Methods Summary |
---|
public void | add(com.sun.mail.imap.Rights$Right right)Add the specified right to this Rights object.
this.rights[(int)right.right] = true;
|
public void | add(com.sun.mail.imap.Rights rights)Add all the rights in the given Rights object to this
Rights object.
for (int i = 0; i < rights.rights.length; i++)
if (rights.rights[i])
this.rights[i] = true;
|
public java.lang.Object | clone()Returns a clone of this Rights object.
Rights r = null;
try {
r = (Rights)super.clone();
r.rights = new boolean[128];
System.arraycopy(this.rights, 0, r.rights, 0, this.rights.length);
} catch (CloneNotSupportedException cex) {
// ignore, can't happen
}
return r;
|
public boolean | contains(com.sun.mail.imap.Rights rights)Check whether all the rights in the specified Rights object are
present in this Rights object.
for (int i = 0; i < rights.rights.length; i++)
if (rights.rights[i] && !this.rights[i])
return false;
// If we've made it till here, return true
return true;
|
public boolean | contains(com.sun.mail.imap.Rights$Right right)Check whether the specified right is present in this Rights object.
return this.rights[(int)right.right];
|
public boolean | equals(java.lang.Object obj)Check whether the two Rights objects are equal.
if (!(obj instanceof Rights))
return false;
Rights rights = (Rights)obj;
for (int i = 0; i < rights.rights.length; i++)
if (rights.rights[i] != this.rights[i])
return false;
return true;
|
public com.sun.mail.imap.Rights$Right[] | getRights()Return all the rights in this Rights object. Returns
an array of size zero if no rights are set.
Vector v = new Vector();
for (int i = 0; i < this.rights.length; i++)
if (this.rights[i])
v.addElement(Right.getInstance((char)i));
Right[] rights = new Right[v.size()];
v.copyInto(rights);
return rights;
|
public int | hashCode()Compute a hash code for this Rights object.
int hash = 0;
for (int i = 0; i < this.rights.length; i++)
if (this.rights[i])
hash++;
return hash;
|
public void | remove(com.sun.mail.imap.Rights$Right right)Remove the specified right from this Rights object.
this.rights[(int)right.right] = false;
|
public void | remove(com.sun.mail.imap.Rights rights)Remove all rights in the given Rights object from this
Rights object.
for (int i = 0; i < rights.rights.length; i++)
if (rights.rights[i])
this.rights[i] = false;
|
public java.lang.String | toString()
StringBuffer sb = new StringBuffer();
for (int i = 0; i < this.rights.length; i++)
if (this.rights[i])
sb.append((char)i);
return sb.toString();
|