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