phenote.datamodel
Class AbstractCharacter

java.lang.Object
  extended by phenote.datamodel.AbstractCharacter
All Implemented Interfaces:
CharacterI
Direct Known Subclasses:
AnnotationCharacter, Character

public abstract class AbstractCharacter
extends java.lang.Object
implements CharacterI


Constructor Summary
AbstractCharacter()
           
 
Method Summary
abstract  void addComparison(org.obo.datamodel.OBOProperty relation, CharacterI relatedChar)
          throws CharacterEx if not implemented (Character doesnt implement) OBOAnnotation implements
protected  boolean eq(CharFieldValue c1, CharFieldValue c2)
          check if both are null in addition to .equals()
 boolean equals(CharacterI ch)
           
 boolean fieldEquals(CharacterI c, CharField cf)
          by default check if single char field val from field is equal, eventually should get hip to potential lists of values
 java.util.List<CharField> getAllCharFields()
          generic fields!!!
 CharField getCharFieldForName(java.lang.String fieldName)
           
 org.obo.datamodel.OBOClass getEntity()
           
protected  CharField getEntityField()
           
protected  CharField getGenConField()
           
 org.obo.datamodel.OBOClass getGeneticContext()
           
 java.lang.String getGenotype()
           
protected  CharField getGenotypeField()
           
 org.obo.annotation.datamodel.Annotation getOboAnnotation()
          Return null by default - AnnotationCharacter overrides
 java.lang.String getPub()
          these methods are pase and need to be phased out!
protected  CharField getPubField()
           
protected  CharField getQualField()
           
 org.obo.datamodel.OBOClass getQuality()
           
protected  org.obo.datamodel.OBOClass getTerm(CharField cf)
          Throws char field exception if char field is not a term, thus lists of terms throw an exception as they are not technically a single term
 org.obo.datamodel.OBOClass getTerm(java.lang.String field)
           
 java.lang.String getValueString(CharField cf)
          used in particular for lists of values
 java.lang.String getValueString(java.lang.String field)
           
 boolean hasGeneticContext()
           
 boolean hasNoContent()
           
 boolean hasOboAnnotation()
          Whether or not datamodel has obo annotations, returns getOboAnnotation != null, which is only true for AnnotationCharacter
 boolean hasPub()
          According to the CharacterI documentation, the methods below are garbage
 boolean hasValue(CharField cf)
           
 boolean hasValue(java.lang.String fieldName)
           
 void setEntity(org.obo.datamodel.OBOClass e)
           
 void setGeneticContext(org.obo.datamodel.OBOClass gc)
           
 void setGenotype(java.lang.String gt)
           
 void setPub(java.lang.String p)
          eventually have Genotype object? probably
 void setQuality(org.obo.datamodel.OBOClass q)
           
protected  void setValue(CharField cf, org.obo.datamodel.OBOClass term)
           
 CharFieldValue setValue(CharField cf, java.lang.String s)
          if term field, string should be id, obo class will be searched for, if class not found then dangler is created.
 CharFieldValue setValue(CharField cf, java.lang.String s, java.lang.String danglerName)
          if term field, string should be id, obo class will be searched for, if class not found then dangler is created.
protected  void setValue(CharFieldValue cfv)
           
 CharFieldValue setValue(java.lang.String fieldString, java.lang.String valueString)
          Returns CharFieldValue created
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface phenote.datamodel.CharacterI
cloneCharacter, getValue, getValueList, setValue, supportsComparisons
 

Constructor Detail

AbstractCharacter

public AbstractCharacter()
Method Detail

setValue

public CharFieldValue setValue(java.lang.String fieldString,
                               java.lang.String valueString)
                        throws CharFieldException,
                               TermNotFoundException
Returns CharFieldValue created

Specified by:
setValue in interface CharacterI
Throws:
CharFieldException
TermNotFoundException

setValue

public CharFieldValue setValue(CharField cf,
                               java.lang.String s)
                        throws CharFieldException
if term field, string should be id, obo class will be searched for, if class not found then dangler is created. if free text field just uses string of course. the dangler makes termNotFound Ex irrelevant - take out? or will there be a no dangler mode? probably not right? CharFieldEx thrown if improper date for date field

Specified by:
setValue in interface CharacterI
Throws:
CharFieldException

setValue

public CharFieldValue setValue(CharField cf,
                               java.lang.String s,
                               java.lang.String danglerName)
                        throws CharFieldException
if term field, string should be id, obo class will be searched for, if class not found then dangler is created. if free text field just uses string of course. the dangler makes termNotFound Ex irrelevant - take out? or will there be a no dangler mode? probably not right? CharFieldEx thrown if improper date for date field if cf is a term, can optionally pass in non null danglerName, if term ends up being dangler (not found in ontology) will set dangler id to s and dangler name to danglerName

Specified by:
setValue in interface CharacterI
Throws:
CharFieldException

