Improved code readability
[sixth-3d.git] / src / main / java / eu / svjatoslav / sixth / e3d / gui / TextPointer.java
index 8ba9f9f..7e2bf74 100755 (executable)
@@ -4,6 +4,9 @@
  */
 package eu.svjatoslav.sixth.e3d.gui;
 
+/**
+ * A pointer to a character in a text.
+ */
 public class TextPointer implements Comparable<TextPointer> {
 
     public int row;
@@ -48,6 +51,15 @@ public class TextPointer implements Comparable<TextPointer> {
 
     }
 
+    /**
+     * Checks if this pointer is between the specified pointers.
+     *
+     * @param start
+     *            The start pointer.
+     * @param end
+     *            The end pointer.
+     * @return True if this pointer is between the specified pointers.
+     */
     public boolean isBetween(final TextPointer start, final TextPointer end) {
 
         if (start == null)
@@ -56,6 +68,7 @@ public class TextPointer implements Comparable<TextPointer> {
         if (end == null)
             return false;
 
+        // Make sure that start is smaller than end.
         TextPointer smaller;
         TextPointer bigger;
 
@@ -67,8 +80,8 @@ public class TextPointer implements Comparable<TextPointer> {
             bigger = start;
         }
 
+        // Check if this pointer is between the specified pointers.
         return (compareTo(smaller) >= 0) && (bigger.compareTo(this) > 0);
-
     }
 
 }