Added javadoc for all the helper classes in SDN-IP.
Also changed a couple of names to better reflect the usage or comply with
naming standards:
in IBgpRouteService.java: getBGPdRestIp -> getBgpdRestIp
in Prefix.java: MAX_BYTES -> ADDRESS_LENGTH
Change-Id: Id23b6bb077d79d671d21e2490ab410f322d7c166
diff --git a/src/main/java/net/onrc/onos/apps/bgproute/PatriciaTrie.java b/src/main/java/net/onrc/onos/apps/bgproute/PatriciaTrie.java
index 54f8129..0c64502 100644
--- a/src/main/java/net/onrc/onos/apps/bgproute/PatriciaTrie.java
+++ b/src/main/java/net/onrc/onos/apps/bgproute/PatriciaTrie.java
@@ -3,6 +3,12 @@
import java.util.Iterator;
import java.util.NoSuchElementException;
+/**
+ * Implements a patricia tree. See {@link IPatriciaTrie} for a description of
+ * how the tree works and its usage.
+ *
+ * @param <V> the type of objects that will be stored in the tree
+ */
public class PatriciaTrie<V> implements IPatriciaTrie<V> {
private final byte[] maskBits = {(byte) 0x00, (byte) 0x80, (byte) 0xc0, (byte) 0xe0, (byte) 0xf0,
(byte) 0xf8, (byte) 0xfc, (byte) 0xfe, (byte) 0xff};
@@ -11,6 +17,14 @@
private Node top;
+ /**
+ * Class constructor which takes the maximum length of strings that can be
+ * stored in the tree. This is used as a sanity check to prevent
+ * excessively long strings from being added, as this could slow down
+ * lookups.
+ *
+ * @param maxPrefixLength the maximum length of prefixes
+ */
public PatriciaTrie(int maxPrefixLength) {
this.maxPrefixLength = maxPrefixLength;
}