@Nullable
  @Override
  public Element getState() {
    final Element actions = new Element("actions");
    final Element abbreviations = new Element("abbreviations");
    actions.addContent(abbreviations);
    for (String key : myActionId2Abbreviations.keySet()) {
      final LinkedHashSet<String> abbrs = myActionId2Abbreviations.get(key);
      final LinkedHashSet<String> pluginAbbrs = myPluginsActionId2Abbreviations.get(key);
      if (abbrs == pluginAbbrs || (abbrs != null && abbrs.equals(pluginAbbrs))) {
        continue;
      }
      if (abbrs != null) {
        final Element action = new Element("action");
        action.setAttribute("id", key);
        abbreviations.addContent(action);
        for (String abbr : abbrs) {
          final Element abbreviation = new Element("abbreviation");
          abbreviation.setAttribute("name", abbr);
          action.addContent(abbreviation);
        }
      }
    }

    return actions;
  }
示例#2
0
  void dontCareArgs(ArrayList<ArrayList<LinkedHashSet<FTATransition>>> psi_tuple, FuncSymb f) {
    LinkedHashSet<LinkedHashSet<String>> qs;
    ArrayList<LinkedHashSet<FTATransition>> psiIntersectTuple =
        new ArrayList<LinkedHashSet<FTATransition>>();
    LinkedHashSet<FTATransition> ts;
    ArrayList<LinkedHashSet<LinkedHashSet<String>>> lhs =
        new ArrayList<LinkedHashSet<LinkedHashSet<String>>>();
    LinkedHashSet<String> rhs;
    LinkedHashSet<FTATransition> temp;
    LinkedHashSet<FTATransition> deltaj;
    ArrayList<LinkedHashSet<LinkedHashSet<FTATransition>>> dontCares =
        new ArrayList<LinkedHashSet<LinkedHashSet<FTATransition>>>();

    // Intersect elements of psi-tuple and initialise don't-care array
    for (int i = 0; i < f.arity; i++) {
      if (!psi_tuple.get(i).isEmpty()) {
        psiIntersectTuple.add(i, intersect(psi_tuple.get(i)));
      } else {
        psiIntersectTuple.add(i, new LinkedHashSet<FTATransition>());
      }
      dontCares.add(i, new LinkedHashSet<LinkedHashSet<FTATransition>>());
    }

    for (int i = 0; i < f.arity; i++) {
      temp = psiIntersectTuple.get(i);
      for (int j = 0; j < psi_tuple.get(i).size(); j++) {
        deltaj = psi_tuple.get(i).get(j);
        psiIntersectTuple.set(i, deltaj);
        rhs = rhsSet(deltaj);
        if (rhs.equals(rhsSet(intersect(psiIntersectTuple)))) {
          // generate a don't care transition
          lhs = new ArrayList<LinkedHashSet<LinkedHashSet<String>>>();
          for (int k = 0; k < f.arity; k++) {
            lhs.add(k, new LinkedHashSet<LinkedHashSet<String>>());
            if (k == i) {
              lhs.set(k, t_inverse_table.get(f).get(i).get(deltaj));
            }
          }
          deltad.add(new PTransition(f, rhs, lhs));
          dontCares.get(i).add(deltaj);
        } else if (f.arity == 2 && isSingleton(rhs) && intersectsAll(deltaj, i, f, psi_tuple)) {
          lhs = new ArrayList<LinkedHashSet<LinkedHashSet<String>>>();
          for (int k = 0; k < f.arity; k++) {
            lhs.add(k, new LinkedHashSet<LinkedHashSet<String>>());
            if (k == i) {
              lhs.set(k, t_inverse_table.get(f).get(i).get(deltaj));
            }
          }
          deltad.add(new PTransition(f, rhs, lhs));
          dontCares.get(i).add(deltaj);
        }
      }
      psiIntersectTuple.set(i, temp);
    }
    for (int i = 0; i < f.arity; i++) {
      psi_tuple.get(i).removeAll(dontCares.get(i));
    }
  }
示例#3
0
  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    VirtualMachines vms1 = (VirtualMachines) o;

    if (!virtualMachines.equals(vms1.virtualMachines)) return false;

    return true;
  }
 /** java.util.LinkedHashSet#clone() */
 public void test_clone() {
   // Test for method java.lang.Object java.util.LinkedHashSet.clone()
   LinkedHashSet hs2 = (LinkedHashSet) hs.clone();
   assertTrue("clone returned an equivalent LinkedHashSet", hs != hs2);
   assertTrue("clone did not return an equal LinkedHashSet", hs.equals(hs2));
 }
