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
-
val
- The value which is pointed to.
-
PDouble()
- If no initial value given, start with zero
-
PDouble(double)
- The value can be initialized by the constructor
-
clone()
- Create a new object of the same type with the same value
-
copyInto(Pointer)
- Copy the value of this object into another of the same type
-
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.
-
toDouble()
- If a pointer to a numeric type, convert the .val field to a double,
else just return 0.
-
toString()
- pointers convert to strings just as their values convert
-
unparse(Unparser, int)
- Output a description of this object that can be parsed with parse().
val
public double val
- The value which is pointed to.
PDouble
public PDouble(double initVal)
- The value can be initialized by the constructor
PDouble
public PDouble()
- If no initial value given, start with zero
clone
public final Object clone()
- Create a new object of the same type with the same value
- Overrides:
- clone in class Pointer
copyInto
public final void copyInto(Pointer obj)
- Copy the value of this object into another of the same type
- Overrides:
- copyInto in class Pointer
toString
public String toString()
- pointers convert to strings just as their values convert
- Overrides:
- toString in class Object
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
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
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