Package jadex.extension.envsupport.math
Class Vector1Long
- java.lang.Object
-
- jadex.extension.envsupport.math.Vector1Long
-
-
Constructor Summary
Constructors Constructor Description Vector1Long()
Creates a new vector.Vector1Long(long value)
Creates a new Vector1Long.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IVector1
add(IVector1 vector)
Adds another vector to this vector, adding individual components.IVector1
cbrt()
Calculate the cbrt 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.int
hashCode()
Compute the hash code.boolean
less(IVector1 vector)
Tests if the vector is less than another vector.IVector1
mod(IVector1 mod)
Calculate the modulo.IVector1
multiply(IVector1 vector)
Performs a multiplication on the vector.IVector1
negate()
Negates the vector by negating its components.void
setAsLong(long x)
IVector1
sqrt()
Calculate the square root.IVector1
subtract(IVector1 vector)
Subtracts another vector to this vector, subtracting individual components.java.lang.String
toString()
IVector1
zero()
Sets the vector component to zero.
-
-
-
Field Detail
-
ZERO
public static final IVector1 ZERO
Zero vector
-
-
Method Detail
-
add
public IVector1 add(IVector1 vector)
Adds another vector to this vector, adding individual components.
-
subtract
public IVector1 subtract(IVector1 vector)
Subtracts another vector to this vector, subtracting individual components.
-
zero
public IVector1 zero()
Sets the vector component to zero.
-
negate
public IVector1 negate()
Negates the vector by negating its components.
-
sqrt
public IVector1 sqrt()
Calculate the square root.
-
cbrt
public IVector1 cbrt()
Calculate the cbrt root.
-
getDistance
public IVector1 getDistance(IVector1 vector)
Returns the distance to another vector- Specified by:
getDistance
in interfaceIVector1
- Parameters:
vector
- other vector- Returns:
- distance
-
getAsInteger
public int getAsInteger()
Returns the vector as integer.- Specified by:
getAsInteger
in interfaceIVector1
- Returns:
- vector as integer
-
getAsLong
public long getAsLong()
Returns the vector as long.
-
setAsLong
public void setAsLong(long x)
-
getAsFloat
public float getAsFloat()
Returns the vector as float.- Specified by:
getAsFloat
in interfaceIVector1
- Returns:
- vector as float
-
getAsDouble
public double getAsDouble()
Returns the vector as double.- Specified by:
getAsDouble
in interfaceIVector1
- Returns:
- vector as double
-
getAsBigDecimal
public java.math.BigDecimal getAsBigDecimal()
Returns the vector as BigDecimal.- Specified by:
getAsBigDecimal
in interfaceIVector1
- Returns:
- vector as BigDecimal
-
copy
public IVector1 copy()
Makes a copy of the vector without using the complex clone interface.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Generates a deep clone of the vector.
-
equals
public boolean equals(java.lang.Object obj)
Compares the vector to an object
-
hashCode
public int hashCode()
Compute the hash code.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- The hash code.
-
equals
public boolean equals(IVector1 vector)
Compares the vector to another vector. The vectors are equal if the components are equal.
-
greater
public boolean greater(IVector1 vector)
Tests if the vector is greater than another vector.
-
less
public boolean less(IVector1 vector)
Tests if the vector is less than another vector.
-
createVector2
public IVector2 createVector2(IVector1 sec)
Create a vector2 from this and another vector.- Specified by:
createVector2
in interfaceIVector1
- Parameters:
sec
- The second vector.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-