com.mapinfo.midev.geometry

## Interface IDirectPositionList

All Superinterfaces:
  Serializable

    public interface IDirectPositionList
    extends Serializable

A representation of an ordered container of `DirectPositions`.

### Method Summary

All Methods Instance Methods Abstract Methods
`void` `add(DirectPosition dp)` Append the given `DirectPosition` to the end of this list.
`void` `add(double x, double y)` Append the given `DirectPosition` values to the end of this list.
`void` `add(double x, double y, double z)` Append the given `DirectPosition` values to the end of this list.
`void` `add(double x, double y, double z, MValue m)` Append the given `DirectPosition` values to the end of this list.
`void` `add(double x, double y, MValue m)` Append the given `DirectPosition` values to the end of this list.
`void` `add(int index, DirectPosition dp)` Inserts the given `DirectPosition` at the specified index in this list.
`void` `add(int index, double x, double y)` Add the `DirectPosition` values to the specified index in this array.
`void` `add(int index, double x, double y, double z)` Add the `DirectPosition` values to the specified index in this array.
`void` `add(int index, double x, double y, double z, MValue m)` Add the `DirectPosition` values to the specified index in this array.
`void` `add(int index, double x, double y, MValue m)` Add the `DirectPosition` values to the specified index in this array.
`void` `addAll(IDirectPositionList dpl)` Append all the direct positions in the input `IDirectPositionList` to this list in the order they are returned by the input objects iterator.
`void` `applyMutator(IDirectPositionMutator dpm)` Apply the given `IDirectPositionMutator` to every direct position in this list.
`void` `clear()` Removes all of the `DirectPosition`s from this list.
`boolean` `contains(DirectPosition dp)` Does this list contain a direct position with the same value as dp? This method returns true if there is at least one direct position (a) in this list such that dp.equals(a) == true.
`DirectPosition` `getDirectPosition(int i, DirectPosition dp)` Copy the DirectPosition at the given index into the supplied `DirectPosition`.
`IDirectPositionIterator` `getDirectPositionIterator()` Get an iterator over the direct positions in this list.
`int` `indexOf(DirectPosition dp)` Find the index of the first `DirectPosition` that is equal to the given `DirectPosition`.
`boolean` `isEmpty()` Does this list contain any `DirectPosition`s.
`boolean` `isReadOnly()` Determine if this list is modifiable.
`int` `lastIndexOf(DirectPosition dp)` Find the index of the last `DirectPosition` that is equal to the given `DirectPosition`.
`boolean` `mAllSet()` Does this direct position list have all non-null MValues.
`boolean` `mSet()` Does this direct position list have at least one non-null MValue.
`void` `remove(int index)` Remove the `DirectPosition` at the specified index from the list.
`IDirectPositionList` `reverse()` Get a copy of this list with the direct positions in reverse order.
`void` `set(int index, DirectPosition dp)` Replace the `DirectPosition` at the given index with the given `DirectPosition`.
`void` `set(int index, double x, double y)` Replace the `DirectPosition` values at the given index with the given `DirectPosition` values.
`void` `set(int index, double x, double y, double z)` Replace the `DirectPosition` values at the given index with the given `DirectPosition` values.
`void` `set(int index, double x, double y, double z, MValue m)` Replace the `DirectPosition` values at the given index with the given `DirectPosition` values.
`void` `set(int index, double x, double y, MValue m)` Replace the `DirectPosition` values at the given index with the given `DirectPosition` values.
`int` `size()` Return the number of `DirectPosition`s in this list.
`boolean` `zAllSet()` Do all the Z values in this direct position list have a value that is not `Double.NaN`.
`boolean` `zSet()` Does at least one Z value in this direct position list have a value that is not `Double.NaN`.

### Method Detail

#### getDirectPositionIterator

    IDirectPositionIterator getDirectPositionIterator()

Get an iterator over the direct positions in this list.

