本文整理了Java中java.util.Vector.elements()
方法的一些代码示例,展示了Vector.elements()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Vector.elements()
方法的具体详情如下:
包路径:java.util.Vector
类名称:Vector
方法名:elements
[英]Returns an enumeration on the elements of this vector. The results of the enumeration may be affected if the contents of this vector is modified.
[中]返回此向量元素的枚举。如果修改此向量的内容,则可能会影响枚举结果。
代码示例来源:origin: log4j/log4j
/**
* {@inheritDoc}
*/
public Enumeration getCurrentLoggers() {
return new Vector().elements();
}
代码示例来源:origin: alibaba/druid
public Enumeration<ColumnGroup> getColumnGroups(TableColumn col) {
if (columnGroups == null) {
return null;
}
Enumeration<ColumnGroup> enum1 = columnGroups.elements();
while (enum1.hasMoreElements()) {
ColumnGroup cGroup = (ColumnGroup) enum1.nextElement();
Vector<ColumnGroup> v_ret = cGroup.getColumnGroups(col, new Vector<ColumnGroup>());
if (v_ret != null) {
return v_ret.elements();
}
}
return null;
}
代码示例来源:origin: alibaba/druid
public void setColumnMargin(int margin) {
this.margin = margin;
Enumeration<Object> enumeration = vector.elements();
while (enumeration.hasMoreElements()) {
Object obj = enumeration.nextElement();
if (obj instanceof ColumnGroup) {
((ColumnGroup) obj).setColumnMargin(margin);
}
}
}
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
/**
* Returns an enumeration describing the available options.
*
* @return an enumeration of all the available options.
*/
@Override
public Enumeration<Option> listOptions() {
Vector<Option> newVector = new Vector<Option>();
newVector.addElement(new Option("\tOutput additional statistics.",
"additional-stats", 0, "-additional-stats"));
newVector.addAll(Collections.list(super.listOptions()));
return newVector.elements();
}
代码示例来源:origin: commons-collections/commons-collections
public void testSizeIsEmpty_Enumeration() {
Vector list = new Vector();
assertEquals(true, CollectionUtils.sizeIsEmpty(list.elements()));
list.add("a");
assertEquals(false, CollectionUtils.sizeIsEmpty(list.elements()));
Enumeration en = list.elements();
en.nextElement();
assertEquals(true, CollectionUtils.sizeIsEmpty(en));
}
public void testSizeIsEmpty_Iterator() {
代码示例来源:origin: robovm/robovm
/**
* Constructs a new {@code SequenceInputStream} using the two streams
* {@code s1} and {@code s2} as the sequence of streams to read from.
*
* @param s1
* the first stream to get bytes from.
* @param s2
* the second stream to get bytes from.
* @throws NullPointerException
* if {@code s1} is {@code null}.
*/
public SequenceInputStream(InputStream s1, InputStream s2) {
if (s1 == null) {
throw new NullPointerException("s1 == null");
}
Vector<InputStream> inVector = new Vector<InputStream>(1);
inVector.addElement(s2);
e = inVector.elements();
in = s1;
}
代码示例来源:origin: google/guava
private static Enumeration<Integer> enumerate(Integer... ints) {
Vector<Integer> vector = new Vector<>();
vector.addAll(asList(ints));
return vector.elements();
}
代码示例来源:origin: apache/rocketmq
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();
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Returns the classpath this classloader will consult.
*
* @return the classpath used for this classloader, with elements
* separated by the path separator for the system.
*/
public String getClasspath() {
StringBuffer sb = new StringBuffer();
boolean firstPass = true;
Enumeration componentEnum = pathComponents.elements();
while (componentEnum.hasMoreElements()) {
if (!firstPass) {
sb.append(System.getProperty("path.separator"));
} else {
firstPass = false;
}
sb.append(((File) componentEnum.nextElement()).getAbsolutePath());
}
return sb.toString();
}
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
/**
* Returns an enumeration describing the available options.
*
* @return an enumeration of all the available options.
*/
@Override
public Enumeration<Option> listOptions() {
Vector<Option> result = new Vector<Option>();
result.addElement(new Option("\tThe class index\n" + "\t(default: last)",
"c", 1, "-c <class index>"));
result.addAll(Collections.list(super.listOptions()));
return result.elements();
}
代码示例来源:origin: log4j/log4j
/** {@inheritDoc} */
public Enumeration getAllAppenders() {
return new Vector().elements();
}
代码示例来源:origin: eclipse/paho.mqtt.java
/**
* Returns all of the persistent data from the previously specified persistence directory.
* @return all of the persistent data from the persistence directory.
* @throws MqttPersistenceException if an exception is thrown whilst getting the keys
*/
public Enumeration keys() throws MqttPersistenceException {
checkIsOpen();
File[] files = getFiles();
Vector result = new Vector(files.length);
for (int i=0;i<files.length;i++) {
String filename = files[i].getName();
String key = filename.substring(0,filename.length()-MESSAGE_FILE_EXTENSION.length());
result.addElement(key);
}
return result.elements();
}
代码示例来源:origin: log4j/log4j
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();
}
代码示例来源:origin: jenkinsci/jenkins
for (Enumeration e = systemPackages.elements(); e.hasMoreElements();) {
String packageName = (String) e.nextElement();
if (resourceName.startsWith(packageName)) {
useParentFirst = true;
for (Enumeration e = loaderPackages.elements(); e.hasMoreElements();) {
String packageName = (String) e.nextElement();
if (resourceName.startsWith(packageName)) {
useParentFirst = false;
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
/**
* Returns an enumeration describing the available options.
*
* @return an enumeration of all the available options.
*/
@Override
public Enumeration<Option> listOptions() {
Vector<Option> result = new Vector<Option>();
result.addElement(new Option("The class index", "c", 1,
"-c <the class index>"));
result.addAll(Collections.list(super.listOptions()));
return result.elements();
}
代码示例来源:origin: org.slf4j/log4j-over-slf4j
/**
* This bogus implementation returns an empty enumeration.
*
* @return
*/
public static Enumeration getCurrentLoggers() {
return new Vector().elements();
}
代码示例来源:origin: log4j/log4j
/**
Returns all the currently defined categories in this hierarchy as
an {@link java.util.Enumeration Enumeration}.
<p>The root logger is <em>not</em> included in the returned
{@link Enumeration}. */
public
Enumeration getCurrentLoggers() {
// The accumlation in v is necessary because not all elements in
// ht are Logger objects as there might be some ProvisionNodes
// as well.
Vector v = new Vector(ht.size());
Enumeration elems = ht.elements();
while(elems.hasMoreElements()) {
Object o = elems.nextElement();
if(o instanceof Logger) {
v.addElement(o);
}
}
return v.elements();
}
代码示例来源:origin: log4j/log4j
/**
* make sure we close all network connections when this handler is destroyed.
* @since 1.2.15
*/
public void close() {
synchronized(this) {
for(Enumeration e = connections.elements();e.hasMoreElements();) {
try {
((Socket)e.nextElement()).close();
} catch(InterruptedIOException ex) {
Thread.currentThread().interrupt();
} catch(IOException ex) {
} catch(RuntimeException ex) {
}
}
}
try {
serverSocket.close();
} catch(InterruptedIOException ex) {
Thread.currentThread().interrupt();
} catch(IOException ex) {
} catch(RuntimeException ex) {
}
}
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
/**
* Returns an enumeration describing the available options.
*
* @return an enumeration of all the available options.
*/
@Override
public Enumeration<Option> listOptions() {
Vector<Option> newVector = new Vector<Option>();
newVector.addElement(new Option("\tSet base of the expansion constant\n"
+ "\t(default = 1.3).", "B", 1, "-B <value>"));
newVector.addAll(Collections.list(super.listOptions()));
return newVector.elements();
}
代码示例来源:origin: apache/kylin
/**
* See {@link Properties#propertyNames()}.
*/
public Enumeration<String> propertyNames() {
return new Vector<String>(properties.keySet()).elements();
}
内容来源于网络,如有侵权,请联系作者删除!