Java Doc for ListProperties.java in  » J2EE » Jaffa » org » jaffa » 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 » J2EE » Jaffa » org.jaffa.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.util.Properties
   org.jaffa.util.ListProperties

ListProperties
public class ListProperties extends Properties (Code)
This class combines the utility of the Properties class with a List. Features are: 1) Maintains the order of properties when loading them from an InputStream and when the properties are added manually. 2) Provides a sort capability for the properties 3) Provides a 'comments' attribute for each property 4) Stores the properties in an OutputStream, maintaining the order of the properties and the comments NOTE: Even though this class extends HashTable (since Properties extends HashTable), this implementation is not synchronized !!



Constructor Summary
public  ListProperties()
     Creates an empty property list with no default values.
public  ListProperties(Properties defaults)
     Creates an empty property list with the specified defaults.

Method Summary
public  voidclear()
     Removes all mappings from this map.
public  Objectclone()
     Returns a clone of this object.
public  booleancontainsKey(Object key)
     Returns true if this map contains a mapping for the specified key. The default mappings are not searched for the key.
Parameters:
  key - key whose presence in this map is to be tested.
public  booleancontainsValue(Object value)
     Returns true if this map maps one or more keys to the specified value. The default mappings are not searched for the value.
Parameters:
  value - value whose presence in this map is to be tested.
public  Enumerationelements()
     Returns an enumeration of the values in this hashtable.
public  SetentrySet()
     Returns a set view of the mappings contained in this map.
public  booleanequals(Object o)
     Compares the specified object with this map for equality. Returns true if the given object is also a ListProperties and the two Properties represent the same mappings. The comments are not compared. The default mappings are not compared.
Parameters:
  o - object to be compared for equality with this map.
public  Objectget(Object key)
     Returns the value to which this map maps the specified key. Returns null if the map contains no mapping for this key. A return value of null does not necessarily indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key to null. The containsKey operation may be used to distinguish these two cases. The default mappings are not searched for the key.
Parameters:
  key - key whose associated value is to be returned.
public  StringgetComments(String key)
     Returns the comments for the property.
Parameters:
  key - The key used for adding the property.
public  StringgetProperty(String key)
     Searches for the property with the specified key in this property list.
public  StringgetProperty(String key, String defaultValue)
     Searches for the property with the specified key in this property list.
public  inthashCode()
     Returns the hash code value for this map.
public  booleanisEmpty()
     Returns true if this map contains no key-value mappings.
public  SetkeySet()
     Returns a set view of the keys contained in this map.
public  Enumerationkeys()
     Returns an enumeration of the keys in this hashtable.
public  voidlist(PrintStream out)
     Prints this property list out to the specified output stream.
public  voidlist(PrintWriter out)
     Prints this property list out to the specified output stream.
public  voidload(InputStream inStream)
     Reads a property list (key and element pairs) from the input stream.
public  EnumerationpropertyNames()
     Returns an enumeration of all the keys in this property list, including distinct keys in the default property list if a key of the same name has not already been found from the main properties list.
public  Objectput(Object key, Object value)
     Adds an object to the Map.
public  voidputAll(Map t)
     Copies all of the mappings from the specified map to this map.
public  Objectremove(Object key)
     Removes the mapping for this key from this map if it is present. The default mappings are not touched.
Parameters:
  key - key whose mapping is to be removed from the map.
public  voidsetComments(String key, String comments)
     Sets the comments for the property.
public  ObjectsetProperty(String key, String value, String comments)
     Adds a new property, or updates if it already exists.
Parameters:
  key - The key for the property.
Parameters:
  value - The value for the property.
Parameters:
  comments - The comment for the property.
public  ObjectsetProperty(String key, String value)
     Adds a new property, or updates if it already exists.
Parameters:
  key - The key for the property.
Parameters:
  value - The value for the property.
public  intsize()
     Returns the number of key-value mappings in this map.
public  voidsort()
     This sorts the Properties based on the keys.
public  voidstore(OutputStream out, String header)
     Writes this property list (key and element pairs) in this Properties table to the output stream. Properties from the defaults table of this Properties table (if any) are not written out by this method. After the entries have been written, the output stream is flushed.
