code
stringlengths
73
34.1k
label
stringclasses
1 value
private void validate() { if ((this.segments.length < 0) && (!this.snapshot)) { throw new IllegalArgumentException("segments.length:" + Integer.valueOf(this.segments.length)); } for (int i = 0; i < this.segments.length; i++) { if (this.segments[i] < 0) { throw new IllegalArgumentExcepti...
java
public static Integer computeGrammarSize(GrammarRules rules, Integer paaSize) { // The final grammar's size in BYTES // int res = 0; // The final size is the sum of the sizes of all rules // for (GrammarRuleRecord r : rules) { String ruleStr = r.getRuleString(); String[] tokens = r...
java
public static GrammarRules performPruning(double[] ts, GrammarRules grammarRules) { RulePruningAlgorithm pruner = new RulePruningAlgorithm(grammarRules, ts.length); pruner.pruneRules(); return pruner.regularizePrunedRules(); }
java
public static double computeCover(boolean[] cover) { int covered = 0; for (boolean i : cover) { if (i) { covered++; } } return (double) covered / (double) cover.length; }
java
private boolean compatible(int i, int j, Set<Integer> T[][]) { if(s2comp[i] != s2comp[j]) return false; for(int k = 0; k < nbLabels; k++) { if(! T[i][k].equals(T[j][k])) return false; } return true; }
java
public boolean register(E e, String name) { if (resolve.containsKey(name)) { return false; } resolve.put(name, e); rev.put(e, name); return true; }
java
@Override public boolean substituteVM(VM curId, VM nextId) { if (VM.TYPE.equals(elemId)) { if (rev.containsKey(nextId)) { //the new id already exists. It is a failure scenario. return false; } String fqn = rev.remove(curId); if...
java
@SuppressWarnings("unchecked") public static NamingService<VM> getVMNames(Model mo) { return (NamingService<VM>) mo.getView(ID + VM.TYPE); }
java
@SuppressWarnings("unchecked") public static NamingService<Node> getNodeNames(Model mo) { return (NamingService<Node>) mo.getView(ID + Node.TYPE); }
java
public boolean applyEvents(Hook k, Model i) { for (Event n : getEvents(k)) { if (!n.apply(i)) { return false; } } return true; }
java
public boolean addEvent(Hook k, Event n) { Set<Event> l = events.get(k); if (l == null) { l = new HashSet<>(); events.put(k, l); } return l.add(n); }
java
public Set<Event> getEvents(Hook k) { Set<Event> l = events.get(k); return l == null ? Collections.emptySet() : l; }
java
@Override public void addDim(int c, int[] cUse, IntVar[] dUse, int[] alias) { capacities.add(c); cUsages.add(cUse); dUsages.add(dUse); aliases.add(alias); }
java
@Override public boolean beforeSolve(ReconfigurationProblem r) { super.beforeSolve(r); for (int i = 0; i < aliases.size(); i++) { int capa = capacities.get(i); int[] alias = aliases.get(i); int[] cUse = cUsages.get(i); int[] dUses = new int[dUsages.get...
java
public static List<ChocoView> resolveDependencies(Model mo, List<ChocoView> views, Collection<String> base) throws SchedulerException { Set<String> done = new HashSet<>(base); List<ChocoView> remaining = new ArrayList<>(views); List<ChocoView> solved = new ArrayList<>(); while (!remainin...
java
public static List<RuleInterval> getZeroIntervals(int[] coverageArray) { ArrayList<RuleInterval> res = new ArrayList<RuleInterval>(); int start = -1; boolean inInterval = false; int intervalsCounter = -1; // slide over the array from left to the right // for (int i = 0; i < coverageArray....
java
public static double getCoverAsFraction(int seriesLength, GrammarRules rules) { boolean[] coverageArray = new boolean[seriesLength]; for (GrammarRuleRecord rule : rules) { if (0 == rule.ruleNumber()) { continue; } ArrayList<RuleInterval> arrPos = rule.getRuleIntervals(); for (R...
java
public static double getMeanRuleCoverage(int length, GrammarRules rules) { // get the coverage array // int[] coverageArray = new int[length]; for (GrammarRuleRecord rule : rules) { if (0 == rule.ruleNumber()) { continue; } ArrayList<RuleInterval> arrPos = rule.getRuleIntervals...
java
public void removeLayerFromCache(LayerImpl layer) { if (layer.getId() != layerId) { throw new IllegalStateException(); } LayerCacheImpl layerCache = layerCacheRef.get(); if (layerCache != null) { layerCache.remove(layer.getKey(), layer); } }
java
public final V put(K key, V value) { BinTreeNode<K,V> prev = null; BinTreeNode<K,V> node = root; int key_hash_code = key.hashCode(); while(node != null) { prev = node; if(key_hash_code < node.keyHashCode) { node = node.left; } else { if((key_hash_code > node.keyHashCode) || !node.key.equals...
java
private final V remove_semi_leaf(BinTreeNode<K,V> node, BinTreeNode<K,V> prev, int son, BinTreeNode<K,V> m) { if(prev == null) { root = m; } else { if(son == 0) prev.left = m; else prev.right = m; } return node.value; }
java
private final V finish_removal(BinTreeNode<K,V> node, BinTreeNode<K,V> prev, int son, BinTreeNode<K,V> m) { if(m != null) { // set up the links for m m.left = node.left; m.right = node.right; } if(prev == null) root = m; else { if(son == 0) prev.left = m; else prev.right = m; }...
java
private final BinTreeNode<K,V> extract_next(BinTreeNode<K,V> node) { BinTreeNode<K,V> prev = node.right; BinTreeNode<K,V> curr = prev.left; if(curr == null) { node.right = node.right.right; return prev; } while(curr.left != null) { prev = curr; curr = curr.left; } prev.left = curr.right; ...
java
public final Collection<V> values() { return new AbstractCollection<V>() { public Iterator<V> iterator() { final Iterator<Map.Entry<K,V>> ite = entryIterator(); return new Iterator<V>() { public boolean hasNext() { return ite.hasNext(); } public void remove() { ite.remove(); } public V ...
java
public final Set<Map.Entry<K,V>> entrySet() { return new AbstractSet<Map.Entry<K,V>>() { public Iterator<Map.Entry<K,V>> iterator() { return entryIterator(); } public int size() { return size; } }; }
java
public final Set<K> keySet() { return new AbstractSet<K>() { public Iterator<K> iterator() { final Iterator<Map.Entry<K,V>> ite = entryIterator(); return new Iterator<K>() { public boolean hasNext() { return ite.hasNext(); } public void remove() { ite.remove(); } public K next() ...
java
public void processChildren(Node node) { for (Node cursor = node.getFirstChild(); cursor != null; cursor = cursor.getNext()) { if (cursor.getType() == Token.CALL) { // The node is a function or method call Node name = cursor.getFirstChild(); if (name != null && name.getType() == Token.NAME && // n...
java
public List<IntVar> getIncoming(Node n) { List<IntVar> l = incoming.get(n); if (l == null) { l = Collections.emptyList(); } return l; }
java
public List<IntVar> getOutgoing(Node n) { List<IntVar> l = outgoings.get(n); if (l == null) { l = Collections.emptyList(); } return l; }
java
private void checkModel(Model mo, boolean start) throws SatConstraintViolationException { for (SatConstraintChecker<?> c : checkers) { if (start && !c.startsWith(mo)) { SatConstraint cs = c.getConstraint(); if (cs != null) { throw new DiscreteViola...
java
private static JSONObject toJSON(Mapping c) { JSONObject o = new JSONObject(); o.put("offlineNodes", nodesToJSON(c.getOfflineNodes())); o.put("readyVMs", vmsToJSON(c.getReadyVMs())); JSONObject ons = new JSONObject(); for (Node n : c.getOnlineNodes()) { JSONObject w ...
java
public void fillMapping(Model mo, JSONObject o) throws JSONConverterException { Mapping c = mo.getMapping(); for (Node u : newNodes(mo, o, "offlineNodes")) { c.addOfflineNode(u); } for (VM u : newVMs(mo, o, "readyVMs")) { c.addReadyVM(u); } JSONObj...
java
private static Set<Node> newNodes(Model mo, JSONObject o, String key) throws JSONConverterException { checkKeys(o, key); Object x = o.get(key); if (!(x instanceof JSONArray)) { throw new JSONConverterException("array expected at key '" + key + "'"); } Set<Node> s = ne...
java
private static Set<VM> newVMs(Model mo, JSONObject o, String key) throws JSONConverterException { checkKeys(o, key); Object x = o.get(key); if (!(x instanceof JSONArray)) { throw new JSONConverterException("array expected at key '" + key + "'"); } Set<VM> s = new Has...
java
public boolean add(String key, ModuleDepInfo info) { if (info == null) { throw new NullPointerException(); } boolean modified = false; ModuleDepInfo existing = get(key); if (!containsKey(key) || existing != info) { if (existing != null) { modified = existing.add(info); } else { supe...
java
public boolean addAll(ModuleDeps other) { boolean modified = false; for (Map.Entry<String, ModuleDepInfo> entry : other.entrySet()) { modified |= add(entry.getKey(), new ModuleDepInfo(entry.getValue())); } return modified; }
java
public int minVMAllocation(int vmIdx, int v) { int vv = Math.max(v, vmAllocation.get(vmIdx)); vmAllocation.set(vmIdx, vv); return vv; }
java
public double capOverbookRatio(int nIdx, double d) { if (d < 1) { return ratios.get(nIdx); } double v = Math.min(ratios.get(nIdx), d); ratios.set(nIdx, v); return v; }
java
@Override public boolean beforeSolve(ReconfigurationProblem p) throws SchedulerException { for (VM vm : source.getMapping().getAllVMs()) { int vmId = p.getVM(vm); int v = getVMAllocation(vmId); if (v < 0) { int prevUsage = rc.getConsumption(vm); ...
java
private boolean capHosting(int nIdx, int min, int nbZeroes) { Node n = rp.getNode(nIdx); double capa = getSourceResource().getCapacity(n) * getOverbookRatio(nIdx)/*.getLB()*/; int card = (int) (capa / min) + nbZeroes + 1; if (card < source.getMapping().getRunningVMs(n).size()) { // T...
java
private void checkInitialSatisfaction() { //Seems to me we don't support ratio change for (Node n : rp.getSourceModel().getMapping().getOnlineNodes()) { int nIdx = rp.getNode(n); double ratio = getOverbookRatio(nIdx)/*.getLB()*/; double capa = getSourceResource().getC...
java
public static TObjectIntMap<VM> getWeights(ReconfigurationProblem rp, List<CShareableResource> rcs) { Model mo = rp.getSourceModel(); int[] capa = new int[rcs.size()]; int[] cons = new int[rcs.size()]; TObjectIntMap<VM> cost = new TObjectIntHashMap<>(); for (Node n : mo.getMappi...
java
private boolean distinctVMStates() { boolean ok = vms.size() == running.size() + sleeping.size() + ready.size() + killed.size(); //It is sure there is no solution as a VM cannot have multiple destination state Map<VM, VMState> states = new HashMap<>(); for (VM v : running) { ...
java
@Override @SuppressWarnings("squid:S3346") public ReconfigurationPlan buildReconfigurationPlan(Solution s, Model src) throws SchedulerException { ReconfigurationPlan plan = new DefaultReconfigurationPlan(src); for (NodeTransition action : nodeActions) { action.insertActions(s, plan);...
java
private void defaultHeuristic() { IntStrategy intStrat = Search.intVarSearch(new FirstFail(csp), new IntDomainMin(), csp.retrieveIntVars(true)); SetStrategy setStrat = new SetStrategy(csp.retrieveSetVars(), new InputOrder<>(csp), new SetDomainMin(), true); RealStrategy realStrat = new RealStrate...
java
private void makeCardinalityVariables() { vmsCountOnNodes = new ArrayList<>(nodes.size()); int nbVMs = vms.size(); for (Node n : nodes) { vmsCountOnNodes.add(csp.intVar(makeVarLabel("nbVMsOn('", n, "')"), 0, nbVMs, true)); } vmsCountOnNodes = Collections.unmodifiableL...
java
@Override public Iterator<Action> iterator() { Set<Action> sorted = new TreeSet<>(startFirstComparator); sorted.addAll(actions); return sorted.iterator(); }
java
private void addDirectionalEdge(Edge e) { if (edgeAccess.getCapacity() < getEdgeIndex(edgePos) + EDGE_SIZE) edgeAccess.ensureCapacity(edgeAccess.getCapacity() + INITIAL_EDGE_FILE_SIZE); long fromId = nodIdMapping.get(e.getFromNodeId()); long toId = nodIdMapping.get(e.getToNodeId()); long fromIndex...
java
public static DefaultConstraintsCatalog newBundle() { DefaultConstraintsCatalog c = new DefaultConstraintsCatalog(); c.add(new AmongBuilder()); c.add(new BanBuilder()); c.add(new ResourceCapacityBuilder()); c.add(new RunningCapacityBuilder()); c.add(new FenceBuilder()); ...
java
public boolean add(SatConstraintBuilder c) { if (this.builders.containsKey(c.getIdentifier())) { return false; } this.builders.put(c.getIdentifier(), c); return true; }
java
public int compare(T o1, T o2) { if(o1 == o2) return 0; String str1 = (o1 == null) ? "null" : o1.toString(); String str2 = (o2 == null) ? "null" : o2.toString(); return str1.compareTo(str2); }
java
public static CaseSyntax of(Character separator, CaseConversion allCharCase) { return of(separator, allCharCase, allCharCase, allCharCase); }
java
protected void registerDefaultDatatypes() { registerStandardDatatype(String.class); registerStandardDatatype(Boolean.class); registerStandardDatatype(Character.class); registerStandardDatatype(Currency.class); registerCustomDatatype(Datatype.class); // internal trick... registerNumberDatatypes(...
java
public void setExtraDatatypes(List<String> datatypeList) { getInitializationState().requireNotInitilized(); for (String fqn : datatypeList) { registerCustomDatatype(fqn); } }
java
public static CompressionCodec getGzipCodec(Configuration conf) { try { return (CompressionCodec) ReflectionUtils.newInstance( conf.getClassByName("org.apache.hadoop.io.compress.GzipCodec").asSubclass(CompressionCodec.class), conf); } catch (ClassNotFoundExcep...
java
public static boolean isNearMultipleBorders(@Nonnull final Point point, @Nonnull final Territory territory) { checkDefined("point", point); if (territory != Territory.AAA) { final int territoryNumber = territory.getNumber(); if (territory.getParentTerritory() != null) { ...
java
public void enqueue(RepairDigramRecord digramRecord) { // System.out.println("before == " + this.toString()); // if the same key element is in the queue - something went wrong with tracking... if (elements.containsKey(digramRecord.str)) { throw new IllegalArgumentException( "Element wit...
java
public RepairDigramRecord get(String key) { RepairQueueNode el = this.elements.get(key); if (null != el) { return el.payload; } return null; }
java
private void removeNodeFromList(RepairQueueNode el) { // the head case // if (null == el.prev) { if (null != el.next) { this.head = el.next; this.head.prev = null; el=null; } else { // can't happen? yep. if there is only one element exists... this.he...
java
public int evaluate(Model mo, Class<? extends Action> a, Element e) throws SchedulerException { ActionDurationEvaluator<Element> ev = durations.get(a); if (ev == null) { throw new SchedulerModelingException(null, "Unable to estimate the duration of action '" + a.getSimpleName() + "' related ...
java
protected void parseParameter(String parameter, CliParserState parserState, CliParameterConsumer parameterConsumer) { if (parserState.isOptionsComplete()) { // no more options (e.g. --foo), only arguments from here List<CliArgumentContainer> argumentList = this.cliState.getArguments(parserState.require...
java
private int printHelpOptions(CliOutputSettings settings, Map<CliOption, CliOptionHelpInfo> option2HelpMap, StringBuilder parameters, Collection<CliOptionContainer> modeOptions) { int maxOptionColumnWidth = 0; for (CliOptionContainer option : modeOptions) { CliOption cliOption = option.getOption(); ...
java
public boolean contains(Object o) { for(T e : elemArray) { if((o == e) || ((o != null) && o.equals(e))) { return true; } } return false; }
java
public Set<Action> getDependencies(Action a) { if (!demandingNodes.containsKey(a)) { return Collections.emptySet(); } Node n = demandingNodes.get(a); Set<Action> allActions = getFreeings(n); Set<Action> pre = new HashSet<>(); for (Action action : allActions) {...
java
public static boolean isExplodeRequires(HttpServletRequest request) { if (isIncludeRequireDeps(request)) { // don't expand require deps if we're including them in the response. return false; } boolean result = false; IAggregator aggr = (IAggregator)request.getAttribute(IAggregator.AGGREGATOR_REQATTR...
java
public static boolean isHasFiltering(HttpServletRequest request) { IAggregator aggr = (IAggregator)request.getAttribute(IAggregator.AGGREGATOR_REQATTRNAME); IOptions options = aggr.getOptions(); return (options != null) ? !options.isDisableHasFiltering() : true; }
java
@Nonnull static Boundary createBoundaryForTerritoryRecord(final int territoryRecord) { return new Boundary( DATA_MODEL.getLatMicroDegMin(territoryRecord), DATA_MODEL.getLonMicroDegMin(territoryRecord), DATA_MODEL.getLatMicroDegMax(territoryRecord), DATA_MODEL.getLonMicroDegMa...
java
boolean containsPoint(@Nonnull final Point p) { if (!p.isDefined()) { return false; } final int latMicroDeg = p.getLatMicroDeg(); if ((latMicroDegMin > latMicroDeg) || (latMicroDeg >= latMicroDegMax)) { return false; } final int lonMicroDeg = p.get...
java
public static List<Precedence> newPrecedence(VM vmBefore, Collection<VM> vmsAfter) { return newPrecedence(Collections.singleton(vmBefore), vmsAfter); }
java
public static List<Precedence> newPrecedence(Collection<VM> vmsBefore, VM vmAfter) { return newPrecedence(vmsBefore, Collections.singleton(vmAfter)); }
java
public static List<Precedence> newPrecedence(Collection<VM> vmsBefore, Collection<VM> vmsAfter) { List<Precedence> l = new ArrayList<>(vmsBefore.size() * vmsAfter.size()); for (VM vmb : vmsBefore) { for (VM vma : vmsAfter) { l.add(new Precedence(vmb, vma)); } ...
java
private ESat isConsistent() { int[][] l = new int[nbDims][nbBins]; for (int i = 0; i < bins.length; i++) { if (bins[i].isInstantiated()) { for (int d = 0; d < nbDims; d++) { int v = bins[i].getValue(); l[d][v] += iSizes[d][i]; ...
java
@Override public int getPropagationConditions(int idx) { return idx < bins.length ? IntEventType.all() : IntEventType.BOUND.getMask() + IntEventType.INSTANTIATE.getMask(); }
java
private void computeSumItemSizes() { for (int d = 0; d < nbDims; d++) { long sum = 0; for (int i = 0; i < iSizes[d].length; i++) { sum += iSizes[d][i]; } this.sumISizes[d] = sum; } }
java
@Override public void clearCached(ICacheManager mgr) { Map<String, CacheEntry> moduleBuilds; synchronized (this) { moduleBuilds = _moduleBuilds; _moduleBuilds = null; } if (moduleBuilds != null) { for (Map.Entry<String, CacheEntry> entry : moduleBuilds.entrySet()) { entry.getValue().delet...
java
public static SplittableElementSet<VM> newVMIndex(Collection<VM> c, TIntIntHashMap idx) { return new SplittableElementSet<>(c, idx); }
java
public static SplittableElementSet<Node> newNodeIndex(Collection<Node> c, TIntIntHashMap idx) { return new SplittableElementSet<>(c, idx); }
java
public boolean forEachPartition(IterateProcedure<E> p) { int curIdx = index.get(values.get(0).id()); int from; int to; for (from = 0, to = 0; to < values.size(); to++) { int cIdx = index.get(values.get(to).id()); if (curIdx != cIdx) { if (!p.extrac...
java
public Set<E> getSubSet(int k) { int from = -1; //TODO: very bad. Bounds should be memorized for (int x = 0; x < values.size(); x++) { int cIdx = index.get(values.get(x).id()); if (cIdx == k && from == -1) { from = x; } if (from >= ...
java
public List<ElementSubSet<E>> getPartitions() { final List<ElementSubSet<E>> partitions = new ArrayList<>(); forEachPartition((idx, key, from, to) -> { partitions.add(new ElementSubSet<>(SplittableElementSet.this, key, from, to)); return true; }); return partition...
java
public ICacheKeyGenerator combine(ICacheKeyGenerator otherKeyGen) { if (this.equals(otherKeyGen)) { return this; } @SuppressWarnings("unchecked") AbstractCollectionCacheKeyGenerator<T> other = (AbstractCollectionCacheKeyGenerator<T>)otherKeyGen; if (isProvisional() && other.isProvisional()) { // ...
java
public static final void setReader(String format, TreeReader reader) { String key = format.toLowerCase(); readers.put(key, reader); if (JSON.equals(key)) { cachedJsonReader = reader; } }
java
protected int resolveInclude() throws XMLStreamException { // we are no more in fallback mode this.fallback = false; this.depth++; int eventType = -1; // read attributes... String href = getAttributeValue(null, "href"); LOGGER.trace("Resolving xi:include to href {}", href); String xpoin...
java
protected void closeInitialInclude() throws XMLStreamException { LOGGER.trace("Closing xi:include"); int eventType = -1; // we ascend the XML until the initial include is closed. while (this.depth > 0) { eventType = this.mainReader.next(); if (eventType == XMLStreamConstants.START_ELEMENT) ...
java
public boolean read() { if (state == State.READING_FRAME_SIZE) { // try to read the frame size completely if (!internalRead(frameSizeBuffer)) return false; // if the frame size has been read completely, then prepare to read the // actu...
java
public boolean write() { assert state == State.WRITING; boolean writeFailed = false; try { if (response.streamTo(transport) < 0) { writeFailed = true; return false; } else if (!response.isFullyStreamed(...
java
public void changeSelectInterests() { switch (state) { case READY_TO_WRITE: // set the OP_WRITE interest state = State.WRITING; break; case READY_TO_READ_FRAME_SIZE: state = State.READING_FRAME_SIZE; break; ...
java
public void invoke() { assert state == State.READ_FRAME_COMPLETE : "Invoke called in invalid state: " + state; TTransport inTrans = getInputTransport(); TProtocol inProt = thriftFactories.inputProtocolFactory.getProtocol(inTrans); TProtocol outProt = thriftFactories.outputProtocolFa...
java
private boolean internalRead(Buffer buffer) { try { return !(buffer.readFrom(transport) < 0); } catch (IOException e) { logger.warn("Got an IOException in internalRead!", e); return false; } }
java
public void close() { freeDataBuffer(); frameSizeBuffer.free(); transport.close(); if (response != null) response.close(); }
java
public ArrayList<SameLengthMotifs> classifyMotifs(double lengthThreshold, GrammarRules grammarRules) { // reset vars ArrayList<SameLengthMotifs> allClassifiedMotifs = new ArrayList<SameLengthMotifs>(); // down to business ArrayList<SAXMotif> allMotifs = getAllMotifs(grammarRules); ...
java
protected ArrayList<SAXMotif> getAllMotifs(GrammarRules grammarRules) { // result ArrayList<SAXMotif> allMotifs = new ArrayList<SAXMotif>(); int ruleNumber = grammarRules.size(); // iterate over all rules for (int i = 0; i < ruleNumber; i++) { // iterate over all segments/motifs/...
java
protected ArrayList<SameLengthMotifs> removeOverlappingInSimiliar( ArrayList<SameLengthMotifs> allClassifiedMotifs, GrammarRules grammarRules, double[] ts, double thresouldCom) { ArrayList<SAXMotif> motifsBeDeleted = new ArrayList<SAXMotif>(); SAXPointsNumber[] pointsNumberRemoveStrategy = c...
java
protected boolean decideRemove(SAXMotif motif1, SAXMotif motif2, SAXPointsNumber[] pointsNumberRemoveStrategy) { // motif1 details int motif1Start = motif1.getPos().getStart(); int motif1End = motif1.getPos().getEnd() - 1; int length1 = motif1End - motif1Start; // motif2 details ...
java
protected ArrayList<SameLengthMotifs> refinePatternsByClustering(GrammarRules grammarRules, double[] ts, ArrayList<SameLengthMotifs> allClassifiedMotifs, double fractionTopDist) { DistanceComputation dc = new DistanceComputation(); double[] origTS = ts; ArrayList<SameLengthMotifs> newAllClassified...
java
private ArrayList<String[]> findCluster(Cluster cluster, double cutDist, int minPatternPerCls) { ArrayList<String[]> clusterTSIdx = new ArrayList<String[]>(); if (cluster.getDistance() != null) { // if (cluster.getDistance() > cutDist) { if (cluster.getDistanceValue() > cutDist) { i...
java
private ArrayList<String> getNameInCluster(Cluster cluster) { ArrayList<String> itemsInCluster = new ArrayList<String>(); String nodeName; if (cluster.isLeaf()) { nodeName = cluster.getName(); itemsInCluster.add(nodeName); } else { // String[] clusterName = cluster.getNam...
java
private ArrayList<SameLengthMotifs> SeparateMotifsByClustering(ArrayList<String[]> clusterTSIdx, SameLengthMotifs sameLenMotifs) { ArrayList<SameLengthMotifs> newResult = new ArrayList<SameLengthMotifs>(); if (clusterTSIdx.size() > 1) { ArrayList<SAXMotif> subsequences = sameLenMotifs.getSameLen...
java
@Override public BtrpOperand go(BtrPlaceTree parent) { String cname = getText(); if (catalog == null) { return ignoreError("No constraints available"); } SatConstraintBuilder b = catalog.getConstraint(cname); if (b == null) { ignoreError("Unknown cons...
java
public static Process runProcess(String... cmdParts) throws IOException { return new ProcessBuilder(buildCommandline(cmdParts)) .inheritIO() .start(); }
java