uk.ac.ebi.miriam.data
Class DataType

java.lang.Object
  extended by uk.ac.ebi.miriam.data.DataType
All Implemented Interfaces:
Serializable, Comparable<Object>

public class DataType
extends Object
implements Comparable<Object>, Serializable

Contains all the information about a MIRIAM data type.

Copyright:
Copyright (C) 2006-2012 BioModels.net (EMBL - European Bioinformatics Institute)
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Version:
20110309
Author:
Camille Laibe
See Also:
Serialized Form

Constructor Summary
DataType()
          Default constructor
 
Method Summary
 void addDeprecatedURI(URI uri)
          Adds a URI to the list of deprecated URIs.
 void addDoc(URI ref)
          Adds another reference to a piece of documentation
 void addResource(Resource res)
          Adds another resource to the data type
 void addSynonym(String synonym)
          Adds a synonym to the list of synonyms.
 void addTag(String tag, String def)
          Adds one tag to the list.
 int compareTo(Object obj)
          Compares to objects and determine whether they are equivalent or not.
 void destroy()
          Destroys the object (free the memory)
 List<String> getDataEntriesPrefix()
          Getter of the prefix of the physical location of all the data entries (one precise element)
 List<String> getDataEntriesSuffix()
          Getter of the suffix of the physical location of all the data entries (one precise element)
 String getDataEntryPrefix(int index)
          Getter of the prefix of the physical location of one data entry (one precise element) WARNING: no check of the validity of the parameter ('out of range' possible...)
 String getDataEntrySuffix(int index)
          Getter of the suffix of the physical location of one data entry (one precise element)
 String getDataResource(int index)
          Getter of the physical location of one precise resource (information page)
 List<String> getDataResources()
          Getter of the physical locations of all the resources (information page)
 Date getDateCreation()
          Getter of the date (Date) of creation of the data type
 Date getDateModification()
          Getter of the date (Date) of last modification of the data type
 String getDefinition()
          Getter of the definition of the data type
 URI getDeprecatedURI(int i)
          Returns one precise deprecated URI of the data type
 List<URI> getDeprecatedURIs()
          Returns all the deprecated URIs of the data type
 URI getDoc(int index)
          Getter of a specific reference to a piece of documentation
 List<URI> getDocs()
          Getter
 String getId()
          Getter of the stable ID (in the database) of the data type
 String getName()
          Getter of the official name (not a synonym) of the data type
 String getObsoleteComment()
          Getter
 String getRegexp()
          Getter of the regular expression of the data type
 String getReplacedBy()
          Getter
 Resource getResource(int index)
          Getter of a specific resource (physical location) of the data type
 List<Resource> getResources()
          Getter of the resources (physical locations) of the data type
 String getSynonym(int i)
          Getter of one of the synonyms of the name of the data type
 List<String> getSynonyms()
          Getter of the synonyms of the name of the data type
 Map<String,String> getTags()
          Getter
 URI getURN()
          Getter of the official URN of the data type
 boolean hasOfficialResource()
          Checks if the data type has (at least) one resource is official (there is at least one resource and the resources are not all deprecated)
 boolean isObsolete()
          Getter
 void setDateCreation(Date dateCreation)
          Setter of the date (Date) of creation of the data type
 void setDateModification(Date dateModification)
          Setter of the date (Date) of last modification of the data type
 void setDefinition(String definition)
          Setter of the definition of the data type
 void setDeprecatedURIs(List<URI> deprecatedURIs)
          Setter of the deprecated forms of the URI (URN or URL) of the data type
 void setDocs(List<URI> docs)
          Setter
 void setId(String id)
          Setter of the internal ID (in the database) of the data type
 void setName(String name)
          Setter of the official name of the data type
 void setObsolete(boolean obsolete)
          Setter
 void setObsolete(int obsolete)
          Setter (from int)
 void setObsoleteComment(String obsoleteComment)
          Setter
 void setRegexp(String regexp)
          Setter of the regular expression of the data type
 void setReplacedBy(String replacedBy)
          Setter
 void setResources(List<Resource> resources)
          Setter of the resources (physical locations) of the data type
 void setSynonyms(List<String> synonyms)
          Setter of the synonyms of the data type
 void setTags(Map<String,String> tags)
          Setter
 void setURN(String urn)
          Setter of the official URN of the data type Warning: if the URI is actually a URL, its type will be 'URL'!
 void setURN(URI urn)
          Setter of the official URN of the data type
 String toString()
          Overrides the 'toString()' method for the 'DataType' object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataType

