|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.Vector<Object>
org.cip4.jdflib.datatypes.JDFNumList
public abstract class JDFNumList
This abstract class is the representation of a number list (Integer and Double object). Intern these objects are collected in a vector and there are several methods to provide an access to the data.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.cip4.jdflib.datatypes.JDFBaseDataTypes |
|---|
JDFBaseDataTypes.EnumFitsValue |
| Field Summary |
|---|
| Fields inherited from class java.util.Vector |
|---|
capacityIncrement, elementCount, elementData |
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Fields inherited from interface org.cip4.jdflib.datatypes.JDFBaseDataTypes |
|---|
EPSILON, MAX_CMYK_COLOR, MAX_LAB_COLOR, MAX_MATRIX_DIMENSION, MAX_RECTANGLE_DIMENSION, MAX_RGB_COLOR, MAX_SHAPE_DIMENSION, MAX_XY_DIMENSION |
| Constructor Summary | |
|---|---|
JDFNumList()
constructs an empty number list |
|
JDFNumList(int size)
constructor - constructs a number list with the given size and sets all values set to 0.0 Double |
|
JDFNumList(JDFNumList nl)
constructor - constructs a number list with a given JDFNumList |
|
JDFNumList(String sl)
constructor - constructs a number list with the given String; if the sub class is of type JDFIntegerList all object will be Integer in all other cases the object will be a Double |
|
JDFNumList(Vector v)
Deprecated. use typesafe constructors |
|
| Method Summary | |
|---|---|
JDFNumList |
abs()
modify numlist to absolute values |
JDFNumList |
clone()
|
boolean |
contains(JDFNumList l)
return true if this contains at least one element from l |
boolean |
containsAll(JDFNumList l)
return true if this contains all elements from l |
Vector<Object> |
copyNumList()
Deprecated. use clone() |
double |
doubleAt(int i)
getElementAt - returns the element at the ith position |
Object |
elementAt(int i)
getElementAt - returns the element at the ith position |
boolean |
equals(Object other)
equals - compares two JDFNumList elements |
double[] |
getDoubleList()
get the list of values as doubles |
int[] |
getIntArray()
getIntArray - returns this integer list as an int array |
String |
getString()
Deprecated. 060418 - use toString |
String |
getString(int precision)
getString - returns the JDFNumList as a String |
int |
hashCode()
hashCode complements equals() to fulfill the equals/hashCode contract |
abstract boolean |
isValid()
isValid - true if all instances are Double or Integer types |
boolean |
isValidString(String st)
isValidString - true if all instances are Double or Integer types |
boolean |
matches(JDFNumList other,
double delta)
are all values within +/- delta? |
void |
removeElementAt(int i)
removeElementAt - removes the element at the given position |
boolean |
replaceElementAt(Object obj,
int i)
replaceElementAt - replaces the element at the given position with the given object |
JDFNumList |
scale(double factor)
scale all values of this by factor |
JDFNumList |
scaleFromCM()
scale all values of this to points from centimeters |
JDFNumList |
scaleFromMM()
scale all values of this to points from millimeters |
JDFNumList |
scaleToCM()
scale all values of this to points from centimeters |
JDFNumList |
scaleToMM()
scale all values of this to points from millimeters |
void |
set(int pos,
double d)
|
void |
setString(String string)
sets this to the value specified in string |
void |
subtract(JDFNumList l)
subtract l from this, |
String |
toString()
toString - returns the JDFNumList as a String |
void |
unify()
ensure that each instance exists only once |
| 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 |
| Methods inherited from class java.util.AbstractList |
|---|
iterator, listIterator, listIterator |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
iterator, listIterator, listIterator |
| Constructor Detail |
|---|
public JDFNumList()
public JDFNumList(int size)
size - the given size
@Deprecated
public JDFNumList(Vector v)
throws DataFormatException
v - a vector with number list objects
DataFormatException - - if the Vector has not a valid format
public JDFNumList(String sl)
throws DataFormatException
sl - the given String
DataFormatException - - if the String has not a valid format
public JDFNumList(JDFNumList nl)
throws DataFormatException
nl - the given number list
DataFormatException - - if the String has not a valid format| Method Detail |
|---|
public void set(int pos,
double d)
pos - d -
public void setString(String string)
throws DataFormatException
string -
DataFormatException@Deprecated public String getString()
public double[] getDoubleList()
public String toString()
toString in class Vector<Object>public String getString(int precision)
precision - # of digits to print
public boolean equals(Object other)
equals in interface Collection<Object>equals in interface List<Object>equals in class Vector<Object>public int hashCode()
hashCode in interface Collection<Object>hashCode in interface List<Object>hashCode in class Vector<Object>public Object elementAt(int i)
elementAt in class Vector<Object>i - the index
public double doubleAt(int i)
i - the index
@Deprecated public Vector<Object> copyNumList()
public void removeElementAt(int i)
removeElementAt in class Vector<Object>i - the position from where to remove the element
public boolean replaceElementAt(Object obj,
int i)
obj - the objecti - the given position
public abstract boolean isValid()
throws DataFormatException
DataFormatExceptionpublic boolean isValidString(String st)
st - the string to check
public JDFNumList scaleFromMM()
public JDFNumList scaleFromCM()
public JDFNumList scaleToMM()
public JDFNumList scaleToCM()
public JDFNumList scale(double factor)
factor -
public JDFNumList abs()
Math.abs(int)public JDFNumList clone()
clone in class Vector<Object>Vector.clone()
public boolean matches(JDFNumList other,
double delta)
other - delta -
Math.abs(int)public void subtract(JDFNumList l)
l - the list to subtract from this
IllegalArgumentException - if sizes don't matchpublic void unify()
public int[] getIntArray()
public boolean contains(JDFNumList l)
l - the list to check for
public boolean containsAll(JDFNumList l)
l - the list to check for
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||