@Override public AssociationIF makeAssociation(TopicIF assoc_type) { if (assoc_type == null) throw new NullPointerException(MSG_ASSOCIATION_TYPE_NOT_NULL); CrossTopicMapException.check(assoc_type, this.tm); AssociationIF assoc = new Association(txn); ((TopicMap)tm).addAssociation(assoc); assoc.setType(assoc_type); return assoc; }
@Override public AssociationIF makeAssociation(TopicIF assoc_type) { if (assoc_type == null) throw new NullPointerException(MSG_ASSOCIATION_TYPE_NOT_NULL); CrossTopicMapException.check(assoc_type, this.tm); AssociationIF assoc = new Association(tm); tm.addAssociation(assoc); assoc.setType(assoc_type); return assoc; }
assoc.setType(referenced_topic);
@Override public void setType(Topic type) { Check.typeNotNull(this, type); Check.typeInTopicMap(getTopicMap(), type); wrapped.setType(topicMap.unwrapTopic(type)); }
@Override public AssociationIF makeAssociation(TopicIF assoc_type, TopicIF role_type, TopicIF player) { if (assoc_type == null) throw new NullPointerException(MSG_ASSOCIATION_TYPE_NOT_NULL); if (role_type == null) throw new NullPointerException(MSG_ASSOCIATION_ROLE_TYPE_NOT_NULL); if (player == null) throw new NullPointerException(MSG_ASSOCIATION_ROLE_PLAYER_NOT_NULL); CrossTopicMapException.check(assoc_type, this.tm); CrossTopicMapException.check(role_type, this.tm); CrossTopicMapException.check(player, this.tm); AssociationIF assoc = new Association(tm); tm.addAssociation(assoc); assoc.setType(assoc_type); AssociationRoleIF assocrl = new AssociationRole(tm); ((Association)assoc).addRole(assocrl); assocrl.setType(role_type); assocrl.setPlayer(player); return assoc; }
@Override public AssociationIF makeAssociation(TopicIF assoc_type, TopicIF role_type, TopicIF player) { if (assoc_type == null) throw new NullPointerException(MSG_ASSOCIATION_TYPE_NOT_NULL); if (role_type == null) throw new NullPointerException(MSG_ASSOCIATION_ROLE_TYPE_NOT_NULL); if (player == null) throw new NullPointerException(MSG_ASSOCIATION_ROLE_PLAYER_NOT_NULL); CrossTopicMapException.check(assoc_type, this.tm); CrossTopicMapException.check(role_type, this.tm); CrossTopicMapException.check(player, this.tm); AssociationIF assoc = new Association(txn); ((TopicMap)tm).addAssociation(assoc); assoc.setType(assoc_type); AssociationRoleIF assocrl = new AssociationRole(txn); ((Association)assoc).addRole(assocrl); assocrl.setType(role_type); assocrl.setPlayer(player); return assoc; }
@Override public void run() { AssociationIF a = getAssociation(); TopicIF type = builder.makeTopic(); // create type this.data.put("type", type); a.setType(type); this.objectId = a.getObjectId(); this.value = type.getObjectId(); } });
public void testAssociationsDynamic() { TopicIF at1 = builder.makeTopic(); TopicIF at2 = builder.makeTopic(); AssociationIF a = builder.makeAssociation(at1); assertTrue("TopicMapIF.addAssociation does not update index", index.getAssociations(at1).size() == 1); a.setType(at2); assertTrue("AssociationIF.setType(at2) does not update index", index.getAssociations(at1).size() == 0); a.setType(at1); assertTrue("AssociationIF.addType does not update index", index.getAssociations(at1).size() == 1); a.remove(); assertTrue("TopicMapIF.removeAssociation does not update index", index.getAssociations(at1).size() == 0); }
@Override public void run() { AssociationIF a = getAssociation(); TopicIF type = builder.makeTopic(); // create type type.addSubjectIdentifier(URILocator.create("type:cleared")); a.setType(type); TopicIF xtype = (TopicIF)this.data.remove("type"); // remove type xtype.remove(); this.objectId = a.getObjectId(); } });
assoc.setType(atype);
assoc.setType(atype);
clsix.usedAsAssociationRoleType(type)); inst.setType(type); role.setType(type);
r1E.getAssociation().setType(at2E); r1E.setType(rt3E); assertTrue("p1E.rolesByType(rt1,at1).size is not 0.", p1E.getRolesByType(rt1E, at1E).size() == 0); r1B.getAssociation().setType(at1B); assertTrue("p1B.rolesByType(rt3,at1).size is not 1.", p1B.getRolesByType(rt3B,at1B).size() == 1); assertTrue("p1B.rolesByType(rt3,at2).size is not 0.", p1B.getRolesByType(rt3B,at2B).size() == 0);
assoc.setType(type);
as.setType(as_type2);
as.setType(other); afterTest();