org.jdesktop.dataset
Class DataRelation

java.lang.Object
  extended by org.jdesktop.dataset.DataRelation

public class DataRelation
extends java.lang.Object

Author:
rbair

Field Summary
protected static java.lang.String DEFAULT_NAME_PREFIX
          Used as a prefix for auto-generated DataRelation names.
 
Constructor Summary
protected DataRelation(DataSet ds)
          Create a new DataRelation
protected DataRelation(DataSet ds, java.lang.String name)
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a PropertyChangeListener to this class for any changes to bean properties.
 void addPropertyChangeListener(java.lang.String property, java.beans.PropertyChangeListener listener)
          Adds a PropertyChangeListener to this class for specific property changes.
 DataColumn getChildColumn()
           
 DataSet getDataSet()
           
 java.lang.String getName()
           
 DataColumn getParentColumn()
           
 java.util.List<DataRow> getRows(DataRow parentRow)
          Given a DataRow from the parent DataTable, return a list of related DataRows from the child DataTable.
 java.util.List<DataRow> getRows(DataRow[] parentRows)
          Given an array of DataRows, produce the union of the results for each DataRow from the child DataTable
 java.util.List<DataRow> getRows(int parentRowIndex)
          Given the index of a row in the parent DataTable, produce a corrosponding list of related rows from the child DataTable
 java.util.List<DataRow> getRows(int[] parentRowIndices)
          Given an array if parent row indices, produce the union of the results for each index from the child DataTable
 java.util.List<DataRow> getRows(java.util.List<java.lang.Integer> parentRowIndices)
          Given a List of indices, produce the union of the results for each index from the child DataTable
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Stops notifying a specific listener of any changes to bean properties.
 void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
          Stops notifying a specific listener of changes to a specific property.
 void setChildColumn(DataColumn childColumn)
          sets the child DataColumn in this parent/child relation
 void setName(java.lang.String name)
          Set the name of the DataRelation
 void setParentColumn(DataColumn parentColumn)
          Sets the DataColumn that is the parent in this parent/child relation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_NAME_PREFIX

protected static final java.lang.String DEFAULT_NAME_PREFIX
Used as a prefix for auto-generated DataRelation names.

See Also:
Constant Field Values
Constructor Detail

DataRelation

protected DataRelation(DataSet ds)
Create a new DataRelation


DataRelation

protected DataRelation(DataSet ds,
                       java.lang.String name)
Method Detail

getDataSet

public DataSet getDataSet()
Returns:
the DataSet that this DataRelation belongs to

setName

public void setName(java.lang.String name)
Set the name of the DataRelation

Parameters:
name -

getName

public java.lang.String getName()
Returns:
The name of this DataRelation

getParentColumn

public DataColumn getParentColumn()
Returns:
the DataColumn that is the parent in this parent/child relation

setParentColumn

public void setParentColumn(DataColumn parentColumn)
Sets the DataColumn that is the parent in this parent/child relation. The value in the parentColumn for a specified range of field indices will be used to generate the list of child Rows.

Parameters:
parentColumn -

getChildColumn

public DataColumn getChildColumn()
Returns:
The child DataColumn in this parent/child relation

setChildColumn

public void setChildColumn(DataColumn childColumn)
sets the child DataColumn in this parent/child relation

Parameters:
childColumn -

getRows

public java.util.List<DataRow> getRows(DataRow parentRow)
Given a DataRow from the parent DataTable, return a list of related DataRows from the child DataTable.

Parameters:
parentRow -

getRows

public java.util.List<DataRow> getRows(int parentRowIndex)
Given the index of a row in the parent DataTable, produce a corrosponding list of related rows from the child DataTable

Parameters:
parentRowIndex -

getRows

public java.util.List<DataRow> getRows(DataRow[] parentRows)
Given an array of DataRows, produce the union of the results for each DataRow from the child DataTable

Parameters:
parentRows -

getRows

public java.util.List<DataRow> getRows(int[] parentRowIndices)
Given an array if parent row indices, produce the union of the results for each index from the child DataTable

Parameters:
parentRowIndices -

getRows

public java.util.List<DataRow> getRows(java.util.List<java.lang.Integer> parentRowIndices)
Given a List of indices, produce the union of the results for each index from the child DataTable

Parameters:
parentRowIndices -

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener to this class for any changes to bean properties.

Parameters:
listener - The PropertyChangeListener to notify of changes to this instance.

addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String property,
                                      java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener to this class for specific property changes.

Parameters:
property - The name of the property to listen to changes for.
listener - The PropertyChangeListener to notify of changes to this instance.

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Stops notifying a specific listener of any changes to bean properties.

Parameters:
listener - The listener to stop receiving notifications.

removePropertyChangeListener

public void removePropertyChangeListener(java.lang.String propertyName,
                                         java.beans.PropertyChangeListener listener)
Stops notifying a specific listener of changes to a specific property.

Parameters:
propertyName - The name of the property to ignore from now on.
listener - The listener to stop receiving notifications.


Copyright © 2005 Sun Microsystems All Rights Reserved.