attempts to approximately set the job submit time based on the last
modification time of the job history file
@param value result
@return approximate job submit time
@throws MissingColumnInResultException
343737
public long getApproxSubmitTime(Result value)
      throws MissingColumnInResultException {
    if (value == null) {
      throw new IllegalArgumentException(
          "Cannot get last modification time from " + "a null hbase result");
    }

    Cell cell = value.getColumnLatestCell(Constants.INFO_FAM_BYTES,
        Constants.JOBHISTORY_LAST_MODIFIED_COL_BYTES);

    if (cell == null) {
      throw new MissingColumnInResultException(Constants.INFO_FAM_BYTES,
          Constants.JOBHISTORY_LAST_MODIFIED_COL_BYTES);
    }

    byte[] lastModTimeBytes = CellUtil.cloneValue(cell);
    // we try to approximately set the job submit time based on when the job
    // history file
    // was last modified and an average job duration
    long lastModTime = Bytes.toLong(lastModTimeBytes);
    long jobSubmitTimeMillis = lastModTime - Constants.AVERGAE_JOB_DURATION;
    LOG.debug("Approximate job submit time is " + jobSubmitTimeMillis
        + " based on " + lastModTime);
    return jobSubmitTimeMillis;
  }
686752
public void setFinish(int index, Date value)
   {
      set(selectField(AssignmentFieldLists.CUSTOM_FINISH, index), value);
   }
891184
public final void setRemainingTimeToLive(long value) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setRemainingTimeToLive", Long.valueOf(value));
        if (value < 0) {
            getHdr2().setLongField(JsHdr2Access.TIMETOLIVE, 0);
        }
        else if (value == 0) {
            getHdr2().setLongField(JsHdr2Access.TIMETOLIVE, 1);
        }
        else {
            long ttl = getMessageWaitTime().longValue() + value;
            /* Call setTimeToLive so that bounds checking takes place for an API message. */
            setTimeToLive(ttl);
        }
        wasTimeToLiveChanged = true;
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setRemainingTimeToLive");
    }
1196495
public static final String printTime(Date value)
   {
      return (value == null ? null : TIME_FORMAT.get().format(value));
   }
724044
@Override
	public void setValueAt(final Object value, final int rowIndex, final int visibleIndex) {
		final int actualColIndex = this.visibilityManager.getActualIndexFromVisibleIndex(visibleIndex);
		final JKTableRecord record = this.records.get(rowIndex);
		record.setColumnValue(actualColIndex, value);
		record.setStatus(RecordStatus.MODIFIED);
		fireTableCellUpdated(rowIndex, visibleIndex);
		this.modified = true;
	}
827032
public static java.sql.Date getDate(Object value) {
        try {
            return toDate(value);
        } catch (ParseException pe) {
            pe.printStackTrace();
            return null;
        }
    }
1135541
public void setFinish(int index, Date value)
   {
      set(selectField(TaskFieldLists.CUSTOM_FINISH, index), value);
   }
744733
function setColumnValue($column_name, $value, $column_type = null) {
		if (null === $column_type) {
			$column_type = static::getColumnType($column_name);
		}

		static $true = array(true, 1, '1', 'on', 'true');
		static $false = array(false, 0, '0', 'off', 'false');

		if ($column_type === self::COLUMN_TYPE_BOOLEAN) {
			if (is_string($value)) {
				$value = strtolower($value);
			}
			if (in_array($value, $true, true)) {
				$value = 1;
			} elseif (in_array($value, $false, true)) {
				$value = 0;
			} elseif ($value === '' || $value === null) {
				$value = null;
			} else {
				throw new InvalidArgumentException($value . ' is not a valid boolean value');
			}
		} else {
			$temporal = static::isTemporalType($column_type);
			$numeric = static::isNumericType($column_type);

			if ($numeric || $temporal) {
				if (is_string($value)) {
					$value = trim($value);
				}
				if ('' === $value) {
					$value = null;
				} elseif (null !== $value) {
					if ($temporal) {
						$value = static::coerceTemporalValue($value, $column_type, static::getConnection());
					} elseif ($numeric) {
						if (is_bool($value)) {
							$value = $value ? 1 : 0;
						} elseif (static::isIntegerType($column_type)) {
							// validate and cast
							if (!is_int($value)) {
								$int_val = intval($value);
								if ((string) $int_val != (string) $value) {
									throw new InvalidArgumentException($value . ' is not a valid integer or it is too large');
								}
								$value = $int_val;
							}
						} else {
							// only validates, doesn't cast...yet
							$float_val = floatval($value);
							if ((string) $float_val != (string) $value) {
								throw new InvalidArgumentException($value . ' is not a valid float or it is too large');
							}
						}
					}
				}
			}
		}

		if ($this->$column_name !== $value) {
			$this->_modifiedColumns[$column_name] = $column_name;
			$this->$column_name = $value;
		}
		return $this;
	}
