/** * Checks whether a given node exists in the tree * @param fqn The fully qualified name of the node * @return boolean Whether or not the node exists */ public boolean exists(String fqn) { return fqn != null && findNode(fqn) != null; }
/** * Returns the data hashmap for a given node. This method can only be used by callers that are inside * the same package. The reason is that callers must not modify the return value, as these modifications * would not be replicated, thus rendering the replicas inconsistent. * @param fqn The fully qualified name of the node * @return HashMap The data hashmap for the given node */ Map<String,Object> get(String fqn) { Node n=findNode(fqn); if(n == null) return null; return n.getData(); }
/** * Prints a representation of the node defined by {@code fqn}. Output includes name, fqn and * data. */ public String print(String fqn) { Node n=findNode(fqn); if(n == null) return null; return n.toString(); }
public void _remove(String fqn, String key) { Node n; if(fqn == null || key == null) return; n=findNode(fqn); if(n != null) n.removeData(key); }
/** * Finds a node given its name and returns the value associated with a given key in its {@code data} * map. Returns null if the node was not found in the tree or the key was not found in the hashmap. * @param fqn The fully qualified name of the node. * @param key The key. */ public Object get(String fqn, String key) { Node n=findNode(fqn); if(n == null) return null; return n.getData(key); }
public void _removeData(String fqn) { Node n; if(fqn == null) return; n=findNode(fqn); if(n != null) n.removeData(); }
/** * Gets the keys of the {@code data} map. Returns all keys as Strings. Returns null if node * does not exist. * @param fqn The fully qualified name of the node * @return Set A set of keys (as Strings) */ public Set getKeys(String fqn) { Node n=findNode(fqn); Map data; if(n == null) return null; data=n.getData(); if(data == null) return null; return data.keySet(); }
/** * Returns all children of a given node * @param fqn The fully qualified name of the node * @return Set A list of child names (as Strings) */ public Set getChildrenNames(String fqn) { Node n=findNode(fqn); Map m; if(n == null) return null; m=n.getChildren(); if(m != null) return m.keySet(); else return null; }
/** * Checks whether a given node exists in the tree * @param fqn The fully qualified name of the node * @return boolean Whether or not the node exists */ public boolean exists(String fqn) { if(fqn == null) return false; return findNode(fqn) != null; }
/** * Checks whether a given node exists in the tree * @param fqn The fully qualified name of the node * @return boolean Whether or not the node exists */ public boolean exists(String fqn) { return fqn != null && findNode(fqn) != null; }
/** * Prints a representation of the node defined by {@code fqn}. Output includes name, fqn and * data. */ public String print(String fqn) { Node n=findNode(fqn); if(n == null) return null; return n.toString(); }
public void _removeData(String fqn) { Node n; if(fqn == null) return; n=findNode(fqn); if(n != null) n.removeData(); }
public void _removeData(String fqn) { Node n; if(fqn == null) return; n=findNode(fqn); if(n != null) n.removeData(); }
/** * Returns the data hashmap for a given node. This method can only be used by callers that are inside * the same package. The reason is that callers must not modify the return value, as these modifications * would not be replicated, thus rendering the replicas inconsistent. * @param fqn The fully qualified name of the node * @return HashMap The data hashmap for the given node */ Map<String,Object> get(String fqn) { Node n=findNode(fqn); if(n == null) return null; return n.getData(); }
public void _remove(String fqn, String key) { Node n; if(fqn == null || key == null) return; n=findNode(fqn); if(n != null) n.removeData(key); }
/** * Returns the data hashmap for a given node. This method can only be used by callers that are inside * the same package. The reason is that callers must not modify the return value, as these modifications * would not be replicated, thus rendering the replicas inconsistent. * @param fqn The fully qualified name of the node * @return HashMap The data hashmap for the given node */ HashMap get(String fqn) { Node n=findNode(fqn); if(n == null) return null; return n.getData(); }
public void _remove(String fqn, String key) { Node n; if(fqn == null || key == null) return; n=findNode(fqn); if(n != null) n.removeData(key); }
/** * Finds a node given its name and returns the value associated with a given key in its <code>data</code> * map. Returns null if the node was not found in the tree or the key was not found in the hashmap. * @param fqn The fully qualified name of the node. * @param key The key. */ public Object get(String fqn, String key) { Node n=findNode(fqn); if(n == null) return null; return n.getData(key); }
/** * Prints a representation of the node defined by <code>fqn</code>. Output includes name, fqn and * data. */ public String print(String fqn) { Node n=findNode(fqn); if(n == null) return null; return n.toString(); }
/** * Finds a node given its name and returns the value associated with a given key in its {@code data} * map. Returns null if the node was not found in the tree or the key was not found in the hashmap. * @param fqn The fully qualified name of the node. * @param key The key. */ public Object get(String fqn, String key) { Node n=findNode(fqn); if(n == null) return null; return n.getData(key); }