com.ibm.tws.objects.filter
Class TimeRange

java.lang.Object
  extended bycom.ibm.tws.objects.filter.AbstractRange
      extended bycom.ibm.tws.objects.filter.TimeRange
All Implemented Interfaces:
java.io.Serializable

public class TimeRange
extends AbstractRange

This subclass of AbstractRange can hold a range of date values, and can be set into a QueryFilter to retrieve results with the requested range on a selected date field.

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
          Copyright.
 
Constructor Summary
TimeRange(java.util.Date limit, boolean isStart)
          Creates an "open" TimeRange object, having only a start or end limit.
TimeRange(java.util.Date start, java.util.Date end)
          Creates a "closed" TimeRange object, having both a start and end limit.
 
Method Summary
 boolean equals(java.lang.Object object)
          Returns true if this range is equal to the given one.
 java.util.Date getRangeEnd()
          Returns the range end limit.
 java.util.Date getRangeStart()
          Returns the range start limit.
 int hashCode()
          Returns a hash code for this range.
 java.lang.String toString()
          Returns a compact representation of this range.
 
Methods inherited from class com.ibm.tws.objects.filter.AbstractRange
hasEnd, hasStart
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
Copyright.

Constructor Detail

TimeRange

public TimeRange(java.util.Date start,
                 java.util.Date end)
Creates a "closed" TimeRange object, having both a start and end limit.

Parameters:
start - The range start limit.
end - The range end limit.
Throws:
java.lang.NullPointerException - At least one of the specified range limits is null.
java.lang.IllegalArgumentException - The start limit is greater than the end limit.

TimeRange

public TimeRange(java.util.Date limit,
                 boolean isStart)
Creates an "open" TimeRange object, having only a start or end limit.

Parameters:
limit - The range start or end limit.
isStart - True if the range has only a start limit, false if it has only an end limit.
Throws:
java.lang.NullPointerException - The specified range limit is null.
Method Detail

getRangeStart

public java.util.Date getRangeStart()
Returns the range start limit.

Returns:
The range start limit.

getRangeEnd

public java.util.Date getRangeEnd()
Returns the range end limit.

Returns:
The range end limit.

equals

public boolean equals(java.lang.Object object)
Returns true if this range is equal to the given one.

Overrides:
equals in class AbstractRange
Parameters:
object - The object to be compared with this one.
Returns:
True if this object equals to the given one.

hashCode

public int hashCode()
Returns a hash code for this range.

Overrides:
hashCode in class AbstractRange
Returns:
The object's hash code.

toString

public java.lang.String toString()
Returns a compact representation of this range.

Returns:
A compact representation of this range.


Copyright © 2005 IBM All Rights Reserved.