Package org.tensorics.core.tensorbacked
Class SimpleTensorbackedBuilder<V,TB extends Tensorbacked<V>>
- java.lang.Object
-
- org.tensorics.core.tensorbacked.SimpleTensorbackedBuilder<V,TB>
-
- Type Parameters:
V
- the type of the values of the tensor (and thus also the tensor backed object)TB
- the type of the tensor backed object
- All Implemented Interfaces:
TensorbackedBuilder<V,TB>
public class SimpleTensorbackedBuilder<V,TB extends Tensorbacked<V>> extends java.lang.Object implements TensorbackedBuilder<V,TB>
A builder for tensor backed objects, which takes care that only positions which are compatible with the dimensions of the foreseen underlaying tensor are put into it. Internally, it uses a builder for a tensor, to which most of the methods are delegated. At build time, the tensor is encapsulated in the according tensor backed class.This class is not thread safe.
-
-
Method Summary
-
-
-
Method Detail
-
put
public final SimpleTensorbackedBuilder<V,TB> put(java.util.Map.Entry<Position,V> entry)
- Specified by:
put
in interfaceTensorbackedBuilder<V,TB extends Tensorbacked<V>>
-
put
public final SimpleTensorbackedBuilder<V,TB> put(Position position, V value)
- Specified by:
put
in interfaceTensorbackedBuilder<V,TB extends Tensorbacked<V>>
-
putAll
public final SimpleTensorbackedBuilder<V,TB> putAll(java.util.Set<java.util.Map.Entry<Position,V>> entries)
- Specified by:
putAll
in interfaceTensorbackedBuilder<V,TB extends Tensorbacked<V>>
-
putAll
public final SimpleTensorbackedBuilder<V,TB> putAll(Position position, java.util.Map<Position,V> entries)
- Specified by:
putAll
in interfaceTensorbackedBuilder<V,TB extends Tensorbacked<V>>
-
putAll
public final SimpleTensorbackedBuilder<V,TB> putAll(Position position, Tensor<V> tensor)
- Specified by:
putAll
in interfaceTensorbackedBuilder<V,TB extends Tensorbacked<V>>
-
putAll
public final SimpleTensorbackedBuilder<V,TB> putAll(Position position, Tensorbacked<V> tensorbacked)
- Specified by:
putAll
in interfaceTensorbackedBuilder<V,TB extends Tensorbacked<V>>
-
putAll
public final SimpleTensorbackedBuilder<V,TB> putAll(TB tensorBacked)
- Specified by:
putAll
in interfaceTensorbackedBuilder<V,TB extends Tensorbacked<V>>
-
putAll
public final SimpleTensorbackedBuilder<V,TB> putAll(Tensor<V> tensor)
- Specified by:
putAll
in interfaceTensorbackedBuilder<V,TB extends Tensorbacked<V>>
-
putAll
public final SimpleTensorbackedBuilder<V,TB> putAll(java.util.Map<Position,V> newEntries)
- Specified by:
putAll
in interfaceTensorbackedBuilder<V,TB extends Tensorbacked<V>>
-
remove
public final SimpleTensorbackedBuilder<V,TB> remove(Position position)
- Specified by:
remove
in interfaceTensorbackedBuilder<V,TB extends Tensorbacked<V>>
-
context
public final SimpleTensorbackedBuilder<V,TB> context(Position context)
- Specified by:
context
in interfaceTensorbackedBuilder<V,TB extends Tensorbacked<V>>
-
context
public final SimpleTensorbackedBuilder<V,TB> context(java.lang.Object... coordinates)
- Specified by:
context
in interfaceTensorbackedBuilder<V,TB extends Tensorbacked<V>>
-
build
public TB build()
Builds the tensor backed object, after all the content is set.- Specified by:
build
in interfaceTensorbackedBuilder<V,TB extends Tensorbacked<V>>
- Returns:
- a new instance of the tensor backed object, containing all the data as described after instantiating the builder.
-
-