com.enspire.gemini.bidirectional
Class BidirectionalCollection

java.lang.Object
  extended by com.enspire.collections.decorator.CollectionDecorator
      extended by com.enspire.gemini.bidirectional.BidirectionalCollection
All Implemented Interfaces:
BidirectionalProperty, java.lang.Iterable, java.util.Collection

public class BidirectionalCollection
extends com.enspire.collections.decorator.CollectionDecorator
implements BidirectionalProperty

e-nspire site

This Collection updates the corresponding opposite property of its elements, both simple and container properties. It is intended to represent one end of a bidirectional association. It must be supplied with RelationshipUpdater to know which property of the containing objects represents the opposite end. It decorates another Collection.

Since:
1.0
Author:
Dragan Djuric

Constructor Summary
BidirectionalCollection()
           
 
Method Summary
 boolean add(java.lang.Object object)
          Adds the object to the collection and updates the opposite property of the added object.
 boolean addAll(java.util.Collection coll)
           
 void clear()
          Unsupported operation.
protected  java.util.Collection getDecoratedCollection()
           
 java.lang.String getOppositeName()
          Gets the name of the opposite property.
 java.lang.Object getOwner()
          Gets the owner of this object.
 java.lang.Object getPropertyValue()
          Gets the value (e.g.
 RelationshipUpdater getRelationshipUpdater()
          Gets the updater of the another end of the represented relationship.
 java.util.Iterator iterator()
           
 boolean remove(java.lang.Object object)
          Removes the object from the collection and updates the opposite property of the removed object.
 boolean removeAll(java.util.Collection coll)
           
 boolean retainAll(java.util.Collection coll)
          Unsupported operation.
 void setOppositeName(java.lang.String oppositeName)
          Sets the name of the opposite property.
 void setOwner(java.lang.Object owner)
          Sets the owner of this object.
 void setPropertyValue(java.lang.Object propertyValue)
          Sets the value (e.g.
 void setRelationshipUpdater(RelationshipUpdater relationshipUpdater)
          Sets the updater of the another end of the represented relationship.
 
Methods inherited from class com.enspire.collections.decorator.CollectionDecorator
contains, containsAll, isEmpty, size, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

BidirectionalCollection

public BidirectionalCollection()
Method Detail

getRelationshipUpdater

public RelationshipUpdater getRelationshipUpdater()
Description copied from interface: BidirectionalProperty
Gets the updater of the another end of the represented relationship.

Specified by:
getRelationshipUpdater in interface BidirectionalProperty
Returns:
relationshipUpdater the updater of the another end of the represented relationship
See Also:
BidirectionalProperty.getRelationshipUpdater()

setRelationshipUpdater

public void setRelationshipUpdater(RelationshipUpdater relationshipUpdater)
Description copied from interface: BidirectionalProperty
Sets the updater of the another end of the represented relationship.

Specified by:
setRelationshipUpdater in interface BidirectionalProperty
Parameters:
relationshipUpdater - the updater of the another end of the represented relationship
See Also:
BidirectionalProperty.setRelationshipUpdater(com.enspire.gemini.RelationshipUpdater)

getOppositeName

public java.lang.String getOppositeName()
Description copied from interface: BidirectionalProperty
Gets the name of the opposite property.

Specified by:
getOppositeName in interface BidirectionalProperty
Returns:
name the name of the opposite property
See Also:
BidirectionalProperty.getOppositeName()

setOppositeName

public void setOppositeName(java.lang.String oppositeName)
Description copied from interface: BidirectionalProperty
Sets the name of the opposite property.

Specified by:
setOppositeName in interface BidirectionalProperty
See Also:
BidirectionalProperty.setOppositeName(java.lang.String)

getOwner

public java.lang.Object getOwner()
Description copied from interface: BidirectionalProperty
Gets the owner of this object.

Specified by:
getOwner in interface BidirectionalProperty
Returns:
the owner
See Also:
BidirectionalProperty.getOwner()

setOwner

public void setOwner(java.lang.Object owner)
Description copied from interface: BidirectionalProperty
Sets the owner of this object.

Specified by:
setOwner in interface BidirectionalProperty
Parameters:
owner - new value
See Also:
BidirectionalProperty.setOwner(java.lang.Object)

getPropertyValue

public java.lang.Object getPropertyValue()
Description copied from interface: BidirectionalProperty
Gets the value (e.g. the wrapped object) of the property.

Specified by:
getPropertyValue in interface BidirectionalProperty
Returns:
value
See Also:
BidirectionalProperty.getPropertyValue()

setPropertyValue

public void setPropertyValue(java.lang.Object propertyValue)
Description copied from interface: BidirectionalProperty
Sets the value (e.g. the wrapped object) of the property.

Specified by:
setPropertyValue in interface BidirectionalProperty
See Also:
com.enspire.gemini.BidirectionalProperty#setPropertyValue(java.lang.String)

getDecoratedCollection

protected java.util.Collection getDecoratedCollection()
Specified by:
getDecoratedCollection in class com.enspire.collections.decorator.CollectionDecorator
See Also:
ListDecorator.getDecoratedCollection()

add

public boolean add(java.lang.Object object)
Adds the object to the collection and updates the opposite property of the added object.

Specified by:
add in interface java.util.Collection
Overrides:
add in class com.enspire.collections.decorator.CollectionDecorator
See Also:
Collection.add(java.lang.Object)

remove

public boolean remove(java.lang.Object object)
Removes the object from the collection and updates the opposite property of the removed object.

Specified by:
remove in interface java.util.Collection
Overrides:
remove in class com.enspire.collections.decorator.CollectionDecorator
See Also:
Collection.remove(java.lang.Object)

addAll

public boolean addAll(java.util.Collection coll)
Specified by:
addAll in interface java.util.Collection
Overrides:
addAll in class com.enspire.collections.decorator.CollectionDecorator
See Also:
Collection.addAll(java.util.Collection)

removeAll

public boolean removeAll(java.util.Collection coll)
Specified by:
removeAll in interface java.util.Collection
Overrides:
removeAll in class com.enspire.collections.decorator.CollectionDecorator
See Also:
Collection.removeAll(java.util.Collection)

retainAll

public boolean retainAll(java.util.Collection coll)
Unsupported operation.

Specified by:
retainAll in interface java.util.Collection
Overrides:
retainAll in class com.enspire.collections.decorator.CollectionDecorator
See Also:
Collection.retainAll(java.util.Collection)

clear

public void clear()
Unsupported operation.

Specified by:
clear in interface java.util.Collection
Overrides:
clear in class com.enspire.collections.decorator.CollectionDecorator
See Also:
Collection.clear()

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface java.lang.Iterable
Specified by:
iterator in interface java.util.Collection
Overrides:
iterator in class com.enspire.collections.decorator.CollectionDecorator
See Also:
CollectionDecorator.iterator()


Copyright © 2005 e-nspire. All Rights Reserved.