public interface SORT
Provides an architectural hook to return sorted selections.
The bridges in this external entity are not bridges in the normal sense that
the provide an interface into hand written code, but they serve as a proxy
for a missing OAL feature to sort the result of a select
statement.
Inject a call to one of the SORT
bridges in a "where" clause to cause
the result to be sorted. The SORT
bridges return boolean
which allows them to be included with the rest of a "where" expression via a
logical and
.
Example:
select many persons from instances of Person where (SORT::ascending(attr:"name") and selected.age >= 21);
This selection will result in a set of Person
s greater than or equal
to 21 years of age, sorted by name. The SORT
bridges only support
sorting by a single attribute at a time.
Modifier and Type | Method and Description |
---|---|
boolean |
ascending(String attr)
Sort the selection ascending by the attribute specified.
|
boolean |
descending(String attr)
Sort the selection descending by the attribute specified.
|
boolean ascending(String attr)
attr
- the attribute to sort byboolean descending(String attr)
attr
- the attribute to sort byCopyright © 2020. All rights reserved.