Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add skeleton object for defining the state of data
- Loading branch information
1 parent
5766a45
commit 6df5a38
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package mesh.model.store | ||
{ | ||
/** | ||
* The <code>DataState</code> class encapsulates the state of the data for a store key in | ||
* the store, in relation to the data's source. | ||
* | ||
* @author Dan Schultz | ||
*/ | ||
public class DataState | ||
{ | ||
/** | ||
* Constructor. | ||
*/ | ||
public function DataState(value:int) | ||
{ | ||
_value = value; | ||
} | ||
|
||
/** | ||
* Checks if two states are equal. | ||
* | ||
* @param obj The object to check. | ||
* @return <code>true</code> if the two states are equal. | ||
*/ | ||
public function equals(obj:Object):Boolean | ||
{ | ||
return obj is DataState ? obj.value == value : false; | ||
} | ||
|
||
private var _value:int; | ||
/** | ||
* The internal value for this state. | ||
*/ | ||
public function get value():int | ||
{ | ||
return _value; | ||
} | ||
} | ||
} |