[Geom4j-developer] SF.net SVN: geom4j:[24] trunk
Status: Pre-Alpha
Brought to you by:
skhenkin
|
From: <skh...@us...> - 2009-12-25 22:05:33
|
Revision: 24
http://geom4j.svn.sourceforge.net/geom4j/?rev=24&view=rev
Author: skhenkin
Date: 2009-12-25 22:05:23 +0000 (Fri, 25 Dec 2009)
Log Message:
-----------
Javadocs improved.
Build script supports building binary and source distributions.
System properties supported.
Modified Paths:
--------------
trunk/build.xml
trunk/src/net/sourceforge/geom4j/BasicFigure.java
trunk/src/net/sourceforge/geom4j/ClosestPairOfPointsAlgorithm.java
trunk/src/net/sourceforge/geom4j/ClosestPairOfPointsAlgorithmTest.java
trunk/src/net/sourceforge/geom4j/CompoundFigure.java
trunk/src/net/sourceforge/geom4j/Config.java
trunk/src/net/sourceforge/geom4j/ConvexHullAlgorithm.java
trunk/src/net/sourceforge/geom4j/ConvexHullAlgorithmTest.java
trunk/src/net/sourceforge/geom4j/DistanceTest.java
trunk/src/net/sourceforge/geom4j/EmptyFigure.java
trunk/src/net/sourceforge/geom4j/EmptyFigureTest.java
trunk/src/net/sourceforge/geom4j/Figure.java
trunk/src/net/sourceforge/geom4j/IntersectionTest.java
trunk/src/net/sourceforge/geom4j/Line.java
trunk/src/net/sourceforge/geom4j/LineTest.java
trunk/src/net/sourceforge/geom4j/Point.java
trunk/src/net/sourceforge/geom4j/PointPair.java
trunk/src/net/sourceforge/geom4j/PointPairTest.java
trunk/src/net/sourceforge/geom4j/PointSet.java
trunk/src/net/sourceforge/geom4j/PointTest.java
trunk/src/net/sourceforge/geom4j/Polygon.java
trunk/src/net/sourceforge/geom4j/PolygonTest.java
trunk/src/net/sourceforge/geom4j/PolygonTriangulationAlgorithm.java
trunk/src/net/sourceforge/geom4j/PolygonTriangulationAlgorithmTest.java
trunk/src/net/sourceforge/geom4j/Segment.java
trunk/src/net/sourceforge/geom4j/SegmentIntersectionAlgorithm.java
trunk/src/net/sourceforge/geom4j/SegmentIntersectionAlgorithmTest.java
trunk/src/net/sourceforge/geom4j/SegmentSet.java
trunk/src/net/sourceforge/geom4j/SegmentTest.java
trunk/src/net/sourceforge/geom4j/Triangle.java
trunk/src/net/sourceforge/geom4j/TriangleTest.java
trunk/src/net/sourceforge/geom4j/Triangulation.java
trunk/src/net/sourceforge/geom4j/TriangulationTest.java
trunk/src/net/sourceforge/geom4j/Vector.java
trunk/src/net/sourceforge/geom4j/VectorTest.java
trunk/src/net/sourceforge/geom4j/demo/Demo.java
trunk/src/net/sourceforge/geom4j/util/AVLTree.java
trunk/src/net/sourceforge/geom4j/util/AVLTreeTest.java
trunk/src/net/sourceforge/geom4j/util/BinarySearchTree.java
trunk/src/net/sourceforge/geom4j/util/BinarySearchTreeTest.java
trunk/src/net/sourceforge/geom4j/util/BinarySearchTreeTestBase.java
trunk/src/net/sourceforge/geom4j/util/BinaryTreeBasedSmartQueue.java
trunk/src/net/sourceforge/geom4j/util/BinaryTreeBasedSmartQueueTest.java
trunk/src/net/sourceforge/geom4j/util/ListBasedSmartQueue.java
trunk/src/net/sourceforge/geom4j/util/ListBasedSmartQueueTest.java
trunk/src/net/sourceforge/geom4j/util/SearchTree.java
trunk/src/net/sourceforge/geom4j/util/SmartQueue.java
trunk/src/net/sourceforge/geom4j/util/SmartQueueTestBase.java
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/build.xml 2009-12-25 22:05:23 UTC (rev 24)
@@ -1,12 +1,13 @@
<project name="geom4j" basedir="." default="all">
+ <property name="app.version" value="1.0.0"/>
<property name="src.dir" value="${basedir}/src"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="build.dir" value="${basedir}/build"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="debug.classes.dir" value="${build.dir}/classes-debug"/>
- <property name="app.jar" value="${build.dir}/${ant.project.name}.jar"/>
- <property name="app.tests.jar" value="${build.dir}/${ant.project.name}-tests.jar"/>
+ <property name="app.jar" value="${build.dir}/${ant.project.name}-${app.version}.jar"/>
+ <property name="app.tests.jar" value="${build.dir}/${ant.project.name}-${app.version}-tests.jar"/>
<property name="demo.main.class" value="net.sourceforge.geom4j.demo.Demo"/>
<property name="test.reports.dir" value="${build.dir}/test-reports"/>
<property name="junit.dir" value="${lib.dir}/junit"/>
@@ -14,6 +15,10 @@
<property name="instrumented.classes.dir" value="${build.dir}/instrumented-classes"/>
<property name="coverage.file" value="${build.dir}/cobertura.ser"/>
<property name="coverage.report.dir" value="${build.dir}/coverage-report"/>
+ <property name="app.bin.zip" value="${build.dir}/${ant.project.name}-${app.version}-bin.zip"/>
+ <property name="app.bin.tgz" value="${build.dir}/${ant.project.name}-${app.version}-bin.tar.gz"/>
+ <property name="app.src.zip" value="${build.dir}/${ant.project.name}-${app.version}-src.zip"/>
+ <property name="app.src.tgz" value="${build.dir}/${ant.project.name}-${app.version}-src.tar.gz"/>
<path id="junit.classpath">
<fileset dir="${junit.dir}" includes="**/*.jar"/>
@@ -52,6 +57,31 @@
includes="**/*Test.class" />
</target>
+ <target name="package-binaries" depends="package-application, package-tests">
+ <zip destfile="${app.bin.zip}">
+ <fileset dir="${build.dir}"
+ includes="*.jar" />
+ <fileset dir="${basedir}"
+ includes="LICENSE.txt"/>
+ </zip>
+ <tar destfile="${app.bin.tgz}"
+ compression="gzip">
+ <zipfileset src="${app.bin.zip}" />
+ </tar>
+ </target>
+
+ <target name="package-sources" depends="package-application">
+ <zip destfile="${app.src.zip}">
+ <fileset dir="${src.dir}" />
+ <fileset dir="${basedir}"
+ includes="LICENSE.txt"/>
+ </zip>
+ <tar destfile="${app.src.tgz}"
+ compression="gzip">
+ <zipfileset src="${app.src.zip}" />
+ </tar>
+ </target>
+
<target name="unit-test" depends="package-application, package-tests">
<mkdir dir="${test.reports.dir}"/>
<junit printsummary="yes" fork="yes" haltonfailure="yes">
@@ -77,7 +107,8 @@
classpath="${app.jar}" />
</target>
- <target name="all" depends="package-application, package-tests, unit-test, run-demo"/>
+ <target name="all" depends="package-application, package-binaries,
+ package-sources, package-tests, unit-test, run-demo" />
<target name="compile-debug">
<mkdir dir="${debug.classes.dir}"/>
Modified: trunk/src/net/sourceforge/geom4j/BasicFigure.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/BasicFigure.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/BasicFigure.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -19,6 +19,7 @@
* A basic or primitive figure like point, line, etc.
*
* @author Sergey Khenkin
+ * @since 1.0.0
*/
public abstract class BasicFigure extends Figure {
Modified: trunk/src/net/sourceforge/geom4j/ClosestPairOfPointsAlgorithm.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/ClosestPairOfPointsAlgorithm.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/ClosestPairOfPointsAlgorithm.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -27,6 +27,7 @@
* with the smallest distance between them.
*
* @author Sergey Khenkin
+ * @since 1.0.0
*/
public interface ClosestPairOfPointsAlgorithm {
Modified: trunk/src/net/sourceforge/geom4j/ClosestPairOfPointsAlgorithmTest.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/ClosestPairOfPointsAlgorithmTest.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/ClosestPairOfPointsAlgorithmTest.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -22,6 +22,12 @@
import org.junit.Before;
import org.junit.Test;
+/**
+ * Tests for finding closest pair of points algorithm
+ *
+ * @author Sergey Khenkin
+ * @since 1.0.0
+ */
public class ClosestPairOfPointsAlgorithmTest {
private PointSet ps;
Modified: trunk/src/net/sourceforge/geom4j/CompoundFigure.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/CompoundFigure.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/CompoundFigure.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -26,6 +26,7 @@
* Can use CompoundFigure<? extends Figure> for arbitrary figures.
*
* @author Sergey Khenkin
+ * @since 1.0.0
*/
public class CompoundFigure<F extends Figure> extends Figure implements Iterable<F> {
protected Set<F> figures = new HashSet<F>();
Modified: trunk/src/net/sourceforge/geom4j/Config.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/Config.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/Config.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -15,10 +15,28 @@
package net.sourceforge.geom4j;
+/**
+ * Global configuration parameters.
+ * You can specify the following parameters:
+ * <ul>
+ * <li>geom4j.precision - precision of the floating point calculations,
+ * e.g. 0.000001, 1E-6</li>
+ * </ul>
+ *
+ * @author Sergey Khenkin
+ * @since 1.0.0
+ */
public class Config {
- private static double DEFAULT_PRECISION = 1E-6;
- private static double precision = DEFAULT_PRECISION;
+ private static final String PRECISION_PARAMETER_NAME = "geom4j.precision";
+ private static final double DEFAULT_PRECISION = 1E-6;
+ private static double precision;
+ static {
+ // initialize configuration parameters
+ precision = getSystemPropertyAsDouble(PRECISION_PARAMETER_NAME,
+ DEFAULT_PRECISION);
+ }
+
public static double getPrecision() {
return precision;
}
@@ -72,4 +90,14 @@
public static boolean isZero(double x) {
return x < precision && x > -precision;
}
+
+ private static double getSystemPropertyAsDouble(
+ String propertyName, double defaultValue) {
+ String parameterString = System.getProperty(propertyName);
+ if (parameterString == null) {
+ return defaultValue;
+ } else {
+ return Double.parseDouble(parameterString);
+ }
+ }
}
Modified: trunk/src/net/sourceforge/geom4j/ConvexHullAlgorithm.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/ConvexHullAlgorithm.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/ConvexHullAlgorithm.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -25,6 +25,7 @@
* The convex hull is represented as a polygon.
*
* @author Sergey Khenkin
+ * @since 1.0.0
*/
public interface ConvexHullAlgorithm {
/** Execute the algorithm and find the convex hull for a given point set */
Modified: trunk/src/net/sourceforge/geom4j/ConvexHullAlgorithmTest.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/ConvexHullAlgorithmTest.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/ConvexHullAlgorithmTest.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -22,6 +22,12 @@
import org.junit.Before;
import org.junit.Test;
+/**
+ * Tests for convex hull algorithms
+ *
+ * @author Sergey Khenkin
+ * @since 1.0.0
+ */
public class ConvexHullAlgorithmTest {
private PointSet ps;
private Polygon ch;
Modified: trunk/src/net/sourceforge/geom4j/DistanceTest.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/DistanceTest.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/DistanceTest.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -20,6 +20,12 @@
import org.junit.Before;
import org.junit.Test;
+/**
+ * Tests for distance calculation
+ *
+ * @author Sergey Khenkin
+ * @since 1.0.0
+ */
public class DistanceTest {
@Before
@@ -86,7 +92,6 @@
@Test
public void testPolygonDistance() {
- // TODO: refactor this and other tests using varargs
Figure p = new Point(10, 20);
Figure square = new Polygon(
new Point(0, 0),
Modified: trunk/src/net/sourceforge/geom4j/EmptyFigure.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/EmptyFigure.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/EmptyFigure.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -21,6 +21,7 @@
* Only one instance of this class is actually instantiated via the singleton pattern.
*
* @author Sergey Khenkin
+ * @since 1.0.0
*/
public final class EmptyFigure extends BasicFigure {
private static final EmptyFigure emptyFigure = new EmptyFigure();
Modified: trunk/src/net/sourceforge/geom4j/EmptyFigureTest.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/EmptyFigureTest.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/EmptyFigureTest.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -20,6 +20,12 @@
import org.junit.Before;
import org.junit.Test;
+/**
+ * Tests for empty figure
+ *
+ * @author Sergey Khenkin
+ * @since 1.0.0
+ */
public class EmptyFigureTest {
@Before
Modified: trunk/src/net/sourceforge/geom4j/Figure.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/Figure.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/Figure.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -20,6 +20,7 @@
* Examples of figures: a point, a set of points, a line, a polygon, etc.
*
* @author Sergey Khenkin
+ * @since 1.0.0
*/
public abstract class Figure {
/** An empty figure, i.e. a figure containing no points */
Modified: trunk/src/net/sourceforge/geom4j/IntersectionTest.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/IntersectionTest.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/IntersectionTest.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -21,6 +21,12 @@
import org.junit.Before;
import org.junit.Test;
+/**
+ * Tests for figure intersections
+ *
+ * @author Sergey Khenkin
+ * @since 1.0.0
+ */
public class IntersectionTest {
@Before
Modified: trunk/src/net/sourceforge/geom4j/Line.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/Line.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/Line.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -20,6 +20,7 @@
* Passes through two points and goes infinitely in both directions.
*
* @author Sergey Khenkin
+ * @since 1.0.0
*/
public final class Line extends BasicFigure {
private Point p1;
Modified: trunk/src/net/sourceforge/geom4j/LineTest.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/LineTest.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/LineTest.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -19,6 +19,12 @@
import org.junit.Test;
+/**
+ * Tests for straight line figure
+ *
+ * @author Sergey Khenkin
+ * @since 1.0.0
+ */
public class LineTest {
@Test
Modified: trunk/src/net/sourceforge/geom4j/Point.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/Point.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/Point.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -20,6 +20,7 @@
* Has two double coordinates (x,y).
*
* @author Sergey Khenkin
+ * @since 1.0.0
*/
public final class Point extends BasicFigure {
private double x;
Modified: trunk/src/net/sourceforge/geom4j/PointPair.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/PointPair.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/PointPair.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -19,6 +19,7 @@
* A pair of points in a plane
*
* @author Sergey Khenkin
+ * @since 1.0.0
*/
public class PointPair {
private Point firstPoint;
Modified: trunk/src/net/sourceforge/geom4j/PointPairTest.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/PointPairTest.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/PointPairTest.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -19,6 +19,12 @@
import org.junit.Test;
+/**
+ * Tests for point pair figure
+ *
+ * @author Sergey Khenkin
+ * @since 1.0.0
+ */
public class PointPairTest {
@Test
Modified: trunk/src/net/sourceforge/geom4j/PointSet.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/PointSet.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/PointSet.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -18,6 +18,12 @@
import java.util.Arrays;
import java.util.Collection;
+/**
+ * Set of points
+ *
+ * @author Sergey Khenkin
+ * @since 1.0.0
+ */
public class PointSet extends CompoundFigure<Point> {
/** An empty point set */
public static final PointSet EMPTY = new PointSet();
Modified: trunk/src/net/sourceforge/geom4j/PointTest.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/PointTest.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/PointTest.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -18,6 +18,12 @@
import static org.junit.Assert.*;
import org.junit.Test;
+/**
+ * Tests for point figure
+ *
+ * @author Sergey Khenkin
+ * @since 1.0.0
+ */
public class PointTest {
@Test
Modified: trunk/src/net/sourceforge/geom4j/Polygon.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/Polygon.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/Polygon.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -23,6 +23,7 @@
* A polygon is a closed shape in a plane.
*
* @author Sergey Khenkin
+ * @since 1.0.0
*/
public class Polygon extends BasicFigure {
// TODO: think of making this class also immutable
@@ -257,7 +258,7 @@
* Create polygon triangulation
*/
public Triangulation triangulate() {
- return triangulate(PolygonTriangulationAlgorithm.NAIVE);
+ return triangulate(PolygonTriangulationAlgorithm.CONVEX);
}
/**
Modified: trunk/src/net/sourceforge/geom4j/PolygonTest.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/PolygonTest.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/PolygonTest.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -20,6 +20,12 @@
import org.junit.Before;
import org.junit.Test;
+/**
+ * Tests for polygon figure
+ *
+ * @author Sergey Khenkin
+ * @since 1.0.0
+ */
public class PolygonTest {
Polygon p = new Polygon();
Modified: trunk/src/net/sourceforge/geom4j/PolygonTriangulationAlgorithm.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/PolygonTriangulationAlgorithm.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/PolygonTriangulationAlgorithm.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -19,6 +19,7 @@
* A polygon triangulation algorithm.
*
* @author Sergey Khenkin
+ * @since 1.0.0
*/
public interface PolygonTriangulationAlgorithm {
@@ -31,9 +32,9 @@
/**
- * Naive algorithm
+ * Straightforward algorithm for convex polygon triangulation
*/
- static PolygonTriangulationAlgorithm NAIVE = new PolygonTriangulationAlgorithm() {
+ static PolygonTriangulationAlgorithm CONVEX = new PolygonTriangulationAlgorithm() {
@Override
public Triangulation run(Polygon polygon) {
Triangulation triangulation = new Triangulation();
Modified: trunk/src/net/sourceforge/geom4j/PolygonTriangulationAlgorithmTest.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/PolygonTriangulationAlgorithmTest.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/PolygonTriangulationAlgorithmTest.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -19,6 +19,12 @@
import org.junit.Test;
+/**
+ * Tests for polygon triangulation algorithms
+ *
+ * @author Sergey Khenkin
+ * @since 1.0.0
+ */
public class PolygonTriangulationAlgorithmTest {
@Test
Modified: trunk/src/net/sourceforge/geom4j/Segment.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/Segment.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/Segment.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -20,6 +20,7 @@
* A set of points of the line lying between start point and end point.
*
* @author Sergey Khenkin
+ * @since 1.0.0
*/
public final class Segment extends BasicFigure {
private Point startPoint;
Modified: trunk/src/net/sourceforge/geom4j/SegmentIntersectionAlgorithm.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/SegmentIntersectionAlgorithm.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/SegmentIntersectionAlgorithm.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -25,6 +25,7 @@
* segments.
*
* @author Sergey Khenkin
+ * @since 1.0.0
*/
public interface SegmentIntersectionAlgorithm {
Modified: trunk/src/net/sourceforge/geom4j/SegmentIntersectionAlgorithmTest.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/SegmentIntersectionAlgorithmTest.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/SegmentIntersectionAlgorithmTest.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -7,6 +7,12 @@
import org.junit.Before;
import org.junit.Test;
+/**
+ * Tests for segment intersection algorithms
+ *
+ * @author Sergey Khenkin
+ * @since 1.0.0
+ */
public class SegmentIntersectionAlgorithmTest {
SegmentSet ss1;
PointSet ps1;
Modified: trunk/src/net/sourceforge/geom4j/SegmentSet.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/SegmentSet.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/SegmentSet.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -21,6 +21,7 @@
* A set of segments
*
* @author Sergey Khenkin
+ * @since 1.0.0
*/
public class SegmentSet extends CompoundFigure<Segment> {
Modified: trunk/src/net/sourceforge/geom4j/SegmentTest.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/SegmentTest.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/SegmentTest.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -19,6 +19,12 @@
import org.junit.Test;
+/**
+ * Tests for segment figure
+ *
+ * @author Sergey Khenkin
+ * @since 1.0.0
+ */
public class SegmentTest {
@Test
public void testLength() {
Modified: trunk/src/net/sourceforge/geom4j/Triangle.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/Triangle.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/Triangle.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -20,6 +20,7 @@
* Implemented as a specialized variation of a polygon.
*
* @author Sergey Khenkin
+ * @since 1.0.0
*/
public class Triangle extends Polygon {
public Triangle(Point a, Point b, Point c) {
Modified: trunk/src/net/sourceforge/geom4j/TriangleTest.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/TriangleTest.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/TriangleTest.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -19,6 +19,12 @@
import org.junit.Test;
+/**
+ * Tests for triangle figure
+ *
+ * @author Sergey Khenkin
+ * @since 1.0.0
+ */
public class TriangleTest {
@Test
public void testTriangleConstruction() {
Modified: trunk/src/net/sourceforge/geom4j/Triangulation.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/Triangulation.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/Triangulation.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -19,6 +19,7 @@
* A polygon triangulation, actually a set of triangles.
*
* @author Sergey Khenkin
+ * @since 1.0.0
*/
public class Triangulation extends CompoundFigure<Triangle> {
/**
Modified: trunk/src/net/sourceforge/geom4j/TriangulationTest.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/TriangulationTest.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/TriangulationTest.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -19,6 +19,12 @@
import org.junit.Test;
+/**
+ * Tests for triangulation figure
+ *
+ * @author Sergey Khenkin
+ * @since 1.0.0
+ */
public class TriangulationTest {
@Test
public void testTriangulationVertices() {
Modified: trunk/src/net/sourceforge/geom4j/Vector.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/Vector.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/Vector.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -21,6 +21,7 @@
* Actually this is a 2-component vector of double values.
*
* @author Sergey Khenkin
+ * @since 1.0.0
*/
public class Vector {
private double x;
Modified: trunk/src/net/sourceforge/geom4j/VectorTest.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/VectorTest.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/VectorTest.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -20,6 +20,12 @@
import org.junit.Before;
import org.junit.Test;
+/**
+ * Tests for vectors
+ *
+ * @author Sergey Khenkin
+ * @since 1.0.0
+ */
public class VectorTest {
@Before
Modified: trunk/src/net/sourceforge/geom4j/demo/Demo.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/demo/Demo.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/demo/Demo.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -34,6 +34,7 @@
* Most probably will be a part of documentation later on.
*
* @author Sergey Khenkin
+ * @since 1.0.0
*/
public class Demo {
Modified: trunk/src/net/sourceforge/geom4j/util/AVLTree.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/util/AVLTree.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/util/AVLTree.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -37,6 +37,7 @@
* @param <E> type of values stored in the tree
*
* @author Sergey Khenkin
+ * @since 1.0.0
*/
public class AVLTree<E> extends BinarySearchTree<E> {
Modified: trunk/src/net/sourceforge/geom4j/util/AVLTreeTest.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/util/AVLTreeTest.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/util/AVLTreeTest.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -23,6 +23,12 @@
import org.junit.Before;
import org.junit.Test;
+/**
+ * Tests for AVL self-balancing tree
+ *
+ * @author Sergey Khenkin
+ * @since 1.0.0
+ */
public class AVLTreeTest extends BinarySearchTreeTestBase {
@Before
Modified: trunk/src/net/sourceforge/geom4j/util/BinarySearchTree.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/util/BinarySearchTree.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/util/BinarySearchTree.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -33,6 +33,7 @@
* @param <E> type of values stored in the tree
*
* @author Sergey Khenkin
+ * @since 1.0.0
*/
public class BinarySearchTree<E> implements SearchTree<E> {
Modified: trunk/src/net/sourceforge/geom4j/util/BinarySearchTreeTest.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/util/BinarySearchTreeTest.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/util/BinarySearchTreeTest.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -20,6 +20,12 @@
import org.junit.Before;
import org.junit.Test;
+/**
+ * Tests for binary tree
+ *
+ * @author Sergey Khenkin
+ * @since 1.0.0
+ */
public class BinarySearchTreeTest extends BinarySearchTreeTestBase {
@Before
Modified: trunk/src/net/sourceforge/geom4j/util/BinarySearchTreeTestBase.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/util/BinarySearchTreeTestBase.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/util/BinarySearchTreeTestBase.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -36,6 +36,7 @@
* subclasses.
*
* @author Sergey Khenkin
+ * @since 1.0.0
*/
public abstract class BinarySearchTreeTestBase {
Modified: trunk/src/net/sourceforge/geom4j/util/BinaryTreeBasedSmartQueue.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/util/BinaryTreeBasedSmartQueue.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/util/BinaryTreeBasedSmartQueue.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -27,6 +27,7 @@
* swap() - for swapping two elements present in the tree.
*
* @author Sergey Khenkin
+ * @since 1.0.0
*/
public class BinaryTreeBasedSmartQueue<E> extends AVLTree<E>
implements SmartQueue<E> {
Modified: trunk/src/net/sourceforge/geom4j/util/BinaryTreeBasedSmartQueueTest.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/util/BinaryTreeBasedSmartQueueTest.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/util/BinaryTreeBasedSmartQueueTest.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -19,6 +19,12 @@
import org.junit.Test;
+/**
+ * Tests for smart queue implementation based on a binary tree
+ *
+ * @author Sergey Khenkin
+ * @since 1.0.0
+ */
public class BinaryTreeBasedSmartQueueTest extends SmartQueueTestBase {
@Override
protected SmartQueue<String> getQueueInstance() {
Modified: trunk/src/net/sourceforge/geom4j/util/ListBasedSmartQueue.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/util/ListBasedSmartQueue.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/util/ListBasedSmartQueue.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -28,6 +28,7 @@
* efficient one of time O(log n) is ready.
*
* @author Sergey Khenkin
+ * @since 1.0.0
*/
public class ListBasedSmartQueue<E> implements SmartQueue<E> {
/** List that stores queue elements */
Modified: trunk/src/net/sourceforge/geom4j/util/ListBasedSmartQueueTest.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/util/ListBasedSmartQueueTest.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/util/ListBasedSmartQueueTest.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -20,6 +20,12 @@
import org.junit.Test;
+/**
+ * Tests for smart queue implementation based on a list
+ *
+ * @author Sergey Khenkin
+ * @since 1.0.0
+ */
public class ListBasedSmartQueueTest extends SmartQueueTestBase {
@Override
protected SmartQueue<String> getQueueInstance() {
Modified: trunk/src/net/sourceforge/geom4j/util/SearchTree.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/util/SearchTree.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/util/SearchTree.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -25,6 +25,7 @@
* Tree stores only unique elements.
*
* @author Sergey Khenkin
+ * @since 1.0.0
*/
public interface SearchTree<E> extends Iterable<E> {
/**
Modified: trunk/src/net/sourceforge/geom4j/util/SmartQueue.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/util/SmartQueue.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/util/SmartQueue.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -17,16 +17,19 @@
/**
* SmartQueue is a priority queue which with the following properties:
- * - only unique elements are stored;
- * - elements are kept sorted according to some order;
- * - elements can be inserted and removed efficiently;
- * - first element (smallest) can be extracted from the queue;
- * - for any element immediately previous and immediately next
- * elements can be obtained;
- * - any pair of elements can be swapped.
+ * <ul>
+ * <li>only unique elements are stored;</li>
+ * <li>elements are kept sorted according to some order;</li>
+ * <li>elements can be inserted and removed efficiently;</li>
+ * <li>first element (smallest) can be extracted from the queue;</li>
+ * <li>for any element immediately previous and immediately next
+ * elements can be obtained;</li>
+ * <li>any pair of elements can be swapped.</li>
+ * </ul>
* All these actions should be performed efficiently.
*
* @author Sergey Khenkin
+ * @since 1.0.0
*/
public interface SmartQueue<E> {
/** Insert an element */
Modified: trunk/src/net/sourceforge/geom4j/util/SmartQueueTestBase.java
===================================================================
--- trunk/src/net/sourceforge/geom4j/util/SmartQueueTestBase.java 2009-12-18 22:27:28 UTC (rev 23)
+++ trunk/src/net/sourceforge/geom4j/util/SmartQueueTestBase.java 2009-12-25 22:05:23 UTC (rev 24)
@@ -19,6 +19,13 @@
import org.junit.Test;
+/**
+ * Base class for smart queue tests.
+ * All implementation-specific details should be tested in subclasses.
+ *
+ * @author Sergey Khenkin
+ * @since 1.0.0
+ */
public abstract class SmartQueueTestBase {
protected SmartQueue<String> createQueue() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|