Package com.yahoo.tensor
Class TensorType.Dimension
- java.lang.Object
-
- com.yahoo.tensor.TensorType.Dimension
-
- All Implemented Interfaces:
java.lang.Comparable<TensorType.Dimension>
- Direct Known Subclasses:
TensorType.IndexedBoundDimension
,TensorType.IndexedUnboundDimension
,TensorType.MappedDimension
- Enclosing class:
- TensorType
public abstract static class TensorType.Dimension extends java.lang.Object implements java.lang.Comparable<TensorType.Dimension>
A tensor dimension. Dimensions have the natural order of their names.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TensorType.Dimension.Type
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
compareTo(TensorType.Dimension other)
boolean
equals(java.lang.Object other)
int
hashCode()
static TensorType.Dimension
indexed(java.lang.String name)
static TensorType.Dimension
indexed(java.lang.String name, long size)
boolean
isIndexed()
Returns true if this is an indexed bound or unbound typeboolean
isMapped()
Returns true if this is of the mapped typestatic TensorType.Dimension
mapped(java.lang.String name)
java.lang.String
name()
abstract java.util.Optional<java.lang.Long>
size()
Returns the size of this dimension if it is bound, empty otherwiseabstract java.lang.String
toString()
abstract TensorType.Dimension.Type
type()
abstract TensorType.Dimension
withName(java.lang.String name)
Returns a copy of this with the name set to the given name
-
-
-
Method Detail
-
name
public final java.lang.String name()
-
size
public abstract java.util.Optional<java.lang.Long> size()
Returns the size of this dimension if it is bound, empty otherwise
-
type
public abstract TensorType.Dimension.Type type()
-
withName
public abstract TensorType.Dimension withName(java.lang.String name)
Returns a copy of this with the name set to the given name
-
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
public abstract java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
compareTo
public int compareTo(TensorType.Dimension other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<TensorType.Dimension>
-
indexed
public static TensorType.Dimension indexed(java.lang.String name, long size)
-
indexed
public static TensorType.Dimension indexed(java.lang.String name)
-
mapped
public static TensorType.Dimension mapped(java.lang.String name)
-
-