public  StringtoString()
     Returns debug info.
public  Collectionvalues()
     Returns a collection view of the values contained in this map.


Constructor Detail
ListProperties
public ListProperties()(Code)
Creates an empty property list with no default values.



ListProperties
public ListProperties(Properties defaults)(Code)
Creates an empty property list with the specified defaults.
Parameters:
  defaults - The defaults.




Method Detail
clear
public void clear()(Code)
Removes all mappings from this map. The default mappings are not touched.



clone
public Object clone()(Code)
Returns a clone of this object. a clone of the Map.



containsKey
public boolean containsKey(Object key)(Code)
Returns true if this map contains a mapping for the specified key. The default mappings are not searched for the key.
Parameters:
  key - key whose presence in this map is to be tested. true if this map contains a mapping for the specified key.



containsValue
public boolean containsValue(Object value)(Code)
Returns true if this map maps one or more keys to the specified value. The default mappings are not searched for the value.
Parameters:
  value - value whose presence in this map is to be tested. true if this map maps one or more keys to the specified value.



elements
public Enumeration elements()(Code)
Returns an enumeration of the values in this hashtable. Use the Enumeration methods on the returned object to fetch the elements sequentially. The values from the default mappings are not part of the Enumeration. an enumeration of the values in this hashtable.



entrySet
public Set entrySet()(Code)
Returns a set view of the mappings contained in this map. The entries from the default mappings are not part of the Set. a set view of the mappings contained in this map.



equals
public boolean equals(Object o)(Code)
Compares the specified object with this map for equality. Returns true if the given object is also a ListProperties and the two Properties represent the same mappings. The comments are not compared. The default mappings are not compared.
Parameters:
  o - object to be compared for equality with this map. true if the specified object is equal to this map.



get
public Object get(Object key)(Code)
Returns the value to which this map maps the specified key. Returns null if the map contains no mapping for this key. A return value of null does not necessarily indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key to null. The containsKey operation may be used to distinguish these two cases. The default mappings are not searched for the key.
Parameters:
  key - key whose associated value is to be returned. the value to which this map maps the specified key, or null if the map contains no mapping for this key.



getComments
public String getComments(String key)(Code)
Returns the comments for the property.
Parameters:
  key - The key used for adding the property. the comments for the property.



getProperty
public String getProperty(String key)(Code)
Searches for the property with the specified key in this property list. If the key is not found in this property list, the default property list, and its defaults, recursively, are then checked. The method returns null if the property is not found.
Parameters:
  key - the property key. the value in this property list with the specified key value.



getProperty
public String getProperty(String key, String defaultValue)(Code)
Searches for the property with the specified key in this property list. If the key is not found in this property list, the default property list, and its defaults, recursively, are then checked. The method returns the default value argument if the property is not found.
Parameters:
  key - the property key.
Parameters:
  defaultValue - a default value. the value in this property list with the specified key value.



hashCode
public int hashCode()(Code)
Returns the hash code value for this map. The hashCode will not take into account the comments, if any. The default mappings do not affect the return value. the hash code value for this map.



isEmpty
public boolean isEmpty()(Code)
Returns true if this map contains no key-value mappings. The default mappings have no effect on the return value. true if this map contains no key-value mappings.



keySet
public Set keySet()(Code)
Returns a set view of the keys contained in this map. The keys from the default mappings are not part of the Set. a set view of the keys contained in this map.



keys
public Enumeration keys()(Code)
Returns an enumeration of the keys in this hashtable. The keys from the default mappings are not part of the Enumeration. an enumeration of the keys in this hashtable.



list
public void list(PrintStream out)(Code)
Prints this property list out to the specified output stream. This method is useful for debugging.
Parameters:
  out - an output stream.



list
public void list(PrintWriter out)(Code)
Prints this property list out to the specified output stream. This method is useful for debugging.
Parameters:
  out - an output stream.



load
public void load(InputStream inStream) throws IOException(Code)
Reads a property list (key and element pairs) from the input stream.
Parameters:
  inStream - the input stream
