public class ModelSet<E extends ModelElement<? super E>> extends Object implements ModelCollection<E>, Set<E>, Serializable
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.
| Constructor and Description |
|---|
ModelSet() |
| Modifier and Type | Method and Description |
|---|---|
<R,D> R |
accept(R result,
Visitor<R,D> visitor,
D data) |
<R,D> R |
accept(Visitor<R,D> visitor,
D data) |
boolean |
add(E e) |
boolean |
addAll(Collection<? extends E> c) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
static <T extends ModelElement<? super T>> |
create() |
static <T extends ModelElement<? super T>> |
create(Comparator<T> comparator) |
E |
find(com.google.common.base.Predicate<? super E> predicate) |
Comparator<E> |
getComparator()
|
boolean |
isEmpty() |
Iterator<E> |
iterator() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
void |
setComparator(Comparator<E> comparator)
|
int |
size() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
public static <T extends ModelElement<? super T>> ModelSet<T> create()
public static <T extends ModelElement<? super T>> ModelSet<T> create(Comparator<T> comparator)
public Comparator<E> getComparator()
public void setComparator(Comparator<E> comparator)
comparator - the comparator to setpublic E find(com.google.common.base.Predicate<? super E> predicate)
find in interface ModelCollection<E extends ModelElement<? super E>>public boolean add(E e)
add in interface Collection<E extends ModelElement<? super E>>add in interface Set<E extends ModelElement<? super E>>public boolean addAll(Collection<? extends E> c)
addAll in interface Collection<E extends ModelElement<? super E>>addAll in interface Set<E extends ModelElement<? super E>>public void clear()
clear in interface Collection<E extends ModelElement<? super E>>clear in interface Set<E extends ModelElement<? super E>>public boolean contains(Object o)
contains in interface Collection<E extends ModelElement<? super E>>contains in interface Set<E extends ModelElement<? super E>>public boolean containsAll(Collection<?> c)
containsAll in interface Collection<E extends ModelElement<? super E>>containsAll in interface Set<E extends ModelElement<? super E>>public boolean isEmpty()
isEmpty in interface Collection<E extends ModelElement<? super E>>isEmpty in interface Set<E extends ModelElement<? super E>>public Iterator<E> iterator()
iterator in interface Iterable<E extends ModelElement<? super E>>iterator in interface Collection<E extends ModelElement<? super E>>iterator in interface Set<E extends ModelElement<? super E>>public boolean remove(Object o)
remove in interface Collection<E extends ModelElement<? super E>>remove in interface Set<E extends ModelElement<? super E>>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<E extends ModelElement<? super E>>removeAll in interface Set<E extends ModelElement<? super E>>public boolean retainAll(Collection<?> c)
retainAll in interface Collection<E extends ModelElement<? super E>>retainAll in interface Set<E extends ModelElement<? super E>>public int size()
size in interface Collection<E extends ModelElement<? super E>>size in interface Set<E extends ModelElement<? super E>>public Object[] toArray()
toArray in interface Collection<E extends ModelElement<? super E>>toArray in interface Set<E extends ModelElement<? super E>>public <T> T[] toArray(T[] a)
toArray in interface Collection<E extends ModelElement<? super E>>toArray in interface Set<E extends ModelElement<? super E>>public <R,D> R accept(R result,
Visitor<R,D> visitor,
D data)
accept in interface ModelCollection<E extends ModelElement<? super E>>Copyright © 2014 JBoss by Red Hat. All Rights Reserved.