public SameAsBound(ResolvedType s, ResolvedType t) { if (!isInferenceVariable(s) && !isInferenceVariable(t)) { throw new IllegalArgumentException("One of S or T should be an inference variable"); } this.s = s; this.t = t; }
public SubtypeOfBound(ResolvedType s, ResolvedType t) { if (!isInferenceVariable(s) && !isInferenceVariable(t)) { throw new IllegalArgumentException("One of S or T should be an inference variable"); } this.s = s; this.t = t; }
public SameAsBound(ResolvedType s, ResolvedType t) { if (!isInferenceVariable(s) && !isInferenceVariable(t)) { throw new IllegalArgumentException("One of S or T should be an inference variable"); } this.s = s; this.t = t; }
public SameAsBound(ResolvedType s, ResolvedType t) { if (!isInferenceVariable(s) && !isInferenceVariable(t)) { throw new IllegalArgumentException("One of S or T should be an inference variable"); } this.s = s; this.t = t; }
public SubtypeOfBound(ResolvedType s, ResolvedType t) { if (!isInferenceVariable(s) && !isInferenceVariable(t)) { throw new IllegalArgumentException("One of S or T should be an inference variable"); } this.s = s; this.t = t; }
public SubtypeOfBound(ResolvedType s, ResolvedType t) { if (!isInferenceVariable(s) && !isInferenceVariable(t)) { throw new IllegalArgumentException("One of S or T should be an inference variable"); } this.s = s; this.t = t; }
private boolean areSameTypeInference(ResolvedType a, ResolvedType b) { return isInferenceVariable(a) && isInferenceVariable(b) && a.equals(b); }
private boolean areSameTypeInference(ResolvedType a, ResolvedType b) { return isInferenceVariable(a) && isInferenceVariable(b) && a.equals(b); }
@Override public Optional<ProperLowerBound> isProperLowerBound() { if (isProperType(s) && isInferenceVariable(t)) { return Optional.of(new ProperLowerBound((InferenceVariable) t, s)); } return Optional.empty(); }
@Override public Optional<ProperLowerBound> isProperLowerBound() { if (isProperType(s) && isInferenceVariable(t)) { return Optional.of(new ProperLowerBound((InferenceVariable) t, s)); } return Optional.empty(); }
@Override public Optional<ProperUpperBound> isProperUpperBound() { if (isInferenceVariable(s) && isProperType(t)) { return Optional.of(new ProperUpperBound((InferenceVariable) s, t)); } return Optional.empty(); }
@Override public Optional<Instantiation> isAnInstantiation() { if (isInferenceVariable(s) && isProperType(t)) { return Optional.of(new Instantiation((InferenceVariable) s, t)); } if (isProperType(s) && isInferenceVariable(t)) { return Optional.of(new Instantiation((InferenceVariable) t, s)); } return Optional.empty(); }
@Override public Optional<ProperUpperBound> isProperUpperBound() { if (isInferenceVariable(s) && isProperType(t)) { return Optional.of(new ProperUpperBound((InferenceVariable) s, t)); } return Optional.empty(); }
@Override public Optional<Instantiation> isAnInstantiation() { if (isInferenceVariable(s) && isProperType(t)) { return Optional.of(new Instantiation((InferenceVariable) s, t)); } if (isProperType(s) && isInferenceVariable(t)) { return Optional.of(new Instantiation((InferenceVariable) t, s)); } return Optional.empty(); }
@Override public Optional<ProperUpperBound> isProperUpperBound() { if (isInferenceVariable(s) && isProperType(t)) { return Optional.of(new ProperUpperBound((InferenceVariable) s, t)); } return Optional.empty(); }
@Override public Optional<ProperLowerBound> isProperLowerBound() { if (isProperType(s) && isInferenceVariable(t)) { return Optional.of(new ProperLowerBound((InferenceVariable) t, s)); } return Optional.empty(); }
@Override public Optional<Instantiation> isAnInstantiation() { if (isInferenceVariable(s) && isProperType(t)) { return Optional.of(new Instantiation((InferenceVariable) s, t)); } if (isProperType(s) && isInferenceVariable(t)) { return Optional.of(new Instantiation((InferenceVariable) t, s)); } return Optional.empty(); }
public static Set<InferenceVariable> usedInferenceVariables(ResolvedType type) { if (isInferenceVariable(type)) { return new HashSet<>(Arrays.asList((InferenceVariable)type)); } if (type.isReferenceType()) { Set<InferenceVariable> res = new HashSet<>(); for (ResolvedType tp : type.asReferenceType().typeParametersValues()) { res.addAll(usedInferenceVariables(tp)); } return res; } throw new UnsupportedOperationException(type.toString()); }
public static Set<InferenceVariable> usedInferenceVariables(ResolvedType type) { if (isInferenceVariable(type)) { return new HashSet<>(Arrays.asList((InferenceVariable)type)); } if (type.isReferenceType()) { Set<InferenceVariable> res = new HashSet<>(); for (ResolvedType tp : type.asReferenceType().typeParametersValues()) { res.addAll(usedInferenceVariables(tp)); } return res; } throw new UnsupportedOperationException(type.toString()); }
public static Set<InferenceVariable> usedInferenceVariables(ResolvedType type) { if (isInferenceVariable(type)) { return new HashSet<>(Arrays.asList((InferenceVariable)type)); } if (type.isReferenceType()) { Set<InferenceVariable> res = new HashSet<>(); for (ResolvedType tp : type.asReferenceType().typeParametersValues()) { res.addAll(usedInferenceVariables(tp)); } return res; } throw new UnsupportedOperationException(type.toString()); }