org.richfaces.cdk.model
Class ModelSet<E extends ModelElement<? super E>>
java.lang.Object
org.richfaces.cdk.model.ModelSet<E>
- All Implemented Interfaces:
- Iterable<E>, Collection<E>, Set<E>, ModelCollection<E>, Visitable
public class ModelSet<E extends ModelElement<? super E>>
- extends Object
- implements ModelCollection<E>, Set<E>
Base class for all model collections. This collection use Mergeable.same(Object) method instead of equals to lookup
objects in the contains(Object) and remove(Object) methods. In addition, it merges same objects instead of
replace in the add(ModelElement) method.
- Author:
- asmirnov@exadel.com
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ModelSet
public ModelSet()
create
public static <T extends ModelElement<? super T>> ModelSet<T> create()
create
public static <T extends ModelElement<? super T>> ModelSet<T> create(Comparator<T> comparator)
getComparator
public Comparator<E> getComparator()
- Returns:
- the comparator
setComparator
public void setComparator(Comparator<E> comparator)
- Parameters:
comparator - the comparator to set
find
public E find(com.google.common.base.Predicate<? super E> predicate)
- Specified by:
find in interface ModelCollection<E extends ModelElement<? super E>>
add
public boolean add(E e)
- Specified by:
add in interface Collection<E extends ModelElement<? super E>>- Specified by:
add in interface Set<E extends ModelElement<? super E>>
addAll
public boolean addAll(Collection<? extends E> c)
- Specified by:
addAll in interface Collection<E extends ModelElement<? super E>>- Specified by:
addAll in interface Set<E extends ModelElement<? super E>>
clear
public void clear()
- Specified by:
clear in interface Collection<E extends ModelElement<? super E>>- Specified by:
clear in interface Set<E extends ModelElement<? super E>>
contains
public boolean contains(Object o)
- Specified by:
contains in interface Collection<E extends ModelElement<? super E>>- Specified by:
contains in interface Set<E extends ModelElement<? super E>>
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAll in interface Collection<E extends ModelElement<? super E>>- Specified by:
containsAll in interface Set<E extends ModelElement<? super E>>
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty in interface Collection<E extends ModelElement<? super E>>- Specified by:
isEmpty in interface Set<E extends ModelElement<? super E>>
iterator
public Iterator<E> iterator()
- Specified by:
iterator in interface Iterable<E extends ModelElement<? super E>>- Specified by:
iterator in interface Collection<E extends ModelElement<? super E>>- Specified by:
iterator in interface Set<E extends ModelElement<? super E>>
remove
public boolean remove(Object o)
- Specified by:
remove in interface Collection<E extends ModelElement<? super E>>- Specified by:
remove in interface Set<E extends ModelElement<? super E>>
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAll in interface Collection<E extends ModelElement<? super E>>- Specified by:
removeAll in interface Set<E extends ModelElement<? super E>>
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAll in interface Collection<E extends ModelElement<? super E>>- Specified by:
retainAll in interface Set<E extends ModelElement<? super E>>
size
public int size()
- Specified by:
size in interface Collection<E extends ModelElement<? super E>>- Specified by:
size in interface Set<E extends ModelElement<? super E>>
toArray
public Object[] toArray()
- Specified by:
toArray in interface Collection<E extends ModelElement<? super E>>- Specified by:
toArray in interface Set<E extends ModelElement<? super E>>
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArray in interface Collection<E extends ModelElement<? super E>>- Specified by:
toArray in interface Set<E extends ModelElement<? super E>>
accept
public <R,D> R accept(R result,
Visitor<R,D> visitor,
D data)
- Specified by:
accept in interface ModelCollection<E extends ModelElement<? super E>>
accept
public <R,D> R accept(Visitor<R,D> visitor,
D data)
- Specified by:
accept in interface Visitable
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.