public class NodeHashMapImpl extends Object implements NodeHashMap
Constructor and Description |
---|
NodeHashMapImpl(DigestCalculator digestCalculator) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear all the items stored inside this map.
|
Set<Map.Entry<String,DataNode>> |
entrySet()
Return all the entries inside this map.
|
DataNode |
get(String path)
Return the data node associated with the path.
|
long |
getDigest()
Return the digest value.
|
void |
postChange(String path,
DataNode node)
Called after making the changes on the node, which will update
the digest.
|
void |
preChange(String path,
DataNode node)
Called before we made the change on the node, which will clear
the digest associated with it.
|
DataNode |
put(String path,
DataNode node)
Add the node into the map and update the digest with the new node.
|
DataNode |
putWithoutDigest(String path,
DataNode node)
Add the node into the map without update the digest.
|
DataNode |
remove(String path)
Remove the path from the internal nodes map.
|
int |
size()
Return the size of the nodes stored in this map.
|
public NodeHashMapImpl(DigestCalculator digestCalculator)
public DataNode put(String path, DataNode node)
NodeHashMap
put
in interface NodeHashMap
path
- the path of the nodenode
- the actual node associated with this pathpublic DataNode putWithoutDigest(String path, DataNode node)
NodeHashMap
putWithoutDigest
in interface NodeHashMap
path
- the path of the nodenode
- the actual node associated with this pathpublic DataNode get(String path)
NodeHashMap
get
in interface NodeHashMap
path
- the path to read frompublic DataNode remove(String path)
NodeHashMap
remove
in interface NodeHashMap
path
- the path to removepublic Set<Map.Entry<String,DataNode>> entrySet()
NodeHashMap
entrySet
in interface NodeHashMap
public void clear()
NodeHashMap
clear
in interface NodeHashMap
public int size()
NodeHashMap
size
in interface NodeHashMap
public void preChange(String path, DataNode node)
NodeHashMap
preChange
in interface NodeHashMap
path
- the path being changednode
- the node associated with the pathpublic void postChange(String path, DataNode node)
NodeHashMap
postChange
in interface NodeHashMap
path
- the path being changednode
- the node associated with the pathpublic long getDigest()
NodeHashMap
getDigest
in interface NodeHashMap
Copyright © 2008–2020 The Apache Software Foundation. All rights reserved.