org.jfree.chart

Class StrokeMap

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.

Since: 1.0.3

Constructor Summary
StrokeMap()
Creates a new (empty) map.
Method Summary
voidclear()
Resets the map to empty.
Objectclone()
Returns a clone of this StrokeMap.
booleancontainsKey(Comparable key)
Returns true if the map contains the specified key, and false otherwise.
booleanequals(Object obj)
Tests this map for equality with an arbitrary object.
StrokegetStroke(Comparable key)
Returns the stroke associated with the specified key, or null.
voidput(Comparable key, Stroke stroke)
Adds a mapping between the specified key and stroke values.

Constructor Detail

StrokeMap

public StrokeMap()
Creates a new (empty) map.

Method Detail

clear

public void clear()
Resets the map to empty.

clone

public Object clone()
Returns a clone of this StrokeMap.

Returns: A clone of this instance.

Throws: CloneNotSupportedException if any key is not cloneable.

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.

equals

public boolean equals(Object obj)
Tests this map for equality with an arbitrary object.

Parameters: obj the object (null permitted).

Returns: A boolean.

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.

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.

Copyright © 2000-2009 by Object Refinery Limited. All Rights Reserved.