Java Doc for ArrayDictionary.java in  » Web-Server » Jigsaw » org » w3c » 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 » Web Server » Jigsaw » org.w3c.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.util.Dictionary
      org.w3c.util.ArrayDictionary

ArrayDictionary
public class ArrayDictionary extends Dictionary implements Cloneable(Code)
Random-access dictionary: like a dictionary but with a certain Vector-ness to it Besides all the methods from Dictionary, it also has methods that permit direct access to the nth element or nth key. Should be used with care...it's not too well tested yet, and it is very exposed.

This class does not provide thread-safeness, for the sake of efficiency, again it should be used with care !
author:
   Antonio Ramírez



Field Summary
protected  intincr
    
protected  Object[]keys
    
protected  intnelems
    
protected  Object[]values
    

Constructor Summary
public  ArrayDictionary()
     Create an ArrayDictionary using default values for initial size and increment.
public  ArrayDictionary(int init)
     Create an ArrayDictionary using the given initial size.
public  ArrayDictionary(int init, int incr)
     Create an ArrayDictionary using the given initial size and the given increment for growing the array.
public  ArrayDictionary(Vector keys, Vector values)
     Create an ArrayDictionary, contructing the arrays of keys and values from the two given vectors.
public  ArrayDictionary(Vector keys, Vector values, int incr)
     Create an ArrayDictionary, contructing the arrays of keys and values from the two given vectors.
public  ArrayDictionary(Object[] keys, Object[] values)
     Create an ArrayDicitonary, using (not copying) the given pair of arrays as keys and values.
public  ArrayDictionary(Object[] keys, Object[] values, int incr)
     Create an ArrayDicitonary, using (not copying) the given pair of arrays as keys and values.

Method Summary
final public  intcapacity()
     Returns the maximum number of keys the dictionary can hold without reallocating an array.
public  Objectclone()
     Clone this array dictionary.
final public  ObjectelementAt(int n)
     Returns the nth element (value).
public  Enumerationelements()
     Returns an enumeration of the elements of the dictionary.
final public  voidensureCapacity(int minCapacity)
     Increases the capacity of this dictionary to at least the specified number of key/value mappings.
public  Objectget(Object key)
     Returns the value that maps to the given key.
public  Object[]getMany(Object[] rKeys)
     "Optimized" method to obtain the values corresponding to several keys, in one swoop.
final protected  voidgrow()
    
protected  voidgrow(int newCapacity)
    
final public  booleanisEmpty()
    
final public  ObjectkeyAt(int n)
     Returns the nth key.
public  Enumerationkeys()
     Returns an enumeration of the keys of the dictionary.
public static  voidmain(String[] args)
    
public  Objectput(Object key, Object value)
     Adds a mapping between a key and a value to the dictionary.
public  Objectremove(Object key)
    
public  ObjectremoveElementAt(int n)
     Removes the nth mapping (key/value pair) in the dictionary.
public  ObjectsetElementAt(int n, Object newVal)
     Sets the element at the nth place in the array.
final public  intsize()
    
public  StringtoString()
    

Field Detail
incr
protected int incr(Code)
By how much to grow



keys
protected Object[] keys(Code)
The array of keys



nelems
protected int nelems(Code)
How many real elements are in



values
protected Object[] values(Code)
The array of corresponding values




Constructor Detail
ArrayDictionary
public ArrayDictionary()(Code)
Create an ArrayDictionary using default values for initial size and increment.



ArrayDictionary
public ArrayDictionary(int init)(Code)
Create an ArrayDictionary using the given initial size. (The increment is set to the same value).
Parameters:
  init - The initial size



ArrayDictionary
public ArrayDictionary(int init, int incr)(Code)
Create an ArrayDictionary using the given initial size and the given increment for growing the array.
Parameters:
  init - the initial size
Parameters:
  incr - the increment



ArrayDictionary
public ArrayDictionary(Vector keys, Vector values)(Code)
Create an ArrayDictionary, contructing the arrays of keys and values from the two given vectors. The two vectors should have the same size. The increment is set to the number of elements.
Parameters:
  keys - the vector of keys
