public class Genders
extends java.lang.Object
Constructor and Description |
---|
Genders()
Creates a Genders object, loading the default genders database
|
Genders(java.lang.String filename)
Creates a Genders object, loading the specified genders database
|
Modifier and Type | Method and Description |
---|---|
void |
cleanup()
Cleans up allocated memory.
|
java.lang.String[] |
getattr_all()
Returns all of the attributes in the genders database
|
java.lang.String[] |
getattr()
Returns all the attributes of the node you are running on
|
java.lang.String[] |
getattr(java.lang.String node)
Returns all the attributes of the specified node
|
java.lang.String |
getattrval(java.lang.String attr)
Returns the value of the specified attribute on the current
node you are running on
|
java.lang.String |
getattrval(java.lang.String node,
java.lang.String attr)
Returns the value of the specified attribute on the specified
node.
|
int |
getmaxattrs()
Returns maximum number of attributes of any one node parsed in
the genders database
|
java.lang.String |
getnodename()
Returns the current node you are on, in shortened hostname
format.
|
java.lang.String[] |
getnodes()
Returns all the nodes in the genders database
|
java.lang.String[] |
getnodes(java.lang.String attr)
Returns all the nodes with the specified attribute
|
java.lang.String[] |
getnodes(java.lang.String attr,
java.lang.String val)
Returns all the nodes with the specified attribute and value
|
int |
getnumattrs()
Returns number of attributes parsed in the genders database
|
int |
getnumnodes()
Returns number of nodes parsed in the genders database
|
boolean |
isattr(java.lang.String attr)
Tests if the specified attribute exists in the genders database
|
boolean |
isattrval(java.lang.String attr,
java.lang.String val)
Tests if the specified value exists in the genders database
|
boolean |
isnode(java.lang.String node)
Tests if the specified node exists in the genders database
|
java.lang.String[] |
query(java.lang.String query)
Returns nodes specified via the specified query.
|
boolean |
testattr(java.lang.String attr)
Tests if the current node has the specified attribute
|
boolean |
testattr(java.lang.String node,
java.lang.String attr)
Tests if the specified node has the specified attribute
|
boolean |
testattrval(java.lang.String attr,
java.lang.String val)
Tests if the current node has the specified attribute and value.
|
boolean |
testattrval(java.lang.String node,
java.lang.String attr,
java.lang.String val)
Tests if the specified node has the specified attribute and value.
|
boolean |
testquery(java.lang.String query)
Test if the current node meets the conditions of the specified query.
|
boolean |
testquery(java.lang.String node,
java.lang.String query)
Test if the specified node meets the conditions of the specified query.
|
public Genders() throws GendersException
GendersException
public Genders(java.lang.String filename) throws GendersException
GendersException
public int getnumnodes() throws GendersException
GendersException
- on errorpublic int getnumattrs() throws GendersException
GendersException
- on errorpublic int getmaxattrs() throws GendersException
GendersException
- on errorpublic java.lang.String getnodename() throws GendersException
GendersException
- on errorpublic java.lang.String[] getnodes() throws GendersException
GendersException
- on errorpublic java.lang.String[] getnodes(java.lang.String attr) throws GendersException
GendersException
- on errorpublic java.lang.String[] getnodes(java.lang.String attr, java.lang.String val) throws GendersException
GendersException
- on errorpublic java.lang.String[] getattr() throws GendersException
GendersException
- on errorpublic java.lang.String[] getattr(java.lang.String node) throws GendersException
GendersException
- on errorpublic java.lang.String[] getattr_all() throws GendersException
GendersException
- on errorpublic java.lang.String getattrval(java.lang.String attr) throws GendersException
GendersException
- on errorpublic java.lang.String getattrval(java.lang.String node, java.lang.String attr) throws GendersException
GendersException
- on errorpublic boolean testattr(java.lang.String attr) throws GendersException
GendersException
- on errorpublic boolean testattr(java.lang.String node, java.lang.String attr) throws GendersException
GendersException
- on errorpublic boolean testattrval(java.lang.String attr, java.lang.String val) throws GendersException
GendersException
- on errorpublic boolean testattrval(java.lang.String node, java.lang.String attr, java.lang.String val) throws GendersException
GendersException
- on errorpublic boolean isnode(java.lang.String node) throws GendersException
GendersException
- on errorpublic boolean isattr(java.lang.String attr) throws GendersException
GendersException
- on errorpublic boolean isattrval(java.lang.String attr, java.lang.String val) throws GendersException
GendersException
- on errorpublic java.lang.String[] query(java.lang.String query) throws GendersException
GendersException
- on errorpublic boolean testquery(java.lang.String query) throws GendersException
GendersException
- on errorpublic boolean testquery(java.lang.String node, java.lang.String query) throws GendersException
GendersException
- on errorpublic void cleanup()