/** * Set the current size of the stack frame. */ void setCurrentStackFrameSize(int sz) { m_variableNames.setSize(sz); }
/** * Set the current size of the stack frame. */ void setCurrentStackFrameSize(int sz) { m_variableNames.setSize(sz); }
/** * Ensures that the formats list can hold entries * up to and including the entry with this index */ private void ensureFormatsSize(int index) { if(_formats.size() <= index) { _formats.setSize(index+1); } } }
/** * Generates all curves based on the specified data. * In addition the legend view is created. */ private void generateCurves(DataPlot dataPlot) { synchronized (_curves) { _legendView = new GraphicalComposite(null); _legendView.addElement(_legend.getBox()); _curves.setSize(0); _nextCurveHints.setSize(0); for (int i = 0, n = dataPlot.getNumberOfElements(); i < n; i++) { Curve curve = _curveFactory.create(i, n, _clippingShape, _legend); _curves.addElement(curve); _nextCurveHints.addElement(new Vector()); DataCurve dataCurve = (DataCurve) dataPlot.getElement(i); _legendView.addElement(curve.getLegendSymbol()); _legendView.addElement( _legend.createCurveTitle(i, n, dataCurve.getTitle())); fillCurve(i, dataCurve); } } }
m_prefixMappings.setSize(topContextIndex);
m_prefixMappings.setSize(topContextIndex);
m_prefixMappings.setSize(topContextIndex);
m_prefixMappings.setSize(topContextIndex);
public void setExpansionFileSize(int index, long size) { if (index >= mExpansionFileSizes.size()) { mExpansionFileSizes.setSize(index + 1); } mExpansionFileSizes.set(index, size); }
public void setExpansionFileName(int index, String name) { if (index >= mExpansionFileNames.size()) { mExpansionFileNames.setSize(index + 1); } mExpansionFileNames.set(index, name); }
/** Clear any nested diagnostic information if any. This method is useful in cases where the same thread can be potentially used over and over in different unrelated contexts. <p>This method is equivalent to calling the {@link #setMaxDepth} method with a zero <code>maxDepth</code> argument. @since 0.8.4c */ public static void clear() { Stack stack = (Stack) ht.get(Thread.currentThread()); if(stack != null) stack.setSize(0); }
/** * Sets the expansion URL. Expansion URL's are not committed to preferences, but are instead * intended to be stored when the license response is processed by the front-end. * * @param index * the index of the expansion URL. This value will be either MAIN_FILE_URL_INDEX or * PATCH_FILE_URL_INDEX * @param URL * the URL to set */ public void setExpansionURL(int index, String URL) { if (index >= mExpansionURLs.size()) { mExpansionURLs.setSize(index + 1); } mExpansionURLs.set(index, URL); }
/** * @param parameter zero-based parameter number */ public void addAnnotation(int parameter, Annotation annotation) { if (parameter >= mParameterAnnotations.size()) { mParameterAnnotations.setSize(parameter); } Vector<Annotation> annotations = mParameterAnnotations.get(parameter); if (annotations == null) { annotations = new Vector<Annotation>(2); mParameterAnnotations.set(parameter, annotations); } annotations.add(annotation); }
/** Set maximum depth of this diagnostic context. If the current depth is smaller or equal to <code>maxDepth</code>, then no action is taken. <p>This method is a convenient alternative to multiple {@link #pop} calls. Moreover, it is often the case that at the end of complex call sequences, the depth of the NDC is unpredictable. The <code>setMaxDepth</code> method circumvents this problem. <p>For example, the combination <pre> void foo() { int depth = NDC.getDepth(); ... complex sequence of calls NDC.setMaxDepth(depth); } </pre> ensures that between the entry and exit of foo the depth of the diagnostic stack is conserved. @see #getDepth @since 0.7.5 */ static public void setMaxDepth(int maxDepth) { Stack stack = (Stack) ht.get(Thread.currentThread()); if(stack != null && maxDepth < stack.size()) stack.setSize(maxDepth); }
/** * Will only insert into the pool if the constant is not already in the * pool. * * @return The actual constant in the pool. */ public ConstantInfo addConstant(ConstantInfo constant) { ConstantInfo info = mConstants.get(constant); if (info != null) { return info; } int entryCount = constant.getEntryCount(); if (mIndexedConstants != null && mPreserveOrder) { int size = mIndexedConstants.size(); mIndexedConstants.setSize(size + entryCount); mIndexedConstants.set(size, constant); constant.mIndex = size; } mConstants.put(constant, constant); mEntries += entryCount; return constant; }
m_namespaceDeclSets.setSize(ds);
m_namespaceDeclSets.setSize(ds);
/** * Terminate the task running the queue, but only if there is a queue. */ synchronized void terminateQueue() { if (q != null) { Vector<EventListener> dummyListeners = new Vector<EventListener>(); dummyListeners.setSize(1); // need atleast one listener q.add(new QueueElement(new TerminatorEvent(), dummyListeners)); q = null; } }
/** * Terminate the task running the queue, but only if there is a queue. */ synchronized void terminateQueue() { if (q != null) { Vector<EventListener> dummyListeners = new Vector<>(); dummyListeners.setSize(1); // need atleast one listener q.add(new QueueElement(new TerminatorEvent(), dummyListeners)); q = null; } }
@Test public void testPrintRecordsWithEmptyVector() throws IOException { try (CSVPrinter csvPrinter = CSVFormat.POSTGRESQL_TEXT.printer()) { final Vector<CSVFormatTest.EmptyEnum> vector = new Vector<>(); final int expectedCapacity = 23; vector.setSize(expectedCapacity); csvPrinter.printRecords(vector); assertEquals(expectedCapacity, vector.capacity()); } }