Package jadex.extension.envsupport.math
Interface IVector1
-
- All Known Implementing Classes:
Vector1Double
,Vector1Int
,Vector1Long
public interface IVector1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IVector1
add(IVector1 vector)
Adds another vector to this vector, adding individual components.IVector1
cbrt()
Calculate the cube root.java.lang.Object
clone()
Generates a deep clone of the vector.IVector1
copy()
Makes a copy of the vector without using the complex clone interface.IVector2
createVector2(IVector1 sec)
Create a vector2 from this and another vector.boolean
equals(IVector1 vector)
Compares the vector to another vector.boolean
equals(java.lang.Object obj)
Compares the vector to an objectjava.math.BigDecimal
getAsBigDecimal()
Returns the vector as BigDecimal.double
getAsDouble()
Returns the vector as double.float
getAsFloat()
Returns the vector as float.int
getAsInteger()
Returns the vector as integer.long
getAsLong()
Returns the vector as long.IVector1
getDistance(IVector1 vector)
Returns the distance to another vectorboolean
greater(IVector1 vector)
Tests if the vector is greater than another vector.boolean
less(IVector1 vector)
Tests if the vector is less than another vector.IVector1
mod(IVector1 mod)
IVector1
multiply(IVector1 vector)
Performs a multiplication on the vector.IVector1
negate()
Negates the vector by negating its components.IVector1
sqrt()
Calculate the square root.IVector1
subtract(IVector1 vector)
Subtracts another vector to this vector, subtracting individual components.IVector1
zero()
Sets the vector component to zero.
-
-
-
Method Detail
-
add
IVector1 add(IVector1 vector)
Adds another vector to this vector, adding individual components.- Parameters:
vector
- the vector to add to this vector- Returns:
- a reference to the called vector (NOT a copy)
-
subtract
IVector1 subtract(IVector1 vector)
Subtracts another vector to this vector, subtracting individual components.- Parameters:
vector
- the vector to subtract from this vector- Returns:
- a reference to the called vector (NOT a copy)
-
multiply
IVector1 multiply(IVector1 vector)
Performs a multiplication on the vector.- Parameters:
vector
- vector- Returns:
- a reference to the called vector (NOT a copy)
-
zero
IVector1 zero()
Sets the vector component to zero.- Returns:
- a reference to the called vector (NOT a copy)
-
negate
IVector1 negate()
Negates the vector by negating its components.- Returns:
- a reference to the called vector (NOT a copy)
-
sqrt
IVector1 sqrt()
Calculate the square root.- Returns:
- The square root.
-
cbrt
IVector1 cbrt()
Calculate the cube root.- Returns:
- The cube root.
-
getDistance
IVector1 getDistance(IVector1 vector)
Returns the distance to another vector- Parameters:
vector
- other vector- Returns:
- distance
-
getAsInteger
int getAsInteger()
Returns the vector as integer.- Returns:
- vector as integer
-
getAsLong
long getAsLong()
Returns the vector as long.- Returns:
- vector as long
-
getAsFloat
float getAsFloat()
Returns the vector as float.- Returns:
- vector as float
-
getAsDouble
double getAsDouble()
Returns the vector as double.- Returns:
- vector as double
-
getAsBigDecimal
java.math.BigDecimal getAsBigDecimal()
Returns the vector as BigDecimal.- Returns:
- vector as BigDecimal
-
copy
IVector1 copy()
Makes a copy of the vector without using the complex clone interface.- Returns:
- copy of the vector
-
clone
java.lang.Object clone() throws java.lang.CloneNotSupportedException
Generates a deep clone of the vector.- Returns:
- clone of this vector
- Throws:
java.lang.CloneNotSupportedException
-
equals
boolean equals(java.lang.Object obj)
Compares the vector to an object- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- the object- Returns:
- always returns false unless the object is an IVector2, in which case it is equivalent to equals(IVector vector)
-
equals
boolean equals(IVector1 vector)
Compares the vector to another vector. The vectors are equal if the components are equal.- Parameters:
vector
- the other vector- Returns:
- true if the vectors are equal
-
greater
boolean greater(IVector1 vector)
Tests if the vector is greater than another vector.- Parameters:
vector
- the other vector- Returns:
- true if the vector is greater than the given vector.
-
less
boolean less(IVector1 vector)
Tests if the vector is less than another vector.- Parameters:
vector
- the other vector- Returns:
- true if the vector is less than the given vector.
-
-