All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pointer.PDouble

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

public class PDouble
extends Pointer
This is a pointer to a double, 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 PDouble()
If no initial value given, start with zero
 o PDouble(double)
The value can be initialized by the constructor

Method Index

 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 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 double val
The value which is pointed to.

Constructors

 o PDouble
 public PDouble(double initVal)
The value can be initialized by the constructor

 o PDouble
 public PDouble()
If no initial value given, start with zero

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 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
See Also:
Parsable

All Packages  Class Hierarchy  This Package  Previous  Next  Index