@Override public TopicNameIF makeTopicName(TopicIF topic, String value) { if (topic == null) throw new NullPointerException(MSG_TOPIC_NOT_NULL); if (value == null) throw new NullPointerException(MSG_TOPIC_NAME_VALUE_NOT_NULL); CrossTopicMapException.check(topic, this.tm); TopicNameIF name = new TopicName(tm); ((Topic)topic).addTopicName(name); name.setValue(value); name.setType(getDefaultNameType()); return name; }
@Override public TopicNameIF makeTopicName(TopicIF topic, String value) { if (topic == null) throw new NullPointerException(MSG_TOPIC_NOT_NULL); if (value == null) throw new NullPointerException(MSG_TOPIC_NAME_VALUE_NOT_NULL); CrossTopicMapException.check(topic, this.tm); TopicIF bntype = getDefaultNameType(); TopicNameIF name = new TopicName(txn); ((Topic)topic).addTopicName(name); name.setValue(value); name.setType(bntype); return name; }
bname.setType(referenced_topic);
@Override public void setType(Topic type) { Check.typeNotNull(this, type); Check.typeInTopicMap(getTopicMap(), type); wrapped.setType(topicMap.unwrapTopic(type)); }
@Override public TopicNameIF makeTopicName(TopicIF topic, TopicIF bntype, String value) { if (topic == null) throw new NullPointerException(MSG_TOPIC_NOT_NULL); if (value == null) throw new NullPointerException(MSG_TOPIC_NAME_VALUE_NOT_NULL); CrossTopicMapException.check(topic, this.tm); // if not type has been specified, use the default name type if (bntype == null) bntype = getDefaultNameType(); else CrossTopicMapException.check(bntype, this.tm); TopicNameIF name = new TopicName(tm); ((Topic)topic).addTopicName(name); name.setType(bntype); name.setValue(value); return name; }
basename.setType(type);
@Override public TopicNameIF makeTopicName(TopicIF topic, TopicIF bntype, String value) { if (topic == null) throw new NullPointerException(MSG_TOPIC_NOT_NULL); if (value == null) throw new NullPointerException(MSG_TOPIC_NAME_VALUE_NOT_NULL); CrossTopicMapException.check(topic, this.tm); if (bntype != null) CrossTopicMapException.check(bntype, this.tm); // if type has not been specified, use the default name type if (bntype == null) bntype = getDefaultNameType(); else CrossTopicMapException.check(bntype, this.tm); TopicNameIF name = new TopicName(txn); ((Topic)topic).addTopicName(name); name.setType(bntype); name.setValue(value); return name; }
basename.setType(type);
@Override public void run() { TopicNameIF bn = getTopicName(); TopicIF type = builder.makeTopic(); // create type bn.setType(null); TopicIF xtype = (TopicIF)this.data.remove("type"); // remove type xtype.remove(); this.objectId = bn.getObjectId(); } });
@Override public void run() { TopicNameIF bn = getTopicName(); TopicIF type = builder.makeTopic(); // create type this.data.put("type", type); bn.setType(type); this.objectId = bn.getObjectId(); this.value = type.getObjectId(); } });
while (tniter.hasNext()) { TopicNameIF tn = tniter.next(); tn.setType(ntheme); tn.removeTheme(ntheme);
while (tniter.hasNext()) { TopicNameIF tn = tniter.next(); tn.setType(ntheme); tn.removeTheme(ntheme);
public void testAllTopicNames() { assertEquals(0, clsix.getAllTopicNames().size()); TopicIF topic = builder.makeTopic(); TopicNameIF tn = builder.makeTopicName(topic, "foo"); TopicNameIF tn2 = builder.makeTopicName(topic, topic, "bar"); assertEquals(2, clsix.getAllTopicNames().size()); assertTrue(clsix.getAllTopicNames().contains(tn)); assertTrue(clsix.getAllTopicNames().contains(tn2)); tn.setType(topic); assertEquals(2, clsix.getAllTopicNames().size()); tn.remove(); assertEquals(1, clsix.getAllTopicNames().size()); assertFalse(clsix.getAllTopicNames().contains(tn)); topic.remove(); assertEquals(0, clsix.getAllTopicNames().size()); assertFalse(clsix.getAllTopicNames().contains(tn2)); }
topicName.setType(nameType2); assertFalse("Index of topic names by value and type does not detect changed type", ix.getTopicNames(value2, nameType2).isEmpty()); topicName2.setType(nameType2); assertFalse("Index of topic names by value and type contains topic name with wrong value", ix.getTopicNames(value2, nameType2).contains(topicName2));
tn.setType(tn_type2);
bn.setType(other); afterTest();