|| (context != null && subject != null) || context != null) { IntArray fromKey = IntArray.createCSPOKey(subject, property, object, context); IntArray toKey = IntArray.createCSPOMaxKey(subject, property, object, context);
|| (context != null && subject != null) || context != null) { IntArray fromKey = IntArray.createCSPOKey(subject, property, object, context); IntArray toKey = IntArray.createCSPOMaxKey(subject, property, object, context);
/** * Removes the specified element from this set if it is present * (optional operation). More formally, removes an element <tt>e</tt> * such that * <tt>(o==null ? e==null : o.equals(e))</tt>, if * this set contains such an element. Returns <tt>true</tt> if this set * contained the element (or equivalently, if this set changed as a * result of the call). (This set will not contain the element once the * call returns.) * * @param o object to be removed from this set, if present * @return <tt>true</tt> if this set contained the specified element * @throws ClassCastException if the type of the specified element * is incompatible with this set (optional) * @throws NullPointerException if the specified element is null and this * set does not permit null elements (optional) * @throws UnsupportedOperationException if the <tt>remove</tt> operation * is not supported by this set */ @Override public synchronized boolean remove(Object o) { if(o instanceof Statement) { Statement triple = (Statement)o; indexSPOC.remove(IntArray.createSPOCKey(triple.getSubject(), triple.getPredicate(), triple.getObject(), triple.getContext())); indexCSPO.remove(IntArray.createCSPOKey(triple.getSubject(), triple.getPredicate(), triple.getObject(), triple.getContext())); } return data.remove(o); }
/** * Removes the specified element from this set if it is present * (optional operation). More formally, removes an element <tt>e</tt> * such that * <tt>(o==null ? e==null : o.equals(e))</tt>, if * this set contains such an element. Returns <tt>true</tt> if this set * contained the element (or equivalently, if this set changed as a * result of the call). (This set will not contain the element once the * call returns.) * * @param o object to be removed from this set, if present * @return <tt>true</tt> if this set contained the specified element * @throws ClassCastException if the type of the specified element * is incompatible with this set (optional) * @throws NullPointerException if the specified element is null and this * set does not permit null elements (optional) * @throws UnsupportedOperationException if the <tt>remove</tt> operation * is not supported by this set */ @Override public synchronized boolean remove(Object o) { if(o instanceof Statement) { Statement triple = (Statement)o; indexSPOC.remove(IntArray.createSPOCKey(triple.getSubject(), triple.getPredicate(), triple.getObject(), triple.getContext())); indexCSPO.remove(IntArray.createCSPOKey(triple.getSubject(), triple.getPredicate(), triple.getObject(), triple.getContext())); } return data.remove(o); }
public synchronized boolean add(Triple triple) { indexSPOC.put(IntArray.createSPOCKey(triple.getSubject(), triple.getPredicate(), triple.getObject(), triple.getContext()),triple); indexCSPO.put(IntArray.createCSPOKey(triple.getSubject(), triple.getPredicate(), triple.getObject(), triple.getContext()),triple); return data.add(triple);
public synchronized boolean add(Triple triple) { indexSPOC.put(IntArray.createSPOCKey(triple.getSubject(), triple.getPredicate(), triple.getObject(), triple.getContext()),triple); indexCSPO.put(IntArray.createCSPOKey(triple.getSubject(), triple.getPredicate(), triple.getObject(), triple.getContext()),triple); return data.add(triple);