org.jetbrains.kotlin.descriptors.impl
Class ValueParameterDescriptorImpl

java.lang.Object
  extended by org.jetbrains.kotlin.descriptors.annotations.AnnotatedImpl
      extended by org.jetbrains.kotlin.descriptors.impl.DeclarationDescriptorImpl
          extended by org.jetbrains.kotlin.descriptors.impl.DeclarationDescriptorNonRootImpl
              extended by org.jetbrains.kotlin.descriptors.impl.VariableDescriptorImpl
                  extended by org.jetbrains.kotlin.descriptors.impl.ValueParameterDescriptorImpl
All Implemented Interfaces:
Annotated, CallableDescriptor, DeclarationDescriptor, DeclarationDescriptorNonRoot, DeclarationDescriptorWithSource, DeclarationDescriptorWithVisibility, Named, ValueParameterDescriptor, VariableDescriptor

public class ValueParameterDescriptorImpl
extends VariableDescriptorImpl
implements ValueParameterDescriptor


Constructor Summary
ValueParameterDescriptorImpl(DeclarationDescriptor containingDeclaration, ValueParameterDescriptor original, int index, Annotations annotations, Name name, JetType outType, boolean declaresDefaultValue, JetType varargElementType, SourceElement source)
           
 
Method Summary
<R,D> R
accept(DeclarationDescriptorVisitor<R,D> visitor, D data)
           
 void addOverriddenDescriptor(ValueParameterDescriptor overridden)
           
 ValueParameterDescriptor copy(DeclarationDescriptor newOwner, Name newName)
           
 boolean declaresDefaultValue()
          The back-end should relies on this property when generating function signatures
 int getIndex()
          Returns the 0-based index of the value parameter in the parameter list of its containing function.
 ValueParameterDescriptor getOriginal()
           
 java.util.Set<? extends ValueParameterDescriptor> getOverriddenDescriptors()
          Parameter p1 overrides p2 iff a) their respective owners (function declarations) f1 override f2 b) p1 and p2 have the same indices in the owners' parameter lists
 JetType getVarargElementType()
           
 Visibility getVisibility()
           
 boolean hasDefaultValue()
          The front-end relies on this property when resolving function calls
 boolean isVar()
           
 void setType(JetType type)
           
 ValueParameterDescriptor substitute(TypeSubstitutor substitutor)
           
 
Methods inherited from class org.jetbrains.kotlin.descriptors.impl.VariableDescriptorImpl
getCompileTimeInitializer, getDispatchReceiverParameter, getExtensionReceiverParameter, getReturnType, getType, getTypeParameters, getValueParameters, hasStableParameterNames, hasSynthesizedParameterNames, setCompileTimeInitializer, setOutType
 
Methods inherited from class org.jetbrains.kotlin.descriptors.impl.DeclarationDescriptorNonRootImpl
getContainingDeclaration, getSource
 
Methods inherited from class org.jetbrains.kotlin.descriptors.impl.DeclarationDescriptorImpl
acceptVoid, getName, toString
 
Methods inherited from class org.jetbrains.kotlin.descriptors.annotations.AnnotatedImpl
getAnnotations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jetbrains.kotlin.descriptors.ValueParameterDescriptor
getType
 
Methods inherited from interface org.jetbrains.kotlin.descriptors.VariableDescriptor
getCompileTimeInitializer, getContainingDeclaration
 
Methods inherited from interface org.jetbrains.kotlin.descriptors.CallableDescriptor
getDispatchReceiverParameter, getExtensionReceiverParameter, getReturnType, getTypeParameters, getValueParameters, hasStableParameterNames, hasSynthesizedParameterNames
 
Methods inherited from interface org.jetbrains.kotlin.descriptors.DeclarationDescriptorWithSource
getSource
 
Methods inherited from interface org.jetbrains.kotlin.descriptors.DeclarationDescriptor
acceptVoid
 
Methods inherited from interface org.jetbrains.kotlin.descriptors.annotations.Annotated
getAnnotations
 
