| Package | Description |
|---|---|
| org.osgl | |
| org.osgl.util |
| Modifier and Type | Class and Description |
|---|---|
static class |
Osgl.Comparator<T>
Adapt JDK Comparator (since 1.2) to Functional programming.
|
static class |
Osgl.F2<P1,P2,R>
Base implementation of
Osgl.Func2 function. |
static class |
Osgl.IndexedVisitor<K,T>
An
IndexedVisitor provide a tool to iterate through a Map or indexed list
by passing the key/index and the value to the function. |
static class |
Osgl.V2<P1,P2> |
| Modifier and Type | Method and Description |
|---|---|
C.List<T> |
Osgl.Var.acceptRight(Osgl.Func2<Integer,? super T,?> indexedVisitor) |
Osgl.F2<P1,P2,R> |
Osgl.F2.andThen(Osgl.Func2<? super P1,? super P2,? extends R>... fs)
Returns a composed function that applied, in sequence, this function and
all functions specified one by one.
|
static <T1,T2> Osgl.F2<T1,T2,Void> |
Osgl.F.breakIf(Osgl.Func2<? super T1,? super T2,Boolean> predicate)
Return a two variables function that throw out a
Osgl.Break when a two variables predicate return
true on an element been tested. |
static <P,T1,T2> Osgl.F2<T1,T2,Void> |
Osgl.F.breakIf(Osgl.Func2<? super T1,? super T2,Boolean> predicate,
P payload)
Return a two variables function that throw out a
Osgl.Break with payload specified when
a two variables predicate return true on an element been tested |
static <T> Osgl.Comparator<T> |
Osgl.comparator(Osgl.Func2<? super T,? super T,Integer> f)
Adapt a general
Osgl.Func2 function with (T, T, Integer) type into Comparator |
<X1,X2> Osgl.F2<X1,X2,R> |
Osgl.F1.compose(Osgl.Func2<? super X1,? super X2,? extends P1> before)
Returns an
F2<X1, X2, R>> function by composing the specified
Func2<X1, X2, P1> function with this function applied last |
static <P1,P2,R> Osgl.F2<P1,P2,R> |
Osgl.f2(Osgl.Func2<? super P1,? super P2,? extends R> f2)
Convert a general
Osgl.Func2 function into a Osgl.F2 typed
function |
protected void |
Osgl.Var.forEachLeft(Osgl.Func2<Integer,? super T,?> indexedVisitor) |
protected void |
Osgl.Var.forEachRight(Osgl.Func2<Integer,? super T,?> indexedVisitor) |
static <T> Osgl.F2<T,T,Boolean> |
Osgl.F.greaterThan(Osgl.Func2<? super T,? super T,Integer> c)
Alias of
Osgl.F.gt(java.util.Comparator) |
static <T> Osgl.F2<T,T,Boolean> |
Osgl.F.greaterThanOrEqualsTo(Osgl.Func2<? super T,? super T,Integer> c)
Alias of
Osgl.F.gte(java.util.Comparator) |
static <T> Osgl.F2<T,T,Boolean> |
Osgl.F.gt(Osgl.Func2<? super T,? super T,Integer> c)
Returns a function that check if a value is less than another one using the
Comparator specified |
static <T> Osgl.F2<T,T,Boolean> |
Osgl.F.gte(Osgl.Func2<? super T,? super T,Integer> c)
Returns a function that check if a value is greater than or equals to another one
using the
Comparator specified |
static <T> Osgl.F2<T,T,Boolean> |
Osgl.F.lessThan(Osgl.Func2<? super T,? super T,Integer> c)
Alias of
Osgl.F.lt(java.util.Comparator) |
static <T> Osgl.F2<T,T,Boolean> |
Osgl.F.lessThanOrEqualsTo(Osgl.Func2<? super T,? super T,Integer> c)
Alias of
Osgl.F.lte(java.util.Comparator) |
static <T> Osgl.F2<T,T,Boolean> |
Osgl.F.lt(Osgl.Func2<? super T,? super T,Integer> c)
Returns a function that check if a value is less than another one using the
Comparator specified |
static <T> Osgl.F2<T,T,Boolean> |
Osgl.F.lte(Osgl.Func2<? super T,? super T,Integer> c)
Returns a function that check if a value is less than or equals to another one
using the
Comparator specified |
static <P1,P2> Osgl.F2<P1,P2,Boolean> |
Osgl.F.negate(Osgl.Func2<? super P1,? super P2,Boolean> predicate)
Returns a negate function of the specified predicate that applied to 2 parameters and returns boolean value
|
Osgl.F2<P1,P2,R> |
Osgl.F2.orElse(Osgl.Func2<? super P1,? super P2,? extends R> fallback)
Returns a composed function that when applied, try to apply this function first, in case
a
NotAppliedException is captured apply to the fallback function specified. |
Osgl.Option<T> |
Osgl.Var.reduce(Osgl.Func2<T,T,T> accumulator) |
<R> R |
Osgl.Var.reduce(R identity,
Osgl.Func2<R,T,R> accumulator) |
Osgl.Option<T> |
Osgl.Var.reduceLeft(Osgl.Func2<T,T,T> accumulator) |
<R> R |
Osgl.Var.reduceLeft(R identity,
Osgl.Func2<R,T,R> accumulator) |
Osgl.Option<T> |
Osgl.Var.reduceRight(Osgl.Func2<T,T,T> accumulator) |
<R> R |
Osgl.Var.reduceRight(R identity,
Osgl.Func2<R,T,R> accumulator) |
Osgl.F1<T,Osgl.Var<T>> |
Osgl.Var._f.updater(Osgl.Func2<T,T,T> changer) |
| Modifier and Type | Class and Description |
|---|---|
static class |
N.ByteRangeStep |
static class |
N.IntRangeStep |
static class |
N.LongRangeStep |
static class |
N.Op |
static class |
N.RangeStep<T extends Number> |
static class |
N.ShortRangeStep |
class |
SimpleStringValueResolver |
| Modifier and Type | Method and Description |
|---|---|
Osgl.Func2<ELEMENT,Integer,ELEMENT> |
C.Range.step()
Returns a
$.Func2 function that applied to an element in this Range and
an integer n indicate the number of steps. |
Osgl.Func2<ELEMENT,Integer,ELEMENT> |
LazyRange.step() |
| Modifier and Type | Method and Description |
|---|---|
C.Map<K,V> |
C.Map.accept(Osgl.Func2<? super K,? super V,?> indexedVisitor)
Alias of
C.Map.forEach(Osgl.Func2) |
C.List<T> |
C.List.accept(Osgl.Func2<Integer,? super T,?> indexedVisitor)
Loop through the list and for each element, call on the
indexedVisitor function specified
|
C.List<T> |
ListBase.accept(Osgl.Func2<Integer,? super T,?> indexedVisitor) |
C.List<T> |
C.List.acceptLeft(Osgl.Func2<Integer,? super T,?> indexedVisitor)
Loop through the list from
0 to size - 1. |
C.List<T> |
ListBase.acceptLeft(Osgl.Func2<Integer,? super T,?> indexedVisitor) |
C.List<T> |
C.List.acceptRight(Osgl.Func2<Integer,? super T,?> indexedVisitor)
Loop through the list from
size() - 1 to 0. |
C.List<T> |
ListBase.acceptRight(Osgl.Func2<Integer,? super T,?> indexedVisitor) |
C.Map<K,V> |
C.Map.each(Osgl.Func2<? super K,? super V,?> indexedVisitor)
Alias of
C.Map.forEach(Osgl.Func2) |
C.List<T> |
C.List.each(Osgl.Func2<Integer,? super T,?> indexedVisitor)
Alias of
C.List.accept(Osgl.Func2) |
C.List<T> |
ListBase.each(Osgl.Func2<Integer,? super T,?> indexedVisitor) |
static <K,V> void |
C.forEach(Map<K,V> map,
Osgl.Func2<? super K,? super V,?> indexedVisitor)
Run indexedVisitor function on all key/value pair in a given map.
|
C.Map<K,V> |
C.Map.forEach(Osgl.Func2<? super K,? super V,?> indexedVisitor)
Loop through this map on each key/value pair, apply them to the function specified
|
C.List<T> |
C.List.forEach(Osgl.Func2<Integer,? super T,?> indexedVisitor)
Alias of
C.List.accept(Osgl.Func2) |
C.List<T> |
ListBase.forEach(Osgl.Func2<Integer,? super T,?> indexedVisitor) |
protected void |
ListBase.forEachLeft(Osgl.Func2<Integer,? super T,?> indexedVisitor) |
protected void |
ListBase.forEachRight(Osgl.Func2<Integer,? super T,?> indexedVisitor) |
Osgl.Option<T> |
C.Traversable.reduce(Osgl.Func2<T,T,T> accumulator)
Performs a reduction on the elements in this traversable, using provided accumulating
function.
|
Osgl.Option<T> |
C.Sequence.reduce(Osgl.Func2<T,T,T> accumulator)
Performs a reduction on the elements in this traversable, using provided accumulating
function.
|
Osgl.Option<T> |
ListBase.reduce(Osgl.Func2<T,T,T> accumulator) |
Osgl.Option<T> |
SetBase.reduce(Osgl.Func2<T,T,T> accumulator) |
Osgl.Option<T> |
TraversableBase.reduce(Osgl.Func2<T,T,T> accumulator)
Iterate through the traversal to apply the accumulator to
the result of previous application and the element being iterated.
|
<R> R |
C.Traversable.reduce(R identity,
Osgl.Func2<R,T,R> accumulator)
Performs a reduction on the elements in this traversable, using the provided
identity and accumulating function.
|
<R> R |
C.Sequence.reduce(R identity,
Osgl.Func2<R,T,R> accumulator)
Performs a reduction on the elements in this traversable, using the provided
identity and accumulating function.
|
<R> R |
ListBase.reduce(R identity,
Osgl.Func2<R,T,R> accumulator) |
<R> R |
SetBase.reduce(R identity,
Osgl.Func2<R,T,R> accumulator) |
<R> R |
TraversableBase.reduce(R identity,
Osgl.Func2<R,T,R> accumulator)
Iterate through the traversal to apply the accumulator to
the result of previous application and the element being
iterated.
|
Osgl.Option<T> |
C.Sequence.reduceLeft(Osgl.Func2<T,T,T> accumulator)
Run reduction from head to tail.
|
Osgl.Option<T> |
ListBase.reduceLeft(Osgl.Func2<T,T,T> accumulator) |
Osgl.Option<T> |
SequenceBase.reduceLeft(Osgl.Func2<T,T,T> accumulator)
Delegate to
TraversableBase.reduce(org.osgl.Osgl.Func2) |
<R> R |
C.Sequence.reduceLeft(R identity,
Osgl.Func2<R,T,R> accumulator)
Run reduction from header side.
|
<R> R |
ListBase.reduceLeft(R identity,
Osgl.Func2<R,T,R> accumulator) |
<R> R |
SequenceBase.reduceLeft(R identity,
Osgl.Func2<R,T,R> accumulator)
|
Osgl.Option<ELEMENT> |
C.Range.reduceRight(Osgl.Func2<ELEMENT,ELEMENT,ELEMENT> accumulator) |
Osgl.Option<ELEMENT> |
LazyRange.reduceRight(Osgl.Func2<ELEMENT,ELEMENT,ELEMENT> accumulator) |
Osgl.Option<T> |
C.ReversibleSequence.reduceRight(Osgl.Func2<T,T,T> accumulator)
Run reduction from tail to head.
|
Osgl.Option<T> |
ListBase.reduceRight(Osgl.Func2<T,T,T> accumulator) |
<R> R |
C.Range.reduceRight(R identity,
Osgl.Func2<R,ELEMENT,R> accumulator) |
<R> R |
LazyRange.reduceRight(R identity,
Osgl.Func2<R,ELEMENT,R> accumulator) |
<R> R |
C.ReversibleSequence.reduceRight(R identity,
Osgl.Func2<R,T,R> accumulator)
Run reduction from tail side.
|
<R> R |
ListBase.reduceRight(R identity,
Osgl.Func2<R,T,R> accumulator) |
void |
PropertyHandler.setStringValueResolver(Osgl.Func2<String,Class<?>,?> stringValueResolver) |
Copyright © 2017. All Rights Reserved.