@Override public Map<?, ?> deserialize(JsonElement elem, Type type, JsonDeserializationContext ctx) throws JsonParseException { if (elem == null) { return null; } JsonObject js = elem.getAsJsonObject(); Type valueType = (type instanceof ParameterizedType) ? ((ParameterizedType) type).getActualTypeArguments()[1] : Object.class; Map<String, Object> map = JSCollections.$map(); for (java.util.Map.Entry<String, JsonElement> entry : js.entrySet()) { map.$put(entry.getKey(), ctx.deserialize(entry.getValue(), valueType)); } return map; }
private void initAssertionsMap() { assertions = JSCollections.$map(); for (int i = 0; i < inputGraph.getNodes().$length();i++) { assertions.$put(String.valueOf(i),new Array<PapAssertion>()); } }
private void buildValuesCompetencyIndexAndDependencies() { competencyIndex = JSCollections.$map(); values = new Array<Double>(); for (int i=0;i<inputGraph.getNodes().$length();i++){ values.push(INITIAL_VALUE); competencyIndex.$put(inputGraph.getNodes().$get(i),i); String type; for (int j=0; j< PapDependency.getDependencyTypes().$length();j++) { type = PapDependency.getDependencyTypes().$get(j); dependencies.$get(type).$put(String.valueOf(i),new Array<PapDependency>()); } } }
final InquiryPacket ip = new InquiryPacket(subject, competency, level, context, success, failure, null, IPType.COMPETENCY); ip.root = true; processedEquivalencies = JSCollections.$map(); assertions = null; this.context = context;
encryptOnSaveMap = JSCollections.$map();
public PapDependencyDefinitions() { dependencyDefinitionMap = JSCollections.$map(); }
public void initNodePacketGraph(Array<Node> nodes) { NodePacket np; Node n; nodePacketList = new Array<NodePacket>(); nodePacketMap = JSCollections.$map(); relationList = new Array<PacketRelation>(); for (int i=0;i<nodes.$length();i++) { n = nodes.$get(i); np = new NodePacket(); np.addNode(n); nodePacketList.push(np); nodePacketMap.$put(n.getId(),np); } }
public NodePacket() { nodeList = new Array<Node>(); nodeMap = JSCollections.$map(); }
private void initBuilder(boolean createImpliedEdges) { this.createImpliedEdges = createImpliedEdges; competencyGraph = new CompetencyGraph(includeAssertions); assertionMap = JSCollections.$map(); frameworkRelationMap = JSCollections.$map(); frameworkRelationList = new Array<EcAlignment>(); assertionList = new Array<EcAssertion>(); }
private void initDependenciesMap() { dependencies = JSCollections.$map(); String type; for (int i=0; i< PapDependency.getDependencyTypes().$length();i++) { type = PapDependency.getDependencyTypes().$get(i); Map<String,Array<PapDependency>> dependencySubMap = JSCollections.$map(); dependencies.$put(type,dependencySubMap); } }
@Override public Map<String, Object> deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { // Ok: must point to START_OBJECT, FIELD_NAME or END_OBJECT JsonToken t = jp.getCurrentToken(); if ((t != JsonToken.START_OBJECT) && (t != JsonToken.FIELD_NAME) && (t != JsonToken.END_OBJECT)) { throw ctxt.mappingException(getMapClass()); } Map<String, Object> result = JSCollections.$map(); _readAndBind(jp, ctxt, result); return result; }
public NodePacketGraph() { nodePacketList = new Array<NodePacket>(); nodePacketMap = JSCollections.$map(); relationList = new Array<PacketRelation>(); }
public void asTurtle(Callback1<String> success, Callback1<String> failure, String signatureSheet) { final FormData fd = new FormData(); final String id = this.id; if (signatureSheet != null || signatureSheet != JSGlobal.undefined) fd.append("signatureSheet", signatureSheet); Map<String, String> headers = JSCollections.$map(); headers.$put("Accept", "text/turtle"); EcRemote.postWithHeadersExpectingString(id, "", fd, headers, success, failure); } }
private void addCompetenciesToFrameworkNodeGraph() { EcCompetency cmp; Node n; competencyNodeMap = JSCollections.$map(); for (int i = 0; i < competencyArray.$length(); i++) { cmp = competencyArray.$get(i); n = new Node(cmp.shortId()); n.setName(cmp.getName()); n.setDescription(cmp.getDescription()); frameworkNodeGraph.addNode(n); competencyNodeMap.$put(cmp.shortId(), n); } }
public CompetencyGraph(boolean includeAssertions) { nodes = new Array<String>(); edges = new Array<CgEdge>(); positiveAssertions = new Array<SimpleAssertion>(); negativeAssertions = new Array<SimpleAssertion>(); nodeMap = JSCollections.$map(); edgeMap = JSCollections.$map(); this.includeAssertions = includeAssertions; }
public void asNQuads(Callback1<String> success, Callback1<String> failure, String signatureSheet) { final FormData fd = new FormData(); final String id = this.id; if (signatureSheet != null || signatureSheet != JSGlobal.undefined) fd.append("signatureSheet", signatureSheet); Map<String, String> headers = JSCollections.$map(); headers.$put("Accept", "text/n4"); EcRemote.postWithHeadersExpectingString(id, "", fd, headers, success, failure); }
public void asRdfXml(Callback1<String> success, Callback1<String> failure, String signatureSheet) { final FormData fd = new FormData(); final String id = this.id; if (signatureSheet != null || signatureSheet != JSGlobal.undefined) fd.append("signatureSheet", signatureSheet); Map<String, String> headers = JSCollections.$map(); headers.$put("Accept", "application/rdf+xml"); EcRemote.postWithHeadersExpectingString(id, "", fd, headers, success, failure); }
public NodeRelationMap() { nodeList = new Array<Node>(); relationMap = JSCollections.$map(); }