prefuse.data.query
Class ObjectRangeModel

java.lang.Object
  extended by javax.swing.DefaultBoundedRangeModel
      extended by prefuse.data.query.ObjectRangeModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.BoundedRangeModel, ValuedRangeModel

public class ObjectRangeModel
extends javax.swing.DefaultBoundedRangeModel
implements ValuedRangeModel

Supports an ordered range of arbitrary objects. Designed to support range-based dynamic queries over ordered, but not necessarily numerical, data.

Author:
jeffrey heer
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.DefaultBoundedRangeModel
changeEvent, listenerList
 
Constructor Summary
ObjectRangeModel(java.lang.Object[] objects)
          Create a new ObjectRangeModel with the given objects.
 
Method Summary
 java.lang.Object getHighValue()
          Get the value at the high point of the range span.
 int getIndex(java.lang.Object o)
          Return the index for a given Object, indicating its order in the range.
 java.lang.Object getLowValue()
          Get the value at the low point of the range span.
 java.lang.Object getMaxValue()
          Get the maximum value backing the range model.
 java.lang.Object getMinValue()
          Get the minimum value backing the range model.
 java.lang.Object getObject(int i)
          Return the Object at the given index.
 void setValueRange(java.lang.Object[] objects)
          Sets the range model to the given objects.
 
Methods inherited from class javax.swing.DefaultBoundedRangeModel
addChangeListener, fireStateChanged, getChangeListeners, getExtent, getListeners, getMaximum, getMinimum, getValue, getValueIsAdjusting, removeChangeListener, setExtent, setMaximum, setMinimum, setRangeProperties, setValue, setValueIsAdjusting, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.swing.BoundedRangeModel
addChangeListener, getExtent, getMaximum, getMinimum, getValue, getValueIsAdjusting, removeChangeListener, setExtent, setMaximum, setMinimum, setRangeProperties, setValue, setValueIsAdjusting
 

Constructor Detail

ObjectRangeModel

public ObjectRangeModel(java.lang.Object[] objects)
Create a new ObjectRangeModel with the given objects. The objects are assumed to sorted in ascending order.

Parameters:
objects - the members of this ObjectRangeModel, sorted in ascending order.
Method Detail

setValueRange

public void setValueRange(java.lang.Object[] objects)
Sets the range model to the given objects. The objects are assumed to sorted in ascending order.

Parameters:
objects - the members of this ObjectRangeModel, sorted in ascending order.

getObject

public java.lang.Object getObject(int i)
Return the Object at the given index.

Parameters:
i - the index of the Object
Returns:
return the requested Object.

getIndex

public int getIndex(java.lang.Object o)
Return the index for a given Object, indicating its order in the range.

Parameters:
o - the Object to lookup.
Returns:
the index of the Object in the range model, -1 if the Object is not found in the model.

getMinValue

public java.lang.Object getMinValue()
Description copied from interface: ValuedRangeModel
Get the minimum value backing the range model. This is the absolute minimum value possible for the range span.

Specified by:
getMinValue in interface ValuedRangeModel
Returns:
the minimum value
See Also:
ValuedRangeModel.getMinValue()

getMaxValue

public java.lang.Object getMaxValue()
Description copied from interface: ValuedRangeModel
Get the maximum value backing the range model. This is the absolute maximum value possible for the range span.

Specified by:
getMaxValue in interface ValuedRangeModel
Returns:
the maximum value
See Also:
ValuedRangeModel.getMaxValue()

getLowValue

public java.lang.Object getLowValue()
Description copied from interface: ValuedRangeModel
Get the value at the low point of the range span.

Specified by:
getLowValue in interface ValuedRangeModel
Returns:
the lowest value of the current range
See Also:
ValuedRangeModel.getLowValue()

getHighValue

public java.lang.Object getHighValue()
Description copied from interface: ValuedRangeModel
Get the value at the high point of the range span.

Specified by:
getHighValue in interface ValuedRangeModel
Returns:
the highest value of the current range
See Also:
ValuedRangeModel.getHighValue()


Copyright © 2007 Regents of the University of California