Ejemplo n.º 1
0
  public GeneOrthologyEntry(String line) {
    String[] a = line.split("\\s");
    geneName = a[0];
    s288cCoords = parseCoordsString(a[1]);
    sigmaCoords = parseCoordsString(a[2]);
    try {
      identity = Double.parseDouble(a[3]);
    } catch (NumberFormatException e) {
      identity = null;
    }
    flags = new HashSet<Flag>();
    orfCoords = null;

    if (a.length > 4) {
      String[] fa = a[4].split(",");
      for (int i = 0; i < fa.length; i++) {
        try {
          if (fa[i].length() > 0) {
            flags.add(Flag.valueOf(fa[i]));
          } else {
            flags.add(Flag.UNKNOWN);
          }
        } catch (IllegalArgumentException e) {
          System.err.println(String.format("Unknown FLAG: \"%s\"", fa[i]));
          flags.add(Flag.UNKNOWN);
        }
      }

      if (a.length > 5) {
        orfCoords = parseCoordsString(a[5]);
      }
    }
  }
Ejemplo n.º 2
0
 public static boolean isFlagSet(short flags, Flag flag) {
   return flag != null && ((flags & flag.value()) == flag.value());
 }
Ejemplo n.º 3
0
 /**
  * Clears a number of flags in a message
  *
  * @param flags The flags
  * @return A reference to the message
  */
 public Message clearFlag(Flag... flags) {
   if (flags != null) for (Flag flag : flags) if (flag != null) this.flags &= ~flag.value();
   return this;
 }
Ejemplo n.º 4
0
 /**
  * Sets a number of flags in a message
  *
  * @param flags The flag or flags
  * @return A reference to the message
  */
 public Message setFlag(Flag... flags) {
   if (flags != null) for (Flag flag : flags) if (flag != null) this.flags |= flag.value();
   return this;
 }