Class JDFNumberList

  • 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 JDFNumberList
    extends JDFNumList
    This class is a representation of a number list (JDFNumberList). It is a whitespace separated list of double values.
    See Also:
    Serialized Form
    • Constructor Detail

      • JDFNumberList

        public JDFNumberList​(double[] array)
      • JDFNumberList

        public JDFNumberList​(JDFNumList nl)
                      throws java.util.zip.DataFormatException
        Throws:
        java.util.zip.DataFormatException
      • JDFNumberList

        public JDFNumberList()
      • JDFNumberList

        public JDFNumberList​(java.lang.String s)
                      throws java.util.zip.DataFormatException
        constructs a number list with the given string
        Parameters:
        s - the given String
        Throws:
        java.util.zip.DataFormatException - - if the String has not a valid format
      • JDFNumberList

        @Deprecated
        public JDFNumberList​(java.util.Vector v)
                      throws java.util.zip.DataFormatException
        Deprecated.
        use typesafe constructors
        constructs a number list with the given vector
        Parameters:
        v - the given vector
        Throws:
        java.util.zip.DataFormatException - - if the Vector has not a valid format
    • Method Detail

      • createNumberList

        public static JDFNumberList createNumberList​(java.lang.String s)
        factory for JDFNumberList that silently returns null in case of illegal strings
        Parameters:
        s - the string to parse
        Returns:
        the JDFNumberList, null if s is not compatible
      • isValid

        public boolean isValid()
                        throws java.util.zip.DataFormatException
        isValid - true if all instances are Double 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
      • add

        public void add​(double x)
        add - add a double value to the vector
        Parameters:
        x - the double value
      • add

        public void add​(java.lang.String s)
                 throws java.util.zip.DataFormatException
        add - adds a number list to the already existing number list
        Parameters:
        s - the given string
        Throws:
        java.util.zip.DataFormatException - - if the String has not a valid format
      • contains

        public boolean contains​(double d)
        return true if at least one value in the list is d
        Parameters:
        d - the value to search
        Returns: