Esempio n. 1
0
 public static boolean assignmentsAreEqual(Assignment a1, Assignment a2) {
   boolean areEqual = false;
   if (a1.getClass().equals(a2.getClass())
       && a1.keyPath() != null
       && a2.keyPath() != null
       && a1.value() != null
       && a2.value() != null) {
     areEqual = a1.keyPath().equals(a2.keyPath()) && a1.value().equals(a2.value());
   }
   return areEqual;
 }
 public void printTreeAsHTML(StringBuilder sb) {
   if (scope != null) {
     sb.append("<li><b>")
         .append(scope.getClass().getSimpleName())
         .append("</b> <i>")
         .append(scope.getFullName())
         .append("</i>");
   }
   if (!assignments.isEmpty()) {
     sb.append("<ul>");
     for (Assignment a : assignments) {
       sb.append("<li><font color='blue'>")
           .append(a.getClass().getSimpleName())
           .append(" : <u>")
           .append(a.getIdentifier())
           .append("</u></font></li>");
     }
     sb.append("</ul>");
   }
   if (!children.isEmpty()) {
     sb.append("<ul>");
     for (ScopeTreeNode stn : children) {
       stn.printTreeAsHTML(sb);
     }
     sb.append("</ul>");
   }
 }