Class XMLFieldDescriptors

java.lang.Object
org.exolab.castor.xml.util.XMLFieldDescriptors

public class XMLFieldDescriptors extends Object
A class which represents a collection of XMLFieldDescriptor instances.
Version:
$Revision: 8145 $ $Date: 2005-12-13 14:58:48 -0700 (Tue, 13 Dec 2005) $
Author:
Keith Visco
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new XMLFieldDescriptors with the default Size.
    Creates a new XMLFieldDescriptors with the given size.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    add(XMLFieldDescriptor descriptor)
    Adds the specified XMLFieldDescriptor to the collection.
    void
    Removes all descriptors from this collection.
     
    boolean
    Returns true if the specified descriptor is contained in this collection.
    boolean
    Compares the specified object with this list for equality.
    get(int index)
    Returns the XMLFieldDescriptor at the specified position in this list.
    int
    As defined by the JDK 1.2 API spec:
    Returns the hash code value for this list.
    int
    Returns the index of the first occurrence of the specified XMLFieldDescriptor, or -1 if the descriptor is not contained in the collection.
    boolean
    Returns true if there are no descriptors in the collection.
    remove(int index)
    Removes the descriptor at the specified index from the list.
    boolean
    Removes the given XMLFieldDescriptor from the list.
    int
    Returns the number of descriptors in the list.
    Returns an array containing all of the descriptors in this list in proper sequence.
    Returns an array containing all of the descriptors in this list in proper sequence.
    toArray(XMLFieldDescriptor[] dst, int offset)
    Returns an array containing all of the elements in this list in proper sequence.
    void
    Reduces the capacity of the internal buffer to the current size freeing up unused memory.

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • XMLFieldDescriptors

      public XMLFieldDescriptors()
      Creates a new XMLFieldDescriptors with the default Size.
    • XMLFieldDescriptors

      public XMLFieldDescriptors(int size)
      Creates a new XMLFieldDescriptors with the given size.
      Parameters:
      size - the initial size of the internal collection.
  • Method Details

    • add

      public boolean add(XMLFieldDescriptor descriptor)
      Adds the specified XMLFieldDescriptor to the collection. If the specified XMLFieldDescriptor is already contained in the collection, it will not be re-added, false will be returned.
      Parameters:
      descriptor - the XMLFieldDescriptor to add
      Returns:
      true if the descriptor is added, false otherwise.
    • clear

      public void clear()
      Removes all descriptors from this collection.
    • clone

      public Object clone()
      Overrides:
      clone in class Object
    • contains

      public boolean contains(XMLFieldDescriptor descriptor)
      Returns true if the specified descriptor is contained in this collection. If the descriptor is null, then if this collection contains a null value, true will be returned.
      Parameters:
      descriptor - the XMLFieldDescriptor to search the list for
      Returns:
      true if specified descriptor is contained in the list
    • equals

      public boolean equals(Object obj)
      Compares the specified object with this list for equality. Returns true if and only if the specified Object is a list and all of its associated elements are equal to the elements of this list
      Overrides:
      equals in class Object
      Returns:
      true if the given object is considered equal to this list.
    • get

      public XMLFieldDescriptor get(int index) throws IndexOutOfBoundsException
      Returns the XMLFieldDescriptor at the specified position in this list.
      Parameters:
      index - the position of the descriptor to return
      Throws:
      IndexOutOfBoundsException
    • hashCode

      public int hashCode()
      As defined by the JDK 1.2 API spec:
      Returns the hash code value for this list. The hash code of a list is defined to be the result of the following calculation:
      hashCode = 1; Iterator i = list.iterator(); while (i.hasNext()) { Object obj = i.next(); hashCode = 31*hashCode + (obj==null ? 0 : obj.hashCode()); }
      Overrides:
      hashCode in class Object
      Returns:
      the hash code value for this list
    • indexOf

      public int indexOf(XMLFieldDescriptor descriptor)
      Returns the index of the first occurrence of the specified XMLFieldDescriptor, or -1 if the descriptor is not contained in the collection.
      Parameters:
      descriptor - the XMLFieldDescriptor to get the index of
    • isEmpty

      public boolean isEmpty()
      Returns true if there are no descriptors in the collection.
      Returns:
      true if the collection is empty.
    • remove

      public XMLFieldDescriptor remove(int index)
      Removes the descriptor at the specified index from the list.
      Parameters:
      index - the position in the list to remove the descriptor from.
      Returns:
      the descriptor that was removed from the list.
    • remove

      public boolean remove(XMLFieldDescriptor descriptor)
      Removes the given XMLFieldDescriptor from the list.
      Parameters:
      descriptor - the XMLFieldDescriptor to remove from the list.
      Returns:
      true if the descriptor was removed from the list.
    • trimToSize

      public void trimToSize()
      Reduces the capacity of the internal buffer to the current size freeing up unused memory.
    • size

      public int size()
      Returns the number of descriptors in the list.
      Returns:
      the number of descriptors in the list.
    • toArray

      public XMLFieldDescriptor[] toArray()
      Returns an array containing all of the descriptors in this list in proper sequence.
      Returns:
      the array of descriptors of this List
    • toArray

      public XMLFieldDescriptor[] toArray(XMLFieldDescriptor[] dst)
      Returns an array containing all of the descriptors in this list in proper sequence.
      Returns:
      the array of descriptors of this list.
    • toArray

      public XMLFieldDescriptor[] toArray(XMLFieldDescriptor[] dst, int offset)
      Returns an array containing all of the elements in this list in proper sequence.
      Returns:
      the array of descriptors of this list.