Java Doc for UnorderList.java in  » 6.0-JDK-Modules » java-3d » javax » media » j3d » 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 » 6.0 JDK Modules » java 3d » javax.media.j3d 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.media.j3d.UnorderList

UnorderList
class UnorderList implements Cloneable,java.io.Serializable(Code)
A strongly type unorder array list. The operation add(Object o) & remove(int i) take O(1) time. The class is designed to optimize speed. So many reductance procedures call and range check as found in ArrayList are removed.

Use the following code to iterate through an array.

 UnorderList  list = new UnorderList(YourClass.class);
 // add element here
 YourClass[] arr = (YourClass []) list.toArray();
 int size = list.arraySize();
 for (int i=0; i < size; i++) {
 YourClass obj = arr[i];
 ....
 }
 

Note:

    1) The array return is a copied of internal array.
    2) Don't use arr.length , use list.arraySize();
    3) No need to do casting for individual element as in ArrayList.
    4) UnorderList is thread safe.


Field Summary
transient  ObjectcloneData
    
transient  intcloneSize
    
 ClasscomponentType
    
transient  ObjectelementData
     The array buffer into which the elements of the ArrayList are stored.
transient  booleanisDirty
    
 intsize
     The size of the ArrayList (the number of elements it contains).

Constructor Summary
 UnorderList(int initialCapacity, Class componentType)
     Constructs an empty list with the specified initial capacity.
 UnorderList(Class componentType)
     Constructs an empty list.
 UnorderList(int initialCapacity)
     Constructs an empty list with the specified initial capacity.
 UnorderList()
     Constructs an empty list.

Method Summary
final synchronized  voidadd(Object o)
     Appends the specified element to the end of this list.
final synchronized  booleanaddUnique(Object o)
     Add Object into the list if it is not already exists.
final  intarraySize()
     Returns the size of entry use in toArray() number of elements in this list.
final synchronized  voidclear()
     Removes all of the elements from this list.
final synchronized  voidclearMirror()
    
final protected synchronized  Objectclone()
     Returns a shallow copy of this ArrayList instance.
final synchronized  booleancontains(Object o)
     Returns true if this list contains the specified element.
final synchronized  Objectget(int index)
     Returns the element at the specified position in this list.
Parameters:
  index - index of element to return.
final  ClassgetComponentType()
    
final synchronized  intindexOf(Object o)
     Searches for the last occurence of the given argument, testing for equality using the equals method.
final  booleanisEmpty()
     Tests if this list has no elements.
final synchronized  voidremove(int index)
     Removes the element at the specified position in this list.
final synchronized  booleanremove(Object o)
     Removes the specified element in this list. Replace the removed element by the last one.
Parameters:
  o - the element to removed.
final synchronized  ObjectremoveLastElement()
     Removes the element at the last position in this list.
final synchronized  voidremoveOrdered(int index)
     Removes the element at the specified position in this list.
final synchronized  voidset(int index, Object element)
     Replaces the element at the specified position in this list with the specified element.
Parameters:
  index - index of element to replace.
Parameters:
  element - element to be stored at the specified position.
final synchronized  voidshift(Object objs, int idx)
    
final  intsize()
     Returns the number of elements in this list.
final synchronized  Object[]toArray(boolean copy)
     Returns an array containing all of the elements in this list. The size of the array may longer than the actual size.
final synchronized  Object[]toArray()
     Returns an array containing all of the elements in this list. The size of the array may longer than the actual size.
final synchronized  Object[]toArray(Object startElement)
     Returns an array containing elements starting from startElement all of the elements in this list.
final synchronized  voidtoArrayAndClear(Object[] objs)
    
public synchronized  StringtoString()
    
final synchronized  voidtrimToSize()
     Trims the capacity of this ArrayList instance to be the list's current size.

Field Detail
cloneData
transient Object cloneData(Code)
Clone copy of elementData return by toArray(true);



cloneSize
transient int cloneSize(Code)



componentType
Class componentType(Code)
Component Type of individual array element entry



elementData
transient Object elementData(Code)
The array buffer into which the elements of the ArrayList are stored. The capacity of the ArrayList is the length of this array buffer. It is non-private to enable compiler do inlining for get(), set(), remove() when -O flag turn on.



isDirty
transient boolean isDirty(Code)



size
int size(Code)
The size of the ArrayList (the number of elements it contains). We make it non-private to enable compiler do inlining for getSize() when -O flag turn on.




Constructor Detail
UnorderList
UnorderList(int initialCapacity, Class componentType)(Code)
Constructs an empty list with the specified initial capacity. and the class data Type
Parameters:
  initialCapacity - the initial capacity of the list.
Parameters:
  componentType - class type of element in the list.



