public interface IdGraph<Id>
Modifier and Type | Method and Description |
---|---|
IdGraph<Id> |
ancestorIdGraph(Id id,
boolean inclusive)
Getting an id's ancestor id graph (its, parents' parents, and so on).
|
IdGraph<Id> |
ancestorIdGraph(Set<Id> ids,
boolean inclusive)
Getting an id set's ancestor id graph (their parents, parents' parents, and so on).
|
Iterable<Id> |
ancestorIdIterable(Id id,
boolean inclusive)
Getting an id's ancestor id iterable (its parents, parents' parents, and so on).
|
Iterable<Id> |
ancestorIdIterable(Set<Id> ids,
boolean inclusive)
Getting an id set's ancestor id iterable (their parents, parents' parents, and so on).
|
com.google.common.collect.ImmutableSet<Id> |
ancestorIdSet(Id id,
boolean inclusive)
Getting an id's ancestor id set (its parents, parents' parents, and so on).
|
com.google.common.collect.ImmutableSet<Id> |
ancestorIdSet(Set<Id> ids,
boolean inclusive)
Getting an id set's ancestor id set (their parents, parents' parents, and so on).
|
void |
assertIdsEqual(Id[] ids)
Assert that a graph contains exactly these ids.
|
void |
assertIdsEqual(com.google.common.collect.ImmutableSet<Id> ids)
Assert that a graph contains exactly these ids.
|
com.google.common.collect.ImmutableSet<Id> |
childIdSet(Id id)
Getting an id's child ids.
|
boolean |
containsCycle()
Whether the digraph contains a cycle.
|
IdGraph<Id> |
descendantIdGraph(Id id,
boolean inclusive)
Getting an id's descendant id graph (its children, childrens' children, and so on).
|
IdGraph<Id> |
descendantIdGraph(Set<Id> ids,
boolean inclusive)
Getting an id set's descendant id graph (their children, childrens' children, and so on).
|
Iterable<Id> |
descendantIdIterable(Id id,
boolean inclusive)
Getting an id's descendant id iterable (its children, childrens' children, and so on).
|
Iterable<Id> |
descendantIdIterable(Set<Id> ids,
boolean inclusive)
Getting an id set's descendant id iterable (their children, childrens' children, and so on).
|
com.google.common.collect.ImmutableSet<Id> |
descendantIdSet(Id id,
boolean inclusive)
Getting an id's descendant id set (its children, childrens' children, and so on).
|
com.google.common.collect.ImmutableSet<Id> |
descendantIdSet(Set<Id> ids,
boolean inclusive)
Getting an id set's descendant id set (their children, childrens' children, and so on).
|
IdGraph<Id> |
filterIdGraph(Set<Id> ids)
Filter a graph by only keep the specified ids and arcs between these ids.
|
com.google.common.collect.ImmutableSetMultimap<Id,Id> |
id__childIds()
The mapping from id to child ids.
|
com.google.common.collect.ImmutableSetMultimap<Id,Id> |
id__parentIds()
The mapping from id to parent ids.
|
com.google.common.collect.ImmutableSet<Id> |
idSet()
The set of ids.
|
int |
idSize()
The number of ids.
|
boolean |
isAncestorOf(Id id,
Id potentialDescendant,
boolean inclusive)
Whether an id is a ancestor of another id.
|
boolean |
isChildOf(Id id,
Id potentialParent)
Whether an id is a child of another id.
|
boolean |
isDescendantOf(Id id,
Id potentialAncestor,
boolean inclusive)
Whether an id is a descendant of another id.
|
boolean |
isLeaf(Id id)
Is an id a leaf?
|
boolean |
isParentOf(Id id,
Id potentialChild)
Whether an id is a parent of another id.
|
boolean |
isRoot(Id id)
Is an id a root?
|
com.google.common.collect.ImmutableSet<Id> |
leafIdSet()
The digraph's leaf (sink) ids, so the ids without children.
|
com.google.common.base.Optional<com.google.common.collect.ImmutableList<Id>> |
optionalTopsortIdList()
A topologically sorted list of ids, with roots (sources) first (will be absent if the digraph
is cyclic).
|
com.google.common.collect.ImmutableSet<Id> |
parentIdSet(Id id)
Getting an id's parent ids.
|
com.google.common.collect.ImmutableSet<Id> |
rootIdSet()
The digraph's root (source) ids, so the ids without parents.
|
Iterable<Id> |
traverseIdIterable(boolean depthFirst,
boolean inclusive,
Id startId,
LambdaLib.Fn1<Id,List<Id>> expand)
Generic id traversal as an iterable.
|
Iterable<Id> |
traverseIdIterable(boolean depthFirst,
boolean inclusive,
com.google.common.collect.ImmutableList<Id> startIds,
LambdaLib.Fn1<Id,List<Id>> expand)
Generic id traversal as an iterable.
|
com.google.common.collect.ImmutableList<Id> |
traverseIdList(boolean depthFirst,
boolean inclusive,
Id startId,
LambdaLib.Fn1<Id,List<Id>> expand)
Generic id traversal copied into a list.
|
com.google.common.collect.ImmutableList<Id> |
traverseIdList(boolean depthFirst,
boolean inclusive,
com.google.common.collect.ImmutableList<Id> startIds,
LambdaLib.Fn1<Id,List<Id>> expand)
Generic id traversal copied into a list.
|
com.google.common.collect.ImmutableSet<Id> idSet()
int idSize()
void assertIdsEqual(com.google.common.collect.ImmutableSet<Id> ids)
void assertIdsEqual(Id[] ids)
IdGraph<Id> filterIdGraph(Set<Id> ids)
com.google.common.collect.ImmutableSetMultimap<Id,Id> id__parentIds()
com.google.common.collect.ImmutableSet<Id> parentIdSet(Id id)
com.google.common.collect.ImmutableSetMultimap<Id,Id> id__childIds()
boolean isAncestorOf(Id id, Id potentialDescendant, boolean inclusive)
Iterable<Id> ancestorIdIterable(Id id, boolean inclusive)
Iterable<Id> ancestorIdIterable(Set<Id> ids, boolean inclusive)
com.google.common.collect.ImmutableSet<Id> ancestorIdSet(Id id, boolean inclusive)
com.google.common.collect.ImmutableSet<Id> ancestorIdSet(Set<Id> ids, boolean inclusive)
IdGraph<Id> ancestorIdGraph(Id id, boolean inclusive)
IdGraph<Id> ancestorIdGraph(Set<Id> ids, boolean inclusive)
boolean isDescendantOf(Id id, Id potentialAncestor, boolean inclusive)
Iterable<Id> descendantIdIterable(Id id, boolean inclusive)
Iterable<Id> descendantIdIterable(Set<Id> ids, boolean inclusive)
com.google.common.collect.ImmutableSet<Id> descendantIdSet(Id id, boolean inclusive)
com.google.common.collect.ImmutableSet<Id> descendantIdSet(Set<Id> ids, boolean inclusive)
IdGraph<Id> descendantIdGraph(Id id, boolean inclusive)
IdGraph<Id> descendantIdGraph(Set<Id> ids, boolean inclusive)
boolean isRoot(Id id)
com.google.common.collect.ImmutableSet<Id> rootIdSet()
boolean isLeaf(Id id)
com.google.common.collect.ImmutableSet<Id> leafIdSet()
boolean containsCycle()
com.google.common.base.Optional<com.google.common.collect.ImmutableList<Id>> optionalTopsortIdList()
Iterable<Id> traverseIdIterable(boolean depthFirst, boolean inclusive, Id startId, LambdaLib.Fn1<Id,List<Id>> expand)
depthFirst
- Whether to traverse depth first or breadth first.inclusive
- Whether to include the start ids in the traversal.startId
- The initial id.expand
- A function mapping an id to the next ids.Iterable<Id> traverseIdIterable(boolean depthFirst, boolean inclusive, com.google.common.collect.ImmutableList<Id> startIds, LambdaLib.Fn1<Id,List<Id>> expand)
depthFirst
- Whether to traverse depth first or breadth first.inclusive
- Whether to include the start ids in the traversal.startIds
- The initial id list.expand
- A function mapping an id to the next ids.com.google.common.collect.ImmutableList<Id> traverseIdList(boolean depthFirst, boolean inclusive, Id startId, LambdaLib.Fn1<Id,List<Id>> expand)
depthFirst
- Whether to traverse depth first or breadth first.inclusive
- Whether to include the start ids in the traversal.startIds
- The initial id.expand
- A function mapping an id to the next ids.com.google.common.collect.ImmutableList<Id> traverseIdList(boolean depthFirst, boolean inclusive, com.google.common.collect.ImmutableList<Id> startIds, LambdaLib.Fn1<Id,List<Id>> expand)
depthFirst
- Whether to traverse depth first or breadth first.inclusive
- Whether to include the start ids in the traversal.startIds
- The initial id list.expand
- A function mapping an id to the next ids.Copyright © 2014. All rights reserved.