Package org.jfree.chart.axis
Interface Timeline
public interface Timeline
An interface that defines the contract for a Timeline.
A Timeline will present a series of values to be used for an axis. Each Timeline must provide transformation methods between domain values and timeline values. In theory many transformations are possible.
A timeline can be used as parameter to a
DateAxis to define the values that this axis
supports.
Because Timelines were created mainly for Date related axis, values are
represented as longs instead of doubles. In this case, the domain value is
just the number of milliseconds since January 1, 1970, 00:00:00 GMT as
defined by the getTime() method of Date.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsDomainRange(long fromMillisecond, long toMillisecond) Returnstrueif a range of values are contained in the timeline.booleancontainsDomainRange(Date fromDate, Date toDate) Returnstrueif a range of dates are contained in the timeline.booleancontainsDomainValue(long millisecond) Returnstrueif a value is contained in the timeline values.booleancontainsDomainValue(Date date) Returnstrueif a date is contained in the timeline values.longtoMillisecond(long timelineValue) Translates a value relative to this timeline into a domain value.longtoTimelineValue(long millisecond) Translates a millisecond (as defined by java.util.Date) into an index along this timeline.longtoTimelineValue(Date date) Translates a date into a value on this timeline.
-
Method Details
-
toTimelineValue
Translates a millisecond (as defined by java.util.Date) into an index along this timeline.- Parameters:
millisecond- the millisecond.- Returns:
- A timeline value.
-
toTimelineValue
Translates a date into a value on this timeline.- Parameters:
date- the date.- Returns:
- A timeline value
-
toMillisecond
Translates a value relative to this timeline into a domain value. The domain value obtained by this method is not always the same domain value that could have been supplied to translateDomainValueToTimelineValue(domainValue). This is because the original transformation may not be complete reversable.- Parameters:
timelineValue- a timeline value.- Returns:
- A domain value.
-
containsDomainValue
Returnstrueif a value is contained in the timeline values.- Parameters:
millisecond- the millisecond.- Returns:
trueif value is contained in the timeline andfalseotherwise.
-
containsDomainValue
Returnstrueif a date is contained in the timeline values.- Parameters:
date- the date to verify.- Returns:
trueif value is contained in the timeline andfalseotherwise.
-
containsDomainRange
Returnstrueif a range of values are contained in the timeline.- Parameters:
fromMillisecond- the start of the range to verify.toMillisecond- the end of the range to verify.- Returns:
trueif the range is contained in the timeline orfalseotherwise
-
containsDomainRange
Returnstrueif a range of dates are contained in the timeline.- Parameters:
fromDate- the start of the range to verify.toDate- the end of the range to verify.- Returns:
trueif the range is contained in the timeline orfalseotherwise
-