Class: Java::JavaClass

Inherits:
Object
  • Object
show all
Defined in:
lib/javaobs.rb

Overview

The Java meta class with all the information needed for serialization of the Ruby class to the stream. This class is attached to the Ruby class.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, uid, flags) ⇒ JavaClass

Returns a new instance of JavaClass.



76
77
78
79
80
81
82
83
84
# File 'lib/javaobs.rb', line 76

def initialize(name, uid, flags)
  @name = @javaName = name
  ind = name.rindex('.')
  @name = name.slice(ind + 1..name.length) if ind
  @flags = flags
  @uid = uid
  @fields = []
  @arrayType = name[1] if name[0] == ?[
end

Instance Attribute Details

#arrayTypeObject (readonly)

Returns the value of attribute arrayType.



74
75
76
# File 'lib/javaobs.rb', line 74

def arrayType
  @arrayType
end

#fieldsObject (readonly)

Returns the value of attribute fields.



74
75
76
# File 'lib/javaobs.rb', line 74

def fields
  @fields
end

#flagsObject (readonly)

Returns the value of attribute flags.



74
75
76
# File 'lib/javaobs.rb', line 74

def flags
  @flags
end

#javaNameObject (readonly)

Returns the value of attribute javaName.



74
75
76
# File 'lib/javaobs.rb', line 74

def javaName
  @javaName
end

#nameObject (readonly)

Returns the value of attribute name.



74
75
76
# File 'lib/javaobs.rb', line 74

def name
  @name
end

#rubyClassObject

Returns the value of attribute rubyClass.



73
74
75
# File 'lib/javaobs.rb', line 73

def rubyClass
  @rubyClass
end

#superClassObject

Returns the value of attribute superClass.



73
74
75
# File 'lib/javaobs.rb', line 73

def superClass
  @superClass
end

#uidObject (readonly)

Returns the value of attribute uid.



74
75
76
# File 'lib/javaobs.rb', line 74

def uid
  @uid
end

Instance Method Details

#addField(field) ⇒ Object

Add a field to the class.



87
88
89
# File 'lib/javaobs.rb', line 87

def addField(field)
  @fields << field
end

#to_sObject



91
92
93
# File 'lib/javaobs.rb', line 91

def to_s
  @name
end