?? seq.java
字號:
package spApi;
import java.util.Date;
public class Seq
{
public static Class seqclass = new Seq().getClass();
private static long globalSeq_1;
private static int globalSeq_2;
private static int globalSeq_3;
private static int Min_Seq;
private static int Max_Seq;
private static Date original = new Date();
public Seq(int paramInt1, int paramInt2)
{
Min_Seq = paramInt1;
Max_Seq = paramInt2;
globalSeq_3 = Min_Seq; }
public Seq() {
Min_Seq = 0;
Max_Seq = 999999;
}
public void setNodeId(long paramLong)
{
globalSeq_1 = paramLong;
}
public long getGlobalSeq_1()
{
return globalSeq_1;
}
public int getGlobalSeq_2()
{
return globalSeq_2;
}
public int getGlobalSeq_3()
{
return globalSeq_3;
}
public static synchronized void computeSequence()
{
Date localDate = new Date();
if (globalSeq_3 == Max_Seq)
globalSeq_3 = Min_Seq;
else {
globalSeq_3 += 1;
}
globalSeq_2 = (localDate.getMonth() + 1) * 100000000 + localDate.getDate() * 1000000 +(localDate.getHours()+8) * 10000 + localDate.getMinutes() * 100 + localDate.getSeconds();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -