|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectchemaxon.struc.CGraph
Chemical graph.
CNode,
CEdge,
Serialized Form| Field Summary | |
protected int[][] |
btab
Bond table. |
protected java.util.Vector |
cacheMemory
|
protected int[][] |
ctab
Connection table. |
protected int |
edgeCount
The number of edges. |
protected CEdge[] |
edges
The edges (bonds). |
protected int[] |
fragIds
Fragment identifiers. |
protected int[] |
grinv
Graph invariants. |
protected long |
grinvCC
Graph invariant change count. |
protected static int |
INITIAL_CAPACITY
Initial capacity of the nodes and edges vectors. |
protected int |
nFrags
Number of disconnected fragments. |
protected int |
nGrinv
Number of different graph invariants. |
protected int |
nodeCount
The number of nodes. |
protected CNode[] |
nodes
The nodes (atoms). |
protected CGraph |
parentGraph
The structure that contains this graph as a substructure. |
static int |
RMCLEANUP_ALL
Perform all clean-up methods when removing a node or an edge. |
static int |
RMCLEANUP_EDGES
When removing a node or an edge, also remove the edge(s) from the node object(s). |
static int |
RMCLEANUP_NONE
Do not perform any clean-up methods when removing a node or an edge. |
protected int[][] |
sssr
SSSR ring node indexes. |
protected CGraph |
superGraph
Parent of all parents. |
| Constructor Summary | |
CGraph()
Constructs a chemical graph. |
|
CGraph(CGraph p)
Constructs a chemical graph. |
|
CGraph(CGraph p,
int n,
int e)
Constructs a fragment with the specified number of nodes and edges |
|
| Method Summary | |
void |
add(CEdge edge)
Adds an edge to the graph. |
void |
add(CNode node)
Adds a node to the graph. |
protected void |
addEdge0(CEdge edge)
Adds an edge. |
protected int |
addEdgeWithoutChangingIt(CEdge edge)
Adds an edge without setting its parentGraph and index fields. |
protected void |
addNode0(CNode node)
Adds a node. |
protected int |
addNodeWithoutChangingIt(CNode node)
Adds a node without setting its parentGraph and index fields. |
java.lang.Object |
clone()
Makes an identical copy of the molecule. |
protected void |
clonecopy(CGraph graph)
Copies the clones of nodes and edges of this graph to another one. |
void |
clonelesscopy(CGraph graph)
Copy to selection. |
boolean |
contains(CGraph graph)
Does the graph contain the specified fragment? |
boolean |
contains(java.lang.Object o)
Checks if the graph contains the specified node or edge. |
protected int |
findEdge(CEdge edge)
Finds an edge in the edgess array. |
void |
findFrag(int i,
CGraph frag)
Determines the subgraph connected to the specified node. |
CGraph[] |
findFrags(java.lang.Class cl)
Determines the disconnected fragments and puts them into an array. |
protected int |
findNode(CNode node)
Finds a node in the nodes array. |
void |
fuse(CGraph graph)
Adds those nodes and edges of a graph to this one that are not already elements. |
protected void |
fuse0(CGraph graph)
Adds those nodes and edges of a graph to this one that are not already elements. |
int[][] |
getBtab()
Gets the edge (bond) table. |
int[][] |
getCtab()
Gets the connection table. |
CEdge |
getEdge(int i)
Gets an edge. |
CEdge[] |
getEdgeArray()
Creates an array of edges. |
int |
getEdgeCount()
Gets the number of edges. |
java.util.Vector |
getEdgeVector()
Gets the edges. |
CGraph |
getForefather()
Gets the first parent. |
int |
getFragCount()
Returns the number of fragments. |
int[] |
getFragIds()
Gets an array containing the fragment id for each node. |
protected int[] |
getGrinv()
Gets the graph invariants array. |
int |
getGrinv(int[] gi)
Gets the graph invariants. |
long |
getGrinvCC()
Gets the graph invariant change count. |
java.lang.Object |
getLock()
Gets the lock object for synchronization. |
CNode |
getNode(int i)
Gets a node. |
int |
getNodeCount()
Gets the number of nodes. |
java.util.Vector |
getNodeVector()
Gets the nodes. |
CGraph |
getParent()
Gets the parent graph that contains this substructure. |
int[][] |
getSSSR()
Gets the Smallest Set of Smallest Ring node indexes array. |
protected void |
incGrinvCC()
Increases the graph invariant change count and sets grinv to null. |
int |
indexOf(CEdge edge)
Gets the index of the specified edge. |
int |
indexOf(CNode node)
Gets the index of the specified node. |
void |
insertEdge(int i,
CEdge edge)
Inserts the edge at the specified index. |
void |
insertNode(int i,
CNode node)
Inserts the node at the specified index. |
protected void |
insertNullEdges(int i,
int count)
Insert nulls into the bond array. |
protected void |
insertNullNodes(int i,
int count)
Insert nulls into the atom array. |
boolean |
isEmpty()
Ask if the graph is empty or not. |
protected boolean |
isRealNodeParent()
Can it be a real node parent? |
boolean |
isSimilarTo(CGraph g)
Checks if the graph is similar to another graph. |
protected void |
makeItSimilar(CGraph g)
Empty method. |
void |
mergeNodes(CNode that,
CNode a)
Merges edges of a node with another node, then adds the node to the molecule. |
CGraph |
newInstance()
Creates a new CGraph object. |
void |
pack()
Reduce memory usage. |
protected void |
regenCtabs()
Regenerates connection table and edge table. |
void |
regenEdges()
Regenerates the edge vector: remove its elements, then put the edge objects from the nodes into it. |
void |
removeAll()
Removes all the nodes and edges. |
void |
removeAllEdges()
Removes all edges. |
void |
removeEdge(CEdge edge)
Removes an edge by reference. |
protected void |
removeEdge(CEdge edge,
int cleanupFlags)
Removes an edge by reference. |
void |
removeEdge(int i)
Removes an edge from the graph. |
protected void |
removeEdge(int i,
int cleanupFlags)
Removes an edge from the graph. |
void |
removeNode(CNode node)
Removes a node and its edges. |
void |
removeNode(CNode node,
int cleanupFlags)
Removes a node and its edges with extra clean-up options. |
void |
removeNode(int i)
Removes a node and its edges from the graph. |
void |
removeNode(int i,
int cleanupFlags)
Removes a node and its edges with extra clean-up options. |
protected void |
resetCtab()
An operation performed that changed the connection table and the graph invariants. |
protected void |
resetGrinvInParents()
Graph invariants must be recalculated for this graph and all parent graphs. |
protected java.lang.Object[] |
restoreCache(int n)
Restores caches like connection table, bond table, etc. |
protected java.lang.Object[] |
saveCache(int n)
Saves caches like connection table, bond table, etc. |
void |
setEdge(int i,
CEdge edge)
Sets the edge at the specified index. |
protected void |
setGrinvCC(long g)
Sets the graph invariant change count. |
void |
setNode(int i,
CNode node)
Sets the node at the specified index. |
protected void |
setNode0(int i,
CNode node)
Sets the node at the specified index. |
void |
sortEdgesAccordingTo(CEdge[] order)
Sorts edges in the same order as they appear in another chemical graph. |
java.lang.String |
toString()
Overrides Object.toString() to ease debugging. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected static final int INITIAL_CAPACITY
public static final int RMCLEANUP_NONE
removeNode(CNode, int),
removeNode(int, int),
removeEdge(CEdge, int),
removeEdge(int, int),
Constant Field Valuespublic static final int RMCLEANUP_ALL
removeNode(CNode, int),
removeNode(int, int),
removeEdge(CEdge, int),
removeEdge(int, int),
Constant Field Valuespublic static final int RMCLEANUP_EDGES
removeNode(CNode, int),
removeNode(int, int),
removeEdge(CEdge, int),
removeEdge(int, int),
Constant Field Valuesprotected transient CGraph superGraph
protected transient CGraph parentGraph
protected transient CNode[] nodes
protected transient int nodeCount
protected transient CEdge[] edges
protected transient int edgeCount
protected transient int[][] sssr
protected transient int[][] ctab
protected transient int[][] btab
protected transient int[] fragIds
protected transient int nFrags
protected transient int[] grinv
protected transient int nGrinv
protected transient long grinvCC
protected transient java.util.Vector cacheMemory
| Constructor Detail |
public CGraph(CGraph p,
int n,
int e)
p - the parent graph or nulln - no reallocation needed until the number of nodes is less than
this valuee - no reallocation needed until the number of edges is less than
this valuepublic CGraph(CGraph p)
p - the parent graph or nullpublic CGraph()
| Method Detail |
protected boolean isRealNodeParent()
public java.util.Vector getNodeVector()
public java.util.Vector getEdgeVector()
public int getNodeCount()
public CNode getNode(int i)
i - node index
public void setNode(int i,
CNode node)
i - node indexnode - new node reference
public final void insertNode(int i,
CNode node)
i - node indexnode - new node reference
protected void insertNullNodes(int i,
int count)
i - starting indexcount - number of new entries
public final void insertEdge(int i,
CEdge edge)
i - edge indexedge - new edge reference
protected void insertNullEdges(int i,
int count)
i - starting indexcount - number of new entriespublic int getEdgeCount()
public CEdge getEdge(int i)
i - edge index
public void setEdge(int i,
CEdge edge)
i - edge indexedge - the edge referencepublic void add(CNode node)
node - the node objectpublic void add(CEdge edge)
edge - the edge objectpublic void removeNode(CNode node)
node - the nodepublic void removeNode(int i)
i - the node indexpublic void removeEdge(CEdge edge)
edge - the edgepublic void removeEdge(int i)
i - the edge indexpublic void removeAllEdges()
public void removeAll()
public void regenEdges()
public CEdge[] getEdgeArray()
public void sortEdgesAccordingTo(CEdge[] order)
order - the edges in the other graphpublic int indexOf(CNode node)
node - the node
public int indexOf(CEdge edge)
edge - the edge
public boolean contains(java.lang.Object o)
o - the node or edge object
public boolean isEmpty()
public boolean isSimilarTo(CGraph g)
true if the graphs are similar,
false otherwiseCNode.haveEqualProperties(CNode),
CNode.haveSimilarEdges(CNode)
public void removeNode(CNode node,
int cleanupFlags)
removeNode(CNode)
instead unless you are sure what you are doing.
node - the nodecleanupFlags - extra clean-up methodsRMCLEANUP_NONE,
RMCLEANUP_ALL,
RMCLEANUP_EDGES
public void removeNode(int i,
int cleanupFlags)
removeNode(int)
instead unless you are sure what you are doing.
i - the node indexcleanupFlags - extra clean-up methodsRMCLEANUP_NONE,
RMCLEANUP_ALL,
RMCLEANUP_EDGES
protected void removeEdge(CEdge edge,
int cleanupFlags)
edge - the edgecleanupFlags - extra clean-up methodsRMCLEANUP_NONE,
RMCLEANUP_ALL,
RMCLEANUP_EDGES
protected void removeEdge(int i,
int cleanupFlags)
i - the edge indexcleanupFlags - extra clean-up methodsRMCLEANUP_NONE,
RMCLEANUP_ALL,
RMCLEANUP_EDGESprotected void fuse0(CGraph graph)
graph - the graphpublic void fuse(CGraph graph)
graph - the other graph
public void mergeNodes(CNode that,
CNode a)
that - the nodea - the other nodepublic boolean contains(CGraph graph)
graph - the fragment
protected void clonecopy(CGraph graph)
graph - the target graphpublic void clonelesscopy(CGraph graph)
graph - the target graph (the selection)public java.lang.Object clone()
public java.lang.String toString()
@', and the unsigned
hexadecimal representation of the hash code of the object.
public final int[][] getSSSR()
public int[][] getCtab()
public int[][] getBtab()
public int getGrinv(int[] gi)
gi - the output array
protected int[] getGrinv()
public final long getGrinvCC()
protected final void setGrinvCC(long g)
g - graph invariant change countprotected final void incGrinvCC()
protected final void resetGrinvInParents()
public final int getFragCount()
public final int[] getFragIds()
public final CGraph[] findFrags(java.lang.Class cl)
cl - create fragment objects of this class
public final void findFrag(int i,
CGraph frag)
i - node indexfrag - add the nodes and edges to this CGraphpublic final java.lang.Object getLock()
public final CGraph getParent()
public final CGraph getForefather()
public void pack()
public CGraph newInstance()
protected void makeItSimilar(CGraph g)
g - a CGraph objectprotected void resetCtab()
protected final int findNode(CNode node)
protected final int findEdge(CEdge edge)
protected void regenCtabs()
protected void addNode0(CNode node)
node - the node referenceprotected final int addNodeWithoutChangingIt(CNode node)
node - the node reference
protected void setNode0(int i,
CNode node)
i - node indexnode - new node referenceprotected void addEdge0(CEdge edge)
edge - the edge referenceprotected final int addEdgeWithoutChangingIt(CEdge edge)
edge - the edge reference
protected java.lang.Object[] saveCache(int n)
protected java.lang.Object[] restoreCache(int n)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||