Back to project page interdroid-swan.
The source code is released under:
Copyright (c) 2008-2011 Vrije Universiteit, The Netherlands All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the follo...
If you think the Android project interdroid-swan listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package interdroid.swan.swansong; //from w ww . j av a 2 s . com public class ConstantValueExpression implements ValueExpression { private Result mResult; public ConstantValueExpression(Object constant) { mResult = new Result(new TimestampedValue[] { new TimestampedValue( constant) }, 0); mResult.setDeferUntil(Long.MAX_VALUE); mResult.setDeferUntilGuaranteed(true); } public Result getResult() { return mResult; } @Override public String toParseString() { if (mResult.mValues[0].getValue() instanceof String) { return "'" + mResult.mValues[0].getValue().toString() + "'"; } else { return mResult.mValues[0].getValue().toString(); } } @Override public void setInferredLocation(String location) { throw new RuntimeException( "Please don't use this method. For internal use only."); } @Override public String getLocation() { return LOCATION_INDEPENDENT; } @Override public HistoryReductionMode getHistoryReductionMode() { return HistoryReductionMode.DEFAULT_MODE; } }