Class: BiteScript::ASM::ParameterizedType

Inherits:
GenericTypeMirror show all
Defined in:
lib/bitescript/mirror.rb,
lib/bitescript/asm3/mirror.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from GenericTypeMirror

#array?, #inspect, #type_variable?, #wildcard?

Constructor Details

#initialize(raw_type, outer_type = nil) ⇒ ParameterizedType

Returns a new instance of ParameterizedType.



578
579
580
581
582
# File 'lib/bitescript/mirror.rb', line 578

def initialize(raw_type, outer_type=nil)
  @raw_type = raw_type
  @type_arguments = []
  @outer_type = outer_type
end

Instance Attribute Details

#outer_typeObject (readonly)

Returns the value of attribute outer_type.



576
577
578
# File 'lib/bitescript/mirror.rb', line 576

def outer_type
  @outer_type
end

#raw_typeObject (readonly)

Returns the value of attribute raw_type.



576
577
578
# File 'lib/bitescript/mirror.rb', line 576

def raw_type
  @raw_type
end

#type_argumentsObject (readonly)

Returns the value of attribute type_arguments.



576
577
578
# File 'lib/bitescript/mirror.rb', line 576

def type_arguments
  @type_arguments
end

Instance Method Details

#descriptorObject



584
585
586
# File 'lib/bitescript/mirror.rb', line 584

def descriptor
  raw_type.descriptor
end

#generic_class?Boolean

Returns:

  • (Boolean)


588
589
590
# File 'lib/bitescript/mirror.rb', line 588

def generic_class?
  true
end

#to_sObject



592
593
594
595
596
597
598
599
600
601
602
# File 'lib/bitescript/mirror.rb', line 592

def to_s
  name = raw_type.internal_name.tr('/', '.')
  unless type_arguments.empty?
    name << "<#{type_arguments.map {|a| a.to_s}.join(', ')}>"
  end
  if outer_type
    "#{outer_type}.#{name}"
  else
    name
  end
end