Changeset a5cfe93


Ignore:
Timestamp:
Mar 26, 2011 1:52:11 PM (8 years ago)
Author:
Ted Faber <faber@…>
Branches:
abac0-leak, abac0-mei, compt_changes, gec13, master, mei-id, mei-rt0-n, mei_rt0, mei_rt2, mei_rt2_fix_1, meiyap-rt1, meiyap1, rt2, tvf-new-xml
Children:
6432e35
Parents:
b67a7ac
Message:

Doc tweaks and completion.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/net/deterlab/abac/Role.java

    re36ea1d ra5cfe93  
    116116    /**
    117117     * Returns true iff the role is a principal.
    118      * @returns true iff the role is a principal.
     118     * @return true iff the role is a principal.
    119119     */
    120120    public boolean is_principal() { return m_parts.length == 1; }
     
    122122    /**
    123123     * Returns true iff the role is a role (i.e., A.r1).
    124      * @returns true iff the role is a role (i.e., A.r1).
     124     * @return true iff the role is a role (i.e., A.r1).
    125125     */
    126126    public boolean is_role() { return m_parts.length == 2; }
     
    128128    /**
    129129     * Returns true iff the role is a linking role (i.e., A.r1.r2).
    130      * @returns true iff the role is a linking role (i.e., A.r1.r2).
     130     * @return true iff the role is a linking role (i.e., A.r1.r2).
    131131     */
    132132    public boolean is_linking() { return m_parts.length == 3; }
     
    134134    /**
    135135     * Returns true iff the role represents an intersection role.
    136      * @returns true iff the role represents an intersection role.
     136     * @return true iff the role represents an intersection role.
    137137     */
    138138    public boolean is_intersection() { return m_prereqs != null; }
     
    142142     * refers to another role in the graph. This will throw a runtime
    143143     * exception if the node is not a linking role.
    144      * @returns the first two elements of a linking role's name.
     144     * @return the first two elements of a linking role's name.
    145145     * @throws RuntimeException if the role is not linking
    146146     */
     
    166166     * Returns the principal part of a role or principal. This is everything
    167167     * except the last element of the name.  Used by Query.
    168      * @returns the principal part of a role or principal.
     168     * @return the principal part of a role or principal.
    169169     */
    170170    String principal_part() {
     
    201201    }
    202202
     203    /**
     204     * Returns a string representation of the Role.
     205     * @return a string representation of the Role.
     206     */
    203207    public String toString() {
    204208        return m_string;
    205209    }
    206210
     211    /**
     212     * Returns a string representation of the Role with mnemonic names from the
     213     * given Context.  A jabac extension.
     214     * @param c A Context used to look up mnemonic names.
     215     * @return a string representation of the Role with mnemonic names from the
     216     * given Context.
     217     */
    207218    public String simpleString(Context c) {
    208219        return c.expandNickname(m_string);
    209220    }
    210221
     222    /**
     223     * Equality test.  Two Roles are the same if their string representations
     224     * are equal.
     225     * @param v2 an Object to compare
     226     * @return a boolean, true if the two Roles are equal.
     227     */
    211228    public boolean equals(Object v2) {
    212229        if (v2 instanceof Role)
     
    215232    }
    216233
     234    /**
     235     * Partial order test.  Return a lexical comparison of the two Roles
     236     * @param o an Object to compare against
     237     * @return -1 if this Role is before, 0 if they are the same, and 1
     238     *              if this Role is after the given object.
     239     */
    217240    public int compareTo(Object o) {
    218241        if (o instanceof Role)
     
    221244    }
    222245
     246    /**
     247     * Returns a hash code value for the object.  It is the hash of the string
     248     * representation.
     249     * @return a hash code value for the object.
     250     */
    223251    public int hashCode() {
    224252        return m_string.hashCode();
Note: See TracChangeset for help on using the changeset viewer.