public XTM2ContentHandler(TopicMapStoreFactoryIF store_factory, LocatorIF doc_address) { this(store_factory, doc_address, new CompactHashSet()); }
@Override public boolean addAll(Collection coll) { synchronized(this) {return super.addAll(coll);} } @Override
@Override public boolean add(Object o) { synchronized(this) {return super.add(o);} } @Override
@Override public boolean contains(Object o) { synchronized(this) {return super.contains((E)o);} } @Override
@Override public void clear() { synchronized(this) {super.clear();} } @Override
@Override public boolean containsAll(Collection coll) { synchronized(this) {return super.containsAll(coll);} } @Override
public UniqueSet(Collection<E> c) { super(c.size() < INITIAL_SIZE ? INITIAL_SIZE : c.size()); Iterator<E> e = c.iterator(); while (e.hasNext()) { super.add(e.next()); } }
public SimpleFileFilter(String description) { this.description = description; this.extensions = new CompactHashSet(); }
public UniqueSet(UniqueSet<E> s1, UniqueSet<E> s2) { super((s1.objects.length > s2.objects.length ? s1.objects.length : s2.objects.length)); UniqueSet<E> set1; UniqueSet<E> set2; if (s1.elements > s2.elements) { set1 = s1; set2 = s2; } else { set1 = s2; set2 = s1; } // clone members System.arraycopy(set1.objects, 0, this.objects, 0, set1.objects.length); this.elements = set1.elements; this.freecells = set1.freecells; // add other sets elements individually Iterator<E> iter = set2.iterator(); for (int i=0; i < set2.elements; i++) { super.add(iter.next()); } }
/** * Constructs a new set containing the elements in the specified * collection. * * @param c the collection whose elements are to be placed into this set. */ public CompactHashSet(Collection<E> c) { this(c.size()); addAll(c); }
protected Collection<V> createCollection() { return new CompactHashSet<V>(); }
/** * INTERNAL: Get the internal representation of a given set. The * initial reference count is 1. */ public UniqueSet<E> get(Set<E> set) { UniqueSet<E> set2; //! if (set.isEmpty()) { //! // Replace with EMPTY_SET if empty. //! set2 = EMPTY_SET; //! if (set2.refcount == 0) super.add(EMPTY_SET); //! } else { // Look up candidate set in set pool set2 = (UniqueSet<E>)lookup(set); if (set2 == null) { // Create new set if no existing set found // FIXME: Could use 'set' variable if compatible and manageable set2 = new UniqueSet<E>(set); super.add(set2); } //!} set2.refcount++; return set2; }
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>(); }
super.add(newset); return newset; } else { // was there already
/** * PUBLIC: Initializes the exporter. */ public XTMFragmentExporter() { export_srclocs = true; locator_handler = null; reifiers = new ArrayList(); alreadyExported = new CompactHashSet(); }
super.add(newset); return newset; } else { // was there already
public TologQuery() { clauses = new ArrayList(); orderBy = new ArrayList(); countVariables = new CompactHashSet<Variable>(); variables = new ArrayList(); orderDescending = new CompactHashSet<String>(); limit = -1; offset = -1; }
/** * INTERNAL: Finds the variables inside the rule that were bound to * literals outside the rule. * @param params The parameters to the rule given in its declaration * (an array of Variable objects) * @param extarguments The parameters passed to this invocation */ private static Set getLiteralVariables(Object[] params, Object[] extarguments) { Set litvars = new CompactHashSet(); for (int ix = 0; ix < params.length; ix++) if (!(extarguments[ix] instanceof Variable)) litvars.add(params[ix]); return litvars; }
private Set makeSet(String[] open) { Set nodes = new CompactHashSet(open.length * 2); for (int ix = 0; ix < open.length; ix++) { if (open[ix].equals("")) continue; TMObjectIF object = getObjectById(open[ix]); // if the ID list in the session is out of date, because the // topic map was reloaded or changed in the meantime, we may // get non-existent topics or non-topics back here. if this // happens we assume we have out-of-date info and stop if (object == null || !(object instanceof TopicIF)) return new CompactHashSet(); nodes.add(object); } return nodes; }