org.xins.common.collections
Class AbstractPropertyReader

java.lang.Object
  extended byorg.xins.common.collections.AbstractPropertyReader
All Implemented Interfaces:
PropertyReader, Serializable
Direct Known Subclasses:
BasicPropertyReader, PropertiesPropertyReader, ProtectedPropertyReader, ServletRequestPropertyReader

public abstract class AbstractPropertyReader
extends Object
implements PropertyReader

Base for PropertyReader implementations that use an underlying Map instance.

Since:
XINS 1.0.0
Version:
$Revision: 1.28 $ $Date: 2008/07/04 10:22:50 $
Author:
Ernst de Haan, Anthony Goubard
See Also:
Serialized Form

Constructor Summary
protected AbstractPropertyReader(Map map)
          Constructs a new AbstractPropertyReader.
 
Method Summary
 boolean equals(Object obj)
          Compares this object with the specified argument for equality.
 String get(String name)
          Gets the value of the property with the specified name.
 Iterator getNames()
          Gets an iterator that iterates over all the property names.
protected  Map getPropertiesMap()
          Returns the Map that contains the properties.
 int hashCode()
          Returns a hash code value for this object.
 int size()
          Returns the number of entries.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPropertyReader

protected AbstractPropertyReader(Map map)
                          throws IllegalArgumentException
Constructs a new AbstractPropertyReader.

Parameters:
map - the map containing the data of this PropertyReader, cannot be null.
Throws:
IllegalArgumentException - if map == null.
Since:
XINS 1.4.0
Method Detail

get

public String get(String name)
           throws IllegalArgumentException
Gets the value of the property with the specified name.

Specified by:
get in interface PropertyReader
Parameters:
name - the name of the property, cannot be null.
Returns:
the value of the property, or null if it is not set.
Throws:
IllegalArgumentException - if name == null.

getNames

public Iterator getNames()
Gets an iterator that iterates over all the property names. The Iterator will return only String instances.

Specified by:
getNames in interface PropertyReader
Returns:
the Iterator that will iterate over all the names, never null.

size

public int size()
Returns the number of entries.

Specified by:
size in interface PropertyReader
Returns:
the size, always >= 0.

getPropertiesMap

protected Map getPropertiesMap()
Returns the Map that contains the properties.

Returns:
the Map used to store the properties in, cannot be null.
Since:
XINS 1.4.0

equals

public boolean equals(Object obj)
Compares this object with the specified argument for equality.

Parameters:
obj - the object to compare with, can be null.
Returns:
true if the objects a and b are considered to be equal, false if they are considered different.

hashCode

public int hashCode()
Returns a hash code value for this object.

Returns:
a hash code value for this object.


See http://www.xins.org/.