Class: OBJFXBuilderWrapper

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

Instance Method Summary collapse

Constructor Details

#initialize(safeobj, type) ⇒ OBJFXBuilderWrapper

Returns a new instance of OBJFXBuilderWrapper.



3
4
5
6
7
# File 'lib/fxmlloader/real_elts.rb', line 3

def initialize(safeobj, type)
  super()
  @type = type
  @obj = safeobj
end

Instance Method Details

#==(rhs) ⇒ Object



45
46
47
# File 'lib/fxmlloader/real_elts.rb', line 45

def ==(rhs)
  self.equal? rhs # do pointer comparison
end

#[](o) ⇒ Object



34
35
36
# File 'lib/fxmlloader/real_elts.rb', line 34

def [](o)
  get(o)
end

#[]=(k, v) ⇒ Object



37
38
39
# File 'lib/fxmlloader/real_elts.rb', line 37

def []=(k, v)
  put(k, v)
end

#buildObject



17
18
19
# File 'lib/fxmlloader/real_elts.rb', line 17

def build
  @obj.build.tap{|x| rmorph self, x}
end

#containsKey(o) ⇒ Object



21
22
23
# File 'lib/fxmlloader/real_elts.rb', line 21

def containsKey(o)
  @obj.containsKey(o)
end

#entrySetObject



41
42
43
# File 'lib/fxmlloader/real_elts.rb', line 41

def entrySet
  java.util.HashMap.new({}).entrySet
end

#get(o) ⇒ Object



25
26
27
# File 'lib/fxmlloader/real_elts.rb', line 25

def get(o)
  @obj.get(o)
end

#inspectObject



49
50
51
# File 'lib/fxmlloader/real_elts.rb', line 49

def inspect
  "#<ObjectBuilderWrapper:#{self.object_id.to_s 16} type=#{@type}, child=#{@obj.class.inspect}>"
end

#on_put(&on_put) ⇒ Object



13
14
15
# File 'lib/fxmlloader/real_elts.rb', line 13

def on_put(&on_put)
  @on_put = on_put
end

#put(k, v) ⇒ Object



29
30
31
32
# File 'lib/fxmlloader/real_elts.rb', line 29

def put(k, v)
  @on_put.call(k, v) if @on_put
  @obj.put(k, v)
end

#wrapped_classObject



9
10
11
# File 'lib/fxmlloader/real_elts.rb', line 9

def wrapped_class
  @type
end