KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > test > internal > performance > data > DataPoint


1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.test.internal.performance.data;
12
13 import java.util.Collection JavaDoc;
14 import java.util.Map JavaDoc;
15 import java.util.Set JavaDoc;
16
17
18 /**
19  * @since 3.1
20  */

21 public class DataPoint {
22     private int fStep;
23     private Map JavaDoc fScalars;
24     
25     public DataPoint(int step, Map JavaDoc values) {
26         fStep= step;
27         fScalars= values;
28     }
29     
30     public int getStep() {
31         return fStep;
32     }
33     
34     public Dim[] getDimensions() {
35         Set JavaDoc set= fScalars.keySet();
36         return (Dim[]) set.toArray(new Dim[set.size()]);
37     }
38     
39     public Collection JavaDoc getDimensions2() {
40         return fScalars.keySet();
41     }
42
43     public boolean contains(Dim dimension) {
44         return fScalars.containsKey(dimension);
45     }
46     
47     public Scalar[] getScalars() {
48         return (Scalar[]) fScalars.values().toArray(new Scalar[fScalars.size()]);
49     }
50     
51     public Scalar getScalar(Dim dimension) {
52         return (Scalar) fScalars.get(dimension);
53     }
54     
55     public String JavaDoc toString() {
56         return "DataPoint [step= " + fStep + ", #dimensions: " + fScalars.size() + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
57
}
58 }
59
Popular Tags