Methods inherited from interface org.jetbrains.kotlin.descriptors.Named
getName
 

Constructor Detail

ValueParameterDescriptorImpl

public ValueParameterDescriptorImpl(@NotNull
                                    DeclarationDescriptor containingDeclaration,
                                    @Nullable
                                    ValueParameterDescriptor original,
                                    int index,
                                    @NotNull
                                    Annotations annotations,
                                    @NotNull
                                    Name name,
                                    @NotNull
                                    JetType outType,
                                    boolean declaresDefaultValue,
                                    @Nullable
                                    JetType varargElementType,
                                    @NotNull
                                    SourceElement source)
Method Detail

setType

public void setType(@NotNull
                    JetType type)

getIndex

public int getIndex()
Description copied from interface: ValueParameterDescriptor
Returns the 0-based index of the value parameter in the parameter list of its containing function.

Specified by:
getIndex in interface ValueParameterDescriptor
Returns:
the parameter index

hasDefaultValue

public boolean hasDefaultValue()
Description copied from interface: ValueParameterDescriptor
The front-end relies on this property when resolving function calls

Specified by:
hasDefaultValue in interface ValueParameterDescriptor
Returns:
true iff the parameter has a default value, i.e. declares it or inherits by overriding a parameter in an overridden function.

declaresDefaultValue

public boolean declaresDefaultValue()
Description copied from interface: ValueParameterDescriptor
The back-end should relies on this property when generating function signatures

Specified by:
declaresDefaultValue in interface ValueParameterDescriptor
Returns:
true iff the parameter declares a default value, i.e. explicitly specifies it in the function header

getVarargElementType

@Nullable
public JetType getVarargElementType()
Specified by:
getVarargElementType in interface ValueParameterDescriptor

getOriginal

@NotNull
public ValueParameterDescriptor getOriginal()
Specified by:
getOriginal in interface CallableDescriptor
Specified by:
getOriginal in interface DeclarationDescriptor
Specified by:
getOriginal in interface ValueParameterDescriptor
Overrides:
getOriginal in class VariableDescriptorImpl
Returns:
The descriptor that corresponds to the original declaration of this element. A descriptor can be obtained from its original by substituting type arguments (of the declaring class or of the element itself). returns this object if the current descriptor is original itself

substitute

@NotNull
public ValueParameterDescriptor substitute(@NotNull
                                                   TypeSubstitutor substitutor)
Specified by:
substitute in interface CallableDescriptor
Specified by:
substitute in interface DeclarationDescriptor
Specified by:
substitute in interface VariableDescriptor

accept

public <R,D> R accept(DeclarationDescriptorVisitor<R,D> visitor,
                      D data)
Specified by:
accept in interface DeclarationDescriptor

isVar

public boolean isVar()
Specified by:
isVar in interface VariableDescriptor

copy

@NotNull
public ValueParameterDescriptor copy(@NotNull
                                             DeclarationDescriptor newOwner,
                                             @NotNull
                                             Name newName)
Specified by:
copy in interface ValueParameterDescriptor

getVisibility

@NotNull
public Visibility getVisibility()
Specified by:
getVisibility in interface DeclarationDescriptorWithVisibility

getOverriddenDescriptors

@NotNull
public java.util.Set<? extends ValueParameterDescriptor> getOverriddenDescriptors()
Description copied from interface: ValueParameterDescriptor
Parameter p1 overrides p2 iff a) their respective owners (function declarations) f1 override f2 b) p1 and p2 have the same indices in the owners' parameter lists

Specified by:
getOverriddenDescriptors in interface CallableDescriptor
Specified by:
getOverriddenDescriptors in interface ValueParameterDescriptor
Overrides:
getOverriddenDescriptors in class VariableDescriptorImpl

addOverriddenDescriptor

public void addOverriddenDescriptor(@NotNull
                                    ValueParameterDescriptor overridden)
Specified by:
addOverriddenDescriptor in interface ValueParameterDescriptor