Class DirectedGraph<V,E>
java.lang.Object
io.lacuna.bifurcan.DirectedGraph<V,E>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
edges()
boolean
forked()
This returns a data structure which is forked, which is equivalent to Clojure's persistent data structures, also sometimes called functional or immutable.int
hashCode()
In an undirected graph, this is equivalent toIGraph.out(Object)
.boolean
boolean
isLinear()
linear()
This returns a data structure which is linear, or temporarily mutable.<U> DirectedGraph
<V, U> In an undirected graph, this is equivalent toIGraph.in(Object)
.replace
(V a, V b, BinaryOperator<E> merge) toString()
vertices()
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.lacuna.bifurcan.ICollection
iterator, nth
Methods inherited from interface io.lacuna.bifurcan.IGraph
add, indexOf, iterator, merge, nth, remove, size, split
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
DirectedGraph
public DirectedGraph() -
DirectedGraph
-
-
Method Details
-
vertices
-
edges
-
edge
-
edge
-
in
-
out
-
mapEdges
-
link
-
link
-
link
-
unlink
-
add
-
remove
-
merge
-
select
-
replace
-
replace
-
forked
Description copied from interface:ICollection
This returns a data structure which is forked, which is equivalent to Clojure's persistent data structures, also sometimes called functional or immutable. This is called "forked" because it means that multiple functions can make divergent changes to the data structure without affecting each other.If only a single function or scope uses the data structure, it can be left as a linear data structure, which can have significant performance benefits.
If the data structure is already forked, it will simply return itself.
- Specified by:
forked
in interfaceICollection<V,
E> - Returns:
- a forked form of the data structure
-
linear
Description copied from interface:ICollection
This returns a data structure which is linear, or temporarily mutable. The term "linear", as used here, does not completely align with the formal definition of linear types as used in type theory. It is meant to describe the linear dataflow of the method calls, and as a converse to "forked" data structures.If
ICollection.forked()
is called on a linear collection, all references to that linear collection should be discarded.If the data structure is already linear, it will simply return itself.
- Specified by:
linear
in interfaceICollection<V,
E> - Returns:
- a linear form of this data structure
-
isLinear
public boolean isLinear()- Specified by:
isLinear
in interfaceICollection<V,
E> - Returns:
- true, if the collection is linear
-
isDirected
public boolean isDirected()- Specified by:
isDirected
in interfaceIGraph<V,
E> - Returns:
- whether the graph is directed
-
transpose
-
vertexHash
- Specified by:
vertexHash
in interfaceIGraph<V,
E> - Returns:
- the hash function for vertices
-
vertexEquality
- Specified by:
vertexEquality
in interfaceIGraph<V,
E> - Returns:
- the equality check for vertices
-
hashCode
-
equals
-
clone
-
toString
-