|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Student
The Student class is a basic type of this model. The Model creates several instances of the student type of "agent". Each student has a name, it can send messages to other students, receive messages. The big addition in this model is that the student interacts with others, and when it does, it takes a note of the fingerprint of the other student, and then it puts that other into a map, using the fingerprint as a key. When asked to check its records on a fingerprint, the agent can then look int he map, see if there is anybody with that fingerprint, and then send back the identity of the other.
Constructor Summary | |
Student(java.lang.String s)
Create a student and tell it its name. |
Method Summary | |
Student |
checkFingerprint(Fingerprint x)
Find out if fingerprint of suspect is in records. |
Fingerprint |
getFingerprint()
Return the fingerprint object |
java.lang.String |
getName()
Return the student's name string |
double |
getSomeData()
|
void |
receiveMessage(Student obj,
java.lang.String s)
The Student object receives a message from "obj" and the content of the message is a String s Note I'm inconsistent here in setting a precise type for obj in this method, whereas I used Object in sayHiTo(). |
void |
sayHi()
This is a diagnostic method. |
void |
sayHiTo(java.lang.Object target)
The student is supposed to send a message to the target Object. |
void |
setContactList(java.util.HashSet aList)
|
void |
step()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Student(java.lang.String s)
Method Detail |
public void sayHiTo(java.lang.Object target)
public void receiveMessage(Student obj, java.lang.String s)
public java.lang.String getName()
public Fingerprint getFingerprint()
public void sayHi()
public void setContactList(java.util.HashSet aList)
public Student checkFingerprint(Fingerprint x)
public void step()
public double getSomeData()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |