org.nakedobjects.object
Interface NakedCollection

All Superinterfaces:
Naked, NakedObject, java.io.Serializable
All Known Implementing Classes:
AbstractNakedCollection

public interface NakedCollection
extends NakedObject


Method Summary
 void add(NakedObject object)
          adds object to the collection and notifies all views that the collection has changed.
 void added(NakedObject object)
           
 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.
 boolean contains(NakedObject object)
          Returns true if the logical collection contains the specified object.
 void copyObject(Naked objectToCopy)
          Copies the attributes from the specified instance to the current instance.
 java.util.Enumeration displayElements()
          Return cache to be viewed on current page
 java.util.Enumeration elements()
          Return all elements in this collection
 void first()
          Position cursor at first element
 int getDisplaySize()
           
 boolean hasNext()
          If true there is a next page to display, and 'next' and 'last' options are valid
 boolean hasPrevious()
           
 void last()
          Position cursor at last
 void next()
          Position cursor at beginning of next page
 int position()
           
 void previous()
          Position cursor at beginning of previous page
 void remove(NakedObject object)
          removes object from the collection and notifies all views that the collection has changed.
 void removed(NakedObject element)
           
 void reset()
           
 int size()
          Return a NakedCollection of objects which match the specified pattern from within the current collection
 Title title()
          by default returns the collections name and its number of elements
 
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, isEmpty, isSameAs, isValid, summary
 

Method Detail

getDisplaySize

public int getDisplaySize()

position

public int position()

add

public void add(NakedObject object)
adds object to the collection and notifies all views that the collection has changed.


added

public void added(NakedObject object)

canAdd

public Permission canAdd(NakedObject object)
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.


canRemove

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


contains

public boolean contains(NakedObject object)
Returns true if the logical collection contains the specified object.


copyObject

public void copyObject(Naked objectToCopy)
Copies the attributes from the specified instance to the current instance. Each NakedInterface object reference is copied across and values for each NakedDatum object are copied across to the NakedDatum objects in the current instance.

Specified by:
copyObject in interface Naked

displayElements

public java.util.Enumeration displayElements()
Return cache to be viewed on current page


elements

public java.util.Enumeration elements()
Return all elements in this collection


first

public void first()
Position cursor at first element


hasNext

public boolean hasNext()
If true there is a next page to display, and 'next' and 'last' options are valid


hasPrevious

public boolean hasPrevious()

last

public void last()
Position cursor at last


next

public void next()
Position cursor at beginning of next page


previous

public void previous()
Position cursor at beginning of previous page


remove

public void remove(NakedObject object)
removes object from the collection and notifies all views that the collection has changed.


removed

public void removed(NakedObject element)

reset

public void reset()

size

public int size()
Return a NakedCollection of objects which match the specified pattern from within the current collection


title

public Title title()
by default returns the collections name and its number of elements

Specified by:
title in interface Naked