Initializer
Identifier(String name, Boolean usePrefix)
Parameters:
  • name

    The name of the identifier.

  • usePrefix

    If true, use the \i/\I prefix.

    This property is only of concern to tools which deal immediately with source code; it does not influence the equality of Identifier instances.

    (If this is false and the name requires a prefix, an AssertionError is thrown.)

Attributes
childrenshared actual [] children

The child nodes of this node.

hashshared actual Integer hash

The hash value of the value, which allows the value to be an element of a hash-based set or key of a hash-based map. Implementations must respect the constraint that:

  • if x==y then x.hash==y.hash.

Therefore, a class which refines equals must also refine hash.

Because the Integer type is platform-dependent a compiler for a given platform is permitted to further manipulate the calculated hash for an object, and the resulting hash may differ between platforms.

Refines Object.hash
nameshared default String name

The name of the identifier.

prefixshared formal String prefix

The prefix for this kind of identifier – \i for a lowercase identifier, \I for an uppercase identifier.

textshared String text

The text of the identifier, that is its name and, if used, the prefix.

usePrefixshared default Boolean usePrefix

If true, use the \i/\I prefix.

This property is only of concern to tools which deal immediately with source code; it does not influence the equality of Identifier instances.

(If this is false and the name requires a prefix, an AssertionError is thrown.)

Inherited Attributes
Attributes inherited from: Node
Attributes inherited from: Object
hash, string
Methods
copyshared formal Identifier copy(String name = ..., Boolean usePrefix = ...)

Creates a copy of this identifier. All parameters default to the value of the corresponding parameter of this instance.

Parameters:
  • name = this.name
  • usePrefix = this.usePrefix
Inherited Methods
Methods inherited from: Node
Methods inherited from: Object
equals