com.mapinfo.midev.style

## Class Dash

- java.lang.Object
- - com.mapinfo.midev.style.Dash

All Implemented Interfaces:
  Serializable

    public class Dash
    extends Object
    implements Serializable

Dash instructions that describe dash offset as well as dash length and gap length.

See Also:
  Serialized Form

### Field Summary

Fields
`static float` `DEFAULT_DASH_OFFSET` The default dash offset.
`static Dash` `NONE` Indicates that dash instructions are empty and should not be inherited from the parent style during the rendering process.

### Constructor Summary

Constructors
Constructor and Description
`Dash(float[] dashes, PaperUnit unit)` Creates a `Dash` object with the specified dash pattern and units.
`Dash(float[] dashes, PaperUnit unit, float dashOffset)` Creates a `Dash` object with the specified dash pattern, units and offset.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `equals(Object o)`
`float[]` `getDashes()` Returns the dashing pattern for a line.
`float` `getDashOffset()` Returns the number of units into the dashes pattern to begin the line with.
`PaperUnit` `getUnit()` Returns the unit used for dash offset, dash length and dash gap length.
`int` `hashCode()`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### DEFAULT_DASH_OFFSET

    public static final float DEFAULT_DASH_OFFSET

The default dash offset. The default is 0.0.

See Also:
  Constant Field Values

#### NONE

    public static final Dash NONE

Indicates that dash instructions are empty and should not be inherited from the parent style during the rendering process. This prevents lines from having any dashes. All Dash.NONE methods throw UnsupportedOperationException.

### Constructor Detail

#### Dash

    public Dash(float[] dashes,
                PaperUnit unit)

Creates a `Dash` object with the specified dash pattern and units. Sets dash offset to `Dash.DEFAULT_DASH_OFFSET`.

This constructor creates a safe copy of the dashes array so that changing it does not affect the Dash object.

Parameters:
  `dashes` - the pattern of the dashes. There must be an even number of values in the array. The values alternate in specifying the amount of line and the amount of space.
  `unit` - the units of the dashes. Cannot be null.
Throws:
  `IllegalArgumentException` -

if dashes array is null or empty;
if unit is null.

#### Dash

    public Dash(float[] dashes,
                PaperUnit unit,
                float dashOffset)

Creates a `Dash` object with the specified dash pattern, units and offset. The offset specifies the number of units into the dashes pattern to begin the line with.

This constructor creates a safe copy of the dashes array so that changing it does not affect the Dash object.

Parameters:
  `dashes` - the pattern of the dashes. There must be an even number of values in the array. The values alternate in specifying the amount of line and the amount of space.
  `unit` - the units of the dashes. Cannot be null.
  `dashOffset` - The offset into the pattern to start drawing the dashes. Must be greater than or equal to zero.
Throws:
  `IllegalArgumentException` -

if dashes array is null or empty;
if unit is null;
if dashOffset is less than zero.
  `InvalidStyleException` - if dashes array has an odd number of elements.

### Method Detail

#### getUnit

    public PaperUnit getUnit()

Returns the unit used for dash offset, dash length and dash gap length.

Returns:
  the unit used for dash offset, dash length and dash gap length.

#### getDashOffset

    public float getDashOffset()

Returns the number of units into the dashes pattern to begin the line with.

Returns:
  the number of units into the dashes pattern to begin the line with.

#### getDashes

    public float[] getDashes()

Returns the dashing pattern for a line. The values alternate in specifying the amount of line and the amount of space.

Returns:
  The safe copy of the dashes array. Changing it does not affect the Dash object.

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`