|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD |
public interface DomainObjectCollection extends java.lang.Iterable
A DomainObjectCollection represents a read-only set of domain objects of type T.
You can use the methods of this interface to query the elements of the collection. You can also add actions which are executed as elements are added to this collection.
- The type of domain objects in this collection.Method Summary | |
---|---|
void
|
all(Action action)
Executes the given action against all objects in this collection, and any objects subsequently added to this collection. |
void
|
all(groovy.lang.Closure action)
Executes the given closure against all objects in this collection, and any objects subsequently added to this collection. |
void
|
allObjects(Action action)
Executes the given action against all objects in this collection, and any objects subsequently added to this collection. |
void
|
allObjects(groovy.lang.Closure action)
Executes the given closure against all objects in this collection, and any objects subsequently added to this collection. |
java.util.Set
|
findAll(Spec spec)
Returns the objects in this collection which meet the given specification. |
java.util.Set
|
getAll()
Returns the objects in this collection. |
DomainObjectCollection
|
matching(Spec spec)
Returns a collection which contains the objects in this collection which meet the given specification. |
DomainObjectCollection
|
matching(groovy.lang.Closure spec)
Returns a collection which contains the objects in this collection which meet the given closure specification. |
Action
|
whenObjectAdded(Action action)
Adds an Action to be executed when an object is added to this collection. |
void
|
whenObjectAdded(groovy.lang.Closure action)
Adds a closure to be called when an object is added to this collection. |
Action
|
whenObjectRemoved(Action action)
Adds an Action to be executed when an object is removed from this collection. |
DomainObjectCollection
|
withType(java.lang.Class type)
Returns a collection containing the objects in this collection of the given type. |
DomainObjectCollection
|
withType(java.lang.Class type, Action configureAction)
Returns a collection containing the objects in this collection of the given type. |
DomainObjectCollection
|
withType(java.lang.Class type, groovy.lang.Closure configureClosure)
Returns a collection containing the objects in this collection of the given type. |
Methods inherited from interface java.lang.Iterable | |
---|---|
java.lang.Iterable#iterator() |
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Method Detail |
---|
public void all(Action action)
action
- The action to be executed
public void all(groovy.lang.Closure action)
action
- The action to be executed
@Deprecated public void allObjects(Action action)
action
- The action to be executed
@Deprecated public void allObjects(groovy.lang.Closure action)
action
- The closure to be called
public java.util.Set findAll(Spec spec)
spec
- The specification to use.
public java.util.Set getAll()
public DomainObjectCollection matching(Spec spec)
spec
- The specification to use.
public DomainObjectCollection matching(groovy.lang.Closure spec)
spec
- The specification to use. The closure gets a collection element as an argument.
public Action whenObjectAdded(Action action)
action
- The action to be executed
public void whenObjectAdded(groovy.lang.Closure action)
action
- The closure to be called
public Action whenObjectRemoved(Action action)
action
- The action to be executed
public DomainObjectCollection withType(java.lang.Class type)
type
- The type of objects to find.
public DomainObjectCollection withType(java.lang.Class type, Action configureAction)
type
- The type of objects to find.configureAction
- The action to execute for each object in the resulting collection.
public DomainObjectCollection withType(java.lang.Class type, groovy.lang.Closure configureClosure)
type
- The type of objects to find.configureClosure
- The closure to execute for each object in the resulting collection.
Groovy Documentation