2007-10-17 00:30:00 +00:00
|
|
|
/*
|
2007-11-03 23:35:00 +00:00
|
|
|
* $Id: Return.java,v 1.8 2007/11/02 10:47:51 bacon Exp $
|
|
|
|
*
|
|
|
|
* ${License}
|
2007-10-17 00:30:00 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
package ase.awk;
|
|
|
|
|
2007-11-03 23:35:00 +00:00
|
|
|
public class Return implements Clearable
|
2007-10-17 00:30:00 +00:00
|
|
|
{
|
2007-10-24 00:18:00 +00:00
|
|
|
protected long runid;
|
|
|
|
protected long valid;
|
|
|
|
|
|
|
|
/* An instance of the Return class should not be used
|
|
|
|
* outside the context where it is availble. When it is
|
|
|
|
* referenced that way, the setXXX methods may cause
|
|
|
|
* JVM to crash */
|
|
|
|
|
2007-10-31 00:01:00 +00:00
|
|
|
public Return (Context ctx)
|
|
|
|
{
|
2007-11-03 23:35:00 +00:00
|
|
|
ctx.pushClearable (this);
|
2007-10-31 00:01:00 +00:00
|
|
|
this.runid = ctx.getId();
|
|
|
|
this.valid = 0;
|
|
|
|
}
|
|
|
|
|
2007-10-24 00:18:00 +00:00
|
|
|
Return (long runid, long valid)
|
|
|
|
{
|
|
|
|
this.runid = runid;
|
|
|
|
this.valid = valid;
|
|
|
|
}
|
|
|
|
|
2007-10-25 23:43:00 +00:00
|
|
|
public boolean isIndexed ()
|
|
|
|
{
|
2007-11-03 23:35:00 +00:00
|
|
|
if (this.runid == 0) return false;
|
2007-10-25 23:43:00 +00:00
|
|
|
return isindexed (this.runid, this.valid);
|
|
|
|
}
|
|
|
|
|
2007-10-24 00:18:00 +00:00
|
|
|
public void setIntValue (long v)
|
|
|
|
{
|
2007-11-03 23:35:00 +00:00
|
|
|
if (this.runid == 0) return;
|
2007-10-24 00:18:00 +00:00
|
|
|
setintval (this.runid, this.valid, v);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setIntValue (int v)
|
|
|
|
{
|
2007-11-03 23:35:00 +00:00
|
|
|
if (this.runid == 0) return;
|
2007-10-24 00:18:00 +00:00
|
|
|
setintval (this.runid, this.valid, (long)v);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setIntValue (short v)
|
|
|
|
{
|
2007-11-03 23:35:00 +00:00
|
|
|
if (this.runid == 0) return;
|
2007-10-24 00:18:00 +00:00
|
|
|
setintval (this.runid, this.valid, (long)v);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setIntValue (byte v)
|
|
|
|
{
|
2007-11-03 23:35:00 +00:00
|
|
|
if (this.runid == 0) return;
|
2007-10-24 00:18:00 +00:00
|
|
|
setintval (this.runid, this.valid, (long)v);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setRealValue (double v)
|
|
|
|
{
|
2007-11-03 23:35:00 +00:00
|
|
|
if (this.runid == 0) return;
|
2007-10-24 00:18:00 +00:00
|
|
|
setrealval (this.runid, this.valid, v);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setRealValue (float v)
|
|
|
|
{
|
2007-11-03 23:35:00 +00:00
|
|
|
if (this.runid == 0) return;
|
2007-10-24 00:18:00 +00:00
|
|
|
setrealval (this.runid, this.valid, (double)v);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setStringValue (String v)
|
|
|
|
{
|
2007-11-03 23:35:00 +00:00
|
|
|
if (this.runid == 0) return;
|
2007-10-24 00:18:00 +00:00
|
|
|
setstrval (this.runid, this.valid, v);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setIndexedIntValue (String index, long v)
|
|
|
|
{
|
2007-11-03 23:35:00 +00:00
|
|
|
if (this.runid == 0) return;
|
2007-10-24 00:18:00 +00:00
|
|
|
setindexedintval (this.runid, this.valid, index, v);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setIndexedIntValue (String index, int v)
|
|
|
|
{
|
2007-11-03 23:35:00 +00:00
|
|
|
if (this.runid == 0) return;
|
2007-10-24 00:18:00 +00:00
|
|
|
setindexedintval (this.runid, this.valid, index, (long)v);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setIndexedIntValue (String index, short v)
|
|
|
|
{
|
2007-11-03 23:35:00 +00:00
|
|
|
if (this.runid == 0) return;
|
2007-10-24 00:18:00 +00:00
|
|
|
setindexedintval (this.runid, this.valid, index, (long)v);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setIndexedIntValue (String index, byte v)
|
|
|
|
{
|
2007-11-03 23:35:00 +00:00
|
|
|
if (this.runid == 0) return;
|
2007-10-24 00:18:00 +00:00
|
|
|
setindexedintval (this.runid, this.valid, index, (long)v);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setIndexedRealValue (String index, double v)
|
|
|
|
{
|
2007-11-03 23:35:00 +00:00
|
|
|
if (this.runid == 0) return;
|
2007-10-24 00:18:00 +00:00
|
|
|
setindexedrealval (this.runid, this.valid, index, v);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setIndexedRealValue (String index, float v)
|
|
|
|
{
|
2007-11-03 23:35:00 +00:00
|
|
|
if (this.runid == 0) return;
|
2007-10-24 00:18:00 +00:00
|
|
|
setindexedrealval (this.runid, this.valid, index, (double)v);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setIndexedStringValue (String index, String v)
|
|
|
|
{
|
2007-11-03 23:35:00 +00:00
|
|
|
if (this.runid == 0) return;
|
2007-10-24 00:18:00 +00:00
|
|
|
setindexedstrval (this.runid, this.valid, index, v);
|
|
|
|
}
|
|
|
|
|
2007-10-25 23:43:00 +00:00
|
|
|
public void setIndexedIntValue (long index, long v)
|
|
|
|
{
|
2007-11-03 23:35:00 +00:00
|
|
|
if (this.runid == 0) return;
|
2007-10-25 23:43:00 +00:00
|
|
|
setindexedintval (this.runid, this.valid, Long.toString(index), v);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setIndexedIntValue (long index, int v)
|
|
|
|
{
|
2007-11-03 23:35:00 +00:00
|
|
|
if (this.runid == 0) return;
|
2007-10-25 23:43:00 +00:00
|
|
|
setindexedintval (this.runid, this.valid, Long.toString(index), (long)v);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setIndexedIntValue (long index, short v)
|
|
|
|
{
|
2007-11-03 23:35:00 +00:00
|
|
|
if (this.runid == 0) return;
|
2007-10-25 23:43:00 +00:00
|
|
|
setindexedintval (this.runid, this.valid, Long.toString(index), (long)v);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setIndexedIntValue (long index, byte v)
|
|
|
|
{
|
2007-11-03 23:35:00 +00:00
|
|
|
if (this.runid == 0) return;
|
2007-10-25 23:43:00 +00:00
|
|
|
setindexedintval (this.runid, this.valid, Long.toString(index), (long)v);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setIndexedRealValue (long index, double v)
|
|
|
|
{
|
2007-11-03 23:35:00 +00:00
|
|
|
if (this.runid == 0) return;
|
2007-10-25 23:43:00 +00:00
|
|
|
setindexedrealval (this.runid, this.valid, Long.toString(index), v);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setIndexedRealValue (long index, float v)
|
|
|
|
{
|
2007-11-03 23:35:00 +00:00
|
|
|
if (this.runid == 0) return;
|
2007-10-25 23:43:00 +00:00
|
|
|
setindexedrealval (this.runid, this.valid, Long.toString(index), (double)v);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setIndexedStringValue (long index, String v)
|
|
|
|
{
|
2007-11-03 23:35:00 +00:00
|
|
|
if (this.runid == 0) return;
|
2007-10-25 23:43:00 +00:00
|
|
|
setindexedstrval (this.runid, this.valid, Long.toString(index), v);
|
|
|
|
}
|
|
|
|
|
2007-10-24 23:17:00 +00:00
|
|
|
public void clear ()
|
|
|
|
{
|
2007-11-03 23:35:00 +00:00
|
|
|
if (this.runid == 0) return;
|
2007-10-24 23:17:00 +00:00
|
|
|
clearval (this.runid, this.valid);
|
|
|
|
}
|
|
|
|
|
2007-10-25 23:43:00 +00:00
|
|
|
protected native boolean isindexed (long runid, long valid);
|
|
|
|
|
2007-10-24 00:18:00 +00:00
|
|
|
protected native void setintval (long runid, long valid, long v);
|
|
|
|
protected native void setrealval (long runid, long valid, double v);
|
|
|
|
protected native void setstrval (long runid, long valid, String v);
|
|
|
|
|
|
|
|
protected native void setindexedintval (
|
|
|
|
long runid, long valid, String index, long v);
|
|
|
|
protected native void setindexedrealval (
|
|
|
|
long runid, long valid, String index, double v);
|
|
|
|
protected native void setindexedstrval (
|
|
|
|
long runid, long valid, String index, String v);
|
2007-10-24 23:17:00 +00:00
|
|
|
|
|
|
|
protected native void clearval (long runid, long valid);
|
2007-10-17 00:30:00 +00:00
|
|
|
}
|