You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by ma...@apache.org on 2012/03/28 16:51:27 UTC
svn commit: r1306386 - in /incubator/sis/trunk: ./
sis-core/src/main/java/org/apache/sis/storage/
Author: mattmann
Date: Wed Mar 28 14:51:26 2012
New Revision: 1306386
URL: http://svn.apache.org/viewvc?rev=1306386&view=rev
Log:
- fix for SIS-38 Add the missing documentation comments for SIS-core storage contributed by Charitha Madusanka
Modified:
incubator/sis/trunk/CHANGES.txt
incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/GeoRSSData.java
incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTree.java
incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTreeReader.java
incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTreeWriter.java
Modified: incubator/sis/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/sis/trunk/CHANGES.txt?rev=1306386&r1=1306385&r2=1306386&view=diff
==============================================================================
--- incubator/sis/trunk/CHANGES.txt (original)
+++ incubator/sis/trunk/CHANGES.txt Wed Mar 28 14:51:26 2012
@@ -3,6 +3,8 @@ Apache SIS Change Log
Release 0.3-incubating - Current Development
+* SIS-38 Add the missing documentation comments for SIS-core
+ storage (Charitha Madusanka via mattmann)
Release 0.2-incubating - 03/08/2012
Modified: incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/GeoRSSData.java
URL: http://svn.apache.org/viewvc/incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/GeoRSSData.java?rev=1306386&r1=1306385&r2=1306386&view=diff
==============================================================================
--- incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/GeoRSSData.java (original)
+++ incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/GeoRSSData.java Wed Mar 28 14:51:26 2012
@@ -139,7 +139,6 @@ public class GeoRSSData implements QuadT
writer.write("lon;" + geoRSSModule.getPosition().getLongitude());
writer.close();
} catch (IOException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
}
}
@@ -168,10 +167,8 @@ public class GeoRSSData implements QuadT
}
reader.close();
} catch (FileNotFoundException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
}
return map;
Modified: incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTree.java
URL: http://svn.apache.org/viewvc/incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTree.java?rev=1306386&r1=1306385&r2=1306386&view=diff
==============================================================================
--- incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTree.java (original)
+++ incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTree.java Wed Mar 28 14:51:26 2012
@@ -330,6 +330,22 @@ public class QuadTree {
EARTH_MAX_Y), pr.getRectangularRegionApproximation(360));
}
+ /**
+ * Performs point radius search.
+ *
+ * @param point
+ * the center of the circular region
+ * @param radiusKM
+ * the radius in kilometers
+ * @param node
+ * quad tree root node
+ * @param nodeRegion
+ * Rectangle2D representing the circular node region
+ * @param searchRegion
+ * Rectangle2D representing the circular search region
+ * @return a list of QuadTreeData that are within the given radius from the
+ * point
+ */
private List<QuadTreeData> queryByPointRadius(final LatLon point,
final double radiusKM, final QuadTreeNode node,
final Rectangle2D nodeRegion, final Rectangle2D searchRegion) {
@@ -428,11 +444,31 @@ public class QuadTree {
}
}
+ /**
+ * Performs bounding box search.
+ *
+ * @param searchRegion
+ * Rectangle2D representing the rectangular search region
+ * @return a list of QuadTreeData that are within the given radius from the
+ * point
+ */
private List<QuadTreeData> queryByBoundingBox(final Rectangle2D searchRegion) {
return queryByBoundingBox(this.root, new Rectangle2D.Double(EARTH_MIN_X,
EARTH_MIN_Y, EARTH_MAX_X, EARTH_MAX_Y), searchRegion);
}
+ /**
+ * Performs bounding box search.
+ *
+ * @param node
+ * quad tree root node
+ * @param nodeRegion
+ * Rectangle2D representing the rectangular node region
+ * @param searchRegion
+ * Rectangle2D representing the rectangular search region
+ * @return a list of QuadTreeData that are within the given radius from the
+ * point
+ */
private List<QuadTreeData> queryByBoundingBox(final QuadTreeNode node,
final Rectangle2D nodeRegion, final Rectangle2D searchRegion) {
@@ -499,42 +535,92 @@ public class QuadTree {
return matches;
}
+ /**
+ * Returns the size of the quad tree.
+ *
+ * @return size of the quad tree.
+ */
public int size() {
return this.size;
}
+ /**
+ * Returns the root node of the quad tree.
+ *
+ * @return root node of the quad tree.
+ */
public QuadTreeNode getRoot() {
return this.root;
}
+ /**
+ * Sets the size of the quad tree.
+ *
+ * @param size
+ */
public void setSize(int size) {
this.size = size;
}
+ /**
+ * Returns the size of the quad tree.
+ *
+ * @return size of quad tree
+ */
public int getSize() {
return this.size;
}
+ /**
+ * Sets the node size of the quad tree.
+ *
+ * @param nodeSize
+ */
public void setNodeSize(int nodeSize) {
this.nodeSize = nodeSize;
}
+ /**
+ * Returns the node size of the quad tree.
+ *
+ * @return node size of the quad tree.
+ */
public int getNodeSize() {
return this.nodeSize;
}
+ /**
+ * Returns the capacity of node in the quad tree.
+ *
+ * @return capacity of node in the quad tree.
+ */
public int getCapacity() {
return this.capacity;
}
+ /**
+ * Returns the maximum depth of the quad tree.
+ *
+ * @return maximum depth of the quad tree.
+ */
public int getDepth() {
return this.maxDepth;
}
+ /**
+ * Sets the capacity of node in the quad tree.
+ *
+ * @param capacity
+ */
public void setCapacity(int capacity) {
this.capacity = capacity;
}
+ /**
+ * Sets the maximum depth of the quad tree.
+ *
+ * @param depth
+ */
public void setDepth(int depth) {
this.maxDepth = depth;
}
Modified: incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTreeReader.java
URL: http://svn.apache.org/viewvc/incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTreeReader.java?rev=1306386&r1=1306385&r2=1306386&view=diff
==============================================================================
--- incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTreeReader.java (original)
+++ incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTreeReader.java Wed Mar 28 14:51:26 2012
@@ -51,6 +51,16 @@ public class QuadTreeReader {
return tree;
}
+ /**
+ * Read the quad tree configuration from file.
+ *
+ * @param tree
+ * the quad tree
+ * @param directory
+ * the directory where the configuration file is located
+ * @param treeConfigFile
+ * the name of the tree configuration file
+ */
private static void readConfigFromFile(QuadTree tree, String directory,
String treeConfigFile) {
try {
@@ -65,17 +75,26 @@ public class QuadTreeReader {
tree.setDepth(depth);
}
} catch (FileNotFoundException e1) {
- // TODO Auto-generated catch block
e1.printStackTrace();
} catch (NumberFormatException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
}
}
+ /**
+ * Read the quad tree index from file.
+ *
+ * @param tree
+ * the quad tree
+ * @param parent
+ * the quad tree parent node
+ * @param directory
+ * the directory where the index files are located
+ * @param filename
+ * the name of the parent node file
+ */
private static void readFromFile(final QuadTree tree,
final QuadTreeNode parent, final String directory, final String filename) {
try {
@@ -133,13 +152,10 @@ public class QuadTreeReader {
}
} catch (FileNotFoundException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
} catch (NumberFormatException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
}
}
Modified: incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTreeWriter.java
URL: http://svn.apache.org/viewvc/incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTreeWriter.java?rev=1306386&r1=1306385&r2=1306386&view=diff
==============================================================================
--- incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTreeWriter.java (original)
+++ incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTreeWriter.java Wed Mar 28 14:51:26 2012
@@ -34,7 +34,9 @@ public class QuadTreeWriter {
* separate file.
*
* @param tree
+ * the quad tree
* @param directory
+ * the directory where the index file is located
*/
public static void writeTreeToFile(QuadTree tree, String directory) {
createIdxDir(directory);
@@ -42,6 +44,12 @@ public class QuadTreeWriter {
writeNodeToFile(tree.getRoot(), directory);
}
+ /**
+ * Creating quad tree index file.
+ *
+ * @param directory
+ * the directory where the index file is located
+ */
private static void createIdxDir(String directory) {
File dir = new File(directory);
if (!dir.exists()) {
@@ -50,6 +58,14 @@ public class QuadTreeWriter {
}
}
+ /**
+ * Write quad tree configerations to file.
+ *
+ * @param tree
+ * the quad tree
+ * @param directory
+ * the directory where the configerations file is located
+ */
private static void writeTreeConfigsToFile(QuadTree tree, String directory) {
try {
BufferedWriter writer = new BufferedWriter(new FileWriter(directory
@@ -59,11 +75,18 @@ public class QuadTreeWriter {
writer.newLine();
writer.close();
} catch (IOException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
}
}
+ /**
+ * Write quad tree node to index file.
+ *
+ * @param node
+ * the quad tree node
+ * @param directory
+ * the directory where the index file is located
+ */
private static void writeNodeToFile(QuadTreeNode node, String directory) {
try {
BufferedWriter writer = new BufferedWriter(new FileWriter(directory
@@ -96,7 +119,6 @@ public class QuadTreeWriter {
}
writer.close();
} catch (IOException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
}
if (node.getNodeType() == NodeType.GRAY) {
@@ -122,6 +144,15 @@ public class QuadTreeWriter {
}
}
+ /**
+ * Get the quad tree data string
+ *
+ * @param quadrant
+ * specified quadrant
+ * @param node
+ * the quad tree node
+ * @return quad tree data string
+ */
private static String getQuadTreeDataString(Quadrant quadrant,
final QuadTreeNode node) {
StringBuffer str = new StringBuffer();