SHARE
TWEET

Untitled

a guest Aug 31st, 2019 98 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package core.data;
  2.  
  3. class Node {
  4.     public var name:String;
  5.     public var value:String;
  6.     public var children:Array<Node> = new Array<Node>();
  7.     public var attributes:Map<String, Node> = new Map<String, Node>();
  8.    
  9.     public function new(name:String, value:String = null) {
  10.         this.name = name;
  11.         this.value = value;
  12.     }
  13.    
  14.     public function addChild(name:String, value:String = null):Node {
  15.         var child = new Node(name, value);
  16.         children.push(child);
  17.         return child;
  18.     }
  19.    
  20.     public function addAttribute(name:String, value:String):Node {
  21.         var attr = new Node(name, value);
  22.         attributes.set(name, attr);
  23.         return attr;
  24.     }
  25.    
  26.     public function find(path:String):Dynamic {
  27.         ...
  28.     }
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top