package org.TexasTorque.TorqueLib.util;

import java.util.Enumeration;
import java.util.Hashtable;

public class TorqueLogging extends Thread
{
    
    private static TorqueLogging instance;
    private Hashtable logTable;
    private static String fileName = "TorqueLog.txt";
    private static boolean logToDashboard = false;
    private static boolean writeNow = false;
    
    public static void setFileName(String fileNm)
    {
        fileName = fileNm;
    }
    
    public static void setDashboardLogging(boolean log)
    {
        logToDashboard = log;
    }
    
    public static TorqueLogging getInstance()
    {
        return (instance == null) ? instance = new TorqueLogging() : instance;
    }
    
    public TorqueLogging()
    {
        logTable = new Hashtable();
        
    }
    
    public void start()
    {
        
    }
    
    public void run()
    {
        
    }
    
    public void writeKeys()
    {
        if(!logTable.isEmpty())
        {
            String logLine = "";
            Enumeration keys = logTable.keys();
            while(keys.hasMoreElements())
            {
                String key = (String)keys.nextElement();
                Object value = logTable.get(key);
                
            }
        }
    }
    
    public void writeValues()
    {
        if(!logTable.isEmpty())
        {
            String logLine = "";
            Enumeration keys = logTable.keys();
            while(keys.hasMoreElements())
            {
                String key = (String)keys.nextElement();
                Object value = logTable.get(key);
                
            }
        }
    }
    
    public void writeToDashboard()
    {
        
    }
    
    
}

package org.TexasTorque.TorqueLib.util;

import java.util.Hashtable;

public class TorqueLogging extends Thread
{
    
    private static TorqueLogging instance;
    private static String fileName = "TorqueLog.txt";
    private static boolean logToDashboard = false;
    private Hashtable table;
    private String keys;
    private String values;
    private int numValues;
    
    public static void setFileName(String fileNm)
    {
        fileName = fileNm;
    }
    
    public static void setDashboardLogging(boolean log)
    {
        logToDashboard = log;
    }
    
    public synchronized static TorqueLogging getInstance()
    {
        return (instance == null) ? instance = new TorqueLogging() : instance;
    }
    
    public TorqueLogging()
    {
        table = new Hashtable();
        numValues = 0;
    }
    
    public void start()
    {
        
    }
    
    public void run()
    {
        
    }
    
    public synchronized void logValue(String name, int value)
    {
        if(table.get(name) == null)
        {
            keys += name;
            numValues++;
        }
        table.put(name, "" + value);
    }
    
    public synchronized void logValue(String name, boolean value)
    {
        if(table.get(name) == null)
        {
            keys += name;
            numValues++;
        }
        table.put(name, "" + value);
    }
    
    public synchronized void logValue(String name, double value)
    {
        if(table.get(name) == null)
        {
            keys += name;
            numValues++;
        }
        table.put(name, "" + value);
    }
    
    public synchronized void logValue(String name, String value)
    {
        if(table.get(name) == null)
        {
            keys += name;
            numValues++;
        }
        table.put(name, value);
    }
    
    public void writeKeysToFile()
    {
        
    }
    
    public void calculateValueString()
    {
    }
    
    public void writeValuesToFile()
    {
        
    }
    
    public void writeToDashboard()
    {
        
    }
    
    
}

set up the logging methods of the class and changed around its structure to rayne's specs