java.util.Stack.lastIndexOf()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(151)

本文整理了Java中java.util.Stack.lastIndexOf()方法的一些代码示例,展示了Stack.lastIndexOf()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Stack.lastIndexOf()方法的具体详情如下:
包路径:java.util.Stack
类名称:Stack
方法名:lastIndexOf

Stack.lastIndexOf介绍

暂无

代码示例

代码示例来源:origin: com.mysema.rdf/rdfbean-core

private boolean inNegation() {
  int notIndex = operatorStack.lastIndexOf(Ops.NOT);
  if (notIndex > -1) {
    int existsIndex = operatorStack.lastIndexOf(Ops.EXISTS);
    return notIndex > existsIndex;
  }
  return false;
}

代码示例来源:origin: org.jdom/jdom-legacy

/**
 * Given a prefix, this will return the namespace URI most 
 * rencently (topmost) associated with that prefix.
 *
 * @param prefix <code>String</code> namespace prefix.
 * @return <code>String</code> - the namespace URI for that prefix.
 */
public String getURI(String prefix) {
  int index = prefixes.lastIndexOf(prefix);
  if (index == -1) {
    return null;
  }
  String uri = (String)uris.elementAt(index);
  return uri;       
}

代码示例来源:origin: org.sonatype.maven.archetype/archetype-common

/**
 * Given a prefix, this will return the namespace URI most rencently (topmost) associated with
 * that prefix.
 * 
 * @param prefix <code>String</code> namespace prefix.
 * @return <code>String</code> - the namespace URI for that prefix.
 */
public String getURI(String prefix) {
  int index=prefixes.lastIndexOf(prefix);
  if (index == -1) {
    return null;
  }
  return uris.elementAt(index);
}

代码示例来源:origin: dragome/dragome-sdk

/**
   * Returns the index of the first occurrence of the object.
   *
   * @return the index of the first occurrence of the object
   * @param o
   *            the object to be searched
   */
  public synchronized int search(Object o)
  {
    int index= lastIndexOf(o);
    if (index >= 0)
      return (size() - index);
    return -1;
  }
}

代码示例来源:origin: apache/maven-archetype

/**
 * Given a prefix, this will return the namespace URI most
 * rencently (topmost) associated with that prefix.
 *
 * @param prefix <code>String</code> namespace prefix.
 * @return <code>String</code> - the namespace URI for that prefix.
 */
public String getURI( String prefix )
{
  int index = prefixes.lastIndexOf( prefix );
  if ( index == -1 )
  {
    return null;
  }
  String uri = (String) uris.elementAt( index );
  return uri;
}

代码示例来源:origin: org.apidesign.bck2brwsr/emul

/**
 * Returns the 1-based position where an object is on this stack.
 * If the object <tt>o</tt> occurs as an item in this stack, this
 * method returns the distance from the top of the stack of the
 * occurrence nearest the top of the stack; the topmost item on the
 * stack is considered to be at distance <tt>1</tt>. The <tt>equals</tt>
 * method is used to compare <tt>o</tt> to the
 * items in this stack.
 *
 * @param   o   the desired object.
 * @return  the 1-based position from the top of the stack where
 *          the object is located; the return value <code>-1</code>
 *          indicates that the object is not on the stack.
 */
public synchronized int search(Object o) {
  int i = lastIndexOf(o);
  if (i >= 0) {
    return size() - i;
  }
  return -1;
}

代码示例来源:origin: jtulach/bck2brwsr

/**
 * Returns the 1-based position where an object is on this stack.
 * If the object <tt>o</tt> occurs as an item in this stack, this
 * method returns the distance from the top of the stack of the
 * occurrence nearest the top of the stack; the topmost item on the
 * stack is considered to be at distance <tt>1</tt>. The <tt>equals</tt>
 * method is used to compare <tt>o</tt> to the
 * items in this stack.
 *
 * @param   o   the desired object.
 * @return  the 1-based position from the top of the stack where
 *          the object is located; the return value <code>-1</code>
 *          indicates that the object is not on the stack.
 */
public synchronized int search(Object o) {
  int i = lastIndexOf(o);
  if (i >= 0) {
    return size() - i;
  }
  return -1;
}

代码示例来源:origin: jpox/jpox

/**
 * Method to retrieve the last position of the element.
 * @param element The element
 * @return The last position of this element in the List.
 **/
public int lastIndexOf(Object element)
{
  if (useCache)
  {
    loadFromStore();
  }
  else if (backingStore != null)
  {
    return backingStore.lastIndexOf(ownerSM, element);
  }
  return delegate.lastIndexOf(element);
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-core

throws InvalidNodeTypeDefException, RepositoryException {
for (Name nt : supertypes) {
  int pos = inheritanceChain.lastIndexOf(nt);
  if (pos >= 0) {
    StringBuilder buf = new StringBuilder();

代码示例来源:origin: apache/jackrabbit

throws InvalidNodeTypeDefException, RepositoryException {
for (Name nt : supertypes) {
  int pos = inheritanceChain.lastIndexOf(nt);
  if (pos >= 0) {
    StringBuilder buf = new StringBuilder();

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-jcr2spi

for (int i = 0; i < supertypes.length; i++) {
  Name stName = supertypes[i];
  int pos = inheritanceChain.lastIndexOf(stName);
  if (pos >= 0) {
    StringBuffer buf = new StringBuffer();

代码示例来源:origin: org.eclipse.jetty/jetty-start

int idx = seenStack.lastIndexOf(property);
for (int i = idx; i < seenStack.size(); i++)

代码示例来源:origin: apache/jackrabbit

for (int i = 0; i < supertypes.length; i++) {
  Name stName = supertypes[i];
  int pos = inheritanceChain.lastIndexOf(stName);
  if (pos >= 0) {
    StringBuffer buf = new StringBuffer();

代码示例来源:origin: msv/msv

ReferenceExp child = (ReferenceExp)itr.next();
int idx = items.lastIndexOf(child);
if(idx!=-1) {

代码示例来源:origin: com.sun.xml.bind/jaxb1-impl

ReferenceExp child = (ReferenceExp)itr.next();
int idx = items.lastIndexOf(child);
if(idx!=-1) {

代码示例来源:origin: com.sun.xml.bind/jaxb-extra-osgi

ReferenceExp child = (ReferenceExp)itr.next();
int idx = items.lastIndexOf(child);
if(idx!=-1) {

代码示例来源:origin: kohsuke/msv

ReferenceExp child = (ReferenceExp)itr.next();
int idx = items.lastIndexOf(child);
if(idx!=-1) {

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-core

int pos = definingParentNTs.lastIndexOf(nt);
if (pos >= 0) {
  StringBuilder buf = new StringBuilder();

代码示例来源:origin: apache/jackrabbit

int pos = definingParentNTs.lastIndexOf(nt);
if (pos >= 0) {
  StringBuilder buf = new StringBuilder();

代码示例来源:origin: apache/jackrabbit

for (int i = 0; i < childNodeNTs.length; i++) {
  Name nt = childNodeNTs[i];
  int pos = definingParentNTs.lastIndexOf(nt);
  if (pos >= 0) {
    StringBuffer buf = new StringBuffer();

相关文章