This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface AttributeRepresentation { | |
List<Attribute> newAttributeList(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"teamID": { | |
"type": "nominal", | |
"role": "id" | |
} | |
}, | |
{ | |
"size": { | |
"type": "integer" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final class JSONAttributeRepresentation implements AttributeRepresentation { | |
private final List<Attribute> attributes; | |
public JSONAttributeRepresentation(Reader JSONReader) { | |
// Read in json however you want | |
// Get name, type, and role for each | |
// for each create attribute with the name and type | |
// Attribute att = AttributeFactory.createAttribute(name, type) | |
// atributes.add(att); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AttributeRepresentation rep = new JSONAttributeRepresentation(Reader jsonReader); | |
List<Attributes> attributes = rep.newAttributeList(); | |
Map<Attribute, String> roles = new HashMap<Attribute, String>(); | |
Attribute id = attributes.get(0); | |
roles.put(id, Attributes.ID_NAME); |
OlderNewer