Package moss
Class ExtMgr
java.lang.Object
moss.ExtMgr
- All Implemented Interfaces:
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
FieldsModifier and TypeFieldDescriptionprotected moss.ExtEdge[]
the hash table of the extension edgesprotected int
the number of added extension edges (with reversals)protected moss.ExtEdge
the current extension edgeprotected boolean
whether edges are to be treated as directedprotected moss.ExtEdge[]
the table for access via the source node type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
getDest()
Get the destination node type of the current extension edge.int
getSrc()
Get the source node type of the current extension edge.int
getType()
Get the edge type of the current extension edge.boolean
isRevd()
Whether the edge is reversed (if edges are directed).int
next()
Get the next extension edge.void
show()
Show the content of an extension edge manager (for debugging).void
sort()
Sort the extension edges lexicographically.void
Trim the extension edges.
-
Field Details
-
dir
protected boolean dirwhether edges are to be treated as directed -
exts
protected moss.ExtEdge[] extsthe table for access via the source node type -
bins
protected moss.ExtEdge[] binsthe hash table of the extension edges -
cnt
protected int cntthe number of added extension edges (with reversals) -
curr
protected moss.ExtEdge currthe 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 directedtypes
- the number of different node typeshsize
- 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 directedtypes
- 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
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
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)
-