KickJava   Java API By Example, From Geeks To Geeks.

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


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
14 /**
15  * @since 3.1
16  */

17 public class Scalar {
18     private Dim fDimension;
19     private long fMagnitude;
20     
21     public Scalar(Dim dimension, long extent) {
22         fDimension= dimension;
23         fMagnitude= extent;
24     }
25     
26     public Dim getDimension() {
27         return fDimension;
28     }
29     
30     public long getMagnitude() {
31         return fMagnitude;
32     }
33     
34     public String JavaDoc toString() {
35         if (fDimension == null)
36             return "Scalar [dimension= " + fDimension + ", magnitude= " + fMagnitude + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
37
return "Scalar [" + fDimension.getName() + ": " + fDimension.getDisplayValue(this) + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
38
}
39 }
40
Popular Tags