org.cip4.jdflib.datatypes
Class JDFIntegerList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector<Object>
              extended by org.cip4.jdflib.datatypes.JDFNumList
                  extended by org.cip4.jdflib.datatypes.JDFIntegerList
All Implemented Interfaces:
Serializable, Cloneable, Iterable<Object>, Collection<Object>, List<Object>, 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 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
JDFIntegerList()
          constructs an empty range list
JDFIntegerList(int i)
          constructs an integer list with all values set via an int
JDFIntegerList(int[] iArray)
          constructs an integer list with all values set via an int[]
JDFIntegerList(JDFIntegerList il)
          constructs an integer list with all values set via a JDFIntegerList
JDFIntegerList(String s)
          constructs an integer list with all values set via a String
 
Method Summary
 JDFNumList abs()
          modify numlist to absolute values
 void add(int x)
          add - add an int to the vector
 void add(JDFIntegerList il)
          Deprecated. - usa addAll
 void add(String s)
          add - adds a integer list string to the existing integer list
 void addIntegerList(JDFIntegerList il)
          Deprecated. - use addAll()
 boolean contains(int d)
          return true if at least one value in the list is d
static JDFIntegerList createIntegerList(String s)
          convert a string to an integerlist, and return null if the string is no good
 boolean equals(Object other)
          equals - returns true if both JDFIntegerList are equal otherwise false
 int getInt(int pos)
          getInt - returns the integer at 'pos' from the list.
 int[] getIntArray()
          getIntArray - returns this integer list as an int array
static JDFIntegerList getIntegerList(String s)
          Deprecated. use createIntegerList
 int hashCode()
          hashCode complements equals() to fulfill the equals/hashCode contract
 boolean isValid()
          isValid - true if all instances are Integer types
 boolean isValidString(String st)
          isValidString - true if all instances are Double or Integer types
 JDFIntegerList scale(double factor)
          must keep this because otherwise the object vector gets corrupted with Double objects
 void setInt(int i)
          setIntArray - sets this integer list to an int
the RangeList is emptied, then the single value i is added
 void setInt(int pos, int val)
          setInt - sets the integer val at 'pos' from the list.
 void setIntArray(int[] iArray)
          setIntArray - sets this integer list to an int array
the RangeList is emptied, then the values of iArray are added
 void subtract(JDFNumList l)
          subtract l from this,
 
Methods inherited from class org.cip4.jdflib.datatypes.JDFNumList
clone, contains, containsAll, copyNumList, doubleAt, elementAt, getDoubleList, getString, getString, matches, removeElementAt, replaceElementAt, scaleFromCM, scaleFromMM, scaleToCM, scaleToMM, set, setString, 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
 
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

JDFIntegerList

public JDFIntegerList()
constructs an empty range list


JDFIntegerList

public JDFIntegerList(String s)
               throws DataFormatException
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

public JDFIntegerList(JDFIntegerList il)
               throws DataFormatException
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 Detail

isValidString

public boolean isValidString(String st)
Description copied from class: JDFNumList
isValidString - true if all instances are Double or Integer types

Overrides:
isValidString in class JDFNumList
Parameters:
st -
Returns:
true if valid
See Also:
JDFNumList.isValidString(java.lang.String)

getIntegerList

@Deprecated
public static JDFIntegerList getIntegerList(String s)
Deprecated. use 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

createIntegerList

public static JDFIntegerList createIntegerList(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 DataFormatException
isValid - true if all instances are Integer 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

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 contais d

equals

public boolean equals(Object other)
equals - returns true if both JDFIntegerList are equal otherwise false

Specified by:
equals in interface Collection<Object>
Specified by:
equals in interface List<Object>
Overrides:
equals in class JDFNumList
Returns:
boolean - true if equal otherwise false

hashCode

public int hashCode()
hashCode complements equals() to fulfill the equals/hashCode contract

Specified by:
hashCode in interface Collection<Object>
Specified by:
hashCode in interface List<Object>
Overrides:
hashCode in class JDFNumList

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

add

@Deprecated
public void add(JDFIntegerList il)
Deprecated. - usa addAll

add - adds a complete integer list to the vector

Parameters:
il - the given integer list

add

public void add(String s)
         throws DataFormatException
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

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 get
val - the value to set

scale

public JDFIntegerList scale(double factor)
must keep this because otherwise the object vector gets corrupted with Double objects

Overrides:
scale in class JDFNumList
Returns:
See Also:
JDFNumList.scale(double)

getIntArray

public int[] getIntArray()
getIntArray - returns this integer list as an int array

Overrides:
getIntArray in class JDFNumList
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

abs

public JDFNumList abs()
Description copied from class: JDFNumList
modify numlist to absolute values

Overrides:
abs in class JDFNumList
Returns:
See Also:
JDFNumList.abs()

subtract

public void subtract(JDFNumList l)
subtract l from this,

Overrides:
subtract in class JDFNumList
Parameters:
l - the list to subtract from this
Throws:
IllegalArgumentException - if sizes don't match


Copyright © 2013. All Rights Reserved.