| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.marc4j.marc.Subfield
Subfield defines behaviour for a subfield (a data
 element within a data field).  
A subfield consists of a delimiter followed by a data element identifier (together the subfield code) and a data element. The structure of a data element according to the MARC standard is as follows:
DELIMITER DATA_ELEMENT_IDENTIFIER DATA_ELEMENT
This structure is returned by the marshal()
 method.
| Constructor Summary | |
| Subfield()Default constructor | |
| Subfield(char code,
         char[] data)Creates a new Subfieldinstance and registers the
 data element identifier and the data element. | |
| Subfield(char code,
         String data)Creates a new Subfieldinstance and registers the
 data element identifier and the data element. | |
| Method Summary | |
|  char | getCode()Returns the data element identifier. | 
|  char[] | getData()Returns the data element. | 
|  String | marshal()Returns a Stringrepresentation for a data element
 following the structure of a MARC data element. | 
|  void | setCode(char code)Registers the data element identifier. | 
|  void | setData(char[] data)Registers the data element. | 
|  void | setData(String data)Registers the data element. | 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
public Subfield()
public Subfield(char code,
                char[] data)
Creates a new Subfield instance and registers the
 data element identifier and the data element.
code - the data element identifierdata - the data element
public Subfield(char code,
                String data)
Creates a new Subfield instance and registers the
 data element identifier and the data element.
code - the data element identifierdata - the data element| Method Detail | 
public void setCode(char code)
Registers the data element identifier.
code - the data element identifier
IllegalIdentifierException - when the data element identifier
                                    is not a valid data element
                                    identifierpublic void setData(char[] data)
Registers the data element.
data - the data elementpublic void setData(String data)
Registers the data element.
data - the data elementpublic char getCode()
Returns the data element identifier.
char - the data element identifierpublic char[] getData()
Returns the data element.
char[] - the data elementpublic String marshal()
Returns a String representation for a data element
 following the structure of a MARC data element.
String - the data element| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||