Class SearchCompiler.Match
- java.lang.Object
-
- org.openstreetmap.josm.data.osm.search.SearchCompiler.Match
-
- All Implemented Interfaces:
java.util.function.Predicate<OsmPrimitive>
- Direct Known Subclasses:
AutoFilterManager.Match
,ContextSwitchTemplate.ContextProvider
,SearchCompiler.AbstractBinaryMatch
,SearchCompiler.Closed
,SearchCompiler.Deleted
,SearchCompiler.ExactType
,SearchCompiler.HasRole
,SearchCompiler.InArea
,SearchCompiler.Incomplete
,SearchCompiler.MapCSSMatch
,SearchCompiler.Modified
,SearchCompiler.New
,SearchCompiler.Nth
,SearchCompiler.Preset
,SearchCompiler.RangeMatch
,SearchCompiler.RoleMatch
,SearchCompiler.Selected
,SearchCompiler.TaggedMatch
,SearchCompiler.UnaryMatch
,SearchCompiler.Untagged
,SearchCompiler.UserMatch
- Enclosing class:
- SearchCompiler
public abstract static class SearchCompiler.Match extends java.lang.Object implements java.util.function.Predicate<OsmPrimitive>
Base class for all search criteria. If the criterion only depends on an object's tags, inherit fromSearchCompiler.TaggedMatch
.
-
-
Constructor Summary
Constructors Constructor Description Match()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract boolean
match(OsmPrimitive osm)
Tests whether the primitive matches this criterion.boolean
match(Tagged tagged)
Tests whether the tagged object matches this criterion.boolean
test(OsmPrimitive object)
SearchCompiler.Match
validate()
Check if this is a valid match object
-
-
-
Constructor Detail
-
Match
public Match()
-
-
Method Detail
-
match
public abstract boolean match(OsmPrimitive osm)
Tests whether the primitive matches this criterion.- Parameters:
osm
- the primitive to test- Returns:
- true if the primitive matches this criterion
-
match
public boolean match(Tagged tagged)
Tests whether the tagged object matches this criterion.- Parameters:
tagged
- the tagged object to test- Returns:
- true if the tagged object matches this criterion
-
test
public final boolean test(OsmPrimitive object)
- Specified by:
test
in interfacejava.util.function.Predicate<OsmPrimitive>
-
validate
public SearchCompiler.Match validate() throws SearchParseError
Check if this is a valid match object- Returns:
this
, for easy chaining- Throws:
SearchParseError
- If the match is not valid
-
-