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

## com.twitterapime.util
Class QSort

    java.lang.Object
      com.twitterapime.util.QSort

    public class QSort

extends java.lang.Object

This class implements QSort algorithm.

Since:
  1.3
Version:
  1.0
Author:
  Ernandes Mourao Junior (ernandes@gmail.com)

Constructor Summary
`QSort()` Default constructor.

Method Summary
`protected java.lang.Object` | `getElement(java.lang.Object ob)` Get an element to be sorted from a given object.
`protected boolean` | `greater(java.lang.Object i1, java.lang.Object i2)` Verify if a given object (1st param) is greater than another object (2nd param).
`boolean` | `isAscendingSort()` Return if the sort is set up for ascending or descending.
`protected boolean` | `lesser(java.lang.Object i1, java.lang.Object i2)` Verify if a given object (1st param) is lesser than another object (2nd param).
`void` | `quicksort(java.lang.Object[] items, int s, int e)` Start sorting a given array of objects.
`void` | `setAscendingSortEnabled(boolean enabled)` Set enable the ascending sort or descending.
`protected void` | `swap(java.lang.Object[] its, int i1, int i2)` Swap two objects from the array according to the given indexes.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### QSort

    public QSort()

  Default constructor.

Method Detail

### setAscendingSortEnabled

    public void setAscendingSortEnabled(boolean enabled)

  Set enable the ascending sort or descending.

  Parameters:
    `enabled` - Enabled or disabled.

### isAscendingSort

    public boolean isAscendingSort()

  Return if the sort is set up for ascending or descending.

  Returns:
    Ascending sort or descending.

### quicksort

    public void quicksort(java.lang.Object[] items,
                          int s,
                          int e)

  Start sorting a given array of objects.

  Parameters:
    `items` - Objects to be sorted.
    `s` - Start index.
    `e` - End index.

### getElement

    protected java.lang.Object getElement(java.lang.Object ob)

  Get an element to be sorted from a given object.

  Parameters:
    `ob` - Object.
  Returns:
    Object to be sorted.

### lesser

    protected boolean lesser(java.lang.Object i1,
                             java.lang.Object i2)

  Verify if a given object (1st param) is lesser than another object (2nd param).

  Parameters:
    `i1` - Object 1.
    `i2` - Object 2.
  Returns:
    If 1s object is lesser thant 2nd object.

### greater

    protected boolean greater(java.lang.Object i1,
                              java.lang.Object i2)

  Verify if a given object (1st param) is greater than another object (2nd param).

  Parameters:
    `i1` - Object 1.
    `i2` - Object 2.
  Returns:
    If 1s object is greater thant 2nd object.

### swap

    protected void swap(java.lang.Object[] its,
                        int i1,
                        int i2)

  Swap two objects from the array according to the given indexes.

  Parameters:
    `its` - Array of objects.
    `i1` - Index of the 1st object.
    `i2` - Index of the 2nd object.

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

Copyright © 2010 Twitter API ME Team. All Rights Reserved.