All pastes #486935 Raw Edit

Stuff

public text v1 · immutable
·published 2007-05-14 04:41 UTC
rendered paste body
   String key1 = words[0];
                String key2 = words[1];
                int index = 0;
                int totalfactor1= 1;
                String baseunit1 = key1;
                boolean  indexcheck = false;
                while((unitmap.unit myunit = map.get(baseunit1)) != null){
                    if(opts.tableconvert){
                        out.printf("%s =" + opts.format  "%s%n", baseunit1, myunit.factor,
                                   myunit.baseunit);
                    }
                    totalfactor *= myunit.factor;
                    baseunit = myunit.baseunit;
                    index ++;
                    if(index == 32){
                       indexcheck = true;
                       break;
                    }
                }
                if( indexcheck == true){
                    syslib.warn("circular definition");
                    continue;
                }
                unitmap.unit unit1 = map.get(key1);
                unitmap.unit unit2 = map.get(key2);
                if(unit1 == null){
                    syslib.warn(key1 +" does not exist");
                }else if(unit2 == null){
                    syslib.warn(key2 +" does not exist");
                }else{