org.joda.time.YearMonthDay.indexOfSupported()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(12.3k)|赞(0)|评价(0)|浏览(129)

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

YearMonthDay.indexOfSupported介绍

暂无

代码示例

代码示例来源:origin: joda-time/joda-time

  1. /**
  2. * Gets the property object for the specified type, which contains
  3. * many useful methods.
  4. *
  5. * @param type the field type to get the property for
  6. * @return the property object
  7. * @throws IllegalArgumentException if the field is null or unsupported
  8. */
  9. public Property property(DateTimeFieldType type) {
  10. return new Property(this, indexOfSupported(type));
  11. }

代码示例来源:origin: JodaOrg/joda-time

  1. /**
  2. * Gets the property object for the specified type, which contains
  3. * many useful methods.
  4. *
  5. * @param type the field type to get the property for
  6. * @return the property object
  7. * @throws IllegalArgumentException if the field is null or unsupported
  8. */
  9. public Property property(DateTimeFieldType type) {
  10. return new Property(this, indexOfSupported(type));
  11. }

代码示例来源:origin: joda-time/joda-time

  1. /**
  2. * Returns a copy of this date with the value of the specified field increased.
  3. * <p>
  4. * If the addition is zero, then <code>this</code> is returned.
  5. * <p>
  6. * These three lines are equivalent:
  7. * <pre>
  8. * YearMonthDay added = ymd.withFieldAdded(DurationFieldType.days(), 6);
  9. * YearMonthDay added = ymd.plusDays(6);
  10. * YearMonthDay added = ymd.dayOfMonth().addToCopy(6);
  11. * </pre>
  12. *
  13. * @param fieldType the field type to add to, not null
  14. * @param amount the amount to add
  15. * @return a copy of this instance with the field updated
  16. * @throws IllegalArgumentException if the value is null or invalid
  17. * @throws ArithmeticException if the new datetime exceeds the capacity
  18. */
  19. public YearMonthDay withFieldAdded(DurationFieldType fieldType, int amount) {
  20. int index = indexOfSupported(fieldType);
  21. if (amount == 0) {
  22. return this;
  23. }
  24. int[] newValues = getValues();
  25. newValues = getField(index).add(this, index, newValues, amount);
  26. return new YearMonthDay(this, newValues);
  27. }

代码示例来源:origin: JodaOrg/joda-time

  1. /**
  2. * Returns a copy of this date with the value of the specified field increased.
  3. * <p>
  4. * If the addition is zero, then <code>this</code> is returned.
  5. * <p>
  6. * These three lines are equivalent:
  7. * <pre>
  8. * YearMonthDay added = ymd.withFieldAdded(DurationFieldType.days(), 6);
  9. * YearMonthDay added = ymd.plusDays(6);
  10. * YearMonthDay added = ymd.dayOfMonth().addToCopy(6);
  11. * </pre>
  12. *
  13. * @param fieldType the field type to add to, not null
  14. * @param amount the amount to add
  15. * @return a copy of this instance with the field updated
  16. * @throws IllegalArgumentException if the value is null or invalid
  17. * @throws ArithmeticException if the new datetime exceeds the capacity
  18. */
  19. public YearMonthDay withFieldAdded(DurationFieldType fieldType, int amount) {
  20. int index = indexOfSupported(fieldType);
  21. if (amount == 0) {
  22. return this;
  23. }
  24. int[] newValues = getValues();
  25. newValues = getField(index).add(this, index, newValues, amount);
  26. return new YearMonthDay(this, newValues);
  27. }

