Class MetisFieldVersionHistory
java.lang.Object
io.github.tonywasher.joceanus.metis.field.MetisFieldVersionHistory
- All Implemented Interfaces:
MetisDataItem.MetisDataObjectFormat,MetisFieldItem
Data Version History.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.tonywasher.joceanus.metis.field.MetisFieldItem
MetisFieldItem.MetisFieldDef, MetisFieldItem.MetisFieldItemType, MetisFieldItem.MetisFieldSetDef, MetisFieldItem.MetisFieldTableItem, MetisFieldItem.MetisFieldUpdatableItem, MetisFieldItem.MetisFieldVersionedDef -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidClear history.protected voidcondenseHistory(int pNewVersion) Condense history.Determines whether a particular field has changed.formatObject(OceanusDataFormatter pFormatter) Obtain Object summary.Obtain the fieldSet.Obtain the last values.protected MetisFieldVersionValuesGet original values.protected MetisFieldVersionValuesGet the changeable values object for this item.booleanIs there any history?booleanpopItem from the history if equal to current.voidpopItem from the history and remove from history.voidpushHistory(int pVersion) Push Item to the history.protected voidReset history.voidSet history explicitly.protected voidsetValues(MetisFieldVersionValues pValues) Initialise the current values.
-
Constructor Details
-
MetisFieldVersionHistory
Constructor.- Parameters:
pCurr- the current values
-
-
Method Details
-
getDataFieldSet
Description copied from interface:MetisFieldItemObtain the fieldSet.- Specified by:
getDataFieldSetin interfaceMetisFieldItem- Returns:
- the fieldSet
-
formatObject
Description copied from interface:MetisDataItem.MetisDataObjectFormatObtain Object summary.- Specified by:
formatObjectin interfaceMetisDataItem.MetisDataObjectFormat- Parameters:
pFormatter- the data formatter- Returns:
- the display summary of the object
-
setValues
Initialise the current values.- Parameters:
pValues- the current values
-
getValueSet
Get the changeable values object for this item.- Returns:
- the object
-
getOriginalValues
Get original values.- Returns:
- original values
-
pushHistory
public void pushHistory(int pVersion) Push Item to the history.- Parameters:
pVersion- the new version
-
popTheHistory
public void popTheHistory()popItem from the history and remove from history. -
maybePopHistory
public boolean maybePopHistory()popItem from the history if equal to current.- Returns:
- was a change made
-
hasHistory
public boolean hasHistory()Is there any history?- Returns:
- whether there are entries in the history list
-
getLastValues
Obtain the last values.- Returns:
- the last values (or null)
-
clearHistory
protected void clearHistory()Clear history. -
resetHistory
protected void resetHistory()Reset history. -
setHistory
Set history explicitly.- Parameters:
pBase- the base item
-
condenseHistory
protected void condenseHistory(int pNewVersion) Condense history.- Parameters:
pNewVersion- the new maximum version
-
fieldChanged
Determines whether a particular field has changed.- Parameters:
pField- the field- Returns:
- the difference
-