Package org.marc4j.marc
Class VariableField
- java.lang.Object
-
- org.marc4j.marc.VariableField
-
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
ControlField
,DataField
public abstract class VariableField extends Object implements Serializable, Cloneable
VariableField
defines general behaviour for variable fields.According to the MARC standard the variable fields follow the leader and the directory in the record and consist of control fields and data fields. Control fields precede data fields in the record and are arranged in the same sequence as the corresponding entries in the directory.
- Author:
- Bas Peters
- See Also:
ControlField
,DataField
, Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
VariableField()
Default constructor.protected
VariableField(String tag)
Creates a newVariableField
for the supplied tag.protected
VariableField(VariableField other)
Copy constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract Object
clone()
Deprecated.Use copy constructorVariableField(VariableField)
abstract boolean
equals(Object obj)
abstract boolean
find(Pattern pattern)
Returnstrue
is the supplied regular expression pattern matches theVariablefield
data; else,false
.Long
getId()
String
getTag()
Returns the tag name.abstract int
hashCode()
void
setId(Long id)
void
setTag(String tag)
Registers the tag name.
-
-
-
Field Detail
-
EMPTY_ID
public static final Long EMPTY_ID
Empty value for the field id
-
-
Constructor Detail
-
VariableField
protected VariableField()
Default constructor.
-
VariableField
protected VariableField(String tag)
Creates a new
VariableField
for the supplied tag.- Parameters:
tag
- the tag name
-
VariableField
protected VariableField(VariableField other)
Copy constructor. Copy id attribute, so if you don't want has the same, use setId(VariableField.EMPTY_ID) with the new created instance.- Parameters:
other
- another Variablefield where copy the values
-
-
Method Detail
-
setTag
public void setTag(String tag)
Registers the tag name.
- Parameters:
tag
- the tag name
-
getTag
public String getTag()
Returns the tag name.
- Returns:
String
- the tag name
-
getId
public Long getId()
- Returns:
- Returns the id field value.
-
setId
public void setId(Long id)
- Parameters:
id
- The new id value.
-
find
public abstract boolean find(Pattern pattern)
Returnstrue
is the supplied regular expression pattern matches theVariablefield
data; else,false
.- Parameters:
regex
- A regular expression pattern to find in the subfields
-
clone
@Deprecated public abstract Object clone()
Deprecated.Use copy constructorVariableField(VariableField)
-
-