Class XmlFormats
- java.lang.Object
-
- de.ipk_gatersleben.bit.bi.edal.primary_data.reference.datacite.xml.XmlFormats
-
- All Implemented Interfaces:
java.io.Serializable
public class XmlFormats extends java.lang.Object implements java.io.Serializable
XML Mapping class for the 'formats' element.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description XmlFormats()
Default constructor
-
Method Summary
Modifier and Type Method Description void
addFormat(int index, java.lang.String format)
void
addFormat(java.lang.String format)
java.util.Iterator<? extends java.lang.String>
enumerateFormat()
Return anIterator
of allXmlFormats
.java.lang.String[]
getFormat()
Returns the contents of theList
in an Array.java.lang.String
getFormat(int index)
Return theXmlFormats
at the specified position in theList
.int
getFormatCount()
Return the number of theXmlFormats
.void
removeAllFormat()
Remove allXmlFormats
in theList
.boolean
removeFormat(java.lang.String format)
Remove a specifiedXmlFormats
.java.lang.String
removeFormatAt(int index)
Remove aXmlFormats
at the specified position.void
setFormat(int index, java.lang.String format)
Set theXmlFormats
at the specified position of theList
.void
setFormat(java.lang.String[] formatArray)
Set a allXmlFormats
to theList
.
-
-
-
Method Detail
-
addFormat
public void addFormat(java.lang.String format) throws java.lang.IndexOutOfBoundsException
- Parameters:
format
- theXmlFormats
to add.- Throws:
java.lang.IndexOutOfBoundsException
- if the index given is outside the bounds of the collection.
-
addFormat
public void addFormat(int index, java.lang.String format) throws java.lang.IndexOutOfBoundsException
- Parameters:
index
- the position to insert theXmlFormats
.format
- theXmlFormats
to add.- Throws:
java.lang.IndexOutOfBoundsException
- if the index given is outside the bounds of the collection
-
enumerateFormat
public java.util.Iterator<? extends java.lang.String> enumerateFormat()
Return anIterator
of allXmlFormats
.- Returns:
- an Iterator over all
XmlFormats
elements.
-
getFormat
public java.lang.String getFormat(int index) throws java.lang.IndexOutOfBoundsException
Return theXmlFormats
at the specified position in theList
.- Parameters:
index
- the position of the searchedXmlFormats
.- Returns:
- the value of the
XmlFormats
at the given index - Throws:
java.lang.IndexOutOfBoundsException
- if the index given is outside the bounds of the collection
-
getFormat
public java.lang.String[] getFormat()
Returns the contents of theList
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:
- an Array of
XmlFormats
.
-
getFormatCount
public int getFormatCount()
Return the number of theXmlFormats
.- Returns:
- the size of this collection
-
removeAllFormat
public void removeAllFormat()
Remove allXmlFormats
in theList
.
-
removeFormat
public boolean removeFormat(java.lang.String format)
Remove a specifiedXmlFormats
.- Parameters:
format
- theXmlFormats
to remove.- Returns:
- true if the object was removed from the collection.
-
removeFormatAt
public java.lang.String removeFormatAt(int index)
Remove aXmlFormats
at the specified position.- Parameters:
index
- the position of theXmlFormats
to remove.- Returns:
- the element removed from the collection
-
setFormat
public void setFormat(int index, java.lang.String format) throws java.lang.IndexOutOfBoundsException
Set theXmlFormats
at the specified position of theList
.- Parameters:
index
- the position to set theXmlFormats
.format
- theXmlFormats
to set.- Throws:
java.lang.IndexOutOfBoundsException
- if the index given is outside the bounds of the collection
-
setFormat
public void setFormat(java.lang.String[] formatArray)
Set a allXmlFormats
to theList
.- Parameters:
formatArray
- the array of formats to set
-
-