All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.ifarchive.glk.Prototype

java.lang.Object
   |
   +----org.ifarchive.glk.Prototype

public class Prototype
extends Object
Code to deal with parsing a Glk prototype string. The Prototype class represents one entry; you can use Prototype.parseString() to parse a string to an array of Prototypes.

See Also:
parseString

Variable Index

 o major
The prototype's major type.
 o minor
The prototype's minor type.
 o MOD_ARRAY
This is an array parameter.
 o MOD_NOTNULL
This is a reference parameter which can't be null.
 o MOD_REF_IN
This is a reference parameter being passed in.
 o MOD_REF_OUT
This is a reference parameter being passed out.
 o MOD_RETAINED
This array may be retained by Glk.
 o MOD_STRUCT
This is a structure parameter.
 o modifiers
One or more of the modifiers MOD_* corresponding to modifier characters in the prototype string.
 o structure
Prototypes for each field in the structure.

Method Index

 o isArray()
Is this prototype for an array?
 o isNotNull()
Is this reference non-null?
 o isRef()
Is this a reference argument?
 o parseString(String)
Parse a Glk argument string.
 o toString()
Convert to a printable string.

Variables

 o major
 public char major
The prototype's major type. One of:

 o minor
 public char minor
The prototype's minor type.

 o modifiers
 public int modifiers
One or more of the modifiers MOD_* corresponding to modifier characters in the prototype string.

 o MOD_REF_IN
 public static final int MOD_REF_IN
This is a reference parameter being passed in.

 o MOD_REF_OUT
 public static final int MOD_REF_OUT
This is a reference parameter being passed out.

 o MOD_NOTNULL
 public static final int MOD_NOTNULL
This is a reference parameter which can't be null.

 o MOD_STRUCT
 public static final int MOD_STRUCT
This is a structure parameter.

 o MOD_ARRAY
 public static final int MOD_ARRAY
This is an array parameter.

 o MOD_RETAINED
 public static final int MOD_RETAINED
This array may be retained by Glk. The Java binding ignores this and assumes all arrays may be retained.

 o structure
 public Prototype structure[]
Prototypes for each field in the structure. Null if this prototype is not for a structure.

Methods

 o isRef
 public boolean isRef()
Is this a reference argument?

Returns:
true if this is a pass-in or pass-out reference.
 o isNotNull
 public boolean isNotNull()
Is this reference non-null?

Returns:
true if this reference can't be null.
 o isArray
 public boolean isArray()
Is this prototype for an array?

Returns:
true if this prototype is for an array parameter.
 o toString
 public String toString()
Convert to a printable string.

Returns:
a printed representation of this object.
Overrides:
toString in class Object
 o parseString
 public static Prototype[] parseString(String proto)
Parse a Glk argument string. Converts the encoded string into an array of Prototype objects.

Parameters:
proto - The string to parse, which must be a complete Glk argument string or structure definition string.
Returns:
an array of Prototype objects, one for each argument.

All Packages  Class Hierarchy  This Package  Previous  Next  Index