Class AffineTransformList
java.lang.Object
|
+--java.util.AbstractCollection
|
+--java.util.AbstractList
|
+--java.util.AbstractSequentialList
|
+--java.util.LinkedList
|
+--AffineTransformList
- All Implemented Interfaces:
- java.lang.Cloneable, java.util.Collection, java.util.List, java.io.Serializable
- public class AffineTransformList
- extends java.util.LinkedList
Linked list implementation of the List interface containing AffineTransforms. Implements all
optional list operations, but only permits AffineTransform
insertion. In addition to implementing the List interface,
the AffineTransformList class extends the uniformly named methods within LinkedList to
get, remove and insert an element at the
beginning and end of the list. These operations allow AffineTransformLists to be
used as a stack, queue, or double-ended queue (deque).
The primary purpose of the class is for the development of getTransformStep,
which returns the AffineTransform
found passing a double index. The double index transforms
into an intermidiary AffineTransform
developed from the list of AffineTransforms.
The iterators returned by the this class's iterator and
listIterator methods are fail-fast: if the list is
structurally modified at any time after the iterator is created, in any way
except through the Iterator's own remove or add methods,
the iterator will throw a ConcurrentModificationException. Thus,
in the face of concurrent modification, the iterator fails quickly and
cleanly, rather than risking arbitrary, non-deterministic behavior at an
undetermined time in the future.
- See Also:
LinkedList
,
AffineTransform
, Serialized Form
Fields inherited from class java.util.AbstractList |
modCount |
Constructor Summary |
AffineTransformList()
Constructs an empty list. |
AffineTransformList(java.util.Collection c)
Constructs a list containing the elements of the specified
collection, in the order they are returned by the collection's
iterator. |
Method Summary |
boolean |
add(java.awt.geom.AffineTransform a)
Appends the given AffineTransform to the end of this list. |
void |
add(int index,
java.awt.geom.AffineTransform element)
Inserts the specified AffineTransform at the specified position in this list. |
void |
addFirst(java.awt.geom.AffineTransform a)
Inserts the given AffineTransform at the beginning of this list. |
void |
addLast(java.awt.geom.AffineTransform a)
Appends the given AffineTransform to the end of this list. |
static java.awt.geom.AffineTransform |
getTransformStep(java.awt.geom.AffineTransform a,
java.awt.geom.AffineTransform b,
double step)
Finds the appropriate AffineTransform given a double step and two AffineTrasforms. |
java.awt.geom.AffineTransform |
getTransformStep(double step)
Finds the appropriate AffineTransform given a double step. |
java.awt.geom.AffineTransform |
set(int index,
java.awt.geom.AffineTransform element)
Replaces the AffineTransform at the specified position in this list with the
specified AffineTransform . |
Methods inherited from class java.util.LinkedList |
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, remove, remove, removeFirst, removeLast, set, size, toArray, toArray |
Methods inherited from class java.util.AbstractSequentialList |
iterator |
Methods inherited from class java.util.AbstractList |
equals, hashCode, listIterator, removeRange, subList |
Methods inherited from class java.util.AbstractCollection |
containsAll, isEmpty, removeAll, retainAll, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList |
AffineTransformList
public AffineTransformList()
- Constructs an empty list.
AffineTransformList
public AffineTransformList(java.util.Collection c)
- Constructs a list containing the elements of the specified
collection, in the order they are returned by the collection's
iterator.
- Parameters:
c
- the collection whose elements are to be placed into this list.
add
public boolean add(java.awt.geom.AffineTransform a)
- Appends the given
AffineTransform
to the end of this list.
- Parameters:
a
- the AffineTransform
to be inserted at the end of this list.- Returns:
- true (as per the general contract of
Collection.add).
add
public void add(int index,
java.awt.geom.AffineTransform element)
- Inserts the specified
AffineTransform
at the specified position in this list.
Shifts the AffineTransform
currently at that position (if any) and any
subsequent elements to the right (adds one to their indices).
- Parameters:
index
- index at which the specified element is to be inserted.element
- AffineTransform
to be inserted.- Throws:
java.lang.IndexOutOfBoundsException
- if the specified index is out of
range (index < 0 || index > size()).
addFirst
public void addFirst(java.awt.geom.AffineTransform a)
- Inserts the given
AffineTransform
at the beginning of this list.
- Parameters:
a
- the AffineTransform
to be inserted at the beginning of this list.
addLast
public void addLast(java.awt.geom.AffineTransform a)
- Appends the given
AffineTransform
to the end of this list. (Identical in
function to the add method; included only for consistency.)
- Parameters:
a
- the AffineTransform
to be inserted at the end of this list.
set
public java.awt.geom.AffineTransform set(int index,
java.awt.geom.AffineTransform element)
- Replaces the
AffineTransform
at the specified position in this list with the
specified AffineTransform
.
- Parameters:
index
- index of element to replace.element
- AffineTransform
to be stored at the specified position.- Returns:
- the
AffineTransform
previously at the specified position. - Throws:
java.lang.IndexOutOfBoundsException
- if the specified index is out of
range (index < 0 || index >= size()).
getTransformStep
public java.awt.geom.AffineTransform getTransformStep(double step)
throws java.lang.IndexOutOfBoundsException
- Finds the appropriate
AffineTransform
given a double step. The double step
refers to inbetween two AffineTransform
s, defined by integer indices. The AffineTransform
returns that takes the step and finds the AffineTransform that fits at that given point
between the two integer indices.
- Parameters:
step
- double step referring to inbetween two indices of the AffineTransformList.- Returns:
AffineTransform
that represents the transform for the double step between
two AffineTransform
s.- Throws:
java.lang.IndexOutOfBoundsException
- if the specified step is out of
range (step < 0 || step >= size()).
getTransformStep
public static java.awt.geom.AffineTransform getTransformStep(java.awt.geom.AffineTransform a,
java.awt.geom.AffineTransform b,
double step)
- Finds the appropriate
AffineTransform
given a double step and two AffineTrasforms. The double step
refers to a number between 1 and 0. The AffineTransform
returned takes the step and finds the AffineTransform that fits at that given point
between the two integer indices, 0 returns AffineTransform
a and 1 returns AffineTrasform
b.
- Parameters:
a
- AffineTransform that is returned at step 0.b
- AffineTransform that is returned at step 1.step
- double step referring to inbetween two indices of the AffineTransformList.- Returns:
AffineTransform
that represents the transform for the double step between
two AffineTransform
s a and b.- Throws:
java.lang.IndexOutOfBoundsException
- if the specified step is out of
range (step < 0 || step >= size()).