|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectnet.sourceforge.pain.db.DbCollection
net.sourceforge.pain.db.DbAbstractStringMap
net.sourceforge.pain.db.DbStringSet
This class implements the Set interface. Only not null String values supported.
PAiN Db will not support more general serializable objects Set as it brokes database design
but Strings(Immutable) Sets are too convinient to be missed.
This class is still experimental and could be removed with next release.
(possible usage alternative: Cookie class and StingKeyMap)
| Nested Class Summary | |
static class |
DbCollection.ReadOnlyIterator
|
| Constructor Summary | |
DbStringSet(DbObject owner,
int fid)
|
|
DbStringSet(DbObject owner,
java.lang.String[] image,
int fid)
|
|
| Method Summary | |
boolean |
add(java.lang.Object o)
Adds the specified element to this set if it is not already present (optional operation). |
boolean |
addAll(java.util.Collection c)
Adds all of the elements in the specified collection to this set if they're not already present (optional operation). |
void |
clear()
Removes all of the elements from this set (optional operation). |
boolean |
contains(java.lang.Object o)
Returns true if this set contains the specified element. |
boolean |
containsAll(java.util.Collection c)
Returns true if this set contains all of the elements of the specified collection. |
boolean |
isEmpty()
Returns true if this set contains no elements. |
java.util.Iterator |
iterator()
Returns an iterator over the elements in this set. |
boolean |
remove(java.lang.Object o)
Removes the specified element from this set if it is present (optional operation). |
boolean |
removeAll(java.util.Collection c)
Removes from this set all of its elements that are contained in the specified collection (optional operation). |
boolean |
retainAll(java.util.Collection c)
Retains only the elements in this set that are contained in the specified collection (optional operation). |
int |
size()
Returns the number of elements in this set (its cardinality). |
java.lang.Object[] |
toArray()
Returns an array containing all of the elements in this set. |
java.lang.Object[] |
toArray(java.lang.Object[] a)
Returns an array containing all of the elements in this set; the runtime type of the returned array is that of the specified array. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Set |
equals, hashCode |
| Constructor Detail |
public DbStringSet(DbObject owner,
java.lang.String[] image,
int fid)
public DbStringSet(DbObject owner,
int fid)
| Method Detail |
public int size()
java.util.Set
size in interface java.util.Setpublic void clear()
java.util.Set
clear in interface java.util.Setpublic boolean isEmpty()
java.util.Set
isEmpty in interface java.util.Setpublic java.lang.Object[] toArray()
java.util.Set
toArray in interface java.util.Setpublic boolean add(java.lang.Object o)
java.util.Seto, to this set if this set contains no element
e such that (o==null ? e==null :
o.equals(e)). If this set already contains the specified
element, the call leaves this set unchanged and returns false.
In combination with the restriction on constructors, this ensures that
sets never contain duplicate elements.The stipulation above does not imply that sets must accept all elements; sets may refuse to add any particular element, including null, and throwing an exception, as described in the specification for Collection.add. Individual set implementations should clearly document any restrictions on the the elements that they may contain.
add in interface java.util.Seto - element to be added to this set.
public boolean contains(java.lang.Object o)
java.util.Sete such that (o==null ? e==null :
o.equals(e)).
contains in interface java.util.Seto - element whose presence in this set is to be tested.
public boolean remove(java.lang.Object o)
java.util.Sete such that
(o==null ? e==null : o.equals(e)), if the set contains
such an element. Returns true if the set contained the
specified element (or equivalently, if the set changed as a result of
the call). (The set will not contain the specified element once the
call returns.)
remove in interface java.util.Seto - object to be removed from this set, if present.
public boolean addAll(java.util.Collection c)
java.util.Set
addAll in interface java.util.Setc - collection whose elements are to be added to this set.
Set.add(Object)public boolean containsAll(java.util.Collection c)
java.util.Set
containsAll in interface java.util.Setc - collection to be checked for containment in this set.
Set.contains(Object)public boolean removeAll(java.util.Collection c)
java.util.Set
removeAll in interface java.util.Setc - collection that defines which elements will be removed from
this set.
Set.remove(Object)public boolean retainAll(java.util.Collection c)
java.util.Set
retainAll in interface java.util.Setc - collection that defines which elements this set will retain.
Set.remove(Object)public java.util.Iterator iterator()
java.util.Set
iterator in interface java.util.Setpublic java.lang.Object[] toArray(java.lang.Object[] a)
java.util.Set
toArray in interface java.util.Seta - the array into which the elements of this set are to
be stored, if it is big enough; otherwise, a new array of the
same runtime type is allocated for this purpose.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||