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