public class Environment extends Object
Modifier and Type | Field and Description |
---|---|
OsmPrimitive |
child
The same for parent selector.
|
private Condition.Context |
context |
Integer |
count
count of nodes in parent way or members in parent relation.
|
static String |
DEFAULT_LAYER |
Integer |
index
index of node in parent way or member in parent relation.
|
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)
Creates a new environment.
|
Environment(OsmPrimitive osm,
MultiCascade mc,
String layer,
StyleSource source)
Creates a new environment.
|
Modifier and Type | Method and Description |
---|---|
void |
clearSelectorMatchingInformation() |
Cascade |
getCascade(String layer) |
Condition.Context |
getContext()
Replies the current context.
|
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,
int count)
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,
int count)
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,
int count)
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 StyleSource source
private Condition.Context context
public static final String DEFAULT_LAYER
public OsmPrimitive parent
Selector.LinkSelector
(within a child selector)public OsmPrimitive child
public Integer index
public Environment()
public Environment(OsmPrimitive osm)
osm
- OSM primitivepublic Environment(OsmPrimitive osm, MultiCascade mc, String layer, StyleSource source)
osm
- OSM primitivemc
- multi cascadelayer
- layersource
- style sourcepublic Environment(Environment other)
other
.other
- the other environment. Must not be null.IllegalArgumentException
- if param
is null
public Environment withPrimitive(OsmPrimitive osm)
osm
- OSM primitiveosm
public Environment withParent(OsmPrimitive parent)
parent
- the matching parent objectparent
public Environment withParentAndIndexAndLinkContext(OsmPrimitive parent, int index, int count)
Condition.Context.LINK
.parent
- the matching parent objectindex
- index of node in parent way or member in parent relationcount
- count of nodes in parent way or members in parent relationCondition.Context.LINK
parent
,
index
public Environment withChild(OsmPrimitive child)
child
- the matching child objectchild
public Environment withChildAndIndexAndLinkContext(OsmPrimitive child, int index, int count)
Condition.Context.LINK
.child
- the matching child objectindex
- index of node in parent way or member in parent relationcount
- count of nodes in parent way or members in parent relationContext#LINK
child
,
index
public Environment withIndex(int index, int count)
index
- index of node in parent way or member in parent relationcount
- count of nodes in parent way or members in parent relationindex
public Environment withContext(Condition.Context context)
Condition.Context
.context
- contextContext
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 void clearSelectorMatchingInformation()
public Cascade getCascade(String layer)