430 Part II: The Java Library
Method Description
<A extends Annotation> A
getAnnotation(Class<A>annoType)
Returns anAnnotationobject that contains the
annotation associated withannoTypefor the
invoking object.
Annotation[ ] getAnnotations( ) Returns all annotations associated with the invoking
object in an array ofAnnotationobjects. Returns a
reference to this array.
Annotation[ ] getDeclaredAnnotations( ) Returns anAnnotationobject for all the annotations
that are declared by the invoking object. (Inherited
annotations are ignored.)
String getImplementationTitle( ) Returns the title of the invoking package.
String getImplementationVendor( ) Returns the name of the implementor of the
invoking package.
String getImplementationVersion( ) Returns the version number of the invoking package.
String getName( ) Returns the name of the invoking package.
static Package getPackage(StringpkgName) Returns aPackageobject with the name specified
bypkgName.
static Package[ ] getPackages( ) Returns all packages about which the invoking
program is currently aware.
String getSpecificationTitle( ) Returns the title of the invoking package’s
specification.
String getSpecificationVendor( ) Returns the name of the owner of the specification
for the invoking package.
String getSpecificationVersion( ) Returns the invoking package’s specification
version number.
int hashCode( ) Returns the hash code for the invoking package.
boolean isAnnotationPresent(
Class<? extends Annotation>anno)
Returnstrueif the annotation described byannois
associated with the invoking object. Returnsfalse,
other wise.
boolean isCompatibleWith(StringverNum)
throws NumberFormatException
ReturnstrueifverNumis less than or equal to the
invoking package’s version number.
boolean isSealed( ) Returnstrueif the invoking package is sealed.
Returnsfalseother wise.
boolean isSealed(URLurl) Returnstrueif the invoking package is sealed
relative tourl.Returnsfalseother wise.
String toString( ) Returns the string equivalent of the invoking
package.
TABLE 16-19 The Methods Defined byPackage