public DataType()
Default constructor

Method Detail

destroy

public void destroy()
Destroys the object (free the memory)


toString

public String toString()
Overrides the 'toString()' method for the 'DataType' object

Overrides:
toString in class Object
Returns:
a string which contains all the information about the data type

compareTo

public int compareTo(Object obj)
Compares to objects and determine whether they are equivalent or not. Mandatory method for the class to be able to implement 'Comparable'

WARNING: the test only uses the identifier of the DataType object!

Specified by:
compareTo in interface Comparable<Object>
Parameters:
obj - an unknown object
Returns:
0 if the two objects are the same

getDefinition

public String getDefinition()
Getter of the definition of the data type

Returns:
definition of the data type

setDefinition

public void setDefinition(String definition)
Setter of the definition of the data type

Parameters:
definition - definition of the data type

getDeprecatedURIs

public List<URI> getDeprecatedURIs()
Returns all the deprecated URIs of the data type

Returns:
all the deprecated URIs of the data type

getDeprecatedURI

public URI getDeprecatedURI(int i)
Returns one precise deprecated URI of the data type

Parameters:
i - index of the deprecated URI
Returns:
one precise deprecated URI of the data type

setDeprecatedURIs

public void setDeprecatedURIs(List<URI> deprecatedURIs)
Setter of the deprecated forms of the URI (URN or URL) of the data type

Parameters:
deprecatedURIs - list of all the deprecated URI of the data type

addDeprecatedURI

public void addDeprecatedURI(URI uri)
Adds a URI to the list of deprecated URIs.

Parameters:
uri - deprecated URI to add

getId

public String getId()
Getter of the stable ID (in the database) of the data type

Returns:
the internal ID of the data type

setId

public void setId(String id)
Setter of the internal ID (in the database) of the data type

Parameters:
id - internal ID of the data type

getName

public String getName()
Getter of the official name (not a synonym) of the data type

Returns:
name of the data type

setName

public void setName(String name)
Setter of the official name of the data type

Parameters:
name - name of the data type

getRegexp

public String getRegexp()
Getter of the regular expression of the data type

Returns:
regular expression of the data type

setRegexp

public void setRegexp(String regexp)
Setter of the regular expression of the data type

Parameters:
regexp - regular expression of the data type

getSynonyms

public List<String> getSynonyms()
Getter of the synonyms of the name of the data type

Returns:
list of all the synonyms of the name of the data type

getSynonym

public String getSynonym(int i)
Getter of one of the synonyms of the name of the data type

Parameters:
i - index of the synonym
Returns:
one precise synonym of the name of the data type

setSynonyms

public void setSynonyms(List<String> synonyms)
Setter of the synonyms of the data type

Parameters:
synonyms - list of all the synonyms of the data type

addSynonym

public void addSynonym(String synonym)
Adds a synonym to the list of synonyms.

Parameters:
synonym - to add

getURN

public URI getURN()
Getter of the official URN of the data type

Returns:
URN of the data type

setURN

public void setURN(URI urn)
Setter of the official URN of the data type

Parameters:
urn - URN of the data type

setURN

public void setURN(String urn)
Setter of the official URN of the data type Warning: if the URI is actually a URL, its type will be 'URL'!

Parameters:
urn - URN of the data type

getResources

public List<Resource> getResources()
Getter of the resources (physical locations) of the data type

Returns:
the resources of the data type

getResource

public Resource getResource(int index)
Getter of a specific resource (physical location) of the data type

