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?
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_type ⇒ Object (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_type ⇒ Object (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_arguments ⇒ Object (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
#descriptor ⇒ Object
584 585 586 |
# File 'lib/bitescript/mirror.rb', line 584 def descriptor raw_type.descriptor end |
#generic_class? ⇒ Boolean
588 589 590 |
# File 'lib/bitescript/mirror.rb', line 588 def generic_class? true end |
#to_s ⇒ Object
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 |