comparison src/org/qmul/eecs/c4dm/sia/model/NDimensionalObject.java @ 0:08675ab08e7f

New
author Steven Hargreaves <steve.harg@gmail.com>
date Sat, 29 Dec 2012 17:41:06 +0000
parents
children ffd47645ca13
comparison
equal deleted inserted replaced
-1:000000000000 0:08675ab08e7f
1 package org.qmul.eecs.c4dm.sia.model;
2
3 import java.util.Vector;
4
5 import org.qmul.eecs.c4dm.sia.exceptions.DimensionException;
6
7 public class NDimensionalObject {
8
9 private Vector<DimensionValue> dimensionValues;
10
11 public NDimensionalObject() {
12 super();
13 }
14
15 /**
16 * @return the dimensionValue
17 */
18 public Vector<DimensionValue> getDimensionValues() {
19 return dimensionValues;
20 }
21
22 /**
23 * @param dimensionValue the dimensionValue to set
24 */
25 public void setDimensionValues(Vector<DimensionValue> dimensionValues) {
26 this.dimensionValues = dimensionValues;
27 }
28
29 public double getDimensionValue(int dimension) throws DimensionException {
30 for (DimensionValue dv : this.getDimensionValues())
31 {
32 if (dv.getDimension() == dimension)
33 return dv.getValue();
34 }
35 throw new DimensionException("No value for dimension " + dimension);
36 }
37
38 }