org.nakedobjects.object.collection
Class ArbitraryCollection

java.lang.Object
  extended byjava.util.Observable
      extended byorg.nakedobjects.object.AbstractNakedObject
          extended byorg.nakedobjects.object.collection.AbstractNakedCollection
              extended byorg.nakedobjects.object.collection.ArbitraryCollection
All Implemented Interfaces:
java.io.Externalizable, Naked, NakedCollection, NakedObject, java.io.Serializable

public class ArbitraryCollection
extends AbstractNakedCollection

See Also:
Serialized Form

Constructor Summary
ArbitraryCollection()
           
ArbitraryCollection(java.lang.String name)
          Constructs collection and sets the name.
 
Method Summary
 Permission canAdd(NakedObject object)
          Vetos the addition to this collection if the object being added requests it.
 Permission canRemove(NakedObject object)
          Vetos the removal from this collection if the object being removed requests it.
 TextString getName()
          returns name of the collection.
 void setName(java.lang.String name)
          Sets the name of the collection, by changing the value held in the name field.
 Title title()
          by default returns the collections name and its number of elements
 
Methods inherited from class org.nakedobjects.object.collection.AbstractNakedCollection
add, addAll, added, contains, displayElements, elements, extract, first, getDisplaySize, getMaxCacheSize, hasNext, hasPrevious, isEmpty, last, next, position, previous, remove, removeAll, removed, reset, search, setDisplaySize, setMaxCacheSize, size
 
Methods inherited from class org.nakedobjects.object.AbstractNakedObject
about, aboutExplorationActionClass, aboutExplorationActionClone, aboutExplorationActionMakePersistent, canClone, contextualTitle, copyObject, created, createInstance, createInstance, createTransientInstance, deleted, destroy, equals, explorationActionClass, explorationActionClone, explorationActionMakePersistent, getClassHelpText, getClassName, getCollectiveName, getFullClassName, getIconName, getIdString, getNakedClass, getObjectHelpText, getObjectStore, getOid, hashCode, iconImage, init, isFinder, isLookupElement, isPersistent, isResolved, isSameAs, isValid, makeFinder, makePersistent, objectChanged, readExternal, resolve, resolve, setChangedAndNotifyObservers, setOid, setResolved, summary, toString, writeExternal
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.nakedobjects.object.NakedCollection
copyObject
 
Methods inherited from interface org.nakedobjects.object.NakedObject
addObserver, contextualTitle, countObservers, created, deleted, deleteObserver, destroy, getCollectiveName, getIdString, getNakedClass, getObjectStore, getOid, hasChanged, iconImage, isFinder, isLookupElement, isPersistent, isResolved, makeFinder, makePersistent, objectChanged, resolve, setChangedAndNotifyObservers, setOid, setResolved
 
Methods inherited from interface org.nakedobjects.object.Naked
about, getClassName, getFullClassName, getObjectHelpText, isSameAs, isValid, summary
 

Constructor Detail

ArbitraryCollection

public ArbitraryCollection()

ArbitraryCollection

public ArbitraryCollection(java.lang.String name)
Constructs collection and sets the name.

See Also:
setName(String)
Method Detail

setName

public void setName(java.lang.String name)
Sets the name of the collection, by changing the value held in the name field.

See Also:
getName()

getName

public TextString getName()
returns name of the collection.

See Also:
setName(String)

canAdd

public Permission canAdd(NakedObject object)
Description copied from interface: NakedCollection
Vetos the addition to this collection if the object being added requests it. Returns the result of canAddTo() called on the object reference. Also disallows the addition of itself. By default a collection can be added to another collection (but not to itself). Any type of object which wishes to restrict its placement in a collection should override this method.

Specified by:
canAdd in interface NakedCollection
Specified by:
canAdd in class AbstractNakedCollection

canRemove

public Permission canRemove(NakedObject object)
Description copied from interface: NakedCollection
Vetos the removal from this collection if the object being removed requests it. Returns the result of canRemoveFrom() called on the object reference.

Specified by:
canRemove in interface NakedCollection
Specified by:
canRemove in class AbstractNakedCollection

title

public Title title()
Description copied from interface: NakedCollection
by default returns the collections name and its number of elements

Specified by:
title in interface NakedCollection
Overrides:
title in class AbstractNakedCollection