sbc.orthoxml
Class Group

java.lang.Object
  extended by sbc.orthoxml.Scoreable
      extended by sbc.orthoxml.Group

public class Group
extends Scoreable

The group class represents a group of orthologous or paralogous genes depending on its type. Groups can be nested to represent trees. Multiple scores can be assigned to the group and each gene in the group. Genes are encapsulated into Membership objects that hold the gene and scores for the gene.

Author:
Thomas Schmitt

Nested Class Summary
static class Group.Type
          The type of a group i.e.
 
Constructor Summary
Group()
           
 
Method Summary
 java.util.Set<java.lang.String> definedProperties()
          Returns the properties defined for the group.
 java.util.List<Group> getChildren()
          Returns the children (nested groups) of the group.
 java.util.List<Gene> getGenes()
          Convenience method to get all genes that are a member of the group without the membership nesting.
 java.lang.String getId()
          Returns the id of the group.
 java.util.List<Membership> getMembers()
          Returns the genes that a member of the group nested into Membership objects.
 java.util.List<Gene> getNestedGenes()
          Convenience method to get all gene in the group and in groups that are nested into the group.
 java.util.List<Membership> getNestedMembers()
          Convenience method to get all memberships of the group and of groups that are nested into the group.
 Group getParent()
          Returns the parent of group e.g.
 java.lang.String getProperty(java.lang.String key)
          Returns the value of the property or null if the property has no value or is undefined.
 Group.Type getType()
          Returns the type of the group.
 boolean hasProperty(java.lang.String key)
          Returns true if the property is defined for the group and false otherwise.
 void setChildren(java.util.List<Group> children)
           
 void setGenes(java.util.List<Gene> genes)
          Convenience method to set gene members without a score.
 void setId(java.lang.String id)
          Sets the id of the group.
 void setMembers(java.util.List<Membership> members)
          Sets the genes that are members of group as Membership objects.
 void setProperty(java.lang.String key, java.lang.String value)
          Sets a key-value property.
 void setType(Group.Type type)
          Sets the type of the group.
 
Methods inherited from class sbc.orthoxml.Scoreable
addScore, getDefinedScores, getScores
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Group

public Group()
Method Detail

getNestedGenes

public java.util.List<Gene> getNestedGenes()
Convenience method to get all gene in the group and in groups that are nested into the group.

Returns:
genes in the group and in nested groups

getNestedMembers

public java.util.List<Membership> getNestedMembers()
Convenience method to get all memberships of the group and of groups that are nested into the group.

Returns:
memberships of the group of nested groups

getParent

public Group getParent()
Returns the parent of group e.g. the group this group is nested in.

Returns:
the parent or null if none.

setChildren

public void setChildren(java.util.List<Group> children)
Parameters:
children - the children to set

getChildren

public java.util.List<Group> getChildren()
Returns the children (nested groups) of the group.

Returns:
the children

setMembers

public void setMembers(java.util.List<Membership> members)
Sets the genes that are members of group as Membership objects.

Parameters:
members - the members of the group

setGenes

public void setGenes(java.util.List<Gene> genes)
Convenience method to set gene members without a score.

Parameters:
genes - the gene members of the group

getGenes

public java.util.List<Gene> getGenes()
Convenience method to get all genes that are a member of the group without the membership nesting. Use @{link #getNestedGenes()} to get all gene in the group and in the children of the group.

Returns:
the gene members of the group

getMembers

public java.util.List<Membership> getMembers()
Returns the genes that a member of the group nested into Membership objects. Use @{link #getNestedMembers()} to get all members in the group and in the children of the group.

Returns:
the memberships of the group

setType

public void setType(Group.Type type)
Sets the type of the group.

Parameters:
type - the type to set

getType

public Group.Type getType()
Returns the type of the group.

Returns:
the type of the group.

setId

public void setId(java.lang.String id)
Sets the id of the group.

Parameters:
id - the id to set

getId

public java.lang.String getId()
Returns the id of the group.

Returns:
the id

setProperty

public void setProperty(java.lang.String key,
                        java.lang.String value)
Sets a key-value property. If a property with the key is already defined the property gets overwritten.

Parameters:
key - the of the property
value - the value of the property

getProperty

public java.lang.String getProperty(java.lang.String key)
Returns the value of the property or null if the property has no value or is undefined.

Parameters:
key - the key of the property
Returns:
the velue of the property or null if none

hasProperty

public boolean hasProperty(java.lang.String key)
Returns true if the property is defined for the group and false otherwise.

Parameters:
key - the key of the property
Returns:
true if the property is defined otherwise false

definedProperties

public java.util.Set<java.lang.String> definedProperties()
Returns the properties defined for the group.

Returns:
the properties defined for the group