@Test public void testToLong() throws Exception { Timestamp t = new Timestamp(); long tLong = t.toLong(); Timestamp t2 = t.add(1, (short)0); long t2Long = t2.toLong(); Timestamp t3 = t.add(0, (short)1); long t3Long = t3.toLong(); assertTrue(tLong < t2Long); assertTrue(tLong < t3Long); Timestamp tRecon = new Timestamp(tLong); Timestamp t2Recon = new Timestamp(t2Long); Timestamp t3Recon = new Timestamp(t3Long); assertTrue(t.getWallTime() == tRecon.getWallTime()); assertTrue(t.getLogical() == tRecon.getLogical()); assertTrue(t2.getWallTime() == t2Recon.getWallTime()); assertTrue(t2.getLogical() == t2Recon.getLogical()); assertTrue(t3.getWallTime() == t3Recon.getWallTime()); assertTrue(t3.getLogical() == t3Recon.getLogical()); }
public long toLong() { long longRepresentation = this.wallTime; longRepresentation = longRepresentation << 16; longRepresentation = (longRepresentation | (long)this.logical); return longRepresentation; }
Timestamp implements Comparable<Timestamp>, Cloneable { public long toLong() { long longRepresentation = this.wallTime; longRepresentation = longRepresentation << 16; longRepresentation = (longRepresentation | (long)this.logical); return longRepresentation; } }
Timestamp implements Comparable<Timestamp>, Cloneable { public long toLong() { long longRepresentation = this.wallTime; longRepresentation = longRepresentation << 16; longRepresentation = (longRepresentation | (long)this.logical); return longRepresentation; } Timestamp();  Timestamp(long wallTime, short logical);  Timestamp(long t); }
Timestamp implements Comparable<Timestamp>, Cloneable { public long toLong() { long longRepresentation = this.wallTime; longRepresentation = longRepresentation << 16; longRepresentation = (longRepresentation | (long)this.logical); return longRepresentation; } Timestamp();  Timestamp(long wallTime, short logical);  Timestamp(long t); Timestamp clone(); Timestamp add(Timestamp t); Timestamp add(long wallTime, short logical); long getWallTime(); void setWallTime(long wallTime); short getLogical(); void setLogical(short logical); void incrementLogical(); void resetLogical(); long toLong(); int compareTo(Timestamp o); String toString(); }
Timestamp implements Comparable<Timestamp>, Cloneable { public long toLong() { long longRepresentation = this.wallTime; longRepresentation = longRepresentation << 16; longRepresentation = (longRepresentation | (long)this.logical); return longRepresentation; } Timestamp();  Timestamp(long wallTime, short logical);  Timestamp(long t); Timestamp clone(); Timestamp add(Timestamp t); Timestamp add(long wallTime, short logical); long getWallTime(); void setWallTime(long wallTime); short getLogical(); void setLogical(short logical); void incrementLogical(); void resetLogical(); long toLong(); int compareTo(Timestamp o); String toString();  }