?? timestamper.java
字號(hào):
//$Id: Timestamper.java,v 1.5.2.2 2003/11/05 09:33:34 oneovthafew Exp $package net.sf.hibernate.cache;/** * Generates increasing identifiers (in a single VM only). * Not valid across multiple VMs. Identifiers are not necessarily * strictly increasing, but usually are. */public final class Timestamper { private static short counter = 0; private static long time; private static final int BIN_DIGITS = 12; public static final short ONE_MS = 1<<BIN_DIGITS; public static long next() { synchronized(Timestamper.class) { long newTime = System.currentTimeMillis() << BIN_DIGITS; if (time<newTime) { time = newTime; counter = 0; } else if (counter < ONE_MS - 1 ) { counter++; } return time + counter; } } private Timestamper() {}}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -