public class Area
extends java.lang.Object
Offset
is returned
when a PL/I variable is "allocated within" an Area.
PL/I OFFSETs generated as Java Offset
s hold references to standard Java
objects allocated on the Java heap but are associated with an Area
to
use that class's facilities to marshal and un-marshal associated objects
"within" Area
for I/O operations. It has less to do with actually allocating
the alloted space defined for an Area.Constructor and Description |
---|
Area()
constructor - create a null Area
|
Area(java.lang.String name,
int size)
constructor - create a Area of a certain size and given name
|
Modifier and Type | Method and Description |
---|---|
Pointer<?> |
add(Pointer<?> ptr)
Add a Pointer (or its subclass Offset) to an area
|
void |
allocate(int size)
Allocate or reallocate an area of a certain size
|
void |
free()
Free an area of all objects within it
|
void |
free(Pointer<?> ptr)
Free a specific Pointer (or its subclass Offset) within an Area
|
void |
fromBytes(byte[] bytes)
convert a byte array (from an I/O or Group assignment) to this Area
|
int |
getItems()
return the number of allocated items
|
int |
getLength()
return the allocated length of the Area
|
int |
getSize()
return the declared size of the Area
|
byte[] |
toBytes()
convert Area to a byte array (for an I/O or Group assignment)
|
public Area()
public Area(java.lang.String name, int size)
name
- - the name of this area (for error messages)size
- - size of the areapublic int getSize()
public int getLength()
public int getItems()
public void allocate(int size)
size
- - the size of the areapublic Pointer<?> add(Pointer<?> ptr)
ptr
- - the Pointer or Offset to add to this areapublic void free(Pointer<?> ptr)
ptr
- - a Pointer or Offset to free within this AreaAREA
- CONDITION if not allocatedpublic void free()
public void fromBytes(byte[] bytes)
bytes
- - the byte array that was built with toBytes()public byte[] toBytes()