public void initAdditions() { this.addedContextInitRules_ = null; this.addedContextRuleHeadByClassExpressions_ = new ArrayHashMap<ModifiableIndexedClassExpression, ChainableSubsumerRule>( 32); this.addedDefinitions_ = new ArrayHashMap<ModifiableIndexedClass, ModifiableIndexedClassExpression>( 32); this.addedDefinitionReasons_ = new ArrayHashMap<ModifiableIndexedClass, ElkAxiom>( 32); }
@Override public V put(K key, V value) { if (key == null) throw new NullPointerException(); V result = putKeyValue(keys, values, key, value); if (result == null && ++size == LinearProbing.getUpperSize(keys.length)) enlarge(); return result; }
/** * @param key * @return the collection of values associated with the given key, or * {@code null} if no value us associated */ public Collection<Value> getValues(Object key) { return super.get(key); }
@Override public V remove(Object key) { if (key == null) throw new NullPointerException(); V result = removeEntry(keys, values, key); if (result != null && --size == LinearProbing.getLowerSize(keys.length)) shrink(); return result; }
/** * Decreasing the capacity of the map */ private void shrink() { int oldCapacity = keys.length; if (oldCapacity <= LinearProbing.DEFAULT_INITIAL_CAPACITY) return; K oldKeys[] = keys; V oldValues[] = values; int newCapacity = oldCapacity >> 1; @SuppressWarnings("unchecked") K newKeys[] = (K[]) new Object[newCapacity]; @SuppressWarnings("unchecked") V newValues[] = (V[]) new Object[newCapacity]; for (int i = 0; i < oldCapacity; i++) { K key = oldKeys[i]; if (key != null) putKeyValue(newKeys, newValues, key, oldValues[i]); } this.keys = newKeys; this.values = newValues; }
@Override public V remove(Object key) { if (key == null) throw new NullPointerException(); V result = removeEntry(keys, values, key); if (result != null && --size == LinearProbing.getLowerSize(keys.length)) shrink(); return result; }
/** * Decreasing the capacity of the map */ private void shrink() { int oldCapacity = keys.length; if (oldCapacity <= LinearProbing.DEFAULT_INITIAL_CAPACITY) return; K oldKeys[] = keys; V oldValues[] = values; int newCapacity = oldCapacity >> 1; @SuppressWarnings("unchecked") K newKeys[] = (K[]) new Object[newCapacity]; @SuppressWarnings("unchecked") V newValues[] = (V[]) new Object[newCapacity]; for (int i = 0; i < oldCapacity; i++) { K key = oldKeys[i]; if (key != null) putKeyValue(newKeys, newValues, key, oldValues[i]); } this.keys = newKeys; this.values = newValues; }
AbstractObjectIntersectionFromConjunctRule(ChainableSubsumerRule tail) { super(tail); this.conjunctionsByConjunct_ = new ArrayHashMap<IndexedClassExpression, IndexedObjectIntersectionOf>( 4); }
@Override public V remove(Object key) { if (key == null) throw new NullPointerException(); V result = removeEntry(keys, values, key); if (result != null && --size == LinearProbing.getLowerSize(keys.length)) shrink(); return result; }
@Override public V put(K key, V value) { if (key == null) throw new NullPointerException(); V result = putKeyValue(keys, values, key, value); if (result == null && ++size == LinearProbing.getUpperSize(keys.length)) enlarge(); return result; }
/** * @param key * @return the collection of values associated with the given key, or * {@code null} if no value us associated */ public Collection<Value> getValues(Object key) { return super.get(key); }
/** * Decreasing the capacity of the map */ private void shrink() { int oldCapacity = keys.length; if (oldCapacity <= LinearProbing.DEFAULT_INITIAL_CAPACITY) return; K oldKeys[] = keys; V oldValues[] = values; int newCapacity = oldCapacity >> 1; @SuppressWarnings("unchecked") K newKeys[] = (K[]) new Object[newCapacity]; @SuppressWarnings("unchecked") V newValues[] = (V[]) new Object[newCapacity]; for (int i = 0; i < oldCapacity; i++) { K key = oldKeys[i]; if (key != null) putKeyValue(newKeys, newValues, key, oldValues[i]); } this.keys = newKeys; this.values = newValues; }
AbstractObjectIntersectionFromConjunctRule(ChainableSubsumerRule tail) { super(tail); this.conjunctionsByConjunct_ = new ArrayHashMap<IndexedClassExpression, IndexedObjectIntersectionOf>( 4); }
@Override public V put(K key, V value) { if (key == null) throw new NullPointerException(); V result = putKeyValue(keys, values, key, value); if (result == null && ++size == LinearProbing.getUpperSize(keys.length)) enlarge(); return result; }
/** * @param key * @return the collection of values associated with the given key, or * {@code null} if no value us associated */ public Collection<Value> getValues(Object key) { return super.get(key); }
/** * Increasing the capacity of the map */ private void enlarge() { int oldCapacity = keys.length; if (oldCapacity == LinearProbing.MAXIMUM_CAPACITY) throw new IllegalArgumentException( "Map cannot grow beyond capacity: " + LinearProbing.MAXIMUM_CAPACITY); K oldKeys[] = keys; V oldValues[] = values; int newCapacity = oldCapacity << 1; @SuppressWarnings("unchecked") K newKeys[] = (K[]) new Object[newCapacity]; @SuppressWarnings("unchecked") V newValues[] = (V[]) new Object[newCapacity]; for (int i = 0; i < oldCapacity; i++) { K key = oldKeys[i]; if (key != null) putKeyValue(newKeys, newValues, key, oldValues[i]); } this.keys = newKeys; this.values = newValues; }
public void initAdditions() { this.addedContextInitRules_ = null; this.addedContextRuleHeadByClassExpressions_ = new ArrayHashMap<ModifiableIndexedClassExpression, ChainableSubsumerRule>( 32); this.addedDefinitions_ = new ArrayHashMap<ModifiableIndexedClass, ModifiableIndexedClassExpression>( 32); this.addedDefinitionReasons_ = new ArrayHashMap<ModifiableIndexedClass, ElkAxiom>( 32); }