th.co.edge.jseq
Class MockObject

java.lang.Object
  extended by th.co.edge.jseq.MockObject
All Implemented Interfaces:
java.lang.Comparable<MockObject>

public class MockObject
extends java.lang.Object
implements java.lang.Comparable<MockObject>

A MockObject is an immutable class representing one life-line in a sequence diagram.


Constructor Summary
MockObject(java.lang.String name, int column)
          Creates a new MockObject with a given name and column in the diagram.
 
Method Summary
 int compareTo(MockObject otherObject)
          Compares this MockObject to another MockObject, returning a negative integer, zero or a positive integer if this object is less than, equal to, or greater than the other object, respectively.
 boolean equals(java.lang.Object o)
          Compares this MockObject to another object and returns true if and only if the other object is a MockObject with the same name and column number.
 int getColumn()
          Returns the column number of this MockObject, which determines the order of the life-lines in the sequence diagram.
 java.lang.String getName()
          Returns the name that will be displayed at the top of the life-line.
 int hashCode()
          Returns a hash code for this MockObject.
 java.lang.String toString()
          Returns a string representation of this MockObject, mainly useful for logging.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MockObject

public MockObject(java.lang.String name,
                  int column)
Creates a new MockObject with a given name and column in the diagram.

Parameters:
name - the name that will be displayed at the top of the life-line
column - the column number of this life-line
Method Detail

getName

public java.lang.String getName()
Returns the name that will be displayed at the top of the life-line.

Returns:
the name of this MockObject

getColumn

public int getColumn()
Returns the column number of this MockObject, which determines the order of the life-lines in the sequence diagram.

Returns:
the column number of this MockObject

toString

public java.lang.String toString()
Returns a string representation of this MockObject, mainly useful for logging.

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

equals

public boolean equals(java.lang.Object o)
Compares this MockObject to another object and returns true if and only if the other object is a MockObject with the same name and column number.

Overrides:
equals in class java.lang.Object
Parameters:
o - the object to compare this MockObject to
Returns:
true if o is a MockObject with the same name and column number, false otherwise

hashCode

public int hashCode()
Returns a hash code for this MockObject.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code for this MockObject

compareTo

public int compareTo(MockObject otherObject)
Compares this MockObject to another MockObject, returning a negative integer, zero or a positive integer if this object is less than, equal to, or greater than the other object, respectively.

Comparison is done as follows:

Specified by:
compareTo in interface java.lang.Comparable<MockObject>
Parameters:
otherObject - the MockObject to compare this object to
Returns:
0 if this object is equal to otherObject; a negative integer if this object is smaller than otherObject; and a positive integer if this object is greater than otherObject


Copyright © 2008 Edge Software, Co., Ltd.. All Rights Reserved.