com.ochafik.util
Class CollectionAdapter<U,V>

java.lang.Object
  extended by java.util.AbstractCollection<V>
      extended by com.ochafik.util.CollectionAdapter<U,V>
All Implemented Interfaces:
Iterable<V>, Collection<V>

public class CollectionAdapter<U,V>
extends AbstractCollection<V>


Nested Class Summary
protected  class CollectionAdapter.IteratorAdapter
           
 
Field Summary
protected  Adapter<U,V> adapter
           
protected  Collection<U> collection
           
 
Constructor Summary
CollectionAdapter(Collection<U> collection, Adapter<U,V> adapter)
           
 
Method Summary
 boolean add(V o)
           
 void clear()
           
 boolean contains(Object o)
           
 boolean isEmpty()
           
 Iterator<V> iterator()
           
 int size()
           
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Field Detail

collection

protected Collection<U> collection

adapter

protected Adapter<U,V> adapter
Constructor Detail

CollectionAdapter

public CollectionAdapter(Collection<U> collection,
                         Adapter<U,V> adapter)
Method Detail

iterator

public Iterator<V> iterator()
Specified by:
iterator in interface Iterable<V>
Specified by:
iterator in interface Collection<V>
Specified by:
iterator in class AbstractCollection<V>

size

public int size()
Specified by:
size in interface Collection<V>
Specified by:
size in class AbstractCollection<V>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<V>
Overrides:
isEmpty in class AbstractCollection<V>

clear

public void clear()
Specified by:
clear in interface Collection<V>
Overrides:
clear in class AbstractCollection<V>

add

public boolean add(V o)
Specified by:
add in interface Collection<V>
Overrides:
add in class AbstractCollection<V>

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<V>
Overrides:
contains in class AbstractCollection<V>


Copyright © 2009. All Rights Reserved.