Class BoundSet
java.lang.Object
com.github.javaparser.symbolsolver.resolution.typeinference.BoundSet
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interface
private class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate <T> Set
<T> private Set
<InferenceVariable> private Set
<Set<InferenceVariable>> allPossibleSetsWithProperty
(Set<InferenceVariable> allElements, List<BoundSet.VariableDependency> dependencies) private Set
<Set<InferenceVariable>> allSetsWithProperty
(Set<InferenceVariable> allElements, List<BoundSet.VariableDependency> dependencies) private boolean
appearInLeftPartOfCapture
(InferenceVariable inferenceVariable) private boolean
buildAllSubsetsOfSize
(Set<T> allElements, int desiredSize) boolean
deriveImpliedBounds
(TypeSolver typeSolver) static BoundSet
empty()
boolean
private Optional
<Pair<SameAsBound, SameAsBound>> findPairSameAs
(Predicate<Pair<SameAsBound, SameAsBound>> condition) private List
<Pair<ResolvedReferenceType, ResolvedReferenceType>> private <T> T
forEachPairSameAndSubtype
(BoundSet.Processor<SameAsBound, SubtypeOfBound, T> processor, T initialValue) private <T> T
forEachPairSameAs
(BoundSet.Processor<SameAsBound, SameAsBound, T> processor, T initialValue) private <T> T
forEachPairSubtypeAndSubtype
(BoundSet.Processor<SubtypeOfBound, SubtypeOfBound, T> processor, T initialValue) private Instantiation
getProperUpperBoundsFor
(InferenceVariable inferenceVariable) int
hashCode()
private boolean
private boolean
hasProperty
(Set<InferenceVariable> alphas, List<BoundSet.VariableDependency> dependencies) if αi depends on the resolution of a variable β, then either β has an instantiation or there is some j such that β = αjincorporate
(BoundSet otherBounds, TypeSolver typeSolver) Maintains a set of inference variable bounds, ensuring that these are consistent as new bounds are added.boolean
isEmpty()
private boolean
isTheFirstAProperSubsetOfTheSecond
(Set<InferenceVariable> subset, Set<InferenceVariable> originalSet) boolean
isTrue()
It is sometimes convenient to refer to an empty bound set with the symbol true; this is merely out of convenience, and the two are interchangeable.performResolution
(List<InferenceVariable> variablesToResolve, TypeSolver typeSolver) Examines the bounds on an inference variable and determines an instantiation that is compatible with those bounds.private boolean
properUpperBoundsAreAtMostExceptionThrowableAndObject
(InferenceVariable inferenceVariable) private Optional
<Set<InferenceVariable>> smallestSetWithProperty
(Set<InferenceVariable> uninstantiatedVariables, List<BoundSet.VariableDependency> dependencies) there exists no non-empty proper subset of { α1, ..., αn } with this property.private boolean
thereAreProperSubsets
(Set<InferenceVariable> aSet, Set<Set<InferenceVariable>> allPossibleSets) private boolean
thereIsSomeJSuchThatβequalAlphaJ
(Set<InferenceVariable> alphas, InferenceVariable beta) toString()
-
Field Details
-
JAVA_LANG_RUNTIME_EXCEPTION
-
EMPTY
-
bounds
-
-
Constructor Details
-
BoundSet
public BoundSet()
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
toString
-
isTrue
public boolean isTrue()It is sometimes convenient to refer to an empty bound set with the symbol true; this is merely out of convenience, and the two are interchangeable. -
empty
-
withBound
-
findPairSameAs
private Optional<Pair<SameAsBound,SameAsBound>> findPairSameAs(Predicate<Pair<SameAsBound, SameAsBound>> condition) -
isEmpty
public boolean isEmpty() -
forEachPairSameAs
private <T> T forEachPairSameAs(BoundSet.Processor<SameAsBound, SameAsBound, T> processor, T initialValue) -
forEachPairSameAndSubtype
private <T> T forEachPairSameAndSubtype(BoundSet.Processor<SameAsBound, SubtypeOfBound, T> processor, T initialValue) -
forEachPairSubtypeAndSubtype
private <T> T forEachPairSubtypeAndSubtype(BoundSet.Processor<SubtypeOfBound, SubtypeOfBound, T> processor, T initialValue) -
areSameTypeInference
-
findPairsOfCommonAncestors
private List<Pair<ResolvedReferenceType,ResolvedReferenceType>> findPairsOfCommonAncestors(ResolvedReferenceType r1, ResolvedReferenceType r2) -
incorporate
Maintains a set of inference variable bounds, ensuring that these are consistent as new bounds are added. Because the bounds on one variable can sometimes impact the possible choices for another variable, this process propagates bounds between such interdependent variables. -
deriveImpliedBounds
-
containsFalse
public boolean containsFalse() -
allInferenceVariables
-
hasInstantiationFor
-
getInstantiationFor
-
thereIsSomeJSuchThatβequalAlphaJ
private boolean thereIsSomeJSuchThatβequalAlphaJ(Set<InferenceVariable> alphas, InferenceVariable beta) -
buildAllSubsetsOfSize
-
allButOne
-
smallestSetWithProperty
private Optional<Set<InferenceVariable>> smallestSetWithProperty(Set<InferenceVariable> uninstantiatedVariables, List<BoundSet.VariableDependency> dependencies) there exists no non-empty proper subset of { α1, ..., αn } with this property. -
hasProperty
private boolean hasProperty(Set<InferenceVariable> alphas, List<BoundSet.VariableDependency> dependencies) if αi depends on the resolution of a variable β, then either β has an instantiation or there is some j such that β = αj- Returns:
-
performResolution
public Optional<InstantiationSet> performResolution(List<InferenceVariable> variablesToResolve, TypeSolver typeSolver) Examines the bounds on an inference variable and determines an instantiation that is compatible with those bounds. It also decides the order in which interdependent inference variables are to be resolved. -
allPossibleSetsWithProperty
private Set<Set<InferenceVariable>> allPossibleSetsWithProperty(Set<InferenceVariable> allElements, List<BoundSet.VariableDependency> dependencies) -
thereAreProperSubsets
private boolean thereAreProperSubsets(Set<InferenceVariable> aSet, Set<Set<InferenceVariable>> allPossibleSets) -
isTheFirstAProperSubsetOfTheSecond
private boolean isTheFirstAProperSubsetOfTheSecond(Set<InferenceVariable> subset, Set<InferenceVariable> originalSet) -
allSetsWithProperty
private Set<Set<InferenceVariable>> allSetsWithProperty(Set<InferenceVariable> allElements, List<BoundSet.VariableDependency> dependencies) -
properUpperBoundsAreAtMostExceptionThrowableAndObject
private boolean properUpperBoundsAreAtMostExceptionThrowableAndObject(InferenceVariable inferenceVariable) -
appearInLeftPartOfCapture
-
getProperUpperBoundsFor
-