public class ExtMgr
extends java.lang.Object
An extension edge manager manages triples consisting of two node types (source and destination) and an edge type, which describe potential extension edges.
Modifier and Type | Field and Description |
---|---|
protected moss.ExtEdge[] |
bins
the hash table of the extension edges
|
protected int |
cnt
the number of extension edges
|
protected moss.ExtEdge |
curr
the current extension edge
|
protected moss.ExtEdge[] |
exts
the table for access via the source node type
|
Constructor and Description |
---|
ExtMgr(int types)
Create an extension edge manager.
|
ExtMgr(int types,
int hsize)
Create an extension edge manager.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Edge edge)
Add an extension edge.
|
int |
first(int src)
Initialize the traversal of extension edges.
|
int |
getDegree()
Get the maximum source node degree of the current extension edge.
|
int |
getDest()
Get the destination node type of the current extension edge.
|
int |
getType()
Get the edge type of the current extension edge.
|
int |
next()
Get the next extension edge.
|
void |
sort()
Sort the extension edges lexicographically.
|
void |
sortvec()
Sort the extension edges lexicographically.
|
void |
trim(Recoder coder)
Trim the extension edges.
|
protected moss.ExtEdge[] exts
protected moss.ExtEdge[] bins
protected int cnt
protected moss.ExtEdge curr
public ExtMgr(int types, int hsize)
types
- the number of different node typeshsize
- the initial size of the hash tablepublic ExtMgr(int types)
types
- the number of different node typespublic void add(Edge edge)
edge
- the edge to addpublic void sortvec()
This sort function uses an array buffer for the edges
and the sort function of the Arrays
class.
public void sort()
This sort function uses a straightforward merge sort on the singly linked extension edge lists.
public void trim(Recoder coder)
coder
- the node type recoder with which to trimpublic int first(int src)
src
- the type of the source node-1
if there is no edgepublic int next()
-1
if there is no such edgepublic int getType()
public int getDest()
public int getDegree()