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

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

本文整理了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

/**
 * Returns the time represented by this {@code Calendar}, recomputing the time from its
 * fields if necessary.
 *
 * @throws IllegalArgumentException
 *                if the time is not set and the time cannot be computed
 *                from the current field values.
 */
public long getTimeInMillis() {
  if (!isTimeSet) {
    computeTime();
    isTimeSet = true;
  }
  return time;
}

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

/**
 * Computes the time from the fields if the time has not already been set.
 * Computes the fields from the time if the fields are not already set.
 *
 * @throws IllegalArgumentException
 *                if the time is not set and the time cannot be computed
 *                from the current field values.
 */
protected void complete() {
  if (!isTimeSet) {
    computeTime();
    isTimeSet = true;
  }
  if (!areFieldsSet) {
    computeFields();
    areFieldsSet = true;
  }
}

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

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

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

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

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

/**
 * Returns the time represented by this {@code Calendar}, recomputing the time from its
 * fields if necessary.
 *
 * @throws IllegalArgumentException
 *                if the time is not set and the time cannot be computed
 *                from the current field values.
 */
public long getTimeInMillis() {
  if (!isTimeSet) {
    computeTime();
    isTimeSet = true;
  }
  return time;
}

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

/**
 * Returns the time represented by this {@code Calendar}, recomputing the time from its
 * fields if necessary.
 *
 * @throws IllegalArgumentException
 *                if the time is not set and the time cannot be computed
 *                from the current field values.
 */
public long getTimeInMillis() {
  if (!isTimeSet) {
    computeTime();
    isTimeSet = true;
  }
  return time;
}

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

/**
 * Returns the time represented by this {@code Calendar}, recomputing the time from its
 * fields if necessary.
 *
 * @throws IllegalArgumentException
 *                if the time is not set and the time cannot be computed
 *                from the current field values.
 */
public long getTimeInMillis() {
  if (!isTimeSet) {
    computeTime();
    isTimeSet = true;
  }
  return time;
}

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

/**
 * Returns the time represented by this {@code Calendar}, recomputing the time from its
 * fields if necessary.
 *
 * @throws IllegalArgumentException if the time is not set and the time cannot be computed
 *                                  from the current field values.
 */
public long getTimeInMillis() {
  if (!isTimeSet) {
    computeTime();
    isTimeSet = true;
  }
  return time;
}

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

/**
 * Returns the time represented by this {@code Calendar}, recomputing the time from its
 * fields if necessary.
 *
 * @throws IllegalArgumentException
 *                if the time is not set and the time cannot be computed
 *                from the current field values.
 */
public long getTimeInMillis() {
  if (!isTimeSet) {
    computeTime();
    isTimeSet = true;
  }
  return time;
}

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

/**
 * Returns the time represented by this {@code Calendar}, recomputing the time from its
 * fields if necessary.
 *
 * @throws IllegalArgumentException
 *                if the time is not set and the time cannot be computed
 *                from the current field values.
 */
public long getTimeInMillis() {
  if (!isTimeSet) {
    computeTime();
    isTimeSet = true;
  }
  return time;
}

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

/**
 * Returns the time represented by this {@code Calendar}, recomputing the time from its
 * fields if necessary.
 *
 * @throws IllegalArgumentException
 *                if the time is not set and the time cannot be computed
 *                from the current field values.
 */
public long getTimeInMillis() {
  if (!isTimeSet) {
    computeTime();
    isTimeSet = true;
  }
  return time;
}

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

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

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

/**
 * Computes the time from the fields if the time has not already been set.
 * Computes the fields from the time if the fields are not already set.
 *
 * @throws IllegalArgumentException
 *                if the time is not set and the time cannot be computed
 *                from the current field values.
 */
protected void complete() {
  if (!isTimeSet) {
    computeTime();
    isTimeSet = true;
  }
  if (!areFieldsSet) {
    computeFields();
    areFieldsSet = true;
  }
}

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

/**
 * Computes the time from the fields if the time has not already been set.
 * Computes the fields from the time if the fields are not already set.
 *
 * @throws IllegalArgumentException if the time is not set and the time cannot be computed
 *                                  from the current field values.
 */
protected void complete() {
  if (!isTimeSet) {
    computeTime();
    isTimeSet = true;
  }
  if (!areFieldsSet) {
    computeFields();
    areFieldsSet = true;
  }
}

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

/**
 * Computes the time from the fields if the time has not already been set.
 * Computes the fields from the time if the fields are not already set.
 *
 * @throws IllegalArgumentException
 *                if the time is not set and the time cannot be computed
 *                from the current field values.
 */
protected void complete() {
  if (!isTimeSet) {
    computeTime();
    isTimeSet = true;
  }
  if (!areFieldsSet) {
    computeFields();
    areFieldsSet = true;
  }
}

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

/**
 * Computes the time from the fields if the time has not already been set.
 * Computes the fields from the time if the fields are not already set.
 *
 * @throws IllegalArgumentException
 *                if the time is not set and the time cannot be computed
 *                from the current field values.
 */
protected void complete() {
  if (!isTimeSet) {
    computeTime();
    isTimeSet = true;
  }
  if (!areFieldsSet) {
    computeFields();
    areFieldsSet = true;
  }
}

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

/**
 * Computes the time from the fields if the time has not already been set.
 * Computes the fields from the time if the fields are not already set.
 *
 * @throws IllegalArgumentException
 *                if the time is not set and the time cannot be computed
 *                from the current field values.
 */
protected void complete() {
  if (!isTimeSet) {
    computeTime();
    isTimeSet = true;
  }
  if (!areFieldsSet) {
    computeFields();
    areFieldsSet = true;
  }
}

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

/**
 * Computes the time from the fields if the time has not already been set.
 * Computes the fields from the time if the fields are not already set.
 *
 * @throws IllegalArgumentException
 *                if the time is not set and the time cannot be computed
 *                from the current field values.
 */
protected void complete() {
  if (!isTimeSet) {
    computeTime();
    isTimeSet = true;
  }
  if (!areFieldsSet) {
    computeFields();
    areFieldsSet = true;
  }
}

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

/**
 * Computes the time from the fields if the time has not already been set.
 * Computes the fields from the time if the fields are not already set.
 *
 * @throws IllegalArgumentException
 *                if the time is not set and the time cannot be computed
 *                from the current field values.
 */
protected void complete() {
  if (!isTimeSet) {
    computeTime();
    isTimeSet = true;
  }
  if (!areFieldsSet) {
    computeFields();
    areFieldsSet = true;
  }
}

相关文章