当前位置: 首页>>代码示例>>Java>>正文


Java Vector.toArray方法代码示例

本文整理汇总了Java中java.util.Vector.toArray方法的典型用法代码示例。如果您正苦于以下问题:Java Vector.toArray方法的具体用法?Java Vector.toArray怎么用?Java Vector.toArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.util.Vector的用法示例。


在下文中一共展示了Vector.toArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getGenericRules

import java.util.Vector; //导入方法依赖的package包/类
/**
 * Gets the genericRules attribute of the YassLanguageFilter object
 *
 * @param data Description of the Parameter
 * @return The genericRules value
 */
public String[] getGenericRules(Vector<YassSong> data) {
    Vector<String> langs = new Vector<>();
    for (Enumeration<?> e = data.elements(); e.hasMoreElements(); ) {
        YassSong s = (YassSong) e.nextElement();
        String lang = s.getLanguage();
        if (lang == null || lang.length() < 1) {
            continue;
        }
        if (!langs.contains(lang)) {
            langs.addElement(lang);

        }
    }
    Collections.sort(langs);

    return langs.toArray(new String[langs.size()]);
}
 
开发者ID:SarutaSan72,项目名称:Yass,代码行数:24,代码来源:YassLanguageFilter.java

示例2: parseBenchArgs

