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.



898
899
900
901
902
# File 'lib/javaclass/attribute.rb', line 898

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.



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

def line_number
  @line_number
end

#start_pcObject

Returns the value of attribute start_pc.



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

def start_pc
  @start_pc
end

Instance Method Details

#to_bytesObject



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

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

#to_sObject



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

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