Package org.cip4.jdflib.datatypes
Class JDFIntegerList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.Vector<java.lang.Object>
-
- org.cip4.jdflib.datatypes.JDFNumList
-
- org.cip4.jdflib.datatypes.JDFIntegerList
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<java.lang.Object>,java.util.Collection<java.lang.Object>,java.util.List<java.lang.Object>,java.util.RandomAccess,JDFBaseDataTypes
public class JDFIntegerList extends JDFNumList
This class is a representation of an integer list (JDFIntegerList). It is a whitespace separated list of integer values.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.cip4.jdflib.datatypes.JDFNumList
JDFNumList.NormComparator, JDFNumList.VolumeComparator
-
Nested classes/interfaces inherited from interface org.cip4.jdflib.datatypes.JDFBaseDataTypes
JDFBaseDataTypes.EnumFitsValue
-
-
Field Summary
-
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
Constructors Constructor Description JDFIntegerList()constructs 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[]JDFIntegerList(java.lang.String s)constructs an integer list with all values set via a StringJDFIntegerList(JDFIntegerList il)constructs an integer list with all values set via a JDFIntegerList
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description JDFNumListabs()modify numlist to absolute valuesvoidadd(int x)add - add an int to the vectorvoidadd(java.lang.String s)add - adds a integer list string to the existing integer listvoidadd(JDFIntegerList il)Deprecated.- usa addAllvoidaddIntegerList(JDFIntegerList il)Deprecated.- use addAll()JDFIntegerListaddX(int x)add - add an int to the vectorbooleancontains(int d)return true if at least one value in the list is dstatic JDFIntegerListcreateIntegerList(java.lang.String s)convert a string to an integerlist, and return null if the string is no goodbooleanequals(java.lang.Object other)equals - 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()getIntArray - returns this integer list as an int arraystatic JDFIntegerListgetIntegerList(java.lang.String s)Deprecated.use createIntegerListinthashCode()hashCode complements equals() to fulfill the equals/hashCode contractbooleanisValid()isValid - true if all instances are Integer typesbooleanisValidString(java.lang.String st)isValidString - true if all instances are Double or Integer typesJDFIntegerListscale(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 addedJDFIntegerListsetIntX(int i)setIntArray - sets this integer list to an int
the RangeList is emptied, then the single value i is addedJDFIntegerListsetIntX(int pos, int val)JDFIntegerListshift(int shift)must keep this because otherwise the object vector gets corrupted with Double objectsvoidsort()JDFIntegerListsubtract(JDFNumList l)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, volume
-
Methods 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, trimToSize
-
-
-
-
Constructor Detail
-
JDFIntegerList
public JDFIntegerList()
constructs an empty range list
-
JDFIntegerList
public JDFIntegerList(java.lang.String s) throws java.util.zip.DataFormatExceptionconstructs an integer list with all values set via a String- Parameters:
s- the given String- Throws:
java.util.zip.DataFormatException- - if the String has not a valid format
-
JDFIntegerList
public JDFIntegerList(JDFIntegerList il) throws java.util.zip.DataFormatException
constructs an integer list with all values set via a JDFIntegerList- Parameters:
il- the given integer list- Throws:
java.util.zip.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 Detail
-
isValidString
public boolean isValidString(java.lang.String st)
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:
JDFNumList.isValidString(java.lang.String)
-
getIntegerList
@Deprecated public static JDFIntegerList getIntegerList(java.lang.String s)
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
public static JDFIntegerList createIntegerList(java.lang.String s)
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
public boolean isValid() throws java.util.zip.DataFormatExceptionisValid - true if all instances are Integer types- Specified by:
isValidin classJDFNumList- Returns:
- boolean - true if all instances are Double or Integer types
- Throws:
java.util.zip.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
public boolean equals(java.lang.Object other)
equals - returns true if both JDFIntegerList are equal otherwise false- Specified by:
equalsin interfacejava.util.Collection<java.lang.Object>- Specified by:
equalsin interfacejava.util.List<java.lang.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 interfacejava.util.Collection<java.lang.Object>- Specified by:
hashCodein interfacejava.util.List<java.lang.Object>- Overrides:
hashCodein classJDFNumList
-
addIntegerList
@Deprecated public void addIntegerList(JDFIntegerList il)
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
public JDFIntegerList addX(int x)
add - add an int to the vector- Parameters:
x- the int value
-
add
@Deprecated public void add(JDFIntegerList il)
Deprecated.- usa addAlladd - adds a complete integer list to the vector- Parameters:
il- the given integer list
-
add
public void add(java.lang.String s) throws java.util.zip.DataFormatExceptionadd - adds a integer list string to the existing integer list- Parameters:
s- the given string- Throws:
java.util.zip.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
public JDFIntegerList setIntX(int pos, int val)
-
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
public JDFIntegerList scale(double factor)
must keep this because otherwise the object vector gets corrupted with Double objects- Overrides:
scalein classJDFNumList- Returns:
- See Also:
JDFNumList.scale(double)
-
shift
public JDFIntegerList shift(int shift)
must keep this because otherwise the object vector gets corrupted with Double objects- See Also:
JDFNumList.scale(double)
-
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
public JDFIntegerList setIntX(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- Returns:
-
abs
public JDFNumList abs()
Description copied from class:JDFNumListmodify numlist to absolute values- Overrides:
absin classJDFNumList- Returns:
- See Also:
JDFNumList.abs()
-
subtract
public JDFIntegerList subtract(JDFNumList l)
subtract l from this,- Overrides:
subtractin classJDFNumList- Parameters:
l- the list to subtract from this- Throws:
java.lang.IllegalArgumentException- if sizes don't match
-
-