The direct positions returned by the iterator are copies of those in the list; changing a returned direct position will not modify the underlying list.

Returns:
  an `IDirectPositionIterator`.

#### getDirectPosition

    DirectPosition getDirectPosition(int i,
                                     DirectPosition dp)

Copy the DirectPosition at the given index into the supplied `DirectPosition`.

Parameters:
  `i` - zero-based index of the DirectPosition to copy.
  `dp` - the `DirectPosition` to copy into, cannot be null
Returns:
  input `DirectPosition` dp after being changed

#### addAll

    void addAll(IDirectPositionList dpl)
         throws UnsupportedOperationException

Append all the direct positions in the input `IDirectPositionList` to this list in the order they are returned by the input objects iterator.

Parameters:
  `dpl` - `IDirectPositionList` to append to this list
Throws:
  `UnsupportedOperationException` - if the list is read only
See Also:
  `IDirectPositionList.isReadOnly()`

#### zSet

    boolean zSet()

Does at least one Z value in this direct position list have a value that is not `Double.NaN`.

The implementation of this method may execute in linear time on the first invocation but must execute in constant time for all subsequent calls if this object has not changed.

Returns:
  true if not empty and at least one Z value is not `Double.NaN`

#### zAllSet

    boolean zAllSet()

Do all the Z values in this direct position list have a value that is not `Double.NaN`.

The implementation of this method may execute in linear time on the first invocation but must execute in constant time for all subsequent calls if this object has not changed.

Returns:
  true if not empty and all Z values are not `Double.NaN`

#### mSet

    boolean mSet()

Does this direct position list have at least one non-null MValue.

The implementation of this method may execute in linear time on the first invocation but must execute in constant time for all subsequent calls if this object has not changed.

Returns:
  true if not empty and at least one MValue is not null

#### mAllSet

    boolean mAllSet()

Does this direct position list have all non-null MValues.

The implementation of this method may execute in linear time on the first invocation but must execute in constant time for all subsequent calls if this object has not changed.

Returns:
  true if not empty and all Mvalues are not null.

#### isReadOnly

    boolean isReadOnly()

Determine if this list is modifiable.

Returns:
  true if this list is read-only, false if the list can be modified.

#### size

    int size()

Return the number of `DirectPosition`s in this list.

The implementation of this method may execute in linear time on the first invocation but must execute in constant time for all subsequent calls if this object has not changed.

Returns:
  the number of DirectPositions in this list

#### set

    void set(int index,
             DirectPosition dp)
      throws UnsupportedOperationException

Replace the `DirectPosition` at the given index with the given `DirectPosition`.

Parameters:
  `index` - zero based index
  `dp` - `DirectPosition` to set at index
Throws:
  `UnsupportedOperationException` - if the list is read only
  `IndexOutOfBoundsException` - - if the index is out of range, index < 0 || index >= size()
See Also:
  `IDirectPositionList.isReadOnly()`

#### set

    void set(int index,
             double x,
             double y)
      throws UnsupportedOperationException

Replace the `DirectPosition` values at the given index with the given `DirectPosition` values. Note that this method behaves just as `IDirectPositionList.set(int,DirectPosition)` were called with a `DirectPosition` in which only x and y were set.

Parameters:
  `index` - zero based index
  `x` - x coordinate, a valid double value
  `y` - y coordinate, a valid double value
Throws:
  `UnsupportedOperationException` - if the list is read only
  `IndexOutOfBoundsException` - - if the index is out of range, index < 0 || index >= size()
See Also:
  `IDirectPositionList.isReadOnly()`, `DirectPosition.DirectPosition(double,double)`

#### set

    void set(int index,
             double x,
             double y,
             double z)
      throws UnsupportedOperationException

Replace the `DirectPosition` values at the given index with the given `DirectPosition` values. Note that this method behaves just as `IDirectPositionList.set(int,DirectPosition)` were called with a `DirectPosition` in which only x, y, and z were set.

