Imports the given CSV row into a target object.

 @param [{Symbol => Object}] row the input row field => value hash
 @return the migrated target object if the migration is valid, nil otherwise
772914
def migrate_row(row)
      # create an instance for each creatable class
      created = Set.new
      # the migrated objects
      migrated = @creatable_classes.map { |klass| create_instance(klass, row, created) }
      # migrate each object from the input row
      migrated.each do |obj|
        # First uniquify the object if necessary.
        if @unique and Unique === obj then
          logger.debug { "The migrator is making #{obj} unique..." }
          obj.uniquify
        end
        obj.migrate(row, migrated)
      end
      # the valid migrated objects
      @migrated = migrate_valid_references(row, migrated)
      # the candidate target objects
      tgts = @migrated.select { |obj| @target_class === obj }
      if tgts.size > 1 then
        raise MigrationError.new("Ambiguous #{@target_class} targets #{tgts.to_series}")
      end
      target = tgts.first || return
      
      logger.debug { "Migrated target #{target}." }
      target
    end
352781
public void addRow(Object[] r) {

        Object[] row = new Object[r.length];

        // System.arraycopy(r, 0, row, 0, r.length);
        for (int i = 0; i < r.length; i++) {
            row[i] = r[i];

            if (row[i] == null) {

//                row[i] = "(null)";
            }
        }

        rows.addElement(row);
    }
949414
def add_row(row)
      size = row.size
      raise ArgumentError.new("Given a row of data with #{size} entries, but there are only #{@table_columns.size} columns in the table") unless size == @table_columns.size
      @data << row
    end
1209578
public static void dumpRow(Map<String, Object> row)
   {
      for (Entry<String, Object> entry : row.entrySet())
      {
         Object value = entry.getValue();
         System.out.println(entry.getKey() + " = " + value + " ( " + (value == null ? "" : value.getClass().getName()) + ")");
      }
   }
319247
protected Object getTopRowBean(final List<Integer> row) {
		// Get root level
		List<?> lvl = getBeanList();
		if (lvl == null || lvl.isEmpty()) {
			return null;
		}

		// Get root row bean (ie top level)
		int rowIdx = row.get(0);
		Object rowData = lvl.get(rowIdx);
		return rowData;
	}
67958
def insert_row(row_index = 0)
      validate_workbook
      ensure_cell_exists(row_index)

      old_row = new_cells = nil

      if row_index > 0 then
        old_row = sheet_data.rows[row_index - 1]
        if old_row then
          new_cells = old_row.cells.collect { |c|
                        if c.nil? then nil
                        else nc = RubyXL::Cell.new(:style_index => c.style_index)
                             nc.worksheet = self
                             nc
                        end
                      }
        end
      end

      row0 = sheet_data.rows[0]
      new_cells ||= Array.new((row0 && row0.cells.size) || 0)

      sheet_data.rows.insert(row_index, nil)
      new_row = add_row(row_index, :cells => new_cells, :style_index => old_row && old_row.style_index)

      # Update row values for all rows below
      row_index.upto(sheet_data.rows.size - 1) { |r|
        row = sheet_data.rows[r]
        next if row.nil?
        row.cells.each_with_index { |cell, c|
          next if cell.nil?
          cell.r = RubyXL::Reference.new(r, c)
        }
      }

      return new_row
    end
384499
def set_row(row, val)
      # Setter
      if !row.is_a?(String) || (!val.is_a?(Hash) && !val.is_a?(Array))
        raise ArgumentError, 'Illegal argument type'
      elsif val.is_a?(Array) && val.size != col_keys.size
        raise ArgumentError, 'Column size not match'
      end

      case val
      when Array
        if @row_keys[row]
          row = @row_keys[row]
          @content[row] = val
        else
          @row_keys[row] = @row_keys.size
          @content << val
        end
      when Hash
        unless @row_keys[row]
          @row_keys[row] = @row_keys.size
          @content << ([''] * @col_keys.size)
        end

        row = @row_keys[row]
        val.each do |k, v|
          col = @col_keys[k]
          @content[row][col] = v if col
        end
      end

      self
    end
