|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractSequentialList<E>
java.util.LinkedList<KVector>
de.cau.cs.kieler.core.math.KVectorChain
public class KVectorChain
A chain of vectors. Can be used to describe polylines or similar constructs.
Field Summary |
---|
Fields inherited from class java.util.Vector |
---|
capacityIncrement, elementCount, elementData |
Constructor Summary | |
---|---|
KVectorChain()
Creates an empty vector chain. |
|
KVectorChain(Collection<KVector> collection)
Creates a vector chain from a given collection of vectors. |
|
KVectorChain(KVector[] vectors)
Creates a vector chain from a given vector array. |
Method Summary | |
---|---|
void |
add()
Adds a (0,0) vector to the vector chain. |
void |
add(double x,
double y)
Adds the vector (x,y) to the vector chain. |
void |
addAll(KVector[] vectors)
Add all the vectors in the given array to the end of this vector chain. |
void |
addFirst()
Adds a (0,0) vector to the beginning of the vector chain. |
void |
addFirst(double x,
double y)
Adds the vector (x,y) to the beginning of the vector chain. |
void |
addLast()
Adds a (0,0) vector to the end of the vector chain. |
void |
addLast(double x,
double y)
Adds the vector (x,y) to the end of the vector chain. |
boolean |
containsAll(Collection<?> c)
|
boolean |
equals(Object o)
|
double |
getLength()
Calculate the total length of this vector chain. |
KVector |
getPointOnLine(double dist)
Calculate a point on this vector chain with given distance. |
boolean |
isEmpty()
|
ListIterator<E> |
listIterator()
|
void |
parse(String string)
Parse the given string and set the content of this data object. |
boolean |
removeAll(Collection<?> c)
|
boolean |
retainAll(Collection<?> c)
|
static KVectorChain |
reverse(KVectorChain chain)
Returns a new vector chain that is the reverse of the given vector chain. |
String |
toString()
|
void |
translate(double dx,
double dy)
Iterates through all vectors and adds the offset to them. |
void |
translate(KVector offset)
Iterates through all vectors and adds the offset to them. |
Methods inherited from class java.util.LinkedList |
---|
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, toArray, toArray |
Methods inherited from class java.util.Queue |
---|
empty, peek, pop, push |
Methods inherited from class java.util.Vector |
---|
addElement, capacity, clear, elementAt, elements, ensureCapacity, equals, indexOf, indexOf, insertElementAt, isEmpty, lastIndexOf, lastIndexOf, removeAllElements, removeElement, removeElementAt, setElementAt, setSize, size, toArray, trimToSize |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from class java.util.AbstractSequentialList |
---|
iterator |
Methods inherited from interface java.util.List |
---|
listIterator, subList |
Methods inherited from interface java.util.Collection |
---|
containsAll, equals, hashCode, isEmpty, iterator, removeAll, retainAll |
Methods inherited from interface java.util.Deque |
---|
iterator |
Constructor Detail |
---|
public KVectorChain()
public KVectorChain(Collection<KVector> collection)
collection
- a collection of vectorspublic KVectorChain(KVector[] vectors)
vectors
- an array of vectorsMethod Detail |
---|
public String toString()
toString
in class Object
public void parse(String string)
parse
in interface IDataObject
string
- a stringpublic void add()
public void add(double x, double y)
x
- x coordinatey
- y coordinatepublic void addFirst()
public void addFirst(double x, double y)
x
- x coordinatey
- y coordinatepublic void addLast()
public void addLast(double x, double y)
x
- x coordinatey
- y coordinatepublic void addAll(KVector[] vectors)
vectors
- a vector arraypublic void translate(KVector offset)
offset
- the offset to add to the vectors.public void translate(double dx, double dy)
dx
- x value to add.dy
- y value to add.public double getLength()
public KVector getPointOnLine(double dist)
dist
- the distance from the first point (if positive) or the last point
(if negative)
public static KVectorChain reverse(KVectorChain chain)
KVector
instance in
the old chain doesn't affect any vectors in the new chain.
chain
- the chain to be reversed.
public boolean equals(Object o)
equals
in interface Collection<E>
equals
in class Object
public ListIterator<E> listIterator()
listIterator
in interface List<E>
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<E>
public boolean isEmpty()
isEmpty
in interface Collection<E>
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<E>
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<E>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |