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, ParameterDescriptor, ValueParameterDescriptor, VariableDescriptor

public class ValueParameterDescriptorImpl
extends VariableDescriptorImpl
implements ValueParameterDescriptor


Field Summary
 
Fields inherited from class org.jetbrains.kotlin.descriptors.impl.VariableDescriptorImpl
outType
 
Constructor Summary
ValueParameterDescriptorImpl(CallableDescriptor 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)
           
 ValueParameterDescriptor copy(CallableDescriptor newOwner, Name newName)
           
 boolean declaresDefaultValue()
           
  getCompileTimeInitializer()
           
 CallableDescriptor getContainingDeclaration()
           
 int getIndex()
          Returns the 0-based index of the value parameter in the parameter list of its containing function.
 ValueParameterDescriptor getOriginal()
           
 java.util.Collection<? 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 isVar()
           
 ValueParameterDescriptor substitute(TypeSubstitutor substitutor)
           
 
Methods inherited from class org.jetbrains.kotlin.descriptors.impl.VariableDescriptorImpl
getDispatchReceiverParameter, getExtensionReceiverParameter, getReturnType, getType, getTypeParameters, getValueParameters, hasStableParameterNames, hasSynthesizedParameterNames, isConst, setOutType
 
Methods inherited from class org.jetbrains.kotlin.descriptors.impl.DeclarationDescriptorNonRootImpl
getSource
 
Methods inherited from class org.jetbrains.kotlin.descriptors.impl.DeclarationDescriptorImpl
acceptVoid, getName, toString, 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.VariableDescriptor
getType, isConst
 
Methods inherited from interface org.jetbrains.kotlin.descriptors.ParameterDescriptor
getType
 
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
 

Constructor Detail

ValueParameterDescriptorImpl

public ValueParameterDescriptorImpl(@NotNull
                                    CallableDescriptor 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

getContainingDeclaration

@NotNull
public CallableDescriptor getContainingDeclaration()
Specified by:
getContainingDeclaration in interface DeclarationDescriptor
Specified by:
getContainingDeclaration in interface DeclarationDescriptorNonRoot
Specified by:
getContainingDeclaration in interface ParameterDescriptor
Specified by:
getContainingDeclaration in interface ValueParameterDescriptor
Specified by:
getContainingDeclaration in interface VariableDescriptor
Overrides:
getContainingDeclaration in class DeclarationDescriptorNonRootImpl

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

declaresDefaultValue

public boolean declaresDefaultValue()
Specified by:
declaresDefaultValue in interface ValueParameterDescriptor
Returns:
true iff this parameter belongs to a declared function (not a fake override) and declares the default value, i.e. explicitly specifies it in the function signature. Also see 'hasDefaultValue' extension in DescriptorUtils.kt

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 DeclarationDescriptorWithSource
Specified by:
getOriginal in interface ParameterDescriptor
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

getCompileTimeInitializer

@Nullable
public  getCompileTimeInitializer()
Specified by:
getCompileTimeInitializer in interface VariableDescriptor

copy

@NotNull
public ValueParameterDescriptor copy(@NotNull
                                             CallableDescriptor 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.Collection<? 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