org.apache.felix.prefs
Class ChangeSet

java.lang.Object
  extended by org.apache.felix.prefs.ChangeSet

public class ChangeSet
extends java.lang.Object

This class keeps track of the changes to a preferences node.


Field Summary
protected  java.util.Set addedChildren
          A set of added children.
protected  java.util.Set changedProperties
          A set of changed/added properties.
protected  boolean hasChanges
          Do we have changes at all?
protected  java.util.Set removedChildren
          A set of removed children.
protected  java.util.Set removedProperties
          A set of removed properties.
 
Constructor Summary
ChangeSet()
           
 
Method Summary
 void childAdded(java.lang.String name)
          Inform that a child has been added.
 void childRemoved(java.lang.String name)
          Inform that a child has been removed.
 void clear()
          Reset state to unchanged.
 java.util.Collection getAddedChildren()
          Return a collection with the added children names.
 java.util.Collection getChangedProperties()
          Return a collection with the changed property names.
 java.util.Collection getRemovedChildren()
          Return a collection with the removed children names.
 java.util.Collection getRemovedProperties()
          Return a collection with the removed property names.
 boolean hasChanges()
          Do we have changes?
 void importChanges(ChangeSet other)
          Import the changes from the other change set.
 void propertyChanged(java.lang.String name)
          Inform that a property has been added/changed.
 void propertyRemoved(java.lang.String name)
          Inform that a property has removed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hasChanges

protected boolean hasChanges
Do we have changes at all?


changedProperties

protected final java.util.Set changedProperties
A set of changed/added properties.


removedProperties

protected final java.util.Set removedProperties
A set of removed properties.


addedChildren

protected final java.util.Set addedChildren
A set of added children.


removedChildren

protected final java.util.Set removedChildren
A set of removed children.

Constructor Detail

ChangeSet

public ChangeSet()
Method Detail

hasChanges

public boolean hasChanges()
Do we have changes?

Returns:
True if there are any changes.

propertyChanged

public void propertyChanged(java.lang.String name)
Inform that a property has been added/changed.

Parameters:
name - The name of the property.

propertyRemoved

public void propertyRemoved(java.lang.String name)
Inform that a property has removed.

Parameters:
name - The name of the property.

childAdded

public void childAdded(java.lang.String name)
Inform that a child has been added.

Parameters:
name - The name of the child.

childRemoved

public void childRemoved(java.lang.String name)
Inform that a child has been removed.

Parameters:
name - The name of the child.

clear

public void clear()
Reset state to unchanged.


importChanges

public void importChanges(ChangeSet other)
Import the changes from the other change set.

Parameters:
other -

getChangedProperties

public java.util.Collection getChangedProperties()
Return a collection with the changed property names.

Returns:
A collection.

getRemovedProperties

public java.util.Collection getRemovedProperties()
Return a collection with the removed property names.

Returns:
A collection.

getAddedChildren

public java.util.Collection getAddedChildren()
Return a collection with the added children names.

Returns:
A collection.

getRemovedChildren

public java.util.Collection getRemovedChildren()
Return a collection with the removed children names.

Returns:
A collection.