public static Record r(int v) { return RecordLib.intToRecord(v, RecordLib.TestRecordLength) ; }
public static int r(Record rec) { return RecordLib.recordToInt(rec) ; }
public static List<Integer> r(Iterator<Record> iter) { return RecordLib.toIntList(iter) ; }
public static int delete(Index index, int... vals) { int count = 0 ; for ( int v : vals ) { boolean b = index.delete(r(v)) ; if ( b ) count++ ; } return count ; }
public static Record intToRecord(int v) { return intToRecord(v, recordFactory) ; } public static Record intToRecord(int v, int recLen) { return intToRecord(v, new RecordFactory(recLen, 0)) ; }
public static int delete(Index index, int... vals) { int count = 0 ; for ( int v : vals ) { boolean b = index.delete(r(v)) ; if ( b ) count++ ; } return count ; }
public static List<Integer> toIntList(Iterator<Record> iter) { return Iter.toList(Iter.map(iter, item->recordToInt(item))) ; }
public static List<Record> intToRecord(int[] v) { return intToRecord(v, recordFactory) ; }
public int find(RecordBuffer rb, int v) { return rb.find(r(v)) ; }
public static void add(Index index, int... vals) { // System.out.println("Add: "+Arrays.toString(vals)) ; List<Record> x = intToRecord(vals, RecordLib.TestRecordLength) ; for ( Record r : x ) { // System.out.println(" Add: "+r) ; index.insert(r) ; } }
public int find(RecordBuffer rb, int v) { return rb.find(r(v)) ; }
public static void add(Index index, int... vals) { // System.out.println("Add: "+Arrays.toString(vals)) ; List<Record> x = intToRecord(vals, RecordLib.TestRecordLength) ; for ( Record r : x ) { // System.out.println(" Add: "+r) ; index.insert(r) ; } }
public static List<Record> intToRecord(int[] v, int recLen) { return intToRecord(v, new RecordFactory(recLen, 0)) ; }
private static void insert(BPTreeRecords bpr, int... values) { for ( int value : values ) { bpr.internalInsert(null, RecordLib.intToRecord(value)) ; } }
private static void delete(BPTreeRecords bpr, int... values) { for ( int value : values ) { delete(bpr, RecordLib.intToRecord(value)) ; } }
private static void insert(BPTreeRecords bpr, int... values) { for ( int value : values ) { bpr.internalInsert(null, RecordLib.intToRecord(value)) ; } }
private static void delete(BPTreeRecords bpr, int... values) { for ( int value : values ) { delete(bpr, RecordLib.intToRecord(value)) ; } }
private static Record search(BPTreeRecords bpr, int x) { return search(bpr, RecordLib.intToRecord(x)) ; }
private static RecordBuffer make(int n, int len) { RecordBuffer rb = new RecordBuffer(recordFactory, len) ; for ( int i = 0 ; i < n ; i++ ) { Record r = RecordLib.intToRecord(2*i+2) ; rb.add(r) ; } return rb ; } }
private static RecordBuffer make(int n, int len) { RecordBuffer rb = new RecordBuffer(recordFactory, len) ; for ( int i = 0 ; i < n ; i++ ) { Record r = RecordLib.intToRecord(2*i+2) ; rb.add(r) ; } return rb ; } }