|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.chart.axis.SegmentedTimeline.Segment
Internal class to represent a valid segment for this timeline. A segment is valid on a timeline if it is part of its included, excluded or exception segments.
Each segment will know its segment number, segmentStart, segmentEnd and index inside the segment.
Field Summary | |
protected long |
millisecond
A reference point within the segment. |
protected long |
segmentEnd
The segment end. |
protected long |
segmentNumber
The segment number. |
protected long |
segmentStart
The segment start. |
Constructor Summary | |
protected |
SegmentedTimeline.Segment()
Protected constructor only used by sub-classes. |
protected |
SegmentedTimeline.Segment(long millisecond)
Creates a segment for a given point in time. |
Method Summary | |
boolean |
after(SegmentedTimeline.Segment other)
Returns true if this segment is wholly after another segment. |
boolean |
before(SegmentedTimeline.Segment other)
Returns true if this segment is wholly before another segment. |
long |
calculateSegmentNumber(long millis)
Calculates the segment number for a given millisecond. |
int |
compareTo(java.lang.Object object)
Will compare this Segment with another Segment (from Comparable interface). |
boolean |
contained(long from,
long to)
Returns true if this segment is contained in an interval. |
boolean |
contains(long millis)
Returns true if a particular millisecond is contained in this segment. |
boolean |
contains(long from,
long to)
Returns true if an interval is contained in this segment. |
boolean |
contains(SegmentedTimeline.Segment segment)
Returns true if a segment is contained in this segment. |
SegmentedTimeline.Segment |
copy()
Returns a copy of ourselves or null if there was an exception during
cloning. |
void |
dec()
Decrements the internal attributes of this segment by one segment. |
void |
dec(long n)
Decrements the internal attributes of this segment by a number of segments. |
boolean |
equals(java.lang.Object object)
Tests an object (usually another Segment ) for equality with this segment. |
java.util.Date |
getDate()
Returns a Date that represents the reference point for this segment. |
long |
getMillisecond()
Returns the millisecond used to reference this segment (always between the segmentStart and segmentEnd). |
long |
getSegmentCount()
Returns always one (the number of segments contained in this segment). |
long |
getSegmentEnd()
Gets the end of this segment in ms. |
long |
getSegmentNumber()
Returns the segment number of this segment. |
long |
getSegmentStart()
Gets the start of this segment in ms. |
void |
inc()
Increments the internal attributes of this segment by one segment. |
void |
inc(long n)
Increments the internal attributes of this segment by a number of segments. |
boolean |
inExceptionSegments()
Returns true if we are an exception segment. |
boolean |
inExcludeSegments()
Returns true if we are an excluded segment. |
boolean |
inIncludeSegments()
Returns true if we are an included segment and we are not an exception. |
SegmentedTimeline.Segment |
intersect(long from,
long to)
Returns a segment that is the intersection of this segment and the interval. |
void |
moveIndexToEnd()
Moves the index of this segment to the end of the segment. |
void |
moveIndexToStart()
Moves the index of this segment to the beginning if the segment. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected long segmentNumber
protected long segmentStart
protected long segmentEnd
protected long millisecond
Constructor Detail |
protected SegmentedTimeline.Segment()
protected SegmentedTimeline.Segment(long millisecond)
millisecond
- the millisecond (as encoded by java.util.Date).Method Detail |
public long calculateSegmentNumber(long millis)
millis
- the millisecond (as encoded by java.util.Date).
public long getSegmentNumber()
public long getSegmentCount()
public long getSegmentStart()
public long getSegmentEnd()
public long getMillisecond()
public java.util.Date getDate()
Date
that represents the reference point for this segment.
public boolean contains(long millis)
millis
- the millisecond to verify.
true
if the millisecond is contained in the segment.public boolean contains(long from, long to)
true
if an interval is contained in this segment.
from
- the start of the interval.to
- the end of the interval.
true
if the interval is contained in the segment.public boolean contains(SegmentedTimeline.Segment segment)
true
if a segment is contained in this segment.
segment
- the segment to test for inclusion
true
if the segment is contained in this segment.public boolean contained(long from, long to)
true
if this segment is contained in an interval.
from
- the start of the interval.to
- the end of the interval.
public SegmentedTimeline.Segment intersect(long from, long to)
from
- the start of the interval.to
- the end of the interval.
public boolean before(SegmentedTimeline.Segment other)
true
if this segment is wholly before another segment.
other
- the other segment.
public boolean after(SegmentedTimeline.Segment other)
true
if this segment is wholly after another segment.
other
- the other segment.
public boolean equals(java.lang.Object object)
Segment
) for equality with this segment.
object
- The other segment to compare with us
public SegmentedTimeline.Segment copy()
null
if there was an exception during
cloning.
public int compareTo(java.lang.Object object)
compareTo
in interface java.lang.Comparable
object
- The other Segment to compare with
public boolean inIncludeSegments()
true
or false
.public boolean inExcludeSegments()
true
or false
.public boolean inExceptionSegments()
public void inc(long n)
n
- Number of segments to increment.public void inc()
public void dec(long n)
n
- Number of segments to decrement.public void dec()
public void moveIndexToStart()
public void moveIndexToEnd()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |