Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| HTML Parser Home Page
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.htmlparser.util.sort
Interface Sortable

All Known Implementing Classes:
  PageIndex

public interface Sortable

Provides a mechanism to abstract the sort process. Classes implementing this interface are collections of Ordered objects that are to be sorted by the Sort class and are not necessarily Vectors or Arrays of Ordered objects.

See Also:
  `Sort`

Method Summary
`Ordered` | `fetch(int index, Ordered reuse)` Fetch the object at the given index.
`int` | `first()` Returns the first index of the Sortable.
`int` | `last()` Returns the last index of the Sortable.
`void` | `swap(int i, int j)` Swaps the elements at the given indicies.

Method Detail

### first

    public int first()

  Returns the first index of the Sortable.

  Returns:
    The index of the first element.

### last

    public int last()

  Returns the last index of the Sortable.

  Returns:
    The index of the last element. If this were an array object this would be (object.length - 1).

### fetch

    public Ordered fetch(int index,
                         Ordered reuse)

  Fetch the object at the given index.

  Parameters:
    `index` - The item number to get.
    `reuse` - If this argument is not null, it is an object acquired from a previous fetch that is no longer needed and may be returned as the result if it makes mores sense to alter and return it than to fetch or create a new element. That is, the reuse object is garbage and may be used to avoid allocating a new object if that would normally be the strategy.
  Returns:
    The Ordered object at that index.

### swap

    public void swap(int i,
                     int j)

  Swaps the elements at the given indicies.

  Parameters:
    `i` - One index.
    `j` - The other index.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| © 2004 Somik Raha Mar 14, 2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

HTML Parser is an open source library released under LGPL.