Class SortInfo

java.lang.Object
com.webmethods.caf.faces.data.object.SortInfo
All Implemented Interfaces:
ISortInfo, Serializable

public class SortInfo extends Object implements ISortInfo, Serializable

Implementation of table sort information bean.

See Also:
  • Field Details

  • Constructor Details

    • SortInfo

      public SortInfo()
      New, empty sort info constructor
    • SortInfo

      public SortInfo(String s)
      Sort info from toString() (with string keys).
    • SortInfo

      public SortInfo(ISortInfo sort)
      Shallow copy of existing sort info.
  • Method Details

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • size

      public int size()
      Description copied from interface: ISortInfo
      Return number of sort keys. May be zero.
      Specified by:
      size in interface ISortInfo
      Returns:
      number of sort keys
    • getKey

      public Object getKey(int ordinal)
      Description copied from interface: ISortInfo
      Sort key. The 1st key is the primary key, the 2nd key is the secondary key, etc.
      Specified by:
      getKey in interface ISortInfo
      Parameters:
      ordinal - Must be > 0 and <= ISortInfo.size().
      Returns:
      Non-null, non-empty key.
    • isAscending

      public boolean isAscending(int ordinal)
      Description copied from interface: ISortInfo
      Sort order. The 1st order is the primary order, the 2nd order is the secondary order, etc.
      Specified by:
      isAscending in interface ISortInfo
      Parameters:
      ordinal - Must be > 0 and <= ISortInfo.size().
      Returns:
      True if order is a-z, 1-10, Jan-Dec, etc.
    • isAscending

      public boolean isAscending(Object key)
      Description copied from interface: ISortInfo
      Sort order associated with specified key.
      Specified by:
      isAscending in interface ISortInfo
      Parameters:
      key - the sort key.
      Returns:
      True if order is a-z, 1-10, Jan-Dec, etc., or if key is not present.
    • getOrdinal

      public int getOrdinal(Object key)
      Description copied from interface: ISortInfo
      Sort ordinal associated with specified key.
      Specified by:
      getOrdinal in interface ISortInfo
      Parameters:
      key - sort ordinal
      Returns:
      Ordinal, or zero if key is not present.
    • getOrdinals

      public IContentProvider getOrdinals()
      Description copied from interface: ISortInfo
      Return content provider for mapping keys to ordinal values.
      Specified by:
      getOrdinals in interface ISortInfo
      Returns:
      instance of SortInfo.OrdinalsContentProvider
    • getAscendings

      public IContentProvider getAscendings()
      Description copied from interface: ISortInfo
      Return content provider for mapping keys to ascending values.
      Specified by:
      getAscendings in interface ISortInfo
      Returns:
      instance of SortInfo.AscendingsContentProvider
    • toggleAscending

      public void toggleAscending(int ordinal)
      Toggles between ascending and descending for ordinal.
    • add

      public void add(Object key, boolean ascending)
      Adds as last ordinal.
      Parameters:
      key - Non-null, non-empty key.
      ascending - True if order is a-z, 1-10, Jan-Dec, etc.
    • add

      public void add(int ordinal, Object key, boolean ascending)
      Adds an ordinal. The 1st key is the primary key, the 2nd key is the secondary key, etc.
      Parameters:
      ordinal - Must be > 0 and <= size().
      key - Non-null, non-empty key.
      ascending - True if order is a-z, 1-10, Jan-Dec, etc.
      Throws:
      IndexOutOfBoundsException - If ordinal <= 1 or > size() + 1.
    • remove

      public void remove(int ordinal)
      Removes an ordinal. The 1st key is the primary key, the 2nd key is the secondary key, etc.
      Parameters:
      ordinal - Must be > 0 and <= size().
      Throws:
      IndexOutOfBoundsException - If ordinal <= 1 or > size().
    • move

      public void move(int fromOrdinal, int toOrdinal)
      Moves from first ordinal to second ordinal.
      Parameters:
      fromOrdinal - Must be > 0 and <= size().
      toOrdinal - Must be > 0 and <= size().
      Throws:
      IndexOutOfBoundsException - If either ordinal <= 1 or > size().
    • clear

      public void clear()
      Removes all ordinals.
    • fromString

      public void fromString(String s)
      Reverses toString() (with string keys).
    • getOrdinal

      protected SortInfo.Ordinal getOrdinal(int ordinal)
      Parameters:
      ordinal - Must be > 0 and <= size().
      Returns:
      Ordinal object.
      Throws:
      IndexOutOfBoundsException - If ordinal <= 1 or > size().