Parameters:
  `index` - zero based index
  `x` - x coordinate, a valid double value
  `y` - y coordinate, a valid double value
  `z` - z coordinate, a valid double value
Throws:
  `UnsupportedOperationException` - if the list is read only
  `IndexOutOfBoundsException` - - if the index is out of range, index < 0 || index >= size()
See Also:
  `IDirectPositionList.isReadOnly()`, `DirectPosition.DirectPosition(double,double,double)`

#### set

    void set(int index,
             double x,
             double y,
             MValue m)
      throws UnsupportedOperationException

Replace the `DirectPosition` values at the given index with the given `DirectPosition` values. Note that this method behaves just as `IDirectPositionList.set(int, com.mapinfo.midev.geometry.DirectPosition)` were called with a `DirectPosition` in which only x, y, and m were set.

Parameters:
  `index` - zero based index
  `x` - x coordinate, a valid double value
  `y` - y coordinate, a valid double value
  `m` - an MValue or null if unassigned
Throws:
  `UnsupportedOperationException` - if the list is read only
  `IndexOutOfBoundsException` - - if the index is out of range, index < 0 || index >= size()
See Also:
  `IDirectPositionList.isReadOnly()`, `DirectPosition.DirectPosition(double,double, com.mapinfo.midev.geometry.MValue)`

#### set

    void set(int index,
             double x,
             double y,
             double z,
             MValue m)
      throws UnsupportedOperationException

Replace the `DirectPosition` values at the given index with the given `DirectPosition` values.

Parameters:
  `index` - zero based index
  `x` - x coordinate, a valid double value
  `y` - y coordinate, a valid double value
  `z` - z coordinate, a valid double value
  `m` - an MValue or null if unassigned
Throws:
  `UnsupportedOperationException` - if the list is read only
  `IndexOutOfBoundsException` - - if the index is out of range, index < 0 || index >= size()
See Also:
  `IDirectPositionList.isReadOnly()`, `DirectPosition.DirectPosition(double,double,double,MValue)`

#### add

    void add(int index,
             DirectPosition dp)
      throws UnsupportedOperationException

Inserts the given `DirectPosition` at the specified index in this list. Shifts the `DirectPosition` at that index and any subsequent `DirectPosition`s one position to the right (adds one to their indices).

Parameters:
  `index` - zero based index. Must be >=0 and <= size().
  `dp` - `DirectPosition` to add, cannot be null
Throws:
  `UnsupportedOperationException` - if the list is read only
  `IndexOutOfBoundsException` - - if the index is out of range, index < 0 || index > size()
See Also:
  `IDirectPositionList.isReadOnly()`

#### add

    void add(int index,
             double x,
             double y)
      throws UnsupportedOperationException

Add the `DirectPosition` values to the specified index in this array. Note that this method behaves just as `IDirectPositionList.add(int,DirectPosition)` were called with a `DirectPosition` in which only x and y were set.

Parameters:
  `index` - zero based index. Must be >=0 and <= size() so the new direct position either is inserted into an existing spot and direct positions to the right are shifted one position or it is put immediately adjacent to the last direct position.
  `x` - x coordinate, a valid double value
  `y` - y coordinate, a valid double value
Throws:
  `UnsupportedOperationException` - if the list is read only
  `IndexOutOfBoundsException` - - if the index is out of range, index < 0 || index > size()
See Also:
  `IDirectPositionList.isReadOnly()`, `DirectPosition.DirectPosition(double,double)`

#### add

    void add(int index,
             double x,
             double y,
             double z)
      throws UnsupportedOperationException

Add the `DirectPosition` values to the specified index in this array. Note that this method behaves just as `IDirectPositionList.add(int,DirectPosition)` were called with a `DirectPosition` in which only x, y, and z were set.

