Java Doc for FIFOQueue.java in  » Search-Engine » BDDBot » bdd » util » 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 » Search Engine » BDDBot » bdd.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   bdd.util.FIFOQueue

FIFOQueue
public class FIFOQueue implements java.util.Enumeration(Code)
Written by Tim Macinta 1997
Distributed under the GNU Public License (a copy of which is enclosed with the source).

This class provides a simple First In First Out Queue. Please Note: this implementation of a FIFOQueue is not thread safe so if you plan on accessing the same queue with multiple threads you wil need to handle synchronization yourself (e.g., by creating a synchronized subclass).


Field Summary
 intgrow_size
    
 intinsert_point
    
 Object[]q
    
 intread_point
    

Constructor Summary
public  FIFOQueue()
    
public  FIFOQueue(int initial_cap, int grow_size)
     "initial_cap" specifies the initial capacity of the queue and "grow_size" specifies the amount that the capacity grows by when capacity is reached.

Method Summary
public  voidaddElement(Object object)
     Adds "object" to the queue.
public  intcountElements()
     Returns the number of elements in this queue.
 voidgrow()
     Enlarges the queue capacity by "grow_size".
public  booleanhasMoreElements()
     Returns true if this queue contains more elements and false otherwise.
public  voidinsertElementAt(Object element, int index)
    
public  ObjectnextElement()
     Removes the next element from the queue and returns it.
public  ObjectreadElementAt(int index)
     Returns the element at index number "index" (index number 0 is the first element that is read with the nextElement() method).
public  ObjectreadNextElement()
     Returns the next element that on the queue, but leaves the element on the queue so that the next call to nextElement() or readNextElement() will return the same element.
public  voidsetCapacity(int new_capacity)
     Conserves memory by shrinking the capacity of the queue to "new_capacity".
 voidshift()
     Shifts all elements so that "read_point" is set to 0.
public  voidshrinkCapacityToSize()
     Sets the capacity to the number of elements in the queue.

Field Detail
grow_size
int grow_size(Code)



insert_point
int insert_point(Code)



q
Object[] q(Code)



read_point
int read_point(Code)




Constructor Detail
FIFOQueue
public FIFOQueue()(Code)



FIFOQueue
public FIFOQueue(int initial_cap, int grow_size)(Code)
"initial_cap" specifies the initial capacity of the queue and "grow_size" specifies the amount that the capacity grows by when capacity is reached. Both parameters must be positive.




Method Detail
addElement
public void addElement(Object object)(Code)
Adds "object" to the queue. "object" CAN be null.



countElements
public int countElements()(Code)
Returns the number of elements in this queue.



grow
void grow()(Code)
Enlarges the queue capacity by "grow_size".



hasMoreElements
public boolean hasMoreElements()(Code)
Returns true if this queue contains more elements and false otherwise.



insertElementAt
public void insertElementAt(Object element, int index)(Code)
Insert "element" in the queue at index number "index."



nextElement
public Object nextElement()(Code)
Removes the next element from the queue and returns it.

Throws a java.util.NoSuchElementException if the queue is empty.




readElementAt
public Object readElementAt(int index)(Code)
Returns the element at index number "index" (index number 0 is the first element that is read with the nextElement() method).



readNextElement
public Object readNextElement()(Code)
Returns the next element that on the queue, but leaves the element on the queue so that the next call to nextElement() or readNextElement() will return the same element.

Throws a java.util.NoSuchElementException if the queue is empty.




setCapacity
public void setCapacity(int new_capacity)(Code)
Conserves memory by shrinking the capacity of the queue to "new_capacity". Of course, you can also use this method to manually grow the size of the queue, but this is unecessary. "new_capacity" should be greater than or equal to the number of elements in the queue - if it is less than the number of elements in the queue, the capacity will be set to the number of elements in the queue.



shift
void shift()(Code)
Shifts all elements so that "read_point" is set to 0.



shrinkCapacityToSize
public void shrinkCapacityToSize()(Code)
Sets the capacity to the number of elements in the queue. Equivalent to setCapacity(countElements()) .



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.