org.xins.common.collections
Class StatsPropertyReader

java.lang.Object
  extended byorg.xins.common.collections.StatsPropertyReader
All Implemented Interfaces:
PropertyReader, Serializable

public final class StatsPropertyReader
extends Object
implements PropertyReader

Immutable property reader that remembers which properties have not been accessed.

Since:
XINS 1.3.0
Version:
$Revision: 1.13 $ $Date: 2008/07/04 10:22:49 $
Author:
Ernst de Haan
See Also:
Serialized Form

Constructor Summary
StatsPropertyReader(PropertyReader source)
          Constructs a new StatsPropertyReader based on the specified PropertyReader.
 
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.
 PropertyReader getUnused()
          Retrieves the set of unused 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

StatsPropertyReader

public StatsPropertyReader(PropertyReader source)
                    throws IllegalArgumentException
Constructs a new StatsPropertyReader based on the specified PropertyReader. The properties in source are copied to an internal store.

Parameters:
source - the source property reader, cannot be null.
Throws:
IllegalArgumentException - if source == null.
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.

getUnused

public PropertyReader getUnused()
Retrieves the set of unused properties.

Returns:
a PropertyReader containing which were not queried, never null.

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/.