2010-02-04 01:57:09 +01:00
|
|
|
package com.metaweb.gridworks.protograph;
|
|
|
|
|
|
|
|
import java.util.Properties;
|
|
|
|
|
|
|
|
import org.json.JSONException;
|
|
|
|
import org.json.JSONWriter;
|
|
|
|
|
2010-02-11 07:44:48 +01:00
|
|
|
public class AnonymousNode implements Node {
|
2010-02-04 01:57:09 +01:00
|
|
|
private static final long serialVersionUID = -6956243664838720646L;
|
2010-02-06 03:54:01 +01:00
|
|
|
|
|
|
|
final public FreebaseType type;
|
|
|
|
|
|
|
|
public AnonymousNode(FreebaseType type) {
|
|
|
|
this.type = type;
|
|
|
|
}
|
2010-02-04 01:57:09 +01:00
|
|
|
|
|
|
|
public void write(JSONWriter writer, Properties options)
|
|
|
|
throws JSONException {
|
2010-02-12 03:23:26 +01:00
|
|
|
|
|
|
|
writer.object();
|
|
|
|
writer.key("nodeType"); writer.value("anonymous");
|
|
|
|
writer.key("type"); type.write(writer, options);
|
|
|
|
writer.endObject();
|
2010-02-04 01:57:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|