de.unihalle.informatik.MiToBo.core.operator
Class MTBPortHashAccess

java.lang.Object
  extended by de.unihalle.informatik.Alida.operator.ALDPortHashAccess
      extended by de.unihalle.informatik.MiToBo.core.operator.MTBPortHashAccess

@ALDMetaInfo(export=ALLOWED)
public class MTBPortHashAccess
extends de.unihalle.informatik.Alida.operator.ALDPortHashAccess

Interface to the port database of the Alida / MiToBo operator history.

This class implements an interface to access the history database. It yields the only possibility to access the database, direct access is blocked to guarantee database consistency.

Compared to the superclass a special treatment of MiToBo images takes place to ensure proper association of MiToBo images and underlying ImageJ ImagePlus data. Objects are usually registered by their references in the port database, however, in case of MiToBo images and underlying ImagePlus data different object references, i.e. the MTBImage and the ImagePlus, essentially represent the same data in the system. Hence, for history database validity explicit associations need to be established between ImagePlus and MTBImage data.

Database consistency is ensured by introducing a specialized data type which is the MTBHistoryImageBox. If a MTBImage is fed into an operator as parameter the first time, a corresponding image box is created and registered in the local hash. Lateron, when the ImagePlus object linked to the MTBImage is directly used as parameter, the MiToBo images within all boxes are searched to find the corresponding MTBImage. Then the history port associated with the box is updated, ensuring history consistency and at the same time proper association of the ImagePlus with the formerly known MTBImage.

In case of using an ImagePlus as parameter that has not been seen before, the same mechanism is applied. First an image box is initialized for the new ImagePlus. When at a later point in time the MTBImage is used as parameter which is associated to the formerly seen ImagePlus, the association is explicitly established by linking the MTBImage to the box and updating the history port of the box accordingly.

Author:
moeller, posch

Field Summary
static String MPH_EXTENSION
          Default extension of MiToBo processing history file.
 
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDPortHashAccess
ALD_EXTENSION
 
Constructor Summary
protected MTBPortHashAccess()
          Constructor without function.
 
Method Summary
protected  de.unihalle.informatik.Alida.operator.ALDPort getHistoryLink(Object obj)
          Gets the port to which the object is currently linked in history.
protected  boolean isRegistered(Object obj)
          Checks if an object is registered in the database.
protected  void register(Object obj)
          Registers the object to the database.
protected  void setHistoryLink(Object obj, de.unihalle.informatik.Alida.operator.ALDPort port)
          Sets the port to which the object is to be linked in history.
 
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDPortHashAccess
getNumEntries, readHistory, writeHistory, writeHistory, writeHistory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MPH_EXTENSION

public static final String MPH_EXTENSION
Default extension of MiToBo processing history file.

Constructor Detail

MTBPortHashAccess

protected MTBPortHashAccess()
Constructor without function.

Note that there will be only one processing history per session and not many different objects of this type.

Method Detail

isRegistered

protected boolean isRegistered(Object obj)
Checks if an object is registered in the database.

Overrides:
isRegistered in class de.unihalle.informatik.Alida.operator.ALDPortHashAccess
Parameters:
obj - Object to check.
Returns:
True, if object is known to the database.

register

protected void register(Object obj)
Registers the object to the database.

Overrides:
register in class de.unihalle.informatik.Alida.operator.ALDPortHashAccess
Parameters:
obj - Object to register.

getHistoryLink

protected de.unihalle.informatik.Alida.operator.ALDPort getHistoryLink(Object obj)
Gets the port to which the object is currently linked in history.

Overrides:
getHistoryLink in class de.unihalle.informatik.Alida.operator.ALDPortHashAccess
Returns:
Current port to which data is linked.

setHistoryLink

protected void setHistoryLink(Object obj,
                              de.unihalle.informatik.Alida.operator.ALDPort port)
Sets the port to which the object is to be linked in history.

Overrides:
setHistoryLink in class de.unihalle.informatik.Alida.operator.ALDPortHashAccess
Parameters:
port - New port the data object is to be linked to.


Copyright © 2010–2015 Martin Luther University Halle-Wittenberg. All rights reserved.