All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pointer.PString

java.lang.Object
   |
   +----pointer.Pointer
           |
           +----pointer.PString

public class PString
extends Pointer
This is a pointer to a String, used for pass-by-reference calls. Passing the pointer to a method allows that method to change the value.

This code is (c) 1996 Leemon Baird <leemon@cs.cmu.edu>, http://www.cs.cmu.edu/~baird
The source and object code may be redistributed freely. If the code is modified, please state so in the comments.

Version:
1.0, 9 May 96
Author:
Leemon Baird

Variable Index

 o val
The value which is pointed to.

Constructor Index

 o PString()
 o PString(String)
The value can be initialized by the constructor

Method Index

 o BNF(int)
 o clone()
Create a new object of the same type with the same value
 o copyInto(Pointer)
Copy the value of this object into another of the same type
 o equalVal(Pointer)
Does this pointer and the other have the same value? Different types , such as (int)3 and (long)3 are defined to have different values.
 o parse(Parser, int)
Parse the input file to get the parameters for this object.
 o toDouble()
If a pointer to a numeric type, convert the .val field to a double, else just return 0.
 o toString()
pointers convert to strings just as their values convert
 o unparse(Unparser, int)
Output a description of this object that can be parsed with parse().

Variables

 o val
 public String val
The value which is pointed to.

Constructors

 o PString
 public PString()
 o PString
 public PString(String initVal)
The value can be initialized by the constructor

Methods

 o clone
 public final Object clone()
Create a new object of the same type with the same value

Overrides:
clone in class Pointer
 o copyInto
 public final void copyInto(Pointer obj)
Copy the value of this object into another of the same type

Overrides:
copyInto in class Pointer
 o toString
 public String toString()
pointers convert to strings just as their values convert

Overrides:
toString in class Object
 o toDouble
 public double toDouble()
If a pointer to a numeric type, convert the .val field to a double, else just return 0.

Overrides:
toDouble in class Pointer
 o equalVal
 public boolean equalVal(Pointer obj)
Does this pointer and the other have the same value? Different types , such as (int)3 and (long)3 are defined to have different values.

Overrides:
equalVal in class Pointer
 o BNF
 public String BNF(int lang)
Overrides:
BNF in class Pointer
 o unparse
 public void unparse(Unparser u,
                     int lang)
Output a description of this object that can be parsed with parse().

Overrides:
unparse in class Pointer
 o parse
 public Object parse(Parser p,
                     int lang) throws ParserException
Parse the input file to get the parameters for this object.

Throws: ParserException
parser didn't find the required token
Overrides:
parse in class Pointer

All Packages  Class Hierarchy  This Package  Previous  Next  Index