public AllocationResult(AllocationResult ar1, AllocationResult ar2) { assert isAVVValid(ar1.avResults); assert isAVVValid(ar2.avResults);  int len1 = ar1.avResults.length; int len2 = ar2.avResults.length; List mergedavs = new ArrayList(len1 + len2); outer: for (int i = 0; i < len2; i++) { AspectValue av2 = ar2.avResults[i]; int aspectType = av2.getAspectType(); for (int j = 0; j < len1; j++) { if (aspectType == ar1.avResults[j].getAspectType()) { continue outer; } } mergedavs.add(av2); } mergedavs.addAll(Arrays.asList(ar1.avResults)); int nAspects = mergedavs.size(); avResults = (AspectValue[]) mergedavs.toArray(new AspectValue[nAspects]); confrating = (ar1.confrating * len1 + ar2.confrating * (nAspects - len1)) / nAspects;  if (ar1.auxqueries != null) { auxqueries = (String[]) ar1.auxqueries.clone(); } if (ar2.auxqueries != null) { String[] mergedQueries = assureAuxqueries(); for (int i = 0; i < AQTYPE_COUNT; i++) { if (mergedQueries[i] == null) mergedQueries[i] = ar2.auxqueries[i]; } } isSuccess = ar1.isSuccess() || ar2.isSuccess();
public AllocationResult(double rating, boolean success, AspectValue[] aspectvalues) { isSuccess = success; confrating = (float) rating; avResults = cloneAndCheckAVV(aspectvalues); phasedavrs = null; clearMemos();
  public AllocationResult(AllocationResult ar1, AllocationResult ar2) {    assert isAVVValid(ar1.avResults);    assert isAVVValid(ar2.avResults);    int len1 = ar1.avResults.length;    int len2 = ar2.avResults.length;    List mergedavs = new ArrayList(len1 + len2);  outer:    for (int i = 0; i < len2; i++) {      AspectValue av2 = ar2.avResults[i];      int aspectType = av2.getAspectType();      for (int j = 0; j < len1; j++) {        if (aspectType == ar1.avResults[j].getAspectType()) {          continue outer;       // Already have this AspectType        }      }      mergedavs.add(av2);    }    mergedavs.addAll(Arrays.asList(ar1.avResults));    int nAspects = mergedavs.size();    avResults = (AspectValue[]) mergedavs.toArray(new AspectValue[nAspects]);    confrating = (ar1.confrating * len1 + ar2.confrating * (nAspects - len1)) / nAspects;    if (ar1.auxqueries != null) {      auxqueries = (String[]) ar1.auxqueries.clone();    }    if (ar2.auxqueries != null) {      String[] mergedQueries = assureAuxqueries();      for (int i = 0; i < AQTYPE_COUNT; i++) {        if (mergedQueries[i] == null) mergedQueries[i] = ar2.auxqueries[i];      }    }    isSuccess = ar1.isSuccess() || ar2.isSuccess();  }