org.opensaml.xml.util
Class LazySet<ElementType>

java.lang.Object
  extended by org.opensaml.xml.util.LazySet<ElementType>
Type Parameters:
ElementType - type of the elements within the set
All Implemented Interfaces:
Serializable, Iterable<ElementType>, Collection<ElementType>, Set<ElementType>

@NotThreadSafe
public class LazySet<ElementType>
extends Object
implements Set<ElementType>, Serializable

A set that is lazy initialized. This set takes very little memory when storing zero or one item.

See Also:
Serialized Form

Constructor Summary
LazySet()
           
 
Method Summary
 boolean add(ElementType element)
          
 boolean addAll(Collection<? extends ElementType> collection)
          
 void clear()
          
 boolean contains(Object element)
          
 boolean containsAll(Collection<?> collection)
          
 boolean isEmpty()
          
 Iterator<ElementType> iterator()
          
 boolean remove(Object element)
          
 boolean removeAll(Collection<?> collection)
          
 boolean retainAll(Collection<?> collection)
          
 int size()
          
 Object[] toArray()
          
<T> T[]
toArray(T[] type)
          
 
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

LazySet

public LazySet()
Method Detail

add

public boolean add(ElementType element)

Specified by:
add in interface Collection<ElementType>
Specified by:
add in interface Set<ElementType>

addAll

public boolean addAll(Collection<? extends ElementType> collection)

Specified by:
addAll in interface Collection<ElementType>
Specified by:
addAll in interface Set<ElementType>

clear

public void clear()

Specified by:
clear in interface Collection<ElementType>
Specified by:
clear in interface Set<ElementType>

contains

public boolean contains(Object element)

Specified by:
contains in interface Collection<ElementType>
Specified by:
contains in interface Set<ElementType>

containsAll

public boolean containsAll(Collection<?> collection)

Specified by:
containsAll in interface Collection<ElementType>
Specified by:
containsAll in interface Set<ElementType>

isEmpty

public boolean isEmpty()

Specified by:
isEmpty in interface Collection<ElementType>
Specified by:
isEmpty in interface Set<ElementType>

iterator

public Iterator<ElementType> iterator()

Specified by:
iterator in interface Iterable<ElementType>
Specified by:
iterator in interface Collection<ElementType>
Specified by:
iterator in interface Set<ElementType>

remove

public boolean remove(Object element)

Specified by:
remove in interface Collection<ElementType>
Specified by:
remove in interface Set<ElementType>

removeAll

public boolean removeAll(Collection<?> collection)

Specified by:
removeAll in interface Collection<ElementType>
Specified by:
removeAll in interface Set<ElementType>

retainAll

public boolean retainAll(Collection<?> collection)

Specified by:
retainAll in interface Collection<ElementType>
Specified by:
retainAll in interface Set<ElementType>

size

public int size()

Specified by:
size in interface Collection<ElementType>
Specified by:
size in interface Set<ElementType>

toArray

public Object[] toArray()

Specified by:
toArray in interface Collection<ElementType>
Specified by:
toArray in interface Set<ElementType>

toArray

public <T> T[] toArray(T[] type)

Specified by:
toArray in interface Collection<ElementType>
Specified by:
toArray in interface Set<ElementType>


Copyright © 2006-2008 Internet2. All Rights Reserved.