org.omnaest.utils.structure.collection
Class CollectionComposite<E>

java.lang.Object
  extended by org.omnaest.utils.structure.collection.CollectionAbstract<E>
      extended by org.omnaest.utils.structure.collection.CollectionComposite<E>
Type Parameters:
E -
All Implemented Interfaces:
Serializable, Iterable<E>, Collection<E>

public class CollectionComposite<E>
extends CollectionAbstract<E>

Composite Collection consisting of multiple given Collection instances of the same type

The add(Object) method will add new elements to the Collection with the smallest size.

Author:
Omnaest
See Also:
Serialized Form

Constructor Summary
CollectionComposite(Collection<Collection<E>> collectionOfCollections)
           
CollectionComposite(Collection<E>... collections)
           
 
Method Summary
 boolean add(E e)
           
 boolean contains(Object o)
           
 Iterator<E> iterator()
           
 boolean remove(Object o)
           
 int size()
           
 
Methods inherited from class org.omnaest.utils.structure.collection.CollectionAbstract
addAll, clear, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CollectionComposite

public CollectionComposite(Collection<E>... collections)
Parameters:
collections -
See Also:
CollectionComposite

CollectionComposite

public CollectionComposite(Collection<Collection<E>> collectionOfCollections)
Method Detail

size

public int size()

contains

public boolean contains(Object o)

iterator

public Iterator<E> iterator()

add

public boolean add(E e)

remove

public boolean remove(Object o)


Copyright © 2013. All Rights Reserved.