ca.cas.patterns
Class FPChrom

java.lang.Object
  extended by ca.cas.patterns.FPChrom

public class FPChrom
extends java.lang.Object

This class stores a final pattern chromosome. This is little more than a vector of Fragment objects and a boolean flag to indicate if the chromosome is a ring.


Constructor Summary
FPChrom()
           
FPChrom(boolean ring)
           
 
Method Summary
 boolean add(Fragment frag)
          adds the fragment to the end of the chromosome
 void add(int index, Fragment frag)
          adds the fragment at the specified index.
 java.util.Enumeration<Fragment> fragments()
          returns an enumeration of the fragments in the chromosome.
 Fragment getFragment(int index)
          returns the fragment at the specified index.
 boolean isRing()
          returns true if the chromosome is a ring.
 Fragment removeFragment(int index)
          remove the fragment at the specified index.
 int size()
          returns the number of fragments in this chromosome
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FPChrom

public FPChrom()

FPChrom

public FPChrom(boolean ring)
Method Detail

add

public boolean add(Fragment frag)
adds the fragment to the end of the chromosome

Parameters:
frag - fragment to add
Returns:
true if added

add

public void add(int index,
                Fragment frag)
adds the fragment at the specified index.

Parameters:
index - location to add fragment
frag - fragment to add

isRing

public boolean isRing()
returns true if the chromosome is a ring.

Returns:
true if a ring

size

public int size()
returns the number of fragments in this chromosome

Returns:
number of fragments in this chromosome

getFragment

public Fragment getFragment(int index)
returns the fragment at the specified index.

Parameters:
index -
Returns:
fragment at index

removeFragment

public Fragment removeFragment(int index)
remove the fragment at the specified index.

Parameters:
index -
returns - the fragment at the index.

fragments

public java.util.Enumeration<Fragment> fragments()
returns an enumeration of the fragments in the chromosome.

Returns:
enumeration of the fragments in this chromosome.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object