# Attributed qualified "To One"-Association

    /**
     * <pre>
     *           +----------+                 1
     * LeftClass | getKey() +------------------- RightClass
     *           +----------+        rightRoles
     * </pre>
     */

Attribute
`private FHashMap rightRoles;` or `private FTreeMap rightRoles;`

Access Methods Summary
`public boolean` | `hasInRightRoles (RightClass value)`
`public boolean` | `hasKeyInRightRoles (KeyType key)`
`public Iterator` | `iteratorOfRightRoles ()`
`public Iterator` | `keysOfRightRoles ()`
`public Iterator` | `entriesOfRightRoles ()`
`public int` | `sizeOfRightRoles ()`
`public RightClass` | `getFromRightRoles (KeyType key)`
`public boolean` | `addToRightRoles (RightClass value)`
`public boolean` | `removeFromRightRoles (RightClass value)`
`public boolean` | `removeKeyFromRightRoles (KeyType key)`
`public void` | `removeAllFromRightRoles ()`

Access Methods

    public boolean hasInRightRoles (RightClass value)
    {return ((this.rightRoles != null) &&
            (value != null) && (value.getKey () != null) &&
            (this.rightRoles.get (value.getKey ()) == value));
    }

    public boolean hasKeyInRightRoles (KeyType key)
    {return ((this.rightRoles != null) &&
            (key != null) &&
            this.rightRoles.containsKey (key));
    }

    public Iterator iteratorOfRightRoles ()
    {return ((this.rightRoles == null)
            ? FEmptyIterator.get ()
            : this.rightRoles.values ().iterator ());
    }

    public Iterator keysOfRightRoles ()
    {return ((this.rightRoles == null)
            ? FEmptyIterator.get ()
            : this.rightRoles.keySet ().iterator ());
    }

    public Iterator entriesOfRightRoles ()
    {return ((this.rightRoles == null)
            ? FEmptyIterator.get ()
            : this.rightRoles.entrySet ().iterator ());
    }

    public int sizeOfRightRoles ()
    {return ((this.rightRoles == null)
            ? 0
            : this.rightRoles.size ());
    }

    public RightClass getFromRightRoles (KeyType key)
    {return (((this.rightRoles == null) || (key == null))
            ? null
            : (RightClass) this.rightRoles.get (key));
    }

    public boolean addToRightRoles (RightClass value)
    {boolean changed = false;
    if ((value != null) && (value.getKey () != null))
    {
       if (this.rightRoles == null)
       {
          this.rightRoles = new FHashSet ($CONSTRUCTORPARAM$); // or FTreeMap ()
       }
       RightClass oldValue = (RightClass) this.rightRoles.put (value.getKey (), value);
       if (oldValue != value)
       {
          if (oldValue != null)
          {
             oldValue.<method to remove>;
          }
          value.<method to insert>;
          changed = true;
       }
    }
    return changed;
    }

    public boolean removeFromRightRoles (RightClass value)
    {boolean changed = false;
    if ((this.rightRoles != null) && (value != null) && (value.getKey () != null))
    {
       RightClass oldValue = (RightClass) this.rightRoles.get (value.getKey ());
       if (oldValue == value)
       {
          this.rightRoles.remove (value.getKey ());
          value.<method to remove>;
          changed = true;
       }
    }
    return changed;
    }

    public boolean removeKeyFromRightRoles (KeyType key)
    {boolean changed = false;
    if ((this.rightRoles != null) && (key != null))
    {
       RightClass tmpValue = (RightClass) this.rightRoles.get (key);
       if (tmpValue != null)
       {
          this.rightRoles.remove (key);
          tmpValue.<method to remove>;
          changed = true;
       }
    }
    return changed;
    }

    public void removeAllFromRightRoles ()
    {RightClass tmpValue;
    Iterator iter = this.iteratorOfRightRoles ();
    while (iter.hasNext ())
    {
       tmpValue = (RightClass) iter.next ();
       this.removeFromRightRoles (tmpValue);
    }
    }