E - the edge type of the graphpublic final class EdgeList<E extends DirectedEdge<?,E>> extends java.lang.Object implements Meldable<EdgeList<E>>, java.lang.Iterable<E>
| Constructor and Description |
|---|
EdgeList()
Creates an empty
EdgeList |
EdgeList(java.lang.Iterable<? extends E> other)
Takes another
EdgeList an appends it to this one |
| Modifier and Type | Method and Description |
|---|---|
void |
append(E edge)
Takes an edge and appends it to this
EdgeList. |
void |
clear()
Clears the
EdgeList |
<C extends java.util.Collection<E>> |
collect(java.util.function.Supplier<C> collectionFactory)
Returns a new
Collection of the elements of this EdgeList using the provided factory. |
boolean |
equals(java.lang.Object o)
Checks if another object is equal to this
EdgeList. |
java.util.Iterator<E> |
iterator()
Returns an
Iterator over the elements in this EdgeList. |
<T extends DirectedEdge<?,T>> |
map(java.util.function.Function<E,T> mapper)
Transforms the elements of this
EdgeList using the provided function. |
<T,C extends java.util.Collection<T>> |
mapCollect(java.util.function.Function<E,T> mapper,
java.util.function.Supplier<C> collectionFactory)
Returns a new
Collection of the elements of this EdgeList using the provided factory after
transforming each element using the provided function. |
void |
meld(EdgeList<E> other)
Destructively melds other into this.
|
void |
prepend(E edge)
Takes an edge and prepends it to this
EdgeList. |
int |
size()
Returns the number of edges in this
EdgeList. |
java.util.stream.Stream<E> |
stream()
Returns a
Stream of the edges of this EdgeList. |
E[] |
toArray(java.util.function.IntFunction<E[]> generator)
Creates an array of the edges of this
EdgeList using the provided generator |
java.lang.String |
toString()
Returns a string representation of this
EdgeList. |
public EdgeList()
EdgeListpublic void meld(EdgeList<E> other)
Meldablepublic int size()
EdgeList.EdgeListpublic void append(E edge)
EdgeList.edge - the edge to be appended to this EdgeListpublic void prepend(E edge)
EdgeList.edge - the edge to be prepended to this EdgeListpublic void clear()
EdgeListpublic java.util.stream.Stream<E> stream()
Stream of the edges of this EdgeList.Stream of the edges of this EdgeListpublic E[] toArray(java.util.function.IntFunction<E[]> generator)
EdgeList using the provided generatorgenerator - a function which produces a new array of the desired type and the provided lengthEdgeListpublic <C extends java.util.Collection<E>> C collect(java.util.function.Supplier<C> collectionFactory)
Collection of the elements of this EdgeList using the provided factory.C - the type of the resulting CollectioncollectionFactory - a Supplier which returns a new, empty Collection of the appropriate typeCollection of the elements of this EdgeListpublic <T,C extends java.util.Collection<T>> C mapCollect(java.util.function.Function<E,T> mapper, java.util.function.Supplier<C> collectionFactory)
Collection of the elements of this EdgeList using the provided factory after
transforming each element using the provided function.T - the result type of the mapping functionC - the type of the resulting Collectionmapper - the mapping functioncollectionFactory - a Supplier which returns a new, empty Collection of the appropriate typeCollection containing the mapped elements of this EdgeListpublic <T extends DirectedEdge<?,T>> EdgeList<T> map(java.util.function.Function<E,T> mapper)
EdgeList using the provided function.public java.lang.String toString()
EdgeList.toString in class java.lang.ObjectEdgeList.public boolean equals(java.lang.Object o)
EdgeList. Two instances of EdgeList are equal
iff they have the same size and contain the same elements in identical order.equals in class java.lang.Objecto - object to be tested for equalityEdgeList.