Class: Tabula::TextElementIndex
- Inherits:
-
Java::ComInfomatiqJsiRtree::RTree
- Object
- Java::ComInfomatiqJsiRtree::RTree
- Tabula::TextElementIndex
- Defined in:
- lib/tabula/entities/text_element_index.rb
Defined Under Namespace
Classes: SaveToListProcedure
Instance Attribute Summary collapse
-
#te_dict ⇒ Object
readonly
Returns the value of attribute te_dict.
Instance Method Summary collapse
- #<<(text_element) ⇒ Object
- #contains(zone_entity) ⇒ Object
-
#initialize ⇒ TextElementIndex
constructor
A new instance of TextElementIndex.
Constructor Details
#initialize ⇒ TextElementIndex
Returns a new instance of TextElementIndex.
27 28 29 30 31 32 |
# File 'lib/tabula/entities/text_element_index.rb', line 27 def initialize super self.init(nil) @te_dict = {} @save_to_list = SaveToListProcedure.new(self) end |
Instance Attribute Details
#te_dict ⇒ Object (readonly)
Returns the value of attribute te_dict.
4 5 6 |
# File 'lib/tabula/entities/text_element_index.rb', line 4 def te_dict @te_dict end |
Instance Method Details
#<<(text_element) ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/tabula/entities/text_element_index.rb', line 34 def <<(text_element) r = Java::ComInfomatiqJsi::Rectangle.new(text_element.left, text_element.top, text_element.right, text_element.bottom) @te_dict[text_element.object_id] = text_element self.add(r, text_element.object_id) end |
#contains(zone_entity) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/tabula/entities/text_element_index.rb', line 43 def contains(zone_entity) r = Java::ComInfomatiqJsi::Rectangle.new(zone_entity.left, zone_entity.top, zone_entity.right, zone_entity.bottom) @save_to_list.reset! super(r, @save_to_list) # sort in lexicographic (reading) order @save_to_list.list.sort end |