Parameters:
  `index` - zero based index. Must be >=0 and <= size() so the new direct position either is inserted into an existing spot and direct positions to the right are shifted one position or it is put immediately adjacent to the last direct position.
  `x` - x coordinate, a valid double value
  `y` - y coordinate, a valid double value
  `z` - z coordinate, a valid double value
Throws:
  `UnsupportedOperationException` - if the list is read only
  `IndexOutOfBoundsException` - - if the index is out of range, index < 0 || index > size()
See Also:
  `IDirectPositionList.isReadOnly()`, `DirectPosition.DirectPosition(double,double,double)`

#### add

    void add(int index,
             double x,
             double y,
             MValue m)
      throws UnsupportedOperationException

Add the `DirectPosition` values to the specified index in this array. Note that this method behaves just as `IDirectPositionList.add(int, com.mapinfo.midev.geometry.DirectPosition)` were called with a `DirectPosition` in which only x, y, and m were set.

Parameters:
  `index` - zero based index. Must be >=0 and <= size() so the new direct position either is inserted into an existing spot and direct positions to the right are shifted one position or it is put immediately adjacent to the last direct position.
  `x` - x coordinate, a valid double value
  `y` - y coordinate, a valid double value
  `m` - an MValue or null if unassigned
Throws:
  `UnsupportedOperationException` - if the list is read only
  `IndexOutOfBoundsException` - - if the index is out of range, index < 0 || index > size()
See Also:
  `IDirectPositionList.isReadOnly()`, `DirectPosition.DirectPosition(double,double,MValue)`

#### add

    void add(int index,
             double x,
             double y,
             double z,
             MValue m)
      throws UnsupportedOperationException

Add the `DirectPosition` values to the specified index in this array.

Parameters:
  `index` - zero based index. Must be >=0 and <= size() so the new direct position either is inserted into an existing spot and direct positions to the right are shifted one position or it is put immediately adjacent to the last direct position.
  `x` - x coordinate, a valid double value
  `y` - y coordinate, a valid double value
  `z` - z coordinate, a valid double value
  `m` - an MValue or null if unassigned
Throws:
  `UnsupportedOperationException` - if the list is read only
  `IndexOutOfBoundsException` - - if the index is out of range, index < 0 || index > size()
See Also:
  `IDirectPositionList.isReadOnly()`, `DirectPosition.DirectPosition(double,double,double,MValue)`

#### remove

    void remove(int index)
         throws UnsupportedOperationException

Remove the `DirectPosition` at the specified index from the list.

Parameters:
  `index` - zero based index of the `DirectPosition` to remove.
Throws:
  `UnsupportedOperationException` - if the list is read only
  `IndexOutOfBoundsException` - - if the index is out of range, index < 0 || index > size()
See Also:
  `IDirectPositionList.isReadOnly()`

#### indexOf

    int indexOf(DirectPosition dp)

Find the index of the first `DirectPosition` that is equal to the given `DirectPosition`.

Parameters:
  `dp` - DirectPosition to match
Returns:
  zero-based index of first match or -1 if no match found.
Throws:
  `IndexOutOfBoundsException` - - if the index is out of range, index < 0 || index > size()
See Also:
  `DirectPosition.equals(Object)`

#### lastIndexOf

    int lastIndexOf(DirectPosition dp)

Find the index of the last `DirectPosition` that is equal to the given `DirectPosition`.

Parameters:
  `dp` - DirectPosition to match
Returns:
  zero-based index of last match or -1 if no match found.
See Also:
  `DirectPosition.equals(Object)`

#### add

    void add(DirectPosition dp)
      throws UnsupportedOperationException

Append the given `DirectPosition` to the end of this list.

The values in dp are appended to this list but the object dp is not retained by this list.

Parameters:
  `dp` - DirectPosition to append, cannot be null
Throws:
  `UnsupportedOperationException` - if the list is read only
See Also:
  `IDirectPositionList.isReadOnly()`

