Exemple #1
0
 /**
  * Sets a flag to the supplied value
  *
  * @see Flag
  */
 public void setFlag(int bit) {
   checkFlag(bit);
   // bits are indexed from left to right
   flags |= (1 << (15 - bit));
 }
Exemple #2
0
 /**
  * Retrieves a flag
  *
  * @see Flag
  */
 public boolean getFlag(int bit) {
   checkFlag(bit);
   // bits are indexed from left to right
   return (flags & (1 << (15 - bit))) != 0;
 }