Adaptor

Definitions

def comparator(_: Proxy[a]): java.util.Comparator \ IO with Order[a] Source

Returns a comparator for elements of type a.

The comparator is backed by the ordering on a.

Note: Currently requires a Proxy (until Java types support generics).

def fromCollectionToIterator(rc: Region[r], proxy: Proxy[a], col: java.util.Collection): Iterator[a, r, r] \ r Source

Returns a Flix Iterator of the elements in the given Java Collection.

def fromIterator(rc: Region[r], _: Proxy[a], iter: java.util.Iterator): Iterator[a, r, r] Source

Returns a fresh Flix Iterator from the Java iterator iter.

def fromList(l: java.util.List): List[a] Source

Returns all elements in the given Java List as a Flix List.

def fromListToIterator(rc: Region[r], prx: Proxy[a], l: java.util.List): Iterator[a, r, r] \ r Source

Returns a Flix Iterator of the elements in the given Java List.

def fromMap(m: java.util.Map): Map[k, v] with Order[k] Source

Returns all key-value pairs in the given Java Map as a Flix Map.

WARNING: The Flix Map will use the ordering defined on k.

def fromMapEntry(_: Proxy[k], _: Proxy[v], e: java.util.Map$Entry): (k, v) Source

Returns the given Java Map.Entry as a Flix tuple.

def fromMapToIterator(rc: Region[r], m: java.util.Map): Iterator[(k, v), r, r] \ r Source

Returns a Flix Iterator of the key-value pairs in the given Java Map.

def fromOptional(_: Proxy[a], o: java.util.Optional): Option[a] Source

Returns the given Java Optional as a Flix Option.

def fromSet(l: java.util.Set): Set[a] with Order[a] Source

Returns all elements in the given Java Set as a Flix Set.

WARNING: The Flix Set will use the ordering defined on a.

def fromSetToIterator(rc: Region[r], prx: Proxy[a], s: java.util.Set): Iterator[a, r, r] \ r Source

Returns a Flix Iterator of the elements in the given Java Set.

def fromStreamToIterator(rc: Region[r], proxy: Proxy[a], strm: java.util.stream.Stream): Iterator[a, r, r] \ r Source

Returns a Flix Iterator of the elements in the given Java Stream.

def toArrayList(ma: m[a]): java.util.ArrayList \ IO + Aef[m] with Foldable[m] Source

Returns the elements of the given foldable ma as a new Java ArrayList.

Creates a fresh ArrayList and copies all elements in ma into it.

def toLinkedList(ma: m[a]): java.util.LinkedList \ IO + Aef[m] with Foldable[m] Source

Returns the elements of the given foldable ma as a new Java LinkedList.

Creates a fresh LinkedList and copies all elements in ma into it.

def toList(ma: m[a]): java.util.List \ IO + Aef[m] with Foldable[m] Source

Alias for toArrayList.

def toMap(m: Map[k, v]): java.util.Map \ IO with Order[k] Source

Alias for toTreeMap.

def toMapEntry(p: (k, v)): java.util.Map$Entry \ IO Source

Returns the key-value pair p as a new Java Map.Entry.

def toOptional(o: Option[a]): java.util.Optional \ IO Source

Returns the o as a new Java Optional.

def toSet(ma: m[a]): java.util.Set \ IO + Aef[m] with Order[a], Foldable[m] Source

Alias for toTreeSet.

def toTreeMap(m: Map[k, v]): java.util.TreeMap \ IO with Order[k] Source

Returns all key-value pairs of the given map m as a new TreeMap.

The TreeMap uses a Comparator constructed from the Order on k.

def toTreeSet(ma: m[a]): java.util.TreeSet \ IO + Aef[m] with Order[a], Foldable[m] Source

Returns the elements of the given foldable ma as a new TreeSet.