getAllCharFields

public java.util.List<CharField> getAllCharFields()
Description copied from interface: CharacterI
generic fields!!!

Specified by:
getAllCharFields in interface CharacterI

getCharFieldForName

public CharField getCharFieldForName(java.lang.String fieldName)
                              throws CharFieldException
Specified by:
getCharFieldForName in interface CharacterI
Throws:
CharFieldException

getTerm

protected org.obo.datamodel.OBOClass getTerm(CharField cf)
                                      throws CharFieldException
Throws char field exception if char field is not a term, thus lists of terms throw an exception as they are not technically a single term

Throws:
CharFieldException

getTerm

public org.obo.datamodel.OBOClass getTerm(java.lang.String field)
                                   throws CharFieldException
Specified by:
getTerm in interface CharacterI
Throws:
CharFieldException

setValue

protected void setValue(CharField cf,
                        org.obo.datamodel.OBOClass term)

getValueString

public java.lang.String getValueString(CharField cf)
Description copied from interface: CharacterI
used in particular for lists of values

Specified by:
getValueString in interface CharacterI

getValueString

public java.lang.String getValueString(java.lang.String field)
                                throws CharFieldException
Specified by:
getValueString in interface CharacterI
Throws:
CharFieldException

hasNoContent

public boolean hasNoContent()
Specified by:
hasNoContent in interface CharacterI

hasValue

public boolean hasValue(CharField cf)
Specified by:
hasValue in interface CharacterI

hasValue

public boolean hasValue(java.lang.String fieldName)
Specified by:
hasValue in interface CharacterI

setValue

protected void setValue(CharFieldValue cfv)

equals

public boolean equals(CharacterI ch)
Specified by:
equals in interface CharacterI

fieldEquals

public boolean fieldEquals(CharacterI c,
                           CharField cf)
by default check if single char field val from field is equal, eventually should get hip to potential lists of values

Specified by:
fieldEquals in interface CharacterI

eq

protected boolean eq(CharFieldValue c1,
                     CharFieldValue c2)
check if both are null in addition to .equals()


hasOboAnnotation

public boolean hasOboAnnotation()
Whether or not datamodel has obo annotations, returns getOboAnnotation != null, which is only true for AnnotationCharacter

Specified by:
hasOboAnnotation in interface CharacterI

getOboAnnotation

public org.obo.annotation.datamodel.Annotation getOboAnnotation()
Return null by default - AnnotationCharacter overrides

Specified by:
getOboAnnotation in interface CharacterI

addComparison

public abstract void addComparison(org.obo.datamodel.OBOProperty relation,
                                   CharacterI relatedChar)
                            throws CharacterEx
throws CharacterEx if not implemented (Character doesnt implement) OBOAnnotation implements

Specified by:
addComparison in interface CharacterI
Throws:
CharacterEx

hasPub

public boolean hasPub()
According to the CharacterI documentation, the methods below are garbage

Specified by:
hasPub in interface CharacterI

setEntity

public void setEntity(org.obo.datamodel.OBOClass e)
Specified by:
setEntity in interface CharacterI

hasGeneticContext

public boolean hasGeneticContext()
Specified by:
hasGeneticContext in interface CharacterI

setGeneticContext

public void setGeneticContext(org.obo.datamodel.OBOClass gc)
Specified by:
setGeneticContext in interface CharacterI

getEntity

public org.obo.datamodel.OBOClass getEntity()
Specified by:
getEntity in interface CharacterI

getEntityField

protected CharField getEntityField()
                            throws CharFieldException
Throws:
CharFieldException

getGenConField

protected CharField getGenConField()
                            throws CharFieldException
Throws:
CharFieldException

getPubField

protected CharField getPubField()
                         throws CharFieldException
Throws:
CharFieldException

getQualField

protected CharField getQualField()
                          throws CharFieldException
Throws:
CharFieldException

getGeneticContext

public org.obo.datamodel.OBOClass getGeneticContext()
Specified by:
getGeneticContext in interface CharacterI

setGenotype

public void setGenotype(java.lang.String gt)
Specified by:
setGenotype in interface CharacterI

getGenotype

public java.lang.String getGenotype()
Specified by:
getGenotype in interface CharacterI

getGenotypeField

protected CharField getGenotypeField()
                              throws CharFieldException
Throws:
CharFieldException

getPub

public java.lang.String getPub()
Description copied from interface: CharacterI
these methods are pase and need to be phased out!

Specified by:
getPub in interface CharacterI

setPub

public void setPub(java.lang.String p)
Description copied from interface: CharacterI
eventually have Genotype object? probably

Specified by:
setPub in interface CharacterI

getQuality

public org.obo.datamodel.OBOClass getQuality()
Specified by:
getQuality in interface CharacterI

setQuality

public void setQuality(org.obo.datamodel.OBOClass q)
Specified by:
setQuality in interface CharacterI