SUMMARY: MODULE | CLASS | TYPE | PROC | VAR | CONST | DETAIL: TYPE | PROC | VAR | CONST |
This module provides "boxed" representations for the predefined types of Oberon-2. For every predefined type, there is a corresponding class definition. (Ok, that is the theory. Not all types are implemented. If you need one, add it. And do not forget to send me the patch!)
All boxed values are derived from the class Object. Instances are immutable. That is, they take on a value when created and never change it during their lifetime.
ADT:Storable IO Object Object RT0
Class List | |
Boolean | |
LongInt | |
LongReal | |
Object | This is the base type for all boxed versions of Oberon-2 values. |
Set | |
String |
Class Summary: Boolean [Detail] | |
+---RT0.Object | +---Object.Object | +---ADT:Storable.Object | +---Object:Boxed.Object | +--Object:Boxed.Boolean | |
Field Summary | |
value-: BOOLEAN | |
Constructor Summary | |
NewBoolean(BOOLEAN): Boolean Deprecated. | |
ParseBoolean(ARRAY OF CHAR): Boolean | |
Method Summary | |
Cmp(Object): LONGINT | |
Equals(Object): BOOLEAN Indicates whether some other object is "equal to" this one. | |
HashCode(): Hash Returns a hash code value for the object. | |
INIT(BOOLEAN) | |
Load(Reader) Loads data of v from r. | |
Store(Writer) Stores data of v to w. | |
ToString(): STRING Returns a string representation of the object. | |
Inherited Methods | |
From RT0.Object: From Object.Object: From ADT:Storable.Object: From Object:Boxed.Object: |
Class Summary: LongInt [Detail] | |
+---RT0.Object | +---Object.Object | +---ADT:Storable.Object | +---Object:Boxed.Object | +--Object:Boxed.LongInt | |
Field Summary | |
value-: LONGINT | |
Constructor Summary | |
NewLongInt(LONGINT): LongInt Deprecated. | |
ParseLongInt(ARRAY OF CHAR): LongInt | |
Method Summary | |
Add(LongInt): LongInt | |
Cmp(Object): LONGINT | |
Div(LongInt): LongInt | |
Equals(Object): BOOLEAN Indicates whether some other object is "equal to" this one. | |
HashCode(): Hash Returns a hash code value for the object. | |
INIT(LONGINT) | |
Load(Reader) Loads data of v from r. | |
Mod(LongInt): LongInt | |
Mul(LongInt): LongInt | |
Neg(): LongInt | |
Sign(): LONGINT | |
Store(Writer) Stores data of v to w. | |
Sub(LongInt): LongInt | |
ToString(): STRING Returns a string representation of the object. | |
Inherited Methods | |
From RT0.Object: From Object.Object: From ADT:Storable.Object: From Object:Boxed.Object: |
Class Summary: LongReal [Detail] | |
+---RT0.Object | +---Object.Object | +---ADT:Storable.Object | +---Object:Boxed.Object | +--Object:Boxed.LongReal | |
Field Summary | |
value-: LONGREAL | |
Constructor Summary | |
NewLongReal(LONGREAL): LongReal Deprecated. | |
ParseLongReal(ARRAY OF CHAR): LongReal | |
ParseLongRealLiteral(ARRAY OF CHAR): LongReal Like ParseLongReal, but the character of the exponent decides whether the value should be treated as a REAL or LONGREAL literal. | |
Method Summary | |
Add(LongReal): LongReal | |
Cmp(Object): LONGINT | |
Div(LongReal): LongReal | |
Equals(Object): BOOLEAN Indicates whether some other object is "equal to" this one. | |
HashCode(): Hash Returns a hash code value for the object. | |
INIT(LONGREAL) | |
Load(Reader) Loads data of v from r. | |
Mul(LongReal): LongReal | |
Neg(): LongReal | |
Sign(): LONGINT | |
Store(Writer) Stores data of v to w. | |
Sub(LongReal): LongReal | |
ToLongReal(): LONGREAL | |
ToString(): STRING Returns a string representation of the object. | |
Inherited Methods | |
From RT0.Object: From Object.Object: From ADT:Storable.Object: From Object:Boxed.Object: |
Class Summary: Object [Detail] | |
+---RT0.Object | +---Object.Object | +---ADT:Storable.Object | +--Object:Boxed.Object This is the base type for all boxed versions of Oberon-2 values. | |
Method Summary | |
Cmp(Object): LONGINT | |
ToString(): STRING Returns a string representation of the object. | |
Inherited Methods | |
From RT0.Object: From Object.Object: From ADT:Storable.Object: |
Class Summary: Set [Detail] | |
+---RT0.Object | +---Object.Object | +---ADT:Storable.Object | +---Object:Boxed.Object | +--Object:Boxed.Set | |
Field Summary | |
value-: SET | |
Constructor Summary | |
NewSet(SET): Set Deprecated. | |
Method Summary | |
Cmp(Object): LONGINT | |
Equals(Object): BOOLEAN Indicates whether some other object is "equal to" this one. | |
HashCode(): Hash Returns a hash code value for the object. | |
INIT(SET) | |
Load(Reader) Loads data of v from r. | |
Store(Writer) Stores data of v to w. | |
ToLongInt(): LONGINT | |
ToString(): STRING Returns a string representation of the object. | |
Inherited Methods | |
From RT0.Object: From Object.Object: From ADT:Storable.Object: From Object:Boxed.Object: |
Class Summary: String [Detail] | |
+---RT0.Object | +---Object.Object | +---ADT:Storable.Object | +---Object:Boxed.Object | +--Object:Boxed.String | |
Field Summary | |
value-: STRING | |
Constructor Summary | |
NewString(STRING): String Deprecated. | |
ParseString(ARRAY OF CHAR): String | |
Method Summary | |
Cmp(Object): LONGINT | |
Equals(Object): BOOLEAN Indicates whether some other object is "equal to" this one. | |
HashCode(): Hash Returns a hash code value for the object. | |
INIT(STRING) | |
Load(Reader) Loads data of v from r. | |
Store(Writer) Stores data of v to w. | |
ToString(): STRING Returns a string representation of the object. | |
Inherited Methods | |
From RT0.Object: From Object.Object: From ADT:Storable.Object: From Object:Boxed.Object: |
Type Summary | |
ParseFct = (ARRAY OF CHAR): Object |
Procedure Summary | |
BooleanToString(BOOLEAN): STRING Equivalent to calling NewBoolean with value, and then Object.ToString on the result. | |
IntToString(LONGINT): STRING Equivalent to calling NewLongInt with value, and then Object.ToString on the result. | |
LongRealToString(LONGREAL): STRING Equivalent to calling NewLongReal with value, and then Object.ToString on the result. | |
SetToString(SET): STRING Equivalent to calling NewSet with value, and then Object.ToString on the result. |
Variable Summary | |
false-: Boolean | |
oneLongInt-: LongInt | |
oneLongReal-: LongReal | |
true-: Boolean | |
zeroLongInt-: LongInt | |
zeroLongReal-: LongReal |
Class Detail: Boolean |
Field Detail |
FIELD value-: BOOLEAN
Constructor Detail |
PROCEDURE NewBoolean(value: BOOLEAN): Boolean
Deprecated. Use NEW(Boolean, ...) instead.
PROCEDURE ParseBoolean(str: ARRAY OF CHAR): Boolean
Method Detail |
PROCEDURE (v: Boolean) Cmp(y: Object): LONGINT
Redefines: Cmp
PROCEDURE (v: Boolean) Equals(y: Object): BOOLEAN
Indicates whether some other object is "equal to" this one.
The Object.Equals method implements an equivalence relation:
It is reflexive: for any reference value `x', `x.Equals(x)' should return TRUE.
It is symmetric: for any reference values `x' and `y', `x.Equals(y)' should return TRUE if and only if `y.Equals(x)' returns TRUE.
It is transitive: for any reference values `x', `y', and `z', if `x.Equals(y)' returns TRUE and `y.Equals(z)' returns TRUE, then `x.Equals(z)' should return TRUE.
It is consistent: for any reference values `x' and `y', multiple invocations of `x.Equals(y)' consistently return TRUE or consistently return FALSE, provided no information used in equals comparisons on the object is modified.
For any non-NIL reference value `x', `x.Equals(NIL)' should return FALSE.
The `Equals' method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any reference values `x' and `y', this method returns TRUE if and only if `x' and `y' refer to the same object (`x=y' has the value TRUE).
[Description inherited from Equals]
PROCEDURE (v: Boolean) HashCode(): Hash
Returns a hash code value for the object. This method is supported for the benefit of dictionaries such as those provided by ADT:Dictionary.
The general contract of Object.HashCode is:
Whenever it is invoked on the same object more than once during an execution of an application, the Object.HashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
If two objects are equal according to the Object.Equals method, then calling the Object.HashCode method on each of the two objects must produce the same integer result.
It is not required that if two objects are unequal according to the Object.Equals method, then calling the Object.HashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of dictionaries.
As much as is reasonably practical, the Object.HashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required.)
[Description inherited from HashCode]
PROCEDURE (v: Boolean) INIT(value: BOOLEAN)
PROCEDURE (v: Boolean) Load(r: Reader) RAISES Error;
Loads data of v from r. Nested record pointers are loaded by calling the type-bound procecdure Reader.ReadObject. This procedure must be symmetric to Object.Store, or data internalization will break, causing undefined object state or program termination.
Note: When internalizing a file with alien objects, it is possible that the type-bound procedure Object.Load is invoked more than once for a single object. Except for the results of the last call, all duplicates are discarded. Because of this, all changes by this procedure to any program state that is not part of the object v are deprecated.
Pre-condition: This procedure is either activated by a super call, or from the procedure Reader.ReadObject.
[Description inherited from Load]
PROCEDURE (v: Boolean) Store(w: Writer) RAISES Error;
Stores data of v to w. Nested record pointers are stored by calling the type-bound procedure Writer.WriteObject. The procedure is not allowed to make any changes to the global state of the program, except for calling the `Write' methods of the writer w. Any redefinition of this procedure must include a super call, preferably as the first statement of the procedure body.
Pre-condition: This procedure is either activated by a super call, or from the procedure Writer.WriteObject.
[Description inherited from Store]
PROCEDURE (v: Boolean) ToString(): STRING
Returns a string representation of the object. Typically, the string is some form of "natural" representation of the value. For complex objects, it should describe the type and essential attributes of the object. The exact format of the returned value is intentionally left vague.
[Description inherited from ToString]
Class Detail: LongInt |
Field Detail |
FIELD value-: LONGINT
Constructor Detail |
PROCEDURE NewLongInt(val: LONGINT): LongInt
Deprecated. Use NEW(Longint, ...) instead.
PROCEDURE ParseLongInt(s: ARRAY OF CHAR): LongInt
Method Detail |
PROCEDURE (v: LongInt) Add(right: LongInt): LongInt
PROCEDURE (v: LongInt) Cmp(right: Object): LONGINT
Redefines: Cmp
PROCEDURE (v: LongInt) Div(right: LongInt): LongInt
PROCEDURE (v: LongInt) Equals(y: Object): BOOLEAN
Indicates whether some other object is "equal to" this one.
The Object.Equals method implements an equivalence relation:
It is reflexive: for any reference value `x', `x.Equals(x)' should return TRUE.
It is symmetric: for any reference values `x' and `y', `x.Equals(y)' should return TRUE if and only if `y.Equals(x)' returns TRUE.
It is transitive: for any reference values `x', `y', and `z', if `x.Equals(y)' returns TRUE and `y.Equals(z)' returns TRUE, then `x.Equals(z)' should return TRUE.
It is consistent: for any reference values `x' and `y', multiple invocations of `x.Equals(y)' consistently return TRUE or consistently return FALSE, provided no information used in equals comparisons on the object is modified.
For any non-NIL reference value `x', `x.Equals(NIL)' should return FALSE.
The `Equals' method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any reference values `x' and `y', this method returns TRUE if and only if `x' and `y' refer to the same object (`x=y' has the value TRUE).
[Description inherited from Equals]
PROCEDURE (v: LongInt) HashCode(): Hash
Returns a hash code value for the object. This method is supported for the benefit of dictionaries such as those provided by ADT:Dictionary.
The general contract of Object.HashCode is:
Whenever it is invoked on the same object more than once during an execution of an application, the Object.HashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
If two objects are equal according to the Object.Equals method, then calling the Object.HashCode method on each of the two objects must produce the same integer result.
It is not required that if two objects are unequal according to the Object.Equals method, then calling the Object.HashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of dictionaries.
As much as is reasonably practical, the Object.HashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required.)
[Description inherited from HashCode]
PROCEDURE (v: LongInt) INIT(val: LONGINT)
PROCEDURE (v: LongInt) Load(r: Reader) RAISES Error;
Loads data of v from r. Nested record pointers are loaded by calling the type-bound procecdure Reader.ReadObject. This procedure must be symmetric to Object.Store, or data internalization will break, causing undefined object state or program termination.
Note: When internalizing a file with alien objects, it is possible that the type-bound procedure Object.Load is invoked more than once for a single object. Except for the results of the last call, all duplicates are discarded. Because of this, all changes by this procedure to any program state that is not part of the object v are deprecated.
Pre-condition: This procedure is either activated by a super call, or from the procedure Reader.ReadObject.
[Description inherited from Load]
PROCEDURE (v: LongInt) Mod(right: LongInt): LongInt
PROCEDURE (v: LongInt) Mul(right: LongInt): LongInt
PROCEDURE (v: LongInt) Neg(): LongInt
PROCEDURE (v: LongInt) Sign(): LONGINT
PROCEDURE (v: LongInt) Store(w: Writer) RAISES Error;
Stores data of v to w. Nested record pointers are stored by calling the type-bound procedure Writer.WriteObject. The procedure is not allowed to make any changes to the global state of the program, except for calling the `Write' methods of the writer w. Any redefinition of this procedure must include a super call, preferably as the first statement of the procedure body.
Pre-condition: This procedure is either activated by a super call, or from the procedure Writer.WriteObject.
[Description inherited from Store]
PROCEDURE (v: LongInt) Sub(right: LongInt): LongInt
PROCEDURE (v: LongInt) ToString(): STRING
Returns a string representation of the object. Typically, the string is some form of "natural" representation of the value. For complex objects, it should describe the type and essential attributes of the object. The exact format of the returned value is intentionally left vague.
[Description inherited from ToString]
Class Detail: LongReal |
Field Detail |
FIELD value-: LONGREAL
Constructor Detail |
PROCEDURE NewLongReal(val: LONGREAL): LongReal
Deprecated. Use NEW(LongReal, ...) instead.
PROCEDURE ParseLongReal(s: ARRAY OF CHAR): LongReal
PROCEDURE ParseLongRealLiteral(s: ARRAY OF CHAR): LongReal
Like ParseLongReal, but the character of the exponent decides whether the value should be treated as a REAL or LONGREAL literal.
Method Detail |
PROCEDURE (v: LongReal) Add(right: LongReal): LongReal
PROCEDURE (v: LongReal) Cmp(right: Object): LONGINT
Redefines: Cmp
PROCEDURE (v: LongReal) Div(right: LongReal): LongReal
PROCEDURE (v: LongReal) Equals(y: Object): BOOLEAN
Indicates whether some other object is "equal to" this one.
The Object.Equals method implements an equivalence relation:
It is reflexive: for any reference value `x', `x.Equals(x)' should return TRUE.
It is symmetric: for any reference values `x' and `y', `x.Equals(y)' should return TRUE if and only if `y.Equals(x)' returns TRUE.
It is transitive: for any reference values `x', `y', and `z', if `x.Equals(y)' returns TRUE and `y.Equals(z)' returns TRUE, then `x.Equals(z)' should return TRUE.
It is consistent: for any reference values `x' and `y', multiple invocations of `x.Equals(y)' consistently return TRUE or consistently return FALSE, provided no information used in equals comparisons on the object is modified.
For any non-NIL reference value `x', `x.Equals(NIL)' should return FALSE.
The `Equals' method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any reference values `x' and `y', this method returns TRUE if and only if `x' and `y' refer to the same object (`x=y' has the value TRUE).
[Description inherited from Equals]
PROCEDURE (v: LongReal) HashCode(): Hash
Returns a hash code value for the object. This method is supported for the benefit of dictionaries such as those provided by ADT:Dictionary.
The general contract of Object.HashCode is:
Whenever it is invoked on the same object more than once during an execution of an application, the Object.HashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
If two objects are equal according to the Object.Equals method, then calling the Object.HashCode method on each of the two objects must produce the same integer result.
It is not required that if two objects are unequal according to the Object.Equals method, then calling the Object.HashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of dictionaries.
As much as is reasonably practical, the Object.HashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required.)
[Description inherited from HashCode]
PROCEDURE (v: LongReal) INIT(val: LONGREAL)
PROCEDURE (v: LongReal) Load(r: Reader) RAISES Error;
Loads data of v from r. Nested record pointers are loaded by calling the type-bound procecdure Reader.ReadObject. This procedure must be symmetric to Object.Store, or data internalization will break, causing undefined object state or program termination.
Note: When internalizing a file with alien objects, it is possible that the type-bound procedure Object.Load is invoked more than once for a single object. Except for the results of the last call, all duplicates are discarded. Because of this, all changes by this procedure to any program state that is not part of the object v are deprecated.
Pre-condition: This procedure is either activated by a super call, or from the procedure Reader.ReadObject.
[Description inherited from Load]
PROCEDURE (v: LongReal) Mul(right: LongReal): LongReal
PROCEDURE (v: LongReal) Neg(): LongReal
PROCEDURE (v: LongReal) Sign(): LONGINT
PROCEDURE (v: LongReal) Store(w: Writer) RAISES Error;
Stores data of v to w. Nested record pointers are stored by calling the type-bound procedure Writer.WriteObject. The procedure is not allowed to make any changes to the global state of the program, except for calling the `Write' methods of the writer w. Any redefinition of this procedure must include a super call, preferably as the first statement of the procedure body.
Pre-condition: This procedure is either activated by a super call, or from the procedure Writer.WriteObject.
[Description inherited from Store]
PROCEDURE (v: LongReal) Sub(right: LongReal): LongReal
PROCEDURE (v: LongReal) ToLongReal(): LONGREAL
PROCEDURE (v: LongReal) ToString(): STRING
Returns a string representation of the object. Typically, the string is some form of "natural" representation of the value. For complex objects, it should describe the type and essential attributes of the object. The exact format of the returned value is intentionally left vague.
[Description inherited from ToString]
Class Detail: Object |
Method Detail |
PROCEDURE (v: Object) Cmp(y: Object): LONGINT
PROCEDURE (v: Object) ToString(): STRING
Returns a string representation of the object. Typically, the string is some form of "natural" representation of the value. For complex objects, it should describe the type and essential attributes of the object. The exact format of the returned value is intentionally left vague.
[Description inherited from ToString]
Class Detail: Set |
Field Detail |
FIELD value-: SET
Constructor Detail |
PROCEDURE NewSet(value: SET): Set
Deprecated. Use NEW(Set, ...) instead.
Method Detail |
PROCEDURE (v: Set) Cmp(y: Object): LONGINT
Redefines: Cmp
PROCEDURE (v: Set) Equals(y: Object): BOOLEAN
Indicates whether some other object is "equal to" this one.
The Object.Equals method implements an equivalence relation:
It is reflexive: for any reference value `x', `x.Equals(x)' should return TRUE.
It is symmetric: for any reference values `x' and `y', `x.Equals(y)' should return TRUE if and only if `y.Equals(x)' returns TRUE.
It is transitive: for any reference values `x', `y', and `z', if `x.Equals(y)' returns TRUE and `y.Equals(z)' returns TRUE, then `x.Equals(z)' should return TRUE.
It is consistent: for any reference values `x' and `y', multiple invocations of `x.Equals(y)' consistently return TRUE or consistently return FALSE, provided no information used in equals comparisons on the object is modified.
For any non-NIL reference value `x', `x.Equals(NIL)' should return FALSE.
The `Equals' method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any reference values `x' and `y', this method returns TRUE if and only if `x' and `y' refer to the same object (`x=y' has the value TRUE).
[Description inherited from Equals]
PROCEDURE (v: Set) HashCode(): Hash
Returns a hash code value for the object. This method is supported for the benefit of dictionaries such as those provided by ADT:Dictionary.
The general contract of Object.HashCode is:
Whenever it is invoked on the same object more than once during an execution of an application, the Object.HashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
If two objects are equal according to the Object.Equals method, then calling the Object.HashCode method on each of the two objects must produce the same integer result.
It is not required that if two objects are unequal according to the Object.Equals method, then calling the Object.HashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of dictionaries.
As much as is reasonably practical, the Object.HashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required.)
[Description inherited from HashCode]
PROCEDURE (v: Set) INIT(value: SET)
PROCEDURE (v: Set) Load(r: Reader) RAISES Error;
Loads data of v from r. Nested record pointers are loaded by calling the type-bound procecdure Reader.ReadObject. This procedure must be symmetric to Object.Store, or data internalization will break, causing undefined object state or program termination.
Note: When internalizing a file with alien objects, it is possible that the type-bound procedure Object.Load is invoked more than once for a single object. Except for the results of the last call, all duplicates are discarded. Because of this, all changes by this procedure to any program state that is not part of the object v are deprecated.
Pre-condition: This procedure is either activated by a super call, or from the procedure Reader.ReadObject.
[Description inherited from Load]
PROCEDURE (v: Set) Store(w: Writer) RAISES Error;
Stores data of v to w. Nested record pointers are stored by calling the type-bound procedure Writer.WriteObject. The procedure is not allowed to make any changes to the global state of the program, except for calling the `Write' methods of the writer w. Any redefinition of this procedure must include a super call, preferably as the first statement of the procedure body.
Pre-condition: This procedure is either activated by a super call, or from the procedure Writer.WriteObject.
[Description inherited from Store]
PROCEDURE (v: Set) ToLongInt(): LONGINT
PROCEDURE (v: Set) ToString(): STRING
Returns a string representation of the object. Typically, the string is some form of "natural" representation of the value. For complex objects, it should describe the type and essential attributes of the object. The exact format of the returned value is intentionally left vague.
[Description inherited from ToString]
Class Detail: String |
Field Detail |
FIELD value-: STRING
Constructor Detail |
PROCEDURE NewString(value: STRING): String
Deprecated. Use NEW(String, ...) instead.
PROCEDURE ParseString(str: ARRAY OF CHAR): String
Method Detail |
PROCEDURE (v: String) Cmp(str: Object): LONGINT
Redefines: Cmp
PROCEDURE (v: String) Equals(y: Object): BOOLEAN
Indicates whether some other object is "equal to" this one.
The Object.Equals method implements an equivalence relation:
It is reflexive: for any reference value `x', `x.Equals(x)' should return TRUE.
It is symmetric: for any reference values `x' and `y', `x.Equals(y)' should return TRUE if and only if `y.Equals(x)' returns TRUE.
It is transitive: for any reference values `x', `y', and `z', if `x.Equals(y)' returns TRUE and `y.Equals(z)' returns TRUE, then `x.Equals(z)' should return TRUE.
It is consistent: for any reference values `x' and `y', multiple invocations of `x.Equals(y)' consistently return TRUE or consistently return FALSE, provided no information used in equals comparisons on the object is modified.
For any non-NIL reference value `x', `x.Equals(NIL)' should return FALSE.
The `Equals' method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any reference values `x' and `y', this method returns TRUE if and only if `x' and `y' refer to the same object (`x=y' has the value TRUE).
[Description inherited from Equals]
PROCEDURE (v: String) HashCode(): Hash
Returns a hash code value for the object. This method is supported for the benefit of dictionaries such as those provided by ADT:Dictionary.
The general contract of Object.HashCode is:
Whenever it is invoked on the same object more than once during an execution of an application, the Object.HashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
If two objects are equal according to the Object.Equals method, then calling the Object.HashCode method on each of the two objects must produce the same integer result.
It is not required that if two objects are unequal according to the Object.Equals method, then calling the Object.HashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of dictionaries.
As much as is reasonably practical, the Object.HashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required.)
[Description inherited from HashCode]
PROCEDURE (v: String) INIT(value: STRING)
PROCEDURE (v: String) Load(r: Reader) RAISES Error;
Loads data of v from r. Nested record pointers are loaded by calling the type-bound procecdure Reader.ReadObject. This procedure must be symmetric to Object.Store, or data internalization will break, causing undefined object state or program termination.
Note: When internalizing a file with alien objects, it is possible that the type-bound procedure Object.Load is invoked more than once for a single object. Except for the results of the last call, all duplicates are discarded. Because of this, all changes by this procedure to any program state that is not part of the object v are deprecated.
Pre-condition: This procedure is either activated by a super call, or from the procedure Reader.ReadObject.
[Description inherited from Load]
PROCEDURE (v: String) Store(w: Writer) RAISES Error;
Stores data of v to w. Nested record pointers are stored by calling the type-bound procedure Writer.WriteObject. The procedure is not allowed to make any changes to the global state of the program, except for calling the `Write' methods of the writer w. Any redefinition of this procedure must include a super call, preferably as the first statement of the procedure body.
Pre-condition: This procedure is either activated by a super call, or from the procedure Writer.WriteObject.
[Description inherited from Store]
PROCEDURE (v: String) ToString(): STRING
Returns a string representation of the object. Typically, the string is some form of "natural" representation of the value. For complex objects, it should describe the type and essential attributes of the object. The exact format of the returned value is intentionally left vague.
[Description inherited from ToString]
Type Detail |
TYPE ParseFct = (str: ARRAY OF CHAR): Object
Procedure Detail |
PROCEDURE BooleanToString(value: BOOLEAN): STRING
Equivalent to calling NewBoolean with value, and then Object.ToString on the result.
PROCEDURE IntToString(value: LONGINT): STRING
Equivalent to calling NewLongInt with value, and then Object.ToString on the result.
PROCEDURE LongRealToString(value: LONGREAL): STRING
Equivalent to calling NewLongReal with value, and then Object.ToString on the result.
PROCEDURE SetToString(value: SET): STRING
Equivalent to calling NewSet with value, and then Object.ToString on the result.
Variable Detail |
VAR false-: Boolean
VAR oneLongInt-: LongInt
VAR oneLongReal-: LongReal
VAR true-: Boolean
VAR zeroLongInt-: LongInt
VAR zeroLongReal-: LongReal