Class 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 the List of size at a specified position.
      void addSize​(long bytes)
      Add a size to the List of sizes.
      void addSize​(java.lang.String size)
      Add a size to the List of sizes.
      java.util.Iterator<? extends java.lang.String> enumerateSize()
      Return an Iterator 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 the List.
      int getSizeCount()
      Return the number of the sizes.
      void removeAllSize()
      Remove all sizes in the List.
      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 the List.
      void setSize​(java.lang.String[] sizeArray)
      Set a all sizes to the List.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • XmlSizes

        public XmlSizes()
    • Method Detail

      • addSize

        public void addSize​(long bytes)
                     throws java.lang.IndexOutOfBoundsException
        Add a size to the List of sizes.
        Parameters:
        bytes - the number of bytes to convert into a String.
        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 the List 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 the List 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 an Iterator 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 the List.
        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 the List.
      • 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 the List.
        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 the List.
        Parameters:
        sizeArray - teh array of sizes to set