View Javadoc
1   package org.djunits.value.vfloat.matrix;
2   
3   import org.djunits.unit.TemperatureUnit;
4   import org.djunits.value.StorageType;
5   import org.djunits.value.ValueException;
6   import org.djunits.value.vfloat.scalar.FloatTemperature;
7   
8   /**
9    * Immutable FloatTemperature Matrix.
10   * <p>
11   * Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
12   * BSD-style license. See <a href="http://djunits.org/docs/license.html">DJUNITS License</a>.
13   * <p>
14   * $LastChangedDate: 2015-09-29 14:14:28 +0200 (Tue, 29 Sep 2015) $, @version $Revision: 73 $, by $Author: pknoppers $, initial
15   * version Sep 5, 2015 <br>
16   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
17   * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
18   */
19  public class FloatTemperatureMatrix
20          extends AbstractFloatMatrixRel<TemperatureUnit, FloatTemperatureMatrix, MutableFloatTemperatureMatrix, FloatTemperature>
21  {
22      /** */
23      private static final long serialVersionUID = 20151006L;
24  
25      /**
26       * Construct a new Relative Immutable FloatTemperatureMatrix.
27       * @param values float[][]; the values of the entries in the new Relative Immutable FloatTemperatureMatrix
28       * @param unit U; the unit of the new Relative Immutable FloatTemperatureMatrix
29       * @param storageType the data type to use (e.g., DENSE or SPARSE)
30       * @throws ValueException when values is null
31       */
32      public FloatTemperatureMatrix(final float[][] values, final TemperatureUnit unit, final StorageType storageType)
33              throws ValueException
34      {
35          super(values, unit, storageType);
36      }
37  
38      /**
39       * Construct a new Relative Immutable FloatTemperatureMatrix.
40       * @param values FloatScalar.Rel&lt;U&gt;[][]; the values of the entries in the new Relative Immutable
41       *            FloatTemperatureMatrix
42       * @param storageType the data type to use (e.g., DENSE or SPARSE)
43       * @throws ValueException when values has zero entries
44       */
45      public FloatTemperatureMatrix(final FloatTemperature[][] values, final StorageType storageType) throws ValueException
46      {
47          super(values, storageType);
48      }
49  
50      /**
51       * Construct a new Relative Immutable FloatTemperatureMatrix.
52       * @param data an internal data object
53       * @param unit the unit
54       */
55      FloatTemperatureMatrix(final FloatMatrixData data, final TemperatureUnit unit)
56      {
57          super(data, unit);
58      }
59  
60      /** {@inheritDoc} */
61      @Override
62      public final FloatTemperatureMatrix toDense()
63      {
64          return this.data.isDense() ? this : instantiateType(this.data.toDense(), getUnit());
65      }
66  
67      /** {@inheritDoc} */
68      @Override
69      public final FloatTemperatureMatrix toSparse()
70      {
71          return this.data.isSparse() ? this : instantiateType(this.data.toSparse(), getUnit());
72      }
73  
74      /** {@inheritDoc} */
75      @Override
76      protected final FloatTemperatureMatrix instantiateType(final FloatMatrixData fmd, final TemperatureUnit unit)
77      {
78          return new FloatTemperatureMatrix(fmd, unit);
79      }
80  
81      /** {@inheritDoc} */
82      @Override
83      protected final MutableFloatTemperatureMatrix instantiateMutableType(final FloatMatrixData fmd, final TemperatureUnit unit)
84      {
85          return new MutableFloatTemperatureMatrix(fmd, unit);
86      }
87  
88      /** {@inheritDoc} */
89      @Override
90      protected final FloatTemperature instantiateScalar(final float value, final TemperatureUnit unit)
91      {
92          return new FloatTemperature(value, unit);
93      }
94  
95  }