@Test public void generateParsings(){ CostModelStrategy target = new CostModelStrategy(tokens, parameterSet); Deencapsulation.invoke(target, "generateParsings"); LinkedList<Parsing> result = Deencapsulation.getField(target, "generatedParsings"); int expectedSize = (int)Math.pow(2, tokens.length-1); Assert.assertEquals(result.size(), expectedSize); }
private void generateParsings() { generatedParsings = new LinkedList<Parsing>(); int numPossibleParsings = (int)Math.round(Math.pow(2, tokens.length-1)); for(int parsingIndex = 0; parsingIndex < numPossibleParsings ; parsingIndex++) { generatedParsings.add(new Parsing(tokens, parsingIndex)); } }
CostModelStrategy extends ParseStrategyBase { private void generateParsings() { generatedParsings = new LinkedList<Parsing>(); int numPossibleParsings = (int)Math.round(Math.pow(2, tokens.length-1)); for(int parsingIndex = 0; parsingIndex < numPossibleParsings ; parsingIndex++) { generatedParsings.add(new Parsing(tokens, parsingIndex)); } } }
CostModelStrategy extends ParseStrategyBase { private void generateParsings() { generatedParsings = new LinkedList<Parsing>(); int numPossibleParsings = (int)Math.round(Math.pow(2, tokens.length-1)); for(int parsingIndex = 0; parsingIndex < numPossibleParsings ; parsingIndex++) { generatedParsings.add(new Parsing(tokens, parsingIndex)); } } CostModelStrategy(TokenizedString tokens,
                             ParseParameterSet parameterSet); }
CostModelStrategy extends ParseStrategyBase { private void generateParsings() { generatedParsings = new LinkedList<Parsing>(); int numPossibleParsings = (int)Math.round(Math.pow(2, tokens.length-1)); for(int parsingIndex = 0; parsingIndex < numPossibleParsings ; parsingIndex++) { generatedParsings.add(new Parsing(tokens, parsingIndex)); } } CostModelStrategy(TokenizedString tokens,
                             ParseParameterSet parameterSet); void getDefaultLengthScorings(SolrParams invariants); @Override List<TreeMap<String,Object>> getOutput(); @Override TreeSet<Parsing> getUnfilteredParsings(); }
CostModelStrategy extends ParseStrategyBase { private void generateParsings() { generatedParsings = new LinkedList<Parsing>(); int numPossibleParsings = (int)Math.round(Math.pow(2, tokens.length-1)); for(int parsingIndex = 0; parsingIndex < numPossibleParsings ; parsingIndex++) { generatedParsings.add(new Parsing(tokens, parsingIndex)); } } CostModelStrategy(TokenizedString tokens,
                             ParseParameterSet parameterSet); void getDefaultLengthScorings(SolrParams invariants); @Override List<TreeMap<String,Object>> getOutput(); @Override TreeSet<Parsing> getUnfilteredParsings();  }