public Results getResults(boolean inp1, boolean inp2) { boolean sum = x1.OperatorGate(inp1, inp2); boolean carry = a1.OperatorGate(inp1, inp2); return new Results(sum, carry); }
Results kf = new Results(); kf.setTitle("Title"); kf.setAuthor("Author"); kf.setPlaceholderleft(R.drawable.yourpic); results.add(kf);
@Override public Report runReport(ReportCalculationResults calculationResults, CashFlowReportTemplate reportTemplate) { int tradeCount = calculationResults.getCalculationResults().getRowCount(); if (tradeCount == 0) { throw new IllegalArgumentException("Calculation results is empty"); } if (tradeCount > 1) { throw new IllegalArgumentException( Messages.format("Unable to show cashflow report for {} trades at once. " + "Please filter the portfolio to a single trade.", tradeCount)); } int columnIdx = calculationResults.getColumns().indexOf(Column.of(Measures.EXPLAIN_PRESENT_VALUE)); if (columnIdx == -1) { throw new IllegalArgumentException( Messages.format("Unable to find column for required measure '{}' in calculation results", Measures.EXPLAIN_PRESENT_VALUE)); } Result<?> result = calculationResults.getCalculationResults().get(0, columnIdx); if (result.isFailure()) { throw new IllegalArgumentException( Messages.format("Failure result found for required measure '{}': {}", Measures.EXPLAIN_PRESENT_VALUE, result.getFailure().getMessage())); } ExplainMap explainMap = (ExplainMap) result.getValue(); return runReport(explainMap, calculationResults.getValuationDate()); }
Column column = Column.of(Measure.of(measureName)); int columnIndex = results.getColumns().indexOf(column); if (columnIndex == -1) { validMeasureNames); Result<?> result = results.getCalculationResults().get(rowIndex, columnIndex); if (result.isFailure() && result.getFailure().getReason() == FailureReason.ERROR) { return Result.failure(
Results res = new Results(); try { byte[] c = new byte[1024]; res.incTabCount(); res.incSpaceCount();
public static void main(String[] args) throws Exception { Results results = new Results(); ThreadDictionarySearch threadA = new ThreadDictionarySearch(results, "dictionary A"); ThreadDictionarySearch threadB = new ThreadDictionarySearch(results, "dictionary B"); ThreadDictionarySearch threadC = new ThreadDictionarySearch(results, "dictionary C"); ThreadDictionarySearch threadD = new ThreadDictionarySearch(results, "dictionary D"); threadA.start(); threadB.start(); threadC.start(); threadD.start(); if (results.isReady()) // it stays here until all dictionaries are searched // because in "Results" it's told to wait() while not finished; for (String string : results.getAllResults()) { System.out.println("RESULT: " + string); }
StudentYear yearInputobject = new StudentYear(); int year = yearInputobject.getStudentYear(); Results resultsInputobject = new Results(year); resultsInputobject.printResults();
public void test_of() { ReportCalculationResults test = sut(); assertEquals(test.getValuationDate(), VAL_DATE); assertEquals(test.getTargets(), ImmutableList.of(TRADE)); assertEquals(test.getColumns(), ImmutableList.of(COLUMN)); assertEquals(test.getCalculationResults().get(0, 0).getValue(), PV); assertEquals(test.getReferenceData(), ReferenceData.standard()); }
@Override public ReportRequirements requirements(CashFlowReportTemplate reportTemplate) { return ReportRequirements.of(Column.of(Measures.EXPLAIN_PRESENT_VALUE)); }
/** * Gets the measure encoded in a value path, if present. * * @param valuePath the value path * @return the measure, if present */ public static Optional<Measure> measure(String valuePath) { try { List<String> tokens = tokenize(valuePath); ValueRootType rootType = ValueRootType.parseToken(tokens.get(0)); if (rootType != ValueRootType.MEASURES || tokens.size() < 2) { return Optional.empty(); } Measure measure = Measure.of(tokens.get(1)); return Optional.of(measure); } catch (Exception ex) { return Optional.empty(); } }
/** * Evaluates a value path against a set of results, returning the resolved result for each trade. * * @param valuePath the value path * @param results the calculation results * @return the list of resolved results for each trade */ public static List<Result<?>> evaluate(String valuePath, ReportCalculationResults results) { List<String> tokens = tokenize(valuePath); if (tokens.size() < 1) { return Collections.nCopies( results.getTargets().size(), Result.failure(FailureReason.INVALID, "Column expressions must not be empty")); } CalculationFunctions functions = results.getCalculationFunctions(); int rowCount = results.getCalculationResults().getRowCount(); return IntStream.range(0, rowCount) .mapToObj(rowIndex -> evaluate(functions, tokens, RootEvaluator.INSTANCE, new ResultsRow(results, rowIndex))) .collect(toImmutableList()); }
public ActionResult GetPartialResults() { Results yourModel = new Results(); //your logic here to populate your model return PartialView("_Results", yourModel); }
Results results = new Results(); // start with an empty one int[] sizes = new int[] { 1, 5, 10, 25, 50, 100, 200, 1000 }; int last=0; for(int i = 0; i<size.length; i++) { int size = sizes[i]; results = updateDetails(results,strings.subList(last,size)); System.out.println(results); last = size; }
Results results = new Results(); // start with an empty one results = updateDetails(results,strings.subList(0,1)); System.out.println(results); results = updateDetails(results,strings.subList(1,5)); System.out.println(results); results = updateDetails(results,strings.subList(5,10)); System.out.println(results);
Results calculate(Tree node) { if (node == null) return new Results(0,0,0); else { Results leftResults = calculate(node.left); Results rightResults = calculate(node.right); int leftLength = 1 + leftResults.leftLength; int rightLength = 1 + rightResults.rightLength; int maxLength = Math.max(Math.max(leftLength, rightLength), Math.max(leftResults.maxLength, rightResults.maxLength)); return new Results(leftLength, rightLength, maxLength); } }
for(int a = 0; a < n; a++) Results r = new Results(); r = buyCoffee(cc); purchases.add(r);