コード例 #1
0
ファイル: TaskEventId.java プロジェクト: djw1149/cougaar-glm
 public boolean equals(Object o) {
   if (o instanceof TaskEventId) {
     TaskEventId other = (TaskEventId) o;
     return (theTaskUID.equals(other.theTaskUID) && theAspectType == other.theAspectType);
   }
   return false;
 }
コード例 #2
0
 public boolean execute(Object o) {
   if (o instanceof OrgActivity) {
     if (oplanUID_.equals(((OrgActivity) o).getOplanUID())) {
       return true;
     }
   }
   return false;
 }
コード例 #3
0
 public String toString() {
   StringBuffer buff = new StringBuffer();
   if (uid != null) {
     buff.append(" uid is :" + uid.toString() + "\n");
   }
   buff.append(" status :" + outstandingquery);
   return buff.toString();
 }
コード例 #4
0
ファイル: TaskEventId.java プロジェクト: djw1149/cougaar-glm
 public int compareTo(Object o) {
   TaskEventId key = (TaskEventId) o;
   int diff = theTaskUID.compareTo(key.theTaskUID);
   if (diff == 0) {
     diff = theAspectType - key.theAspectType;
   }
   return diff;
 }
コード例 #5
0
  private void buildDigestedUserFile(String args[]) {
    // Parse command-line arguments.
    String domain = null;
    String fileName = null;
    for (int i = 0; i < args.length; i++) {
      if (args[i].equals("-d")) {
        if (++i == args.length) {
          usage();
        }
        domain = args[i];
      } else if (args[i].equals("-f")) {
        if (++i == args.length) {
          usage();
        }
        fileName = args[i];
      }
    }
    if (fileName == null) {
      fileName = "UserFile-" + domain + ".xml";
    }

    // The UID is not important. Make a fake one.
    UID uid = UID.toUID("AgentA/1094690973044");
    UserEntries userCache = new UserEntries(uid);
    userCache.setDomain(domain);
    init(userCache);

    UserFileParser ufp = new UserFileParser(userCache);
    System.out.println("Reading user XML file...");
    ufp.readUsers("UserFile.xml");
    OutputStream os = null;
    try {
      os = new FileOutputStream(fileName);
    } catch (FileNotFoundException e) {
      usage();
    }
    System.out.println("Generating user XML file: " + fileName + " for domain: " + domain);
    ufp.saveUsersAndRoles(os);
    try {
      os.close();
    } catch (IOException e) {
      System.out.println("Unable to close file");
    }
  }
コード例 #6
0
ファイル: TaskEventId.java プロジェクト: djw1149/cougaar-glm
 public String toString() {
   return theTaskUID.toString() + ":" + theAspectType;
 }
コード例 #7
0
ファイル: TaskEventId.java プロジェクト: djw1149/cougaar-glm
 public TaskEventId(UID aTaskUID, int anAspectType) {
   theTaskUID = aTaskUID;
   theAspectType = anAspectType;
   hc = theTaskUID.hashCode() + theAspectType;
 }