org.apache.felix.prefs
Class ChangeSet

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

public class ChangeSet
extends Object

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


Field Summary
protected  Set addedChildren
          A set of added children.
protected  Set changedProperties
          A set of changed/added properties.
protected  boolean hasChanges
          Do we have changes at all?
protected  Set removedChildren
          A set of removed children.
protected  Set removedProperties
          A set of removed properties.
 
Constructor Summary
ChangeSet()
           
 
Method Summary
 void childAdded(String name)
          Inform that a child has been added.
 void childRemoved(String name)
          Inform that a child has been removed.
 void clear()
          Reset state to unchanged.
 Collection getAddedChildren()
          Return a collection with the added children names.
 Collection getChangedProperties()
          Return a collection with the changed property names.
 Collection getRemovedChildren()
          Return a collection with the removed children names.
 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(String name)
          Inform that a property has been added/changed.
 void propertyRemoved(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 Set changedProperties
A set of changed/added properties.


removedProperties

protected final Set removedProperties
A set of removed properties.


addedChildren

protected final Set addedChildren
A set of added children.


removedChildren

protected final 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(String name)
Inform that a property has been added/changed.

Parameters:
name - The name of the property.

propertyRemoved

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

Parameters:
name - The name of the property.

childAdded

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

Parameters:
name - The name of the child.

childRemoved

public void childRemoved(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 Collection getChangedProperties()
Return a collection with the changed property names.

Returns:
A collection.

getRemovedProperties

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

Returns:
A collection.

getAddedChildren

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

Returns:
A collection.

getRemovedChildren

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

Returns:
A collection.


Copyright © 2011 Apache Software Foundation. All Rights Reserved.