Get this field to the maximum or minimum value.<p>
Override this to supply the correct max/min for this field type.
@param iAreaDesc END_SELECT_KEY means set to largest value, others mean smallest.
510913
public void setToLimit(int iAreaDesc)   // Set this field to the largest or smallest value
    {
        // Override this!!
        String filler = Constants.BLANK;
        if (iAreaDesc == DBConstants.END_SELECT_KEY)
        {   // \376 is consistently the largest in the character set
            filler = StringField.HIGH_STRING; // Change the filler pointer
        }
        this.doSetData(filler, DBConstants.DONT_DISPLAY, DBConstants.SCREEN_MOVE);  // will fill with zeros
    }
1328758
public int convertIndexToField(int index, boolean bDisplayOption, int iMoveMode)
    {   // User selected an item... Read it in!
        int iErrorCode = this.moveToIndex(index);
        if (iErrorCode == DBConstants.NORMAL_RETURN)
            m_record.handleRecordChange(null, DBConstants.SELECT_TYPE, bDisplayOption);   // Record selected!!!
        // These next lines causes the FieldBehaviors with SCREEN_MOVE to be executed!!!
        FieldInfo field = this.getField();
        if (iErrorCode == DBConstants.NORMAL_RETURN) if (field != null)
        {
            if (field instanceof ReferenceField)
                ((ReferenceField)field).setReference(m_record, bDisplayOption, iMoveMode);
            else if (field instanceof StringField)
            {
                {
                    if (displayFieldName != null)
                        return field.setString(m_record.getField(displayFieldName).toString());
                    else
                        return field.setString(m_record.getField(m_iFieldSeq).toString());
                }
            }
        }
        return iErrorCode;
    }
1164321
def get_input_score_end_range_metadata(self):
        
        # Implemented from template for osid.resource.ResourceForm.get_group_metadata_template
        metadata = dict(self._mdata['input_score_end_range'])
        metadata.update({'existing_decimal_values': self._my_map['inputScoreEndRange']})
        return Metadata(**metadata)
807754
public static int findMaxIndex( int[] a ) {
		int max = a[0];
		int index = 0;

		for( int i = 1; i< a.length; i++ ) {
			int val = a[i];

			if( val > max ) {
				max = val;
				index = i;
			}
		}

		return index;
	}
918326
public final int getMaxArity() {
    Node params = getParametersNode();
    if (params != null) {
      Node lastParam = params.getLastChild();
      if (lastParam == null || !lastParam.isVarArgs()) {
        return params.getChildCount();
      }
    }

    return Integer.MAX_VALUE;
  }
272160
public boolean checkParams(int iAreaDesc)
    {
        KeyArea pIndex = this.getKeyArea(-1);
        int lastField = pIndex.getKeyFields() + DBConstants.MAIN_FIELD - 1;
        for (int keyFieldSeq = DBConstants.MAIN_FIELD; keyFieldSeq <= lastField; keyFieldSeq++)
        {
            KeyField pKeyField = pIndex.getKeyField(keyFieldSeq);
            BaseField pField = pKeyField.getField(DBConstants.MAIN_FIELD);
            BaseField pParamField = pKeyField.getField(iAreaDesc);
            int bCompare = pField.compareTo(pParamField);
            if (iAreaDesc == DBConstants.END_SELECT_KEY) if (bCompare > 0)
                return true;    // Past range
            if (iAreaDesc == DBConstants.START_SELECT_KEY) if (bCompare < 0)
                return true;    // Past range
        }
        return false; // Within the range!
    }
842493
public static Map.Entry<Object, Double> selectMaxKeyValue(Map<Object, Double> keyValueMap) {
        Double maxValue=Double.NEGATIVE_INFINITY;
        Object maxValueKey = null;
        
        for(Map.Entry<Object, Double> entry : keyValueMap.entrySet()) {
            Double value = entry.getValue();
            if(value!=null && value>maxValue) {
                maxValue=value;
                maxValueKey=entry.getKey();
            }
        }
        
        return new AbstractMap.SimpleEntry<>(maxValueKey, keyValueMap.get(maxValueKey));
    }
