/* --------------------------------------------------------- *
* __________ D E L T A S C R I P T *
* (_________() *
* / === / - A fast, dynamic scripting language *
* | == | - Version 4.13.11.0 *
* / === / - Developed by Adam R. Nelson *
* | = = | - 2011-2013 *
* / === / - Distributed under GNU LGPL v3 *
* (________() - http://github.com/ar-nelson/deltascript *
* *
* --------------------------------------------------------- */
package com.sector91.delta.script.objects;
import com.sector91.delta.script.objects.reflect.DS_JavaClass;
/**
* <p>Represents any object that can be used as a DeltaScript "identity" object.
* This interface exists only so that {@link DS_Scope.IdentityChain} objects do
* not need to implement {@link DS_Object}.</p>
*
* @author Adam R. Nelson
* @version 4.13.11.0
* @since 4.13.2.0
*/
interface Identity
{
/**
* <p>Checks if this object is of the "type" represented by {@code typeObj}.
* Typing in DeltaScript is the same for every object that is not a scope:
* an object is considered an instance of any {@link DS_JavaClass}
* representing a class {@code cls} for which this object is
* {@code instanceof cls}.</p>
*
* <p>For scopes, typing is more complex. If a scope was created by calling
* a function, then it is considered an instance of that function. Scopes
* are also considered an instance of themselves, their prototype (if any),
* any included scopes, and anything that any of these sub-objects are an
* instance of.</p>
*
* @param typeObj The object to check if this object is an "instance of."
* @return {@code true} if this object is considered an "instance of"
* {@code typeObj} by DeltaScript's typing rules, {@code false}
* otherwise.
* @since 4.13.1.1
*/
public boolean is(DS_Object typeObj);
}