Class: JavaClass::LineNumber

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, line_number = nil) ⇒ LineNumber

Returns a new instance of LineNumber.



902
903
904
905
906
# File 'lib/javaclass/attribute.rb', line 902

def initialize( java_class, start_pc=nil, line_number=nil )
  @java_class=java_class
  @start_pc=start_pc
  @line_number=line_number
end

Instance Attribute Details

#line_numberObject

Returns the value of attribute line_number.



915
916
917
# File 'lib/javaclass/attribute.rb', line 915

def line_number
  @line_number
end

#start_pcObject

Returns the value of attribute start_pc.



914
915
916
# File 'lib/javaclass/attribute.rb', line 914

def start_pc
  @start_pc
end

Instance Method Details

#to_bytesObject



910
911
912
913
# File 'lib/javaclass/attribute.rb', line 910

def to_bytes
  bytes = to_byte( @start_pc, 2 )
  bytes += to_byte( @line_number, 2 )
end

#to_sObject



907
908
909
# File 'lib/javaclass/attribute.rb', line 907

def to_s
  "line : #{@line_number}"
end