Interface SORT

  • All Known Implementing Classes:
    SORTImpl

    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 Persons 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.

    • Method Detail

      • ascending

        boolean ascending​(String attr)
        Sort the selection ascending by the attribute specified.
        Parameters:
        attr - the attribute to sort by
        Returns:
        true
      • descending

        boolean descending​(String attr)
        Sort the selection descending by the attribute specified.
        Parameters:
        attr - the attribute to sort by
        Returns:
        true