de.hpi.fgis.dude.util.bibtex.data
Class BibtexEntry

java.lang.Object
  extended by de.hpi.fgis.dude.util.bibtex.data.BibtexNode
      extended by de.hpi.fgis.dude.util.bibtex.data.BibtexAbstractEntry
          extended by de.hpi.fgis.dude.util.bibtex.data.BibtexEntry

public class BibtexEntry
extends BibtexAbstractEntry

An entry is something that can be referenced by a latex file using the \cite command. E.g.

 @inproceedings{diwan98typebased,
    year=1998,
    pages={106-117},
    title={Type-Based Alias Analysis},
    url={citeseer.nj.nec.com/diwan98typebased.html},
    booktitle={SIGPLAN Conference on Programming Language Design and Implementation},
    author={Amer Diwan and Kathryn S. McKinley and J. Eliot B. Moss},
 }
 
For an example of how to create BibtexEntry objects, check out the documentation for the constructor of BibtexNode.

Author:
henkel

Constructor Summary
protected BibtexEntry(BibtexFile file, String entryType, String entryKey)
          Instantiates a new BibtexEntry.
 
Method Summary
 String getEntryKey()
          Returns the key of this entry.
 String getEntryType()
          Returns the type of this entry.
 Map<String,BibtexAbstractValue> getFields()
          Returns a read only view of the field map.
 BibtexAbstractValue getFieldValue(String name)
          Returns the value of field specified by the passed field name.
 void printBibtex(PrintWriter writer)
          Prints the node to the passed PrintWriter.
 void setEntryKey(String entryKey)
          Sets the entryKey.
 void setEntryType(String entryType)
          Sets the entryType.
 void setField(String fieldName, BibtexAbstractValue fieldValue)
          Sets a field within this entry.
 void undefineField(String fieldName)
          Removes the field from this entry.
 
Methods inherited from class de.hpi.fgis.dude.util.bibtex.data.BibtexNode
getOwnerFile, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BibtexEntry

protected BibtexEntry(BibtexFile file,
                      String entryType,
                      String entryKey)
Instantiates a new BibtexEntry.

Parameters:
file - The file that includes this entry.
entryType - The type of the entry.
entryKey - The key of the entry.
Method Detail

getEntryKey

public String getEntryKey()
Returns the key of this entry.

Returns:
The key of this entry or null if it is not set.

getFieldValue

public BibtexAbstractValue getFieldValue(String name)
Returns the value of field specified by the passed field name.

Parameters:
name - The name of the field whose value is requested.
Returns:
The field value of the requested field or null if it is not set.

getEntryType

public String getEntryType()
Returns the type of this entry.

Returns:
The type of this entry or null if it is not set.

getFields

public Map<String,BibtexAbstractValue> getFields()
Returns a read only view of the field map. This is a mapping from String instances (field names) to instances of BibtexAbstractValue.

Returns:
The field-value mapping.

setField

public void setField(String fieldName,
                     BibtexAbstractValue fieldValue)
Sets a field within this entry.

Parameters:
fieldName - The name of the field.
fieldValue - The value of the field.

setEntryKey

public void setEntryKey(String entryKey)
Sets the entryKey.

Parameters:
entryKey - The entryKey to set

setEntryType

public void setEntryType(String entryType)
Sets the entryType.

Parameters:
entryType - The entryType to set

printBibtex

public void printBibtex(PrintWriter writer)
Description copied from class: BibtexNode
Prints the node to the passed PrintWriter. This method needs to be implemented by each sub-class.

Specified by:
printBibtex in class BibtexNode
Parameters:
writer - The writer that shall be used for writing the String representation of this node.

undefineField

public void undefineField(String fieldName)
Removes the field from this entry.

Parameters:
fieldName - The name of the field that shall be removed.


Copyright © 2011 Hasso Plattner Institute - Chair of Information Systems. All Rights Reserved.