dk.eobjects.metamodel.data
Class Row

Package class diagram package Row
java.lang.Object
  extended by dk.eobjects.metamodel.data.Row
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class Row
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Represents a row of data in a DataSet. Each row is a mapping between SelectItems and values for each SelectItem.

See Also:
DataSet, SelectItem, Serialized Form

Constructor Summary
Row(SelectItem[] items, java.lang.Object[] values)
          Constructs a row from an array of SelectItems and an array of corresponding values
 
Method Summary
protected  Row clone()
           
 boolean equals(java.lang.Object obj)
           
 SelectItem[] getSelectItems()
           
 Row getSubSelection(SelectItem[] selectItems)
          Creates a row similar to this one but only with a subset of the select items
 java.lang.Object getValue(Column column)
          Shorthand method for getting the value of a SelectItem based on the provided column.
 java.lang.Object getValue(int index)
          Gets the value of the row at a given index
 java.lang.Object getValue(SelectItem item)
          Gets the value of the provided SelectItem.
 java.lang.Object[] getValues()
           
 int hashCode()
           
 int indexOf(SelectItem item)
          Gets the index of a SelectItem in the row.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Row

public Row(SelectItem[] items,
           java.lang.Object[] values)
Constructs a row from an array of SelectItems and an array of corresponding values

Parameters:
items - the array of SelectItems
values - the array of values
Method Detail

getValue

public java.lang.Object getValue(SelectItem item)
Gets the value of the provided SelectItem.

Parameters:
item -
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.

getValue

public java.lang.Object getValue(Column column)
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)).

Parameters:
column -
Returns:
the value of the specified column

indexOf

public int indexOf(SelectItem item)
Gets the index of a SelectItem in the row.

Parameters:
item -
Returns:
the index of a SelectItem in the row. If the SelectItem is not found -1 will be returned.

getValue

public java.lang.Object getValue(int index)
                          throws java.lang.ArrayIndexOutOfBoundsException
Gets the value of the row at a given index

Parameters:
index -
Returns:
the value at the specified index
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the provided index is out of range

getSelectItems

public SelectItem[] getSelectItems()

getValues

public java.lang.Object[] getValues()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

clone

protected Row clone()
Overrides:
clone in class java.lang.Object

getSubSelection

public Row getSubSelection(SelectItem[] selectItems)
Creates a row similar to this one but only with a subset of the select items

Parameters:
selectItems -
Returns:
a new Row object containing only the select items requested


Copyright © 2007-2010. All Rights Reserved.