oracle.adf.view.faces.model
Class RowKeySet

java.lang.Object
  |
  +--oracle.adf.view.faces.model.RowKeySet
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public abstract class RowKeySet
extends java.lang.Object
implements java.io.Externalizable

Implements a set of rowKeys. This set is connected with a CollectionModel and is actually a subset of the rowKeys contained by the CollectionModel. This set is used to group together rows that have a common UI property. For example, all the rows that are currently selected by a user might be placed in a single RowKeySet.

This class has very efficient implementations for addAll, removeAll and invertAll.

See Also:
Serialized Form

Constructor Summary
RowKeySet()
          Creates an initially empty RowKeySet.
RowKeySet(boolean addAll)
          Creates a new RowKeySet.
 
Method Summary
 boolean add()
          Adds the current rowKey to this set.
 void addAll()
          Adds every rowKey to this set.
protected abstract  CollectionModel getModel()
          Gets the CollectionModel associated with this set.
 java.util.Iterator getRowKeyIterator()
          Gets an iteration of all the rowKeys contained in this set.
 int getSize()
          Gets the number of rowKeys in this set (if known).
 boolean invert()
          Adds the current rowKey to this set if it doesn't already exist, removes it otherwise.
 void invertAll()
          Inverts this set.
 boolean isContained()
          Checks to see the current rowKey is contained by this set.
 void readExternal(java.io.ObjectInput in)
           
 boolean remove()
          Removes the current rowKey from this set.
 void removeAll()
          Removes every rowKey from this set.
 void setContained(boolean add)
          Adds or removes the current rowKey.
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RowKeySet

public RowKeySet()
Creates an initially empty RowKeySet.


RowKeySet

public RowKeySet(boolean addAll)
Creates a new RowKeySet.

Parameters:
addAll - whether to add every rowKey to this set.
Method Detail

isContained

public boolean isContained()
Checks to see the current rowKey is contained by this set.

Returns:
true if this set contains the current rowKey

setContained

public void setContained(boolean add)
Adds or removes the current rowKey.

Parameters:
add - if true, the current rowKey is added to this set. if false, the current rowKey is removed from this set.

add

public boolean add()
Adds the current rowKey to this set.

Returns:
true if this set changed

remove

public boolean remove()
Removes the current rowKey from this set.

Returns:
true if this set changed

invert

public boolean invert()
Adds the current rowKey to this set if it doesn't already exist, removes it otherwise.

Returns:
true if the row is now added. false otherwise.

invertAll

public void invertAll()
Inverts this set. All of the contents of this set will be removed. Then rowKeys that were not previously in this set will be added. This method executes in constant time.


addAll

public void addAll()
Adds every rowKey to this set. This method executes in constant time.


removeAll

public void removeAll()
Removes every rowKey from this set. This method executes in constant time.


getRowKeyIterator

public java.util.Iterator getRowKeyIterator()
Gets an iteration of all the rowKeys contained in this set.

Returns:
each entry is a rowKey. The CollectionModel should not be mutated while the iterator is being used.

getSize

public int getSize()
Gets the number of rowKeys in this set (if known).

Returns:
-1 if the number of rowKeys is unknown.

getModel

protected abstract CollectionModel getModel()
Gets the CollectionModel associated with this set. The current rowKey (that is used by some of the methods in this class) is obtained from this CollectionModel.


writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException


Copyright © 2003-2004 Oracle Corporation. All Rights Reserved.