Package hydra.typing
Class TermSignature
- java.lang.Object
-
- hydra.typing.TermSignature
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<TermSignature>
public class TermSignature extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<TermSignature>
A structured signature for a term: an ordered list of type parameters (with optional class constraints), an ordered list of value parameters, and a result. TermSignature is a richer view of TypeScheme: every TermSignature can be converted to a TypeScheme by erasing parameter names, descriptions, and laziness flags.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description java.util.List<Parameter>parametersThe value parameters of the term, in orderstatic NamePARAMETERSName of thehydra.typing.TermSignature.parametersfield.ResultresultThe result of the termstatic NameRESULTName of thehydra.typing.TermSignature.resultfield.static NameTYPE_Name of thehydra.typing.TermSignaturetype.static NameTYPE_PARAMETERSName of thehydra.typing.TermSignature.typeParametersfield.java.util.List<TypeParameter>typeParametersThe type parameters of the term, in order
-
Constructor Summary
Constructors Constructor Description TermSignature(java.util.List<TypeParameter> typeParameters, java.util.List<Parameter> parameters, Result result)Constructs an immutableTermSignature.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(TermSignature other)booleanequals(java.lang.Object other)inthashCode()TermSignaturewithParameters(java.util.List<Parameter> parameters)Returns a copy of thisTermSignaturewithparametersreplaced.TermSignaturewithResult(Result result)Returns a copy of thisTermSignaturewithresultreplaced.TermSignaturewithTypeParameters(java.util.List<TypeParameter> typeParameters)Returns a copy of thisTermSignaturewithtypeParametersreplaced.
-
-
-
Field Detail
-
TYPE_
public static final Name TYPE_
Name of thehydra.typing.TermSignaturetype.
-
TYPE_PARAMETERS
public static final Name TYPE_PARAMETERS
Name of thehydra.typing.TermSignature.typeParametersfield.
-
PARAMETERS
public static final Name PARAMETERS
Name of thehydra.typing.TermSignature.parametersfield.
-
RESULT
public static final Name RESULT
Name of thehydra.typing.TermSignature.resultfield.
-
typeParameters
public final java.util.List<TypeParameter> typeParameters
The type parameters of the term, in order
-
parameters
public final java.util.List<Parameter> parameters
The value parameters of the term, in order
-
result
public final Result result
The result of the term
-
-
Constructor Detail
-
TermSignature
public TermSignature(java.util.List<TypeParameter> typeParameters, java.util.List<Parameter> parameters, Result result)
Constructs an immutableTermSignature.- Parameters:
typeParameters- The type parameters of the term, in orderparameters- The value parameters of the term, in orderresult- The result of the term
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
compareTo
public int compareTo(TermSignature other)
- Specified by:
compareToin interfacejava.lang.Comparable<TermSignature>
-
withTypeParameters
public TermSignature withTypeParameters(java.util.List<TypeParameter> typeParameters)
Returns a copy of thisTermSignaturewithtypeParametersreplaced.
-
withParameters
public TermSignature withParameters(java.util.List<Parameter> parameters)
Returns a copy of thisTermSignaturewithparametersreplaced.
-
withResult
public TermSignature withResult(Result result)
Returns a copy of thisTermSignaturewithresultreplaced.
-
-