edu.mit.sketch.ddg
Class PrimitiveMapping
java.lang.Object
|
+--java.util.AbstractMap
|
+--java.util.HashMap
|
+--edu.mit.sketch.ddg.PrimitiveMapping
- All Implemented Interfaces:
- Cloneable, Map, Serializable
- public class PrimitiveMapping
- extends HashMap
Represents a one to one mapping between primitives of two different object
descriptions. The keys are the primitives from one object, and the
values are primitives from the other object. This class is used to find subobjects in objects.
PrimitiveMapping.java
Created: Tue Feb 12 21:14:00 2002
- See Also:
- Serialized Form
| Methods inherited from class java.util.HashMap |
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
PrimitiveMapping
public PrimitiveMapping()
- Construct an empty mapping
PrimitiveMapping
public PrimitiveMapping(PrimitiveMapping other)
- Construct a mapping the same as a given one
containsPair
public boolean containsPair(Primitive p1,
Primitive p2)
- Check whether a mached pair (in this order) exists in the mapping.
addPair
public void addPair(Primitive p1,
Primitive p2)
- Add a new pair. The pair will only be added if these primitives
do not already participate in the mapping.
removePair
public void removePair(Primitive p1,
Primitive p2)
- Remove a pair.
getMapping
public Primitive getMapping(Primitive p)
- Get the primitive that maps to the given primitive. If such mapping does not
exist, returns null.