java.util.Calendar.getGreatestMinimum()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(286)

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

Calendar.getGreatestMinimum介绍

[英]Returns the greatest minimum value of the given field. This is the biggest value that getActualMinimum can return for any possible time.
[中]返回给定字段的最大最小值。这是getActualMinimum在任何可能的时间都可以返回的最大值。

代码示例

代码示例来源:origin: robovm/robovm

  1. /**
  2. * Returns the minimum value of the given field for the current date.
  3. */
  4. public int getActualMinimum(int field) {
  5. int value, next;
  6. if (getMinimum(field) == (next = getGreatestMinimum(field))) {
  7. return next;
  8. }
  9. complete();
  10. long orgTime = time;
  11. set(field, next);
  12. do {
  13. value = next;
  14. roll(field, false);
  15. next = get(field);
  16. } while (next < value);
  17. time = orgTime;
  18. areFieldsSet = false;
  19. return value;
  20. }

代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel

  1. /**
  2. * Method reduce_constant_length_field
  3. */
  4. protected static void reduce_constant_length_field(
  5. int field, Calendar start, Calendar candidate) {
  6. if ((start.getMaximum(field) != start.getLeastMaximum(field)) ||
  7. (start.getMinimum(field) != start.getGreatestMinimum(field))) {
  8. throw new IllegalArgumentException("Not a constant length field");
  9. }
  10. int delta = start.get(field) - candidate.get(field);
  11. if (delta > 0) {
  12. int fieldLength =
  13. start.getMaximum(field) - start.getMinimum(field) + 1;
  14. delta -= fieldLength;
  15. }
  16. candidate.add(field, delta);
  17. }

代码示例来源:origin: com.aoindustries/ao-lang

  1. @Override
  2. public int getGreatestMinimum(int field) {
  3. return wrapped.getGreatestMinimum(field);
  4. }

代码示例来源:origin: at.bestsolution.eclipse/com.ibm.icu.base

  1. /**
  2. * Returns the highest minimum value for the given field if varies.
  3. * Otherwise same as getMinimum(). For Gregorian, no difference.
  4. * @param field the given time field.
  5. * @return the highest minimum value for the given time field.
  6. * @stable ICU 2.0
  7. */
  8. public final int getGreatestMinimum(int field) {
  9. return calendar.getGreatestMinimum(getJDKField(field));
  10. }

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/com.ibm.icu.base

  1. /**
  2. * Returns the highest minimum value for the given field if varies.
  3. * Otherwise same as getMinimum(). For Gregorian, no difference.
  4. * @param field the given time field.
  5. * @return the highest minimum value for the given time field.
  6. * @stable ICU 2.0
  7. */
  8. public final int getGreatestMinimum(int field) {
  9. return calendar.getGreatestMinimum(getJDKField(field));
  10. }

代码示例来源:origin: EvoSuite/evosuite

  1. @Override
  2. public int getGreatestMinimum(int field) {
  3. Capturer.capture(Instrumenter.CAPTURE_ID_JAVA_UTIL_CALENDAR, this, "getGreatestMinimum", "(I)V", new Object[] {field});
  4. int ret = wrappedCalendar.getGreatestMinimum(field);
  5. Capturer.enable(Instrumenter.CAPTURE_ID_JAVA_UTIL_CALENDAR, this, ret);
  6. return ret;
  7. }

代码示例来源:origin: jtulach/bck2brwsr

  1. int fieldValue = getGreatestMinimum(field);
  2. int endValue = getMinimum(field);

代码示例来源:origin: org.apidesign.bck2brwsr/emul

  1. int fieldValue = getGreatestMinimum(field);
  2. int endValue = getMinimum(field);

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

  1. /**
  2. * Returns the minimum value of the given field for the current date.
  3. */
  4. public int getActualMinimum(int field) {
  5. int value, next;
  6. if (getMinimum(field) == (next = getGreatestMinimum(field))) {
  7. return next;
  8. }
  9. complete();
  10. long orgTime = time;
  11. set(field, next);
  12. do {
  13. value = next;
  14. roll(field, false);
  15. next = get(field);
  16. } while (next < value);
  17. time = orgTime;
  18. areFieldsSet = false;
  19. return value;
  20. }

代码示例来源:origin: com.jtransc/jtransc-rt

  1. /**
  2. * Returns the minimum value of the given field for the current date.
  3. */
  4. public int getActualMinimum(int field) {
  5. int value, next;
  6. if (getMinimum(field) == (next = getGreatestMinimum(field))) {
  7. return next;
  8. }
  9. complete();
  10. long orgTime = time;
  11. set(field, next);
  12. do {
  13. value = next;
  14. roll(field, false);
  15. next = get(field);
  16. } while (next < value);
  17. time = orgTime;
  18. areFieldsSet = false;
  19. return value;
  20. }

代码示例来源:origin: com.bugvm/bugvm-rt

  1. /**
  2. * Returns the minimum value of the given field for the current date.
  3. */
  4. public int getActualMinimum(int field) {
  5. int value, next;
  6. if (getMinimum(field) == (next = getGreatestMinimum(field))) {
  7. return next;
  8. }
  9. complete();
  10. long orgTime = time;
  11. set(field, next);
  12. do {
  13. value = next;
  14. roll(field, false);
  15. next = get(field);
  16. } while (next < value);
  17. time = orgTime;
  18. areFieldsSet = false;
  19. return value;
  20. }

