phenote.datamodel
Class CharFieldValue

java.lang.Object
  extended by phenote.datamodel.CharFieldValue
All Implemented Interfaces:
java.lang.Cloneable

public class CharFieldValue
extends java.lang.Object
implements java.lang.Cloneable

At the moment char field values can be Strings, OBOClasses, and dates, and possibly more coming. This class attempts to hide the details of the actual data structure of the value for the field - could be String or OBOClass but can still deal with both the same - at least thats the idea... post composition brings up some interesting issues...??? CharField is the generic field, CharFieldValue is an actual instance of data within the CharField - in a Character


Constructor Summary
CharFieldValue(Comparison comp)
           
CharFieldValue(java.util.Date d, CharacterI c, CharField cf)
           
CharFieldValue(org.obo.datamodel.OBOClass o, CharacterI c, CharField cf)
          SINGLE VALUE term/class - not list
CharFieldValue(java.lang.String value, CharacterI c, CharField cf)
           
 
Method Summary
 void addKid(CharFieldValue kid)
           
 CharFieldValue cloneCharFieldValue()
           
 CharFieldValue cloneCharFieldValue(CharacterI newCharacter, CharField newField)
           
 CharFieldValue cloneValueForChar(CharacterI newChar)
           
 void editModel()
           
static CharFieldValue emptyValue(CharacterI c, CharField cf)
           
 boolean equals(java.lang.Object o)
          returns true if the actual values are equal.
 CharacterI getCharacter()
           
 CharField getCharField()
           
 java.util.List<CharFieldValue> getCharFieldValueList()
           
 java.util.List<Comparison> getComparisonList()
          From cfv comparison parent
 java.util.Date getDate()
           
 java.lang.String getID()
          convenience fn
 CharFieldValue getKidWithSameValue(CharFieldValue val)
          return kid that has same value/class/string as val.
 java.lang.String getName()
           
 org.obo.datamodel.OBOClass getOboClass()
           
 org.obo.datamodel.OBOClass getTerm()
           
 java.lang.String getValueAsString()
           
 java.util.List<CharFieldValue> getValuePickList()
           
 int hashCode()
           
 boolean hasKid(CharFieldValue kid)
          uses contains which uses equals, which tests the value/term/string in CharFieldValue, NOT if its the same CharFieldValue object! so if CFV with same term but different Character will be true
 boolean hasObject(org.obo.datamodel.OBOObject obj)
          an OBOObject can be an OBOClass or an OBOProperty and other obo thingies return true if is term and obj is oboClassValue using oboObject instead of OBOClass so can use same method for other obo objects
 void insertKid(int index, CharFieldValue kid)
           
 boolean isComparison()
           
 boolean isCompound()
           
 boolean isDangler()
           
 boolean isDate()
           
 boolean isEmpty()
           
 boolean isPickList()
           
 boolean isTerm()
           
(package private) static CharFieldValue makeDate(java.lang.String dateString, CharacterI c, CharField cf)
          dateString is a date, if not valid date throws ParseEx
static CharFieldValue makeListParentValue(CharacterI c, CharField cf)
           
static CharFieldValue makeNewValue(CharFieldValue newValue, CharFieldValue oldValue)
          If list adds to value, if not list just sets it, makes new CFV This is used by CharacterListFieldGui (for template) but i dont understand how it works for lists - newList and newValue never seem to connect - jim???
static CharFieldValue makeNewValue(org.obo.datamodel.OBOClass o, CharFieldValue oldVal)
          If list adds to value, if not list just sets it, makes new CFV
static CharFieldValue makeNewValue(java.lang.String newString, CharFieldValue oldVal)
          If list adds to value, if not list just sets it, makes new CFV
 void removeAllKids()
           
 void removeKid(CharFieldValue kid)
          Remove "kid" from kid list
(package private)  void setCharacter(CharacterI c)
          set selfs character as well as kids/list(recurse)
 void setIsList(boolean isList)
           
 void setName(java.lang.String name)
          this is used for danglers on loading data
 void setOverridePickList(boolean flag)
           
 java.lang.String toString()
           
 org.obo.datamodel.OBOClass toTerm()
          if cfv is a term just returns it, returns null if doesnt have term, otherwise makes a dangling term out of its value, string or date or whatnot
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CharFieldValue

public CharFieldValue(java.lang.String value,
                      CharacterI c,
                      CharField cf)

