Dotty Documentation

0.15.0-bin-SNAPSHOT

abstract class Name
extends Designator with PreName

A name if either a term name or a type name. Term names can be simple or derived. A simple term name is essentially an interned string stored in a name table. A derived term name adds a tag, and possibly a number or a further simple name to some other name.

[-] Constructors

Name ( )
Name ( self: Name )

[-] Members

[+] type ThisName = Nothing <: Name

A type for names of the same kind as this name

[+] def ++ ( other: Name ) : ThisName

Append other to the last part of this name

[+] def ++ ( other: String ) : ThisName
[+] def asSimpleName : SimpleName

This name downcasted to a simple term name

[+] def asTermName : TermName

This name downcasted to a term name

[+] def asTypeName : TypeName

This name downcasted to a type name

[+] def collect ( f: PartialFunction [ Name, T ] ) : Option [ T ]

If partial function f is defined for some part of this name, apply it in a Some, otherwise None. Stops at derived names whose kind has definesNewName = true.

[+] def debugString : String

A string showing the internal structure of this name. By contrast, toString shows the name after conversion to a simple name.

[+] def decode : ThisName

Replace operator expansions by corresponding operator symbols.

[+] def decoded : String
[+] def derived ( info: NameInfo ) : ThisName

A derived name consisting of this name and the added info, unless it is already present in this name.

[+] def derived ( kind: ClassifiedNameKind ) : ThisName

A derived name consisting of this name and the info of kind

[+] def encode : ThisName

Replace operator symbols by corresponding operator expansions

[+] def endsWith ( str: String ) : Boolean

Does (the last part of) this name end with str?

[+] override def equals ( that: Any ) : Boolean
[+] def exclude ( kind: NameKind ) : ThisName

This name without any info of the given kind. Excepted, as always, is the underlying name part of a qualified name.

[+] def firstPart : SimpleName

The first part of this (possible qualified) name

[+] override def hashCode : Int
[+] def is ( kind: NameKind ) : Boolean

Does this name contain an info of the given kind? Excepted, as always, is the underlying name part of a qualified name.

[+] def isEmpty : Boolean

Is this name empty?

[+] def isTermName : Boolean

Is this name a term name?

[+] def isTypeName : Boolean

Is this name a type name?

[+] def lastPart : SimpleName

The last part of this (possible qualified) name

[+] def likeSpaced ( name: Name ) : ThisName

A name in the same (term or type) namespace as this name and with same characters as given name.

[+] def mangled : ThisName

This name converted to a simple term name and in addition with all symbolic operator characters expanded.

[+] def mangledString : String

Convert to string after mangling

[+] def mapLast ( f: SimpleName => SimpleName ) : ThisName

Apply f to last simple term name making up this name

[+] def mapParts ( f: SimpleName => SimpleName ) : ThisName

Apply f to all simple term names making up this name

[+] def replace ( f: PartialFunction [ Name, Name ] ) : ThisName

Apply rewrite rule given by f to some part of this name, skipping and rewrapping other decorators. Stops at derived names whose kind has definesNewName = true. If f does not apply to any part, return name unchanged.

[+] def replace ( from: Char , to: Char ) : ThisName

Replace all occurrences of from to to in this name

[+] def startsWith ( str: String ) : Boolean

Does (the first part of) this name start with str?

[+] def toSimpleName : SimpleName

This name converted to a simple term name

[+] def toTermName : TermName

This name converted to a term name

[+] def toText ( printer: Printer ) : Text

Convert name to text via printer.

[+] def toTypeName : TypeName

This name converted to a type name