set standard number classes to public

This commit is contained in:
Jörg Prante 2017-02-02 21:34:33 +01:00
parent 0615ba539d
commit 0f01172f4d
15 changed files with 42 additions and 46 deletions

View file

@ -26,7 +26,7 @@ import java.util.regex.Pattern;
* See link:http://tools.ietf.org/html/draft-kunze-ark-18[ARK IETF RFC, window='_blank'],
* link:http://www.cdlib.org/services/uc3/docs/jak_ARKs_Berlin_2012.pdf[10 years ARK, window='_blank']
*/
class ARK extends StandardNumber implements Cloneable, Comparable<ARK> {
public class ARK extends StandardNumber implements Cloneable, Comparable<ARK> {
private static final Pattern PATTERN = Pattern.compile("[\\p{Graph}\\p{Punct}]{0,48}");
@ -34,15 +34,10 @@ class ARK extends StandardNumber implements Cloneable, Comparable<ARK> {
private URI uri;
protected ARK() {
public ARK() {
super("ark");
}
@Override
public int compareTo(ARK ark) {
return ark != null ? normalizedValue().compareTo(ark.normalizedValue()) : -1;
}
@Override
public ARK set(CharSequence value) {
super.set(value);
@ -112,9 +107,12 @@ class ARK extends StandardNumber implements Cloneable, Comparable<ARK> {
@Override
public Collection<String> getTypedVariants() {
return Arrays.asList(
type().toUpperCase() + " " + format(),
type().toUpperCase() + " " + normalizedValue());
return Arrays.asList(type().toUpperCase() + " " + format(), type().toUpperCase() + " " + normalizedValue());
}
@Override
public int compareTo(ARK ark) {
return ark != null ? normalizedValue().compareTo(ark.normalizedValue()) : -1;
}
@Override

View file

@ -42,7 +42,7 @@ import java.util.regex.Pattern;
* and the context of use. The DOI system provides, within networks of DOI applications,
* for unique identification, persistence, resolution, metadata and semantic interoperability.
*/
class DOI extends StandardNumber implements Cloneable, Comparable<DOI> {
public class DOI extends StandardNumber implements Cloneable, Comparable<DOI> {
private static final Pattern DOI_PATTERN =
Pattern.compile("\\b10\\.\\d{4}([.][0-9]+)*/[a-z0-9/\\-.()<>_:;\\\\]+\\b");
@ -56,15 +56,10 @@ class DOI extends StandardNumber implements Cloneable, Comparable<DOI> {
private URI httpDxDoi;
protected DOI() {
public DOI() {
super("doi");
}
@Override
public int compareTo(DOI doi) {
return doi != null ? normalizedValue().compareTo(doi.normalizedValue()) : -1;
}
@Override
public DOI createChecksum(boolean checksum) {
return this;
@ -141,6 +136,11 @@ class DOI extends StandardNumber implements Cloneable, Comparable<DOI> {
}
}
@Override
public int compareTo(DOI doi) {
return doi != null ? normalizedValue().compareTo(doi.normalizedValue()) : -1;
}
@Override
public boolean equals(Object object) {
return object instanceof DOI && value.equals(((DOI) object).value);

View file

@ -12,13 +12,13 @@ import java.util.regex.Pattern;
* Numbers encoded in UPC and EAN barcodes are known as
* Global Trade Item Numbers (GTIN).
*/
class EAN extends StandardNumber implements Cloneable, Comparable<EAN> {
public class EAN extends StandardNumber implements Cloneable, Comparable<EAN> {
private static final Pattern PATTERN = Pattern.compile("\\b[\\p{Digit}\\s]{13,18}\\b");
private boolean createWithChecksum;
protected EAN() {
public EAN() {
super("ean");
}

View file

@ -40,13 +40,13 @@ import java.util.regex.Pattern;
*
* See link:http://www.gtin.info/[GTIN info, window='_blank']
*/
class GTIN extends StandardNumber implements Cloneable, Comparable<GTIN> {
public class GTIN extends StandardNumber implements Cloneable, Comparable<GTIN> {
private static final Pattern PATTERN = Pattern.compile("\\b[\\p{Digit}\\-]{3,18}\\b");
private boolean createWithChecksum;
protected GTIN() {
public GTIN() {
super("gtin");
}

View file

@ -18,7 +18,7 @@ import java.util.regex.Pattern;
*
* Checksum calculation is in accordance to ISO 7064 MOD-97.
*/
class IBAN extends StandardNumber implements Cloneable, Comparable<IBAN> {
public class IBAN extends StandardNumber implements Cloneable, Comparable<IBAN> {
/**
* Norway = 15, Malta = 31 + "IBAN ".
@ -57,7 +57,7 @@ class IBAN extends StandardNumber implements Cloneable, Comparable<IBAN> {
private boolean createWithChecksum;
protected IBAN() {
public IBAN() {
super("iban");
}

View file

@ -44,7 +44,7 @@ import javax.xml.stream.events.XMLEvent;
* link:http://www.iana.org/assignments/urn-namespaces[The IANA URN assignments, window='_blank'],
* link:https://www.isbn-international.org/range_file_generation[ISBN prefix generation, window='_blank']
*/
class ISBN extends StandardNumber implements Cloneable, Comparable<ISBN> {
public class ISBN extends StandardNumber implements Cloneable, Comparable<ISBN> {
private static final Pattern PATTERN = Pattern.compile("[\\p{Digit}xX\\p{Pd}]{10,17}");
@ -60,7 +60,7 @@ class ISBN extends StandardNumber implements Cloneable, Comparable<ISBN> {
private boolean isEAN;
protected ISBN() {
public ISBN() {
super("isbn");
}

View file

@ -24,13 +24,13 @@ import java.util.regex.Pattern;
*
* See link:http://www.ismn-international.org/download/Web_ISMN%20Manual_2008-3.pdf[ISMN Manual 2008, window='_blank']
*/
class ISMN extends StandardNumber implements Cloneable, Comparable<ISMN> {
public class ISMN extends StandardNumber implements Cloneable, Comparable<ISMN> {
private static final Pattern PATTERN = Pattern.compile("[\\p{Digit}M\\p{Pd}]{0,17}");
private boolean createWithChecksum;
protected ISMN() {
public ISMN() {
super("ismn");
}

View file

@ -15,9 +15,9 @@ import java.util.regex.Pattern;
* and newspaper articles. Such an identifier consists of 16 numerical digits divided
* into four blocks.
*
* Checksum calculation is in accordance to ISO/IEC 7064:2003, MOD 11-2
* Checksum calculation is in accordance to ISO/IEC 7064:2003, MOD 11-2.
*/
class ISNI extends StandardNumber implements Cloneable, Comparable<ISNI> {
public class ISNI extends StandardNumber implements Cloneable, Comparable<ISNI> {
private static final Pattern PATTERN = Pattern.compile("[\\p{Digit}xX\\p{Pd}\\s]{16,24}");
@ -27,7 +27,7 @@ class ISNI extends StandardNumber implements Cloneable, Comparable<ISNI> {
private boolean createWithChecksum;
protected ISNI() {
public ISNI() {
super("isni");
}

View file

@ -1,7 +1,5 @@
package org.xbib.standardnumber;
import org.xbib.standardnumber.checksum.iso7064.MOD1110;
import java.util.Arrays;
import java.util.Collection;
import java.util.regex.Matcher;
@ -57,7 +55,7 @@ import java.util.regex.Pattern;
* These particularities themselves necessitated the introduction
* of the ISSN.
*/
class ISSN extends StandardNumber implements Cloneable, Comparable<ISSN> {
public class ISSN extends StandardNumber implements Cloneable, Comparable<ISSN> {
private static final Pattern PATTERN = Pattern.compile("[0-9]{4}\\p{Pd}?[0-9]{3}[0-9xX]");
@ -65,7 +63,7 @@ class ISSN extends StandardNumber implements Cloneable, Comparable<ISSN> {
private boolean createWithChecksum;
protected ISSN() {
public ISSN() {
super("issn");
}

View file

@ -25,7 +25,7 @@ import java.util.regex.Pattern;
*
* Checksum algorithm is ISO 7064 MOD 16/3.
*/
class ISTC extends StandardNumber implements Cloneable, Comparable<ISTC> {
public class ISTC extends StandardNumber implements Cloneable, Comparable<ISTC> {
private static final Pattern PATTERN = Pattern.compile("^[\\p{Alnum}\\p{Pd}\\s]{12,24}");
@ -33,7 +33,7 @@ class ISTC extends StandardNumber implements Cloneable, Comparable<ISTC> {
private boolean createWithChecksum;
protected ISTC() {
public ISTC() {
super("istc");
}

View file

@ -22,13 +22,13 @@ import java.util.regex.Pattern;
* the system will deal with duplicate registrations by linking such registration records
* in the ISWC database.
*/
class ISWC extends StandardNumber implements Cloneable, Comparable<ISWC> {
public class ISWC extends StandardNumber implements Cloneable, Comparable<ISWC> {
private static final Pattern PATTERN = Pattern.compile("[\\p{Alnum}\\p{Pd}\\s]{10,13}");
private String formatted;
protected ISWC() {
public ISWC() {
super("iswc");
}

View file

@ -9,9 +9,9 @@ import java.net.URI;
*
* Checksum calculation is according to ISO/IEC 7064:2003, MOD 11-2.
*/
class ORCID extends ISNI {
public class ORCID extends ISNI {
protected ORCID() {
public ORCID() {
super("orcid");
}

View file

@ -11,7 +11,7 @@ import java.util.regex.Pattern;
* A catalog record numbering system, uniquely identifying records, used by PICA
* (Project voor geIntegreerde Catalogus Automatisering) integrated library systems.
*/
class PPN extends StandardNumber implements Cloneable, Comparable<PPN> {
public class PPN extends StandardNumber implements Cloneable, Comparable<PPN> {
private static final Pattern PATTERN = Pattern.compile("[\\p{Digit}]{3,10}\\p{Pd}{0,1}[\\p{Digit}xX]{1}\\b");
@ -19,7 +19,7 @@ class PPN extends StandardNumber implements Cloneable, Comparable<PPN> {
private boolean createWithChecksum;
protected PPN() {
public PPN() {
super("ppn");
}

View file

@ -22,13 +22,13 @@ import java.util.regex.Pattern;
* All of these data structures follow the global GS1 specification which bases on
* international standards.
*/
class UPC extends StandardNumber implements Cloneable, Comparable<UPC> {
public class UPC extends StandardNumber implements Cloneable, Comparable<UPC> {
private static final Pattern PATTERN = Pattern.compile("[\\p{Digit}]{0,12}");
private boolean createWithChecksum;
protected UPC() {
public UPC() {
super("upc");
}

View file

@ -16,7 +16,7 @@ import java.util.regex.Pattern;
* See link:http://support.d-nb.de/iltis/onlineRoutinen/Pruefziffernberechnung.htm[Prüfziffernberechnung in ILTIS, window='_blank'],
* link:https://wiki.dnb.de/pages/viewpage.action?pageId=48139522[DNB Wiki, window='_blank']
*/
class ZDB extends StandardNumber implements Cloneable, Comparable<ZDB> {
public class ZDB extends StandardNumber implements Cloneable, Comparable<ZDB> {
private static final Pattern PATTERN = Pattern.compile("^[\\p{Digit}]{2,10}\\p{Pd}{0,1}[\\p{Digit}xX]{1}\\b");
@ -24,7 +24,7 @@ class ZDB extends StandardNumber implements Cloneable, Comparable<ZDB> {
private boolean createWithChecksum;
protected ZDB() {
public ZDB() {
super("zdb");
}