Class Values
java.lang.Object
org.graphstream.ui.graphicGraph.stylesheet.Values
public class Values extends Object implements Iterable<Double>
Several values and the units of these values.
As a style sheet may express values in several different units. This class purpose is to pack the value and the units it is expressed in into a single object.
-
Field Summary
Fields Modifier and Type Field Description StyleConstants.UnitsunitsThe values units.ArrayList<Double>valuesThe value. -
Constructor Summary
-
Method Summary
Modifier and Type Method Description voidaddValues(double... values)Append the given set of values at the end of this set.voidcopy(Values values)Copy the given values to this set.booleanequals(Object o)doubleget(int i)The i-th value of this set.StyleConstants.UnitsgetUnits()Values units.intgetValueCount()Number of values in this set.voidinsertValue(int i, double value)Insert the given value at the given index.Iterator<Double>iterator()voidremoveValue(int i)Remove the i-th value.voidsetUnits(StyleConstants.Units units)Change the values units.voidsetValue(int i, double value)Change the i-th value.intsize()Number of values in this set.StringtoString()Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
values
The value. -
units
The values units.
-
-
Constructor Details
-
Values
New value set with one initial value.- Parameters:
units- The values units.values- A variable count of values.
-
Values
New copy of another value set.- Parameters:
other- The other values to copy.
-
Values
New set of one value.- Parameters:
value- The value to copy with its units.
-
-
Method Details
-
size
public int size()Number of values in this set.- Returns:
- The number of values.
-
getValueCount
public int getValueCount()Number of values in this set.- Returns:
- The number of values.
-
get
public double get(int i)The i-th value of this set. If the index is less than zero, the first value is given, if the index if greater or equal to the number of values, the last value is given.- Parameters:
i- The value index.- Returns:
- The corresponding value.
-
getUnits
Values units.- Returns:
- The units used for each value.
-
equals
-
iterator
-
toString
-
copy
Copy the given values to this set. The units are also copied.- Parameters:
values- The values to copy.
-
addValues
public void addValues(double... values)Append the given set of values at the end of this set.- Parameters:
values- The value set to append.
-
insertValue
public void insertValue(int i, double value)Insert the given value at the given index.- Parameters:
i- Where to insert the value.value- The value to insert.
-
setValue
public void setValue(int i, double value)Change the i-th value.- Parameters:
i- The value index.value- The value to put.
-
removeValue
public void removeValue(int i)Remove the i-th value.- Parameters:
i- The index at which the value is to be removed.
-
setUnits
Change the values units.- Parameters:
units- The units.
-