Class CBLPointer

All Implemented Interfaces:
AbstractDataObject, IFormatTypes, ICBLContainer, ICBLDataType, IFieldContainer, ISMDataType, ISMInteger, ISMNumeric, ISMObject
Direct Known Subclasses:
CBLObject

public class CBLPointer extends CBLInteger
Data Type used for emulation of COBOL Pointer fields. Classes declaring this data-type must inherit from CBLBean (or one of its subclasses).
  • Constructor Details

    • CBLPointer

      public CBLPointer(String name, CBLBean owner)
      when the Pointer is redefined - it means the offset maybe passed to it via the Redefined field e.g. 01 WORKING-STORAGE-FIELDS. 03 PTR1 POINTER. 03 INT1 REDEFINES PTR1 PIC S9(09) COMP. ... MOVE 123 to INT1 So, when redefined use the internal CBLInteger value which is shared between this and Redefinition, otherwise use pointerOffset
    • CBLPointer

      public CBLPointer(String name, int[] theDim, CBLBean owner)
    • CBLPointer

      @Deprecated public CBLPointer(String name, String picture, CBLBean owner, int compMode)
      Deprecated.
    • CBLPointer

      public CBLPointer(String name, int[] theDim, String picture, CBLBean owner, int compMode)
    • CBLPointer

      @Deprecated public CBLPointer(String name, String picture, CBLBean owner)
      Deprecated.
    • CBLPointer

      @Deprecated public CBLPointer(String name, int[] theDim, String picture, CBLBean owner)
      Deprecated.
    • CBLPointer

      public CBLPointer(AbstractCBLPrimitive parent, int[] index)
  • Method Details

    • createSubField

      protected final AbstractCBLField createSubField(int[] index)
      Overrides:
      createSubField in class CBLInteger
    • assignValue

      public final void assignValue(AbstractDataObject data)
      Overrides:
      assignValue in class AbstractCBLField
    • assignValue

      public final void assignValue(AbstractDataObject data, int index)
      Used internally by SM/ET Generated DAO objects for arrayed Pointers
      Parameters:
      data -
      index -
    • getTopCharArrayObject

      public com.softwaremining.wrappers.CBLBean.CharArrayObject getTopCharArrayObject()
    • getTopCharArrayObject

      public com.softwaremining.wrappers.CBLBean.CharArrayObject getTopCharArrayObject(int index)
    • getCharArraysManager

      public com.softwaremining.wrappers.CBLBean.CharArraysManager getCharArraysManager()
    • getCharArraysManager

      public com.softwaremining.wrappers.CBLBean.CharArraysManager getCharArraysManager(int index)
    • assignToAddressOf

      public final void assignToAddressOf(CBLPointer sourcePointer)
      Translation of COBOL's
      SET pointer (this) TO ADDRESS OF targetField
      Overrides:
      assignToAddressOf in class AbstractCBLField
      Parameters:
      targetField -
    • assignToAddressOf

      public void assignToAddressOf(AbstractCBLField targetField)
      Translation of COBOL's
      SET pointer (this) TO ADDRESS OF targetField
      Specified by:
      assignToAddressOf in interface ICBLContainer
      Overrides:
      assignToAddressOf in class AbstractCBLField
      Parameters:
      targetField -
    • assignToAddressOf

      public void assignToAddressOf(CBLBean targetWrapper)
      Translation of COBOL's
      SET pointer (this) TO ADDRESS OF targetField
      Specified by:
      assignToAddressOf in interface ICBLContainer
      Overrides:
      assignToAddressOf in class AbstractCBLField
      Parameters:
      targetWrapper -
      targetField -
    • assignToAddressOf

      public void assignToAddressOf(CBLBean targetWrapper, long index)
      Translation of COBOL's
      SET pointer (this) TO ADDRESS OF targetField
      The POINTER dao is expected to be an array of pointers, and the 'index' refers to Pointer array Item.
      I.e. POINTER (this) OCCURS nn TIMES.
      Parameters:
      targetField -
    • assignRedefines

      public void assignRedefines(AbstractCBLField field)
      Description copied from class: AbstractCBLField
      used internally by the framework to manage the COBOL redefinitions
      Overrides:
      assignRedefines in class AbstractCBLField
    • isFieldPointer

      public boolean isFieldPointer()
      a pointer may point to a Field (in same class) or another Data-Access Object (ACMBaseWrappper subclass)
      Returns:
      true if pointing to a field
    • isNull

      public boolean isNull()
      check whether field has been assigned to as yet
      Returns:
      true if not pointing to anything yet
    • assignRedefines

      public final void assignRedefines(AbstractDataObject data)
    • retrieveSQLObject

      public Object retrieveSQLObject()
      Description copied from class: AbstractCBLField
      used internally by framework for database access
      Specified by:
      retrieveSQLObject in interface ISMDataType
      Specified by:
      retrieveSQLObject in interface ISMObject
      Overrides:
      retrieveSQLObject in class AbstractCBLField
    • stringValue

      public String stringValue()
      Specified by:
      stringValue in interface ISMDataType
      Overrides:
      stringValue in class AbstractCBLField
    • retrieveAsStringFormatted

      public String retrieveAsStringFormatted()
      used internally by framework for getting Stringified object values Returns the "storage" format of the field - for computational fields this would be binary
      Specified by:
      retrieveAsStringFormatted in interface ISMObject
      Overrides:
      retrieveAsStringFormatted in class AbstractCBLField
    • retrieveAsString

      public String retrieveAsString()
      Description copied from class: AbstractCBLField
      For a group item - it returns the fully expanded String representing the group. Ie if
         Group contains FIELD-1 PIC (X) OCCURS 4 time.
         field1[0].set("A");
         group.stringValue() returns : "A   " ;
       
      For a field - it returns the value. Ie for an integer (PIC X(5)) value 10 it would return "10" , Please also see retrieveAsStringFormatted which would return "10 "
      Specified by:
      retrieveAsString in interface AbstractDataObject
      Specified by:
      retrieveAsString in interface ISMDataType
      Specified by:
      retrieveAsString in interface ISMObject
      Overrides:
      retrieveAsString in class AbstractCBLField
      Returns:
      String representation of a group
    • retrievePointingTo

      public AbstractDataObject retrievePointingTo()
    • assignValue

      public void assignValue(String newValue)
      Description copied from class: AbstractCBLField
      used internally by framework for setting object values
      Specified by:
      assignValue in interface AbstractDataObject
      Specified by:
      assignValue in interface ISMDataType
      Specified by:
      assignValue in interface ISMObject
      Overrides:
      assignValue in class AbstractCBLField
    • assignValue

      public void assignValue(double newValue)
      Description copied from class: AbstractCBLField
      Method Used internally by framework Set value of the object
      Overrides:
      assignValue in class AbstractCBLField
    • assignValue

      public void assignValue(long newValue)
      Method Used internally by framework Set value of the object
      Overrides:
      assignValue in class AbstractCBLField
    • assignValue

      public void assignValue(int newValue)
      Method Used internally by framework Set value of the object
      Overrides:
      assignValue in class AbstractCBLField
    • initialize

      public void initialize()
      method used internally by framework to initialize the field to its defaultValue
      Specified by:
      initialize in interface ISMObject
      Overrides:
      initialize in class AbstractCBLPrimitive
    • assignDefaultValue

      public final void assignDefaultValue(AbstractDataObject data)
    • retrieveSubField

      public CBLPointer retrieveSubField(int index)
    • incrementPointerOffset

      public void incrementPointerOffset(double pointerOffst)
      POINTER ARITHMATIC - limited functionality. EG. in COBOL we can have
        ADD 2 TO WS-SAD-PTR
       
      This framework does not work with direct memory position - but instead it will offset the pointer position. THis means if it was pointing to a field X(10), incrementing the address by 2 is equivalant of field.substring(2);
      Overrides:
      incrementPointerOffset in class AbstractCBLField
    • incrementPointerOffset

      public void incrementPointerOffset(Number pointerOffst)
    • equals

      public boolean equals(CBLPointer pointerField)
      checks if Two Pointers point to same area
      Overrides:
      equals in class AbstractCBLField
      Parameters:
      value -
      Returns:
    • pointsTo

      public boolean pointsTo(CBLBean targetWrapper)
    • assignExemptFromMemRelease

      public final void assignExemptFromMemRelease(boolean exempt)
    • isExemptFromMemRelease

      public boolean isExemptFromMemRelease()