public class EPLI
extends java.lang.Object
main()
printing the runtime library versionModifier and Type | Field and Description |
---|---|
static java.math.RoundingMode |
RoundingRound |
static java.lang.String |
ROUNDINGROUND |
static java.math.RoundingMode |
RoundingTruncation
BigDecimal changes in scale are done with "setScale(n, rounding-mode)"
use "HALF_EVEN" for traditional numeric rounding and "DOWN" for truncation
From IBM Ent PL/I Lang Ref Man p.79:
"Converting arithmetic precision
When an arithmetic value has the same data attributes (except for precision) as the target,
precision conversion is required.
|
static java.lang.String |
ROUNDINGTRUNCATION |
Constructor and Description |
---|
EPLI() |
Modifier and Type | Method and Description |
---|---|
static java.util.Properties |
Annotations(Group group,
java.lang.String fullName)
look for a member (field) within a group (class) and return
annotations attached to it.
|
static void |
Assert(boolean test,
java.lang.String... msgs)
Throw an ERROR Condition if an unexpected situation occurs
|
static BitN |
BitN(BitN inBits)
Runtime copy constructor of BIT(n) since BitN doesn't have one.
|
static BitN |
BitN(int nbits,
BitN inBits)
Runtime copy constructor of BIT(n) since BitN doesn't have one.
|
static BitN |
BitNAnd(BitN op1,
BitN op2)
Runtime & operator for BIT(n) since BitN doesn't have one.
|
static BitN |
BitNNot(BitN inBits)
Runtime prefix ^ operator for BIT(n) since BitN doesn't have one.
|
static BitN |
BitNOr(BitN op1,
BitN op2)
Runtime | operator for BIT(n) since BitN doesn't have one.
|
static BitN |
BitNXor(BitN op1,
BitN op2)
Runtime infix ^ operator for BIT(n) since BitN doesn't have one.
|
static void |
ByAddress(java.lang.Object to,
java.lang.Object from)
Assign interior of one object to another matching object type,
essentially copying one object to another "by address." allows changing
immutable objects (e.g., String, Double, FixedBin) passed as parameters.
|
static void |
ByValue(java.lang.Object to,
java.lang.Object from)
Assign an entire group to a copy of another matching
group, essentially copying the interior fields of a Group "by value."
|
static boolean |
CheckLic()
Check licensing of the Elastic PL/I Runtime
intended to be invoked by a static constructor of one of the
core EPLI runtime classes, such as Group
|
static java.nio.charset.Charset |
DefaultCharset()
get PL/I's mirror of Charset.defaultCharset() that is initially set from
the JVM's start-up Charset.defaultCharset() but can be modified with
RuntimeOption("CHARSET=chechen").
|
static java.lang.Object |
GetAnnotation(java.lang.Class<?> annotation,
java.lang.Object variable)
GetAnnotation - get the value of @BIT, @CHAR, @PIC or @VARY annotation
associated with an object.
|
static java.lang.Object |
GetCopy(Group grp,
java.lang.String name)
GetCopy - Use reflection to get a copy of a non-static field within a group
|
static java.lang.Object[] |
GetExternal(java.lang.String name,
java.lang.Object var)
Define a new or return an existing External variable
|
static boolean |
Has(Group grp,
java.lang.String name)
Has - Use reflection to answer whether a Group object has
a named non-static member
|
static java.lang.Object |
LookupProgram(java.lang.Class<?> klass)
Lookup a pre-registered instance of an EXTERNAL PROCEDURE by its Java class
and thread currently running.
|
static void |
main(java.lang.String[] args)
Runtime module main routine prints version info
and double-check the Elastic PL/I Runtime license
for the current user.
|
static java.lang.Object |
RegisterProgram(java.lang.Class<?> klass,
boolean isStatic)
Create and register an instance of an EXTERNAL PROCEDURE by name and
by this thread such that all threads that lookup this
procedure by the java class in which it is contained.
|
static void |
ResetProgram()
During reinitialization of an entire JVM running this PL/I program (when would that
occur? dunno) you might want to clear out the Program Manager cache
|
static java.lang.String |
RuntimeOption(java.lang.String option)
Interrogate runtime options that are set as either
properties or environment variables.
|
static void |
RuntimeOptions(java.lang.String[] options)
interrogate String args (from main method) for runtime
option assignments (those with "name=value") and assign them
as well as remove them from the list
|
static java.lang.String |
toFixedChar(java.lang.String inString,
int len)
Simulate CHAR(n) datatypes by padding or truncating
string to length
|
static java.lang.String |
toVarChar(BitN inBits)
Runtime conversion from BIT(n) to CHAR(m) VARYING
|
static java.lang.String |
toVarChar(BitN inBits,
int N)
Runtime conversion from BIT(n) to CHAR(m) VARYING
|
static java.lang.String |
toVarChar(java.lang.String inString,
int maxLen)
Runtime conversion CHAR(n) or CHAR(n) VARYING to CHAR(m) VARYING
|
public static final java.math.RoundingMode RoundingTruncation
public static final java.lang.String ROUNDINGTRUNCATION
public static final java.math.RoundingMode RoundingRound
public static final java.lang.String ROUNDINGROUND
public static java.lang.String RuntimeOption(java.lang.String option)
option
- - the option to interrogate and return
the value or, if NOEXECOPS, ignore all further attempts
to interrogate these options and EXECOPS, resume
attempts to interrogate. if name=value then the option
is set instead of interrogatedpublic static java.nio.charset.Charset DefaultCharset()
public static void RuntimeOptions(java.lang.String[] options)
options
- - an array of arguments to the main procedure
some of which may be of the form name=value in which case set
those runtime options (and remove them from the list of options)public static java.lang.Object[] GetExternal(java.lang.String name, java.lang.Object var)
name
- - the name of this external object (all upper case)var
- - an Object of the type expected for this external namepublic static java.lang.String toFixedChar(java.lang.String inString, int len)
inString
- - input stringlen
- - defined fixed length of the stringpublic static java.lang.String toVarChar(java.lang.String inString, int maxLen)
inString
- - input StringmaxLen
- - the maximum length of this var charpublic static java.lang.String toVarChar(BitN inBits)
inBits
- - input BitNpublic static java.lang.String toVarChar(BitN inBits, int N)
inBits
- - input BitNN
- - the number of bits to return or 0 meaning
the length of the BitNpublic static BitN BitN(BitN inBits)
inBits
- - input BitNpublic static BitN BitN(int nbits, BitN inBits)
nbits
- - only copy of to this number of bits (returned BitN cardinality)inBits
- - input BitNpublic static BitN BitNAnd(BitN op1, BitN op2)
op1
- - input BitN to and with ...op2
- - ... the other set of BitNpublic static BitN BitNOr(BitN op1, BitN op2)
op1
- - input BitN to and with ...op2
- - ... the other set of BitNpublic static BitN BitNNot(BitN inBits)
inBits
- - input BitNpublic static BitN BitNXor(BitN op1, BitN op2)
op1
- - input BitNop2
- - input BitNpublic static boolean CheckLic()
public static void Assert(boolean test, java.lang.String... msgs)
test
- - boolean - do nothing if true, raise a Condition if falsepublic static void ByAddress(java.lang.Object to, java.lang.Object from)
to
- - the destination objectfrom
- - the source objectpublic static void ByValue(java.lang.Object to, java.lang.Object from)
to
- - the target groupfrom
- - the source grouppublic static java.util.Properties Annotations(Group group, java.lang.String fullName)
group
- - a group containing ...fullName
- - ... a member namepublic static boolean Has(Group grp, java.lang.String name)
grp
- - the source groupname
- - a potential field within that grouppublic static java.lang.Object GetCopy(Group grp, java.lang.String name)
grp
- - the source groupname
- - a potential field within that grouppublic static java.lang.Object GetAnnotation(java.lang.Class<?> annotation, java.lang.Object variable)
annotation
- - the interface class of the annotation requested,
sBIT.class, CHAR.class, PIC.class or VARY.class.variable
- - the variable to test for the annotationpublic static java.lang.Object RegisterProgram(java.lang.Class<?> klass, boolean isStatic)
klass
- - the class containing the external procedure to register.
for Elastic PL/I classes it is the CamelCase of the camelBack procedure
name to be called (PL/I PROC MY_PROC is generated by epli as
procedure myProc() in class MyProc).isStatic
- - lookup is done on a per thread basis, unless isStatic
is defined in which case there is effectively one instance of this class
used by all threads, making it effectively static. in either case
variables declared as STATIC or EXTERNAL within the procedure will be shared
across all threads within the JVM.Condition.ERROR
- with condition code PROCEDURENOTFOUND if this is not a
PL/I procedure that has been declared and whose class is avalable to this JVM's
class loader. If this is a COBOL or JAVA program that must be invoked, declare
your procedure with the correct LINKAGE and other Program Managers for them.public static java.lang.Object LookupProgram(java.lang.Class<?> klass)
klass
- - the class containing the external procedure to register.
for Elastic PL/I classes it is the CamelCase of the camelBack procedure
name to be called (PL/I PROC MY_PROC is generated by epli as
procedure myProc() in class MyProc).public static void ResetProgram()
public static void main(java.lang.String[] args)
args
- - arguments ignored, unless "-test" is given