/** Gets an array of booleans with the status of the lasers for all channels * * @param lp laser positions per channel * @return extended array with the lp of every channel */ private Boolean[] getLaserPositions(boolean[] lp) { List<Boolean> lasers = new LinkedList<>(); final List<Boolean> lps = Arrays.asList(ArrayUtils.toObject(lp)); for (int i = 0; i < gn_spec_nCh.getInt(); i++) lasers = ListUtils.union(lasers, lps); return lasers.toArray(new Boolean[lasers.size()]); }
public Set<Triple> extractTriplePattern(final Query query, final boolean ignoreOptionals) { triplePattern = new HashSet<>(); optionalTriplePattern = new HashSet<>(); query.getQueryPattern().visit(this); // postprocessing: triplepattern in OPTIONAL clause if (!ignoreOptionals && query.isSelectType()) { for (Triple t : optionalTriplePattern) { if (!ListUtils.intersection(new ArrayList<>(VarUtils.getVars(t)), query.getProjectVars()).isEmpty()) { triplePattern.add(t); } } } return triplePattern; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AnnotationOptionList that = (AnnotationOptionList) o; return ListUtils.isEqualList(this.list, that.list); }
public Definition parseDefinition(File definitionFile, String mainModuleName, String mainProgramsModule) { Definition definition = parser.loadDefinition( mainModuleName, mainProgramsModule, FileUtil.load(definitionFile), definitionFile, definitionFile.getParentFile(), ListUtils.union(lookupDirectories, Lists.newArrayList(Kompile.BUILTIN_DIRECTORY)), autoImportDomains, kore); return definition; }
public Set<Triple> extractTriplePattern(Query query, boolean ignoreOptionals){ triplePattern = new HashSet<Triple>(); candidates = new HashSet<Triple>(); query.getQueryPattern().visit(this); //postprocessing: triplepattern in OPTIONAL clause if(!ignoreOptionals){ if(query.isSelectType()){ for(Triple t : candidates){ if(ListUtils.intersection(new ArrayList<Var>(VarUtils.getVars(t)), query.getProjectVars()).size() >= 2){ triplePattern.add(t); } } } } return triplePattern; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; OptionList<?> that = (OptionList<?>) o; if (!elementClass.equals(that.elementClass)) return false; return ListUtils.isEqualList(list, that.list); }
Source source = Source.apply(options.mainDefinitionFile(files).getAbsolutePath()); File currentDirectory = options.mainDefinitionFile(files).getParentFile(); List<File> lookupDirectories = ListUtils.union(options.includes.stream() .map(files::resolveWorkingDirectory).collect(Collectors.toList()), Lists.newArrayList(Kompile.BUILTIN_DIRECTORY));
public Set<Triple> extractTriplePattern(Query query, boolean ignoreOptionals){ triplePattern = new HashSet<>(); optionalTriplePattern = new HashSet<>(); query.getQueryPattern().visit(this); //postprocessing: triplepattern in OPTIONAL clause if(!ignoreOptionals){ if(query.isSelectType()){ for(Triple t : optionalTriplePattern){ if(!ListUtils.intersection(new ArrayList<>(VarUtils.getVars(t)), query.getProjectVars()).isEmpty()){ triplePattern.add(t); } } } } return triplePattern; }
if (path.size() > head.size() && ListUtils.isEqualList(path.subList(0, head.size()), head))
List<E> union = ListUtils.union(path1, path2); /* concatenate */
public final List<List<E>> findShortestPath(final V initial, final V destination){ final List<E> shortestPath = dijkstraAlgorithm.getPath(initial, destination); initialCostMap = dijkstraAlgorithm.getDistanceMap(initial); final List<E> reversedShortestPath = reverseUpdateEdgesWeight(graph, MapTransformer.getInstance(initialCostMap), shortestPath, initial, destination); discardCommonReversedEdges(graph, shortestPath, reversedShortestPath); final List<E> unitedPaths = ListUtils.union(shortestPath, reversedShortestPath); final List<E> resultPath1 = restorePaths(shortestPath, destination, unitedPaths); final List<E> resultPath2 = restorePaths(reversedShortestPath, destination, unitedPaths); List<List<E>> result = mergePaths(resultPath1, resultPath2); if ((result == null) || (result.size() == 0)){ result = new ArrayList<>(); result.add(shortestPath); } return result; }
} else { noiseCandidates = noiseGenerator.generateNoiseCandidates(sparqlQuery, noiseMethod, ListUtils.union(posExamples, negExamples), maxNrOfNoiseCandidates); Files.write(Joiner.on("\n").join(noiseCandidates), file, Charsets.UTF_8);
noiseCandidates = Files.readLines(file, Charsets.UTF_8); } else { noiseCandidates = generateNoiseCandidates(sparqlQuery, noiseMethod, ListUtils.union(posExamples, negExamples), maxNrOfNoiseCandidates); Files.write(Joiner.on("\n").join(noiseCandidates), file, Charsets.UTF_8);
for (String ex : ListUtils.union(correctPosExamples, falsePosExamples)) { posExamplesMapping.put(new OWLNamedIndividualImpl(IRI.create(ex)), getQueryTree(ex));
for (String ex : ListUtils.union(correctPosExamples, falsePosExamples)) { try { posExamplesMapping.put(new OWLNamedIndividualImpl(IRI.create(ex)), getQueryTree(ex, cbdStructure));
Source.apply(definitionFile.getAbsolutePath()), definitionFile.getParentFile(), ListUtils.union(lookupDirectories, Lists.newArrayList(Kompile.BUILTIN_DIRECTORY)), kore);
List<Rule> rulesForStepFunc = ListUtils.union( groupedByStepFunction.getOrDefault(Optional.of(lbl), Collections.emptyList()), filterNoneRulesByVariableType(lbl, groupedByStepFunction.getOrDefault(Optional.<KLabel>empty(), Collections.emptyList()), functionRules));