Class SearchCompiler.AbstractBinaryMatch
- java.lang.Object
-
- org.openstreetmap.josm.data.osm.search.SearchCompiler.Match
-
- org.openstreetmap.josm.data.osm.search.SearchCompiler.AbstractBinaryMatch
-
- All Implemented Interfaces:
Predicate<OsmPrimitive>
- Direct Known Subclasses:
SearchCompiler.And
,SearchCompiler.Or
,SearchCompiler.Xor
- Enclosing class:
- SearchCompiler
public abstract static class SearchCompiler.AbstractBinaryMatch extends SearchCompiler.Match
A binary search operator which may take data parameters.
-
-
Field Summary
Fields Modifier and Type Field Description protected SearchCompiler.Match
lhs
protected SearchCompiler.Match
rhs
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractBinaryMatch(SearchCompiler.Match lhs, SearchCompiler.Match rhs)
Constructs a newBinaryMatch
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
SearchCompiler.Match
getLhs()
Returns left hand side.SearchCompiler.Match
getRhs()
Returns right hand side.int
hashCode()
<T,U>
Umap(Function<SearchCompiler.Match,T> mapper, BiFunction<T,T,U> operator)
First appliesmapper
to both sides and then appliesoperator
on the two results.protected static String
parenthesis(SearchCompiler.Match m)
-
Methods inherited from class org.openstreetmap.josm.data.osm.search.SearchCompiler.Match
match, match, test, validate
-
-
-
-
Field Detail
-
lhs
protected final SearchCompiler.Match lhs
-
rhs
protected final SearchCompiler.Match rhs
-
-
Constructor Detail
-
AbstractBinaryMatch
protected AbstractBinaryMatch(SearchCompiler.Match lhs, SearchCompiler.Match rhs)
Constructs a newBinaryMatch
.- Parameters:
lhs
- Left hand siderhs
- Right hand side
-
-
Method Detail
-
getLhs
public final SearchCompiler.Match getLhs()
Returns left hand side.- Returns:
- left hand side
-
getRhs
public final SearchCompiler.Match getRhs()
Returns right hand side.- Returns:
- right hand side
-
map
public <T,U> U map(Function<SearchCompiler.Match,T> mapper, BiFunction<T,T,U> operator)
First appliesmapper
to both sides and then appliesoperator
on the two results.- Type Parameters:
T
- the type of the intermediate resultU
- the type of the result- Parameters:
mapper
- the mapping functionoperator
- the operator- Returns:
operator.apply(mapper.apply(lhs), mapper.apply(rhs))
-
parenthesis
protected static String parenthesis(SearchCompiler.Match m)
-
-