CharFieldValue

public CharFieldValue(org.obo.datamodel.OBOClass o,
                      CharacterI c,
                      CharField cf)
SINGLE VALUE term/class - not list


CharFieldValue

public CharFieldValue(Comparison comp)

CharFieldValue

public CharFieldValue(java.util.Date d,
                      CharacterI c,
                      CharField cf)
Method Detail

makeListParentValue

public static CharFieldValue makeListParentValue(CharacterI c,
                                                 CharField cf)

makeNewValue

public static CharFieldValue makeNewValue(org.obo.datamodel.OBOClass o,
                                          CharFieldValue oldVal)
If list adds to value, if not list just sets it, makes new CFV


makeNewValue

public static CharFieldValue makeNewValue(java.lang.String newString,
                                          CharFieldValue oldVal)
If list adds to value, if not list just sets it, makes new CFV


makeNewValue

public static CharFieldValue makeNewValue(CharFieldValue newValue,
                                          CharFieldValue oldValue)
If list adds to value, if not list just sets it, makes new CFV This is used by CharacterListFieldGui (for template) but i dont understand how it works for lists - newList and newValue never seem to connect - jim???


setIsList

public void setIsList(boolean isList)

setOverridePickList

public void setOverridePickList(boolean flag)

getCharFieldValueList

public java.util.List<CharFieldValue> getCharFieldValueList()

makeDate

static CharFieldValue makeDate(java.lang.String dateString,
                               CharacterI c,
                               CharField cf)
                        throws java.text.ParseException
dateString is a date, if not valid date throws ParseEx

Throws:
java.text.ParseException

cloneCharFieldValue

public CharFieldValue cloneCharFieldValue()

cloneValueForChar

public CharFieldValue cloneValueForChar(CharacterI newChar)

cloneCharFieldValue

public CharFieldValue cloneCharFieldValue(CharacterI newCharacter,
                                          CharField newField)

emptyValue

public static CharFieldValue emptyValue(CharacterI c,
                                        CharField cf)

setCharacter

void setCharacter(CharacterI c)
set selfs character as well as kids/list(recurse)


getCharacter

public CharacterI getCharacter()

isEmpty

public boolean isEmpty()

getName

public java.lang.String getName()

getValueAsString

public java.lang.String getValueAsString()

setName

public void setName(java.lang.String name)
this is used for danglers on loading data


getID

public java.lang.String getID()
convenience fn


isDate

public boolean isDate()

getDate

public java.util.Date getDate()

isPickList

public boolean isPickList()

isComparison

public boolean isComparison()

getComparisonList

public java.util.List<Comparison> getComparisonList()
From cfv comparison parent


isCompound

public boolean isCompound()

getValuePickList

public java.util.List<CharFieldValue> getValuePickList()

getOboClass

public org.obo.datamodel.OBOClass getOboClass()

isTerm

public boolean isTerm()

getTerm

public org.obo.datamodel.OBOClass getTerm()

hasObject

public boolean hasObject(org.obo.datamodel.OBOObject obj)
an OBOObject can be an OBOClass or an OBOProperty and other obo thingies return true if is term and obj is oboClassValue using oboObject instead of OBOClass so can use same method for other obo objects


editModel

public void editModel()

addKid

public void addKid(CharFieldValue kid)

insertKid

public void insertKid(int index,
                      CharFieldValue kid)

removeKid

public void removeKid(CharFieldValue kid)
Remove "kid" from kid list


removeAllKids

public void removeAllKids()

hasKid

public boolean hasKid(CharFieldValue kid)
uses contains which uses equals, which tests the value/term/string in CharFieldValue, NOT if its the same CharFieldValue object! so if CFV with same term but different Character will be true


getKidWithSameValue

public CharFieldValue getKidWithSameValue(CharFieldValue val)
return kid that has same value/class/string as val. if none return null


getCharField

public CharField getCharField()

isDangler

public boolean isDangler()

toTerm

public org.obo.datamodel.OBOClass toTerm()
if cfv is a term just returns it, returns null if doesnt have term, otherwise makes a dangling term out of its value, string or date or whatnot


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
returns true if the actual values are equal. 1st of all o must be a CharFieldValue. then tests for equality of of value, that is term,string, list items, .... So CharFieldValues from 2 different characters with same obo class are equal

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object