edu.swri.swiftvis
Class DataElement

java.lang.Object
  extended by edu.swri.swiftvis.DataElement
All Implemented Interfaces:
java.io.Serializable

public class DataElement
extends java.lang.Object
implements java.io.Serializable

This class represents one "row" of data in a data file. They are immutable so that I can share them freely without having to do extra copying. When functions are applied to certain fields in them that will require the creation of new sets of them, but that would have been needed anyway. This way, as long as a function isn't applied I only have to create an array or vector or references and not duplicate all of the data. Each data element knows what DataSource it comes from so that it can give you extra information about what each parameter or value means without each one having to store that. The data in an element is separated into parameters and values. The parameters are integers for things like particle number or what type of particle. The values are the actual data and can include things like time, x, y, etc.

See Also:
Serialized Form

Constructor Summary
DataElement(DataElement de, float val)
           
DataElement(DataElement de, float[] vals)
           
DataElement(DataElement de, int par)
           
DataElement(DataElement de, int[] pars)
           
DataElement(int[] pars, float[] vals)
           
 
Method Summary
 DataElement addParam(int par)
           
 DataElement addValue(float val)
           
 int getNumParams()
           
 int getNumValues()
           
 int getParam(int which)
           
 float getValue(int which)
           
static DataElement replaceParams(DataElement de, int[] pars)
           
static DataElement replaceValues(DataElement de, float[] vals)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataElement

public DataElement(int[] pars,
                   float[] vals)

DataElement

public DataElement(DataElement de,
                   int par)

DataElement

public DataElement(DataElement de,
                   int[] pars)

DataElement

public DataElement(DataElement de,
                   float val)

DataElement

public DataElement(DataElement de,
                   float[] vals)
Method Detail

getNumParams

public int getNumParams()

getParam

public int getParam(int which)

getNumValues

public int getNumValues()

getValue

public float getValue(int which)

addParam

public DataElement addParam(int par)

addValue

public DataElement addValue(float val)

replaceParams

public static DataElement replaceParams(DataElement de,
                                        int[] pars)

replaceValues

public static DataElement replaceValues(DataElement de,
                                        float[] vals)