public class TreeClass<Id,Node> extends DagClass<Id,Node> implements Tree<Id,Node>
Constructor and Description |
---|
TreeClass(IdTree<Id> idTree,
com.google.common.collect.ImmutableBiMap<Id,Node> id__node,
boolean allowPartial) |
Modifier and Type | Method and Description |
---|---|
IdTree<Id> |
ancestorIdGraph(Id id,
boolean inclusive)
Getting an id's ancestor id graph (its, parents' parents, and so on).
|
IdTree<Id> |
ancestorIdGraph(Set<Id> ids,
boolean inclusive)
Getting an id set's ancestor id graph (their parents, parents' parents, and so on).
|
com.google.common.collect.ImmutableList<Id> |
ancestorIdList(Id id,
boolean inclusive)
Getting an id's ancestor id list, with the root id first and the id's parent id last.
|
com.google.common.collect.ImmutableList<Node> |
ancestorNodeList(Id id,
boolean inclusive)
Getting an id's ancestor node list, with the root node first and the id's parent node last.
|
int |
depth(Id id)
Getting the size of an id's ancestor list.
|
IdTree<Id> |
descendantIdTree(Id id) |
IdTree<Id> |
idGraph()
The internal id graph.
|
Id |
leastDeep(Set<Id> ids)
Select the least deep id from a set, non-deterministic if there are ties.
|
int |
maxDepth()
The maximum depth in the tree.
|
Id |
mostDeep(Set<Id> ids)
Select the most deep id from a set, non-deterministic if there are ties.
|
com.google.common.base.Optional<Id> |
parentId(Id id)
Getting an id's parent id, will be absent if the id is the root.
|
com.google.common.base.Optional<Node> |
parentNode(Id id)
Getting an id's parent node, will be absent if the id is the root.
|
Id |
rootId()
The tree's root id.
|
Node |
rootNode()
The tree's root node.
|
breadthIdIterable, breadthIdList, breadthNodeIterable, breadthNodeList, depthIdIterable, depthIdList, depthNodeIterable, depthNodeList, descendantIdGraph, descendantIdGraph, filterIdGraph, topsortIdList, topsortNodeList
add, addAll, ancestorIdIterable, ancestorIdIterable, ancestorIdSet, ancestorIdSet, ancestorNodeIterable, ancestorNodeIterable, ancestorNodeSet, ancestorNodeSet, assertIdsEqual, assertIdsEqual, childIdSet, childNodeSet, clear, contains, containsAll, containsCycle, containsNodeForId, descendantIdIterable, descendantIdIterable, descendantIdSet, descendantIdSet, descendantNodeIterable, descendantNodeIterable, descendantNodeSet, descendantNodeSet, fields, getId, getNode, id__childIds, id__node, id__parentIds, idSet, idSize, isAncestorOf, isChildOf, isDescendantOf, isEmpty, isLeaf, isParentOf, isRoot, iterator, leafIdSet, leafNodeSet, nodeSet, nodeSize, optionalTopsortIdList, optionalTopsortNodeList, parentIdSet, parentNodeSet, remove, removeAll, retainAll, rootIdSet, rootNodeSet, size, toArray, toArray, transformIterable, transformIterable, transformIterator, transformIterator, transformList, transformList, transformOptional, transformOptional, transformSet, transformSet, traverseIdIterable, traverseIdIterable, traverseIdList, traverseIdList, traverseNodeIterable, traverseNodeIterable, traverseNodeList, traverseNodeList, unboundIdSet
equals, hashCode, isEntity
array, objectHelper, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
breadthNodeIterable, breadthNodeList, depthNodeIterable, depthNodeList, topsortNodeList
ancestorNodeIterable, ancestorNodeIterable, ancestorNodeSet, ancestorNodeSet, childNodeSet, descendantNodeIterable, descendantNodeIterable, descendantNodeSet, descendantNodeSet, leafNodeSet, optionalTopsortNodeList, parentNodeSet, rootNodeSet, transformIterable, transformIterator, transformList, transformOptional, transformSet, traverseNodeIterable, traverseNodeIterable, traverseNodeList, traverseNodeList
add, addAll, clear, containsNodeForId, getId, getNode, id__node, nodeSet, nodeSize, remove, removeAll, retainAll, transformIterable, transformIterator, transformList, transformOptional, transformSet, unboundIdSet
contains, containsAll, equals, hashCode, isEmpty, iterator, size, toArray, toArray
breadthIdIterable, breadthIdList, depthIdIterable, depthIdList, descendantIdGraph, descendantIdGraph, filterIdGraph, topsortIdList
ancestorIdIterable, ancestorIdIterable, ancestorIdSet, ancestorIdSet, assertIdsEqual, assertIdsEqual, childIdSet, containsCycle, descendantIdIterable, descendantIdIterable, descendantIdSet, descendantIdSet, id__childIds, id__parentIds, idSet, idSize, isAncestorOf, isChildOf, isDescendantOf, isLeaf, isParentOf, isRoot, leafIdSet, optionalTopsortIdList, parentIdSet, rootIdSet, traverseIdIterable, traverseIdIterable, traverseIdList, traverseIdList
public IdTree<Id> idGraph()
PartialGraph
public com.google.common.base.Optional<Id> parentId(Id id)
IdTree
public com.google.common.base.Optional<Node> parentNode(Id id)
Tree
parentNode
in interface Tree<Id,Node>
public IdTree<Id> ancestorIdGraph(Id id, boolean inclusive)
IdGraph
ancestorIdGraph
in interface IdDag<Id>
ancestorIdGraph
in interface IdGraph<Id>
ancestorIdGraph
in interface IdTree<Id>
ancestorIdGraph
in class DagClass<Id,Node>
public IdTree<Id> ancestorIdGraph(Set<Id> ids, boolean inclusive)
IdGraph
ancestorIdGraph
in interface IdDag<Id>
ancestorIdGraph
in interface IdGraph<Id>
ancestorIdGraph
in interface IdTree<Id>
ancestorIdGraph
in class DagClass<Id,Node>
public com.google.common.collect.ImmutableList<Id> ancestorIdList(Id id, boolean inclusive)
IdTree
ancestorIdList
in interface IdTree<Id>
public com.google.common.collect.ImmutableList<Node> ancestorNodeList(Id id, boolean inclusive)
Tree
ancestorNodeList
in interface Tree<Id,Node>
public IdTree<Id> descendantIdTree(Id id)
descendantIdTree
in interface IdTree<Id>
public int depth(Id id)
IdTree
public int maxDepth()
IdTree
public Id mostDeep(Set<Id> ids)
IdTree
Copyright © 2014. All rights reserved.