|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--java.util.AbstractCollection
|
+--java.util.AbstractList
|
+--java.util.Vector
|
+--jumbo.euclid.EuclidVector
|
+--jumbo.euclid.Int2Vector
Int2Vector - a (Java) Vector of Int2s. (Note that 'Vector' is used by Java to describe an array of objects - there is no relationship to geometrical vectors in this package.)
Support is also given for the two component arrays as IntArrays
Default is an empty (Java) Vector;
| Fields inherited from class java.util.Vector |
capacityIncrement,
elementCount,
elementData |
| Fields inherited from class java.util.AbstractList |
modCount |
| Constructor Summary | |
Int2Vector()
|
|
Int2Vector(int size)
create a Vector with given number of points |
|
Int2Vector(int[] flarray)
Formed by feeding in an existing array to a 2xn matrix. |
|
Int2Vector(Int2Vector pv)
copy constructor from Int2Vector COPIES pv |
|
Int2Vector(IntArray m)
constructor from IntArray - by REFERENCE |
|
Int2Vector(int n,
int[] x,
int[] y)
from two parallel arrays of x, y - by REFERENCE |
|
| Method Summary | |
void |
addElement(Int2 p)
|
int |
getClosestPoint(Int2 p)
get the closest point (both ranges are assumed to have the same scales |
int |
getCoordinate(int i,
Choice2 j)
get a single coordinate value |
Int2 |
getInt2(int i)
get the i'th Int2 |
int |
getPoint(Int2 p,
int width,
int height)
get the index of the first point within a box centered on p (i.e. |
IntRange |
getRange(Choice2 ax)
get range of one coordinate |
Int2Range |
getRange2()
get range of both coordinates |
IntArray |
getXorY(Choice2 axis)
get a single coordinate array - e.g. |
IntArray |
getXY()
get the coordinate coordinate array as ints x,y,x,y, ... |
java.lang.String |
makeString()
we are not allowed a toString() here, as Vector is a final class |
void |
multiplyBy(int f)
multiply all coordinates be a given scalar (i.e. |
void |
plus(Int2 p)
add a Int2 to all elements of 'this'; MODIFIES 'this' |
void |
setElementAt(Int2 v,
int i)
|
Int2Vector |
sortAscending(Choice2 ax)
sort ARRAY on X or Y coordinate; returns new array |
Int2Vector |
sortDescending(Choice2 ax)
sort ARRAY on X or Y coordinate; returns new array |
void |
sortXYAscending()
sort X and Y within each point; MODIFIES array |
void |
sortXYDescending()
sort X and Y within each point; MODIFIES array |
Int2Vector |
subArray(IntSet is)
create a NEW subset of the points; points are COPIED |
IntSet |
subSet(Int2Range r)
create a subset of the points within a box |
void |
subtract(Int2 v)
translate negatively; MODIFIES 'this' |
void |
swapXY()
swap all X and Y coordinates; MODIFIES array |
void |
translateBy(Int2 v)
translate by a vector, synonym for 'plus'; MODIFIES 'this' |
| Methods inherited from class jumbo.euclid.EuclidVector |
concatenate |
| Methods inherited from class java.util.Vector |
add,
add,
addAll,
addAll,
addElement,
capacity,
clear,
clone,
contains,
containsAll,
copyInto,
elementAt,
elements,
ensureCapacity,
equals,
firstElement,
get,
hashCode,
indexOf,
indexOf,
insertElementAt,
isEmpty,
lastElement,
lastIndexOf,
lastIndexOf,
remove,
remove,
removeAll,
removeAllElements,
removeElement,
removeElementAt,
removeRange,
retainAll,
set,
setElementAt,
setSize,
size,
subList,
toArray,
toArray,
toString,
trimToSize |
| Methods inherited from class java.util.AbstractList |
iterator,
listIterator,
listIterator |
| Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
| Constructor Detail |
public Int2Vector()
public Int2Vector(int size)
public Int2Vector(int[] flarray)
throws BadArgumentException
public Int2Vector(int n,
int[] x,
int[] y)
public Int2Vector(IntArray m)
throws BadArgumentException
public Int2Vector(Int2Vector pv)
| Method Detail |
public void addElement(Int2 p)
public void setElementAt(Int2 v,
int i)
throws java.lang.ArrayIndexOutOfBoundsException
public IntRange getRange(Choice2 ax)
public Int2Range getRange2()
public Int2Vector subArray(IntSet is)
throws BadSubscriptException
public IntSet subSet(Int2Range r)
public int getClosestPoint(Int2 p)
public int getPoint(Int2 p,
int width,
int height)
public void translateBy(Int2 v)
public void plus(Int2 p)
public void subtract(Int2 v)
public void multiplyBy(int f)
public Int2 getInt2(int i)
public IntArray getXY()
public int getCoordinate(int i,
Choice2 j)
public IntArray getXorY(Choice2 axis)
public void swapXY()
public void sortXYAscending()
public void sortXYDescending()
public Int2Vector sortAscending(Choice2 ax)
public Int2Vector sortDescending(Choice2 ax)
public java.lang.String makeString()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||