Class Registers

A Register is string of text indexed by a single character. Typically the text is taken from selected buffer text and the index character is a keyboard character selected by the user.

The application maintains a single Registers object consisting of an dynamically sized array of Register objects. The Registers class defines a number of methods that give each register the properties of a virtual clipboard.

The following methods provide a clipboard operations for register objects:

The following methods provide a lower-level interface for working with registers:

Interface Registers.Register

This interface requires implementation of two methods: setValue(), which takes a String parameter, and toString(), which return a textual representation of the register's contents. Two classes implement this interface. A ClipboardRegister is tied to the contents of the application's clipboard. The application assigns a ClipboardRegister to the register indexed under the character $. A StringRegister is created for registers assigned by the user. In addition, the application assigns to the StringRegister indexed under % the last text segment selected in the text area.

A Register object does not maintain a copy of its index key. Indexing is performed by the Registers object.