Refine search
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); }
/** * @param allInOneLine * allInOneLine * @return result.toArray(new String[0]) * @deprecated Unstable due to platform-specific behavior. Use {@link org.apache.commons.lang.StringUtils#split} or similar * instead. */ @Deprecated public static String[] toStringArray(String allInOneLine) { if (allInOneLine != "") { Vector<String> result = new Vector<String>(); StringTokenizer s = new StringTokenizer(allInOneLine, System.getProperty("line.separator")); String line = null; // Read until either end of file or an empty line while (s.hasMoreTokens() && ((line = s.nextToken()) != null) && (!line.equals(""))) result.add(line); return result.toArray(new String[0]); } else return null; }
public void setParser(Parser parser) { super.setParser(parser); // find all expressions in this Union final Vector components = new Vector(); flatten(components); final int size = components.size(); _components = (Expression[])components.toArray(new Expression[size]); for (int i = 0; i < size; i++) { _components[i].setParser(parser); _components[i].setParent(this); if (_components[i] instanceof Step) { final Step step = (Step)_components[i]; final int axis = step.getAxis(); final int type = step.getNodeType(); // Put attribute iterators first if ((axis == Axis.ATTRIBUTE) || (type == DTM.ATTRIBUTE_NODE)) { _components[i] = _components[0]; _components[0] = step; } // Check if the union contains a reverse iterator if (Axis.isReverse(axis)) _reverse = true; } } // No need to reverse anything if another expression lies on top of this if (getParent() instanceof Expression) _reverse = false; }
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); }
public MqttDeliveryToken[] getOutstandingDelTokens() { final String methodName = "getOutstandingDelTokens"; synchronized(tokens) { //@TRACE 311=> log.fine(CLASS_NAME,methodName,"311"); Vector list = new Vector(); Enumeration enumeration = tokens.elements(); MqttToken token; while(enumeration.hasMoreElements()) { token = (MqttToken)enumeration.nextElement(); if (token != null && token instanceof MqttDeliveryToken && !token.internalTok.isNotified()) { list.addElement(token); } } MqttDeliveryToken[] result = new MqttDeliveryToken[list.size()]; return (MqttDeliveryToken[]) list.toArray(result); } }
/** * @param allInOneLine * allInOneLine * @return result.toArray(new String[0]) * @deprecated Unstable due to platform-specific behavior. Use {@link org.apache.commons.lang.StringUtils#split} or similar * instead. */ @Deprecated public static String[] toStringArray(String allInOneLine) { if (allInOneLine != "") { Vector<String> result = new Vector<String>(); StringTokenizer s = new StringTokenizer(allInOneLine, System.getProperty("line.separator")); String line = null; // Read until either end of file or an empty line while (s.hasMoreTokens() && ((line = s.nextToken()) != null) && (!line.equals(""))) result.add(line); return result.toArray(new String[0]); } else return null; }
Vector<String> vector = new Vector<String>(); String[] strings = vector.toArray(new String[vector.size()]);
static String[] getAPKExpansionFiles(Context ctx, int mainVersion, int patchVersion) { String packageName = ctx.getPackageName(); Vector<String> ret = new Vector<String>(); if (Environment.getExternalStorageState().equals( Environment.MEDIA_MOUNTED)) { File main = new File(strMainPath); if (main.isFile()) { ret.add(strMainPath); File main = new File(strPatchPath); if (main.isFile()) { ret.add(strPatchPath); String[] retArray = new String[ret.size()]; ret.toArray(retArray); return retArray;
if (pureMode || (env != null && env.size() > 0)) { StringBuffer sb = new StringBuffer(); Vector cmdVec = new Vector(); cmdVec.add("cmd.exe"); cmdVec.add("/c"); sb.append("start /b \"\" "); } else { cmdVec.add("bash"); cmdVec.add("--norc"); cmdVec.add("-c"); cmdVec.add(sb.toString()); String[] cmdStrings = (String[]) cmdVec.toArray(new String[0]); if (trace != null && trace.length() > 0) { for (int i = 0; i < cmdStrings.length; i++) {
static String[] getAPKExpansionFiles(Context ctx, int mainVersion, int patchVersion) { String packageName = ctx.getPackageName(); Vector<String> ret = new Vector<String>(); if (Environment.getExternalStorageState().equals( Environment.MEDIA_MOUNTED)) { File main = new File(strMainPath); if (main.isFile()) { ret.add(strMainPath); File main = new File(strPatchPath); if (main.isFile()) { ret.add(strPatchPath); String[] retArray = new String[ret.size()]; ret.toArray(retArray); return retArray;
Vector v = new Vector(16, 16); Vector vf = new Vector(16, 16); float aWeight = Float.parseFloat(fields[0]); sumOfWeights += aWeight; v.add(new Float(aWeight)); // Push the weight vf.add(fields[1]); // Push the function String[] wfun = (String[]) vf.toArray(new String[vf.size()]); float[] fw = new float[v.size()]; for (int i = 0; i < fw.length; i++) { Float aWeight = (Float) v.get(i);
public MBeanInfo getMBeanInfo() { //cat.debug("getMBeanInfo called."); MBeanAttributeInfo[] attribs = new MBeanAttributeInfo[dAttributes.size()]; dAttributes.toArray(attribs); MBeanInfo mb = new MBeanInfo(dClassName, dDescription, attribs, dConstructors, dOperations, new MBeanNotificationInfo[0]); //cat.debug("getMBeanInfo exit."); return mb; }
Vector v = new Vector(16, 16); Vector vf = new Vector(16, 16); float aWeight = Float.parseFloat(fields[0]); sumOfWeights += aWeight; v.add(new Float(aWeight)); // Push the weight vf.add(fields[1]); // Push the function String[] wfun = (String[]) vf.toArray(new String[vf.size()]); float[] fw = new float[v.size()]; for (int i = 0; i < fw.length; i++) { Float aWeight = (Float) v.get(i);
/** * Get the list of patterns that should be excluded by default. * * @return An array of <code>String</code> based on the current * contents of the <code>defaultExcludes</code> * <code>Vector</code>. * * @since Ant 1.6 */ public static String[] getDefaultExcludes() { return (String[]) defaultExcludes.toArray(new String[defaultExcludes .size()]); }
@DataPoints public static CharSequence[] dataPoints() { Vector<CharSequence> charSequences = new Vector<CharSequence>(); charSequences.add(bracedCharacterCode("123456")); charSequences.add(bracedCharacterCode("789012")); charSequences.add(bracedCharacterCode("ABCDEF")); charSequences.add(bracedCharacterCode("abcdef")); charSequences.add(bracedCharacterCode("0")); return charSequences.toArray(new CharSequence[charSequences.size()]); };