JIDE 3.5.15

com.jidesoft.pivot
Class DefaultValues

java.lang.Object
  extended by com.jidesoft.pivot.DefaultValues
All Implemented Interfaces:
Values
Direct Known Subclasses:
DummyValues, GrandTotalValues, RunningSummaryValues, SummaryValues

public class DefaultValues
extends Object
implements Values

Default implementation of Values interface.

The equality of two DefaultValues's is depending on the actual equality from the Value inside it.

If you extend a new Values class from DefaultValues, you need override SortableAggregateTableModel.compare(int, int, int) to make sure your new value type will present in right position while sorting together with other type of values.


Constructor Summary
DefaultValues(ExpandableValue value)
          Creates DefaultValues from ExpandableValue.
DefaultValues(List<Value> values)
          Creates DefaultValues from an array of Values.
DefaultValues(Object[] values)
          Creates DefaultValues from an array of Values.
DefaultValues(Value[] values)
          Creates DefaultValues from an array of Values.
 
Method Summary
 boolean equals(Object o)
           
 int getCount()
          Gets the number of Values.
 Value getValueAt(int index)
          Gets the Value at the specified index.
 int hashCode()
           
 CompoundKey toCompoundKey()
          Creates a CompoundKey from this DefaultValues.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultValues

public DefaultValues(ExpandableValue value)
Creates DefaultValues from ExpandableValue. ExpandableValue can have parent so this constructor will find all its ancestors and create the DefaultValues until the parent is null.

Parameters:
value - a ExpandableValue

DefaultValues

public DefaultValues(Value[] values)
Creates DefaultValues from an array of Values. Sometimes it is difficult to create or access the ExpandableValue and use the DefaultValues(ExpandableValue). So we introduces this constructor to make it possible to create a DefaultValues if you have all the Values.

Parameters:
values - an array of Values.

DefaultValues

public DefaultValues(List<Value> values)
Creates DefaultValues from an array of Values. Sometimes it is difficult to create or access the ExpandableValue and use the DefaultValues(ExpandableValue). So we introduces this constructor to make it possible to create a DefaultValues if you have all the Values.

Parameters:
values - a list of Values.

DefaultValues

public DefaultValues(Object[] values)
Creates DefaultValues from an array of Values. Sometimes it is difficult to create or access the ExpandableValue and use the DefaultValues(ExpandableValue). So we introduces this constructor to make it possible to create a DefaultValues if you only know the actual values.

Parameters:
values - an array of Values.
Method Detail

getValueAt

public Value getValueAt(int index)
Description copied from interface: Values
Gets the Value at the specified index.

Specified by:
getValueAt in interface Values
Parameters:
index - the index.
Returns:
the Value at the specified index.

getCount

public int getCount()
Description copied from interface: Values
Gets the number of Values.

Specified by:
getCount in interface Values
Returns:
the number of Values.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toCompoundKey

public CompoundKey toCompoundKey()
Creates a CompoundKey from this DefaultValues. The keys in the CompoundKeys are the actual values from the DefaultValues.

Returns:
a CompoundKey.

toString

public String toString()
Overrides:
toString in class Object

JIDE 3.5.15