Parameters:
  values - the vector of values



ArrayDictionary
public ArrayDictionary(Vector keys, Vector values, int incr)(Code)
Create an ArrayDictionary, contructing the arrays of keys and values from the two given vectors. The two vectors should have the same size.
Parameters:
  keys - the vector of keys
Parameters:
  values - the vector of values
Parameters:
  incr - the increment for growing the arrays



ArrayDictionary
public ArrayDictionary(Object[] keys, Object[] values)(Code)
Create an ArrayDicitonary, using (not copying) the given pair of arrays as keys and values. The increment is set to the length of the arrays.
Parameters:
  keys - the array of keys
Parameters:
  values - the array of values



ArrayDictionary
public ArrayDictionary(Object[] keys, Object[] values, int incr)(Code)
Create an ArrayDicitonary, using (not copying) the given pair of arrays as keys and values.
Parameters:
  keys - the array of keys
Parameters:
  values - the array of values
Parameters:
  incr - the increment for growing the arrays




Method Detail
capacity
final public int capacity()(Code)
Returns the maximum number of keys the dictionary can hold without reallocating an array. the capacity of the dictionary



clone
public Object clone()(Code)
Clone this array dictionary.

As for hashtables, a shallow copy is made, the keys and elements themselves are not cloned. The clone.




elementAt
final public Object elementAt(int n)(Code)
Returns the nth element (value).
Parameters:
  n - the index of the desired element the nth element, or null if no element in that place.



elements
public Enumeration elements()(Code)
Returns an enumeration of the elements of the dictionary. the enumeration



ensureCapacity
final public void ensureCapacity(int minCapacity)(Code)
Increases the capacity of this dictionary to at least the specified number of key/value mappings.
Parameters:
  minCapacity - the desired minimum capacity



get
public Object get(Object key)(Code)
Returns the value that maps to the given key.
Parameters:
  key - the key the value



getMany
public Object[] getMany(Object[] rKeys)(Code)
"Optimized" method to obtain the values corresponding to several keys, in one swoop.
Parameters:
  rKeys - An array of requested keys An array of corresponding values



grow
final protected void grow()(Code)



grow
protected void grow(int newCapacity)(Code)



isEmpty
final public boolean isEmpty()(Code)
Are there any entries in the dictionary? true if there are no entries,false> otherwise.



keyAt
final public Object keyAt(int n)(Code)
Returns the nth key.
Parameters:
  n - the index of the desired key the nth key, or null if no key in that place.



keys
public Enumeration keys()(Code)
Returns an enumeration of the keys of the dictionary. the enumeration



main
public static void main(String[] args)(Code)
A kludge for testing ArrayDictionary



put
public Object put(Object key, Object value)(Code)
Adds a mapping between a key and a value to the dictionary. Will grow the arrays if necessary.
Parameters:
  key - the key
Parameters:
  value - the corresponding value the previous value corresponding to the key, or null ifthe key is new.



remove
public Object remove(Object key)(Code)
Removes a key (and its value) from the dictionary;
Parameters:
  key - the key to remove the value that used to map to that key



removeElementAt
public Object removeElementAt(int n)(Code)
Removes the nth mapping (key/value pair) in the dictionary.
Parameters:
  n - the index of the element to remove the old value of the element at the nth place



setElementAt
public Object setElementAt(int n, Object newVal)(Code)
Sets the element at the nth place in the array.
Parameters:
  n - the index of the element to change
Parameters:
  newVal - the value to change it to the old value



size
final public int size()(Code)
Returns the number of elements in the dictionary the number of elements



toString
public String toString()(Code)
Creates a string representation of the dictionary the string representation.



Methods inherited from java.util.Dictionary
abstract public Enumeration<V> elements()(Code)(Java Doc)
abstract public V get(Object key)(Code)(Java Doc)
abstract public boolean isEmpty()(Code)(Java Doc)
abstract public Enumeration<K> keys()(Code)(Java Doc)
abstract public V put(K key, V value)(Code)(Java Doc)
abstract public V remove(Object key)(Code)(Java Doc)
abstract public int size()(Code)(Java Doc)

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.