Package org.tensorics.core.tensor
Interface MappableTensor<V>
-
- Type Parameters:
V
- the type of the values of the tensors
public interface MappableTensor<V> extends Tensor<V>
Enhances the tensor interface by a method to view the tensor as a map from position to values. This interface is intended to be used by utility methods in order to avoid unnecessary calls.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Map<Position,V>
asMap()
By implementing this method, a tensor can provide an efficient way to convert the tensor to a map from position to values.
-
-
-
Method Detail
-
asMap
java.util.Map<Position,V> asMap()
By implementing this method, a tensor can provide an efficient way to convert the tensor to a map from position to values. Implementing instances must follow the following contract:- this method must not return
null
- It is recommended to return either a copy or an immutable map. Despite clients are not supposed to manipulate the returned maps, it cannot be guaranteed and this could lead to unexpected results.
TensorInternals.mapFrom(Tensor)
(internal clients) orTensorics.mapFrom(Tensor)
(external clients)- Returns:
- a (preferrably immutable) map representing the content of the tensor
- See Also:
TensorInternals.mapFrom(Tensor)
,Tensorics.mapFrom(Tensor)
- this method must not return
-
-