TileItemQuery
A query builder for TileItemEx objects.
ClassRLPlugins API
public class TileItemQuery extends AbstractQuery<TileItemEx, TileItemQuery>Members
Constructors
- newTileItemQuery()
Creates a new TileItemQuery instance initialized with all tile items in the game.
Methods
- TileItemQueryatLocation(WorldPoint)
Filters to only items located at the specified world point.
- TileItemExfarthest()
Get the farthest item from the filtered list Terminal operation - executes the query.
- TileItemExfarthest(WorldPoint)
Get the farthest item from a specific point Terminal operation - executes the query.
- TileItemQuerygreaterThanGePrice(int)
Filters to only items with a Grand Exchange price greater than the specified value.
- TileItemQuerygreaterThanHighAlchValue(int)
Filters to only items with a high alchemy value greater than the specified value.
- TileItemQuerygreaterThanLowAlchValue(int)
Filters to only items with a low alchemy value greater than the specified value.
- TileItemQuerygreaterThanShopPrice(int)
Filters to only items with a shop price greater than the specified value.
- TileItemQuerylessThanGePrice(int)
Filters to only items with a Grand Exchange price less than the specified value.
- TileItemQuerylessThanHighAlchValue(int)
Filters to only items with a high alchemy value less than the specified value.
- TileItemQuerylessThanLowAlchValue(int)
Filters to only items with a low alchemy value less than the specified value.
- TileItemQuerylessThanShopPrice(int)
Filters to only items with a shop price less than the specified value.
- TileItemExlongestPath()
Get the item with the furthest path from the filtered list Terminal operation - executes the query.
- TileItemExnearest()
Get the nearest item from the filtered list Terminal operation - executes the query.
- TileItemExnearest(WorldPoint)
Get the nearest item to a specific point Terminal operation - executes the query.
- TileItemExshortestPath()
Get the item with the shortest path from the filtered list Terminal operation - executes the query.
- TileItemQuerysortFurthest()
Sorts the items by distance from the local player, furthest first.
- TileItemQuerysortFurthest(WorldPoint)
Sorts the items by distance from the specified world point, furthest first.
- TileItemQuerysortLongestPath()
Sort by furthest path from the player.
- TileItemQuerysortLongestPath(WorldPoint)
Sort by furthest path from a specific point.
- TileItemQuerysortNearest()
Sorts the items by distance from the local player, nearest first.
- TileItemQuerysortNearest(WorldPoint)
Sorts the items by distance from the specified world point, nearest first.
- TileItemQuerysortShortestPath()
Sort by shortest path from the player.
- TileItemQuerysortShortestPath(WorldPoint)
Sort by shortest path from a specific point.
- TileItemQuerywithCanonicalId(int...)
Filters the query to include only items with the specified canonical IDs.
- TileItemQuerywithId(int...)
Filters the query to include only items with the specified IDs.
- TileItemQuerywithin(int)
Filters to only items within the specified distance from the local player.
- TileItemQuerywithin(WorldPoint, int)
Filters to only items within the specified distance from the given world point.
- TileItemQuerywithName(String)
Filters the query to include only items with the specified name.
- TileItemQuerywithNameContains(String)
Filters to only items whose names contain the specified substring, ignoring case.
- TileItemQuerywithNameMatches(String)
Filters to only items whose names match the specified wildcard pattern, ignoring case.
- TileItemQuerywithNames(String...)
Filters the query to include only items with names containing any of the specified substrings, ignoring case.
Inherited from AbstractQuery
- Raggregate(Function<Stream<TileItemEx>, R>)
Generic aggregation method for custom terminal operations Executes filters and allows custom stream processing.
- booleanall(Predicate<TileItemEx>)
Check if all filtered results match the predicate.
- booleanany(Predicate<TileItemEx>)
Check if any filtered result matches the predicate.
- List<TileItemEx>collect()
Get the filtered/sorted list.
- Rcollect(Collector<TileItemEx, ?, R>)
Execute filters and process with custom collector.
- intcount()
Get count of filtered results.
- TileItemQuerydistinct()
Ensure results are distinct.
- TileItemExfirst()
Get the first element from the filtered/sorted list.
- voidfirstIfPresent(Consumer<TileItemEx>)
First if present.
- voidfirstOrElse(Consumer<TileItemEx>, Runnable)
Perform action on the first element, or else run elseAction if no results.
- voidforEach(Consumer<TileItemEx>)
Executes filters and performs an action on each result.
- booleanisEmpty()
Check if there are no filtered results.
- TileItemQuerykeepIf(Predicate<TileItemEx>)
Lazily filter by predicate (keeps matching items).
- TileItemExlast()
Get the last element from the filtered/sorted list.
- voidlastOrElse(Consumer<TileItemEx>, Runnable)
Perform action on the last element, or else run elseAction if no results.
- TileItemQuerylimit(int)
Limit the number of results.
- booleannone(Predicate<TileItemEx>)
Check if no filtered results match the predicate.
- TileItemQuerypeek(Consumer<TileItemEx>)
Peek at each element during processing.
- TileItemQuerypostProcess(Function<List<TileItemEx>, List<TileItemEx>>)
Apply a post-processing function after sorting.
- TileItemExrandom()
Get a random element from the filtered/sorted list.
- TileItemQueryremoveIf(Predicate<TileItemEx>)
Lazily filter by predicate (removes matching items).
- TileItemQueryskip(int)
Skip a number of results.
- TileItemQuerysort(Comparator<TileItemEx>)
Lazily add sorting.
TileItemQuery()
public TileItemQuery()Creates a new TileItemQuery instance initialized with all tile items in the game.
atLocation(WorldPoint)
public TileItemQuery atLocation(WorldPoint location)Filters to only items located at the specified world point.
Parameters
location- The world point to filter by.
Returns
TileItemQuery.
farthest()
public TileItemEx farthest()Get the farthest item from the filtered list Terminal operation - executes the query.
farthest(WorldPoint)
public TileItemEx farthest(WorldPoint center)Get the farthest item from a specific point Terminal operation - executes the query.
Parameters
center- Center.
greaterThanGePrice(int)
public TileItemQuery greaterThanGePrice(int price)Filters to only items with a Grand Exchange price greater than the specified value.
Parameters
price- The minimum Grand Exchange price.
Returns
TileItemQuery.
greaterThanHighAlchValue(int)
public TileItemQuery greaterThanHighAlchValue(int value)Filters to only items with a high alchemy value greater than the specified value.
Parameters
value- The minimum high alchemy value.
Returns
TileItemQuery.
greaterThanLowAlchValue(int)
public TileItemQuery greaterThanLowAlchValue(int value)Filters to only items with a low alchemy value greater than the specified value.
Parameters
value- The minimum low alchemy value.
Returns
TileItemQuery.
greaterThanShopPrice(int)
public TileItemQuery greaterThanShopPrice(int price)Filters to only items with a shop price greater than the specified value.
Parameters
price- The minimum shop price.
Returns
TileItemQuery.
lessThanGePrice(int)
public TileItemQuery lessThanGePrice(int price)Filters to only items with a Grand Exchange price less than the specified value.
Parameters
price- The maximum Grand Exchange price.
Returns
TileItemQuery.
lessThanHighAlchValue(int)
public TileItemQuery lessThanHighAlchValue(int value)Filters to only items with a high alchemy value less than the specified value.
Parameters
value- The maximum high alchemy value.
Returns
TileItemQuery.
lessThanLowAlchValue(int)
public TileItemQuery lessThanLowAlchValue(int value)Filters to only items with a low alchemy value less than the specified value.
Parameters
value- The maximum low alchemy value.
Returns
TileItemQuery.
lessThanShopPrice(int)
public TileItemQuery lessThanShopPrice(int price)Filters to only items with a shop price less than the specified value.
Parameters
price- The maximum shop price.
Returns
TileItemQuery.
longestPath()
public TileItemEx longestPath()Get the item with the furthest path from the filtered list Terminal operation - executes the query.
nearest()
public TileItemEx nearest()Get the nearest item from the filtered list Terminal operation - executes the query.
nearest(WorldPoint)
public TileItemEx nearest(WorldPoint center)Get the nearest item to a specific point Terminal operation - executes the query.
Parameters
center- Center.
shortestPath()
public TileItemEx shortestPath()Get the item with the shortest path from the filtered list Terminal operation - executes the query.
sortFurthest()
public TileItemQuery sortFurthest()Sorts the items by distance from the local player, furthest first.
Returns
TileItemQuery.
sortFurthest(WorldPoint)
public TileItemQuery sortFurthest(WorldPoint center)Sorts the items by distance from the specified world point, furthest first.
Parameters
center- The center world point.
Returns
TileItemQuery.
sortLongestPath()
public TileItemQuery sortLongestPath()Sort by furthest path from the player.
Returns
TileItemQuery.
sortLongestPath(WorldPoint)
public TileItemQuery sortLongestPath(WorldPoint center)Sort by furthest path from a specific point.
Parameters
center- Center point.
Returns
TileItemQuery.
sortNearest()
public TileItemQuery sortNearest()Sorts the items by distance from the local player, nearest first.
Returns
TileItemQuery.
sortNearest(WorldPoint)
public TileItemQuery sortNearest(WorldPoint center)Sorts the items by distance from the specified world point, nearest first.
Parameters
center- The center world point.
Returns
TileItemQuery.
sortShortestPath()
public TileItemQuery sortShortestPath()Sort by shortest path from the player.
Returns
TileItemQuery.
sortShortestPath(WorldPoint)
public TileItemQuery sortShortestPath(WorldPoint center)Sort by shortest path from a specific point.
Parameters
center- Center point.
Returns
TileItemQuery.
withCanonicalId(int...)
public TileItemQuery withCanonicalId(int... id)Filters the query to include only items with the specified canonical IDs.
Parameters
id- The canonical item IDs to filter by.
Returns
TileItemQuery.
withId(int...)
public TileItemQuery withId(int... id)Filters the query to include only items with the specified IDs.
Parameters
id- The item IDs to filter by.
Returns
TileItemQuery.
within(int)
public TileItemQuery within(int distance)Filters to only items within the specified distance from the local player.
Parameters
distance- The maximum distance.
Returns
TileItemQuery.
within(WorldPoint, int)
public TileItemQuery within(WorldPoint center, int distance)Filters to only items within the specified distance from the given world point.
Parameters
center- The center world point.
distance- The maximum distance.
Returns
TileItemQuery.
withName(String)
public TileItemQuery withName(String name)Filters the query to include only items with the specified name.
Parameters
name- The item name to filter by.
Returns
TileItemQuery.
withNameContains(String)
public TileItemQuery withNameContains(String namePart)Filters to only items whose names contain the specified substring, ignoring case.
Parameters
namePart- The substring to filter by.
Returns
TileItemQuery.
withNameMatches(String)
public TileItemQuery withNameMatches(String namePart)Filters to only items whose names match the specified wildcard pattern, ignoring case.
Parameters
namePart- The wildcard pattern to filter by.
Returns
TileItemQuery.
withNames(String...)
public TileItemQuery withNames(String... names)Filters the query to include only items with names containing any of the specified substrings, ignoring case.
Parameters
names- The substrings to filter by.
Returns
TileItemQuery.
aggregate(Function<Stream<TileItemEx>, R>)from AbstractQuery
public R aggregate(Function<Stream<TileItemEx>, R> aggregator)Generic aggregation method for custom terminal operations Executes filters and allows custom stream processing.
Parameters
aggregator- Aggregator.
all(Predicate<TileItemEx>)from AbstractQuery
public boolean all(Predicate<TileItemEx> predicate)Check if all filtered results match the predicate.
Parameters
predicate- Predicate to test.
Returns
True if all match, false otherwise.
any(Predicate<TileItemEx>)from AbstractQuery
public boolean any(Predicate<TileItemEx> 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<TileItemEx> collect()Get the filtered/sorted list.
collect(Collector<TileItemEx, ?, R>)from AbstractQuery
public R collect(Collector<TileItemEx, ?, 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 TileItemQuery distinct()Ensure results are distinct.
Returns
The query instance.
first()from AbstractQuery
public TileItemEx first()Get the first element from the filtered/sorted list.
firstIfPresent(Consumer<TileItemEx>)from AbstractQuery
public void firstIfPresent(Consumer<TileItemEx> action)First if present.
Parameters
action- Action.
firstOrElse(Consumer<TileItemEx>, Runnable)from AbstractQuery
public void firstOrElse(Consumer<TileItemEx> 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<TileItemEx>)from AbstractQuery
public void forEach(Consumer<TileItemEx> 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<TileItemEx>)from AbstractQuery
public TileItemQuery keepIf(Predicate<TileItemEx> predicate)Lazily filter by predicate (keeps matching items).
Parameters
predicate- Predicate.
Returns
The query instance.
last()from AbstractQuery
public TileItemEx last()Get the last element from the filtered/sorted list.
lastOrElse(Consumer<TileItemEx>, Runnable)from AbstractQuery
public void lastOrElse(Consumer<TileItemEx> 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 TileItemQuery limit(int maxSize)Limit the number of results.
Parameters
maxSize- Max size.
Returns
The query instance.
none(Predicate<TileItemEx>)from AbstractQuery
public boolean none(Predicate<TileItemEx> predicate)Check if no filtered results match the predicate.
Parameters
predicate- Predicate to test.
Returns
True if none match, false otherwise.
peek(Consumer<TileItemEx>)from AbstractQuery
public TileItemQuery peek(Consumer<TileItemEx> action)Peek at each element during processing.
Parameters
action- Action to perform on each element.
Returns
The query instance.
postProcess(Function<List<TileItemEx>, List<TileItemEx>>)from AbstractQuery
public TileItemQuery postProcess(Function<List<TileItemEx>, List<TileItemEx>> 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 TileItemEx random()Get a random element from the filtered/sorted list.
removeIf(Predicate<TileItemEx>)from AbstractQuery
public TileItemQuery removeIf(Predicate<TileItemEx> predicate)Lazily filter by predicate (removes matching items).
Parameters
predicate- Predicate.
Returns
The query instance.
skip(int)from AbstractQuery
public TileItemQuery skip(int count)Skip a number of results.
Parameters
count- Count.
Returns
The query instance.
sort(Comparator<TileItemEx>)from AbstractQuery
public TileItemQuery sort(Comparator<TileItemEx> comparator)Lazily add sorting.
Parameters
comparator- Comparator.
Returns
The query instance.
Also allowed
Every class has these, as in plain Java.
equals, toString