fr.cnes.sirius.patrius.tools.ephemerisComparator
Class Data<T>

java.lang.Object
  extended by fr.cnes.sirius.patrius.tools.ephemerisComparator.Data<T>
Type Parameters:
T - this is used to specify which type of Data is stored in the object.
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ComparisonData, MeaningfulData, ThresholdsData

public class Data<T>
extends Object
implements Serializable

This class represents a set of columns, which values are Ts.

Since:
1.0
Version:
$Id: Data.java 17581 2017-05-10 12:47:31Z bignon $
Author:
Philippe Pavero
See Also:
Serialized Form
Concurrency :
not thread-safe
Concurrency comment :
matches the concurrency of the parameter type : using an immutable type is HIGHLY recommended

Constructor Summary
Data(ArrayList<ArrayList<T>> clmns)
          this constructor initialises the columns
 
Method Summary
 Data<T> extractData(int[] columnIndexes)
          Extracts several columns from this Data object and produces a Data object from them.
 ArrayList<T> getColumn(int columnIndex)
          Gets a column.
 int getColumnNumber()
          Gets the number of columns.
 ArrayList<T> getLine(int lineIndex)
          Gets a line.
 int getLineNumber()
          gets the number of lines in the data table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Data

public Data(ArrayList<ArrayList<T>> clmns)
this constructor initialises the columns

Parameters:
clmns - the columns to put in the attribute
Throws:
EphemerisComparatorRuntimeException - when columns is null
Since:
1.0
Method Detail

getColumn

public final ArrayList<T> getColumn(int columnIndex)
Gets a column.

Parameters:
columnIndex - the index of the column to return
Returns:
the column which index was specified
Since:
1.0

getColumnNumber

public final int getColumnNumber()
Gets the number of columns.

Returns:
the number of columns
Since:
1.0

getLine

public final ArrayList<T> getLine(int lineIndex)
Gets a line.

Parameters:
lineIndex - the index of the line to return
Returns:
the line which index was specified
Since:
1.0

getLineNumber

public final int getLineNumber()
gets the number of lines in the data table

Returns:
the length of the first column
Since:
1.0

extractData

public final Data<T> extractData(int[] columnIndexes)
Extracts several columns from this Data object and produces a Data object from them.

Parameters:
columnIndexes - the table that contains all the indexes of the columns to extract.
Returns:
the Data object constructed from the extracted columns. The columns inside of it are in the same order than the given indexes.
Since:
1.0


Copyright © 2017 CNES. All Rights Reserved.