com.edsdev.jconvert.logic
Class ConversionGapBuilder

java.lang.Object
  extended bycom.edsdev.jconvert.logic.ConversionGapBuilder

public class ConversionGapBuilder
extends java.lang.Object

This class is responsible for generating missing conversions in a ConversionType list. The name is a bit misleading.

Author:
Ed Sarrazin Created on Nov 2, 2007 7:54:38 PM

Constructor Summary
ConversionGapBuilder()
           
 
Method Summary
static void createMissingConversions(ConversionType ct)
          Looks through all of the conversions in the specified ConversionType and tries to create missing conversions through association.
static void createOneToOneConversions(ConversionType ct)
          This method is responsible for creating the one-to-one conversions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConversionGapBuilder

public ConversionGapBuilder()
Method Detail

createOneToOneConversions

public static void createOneToOneConversions(ConversionType ct)
This method is responsible for creating the one-to-one conversions. All these are are the conversions that convert the same unit of measure to itself. These are boring calculations that no-one really wants to enter in their conversion tables. But it makes the GUI nice when selecting around and the To lists do not keep shifting around

Parameters:
ct - ConversionType that you want to create the one-to-one conversions in.

createMissingConversions

public static void createMissingConversions(ConversionType ct)
Looks through all of the conversions in the specified ConversionType and tries to create missing conversions through association. For example, if you have a conversion from feet to yards and from miles to yards, this method should create the conversions feet to feet, feet to miles, yards to feet, yards to miles, yards to yards, miles to miles, and miles to feet. Note that due to the math involved, if there is an offset in the current conversion, then there will not be any other calculated conversions from that conversion

Parameters:
ct - ConversionType


JConvert - opensource project by Ed Sarrazin