Package org.cip4.jdflib.datatypes
Class JDFIntegerList
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.Vector<Object>
org.cip4.jdflib.datatypes.JDFNumList
org.cip4.jdflib.datatypes.JDFIntegerList
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<Object>,Collection<Object>,List<Object>,RandomAccess,JDFBaseDataTypes
This class is a representation of an integer list (JDFIntegerList). It is a whitespace separated list of integer values.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.cip4.jdflib.datatypes.JDFNumList
JDFNumList.NormComparator, JDFNumList.VolumeComparatorNested classes/interfaces inherited from interface org.cip4.jdflib.datatypes.JDFBaseDataTypes
JDFBaseDataTypes.EnumFitsValue -
Field Summary
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementDataFields inherited from class java.util.AbstractList
modCountFields 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
ConstructorsConstructorDescriptionconstructs an empty range listJDFIntegerList(int i) constructs an integer list with all values set via an intJDFIntegerList(int[] iArray) constructs an integer list with all values set via an int[]constructs an integer list with all values set via a Stringconstructs an integer list with all values set via a JDFIntegerList -
Method Summary
Modifier and TypeMethodDescriptionabs()modify numlist to absolute valuesvoidadd(int x) add - add an int to the vectorvoidadd - adds a integer list string to the existing integer listvoidadd(JDFIntegerList il) Deprecated.- usa addAllvoidDeprecated.- use addAll()addX(int x) add - add an int to the vectorbooleancontains(int d) return true if at least one value in the list is dstatic JDFIntegerListconvert a string to an integerlist, and return null if the string is no goodbooleanequals - returns true if both JDFIntegerList are equal otherwise falseintgetInt(int pos) getInt - returns the integer at 'pos' from the list.
Note: if pos is negative, getInt returns the pos'th integer counting from the end.int[]getIntArray - returns this integer list as an int arraystatic JDFIntegerListDeprecated.use createIntegerListinthashCode()hashCode complements equals() to fulfill the equals/hashCode contractbooleanisValid()isValid - true if all instances are Integer typesbooleanisValidString(String st) isValidString - true if all instances are Double or Integer typesscale(double factor) must keep this because otherwise the object vector gets corrupted with Double objectsvoidsetInt(int i) setIntArray - sets this integer list to an int
the RangeList is emptied, then the single value i is addedvoidsetInt(int pos, int val) setInt - sets the integer val at 'pos' from the list.
Note: if pos is negative, setInt sets the pos'th integer counting from the end.voidsetIntArray(int[] iArray) setIntArray - sets this integer list to an int array
the RangeList is emptied, then the values of iArray are addedsetIntX(int i) setIntArray - sets this integer list to an int
the RangeList is emptied, then the single value i is addedsetIntX(int pos, int val) shift(int shift) must keep this because otherwise the object vector gets corrupted with Double objectsvoidsort()subtract l from this,Methods inherited from class org.cip4.jdflib.datatypes.JDFNumList
clone, contains, containsAll, copyNumList, doubleAt, elementAt, getDouble, getDoubleList, getDoubleVector, getString, getString, intAt, matches, max, min, norm, removeElementAt, replaceElementAt, scale, scaleFromCM, scaleFromCM, scaleFromMM, scaleFromMM, scaleToCM, scaleToCM, scaleToMM, scaleToMM, set, setString, setX, shift, toString, unify, volumeMethods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, contains, containsAll, copyInto, elements, ensureCapacity, firstElement, forEach, get, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeIf, removeRange, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Constructor Details
-
JDFIntegerList
public JDFIntegerList()constructs an empty range list -
JDFIntegerList
constructs an integer list with all values set via a String- Parameters:
s- the given String- Throws:
DataFormatException- - if the String has not a valid format
-
JDFIntegerList
constructs an integer list with all values set via a JDFIntegerList- Parameters:
il- the given integer list- Throws:
DataFormatException- - if the JDFIntegerList has not a valid format
-
JDFIntegerList
public JDFIntegerList(int[] iArray) constructs an integer list with all values set via an int[]- Parameters:
iArray- - the given integer array
-
JDFIntegerList
public JDFIntegerList(int i) constructs an integer list with all values set via an int- Parameters:
i- the given integer
-
-
Method Details
-
isValidString
Description copied from class:JDFNumListisValidString - true if all instances are Double or Integer types- Overrides:
isValidStringin classJDFNumList- Parameters:
st-- Returns:
- true if valid
- See Also:
-
getIntegerList
Deprecated.use createIntegerListconvert a string to an integerlist, and return null if the string is no good- Parameters:
s- the string to parse- Returns:
- the integerlist, null if snafu
-
createIntegerList
convert a string to an integerlist, and return null if the string is no good- Parameters:
s- the string to parse- Returns:
- the integerlist, null if snafu
-
isValid
isValid - true if all instances are Integer types- Specified by:
isValidin classJDFNumList- Returns:
- boolean - true if all instances are Double or Integer types
- Throws:
DataFormatException- - if the Vector has not a valid format
-
contains
public boolean contains(int d) return true if at least one value in the list is d- Parameters:
d- the value to search- Returns:
- true if this contains d
-
equals
equals - returns true if both JDFIntegerList are equal otherwise false- Specified by:
equalsin interfaceCollection<Object>- Specified by:
equalsin interfaceList<Object>- Overrides:
equalsin classJDFNumList- Returns:
- boolean - true if equal otherwise false
-
hashCode
public int hashCode()hashCode complements equals() to fulfill the equals/hashCode contract- Specified by:
hashCodein interfaceCollection<Object>- Specified by:
hashCodein interfaceList<Object>- Overrides:
hashCodein classJDFNumList
-
addIntegerList
Deprecated.- use addAll()addIntegerList - adds an integer list to this integer list- Parameters:
il- the given integer list
-
add
public void add(int x) add - add an int to the vector- Parameters:
x- the int value
-
addX
add - add an int to the vector- Parameters:
x- the int value
-
add
Deprecated.- usa addAlladd - adds a complete integer list to the vector- Parameters:
il- the given integer list
-
add
add - adds a integer list string to the existing integer list- Parameters:
s- the given string- Throws:
DataFormatException- - if the String has not a valid format
-
getInt
public int getInt(int pos) getInt - returns the integer at 'pos' from the list.
Note: if pos is negative, getInt returns the pos'th integer counting from the end.- Parameters:
pos- index of the integer to get- Returns:
- int - the pos'th int
-
setIntX
-
setInt
public void setInt(int pos, int val) setInt - sets the integer val at 'pos' from the list.
Note: if pos is negative, setInt sets the pos'th integer counting from the end.- Parameters:
pos- index of the integer to getval- the value to set
-
sort
public void sort()- Overrides:
sortin classJDFNumList
-
scale
must keep this because otherwise the object vector gets corrupted with Double objects- Overrides:
scalein classJDFNumList- Returns:
- See Also:
-
shift
must keep this because otherwise the object vector gets corrupted with Double objects- See Also:
-
getIntArray
public int[] getIntArray()getIntArray - returns this integer list as an int array- Overrides:
getIntArrayin classJDFNumList- Returns:
- int[] - the int array
-
setIntArray
public void setIntArray(int[] iArray) setIntArray - sets this integer list to an int array
the RangeList is emptied, then the values of iArray are added- Parameters:
iArray- the int array
-
setInt
public void setInt(int i) setIntArray - sets this integer list to an int
the RangeList is emptied, then the single value i is added- Parameters:
i- the value
-
setIntX
setIntArray - sets this integer list to an int
the RangeList is emptied, then the single value i is added- Parameters:
i- the value- Returns:
-
abs
Description copied from class:JDFNumListmodify numlist to absolute values- Overrides:
absin classJDFNumList- Returns:
- See Also:
-
subtract
subtract l from this,- Overrides:
subtractin classJDFNumList- Parameters:
l- the list to subtract from this- Throws:
IllegalArgumentException- if sizes don't match
-