Class XmlSizes
- java.lang.Object
-
- de.ipk_gatersleben.bit.bi.edal.primary_data.reference.datacite.xml.XmlSizes
-
- All Implemented Interfaces:
java.io.Serializable
public class XmlSizes extends java.lang.Object implements java.io.SerializableXML mapping class for the 'sizes' element.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description XmlSizes()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSize(int index, java.lang.String size)Add a size to theListof size at a specified position.voidaddSize(long bytes)Add a size to theListof sizes.voidaddSize(java.lang.String size)Add a size to theListof sizes.java.util.Iterator<? extends java.lang.String>enumerateSize()Return anIteratorof all sizes.java.lang.String[]getSize()Returns the contents of the collection in an Array.java.lang.StringgetSize(int index)Return the size at the specified position in theList.intgetSizeCount()Return the number of the sizes.voidremoveAllSize()Remove all sizes in theList.booleanremoveSize(java.lang.String size)Remove a specified size.java.lang.StringremoveSizeAt(int index)Remove a size at the specified position.voidsetSize(int index, java.lang.String size)Set the size at the specified position of theList.voidsetSize(java.lang.String[] sizeArray)Set a all sizes to theList.
-
-
-
Method Detail
-
addSize
public void addSize(long bytes) throws java.lang.IndexOutOfBoundsExceptionAdd a size to theListof sizes.- Parameters:
bytes- the number of bytes to convert into aString.- Throws:
java.lang.IndexOutOfBoundsException- if the index given is outside the bounds of the collection.
-
addSize
public void addSize(java.lang.String size) throws java.lang.IndexOutOfBoundsExceptionAdd a size to theListof sizes.- Parameters:
size- the size to add.- Throws:
java.lang.IndexOutOfBoundsException- if the index given is outside the bounds of the collection.
-
addSize
public void addSize(int index, java.lang.String size) throws java.lang.IndexOutOfBoundsExceptionAdd a size to theListof size at a specified position.- Parameters:
index- the position to insert the size.size- the size to add.- Throws:
java.lang.IndexOutOfBoundsException- if the index given is outside the bounds of the collection
-
enumerateSize
public java.util.Iterator<? extends java.lang.String> enumerateSize()
Return anIteratorof all sizes.- Returns:
- an Iterator over all sizes elements.
-
getSize
public java.lang.String getSize(int index) throws java.lang.IndexOutOfBoundsExceptionReturn the size at the specified position in theList.- Parameters:
index- the position of the searched size.- Returns:
- the value of the size at the given index
- Throws:
java.lang.IndexOutOfBoundsException- if the index given is outside the bounds of the collection
-
getSize
public java.lang.String[] getSize()
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
-
getSizeCount
public int getSizeCount()
Return the number of the sizes.- Returns:
- the size of this collection
-
removeAllSize
public void removeAllSize()
Remove all sizes in theList.
-
removeSize
public boolean removeSize(java.lang.String size)
Remove a specified size.- Parameters:
size- the size to remove.- Returns:
- true if the object was removed from the collection.
-
removeSizeAt
public java.lang.String removeSizeAt(int index)
Remove a size at the specified position.- Parameters:
index- the position of the size to remove.- Returns:
- the element removed from the collection
-
setSize
public void setSize(int index, java.lang.String size) throws java.lang.IndexOutOfBoundsExceptionSet the size at the specified position of theList.- Parameters:
index- the position to set the size.size- the size to set.- Throws:
java.lang.IndexOutOfBoundsException- if the index given is outside the bounds of the collection
-
setSize
public void setSize(java.lang.String[] sizeArray)
Set a all sizes to theList.- Parameters:
sizeArray- teh array of sizes to set
-
-