예제 #1
0
  /**
   * Loads a Nodelist from file.
   *
   * @param fileLocation Location of the file in String format.
   * @return True if successful, false otherwise.
   */
  public boolean loadNodeList(String fileLocation) {
    Object loadedFile = fileManager.loadXMLFile(NodeList.class, fileLocation);

    if (loadedFile != null) {
      try {
        nodeManager.setNodeList((NodeList) loadedFile);
      } catch (ClassCastException e) {
        return false;
      }
      return true;
    } else {
      return false;
    }
  }
예제 #2
0
 /**
  * Saves a node to file.
  *
  * @param fileLocation Location in String format.
  * @return True if successful, false otherwise.
  */
 public boolean saveNodeList(String fileLocation) {
   return fileManager.saveXMLFile(nodeManager.getNodeList(), fileLocation);
 }