All Packages Class Hierarchy This Package Previous Next Index
Class pointer.PLong
java.lang.Object
|
+----pointer.Pointer
|
+----pointer.PLong
- public class PLong
- extends Pointer
This is a pointer to a long, 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.
-
PLong(long)
- 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
val
public long val
- The value which is pointed to.
PLong
public PLong(long initVal)
- The value can be initialized by the constructor
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
All Packages Class Hierarchy This Package Previous Next Index