private List<Field> makeEnrichedFieldList(String desc, String value, List<Data> dataList) { return IntStream.range(0, dataList.size()) .filter(i -> !dataList.get(i).getCode().equals("english")) .boxed () .flatMap(i -> Stream.of(new Field(desc + i + 1, dataList.get(i).getCode()), new Field(value + i + 1, dataList.get(i).getValue())) .collect(Collectors.toList()); }
for(int yi = 0; yi<y; yi++){ for (int xi = 0; xi<x; xi++){ fields[xi][yi] = new Field(xi*r, yi*r); } }
for(int yi = 1; yi<y; yi++){ for (int xi = 1; xi<x; xi++){ fields[xi][yi] = new Field(xi*r, yi*r); } }
{ ... for (int i = 0; i < fields.length; i += 2) fields[i] = fields[i + 1] = new Field(r.nextInt(pool)); shuffleFields(fields); return fields; }
function Field(data) { this.name = data.name; this.foo = function() { document.writeln('foo' + '<br />'); } } var someData = { name: 'MyName' }; var field = new Field(someData); document.writeln(field.name + '<br />'); field.foo();
private List<Field> enrichWithFieldList(String desc, String value, List<Data> dataList) { int[] index = { 1 }; return dataList.stream() .filter(d -> !"english".equals(d.getCode()) .flatMap(d -> Stream.of(new Field(desc+index[0], data.getCode()), new Field(value+index[0]++, data.getValue()))) .collect(Collectors.toList()); }
Field temp = new Field(Field.FOCUSABLE) {
private void createDocument() throws FileNotFoundException { File sjp = new File(dictionaryPath); BufferedReader reader = new BufferedReader(new FileReader(sjp)); String readLine = null; while((readLine = reader.readLine() != null)) { readLine = readLine.trim(); Document dictionary = new Document(); dictionary.add(new Field("word", readLine)); // toAnagram methods sorts the letters in the word. Also makes it // case insensitive. dictionary.add(new Field("anagram", toAnagram(readLine))); indexWriter.addDocument(dictionary); } }
f = new Field(a); f.displayField();