public class IDataKeySet extends IDataElementSet
Set
"-based API for accessing the keys in a WmRecord
.
IDataKeySet
is created and returned by the WmRecord.keySet()
method
and should not be created by adapter writers. The items in IDataKeySet
are
the String
keys in the WmRecord
.
IDataKeySet
supports element removal, using the Set.clear()
,
Set.remove(java.lang.Object)
, and Iterator.remove()
methods. These methods will
remove the string key from this Set
and remove the key/value pair from the
corresponding WmRecord
.
IDataKeySet
does not support the
Set.add(E)
, Set.addAll(java.util.Collection<? extends E>)
, Set.retainAll(java.util.Collection<?>)
methods. All other methods from Set
are supported.
WmRecord.keySet()
elementCursor, iData
Constructor and Description |
---|
IDataKeySet(com.wm.data.IData iData)
Constructs an
IDataKeySet . |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.lang.Object key)
Returns
true if this Set contains the specified key. |
boolean |
containsAll(java.util.Collection collection)
Returns
true if this Set contains all keys specified in the
given collection. |
java.util.Iterator |
iterator()
Returns an
Iterator object for the key elements in this
Set |
boolean |
remove(java.lang.Object key)
Removes the specified key from this
Set and removes its associated
key/value from the corresponding WmRecord . |
boolean |
retainAll(java.util.Collection c)
Retains only the elements in this set that are contained in the specified
collection (optional operation).
|
java.lang.Object[] |
toArray()
Returns a
String array containing all the keys in this Set . |
add, addAll, clear, finalize, isEmpty, removeAll, size, toArray, toVector
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public IDataKeySet(com.wm.data.IData iData)
IDataKeySet
.iData
- IData object to get the keys of.public boolean contains(java.lang.Object key)
true
if this Set
contains the specified key.contains
in interface java.util.Collection
contains
in interface java.util.Set
contains
in class IDataElementCollection
key
- A String
key.true
if this Set
(and its corresponding
WmRecord
) contains the key. Returns false
if the input is not a String
, or if the key is not found.public boolean containsAll(java.util.Collection collection)
true
if this Set
contains all keys specified in the
given collection.containsAll
in interface java.util.Collection
containsAll
in interface java.util.Set
containsAll
in class IDataElementCollection
collection
- a Collection
of String
objects.true
if the keys in the Collection
are contained
in this Set
.IDataElementCollection.contains(Object)
public java.util.Iterator iterator()
Iterator
object for the key elements in this
Set
iterator
in interface java.lang.Iterable
iterator
in interface java.util.Collection
iterator
in interface java.util.Set
iterator
in class IDataElementCollection
IDataKeyIterator
IDataKeyIterator
public boolean remove(java.lang.Object key)
Set
and removes its associated
key/value from the corresponding WmRecord
.
Note: If an adapter writer uses the IData
methods to add key/values into
the WmRecord
, it is possible for this record to have more than one key
with the same name in this Set
. If this is the case, this method
removes only the first key in the Set
and the corresponding key/value
from the WmRecord
.
remove
in interface java.util.Collection
remove
in interface java.util.Set
remove
in class IDataElementCollection
key
- The key to remove from this Set
. Key must a be a
String
object.true
if the key was removed from this Set
and if
the associated key/value removed from the corresponding WmRecord
public boolean retainAll(java.util.Collection c)
Collection
object must only contain
String
elements. For each key not specified in the collection,
the record entry will be removed. If a key not specified in the collection
contains more than one entry, all the entries will be removedretainAll
in interface java.util.Collection
retainAll
in interface java.util.Set
retainAll
in class IDataElementCollection
a
- Collection
of String object representing the record keysboolean[]
True at least one entry was removedpublic java.lang.Object[] toArray()
String
array containing all the keys in this Set
.toArray
in interface java.util.Collection
toArray
in interface java.util.Set
toArray
in class IDataElementCollection
String
array of keys
Copyright © 2003 - 2021 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.