Read the entire contents of a cursor row and store them in a ContentValues.

@param cursor the cursor to read from.
@param values the {@link ContentValues} to put the row into.
353935
public static void cursorRowToContentValues(Cursor cursor, ContentValues values) {
        String[] columns = cursor.getColumnNames();
        int length = columns.length;
        for (int i = 0; i < length; i++) {
            if (cursor.getType(i) == Cursor.FIELD_TYPE_BLOB) {
                values.put(columns[i], cursor.getBlob(i));
            } else {
                values.put(columns[i], cursor.getString(i));
            }
        }
    }
395724
public void setLimitValues(java.util.Collection<String> limitValues) {
        if (limitValues == null) {
            this.limitValues = null;
            return;
        }

        this.limitValues = new java.util.ArrayList<String>(limitValues);
    }
663229
public static void setAttr(Map<String, Object> values) {
		for (Entry<String, Object> entry : values.entrySet()) {
			getServletRequest().setAttribute(entry.getKey(), entry.getValue());
		}
	}
388863
@Override
  void scan(EnvKelp query, Object []values, RowCursor cursor)
  {
    try (InputStream is = cursor.openInputStream(getColumn().index())) {
      if (is == null) {
        return;
      }

      _serializer.query(is, _query, values);
    } catch (IOException e) {
      log.log(Level.FINER, e.toString(), e);
    }
  }
129763
public void buildInSqlByCollection(String fieldText, Collection<Object> values) {
        super.buildInSql(fieldText, values == null ? null : values.toArray());
    }
345962
public static long insert(Connection connection, String table,
			ContentValues values) {
		try {
			return insertOrThrow(connection, table, values);
		} catch (Exception e) {
			log.log(Level.WARNING, "Error inserting into table: " + table
					+ ", Values: " + values, e);
			return -1;
		}
	}
1229623
public void setCursor(Object object, String cursor) {
		if (object == null) {
			Dom.setStyleAttribute(getRootElement(), "cursor", cursor);
		} else {
			Element element = getGroup(object);
			if (element != null) {
				Dom.setStyleAttribute(element, "cursor", cursor);
			}
		}
	}
246614
public static void dumpCurrentRow(Cursor cursor, PrintStream stream) {
        String[] cols = cursor.getColumnNames();
        stream.println("" + cursor.getPosition() + " {");
        int length = cols.length;
        for (int i = 0; i< length; i++) {
            String value;
            try {
                value = cursor.getString(i);
            } catch (SQLiteException e) {
                // assume that if the getString threw this exception then the column is not
                // representable by a string, e.g. it is a BLOB.
                value = "<unprintable>";
            }
            stream.println("   " + cols[i] + '=' + value);
        }
        stream.println("}");
    }
503772
public void setContents(byte[] value) {

        if (value == null) {
            value = new byte[] {};
        }
        long dateContent = System.currentTimeMillis();
        if ((m_fileContent == null) || (m_fileContent.length == 0)) {
            dateContent = m_dateContent;
        }
        m_fileContent = new byte[value.length];
        System.arraycopy(value, 0, m_fileContent, 0, value.length);

        if (m_fileContent.length > 0) {
            m_length = m_fileContent.length;
        } else {
            m_length = 0;
        }
        m_dateContent = dateContent;
    }
1146295
@Override
    public Uri insert(Uri uri, ContentValues values) {
        Uri result = null;

        if (!controller.hasPreinitialized()) {
            throw new IllegalStateException("Controller has not been initialized.");
        }

        int patternCode = controller.getUriMatcher().match(uri);
        MatcherPattern pattern = controller.findMatcherPattern(patternCode);
        if (pattern == null) {
            throw new IllegalArgumentException("unknown uri : " + uri.toString());
        }

        Parameter parameter = new Parameter(uri, values);
        SQLiteDatabase db = this.getHelper().getWritableDatabase();

        result = onInsert(this.getHelper(), db, pattern, parameter);
        if (result != null) {
            this.onInsertCompleted(result, uri, pattern, parameter);
        }
        return result;
    }
1332887
@Override
    public void putAll(final Collection<T> values) {
        if (values == null || values.size() == 0) {
            return;
        }
        for (final T value : values) {
            put(value);
        }
    }
970223
public void addRow(boolean[] values) {
    Node<ColumnName> prev = null;
    for(int i=0; i < values.length; ++i) {
      if (values[i]) {
        ColumnHeader<ColumnName> top = columns.get(i);
        top.size += 1;
        Node<ColumnName> bottom = top.up;
        Node<ColumnName> node = new Node<ColumnName>(null, null, bottom, 
                                                     top, top);
        bottom.down = node;
        top.up = node;
        if (prev != null) {
          Node<ColumnName> front = prev.right;
          node.left = prev;
          node.right = front;
          prev.right = node;
          front.left = node;
        } else {
          node.left = node;
          node.right = node;
        }
        prev = node;
      }
    }
  }
330570
@Override
    public void setCursorPosition(TerminalPosition position) {
        if(position == null) {
            //Skip any validation checks if we just want to hide the cursor
            this.cursorPosition = null;
            return;
        }
        if(position.getColumn() < 0) {
            position = position.withColumn(0);
        }
        if(position.getRow() < 0) {
            position = position.withRow(0);
        }
        if(position.getColumn() >= terminalSize.getColumns()) {
            position = position.withColumn(terminalSize.getColumns() - 1);
        }
        if(position.getRow() >= terminalSize.getRows()) {
            position = position.withRow(terminalSize.getRows() - 1);
        }
        this.cursorPosition = position;
    }
954603
public static <T> List<T> getList(final ContentValues[] values, final Class<T> klass) {
        final List<T> objects = new ArrayList<T>();
        for (int i = 0; i < values.length; i++) {
            final T object = getObject(values[i], klass);
            if (object != null) {
                objects.add(object);
            }
        }
        return objects;
    }
1364433
public void setArrayValues(java.util.Collection<Value> arrayValues) {
        if (arrayValues == null) {
            this.arrayValues = null;
            return;
        }

        this.arrayValues = new java.util.ArrayList<Value>(arrayValues);
    }
1140601
public void setTypeaheadValues(java.lang.Object _typeaheadValues) {
		getStateHelper().put(PropertyKeys.typeaheadValues, _typeaheadValues);
	}
239006
public static long insertOrThrow(Connection connection, String table,
			ContentValues values) {

		StringBuilder insert = new StringBuilder();
		insert.append("insert into ").append(CoreSQLUtils.quoteWrap(table))
				.append("(");

		Object[] args = null;
		int size = (values != null && values.size() > 0) ? values.size() : 0;

		args = new Object[size];
		int i = 0;
		for (String colName : values.keySet()) {
			insert.append((i > 0) ? "," : "");
			insert.append(CoreSQLUtils.quoteWrap(colName));
			args[i++] = values.get(colName);
		}
		insert.append(')');
		insert.append(" values (");
		for (i = 0; i < size; i++) {
			insert.append((i > 0) ? ",?" : "?");
		}
		insert.append(')');

		String sql = insert.toString();

		PreparedStatement statement = null;

		long id = 0;
		try {
			statement = connection.prepareStatement(sql);
			setArguments(statement, args);
			int count = statement.executeUpdate();

			if (count == 0) {
				throw new GeoPackageException(
						"Failed to execute SQL insert statement: " + sql
								+ ". No rows added from execution.");
			}

			try (ResultSet generatedKeys = statement.getGeneratedKeys()) {
				if (generatedKeys.next()) {
					id = generatedKeys.getLong(1);
				} else {
					throw new GeoPackageException(
							"Failed to execute SQL insert statement: " + sql
									+ ". No row id was found.");
				}
			}
		} catch (SQLException e) {
			throw new GeoPackageException(
					"Failed to execute SQL insert statement: " + sql, e);
		} finally {
			closeStatement(statement, sql);
		}

		return id;
	}