public XTM2ContentHandler(TopicMapStoreFactoryIF store_factory, LocatorIF doc_address) { this(store_factory, doc_address, new CompactHashSet()); }
public AssociationTracker(Set<TopicIF> targettopics, Set<TopicIF> sourcetopics) { this.targettopics = targettopics; this.sourcetopics = sourcetopics; this.wanted = new CompactHashSet<String>(); this.unwanted = new HashMap<String, AssociationIF>(); }
/** * PUBLIC: Initializes the exporter. */ public XTMFragmentExporter() { export_srclocs = true; locator_handler = null; reifiers = new ArrayList(); alreadyExported = new CompactHashSet(); }
public TologQuery() { clauses = new ArrayList(); orderBy = new ArrayList(); countVariables = new CompactHashSet<Variable>(); variables = new ArrayList(); orderDescending = new CompactHashSet<String>(); limit = -1; offset = -1; }
public SimpleFileFilter(String description, String extension) { this.description = description; this.extensions = new CompactHashSet(); addExtension(extension); }
private static Set<String> getAssociationKeySet(Collection<AssociationIF> associations) { Set<String> assocs = new CompactHashSet<String>(); Iterator<AssociationIF> it = associations.iterator(); while (it.hasNext()) { AssociationIF assoc = it.next(); assocs.add(KeyGenerator.makeAssociationKey(assoc)); } return assocs; }
private Set revitalize(Set c) { Set result = new CompactHashSet(c.size()); Iterator iter = c.iterator(); while (iter.hasNext()) { Object o = iter.next(); result.add(revitalize(o)); } return result; }
public GlobalParseContext(TopicMapIF topicmap, LocatorIF base) { this.topicmap = topicmap; this.base = base; this.builder = topicmap.getBuilder(); this.prefixes = new HashMap<String, LocatorIF>(); this.templates = new HashMap<String, Template>(); this.counter = 0; this.include_uris = new CompactHashSet<LocatorIF>(); }
private Set findTransitiveClosure(QueryMatches result, int startcol, int goalcol, Object startval) { Set closure = new CompactHashSet(100); closure.add(startval); int before; do { before = closure.size(); addTransitively(result, startcol, goalcol, closure); } while (before < closure.size()); closure.remove(startval); // FIXME: this isn't a proper fix! return closure; }
private Set mapToObjectIds(Set objects) { if (objects == null) return null; Set objids = new CompactHashSet(objects.size()); Iterator it = objects.iterator(); while (it.hasNext()) { TMObjectIF obj = (TMObjectIF) it.next(); objids.add(obj.getObjectId()); } return objids; }
@Override protected Collection getClasses(TopicIF instance) { Set types = new CompactHashSet(); Iterator it = instance.getTypes().iterator(); while (it.hasNext()) types.addAll(getSupertypes((TopicIF) it.next())); return types; }
@Override protected Collection getInstances(TopicIF klass) { Set instances = new CompactHashSet(); Iterator it = getSubtypes(klass).iterator(); while (it.hasNext()) instances.addAll(index.getTopics((TopicIF) it.next())); return instances; }
private void init() { this.filter = null; this.exported = new CompactHashSet(); this.nsuris = new HashMap(); this.prefixes = new HashMap(); this.unassigned = new CompactHashSet(); addPrefix("iso", NS_ISO); addPrefix("xtm", NS_XTM); addPrefix("tm", NS_TM); }
@Override protected Collection getTypes() { Set types = new CompactHashSet(); Iterator it = index.getTopicTypes().iterator(); while (it.hasNext()) { TopicIF type = (TopicIF) it.next(); types.addAll(getSupertypes(type)); types.addAll(typeutils.getSubclasses(type)); } return types; }
@Override public Collection<AssociationRoleIF> getRolesByType(TopicIF roletype) { Collection<AssociationRoleIF> result = new CompactHashSet<AssociationRoleIF>(); for (AssociationRoleIF role : this.<AssociationRoleIF>loadCollectionField(Association.LF_roles)) { if (role.getType() == roletype) result.add(role); } return result; }
public SimpleFileFilter(String description, String ext1, String ext2) { this.description = description; this.extensions = new CompactHashSet(); addExtension(ext1); addExtension(ext2); }
@Override public Collection<AssociationRoleIF> getRolesByType(TopicIF roletype) { if (roletype == null) throw new NullPointerException("Role type must not be null."); CrossTopicMapException.check(roletype, this); Collection<AssociationRoleIF> result = new CompactHashSet<AssociationRoleIF>(); for (AssociationRoleIF role : this.<AssociationRoleIF>loadCollectionField(LF_roles)) if (role.getType() == roletype) result.add(role); return result; }
@Override public Collection<TopicIF> getRoleTypes() { Collection<TopicIF> result = new CompactHashSet<TopicIF>(); for (AssociationRoleIF role : this.<AssociationRoleIF>loadCollectionField(Association.LF_roles)) { TopicIF type = role.getType(); if (type != null) result.add(role.getType()); } return result; }
@Override public Collection<TopicIF> getRoleTypes() { Collection<TopicIF> result = new CompactHashSet<TopicIF>(); for (AssociationRoleIF role : this.<AssociationRoleIF>loadCollectionField(LF_roles)) { TopicIF type = role.getType(); if (type != null) result.add(role.getType()); } return result; }
private static Set<TopicIF> queryForSet(TopicMapIF tm, String query) throws InvalidQueryException { Set<TopicIF> set = new CompactHashSet<TopicIF>(); QueryProcessorIF proc = QueryUtils.getQueryProcessor(tm); QueryResultIF result = proc.execute(query); while (result.next()) set.add((TopicIF) result.getValue(0)); result.close(); return set; }