Original 2.4
[marc4j.git] / src / org / marc4j / marc / Subfield.java
1 //$Id: Subfield.java,v 1.11 2006/08/04 12:26:33 bpeters Exp $\r
2 /**\r
3  * Copyright (C) 2004 Bas Peters\r
4  *\r
5  * This file is part of MARC4J\r
6  *\r
7  * MARC4J is free software; you can redistribute it and/or\r
8  * modify it under the terms of the GNU Lesser General Public \r
9  * License as published by the Free Software Foundation; either \r
10  * version 2.1 of the License, or (at your option) any later version.\r
11  *\r
12  * MARC4J is distributed in the hope that it will be useful,\r
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
15  * Lesser General Public License for more details.\r
16  *\r
17  * You should have received a copy of the GNU Lesser General Public \r
18  * License along with MARC4J; if not, write to the Free Software\r
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
20  */\r
21 package org.marc4j.marc;\r
22 \r
23 import java.io.Serializable;\r
24 \r
25 /**\r
26  * Represents a subfield in a MARC record.\r
27  * \r
28  * @author Bas Peters\r
29  * @version $Revision: 1.11 $\r
30  */\r
31 public interface Subfield extends Serializable {\r
32 \r
33     /**\r
34      * Sets the identifier.\r
35      * \r
36      * <p>\r
37      * The purpose of this identifier is to provide an identifier for\r
38      * persistency.\r
39      * \r
40      * @param id\r
41      *            the identifier\r
42      */\r
43     public void setId(Long id);\r
44 \r
45     /**\r
46      * Returns the identifier.\r
47      * \r
48      * @return Long - the identifier\r
49      */\r
50     public Long getId();\r
51 \r
52     /**\r
53      * Returns the data element identifier.\r
54      * \r
55      * @return char - the data element identifier\r
56      */\r
57     public char getCode();\r
58 \r
59     /**\r
60      * Sets the data element identifier.\r
61      * \r
62      * @param code\r
63      *            the data element identifier\r
64      */\r
65     public void setCode(char code);\r
66 \r
67     /**\r
68      * Returns the data element.\r
69      * \r
70      * @return String - the data element\r
71      */\r
72     public String getData();\r
73 \r
74     /**\r
75      * Sets the data element.\r
76      * \r
77      * @param data\r
78      *            the data element\r
79      */\r
80     public void setData(String data);\r
81 \r
82     /**\r
83      * Returns true if the given regular expression matches a subsequence of the\r
84      * data element.\r
85      * \r
86      * See (@link java.util.regex.Pattern} for regular expressions.\r
87      * \r
88      * @param pattern\r
89      *            the regular expression\r
90      * @return true if the pattern matches, false othewise\r
91      */\r
92     public boolean find(String pattern);\r
93 \r
94 }\r