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:
java.io.Serializable, java.lang.Iterable<ElementType>, java.util.Collection<ElementType>, java.util.Set<ElementType>

@NotThreadSafe
public class LazySet<ElementType>
extends java.lang.Object
implements java.util.Set<ElementType>, java.io.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(java.util.Collection<? extends ElementType> collection)
          
 void clear()
          
 boolean contains(java.lang.Object element)
          
 boolean containsAll(java.util.Collection<?> collection)
          
 boolean isEmpty()
          
 java.util.Iterator<ElementType> iterator()
          
 boolean remove(java.lang.Object element)
          
 boolean removeAll(java.util.Collection<?> collection)
          
 boolean retainAll(java.util.Collection<?> collection)
          
 int size()
          
 java.lang.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 java.util.Collection<ElementType>
Specified by:
add in interface java.util.Set<ElementType>

addAll

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

Specified by:
addAll in interface java.util.Collection<ElementType>
Specified by:
addAll in interface java.util.Set<ElementType>

clear

public void clear()

Specified by:
clear in interface java.util.Collection<ElementType>
Specified by:
clear in interface java.util.Set<ElementType>

contains

public boolean contains(java.lang.Object element)

Specified by:
contains in interface java.util.Collection<ElementType>
Specified by:
contains in interface java.util.Set<ElementType>

containsAll

public boolean containsAll(java.util.Collection<?> collection)

Specified by:
containsAll in interface java.util.Collection<ElementType>
Specified by:
containsAll in interface java.util.Set<ElementType>

isEmpty

public boolean isEmpty()

Specified by:
isEmpty in interface java.util.Collection<ElementType>
Specified by:
isEmpty in interface java.util.Set<ElementType>

iterator

public java.util.Iterator<ElementType> iterator()

Specified by:
iterator in interface java.lang.Iterable<ElementType>
Specified by:
iterator in interface java.util.Collection<ElementType>
Specified by:
iterator in interface java.util.Set<ElementType>

remove

public boolean remove(java.lang.Object element)

Specified by:
remove in interface java.util.Collection<ElementType>
Specified by:
remove in interface java.util.Set<ElementType>

removeAll

public boolean removeAll(java.util.Collection<?> collection)

Specified by:
removeAll in interface java.util.Collection<ElementType>
Specified by:
removeAll in interface java.util.Set<ElementType>

retainAll

public boolean retainAll(java.util.Collection<?> collection)

Specified by:
retainAll in interface java.util.Collection<ElementType>
Specified by:
retainAll in interface java.util.Set<ElementType>

size

public int size()

Specified by:
size in interface java.util.Collection<ElementType>
Specified by:
size in interface java.util.Set<ElementType>

toArray

public java.lang.Object[] toArray()

Specified by:
toArray in interface java.util.Collection<ElementType>
Specified by:
toArray in interface java.util.Set<ElementType>

toArray

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

Specified by:
toArray in interface java.util.Collection<ElementType>
Specified by:
toArray in interface java.util.Set<ElementType>


Copyright © 2006-2011 Internet2. All Rights Reserved.