Next: 6 Glossary
Up: 7 <
Previous: 4 GAT Application Utility
  Contents
Subsections
5 External Classes
The present document relies on various occasions on
which are not GATObjects. The realisation and
implementation of these types is in general language dependent, and
in many cases can be reduced to native classes. This
appendix describes the minimal functionality the GAT
expects from these types. When in some language an equivalent of
such classes does not exist, GAT has to implement it.
For some of the listed classes, like Buffer, a functionally
extended equivalent MAY be added as GATClass (e.g.
GATBuffer) in a later version of the specification.
List
An of this is a list of
instances. Some languages have ``native'' List types
which MAY be used. If no such native List type exists, then a GAT
implementation must include a List type.
Tests this List for equality with the passed instance.
If the passed is not a List instance, then this operation immediately
returns False.
If the passed is a List instance, then it is deemed equal to this
if it consists of the ``same'' elements, as determined by the Equals operation
on the respective elements, in the same order as this List instance.
Inputs:
- Object -- object -- Object to test for equality.
Outputs:
- Bool -- equal -- Boolean indicating equality.
String
An of the String represents
a character string. The String provides various
for manipulation of String instances.
Constructs a new String by decoding the specified List of bytes
using the specified charset. The length of the new String is
a function of the charset, and hence MAY not be equal to the
length of the byte List. The behaviour of this constructor when
the given bytes are not valid in the given charset is
unspecified.
The currently supported charsets are as follows
- US-ASCII -- Seven-bit ASCII, a.k.a. ISO646-US,
a.k.a. the Basic Latin block of the Unicode character set
- ISO-8859-1 -- ISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1
- UTF-8 -- Eight-bit UCS Transformation Format
- UTF-16BE -- Sixteen-bit UCS Transformation Format, big-endian byte order
- UTF-16LE -- Sixteen-bit UCS Transformation Format, little-endian byte order
- UTF-16 -- Sixteen-bit UCS Transformation Format, byte order identified by an optional
byte-order mark
Inputs:
- Buffer -- buffer -- The bytes to be decoded into characters.
- String -- charset -- Name of a supported charset.
Compares this string to the specified object. The result is True
if and only if the argument is not null and is a String object
that represents the same sequence of characters as this object
Inputs:
- Object -- object -- Object to test for equality.
Outputs:
- Bool -- equal -- Boolean indicating equality.
Destroys this String object.
Encodes this String into a sequence of bytes using the named
charset, storing the result into a new byte List. The behaviour
of this when this string cannot be encoded in
the given charset is unspecified.
Inputs:
- String -- charset -- Charset to use for conversion.
Outputs:
- Buffer -- buffer -- Resultant bytes.
Buffer
A buffer is a container for arbitrary data. In most languages,
this can be represented as an array of bytes. The application is
responsible for reading and writing such buffers, and in
particular for correct (de)serialisation of primitive and complex
types during that process.
The GAT API specification MAY in a later version be extended with
a GATBuffer class providing more sophisticated handling of typed
data.
Buffers need not to be safe for use by multiple concurrent
threads. If a buffer is to be used by more than one thread then
access to the buffer SHOULD be controlled by appropriate
synchronisation.
Next: 6 Glossary
Up: 7 <
Previous: 4 GAT Application Utility
  Contents
Andre Merzky
2004-05-20
|