Class Partition

java.lang.Object
  extended byPartition
All Implemented Interfaces:
java.lang.Cloneable

public class Partition
extends java.lang.Object
implements java.lang.Cloneable

This class implements partitions of the set of integers 0,...,size. The array blockName gives the class of an integer. The array blockList gives each class as a doubly linked list (class DListInt). The array address gives the location of an element in its class.


Constructor Summary
Partition(int n)
          Creates the partition with one class (with name 0) of 0,...
Partition(int[] t)
          Creates a partition according to the class names given in the array .
 
Method Summary
 java.lang.Object clone()
           
 java.lang.String toString()
          returns the partition with each class on a line.
 void transfer(DListInt list, int src, int dest)
          Transfers the elements of the list list from the class src to the class dest.
 void transfer(int q, int src, int dest)
          Transfers q from the class src to the class dest.
 void transfer(IntList list, int src, int dest)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Partition

public Partition(int n)
Creates the partition with one class (with name 0) of 0,...,n


Partition

public Partition(int[] t)
Creates a partition according to the class names given in the array .

Method Detail

clone

public java.lang.Object clone()

transfer

public void transfer(int q,
                     int src,
                     int dest)
Transfers q from the class src to the class dest.


transfer

public void transfer(DListInt list,
                     int src,
                     int dest)
Transfers the elements of the list list from the class src to the class dest.


transfer

public void transfer(IntList list,
                     int src,
                     int dest)

toString

public java.lang.String toString()
returns the partition with each class on a line.