public class SparseWeightedDirectedTypedEdgeSet<T> extends AbstractSet<WeightedDirectedTypedEdge<T>> implements EdgeSet<WeightedDirectedTypedEdge<T>>, Serializable
EdgeSet implementation that stores DirectedEdge instances
for a vertex.| Constructor and Description |
|---|
SparseWeightedDirectedTypedEdgeSet(int root) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(WeightedDirectedTypedEdge<T> e)
Adds the edge to this set if one of the vertices is the root vertex and
if the non-root vertex has a greater index that this vertex.
|
void |
clear() |
IntSet |
connected()
Returns the set of vertices connected to the root edges.
|
boolean |
connects(int vertex)
Returns true if the root vertex is connected to the provided vertex.
|
boolean |
connects(int vertex,
T type) |
boolean |
contains(Object o) |
SparseWeightedDirectedTypedEdgeSet<T> |
copy(IntSet vertices)
Copies the edges in this set that are connected to any of the vertices in
the provided set.
|
int |
disconnect(int vertex)
Removes all edges instances that connect to the specified vertex,
returning the number of edges that were removed, if any.
|
Set<WeightedDirectedTypedEdge<T>> |
getEdges(int vertex)
Returns the set of
Edge instances that connect the root vertex
with this vertex or an empty set if no such edges exist. |
Set<WeightedDirectedTypedEdge<T>> |
getEdges(int vertex,
Set<T> types) |
Set<WeightedDirectedTypedEdge<T>> |
getEdges(Set<T> types) |
Set<WeightedDirectedTypedEdge<T>> |
getEdges(T type) |
int |
getRoot()
Returns the vertex to which all edges in this set are connected.
|
Set<WeightedDirectedTypedEdge<T>> |
incoming() |
boolean |
isEmpty() |
Iterator<WeightedDirectedTypedEdge<T>> |
iterator() |
Set<WeightedDirectedTypedEdge<T>> |
outgoing() |
IntSet |
predecessors() |
boolean |
remove(Object o) |
int |
size() |
IntSet |
successors() |
double |
sum()
Returns the sum of the weights of the edges contained in this set.
|
Iterator<WeightedDirectedTypedEdge<T>> |
uniqueIterator() |
equals, hashCode, removeAlladdAll, containsAll, retainAll, toArray, toArray, toStringpublic SparseWeightedDirectedTypedEdgeSet(int root)
public boolean add(WeightedDirectedTypedEdge<T> e)
add in interface EdgeSet<WeightedDirectedTypedEdge<T>>add in interface Collection<WeightedDirectedTypedEdge<T>>add in interface Set<WeightedDirectedTypedEdge<T>>add in class AbstractCollection<WeightedDirectedTypedEdge<T>>true if the edge was added, false if the edge was
already present, or if it could not be added to this edge set due
to the root vertex not being connected to the edgepublic void clear()
clear in interface Collection<WeightedDirectedTypedEdge<T>>clear in interface Set<WeightedDirectedTypedEdge<T>>clear in class AbstractCollection<WeightedDirectedTypedEdge<T>>public IntSet connected()
connected in interface EdgeSet<WeightedDirectedTypedEdge<T>>public boolean connects(int vertex)
connects in interface EdgeSet<WeightedDirectedTypedEdge<T>>public boolean connects(int vertex,
T type)
public boolean contains(Object o)
contains in interface Collection<WeightedDirectedTypedEdge<T>>contains in interface Set<WeightedDirectedTypedEdge<T>>contains in class AbstractCollection<WeightedDirectedTypedEdge<T>>public SparseWeightedDirectedTypedEdgeSet<T> copy(IntSet vertices)
EdgeSetcopy in interface EdgeSet<WeightedDirectedTypedEdge<T>>public int disconnect(int vertex)
disconnect in interface EdgeSet<WeightedDirectedTypedEdge<T>>public Set<WeightedDirectedTypedEdge<T>> getEdges(T type)
public Set<WeightedDirectedTypedEdge<T>> getEdges(Set<T> types)
public Set<WeightedDirectedTypedEdge<T>> getEdges(int vertex)
Edge instances that connect the root vertex
with this vertex or an empty set if no such edges exist.getEdges in interface EdgeSet<WeightedDirectedTypedEdge<T>>public Set<WeightedDirectedTypedEdge<T>> getEdges(int vertex, Set<T> types)
public int getRoot()
getRoot in interface EdgeSet<WeightedDirectedTypedEdge<T>>public Set<WeightedDirectedTypedEdge<T>> incoming()
public boolean isEmpty()
isEmpty in interface Collection<WeightedDirectedTypedEdge<T>>isEmpty in interface Set<WeightedDirectedTypedEdge<T>>isEmpty in class AbstractCollection<WeightedDirectedTypedEdge<T>>public Iterator<WeightedDirectedTypedEdge<T>> iterator()
iterator in interface Iterable<WeightedDirectedTypedEdge<T>>iterator in interface Collection<WeightedDirectedTypedEdge<T>>iterator in interface Set<WeightedDirectedTypedEdge<T>>iterator in class AbstractCollection<WeightedDirectedTypedEdge<T>>public Set<WeightedDirectedTypedEdge<T>> outgoing()
public IntSet predecessors()
public int size()
size in interface Collection<WeightedDirectedTypedEdge<T>>size in interface Set<WeightedDirectedTypedEdge<T>>size in class AbstractCollection<WeightedDirectedTypedEdge<T>>public boolean remove(Object o)
remove in interface Collection<WeightedDirectedTypedEdge<T>>remove in interface Set<WeightedDirectedTypedEdge<T>>remove in class AbstractCollection<WeightedDirectedTypedEdge<T>>public IntSet successors()
public double sum()
public Iterator<WeightedDirectedTypedEdge<T>> uniqueIterator()
Copyright © 2012. All Rights Reserved.