Class: JavaClass::Excpetion

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/javaclass/attribute.rb

Overview

例外

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Base

#==, #===, #dump, #eql?, #hash, #to_byte

Constructor Details

#initialize(java_class, start_pc = nil, end_pc = nil, handler_pc = nil, catch_type_index = nil) ⇒ Excpetion

Returns a new instance of Excpetion.



834
835
836
837
838
839
840
# File 'lib/javaclass/attribute.rb', line 834

def initialize( java_class, start_pc=nil, end_pc=nil, handler_pc=nil, catch_type_index=nil )
  @java_class=java_class
  @start_pc=start_pc
  @end_pc=end_pc
  @handler_pc=handler_pc
  @catch_type_index=catch_type_index
end

Instance Attribute Details

#catch_type_indexObject

Returns the value of attribute catch_type_index.



854
855
856
# File 'lib/javaclass/attribute.rb', line 854

def catch_type_index
  @catch_type_index
end

#end_pcObject

Returns the value of attribute end_pc.



852
853
854
# File 'lib/javaclass/attribute.rb', line 852

def end_pc
  @end_pc
end

#handler_pcObject

Returns the value of attribute handler_pc.



853
854
855
# File 'lib/javaclass/attribute.rb', line 853

def handler_pc
  @handler_pc
end

#start_pcObject

Returns the value of attribute start_pc.



851
852
853
# File 'lib/javaclass/attribute.rb', line 851

def start_pc
  @start_pc
end

Instance Method Details

#catch_typeObject



841
842
843
# File 'lib/javaclass/attribute.rb', line 841

def catch_type
  @catch_type_index == nil ? nil : @java_class.get_constant(@catch_type_index)
end

#to_bytesObject



844
845
846
847
848
849
850
# File 'lib/javaclass/attribute.rb', line 844

def to_bytes
  bytes = []
  bytes += to_byte( @start_pc, 2 )
  bytes += to_byte( @end_pc, 2 )
  bytes += to_byte( @handler_pc, 2 )
  bytes += to_byte( @catch_type_index, 2 )
end