id stringlengths 36 36 | text stringlengths 1 1.25M |
|---|---|
59484725-15b6-4807-a537-50baa69e9c89 | RecieveMsg(SctpChannel clientSocket) {
this.clientSocket = clientSocket;
} |
52a35e66-b3af-4093-8d52-b5b5385b3437 | public static void receiveMessage(SctpChannel clientSock)
throws InterruptedException {
String[] output;
String[] outputVector;
ByteBuffer byteBuffer;
byteBuffer = ByteBuffer.allocate(512);
String messageType = "";
try {
if (running = true) {
MessageInfo messageInfo = clientSock.receive(byteBuffer... |
4638e628-0e04-40d5-896c-83fcd13264d2 | public static String byteToString(ByteBuffer byteBuffer) {
byteBuffer.position(0);
byteBuffer.limit(512);
byte[] bufArr = new byte[byteBuffer.remaining()];
byteBuffer.get(bufArr);
return new String(bufArr);
} |
ed203918-0ee7-4a50-8c31-2bb36acf60cf | @Override
public void run() {
// TODO Auto-generated method stub
while (true) {
try {
receiveMessage(clientSocket);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
} |
38dd2455-8a63-4383-bb77-6c097e569766 | public static void readConnectedTo(String filePath) throws IOException {
BufferedReader br = null;
String sCurrentLine;
String[] output;
ArrayList<TripletData> result = new ArrayList<>();
br = new BufferedReader(new FileReader(filePath));
while (!(sCurrentLine = br.readLine()).equals("END")) {
}
int co... |
b91caef7-95f7-45bf-a70c-9336f2008e5e | public static void readNodeList(String filePath) throws IOException {
BufferedReader br = null;
String sCurrentLine;
String[] output;
ArrayList<TripletData> result = new ArrayList<>();
br = new BufferedReader(new FileReader(filePath));
System.out.println("here");
while (!(sCurrentLine = br.readLine()).equ... |
377dde37-1505-47b1-b1c7-a7afcc14763d | public static void main(String args[]) throws IOException, Exception {
System.out.println("Enter Node Number");
BufferedReader bufferRead = new BufferedReader(new InputStreamReader(
System.in));
myNodeNumber = Integer.parseInt(bufferRead.readLine());
System.out.println("myNodeNumber:" + myNodeNumber);
re... |
97cc1c8d-f68c-4170-b3e5-0b76ff18bf6e | public void checkSortedList()
{
String targetDirectory = System.getProperty("user.dir");
String[] sortedArray = null;
File directory = new File(targetDirectory);
File[] files = directory.listFiles();
int fileSize = files.length;
for (int i = 0; i < fileSize; i++) {
BufferedReader buffer1 = null;
tr... |
72895692-40c5-41ba-b4a5-79375485eaca | public static void main(String[] args) {
CheckFilesSort check = new CheckFilesSort();
check.checkSortedList();
} |
d677c229-7939-40d0-9287-e584384fdf3f | public QuadData() {
} |
33985d71-ed8e-4dd9-b334-3752b58c2251 | public QuadData(int ele, int ts, int i, int j) {
elec = ele;
timeStamp = ts;
indexI = i;
indexJ = j;
} |
0d17b36c-85a0-4737-b268-7da2bf44297b | TripletData() {
} |
1f3a3dea-2978-41dc-ae54-bccd06e85339 | TripletData(int hostName, String ipAddress, int portNo) {
hostName = this.hostName;
ipAddress = this.ipAddress;
portNo = this.portNo;
} |
c648d99d-53a6-4408-8ab8-76ac2e0add3b | public static void sendMessage(SctpChannel clientSock, String Message)
throws IOException {
// System.out.println("Hey Im inside Send Messgae");
// prepare byte buffer to send massage
ByteBuffer sendBuffer = ByteBuffer.allocate(512);
sendBuffer.clear();
// Reset a pointer to point to the start of buffer
... |
8730057b-5611-4dcc-838f-d9dc11684737 | public static void sendMessage2(SctpChannel clientSock, String Message)
throws IOException {
// System.out.println("Hey Im inside Send Messgae");
// prepare byte buffer to send massage
ByteBuffer sendBuffer = ByteBuffer.allocate(512);
sendBuffer.clear();
// Reset a pointer to point to the start of buffer
... |
5ffd22eb-cd40-428b-a9ea-8966790bd0ca | public static void receiveMessage(SctpChannel clientSock) {
ByteBuffer byteBuffer;
byteBuffer = ByteBuffer.allocate(512);
try {
MessageInfo messageInfo = clientSock
.receive(byteBuffer, null, null);
String message = byteToString(byteBuffer);
// System.out.println("Received Message from Server:");
... |
7f8dcee8-dc07-4654-957e-6a321cbc7847 | public static String byteToString(ByteBuffer byteBuffer) {
byteBuffer.position(0);
byteBuffer.limit(512);
byte[] bufArr = new byte[byteBuffer.remaining()];
byteBuffer.get(bufArr);
return new String(bufArr);
} |
11bdaae2-f27a-4220-b521-284e940ffe86 | public void run() {
try {
for (int i = 0; i < MainClass.connectedTo.size(); i++) {
System.out.println("In Client");
InetSocketAddress serverAddr = new InetSocketAddress(
MainClass.connectedTo.get(i).ipAddress,
MainClass.connectedTo.get(i).portNo);
MainClass.ClientSocket.put(
MainClass... |
41abf86a-5da5-404e-8e70-a6894094d611 | public ReqID() {
} |
e5e9f12f-5f00-4d09-a9d7-22ea25d378d1 | public ReqID(int reqO, int reqT) {
reqOrigin = reqO;
reqTime = reqT;
} |
22ae3279-7252-4a62-b639-11c237cd86a4 | @Before
public void setUp() {
r = new Random();
} |
b7191a99-c25b-48c4-b64e-e53932db3a6e | @Test
public void randomizedAddTest() {
for(int i = 1; i <= TESTS_AMOUNT * TESTS_ENABLED; i++) {
BigInteger a = new BigInteger(TESTS_MULTIPLIER * i, r);
BigInteger b = new BigInteger(TESTS_MULTIPLIER * i, r);
UnsignedBigInt c = new UnsignedBigInt(a.toString());
... |
f3b159d2-064a-48f2-8060-fc0c368e6494 | @Test
public void randomizedSubtractTest() {
for(int i = 1; i <= TESTS_AMOUNT * TESTS_ENABLED; i++) {
BigInteger a = new BigInteger(TESTS_MULTIPLIER * i, r);
BigInteger b = new BigInteger(TESTS_MULTIPLIER * i, r);
if(a.compareTo(b) < 0) {
BigInteger swap =... |
dc874734-4b04-483b-81de-4a2c9dcffb0d | @Test
public void randomizedMultiplyTest() {
for(int i = 1; i <= TESTS_AMOUNT * TESTS_ENABLED; i++) {
BigInteger a = new BigInteger(TESTS_MULTIPLIER * i, r);
BigInteger b = new BigInteger(TESTS_MULTIPLIER * i, r);
UnsignedBigInt c = new UnsignedBigInt(a.toString());
... |
f6738758-264e-48ba-8061-a9c73cac2659 | @Test
public void randomizedDivideTest() {
for(int i = 1; i <= TESTS_AMOUNT * TESTS_ENABLED; i++) {
BigInteger a = new BigInteger(TESTS_MULTIPLIER * i, r);
BigInteger b = new BigInteger(TESTS_MULTIPLIER * i, r);
UnsignedBigInt c = new UnsignedBigInt(a.toString());
... |
12663868-8bbf-4d74-845a-aa40705743f6 | @Before
public void setUp() {
a = new UnsignedBigInt(12341234L);
b = new UnsignedBigInt("12341234123412341234123412341234123412341234");
} |
a216d99f-6faf-43bc-b960-2de7e277b503 | @Test
public void testLongConstructor_positiveInt() {
assertEquals(a.longValue(), 12341234L);
} |
699821c2-cbcb-4423-a3f9-b9238f26f768 | @Test
public void testStringConstructor() {
assertEquals(b.toString(), "12341234123412341234123412341234123412341234");
} |
d4b3d394-1cfd-4f3a-b585-18967d806793 | @Test
public void testAdd() {
assertEquals(a.add(b), new UnsignedBigInt("12341234123412341234123412341234123424682468"));
assertEquals(b.add(a), new UnsignedBigInt("12341234123412341234123412341234123424682468"));
} |
5a22dd19-172d-4439-8455-de47021f03f4 | @Test
public void testBiggerThan() {
assertTrue(b.biggerThan(a));
assertTrue(!a.biggerThan(b));
assertTrue(!b.biggerThan(b));
} |
1b3f4dc0-8d1a-49b7-9aa5-8ba333279c61 | @Test
public void testEquals() {
assertTrue(a.equals(a));
assertTrue(b.equals(b));
assertTrue(!a.equals(b));
assertTrue(!b.equals(a));
assertTrue(a.equals(new UnsignedBigInt(a.toString())));
} |
1ea50f3d-26e1-4659-a78c-8c4ee079e627 | @Test
public void testDivide() {
assertEquals(a.divide(a), new UnsignedBigInt("1"));
assertEquals(b.divide(a), new UnsignedBigInt("1000000010000000100000001000000010000"));
} |
dc30e80c-9c29-4aba-97fa-9aed968cebc3 | @Test
public void testLongValue() {
assertEquals(a.longValue(), 12341234L);
} |
3241490b-e58e-4cf4-be5a-cc4a74e36a2f | @Test
public void testMod() {
assertEquals(a.mod(a), new UnsignedBigInt("0"));
assertEquals(b.mod(a), new UnsignedBigInt("1234"));
} |
583fac55-4459-47b8-8502-a8267c38af13 | @Test
public void testModPow() {
assertEquals(b.modPow(new UnsignedBigInt("4"), a), new UnsignedBigInt("3720510"));
assertEquals(b.modPow(a, a), new UnsignedBigInt("1522756"));
} |
1f4a9a18-37ac-43ca-860a-e637d1f52eb3 | @Test
public void testMultiply_basecase() {
assertEquals(a.multiply(a), new UnsignedBigInt("152306056642756"));
} |
7bfe7ffe-eed2-466b-8b0e-47be70d84bf4 | @Test
public void testMultiply_karatsuba() {
UnsignedBigInt c = new UnsignedBigInt("15525180923007089351489794884625025552568860171166966111390520380260509526863768863308784088286464779504877306971310732061715800441148143914442872750411811392044549760208499055502652856315984448252629991937164687508928468538... |
574ab3eb-d6bd-42de-a71d-f14f9c785478 | @Test
public void testPow() {
assertEquals(a.pow(new UnsignedBigInt("0")), new UnsignedBigInt("1"));
assertEquals(a.pow(new UnsignedBigInt("1")), a);
assertEquals(a.pow(new UnsignedBigInt("2")), new UnsignedBigInt("152306056642756"));
assertEquals(a.pow(new UnsignedBigInt("3")), new Unsi... |
2fbb485b-e0bb-43ea-b28e-1b7893d87b58 | @Test
public void testSmallerThan() {
assertTrue(a.smallerThan(b));
assertTrue(!b.smallerThan(a));
assertTrue(!a.smallerThan(a));
} |
04d66572-0423-443a-9ac5-e163201139ee | @Test
public void testSubtract() {
assertEquals(b.subtract(a), new UnsignedBigInt("12341234123412341234123412341234123400000000"));
assertEquals(a.subtract(a), new UnsignedBigInt("0"));
} |
2e02b97a-a5c0-4ea7-ad43-0d022830c473 | @Test
public void testToString() {
assertEquals(a.toString(), "12341234");
assertEquals(b.toString(), "12341234123412341234123412341234123412341234");
} |
101d476c-ab7b-4f99-86df-1b9eba7a05a4 | public UnsignedBigInt(long l) {
this.bits = new BitArray(l);
} |
cd821780-5e7d-4a49-952b-f6dd5ce95e85 | public UnsignedBigInt(String s) {
this();
UnsignedBigInt newBigInt = new UnsignedBigInt();
for(int i = 0; i < s.length(); i++) {
newBigInt = newBigInt.multiply(UnsignedBigInt.TEN);
newBigInt = newBigInt.add(new UnsignedBigInt(Long.parseLong(s.charAt(i) +... |
6a6a61f3-4bc1-4ee6-8d32-7ac0ffc6e718 | public UnsignedBigInt() {
this.bits = new BitArray();
} |
a480a3a3-72af-449f-b9a2-21489b638fe4 | public UnsignedBigInt(UnsignedBigInt b) {
this.bits = new BitArray(b.bits);
} |
8be64a7b-6efd-4942-8f84-892366e17968 | public UnsignedBigInt(BitArray bits) {
this.bits = bits;
} |
4dce619f-e9af-4b3c-b9c6-8445d13887f3 | public UnsignedBigInt add(UnsignedBigInt b) {
UnsignedBigInt result = new UnsignedBigInt();
int carry = 0;
int max = Math.max(this.bits.length(), b.bits.length());
for(int i = 0; i <= max; i++) {
int s = this.bits.getBit(i) + b.bits.getBit(i) + carry;
car... |
2763da41-b023-4ff1-84c6-659a1cb445a9 | public boolean biggerThan(UnsignedBigInt b) {
for(int i = Math.max(this.bits.length(), b.bits.length()); i >= 0; i--) {
if(this.bits.getBit(i) > b.bits.getBit(i)) {
return true;
}
if(this.bits.getBit(i) < b.bits.getBit(i)) {
return false;
... |
6c2d3375-4b53-49d9-8ae2-efeb7b25df97 | @Override
public boolean equals(Object b) {
if(b == null || !(b instanceof UnsignedBigInt)) {
return false;
}
for(int i = Math.max(this.bits.length(), ((UnsignedBigInt)b).bits.length()); i >= 0; i--) {
if(this.bits.getBit(i) > ((UnsignedBigInt)b).bits.getBit(i)) {
... |
c0ca08e5-9063-44d0-a959-f2938aabc973 | public UnsignedBigInt divide(UnsignedBigInt b) {
UnsignedBigInt result[] = this.divideAndRemainder(b);
return result[0];
} |
087e72d6-7aa8-453a-8e10-a9aea0e16abd | public UnsignedBigInt[] divideAndRemainder(UnsignedBigInt b) {
// quotient is in result[0]
// remainder is in result[1]
UnsignedBigInt result[] = new UnsignedBigInt[2];
result[0] = new UnsignedBigInt();
result[1] = new UnsignedBigInt();
for(int i = this.bits.leng... |
eec7ae08-39d0-49a8-9b81-99b4fd9e9669 | public long longValue() {
return this.bits.toLong();
} |
12c865d2-6c6c-4f0b-82ac-ffab153bc424 | public UnsignedBigInt mod(UnsignedBigInt m) {
UnsignedBigInt result[] = this.divideAndRemainder(m);
return result[1];
} |
84eaacb2-2a1a-457d-b14b-1c1b6bad4f30 | public UnsignedBigInt modPow(UnsignedBigInt e, UnsignedBigInt m) {
UnsignedBigInt b = new UnsignedBigInt(this);
UnsignedBigInt exp = new UnsignedBigInt(e);
UnsignedBigInt result = new UnsignedBigInt(UnsignedBigInt.ONE);
while(exp.biggerThan(UnsignedBigInt.ZERO)) {
UnsignedBi... |
871b012a-0b97-4470-aec1-9047f2dba62d | public UnsignedBigInt karatsuba(UnsignedBigInt b) {
int m = (int)Math.ceil(Math.min(this.bits.length(), b.bits.length()) / 2.0);
if(m < 512) {
return this.multiply(b);
}
// TODO: calculate B^m with left shifts instead of multiplications
UnsignedBigIn... |
7d612bcc-2284-4578-be1f-a5e15ea4f980 | public UnsignedBigInt multiply(UnsignedBigInt b) {
UnsignedBigInt result = new UnsignedBigInt();
UnsignedBigInt temp;
for(int i = 0; i < b.bits.length(); i++) {
if(b.bits.getBit(i) > 0) {
temp = new UnsignedBigInt(this);
for(int j = 0; j < i; j++) {
... |
411aae9e-566a-497c-aaf0-d71b82cc1698 | public UnsignedBigInt pow(UnsignedBigInt e) {
UnsignedBigInt b = new UnsignedBigInt(this);
UnsignedBigInt result = new UnsignedBigInt(UnsignedBigInt.ONE);
while(e.biggerThan(UnsignedBigInt.ZERO)) {
if(e.bits.getBit(0) > 0) {
result = result.multiply(b);
... |
29b85792-c77a-41f4-996f-cfcd3ccbab41 | public boolean smallerThan(UnsignedBigInt b) {
for(int i = Math.max(this.bits.length(), b.bits.length()); i >= 0; i--) {
if(this.bits.getBit(i) > b.bits.getBit(i)) {
return false;
}
if(this.bits.getBit(i) < b.bits.getBit(i)) {
return true;
... |
15504c6f-fb5c-40c8-a8f9-2e4b2fe4a528 | public UnsignedBigInt subtract(UnsignedBigInt b) {
UnsignedBigInt result = new UnsignedBigInt();
int borrow = 0;
int max = Math.max(this.bits.length(), b.bits.length());
for(int i = 0; i <= max; i++) {
int s = this.bits.getBit(i) - b.bits.getBit(i) + borrow;
borr... |
540c2a23-9da0-4fd2-82ea-8ae59870cd80 | @Override
public String toString() {
StringBuilder sb = new StringBuilder();
UnsignedBigInt result[] = new UnsignedBigInt[2];
result[0] = new UnsignedBigInt(this);
do {
result = result[0].divideAndRemainder(UnsignedBigInt.TEN);
... |
e87658a6-7c29-4bd2-a58c-a51d2e07847f | public BitArray() {
a = new long[1];
} |
dcbb2339-fa71-4e85-bda4-4a017689b3ff | public BitArray(long l) {
a = new long[1];
a[0] = l;
} |
18822436-f59c-4d61-a09d-0d7f7febb9f0 | public BitArray(BitArray ba) {
a = new long[ba.a.length];
System.arraycopy(ba.a, 0, a, 0, ba.a.length);
} |
aa83fb71-9db0-47f1-aada-7f7d332e9555 | private void expand(int w) {
int size = Math.max(a.length * 2, w + 1);
long[] newArray = new long[size];
System.arraycopy(a, 0, newArray, 0, a.length);
this.a = newArray;
} |
5337755c-1f4a-4d2c-9b0e-0383a0f88943 | public int length() {
for(int i = a.length - 1; i >= 0; i--) {
if(a[i] != 0) {
for(int j = 63; j >= 0; j--) {
if((a[i] & (1L << (j % 64))) != 0) {
return (i * 64) + j + 1;
}
}
}
}
... |
d4041ac6-6ad8-4b50-99ac-ce2e8cd8d1df | public void clear() {
for(int i = 0; i < a.length; i++) {
a[i] = 0;
}
} |
5f80b7a4-71c7-4ccf-8926-9f96e0a04418 | public void setBit(int i, int b) {
int w = (int)Math.floor(i / 64.0f);
if(w >= a.length) {
expand(w);
}
if(b == 1) {
a[w] |= (1L << (i % 64));
} else {
a[w] &= ~(1L << (i % 64));
}
} |
0a69102c-68f4-467c-a180-0cd00f5947a4 | public int getBit(int i) {
int w = (int)Math.floor(i / 64.0f);
if(w >= a.length) {
return 0;
}
return (a[w] & (1L << (i % 64))) == 0 ? 0 : 1;
} |
0954c843-0325-4c4a-8e29-242aafab1338 | public void shiftLeft() {
int lowBit = 0;
int highBit = 0;
for(int i = 0; i < a.length; i++) {
lowBit = highBit;
highBit = getBit((i * 64) + 63);
a[i] <<= 1L;
setBit(i * 64, lowBit);
if(highBit > 0 && i == a.length - 1) {
... |
c709ee1d-2dc8-4185-ad43-9e7b5dfe45d2 | public void shiftLeft64() {
if(Math.floor(length() / 64.0f) >= a.length - 1) {
expand(0);
}
long high = 0;
long low = 0;
for(int i = 0; i < a.length; i++) {
low = high;
high = a[i];
a[i] = low;
}
} |
ac24e8fc-fa96-4b1e-a223-c5b4d55c996c | public void shiftRight() {
int lowBit = 0;
int highBit = 0;
for(int i = a.length - 1; i >= 0; i--) {
highBit = lowBit;
lowBit = getBit(i * 64);
a[i] >>>= 1L;
setBit((i * 64) + 63, highBit);
}
} |
fa169689-b4df-4593-8a7b-54e2700138c2 | @Override
public String toString() {
StringBuilder sb = new StringBuilder();
for(int i = a.length - 1; i >= 0; i--) {
sb.append(" ");
sb.append(String.format("%64s", Long.toBinaryString(a[i])).replace(' ', '0'));
}
return sb.toString().trim();
} |
9dcb4a78-61e7-4f3b-9c10-335c48507df7 | public long toLong() {
return a[0];
} |
407fb1bc-19cc-403b-9b68-f7217b2d85f5 | public static void main(String[] args) {
SecureRandom random = new SecureRandom();
UnsignedBigInt p = new UnsignedBigInt(BigInteger.probablePrime(256, random).toString());
UnsignedBigInt g = new UnsignedBigInt("2");
UnsignedBigInt a = new UnsignedBigInt(BigInteger.prob... |
b72d6047-23d2-484a-9c02-d7974dc230f1 | public static void main (String[] args) {
GroupReader groupReader = createGroupReader(INPUT_FILE);
FileWriter fileWriter = createFileWriter(OUTPUT_FILE);
Dictionary.getInstance().setNGramLength(4); //TODO: magic
if (!loadDictionary()) {
buildDictionary(INPUT_FILE);
... |
771c90e8-9f92-436f-9c88-691513943c87 | private static boolean loadDictionary() {
try {
Dictionary.getInstance().load();
} catch (FileNotFoundException exception) {
System.out.println("Dictionary file not found. Continue.");
return false;
}
return true;
} |
dd65713a-b0fb-4d8a-b20f-83b80bbb0e09 | private static void buildDictionary(String inputFilename) {
try {
Dictionary.getInstance().build(new CsvFileReader(), inputFilename);
} catch (FileNotFoundException exception) {
System.out.println("Dictionary building error. No such file. Exit.");
System.exit(1);
... |
c607e8c2-5c47-4365-8770-a7b56f99f5ad | private static GroupReader createGroupReader(String inputFilename) {
GroupReader reader = new GroupReader(new CsvFileReader());
try {
reader.open(inputFilename);
} catch (FileNotFoundException exception) {
System.out.println("No file \"" + inputFilename + "\" for input. E... |
2dfc457c-e7cd-4530-8f4d-ae1339c12fe2 | private static FileWriter createFileWriter(String outputFilename) {
FileWriter writer = null;
try {
writer = new FileWriter(outputFilename);
} catch (FileNotFoundException exception) {
System.out.println("Output file opening error. Exit.");
System.exit(1);
... |
5dd70f51-d4d8-4e43-a2c8-b91438675bd7 | @Override
public Post next() {
if (hasNext()) {
Entry entry = readNextEntry();
ArrayList<Integer> nGramIds = Dictionary.getInstance().stringToIndexes(entry.message);
for (Integer a : nGramIds) {
if (a == 447) {
int b = 0;
... |
fbf844b5-f5b2-4ddf-a31d-83392f0b9651 | private Entry readNextEntry() {
scanner.useDelimiter("\\s");
int groupId = scanner.nextInt();
int messageId = scanner.nextInt();
long timeStamp = scanner.nextLong();
scanner.useDelimiter("\n|\t");
String message = scanner.next();
return new Entry(groupId, messag... |
b6c7e307-0494-4e6b-bec1-1852e89217f2 | public Entry(int groupId, int messageId, long timeStamp, String message) {
this.groupId = groupId;
this.messageId = messageId;
this.timeStamp = timeStamp;
this.message = message;
} |
8cd05bfd-414c-4558-adec-bbe5a916fff3 | public Pair(A first, B second) {
this.first = first;
this.second = second;
} |
10fe2a0d-fa8c-43df-967c-ba79ffc2a051 | public NGram(String base) {
this.base = base;
} |
a0da1c53-283b-4afc-906c-ada394f93006 | public String getBase() {
return base;
} |
e533e543-b91c-4c82-8d98-10dd840a61b2 | @Override
public boolean equals(Object obj) {
return obj instanceof NGram && ((NGram) obj).base.equals(this.base);
} |
96825955-6ced-4039-bb52-b62a5e88da91 | @Override
public int hashCode() {
return base.hashCode();
} |
e8bd1469-c07d-4a23-bbb2-2ce6efdee053 | @Override
public String toString() {
return base;
} |
3225171e-892a-486b-b6be-11537f1b2725 | public Post(String message, int groupId, Collection<Integer> collection) {
this.message = message;
this.groupId = groupId;
this.nGramIds = new ArrayList<Integer>(collection);
} |
0ccb21d3-5e7d-4cb0-a634-805247575a70 | public String getMessage() {
return message;
} |
aeb548da-8d9b-451f-8da9-d7f4c707763b | public int getGroupId() {
return groupId;
} |
f638187e-34f1-496e-b6d4-3979fe5d097e | public ArrayList<Integer> getNGramIds() {
return nGramIds;
} |
196f5a7c-9acf-4953-a5ec-a115ef7bc354 | public SortedPairs() {
this.list = new ArrayList<Entry<F, S>>();
} |
9c0e4d84-2a7e-42a1-a671-abb355e96708 | public void add(F first, S second) {
list.add(new Entry<F, S>(first, second));
} |
2ad51313-b91a-40c8-962c-81d9a8b5f26d | public Pair<F, S> getPair(int index) {
Entry entry = list.get(index);
return new Pair<F, S>((F) entry.first, (S) entry.second);
} |
82fdd789-5752-4963-aadd-c30c3ecdc7ab | public void remove(int index) {
list.remove(index);
} |
0e645d2c-dcf7-4f99-bf68-14135bfae612 | public void sort() {
Collections.sort(list);
} |
37f156a0-df5c-493c-a9c1-def9e79bac5a | public int size() {
return list.size();
} |
66c7af7e-1a34-464b-840b-6b6077d445bf | @Override
public Iterator<Pair<F, S>> iterator() {
return new Iterator<Pair<F, S>>() {
private Iterator<Entry<F, S>> iterator = list.iterator();
@Override
public boolean hasNext() {
return iterator.hasNext();
}
@Override
... |
65f01a4f-0a21-4364-bdd9-468ef9e35c3a | @Override
public boolean hasNext() {
return iterator.hasNext();
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.