Class PropertyMapManager
- java.lang.Object
-
- net.infonode.properties.propertymap.PropertyMapManager
-
public class PropertyMapManager extends java.lang.Object
Utility class for performing multiple modifications toPropertyMap
's and merging change notifications to optimize performance.
-
-
Constructor Summary
Constructors Constructor Description PropertyMapManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beginBatch()
Begins a batch operation.void
endBatch()
Ends a batch operation.static PropertyMapManager
getInstance()
Returns the only instance of this class.static void
runBatch(java.lang.Runnable runnable)
Executes a method inside abeginBatch()
-endBatch()
pair.
-
-
-
Method Detail
-
getInstance
public static PropertyMapManager getInstance()
Returns the only instance of this class.- Returns:
- the only instance of this class
-
runBatch
public static void runBatch(java.lang.Runnable runnable)
Executes a method inside abeginBatch()
-endBatch()
pair. SeebeginBatch()
for more information. It's safe to call other batch methods from insideRunnable.run()
.- Parameters:
runnable
- the runnable to invoke
-
beginBatch
public void beginBatch()
Begins a batch operation. This stores and merges all change notifications occuring in all property maps untilendBatch()
is called. Each call to this method MUST be followed by a call toendBatch()
. This method can be called an unlimited number of times without callingendBatch()
in between, but each call must have a corresponding call toendBatch()
. Only when exiting from the outermostendBatch()
the changes be propagated to the listeners.
-
endBatch
public void endBatch()
Ends a batch operation. SeebeginBatch()
for more information.
-
-