Initialize this converter.
@param converter The field to set the bit in (Should be a NumberField).
@param iBitNumber The bit number to set with this converter (0 = L.O. bit).
@param trueIfMatch Return true if this bit is on (if this variable is true).
429657
public void init(Converter converter, int iBitNumber, boolean trueIfMatch, boolean bTrueIfNull)
    {
        super.init(converter);
        m_iBitNumber = iBitNumber;
        m_bTrueIfMatch = trueIfMatch;
        m_bTrueIfNull = bTrueIfNull;
    }
478549
@Override
    public void addConverter(Class<?> from, Class<?> to, Converter converter) {
        Map toMap = fromMap.get(from);
        if (toMap == null) {
            toMap = new HashMap<Class<?>, Map<Class<?>, Converter>>();
            fromMap.put(from, toMap);
        }
        toMap.put(to, converter);
    }
725371
public void init(Record record, String strToCompare, String strSeekSign, Converter pconvFlag, boolean bDontFilterIfNullCompare, BaseField fldToCheck, BaseField fldToCompare)
    {
        m_fldFakeDate = null;
        super.init(record, null, strToCompare, null, pconvFlag, bDontFilterIfNullCompare, fldToCheck, fldToCompare);
        if (strSeekSign == null)
            m_strSeekSign = DBConstants.BLANK;    // I Must do this here because I don't want the default value
    }
768452
private static Converter selectSlow(ConverterSet set, Class<?> type) {
        Converter[] converters = set.iConverters;
        int length = converters.length;
        Converter converter;

        for (int i=length; --i>=0; ) {
            converter = converters[i];
            Class<?> supportedType = converter.getSupportedType();

            if (supportedType == type) {
                // Exact match.
                return converter;
            }

            if (supportedType == null || (type != null && !supportedType.isAssignableFrom(type))) {
                // Eliminate the impossible.
                set = set.remove(i, null);
                converters = set.iConverters;
                length = converters.length;
            }
        }

        // Haven't found exact match, so check what remains in the set.

        if (type == null || length == 0) {
            return null;
        }
        if (length == 1) {
            // Found the one best match.
            return converters[0];
        }

        // At this point, there exist multiple potential converters.

        // Eliminate supertypes.
        for (int i=length; --i>=0; ) {
            converter = converters[i];
            Class<?> supportedType = converter.getSupportedType();
            for (int j=length; --j>=0; ) {
                if (j != i && converters[j].getSupportedType().isAssignableFrom(supportedType)) {
                    // Eliminate supertype.
                    set = set.remove(j, null);
                    converters = set.iConverters;
                    length = converters.length;
                    i = length - 1;
                }
            }
        }        
        
        // Check what remains in the set.

        if (length == 1) {
            // Found the one best match.
            return converters[0];
        }

        // Class c implements a, b {}
        // Converters exist only for a and b. Which is better? Neither.

        StringBuilder msg = new StringBuilder();
        msg.append("Unable to find best converter for type \"");
        msg.append(type.getName());
        msg.append("\" from remaining set: ");
        for (int i=0; i<length; i++) {
            converter = converters[i];
            Class<?> supportedType = converter.getSupportedType();

            msg.append(converter.getClass().getName());
            msg.append('[');
            msg.append(supportedType == null ? null : supportedType.getName());
            msg.append("], ");
        }

        throw new IllegalStateException(msg.toString());
    }
796473
public void setMatchReturnValue(String filterReturnValue) {
    if (filterReturnValue.equalsIgnoreCase("accept")) {
      matchReturnValue = ACCEPT;
    } else if (filterReturnValue.equalsIgnoreCase("deny")) {
      matchReturnValue = DENY;
    } else if (filterReturnValue.equalsIgnoreCase("neutral")) {
      matchReturnValue = NEUTRAL;
    } else {
      LogLog.error("invalid matchReturnValue: " + filterReturnValue);
    }
  }
372875
function ( num, integer ) {
			var tmp, item, i,
				transformTable, numberString, convertedNumber;

			// Set the target Transform table:
			transformTable = this.digitTransformTable( $.i18n().locale );
			numberString = '' + num;
			convertedNumber = '';

			if ( !transformTable ) {
				return num;
			}

			// Check if the restore to Latin number flag is set:
			if ( integer ) {
				if ( parseFloat( num, 10 ) === num ) {
					return num;
				}

				tmp = [];

				for ( item in transformTable ) {
					tmp[transformTable[item]] = item;
				}

				transformTable = tmp;
			}

			for ( i = 0; i < numberString.length; i++ ) {
				if ( transformTable[numberString[i]] ) {
					convertedNumber += transformTable[numberString[i]];
				} else {
					convertedNumber += numberString[i];
				}
			}

			return integer ? parseFloat( convertedNumber, 10 ) : convertedNumber;
		}
