|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.ponder2.objects.P2Object
net.ponder2.objects.P2Hash
public class P2Hash
Implements a dictionary that stores objects indexed by keys. The keys are string types.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
java.util.Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
P2Hash()
Creates an instance of a P2Hash with no contents |
|
P2Hash(java.util.Map<java.lang.String,P2Object> hash)
Creates an instance of a P2Hash with initials value(s) |
|
| Method Summary | |
|---|---|
P2Hash |
asHash()
Returns itself as a Ponder2 hash |
java.util.Map<java.lang.String,P2Object> |
asMap()
gets the complete arguments in name, value pairs |
protected P2Array |
asPonder2Array()
answers an array containing name, values, name, value ... |
void |
clear()
|
boolean |
containsKey(java.lang.Object key)
|
boolean |
containsValue(java.lang.Object value)
|
java.util.Set<java.util.Map.Entry<java.lang.String,P2Object>> |
entrySet()
|
P2Object |
get(java.lang.Object key)
|
boolean |
isEmpty()
|
protected boolean |
isMutable()
To be overridden by P2Hash subclasses. |
java.util.Set<java.lang.String> |
keySet()
|
protected java.lang.String[] |
names()
returns an array of the names of the objects in this domain |
P2Object |
operation_at_ifAbsent(P2Object source,
java.lang.String aKey,
P2Block aBlock)
Answer the value associated with the given key. |
P2Object |
operation_at_put(java.lang.String aKey,
P2Object anObject)
Answer anObject. |
protected P2Object |
operation_at(java.lang.String aKey)
Answer the value associated with the given key. |
P2Array |
operation_collect(P2Object source,
P2Block aBlock)
Takes a block and executes the block once for each entry in the hash. |
void |
operation_do(P2Object source,
P2Block aBlock)
Takes a block and executes the block once for each entry in the hash. |
protected boolean |
operation_has(P2Object anObject)
Answer true if anObject is in the receiver |
protected boolean |
operation_has(java.lang.String aKey)
Answer true if the given key exists otherwise false |
protected P2Object |
operation_listNames()
answers an array containing the names of all the domain's entries. |
protected P2Object |
operation_listObjects()
answers an array of Managed Object names containing all the entries in the domain. |
protected P2Object |
operation_remove(java.lang.String aKey)
Answer the value associated with the given key and remove it from the table. |
protected void |
operation_removeAll()
Removes all objects stored in the receiver. |
P2Object |
put(java.lang.String key,
P2Object value)
|
void |
putAll(java.util.Map<? extends java.lang.String,? extends P2Object> map)
|
P2Object |
readXml(com.twicom.qdparser.TaggedElement xml,
java.util.Map<java.lang.Integer,P2Serializable> read)
|
P2Object |
remove(java.lang.Object key)
|
protected boolean |
removeObject(P2Object anObject)
Removes anObject from the receiver. |
protected void |
set(P2Hash hash)
sets the hash with a copy of the contents of another P2Hash |
int |
size()
Answer the number of elements in the receiver. |
java.lang.String |
toString()
|
java.util.Collection<P2Object> |
values()
|
com.twicom.qdparser.TaggedElement |
writeXml(java.util.Set<P2Object> written)
|
| Methods inherited from class net.ponder2.objects.P2Object |
|---|
asArray, asBlock, asBoolean, asClass, asDouble, asFloat, asInteger, asLong, asNumber, asP2Array, asString, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, fromXml, getManagedObject, getOID, getSMC, operation, operation, setSMC |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
equals, hashCode |
| Constructor Detail |
|---|
public P2Hash()
public P2Hash(java.util.Map<java.lang.String,P2Object> hash)
hash - a Java Map containing P2Values| Method Detail |
|---|
public P2Hash asHash()
throws Ponder2ArgumentException
P2Object
asHash in class P2ObjectPonder2ArgumentExceptionpublic java.util.Map<java.lang.String,P2Object> asMap()
protected void set(P2Hash hash)
hash - the hash to be copied
public void operation_do(P2Object source,
P2Block aBlock)
throws Ponder2Exception
Ponder2Exception
public P2Array operation_collect(P2Object source,
P2Block aBlock)
throws Ponder2Exception
Ponder2Exceptionprotected java.lang.String[] names()
protected P2Object operation_listNames()
protected P2Object operation_listObjects()
protected P2Array asPonder2Array()
public P2Object operation_at_put(java.lang.String aKey,
P2Object anObject)
protected P2Object operation_remove(java.lang.String aKey)
protected boolean removeObject(P2Object anObject)
throws Ponder2Exception
anObject - the object to be removed
Ponder2Exceptionprotected void operation_removeAll()
protected boolean operation_has(java.lang.String aKey)
protected boolean operation_has(P2Object anObject)
public P2Object operation_at_ifAbsent(P2Object source,
java.lang.String aKey,
P2Block aBlock)
throws Ponder2Exception
Ponder2Exception
protected P2Object operation_at(java.lang.String aKey)
throws Ponder2ArgumentException
Ponder2ArgumentExceptionpublic void clear()
clear in interface java.util.Map<java.lang.String,P2Object>public boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.String,P2Object>public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<java.lang.String,P2Object>public java.util.Set<java.util.Map.Entry<java.lang.String,P2Object>> entrySet()
entrySet in interface java.util.Map<java.lang.String,P2Object>public P2Object get(java.lang.Object key)
get in interface java.util.Map<java.lang.String,P2Object>public boolean isEmpty()
isEmpty in interface java.util.Map<java.lang.String,P2Object>public java.util.Set<java.lang.String> keySet()
keySet in interface java.util.Map<java.lang.String,P2Object>
public P2Object put(java.lang.String key,
P2Object value)
put in interface java.util.Map<java.lang.String,P2Object>public void putAll(java.util.Map<? extends java.lang.String,? extends P2Object> map)
putAll in interface java.util.Map<java.lang.String,P2Object>public P2Object remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.String,P2Object>public int size()
size in interface java.util.Map<java.lang.String,P2Object>public java.util.Collection<P2Object> values()
values in interface java.util.Map<java.lang.String,P2Object>protected boolean isMutable()
public com.twicom.qdparser.TaggedElement writeXml(java.util.Set<P2Object> written)
throws Ponder2OperationException
writeXml in interface P2SerializablewriteXml in class P2ObjectPonder2OperationException
public P2Object readXml(com.twicom.qdparser.TaggedElement xml,
java.util.Map<java.lang.Integer,P2Serializable> read)
throws Ponder2OperationException,
Ponder2ArgumentException
readXml in interface P2SerializablereadXml in class P2ObjectPonder2OperationException
Ponder2ArgumentExceptionpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||