edu.iastate.biocyc.dao.txt
Class AbstractBiocycElement

java.lang.Object
  extended by edu.iastate.biocyc.dao.txt.AbstractBiocycElement
All Implemented Interfaces:
BiocycElement
Direct Known Subclasses:
BiocycClass, BiocycCompound, BiocycEnzrxn, BiocycGene, BiocycPathway, BiocycProtein, BiocycReaction

public abstract class AbstractBiocycElement
extends java.lang.Object
implements BiocycElement


Field Summary
(package private)  java.util.Map dataMap
          the attribute value
 
Constructor Summary
AbstractBiocycElement()
          default constructor
AbstractBiocycElement(java.util.Map dataMap)
          default constructor
 
Method Summary
static java.util.Map adjustName(java.util.Map instanceMap)
          adjust the name so it is unique in the whole name space.
abstract  Blockunit createBlockunit(java.lang.String organism, java.lang.String username, java.lang.String source)
          create the blockunit
static java.util.Set duplicatedName(java.util.Map instanceMap)
          collect duplicate common name.
 java.util.Collection getCitationList()
          get the pubmed id list
 java.util.Collection getCommentList()
          get the comment list
 java.lang.String getCommonName()
          get the common name
 java.util.Map getDataMap()
          get the data map
protected  java.lang.Object getFirst(java.util.Map dataMap, java.lang.Object key)
          get first object in the map.
 java.util.Collection getSynonymList()
          get the synonym list
 java.util.Collection getTypeList()
          get the type list
 java.lang.String getUniqueId()
          get the unique id
static boolean isNumeric(java.lang.String str)
          detect if a string is a integer
 Blockunit joinCommonProperties(Blockunit blockunit)
          join common properties like synonyms, comments and references
 Blockunit joinConfidence(Blockunit blockunit)
           
 void setDataMap(java.util.Map dataMap)
          set the data map
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataMap

java.util.Map dataMap
the attribute value

Constructor Detail

AbstractBiocycElement

public AbstractBiocycElement()
default constructor


AbstractBiocycElement

public AbstractBiocycElement(java.util.Map dataMap)
default constructor

Parameters:
dataMap - the attribute value map
Method Detail

setDataMap

public void setDataMap(java.util.Map dataMap)
set the data map

Specified by:
setDataMap in interface BiocycElement
Parameters:
dataMap - data map for all attributes

getUniqueId

public java.lang.String getUniqueId()
get the unique id

Specified by:
getUniqueId in interface BiocycElement
Returns:
the unique id

getCommonName

public java.lang.String getCommonName()
get the common name

Specified by:
getCommonName in interface BiocycElement
Returns:
common name

getFirst

protected java.lang.Object getFirst(java.util.Map dataMap,
                                    java.lang.Object key)
get first object in the map. Used for single value attributes

Parameters:
dataMap - the map
key - the key
Returns:
the first object

getSynonymList

public java.util.Collection getSynonymList()
get the synonym list

Specified by:
getSynonymList in interface BiocycElement
Returns:
synonym list

getTypeList

public java.util.Collection getTypeList()
get the type list

Specified by:
getTypeList in interface BiocycElement
Returns:
type list

getDataMap

public java.util.Map getDataMap()
get the data map

Specified by:
getDataMap in interface BiocycElement
Returns:
the data map

getCommentList

public java.util.Collection getCommentList()
get the comment list

Returns:
the comment list

getCitationList

public java.util.Collection getCitationList()
get the pubmed id list

Returns:
the pubmed id list

duplicatedName

public static java.util.Set duplicatedName(java.util.Map instanceMap)
collect duplicate common name. For these names, we should use unique id in database

Parameters:
instanceMap - the instance map
Returns:
the duplicated name set

adjustName

public static java.util.Map adjustName(java.util.Map instanceMap)
adjust the name so it is unique in the whole name space.

Parameters:
instanceMap - the instance map
Returns:
the new map do not contain duplicated common name

createBlockunit

public abstract Blockunit createBlockunit(java.lang.String organism,
                                          java.lang.String username,
                                          java.lang.String source)
Description copied from interface: BiocycElement
create the blockunit

Specified by:
createBlockunit in interface BiocycElement
Returns:
create the blockunit

joinCommonProperties

public Blockunit joinCommonProperties(Blockunit blockunit)
join common properties like synonyms, comments and references

Parameters:
blockunit - the blockunit to be joined.
Returns:
the new blockunit has joined information

joinConfidence

public Blockunit joinConfidence(Blockunit blockunit)

isNumeric

public static boolean isNumeric(java.lang.String str)
detect if a string is a integer

Parameters:
str - string to detect
Returns:
true if it is numeric, I am not sure the semantic of Character.isDigit()