1122021
public static Object convertToUIInputValue(final ConverterFactory converterFactory,
            final InputComponent<?, ?> input, final Object value)
   {
      final Object result;
      Class<Object> sourceType = (Class<Object>) value.getClass();
      Class<Object> targetType = (Class<Object>) input.getValueType();
      if (!targetType.isAssignableFrom(sourceType))
      {
         if (input instanceof SelectComponent)
         {
            SelectComponent<?, Object> selectComponent = (SelectComponent<?, Object>) input;
            Iterable<Object> valueChoices = selectComponent.getValueChoices();
            final Converter<Object, ?> selectConverter;
            if (String.class.isAssignableFrom(sourceType))
            {
               selectConverter = getItemLabelConverter(converterFactory, selectComponent);
            }
            else
            {
               selectConverter = converterFactory.getConverter(targetType, sourceType);
            }
            Object chosenObj = null;
            if (valueChoices != null)
            {
               for (Object valueChoice : valueChoices)
               {
                  Object convertedObj = selectConverter.convert(valueChoice);
                  if (convertedObj.equals(value))
                  {
                     chosenObj = valueChoice;
                     break;
                  }
               }
            }
            result = chosenObj;
         }
         else
         {

            Converter<String, Object> valueConverter = (Converter<String, Object>) input.getValueConverter();
            if (valueConverter != null)
            {
               if (value instanceof String)
               {
                  result = valueConverter.convert((String) value);
               }
               else
               {
                  Converter<Object, String> stringConverter = converterFactory.getConverter(sourceType, String.class);
                  CompositeConverter compositeConverter = new CompositeConverter(stringConverter, valueConverter);
                  result = compositeConverter.convert(value);
               }

            }
            else
            {
               Converter<Object, Object> converter = converterFactory.getConverter(sourceType, targetType);
               result = converter.convert(value);
            }
         }
      }
      else
      {

         Converter<String, Object> valueConverter = (Converter<String, Object>) input.getValueConverter();
         if (valueConverter != null && value instanceof String)
         {
            result = valueConverter.convert((String) value);
         }
         else
         {
            // FORGE-2493: By setting the system property 'org.jboss.forge.ui.select_one_lenient_value' to true will
            // allow UISelectOne to set values outside of its value choices. (pre-2.20.0.Final behavior)
            if (input instanceof SelectComponent && !Boolean.getBoolean("org.jboss.forge.ui.select_one_lenient_value"))
            {
               SelectComponent<?, Object> selectComponent = (SelectComponent<?, Object>) input;
               Set<Object> valueChoices = Sets.toSet(selectComponent.getValueChoices());
               // Check if the value is contained in the valueChoices set
               if (valueChoices != null && valueChoices.contains(value))
               {
                  result = value;
               }
               else
               {
                  // equals()/hashCode may not have been implemented. Trying to compare from the String representation
                  Object chosenObj = null;
                  if (valueChoices != null)
                  {
                     Converter<Object, String> selectConverter = getItemLabelConverter(converterFactory,
                              selectComponent);
                     String valueLabel = selectConverter.convert(value);
                     for (Object valueChoice : valueChoices)
                     {
                        String convertedObj = selectConverter.convert(valueChoice);
                        if (convertedObj.equals(valueLabel))
                        {
                           chosenObj = valueChoice;
                           break;
                        }
                     }
                  }
                  result = chosenObj;
               }
            }
            else
            {
               result = value;
            }
         }
      }
      return result;
   }
694034
public void init(BaseField field, BaseListener listenerToDisable,  String strDisableOnMatch,  boolean bDisableIfMatch)
    {
        super.init(field);
        m_listenerToDisable = listenerToDisable;
        m_strDisableOnMatch = strDisableOnMatch;
        m_bDisableIfMatch = bDisableIfMatch;
    }
843581
public void registerConvertor(Class src, Class dest, Convertor convertor) {
        repository.registerConvertor(src, dest, convertor);
    }
