com.timeindexing.time
Class AbstractTimeSpecifier

java.lang.Object
  extended bycom.timeindexing.time.AbstractTimeSpecifier
All Implemented Interfaces:
java.lang.Cloneable, TimeSpecifier, Value
Direct Known Subclasses:
Day, EndOfDay, EndOfHour, EndOfMinute, EndOfMonth, EndOfSecond, EndOfWeek, EndOfYear, Hour, Microsecond, Millisecond, Minute, Month, Nanosecond, Now, Second, StartOfDay, StartOfHour, StartOfMinute, StartOfMonth, StartOfSecond, StartOfWeek, StartOfYear, Week, Year

public abstract class AbstractTimeSpecifier
extends java.lang.Object
implements TimeSpecifier

An abstract class for objects that specify some modifier for a Timestamp.


Constructor Summary
AbstractTimeSpecifier()
           
 
Method Summary
 TimeSpecifier afterDoing(TimeSpecifier specfier)
          After doing the specfied TimeSpecifier, do this TimeSpecifier.
 java.lang.Object clone()
          Clone this object.
 TimeDirection getDirection()
          Get the direction.
 long getHowMany()
          Get how many.
 TimeSpecifier getPredecessor()
          Get the predecessor TimeSpecifier.
protected  boolean hasPredecessor()
          Does this TimeSpecifier have a predecessor specfier.
 TimeSpecifier then(TimeSpecifier specfier)
          Do this TimeSpecifier, then do another TimeSpecifier.
 long value()
          Get the value.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.timeindexing.time.TimeSpecifier
instantiate
 

Constructor Detail

AbstractTimeSpecifier

public AbstractTimeSpecifier()
Method Detail

then

public TimeSpecifier then(TimeSpecifier specfier)
Do this TimeSpecifier, then do another TimeSpecifier. This gets more modification. N.B. spec1.then(spec2) == spec2.afterDoing(spec1) spec1.then(spec2).then(spec3) == spec3.afterDoing(spec2.afterDoing(spec1))

Specified by:
then in interface TimeSpecifier

afterDoing

public TimeSpecifier afterDoing(TimeSpecifier specfier)
After doing the specfied TimeSpecifier, do this TimeSpecifier. This gets more modification. N.B. spec1.then(spec2) == spec2.afterDoing(spec1) spec1.then(spec2).then(spec3) == spec3.afterDoing(spec2.afterDoing(spec1))

Specified by:
afterDoing in interface TimeSpecifier

hasPredecessor

protected boolean hasPredecessor()
Does this TimeSpecifier have a predecessor specfier.


clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clone this object.

Throws:
java.lang.CloneNotSupportedException

value

public long value()
Get the value. When TimeDirection is FORWARD_DT, then the value is positive, and when TimeDirection is BACKWARD_DT, then the value is negative.

Specified by:
value in interface TimeSpecifier

getHowMany

public long getHowMany()
Get how many.


getDirection

public TimeDirection getDirection()
Get the direction.


getPredecessor

public TimeSpecifier getPredecessor()
Get the predecessor TimeSpecifier.