com.artima.place.info
Class InfoBundle

java.lang.Object
  |
  +--com.artima.place.info.InfoBundle
All Implemented Interfaces:
java.lang.Cloneable, Purgable, java.io.Serializable

public class InfoBundle
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable, Purgable

A bundle of localizable information objects.

See Also:
Serialized Form

Constructor Summary
InfoBundle(java.util.Set infoSet)
          Constructs a new InfoBundle with passed info object set.
 
Method Summary
 java.lang.Object clone()
          Clones this InfoBundle.
 boolean equals(java.lang.Object o)
          Compares this InfoBundle to the passed object for equality.
 java.util.Set getInfoSet()
          Returns a Set of info objects which provide localizable information suitable for presentation to users.
 int hashCode()
          Returns a hash code for this object.
 void purge()
          Purge away information about undesired locales.
 void purge(java.util.Locale preserveLocale)
          Purge away information about all locales except the passed desired locale.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InfoBundle

public InfoBundle(java.util.Set infoSet)
Constructs a new InfoBundle with passed info object set.

The passed Set will not be used as part of the state of this newly constructed object. Rather its contents will be used to initialize an unmodifiable Set that will be returned by getInfoSet.

Parameters:
infoSet - a Set (which may be empty) of info objects
Method Detail

getInfoSet

public java.util.Set getInfoSet()
Returns a Set of info objects which provide localizable information suitable for presentation to users.
Returns:
the info set.

purge

public void purge()
Purge away information about undesired locales. This method merely invokes purge() on each Purgable object in its info set.
Specified by:
purge in interface Purgable

purge

public void purge(java.util.Locale preserveLocale)
Purge away information about all locales except the passed desired locale. This method merely invokes purge(Locale) on each Purgable object in its info set, passing to purge(Locale) the desiredLocale passed to this method.
Specified by:
purge in interface Purgable
Parameters:
preserveLocale - a locale to preserve in this InfoBundle.

equals

public boolean equals(java.lang.Object o)
Compares this InfoBundle to the passed object for equality. To be semantically equal, the class of the passed object must be InfoBundle and the passed object's info set must be semantically to this object's info set.
Overrides:
equals in class java.lang.Object
Parameters:
An - object to compare to this InfoBundle
Returns:
true if this InfoBundle is semantically equal to the passed InfoBundle

hashCode

public int hashCode()
Returns a hash code for this object.
Overrides:
hashCode in class java.lang.Object
Returns:
the hash code

clone

public java.lang.Object clone()
Clones this InfoBundle. This method performs a shallow copy of the contained info set.
Overrides:
clone in class java.lang.Object
Returns:
a clone of this method