public class RebuildingContextImpl extends java.lang.Object implements RebuildingContext
RebuildingContextImpl
implements RebuildingContext
storing the relation from an old node to the new
node in a Map
in which the key is the old node.Constructor and Description |
---|
RebuildingContextImpl()
Default constructor
|
RebuildingContextImpl(RebuildingContext oldContext)
Constructor creating a
RebuildingContext out of an old RebuildingContext |
Modifier and Type | Method and Description |
---|---|
boolean |
containsUpdated(Node node)
Checks if the context contains already an updated version of the given node.
|
java.util.Map<Node,Node> |
getRebuildingMap()
Returns a map of instruction nodes to instruction nodes, which contains the nodes to be replaced as key and the
nodes which shall replace the old nodes as values.
|
<T extends Node> |
getUpdated(T node)
Returns resolved node of type T or null if is not yet resolved.
|
<T extends Node> |
getUpdatedOrSame(T node)
Returns updated or same(given) node from context.
|
<T extends Node> |
put(T key,
T newNode)
Holds relation between old node and new node
|
public RebuildingContextImpl()
public RebuildingContextImpl(RebuildingContext oldContext)
RebuildingContext
out of an old RebuildingContext
oldContext
- the old rebuilding contextpublic <T extends Node> void put(T key, T newNode)
RebuildingContext
put
in interface RebuildingContext
T
- the type of Node
key
- as existing nodenewNode
- as enhanced nodepublic boolean containsUpdated(Node node)
RebuildingContext
containsUpdated
in interface RebuildingContext
node
- the instruction node for which it shall be checked if an updated version exists for ittrue
if the context contains an updated version, false
if not.public <T extends Node> T getUpdatedOrSame(T node)
RebuildingContext
getUpdatedOrSame
in interface RebuildingContext
T
- the type of Node
node
- to be see if updated.public java.util.Map<Node,Node> getRebuildingMap()
RebuildingContext
getRebuildingMap
in interface RebuildingContext
public <T extends Node> T getUpdated(T node)
RebuildingContext
getUpdated
in interface RebuildingContext
T
- the type of Node
node
- to get the update from