|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jniwrapper.Parameter
com.jniwrapper.ZeroTerminatedString
public abstract class ZeroTerminatedString
Base class for all types of zero-terminated strings.
NOTE: All string lengths include the terminating zero character unless otherwise noted.
Field Summary |
---|
Fields inherited from class com.jniwrapper.Parameter |
---|
LICENSE_TYPE, V |
Constructor Summary | |
---|---|
protected |
ZeroTerminatedString(byte[] bytes,
int lenBytes,
int charLength)
Constructs a string with specified value, maximum length and characted type (1-byte or 2-byte). |
Method Summary | |
---|---|
protected Parameter |
asReturnValue()
Returns a parameter that represents this one as a return value. |
protected abstract java.lang.String |
bytesToString(byte[] bytes)
|
boolean |
equals(java.lang.Object obj)
Compares this Parameter object to a given object. |
protected int |
getAlignedLength()
Returns a parameter length in bytes aligned to default alignment. |
java.lang.String |
getDebugInfo()
Return debug info for JNIWrapper parameter. |
int |
getFirstMemberSize()
Should return first member size. |
int |
getLength()
Returns the length of this string object. |
int |
getMaxLength()
Returns the maximum length of a string. |
protected abstract int |
getStrLen(DataBuffer dataBuffer,
int startOffset)
|
java.lang.String |
getValue()
|
int |
hashCode()
|
void |
read(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
Reads this parameter from a specified data source. |
void |
setValue(java.lang.String value)
Sets the value for the parameter. |
protected abstract byte[] |
stringToBytes(java.lang.String value)
|
java.lang.String |
toString()
|
void |
write(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
Writes this parameter to a specified data source. |
Methods inherited from class com.jniwrapper.Parameter |
---|
acceptIOPerformer, clone, dataBufferAssigned, getAlignmentRequirement, getDataBuffer, getDataBufferOffset, indent, pop, push, read, read, setDataBuffer, toByteArray, write |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected ZeroTerminatedString(byte[] bytes, int lenBytes, int charLength)
bytes
- a string as byteslenBytes
- the maximum string length in bytescharLength
- the character lengtin in bytesMethod Detail |
---|
public int getMaxLength()
charLength
is 1. In these cases
ANSI string may not be able to hold getMaxLength()
characters. Creating a new
AnsiString
object with the string as a parameter or using WideString
eliminates this problem.
public final void setValue(java.lang.String value)
StringParameter
setValue
in interface StringParameter
value
- the value to set.public final java.lang.String getValue()
getValue
in interface StringParameter
protected abstract int getStrLen(DataBuffer dataBuffer, int startOffset)
public int getLength()
getMaxLength()
method.
getLength
in class Parameter
protected int getAlignedLength()
Parameter
getAlignedLength
in class Parameter
protected Parameter asReturnValue()
Parameter
asReturnValue
in class Parameter
this
public void write(DataBuffer stackBuffer, int offset, boolean invokedByCallback) throws MemoryAccessViolationException
Parameter
write
in class Parameter
MemoryAccessViolationException
public void read(DataBuffer stackBuffer, int offset, boolean invokedByCallback) throws MemoryAccessViolationException
Parameter
read
in class Parameter
MemoryAccessViolationException
public java.lang.String getDebugInfo()
Parameter
getDebugInfo
in class Parameter
public boolean equals(java.lang.Object obj)
Parameter
Parameter
object to a given object. Two
Parameter
objects are considered equal if their byte
representations are equal and they are of the same type. Subclasses may
override this method as appropriate.
equals
in class Parameter
obj
- a value to compare this object to.
true
if two objects are equal.public int hashCode()
hashCode
in class Parameter
protected abstract byte[] stringToBytes(java.lang.String value)
protected abstract java.lang.String bytesToString(byte[] bytes)
public java.lang.String toString()
toString
in class java.lang.Object
public int getFirstMemberSize()
AlignmentAwareParameter
getFirstMemberSize
in interface AlignmentAwareParameter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |