Class NativeIterator

All Implemented Interfaces:
Serializable, ConstProperties, DebuggableObject, IdFunctionCall, Scriptable, SymbolScriptable

public final class NativeIterator extends IdScriptableObject
This class implements iterator objects. See http://developer.mozilla.org/en/docs/New_in_JavaScript_1.7#Iterators
See Also:
  • Field Details

  • Constructor Details

    • NativeIterator

      private NativeIterator()
      Only for constructing the prototype object.
    • NativeIterator

      private NativeIterator(Object objectIterator)
  • Method Details

    • init

      static void init(Context cx, ScriptableObject scope, boolean sealed)
    • getStopIterationObject

      public static Object getStopIterationObject(Scriptable scope)
      Get the value of the "StopIteration" object. Note that this value is stored in the top-level scope using "associateValue" so the value can still be found even if a script overwrites or deletes the global "StopIteration" property.
      Parameters:
      scope - a scope whose parent chain reaches a top-level scope
      Returns:
      the StopIteration object
    • getClassName

      public String getClassName()
      Description copied from class: ScriptableObject
      Return the name of the class.

      This is typically the same name as the constructor. Classes extending ScriptableObject must implement this abstract method.

      Specified by:
      getClassName in interface Scriptable
      Specified by:
      getClassName in class ScriptableObject
    • initPrototypeId

      protected void initPrototypeId(int id)
      Overrides:
      initPrototypeId in class IdScriptableObject
    • execIdCall

      public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, Object[] args)
      Description copied from class: IdScriptableObject
      'thisObj' will be null if invoked as constructor, in which case * instance of Scriptable should be returned.
      Specified by:
      execIdCall in interface IdFunctionCall
      Overrides:
      execIdCall in class IdScriptableObject
    • jsConstructor

      private static Object jsConstructor(Context cx, Scriptable scope, Scriptable thisObj, Object[] args)
    • next

      private Object next(Context cx, Scriptable scope)
    • getJavaIterator

      private static Iterator<?> getJavaIterator(Object obj)
      If "obj" is a java.util.Iterator or a java.lang.Iterable, return a wrapping as a JavaScript Iterator. Otherwise, return null. This method is in VMBridge since Iterable is a JDK 1.5 addition.
    • findPrototypeId

      protected int findPrototypeId(String s)
      Overrides:
      findPrototypeId in class IdScriptableObject