Module de.carne.mcd
Package de.carne.mcd.bootstrap
Class InstructionReference<T extends InstructionReferenceEntry>
- java.lang.Object
-
- de.carne.mcd.bootstrap.InstructionReference<T>
-
- Type Parameters:
T- the actual instruction reference entry type.
public abstract class InstructionReference<T extends InstructionReferenceEntry> extends java.lang.ObjectHelper class used to create and update a instruction reference file suitable for InstructionIndex generation.
-
-
Constructor Summary
Constructors Constructor Description InstructionReference()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddOrUpdateEntries(java.lang.Iterable<T> entries)Adds or updates a collection of instruction reference entries.voidaddOrUpdateEntry(T entry)Adds or updates an instruction reference entry.InstructionIndexBuilderbuild(InstructionIndexBuilder builder)Builds up the instruction index by feeding all reference entries into the given InstructionIndexBuilder instance.voidload(java.io.File file)Loads instruction reference entries from a file.voidload(java.io.File file, java.nio.charset.Charset cs)Loads instruction reference entries from a file.voidlogStatus()Logs the current status of this instance.protected TmergeEntries(T left, T right)protected abstract TnewEntry(InstructionReferenceEntry entryData)voidsave(java.io.File file)Saves all instruction reference entries to a file.voidsave(java.io.File file, java.nio.charset.Charset cs)Saves all instruction reference entries to a file.
-
-
-
Method Detail
-
load
public void load(java.io.File file) throws java.io.IOExceptionLoads instruction reference entries from a file.- Parameters:
file- the file to load from.- Throws:
java.io.IOException- if an I/O error occurs.
-
load
public void load(java.io.File file, java.nio.charset.Charset cs) throws java.io.IOExceptionLoads instruction reference entries from a file.- Parameters:
file- the file to load from.cs- the Charset to use for text conversion.- Throws:
java.io.IOException- if an I/O error occurs.
-
newEntry
protected abstract T newEntry(InstructionReferenceEntry entryData) throws java.io.IOException
- Throws:
java.io.IOException
-
addOrUpdateEntries
public void addOrUpdateEntries(java.lang.Iterable<T> entries) throws java.io.IOException
Adds or updates a collection of instruction reference entries.- Parameters:
entries- the entries to add or update.- Throws:
java.io.IOException- if an I/O error occurs.
-
addOrUpdateEntry
public void addOrUpdateEntry(T entry) throws java.io.IOException
Adds or updates an instruction reference entry.- Parameters:
entry- the entry to add or update.- Throws:
java.io.IOException- if an I/O error occurs.
-
mergeEntries
protected T mergeEntries(T left, T right) throws java.io.IOException
- Throws:
java.io.IOException
-
save
public void save(java.io.File file) throws java.io.IOExceptionSaves all instruction reference entries to a file.- Parameters:
file- the file to save to.- Throws:
java.io.IOException- if an I/O error occurs.
-
save
public void save(java.io.File file, java.nio.charset.Charset cs) throws java.io.IOExceptionSaves all instruction reference entries to a file.- Parameters:
file- the file to save to.cs- the Charset to use for text conversion.- Throws:
java.io.IOException- if an I/O error occurs.
-
build
public InstructionIndexBuilder build(InstructionIndexBuilder builder) throws java.io.IOException
Builds up the instruction index by feeding all reference entries into the given InstructionIndexBuilder instance.- Parameters:
builder- the InstructionIndexBuilder instance to feed the entries into.- Returns:
- the updated InstructionIndexBuilder instance.
- Throws:
java.io.IOException- if a reference entry conversion fails.- See Also:
InstructionReferenceEntry.toInstruction()
-
logStatus
public void logStatus()
Logs the current status of this instance.
-
-