@Override public boolean equals(Object o) { if (!(o instanceof SuperTypesOfSingleton)) return false; SuperTypesOfSingleton other= (SuperTypesOfSingleton) o; return other.fLowerBound.equals(fLowerBound); }
@Override public boolean doEquals(TType other) { ArrayType arrayType= (ArrayType)other; return fElementType.equals(arrayType.fElementType) && fDimensions == arrayType.fDimensions; }
@Override public boolean doEquals(TType type) { WildcardType other= (WildcardType)type; if (fBound == null) return other.fBound == null; return fBound.equals(other.fBound); }
/** * Checks whether the <code>this</code> left hand side type interpreted as * a type argument of a parameterized type is compatible with the given type * <code>rhs</code>. For example if * <code>List<this>= List<rhs></code> is a valid assignment. * * @param rhs the right-hand-side type * @return <code>true</code> iff <code>this</code> contains <code>rhs</code> according to JLS3 4.5.1.1 */ protected boolean checkTypeArgument(TType rhs) { return this.equals(rhs); }
@Override public boolean doEquals(TType type) { WildcardType other= (WildcardType)type; if (fBound == null) return other.fBound == null; return fBound.equals(other.fBound); }
@Override public boolean equals(Object o) { if (!(o instanceof SubTypesOfSingleton)) return false; SubTypesOfSingleton other= (SubTypesOfSingleton) o; return other.fUpperBound.equals(fUpperBound); }
public boolean equals(Object o) { if (!(o instanceof SuperTypesOfSingleton)) return false; SuperTypesOfSingleton other= (SuperTypesOfSingleton) o; return other.fLowerBound.equals(fLowerBound); }
/** * Checks whether the <code>this</code> left hand side type interpreted as * a type argument of a parameterized type is compatible with the given type * <code>rhs</code>. For example if * <code>List<this>= List<rhs></code> is a valid assignment. * * @param rhs the right-hand-side type * @return <code>true</code> iff <code>this</code> contains <code>rhs</code> according to JLS3 4.5.1.1 */ protected boolean checkTypeArgument(TType rhs) { return this.equals(rhs); }
/** * Checks whether the <code>this</code> left hand side type interpreted as * a type argument of a parameterized type is compatible with the given type * <code>rhs</code>. For example if * <code>List<this>= List<rhs></code> is a valid assignment. * * @return <code>true</code> iff <code>this</code> contains <code>rhs</code> according to JLS3 4.5.1.1 */ protected boolean checkTypeArgument(TType rhs) { return this.equals(rhs); }
@Override public boolean doEquals(TType other) { ArrayType arrayType= (ArrayType)other; return fElementType.equals(arrayType.fElementType) && fDimensions == arrayType.fDimensions; }
@Override public boolean isSingleton() { // The only thing that doesn't have at least 1 proper supertype is java.lang.Object return fLowerBound.equals(getJavaLangObject()); }
@Override public boolean contains(TType t) { if (t.equals(fUpperBound)) return true; return TTypes.canAssignTo(t, fUpperBound); }
@Override public boolean containsAll(TypeSet s) { if (s.isEmpty()) return true; if (s.isSingleton()) return s.anyMember().equals(fType); return false; }
@Override public boolean containsAll(TypeSet s) { if (s.isEmpty()) return true; if (s.isSingleton()) return s.anyMember().equals(fType); return false; }
protected final ITypeSet computeTypeEstimate(final ConstraintVariable2 variable) { final TType type= variable.getType(); if (variable instanceof ImmutableTypeVariable2 || !type.getErasure().equals(fModel.getSubType().getErasure())) return SuperTypeSet.createTypeSet(type); final TType[] types= type.getInterfaces(); for (int index= 0; index < types.length; index++) { if (types[index].getName().startsWith(fName) && types[index].getErasure().equals(fModel.getSuperType().getErasure())) return SuperTypeSet.createTypeSet(type, types[index]); } return SuperTypeSet.createTypeSet(type); } }
/** * Computes the initial type estimate for the specified constraint variable. * * @param variable the constraint variable * @return the initial type estimate */ protected ITypeSet computeTypeEstimate(final ConstraintVariable2 variable) { final TType type= variable.getType(); if (variable instanceof ImmutableTypeVariable2 || !type.getErasure().equals(fModel.getSubType().getErasure())) return SuperTypeSet.createTypeSet(type); return SuperTypeSet.createTypeSet(type, fModel.getSuperType()); }
/** * Computes the initial type estimate for the specified constraint variable. * * @param variable the constraint variable * @return the initial type estimate */ protected ITypeSet computeTypeEstimate(final ConstraintVariable2 variable) { final TType type= variable.getType(); if (variable instanceof ImmutableTypeVariable2 || !type.getErasure().equals(fModel.getSubType().getErasure())) return SuperTypeSet.createTypeSet(type); return SuperTypeSet.createTypeSet(type, fModel.getSuperType()); }