org.marc4j.marc
Class Tag

java.lang.Object
  |
  +--org.marc4j.marc.Tag

public class Tag
extends Object

Tag defines behaviour for a MARC tag.

A MARC tag is a three character string used to identify an associated variable field. According to the MARC standard the tag may consist of ASCII numeric characters (decimal integers 0-9) and/or ASCII alphabetic characters (uppercase or lowercase, but not both).

Version:
$Revision: 1.5 $
Author:
Bas Peters

Constructor Summary
Tag()
           
 
Method Summary
static boolean isControlField(String tag)
          Returns true if the tag identifies a control field.
static boolean isControlNumberField(String tag)
          Returns true if the tag identifies a control number field.
static boolean isDataField(String tag)
          Returns true if the tag identifies a data field.
static boolean isValid(String tag)
          Returns true if the given value is a valid tag value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tag

public Tag()
Method Detail

isValid

public static boolean isValid(String tag)

Returns true if the given value is a valid tag value.

The method returns true if the tag contains three alphabetic or numeric ASCII graphic characters.

Note: mixing uppercase and lowercase letters is not validated.

Parameters:
tag - the tag name

isControlNumberField

public static boolean isControlNumberField(String tag)

Returns true if the tag identifies a control number field.

The method returns false if the tag does not equals 001.

Parameters:
tag - the tag name
Returns:
boolean - tag identifies a control number field (true) or not (false)

isControlField

public static boolean isControlField(String tag)

Returns true if the tag identifies a control field.

The method returns false if the tag does not begin with two zero's.

Parameters:
tag - the tag name
Returns:
boolean - tag identifies a control field (true) or a data field (false)

isDataField

public static boolean isDataField(String tag)

Returns true if the tag identifies a data field.

The method returns false if the tag begins with two zero's.

Parameters:
tag - the tag name
Returns:
boolean - tag identifies a data field (true) or a control field (false)


Copyright 2001-2003 Bas Peters. All Rights Reserved.