java.lang.Object
de.grogra.xl.impl.base.RuntimeModel
- All Implemented Interfaces:
RuntimeModel
- Direct Known Subclasses:
Runtime
,RuntimeModel
,RuntimeModel
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The edge bit mask that encodes a branch edge.protected Neighbors
static final int
The edge bit mask that encodes a containment edge.static final int
The edge bit mask that encodes an end-of-containment edge.protected Neighbors
protected Neighbors
protected Neighbors
protected Neighbors
static final int
The edge bit mask that encodes some general-purpose mark edge.static final int
static final int
The first unused edge bit mask.static final int
The edge bit mask that encodes a refinement edge.static final int
The edge bit mask that covers the special edge.static final int
The edge bit mask that encodes a successor edge. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
addEdgeBits
(Object source, Object target, int bits) Adds a set of edge bits from asource
node to atarget
node.abstract EdgeIterator
createEdgeIterator
(Object node, EdgeDirection dir) Creates an iterator over the edges ofnode
.Returns the graph that shall be used in the context of the current thread.static final int
edgeBitsIntersection
(int edgeBits, int mask) static final int
edgeBitsRemove
(int a, int toBeRemoved) static final int
edgeBitsUnion
(int a, int b) abstract int
getEdgeBits
(Object source, Object target) Return the edge bits between asource
node and atarget
node.abstract Class
Specifies the base type of nodes of this runtime model.int
getStandardEdgeFor
(int edgeType) void
initialize
(String params) Initializes this model.boolean
Determines ifvalue
represents a valid node for this run-time model.boolean
isWrapperFor
(Object object, Type type) Tests if the object is a wrapper for values of the given type.void
setCurrentGraph
(Graph extent) static final boolean
testEdgeBits
(int edgeBits, int mask) boolean
unwrapBoolean
(Object wrapper) Extracts the boolean value of a wrapper.byte
unwrapByte
(Object wrapper) Extracts the byte value of a wrapper.char
unwrapChar
(Object wrapper) Extracts the char value of a wrapper.double
unwrapDouble
(Object wrapper) Extracts the double value of a wrapper.float
unwrapFloat
(Object wrapper) Extracts the float value of a wrapper.int
Extracts the int value of a wrapper.long
unwrapLong
(Object wrapper) Extracts the long value of a wrapper.unwrapObject
(Object wrapper) Extracts the Object value of a wrapper.short
unwrapShort
(Object wrapper) Extracts the short value of a wrapper.
-
Field Details
-
SUCCESSOR_EDGE
public static final int SUCCESSOR_EDGEThe edge bit mask that encodes a successor edge.This bit mask represents bit 8, i.e., its value is 256.
- See Also:
-
BRANCH_EDGE
public static final int BRANCH_EDGEThe edge bit mask that encodes a branch edge.This bit mask represents bit 9, i.e., its value is 512.
- See Also:
-
CONTAINMENT_EDGE
public static final int CONTAINMENT_EDGEThe edge bit mask that encodes a containment edge.This bit mask represents bit 10, i.e., its value is 1024.
- See Also:
-
CONTAINMENT_END_EDGE
public static final int CONTAINMENT_END_EDGEThe edge bit mask that encodes an end-of-containment edge.This bit mask represents bit 11.
- See Also:
-
REFINEMENT_EDGE
public static final int REFINEMENT_EDGEThe edge bit mask that encodes a refinement edge.This bit mask represents bit 12.
- See Also:
-
MARK_EDGE
public static final int MARK_EDGEThe edge bit mask that encodes some general-purpose mark edge.This bit mask represents bit 13.
- See Also:
-
MIN_USER_EDGE
public static final int MIN_USER_EDGEThe first unused edge bit mask. This and all higher bit masks can be used freely.This bit mask represents bit 14.
- See Also:
-
SPECIAL_MASK
public static final int SPECIAL_MASKThe edge bit mask that covers the special edge.This bit mask represents the bits 0 - 7, i.e., its value is 255.
- See Also:
-
MIN_NORMAL_BIT_INDEX
public static final int MIN_NORMAL_BIT_INDEX- See Also:
-
copyOut
-
copyIn
-
copyOutNoRefine
-
copyInNoRefine
-
branchIn
-
-
Constructor Details
-
RuntimeModel
public RuntimeModel()
-
-
Method Details
-
getNodeType
Specifies the base type of nodes of this runtime model. This should return the same type asCompiletimeModel.getNodeType()
for the correspondingCompiletimeModel
implementation.- Returns:
- base type of nodes
-
addEdgeBits
Adds a set of edge bits from asource
node to atarget
node.- Parameters:
source
- the source node of the edgetarget
- the target node of the edgebits
- the edge bits that are to be added
-
getEdgeBits
Return the edge bits between asource
node and atarget
node. If there is no edge at all, 0 is returned.- Parameters:
source
- the source node of the edgetarget
- the target node of the edge- Returns:
- the edge bits
-
createEdgeIterator
Creates an iterator over the edges ofnode
. The iterator is set to the first edge of the node, if any. The directiondir
has to be respected by the iterator.- Parameters:
node
- the node whose edges are to be iterateddir
- direction in which edges are traversed (seen fromnode
)- Returns:
- an edge iterator
-
initialize
Description copied from interface:RuntimeModel
Initializes this model. This method is invoked byRuntimeModelFactory.modelForName(java.lang.String, java.lang.ClassLoader)
after a newRuntimeModel
instance has been created. The format ofparams
depends on implementations ofRuntimeModel
.- Specified by:
initialize
in interfaceRuntimeModel
- Parameters:
params
- initialization parameters, possiblynull
-
getStandardEdgeFor
public int getStandardEdgeFor(int edgeType) -
setCurrentGraph
-
currentGraph
Description copied from interface:RuntimeModel
Returns the graph that shall be used in the context of the current thread. This is needed by graph-related XL statements which do not explicitly specify the graph to use.- Specified by:
currentGraph
in interfaceRuntimeModel
- Returns:
- the current graph for this model
-
isNode
Description copied from interface:RuntimeModel
Determines ifvalue
represents a valid node for this run-time model.- Specified by:
isNode
in interfaceRuntimeModel
- Parameters:
value
- the value to be tested- Returns:
true
iff the value represents a node
-
testEdgeBits
public static final boolean testEdgeBits(int edgeBits, int mask) -
edgeBitsIntersection
public static final int edgeBitsIntersection(int edgeBits, int mask) -
edgeBitsUnion
public static final int edgeBitsUnion(int a, int b) -
edgeBitsRemove
public static final int edgeBitsRemove(int a, int toBeRemoved) -
isWrapperFor
Description copied from interface:RuntimeModel
Tests if the object is a wrapper for values of the given type.- Specified by:
isWrapperFor
in interfaceRuntimeModel
- Parameters:
object
- the potential wrapper to be testedtype
- the value type- Returns:
true
iffobject
is a wrapper for values of typetype
-
unwrapBoolean
Description copied from interface:RuntimeModel
Extracts the boolean value of a wrapper.- Specified by:
unwrapBoolean
in interfaceRuntimeModel
- Parameters:
wrapper
- the wrapper- Returns:
- the wrapped value of the wrapper
-
unwrapByte
Description copied from interface:RuntimeModel
Extracts the byte value of a wrapper.- Specified by:
unwrapByte
in interfaceRuntimeModel
- Parameters:
wrapper
- the wrapper- Returns:
- the wrapped value of the wrapper
-
unwrapShort
Description copied from interface:RuntimeModel
Extracts the short value of a wrapper.- Specified by:
unwrapShort
in interfaceRuntimeModel
- Parameters:
wrapper
- the wrapper- Returns:
- the wrapped value of the wrapper
-
unwrapChar
Description copied from interface:RuntimeModel
Extracts the char value of a wrapper.- Specified by:
unwrapChar
in interfaceRuntimeModel
- Parameters:
wrapper
- the wrapper- Returns:
- the wrapped value of the wrapper
-
unwrapInt
Description copied from interface:RuntimeModel
Extracts the int value of a wrapper.- Specified by:
unwrapInt
in interfaceRuntimeModel
- Parameters:
wrapper
- the wrapper- Returns:
- the wrapped value of the wrapper
-
unwrapLong
Description copied from interface:RuntimeModel
Extracts the long value of a wrapper.- Specified by:
unwrapLong
in interfaceRuntimeModel
- Parameters:
wrapper
- the wrapper- Returns:
- the wrapped value of the wrapper
-
unwrapFloat
Description copied from interface:RuntimeModel
Extracts the float value of a wrapper.- Specified by:
unwrapFloat
in interfaceRuntimeModel
- Parameters:
wrapper
- the wrapper- Returns:
- the wrapped value of the wrapper
-
unwrapDouble
Description copied from interface:RuntimeModel
Extracts the double value of a wrapper.- Specified by:
unwrapDouble
in interfaceRuntimeModel
- Parameters:
wrapper
- the wrapper- Returns:
- the wrapped value of the wrapper
-
unwrapObject
Description copied from interface:RuntimeModel
Extracts the Object value of a wrapper.- Specified by:
unwrapObject
in interfaceRuntimeModel
- Parameters:
wrapper
- the wrapper- Returns:
- the wrapped value of the wrapper
-