📄 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 + -