Class XmlSubjects
- java.lang.Object
-
- de.ipk_gatersleben.bit.bi.edal.primary_data.reference.datacite.xml.XmlSubjects
-
- All Implemented Interfaces:
java.io.Serializable
public class XmlSubjects extends java.lang.Object implements java.io.SerializableXML mapping class for the 'subjects' element.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description XmlSubjects()Default constructor.
-
Method Summary
Modifier and Type Method Description voidaddSubject(int index, XmlSubject subject)voidaddSubject(XmlSubject subject)java.util.Iterator<? extends XmlSubject>enumerateSubject()Return anIteratorof allXmlSubject.XmlSubject[]getSubject()Returns the contents of the collection in an Array.XmlSubjectgetSubject(int index)Return theXmlSubjectat the specified position in theList.intgetSubjectCount()Return the number of theXmlSubject.voidremoveAllSubject()Remove allXmlSubjectin theList.booleanremoveSubject(XmlSubject subject)Remove a specifiedXmlSubject.XmlSubjectremoveSubjectAt(int index)Remove aXmlSubjectat the specified position.voidsetSubject(int index, XmlSubject subject)Set theXmlSubjectat the specified position of theList.voidsetSubject(XmlSubject[] subjectArray)Set a allXmlSubjectto theList.
-
-
-
Method Detail
-
addSubject
public void addSubject(XmlSubject subject) throws java.lang.IndexOutOfBoundsException
- Parameters:
subject- theXmlSubjectto add.- Throws:
java.lang.IndexOutOfBoundsException- if the index given is outside the bounds of the collection.
-
addSubject
public void addSubject(int index, XmlSubject subject) throws java.lang.IndexOutOfBoundsException- Parameters:
subject- the position to insert theXmlSubject.index- the position of theXmlSubjectto add.- Throws:
java.lang.IndexOutOfBoundsException- if the index given is outside the bounds of the collection
-
enumerateSubject
public java.util.Iterator<? extends XmlSubject> enumerateSubject()
Return anIteratorof allXmlSubject.- Returns:
- an Iterator over all
XmlSubjectelements.
-
getSubject
public XmlSubject getSubject(int index) throws java.lang.IndexOutOfBoundsException
Return theXmlSubjectat the specified position in theList.- Parameters:
index- the position of the searchedXmlSubject.- Returns:
- the value of the
XmlSubjectat the given index - Throws:
java.lang.IndexOutOfBoundsException- if the index given is outside the bounds of the collection
-
getSubject
public XmlSubject[] getSubject()
Returns the contents of the collection in an Array.Note: Just in case the collection contents are changing in another thread, we pass a 0-length Array of the correct type into the API call. This way we know that the Array returned is of exactly the correct length.
- Returns:
- this collection as an Array
-
getSubjectCount
public int getSubjectCount()
Return the number of theXmlSubject.- Returns:
- the size of this collection
-
removeAllSubject
public void removeAllSubject()
Remove allXmlSubjectin theList.
-
removeSubject
public boolean removeSubject(XmlSubject subject)
Remove a specifiedXmlSubject.- Parameters:
subject- theXmlSubjectto remove.- Returns:
- true if the object was removed from the collection.
-
removeSubjectAt
public XmlSubject removeSubjectAt(int index)
Remove aXmlSubjectat the specified position.- Parameters:
index- the position of theXmlSubjectto remove.- Returns:
- the element removed from the collection
-
setSubject
public void setSubject(int index, XmlSubject subject) throws java.lang.IndexOutOfBoundsExceptionSet theXmlSubjectat the specified position of theList.- Parameters:
index- the position to set theXmlSubject.subject- theXmlSubjectto set.- Throws:
java.lang.IndexOutOfBoundsException- if the index given is outside the bounds of the collection
-
setSubject
public void setSubject(XmlSubject[] subjectArray)
Set a allXmlSubjectto theList.- Parameters:
subjectArray- the array of subjects to set
-
-