Documentation of 'edu.rit.numeric.ListXYZSeries' Java class
ListXYZSeries
edu.rit.numeric

Class ListXYZSeries

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable


    public class ListXYZSeries
    extends XYZSeries
    implements java.io.Externalizable
    Class ListXYZSeries provides a series of (x,y,z) triples of real values (type double); the series is variable-length.
    See Also:
    Serialized Form
    • Constructor Detail

      • ListXYZSeries

        public ListXYZSeries()
        Construct a new zero-length XYZ series.
    • Method Detail

      • length

        public int length()
        Returns the number of values in this series.
        Specified by:
        length in class XYZSeries
        Returns:
        Length.
      • x

        public double x(int i)
        Returns the given X value in this series.
        Specified by:
        x in class XYZSeries
        Parameters:
        i - Index.
        Returns:
        The X value in this series at index i.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - (unchecked exception) Thrown if i is not in the range 0 .. length()-1.
      • y

        public double y(int i)
        Returns the given Y value in this series.
        Specified by:
        y in class XYZSeries
        Parameters:
        i - Index.
        Returns:
        The Y value in this series at index i.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - (unchecked exception) Thrown if i is not in the range 0 .. length()-1.
      • z

        public double z(int i)
        Returns the given Z value in this series.
        Specified by:
        z in class XYZSeries
        Parameters:
        i - Index.
        Returns:
        The Z value in this series at index i.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - (unchecked exception) Thrown if i is not in the range 0 .. length()-1.
      • clear

        public ListXYZSeries clear()
        Clear this series.
        Returns:
        This series.
      • add

        public ListXYZSeries add(double x,
                                 double y,
                                 double z)
        Add the given data to this series.
        Parameters:
        x - X value.
        y - Y value.
        z - Z value.
        Returns:
        This series.
      • add

        public ListXYZSeries add(double... data)
        Add the given data to this series. The data values are grouped into triples, where the first data value is the X value, the second data value is the Y value, and the third data value is the Z value. Each triple of data values is added to this series as though by the add(double,double,double) method. It is assumed that the number of data values is a multiple of 3.
        Parameters:
        data - Data values.
        Returns:
        This series.
      • add

        public ListXYZSeries add(double[] x,
                                 double[] y,
                                 double[] z)
        Add the given data arrays to this series. Each element of x, y, and z is added to this series as though by the add(double,double,double) method. It is assumed that x, y, and z are the same length.
        Parameters:
        x - Array of X values.
        y - Array of Y values.
        z - Array of Z values.
        Returns:
        This series.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if x, y, or z is null.
      • add

        public ListXYZSeries add(double[] x,
                                 double[] y,
                                 double[] z,
                                 int off,
                                 int len)
        Add a portion of the given data arrays to this series. Each element of x, y, and z from index off through index off+len-1 inclusive is added to this series as though by the add(double,double,double) method.
        Parameters:
        x - Array of X values.
        y - Array of Y values.
        z - Array of Z values.
        off - Index of first element to add.
        len - Number of elements to add.
        Returns:
        This series.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if x, y, or z is null.
        java.lang.IndexOutOfBoundsException - (unchecked exception) Thrown if off < 0, len < 0, off+len > x.length, off+len > y.length, or off+len > z.length.
      • add

        public ListXYZSeries add(XYZSeries theSeries)
        Add the given XYZSeries to this series. Each corresponding X, Y, and Z value in the given X-Y-Z series is added to this series as though by the add(double,double,double) method.
        Parameters:
        theSeries - X-Y-Z series.
        Returns:
        This series.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if theSeries is null.
      • add

        public ListXYZSeries add(XYZSeries theSeries,
                                 int off,
                                 int len)
        Add a portion of the given XYZSeries to this series. Each corresponding X, Y, and Z value in the given X-Y-Z series from index off through index off+len-1 inclusive is added to this series as though by the add(double,double,double) method.
        Parameters:
        theSeries - X-Y-Z series.
        off - Index of first element to add.
        len - Number of elements to add.
        Returns:
        This series.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if theSeries is null.
        java.lang.IndexOutOfBoundsException - (unchecked exception) Thrown if off < 0, len < 0, or off+len > theSeries.length().
      • add

        public ListXYZSeries add(java.util.Scanner scanner)
        Add data read from the given scanner to this series. Double values are read from the scanner until there are no more. Each triple of consecutive double values is added to this series as though by the add(double,double,double) method. Any leftover double values are discarded. The add() method does not close the scanner when finished.

        To read data from a file, pass a scanner constructed on top of the file; to read data from an input stream, pass a scanner constructed on top of the input stream; and so on.

        Parameters:
        scanner - Scanner.
        Returns:
        This series.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if scanner is null.
      • writeExternal

        public void writeExternal(java.io.ObjectOutput out)
                           throws java.io.IOException
        Write this series to the given object output stream.
        Specified by:
        writeExternal in interface java.io.Externalizable
        Parameters:
        out - Object output stream.
        Throws:
        java.io.IOException - Thrown if an I/O error occurred.
      • readExternal

        public void readExternal(java.io.ObjectInput in)
                          throws java.io.IOException
        Read this series from the given object input stream.
        Specified by:
        readExternal in interface java.io.Externalizable
        Parameters:
        in - Object input stream.
        Throws:
        java.io.IOException - Thrown if an I/O error occurred.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.