01: /********************************************************************************
02: * CruiseControl, a Continuous Integration Toolkit
03: * Copyright (c) 2001, ThoughtWorks, Inc.
04: * 200 E. Randolph, 25th Floor
05: * Chicago, IL 60601 USA
06: * All rights reserved.
07: *
08: * Redistribution and use in source and binary forms, with or without
09: * modification, are permitted provided that the following conditions
10: * are met:
11: *
12: * + Redistributions of source code must retain the above copyright
13: * notice, this list of conditions and the following disclaimer.
14: *
15: * + Redistributions in binary form must reproduce the above
16: * copyright notice, this list of conditions and the following
17: * disclaimer in the documentation and/or other materials provided
18: * with the distribution.
19: *
20: * + Neither the name of ThoughtWorks, Inc., CruiseControl, nor the
21: * names of its contributors may be used to endorse or promote
22: * products derived from this software without specific prior
23: * written permission.
24: *
25: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
29: * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32: * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33: * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34: * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35: * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36: ********************************************************************************/package net.sourceforge.cruisecontrol.sourcecontrols.accurev;
37:
38: /**
39: * Implements a "numeric" time-spec (n or n.m) format.
40: *
41: * @author <a href="mailto:Nicola_Orru@scee.net">Nicola Orru'</a>
42: */
43: public final class TransactionNumberTimespec extends Timespec {
44: /**
45: * Convenience constant containing the KewordTimespec "highest"
46: */
47: public static final KeywordTimespec HIGHEST = new KeywordTimespec(
48: "highest");
49: private int transaction;
50:
51: /**
52: * Creates a new TransactionNumberTimespec with no count (n form)
53: *
54: * @param transaction the transaction number
55: */
56: public TransactionNumberTimespec(int transaction) {
57: this .transaction = transaction;
58: }
59:
60: /**
61: * Creates a new TransactionNumberTimespec with the given count (n.m form)
62: *
63: * @param transaction the transaction number
64: * @param count the count
65: */
66: public TransactionNumberTimespec(int transaction, int count) {
67: super (count);
68: this .transaction = transaction;
69: }
70:
71: /**
72: * formats the transaction (main) part onto a String
73: *
74: * @return the transaction number as a string
75: */
76: public String format() {
77: return Integer.toString(transaction);
78: }
79: }
|