+ * This estimate doesn't include the size of the {@link SpatialReference} object
+ * because instances of {@link SpatialReference} are expected to be shared among
+ * geometry objects.
+ *
+ * @return Returns an estimate of this object size in bytes.
+ */
+ public long estimateMemorySize() {
+ long sz = SIZE_OF_MAPGEOMETRY;
+ if (m_geometry != null)
+ sz += m_geometry.estimateMemorySize();
+ return sz;
+ }
+
@Override
public int hashCode() {
SpatialReference sr = getSpatialReference();
diff --git a/src/main/java/com/esri/core/geometry/OperatorDensifyByLength.java b/src/main/java/com/esri/core/geometry/OperatorDensifyByLength.java
index 085dd397..d9d9d692 100644
--- a/src/main/java/com/esri/core/geometry/OperatorDensifyByLength.java
+++ b/src/main/java/com/esri/core/geometry/OperatorDensifyByLength.java
@@ -49,7 +49,7 @@ public Type getType() {
* After that the curves are replaced with straight segments.
* @param progressTracker
* @return Returns the densified geometries (It does nothing to geometries
- * with dim < 1, but simply passes them along).
+ * with dim < 1, but simply passes them along).
*/
public abstract GeometryCursor execute(GeometryCursor inputGeometries,
double maxLength, ProgressTracker progressTracker);
@@ -67,7 +67,7 @@ public abstract GeometryCursor execute(GeometryCursor inputGeometries,
* After that the curves are replaced with straight segments.
* @param progressTracker
* @return Returns the densified geometry. (It does nothing to geometries
- * with dim < 1, but simply passes them along).
+ * with dim < 1, but simply passes them along).
*/
public abstract Geometry execute(Geometry inputGeometry, double maxLength,
ProgressTracker progressTracker);
diff --git a/src/main/java/com/esri/core/geometry/OperatorImportFromGeoJson.java b/src/main/java/com/esri/core/geometry/OperatorImportFromGeoJson.java
index 87de2d4a..2a25215d 100644
--- a/src/main/java/com/esri/core/geometry/OperatorImportFromGeoJson.java
+++ b/src/main/java/com/esri/core/geometry/OperatorImportFromGeoJson.java
@@ -34,7 +34,7 @@ public Type getType() {
* Performs the ImportFromGeoJson operation.
*
* @param type Use the {@link Geometry.Type} enum.
- * @param jsonObject The JSONObject holding the geometry and spatial reference.
+ * @param jsonReader The JSONReader.
* @return Returns the imported MapGeometry.
* @throws JsonGeometryException
*/
@@ -49,7 +49,6 @@ public Type getType() {
* @param type Use the {@link Geometry.Type} enum.
* @param geoJsonString The string holding the Geometry in geoJson format.
* @return Returns the imported MapGeometry.
- * @throws JSONException
*
*/
public abstract MapGeometry execute(int import_flags, Geometry.Type type, String geoJsonString, ProgressTracker progress_tracker);
@@ -61,7 +60,6 @@ public Type getType() {
* @param import_flags Use the {@link GeoJsonImportFlags} interface.
* @param geoJsonString The string holding the Geometry in geoJson format.
* @return Returns the imported MapOGCStructure.
- * @throws JSONException
*/
public abstract MapOGCStructure executeOGC(int import_flags, String geoJsonString, ProgressTracker progress_tracker);
diff --git a/src/main/java/com/esri/core/geometry/OperatorIntersection.java b/src/main/java/com/esri/core/geometry/OperatorIntersection.java
index ee3b4833..5afc6e37 100644
--- a/src/main/java/com/esri/core/geometry/OperatorIntersection.java
+++ b/src/main/java/com/esri/core/geometry/OperatorIntersection.java
@@ -53,12 +53,12 @@ public abstract GeometryCursor execute(GeometryCursor inputGeometries,
*@param sr The spatial reference is used to get tolerance value. Can be null, then the tolerance is not used and the operation is performed with
*a small tolerance value just enough to make the operation robust.
*@param progress_tracker Allows to cancel the operation. Can be null.
- *@param dimensionMask The dimension of the intersection. The value is either -1, or a bitmask mask of values (1 << dim).
+ *@param dimensionMask The dimension of the intersection. The value is either -1, or a bitmask mask of values (1 << dim).
*The value of -1 means the lower dimension in the intersecting pair.
*This is a fastest option when intersecting polygons with polygons or polylines.
- *The bitmask of values (1 << dim), where dim is the desired dimension value, is used to indicate
+ *The bitmask of values (1 << dim), where dim is the desired dimension value, is used to indicate
*what dimensions of geometry one wants to be returned. For example, to return
- *multipoints and lines only, pass (1 << 0) | (1 << 1), which is equivalen to 1 | 2, or 3.
+ *multipoints and lines only, pass (1 << 0) | (1 << 1), which is equivalen to 1 | 2, or 3.
*@return Returns the cursor of the intersection result. The cursors' getGeometryID method returns the current ID of the input geometry
*being processed. When dimensionMask is a bitmask, there will be n result geometries per one input geometry returned, where n is the number
*of bits set in the bitmask. For example, if the dimensionMask is 5, there will be two geometries per one input geometry.
@@ -81,7 +81,7 @@ public abstract GeometryCursor execute(GeometryCursor input_geometries,
*points, but the overlaps only).
*The call is equivalent to calling the overloaded method using cursors:
*execute(new SimpleGeometryCursor(input_geometry), new SimpleGeometryCursor(intersector), sr, progress_tracker, mask).next();
- *where mask can be either -1 or min(1 << input_geometry.getDimension(), 1 << intersector.getDimension());
+ *where mask can be either -1 or min(1 << input_geometry.getDimension(), 1 << intersector.getDimension());
*@param inputGeometry is the Geometry instance to be intersected by the intersector.
*@param intersector is the intersector Geometry.
*@param sr The spatial reference to get the tolerance value from. Can be null, then the tolerance is calculated from the input geometries.
diff --git a/src/main/java/com/esri/core/geometry/OperatorOffset.java b/src/main/java/com/esri/core/geometry/OperatorOffset.java
index 7b4f3673..bdcf5005 100644
--- a/src/main/java/com/esri/core/geometry/OperatorOffset.java
+++ b/src/main/java/com/esri/core/geometry/OperatorOffset.java
@@ -43,7 +43,7 @@ public enum JoinType {
*
* The offset operation creates a geometry that is a constant distance from
* an input polyline or polygon. It is similar to buffering, but produces a
- * one sided result. If offsetDistance > 0, then the offset geometry is
+ * one sided result. If offsetDistance greater than 0, then the offset geometry is
* constructed to the right of the oriented input geometry, otherwise it is
* constructed to the left. For a simple polygon, the orientation of outer
* rings is clockwise and for inner rings it is counter clockwise. So the
@@ -82,7 +82,7 @@ public abstract GeometryCursor execute(GeometryCursor inputGeometries,
*
* The offset operation creates a geometry that is a constant distance from
* an input polyline or polygon. It is similar to buffering, but produces a
- * one sided result. If offsetDistance > 0, then the offset geometry is
+ * one sided result. If offsetDistance greater than 0, then the offset geometry is
* constructed to the right of the oriented input geometry, otherwise it is
* constructed to the left. For a simple polygon, the orientation of outer
* rings is clockwise and for inner rings it is counter clockwise. So the
diff --git a/src/main/java/com/esri/core/geometry/Point.java b/src/main/java/com/esri/core/geometry/Point.java
index d96589ae..a421400f 100644
--- a/src/main/java/com/esri/core/geometry/Point.java
+++ b/src/main/java/com/esri/core/geometry/Point.java
@@ -39,7 +39,7 @@ public class Point extends Geometry implements Serializable {
//We are using writeReplace instead.
//private static final long serialVersionUID = 2L;
- double[] m_attributes; // use doubles to store everything (long are bitcast)
+ double[] m_attributes; // use doubles to store everything (long are bitcast)
/**
* Creates an empty 2D point.
@@ -626,22 +626,22 @@ public int hashCode() {
return hashCode;
}
- @Override
- public Geometry getBoundary() {
- return null;
- }
-
- @Override
- public void replaceNaNs(int semantics, double value) {
- addAttribute(semantics);
- if (isEmpty())
- return;
-
- int ncomps = VertexDescription.getComponentCount(semantics);
- for (int i = 0; i < ncomps; i++) {
- double v = getAttributeAsDbl(semantics, i);
- if (Double.isNaN(v))
- setAttribute(semantics, i, value);
- }
- }
+ @Override
+ public Geometry getBoundary() {
+ return null;
+ }
+
+ @Override
+ public void replaceNaNs(int semantics, double value) {
+ addAttribute(semantics);
+ if (isEmpty())
+ return;
+
+ int ncomps = VertexDescription.getComponentCount(semantics);
+ for (int i = 0; i < ncomps; i++) {
+ double v = getAttributeAsDbl(semantics, i);
+ if (Double.isNaN(v))
+ setAttribute(semantics, i, value);
+ }
+ }
}
diff --git a/src/main/java/com/esri/core/geometry/Point2D.java b/src/main/java/com/esri/core/geometry/Point2D.java
index 245b8156..90cc1e46 100644
--- a/src/main/java/com/esri/core/geometry/Point2D.java
+++ b/src/main/java/com/esri/core/geometry/Point2D.java
@@ -1,5 +1,5 @@
/*
- Copyright 1995-2015 Esri
+ Copyright 1995-2018 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -435,7 +435,7 @@ public boolean isNaN() {
}
/**
- * Calculates the orientation of the triangle formed by p->q->r. Returns 1
+ * Calculates the orientation of the triangle formed by p, q, r. Returns 1
* for counter-clockwise, -1 for clockwise, and 0 for collinear. May use
* high precision arithmetics for some special degenerate cases.
*/
diff --git a/src/main/java/com/esri/core/geometry/Polygon.java b/src/main/java/com/esri/core/geometry/Polygon.java
index a8298077..949a3797 100644
--- a/src/main/java/com/esri/core/geometry/Polygon.java
+++ b/src/main/java/com/esri/core/geometry/Polygon.java
@@ -1,5 +1,5 @@
/*
- Copyright 1995-2015 Esri
+ Copyright 1995-2018 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -145,39 +145,41 @@ public int getExteriorRingCount() {
return m_impl.getOGCPolygonCount();
}
- public interface FillRule {
- /**
- * odd-even fill rule. This is the default value. A point is in the polygon interior if a ray
- * from this point to infinity crosses odd number of segments of the polygon.
- */
- public final static int enumFillRuleOddEven = 0;
- /**
- * winding fill rule (aka non-zero winding rule). A point is in the polygon interior if a winding number is not zero.
- * To compute a winding number for a point, draw a ray from this point to infinity. If N is the number of times the ray
- * crosses segments directed up and the M is the number of times it crosses segments directed down,
- * then the winding number is equal to N-M.
- */
- public final static int enumFillRuleWinding = 1;
- };
-
- /**
- *Fill rule for the polygon that defines the interior of the self intersecting polygon. It affects the Simplify operation.
- *Can be use by drawing code to pass around the fill rule of graphic path.
- *This property is not persisted in any format yet.
- *See also Polygon.FillRule.
- */
- public void setFillRule(int rule) {
- m_impl.setFillRule(rule);
- }
-
- /**
- *Fill rule for the polygon that defines the interior of the self intersecting polygon. It affects the Simplify operation.
- *Changing the fill rule on the polygon that has no self intersections has no physical effect.
- *Can be use by drawing code to pass around the fill rule of graphic path.
- *This property is not persisted in any format yet.
- *See also Polygon.FillRule.
- */
- public int getFillRule() {
- return m_impl.getFillRule();
- }
+ public interface FillRule {
+ /**
+ * odd-even fill rule. This is the default value. A point is in the polygon
+ * interior if a ray from this point to infinity crosses odd number of segments
+ * of the polygon.
+ */
+ public final static int enumFillRuleOddEven = 0;
+ /**
+ * winding fill rule (aka non-zero winding rule). A point is in the polygon
+ * interior if a winding number is not zero. To compute a winding number for a
+ * point, draw a ray from this point to infinity. If N is the number of times
+ * the ray crosses segments directed up and the M is the number of times it
+ * crosses segments directed down, then the winding number is equal to N-M.
+ */
+ public final static int enumFillRuleWinding = 1;
+ };
+
+ /**
+ * Fill rule for the polygon that defines the interior of the self intersecting
+ * polygon. It affects the Simplify operation. Can be use by drawing code to
+ * pass around the fill rule of graphic path. This property is not persisted in
+ * any format yet. See also Polygon.FillRule.
+ */
+ public void setFillRule(int rule) {
+ m_impl.setFillRule(rule);
+ }
+
+ /**
+ * Fill rule for the polygon that defines the interior of the self intersecting
+ * polygon. It affects the Simplify operation. Changing the fill rule on the
+ * polygon that has no self intersections has no physical effect. Can be use by
+ * drawing code to pass around the fill rule of graphic path. This property is
+ * not persisted in any format yet. See also Polygon.FillRule.
+ */
+ public int getFillRule() {
+ return m_impl.getFillRule();
+ }
}
diff --git a/src/main/java/com/esri/core/geometry/Polyline.java b/src/main/java/com/esri/core/geometry/Polyline.java
index 0d842806..9f45d7ea 100644
--- a/src/main/java/com/esri/core/geometry/Polyline.java
+++ b/src/main/java/com/esri/core/geometry/Polyline.java
@@ -1,5 +1,5 @@
/*
- Copyright 1995-2015 Esri
+ Copyright 1995-2018 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/src/main/java/com/esri/core/geometry/SizeOf.java b/src/main/java/com/esri/core/geometry/SizeOf.java
index 86683a93..31460366 100644
--- a/src/main/java/com/esri/core/geometry/SizeOf.java
+++ b/src/main/java/com/esri/core/geometry/SizeOf.java
@@ -21,6 +21,7 @@
email: contracts@esri.com
*/
+
package com.esri.core.geometry;
import static sun.misc.Unsafe.ARRAY_BYTE_BASE_OFFSET;
@@ -38,90 +39,83 @@
import static sun.misc.Unsafe.ARRAY_SHORT_BASE_OFFSET;
import static sun.misc.Unsafe.ARRAY_SHORT_INDEX_SCALE;
-public final class SizeOf
-{
- public static final int SIZE_OF_ATTRIBUTE_STREAM_OF_FLOAT = 24;
+public final class SizeOf {
+ public static final int SIZE_OF_ATTRIBUTE_STREAM_OF_FLOAT = 24;
- public static final int SIZE_OF_ATTRIBUTE_STREAM_OF_DBL = 24;
+ public static final int SIZE_OF_ATTRIBUTE_STREAM_OF_DBL = 24;
- public static final int SIZE_OF_ATTRIBUTE_STREAM_OF_INT8 = 24;
+ public static final int SIZE_OF_ATTRIBUTE_STREAM_OF_INT8 = 24;
- public static final int SIZE_OF_ATTRIBUTE_STREAM_OF_INT16 = 24;
+ public static final int SIZE_OF_ATTRIBUTE_STREAM_OF_INT16 = 24;
- public static final int SIZE_OF_ATTRIBUTE_STREAM_OF_INT32 = 24;
+ public static final int SIZE_OF_ATTRIBUTE_STREAM_OF_INT32 = 24;
- public static final int SIZE_OF_ATTRIBUTE_STREAM_OF_INT64 = 24;
+ public static final int SIZE_OF_ATTRIBUTE_STREAM_OF_INT64 = 24;
- public static final int SIZE_OF_ENVELOPE = 32;
+ public static final int SIZE_OF_ENVELOPE = 32;
- public static final int SIZE_OF_ENVELOPE2D = 48;
+ public static final int SIZE_OF_ENVELOPE2D = 48;
- public static final int SIZE_OF_LINE = 56;
+ public static final int SIZE_OF_LINE = 56;
- public static final int SIZE_OF_MULTI_PATH = 24;
+ public static final int SIZE_OF_MULTI_PATH = 24;
- public static final int SIZE_OF_MULTI_PATH_IMPL = 112;
+ public static final int SIZE_OF_MULTI_PATH_IMPL = 112;
- public static final int SIZE_OF_MULTI_POINT = 24;
+ public static final int SIZE_OF_MULTI_POINT = 24;
- public static final int SIZE_OF_MULTI_POINT_IMPL = 56;
+ public static final int SIZE_OF_MULTI_POINT_IMPL = 56;
- public static final int SIZE_OF_POINT = 24;
+ public static final int SIZE_OF_POINT = 24;
- public static final int SIZE_OF_POLYGON = 24;
+ public static final int SIZE_OF_POLYGON = 24;
- public static final int SIZE_OF_POLYLINE = 24;
+ public static final int SIZE_OF_POLYLINE = 24;
- public static final int SIZE_OF_OGC_CONCRETE_GEOMETRY_COLLECTION = 24;
+ public static final int SIZE_OF_OGC_CONCRETE_GEOMETRY_COLLECTION = 24;
- public static final int SIZE_OF_OGC_LINE_STRING = 24;
+ public static final int SIZE_OF_OGC_LINE_STRING = 24;
- public static final int SIZE_OF_OGC_MULTI_LINE_STRING = 24;
+ public static final int SIZE_OF_OGC_MULTI_LINE_STRING = 24;
- public static final int SIZE_OF_OGC_MULTI_POINT = 24;
+ public static final int SIZE_OF_OGC_MULTI_POINT = 24;
- public static final int SIZE_OF_OGC_MULTI_POLYGON = 24;
+ public static final int SIZE_OF_OGC_MULTI_POLYGON = 24;
- public static final int SIZE_OF_OGC_POINT = 24;
+ public static final int SIZE_OF_OGC_POINT = 24;
- public static final int SIZE_OF_OGC_POLYGON = 24;
+ public static final int SIZE_OF_OGC_POLYGON = 24;
+
+ public static final int SIZE_OF_MAPGEOMETRY = 24;
- public static long sizeOfByteArray(int length)
- {
- return ARRAY_BYTE_BASE_OFFSET + (((long) ARRAY_BYTE_INDEX_SCALE) * length);
- }
+ public static long sizeOfByteArray(int length) {
+ return ARRAY_BYTE_BASE_OFFSET + (((long) ARRAY_BYTE_INDEX_SCALE) * length);
+ }
- public static long sizeOfShortArray(int length)
- {
- return ARRAY_SHORT_BASE_OFFSET + (((long) ARRAY_SHORT_INDEX_SCALE) * length);
- }
+ public static long sizeOfShortArray(int length) {
+ return ARRAY_SHORT_BASE_OFFSET + (((long) ARRAY_SHORT_INDEX_SCALE) * length);
+ }
- public static long sizeOfCharArray(int length)
- {
- return ARRAY_CHAR_BASE_OFFSET + (((long) ARRAY_CHAR_INDEX_SCALE) * length);
- }
+ public static long sizeOfCharArray(int length) {
+ return ARRAY_CHAR_BASE_OFFSET + (((long) ARRAY_CHAR_INDEX_SCALE) * length);
+ }
- public static long sizeOfIntArray(int length)
- {
- return ARRAY_INT_BASE_OFFSET + (((long) ARRAY_INT_INDEX_SCALE) * length);
- }
+ public static long sizeOfIntArray(int length) {
+ return ARRAY_INT_BASE_OFFSET + (((long) ARRAY_INT_INDEX_SCALE) * length);
+ }
- public static long sizeOfLongArray(int length)
- {
- return ARRAY_LONG_BASE_OFFSET + (((long) ARRAY_LONG_INDEX_SCALE) * length);
- }
+ public static long sizeOfLongArray(int length) {
+ return ARRAY_LONG_BASE_OFFSET + (((long) ARRAY_LONG_INDEX_SCALE) * length);
+ }
- public static long sizeOfFloatArray(int length)
- {
- return ARRAY_FLOAT_BASE_OFFSET + (((long) ARRAY_FLOAT_INDEX_SCALE) * length);
- }
+ public static long sizeOfFloatArray(int length) {
+ return ARRAY_FLOAT_BASE_OFFSET + (((long) ARRAY_FLOAT_INDEX_SCALE) * length);
+ }
- public static long sizeOfDoubleArray(int length)
- {
- return ARRAY_DOUBLE_BASE_OFFSET + (((long) ARRAY_DOUBLE_INDEX_SCALE) * length);
- }
+ public static long sizeOfDoubleArray(int length) {
+ return ARRAY_DOUBLE_BASE_OFFSET + (((long) ARRAY_DOUBLE_INDEX_SCALE) * length);
+ }
- private SizeOf()
- {
- }
+ private SizeOf() {
+ }
}
diff --git a/src/main/java/com/esri/core/geometry/SpatialReference.java b/src/main/java/com/esri/core/geometry/SpatialReference.java
index 22b0c74f..4c337e27 100644
--- a/src/main/java/com/esri/core/geometry/SpatialReference.java
+++ b/src/main/java/com/esri/core/geometry/SpatialReference.java
@@ -1,5 +1,5 @@
/*
- Copyright 1995-2017 Esri
+ Copyright 1995-2018 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/src/main/java/com/esri/core/geometry/ogc/OGCGeometry.java b/src/main/java/com/esri/core/geometry/ogc/OGCGeometry.java
index 4ad748be..a3f60a6d 100644
--- a/src/main/java/com/esri/core/geometry/ogc/OGCGeometry.java
+++ b/src/main/java/com/esri/core/geometry/ogc/OGCGeometry.java
@@ -1,5 +1,5 @@
/*
- Copyright 1995-2017 Esri
+ Copyright 1995-2018 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/src/test/java/com/esri/core/geometry/TestEstimateMemorySize.java b/src/test/java/com/esri/core/geometry/TestEstimateMemorySize.java
index ba516b5f..64d2bfc2 100644
--- a/src/test/java/com/esri/core/geometry/TestEstimateMemorySize.java
+++ b/src/test/java/com/esri/core/geometry/TestEstimateMemorySize.java
@@ -15,92 +15,81 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-public class TestEstimateMemorySize
-{
- @Test
- public void testInstanceSizes()
- {
- assertEquals(getInstanceSize(AttributeStreamOfFloat.class), SizeOf.SIZE_OF_ATTRIBUTE_STREAM_OF_FLOAT);
- assertEquals(getInstanceSize(AttributeStreamOfDbl.class), SizeOf.SIZE_OF_ATTRIBUTE_STREAM_OF_DBL);
- assertEquals(getInstanceSize(AttributeStreamOfInt8.class), SizeOf.SIZE_OF_ATTRIBUTE_STREAM_OF_INT8);
- assertEquals(getInstanceSize(AttributeStreamOfInt16.class), SizeOf.SIZE_OF_ATTRIBUTE_STREAM_OF_INT16);
- assertEquals(getInstanceSize(AttributeStreamOfInt32.class), SizeOf.SIZE_OF_ATTRIBUTE_STREAM_OF_INT32);
- assertEquals(getInstanceSize(AttributeStreamOfInt64.class), SizeOf.SIZE_OF_ATTRIBUTE_STREAM_OF_INT64);
- assertEquals(getInstanceSize(Envelope.class), SizeOf.SIZE_OF_ENVELOPE);
- assertEquals(getInstanceSize(Envelope2D.class), SizeOf.SIZE_OF_ENVELOPE2D);
- assertEquals(getInstanceSize(Line.class), SizeOf.SIZE_OF_LINE);
- assertEquals(getInstanceSize(MultiPath.class), SizeOf.SIZE_OF_MULTI_PATH);
- assertEquals(getInstanceSize(MultiPathImpl.class), SizeOf.SIZE_OF_MULTI_PATH_IMPL);
- assertEquals(getInstanceSize(MultiPoint.class), SizeOf.SIZE_OF_MULTI_POINT);
- assertEquals(getInstanceSize(MultiPointImpl.class), SizeOf.SIZE_OF_MULTI_POINT_IMPL);
- assertEquals(getInstanceSize(Point.class), SizeOf.SIZE_OF_POINT);
- assertEquals(getInstanceSize(Polygon.class), SizeOf.SIZE_OF_POLYGON);
- assertEquals(getInstanceSize(Polyline.class), SizeOf.SIZE_OF_POLYLINE);
- assertEquals(getInstanceSize(OGCConcreteGeometryCollection.class), SizeOf.SIZE_OF_OGC_CONCRETE_GEOMETRY_COLLECTION);
- assertEquals(getInstanceSize(OGCLineString.class), SizeOf.SIZE_OF_OGC_LINE_STRING);
- assertEquals(getInstanceSize(OGCMultiLineString.class), SizeOf.SIZE_OF_OGC_MULTI_LINE_STRING);
- assertEquals(getInstanceSize(OGCMultiPoint.class), SizeOf.SIZE_OF_OGC_MULTI_POINT);
- assertEquals(getInstanceSize(OGCMultiPolygon.class), SizeOf.SIZE_OF_OGC_MULTI_POLYGON);
- assertEquals(getInstanceSize(OGCPoint.class), SizeOf.SIZE_OF_OGC_POINT);
- assertEquals(getInstanceSize(OGCPolygon.class), SizeOf.SIZE_OF_OGC_POLYGON);
- }
+public class TestEstimateMemorySize {
+ @Test
+ public void testInstanceSizes() {
+ assertEquals(getInstanceSize(AttributeStreamOfFloat.class), SizeOf.SIZE_OF_ATTRIBUTE_STREAM_OF_FLOAT);
+ assertEquals(getInstanceSize(AttributeStreamOfDbl.class), SizeOf.SIZE_OF_ATTRIBUTE_STREAM_OF_DBL);
+ assertEquals(getInstanceSize(AttributeStreamOfInt8.class), SizeOf.SIZE_OF_ATTRIBUTE_STREAM_OF_INT8);
+ assertEquals(getInstanceSize(AttributeStreamOfInt16.class), SizeOf.SIZE_OF_ATTRIBUTE_STREAM_OF_INT16);
+ assertEquals(getInstanceSize(AttributeStreamOfInt32.class), SizeOf.SIZE_OF_ATTRIBUTE_STREAM_OF_INT32);
+ assertEquals(getInstanceSize(AttributeStreamOfInt64.class), SizeOf.SIZE_OF_ATTRIBUTE_STREAM_OF_INT64);
+ assertEquals(getInstanceSize(Envelope.class), SizeOf.SIZE_OF_ENVELOPE);
+ assertEquals(getInstanceSize(Envelope2D.class), SizeOf.SIZE_OF_ENVELOPE2D);
+ assertEquals(getInstanceSize(Line.class), SizeOf.SIZE_OF_LINE);
+ assertEquals(getInstanceSize(MultiPath.class), SizeOf.SIZE_OF_MULTI_PATH);
+ assertEquals(getInstanceSize(MultiPathImpl.class), SizeOf.SIZE_OF_MULTI_PATH_IMPL);
+ assertEquals(getInstanceSize(MultiPoint.class), SizeOf.SIZE_OF_MULTI_POINT);
+ assertEquals(getInstanceSize(MultiPointImpl.class), SizeOf.SIZE_OF_MULTI_POINT_IMPL);
+ assertEquals(getInstanceSize(Point.class), SizeOf.SIZE_OF_POINT);
+ assertEquals(getInstanceSize(Polygon.class), SizeOf.SIZE_OF_POLYGON);
+ assertEquals(getInstanceSize(Polyline.class), SizeOf.SIZE_OF_POLYLINE);
+ assertEquals(getInstanceSize(OGCConcreteGeometryCollection.class),
+ SizeOf.SIZE_OF_OGC_CONCRETE_GEOMETRY_COLLECTION);
+ assertEquals(getInstanceSize(OGCLineString.class), SizeOf.SIZE_OF_OGC_LINE_STRING);
+ assertEquals(getInstanceSize(OGCMultiLineString.class), SizeOf.SIZE_OF_OGC_MULTI_LINE_STRING);
+ assertEquals(getInstanceSize(OGCMultiPoint.class), SizeOf.SIZE_OF_OGC_MULTI_POINT);
+ assertEquals(getInstanceSize(OGCMultiPolygon.class), SizeOf.SIZE_OF_OGC_MULTI_POLYGON);
+ assertEquals(getInstanceSize(OGCPoint.class), SizeOf.SIZE_OF_OGC_POINT);
+ assertEquals(getInstanceSize(OGCPolygon.class), SizeOf.SIZE_OF_OGC_POLYGON);
+ }
- private static