public class IdTreeClass<Id> extends IdDagClass<Id> implements IdTree<Id>
Constructor and Description |
---|
IdTreeClass(com.google.common.collect.ImmutableSet<Id> idSet,
com.google.common.collect.ImmutableSetMultimap<Id,Id> id__parentIds) |
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.
|
int |
depth(Id id)
Getting the size of an id's ancestor list.
|
IdTree<Id> |
descendantIdTree(Id id) |
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.
|
Id |
rootId()
The tree's root id.
|
breadthIdIterable, breadthIdList, depthIdIterable, depthIdList, descendantIdGraph, descendantIdGraph, filterIdGraph, topsortIdList
ancestorIdIterable, ancestorIdIterable, ancestorIdSet, ancestorIdSet, assertIdsEqual, assertIdsEqual, childIdListLambda, childIdSet, containsCycle, descendantIdIterable, descendantIdIterable, descendantIdSet, descendantIdSet, fields, filterParentMap, id__childIds, id__parentIds, idSet, idSize, isAncestorOf, isChildOf, isDescendantOf, isLeaf, isParentOf, isRoot, leafIdSet, optionalTopsortIdList, parentIdListLambda, parentIdSet, rootIdSet, traverseIdIterable, traverseIdIterable, traverseIdList, traverseIdList
equals, hashCode, isEntity
array, objectHelper, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
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 com.google.common.base.Optional<Id> parentId(Id id)
IdTree
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 IdDagClass<Id>
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 IdDagClass<Id>
public com.google.common.collect.ImmutableList<Id> ancestorIdList(Id id, boolean inclusive)
IdTree
ancestorIdList
in interface IdTree<Id>
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.