Wrapped -> Boxed.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5195 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -22,13 +22,13 @@
|
||||
package com.threerings.util {
|
||||
|
||||
/**
|
||||
* An interface implemented by our wrapper classes.
|
||||
* An interface implemented by our "boxed" data classes.
|
||||
*/
|
||||
public interface Wrapped
|
||||
public interface Boxed
|
||||
{
|
||||
/**
|
||||
* Return the wrapped value.
|
||||
* Return the unboxed value.
|
||||
*/
|
||||
function unwrap () :Object;
|
||||
function unbox () :Object;
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,7 @@ package com.threerings.util {
|
||||
* Equivalent to java.lang.Byte.
|
||||
*/
|
||||
public class Byte
|
||||
implements Equalable, Wrapped
|
||||
implements Equalable, Boxed
|
||||
{
|
||||
public var value :int;
|
||||
|
||||
@@ -45,8 +45,8 @@ public class Byte
|
||||
return (other is Byte) && (value === (other as Byte).value);
|
||||
}
|
||||
|
||||
// from Wrapped
|
||||
public function unwrap () :Object
|
||||
// from Boxed
|
||||
public function unbox () :Object
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ package com.threerings.util {
|
||||
* Equivalent to java.lang.Float.
|
||||
*/
|
||||
public class Float
|
||||
implements Equalable, Wrapped
|
||||
implements Equalable, Boxed
|
||||
{
|
||||
public var value :Number;
|
||||
|
||||
@@ -45,8 +45,8 @@ public class Float
|
||||
return (other is Float) && (value === (other as Float).value);
|
||||
}
|
||||
|
||||
// from Wrapped
|
||||
public function unwrap () :Object
|
||||
// from Boxed
|
||||
public function unbox () :Object
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ package com.threerings.util {
|
||||
// Number <--> java.lang.Double. However, a Number object that refers
|
||||
// to an integer value is actually an int. Yes, it's totally fucked.
|
||||
public class Integer
|
||||
implements Equalable, Wrapped
|
||||
implements Equalable, Boxed
|
||||
{
|
||||
public var value :int;
|
||||
|
||||
@@ -50,8 +50,8 @@ public class Integer
|
||||
return (other is Integer) && (value === (other as Integer).value);
|
||||
}
|
||||
|
||||
// from Wrapped
|
||||
public function unwrap () :Object
|
||||
// from Boxed
|
||||
public function unbox () :Object
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ package com.threerings.util {
|
||||
* Equivalent to java.lang.Short.
|
||||
*/
|
||||
public class Short
|
||||
implements Equalable, Wrapped
|
||||
implements Equalable, Boxed
|
||||
{
|
||||
/** The minimum possible short value. */
|
||||
public static const MIN_VALUE :int = -Math.pow(2, 15);
|
||||
@@ -52,8 +52,8 @@ public class Short
|
||||
return (other is Short) && (value === (other as Short).value);
|
||||
}
|
||||
|
||||
// from Wrapped
|
||||
public function unwrap () :Object
|
||||
// from Boxed
|
||||
public function unbox () :Object
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -417,9 +417,13 @@ public class StringUtil
|
||||
return null;
|
||||
}
|
||||
var ba :ByteArray = new ByteArray();
|
||||
for (var ii :int = 0; ii < s.length; ii++) {
|
||||
ba[ii] = int(s.charCodeAt(ii)) & 0xFF;
|
||||
}
|
||||
// if (true) {
|
||||
for (var ii :int = 0; ii < s.length; ii++) {
|
||||
ba[ii] = int(s.charCodeAt(ii)) & 0xFF;
|
||||
}
|
||||
// } else {
|
||||
// ba.writeUTFBytes(s);
|
||||
// }
|
||||
return ba;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import com.threerings.io.Streamable;
|
||||
* Equivalent to java.lang.Boolean.
|
||||
*/
|
||||
public class langBoolean
|
||||
implements Equalable, Streamable, Wrapped
|
||||
implements Equalable, Streamable, Boxed
|
||||
{
|
||||
public var value :Boolean;
|
||||
|
||||
@@ -62,8 +62,8 @@ public class langBoolean
|
||||
value = ins.readBoolean();
|
||||
}
|
||||
|
||||
// from Wrapped
|
||||
public function unwrap () :Object
|
||||
// from Boxed
|
||||
public function unbox () :Object
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user