org.glite.authz.common.util
Class LazyList<ElementType>

java.lang.Object
  extended by org.glite.authz.common.util.LazyList<ElementType>
Type Parameters:
ElementType - type of elements within the list
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<ElementType>, java.util.Collection<ElementType>, java.util.List<ElementType>

@NotThreadSafe
public class LazyList<ElementType>
extends java.lang.Object
implements java.util.List<ElementType>, java.io.Serializable

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

See Also:
Serialized Form

Constructor Summary
LazyList()
           
 
Method Summary
 boolean add(ElementType item)
          
 void add(int index, ElementType element)
          
 boolean addAll(java.util.Collection<? extends ElementType> collection)
          
 boolean addAll(int index, java.util.Collection<? extends ElementType> collection)
          
protected  java.util.List<ElementType> buildList()
          Builds an appropriate delegate for this list.
 void clear()
          
 boolean contains(java.lang.Object element)
          
 boolean containsAll(java.util.Collection<?> collections)
          
 boolean equals(java.lang.Object obj)
          
 ElementType get(int index)
          
 int hashCode()
          
 int indexOf(java.lang.Object element)
          
 boolean isEmpty()
          
 java.util.Iterator<ElementType> iterator()
          
 int lastIndexOf(java.lang.Object element)
          
 java.util.ListIterator<ElementType> listIterator()
          
 java.util.ListIterator<ElementType> listIterator(int index)
          
 ElementType remove(int index)
          
 boolean remove(java.lang.Object element)
          
 boolean removeAll(java.util.Collection<?> collection)
          
 boolean retainAll(java.util.Collection<?> collection)
          
 ElementType set(int index, ElementType element)
          
 int size()
          
 java.util.List<ElementType> subList(int fromIndex, int toIndex)
          
 java.lang.Object[] toArray()
          
<T> T[]
toArray(T[] type)
          
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LazyList

public LazyList()
Method Detail

add

public boolean add(ElementType item)

Specified by:
add in interface java.util.Collection<ElementType>
Specified by:
add in interface java.util.List<ElementType>

add

public void add(int index,
                ElementType element)

Specified by:
add in interface java.util.List<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.List<ElementType>

addAll

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

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

clear

public void clear()

Specified by:
clear in interface java.util.Collection<ElementType>
Specified by:
clear in interface java.util.List<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.List<ElementType>

containsAll

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

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

get

public ElementType get(int index)

Specified by:
get in interface java.util.List<ElementType>

indexOf

public int indexOf(java.lang.Object element)

Specified by:
indexOf in interface java.util.List<ElementType>

isEmpty

public boolean isEmpty()

Specified by:
isEmpty in interface java.util.Collection<ElementType>
Specified by:
isEmpty in interface java.util.List<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.List<ElementType>

lastIndexOf

public int lastIndexOf(java.lang.Object element)

Specified by:
lastIndexOf in interface java.util.List<ElementType>

listIterator

public java.util.ListIterator<ElementType> listIterator()

Specified by:
listIterator in interface java.util.List<ElementType>

listIterator

public java.util.ListIterator<ElementType> listIterator(int index)

Specified by:
listIterator in interface java.util.List<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.List<ElementType>

remove

public ElementType remove(int index)

Specified by:
remove in interface java.util.List<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.List<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.List<ElementType>

set

public ElementType set(int index,
                       ElementType element)

Specified by:
set in interface java.util.List<ElementType>

size

public int size()

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

subList

public java.util.List<ElementType> subList(int fromIndex,
                                           int toIndex)

Specified by:
subList in interface java.util.List<ElementType>

toArray

public java.lang.Object[] toArray()

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

toArray

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

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

buildList

protected java.util.List<ElementType> buildList()
Builds an appropriate delegate for this list.

Returns:
delegate for this list

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()

Specified by:
hashCode in interface java.util.Collection<ElementType>
Specified by:
hashCode in interface java.util.List<ElementType>
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)

Specified by:
equals in interface java.util.Collection<ElementType>
Specified by:
equals in interface java.util.List<ElementType>
Overrides:
equals in class java.lang.Object


Copyright © 2008-2012 EMI - European Middleware Initiative. All Rights Reserved.