代码示例来源:origin: joda-time/joda-time

  1. /**
  2. * Returns a copy of this date with the specified field set to a new value.
  3. * <p>
  4. * For example, if the field type is <code>dayOfMonth</code> then the day
  5. * would be changed in the returned instance.
  6. * <p>
  7. * These three lines are equivalent:
  8. * <pre>
  9. * YearMonthDay updated = ymd.withField(DateTimeFieldType.dayOfMonth(), 6);
  10. * YearMonthDay updated = ymd.dayOfMonth().setCopy(6);
  11. * YearMonthDay updated = ymd.property(DateTimeFieldType.dayOfMonth()).setCopy(6);
  12. * </pre>
  13. *
  14. * @param fieldType the field type to set, not null
  15. * @param value the value to set
  16. * @return a copy of this instance with the field set
  17. * @throws IllegalArgumentException if the value is null or invalid
  18. */
  19. public YearMonthDay withField(DateTimeFieldType fieldType, int value) {
  20. int index = indexOfSupported(fieldType);
  21. if (value == getValue(index)) {
  22. return this;
  23. }
  24. int[] newValues = getValues();
  25. newValues = getField(index).set(this, index, newValues, value);
  26. return new YearMonthDay(this, newValues);
  27. }

代码示例来源:origin: JodaOrg/joda-time

  1. /**
  2. * Returns a copy of this date with the specified field set to a new value.
  3. * <p>
  4. * For example, if the field type is <code>dayOfMonth</code> then the day
  5. * would be changed in the returned instance.
  6. * <p>
  7. * These three lines are equivalent:
  8. * <pre>
  9. * YearMonthDay updated = ymd.withField(DateTimeFieldType.dayOfMonth(), 6);
  10. * YearMonthDay updated = ymd.dayOfMonth().setCopy(6);
  11. * YearMonthDay updated = ymd.property(DateTimeFieldType.dayOfMonth()).setCopy(6);
  12. * </pre>
  13. *
  14. * @param fieldType the field type to set, not null
  15. * @param value the value to set
  16. * @return a copy of this instance with the field set
  17. * @throws IllegalArgumentException if the value is null or invalid
  18. */
  19. public YearMonthDay withField(DateTimeFieldType fieldType, int value) {
  20. int index = indexOfSupported(fieldType);
  21. if (value == getValue(index)) {
  22. return this;
  23. }
  24. int[] newValues = getValues();
  25. newValues = getField(index).set(this, index, newValues, value);
  26. return new YearMonthDay(this, newValues);
  27. }

代码示例来源:origin: camunda/camunda-bpm-platform

  1. /**
  2. * Gets the property object for the specified type, which contains
  3. * many useful methods.
  4. *
  5. * @param type the field type to get the property for
  6. * @return the property object
  7. * @throws IllegalArgumentException if the field is null or unsupported
  8. */
  9. public Property property(DateTimeFieldType type) {
  10. return new Property(this, indexOfSupported(type));
  11. }

代码示例来源:origin: camunda/camunda-bpm-platform

  1. /**
  2. * Returns a copy of this date with the value of the specified field increased.
  3. * <p>
  4. * If the addition is zero, then <code>this</code> is returned.
  5. * <p>
  6. * These three lines are equivalent:
  7. * <pre>
  8. * YearMonthDay added = ymd.withFieldAdded(DurationFieldType.days(), 6);
  9. * YearMonthDay added = ymd.plusDays(6);
  10. * YearMonthDay added = ymd.dayOfMonth().addToCopy(6);
  11. * </pre>
  12. *
  13. * @param fieldType the field type to add to, not null
  14. * @param amount the amount to add
  15. * @return a copy of this instance with the field updated
  16. * @throws IllegalArgumentException if the value is null or invalid
  17. * @throws ArithmeticException if the new datetime exceeds the capacity
  18. */
  19. public YearMonthDay withFieldAdded(DurationFieldType fieldType, int amount) {
  20. int index = indexOfSupported(fieldType);
  21. if (amount == 0) {
  22. return this;
  23. }
  24. int[] newValues = getValues();
  25. newValues = getField(index).add(this, index, newValues, amount);
  26. return new YearMonthDay(this, newValues);
  27. }

