1 33 34 package bsh.collection; 35 36 import java.util.Iterator ; 37 import java.util.Collection ; 38 import java.util.Enumeration ; 39 import java.util.Map ; 40 import java.lang.reflect.Array ; 41 import bsh.BshIterator; 42 43 47 public class CollectionManagerImpl extends bsh.CollectionManager 48 { 49 public BshIterator getBshIterator( Object obj ) 50 throws IllegalArgumentException 51 { 52 if ( obj instanceof Collection || obj instanceof Iterator ) 53 return new CollectionIterator( obj ); 54 else 55 return new bsh.CollectionManager.BasicBshIterator( obj ); 56 } 57 58 public boolean isMap( Object obj ) 59 { 60 if ( obj instanceof Map ) 61 return true; 62 else 63 return super.isMap( obj ); 64 } 65 66 public Object getFromMap( Object map, Object key ) 67 { 68 return ((Map )map).get(key); 70 } 71 public Object putInMap( Object map, Object key, Object value ) 72 { 73 return ((Map )map).put(key, value); 75 } 76 } 77 | Popular Tags |