/* (non-Javadoc)
@see com.github.thehilikus.jrobocom.RobotControl#reverseTransfer(int, int)
978665
@Override
    public int reverseTransfer(int remoteBankIndex, int localBankIndex) {
	int penalty = Timing.getInstance().REMOTE_ACCESS_PENALTY + Timing.getInstance().TRANSFER_BASE;
	log.trace("[reverseTransfer] Waiting {} cycles to start transfer from {} to {}", penalty, remoteBankIndex, localBankIndex);
	turnsControl.waitTurns(penalty, "Reverse Transfer Wait 1/2");
	int bankComplexity = robot.reverseTransfer(localBankIndex, remoteBankIndex);

	log.trace("[reverseTransfer] Waiting {} cycles to complete transfer", Timing.getInstance().TRANSFER_SINGLE * bankComplexity);
	turnsControl.waitTurns(Timing.getInstance().TRANSFER_SINGLE * bankComplexity, "Reverse Transfer Wait 2/2");

	return bankComplexity;
    }
35332
public void reverse() {
		for (int i = 0; i < size / 2; i++) {
			T tmp = data[i];
			data[i] = data[size - i - 1];
			data[size - i - 1] = tmp;
		}
	}
209022
@Override
    public StreamT<W,T> reverse() {

        return (StreamT<W,T>) FoldableTransformerSeq.super.reverse();
    }
936305
@Override
  public final void reverseDraw(final Map<String, Object> pAddParam,
    final IMakingWarehouseEntry pEntity, final Date pDateAccount,
      final Long pDrawingOwnerId) throws Exception {
    if (!pEntity.getIdDatabaseBirth()
      .equals(getSrvOrm().getIdDatabase())) {
      throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER,
        "can_not_make_di_entry_for_foreign_src");
    }
    String tblNm = getDrawItemEntryClass().getSimpleName().toUpperCase();
    List<T> diel = getSrvOrm().retrieveListWithConditions(pAddParam,
      getDrawItemEntryClass(), " where DRAWINGTYPE=" + pEntity.constTypeCode()
        + " and " + tblNm + ".IDDATABASEBIRTH=" + getSrvOrm().getIdDatabase()
          + " and DRAWINGID=" + pEntity.getReversedId());
    BigDecimal quantityToLeaveRst = pEntity.getItsQuantity();
    String langDef = (String) pAddParam.get("langDef");
    for (T dies : diel) {
      if (dies.getItsQuantity().doubleValue() < 0) {
        throw new ExceptionWithCode(ExceptionWithCode.FORBIDDEN,
          "Attempt to reverse reversed " + pAddParam.get("user"));
      }
      T die = createDrawItemEntry(pAddParam);
      die.setItsDate(pDateAccount);
      die.setIdDatabaseBirth(getSrvOrm().getIdDatabase());
      die.setSourceType(dies.getSourceType());
      die.setSourceId(dies.getSourceId());
      die.setDrawingType(pEntity.constTypeCode());
      die.setDrawingId(pEntity.getItsId());
      die.setDrawingOwnerId(pDrawingOwnerId);
      die.setDrawingOwnerType(pEntity.getOwnerType());
      die.setSourceOwnerId(dies.getSourceOwnerId());
      die.setSourceOwnerType(dies.getSourceOwnerType());
      die.setItsCost(dies.getItsCost());
      die.setItsTotal(dies.getItsTotal().negate());
      die.setUnitOfMeasure(dies.getUnitOfMeasure());
      die.setInvItem(dies.getInvItem());
      die.setItsQuantity(dies.getItsQuantity().negate());
      quantityToLeaveRst = quantityToLeaveRst.add(dies.getItsQuantity());
      if (quantityToLeaveRst.doubleValue() > 0) {
        throw new ExceptionWithCode(ExceptionWithCode.SOMETHING_WRONG,
          "Reversing source has different quantity against movement entries! "
            + pAddParam.get("user"));
      }
      die.setReversedId(dies.getItsId());
      die.setDescription(makeDescription(pAddParam, pEntity, dies) + " "
        + getSrvI18n().getMsg("reversed_entry_n", langDef)
          + getSrvOrm().getIdDatabase() + "-" + dies.getItsId());
      getSrvOrm().insertEntity(pAddParam, die);
      die.setIsNew(false);
      @SuppressWarnings("unchecked")
      IFactorySimple<IDrawItemSource> fctDis =
        (IFactorySimple<IDrawItemSource>) this.entitiesFactoriesFatory
         .lazyGet(pAddParam, srvTypeCode.getTypeCodeMap()
          .get(dies.getSourceType()));
      IDrawItemSource drawed = fctDis.create(pAddParam);
      String fldIdName = this.srvOrm.getTablesMap()
        .get(drawed.getClass().getSimpleName()).getIdFieldName();
      Method setterId = this.settersRapiHolder
        .getFor(drawed.getClass(), fldIdName);
      setterId.invoke(drawed, dies.getSourceId());
      drawed = srvOrm.retrieveEntity(pAddParam, drawed);
      drawed.setTheRest(drawed.getTheRest().add(dies.getItsQuantity()));
      srvOrm.updateEntity(pAddParam, drawed);
      dies.setReversedId(die.getItsId());
      dies.setDescription(dies.getDescription() + " "
        + getSrvI18n().getMsg("reversing_entry_n", langDef)
          + getSrvOrm().getIdDatabase() + "-" + die.getItsId()); //only local
      getSrvOrm().updateEntity(pAddParam, dies);
    }
    if (quantityToLeaveRst.doubleValue() != 0) {
      throw new ExceptionWithCode(ExceptionWithCode.SOMETHING_WRONG,
        "Reversing source has different quantity against movement entries! "
          + pAddParam.get("user"));
    }
  }
621599
private <IN1, IN2, OUT> Collection<Integer> transformTwoInputTransform(TwoInputTransformation<IN1, IN2, OUT> transform) {

		Collection<Integer> inputIds1 = transform(transform.getInput1());
		Collection<Integer> inputIds2 = transform(transform.getInput2());

		// the recursive call might have already transformed this
		if (alreadyTransformed.containsKey(transform)) {
			return alreadyTransformed.get(transform);
		}

		List<Integer> allInputIds = new ArrayList<>();
		allInputIds.addAll(inputIds1);
		allInputIds.addAll(inputIds2);

		String slotSharingGroup = determineSlotSharingGroup(transform.getSlotSharingGroup(), allInputIds);

		streamGraph.addCoOperator(
				transform.getId(),
				slotSharingGroup,
				transform.getCoLocationGroupKey(),
				transform.getOperator(),
				transform.getInputType1(),
				transform.getInputType2(),
				transform.getOutputType(),
				transform.getName());

		if (transform.getStateKeySelector1() != null || transform.getStateKeySelector2() != null) {
			TypeSerializer<?> keySerializer = transform.getStateKeyType().createSerializer(env.getConfig());
			streamGraph.setTwoInputStateKey(transform.getId(), transform.getStateKeySelector1(), transform.getStateKeySelector2(), keySerializer);
		}

		streamGraph.setParallelism(transform.getId(), transform.getParallelism());
		streamGraph.setMaxParallelism(transform.getId(), transform.getMaxParallelism());

		for (Integer inputId: inputIds1) {
			streamGraph.addEdge(inputId,
					transform.getId(),
					1
			);
		}

		for (Integer inputId: inputIds2) {
			streamGraph.addEdge(inputId,
					transform.getId(),
					2
			);
		}

		return Collections.singleton(transform.getId());
	}
997554
@SuppressWarnings("WeakerAccess")
    public static void reverse(int[] order, int offset, int length) {
        for (int i = 0; i < length / 2; i++) {
            int t = order[offset + i];
            order[offset + i] = order[offset + length - i - 1];
            order[offset + length - i - 1] = t;
        }
    }
1058045
private static void reverse(int[] path, int i, int j) {
        while (i < j) {
            int tmp = path[i];
            path[i] = path[j];
            path[j] = tmp;
            i++;
            j--;
        }
    }
834948
@VisibleForTesting
  static String reverse(InetAddress address) {
    byte[] bytes = address.getAddress();
    if (bytes.length == 4) return reverseIpv4(bytes);
    else return reverseIpv6(bytes);
  }
391299
def Reverse(self, copy=False):
        
        numPoints = self.GetN()
        if copy:
            revGraph = self.Clone()
        else:
            revGraph = self
        X = self.GetX()
        EXlow = self.GetEXlow()
        EXhigh = self.GetEXhigh()
        Y = self.GetY()
        EYlow = self.GetEYlow()
        EYhigh = self.GetEYhigh()
        for i in range(numPoints):
            index = numPoints - 1 - i
            revGraph.SetPoint(i, X[index], Y[index])
            revGraph.SetPointError(
                i,
                EXlow[index], EXhigh[index],
                EYlow[index], EYhigh[index])
        return revGraph
1342904
@Override
	public ParallelTransformation reversed(boolean reversed)
	{
		if (!reversed)
			return this;

		for (Transformation<?, ?> transformation : listTransformations)
			transformation.reversed(true);

		return this;
	}
885229
public static void reverse(int[] a) {
        int i = 0, j = a.length - 1;
        while (i < j) {
            SortUtils.swap(a, i++, j--);  // code for swap not shown, but easy enough
        }
    }
409520
@Override
  public final void makeOtherEntries(final Map<String, Object> pAddParam,
    final SalesReturn pEntity, final IRequestData pRequestData,
      final boolean pIsNew) throws Exception {
    String actionAdd = pRequestData.getParameter("actionAdd");
    if ("makeAccEntries".equals(actionAdd)
      && pEntity.getReversedId() != null) {
      //reverse none-reversed lines:
      SalesReturnLine srl = new SalesReturnLine();
      SalesReturn reversed = new SalesReturn();
      reversed.setItsId(pEntity.getReversedId());
      srl.setItsOwner(reversed);
      List<SalesReturnLine> reversedLines = getSrvOrm().
        retrieveListForField(pAddParam, srl, "itsOwner");
      String langDef = (String) pAddParam.get("langDef");
      for (SalesReturnLine reversedLine : reversedLines) {
        if (reversedLine.getReversedId() == null) {
          if (!reversedLine.getItsQuantity()
            .equals(reversedLine.getTheRest())) {
            throw new ExceptionWithCode(PurchaseInvoice.SOURSE_IS_IN_USE,
              "There is withdrawals from this source!");
          }
          SalesReturnLine reversingLine = new SalesReturnLine();
          reversingLine.setIdDatabaseBirth(getSrvOrm().getIdDatabase());
          reversingLine.setReversedId(reversedLine.getItsId());
          reversingLine.setWarehouseSite(reversedLine.getWarehouseSite());
          reversingLine.setInvItem(reversedLine.getInvItem());
          reversingLine.setUnitOfMeasure(reversedLine.getUnitOfMeasure());
          reversingLine.setItsCost(reversedLine.getItsCost());
          reversingLine.setItsQuantity(reversedLine.getItsQuantity()
            .negate());
          reversingLine.setItsTotal(reversedLine.getItsTotal().negate());
          reversingLine.setSubtotal(reversedLine.getSubtotal().negate());
          reversingLine.setTotalTaxes(reversedLine.getTotalTaxes().negate());
          reversingLine.setTaxesDescription(reversedLine
            .getTaxesDescription());
          reversingLine.setIsNew(true);
          reversingLine.setItsOwner(pEntity);
          reversingLine.setDescription(getSrvI18n()
            .getMsg("reversed_n", langDef) + reversedLine.getIdDatabaseBirth()
              + "-" + reversedLine.getItsId()); //local
          getSrvOrm().insertEntity(pAddParam, reversingLine);
          reversingLine.setIsNew(false);
          getSrvWarehouseEntry().load(pAddParam, reversingLine,
            reversingLine.getWarehouseSite());
          String descr;
          if (reversedLine.getDescription() == null) {
            descr = "";
          } else {
            descr = reversedLine.getDescription();
          }
          reversedLine.setDescription(descr
            + " " + getSrvI18n().getMsg("reversing_n", langDef) + reversingLine
              .getIdDatabaseBirth() + "-" + reversingLine.getItsId());
          reversedLine.setReversedId(reversingLine.getItsId());
          reversedLine.setTheRest(BigDecimal.ZERO);
          getSrvOrm().updateEntity(pAddParam, reversedLine);
          SalesReturnGoodsTaxLine pigtlt =
            new SalesReturnGoodsTaxLine();
          pigtlt.setItsOwner(reversedLine);
          List<SalesReturnGoodsTaxLine> tls = getSrvOrm()
            .retrieveListForField(pAddParam, pigtlt, "itsOwner");
          for (SalesReturnGoodsTaxLine pigtl : tls) {
            getSrvOrm().deleteEntity(pAddParam, pigtl);
          }
        }
      }
      SalesReturnTaxLine srtl = new SalesReturnTaxLine();
      srtl.setItsOwner(reversed);
      List<SalesReturnTaxLine> reversedTaxLines = getSrvOrm().
        retrieveListForField(pAddParam, srtl, "itsOwner");
      for (SalesReturnTaxLine reversedLine : reversedTaxLines) {
        if (reversedLine.getReversedId() == null) {
          SalesReturnTaxLine reversingLine = new SalesReturnTaxLine();
          reversingLine.setIdDatabaseBirth(getSrvOrm().getIdDatabase());
          reversingLine.setReversedId(reversedLine.getItsId());
          reversingLine.setItsTotal(reversedLine.getItsTotal().negate());
          reversingLine.setTax(reversedLine.getTax());
          reversingLine.setIsNew(true);
          reversingLine.setItsOwner(pEntity);
          getSrvOrm().insertEntity(pAddParam, reversingLine);
          reversingLine.setIsNew(false);
          reversedLine.setReversedId(reversingLine.getItsId());
          getSrvOrm().updateEntity(pAddParam, reversedLine);
        }
      }
    }
  }
485305
private void reverseRange(Buffer a, int lo, int hi) {
    hi--;
    while (lo < hi) {
      s.swap(a, lo, hi);
      lo++;
      hi--;
    }
  }
1241191
public void reverse(Consumer<T> action) {
        TopoSorter<T> sorter = new TopoSorter<>(this);
        sorter.reverse(action);
    }
275363
private static void reverse(int[] array, int start, int end) {
		for (int i = start, j = end; i < --j; ++i) {
			int t = array[i];
			array[i] = array[j];
			array[j] = t;
		}
	}
1356381
private static void reverseRange(Object[] a, int lo, int hi) {
        hi--;
        while (lo < hi) {
            Object t = a[lo];
            a[lo++] = a[hi];
            a[hi--] = t;
        }
    }
599699
public void dereferenceControllable()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(tc, "dereferenceControllable");
    _remoteDurableName = null;
    _anycastInputHandler = null;
    _destinationHandler = null;
    _messageProcessor = null;
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.exit(tc, "dereferenceControllable");    
  }