Class: JavaClass::Constant

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

Overview

Constantの基底クラス

Constant Summary collapse

CONSTANT_Class =
7
CONSTANT_Fieldref =
9
CONSTANT_Methodref =
10
CONSTANT_InterfaceMethodref =
11
CONSTANT_String =
8
CONSTANT_Integer =
3
CONSTANT_Float =
4
CONSTANT_Long =
5
CONSTANT_Double =
6
CONSTANT_NameAndType =
12
CONSTANT_Utf8 =
1

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Base

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

Constructor Details

#initialize(java_class, tag = nil) ⇒ Constant

コンストラクタ

*java_class::constantの所有者であるJavaクラス *tag::constantの種類を示すタグ



29
30
31
32
# File 'lib/javaclass/constant.rb', line 29

def initialize( java_class, tag=nil )
  @java_class = java_class
  @tag  = tag
end

Instance Attribute Details

#java_classObject

Returns the value of attribute java_class.



39
40
41
# File 'lib/javaclass/constant.rb', line 39

def java_class
  @java_class
end

#tagObject

Returns the value of attribute tag.



38
39
40
# File 'lib/javaclass/constant.rb', line 38

def tag
  @tag
end

Instance Method Details

#to_bytesObject



34
35
36
# File 'lib/javaclass/constant.rb', line 34

def to_bytes()
  to_byte( @tag, 1)
end