com.microfocus.cobol.lang
Class CobolTime

java.lang.Object
  extended bycom.microfocus.cobol.lang.CobolTime
All Implemented Interfaces:
DataType

public class CobolTime
extends Object
implements DataType

Java class for a CobolTime field

Copyright: Copyright (c) 2002-2003
Company: Micro Focus International Ltd

Since:
Net Express 4.0, Server Express 4.0
Version:
3.5, 2/11/03

Constructor Summary
CobolTime()
          Construct a CobolTime type using the current time
CobolTime(Time sqlTime)
          Construct a CobolTime type using the specified time
CobolTime(Time sqlTime, String encoding)
          Construct a CobolTime given a specific time and encoding
Example:
 
Method Summary
 byte[] getBytes()
          public method called by the COBOL Runtime to allow the CobolTime instance to update its Java represenation of the CobolTime field.
 String getEncoding()
          returns the current encoding
 void synchronizeData()
          public method called by the COBOL Runtime to allow the CobolTime instance to update its Java represenation of the CobolTime field.
 String toString()
          returns a String representation of the CobolTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CobolTime

public CobolTime()
Construct a CobolTime type using the current time


CobolTime

public CobolTime(Time sqlTime)
Construct a CobolTime type using the specified time

Parameters:
sqlTime -

CobolTime

public CobolTime(Time sqlTime,
                 String encoding)
          throws UnsupportedEncodingException
Construct a CobolTime given a specific time and encoding
Example:
 CobolTime parm = new CobolTime(sqlTime);
 retcode = RuntimeSystem.cobcall("cblstime",new ParameterList().add(parm));
 System.out.println(sqlTime);

 with the COBOL program cblstime.cbl being:

 working-storage section.
 linkage section.
 01 jsql-time.
   03 jhour     pic 99.
   03 filler    pic x.
   03 jminute   pic 99.
   03 filler    pic x.
   03 jseconds  pic 99.

 procedure division using jsql-time.
  display "COBOL -> " jsql-time.
  add 1 to jhour
  exit program returning 0.
 

Parameters:
sqlTime -
encoding -
Method Detail

getBytes

public byte[] getBytes()
                throws CobolException,
                       Exception
public method called by the COBOL Runtime to allow the CobolTime instance to update its Java represenation of the CobolTime field.

Specified by:
getBytes in interface DataType
Returns:
Throws:
CobolException
Exception

synchronizeData

public void synchronizeData()
                     throws CobolException,
                            Exception
public method called by the COBOL Runtime to allow the CobolTime instance to update its Java represenation of the CobolTime field.

Specified by:
synchronizeData in interface DataType
Throws:
CobolException
Exception

getEncoding

public String getEncoding()
returns the current encoding

Returns:
a string

toString

public String toString()
returns a String representation of the CobolTime

Returns:
a string



Copyright © 2000 Micro Focus International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.