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

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

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

Calendar.computeTime介绍

[英]Computes time from the Calendar fields.
[中]从日历字段计算时间。

代码示例

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

  1. /**
  2. * Returns the time represented by this {@code Calendar}, recomputing the time from its
  3. * fields if necessary.
  4. *
  5. * @throws IllegalArgumentException
  6. * if the time is not set and the time cannot be computed
  7. * from the current field values.
  8. */
  9. public long getTimeInMillis() {
  10. if (!isTimeSet) {
  11. computeTime();
  12. isTimeSet = true;
  13. }
  14. return time;
  15. }

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

  1. /**
  2. * Computes the time from the fields if the time has not already been set.
  3. * Computes the fields from the time if the fields are not already set.
  4. *
  5. * @throws IllegalArgumentException
  6. * if the time is not set and the time cannot be computed
  7. * from the current field values.
  8. */
  9. protected void complete() {
  10. if (!isTimeSet) {
  11. computeTime();
  12. isTimeSet = true;
  13. }
  14. if (!areFieldsSet) {
  15. computeFields();
  16. areFieldsSet = true;
  17. }
  18. }

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

  1. /**
  2. * Recomputes the time and updates the status fields isTimeSet
  3. * and areFieldsSet. Callers should check isTimeSet and only
  4. * call this method if isTimeSet is false.
  5. */
  6. private void updateTime() {
  7. computeTime();
  8. // The areFieldsSet and areAllFieldsSet values are no longer
  9. // controlled here (as of 1.5).
  10. isTimeSet = true;
  11. }

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

  1. /**
  2. * Recomputes the time and updates the status fields isTimeSet
  3. * and areFieldsSet. Callers should check isTimeSet and only
  4. * call this method if isTimeSet is false.
  5. */
  6. private void updateTime() {
  7. computeTime();
  8. // The areFieldsSet and areAllFieldsSet values are no longer
  9. // controlled here (as of 1.5).
  10. isTimeSet = true;
  11. }

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

  1. /**
  2. * Returns the time represented by this {@code Calendar}, recomputing the time from its
  3. * fields if necessary.
  4. *
  5. * @throws IllegalArgumentException
  6. * if the time is not set and the time cannot be computed
  7. * from the current field values.
  8. */
  9. public long getTimeInMillis() {
  10. if (!isTimeSet) {
  11. computeTime();
  12. isTimeSet = true;
  13. }
  14. return time;
  15. }

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

  1. /**
  2. * Returns the time represented by this {@code Calendar}, recomputing the time from its
  3. * fields if necessary.
  4. *
  5. * @throws IllegalArgumentException
  6. * if the time is not set and the time cannot be computed
  7. * from the current field values.
  8. */
  9. public long getTimeInMillis() {
  10. if (!isTimeSet) {
  11. computeTime();
  12. isTimeSet = true;
  13. }
  14. return time;
  15. }

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

  1. /**
  2. * Returns the time represented by this {@code Calendar}, recomputing the time from its
  3. * fields if necessary.
  4. *
  5. * @throws IllegalArgumentException
  6. * if the time is not set and the time cannot be computed
  7. * from the current field values.
  8. */
  9. public long getTimeInMillis() {
  10. if (!isTimeSet) {
  11. computeTime();
  12. isTimeSet = true;
  13. }
  14. return time;
  15. }

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

  1. /**
  2. * Returns the time represented by this {@code Calendar}, recomputing the time from its
  3. * fields if necessary.
  4. *
  5. * @throws IllegalArgumentException if the time is not set and the time cannot be computed
  6. * from the current field values.
  7. */
  8. public long getTimeInMillis() {
  9. if (!isTimeSet) {
  10. computeTime();
  11. isTimeSet = true;
  12. }
  13. return time;
  14. }

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

  1. /**
  2. * Returns the time represented by this {@code Calendar}, recomputing the time from its
  3. * fields if necessary.
  4. *
  5. * @throws IllegalArgumentException
  6. * if the time is not set and the time cannot be computed
  7. * from the current field values.
  8. */
  9. public long getTimeInMillis() {
  10. if (!isTimeSet) {
  11. computeTime();
  12. isTimeSet = true;
  13. }
  14. return time;
  15. }

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

  1. /**
  2. * Returns the time represented by this {@code Calendar}, recomputing the time from its
  3. * fields if necessary.
  4. *
  5. * @throws IllegalArgumentException
  6. * if the time is not set and the time cannot be computed
  7. * from the current field values.
  8. */
  9. public long getTimeInMillis() {
  10. if (!isTimeSet) {
  11. computeTime();
  12. isTimeSet = true;
  13. }
  14. return time;
  15. }

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

  1. /**
  2. * Returns the time represented by this {@code Calendar}, recomputing the time from its
  3. * fields if necessary.
  4. *
  5. * @throws IllegalArgumentException
  6. * if the time is not set and the time cannot be computed
  7. * from the current field values.
  8. */
  9. public long getTimeInMillis() {
  10. if (!isTimeSet) {
  11. computeTime();
  12. isTimeSet = true;
  13. }
  14. return time;
  15. }

