These should all be immutable.

Hopefully nothing was setting the values.
If so, maybe we'll see compile-time errors/warnings.
Maybe.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5677 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2009-03-03 22:30:15 +00:00
parent 07a42c7364
commit 1566d00c75
5 changed files with 88 additions and 36 deletions
+17 -6
View File
@@ -27,28 +27,39 @@ package com.threerings.util {
public class Float
implements Equalable, Boxed
{
public var value :Number;
public static function valueOf (val :Number) :Float
{
return new Float(val);
}
public function Float (value :Number)
/**
* Access the immutable value.
*/
public function get value () :Number
{
this.value = value;
return _value;
}
/**
* Constructor.
*/
public function Float (floatValue :Number)
{
_value = floatValue;
}
// from Equalable
public function equals (other :Object) :Boolean
{
return (other is Float) && (value === (other as Float).value);
return (other is Float) && (_value === (other as Float).value);
}
// from Boxed
public function unbox () :Object
{
return value;
return _value;
}
protected var _value :Number;
}
}