1023955
@CheckForSigned
  private int _getPutIndex (final int key)
  {
    final int readIdx = _getReadIndex (key);
    if (readIdx >= 0)
      return readIdx;
    // key not found, find insertion point
    final int startIdx = MapHelper.phiMix (key) & m_nMask;
    if (m_aKeys[startIdx] == FREE_KEY)
      return startIdx;
    int idx = startIdx;
    while (m_aKeys[idx] != FREE_KEY)
    {
      idx = _getNextIndex (idx);
      if (idx == startIdx)
        return -1;
    }
    return idx;
  }
544142
public static int getSlot(ByteBuffer key) {

        int limit = key.limit();
        int position = key.position();

        int start = indexOf(key, SUBKEY_START);
        if (start != -1) {
            int end = indexOf(key, start + 1, SUBKEY_END);
            if (end != -1 && end != start + 1) {
                key.position(start + 1).limit(end);
            }
        }

        try {
            if (key.hasArray()) {
                return CRC16.crc16(key.array(), key.position(), key.limit() - key.position()) % SLOT_COUNT;
            }
            return CRC16.crc16(key) % SLOT_COUNT;
        } finally {
            key.position(position).limit(limit);
        }
    }
948779
def get_max_position(self, chrom):
        
        res = self.db.variant.find({'chrom':chrom}, {'_id':0, 'end':1}).sort([('end', DESCENDING)]).limit(1)
        end = 0
        for variant in res:
            end = variant['end']
        return end
640436
static SelectionKeysSet optimize(Selector selector, ILogger logger) {
        checkNotNull(selector, "selector");
        checkNotNull(logger, "logger");

        try {
            SelectionKeysSet set = new SelectionKeysSet();

            Class<?> selectorImplClass = findOptimizableSelectorClass(selector);
            if (selectorImplClass == null) {
                return null;
            }

            Field selectedKeysField = selectorImplClass.getDeclaredField("selectedKeys");
            selectedKeysField.setAccessible(true);

            Field publicSelectedKeysField = selectorImplClass.getDeclaredField("publicSelectedKeys");
            publicSelectedKeysField.setAccessible(true);

            selectedKeysField.set(selector, set);
            publicSelectedKeysField.set(selector, set);

            logger.finest("Optimized Selector: " + selector.getClass().getName());
            return set;
        } catch (Throwable t) {
            // we don't want to print at warning level because it could very well be that the target JVM doesn't
            // support this optimization. That is why we print on finest
            logger.finest("Failed to optimize Selector: " + selector.getClass().getName(), t);
            return null;
        }
    }
309089
public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption)
    { // Read a valid record
        int iErrorCode = super.doRecordChange(field, iChangeType, bDisplayOption);      // Initialize the record
        if (iErrorCode == DBConstants.NORMAL_RETURN)
        {
            if (iChangeType == DBConstants.AFTER_ADD_TYPE)
            {
                Object bookmark = this.getOwner().getLastModified(m_iHandleType);
                if (bookmark != null)
                    this.addBookmarkFilter(bookmark);
            }
            if (iChangeType == DBConstants.AFTER_REQUERY_TYPE)
            {
                String strKeyName = null;
                Object objKeyData = null;
                if (this.getOwner().getDefaultOrder() > 0)
                {
                    strKeyName = this.getOwner().getKeyArea().getKeyName();
                    KeyField keyField = this.getOwner().getKeyArea().getKeyField(0);
                    BaseField fldKey = keyField.getField(DBConstants.FILE_KEY_AREA);
                    if (fldKey instanceof ReferenceField)
                    {
                        if (!keyField.getField(DBConstants.END_SELECT_KEY).isNull())
                            if (keyField.getField(DBConstants.END_SELECT_KEY).equals(keyField.getField(DBConstants.START_SELECT_KEY)))
                            {
                                fldKey = keyField.getField(DBConstants.START_SELECT_KEY);   // On a requery this should be the key
                                objKeyData = fldKey.getData();
                            }
                    }
                }
                this.clearBookmarkFilters(strKeyName, objKeyData);
            }
        }
        return iErrorCode;
    }
