|
Version: 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.biomoby.shared.MobyDataType
public class MobyDataType
A container representing a data type used in the Moby registry (in the BioMoby speak it is called "Object Class"). The Moby data types are used to specify what types of inputs and outputs are needed or produced by Moby services.
This container is used mainly to register a new data type into a Moby registry, and to find services with this particular input or output data type.
Field Summary | |
---|---|
static String |
DUMMY_NAME
A dummy name used for MobyDataType instances that do not have (yet) a real name. |
Constructor Summary | |
---|---|
MobyDataType()
Default constructor. |
|
MobyDataType(String name)
Normal constructor. |
Method Summary | |
---|---|
void |
addChild(MobyRelationship child)
|
void |
addChild(String name,
String typeName,
int relationshipType)
Create a MobyRelationship object from
given parameters and add it as a new child. |
void |
addParentName(String value)
Add one parent of this data type. |
int |
compareTo(MobyDataType obj)
|
boolean |
equals(Object obj)
|
String |
format(int indent)
|
MobyRelationship[] |
getAllChildren()
Returns all HAS/HASA children for this object and all of its parent classes. |
String |
getAuthority()
Return an authority for this data type. |
static Comparator |
getAuthorityComparator()
Create a comparator for case-insensitive sorting of data types by their authorities. |
MobyRelationship |
getChild(String fieldName)
Returns the HAS/HASA child with the given name (if it exists) for this object or any of its parent classes. |
MobyRelationship[] |
getChildren()
Return children of this data type, and the way how they are ontologically related to this data type. |
String |
getComment()
Return a comment that is attached to this instance. |
static MobyDataType |
getDataType(String className)
|
static MobyDataType |
getDataType(String className,
Registry reg)
Retrieves a datatype object from the registry's ontology. |
String |
getDescription()
Return a (usually) human readable description of this data type. |
String |
getEmailContact()
Return a contact email. |
String |
getId()
Return an ID that is given to this data type during its registration. |
MobyDataType[] |
getLineage()
A convenience method for retrieving the entire inheritance tree for this MOBY object class. |
String |
getLSID()
Return LSID representing this data type definition. |
String |
getName()
|
MobyDataType |
getParent()
|
String |
getParentName()
Return the first parent name (at the moment the only one set and used, anyway. |
String[] |
getParentNames()
Return names of all parental data types (as stored in the BioMoby class ontology). |
Registry |
getRegistry()
|
boolean |
inheritsFrom(MobyDataType otherType)
Searches the ontology lineage of the current data type against the provided type. |
boolean |
inheritsFrom(String otherTypeName)
Searches the ontology lineage of the current data type against the data type corresponding to the provided name. |
void |
setAuthority(String value)
|
void |
setChildren(MobyRelationship[] value)
|
void |
setComment(String value)
|
void |
setDescription(String value)
|
void |
setEmailContact(String value)
|
void |
setId(String value)
|
void |
setLSID(String value)
|
void |
setName(String value)
|
void |
setParentNames(String[] value)
|
void |
setRegistry(Registry r)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String DUMMY_NAME
Constructor Detail |
---|
public MobyDataType()
public MobyDataType(String name)
name
- of this data type (e.g. GenericSequence, or
String). The name can be either a simple string (e.g. Object),
or a full-blown LSID
(e.g. urn:lsid:biomoby.org:objectclass:Object).Method Detail |
---|
public int compareTo(MobyDataType obj)
compareTo
in interface Comparable<MobyDataType>
public boolean equals(Object obj)
equals
in class Object
public void setRegistry(Registry r)
public Registry getRegistry()
public static MobyDataType getDataType(String className)
public static MobyDataType getDataType(String className, Registry reg)
public String getName()
public void setName(String value)
public String getId()
public void setId(String value)
getId()
public String getAuthority()
public void setAuthority(String value)
getAuthority()
public String getEmailContact()
public void setEmailContact(String value)
getEmailContact()
public String getDescription()
public void setDescription(String value)
getDescription()
public String getLSID()
getLSID
in interface LSIDAccessible
public void setLSID(String value)
getLSID()
public String[] getParentNames()
public String getParentName()
getParentNames()
.
public MobyDataType getParent()
public MobyDataType[] getLineage()
public void setParentNames(String[] value)
value
- is a set of parent names (usually just one name,
however). If it is null all parents set previously are
forgotten.getParentNames()
public void addParentName(String value)
value
- is a name of a parental data type. A null value is
ignored.getParentNames()
public MobyRelationship[] getChildren()
Note that it does not return children that belong to the parent types - in other words it does not go up through the whole ontology tree to find all children.
Central.iHAS
,
Central.iHASA
public MobyRelationship[] getAllChildren()
public MobyRelationship getChild(String fieldName)
public boolean inheritsFrom(String otherTypeName)
public boolean inheritsFrom(MobyDataType otherType)
public void setChildren(MobyRelationship[] value)
value
- is an array of children. If it is null all
children set previously are forgotten.getChildren()
public void addChild(MobyRelationship child)
child
- a new child to be added. If null it is ignored.getChildren()
public void addChild(String name, String typeName, int relationshipType)
MobyRelationship
object from
given parameters and add it as a new child.
name
- is a name how the new child is known to this data
type (an "article name" in the BioMoby speak),
e.g. 'length'. Because of the backward compatibility it accepts
also a null or empty string here - but according to the BioMoby
API (0.8) this name should be always given.typeName
- is a name of the child data type,
e.g. 'Integer'. If it is null it is ignored.relationshipType
- is either HASA
or HAS
. If it is something
else it is silenty changed to HASA
.getChildren()
public String toString()
toString
in class Object
public String format(int indent)
public String getComment()
toString()
method). It is for developers doing various tricks with these
instances.
public void setComment(String value)
getComment()
public static Comparator getAuthorityComparator()
|
Version: 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |