T - type of the tree's values@Deprecated public static final class Tree.Empty<T> extends Tree<T> implements java.io.Serializable
Tree.Empty<T>, Tree.Node<T>, Tree.Order| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
draw()
Deprecated.
Creates a neat 2-dimensional drawing of a tree.
|
boolean |
equals(java.lang.Object o)
Deprecated.
In Vavr there are four basic classes of collections:
Seq (sequential elements)
Set (distinct elements)
Map (indexed elements)
Multimap (indexed collections)
Two collection instances of these classes are equal if and only if both collections
belong to the same basic collection class (Seq, Set, Map or Multimap)
contain the same elements
have the same element order, if the collections are of type Seq
Two Map/Multimap elements, resp.
|
List<Tree.Node<T>> |
getChildren()
Deprecated.
Returns the children of this tree.
|
T |
getValue()
Deprecated.
Gets the value of this tree.
|
int |
hashCode()
Deprecated.
Returns the hash code of this collection.
|
static <T> Tree.Empty<T> |
instance()
Deprecated.
|
boolean |
isEmpty()
Deprecated.
Checks if this Traversable is empty.
|
boolean |
isLeaf()
Deprecated.
Checks if this Tree is a leaf.
|
T |
last()
Deprecated.
Dual of Traversable.head(), returning the last element.
|
int |
length()
Deprecated.
Computes the number of elements of this Traversable.
|
java.lang.String |
toLispString()
Deprecated.
Creates a Lisp-like representation of this
Tree. |
java.lang.String |
toString()
Deprecated.
Clarifies that values have a proper toString() method implemented.
|
branchCount, build, collect, collector, distinct, distinctBy, distinctBy, drop, dropRight, dropUntil, dropWhile, empty, fill, fill, filter, filterNot, flatMap, foldRight, groupBy, grouped, hasDefiniteSize, head, init, initOption, isAsync, isBranch, isDistinct, isLazy, isSequential, isTraversableAgain, iterator, iterator, leafCount, map, narrow, nodeCount, of, of, of, of, ofAll, ofAll, orElse, orElse, partition, peek, recurse, replace, replaceAll, retainAll, scan, scanLeft, scanRight, slideBy, sliding, sliding, span, stringPrefix, tabulate, tail, tailOption, take, takeRight, takeUntil, takeWhile, transform, traverse, traverse, values, values, zip, zipAll, zipWith, zipWithIndex, zipWithIndexclone, finalize, getClass, notify, notifyAll, wait, wait, waitarrangeBy, average, containsAll, count, existsUnique, find, findLast, fold, foldLeft, forEachWithIndex, get, headOption, isOrdered, isSingleValued, lastOption, max, maxBy, maxBy, min, minBy, minBy, mkCharSeq, mkCharSeq, mkCharSeq, mkString, mkString, mkString, narrow, nonEmpty, product, reduce, reduceLeft, reduceLeftOption, reduceOption, reduceRight, reduceRightOption, single, singleOption, size, spliterator, sum, toLinkedMap, toMap, toSortedMap, toSortedMap, unzip, unzip3collect, collect, contains, corresponds, eq, exists, forAll, forEach, getOrElse, getOrElse, getOrElseThrow, getOrElseTry, getOrNull, narrow, out, out, stderr, stdout, toArray, toCharSeq, toCompletableFuture, toEither, toEither, toInvalid, toInvalid, toJavaArray, toJavaArray, toJavaArray, toJavaCollection, toJavaList, toJavaList, toJavaMap, toJavaMap, toJavaMap, toJavaOptional, toJavaParallelStream, toJavaSet, toJavaSet, toJavaStream, toLeft, toLeft, toLinkedMap, toLinkedMap, toLinkedSet, toList, toMap, toMap, toOption, toPriorityQueue, toPriorityQueue, toQueue, toRight, toRight, toSet, toSortedMap, toSortedMap, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toStream, toTree, toTree, toTry, toTry, toValid, toValid, toValidation, toValidation, toVectorpublic static <T> Tree.Empty<T> instance()
public List<Tree.Node<T>> getChildren()
TreegetChildren in class Tree<T>public T getValue()
Treepublic boolean isEmpty()
Traversablepublic int length()
Traversable
Same as Traversable.size().
length in interface Traversable<T>public boolean isLeaf()
Treepublic T last()
Traversablelast in interface Traversable<T>public boolean equals(java.lang.Object o)
TraversableNotes:
public int hashCode()
Traversable
int hash = 1;
for (T t : this) { hash = hash * 31 + Objects.hashCode(t); }
Collections with arbitrary iteration order are hashed in a way such that the hash of a fixed number of elements is independent of their iteration order.
int hash = 1;
for (T t : this) { hash += Objects.hashCode(t); }
Please note that the particular hashing algorithms may change in a future version of Vavr.
public final class Hashed<K> {
private final K key;
private final Lazy<Integer> hashCode;
public Hashed(K key) {
this.key = key;
this.hashCode = Lazy.of(() -> Objects.hashCode(key));
}
public K key() {
return key;
}
@Override
public boolean equals(Object o) {
if (o == key) {
return true;
} else if (key != null && o instanceof Hashed) {
final Hashed that = (Hashed) o;
return key.equals(that.key);
} else {
return false;
}
}
@Override
public int hashCode() {
return hashCode.get();
}
@Override
public String toString() {
return "Hashed(" + (key == null ? "null" : key.toString()) + ")";
}
}
public java.lang.String toString()
ValueSee Object.toString().
public java.lang.String toLispString()
TreeTree.toLispString in class Tree<T>Tree as Lisp-string, i.e. represented as list of lists.