/*
 * Created on Feb 7, 2007
 */
package org.griphyn.vdl.util;

public final class TriStateBoolean {
	public static final TriStateBoolean FALSE = new TriStateBoolean(0);
    public static final TriStateBoolean TRUE = new TriStateBoolean(1);
    public static final TriStateBoolean MAYBE = new TriStateBoolean(2);
    
    private int value;
    
    private TriStateBoolean(int value) {
        this.value = value;
    }

	public boolean equals(Object obj) {
		if (obj instanceof TriStateBoolean) {
			return value == ((TriStateBoolean) obj).value;
        }
        else {
        	return false;   
        }
	}

	public int hashCode() {
		return value;
	}

	public String toString() {
		switch(value) {
            case 0: return "false";
            case 1: return "true";
            default: return "maybe";
        }
	}
    
    public static TriStateBoolean valueOf(String value) {
    	if ("false".equalsIgnoreCase(value) || "no".equalsIgnoreCase(value)) {
    		return FALSE;
        }
        else if ("true".equalsIgnoreCase(value) || "yes".equalsIgnoreCase(value)) {
            return TRUE;
        }
        else {
        	return MAYBE;
        }
    }
}

@@ -94,17 +94,20 @@
 olean %7B%0A
-%09
+    
 public s
@@ -418,17 +418,20 @@
 %0A    %7D%0A%0A
-%09
+    
 public b
@@ -458,18 +458,24 @@
  obj) %7B%0A
-%09%09
+        
 if (obj 
@@ -508,11 +508,20 @@
 ) %7B%0A
-%09%09%09
+            
 retu
@@ -592,25 +592,28 @@
 e %7B%0A        
-%09
+    
 return false
@@ -627,21 +627,27 @@
       %7D%0A
-%09%7D%0A%0A%09
+    %7D%0A%0A    
 public i
@@ -662,18 +662,24 @@
 ode() %7B%0A
-%09%09
+        
 return v
@@ -688,13 +688,19 @@
 ue;%0A
-%09%7D%0A%0A%09
+    %7D%0A%0A    
 publ
@@ -722,18 +722,24 @@
 ing() %7B%0A
-%09%09
+        
 switch(v
@@ -864,17 +864,20 @@
       %7D%0A
-%09
+    
 %7D%0A    %0A 
@@ -937,17 +937,20 @@
 ) %7B%0A    
-%09
+    
 if (%22fal
@@ -1020,10 +1020,16 @@
     
-%09%09
+        
 retu
@@ -1194,9 +1194,12 @@
     
-%09
+    
 retu

Tidy whitespace