1259849
def concat(row)
      row = Workbook::Row.new(row) unless row.class == Workbook::Row
      super(row)
    end
939549
function Row(columnSpecs, row) {
  var i, col, type, val, cols = [];
  for (i = 0; i < columnSpecs.length; i++) {
    col = columnSpecs[i];
    type = types.fromType(col.type);
    if (col.subtype) {
      type = type(col.subtype);
    } else if (col.keytype) {
      type = type(col.keytype, col.valuetype);
    }
    val = type.deserialize(row[i]);
    this[col.name] = val;
    cols.push(val);
  }
  Object.defineProperty(this, 'columns', {
    value: cols,
    enumerable: false
  });
}
549333
private SparseDoubleVector updateRow(int row) {
        SparseDoubleVector rowVec = rowToColumns.get(row);
        if (rowVec == null) {
            rowVec = emptyVector.instanceCopy();
            rowToColumns.put(row, rowVec);
        }

        return rowVec;
    }
10960
def listing_row_to_object(row)
        l = Listing.new
        row.css('td').each_with_index do |td, i|

          txt = td.text.strip # yes, slightly slower to do this here, but I type less.

          case i
          when 4
            l.sku = txt
          when 5
            l.asin = txt
          when 6
            l.product_name = txt
          when 7
            l.created_at = parse_amazon_time(txt)
          when 8
            l.quantity = (inputs = td.css('input')).any? ? inputs.first['value'].to_i : txt.to_i
          when 10
            l.price = get_price(td)
          when 11
            l.condition = txt
          when 12
            l.low_price = get_low_price(td)
          when 3
            l.status = txt
          end
        end
        l
      end
627707
def insert(self, row):
        
        data = self._convert_value(row)
        self._service.InsertRow(data, self._ss.id, self.id)
871849
public static RowMajorSparseMatrix fromCSV(String csv) {
        return Matrix.fromCSV(csv).to(Matrices.SPARSE_ROW_MAJOR);
    }
24013
public CsvSchema buildCsvSchema(final Map<String, Object> row) {
        CsvSchema.Builder builder = CsvSchema.builder();
        Set<String> fields = row.keySet();

        for (String field : fields) {
            builder.addColumn(field);
        }

        return builder.build();
    }
1305152
def remove_row(row)
      case
        when row.is_a?(Array)
          location = @rows.index { |row_hash| row_hash.values_at(*@parameters) == row.collect { |value| value.strip } }
        when row.is_a?(Hash)
          location = @rows.index { |row_hash| row_hash == row.each_value { |value| value.strip! } }
        else
          raise(ArgumentError, "Can only remove row from a Hash or an Array but received #{row.class}")
      end

      #todo - remove once Hash rows are no longer supported
      @rows.delete_at(location) if location
      @row_elements.delete_at(location + 1) if location
    end
364825
def build_row!(row)
      row = @row_klass.call(row)

      # Convert values
      @type_map.each do |column, type|
        row[column] = @converter.call(row[column], type)
      end

      return row unless @builder

      @builder.call(row)
    end
451301
private void importRow(PdfPRow row) {
        this.cells = new ArrayList();
        this.width = this.document.getDocumentHeader().getPageSetting().getPageWidth() - this.document.getDocumentHeader().getPageSetting().getMarginLeft() - this.document.getDocumentHeader().getPageSetting().getMarginRight();
        this.width = (int) (this.width * this.parentTable.getTableWidthPercent() / 100);
        
        int cellRight = 0;
        int cellWidth = 0;
        PdfPCell[] cells = row.getCells();
        for(int i = 0; i < cells.length; i++) {
            cellWidth = (int) (this.width * this.parentTable.getProportionalWidths()[i] / 100);
            cellRight = cellRight + cellWidth;
            
            PdfPCell cell = cells[i];
            RtfCell rtfCell = new RtfCell(this.document, this, cell);
            rtfCell.setCellRight(cellRight);
            rtfCell.setCellWidth(cellWidth);
            this.cells.add(rtfCell);
        }
    }