/** * Create the node memory. * @param state The state. * @return The node memory. */ public Object createNodeMemory(IOAVState state) { return state.isJavaIdentity() ? (Set)new MixedIdentityHashSet(state) : new LinkedHashSet(); }
/** * Create a set for holding object ids. */ protected Set createIdSet() { return state.isJavaIdentity() ? (Set)new IdentityHashSet() : new HashSet(); } }
/** * Create the node memory. * @param state The state. * @return The node memory. */ public Object createNodeMemory(IOAVState state) { return state.isJavaIdentity() ? (Set)new MixedIdentityHashSet(state) : new LinkedHashSet(); }
/** * Create a new constraint memory. */ public IndexedConstraintMemory(IOAVState state) { this.objects = state.isJavaIdentity() ? (Map) new MixedIdentityHashMap(state) : new HashMap(); this.tuples = state.isJavaIdentity() ? (Map) new MixedIdentityHashMap(state) : new HashMap(); this.ovalues = state.isJavaIdentity() ? (Map) new MixedIdentityHashMap(state) : new HashMap(); this.tvalues = new HashMap(); }
/** * Create a new constraint memory. */ public IndexedConstraintMemory(IOAVState state) { this.objects = state.isJavaIdentity() ? (Map) new MixedIdentityHashMap(state) : new HashMap(); this.tuples = state.isJavaIdentity() ? (Map) new MixedIdentityHashMap(state) : new HashMap(); this.ovalues = state.isJavaIdentity() ? (Map) new MixedIdentityHashMap(state) : new HashMap(); this.tvalues = new HashMap(); }
/** * Create a set for holding object ids. */ protected Set createIdSet() { return state.isJavaIdentity() ? (Set)new IdentityHashSet() : new HashSet(); } }
/** * Add a mapping for the key to the memory. * Multiples mappings for the same key will be stored in a set. */ public void addMapping(IOAVState state, Tuple key, Object value) { Set values = (Set)mappings.get(key); if(values==null) { values = state.isJavaIdentity() ? (Set)new MixedIdentityHashSet(state) : new HashSet(); mappings.put(key, values); } values.add(value); }
/** * Add a mapping for the key to the memory. * Multiples mappings for the same key will be stored in a set. */ public void addMapping(IOAVState state, Tuple key, Object value) { Set values = (Set)mappings.get(key); if(values==null) { values = state.isJavaIdentity() ? (Set)new MixedIdentityHashSet(state) : new HashSet(); mappings.put(key, values); } values.add(value); }
/** * Compute the intersection of two collections. * @param c1 The first collection. * @param c2 The second collection. * @return The intersection. */ protected Collection identityIntersection(IOAVState state, Collection c1, Collection c2) { if(c1==null || c2==null) return null; Collection ret = state.isJavaIdentity() ? (Set)new MixedIdentityHashSet(state) : new LinkedHashSet(); for(Iterator it=c1.iterator(); it.hasNext(); ) { Object o1 = it.next(); if(c2.contains(o1)) ret.add(o1); } return ret; }
/** * Compute the intersection of two collections. * @param c1 The first collection. * @param c2 The second collection. * @return The intersection. */ protected Collection identityIntersection(IOAVState state, Collection c1, Collection c2) { if(c1==null || c2==null) return null; Collection ret = state.isJavaIdentity() ? (Set)new MixedIdentityHashSet(state) : new LinkedHashSet(); for(Iterator it=c1.iterator(); it.hasNext(); ) { Object o1 = it.next(); if(c2.contains(o1)) ret.add(o1); } return ret; }
this.copy = state.isJavaIdentity() ? (Map)new IdentityHashMap() : new HashMap(); this.rootobjects = state.isJavaIdentity() ? (Set)new IdentityHashSet() : new HashSet(); setSynchronizator(synchronizator);
Set vals = state.isJavaIdentity() ? (Set)new MixedIdentityHashSet(state) : new HashSet(); vals.add(obs.get(i)); resulttuple = mem.getTuple(state, resulttuple, vals);
Set vals = state.isJavaIdentity() ? (Set)new MixedIdentityHashSet(state) : new HashSet(); vals.add(obs.get(i)); resulttuple = mem.getTuple(state, resulttuple, vals);