public class ISBN extends StandardNumber implements java.lang.Cloneable, java.lang.Comparable<ISBN>
ISO 2108 International Standard Book Number (ISBN), Z39.50 BIB-1 Use Attribute 7.
The International Standard Book Number is a 13-digit number that uniquely identifies books and book-like products published internationally.
The purpose of the ISBN is to establish and identify one title or edition of a title from one specific publisher and is unique to that edition, allowing for more efficient marketing of products by booksellers, libraries, universities, wholesalers and distributors.
Every ISBN consists of thirteen digits and whenever it is printed it is preceded by the letters ISBN. The thirteen-digit number is divided into four parts of variable length, each part separated by a hyphen.
This class is based upon the ISBN converter and formatter class by Openly Informatics, Inc.
See The ISBN Users' Manual, The IETF URN Charter, The IANA URN assignments, ISBN prefix generation
type, value
Constructor and Description |
---|
ISBN() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Returns a clone if the implementation is cloneable.
|
int |
compareTo(ISBN isbn) |
ISBN |
createChecksum(boolean createWithChecksum)
Indicate that a correct check sum should be computed.
|
ISBN |
ean(boolean eanPreferred)
Prefer European Article Number (EAN, ISBN-13).
|
boolean |
equals(java.lang.Object object) |
java.lang.String |
format()
Get printable representation of this standard book number.
|
java.lang.String |
getCountryAndPublisherCode()
Get country and publisher code.
|
static StandardNumber |
getInstance(java.lang.Package thePackage,
java.lang.ClassLoader classLoader,
java.lang.String type) |
static StandardNumber |
getInstance(java.lang.String type) |
java.util.Collection<java.lang.String> |
getTypedVariants() |
int |
hashCode() |
boolean |
isEAN() |
boolean |
isValid()
Check for this ISBN number validity.
|
ISBN |
normalize()
Normalize the value by removing all unwanted characters or
replacing characters with the ones required for verification.
|
java.lang.String |
normalizedValue()
Get the normalized value of this standard book number.
|
ISBN |
reset() |
ISBN |
verify()
Verify the number.
|
set, type
public ISBN createChecksum(boolean createWithChecksum)
StandardNumber
Indicate that a correct check sum should be computed.
createChecksum
in class StandardNumber
createWithChecksum
- if checksum is includedpublic int compareTo(ISBN isbn)
compareTo
in interface java.lang.Comparable<ISBN>
public ISBN normalize()
StandardNumber
Normalize the value by removing all unwanted characters or replacing characters with the ones required for verification.
normalize
in class StandardNumber
public boolean isValid()
Check for this ISBN number validity.
isValid
in class StandardNumber
public ISBN verify()
StandardNumber
Verify the number.
verify
in class StandardNumber
public java.lang.String normalizedValue()
Get the normalized value of this standard book number.
normalizedValue
in class StandardNumber
public java.lang.String format()
Get printable representation of this standard book number.
format
in class StandardNumber
public ISBN reset()
reset
in class StandardNumber
public java.util.Collection<java.lang.String> getTypedVariants()
getTypedVariants
in class StandardNumber
public boolean isEAN()
public ISBN ean(boolean eanPreferred)
Prefer European Article Number (EAN, ISBN-13).
eanPreferred
- true if EAN should be preferredpublic java.lang.String getCountryAndPublisherCode()
Get country and publisher code.
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
- if this is called on an
implementation that does not support `Cloneable`public static StandardNumber getInstance(java.lang.String type) throws NoSuchStandardNumberException
NoSuchStandardNumberException
public static StandardNumber getInstance(java.lang.Package thePackage, java.lang.ClassLoader classLoader, java.lang.String type) throws NoSuchStandardNumberException
NoSuchStandardNumberException