public class ArrayConverters extends Object
Constructor and Description |
---|
ArrayConverters() |
Modifier and Type | Method and Description |
---|---|
static int[] |
combineIntegers(int[] twoByteIntArray,
int[] fourByteIntArray)
Combine integer arrays.
|
static int[] |
convertByteToIntegers(byte[] byteArray)
Convert a byte array containing two bytes to integers in an integer array.
|
static int[] |
convertCharToIntegers(char[] charArray)
Convert a char array to an integer array using the ASCII code for characters
|
static int[] |
convertFloatsToInts(float[] floatArray,
float floatMultiplier)
Convert an integer array to a float array by multiplying by a float.
|
static int[] |
convertFourByteToIntegers(byte[] byteArray)
Convert a byte array containing four bytes to integers in an integer array.
|
static byte[] |
convertIntegersToBytes(int[] intArray)
Convert an integer array to byte array, where each integer is encoded by a
single byte.
|
static byte[] |
convertIntegersToFourByte(int[] intArray)
Convert an integer array to byte array, where each integer is encoded by a
four bytes.
|
static byte[] |
convertIntegersToTwoBytes(int[] intArray)
Convert an integer array to byte array, where each integer is encoded by a
two bytes.
|
static char[] |
convertIntegerToChar(int[] integerArray)
Convert an integer array to a char array.
|
static float[] |
convertIntsToFloats(int[] intArray,
float floatDivider)
Convert an integer array to a float array by dividing by a float.
|
static byte[] |
convertShortsToTwoBytes(short[] shortArray)
Convert a short array to byte array, where each short is encoded by a
two bytes.
|
static short[] |
convertTwoBytesToShorts(byte[] byteArray)
Convert to byte integers to a short array.
|
static int[] |
convertTwoByteToIntegers(byte[] byteArray)
Convert a byte array containing two bytes to integers in an integer array.
|
static String[] |
decodeChainList(byte[] currentChainList,
int length)
Find all the chain ids from a single byte array.
|
static byte[] |
encodeChainList(String[] chainNames,
int length)
Convert the chain names to a byte array.
|
static int[] |
recursiveIndexDecode(int[] in)
Decodes an input array of integers following a Recursive Indexing strategy.
|
static int[] |
recursiveIndexEncode(int[] in)
Encodes an input array of integers following a Recursive Indexing strategy
(uses a reduced alphabet with fixed limits).
|
static List<int[]> |
splitIntegers(int[] inputArray)
Convert an input array of integers to two arrays.
|
public static String[] decodeChainList(byte[] currentChainList, int length)
currentChainList
- the byte array of the chain list input.length
- the number of bytes array takespublic static float[] convertIntsToFloats(int[] intArray, float floatDivider)
intArray
- the input integer array to be dividedfloatDivider
- the float divider to divide the integers by.public static int[] convertByteToIntegers(byte[] byteArray)
byteArray
- the input byte arraypublic static int[] convertTwoByteToIntegers(byte[] byteArray)
byteArray
- the input byte arraypublic static short[] convertTwoBytesToShorts(byte[] byteArray)
byteArray
- the input byte arraypublic static int[] convertFourByteToIntegers(byte[] byteArray)
byteArray
- the input byte arraypublic static int[] combineIntegers(int[] twoByteIntArray, int[] fourByteIntArray)
twoByteIntArray
- an array of integersfourByteIntArray
- an array of integers in pairs. The first in the pair
is to be added to the output array. The second in the pair is the number of
integers to read from the first array.public static char[] convertIntegerToChar(int[] integerArray)
integerArray
- the input integer arraypublic static byte[] convertIntegersToBytes(int[] intArray)
intArray
- the input array of integerspublic static byte[] convertIntegersToTwoBytes(int[] intArray)
intArray
- the input array of integerspublic static byte[] convertShortsToTwoBytes(short[] shortArray)
shortArray
- the input array of integerspublic static byte[] convertIntegersToFourByte(int[] intArray)
intArray
- the input array of integerspublic static int[] convertFloatsToInts(float[] floatArray, float floatMultiplier)
floatArray
- the input float array to be converted to intsfloatMultiplier
- the float divider to multiply the floats by.public static List<int[]> splitIntegers(int[] inputArray)
inputArray
- the array of integers to be split.public static int[] convertCharToIntegers(char[] charArray)
charArray
- the input character arraypublic static byte[] encodeChainList(String[] chainNames, int length)
chainNames
- the list of chain names as stringlength
- max length of chars in a stringpublic static int[] recursiveIndexEncode(int[] in)
in
- the array of integer values to be encodedpublic static int[] recursiveIndexDecode(int[] in)
in
- the array of integer values to be decodedCopyright © 2015–2016 RCSB PDB. All rights reserved.