809874
private void setParameter(PreparedStatement preparedStatement, int param, Object value) throws SQLException {
		if (value instanceof Enum<?>) {
			Enum<?> e = (Enum<?>) value;
			value = e.ordinal();
		} else if (value instanceof LocalDate) {
			value = java.sql.Date.valueOf((LocalDate) value);
		} else if (value instanceof LocalTime) {
			value = java.sql.Time.valueOf((LocalTime) value);
		} else if (value instanceof LocalDateTime) {
			value = java.sql.Timestamp.valueOf((LocalDateTime) value);
		}
		preparedStatement.setObject(param, value);
	}
1139800
public String correctDurationValue(String value) {
		if (value.matches("PT[0-9]+H")){
			for (MatchResult mr : Toolbox.findMatches(Pattern.compile("PT([0-9]+)H"), value)){
				try {
					int hours = Integer.parseInt(mr.group(1));
					if ((hours % 24) == 0){
						int days = hours / 24;
						value = "P"+days+"D";
					}
				} catch(NumberFormatException e) {
					Logger.printDetail(component, "Couldn't do granularity conversion for " + value);
				}
			}
		} else if (value.matches("PT[0-9]+M")){
			for (MatchResult mr : Toolbox.findMatches(Pattern.compile("PT([0-9]+)M"), value)){
				try {
					int minutes = Integer.parseInt(mr.group(1));
					if ((minutes % 60) == 0){
						int hours = minutes / 60;
						value = "PT"+hours+"H";
					}
				} catch(NumberFormatException e) {
					Logger.printDetail(component, "Couldn't do granularity conversion for " + value);
				}
			}
		} else if (value.matches("P[0-9]+M")){
			for (MatchResult mr : Toolbox.findMatches(Pattern.compile("P([0-9]+)M"), value)){
				try {
					int months = Integer.parseInt(mr.group(1));
					if ((months % 12) == 0){
						int years = months / 12;
						value = "P"+years+"Y";
					}
				} catch(NumberFormatException e) {
					Logger.printDetail(component, "Couldn't do granularity conversion for " + value);
				}
			}
		}
		return value;
	}
1313831
private static Object toDatabaseSupportedValue(Object value) {
        if (value instanceof java.lang.String ||
                value instanceof byte[] ||
                value instanceof Byte[] ||
                value instanceof java.lang.Long ||
                value instanceof java.lang.Integer ||
                value instanceof java.lang.Boolean ||
                value instanceof java.math.BigInteger ||
                value instanceof java.lang.Float ||
                value instanceof java.lang.Double ||
                value instanceof java.math.BigDecimal ||
                value instanceof java.sql.Date ||
                value instanceof java.util.Date ||
                /*
                because java.sql.Time and java.sql.Timestamp is subclass of java.sql.Date so the checks always return true
                value instanceof java.sql.Time || value instanceof java.sql.Timestamp ||
                */
                value instanceof java.util.Calendar
                ) {
            return value;
        } else {
            return Reflection.toType(value, String.class);
        }
    }
828730
public void setDate(Date value) {
		this.checkNull(value);
		list.add(value);
		type.add(Date.class);
	}
999380
public static java.sql.Timestamp getTimestamp(Object value) {
        try {
            return toTimestamp(value);
        } catch (ParseException pe) {
            pe.printStackTrace();
            return null;
        }
    }
448630
public TimeColumn set(Selection rowSelection, LocalTime newValue) {
        for (int row : rowSelection) {
            set(row, newValue);
        }
        return this;
    }
283834
public void set(boolean value, int entry) {
        if (entry > numEntries || entry < 0)
            throw new ND4JIllegalStateException(
                            "Entry index given (" + entry + ")in is higher then configured one (" + numEntries + ")");

        if (oneTime && this.timeTracker.get(entry))
            return;

        if (value)
            this.holder |= 1 << (entry + 1);
        else
            this.holder &= ~(1 << (entry + 1));

        if (oneTime)
            this.timeTracker.set(true, entry);
    }
84345
public boolean add(final int value)
    {
        if (value == MISSING_VALUE)
        {
            final boolean previousContainsMissingValue = this.containsMissingValue;
            containsMissingValue = true;
            return !previousContainsMissingValue;
        }

        final int[] values = this.values;
        @DoNotSub final int mask = values.length - 1;
        @DoNotSub int index = Hashing.hash(value, mask);

        while (values[index] != MISSING_VALUE)
        {
            if (values[index] == value)
            {
                return false;
            }

            index = next(index, mask);
        }

        values[index] = value;
        sizeOfArrayValues++;

        if (sizeOfArrayValues > resizeThreshold)
        {
            increaseCapacity();
        }

        return true;
    }
383149
public void add(String column, Object value) {
        add(System.currentTimeMillis(), column, value);
    }