Package com.yahoo.tensor
Class TensorType.Dimension
java.lang.Object
com.yahoo.tensor.TensorType.Dimension
- All Implemented Interfaces:
Comparable<TensorType.Dimension>
- Direct Known Subclasses:
TensorType.IndexedBoundDimension,TensorType.IndexedUnboundDimension,TensorType.MappedDimension
- Enclosing class:
- TensorType
public abstract static class TensorType.Dimension
extends Object
implements Comparable<TensorType.Dimension>
A tensor dimension.
Dimensions have the natural order of their names.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(TensorType.Dimension other) booleaninthashCode()static TensorType.Dimensionstatic TensorType.DimensionbooleanReturns true if this is an indexed bound or unbound typebooleanisMapped()Returns true if this is of the mapped typestatic TensorType.Dimensionfinal Stringname()size()Returns the size of this dimension if it is bound, empty otherwise Beware not use == !abstract StringtoString()abstract TensorType.Dimension.Typetype()abstract TensorType.DimensionReturns a copy of this with the name set to the given namewithSize(long size) Returns a copy of this with the size set to the given value
-
Method Details
-
name
-
size
Returns the size of this dimension if it is bound, empty otherwise Beware not use == != when comparing size. Use equals -
type
-
withName
Returns a copy of this with the name set to the given name -
withSize
Returns a copy of this with the size set to the given value -
isIndexed
public boolean isIndexed()Returns true if this is an indexed bound or unbound type -
isMapped
public boolean isMapped()Returns true if this is of the mapped type -
toString
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareToin interfaceComparable<TensorType.Dimension>
-
indexed
-
indexed
-
mapped
-