Class MolecularGraph
java.lang.Object
org.episteme.natural.chemistry.MolecularGraph
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enumNested classes/interfaces inherited from interface Graph
Graph.Edge<V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddBond(Atom a, Atom b, MolecularGraph.BondType type) booleanAdds an edge between two vertices.booleanAdds a vertex to the graph.intReturns the degree (number of edges) of a vertex.edges()Returns all edges in this graph.getAtoms()getBonds()connection table: Mapinvalid input: '<'Atom, List> Returns the formula (e.g.doubleCalculates molecular mass.booleanChecks if this graph is directed.Returns neighbors of a vertex.toString()intReturns the number of vertices in the graph.vertices()Returns all vertices in this graph.
-
Constructor Details
-
MolecularGraph
public MolecularGraph()
-
-
Method Details
-
addAtom
-
addBond
-
getAtoms
-
getBonds
-
getConnections
connection table: Mapinvalid input: '<'Atom, List> -
getMolecularMass
public double getMolecularMass()Calculates molecular mass. -
getFormula
Returns the formula (e.g. C6H6). -
toString
-
vertices
-
edges
-
addVertex
-
addEdge
-
neighbors
-
degree
-
isDirected
public boolean isDirected()Description copied from interface:GraphChecks if this graph is directed.- Specified by:
isDirectedin interfaceGraph<Atom>- Returns:
- true if directed, false if undirected
-
vertexCount
public int vertexCount()Description copied from interface:GraphReturns the number of vertices in the graph.- Specified by:
vertexCountin interfaceGraph<Atom>- Returns:
- the number of vertices
-