public class ALDPortHashAccess extends Object
This class implements the interface to access the port hash. It yields the only possibility to access the hash, direct access is blocked to guarantee consistency.
Modifier and Type | Field and Description |
---|---|
protected static String |
ALD_EXTENSION
File extension of Alida processing history files.
|
private static org.slf4j.Logger |
logger
Init a logger object.
|
private boolean |
verbose
If true, verbose outputs are written to standard output on calling methods.
|
Modifier | Constructor and Description |
---|---|
protected |
ALDPortHashAccess()
Constructor without function.
|
Modifier and Type | Method and Description |
---|---|
protected ALDPort |
getHistoryLink(Object obj)
Get the port to which the object is currently linked in history.
|
int |
getNumEntries()
Returns the number of objects currently stored in the history database.
|
protected boolean |
isRegistered(Object obj)
Check if an object is registered in the hash.
|
protected void |
readHistory(Object obj,
String filename)
Read and set the processing history from file.
|
protected void |
register(Object obj)
Register the object in the hash.
|
protected void |
setHistoryLink(Object obj,
ALDPort port)
Set the port to which the object is currently linked in history.
|
protected void |
writeHistory(Object obj,
String filename)
Deprecated.
|
protected void |
writeHistory(Object obj,
String filename,
ALDProcessingDAG.HistoryType historyType)
Deprecated.
|
protected void |
writeHistory(Object obj,
String filename,
ALDProcessingDAG.HistoryType historyType,
boolean ignoreHiding)
Write the processing history (if available) to a graphml file.
|
protected static final String ALD_EXTENSION
private boolean verbose
private static org.slf4j.Logger logger
protected ALDPortHashAccess()
Note that there will only be only one processing history per session and not many different objects of this type.
public int getNumEntries()
Note that the number can be larger than the number of objects actually referenced from the Java process due to the management of weak references of the Java Garbage Collector.
protected void readHistory(Object obj, String filename)
If no graphML processing history could be find, the method checks if an arbitrary XML tree is available. If this fails, too, the data object is left without any processing history. As a result of a call of this method either a graphmlHistory or an xmlHistory object (if available) is added to the port of the object.
If filename
ends with .ald
it is used as is
otherwise the extension ald
is appended.
If the object is of type ALDData
the location property is set
from filename and lateron documented in the processing history.
filename
- Filename of processing history (XML file).@Deprecated protected void writeHistory(Object obj, String filename) throws ALDProcessingDAGException, ALDOperatorException
Equivalent to
writeHistory(obj, filename,
ALDProcessingDAG.HistoryType.COMPLETE, false)
.
@Deprecated protected void writeHistory(Object obj, String filename, ALDProcessingDAG.HistoryType historyType) throws ALDProcessingDAGException, ALDOperatorException
Equivalent to
writeHistory(obj, filename, historyType, false)
.
protected void writeHistory(Object obj, String filename, ALDProcessingDAG.HistoryType historyType, boolean ignoreHiding) throws ALDProcessingDAGException, ALDOperatorException
The processing history is created using the opNodes and their ports
starting with this data object.
If no history is available (e.g. if this object is created internally and
not output of an operator) then no history file is written.
If filename
ends with .ald
it is used as is
otherwise the extension ald
is appended.
obj
- Object for which the history to write for.filename
- Filename to write the processing history into
in graphml/XML format. For the extension see above.historyType
- Type/mode of the history.ignoreHiding
- If true, hiding of opNodes is ignored.ALDProcessingDAGException
ALDOperatorException
protected boolean isRegistered(Object obj)
obj
- Object to check.protected void register(Object obj)
obj
- Object to register.protected ALDPort getHistoryLink(Object obj)
Copyright © 2010–2021 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.