org.forester.phylogeny.data
Class Event

java.lang.Object
  extended by org.forester.phylogeny.data.Event
All Implemented Interfaces:
PhylogenyData

public class Event
extends Object
implements PhylogenyData


Nested Class Summary
static class Event.EventType
           
 
Field Summary
static int DEFAULT_VALUE
           
 
Constructor Summary
Event()
           
Event(Event.EventType type)
           
Event(int duplications, int speciations, int gene_losses)
           
Event(int duplications, int speciations, int gene_losses, String type)
           
Event(String nhx)
           
 
Method Summary
 StringBuffer asSimpleText()
           
 StringBuffer asText()
           
 PhylogenyData copy()
          Creates a new PhylogenyData object with identical values as this PhylogenyData.
static Event createSingleDuplicationEvent()
           
static Event createSingleSpeciationEvent()
           
static Event createSingleSpeciationOrDuplicationEvent()
           
 Confidence getConfidence()
           
 Event.EventType getEventType()
           
 int getNumberOfDuplications()
           
 int getNumberOfGeneLosses()
           
 int getNumberOfSpeciations()
           
 boolean isDuplication()
          Returns true if this event contains one or more duplications events only
 boolean isEqual(PhylogenyData event)
          Compares this PhylogenyData to PhylogenyData data.
 boolean isFusion()
           
 boolean isGeneLoss()
          Returns true if this event contains one or more gene loss events only
 boolean isOther()
           
 boolean isRoot()
           
 boolean isSpeciation()
          Returns true if this event contains one or more speciation events only
 boolean isSpeciationOrDuplication()
           
 boolean isTransfer()
           
 boolean isUnassigned()
           
 void setConfidence(Confidence confidence)
           
 void setDuplications(int duplications)
           
 void setGeneLosses(int gene_losses)
           
 void setSpeciations(int speciations)
           
 StringBuffer toNHX()
           
 void toPhyloXML(Writer writer, int level, String indentation)
          Writes a phyloXML representation of this phylogeny data.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_VALUE

public static final int DEFAULT_VALUE
See Also:
Constant Field Values
Constructor Detail

Event

public Event()

Event

public Event(Event.EventType type)

Event

public Event(int duplications,
             int speciations,
             int gene_losses)

Event

public Event(int duplications,
             int speciations,
             int gene_losses,
             String type)

Event

public Event(String nhx)
      throws NHXFormatException
Throws:
NHXFormatException
Method Detail

asSimpleText

public StringBuffer asSimpleText()
Specified by:
asSimpleText in interface PhylogenyData

asText

public StringBuffer asText()
Specified by:
asText in interface PhylogenyData

copy

public PhylogenyData copy()
Description copied from interface: PhylogenyData
Creates a new PhylogenyData object with identical values as this PhylogenyData. This ~should~ return a deep copy, but not there yet.

Specified by:
copy in interface PhylogenyData
Returns:
a ~deep~ copy of this PhylogenyData

getConfidence

public Confidence getConfidence()

getEventType

public Event.EventType getEventType()

getNumberOfDuplications

public int getNumberOfDuplications()

getNumberOfGeneLosses

public int getNumberOfGeneLosses()

getNumberOfSpeciations

public int getNumberOfSpeciations()

isDuplication

public boolean isDuplication()
Returns true if this event contains one or more duplications events only

Returns:
true if this event contains one or more duplications events only

isEqual

public boolean isEqual(PhylogenyData event)
Description copied from interface: PhylogenyData
Compares this PhylogenyData to PhylogenyData data. In general, this should return true if and only if all fiels are exactly identical.

Specified by:
isEqual in interface PhylogenyData
Returns:
in general, true if and only if all fiels are exactly identical, false otherwise

isFusion

public boolean isFusion()

isGeneLoss

public boolean isGeneLoss()
Returns true if this event contains one or more gene loss events only

Returns:
true if this event contains one or more gene loss events only

isOther

public boolean isOther()

isRoot

public boolean isRoot()

isSpeciation

public boolean isSpeciation()
Returns true if this event contains one or more speciation events only

Returns:
true if this event contains one or more speciation events only

isSpeciationOrDuplication

public boolean isSpeciationOrDuplication()

isTransfer

public boolean isTransfer()

isUnassigned

public boolean isUnassigned()

setConfidence

public void setConfidence(Confidence confidence)

setDuplications

public void setDuplications(int duplications)

setGeneLosses

public void setGeneLosses(int gene_losses)

setSpeciations

public void setSpeciations(int speciations)

toNHX

public StringBuffer toNHX()
Specified by:
toNHX in interface PhylogenyData

toPhyloXML

public void toPhyloXML(Writer writer,
                       int level,
                       String indentation)
                throws IOException
Description copied from interface: PhylogenyData
Writes a phyloXML representation of this phylogeny data.

Specified by:
toPhyloXML in interface PhylogenyData
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object

createSingleDuplicationEvent

public static Event createSingleDuplicationEvent()

createSingleSpeciationEvent

public static Event createSingleSpeciationEvent()

createSingleSpeciationOrDuplicationEvent

public static Event createSingleSpeciationOrDuplicationEvent()