Package daikon.derive.ternary
Class TernaryDerivationFactory
- Object
-
- TernaryDerivationFactory
-
- All Implemented Interfaces:
DerivationFactory
- Direct Known Subclasses:
SequenceFloatArbitrarySubsequenceFactory
,SequenceScalarArbitrarySubsequenceFactory
,SequenceStringArbitrarySubsequenceFactory
public abstract class TernaryDerivationFactory extends Object implements DerivationFactory
Factory to produce TernaryDerivations.
-
-
Constructor Summary
Constructors Constructor Description TernaryDerivationFactory()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static boolean
checkComparability(VarInfo vi1, VarInfo vi2)
Checks if two base variables are comparable to each other.static boolean
checkType(VarInfo vi1, VarInfo vi2)
Check if vi1 and vi2 can be a part of a VarInfo triple based on their types.abstract TernaryDerivation @Nullable []
instantiate(VarInfo vi1, VarInfo vi2, VarInfo vi3)
Create a set of derivations from three base variables.static @Nullable ProglangType
returnType(VarInfo vi1, VarInfo vi2)
Check if vi1 and vi2 can be a part of a VarInfo triple based on their types.
-
-
-
Constructor Detail
-
TernaryDerivationFactory
public TernaryDerivationFactory()
-
-
Method Detail
-
instantiate
public abstract TernaryDerivation @Nullable [] instantiate(VarInfo vi1, VarInfo vi2, VarInfo vi3)
Create a set of derivations from three base variables. If the base variables aren't worth deriving from, returns null.- Parameters:
vi1
- the first of the three base variablesvi2
- the second of the three base variablesvi3
- the third of the three base variables- Returns:
- a set of derivations based on three base variables. We allow more than one because the base variables may have multiple derived variables, per type of derivation. Can also be null if the variables have nothing to derive from.
-
checkType
public static boolean checkType(VarInfo vi1, VarInfo vi2)
Check if vi1 and vi2 can be a part of a VarInfo triple based on their types.- Returns:
- true if vi1 and vi2 can belong to a valid VarInfo triple; false otherwise
-
returnType
public static @Nullable ProglangType returnType(VarInfo vi1, VarInfo vi2)
Check if vi1 and vi2 can be a part of a VarInfo triple based on their types.- Returns:
- a ProglangType which is the type of VarInfo needed to make a valid VarInfo triple out of vi1 and vi2 (null otherwise)
-
checkComparability
public static boolean checkComparability(VarInfo vi1, VarInfo vi2)
Checks if two base variables are comparable to each other.- Returns:
- true if vi1 and vi2 are comparable; false otherwise
-
-