pl.edu.agh.cast.rawdata
Class DataRow

java.lang.Object
  extended by pl.edu.agh.cast.rawdata.logging.AbstractRawDataMonitorable
      extended by pl.edu.agh.cast.rawdata.DataRow
All Implemented Interfaces:
IRawDataMonitorable

public class DataRow
extends AbstractRawDataMonitorable

Class which represents one row of data read from source data file. It contains list of strings object each representing one cell.

Author:
AGH CAST Team

Field Summary
static int UNSPECIFIED_ROW_NUMBER
          Indicates that row has unspecified number in tabular data.
 
Constructor Summary
DataRow()
          Default constructor.
 
Method Summary
 void add(int index, String element)
          Inserts the specified element at the specified position in this list.
 boolean add(String element)
          Appends the specified element to the end of this list.
 String get(int index)
          Returns the element at the specified position in this list.
 int getRowNumber()
           
 Object remove(int index)
          Removes the element at the specified position in this list.
 String replace(int index, String element)
          Replaces cells specified by index, by element.
 int size()
          Returns the number of elements in this list.
 String toString()
          
 
Methods inherited from class pl.edu.agh.cast.rawdata.logging.AbstractRawDataMonitorable
getObservers, registerObserver, unregisterObserver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNSPECIFIED_ROW_NUMBER

public static final int UNSPECIFIED_ROW_NUMBER
Indicates that row has unspecified number in tabular data.

See Also:
Constant Field Values
Constructor Detail

DataRow

public DataRow()
Default constructor.

Method Detail

getRowNumber

public int getRowNumber()

replace

public String replace(int index,
                      String element)
Replaces cells specified by index, by element.

Parameters:
index - index of cell to replace
element - new element
Returns:
new element or null if specified index is out of bounds

add

public boolean add(String element)
Appends the specified element to the end of this list.

Parameters:
element - element to be inserted
Returns:
true (as per the general contract of Collection.add).

add

public void add(int index,
                String element)
         throws IndexOutOfBoundsException
Inserts the specified element at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

Parameters:
index - index at which the specified element is to be inserted
element - element to be inserted
Throws:
IndexOutOfBoundsException - if the specified index is out of range (index < 0 || index > size()).

size

public int size()
Returns the number of elements in this list.

Returns:
the number of elements in this list.

get

public String get(int index)
           throws IndexOutOfBoundsException
Returns the element at the specified position in this list.

Parameters:
index - index of element to return
Returns:
the element at the specified position in this list.
Throws:
IndexOutOfBoundsException - if the specified index is out of range (index < 0 || index > size()).

remove

public Object remove(int index)
              throws IndexOutOfBoundsException
Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.

Parameters:
index - the index of the element to removed
Returns:
the element previously at the specified position.
Throws:
IndexOutOfBoundsException - if the specified index is out of range (index < 0 || index > size()).

toString

public String toString()

Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.