Skip to content

LoopTranslation

Tom Ball edited this page Feb 5, 2014 · 3 revisions

com.google.j2objc.annotations

Annotation Type LoopTranslation

@Target(ElementType.LOCAL_VARIABLE)
@Retention(RetentionPolicy.SOURCE)
public @interface LoopTranslation {

  /**
   * Enumerates the available translation options for enhanced for loops.
   * FAST_ENUMERATION is the default style emitted by the translator.
   */
  enum LoopStyle {
    /*
     * for (id var in expr) {
     *   ...
     * }
     */
    JAVA_ITERATOR,

    /*
     * id<JavaUtilIterator> iter__ = [expr iterator];
     * while ([iter__ hasNext]) {
     *   id var = [iter__ next];
     *   ...
     * }
     */
    FAST_ENUMERATION
  }

  LoopStyle value();

Annotation that specifies how an enhanced for loop should be translated by the J2ObjC translator.

We've Moved!

The J2ObjC wiki has moved to j2objc.org.

Clone this wiki locally