New Objects Resulting from Conversions

A new class instance is implicitly created when:

  • The string, prompt or document concatenation operator + is used in an expression, resulting in a new object of type String, Prompt, or Document.

  • The prompt escalation, time of day prompt, time of week prompt, day of week prompt or random prompt operator || is used in an expression.

  • The prompt substitution operator ||| is used in an expression.

  • The time of day document, time of week document or day of week document operator || is used in an expression.

  • The compound grammar operator || is used in an expression.

  • The String Concatenation Operator +, which, when given a String operand and a reference, converts the reference to a String by invoking the toString method of the referenced object (using "null" if either the reference or the result of toString is a null reference) or reads the whole document and converts it as a string if the referenced object is of type Document, and then produces a newly created String that is the concatenation of the two strings.

  • The Document Concatenation Operator +, which when given a Document operand and a reference to another Document type produces a newly created Document that is the concatenation of the two documents.

  • The time of day document, time of week document and day of week document operator || ((Prompt Escalation Operator), which when given a Document operand and a reference to another Document type produces a newly created Document based on the qualifiers having been applied to the two document operands.

  • The Prompt Concatenation Operator +,, which, when given a Prompt operand and a reference to a char, Currency, Date, Document, java.io.File, java.io.InputStream, Language, Prompt, String, java.net.URL, Time or any numeral types, converts the reference to a Prompt based on Table - Prompt Concatenation Conversion Result, and then produces a newly created Prompt that is the concatenation of the two prompts.

Note

The types with the asterisk (*) require that the proper language pack be installed. The asterisk is not part of the type.

Prompt Concatenation Conversion Result

Type

Prompt Result

char*

Spoken representation of the character

Currency*

Spoken representation of the currency designator

Date*

Spoken representation of the date

Document

Assumes document represents a properly encoded prompt and plays its content

java.io.File

Assumes file represents a properly encoded prompt and plays its content

java.io.InputStream

Assumes stream represents a properly encoded prompt and plays its content

Language*

Spoken representation of the represented language

Prompt

No conversion needed

String*

Spells back the string one character at a time

java.net.URL

Assumes referenced content represents a properly encoded prompt and plays its content

Time*

Spoken representation of the time

Any numeral types*

Spoken representation of the value

  • The prompt escalation, time of day prompt, time of week prompt, and day of week prompt operator || ((Prompt Escalation Operator ||), which when given a Prompt operand and a reference to another Prompt type produces a newly created Prompt based on the qualifiers having been applied to the two prompt operands.

  • The Prompt Substitution Operator |||, which when given a Prompt operand and a reference to another Prompt type produces a newly created Prompt.

  • The compound grammar operator ||, which when given a Grammar operand and a reference to another Grammar type produces a newly created Grammar.

  • The Type Comparison Operator instanceof

  • The Reference Equality Operators == and !=

  • The Conditional Operator ? :

  • Prompt Qualifier Operator @, which accepts either a DayOfWeekLiteral, Language, Time, or numeral type as its right hand-side operand and results in the same prompt/document being qualified in order to be used with the prompt/document container operator || to create a day of week prompt/document, a time of day prompt/document or a time of week prompt/document, or simply to override the language of a specific prompt/document.

  • Prompt Weight Qualifier Operator %, which accepts a numeral type as its right hand-side operand and results in the same prompt being qualified in order to be used with the prompt container operator || to create a random prompt.

There may be many references to the same object. Most objects have state, stored in the fields of objects that are instances of classes or in the variables that are the components of an array object. If two variables contain references to the same object, the state of the object can be modified using one variable's reference to the object, and then the altered state can be observed through the reference in the other variable.

  • Array creation expressions, string concatenation expressions, document concatenation expressions, or prompt concatenation expressions throw an OutOfMemoryError if there is insufficient memory available.