Пример #1
0
  public Period(Temporal temporal, Instant startInstant, Instant finishInstant)
      throws TemporalException {
    int granularity;

    this.startInstant = new Instant(temporal, startInstant);
    this.finishInstant = new Instant(temporal, finishInstant);

    // Set granularity to finest of both.
    if (startInstant.getGranularity() > finishInstant.getGranularity())
      granularity = startInstant.getGranularity();
    else granularity = finishInstant.getGranularity();

    this.startInstant.setGranularity(granularity);
    this.finishInstant.setGranularity(granularity);

    orderCheck();
  } // Period
Пример #2
0
 public int getGranularity() {
   return startInstant.getGranularity(); // start and finish instant have same granularity.
 } // getGranularity
Пример #3
0
 public Period(Temporal temporal, Instant instant) throws TemporalException {
   this(temporal, instant, instant, instant.getGranularity());
 } // Period
Пример #4
0
 public void setFinishInstant(Instant instant) throws TemporalException {
   finishInstant = new Instant(temporal, instant);
   // Both instants must share same granularity.
   startInstant.setGranularity(instant.getGranularity());
 } /// setFinishInstant