test_class.declarator: topicmap
test_class.modifier: protected
test_class.original_string: protected TopicMapIF        topicmap;
test_class.type: TopicMapIF
test_class.var_name: topicmap
test_class.declarator: builder
test_class.modifier: protected
test_class.original_string: protected TopicMapBuilderIF builder;
test_class.type: TopicMapBuilderIF
test_class.var_name: builder
test_class.file: ontopia-engine/src/test/java/net/ontopia/topicmaps/utils/SubjectIdentityDeciderTest.java
test_class.identifier: SubjectIdentityDeciderTest
test_case.body: @Test
    public void testInstances() {
      LocatorIF locC = makeLocator("C");
      LocatorIF locD = makeLocator("D");
      TopicIF topicA = getTopic("A");
      TopicIF topicB = getTopic("B");
  
      SubjectIdentityDecider decider = new SubjectIdentityDecider(locC);
      Assert.assertTrue("Decider did not recognize instance of topic",
                 decider.ok(topicA));
                 
      Assert.assertTrue("Decider ok-d topic which was instance of topic with wrong identifier",
                 !decider.ok(topicB));
    }
test_case.class_method_signature: SubjectIdentityDeciderTest.testInstances()
test_case.full_signature: @Test public void testInstances()
test_case.identifier: testInstances
test_case.invocations: makeLocator makeLocator getTopic getTopic assertTrue ok assertTrue ok
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testInstances()
focal_class.declarator: subject_identifier
focal_class.modifier: protected
focal_class.original_string: protected LocatorIF subject_identifier;
focal_class.type: LocatorIF
focal_class.var_name: subject_identifier
focal_class.file: ontopia-engine/src/main/java/net/ontopia/topicmaps/utils/SubjectIdentityDecider.java
focal_class.identifier: SubjectIdentityDecider
focal_class.interfaces: implements DeciderIF<T>
focal_class.class_method_signature: SubjectIdentityDecider.SubjectIdentityDecider(LocatorIF subject_identifier)
focal_class.full_signature: public  SubjectIdentityDecider(LocatorIF subject_identifier)
focal_class.identifier: SubjectIdentityDecider
focal_class.modifiers: public
focal_class.parameters: (LocatorIF subject_identifier)
focal_class.signature:  SubjectIdentityDecider(LocatorIF subject_identifier)
focal_class.class_method_signature: SubjectIdentityDecider.ok(T object)
focal_class.full_signature: @Override public boolean ok(T object)
focal_class.identifier: ok
focal_class.modifiers: @Override public
focal_class.parameters: (T object)
focal_class.return: boolean
focal_class.signature: boolean ok(T object)
focal_method.body: @Override
    public boolean ok(T object) {
      if (object instanceof TopicIF) {
        TopicIF topic = (TopicIF) object;
        if (topic.getSubjectIdentifiers().contains(subject_identifier))
          return true;
      }
        
      if (object instanceof TypedIF) {
        TopicIF topic = ((TypedIF) object).getType();
        if (topic == null)
          return false;
        return topic.getSubjectIdentifiers().contains(subject_identifier);
        
      } else if (object instanceof TopicIF) {
        Iterator<TopicIF> it = ((TopicIF) object).getTypes().iterator();
        while (it.hasNext()) {
          TopicIF topic = it.next();
          if (topic.getSubjectIdentifiers().contains(subject_identifier))
            return true;
        }
      } 
  
      return false;
    }
focal_method.class_method_signature: SubjectIdentityDecider.ok(T object)
focal_method.full_signature: @Override public boolean ok(T object)
focal_method.identifier: ok
focal_method.invocations: contains getSubjectIdentifiers getType contains getSubjectIdentifiers iterator getTypes hasNext next contains getSubjectIdentifiers
focal_method.modifiers: @Override public
focal_method.parameters: (T object)
focal_method.return: boolean
focal_method.signature: boolean ok(T object)