net.sf.spif.example
Class Person

java.lang.Object
  |
  +--net.sf.spif.example.Person

public class Person
extends java.lang.Object

A example model object. This one is the main object of an edit bubble.

Version:
$Id: Person.java,v 1.4 2003/03/06 22:35:59 bratseth Exp $
Author:
Jon S Bratseth

Constructor Summary
Person(PersonId id)
          Re-create an existing person.
Person(java.lang.String name)
          Create a person and assign a unique id in some way I am not going into here.
 
Method Summary
 void addChild(PersonId childId)
           
 boolean equals(java.lang.Object object)
          Identity is determined by id
 Address getAddress()
           
 java.util.Iterator getChildIterator()
          Returns a read-only iterator of the children of this person
 java.util.Iterator getChildren()
          Returns an iterator of the ids of the children of this class.
 PersonId getId()
           
 java.lang.String getName()
           
 PersonReport getReport()
          A persistent edit bubble may well contain non-persistent objects
 int hashCode()
          And don't forget the hash code
 boolean removeChild(PersonId childId)
           
 void setAddress(Address address)
          (The address is a dependent object - part of the same edit bubble)
 void setName(java.lang.String name)
           
 void setPersonReport(PersonReport report)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Person

public Person(PersonId id)
Re-create an existing person. You won't call this.


Person

public Person(java.lang.String name)
Create a person and assign a unique id in some way I am not going into here. You may also have some store chain create the id on put: PersonId newId=Store.put(null,newPerson);

Method Detail

getId

public PersonId getId()

setName

public void setName(java.lang.String name)

getName

public java.lang.String getName()

setAddress

public void setAddress(Address address)
(The address is a dependent object - part of the same edit bubble)


getAddress

public Address getAddress()

getChildren

public java.util.Iterator getChildren()
Returns an iterator of the ids of the children of this class. (So this is not part of the sane edit bubble, although collections may very well be)

Returns:
a read-only iterator of children personId's, or an empty iterator if there is no children

addChild

public void addChild(PersonId childId)

getChildIterator

public java.util.Iterator getChildIterator()
Returns a read-only iterator of the children of this person


removeChild

public boolean removeChild(PersonId childId)
Returns:
true if the child was removed, false if it wasn't present

getReport

public PersonReport getReport()
A persistent edit bubble may well contain non-persistent objects


setPersonReport

public void setPersonReport(PersonReport report)

equals

public boolean equals(java.lang.Object object)
Identity is determined by id

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
And don't forget the hash code

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Spif 1.01 (2003-04-03). http://spif.sf.net