public class Queue extends MadaraJNI
Constructor and Description |
---|
Queue()
Default constructor
|
Queue(Queue input)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
long |
count()
Returns the number of records currently in the queue
|
KnowledgeRecord |
dequeue(boolean waitForRecord)
Attempts to dequeue a record
|
boolean |
enqueue(double value)
Attempts to enqueue a double
|
boolean |
enqueue(KnowledgeRecord record)
Attempts to enqueue a record
|
boolean |
enqueue(long value)
Attempts to enqueue a long
|
boolean |
enqueue(java.lang.String value)
Attempts to enqueue a string
|
protected void |
finalize()
Cleans up underlying C resources
|
void |
free()
Deletes the C instantiation.
|
static Queue |
fromPointer(long cptr)
Creates a java object instance from a C/C++ pointer
|
static Queue |
fromPointer(long cptr,
boolean shouldManage)
Creates a java object instance from a C/C++ pointer
|
java.lang.String |
getName()
Gets the name of the variable
|
KnowledgeRecord |
inspect(int position)
Inspects the record at the specified position
|
void |
resize(long length)
Resizes the vector
|
void |
setName(KnowledgeBase kb,
java.lang.String name)
Sets the name and knowledge base being referred to
|
void |
setName(Variables vars,
java.lang.String name)
Sets the name and knowledge base being referred to
|
void |
setSettings(UpdateSettings settings)
Sets the settings for updating variables in the Knowledge Base
|
long |
size()
Returns the maximum size of the queue
|
public Queue()
public Queue(Queue input)
input
- instance to copypublic static Queue fromPointer(long cptr)
cptr
- C pointer to the objectpublic static Queue fromPointer(long cptr, boolean shouldManage)
cptr
- C pointer to the objectshouldManage
- if true, manage the pointerpublic KnowledgeRecord inspect(int position)
position
- position in the queue to inspectpublic KnowledgeRecord dequeue(boolean waitForRecord)
waitForRecord
- if true, block on a record being added to queuepublic java.lang.String getName()
public void resize(long length)
length
- new number of elements of the vectorpublic boolean enqueue(KnowledgeRecord record)
record
- the new record to place on the queuepublic boolean enqueue(double value)
value
- the new value to place on the queuepublic boolean enqueue(long value)
value
- the new value to place on the queuepublic boolean enqueue(java.lang.String value)
value
- the new value to place on the queuepublic void setName(KnowledgeBase kb, java.lang.String name)
kb
- the knowledge base that contains the namename
- the variable namepublic void setName(Variables vars, java.lang.String name)
vars
- the variables facade that contains the namename
- the variable namepublic void setSettings(UpdateSettings settings)
settings
- the settings to use for updating the Knowledge Basepublic long size()
public long count()
public void free()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
- necessary for override but unused