## org.jfree.chart.plot
Class CategoryMarker

    java.lang.Object
      org.jfree.chart.plot.Marker
          org.jfree.chart.plot.CategoryMarker

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

    public class CategoryMarker

extends Marker
implements java.lang.Cloneable, java.io.Serializable

A marker for a category.
Note that for serialization to work correctly, the category key must be an instance of a serializable class.

See Also:
  `CategoryPlot.addDomainMarker(CategoryMarker)`, Serialized Form

Constructor Summary
`CategoryMarker(java.lang.Comparable key)` Creates a new category marker for the specified category.
`CategoryMarker(java.lang.Comparable key, java.awt.Paint paint, java.awt.Stroke stroke)` Creates a new category marker.
`CategoryMarker(java.lang.Comparable key, java.awt.Paint paint, java.awt.Stroke stroke, java.awt.Paint outlinePaint, java.awt.Stroke outlineStroke, float alpha)` Creates a new category marker.

Method Summary
`boolean` `equals(java.lang.Object obj)` Tests the marker for equality with an arbitrary object.
`boolean` `getDrawAsLine()` Returns the flag that controls whether the marker is drawn as a region or a line.
`java.lang.Comparable` `getKey()` Returns the key.
`void` `setDrawAsLine(boolean drawAsLine)` Sets the flag that controls whether the marker is drawn as a region or as a line, and sends a `MarkerChangeEvent` to all registered listeners.
`void` `setKey(java.lang.Comparable key)` Sets the key and sends a `MarkerChangeEvent` to all registered listeners.

Methods inherited from class org.jfree.chart.plot.Marker

`addChangeListener, clone, getAlpha, getLabel, getLabelAnchor, getLabelFont, getLabelOffset, getLabelOffsetType, getLabelPaint, getLabelTextAnchor, getListeners, getOutlinePaint, getOutlineStroke, getPaint, getStroke, notifyListeners, removeChangeListener, setAlpha, setLabel, setLabelAnchor, setLabelFont, setLabelOffset, setLabelOffsetType, setLabelPaint, setLabelTextAnchor, setOutlinePaint, setOutlineStroke, setPaint, setStroke`

Methods inherited from class java.lang.Object
`finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### CategoryMarker

    public CategoryMarker(java.lang.Comparable key)

  Creates a new category marker for the specified category.

  Parameters:
    `key` - the category key.

### CategoryMarker

    public CategoryMarker(java.lang.Comparable key,
                          java.awt.Paint paint,
                          java.awt.Stroke stroke)

  Creates a new category marker.

  Parameters:
    `key` - the key.
    `paint` - the paint (`null` not permitted).
    `stroke` - the stroke (`null` not permitted).

### CategoryMarker

    public CategoryMarker(java.lang.Comparable key,
                          java.awt.Paint paint,
                          java.awt.Stroke stroke,
                          java.awt.Paint outlinePaint,
                          java.awt.Stroke outlineStroke,
                          float alpha)

  Creates a new category marker.

  Parameters:
    `key` - the key.
    `paint` - the paint (`null` not permitted).
    `stroke` - the stroke (`null` not permitted).
    `outlinePaint` - the outline paint (`null` permitted).
    `outlineStroke` - the outline stroke (`null` permitted).
    `alpha` - the alpha transparency.

Method Detail

### getKey

    public java.lang.Comparable getKey()

  Returns the key.

  Returns:
    The key.

### setKey

    public void setKey(java.lang.Comparable key)

  Sets the key and sends a `MarkerChangeEvent` to all registered listeners.

  Parameters:
    `key` - the key (`null` not permitted).
  Since:
    1.0.3

### getDrawAsLine

    public boolean getDrawAsLine()

  Returns the flag that controls whether the marker is drawn as a region or a line.

  Returns:
    A line.

### setDrawAsLine

    public void setDrawAsLine(boolean drawAsLine)

  Sets the flag that controls whether the marker is drawn as a region or as a line, and sends a `MarkerChangeEvent` to all registered listeners.

  Parameters:
    `drawAsLine` - the flag.

### equals

    public boolean equals(java.lang.Object obj)

  Tests the marker for equality with an arbitrary object.

  Overrides:
    `equals` in class `Marker`
  Parameters:
    `obj` - the object (`null` permitted).
  Returns:
    A boolean.