Adaptor
Definitions
def
comparator
[a]
(
_ :
Proxy[a]
)
: Comparator
\ IO
with
Order[a]
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
fromIterator
[ra]
(
rc :
Region[r]
_ :
Proxy[a]
iter :
Iterator
)
: Iterator[a, r, r]
\ Pure
Returns a fresh Flix Iterator
from the Java iterator iter
.
def
fromList
[a]
(
l :
List
)
: List[a]
\ Pure
Returns all elements in the given Java List as a Flix List.
def
fromMap
[kv]
(
m :
Map
)
: Map[k, v]
\ Pure
with
Order[k]
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
fromSet
[a]
(
l :
Set
)
: Set[a]
\ Pure
with
Order[a]
Returns all elements in the given Java Set as a Flix Set.
WARNING: The Flix Set will use the ordering defined on a
.
def
toArrayList
[ma]
(
ma :
m[a]
)
: ArrayList
\ IO
with
Foldable[m]
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]
(
ma :
m[a]
)
: LinkedList
\ IO
with
Foldable[m]
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]
(
ma :
m[a]
)
: List
\ IO
with
Foldable[m]
Alias for toArrayList
.
def
toMap
[kv]
(
m :
Map[k, v]
)
: Map
\ IO
with
Order[k]
Alias for toTreeMap
.
def
toSet
[ma]
(
ma :
m[a]
)
: Set
\ IO
with
Order[a]
Foldable[m]
Alias for toTreeSet
.
def
toTreeMap
[kv]
(
m :
Map[k, v]
)
: TreeMap
\ IO
with
Order[k]
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]
(
ma :
m[a]
)
: TreeSet
\ IO
with
Order[a]
Foldable[m]
Returns the elements of the given foldable ma
as a new TreeSet
.