Sets the <tt>Currency Usage</tt> object used to display currency.
This takes effect immediately, if this format is a
currency format.
@param newUsage new currency context object to use.
971076
public void setCurrencyUsage(CurrencyUsage newUsage) {
        if (newUsage == null) {
            throw new NullPointerException("return value is null at method AAA");
        }
        currencyUsage = newUsage;
        Currency theCurrency = this.getCurrency();

        // We set rounding/digit based on currency context
        if (theCurrency != null) {
            setRoundingIncrement(theCurrency.getRoundingIncrement(currencyUsage));
            int d = theCurrency.getDefaultFractionDigits(currencyUsage);
            setMinimumFractionDigits(d);
            _setMaximumFractionDigits(d);
        }
    }
765794
public void setValue(Object newValue) {
        Object checkedValue = checkValue(newValue);
        setDirty(isDifferent(baseValue, checkedValue));
        if (isDifferent(value, checkedValue)){ // firePropertyChange doesn't do this check sufficiently
            firePropertyChange(VALUE, value, value = checkedValue); // set inline to avoid recursion
        }
    }
62047
public void bind(Object newValue)
    {
    	if (getValue() == null)
    	{
    		setValue(newValue);
    	}	
    	else
    	{
    		setValue2(newValue);
    		setBound(true); 		
    	}
    }
538475
public void setValue(Object newValue)
    {
    	if (NOT_KNOWN.equals(newValue))
    	{
        	m_proxyField.updateValue();
    		m_proxyField.setNotKnown(true);
    		return;
    	}
    	if (UNKNOWN.equals(newValue))
    	{
    		m_proxyField.reset();
        	m_proxyField.updateValue();
    		return;
    	}
    	m_proxyField.setValue(newValue);
    	m_proxyField.updateValue();
    }
1327629
public static void setProperty2(Object newValue, Object object, String property) {
        setProperty(object, property, newValue);
    }
202987
private void setValue(Object newValue) {
        try {
            if (this.type == null)
                value = newValue;
            else if (this.type.equals("java.lang.String"))
                value = newValue;
            else if (this.type.equals("java.lang.Boolean"))
                value = Boolean.valueOf((String) newValue);
            else if (this.type.equals("java.lang.Integer"))
                value = new Integer(((String) newValue));
            else if (this.type.equals("java.lang.Double"))
                value = new Double(((String) newValue));
            else if (this.type.equals("java.lang.Byte"))
                value = new Byte(((String) newValue));
            else if (this.type.equals("java.lang.Short"))
                value = new Short(((String) newValue));
            else if (this.type.equals("java.lang.Long"))
                value = new Long(((String) newValue));
            else if (this.type.equals("java.lang.Float"))
                value = new Float(((String) newValue));
            else if (this.type.equals("java.lang.Character")) 
                value = Character.valueOf(((String) newValue).charAt(0)); 
            else
                value = newValue;

        } catch (NumberFormatException nfe) {
            Tr.warning(tc, "INCOMPATIBLE_PROPERTY_TYPE_J2CA0207", new Object[] { name, type, newValue });
        }

    }
942541
public synchronized void use(Object user) {
		usage++;
		lastUsage = System.currentTimeMillis();
		if (users != null)
			users.add(user);
	}
550152
public void setProperty(Class sender, Object object, String name, Object newValue, boolean useSuper, boolean fromInsideClass) {
        if (setPropertyMethod != null && !name.equals(META_CLASS_PROPERTY) && getJavaClass().isInstance(object)) {
            setPropertyMethod.invoke(object, new Object[]{name, newValue});
            return;
        }
        super.setProperty(sender, object, name, newValue, useSuper, fromInsideClass);
    }
111737
def currency_context(context):
    
    request = context['request']
    currency_code = memoize_nullary(lambda: get_currency_code(request))

    context['CURRENCIES'] = Currency.active.all() # querysets are already lazy
    context['CURRENCY_CODE'] = currency_code # lazy
    context['CURRENCY'] = memoize_nullary(lambda: get_currency(currency_code)) # lazy

    return ''
1296261
@Override
    public Money subtract(MonetaryAmount subtrahend) {
        MoneyUtils.checkAmountParameter(subtrahend, this.currency);
        if (subtrahend.isZero()) {
            return this;
        }
        return new Money(this.number.subtract(subtrahend.getNumber().numberValue(BigDecimal.class)), getCurrency());
    }
1024243
public void setValue(Object newValue)
    {
    	if (FieldMetadata.NOT_KNOWN.equals(newValue))
    	{
            setUnknown(false);
            m_notKnown = true;
            return;
    		//throw new RuntimeException("Inconsistent use of NOT_KNOWN");
    	}
    	if (FieldMetadata.UNKNOWN.equals(newValue))
    	{
            setUnknown(true);
            m_notKnown = false;
            return;
    		//throw new RuntimeException("Inconsistent use of UNKNOWN");
    	}
        if (isDerived() && !ValidationUtils.equals(m_currentValue,newValue))
        {
            final String labelName = getPropertyMetadata().getLabelName();
            final String message = m_messageSourceAccessor.getMessage(
                    "nz.co.senanque.validationengine.derivedValue",
                    new Object[]
                    { labelName, newValue }, 
                    "Cannot set derived field.");
            throw new ValidationException(message);
        }
        m_currentValue = newValue;
        useCurrentValue(true);
        setUnknown(false);
        m_notKnown = false;
        
        addHistory(newValue);
    }
1184927
public void setUseChartDataTextColor(final boolean USE) {
        if (null == useChartDataTextColor) {
            _useChartDataTextColor = USE;
            redraw();
        } else {
            useChartDataTextColor.set(USE);
        }
    }
775435
public static synchronized void setLocale(String newLocale) throws UnsupportedLocaleException {
        Preconditions.checkArgument(newLocale == null, "newLocale == null");
        if (!newLocale.equals(CURRENT_LOCALE)) {
            LogCentral.setLocale(newLocale);
            CURRENT_LOCALE = newLocale;
        }
    }
1295467
private function setLocale($locale)
    {
        if($locale != null)
        {
            \Locale::setDefault($locale);
        }
        else 
        {
           \Locale::setDefault(self::CURRENCY_DEFAULT_LOCALE); 
        }
        
        $this->locale = \Locale::getDefault();
    }
1053177
private void assignCurrencyPrivate(XAttributable element, String currency) {
		if (currency != null && currency.trim().length() > 0) {
			XAttributeLiteral attr = (XAttributeLiteral) ATTR_CURRENCY.clone();
			attr.setValue(currency);
			element.getAttributes().put(KEY_CURRENCY, attr);
		}
	}
3738
public void setValueOn(String newValue, @Nullable String newName) {
        if (isChecked()) { // refining on valueOn: facetRefinement needs an update
            searcher.updateFacetRefinement(attribute, valueOn, false)
                    .updateFacetRefinement(newName != null ? newName : attribute, newValue, true)
                    .search();
        }
        this.valueOn = newValue;
        applyEventualNewAttribute(newName);
    }
918743
void mergeChild(MoneyParseContext child) {
        setLocale(child.getLocale());
        setText(child.getText());
        setIndex(child.getIndex());
        setErrorIndex(child.getErrorIndex());
        setCurrency(child.getCurrency());
        setAmount(child.getAmount());
    }