Package com._1c.g5.v8.dt.common
Class EObjectTrie
- java.lang.Object
-
- com._1c.g5.v8.dt.common.EObjectTrie
-
- All Implemented Interfaces:
IEObjectTrie
public class EObjectTrie extends Object implements IEObjectTrie
The default implementation ofIEObjectTrie
that supports filtered view. The filtered view allows to use some subtree of the origin trie.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com._1c.g5.v8.dt.common.IEObjectTrie
IEObjectTrie.INode
-
-
Constructor Summary
Constructors Constructor Description EObjectTrie()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com._1c.g5.v8.dt.common.EObjectTrie.Node
addPath(org.eclipse.xtext.naming.QualifiedName qualifiedName)
Adds an empty node to the trie achievable by the given path.boolean
belongsTo(org.eclipse.xtext.naming.QualifiedName qualifiedName)
Checks whether the special path belongs to thisIEObjectTrie
.Collection<IEObjectTrie.INode>
getChildren(org.eclipse.xtext.naming.QualifiedName qualifiedName)
Gets the children of the trie node achievable by the given path.IEObjectTrie.INode
getNode(org.eclipse.xtext.naming.QualifiedName qualifiedName)
Gets the trie node associated with the given path.Comparator<IEObjectTrie.INode>
getNodeComparator()
Gets theIEObjectTrie.INode
comparator to sort child nodes in the trie.Set<String>
getRootOutgoingEdges()
Gets the root outgoing edges.boolean
hasChildren(org.eclipse.xtext.naming.QualifiedName qualifiedName)
Returnstrue
if the trie node achievable by the given path has children.void
markPath(org.eclipse.xtext.naming.QualifiedName qualifiedName)
Marks the given path.boolean
remove(org.eclipse.xtext.naming.QualifiedName qualifiedName)
Deletes the trie node associated with the given path.void
setEObject(org.eclipse.xtext.naming.QualifiedName qualifiedName, org.eclipse.emf.ecore.EObject eObject)
Sets the givenEObject
to the trie node achievable by the given path.void
setFilteredViewActive(boolean isFilteredViewActive)
Sets the 'isFilteredViewActive' flag.void
setNodeComparator(Comparator<IEObjectTrie.INode> nodeComparator)
Sets theIEObjectTrie.INode
comparator to sort child nodes in the trie.
-
-
-
Method Detail
-
getNode
public IEObjectTrie.INode getNode(org.eclipse.xtext.naming.QualifiedName qualifiedName)
Description copied from interface:IEObjectTrie
Gets the trie node associated with the given path.- Specified by:
getNode
in interfaceIEObjectTrie
- Parameters:
qualifiedName
- the given path, can not benull
- Returns:
- the node associated with the given path, may be
null
if no node achievable by the given path
-
getRootOutgoingEdges
public Set<String> getRootOutgoingEdges()
Description copied from interface:IEObjectTrie
Gets the root outgoing edges.- Specified by:
getRootOutgoingEdges
in interfaceIEObjectTrie
- Returns:
- the root outer edges, can not be
null
-
getChildren
public Collection<IEObjectTrie.INode> getChildren(org.eclipse.xtext.naming.QualifiedName qualifiedName)
Description copied from interface:IEObjectTrie
Gets the children of the trie node achievable by the given path.- Specified by:
getChildren
in interfaceIEObjectTrie
- Parameters:
qualifiedName
- the given path, can not benull
- Returns:
- the children of the trie node, can not be
null
-
hasChildren
public boolean hasChildren(org.eclipse.xtext.naming.QualifiedName qualifiedName)
Description copied from interface:IEObjectTrie
Returnstrue
if the trie node achievable by the given path has children.- Specified by:
hasChildren
in interfaceIEObjectTrie
- Parameters:
qualifiedName
- the given path, can not benull
- Returns:
true
if the trie node achievable by the given path has children.
-
belongsTo
public boolean belongsTo(org.eclipse.xtext.naming.QualifiedName qualifiedName)
Description copied from interface:IEObjectTrie
Checks whether the special path belongs to thisIEObjectTrie
.- Specified by:
belongsTo
in interfaceIEObjectTrie
- Parameters:
qualifiedName
- the special path, can not benull
- Returns:
true
if the special path belongs to thisIEObjectTrie
andfalse
otherwise
-
addPath
public com._1c.g5.v8.dt.common.EObjectTrie.Node addPath(org.eclipse.xtext.naming.QualifiedName qualifiedName)
Adds an empty node to the trie achievable by the given path. If this trie contained a node for the given path, the old value is not replaced by a new one.- Parameters:
qualifiedName
- the given path from the trie root to put node, can not benull
- Returns:
- the newly added child or the previous child node associated with the given path, can not be
null
-
setEObject
public void setEObject(org.eclipse.xtext.naming.QualifiedName qualifiedName, org.eclipse.emf.ecore.EObject eObject)
Sets the givenEObject
to the trie node achievable by the given path.- Parameters:
qualifiedName
- the given path, can not benull
eObject
- the givenEObject
, can not benull
-
setFilteredViewActive
public void setFilteredViewActive(boolean isFilteredViewActive)
Sets the 'isFilteredViewActive' flag.- Parameters:
isFilteredViewActive
-true
if the trie is in the filtered view andfalse
otherwise
-
markPath
public void markPath(org.eclipse.xtext.naming.QualifiedName qualifiedName)
Marks the given path. It used to select some subtree of the original trie and use only this subtree.- Parameters:
qualifiedName
- the given path, can not benull
-
remove
public boolean remove(org.eclipse.xtext.naming.QualifiedName qualifiedName)
Description copied from interface:IEObjectTrie
Deletes the trie node associated with the given path.- Specified by:
remove
in interfaceIEObjectTrie
- Parameters:
qualifiedName
- the given path, can not benull
- Returns:
true
if node associated with the given path was deleted,false
otherwise
-
getNodeComparator
public Comparator<IEObjectTrie.INode> getNodeComparator()
Gets theIEObjectTrie.INode
comparator to sort child nodes in the trie.- Returns:
- nodeComparator the current
IEObjectTrie.INode
comparator, can benull
-
setNodeComparator
public void setNodeComparator(Comparator<IEObjectTrie.INode> nodeComparator)
Sets theIEObjectTrie.INode
comparator to sort child nodes in the trie.- Parameters:
nodeComparator
- the givenIEObjectTrie.INode
comparator, cannot benull
-
-