xades4j.utils
Class PropertiesSet<T>

java.lang.Object
  extended by xades4j.utils.PropertiesSet<T>

public class PropertiesSet<T>
extends Object

A generic bag of properties used to store properties that apply to a specific target (data object descriptions, signature properties collector, signed data objects). The properties are organized by type (class).

Author:
Luís

Constructor Summary
PropertiesSet(int initialNPropTypes)
          Initializes the property bag with the given initial diferent property types.
 
Method Summary
 void add(T prop)
          Adds a property to the bag.
 Collection<T> getProperties()
          Gets the properties in the bag.
 boolean isEmpty()
          Indicates whether the bag has any properties.
 void put(T prop)
          Puts a property in the bag.
 void remove(T prop)
          Removes a property from the bag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesSet

public PropertiesSet(int initialNPropTypes)
Initializes the property bag with the given initial diferent property types.

Parameters:
initialNPropTypes - the initial number of different property types.
Method Detail

put

public void put(T prop)
Puts a property in the bag. The put operation doesn't allow repeated property types. If a property of this type was previously added an exception is thrown.

Parameters:
prop - the property
Throws:
NullPointerException - if prop is null
PropertyTargetException - if a property of this type was previously added

add

public void add(T prop)
Adds a property to the bag. The add operation allows multiple properties of the same type but not repeated instances.

Parameters:
prop - the property
Throws:
NullPointerException - if prop is null
PropertyTargetException - if the given property (instance) is already present in the bag

remove

public void remove(T prop)
Removes a property from the bag.

Parameters:
prop - the property to be removed
Throws:
NullPointerException - if the property is null
IllegalStateException - if the property is not present

isEmpty

public boolean isEmpty()
Indicates whether the bag has any properties.

Returns:
true if the bag has no properties

getProperties

public Collection<T> getProperties()
Gets the properties in the bag.

Returns:
un unmodifiable collection of properties


Copyright © 2012. All Rights Reserved.