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 static class |
Selector.ChildOrParentSelector.AbstractFinder |
private class |
Selector.ChildOrParentSelector.ContainsFinder
Finds elements which are inside the right element, collects those in
children |
private class |
Selector.ChildOrParentSelector.CrossingFinder |
private class |
Selector.ChildOrParentSelector.InsideOrEqualFinder
Finds elements which are inside the left element, or in other words, it finds elements enclosing e.osm.
|
private class |
Selector.ChildOrParentSelector.MatchingReferrerFinder
Finds the first referrer matching
left |
private class |
Selector.ChildOrParentSelector.MultipolygonOpenEndFinder |
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 |
BASE_ANY, BASE_AREA, BASE_CANVAS, BASE_META, BASE_NODE, BASE_RELATION, BASE_SETTING, BASE_SETTINGS, BASE_WAY| Constructor and Description |
|---|
ChildOrParentSelector(Selector a,
Selector.LinkSelector link,
Selector b,
Selector.ChildOrParentSelectorType type)
Constructs a new
ChildOrParentSelector. |
| Modifier and Type | Method and Description |
|---|---|
Range |
getRange()
Returns the scale range, an interval of the form "lower < x <= upper" where 0 <= lower < upper.
|
Subpart |
getSubpart()
Returns the subpart, if supported.
|
private static boolean |
isArea(IPrimitive p) |
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() |
private void |
visitBBox(Environment e,
Selector.ChildOrParentSelector.AbstractFinder finder) |
public final Selector.LinkSelector link
public final Selector.ChildOrParentSelectorType type
public ChildOrParentSelector(Selector a, Selector.LinkSelector link, Selector b, Selector.ChildOrParentSelectorType type)
ChildOrParentSelector.a - the first selectorlink - linkb - the second selectortype - the selector typeprivate void visitBBox(Environment e, Selector.ChildOrParentSelector.AbstractFinder finder)
private static boolean isArea(IPrimitive p)
public boolean matches(Environment e)
Selectormatches in interface Selectore - 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 Subpart getSubpart()
Selector::subpart syntax).getSubpart in interface Selectorpublic Range getRange()
Selectorpublic Selector optimizedBaseCheck()
SelectoroptimizedBaseCheck in interface Selectorpublic java.lang.String toString()
toString in class java.lang.Object