Last change
on this file since 8699 was 6287, checked in by cs025, 21 years ago |
Various changes to the METS structures and identifier factories to
move towards updateable structures and to add section support.
|
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
687 bytes
|
Line | |
---|
1 | package org.greenstone.gsdl3.gs3build.metadata;
|
---|
2 |
|
---|
3 | public abstract class AbstractIdentifierFactory
|
---|
4 | {
|
---|
5 | private String idPrelude;
|
---|
6 | private int idSeqNo;
|
---|
7 |
|
---|
8 | public AbstractIdentifierFactory(String idPrelude)
|
---|
9 | { this.idPrelude = idPrelude;
|
---|
10 | this.idSeqNo = 1;
|
---|
11 | }
|
---|
12 |
|
---|
13 | public String getNextIdentifier()
|
---|
14 | { int id = this.idSeqNo ++;
|
---|
15 |
|
---|
16 | return idPrelude + Integer.toString(id);
|
---|
17 | }
|
---|
18 |
|
---|
19 | public void noteIdentifier(String identifier)
|
---|
20 | { if (!identifier.startsWith(this.idPrelude))
|
---|
21 | return;
|
---|
22 |
|
---|
23 | identifier = identifier.substring(this.idPrelude.length());
|
---|
24 |
|
---|
25 | int value = Integer.parseInt(identifier);
|
---|
26 | if (value >= this.idSeqNo) {
|
---|
27 | this.idSeqNo = value + 1;
|
---|
28 | }
|
---|
29 | }
|
---|
30 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.