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?

Methods included from Generics

#inspect_generic, #inspect_type

Constructor Details

#initialize(raw_type, outer_type = nil) ⇒ ParameterizedType

Returns a new instance of ParameterizedType.



621
622
623
624
625
# File 'lib/bitescript/mirror.rb', line 621

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.



619
620
621
# File 'lib/bitescript/mirror.rb', line 619

def outer_type
  @outer_type
end

#raw_typeObject (readonly)

Returns the value of attribute raw_type.



619
620
621
# File 'lib/bitescript/mirror.rb', line 619

def raw_type
  @raw_type
end

#type_argumentsObject (readonly)

Returns the value of attribute type_arguments.



619
620
621
# File 'lib/bitescript/mirror.rb', line 619

def type_arguments
  @type_arguments
end

Instance Method Details

#descriptorObject



627
628
629
# File 'lib/bitescript/mirror.rb', line 627

def descriptor
  raw_type.descriptor
end

#generic_class?Boolean

Returns:

  • (Boolean)


631
632
633
# File 'lib/bitescript/mirror.rb', line 631

def generic_class?
  true
end

#to_sObject



635
636
637
638
639
640
641
642
643
644
645
# File 'lib/bitescript/mirror.rb', line 635

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