#### add

    void add(double x,
             double y)
      throws UnsupportedOperationException

Append the given `DirectPosition` values to the end of this list. Note that this method behaves just as `IDirectPositionList.add(DirectPosition)` were called with a DirectPosition in which only x and y were set.

Parameters:
  `x` - x coordinate, a valid double value
  `y` - y coordinate, a valid double value
Throws:
  `UnsupportedOperationException` - if the list is read only
See Also:
  `IDirectPositionList.isReadOnly()`, `DirectPosition.DirectPosition(double,double)`

#### add

    void add(double x,
             double y,
             double z)
      throws UnsupportedOperationException

Append the given `DirectPosition` values to the end of this list. Note that this method behaves just as `IDirectPositionList.add(com.mapinfo.midev.geometry.DirectPosition)` were called with a DirectPosition in which only x, y, and z were set.

Parameters:
  `x` - x coordinate, a valid double value
  `y` - y coordinate, a valid double value
  `z` - z coordinate, a valid double value
Throws:
  `UnsupportedOperationException` - if the list is read only
See Also:
  `IDirectPositionList.isReadOnly()`, `DirectPosition.DirectPosition(double,double,double)`

#### add

    void add(double x,
             double y,
             MValue m)
      throws UnsupportedOperationException

Append the given `DirectPosition` values to the end of this list. Note that this method behaves just as `IDirectPositionList.add(com.mapinfo.midev.geometry.DirectPosition)` were called with a `DirectPosition` in which only x, y, and m were set.

Parameters:
  `x` - x coordinate, a valid double value
  `y` - y coordinate, a valid double value
  `m` - an MValue or null if unassigned
Throws:
  `UnsupportedOperationException` - if the list is read only
See Also:
  `IDirectPositionList.isReadOnly()`, `DirectPosition.DirectPosition(double,double,MValue)`

#### add

    void add(double x,
             double y,
             double z,
             MValue m)
      throws UnsupportedOperationException

Append the given `DirectPosition` values to the end of this list.

Parameters:
  `x` - x coordinate, a valid double value
  `y` - y coordinate, a valid double value
  `z` - z coordinate, a valid double value
  `m` - an MValue or null if unassigned
Throws:
  `UnsupportedOperationException` - if the list is read only
See Also:
  `IDirectPositionList.isReadOnly()`, `DirectPosition.DirectPosition(double,double,double,MValue)`

#### contains

    boolean contains(DirectPosition dp)

Does this list contain a direct position with the same value as dp?

This method returns true if there is at least one direct position (a) in this list such that dp.equals(a) == true. It does not mean that the instance dp itself is contained by this list.

Parameters:
  `dp` - `DirectPosition` to test for containment in this list
Returns:
  true if dp is contained by this list, false otherwise
See Also:
  `DirectPosition.equals(Object)`, `IDirectPositionList.indexOf(com.mapinfo.midev.geometry.DirectPosition)`

#### clear

    void clear()
        throws UnsupportedOperationException

Removes all of the `DirectPosition`s from this list. This list will be empty after this call returns.

Throws:
  `UnsupportedOperationException` - if the list is read only
See Also:
  `IDirectPositionList.isEmpty()`, `IDirectPositionList.isReadOnly()`

#### isEmpty

    boolean isEmpty()

Does this list contain any `DirectPosition`s.

Returns:
  true if this list contains at least one `DirectPosition`.

#### applyMutator

    void applyMutator(IDirectPositionMutator dpm)
               throws UnsupportedOperationException

Apply the given `IDirectPositionMutator` to every direct position in this list.

Parameters:
  `dpm` - mutator to apply to this list
Throws:
  `UnsupportedOperationException` - if the list is read only
See Also:
  `IDirectPositionList.isReadOnly()`

#### reverse

    IDirectPositionList reverse()

Get a copy of this list with the direct positions in reverse order.

Returns:
  A copy of this list with the direct positions in reverse order.