/** * Does a proper compare on the ids * * @param id1 * @param id2 * @return 0 if equal else a positive if id1 is > id2 ... */ public static int compare(String id1, String id2) { int result = -1; String seed1 = IdGenerator.getSeedFromId(id1); String seed2 = IdGenerator.getSeedFromId(id2); if (seed1 != null && seed2 != null) { result = seed1.compareTo(seed2); if (result == 0) { long count1 = IdGenerator.getSequenceFromId(id1); long count2 = IdGenerator.getSequenceFromId(id2); result = (int)(count1 - count2); } } return result; }
public void rollback(final String id) { String seed = IdGenerator.getSeedFromId(id); if (seed != null) { BitArrayBin bab = map.get(seed); if (bab != null) { long index = IdGenerator.getSequenceFromId(id); bab.setBit(index, false); modified = true; } } }
/** * Check the message id is in order * * @param id * * @return true if the id is in order */ public boolean isInOrder(final String id) { boolean answer = true; if (id != null) { String seed = IdGenerator.getSeedFromId(id); if (seed != null) { BitArrayBin bab = map.get(seed); if (bab != null) { long index = IdGenerator.getSequenceFromId(id); answer = bab.isInOrder(index); modified = true; } } } return answer; }
/** * checks whether this messageId has been seen before and adds this * messageId to the list * * @param id * @return true if the message is a duplicate */ public boolean isDuplicate(String id) { boolean answer = false; String seed = IdGenerator.getSeedFromId(id); if (seed != null) { BitArrayBin bab = map.get(seed); if (bab == null) { bab = new BitArrayBin(auditDepth); map.put(seed, bab); modified = true; } long index = IdGenerator.getSequenceFromId(id); if (index >= 0) { answer = bab.setBit(index, true); modified = true; } } return answer; }
/** * Does a proper compare on the ids * * @param id1 * @param id2 * @return 0 if equal else a positive if id1 is > id2 ... */ public static int compare(String id1, String id2) { int result = -1; String seed1 = IdGenerator.getSeedFromId(id1); String seed2 = IdGenerator.getSeedFromId(id2); if (seed1 != null && seed2 != null) { result = seed1.compareTo(seed2); if (result == 0) { long count1 = IdGenerator.getSequenceFromId(id1); long count2 = IdGenerator.getSequenceFromId(id2); result = (int)(count1 - count2); } } return result; }
/** * Does a proper compare on the ids * * @param id1 * @param id2 * @return 0 if equal else a positive if id1 is > id2 ... */ public static int compare(String id1, String id2) { int result = -1; String seed1 = IdGenerator.getSeedFromId(id1); String seed2 = IdGenerator.getSeedFromId(id2); if (seed1 != null && seed2 != null) { result = seed1.compareTo(seed2); if (result == 0) { long count1 = IdGenerator.getSequenceFromId(id1); long count2 = IdGenerator.getSequenceFromId(id2); result = (int)(count1 - count2); } } return result; }
/** * Does a proper compare on the ids * * @param id1 * @param id2 * @return 0 if equal else a positive if id1 is > id2 ... */ public static int compare(String id1, String id2) { int result = -1; String seed1 = IdGenerator.getSeedFromId(id1); String seed2 = IdGenerator.getSeedFromId(id2); if (seed1 != null && seed2 != null) { result = seed1.compareTo(seed2); if (result == 0) { long count1 = IdGenerator.getSequenceFromId(id1); long count2 = IdGenerator.getSequenceFromId(id2); result = (int)(count1 - count2); } } return result; }
/** * Does a proper compare on the ids * * @param id1 * @param id2 * @return 0 if equal else a positive if id1 is > id2 ... */ public static int compare(String id1, String id2) { int result = -1; String seed1 = IdGenerator.getSeedFromId(id1); String seed2 = IdGenerator.getSeedFromId(id2); if (seed1 != null && seed2 != null) { result = seed1.compareTo(seed2); if (result == 0) { long count1 = IdGenerator.getSequenceFromId(id1); long count2 = IdGenerator.getSequenceFromId(id2); result = (int)(count1 - count2); } } return result; }
public void rollback(final String id) { String seed = IdGenerator.getSeedFromId(id); if (seed != null) { BitArrayBin bab = map.get(seed); if (bab != null) { long index = IdGenerator.getSequenceFromId(id); bab.setBit(index, false); modified = true; } } }
public void rollback(final String id) { String seed = IdGenerator.getSeedFromId(id); if (seed != null) { BitArrayBin bab = map.get(seed); if (bab != null) { long index = IdGenerator.getSequenceFromId(id); bab.setBit(index, false); modified = true; } } }
public void rollback(final String id) { String seed = IdGenerator.getSeedFromId(id); if (seed != null) { BitArrayBin bab = map.get(seed); if (bab != null) { long index = IdGenerator.getSequenceFromId(id); bab.setBit(index, false); modified = true; } } }
/** * Check the message id is in order * * @param id * * @return true if the id is in order */ public boolean isInOrder(final String id) { boolean answer = true; if (id != null) { String seed = IdGenerator.getSeedFromId(id); if (seed != null) { BitArrayBin bab = map.get(seed); if (bab != null) { long index = IdGenerator.getSequenceFromId(id); answer = bab.isInOrder(index); modified = true; } } } return answer; }
/** * Check the message id is in order * @param id * @return */ public boolean isInOrder(final String id) { boolean answer = true; if (id != null) { String seed = IdGenerator.getSeedFromId(id); if (seed != null) { BitArrayBin bab = map.get(seed); if (bab != null) { long index = IdGenerator.getSequenceFromId(id); answer = bab.isInOrder(index); } } } return answer; }
/** * Check the message id is in order * * @param id * * @return true if the id is in order */ public boolean isInOrder(final String id) { boolean answer = true; if (id != null) { String seed = IdGenerator.getSeedFromId(id); if (seed != null) { BitArrayBin bab = map.get(seed); if (bab != null) { long index = IdGenerator.getSequenceFromId(id); answer = bab.isInOrder(index); modified = true; } } } return answer; }
/** * Check the message id is in order * * @param id * * @return true if the id is in order */ public boolean isInOrder(final String id) { boolean answer = true; if (id != null) { String seed = IdGenerator.getSeedFromId(id); if (seed != null) { BitArrayBin bab = map.get(seed); if (bab != null) { long index = IdGenerator.getSequenceFromId(id); answer = bab.isInOrder(index); modified = true; } } } return answer; }
/** * checks whether this messageId has been seen before and adds this * messageId to the list * * @param id * @return true if the message is a duplicate */ public boolean isDuplicate(String id) { boolean answer = false; String seed = IdGenerator.getSeedFromId(id); if (seed != null) { BitArrayBin bab = map.get(seed); if (bab == null) { bab = new BitArrayBin(auditDepth); map.put(seed, bab); modified = true; } long index = IdGenerator.getSequenceFromId(id); if (index >= 0) { answer = bab.setBit(index, true); modified = true; } } return answer; }
/** * checks whether this messageId has been seen before and adds this * messageId to the list * * @param id * @return true if the message is a duplicate */ public boolean isDuplicate(String id) { boolean answer = false; String seed = IdGenerator.getSeedFromId(id); if (seed != null) { BitArrayBin bab = map.get(seed); if (bab == null) { bab = new BitArrayBin(auditDepth); map.put(seed, bab); modified = true; } long index = IdGenerator.getSequenceFromId(id); if (index >= 0) { answer = bab.setBit(index, true); modified = true; } } return answer; }
/** * checks whether this messageId has been seen before and adds this * messageId to the list * * @param id * @return true if the message is a duplicate */ public boolean isDuplicate(String id) { boolean answer = false; String seed = IdGenerator.getSeedFromId(id); if (seed != null) { BitArrayBin bab = map.get(seed); if (bab == null) { bab = new BitArrayBin(auditDepth); map.put(seed, bab); } long index = IdGenerator.getSequenceFromId(id); if (index >= 0) { answer = bab.setBit(index, true); } } return answer; }
/** * checks whether this messageId has been seen before and adds this * messageId to the list * * @param id * @return true if the message is a duplicate */ public boolean isDuplicate(String id) { boolean answer = false; String seed = IdGenerator.getSeedFromId(id); if (seed != null) { BitArrayBin bab = map.get(seed); if (bab == null) { bab = new BitArrayBin(auditDepth); map.put(seed, bab); modified = true; } long index = IdGenerator.getSequenceFromId(id); if (index >= 0) { answer = bab.setBit(index, true); modified = true; } } return answer; }