phenote.datamodel
Class AbstractCharacter

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

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


Field Summary
 
Fields inherited from interface phenote.datamodel.CharacterI
CHAR_FLAVOR
 
Constructor Summary
AbstractCharacter()
           
 
Method Summary
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!!!
 java.lang.String getAnnotId()
          Returns auto generated annot id for character, returns null if dont have one
 CharField getCharFieldForName(java.lang.String fieldName)
           
 java.util.List<Comparison> getComparisons()
          get all comparisons with char as subject
 java.util.List<CharFieldValue> getComparisonValueKidList()
          Returns a list of CharFieldValue comparison kids (not parent CFV)
 org.obo.datamodel.OBOClass getEntity()
           
protected  CharField getEntityField()
           
protected  CharField getGenConField()
           
 org.obo.datamodel.OBOClass getGeneticContext()
           
 java.lang.String getGenotype()
           
protected  CharField getGenotypeField()
           
 java.lang.String getIdOrValue(java.lang.String field)
          convenience function, if field is a term then return ID, otherwise return field value as String throws ex if field doesnt exist
 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.Object getTransferData(java.awt.datatransfer.DataFlavor flavor)
          Returns an object which represents the data to be transferred.
 java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
          Returns an array of DataFlavor objects indicating the flavors the data can be provided in.
 java.lang.String getValueString(CharField cf)
          used in particular for lists of values
 java.lang.String getValueString(java.lang.String field)
           
 boolean hasAnnotId()
          throws CharacterEx if not implemented (Character doesnt implement) OBOAnnotation implements
 boolean hasComparison()
          Returns true if character is a SUBJECT of a comparison, NOT object in otherwords returns false if getComparison is null
 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 They are here for backward compatibility - still used in nexus & phenoxml adapter but they should be upgraded to new generic way at some point need to keep in for now
 boolean hasValue(CharField cf)
           
 boolean hasValue(java.lang.String fieldName)
           
 boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
          Returns whether or not the specified data flavor is supported for this object
 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

getIdOrValue

public java.lang.String getIdOrValue(java.lang.String field)
                              throws CharFieldException
convenience function, if field is a term then return ID, otherwise return field value as String throws ex if field doesnt exist

Specified by:
getIdOrValue 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

hasAnnotId

public boolean hasAnnotId()
throws CharacterEx if not implemented (Character doesnt implement) OBOAnnotation implements

Specified by:
hasAnnotId in interface CharacterI

getAnnotId

public java.lang.String getAnnotId()
Description copied from interface: CharacterI
Returns auto generated annot id for character, returns null if dont have one

Specified by:
getAnnotId in interface CharacterI

hasComparison

public boolean hasComparison()
Description copied from interface: CharacterI
Returns true if character is a SUBJECT of a comparison, NOT object in otherwords returns false if getComparison is null

Specified by:
hasComparison in interface CharacterI

getComparisons

public java.util.List<Comparison> getComparisons()
get all comparisons with char as subject

Specified by:
getComparisons in interface CharacterI

getComparisonValueKidList

public java.util.List<CharFieldValue> getComparisonValueKidList()
Returns a list of CharFieldValue comparison kids (not parent CFV)

Specified by:
getComparisonValueKidList in interface CharacterI

getTransferData

public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor)
Returns an object which represents the data to be transferred.

Specified by:
getTransferData in interface java.awt.datatransfer.Transferable

getTransferDataFlavors

public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
Returns an array of DataFlavor objects indicating the flavors the data can be provided in.

Specified by:
getTransferDataFlavors in interface java.awt.datatransfer.Transferable

isDataFlavorSupported

public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
Returns whether or not the specified data flavor is supported for this object

Specified by:
isDataFlavorSupported in interface java.awt.datatransfer.Transferable

hasPub

public boolean hasPub()
According to the CharacterI documentation, the methods below are garbage They are here for backward compatibility - still used in nexus & phenoxml adapter but they should be upgraded to new generic way at some point need to keep in for now

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