private static void addNavigationElements(@NotNull TreeElement root, @NotNull TIntArrayList navigationOffsets, boolean start) { if (root instanceof PsiTreeElementBase) { PsiElement element = ((PsiTreeElementBase)root).getValue(); int offset; if (start) { offset = element.getTextRange().getStartOffset(); if (element.getLanguage().getID().equals("JAVA")) { // HACK: for Java classes and methods, we want to jump to the opening brace int textOffset = element.getTextOffset(); int braceIndex = element.getText().indexOf('{', textOffset - offset); if (braceIndex >= 0) { offset += braceIndex; } } } else { offset = element.getTextRange().getEndOffset() - 1; } if (!navigationOffsets.contains(offset)) { navigationOffsets.add(offset); } } for (TreeElement child : root.getChildren()) { addNavigationElements(child, navigationOffsets, start); } }
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); int size = stream.readInt(); _data = new int[size]; while (size-- > 0) { int val = stream.readInt(); add(val); } }
public static int[] getSelectedIdx(final BitSet _set) { if (_set == null || _set.isEmpty()) { return FuEmptyArrays.INT0; } final int max = _set.length(); final TIntArrayList list = new TIntArrayList(max); for (int i = 0; i < max; i++) { if (_set.get(i)) { list.add(i); } } return list.toNativeArray(); }
public ListVarSet (Universe universe, Collection included) { this.universe = universe; this.included = new TIntArrayList (included.size ()); java.util.Iterator it = included.iterator(); while (it.hasNext()) { this.included.add (universe.getIndex ((Variable) it.next ())); } this.included.sort (); }
public boolean add (Object o) { int idx = universe.getIndex ((Variable) o); if (idx == -1) throw new UnsupportedOperationException(); included.add (idx); included.sort (); return true; }
public ListVarSet (Universe universe, Collection included) { this.universe = universe; this.included = new TIntArrayList (included.size ()); java.util.Iterator it = included.iterator(); while (it.hasNext()) { this.included.add (universe.getIndex ((Variable) it.next ())); } this.included.sort (); }
public boolean add (Object o) { int idx = universe.getIndex ((Variable) o); if (idx == -1) throw new UnsupportedOperationException(); included.add (idx); included.sort (); return true; }
private void fillUnclusteredInstances (int size) { unclusteredInstances = new TIntArrayList(size); for (int i = 0; i < size; i++) unclusteredInstances.add(i); unclusteredInstances.shuffle(random); }
private void fillUnclusteredInstances (int size) { unclusteredInstances = new TIntArrayList(size); for (int i = 0; i < size; i++) unclusteredInstances.add(i); unclusteredInstances.shuffle(random); }
public final void initWith(final CtuluArrayInteger _m, final boolean _throwEvent) { list_ = new TIntArrayList(_m.list_.length); list_.add(_m.list_); if (_throwEvent) { fireIntStructureChanged(); } }
public Object create() { TIntArrayList list = new TIntArrayList(); for (int i = 0; i < 1000; i++) { list.add(i); } list.trimToSize(); return list; } }
private void addKeysToList(TIntArrayList keys) { if (null != subfv1) { subfv1.addKeysToList(keys); if (null != subfv2) subfv2.addKeysToList(keys); } ListIterator it = listIterator(); while (it.hasNext()) keys.add(((Feature) it.next()).index); }
public GISAttributeModelIntegerInterface deriveNewModel(final int _numObject, final GISReprojectInterpolateurI.IntegerTarget _interpol) { final TIntArrayList newList = new TIntArrayList(_numObject); for (int i = 0; i < _numObject; i++) { newList.add(_interpol.interpol(i)); } return new GISAttributeModelIntegerList(newList, this); }
public GISAttributeModel createSubModel(final int[] _idxToRemove) { final TIntArrayList newList = new TIntArrayList(getSize()); final int nb = getSize(); for (int i = 0; i < nb; i++) { if (Arrays.binarySearch(_idxToRemove, i) < 0) { newList.add(list_.get(i)); } } return new GISAttributeModelIntegerList(newList, this); }
public void preProcess(FeatureVector fv) { cache.resetQuick(); int fi; // cache constrained input features for (int loc = 0; loc < fv.numLocations(); loc++) { fi = fv.indexAtLocation(loc); if (constraints.containsKey(fi)) { cache.add(fi); } } }
public void preProcess(FeatureVector fv) { cache.resetQuick(); int fi; // cache constrained input features for (int loc = 0; loc < fv.numLocations(); loc++) { fi = fv.indexAtLocation(loc); if (constraints.containsKey(fi)) { cache.add(fi); } } }
public void preProcess(FeatureVector fv) { cache.resetQuick(); int fi; // cache constrained input features for (int loc = 0; loc < fv.numLocations(); loc++) { fi = fv.indexAtLocation(loc); if (constraints.containsKey(fi)) { cache.add(fi); } } }
public void preProcess(FeatureVector fv) { cache.resetQuick(); int fi; // cache constrained input features for (int loc = 0; loc < fv.numLocations(); loc++) { fi = fv.indexAtLocation(loc); if (constraints.containsKey(fi)) { cache.add(fi); } } }
public void preProcess(FeatureVector fv) { cache.resetQuick(); int fi; for (int loc = 0; loc < fv.numLocations(); loc++) { fi = fv.indexAtLocation(loc); if (constraintsMap.containsKey(fi)) { cache.add(constraintsMap.get(fi)); } } }
private int[] toValueArray () { TIntArrayList vals = new TIntArrayList (maxTime () * numSlices ()); for (int t = 0; t < lblseq.size (); t++) { Labels lbls = lblseq.getLabels (t); for (int j = 0; j < lbls.size (); j++) { Label lbl = lbls.get (j); vals.add (lbl.getIndex ()); } } return vals.toNativeArray (); }