com.timjohnstondev.unitconverter.logic
Class UnitLogic

java.lang.Object
  extended by com.timjohnstondev.unitconverter.logic.UnitLogic

public final class UnitLogic
extends Object

Utility class that contains all of the logic for checking and updating the units with mole.


Method Summary
static boolean hasMoles(ListModel model)
          Determines if there is a mole part of the unit already.
static void insertMol(JList list, String unitSeparator)
          Changes the unit to show mole as appropriate.
static boolean isMolUnitDivisor(ListModel model)
          Determines if the mole part of the unit will be in the divisor or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hasMoles

public static boolean hasMoles(ListModel model)
Determines if there is a mole part of the unit already.

Parameters:
model - list of the units
Returns:
true if unit has a mole part, otherwise false

isMolUnitDivisor

public static boolean isMolUnitDivisor(ListModel model)
Determines if the mole part of the unit will be in the divisor or not.

Parameters:
model - list of the units
Returns:
true if mole unit is in the divisor, otherwise false

insertMol

public static void insertMol(JList list,
                             String unitSeparator)
Changes the unit to show mole as appropriate.

Parameters:
list - list of the units
unitSeparator - the unit separator


Copyright © 2009 Tim Johnston Development, LLC. All Rights Reserved.