|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--com.jniwrapper.Parameter
|
+--com.jniwrapper.ZeroTerminatedString
Base class for all types of zero-terminated strings.
NOTE: All string lengths include the terminating zero character unless otherwise noted.
| Constructor Summary | |
protected |
ZeroTerminatedString(byte[] bytes,
int lenBytes,
int charLength)
Constructs string with specified value, maximum length and characted type (1-byte or 2-byte) |
protected |
ZeroTerminatedString(java.lang.String s,
int len,
int charLength)
Deprecated. strings created using this constructor may allocate not enough memory to hold len characters in certain encodings. |
| 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 parameter length in bytes aligned to default alignment. |
protected int |
getCharLength()
Returns character length in bytes |
int |
getLength()
Returns length of this string object. |
int |
getMaxLength()
Returns maximum length of a string. |
protected abstract int |
getStrLen(DataBuffer dataBuffer,
int startOffset)
|
java.lang.String |
getValue()
|
void |
pop(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
Default implementation, which does nothing as most primitive types do nothing on pop. |
void |
push(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
Writes a parameter to a function stacks |
void |
read(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
Reads this parameter from a specified data source. |
void |
setValue(java.lang.String value)
|
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, getAlignmentRequirement, getDataBuffer, getDataBufferOffset, indent, read, setDataBuffer, toByteArray, write |
| Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
protected ZeroTerminatedString(byte[] bytes,
int lenBytes,
int charLength)
bytes - string as byteslenBytes - maximum string length in bytescharLength - character lengtin in bytes
protected ZeroTerminatedString(java.lang.String s,
int len,
int charLength)
len characters in certain encodings.
| Method 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
avoids this problem.
public final void setValue(java.lang.String value)
setValue in interface StringParameterpublic final java.lang.String getValue()
getValue in interface StringParameterprotected int getCharLength()
protected abstract int getStrLen(DataBuffer dataBuffer,
int startOffset)
public int getLength()
getMaxLength() method.
getLength in class Parameterprotected int getAlignedLength()
Parameter
getAlignedLength in class Parameterprotected Parameter asReturnValue()
Parameter
asReturnValue in class Parameterthis
public void push(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
Parameter
push in class Parameter
public void pop(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
throws MemoryAccessViolationException
Parameter
pop in class ParameterMemoryAccessViolationException
public void write(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
throws MemoryAccessViolationException
Parameter
write in class ParameterMemoryAccessViolationException
public void read(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
throws MemoryAccessViolationException
Parameter
read in class ParameterMemoryAccessViolationExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
ParameterParameter 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 Parameterobj - value to compare this object to
true if two objects are equal.protected abstract byte[] stringToBytes(java.lang.String value)
protected abstract java.lang.String bytesToString(byte[] bytes)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||