Java Doc for ArrayStack.java in  » Library » Apache-common-Collections » org » apache » commons » collections » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Library » Apache common Collections » org.apache.commons.collections 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.util.ArrayList
   org.apache.commons.collections.ArrayStack

ArrayStack
public class ArrayStack extends ArrayList implements Buffer(Code)
An implementation of the java.util.Stack API that is based on an ArrayList instead of a Vector, so it is not synchronized to protect against multi-threaded access. The implementation is therefore operates faster in environments where you do not need to worry about multiple thread contention.

The removal order of an ArrayStack is based on insertion order: The most recently added element is removed first. The iteration order is not the same as the removal order. The iterator returns elements from the bottom up, whereas the ArrayStack.remove() method removes them from the top down.

Unlike Stack, ArrayStack accepts null entries.
See Also:   java.util.Stack
since:
   Commons Collections 1.0
version:
   $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $
author:
   Craig R. McClanahan
author:
   Paul Jack
author:
   Stephen Colebourne




Constructor Summary
public  ArrayStack()
     Constructs a new empty ArrayStack.
public  ArrayStack(int initialSize)
     Constructs a new empty ArrayStack with an initial size.

Method Summary
public  booleanempty()
     Return true if this stack is currently empty.
public  Objectget()
     Returns the element on the top of the stack.
public  Objectpeek()
     Returns the top item off of this stack without removing it.
public  Objectpeek(int n)
     Returns the n'th item down (zero-relative) from the top of this stack without removing it.
public  Objectpop()
     Pops the top item off of this stack and return it.
public  Objectpush(Object item)
     Pushes a new item onto the top of this stack.
public  Objectremove()
     Removes the element on the top of the stack.
public  intsearch(Object object)
     Returns the one-based position of the distance from the top that the specified object exists on this stack, where the top-most element is considered to be at distance 1.


Constructor Detail
ArrayStack
public ArrayStack()(Code)
Constructs a new empty ArrayStack. The initial size is controlled by ArrayList and is currently 10.



ArrayStack
public ArrayStack(int initialSize)(Code)
Constructs a new empty ArrayStack with an initial size.
Parameters:
  initialSize - the initial size to use
throws:
  IllegalArgumentException - if the specified initial sizeis negative




Method Detail
empty
public boolean empty()(Code)
Return true if this stack is currently empty.

This method exists for compatibility with java.util.Stack. New users of this class should use isEmpty instead. true if the stack is currently empty




get
public Object get()(Code)
Returns the element on the top of the stack. the element on the top of the stack
throws:
  BufferUnderflowException - if the stack is empty



peek
public Object peek() throws EmptyStackException(Code)
Returns the top item off of this stack without removing it. the top item on the stack
throws:
  EmptyStackException - if the stack is empty



peek
public Object peek(int n) throws EmptyStackException(Code)
Returns the n'th item down (zero-relative) from the top of this stack without removing it.
Parameters:
  n - the number of items down to go the n'th item on the stack, zero relative
throws:
  EmptyStackException - if there are not enough items on thestack to satisfy this request



pop
public Object pop() throws EmptyStackException(Code)
Pops the top item off of this stack and return it. the top item on the stack
throws:
  EmptyStackException - if the stack is empty



push
public Object push(Object item)(Code)
Pushes a new item onto the top of this stack. The pushed item is also returned. This is equivalent to calling add.
Parameters:
  item - the item to be added the item just pushed



remove
public Object remove()(Code)
Removes the element on the top of the stack. the removed element
throws:
  BufferUnderflowException - if the stack is empty



search
public int search(Object object)(Code)
Returns the one-based position of the distance from the top that the specified object exists on this stack, where the top-most element is considered to be at distance 1. If the object is not present on the stack, return -1 instead. The equals() method is used to compare to the items in this stack.
Parameters:
  object - the object to be searched for the 1-based depth into the stack of the object, or -1 if not found



Methods inherited from java.util.ArrayList
public boolean add(E e)(Code)(Java Doc)
public void add(int index, E element)(Code)(Java Doc)
public boolean addAll(Collection<? extends E> c)(Code)(Java Doc)
public boolean addAll(int index, Collection<? extends E> c)(Code)(Java Doc)
public void clear()(Code)(Java Doc)
public Object clone()(Code)(Java Doc)
public boolean contains(Object o)(Code)(Java Doc)
public void ensureCapacity(int minCapacity)(Code)(Java Doc)
public E get(int index)(Code)(Java Doc)
public int indexOf(Object o)(Code)(Java Doc)
public boolean isEmpty()(Code)(Java Doc)
public Iterator<E> iterator()(Code)(Java Doc)
public int lastIndexOf(Object o)(Code)(Java Doc)
public ListIterator<E> listIterator(int index)(Code)(Java Doc)
public ListIterator<E> listIterator()(Code)(Java Doc)
public E remove(int index)(Code)(Java Doc)
public boolean remove(Object o)(Code)(Java Doc)
public boolean removeAll(Collection c)(Code)(Java Doc)
protected void removeRange(int fromIndex, int toIndex)(Code)(Java Doc)
public boolean retainAll(Collection c)(Code)(Java Doc)
public E set(int index, E element)(Code)(Java Doc)
public int size()(Code)(Java Doc)
public List<E> subList(int fromIndex, int toIndex)(Code)(Java Doc)
public Object[] toArray()(Code)(Java Doc)
public T[] toArray(T[] a)(Code)(Java Doc)
public void trimToSize()(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.