@Test public void testSequence() { MongoSequence s = new MongoSequence(getDataSource().getMongoInstance(), db, coll, key); HashSet<String> set = new HashSet<String>(); for(int i = 0; i < 1000; i++) { String str = s.getNext(); Assert.assertFalse(set.contains(str)); set.add(str); } }
public String getNext() { String v = SixtyTwoBase.tenBaseToSixtyTwo(getNextFromDB()); char c = v.charAt(0); while ( c >= '0' && c <= '9') { v = SixtyTwoBase.tenBaseToSixtyTwo(getNextFromDB()); c = v.charAt(0); } return v; }
MongoSequence implements ISequence { public String getNext() { String v = SixtyTwoBase.tenBaseToSixtyTwo(getNextFromDB()); char c = v.charAt(0); while ( c >= '0' && c <= '9') { v = SixtyTwoBase.tenBaseToSixtyTwo(getNextFromDB()); c = v.charAt(0); } return v; } }
MongoSequence implements ISequence { public String getNext() { String v = SixtyTwoBase.tenBaseToSixtyTwo(getNextFromDB()); char c = v.charAt(0); while ( c >= '0' && c <= '9') { v = SixtyTwoBase.tenBaseToSixtyTwo(getNextFromDB()); c = v.charAt(0); } return v; } MongoSequence(Mongo mongo, String dbName, String collName, String key); }
MongoSequence implements ISequence { public String getNext() { String v = SixtyTwoBase.tenBaseToSixtyTwo(getNextFromDB()); char c = v.charAt(0); while ( c >= '0' && c <= '9') { v = SixtyTwoBase.tenBaseToSixtyTwo(getNextFromDB()); c = v.charAt(0); } return v; } MongoSequence(Mongo mongo, String dbName, String collName, String key); String getNext(); }
MongoSequence implements ISequence { public String getNext() { String v = SixtyTwoBase.tenBaseToSixtyTwo(getNextFromDB()); char c = v.charAt(0); while ( c >= '0' && c <= '9') { v = SixtyTwoBase.tenBaseToSixtyTwo(getNextFromDB()); c = v.charAt(0); } return v; } MongoSequence(Mongo mongo, String dbName, String collName, String key); String getNext();  }