public class MasterDetailsPair extends ICEObject
The MasterDetailsPair class is used by the MasterDetailsComponent to keep track of "masters" and "details" without having to store them in two separate arrays. It simply allows one master value, a string, to be stored beside one details DataComponent. A list of these pairs may also be used to set the templates for the MasterDetailsComponent.
A MasterDetailsPair is an ICEObject and is both uniquely identifiable and persistent. However, it only overloads ICEObject.loadFromXML(), not copy(), equals(), hashcode() or clone().
iComponentListener
Constructor and Description |
---|
MasterDetailsPair()
The constructor.
|
MasterDetailsPair(java.lang.String masterValue,
DataComponent detailsComp)
An alternative constructor in which the master and details pieces can be
specified to immediately initialize the pair.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Deep copies current object and returns a newly instantiated object.
|
void |
copy(MasterDetailsPair otherMasterDetailsPair)
An operation that copies the object passed into the current object.
|
boolean |
equals(java.lang.Object otherObject)
An operation that checks to see if the current object equals the other
object.
|
DataComponent |
getDetails()
This operation returns the details DataComponent of this pair or null if
it has not been set.
|
java.lang.String |
getMaster()
This operation returns the master value of this pair or null if it has
not been set.
|
java.lang.Integer |
getMasterDetailsPairId()
Returns the value of the attribute masterDetailsPairId.
|
int |
hashCode()
Creates a hash number from the current object.
|
void |
setDetails(DataComponent detailsComp)
This operation sets the details DataComponent for this pair.
|
void |
setMaster(java.lang.String masterValue)
This operation sets the master value of this pair.
|
void |
setMasterDetailsPairId(java.lang.Integer id)
Sets the masterDetailsPairId.
|
copy, getDescription, getId, getName, register, setDescription, setId, setName, unregister, update
public MasterDetailsPair()
The constructor.
public MasterDetailsPair(java.lang.String masterValue, DataComponent detailsComp)
An alternative constructor in which the master and details pieces can be specified to immediately initialize the pair.
masterValue
- The string that describes the value of the master that is associated with the details.
detailsComp
- The DataComponent that contains the detailed parameters associated with the master.
public int hashCode()
Creates a hash number from the current object.
hashCode
in interface Identifiable
hashCode
in class ICEObject
A hashcode value.
Identifiable.hashCode()
public boolean equals(java.lang.Object otherObject)
An operation that checks to see if the current object equals the other object. Returns true if equal. False otherwise.
equals
in interface Identifiable
equals
in class ICEObject
otherObject
- The other object to be checked for equality.
True if equal to otherObject. False otherwise.
Identifiable.equals(Object otherObject)
public void copy(MasterDetailsPair otherMasterDetailsPair)
An operation that copies the object passed into the current object.
otherMasterDetailsPair
- A MasterDetailsPair object to be copied.
public java.lang.Object clone()
Deep copies current object and returns a newly instantiated object.
clone
in interface Identifiable
clone
in class ICEObject
A deep cloned MasterDetailsPair.
public java.lang.String getMaster()
This operation returns the master value of this pair or null if it has not been set.
The string that describes the value of the master that is associated with the details.
public void setMaster(java.lang.String masterValue)
This operation sets the master value of this pair.
masterValue
- The string that describes the value of the master that is associated with the details.
public DataComponent getDetails()
This operation returns the details DataComponent of this pair or null if it has not been set.
The DataComponent that contains the detailed parameters associated with the master.
public void setDetails(DataComponent detailsComp)
This operation sets the details DataComponent for this pair.
detailsComp
- The DataComponent that contains the detailed parameters associated with the master.
public java.lang.Integer getMasterDetailsPairId()
Returns the value of the attribute masterDetailsPairId.
A return value representing the integer for the masterDetailsPairId.
public void setMasterDetailsPairId(java.lang.Integer id)
Sets the masterDetailsPairId. Must be a non negative number.
id
- An id to be set to masterDetailsPairId.