Class: RRExpressionValue
- Inherits:
-
Object
- Object
- RRExpressionValue
- Defined in:
- lib/fxmlloader/j8_expression_value.rb
Overview
/**
-
Class representing an observable expression value.
*/
Instance Method Summary collapse
- #addListener(listener) ⇒ Object
- #getValue ⇒ Object
-
#initialize(namespace, expression, type) ⇒ RRExpressionValue
constructor
A new instance of RRExpressionValue.
- #monitorArguments ⇒ Object
- #removeListener(listener) ⇒ Object
- #unmonitorArguments ⇒ Object
Constructor Details
#initialize(namespace, expression, type) ⇒ RRExpressionValue
Returns a new instance of RRExpressionValue.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/fxmlloader/j8_expression_value.rb', line 52 def initialize(namespace, expression, type) super() dputs "Initializing with #{namespace}, #{expression}, #{type}" if (namespace == nil) raise "NullPointerException.new();" end if (expression == nil) raise "NullPointerException.new();" end if (type == nil) raise "NullPointerException.new();" end @listenerCount = 0; @namespace = namespace; @expression = expression; @type = type; arguments = expression.getArguments(); @argumentMonitors = ArrayList.new(arguments.size()); for argument in arguments @argumentMonitors.add(KeyPathMonitor.new(self, argument.iterator())); end end |
Instance Method Details
#addListener(listener) ⇒ Object
87 88 89 90 91 92 93 94 |
# File 'lib/fxmlloader/j8_expression_value.rb', line 87 def addListener( listener) if (@listenerCount == 0) monitorArguments(); end super(listener); @listenerCount += 1 end |
#getValue ⇒ Object
82 83 84 85 |
# File 'lib/fxmlloader/j8_expression_value.rb', line 82 def getValue() dputs "gettng 8ev for #{self} on #{@expression}" return RubyWrapperBeanAdapter.coerce(@expression.evaluate(@namespace), @type); end |
#monitorArguments ⇒ Object
105 106 107 108 109 |
# File 'lib/fxmlloader/j8_expression_value.rb', line 105 def monitorArguments() for argumentMonitor in @argumentMonitors argumentMonitor.monitor(@namespace); end end |
#removeListener(listener) ⇒ Object
96 97 98 99 100 101 102 103 |
# File 'lib/fxmlloader/j8_expression_value.rb', line 96 def removeListener( listener) super(listener); @listenerCount-=1 if (@listenerCount == 0) unmonitorArguments(); end end |
#unmonitorArguments ⇒ Object
111 112 113 114 115 |
# File 'lib/fxmlloader/j8_expression_value.rb', line 111 def unmonitorArguments() for argumentMonitor in @argumentMonitors argumentMonitor.unmonitor(); end end |