org.openstreetmap.josm.gui.mappaint.mapcss
Class Selector.ChildOrParentSelector
java.lang.Object
org.openstreetmap.josm.gui.mappaint.mapcss.Selector.ChildOrParentSelector
- All Implemented Interfaces:
- Selector
- Enclosing interface:
- Selector
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)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
left
private final Selector left
link
private final Selector.LinkSelector link
right
private final Selector right
parentSelector
private final boolean parentSelector
- true, if this represents a parent selector (otherwise it is a child selector)
Selector.ChildOrParentSelector
public Selector.ChildOrParentSelector(Selector a,
Selector.LinkSelector link,
Selector b,
boolean parentSelector)
- Parameters:
a
- the first selectorb
- the second selectorparentSelector
- if true, this is a parent selector; otherwise a child selector
matches
public boolean matches(Environment e)
- Description copied from interface:
Selector
- Apply the selector to the primitive and check if it matches.
- Specified by:
matches
in interface Selector
- Parameters:
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.
- Returns:
- true, if the selector applies
getSubpart
public java.lang.String getSubpart()
- Specified by:
getSubpart
in interface Selector
getRange
public Range getRange()
- Specified by:
getRange
in interface Selector
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
JOSM