Interface IndexedSortable

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int compare​(int i, int j)
      Compare items at the given addresses consistent with the semantics of Comparator.compare(Object, Object).
      int compare​(int segmentNumberI, int segmentOffsetI, int segmentNumberJ, int segmentOffsetJ)
      Compare records at the given addresses consistent with the semantics of Comparator.compare(Object, Object).
      int recordSize()
      Gets the size of each record, the number of bytes separating the head of successive records.
      int recordsPerSegment()
      Gets the number of elements in each memory segment.
      int size()
      Gets the number of elements in the sortable.
      void swap​(int i, int j)
      Swap items at the given addresses.
      void swap​(int segmentNumberI, int segmentOffsetI, int segmentNumberJ, int segmentOffsetJ)
      Swap records at the given addresses.
    • Method Detail

      • compare

        int compare​(int segmentNumberI,
                    int segmentOffsetI,
                    int segmentNumberJ,
                    int segmentOffsetJ)
        Compare records at the given addresses consistent with the semantics of Comparator.compare(Object, Object).
        Parameters:
        segmentNumberI - index of memory segment containing first record
        segmentOffsetI - offset into memory segment containing first record
        segmentNumberJ - index of memory segment containing second record
        segmentOffsetJ - offset into memory segment containing second record
        Returns:
        a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
      • swap

        void swap​(int i,
                  int j)
        Swap items at the given addresses.
      • swap

        void swap​(int segmentNumberI,
                  int segmentOffsetI,
                  int segmentNumberJ,
                  int segmentOffsetJ)
        Swap records at the given addresses.
        Parameters:
        segmentNumberI - index of memory segment containing first record
        segmentOffsetI - offset into memory segment containing first record
        segmentNumberJ - index of memory segment containing second record
        segmentOffsetJ - offset into memory segment containing second record
      • size

        int size()
        Gets the number of elements in the sortable.
        Returns:
        The number of elements.
      • recordSize

        int recordSize()
        Gets the size of each record, the number of bytes separating the head of successive records.
        Returns:
        The record size
      • recordsPerSegment

        int recordsPerSegment()
        Gets the number of elements in each memory segment.
        Returns:
        The number of records per segment