org.jfree.chart.axis

Class SegmentedTimeline.SegmentRange

Enclosing Class:
SegmentedTimeline
Implemented Interfaces:
Cloneable, Comparable, Serializable
Known Direct Subclasses:
SegmentedTimeline.BaseTimelineSegmentRange

protected class SegmentedTimeline.SegmentRange
extends SegmentedTimeline.Segment

Private internal class to represent a range of segments. This class is mainly used to store in one object a range of exception segments. This optimizes certain timelines that use a small segment size (like an intraday timeline) allowing them to express a day exception as one SegmentRange instead of multi Segments.

Field Summary

Fields inherited from class org.jfree.chart.axis.SegmentedTimeline.Segment

millisecond, segmentEnd, segmentNumber, segmentStart

Constructor Summary

SegmentRange(long fromMillisecond, long toMillisecond)
Creates a SegmentRange between a start and end domain values.

Method Summary

long
getSegmentCount()
Returns the number of segments contained in this range.
boolean
inExcludeSegments()
Returns true if we are an excluded segment.
boolean
inIncludeSegments()
Returns true if all Segments of this SegmentRenge are an included segment and are not an exception.
void
inc(long n)
Not implemented for SegmentRange.
SegmentedTimeline.Segment
intersect(long from, long to)
Returns a segment that is the intersection of this segment and the interval.

Methods inherited from class org.jfree.chart.axis.SegmentedTimeline.Segment

after, before, calculateSegmentNumber, compareTo, contained, contains, contains, contains, copy, dec, dec, equals, getDate, getMillisecond, getSegmentCount, getSegmentEnd, getSegmentNumber, getSegmentStart, inExceptionSegments, inExcludeSegments, inIncludeSegments, inc, inc, intersect, moveIndexToEnd, moveIndexToStart

Constructor Details

SegmentRange

public SegmentRange(long fromMillisecond,
                    long toMillisecond)
Creates a SegmentRange between a start and end domain values.
Parameters:
fromMillisecond - start of the range
toMillisecond - end of the range

Method Details

getSegmentCount

public long getSegmentCount()
Returns the number of segments contained in this range.
Overrides:
getSegmentCount in interface SegmentedTimeline.Segment
Returns:
The segment count.

inExcludeSegments

public boolean inExcludeSegments()
Returns true if we are an excluded segment.
Overrides:
inExcludeSegments in interface SegmentedTimeline.Segment
Returns:
true or false.

inIncludeSegments

public boolean inIncludeSegments()
Returns true if all Segments of this SegmentRenge are an included segment and are not an exception.
Overrides:
inIncludeSegments in interface SegmentedTimeline.Segment
Returns:
true or false.

inc

public void inc(long n)
Not implemented for SegmentRange. Always throws IllegalArgumentException.
Overrides:
inc in interface SegmentedTimeline.Segment
Parameters:
n - Number of segments to increment.

intersect

public SegmentedTimeline.Segment intersect(long from,
                                           long to)
Returns a segment that is the intersection of this segment and the interval.
Overrides:
intersect in interface SegmentedTimeline.Segment
Parameters:
from - the start of the interval.
to - the end of the interval.
Returns:
The intersection.