View Javadoc
1   package org.djunits.value.vfloat.matrix;
2   
3   import org.djunits.unit.AngleUnit;
4   import org.djunits.unit.DirectionUnit;
5   import org.djunits.value.StorageType;
6   import org.djunits.value.ValueException;
7   import org.djunits.value.vfloat.scalar.FloatDirection;
8   
9   /**
10   * Immutable FloatDirection 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 FloatDirectionMatrix extends AbstractFloatMatrixAbs<DirectionUnit, AngleUnit, FloatDirectionMatrix,
21          FloatAngleMatrix, MutableFloatDirectionMatrix, FloatDirection>
22  {
23      /** */
24      private static final long serialVersionUID = 20151003L;
25  
26      /**
27       * Construct a new Absolute Immutable FloatDirectionMatrix.
28       * @param values float[][]; the values of the entries in the new Absolute Immutable FloatDirectionMatrix
29       * @param unit U; the unit of the new Absolute Immutable FloatDirectionMatrix
30       * @param storageType the data type to use (e.g., DENSE or SPARSE)
31       * @throws ValueException when values is null
32       */
33      public FloatDirectionMatrix(final float[][] values, final DirectionUnit unit, final StorageType storageType)
34              throws ValueException
35      {
36          super(values, unit, storageType);
37      }
38  
39      /**
40       * Construct a new Absolute Immutable FloatDirectionMatrix.
41       * @param values FloatScalar.Rel&lt;U&gt;[][]; the values of the entries in the new Absolute Immutable FloatDirectionMatrix
42       * @param storageType the data type to use (e.g., DENSE or SPARSE)
43       * @throws ValueException when values has zero entries
44       */
45      public FloatDirectionMatrix(final FloatDirection[][] values, final StorageType storageType) throws ValueException
46      {
47          super(values, storageType);
48      }
49  
50      /**
51       * Construct a new Absolute Immutable FloatDirectionMatrix.
52       * @param data an internal data object
53       * @param unit the unit
54       */
55      FloatDirectionMatrix(final FloatMatrixData data, final DirectionUnit unit)
56      {
57          super(data, unit);
58      }
59  
60      /** {@inheritDoc} */
61      @Override
62      public final FloatDirectionMatrix toDense()
63      {
64          return this.data.isDense() ? this : instantiateTypeAbs(this.data.toDense(), getUnit());
65      }
66  
67      /** {@inheritDoc} */
68      @Override
69      public final FloatDirectionMatrix toSparse()
70      {
71          return this.data.isSparse() ? this : instantiateTypeAbs(this.data.toSparse(), getUnit());
72      }
73  
74      /** {@inheritDoc} */
75      @Override
76      protected final FloatDirectionMatrix instantiateTypeAbs(final FloatMatrixData fmd, final DirectionUnit unit)
77      {
78          return new FloatDirectionMatrix(fmd, unit);
79      }
80  
81      /** {@inheritDoc} */
82      @Override
83      protected final FloatAngleMatrix instantiateTypeRel(final FloatMatrixData fmd, final AngleUnit unit)
84      {
85          return new FloatAngleMatrix(fmd, unit);
86      }
87  
88      /** {@inheritDoc} */
89      @Override
90      protected final MutableFloatDirectionMatrix instantiateMutableType(final FloatMatrixData fmd, final DirectionUnit unit)
91      {
92          return new MutableFloatDirectionMatrix(fmd, unit);
93      }
94  
95      /** {@inheritDoc} */
96      @Override
97      protected final FloatDirection instantiateScalar(final float value, final DirectionUnit unit)
98      {
99          return new FloatDirection(value, unit);
100     }
101 
102 }