public String toHTML() {
   return "<TR><TD>"
       + this.representative
       + "</TD><TD>"
       + MWACGroupAssistant.groupsToString(this.members)
       + "</TD></TR>";
 }
Пример #2
0
  /** returns a HTML string representation the neighboor list */
  public String toHTML() {
    String trust = "<FONT size=+1 color=green>TRUSTED</FONT>";
    if (!this.isConfident()) trust = "<FONT size=+1 color=red>DISTRUSTED</FONT>";

    String res =
        "<B>Neighboor list</B> (" + neighboorList.size() + "neighboors / " + trust + ")<BR>";

    res += "<TABLE border=1>";
    res += "<TR><TD>id</TD><TD>trust</TD><TD>role</TD><TD>group</TD></TR>";
    TrustedTripletIdRoleGroup triplet;
    ListIterator<TrustedTripletIdRoleGroup> iter = neighboorList.listIterator();
    while (iter.hasNext()) {
      triplet = iter.next();
      res +=
          "<TR><TD>"
              + triplet.id
              + "</TD><TD>"
              + triplet.trust
              + "</TD><TD>"
              + TrustedMWACAgent.roleToString(triplet.role)
              + "</TD><TD>"
              + MWACGroupAssistant.groupsToString(triplet.groups)
              + "</TD></TR>";
    }
    res += "</TABLE>";
    return res;
  }
 public void add(int member) {
   this.members = MWACGroupAssistant.cloneGroupArray(this.members, 1 + this.members.length);
   this.members[this.members.length - 1] = member;
 }