Package gov.llnl.lc.chaos
Class Genders
java.lang.Object
gov.llnl.lc.chaos.Genders
Java JNI extensions wrapper around libgenders C library. Most
library functions behave similarly to C api functions with minor
exceptions documented below.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanup()
Cleans up allocated memory.String[]
getattr()
Returns all the attributes of the node you are running onString[]
Returns all the attributes of the specified nodeString[]
Returns all of the attributes in the genders databasegetattrval
(String attr) Returns the value of the specified attribute on the current node you are running ongetattrval
(String node, String attr) Returns the value of the specified attribute on the specified node.int
Returns maximum number of attributes of any one node parsed in the genders databaseReturns the current node you are on, in shortened hostname format.String[]
getnodes()
Returns all the nodes in the genders databaseString[]
Returns all the nodes with the specified attributeString[]
Returns all the nodes with the specified attribute and valueint
Returns number of attributes parsed in the genders databaseint
Returns number of nodes parsed in the genders databaseboolean
Tests if the specified attribute exists in the genders databaseboolean
Tests if the specified value exists in the genders databaseboolean
Tests if the specified node exists in the genders databaseString[]
Returns nodes specified via the specified query.boolean
Tests if the current node has the specified attributeboolean
Tests if the specified node has the specified attributeboolean
testattrval
(String attr, String val) Tests if the current node has the specified attribute and value.boolean
testattrval
(String node, String attr, String val) Tests if the specified node has the specified attribute and value.boolean
Test if the current node meets the conditions of the specified query.boolean
Test if the specified node meets the conditions of the specified query.
-
Constructor Details
-
Genders
Creates a Genders object, loading the default genders database- Throws:
GendersException
-
Genders
Creates a Genders object, loading the specified genders database- Throws:
GendersException
-
-
Method Details
-
getnumnodes
Returns number of nodes parsed in the genders database- Throws:
GendersException
- on error
-
getnumattrs
Returns number of attributes parsed in the genders database- Throws:
GendersException
- on error
-
getmaxattrs
Returns maximum number of attributes of any one node parsed in the genders database- Throws:
GendersException
- on error
-
getnodename
Returns the current node you are on, in shortened hostname format.- Throws:
GendersException
- on error
-
getnodes
Returns all the nodes in the genders database- Throws:
GendersException
- on error
-
getnodes
Returns all the nodes with the specified attribute- Throws:
GendersException
- on error
-
getnodes
Returns all the nodes with the specified attribute and value- Throws:
GendersException
- on error
-
getattr
Returns all the attributes of the node you are running on- Throws:
GendersException
- on error
-
getattr
Returns all the attributes of the specified node- Throws:
GendersException
- on error
-
getattr_all
Returns all of the attributes in the genders database- Throws:
GendersException
- on error
-
getattrval
Returns the value of the specified attribute on the current node you are running on- Throws:
GendersException
- on error
-
getattrval
Returns the value of the specified attribute on the specified node. May be an empty string if the attribute contains no value.- Throws:
GendersException
- on error
-
testattr
Tests if the current node has the specified attribute- Throws:
GendersException
- on error
-
testattr
Tests if the specified node has the specified attribute- Throws:
GendersException
- on error
-
testattrval
Tests if the current node has the specified attribute and value.- Throws:
GendersException
- on error
-
testattrval
Tests if the specified node has the specified attribute and value.- Throws:
GendersException
- on error
-
isnode
Tests if the specified node exists in the genders database- Throws:
GendersException
- on error
-
isattr
Tests if the specified attribute exists in the genders database- Throws:
GendersException
- on error
-
isattrval
Tests if the specified value exists in the genders database- Throws:
GendersException
- on error
-
query
Returns nodes specified via the specified query. Signify union with '||', intersection with '&&', * difference with '--', and complement with '~'. Operations are performed left to right. Parentheses can be used to change the order of operations.- Throws:
GendersException
- on error
-
testquery
Test if the current node meets the conditions of the specified query.- Throws:
GendersException
- on error
-
testquery
Test if the specified node meets the conditions of the specified query.- Throws:
GendersException
- on error
-
cleanup
public void cleanup()Cleans up allocated memory. Must be called to free memory from underlying calls. After this method is called, all genders methods above cannot be called and will result in errors.
-