Ejemplo n.º 1
0
 /**
  * Gets the values of a period from an interval.
  *
  * @param period the period instant to use
  * @param duration the duration to query
  * @return the values of the period extracted from the duration
  */
 public int[] get(ReadablePeriod period, long duration) {
   int size = period.size();
   int[] values = new int[size];
   if (duration != 0) {
     long current = 0;
     for (int i = 0; i < size; i++) {
       DurationField field = period.getFieldType(i).getField(this);
       if (field.isPrecise()) {
         int value = field.getDifference(duration, current);
         current = field.add(current, value);
         values[i] = value;
       }
     }
   }
   return values;
 }
 public boolean isPrecise() {
   return iTimeField ? iField.isPrecise() : iField.isPrecise() && this.iZone.isFixed();
 }