Class: BiteScript::ASM::ParameterizedType
- Inherits:
-
GenericTypeMirror
- Object
- GenericTypeMirror
- BiteScript::ASM::ParameterizedType
- Defined in:
- lib/bitescript/mirror.rb,
lib/bitescript/asm3/mirror.rb
Instance Attribute Summary collapse
-
#outer_type ⇒ Object
readonly
Returns the value of attribute outer_type.
-
#raw_type ⇒ Object
readonly
Returns the value of attribute raw_type.
-
#type_arguments ⇒ Object
readonly
Returns the value of attribute type_arguments.
Instance Method Summary collapse
- #descriptor ⇒ Object
- #generic_class? ⇒ Boolean
-
#initialize(raw_type, outer_type = nil) ⇒ ParameterizedType
constructor
A new instance of ParameterizedType.
- #to_s ⇒ Object
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_type ⇒ Object (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_type ⇒ Object (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_arguments ⇒ Object (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
#descriptor ⇒ Object
627 628 629 |
# File 'lib/bitescript/mirror.rb', line 627 def descriptor raw_type.descriptor end |
#generic_class? ⇒ Boolean
631 632 633 |
# File 'lib/bitescript/mirror.rb', line 631 def generic_class? true end |
#to_s ⇒ Object
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 |