org.eobjects.metamodel.data
Class AbstractRow

java.lang.Object
  extended by org.eobjects.metamodel.data.AbstractRow
All Implemented Interfaces:
Serializable, Cloneable, Row
Direct Known Subclasses:
DefaultRow

public abstract class AbstractRow
extends Object
implements Cloneable, Row

An abstract row that decorates another row. Useful for virtual data that may e.g. be converting physical data etc.

See Also:
Serialized Form

Constructor Summary
AbstractRow()
           
 
Method Summary
protected  Row clone()
           
 boolean equals(Object obj)
           
protected abstract  DataSetHeader getHeader()
           
 SelectItem[] getSelectItems()
          Gets the select items that represent the columns of the DataSet that this row pertains to.
 Style getStyle(Column column)
           
 Style getStyle(SelectItem item)
           
 Style[] getStyles()
           
 Row getSubSelection(DataSetHeader header)
          Creates a row similar to this one but only with a subset of the values.
 Row getSubSelection(SelectItem[] selectItems)
          Creates a row similar to this one but only with a subset of the values.
 Object getValue(Column column)
          Shorthand method for getting the value of a SelectItem based on the provided column.
 Object getValue(SelectItem item)
          Gets the value of the provided SelectItem.
 Object[] getValues()
          Gets the values of the row, represented as an object array
 int hashCode()
           
 int indexOf(Column column)
          Gets the index of a Column in the row.
 int indexOf(SelectItem item)
          Gets the index of a SelectItem in the row.
 int size()
          Gets the amount of values/columns/select items represented in this row.
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eobjects.metamodel.data.Row
getStyle, getValue
 

Constructor Detail

AbstractRow

public AbstractRow()
Method Detail

getHeader

protected abstract DataSetHeader getHeader()

hashCode

public final int hashCode()
Overrides:
hashCode in class Object

equals

public final boolean equals(Object obj)
Overrides:
equals in class Object

toString

public final String toString()
Overrides:
toString in class Object

getValue

public final Object getValue(SelectItem item)
Description copied from interface: Row
Gets the value of the provided SelectItem.

Specified by:
getValue in interface Row
Returns:
the value that corresponds to the provided SelectItem. Can be null if either the value is null or if no value exists that matches the SelectItem.

getStyle

public final Style getStyle(SelectItem item)
Specified by:
getStyle in interface Row

getStyle

public final Style getStyle(Column column)
Specified by:
getStyle in interface Row

getValues

public Object[] getValues()
Description copied from interface: Row
Gets the values of the row, represented as an object array

Specified by:
getValues in interface Row
Returns:
an array of objects, containing the values of this row.

getValue

public final Object getValue(Column column)
Description copied from interface: Row
Shorthand method for getting the value of a SelectItem based on the provided column. Invoking this method is equivalent to invoking getValue(new SelectItem(column)).

Specified by:
getValue in interface Row
Returns:
the value of the specified column

indexOf

public final int indexOf(SelectItem item)
Description copied from interface: Row
Gets the index of a SelectItem in the row.

Specified by:
indexOf in interface Row
Parameters:
item - the item to get the index of
Returns:
the index of a SelectItem in the row. If the SelectItem is not found -1 will be returned.

indexOf

public final int indexOf(Column column)
Description copied from interface: Row
Gets the index of a Column in the row.

Specified by:
indexOf in interface Row
Parameters:
column - the column to get the index of
Returns:
the index of a column in the row. If the Column is not found, -1 will be returned.

getSubSelection

public Row getSubSelection(SelectItem[] selectItems)
Description copied from interface: Row
Creates a row similar to this one but only with a subset of the values.

Specified by:
getSubSelection in interface Row
Parameters:
selectItems - the select items (~ columns) to sub-select the row with
Returns:
a new Row object containing only the select items requested

getSelectItems

public final SelectItem[] getSelectItems()
Description copied from interface: Row
Gets the select items that represent the columns of the DataSet that this row pertains to.

Specified by:
getSelectItems in interface Row
Returns:

size

public final int size()
Description copied from interface: Row
Gets the amount of values/columns/select items represented in this row.

Specified by:
size in interface Row
Returns:

getStyles

public Style[] getStyles()
Specified by:
getStyles in interface Row

clone

protected Row clone()
Overrides:
clone in class Object

getSubSelection

public final Row getSubSelection(DataSetHeader header)
Description copied from interface: Row
Creates a row similar to this one but only with a subset of the values.

Specified by:
getSubSelection in interface Row
Parameters:
header - the new header to sub-select the row with
Returns:
a new Row object containing only the select items in the newly requested header


Copyright © 2007-2013. All Rights Reserved.