123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 |
- define("dojox/uuid/Uuid", ['dojo/_base/lang', './_base'], function(dojo, uuid){
- dojox.uuid.Uuid = function(/*String?*/ input){
-
-
-
-
-
-
-
-
-
-
-
-
-
- this._uuidString = dojox.uuid.NIL_UUID;
- if(input){
- dojox.uuid.assert(dojo.isString(input));
- this._uuidString = input.toLowerCase();
- dojox.uuid.assert(this.isValid());
- }else{
- var ourGenerator = dojox.uuid.Uuid.getGenerator();
- if(ourGenerator){
- this._uuidString = ourGenerator();
- dojox.uuid.assert(this.isValid());
- }
- }
- };
- dojox.uuid.Uuid.compare = function(/*dojox.uuid.Uuid*/ uuidOne, /*dojox.uuid.Uuid*/ uuidTwo){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var uuidStringOne = uuidOne.toString();
- var uuidStringTwo = uuidTwo.toString();
- if (uuidStringOne > uuidStringTwo) return 1;
- if (uuidStringOne < uuidStringTwo) return -1;
- return 0;
- };
- dojox.uuid.Uuid.setGenerator = function(/*Function?*/ generator){
-
-
-
-
-
- dojox.uuid.assert(!generator || dojo.isFunction(generator));
- dojox.uuid.Uuid._ourGenerator = generator;
- };
- dojox.uuid.Uuid.getGenerator = function(){
-
-
- return dojox.uuid.Uuid._ourGenerator;
- };
- dojox.uuid.Uuid.prototype.toString = function(){
-
-
-
- return this._uuidString;
- };
- dojox.uuid.Uuid.prototype.compare = function(/*dojox.uuid.Uuid*/ otherUuid){
-
-
-
-
-
-
- return dojox.uuid.Uuid.compare(this, otherUuid);
- };
- dojox.uuid.Uuid.prototype.isEqual = function(/*dojox.uuid.Uuid*/ otherUuid){
-
-
-
- return (this.compare(otherUuid) == 0);
- };
- dojox.uuid.Uuid.prototype.isValid = function(){
-
-
- return dojox.uuid.isValid(this);
- };
- dojox.uuid.Uuid.prototype.getVariant = function(){
-
-
-
-
-
-
-
-
-
-
-
-
- return dojox.uuid.getVariant(this);
- };
- dojox.uuid.Uuid.prototype.getVersion = function(){
-
-
-
-
-
-
-
-
-
- if(!this._versionNumber){
- this._versionNumber = dojox.uuid.getVersion(this);
- }
- return this._versionNumber;
- };
- dojox.uuid.Uuid.prototype.getNode = function(){
-
-
-
-
-
-
- if (!this._nodeString) {
- this._nodeString = dojox.uuid.getNode(this);
- }
- return this._nodeString;
- };
- dojox.uuid.Uuid.prototype.getTimestamp = function(/*String?*/ returnType){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if(!returnType){returnType = null};
- switch(returnType){
- case "string":
- case String:
- return this.getTimestamp(Date).toUTCString();
- break;
- case "hex":
-
-
- if (!this._timestampAsHexString) {
- this._timestampAsHexString = dojox.uuid.getTimestamp(this, "hex");
- }
- return this._timestampAsHexString;
- break;
- case null:
- case "date":
- case Date:
-
- if (!this._timestampAsDate) {
- this._timestampAsDate = dojox.uuid.getTimestamp(this, Date);
- }
- return this._timestampAsDate;
- break;
- default:
-
- dojox.uuid.assert(false, "The getTimestamp() method dojox.uuid.Uuid was passed a bogus returnType: " + returnType);
- break;
- }
- };
- return dojox.uuid.Uuid;
- });
|