Class 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
    • Constructor Detail

      • JDFIntegerList

        public JDFIntegerList()
        constructs an empty range list
      • JDFIntegerList

        public JDFIntegerList​(java.lang.String s)
                       throws java.util.zip.DataFormatException
        constructs 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

      • getIntegerList

        @Deprecated
        public static JDFIntegerList getIntegerList​(java.lang.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​(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.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:
        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:
        equals in interface java.util.Collection<java.lang.Object>
        Specified by:
        equals in interface java.util.List<java.lang.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 java.util.Collection<java.lang.Object>
        Specified by:
        hashCode in interface java.util.List<java.lang.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
      • 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 addAll
        add - 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.DataFormatException
        add - 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
      • 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
      • 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
      • 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:
      • subtract

        public JDFIntegerList subtract​(JDFNumList l)
        subtract l from this,
        Overrides:
        subtract in class JDFNumList
        Parameters:
        l - the list to subtract from this
        Throws:
        java.lang.IllegalArgumentException - if sizes don't match