Bibi
19 Oct 2005 21:04

ujap.bibi
Class SingleField

java.lang.Object
  extended byujap.bibi.SingleField

public class SingleField
extends Object

this class represents a single field in a bibtex entry, e.g. the field with the name "year" and the value "2000". this class helps avoiding different names for fields with the same semantics, e.g. "Author" and "author".


Field Summary
private  String name
           
private  String noWhiteValue
           
private  String value
           
 
Constructor Summary
SingleField()
           
SingleField(String name, String value)
           
SingleField(String author, String[][] names)
           
 
Method Summary
 boolean equals(Object o)
          two SingleFields are equal if the field names are equal - note that the values may still be different!
 String getName()
           
 String getValue()
           
 int hashCode()
          the hashCode of the name, or 0 if name==null
 boolean nearlyEqual(SingleField o)
          if names are equal and values more or less equal
static String noWhitespace(String s)
          remove whitepsace from string (not only at the ends, but overall)
 boolean reallyEqual(SingleField o)
          if names and values are equal
 void setName(String name)
          makes the name lowercase
private  void setRealValue(String value)
           
 void setValue(String value)
          do not call setValue before name has been set!
private  void setValue(String[][] a)
          a special setValue method for author names
private  String toAuthorString(String[][] a)
          Convert author names array into string in bibtex format.
 String toString()
           
static String trim(String s)
          remove superfluous whitespace: multiple spaces, newlines, ...
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private String name

value

private String value

noWhiteValue

private String noWhiteValue
Constructor Detail

SingleField

public SingleField()

SingleField

public SingleField(String author,
                   String[][] names)

SingleField

public SingleField(String name,
                   String value)
            throws ParseException
Method Detail

setName

public void setName(String name)
makes the name lowercase


getName

public String getName()

setValue

public void setValue(String value)
              throws ParseException
do not call setValue before name has been set!

Throws:
ParseException

toAuthorString

private String toAuthorString(String[][] a)
Convert author names array into string in bibtex format. TODO: can be optimized (by Andre).


setValue

private void setValue(String[][] a)
a special setValue method for author names


setRealValue

private void setRealValue(String value)

getValue

public String getValue()

equals

public boolean equals(Object o)
two SingleFields are equal if the field names are equal - note that the values may still be different!


hashCode

public int hashCode()
the hashCode of the name, or 0 if name==null


reallyEqual

public boolean reallyEqual(SingleField o)
if names and values are equal


nearlyEqual

public boolean nearlyEqual(SingleField o)
if names are equal and values more or less equal


noWhitespace

public static String noWhitespace(String s)
remove whitepsace from string (not only at the ends, but overall)


trim

public static String trim(String s)
remove superfluous whitespace: multiple spaces, newlines, ... whitespace at beginning and end. tabs and newlines are replaced with spaces.


toString

public String toString()

Bibi
19 Oct 2005 21:04

Copyright ? 2002-2005 Ute Platzer. All Rights Reserved.