Version: 1.1.1

org.biomoby.shared.data
Class MobyDataObjectVector

java.lang.Object
  extended by org.biomoby.shared.MobyData
      extended by org.biomoby.shared.MobyPrimaryData
          extended by org.biomoby.shared.MobyPrimaryDataSimple
              extended by org.biomoby.shared.data.MobyDataObject
                  extended by org.biomoby.shared.data.MobyDataObjectVector
All Implemented Interfaces:
Cloneable, Comparable, Iterable<MobyDataObject>, Collection<MobyDataObject>, List<MobyDataObject>, MobyDataInstance

public class MobyDataObjectVector
extends MobyDataObject
implements List<MobyDataObject>

This class is primarily intended for use by MobyDataComposite to represent Object members in the HAS (1-to-many) relationship. Not all MobyDataObject behaviours are well defined for this object, but should rather be called on its members. If you are looking to represent a MOBY XML Collection please see MobyDataObjectSet.


Field Summary
 
Fields inherited from interface org.biomoby.shared.data.MobyDataInstance
CENTRAL_XML_MODE, SERVICE_XML_MODE
 
Constructor Summary
MobyDataObjectVector(String name)
          Builds a vector with an initial capacity of 5.
MobyDataObjectVector(String name, int initialCapacity)
           
MobyDataObjectVector(String name, int initialCapacity, Registry registry)
           
MobyDataObjectVector(String name, Registry registry)
           
 
Method Summary
 void add(int index, MobyDataObject mdo)
          Inserts the specified element at the specified position in this list.
 boolean add(MobyDataObject mdo)
          Add an object to the list.
 boolean addAll(Collection<? extends MobyDataObject> c)
          Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator.
 boolean addAll(int index, Collection<? extends MobyDataObject> c)
          Inserts all of the elements in the specified collection into this list at the specified position.
 void clear()
          Removes all of the elements from this list.
 boolean contains(Object o)
          Returns true if this list contains the specified element.
 boolean containsAll(Collection c)
          Returns true if this list contains all of the elements of the specified collection.
 boolean equals(Object o)
          Compares the specified object with this list for equality.
 MobyDataObject get(int index)
          Returns the element at the specified position in this list.
 int hashCode()
          Returns the hash code value for this list.
 int indexOf(Object o)
          Returns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element.
 boolean isEmpty()
           
 Iterator<MobyDataObject> iterator()
          Returns an iterator over the elements in this list in proper sequence.
 int lastIndexOf(Object o)
          Returns the index in this list of the last occurrence of the specified element, or -1 if this list does not contain this element.
 ListIterator<MobyDataObject> listIterator()
          Returns a list iterator of the elements in this list (in proper sequence).
 ListIterator<MobyDataObject> listIterator(int index)
          Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in this list.
 MobyDataObject remove(int index)
          Removes the element at the specified position in this list (optional operation).
 boolean remove(Object o)
          Removes the first occurrence in this list of the specified element.
 boolean removeAll(Collection c)
          Removes from this list all the elements that are contained in the specified collection.
 boolean retainAll(Collection c)
          Retains only the elements in this list that are contained in the specified collection (optional operation).
 MobyDataObject set(int index, MobyDataObject element)
          Replaces the element at the specified position in this list with the specified element (optional operation).
 int size()
          Returns the number of elements in this list.
 List<MobyDataObject> subList(int fromIndex, int toIndex)
          Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.
 Object[] toArray()
          Returns an array containing all of the elements in this list in proper sequence.
<T> T[]
toArray(T[] a)
           
 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.
 
Methods inherited from class org.biomoby.shared.data.MobyDataObject
addCrossReference, addCrossReferences, addCrossReferences, addProvisionInfo, clone, compareTo, createInstanceFromDOM, createInstanceFromDOM, createInstanceFromString, createInstanceFromString, createInstanceFromXML, getCrossReferences, getId, getName, getObject, 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

MobyDataObjectVector

public MobyDataObjectVector(String name)
Builds a vector with an initial capacity of 5.


MobyDataObjectVector

public MobyDataObjectVector(String name,
                            Registry registry)

MobyDataObjectVector

public MobyDataObjectVector(String name,
                            int initialCapacity)

MobyDataObjectVector

public MobyDataObjectVector(String name,
                            int initialCapacity,
                            Registry registry)
Method Detail

toXML

public String toXML()
Description copied from class: MobyDataObject
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.

Specified by:
toXML in interface MobyDataInstance
Overrides:
toXML in class MobyDataObject
Returns:
the MOBY XML representation of the data instance

add

public boolean add(MobyDataObject mdo)
Add an object to the list. If the object is another MobyDataObjectVector, the list is flattened first, as MOBY XML does not allow nested lists (equivalent to calling addAll).

Specified by:
add in interface Collection<MobyDataObject>
Specified by:
add in interface List<MobyDataObject>

add

public void add(int index,
                MobyDataObject mdo)