import java.util.Vector; //导入方法依赖的package包/类
String[] parseBenchArgs(StreamTokenizer tokens)
    throws IOException, ConfigFormatException
{
    Vector vec = new Vector();
    for (;;) {
        switch (tokens.ttype) {
            case StreamTokenizer.TT_EOF:
            case StreamTokenizer.TT_EOL:
                return (String[]) vec.toArray(new String[vec.size()]);

            case StreamTokenizer.TT_WORD:
            case '"':
                vec.add(tokens.sval);
                tokens.nextToken();
                break;

            default:
                throw new ConfigFormatException("unrecognized arg token " +
                        "on line " + tokens.lineno());
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:Harness.java

示例3: getAgents2StartFromAgentName

import java.util.Vector; //导入方法依赖的package包/类
/**
 * Gets the description instances of the agents to start, identified by the agent name
 *
 * @param agentName the agent name
 * @return the array of AgentClassElement4SimStart depending on the agent name
 */
public AgentClassElement4SimStart[] getAgents2StartFromAgentName(String agentName) {
	
	AgentClassElement4SimStart[] ace4sArr = null;
	Vector<AgentClassElement4SimStart> ace4sVector = new Vector<AgentClassElement4SimStart>();
	
	for (int i = 0; i < this.agents2Start.size(); i++) {
		AgentClassElement4SimStart ace4s = (AgentClassElement4SimStart) this.agents2Start.get(i);
		if (ace4s.getStartAsName().equals(agentName)) {
			ace4sVector.add(ace4s);
		}
	}

	if (ace4sVector.size()!=0) {
		ace4sArr = ace4sVector.toArray(new AgentClassElement4SimStart[ace4sVector.size()]);	
	}
	return ace4sArr;
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:24,代码来源:EnvironmentController.java

示例4: getAllDevices

import java.util.Vector; //导入方法依赖的package包/类
public String[] getAllDevices() {
    Vector<String> devices = new Vector<String>();
    // Parse each driver
    Iterator<Driver> itdriv;
    try {
        itdriv = getDrivers().iterator();
        while (itdriv.hasNext()) {
            Driver driver = itdriv.next();
            Iterator<File> itdev = driver.getDevices().iterator();
            while (itdev.hasNext()) {
                String device = itdev.next().getName();
                String value = String.format("%s (%s)", device, driver.getName());
                devices.add(value);
            }
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
    return devices.toArray(new String[devices.size()]);
}
 
开发者ID:licheedev,项目名称:Android-SerialPort-API,代码行数:21,代码来源:SerialPortFinder.java

示例5: finalizeSubCurves

import java.util.Vector; //导入方法依赖的package包/类
public static void finalizeSubCurves(Vector<CurveLink> subcurves,
                                     Vector<ChainEnd> chains) {
    int numchains = chains.size();
    if (numchains == 0) {
        return;
    }
    if ((numchains & 1) != 0) {
        throw new InternalError("Odd number of chains!");
    }
    ChainEnd[] endlist = new ChainEnd[numchains];
    chains.toArray(endlist);
    for (int i = 1; i < numchains; i += 2) {
        ChainEnd open = endlist[i - 1];
        ChainEnd close = endlist[i];
        CurveLink subcurve = open.linkTo(close);
        if (subcurve != null) {
            subcurves.add(subcurve);
        }
    }
    chains.clear();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:AreaOp.java

示例6: removeProviders

import java.util.Vector; //导入方法依赖的package包/类
private static Provider[] removeProviders(String cipherAlg) {
    Vector providers = new Vector();
    boolean done = false;
    while (!done) {
        try {
            Cipher c = Cipher.getInstance(cipherAlg);
            Provider p = c.getProvider();
            providers.add(p);
            Security.removeProvider(p.getName());
        } catch (NoSuchAlgorithmException nsae) {
            done = true;
        } catch (NoSuchPaddingException nspe) {
            // should never happen
        }
    }
    return (Provider[]) (providers.toArray(new Provider[0]));
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:18,代码来源:GetKeySpecException.java

示例7: parseHostList

import java.util.Vector; //导入方法依赖的package包/类
public static String[] parseHostList(String hosts) {

		Matcher m = Pattern.compile("([^,\\[]+)(\\[(([^\\]])*)\\])?").matcher(
				hosts);
		Vector<String> list = new Vector<String>();

		while (m.find()) {
			String prefix = m.group(1);
			String range = m.group(3);
			if (range == null) {
				list.add(prefix);
				continue;
			}
			for (String x : range.split(",")) {
				String[] y = x.split("-");
				int start = Integer.parseInt(y[0]);
				int end = y.length == 1 ? start : Integer.parseInt(y[1]);
				for (int i = start; i <= end; i++)
					list.add(prefix + i);
			}
		}
		return list.toArray(new String[0]);
	}
 
开发者ID:intel-hpdd,项目名称:scheduling-connector-for-hadoop,代码行数:24,代码来源:HPCUtils.java

示例8: multiFind

import java.util.Vector; //导入方法依赖的package包/类
private String[] multiFind(String key) {
  Vector value = new Vector();
  for(int i = 0; i < _configs.size(); i++) {
    Vector v = (Vector)_configs.elementAt(i);
    for(int j = 0; j < v.size(); j++) {
      String[] kv = (String[])v.elementAt(j);
      if(kv[0].equals(key)) {
        String foo = kv[1];
        if(foo != null) {
          value.remove(foo);
          value.addElement(foo);
        }
      }
    }
  }
  String[] result = new String[value.size()]; 
  value.toArray(result);
  return result;
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:20,代码来源:OpenSSHConfig.java

示例9: getNativeNames

import java.util.Vector; //导入方法依赖的package包/类
@Override
protected String[] getNativeNames(String fontFileName,
        String platformName) {
    Vector nativeNames;
    if ((nativeNames=(Vector)xlfdMap.get(fontFileName))==null) {
        if (platformName == null) {
            return null;
        } else {
            /* back-stop so that at least the name used in the
             * font configuration file is known as a native name
             */
            String []natNames = new String[1];
            natNames[0] = platformName;
            return natNames;
        }
    } else {
        int len = nativeNames.size();
        return (String[])nativeNames.toArray(new String[len]);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:X11FontManager.java

示例10: MergedLogSourceIterator

import java.util.Vector; //导入方法依赖的package包/类
public MergedLogSourceIterator(MergedLogSource src, long starttime, long endtime, FilterOp filter) throws IllegalArgumentException, FilterException {
    Vector<LogIterator> iters = new Vector<LogIterator>();
    for (LogSource s : src.sources) {
	if (s.overlapsRange(starttime, endtime)) {
	    iters.add(s.iterator(starttime, endtime, filter));
	}
    }
    
    sources = new LogIterator[iters.size()];
    sources = iters.toArray(sources);
    nexts = new LogEntry[iters.size()];
    for (int i = 0; i < sources.length; i++) {
	if (sources[i].hasNext()) 
	    nexts[i] = sources[i].next();
    }
    this.filter = filter;
}
 
开发者ID:didichuxing2,项目名称:https-github.com-apache-zookeeper,代码行数:18,代码来源:MergedLogSource.java

示例11: setParser

import java.util.Vector; //导入方法依赖的package包/类
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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:UnionPathExpr.java

示例12: getAllDevicesPath

import java.util.Vector; //导入方法依赖的package包/类
public String[] getAllDevicesPath() {
    Vector<String> devices = new Vector<String>();
    // Parse each driver
    Iterator<Driver> itdriv;
    try {
        itdriv = getDrivers().iterator();
        while (itdriv.hasNext()) {
            Driver driver = itdriv.next();
            Iterator<File> itdev = driver.getDevices().iterator();
            while (itdev.hasNext()) {
                String device = itdev.next().getAbsolutePath();
                devices.add(device);
            }
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
    return devices.toArray(new String[devices.size()]);
}
 
开发者ID:licheedev,项目名称:Android-SerialPort-API,代码行数:20,代码来源:SerialPortFinder.java

示例13: sortByName

import java.util.Vector; //导入方法依赖的package包/类
public void sortByName(final Row row, final boolean element) {
    if (row == null) {
        final Vector v = getChilds(null, element);
        final Object o[] = v.toArray();
        Arrays.sort(o, new RowNameComparator<Object>());

    } else
        row.sortByName(element);
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:10,代码来源:NDataPlugin.java

示例14: getExtensions

import java.util.Vector; //导入方法依赖的package包/类
public String[] getExtensions() {
    Vector v = new Vector();
    String[] ss = {};
    Elements exts = _root.getChildElements("ext");
    for (int i = 0; i < exts.size(); i++)
        v.add(exts.get(i).getValue());
    return (String[]) v.toArray(ss);
}
 
开发者ID:ser316asu,项目名称:SER316-Ingolstadt,代码行数:9,代码来源:MimeType.java

示例15: SerialStruct

import java.util.Vector; //导入方法依赖的package包/类
/**
  * Constructs a <code>SerialStruct</code> object from the
  * given <code>SQLData</code> object, using the given type
  * map to custom map it to a class in the Java programming
  * language.  The type map gives the SQL type and the class
  * to which it is mapped.  The <code>SQLData</code> object
  * defines the class to which the SQL type will be mapped.
  *
  * @param in an instance of the <code>SQLData</code> class
  *           that defines the mapping of the SQL structured
  *           type to one or more objects in the Java programming language
  * @param map a <code>java.util.Map</code> object in which
  *        each entry consists of 1) a <code>String</code> object
  *        giving the fully qualified name of a UDT and 2) the
  *        <code>Class</code> object for the <code>SQLData</code> implementation
  *        that defines how the UDT is to be mapped
  * @throws SerialException if an error occurs
  */
public SerialStruct(SQLData in, Map<String,Class<?>> map)
    throws SerialException
{

    try {

    //set the type name
    SQLTypeName = in.getSQLTypeName();

    Vector<Object> tmp = new Vector<>();
    in.writeSQL(new SQLOutputImpl(tmp, map));
    attribs = tmp.toArray();

    } catch (SQLException e) {
        throw new SerialException(e.getMessage());
    }
}
 
开发者ID:madHEYsia,项目名称:ClassroomFlipkart,代码行数:36,代码来源:SerialStruct.java


注:本文中的java.util.Vector.toArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。