Author: kono
Date: 2009-03-09 16:58:39 -0700 (Mon, 09 Mar 2009)
New Revision: 16188
Modified:
core3/io-api/trunk/src/main/java/org/cytoscape/io/CyFileFilter.java
core3/io-api/trunk/src/main/java/org/cytoscape/io/read/CyReader.java
core3/io-api/trunk/src/main/java/org/cytoscape/io/read/CyReaderFactory.java
core3/io-api/trunk/src/main/java/org/cytoscape/io/read/CyReaderManager.java
Log:
Now read() method returns actual read object.
Modified: core3/io-api/trunk/src/main/java/org/cytoscape/io/CyFileFilter.java
===================================================================
--- core3/io-api/trunk/src/main/java/org/cytoscape/io/CyFileFilter.java
2009-03-09 23:11:38 UTC (rev 16187)
+++ core3/io-api/trunk/src/main/java/org/cytoscape/io/CyFileFilter.java
2009-03-09 23:58:39 UTC (rev 16188)
@@ -1,12 +1,15 @@
package org.cytoscape.io;
import java.io.IOException;
+import java.io.InputStream;
import java.net.URI;
import java.util.Set;
public interface CyFileFilter {
public boolean accept(URI uri, DataCategory category) throws
IOException;
+
+ public boolean accept(InputStream stream, DataCategory category) throws
IOException;
/**
* Returns a list of file extensions (xml, xgmml, sif) suitable for for
use
Modified: core3/io-api/trunk/src/main/java/org/cytoscape/io/read/CyReader.java
===================================================================
--- core3/io-api/trunk/src/main/java/org/cytoscape/io/read/CyReader.java
2009-03-09 23:11:38 UTC (rev 16187)
+++ core3/io-api/trunk/src/main/java/org/cytoscape/io/read/CyReader.java
2009-03-09 23:58:39 UTC (rev 16188)
@@ -2,7 +2,7 @@
import java.io.IOException;
import java.io.InputStream;
-import java.util.Set;
+import java.util.Map;
/**
* The basic input interface that specifies what is to be read and when it is
to
@@ -21,21 +21,8 @@
* <p>
* This should probably throw an {...@link java.io.IOException}
*/
- public void read() throws IOException;
+ public Map<Class<?>, Object> read() throws IOException;
public void setInputStream(InputStream is);
- /**
- * Client classes get the actual read data objects by this method. This
is a
- * type-safe heterogeneous container pattern.
- *
- * If client code use this method before read(), IllegalStateException
will be thrown.
- *
- * @param <T>
- * @param type
- * @return
- */
- public <T> T getReadData(Class<T> type) throws IllegalStateException,
IllegalArgumentException;
-
- public Set<Class<?>> getSupportedDataTypes();
}
Modified:
core3/io-api/trunk/src/main/java/org/cytoscape/io/read/CyReaderFactory.java
===================================================================
--- core3/io-api/trunk/src/main/java/org/cytoscape/io/read/CyReaderFactory.java
2009-03-09 23:11:38 UTC (rev 16187)
+++ core3/io-api/trunk/src/main/java/org/cytoscape/io/read/CyReaderFactory.java
2009-03-09 23:58:39 UTC (rev 16188)
@@ -1,12 +1,15 @@
package org.cytoscape.io.read;
import java.io.IOException;
+import java.io.InputStream;
import java.net.URI;
import org.cytoscape.io.FileIOFactory;
public interface CyReaderFactory extends FileIOFactory {
-
+
public CyReader getReader(URI uri) throws IOException;
+ public CyReader getReader(InputStream stream) throws IOException;
+
}
Modified:
core3/io-api/trunk/src/main/java/org/cytoscape/io/read/CyReaderManager.java
===================================================================
--- core3/io-api/trunk/src/main/java/org/cytoscape/io/read/CyReaderManager.java
2009-03-09 23:11:38 UTC (rev 16187)
+++ core3/io-api/trunk/src/main/java/org/cytoscape/io/read/CyReaderManager.java
2009-03-09 23:58:39 UTC (rev 16188)
@@ -34,6 +34,7 @@
*/
package org.cytoscape.io.read;
+import java.io.InputStream;
import java.net.URI;
import java.util.Map;
@@ -60,8 +61,8 @@
* @return
* @throws IllegalArgumentException File type is not supported.
*/
- public CyReader getReader(String fileName, DataCategory category)
throws IllegalArgumentException;
-
public CyReader getReader(URI resourceLocation, DataCategory category)
throws IllegalArgumentException;
+
+ public CyReader getReader(InputStream stream, DataCategory category)
throws IllegalArgumentException;
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en
-~----------~----~----~----~------~----~------~--~---