gpt4 book ai didi

cesiumlanguagewriter.YearMonthDay.compareTo()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 14:17:31 27 4
gpt4 key购买 nike

本文整理了Java中cesiumlanguagewriter.YearMonthDay.compareTo()方法的一些代码示例,展示了YearMonthDay.compareTo()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YearMonthDay.compareTo()方法的具体详情如下:
包路径:cesiumlanguagewriter.YearMonthDay
类名称:YearMonthDay
方法名:compareTo

YearMonthDay.compareTo介绍

[英]Compares this instance with another instance of the same type.
[中]将此实例与同类型的另一个实例进行比较。

代码示例

代码示例来源:origin: AnalyticalGraphicsInc/czml-writer

/**
*  
Returns {@code true} if {@code left} is greater than or equal to {@code right}.



* @param left The instance to compare to {@code right}.
* @param right The instance to compare to {@code left}.
* @return 
{@code true} if {@code left} is greater than or equal to {@code right}; otherwise, {@code false}.

*/
@CS2JInfo("This method implements the functionality of the overloaded operator: 'System.Boolean >=(YearMonthDay,YearMonthDay)'")
public static boolean greaterThanOrEqual(@Nonnull YearMonthDay left, @Nonnull YearMonthDay right) {
  return left.compareTo(right) >= 0;
}

代码示例来源:origin: AnalyticalGraphicsInc/czml-writer

/**
*  
Returns {@code true} if {@code left} is less than {@code right}.



* @param left The instance to compare to {@code right}.
* @param right The instance to compare to {@code left}.
* @return 
{@code true} if {@code left} is less than {@code right}; otherwise, {@code false}.

*/
@CS2JInfo("This method implements the functionality of the overloaded operator: 'System.Boolean <(YearMonthDay,YearMonthDay)'")
public static boolean lessThan(@Nonnull YearMonthDay left, @Nonnull YearMonthDay right) {
  return left.compareTo(right) < 0;
}

代码示例来源:origin: AnalyticalGraphicsInc/czml-writer

/**
*  
Returns {@code true} if {@code left} is less than or equal to {@code right}.



* @param left The instance to compare to {@code right}.
* @param right The instance to compare to {@code left}.
* @return 
{@code true} if {@code left} is less than or equal to {@code right}; otherwise, {@code false}.

*/
@CS2JInfo("This method implements the functionality of the overloaded operator: 'System.Boolean <=(YearMonthDay,YearMonthDay)'")
public static boolean lessThanOrEqual(@Nonnull YearMonthDay left, @Nonnull YearMonthDay right) {
  return left.compareTo(right) <= 0;
}

代码示例来源:origin: AnalyticalGraphicsInc/czml-writer

/**
*  
Returns {@code true} if {@code left} is greater than {@code right}.



* @param left The instance to compare to {@code right}.
* @param right The instance to compare to {@code left}.
* @return 
{@code true} if {@code left} is greater than {@code right}; otherwise, {@code false}.

*/
@CS2JInfo("This method implements the functionality of the overloaded operator: 'System.Boolean >(YearMonthDay,YearMonthDay)'")
public static boolean greaterThan(@Nonnull YearMonthDay left, @Nonnull YearMonthDay right) {
  return left.compareTo(right) > 0;
}

代码示例来源:origin: AnalyticalGraphicsInc/czml-writer

int result = m_yearMonthDay.compareTo(other.m_yearMonthDay);
if (result != 0) {
  return result;

代码示例来源:origin: AnalyticalGraphicsInc/czml-writer

Assert.assertTrue(first.equalsType(second));
Assert.assertTrue(second.equalsType(first));
Assert.assertEquals((int) 0, (int) first.compareTo(second));
Assert.assertEquals((int) 0, (int) second.compareTo(first));
second = new YearMonthDay(2001, 1, 1);
AssertHelper.assertNotEqual(first, second);
Assert.assertFalse(first.equalsType(second));
Assert.assertFalse(second.equalsType(first));
AssertHelper.assertNotEqual(0, first.compareTo(second));
AssertHelper.assertNotEqual(0, second.compareTo(first));
second = new YearMonthDay(2000, 2, 1);
AssertHelper.assertNotEqual(first, second);
Assert.assertFalse(first.equalsType(second));
Assert.assertFalse(second.equalsType(first));
AssertHelper.assertNotEqual(0, first.compareTo(second));
AssertHelper.assertNotEqual(0, second.compareTo(first));
second = new YearMonthDay(2000, 1, 2);
AssertHelper.assertNotEqual(first, second);
Assert.assertFalse(first.equalsType(second));
Assert.assertFalse(second.equalsType(first));
AssertHelper.assertNotEqual(0, first.compareTo(second));
AssertHelper.assertNotEqual(0, second.compareTo(first));
AssertHelper.assertNotEqual(first, 5);

代码示例来源:origin: AnalyticalGraphicsInc/czml-writer

/**
*  
Tests the CompareTo methods and the comparison operators.

*/
@Test
public final void testComparisons() {
  YearMonthDay ymd1 = new YearMonthDay(2006, 3, 14);
  YearMonthDay ymd2 = new YearMonthDay(2006, 3, 14);
  YearMonthDay ymd3 = new YearMonthDay(2006, 5, 26);
  Object ymd4 = new YearMonthDay(2004, 2, 21);
  Assert.assertTrue(YearMonthDay.equals(ymd1, ymd2));
  Assert.assertTrue(YearMonthDay.equals(ymd2, ymd1));
  Assert.assertTrue(YearMonthDay.notEquals(ymd1, ymd3));
  Assert.assertTrue(YearMonthDay.greaterThanOrEqual(ymd1, ymd2));
  Assert.assertTrue(YearMonthDay.lessThanOrEqual(ymd1, ymd2));
  Assert.assertTrue(ymd1.compareTo(ymd2) == 0);
  Assert.assertTrue(YearMonthDay.lessThan(ymd2, ymd3));
  Assert.assertTrue(YearMonthDay.lessThanOrEqual(ymd2, ymd3));
  Assert.assertTrue(YearMonthDay.greaterThan(ymd3, ymd2));
  Assert.assertTrue(YearMonthDay.greaterThanOrEqual(ymd3, ymd2));
  AssertHelper.assertNotEqual(ymd1, ymd4);
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com