public class Environment extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
OsmPrimitive |
child
The same for parent selector.
|
private Condition.Context |
context |
static java.lang.String |
DEFAULT_LAYER |
java.lang.Integer |
index
index of node in parent way or member in parent relation.
|
java.lang.String |
layer |
MultiCascade |
mc |
OsmPrimitive |
osm |
OsmPrimitive |
parent
If not null, this is the matching parent object if a condition or an expression
is evaluated in a
Selector.LinkSelector (within a child selector) |
StyleSource |
source |
Constructor and Description |
---|
Environment()
Creates a new uninitialized environment.
|
Environment(Environment other)
Creates a clone of the environment
other . |
Environment(OsmPrimitive osm,
MultiCascade mc,
java.lang.String layer,
StyleSource source)
Creates a new environment.
|
Modifier and Type | Method and Description |
---|---|
void |
clearSelectorMatchingInformation() |
Cascade |
getCascade(java.lang.String layer) |
Condition.Context |
getContext()
Replies the current context.
|
java.lang.String |
getRole() |
boolean |
hasParentRelation()
Determines if this environment has a relation as parent.
|
boolean |
isLinkContext()
Determines if the context of this environment is
Condition.Context.LINK . |
Environment |
withChild(OsmPrimitive child)
Creates a clone of this environment, with the specified child.
|
Environment |
withChildAndIndexAndLinkContext(OsmPrimitive child,
int index)
Creates a clone of this environment, with the specified child, index, and context set to
Condition.Context.LINK . |
Environment |
withContext(Condition.Context context)
Creates a clone of this environment, with the specified
Condition.Context . |
Environment |
withIndex(int index)
Creates a clone of this environment, with the specified index.
|
Environment |
withLinkContext()
Creates a clone of this environment, with context set to
Condition.Context.LINK . |
Environment |
withParent(OsmPrimitive parent)
Creates a clone of this environment, with the specified parent.
|
Environment |
withParentAndIndexAndLinkContext(OsmPrimitive parent,
int index)
Creates a clone of this environment, with the specified parent, index, and context set to
Condition.Context.LINK . |
Environment |
withPrimitive(OsmPrimitive osm)
Creates a clone of this environment, with the specified primitive.
|
public OsmPrimitive osm
public MultiCascade mc
public java.lang.String layer
public StyleSource source
private Condition.Context context
public static final java.lang.String DEFAULT_LAYER
public OsmPrimitive parent
Selector.LinkSelector
(within a child selector)public OsmPrimitive child
public java.lang.Integer index
public Environment()
public Environment(OsmPrimitive osm, MultiCascade mc, java.lang.String layer, StyleSource source)
public Environment(Environment other) throws java.lang.IllegalArgumentException
other
.other
- the other environment. Must not be null.java.lang.IllegalArgumentException
- if param
is null
public Environment withPrimitive(OsmPrimitive osm)
osm
public Environment withParent(OsmPrimitive parent)
parent
- the matching parent objectparent
public Environment withParentAndIndexAndLinkContext(OsmPrimitive parent, int index)
Condition.Context.LINK
.parent
- the matching parent objectindex
- index of node in parent way or member in parent relationCondition.Context.LINK
parent
,
index
public Environment withChild(OsmPrimitive child)
child
- the matching child objectchild
public Environment withChildAndIndexAndLinkContext(OsmPrimitive child, int index)
Condition.Context.LINK
.public Environment withIndex(int index)
index
- index of node in parent way or member in parent relationindex
public Environment withContext(Condition.Context context)
Condition.Context
.Context
public Environment withLinkContext()
Condition.Context.LINK
.Context#LINK
public boolean isLinkContext()
Condition.Context.LINK
.true
if the context of this environment is Context#LINK
, false
otherwisepublic boolean hasParentRelation()
true
if this environment has a relation as parent, false
otherwiseparent
public Condition.Context getContext()
public java.lang.String getRole()
public void clearSelectorMatchingInformation()
public Cascade getCascade(java.lang.String layer)