org.scopemvc.model.collection
Class SetModel

java.lang.Object
  |
  +--org.scopemvc.model.basic.BasicModel
        |
        +--org.scopemvc.model.collection.SetModel
All Implemented Interfaces:
java.util.Collection, ModelChangeEventSource, ModelChangeListener, ModelChangeTypes, java.util.Set

public class SetModel
extends BasicModel
implements java.util.Set

A BasicModel wrapper for an Set that can propagate changes to contained Models up the Model hierarchy. The set itself is exposed via the "set" property, however, changes to this underlying set must be made through this class's public API in order to maintain the event propagation.

By default SetModel registers itself as a listener to Models that are added to the list and deregisters when those Models are removed. This behaviour can be changed at creation so that ModelChangeEvent propagation from contained models is disabled.

Version:
$Revision: 1.9 $
Author:
Steve Meyfroidt

Field Summary
protected  java.util.Set contents
          TODO: describe of the Field
protected  boolean propagateModelChanges
          TODO: describe of the Field
static Selector SET
          TODO: describe of the Field
protected static java.lang.String TO_STRING_SEPARATOR
          TODO: describe of the Field
protected static int TO_STRING_SEPARATOR_LENGTH
          TODO: describe of the Field
 
Fields inherited from interface org.scopemvc.core.ModelChangeTypes
ACCESS_CHANGED, VALUE_ADDED, VALUE_CHANGED, VALUE_REMOVED
 
Constructor Summary
SetModel()
          Constructor for the SetModel object
SetModel(boolean inPropagateModelChanges)
          Constructor for the SetModel object
SetModel(boolean inPropagateModelChanges, java.util.Set inSet)
          Constructor for the SetModel object
SetModel(java.util.Set inSet)
          Constructor for the SetModel object
 
Method Summary
 boolean add(java.lang.Object o)
          TODO: document the method
 boolean addAll(java.util.Collection c)
          Adds an element to the All attribute of the SetModel object
 void clear()
          TODO: document the method
 boolean contains(java.lang.Object arg0)
          TODO: document the method
 boolean containsAll(java.util.Collection arg0)
          TODO: document the method
 boolean equals(java.lang.Object o)
          TODO: document the method
 java.util.Set getSet()
          Gets the set
 int getSize()
          Gets the size
 int hashCode()
          TODO: document the method
 boolean isEmpty()
          Gets the empty
 java.util.Iterator iterator()
          TODO: document the method
 void modelChanged(ModelChangeEvent inEvent)
          TODO: document the method
 boolean remove(java.lang.Object o)
          TODO: document the method
 boolean removeAll(java.util.Collection c)
          TODO: document the method
 boolean retainAll(java.util.Collection c)
          TODO: document the method
 void setSet(java.util.Set inContents)
          Set contents to the passed Object list and fire a ModelChangeEvent.
 int size()
          TODO: document the method
 java.lang.Object[] toArray()
          TODO: document the method
 java.lang.Object[] toArray(java.lang.Object[] arg0)
          TODO: document the method
 java.lang.String toString()
          TODO: document the method
 
Methods inherited from class org.scopemvc.model.basic.BasicModel
addModelChangeListener, fireModelChange, listenNewSubmodel, makeActive, removeModelChangeListener, unlistenOldSubmodel
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SET

public static final Selector SET
TODO: describe of the Field


TO_STRING_SEPARATOR

protected static final java.lang.String TO_STRING_SEPARATOR
TODO: describe of the Field

See Also:
Constant Field Values

TO_STRING_SEPARATOR_LENGTH

protected static final int TO_STRING_SEPARATOR_LENGTH
TODO: describe of the Field


contents

protected java.util.Set contents
TODO: describe of the Field


propagateModelChanges

protected boolean propagateModelChanges
TODO: describe of the Field

Constructor Detail

SetModel

public SetModel()
Constructor for the SetModel object


SetModel

public SetModel(java.util.Set inSet)
Constructor for the SetModel object

Parameters:
inSet - TODO: Describe the Parameter

SetModel

public SetModel(boolean inPropagateModelChanges)
Constructor for the SetModel object