Inserts the specified element at the specified position in this list. If the object is another MobyDataObjectVector, the list is flattened first, as MOBY XML does not allow nested lists (equivalent to calling addAll).

Specified by:
add in interface List<MobyDataObject>

addAll

public boolean addAll(Collection<? extends MobyDataObject> c)
Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator. Usually the argument would be a MobyDataObjectSet, or another MobyDataObjectVector.

Specified by:
addAll in interface Collection<MobyDataObject>
Specified by:
addAll in interface List<MobyDataObject>

addAll

public boolean addAll(int index,
                      Collection<? extends MobyDataObject> c)
Inserts all of the elements in the specified collection into this list at the specified position. Usually the argument would be a MobyDataObjectSet, or another MobyDataObjectVector.

Specified by:
addAll in interface List<MobyDataObject>

clear

public void clear()
Removes all of the elements from this list.

Specified by:
clear in interface Collection<MobyDataObject>
Specified by:
clear in interface List<MobyDataObject>

contains

public boolean contains(Object o)
Returns true if this list contains the specified element.

Specified by:
contains in interface Collection<MobyDataObject>
Specified by:
contains in interface List<MobyDataObject>

containsAll

public boolean containsAll(Collection c)
Returns true if this list contains all of the elements of the specified collection.

Specified by:
containsAll in interface Collection<MobyDataObject>
Specified by:
containsAll in interface List<MobyDataObject>

equals

public boolean equals(Object o)
Compares the specified object with this list for equality.

Specified by:
equals in interface Collection<MobyDataObject>
Specified by:
equals in interface List<MobyDataObject>
Overrides:
equals in class MobyDataObject
Returns:
true if the values are equals according to the underlying Java object's equals() method

get

public MobyDataObject get(int index)
Returns the element at the specified position in this list.

Specified by:
get in interface List<MobyDataObject>

hashCode

public int hashCode()
Returns the hash code value for this list.

Specified by:
hashCode in interface Collection<MobyDataObject>
Specified by:
hashCode in interface List<MobyDataObject>
Overrides:
hashCode in class Object

indexOf

public int indexOf(Object o)
Returns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element.

Specified by:
indexOf in interface List<MobyDataObject>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<MobyDataObject>
Specified by:
isEmpty in interface List<MobyDataObject>

iterator

public Iterator<MobyDataObject> iterator()
Returns an iterator over the elements in this list in proper sequence.

Specified by:
iterator in interface Iterable<MobyDataObject>
Specified by:
iterator in interface Collection<MobyDataObject>
Specified by:
iterator in interface List<MobyDataObject>

lastIndexOf

public int lastIndexOf(Object o)
Returns the index in this list of the last occurrence of the specified element, or -1 if this list does not contain this element.

Specified by:
lastIndexOf in interface List<MobyDataObject>

listIterator

public ListIterator<MobyDataObject> listIterator()
Returns a list iterator of the elements in this list (in proper sequence).

Specified by:
listIterator in interface List<MobyDataObject>

listIterator

public ListIterator<MobyDataObject> listIterator(int index)
Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in this list.

Specified by:
listIterator in interface List<MobyDataObject>

remove

public MobyDataObject remove(int index)
Removes the element at the specified position in this list (optional operation).

Specified by:
remove in interface List<MobyDataObject>

remove

public boolean remove(Object o)
Removes the first occurrence in this list of the specified element.

Specified by:
remove in interface Collection<MobyDataObject>
Specified by:
remove in interface List<MobyDataObject>

removeAll

public boolean removeAll(Collection c)
Removes from this list all the elements that are contained in the specified collection.

Specified by:
removeAll in interface Collection<MobyDataObject>
Specified by:
removeAll in interface List<MobyDataObject>

retainAll

public boolean retainAll(Collection c)
Retains only the elements in this list that are contained in the specified collection (optional operation).

Specified by:
retainAll in interface Collection<MobyDataObject>
Specified by:
retainAll in interface List<MobyDataObject>

set

public MobyDataObject set(int index,
                          MobyDataObject element)
Replaces the element at the specified position in this list with the specified element (optional operation). If the element to be set is another MobyDataObjectVector, the list is flatten first because MOBY XML does not support nested lists.

Specified by:
set in interface List<MobyDataObject>

size

public int size()
Returns the number of elements in this list.

Specified by:
size in interface Collection<MobyDataObject>
Specified by:
size in interface List<MobyDataObject>

subList

public List<MobyDataObject> subList(int fromIndex,
                                    int toIndex)
Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.

Specified by:
subList in interface List<MobyDataObject>

toArray

public Object[] toArray()
Returns an array containing all of the elements in this list in proper sequence.

Specified by:
toArray in interface Collection<MobyDataObject>
Specified by:
toArray in interface List<MobyDataObject>

toArray

public <T> T[] toArray(T[] a)
            throws ClassCastException
Specified by:
toArray in interface Collection<MobyDataObject>
Specified by:
toArray in interface List<MobyDataObject>
Throws:
ClassCastException

Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010