IntegerFieldParser.java :  » Game » textadventure » streambolics » core » Android Open Source

Android Open Source » Game » textadventure 
textadventure » streambolics » core » IntegerFieldParser.java
package streambolics.core;

public abstract class IntegerFieldParser<T> extends FieldParser<T>
{
    protected abstract void setConvertedValue (T aObject, int aValue);

    protected abstract int getConvertedValue (T aObject);

    @Override
    public void setValue (T aObject, String aValue)
    {
        setConvertedValue (aObject, Integer.parseInt (aValue));
    }

    @Override
    public String getValue (T aObject)
    {
        return Integer.toString (getConvertedValue (aObject));
    }

    @Override
    public boolean isValue (T aObject, String aValue)
    {
        return getConvertedValue (aObject) == Integer.parseInt (aValue);
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.