taskspaces.rna
Class Partition

java.lang.Object
  |
  +--taskspaces.rna.Partition
All Implemented Interfaces:
java.io.Serializable

public class Partition
extends java.lang.Object
implements java.io.Serializable

Contains methods to generate random RNA sequence Strings from a sequence over a set space of partitions given a number of objects and modules.

Version:
1.00
Author:
Rob Markel
See Also:
Serialized Form

Field Summary
(package private)  int modules
          Holds number of modules.
(package private)  int objects
          Holds number of objects.
(package private)  int[] partitions
          Holds partition values.
 
Constructor Summary
Partition()
           
 
Method Summary
 int[] fill(int obs, int mods)
          Sets the partition array to the correct values.
 int getModuleNumber()
          Returns the current number of modules.
 int getObjectNumber()
          Returns the current number of objects.
 int[] getPartitions()
          Returns the partition array.
 float[] getPercentages(float percentage)
          Returns the partition percentages when passed a percentage.
 int[] next()
          Returns the next permutation of the partition array.
 void reset()
          Resets the partitions.
 void setModuleNumber(int i)
          Sets the current number of modules.
 void setObjectNumber(int i)
          Sets the current number of objects.
 void setPartitions(int[] i)
          Sets the partition array to the given array.
 int sum(int[] array)
          Sums the elements of a given int[].
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

objects

int objects
Holds number of objects.

modules

int modules
Holds number of modules.

partitions

int[] partitions
Holds partition values.
Constructor Detail

Partition

public Partition()
Method Detail

getPercentages

public float[] getPercentages(float percentage)
Returns the partition percentages when passed a percentage.
Parameters:
percentage - indicates percent steps.
Returns:
the current percentage values.

getObjectNumber

public int getObjectNumber()
Returns the current number of objects.
Returns:
the current number of objects.

setObjectNumber

public void setObjectNumber(int i)
Sets the current number of objects.
Parameters:
i - the desired number of objects.
Returns:
void

getModuleNumber

public int getModuleNumber()
Returns the current number of modules.
Returns:
the current number of modules.

setModuleNumber

public void setModuleNumber(int i)
Sets the current number of modules.
Parameters:
i - the desired number of modules.
Returns:
void

getPartitions

public int[] getPartitions()
Returns the partition array.
Returns:
the current partition array.

setPartitions

public void setPartitions(int[] i)
Sets the partition array to the given array.
Parameters:
i - the partition array to set as the current partition array.
Returns:
void

reset

public void reset()
           throws java.lang.Exception
Resets the partitions.
Returns:
void.

fill

public int[] fill(int obs,
                  int mods)
           throws java.lang.Exception
Sets the partition array to the correct values.
Parameters:
o - the number of objects.
m - the number of modules.
Returns:
the array of values.

next

public int[] next()
           throws java.lang.Exception
Returns the next permutation of the partition array.
Returns:
the next permutation of the partition array.

sum

public int sum(int[] array)
Sums the elements of a given int[].
Parameters:
ia - the integer array to sum.
Returns:
the sum value of the array elements.

-bottom