org.opensha.commons.data.function
Class XY_DataSetList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<XY_DataSet>
              extended by org.opensha.commons.data.function.XY_DataSetList
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<XY_DataSet>, java.util.Collection<XY_DataSet>, java.util.List<XY_DataSet>, java.util.RandomAccess

public class XY_DataSetList
extends java.util.ArrayList<XY_DataSet>
implements java.io.Serializable

Title: XY_DataSetList

Description: List container for XY Datasets. This class stores XY_DataSetAPI ( and any subclass ) internally in an array list and provides standard list access functions such as (paraphrasing) get(), set(), delete(), iterator(), size(), etc.

Currently any type of XY_DataSetAPI is allowed in the list. Subclasses can overide isFunctionAllowed() to provide added constraints on what can belong in this list.

Note: Since this class behaves like an ArrayList, functions in the list may be accessed by index, or by iterator.

Version:
1.0
Author:
Steven W. Rock
See Also:
Serialized Form

Field Summary
protected static java.lang.String C
           
protected static boolean D
           
protected  java.lang.String info
          Every function list has a information string that can be used in displays, etc.
protected  java.lang.String name
          Every function list have a name for identifying it amoung several
protected  java.lang.String xAxisName
          The X-Axis name, may be the same for all items in the list.
protected  java.lang.String yAxisName
          The Y-Axis name, may be the same for all items in the list.
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
XY_DataSetList()
          no arg constructor, this constructor currently is empty.
 
Method Summary
 XY_DataSetList deepClone()
          Returns a copy of this list, therefore any changes to the copy cannot affect this original list.
 boolean equals(java.lang.Object list)
          Returns true if all the DisctetizedFunctions in this list are equal.
 java.lang.String getInfo()
          Returns the info of this list
 java.lang.String getName()
          Returns the name of this list
 java.lang.String getXAxisName()
          Returns the xAxisName of this list
 java.lang.String getXYAxesName()
          Combo Name of the X and Y axis, used for determining if two DiscretizedFunction2DAPIs represent the same thing.
 java.lang.String getYAxisName()
          Returns the yAxisName of this list
 void setInfo(java.lang.String info)
          Sets the info of this list
 void setName(java.lang.String name)
          Sets the name of this list
 void setXAxisName(java.lang.String name)
          Sets the xAxisName of this list
 void setYAxisName(java.lang.String name)
          Sets the yAxisName of this list
 java.lang.String toString()
          Debugging information.
 java.lang.String toStringOld()
          Returns all datapoints in a matrix, x values in first column, first functions y vaules in second, second function's y values in the third, etc.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Field Detail

C

protected static final java.lang.String C
See Also:
Constant Field Values

D

protected static final boolean D
See Also:
Constant Field Values

info

protected java.lang.String info
Every function list has a information string that can be used in displays, etc.


name

protected java.lang.String name
Every function list have a name for identifying it amoung several


xAxisName

protected java.lang.String xAxisName
The X-Axis name, may be the same for all items in the list. .

SWR: Not sure if this is needed any more. Have to check into is.


yAxisName

protected java.lang.String yAxisName
The Y-Axis name, may be the same for all items in the list. .

SWR: Not sure if this is needed any more. Have to check into is.

Constructor Detail

XY_DataSetList

public XY_DataSetList()
no arg constructor, this constructor currently is empty.

Method Detail

getName

public java.lang.String getName()
Returns the name of this list


setName

public void setName(java.lang.String name)
Sets the name of this list


getInfo

public java.lang.String getInfo()
Returns the info of this list


setInfo

public void setInfo(java.lang.String info)
Sets the info of this list


getXAxisName

public java.lang.String getXAxisName()
Returns the xAxisName of this list


setXAxisName

public void setXAxisName(java.lang.String name)
Sets the xAxisName of this list


getYAxisName

public java.lang.String getYAxisName()
Returns the yAxisName of this list


setYAxisName

public void setYAxisName(java.lang.String name)
Sets the yAxisName of this list


getXYAxesName

public java.lang.String getXYAxesName()
Combo Name of the X and Y axis, used for determining if two DiscretizedFunction2DAPIs represent the same thing.


equals

public boolean equals(java.lang.Object list)
Returns true if all the DisctetizedFunctions in this list are equal. Equality is determined if the two lists are the same size, then calls containsAll()

Specified by:
equals in interface java.util.Collection<XY_DataSet>
Specified by:
equals in interface java.util.List<XY_DataSet>
Overrides:
equals in class java.util.AbstractList<XY_DataSet>

deepClone

public XY_DataSetList deepClone()
Returns a copy of this list, therefore any changes to the copy cannot affect this original list. A deep clone is different from a normal Java clone or shallow clone in that each function in the list is also cloned. A shallow clone would only return a new instance of this DiscretizedFuncList, but not clone the elements. It would maintain a pointer to the same elements.


toString

public java.lang.String toString()
Debugging information. Dumps the state of this object, number of functions present, and calls the toString() of each element to dump it's state.

This is the function called to format the data for raw data display in the IMRTesterApplet.

Note: SWR: Still needs work to reformat the data better. Currently output is x, y for each function seperatly. A better output format would be in spreadsheet format, since all functions in the IMRTesterApplet share the same x values. Currently not implemented.

Overrides:
toString in class java.util.AbstractCollection<XY_DataSet>

toStringOld

public java.lang.String toStringOld()
Returns all datapoints in a matrix, x values in first column, first functions y vaules in second, second function's y values in the third, etc. This function should be optimized by actually accessing the underlying TreeMap.

Note: SWR This function has been renamed from toString(). This function no longer works, but contains the formatting rules needed to still be imploemented by toString().