net.shibboleth.metadata.util
Class ItemCollectionWithMetadata<ItemType extends Item>

java.lang.Object
  extended by net.shibboleth.metadata.util.ItemCollectionWithMetadata<ItemType>
Type Parameters:
ItemType - type of items stored in this collection
All Implemented Interfaces:
Iterable<ItemType>, Collection<ItemType>

public class ItemCollectionWithMetadata<ItemType extends Item>
extends Object
implements Collection<ItemType>

A wrapper around a delegate collection that allows the collection to carry item metadata.


Field Summary
private  Collection<ItemType> delegate
          The delegate collection.
private  ClassToInstanceMultiMap<ItemMetadata> metadata
          Additional processing information associated with this collection of Items.
 
Constructor Summary
ItemCollectionWithMetadata()
          Constructor.
ItemCollectionWithMetadata(Collection<ItemType> wrappedCollection)
          Constructor.
 
Method Summary
 boolean add(ItemType e)
          
 boolean addAll(Collection<? extends ItemType> c)
          
 void clear()
          
 boolean contains(Object o)
          
 boolean containsAll(Collection<?> c)
          
 ClassToInstanceMultiMap<ItemMetadata> getCollectionMetadata()
          Gets the ItemMetadata for this collection.
 boolean isEmpty()
          
 Iterator<ItemType> iterator()
          
 boolean remove(Object o)
          
 boolean removeAll(Collection<?> c)
          
 boolean retainAll(Collection<?> c)
          
 int size()
          
 Object[] toArray()
          
<T> T[]
toArray(T[] a)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Field Detail

delegate

private final Collection<ItemType extends Item> delegate
The delegate collection.


metadata

private final ClassToInstanceMultiMap<ItemMetadata> metadata
Additional processing information associated with this collection of Items.

Constructor Detail

ItemCollectionWithMetadata

public ItemCollectionWithMetadata()
Constructor.


ItemCollectionWithMetadata

public ItemCollectionWithMetadata(@Nonnull@NonnullElements
                                  Collection<ItemType> wrappedCollection)
Constructor.

Parameters:
wrappedCollection - the underlying collection that holds the items
Method Detail

getCollectionMetadata

@Nonnull
@NonnullElements
public ClassToInstanceMultiMap<ItemMetadata> getCollectionMetadata()
Gets the ItemMetadata for this collection.

Returns:
the ItemMetadata for this collection, never null

size

public int size()

Specified by:
size in interface Collection<ItemType extends Item>

isEmpty

public boolean isEmpty()

Specified by:
isEmpty in interface Collection<ItemType extends Item>

contains

public boolean contains(Object o)

Specified by:
contains in interface Collection<ItemType extends Item>

iterator

@Nonnull
@NonnullElements
public Iterator<ItemType> iterator()

Specified by:
iterator in interface Iterable<ItemType extends Item>
Specified by:
iterator in interface Collection<ItemType extends Item>

toArray

@Nonnull
@NonnullElements
public Object[] toArray()

Specified by:
toArray in interface Collection<ItemType extends Item>

toArray

@Nonnull
@NonnullElements
public <T> T[] toArray(@Nonnull
                                               T[] a)

Specified by:
toArray in interface Collection<ItemType extends Item>

add

public boolean add(@Nullable
                   ItemType e)

Specified by:
add in interface Collection<ItemType extends Item>

remove

public boolean remove(@Nullable
                      Object o)

Specified by:
remove in interface Collection<ItemType extends Item>

containsAll

public boolean containsAll(@Nonnull
                           Collection<?> c)

Specified by:
containsAll in interface Collection<ItemType extends Item>

addAll

public boolean addAll(@Nullable
                      Collection<? extends ItemType> c)

Specified by:
addAll in interface Collection<ItemType extends Item>

removeAll

public boolean removeAll(@Nullable
                         Collection<?> c)

Specified by:
removeAll in interface Collection<ItemType extends Item>

retainAll

public boolean retainAll(@Nonnull
                         Collection<?> c)

Specified by:
retainAll in interface Collection<ItemType extends Item>

clear

public void clear()

Specified by:
clear in interface Collection<ItemType extends Item>


Copyright © 1999-2012. All Rights Reserved.