示例#5
0
 public boolean equals(Object o) {
   return delegate.equals(o);
 }
 @Override
 public boolean equals(Object obj) {
   if (this == obj) return true;
   if (obj == null) return false;
   if (getClass() != obj.getClass()) return false;
   PojoFoo other = (PojoFoo) obj;
   if (arrayBlockingQueue == null) {
     if (other.arrayBlockingQueue != null) return false;
   } else if (!arrayBlockingQueue.equals(other.arrayBlockingQueue)) return false;
   if (arrayDeque == null) {
     if (other.arrayDeque != null) return false;
   } else if (!arrayDeque.equals(other.arrayDeque)) return false;
   if (arrayList == null) {
     if (other.arrayList != null) return false;
   } else if (!arrayList.equals(other.arrayList)) return false;
   if (bar == null) {
     if (other.bar != null) return false;
   } else if (!bar.equals(other.bar)) return false;
   if (blockingDeque == null) {
     if (other.blockingDeque != null) return false;
   } else if (!blockingDeque.equals(other.blockingDeque)) return false;
   if (blockingQueue == null) {
     if (other.blockingQueue != null) return false;
   } else if (!blockingQueue.equals(other.blockingQueue)) return false;
   if (collection == null) {
     if (other.collection != null) return false;
   } else if (!collection.equals(other.collection)) return false;
   if (concurrentLinkedQueue == null) {
     if (other.concurrentLinkedQueue != null) return false;
   } else if (!concurrentLinkedQueue.equals(other.concurrentLinkedQueue)) return false;
   if (concurrentSkipListSet == null) {
     if (other.concurrentSkipListSet != null) return false;
   } else if (!concurrentSkipListSet.equals(other.concurrentSkipListSet)) return false;
   if (copyOnWriteArrayList == null) {
     if (other.copyOnWriteArrayList != null) return false;
   } else if (!copyOnWriteArrayList.equals(other.copyOnWriteArrayList)) return false;
   if (copyOnWriteArraySet == null) {
     if (other.copyOnWriteArraySet != null) return false;
   } else if (!copyOnWriteArraySet.equals(other.copyOnWriteArraySet)) return false;
   if (deque == null) {
     if (other.deque != null) return false;
   } else if (!deque.equals(other.deque)) return false;
   if (hashSet == null) {
     if (other.hashSet != null) return false;
   } else if (!hashSet.equals(other.hashSet)) return false;
   if (linkedBlockingDeque == null) {
     if (other.linkedBlockingDeque != null) return false;
   } else if (!linkedBlockingDeque.equals(other.linkedBlockingDeque)) return false;
   if (linkedBlockingQueue == null) {
     if (other.linkedBlockingQueue != null) return false;
   } else if (!linkedBlockingQueue.equals(other.linkedBlockingQueue)) return false;
   if (linkedHashSet == null) {
     if (other.linkedHashSet != null) return false;
   } else if (!linkedHashSet.equals(other.linkedHashSet)) return false;
   if (linkedList == null) {
     if (other.linkedList != null) return false;
   } else if (!linkedList.equals(other.linkedList)) return false;
   if (list == null) {
     if (other.list != null) return false;
   } else if (!list.equals(other.list)) return false;
   if (name == null) {
     if (other.name != null) return false;
   } else if (!name.equals(other.name)) return false;
   if (navigableSet == null) {
     if (other.navigableSet != null) return false;
   } else if (!navigableSet.equals(other.navigableSet)) return false;
   if (priorityBlockingQueue == null) {
     if (other.priorityBlockingQueue != null) return false;
   } else if (!priorityBlockingQueue.equals(other.priorityBlockingQueue)) return false;
   if (priorityQueue == null) {
     if (other.priorityQueue != null) return false;
   } else if (!priorityQueue.equals(other.priorityQueue)) return false;
   if (queue == null) {
     if (other.queue != null) return false;
   } else if (!queue.equals(other.queue)) return false;
   if (set == null) {
     if (other.set != null) return false;
   } else if (!set.equals(other.set)) return false;
   if (sortedSet == null) {
     if (other.sortedSet != null) return false;
   } else if (!sortedSet.equals(other.sortedSet)) return false;
   if (stack == null) {
     if (other.stack != null) return false;
   } else if (!stack.equals(other.stack)) return false;
   if (treeSet == null) {
     if (other.treeSet != null) return false;
   } else if (!treeSet.equals(other.treeSet)) return false;
   if (vector == null) {
     if (other.vector != null) return false;
   } else if (!vector.equals(other.vector)) return false;
   return true;
 }
示例#7
0
 private boolean equalsByUnknownVariables(DfaMemoryStateImpl that) {
   return myUnknownVariables.equals(that.myUnknownVariables);
 }