Modifier and Type | Method and Description |
---|---|
boolean |
addEdge(int vertex1,
int vertex2)
Adds an edge between the two vertices, returning
true if the edge
was not previously present. |
boolean |
addEdge(int vertex1,
int vertex2,
Calendar start,
Calendar end) |
boolean |
addEdge(int vertex1,
int vertex2,
Date start,
Date end) |
boolean |
addEdge(int vertex1,
int vertex2,
long start,
long end) |
boolean |
addVertex(int i)
Adds a vertex with the provided index to the graph, returning
true
if the vertex was not previously present. |
boolean |
addVertex(int i,
Calendar start,
Calendar end) |
boolean |
addVertex(int i,
Date start,
Date end) |
boolean |
addVertex(int i,
long start,
long end) |
void |
clear()
Removes all the edges and vertices from this graph
|
void |
clearEdges()
Removes all the edges in this graph, retaining all the vertices.
|
boolean |
containsEdge(int vertex1,
int vertex2,
Calendar atTime)
Returns
true if this graph contains an edge between vertex1 and vertex2 . |
boolean |
containsEdge(int vertex1,
int vertex2,
Date atTime) |
boolean |
containsEdge(int vertex1,
int vertex2,
long atTime) |
Set<? extends TemporalEdge> |
edges()
Returns the set of edges contained in this graph.
|
Set<? extends TemporalEdge> |
getAdjacencyList(int vertex)
Returns the set of edges connected to the provided vertex.
|
TemporalEdge |
getEdge(int vertex1,
int vertex2)
Returns the
Edge instance connecting the two vertices or null if the vertices are not connected. |
Graph |
subgraph(IntSet vertices)
Returns a view of this graph containing only the specified vertices.
|
Graph |
subgraph(IntSet vertices,
Calendar atTime) |
Graph |
subgraph(IntSet vertices,
Calendar startTime,
Calendar endTime) |
Graph |
subgraph(IntSet vertices,
Date atTime) |
Graph |
subgraph(IntSet vertices,
Date startTime,
Date endTime) |
Graph |
subgraph(IntSet vertices,
long atTime) |
Graph |
subgraph(IntSet vertices,
long startTime,
long endTime) |
boolean addVertex(int i)
true
if the vertex was not previously present.i
- a non-negative index for a vertex. If the graph has size bounds
(i.e. a limited number of vertices), the implementation may throw
an exception if this index exceeds those bounds.IllegalArgumentException
- if i
is negative or beyond the
number of representable vertices in the current instanceboolean addVertex(int i, long start, long end)
boolean addEdge(int vertex1, int vertex2)
true
if the edge
was not previously present. Implemenations are free to decide the
behavior for cases where one or both of the vertices are not currently in
the graph, and whether self-edges are allowed (i.e. vertex1 ==
vertex2
).boolean addEdge(int vertex1, int vertex2, long start, long end)
void clear()
void clearEdges()
clearEdges
in interface Graph
boolean containsEdge(int vertex1, int vertex2, Calendar atTime)
true
if this graph contains an edge between vertex1
and vertex2
.boolean containsEdge(int vertex1, int vertex2, Date atTime)
boolean containsEdge(int vertex1, int vertex2, long atTime)
Set<? extends TemporalEdge> edges()
Set<? extends TemporalEdge> getAdjacencyList(int vertex)
getAdjacencyList
in interface Graph
TemporalEdge getEdge(int vertex1, int vertex2)
Edge
instance connecting the two vertices or null
if the vertices are not connected.Graph subgraph(IntSet vertices)
vertices
- the vertices to include in the subgraphIllegalArgumentException
- if vertices
contains vertices
not present in this graphCopyright © 2012. All Rights Reserved.