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.

In general, hash values vary between platforms and between executions of the same program.

Note that when executing on a Java Virtual Machine, the 64-bit Integer value returned by an implementation of hash is truncated to a 32-bit integer value by taking the exclusive disjunction of the 32 lowest-order bits with the 32 highest-order bits, before returning the value to the caller.

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.)

validshared Boolean valid

Whether this identifier is a valid Ceylon identifier. The LIdentifier.internal() and UIdentifier.internal() constructors allow compilers and other tools to create identifiers that contain dollar signs; these identifiers will never collide with regular Ceylon identifiers, because they are not valid in Ceylon.

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.na
  • usePrefix = = this.usePref
Inherited Methods
Methods inherited from: Node
Methods inherited from: Object
equals