Class ProviderSubset<T>
- java.lang.Object
-
- org.apache.wicket.extensions.markup.html.repeater.util.ProviderSubset<T>
-
- Type Parameters:
T
- type of data
- All Implemented Interfaces:
Serializable
,Iterable<T>
,Collection<T>
,Set<T>
,IDetachable
,IClusterable
public class ProviderSubset<T> extends Object implements Set<T>, IDetachable
ASet
implementation utilizing aITreeProvider
's models to keep containing elements.- Author:
- svenmeier
- See Also:
ITreeProvider.model(Object)
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ProviderSubset(ITreeProvider<T> provider)
Create an empty subset.ProviderSubset(ITreeProvider<T> provider, boolean addRoots)
Create a subset optionally containing all roots of the provider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(T t)
boolean
addAll(Collection<? extends T> ts)
void
clear()
boolean
contains(Object o)
boolean
containsAll(Collection<?> cs)
IModel<Set<T>>
createModel()
Create a model holding this set.void
detach()
Detaches model after use.boolean
isEmpty()
Iterator<T>
iterator()
boolean
remove(Object o)
boolean
removeAll(Collection<?> cs)
boolean
retainAll(Collection<?> c)
int
size()
Object[]
toArray()
<S> S[]
toArray(S[] a)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.Set
equals, hashCode, spliterator
-
-
-
-
Constructor Detail
-
ProviderSubset
public ProviderSubset(ITreeProvider<T> provider)
Create an empty subset.- Parameters:
provider
- the provider of the complete set
-
ProviderSubset
public ProviderSubset(ITreeProvider<T> provider, boolean addRoots)
Create a subset optionally containing all roots of the provider.- Parameters:
provider
- the provider of the complete setaddRoots
- should all roots be added to this subset
-
-
Method Detail
-
detach
public void detach()
Description copied from interface:IDetachable
Detaches model after use. This is generally used to null out transient references that can be re-attached later.- Specified by:
detach
in interfaceIDetachable
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
clear
public void clear()
-
addAll
public boolean addAll(Collection<? extends T> ts)
-
containsAll
public boolean containsAll(Collection<?> cs)
- Specified by:
containsAll
in interfaceCollection<T>
- Specified by:
containsAll
in interfaceSet<T>
-
removeAll
public boolean removeAll(Collection<?> cs)
-
retainAll
public boolean retainAll(Collection<?> c)
-
toArray
public <S> S[] toArray(S[] a)
-
createModel
public IModel<Set<T>> createModel()
Create a model holding this set.- Returns:
- model
-
-