net.cscott.sinjdoc

Interface TypeArgument

public interface TypeArgument

A TypeArgument is either a type or a wildcard specification such as "? extends Number", "? super Integer", or "?".

Version: $Id: TypeArgument.java,v 1.1 2003/07/29 16:02:37 cananian Exp $

Author: C. Scott Ananian (cscott@cscott.net)

Method Summary
TypegetType()
Return the Type bound corresponding to this TypeArgument.
booleanisContravariant()
Return true if this type argument is contravariant; for example, Comparable<? super Integer>.
booleanisCovariant()
Return true if this type argument is covariant; for example, Set<? extends Number>.

Method Detail

getType

public Type getType()
Return the Type bound corresponding to this TypeArgument. Bivariant type arguments should return the Type corresponding to java.lang.Object. Covariant, contravariant, or invariant type arguments should return the type forming the bound on the argument type.

isContravariant

public boolean isContravariant()
Return true if this type argument is contravariant; for example, Comparable<? super Integer>. Also returns true if the type argument is bivariant; for example, Comparable<?>.

isCovariant

public boolean isCovariant()
Return true if this type argument is covariant; for example, Set<? extends Number>. Also returns true if the type argument is bivariant; for example, Set<?>.
Copyright © 2003 C. Scott Ananian