public static class Selector.ChildOrParentSelector extends java.lang.Object implements Selector
Represents a child selector or a parent selector.
In addition to the standard CSS notation for child selectors, JOSM also supports an "inverse" notation:
selector_a > selector_b { ... } // the standard notation (child selector) relation[type=route] > way { ... } // example (all ways of a route) selector_a < selector_b { ... } // the inverse notation (parent selector) node[traffic_calming] < way { ... } // example (way that has a traffic calming node)
Modifier and Type | Class and Description |
---|---|
private class |
Selector.ChildOrParentSelector.AbstractFinder |
private class |
Selector.ChildOrParentSelector.ContainsFinder |
private class |
Selector.ChildOrParentSelector.CrossingFinder |
private class |
Selector.ChildOrParentSelector.MatchingReferrerFinder
Finds the first referrer matching
left |
Selector.AbstractSelector, Selector.ChildOrParentSelector, Selector.ChildOrParentSelectorType, Selector.GeneralSelector, Selector.LinkSelector, Selector.OptimizedGeneralSelector
Modifier and Type | Field and Description |
---|---|
Selector |
left |
Selector.LinkSelector |
link |
Selector |
right |
Selector.ChildOrParentSelectorType |
type |
Constructor and Description |
---|
ChildOrParentSelector(Selector a,
Selector.LinkSelector link,
Selector b,
Selector.ChildOrParentSelectorType type) |
Modifier and Type | Method and Description |
---|---|
Range |
getRange() |
java.lang.String |
getSubpart() |
boolean |
matches(Environment e)
Apply the selector to the primitive and check if it matches.
|
Selector |
optimizedBaseCheck()
Create an "optimized" copy of this selector that omits the base check.
|
java.lang.String |
toString() |
public final Selector.LinkSelector link
public final Selector.ChildOrParentSelectorType type
public ChildOrParentSelector(Selector a, Selector.LinkSelector link, Selector b, Selector.ChildOrParentSelectorType type)
a
- the first selectorb
- the second selectortype
- the selector typepublic boolean matches(Environment e)
Selector
matches
in interface Selector
e
- the Environment. env.mc and env.layer are read-only when matching a selector.
env.source is not needed. This method will set the matchingReferrers field of env as
a side effect! Make sure to clear it before invoking this method.public java.lang.String getSubpart()
getSubpart
in interface Selector
public Selector optimizedBaseCheck()
Selector
optimizedBaseCheck
in interface Selector
public java.lang.String toString()
toString
in class java.lang.Object