SafespotQuery
Query builder for solved safespot plans.
ClassRLPlugins API
public class SafespotQuery extends AbstractQuery<Safespot, SafespotQuery>Members
Constructors
- newSafespotQuery(List<Safespot>)
Creates a SafespotQuery.
Methods
- SafespotQuery
- Safespotnearest()
Nearest.
- SafespotQueryreachable()
Reachable.
- SafespotQueryrequiresNoKiting()
Requires no kiting.
- SafespotQuerysortHighestScore()
Sort highest score.
- SafespotQuerysortNearest()
Sort nearest.
- SafespotQuerysortNearest(WorldPoint)
Sort nearest.
- SafespotQuerysortShortestPath()
Sort shortest path.
- SafespotQuerystable()
Stable.
- SafespotQuerywithin(WorldPoint, int)
Within.
- SafespotQuerywithoutSetupDanger()
Without setup danger.
Inherited from AbstractQuery
- Raggregate(Function<Stream<Safespot>, R>)
Generic aggregation method for custom terminal operations Executes filters and allows custom stream processing.
- booleanall(Predicate<Safespot>)
Check if all filtered results match the predicate.
- booleanany(Predicate<Safespot>)
Check if any filtered result matches the predicate.
- List<Safespot>collect()
Get the filtered/sorted list.
- Rcollect(Collector<Safespot, ?, R>)
Execute filters and process with custom collector.
- intcount()
Get count of filtered results.
- SafespotQuerydistinct()
Ensure results are distinct.
- Safespotfirst()
Get the first element from the filtered/sorted list.
- voidfirstIfPresent(Consumer<Safespot>)
First if present.
- voidfirstOrElse(Consumer<Safespot>, Runnable)
Perform action on the first element, or else run elseAction if no results.
- voidforEach(Consumer<Safespot>)
Executes filters and performs an action on each result.
- booleanisEmpty()
Check if there are no filtered results.
- SafespotQuerykeepIf(Predicate<Safespot>)
Lazily filter by predicate (keeps matching items).
- Safespotlast()
Get the last element from the filtered/sorted list.
- voidlastOrElse(Consumer<Safespot>, Runnable)
Perform action on the last element, or else run elseAction if no results.
- SafespotQuerylimit(int)
Limit the number of results.
- booleannone(Predicate<Safespot>)
Check if no filtered results match the predicate.
- SafespotQuerypeek(Consumer<Safespot>)
Peek at each element during processing.
- SafespotQuerypostProcess(Function<List<Safespot>, List<Safespot>>)
Apply a post-processing function after sorting.
- Safespotrandom()
Get a random element from the filtered/sorted list.
- SafespotQueryremoveIf(Predicate<Safespot>)
Lazily filter by predicate (removes matching items).
- SafespotQueryskip(int)
Skip a number of results.
- SafespotQuerysort(Comparator<Safespot>)
Lazily add sorting.
SafespotQuery(List<Safespot>)
public SafespotQuery(List<Safespot> safespots)Creates a SafespotQuery.
Parameters
safespots- Safespots.
in(WorldArea)
public SafespotQuery in(WorldArea area)In.
Parameters
area- Area.
nearest()
public Safespot nearest()Nearest.
reachable()
public SafespotQuery reachable()Reachable.
requiresNoKiting()
public SafespotQuery requiresNoKiting()Requires no kiting.
sortHighestScore()
public SafespotQuery sortHighestScore()Sort highest score.
sortNearest()
public SafespotQuery sortNearest()Sort nearest.
sortNearest(WorldPoint)
public SafespotQuery sortNearest(WorldPoint source)Sort nearest.
Parameters
source- Source.
sortShortestPath()
public SafespotQuery sortShortestPath()Sort shortest path.
stable()
public SafespotQuery stable()Stable.
within(WorldPoint, int)
public SafespotQuery within(WorldPoint center, int distance)Within.
Parameters
center- Center.
distance- Distance.
withoutSetupDanger()
public SafespotQuery withoutSetupDanger()Without setup danger.
aggregate(Function<Stream<Safespot>, R>)from AbstractQuery
public R aggregate(Function<Stream<Safespot>, R> aggregator)Generic aggregation method for custom terminal operations Executes filters and allows custom stream processing.
Parameters
aggregator- Aggregator.
all(Predicate<Safespot>)from AbstractQuery
public boolean all(Predicate<Safespot> predicate)Check if all filtered results match the predicate.
Parameters
predicate- Predicate to test.
Returns
True if all match, false otherwise.
any(Predicate<Safespot>)from AbstractQuery
public boolean any(Predicate<Safespot> predicate)Check if any filtered result matches the predicate.
Parameters
predicate- Predicate to test.
Returns
True if any match, false otherwise.
collect()from AbstractQuery
public List<Safespot> collect()Get the filtered/sorted list.
collect(Collector<Safespot, ?, R>)from AbstractQuery
public R collect(Collector<Safespot, ?, R> collector)Execute filters and process with custom collector.
Parameters
collector- Collector.
count()from AbstractQuery
public int count()Get count of filtered results.
distinct()from AbstractQuery
public SafespotQuery distinct()Ensure results are distinct.
Returns
The query instance.
first()from AbstractQuery
public Safespot first()Get the first element from the filtered/sorted list.
firstIfPresent(Consumer<Safespot>)from AbstractQuery
public void firstIfPresent(Consumer<Safespot> action)First if present.
Parameters
action- Action.
firstOrElse(Consumer<Safespot>, Runnable)from AbstractQuery
public void firstOrElse(Consumer<Safespot> action, Runnable elseAction)Perform action on the first element, or else run elseAction if no results.
Parameters
action- Action to perform on the first element.
elseAction- Action to perform if no results.
forEach(Consumer<Safespot>)from AbstractQuery
public void forEach(Consumer<Safespot> action)Executes filters and performs an action on each result.
Parameters
action- Action.
isEmpty()from AbstractQuery
public boolean isEmpty()Check if there are no filtered results.
Returns
True if no results after filtering, false otherwise.
keepIf(Predicate<Safespot>)from AbstractQuery
public SafespotQuery keepIf(Predicate<Safespot> predicate)Lazily filter by predicate (keeps matching items).
Parameters
predicate- Predicate.
Returns
The query instance.
last()from AbstractQuery
public Safespot last()Get the last element from the filtered/sorted list.
lastOrElse(Consumer<Safespot>, Runnable)from AbstractQuery
public void lastOrElse(Consumer<Safespot> action, Runnable elseAction)Perform action on the last element, or else run elseAction if no results.
Parameters
action- Action to perform on the last element.
elseAction- Action to perform if no results.
limit(int)from AbstractQuery
public SafespotQuery limit(int maxSize)Limit the number of results.
Parameters
maxSize- Max size.
Returns
The query instance.
none(Predicate<Safespot>)from AbstractQuery
public boolean none(Predicate<Safespot> predicate)Check if no filtered results match the predicate.
Parameters
predicate- Predicate to test.
Returns
True if none match, false otherwise.
peek(Consumer<Safespot>)from AbstractQuery
public SafespotQuery peek(Consumer<Safespot> action)Peek at each element during processing.
Parameters
action- Action to perform on each element.
Returns
The query instance.
postProcess(Function<List<Safespot>, List<Safespot>>)from AbstractQuery
public SafespotQuery postProcess(Function<List<Safespot>, List<Safespot>> processor)Apply a post-processing function after sorting.
Useful for reordering algorithms that can't be expressed as Comparators.
Parameters
processor- Function to transform the result list.
Returns
The query instance.
random()from AbstractQuery
public Safespot random()Get a random element from the filtered/sorted list.
removeIf(Predicate<Safespot>)from AbstractQuery
public SafespotQuery removeIf(Predicate<Safespot> predicate)Lazily filter by predicate (removes matching items).
Parameters
predicate- Predicate.
Returns
The query instance.
skip(int)from AbstractQuery
public SafespotQuery skip(int count)Skip a number of results.
Parameters
count- Count.
Returns
The query instance.
sort(Comparator<Safespot>)from AbstractQuery
public SafespotQuery sort(Comparator<Safespot> comparator)Lazily add sorting.
Parameters
comparator- Comparator.
Returns
The query instance.
Also allowed
Every class has these, as in plain Java.
equals, toString