Parameters:
inPropagateModelChanges - TODO: Describe the Parameter

SetModel

public SetModel(boolean inPropagateModelChanges,
                java.util.Set inSet)
Constructor for the SetModel object

Parameters:
inPropagateModelChanges - TODO: Describe the Parameter
inSet - TODO: Describe the Parameter
Method Detail

getSet

public java.util.Set getSet()
Gets the set

Returns:
The set value

getSize

public int getSize()
Gets the size

Returns:
The size value

isEmpty

public boolean isEmpty()
Gets the empty

Specified by:
isEmpty in interface java.util.Set
Returns:
The empty value

setSet

public void setSet(java.util.Set inContents)
Set contents to the passed Object list and fire a ModelChangeEvent.

Parameters:
inContents - The new set value

modelChanged

public void modelChanged(ModelChangeEvent inEvent)
TODO: document the method

Specified by:
modelChanged in interface ModelChangeEventSource
Overrides:
modelChanged in class BasicModel
Parameters:
inEvent - TODO: Describe the Parameter

toString

public java.lang.String toString()
TODO: document the method

Overrides:
toString in class java.lang.Object
Returns:
TODO: Describe the Return Value

size

public int size()
TODO: document the method

Specified by:
size in interface java.util.Set
Returns:
TODO: Describe the Return Value

contains

public boolean contains(java.lang.Object arg0)
TODO: document the method

Specified by:
contains in interface java.util.Set
Parameters:
arg0 - TODO: Describe the Parameter
Returns:
TODO: Describe the Return Value

iterator

public java.util.Iterator iterator()
TODO: document the method

Specified by:
iterator in interface java.util.Set
Returns:
TODO: Describe the Return Value

toArray

public java.lang.Object[] toArray()
TODO: document the method

Specified by:
toArray in interface java.util.Set
Returns:
TODO: Describe the Return Value

toArray

public java.lang.Object[] toArray(java.lang.Object[] arg0)
TODO: document the method

Specified by:
toArray in interface java.util.Set
Parameters:
arg0 - TODO: Describe the Parameter
Returns:
TODO: Describe the Return Value

containsAll

public boolean containsAll(java.util.Collection arg0)
TODO: document the method

Specified by:
containsAll in interface java.util.Set
Parameters:
arg0 - TODO: Describe the Parameter
Returns:
TODO: Describe the Return Value

add

public boolean add(java.lang.Object o)
TODO: document the method

Specified by:
add in interface java.util.Set
Parameters:
o - TODO: Describe the Parameter
Returns:
TODO: Describe the Return Value

remove

public boolean remove(java.lang.Object o)
TODO: document the method

Specified by:
remove in interface java.util.Set
Parameters:
o - TODO: Describe the Parameter
Returns:
TODO: Describe the Return Value

addAll

public boolean addAll(java.util.Collection c)
Adds an element to the All attribute of the SetModel object

Specified by:
addAll in interface java.util.Set
Parameters:
c - The element to be added to the All attribute
Returns:
TODO: Describe the Return Value

retainAll

public boolean retainAll(java.util.Collection c)
TODO: document the method

Specified by:
retainAll in interface java.util.Set
Parameters:
c - TODO: Describe the Parameter
Returns:
TODO: Describe the Return Value

removeAll

public boolean removeAll(java.util.Collection c)
TODO: document the method

Specified by:
removeAll in interface java.util.Set
Parameters:
c - TODO: Describe the Parameter
Returns:
TODO: Describe the Return Value

clear

public void clear()
TODO: document the method

Specified by:
clear in interface java.util.Set

equals

public boolean equals(java.lang.Object o)
TODO: document the method

Specified by:
equals in interface java.util.Set
Overrides:
equals in class java.lang.Object
Parameters:
o - TODO: Describe the Parameter
Returns:
TODO: Describe the Return Value

hashCode

public int hashCode()
TODO: document the method

Specified by:
hashCode in interface java.util.Set
Overrides:
hashCode in class java.lang.Object
Returns:
TODO: Describe the Return Value


Copyright © 2000-2002 The Scope Team. All Rights Reserved.