public abstract class AbstractCompactGraph<E extends CompactEdge<EP>,NP,EP> extends Object implements MutableGraph<Integer,E,NP,EP>, NodeIDs<Integer>
SimpleGraph.NormalGraphView<N,G extends SimpleGraph<N>>
Modifier and Type | Field and Description |
---|---|
protected ResizingObjectArray |
edges |
protected int |
size |
Constructor and Description |
---|
AbstractCompactGraph() |
AbstractCompactGraph(int initialCapacity) |
Modifier and Type | Method and Description |
---|---|
int |
addIntNode() |
int |
addIntNode(NP properties) |
Integer |
addNode(NP properties)
Adds a new node to the graph.
|
E |
connect(Integer source,
Integer target,
EP properties)
Inserts an edge in the graph.
|
CompactEdge<EP> |
connect(int source,
int target) |
E |
connect(int source,
int target,
EP property) |
protected abstract E |
createEdge(int source,
int target,
EP property) |
EP |
getEdgeProperty(E edge)
Retrieves the property of a given edge.
|
Integer |
getNode(int id) |
int |
getNodeId(Integer node) |
abstract NP |
getNodeProperties(int node) |
NP |
getNodeProperty(Integer node)
Retrieves the property of a given node.
|
Collection<Integer> |
getNodes()
Retrieves an (unmodifiable) collection of the nodes in this graph.
|
protected List<E> |
getOutEdgeList(int node) |
Collection<E> |
getOutgoingEdges(int node) |
Collection<E> |
getOutgoingEdges(Integer node)
Retrieves the outgoing edges of a given node.
|
Integer |
getTarget(E edge)
Retrieves, for a given edge, its target node.
|
NodeIDs<Integer> |
nodeIDs() |
void |
setEdgeProperty(E edge,
EP property) |
void |
setNodeProperty(Integer node,
NP property) |
abstract void |
setNodeProperty(int node,
NP property) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addNode, connect
asNormalGraph, getVisualizationHelper
iterator, nodesStream, size
forEach, spliterator
adjacentTargetsIterator, adjacentTargetsStream, getAdjacentTargets, getEdgesBetween, outgoingEdges, outgoingEdgesIterator, outgoingEdgesStream
adjacentTargets, createDynamicNodeMapping, createStaticNodeMapping, isConnected
protected final ResizingObjectArray edges
protected int size
public AbstractCompactGraph()
public AbstractCompactGraph(int initialCapacity)
public Collection<Integer> getNodes()
SimpleGraph
getNodes
in interface SimpleGraph<Integer>
public NodeIDs<Integer> nodeIDs()
nodeIDs
in interface SimpleGraph<Integer>
public Collection<E> getOutgoingEdges(Integer node)
IndefiniteGraph
getOutgoingEdges
in interface IndefiniteGraph<Integer,E extends CompactEdge<EP>>
node
- the node.Collection
of all outgoing edges, or null
if the node has no outgoing edges.public Collection<E> getOutgoingEdges(int node)
public Integer getTarget(E edge)
IndefiniteGraph
getTarget
in interface IndefiniteGraph<Integer,E extends CompactEdge<EP>>
edge
- the edge.public Integer addNode(NP properties)
MutableGraph
addNode
in interface MutableGraph<Integer,E extends CompactEdge<EP>,NP,EP>
properties
- the property for the new nodepublic int addIntNode(NP properties)
public int addIntNode()
public void setNodeProperty(Integer node, NP property)
setNodeProperty
in interface MutableGraph<Integer,E extends CompactEdge<EP>,NP,EP>
public abstract void setNodeProperty(int node, NP property)
public E connect(Integer source, Integer target, EP properties)
MutableGraph
connect
in interface MutableGraph<Integer,E extends CompactEdge<EP>,NP,EP>
source
- the source node of the edgetarget
- the target node of the edgeproperties
- the property of the edgepublic CompactEdge<EP> connect(int source, int target)
public void setEdgeProperty(E edge, EP property)
setEdgeProperty
in interface MutableGraph<Integer,E extends CompactEdge<EP>,NP,EP>
public NP getNodeProperty(Integer node)
UniversalIndefiniteGraph
getNodeProperty
in interface UniversalIndefiniteGraph<Integer,E extends CompactEdge<EP>,NP,EP>
node
- the nodepublic abstract NP getNodeProperties(int node)
public EP getEdgeProperty(E edge)
UniversalIndefiniteGraph
getEdgeProperty
in interface UniversalIndefiniteGraph<Integer,E extends CompactEdge<EP>,NP,EP>
edge
- the edgeCopyright © 2018. All rights reserved.