Original 2.4
[marc4j.git] / src / org / marc4j / marc / Leader.java
1 //$Id: Leader.java,v 1.15 2006/08/04 12:27:36 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 record label in a MARC record.\r
27  * \r
28  * @author Bas Peters\r
29  * @version $Revision: 1.15 $\r
30  * \r
31  */\r
32 public interface Leader extends Serializable {\r
33 \r
34     /**\r
35      * Sets the identifier.\r
36      * \r
37      * <p>\r
38      * The purpose of this identifier is to provide an identifier for\r
39      * persistency.\r
40      * \r
41      * @param id\r
42      *            the identifier\r
43      */\r
44     public void setId(Long id);\r
45 \r
46     /**\r
47      * Returns the identifier.\r
48      * \r
49      * @return Long - the identifier\r
50      */\r
51     public Long getId();\r
52 \r
53     /**\r
54      * Sets the logical record length (positions 00-04).\r
55      * \r
56      * @param recordLength\r
57      *            integer representing the record length\r
58      */\r
59     public void setRecordLength(int recordLength);\r
60 \r
61     /**\r
62      * Sets the record status (position 05).\r
63      * \r
64      * @param recordStatus\r
65      *            character representing the record status\r
66      */\r
67     public void setRecordStatus(char recordStatus);\r
68 \r
69     /**\r
70      * Sets the type of record (position 06).\r
71      * \r
72      * @param typeOfRecord\r
73      *            character representing the type of record\r
74      */\r
75     public void setTypeOfRecord(char typeOfRecord);\r
76 \r
77     /**\r
78      * Sets implementation defined values (position 07-08).\r
79      * \r
80      * @param implDefined1\r
81      *            character array representing the implementation defined data\r
82      */\r
83     public void setImplDefined1(char[] implDefined1);\r
84 \r
85     /**\r
86      * Sets the character encoding scheme (position 09).\r
87      * \r
88      * @param charCodingScheme\r
89      *            character representing the character encoding\r
90      */\r
91     public void setCharCodingScheme(char charCodingScheme);\r
92 \r
93     /**\r
94      * Sets the indicator count (position 10).\r
95      * \r
96      * @param indicatorCount\r
97      *            integer representing the number of indicators present in a\r
98      *            data field\r
99      */\r
100     public void setIndicatorCount(int indicatorCount);\r
101 \r
102     /**\r
103      * Sets the subfield code length (position 11).\r
104      * \r
105      * @param subfieldCodeLength\r
106      *            integer representing the subfield code length\r
107      */\r
108     public void setSubfieldCodeLength(int subfieldCodeLength);\r
109 \r
110     /**\r
111      * Sets the base address of data (positions 12-16).\r
112      * \r
113      * @param baseAddressOfData\r
114      *            integer representing the base address of data\r
115      */\r
116     public void setBaseAddressOfData(int baseAddressOfData);\r
117 \r
118     /**\r
119      * Sets implementation defined values (positions 17-19).\r
120      * \r
121      * @param implDefined2\r
122      *            character array representing the implementation defined data\r
123      */\r
124     public void setImplDefined2(char[] implDefined2);\r
125 \r
126     /**\r
127      * Sets the entry map (positions 20-23).\r
128      * \r
129      * @param entryMap\r
130      *            character array representing the entry map\r
131      */\r
132     public void setEntryMap(char[] entryMap);\r
133 \r
134     /**\r
135      * Returns the logical record length (positions 00-04).\r
136      * \r
137      * @return <code>int</code>- the record length\r
138      */\r
139     public int getRecordLength();\r
140 \r
141     /**\r
142      * Returns the record status (positions 05).\r
143      * \r
144      * @return <code>char</code>- the record status\r
145      */\r
146     public char getRecordStatus();\r
147 \r
148     /**\r
149      * Returns the record type (position 06).\r
150      * \r
151      * @return <code>char</code>- the record type\r
152      */\r
153     public char getTypeOfRecord();\r
154 \r
155     /**\r
156      * Returns implementation defined values (positions 07-08).\r
157      * \r
158      * @return <code>char[]</code>- implementation defined values\r
159      */\r
160     public char[] getImplDefined1();\r
161 \r
162     /**\r
163      * Returns the character coding scheme (position 09).\r
164      * \r
165      * @return <code>char</code>- the character coding scheme\r
166      */\r
167     public char getCharCodingScheme();\r
168 \r
169     /**\r
170      * Returns the indicator count (positions 10).\r
171      * \r
172      * @return <code>int</code>- the indicator count\r
173      */\r
174     public int getIndicatorCount();\r
175 \r
176     /**\r
177      * Returns the subfield code length (position 11).\r
178      * \r
179      * @return <code>int</code>- the subfield code length\r
180      */\r
181     public int getSubfieldCodeLength();\r
182 \r
183     /**\r
184      * Returns the base address of data (positions 12-16).\r
185      * \r
186      * @return <code>int</code>- the base address of data\r
187      */\r
188     public int getBaseAddressOfData();\r
189 \r
190     /**\r
191      * Returns implementation defined values (positions 17-19).\r
192      * \r
193      * @return <code>char[]</code>- implementation defined values\r
194      */\r
195     public char[] getImplDefined2();\r
196 \r
197     /**\r
198      * Returns the entry map (positions 20-23).\r
199      * \r
200      * @return <code>char[]</code>- the entry map\r
201      */\r
202     public char[] getEntryMap();\r
203 \r
204     /**\r
205      * <p>\r
206      * Creates a leader object from a string object.\r
207      * </p>\r
208      * \r
209      * <p>\r
210      * Indicator count and subfield code length are defaulted to 2 if they are\r
211      * not integer values.\r
212      * </p>\r
213      * \r
214      * @param ldr\r
215      *            the leader\r
216      */\r
217     public void unmarshal(String ldr);\r
218 \r
219     /**\r
220      * Creates a string object from this leader object.\r
221      * \r
222      * @return String - the string object from this leader object\r
223      */\r
224     public String marshal();\r
225 \r
226 }\r