示例#1
0
 boolean isEnabled(long m) {
   if (enabledMechanisms != null) {
     return enabledMechanisms.contains(Long.valueOf(m));
   }
   if (disabledMechanisms != null) {
     return !disabledMechanisms.contains(Long.valueOf(m));
   }
   return true;
 }
示例#2
0
 private Set<Long> parseMechanisms(String keyword) throws IOException {
   checkDup(keyword);
   Set<Long> mechs = new HashSet<Long>();
   parseEquals();
   parseOpenBraces();
   while (true) {
     int token = nextToken();
     if (isCloseBraces(token)) {
       break;
     }
     if (token == TT_EOL) {
       continue;
     }
     if (token != TT_WORD) {
       throw excToken("Expected mechanism, read");
     }
     long mech = parseMechanism(st.sval);
     mechs.add(Long.valueOf(mech));
   }
   if (DEBUG) {
     System.out.print("mechanisms: [");
     for (Long mech : mechs) {
       System.out.print(Functions.getMechanismName(mech));
       System.out.print(", ");
     }
     System.out.println("]");
   }
   return mechs;
 }