public class Environment extends Object
Modifier and Type | Field and Description |
---|---|
IPrimitive |
child
The same for parent selector.
|
Set<IPrimitive> |
children
Set of matched children filled by ContainsFinder and CrossingFinder, null if nothing matched
|
private Condition.Context |
context |
Integer |
count
count of nodes in parent way or members in parent relation.
|
Map<IPrimitive,Map<List<Way>,List<WaySegment>>> |
crossingWaysMap
Crossing ways result from CrossingFinder, filled for incomplete ways/relations
|
static String |
DEFAULT_LAYER
The name of the default layer.
|
Integer |
index
index of node in parent way or member in parent relation.
|
Map<IPrimitive,Area> |
intersections
Intersection areas (only filled with CrossingFinder if children is not null)
|
String |
layer
The current MapCSS layer
|
MultiCascade |
mc
The cascades that are currently evaluated
|
Map<IPrimitive,Area> |
mpAreaCache
Cache for multipolygon areas, can be null, used with CrossingFinder
|
IPrimitive |
osm
The primitive that is currently evaluated
|
IPrimitive |
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) |
private Selector |
selector
The selector that is currently being evaluated
|
StyleSource |
source
The style source that is evaluated
|
Set<IPrimitive> |
toMatchForSurrounding
Can be null, may contain primitives when surrounding objects of the primitives are tested
|
Modifier | Constructor and Description |
---|---|
|
Environment()
Creates a new uninitialized environment.
|
|
Environment(Environment other)
Creates a clone of the environment
other . |
private |
Environment(Environment other,
Selector selector)
Creates a clone of the environment
other . |
|
Environment(IPrimitive osm)
Creates a new environment.
|
|
Environment(IPrimitive osm,
MultiCascade mc,
String layer,
StyleSource source)
Creates a new environment.
|
Modifier and Type | Method and Description |
---|---|
Environment |
clearSelectorMatchingInformation()
Clears all matching context information
|
Cascade |
getCascade()
Gets the current cascade for the current layer of this environment
|
Cascade |
getCascade(String layer)
Gets the current cascade for a given layer
|
Condition.Context |
getContext()
Replies the current context.
|
String |
getRole()
Gets the role of the matching primitive in the relation
|
boolean |
hasParentRelation()
Determines if this environment has a relation as parent.
|
boolean |
isLinkContext()
Determines if the context of this environment is
Condition.Context.LINK . |
Selector |
selector()
Get the selector for this environment
|
Environment |
withChild(IPrimitive child)
Creates a clone of this environment, with the specified child.
|
Environment |
withChildAndIndexAndLinkContext(IPrimitive 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(IPrimitive parent)
Creates a clone of this environment, with the specified parent.
|
Environment |
withParentAndIndexAndLinkContext(IPrimitive 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(IPrimitive osm)
Creates a clone of this environment, with the specified primitive.
|
Environment |
withSelector(Selector selector)
Creates a clone of this environment, with the selector set
|
public IPrimitive osm
public MultiCascade mc
public StyleSource source
private Condition.Context context
public static final String DEFAULT_LAYER
public IPrimitive parent
Selector.LinkSelector
(within a child selector)public IPrimitive child
public Integer index
public Integer count
public Set<IPrimitive> children
public Map<IPrimitive,Map<List<Way>,List<WaySegment>>> crossingWaysMap
public Map<IPrimitive,Area> intersections
public Map<IPrimitive,Area> mpAreaCache
public Set<IPrimitive> toMatchForSurrounding
public Environment()
public Environment(IPrimitive osm)
osm
- OSM primitivepublic Environment(IPrimitive 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
private Environment(Environment other, Selector selector)
other
.other
- the other environment. Must not be null.selector
- the selector for this environment. May be null.IllegalArgumentException
- if param
is null
public Environment withPrimitive(IPrimitive osm)
osm
- OSM primitiveosm
public Environment withParent(IPrimitive parent)
parent
- the matching parent objectparent
public Environment withParentAndIndexAndLinkContext(IPrimitive 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(IPrimitive child)
child
- the matching child objectchild
public Environment withChildAndIndexAndLinkContext(IPrimitive 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 Environment withSelector(Selector selector)
selector
- The selector to usepublic 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 String getRole()
public Selector selector()
null
.public Environment clearSelectorMatchingInformation()
public Cascade getCascade()
public Cascade getCascade(String layer)
layer
- The layer to use, null
to use the layer of the Environment