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.Serializable
XML mapping class for the 'sizes' element.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description XmlSizes()
-
Method Summary
Modifier and Type Method Description void
addSize(int index, java.lang.String size)
Add a size to theList
of size at a specified position.void
addSize(long bytes)
Add a size to theList
of sizes.void
addSize(java.lang.String size)
Add a size to theList
of sizes.java.util.Iterator<? extends java.lang.String>
enumerateSize()
Return anIterator
of all sizes.java.lang.String[]
getSize()
Returns the contents of the collection in an Array.java.lang.String
getSize(int index)
Return the size at the specified position in theList
.int
getSizeCount()
Return the number of the sizes.void
removeAllSize()
Remove all sizes in theList
.boolean
removeSize(java.lang.String size)
Remove a specified size.java.lang.String
removeSizeAt(int index)
Remove a size at the specified position.void
setSize(int index, java.lang.String size)
Set the size at the specified position of theList
.void
setSize(java.lang.String[] sizeArray)
Set a all sizes to theList
.
-
-
-
Method Detail
-
addSize
public void addSize(long bytes) throws java.lang.IndexOutOfBoundsException
Add a size to theList
of 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.IndexOutOfBoundsException
Add a size to theList
of 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.IndexOutOfBoundsException
Add a size to theList
of 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 anIterator
of all sizes.- Returns:
- an Iterator over all sizes elements.
-
getSize
public java.lang.String getSize(int index) throws java.lang.IndexOutOfBoundsException
Return 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.IndexOutOfBoundsException
Set 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
-
-