com.partnersoft.v3x.data
Class PairArray

java.lang.Object
  extended by com.partnersoft.v3x.data.PairArray
All Implemented Interfaces:
ArraySearchingGopher, ArraySortingGopher
Direct Known Subclasses:
InMemoryFindItemDump

public class PairArray
extends java.lang.Object
implements ArraySortingGopher, ArraySearchingGopher


Constructor Summary
PairArray()
           
 
Method Summary
 void clear()
           
 int compare(int index, java.lang.Object key)
          Compares the key of the item at the given index using the key given, based on the default ordering.
 int compare(int index, java.lang.Object key, java.util.Comparator comp)
          Compares the key of the item at the given index using the key and ordering given.
 int findClosest(java.lang.String key)
           
 java.lang.Object get(int index)
           
 java.lang.Object get(java.lang.Object key)
           
 java.lang.Object getKey(int index)
           
 int getSize()
          Returns the number of items in the array.
 int indexOf(java.lang.Object key)
           
 java.lang.Object keyAt(int index)
          Gets the key object from the given index.
 void put(java.lang.Object key, java.lang.Object value)
           
 void sort()
           
 void swap(int a, int b)
          Swaps the items at the two index positions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PairArray

public PairArray()
Method Detail

put

public void put(java.lang.Object key,
                java.lang.Object value)

findClosest

public int findClosest(java.lang.String key)

get

public java.lang.Object get(java.lang.Object key)

indexOf

public int indexOf(java.lang.Object key)

get

public java.lang.Object get(int index)

getKey

public java.lang.Object getKey(int index)

clear

public void clear()

sort

public void sort()

compare

public int compare(int index,
                   java.lang.Object key)
Compares the key of the item at the given index using the key given, based on the default ordering.

Specified by:
compare in interface ArraySearchingGopher
Specified by:
compare in interface ArraySortingGopher

compare

public int compare(int index,
                   java.lang.Object key,
                   java.util.Comparator comp)
Compares the key of the item at the given index using the key and ordering given.

Specified by:
compare in interface ArraySearchingGopher
Specified by:
compare in interface ArraySortingGopher

keyAt

public java.lang.Object keyAt(int index)
Gets the key object from the given index.

Specified by:
keyAt in interface ArraySortingGopher

getSize

public int getSize()
Returns the number of items in the array.

Specified by:
getSize in interface ArraySearchingGopher
Specified by:
getSize in interface ArraySortingGopher

swap

public void swap(int a,
                 int b)
Swaps the items at the two index positions.

Specified by:
swap in interface ArraySortingGopher