Class StrokeMap

java.lang.Object
org.jfree.chart.StrokeMap
All Implemented Interfaces:
Serializable, Cloneable

public class StrokeMap extends Object implements Cloneable, Serializable
A storage structure that maps Comparable instances with Stroke instances.

To support cloning and serialization, you should only use keys that are cloneable and serializable. Special handling for the Stroke instances is included in this class.
See Also:
  • Field Details

    • serialVersionUID

      static final long serialVersionUID
      For serialization.
      See Also:
    • store

      private transient Map store
      Storage for the keys and values.
  • Constructor Details

    • StrokeMap

      public StrokeMap()
      Creates a new (empty) map.
  • Method Details

    • getStroke

      public Stroke getStroke(Comparable key)
      Returns the stroke associated with the specified key, or null.
      Parameters:
      key - the key (null not permitted).
      Returns:
      The stroke, or null.
      Throws:
      IllegalArgumentException - if key is null.
    • containsKey

      public boolean containsKey(Comparable key)
      Returns true if the map contains the specified key, and false otherwise.
      Parameters:
      key - the key.
      Returns:
      true if the map contains the specified key, and false otherwise.
    • put

      public void put(Comparable key, Stroke stroke)
      Adds a mapping between the specified key and stroke values.
      Parameters:
      key - the key (null not permitted).
      stroke - the stroke.
    • clear

      public void clear()
      Resets the map to empty.
    • equals

      public boolean equals(Object obj)
      Tests this map for equality with an arbitrary object.
      Overrides:
      equals in class Object
      Parameters:
      obj - the object (null permitted).
      Returns:
      A boolean.
    • clone

      public Object clone() throws CloneNotSupportedException
      Returns a clone of this StrokeMap.
      Overrides:
      clone in class Object
      Returns:
      A clone of this instance.
      Throws:
      CloneNotSupportedException - if any key is not cloneable.
    • writeObject

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

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