function AdfObject() {
  this.Init();
}
AdfObject.superclass = null;
AdfObject._GET_FUNCTION_NAME_REGEXP = /function\s+([\w\$][\w\$\d]*)\s*\(/;
AdfObject.prototype = new Object;
AdfObject.prototype.constructor = AdfObject;
AdfObject.createSubclass = function(extendingClass, baseClass, typeName, classInitializationState) {
  AdfAssert.assertFunction(extendingClass);
  AdfAssert.assertFunctionOrNull(baseClass);
  AdfAssert.assertStringOrNull(typeName);
  if (baseClass == undefined) {
    baseClass = AdfObject;
  }
  AdfAssert.assert(extendingClass != baseClass, "Class can't extend itself");
  var tempConstructor = AdfObject._tempSubclassConstructor;
  tempConstructor.prototype = baseClass.prototype;
  extendingClass.prototype = new tempConstructor;
  extendingClass.prototype.constructor = extendingClass;
  extendingClass.superclass = extendingClass["superclass"] = baseClass.prototype;
  if (typeName) {
    extendingClass._typeName = typeName;
  }
  if (classInitializationState !== undefined) {
    extendingClass._classInitializationState = classInitializationState;
  }
};
AdfObject._tempSubclassConstructor = function() {
};
AdfObject.exportPrototypeSymbol = function(name, valueMapping) {
  var renamed = null;
  var val = null;
  for (var prop in valueMapping) {
    renamed = prop;
    val = valueMapping[prop];
    break;
  }
  var tokens = name.split(".");
  var constructor = window[tokens[0]];
  var original = tokens[2];
  if (renamed == original || renamed == null) {
    return;
  }
  var renameMap = constructor._r2o;
  if (!renameMap) {
    renameMap = new Object;
    constructor._r2o = renameMap;
  }
  renameMap[renamed] = original;
  goog.exportSymbol(name, val);
};
AdfObject.prototype.getClass = function(otherInstance) {
  if (otherInstance == undefined) {
    otherInstance = this;
  } else {
    if (otherInstance == null) {
      return null;
    }
  }
  return otherInstance["constructor"];
};
AdfObject.prototype.adopt = function(theRawObject) {
  AdfCollections.copyInto(this, theRawObject);
};
AdfObject.prototype.clone = function() {
  var clone = new this.constructor;
  AdfCollections.copyInto(clone, this);
  return clone;
};
AdfObject.prototype.toString = function() {
  return this.toDebugString();
};
AdfObject.prototype.toDebugString = function() {
  return this.getTypeName() + " Object";
};
AdfObject.getTypeName = function(clazz) {
  AdfAssert.assertFunction(clazz);
  var typeName = clazz._typeName;
  if (typeName == null) {
    var constructorText = clazz.toString();
    var matches = AdfObject._GET_FUNCTION_NAME_REGEXP.exec(constructorText);
    typeName = matches[1];
    clazz._typeName = typeName;
  }
  return typeName;
};
AdfObject.prototype.getTypeName = function() {
  return AdfObject.getTypeName(this.constructor);
};
AdfObject.prototype.Init = function() {
  if (AdfAssert.DEBUG) {
    AdfAssert.assert(this["getTypeName"], "Not an AdfObject");
  }
  var currClass = this.constructor;
  if (!currClass._initialized) {
    AdfObject._initClasses(currClass);
  }
};
AdfObject.ensureClassInitialization = function(clazz) {
  AdfAssert.assertFunction(clazz);
  if (!clazz._initialized) {
    AdfObject._initClasses(clazz);
  }
};
AdfObject.prototype.GetLazyMapProperty = function(propName, createIfNonexistent, otherInstance) {
  if (otherInstance == undefined) {
    otherInstance = this;
  }
  var property = otherInstance[propName];
  if (property == undefined && createIfNonexistent) {
    property = new Object;
    otherInstance[propName] = property;
  }
  return property;
};
AdfObject.prototype.GetLazyArrayProperty = function(propName, createIfNonexistent, otherInstance) {
  if (otherInstance == undefined) {
    otherInstance = this;
  }
  var property = otherInstance[propName];
  if (property == undefined && createIfNonexistent) {
    property = new Array;
    otherInstance[propName] = property;
  }
  return property;
};
AdfObject.prototype.equals = function(object) {
  return this === object;
};
AdfObject.prototype.createCallback = function(func) {
  AdfAssert.assertFunction(func);
  var funcName = func[AdfAssert.FUNC_NAME_PROPERTY];
  AdfAssert.assertString(funcName);
  var proxyFunction = function anonymous() {
    var f = arguments.callee;
    return f._func.apply(f._owner, arguments);
  };
  proxyFunction["_owner"] = this;
  proxyFunction["_func"] = func;
  return proxyFunction;
};
AdfObject.createInitializedObject = function() {
  var argCount = arguments.length;
  AdfAssert.assert(argCount % 2 == 0, "every key must have a value");
  var newObject = new Object;
  for (var i = 0;i < argCount;i++) {
    var currKey = arguments[i];
    AdfAssert.assertString(currKey);
    i++;
    newObject[currKey] = arguments[i];
  }
  return newObject;
};
AdfObject._applyFunctionProperties = function(target, className) {
  var funcNameProperty = AdfAssert.FUNC_NAME_PROPERTY;
  var classNameProperty = AdfAssert.CLASS_NAME_PROPERTY;
  for (currPropName in target) {
    var currProp = target[currPropName];
    if (typeof currProp == "function") {
      if (!currProp.hasOwnProperty(funcNameProperty)) {
        currProp[funcNameProperty] = currPropName;
        currProp[classNameProperty] = className;
      }
    }
  }
};
AdfObject._initClasses = function(currClass) {
  if (AdfAssert.DEBUG) {
    AdfAssert.assertFunction(currClass);
    AdfAssert.assert(!currClass._initialized);
  }
  currClass._initialized = true;
  var superclass = currClass.superclass;
  if (superclass) {
    var superclassConstructor = superclass.constructor;
    if (superclassConstructor && !superclassConstructor._initialized) {
      AdfObject._initClasses(superclassConstructor);
    }
    AdfObject._applyRenamesToSubclass(currClass);
  }
  var typeName = AdfObject.getTypeName(currClass);
  try {
    var InitClassFunc = currClass.InitClass;
    if (!InitClassFunc) {
      InitClassFunc = currClass["InitClass"];
    }
    if (InitClassFunc) {
      var initializationState = currClass._classInitializationState;
      InitClassFunc.call(currClass, initializationState);
      if (initializationState !== undefined) {
        delete currClass._classInitializationState;
      }
    }
  } finally {
    if (AdfAssert.DEBUG) {
      AdfObject._applyFunctionProperties(currClass.prototype, typeName);
      AdfObject._applyFunctionProperties(currClass, "static " + typeName);
    }
  }
};
AdfObject._applyRenamesToSubclass = function(currClass) {
  if (!AdfObject._r2o) {
    return;
  }
  var ancestor = currClass.superclass;
  AdfObject._applyRenamesFromChain(currClass, ancestor, ancestor);
};
AdfObject._applyRenamesFromChain = function(currClass, superclass, immediateSuperclass) {
  if (!superclass) {
    return;
  }
  var ancestor = superclass.constructor;
  AdfObject._applyRenamesFromChain(currClass, ancestor.superclass, immediateSuperclass);
  var renameMap = ancestor._r2o;
  if (renameMap) {
    for (var alias in renameMap) {
      var orig = renameMap[alias];
      if (alias != orig) {
        var prot = currClass.prototype;
        if (!AdfObject._isPrototypePropertyLocallySet(prot, immediateSuperclass, alias) && AdfObject._isPrototypePropertyLocallySet(prot, immediateSuperclass, orig)) {
          prot[alias] = prot[orig];
        } else {
          if (!AdfObject._isPrototypePropertyLocallySet(prot, immediateSuperclass, orig) && AdfObject._isPrototypePropertyLocallySet(prot, immediateSuperclass, alias)) {
            prot[orig] = prot[alias];
          }
        }
      }
    }
  }
};
AdfObject._isPrototypePropertyLocallySet = function(currClassPrototype, superclassPrototype, prop) {
  return currClassPrototype[prop] && !(currClassPrototype[prop] === superclassPrototype[prop]);
};
