Author: mes
Date: 2010-10-05 14:10:17 -0700 (Tue, 05 Oct 2010)
New Revision: 22158
Added:
core3/io-api/trunk/src/main/java/org/cytoscape/io/read/CyPropertyReader.java
core3/io-api/trunk/src/main/java/org/cytoscape/io/read/CyPropertyReaderManager.java
core3/io-api/trunk/src/main/java/org/cytoscape/io/write/PropertyWriterFactory.java
core3/io-api/trunk/src/main/java/org/cytoscape/io/write/PropertyWriterManager.java
Log:
added support for properties
Added:
core3/io-api/trunk/src/main/java/org/cytoscape/io/read/CyPropertyReader.java
===================================================================
---
core3/io-api/trunk/src/main/java/org/cytoscape/io/read/CyPropertyReader.java
(rev 0)
+++
core3/io-api/trunk/src/main/java/org/cytoscape/io/read/CyPropertyReader.java
2010-10-05 21:10:17 UTC (rev 22158)
@@ -0,0 +1,20 @@
+package org.cytoscape.io.read;
+
+import org.cytoscape.work.Task;
+
+/**
+ *
+ */
+public interface CyPropertyReader extends Task {
+
+ /**
+ * @return A property object of type T. Type T can be
+ * be generally be any object, but in practice will be
+ * {...@link java.util.Properties},
+ * {...@link org.cytoscape.property.bookmark.Bookmarks}, and
+ * {...@link org.cytoscape.property.session.Cysession}.
+ */
+ Object getProperty();
+
+}
+
Added:
core3/io-api/trunk/src/main/java/org/cytoscape/io/read/CyPropertyReaderManager.java
===================================================================
---
core3/io-api/trunk/src/main/java/org/cytoscape/io/read/CyPropertyReaderManager.java
(rev 0)
+++
core3/io-api/trunk/src/main/java/org/cytoscape/io/read/CyPropertyReaderManager.java
2010-10-05 21:10:17 UTC (rev 22158)
@@ -0,0 +1,29 @@
+package org.cytoscape.io.read;
+
+import java.io.InputStream;
+import java.net.URI;
+
+/**
+ *
+ */
+public interface CyPropertyReaderManager {
+ /**
+ * Given a URI this method will attempt to find a CyPropertyReaderFactory
+ * that can read the URI, will set the InputStream for the factory and
+ * will return the reader task.
+ * @param uri The URI we're attempting to read.
+ * @return A reader than can read the specified URI. Will return null if
+ * no reader can be found.
+ */
+ CyPropertyReader getReader(URI uri);
+
+ /**
+ * Given an InputStream this method will attempt to find a
CyPropertyReaderFactory
+ * that can read the stream, will set the InputStream for the factory and
+ * will return the reader task.
+ * @param stream The input stream we're attempting to read.
+ * @return A reader than can read the specified stream. Will return null if
+ * no reader can be found.
+ */
+ CyPropertyReader getReader(InputStream stream);
+}
Added:
core3/io-api/trunk/src/main/java/org/cytoscape/io/write/PropertyWriterFactory.java
===================================================================
---
core3/io-api/trunk/src/main/java/org/cytoscape/io/write/PropertyWriterFactory.java
(rev 0)
+++
core3/io-api/trunk/src/main/java/org/cytoscape/io/write/PropertyWriterFactory.java
2010-10-05 21:10:17 UTC (rev 22158)
@@ -0,0 +1,10 @@
+package org.cytoscape.io.write;
+
+
+/**
+ * Returns a Task that will write
+ */
+public interface PropertyWriterFactory extends CyWriterFactory {
+
+ void setProperty(Object property);
+}
Added:
core3/io-api/trunk/src/main/java/org/cytoscape/io/write/PropertyWriterManager.java
===================================================================
---
core3/io-api/trunk/src/main/java/org/cytoscape/io/write/PropertyWriterManager.java
(rev 0)
+++
core3/io-api/trunk/src/main/java/org/cytoscape/io/write/PropertyWriterManager.java
2010-10-05 21:10:17 UTC (rev 22158)
@@ -0,0 +1,48 @@
+/*
+ Copyright (c) 2006, 2007, The Cytoscape Consortium (www.cytoscape.org)
+
+ The Cytoscape Consortium is:
+ - Institute for Systems Biology
+ - University of California San Diego
+ - Memorial Sloan-Kettering Cancer Center
+ - Institut Pasteur
+ - Agilent Technologies
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications. In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage. See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+package org.cytoscape.io.write;
+
+import org.cytoscape.io.CyFileFilter;
+import java.io.File;
+import java.io.OutputStream;
+
+public interface PropertyWriterManager extends CyWriterManager {
+
+ /**
+ * The filter is important here because it will
+ */
+ CyWriter getWriter(Object property, CyFileFilter filter, File file)
throws Exception;
+ CyWriter getWriter(Object property, CyFileFilter filter, OutputStream
os) throws Exception;
+}
--
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.