query stringlengths 7 33.1k | document stringlengths 7 335k | metadata dict | negatives listlengths 3 101 | negative_scores listlengths 3 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
Moving on the x axis. | @Override
public void keyPressed(KeyEvent e)
{
if((e.getKeyCode() == KeyEvent.VK_D) || e.getKeyCode() == (KeyEvent.VK_RIGHT))
pl.moveXspeed += pl.accelXspeed;
else if(e.getKeyCode() == (KeyEvent.VK_A) || e.getKeyCode() == (KeyEvent.VK_LEFT))
pl.moveXspeed -= pl.accelXspeed;
// Moving on the y axis.
if(e.getKeyCode() == (KeyEvent.VK_W) || e.getKeyCode() == (KeyEvent.VK_UP))
pl.moveYspeed -= pl.accelYspeed;
else if(e.getKeyCode() == (KeyEvent.VK_S) || e.getKeyCode() == (KeyEvent.VK_DOWN))
pl.moveYspeed += pl.accelYspeed;
else
{
}
if (GameOn == true){
}
else if (GameOn == false )
{
repaint();
Data = " Number of rockets remaining: " + pl.NumRockets
+ "Number of bullets remaining: " +pl.NumBullets
+ " Remaining health: " +pl.Health
+" Number of runway enemies: " + RunAwayEnemies
+ " Number of destroyed enemies: " +DestroyedEnemies;
Email = new EmailGUI(Data);
}
/* else if (WinsState == true )
{
repaint();
//*******************stoip game here and send email with game details
Data = " Number of rockets remaining: " + pl.NumRockets +","
+ " Number of bullets remaining: " +pl.NumBullets+","
+ " Remaining health: " +pl.Health+","
+ " Number of destroyed enemies: " +DestroyedEnemies+","
+" Number of runway enemies: " + RunAwayEnemies;
Email = new EmailGUI(Data);
}*/
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void moveX() {\n\t\tsetX( getX() + getVx() );\n\t}",
"default void setX(double x)\n {\n getAxis().setX(x);\n }",
"@Override\n\tpublic void move_x() {\n\t\tif(mX < 0){\n\t \tdirection *= -1 ;\n\t \t setScale(-1, 1);\n\t }else if (mX > activity.getCameraWidth()-64){\n\t ... | [
"0.74132025",
"0.7226093",
"0.6941805",
"0.68606496",
"0.6853636",
"0.6844175",
"0.67547977",
"0.6725182",
"0.6714239",
"0.67106324",
"0.6660837",
"0.6659342",
"0.6559533",
"0.65507406",
"0.6527701",
"0.65116286",
"0.6496821",
"0.6489641",
"0.64865863",
"0.64838403",
"0.64717... | 0.0 | -1 |
actions performed when mouse button 1 is pressed | @Override
public void mouseClicked(MouseEvent e) {
if (e.getButton() == MouseEvent.BUTTON1)
{
if (pl.NumBullets > 0)
{
//creates shoot and adds the to the list
pl.Shoot();
BulletFired = true;
bul = new Bullet(pl.GetXCoord() + 240,pl.GetYCoord() + 70);
BulletList.add(bul);
}
else if (pl.NumBullets <= 0)
{
GameOn = false;
}
}
//actions performed when mouse button 2 is pressed
if (e.getButton() == MouseEvent.BUTTON3)
{
if (pl.NumRockets > 0)
{
//creates rockets and adds the to the list
pl.FireRocket();
RocketFired = true;
rock = new Rocket(pl.GetXCoord() + 200,pl.GetYCoord() + 60);
RocketList.add(rock);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void button1MousePressed(MouseEvent e) {\n }",
"private void button1MouseClicked(MouseEvent e) {\n\t}",
"private void button1MouseClicked(MouseEvent e) {\n }",
"@Override\r\n\tpublic void mousePressed(MouseEvent me) {\r\n\t\tbuttonType = me.getButton();\r\n\t\tselect(me.getX(), me.getY());\r\n\... | [
"0.80218303",
"0.7982676",
"0.77292126",
"0.7695602",
"0.7628193",
"0.7597237",
"0.7515748",
"0.75007385",
"0.75007385",
"0.7494752",
"0.74668676",
"0.74613297",
"0.7456509",
"0.7437708",
"0.74164355",
"0.74164355",
"0.74164355",
"0.73991287",
"0.7389358",
"0.73861754",
"0.73... | 0.0 | -1 |
creates an instance of the enemy | private void createEnemyHelicopter()
{
RandNum = 0 + (int)(Math.random()*700);
int xCoordinate = 1400;
int yCoordinate = RandNum;
eh = new Enemy(xCoordinate,yCoordinate);
// Add created enemy to the list of enemies.
EnemyList.add(eh);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void createEnemy()\n {\n scorpion = new Enemy(\"Giant Scorpion\", 5, 10); \n rusch = new Enemy(\"Mr. Rusch\", 10, 1000);\n skeleton = new Enemy(\"Skeleton\", 10, 50);\n zombie = new Enemy(\"Zombie\", 12, 25);\n ghoul = new Enemy(\"Ghoul\", 15, 45);\n ghost = new Enemy(\"Gh... | [
"0.8206479",
"0.7490035",
"0.74602467",
"0.7180185",
"0.70509255",
"0.6965897",
"0.6909685",
"0.68582785",
"0.6767977",
"0.6741716",
"0.6739295",
"0.6671588",
"0.66391003",
"0.6630459",
"0.6575376",
"0.65281844",
"0.64888036",
"0.64882606",
"0.64787024",
"0.646625",
"0.642827... | 0.74084705 | 3 |
Updates all enemies. Move the enemy and checks if it has left the screen. Checks whether enemy was destroyed. Checks whether any enemy collided with player. | private void updateEnemies()
{
for(int i = 0; i < EnemyList.size(); i++)
{
//get and update enemy for the enemy list
Enemy eh = EnemyList.get(i);
eh.Update();
//checks for enemy and player crashes
Rectangle playerRectangel = new Rectangle(pl.xCoord, pl.yCoord, pl.PlayerImage.getWidth(), pl.PlayerImage.getHeight());
Rectangle enemyRectangel = new Rectangle(eh.xCoord, eh.yCoord, eh.EnemyHelicopterImage.getWidth(), eh.EnemyHelicopterImage.getHeight());
if(playerRectangel.intersects(enemyRectangel)){
//set player health to zero
pl.Health = 0;
// Remove helicopter from the list.
EnemyList.remove(i);
//creates new explosion coordinates
enExplosionX = eh.xCoord;
enExplosionY = eh.yCoord;
plExplosionX = pl.xCoord+120;
plExplosionY = pl.yCoord;
GameOn = false;
}
// Check health.
if(eh.Health <= 0){
// Increase the number of destroyed enemies and removes a helicopter froma list.
DestroyedEnemies++;
if(DestroyedEnemies == 10)
{
//WinsState = true;
}
EnemyList.remove(i);
}
// If the current enemy has left the scree it is removed from the list and the number of runAwayEnemies is increased.
if(eh.HasLeftScreen())
{
EnemyList.remove(i);
RunAwayEnemies++;
}
if(RunAwayEnemies > 5)
{
GameOn = false;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void updateEnemies() {\n for (Map.Entry<Integer, Enemy> entry :enemies.entrySet()) {\n entry.getValue().update(mainPlayerPosX, mainPlayerPosY);\n if (entry.getValue().isDead()) {\n enemiesSize--;\n }\n }\n }",
"void updateEnemies() {\n ... | [
"0.7935792",
"0.7682164",
"0.7438727",
"0.6774161",
"0.6770253",
"0.67663074",
"0.67088705",
"0.6684497",
"0.66774225",
"0.66383374",
"0.66321033",
"0.6631174",
"0.65375674",
"0.64812213",
"0.64596885",
"0.6459037",
"0.64552885",
"0.64360195",
"0.638755",
"0.6371865",
"0.6339... | 0.79611355 | 0 |
Update bullets. It moves bullets. Checks whether the bullet has left the screen. Checks whether the bullets hit an enemy or not. | private void UpdateBullets()
{
for(int i = 0; i < BulletList.size(); i++)
{
Bullet bullet = BulletList.get(i);
// Move the bullet.
bullet.Update();
// checks if the bullet has it left the screen
if(bullet.HasLeftScreen()){
BulletList.remove(i);
continue;
}
// checks if the bullet hit the enemy
Rectangle BulletRectangle = new Rectangle((int)bullet.xCoord, (int)bullet.yCoord, bullet.BulletImage.getWidth(), bullet.BulletImage.getHeight());
// Go trough all enemies.
for(int j = 0; j < EnemyList.size(); j++)
{
Enemy eh = EnemyList.get(j);
Rectangle EnemyRectangel = new Rectangle(eh.xCoord, eh.yCoord, eh.EnemyHelicopterImage.getWidth(), eh.EnemyHelicopterImage.getHeight());
// Checks whether the the bullet has hit the enemy
if(BulletRectangle.intersects(EnemyRectangel))
{
// Bullet hit the enemy so we reduce his health.
eh.Health -= Bullet.DamagePower;
// Bullet was also destroyed so we remove it.
BulletList.remove(i);
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void update() {\n for (int i = 0; i < bullets.size(); i++) {//if any bullets expires remove it\n if (bullets.get(i).off) {\n bullets.remove(i);\n i--;\n }\n }\n move();//move everything\n checkPositions();//check if anything has been s... | [
"0.771319",
"0.741776",
"0.73979664",
"0.72704697",
"0.70813704",
"0.7004785",
"0.68094397",
"0.67985386",
"0.6775275",
"0.6773134",
"0.6746208",
"0.6746192",
"0.67010754",
"0.6636765",
"0.66283554",
"0.66245687",
"0.6563331",
"0.65623057",
"0.65588605",
"0.654165",
"0.653277... | 0.82402515 | 0 |
Update rockets. It moves rocket and add smoke behind it. Checks whether the rocket has left the screen. Checks whether any rocket is hit any enemy. | private void UpdateRockets()
{
for(int i = 0; i < RocketList.size(); i++)
{
Rocket rocket = RocketList.get(i);
// Moves the rocket.
rocket.Update();
// Checks if it the rocket has left the screen.
if(rocket.HasLeftScreen())
{
RocketList.remove(i);
}
// Checks if current rocket hit any enemy.
if( HasRocketHitEnemy(rocket) )
// Removes the rocket
RocketList.remove(i);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void checkRockets() {\n for (Rocket rocket : rockets) {\n for (Ufo ufo : ufos) {\n if (ufo.intersects(rocket)) {\n ufo.die();\n rocket.die();\n }\n }\n\n if (rocket.getY() <= 0)\n rocke... | [
"0.58884573",
"0.5873013",
"0.559507",
"0.55443275",
"0.54739755",
"0.544614",
"0.54151773",
"0.53953624",
"0.53254473",
"0.5324741",
"0.52972865",
"0.52840495",
"0.528066",
"0.5279545",
"0.5269064",
"0.52434283",
"0.5241604",
"0.5224888",
"0.52208865",
"0.52208817",
"0.52155... | 0.71811837 | 0 |
Checks if the given rocket is hit any of enemy helicopters. | private boolean HasRocketHitEnemy(Rocket rocket)
{
boolean HitEnemy = false;
Rectangle rocketRectangle = new Rectangle(rocket.xCoord, rocket.yCoord,rocket.RocketImage.getWidth(), rocket.RocketImage.getHeight());
// Go through all enemies.
for(int j = 0; j < EnemyList.size(); j++)
{
Enemy eh = EnemyList.get(j);
// Current enemy rectangle.
Rectangle enemyRectangel = new Rectangle(eh.xCoord, eh.yCoord, eh.EnemyHelicopterImage.getWidth(), eh.EnemyHelicopterImage.getHeight());
// Is current rocket over current enemy?
if(rocketRectangle.intersects(enemyRectangel))
{
HitEnemy = true;
// Rocket hit the enemy so we reduce his health.
eh.Health -= rocket.damagePower;
// Rocket hit enemy so we don't need to check other enemies.
break;
}
}
return HitEnemy;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void checkHits() {\n\t\t// your code here\n\t\tfor (int i = 0; i < enemyX.length; i++) {\n\t\t\tif (distance((int)xI, (int)yI, enemyX[i], enemyY[i]) <= DIAM_ENEMY/2 + DIAM_LAUNCHER/2) {\n\t\t\t}\n\t\t}\n\t}",
"boolean collidesEnemy() {\n for(int i = 0; i < barrage.size(); i++) {\n ... | [
"0.6731204",
"0.65164095",
"0.64096385",
"0.6251347",
"0.6148555",
"0.6089368",
"0.60871124",
"0.60424715",
"0.60297817",
"0.5954685",
"0.59300613",
"0.58789754",
"0.5874352",
"0.58054733",
"0.5800298",
"0.5770003",
"0.57490706",
"0.5734914",
"0.57342637",
"0.5700848",
"0.567... | 0.78331393 | 0 |
Draws all game images | protected void paintComponent(Graphics g)
{
super.paintComponent(g);
//drawing the background
g.drawImage(BackGround, 0, 0, null);
//if(GameOn == true)
//{
//calling the paint function of the game characters
pl.paint(g);
for(int i = 0 ; i < EnemyList.size(); i++)
{
EnemyList.get(i).paint(g);
}
//drawing the explosions
g.drawImage(Explosion, enExplosionX, enExplosionY, null);
g.drawImage(Explosion, plExplosionX, plExplosionY, null);
font = new Font("LCD", Font.BOLD, 25);
g.setFont(font);
//g.drawString("Time: " + formatTime(gameTime), 0, 615);
g.drawString("Rockets Remaining: " + pl.NumRockets, 0, 635);
g.drawString("Bullets Remaining: " + pl.NumBullets, 0, 655);
g.drawString("Enemies Destroyed: " + DestroyedEnemies, 0, 675);
g.drawString("Runaway Enemies: " + RunAwayEnemies, 0, 695);
//}
if(BulletFired = true)
{
for(int i = 0; i < BulletList.size();i++)
{
BulletList.get(i).paint(g);
}
}
if(RocketFired = true)
{
for(int i = 0; i < RocketList.size();i++)
{
RocketList.get(i).paint(g);
}
}
if(GameOn == false){
g.drawImage(GameOver, 200, 0, null);
//g.drawString("Enemies Destroyed: " + DestroyedEnemies, 250, 10);
}
else if (WinsState == true )
{
g.drawImage(GameWin, 200, 0, null);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void drawImages() {\n\t\t\r\n\t}",
"private void drawGame(){\n drawBackGroundImage();\n drawWalls();\n drawPowerups();\n drawBullet();\n }",
"public void draw(){\n\t\tStdDraw.picture(this.xxPos,this.yyPos,\"images/\"+this.imgFileName);\n\t}",
"private void render() {\n ... | [
"0.83027697",
"0.79937464",
"0.7349116",
"0.72533584",
"0.72083956",
"0.7169849",
"0.71517175",
"0.6999607",
"0.6928163",
"0.6901576",
"0.69004905",
"0.68860674",
"0.68825686",
"0.68779844",
"0.6819272",
"0.6760946",
"0.673378",
"0.6718626",
"0.6716919",
"0.6714916",
"0.66718... | 0.0 | -1 |
Writes the currents game stats to a binary file | public void WiriteToBinary() throws IOException
{
DataOutputStream Output = new DataOutputStream (new FileOutputStream("GameProgress.dat", true));
//*************************************information to send using smtp
Output.write(pl.xCoord);
Output.write(pl.yCoord);
Output.write(pl.NumRockets);
Output.write(pl.NumBullets);
Output.write(pl.Health);
Output.write(DestroyedEnemies);
Output.write(RunAwayEnemies);
for (int i = 0 ; i < EnemyList.size(); i++ )
{
Output.write(EnemyList.get(i).xCoord);
Output.write(EnemyList.get(i).xCoord);
Output.write(EnemyList.get(i).Health);
}
Output.close();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void saveStats() {\r\n\t\tif(Main.optionsCheckbox.getState()) FileUtils.exportGameOptions();\r\n\t\t\r\n\t\tif(Main.isFourHandedTeams) {\r\n\t\t\tif(Main.team1Checkbox.getState()) FileUtils.exportTeamFile(Main.teamOne);\r\n\t\t\tif(Main.team2Checkbox.getState()) FileUtils.exportTeamFile(Main.teamTwo)... | [
"0.71963125",
"0.68947107",
"0.6886871",
"0.66852176",
"0.6632148",
"0.6593409",
"0.65733105",
"0.6505053",
"0.6496206",
"0.64069366",
"0.63891727",
"0.6364614",
"0.63548833",
"0.6351927",
"0.6349311",
"0.63079983",
"0.6299017",
"0.6295236",
"0.6294295",
"0.62513417",
"0.6222... | 0.7059873 | 1 |
Reads the currents game stats from a binary file | public void ReadFromBinary() throws IOException
{
DataInputStream Input = new DataInputStream(new FileInputStream("GameProgress.dat"));
pl.xCoord = Input.read();
pl.xCoord = Input.read();
pl.NumRockets = Input.read();
pl.NumBullets = Input.read();
pl.Health =Input.read();
DestroyedEnemies =Input.read();
RunAwayEnemies =Input.read();
int x, y = 0;
for (int i = 0 ; i < EnemyList.size(); i++ )
{
x = Input.read();
y = Input.read();
eh = new Enemy(x,y);
EnemyList.add(eh);
}
Input.close();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void loadGameStats(Player player) throws FileNotFoundException {\n gameStatsReader = new BufferedReader(new FileReader(\"src/main/resources/stats/gamestats.txt\"));\n try {\n player.getGameStats().setAttacks(Integer.parseInt(gameStatsReader.readLine()));\n player.g... | [
"0.66196626",
"0.60682416",
"0.59473634",
"0.57442147",
"0.56772053",
"0.5671603",
"0.5649447",
"0.56404006",
"0.5638209",
"0.55988324",
"0.55632573",
"0.556052",
"0.5548689",
"0.5543208",
"0.5542965",
"0.55275923",
"0.5517386",
"0.55161357",
"0.55098534",
"0.54459465",
"0.54... | 0.6508131 | 1 |
method for heal method testing. | @Test
public void whenDoctorHealThenCorrectDescription() {
Treatment treatment = new Treatment();
treatment.setDrug("Аспирин", "125-6");
treatment.setProcedure("Массаж", 10);
Doctor doctor = new Doctor("Алексей Петрович", "СПбГУ", 3650, treatment);
Patient patient = new Patient();
patient.setName("Антон");
String result = doctor.heal(patient);
String expectString = "Алексей Петрович лечит Антон";
assertThat(result, is(expectString));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void heal(Heros h);",
"public void heal(int healAmount){\r\n health+= healAmount;\r\n }",
"public void heal() {\n delegate.heal();\n }",
"public void heal(){\n\t\thp += potion.getHpBoost();\n\t\tif(hp > max_hp)hp = max_hp;\n\t}",
"@Override\n\tpublic void heal() {\n\t\tboolean canHeal;\... | [
"0.7858827",
"0.7695189",
"0.7604803",
"0.75100595",
"0.75090367",
"0.74339813",
"0.7364095",
"0.73088205",
"0.7236234",
"0.7234015",
"0.7175396",
"0.7027721",
"0.6996787",
"0.6951713",
"0.6898153",
"0.68437696",
"0.68277943",
"0.67811286",
"0.67229974",
"0.6703102",
"0.66537... | 0.0 | -1 |
Parse the file and output in ".igv" format | public void convert(File inputFile, File outputFile) throws IOException {
setType(inputFile);
BufferedReader reader = null;
PrintWriter writer = null;
try {
reader = new BufferedReader(new FileReader(inputFile));
writer = new PrintWriter(new BufferedWriter(new FileWriter(outputFile)));
String nextLine = null;
// Skip meta data. Note for GCT files this includes the mandatory first line
while ((nextLine = reader.readLine()).startsWith("#") && (nextLine != null)) {
writer.println(nextLine);
}
// This is the first non-meta line
writer.println(nextLine);
// for TAB and RES files the first row contains the column headings.
int nCols = 0;
if (type == FileType.TAB || type == FileType.RES) {
nCols = nextLine.split("\t").length;
}
if (type == FileType.GCT) {
// GCT files. Column headings are 3rd row (read next line)
nextLine = reader.readLine();
nCols = nextLine.split("\t").length;
writer.println(nextLine);
} else if (type == FileType.RES) {
// Res files -- skip lines 2 and 3
writer.println(reader.readLine());
writer.println(reader.readLine());
}
// Compute the # of data points
int columnSkip = 1;
if (type == FileType.RES) {
columnSkip = 2;
nCols++; // <= last call column of a res file is sometimes blank, if not this will get
}
nPts = (nCols - dataStartColumn) / columnSkip;
// Now for the data
while ((nextLine = reader.readLine()) != null) {
String[] tokens = nextLine.split("\t");
for (int i = 0; i < dataStartColumn; i++) {
writer.print(tokens[i] + "\t");
}
DataRow row = new DataRow(tokens, nextLine);
for (int i = 0; i < nPts; i++) {
if (Double.isNaN(row.scaledData[i])) {
writer.print("\t");
} else {
writer.print(row.scaledData[i]);
if (type == FileType.RES) {
writer.print("\t" + row.calls[i]);
}
if (i < nPts - 1) {
writer.print("\t");
}
}
}
writer.println();
}
}
finally {
if (reader != null) {
reader.close();
}
if (writer != null) {
writer.close();
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static String getIGVExtension(String path) {\n\n // String off gzip first\n if (path.endsWith(\".gz\")) path = path.substring(0, path.length() - 3);\n\n // Now common qualifiers\n if (path.endsWith(\".txt\") || path.endsWith(\".xls\")) path = path.substring(0, path.length() - 4);... | [
"0.56798315",
"0.5557617",
"0.5491803",
"0.5307464",
"0.5294974",
"0.52312666",
"0.5114316",
"0.50712264",
"0.50429803",
"0.5000527",
"0.49942064",
"0.4993905",
"0.4968992",
"0.49399826",
"0.48772404",
"0.48688385",
"0.4849317",
"0.4807805",
"0.47554845",
"0.47479233",
"0.469... | 0.43791097 | 77 |
validation for k and string length | public static int maxSubStringSizeKDistinctChars(String str, int k) {
int start = 0;
int maxLen = 0;
int localSum = 0;
HashMap<Character, Integer> hm = new HashMap<>();
for(int end = 0; end < str.length(); end++) {
localSum++;
if (hm.containsKey(str.charAt(end))) {
hm.put(str.charAt(end), hm.get(str.charAt(end)) + 1);
} else {
hm.put(str.charAt(end), 1);
}
while(hm.size() > k) {
// maxLen = Math.max(maxLen, end - start);
maxLen = Math.max(maxLen, localSum - 1);
hm.put(str.charAt(start), hm.get(str.charAt(start)) - 1);
if(hm.get(str.charAt(start)) == 0) {
hm.remove(str.charAt(start));
}
start++;
localSum--;
}
}
return Math.max(maxLen, localSum);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void validate(String s, int length, String msg) {\n Logger.getLogger(getClass()).info(\"valore della stringa inserita\"+s);\n \tif (s != null && s.length()>length)\n throw new IllegalArgumentException(msg);\n }",
"public boolean isValidPalindrome(String s, int k) {\n int n = ... | [
"0.645189",
"0.6417806",
"0.6397077",
"0.6380624",
"0.6368808",
"0.6316062",
"0.62716395",
"0.60862464",
"0.6066836",
"0.60625803",
"0.6050986",
"0.60181695",
"0.6015288",
"0.6000637",
"0.59583247",
"0.59375215",
"0.588191",
"0.58724695",
"0.5864214",
"0.5840092",
"0.58286476... | 0.6239478 | 7 |
check if a job in the queue is done | boolean isDone(long number) throws NoSuchJobException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isDone();",
"public boolean isDone();",
"boolean isDone();",
"boolean hasFinished();",
"public boolean isDone(){\r\n\t\tif(worker.getState()==Thread.State.TERMINATED) return true;\r\n\t\treturn false;\r\n\t}",
"public boolean isDone() { return true; }",
"protected boolean isAllJobsFinish... | [
"0.7197324",
"0.7197324",
"0.7139734",
"0.7066612",
"0.70477796",
"0.6977059",
"0.69692737",
"0.69115436",
"0.68701905",
"0.68660825",
"0.68528473",
"0.68259215",
"0.68033594",
"0.6771938",
"0.6706633",
"0.6706187",
"0.67033386",
"0.6689793",
"0.66837394",
"0.6672949",
"0.666... | 0.7561757 | 0 |
Add a job to the queue | void put( long number,Future<T> t); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addJob(String name, JobInProgress job) {\n Queue<JobInProgress> queue = queues.get(name);\n if (null != queue)\n queue.addJob(job);\n }",
"@Override\n public void pipeStepQueueJob(final Job job) {\n synchronized(jobs_queue) {\n pipeStepLog(\"Queuing JO... | [
"0.77380764",
"0.7626499",
"0.7376506",
"0.71404994",
"0.7068605",
"0.6992445",
"0.68056065",
"0.6755601",
"0.66199696",
"0.65960467",
"0.6568895",
"0.6478909",
"0.6440794",
"0.6440387",
"0.633042",
"0.6328836",
"0.6320404",
"0.6285971",
"0.6261707",
"0.6183698",
"0.6162745",... | 0.0 | -1 |
Return the amount of jobs remaining in the queue | int remains(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public int queueLength() {\n return this.job_queue.size();\n }",
"public int queueSize() {\n\t\treturn queue.size();\t\n\t}",
"public int queueSize() {\n return executor.getQueue().size();\n }",
"public int size(){\r\n\t\treturn queue.size();\r\n\t}",
"long getExcutorTask... | [
"0.78045654",
"0.7508764",
"0.74538493",
"0.7450142",
"0.7441278",
"0.74403083",
"0.74009204",
"0.7373301",
"0.736181",
"0.73556846",
"0.7330397",
"0.73235035",
"0.7297441",
"0.7258423",
"0.7170157",
"0.71541256",
"0.71541256",
"0.71541256",
"0.7153289",
"0.707045",
"0.705108... | 0.0 | -1 |
test put and get | public void testPutGetWMS() {
initCache();
//test a cache put and get
WMSTile wco1 = getDefaultWMSCacheObject("q1", 100, true);
wmsCache.put(wco1.getQuery(), wco1.getColourmode(), PointType.POINT_001, wco1);
WMSTile wco2 = getDefaultWMSCacheObject("q2", 100, true);
wmsCache.put(wco2.getQuery(), wco2.getColourmode(), PointType.POINT_001, wco2);
//test get returns the correct object
assertTrue(compareWMSObjects(wmsCache.get(wco1.getQuery(), wco1.getColourmode(), PointType.POINT_001), wco1));
assertTrue(compareWMSObjects(wmsCache.get(wco2.getQuery(), wco2.getColourmode(), PointType.POINT_001), wco2));
//get from cache an object that does not exist returns a placeholder
WMSTile wcop = wmsCache.get("", "", PointType.POINT_00001);
assertNotNull(wcop);
assertTrue(!wcop.getCached());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void putTest(){\n Map<String, Object> putRequestMap = new HashMap<>();\n putRequestMap.put(\"title\", \"Title 3\");\n putRequestMap.put(\"body\", \"Body 3\");\n\n given().contentType(ContentType.JSON)\n .body(putRequestMap)\n .pathParam(\"... | [
"0.68479466",
"0.6837224",
"0.6802931",
"0.67672694",
"0.6745401",
"0.6488087",
"0.6453102",
"0.6444768",
"0.6415685",
"0.6412539",
"0.64085215",
"0.6395766",
"0.6381701",
"0.6344605",
"0.63382226",
"0.6290388",
"0.62769353",
"0.62626153",
"0.6233996",
"0.6222347",
"0.6182642... | 0.58693415 | 43 |
test cache size management 1. when > cache size records put, nulls will be returned until cachecleaner has done its job. | public void testSizeManagementWMS() {
initCache();
ArrayList<WMSTile> wcos = new ArrayList<WMSTile>();
long putSize = 0;
long maxSize = 0;
int cacheSizeDropCount = 0;
for (int i = 0; i < 1000; i++) {
WMSTile wco = getDefaultWMSCacheObject("q" + i, 50, true);
putSize += wco.getSize();
wcos.add(wco);
long size = wmsCache.getSize();
if (size < maxSize) {
maxSize = size;
cacheSizeDropCount++;
} else {
maxSize = size;
}
boolean result = wmsCache.put(wco.getQuery(), wco.getColourmode(), PointType.POINT_1, wco);
//test if cache is full the put was unsuccessful
//allow for cachecleaner to have reduced the size between put and test
boolean test = (wmsCache.getSize() + wco.getSize() > wmsCache.getMaxCacheSize()) == !result;
if (test == false) {
assertTrue((size + wco.getSize() > wmsCache.getMaxCacheSize()) == !result);
}
assertTrue(wmsCache.getSize() <= wmsCache.getMaxCacheSize());
}
//test size calcuations are operating
assertTrue(putSize > 10000);
//test cache cleaner was run more than once
assertTrue(cacheSizeDropCount > 1);
//test cache size is under max
assertTrue(wmsCache.getSize() <= wmsCache.getMaxCacheSize());
//test gets. Anything that is a placeholder will be null.
int cachedCount = 0;
for (int i = 0; i < wcos.size(); i++) {
WMSTile getwco = wmsCache.get(wcos.get(i).getQuery(), wcos.get(i).getColourmode(), PointType.POINT_1);
if (getwco.getCached()) {
assertTrue(compareWMSObjects(wcos.get(i), getwco));
cachedCount++;
}
}
//test if at least 2 objects were cached at the end
assertTrue(cachedCount > 1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testCoh3710_size()\n {\n doExpiryOpTest(new Runnable()\n {\n public void run()\n {\n assertEquals(0, getNamedCache(getCacheName0()).size());\n }\n });\n }",
"@Override\n\tpublic int getSizeTo... | [
"0.7546581",
"0.6633429",
"0.65371966",
"0.64556134",
"0.63786477",
"0.63126737",
"0.63126415",
"0.6309612",
"0.629017",
"0.62738216",
"0.62587506",
"0.61997354",
"0.6177747",
"0.61754835",
"0.6151304",
"0.6125984",
"0.61073613",
"0.60626596",
"0.60537416",
"0.6049678",
"0.60... | 0.6928442 | 1 |
test that cache does operate with concurrent requests 1. perform many puts and gets on multiple threads | public void testConcurrency() throws InterruptedException {
initCache();
final ArrayList<WMSTile> wcos = new ArrayList<WMSTile>();
final ArrayList<Integer> test = new ArrayList<Integer>();
final LinkedBlockingQueue<Integer> idxs = new LinkedBlockingQueue<Integer>();
Collection<Callable<Integer>> tasks = new ArrayList<Callable<Integer>>();
for (int i = 0; i < 30000; i++) {
wcos.add(getDefaultWMSCacheObject("q" + i, 50, true));
test.add(-1);
idxs.put(i);
//put and get task
tasks.add(new Callable<Integer>() {
public Integer call() throws Exception {
//put
int i = idxs.take();
boolean ok = wmsCache.put(wcos.get(i).getQuery(), wcos.get(i).getColourmode(), PointType.POINT_1, wcos.get(i));
//get
if (ok) {
WMSTile wco = wmsCache.get(wcos.get(i).getQuery(), wcos.get(i).getColourmode(), PointType.POINT_1);
if (wco.getCached()) {
if (compareWMSObjects(wco, wcos.get(i))) {
test.set(i, 1);
} else {
test.set(i, 0);
}
}
}
return i;
}
});
}
ExecutorService executorService = Executors.newFixedThreadPool(100);
executorService.invokeAll(tasks);
//test cache cleaner operated correctly
assertTrue(wmsCache.getSize() <= wmsCache.getMaxCacheSize());
//test for presence of invalid test comparisons
int invalid = 0;
int valid = 0;
for (int i = 0; i < test.size(); i++) {
if (test.get(i) == 0) {
invalid++;
} else if (test.get(i) == 1) {
valid++;
}
}
assertTrue(valid > 0);
assertTrue(invalid == 0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int getCacheConcurrency();",
"@Test\n public void testPutGet() {\n cache.put(\"A\", \"first\");\n cache.put(\"C\", \"second\");\n cache.put(\"C\", \"third\");\n \n assertEquals(\"first\", cache.get(\"A\"));\n assertEquals(\"third\", cache.get(\"C\"));\n }",
"@Tes... | [
"0.7167642",
"0.70300496",
"0.67935026",
"0.6744582",
"0.66920906",
"0.65740556",
"0.6528434",
"0.64675474",
"0.64473534",
"0.64433664",
"0.6430538",
"0.638059",
"0.6332969",
"0.6269611",
"0.626471",
"0.6218464",
"0.621292",
"0.6194396",
"0.61620516",
"0.6124683",
"0.61214274... | 0.780849 | 0 |
callback method used to get the action the robot wish to perform | public abstract Action getAction(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String getOnAction();",
"String getAction();",
"String getAction();",
"int getAction();",
"void determineNextAction();",
"public void performAction();",
"public int getAction() {\n return action;\n }",
"public int getAction() {\n return action_;\n }",
"public void action() {\n ... | [
"0.7656903",
"0.7320204",
"0.7320204",
"0.7106855",
"0.70529294",
"0.7019947",
"0.69890344",
"0.6937019",
"0.6936713",
"0.69239736",
"0.6923399",
"0.6890222",
"0.685129",
"0.6850046",
"0.68443537",
"0.6839363",
"0.6815559",
"0.68024504",
"0.6798403",
"0.6759916",
"0.6759916",... | 0.7075148 | 4 |
callback method used to notify scan result (if robot last action type was SCAN) | public abstract void notifyScanResult(int distancesToWallsInEachDirection); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void onScanResult(final IScanResult result);",
"@Override\r\n\tpublic void onScanComplete() \r\n\t{\n\t\tif(_scanActionMode != null)\r\n\t\t\t_scanActionMode.finish();\r\n\t}",
"void onDeviceFound(TxRxScanResult scanResult);",
"@Override\n public void onScanResult(int callbackType, ScanResult result) ... | [
"0.7161397",
"0.7017784",
"0.6841524",
"0.6838592",
"0.6697415",
"0.66762465",
"0.64858854",
"0.6481691",
"0.6398427",
"0.63424253",
"0.6250738",
"0.6216722",
"0.6148129",
"0.6147891",
"0.6115946",
"0.6110114",
"0.61077553",
"0.61020845",
"0.60988396",
"0.6094416",
"0.6079634... | 0.5705539 | 50 |
callback method used to notify move result (if robot last action type was MOVE_FORWARD) | public abstract void notifyMoveResult(boolean hasMoved); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void moveSuccessfullyExecuted(Move move) {\n\t\tSystem.out.println(\"executed: \"+move);\r\n\t}",
"void onMoveTaken(Piece captured);",
"void doneMoving();",
"@Override\n\tpublic void onMoveCompleted(MoveEvent arg0) {\n\t\t\n\t}",
"void onMove();",
"protected void onMove() {\r\n }... | [
"0.7134273",
"0.6976024",
"0.6947309",
"0.6943718",
"0.69080645",
"0.68498594",
"0.67006445",
"0.6609998",
"0.6549574",
"0.6506367",
"0.6501533",
"0.6486151",
"0.6479275",
"0.6460295",
"0.64576405",
"0.6420539",
"0.6384577",
"0.6374001",
"0.63453525",
"0.6318013",
"0.6286383"... | 0.7783039 | 0 |
Create a definition of a subject area. | public GUIDResponse createSubjectArea(String serverName,
String userId,
ReferenceableRequestBody requestBody)
{
final String methodName = "createSubjectArea";
RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);
GUIDResponse response = new GUIDResponse();
AuditLog auditLog = null;
try
{
if (requestBody != null)
{
if (requestBody.getProperties() instanceof SubjectAreaProperties)
{
auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);
SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);
SubjectAreaProperties properties = (SubjectAreaProperties)requestBody.getProperties();
String subjectAreaGUID = handler.createSubjectArea(userId,
requestBody.getExternalSourceGUID(),
requestBody.getExternalSourceName(),
properties.getQualifiedName(),
properties.getSubjectAreaName(),
properties.getDisplayName(),
properties.getDescription(),
properties.getUsage(),
properties.getScope(),
properties.getDomainIdentifier(),
properties.getAdditionalProperties(),
properties.getTypeName(),
properties.getExtendedProperties(),
new Date(),
methodName);
response.setGUID(subjectAreaGUID);
}
else
{
restExceptionHandler.handleInvalidPropertiesObject(SubjectAreaProperties.class.getName(), methodName);
}
}
else
{
restExceptionHandler.handleNoRequestBody(userId, methodName, serverName);
}
}
catch (Exception error)
{
restExceptionHandler.captureExceptions(response, error, methodName, auditLog);
}
restCallLogger.logRESTCallReturn(token, response.toString());
return response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public SubjectareasRecord() {\n\t\tsuper(Subjectareas.SUBJECTAREAS);\n\t}",
"public SubjectAreaDefinitionResponse getSubjectAreaDefinitionByGUID(String serverName,\n String userId,\n ... | [
"0.62497747",
"0.6204926",
"0.620395",
"0.5832022",
"0.57169074",
"0.56226754",
"0.5565016",
"0.55110484",
"0.5453611",
"0.5396621",
"0.53450143",
"0.5270414",
"0.5268967",
"0.5205816",
"0.5196598",
"0.51926637",
"0.5185745",
"0.5145061",
"0.5126972",
"0.51134646",
"0.5030448... | 0.6074045 | 3 |
Update the definition of a subjectArea. | public VoidResponse updateSubjectArea(String serverName,
String userId,
String subjectAreaGUID,
boolean isMergeUpdate,
ReferenceableRequestBody requestBody)
{
final String methodName = "updateSubjectArea";
final String guidParameter = "subjectAreaGUID";
RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);
VoidResponse response = new VoidResponse();
AuditLog auditLog = null;
try
{
if (requestBody != null)
{
if (requestBody.getProperties() instanceof SubjectAreaProperties)
{
auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);
SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);
SubjectAreaProperties properties = (SubjectAreaProperties)requestBody.getProperties();
handler.updateSubjectArea(userId,
requestBody.getExternalSourceGUID(),
requestBody.getExternalSourceName(),
subjectAreaGUID,
guidParameter,
properties.getQualifiedName(),
properties.getSubjectAreaName(),
properties.getDisplayName(),
properties.getDescription(),
properties.getUsage(),
properties.getScope(),
properties.getDomainIdentifier(),
properties.getAdditionalProperties(),
properties.getTypeName(),
properties.getExtendedProperties(),
isMergeUpdate,
methodName);
}
else
{
restExceptionHandler.handleInvalidPropertiesObject(SubjectAreaProperties.class.getName(), methodName);
}
}
else
{
restExceptionHandler.handleNoRequestBody(userId, methodName, serverName);
}
}
catch (Exception error)
{
restExceptionHandler.captureExceptions(response, error, methodName, auditLog);
}
restCallLogger.logRESTCallReturn(token, response.toString());
return response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void update(Area area) {\n\t\tdao.update(area);\n\t}",
"@Override\n public final void setArea(JQLayoutArea area)\n {\n if (area != null)\n {\n removeClass(area.getAreaClass().toString());\n }\n this.area = area;\n if (this.area != null)\n {\n ... | [
"0.57344246",
"0.5639074",
"0.5518399",
"0.54971385",
"0.54742694",
"0.537119",
"0.5364774",
"0.5359781",
"0.5320601",
"0.53143126",
"0.5213709",
"0.51969403",
"0.51565504",
"0.5098994",
"0.5091586",
"0.50896",
"0.5001323",
"0.4983026",
"0.49717063",
"0.49403697",
"0.49233785... | 0.55761045 | 2 |
Remove the definition of a subjectArea. | @SuppressWarnings(value = "unused")
public VoidResponse deleteSubjectArea(String serverName,
String userId,
String subjectAreaGUID,
ExternalSourceRequestBody requestBody)
{
final String methodName = "deleteSubjectArea";
final String guidParameter = "subjectAreaGUID";
RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);
VoidResponse response = new VoidResponse();
AuditLog auditLog = null;
try
{
auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);
SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);
if (requestBody != null)
{
handler.deleteBeanInRepository(userId,
requestBody.getExternalSourceGUID(),
requestBody.getExternalSourceName(),
subjectAreaGUID,
guidParameter,
OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,
OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,
null,
null,
false,
false,
new Date(),
methodName);
}
else
{
handler.deleteBeanInRepository(userId,
null,
null,
subjectAreaGUID,
guidParameter,
OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,
OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,
null,
null,
false,
false,
new Date(),
methodName);
}
}
catch (Exception error)
{
restExceptionHandler.captureExceptions(response, error, methodName, auditLog);
}
restCallLogger.logRESTCallReturn(token, response.toString());
return response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void removeArea() {\n \t\tthis.set.remove( this.area );\n \t\tthis.finish();\n \t}",
"@Override\n\tpublic AreaExecution removeArea(long areaId) {\n\t\treturn null;\n\t}",
"public abstract void remove(SubArea selectedSubArea);",
"void unsetSubject();",
"@SuppressWarnings(value = \"unused\")\n pub... | [
"0.6749771",
"0.61756337",
"0.609662",
"0.5876178",
"0.5838116",
"0.56890357",
"0.56890357",
"0.56890357",
"0.56149083",
"0.5556862",
"0.551338",
"0.5498059",
"0.54783356",
"0.54591894",
"0.5362972",
"0.5343386",
"0.5337719",
"0.5330469",
"0.5326685",
"0.5300468",
"0.5260445"... | 0.57937306 | 5 |
Link two related subject areas together as part of a hierarchy. A subjectArea can only have one parent but many child subjectAreas. | @SuppressWarnings(value = "unused")
public VoidResponse linkSubjectAreasInHierarchy(String serverName,
String userId,
String parentSubjectAreaGUID,
String childSubjectAreaGUID,
RelationshipRequestBody requestBody)
{
final String methodName = "linkSubjectAreasInHierarchy";
final String parentSubjectAreaGUIDParameterName = "parentSubjectAreaGUID";
final String childSubjectAreaGUIDParameterName = "childSubjectAreaGUID";
RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);
VoidResponse response = new VoidResponse();
AuditLog auditLog = null;
try
{
auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);
SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);
if (requestBody != null)
{
if (requestBody.getProperties() != null)
{
handler.linkElementToElement(userId,
requestBody.getExternalSourceGUID(),
requestBody.getExternalSourceName(),
parentSubjectAreaGUID,
parentSubjectAreaGUIDParameterName,
OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,
childSubjectAreaGUID,
childSubjectAreaGUIDParameterName,
OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,
false,
false,
OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_GUID,
OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_NAME,
null,
requestBody.getProperties().getEffectiveFrom(),
requestBody.getProperties().getEffectiveTo(),
new Date(),
methodName);
}
else
{
handler.linkElementToElement(userId,
requestBody.getExternalSourceGUID(),
requestBody.getExternalSourceName(),
parentSubjectAreaGUID,
parentSubjectAreaGUIDParameterName,
OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,
childSubjectAreaGUID,
childSubjectAreaGUIDParameterName,
OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,
false,
false,
OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_GUID,
OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_NAME,
(InstanceProperties) null,
null,
null,
new Date(),
methodName);
}
}
else
{
handler.linkElementToElement(userId,
null,
null,
parentSubjectAreaGUID,
parentSubjectAreaGUIDParameterName,
OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,
childSubjectAreaGUID,
childSubjectAreaGUIDParameterName,
OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,
false,
false,
OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_GUID,
OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_NAME,
(InstanceProperties) null,
null,
null,
new Date(),
methodName);
}
}
catch (Exception error)
{
restExceptionHandler.captureExceptions(response, error, methodName, auditLog);
}
restCallLogger.logRESTCallReturn(token, response.toString());
return response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@SuppressWarnings(value = \"unused\")\n public VoidResponse unlinkSubjectAreasInHierarchy(String serverName,\n String userId,\n String parentSubjectAreaGUI... | [
"0.55676174",
"0.5322456",
"0.51372737",
"0.5050443",
"0.49892792",
"0.49657714",
"0.47530723",
"0.4724283",
"0.47151855",
"0.46638596",
"0.46433288",
"0.46254793",
"0.46075368",
"0.46075368",
"0.46007305",
"0.4559703",
"0.45590234",
"0.45327145",
"0.45271364",
"0.44742703",
... | 0.65888536 | 0 |
Remove the link between two subjectAreas in the subjectArea hierarchy. | @SuppressWarnings(value = "unused")
public VoidResponse unlinkSubjectAreasInHierarchy(String serverName,
String userId,
String parentSubjectAreaGUID,
String childSubjectAreaGUID,
RelationshipRequestBody requestBody)
{
final String methodName = "unlinkSubjectAreasInHierarchy";
final String parentSubjectAreaGUIDParameterName = "parentSubjectAreaGUID";
final String childSubjectAreaGUIDParameterName = "childSubjectAreaGUID";
RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);
VoidResponse response = new VoidResponse();
AuditLog auditLog = null;
try
{
auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);
SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);
if (requestBody != null)
{
handler.unlinkElementFromElement(userId,
false,
requestBody.getExternalSourceGUID(),
requestBody.getExternalSourceName(),
parentSubjectAreaGUID,
parentSubjectAreaGUIDParameterName,
OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,
childSubjectAreaGUID,
childSubjectAreaGUIDParameterName,
OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,
OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,
false,
false,
OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_GUID,
OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_NAME,
null,
methodName);
}
else
{
handler.unlinkElementFromElement(userId,
false,
null,
null,
parentSubjectAreaGUID,
parentSubjectAreaGUIDParameterName,
OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,
childSubjectAreaGUID,
childSubjectAreaGUIDParameterName,
OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,
OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,
false,
false,
OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_GUID,
OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_NAME,
null,
methodName);
}
}
catch (Exception error)
{
restExceptionHandler.captureExceptions(response, error, methodName, auditLog);
}
restCallLogger.logRESTCallReturn(token, response.toString());
return response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void removeArea() {\n \t\tthis.set.remove( this.area );\n \t\tthis.finish();\n \t}",
"public abstract void remove(SubArea selectedSubArea);",
"void unsetFurtherRelations();",
"public void secondaryRemoveLeaseRules(com.hps.july.persistence.LeaseRule aLeaseRules) {\n\tthis.getLeaseRulesLink().secondary... | [
"0.62013704",
"0.6026708",
"0.5791289",
"0.5702083",
"0.5634145",
"0.5581981",
"0.55649316",
"0.5564393",
"0.54370594",
"0.5426797",
"0.5417833",
"0.5302369",
"0.5292429",
"0.5265178",
"0.526267",
"0.52620286",
"0.5253213",
"0.5232699",
"0.52255696",
"0.52188075",
"0.5190005"... | 0.6079353 | 1 |
Link a subject area to a governance definition that controls how the assets in the subjectArea should be governed. | @SuppressWarnings(value = "unused")
public VoidResponse linkSubjectAreaToGovernanceDefinition(String serverName,
String userId,
String subjectAreaGUID,
String definitionGUID,
RelationshipRequestBody requestBody)
{
final String methodName = "linkSubjectAreaToGovernanceDefinition";
final String subjectAreaGUIDParameterName = "subjectAreaGUID";
final String definitionGUIDParameterName = "definitionGUID";
RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);
VoidResponse response = new VoidResponse();
AuditLog auditLog = null;
try
{
auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);
SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);
if (requestBody != null)
{
if (requestBody.getProperties() != null)
{
handler.linkElementToElement(userId,
requestBody.getExternalSourceGUID(),
requestBody.getExternalSourceName(),
definitionGUID,
definitionGUIDParameterName,
OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,
subjectAreaGUID,
subjectAreaGUIDParameterName,
OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,
false,
false,
OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,
OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,
null,
requestBody.getProperties().getEffectiveFrom(),
requestBody.getProperties().getEffectiveTo(),
new Date(),
methodName);
}
else
{
handler.linkElementToElement(userId,
requestBody.getExternalSourceGUID(),
requestBody.getExternalSourceName(),
definitionGUID,
definitionGUIDParameterName,
OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,
subjectAreaGUID,
subjectAreaGUIDParameterName,
OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,
false,
false,
OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,
OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,
(InstanceProperties) null,
null,
null,
new Date(),
methodName);
}
}
else
{
handler.linkElementToElement(userId,
null,
null,
definitionGUID,
definitionGUIDParameterName,
OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,
subjectAreaGUID,
subjectAreaGUIDParameterName,
OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,
false,
false,
OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,
OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,
(InstanceProperties) null,
null,
null,
new Date(),
methodName);
}
}
catch (Exception error)
{
restExceptionHandler.captureExceptions(response, error, methodName, auditLog);
}
restCallLogger.logRESTCallReturn(token, response.toString());
return response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public SubjectAreaDefinitionResponse getSubjectAreaDefinitionByGUID(String serverName,\n String userId,\n String subjectAreaGUID)\n {\n final String methodName = \... | [
"0.58370477",
"0.55527776",
"0.5449102",
"0.54165924",
"0.5388373",
"0.5146859",
"0.5124984",
"0.51085216",
"0.5106169",
"0.50933254",
"0.5090245",
"0.50737303",
"0.5038639",
"0.49586785",
"0.49063617",
"0.48667303",
"0.48621497",
"0.48343104",
"0.48048252",
"0.47416204",
"0.... | 0.6726549 | 0 |
Remove the link between a subjectArea and a governance definition. | @SuppressWarnings(value = "unused")
public VoidResponse unlinkSubjectAreaFromGovernanceDefinition(String serverName,
String userId,
String subjectAreaGUID,
String definitionGUID,
RelationshipRequestBody requestBody)
{
final String methodName = "unlinkSubjectAreaToGovernanceDefinition";
final String subjectAreaGUIDParameterName = "subjectAreaGUID";
final String definitionGUIDParameterName = "definitionGUID";
RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);
VoidResponse response = new VoidResponse();
AuditLog auditLog = null;
try
{
auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);
SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);
if (requestBody != null)
{
handler.unlinkElementFromElement(userId,
false,
requestBody.getExternalSourceGUID(),
requestBody.getExternalSourceName(),
definitionGUID,
definitionGUIDParameterName,
OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,
subjectAreaGUID,
subjectAreaGUIDParameterName,
OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,
OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,
false,
false,
OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,
OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,
null,
methodName);
}
else
{
handler.unlinkElementFromElement(userId,
false,
null,
null,
definitionGUID,
definitionGUIDParameterName,
OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,
subjectAreaGUID,
subjectAreaGUIDParameterName,
OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,
OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,
false,
false,
OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,
OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,
null,
methodName);
}
}
catch (Exception error)
{
restExceptionHandler.captureExceptions(response, error, methodName, auditLog);
}
restCallLogger.logRESTCallReturn(token, response.toString());
return response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void deleteAgence(Agence a) {\n\t\t\n\t}",
"public void removeRuleRef(org.semanticwb.model.RuleRef value);",
"@Test\n\tpublic void testRemoveLinkComponentDeleteOrphanedFromDoc() {\n\t\tAddressBook adrbook = new AddressBook();\n\t\tDocument doc = new Document(adrbook);\n\t\tAssert.assertSame... | [
"0.6035027",
"0.58663505",
"0.5811549",
"0.57919645",
"0.5770359",
"0.5698504",
"0.5694095",
"0.56698024",
"0.5662364",
"0.55477595",
"0.55325073",
"0.5501097",
"0.5493904",
"0.5491938",
"0.54724723",
"0.5448573",
"0.54353243",
"0.53577286",
"0.5352179",
"0.534702",
"0.533915... | 0.6600468 | 0 |
Return information about a specific subject area. | public SubjectAreaResponse getSubjectAreaByGUID(String serverName,
String userId,
String subjectAreaGUID)
{
final String methodName = "getSubjectAreaByGUID";
final String subjectAreaGUIDParameterName = "subjectAreaGUID";
RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);
SubjectAreaResponse response = new SubjectAreaResponse();
AuditLog auditLog = null;
try
{
auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);
SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);
response.setElement(handler.getBeanFromRepository(userId,
subjectAreaGUID,
subjectAreaGUIDParameterName,
OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,
false,
false,
new Date(),
methodName));
}
catch (Exception error)
{
restExceptionHandler.captureExceptions(response, error, methodName, auditLog);
}
restCallLogger.logRESTCallReturn(token, response.toString());
return response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getInformation(ITextViewer textViewer, IRegion subject) {\n \t\treturn \"not null\"; //$NON-NLS-1$\n \t}",
"public SubjectInfo getSubjectInfo() {\r\n\t\treturn subjectInfo;\r\n\t}",
"public SubjectInfo getSubject() {\n return this.subject;\n }",
"public abstract String getArea();",
... | [
"0.6016494",
"0.5982568",
"0.5982008",
"0.5884644",
"0.58367455",
"0.5714853",
"0.5680528",
"0.56710076",
"0.5664328",
"0.5664328",
"0.5664328",
"0.56290734",
"0.5575278",
"0.5566822",
"0.5566822",
"0.5566822",
"0.5519611",
"0.5519611",
"0.5517835",
"0.5511427",
"0.5511427",
... | 0.59165734 | 3 |
Return information about a specific subject area. | public SubjectAreaResponse getSubjectAreaByName(String serverName,
String userId,
String qualifiedName)
{
final String methodName = "getSubjectAreaByName";
final String qualifiedNameParameterName = "qualifiedName";
RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);
SubjectAreaResponse response = new SubjectAreaResponse();
AuditLog auditLog = null;
try
{
auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);
SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);
response.setElement(handler.getSubjectArea(userId,
qualifiedName,
qualifiedNameParameterName,
false,
false,
new Date(),
methodName));
}
catch (Exception error)
{
restExceptionHandler.captureExceptions(response, error, methodName, auditLog);
}
restCallLogger.logRESTCallReturn(token, response.toString());
return response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getInformation(ITextViewer textViewer, IRegion subject) {\n \t\treturn \"not null\"; //$NON-NLS-1$\n \t}",
"public SubjectInfo getSubject() {\n return this.subject;\n }",
"public SubjectInfo getSubjectInfo() {\r\n\t\treturn subjectInfo;\r\n\t}",
"public SubjectAreaResponse getSubject... | [
"0.6013288",
"0.5978578",
"0.59778625",
"0.59181774",
"0.58855367",
"0.58345175",
"0.5713292",
"0.56811994",
"0.56718147",
"0.56650966",
"0.56650966",
"0.56650966",
"0.5629674",
"0.55752593",
"0.5569739",
"0.5569739",
"0.5569739",
"0.5519934",
"0.5519934",
"0.5519584",
"0.550... | 0.54653543 | 23 |
Return information about the defined subject areas. | public SubjectAreaListResponse getSubjectAreasForDomain(String serverName,
String userId,
int domainIdentifier,
int startFrom,
int pageSize)
{
final String methodName = "getSubjectAreasForDomain";
RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);
SubjectAreaListResponse response = new SubjectAreaListResponse();
AuditLog auditLog = null;
try
{
auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);
SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);
List<SubjectAreaElement> subjectAreas = handler.getSubjectAreasByDomain(userId,
domainIdentifier,
startFrom,
pageSize,
false,
false,
new Date(),
methodName);
response.setElementList(subjectAreas);
}
catch (Exception error)
{
restExceptionHandler.captureExceptions(response, error, methodName, auditLog);
}
restCallLogger.logRESTCallReturn(token, response.toString());
return response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void printAllAreas() {\r\n\t for (int i = 0; i <= 2967; i++) {\r\n\t System.out.println(\"Load Shedding Inforamtion: \" + LSItemsArray[i].getInformation()\r\n + \": Corresponding Areas: \" + LSItemsArray[i].getAreas());\r\n\r\n\t }\r\n\t }",
"public abstract Strin... | [
"0.60744494",
"0.5970356",
"0.5945063",
"0.58944607",
"0.58462304",
"0.57586503",
"0.5724986",
"0.5699859",
"0.56917435",
"0.5687435",
"0.5687435",
"0.5687435",
"0.56828934",
"0.5672447",
"0.5660366",
"0.5601047",
"0.5601047",
"0.5601047",
"0.5585816",
"0.5570091",
"0.5527149... | 0.50360715 | 71 |
Return information about a specific subject area and its linked governance definitions. | public SubjectAreaDefinitionResponse getSubjectAreaDefinitionByGUID(String serverName,
String userId,
String subjectAreaGUID)
{
final String methodName = "getSubjectAreaDefinitionByGUID";
final String subjectAreaGUIDParameterName = "subjectAreaGUID";
RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);
SubjectAreaDefinitionResponse response = new SubjectAreaDefinitionResponse();
AuditLog auditLog = null;
try
{
auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);
SubjectAreaHandler<SubjectAreaElement> subjectAreaHandler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);
SubjectAreaElement element = subjectAreaHandler.getBeanFromRepository(userId,
subjectAreaGUID,
subjectAreaGUIDParameterName,
OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,
false,
false,
new Date(),
methodName);
if (element != null)
{
SubjectAreaDefinition subjectAreaDefinition = new SubjectAreaDefinition(element);
subjectAreaDefinition.setParentSubjectAreaGUID(subjectAreaHandler.getSubjectAreaParentGUID(userId,
subjectAreaGUID,
subjectAreaGUIDParameterName,
false,
false,
new Date(),
methodName));
subjectAreaDefinition.setNestedSubjectAreaGUIDs(subjectAreaHandler.getSubjectAreaChildrenGUIDs(userId,
subjectAreaGUID,
subjectAreaGUIDParameterName,
false,
false,
new Date(),
methodName));
GovernanceDefinitionHandler<GovernanceDefinitionElement> definitionHandler = instanceHandler.getGovernanceDefinitionHandler(userId, serverName, methodName);
ElementStubConverter<ElementStub> elementStubConverter = instanceHandler.getElementStubConverter(userId, serverName, methodName);
List<Relationship> relationships = definitionHandler.getGoverningDefinitionLinks(userId,
subjectAreaGUID,
subjectAreaGUIDParameterName,
OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,
null,
0,
0,
false,
false,
new Date(),
methodName);
List<ElementStub> definitions = elementStubConverter.getNewBeans(ElementStub.class, relationships, true, methodName);
subjectAreaDefinition.setAssociatedGovernanceDefinitions(definitions);
response.setProperties(subjectAreaDefinition);
}
}
catch (Exception error)
{
restExceptionHandler.captureExceptions(response, error, methodName, auditLog);
}
restCallLogger.logRESTCallReturn(token, response.toString());
return response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@SuppressWarnings(value = \"unused\")\n public VoidResponse linkSubjectAreaToGovernanceDefinition(String serverName,\n String userId,\n String ... | [
"0.5607668",
"0.52910304",
"0.51649773",
"0.5041852",
"0.50163937",
"0.4921489",
"0.49029437",
"0.49029437",
"0.48730204",
"0.4805235",
"0.47746584",
"0.4768294",
"0.47668087",
"0.47549576",
"0.4735034",
"0.47233018",
"0.47212762",
"0.47040582",
"0.46897906",
"0.46893087",
"0... | 0.57703966 | 0 |
Add a subject area classification to a referenceable element. | public VoidResponse addSubjectAreaMemberClassification(String serverName,
String userId,
String elementGUID,
ClassificationRequestBody requestBody)
{
final String methodName = "addSubjectAreaMemberClassification";
final String elementGUIDParameterName = "elementGUID";
RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);
VoidResponse response = new VoidResponse();
AuditLog auditLog = null;
try
{
auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);
ReferenceableHandler<RelatedElement> handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName);
if (requestBody != null)
{
if (requestBody.getProperties() instanceof SubjectAreaClassificationProperties)
{
SubjectAreaClassificationProperties properties = (SubjectAreaClassificationProperties)requestBody.getProperties();
handler.addSubjectAreaClassification(userId,
requestBody.getExternalSourceGUID(),
requestBody.getExternalSourceName(),
elementGUID,
elementGUIDParameterName,
OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME,
properties.getSubjectAreaName(),
false,
false,
properties.getEffectiveFrom(),
properties.getEffectiveTo(),
null,
methodName);
}
else
{
restExceptionHandler.handleInvalidPropertiesObject(SubjectAreaClassificationProperties.class.getName(), methodName);
}
}
else
{
restExceptionHandler.handleNoRequestBody(userId, methodName, serverName);
}
}
catch (Exception error)
{
restExceptionHandler.captureExceptions(response, error, methodName, auditLog);
}
restCallLogger.logRESTCallReturn(token, response.toString());
return response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"org.landxml.schema.landXML11.ClassificationDocument.Classification addNewClassification();",
"public void setArea(String area) {\n this.area = area;\n }",
"public void setArea(String area) {\n this.area = area;\n }",
"public void setArea(String area) {\n\t\tthis.area = area;\n\t}"... | [
"0.5351993",
"0.53511214",
"0.53422105",
"0.52672374",
"0.5120787",
"0.5111836",
"0.49767813",
"0.49549225",
"0.49321124",
"0.48879808",
"0.48435298",
"0.48148933",
"0.47952023",
"0.4771809",
"0.47707608",
"0.47707608",
"0.47634935",
"0.47505796",
"0.4704709",
"0.4697659",
"0... | 0.6086718 | 0 |
Remove a subject area classification from a referenceable. | public VoidResponse deleteSubjectAreaMemberClassification(String serverName,
String userId,
String elementGUID,
ExternalSourceRequestBody requestBody)
{
final String methodName = "deleteSubjectAreaMemberClassification";
final String elementGUIDParameterName = "elementGUID";
RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);
VoidResponse response = new VoidResponse();
AuditLog auditLog = null;
try
{
auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);
ReferenceableHandler<RelatedElement> handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName);
if (requestBody != null)
{
handler.removeSubjectAreaClassification(userId,
requestBody.getExternalSourceGUID(),
requestBody.getExternalSourceName(),
elementGUID,
elementGUIDParameterName,
OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME,
false,
false,
null,
methodName);
}
else
{
handler.removeSubjectAreaClassification(userId,
null,
null,
elementGUID,
elementGUIDParameterName,
OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME,
false,
false,
null,
methodName);
}
}
catch (Exception error)
{
restExceptionHandler.captureExceptions(response, error, methodName, auditLog);
}
restCallLogger.logRESTCallReturn(token, response.toString());
return response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract void remove(SubArea selectedSubArea);",
"private void removeArea() {\n \t\tthis.set.remove( this.area );\n \t\tthis.finish();\n \t}",
"public void removeRuleRef(org.semanticwb.model.RuleRef value);",
"public void removeAllRuleRef();",
"protected void removeReference()\n {\n }",
"pub... | [
"0.6776431",
"0.66257757",
"0.59562606",
"0.5868304",
"0.56958705",
"0.5682851",
"0.56618565",
"0.565781",
"0.56219715",
"0.550945",
"0.54683834",
"0.54376656",
"0.5423444",
"0.5416639",
"0.53792405",
"0.5376295",
"0.53514934",
"0.5337452",
"0.5329579",
"0.5324219",
"0.527218... | 0.5975293 | 2 |
Return information about the contents of a subject area such as the glossaries, reference data sets and quality definitions. | public ElementStubListResponse getMembersOfSubjectArea(String serverName,
String userId,
String subjectAreaName,
int startFrom,
int pageSize)
{
final String methodName = "getMembersOfSubjectArea";
RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);
ElementStubListResponse response = new ElementStubListResponse();
AuditLog auditLog = null;
try
{
auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);
ReferenceableHandler<ElementStub> handler = instanceHandler.getElementStubHandler(userId, serverName, methodName);
response.setElements(handler.getSubjectAreaMembers(userId,
subjectAreaName,
startFrom,
pageSize,
false,
false,
null,
methodName));
}
catch (Exception error)
{
restExceptionHandler.captureExceptions(response, error, methodName, auditLog);
}
restCallLogger.logRESTCallReturn(token, response.toString());
return response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getInformation(ITextViewer textViewer, IRegion subject) {\n \t\treturn \"not null\"; //$NON-NLS-1$\n \t}",
"public SubjectAreaDefinitionResponse getSubjectAreaDefinitionByGUID(String serverName,\n String userId,\n ... | [
"0.582621",
"0.5342856",
"0.5291587",
"0.52572846",
"0.5247554",
"0.52225095",
"0.52207917",
"0.5194019",
"0.51903063",
"0.51759666",
"0.51759666",
"0.51759666",
"0.51759666",
"0.51759666",
"0.51759666",
"0.51759666",
"0.51759666",
"0.51443017",
"0.51443017",
"0.51443017",
"0... | 0.0 | -1 |
Simply selects the home view to render by returning its name. | @RequestMapping(value = "/", method = RequestMethod.GET)
public String home(Locale locale, Model model) {
logger.info("Welcome home! The client locale is {}.", locale);
Date date = new Date();
DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);
String formattedDate = dateFormat.format(date);
model.addAttribute("serverTime", formattedDate );
return "home";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@GetMapping(Mappings.HOME)\n\tpublic String showHome() {\n\n\t\treturn ViewNames.HOME;\n\t}",
"public String home() {\n if (getUsuario() == null) {\n return \"login.xhtml\";\n }\n // Si el usuario es un ADMINISTRADOR, le lleva a la pagina a la lista de Alumnos\n if (getUsua... | [
"0.6822435",
"0.62661755",
"0.6217795",
"0.6203774",
"0.6201253",
"0.6188922",
"0.6154045",
"0.61244094",
"0.61224985",
"0.6106122",
"0.60122067",
"0.6010745",
"0.5981612",
"0.5978502",
"0.5944166",
"0.59367555",
"0.592576",
"0.5908651",
"0.59058887",
"0.58818066",
"0.5861352... | 0.0 | -1 |
Create a new student object and return it | @ResponseBody
@RequestMapping(value = "/getstudent/{id}/{name}", method=RequestMethod.GET, produces={"application/json", "application/xml"})
public Student getStudent(HttpServletRequest request, HttpServletResponse response, @PathVariable ("id") int id, @PathVariable("name") String name){
SimpleDateFormat dateFormatter = new SimpleDateFormat("MM/dd/yyyy");
Student student = new Student(id, name, dateFormatter.format(new Date()));
List<Course> cources = student.getCourses();
cources.add(new Course("Math", 15));
cources.add(new Course("Politics", 100));
return student;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Student createStudent();",
"private Student createStudent(Element studentNode) {\n String serialNumber = studentNode.getAttribute(\"serialNumber\");\n Student b = new Student();\n b.setSerialNumber(serialNumber);\n\n b.setName(getTextFromTagName(studentNode, \"name\"));\n b.set... | [
"0.8587213",
"0.76602536",
"0.73838705",
"0.73810923",
"0.73418975",
"0.7271858",
"0.7173844",
"0.71528345",
"0.70362467",
"0.7016495",
"0.7016495",
"0.7016495",
"0.7014141",
"0.70078033",
"0.6999796",
"0.6992419",
"0.69771415",
"0.6924644",
"0.6894341",
"0.6855247",
"0.68438... | 0.0 | -1 |
button that lets user to go to main screen | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_result);
initializeWidgets(); // initialize the widgets on the front end
String log = getIntent().getStringExtra("LOG"); // get the log from the main activity using intent
int correctAnswers = getIntent().getIntExtra("CorrectAnswers", 0); // get the correct number of answers
int totalAnswers = getIntent().getIntExtra("TotalAnswers", 0); // get the total number of answers
resultTextView.setText(log); // set the text to textview
int correctPercentage = findPercentage(correctAnswers, totalAnswers); // find the percentage of the correct answers
int wrongPercentage = findPercentage(totalAnswers - correctAnswers, totalAnswers); // find the percentage of the wrong answers
resultTextView.append("\n\n\n\n" + correctPercentage + "% Correct Answer"); // set correct percentage
resultTextView.append("\n" + wrongPercentage + "% Wrong Answer"); // set wrong percentage
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void gotoMain(View view) {\n finish();\n }",
"void goMainScreen(){\n\t\tcheckSavePwd();\n\t\tActionEvent e = new ActionEvent();\n\t\te.sender = this;\n\t\te.action = ActionEventConstant.ACTION_SWITH_TO_CATEGORY_SCREEN;\n\t\tUserController.getInstance().handleSwitchActivity(e);\n\t}",
"public v... | [
"0.7511108",
"0.74586016",
"0.73856884",
"0.73531365",
"0.7340331",
"0.73227566",
"0.7320727",
"0.7262976",
"0.7256168",
"0.722315",
"0.7207064",
"0.7144325",
"0.71104914",
"0.70724183",
"0.70175755",
"0.70015997",
"0.6970714",
"0.6945437",
"0.6893761",
"0.68913054",
"0.68878... | 0.0 | -1 |
This method initializes the widgets given on the front end | private void initializeWidgets() {
resultTextView = findViewById(R.id.resultTextView);
goBackButton = findViewById(R.id.goBackButton);
goBackButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void initializeWidgets() {\n\t\timg_home = (ImageView) findViewById(R.id.img_home);\n\t\tlv_customer_info = (ListView) findViewById(R.id.lv_customer_info);\n\t\tmc_ed_search = (AutoCompleteTextView) findViewById(R.id.mc_ed_search);\n\t\ttxv_invisible = (TextView) findViewById(R.id.txv_invisible);\n\t\ttxv_... | [
"0.78779227",
"0.74776936",
"0.74715966",
"0.72881913",
"0.72501093",
"0.7164392",
"0.7108229",
"0.7105446",
"0.70780367",
"0.70474845",
"0.7021927",
"0.69945115",
"0.6985899",
"0.6985899",
"0.6979071",
"0.69722474",
"0.6951141",
"0.6949804",
"0.69389576",
"0.6925009",
"0.691... | 0.688462 | 22 |
If the physical back button on the device is clicked | @Override
public void onBackPressed() {
super.onBackPressed();
finish();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean onBackPressed();",
"boolean onBackPressed();",
"public abstract boolean onBackPressed(boolean isSystemBackKey);",
"public abstract boolean onBackPressed();",
"public boolean onBackPressed() {\n \treturn m_renderer.onBackPressed();\n }",
"void onGoBackButtonClick();",
"@Override\n // ... | [
"0.83247775",
"0.83247775",
"0.8159554",
"0.8036157",
"0.7942018",
"0.7762353",
"0.7672141",
"0.7638245",
"0.75826216",
"0.75826216",
"0.758181",
"0.75771785",
"0.7565594",
"0.7539933",
"0.7503665",
"0.74922836",
"0.74879956",
"0.7439152",
"0.7420973",
"0.7413047",
"0.7411465... | 0.0 | -1 |
Construct a builder based upon the specified passive oracle. | public Builder(PassiveOracle<I, O> passiveOracle) {
super(passiveOracle);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract ODatabaseInternal<?> newDatabase();",
"private Builder() {\n super(baconhep.TTau.SCHEMA$);\n }",
"public OracleDataSourceFactory()\n {\n super();\n System.out.println(\"Constructed OracleDataSourceFactory\");\n }",
"private Builder() {\n super(edu.pa.Rat.SCHEMA$);\n ... | [
"0.53396386",
"0.52014226",
"0.51301074",
"0.5125255",
"0.50394064",
"0.50161636",
"0.49924222",
"0.49742386",
"0.49295086",
"0.49208605",
"0.49180937",
"0.49180937",
"0.49180937",
"0.49180937",
"0.49180937",
"0.49180937",
"0.49180937",
"0.49180937",
"0.49180937",
"0.49180937",... | 0.8257077 | 0 |
TODO Autogenerated method stub | @Override
public String execute() throws Exception {
HttpSession session = ServletActionContext.getRequest().getSession();
String prefix=(String)session.getAttribute("prefix");
MemoryMessage memoryMessage=(MemoryMessage) session.getAttribute("memMessage");
this.chart=new DrawPictureImpl().drawMemBarChart(prefix, memoryMessage);
return "success";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
Test constructor argument's with wrong values. max is zero | @Test(expected=IllegalArgumentException.class)
public void testConstructor_max0() {
new LengthMax(0);
fail();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test(expected=NullPointerException.class)\r\n public void testConstructor_nextNull() {\r\n \r\n new LengthMax(max, null);\r\n \r\n fail();\r\n \r\n }",
"@Test(expected=IllegalArgumentException.class)\n\tpublic void testZerosException() throws IllegalArgumentException {\n... | [
"0.69965005",
"0.6831237",
"0.65116113",
"0.64757574",
"0.64565253",
"0.6424823",
"0.6394776",
"0.63853693",
"0.63596636",
"0.6338208",
"0.63282955",
"0.62706745",
"0.62646174",
"0.62100697",
"0.6192001",
"0.619053",
"0.6171836",
"0.6165343",
"0.6158362",
"0.6153231",
"0.6145... | 0.7988593 | 0 |
Test constructor argument's with wrong values. next is null. | @Test(expected=NullPointerException.class)
public void testConstructor_nextNull() {
new LengthMax(max, null);
fail();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testLinkList()\n {\n // passing head as null to constructor is not allowed\n //\n try\n {\n new LinkList(null);\n fail(\"Passing null for head should throw\");\n }\n catch(IllegalArgumentException e)\n {\n a... | [
"0.6338891",
"0.61251086",
"0.6106086",
"0.6089708",
"0.6089124",
"0.60659426",
"0.6037448",
"0.5933434",
"0.5923131",
"0.5897468",
"0.5835397",
"0.5834437",
"0.5824793",
"0.5775248",
"0.57606006",
"0.57389724",
"0.5704783",
"0.56898475",
"0.5671301",
"0.56515217",
"0.5650747... | 0.7058151 | 0 |
Test execusion with a null input. | @Test
public void testExecute_inputNull() {
assertThat((Object)processor.execute(null, ANONYMOUS_CSVCONTEXT)).isNull();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void noneNullArgumentIsNullTest() throws GeneralException {\n for (String noneNullArgument : SAMLCorrelationRule.NONE_NULL_ARGUMENTS_NAME) {\n\n JavaRuleContext testRuleContext = buildTestJavaRuleContext();\n testRuleContext.getArguments().remove(noneNullArgument);\n\... | [
"0.69402635",
"0.6675134",
"0.6580598",
"0.6480455",
"0.64759845",
"0.64374304",
"0.6394552",
"0.63752544",
"0.635831",
"0.631132",
"0.63046986",
"0.6285367",
"0.62180215",
"0.62019134",
"0.6124993",
"0.60830104",
"0.6068091",
"0.60644436",
"0.60468847",
"0.6036192",
"0.60311... | 0.7720591 | 0 |
Test execusion with valid value. | @Test
public void testExecute_inputValid() {
{
String input = maxStr;
assertThat((Object)processor.execute(input, ANONYMOUS_CSVCONTEXT)).isEqualTo(input);
assertThat((Object)processorChain.execute(input, ANONYMOUS_CSVCONTEXT)).isEqualTo(input);
}
{
String input = maxStr.substring(0, max-1);
assertThat((Object)processor.execute(input, ANONYMOUS_CSVCONTEXT)).isEqualTo(input);
assertThat((Object)processorChain.execute(input, ANONYMOUS_CSVCONTEXT)).isEqualTo(input);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void isInputDataValidTest() {\n boolean invoke = Deencapsulation.invoke(modificationFibonacci, \"isInputDataValid\", \"1\");\n assertTrue(invoke);\n }",
"@Test\n public void isInputDataValidTestWithBadInput() {\n boolean invoke = Deencapsulation.invoke(modificationFibonacci, \"isInputD... | [
"0.66025835",
"0.6453457",
"0.6362088",
"0.62935495",
"0.6281482",
"0.626156",
"0.6219137",
"0.6218132",
"0.6174303",
"0.6151714",
"0.61464345",
"0.6118035",
"0.6113422",
"0.6101612",
"0.60902977",
"0.60765207",
"0.6058583",
"0.605772",
"0.60446566",
"0.60276985",
"0.59868455... | 0.5584396 | 95 |
Adds a row of components to the given container. | protected static void addRow(Container container, GridBagConstraints gbc, JComponent... components) {
if(components.length == 0) {
return;
}
for(int c = 0; c < components.length; c++) {
if(c == components.length - 1) {
gbc.gridwidth = GridBagConstraints.REMAINDER;
}
container.add(components[c], gbc);
gbc.gridx++;
}
gbc.gridwidth = 1;
gbc.gridx = 0;
gbc.gridy++;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void addRow() {\n ArrayList<EscapeBlock> row = new ArrayList<>();\n grid.add(row);\n \n for (int j = 0; j < gridWidth; j++) {\n EscapeBlock block = new EscapeBlock(j, gridHeight);\n block.setLocation(margin + j * (Block.length+1) ,\n marg... | [
"0.69011694",
"0.6869621",
"0.66180265",
"0.63249326",
"0.63175404",
"0.6175119",
"0.6172397",
"0.6106604",
"0.60863984",
"0.60273355",
"0.6020524",
"0.59465796",
"0.5906514",
"0.5905961",
"0.58680195",
"0.58496916",
"0.58369476",
"0.58348244",
"0.57696766",
"0.5744918",
"0.5... | 0.79799885 | 0 |
Shuts down the database. No other operations are accepted after this call. | public void shutdown() throws DatabaseAccessException {
try {
this.connection.close();
} catch (SQLException e) {
throw new DatabaseAccessException(Failure.CONNECTION);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void shutDownDB(){\n\t\ttry\n {\n // the shutdown=true attribute shuts down Derby\n\t\t\tDriverManager.getConnection(\"jdbc:derby:\" + dbName + \";shutdown=true\");\n\n // To shut down a specific database only, but keep the\n // engine running (for example for connect... | [
"0.77395964",
"0.76746297",
"0.7577482",
"0.7463126",
"0.7433678",
"0.74199665",
"0.73941076",
"0.72131395",
"0.7161446",
"0.7104907",
"0.70335245",
"0.7028965",
"0.69634247",
"0.69485176",
"0.69341993",
"0.6898423",
"0.68462735",
"0.68272495",
"0.68116623",
"0.68068135",
"0.... | 0.68540037 | 16 |
Loads the required jdbc driver | private void initDriver() throws InvalidDriverException {
try {
Class.forName(this.driverName);
} catch (ClassNotFoundException e) {
// unable to load driver; invalid
throw new InvalidDriverException(Failure.DRIVER);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void loadDbDriver(){\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tLOGGER.severe(\"!EXCEPTION: \" + e.getMessage());\n\t\t}\n\t}",
"private static void loadDriver() {\n\t\ttry {\n\t\t\tClass.forName(\"org.sqlite.JDBC\");\n\t\t} catch (ClassNo... | [
"0.77760947",
"0.77297163",
"0.7524254",
"0.7476981",
"0.73795915",
"0.734371",
"0.7261652",
"0.71881324",
"0.709627",
"0.6998567",
"0.6809303",
"0.68021697",
"0.66484696",
"0.66413456",
"0.6540229",
"0.6433752",
"0.6356116",
"0.6295927",
"0.62827754",
"0.62730545",
"0.626999... | 0.5543653 | 83 |
Establishes a connection with the database | private void initConnection() throws DatabaseAccessException {
try {
this.connection = DriverManager.getConnection(this.driver + ":" + this.path);
} catch (SQLException e) {
// unable to create the connection; access error
throw new DatabaseAccessException(Failure.CONNECTION);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void connect() {\n\n DatabaseGlobalAccess.getInstance().setEmf(Persistence.createEntityManagerFactory(\"PU_dashboarddb\"));\n DatabaseGlobalAccess.getInstance().setEm(DatabaseGlobalAccess.getInstance().getEmf().createEntityManager());\n DatabaseGlobalAccess.getInstance().getDatabaseData... | [
"0.7779754",
"0.76710576",
"0.75907123",
"0.7553362",
"0.75532997",
"0.7540515",
"0.7519467",
"0.75130993",
"0.7469781",
"0.7467281",
"0.74406964",
"0.74337405",
"0.7388202",
"0.7355787",
"0.73447925",
"0.732867",
"0.73208916",
"0.73151237",
"0.7311713",
"0.7306438",
"0.72921... | 0.6925689 | 86 |
Sets the SQLite specific pragmas to boost the performance | private void initConfig() throws DatabaseAccessException {
Statement stmt = null;
try {
stmt = this.connection.createStatement();
// With synchronous OFF, SQLite continues without syncing
// as soon as it has handed data off to the operating system.
stmt.execute("PRAGMA synchronous = OFF;");
// The MEMORY journaling mode stores the rollback journal in volatile RAM.
// This saves disk I/O but at the expense of database safety and integrity.
stmt.execute("PRAGMA journal_mode = MEMORY;");
// The journal_size_limit pragma may be used to limit the size of rollback-journal.
// -1 means no limit.
stmt.execute("PRAGMA journal_size_limit = -1;");
// If the argument N is negative, then the number of cache pages
// is adjusted to use approximately N*1024 bytes of memory.
stmt.execute("PRAGMA cache_size = -50000;");
// Once an encoding has been set for a database, it cannot be changed.
stmt.execute("PRAGMA encoding = \"UTF-8\";");
// When temp_store is MEMORY temporary tables and indices are kept
// in as if they were pure in-memory databases memory.
stmt.execute("PRAGMA temp_store = MEMORY;");
stmt.close();
} catch (SQLException e) {
throw new DatabaseAccessException(Failure.CONFIG);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setPragma(String pragma)\r\n/* 299: */ {\r\n/* 300:450 */ set(\"Pragma\", pragma);\r\n/* 301: */ }",
"private void m145783m() {\n if (this.f119478k) {\n mo115433a(\"PRAGMA query_only = 1\", null, null);\n }\n }",
"public PragmaAnnotation() {\n super(... | [
"0.5542168",
"0.5243701",
"0.51763344",
"0.5079699",
"0.5015162",
"0.5008015",
"0.50019693",
"0.4953234",
"0.4801788",
"0.47795826",
"0.47503713",
"0.46028474",
"0.45639306",
"0.45267174",
"0.44981563",
"0.44656962",
"0.44053996",
"0.43903527",
"0.43853402",
"0.43673974",
"0.... | 0.0 | -1 |
Checks if the database layout exists already and create new one if needed | private void initLayout() throws DatabaseAccessException, IncompatibleVersionException {
Statement stmt = null;
ResultSet rs;
int version = -1;
try {
stmt = this.connection.createStatement();
rs = stmt.executeQuery("SELECT Version FROM Metadata;");
version = rs.getInt(1);
stmt.close();
if (version != DatabaseConfiguration.LAYOUTVERSION) {
throw new IncompatibleVersionException(Failure.VERSION);
}
} catch (SQLException e) {
// if there isn't at least the Metadata table with the Version field, we operate on a clean database
createTables();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void createNewSchema() throws SQLException {\n ResultSet resultSet = databaseStatement.executeQuery(\"select count(datname) from pg_database\");\n int uniqueID = 0;\n if(resultSet.next()) {\n uniqueID = resultSet.getInt(1);\n }\n if(uniqueID != 0) {\n ... | [
"0.6325513",
"0.5870481",
"0.5865111",
"0.5765307",
"0.57004976",
"0.56544256",
"0.5637524",
"0.5637524",
"0.5630174",
"0.5621281",
"0.5613548",
"0.5600538",
"0.55982774",
"0.55538213",
"0.55401266",
"0.5536526",
"0.55310106",
"0.5498053",
"0.5463387",
"0.54586565",
"0.545686... | 0.66593176 | 0 |
Creates a new database with all tables | private void createTables() throws DatabaseAccessException {
Statement stmt = null;
PreparedStatement prepStmt = null;
try {
stmt = this.connection.createStatement();
// be sure to drop all tables in case someone manipulated the database manually
stmt.executeUpdate("DROP TABLE IF EXISTS DynamicConstraints;");
stmt.executeUpdate("DROP TABLE IF EXISTS Features;");
stmt.executeUpdate("DROP TABLE IF EXISTS Groups;");
stmt.executeUpdate("DROP TABLE IF EXISTS Metadata;");
stmt.executeUpdate("DROP TABLE IF EXISTS Objects;");
stmt.executeUpdate("DROP TABLE IF EXISTS StaticConstraints;");
stmt.executeUpdate("DROP TABLE IF EXISTS Subspaces;");
// populate database with tables.. by using ugly sql
stmt.executeUpdate("CREATE TABLE DynamicConstraints(Id INTEGER PRIMARY KEY AUTOINCREMENT,"
+ " Operator INTEGER, FeatureReference INTEGER,"
+ " GroupReference INTEGER, Value FLOAT, Active BOOLEAN);");
stmt.executeUpdate("CREATE TABLE Features(Id INTEGER PRIMARY KEY AUTOINCREMENT," + " Name VARCHAR("
+ DatabaseConfiguration.VARCHARLENGTH + "), OutlierFlag BOOLEAN, Min FLOAT, Max FLOAT);");
stmt.executeUpdate("CREATE TABLE Groups(Id INTEGER PRIMARY KEY AUTOINCREMENT, Name VARCHAR("
+ DatabaseConfiguration.VARCHARLENGTH + "),"
+ " Visibility BOOLEAN, Color INTEGER, ColorCalculatedByFeature INTEGER, Description TEXT);");
stmt.executeUpdate("CREATE TABLE Metadata(Version INTEGER);");
// Object table is created in initFeatures, to boost performance
stmt.executeUpdate("CREATE TABLE StaticConstraints(Id INTEGER, GroupReference INTEGER,"
+ " ObjectReference INTEGER, Active BOOLEAN);");
stmt.executeUpdate("CREATE TABLE Subspaces(Id INTEGER, FeatureReference INTEGER," + " Name VARCHAR("
+ DatabaseConfiguration.VARCHARLENGTH + "));");
stmt.close();
// after creating the tables, write the layout version
prepStmt = this.connection.prepareStatement("INSERT INTO Metadata VALUES(?);");
prepStmt.setInt(1, DatabaseConfiguration.LAYOUTVERSION);
prepStmt.execute();
prepStmt.close();
} catch (SQLException e) {
throw new DatabaseAccessException(Failure.LAYOUT);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void createNewDataBase() {\n try (Connection conn = DriverManager.getConnection(url)) {\n if (conn != null) {\n DatabaseMetaData meta = conn.getMetaData();\n createNewTable();\n }\n } catch (SQLException e) {\n System.out.println(e... | [
"0.78887326",
"0.77307534",
"0.75181794",
"0.74612695",
"0.7383135",
"0.7380979",
"0.73178935",
"0.72695374",
"0.7219089",
"0.7164893",
"0.7133134",
"0.7095077",
"0.7091545",
"0.7087526",
"0.7053697",
"0.70472986",
"0.70310396",
"0.7005308",
"0.6973489",
"0.69490135",
"0.6873... | 0.68428546 | 22 |
Returns the database connection. | public Connection getConnection() {
return this.connection;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public DatabaseConnection getDatabaseConnection() {\n return query.getDatabaseConnection();\n }",
"public Connection getConnection() {\n if(connection == null) throw new RuntimeException(\"Attempt to get database connection before it was initialized\");\n return connection;\n }",
"pu... | [
"0.82745546",
"0.82193875",
"0.8089118",
"0.80346507",
"0.79920435",
"0.7988019",
"0.79052126",
"0.7890331",
"0.78707033",
"0.78678",
"0.7846189",
"0.7836675",
"0.78134084",
"0.7810837",
"0.7799963",
"0.7738605",
"0.7734664",
"0.76906776",
"0.76396114",
"0.7629801",
"0.761226... | 0.71411514 | 86 |
Returns true if database exists but is empty. True also could indicate a read error. Check if Database is readable before using this method. | public boolean isEmpty() {
Statement stmt = null;
ResultSet rs = null;
int count = 0;
try {
stmt = this.connection.createStatement();
// without features we are not able to operate correctly
rs = stmt.executeQuery("SELECT COUNT(Id) FROM Features;");
count = rs.getInt(1);
stmt.close();
} catch (SQLException e) {
// for now, do not handle read exceptions, b/c exception here also indicates the failure to get features
}
return (0 == count);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean checkIfDatabaseExists() {\r\n return database.exists();\r\n }",
"public boolean databaseExists() {\n return defaultDatabaseExists();\n }",
"public synchronized boolean existsDatabase() throws IOException {\n return existsDatabase(database.get(), null);\n }",
"public boolean databas... | [
"0.8108975",
"0.7978209",
"0.79259896",
"0.7884726",
"0.7625655",
"0.72534883",
"0.71571267",
"0.71571267",
"0.7137354",
"0.7111336",
"0.70884603",
"0.707043",
"0.7054246",
"0.70041406",
"0.6995858",
"0.6995327",
"0.6991315",
"0.6971858",
"0.6971858",
"0.6971858",
"0.6971858"... | 0.57231015 | 79 |
Stores a range of new objects in the database. Stores the object's values for each feature within the range of objects | public void pushObject(float[][] objects) throws DatabaseAccessException {
PreparedStatement prepStmt = null;
// dynamically insert values in columns of a object row
String sql = "INSERT INTO Objects VALUES(NULL";
for (int i = 1; i <= objects[0].length; ++i) {
sql += ", ?";
}
sql += ");";
try {
prepStmt = this.connection.prepareStatement(sql);
// for each object
for (float[] values : objects) {
// for each value in the object
for (int featureId = 1; featureId <= values.length; ++featureId) {
prepStmt.setFloat(featureId, values[featureId - 1]);
}
prepStmt.addBatch();
}
// do not atomically write each insert, but write them all at once, thus boosting write performance
this.connection.setAutoCommit(false);
prepStmt.executeBatch();
this.connection.setAutoCommit(true);
prepStmt.close();
} catch (SQLException e) {
throw new DatabaseAccessException(Failure.WRITE);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void updateFeaturesMinMax() throws DatabaseAccessException {\n\t\tStatement stmt;\n\t\tResultSet rs;\n\n\t\ttry {\n\t\t\tstmt = this.connection.createStatement();\n\t\t\trs = stmt.executeQuery(\"SELECT Id FROM Features;\");\n\t\t\tArrayList<Integer> featureIds = new ArrayList<Integer>();\n\t\t\twhile (rs.ne... | [
"0.56665766",
"0.55797845",
"0.5278782",
"0.52635175",
"0.52348375",
"0.52110505",
"0.5202527",
"0.51577216",
"0.5144822",
"0.5144724",
"0.5105805",
"0.50951403",
"0.5072661",
"0.50166225",
"0.5008701",
"0.5001918",
"0.49960798",
"0.4991921",
"0.49917704",
"0.49781394",
"0.49... | 0.5851106 | 0 |
Initializes all features, based on their name. | public void initFeatures(String[] features, boolean[] outlierFlags) throws DatabaseAccessException {
Statement stmt = null;
PreparedStatement prepStmt = null;
// build sql table query: Id | "1" | "2" | ... by doing this, we are able to store all values in one row
String sql = "CREATE TABLE IF NOT EXISTS Objects(Id INTEGER PRIMARY KEY AUTOINCREMENT";
for (int i = 1; i <= features.length; ++i) {
// escaping the id is important, due to the fact that we named the row that way (e.g. "1")
sql += ", \"" + i + "\" FLOAT";
}
sql += ");";
try {
stmt = this.connection.createStatement();
// objects table creation
stmt.executeUpdate(sql);
stmt.close();
prepStmt = this.connection.prepareStatement("INSERT INTO Features VALUES(NULL, ?, ?, 0, 1);");
// add all insertions to the batch
for (int i = 0; i < features.length; ++i) {
prepStmt.setString(1, features[i]);
prepStmt.setBoolean(2, outlierFlags[i]);
prepStmt.addBatch();
}
// perform the transaction
this.connection.setAutoCommit(false);
prepStmt.executeBatch();
this.connection.setAutoCommit(true);
prepStmt.close();
} catch (SQLException e) {
throw new DatabaseAccessException(Failure.WRITE);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract void initUnSupportedFeatures();",
"private void createFeatures() {\n\t\tfeatures = new Feature[NUM_FEATURES];\n\n\t\t// Create dummy feature\n\t\tfeatures[0] = new DummyFeature(width, height, 0, 0 - THRESHOLD);\n\n\t\t// Create the rest of the features\n\t\tfor (int i = 1; i < NUM_FEATURES; i+... | [
"0.64552516",
"0.64230394",
"0.62868917",
"0.6198602",
"0.61975974",
"0.61679834",
"0.6155254",
"0.61280817",
"0.6113674",
"0.6082714",
"0.60772073",
"0.59193736",
"0.589788",
"0.5893397",
"0.58445287",
"0.583822",
"0.5813872",
"0.57920486",
"0.57314295",
"0.57202065",
"0.571... | 0.0 | -1 |
Stores a new subspace. | public void pushSubspace(int id, int[] featureReference, String name)
throws DatabaseAccessException {
PreparedStatement prepStmt = null;
try {
prepStmt = this.connection.prepareStatement("INSERT INTO Subspaces VALUES(?, ?, ?);");
// the id is unique for this subspace
prepStmt.setInt(1, id);
// add all insertions to the batch
for (int featureId : featureReference) {
prepStmt.setInt(2, featureId);
prepStmt.setString(3, name);
prepStmt.addBatch();
}
// perform the transaction
this.connection.setAutoCommit(false);
prepStmt.executeBatch();
this.connection.setAutoCommit(true);
prepStmt.close();
} catch (SQLException e) {
throw new DatabaseAccessException(Failure.WRITE);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setDataSpace(DataSpace newDataSpace) {\n\t\tdataspace = newDataSpace;\n\t}",
"public void addSpaceStation()\n\t{\n\t\t//if a space station is already spawned, one will not be added\n\t\tif (gameObj[5].size() == 0)\n\t\t{\n\t\t\tgameObj[5].add(new SpaceStation());\n\t\t\tSystem.out.println(\"SpaceStat... | [
"0.5537048",
"0.54188204",
"0.53972304",
"0.5340573",
"0.5313366",
"0.5242609",
"0.50615674",
"0.5051019",
"0.504971",
"0.5026851",
"0.49915794",
"0.4978384",
"0.49736872",
"0.49702793",
"0.49139914",
"0.48939186",
"0.48285785",
"0.4815401",
"0.48065665",
"0.48029345",
"0.479... | 0.46650493 | 30 |
Returns the database path. | public String getPath() {
return this.path;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String getDatabaseDirectoryPath();",
"public static String getPathDB() {\n return pathDB;\n }",
"public String getDbpath() {\n return dbpath;\n }",
"String getDbPath(String dbName);",
"public String getPath() { return db.getPath(); }",
"private static String getDBPath() {\r\n\t\ttry {... | [
"0.82793695",
"0.81663585",
"0.79991955",
"0.79234576",
"0.7828631",
"0.7676649",
"0.7605234",
"0.760484",
"0.7313985",
"0.72701347",
"0.7267528",
"0.7263885",
"0.7102486",
"0.70391595",
"0.70391595",
"0.70391595",
"0.70391595",
"0.6982891",
"0.6929933",
"0.6884172",
"0.68596... | 0.0 | -1 |
Updates min/max values of all features | public void updateFeaturesMinMax() throws DatabaseAccessException {
Statement stmt;
ResultSet rs;
try {
stmt = this.connection.createStatement();
rs = stmt.executeQuery("SELECT Id FROM Features;");
ArrayList<Integer> featureIds = new ArrayList<Integer>();
while (rs.next()) {
featureIds.add(rs.getInt("Id"));
}
stmt.close();
for (Integer id : featureIds) {
stmt = this.connection.createStatement();
rs = stmt.executeQuery("SELECT MIN(\"" + id + "\"), MAX(\"" + id + "\") FROM Objects;");
float min = rs.getFloat(1);
float max = rs.getFloat(2);
rs.close();
stmt.close();
PreparedStatement prepStmt = this.connection
.prepareStatement("UPDATE Features SET Min=?, Max=? WHERE Id=?");
prepStmt.setFloat(1, min);
prepStmt.setFloat(2, max);
prepStmt.setInt(3, id);
prepStmt.execute();
prepStmt.close();
}
} catch (SQLException ex) {
throw new DatabaseAccessException(Failure.WRITE);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void updateMinMax( ) {\r\n if( (data == null) || (data.size() < 1) ) {\r\n min = 0.0;\r\n max = 0.0;\r\n return;\r\n }\r\n\r\n min = data.get( 0 );\r\n max = data.get( 0 );\r\n\r\n for( int i = 1; i < data.size(); i++ ) {\r\n if(... | [
"0.73796284",
"0.7106098",
"0.6913958",
"0.67289114",
"0.67020893",
"0.6522194",
"0.64763564",
"0.6424152",
"0.6314014",
"0.63049483",
"0.61951786",
"0.61675465",
"0.61581784",
"0.5927169",
"0.5886379",
"0.5848939",
"0.5843493",
"0.5809575",
"0.57722473",
"0.5754968",
"0.5590... | 0.73343986 | 1 |
Returns the error message resulted in failing to verify the PKIMessage The error message is set if verify() returns false. | public String getErrorMessage() {
return this.errMsg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public java.lang.String getErrorMessage() {\n java.lang.Object ref = errorMessage_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n errorMessage_ = s;\n return s;\n } else {\n... | [
"0.62527764",
"0.62507313",
"0.622379",
"0.62221736",
"0.6213976",
"0.62107307",
"0.62107307",
"0.62107307",
"0.6209846",
"0.6209846",
"0.6209846",
"0.6209846",
"0.6209846",
"0.6209846",
"0.6209846",
"0.6179831",
"0.6179831",
"0.6179831",
"0.6179831",
"0.6179831",
"0.6179831"... | 0.0 | -1 |
Returns the name of the authentication module that was successfully used to authenticate the message. The authentication module is set if verify() returns true. | public ICMPAuthenticationModule getUsedAuthenticationModule() {
return this.authModule;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getAuthMethod() {\n return AUTH_NAME;\n }",
"public String getAuthentication() {\r\n return authentication;\r\n }",
"public String getName() {\n return Token2Constants.AUTHENTICATOR_NAME;\n }",
"public boolean authenticationSucceeded() {\n\t\treturn authenticated;\... | [
"0.6004171",
"0.57602245",
"0.5535326",
"0.5461074",
"0.54180324",
"0.54180324",
"0.54180324",
"0.54029125",
"0.5352619",
"0.5352619",
"0.5352619",
"0.53397757",
"0.53397757",
"0.53397757",
"0.52620333",
"0.5251151",
"0.5244894",
"0.52265155",
"0.52221787",
"0.5220359",
"0.52... | 0.646751 | 0 |
Verifies the authenticity of msg | public boolean verify(final PKIMessage msg, final String username) {
if (log.isTraceEnabled()) {
log.trace(">verify");
}
boolean ret = false;
final String authModules = CmpConfiguration.getAuthenticationModule();
final String authparameters = CmpConfiguration.getAuthenticationParameters();
final String modules[] = authModules.split(";");
final String params[] = authparameters.split(";");
ICMPAuthenticationModule module = null;
int i=0;
while (i<modules.length) {
if (log.isDebugEnabled()) {
log.debug("Trying to verify the message authentication by using: " + modules[i] );
log.debug("Authentication module parameter: " + (params[i]!=null ? params[i]:"null") );
}
module = getAuthModule(modules[i].trim(), params[i].trim(), msg);
if((module != null) && module.verifyOrExtract(msg, username)) {
this.authModule = module;
ret = true;
break;
}
if ((module != null) && (module.getErrorMessage() != null)) {
errMsg = module.getErrorMessage();
}
i++;
}
if (log.isTraceEnabled()) {
log.trace("<verify: "+ret);
}
return ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean verify(String message) {\n try {\n String[] messageParts = message.split(\" \"); //messageParts[0] is <HMAC>\n //base64-decode <HMAC>\n byte[] receivedHash = Base64.decode(messageParts[0]);\n String otherMessageParts = message\n .... | [
"0.67110676",
"0.6431759",
"0.6316876",
"0.62501246",
"0.60756475",
"0.5968038",
"0.59010834",
"0.58813876",
"0.5840391",
"0.5839106",
"0.57832474",
"0.57426834",
"0.56980455",
"0.5647378",
"0.5559433",
"0.5540938",
"0.55047417",
"0.55000556",
"0.54852116",
"0.54173565",
"0.5... | 0.6298597 | 3 |
Returns the authentication module whose name is 'module' | private ICMPAuthenticationModule getAuthModule(final String module, final String parameter, final PKIMessage pkimsg) {
if(StringUtils.equals(module, CmpConfiguration.AUTHMODULE_HMAC)) {
final HMACAuthenticationModule hmacmodule = new HMACAuthenticationModule(parameter);
hmacmodule.setSession(this.admin, this.userAdminSession, this.certificateStoreSession);
hmacmodule.setCaInfo(this.cainfo);
return hmacmodule;
} else if(StringUtils.equals(module, CmpConfiguration.AUTHMODULE_ENDENTITY_CERTIFICATE)) {
final EndEntityCertificateAuthenticationModule eemodule = new EndEntityCertificateAuthenticationModule(parameter);
eemodule.setSession(this.admin, this.caAdminSession, this.certificateStoreSession, this.authorizationSessoin, this.eeProfileSession, this.userAdminSession);
return eemodule;
}
if(!CmpConfiguration.getRAOperationMode()) {
if(StringUtils.equals(module, CmpConfiguration.AUTHMODULE_REG_TOKEN_PWD)){
return new RegTokenPasswordExtractor();
} else if(StringUtils.equals(module, CmpConfiguration.AUTHMODULE_DN_PART_PWD)) {
return new DnPartPasswordExtractor(parameter);
}
}
errMsg = "Unrecognized authentication module '" + module + "'";
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public java.lang.CharSequence getModule() {\n return module;\n }",
"public java.lang.CharSequence getModule() {\n return module;\n }",
"public ICMPAuthenticationModule getUsedAuthenticationModule() {\n\t\treturn this.authModule;\n\t}",
"public abstract String getModuleName( );",
"String getModu... | [
"0.6534928",
"0.65051234",
"0.645674",
"0.63632625",
"0.6269496",
"0.6214113",
"0.612932",
"0.6122649",
"0.60982406",
"0.6032232",
"0.60314184",
"0.6013856",
"0.5995447",
"0.59285694",
"0.59035766",
"0.5892119",
"0.5821067",
"0.5816286",
"0.581196",
"0.5793794",
"0.5793794",
... | 0.63173115 | 4 |
It loads a map from map file txt, accepts integers from the file and passes the integer value to the map constructor. | public static Map loadMap(String MapFile){
int Bottle =0;
int Bottle1= 0;
Map Object = new Map(0,0);
try {
Scanner scan = new Scanner(new File(MapFile));
FileReader fr = new FileReader(MapFile);
while(scan.hasNextLine()){
if (scan.hasNextInt()){
Bottle = scan.nextInt();
Bottle1 = scan.nextInt();
}
Object = new Map(Bottle,Bottle1);
}
fr.close();
}
catch (Exception e){
System.out.println("Sorry Nothing Found");
System.out.println(e.toString());
e.printStackTrace();
}
return Object;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static Map readMap(File f)\n {\n Map map = new Map(1);\n try\n {\n MapReader run = new MapReader();\n Scanner mapReader = new Scanner(f);\n ArrayList<String[]> numberLines = new ArrayList<String[]>();\n int dim = mapReader.nextInt();\n ... | [
"0.7292605",
"0.7038616",
"0.69150436",
"0.6648618",
"0.6618025",
"0.65592605",
"0.6546824",
"0.65380377",
"0.6510795",
"0.64784336",
"0.6449052",
"0.6387763",
"0.6369907",
"0.6283092",
"0.62696296",
"0.6263968",
"0.6227034",
"0.6203549",
"0.6099345",
"0.6078452",
"0.60298485... | 0.785188 | 0 |
Returns the message's type. | public abstract int getType(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"MessageType getType();",
"public String getMessageType()\r\n\t{\r\n\t\treturn this.messageType;\r\n\t}",
"public java.lang.String getMessageType() {\r\n return messageType;\r\n }",
"public String getMessageType() {\n return type.getMessage().getName();\n }",
"public Utils.MessageType getMessa... | [
"0.8418045",
"0.8411521",
"0.8321378",
"0.83184046",
"0.82782096",
"0.81800634",
"0.80606467",
"0.8023289",
"0.80146337",
"0.8014441",
"0.80070764",
"0.7989515",
"0.79824865",
"0.79824865",
"0.79172283",
"0.78643286",
"0.7849148",
"0.7772846",
"0.77610254",
"0.7714924",
"0.77... | 0.0 | -1 |
sets the left bitmap | public void setBitmapLeft(Bitmap b){
imgLeft = b;
left.setBitmap(b);
invalidate();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setBitmapRight(Bitmap b){\n\t\timgRight = b;\n\t\tright.setBitmap(b);\n\t\tinvalidate();\n\t}",
"public void setLeft(AVLNode<E> left) {\r\n\t\tthis.left = left;\r\n\t}",
"public void setLeft(BinNode<E> l)\n {\n left = l;\n }",
"public void setLeft() {\n\t\tstate = State.LEFT;\n\t}",
... | [
"0.65295345",
"0.63819075",
"0.63686043",
"0.6318216",
"0.63034844",
"0.62516046",
"0.6151049",
"0.6088505",
"0.60588384",
"0.6052909",
"0.6051465",
"0.6041365",
"0.6022079",
"0.59941417",
"0.5991518",
"0.59905255",
"0.5982874",
"0.59482723",
"0.59482723",
"0.59439474",
"0.59... | 0.844237 | 0 |
sets the right bitmap | public void setBitmapRight(Bitmap b){
imgRight = b;
right.setBitmap(b);
invalidate();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setBitmap(Bitmap bitmap) {\n\t\t\n\t}",
"void setImage(Bitmap bitmap);",
"private void setImage(Bitmap image) {\n }",
"public void setBitmap(Bitmap bitmap){\n this.bitmap = Bitmap.createScaledBitmap(bitmap,(int)(bitmap.getWidth()*bitmapScale),(int)(bitmap.getHeight()*bitmapScale),false)... | [
"0.77171695",
"0.7408676",
"0.7143649",
"0.7128524",
"0.70470613",
"0.6838244",
"0.67303723",
"0.668977",
"0.66225064",
"0.65202844",
"0.649522",
"0.63892263",
"0.6364041",
"0.63386315",
"0.6286176",
"0.6278663",
"0.6268197",
"0.6267158",
"0.62643653",
"0.6234867",
"0.6223742... | 0.7150767 | 2 |
called whenever the image is dragged | public void requestDragFocus(Piece p, float grabX, float grabY) {
if (p != null) {
_dragFocus = p; // the piece that is dragged
_grabPointX = grabX; // the x point which it was grabbed at
_grabPointY = grabY; // the y point which it was grabbed at
// the boundaries to make sure it stays in the square
leftX = _dragFocus.getXClip();
leftY = _dragFocus.getYClip();
rightX = _dragFocus.getXClip()+_dragFocus.getW() - (_dragFocus.getBitmap().getWidth());
rightY = _dragFocus.getYClip()+_dragFocus.getH() - (_dragFocus.getBitmap().getHeight());
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void onDragged();",
"@Override\n\t\t\tpublic void mouseDragged(MouseEvent e) {\n\t\t\t}",
"@Override\n\t\tpublic void mouseDragged(MouseEvent e) {\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void mouseDragged(MouseEvent e) {\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void mouseDragged(MouseEvent e) {\n\t\t\t\n\t\... | [
"0.8045257",
"0.7505113",
"0.7494676",
"0.7494676",
"0.7494676",
"0.7490699",
"0.7490699",
"0.7481952",
"0.7420416",
"0.74189496",
"0.74089366",
"0.7402358",
"0.740199",
"0.74002147",
"0.73977965",
"0.73977965",
"0.73945504",
"0.7391589",
"0.73876673",
"0.73876673",
"0.738766... | 0.0 | -1 |
Allocates a new receive buffer whose capacity is probably large enough to read all inbound data and small enough not to waste its space. | public interface RecvByteBufAllocator {
/**
* Creates a new handle. The handle provides the actual operations and keeps the internal information which is
* required for predicting an optimal buffer capacity.
*/
Handle newHandle();
interface Handle {
/**
* Creates a new receive buffer whose capacity is probably large enough to read all inbound data and small
* enough not to waste its space.
*/
ByteBuf allocate(ByteBufAllocator alloc);
/**
* Similar to {@link #allocate(ByteBufAllocator)} except that it does not allocate anything but just tells the
* capacity.
*/
int guess();
/**
* Records the the actual number of read bytes in the previous read operation so that the allocator allocates
* the buffer with potentially more correct capacity.
*
* @param actualReadBytes the actual number of read bytes in the previous read operation
*/
void record(int actualReadBytes);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void fillReceiveBuffer(final int requestedSize) {\n ByteBuffer readBuffer = receiveBuffer;\n if (requestedSize > receiveBuffer.capacity()) {\n readBuffer = socketService.getByteBuffer(requestedSize);\n readBuffer.put(receiveBuffer).flip();\n socketService.releaseByteBuffer(receiveBuffe... | [
"0.7594373",
"0.67068505",
"0.6383847",
"0.58835226",
"0.58726704",
"0.58000237",
"0.5676667",
"0.5650768",
"0.5618627",
"0.56044924",
"0.5592351",
"0.55782473",
"0.55764717",
"0.5573167",
"0.55502677",
"0.5522942",
"0.5519637",
"0.55084664",
"0.55040056",
"0.55004615",
"0.54... | 0.6075832 | 3 |
Creates a new handle. The handle provides the actual operations and keeps the internal information which is required for predicting an optimal buffer capacity. | Handle newHandle(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic AssetManageReqHandle create(long handleId) {\n\t\tAssetManageReqHandle assetManageReqHandle = new AssetManageReqHandleImpl();\n\n\t\tassetManageReqHandle.setNew(true);\n\t\tassetManageReqHandle.setPrimaryKey(handleId);\n\n\t\treturn assetManageReqHandle;\n\t}",
"protected abstract T newObject... | [
"0.618816",
"0.6158916",
"0.5980845",
"0.5843198",
"0.5664781",
"0.5611101",
"0.5587276",
"0.5491085",
"0.54277444",
"0.54200786",
"0.53962666",
"0.53875715",
"0.53845215",
"0.53820896",
"0.53348345",
"0.53101593",
"0.53101593",
"0.53101593",
"0.52162194",
"0.51811033",
"0.51... | 0.7163859 | 0 |
Creates a new receive buffer whose capacity is probably large enough to read all inbound data and small enough not to waste its space. | ByteBuf allocate(ByteBufAllocator alloc); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void fillReceiveBuffer(final int requestedSize) {\n ByteBuffer readBuffer = receiveBuffer;\n if (requestedSize > receiveBuffer.capacity()) {\n readBuffer = socketService.getByteBuffer(requestedSize);\n readBuffer.put(receiveBuffer).flip();\n socketService.releaseByteBuffer(receiveBuffe... | [
"0.72177523",
"0.62623674",
"0.6019303",
"0.57656986",
"0.5759958",
"0.5663622",
"0.56524754",
"0.5607777",
"0.560289",
"0.55889267",
"0.55781174",
"0.55470073",
"0.5534051",
"0.5515581",
"0.5493077",
"0.54751796",
"0.5458943",
"0.54286075",
"0.5423685",
"0.5384768",
"0.53733... | 0.4834252 | 79 |
Records the the actual number of read bytes in the previous read operation so that the allocator allocates the buffer with potentially more correct capacity. | void record(int actualReadBytes); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected int populateBuffer()\n {\n interlock.beginReading();\n // System.out.println(\"populateBuffer: 2\");\n return byteBuffer.limit();\n }",
"public final int bytesConsumed() {\n/* 218 */ return this.bytesConsumed;\n/* */ }",
"public int getBufferSize() {\n retu... | [
"0.6838334",
"0.6750948",
"0.65591335",
"0.6548127",
"0.6412514",
"0.63901734",
"0.6362348",
"0.6265807",
"0.62506044",
"0.62202233",
"0.6139472",
"0.6123994",
"0.6093656",
"0.6088947",
"0.60835797",
"0.60438704",
"0.6036929",
"0.60299754",
"0.6025093",
"0.60212064",
"0.59713... | 0.6996694 | 0 |
/ renamed from: a | private C11138i<T> m28808a() {
C11138i<T> iVar = this.f28973g;
if (iVar != null) {
return iVar;
}
C11138i<T> a = this.f28969c.mo32447a(this.f28971e, this.f28970d);
this.f28973g = a;
return a;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }",
"public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }",
"interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}",
"interface C33292a {\n /* renamed fr... | [
"0.62497115",
"0.6242887",
"0.61394435",
"0.61176854",
"0.6114027",
"0.60893",
"0.6046901",
"0.6024682",
"0.60201293",
"0.5975212",
"0.59482527",
"0.59121317",
"0.5883635",
"0.587841",
"0.58703005",
"0.5868436",
"0.5864884",
"0.5857492",
"0.58306104",
"0.5827752",
"0.58272064... | 0.0 | -1 |
/ renamed from: a | public static TypeAdapterFactory m28807a(C11261a<?> aVar, Object obj) {
return new C11210c(obj, aVar, aVar.getType() == aVar.getRawType(), null);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }",
"public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }",
"interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}",
"interface C33292a {\n /* renamed fr... | [
"0.62497115",
"0.6242887",
"0.61394435",
"0.61176854",
"0.6114027",
"0.60893",
"0.6046901",
"0.6024682",
"0.60201293",
"0.5975212",
"0.59482527",
"0.59121317",
"0.5883635",
"0.587841",
"0.58703005",
"0.5868436",
"0.5864884",
"0.5857492",
"0.58306104",
"0.5827752",
"0.58272064... | 0.0 | -1 |
This interface defines the process output handler which is used to update the fax job based on the process output information. | public interface ProcessOutputHandler
{
/**
* Updates the fax job based on the data from the process output.
*
* @param faxClientSpi
* The fax client SPI
* @param faxJob
* The fax job object
* @param processOutput
* The process output
* @param faxActionType
* The fax action type
*/
public void updateFaxJob(FaxClientSpi faxClientSpi,FaxJob faxJob,ProcessOutput processOutput,FaxActionType faxActionType);
/**
* This function extracts the fax job status from the process output.
*
* @param faxClientSpi
* The fax client SPI
* @param processOutput
* The process output
* @return The fax job status
*/
public FaxJobStatus getFaxJobStatus(FaxClientSpi faxClientSpi,ProcessOutput processOutput);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void processOutput() {\n\n\t}",
"public abstract void onProcess();",
"public void invokeOutFlowHandlers(ProcessContext processContext) throws GFacException;",
"@Override\n\t\t\tpublic void onProcess(int process) {\n\t\t\t}",
"public void updateFaxJob(FaxClientSpi faxClientSpi,FaxJob faxJob,ProcessOu... | [
"0.67187226",
"0.6656104",
"0.6551847",
"0.6494084",
"0.64333487",
"0.62312794",
"0.6113339",
"0.6054026",
"0.6018855",
"0.6015622",
"0.597306",
"0.5910726",
"0.58135676",
"0.5778075",
"0.5742474",
"0.5677849",
"0.56502175",
"0.5643894",
"0.56414866",
"0.5621802",
"0.5616756"... | 0.8290934 | 0 |
Updates the fax job based on the data from the process output. | public void updateFaxJob(FaxClientSpi faxClientSpi,FaxJob faxJob,ProcessOutput processOutput,FaxActionType faxActionType); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract void updateFaxJobFromInputDataImpl(T inputData,FaxJob faxJob);",
"public void updateFaxJobFromInputData(T inputData,FaxJob faxJob)\n {\n if(!this.initialized)\n {\n throw new FaxException(\"Fax bridge not initialized.\");\n }\n \n //get fax job\... | [
"0.67601734",
"0.63859767",
"0.63451636",
"0.58458203",
"0.5647142",
"0.5482608",
"0.5456585",
"0.5121926",
"0.5120989",
"0.5116078",
"0.51144135",
"0.5064515",
"0.5062548",
"0.5057331",
"0.5019858",
"0.5019858",
"0.5019858",
"0.50064886",
"0.4999733",
"0.4996169",
"0.4995377... | 0.7492923 | 0 |
This function extracts the fax job status from the process output. | public FaxJobStatus getFaxJobStatus(FaxClientSpi faxClientSpi,ProcessOutput processOutput); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getJobStatus(int jNo);",
"public interface ProcessOutputHandler\n{\n /**\n * Updates the fax job based on the data from the process output.\n * \n * @param faxClientSpi\n * The fax client SPI\n * @param faxJob\n * The fax job object\n * @param pr... | [
"0.60001665",
"0.5657387",
"0.55317146",
"0.5504599",
"0.5499523",
"0.54816407",
"0.54274565",
"0.54201126",
"0.54201126",
"0.5346557",
"0.5295921",
"0.5268637",
"0.52340037",
"0.5208302",
"0.52070266",
"0.51406235",
"0.5104415",
"0.51033866",
"0.5096682",
"0.5087649",
"0.505... | 0.70517063 | 0 |
TODO Autogenerated method stub lOGICAL OPERATORS ARE PERFORMED ON 2 RELATIONAL EXPRESIONS AND Operator && When && (AND) operator is used : the out is going to be TRUE only when both the relation expression is true | public static void main(String[] args) {
int x=300;
int y=500;
int z=500;
//((x<y) && (x<z)) // logical expression in Java
// (true && true) // the output is going to be true
//((x==y) && (x>z))
//( false && False) // the final output is going to be False
//((x>y) && (x<z))
//( false && true) // the final output is going to be False
if((x==y)&&(x>z)) // compound condition
{
System.out.println("execute the block of code");
}
boolean results= ((x<y)&&(x<z)); // true
System.out.println(results);
//OR operator ||
// In case of OR operator,
//if anyone of the relational expression is true, the final output is going to be true
// x=400;
// y=500;
// z=400;
//((x<y) || (x==z))
// ( true || true) ----> true
// false || true ----> TRUE
// false || false----> false
// True || False --->true
int age= 30;
if((age==30)||(age>18))
{
System.out.println("give the licence to customer");
}
// Not operator ! - if the original value of the expression is true, and if we use ! operator on it,
//the output will be changed to False
int x1=100;
int y1=50;
if(!(x1==y1)) // x1 not equal to y1 ---true
// !(x==y)
{
System.out.println("the output is true");
}
// x>y --> 100>50 --->true
//!(x>y) ---!(100>50) ---> False
// 100 is not greater than 50 ---> false
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static void andify(List<ExternalizedStateComponent> inputs, ExternalizedStateComponent output, ExternalizedStateConstant trueProp) {\n\t\tfor(ExternalizedStateComponent c : inputs) {\n\t\t\tif(c instanceof ExternalizedStateConstant && !((ExternalizedStateConstant)c).getValue()) {\n\t\t\t\t//Connect false (... | [
"0.60093015",
"0.59919006",
"0.5842405",
"0.5758164",
"0.5694268",
"0.5645351",
"0.5625509",
"0.56147057",
"0.55822325",
"0.5572603",
"0.5571026",
"0.55516416",
"0.55398375",
"0.5522207",
"0.5502901",
"0.5496837",
"0.5495677",
"0.54543895",
"0.54356337",
"0.5428853",
"0.54109... | 0.0 | -1 |
The class holding records for this type | @Override
public Class<SessionPollRecord> getRecordType() {
return SessionPollRecord.class;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public RecordRecord() {\n\t\tsuper(org.jooq.examples.cubrid.demodb.tables.Record.RECORD);\n\t}",
"public Class<?> getRecordClass() \n\t{\n\t return recordClass ;\n\t}",
"public DataRecord() {\n super(DataTable.DATA);\n }",
"@Override\n public Class<Record> getRecordType() {\n return Re... | [
"0.68004626",
"0.66954035",
"0.64103794",
"0.6398801",
"0.6398801",
"0.6398801",
"0.6398801",
"0.6393993",
"0.6354873",
"0.6192012",
"0.61258304",
"0.61258304",
"0.61258304",
"0.6104736",
"0.60470754",
"0.60470754",
"0.60470754",
"0.6040716",
"0.6029211",
"0.6020949",
"0.6008... | 0.0 | -1 |
Create a public.session_poll table reference | public SessionPoll() {
this("session_poll", null);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void createPollTables(DataSource ds) {\n\t\tConnection con = null;\n\t\ttry {\n\t\t\tcon = ds.getConnection();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tPreparedStatement pst = null;\n\t\ttry {\n\t\t\tpst = con.prepareStatement(\n\t\t\t\t\t\"CREATE TABLE Polls\\r\\n\" + \"(i... | [
"0.6074723",
"0.6046247",
"0.52312446",
"0.5206694",
"0.5036366",
"0.49823362",
"0.49671003",
"0.4897851",
"0.4856532",
"0.48380658",
"0.4804503",
"0.47577676",
"0.46816722",
"0.467888",
"0.4672079",
"0.46647292",
"0.4653573",
"0.46346152",
"0.46016806",
"0.45995703",
"0.4585... | 0.60665196 | 1 |
Create an aliased public.session_poll table reference | public SessionPoll(String alias) {
this(alias, SESSION_POLL);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void createTableListenings() {\n\t\tString query = \n\t\t\t\t\"CREATE TABLE IF NOT EXISTS Listenings (\" \t\t\t\t\t\t\t+\n\t\t\t\t\"user\t\t\tVARCHAR(128),\" \t\t\t\t\t\t\t\t\t\t+\n\t\t\t\t\"track\t\t\tVARCHAR(259),\" \t\t\t\t\t\t\t\t\t\t+\n\t\t\t\t\"playcount\t\tINTEGER,\" \t\t\t\t\t\t\t\t\t\t\t+ \n\t\t... | [
"0.510877",
"0.5086602",
"0.5020474",
"0.47995132",
"0.4749471",
"0.45399758",
"0.4512812",
"0.45094064",
"0.44806656",
"0.44693735",
"0.44424686",
"0.44227105",
"0.44104153",
"0.43719268",
"0.4329224",
"0.4328783",
"0.4267735",
"0.4256508",
"0.42561564",
"0.42498362",
"0.424... | 0.55095077 | 0 |
Method for adding items to an array in order | public static void inventory(String name, String[] array1) {
// Adds input to the next available spot in the specified array
for (int i = 0; i < array1.length; i++) {
if (array1[i] == null) {
array1[i] = name;
break;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void insert(int newItem){\n itemArray[count] = newItem;\n count++;\n }",
"@Override\n public void add(T t) {\n checkIfArrayFull();\n\n arrayList[elementsInArray] = t;\n elementsInArray++;\n }",
"public void addItems(K[] items) {\n\n\t\tfor (K item : items) {\n... | [
"0.6615831",
"0.64801306",
"0.6331203",
"0.6248477",
"0.62377095",
"0.62214464",
"0.6206648",
"0.6204346",
"0.61972404",
"0.6184358",
"0.6167735",
"0.6160769",
"0.6121079",
"0.6108576",
"0.6101751",
"0.6097365",
"0.6080764",
"0.6057246",
"0.6050325",
"0.60439503",
"0.6038021"... | 0.0 | -1 |
Method for accounting number of items bought if item is not unique to customer | public static void addSame(int num, String name, int[] array1, String[] array2) {
// Adds count to the appropriate array index
for (int i = 0; i < array1.length; i++) {
if (name.equals(array2[i])) {
array1[i] = array1[i] + num;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void incrementAmountBought() {\n amountBought++;\n }",
"int getNumOfBuyOrders();",
"public int getAmountBought() {\n //System.out.println(clientName + \" has bought \" + amountBought + \" shares of \" + companyName);\n return amountBought;\n }",
"int getPurchasableOffersCoun... | [
"0.68937135",
"0.67390436",
"0.66539675",
"0.660445",
"0.6486979",
"0.64661276",
"0.6439615",
"0.64248985",
"0.64179194",
"0.63592356",
"0.6346966",
"0.6307789",
"0.6284942",
"0.626687",
"0.62385035",
"0.6229141",
"0.617621",
"0.6102673",
"0.6093176",
"0.60738885",
"0.6058658... | 0.0 | -1 |
Method for accounting number of items bought if item is unique to customer | public static void addUnique(int num, String name, int[] array1, String[] array2, int[] array3) {
// Adds count to the appropriate array index
for (int i = 0; i < array1.length; i++) {
if (name.equals(array2[i])) {
array1[i] = array1[i] + num;
array3[i] = array3[i] + 1;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void incrementAmountBought() {\n amountBought++;\n }",
"int getNumOfBuyOrders();",
"int getPurchasableOffersCount();",
"public int getAmountBought() {\n //System.out.println(clientName + \" has bought \" + amountBought + \" shares of \" + companyName);\n return amountBought;\n ... | [
"0.6904966",
"0.68046385",
"0.6729949",
"0.66210735",
"0.6516071",
"0.64479005",
"0.6430657",
"0.6381086",
"0.6304272",
"0.628445",
"0.6282561",
"0.6278664",
"0.6278089",
"0.6272061",
"0.62683386",
"0.6174818",
"0.6137137",
"0.6123441",
"0.60890925",
"0.60458624",
"0.6045447"... | 0.0 | -1 |
Method to see if item is unique from a customer | public static boolean isUnique(String name, String[] array1) {
// Searches through the store item arrays and see if it's the same
for (int i = 0; i < array1.length; i++) {
if (name.equals(array1[i])) {
return false;
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean isIsUnique();",
"@objid (\"ef9777b4-ed2a-4341-bb22-67675cddb70a\")\n boolean isIsUnique();",
"boolean isUnique();",
"public boolean isUnique();",
"public boolean containsCustomer(String c){\n\t\tfor (int i = 0; i < this.list.size(); i++){\n\t\t\tif( c.equals(list.get(i).getUsername()) ){\n\t\t\t... | [
"0.6961384",
"0.69023854",
"0.6881014",
"0.6793802",
"0.64714926",
"0.6411531",
"0.63008857",
"0.63008857",
"0.6268046",
"0.6265835",
"0.6223301",
"0.6209938",
"0.61917305",
"0.6129591",
"0.61016667",
"0.6067712",
"0.60583055",
"0.60218257",
"0.60205376",
"0.6015497",
"0.6014... | 0.0 | -1 |
Create a sale Permissions Needed: SALES_ADMIN | @Test
public void createCatalogSaleTest() {
CatalogSale catalogSale = null;
// CatalogSale response = api.createCatalogSale(catalogSale);
// TODO: test validations
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void create(Sale sale) {\n sale_dao.create(sale);\n }",
"public void updateAccountingSystem(Sale sale)\n {\n \n }",
"@SuppressWarnings(\"unchecked\")\n\tpublic boolean makeNewSale() throws PreconditionException {\n\t\t/* check precondition */\n\t\tif (true) \n\t\t{ \n\t\t\t/* Logi... | [
"0.58384126",
"0.5542626",
"0.55071056",
"0.5457213",
"0.5392109",
"0.53751636",
"0.5367562",
"0.53609335",
"0.52552354",
"0.522335",
"0.5212633",
"0.5202215",
"0.517512",
"0.51554173",
"0.51404405",
"0.5132153",
"0.5116211",
"0.5108389",
"0.5087952",
"0.50862247",
"0.5071533... | 0.5270539 | 8 |
Delete a sale Permissions Needed: SALES_ADMIN | @Test
public void deleteCatalogSaleTest() {
Integer id = null;
// Void response = api.deleteCatalogSale(id);
// TODO: test validations
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void delete(Sale sale) {\n sale_dao.delete(sale);\n }",
"@Override\r\n\tpublic void deleteBySSO(String sso) {\n\t\t\r\n\t}",
"public void delete(SecRole entity);",
"public int deleteAllPermissions() throws DAOException;",
"int deleteByExample(SysRoleDOExample example);",
"@Override\n ... | [
"0.6801549",
"0.6075102",
"0.59524894",
"0.59497076",
"0.5823419",
"0.5742642",
"0.5665595",
"0.5614002",
"0.56070775",
"0.56009436",
"0.5571148",
"0.5555926",
"0.55162704",
"0.5480341",
"0.54796666",
"0.54475224",
"0.5442224",
"0.54231936",
"0.54119974",
"0.54106385",
"0.540... | 0.53351074 | 32 |
Get a single sale Permissions Needed: SALES_USER or SALES_ADMIN | @Test
public void getCatalogSaleTest() {
Integer id = null;
// CatalogSale response = api.getCatalogSale(id);
// TODO: test validations
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<SecRight> getAllRights(int type);",
"public int getSale() {\n\t\treturn sale;\r\n\t}",
"public int getPermission(Integer resourceId);",
"int getPermissionRead();",
"String getPermission();",
"public List<Permission> getPermissions(User user) throws UserManagementException;",
"int getPremium... | [
"0.5425804",
"0.5300734",
"0.51998556",
"0.5186482",
"0.51217896",
"0.51054037",
"0.5051343",
"0.5028513",
"0.5003312",
"0.49326438",
"0.4916547",
"0.49154103",
"0.49040258",
"0.4894703",
"0.48825517",
"0.48765105",
"0.48735276",
"0.48534754",
"0.4850936",
"0.48050347",
"0.47... | 0.0 | -1 |
List and search sales Permissions Needed: SALES_USER or SALES_ADMIN | @Test
public void getCatalogSalesTest() {
Integer size = null;
Integer page = null;
String order = null;
// PageResourceCatalogSale response = api.getCatalogSales(size, page, order);
// TODO: test validations
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<SecRight> getAllRights(int type);",
"public int getCountAllSecRoles();",
"public List<RightInfoDTO> findUserRights(String userNo) throws DataAccessException;",
"public List getSysRoles(SysRole sysRole);",
"boolean allGranted(String roles);",
"@Test\n public void testSysPer(){\n List... | [
"0.5962965",
"0.5745667",
"0.5569361",
"0.5562167",
"0.54879814",
"0.54778606",
"0.5447059",
"0.5440729",
"0.54252326",
"0.53228664",
"0.5314805",
"0.5285351",
"0.5266197",
"0.52500945",
"0.52492315",
"0.5219188",
"0.5151813",
"0.51444787",
"0.5139248",
"0.5121682",
"0.510049... | 0.4708543 | 84 |
Update a sale Permissions Needed: SALES_ADMIN | @Test
public void updateCatalogSaleTest() {
Integer id = null;
CatalogSale catalogSale = null;
// CatalogSale response = api.updateCatalogSale(id, catalogSale);
// TODO: test validations
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void updateAccountingSystem(Sale sale)\n {\n \n }",
"public int modifySale(SaleVO vo) {\n\t\treturn sale.Modify(vo);\r\n\t}",
"@Override\n\tpublic int update(ShiroRolesPermissionsPoEntity entity) {\n\t\treturn 0;\n\t}",
"public void update(Sale sale) {\n sale_dao.update(sale);\n ... | [
"0.69769335",
"0.5970946",
"0.59365225",
"0.58797055",
"0.5728999",
"0.5719415",
"0.57161576",
"0.5662299",
"0.56141716",
"0.548403",
"0.5469036",
"0.5424728",
"0.54051447",
"0.53985786",
"0.5368918",
"0.53183126",
"0.5311137",
"0.52834004",
"0.5246379",
"0.5213769",
"0.52131... | 0.5325395 | 15 |
TODO Autogenerated method stub | @Override
protected void onPreExecute() {
super.onPreExecute();
dialog = new Dialog(Calendario.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.dialog_wait);
dialog.getWindow().setBackgroundDrawableResource(
R.drawable.dialog_rounded_corner_light_black);
dialog.show();
dialog.setCancelable(true);
dialog.setOnCancelListener(new OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
// TODO Auto-generated method stub
cancel(true);
finish();
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void onCancel(DialogInterface dialog) {
cancel(true);
finish();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub mResult = ManagerData.getTurniForDataAndLuogoAndCategoria( getIntent().getLongExtra("data", 0), getIntent() .getStringExtra("luogo"), getIntent() .getStringExtra("categoria")); | @Override
protected Void doInBackground(Void... params) {
mResult = ManagerData.getTurniForDataAndFunzione(getIntent()
.getLongExtra("dataFrom", 0),
getIntent().getLongExtra("dataTo", 0), getIntent()
.getStringExtra("personale"), funzione);
if (!((Boolean) mResult.get("connectionError")))
listTurni = (ArrayList<Turno>) mResult.get("params");
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n Trabajo newTrabajo = (Trabajo) data.getSerializableExtra(\"resultado\");\n\n if(newTrabajo.getId() != 0) { // Si NO es un Trabajo Nuevo Vacío, osea que no hayan Cancelado la operación\n Toast.makeText(getBase... | [
"0.607684",
"0.5928138",
"0.5877889",
"0.579735",
"0.57228696",
"0.5721483",
"0.5720888",
"0.56896913",
"0.5673008",
"0.5650479",
"0.5649531",
"0.56180495",
"0.5601059",
"0.55742174",
"0.5572657",
"0.5557141",
"0.55561775",
"0.5556097",
"0.5547072",
"0.55409753",
"0.55331206"... | 0.6201409 | 0 |
TODO Autogenerated method stub | @Override
protected void onPostExecute(Void result) {
super.onPostExecute(result);
dialog.dismiss();
// START ONPOST
if ((Boolean) mResult.get("connectionError")) {
Dialog noConnection = new Dialog(Calendario.this);
noConnection.requestWindowFeature(Window.FEATURE_NO_TITLE);
noConnection.setContentView(R.layout.dialog_no_connection);
noConnection.getWindow().setBackgroundDrawableResource(
R.drawable.dialog_rounded_corner_light_black);
noConnection.show();
noConnection.setCancelable(true);
noConnection.setOnCancelListener(new OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
// TODO Auto-generated method stub
finish();
}
});
} else {
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
LinearLayout mContainerOra = (LinearLayout) findViewById(R.id.container_lista_ora);
for (int i = 0; i < 21; i++) {
int time = 800 + 50 * i;
View rowOra = inflater.inflate(R.layout.row_ora, null,
false);
if (time % 100 == 0) {
((TextView) rowOra.findViewById(R.id.text_ora))
.setText(" " + (time / 100) + ":00 ");
} else {
((TextView) rowOra.findViewById(R.id.text_ora))
.setText(" " + (time / 100) + ":30 ");
}
rowOra.setLayoutParams(new LayoutParams(
LayoutParams.MATCH_PARENT,
LayoutParams.MATCH_PARENT, 0.5f));
mContainerOra.addView(rowOra);
}
mAllAScrollView = new ArrayList<ScrollView>();
ObservableScrollView mScroll = (ObservableScrollView) findViewById(R.id.scrollView2);
mScroll.setScrollViewListener(Calendario.this);
mAllAScrollView.add(mScroll);
ArrayList<Long> mListaGiorni = getListaGiorni();
ArrayList<View> list = new ArrayList<View>();
SimpleDateFormat dateFormatter = new SimpleDateFormat(
"dd.MM.yyyy", Locale.getDefault());
ArrayList<Turno> listaOrariForGiorno = new ArrayList<Turno>();
for (int i = 0; i < mListaGiorni.size(); i++) // # giorni
{
listaOrariForGiorno.clear();
for (int j = 0; j < listTurni.size(); j++) {
if (dateFormatter
.format(mListaGiorni.get(i))
.toString()
.equalsIgnoreCase(
dateFormatter.format(
listTurni.get(j).getData())
.toString()))
listaOrariForGiorno.add(listTurni.get(j));
}
View base = createBaseColoumn(mListaGiorni.get(i),
parseTurno(listaOrariForGiorno));
list.add(base);
}
String[] funzioneTokenized = ((FunzioneObj) (getIntent()
.getSerializableExtra("funzione"))).getFunzione()
.split(":");
View complex = createComplexColoumn(
funzioneTokenized[funzioneTokenized.length - 1],
list);
complex.setLayoutParams(new LayoutParams(
LayoutParams.MATCH_PARENT,
LayoutParams.MATCH_PARENT, 0.5f));
LinearLayout mContainer = (LinearLayout) findViewById(R.id.container_complex_coloumn);
mContainer.addView(complex);
}
// END ONPOST
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void onCancel(DialogInterface dialog) {
finish();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void onClick(View v) {
if (turno.getVolontari() != null) {
final Dialog dialog = new Dialog(Calendario.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.dialog_turno);
dialog.getWindow().setBackgroundDrawableResource(
R.drawable.dialog_rounded_corner);
((ListView) dialog
.findViewById(R.id.lista_volontari))
.setAdapter(new RowVolontario(
getApplicationContext(), turno
.getVolontari()));
((ListView) dialog
.findViewById(R.id.lista_volontari))
.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(
AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
// TODO Auto-generated method stub
final Utente mUtente = turno
.getVolontari().get(arg2);
if (mUtente.getNumeroTelefonico()
.equalsIgnoreCase("null")) {
AlertDialog.Builder builder = new AlertDialog.Builder(
Calendario.this);
builder.setTitle(getString(R.string.CONTATTO));
builder.setMessage(getString(R.string.NESSUN_NUMERO));
builder.setCancelable(false);
builder.setNeutralButton(
getString(R.string.CHIUDI),
new android.content.DialogInterface.OnClickListener() {
public void onClick(
DialogInterface dialog,
int id) {
dialog.dismiss();
}
});
builder.create().show();
} else {
AlertDialog.Builder builder = new AlertDialog.Builder(
Calendario.this);
builder.setTitle("Contatto");
builder.setMessage(getString(R.string.PROFILO_PHONE1)
+ " "
+ mUtente.getNome()
+ " "
+ mUtente.getCognome()
+ " "
+ getString(R.string.PROFILO_PHONE2)
+ " "
+ mUtente
.getNumeroTelefonico());
builder.setCancelable(false);
builder.setPositiveButton(
"Chiama",
new android.content.DialogInterface.OnClickListener() {
public void onClick(
DialogInterface dialog,
int id) {
dialog.dismiss();
Intent intent = new Intent(
Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:"
+ mUtente
.getNumeroTelefonico()));
startActivityForResult(
intent,
0);
}
});
builder.setNegativeButton(
"Chiudi",
new android.content.DialogInterface.OnClickListener() {
public void onClick(
DialogInterface dialog,
int id) {
dialog.dismiss();
}
});
builder.create().show();
}
}
});
dialog.show();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void onItemClick(
AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
final Utente mUtente = turno
.getVolontari().get(arg2);
if (mUtente.getNumeroTelefonico()
.equalsIgnoreCase("null")) {
AlertDialog.Builder builder = new AlertDialog.Builder(
Calendario.this);
builder.setTitle(getString(R.string.CONTATTO));
builder.setMessage(getString(R.string.NESSUN_NUMERO));
builder.setCancelable(false);
builder.setNeutralButton(
getString(R.string.CHIUDI),
new android.content.DialogInterface.OnClickListener() {
public void onClick(
DialogInterface dialog,
int id) {
dialog.dismiss();
}
});
builder.create().show();
} else {
AlertDialog.Builder builder = new AlertDialog.Builder(
Calendario.this);
builder.setTitle("Contatto");
builder.setMessage(getString(R.string.PROFILO_PHONE1)
+ " "
+ mUtente.getNome()
+ " "
+ mUtente.getCognome()
+ " "
+ getString(R.string.PROFILO_PHONE2)
+ " "
+ mUtente
.getNumeroTelefonico());
builder.setCancelable(false);
builder.setPositiveButton(
"Chiama",
new android.content.DialogInterface.OnClickListener() {
public void onClick(
DialogInterface dialog,
int id) {
dialog.dismiss();
Intent intent = new Intent(
Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:"
+ mUtente
.getNumeroTelefonico()));
startActivityForResult(
intent,
0);
}
});
builder.setNegativeButton(
"Chiudi",
new android.content.DialogInterface.OnClickListener() {
public void onClick(
DialogInterface dialog,
int id) {
dialog.dismiss();
}
});
builder.create().show();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void onScrollChanged(ObservableScrollView scrollView, int x, int y,
int oldx, int oldy) {
for (ScrollView child : mAllAScrollView)
child.scrollTo(x, y);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.