unikix.clientapis.emulator
Class KixField

java.lang.Object
  |
  +--unikix.clientapis.emulator.KixField

public class KixField
extends Object
implements Kix3270Constants

A representation of a 3270 field.

This class presents a set of methods for obtaining information about a field, along with methods for setting the data in it.

It should be noted that the setting of the data in a field does not affect the 3270 cursor position in the KixEmulator and does set the MDT for the field.


Method Summary
 char[] getCharAttributes()
          Get the extended attributes.
 char[] getCharColors()
          Get the extended colors.
 short getCharSet()
          Determine the character set of the field
 char getColor()
          Determine the 3270 color of the field
 int getColumn()
          Get the column of the start of the field.
 char[] getData()
          Get a copy of the data associated with this field.
 int getDataLength()
          Get the length of the data in the field.
 int getFirstCharOffset()
          Get the offset of the first character in the field (as opposed to the attribute byte).
 int getLastCharOffset()
          Get the offset of the last character in the field (as opposed to the attribute byte).
 int getLength()
          Get the field length.
 int getOffset()
          Get the field offset.
 int getRow()
          Get the row of the start of the field.
 String getText()
          Get a textual representation of the data in the field.
 boolean isAskip()
          Determine if the field is Askip.
 boolean isCursorSelectCapable()
          Determine if the field is Cursor Select Capable.
 boolean isIntense()
          Determine if the field is intense.
 boolean isModified()
          Determine if the field has the MDT set.
 boolean isNumeric()
          Determine if the field is Numeric.
 boolean isProtected()
          Determine if the field is protected.
 boolean isSOSI()
          Determine if the field allows the user to enter SOSI data.
 boolean isVisible()
          Determine if the field is visible.
 void setData(char[] newData)
          Set the data in the field to the data provided.
 void setText(String theText)
          Set the value of the field from a String.
 String toString()
          Creates a string representation of the KixField.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getOffset

public int getOffset()
Get the field offset.
Returns:
The offset
See Also:
getRow(), getColumn()

getLength

public int getLength()
Get the field length. This length includes the attribute byte.
Returns:
The length

getRow

public int getRow()
Get the row of the start of the field. This is the row of the attribute byte, rather than the first 'usable' character in the field.
Returns:
The row
See Also:
getColumn(), getOffset()

getColumn

public int getColumn()
Get the column of the start of the field. This is the column of the attribute byte, rather than the first 'usable' character in the field.
Returns:
The column
See Also:
getRow(), getOffset()

getDataLength

public int getDataLength()
Get the length of the data in the field. This does not include the attribute byte.
Returns:
The length

isProtected

public boolean isProtected()
Determine if the field is protected.
Returns:
True if the field is protected.

isIntense

public boolean isIntense()
Determine if the field is intense.
Returns:
True if the field is intense.

isVisible

public boolean isVisible()
Determine if the field is visible.
Returns:
True if the field is visible.

isSOSI

public boolean isSOSI()
Determine if the field allows the user to enter SOSI data.
Returns:
True if SOSI data is allowed.

isModified

public boolean isModified()
Determine if the field has the MDT set.
Returns:
True if the MDT is set.

isNumeric

public boolean isNumeric()
Determine if the field is Numeric.
Returns:
True if the field is Numeric

isAskip

public boolean isAskip()
Determine if the field is Askip. An Askip field is defined by being both protected and numeric.
Returns:
True if it is Askip.

isCursorSelectCapable

public boolean isCursorSelectCapable()
Determine if the field is Cursor Select Capable.
Returns:
True if it is Cursor Select Capable.

getColor

public char getColor()
Determine the 3270 color of the field
Returns:
The color of the field as one of the constants defined in the Kix3270Constants interface.
See Also:
Kix3270Constants

getCharSet

public short getCharSet()
Determine the character set of the field
Returns:
The character of the field as a short. This is the 3270 datastream defined value for the character set.

getData

public char[] getData()
Get a copy of the data associated with this field.
Returns:
The data.
See Also:
setData(char[]), getDataLength()

setData

public void setData(char[] newData)
Set the data in the field to the data provided. The data provided must be the same length as the getDataLength() method returns. The MDT also gets set.
Parameters:
newData - The data.
Throws:
IllegalArgumentException - if newData is null or is not equal in length to the value returned by getDataLength().
IllegalStateException - if the field is protected.
See Also:
getData(), getDataLength()

getText

public String getText()
Get a textual representation of the data in the field. All of the nulls in the field are removed, and the other data is placed in a String.
See Also:
setText(java.lang.String)

setText

public void setText(String theText)
Set the value of the field from a String.
Parameters:
theText - the text.
Throws:
IllegalArgumentException - if the Text is too long for the field.
IllegalStateException - if the field is protected.
See Also:
getText()

getCharAttributes

public char[] getCharAttributes()
Get the extended attributes. This is an array of extended attributes, one for each location in the field.
Returns:
The attributes

getCharColors

public char[] getCharColors()
Get the extended colors.
Returns:
The colors

getFirstCharOffset

public int getFirstCharOffset()
Get the offset of the first character in the field (as opposed to the attribute byte).
Returns:
The offset
See Also:
getLastCharOffset()

getLastCharOffset

public int getLastCharOffset()
Get the offset of the last character in the field (as opposed to the attribute byte).
Returns:
The offset
See Also:
getFirstCharOffset()

toString

public String toString()
Creates a string representation of the KixField.
Returns:
A String representation.
Overrides:
toString in class Object


Copyright (c) 2001 by Sun Microsystems, Inc. All Rights Reserved