Package civitas.celestis.util.tuple
Interface BaseTuple<E>
- Type Parameters:
E- The type of element this tuple should hold
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
BigVector<N,,D, V, DV, PV> DecimalVector<V,,PV> DoubleTuple,FloatTuple,IntegerVector<V,,DV, PV> IntTuple,LongTuple,Tuple<E>,Vector<V>
- All Known Implementing Classes:
ArrayTuple,ArrayVector,Decimal2,Decimal3,Decimal4,DecimalQuaternion,Double1,Double2,Double3,Double4,DoubleArrayTuple,Float1,Float2,Float3,Float4,FloatArrayTuple,Int1,Int2,Int3,Int4,IntArrayTuple,Integer2,Integer3,Integer4,Long1,Long2,Long3,Long4,LongArrayTuple,Object1,Object2,Object3,Object4,Quaternion,Vector2,Vector3,Vector4
The base class for all tuples, including primitive specialized tuples.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanChecks for equality between two instances oftuples.static booleanequalsIgnoreOrder(BaseTuple<?> t1, BaseTuple<?> t2) Checks for equality between two instances oftupleswithout regard to their elements' order.list()Returns an unmodifiable list containing the components of this tuple in their proper order.intsize()Returns the size of this tuple.
-
Method Details
-
equals
Checks for equality between two instances oftuples. This will returntrueif the size, order of elements, and the elements' values are all equal. In other words, this returnstrueif the list representations are equal. (or both tuples arenull, in which casenull == null)- Parameters:
t1- The first tuple to comparet2- The second tuple to compare- Returns:
trueif the tuples are considered equal according to the criteria mentioned above
-
equalsIgnoreOrder
Checks for equality between two instances oftupleswithout regard to their elements' order. This will returntrueif the sizes are equal, and the first tuple contains every element of the second tuple. (or both tuples arenull, in which casenull == null)- Parameters:
t1- The first tuple to comparet2- The second tuple to compare- Returns:
trueif the tuples are considered equal according to the criteria mentioned above
-
size
int size()Returns the size of this tuple. (the number of components it has)- Returns:
- The number of components this tuple has
-
list
Returns an unmodifiable list containing the components of this tuple in their proper order.- Returns:
- The list representation of this tuple
-