|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
org.nakedobjects.object.AbstractNakedObject
org.nakedobjects.object.collection.AbstractNakedCollection
This is the new type of collection for Naked Objects. It is designed to work efficiently is a distributed envirmoment by providing a window on a logical collection. This collection is therefore just a cache of a subset of the complete collection. The real collection is maintained by the ObjectStore. Within this cache there is also a viewing window, which the user is expected to be viewing. As the user pages through the cache more items will be retrieved as the bounds of the cache are hit.
to set the size of the viewing window.,
to set the size of the cache.
To move through the collection on a page-by-page basis,
first(),
next(),
last(),
previous(),
Serialized Form| Constructor Summary | |
AbstractNakedCollection()
|
|
| Method Summary | |
void |
add(NakedObject object)
adds object to the collection and notifies all views that the collection has changed. |
void |
addAll(NakedCollection collection)
Add all elements from the collection. |
void |
added(NakedObject object)
|
abstract Permission |
canAdd(NakedObject object)
Vetos the addition to this collection if the object being added requests it. |
abstract 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. |
java.util.Enumeration |
displayElements()
Return cache to be viewed on current page |
java.util.Enumeration |
elements()
Return all elements in this collection |
ArbitraryCollection |
extract()
Return an ArbitraryCollection with the same elements as this collection |
void |
first()
Position cursor at first element |
int |
getDisplaySize()
|
int |
getMaxCacheSize()
returns the maximum number of elements to hold from the logical collection. |
boolean |
hasNext()
If true there is a next page to display, and 'next' and 'last' options are valid |
boolean |
hasPrevious()
|
boolean |
isEmpty()
Returns true if the object contains no data, eg when new |
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 |
removeAll()
Removes all objects from the collection. |
void |
removed(NakedObject object)
|
void |
reset()
|
AbstractNakedCollection |
search(NakedObject pattern)
Return a NakedCollection of objects which match the specified pattern from within the current collection |
void |
setDisplaySize(int displaySize)
Set the size of the display or viewing window. |
void |
setMaxCacheSize(int maxCacheSize)
Sets the maximum size of the cache providing the specified size is greater than the display size. |
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 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 |
public AbstractNakedCollection()
| Method Detail |
public void setDisplaySize(int displaySize)
public int getDisplaySize()
getDisplaySize in interface NakedCollectionpublic boolean isEmpty()
Naked
isEmpty in interface NakedisEmpty in class AbstractNakedObjectpublic void setMaxCacheSize(int maxCacheSize)
public int getMaxCacheSize()
public void add(NakedObject object)
NakedCollectionobject to the collection and notifies all views that the collection has changed.
add in interface NakedCollectionpublic void added(NakedObject object)
added in interface NakedCollectionpublic abstract Permission canAdd(NakedObject object)
NakedCollectioncanAddTo() 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.
canAdd in interface NakedCollectionpublic abstract Permission canRemove(NakedObject object)
NakedCollectioncanRemoveFrom() called on the object reference.
canRemove in interface NakedCollectionpublic boolean contains(NakedObject object)
contains in interface NakedCollectionpublic java.util.Enumeration displayElements()
displayElements in interface NakedCollectionpublic java.util.Enumeration elements()
elements in interface NakedCollectionpublic ArbitraryCollection extract()
public void first()
first in interface NakedCollectionpublic boolean hasNext()
hasNext in interface NakedCollectionpublic boolean hasPrevious()
hasPrevious in interface NakedCollectionpublic void last()
last in interface NakedCollectionpublic void next()
next in interface NakedCollectionpublic int position()
position in interface NakedCollectionpublic void previous()
previous in interface NakedCollectionpublic void remove(NakedObject object)
NakedCollectionobject from the collection and notifies all views that the collection has changed.
remove in interface NakedCollectionpublic void removed(NakedObject object)
removed in interface NakedCollectionpublic void reset()
reset in interface NakedCollectionpublic AbstractNakedCollection search(NakedObject pattern)
public int size()
NakedCollection
size in interface NakedCollectionpublic Title title()
NakedCollection
title in interface NakedCollectiontitle in class AbstractNakedObjectAbstractNakedObject.contextualTitle()public void addAll(NakedCollection collection)
Implementation note: this code is not threadsafe and does not synchronize on either itself or the collection passed in.
public void removeAll()
Implementation note: this code is not threadsafe; it does not synchronize on itself.
Implemented by invoking remove(NakedObject) on each object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||