Added a streaming Boolean wrapper. Untested.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4279 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-07-19 23:59:55 +00:00
parent 783b5ef33d
commit 2f9ea3a69e
2 changed files with 45 additions and 0 deletions
+1
View File
@@ -35,5 +35,6 @@ public class Translations
// initialize some standard classes
addTranslation("Object", "java.lang.Object");
addTranslation("com.threerings.util.langBoolean", "java.lang.Boolean");
}
}
+44
View File
@@ -0,0 +1,44 @@
package com.threerings.util {
import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream;
import com.threerings.io.Streamable;
/**
* Equivalent to java.lang.Boolean.
*/
public class langBoolean
implements Equalable, Streamable
{
public var value :Boolean;
public static function valueOf (val :Boolean) :langBoolean
{
return new langBoolean(val);
}
public function langBoolean (value :Boolean = false)
{
this.value = value;
}
// from Equalable
public function equals (other :Object) :Boolean
{
return (other is langBoolean) &&
(value === (other as langBoolean).value);
}
// from Streamable
public function writeObject (out :ObjectOutputStream) :void
{
out.writeBoolean(value);
}
// from Streamable
public function readObject (ins :ObjectInputStream) :void
{
value = ins.readBoolean();
}
}
}