[prev] [up] [next]

Other classes

There are many other useful classes found in the system. Only a few of them are mentioned below.

Use the systemBrowser to have a more detailed look into the implementation.

Time

Instances of Time represent a particular time of day.
The typical uses are:

The Time class also provides useful methods to measure the execution time of a block:

    Time millisecondsToRun:[...]
and to get the internal (millisecond-)timer's value.

Notice that Time only represents times within a day - instances do not differenciate between times of different dates. Use Timestamp to represent a time at a particular date.

More details are found in the "Time class documentation" and in the "Timestamp class documentation".

Date

Date represents a particular calendar day.

Typical uses are:

The Date class protocol also provides many methods to convert months or days to/from string representation and various queries:

More details are found in the "Date class documentation".

Notice:
In previous versions, dates were limited to being greater or equal to 1-jan-1901. This limitation was removed in 6.2.5. Arbitrary dates can now be constructed and compared. However, for all leap year computations, the gregorial calendar is used, and no julian conversion is attempted (i.e. the so called "proleptic gregorian calendar" is used).

Timestamp

Timestamps represent a point in time in millisecond resolution. The internal representation is based on utc (i.e. every timestamp keeps its time as a utc time), however it is possible to convert timestamps into other timezones or to make them explicit UtcTimestamps. These only have different external print formats - the time information itself is not affected. Thus it is possible to compare two timestamps from different timezones for equality and order, without a need to care for timezones on a programmer level.
Typical uses are:

Read more in the "Timestamp class documentation".

TimeDuration

These represent a time period in millisecond resolution. They are mostly used for their nice printed representation. You will usually get instances of timeDuration when subtracting times or timestamps.
Typical uses are:

Read more in the "Timeduration class documentation".

Character

Instances of Character represent printable characters. The character range is not limited to 8bit; 16bit and even 32 bit characters are possible (although the windows operating system is limited to 16bit).

Characters are most often used as elements of String and TwoByteString; on their own, they are seldom encountered.
Typical uses are:

More details are found in the "Character class documentation".

Point

Instances of Point represent a coordinate in 2D space. They are most often used in the graphical user interface to represent window positions, window extents, position of graphical objects etc.
Typical uses are:

More details are found in the "Point class documentation".

Rectangle

Like with Point, instances of Rectangle are used in the graphical user interface. They represent a rectangular area defined by an originPoint and a cornerPoint. (the actual internal implementation may be different).
Typical uses are:

More details are found in the "Rectangle class documentation".

Boolean

Boolean is the abstract superclass of the two classes True and False, of which each has only one instance: true and false respectively.

Conceptionally, conditional evaluation of expressions is implemented by booleans; however, most control structures are inline coded by the compilers for more performance.
This means, that even though you find the #ifTrue: and #ifFalse: methods in these two classes, these methods are rarely executed.

More details are found in the "Boolean class documentation".

Block

Blocks represent pieces of executable code, which can be evaluated upon request. Conceptionally, all control structures in smalltalk are implemented using blocks; however, most are inline coded by the compilers for more performance.
Blocks keep the methods environment in which they where created (they are really closures). Therefore, it is possible to access method locals from within a block even after the creating method has returned (For the curious: as in ST-80).

Using blocks, you can create your own control, enumeration and looping constructs.
Typical uses are:

To make good use of the smalltalk language, blocks should be understood in depth.

More details are found in the "Block class documentation".

OperatingSystem

Class OperatingSystem offers low level access to the underlying OS services. The actual set of implemented messages depends on the particular OS used.
For portability, you should try to avoid these - most of the functionality is also available via standard classes, such as Time, FileStream, Filename etc.

more to be documented

More details are found in the "OperatingSystem class documentation".

Smalltalk

Class Smalltalk keeps track of all global variables on the system. Also, it offers many functions for system management, initialization, startup and shutdown.

more to be documented

More details are found in the "Smalltalk class documentation".

ObjectMemory

Class ObjectMemory provides access to low level memory management functions. There are methods to control the behavior of the garbage collector, interrupt handling etc.
Also, query methods on memory usage, GC reclamation rates etc. are found there.

more to be documented

More details are found in the "ObjectMemory class documentation".


Copyright © 1996 Claus Gittinger Development & Consulting

<info@exept.de>

Doc $Revision: 1.25 $ $Date: 2014/11/29 11:55:42 $