本文整理了Java中java.util.Vector.firstElement()
方法的一些代码示例,展示了Vector.firstElement()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Vector.firstElement()
方法的具体详情如下:
包路径:java.util.Vector
类名称:Vector
方法名:firstElement
[英]Returns the first element in this vector.
[中]返回此向量中的第一个元素。
代码示例来源:origin: marytts/marytts
/**
* getter for start time of tier. Assumes that intervals are in sequence
*
* @return start time of tier as double
*/
public double getXmin() {
try {
return this.intervals.firstElement().getXmin();
} catch (NoSuchElementException nse) {
return this.xmin;
}
}
代码示例来源:origin: marytts/marytts
/**
* getter for start time of tier. Assumes that intervals are in sequence
*
* @return start time of tier as double
*/
public double getXmin() {
try {
return this.intervals.firstElement().getXmin();
} catch (NoSuchElementException nse) {
return this.xmin;
}
}
代码示例来源:origin: brianfrankcooper/YCSB
@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;
}
代码示例来源:origin: xalan/xalan
final Object url = stylesheets.firstElement();
if (url instanceof URL)
return compile((URL)url);
代码示例来源:origin: apache/hbase
throw new ExecutionException("First exception in WorkItemHdfsDir", exceptions.firstElement());
代码示例来源:origin: xalan/xalan
TransformerHandler tHFirst = (TransformerHandler)vTHandler.firstElement();
reader.setContentHandler(tHFirst);
reader.setProperty("http://xml.org/sax/properties/lexical-handler", tHFirst);
代码示例来源:origin: apache/hbase
Throwables.propagateIfInstanceOf(exceptions.firstElement(), IOException.class);
throw Throwables.propagate(exceptions.firstElement());
代码示例来源:origin: brianfrankcooper/YCSB
result.putAll(resMap.firstElement());
代码示例来源:origin: Sable/soot
((GotoStmt) s).setTarget(b.succ.firstElement().getHeadJStmt());
} else {
if ((b.succ.firstElement()) == b.next) {
((IfStmt) s).setTarget(b.succ.elementAt(1).getHeadJStmt());
} else {
((IfStmt) s).setTarget(b.succ.firstElement().getHeadJStmt());
代码示例来源:origin: xalan/xalan
ClassGenerator classGen,
MethodGenerator methodGen) {
final XSLTC xsltc = ((Sort)sortObjects.firstElement()).getXSLTC();
final String className = xsltc.getHelperClassName();
代码示例来源:origin: xalan/xalan
String sortRecordClass)
final XSLTC xsltc = ((Sort)sortObjects.firstElement()).getXSLTC();
final String className = xsltc.getHelperClassName();
代码示例来源:origin: stackoverflow.com
while ( messages.size() == 0 )
wait();
String message = (String)messages.firstElement();
messages.removeElement( message );
return message;
代码示例来源:origin: stackoverflow.com
public void run() {
if(!mKillSoundQueue.isEmpty()){
mSoundPool.stop(mKillSoundQueue.firstElement());
代码示例来源:origin: stackoverflow.com
lsEntry = (ChannelSftp.LsEntry) list.firstElement();
oldestFile = lsEntry.getFilename();
attrs = lsEntry.getAttrs();
代码示例来源:origin: camunda/camunda-bpm-platform
"connection available -- size: " +
pool.authenticatedConnections.size());
p = pool.authenticatedConnections.firstElement();
代码示例来源:origin: com.sun.mail/javax.mail
"connection available -- size: " +
pool.authenticatedConnections.size());
p = pool.authenticatedConnections.firstElement();
代码示例来源:origin: freenet/fred
/**
* Returns the first element for this key.
*/
public V get(K key) {
synchronized (table) {
Vector<V> v = table.get(key);
return (v == null ?
null :
v.firstElement());
}
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/**
* PUBLIC:
* Returns the reference table.
*/
public DatabaseTable getReferenceTable(ClassDescriptor desc) {
// TODO: This won't work for direct collection.
// Should extract the target table from joinCriteria (if it's not null),
// like ManyToManyQueryKey.getRelationTable does.
return desc.getTables().firstElement();
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/**
* Wait until has an element or is complete.
*/
public synchronized Object firstElement() {
while ((!isComplete()) && (super.size() < 1)) {
waitUntilAdd();
}
return super.firstElement();
}
代码示例来源:origin: httpunit/httpunit
private void assertMatchingSet( String comment, Object[] expected, Vector foundItems ) {
Vector expectedItems = new Vector();
for (int i = 0; i < expected.length; i++) expectedItems.addElement( expected[ i ] );
for (int i = 0; i < expected.length; i++) {
if (!foundItems.contains( expected[ i ] )) {
fail( comment + ": expected " + asText( expected ) + " but missing " + expected[ i ] );
} else {
foundItems.removeElement( expected[ i ] );
}
}
if (!foundItems.isEmpty()) fail( comment + ": expected " + asText( expected ) + " but found superfluous" + foundItems.firstElement() );
}
内容来源于网络,如有侵权,请联系作者删除!