460559
private Object readKey(
          FieldDescriptor field,
          JsonParser parser,
          DeserializationContext context
  ) throws IOException {
    if (parser.getCurrentToken() != JsonToken.FIELD_NAME) {
      throw reportWrongToken(JsonToken.FIELD_NAME, context, "Expected FIELD_NAME token");
    }

    String fieldName = parser.getCurrentName();
    switch (field.getJavaType()) {
      case INT:
        // lifted from StdDeserializer since there's no method to call
        try {
          return NumberInput.parseInt(fieldName.trim());
        } catch (IllegalArgumentException iae) {
          Number number = (Number) context.handleWeirdStringValue(
                  _valueClass,
                  fieldName.trim(),
                  "not a valid int value"
          );
          return number == null ? 0 : number.intValue();
        }
      case LONG:
        // lifted from StdDeserializer since there's no method to call
        try {
          return NumberInput.parseLong(fieldName.trim());
        } catch (IllegalArgumentException iae) {
          Number number = (Number) context.handleWeirdStringValue(
                  _valueClass,
                  fieldName.trim(),
                  "not a valid long value"
          );
          return number == null ? 0L : number.longValue();
        }
      case BOOLEAN:
        // lifted from StdDeserializer since there's no method to call
        String text = fieldName.trim();
        if ("true".equals(text) || "True".equals(text)) {
          return true;
        }
        if ("false".equals(text) || "False".equals(text)) {
          return false;
        }
        Boolean b = (Boolean) context.handleWeirdStringValue(
                _valueClass,
                text,
                "only \"true\" or \"false\" recognized"
        );
        return Boolean.TRUE.equals(b);
      case STRING:
        return fieldName;
      case ENUM:
        EnumValueDescriptor enumValueDescriptor = field.getEnumType().findValueByName(parser.getText());

        if (enumValueDescriptor == null && !ignorableEnum(parser.getText().trim(), context)) {
          throw context.weirdStringException(parser.getText(), field.getEnumType().getClass(),
                  "value not one of declared Enum instance names");
        }

        return enumValueDescriptor;
      default:
        throw new IllegalArgumentException("Unexpected map key type: " + field.getJavaType());
    }
  }
1185375
@SuppressWarnings("fallthrough")
    protected int handleGetLimit(int field, int limitType) {
        switch (field) {
        case ERA:
            if (limitType == MINIMUM || limitType == GREATEST_MINIMUM) {
                return 0;
            }
            return CURRENT_ERA;
        case YEAR:
        {
            switch (limitType) {
            case MINIMUM:
            case GREATEST_MINIMUM:
                return 1;
            case LEAST_MAXIMUM:
                return 1;
            case MAXIMUM:
                return super.handleGetLimit(field, MAXIMUM) - ERAS[CURRENT_ERA*3];
            }
            //Fall through to the default if not handled above
        }
        default:
            return super.handleGetLimit(field, limitType);
        }
    }
407681
public int findLowestKey(int min) {
        int lowest = Integer.MAX_VALUE;
        int index = index(hash(min));
        final int maxTry = capacity;
        for (int i = 0; i < maxTry; i++) {
            if (!slotIsFree(index)) {
                int k = keys[index];
                if (k == min) return min;
                if (min < k && k < lowest) lowest = k;
            }
            index = nextIndex(index);
        }
        return lowest;
    }
235876
Integer getMaxScaleAct() {

        switch (type) {

            case Types.SQL_DECIMAL :
            case Types.SQL_NUMERIC :
                return ValuePool.getInt(Integer.MAX_VALUE);

            default :
                return getMaxScale();
        }
    }
1329968
public int compareKeys(int iAreaDesc)
    {
        int iCompareValue = 0;
        boolean bForceUniqueKey = false;    // This method is only used by the physical table which do their own unique processing.
        int iKeyFieldCount = this.getKeyFields(bForceUniqueKey, false);
        for (int iKeyFieldSeq = DBConstants.MAIN_KEY_FIELD; iKeyFieldSeq < iKeyFieldCount; iKeyFieldSeq++)
        {
            KeyField keyField = this.getKeyField(iKeyFieldSeq, bForceUniqueKey);
            BaseField fldCurrent = keyField.getField(DBConstants.FILE_KEY_AREA);
            BaseField fldTemp = keyField.getField(iAreaDesc);
            iCompareValue = fldCurrent.compareTo(fldTemp);
            if (this.getKeyOrder(iKeyFieldSeq) == DBConstants.DESCENDING)
                iCompareValue = -iCompareValue;
            if (iCompareValue != 0)
                break;
        }
        return iCompareValue;
    }