All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gw.lang.enhancements.CoreIterableOfIterablesEnhancement.gsx Maven / Gradle / Ivy

There is a newer version: 1.18.2
Show newest version
package gw.lang.enhancements
uses java.lang.Iterable
uses java.util.Iterator

/*
 *  Copyright 2014 Guidewire Software, Inc.
 */
enhancement CoreIterableOfIterablesEnhancement> : Iterable {
  reified function flatten() : Iterable {
    var outerIterable = this
    return new Iterable() {
      override function iterator() : Iterator {
        return outerIterable.map(\ t -> t.iterator()).iterator().flatten()
      }
    }
  }  
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy