All Packages Class Hierarchy This Package Previous Next Index
Class Thing
java.lang.Object
|
+----Thing
- public class Thing
- extends java.lang.Object
An Experimental polymorphic object. A Thing can
a large number of different types of thing at different
times and can identify its type and value in most cases.
The precide type of Thing is determined when it is constructed.
Constructor Index
-
Thing()
- Default constructor for Thing of unknown type
-
Thing(boolean)
- Construct a Thing that is actually a boolean
-
Thing(char)
- Construct a Thing that is actually a char
-
Thing(double)
- Construct a Thing that is actually a double
-
Thing(float)
- Construct a Thing that is actually a float
-
Thing(int)
- Construct a Thing that is actually an int
-
Thing(long)
- Construct a Thing that is actually a long
-
Thing(Object)
- Default constructor for an Object of any class
Method Index
-
myClass()
- Identifies the class of the current thing
-
toInteger()
- If the thing is an Integer then its value can be found
else an exception may be thrown
-
toString()
- Converts a Thing into a string
-
whoAmI()
- prints out the class and value of the current thing.
Constructors
Thing
public Thing()
Default constructor for Thing of unknown type
Thing
public Thing(java.lang.Object x)
Default constructor for an Object of any class
Thing
public Thing(int x)
Construct a Thing that is actually an int
Thing
public Thing(long x)
Construct a Thing that is actually a long
Thing
public Thing(float x)
Construct a Thing that is actually a float
Thing
public Thing(double x)
Construct a Thing that is actually a double
Thing
public Thing(char x)
Construct a Thing that is actually a char
Thing
public Thing(boolean x)
Construct a Thing that is actually a boolean
Methods
myClass
public java.lang.String myClass()
Identifies the class of the current thing
- Returns:
- The name of the actual actual class of the polymorphic thing
whoAmI
public void whoAmI()
prints out the class and value of the current thing.
toString
public java.lang.String toString()
Converts a Thing into a string
- Overrides:
- toString in class java.lang.Object
toInteger
public java.lang.Integer toInteger()
If the thing is an Integer then its value can be found
else an exception may be thrown
All Packages Class Hierarchy This Package Previous Next Index