Class TimeRange
java.lang.Object
org.gvsig.timesupport.swing.impl.rdv.TimeRange
- All Implemented Interfaces:
Comparable<TimeRange>
A time range. This is a range in time specified by a start and end time.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
start
public double startThe start of the time range -
end
public double endThe end of the time range
-
-
Constructor Details
-
TimeRange
public TimeRange(double start, double end) Create a time range.- Parameters:
start- the start of the time rangeend- the end of the time range
-
-
Method Details
-
length
public double length()The length of the time range. Simply end-start.- Returns:
- the length of the time range
-
contains
public boolean contains(double time) See if the time is within the time range.- Parameters:
time- the time to check- Returns:
- true if the time is within the time range, false otherwise
-
compareTo
Compare time ranges. This is based first on their start, and then on their end (if needed).- Specified by:
compareToin interfaceComparable<TimeRange>- Parameters:
d- the time range to compare with- Returns:
- 0 if they are the same, -1 if this is less than the other, and 1 if this is greater than the other.
-