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:
java.util.function.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.Matchlhsprotected SearchCompiler.Matchrhs
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractBinaryMatch(SearchCompiler.Match lhs, SearchCompiler.Match rhs)Constructs a newBinaryMatch.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)SearchCompiler.MatchgetLhs()Returns left hand side.SearchCompiler.MatchgetRhs()Returns right hand side.inthashCode()<T,U>
Umap(java.util.function.Function<SearchCompiler.Match,T> mapper, java.util.function.BiFunction<T,T,U> operator)First appliesmapperto both sides and then appliesoperatoron the two results.protected static java.lang.Stringparenthesis(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(java.util.function.Function<SearchCompiler.Match,T> mapper, java.util.function.BiFunction<T,T,U> operator)
First appliesmapperto both sides and then appliesoperatoron 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 java.lang.String parenthesis(SearchCompiler.Match m)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-