UnorderList
UnorderList(Class componentType)(Code)
Constructs an empty list.
Parameters:
  componentType - class type of element in the list.



UnorderList
UnorderList(int initialCapacity)(Code)
Constructs an empty list with the specified initial capacity.
Parameters:
  initialCapacity - the initial capacity of the list.



UnorderList
UnorderList()(Code)
Constructs an empty list. componentType default to Object.




Method Detail
add
final synchronized void add(Object o)(Code)
Appends the specified element to the end of this list. It is the user responsible to ensure that the element add is of the same type as array componentType.
Parameters:
  o - element to be appended to this list.



addUnique
final synchronized boolean addUnique(Object o)(Code)
Add Object into the list if it is not already exists.
Parameters:
  o - an object to add into the list true if object successfully add, false if duplicate found



arraySize
final int arraySize()(Code)
Returns the size of entry use in toArray() number of elements in this list. the number of elements in this list.



clear
final synchronized void clear()(Code)
Removes all of the elements from this list. The list will be empty after this call returns.



clearMirror
final synchronized void clearMirror()(Code)



clone
final protected synchronized Object clone()(Code)
Returns a shallow copy of this ArrayList instance. (The elements themselves are not copied.) a clone of this ArrayList instance.



contains
final synchronized boolean contains(Object o)(Code)
Returns true if this list contains the specified element.
Parameters:
  o - element whose presence in this List is to be tested.



get
final synchronized Object get(int index)(Code)
Returns the element at the specified position in this list.
Parameters:
  index - index of element to return. the element at the specified position in this list.
throws:
  IndexOutOfBoundsException - if index is out of range (index< 0 || index >= size()).



getComponentType
final Class getComponentType()(Code)



indexOf
final synchronized int indexOf(Object o)(Code)
Searches for the last occurence of the given argument, testing for equality using the equals method.
Parameters:
  o - an object. the index of the first occurrence of the argument in thislist; returns -1 if the object is not found.
See Also:   Object.equals(Object)



isEmpty
final boolean isEmpty()(Code)
Tests if this list has no elements. true if this list has no elements;false otherwise.



remove
final synchronized void remove(int index)(Code)
Removes the element at the specified position in this list. Replace the removed element by the last one.
Parameters:
  index - the index of the element to removed.
throws:
  IndexOutOfBoundsException - if index out of range (index< 0 || index >= size()).



remove
final synchronized boolean remove(Object o)(Code)
Removes the specified element in this list. Replace the removed element by the last one.
Parameters:
  o - the element to removed. true if object remove
throws:
  IndexOutOfBoundsException - if index out of range (index< 0 || index >= size()).



removeLastElement
final synchronized Object removeLastElement()(Code)
Removes the element at the last position in this list. The element remove
throws:
  IndexOutOfBoundsException - if array is empty



removeOrdered
final synchronized void removeOrdered(int index)(Code)
Removes the element at the specified position in this list. The order is keep.
Parameters:
  index - the index of the element to removed.
throws:
  IndexOutOfBoundsException - if index out of range (index< 0 || index >= size()).



set
final synchronized void set(int index, Object element)(Code)
Replaces the element at the specified position in this list with the specified element.
Parameters:
  index - index of element to replace.
Parameters:
  element - element to be stored at the specified position. the element previously at the specified position.
throws:
  IndexOutOfBoundsException - if index out of range(index < 0 || index >= size()).



shift
final synchronized void shift(Object objs, int idx)(Code)



size
final int size()(Code)
Returns the number of elements in this list. the number of elements in this list.



toArray
final synchronized Object[] toArray(boolean copy)(Code)
Returns an array containing all of the elements in this list. The size of the array may longer than the actual size. Use arraySize() to retrieve the size. The array return is a copied of internal array. if copy is true. an array containing all of the elements in this list



toArray
final synchronized Object[] toArray()(Code)
Returns an array containing all of the elements in this list. The size of the array may longer than the actual size. Use arraySize() to retrieve the size. The array return is a copied of internal array. So another thread can continue add/delete the current list. However, it should be noticed that two call to toArray() may return the same copy. an array containing all of the elements in this list



toArray
final synchronized Object[] toArray(Object startElement)(Code)
Returns an array containing elements starting from startElement all of the elements in this list. A new array of exact size is always allocated.
Parameters:
  startElement - starting element to copy an array containing elements starting fromstartElement, null if element not found.



toArrayAndClear
final synchronized void toArrayAndClear(Object[] objs)(Code)



toString
public synchronized String toString()(Code)



trimToSize
final synchronized void trimToSize()(Code)
Trims the capacity of this ArrayList instance to be the list's current size. An application can use this operation to minimize the storage of an ArrayList instance.



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.