softparsmap
Class Family

java.lang.Object
  extended bysoftparsmap.Family
All Implemented Interfaces:
java.lang.Comparable

public class Family
extends java.lang.Object
implements java.lang.Comparable

This class represents a gene family. Since the number of families can be large, this class will only contain a reference to its family group, its family number, and how many sequences it contains.


Constructor Summary
Family(FamilyGroup familyGroup, java.lang.Integer familyNumber)
          A family needs to know from which family group it comes from.
 
Method Summary
 Family cloneFamily()
          Returns a copy of this family.
 int compareTo(java.lang.Object o)
          Compare the family number between this and a second family.
 boolean equals(java.lang.Object o)
          The families are the same if their family numbers are the same.
 FamilyGroup getFamilyGroup()
          Returns the family group to which this family belongs.
 java.lang.Integer getFamilyNumber()
          Returns the family number.
 GeneNode getGeneTree()
          Returns the gene tree.
 int getNumberOfSequences()
          Returns the number of sequences of this family.
 PropertyFile getPropertyFile()
          Returns the property file.
 int hashCode()
          Returns the hash code and it has to agree with equals(java.lang.Object).
 java.lang.String toString()
          Return the family number in string format.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Family

public Family(FamilyGroup familyGroup,
              java.lang.Integer familyNumber)
A family needs to know from which family group it comes from. The family number is used by the family to ask the family group for family specific information.

Parameters:
familyGroup - is the family group this family belongs to
familyNumber - is the number of this family
See Also:
FamilyGroup
Method Detail

getPropertyFile

public PropertyFile getPropertyFile()
Returns the property file.

Returns:
the property file
See Also:
PropertyFile

cloneFamily

public Family cloneFamily()
Returns a copy of this family.

Returns:
a new instance with the same family group and family number

getFamilyNumber

public java.lang.Integer getFamilyNumber()
Returns the family number.

Returns:
the family number

getFamilyGroup

public FamilyGroup getFamilyGroup()
Returns the family group to which this family belongs.

Returns:
the family group
See Also:
FamilyGroup

getGeneTree

public GeneNode getGeneTree()
Returns the gene tree. It gets it from the family group using the the family number.

Returns:
the gene tree
See Also:
GeneNode

getNumberOfSequences

public int getNumberOfSequences()
Returns the number of sequences of this family.

Returns:
the number of sequences of this family

compareTo

public int compareTo(java.lang.Object o)
Compare the family number between this and a second family.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - is the second famliy
Returns:
A integer above zero if this family have a higher family number then 'o', zero if equal, else below zero

equals

public boolean equals(java.lang.Object o)
The families are the same if their family numbers are the same.

Parameters:
o - is the other family.
Returns:
True if the their family numbers are the same.

hashCode

public int hashCode()
Returns the hash code and it has to agree with equals(java.lang.Object).

Returns:
the hash code

toString

public java.lang.String toString()
Return the family number in string format.

Returns:
the family number in string format