com.partnersoft.prototype
Class Compression.Chipmunk

java.lang.Object
  extended by com.partnersoft.prototype.Compression.Chipmunk
All Implemented Interfaces:
ArraySortingGopher
Enclosing class:
Compression

public static class Compression.Chipmunk
extends java.lang.Object
implements ArraySortingGopher


Field Summary
 int[] counts
           
 int rememberMe
           
 java.lang.String[] strings
           
 
Constructor Summary
Compression.Chipmunk(CountingBag county)
           
 
Method Summary
 int compare(int index)
          Compares the key of the item at the given index with the current remembered key.
 int getSize()
          Returns the number of items in the array.
 void remember(int index)
          Remembers the key at the given index for future comparisons.
 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
 

Field Detail

strings

public java.lang.String[] strings

counts

public int[] counts

rememberMe

public int rememberMe
Constructor Detail

Compression.Chipmunk

public Compression.Chipmunk(CountingBag county)
Method Detail

remember

public void remember(int index)
Description copied from interface: ArraySortingGopher
Remembers the key at the given index for future comparisons.

Specified by:
remember in interface ArraySortingGopher

compare

public int compare(int index)
Description copied from interface: ArraySortingGopher
Compares the key of the item at the given index with the current remembered key.

Specified by:
compare in interface ArraySortingGopher

getSize

public int getSize()
Description copied from interface: ArraySortingGopher
Returns the number of items in the array.

Specified by:
getSize in interface ArraySortingGopher

swap

public void swap(int a,
                 int b)
Description copied from interface: ArraySortingGopher
Swaps the items at the two index positions.

Specified by:
swap in interface ArraySortingGopher