Top Description Inners Fields Constructors Methods
org.antlr.v4.gui

public Class TreeLayoutAdaptor

extends Object
implements TreeForTreeLayout<Tree>
Class Inheritance
All Implemented Interfaces
org.abego.treelayout.TreeForTreeLayout
Imports
org.abego.treelayout.TreeForTreeLayout, org.antlr.v4.runtime.tree.Tree, java.util.Iterator, .NoSuchElementException

Adaptor ANTLR trees to TreeForTreeLayout.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

Modifier and TypeField and Description
private Tree

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Iterable<Tree>
getChildren(Tree
[!isLeaf(parentNode)]
node
)

Implements org.abego.treelayout.TreeForTreeLayout.getChildren.

Returns the children of a parent node.
public Iterable<Tree>
getChildrenReverse(Tree
[!isLeaf(parentNode)]
node
)

Implements org.abego.treelayout.TreeForTreeLayout.getChildrenReverse.

Returns the children of a parent node, in reverse order.
public Tree
getFirstChild(Tree
[!isLeaf(parentNode)]
parentNode
)

Implements org.abego.treelayout.TreeForTreeLayout.getFirstChild.

Returns the first child of a parent node.
public Tree
getLastChild(Tree
[!isLeaf(parentNode)]
parentNode
)

Implements org.abego.treelayout.TreeForTreeLayout.getLastChild.

Returns the last child of a parent node.
public Tree
getRoot()

Implements org.abego.treelayout.TreeForTreeLayout.getRoot.

Returns the the root of the tree.
public boolean
isChildOfParent(Tree
 
node
,
Tree
 
parentNode
)

Implements org.abego.treelayout.TreeForTreeLayout.isChildOfParent.

Tells if a node is a child of a given parentNode.
public boolean
isLeaf(Tree
 
node
)

Implements org.abego.treelayout.TreeForTreeLayout.isLeaf.

Tells if a node is a leaf in the tree.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

rootback to summary
private Tree root

Constructor Detail

TreeLayoutAdaptorback to summary
public TreeLayoutAdaptor(Tree root)

Method Detail

getChildrenback to summary
public Iterable<Tree> getChildren(Tree node)

Implements org.abego.treelayout.TreeForTreeLayout.getChildren.

Doc from org.abego.treelayout.TreeForTreeLayout.getChildren.

Returns the children of a parent node.

Time Complexity: O(1)

Parameters
node:Tree

[!isLeaf(parentNode)]

Returns:Iterable<Tree>

the children of the given parentNode, from first to last

Annotations
@Override
getChildrenReverseback to summary
public Iterable<Tree> getChildrenReverse(Tree node)

Implements org.abego.treelayout.TreeForTreeLayout.getChildrenReverse.

Doc from org.abego.treelayout.TreeForTreeLayout.getChildrenReverse.

Returns the children of a parent node, in reverse order.

Time Complexity: O(1)

Parameters
node:Tree

[!isLeaf(parentNode)]

Returns:Iterable<Tree>

the children of given parentNode, from last to first

Annotations
@Override
getFirstChildback to summary
public Tree getFirstChild(Tree parentNode)

Implements org.abego.treelayout.TreeForTreeLayout.getFirstChild.

Doc from org.abego.treelayout.TreeForTreeLayout.getFirstChild.

Returns the first child of a parent node.

Time Complexity: O(1)

Parameters
parentNode:Tree

[!isLeaf(parentNode)]

Returns:Tree

the first child of the parentNode

Annotations
@Override
getLastChildback to summary
public Tree getLastChild(Tree parentNode)

Implements org.abego.treelayout.TreeForTreeLayout.getLastChild.

Doc from org.abego.treelayout.TreeForTreeLayout.getLastChild.

Returns the last child of a parent node.

Time Complexity: O(1)

Parameters
parentNode:Tree

[!isLeaf(parentNode)]

Returns:Tree

the last child of the parentNode

Annotations
@Override
getRootback to summary
public Tree getRoot()

Implements org.abego.treelayout.TreeForTreeLayout.getRoot.

Doc from org.abego.treelayout.TreeForTreeLayout.getRoot.

Returns the the root of the tree.

Time Complexity: O(1)

Returns:Tree

the root of the tree

Annotations
@Override
isChildOfParentback to summary
public boolean isChildOfParent(Tree node, Tree parentNode)

Implements org.abego.treelayout.TreeForTreeLayout.isChildOfParent.

Doc from org.abego.treelayout.TreeForTreeLayout.isChildOfParent.

Tells if a node is a child of a given parentNode.

Time Complexity: O(1)

Parameters
node:Tree

 

parentNode:Tree

 

Returns:boolean

true iff the node is a child of the given parentNode

Annotations
@Override
isLeafback to summary
public boolean isLeaf(Tree node)

Implements org.abego.treelayout.TreeForTreeLayout.isLeaf.

Doc from org.abego.treelayout.TreeForTreeLayout.isLeaf.

Tells if a node is a leaf in the tree.

Time Complexity: O(1)

Parameters
node:Tree

 

Returns:boolean

true iff node is a leaf in the tree, i.e. has no children.

Annotations
@Override
org.antlr.v4.gui back to summary

private Class TreeLayoutAdaptor.AntlrTreeChildrenIterable

extends Object
implements Iterable<Tree>
Class Inheritance
All Implemented Interfaces
java.lang.Iterable

Field Summary

Modifier and TypeField and Description
private final Tree

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Iterator<Tree>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

treeback to summary
private final Tree tree

Constructor Detail

AntlrTreeChildrenIterableback to summary
public AntlrTreeChildrenIterable(Tree tree)

Method Detail

iteratorback to summary
public Iterator<Tree> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<Tree>

an Iterator.

Annotations
@Override
org.antlr.v4.gui back to summary

private Class TreeLayoutAdaptor.AntlrTreeChildrenReverseIterable

extends Object
implements Iterable<Tree>
Class Inheritance
  • java.lang.Object
  • org.antlr.v4.gui.TreeLayoutAdaptor.AntlrTreeChildrenReverseIterable
All Implemented Interfaces
java.lang.Iterable

Field Summary

Modifier and TypeField and Description
private final Tree

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Iterator<Tree>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

treeback to summary
private final Tree tree

Constructor Detail

AntlrTreeChildrenReverseIterableback to summary
public AntlrTreeChildrenReverseIterable(Tree tree)

Method Detail

iteratorback to summary
public Iterator<Tree> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<Tree>

an Iterator.

Annotations
@Override