KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > archive > util > TimestampSerialno


1 /* TimestampSerialno
2 *
3 * $Id: TimestampSerialno.java,v 1.3 2006/08/01 02:43:33 stack-sf Exp $
4 *
5 * Created July 19th, 2006
6 *
7 * Copyright (C) 2006 Internet Archive.
8 *
9 * This file is part of the Heritrix web crawler (crawler.archive.org).
10 *
11 * Heritrix is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser Public License as published by
13 * the Free Software Foundation; either version 2.1 of the License, or
14 * any later version.
15 *
16 * Heritrix is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser Public License
22 * along with Heritrix; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 */

25 package org.archive.util;
26
27 /**
28  * Immutable data structure that holds a timestamp and an accompanying
29  * serial number.
30  *
31  * For Igor!
32  *
33  * @author stack
34  */

35 public class TimestampSerialno {
36     private final String JavaDoc ts;
37     private final int serialNumber;
38
39     public TimestampSerialno(String JavaDoc ts, int serialNo) {
40         this.ts = ts;
41         this.serialNumber = serialNo;
42     }
43     
44     public TimestampSerialno(int serialNo) {
45         this.ts = ArchiveUtils.get14DigitDate();
46         this.serialNumber = serialNo;
47     }
48
49     /**
50      * @return Returns the now.
51      */

52     public String JavaDoc getTimestamp() {
53         return this.ts;
54     }
55
56     /**
57      * @return Returns the serialNumber.
58      */

59     public int getSerialNumber() {
60         return this.serialNumber;
61     }
62 }
Popular Tags