public final class Position
extends java.lang.Object
implements java.io.Serializable
| Modifier | Constructor and Description |
|---|---|
protected |
Position(java.util.Set<?> coordinates) |
| Modifier and Type | Method and Description |
|---|---|
<CS> CS |
coordinateFor(java.lang.Class<CS> dimension) |
java.util.Set<?> |
coordinates() |
boolean |
covers(Position other)
Checks if this position covers the other position, meaning that the other position is a sub position of the
other.
|
java.util.Set<java.lang.Class<?>> |
dimensionSet()
Retrieves the dimensions of this position (i.e.
|
static Position |
empty() |
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
boolean |
isConsistentWith(java.util.Set<java.lang.Class<?>> dimensions)
Checks if the position is consistent with the given dimensions.
|
static Position |
of(java.lang.Iterable<?> coordinates)
Retrieves a position instance for the given coordinates.
|
static Position |
of(java.lang.Object... coordinates)
Retrieves a position instance, representing the given coordinates.
|
java.lang.String |
toString() |
public static Position of(java.lang.Iterable<?> coordinates)
coordinates - the coordinates for which to get the position instance.java.lang.IllegalArgumentException - in case the coordinates are not a valid set for creating a position.java.lang.NullPointerException - if the given coordinates are null@SafeVarargs public static Position of(java.lang.Object... coordinates)
of(Iterable).coordinates - the coordinates for which to retrieve a position instancejava.lang.IllegalArgumentException - in case the coordinates are not a valid set for creating a position.java.lang.NullPointerException - if the given coordinates array is nullof(Iterable)public static Position empty()
public <CS> CS coordinateFor(java.lang.Class<CS> dimension)
public java.util.Set<?> coordinates()
public java.util.Set<java.lang.Class<?>> dimensionSet()
NOTE! These dimensions may differ from the ones kept in the parent tensor!.
public boolean isConsistentWith(java.util.Set<java.lang.Class<?>> dimensions)
dimensions - the dimensions for which conformity has to be checked.true if the position is conform, false if not.public boolean covers(Position other)
other - the other position to compare withtrue if this position covers the other, false otherwisepublic java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object