|
Version: 1.1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.biomoby.shared.MobyData
org.biomoby.shared.MobyPrimaryData
org.biomoby.shared.MobyPrimaryDataSet
org.biomoby.shared.data.MobyDataObjectSet
public class MobyDataObjectSet
This class adds to MobyPrimaryDataSet the ability to get and set instantiated MOBY objects. The MOBY Collection concept that this class embodies is a mathematical bag, i.e. it can contain the same value more than once. This class implements java.util.Collection to facilitate the manipulation of the bag, enforcing that all members of the bag be non-null, MobyDataObject objects. The collection can be empty, but never null. NOTE: The order of members of the collection is meaningless, and may change throughout the life of this object. Do not rely on the order of the items at any time! This class uses a Vector to hold the bag elements and implement most Collection functions.
| Field Summary |
|---|
| Fields inherited from interface org.biomoby.shared.data.MobyDataInstance |
|---|
CENTRAL_XML_MODE, SERVICE_XML_MODE |
| Constructor Summary | |
|---|---|
MobyDataObjectSet(Element e)
|
|
MobyDataObjectSet(Element e,
Registry registry)
|
|
MobyDataObjectSet(String name)
Creates an empty collection bag with a name. |
|
MobyDataObjectSet(String name,
Collection<? extends MobyDataObject> c)
Creates a collection with a name, initializing the members with the members of the given collection. |
|
MobyDataObjectSet(String name,
MobyDataObject[] values)
Creates a collection with a name, initializing the members with the given array. |
|
MobyDataObjectSet(String name,
Registry reg)
|
|
| Method Summary | ||
|---|---|---|
boolean |
add(MobyDataObject mdo)
Add a single MobyDataObject to the collection. |
|
boolean |
addAll(Collection<? extends MobyDataObject> c)
Convenient way to add the input collection of MobyDataObjects (usually a MobyDataObjectSet, or a Vector of MobyDataObjects) to this collection. |
|
void |
addNamespace(MobyNamespace value)
Add given namespace of all elements of this collection. |
|
void |
clear()
Removes all of the MobyDataObject elements from this collection. |
|
MobyDataObjectSet |
clone()
Must be overwritten by a subclass. |
|
boolean |
contains(Object mdsi)
|
|
boolean |
containsAll(Collection c)
|
|
boolean |
equals(Object set)
Compare two MobyDataObject collections. |
|
static Collection<? extends MobyDataObject> |
getChildren(Element e,
Registry registry)
|
|
MobyDataType |
getDataType()
Return the least upper bound parent class of all items in the collection. |
|
MobyDataObject[] |
getElementInstances()
|
|
MobyPrimaryDataSimple[] |
getElements()
|
|
MobyNamespace[] |
getNamespaces()
Return namespaces that occur in all items of the collection. |
|
Object |
getObject()
Each implementer will return the underlying Java object used to store the MOBY value. |
|
int |
getXmlMode()
Report whether toXML will produce Central template or service call instance XML. |
|
int |
hashCode()
Implemented solely because of the general contract that c1.equals(c2) implies that c1.hashCode()==c2.hashCode() |
|
boolean |
isEmpty()
Logically equivalent to size() == 0. |
|
Iterator<MobyDataObject> |
iterator()
|
|
boolean |
remove(Object mdsi)
Removes a single instance of an element from this collection, if it satisfies mdsi.equals(). |
|
boolean |
removeAll(Collection c)
Set theory subtraction operator implementation. |
|
void |
removeNamespace(MobyNamespace value)
Remove given namespace from all elements of this collection. |
|
void |
removeNamespace(String namespaceName)
Remove given namespace (defined by its name) from all elements of this collection. |
|
boolean |
retainAll(Collection c)
Set theory intersection operator implementation. |
|
void |
setElements(MobyDataObject[] values)
Replace whatever is in the collection right now with the values in the input array. |
|
void |
setNamespaces(MobyNamespace[] values)
Set given namespaces of all elements of this collection. |
|
void |
setXmlMode(int mode)
Determined whether toXML will return a Central template value or a service call instance value. |
|
int |
size()
|
|
Object[] |
toArray()
|
|
|
toArray(T[] classArray)
Don't use this method if at all possible. |
|
String |
toXML()
Wraps the simple instances' XML in a MOBY Collection tag |
|
| Methods inherited from class org.biomoby.shared.MobyPrimaryDataSet |
|---|
addElement, format, setDataType, setElements, toString |
| Methods inherited from class org.biomoby.shared.MobyPrimaryData |
|---|
isPrimary |
| Methods inherited from class org.biomoby.shared.MobyData |
|---|
getId, getName, getUserData, setId, setName, 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, setName, setUserData |
| Constructor Detail |
|---|
public MobyDataObjectSet(Element e)
throws MobyException
MobyException
public MobyDataObjectSet(Element e,
Registry registry)
throws MobyException
MobyExceptionpublic MobyDataObjectSet(String name)
public MobyDataObjectSet(String name,
Registry reg)
public MobyDataObjectSet(String name,
MobyDataObject[] values)
throws NullPointerException
values - a set of MobyDataObjects, all from the same registry
NullPointerException - if the input array is null, or contains null elements
public MobyDataObjectSet(String name,
Collection<? extends MobyDataObject> c)
throws ClassCastException,
NullPointerException
c - usually another MobyDataObjectSet, or a Vector of MobyDataObjects, all in the same namespace
ClassCastException - if a member of the input collection is not a MobyDataObject
NullPointerException - if the collection or one of its members is a null object| Method Detail |
|---|
public static Collection<? extends MobyDataObject> getChildren(Element e,
Registry registry)
throws MobyException
MobyExceptionpublic MobyDataObjectSet clone()
MobyPrimaryData
clone in class MobyPrimaryDataSetpublic MobyDataType getDataType()
getDataType in class MobyPrimaryDataSetpublic MobyNamespace[] getNamespaces()
getNamespaces in class MobyPrimaryDataSetpublic void setNamespaces(MobyNamespace[] values)
setNamespaces in class MobyPrimaryDataSetpublic void addNamespace(MobyNamespace value)
addNamespace in class MobyPrimaryDataSetpublic void removeNamespace(String namespaceName)
removeNamespace in class MobyPrimaryDataSetpublic void removeNamespace(MobyNamespace value)
removeNamespace in class MobyPrimaryDataSet
public void setElements(MobyDataObject[] values)
throws NullPointerException
NullPointerException - if the input array is null, or contains null elementspublic Object getObject()
MobyDataInstance
getObject in interface MobyDataInstancepublic MobyPrimaryDataSimple[] getElements()
getElements in class MobyPrimaryDataSetpublic MobyDataObject[] getElementInstances()
public boolean add(MobyDataObject mdo)
throws NullPointerException
add in interface Collection<MobyDataObject>NullPointerException - if the input is a null object
public boolean addAll(Collection<? extends MobyDataObject> c)
throws NullPointerException
addAll in interface Collection<MobyDataObject>NullPointerException - if the collection or one of its members is a null objectpublic void clear()
clear in interface Collection<MobyDataObject>
public boolean contains(Object mdsi)
throws ClassCastException,
NullPointerException
contains in interface Collection<MobyDataObject>ClassCastException - if the input is not a MobyDataObject
NullPointerException - if the input is a null object
public boolean containsAll(Collection c)
throws ClassCastException,
NullPointerException
containsAll in interface Collection<MobyDataObject>ClassCastException - if a member of the input collection is not a MobyDataObject
NullPointerException - if the collection or one of its members is a null object
public boolean equals(Object set)
throws ClassCastException,
NullPointerException
equals in interface Collection<MobyDataObject>equals in class ObjectClassCastException - if the input is not a Collection of MobyDataObjects
NullPointerException - if the input is a null objectpublic int hashCode()
hashCode in interface Collection<MobyDataObject>hashCode in class Objectpublic boolean isEmpty()
isEmpty in interface Collection<MobyDataObject>public Iterator<MobyDataObject> iterator()
iterator in interface Iterable<MobyDataObject>iterator in interface Collection<MobyDataObject>
public boolean remove(Object mdsi)
throws ClassCastException,
NullPointerException
remove in interface Collection<MobyDataObject>mdsi - the MobyDataObject whose value equivalent (not object reference) is to be removed
ClassCastException - if the input is not a MobyDataObject
NullPointerException - if the input is a null object
public boolean removeAll(Collection c)
throws ClassCastException,
NullPointerException
removeAll in interface Collection<MobyDataObject>ClassCastException - if a member of the input collection is not a MobyDataObject
NullPointerException - if the collection or one of its members is a null objectpublic boolean retainAll(Collection c)
retainAll in interface Collection<MobyDataObject>ClassCastException - if a member of the input collection is not a MobyDataObject
NullPointerException - if the collection or one of its members is a null objectpublic int size()
size in interface Collection<MobyDataObject>public Object[] toArray()
toArray in interface Collection<MobyDataObject>
public <T> T[] toArray(T[] classArray)
throws ArrayStoreException,
NullPointerException
toArray in interface Collection<MobyDataObject>ArrayStoreException
NullPointerException
public void setXmlMode(int mode)
throws IllegalArgumentException
setXmlMode in interface MobyDataInstancemode - one of MobyDataInstance.CENTRAL_XML_MODE or MobyDataInstance.SERVICE_XML_MODE
IllegalArgumentException - if the mode is not one of the specified valuespublic int getXmlMode()
getXmlMode in interface MobyDataInstancepublic String toXML()
toXML in interface MobyDataInstancetoXML in class MobyPrimaryDataSet
|
Version: 1.1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||