mds.data.descriptor_s.Ident Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mdsplus-api Show documentation
Show all versions of mdsplus-api Show documentation
MDSplus interface (via lib or mdsip).
package mds.data.descriptor_s;
import java.nio.ByteBuffer;
import mds.MdsException;
import mds.data.DTYPE;
import mds.data.descriptor.Descriptor;
import mds.data.descriptor.Descriptor_S;
import mds.mdsip.Message;
public final class Ident extends Descriptor_S
{
public Ident(final ByteBuffer b)
{
super(b);
}
public final Descriptor> dec() throws MdsException
{
return this.mds.getDescriptor("`--$", this);
}
@Override
public final StringBuilder decompile(final int prec, final StringBuilder pout, final int mode)
{
return pout.append(this.getAtomic());
}
@Override
public final Descriptor> evaluate()
{
try
{
return this.mds.getDescriptor(this.tree, "`$", this);
}
catch (final MdsException e)
{
System.err.println(e);
return Missing.NEW;
}
}
@Override
public final String getAtomic()
{
final byte[] buf = new byte[this.length()];
this.getBuffer().get(buf);
return new String(buf);
}
@Override
protected Descriptor> getData_(final DTYPE... omits) throws MdsException
{
return this.evaluate().getData(omits);
}
public final String getName()
{ return this.getAtomic(); }
public final Descriptor> inc() throws MdsException
{
return this.mds.getDescriptor("`++$", this);
}
@Override
public Message toMessage(final byte descr_idx, final byte n_args, final byte mid) throws MdsException
{
return new Message(descr_idx, this.dtype(), n_args, this.getShape(), this.getBuffer(), mid);
}
}