fixes and additions to new js api
[org.ibex.core.git] / src / org / ibex / js / Stream.java
index 2344e76..e69c28c 100644 (file)
@@ -17,12 +17,14 @@ public abstract class Stream extends JS implements JS.Cloneable {
 
     // Public Interface //////////////////////////////////////////////////////////////////////////////
 
+    // FIXME: This should be in JS, "everything has a stream"
     public static InputStream getInputStream(JS js) throws IOException { return ((Stream)js.unclone()).getInputStream();}
     public static class NotCacheableException extends Exception { }
 
     private Cache getCache = new Cache(100);
-    protected JS _get(Object key) { return null; }
-    public final JS get(JS key) {
+    // FEATURE: Mandate that Streams use only String keys?
+    protected JS _get(JS key) throws JSExn { return null; }
+    public final JS get(JS key) throws JSExn {
         JS ret = (JS) getCache.get(key);
         if (ret == null) getCache.put(key, ret = _get(key));
         return ret;