CCNTime extends Timestamp implements ContentName.ComponentProvider { public CCNTime(long msec) { this((msec/1000) * 1000, (msec % 1000) * 1000000L); } CCNTime(long msec);  CCNTime(Timestamp timestamp);  CCNTime(Date time);  CCNTime(byte [] binaryTime12);  CCNTime(); protected  CCNTime(long msec, long nanos); protected  CCNTime(long binaryTimeAsLong, boolean unused); static CCNTime fromBinaryTimeAsLong(long binaryTimeAsLong); byte [] toBinaryTime(); long toBinaryTimeAsLong(); static long toBinaryTimeAsLong(long msec, long nanos); @Override void setTime(long msec); @Override void setNanos(int nanos); void addNanos(int nanos); void increment(int timeUnits); @Override boolean equals(Timestamp ts); @Override int compareTo(Date o); @Override int compareTo(Timestamp ts); @Override boolean before(Timestamp ts); @Override boolean after(Timestamp ts); @Override boolean before(Date when); @Override boolean after(Date when); static CCNTime now(); String toShortString(); final byte[] getComponent(); static final int NANOS_MAX; }
@Test public void testCCNTime() { Log.info(Log.FAC_TEST, "Starting testCCNTime"); for (int i=0; i < NUM_RUNS; ++i) { CCNTime now = new CCNTime(); Timestamp tn = new Timestamp(now.getTime()); tn.setNanos(now.getNanos()); testTimestamp(now, tn); } long msec = 1252088415990L; CCNTime m = new CCNTime(msec); Timestamp tm = new Timestamp(msec); Timestamp tn = new Timestamp(m.getTime()); tn.setNanos(m.getNanos()); Timestamp rm = roundTimestamp(tm); testTimestamp(m, tm); testTimestamp(m, rm); testTimestamp(m, tn); Log.info(Log.FAC_TEST, "Completed testCCNTime"); }