1 2 17 18 import java.util.TreeMap ; 19 import java.io.Serializable ; 20 import org.apache.velocity.context.AbstractContext; 21 import org.apache.velocity.context.Context; 22 23 33 34 public class TreeMapContext extends AbstractContext 35 { 36 private TreeMap context = new TreeMap (); 37 38 public TreeMapContext() 39 { 40 super(); 41 } 42 43 public TreeMapContext( Context inner ) 44 { 45 super( inner ); 46 } 47 48 public Object internalGet( String key ) 49 { 50 return context.get( key ); 51 } 52 53 public Object internalPut( String key, Object value ) 54 { 55 return context.put( key, value ); 56 } 57 58 public boolean internalContainsKey(Object key) 59 { 60 return context.containsKey( key ); 61 } 62 63 public Object [] internalGetKeys() 64 { 65 return context.keySet().toArray(); 66 } 67 68 public Object internalRemove(Object key) 69 { 70 return context.remove( key ); 71 } 72 } 73 74 | Popular Tags |