|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.geotools.renderer.array.PointArray
org.geotools.renderer.array.DefaultArray
Default implementation of PointArray wrapping an array of (x,y)
coordinates as a flat float[] array. The default implementation is immutable and
doesn't use any compression technic. However, subclasses may be mutable (i.e. support the
insertAt(...) method) or compress data.
getInstance(float[], int, int, boolean),
Serialized Form| Field Summary | |
protected float[] |
array
The array of (x,y) coordinates. |
| Constructor Summary | |
DefaultArray(float[] array)
Wrap the given (x,y) array. |
|
| Method Summary | |
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. |
static PointArray |
getInstance(float[] array,
int lower,
int upper,
boolean copy)
Returns a PointArray object wrapping the given (x,y)
array between the specified bounds. |
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 index)
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. |
protected int |
lower()
Returns the index of the first valid ordinate (inclusive). |
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. |
protected int |
upper()
Returns the index after the last valid ordinate. |
| 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 |
| Field Detail |
protected float[] array
| Constructor Detail |
public DefaultArray(float[] array)
throws java.lang.IllegalArgumentException
array (i.e. the array is not copied). Do not modify the
data after construction if this DefaultArray should be immutable.
array - The array of (x,y) coordinates.
java.lang.IllegalArgumentException - if the array's length is not even.| Method Detail |
public static PointArray getInstance(float[] array,
int lower,
int upper,
boolean copy)
PointArray object wrapping the given (x,y)
array between the specified bounds. If the array doesn't contains any data (i.e. if
lower==upper), then this method returns null.
array - The array of (x,y) coordinates.lower - Index of the first x ordinate in array.upper - Index after the last y oordinate in array.
The difference upper-lower must be even.copy - true if this method should copy the array (in order to
protect the PointArray from changes), or false
for a direct reference without copying. In the later case, the caller is
responsable to ensure that the array will not be modified externally.
PointArray object wrapping the given array.protected int lower()
protected int upper()
public final int count()
count in interface RandomAccesscount in class PointArraypublic long getMemoryUsage()
array reference).
getMemoryUsage in class PointArraypublic final 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 PointArraypoint - The object in which to store the first point, or null.
point or a new Point2D, which contains the first point.public final 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 PointArraypoint - 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 index)
throws java.lang.IndexOutOfBoundsException
getValue in interface RandomAccessindex - The index from 0 inclusive to count() exclusive.
java.lang.IndexOutOfBoundsException - if index is out of bounds.public final PointIterator iterator(int index)
iterator in class PointArrayindex - Index of the first point to returns in the iteration.
public final java.awt.geom.Rectangle2D getBounds2D()
null.
getBounds2D in class PointArray
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 PointArraylower - 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?.
Si le drapeau reverse ? la valeur true, alors les points de
toMerge seront copi?es en ordre inverse.
insertAt in class PointArrayindex - 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 PointArraythis 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)
insertAt(int, float[], int, int, boolean) ou reverse()) vont retourner un autre
tableau de fa?on ? ne pas modifier le tableau immutable.
getFinal in class PointArraylevel - 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 final 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 PointArrayresolution2 - The minimum squared distance desired between points.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||