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

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

本文整理了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

  1. private boolean inNegation() {
  2. int notIndex = operatorStack.lastIndexOf(Ops.NOT);
  3. if (notIndex > -1) {
  4. int existsIndex = operatorStack.lastIndexOf(Ops.EXISTS);
  5. return notIndex > existsIndex;
  6. }
  7. return false;
  8. }

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

  1. /**
  2. * Given a prefix, this will return the namespace URI most
  3. * rencently (topmost) associated with that prefix.
  4. *
  5. * @param prefix <code>String</code> namespace prefix.
  6. * @return <code>String</code> - the namespace URI for that prefix.
  7. */
  8. public String getURI(String prefix) {
  9. int index = prefixes.lastIndexOf(prefix);
  10. if (index == -1) {
  11. return null;
  12. }
  13. String uri = (String)uris.elementAt(index);
  14. return uri;
  15. }

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

  1. /**
  2. * Given a prefix, this will return the namespace URI most rencently (topmost) associated with
  3. * that prefix.
  4. *
  5. * @param prefix <code>String</code> namespace prefix.
  6. * @return <code>String</code> - the namespace URI for that prefix.
  7. */
  8. public String getURI(String prefix) {
  9. int index=prefixes.lastIndexOf(prefix);
  10. if (index == -1) {
  11. return null;
  12. }
  13. return uris.elementAt(index);
  14. }

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

  1. /**
  2. * Returns the index of the first occurrence of the object.
  3. *
  4. * @return the index of the first occurrence of the object
  5. * @param o
  6. * the object to be searched
  7. */
  8. public synchronized int search(Object o)
  9. {
  10. int index= lastIndexOf(o);
  11. if (index >= 0)
  12. return (size() - index);
  13. return -1;
  14. }
  15. }

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

  1. /**
  2. * Given a prefix, this will return the namespace URI most
  3. * rencently (topmost) associated with that prefix.
  4. *
  5. * @param prefix <code>String</code> namespace prefix.
  6. * @return <code>String</code> - the namespace URI for that prefix.
  7. */
  8. public String getURI( String prefix )
  9. {
  10. int index = prefixes.lastIndexOf( prefix );
  11. if ( index == -1 )
  12. {
  13. return null;
  14. }
  15. String uri = (String) uris.elementAt( index );
  16. return uri;
  17. }

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

  1. /**
  2. * Returns the 1-based position where an object is on this stack.
  3. * If the object <tt>o</tt> occurs as an item in this stack, this
  4. * method returns the distance from the top of the stack of the
  5. * occurrence nearest the top of the stack; the topmost item on the
  6. * stack is considered to be at distance <tt>1</tt>. The <tt>equals</tt>
  7. * method is used to compare <tt>o</tt> to the
  8. * items in this stack.
  9. *
  10. * @param o the desired object.
  11. * @return the 1-based position from the top of the stack where
  12. * the object is located; the return value <code>-1</code>
  13. * indicates that the object is not on the stack.
  14. */
  15. public synchronized int search(Object o) {
  16. int i = lastIndexOf(o);
  17. if (i >= 0) {
  18. return size() - i;
  19. }
  20. return -1;
  21. }

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

  1. /**
  2. * Returns the 1-based position where an object is on this stack.
  3. * If the object <tt>o</tt> occurs as an item in this stack, this
  4. * method returns the distance from the top of the stack of the
  5. * occurrence nearest the top of the stack; the topmost item on the
  6. * stack is considered to be at distance <tt>1</tt>. The <tt>equals</tt>
  7. * method is used to compare <tt>o</tt> to the
  8. * items in this stack.
  9. *
  10. * @param o the desired object.
  11. * @return the 1-based position from the top of the stack where
  12. * the object is located; the return value <code>-1</code>
  13. * indicates that the object is not on the stack.
  14. */
  15. public synchronized int search(Object o) {
  16. int i = lastIndexOf(o);
  17. if (i >= 0) {
  18. return size() - i;
  19. }
  20. return -1;
  21. }

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

  1. /**
  2. * Method to retrieve the last position of the element.
  3. * @param element The element
  4. * @return The last position of this element in the List.
  5. **/
  6. public int lastIndexOf(Object element)
  7. {
  8. if (useCache)
  9. {
  10. loadFromStore();
  11. }
  12. else if (backingStore != null)
  13. {
  14. return backingStore.lastIndexOf(ownerSM, element);
  15. }
  16. return delegate.lastIndexOf(element);
  17. }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

相关文章