org.omnaest.utils.structure.collection.set.adapter
Class MapBasedSet<E>

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

public class MapBasedSet<E>
extends SetAbstract<E>

A Set based on a given Map implementation

Author:
Omnaest
See Also:
Serialized Form

Constructor Summary
MapBasedSet(Map<E,Object> map)
           
 
Method Summary
 boolean add(E e)
           
 void clear()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> collection)
           
 boolean isEmpty()
           
 Iterator<E> iterator()
           
 boolean remove(Object o)
           
 boolean removeAll(Collection<?> c)
           
 boolean retainAll(Collection<?> c)
           
 int size()
           
 Object[] toArray()
           
<T> T[]
toArray(T[] a)
           
 String toString()
           
 
Methods inherited from class org.omnaest.utils.structure.collection.set.SetAbstract
equals, hashCode
 
Methods inherited from class org.omnaest.utils.structure.collection.CollectionAbstract
addAll
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
addAll
 

Constructor Detail

MapBasedSet

public MapBasedSet(Map<E,Object> map)
Parameters:
map - Map
See Also:
MapBasedSet
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)

clear

public void clear()
Specified by:
clear in interface Collection<E>
Specified by:
clear in interface Set<E>
Overrides:
clear in class CollectionAbstract<E>

containsAll

public boolean containsAll(Collection<?> collection)
Specified by:
containsAll in interface Collection<E>
Specified by:
containsAll in interface Set<E>
Overrides:
containsAll in class CollectionAbstract<E>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<E>
Specified by:
isEmpty in interface Set<E>
Overrides:
isEmpty in class CollectionAbstract<E>

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<E>
Specified by:
removeAll in interface Set<E>
Overrides:
removeAll in class CollectionAbstract<E>

retainAll

public boolean retainAll(Collection<?> c)
Specified by:
retainAll in interface Collection<E>
Specified by:
retainAll in interface Set<E>
Overrides:
retainAll in class CollectionAbstract<E>

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<E>
Specified by:
toArray in interface Set<E>
Overrides:
toArray in class CollectionAbstract<E>

toArray

public <T> T[] toArray(T[] a)
Specified by:
toArray in interface Collection<E>
Specified by:
toArray in interface Set<E>
Overrides:
toArray in class CollectionAbstract<E>

toString

public String toString()
Overrides:
toString in class CollectionAbstract<E>


Copyright © 2013. All Rights Reserved.