com.jniwrapper
Class AnsiStringArray

java.lang.Object
  extended by com.jniwrapper.Parameter
      extended by com.jniwrapper.AnsiStringArray

public class AnsiStringArray
extends Parameter

This type is specially designed for reading/writing double zero terminated (Ansi) string arrays.

Since:
2.3

Field Summary
 
Fields inherited from class com.jniwrapper.Parameter
LICENSE_TYPE, V
 
Constructor Summary
AnsiStringArray()
           
AnsiStringArray(AnsiStringArray t)
           
AnsiStringArray(int maxLen)
           
AnsiStringArray(java.lang.String[] s)
           
AnsiStringArray(java.lang.String[] s, int maxLen)
           
 
Method Summary
protected  Parameter asReturnValue()
          Returns a parameter that represents this one as a return value.
protected  java.lang.String bytesToString(byte[] bytes)
           
 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.
protected  int getCharLength()
          Returns the character length in bytes.
 java.lang.String getDebugInfo()
          Return debug info for JNIWrapper parameter.
 int getLength()
          Returns the length of the parameter in memory.
 int getMaxLength()
          Returns the maximum length of a string.
protected  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)
           
protected  byte[] stringToBytes(java.lang.String value)
           
 byte[] toBytes(java.lang.String[] value)
           
 void write(DataBuffer stackBuffer, int offset, boolean invokedByCallback)
          Writes this parameter to a specified data source.
 
Methods inherited from class com.jniwrapper.Parameter
acceptIOPerformer, dataBufferAssigned, getAlignmentRequirement, getDataBuffer, getDataBufferOffset, indent, pop, push, read, read, setDataBuffer, toByteArray, write
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnsiStringArray

public AnsiStringArray()

AnsiStringArray

public AnsiStringArray(int maxLen)

AnsiStringArray

public AnsiStringArray(java.lang.String[] s)

AnsiStringArray

public AnsiStringArray(java.lang.String[] s,
                       int maxLen)

AnsiStringArray

public AnsiStringArray(AnsiStringArray t)
Method Detail

bytesToString

protected java.lang.String bytesToString(byte[] bytes)

stringToBytes

protected byte[] stringToBytes(java.lang.String value)

clone

public java.lang.Object clone()
Specified by:
clone in class Parameter

getStrLen

protected int getStrLen(DataBuffer dataBuffer,
                        int startOffset)

getMaxLength

public int getMaxLength()
Returns the maximum length of a string. In certain (mostly Asian) encodings, some characters are represented by more than one byte even if the 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.


setValue

public final void setValue(java.lang.String[] value)

toBytes

public final byte[] toBytes(java.lang.String[] value)

getValue

public final java.lang.String[] getValue()

getCharLength

protected int getCharLength()
Returns the character length in bytes.


getAlignedLength

protected int getAlignedLength()
Description copied from class: Parameter
Returns a parameter length in bytes aligned to default alignment.

Overrides:
getAlignedLength in class Parameter

asReturnValue

protected Parameter asReturnValue()
Description copied from class: Parameter
Returns a parameter that represents this one as a return value. Implementors may use this as a convenience shortcut for users when implementing such objects as strings or arrays to allow users to specify an object as a return value instead of requiring a pointer to it. For general use the default implementation should suffice.

Overrides:
asReturnValue in class Parameter
Returns:
this

write

public void write(DataBuffer stackBuffer,
                  int offset,
                  boolean invokedByCallback)
           throws MemoryAccessViolationException
Description copied from class: Parameter
Writes this parameter to a specified data source.

Specified by:
write in class Parameter
Throws:
MemoryAccessViolationException

read

public void read(DataBuffer stackBuffer,
                 int offset,
                 boolean invokedByCallback)
          throws MemoryAccessViolationException
Description copied from class: Parameter
Reads this parameter from a specified data source.

Specified by:
read in class Parameter
Throws:
MemoryAccessViolationException

getDebugInfo

public java.lang.String getDebugInfo()
Description copied from class: Parameter
Return debug info for JNIWrapper parameter.

Specified by:
getDebugInfo in class Parameter
Returns:
debug info

equals

public boolean equals(java.lang.Object obj)
Description copied from class: Parameter
Compares this 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.

Overrides:
equals in class Parameter
Parameters:
obj - a value to compare this object to.
Returns:
true if two objects are equal.

hashCode

public int hashCode()
Overrides:
hashCode in class Parameter

getLength

public int getLength()
Description copied from class: Parameter
Returns the length of the parameter in memory. This method is similar to C sizeof() operator.

Specified by:
getLength in class Parameter