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:
@@ -35,5 +35,6 @@ public class Translations
|
||||
|
||||
// initialize some standard classes
|
||||
addTranslation("Object", "java.lang.Object");
|
||||
addTranslation("com.threerings.util.langBoolean", "java.lang.Boolean");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user