throws:
  IOException - if an error occurred when reading from the input stream.



propertyNames
public Enumeration propertyNames()(Code)
Returns an enumeration of all the keys in this property list, including distinct keys in the default property list if a key of the same name has not already been found from the main properties list. an enumeration of all the keys in this property list, including the keys in the default property list.



put
public Object put(Object key, Object value)(Code)
Adds an object to the Map. If the map previously contained a mapping for this key, the old value is replaced by the specified value. An IllegalArgumentException is thrown if either of the key and value are not Strings.
Parameters:
  key - The key used for adding the object.
Parameters:
  value - The object to be added. previous value associated with specified key, or null if there was no mapping for key. A null return can also indicate that the map previously associated null with the specified key.



putAll
public void putAll(Map t)(Code)
Copies all of the mappings from the specified map to this map. This will invoke the put() method for each entry from the specified map. An IllegalArgumentException is thrown if either of the key and value are not Strings.
Parameters:
  t - Mappings to be stored in this map.



remove
public Object remove(Object key)(Code)
Removes the mapping for this key from this map if it is present. The default mappings are not touched.
Parameters:
  key - key whose mapping is to be removed from the map. previous value associated with specified key, or null if there was no mapping for key.



setComments
public void setComments(String key, String comments)(Code)
Sets the comments for the property. Nothing will be done, in case there is no existing property for the input key.
Parameters:
  key - The key used for adding the property.
Parameters:
  comments - The comments for the property.



setProperty
public Object setProperty(String key, String value, String comments)(Code)
Adds a new property, or updates if it already exists.
Parameters:
  key - The key for the property.
Parameters:
  value - The value for the property.
Parameters:
  comments - The comment for the property. the previous value of the specified key in this property list, or null if it did not have one.



setProperty
public Object setProperty(String key, String value)(Code)
Adds a new property, or updates if it already exists.
Parameters:
  key - The key for the property.
Parameters:
  value - The value for the property. the previous value of the specified key in this property list, or null if it did not have one.



size
public int size()(Code)
Returns the number of key-value mappings in this map. The default mappings are not included in the result. the number of key-value mappings in this map.



sort
public void sort()(Code)
This sorts the Properties based on the keys.



store
public void store(OutputStream out, String header) throws IOException(Code)
Writes this property list (key and element pairs) in this Properties table to the output stream. Properties from the defaults table of this Properties table (if any) are not written out by this method. After the entries have been written, the output stream is flushed. The output stream remains open after this method returns.
Parameters:
  out - an output stream.
Parameters:
  header - a description of the property list.
throws:
  IOException - if writing this property list to the specified output stream throws an IOException.



toString
public String toString()(Code)
Returns debug info. debug info.



values
public Collection values()(Code)
Returns a collection view of the values contained in this map. The values from the default mappings are not part of the Collection. a collection view of the values contained in this map.



Fields inherited from java.util.Properties
protected Properties defaults(Code)(Java Doc)

Methods inherited from java.util.Properties
public String getProperty(String key)(Code)(Java Doc)
public String getProperty(String key, String defaultValue)(Code)(Java Doc)
public void list(PrintStream out)(Code)(Java Doc)
public void list(PrintWriter out)(Code)(Java Doc)
public synchronized void load(Reader reader) throws IOException(Code)(Java Doc)
public synchronized void load(InputStream inStream) throws IOException(Code)(Java Doc)
public synchronized void loadFromXML(InputStream in) throws IOException, InvalidPropertiesFormatException(Code)(Java Doc)
public Enumeration propertyNames()(Code)(Java Doc)
public synchronized void save(OutputStream out, String comments)(Code)(Java Doc)
public synchronized Object setProperty(String key, String value)(Code)(Java Doc)
public void store(Writer writer, String comments) throws IOException(Code)(Java Doc)
public void store(OutputStream out, String comments) throws IOException(Code)(Java Doc)
public synchronized void storeToXML(OutputStream os, String comment) throws IOException(Code)(Java Doc)
public synchronized void storeToXML(OutputStream os, String comment, String encoding) throws IOException(Code)(Java Doc)
public Set<String> stringPropertyNames()(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.