public class PubChemIdentifier extends AbstractIdentifier
The identifier usually only contains numbers. Sometimes the number is preceded by "CID:". To make this identifier more "identifiable" we require the suffix "CID:".
| Modifier and Type | Field and Description |
|---|---|
static Pattern |
PATTERN
The pattern to verify the identifier.
|
| Constructor and Description |
|---|
PubChemIdentifier(String identifier)
Creates a new identifier.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
check(Identifier identifier)
Returns true, if the identifier is valid.
|
static Optional<Identifier> |
find(Collection<Identifier> identifiers)
Searches a valid PubChem identifier in a collection of identifiers and returns it.
|
int |
getConsecutiveNumber()
Returns the consecutive number without the "CID:" part.
|
static Pattern |
getPattern()
Returns the pattern used to validate the identifier.
|
equals, getIdentifier, hashCode, toStringpublic static final Pattern PATTERN
public PubChemIdentifier(String identifier) throws IllegalArgumentException
identifier - The identifier.IllegalArgumentException - If the identifier not valid.public static boolean check(Identifier identifier)
identifier - The identifier.public static Optional<Identifier> find(Collection<Identifier> identifiers)
identifiers - A collection of identifiers.public static Pattern getPattern()
public int getConsecutiveNumber()
Copyright © 2017. All rights reserved.