|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jniwrapper.Parameter
com.jniwrapper.Str
public class Str
Represents a string data that depends on Unicode support of an operating
system under which the code is being executed. If Unicode is supported, this
class works as WideString
, otherwise as AnsiString
.
Field Summary |
---|
Fields inherited from class com.jniwrapper.Parameter |
---|
LICENSE_TYPE, V |
Constructor Summary | |
---|---|
Str()
Constructs a string with the maximum length of 256 characters. |
|
Str(int maxLen)
Constructs a string with a specified maximum length. |
|
Str(int maxLen,
boolean unicode)
Constructs a string with a specified maximum length and character type. |
|
Str(Str s)
Constructs a copy of the passed instance. |
|
Str(java.lang.String s)
Constructs a string with a specified value. |
|
Str(java.lang.String s,
boolean unicode)
Constructs a string with a specified value and character type. |
|
Str(java.lang.String s,
int maxLen)
Constructs a string with a specified value and maximum length. |
|
Str(java.lang.String s,
int maxLen,
boolean unicode)
Constructs a string with a specified value, maximum length and character type. |
Method Summary | |
---|---|
protected void |
acceptIOPerformer(IOPerformer performer,
DataBuffer buffer,
int initialOffset,
boolean isReadOperation,
boolean invokedByCallback)
Implementation of a Visitor pattern for parameter IO. |
protected Parameter |
asReturnValue()
Returns a parameter that represents this one as a return value. |
java.lang.Object |
clone()
|
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. |
int |
getAlignmentRequirement()
|
protected DataBuffer |
getDataBuffer()
Returns a current data storage. |
protected int |
getDataBufferOffset()
Returns a current offset within data storage. |
java.lang.String |
getDebugInfo()
Return debug info for JNIWrapper parameter. |
int |
getFirstMemberSize()
Should return first member size. |
int |
getLength()
Returns the length of the parameter in memory. |
int |
getMaxLength()
|
java.lang.String |
getValue()
|
int |
hashCode()
|
boolean |
isUnicode()
|
void |
pop(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
Default implementation that does nothing because most primitive types do nothing on pop. |
void |
push(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
Writes a parameter to a function stacks. |
void |
read(byte[] arr,
int offset)
Reads the parameter value from a byte array. |
void |
read(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
Reads this parameter from a specified data source. |
protected void |
setDataBuffer(DataBuffer newBuffer,
int newOffset,
boolean shouldRead)
Sets the data buffer this parameter should use to store data and an offset in bytes within that buffer. |
void |
setValue(java.lang.String value)
Sets the value for the parameter. |
java.lang.String |
toString()
|
void |
write(byte[] arr,
int offset)
Writes the parameter value to a byte array. |
void |
write(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
Writes this parameter to a specified data source. |
Methods inherited from class com.jniwrapper.Parameter |
---|
dataBufferAssigned, indent, read, toByteArray |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Str()
public Str(java.lang.String s)
public Str(java.lang.String s, boolean unicode)
public Str(int maxLen)
public Str(int maxLen, boolean unicode)
public Str(java.lang.String s, int maxLen)
public Str(java.lang.String s, int maxLen, boolean unicode)
public Str(Str s)
s
- a string value to copy from.Method Detail |
---|
public boolean isUnicode()
true
if the contained string data is in Unicode;
otherwise false
.public int getLength()
Parameter
sizeof()
operator.
getLength
in class Parameter
protected int getAlignedLength()
Parameter
getAlignedLength
in class Parameter
protected Parameter asReturnValue()
Parameter
asReturnValue
in class Parameter
this
protected int getDataBufferOffset()
Parameter
getDataBufferOffset
in class Parameter
protected DataBuffer getDataBuffer()
Parameter
getDataBuffer
in class Parameter
protected void setDataBuffer(DataBuffer newBuffer, int newOffset, boolean shouldRead)
Parameter
setDataBuffer
in class Parameter
public void write(byte[] arr, int offset)
Parameter
write
in class Parameter
public void read(byte[] arr, int offset)
Parameter
read
in class Parameter
protected void acceptIOPerformer(IOPerformer performer, DataBuffer buffer, int initialOffset, boolean isReadOperation, boolean invokedByCallback)
Parameter
performer
is responsible for reading and writing the
parameter. Users implementing a complex parameter from scratch (i.e. not
by extending a pre-existing class such as Structure
or
Pointer
) may wish to override this method to make a
performer visit object internal parts.
acceptIOPerformer
in class Parameter
performer
- a visitor responsible for I/Oing the parameter.buffer
- data buffer for I/O operation.initialOffset
- I/O operation offset of this parameter in the
buffer.public int getAlignmentRequirement()
getAlignmentRequirement
in class Parameter
public void push(DataBuffer stackBuffer, int offset, boolean invokedByCallback) throws MemoryAccessViolationException
Parameter
push
in class Parameter
MemoryAccessViolationException
public void pop(DataBuffer stackBuffer, int offset, boolean invokedByCallback) throws MemoryAccessViolationException
Parameter
pop
in class Parameter
MemoryAccessViolationException
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.Object clone()
clone
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
public int getMaxLength()
public void setValue(java.lang.String value)
StringParameter
setValue
in interface StringParameter
value
- the value to set.public java.lang.String getValue()
getValue
in interface StringParameter
public java.lang.String getDebugInfo()
Parameter
getDebugInfo
in class Parameter
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 |