Your Car Loan Embedded

Java RESTful Service Documentation

To make the integration of the RESTful finance calculation service as simple as possible we have also created a Java class that consumes the service that you can simply drop into your existing Java project.

Here you will find the neccessary documentation needed to integrate this class into your project.

Download the Binaries

The neccessary files can be downloaded from the following URL:

Version 0.2.0 JAR - 21/05/2008

Version 0.2.0 Source - 21/05/2008

API Documentation

You can use the familar javadoc interface for browsing the API using the following link:

Usage Guide

Add the JAR to your application classpath or lib directory

Depending on your usage of the Jycle package you should include the JAR file as provided in your library directory. Ensure the JAR file is available on your class path. It may be helpful to use an IDE such as Netbeans or Eclipse to ensure your have the JAR file included correctly.

Create the object

Import the package into your source file as follows:
import net.codweavers.ycle.java.app.*;
Create a new instance of the Jycle class and pass your given username/organisation name into the constructor:
Jycle jycle = new Jycle("my username");
You can now access all the Calculation methods as defined in the API Documentation

Obtaining a basic Hire Purchase calculation

With the object as created above you can obtain a basic Hire Purchase calculation by passing in just two fields:
jycle.Calculate( 10000.00f, new Date() );
This will return a simple Hire Purchase calculation for a vehicle costing £10,000 with a registration date of "today". The calculation will be returned as XML, respresented as a string. You can then transform, serialise or parse the output for your needs.

Obtaining a Residual Value product calculation (PCP, Lease Purchase)

With the object as created above you can obtain a residual value based product calculation by passing in just four fields:
jycle.CalculateWithRV( 10000.00f, new Date(108, 02, 15), 10000, 35214 );
This will return a Hire Purchase, Personal Contract Purchase (PCP) and Lease Purchase quotation if these products are set up for your account. The calculation shown here is for a vehicle costing £10,000 with a registration date of February 15th 2008, having 10,000 miles on the clock (mileage) and a CAPID of 35214 which is a BMW 3 SERIES SALOON 335i M Sport 4dr. The calculation will be returned as XML, respresented as a string. You can then transform, serialise or parse the output for your needs.

Passing in User Defined Deposit, Annual Mileage and Term

Any of the calculation methods can be overloaded to take the user's preferred deposit, annual mileage and term for their loan:
jycle.Calculate( 10000.00f, new Date(), 1000.00f, 8000, 24 );
This will return a simple Hire Purchase calculation for a vehicle costing £10,000 with a registration date of "today", using a deposit of £1000, an annual mileage of 8,000 miles and a term length of 24 months. The calculation will be returned as XML, respresented as a string. You can then transform, serialise or parse the output for your needs.

Passing in User Defined Rates

Any of the calculation methods can be overloaded to take a custom rate, by passing in 2 extra parameters - rateType and rate. The rate type is set using the Jycle.RateType enumeration, and can have one of the following values:
Jycle.RateType.APR;
Jycle.RateType.COMMISSION;
Jycle.RateType.CUSTOMER_RATE;
Simply pass in one of these rate types together with the rate you wish to use. For APR and Customer Rate the rate is handled as a percentage. For a Commission rate type the rate is handled as currency.
jycle.Calculate( 10000.00f, new Date(), Jycle.RateType.APR, 12.9f );
jycle.Calculate( 10000.00f, new Date(), Jycle.RateType.COMMISSION, 250.00f );
jycle.Calculate( 10000.00f, new Date(), Jycle.RateType.CUSTOMER_RATE, 9.0f );
This will return a simple Hire Purchase calculation for a vehicle costing £10,000 with a registration date of "today", using the rate type and rate specified. The calculation will be returned as XML, respresented as a string. You can then transform, serialise or parse the output for your needs.

Further Examples and Unit Tests

This library has been created using Test Driven Development on the JUNit framework. For further code examples please download the source and browse the unit tests

Open Source Licensing

The code is licensed under the BSD license.
If you wish to expand and contribute to this project please submit patches to support@codeweavers.net. All new features must be unit tested, documented and will only be patched to the trunk at the approval of the YCLE development team.
        
/* 
 * Copyright (c) 2008, Codeweavers Ltd.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
 *
 *    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
 *    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
 *    * Neither the name of Codeweavers Ltd nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
 *    
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */