KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > admin > monitor > stats > StringStatisticImpl


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /*
25  * Copyright 2004-2005 Sun Microsystems, Inc. All rights reserved.
26  * Use is subject to license terms.
27  */

28
29 /*
30  * $Id: StringStatisticImpl.java,v 1.2 2005/12/25 03:52:27 tcfujii Exp $
31  * $Date: 2005/12/25 03:52:27 $
32  * $Revision: 1.2 $
33  */

34
35 package com.sun.enterprise.admin.monitor.stats;
36
37 /**
38  * A basic implementation of the StringStatistic Interface. All the instances
39  * of this class are immutable.
40  * @author Muralidhar Vempaty
41  * @author Kedar Mhaswade
42  * @since S1AS8.0
43  * @version 1.0
44  */

45 public final class StringStatisticImpl extends StatisticImpl implements StringStatistic {
46     
47     private final String JavaDoc strVal;
48     
49     /**
50      * Constructor
51      * @param str The current value of this statistic
52      * @param name The name of the statistic
53      * @param unit The unit of measurement for this statistic
54      * @param desc A brief description of the statistic
55      * @param startTime Time in milliseconds at which the measurement was started
56      * @param sampleTime Time at which the last measurement was done.
57      **/

58     public StringStatisticImpl(String JavaDoc str, String JavaDoc name, String JavaDoc unit,
59                                String JavaDoc desc, long startTime, long sampleTime) {
60         
61         super(name, unit, desc, startTime, sampleTime);
62         strVal = str;
63     }
64     
65     /**
66      * Returns the String value of the statistic.
67      */

68     public String JavaDoc getCurrent() {
69         return strVal;
70     }
71 }
72
Popular Tags