Back to project page DisposableIncome-OldJava.
The source code is released under:
MIT License
If you think the Android project DisposableIncome-OldJava 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 uk.co.wilka.disposableincome; /*from w ww.ja v a 2s .c o m*/ import java.net.CacheRequest; public class Cash { private int pence; public static Cash fromPounds(int pounds) { return new Cash(pounds * 100); } public static Cash fromPence(int pence) { return new Cash(pence); } private Cash(int pence) { this.pence = pence; } public int getPounds() { return pence / 100; } public int getPence() { return pence; } // TODO: Unit test this public Cash plus(Cash other) { return new Cash(pence + other.pence); } // TODO: Unit test this public Cash minus(Cash other) { return new Cash(pence - other.pence); } }