Class ShapeList

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public class ShapeList
    extends AbstractObjectList
    A table of Shape objects.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ShapeList()
      Creates a new list.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()
      Returns an independent copy of the list.
      boolean equals​(java.lang.Object obj)
      Tests the list for equality with another object (typically also a list).
      java.awt.Shape getShape​(int index)
      Returns a Shape object from the list.
      int hashCode()
      Returns a hash code value for the object.
      private void readObject​(java.io.ObjectInputStream stream)
      Provides serialization support.
      void setShape​(int index, java.awt.Shape shape)
      Sets the Shape for an item in the list.
      private void writeObject​(java.io.ObjectOutputStream stream)
      Provides serialization support.
      • Methods inherited from class java.lang.Object

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

      • ShapeList

        public ShapeList()
        Creates a new list.
    • Method Detail

      • getShape

        public java.awt.Shape getShape​(int index)
        Returns a Shape object from the list.
        Parameters:
        index - the index (zero-based).
        Returns:
        The object.
      • setShape

        public void setShape​(int index,
                             java.awt.Shape shape)
        Sets the Shape for an item in the list. The list is expanded if necessary.
        Parameters:
        index - the index (zero-based).
        shape - the Shape.
      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Returns an independent copy of the list.
        Overrides:
        clone in class AbstractObjectList
        Returns:
        A clone.
        Throws:
        java.lang.CloneNotSupportedException - if an item in the list does not support cloning.
      • equals

        public boolean equals​(java.lang.Object obj)
        Tests the list for equality with another object (typically also a list).
        Overrides:
        equals in class AbstractObjectList
        Parameters:
        obj - the other object (null permitted).
        Returns:
        A boolean.
      • hashCode

        public int hashCode()
        Returns a hash code value for the object.
        Overrides:
        hashCode in class AbstractObjectList
        Returns:
        the hashcode
      • writeObject

        private void writeObject​(java.io.ObjectOutputStream stream)
                          throws java.io.IOException
        Provides serialization support.
        Parameters:
        stream - the output stream.
        Throws:
        java.io.IOException - if there is an I/O error.
      • readObject

        private void readObject​(java.io.ObjectInputStream stream)
                         throws java.io.IOException,
                                java.lang.ClassNotFoundException
        Provides serialization support.
        Parameters:
        stream - the input stream.
        Throws:
        java.io.IOException - if there is an I/O error.
        java.lang.ClassNotFoundException - if there is a classpath problem.