代码示例来源:origin: stackoverflow.com

  1. Calendar c = Calendar.getInstance();
  2. c.set(Calendar.DATE, c.get(Calendar.DATE) - 1);
  3. c.computeTime(); // Make sure getTime returns the updated time

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

  1. /**
  2. * Computes the time from the fields if the time has not already been set.
  3. * Computes the fields from the time if the fields are not already set.
  4. *
  5. * @throws IllegalArgumentException
  6. * if the time is not set and the time cannot be computed
  7. * from the current field values.
  8. */
  9. protected void complete() {
  10. if (!isTimeSet) {
  11. computeTime();
  12. isTimeSet = true;
  13. }
  14. if (!areFieldsSet) {
  15. computeFields();
  16. areFieldsSet = true;
  17. }
  18. }

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

  1. /**
  2. * Computes the time from the fields if the time has not already been set.
  3. * Computes the fields from the time if the fields are not already set.
  4. *
  5. * @throws IllegalArgumentException if the time is not set and the time cannot be computed
  6. * from the current field values.
  7. */
  8. protected void complete() {
  9. if (!isTimeSet) {
  10. computeTime();
  11. isTimeSet = true;
  12. }
  13. if (!areFieldsSet) {
  14. computeFields();
  15. areFieldsSet = true;
  16. }
  17. }

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

  1. /**
  2. * Computes the time from the fields if the time has not already been set.
  3. * Computes the fields from the time if the fields are not already set.
  4. *
  5. * @throws IllegalArgumentException
  6. * if the time is not set and the time cannot be computed
  7. * from the current field values.
  8. */
  9. protected void complete() {
  10. if (!isTimeSet) {
  11. computeTime();
  12. isTimeSet = true;
  13. }
  14. if (!areFieldsSet) {
  15. computeFields();
  16. areFieldsSet = true;
  17. }
  18. }

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

  1. /**
  2. * Computes the time from the fields if the time has not already been set.
  3. * Computes the fields from the time if the fields are not already set.
  4. *
  5. * @throws IllegalArgumentException
  6. * if the time is not set and the time cannot be computed
  7. * from the current field values.
  8. */
  9. protected void complete() {
  10. if (!isTimeSet) {
  11. computeTime();
  12. isTimeSet = true;
  13. }
  14. if (!areFieldsSet) {
  15. computeFields();
  16. areFieldsSet = true;
  17. }
  18. }

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

  1. /**
  2. * Computes the time from the fields if the time has not already been set.
  3. * Computes the fields from the time if the fields are not already set.
  4. *
  5. * @throws IllegalArgumentException
  6. * if the time is not set and the time cannot be computed
  7. * from the current field values.
  8. */
  9. protected void complete() {
  10. if (!isTimeSet) {
  11. computeTime();
  12. isTimeSet = true;
  13. }
  14. if (!areFieldsSet) {
  15. computeFields();
  16. areFieldsSet = true;
  17. }
  18. }

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

  1. /**
  2. * Computes the time from the fields if the time has not already been set.
  3. * Computes the fields from the time if the fields are not already set.
  4. *
  5. * @throws IllegalArgumentException
  6. * if the time is not set and the time cannot be computed
  7. * from the current field values.
  8. */
  9. protected void complete() {
  10. if (!isTimeSet) {
  11. computeTime();
  12. isTimeSet = true;
  13. }
  14. if (!areFieldsSet) {
  15. computeFields();
  16. areFieldsSet = true;
  17. }
  18. }

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

  1. /**
  2. * Computes the time from the fields if the time has not already been set.
  3. * Computes the fields from the time if the fields are not already set.
  4. *
  5. * @throws IllegalArgumentException
  6. * if the time is not set and the time cannot be computed
  7. * from the current field values.
  8. */
  9. protected void complete() {
  10. if (!isTimeSet) {
  11. computeTime();
  12. isTimeSet = true;
  13. }
  14. if (!areFieldsSet) {
  15. computeFields();
  16. areFieldsSet = true;
  17. }
  18. }

相关文章