ca.odell.glazedlists.jfreechart
Class DefaultValueSegment<T extends Comparable,V extends Comparable>

java.lang.Object
  extended by ca.odell.glazedlists.jfreechart.DefaultValueSegment<T,V>
All Implemented Interfaces:
ValueSegment<T,V>, Comparable<ValueSegment<T,V>>

public class DefaultValueSegment<T extends Comparable,V extends Comparable>
extends Object
implements ValueSegment<T,V>

The default implementation of the ValueSegment interface.

Note: DefaultValueSegments must be immutable objects. Callers are strongly encouraged to construct DefaultValueSegments with defensive copies of the start, end, and value arguments if they are not themselves immutable.

Author:
James Lemieux

Constructor Summary
DefaultValueSegment(T start, T end, V value)
          Create a DefaultValueSegment indicating the value exists between the start and end on some continuum of Comparable objects.
 
Method Summary
 int compareTo(ValueSegment<T,V> o)
          DefaultValueSegments are compared by value, then by segment start, then by segment end.
 T getEnd()
          Returns the value marking the end of this segment.
 T getStart()
          Returns the value marking the start of this segment.
 V getValue()
          Returns the value observed within this segment.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultValueSegment

public DefaultValueSegment(T start,
                           T end,
                           V value)
Create a DefaultValueSegment indicating the value exists between the start and end on some continuum of Comparable objects.

Parameters:
start - the beginning of the segment
end - the end of the segment
value - the value observed between start and end
Throws:
IllegalArgumentException - if start or end is null
Method Detail

getStart

public T getStart()
Returns the value marking the start of this segment.

Specified by:
getStart in interface ValueSegment<T extends Comparable,V extends Comparable>

getEnd

public T getEnd()
Returns the value marking the end of this segment.

Specified by:
getEnd in interface ValueSegment<T extends Comparable,V extends Comparable>

getValue

public V getValue()
Returns the value observed within this segment.

Specified by:
getValue in interface ValueSegment<T extends Comparable,V extends Comparable>

compareTo

public int compareTo(ValueSegment<T,V> o)
DefaultValueSegments are compared by value, then by segment start, then by segment end.

Specified by:
compareTo in interface Comparable<ValueSegment<T extends Comparable,V extends Comparable>>

toString

public String toString()

Overrides:
toString in class Object


Glazed Lists, Copyright © 2003 publicobject.com, O'Dell Engineering.
Documentation build by hbrands at 2017-03-13 22:58