Top Description Fields Constructors Methods
com.univocity.parsers.common.processor

public Class MasterDetailRecord

extends Object
implements Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable
Imports
com.univocity.parsers.common.*, java.util.*

An utility class to store data of a master row and its detail records. Instances of this class are typically generated by an instance of AbstractParser during the parsing of an input using a MasterDetailProcessor.
Author
Univocity Software Pty Ltd - [email protected]
See Also
MasterDetailProcessor, RowProcessor, AbstractParser

Field Summary

Modifier and TypeField and Description
private List<Object[]>
private Object[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Empties the detail rows and sets the master row to null.

public MasterDetailRecord
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.
public List<Object[]>

Returns:

the detail rows which are associated with the master row
getDetailRows
()

Returns the detail rows which are associated with the master row

public Object[]

Returns:

the master row
getMasterRow
()

Returns the master row as identified by a MasterDetailProcessor

public void
setDetailRows(List<Object[]>
the list of rows associated with the master row
detailRows
)

Sets the detail rows associated with the master row

public void
setMasterRow(Object[]
the data of a master row
masterRow
)

Sets the master row data.

Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

detailRowsback to summary
private List<Object[]> detailRows
masterRowback to summary
private Object[] masterRow

Constructor Detail

MasterDetailRecordback to summary
public MasterDetailRecord()

Method Detail

clearback to summary
public void clear()

Empties the detail rows and sets the master row to null.

cloneback to summary
public MasterDetailRecord clone()

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:MasterDetailRecord

a clone of this instance.

Annotations
@Override
getDetailRowsback to summary
public List<Object[]> getDetailRows()

Returns the detail rows which are associated with the master row

Returns:List<Object[]>

the detail rows which are associated with the master row

getMasterRowback to summary
public Object[] getMasterRow()

Returns the master row as identified by a MasterDetailProcessor

Returns:Object[]

the master row

setDetailRowsback to summary
public void setDetailRows(List<Object[]> detailRows)

Sets the detail rows associated with the master row

Parameters
detailRows:List<Object[]>

the list of rows associated with the master row

setMasterRowback to summary
public void setMasterRow(Object[] masterRow)

Sets the master row data.

Parameters
masterRow:Object[]

the data of a master row