1 10 11 package org.mmbase.applications.community.modules; 12 13 import java.util.Date ; 14 15 26 27 public class TimeStamp extends Date 28 { 29 30 33 private int low = 0; 34 37 private int high = 0; 38 39 42 public TimeStamp() 43 { 45 this(System.currentTimeMillis()); 46 } 47 48 52 public TimeStamp(long time) 53 { 54 setTime(time); 55 low = (int)(time & 0xFFFFFFFFL); 56 high = (int)(time >>> 32); 57 } 58 59 65 public TimeStamp(Integer low, Integer high) 66 { 67 this(); if ((low!=null) && (high!=null)) 69 setTimeLowHigh(low.intValue(), high.intValue()); 70 } 71 72 public TimeStamp(int low, int high) 73 { 74 setTimeLowHigh(low, high); 75 } 76 77 83 private void setTimeLowHigh(int low, int high) 84 { 88 89 long highlong = high; 90 highlong <<= 32; 91 long time; 92 if (low<0) { long lowlong = low; 94 lowlong &= 0xFFFFFFFFL; 95 time = highlong + lowlong; 96 } 97 else { 98 time = highlong + low; 99 } 100 setTime(time); 101 } 102 103 107 public int lowIntegerValue() 108 { 109 return low; 110 } 111 112 116 public int highIntegerValue() 117 { 118 return high; 119 } 120 } 121 | Popular Tags |