public boolean apply(long key) { list.add(key); return true; } }
public boolean apply(long key) { list.add(key); return true; } }
public boolean apply(long key) { list.add(key); return true; } });
public boolean apply(long key, Object value) { if (condition.apply(key,value)) { keyList.add(key); valueList.add(value); } return true; } }
public boolean apply(long key, Object value) { if (condition.apply(key,value)) { keyList.add(key); valueList.add(value); } return true; } }
public boolean apply(long key, Object value) { if (condition.apply(key, value)) { keyList.add(key); valueList.add(value); } return true; } });
private void addVarNamePair(int varName1, long key) { LongArrayList pairs = (LongArrayList) varNameToPairsIndex.get(varName1); if (pairs == null) { pairs = new LongArrayList(new long[]{ key }); varNameToPairsIndex.put(varName1, pairs); } else { pairs.add(key); } } });
/** * Tests the methods of this class. * To do benchmarking, comment the lines printing stuff to the console. */ public static void test(long n, long N) { RandomSamplingAssistant assistant = new RandomSamplingAssistant(n,N,null); cern.colt.list.LongArrayList sample = new cern.colt.list.LongArrayList((int)n); cern.colt.Timer timer = new cern.colt.Timer().start(); for (long i=0; i<N; i++) { if (assistant.sampleNextElement()) { sample.add(i); } } timer.stop().display(); System.out.println("sample="+sample); System.out.println("Good bye.\n"); } /**
/** * Tests the methods of this class. * To do benchmarking, comment the lines printing stuff to the console. */ public static void test(long n, long N) { RandomSamplingAssistant assistant = new RandomSamplingAssistant(n,N,null); cern.colt.list.LongArrayList sample = new cern.colt.list.LongArrayList((int)n); cern.colt.Timer timer = new cern.colt.Timer().start(); for (long i=0; i<N; i++) { if (assistant.sampleNextElement()) { sample.add(i); } } timer.stop().display(); System.out.println("sample="+sample); System.out.println("Good bye.\n"); } /**
keyList.add(table[i]); valueList.add(values[i]);
keyList.add(table[i]); valueList.add(values[i]);
keyList.add(table[i]); valueList.add(values[i]);
tiers.add(formulaAndTierIndices);