AI2 Component  (Version nb184)
com.google.appinventor.components.runtime.util.YailObject< T > Interface Template Reference
Inheritance diagram for com.google.appinventor.components.runtime.util.YailObject< T >:
com.google.appinventor.components.runtime.util.YailList

Public Member Functions

Object getObject (int index)
 
int size ()
 
boolean isEmpty ()
 
Iterator< T > iterator ()
 

Detailed Description

YailObject is a marker interface for data types defined by YAIL. Currently, that is YailList and YailDictionary. Any new non-primitive data types should also implement YailObject.

Author
ewpat.nosp@m.ton@.nosp@m.mit.e.nosp@m.du (Evan W. Patton)

Definition at line 19 of file YailObject.java.

Member Function Documentation

◆ getObject()

Object com.google.appinventor.components.runtime.util.YailObject< T >.getObject ( int  index)

Get the object at the given index. The index is 0-based.

Parameters
indexThe index of the object to retrieve.
Returns
An object dependent on the implementation. The returned object should be coercible to another YAIL type.
Exceptions
IndexOutOfBoundsExceptionif the index is less than zero or greater than or equal to the size() of the object.

Implemented in com.google.appinventor.components.runtime.util.YailList.

◆ isEmpty()

Test whether the object is empty.

Returns
True if the object is empty, otherwise false.

◆ iterator()

Returns an iterator over the elements in the YailObject. For YailList this may be any other YAIL type and for YailDictionary this is always YailList.

◆ size()

Get the size of the object. The exact semantics depend on the object, but typically this should be the number of elements in the object. For lists, it is the length of the list and for dictionaries it is the size of the dictionary (number of pairs). Ideally this method should be constant time.

Returns
The size of the object.

Implemented in com.google.appinventor.components.runtime.util.YailList.


The documentation for this interface was generated from the following file: