org.fjank.jcache.collection
Class SetProxy

java.lang.Object
  extended by org.fjank.jcache.collection.SetProxy
All Implemented Interfaces:
Iterable, Collection, Set

public class SetProxy
extends Object
implements Set

A proxy for a key set returned from the Map implementation.

Author:
Frank Karlstrøm

Constructor Summary
SetProxy(Set set, CacheGroup group)
          Creates a new keySetProxy.
 
Method Summary
 boolean add(Object o)
          the implementation of this operation will always throw UnsupportedOperatioinException
 boolean addAll(Collection c)
          the implementation of this operation will always throw UnsupportedOperationException
 void clear()
          Clears this set, which will clear the cache of all objects.
 boolean contains(Object o)
          Returns a boolean indicating wether the object exists in the cache or not.
 boolean containsAll(Collection c)
           
 boolean isEmpty()
           
 Iterator iterator()
           
 boolean remove(Object o)
           
 boolean removeAll(Collection c)
           
 boolean retainAll(Collection c)
           
 int size()
           
 Object[] toArray()
           
 Object[] toArray(Object[] a)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
equals, hashCode
 

Constructor Detail

SetProxy

public SetProxy(Set set,
                CacheGroup group)
Creates a new keySetProxy.

Parameters:
set - the set to be a proxy for.
group -
Method Detail

add

public boolean add(Object o)
the implementation of this operation will always throw UnsupportedOperatioinException

Specified by:
add in interface Collection
Specified by:
add in interface Set
Parameters:
o - the object to add.
Returns:
a boolean indicating wether the operation failed or not.

addAll

public boolean addAll(Collection c)
the implementation of this operation will always throw UnsupportedOperationException

Specified by:
addAll in interface Collection
Specified by:
addAll in interface Set
Parameters:
c - the collection to add objects from.
Returns:
a boolean indicating wether the operation failed or not.

clear

public void clear()
Clears this set, which will clear the cache of all objects. This method behaves the same as invalidate on CacheAccess.

Specified by:
clear in interface Collection
Specified by:
clear in interface Set
See Also:
javax.util.jcache.CacheAccess#invalidate()

contains

public boolean contains(Object o)
Returns a boolean indicating wether the object exists in the cache or not.

Specified by:
contains in interface Collection
Specified by:
contains in interface Set
Parameters:
o - the object to check the existence for.
Returns:
true if the object is present in the cache, false otherwise.

containsAll

public boolean containsAll(Collection c)
Specified by:
containsAll in interface Collection
Specified by:
containsAll in interface Set

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection
Specified by:
isEmpty in interface Set

iterator

public Iterator iterator()
Specified by:
iterator in interface Iterable
Specified by:
iterator in interface Collection
Specified by:
iterator in interface Set

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection
Specified by:
remove in interface Set

removeAll

public boolean removeAll(Collection c)
Specified by:
removeAll in interface Collection
Specified by:
removeAll in interface Set

retainAll

public boolean retainAll(Collection c)
Specified by:
retainAll in interface Collection
Specified by:
retainAll in interface Set
Parameters:
c -
Returns:

size

public int size()
Specified by:
size in interface Collection
Specified by:
size in interface Set
Returns:

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection
Specified by:
toArray in interface Set
Returns:

toArray

public Object[] toArray(Object[] a)
Specified by:
toArray in interface Collection
Specified by:
toArray in interface Set
Parameters:
a -
Returns:

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2002-2009 Hosted by SourceForge. All Rights Reserved.