Author: ruschein
Date: 2009-12-30 17:16:17 -0800 (Wed, 30 Dec 2009)
New Revision: 18810
Modified:
cytoscape/trunk/src/cytoscape/data/readers/CyAttributesReader.java
Log:
Cosmetic.
Modified: cytoscape/trunk/src/cytoscape/data/readers/CyAttributesReader.java
===================================================================
--- cytoscape/trunk/src/cytoscape/data/readers/CyAttributesReader.java
2009-12-31 01:15:19 UTC (rev 18809)
+++ cytoscape/trunk/src/cytoscape/data/readers/CyAttributesReader.java
2009-12-31 01:16:17 UTC (rev 18810)
@@ -80,9 +80,9 @@
* @throws IOException DOCUMENT ME!
*/
public static void loadAttributes(CyAttributes cyAttrs, Reader fileIn)
throws IOException {
- CyAttributesReader ar = new CyAttributesReader();
- ar.loadAttributesInternal(cyAttrs, fileIn);
- }
+ CyAttributesReader ar = new CyAttributesReader();
+ ar.loadAttributesInternal(cyAttrs, fileIn);
+ }
/**
* DOCUMENT ME!
@@ -93,9 +93,9 @@
* @throws IOException DOCUMENT ME!
*/
public void loadAttributesInternal(CyAttributes cyAttrs, Reader fileIn)
- throws IOException {
+ throws IOException {
- badDecode = false;
+ badDecode = false;
try {
final BufferedReader reader;
@@ -176,7 +176,7 @@
String key = line.substring(0, inx).trim();
String val = line.substring(inx + 1).trim();
- key = decodeString(key);
+ key = decodeString(key);
if (firstLine && val.startsWith("(")) {
list = true;
@@ -187,14 +187,14 @@
val = val.substring(1).trim();
val = val.substring(0, val.length() -
1).trim();
- String[] elms = val.split("::");
+ String[] elms = val.split("::");
final ArrayList elmsBuff = new
ArrayList();
- for (String vs : elms) {
- vs = decodeString(vs);
- vs = decodeSlashEscapes(vs);
- elmsBuff.add(vs);
- }
+ for (String vs : elms) {
+ vs = decodeString(vs);
+ vs = decodeSlashEscapes(vs);
+ elmsBuff.add(vs);
+ }
if (firstLine) {
if (type < 0) {
@@ -243,8 +243,8 @@
cyAttrs.setListAttribute(key,
attributeName, elmsBuff);
} else { // Not a list.
- val = decodeString(val);
- val = decodeSlashEscapes(val);
+ val = decodeString(val);
+ val = decodeSlashEscapes(val);
if (firstLine) {
if (type < 0) {
@@ -298,23 +298,23 @@
}
}
- private String decodeString(String in) throws IOException {
- if (doDecoding) {
- try {
- in = URLDecoder.decode(in, CyAttributesWriter.ENCODING_SCHEME);
- }
- catch (IllegalArgumentException iae) {
- if (!badDecode) {
-
CyLogger.getLogger(CyAttributesReader.class).info(MessageFormat.format(badDecodeMessage,
lineNum), iae);
- badDecode = true;
- }
- }
- }
+ private String decodeString(String in) throws IOException {
+ if (doDecoding) {
+ try {
+ in = URLDecoder.decode(in,
CyAttributesWriter.ENCODING_SCHEME);
+ }
+ catch (IllegalArgumentException iae) {
+ if (!badDecode) {
+
CyLogger.getLogger(CyAttributesReader.class).info(MessageFormat.format(badDecodeMessage,
lineNum), iae);
+ badDecode = true;
+ }
+ }
+ }
- return in;
- }
+ return in;
+ }
- private static String decodeSlashEscapes(String in) {
+ private static String decodeSlashEscapes(String in) {
final StringBuilder elmBuff = new StringBuilder();
int inx2;
--
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.