Module xl.impl

Class RuntimeModel

java.lang.Object
de.grogra.xl.impl.base.RuntimeModel
All Implemented Interfaces:
RuntimeModel
Direct Known Subclasses:
Runtime, RuntimeModel, RuntimeModel

public abstract class RuntimeModel extends Object implements RuntimeModel
  • Field Details

    • SUCCESSOR_EDGE

      public static final int SUCCESSOR_EDGE
      The 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_EDGE
      The 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_EDGE
      The 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_EDGE
      The 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_EDGE
      The edge bit mask that encodes a refinement edge.

      This bit mask represents bit 12.

      See Also:
    • MARK_EDGE

      public static final int MARK_EDGE
      The 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_EDGE
      The 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_MASK
      The 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

      protected Neighbors copyOut
    • copyIn

      protected Neighbors copyIn
    • copyOutNoRefine

      protected Neighbors copyOutNoRefine
    • copyInNoRefine

      protected Neighbors copyInNoRefine
    • branchIn

      protected Neighbors branchIn
  • Constructor Details

    • RuntimeModel

      public RuntimeModel()
  • Method Details

    • getNodeType

      public abstract Class getNodeType()
      Specifies the base type of nodes of this runtime model. This should return the same type as CompiletimeModel.getNodeType() for the corresponding CompiletimeModel implementation.
      Returns:
      base type of nodes
    • addEdgeBits

      public abstract void addEdgeBits(Object source, Object target, int bits)
      Adds a set of edge bits from a source node to a target node.
      Parameters:
      source - the source node of the edge
      target - the target node of the edge
      bits - the edge bits that are to be added
    • getEdgeBits

      public abstract int getEdgeBits(Object source, Object target)
      Return the edge bits between a source node and a target node. If there is no edge at all, 0 is returned.
      Parameters:
      source - the source node of the edge
      target - the target node of the edge
      Returns:
      the edge bits
    • createEdgeIterator

      public abstract EdgeIterator createEdgeIterator(Object node, EdgeDirection dir)
      Creates an iterator over the edges of node. The iterator is set to the first edge of the node, if any. The direction dir has to be respected by the iterator.
      Parameters:
      node - the node whose edges are to be iterated
      dir - direction in which edges are traversed (seen from node)
      Returns:
      an edge iterator
    • initialize

      public void initialize(String params)
      Description copied from interface: RuntimeModel
      Initializes this model. This method is invoked by RuntimeModelFactory.modelForName(java.lang.String, java.lang.ClassLoader) after a new RuntimeModel instance has been created. The format of params depends on implementations of RuntimeModel.
      Specified by:
      initialize in interface RuntimeModel
      Parameters:
      params - initialization parameters, possibly null
    • getStandardEdgeFor

      public int getStandardEdgeFor(int edgeType)
    • setCurrentGraph

      public void setCurrentGraph(Graph extent)
    • currentGraph

      public Graph 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 interface RuntimeModel
      Returns:
      the current graph for this model
    • isNode

      public boolean isNode(Object value)
      Description copied from interface: RuntimeModel
      Determines if value represents a valid node for this run-time model.
      Specified by:
      isNode in interface RuntimeModel
      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

      public boolean isWrapperFor(Object object, Type type)
      Description copied from interface: RuntimeModel
      Tests if the object is a wrapper for values of the given type.
      Specified by:
      isWrapperFor in interface RuntimeModel
      Parameters:
      object - the potential wrapper to be tested
      type - the value type
      Returns:
      true iff object is a wrapper for values of type type
    • unwrapBoolean

      public boolean unwrapBoolean(Object wrapper)
      Description copied from interface: RuntimeModel
      Extracts the boolean value of a wrapper.
      Specified by:
      unwrapBoolean in interface RuntimeModel
      Parameters:
      wrapper - the wrapper
      Returns:
      the wrapped value of the wrapper
    • unwrapByte

      public byte unwrapByte(Object wrapper)
      Description copied from interface: RuntimeModel
      Extracts the byte value of a wrapper.
      Specified by:
      unwrapByte in interface RuntimeModel
      Parameters:
      wrapper - the wrapper
      Returns:
      the wrapped value of the wrapper
    • unwrapShort

      public short unwrapShort(Object wrapper)
      Description copied from interface: RuntimeModel
      Extracts the short value of a wrapper.
      Specified by:
      unwrapShort in interface RuntimeModel
      Parameters:
      wrapper - the wrapper
      Returns:
      the wrapped value of the wrapper
    • unwrapChar

      public char unwrapChar(Object wrapper)
      Description copied from interface: RuntimeModel
      Extracts the char value of a wrapper.
      Specified by:
      unwrapChar in interface RuntimeModel
      Parameters:
      wrapper - the wrapper
      Returns:
      the wrapped value of the wrapper
    • unwrapInt

      public int unwrapInt(Object wrapper)
      Description copied from interface: RuntimeModel
      Extracts the int value of a wrapper.
      Specified by:
      unwrapInt in interface RuntimeModel
      Parameters:
      wrapper - the wrapper
      Returns:
      the wrapped value of the wrapper
    • unwrapLong

      public long unwrapLong(Object wrapper)
      Description copied from interface: RuntimeModel
      Extracts the long value of a wrapper.
      Specified by:
      unwrapLong in interface RuntimeModel
      Parameters:
      wrapper - the wrapper
      Returns:
      the wrapped value of the wrapper
    • unwrapFloat

      public float unwrapFloat(Object wrapper)
      Description copied from interface: RuntimeModel
      Extracts the float value of a wrapper.
      Specified by:
      unwrapFloat in interface RuntimeModel
      Parameters:
      wrapper - the wrapper
      Returns:
      the wrapped value of the wrapper
    • unwrapDouble

      public double unwrapDouble(Object wrapper)
      Description copied from interface: RuntimeModel
      Extracts the double value of a wrapper.
      Specified by:
      unwrapDouble in interface RuntimeModel
      Parameters:
      wrapper - the wrapper
      Returns:
      the wrapped value of the wrapper
    • unwrapObject

      public Object unwrapObject(Object wrapper)
      Description copied from interface: RuntimeModel
      Extracts the Object value of a wrapper.
      Specified by:
      unwrapObject in interface RuntimeModel
      Parameters:
      wrapper - the wrapper
      Returns:
      the wrapped value of the wrapper