public Period(Temporal temporal, Period period) throws TemporalException { this( temporal, period.getStartGranuleCount(period.getGranularity()), period.getFinishGranuleCount(period.getGranularity()), period.getGranularity()); } // Period
public boolean finishes(Period p2, int granularity) throws TemporalException { return ((getStartGranuleCount(granularity) < p2.getStartGranuleCount(granularity)) && (getFinishGranuleCount(granularity) == p2.getFinishGranuleCount(granularity))); } // finishes
public boolean contains(Period p2, int granularity) throws TemporalException { return (((p2.getStartGranuleCount(granularity) > getStartGranuleCount(granularity)) || (p2.getStartGranuleCount(granularity) == getStartGranuleCount(granularity))) && ((p2.getFinishGranuleCount(granularity) < getFinishGranuleCount(granularity)) || (p2.getFinishGranuleCount(granularity) == getFinishGranuleCount(granularity)))); } // contains
public boolean overlaps(Period p2, int granularity) throws TemporalException { return ((getStartGranuleCount(granularity) <= p2.getStartGranuleCount(granularity)) && (getFinishGranuleCount(granularity) <= p2.getFinishGranuleCount(granularity)) && (getFinishGranuleCount(granularity) >= p2.getStartGranuleCount(granularity))); } // overlaps
public boolean meets(Period p2, int granularity) throws TemporalException { return ((getFinishGranuleCount(granularity) + 1) == p2.getStartGranuleCount(granularity)); } // meets
public boolean starts_before(Period p2, int granularity) throws TemporalException { return getStartGranuleCount(granularity) < p2.getStartGranuleCount(granularity); } // starts_before
public boolean before(Period p2) throws TemporalException { return getFinishGranuleCount(Temporal.FINEST) < p2.getStartGranuleCount(Temporal.FINEST); } // before