Package org.tensorics.core.tensor
Class AbstractScalar<V>
- java.lang.Object
-
- org.tensorics.core.tensor.AbstractTensor<V>
-
- org.tensorics.core.tensor.AbstractScalar<V>
-
- Type Parameters:
V
- the type of the value of the scalar
- Direct Known Subclasses:
ImmutableScalar
public abstract class AbstractScalar<V> extends AbstractTensor<V> implements Scalar<V>
A base class for scalars, that already guarantees the shape and the correct delegation of the get() methods to the value method.
-
-
Constructor Summary
Constructors Constructor Description AbstractScalar()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(Position position)
Returnstrue
if the tensoric object contains the given position,false
otherwise.V
get(java.lang.Object... coordinates)
V
get(Position position)
Shape
shape()
Retrieves the shape of the tensor.-
Methods inherited from class org.tensorics.core.tensor.AbstractTensor
equals, hashCode
-
-
-
-
Method Detail
-
get
public final V get(java.lang.Object... coordinates)
-
shape
public final Shape shape()
Description copied from interface:Tensor
Retrieves the shape of the tensor. As shape we understand simply the structure of a tensor: Its dimensions and the available positions.Implementations have to take care that the returned value here is never
null
.
-
-