Java Reference
In-Depth Information
public abstract class MapEntity {
protected String[] dbInfo # {
"xxx", // ID
"xxx" // label
};
public MapEntity(String line) {
String docLine # line;
// extracts the ID of the link
int indexInit # docLine.indexOf("ID # ");
docLine # docLine.substring(indexInit ! 4);
int indexEnd # docLine.indexOf('"');
dbInfo[0] # docLine.substring(0, indexEnd);
// extracts the label of the link
. . .
}
}
public class MapEntitySet {
private String[] dbInfo # {
"xxx", // db name
"xxx", // table name
"xxx", // key name
"xxx" // label name
};
public String toXML(String entityType) {
StringBuffer stream # new StringBuffer();
stream.append("\n <LIST TYPE # " ! '"' ! entityType ! '"' !
" DBNAME # " ! '"' ! dbInfo[0] ! '"' !
" DBTABLE # " ! '"' ! dbInfo[1] ! '"' !
" DBKEY # " ! '"' ! dbInfo[2] ! '"' !
" DBLABEL # " ! '"' ! dbInfo[3] ! '"' ! ">");
Iterator iterator # entityList.iterator();
while (iterator.hasNext())
stream.append(((MapEntity) iterator.next()).toXML());
stream.append("\n </LIST>");
return stream.toString();
}
}
public class MapLayer { }
public String toXML() {
StringBuffer stream # new StringBuffer();
stream.append(" <LAYER NAME # " ! '"' ! name ! '"' !
" COLOR # " ! '"' ! colorName ! '"' ! ">");
stream.append(siteSet.toXML("SITE"));
stream.append(linkSet.toXML("LINK"));
stream.append(areaSet.toXML("AREA"));
Search WWH ::




Custom Search