org.marc4j.marc.impl
Class ControlFieldImpl

java.lang.Object
  extended by org.marc4j.marc.impl.VariableFieldImpl
      extended by org.marc4j.marc.impl.ControlFieldImpl
All Implemented Interfaces:
Serializable, Comparable, ControlField, VariableField

public class ControlFieldImpl
extends VariableFieldImpl
implements ControlField

Represents a control field in a MARC record.

Version:
$Revision: 1.4 $
Author:
Bas Peters
See Also:
Serialized Form

Constructor Summary
ControlFieldImpl()
          Creates a new ControlField.
ControlFieldImpl(String tag)
          Creates a new ControlField and sets the tag name.
ControlFieldImpl(String tag, String data)
          Creates a new ControlField and sets the tag name and the data element.
 
Method Summary
 boolean find(String pattern)
          Returns true if the given regular expression matches a subsequence of a data element within the variable field.
 String getData()
          Returns the data element
 Long getId()
          Returns the identifier.
 void setData(String data)
          Sets the data element.
 void setId(Long id)
          Sets the identifier.
 String toString()
          Returns a string representation of this control field.
 
Methods inherited from class org.marc4j.marc.impl.VariableFieldImpl
compareTo, getTag, setTag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.marc4j.marc.VariableField
getTag, setTag
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

ControlFieldImpl

public ControlFieldImpl()
Creates a new ControlField.


ControlFieldImpl

public ControlFieldImpl(String tag)
Creates a new ControlField and sets the tag name.


ControlFieldImpl

public ControlFieldImpl(String tag,
                        String data)
Creates a new ControlField and sets the tag name and the data element.

Method Detail

setData

public void setData(String data)
Description copied from interface: ControlField
Sets the data element.

Specified by:
setData in interface ControlField
Parameters:
data - the data element

getData

public String getData()
Description copied from interface: ControlField
Returns the data element

Specified by:
getData in interface ControlField
Returns:
String - the data element

toString

public String toString()
Returns a string representation of this control field.

Example:

     001 12883376
 

Overrides:
toString in class VariableFieldImpl
Returns:
String - a string representation of this control field

find

public boolean find(String pattern)
Description copied from interface: VariableField
Returns true if the given regular expression matches a subsequence of a data element within the variable field.

See Pattern for more information about Java regular expressions.

Specified by:
find in interface VariableField
Parameters:
pattern - the regular expression
Returns:
true if the pattern matches, false othewise

setId

public void setId(Long id)
Description copied from interface: VariableField
Sets the identifier.

The purpose of this identifier is to provide an identifier for persistency.

Specified by:
setId in interface VariableField
Parameters:
id - the identifier

getId

public Long getId()
Description copied from interface: VariableField
Returns the identifier.

Specified by:
getId in interface VariableField
Returns:
Long - the identifier


Copyright © 2002-2006 Bas Peters. All Rights Reserved.