net.ontopia.utils
Class GrabberCollection<O,G>
java.lang.Object
net.ontopia.utils.GrabberCollection<O,G>
- All Implemented Interfaces:
- Iterable<G>, Collection<G>, CachedIF
public class GrabberCollection<O,G>
- extends Object
- implements Collection<G>, CachedIF
INTERNAL: A collection that uses a grabber to populate itself by
grabbing the individual objects of the nested collection. A decider
can be used to decide whether grabbed objects should be added to
the collection or not.
coll
protected Collection<O> coll
grabber
protected GrabberIF<O,G> grabber
decider
protected DeciderIF<G> decider
grabbed
protected boolean grabbed
grabbed_coll
protected Collection<G> grabbed_coll
GrabberCollection
public GrabberCollection(Collection<O> coll,
GrabberIF<O,G> grabber)
GrabberCollection
public GrabberCollection(Collection<O> coll,
GrabberIF<O,G> grabber,
DeciderIF<G> decider)
refresh
public void refresh()
- Refreshes the collection by looping over the nested collection
and regrabbing its items. Any changes done to the previous
collection will be lost.
- Specified by:
refresh
in interface CachedIF
getCollection
protected Collection<G> getCollection()
clear
public void clear()
- Specified by:
clear
in interface Collection<G>
contains
public boolean contains(Object o)
- Specified by:
contains
in interface Collection<G>
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAll
in interface Collection<G>
equals
public boolean equals(Object o)
- Specified by:
equals
in interface Collection<G>
- Overrides:
equals
in class Object
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface Collection<G>
iterator
public Iterator<G> iterator()
- Specified by:
iterator
in interface Iterable<G>
- Specified by:
iterator
in interface Collection<G>
size
public int size()
- Specified by:
size
in interface Collection<G>
toArray
public Object[] toArray()
- Specified by:
toArray
in interface Collection<G>
toArray
public <G> G[] toArray(G[] a)
- Specified by:
toArray
in interface Collection<G>
add
public boolean add(G o)
- Specified by:
add
in interface Collection<G>
addAll
public boolean addAll(Collection<? extends G> c)
- Specified by:
addAll
in interface Collection<G>
remove
public boolean remove(Object o)
- Specified by:
remove
in interface Collection<G>
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAll
in interface Collection<G>
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAll
in interface Collection<G>
Copyright © 2000-2012 Ontopia.