Class Filter<T>
java.lang.Object
megamek.common.pathfinder.filters.Filter<T>
- Direct Known Subclasses:
AeroGroundPathFinder.AeroGroundOffBoardFilter,MovePathGreedyFilter,MovePathLegalityFilter,MovePathLengthFilter,MovePathLengthFilter,MovePathRiskFilter
Represents a function that allows removing unwanted objects from a collection.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoFilter(Collection<T> collection) Returns filtered collection by removing those objects that failshouldStay(T)test.abstract booleanshouldStay(T object) Tests if the object should stay in the collection.
-
Constructor Details
-
Filter
public Filter()
-
-
Method Details
-
doFilter
Returns filtered collection by removing those objects that failshouldStay(T)test.- Parameters:
collection- collection to be filtered- Returns:
- filtered collection
-
shouldStay
Tests if the object should stay in the collection.- Parameters:
object- tested object- Returns:
- true if the object should stay in the collection
-