01: /**************************************************************************************
02: * Copyright (c) Jonas BonŽr, Alexandre Vasseur. All rights reserved. *
03: * http://aspectwerkz.codehaus.org *
04: * ---------------------------------------------------------------------------------- *
05: * The software in this package is published under the terms of the LGPL license *
06: * a copy of which has been included with this distribution in the license.txt file. *
07: **************************************************************************************/package examples.caching;
08:
09: /**
10: * @author <a href="mailto:jboner@codehaus.org">Jonas BonŽr </a>
11: */
12: public class Pi {
13:
14: public int getPiDecimal(int n) {
15: System.out.println("Pi.getPiDecimal");
16: String decimals = "141592653";
17: if (n > decimals.length()) {
18: return 0;
19: } else {
20: return Integer.parseInt(decimals.substring(n, n + 1));
21: }
22: }
23: }
|