public class RelAbsVector extends java.lang.Object
For many elements in the render extension, it is necessary to specify coordinates not in terms
of absolute values, but rather in terms of relative values or even a combination of absolute
and relative values.
Such a pair of values where one represents an absolute value and the other represents a relative
value can be expressed by a RelAbsVector
.
The relative and absolute values to initialize a RelAbsVector
object can either be given as
numerical datatypes (double) or as a valid value string.
A value string is a combination of an absolute value and a relative value and the absolute
value if given has to come first. So valid value strings would be: '5.0e3+20%', or '100%' or '4'.
Constructor and Description |
---|
RelAbsVector()
Constructor with two values.
|
RelAbsVector(double a)
Constructor with two values.
|
RelAbsVector(double a,
double r)
Constructor with two values.
|
RelAbsVector(java.lang.String coordString)
Constructor with a value string.
|
Modifier and Type | Method and Description |
---|---|
void |
delete()
Explicitly deletes the underlying native object.
|
boolean |
empty()   |
void |
erase()
resets this element by setting its component to 0
|
double |
getAbsoluteValue()
Returns the absolute coordinate value.
|
double |
getRelativeValue()
Returns the relative coordinate value.
|
void |
setAbsoluteValue(double abs)
Sets the absolute coordinate value.
|
void |
setCoordinate(double abs)
Sets the relative and absolute value.
|
void |
setCoordinate(double abs,
double rel)
Sets the relative and absolute value.
|
void |
setCoordinate(java.lang.String coordString)
Sets the coordinates from the given string.
|
void |
setRelativeValue(double rel)
Sets the relative coordinate value.
|
java.lang.String |
toString()   |
public RelAbsVector(double a, double r)
a
- absolute valuea
- relative value in % (50 -> 50%)public RelAbsVector(double a)
a
- absolute valuea
- relative value in % (50 -> 50%)public RelAbsVector()
a
- absolute valuea
- relative value in % (50 -> 50%)public RelAbsVector(java.lang.String coordString)
RelAbsVector
are set to NaN.public void delete()
In general, application software will not need to call this method directly. The Java language binding for libSBML is implemented as a language wrapper that provides a Java interface to libSBML's underlying C++/C code. Some of the Java methods return objects that are linked to objects created not by Java code, but by C++ code. The Java objects wrapped around them will be deleted when the garbage collector invokes the corresponding C++ finalize()
methods for the objects. The finalize()
methods in turn call the RelAbsVector.delete()
method on the libSBML object.
This method is exposed in case calling programs want to ensure that the underlying object is freed immediately, and not at some arbitrary time determined by the Java garbage collector. In normal usage, callers do not need to invoke RelAbsVector.delete()
themselves.
public void setCoordinate(double abs, double rel)
abs
- absolute valuerel
- relative value. If the relative value is omitted, it is set to 0.public void setCoordinate(double abs)
abs
- absolute valuerel
- relative value. If the relative value is omitted, it is set to 0.public void setCoordinate(java.lang.String coordString)
RelAbsVector
are set to NaN.
coordString
- value stringpublic void setAbsoluteValue(double abs)
abs
- absolute value to be setpublic void setRelativeValue(double rel)
rel
- relative value to be setpublic double getAbsoluteValue()
public double getRelativeValue()
public boolean empty()
public java.lang.String toString()
toString
 in class java.lang.Object
public void erase()