@Override public String toString() { return "index:"+getName() ; } }
/** Insert a tuple - return true if it was really added, false if it was a duplicate */ @Override public final boolean add(Tuple<NodeId> tuple) { if ( Check ) { if ( tupleLength != tuple.len() ) throw new TDBException(String.format("Mismatch: tuple length %d / index for length %d", tuple.len(), tupleLength)) ; } return performAdd(tuple) ; } /** Delete a tuple - return true if it was deleted, false if it didn't exist */
/** Delete a tuple - return true if it was deleted, false if it didn't exist */ @Override public final boolean delete(Tuple<NodeId> tuple) { if ( Check ) { if ( tupleLength != tuple.len() ) throw new TDBException(String.format("Mismatch: tuple length %d / index for length %d", tuple.len(), tupleLength)) ; } return performDelete(tuple) ; }
/** Find all matching tuples - a slot of NodeId.NodeIdAny (or null) means match any. * Input pattern in natural order, not index order. */ @Override public final Iterator<Tuple<NodeId>> find(Tuple<NodeId> pattern) { if ( Check ) { if ( tupleLength != pattern.len() ) throw new TDBException(String.format("Mismatch: tuple length %d / index for length %d", pattern.len(), tupleLength)) ; } // null to NodeId.NodIdAny ?? return performFind(pattern) ; }
@Override public final int weight(Tuple<NodeId> pattern) { for ( int i = 0 ; i < tupleLength ; i++ ) { NodeId X = colMap.fetchSlot(i, pattern) ; if ( undef(X) ) // End of fixed terms return i ; } return tupleLength ; }