Index: java/net/deterlab/abac/Role.java
===================================================================
--- java/net/deterlab/abac/Role.java	(revision 5129e3e20b6ca586bd4167e82ae9b341f76c8649)
+++ java/net/deterlab/abac/Role.java	(revision e36ea1d2124f37b1cb324dbc84671ca0f5efa7e5)
@@ -7,11 +7,19 @@
 /**
  * Represents a role, which is a vertex in a Credential graph.
+ * @author <a href="http://abac.deterlab.net">ISI ABAC team</a>
+ * @version 1.3
  */
 public class Role implements Comparable {
+    /** The role represnetation */
     protected String m_string;
+    /** The role broken into parts between dots */
     protected String[] m_parts;
+    /** The linking role from a linking Role */
     protected String m_A_r1;
+    /** The linked role from a linked Role */
     protected String m_r2;
+    /** A prefix of the role */
     protected String m_prefix;
+    /** Prerequisite roles for an intersection role. */
     protected Role[] m_prereqs;
 
@@ -25,6 +33,9 @@
      * If the string does not have this format, the constructor throws a
      * RuntimeException.
-     */
-    public Role(String s) throws RuntimeException {
+     *
+     * @param s a String with the role name
+     * @throws RuntimeException if the string is badly formatted
+     */
+    public Role(String s) {
         m_string = s;
 
@@ -49,8 +60,19 @@
     }
 
+    /**
+     * Create a role from the given string, converted from mnemonic strings to
+     * key IDs that are known from the Context.  This is a jabac extension.
+     * @param s the String containing the rile name.
+     * @param c the Context in which to expand mnemonics
+     * @throws RuntimeException if the string is badly formatted.
+     */
     public Role(String s, Context c) {
 	this(c.expandKeyID(s));
     }
 
+    /**
+     * Copy an existing role.
+     * @param r the Role to copy
+     */
     public Role(Role r) {
 	m_string = r.m_string;
@@ -67,8 +89,9 @@
 
     /**
-     * Initialize a single non-intersection role. See constructor for details of
-     * role format. Will throw RuntimeException if the role is invalid.
-     */
-    private void single_role() throws RuntimeException {
+     * Initialize a single non-intersection role. See constructor for details
+     * of role format. Will throw RuntimeException if the role is invalid.
+     * @throws RuntimeException if a role is invalid.
+     */
+    private void single_role() {
         m_parts = m_string.split("\\.");
         if (m_parts.length > 3)
@@ -93,4 +116,5 @@
     /**
      * Returns true iff the role is a principal.
+     * @returns true iff the role is a principal.
      */
     public boolean is_principal() { return m_parts.length == 1; }
@@ -98,4 +122,5 @@
     /**
      * Returns true iff the role is a role (i.e., A.r1).
+     * @returns true iff the role is a role (i.e., A.r1).
      */
     public boolean is_role() { return m_parts.length == 2; }
@@ -103,4 +128,5 @@
     /**
      * Returns true iff the role is a linking role (i.e., A.r1.r2).
+     * @returns true iff the role is a linking role (i.e., A.r1.r2).
      */
     public boolean is_linking() { return m_parts.length == 3; }
@@ -108,4 +134,5 @@
     /**
      * Returns true iff the role represents an intersection role.
+     * @returns true iff the role represents an intersection role.
      */
     public boolean is_intersection() { return m_prereqs != null; }
@@ -115,4 +142,6 @@
      * refers to another role in the graph. This will throw a runtime
      * exception if the node is not a linking role.
+     * @returns the first two elements of a linking role's name.
+     * @throws RuntimeException if the role is not linking
      */
     String A_r1() throws RuntimeException {
@@ -125,4 +154,6 @@
      * Return the last element of a linking role's name. This will throw a
      * runtime exception if the node is not a linking role.
+     * @return the last element of a linking role's name.
+     * @throws RuntimeException if the node is not a linking role.
      */
     String r2() throws RuntimeException {
@@ -134,12 +165,25 @@
     /**
      * Returns the principal part of a role or principal. This is everything
-     * except the last element of the name.
-     */
-    public String principal_part() {
+     * except the last element of the name.  Used by Query.
+     * @returns the principal part of a role or principal.
+     */
+    String principal_part() {
         return m_prefix;
     }
 
+    /**
+     * Return the principal
+     * @return the principal
+     */
     public String principal() { return m_parts.length > 0 ? m_parts[0] : null; }
+    /**
+     * Return the role name (part after the first dot and before any second)
+     * @return the role name
+     */
     public String role_name() { return m_parts.length > 1 ? m_parts[1] : null; }
+    /**
+     * Return the linked role (first two parts of a linking role)
+     * @return the linked role
+     */
     public String linked_role() { return A_r1(); }
 
@@ -147,4 +191,6 @@
      * Get the roles that form the prerequisites to this intersection. Throws
      * a runtime exception if this is not an intersection role.
+     * @return a Role[] of prerequisites
+     * @throws RuntimeException if this is not an intersection role
      */
     Role[] prereqs() throws RuntimeException {