760551
public void putBooleanMapping(String property, Object trueValue, Object falseValue) {
        Map<String, Object> mapping = new HashMap<>(2);
        mapping.put(TRUE, trueValue);
        mapping.put(FALSE, falseValue);
        this.getBooleanMapping().put(property, mapping);
    }
287355
@Override
	public int compareNumericallyTo(BitStore that) {
		if (that == null) throw new IllegalArgumentException("null that");
		return that.zeros().isAll() ? 0 : -1;
	}
68653
public void init(Record record, boolean bNoDelete, boolean bNoModify)
    {   // For this to work right, the booking number field needs a listener to re-select this file whenever it changes
        m_bNoDelete = bNoDelete;
        m_bNoModify = bNoModify;
        super.init(record);
    }
771206
private static boolean isMatchDayOfMonth(ValueMatcher matcher, int dayOfMonth, int month, boolean isLeapYear) {
		return ((matcher instanceof DayOfMonthValueMatcher) //
				? ((DayOfMonthValueMatcher) matcher).match(dayOfMonth, month, isLeapYear) //
				: matcher.match(dayOfMonth));
	}
242440
private void initLocalZeroPaddingNumberFormat() {
        if (numberFormat instanceof DecimalFormat) {
            decDigits = ((DecimalFormat)numberFormat).getDecimalFormatSymbols().getDigits();
            useLocalZeroPaddingNumberFormat = true;
        } else if (numberFormat instanceof DateNumberFormat) {
            decDigits = ((DateNumberFormat)numberFormat).getDigits();
            useLocalZeroPaddingNumberFormat = true;
        } else {
            useLocalZeroPaddingNumberFormat = false;
        }

        if (useLocalZeroPaddingNumberFormat) {
            decimalBuf = new char[DECIMAL_BUF_SIZE];
        }
    }
701891
public final <S, T> void registerConverter(ConverterKey<S,T> key, Converter<S, T> converter) {	

        if (key.getInputClass() == null) {
            throw new IllegalArgumentException("Input Class must not be null");
        }
        if (key.getOutputClass() == null) {
            throw new IllegalArgumentException("Output Class must not be null");
        }
        if (converter == null) {
            throw new IllegalArgumentException("Converter must not be null");
        }

        if (key.getQualifierAnnotation() == null) {
            throw new IllegalArgumentException("Qualifier must not be null");
        }

        Converter<?,?> old = registeredConverters.putIfAbsent(key, converter);
        if (old != null && (!isSameConverter(old, converter))) {
        	throw new IllegalStateException("Converter already registered for key: " + key);
        }
    }
121198
private void toBoolean(boolean box) {
        if (box && mTarget >= 0x00010004) {
            // Call the new valueOf method.
            invokeStatic("java.lang.Boolean", "valueOf",
                         TypeDesc.BOOLEAN.toObjectType(),
                         new TypeDesc[] {TypeDesc.BOOLEAN});
            return;
        }

        Label nonZero = createLabel();
        Label done = createLabel();
        ifZeroComparisonBranch(nonZero, "!=");
        if (box) {
            TypeDesc newType = TypeDesc.BOOLEAN.toObjectType();
            loadStaticField(newType.getRootName(), "FALSE", newType);
            branch(done);
            nonZero.setLocation();
            loadStaticField(newType.getRootName(), "TRUE", newType);
        } else {
            loadConstant(false);
            branch(done);
            nonZero.setLocation();
            loadConstant(true);
        }
        done.setLocation();
    }
652674
public void doValidRecord(boolean bDisplayOption) // Init this field override for other value
    {
    	Record record = this.getOwner();
    	BaseDatabase database = record.getTable().getDatabase();
    	m_bEnableOnValid = true;

    	int counter = (int)record.getCounterField().getValue();
    	String startingID = database.getProperty(BaseDatabase.STARTING_ID);
    	String endingID = database.getProperty(BaseDatabase.ENDING_ID);
    	if (startingID != null)
    		if (counter < Integer.parseInt(Converter.stripNonNumber(startingID)))
    			m_bEnableOnValid = false;
    	if (endingID != null)
    		if (counter > Integer.parseInt(Converter.stripNonNumber(endingID)))
    			m_bEnableOnValid = false;
//    	System.out.println("start, end: " + startingID + "  " + endingID);
        super.doValidRecord(bDisplayOption);
    }