| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Objectorg.jfree.chart.axis.SegmentedTimeline.Segmentpublic class SegmentedTimeline.Segmentextends java.lang.Objectimplements Comparable, Cloneable, SerializableField Summary | |
protected long |
|
protected long |
|
protected long |
|
protected long |
|
Constructor Summary | |
| |
| |
Method Summary | |
boolean |
|
boolean |
|
long |
|
int |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
SegmentedTimeline.Segment |
|
void |
|
void |
|
boolean |
|
Date |
|
long |
|
long |
|
long |
|
long |
|
long |
|
boolean |
|
boolean |
|
boolean |
|
void |
|
void |
|
SegmentedTimeline.Segment |
|
void |
|
void |
|
protected Segment(long millisecond)
Creates a segment for a given point in time.
- Parameters:
millisecond- the millisecond (as encoded by java.util.Date).
public boolean after(SegmentedTimeline.Segment other)
Returnstrueif this segment is wholly after another segment.
- Parameters:
other- the other segment.
- Returns:
- A boolean.
public boolean before(SegmentedTimeline.Segment other)
Returnstrueif this segment is wholly before another segment.
- Parameters:
other- the other segment.
- Returns:
- A boolean.
public long calculateSegmentNumber(long millis)
Calculates the segment number for a given millisecond.
- Parameters:
millis- the millisecond (as encoded by java.util.Date).
- Returns:
- The segment number.
public int compareTo(Object object)
Will compare this Segment with another Segment (from Comparable interface).
- Parameters:
object- The other Segment to compare with
- Returns:
- -1: this <32object, 0: this.equal(object) and +1: this > object
public boolean contained(long from, long to)
Returnstrueif this segment is contained in an interval.
- Parameters:
from- the start of the interval.to- the end of the interval.
- Returns:
trueif this segment is contained in the interval.
public boolean contains(long millis)
Returns true if a particular millisecond is contained in this segment.
- Parameters:
millis- the millisecond to verify.
- Returns:
trueif the millisecond is contained in the segment.
public boolean contains(long from, long to)
Returnstrueif an interval is contained in this segment.
- Parameters:
from- the start of the interval.to- the end of the interval.
- Returns:
trueif the interval is contained in the segment.
public boolean contains(SegmentedTimeline.Segment segment)
Returnstrueif a segment is contained in this segment.
- Parameters:
segment- the segment to test for inclusion
- Returns:
trueif the segment is contained in this segment.
public SegmentedTimeline.Segment copy()
Returns a copy of ourselves ornullif there was an exception during cloning.
- Returns:
- A copy of this segment.
public void dec()
Decrements the internal attributes of this segment by one segment. The exact time decremented is segmentSize.
public void dec(long n)
Decrements the internal attributes of this segment by a number of segments.
- Parameters:
n- Number of segments to decrement.
public boolean equals(Object object)
Tests an object (usually anotherSegment) for equality with this segment.
- Parameters:
object- The other segment to compare with us
- Returns:
trueif we are the same segment
public Date getDate()
Returns ajava.util.Datethat represents the reference point for this segment.
- Returns:
- The date.
public long getMillisecond()
Returns the millisecond used to reference this segment (always between the segmentStart and segmentEnd).
- Returns:
- The millisecond.
public long getSegmentCount()
Returns always one (the number of segments contained in this segment).
- Returns:
- The segment count (always 1 for this class).
public long getSegmentEnd()
Gets the end of this segment in ms.
- Returns:
- The segment end.
public long getSegmentNumber()
Returns the segment number of this segment. Segments start at 0.
- Returns:
- The segment number.
public long getSegmentStart()
Gets the start of this segment in ms.
- Returns:
- The segment start.
public boolean inExceptionSegments()
Returns true if we are an exception segment. This is implemented via a binary search on the exceptionSegments sorted list. If the segment is not listed as an exception in our list and we have a baseTimeline, a check is performed to see if the segment is inside an excluded segment from our base. If so, it is also considered an exception.
- Returns:
trueif we are an exception segment.
public boolean inExcludeSegments()
Returns true if we are an excluded segment.
- Returns:
trueorfalse.
public boolean inIncludeSegments()
Returns true if we are an included segment and we are not an exception.
- Returns:
trueorfalse.
public void inc()
Increments the internal attributes of this segment by one segment. The exact time incremented is segmentSize.
public void inc(long n)
Increments the internal attributes of this segment by a number of segments.
- Parameters:
n- Number of segments to increment.
public SegmentedTimeline.Segment intersect(long from, long to)
Returns a segment that is the intersection of this segment and the interval.
- Parameters:
from- the start of the interval.to- the end of the interval.
- Returns:
- A segment.
public void moveIndexToEnd()
Moves the index of this segment to the end of the segment.
public void moveIndexToStart()
Moves the index of this segment to the beginning if the segment.