class BaseDataSource

Attributes

startOffset[RW]

Public Class Methods

new(startOffset = 0) click to toggle source
# File lib/data/base_data_source.rb, line 4
def initialize(startOffset = 0)
  @nextDataSource = nil
  @startOffset = startOffset
end

Public Instance Methods

each_with_index(offset = 0) { |value, offset| ... } click to toggle source
# File lib/data/base_data_source.rb, line 9
def each_with_index(offset = 0)
  while ((value = self.valueAt(offset)) != nil) do
    yield value, offset
    offset += 1
  end
end
extendWith(dataSource, startOffset) click to toggle source
# File lib/data/base_data_source.rb, line 16
def extendWith(dataSource, startOffset)
  if (@nextDataSource == nil) then
    @nextDataSource = dataSource
    dataSource.startOffset = startOffset
  else
    @nextDataSource.extendWith(dataSource, startOffset)
  end
end
has_terminator?() click to toggle source
# File lib/data/base_data_source.rb, line 25
def has_terminator?
  false
end
nextDataSourceValueAt(offset) click to toggle source
# File lib/data/base_data_source.rb, line 29
def nextDataSourceValueAt(offset)
  if (@nextDataSource != nil) then
    return @nextDataSource.valueAt(offset)
  else
    return nil
  end
end
valueSequence(startOffset, endOffset) click to toggle source
# File lib/data/base_data_source.rb, line 37
def valueSequence(startOffset, endOffset)
  result = ""
  (startOffset..endOffset).each do |offset|
    result += self.valueAt(offset)
  end
  result
end