代码示例来源:origin: ibinti/bugvm

  1. /**
  2. * Returns the minimum value of the given field for the current date.
  3. */
  4. public int getActualMinimum(int field) {
  5. int value, next;
  6. if (getMinimum(field) == (next = getGreatestMinimum(field))) {
  7. return next;
  8. }
  9. complete();
  10. long orgTime = time;
  11. set(field, next);
  12. do {
  13. value = next;
  14. roll(field, false);
  15. next = get(field);
  16. } while (next < value);
  17. time = orgTime;
  18. areFieldsSet = false;
  19. return value;
  20. }

代码示例来源:origin: MobiVM/robovm

  1. /**
  2. * Returns the minimum value of the given field for the current date.
  3. */
  4. public int getActualMinimum(int field) {
  5. int value, next;
  6. if (getMinimum(field) == (next = getGreatestMinimum(field))) {
  7. return next;
  8. }
  9. complete();
  10. long orgTime = time;
  11. set(field, next);
  12. do {
  13. value = next;
  14. roll(field, false);
  15. next = get(field);
  16. } while (next < value);
  17. time = orgTime;
  18. areFieldsSet = false;
  19. return value;
  20. }

代码示例来源:origin: com.gluonhq/robovm-rt

  1. /**
  2. * Returns the minimum value of the given field for the current date.
  3. */
  4. public int getActualMinimum(int field) {
  5. int value, next;
  6. if (getMinimum(field) == (next = getGreatestMinimum(field))) {
  7. return next;
  8. }
  9. complete();
  10. long orgTime = time;
  11. set(field, next);
  12. do {
  13. value = next;
  14. roll(field, false);
  15. next = get(field);
  16. } while (next < value);
  17. time = orgTime;
  18. areFieldsSet = false;
  19. return value;
  20. }

代码示例来源:origin: FlexoVM/flexovm

  1. /**
  2. * Returns the minimum value of the given field for the current date.
  3. */
  4. public int getActualMinimum(int field) {
  5. int value, next;
  6. if (getMinimum(field) == (next = getGreatestMinimum(field))) {
  7. return next;
  8. }
  9. complete();
  10. long orgTime = time;
  11. set(field, next);
  12. do {
  13. value = next;
  14. roll(field, false);
  15. next = get(field);
  16. } while (next < value);
  17. time = orgTime;
  18. areFieldsSet = false;
  19. return value;
  20. }

代码示例来源:origin: com.liferay.portal/portal-kernel

  1. /**
  2. * Method reduce_constant_length_field
  3. *
  4. *
  5. * @param field
  6. * @param start
  7. * @param candidate
  8. *
  9. */
  10. protected static void reduce_constant_length_field(int field,
  11. Calendar start,
  12. Calendar candidate) {
  13. if ((start.getMaximum(field) != start.getLeastMaximum(field))
  14. || (start.getMinimum(field) != start.getGreatestMinimum(field))) {
  15. throw new IllegalArgumentException("Not a constant length field");
  16. }
  17. int fieldLength = (start.getMaximum(field) - start.getMinimum(field)
  18. + 1);
  19. int delta = start.get(field) - candidate.get(field);
  20. if (delta > 0) {
  21. delta -= fieldLength;
  22. }
  23. candidate.add(field, delta);
  24. }

代码示例来源:origin: com.liferay.portal/portal-kernel

  1. /**
  2. * Method reduce_constant_length_field
  3. *
  4. *
  5. * @param field
  6. * @param start
  7. * @param candidate
  8. *
  9. */
  10. protected static void reduce_constant_length_field(int field,
  11. Calendar start,
  12. Calendar candidate) {
  13. if ((start.getMaximum(field) != start.getLeastMaximum(field))
  14. || (start.getMinimum(field) != start.getGreatestMinimum(field))) {
  15. throw new IllegalArgumentException("Not a constant length field");
  16. }
  17. int fieldLength = (start.getMaximum(field) - start.getMinimum(field)
  18. + 1);
  19. int delta = start.get(field) - candidate.get(field);
  20. if (delta > 0) {
  21. delta -= fieldLength;
  22. }
  23. candidate.add(field, delta);
  24. }

代码示例来源:origin: ThreeTen/threetenbp

  1. return ValueRange.of(jcal.getMinimum(Calendar.MONTH) + 1, jcal.getGreatestMinimum(Calendar.MONTH) + 1,
  2. jcal.getLeastMaximum(Calendar.MONTH) + 1, jcal.getMaximum(Calendar.MONTH) + 1);
  3. case DAY_OF_YEAR: {

代码示例来源:origin: org.threeten/threetenbp

  1. return ValueRange.of(jcal.getMinimum(Calendar.MONTH) + 1, jcal.getGreatestMinimum(Calendar.MONTH) + 1,
  2. jcal.getLeastMaximum(Calendar.MONTH) + 1, jcal.getMaximum(Calendar.MONTH) + 1);
  3. case DAY_OF_YEAR: {

代码示例来源:origin: com.github.seratch/java-time-backport

  1. return ValueRange.of(jcal.getMinimum(Calendar.MONTH) + 1, jcal.getGreatestMinimum(Calendar.MONTH) + 1,
  2. jcal.getLeastMaximum(Calendar.MONTH) + 1, jcal.getMaximum(Calendar.MONTH) + 1);
  3. case DAY_OF_YEAR: {

相关文章