public abstract class Phrasebook<O,S> extends Object
Modifier and Type | Class and Description |
---|---|
protected class |
Phrasebook.FieldMap<T> |
Modifier and Type | Field and Description |
---|---|
static String |
cd
The OpenMath content dictionary name of UMod
|
static String |
cdUri
The OpenMath content dictionary URI of UMod
|
protected Function<O,Boolean> |
decode_bool |
protected Function<O,Integer> |
decode_int |
protected Function<O,String> |
decode_string |
protected <any> |
decoder |
protected Function<Boolean,O> |
encode_bool |
protected Function<Integer,O> |
encode_int |
protected Function<String,O> |
encode_string |
protected <any> |
encoder |
protected S |
symbol_false |
protected S |
symbol_LEFT |
protected S |
symbol_MAP |
protected S |
symbol_NODE |
protected S |
symbol_null |
protected S |
symbol_PAIR |
protected S |
symbol_RIGHT |
protected S |
symbol_SEQ |
protected S |
symbol_SET |
protected S |
symbol_true |
protected S |
symbol_UP |
Modifier | Constructor and Description |
---|---|
protected |
Phrasebook(<any> encoder,
<any> decoder) |
Modifier and Type | Method and Description |
---|---|
protected <T> Function<List<T>,CheckedList<T>> |
consCheckedList() |
protected <T> Function<List<T>,CheckedList<T>> |
consCheckedList(CheckedList.implementations i) |
protected <K,V> Function<Map<K,V>,CheckedMap_D<K,V>> |
consCheckedMap_D() |
protected <K,V> Function<Map<K,V>,CheckedMap_R<K,V>> |
consCheckedMap_R() |
protected <K,V> Function<Map<K,V>,CheckedMap_RD<K,V>> |
consCheckedMap_RD() |
protected <T> Function<Set<T>,CheckedSet<T>> |
consCheckedSet() |
protected <T> Function<List<T>,List<T>> |
consList() |
protected <K,V> Function<Map<K,V>,Map<K,V>> |
consMap() |
protected <T,U> BiFunction<T,U,Pair_checkedLeft<T,U>> |
consPair_checkedLeft() |
protected <T,U> BiFunction<T,U,Pair_checkedRight<T,U>> |
consPair_checkedRight() |
protected <T,U> BiFunction<T,U,Pair<T,U>> |
consPair() |
protected <T> Function<Set<T>,Set<T>> |
consSet() |
protected <U> Function<O,CheckedList<U>> |
decode_CheckedList(Function<? super O,? extends U> f) |
protected <K,V> Function<O,CheckedMap_D<K,V>> |
decode_CheckedMap_D(Function<? super O,? extends K> fkey,
Function<? super O,? extends V> fval) |
protected <K,V> Function<O,CheckedMap_R<K,V>> |
decode_CheckedMap_R(Function<? super O,? extends K> fkey,
Function<? super O,? extends V> fval) |
protected <K,V> Function<O,CheckedMap_RD<K,V>> |
decode_CheckedMap_RD(Function<? super O,? extends K> fkey,
Function<? super O,? extends V> fval) |
protected <U> Function<O,CheckedSet<U>> |
decode_CheckedSet(Function<? super O,? extends U> f) |
protected <T,U,V> Function<O,T> |
decode_CoPair(Function<? super O,? extends U> f1,
Function<? super O,? extends V> f2,
Function<U,T> consLeft,
Function<V,T> consRight) |
protected <U> Function<O,List<U>> |
decode_List(Function<? super O,? extends U> f) |
protected <T> Function<O,T> |
decode_OPT(Function<? super O,? extends T> f) |
protected <T,U,V> Function<O,T> |
decode_Pair(Function<? super O,? extends U> f1,
Function<? super O,? extends V> f2,
BiFunction<U,V,T> cons) |
protected <U> Function<O,Set<U>> |
decode_Set(Function<? super O,? extends U> f) |
protected <T> T |
decodeFields(List<? extends O> fields,
T init,
Map<String,? extends Consumer<? super O,? super T>> fs) |
protected <T> T |
decodeFields(List<? extends O> fields,
T init,
Phrasebook.FieldMap<T> map) |
protected <T,U> Function<CoPair<T,U>,O> |
encode_CoPair(Function<? super T,? extends O> f1,
Function<? super U,? extends O> f2) |
protected <K,V> Function<Map<K,V>,O> |
encode_MAP(Function<? super K,? extends O> fkey,
Function<? super V,? extends O> fval) |
protected <T> Function<T,O> |
encode_OPT(Function<? super T,? extends O> f) |
protected <T,U> Function<Pair<T,U>,O> |
encode_Pair(Function<? super T,? extends O> f1,
Function<? super U,? extends O> f2) |
protected <T> Function<List<T>,O> |
encode_SEQ(Function<? super T,? extends O> f) |
protected <T> Function<Set<T>,O> |
encode_SET(Function<? super T,? extends O> f) |
protected <T,U> Consumer<T,List<O>> |
encodeField(String name,
Function<? super T,? extends U> get,
Function<? super U,O> encode) |
protected <T> O |
encodeNode(T node,
String name,
int size,
Consumer<T,? super List<O>> fieldsEncoder)
Encodes a node.
|
protected List<O> |
matchNode(O node,
String name) |
protected boolean |
matchSymbol(O term,
S symbol) |
protected List<O> |
matchTerm(O term,
S constructor) |
protected O |
pair(O arg1,
O arg2) |
public static final String cd
public static final String cdUri
protected final <any> encoder
protected final <any> decoder
protected final S symbol_NODE
protected final S symbol_SEQ
protected final S symbol_SET
protected final S symbol_MAP
protected final S symbol_PAIR
protected final S symbol_LEFT
protected final S symbol_RIGHT
protected final S symbol_UP
protected final S symbol_null
protected final S symbol_true
protected final S symbol_false
protected <T> O encodeNode(T node, String name, int size, Consumer<T,? super List<O>> fieldsEncoder)
node
- the nodename
- the model class name of the nodesize
- an estimate of the number of fields. Only used as an
initial capacity for the collecting ArrayList
.fieldsEncoder
- a consumer that adds fields encodings to a
given listprotected <T,U> Consumer<T,List<O>> encodeField(String name, Function<? super T,? extends U> get, Function<? super U,O> encode)
protected <T> T decodeFields(List<? extends O> fields, T init, Phrasebook.FieldMap<T> map)
protected <T> T decodeFields(List<? extends O> fields, T init, Map<String,? extends Consumer<? super O,? super T>> fs)
protected <K,V> Function<Map<K,V>,O> encode_MAP(Function<? super K,? extends O> fkey, Function<? super V,? extends O> fval)
protected <T,U> Function<Pair<T,U>,O> encode_Pair(Function<? super T,? extends O> f1, Function<? super U,? extends O> f2)
protected <T,U> Function<CoPair<T,U>,O> encode_CoPair(Function<? super T,? extends O> f1, Function<? super U,? extends O> f2)
protected <U> Function<O,CheckedList<U>> decode_CheckedList(Function<? super O,? extends U> f)
protected <U> Function<O,CheckedSet<U>> decode_CheckedSet(Function<? super O,? extends U> f)
protected <K,V> Function<O,CheckedMap_D<K,V>> decode_CheckedMap_D(Function<? super O,? extends K> fkey, Function<? super O,? extends V> fval)
protected <K,V> Function<O,CheckedMap_R<K,V>> decode_CheckedMap_R(Function<? super O,? extends K> fkey, Function<? super O,? extends V> fval)
protected <K,V> Function<O,CheckedMap_RD<K,V>> decode_CheckedMap_RD(Function<? super O,? extends K> fkey, Function<? super O,? extends V> fval)
protected <T,U,V> Function<O,T> decode_Pair(Function<? super O,? extends U> f1, Function<? super O,? extends V> f2, BiFunction<U,V,T> cons)
protected <T,U,V> Function<O,T> decode_CoPair(Function<? super O,? extends U> f1, Function<? super O,? extends V> f2, Function<U,T> consLeft, Function<V,T> consRight)
protected <T> Function<List<T>,CheckedList<T>> consCheckedList()
protected <T> Function<List<T>,CheckedList<T>> consCheckedList(CheckedList.implementations i)
protected <T> Function<Set<T>,CheckedSet<T>> consCheckedSet()
protected <K,V> Function<Map<K,V>,CheckedMap_D<K,V>> consCheckedMap_D()
protected <K,V> Function<Map<K,V>,CheckedMap_R<K,V>> consCheckedMap_R()
protected <K,V> Function<Map<K,V>,CheckedMap_RD<K,V>> consCheckedMap_RD()
protected <T,U> BiFunction<T,U,Pair<T,U>> consPair()
protected <T,U> BiFunction<T,U,Pair_checkedLeft<T,U>> consPair_checkedLeft()
protected <T,U> BiFunction<T,U,Pair_checkedRight<T,U>> consPair_checkedRight()
see also the complete user documentation .