代码示例来源:origin: camunda/camunda-bpm-platform

  1. /**
  2. * Returns a copy of this date with the specified field set to a new value.
  3. * <p>
  4. * For example, if the field type is <code>dayOfMonth</code> then the day
  5. * would be changed in the returned instance.
  6. * <p>
  7. * These three lines are equivalent:
  8. * <pre>
  9. * YearMonthDay updated = ymd.withField(DateTimeFieldType.dayOfMonth(), 6);
  10. * YearMonthDay updated = ymd.dayOfMonth().setCopy(6);
  11. * YearMonthDay updated = ymd.property(DateTimeFieldType.dayOfMonth()).setCopy(6);
  12. * </pre>
  13. *
  14. * @param fieldType the field type to set, not null
  15. * @param value the value to set
  16. * @return a copy of this instance with the field set
  17. * @throws IllegalArgumentException if the value is null or invalid
  18. */
  19. public YearMonthDay withField(DateTimeFieldType fieldType, int value) {
  20. int index = indexOfSupported(fieldType);
  21. if (value == getValue(index)) {
  22. return this;
  23. }
  24. int[] newValues = getValues();
  25. newValues = getField(index).set(this, index, newValues, value);
  26. return new YearMonthDay(this, newValues);
  27. }

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

  1. /**
  2. * Gets the property object for the specified type, which contains
  3. * many useful methods.
  4. *
  5. * @param type the field type to get the property for
  6. * @return the property object
  7. * @throws IllegalArgumentException if the field is null or unsupported
  8. */
  9. public Property property(DateTimeFieldType type) {
  10. return new Property(this, indexOfSupported(type));
  11. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

  1. /**
  2. * Gets the property object for the specified type, which contains
  3. * many useful methods.
  4. *
  5. * @param type the field type to get the property for
  6. * @return the property object
  7. * @throws IllegalArgumentException if the field is null or unsupported
  8. */
  9. public Property property(DateTimeFieldType type) {
  10. return new Property(this, indexOfSupported(type));
  11. }

代码示例来源:origin: redfish64/TinyTravelTracker

  1. /**
  2. * Gets the property object for the specified type, which contains
  3. * many useful methods.
  4. *
  5. * @param type the field type to get the property for
  6. * @return the property object
  7. * @throws IllegalArgumentException if the field is null or unsupported
  8. */
  9. public Property property(DateTimeFieldType type) {
  10. return new Property(this, indexOfSupported(type));
  11. }

代码示例来源:origin: io.virtdata/virtdata-lib-realer

  1. /**
  2. * Gets the property object for the specified type, which contains
  3. * many useful methods.
  4. *
  5. * @param type the field type to get the property for
  6. * @return the property object
  7. * @throws IllegalArgumentException if the field is null or unsupported
  8. */
  9. public Property property(DateTimeFieldType type) {
  10. return new Property(this, indexOfSupported(type));
  11. }

代码示例来源:origin: Nextdoor/bender

  1. /**
  2. * Gets the property object for the specified type, which contains
  3. * many useful methods.
  4. *
  5. * @param type the field type to get the property for
  6. * @return the property object
  7. * @throws IllegalArgumentException if the field is null or unsupported
  8. */
  9. public Property property(DateTimeFieldType type) {
  10. return new Property(this, indexOfSupported(type));
  11. }

代码示例来源:origin: org.joda/com.springsource.org.joda.time

  1. /**
  2. * Gets the property object for the specified type, which contains
  3. * many useful methods.
  4. *
  5. * @param type the field type to get the property for
  6. * @return the property object
  7. * @throws IllegalArgumentException if the field is null or unsupported
  8. */
  9. public Property property(DateTimeFieldType type) {
  10. return new Property(this, indexOfSupported(type));
  11. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. /**
  2. * Gets the property object for the specified type, which contains
  3. * many useful methods.
  4. *
  5. * @param type the field type to get the property for
  6. * @return the property object
  7. * @throws IllegalArgumentException if the field is null or unsupported
  8. */
  9. public Property property(DateTimeFieldType type) {
  10. return new Property(this, indexOfSupported(type));
  11. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.joda-time

  1. /**
  2. * Gets the property object for the specified type, which contains
  3. * many useful methods.
  4. *
  5. * @param type the field type to get the property for
  6. * @return the property object
  7. * @throws IllegalArgumentException if the field is null or unsupported
  8. */
  9. public Property property(DateTimeFieldType type) {
  10. return new Property(this, indexOfSupported(type));
  11. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. /**
  2. * Returns a copy of this date with the value of the specified field increased.
  3. * <p>
  4. * If the addition is zero, then <code>this</code> is returned.
  5. * <p>
  6. * These three lines are equivalent:
  7. * <pre>
  8. * YearMonthDay added = ymd.withFieldAdded(DurationFieldType.days(), 6);
  9. * YearMonthDay added = ymd.plusDays(6);
  10. * YearMonthDay added = ymd.dayOfMonth().addToCopy(6);
  11. * </pre>
  12. *
  13. * @param fieldType the field type to add to, not null
  14. * @param amount the amount to add
  15. * @return a copy of this instance with the field updated
  16. * @throws IllegalArgumentException if the value is null or invalid
  17. * @throws ArithmeticException if the new datetime exceeds the capacity
  18. */
  19. public YearMonthDay withFieldAdded(DurationFieldType fieldType, int amount) {
  20. int index = indexOfSupported(fieldType);
  21. if (amount == 0) {
  22. return this;
  23. }
  24. int[] newValues = getValues();
  25. newValues = getField(index).add(this, index, newValues, amount);
  26. return new YearMonthDay(this, newValues);
  27. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

  1. /**
  2. * Returns a copy of this date with the value of the specified field increased.
  3. * <p>
  4. * If the addition is zero, then <code>this</code> is returned.
  5. * <p>
  6. * These three lines are equivalent:
  7. * <pre>
  8. * YearMonthDay added = ymd.withFieldAdded(DurationFieldType.days(), 6);
  9. * YearMonthDay added = ymd.plusDays(6);
  10. * YearMonthDay added = ymd.dayOfMonth().addToCopy(6);
  11. * </pre>
  12. *
  13. * @param fieldType the field type to add to, not null
  14. * @param amount the amount to add
  15. * @return a copy of this instance with the field updated
  16. * @throws IllegalArgumentException if the value is null or invalid
  17. * @throws ArithmeticException if the new datetime exceeds the capacity
  18. */
  19. public YearMonthDay withFieldAdded(DurationFieldType fieldType, int amount) {
  20. int index = indexOfSupported(fieldType);
  21. if (amount == 0) {
  22. return this;
  23. }
  24. int[] newValues = getValues();
  25. newValues = getField(index).add(this, index, newValues, amount);
  26. return new YearMonthDay(this, newValues);
  27. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

  1. /**
  2. * Returns a copy of this date with the specified field set to a new value.
  3. * <p>
  4. * For example, if the field type is <code>dayOfMonth</code> then the day
  5. * would be changed in the returned instance.
  6. * <p>
  7. * These three lines are equivalent:
  8. * <pre>
  9. * YearMonthDay updated = ymd.withField(DateTimeFieldType.dayOfMonth(), 6);
  10. * YearMonthDay updated = ymd.dayOfMonth().setCopy(6);
  11. * YearMonthDay updated = ymd.property(DateTimeFieldType.dayOfMonth()).setCopy(6);
  12. * </pre>
  13. *
  14. * @param fieldType the field type to set, not null
  15. * @param value the value to set
  16. * @return a copy of this instance with the field set
  17. * @throws IllegalArgumentException if the value is null or invalid
  18. */
  19. public YearMonthDay withField(DateTimeFieldType fieldType, int value) {
  20. int index = indexOfSupported(fieldType);
  21. if (value == getValue(index)) {
  22. return this;
  23. }
  24. int[] newValues = getValues();
  25. newValues = getField(index).set(this, index, newValues, value);
  26. return new YearMonthDay(this, newValues);
  27. }

相关文章