Class DefaultItemSorter

    • Constructor Detail

      • DefaultItemSorter

        public DefaultItemSorter()
        Deprecated.
        Constructs a DefaultItemSorter using the default Comparator for comparing Propertyvalues.
      • DefaultItemSorter

        public DefaultItemSorter​(Comparator<Object> propertyValueComparator)
        Deprecated.
        Constructs a DefaultItemSorter which uses the Comparator indicated by the propertyValueComparator parameter for comparing Propertyvalues.
        Parameters:
        propertyValueComparator - The comparator to use when comparing individual Property values
    • Method Detail

      • compareProperty

        protected int compareProperty​(Object propertyId,
                                      boolean sortDirection,
                                      Item item1,
                                      Item item2)
        Deprecated.
        Compares the property indicated by propertyId in the items indicated by item1 and item2 for order. Returns a negative integer, zero, or a positive integer as the property value in the first item is less than, equal to, or greater than the property value in the second item. If the sortDirection is false the returned value is negated.

        The comparator set for this DefaultItemSorter is used for comparing the two property values.

        Parameters:
        propertyId - The property id for the property that is used for comparison.
        sortDirection - The direction of the sort. A false value negates the result.
        item1 - The first item to compare.
        item2 - The second item to compare.
        Returns:
        a negative, zero, or positive integer if the property value in the first item is less than, equal to, or greater than the property value in the second item. Negated if sortDirection is false.
      • setSortProperties

        public void setSortProperties​(Container.Sortable container,
                                      Object[] propertyId,
                                      boolean[] ascending)
        Deprecated.
        Description copied from interface: ItemSorter
        Sets the parameters for an upcoming sort operation. The parameters determine what container to sort and how the ItemSorter sorts the container.
        Specified by:
        setSortProperties in interface ItemSorter
        Parameters:
        container - The container that will be sorted. The container must contain the propertyIds given in the propertyId parameter.
        propertyId - The property ids used for sorting. The property ids must exist in the container and should only be used if they are also sortable, i.e include in the collection returned by container.getSortableContainerPropertyIds(). See Container.Sortable.sort(Object[], boolean[]) for more information.
        ascending - Sorting order flags for each property id. See Container.Sortable.sort(Object[], boolean[]) for more information.