public class AstObject extends Object
This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public Licence for more details.
You should have received a copy of the GNU General Public Licence along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street,Fifth Floor, Boston, MA 02110-1301, USA
Modifier and Type | Field and Description |
---|---|
static double |
AST__BAD
Bad coordinate value.
|
static int |
AST__TUNULL
No-change value for use with
tune . |
protected long |
pointer
Holds the C pointer to the AST object.
|
Modifier | Constructor and Description |
---|---|
protected |
AstObject()
Dummy constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
annul()
Annul this object.
|
void |
clear(String attrib)
Clear attribute values for an Object.
|
AstObject |
copy()
Copy an Object.
|
void |
delete()
Delete this object.
|
boolean |
equals(Object obj)
Determine whether two AstObjects are similar in all respects.
|
protected void |
finalize()
Finalize the object; this annuls the AST object to free resources.
|
static int |
getAstConstantI(String constname)
Gets the value of a named integer constant from the underlying
AST library.
|
boolean |
getB(String attrib)
Get a boolean attribute value by name.
|
String |
getC(String attrib)
Get a character attribute value by name.
|
double |
getD(String attrib)
Get a double precision attribute value by name.
|
float |
getF(String attrib)
Get a floating point attribute value by name.
|
int |
getI(String attrib)
Get a integer attribute value by name.
|
String |
getID()
Get
object identification string.
|
String |
getIdent()
Get
permanent Object identification string.
|
long |
getL(String attrib)
Get a long integer attribute value by name.
|
int |
getNobject()
Get
number of Objects in class.
|
int |
getObjSize()
Get
the in-memory size of the Object.
|
int |
getRefCount()
Get
count of active Object pointers.
|
int |
hashCode()
Return a hash code for this AstObject.
|
static boolean |
isThreaded()
Indicates whether the package is running in threaded mode or not.
|
static String |
reportVersions()
Returns a string giving the versions of AST and of JNIAST.
|
boolean |
sameObject(Object obj)
Determine whether two AstObjects are references to the same
underlying object.
|
void |
set(String settings)
Set attribute values for an Object.
|
void |
setB(String attrib,
boolean value)
Set a boolean attribute value by name.
|
void |
setC(String attrib,
String value)
Set a character attribute value by name.
|
void |
setD(String attrib,
double value)
Set a double precision attribute value by name.
|
void |
setF(String attrib,
float value)
Set a floating point attribute value by name.
|
void |
setI(String attrib,
int value)
Set a integer attribute value by name.
|
void |
setID(String ID)
Set
object identification string.
|
void |
setIdent(String Ident)
Set
permanent Object identification string.
|
void |
setL(String attrib,
long value)
Set a long integer attribute value by name.
|
void |
show()
Display a textual representation of an Object on standard output.
|
boolean |
test(String attrib)
Test if an Object attribute value is set.
|
static int |
tune(String name,
int value)
Set or get an integer-valued AST global tuning parameter.
|
protected long pointer
public static final double AST__BAD
public static final int AST__TUNULL
tune
.protected AstObject()
protected void finalize() throws Throwable
public static int getAstConstantI(String constname)
constname
- the name of the constant ("AST__something")constname
IllegalArgumentException
- if no constant by that name existspublic static boolean isThreaded()
public void annul()
It is not normally necessary for application code to call this method, since it is called during object finalization. User code may however call it if there is worry about retaining non-java heap memory longer than absolutely necessary, but think carefully about whether the additional clutter in user code makes this worthwhile.
public void delete()
Note that deletion is unconditional, regardless of other references to this java object or to the underlying AST object. This method should be used with caution. It is not normally necessary for application code to call it.
public boolean equals(Object obj)
Channel
and comparing the resulting textual representations.
It may therefore be relatively expensive.equals
in class Object
obj
- object to be compared with this oneobj
resembles this object in all
respects, false otherwisesameObject
public int hashCode()
Channel
and calculating the hash code of the resulting
String. It may therefore be relatively expensive.public boolean sameObject(Object obj)
==
operator applied between
them will return false. This method can tell you whether two
AstObjects refer to the same thing.obj
- an object to be compared to this one.obj
references the same AST object
as this does.equals
public static String reportVersions()
public void clear(String attrib)
attrib
- Pointer to a null-terminated character string containing a
comma-separated list of the names of the attributes to be cleared.AstException
- if an error occurred in the AST librarypublic AstObject copy()
AstException
- if an error occurred in the AST librarypublic String getC(String attrib)
attrib
- the name of the character attribute to retrieveString
AstException
- if the AST routine generates an error, in
particular if no character
attribute called attrib
existspublic void setC(String attrib, String value)
attrib
- the name of the character attribute to setvalue
- the new value of the attributeAstException
- if the AST routine generates an error,
in particular if no writable character
attribute called attrib
existspublic double getD(String attrib)
attrib
- the name of the double precision attribute to retrievedouble
AstException
- if the AST routine generates an error, in
particular if no double precision
attribute called attrib
existspublic void setD(String attrib, double value)
attrib
- the name of the double precision attribute to setvalue
- the new value of the attributeAstException
- if the AST routine generates an error,
in particular if no writable double precision
attribute called attrib
existspublic float getF(String attrib)
attrib
- the name of the floating point attribute to retrievefloat
AstException
- if the AST routine generates an error, in
particular if no floating point
attribute called attrib
existspublic void setF(String attrib, float value)
attrib
- the name of the floating point attribute to setvalue
- the new value of the attributeAstException
- if the AST routine generates an error,
in particular if no writable floating point
attribute called attrib
existspublic long getL(String attrib)
attrib
- the name of the long integer attribute to retrievelong
AstException
- if the AST routine generates an error, in
particular if no long integer
attribute called attrib
existspublic void setL(String attrib, long value)
attrib
- the name of the long integer attribute to setvalue
- the new value of the attributeAstException
- if the AST routine generates an error,
in particular if no writable long integer
attribute called attrib
existspublic int getI(String attrib)
attrib
- the name of the integer attribute to retrieveint
AstException
- if the AST routine generates an error, in
particular if no integer
attribute called attrib
existspublic void setI(String attrib, int value)
attrib
- the name of the integer attribute to setvalue
- the new value of the attributeAstException
- if the AST routine generates an error,
in particular if no writable integer
attribute called attrib
existspublic boolean getB(String attrib)
getI
but maps integers to
booleans.attrib
- the name of the boolean attribute to retrieveboolean
AstException
- if the AST routine generates an error,
in particular if no integer attribute by
this name existspublic void setB(String attrib, boolean value)
setI
but maps boolean
values to integers.attrib
- the name of the boolean attribute to setvalue
- the new value of attrib
AstException
- if the AST routine generates an error,
in particular if no writable integer
attribute by that name existspublic void set(String settings)
"attribute_1 = value_1, attribute_2 = value_2, ... "
where "attribute_n" specifies an attribute name, and the value to the right of each "=" sign should be a suitable textual representation of the value to be assigned. This value will be interpreted according to the attribute's data type.
The string supplied may also contain "printf"-style format specifiers, identified by "%" signs in the usual way. If present, these will be substituted by values supplied as additional optional arguments (using the normal "printf" rules) before the string is used.
settings
- Pointer to a null-terminated character string containing a
comma-separated list of attribute settings in the form described
above.AstException
- if an error occurred in the AST librarypublic void show()
AstException
- if an error occurred in the AST librarypublic boolean test(String attrib)
attrib
- Pointer to a null-terminated character string containing
the name of the attribute to be tested.AstException
- if an error occurred in the AST librarypublic static int tune(String name, int value)
name
- The name of the tuning parameter (case-insensitive).value
- The new value for the tuning parameter. If this is AST__TUNULL,
the existing current value will be retained.AstException
- if an error occurred in the AST librarypublic String getID()
An identification string can be valuable when, for example, several Objects have been stored in a file (using astWrite) and are later retrieved (using astRead). Consistent use of the ID attribute allows the retrieved Objects to be identified without depending simply on the order in which they were stored.
This attribute may also be useful during debugging, to distinguish similar Objects when using astShow to display them.
public void setID(String ID)
An identification string can be valuable when, for example, several Objects have been stored in a file (using astWrite) and are later retrieved (using astRead). Consistent use of the ID attribute allows the retrieved Objects to be identified without depending simply on the order in which they were stored.
This attribute may also be useful during debugging, to distinguish similar Objects when using astShow to display them.
ID
- the ID attribute of this objectpublic String getIdent()
public void setIdent(String Ident)
Ident
- the Ident attribute of this objectpublic int getNobject()
public int getObjSize()
public int getRefCount()
If the reference count for an Object falls to zero as the result of annulling a pointer to it, then the Object will be deleted.
Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.