org.cip4.jdflib.datatypes
Class JDFNumberList
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.Vector<Object>
org.cip4.jdflib.datatypes.JDFNumList
org.cip4.jdflib.datatypes.JDFNumberList
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<Object>, Collection<Object>, List<Object>, RandomAccess, JDFBaseDataTypes
public class JDFNumberList
- extends JDFNumList
This class is a representation of a number list (JDFNumberList). It is a whitespace separated list of double values.
- See Also:
- Serialized Form
|
Method Summary |
void |
add(double x)
add - add a double value to the vector |
void |
add(String s)
add - adds a number list to the already existing number list |
boolean |
contains(double d)
return true if at least one value in the list is d |
static JDFNumberList |
createNumberList(String s)
factory for JDFNumberList that silently returns null in case of illegal strings |
boolean |
isValid()
isValid - true if all instances are Double types |
| Methods inherited from class org.cip4.jdflib.datatypes.JDFNumList |
abs, clone, contains, containsAll, copyNumList, doubleAt, elementAt, equals, getDoubleList, getIntArray, getString, getString, hashCode, isValidString, matches, removeElementAt, replaceElementAt, scale, scaleFromCM, scaleFromMM, scaleToCM, scaleToMM, set, setString, subtract, toString, unify |
| Methods inherited from class java.util.Vector |
add, add, addAll, addAll, addElement, capacity, clear, contains, containsAll, copyInto, elements, ensureCapacity, firstElement, get, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, trimToSize |
JDFNumberList
public JDFNumberList(String s)
throws DataFormatException
- constructs a number list with the given string
- Parameters:
s - the given String
- Throws:
DataFormatException - - if the String has not a valid format
JDFNumberList
@Deprecated
public JDFNumberList(Vector v)
throws DataFormatException
- Deprecated. use typesafe constructors
- constructs a number list with the given vector
- Parameters:
v - the given vector
- Throws:
DataFormatException - - if the Vector has not a valid format
createNumberList
public static JDFNumberList createNumberList(String s)
- factory for JDFNumberList that silently returns null in case of illegal strings
- Parameters:
s - the string to parse
- Returns:
- the JDFNumberList, null if s is not compatible
isValid
public boolean isValid()
throws DataFormatException
- isValid - true if all instances are Double types
- Specified by:
isValid in class JDFNumList
- Returns:
- boolean - true if all instances are Double or Integer types
- Throws:
DataFormatException - - if the Vector has not a valid format
add
public void add(double x)
- add - add a double value to the vector
- Parameters:
x - the double value
add
public void add(String s)
throws DataFormatException
- add - adds a number list to the already existing number list
- Parameters:
s - the given string
- Throws:
DataFormatException - - if the String has not a valid format
contains
public boolean contains(double d)
- return true if at least one value in the list is d
- Parameters:
d - the value to search
- Returns:
Copyright © 2013. All Rights Reserved.