Package org.tensorics.core.tensor
Class ImmutableTensor.Builder<V>
- java.lang.Object
-
- org.tensorics.core.tensor.AbstractTensorBuilder<V>
-
- org.tensorics.core.tensor.ImmutableTensor.Builder<V>
-
- Type Parameters:
V
- the type of the values to be added
- All Implemented Interfaces:
TensorBuilder<V>
- Enclosing class:
- ImmutableTensor<V>
public static final class ImmutableTensor.Builder<V> extends AbstractTensorBuilder<V>
A builder for an immutable tensor.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableTensor<V>
build()
Builds anImmutableTensor
from all elements put before.java.util.Map<Position,V>
createEntriesMap()
Builds the entries map as anImmutableMap
.protected void
putIt(Position position, V value)
TensorBuilder<V>
remove(Position position)
-
-
-
Method Detail
-
createEntriesMap
public java.util.Map<Position,V> createEntriesMap()
Builds the entries map as anImmutableMap
.- Returns:
-
build
public ImmutableTensor<V> build()
Builds anImmutableTensor
from all elements put before.- Returns:
- an
ImmutableTensor
.
-
putIt
protected void putIt(Position position, V value)
- Specified by:
putIt
in classAbstractTensorBuilder<V>
-
remove
public TensorBuilder<V> remove(Position position)
-
-