public class DefinitionFile
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<Comment> |
comments
HashMap of all comments from the AssignmentFile.
|
private java.util.Map<java.lang.String,AbstractVariableDefinition> |
definitions
HashMap of all definitions from the DefinitionFile.
|
| Constructor and Description |
|---|
DefinitionFile()
Default constructor.
|
DefinitionFile(java.util.Map<java.lang.String,AbstractVariableDefinition> definitions2,
java.util.List<Comment> comments)
Constructor, just sets the fields.
|
| Modifier and Type | Method and Description |
|---|---|
private java.util.Map<Position,Comment> |
createPosCommentMap()
Creates a Map containing comment.getPosition() as Key and comment as Value.No side effects to
fields.
|
private java.util.Map<Position,AbstractVariableDefinition> |
createPosDefMap()
Creates a Map containing definition.getPosition() as Key and definition as Value.
|
boolean |
equals(java.lang.Object obj) |
java.util.List<Comment> |
getComments() |
java.util.Map<java.lang.String,AbstractVariableDefinition> |
getDefinitions()
Returns the field definitions.
|
int |
hashCode() |
private java.lang.StringBuffer |
prepareStringToPrint()
Prepares the StringBuffer for printing.
|
java.lang.String |
print(java.lang.String pathToPrint)
Prints a DefinitionFile containing the VariableDefinitions and Comments.
|
private void |
printTheLinesToFile(java.lang.String pathToPrint,
java.lang.StringBuffer stringBuffer)
The only one method, that real prints lines into the file.
|
private java.util.List<Position> |
sortPositions()
Sorts the Positions of VariableAssignments and Comments in one List.
|
private final java.util.Map<java.lang.String,AbstractVariableDefinition> definitions
private final java.util.List<Comment> comments
public DefinitionFile()
public DefinitionFile(java.util.Map<java.lang.String,AbstractVariableDefinition> definitions2, java.util.List<Comment> comments)
definitions2 - The definitions to set.comments - The comments to set.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.util.Map<java.lang.String,AbstractVariableDefinition> getDefinitions()
public java.util.List<Comment> getComments()
public java.lang.String print(java.lang.String pathToPrint)
throws PrinterException
pathToPrint - The path where to print the file.PrinterException - If a IOException is thrown.PrinterExceptionprivate java.lang.StringBuffer prepareStringToPrint()
private java.util.Map<Position,AbstractVariableDefinition> createPosDefMap()
private java.util.Map<Position,Comment> createPosCommentMap()
private void printTheLinesToFile(java.lang.String pathToPrint,
java.lang.StringBuffer stringBuffer)
throws PrinterException
pathToPrint - The path where to print the file-stringBuffer - The buffer with the lines to print.PrinterException - If an IOException is caused by the printer.private java.util.List<Position> sortPositions()