1 21 package com.db4o; 22 23 import com.db4o.foundation.Tree; 24 25 28 public class TreeString extends Tree { 29 30 public String _key; 31 32 public TreeString(String a_key) { 33 this._key = a_key; 34 } 35 36 protected Tree shallowCloneInternal(Tree tree) { 37 TreeString ts = (TreeString) super.shallowCloneInternal(tree); 38 ts._key = _key; 39 return ts; 40 } 41 42 public Object shallowClone() { 43 return shallowCloneInternal(new TreeString(_key)); 44 } 45 46 public int compare(Tree a_to) { 47 return YapString 48 .compare(YapConst.stringIO.write(((TreeString) a_to)._key), 49 YapConst.stringIO.write(_key)); 50 } 51 52 public Object key(){ 53 return _key; 54 } 55 56 } 57 | Popular Tags |