com.enspire.gemini.bidirectional
Class BidirectionalList

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

public class BidirectionalList
extends com.enspire.collections.decorator.ListDecorator
implements BidirectionalProperty

e-nspire site

This List 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 List.

Since:
1.0
Author:
Dragan Djuric

Constructor Summary
BidirectionalList()
           
 
Method Summary
 void add(int index, java.lang.Object object)
           
 boolean add(java.lang.Object object)
          Adds the object to the list and updates the opposite property of the added object.
 boolean addAll(java.util.Collection coll)
           
 boolean addAll(int index, java.util.Collection coll)
           
 void clear()
          Unsupported operation.
protected  java.util.List getDecoratedList()
           
 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()
           
 java.util.ListIterator listIterator()
           
 java.util.ListIterator listIterator(int index)
           
 java.lang.Object remove(int index)
           
 boolean remove(java.lang.Object object)
          Removes the object from the list and updates the opposite property of the removed object.
 boolean removeAll(java.util.Collection coll)
           
 boolean retainAll(java.util.Collection coll)
          Unsupported operation.
 java.lang.Object set(int index, java.lang.Object object)
           
 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.
 java.util.List subList(int fromIndex, int toIndex)
           
 
Methods inherited from class com.enspire.collections.decorator.ListDecorator
get, getDecoratedCollection, indexOf, lastIndexOf
 
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.List
contains, containsAll, equals, hashCode, isEmpty, size, toArray, toArray
 

Constructor Detail

BidirectionalList

public BidirectionalList()
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)

getDecoratedList

protected java.util.List getDecoratedList()
Specified by:
getDecoratedList in class com.enspire.collections.decorator.ListDecorator
See Also:
ListDecorator.getDecoratedList()

add

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

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

add

public void add(int index,
                java.lang.Object object)
Specified by:
add in interface java.util.List
Overrides:
add in class com.enspire.collections.decorator.ListDecorator
See Also:
ListDecorator.add(int, java.lang.Object)

remove

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

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

remove

public java.lang.Object remove(int index)
Specified by:
remove in interface java.util.List
Overrides:
remove in class com.enspire.collections.decorator.ListDecorator
See Also:
List.remove(int)

addAll

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

addAll

public boolean addAll(int index,
                      java.util.Collection coll)
Specified by:
addAll in interface java.util.List
Overrides:
addAll in class com.enspire.collections.decorator.ListDecorator
See Also:
Collection.addAll(java.util.Collection)

removeAll

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

set

public java.lang.Object set(int index,
                            java.lang.Object object)
Specified by:
set in interface java.util.List
Overrides:
set in class com.enspire.collections.decorator.ListDecorator
See Also:
List.set(int, java.lang.Object)

subList

public java.util.List subList(int fromIndex,
                              int toIndex)
Specified by:
subList in interface java.util.List
Overrides:
subList in class com.enspire.collections.decorator.ListDecorator
See Also:
List.subList(int, int)

retainAll

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

Specified by:
retainAll in interface java.util.Collection
Specified by:
retainAll in interface java.util.List
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
Specified by:
clear in interface java.util.List
Overrides:
clear in class com.enspire.collections.decorator.CollectionDecorator
See Also:
Collection.clear()

listIterator

public java.util.ListIterator listIterator()
Specified by:
listIterator in interface java.util.List
Overrides:
listIterator in class com.enspire.collections.decorator.ListDecorator
See Also:
ListDecorator.listIterator()

listIterator

public java.util.ListIterator listIterator(int index)
Specified by:
listIterator in interface java.util.List
Overrides:
listIterator in class com.enspire.collections.decorator.ListDecorator
See Also:
ListDecorator.listIterator(int)

iterator

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


Copyright © 2005 e-nspire. All Rights Reserved.