RichFaces CDK Generator 4.2.0.CR1

org.richfaces.cdk.model
Class ModelSet<E extends ModelElement<? super E>>

java.lang.Object
  extended by 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

Constructor Summary
ModelSet()
           
 
Method Summary
<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>>
ModelSet<T>
create()
           
static
<T extends ModelElement<? super T>>
ModelSet<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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Set
equals, hashCode
 

Constructor Detail

ModelSet

public ModelSet()
Method Detail

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

RichFaces CDK Generator 4.2.0.CR1

Copyright © 2012 JBoss by Red Hat. All Rights Reserved.