com.pega.pegarules.pub.generator
Class ExpressionMap

java.lang.Object
  extended by com.pega.pegarules.pub.generator.ExpressionMap
All Implemented Interfaces:
java.util.Map

public class ExpressionMap
extends java.lang.Object
implements java.util.Map

The ExpressionMap class implements the Map interface such that the key must be a non-null String and the value must be an instance of Expression. This class is used in First-Use Assembly, where the parameters identifying referenced processing can be, in the general case, expressions that might need to be evaluated at runtime.

Version:
$Revision: 31 $ $Date: 2009-06-24 09:38:04 -0400 (Wed, 24 Jun 2009) $
Author:
John van der Meer

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String VERSION
           
 
Constructor Summary
ExpressionMap()
          Default constructor.
ExpressionMap(java.util.Map aMap)
          'Copy' constructor.
 
Method Summary
 void clear()
          Removes all associations from the collection.
 boolean containsKey(java.lang.Object aName)
          Identifies whether there is an association for the specified name.
 boolean containsValue(java.lang.Object aValue)
          Identifies whether this map maps one or more keys to the specified value.
 java.util.Set entrySet()
          Returns a set view of the mappings contained in this instance.
 boolean equals(java.lang.Object aObject)
          Compares the specified object with this map for equality.
 java.lang.Object get(java.lang.Object aName)
          Identifies the value, if any, that is associated with the specified name.
 Expression getExpression(java.lang.String aName)
          Identifies the Expression, if any, that is associated with the specified name.
 int hashCode()
          Returns the hash code value for this instance, which will be the hashCode value of the underlying java.util.HashMap.
 boolean isEmpty()
          Inicates whether this map contains no name-value associations.
 java.util.Set keySet()
          Returns a set view of the keys (names) contained in this instance.
 java.lang.Object put(java.lang.Object aName, java.lang.Object aValue)
          Associates the specified value with the specified name in this instance, provided that the name is a non-null String and the value is an instance of Expression.
 void putAll(java.util.Map aMap)
          Copies all conforming mappings from the specified Map to this instance.
 void putExpression(java.lang.String aName, Expression aValue)
          Associates the specified Expression with the specified name in this instance.
 java.lang.Object remove(java.lang.Object aName)
          Removes any association for this name from this instance.
 int size()
          Returns the number of name-value mappings in this instance.
 java.util.Collection values()
          Returns a collection view of the values contained in this instance.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

VERSION

public static final java.lang.String VERSION
Constructor Detail

ExpressionMap

public ExpressionMap()
Default constructor.


ExpressionMap

public ExpressionMap(java.util.Map aMap)
'Copy' constructor.

Parameters:
aMap - the Map to be copied
Throws:
java.lang.ClassCastException - if an entry in aMap is encountered for which either its key or value is of an inappropriate type
java.lang.NullPointerException - if an entry in aMap is encountered for which either its key or value is null
Method Detail

getExpression

public Expression getExpression(java.lang.String aName)
Identifies the Expression, if any, that is associated with the specified name.

Parameters:
aName - name whose associated Expression is to be returned
Returns:
the Expression associated with the specified name, or null if this instance includes no association for the specified name

putExpression

public void putExpression(java.lang.String aName,
                          Expression aValue)
Associates the specified Expression with the specified name in this instance. Any previous association for this name is replaced.

Parameters:
aName - name with which the specified Expression is to be associated
aValue - Expression to be associated with the specified name
Throws:
java.lang.NullPointerException - if either argument is null

clear

public void clear()
Removes all associations from the collection.

Specified by:
clear in interface java.util.Map

containsKey

public boolean containsKey(java.lang.Object aName)
Identifies whether there is an association for the specified name.

Specified by:
containsKey in interface java.util.Map
Parameters:
aName - name whose presence is to be tested
Returns:
true when this instance includes an association for this name

containsValue

public boolean containsValue(java.lang.Object aValue)
Identifies whether this map maps one or more keys to the specified value.

Specified by:
containsValue in interface java.util.Map
Parameters:
aValue - value whose presence is to be tested
Returns:
true when this instance associates this value with at least one name

entrySet

public java.util.Set entrySet()
Returns a set view of the mappings contained in this instance.

Specified by:
entrySet in interface java.util.Map
Returns:
a set view of the mappings in this instance

equals

public boolean equals(java.lang.Object aObject)
Compares the specified object with this map for equality.

Specified by:
equals in interface java.util.Map
Overrides:
equals in class java.lang.Object
Parameters:
aObject -
Returns:
true when this instance is equivalent to the specified object

get

public java.lang.Object get(java.lang.Object aName)
Identifies the value, if any, that is associated with the specified name.

Specified by:
get in interface java.util.Map
Parameters:
aName - name whose associated value is to be returned
Returns:
the value associated with the specified name, or null if this instance includes no association for this name

hashCode

public int hashCode()
Returns the hash code value for this instance, which will be the hashCode value of the underlying java.util.HashMap.

Specified by:
hashCode in interface java.util.Map
Overrides:
hashCode in class java.lang.Object
Returns:
the hash code value for this instance

isEmpty

public boolean isEmpty()
Inicates whether this map contains no name-value associations.

Specified by:
isEmpty in interface java.util.Map
Returns:
true when this instance contains no name-value associations

keySet

public java.util.Set keySet()
Returns a set view of the keys (names) contained in this instance.

Specified by:
keySet in interface java.util.Map
Returns:
a set view of the keys in this instance

put

public java.lang.Object put(java.lang.Object aName,
                            java.lang.Object aValue)
Associates the specified value with the specified name in this instance, provided that the name is a non-null String and the value is an instance of Expression. Any previous association for this name is replaced.

Specified by:
put in interface java.util.Map
Parameters:
aName - name with which the specified value is to be associated
aValue - value to be associated with the specified name
Returns:
previous association for this name, or null if there was none
Throws:
java.lang.ClassCastException - if either argument is of an inappropriate type
java.lang.NullPointerException - if either argument is null

putAll

public void putAll(java.util.Map aMap)
Copies all conforming mappings from the specified Map to this instance. Entries in the specified Map are ignored if the key is not a String or if the value does not identify a String.

Specified by:
putAll in interface java.util.Map
Parameters:
aMap - the Map to be copied
Throws:
java.lang.ClassCastException - if an entry in aMap is encountered for which either its key or value is of an inappropriate type
java.lang.NullPointerException - if an entry in aMap is encountered for which either its key or value is null

remove

public java.lang.Object remove(java.lang.Object aName)
Removes any association for this name from this instance.

Specified by:
remove in interface java.util.Map
Parameters:
aName - name to be removed from this instance
Returns:
previous association for this name, or null if there was none

size

public int size()
Returns the number of name-value mappings in this instance.

Specified by:
size in interface java.util.Map
Returns:
number of mappings

values

public java.util.Collection values()
Returns a collection view of the values contained in this instance.

Specified by:
values in interface java.util.Map
Returns:
a collection view of the values in this instance


Copyright © 2012 Pegasystems Inc. All Rights Reserved.