public final class Named extends Object implements TypeTemplate
Modifier and Type | Class and Description |
---|---|
static class |
Named.NamedType<A> |
Constructor and Description |
---|
Named(String name,
TypeTemplate element) |
Modifier and Type | Method and Description |
---|---|
TypeFamily |
apply(TypeFamily family) |
<A,B> FamilyOptic<A,B> |
applyO(FamilyOptic<A,B> input,
Type<A> aType,
Type<B> bType) |
boolean |
equals(Object obj) |
<FT,FR> (TypeTemplate|Type.FieldNotFoundException) |
findFieldOrType(int index,
String name,
Type<FT> type,
Type<FR> resultType)
returned optic will accept
template<family<index>> with the input template, and will return the same with the returned template. |
int |
hashCode() |
(int) -> RewriteResult<?,?> |
hmap(TypeFamily family,
(int) -> RewriteResult<?,?> function)
constraint: family, argFamily and resFamily are matched.
|
int |
size() |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
toSimpleType
public Named(String name, TypeTemplate element)
public int size()
size
in interface TypeTemplate
public TypeFamily apply(TypeFamily family)
apply
in interface TypeTemplate
public <A,B> FamilyOptic<A,B> applyO(FamilyOptic<A,B> input, Type<A> aType, Type<B> bType)
applyO
in interface TypeTemplate
public <FT,FR> (TypeTemplate|Type.FieldNotFoundException) findFieldOrType(int index, @Nullable String name, Type<FT> type, Type<FR> resultType)
TypeTemplate
template<family<index>>
with the input template, and will return the same with the returned template.
(template, optic) = Left(result)
this.apply(family).apply(index) == optic.sType
template.apply(family).apply(index) == optic.tType
findFieldOrType
in interface TypeTemplate
public (int) -> RewriteResult<?,?> hmap(TypeFamily family, (int) -> RewriteResult<?,?> function)
TypeTemplate
result.function(i) :: this.apply(function.argFamily()).apply(i) -> this.apply(function.resFamily()).apply(i)
hmap
in interface TypeTemplate