org.jwalk.test
Class Abstract

java.lang.Object
  extended by org.jwalk.test.Abstract

public abstract class Abstract
extends java.lang.Object

Abstract is an abstract class with one abstract method signature. This is a standard test class, provided with the JWalk tool suite. Abstract is provided solely in order to demonstrate JWalk's ability to recognise that it cannot exercise any abstract class, which by definition cannot be instantiated or executed. It should be possible to inspect the protocols of Abstract.

Version:
1.0
Author:
Anthony Simons

Constructor Summary
Abstract()
          Could create an Abstract instance (were the class not abstract).
 
Method Summary
 int getValue()
          Returns the current value.
 int hashCode()
          Returns a hash code computed from this object.
abstract  void setValue(int value)
          Sets the current value.
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Abstract

public Abstract()
Could create an Abstract instance (were the class not abstract). Initialises the stored value to 5, demonstrating that an abstract class may be at least partly concrete.

Method Detail

getValue

public int getValue()
Returns the current value. This is a concrete method, which could be executed (were the class not abstract).

Returns:
the stored value.

setValue

public abstract void setValue(int value)
Sets the current value. This is an abstract method, not implemented by Abstract, and the sole reason why this must be an abstract class.

Parameters:
value - the value to store.

toString

public java.lang.String toString()
Returns a string representation of this object. Returns the stored value as a string.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this object.

hashCode

public int hashCode()
Returns a hash code computed from this object. Returns the stored value directly.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code computed from this object.