public class NumericState extends DataBuffer implements ComponentState
Modifier and Type | Class and Description |
---|---|
static class |
NumericState.DataFrame
Used to delimit the state associated with a particular component, for
both diagnostic purposes and for properly restoring component states
within
HasState.getInitialState(artisynth.core.modelbase.ComponentState, artisynth.core.modelbase.ComponentState) . |
DataBuffer.Offsets
Constructor and Description |
---|
NumericState() |
NumericState(boolean annotated) |
NumericState(int zcap,
int dcap) |
NumericState(int zcap,
int dcap,
int ocap) |
Modifier and Type | Method and Description |
---|---|
void |
addDataFrame(HasNumericState comp) |
int |
byteSize() |
void |
clear() |
ComponentState |
duplicate()
Create a duplicate of this state which can be used for storing this
state's values.
|
boolean |
equals(ComponentState state,
java.lang.StringBuilder msg)
Returns true if this state equals another component state.
|
boolean |
equals(NumericState state,
java.lang.StringBuilder errMsg) |
NumericState.DataFrame |
getDataFrame(int idx) |
void |
getState(HasNumericState comp) |
void |
getState(NumericState.DataFrame frame,
NumericState state) |
boolean |
hasDataFrames() |
boolean |
isAnnotated()
Queries whether or not this state is annotated.
|
boolean |
isWritable()
Returns
true if this component should in fact be written to
secondary storage. |
int |
numDataFrames() |
void |
print() |
void |
readBinary(java.io.DataInputStream dis)
Read this state (in binary format) from a data input stream.
|
void |
scan(ReaderTokenizer rtok,
java.lang.Object ref)
Scans this element from a ReaderTokenizer.
|
void |
set(ComponentState state)
Sets this state by copying the value from an existing state object.
|
void |
set(NumericState state) |
void |
setAnnotated(boolean annotated)
Requests that this state be annotated.
|
void |
setHasDataFrames(boolean hasFrames) |
java.lang.String |
toString() |
void |
write(java.io.PrintWriter pw,
NumberFormat fmt,
java.lang.Object ref)
Writes a text description of this element to a PrintWriter.
|
void |
writeBinary(java.io.DataOutputStream dos)
Writes this state (in binary format) to a data output stream.
|
dbuffer, dEnsureCapacity, dequals, dget, dget, dget, dget, dget, doffset, dpeek, dpeek, dput, dput, dput, dput, dput, dset, dsetOffset, dsetSize, dsize, dskip, equals, getNumericOffsets, getNumericSizes, getOffsets, getSizes, numericEquals, obuffer, oEnsureCapacity, oequals, oget, ooffset, opeek, opeek, oput, oputs, oset, osetOffset, osetSize, osize, oskip, resetOffsets, set, zbuffer, zEnsureCapacity, zequals, zget, zgetBool, zoffset, zpeek, zpeek, zput, zputBool, zset, zsetOffset, zsetSize, zsize, zskip
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
equals
public NumericState()
public NumericState(boolean annotated)
public NumericState(int zcap, int dcap)
public NumericState(int zcap, int dcap, int ocap)
public boolean hasDataFrames()
public void setHasDataFrames(boolean hasFrames)
public int numDataFrames()
public NumericState.DataFrame getDataFrame(int idx)
public void addDataFrame(HasNumericState comp)
public void getState(HasNumericState comp)
public void getState(NumericState.DataFrame frame, NumericState state)
public void set(NumericState state)
public void writeBinary(java.io.DataOutputStream dos) throws java.io.IOException
ComponentState
writeBinary
in interface ComponentState
dos
- output stream to write model tojava.io.IOException
- if an I/O error occurredpublic void readBinary(java.io.DataInputStream dis) throws java.io.IOException
ComponentState
readBinary
in interface ComponentState
dis
- input stream to read model fromjava.io.IOException
- if an I/O error occurred or if the input is incompatible with the current
state configuration.public boolean isWritable()
Scannable
true
if this component should in fact be written to
secondary storage. This gives subclasses control over whether or
not they are actually written out.isWritable
in interface Scannable
true
if this component should be written to
secondary storage.public void write(java.io.PrintWriter pw, NumberFormat fmt, java.lang.Object ref) throws java.io.IOException
Scannable
scan
and complete
enough to allow full reconstruction of the element.public void scan(ReaderTokenizer rtok, java.lang.Object ref) throws java.io.IOException
Scannable
write
.public void set(ComponentState state)
ComponentState
set
in interface ComponentState
state
- state object to copypublic boolean equals(ComponentState state, java.lang.StringBuilder msg)
equals
in interface ComponentState
state
- state to compare tomsg
- If not null
, can be used to append diagnostic
information if the states are not equal.public boolean equals(NumericState state, java.lang.StringBuilder errMsg)
public void clear()
clear
in class DataBuffer
public ComponentState duplicate()
ComponentState
duplicate
in interface ComponentState
public java.lang.String toString()
toString
in class java.lang.Object
public int byteSize()
public boolean isAnnotated()
msg
argument to
equals(state,msg)
.
For NumericState, annotation is equivalent to hasFrames() == true
.isAnnotated
in interface ComponentState
true
if this state is annotated.public void setAnnotated(boolean annotated)
isAnnotated()
for more details.
Annotation is supported by frames. If annotation
is
true
, frames are enabled. Otherwise, this method has
no effect.
setAnnotated
in interface ComponentState
annotated
- if true
, enables frame for this state.public void print()