JML

java.lang.reflect
Class Method

java.lang.Object
  extended byjava.lang.reflect.AccessibleObject
      extended byjava.lang.reflect.Method
All Implemented Interfaces:
Member

public final class Method
extends AccessibleObject
implements Member


Class Specifications
public constraint this.returnType == \old(this.returnType);

Specifications inherited from class Object
represents objectState <- org.jmlspecs.lang.JMLDataGroup.IT;
public represents _getClass <- \typeof(this);

Model Field Summary
 Class returnType
           
 
Model fields inherited from class java.lang.Object
_getClass, objectState, theString
 
Ghost Field Summary
 
Ghost fields inherited from class java.lang.Object
objectTimesFinalized, owner
 
Field Summary
 
Fields inherited from class java.lang.reflect.AccessibleObject
override, securityCheckCache
 
Fields inherited from interface java.lang.reflect.Member
DECLARED, PUBLIC
 
Constructor Summary
(package private) Method(Class declaringClass, String name, Class[] parameterTypes, Class returnType, Class[] checkedExceptions, int modifiers, int slot)
           
 
Model Method Summary
 
Model methods inherited from class java.lang.Object
hashValue
 
Method Summary
(package private)  Method copy()
           
(package private) static Class[] copy(Class[] in)
           
 boolean equals(nullable Object obj)
           
 Class getDeclaringClass()
           
 Class[] getExceptionTypes()
           
 int getModifiers()
           
 String getName()
           
 Class[] getParameterTypes()
           
 Class getReturnType()
           
 int hashCode()
           
 Object invoke(nullable Object obj, Object[] args)
           
 String toString()
           
 
Methods inherited from class java.lang.reflect.AccessibleObject
isAccessible, setAccessible, setAccessible
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Model Field Detail

returnType

public Class returnType
Constructor Detail

Method

Method(Class declaringClass,
       String name,
       Class[] parameterTypes,
       Class returnType,
       Class[] checkedExceptions,
       int modifiers,
       int slot)
Specifications:
ensures this.returnType == returnType;
Method Detail

copy

Method copy()

getDeclaringClass

public Class getDeclaringClass()
Specified by:
getDeclaringClass in interface Member
Specifications: pure
     also
public normal_behavior
ensures \result != null;

getName

public String getName()
Specified by:
getName in interface Member
Specifications: pure
     also
public normal_behavior
ensures \result != null;

getModifiers

public int getModifiers()
Specified by:
getModifiers in interface Member
Specifications: pure

getReturnType

public Class getReturnType()
Specifications: pure non_null
public normal_behavior
ensures \result == this.returnType;

getParameterTypes

public Class[] getParameterTypes()
Specifications: pure
public normal_behavior
ensures \result != null;

getExceptionTypes

public Class[] getExceptionTypes()
Specifications: pure
public normal_behavior
ensures \result != null;

equals

public boolean equals(nullable Object obj)
Overrides:
equals in class Object
Specifications: pure
Specifications inherited from overridden method equals(Object obj) in class Object:
       pure
public normal_behavior
requires obj != null;
ensures (* \result is true when obj is "equal to" this object *);
     also
public normal_behavior
requires this == obj;
ensures \result ;
     also
public code normal_behavior
requires obj != null;
ensures \result <==> this == obj;
     also
diverges false;
ensures obj == null ==> !\result ;

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Specifications: pure
Specifications inherited from overridden method in class Object:
public behavior
assignable objectState;
ensures (* \result is a hash code for this object *);
     also
public code normal_behavior
assignable \nothing;

toString

public String toString()
Overrides:
toString in class Object
Specifications: pure non_null
Specifications inherited from overridden method in class Object:
       non_null
public normal_behavior
assignable objectState;
ensures \result != null&&\result .equals(this.theString);
ensures (* \result is a string representation of this object *);
     also
public code normal_behavior
assignable \nothing;
ensures \result != null&&(* \result is the instance's class name, followed by an @, followed by the instance's hashcode in hex *);
     also
public code model_program { ... }
    implies_that
assignable objectState;
ensures \result != null;

invoke

public Object invoke(nullable Object obj,
                     Object[] args)
              throws IllegalAccessException,
                     IllegalArgumentException,
                     InvocationTargetException
Throws:
IllegalAccessException
IllegalArgumentException
InvocationTargetException
Specifications: nullable
requires !java.lang.reflect.Modifier.isStatic(this.getModifiers()) ==> obj != null;
ensures this.getReturnType() == boolean.class ==> \result instanceof java.lang.Boolean;
ensures this.getReturnType() == byte.class ==> \result instanceof java.lang.Byte;
ensures this.getReturnType() == char.class ==> \result instanceof java.lang.Character;
ensures this.getReturnType() == int.class ==> \result instanceof java.lang.Integer;
ensures this.getReturnType() == long.class ==> \result instanceof java.lang.Long;
ensures this.getReturnType() == short.class ==> \result instanceof java.lang.Short;
ensures this.getReturnType() == double.class ==> \result instanceof java.lang.Double;
ensures this.getReturnType() == float.class ==> \result instanceof java.lang.Float;
ensures this.getReturnType() == void.class ==> \result == null;
ensures_redundantly this.getReturnType().isPrimitive()&&this.getReturnType() != void.class ==> \result != null;

copy

static Class[] copy(Class[] in)

JML

JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.