KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > excalibur > instrument > manager > InstrumentSampleSnapshot


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14  * implied.
15  *
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */

19
20 package org.apache.excalibur.instrument.manager;
21
22 import java.io.Serializable JavaDoc;
23
24 /**
25  *
26  * @author <a HREF="mailto:dev@avalon.apache.org">Avalon Development Team</a>
27  */

28 public class InstrumentSampleSnapshot
29     implements Serializable JavaDoc
30 {
31     static final long serialVersionUID = -3284372358291073513L;
32     
33     /** The name used to reference the InstrumentSample. */
34     private String JavaDoc m_InstrumentSampleName;
35     
36     /** The interval between each sample. */
37     private long m_interval;
38     
39     /** The number of samples in the InstrumentSample. */
40     private int m_size;
41     
42     /** The time that the last sample starts. */
43     private long m_time;
44     
45     /** The samples as an array of integers. */
46     private int[] m_samples;
47     
48     /** State Version. */
49     private int m_stateVersion;
50     
51     /*---------------------------------------------------------------
52      * Constructors
53      *-------------------------------------------------------------*/

54     /**
55      * @param InstrumentSampleName The name used to reference the InstrumentSample.
56      * @param interval The interval between each sample.
57      * @param size The number of samples in the InstrumentSample.
58      * @param time The time that the last sample starts.
59      * @param samples The samples as an array of integers.
60      * @param stateVersion The current state version of the sample.
61      */

62     public InstrumentSampleSnapshot( String JavaDoc InstrumentSampleName,
63                                      long interval,
64                                      int size,
65                                      long time,
66                                      int[] samples,
67                                      int stateVersion )
68     {
69         m_InstrumentSampleName = InstrumentSampleName;
70         m_interval = interval;
71         m_size = size;
72         m_time = time;
73         m_samples = samples;
74         m_stateVersion = stateVersion;
75     }
76     
77     /*---------------------------------------------------------------
78      * Methods
79      *-------------------------------------------------------------*/

80     /**
81      * Returns the name used to reference the InstrumentSample.
82      *
83      * @return The name used to reference the InstrumentSample.
84      */

85     public String JavaDoc getInstrumentSampleName()
86     {
87         return m_InstrumentSampleName;
88     }
89     
90     /**
91      * Returns the interval, in milliseconds, between each sample.
92      *
93      * @return The interval between each sample.
94      */

95     public long getInterval()
96     {
97         return m_interval;
98     }
99     
100     /**
101      * Returns the number of samples in the InstrumentSample.
102      *
103      * @return The number of samples in the InstrumentSample.
104      */

105     public int getSize()
106     {
107         return m_size;
108     }
109     
110     /**
111      * Returns the time that the last sample starts.
112      *
113      * @return The time that the last sample starts.
114      */

115     public long getTime()
116     {
117         return m_time;
118     }
119     
120     /**
121      * Returns the samples as an array of integers. The sample at index 0
122      * will be the oldest. The end of the array is the newest.
123      *
124      * @return The samples as an array of integers.
125      */

126     public int[] getSamples()
127     {
128         return m_samples;
129     }
130     
131     /**
132      * Returns the stateVersion of the sample. The state version will be
133      * incremented each time any of the configuration of the sample is
134      * modified.
135      * Clients can use this value to tell whether or not anything has
136      * changed without having to do an exhaustive comparison.
137      *
138      * @return The state version of the sample.
139      */

140     public int getStateVersion()
141     {
142         return m_stateVersion;
143     }
144 }
145
146
Popular Tags