Alternatives of patterns, eliminated by explicitouter, except for occurrences in encoded Switch stmt (=remaining Match(CaseDef(.
Alternatives of patterns, eliminated by explicitouter, except for occurrences in encoded Switch stmt (=remaining Match(CaseDef(...))) Eliminated by patmat/explicitouter.
An extractor class to create and pattern match with syntax Alternative(trees)
.
A tree that has an annotation attached to it.
A tree that has an annotation attached to it. Only used for annotated types and annotation ascriptions, annotations on definitions are stored in the Modifiers. Eliminated by typechecker (typedAnnotated), the annotations are then stored in an AnnotatedType.
An extractor class to create and pattern match with syntax Annotated(annot, arg)
.
Applied type <tpt> [ <args> ], eliminated by RefCheck
An extractor class to create and pattern match with syntax AppliedTypeTree(tpt, args)
.
Value application
Dynamic value application.
Dynamic value application. In a dynamic application q.f(as)
An extractor class to create and pattern match with syntax ApplyDynamic(qual, args)
.
An extractor class to create and pattern match with syntax Apply(fun, args)
.
Array of expressions, needs to be translated in backend.
Array of expressions, needs to be translated in backend. This AST node is used to pass arguments to vararg arguments. Introduced by uncurry.
An extractor class to create and pattern match with syntax ArrayValue(elemtpt, elems)
.
Assignment
An extractor class to create and pattern match with syntax Assign(lhs, rhs)
.
Either an assignment or a named argument.
Either an assignment or a named argument. Only appears in argument lists, eliminated by typecheck (doTypedApply), resurrected by reifier.
An extractor class to create and pattern match with syntax AssignOrNamedArg(lhs, rhs)
.
Bind of a variable to a rhs pattern, eliminated by explicitouter Eliminated by patmat/explicitouter.
An extractor class to create and pattern match with syntax Bind(name, body)
.
Block of expressions (semicolon separated expressions)
An extractor class to create and pattern match with syntax Block(stats, expr)
.
Case clause in a pattern match, eliminated during explicitouter (except for occurrences in switch statements).
Case clause in a pattern match, eliminated during explicitouter (except for occurrences in switch statements). Eliminated by patmat/explicitouter.
An extractor class to create and pattern match with syntax CaseDef(pat, guard, body)
.
A class definition.
An extractor class to create and pattern match with syntax ClassDef(mods, name, tparams, impl)
.
Intersection type <parent1> with .
Intersection type <parent1> with ... with <parentN> { <decls> }, eliminated by RefCheck
An extractor class to create and pattern match with syntax CompoundTypeTree(templ)
.
A method or macro definition.
An extractor class to create and pattern match with syntax DefDef(mods, name, tparams, vparamss, tpt, rhs)
.
A tree which defines a symbol-carrying entity.
Document me!
An extractor class to create and pattern match with syntax ExistentialTypeTree(tpt, whereClauses)
.
Anonymous function, eliminated by lambdalift
An extractor class to create and pattern match with syntax Function(vparams, body)
.
Common base class for Apply and TypeApply.
Common base class for Apply and TypeApply. This could in principle be a SymTree, but whether or not a Tree is a SymTree isn't used to settle any interesting questions, and it would add a useless field to all the instances (useless, since GenericApply forwards to the underlying fun.)
Identifier <name>
An extractor class to create and pattern match with syntax Ident(qual, name)
.
Conditional expression
An extractor class to create and pattern match with syntax If(cond, thenp, elsep)
.
A common base class for class and object definitions.
Import clause
An extractor class to create and pattern match with syntax Import(expr, selectors)
.
Import selector
Import selector
Representation of an imported name its optional rename and their optional positions
Eliminated by typecheck.
An extractor class to create and pattern match with syntax ImportSelector(name:, namePos, rename, renamePos)
.
A labelled expression.
A labelled expression. Not expressible in language syntax, but generated by the compiler to simulate while/do-while loops, and also by the pattern matcher.
The label acts much like a nested function, where params
represents
the incoming parameters. The symbol given to the LabelDef should have
a MethodType, as if it were a nested function.
Jumps are apply nodes attributed with a label's symbol. The arguments from the apply node will be passed to the label and assigned to the Idents.
Forward jumps within a block are allowed.
An extractor class to create and pattern match with syntax LabelDef(name, params, rhs)
.
Literal
An extractor class to create and pattern match with syntax Literal(value)
.
- Pattern matching expression (before explicitouter)
- Pattern matching expression (before explicitouter)
After explicitouter, cases will satisfy the following constraints:
EmptyTree
,Literal(Constant(x:Int))
or Alternative(lit|...|lit)
Ident(nme.WILDCARD)
An extractor class to create and pattern match with syntax Match(selector, cases)
.
Common base class for all member definitions: types, classes, objects, packages, vals and vars, defs.
.
...
.
An object definition, e.
An object definition, e.g. object Foo
. Internally, objects are
quite frequently called modules to reduce ambiguity.
Eliminated by refcheck.
An extractor class to create and pattern match with syntax ModuleDef(mods, name, impl)
.
A tree with a name - effectively, a DefTree or RefTree.
Object instantiation One should always use factory method below to build a user level new.
An extractor class to create and pattern match with syntax New(tpt)
.
A packaging, such as package pid { stats }
An extractor class to create and pattern match with syntax PackageDef(pid, stats)
.
A tree which references a symbol-carrying entity.
A tree which references a symbol-carrying entity. References one, as opposed to defining one; definitions are in DefTrees.
Marks underlying reference to id as boxed.
An extractor class to create and pattern match with syntax ReferenceToBoxed(ident)
.
Return expression
An extractor class to create and pattern match with syntax Return(expr)
.
Designator <qualifier> .
Designator <qualifier> . <name>
An extractor class to create and pattern match with syntax Select(qual, name)
.
Type selection <qualifier> # <name>, eliminated by RefCheck
An extractor class to create and pattern match with syntax SelectFromTypeTree(qualifier, name)
.
Singleton type, eliminated by RefCheck
An extractor class to create and pattern match with syntax SingletonTypeTree(ref)
.
Repetition of pattern.
Repetition of pattern. Eliminated by patmat/explicitouter.
An extractor class to create and pattern match with syntax Star(elem)
.
Super reference, qual = corresponding this reference A super reference C.
Super reference, qual = corresponding this reference A super reference C.super[M] is represented as Super(This(C), M).
An extractor class to create and pattern match with syntax Super(qual, mix)
.
A tree with a mutable symbol field, initialized to NoSymbol.
Instantiation template of a class or trait
An extractor class to create and pattern match with syntax Template(parents, self, body)
.
A tree for a term.
A tree for a term. Not all terms are TermTrees; use isTerm to reliably identify terms.
Self reference
An extractor class to create and pattern match with syntax This(qual)
.
Throw expression
An extractor class to create and pattern match with syntax Throw(expr)
.
Tree is the basis for scala's abstract syntax.
Tree is the basis for scala's abstract syntax. The nodes are implemented as case classes, and the parameters which initialize a given tree are immutable: however Trees have several mutable fields which are manipulated in the course of typechecking, including pos, symbol, and tpe.
Newly instantiated trees have tpe set to null (though it
may be set immediately thereafter depending on how it is
constructed.) When a tree is passed to the typer, typically via
typer.typed(tree)
, under normal circumstances the tpe must be
null or the typer will ignore it. Furthermore, the typer is not
required to return the same tree it was passed.
Trees can be easily traversed with e.g. foreach on the root node; for a more nuanced traversal, subclass Traverser. Transformations can be considerably trickier: see the numerous subclasses of Transformer found around the compiler.
Copying Trees should be done with care depending on whether it need be done lazily or strictly (see LazyTreeCopier and StrictTreeCopier) and on whether the contents of the mutable fields should be copied. The tree copiers will copy the mutable attributes to the new tree; calling Tree#duplicate will copy symbol and tpe, but all the positions will be focused.
Trees can be coarsely divided into four mutually exclusive categories:
TypTree
, not TypeTree
.SymTrees include important nodes Ident and Select, which are used as both terms and types; they are distinguishable based on whether the Name is a TermName or TypeName. The correct way for to test for a type or a term (on any Tree) are the isTerm/isType methods on Tree.
"Others" are mostly syntactic or short-lived constructs. Examples include CaseDef, which wraps individual match cases: they are neither terms nor types, nor do they carry a symbol. Another example is Parens, which is eliminated during parsing.
The base API that all trees support
[Eugene++] comment me!
An extractor class to create and pattern match with syntax Try(block, catches, finalizer)
.
A tree for a type.
A tree for a type. Not all types are TypTrees; use isType to reliably identify types.
Explicit type application.
An extractor class to create and pattern match with syntax TypeApply(fun, args)
.
Document me!
An extractor class to create and pattern match with syntax TypeBoundsTree(lo, hi)
.
An abstract type, a type parameter, or a type alias.
An abstract type, a type parameter, or a type alias. Eliminated by erasure.
An extractor class to create and pattern match with syntax TypeDef(mods, name, tparams, rhs)
.
A synthetic tree holding an arbitrary type.
A synthetic tree holding an arbitrary type. Not to be confused with
with TypTree, the trait for trees that are only used for type trees.
TypeTree's are inserted in several places, but most notably in
RefCheck
, where the arbitrary type trees are all replaced by
TypeTree's.
An extractor class to create and pattern match with syntax TypeTree()
.
Type annotation, eliminated by cleanup
An extractor class to create and pattern match with syntax Typed(expr, tpt)
.
Noone knows what this is.
Noone knows what this is. It is not idempotent w.r.t typechecking. Can we, please, remove it? Introduced by typer, eliminated by patmat/explicitouter.
An extractor class to create and pattern match with syntax UnApply(fun, args)
.
Broadly speaking, a value definition.
Broadly speaking, a value definition. All these are encoded as ValDefs:
An extractor class to create and pattern match with syntax ValDef(mods, name, tpt, rhs)
.
A common base class for ValDefs and DefDefs.
The constructor/deconstructor for Alternative
instances.
A tag that preserves the identity of the Alternative
abstract type from erasure.
A tag that preserves the identity of the Alternative
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for Annotated
instances.
A tag that preserves the identity of the Annotated
abstract type from erasure.
A tag that preserves the identity of the Annotated
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for AppliedTypeTree
instances.
A tag that preserves the identity of the AppliedTypeTree
abstract type from erasure.
A tag that preserves the identity of the AppliedTypeTree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for Apply
instances.
The constructor/deconstructor for ApplyDynamic
instances.
A tag that preserves the identity of the ApplyDynamic
abstract type from erasure.
A tag that preserves the identity of the ApplyDynamic
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the Apply
abstract type from erasure.
A tag that preserves the identity of the Apply
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for ArrayValue
instances.
A tag that preserves the identity of the ArrayValue
abstract type from erasure.
A tag that preserves the identity of the ArrayValue
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for Assign
instances.
The constructor/deconstructor for AssignOrNamedArg
instances.
A tag that preserves the identity of the AssignOrNamedArg
abstract type from erasure.
A tag that preserves the identity of the AssignOrNamedArg
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the Assign
abstract type from erasure.
A tag that preserves the identity of the Assign
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for Bind
instances.
A tag that preserves the identity of the Bind
abstract type from erasure.
A tag that preserves the identity of the Bind
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
Block factory that flattens directly nested blocks.
The constructor/deconstructor for Block
instances.
A tag that preserves the identity of the Block
abstract type from erasure.
A tag that preserves the identity of the Block
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
casedef shorthand
The constructor/deconstructor for CaseDef
instances.
A tag that preserves the identity of the CaseDef
abstract type from erasure.
A tag that preserves the identity of the CaseDef
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
the class symbol
the implementation template
The constructor/deconstructor for ClassDef
instances.
A tag that preserves the identity of the ClassDef
abstract type from erasure.
A tag that preserves the identity of the ClassDef
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for CompoundTypeTree
instances.
A tag that preserves the identity of the CompoundTypeTree
abstract type from erasure.
A tag that preserves the identity of the CompoundTypeTree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for DefDef
instances.
A tag that preserves the identity of the DefDef
abstract type from erasure.
A tag that preserves the identity of the DefDef
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the DefTree
abstract type from erasure.
A tag that preserves the identity of the DefTree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The empty tree
The constructor/deconstructor for ExistentialTypeTree
instances.
A tag that preserves the identity of the ExistentialTypeTree
abstract type from erasure.
A tag that preserves the identity of the ExistentialTypeTree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for Function
instances.
A tag that preserves the identity of the Function
abstract type from erasure.
A tag that preserves the identity of the Function
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the GenericApply
abstract type from erasure.
A tag that preserves the identity of the GenericApply
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for Ident
instances.
A tag that preserves the identity of the Ident
abstract type from erasure.
A tag that preserves the identity of the Ident
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for If
instances.
A tag that preserves the identity of the If
abstract type from erasure.
A tag that preserves the identity of the If
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the ImplDef
abstract type from erasure.
A tag that preserves the identity of the ImplDef
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for Import
instances.
The constructor/deconstructor for ImportSelector
instances.
A tag that preserves the identity of the ImportSelector
abstract type from erasure.
A tag that preserves the identity of the ImportSelector
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the Import
abstract type from erasure.
A tag that preserves the identity of the Import
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for LabelDef
instances.
A tag that preserves the identity of the LabelDef
abstract type from erasure.
A tag that preserves the identity of the LabelDef
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for Literal
instances.
A tag that preserves the identity of the Literal
abstract type from erasure.
A tag that preserves the identity of the Literal
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for Match
instances.
A tag that preserves the identity of the Match
abstract type from erasure.
A tag that preserves the identity of the Match
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the MemberDef
abstract type from erasure.
A tag that preserves the identity of the MemberDef
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the Modifiers
abstract type from erasure.
A tag that preserves the identity of the Modifiers
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
the class symbol
the implementation template
The constructor/deconstructor for ModuleDef
instances.
A tag that preserves the identity of the ModuleDef
abstract type from erasure.
A tag that preserves the identity of the ModuleDef
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the NameTree
abstract type from erasure.
A tag that preserves the identity of the NameTree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
0-1 argument list new, based on a type.
Factory method for object creation new tpt(args_1)...(args_n)
A New(t, as)
is expanded to: (new t).<init>(as)
The constructor/deconstructor for New
instances.
A tag that preserves the identity of the New
abstract type from erasure.
A tag that preserves the identity of the New
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for PackageDef
instances.
A tag that preserves the identity of the PackageDef
abstract type from erasure.
A tag that preserves the identity of the PackageDef
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the RefTree
abstract type from erasure.
A tag that preserves the identity of the RefTree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for ReferenceToBoxed
instances.
A tag that preserves the identity of the ReferenceToBoxed
abstract type from erasure.
A tag that preserves the identity of the ReferenceToBoxed
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for Return
instances.
A tag that preserves the identity of the Return
abstract type from erasure.
A tag that preserves the identity of the Return
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for Select
instances.
The constructor/deconstructor for SelectFromTypeTree
instances.
A tag that preserves the identity of the SelectFromTypeTree
abstract type from erasure.
A tag that preserves the identity of the SelectFromTypeTree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the Select
abstract type from erasure.
A tag that preserves the identity of the Select
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for SingletonTypeTree
instances.
A tag that preserves the identity of the SingletonTypeTree
abstract type from erasure.
A tag that preserves the identity of the SingletonTypeTree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for Star
instances.
A tag that preserves the identity of the Star
abstract type from erasure.
A tag that preserves the identity of the Star
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for Super
instances.
A tag that preserves the identity of the Super
abstract type from erasure.
A tag that preserves the identity of the Super
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the SymTree
abstract type from erasure.
A tag that preserves the identity of the SymTree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for Template
instances.
A tag that preserves the identity of the Template
abstract type from erasure.
A tag that preserves the identity of the Template
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the TermTree
abstract type from erasure.
A tag that preserves the identity of the TermTree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for This
instances.
A tag that preserves the identity of the This
abstract type from erasure.
A tag that preserves the identity of the This
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for Throw
instances.
A tag that preserves the identity of the Throw
abstract type from erasure.
A tag that preserves the identity of the Throw
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the Tree
abstract type from erasure.
A tag that preserves the identity of the Tree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for Try
instances.
A tag that preserves the identity of the Try
abstract type from erasure.
A tag that preserves the identity of the Try
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the TypTree
abstract type from erasure.
A tag that preserves the identity of the TypTree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for TypeApply
instances.
A tag that preserves the identity of the TypeApply
abstract type from erasure.
A tag that preserves the identity of the TypeApply
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for TypeBoundsTree
instances.
A tag that preserves the identity of the TypeBoundsTree
abstract type from erasure.
A tag that preserves the identity of the TypeBoundsTree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A TypeDef node which defines abstract type or type parameter for given sym
A TypeDef node which defines given sym
with given tight hand side rhs
.
The constructor/deconstructor for TypeDef
instances.
A tag that preserves the identity of the TypeDef
abstract type from erasure.
A tag that preserves the identity of the TypeDef
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for TypeTree
instances.
A tag that preserves the identity of the TypeTree
abstract type from erasure.
A tag that preserves the identity of the TypeTree
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for Typed
instances.
A tag that preserves the identity of the Typed
abstract type from erasure.
A tag that preserves the identity of the Typed
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for UnApply
instances.
A tag that preserves the identity of the UnApply
abstract type from erasure.
A tag that preserves the identity of the UnApply
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
The constructor/deconstructor for ValDef
instances.
A tag that preserves the identity of the ValDef
abstract type from erasure.
A tag that preserves the identity of the ValDef
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
A tag that preserves the identity of the ValOrDefDef
abstract type from erasure.
A tag that preserves the identity of the ValOrDefDef
abstract type from erasure.
Can be used for pattern matching, instance tests, serialization and likes.
Obtains string representation of a tree
Test two objects for inequality.
Test two objects for inequality.
true
if !(this == that), false otherwise.
Equivalent to x.hashCode
except for boxed numeric types and null
.
Equivalent to x.hashCode
except for boxed numeric types and null
.
For numerics, it returns a hash value which is consistent
with value equality: if two value type instances compare
as true, then ## will produce the same hash value for each
of them.
For null
returns a hashcode where null.hashCode
throws a
NullPointerException
.
a hash value consistent with ==
Test two objects for equality.
Test two objects for equality.
The expression x == that
is equivalent to if (x eq null) that eq null else x.equals(that)
.
true
if the receiver object is equivalent to the argument; false
otherwise.
.
...
Cast the receiver object to be of type T0
.
Cast the receiver object to be of type T0
.
Note that the success of a cast at runtime is modulo Scala's erasure semantics.
Therefore the expression 1.asInstanceOf[String]
will throw a ClassCastException
at
runtime, while the expression List(1).asInstanceOf[List[String]]
will not.
In the latter example, because the type argument is erased as part of compilation it is
not possible to check whether the contents of the list are of the requested type.
the receiver object.
if the receiver object is not an instance of the erasure of type T0
.
Create a copy of the receiver object.
Tests whether the argument (arg0
) is a reference to the receiver object (this
).
Tests whether the argument (arg0
) is a reference to the receiver object (this
).
The eq
method implements an equivalence relation on
non-null instances of AnyRef
, and has three additional properties:
x
and y
of type AnyRef
, multiple invocations of
x.eq(y)
consistently returns true
or consistently returns false
.x
of type AnyRef
, x.eq(null)
and null.eq(x)
returns false
.null.eq(null)
returns true
. When overriding the equals
or hashCode
methods, it is important to ensure that their behavior is
consistent with reference equality. Therefore, if two objects are references to each other (o1 eq o2
), they
should be equal to each other (o1 == o2
) and they should hash to the same value (o1.hashCode == o2.hashCode
).
true
if the argument is a reference to the receiver object; false
otherwise.
The equality method for reference types.
Called by the garbage collector on the receiver object when there are no more references to the object.
Called by the garbage collector on the receiver object when there are no more references to the object.
The details of when and if the finalize
method is invoked, as
well as the interaction between finalize
and non-local returns
and exceptions, are all platform dependent.
Returns string formatted according to given format
string.
Returns string formatted according to given format
string.
Format strings are as for String.format
(@see java.lang.String.format).
A representation that corresponds to the dynamic class of the receiver object.
A representation that corresponds to the dynamic class of the receiver object.
The nature of the representation is platform dependent.
a representation that corresponds to the dynamic class of the receiver object.
not specified by SLS as a member of AnyRef
The hashCode method for reference types.
Test whether the dynamic type of the receiver object is T0
.
Test whether the dynamic type of the receiver object is T0
.
Note that the result of the test is modulo Scala's erasure semantics.
Therefore the expression 1.isInstanceOf[String]
will return false
, while the
expression List(1).isInstanceOf[List[String]]
will return true
.
In the latter example, because the type argument is erased as part of compilation it is
not possible to check whether the contents of the list are of the specified type.
true
if the receiver object is an instance of erasure of type T0
; false
otherwise.
Equivalent to !(this eq that)
.
Equivalent to !(this eq that)
.
true
if the argument is not a reference to the receiver object; false
otherwise.
Wakes up a single thread that is waiting on the receiver object's monitor.
Wakes up a single thread that is waiting on the receiver object's monitor.
not specified by SLS as a member of AnyRef
Wakes up all threads that are waiting on the receiver object's monitor.
Wakes up all threads that are waiting on the receiver object's monitor.
not specified by SLS as a member of AnyRef
Creates a String representation of this object.
Creates a String representation of this object. The default representation is platform dependent. On the java platform it is the concatenation of the class name, "@", and the object's hashcode in hexadecimal.
a String representation of the object.
(Since version 2.10.0) Use leftOfArrow instead
(Since version 2.10.0) Use resultOfEnsuring instead