Package moss

Class ExtMgr

java.lang.Object
moss.ExtMgr
All Implemented Interfaces:
Serializable

public class ExtMgr extends Object implements Serializable
Class for an extension edge manager.

An extension edge manager manages triples consisting of an edge type and two node types (source and destination), which describe potential extension edges.

Since:
2010.01.22
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected moss.ExtEdge[]
    the hash table of the extension edges
    protected int
    the number of added extension edges (with reversals)
    protected moss.ExtEdge
    the current extension edge
    protected boolean
    whether edges are to be treated as directed
    protected moss.ExtEdge[]
    the table for access via the source node type
  • Constructor Summary

    Constructors
    Constructor
    Description
    ExtMgr(boolean dir, int types)
    Create an extension edge manager.
    ExtMgr(boolean dir, int types, int hsize)
    Create an extension edge manager.
    ExtMgr(int types)
    Create an extension edge manager.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(Edge edge)
    Add an extension edge.
    int
    first(int src)
    Initialize the traversal of extension edges.
    int
    Get the maximum source node degree of the current extension edge.
    int
    Get the destination node type of the current extension edge.
    int
    Get the source node type of the current extension edge.
    int
    Get the edge type of the current extension edge.
    boolean
    Whether the edge is reversed (if edges are directed).
    int
    Get the next extension edge.
    void
    Show the content of an extension edge manager (for debugging).
    void
    Sort the extension edges lexicographically.
    void
    trim(Recoder coder)
    Trim the extension edges.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • dir

      protected boolean dir
      whether edges are to be treated as directed
    • exts

      protected moss.ExtEdge[] exts
      the table for access via the source node type
    • bins

      protected moss.ExtEdge[] bins
      the hash table of the extension edges
    • cnt

      protected int cnt
      the number of added extension edges (with reversals)
    • curr

      protected moss.ExtEdge curr
      the current extension edge
  • Constructor Details

    • ExtMgr

      public ExtMgr(boolean dir, int types, int hsize)
      Create an extension edge manager.
      Parameters:
      dir - whether to treat edges as directed
      types - the number of different node types
      hsize - the initial size of the hash table
      Since:
      2010.01.22 (Christian Borgelt)
    • ExtMgr

      public ExtMgr(boolean dir, int types)
      Create an extension edge manager.
      Parameters:
      dir - whether to treat edges as directed
      types - the number of different node types
      Since:
      2021.10.06 (Christian Borgelt)
    • ExtMgr

      public ExtMgr(int types)
      Create an extension edge manager.
      Parameters:
      types - the number of different node types
      Since:
      2010.01.22 (Christian Borgelt)
  • Method Details

    • add

      public void add(Edge edge)
      Add an extension edge.
      Parameters:
      edge - the edge to add
      Since:
      2010.01.22 (Christian Borgelt)
    • sort

      public void sort()
      Sort the extension edges lexicographically.

      This sort function uses a straightforward merge sort on the singly linked extension edge lists.

      Since:
      2010.01.28 (Christian Borgelt)
    • trim

      public void trim(Recoder coder)
      Trim the extension edges.
      Parameters:
      coder - the node type recoder with which to trim
      Since:
      2010.01.23 (Christian Borgelt)
    • first

      public int first(int src)
      Initialize the traversal of extension edges.
      Parameters:
      src - the type of the source node
      Returns:
      the edge type of the first extension edge or -1 if there is no edge
      Since:
      2010.01.22 (Christian Borgelt)
    • next

      public int next()
      Get the next extension edge.
      Returns:
      the edge type of the next extension edge or -1 if there is no such edge
      Since:
      2010.01.22 (Christian Borgelt)
    • getType

      public int getType()
      Get the edge type of the current extension edge.
      Returns:
      the edge type of the current extension edge
      Since:
      2010.01.22 (Christian Borgelt)
    • isRevd

      public boolean isRevd()
      Whether the edge is reversed (if edges are directed).
      Returns:
      whether the edge is reversed
      Since:
      2021.10.08 (Christian Borgelt)
    • getSrc

      public int getSrc()
      Get the source node type of the current extension edge.
      Returns:
      the source node type of the current extension edge
      Since:
      2021.10.06 (Christian Borgelt)
    • getDest

      public int getDest()
      Get the destination node type of the current extension edge.
      Returns:
      the destination node type of the current extension edge
      Since:
      2010.01.22 (Christian Borgelt)
    • getDegree

      public int getDegree()
      Get the maximum source node degree of the current extension edge.
      Returns:
      the maximum source node degree of the current extension edge
      Since:
      2010.01.28 (Christian Borgelt)
    • show

      public void show()
      Show the content of an extension edge manager (for debugging).
      Since:
      2020.10.09 (Christian Borgelt)