C
- the type of the (contravariant!) coordinatepublic class Covariant<C>
extends java.lang.Object
'Physical' vectors/quantities usually transform in such a way, that they transform inverse to the basis. For example, lets assume a vector of 3 values, representing karthesian coordinates in a certain base. If now the basis vectors would be multiplied by a factor, the values of the vector would have to be divided by the same factor. This transformation property is called 'contravariance'.
If the vectors would transform in the same way as the basis, we would say the vector (tensor in that direction) transforms 'covariant'. This is for example the case for tensors that represent transformations themselves.
Within the tensorics framework, because of the forementioned reasons, the contravariant case is considered as the default. Simply any object can be put as contravariant coordinate. On the other hand, covariant axes have to be marked explicitely, by inheriting from this class.
All sub classes are obliged to provide a public constructor with a single argument, taking the coordinate itself as an argument. This inheritance structure is necessary, to be able to have several covariant coordinates in one tensor (because tensorics treats coordinates of the same class as the same coordinate-dimension).
Modifier | Constructor and Description |
---|---|
protected |
Covariant(C coordinate)
The single-argument constructor that has to be overriden by subclasses.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
C |
get()
Retrieves the coordinate value from the covariant coordinate.
|
int |
hashCode() |
java.lang.String |
toString() |
protected Covariant(C coordinate)
coordinate
- the coordinate, which will be treated as a covariant axisjava.lang.NullPointerException
- if the given coordinate is nullpublic C get()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object