|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openbandy.example.bos.Car
public class Car
An example business object that shows how to implement the Serializable
interface. This class contains attributes as well as a vector of serializable
objects.
(c) Copyright P. Bolliger 2007, ALL RIGHTS RESERVED.
| Constructor Summary | |
|---|---|
Car()
|
|
| Method Summary | |
|---|---|
void |
addTire(Tire tire)
|
void |
deserialize(Serializer serializer,
SerializationBuffer serializationBuffer)
This method must overwrite the attributes denoted in getAttributeNames() with values read from the container provided. |
void |
getAttributeNames(java.util.Vector attributes)
This method must put the name of every attribute that needs to be serialized in the given Vector. |
java.lang.String |
getBrand()
|
Serializable |
getCopy()
Must return a copy of the object that is equal according to the method isEuqalTo(). |
Engine |
getEngine()
|
java.lang.String |
getIdName()
Must return the name of the id (e.g. |
int |
getIdValue()
Must return the value of the id. |
java.lang.String |
getLegibleString()
Must return a human readable String representation of the object. |
int |
getLength()
|
Serializable |
getNewInstance()
Must return a new and initialized instance. |
void |
getReferencedIdNames(java.util.Vector referenceNames)
This method must put every id name of referenced objects, i.e. |
void |
getReferences(java.util.Vector references)
This method must put every reference to Serializable objects, i.e. |
SerializableVector |
getTires()
|
boolean |
isEqual(Serializable serializableObject)
Must return true if the serializableObject is equal to this, except for the id but INCLUDING equality of referenced serializables. |
boolean |
isEqualShallow(Serializable serializableObject)
Must return true if the serializableObject is equal to this, except for the id, EXCLUDING equality of referenced serializables. |
void |
serialize(Serializer serializer,
SerializationBuffer serializationBuffer)
This method must fill the container provided with the serialization- Object with values for every attribute denoted in getAttributeNames(). |
void |
setBrand(java.lang.String brand)
|
void |
setEngine(Engine engine)
|
void |
setIdValue(int idValue)
Set the id to the given value. |
void |
setLength(int length)
|
void |
setTires(SerializableVector tires)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Car()
| Method Detail |
|---|
public java.lang.String getBrand()
public void setBrand(java.lang.String brand)
public int getLength()
public void setLength(int length)
public Engine getEngine()
public void setEngine(Engine engine)
public SerializableVector getTires()
public void setTires(SerializableVector tires)
public void addTire(Tire tire)
public void serialize(Serializer serializer,
SerializationBuffer serializationBuffer)
Serializable
serialize in interface Serializableserializer - -
the serializer used for call-backsserializationBuffer - -
the serializationBuffer containing the container to write
values to
public void deserialize(Serializer serializer,
SerializationBuffer serializationBuffer)
Serializable
deserialize in interface Serializableserializer - -
the serializer used for call-backsserializationBuffer - -
the buffer to read values frompublic java.lang.String getIdName()
Serializable
getIdName in interface Serializablepublic int getIdValue()
Serializable
getIdValue in interface Serializablepublic void setIdValue(int idValue)
Serializable
setIdValue in interface SerializableidValue - -
the new id valuepublic void getAttributeNames(java.util.Vector attributes)
Serializableattributes, there must be a corresponding field in the
database for example.
getAttributeNames in interface Serializableattributes - -
the vector to be filledpublic void getReferences(java.util.Vector references)
Serializable
getReferences in interface Serializablereferences - -
the vector to be filledpublic void getReferencedIdNames(java.util.Vector referenceNames)
Serializable
getReferencedIdNames in interface SerializablereferenceNames - -
the vector to be filledpublic java.lang.String getLegibleString()
Serializable
getLegibleString in interface Serializable
public boolean isEqualShallow(Serializable serializableObject)
throws java.lang.ClassCastException
Serializable
isEqualShallow in interface SerializableserializableObject - -
the object to compare
java.lang.ClassCastException
public boolean isEqual(Serializable serializableObject)
throws java.lang.ClassCastException
Serializable
isEqual in interface SerializableserializableObject - -
the object to compare
java.lang.ClassCastExceptionpublic Serializable getCopy()
Serializable
getCopy in interface Serializablepublic Serializable getNewInstance()
Serializable
getNewInstance in interface Serializable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||