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.Serializable
XML 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 void
addSubject(int index, XmlSubject subject)
void
addSubject(XmlSubject subject)
java.util.Iterator<? extends XmlSubject>
enumerateSubject()
Return anIterator
of allXmlSubject
.XmlSubject[]
getSubject()
Returns the contents of the collection in an Array.XmlSubject
getSubject(int index)
Return theXmlSubject
at the specified position in theList
.int
getSubjectCount()
Return the number of theXmlSubject
.void
removeAllSubject()
Remove allXmlSubject
in theList
.boolean
removeSubject(XmlSubject subject)
Remove a specifiedXmlSubject
.XmlSubject
removeSubjectAt(int index)
Remove aXmlSubject
at the specified position.void
setSubject(int index, XmlSubject subject)
Set theXmlSubject
at the specified position of theList
.void
setSubject(XmlSubject[] subjectArray)
Set a allXmlSubject
to theList
.
-
-
-
Method Detail
-
addSubject
public void addSubject(XmlSubject subject) throws java.lang.IndexOutOfBoundsException
- Parameters:
subject
- theXmlSubject
to 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 theXmlSubject
to 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 anIterator
of allXmlSubject
.- Returns:
- an Iterator over all
XmlSubject
elements.
-
getSubject
public XmlSubject getSubject(int index) throws java.lang.IndexOutOfBoundsException
Return theXmlSubject
at the specified position in theList
.- Parameters:
index
- the position of the searchedXmlSubject
.- Returns:
- the value of the
XmlSubject
at 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 allXmlSubject
in theList
.
-
removeSubject
public boolean removeSubject(XmlSubject subject)
Remove a specifiedXmlSubject
.- Parameters:
subject
- theXmlSubject
to remove.- Returns:
- true if the object was removed from the collection.
-
removeSubjectAt
public XmlSubject removeSubjectAt(int index)
Remove aXmlSubject
at the specified position.- Parameters:
index
- the position of theXmlSubject
to remove.- Returns:
- the element removed from the collection
-
setSubject
public void setSubject(int index, XmlSubject subject) throws java.lang.IndexOutOfBoundsException
Set theXmlSubject
at the specified position of theList
.- Parameters:
index
- the position to set theXmlSubject
.subject
- theXmlSubject
to set.- Throws:
java.lang.IndexOutOfBoundsException
- if the index given is outside the bounds of the collection
-
setSubject
public void setSubject(XmlSubject[] subjectArray)
Set a allXmlSubject
to theList
.- Parameters:
subjectArray
- the array of subjects to set
-
-