本文整理了Java中java.util.Stack.firstElement()
方法的一些代码示例,展示了Stack.firstElement()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Stack.firstElement()
方法的具体详情如下:
包路径:java.util.Stack
类名称:Stack
方法名:firstElement
暂无
代码示例来源:origin: libgdx/libgdx
/** Returns true if an asset with the specified name and type is loading, queued to be loaded, or has been loaded. */
public synchronized boolean contains (String fileName, Class type) {
if (tasks.size() > 0) {
AssetDescriptor assetDesc = tasks.firstElement().assetDesc;
if (assetDesc.type == type && assetDesc.fileName.equals(fileName)) return true;
}
for (int i = 0; i < loadQueue.size; i++) {
AssetDescriptor assetDesc = loadQueue.get(i);
if (assetDesc.type == type && assetDesc.fileName.equals(fileName)) return true;
}
return isLoaded(fileName, type);
}
代码示例来源:origin: libgdx/libgdx
/** Returns true if an asset with the specified name is loading, queued to be loaded, or has been loaded. */
public synchronized boolean contains (String fileName) {
if (tasks.size() > 0 && tasks.firstElement().assetDesc.fileName.equals(fileName)) return true;
for (int i = 0; i < loadQueue.size; i++)
if (loadQueue.get(i).fileName.equals(fileName)) return true;
return isLoaded(fileName);
}
代码示例来源:origin: libgdx/libgdx
/** Returns true if an asset with the specified name is loading, queued to be loaded, or has been loaded. */
public synchronized boolean contains (String fileName) {
if (tasks.size() > 0 && tasks.firstElement().assetDesc.fileName.equals(fileName)) return true;
for (int i = 0; i < loadQueue.size; i++)
if (loadQueue.get(i).fileName.equals(fileName)) return true;
return isLoaded(fileName);
}
代码示例来源:origin: libgdx/libgdx
/** Returns true if an asset with the specified name and type is loading, queued to be loaded, or has been loaded. */
public synchronized boolean contains (String fileName, Class type) {
if (tasks.size() > 0) {
AssetDescriptor assetDesc = tasks.firstElement().assetDesc;
if (assetDesc.type == type && assetDesc.fileName.equals(fileName)) return true;
}
for (int i = 0; i < loadQueue.size; i++) {
AssetDescriptor assetDesc = loadQueue.get(i);
if (assetDesc.type == type && assetDesc.fileName.equals(fileName)) return true;
}
return isLoaded(fileName, type);
}
代码示例来源:origin: libgdx/libgdx
AssetLoadingTask currAsset = tasks.firstElement();
if (currAsset.assetDesc.fileName.equals(fileName)) {
currAsset.cancel = true;
代码示例来源:origin: libgdx/libgdx
AssetLoadingTask currAsset = tasks.firstElement();
if (currAsset.assetDesc.fileName.equals(fileName)) {
currAsset.cancel = true;
代码示例来源:origin: camunda/camunda-bpm-platform
public void setThenSaxEventList(List<SaxEvent> thenSaxEventList) {
IfState state = stack.firstElement();
if(state.active) {
state.thenSaxEventList = thenSaxEventList;
} else {
throw new IllegalStateException("setThenSaxEventList() invoked on inactive IfAction");
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
public void setElseSaxEventList(List<SaxEvent> elseSaxEventList) {
IfState state = stack.firstElement();
if(state.active) {
state.elseSaxEventList = elseSaxEventList;
} else {
throw new IllegalStateException("setElseSaxEventList() invoked on inactive IfAction");
}
}
代码示例来源:origin: geotools/geotools
protected boolean stream(ElementHandler handler) {
// create an xpath context from the root element
// TODO: cache the context, should work just the same
// JXPathIntrospector.registerDynamicClass(ElementHandlerImpl.class,
// ElementHandlerPropertyHandler.class);
JXPathIntrospector.registerDynamicClass(NodeImpl.class, NodePropertyHandler.class);
// ElementHandler rootHandler =
// ((DocumentHandler) handlers.firstElement()).getDocumentElementHandler();
Node root = ((DocumentHandler) handlers.firstElement()).getParseNode();
JXPathContext jxpContext = JXPathContextFactory.newInstance().newContext(null, root);
jxpContext.setLenient(true);
Iterator itr = jxpContext.iterate(xpath);
while (itr.hasNext()) {
Object obj = itr.next();
if (handler.getParseNode().equals(obj)) {
return true;
}
}
return false;
}
}
代码示例来源:origin: apache/opennlp
nodeStack.firstElement().addElement(element);
} else {
Node parent = null;
peek = nodeStack.get(index);
} else {
parent = nodeStack.firstElement();
代码示例来源:origin: org.xwiki.platform/xwiki-core-rendering-api
/**
* @return the main printer.
*/
public WikiPrinter getMainPrinter()
{
return this.printers.firstElement();
}
代码示例来源:origin: ch.qos.logback/core
public void setElseSaxEventList(List<SaxEvent> elseSaxEventList) {
IfState state = stack.firstElement();
if(state.active) {
state.elseSaxEventList = elseSaxEventList;
} else {
throw new IllegalStateException("setElseSaxEventList() invoked on inactive IfAction");
}
}
代码示例来源:origin: com.hynnet/logback-core
public void setThenSaxEventList(List<SaxEvent> thenSaxEventList) {
IfState state = stack.firstElement();
if(state.active) {
state.thenSaxEventList = thenSaxEventList;
} else {
throw new IllegalStateException("setThenSaxEventList() invoked on inactive IfAction");
}
}
代码示例来源:origin: org.gosu-lang.gosu/gosu-core
public static ITypeInfo getQualifyingEnclosingTypeInfo( Stack<IFeatureInfo> enclosingFeatureInfos )
{
if( enclosingFeatureInfos.empty() )
{
return null;
}
else
{
return (ITypeInfo)enclosingFeatureInfos.firstElement();
}
}
代码示例来源:origin: ch.qos.logback/core
public void setThenSaxEventList(List<SaxEvent> thenSaxEventList) {
IfState state = stack.firstElement();
if(state.active) {
state.thenSaxEventList = thenSaxEventList;
} else {
throw new IllegalStateException("setThenSaxEventList() invoked on inactive IfAction");
}
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/ch.qos.logback.core
public void setElseSaxEventList(List<SaxEvent> elseSaxEventList) {
IfState state = stack.firstElement();
if(state.active) {
state.elseSaxEventList = elseSaxEventList;
} else {
throw new IllegalStateException("setElseSaxEventList() invoked on inactive IfAction");
}
}
代码示例来源:origin: io.virtdata/virtdata-lib-realer
public void setThenSaxEventList(List<SaxEvent> thenSaxEventList) {
IfState state = stack.firstElement();
if (state.active) {
state.thenSaxEventList = thenSaxEventList;
} else {
throw new IllegalStateException("setThenSaxEventList() invoked on inactive IfAction");
}
}
代码示例来源:origin: tomcat-slf4j-logback/tomcat-slf4j-logback
public void setElseSaxEventList(List<SaxEvent> elseSaxEventList) {
IfState state = stack.firstElement();
if (state.active) {
state.elseSaxEventList = elseSaxEventList;
} else {
throw new IllegalStateException("setElseSaxEventList() invoked on inactive IfAction");
}
}
代码示例来源:origin: com.badlogicgames.gdx/gdx
/** Returns true if an asset with the specified name is loading, queued to be loaded, or has been loaded. */
public synchronized boolean contains (String fileName) {
if (tasks.size() > 0 && tasks.firstElement().assetDesc.fileName.equals(fileName)) return true;
for (int i = 0; i < loadQueue.size; i++)
if (loadQueue.get(i).fileName.equals(fileName)) return true;
return isLoaded(fileName);
}
代码示例来源:origin: com.badlogicgames.gdx/gdx
/** Returns true if an asset with the specified name and type is loading, queued to be loaded, or has been loaded. */
public synchronized boolean contains (String fileName, Class type) {
if (tasks.size() > 0) {
AssetDescriptor assetDesc = tasks.firstElement().assetDesc;
if (assetDesc.type == type && assetDesc.fileName.equals(fileName)) return true;
}
for (int i = 0; i < loadQueue.size; i++) {
AssetDescriptor assetDesc = loadQueue.get(i);
if (assetDesc.type == type && assetDesc.fileName.equals(fileName)) return true;
}
return isLoaded(fileName, type);
}
内容来源于网络,如有侵权,请联系作者删除!