[Biojava-dev] SimpleGFFRecord
Ido M. Tamir
tamir at imp.univie.ac.at
Wed Dec 20 15:58:02 UTC 2006
Hi,
SimpleGFFRecord puts out one additional semicolon
at the end of the attributes. Shifting sBuff.append(";")
to the test changes that.
old:
public static String stringifyAttributes(Map attMap) {
StringBuffer sBuff = new StringBuffer();
Iterator ki = attMap.keySet().iterator();
while (ki.hasNext()) {
String key = (String) ki.next();
sBuff.append(key);
List values = (List) attMap.get(key);
for (Iterator vi = values.iterator(); vi.hasNext();) {
String value = (String) vi.next();
if (isText(value)) {
sBuff.append(" \"" + value + "\"");
} else {
sBuff.append(" " + value);
}
}
sBuff.append(";"); <---!!
if (ki.hasNext()) {
sBuff.append(" ");
}
}
return sBuff.substring(0);
}
public static String stringifyAttributes(Map attMap) {
StringBuffer sBuff = new StringBuffer();
Iterator ki = attMap.keySet().iterator();
while (ki.hasNext()) {
String key = (String) ki.next();
sBuff.append(key);
List values = (List) attMap.get(key);
for (Iterator vi = values.iterator(); vi.hasNext();) {
String value = (String) vi.next();
if (isText(value)) {
sBuff.append(" \"" + value + "\"");
} else {
sBuff.append(" " + value);
}
}
if (ki.hasNext()) {
sBuff.append(";"); <---!!
sBuff.append(" ");
}
}
return sBuff.substring(0);
}
More information about the biojava-dev
mailing list