Parameters:
index -
Returns:
a precise resource of the data type

setResources

public void setResources(List<Resource> resources)
Setter of the resources (physical locations) of the data type

Parameters:
resources - list of the resources of the data type

addResource

public void addResource(Resource res)
Adds another resource to the data type

Parameters:
res - the new resource to add to the data type

getDocs

public List<URI> getDocs()
Getter

Returns:
the docs

getDoc

public URI getDoc(int index)
Getter of a specific reference to a piece of documentation

Parameters:
index -
Returns:
URI of a piece of documentation

setDocs

public void setDocs(List<URI> docs)
Setter

Parameters:
docs - the docs to set

addDoc

public void addDoc(URI ref)
Adds another reference to a piece of documentation

Parameters:
ref - the new reference to a doc to add

setTags

public void setTags(Map<String,String> tags)
Setter

Parameters:
tags - the tags to set

addTag

public void addTag(String tag,
                   String def)
Adds one tag to the list.

Parameters:
tag - tag to add
def - definition of the tag

getTags

public Map<String,String> getTags()
Getter

Returns:
the tags

getDataEntriesPrefix

public List<String> getDataEntriesPrefix()
Getter of the prefix of the physical location of all the data entries (one precise element)

Returns:
the prefix of the physical location of all the data entries

getDataEntryPrefix

public String getDataEntryPrefix(int index)
Getter of the prefix of the physical location of one data entry (one precise element)

WARNING: no check of the validity of the parameter ('out of range' possible...)

Parameters:
index - index of the resource
Returns:
the prefix of the physical location of one precise the data entry

getDataEntriesSuffix

public List<String> getDataEntriesSuffix()
Getter of the suffix of the physical location of all the data entries (one precise element)

Returns:
the suffix of the physical location of all the data entries

getDataEntrySuffix

public String getDataEntrySuffix(int index)
Getter of the suffix of the physical location of one data entry (one precise element)

Parameters:
index - index of the resource
Returns:
the suffix of the physical location of one precise the data entry

getDataResources

public List<String> getDataResources()
Getter of the physical locations of all the resources (information page)

Returns:
the physical locations of all the resources

getDataResource

public String getDataResource(int index)
Getter of the physical location of one precise resource (information page)

Parameters:
index - index of the resource
Returns:
the physical location of one precise resource

getDateCreation

public Date getDateCreation()
Getter of the date (Date) of creation of the data type

Returns:
dateCreation date of creation of the data type

setDateCreation

public void setDateCreation(Date dateCreation)
Setter of the date (Date) of creation of the data type

Parameters:
dateCreation - date of creation of the data type

getDateModification

public Date getDateModification()
Getter of the date (Date) of last modification of the data type

Returns:
date of last modification of the data type

setDateModification

public void setDateModification(Date dateModification)
Setter of the date (Date) of last modification of the data type

Parameters:
dateModification - date of last modification of the data type

hasOfficialResource

public boolean hasOfficialResource()
Checks if the data type has (at least) one resource is official (there is at least one resource and the resources are not all deprecated)

Returns:
a boolean which says if the data type has (at least) one official resource

isObsolete

public boolean isObsolete()
Getter

Returns:
the obsolete

setObsolete

public void setObsolete(boolean obsolete)
Setter

Parameters:
obsolete - the obsolete to set

setObsolete

public void setObsolete(int obsolete)
Setter (from int)

Parameters:
obsolete - the obsolete to set

getReplacedBy

public String getReplacedBy()
Getter

Returns:
the replacedBy

setReplacedBy

public void setReplacedBy(String replacedBy)
Setter

Parameters:
replacedBy - the replacedBy to set

getObsoleteComment

public String getObsoleteComment()
Getter

Returns:
the obsolete comment

setObsoleteComment

public void setObsoleteComment(String obsoleteComment)
Setter

Parameters:
obsoleteComment - the obsolete comment to set


BioModels.net, EMBL-EBI - Feb 2012