private class Selector.ChildOrParentSelector.MatchingReferrerFinder extends java.lang.Object implements PrimitiveVisitor
Finds the first referrer matching Selector.ChildOrParentSelector.left
The visitor works on an environment and it saves the matching
referrer in e.parent
and its relative position in the
list referrers "child list" in e.index
.
If after execution e.parent
is null, no matching
referrer was found.
Modifier and Type | Field and Description |
---|---|
private Environment |
e |
Constructor and Description |
---|
MatchingReferrerFinder(Environment e)
Constructor
|
Modifier and Type | Method and Description |
---|---|
private <T extends IPrimitive> |
doVisit(T parent,
java.util.function.IntSupplier counter,
java.util.function.IntFunction<IPrimitive> getter) |
void |
visit(INode n)
Visiting call for nodes.
|
void |
visit(IRelation<?> r)
Visiting call for relations.
|
void |
visit(IWay<?> w)
Visiting call for ways.
|
private final Environment e
MatchingReferrerFinder(Environment e)
e
- the environment against which we matchpublic void visit(INode n)
PrimitiveVisitor
visit
in interface PrimitiveVisitor
n
- The node to inspect.private <T extends IPrimitive> void doVisit(T parent, java.util.function.IntSupplier counter, java.util.function.IntFunction<IPrimitive> getter)
public void visit(IWay<?> w)
PrimitiveVisitor
visit
in interface PrimitiveVisitor
w
- The way to inspect.public void visit(IRelation<?> r)
PrimitiveVisitor
visit
in interface PrimitiveVisitor
r
- The relation to inspect.