Modifier and Type | Method and Description |
---|---|
boolean |
add(N node)
Add the given node to the graph, sans edges
|
boolean |
addAll(java.util.Collection<? extends N> clctn) |
void |
addObserver(java.util.Observer o) |
float |
avg_nodal_degree() |
void |
clear_all_edges()
Clear all edges from the graph.
|
void |
clear() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> clctn) |
int |
countObservers() |
void |
deleteObserver(java.util.Observer o) |
void |
deleteObservers() |
int |
edge_outdegree(N node)
The out-degree for a give node.
|
Edge<N,E> |
edge(N from,
N to)
Find the first edge from a node to another node.
|
Edge<N,E> |
edge(N from,
N to,
E label)
Find the edge with the given label, from the one node to another
node, if it exists.
|
java.util.Set<Edge<N,E>> |
edges(N from) |
java.util.Collection<Edge<N,E>> |
edges(N from,
N to)
Find the edges going from one node to another node.
|
boolean |
hasChanged() |
boolean |
is_directed() |
boolean |
is_linked(N from,
N to)
Determine if there is a link from one node to another.
|
boolean |
is_simple() |
boolean |
isEmpty() |
java.util.Iterator<N> |
iterator() |
long |
link_count() |
int |
max_nodal_degree() |
int |
nodal_outdegree(N node) |
void |
notifyObservers() |
void |
notifyObservers(java.lang.Object arg) |
void |
plugObservable()
"Plug" delivery of Observable events to observers, so that any such events
are instead queued up internally, and potentially coalesced, rather than
delivered to Observers.
|
java.lang.Iterable<Edge<N,E>> |
random_edge_iterable(N n)
Provide a random-access Iterable over the <Edge<N,E>>-edges from the
given node.
|
java.lang.Iterable<N> |
random_node_iterable()
Provide a random-access Iterable over the <N>-nodes in the graph.
|
boolean |
remove(N from,
N to)
Remove all edges that go from one node to another
|
boolean |
remove(N from,
N to,
E label)
Remove 1 specific edge, given by the label, from between two nodes.
|
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection<?> clctn) |
boolean |
retainAll(java.util.Collection<?> clctn) |
void |
set(N from,
N to,
E label)
Set an edge from one node to another with the given label.
|
void |
set(N from,
N to,
E label,
int weight)
Set an edge from one node to another with the given label and weight.
|
int |
size() |
java.util.Set<N> |
successors(N from) |
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] ts) |
void |
unplugObservable()
Unplug the delivery of Observable events.
|
public boolean is_directed()
is_directed
in interface Graph<N,E>
public boolean is_simple()
public void set(N from, N to, E label)
Graph
public void set(N from, N to, E label, int weight)
Graph
set
in interface Graph<N,E>
weight
- a user-specified metric or weight for the edgeGraph.set(Object, Object, Object)
public boolean add(N node)
Graph
public boolean remove(N from, N to, E label)
Graph
public boolean remove(N from, N to)
Graph
remove
in interface Graph<N,E>
Graph.set(Object, Object, Object)
,
Graph.add(Object)
public void clear_all_edges()
Graph
clear_all_edges
in interface Graph<N,E>
public int edge_outdegree(N node)
Graph
edge_outdegree
in interface Graph<N,E>
public int nodal_outdegree(N node)
nodal_outdegree
in interface Graph<N,E>
public float avg_nodal_degree()
avg_nodal_degree
in interface Graph<N,E>
public long link_count()
link_count
in interface Graph<N,E>
public int max_nodal_degree()
max_nodal_degree
in interface Graph<N,E>
public java.util.Set<N> successors(N from)
successors
in interface Graph<N,E>
public java.util.Collection<Edge<N,E>> edges(N from, N to)
Graph
edges
in interface Graph<N,E>
from
- Which node we want to query edges from.to
- The node to which we're looking for an edge.Graph.edges(Object)
public Edge<N,E> edge(N from, N to)
Graph
public boolean is_linked(N from, N to)
Graph
public Edge<N,E> edge(N from, N to, E label)
Graph
edge
in interface Graph<N,E>
from
- Which node we want to query edges from.to
- The node to which we're looking for an edge.label
- The label of the edge we're interested in.null
otherwise.public java.lang.Iterable<N> random_node_iterable()
Graph
random_node_iterable
in interface Graph<N,E>
public java.lang.Iterable<Edge<N,E>> random_edge_iterable(N n)
Graph
random_edge_iterable
in interface Graph<N,E>
public void addObserver(java.util.Observer o)
addObserver
in interface Graph<N,E>
Observable
public int countObservers()
countObservers
in interface Graph<N,E>
Observable
public void deleteObserver(java.util.Observer o)
deleteObserver
in interface Graph<N,E>
Observable
public void deleteObservers()
deleteObservers
in interface Graph<N,E>
Observable
public boolean hasChanged()
hasChanged
in interface Graph<N,E>
Observable
public void notifyObservers()
notifyObservers
in interface Graph<N,E>
Observable
public void notifyObservers(java.lang.Object arg)
notifyObservers
in interface Graph<N,E>
Observable
public void plugObservable()
Graph
plugObservable
in interface Graph<N,E>
public void unplugObservable()
Graph
unplugObservable
in interface Graph<N,E>
public int size()
public boolean isEmpty()
public boolean contains(java.lang.Object o)
public java.util.Iterator<N> iterator()
public java.lang.Object[] toArray()
public <T> T[] toArray(T[] ts)
public boolean remove(java.lang.Object o)
public boolean containsAll(java.util.Collection<?> clctn)
public boolean addAll(java.util.Collection<? extends N> clctn)
public boolean retainAll(java.util.Collection<?> clctn)
public boolean removeAll(java.util.Collection<?> clctn)