public class BinaryVectorDescriptorImpl extends Object implements BinaryVectorDescriptor
Note that compatibility of instances is enforced by checking the guard object references. It is expected that all parameters (endianness, length) should match for the instances having the same guard object reference associated.
Guarded.EnsureThat, Guarded.New
Constructor and Description |
---|
BinaryVectorDescriptorImpl(BitSet fp,
Object guardObject,
int size,
BinaryVectors.Endianness endianness)
Constructor.
|
BinaryVectorDescriptorImpl(byte[] serialized,
Object guardObject,
int size)
|
BinaryVectorDescriptorImpl(byte[] serialized,
Object guardObject,
int size,
BinaryVectors.Endianness endianness)
Construct from serialized form.
|
BinaryVectorDescriptorImpl(int[] fp,
Object guardObject,
int size)
|
BinaryVectorDescriptorImpl(int[] fp,
Object guardObject,
int size,
BinaryVectors.Endianness endianness)
Constructor.
|
BinaryVectorDescriptorImpl(long[] fp,
Object guardObject,
int size)
Deprecated.
Use
BinaryVectorDescriptorImpl(long[], java.lang.Object, int, com.chemaxon.descriptors.common.BinaryVectors.Endianness)
with explicit endianness specification |
BinaryVectorDescriptorImpl(long[] fp,
Object guardObject,
int size,
BinaryVectors.Endianness endianness)
Construct from a long array representation.
|
BinaryVectorDescriptorImpl(String decimalString,
Object guardObject,
int size,
BinaryVectors.Endianness endianness)
Construct from decimal String representation.
|
Modifier and Type | Method and Description |
---|---|
int |
calculateDarkness()
Calculate the darkness of this fingerprint.
|
int[] |
getFP()
Get integer array representation of this fingerprint.
|
BitSet |
getFpAsBitset()
Get BitSet representation of this fingerprint.
|
byte[] |
getFpAsBytes()
Convert to byte array.
|
long[] |
getFpAsLongs()
Get long array representation of this fingerprint.
|
Object |
getGuardObject()
Gets the guard object associated to the generated descriptors/utilities.
|
byte[] |
serialize()
Deprecated.
Use
getFpAsBytes() |
String |
toBinaryString()
Converts the fingerprint into a binary string containing '0' and '1' characters without further delimiters.
|
String |
toDecimalString()
Deprecated.
|
String |
toIntDecimalString()
Converts the fingerprints integer array representation into a tab separated string.
|
String |
toLongDecimalString()
Converts the fingerprints long array representation into a tab separated string.
|
String |
toString() |
public BinaryVectorDescriptorImpl(BitSet fp, Object guardObject, int size, BinaryVectors.Endianness endianness)
fp
- Fingerprint to representguardObject
- Associated guard objectsize
- Fingerprint size in bitsendianness
- Endianness of packing operationspublic BinaryVectorDescriptorImpl(int[] fp, Object guardObject, int size, BinaryVectors.Endianness endianness)
fp
- Fingerprint to representguardObject
- Associated guard objectsize
- Fingerprint sizeendianness
- Endianness of packing operations@Deprecated public BinaryVectorDescriptorImpl(int[] fp, Object guardObject, int size)
BinaryVectorDescriptorImpl(int[], java.lang.Object, int, com.chemaxon.descriptors.common.BinaryVectors.Endianness)
fp
- Fingerprint to representguardObject
- Associated guard objectsize
- Fingerprint sizepublic BinaryVectorDescriptorImpl(long[] fp, Object guardObject, int size, BinaryVectors.Endianness endianness)
fp
- Fingerprint to representguardObject
- Associated guard objectsize
- Fingerprint size; expected to be multiply of 64 (bits in a long
value)endianness
- Endianness of packing operations@Deprecated public BinaryVectorDescriptorImpl(long[] fp, Object guardObject, int size)
BinaryVectorDescriptorImpl(long[], java.lang.Object, int, com.chemaxon.descriptors.common.BinaryVectors.Endianness)
with explicit endianness specification
Note that endianness of the long
- int
conversion is not specified. To retrieve the
long
array representation use getFpAsLongs()
.
fp
- Fingerprint to representguardObject
- Associated guard objectsize
- Fingerprint size; expected to be multiply of 64 (bits in a long
value)public BinaryVectorDescriptorImpl(byte[] serialized, Object guardObject, int size, BinaryVectors.Endianness endianness)
Byte array serialized form.
serialized
- Serialized formguardObject
- Associated guard objectsize
- Expected fingerprint sizeendianness
- Endianness of packing operations@Deprecated public BinaryVectorDescriptorImpl(byte[] serialized, Object guardObject, int size)
BinaryVectorDescriptorImpl(byte[], java.lang.Object, int, com.chemaxon.descriptors.common.BinaryVectors.Endianness)
Byte array serialized form.
serialized
- Serialized formguardObject
- Associated guard objectsize
- Expected fingerprint sizepublic BinaryVectorDescriptorImpl(String decimalString, Object guardObject, int size, BinaryVectors.Endianness endianness)
decimalString
- Decimal String representationguardObject
- Associated guard objectsize
- Expected fingerprint sizeendianness
- Endianness of packing operationspublic int[] getFP()
BinaryVectorDescriptor
The returned array might be the the internal representation array so changing the values is forbidden. Please note that this behavior is not guaranteed, the returned array can be a non cached copy of the represented binary vector generated on every invocation.
getFP
in interface BinaryVectorDescriptor
public Object getGuardObject()
Guarded
This method is intended to use only for ensuring the compatibility of manipulated objects.
Implementations might use the associated DescriptorGenerator
or DescriptorParameters
reference as
the guard object, however it is a non recommended practice to use this method to access the associated generator
to perform further operations on it.
getGuardObject
in interface Guarded
null
.public byte[] getFpAsBytes()
BinaryVectorDescriptor
getFpAsBytes
in interface BinaryVectorDescriptor
@Deprecated public byte[] serialize()
getFpAsBytes()
public int calculateDarkness()
BinaryVectorDescriptor
Please note that the returned value is not necessarily cached, so the calculation might be executed for multiple consecutive invocations.
calculateDarkness
in interface BinaryVectorDescriptor
public String toIntDecimalString()
BinaryVectorDescriptor
toIntDecimalString
in interface BinaryVectorDescriptor
public String toLongDecimalString()
BinaryVectorDescriptor
toLongDecimalString
in interface BinaryVectorDescriptor
@Deprecated public String toDecimalString()
toIntDecimalString()
public String toBinaryString()
The first bit is the least significant bit of the first integer value of the integer representation.
toBinaryString
in interface BinaryVectorDescriptor
public long[] getFpAsLongs()
BinaryVectorDescriptor
The returned array might be the the internal representation array so changing the values is forbidden. Please note that this behavior is not guaranteed, the returned array can be a non cached copy of the represented binary vector generated on every invocation.
getFpAsLongs
in interface BinaryVectorDescriptor
public BitSet getFpAsBitset()
BinaryVectorDescriptor
getFpAsBitset
in interface BinaryVectorDescriptor