com.sun.sgs.impl.util
Interface BindingKeyedSet<E>

Type Parameters:
E - the element type
All Superinterfaces:
Collection<E>, Iterable<E>, Set<E>
All Known Implementing Classes:
BindingKeyedSetImpl

public interface BindingKeyedSet<E>
extends Set<E>

An implementation of Set backed by a BindingKeyedMap. Elements stored in this map must implement Serializable, and may (but are not required to) implement ManagedObject. The elements stored in this map must have a unique string representation (returned by the toString method), which is used as the element's key in the backing map.


Method Summary
 boolean add(E e)
          Adds the specified element to this set if it was not already present.
 boolean contains(Object o)
          Returns true if this set contains the specified element.
 String getKeyPrefix()
          Returns the key prefix for this set.
 Iterator<E> iterator()
          Returns a Serializable Iterator over the elements in this set.
 boolean remove(Object o)
          Removes the specified element from this set if it was present.
 
Methods inherited from interface java.util.Set
addAll, clear, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, size, toArray, toArray
 

Method Detail

getKeyPrefix

String getKeyPrefix()
Returns the key prefix for this set.

Returns:
the key prefix for this set

add

boolean add(E e)
Adds the specified element to this set if it was not already present.

Specified by:
add in interface Collection<E>
Specified by:
add in interface Set<E>
Parameters:
e - the element to be added
Returns:
true if the set did not already contain the specified element
Throws:
IllegalArgumentException - if the argument does not implement Serializable
ObjectNotFoundException - if value is a managed object that has been removed from the DataManager

contains

boolean contains(Object o)
Returns true if this set contains the specified element.

Specified by:
contains in interface Collection<E>
Specified by:
contains in interface Set<E>
Parameters:
o - the element whose presence in the set is to be tested
Returns:
true if this set contains the specified element, and false otherwise
Throws:
ObjectNotFoundException - if the specified object is a managed object that has been removed from the DataManager, or is equal to an element in the collection that has been removed from the DataManager

iterator

Iterator<E> iterator()
Returns a Serializable Iterator over the elements in this set. The next method of the returned Iterator throws ObjectNotFoundException if the next element in the set is a managed object that has been removed from the DataManager.

Specified by:
iterator in interface Collection<E>
Specified by:
iterator in interface Iterable<E>
Specified by:
iterator in interface Set<E>
Returns:
an iterator over the elements in this set

remove

boolean remove(Object o)
Removes the specified element from this set if it was present.

Specified by:
remove in interface Collection<E>
Specified by:
remove in interface Set<E>
Parameters:
o - the element that should be removed from the set, if present
Returns:
true if the element was initially present in this set
Throws:
ObjectNotFoundException - if the specified object is a managed object that has been removed from the DataManager, or is equal to an element in the collection that has been removed from the DataManager

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved