|
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.MobyData org.biomoby.shared.MobyPrimaryData org.biomoby.shared.MobyPrimaryDataSimple org.biomoby.shared.data.MobyDataObject org.biomoby.shared.data.MobyDataComposite
public class MobyDataComposite
This is the class that represents any non-primitive object instance (i.e. anything except object, boolean, integer, float, date-time, or string) from the MOBY data type ontology. The members of the composite object are stored in a Java Map, and can be either primitives, or other composites. This class implements the ConcurrentMap interface to allow for the easy editing of a composite object's members at runtime.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Field Summary |
---|
Fields inherited from interface org.biomoby.shared.data.MobyDataInstance |
---|
CENTRAL_XML_MODE, SERVICE_XML_MODE |
Constructor Summary | |
---|---|
MobyDataComposite(Element element)
Construct the object using a DOM fragment. |
|
MobyDataComposite(Element element,
Registry registry)
|
|
MobyDataComposite(MobyDataType type)
|
|
MobyDataComposite(MobyDataType type,
MobyNamespace namespace,
String id,
Object... memberStrings)
Instantiates a composite with a variable number of members using Java 1.5's varargs. |
|
MobyDataComposite(MobyDataType type,
String name)
|
|
MobyDataComposite(MobyDataType type,
String name,
MobyNamespace namespace,
String id)
|
|
MobyDataComposite(MobyDataType type,
String name,
String namespace,
String id)
|
|
MobyDataComposite(String typeName)
|
|
MobyDataComposite(String typeName,
Registry r)
|
|
MobyDataComposite(String typeName,
String name)
|
|
MobyDataComposite(String typeName,
String name,
Registry r)
|
|
MobyDataComposite(String typeName,
String name,
String namespace,
String id)
Only call this constructor if you are sure that the data type name is in the ontology, otherwise the datatype will be null. |
|
MobyDataComposite(String typeName,
String name,
String namespace,
String id,
Registry registry)
|
Method Summary | |
---|---|
void |
clear()
Effectively deletes the composite, leaving you with a blank base object |
MobyDataComposite |
clone()
Simply calls new constructor with object's existing data type, name and value. |
boolean |
containsKey(Object fieldName)
To check for the presence of a field with a given name |
boolean |
containsValue(Object value)
To check for the presence of a value in one of the members (e.g Integer, Float, String, Calendar) |
Set<Map.Entry<String,MobyDataObject>> |
entrySet()
Retrieves each field name/MobyDataObject pair for the members of the composite object |
boolean |
equals(Object o)
Returns true if and only if both objects have the same fields with the same values, and the same object ID |
MobyDataObject |
get(Object fieldName)
Retrieves a member of the composite with a given field name. |
Object |
getObject()
Gives access to the Java object instance underlying the MobyData instance. |
int |
hashCode()
|
boolean |
isEmpty()
Is this a blank, uninstantiated object? |
boolean |
isObjectValid()
Report whether all required fields for the object's datatype have been instantiated (i.e. the object is ready to use as input to a service). |
Set<String> |
keySet()
Retrieves a list of the field names in this object |
MobyDataObject |
put(String fieldName,
MobyDataObject value)
Add a field to the composite. |
void |
putAll(Map<? extends String,? extends MobyDataObject> map)
Sets a number of object fields at once. |
MobyDataObject |
putIfAbsent(String key,
MobyDataObject value)
|
MobyDataObject |
remove(Object fieldName)
Removes the field with the given name, if present |
boolean |
remove(Object key,
Object value)
|
MobyDataObject |
replace(String fieldName,
MobyDataObject value)
|
boolean |
replace(String fieldName,
MobyDataObject oldValue,
MobyDataObject newValue)
|
int |
size()
Reports the number of data members in the composite object |
String |
toXML()
Produces a full-blown XML fragment that depending on the value of getXmlMode() is either a template for use in MOBY Central services, or a Simple element for use in calling a service instance. |
Collection<MobyDataObject> |
values()
For the user's convenience, the returned Collection is a MobyDataSetInstance, allowing for MOBY-savvy equivalency testing with another Collection of data instances. |
Methods inherited from class org.biomoby.shared.data.MobyDataObject |
---|
addCrossReference, addCrossReferences, addCrossReferences, addProvisionInfo, compareTo, createInstanceFromDOM, createInstanceFromDOM, createInstanceFromString, createInstanceFromString, createInstanceFromXML, getCrossReferences, getId, getName, getPrimaryNamespace, getProvisionInfo, getTextContents, getValue, getXmlMode, hasCrossReferences, setId, setName, setPrimaryNamespace, setProvisionInfo, setXmlMode, toString |
Methods inherited from class org.biomoby.shared.MobyPrimaryDataSimple |
---|
addNamespace, format, getDataType, getNamespaces, removeNamespace, removeNamespace, setDataType, setNamespaces |
Methods inherited from class org.biomoby.shared.MobyPrimaryData |
---|
isPrimary |
Methods inherited from class org.biomoby.shared.MobyData |
---|
getId, getName, getUserData, setUserData |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.biomoby.shared.data.MobyDataInstance |
---|
getName, getUserData, setUserData |
Constructor Detail |
---|
public MobyDataComposite(Element element) throws MobyException
MobyException
- if the element is not a MobyObject tagpublic MobyDataComposite(Element element, Registry registry) throws MobyException
MobyException
public MobyDataComposite(MobyDataType type, String name, MobyNamespace namespace, String id)
public MobyDataComposite(MobyDataType type, String name, String namespace, String id)
public MobyDataComposite(String typeName, String name, String namespace, String id)
public MobyDataComposite(String typeName, String name, String namespace, String id, Registry registry)
public MobyDataComposite(MobyDataType type, MobyNamespace namespace, String id, Object... memberStrings) throws IllegalArgumentException, MobyException
memberStrings
- an even number of strings, representing name, object, name, object, ...
IllegalArgumentException
- if an odd number of memberStrings is provided
MobyException
- if one of the values provided cannot be cast into the required type according to the DataType definition for the composite, or if a required member is missing.public MobyDataComposite(MobyDataType type, String name)
public MobyDataComposite(String typeName, String name)
public MobyDataComposite(String typeName, String name, Registry r)
public MobyDataComposite(MobyDataType type)
public MobyDataComposite(String typeName)
public MobyDataComposite(String typeName, Registry r)
Method Detail |
---|
public MobyDataComposite clone()
MobyDataObject
clone
in class MobyDataObject
public boolean isObjectValid()
public String toXML()
MobyDataObject
toXML
in interface MobyDataInstance
toXML
in class MobyDataObject
public Object getObject()
MobyDataObject
getObject
in interface MobyDataInstance
getObject
in class MobyDataObject
public void clear()
clear
in interface Map<String,MobyDataObject>
public boolean containsKey(Object fieldName)
containsKey
in interface Map<String,MobyDataObject>
public boolean containsValue(Object value)
containsValue
in interface Map<String,MobyDataObject>
public Set<Map.Entry<String,MobyDataObject>> entrySet()
entrySet
in interface Map<String,MobyDataObject>
public boolean equals(Object o)
equals
in interface Map<String,MobyDataObject>
equals
in class MobyDataObject
public MobyDataObject get(Object fieldName)
get
in interface Map<String,MobyDataObject>
public int hashCode()
hashCode
in interface Map<String,MobyDataObject>
hashCode
in class Object
public boolean isEmpty()
isEmpty
in interface Map<String,MobyDataObject>
public Set<String> keySet()
keySet
in interface Map<String,MobyDataObject>
public MobyDataObject put(String fieldName, MobyDataObject value)
put
in interface Map<String,MobyDataObject>
public void putAll(Map<? extends String,? extends MobyDataObject> map)
putAll
in interface Map<String,MobyDataObject>
public MobyDataObject remove(Object fieldName)
remove
in interface Map<String,MobyDataObject>
public int size()
size
in interface Map<String,MobyDataObject>
public Collection<MobyDataObject> values()
values
in interface Map<String,MobyDataObject>
public MobyDataObject putIfAbsent(String key, MobyDataObject value)
putIfAbsent
in interface ConcurrentMap<String,MobyDataObject>
public boolean remove(Object key, Object value)
remove
in interface ConcurrentMap<String,MobyDataObject>
public MobyDataObject replace(String fieldName, MobyDataObject value)
replace
in interface ConcurrentMap<String,MobyDataObject>
public boolean replace(String fieldName, MobyDataObject oldValue, MobyDataObject newValue)
replace
in interface ConcurrentMap<String,MobyDataObject>
|
Version: 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |