|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.renderer.array.PointArray org.geotools.renderer.array.GenericArray
An array wrapping a pair of x and y vectors. The vectors may be arrays of
any of Java primitive types: double[]
, float[]
, long[]
,
int[]
, short[]
, byte[]
, char[]
(which may
be used as a kind of unsigned short) or boolean[]
(0 or 1 values). The x
and y arrays doesn't need to be of the same type.
Note: this implementation is not the fastest one. For maximal performance, consider using
DefaultArray
instead.
DefaultArray
,
JTSArray
,
Serialized FormConstructor Summary | |
GenericArray(java.lang.Object x,
java.lang.Object y)
Construct a new array of points. |
|
GenericArray(java.lang.Object x,
java.lang.Object y,
int lower,
int upper)
Construct a new array of points. |
Method Summary | |
GenericArray |
clip(java.awt.geom.Rectangle2D clip)
Construct a new array clipped to the specified rectangle. |
int |
count()
Returns the number of points in this array. |
java.awt.geom.Rectangle2D |
getBounds2D()
Returns the bounding box of all x and y ordinates. |
PointArray |
getFinal(CompressionLevel level)
Retourne un tableau immutable qui contient les m?mes donn?es que celui-ci. |
java.awt.geom.Point2D |
getFirstPoint(java.awt.geom.Point2D point)
Returns the first point in this array. |
java.awt.geom.Point2D |
getLastPoint(java.awt.geom.Point2D point)
Returns the last point in this array. |
long |
getMemoryUsage()
Returns an estimation of memory usage in bytes. |
java.awt.geom.Point2D |
getValue(int i)
Returns the point at the specified index. |
PointArray |
insertAt(int index,
float[] toMerge,
int lower,
int upper,
boolean reverse)
Ins?re les donn?es (x,y) du tableau toMerge sp?cifi?. |
PointIterator |
iterator(int index)
Returns an iterator object that iterates along the point coordinates. |
PointArray |
reverse()
Renverse l'ordre de tous les points compris dans ce tableau. |
PointArray |
subarray(int lower,
int upper)
Retourne un tableau enveloppant les m?mes points que le tableau courant, mais des index lower inclusivement jusqu'? upper
exclusivement. |
void |
toArray(ArrayData dest,
float resolution2)
Append (x,y) coordinates to the specified destination array. |
Methods inherited from class org.geotools.renderer.array.PointArray |
equals, equals, hashCode, insertAt, toArray, toShape, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public GenericArray(java.lang.Object x, java.lang.Object y) throws java.lang.ClassCastException, javax.vecmath.MismatchedSizeException
x
- x ordinates.y
- y ordinates.
java.lang.ClassCastException
- if x and y are not arrays
of a primitive type.
javax.vecmath.MismatchedSizeException
- if arrays doesn't have the same length.public GenericArray(java.lang.Object x, java.lang.Object y, int lower, int upper) throws java.lang.ClassCastException
x
- x ordinates.y
- y ordinates.lower
- Index of lower point, inclusive.upper
- Index of upper point, exclusive.
java.lang.ClassCastException
- if x and y are not arrays
of a primitive type.
javax.vecmath.MismatchedSizeException
- if arrays doesn't have the same length.Method Detail |
public int count()
count
in interface RandomAccess
count
in class PointArray
public long getMemoryUsage()
getMemoryUsage
in class PointArray
public java.awt.geom.Point2D getFirstPoint(java.awt.geom.Point2D point)
point
is null, a new
Point2D
object is allocated and then the result is stored in this object.
getFirstPoint
in class PointArray
point
- The object in which to store the first point, or null
.
point
or a new Point2D
, which contains the first point.public java.awt.geom.Point2D getLastPoint(java.awt.geom.Point2D point)
point
is null, a new
Point2D
object is allocated and then the result is stored in this object.
getLastPoint
in class PointArray
point
- The object in which to store the last point, or null
.
point
or a new Point2D
, which contains the last point.public java.awt.geom.Point2D getValue(int i) throws java.lang.IndexOutOfBoundsException
getValue
in interface RandomAccess
i
- The index from 0 inclusive to count()
exclusive.
java.lang.IndexOutOfBoundsException
- if index
is out of bounds.public PointIterator iterator(int index)
iterator
in class PointArray
index
- Index of the first point to returns in the iteration.
public java.awt.geom.Rectangle2D getBounds2D()
null
.
getBounds2D
in class PointArray
public GenericArray clip(java.awt.geom.Rectangle2D clip)
this
if the clip is not cheap.
clip
- The clip, or null
for none.
null
.public PointArray subarray(int lower, int upper)
lower
inclusivement jusqu'? upper
exclusivement. Si le sous-tableau ne contient aucun point (c'est-?-dire si
lower==upper
), alors cette m?thode retourne null
.
subarray
in class PointArray
lower
- Index du premier point ? prendre en compte.upper
- Index suivant celui du dernier point ? prendre en compte.public PointArray insertAt(int index, float[] toMerge, int lower, int upper, boolean reverse)
toMerge
sp?cifi?.
insertAt
in class PointArray
index
- Index ? partir d'o? ins?rer les points dans ce tableau. Le point ? cet
index ainsi que tous ceux qui le suivent seront d?cal?s vers des index plus ?lev?s.toMerge
- Tableau de coordonn?es (x,y) ? ins?rer dans ce
tableau de points. Ses valeurs seront copi?es.lower
- Index de la premi?re coordonn?e de toMerge
? copier dans ce tableau.upper
- Index suivant celui de la derni?re coordonn?e de toMerge
? copier.reverse
- true
s'il faut inverser l'ordre des points de toMerge
lors de la copie. Cette inversion ne change pas l'ordre (x,y) des
coordonn?es de chaque points.
this
si l'insertion ? pu ?tre faite sur
place, ou un autre tableau si ?a n'a pas ?t? possible.public PointArray reverse()
reverse
in class PointArray
this
si l'inversion a pu ?tre faite sur-place,
ou un autre tableau si ?a n'a pas ?t? possible.public PointArray getFinal(CompressionLevel level)
getFinal
in class PointArray
level
- The compression level, or null
if no compression is wanted.
this
si ce tableau r?pondait d?j? aux conditions ou null
si ce tableau ne contient aucune donn?e.public void toArray(ArrayData dest, float resolution2)
ArrayData.length
.
If resolution2
is greater than 0, then points that are closer than
sqrt(resolution2)
from previous one will be skiped.
toArray
in class PointArray
resolution2
- The minimum squared distance desired between points.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |