public class TokenPairCount extends Pair<String> implements ReadWriteable
| Modifier and Type | Field and Description |
|---|---|
boolean |
isSingle |
long |
paircount
Number of times this pair appears together
|
| Constructor and Description |
|---|
TokenPairCount() |
TokenPairCount(String tok1) |
TokenPairCount(String tok1,
String tok2) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(TokenPairCount that) |
String |
asciiHeader()
Header for ascii input.
|
byte[] |
binaryHeader()
Header for binary input.
|
String |
identifier() |
String |
identifier(long time) |
byte[] |
identifierBinary(long time)
Generate a byte array identifier with some time stamp included.
|
static IndependentPair<Long,TokenPairCount> |
parseTimeTokenID(String string)
Given a string, extract the time and TokenPairCount assuming the format:
time + TokenPairCount#TIMESPLIT +
identifier() |
void |
readASCII(Scanner in)
Read internal state from in.
|
void |
readBinary(DataInput in)
Read internal state from in.
|
static long |
timeFromBinaryIdentity(byte[] bytes) |
static long |
timeFromBinaryIdentity(byte[] bytes,
int start,
int length) |
String |
toString() |
void |
writeASCII(PrintWriter out)
Write the content of this as ascii to out.
|
void |
writeBinary(DataOutput out)
Write the content of this as binary to out.
|
equals, firstObject, getFirst, getFirstFunction, getFirstObject, getSecond, getSecondFunction, getSecondObject, pair, pairList, secondObject, setFirstObject, setSecondObject, swap, swapListpublic long paircount
public boolean isSingle
public TokenPairCount()
public TokenPairCount(String tok1, String tok2)
tok1 - tok2 - public TokenPairCount(String tok1)
public void readBinary(DataInput in) throws IOException
ReadableBinaryreadBinary in interface ReadableBinaryin - source to read from.IOException - an error reading inputpublic byte[] binaryHeader()
ReadableBinarybinaryHeader in interface ReadableBinarybinaryHeader in interface WriteableBinarypublic void writeBinary(DataOutput out) throws IOException
WriteableBinarywriteBinary in interface WriteableBinaryout - sink to write toIOException - an error writing to outpublic void add(TokenPairCount that)
public String identifier()
public void readASCII(Scanner in) throws IOException
ReadableASCIIreadASCII in interface ReadableASCIIin - source to read from.IOException - an error reading inputpublic String asciiHeader()
ReadableASCIIasciiHeader in interface ReadableASCIIasciiHeader in interface WriteableASCIIpublic void writeASCII(PrintWriter out) throws IOException
WriteableASCIIwriteASCII in interface WriteableASCIIout - sink to write toIOException - an error writing to outpublic static IndependentPair<Long,TokenPairCount> parseTimeTokenID(String string) throws IOException
identifier()string - IOExceptionpublic String identifier(long time)
public byte[] identifierBinary(long time) throws IOException
writeBinary(DataOutput)time - TokenPairCountIOExceptionpublic static long timeFromBinaryIdentity(byte[] bytes) throws IOException
IOExceptionpublic static long timeFromBinaryIdentity(byte[] bytes, int start, int length) throws IOException
IOException