public void addColumnGroup(ColumnGroup g) { if (columnGroups == null) { columnGroups = new Vector<ColumnGroup>(); } columnGroups.addElement(g); }
public Enumeration getCurrentLoggers() { Vector<Logger> loggers = new Vector<Logger>(ht.size()); Enumeration elems = ht.elements(); while (elems.hasMoreElements()) { Object o = elems.nextElement(); if (o instanceof Logger) { Logger logger = (Logger)o; loggers.addElement(logger); } } return loggers.elements(); }
public static String[] byteArrToUStringArr(byte[] b) { int off = 0; Vector<String> v = new Vector<>(); while (off < b.length) { int length = byteArrToInt(b, off); if (length != 0) { v.addElement(byteArrToUString(b, off + 4, length)); } else { v.addElement(""); } off = off + 2 * length + 4; } String[] s = new String[v.size()]; for (int i = 0; i < s.length; i++) { s[i] = v.elementAt(i); } return s; }
ZipEntryRO[] getEntriesAt(String path) { Vector<ZipEntryRO> zev = new Vector<ZipEntryRO>(); Collection<ZipEntryRO> values = mHashMap.values(); if (null == path) path = ""; int length = path.length(); for (ZipEntryRO ze : values) { if (ze.mFileName.startsWith(path)) { if (-1 == ze.mFileName.indexOf('/', length)) { zev.add(ze); } } } ZipEntryRO[] entries = new ZipEntryRO[zev.size()]; return zev.toArray(entries); }
_templates = new Vector(); final Enumeration templates = oldTemplates.elements(); while (templates.hasMoreElements()) { final Template template = (Template)templates.nextElement(); final int prec = template.getImportPrecedence(); if ((prec >= min) && (prec < max)) addTemplate(template); final int[] types = new int[DTM.NTYPES + names.size()]; for (int i = 0; i < types.length; i++) { types[i] = i; for (int i = 0; i < names.size(); i++) { final String name = (String)names.elementAt(i); isAttribute[i+DTM.NTYPES] = isAttributeName(name); isNamespace[i+DTM.NTYPES] = isNamespaceName(name);
private static String[] split(String input, char sep, int limit) { Vector v = new Vector(); boolean limited = (limit > 0); int applied = 0; else { ++applied; v.add(part.toString()); part = new StringBuffer(); ++index; v.add(part.toString()); int last = v.size(); if (0 == limit) { for (int j = v.size() - 1; j >= 0; --j) { String s = (String) v.elementAt(j); if ("".equals(s)) --last; ret[i] = (String) v.elementAt(i);
Vector vector = new Vector(list); Enumeration en = vector.elements(); test = CollectionUtils.index(en,0); assertTrue(test.equals("zero")); en = vector.elements(); test = CollectionUtils.index(en,1); assertTrue(test.equals("one")); assertTrue(test.equals(en) && !en.hasMoreElements());
int state = normal; StringTokenizer tok = new StringTokenizer(toProcess, "\"\' ", true); Vector v = new Vector(); StringBuffer current = new StringBuffer(); } else if (" ".equals(nextTok)) { if (current.length() != 0) { v.addElement(current.toString()); current.setLength(0); v.addElement(current.toString()); String[] args = new String[v.size()]; v.copyInto(args); return args;
Vector<String> lines = new Vector<>(); // 页面行 int paraSpace = 0; mPageLineCount = mVisibleHeight / (mFontSize + mLineSpace); while ((lines.size() < mPageLineCount) && (curBeginPos > 0)) { Vector<String> paraLines = new Vector<>(); // 段落行 byte[] parabuffer = readParagraphBack(curBeginPos); // 1.读取上一个段落 paraLines.add(strParagraph.substring(0, paintSize)); strParagraph = strParagraph.substring(paintSize); while (lines.size() > mPageLineCount) { // 4.如果段落添加完,但是超出一页,则超出部分需删减 try { curBeginPos += lines.get(0).getBytes(charset).length; // 5.删减行数同时起始位置指针也要跟着偏移
public Vector getAllValidTemplates() { // Return templates if no imported/included stylesheets if (_includedStylesheets == null) { return _templates; } // Is returned value cached? if (_allValidTemplates == null) { Vector templates = new Vector(); int size = _includedStylesheets.size(); for (int i = 0; i < size; i++) { Stylesheet included =(Stylesheet)_includedStylesheets.elementAt(i); templates.addAll(included.getAllValidTemplates()); } templates.addAll(_templates); // Cache results in top-level stylesheet only if (_parentStylesheet != null) { return templates; } _allValidTemplates = templates; } return _allValidTemplates; }
/** * decode the class name of the given argument, or the class name if the argument is zero */ public String decodeClassName(int argNo) { int idx; if (classes == null) { classes = new Vector(); idx = 0; while (idx >= 0) idx = decodeNextClassName(idx); } if (argNo == 0) return (String) classes.elementAt(classes.size() - 1); else return (String) classes.elementAt(argNo - 1); }
@Override public Status read(String table, String key, Set<String> fields, Map<String, ByteIterator> result) { Vector<HashMap<String, ByteIterator>> results = new Vector<>(); final Status status = scan(table, key, 1, fields, results); if (!status.equals(Status.OK)) { return status; } if (results.size() != 1) { return Status.NOT_FOUND; } result.putAll(results.firstElement()); return Status.OK; }
Vector nodes = new Vector(); nodes.addElement(elem); Vector scratchVector = new Vector(); v.setItem(((NodeCompareElem) nodes.elementAt(i)).m_node, i);
public SortedKeyEnumeration(Hashtable ht) { Enumeration f = ht.keys(); Vector keys = new Vector(ht.size()); for (int i, last = 0; f.hasMoreElements(); ++last) { String key = (String) f.nextElement(); for (i = 0; i < last; ++i) { String s = (String) keys.get(i); if (key.compareTo(s) <= 0) break; } keys.add(i, key); } e = keys.elements(); }
public static String[] byteArrToAStringArr(byte[] b) { int off = 0; Vector<String> v = new Vector<>(); while (off < b.length) { int length = byteArrToInt(b, off); if (length != 0) { v.addElement(byteArrToAString(b, off + 4, length)); } else { v.addElement(""); } off = off + length + 4; } String[] s = new String[v.size()]; for (int i = 0; i < s.length; i++) { s[i] = v.elementAt(i); } return s; }
ZipEntryRO[] getEntriesAt(String path) { Vector<ZipEntryRO> zev = new Vector<ZipEntryRO>(); Collection<ZipEntryRO> values = mHashMap.values(); if (null == path) path = ""; int length = path.length(); for (ZipEntryRO ze : values) { if (ze.mFileName.startsWith(path)) { if (-1 == ze.mFileName.indexOf('/', length)) { zev.add(ze); } } } ZipEntryRO[] entries = new ZipEntryRO[zev.size()]; return zev.toArray(entries); }