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: base
test_class.modifier: protected
test_class.original_string: protected LocatorIF         base;
test_class.type: LocatorIF
test_class.var_name: base
test_class.declarator: testdataDirectory = "various"
test_class.modifier: private final static
test_class.original_string: private final static String testdataDirectory = "various";
test_class.type: String
test_class.var_name: testdataDirectory
test_class.file: ontopia-engine/src/test/java/net/ontopia/topicmaps/utils/ClassInstanceUtilsTest.java
test_class.identifier: ClassInstanceUtilsTest
test_case.body: @Test
    public void testGetInstancesOfTopic() throws IOException {
      load(testdataDirectory, "small-test.ltm");
      Collection instances = ClassInstanceUtils.getInstancesOf(topicmap.getTopics(),
                                                               getTopicById("person"));
      Assert.assertTrue("wrong number of instances", instances.size() == 3);
      Assert.assertTrue("instances does not contain 'lmg'",
                 instances.contains(getTopicById("lmg")));
      Assert.assertTrue("instances does not contain 'gra'",
                 instances.contains(getTopicById("gra")));
      Assert.assertTrue("instances does not contain 'grove'",
                 instances.contains(getTopicById("grove")));
    }
test_case.class_method_signature: ClassInstanceUtilsTest.testGetInstancesOfTopic()
test_case.full_signature: @Test public void testGetInstancesOfTopic()
test_case.identifier: testGetInstancesOfTopic
test_case.invocations: load getInstancesOf getTopics getTopicById assertTrue size assertTrue contains getTopicById assertTrue contains getTopicById assertTrue contains getTopicById
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetInstancesOfTopic()
focal_class.file: ontopia-engine/src/main/java/net/ontopia/topicmaps/utils/ClassInstanceUtils.java
focal_class.identifier: ClassInstanceUtils
focal_class.class_method_signature: ClassInstanceUtils.resolveAssociations1(TopicMapIF topicmap)
focal_class.full_signature: public static void resolveAssociations1(TopicMapIF topicmap)
focal_class.identifier: resolveAssociations1
focal_class.modifiers: public static
focal_class.parameters: (TopicMapIF topicmap)
focal_class.return: void
focal_class.signature: void resolveAssociations1(TopicMapIF topicmap)
focal_class.class_method_signature: ClassInstanceUtils.resolveAssociations2(TopicMapIF topicmap)
focal_class.full_signature: public static void resolveAssociations2(TopicMapIF topicmap)
focal_class.identifier: resolveAssociations2
focal_class.modifiers: public static
focal_class.parameters: (TopicMapIF topicmap)
focal_class.return: void
focal_class.signature: void resolveAssociations2(TopicMapIF topicmap)
focal_class.class_method_signature: ClassInstanceUtils.resolveAssociations(TopicMapIF topicmap,
                                            LocatorIF assoctype,
                                            LocatorIF typetype,
                                            LocatorIF insttype)
focal_class.full_signature: private static void resolveAssociations(TopicMapIF topicmap,
                                            LocatorIF assoctype,
                                            LocatorIF typetype,
                                            LocatorIF insttype)
focal_class.identifier: resolveAssociations
focal_class.modifiers: private static
focal_class.parameters: (TopicMapIF topicmap,
                                            LocatorIF assoctype,
                                            LocatorIF typetype,
                                            LocatorIF insttype)
focal_class.return: void
focal_class.signature: void resolveAssociations(TopicMapIF topicmap,
                                            LocatorIF assoctype,
                                            LocatorIF typetype,
                                            LocatorIF insttype)
focal_class.class_method_signature: ClassInstanceUtils.isInstanceOf(TypedIF typed, TopicIF type)
focal_class.full_signature: public static boolean isInstanceOf(TypedIF typed, TopicIF type)
focal_class.identifier: isInstanceOf
focal_class.modifiers: public static
focal_class.parameters: (TypedIF typed, TopicIF type)
focal_class.return: boolean
focal_class.signature: boolean isInstanceOf(TypedIF typed, TopicIF type)
focal_class.class_method_signature: ClassInstanceUtils.isInstanceOf(TopicIF topic, TopicIF type)
focal_class.full_signature: public static boolean isInstanceOf(TopicIF topic, TopicIF type)
focal_class.identifier: isInstanceOf
focal_class.modifiers: public static
focal_class.parameters: (TopicIF topic, TopicIF type)
focal_class.return: boolean
focal_class.signature: boolean isInstanceOf(TopicIF topic, TopicIF type)
focal_class.class_method_signature: ClassInstanceUtils.getInstancesOf(Collection typed, TopicIF type)
focal_class.full_signature: public static Collection getInstancesOf(Collection typed, TopicIF type)
focal_class.identifier: getInstancesOf
focal_class.modifiers: public static
focal_class.parameters: (Collection typed, TopicIF type)
focal_class.return: Collection
focal_class.signature: Collection getInstancesOf(Collection typed, TopicIF type)
focal_class.class_method_signature: ClassInstanceUtils.getTypes(Collection typed)
focal_class.full_signature: public static Collection getTypes(Collection typed)
focal_class.identifier: getTypes
focal_class.modifiers: public static
focal_class.parameters: (Collection typed)
focal_class.return: Collection
focal_class.signature: Collection getTypes(Collection typed)
focal_class.class_method_signature: ClassInstanceUtils.getTypes(Collection typed, Collection accumulated)
focal_class.full_signature: public static Collection getTypes(Collection typed, Collection accumulated)
focal_class.identifier: getTypes
focal_class.modifiers: public static
focal_class.parameters: (Collection typed, Collection accumulated)
focal_class.return: Collection
focal_class.signature: Collection getTypes(Collection typed, Collection accumulated)
focal_class.class_method_signature: ClassInstanceUtils.getTypeMap(Collection typed)
focal_class.full_signature: public static Map getTypeMap(Collection typed)
focal_class.identifier: getTypeMap
focal_class.modifiers: public static
focal_class.parameters: (Collection typed)
focal_class.return: Map
focal_class.signature: Map getTypeMap(Collection typed)
focal_class.class_method_signature: ClassInstanceUtils.getTypeMap(Collection typed, Map accumulated)
focal_class.full_signature: public static Map getTypeMap(Collection typed, Map accumulated)
focal_class.identifier: getTypeMap
focal_class.modifiers: public static
focal_class.parameters: (Collection typed, Map accumulated)
focal_class.return: Map
focal_class.signature: Map getTypeMap(Collection typed, Map accumulated)
focal_method.body: public static Collection getInstancesOf(Collection typed, TopicIF type) {
      Collection result = new ArrayList();
      
      // Loop over the typed objects to see if they're instances of the type
      Iterator iter = typed.iterator();
      while (iter.hasNext()) {
        Object object = iter.next();
        if (object instanceof TypedIF) {
          if (isInstanceOf((TypedIF)object, type)) result.add(object);
        } else {
          if (isInstanceOf((TopicIF)object, type)) result.add(object);
        }
      }
      return result;
    }
focal_method.class_method_signature: ClassInstanceUtils.getInstancesOf(Collection typed, TopicIF type)
focal_method.full_signature: public static Collection getInstancesOf(Collection typed, TopicIF type)
focal_method.identifier: getInstancesOf
focal_method.invocations: iterator hasNext next isInstanceOf add isInstanceOf add
focal_method.modifiers: public static
focal_method.parameters: (Collection typed, TopicIF type)
focal_method.return: Collection
focal_method.signature: Collection getInstancesOf(Collection typed, TopicIF type)