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 |
|---|---|---|---|---|---|---|
The max X value of the 2D point projected to 3D | public float max3DX() {
return Math.max(stop3D.x, start3D.x);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public float getMaxX(){\n return points.get(points.size()-1).getX();\n }",
"public double getMaxCoordinateValue() {\n if (this.max_x > this.max_y)\n return this.max_x;\n else\n return this.max_y;\n }",
"public Point3 max(Point3 p) {\n return new Point3( Math.max(x, p.x),\n Math.max(y, p.y),\n Math.max(z, p.z) );\n }",
"private float getMaxX(HomePieceOfFurniture piece) {\n float [][] points = piece.getPoints();\n float maxX = Float.NEGATIVE_INFINITY;\n for (float [] point : points) {\n maxX = Math.max(maxX, point [0]);\n } \n return maxX;\n }",
"public double getMaxX() {\n\t\treturn mx;\n\t}",
"public double getPositionToP3()\r\n\t{\r\n\t\tdouble max = 0;\r\n\t\tfor(Unit u : units)\r\n\t\t{\r\n\t\t\tif(u instanceof Gate)\r\n\t\t\t\tcontinue;\r\n\t\t\tdouble d = u.getPositionAlongCurve() + u.getRadius()/owner.getLength();\r\n\t\t\tif(d > max)\r\n\t\t\t\tmax = d;\r\n\t\t}\r\n\t\tif(max < 0)\r\n\t\t\tmax = 0;\r\n\t\tif(max > 1)\r\n\t\t\tmax = 1;\r\n\t\treturn 1 - max;\r\n\t}",
"public double getMaxX() {\n\t\tif (pointList.size()==0) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn pointList.get(pointList.size()-1 ).getX();\n\t}",
"float xMax();",
"float zMax();",
"public int getXMax(){\n\t\treturn xDim;\n\t}",
"public double getMaximumX () {\n return minimumX + width;\n }",
"public double getMaxX() {\n\treturn maxX;\n }",
"public float max3DZ() {\n return Math.max(stop3D.z, start3D.z);\n }",
"public double getMaxX() { return getX() + getWidth(); }",
"public float getMaxX() {\n return maxX;\n }",
"public Point getMaxPoint() {\r\n int maximumX = children.get(0).getShapeEndingPoint().getX();\r\n int maximumY = children.get(0).getShapeEndingPoint().getY();\r\n for(IShape shape: children) {\r\n if(shape.getShapeEndingPoint().getX() > maximumX) {\r\n maximumX = shape.getShapeEndingPoint().getX();\r\n }\r\n if(shape.getShapeEndingPoint().getY() > maximumY) {\r\n maximumY = shape.getShapeEndingPoint().getY();\r\n }\r\n }\r\n maxPoint = new Point(maximumX,maximumY);\r\n return maxPoint;\r\n }",
"@Override\n\tpublic double getMaxX() {\n\t\treturn this.getPosition().getX();\n\t}",
"public double getXRangeMax() {\n return xRangeMax;\n }",
"public float getMaxCY3();",
"public float max3DY() {\n return Math.max(stop3D.y, start3D.y);\n }",
"public float max2DX() {\n return Math.max(stop2D.x, start2D.x);\n }",
"float getXStepMax();",
"public Vect3d getExtent (){\r\n \r\n Vect3d extent = new Vect3d();\r\n extent.x = (max.x - min.x) / 2;\r\n extent.y = (max.y - min.y) / 2;\r\n extent.z = (max.y - min.z) / 2;\r\n return extent;\r\n }",
"public int getMaxX() {\n\t\treturn maxX;\n\t}",
"public int getxMax() {\n\t\treturn xMax;\n\t}",
"public Vector3D getExtent() {\n double[] v = this.getVertices();\n\n double xmin = Double.POSITIVE_INFINITY;\n double xmax = Double.NEGATIVE_INFINITY;\n double ymin = Double.POSITIVE_INFINITY;\n double ymax = Double.NEGATIVE_INFINITY;\n double zmin = Double.POSITIVE_INFINITY;\n double zmax = Double.NEGATIVE_INFINITY;\n\n for (int i = 0; i < v.length; i += 3) {\n xmin = Math.min(v[i], xmin);\n xmax = Math.max(v[i], xmax);\n ymin = Math.min(v[i + 1], ymin);\n ymax = Math.max(v[i + 1], ymax);\n zmin = Math.min(v[i + 2], zmin);\n zmax = Math.max(v[i + 2], zmax);\n }\n\n return new Vector3D(xmax - xmin, ymax - ymin, zmax - zmin);\n }",
"public float min3DX() {\n return Math.min(stop3D.x, start3D.x);\n }",
"public double max()\n\n {\n double max=xyValueArray.get(0).getY();\n\n for (int i = 0; i < xyValueArray.size(); i++) {\n if (xyValueArray.get(i).getY() > max) {\n max = xyValueArray.get(i).getY();\n }\n }\n return max;\n }",
"protected void calculateMinMaxCenterPoint() {\n\t\tfinal ImagePlus imp = c.getImage();\n\t\tfinal int w = imp.getWidth(), h = imp.getHeight();\n\t\tfinal int d = imp.getStackSize();\n\t\tfinal Calibration cal = imp.getCalibration();\n\t\tmin = new Point3d();\n\t\tmax = new Point3d();\n\t\tcenter = new Point3d();\n\t\tmin.x = w * (float) cal.pixelHeight;\n\t\tmin.y = h * (float) cal.pixelHeight;\n\t\tmin.z = d * (float) cal.pixelDepth;\n\t\tmax.x = 0;\n\t\tmax.y = 0;\n\t\tmax.z = 0;\n\n\t\tfloat vol = 0;\n\t\tfor (int zi = 0; zi < d; zi++) {\n\t\t\tfinal float z = zi * (float) cal.pixelDepth;\n\t\t\tfinal ImageProcessor ip = imp.getStack().getProcessor(zi + 1);\n\n\t\t\tfinal int wh = w * h;\n\t\t\tfor (int i = 0; i < wh; i++) {\n\t\t\t\tfinal float v = ip.getf(i);\n\t\t\t\tif (v == 0) continue;\n\t\t\t\tvol += v;\n\t\t\t\tfinal float x = (i % w) * (float) cal.pixelWidth;\n\t\t\t\tfinal float y = (i / w) * (float) cal.pixelHeight;\n\t\t\t\tif (x < min.x) min.x = x;\n\t\t\t\tif (y < min.y) min.y = y;\n\t\t\t\tif (z < min.z) min.z = z;\n\t\t\t\tif (x > max.x) max.x = x;\n\t\t\t\tif (y > max.y) max.y = y;\n\t\t\t\tif (z > max.z) max.z = z;\n\t\t\t\tcenter.x += v * x;\n\t\t\t\tcenter.y += v * y;\n\t\t\t\tcenter.z += v * z;\n\t\t\t}\n\t\t}\n\t\tcenter.x /= vol;\n\t\tcenter.y /= vol;\n\t\tcenter.z /= vol;\n\n\t\tvolume = (float) (vol * cal.pixelWidth * cal.pixelHeight * cal.pixelDepth);\n\n\t}",
"public int getXMax(){\n\t\tDouble max = timeIncrements.get(timeIncrements.size()-1);\n\t\txMax = max.intValue();\n\t\treturn xMax;\n\t}",
"public Point getMax () {\r\n\r\n\treturn getB();\r\n }",
"public final int getMaxX() {\n return getMinX() + getWidth();\n }",
"public int getMaximumPoints();",
"@Basic\n\tpublic double getVxmax() {\n\t\treturn this.vxmax;\n\t}",
"public int getMax()\n {\n int max = data.get(0).getX();\n\n for(int i = 0; i < data.size(); i++)\n {\n if (data.get(i).getX() > max)\n {\n max = data.get(i).getX();\n }\n }\n\n\n return max;\n }",
"public int projectX( double x ) {\n double dx = xoff_ + Math.round( x * scale_ );\n return (int) Math.max( (double) Integer.MIN_VALUE,\n Math.min( (double) Integer.MAX_VALUE, dx ) );\n }",
"public int getXD3 ()\n\t{\n\t\treturn xDimension3;\n\t}",
"public E calculateMaximum() {\n return FindMaximum.calculateMaximum(x , y , z);\n }",
"public Vect3d getCenter (){\r\n Vect3d v = new Vect3d();\r\n v.x = (min.x + max.x) / 2;\r\n v.y = (min.y + max.y) / 2;\r\n v.z = (min.z + max.z) / 2;\r\n return v;\r\n }",
"public Coord3d getCenter() {\n return new Coord3d((xmin + xmax) / 2, (ymin + ymax) / 2, (zmin + zmax) / 2);\n }",
"public double[] getMax(){\n double[] max = new double[3];\n for (Triangle i : triangles) {\n double[] tempmax = i.maxCor();\n max[0] = Math.max( max[0], tempmax[0]);\n max[1] = Math.max( max[1], tempmax[1]);\n max[2] = Math.max( max[2], tempmax[2]);\n }\n return max;\n }",
"public double getFrameMaxX() { return isRSS()? getFrame().getMaxX() : getMaxX(); }",
"private long getAbsMax() {\n return Math.max(Math.abs(Visualizer.getLowerBound().get()),\n Visualizer.getUpperBound().get());\n }",
"double rightmost_alien_x() {\n double max_x = 0;\n for (Alien alien : aliens) {\n if (alien.x_position > max_x) {\n max_x = alien.x_position;\n }\n }\n return max_x;\n }",
"public double getMaxT() {\n return v[points_per_segment - 1];\n }",
"public double elementMaxAbs() {\n return ops.elementMaxAbs(mat);\n }",
"public int getMaxTileX() {\n return convertXToTileX(getMaxX() - 1);\n }",
"public void theMaxX() {\n\t\tfloat maxx = coords.getFirst().getX(); // set the largest x to the first one\n\t\tfor(Coord2D c: coords) { // go through the whole linked list\n\t\t\tif(c.getX() > maxx) { // if the x of the current coordinate set is larger than the current max\n\t\t\t\tmaxx = c.getX(); // make that current coordinate the new max\n\t\t\t}\n\t\t}\n\t\tthis.setMaxX(maxx);\n\t}",
"public Point3D normalize() {\n\t\treturn this.divide(Math.sqrt(x*x + y*y + z*z));\n\t}",
"public float getMinX(){\n return points.get(0).getX();\n }",
"public static double getOrigX() {\n return 0.12799999117851257;\n }",
"float yMax();",
"public IPoint getThirdPoint()\n {\n\n Set<IPoint> vertices = this.getVertices();\n Object[] verticesArray = vertices.toArray();\n IPoint thirdPoint = (IPoint)verticesArray[2];\n\n return thirdPoint;\n }",
"public static double getOrigX() {\n return 2.926776647567749;\n }",
"public Point3D getC() {\r\n return c;\r\n }",
"public static double getOrigX() {\n return 0.13199996948242188;\n }",
"@Override\n public double getMaxX() {\n if (getPoints() == null || getPoints().size() == 0) {\n return defaultY;\n }\n Set<Double> keys = getPoints().keySet();\n for (Double key : keys) {\n if (key >= adapter.getMaxFrequency()) {\n return key;\n }\n }\n return getPoints().lastKey();// this.getPoints().ceilingKey(this.getPoints().lastKey()/2);\n }",
"public int getYMax(){\n\t\treturn yDim;\n\t}",
"public double getMaxDistance()\n\t{\n\t // Make sure it went some distance\n\t\tif(xPosList.size() > 0)\n\t\t{\n\t\t\treturn this.xPosList.get(xPosList.size() - 1);\n\t\t}\n\n\t\treturn 0;\n\t}",
"public double getAzMax() {\n\t\treturn azMax;\n\t}",
"private double findMaxY() {\n\t\tif (pointList.size()==0) {\n\t\t\treturn Double.NaN;\n\t\t}\n\t\tdouble max = pointList.get(0).getY();\n\t\tfor(int i=0; i<pointList.size(); i++)\n\t\t\tif (max<pointList.get(i).getY())\n\t\t\t\tmax = pointList.get(i).getY();\n\t\treturn max;\n\t}",
"public double getSolutionX3() {\n this.polySolve();\n if (this.degree < 3) {\n return 0010;\n } else {\n if (this.real) {\n return this.x3;\n } else {\n return 0010;\n }\n }\n }",
"public double getValue(double x, double y){\n\n\tint i,j;\n\tdouble fracX,fracY;\n\tdouble Wxm, Wx0, Wxp, Wym, Wy0, Wyp;\n\tdouble Vm, V0, Vp;\n\n\n\tif(x < x_min || y < y_min || x > x_max || y > y_max){\n\t return z_min;\n\t}\n\n i = (int) ((x-x_min)/x_step + 0.5);\n j = (int) ((y-y_min)/y_step + 0.5);\n\n if( i < 1) i = 1;\n if( i > (nX-2)) i = nX-2;\n if( j < 1) j = 1;\n if( j > (nY-2)) j = nY-2;\t \n\n fracX = (x - x_min - i*x_step)/x_step;\n fracY = (y - y_min - j*y_step)/y_step;\n\n\tWxm = 0.5*(0.5 - fracX)*(0.5 - fracX);\n\tWxp = 0.5*(0.5 + fracX)*(0.5 + fracX);\n\tWx0 = 0.75 - fracX*fracX;\n\n\tWym = 0.5*(0.5 - fracY)*(0.5 - fracY);\n\tWyp = 0.5*(0.5 + fracY)*(0.5 + fracY);\n\tWy0 = 0.75 - fracY*fracY;\n\n\tVm = Wxm*gridData[i-1][j-1]+Wx0*gridData[i][j-1]+Wxp*gridData[i+1][j-1];\n\tV0 = Wxm*gridData[i-1][j] +Wx0*gridData[i][j] +Wxp*gridData[i+1][j];\n\tVp = Wxm*gridData[i-1][j+1]+Wx0*gridData[i][j+1]+Wxp*gridData[i+1][j+1];\n\n return Wym*Vm + Wy0*V0 + Wyp*Vp;\n }",
"public abstract Vector4fc max(IVector4f v);",
"public static double getOrigX() {\n return 0.12999999523162842;\n }",
"public static double getOrigX() {\n return 0.12999999523162842;\n }",
"public static double getOrigX() {\n return 0.12999999523162842;\n }",
"public double getX() {\n\t\treturn point[0];\n\t}",
"public double getApproxEmax() {\n try {\n return computeE(getTmax());\n }\n catch (Exception e) {\n return 0x0.0p0;\n }\n }",
"public Point evaluate(double x, double y, double z) {\n\t\t// x=(-(yn(y-y0)+zn(z-z0))+xn*x0)/xn\n\t\tif (x != x) {\n\t\t\tx = (-(normal.y * (y - origin.y) + normal.z * (z - origin.z)) + normal.x\n\t\t\t\t\t* origin.x)\n\t\t\t\t\t/ normal.x;\n\t\t\treturn new Point(x, y, z);\n\t\t} else if (y != y) {\n\t\t\ty = (-(normal.x * (x - origin.x) + normal.z * (z - origin.z)) + normal.y\n\t\t\t\t\t* origin.y)\n\t\t\t\t\t/ normal.y;\n\t\t\treturn new Point(x, y, z);\n\t\t} else if (z != z) {\n\t\t\tz = (-(normal.y * (y - origin.y) + normal.x * (x - origin.x)) + normal.z\n\t\t\t\t\t* origin.z)\n\t\t\t\t\t/ normal.z;\n\t\t\treturn new Point(x, y, z);\n\t\t}\n\t\treturn null;\n\t}",
"private void calculateMinMaxPositions() {\n boundingVolume = null;\n if ( minMax == null ) {\n minMax = new double[6];\n\n double minX = Double.MAX_VALUE;\n double minY = Double.MAX_VALUE;\n double minZ = Double.MAX_VALUE;\n double maxX = -Double.MAX_VALUE;\n double maxY = -Double.MAX_VALUE;\n double maxZ = -Double.MAX_VALUE;\n int i;\n\n for ( i = 0; i < getNumVertices(); i++ ) {\n double x = vertexPositions[3*i+0];\n double y = vertexPositions[3*i+1];\n double z = vertexPositions[3*i+2];\n\n if ( x < minX ) minX = x;\n if ( y < minY ) minY = y;\n if ( z < minZ ) minZ = z;\n if ( x > maxX ) maxX = x;\n if ( y > maxY ) maxY = y;\n if ( z > maxZ ) maxZ = z;\n }\n minMax[0] = minX;\n minMax[1] = minY;\n minMax[2] = minZ;\n minMax[3] = maxX;\n minMax[4] = maxY;\n minMax[5] = maxZ;\n }\n }",
"@Override\n public double getMaxX() {\n return curMap.getMap().getWidth();\n }",
"org.apache.xmlbeans.XmlDecimal xgetMaximum();",
"public DoubleMatrix1D getDeltaMax() { return deltaMax_; }",
"public double getxMaxSpeed() {\n return this.X_MAX_SPEED;\n }",
"public double getMaxDensity(){\n\t\tdouble mode = Math.exp(location - scale * scale);\n\t\treturn getDensity(mode);\n\t}",
"public Float getT1B11Xfmax() {\r\n return t1B11Xfmax;\r\n }",
"public double getZ() {\n\t\treturn point[2];\n\t}",
"public Point3D getP0() {\n\t\treturn _p0;\n\t}",
"@Override\n public int iamax(INDArray x) {\n return NativeBlas.isamax(x.length(), x.data(), x.offset(), x.stride()[0]) - 1;\n }",
"public double getX3SubSolution() {\n this.polySubSolve();\n return this.x3sub;\n }",
"public float min3DZ() {\n return Math.min(stop3D.z, start3D.z);\n }",
"public Point transform(double x, double y, double z) {\n\t\t\n\t\n\t\tdouble uIso = (x * xToU) + (y * yToU) + (z * zToU);\n\t\tdouble vIso = (x * xToV) + (y * yToV) + (z * zToV);\n\t\t\n\t\tint uDraw = xOffset + (int)(scale * uIso);\n\t\tint vDraw = yOffset + (int)(scale * vIso);\n\t\t\n\t\treturn new Point(uDraw, vDraw);\n\t}",
"public us.ihmc.euclid.tuple3D.Point3D getMousePoint()\n {\n return mouse_point_;\n }",
"public Vector getL(Point3D p){\n if (p.equals(_position)) {\n return null;\n }\n return p.subtract(_position).normalize();\n }",
"public Point3D getPoint() {\r\n\t\treturn point;\r\n\t}",
"public int getMaxX() {\n return scroller.getMaxX();\n }",
"default DiscreteDoubleMap2D pointWiseMaximum(double value) {\r\n\t\treturn (x, y) -> Math.max(this.getValueAt(x, y), value);\r\n\t}",
"public float getMaxTranslationVel(int xform) {\n\t\treturn m_xforms[xform].m_maxTranslationVel;\n\t}",
"public Point3d get3DCenter() {\n double xOfCenter = 0;\n double yOfCenter = 0;\n double zOfCenter = 0;\n for (IAtom atom : atoms) {\n xOfCenter += atom.getPoint3d().x;\n yOfCenter += atom.getPoint3d().y;\n zOfCenter += atom.getPoint3d().z;\n }\n\n return new Point3d(xOfCenter / getAtomCount(),\n yOfCenter / getAtomCount(),\n zOfCenter / getAtomCount());\n }",
"double getMax() {\n\t\t\treturn value_max;\n\t\t}",
"public static double getOrigX() {\n return 0.08838501572608948;\n }",
"private double getMaxOfPool(double[][] input, int rowStart, int colStart,\n int spatialExtent) {\n double max = input[rowStart][colStart];\n for (int row = rowStart; row < rowStart + spatialExtent; row++) {\n for (int col = colStart; col < colStart + spatialExtent; col++) {\n max = Math.max(max, input[row][col]);\n }\n }\n return max;\n }",
"private float getMaxY(HomePieceOfFurniture piece) {\n float [][] points = piece.getPoints();\n float maxY = Float.NEGATIVE_INFINITY;\n for (float [] point : points) {\n maxY = Math.max(maxY, point [1]);\n } \n return maxY;\n }",
"@Override\n public int iamax(IComplexNDArray x) {\n return NativeBlas.icamax(x.length(), x.data(), x.offset(), 1) - 1;\n }",
"public Position coord3dToGeoCoord(Point3D p) {\n double lat_cor = java.lang.Math.toDegrees(java.lang.Math.asin(-p.getY()));\n float lat = (float)lat_cor - TEXTURE_LAT_OFFSET;\n\n // First case issue: longitude between 0° and 180° => half the globe\n double lon_cor = java.lang.Math.toDegrees(java.lang.Math.acos(p.getZ()\n / java.lang.Math.cos(java.lang.Math.asin(-p.getY()))));\n\n // Second case issue: longitude between -90° and 90° => half the globe too\n //double lon_cor = java.lang.Math.toDegrees(java.lang.Math.asin(-p.getX()\n // / java.lang.Math.cos(java.lang.Math.asin(-p.getY()))));\n\n float lon = (float)lon_cor - TEXTURE_LON_OFFSET;\n\n return new Position(lat, lon);\n }",
"public int extractMaximum() {\n \n int max = maximum();\n\n if (max == -1) {\n assert(xft.size() == 0);\n return -1;\n }\n \n remove(max);\n \n return max;\n }",
"public SbVec3f\ngetObjectPoint() {\n\treturn getObjectPoint(null);\n}",
"public float getX2() {\r\n return (c + 2*b + 3*a)/3;\r\n }",
"public double getMaxValue() {\n double max = Double.NEGATIVE_INFINITY;\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j < cols; j++) {\n if (data[i][j] > max)\n max = data[i][j];\n }\n }\n return max;\n }"
] | [
"0.7169778",
"0.6770959",
"0.67429763",
"0.6641286",
"0.6629975",
"0.65907854",
"0.6584864",
"0.6547338",
"0.6431533",
"0.6376473",
"0.6369906",
"0.6369825",
"0.6349715",
"0.6328635",
"0.6290929",
"0.6281864",
"0.62749666",
"0.62544096",
"0.62120485",
"0.6208566",
"0.61584866",
"0.61319935",
"0.61161417",
"0.6113034",
"0.6105722",
"0.6105001",
"0.6057258",
"0.60491705",
"0.6049016",
"0.6026613",
"0.5978224",
"0.5934009",
"0.5865772",
"0.5853163",
"0.5851756",
"0.5829704",
"0.58241194",
"0.5801662",
"0.5798798",
"0.57336265",
"0.57307994",
"0.57246506",
"0.5695416",
"0.56822014",
"0.5643903",
"0.56306607",
"0.56134725",
"0.561247",
"0.5604977",
"0.55978155",
"0.55931693",
"0.5579959",
"0.55716085",
"0.55558896",
"0.55487156",
"0.5539985",
"0.55390906",
"0.5536194",
"0.5527494",
"0.5511067",
"0.5502645",
"0.5468787",
"0.54653686",
"0.54470605",
"0.5434611",
"0.5434611",
"0.5434611",
"0.54324186",
"0.5429757",
"0.542971",
"0.54263014",
"0.54184717",
"0.541348",
"0.5411705",
"0.54102147",
"0.54070306",
"0.53986007",
"0.53961825",
"0.53771913",
"0.536593",
"0.5363087",
"0.53604895",
"0.5355801",
"0.53553975",
"0.53538924",
"0.53477865",
"0.5330137",
"0.5325947",
"0.532498",
"0.53241813",
"0.53205943",
"0.5311204",
"0.5303719",
"0.5295045",
"0.52938265",
"0.5290206",
"0.5284109",
"0.5279023",
"0.5277752",
"0.5276339"
] | 0.72895414 | 0 |
The min Y value of the 2D point projected to 3D | public float min3DY() {
return Math.min(stop3D.y, start3D.y);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Coordinate getMinY();",
"public float min3DZ() {\n return Math.min(stop3D.z, start3D.z);\n }",
"private double findMinY() {\n\t\tif (pointList.size()==0) {\n\t\t\treturn 0;\n\t\t}\n\t\tdouble min = pointList.get(0).getY();\n\t\tfor(int i=0; i<pointList.size(); i++)\n\t\t\tif (min>pointList.get(i).getY())\n\t\t\t\tmin = pointList.get(i).getY();\n\t\treturn min;\n\t}",
"public float min3DX() {\n return Math.min(stop3D.x, start3D.x);\n }",
"float yMin();",
"private float getMinY(HomePieceOfFurniture piece) {\n float [][] points = piece.getPoints();\n float minY = Float.POSITIVE_INFINITY;\n for (float [] point : points) {\n minY = Math.min(minY, point [1]);\n } \n return minY;\n }",
"public float max3DY() {\n return Math.max(stop3D.y, start3D.y);\n }",
"public double getMinimumY () {\n return minimumY;\n }",
"public int minY()\n\t{\n\t\tint m = coords[0][1];\n\t\t\n\t\tfor (int i=0; i<4; i++)\n\t\t{\n\t\t\tm = Math.min(m, coords[i][1]);\n\t\t}\n\t\t\n\t\treturn m;\n\t}",
"public double getMinY() {\n\treturn minY;\n }",
"public double getMinY() {\n\t\treturn ny;\n\t}",
"public double getPositionToP3()\r\n\t{\r\n\t\tdouble max = 0;\r\n\t\tfor(Unit u : units)\r\n\t\t{\r\n\t\t\tif(u instanceof Gate)\r\n\t\t\t\tcontinue;\r\n\t\t\tdouble d = u.getPositionAlongCurve() + u.getRadius()/owner.getLength();\r\n\t\t\tif(d > max)\r\n\t\t\t\tmax = d;\r\n\t\t}\r\n\t\tif(max < 0)\r\n\t\t\tmax = 0;\r\n\t\tif(max > 1)\r\n\t\t\tmax = 1;\r\n\t\treturn 1 - max;\r\n\t}",
"public Output<TFloat32> yMin() {\n return yMin;\n }",
"public int getyMin() {\n\t\treturn yMin;\n\t}",
"public int getMinY() {\n return minY;\n }",
"@Override\n public int getMinY() {\n return this.minY;\n }",
"public static double getOrigY() {\n return 3.906404972076416;\n }",
"float zMin();",
"public Point3 min(Point3 p) {\n return new Point3( Math.min(x, p.x),\n Math.min(y, p.y),\n Math.min(z, p.z) );\n }",
"protected void calculateMinMaxCenterPoint() {\n\t\tfinal ImagePlus imp = c.getImage();\n\t\tfinal int w = imp.getWidth(), h = imp.getHeight();\n\t\tfinal int d = imp.getStackSize();\n\t\tfinal Calibration cal = imp.getCalibration();\n\t\tmin = new Point3d();\n\t\tmax = new Point3d();\n\t\tcenter = new Point3d();\n\t\tmin.x = w * (float) cal.pixelHeight;\n\t\tmin.y = h * (float) cal.pixelHeight;\n\t\tmin.z = d * (float) cal.pixelDepth;\n\t\tmax.x = 0;\n\t\tmax.y = 0;\n\t\tmax.z = 0;\n\n\t\tfloat vol = 0;\n\t\tfor (int zi = 0; zi < d; zi++) {\n\t\t\tfinal float z = zi * (float) cal.pixelDepth;\n\t\t\tfinal ImageProcessor ip = imp.getStack().getProcessor(zi + 1);\n\n\t\t\tfinal int wh = w * h;\n\t\t\tfor (int i = 0; i < wh; i++) {\n\t\t\t\tfinal float v = ip.getf(i);\n\t\t\t\tif (v == 0) continue;\n\t\t\t\tvol += v;\n\t\t\t\tfinal float x = (i % w) * (float) cal.pixelWidth;\n\t\t\t\tfinal float y = (i / w) * (float) cal.pixelHeight;\n\t\t\t\tif (x < min.x) min.x = x;\n\t\t\t\tif (y < min.y) min.y = y;\n\t\t\t\tif (z < min.z) min.z = z;\n\t\t\t\tif (x > max.x) max.x = x;\n\t\t\t\tif (y > max.y) max.y = y;\n\t\t\t\tif (z > max.z) max.z = z;\n\t\t\t\tcenter.x += v * x;\n\t\t\t\tcenter.y += v * y;\n\t\t\t\tcenter.z += v * z;\n\t\t\t}\n\t\t}\n\t\tcenter.x /= vol;\n\t\tcenter.y /= vol;\n\t\tcenter.z /= vol;\n\n\t\tvolume = (float) (vol * cal.pixelWidth * cal.pixelHeight * cal.pixelDepth);\n\n\t}",
"float getRenderableMinY(Long id) throws RemoteException;",
"public float max3DX() {\n return Math.max(stop3D.x, start3D.x);\n }",
"private int getYmin(int[] yt){\n\t\tint min = 256;\n\t\tfor(int i = 0;i<=3;i++){\n\t\t\tif(min > yt[i]){\n\t\t\t\tmin = yt[i];\n\t\t\t}\n\t\t}\n\t\treturn min;\n\t}",
"public float getYChartMin() {\n return 0.0F;\n }",
"public double getY() {\n\t\treturn point[1];\n\t}",
"public Vect3d getCenter (){\r\n Vect3d v = new Vect3d();\r\n v.x = (min.x + max.x) / 2;\r\n v.y = (min.y + max.y) / 2;\r\n v.z = (min.z + max.z) / 2;\r\n return v;\r\n }",
"public float min2DY() {\n return Math.min(stop2D.y, start2D.y);\n }",
"public double obterYmin() {\n\t\treturn ymin;\n\t}",
"double getY() { return pos[1]; }",
"public float getMaxCY3();",
"public double getYRangeMin() {\n return yRangeMin;\n }",
"public Coord3d getCenter() {\n return new Coord3d((xmin + xmax) / 2, (ymin + ymax) / 2, (zmin + zmax) / 2);\n }",
"public float max3DZ() {\n return Math.max(stop3D.z, start3D.z);\n }",
"@Override\n public int getMinTileY() {\n return convertYToTileY(getMinY());\n }",
"public float min2DX() {\n return Math.min(stop2D.x, start2D.x);\n }",
"public double getValue(double x, double y){\n\n\tint i,j;\n\tdouble fracX,fracY;\n\tdouble Wxm, Wx0, Wxp, Wym, Wy0, Wyp;\n\tdouble Vm, V0, Vp;\n\n\n\tif(x < x_min || y < y_min || x > x_max || y > y_max){\n\t return z_min;\n\t}\n\n i = (int) ((x-x_min)/x_step + 0.5);\n j = (int) ((y-y_min)/y_step + 0.5);\n\n if( i < 1) i = 1;\n if( i > (nX-2)) i = nX-2;\n if( j < 1) j = 1;\n if( j > (nY-2)) j = nY-2;\t \n\n fracX = (x - x_min - i*x_step)/x_step;\n fracY = (y - y_min - j*y_step)/y_step;\n\n\tWxm = 0.5*(0.5 - fracX)*(0.5 - fracX);\n\tWxp = 0.5*(0.5 + fracX)*(0.5 + fracX);\n\tWx0 = 0.75 - fracX*fracX;\n\n\tWym = 0.5*(0.5 - fracY)*(0.5 - fracY);\n\tWyp = 0.5*(0.5 + fracY)*(0.5 + fracY);\n\tWy0 = 0.75 - fracY*fracY;\n\n\tVm = Wxm*gridData[i-1][j-1]+Wx0*gridData[i][j-1]+Wxp*gridData[i+1][j-1];\n\tV0 = Wxm*gridData[i-1][j] +Wx0*gridData[i][j] +Wxp*gridData[i+1][j];\n\tVp = Wxm*gridData[i-1][j+1]+Wx0*gridData[i][j+1]+Wxp*gridData[i+1][j+1];\n\n return Wym*Vm + Wy0*V0 + Wyp*Vp;\n }",
"public double getMaxCoordinateValue() {\n if (this.max_x > this.max_y)\n return this.max_x;\n else\n return this.max_y;\n }",
"public double getY() {\n return origin.getY();\n }",
"public float getLowerLeftY()\n {\n return ((COSNumber)rectArray.get(1)).floatValue();\n }",
"public Vector getL(Point3D p){\n if (p.equals(_position)) {\n return null;\n }\n return p.subtract(_position).normalize();\n }",
"public double topmostVertexY() {\n if (right != null && ! right.isEmpty() &&\n left != null && ! left.isEmpty() &&\n left.get(0).getLine().isAscending() &&\n ! right.get(0).getLine().isAscending()) {\n return Line.intersection(right.get(0).getLine(),\n left.get(0).getLine()).getY();\n } else {\n return Double.POSITIVE_INFINITY;\n }\n }",
"public int lowerBoundary(){\r\n\t\treturn this.ypoints[0];\r\n\t}",
"public Vector3D getExtent() {\n double[] v = this.getVertices();\n\n double xmin = Double.POSITIVE_INFINITY;\n double xmax = Double.NEGATIVE_INFINITY;\n double ymin = Double.POSITIVE_INFINITY;\n double ymax = Double.NEGATIVE_INFINITY;\n double zmin = Double.POSITIVE_INFINITY;\n double zmax = Double.NEGATIVE_INFINITY;\n\n for (int i = 0; i < v.length; i += 3) {\n xmin = Math.min(v[i], xmin);\n xmax = Math.max(v[i], xmax);\n ymin = Math.min(v[i + 1], ymin);\n ymax = Math.max(v[i + 1], ymax);\n zmin = Math.min(v[i + 2], zmin);\n zmax = Math.max(v[i + 2], zmax);\n }\n\n return new Vector3D(xmax - xmin, ymax - ymin, zmax - zmin);\n }",
"public Vect3d getExtent (){\r\n \r\n Vect3d extent = new Vect3d();\r\n extent.x = (max.x - min.x) / 2;\r\n extent.y = (max.y - min.y) / 2;\r\n extent.z = (max.y - min.z) / 2;\r\n return extent;\r\n }",
"double getYPosition();",
"public static double getOrigY() {\n return 0.3987833857536316;\n }",
"public double getY();",
"public Point3 max(Point3 p) {\n return new Point3( Math.max(x, p.x),\n Math.max(y, p.y),\n Math.max(z, p.z) );\n }",
"private int getSurfaceY(int x, int yEstimate, int z) {\n final int yMinimum = 0;\n final int yMaximum = 200;\n int y = yEstimate;\n Block block = worldProvider.getBlock(x, yEstimate, z);\n if (isIgnoredByMap(block)) {\n while (isIgnoredByMap(block)) {\n --y;\n block = worldProvider.getBlock(x, y, z);\n if (y <= yMinimum) {\n return BLOCK_Y_DEFAULT;\n }\n }\n } else {\n while (!isIgnoredByMap(block)) {\n ++y;\n block = worldProvider.getBlock(x, y, z);\n if (y >= yMaximum) {\n return BLOCK_Y_DEFAULT;\n }\n }\n --y;\n }\n return y;\n }",
"double getY();",
"double getY();",
"double getY();",
"double getY();",
"double getY();",
"double getY();",
"double getY();",
"double getY();",
"double getY();",
"private double findMaxY() {\n\t\tif (pointList.size()==0) {\n\t\t\treturn Double.NaN;\n\t\t}\n\t\tdouble max = pointList.get(0).getY();\n\t\tfor(int i=0; i<pointList.size(); i++)\n\t\t\tif (max<pointList.get(i).getY())\n\t\t\t\tmax = pointList.get(i).getY();\n\t\treturn max;\n\t}",
"public Point getMinPoint() {\r\n int minX = children.get(0).getShapeStartingPoint().getX();\r\n int minY = children.get(0).getShapeStartingPoint().getY();\r\n for(IShape shape: children) {\r\n if(minX > shape.getShapeStartingPoint().getX()) {\r\n minX = shape.getShapeStartingPoint().getX();\r\n }\r\n if(minY > shape.getShapeStartingPoint().getY()) {\r\n minY = shape.getShapeStartingPoint().getY();\r\n }\r\n }\r\n minPoint = new Point(minX,minY);\r\n return minPoint;\r\n }",
"public double getMaxY() { return getY() + getHeight(); }",
"public double getY() { return y; }",
"public double getMinDist(){\n\t\tquickSort(0, pnt.length - 1);\t// for divide\n\t\t/* CASE: same point */\n\t\tif(min == 0)\n\t\t\treturn 0;\n\n\t\tmin = getDist(pnt[0], pnt[pnt.length - 1]);\n\t\tdivide(0, pnt.length - 1);\n\n\t\treturn min;\n\t}",
"public float getLimit_lin_y_lower() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readFloat(__io__address + 40);\n\t\t} else {\n\t\t\treturn __io__block.readFloat(__io__address + 32);\n\t\t}\n\t}",
"float getY();",
"float getY();",
"float getY();",
"float getY();",
"float getY();",
"float getY();",
"public int getYD3 ()\n\t{\n\t\treturn yDimension3;\n\t}",
"@Override\n public double getPosY() {\n return this.pos[1];\n }",
"public float getMinX(){\n return points.get(0).getX();\n }",
"float yMax();",
"public float getY();",
"public float getY();",
"public double getYPos() {\n\t\treturn this.position[1];\n\t}",
"private double getStartY() {\n\t\treturn Math.min(y1, y2);\n\t}",
"public int projectY( double y ) {\n double dy = yoff_ - Math.round( y * scale_ );\n return (int) Math.max( (double) Integer.MIN_VALUE,\n Math.min( (double) Integer.MAX_VALUE, dy ) );\n }",
"@java.lang.Override\n public godot.wire.Wire.Vector3 getY() {\n return y_ == null ? godot.wire.Wire.Vector3.getDefaultInstance() : y_;\n }",
"public double getMaximumY () {\n return minimumY + height;\n }",
"public int getY(){\n\t\tif(!resetCoordinates()) return 10000;\n\t\treturn Math.round(robot.translation.get(1)/ AvesAblazeHardware.mmPerInch);\n\t}",
"Coordinate getMinX();",
"private float getMaxY(HomePieceOfFurniture piece) {\n float [][] points = piece.getPoints();\n float maxY = Float.NEGATIVE_INFINITY;\n for (float [] point : points) {\n maxY = Math.max(maxY, point [1]);\n } \n return maxY;\n }",
"private static int min(int x, int y, int z) {\n\t\tif (x < y)\n\t\t\treturn (x < z) ? x : z;\n\t\telse\n\t\t\treturn (y < z) ? y : z;\n\t}",
"public Point2D getTopCenterPoint()\n {\n double x = mainVBox.getTranslateX() + (mainVBox.getWidth() / 2);\n double y = mainVBox.getTranslateY();\n return new Point2D(x, y);\n }",
"public Point getMin () {\r\n\r\n\treturn getA();\r\n }",
"public double getY() {\n return collider.getY();\n }",
"public Point3D getLocation() {\n\t\treturn p;\n\t}",
"public int getY() {\r\n return (int) this.p.getY();\r\n }",
"public double getY()\n\t\t{\n\t\t\treturn this.y[0];\n\t\t}",
"public static double getOrigY() {\n return 0.0;\n }",
"public static double getOrigY() {\n return 0.0;\n }",
"public static double getOrigY() {\n return 0.0;\n }",
"public static double getOrigY() {\n return 0.0;\n }",
"public static double getOrigY() {\n return 0.0;\n }",
"public InhomogeneousPoint3D getSuggestedCenterValue() {\n return mSuggestedCenterValue;\n }",
"public double getY() {\n return mY;\n }",
"public float getY() {\n return internalGroup.getY();\n }",
"public Position coord3dToGeoCoord(Point3D p) {\n double lat_cor = java.lang.Math.toDegrees(java.lang.Math.asin(-p.getY()));\n float lat = (float)lat_cor - TEXTURE_LAT_OFFSET;\n\n // First case issue: longitude between 0° and 180° => half the globe\n double lon_cor = java.lang.Math.toDegrees(java.lang.Math.acos(p.getZ()\n / java.lang.Math.cos(java.lang.Math.asin(-p.getY()))));\n\n // Second case issue: longitude between -90° and 90° => half the globe too\n //double lon_cor = java.lang.Math.toDegrees(java.lang.Math.asin(-p.getX()\n // / java.lang.Math.cos(java.lang.Math.asin(-p.getY()))));\n\n float lon = (float)lon_cor - TEXTURE_LON_OFFSET;\n\n return new Position(lat, lon);\n }"
] | [
"0.6993281",
"0.6710686",
"0.6687821",
"0.66497594",
"0.6638886",
"0.663829",
"0.65967757",
"0.65823084",
"0.6472977",
"0.638209",
"0.637901",
"0.6360182",
"0.6344489",
"0.63329417",
"0.63276696",
"0.62954915",
"0.628291",
"0.6217979",
"0.6203833",
"0.61943984",
"0.6186453",
"0.6139846",
"0.613777",
"0.6136881",
"0.6135777",
"0.6083991",
"0.60831565",
"0.6078013",
"0.6059665",
"0.6040844",
"0.6021081",
"0.6012304",
"0.59605294",
"0.59270746",
"0.59239024",
"0.59231156",
"0.5921774",
"0.5910363",
"0.5892194",
"0.58771443",
"0.58769363",
"0.58710223",
"0.5869794",
"0.58687574",
"0.5856603",
"0.58514655",
"0.5840838",
"0.5839724",
"0.5839409",
"0.5829384",
"0.5829384",
"0.5829384",
"0.5829384",
"0.5829384",
"0.5829384",
"0.5829384",
"0.5829384",
"0.5829384",
"0.58187956",
"0.5810015",
"0.58042955",
"0.5800935",
"0.57917243",
"0.57901675",
"0.57859653",
"0.57859653",
"0.57859653",
"0.57859653",
"0.57859653",
"0.57859653",
"0.5776965",
"0.576986",
"0.5769036",
"0.5765351",
"0.5765175",
"0.5765175",
"0.5757943",
"0.57561934",
"0.5750612",
"0.57307166",
"0.57301706",
"0.5728294",
"0.57220036",
"0.57162005",
"0.57105476",
"0.5708247",
"0.5700359",
"0.56970245",
"0.5696569",
"0.569502",
"0.568391",
"0.56793755",
"0.56793755",
"0.56793755",
"0.56793755",
"0.56793755",
"0.56785446",
"0.56779957",
"0.56740075",
"0.56735986"
] | 0.73799133 | 0 |
The max Y value of the 2D point projected to 3D | public float max3DY() {
return Math.max(stop3D.y, start3D.y);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double getMaxCoordinateValue() {\n if (this.max_x > this.max_y)\n return this.max_x;\n else\n return this.max_y;\n }",
"private double findMaxY() {\n\t\tif (pointList.size()==0) {\n\t\t\treturn Double.NaN;\n\t\t}\n\t\tdouble max = pointList.get(0).getY();\n\t\tfor(int i=0; i<pointList.size(); i++)\n\t\t\tif (max<pointList.get(i).getY())\n\t\t\t\tmax = pointList.get(i).getY();\n\t\treturn max;\n\t}",
"float yMax();",
"public float max3DZ() {\n return Math.max(stop3D.z, start3D.z);\n }",
"public double getMaxY() { return getY() + getHeight(); }",
"private float getMaxY(HomePieceOfFurniture piece) {\n float [][] points = piece.getPoints();\n float maxY = Float.NEGATIVE_INFINITY;\n for (float [] point : points) {\n maxY = Math.max(maxY, point [1]);\n } \n return maxY;\n }",
"public float getMaxCY3();",
"public int getYMax(){\n\t\treturn yDim;\n\t}",
"public double getMaximumY () {\n return minimumY + height;\n }",
"public float max3DX() {\n return Math.max(stop3D.x, start3D.x);\n }",
"public Point3 max(Point3 p) {\n return new Point3( Math.max(x, p.x),\n Math.max(y, p.y),\n Math.max(z, p.z) );\n }",
"public double max()\n\n {\n double max=xyValueArray.get(0).getY();\n\n for (int i = 0; i < xyValueArray.size(); i++) {\n if (xyValueArray.get(i).getY() > max) {\n max = xyValueArray.get(i).getY();\n }\n }\n return max;\n }",
"float zMax();",
"public double getChannelYPositionLast() {\n double max = 0.0;\n for (ChannelGraphic channelGraphic : channelGraphics) {\n if (channelGraphic.getyPosition() > max) {\n max = channelGraphic.getyPosition();\n }\n }\n return max;\n }",
"private int getYmax(int[] yt){\n\t\tint max = -1;\n\t\tfor(int i = 0;i<=3;i++){\n\t\t\tif(max < yt[i]){\n\t\t\t\tmax = yt[i];\n\t\t\t}\n\t\t}\n\t\treturn max;\n\t}",
"public double getPositionToP3()\r\n\t{\r\n\t\tdouble max = 0;\r\n\t\tfor(Unit u : units)\r\n\t\t{\r\n\t\t\tif(u instanceof Gate)\r\n\t\t\t\tcontinue;\r\n\t\t\tdouble d = u.getPositionAlongCurve() + u.getRadius()/owner.getLength();\r\n\t\t\tif(d > max)\r\n\t\t\t\tmax = d;\r\n\t\t}\r\n\t\tif(max < 0)\r\n\t\t\tmax = 0;\r\n\t\tif(max > 1)\r\n\t\t\tmax = 1;\r\n\t\treturn 1 - max;\r\n\t}",
"public Output<TFloat32> yMax() {\n return yMax;\n }",
"public float max2DY() {\n return Math.max(stop2D.y, start2D.y);\n }",
"public double getMaxY() {\n\treturn maxY;\n }",
"public double getMaxY() {\n\t\treturn my;\n\t}",
"public int getMaxY() {\n return maxY;\n }",
"public double getYRangeMax() {\n return yRangeMax;\n }",
"public int getyMax() {\n\t\treturn yMax;\n\t}",
"public final int getMaxY() {\n return getMinY() + getHeight();\n }",
"private int getSurfaceY(int x, int yEstimate, int z) {\n final int yMinimum = 0;\n final int yMaximum = 200;\n int y = yEstimate;\n Block block = worldProvider.getBlock(x, yEstimate, z);\n if (isIgnoredByMap(block)) {\n while (isIgnoredByMap(block)) {\n --y;\n block = worldProvider.getBlock(x, y, z);\n if (y <= yMinimum) {\n return BLOCK_Y_DEFAULT;\n }\n }\n } else {\n while (!isIgnoredByMap(block)) {\n ++y;\n block = worldProvider.getBlock(x, y, z);\n if (y >= yMaximum) {\n return BLOCK_Y_DEFAULT;\n }\n }\n --y;\n }\n return y;\n }",
"public int getYMax(){\n\t\tDouble max = Collections.max(byteIncrements);\n\t\tyMax = max.intValue();\n\t\treturn yMax;\n\t}",
"public int getMaxTileY() {\n return convertYToTileY(getMaxY() - 1);\n }",
"@Override\n public double getMaxY() {\n return curMap.getMap().getHeight();\n }",
"public double getFrameMaxY() { return isRSS()? getFrame().getMaxY() : getMaxY(); }",
"public int getMaxY() {\n\t\treturn maxY;\n\t}",
"public double getBiggestY() {\r\n double y = 0;\r\n List<Enemy> enemyLowest = this.lowestLine();\r\n if (enemyLowest.size() > 0) {\r\n y = enemyLowest.get(0).getCollisionRectangle().getBoundaries().getLowY();\r\n for (Enemy e: enemyLowest) {\r\n if (e.getCollisionRectangle().getBoundaries().getLowY() > y) {\r\n y = e.getCollisionRectangle().getBoundaries().getLowY();\r\n }\r\n }\r\n return y;\r\n }\r\n return y;\r\n }",
"public float getYChartMax() {\n return 0.0F;\n }",
"private long getAbsMax() {\n return Math.max(Math.abs(Visualizer.getLowerBound().get()),\n Visualizer.getUpperBound().get());\n }",
"public Point getMax () {\r\n\r\n\treturn getB();\r\n }",
"public double getY() {\n\t\treturn point[1];\n\t}",
"public static double getOrigY() {\n return 3.906404972076416;\n }",
"public Point getMaxPoint() {\r\n int maximumX = children.get(0).getShapeEndingPoint().getX();\r\n int maximumY = children.get(0).getShapeEndingPoint().getY();\r\n for(IShape shape: children) {\r\n if(shape.getShapeEndingPoint().getX() > maximumX) {\r\n maximumX = shape.getShapeEndingPoint().getX();\r\n }\r\n if(shape.getShapeEndingPoint().getY() > maximumY) {\r\n maximumY = shape.getShapeEndingPoint().getY();\r\n }\r\n }\r\n maxPoint = new Point(maximumX,maximumY);\r\n return maxPoint;\r\n }",
"public float max2DX() {\n return Math.max(stop2D.x, start2D.x);\n }",
"public double getY() {\n\t\tRectangle2D bounds = _parentFigure.getBounds();\n\t\tdouble y = bounds.getY() + (_yt * bounds.getHeight());\n\t\treturn y;\n\t}",
"public int getY(){\n\t\tif(!resetCoordinates()) return 10000;\n\t\treturn Math.round(robot.translation.get(1)/ AvesAblazeHardware.mmPerInch);\n\t}",
"public int projectY( double y ) {\n double dy = yoff_ - Math.round( y * scale_ );\n return (int) Math.max( (double) Integer.MIN_VALUE,\n Math.min( (double) Integer.MAX_VALUE, dy ) );\n }",
"public float min3DY() {\n return Math.min(stop3D.y, start3D.y);\n }",
"public double getY() {\n return collider.getY();\n }",
"public double getHighestChildY() {\n\t\t/* Aucun enfant => aucune contrainte en y vers le bas */\n\t\tif (childrenEdges == null)\n\t\t\treturn Double.MAX_VALUE;\n\t\t\n\t\tdouble minY = Double.MAX_VALUE;\n\t\tfor (int i = 0; i < childrenEdges.size(); i++) {\n\t\t\t/*\n\t\t\t * Recherche de l'extrémité la plus basse de l'arête (la plus haute étant le noeud\n\t\t\t * courant)\n\t\t\t */\n\t\t\tEdge currentEdge = childrenEdges.elementAt(i);\n\t\t\tdouble y1 = currentEdge.getSource().getShape().getY();\n\t\t\tdouble y2 = currentEdge.getDestination().getShape().getY();\n\t\t\tdouble y = (y1 > y2) ? y1 : y2;\n\t\t\t\n\t\t\t/* Recherche de l'extrémité la plus haute parmi toutes les extrémités basses */\n\t\t\tif (y < minY)\n\t\t\t\tminY = y;\n\t\t}\n\t\t\n\t\treturn minY;\n\t}",
"public int getUserPlaneY() {\r\n\t\treturn levelManager.getUserPlaneY();\r\n\t}",
"public float getYComponent() {\n return this.vy;\n }",
"public float getMaxTranslationVel(int xform) {\n\t\treturn m_xforms[xform].m_maxTranslationVel;\n\t}",
"public double getYPos() {\n\t\treturn this.position[1];\n\t}",
"public int getMaximumPoints();",
"public double getMaxT() {\n return v[points_per_segment - 1];\n }",
"public double getAzMax() {\n\t\treturn azMax;\n\t}",
"public double lastYValue() {\n\t\tif (pointList.size()==0)\n\t\t\treturn Double.NaN;\n\t\telse\n\t\t\treturn pointList.get( pointList.size()-1).getY();\n\t}",
"public int getYD3 ()\n\t{\n\t\treturn yDimension3;\n\t}",
"public int getY() {\n return (int) this.center.getY();\n }",
"public int getMaxY() {\n return scroller.getMaxY();\n }",
"public int yPos() {\n\t\treturn Engine.scaleY(y);\n\t}",
"public double getY() {\n return mY;\n }",
"public E calculateMaximum() {\n return FindMaximum.calculateMaximum(x , y , z);\n }",
"public float getLimit_lin_y_upper() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readFloat(__io__address + 44);\n\t\t} else {\n\t\t\treturn __io__block.readFloat(__io__address + 36);\n\t\t}\n\t}",
"public double getMaxDiffVertical(Coordinate a, Coordinate b) {\n\t\t Coordinate lowCoord = a.z < b.z ? a : b;\n\t\t Coordinate highCoord = a.z >= b.z ? a : b;\n\t\t double lowZ = (lowCoord.z - uncertaityVertical); \n\t\t double highZ = (highCoord.z + uncertaityVertical);\n\t\t double diff = highZ - lowZ;\n\t\t return diff;\t\t\n\t}",
"public double getY();",
"public int getYPos() {\r\n\t\treturn this.cameraY;\r\n\t}",
"private Integer getHighestYAt(Location locationIncludingYmax, int minY) {\n int y = locationIncludingYmax.getBlockY();\n while (y >= minY) {\n locationIncludingYmax.setY(y);\n Block block = locationIncludingYmax.getBlock();\n if (block.getType().isSolid())\n return y;\n y--;\n }\n return -1;\n }",
"public double getY() {\n return position.getY();\n }",
"public int getY() {\r\n return (int) this.p.getY();\r\n }",
"@java.lang.Override\n public godot.wire.Wire.Vector3 getY() {\n return y_ == null ? godot.wire.Wire.Vector3.getDefaultInstance() : y_;\n }",
"public void theMaxY() {\n\t\tfloat maxy = coords.getFirst().getY(); // set the largest y to the first one\n\t\tfor(Coord2D c: coords) { // go through the whole linked list\n\t\t\tif(c.getY() > maxy) { // if the y of the current coordinate set is larger than the current max\n\t\t\t\tmaxy = c.getY(); // make that current coordinate the new max\n\t\t\t}\n\t\t}\n\t\tthis.setMaxY(maxy);\n\t}",
"public float getUpperRightY()\n {\n return ((COSNumber)rectArray.get(3)).floatValue();\n }",
"public double getY()\n\t\t{\n\t\t\treturn this.y[0];\n\t\t}",
"public double getY2()\n\t{\n\t\treturn this.y[2];\n\t}",
"public double getY2() {\n\t\treturn p2.y;\n\t}",
"public float toWorldCoordinateY(float mouseY){\t\t\n \tmouseY = (mouseY-parent.height)*-1;\n \treturn ((mouseY/zoom) - (parent.height/zoom/2) - position.y)*-1;\n }",
"public double[] getMax(){\n double[] max = new double[3];\n for (Triangle i : triangles) {\n double[] tempmax = i.maxCor();\n max[0] = Math.max( max[0], tempmax[0]);\n max[1] = Math.max( max[1], tempmax[1]);\n max[2] = Math.max( max[2], tempmax[2]);\n }\n return max;\n }",
"public int getPointY() {\n return pointY;\n }",
"public SVGLength getY() {\n return y;\n }",
"public static int getEndYCoordinate(){\n\tint y = getThymioEndField_Y(); \n\t\t\n\t\tif(y == 0){\n\t\t\n \t}else{\n \t y *= FIELD_HEIGHT;\n \t}\n\t\treturn y;\n\t}",
"public double getY() { return y; }",
"double getY();",
"double getY();",
"double getY();",
"double getY();",
"double getY();",
"double getY();",
"double getY();",
"double getY();",
"double getY();",
"public float getY();",
"public float getY();",
"public int getY() {\n return (int) center.getY();\n }",
"public long getMaxHeight(){\r\n\t\treturn world.getHeight();\r\n\t}",
"public float getMaxX(){\n return points.get(points.size()-1).getX();\n }",
"public int getScrollMaxY(){\n return Math.max(0, getLineHeight() * getLineCount() - getHeight() / 2);\n }",
"public double getY()\n\t{\t\n\t\treturn y;\t\t\t\t\t\t\t\t\t\t\t\t// Return point's y-coordinate\n\t}",
"public int getY() {\n if (this.coordinates == null)\n return -1;\n return this.coordinates.y();\n }",
"Float getY();",
"double getYPosition();",
"public static double getOrigY() {\n return 0.3987833857536316;\n }",
"public float getY() {\n return internalGroup.getY();\n }",
"public int getY() {\r\n return (int) center.getY();\r\n }",
"public double getHeight(Point3d position){\r\n\t\treturn position.y - world.getHeight((int) position.x, (int) position.z);\r\n\t}"
] | [
"0.7210531",
"0.70518494",
"0.69890726",
"0.6893337",
"0.6880281",
"0.6860294",
"0.6837383",
"0.6827622",
"0.6792885",
"0.6785092",
"0.6717902",
"0.6706128",
"0.6698999",
"0.6652916",
"0.66379863",
"0.6631959",
"0.6584869",
"0.65167314",
"0.6515809",
"0.6507378",
"0.64395374",
"0.6435079",
"0.64050514",
"0.64048684",
"0.6396366",
"0.6376289",
"0.63624316",
"0.63611364",
"0.6357657",
"0.63466454",
"0.633543",
"0.63272977",
"0.6325211",
"0.63003844",
"0.6285152",
"0.625297",
"0.61767584",
"0.61577255",
"0.6121295",
"0.6119906",
"0.61118644",
"0.610391",
"0.60716426",
"0.60541177",
"0.6044643",
"0.6036857",
"0.6034363",
"0.60084844",
"0.5990333",
"0.59893334",
"0.5985962",
"0.5985491",
"0.59815246",
"0.59744406",
"0.59646523",
"0.59571576",
"0.5955098",
"0.5953548",
"0.5942778",
"0.5935823",
"0.5935273",
"0.59287786",
"0.59104043",
"0.5906707",
"0.5901655",
"0.5897101",
"0.58909005",
"0.5890878",
"0.5884939",
"0.58763236",
"0.58704805",
"0.58673877",
"0.58635306",
"0.5848673",
"0.5846967",
"0.58461267",
"0.5845779",
"0.5844594",
"0.5844594",
"0.5844594",
"0.5844594",
"0.5844594",
"0.5844594",
"0.5844594",
"0.5844594",
"0.5844594",
"0.5838818",
"0.5838818",
"0.58364993",
"0.583487",
"0.5829345",
"0.5822589",
"0.58211464",
"0.582035",
"0.58187807",
"0.58159703",
"0.58158636",
"0.58104956",
"0.5807052",
"0.5800594"
] | 0.76095587 | 0 |
The min Z value of the 2D point projected to 3D | public float min3DZ() {
return Math.min(stop3D.z, start3D.z);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"float zMin();",
"public Point3 min(Point3 p) {\n return new Point3( Math.min(x, p.x),\n Math.min(y, p.y),\n Math.min(z, p.z) );\n }",
"public float min3DX() {\n return Math.min(stop3D.x, start3D.x);\n }",
"public float max3DZ() {\n return Math.max(stop3D.z, start3D.z);\n }",
"public Point3D normalize() {\n\t\treturn this.divide(Math.sqrt(x*x + y*y + z*z));\n\t}",
"public double getZ() {\n\t\treturn point[2];\n\t}",
"public Coord3d getCenter() {\n return new Coord3d((xmin + xmax) / 2, (ymin + ymax) / 2, (zmin + zmax) / 2);\n }",
"public Point3d get3DCenter() {\n double xOfCenter = 0;\n double yOfCenter = 0;\n double zOfCenter = 0;\n for (IAtom atom : atoms) {\n xOfCenter += atom.getPoint3d().x;\n yOfCenter += atom.getPoint3d().y;\n zOfCenter += atom.getPoint3d().z;\n }\n\n return new Point3d(xOfCenter / getAtomCount(),\n yOfCenter / getAtomCount(),\n zOfCenter / getAtomCount());\n }",
"public Vect3d getCenter (){\r\n Vect3d v = new Vect3d();\r\n v.x = (min.x + max.x) / 2;\r\n v.y = (min.y + max.y) / 2;\r\n v.z = (min.z + max.z) / 2;\r\n return v;\r\n }",
"float getZ();",
"float getZ();",
"float getZ();",
"public float getLocalZ(){\n\t\treturn this.z;\n\t}",
"float zMax();",
"private static int min(int x, int y, int z) {\n\t\tif (x < y)\n\t\t\treturn (x < z) ? x : z;\n\t\telse\n\t\t\treturn (y < z) ? y : z;\n\t}",
"godot.wire.Wire.Vector3 getZ();",
"Point3D (double x, double y, double z) {\n this.x = x;\n this.y = y;\n this.z = z;\n }",
"public float min3DY() {\n return Math.min(stop3D.y, start3D.y);\n }",
"@java.lang.Override\n public godot.wire.Wire.Vector3 getZ() {\n return z_ == null ? godot.wire.Wire.Vector3.getDefaultInstance() : z_;\n }",
"private void FindMinZ()\r\n\t{\r\n\t\tminimum_Z=Integer.MAX_VALUE;\r\n\t\tfor(Entry<Integer,Node> entry : FutureUpdateList.entrySet())\r\n\t\t{\r\n\t\t\tNode temp=entry.getValue();\r\n\t\t\tif(temp.z<minimum_Z)\r\n\t\t\t{\r\n\t\t\t\tminimum_Z=temp.z;\r\n\t\t\t\tminimum_X=temp.x;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"double getZ() { return pos[2]; }",
"@Override\n\tpublic double getZLoc() {\n\t\tdouble side = Math.sqrt(getMySize())/2;\n\t\treturn z-side;\n\t}",
"public double getZ() {\n return position.getZ();\n }",
"public float getZ() {\n return z_;\n }",
"public float getZ() {\n return z_;\n }",
"public float getZ() {\r\n return z;\r\n }",
"public float getZ(){\n\t\tif(!isRoot()){\n\t\t\treturn getParent().getZ() + z;\n\t\t}else{\n\t\t\treturn z;\n\t\t}\n\t}",
"public Position coord3dToGeoCoord(Point3D p) {\n double lat_cor = java.lang.Math.toDegrees(java.lang.Math.asin(-p.getY()));\n float lat = (float)lat_cor - TEXTURE_LAT_OFFSET;\n\n // First case issue: longitude between 0° and 180° => half the globe\n double lon_cor = java.lang.Math.toDegrees(java.lang.Math.acos(p.getZ()\n / java.lang.Math.cos(java.lang.Math.asin(-p.getY()))));\n\n // Second case issue: longitude between -90° and 90° => half the globe too\n //double lon_cor = java.lang.Math.toDegrees(java.lang.Math.asin(-p.getX()\n // / java.lang.Math.cos(java.lang.Math.asin(-p.getY()))));\n\n float lon = (float)lon_cor - TEXTURE_LON_OFFSET;\n\n return new Position(lat, lon);\n }",
"public Point3F(float x, float y, float z) {\n this.x = x;\n this.y = y;\n this.z = z;\n }",
"@Override\n\tpublic int getLowZ()\n\t{\n\t\treturn zoneZ1;\n\t}",
"float zAt(int xIndex, int yIndex);",
"public godot.wire.Wire.Vector3 getZ() {\n if (zBuilder_ == null) {\n return z_ == null ? godot.wire.Wire.Vector3.getDefaultInstance() : z_;\n } else {\n return zBuilder_.getMessage();\n }\n }",
"public float max3DX() {\n return Math.max(stop3D.x, start3D.x);\n }",
"protected void calculateMinMaxCenterPoint() {\n\t\tfinal ImagePlus imp = c.getImage();\n\t\tfinal int w = imp.getWidth(), h = imp.getHeight();\n\t\tfinal int d = imp.getStackSize();\n\t\tfinal Calibration cal = imp.getCalibration();\n\t\tmin = new Point3d();\n\t\tmax = new Point3d();\n\t\tcenter = new Point3d();\n\t\tmin.x = w * (float) cal.pixelHeight;\n\t\tmin.y = h * (float) cal.pixelHeight;\n\t\tmin.z = d * (float) cal.pixelDepth;\n\t\tmax.x = 0;\n\t\tmax.y = 0;\n\t\tmax.z = 0;\n\n\t\tfloat vol = 0;\n\t\tfor (int zi = 0; zi < d; zi++) {\n\t\t\tfinal float z = zi * (float) cal.pixelDepth;\n\t\t\tfinal ImageProcessor ip = imp.getStack().getProcessor(zi + 1);\n\n\t\t\tfinal int wh = w * h;\n\t\t\tfor (int i = 0; i < wh; i++) {\n\t\t\t\tfinal float v = ip.getf(i);\n\t\t\t\tif (v == 0) continue;\n\t\t\t\tvol += v;\n\t\t\t\tfinal float x = (i % w) * (float) cal.pixelWidth;\n\t\t\t\tfinal float y = (i / w) * (float) cal.pixelHeight;\n\t\t\t\tif (x < min.x) min.x = x;\n\t\t\t\tif (y < min.y) min.y = y;\n\t\t\t\tif (z < min.z) min.z = z;\n\t\t\t\tif (x > max.x) max.x = x;\n\t\t\t\tif (y > max.y) max.y = y;\n\t\t\t\tif (z > max.z) max.z = z;\n\t\t\t\tcenter.x += v * x;\n\t\t\t\tcenter.y += v * y;\n\t\t\t\tcenter.z += v * z;\n\t\t\t}\n\t\t}\n\t\tcenter.x /= vol;\n\t\tcenter.y /= vol;\n\t\tcenter.z /= vol;\n\n\t\tvolume = (float) (vol * cal.pixelWidth * cal.pixelHeight * cal.pixelDepth);\n\n\t}",
"@java.lang.Override\n public float getZ() {\n return z_;\n }",
"@java.lang.Override\n public float getZ() {\n return z_;\n }",
"public float getLimit_lin_z_lower() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readFloat(__io__address + 48);\n\t\t} else {\n\t\t\treturn __io__block.readFloat(__io__address + 40);\n\t\t}\n\t}",
"public Point3 max(Point3 p) {\n return new Point3( Math.max(x, p.x),\n Math.max(y, p.y),\n Math.max(z, p.z) );\n }",
"public Point3D(double x,double y,double z)\n {\n _x=x;\n _y=y;\n _z=z;\n }",
"public InhomogeneousPoint3D getSuggestedCenterValue() {\n return mSuggestedCenterValue;\n }",
"@java.lang.Override\n public float getZ() {\n return z_;\n }",
"@java.lang.Override\n public float getZ() {\n return z_;\n }",
"public Vector getL(Point3D p){\n if (p.equals(_position)) {\n return null;\n }\n return p.subtract(_position).normalize();\n }",
"public Point3(float x, float y, float z) {\r\n\t\tsuper(x, y);\r\n\t\tthis.z = z;\r\n\t}",
"public Double z() {\n return this.f917a.getAsDouble(\"CFG_LOCATION_LATITUDE\");\n }",
"public Vec3(float x, float y, float z){\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\ttrunc();\n\t}",
"public Point evaluate(double x, double y, double z) {\n\t\t// x=(-(yn(y-y0)+zn(z-z0))+xn*x0)/xn\n\t\tif (x != x) {\n\t\t\tx = (-(normal.y * (y - origin.y) + normal.z * (z - origin.z)) + normal.x\n\t\t\t\t\t* origin.x)\n\t\t\t\t\t/ normal.x;\n\t\t\treturn new Point(x, y, z);\n\t\t} else if (y != y) {\n\t\t\ty = (-(normal.x * (x - origin.x) + normal.z * (z - origin.z)) + normal.y\n\t\t\t\t\t* origin.y)\n\t\t\t\t\t/ normal.y;\n\t\t\treturn new Point(x, y, z);\n\t\t} else if (z != z) {\n\t\t\tz = (-(normal.y * (y - origin.y) + normal.x * (x - origin.x)) + normal.z\n\t\t\t\t\t* origin.z)\n\t\t\t\t\t/ normal.z;\n\t\t\treturn new Point(x, y, z);\n\t\t}\n\t\treturn null;\n\t}",
"public SbVec3f\ngetObjectPoint() {\n\treturn getObjectPoint(null);\n}",
"public abstract Vector3D getPointForSurfaceCoordinates(double u, double v);",
"public final double getZ() {\n return z;\n }",
"public BoundingBox3d(float xmin, float xmax, float ymin, float ymax, float zmin, float zmax) {\n this.xmin = xmin;\n this.xmax = xmax;\n this.ymin = ymin;\n this.ymax = ymax;\n this.zmin = zmin;\n this.zmax = zmax;\n }",
"public Location3D getCenter() {\n\t\treturn new Location3D(world, lowPoint.getBlockX() + getXSize() / 2, lowPoint.getBlockY() + getYSize() / 2, lowPoint.getBlockZ() + getZSize() / 2);\n\t}",
"public double getPositionToP3()\r\n\t{\r\n\t\tdouble max = 0;\r\n\t\tfor(Unit u : units)\r\n\t\t{\r\n\t\t\tif(u instanceof Gate)\r\n\t\t\t\tcontinue;\r\n\t\t\tdouble d = u.getPositionAlongCurve() + u.getRadius()/owner.getLength();\r\n\t\t\tif(d > max)\r\n\t\t\t\tmax = d;\r\n\t\t}\r\n\t\tif(max < 0)\r\n\t\t\tmax = 0;\r\n\t\tif(max > 1)\r\n\t\t\tmax = 1;\r\n\t\treturn 1 - max;\r\n\t}",
"public Point3(double x_, double y_, double z_) {\n x = x_; y = y_; z = z_;\n }",
"public double getZ() {\r\n\t\treturn z;\t\r\n\t\t}",
"public Vector3D getExtent() {\n double[] v = this.getVertices();\n\n double xmin = Double.POSITIVE_INFINITY;\n double xmax = Double.NEGATIVE_INFINITY;\n double ymin = Double.POSITIVE_INFINITY;\n double ymax = Double.NEGATIVE_INFINITY;\n double zmin = Double.POSITIVE_INFINITY;\n double zmax = Double.NEGATIVE_INFINITY;\n\n for (int i = 0; i < v.length; i += 3) {\n xmin = Math.min(v[i], xmin);\n xmax = Math.max(v[i], xmax);\n ymin = Math.min(v[i + 1], ymin);\n ymax = Math.max(v[i + 1], ymax);\n zmin = Math.min(v[i + 2], zmin);\n zmax = Math.max(v[i + 2], zmax);\n }\n\n return new Vector3D(xmax - xmin, ymax - ymin, zmax - zmin);\n }",
"public Point3D getC() {\r\n return c;\r\n }",
"public int getZ()\n {\n return zaxis;\n }",
"public double getZ(){\n\t\treturn z;\n\t}",
"public double getZ() {\n\t\treturn z;\n\t}",
"public double getZ() {\n\t\treturn z;\n\t}",
"public int getZ() {\n\t\treturn -150;\n\t}",
"public double getZ() {\r\n return z;\r\n }",
"public Point3D getPoint() {\r\n\t\treturn point;\r\n\t}",
"@Override\n\tpublic double getZ() {\n\t\treturn z;\n\t}",
"@Override\n public Vector getNormal(Point3D p) {\n Vector O_P= p.subtract(_center);\n return O_P.normalize();\n // return null;\n }",
"public double[] getMin(){\n double[] min = new double[3];\n for (Triangle i : triangles) {\n double[] tempmin = i.minCor();\n min[0] = Math.min( min[0], tempmin[0]);\n min[1] = Math.min( min[1], tempmin[1]);\n min[2] = Math.min( min[2], tempmin[2]);\n }\n return min;\n }",
"public void setMin(Vect3d min) {\r\n this.min = min;\r\n }",
"public double getz0()\n\t{\n\t\treturn this.z0;\n\t}",
"public double getDistance(Point3D point){\n return _position.distance(point);\n }",
"public Vector3(double x, double y,double z){\n \n double pytago;\n \n this.x = x;\n this.y = y;\n this.z = z;\n \n pytago = (x*x) + (y*y) + (z*z);\n \n magnitude = Math.sqrt(pytago);\n }",
"public final double getMinConvexCoefficient()\n {\n return minConvexCoefficient;\n }",
"private Point3D findNormalAtPoint(Point3D hitPoint) {\n double x = hitPoint.getX();\n double y = hitPoint.getY();\n double z = hitPoint.getZ();\n double normalX = 2 * a * x + e * z + f * y + g;\n double normalY = 2 * b * y + d * z + f * x + h;\n double normalZ = 2 * c * z + d * y + e * x + i;\n return new Point3D(normalX, normalY, normalZ).normalize();\n }",
"public Layer getFirstLayer() {\n \t\tif (0 == n_points) return this.layer;\n \t\tif (-1 == n_points) setupForDisplay(); //reload\n \t\tLayer la = this.layer;\n \t\tdouble z = Double.MAX_VALUE;\n \t\tfor (int i=0; i<n_points; i++) {\n \t\t\tLayer layer = layer_set.getLayer(p_layer[i]);\n \t\t\tif (layer.getZ() < z) la = layer;\n \t\t}\n \t\treturn la;\n \t}",
"public float getZ()\n {\n return fz;\n }",
"public Point transform(double x, double y, double z) {\n\t\t\n\t\n\t\tdouble uIso = (x * xToU) + (y * yToU) + (z * zToU);\n\t\tdouble vIso = (x * xToV) + (y * yToV) + (z * zToV);\n\t\t\n\t\tint uDraw = xOffset + (int)(scale * uIso);\n\t\tint vDraw = yOffset + (int)(scale * vIso);\n\t\t\n\t\treturn new Point(uDraw, vDraw);\n\t}",
"public Vector3f getSphereCenter() {\n\t\tfloat[] arr = getMinMax();\n\t\t\n\t\treturn new Vector3f((arr[0]+arr[1])/2,(arr[2]+arr[3])/2,(arr[4]+arr[5])/2);\n\t}",
"public double getMinDist(){\n\t\tquickSort(0, pnt.length - 1);\t// for divide\n\t\t/* CASE: same point */\n\t\tif(min == 0)\n\t\t\treturn 0;\n\n\t\tmin = getDist(pnt[0], pnt[pnt.length - 1]);\n\t\tdivide(0, pnt.length - 1);\n\n\t\treturn min;\n\t}",
"public void setLocalZ(float z){\n\t\tthis.z = z;\n\t}",
"public int getBlockZ()\n\t {\n\t\t if(z >= 0.0) return (int)z;\n\t\t return -1 + (int)(z);\n\t }",
"abstract double getOrgZ();",
"public godot.wire.Wire.Vector3OrBuilder getZOrBuilder() {\n if (zBuilder_ != null) {\n return zBuilder_.getMessageOrBuilder();\n } else {\n return z_ == null ?\n godot.wire.Wire.Vector3.getDefaultInstance() : z_;\n }\n }",
"Point3D getRightLowerFrontCorner();",
"public IPoint getThirdPoint()\n {\n\n Set<IPoint> vertices = this.getVertices();\n Object[] verticesArray = vertices.toArray();\n IPoint thirdPoint = (IPoint)verticesArray[2];\n\n return thirdPoint;\n }",
"public double distSq(Point3D pt) {\n\t\tdouble x1 = x - pt.x;\n\t\tdouble y1 = y - pt.y;\n\t\tdouble z1 = z - pt.z;\n\t\treturn x1*x1 + y1*y1 + z1*z1;\n\t}",
"public double getRadius() {\n return getCenter().distance(new Coord3d(xmin, ymin, zmin));\n }",
"public Point3D getP0() {\n\t\treturn _p0;\n\t}",
"private GeoPoint getClosestPoint(List<GeoPoint> intersectionPoints) {\n Point3D p0 = scene.getCamera().getSpo();//the point location of the camera.\n double minDist = Double.MAX_VALUE;//(meatchelim ldistance hamaximily)\n double currentDistance = 0;\n GeoPoint pt = null;\n for (GeoPoint geoPoint : intersectionPoints) {\n currentDistance = p0.distance(geoPoint.getPoint());//checks the distance from camera to point\n if (currentDistance < minDist) {\n minDist = currentDistance;\n pt = geoPoint;\n }\n }\n return pt;\n }",
"public float getMinX(){\n return points.get(0).getX();\n }",
"public Vect3d getExtent (){\r\n \r\n Vect3d extent = new Vect3d();\r\n extent.x = (max.x - min.x) / 2;\r\n extent.y = (max.y - min.y) / 2;\r\n extent.z = (max.y - min.z) / 2;\r\n return extent;\r\n }",
"public Vector3 (float x, float y, float z) {\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t\tthis.z = z;\r\n\t}",
"public final double getZ()\n {\n return m_jso.getZ();\n }",
"godot.wire.Wire.Vector3OrBuilder getZOrBuilder();",
"Point3D getLeftUpperBackCorner();",
"public abstract ParamNumber getParamZ();",
"public static BlockVector3 getMinVector(double bx, double by, double bz, long xRadius, long yRadius, long zRadius) {\n if (yRadius == -1) {\n return BlockVector3.at(bx - xRadius, 0, bz - zRadius);\n } else {\n return BlockVector3.at(bx - xRadius, by - yRadius, bz - zRadius);\n }\n }",
"public Point getMin () {\r\n\r\n\treturn getA();\r\n }",
"public Vector subtract(Point3D p){\n// return new Vector(\n// p.x.coord- x.coord,\n// p.y.coord- y.coord,\n// p.z.coord- z.coord);\n return new Vector(\n x.coord- p.x.coord,\n y.coord- p.y.coord,\n z.coord- p.z.coord);\n }",
"public Vector3d getOrigin() { return mOrigin; }",
"public Vec3D() {\n\t\tx = y = z = 0.0f;\n\t}"
] | [
"0.75833815",
"0.7101067",
"0.7052109",
"0.6654657",
"0.65929925",
"0.64553386",
"0.644986",
"0.6373728",
"0.632526",
"0.63159627",
"0.63159627",
"0.63159627",
"0.63151777",
"0.6306561",
"0.63040024",
"0.6274826",
"0.6252719",
"0.62319773",
"0.6195802",
"0.6190416",
"0.61338747",
"0.6113087",
"0.611269",
"0.6090727",
"0.60820204",
"0.6063751",
"0.6062493",
"0.60619634",
"0.6043943",
"0.6039373",
"0.60120314",
"0.6008777",
"0.60087615",
"0.5997183",
"0.5996127",
"0.5996127",
"0.5976593",
"0.5972623",
"0.5962182",
"0.5948316",
"0.59407175",
"0.59407175",
"0.5934829",
"0.5928484",
"0.59050804",
"0.5902731",
"0.5853123",
"0.5851338",
"0.58488053",
"0.5827951",
"0.58222175",
"0.5809968",
"0.5800729",
"0.5777722",
"0.57681185",
"0.57680947",
"0.5764695",
"0.5760285",
"0.5745402",
"0.5734515",
"0.5734515",
"0.5728627",
"0.57176125",
"0.5706002",
"0.57024926",
"0.569778",
"0.5696275",
"0.5688302",
"0.5684965",
"0.5672485",
"0.5671575",
"0.5664334",
"0.5663767",
"0.5660141",
"0.56568885",
"0.5656765",
"0.56523037",
"0.5639908",
"0.5639752",
"0.5621426",
"0.5616222",
"0.5611472",
"0.56009907",
"0.55975735",
"0.5596052",
"0.55900854",
"0.55749196",
"0.5574852",
"0.55744624",
"0.55723643",
"0.55680954",
"0.55633146",
"0.55617625",
"0.5558249",
"0.55552065",
"0.5545144",
"0.554098",
"0.55364406",
"0.5533102",
"0.5530751"
] | 0.80098915 | 0 |
The max Z value of the 2D point projected to 3D | public float max3DZ() {
return Math.max(stop3D.z, start3D.z);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"float zMax();",
"public Point3 max(Point3 p) {\n return new Point3( Math.max(x, p.x),\n Math.max(y, p.y),\n Math.max(z, p.z) );\n }",
"public float max3DX() {\n return Math.max(stop3D.x, start3D.x);\n }",
"public double getZ() {\n\t\treturn point[2];\n\t}",
"public float min3DZ() {\n return Math.min(stop3D.z, start3D.z);\n }",
"public float max3DY() {\n return Math.max(stop3D.y, start3D.y);\n }",
"public float getMaxCY3();",
"float getZ();",
"float getZ();",
"float getZ();",
"public double getPositionToP3()\r\n\t{\r\n\t\tdouble max = 0;\r\n\t\tfor(Unit u : units)\r\n\t\t{\r\n\t\t\tif(u instanceof Gate)\r\n\t\t\t\tcontinue;\r\n\t\t\tdouble d = u.getPositionAlongCurve() + u.getRadius()/owner.getLength();\r\n\t\t\tif(d > max)\r\n\t\t\t\tmax = d;\r\n\t\t}\r\n\t\tif(max < 0)\r\n\t\t\tmax = 0;\r\n\t\tif(max > 1)\r\n\t\t\tmax = 1;\r\n\t\treturn 1 - max;\r\n\t}",
"godot.wire.Wire.Vector3 getZ();",
"public float getZ() {\n return z_;\n }",
"public float getZ() {\n return z_;\n }",
"public float getZ() {\r\n return z;\r\n }",
"public double getZ() {\n return position.getZ();\n }",
"@java.lang.Override\n public godot.wire.Wire.Vector3 getZ() {\n return z_ == null ? godot.wire.Wire.Vector3.getDefaultInstance() : z_;\n }",
"public final double getZ() {\n return z;\n }",
"double getZ() { return pos[2]; }",
"public int getZ()\n {\n return zaxis;\n }",
"@java.lang.Override\n public float getZ() {\n return z_;\n }",
"@java.lang.Override\n public float getZ() {\n return z_;\n }",
"public double getZ() {\r\n\t\treturn z;\t\r\n\t\t}",
"public float getLocalZ(){\n\t\treturn this.z;\n\t}",
"public int getZ() {\n\t\treturn -150;\n\t}",
"public double getZ() {\n\t\treturn z;\n\t}",
"public double getZ() {\n\t\treturn z;\n\t}",
"@java.lang.Override\n public float getZ() {\n return z_;\n }",
"@java.lang.Override\n public float getZ() {\n return z_;\n }",
"public double getZ(){\n\t\treturn z;\n\t}",
"public godot.wire.Wire.Vector3 getZ() {\n if (zBuilder_ == null) {\n return z_ == null ? godot.wire.Wire.Vector3.getDefaultInstance() : z_;\n } else {\n return zBuilder_.getMessage();\n }\n }",
"public double getZ() {\r\n return z;\r\n }",
"@Override\n\tpublic double getZ() {\n\t\treturn z;\n\t}",
"float zMin();",
"public float getZ(){\n\t\tif(!isRoot()){\n\t\t\treturn getParent().getZ() + z;\n\t\t}else{\n\t\t\treturn z;\n\t\t}\n\t}",
"public double getAzMax() {\n\t\treturn azMax;\n\t}",
"@Override\n\tpublic double getZLoc() {\n\t\tdouble side = Math.sqrt(getMySize())/2;\n\t\treturn z-side;\n\t}",
"public float getZ()\n {\n return fz;\n }",
"public abstract ParamNumber getParamZ();",
"public double getZFactor() {\r\n\t\treturn z_factor;\r\n\t}",
"public double getz0()\n\t{\n\t\treturn this.z0;\n\t}",
"abstract double getOrgZ();",
"Double getZLength();",
"public Vector3D getExtent() {\n double[] v = this.getVertices();\n\n double xmin = Double.POSITIVE_INFINITY;\n double xmax = Double.NEGATIVE_INFINITY;\n double ymin = Double.POSITIVE_INFINITY;\n double ymax = Double.NEGATIVE_INFINITY;\n double zmin = Double.POSITIVE_INFINITY;\n double zmax = Double.NEGATIVE_INFINITY;\n\n for (int i = 0; i < v.length; i += 3) {\n xmin = Math.min(v[i], xmin);\n xmax = Math.max(v[i], xmax);\n ymin = Math.min(v[i + 1], ymin);\n ymax = Math.max(v[i + 1], ymax);\n zmin = Math.min(v[i + 2], zmin);\n zmax = Math.max(v[i + 2], zmax);\n }\n\n return new Vector3D(xmax - xmin, ymax - ymin, zmax - zmin);\n }",
"public float getLimit_lin_z_upper() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readFloat(__io__address + 52);\n\t\t} else {\n\t\t\treturn __io__block.readFloat(__io__address + 44);\n\t\t}\n\t}",
"public double getMaxCoordinateValue() {\n if (this.max_x > this.max_y)\n return this.max_x;\n else\n return this.max_y;\n }",
"public Position coord3dToGeoCoord(Point3D p) {\n double lat_cor = java.lang.Math.toDegrees(java.lang.Math.asin(-p.getY()));\n float lat = (float)lat_cor - TEXTURE_LAT_OFFSET;\n\n // First case issue: longitude between 0° and 180° => half the globe\n double lon_cor = java.lang.Math.toDegrees(java.lang.Math.acos(p.getZ()\n / java.lang.Math.cos(java.lang.Math.asin(-p.getY()))));\n\n // Second case issue: longitude between -90° and 90° => half the globe too\n //double lon_cor = java.lang.Math.toDegrees(java.lang.Math.asin(-p.getX()\n // / java.lang.Math.cos(java.lang.Math.asin(-p.getY()))));\n\n float lon = (float)lon_cor - TEXTURE_LON_OFFSET;\n\n return new Position(lat, lon);\n }",
"public godot.wire.Wire.Vector3OrBuilder getZOrBuilder() {\n if (zBuilder_ != null) {\n return zBuilder_.getMessageOrBuilder();\n } else {\n return z_ == null ?\n godot.wire.Wire.Vector3.getDefaultInstance() : z_;\n }\n }",
"float zAt(int xIndex, int yIndex);",
"public int getBlockZ()\n\t {\n\t\t if(z >= 0.0) return (int)z;\n\t\t return -1 + (int)(z);\n\t }",
"public BoundingBox3d(float xmin, float xmax, float ymin, float ymax, float zmin, float zmax) {\n this.xmin = xmin;\n this.xmax = xmax;\n this.ymin = ymin;\n this.ymax = ymax;\n this.zmin = zmin;\n this.zmax = zmax;\n }",
"godot.wire.Wire.Vector3OrBuilder getZOrBuilder();",
"double getZLength();",
"public int getZ() {\n\t\treturn z;\n\t}",
"public static Double LargeZ() {\n return LargeZ;\n }",
"@java.lang.Override\n public godot.wire.Wire.Vector3OrBuilder getZOrBuilder() {\n return getZ();\n }",
"public Coord3d getCenter() {\n return new Coord3d((xmin + xmax) / 2, (ymin + ymax) / 2, (zmin + zmax) / 2);\n }",
"public Vect3d getExtent (){\r\n \r\n Vect3d extent = new Vect3d();\r\n extent.x = (max.x - min.x) / 2;\r\n extent.y = (max.y - min.y) / 2;\r\n extent.z = (max.y - min.z) / 2;\r\n return extent;\r\n }",
"public final double getZ()\n {\n return m_jso.getZ();\n }",
"public E calculateMaximum() {\n return FindMaximum.calculateMaximum(x , y , z);\n }",
"public int getZSize() {\n\t\treturn (highPoint.getBlockZ() - lowPoint.getBlockZ()) + 1;\n\t}",
"public Double z() {\n return this.f917a.getAsDouble(\"CFG_LOCATION_LATITUDE\");\n }",
"public Point3D normalize() {\n\t\treturn this.divide(Math.sqrt(x*x + y*y + z*z));\n\t}",
"public Vect3d getCenter (){\r\n Vect3d v = new Vect3d();\r\n v.x = (min.x + max.x) / 2;\r\n v.y = (min.y + max.y) / 2;\r\n v.z = (min.z + max.z) / 2;\r\n return v;\r\n }",
"public double[] getMax(){\n double[] max = new double[3];\n for (Triangle i : triangles) {\n double[] tempmax = i.maxCor();\n max[0] = Math.max( max[0], tempmax[0]);\n max[1] = Math.max( max[1], tempmax[1]);\n max[2] = Math.max( max[2], tempmax[2]);\n }\n return max;\n }",
"public float dst2(float x, float y, float z) {\r\n\t\tfinal float a = x - this.x;\r\n\t\tfinal float b = y - this.y;\r\n\t\tfinal float c = z - this.z;\r\n\t\treturn a * a + b * b + c * c;\r\n\t}",
"public int getZ() {\r\n return z;\r\n }",
"public static double getYFromZ(double z) {\n\t\treturn 0.23 + 2.41 * z;\n\t}",
"Point3D (double x, double y, double z) {\n this.x = x;\n this.y = y;\n this.z = z;\n }",
"public double Z_r() {\r\n \t\treturn getZ();\r\n \t}",
"public Point3D getC() {\r\n return c;\r\n }",
"public float approach_z_GET()\n { return (float)(Float.intBitsToFloat((int) get_bytes(data, 49, 4))); }",
"public boolean compare(Vect3 v, double maxX, double maxY, double maxZ) {\n\t\tif (Math.abs(v.x - x) > maxX) return false;\n\t\tif (Math.abs(v.y - y) > maxY) return false;\n\t\tif (Math.abs(v.z - z) > maxZ) return false;\n\t\treturn true;\n\t}",
"public int getZ() {\n return z;\n }",
"public int getDimZ() {\r\n return dimZ;\r\n }",
"public double getDeltaZ() {\n return deltaZ;\n }",
"public double getDeltaZ() {\n return deltaZ;\n }",
"int getZ();",
"int getZ();",
"int getZ();",
"public int getFarClippingPlane() {\r\n\t\treturn farClippingPlane;\r\n\t}",
"public float min3DX() {\n return Math.min(stop3D.x, start3D.x);\n }",
"public Double z() {\n return z;\n }",
"public Vector3f CubeToWorldVector(float pX, float pY, float pZ) {\n return new Vector3f((pX * this.blockScale) + (this.blockScale * 0.5f),(pY * this.blockScale) + this.blockScale,(pZ * this.blockScale) + (this.blockScale * 0.5f));\n }",
"public double getDeltaZ() {\n return deltaZ;\n }",
"Point3D getLeftUpperBackCorner();",
"public int getZ() {\n return Z;\n }",
"public Point3d get3DCenter() {\n double xOfCenter = 0;\n double yOfCenter = 0;\n double zOfCenter = 0;\n for (IAtom atom : atoms) {\n xOfCenter += atom.getPoint3d().x;\n yOfCenter += atom.getPoint3d().y;\n zOfCenter += atom.getPoint3d().z;\n }\n\n return new Point3d(xOfCenter / getAtomCount(),\n yOfCenter / getAtomCount(),\n zOfCenter / getAtomCount());\n }",
"public double getHeight(Point3d position){\r\n\t\treturn position.y - world.getHeight((int) position.x, (int) position.z);\r\n\t}",
"public double getModZ() {\n return (modZ != 0 ? ( modZ > 0 ? (modZ - RESTADOR) : (modZ + RESTADOR) ) : modZ);\n }",
"@Override\n\tpublic int getZ() {\n\t\treturn 1000;\n\t}",
"public Point getMax () {\r\n\r\n\treturn getB();\r\n }",
"public float min3DY() {\n return Math.min(stop3D.y, start3D.y);\n }",
"protected void calculateMinMaxCenterPoint() {\n\t\tfinal ImagePlus imp = c.getImage();\n\t\tfinal int w = imp.getWidth(), h = imp.getHeight();\n\t\tfinal int d = imp.getStackSize();\n\t\tfinal Calibration cal = imp.getCalibration();\n\t\tmin = new Point3d();\n\t\tmax = new Point3d();\n\t\tcenter = new Point3d();\n\t\tmin.x = w * (float) cal.pixelHeight;\n\t\tmin.y = h * (float) cal.pixelHeight;\n\t\tmin.z = d * (float) cal.pixelDepth;\n\t\tmax.x = 0;\n\t\tmax.y = 0;\n\t\tmax.z = 0;\n\n\t\tfloat vol = 0;\n\t\tfor (int zi = 0; zi < d; zi++) {\n\t\t\tfinal float z = zi * (float) cal.pixelDepth;\n\t\t\tfinal ImageProcessor ip = imp.getStack().getProcessor(zi + 1);\n\n\t\t\tfinal int wh = w * h;\n\t\t\tfor (int i = 0; i < wh; i++) {\n\t\t\t\tfinal float v = ip.getf(i);\n\t\t\t\tif (v == 0) continue;\n\t\t\t\tvol += v;\n\t\t\t\tfinal float x = (i % w) * (float) cal.pixelWidth;\n\t\t\t\tfinal float y = (i / w) * (float) cal.pixelHeight;\n\t\t\t\tif (x < min.x) min.x = x;\n\t\t\t\tif (y < min.y) min.y = y;\n\t\t\t\tif (z < min.z) min.z = z;\n\t\t\t\tif (x > max.x) max.x = x;\n\t\t\t\tif (y > max.y) max.y = y;\n\t\t\t\tif (z > max.z) max.z = z;\n\t\t\t\tcenter.x += v * x;\n\t\t\t\tcenter.y += v * y;\n\t\t\t\tcenter.z += v * z;\n\t\t\t}\n\t\t}\n\t\tcenter.x /= vol;\n\t\tcenter.y /= vol;\n\t\tcenter.z /= vol;\n\n\t\tvolume = (float) (vol * cal.pixelWidth * cal.pixelHeight * cal.pixelDepth);\n\n\t}",
"public Vector3(double x, double y,double z){\n \n double pytago;\n \n this.x = x;\n this.y = y;\n this.z = z;\n \n pytago = (x*x) + (y*y) + (z*z);\n \n magnitude = Math.sqrt(pytago);\n }",
"@Override\n\tpublic int getMaximumLayer() {\n\t\treturn MAX_LAYER;\n\t}",
"public double getDistance(Point3D point){\n return _position.distance(point);\n }",
"@Override\n public int getZ() {\n return (int) claim.getZ();\n }",
"public Vector subtract(Point3D p){\n// return new Vector(\n// p.x.coord- x.coord,\n// p.y.coord- y.coord,\n// p.z.coord- z.coord);\n return new Vector(\n x.coord- p.x.coord,\n y.coord- p.y.coord,\n z.coord- p.z.coord);\n }",
"public static Coordinate create3D(double x, double y, double z) {\r\n return new Coordinate(x, y, z, Double.NaN);\r\n }"
] | [
"0.7800877",
"0.71942794",
"0.7047154",
"0.68410385",
"0.67604953",
"0.6700191",
"0.6657803",
"0.65551585",
"0.65551585",
"0.65551585",
"0.644421",
"0.6416331",
"0.6389398",
"0.63881874",
"0.63642263",
"0.63617116",
"0.6320386",
"0.6312844",
"0.629153",
"0.6282958",
"0.62817687",
"0.62817687",
"0.62342197",
"0.6225988",
"0.622166",
"0.62155277",
"0.62155277",
"0.620922",
"0.620922",
"0.61800224",
"0.61673826",
"0.6135155",
"0.612964",
"0.61132306",
"0.6080918",
"0.6071756",
"0.60623246",
"0.59803003",
"0.5970475",
"0.5961579",
"0.59598064",
"0.59446996",
"0.5938358",
"0.5930617",
"0.5917883",
"0.5889916",
"0.58848745",
"0.58694804",
"0.5849641",
"0.5846074",
"0.58425313",
"0.5841596",
"0.581916",
"0.58033556",
"0.57875335",
"0.57821035",
"0.57756627",
"0.5767891",
"0.57588106",
"0.57476115",
"0.5746147",
"0.5722047",
"0.56788343",
"0.5664032",
"0.5657397",
"0.5653022",
"0.5617545",
"0.5611676",
"0.5599663",
"0.5595531",
"0.5590533",
"0.5589841",
"0.55867916",
"0.5572988",
"0.5551985",
"0.5547493",
"0.5547493",
"0.5544958",
"0.5544958",
"0.5544958",
"0.5542064",
"0.5537855",
"0.5528897",
"0.55257946",
"0.5518312",
"0.5513408",
"0.5507295",
"0.5505957",
"0.5492207",
"0.5491906",
"0.5483298",
"0.54734737",
"0.5472215",
"0.5470462",
"0.5469075",
"0.5439798",
"0.5435111",
"0.542992",
"0.5428369",
"0.5416867"
] | 0.7984397 | 0 |
Configure G2D with selection drawing settings | public void apply(Graphics2D g2d) {
g2d.setColor(AWTColor.toAWT(color));
// Text
String name = g2d.getFont().getFontName();
int size = g2d.getFont().getSize();
Font f = new Font(name, Font.PLAIN, (int) (size * annotationFontSizeFactor));
g2d.setFont(f);
// Stroke
g2d.setStroke(borderStroke);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract void paintSelection(Graphics2D g);",
"public void drawSelectedStyle(Graphics2D g2) {\n final int PADDING = 2;\n final Color selectColor = new Color(100, 100, 100);\n\n final BasicStroke dashed = new BasicStroke(1.0f, BasicStroke.CAP_BUTT,\n BasicStroke.JOIN_MITER, 10.0f, new float[] {2f}, 0.0f);\n\n final Rectangle inRectangle = new Rectangle(bounds.x + PADDING, bounds.y\n + PADDING, bounds.width - 2 * PADDING,\n bounds.height - 2 * PADDING);\n\n final Rectangle outRectangle = new Rectangle(bounds.x - PADDING, bounds.y\n - PADDING, bounds.width + 2 * PADDING,\n bounds.height + 2 * PADDING);\n\n g2.setStroke(dashed);\n g2.setColor(selectColor);\n\n g2.drawRect(inRectangle.x, inRectangle.y, inRectangle.width,\n inRectangle.height);\n g2.drawRect(outRectangle.x, outRectangle.y, outRectangle.width,\n outRectangle.height);\n }",
"public void draw(){\n\t\tif(!visible) return;\n\n\t\twinApp.pushStyle();\n\t\twinApp.style(G4P.g4pStyle);\n\t\tPoint pos = new Point(0,0);\n\t\tcalcAbsPosition(pos);\n\n\t\t// Draw selected option area\n\t\tif(border == 0)\n\t\t\twinApp.noStroke();\n\t\telse {\n\t\t\twinApp.strokeWeight(border);\n\t\t\twinApp.stroke(localColor.txfBorder);\n\t\t}\n\t\tif(opaque)\n\t\t\twinApp.fill(localColor.txfBack);\n\t\telse\n\t\t\twinApp.noFill();\n\t\twinApp.rect(pos.x, pos.y, width, height);\n\t\t\n\t\t// Draw selected text\n\t\twinApp.noStroke();\n\t\twinApp.fill(localColor.txfFont);\n\t\twinApp.textFont(localFont, localFont.getSize());\n\t\twinApp.text(text, pos.x + PADH, pos.y -PADV +(height - localFont.getSize())/2, width - 16, height);\n\n\t\t// draw drop down list\n\t\twinApp.fill(winApp.color(255,255));\n\t\tif(imgArrow != null)\n\t\t\twinApp.image(imgArrow, pos.x + width - imgArrow.width - 1, pos.y + (height - imgArrow.height)/2);\n\t\tif(expanded == true){\n\t\t\tGOption opt;\n\t\t\twinApp.noStroke();\n\t\t\twinApp.fill(localColor.txfBack);\n\t\t\twinApp.rect(pos.x,pos.y+height,width,nbrRowsToShow*height);\n\n\t\t\tfor(int i = 0; i < optGroup.size(); i++){\n\t\t\t\topt = optGroup.get(i);\n\t\t\t\tif(i >= startRow && i < startRow + nbrRowsToShow){\n\t\t\t\t\topt.visible = true;\n\t\t\t\t\topt.y = height * (i - startRow + 1);\n\t\t\t\t\topt.draw();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\topt.visible = false;\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Draw box round list\n\t\t\tif(border != 0){\n\t\t\t\twinApp.strokeWeight(border);\n\t\t\t\twinApp.stroke(localColor.txfBorder);\n\t\t\t\twinApp.noFill();\n\t\t\t\twinApp.rect(pos.x,pos.y+height,width,nbrRowsToShow*height);\n\t\t\t}\n\t\t\tif(optGroup.size() > maxRows){\n\t\t\t\tslider.setVisible(true);\n\t\t\t\tslider.draw();\n\t\t\t}\n\t\t}\n\t\twinApp.popStyle();\n\t}",
"private void drawHelp(Graphics2D g2d) {\n Composite orig_comp = g2d.getComposite();\n g2d.setColor(RTColorManager.getColor(\"brush\", \"dim\")); g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.8f)); g2d.fillRect(0,0,getWidth(),getHeight()); g2d.setComposite(orig_comp);\n int base_x = 5, base_y = Utils.txtH(g2d,\"0\");\n base_y = drawKeyCombo(g2d, base_x, base_y, \"Key\", \"Normal\", \"Shift\", \"Ctrl\", \"Ctrl-Shift\");\n base_y = drawKeyCombo(g2d, base_x, base_y, \"E\", \"Expand Selection\", \"Use Directed Graph\");\n base_y = drawKeyCombo(g2d, base_x, base_y, \"1 - 9\", \"Select Degree\", \"Subtract\", \"Add\", \"Intersect\");\n base_y = drawKeyCombo(g2d, base_x, base_y, \"0\", \"Select Degree > 10\", \"Subtract\", \"Add\", \"Intersect\");\n base_y = drawKeyCombo(g2d, base_x, base_y, \"R\", \"Select Cut Vertices\", \"Subtract\", \"Add\", \"Intersect\");\n base_y = drawKeyCombo(g2d, base_x, base_y, \"Q\", \"Invert Selection\");\n base_y = drawKeyCombo(g2d, base_x, base_y, \"X\", \"Hide Selection\");\n base_y = drawKeyCombo(g2d, base_x, base_y, \"M\", \"Toggle Mode\");\n base_y = drawKeyCombo(g2d, base_x, base_y, \"G\", \"Grid Layout Mode\");\n base_y = drawKeyCombo(g2d, base_x, base_y, \"Y\", \"Line Layout Mode\");\n base_y = drawKeyCombo(g2d, base_x, base_y, \"C\", \"Circle Layout Mode\");\n base_y = drawKeyCombo(g2d, base_x, base_y, \"T\", \"Group Nodes\", \"Align Horizontally\", \"Align Vertically\", \"\");\n base_y = drawKeyCombo(g2d, base_x, base_y, \"S\", \"Set/Clear Sticky Labels\", \"Subtract From\", \"Add To\", \"Intersect With\");\n base_y = drawKeyCombo(g2d, base_x, base_y, \"V\", \"Toggle Node Size\");\n base_y = drawKeyCombo(g2d, base_x, base_y, \"L\", \"Toggle Labels\", \"Toggle Edge Templates\", \"Toggle Node Legend\", \"\");\n base_y = drawKeyCombo(g2d, base_x, base_y, \"W\", \"Make One Hops Visible\", \"Use Directed Graph\");\n base_y = drawKeyCombo(g2d, base_x, base_y, \"N\", \"Add Note\");\n base_y = drawKeyCombo(g2d, base_x, base_y, \"A\", \"Pan Mode\");\n base_y = drawKeyCombo(g2d, base_x, base_y, \"F\", \"Fit\");\n base_y = drawKeyCombo(g2d, base_x, base_y, \"Minus (-)\", \"Zoom Out\", \"Fit\");\n base_y = drawKeyCombo(g2d, base_x, base_y, \"Plus (+)\", \"Zoom In\");\n base_y = drawKeyCombo(g2d, base_x, base_y, \"Cursor Keys\", \"Shift Selected Nodes\");\n base_y = drawKeyCombo(g2d, base_x, base_y, \"< >\", \"Rotate Selected Nodes\", \"15 Degs\", \"90 Degs\", \"\");\n base_y = drawKeyCombo(g2d, base_x, base_y, \"{ }\", \"Scale Selected Nodes\", \"More\", \"Even More\", \"\");\n base_y = drawKeyCombo(g2d, base_x, base_y, \"F[2-5]\", \"Save Layout To Fx\", \"Restore\", \"Delete\", \"Restore\");\n }",
"@Override\n\tprotected void paintComponent(Graphics g) {\n\t\tsuper.paintComponent(g);\n\t\tGraphics2D g2 = (Graphics2D) g; \n\t\tg2.setColor(Color.lightGray);\n\t\tg2.fill(model.bg);\n\t\tg2.setColor(Color.darkGray);\n\t\tg2.fillPolygon(model.terrain);\n\t\tg2.setColor(Color.gray);\n\t\tfor (int i = 0; i < 20; i++) {\n\t\t\tg2.draw(model.circles.get(i));\n\t\t}\n\t\tif (model.curCircleSel != -1) {\n\t\t\tg2.setColor(Color.white);\n\t\t\tg2.setStroke(new BasicStroke(3));\n\t\t\tg2.draw(model.circles.get(model.curCircleSel));\n\t\t}\n\t\tg2.setColor(Color.RED);\n\t\tg2.fill(model.pad);\n\t\tif (curPadSel) {\n\t\t\tg2.setColor(Color.white);\n\t\t\tg2.setStroke(new BasicStroke(3));\n\t\t\tg2.draw(model.pad);\n\t\t}\n\t}",
"public void drawSelected(Graphics2D g2) {\n\t\tfloat[] dashes = {1,1,1};\n \tBasicStroke stroke = new BasicStroke(2, BasicStroke.CAP_SQUARE, BasicStroke.CAP_SQUARE, 10, dashes, 10);\n \tg2.setColor(Color.RED);\n\t\tg2.draw(stroke.createStrokedShape(new Rectangle2D.Double(this.getX()-2,this.getY()-2,this.getDimension()+4,this.getDimension()/2 +4)));\n\t}",
"protected void createSelection() {\r\n\t\tsel = new GraphSelection();\r\n\t}",
"protected void configureGraphics(Graphics2D g)\n/* */ {\n/* 373 */ AffineTransform tx = getTransform();\n/* 374 */ if (tx != null) {\n/* 375 */ g.setTransform(tx);\n/* */ }\n/* */ }",
"protected void setupGraphics(Graphics2D g2) {\r\n g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,\r\n RenderingHints.VALUE_ANTIALIAS_ON);\r\n }",
"public void updateSelection()\n {\n \trectForSelection.setRect(rettangoloX,rettangoloY,larghezza,altezza);\n \trectSelTopLeft.setRect(rettangoloX-3,rettangoloY-3,6,6);\n \trectSelBottomLeft.setRect(rettangoloX-3,rettangoloY+altezza-3,6,6);\n \trectSelTopRight.setRect(rettangoloX+larghezza-3,rettangoloY-3,6,6);\n \trectSelBottomRight.setRect(rettangoloX+larghezza-3,rettangoloY+altezza-3,6,6);\n }",
"@Override\n public synchronized void paint(Graphics g) {\n if (!shouldPaint()) {\n return;\n }\n\n if (g instanceof Graphics2D) {\n Graphics2D g2 = (Graphics2D) g;\n g2.setRenderingHints(argoRenderingHints);\n\t double scale = getScale();\n g2.scale(scale, scale);\n }\n getLayerManager().paint(g);\n //getLayerManager().getActiveLayer().paint(g);\n if (_canSelectElements) {\n _selectionManager.paint(g);\n _modeManager.paint(g);\n }\n }",
"@Override\n\tpublic void draw(Graphics g) {\n\t\tg.setColor(Color.BLACK);\n for(int j = 0 ; j < 3 ; j++) {\n \tg.drawRect(0,50*j, 120, 50);\n }\n \n if(super.selected) {\n\t\t\tg.fillRect(super.north_port.x, super.north_port.y, super.connection_port_width ,super.connection_port_width);\n\t g.fillRect(super.east_port.x-super.connection_port_width, super.east_port.y, super.connection_port_width,super.connection_port_width);\n\t g.fillRect(super.south_port.x, super.south_port.y-super.connection_port_width ,super.connection_port_width,super.connection_port_width);\n\t g.fillRect(super.west_port.x, super.west_port.y, super.connection_port_width,super.connection_port_width);\n\t\t}\n \t\n \n }",
"@Override\n\tvoid draw(Graphics g) {\n\t\tg.setColor(needsHighlight() ? selectColor : Color.GRAY);\n\t\tsetBbox(x, y, x2, y2);\n\t\tif (x < x2 && y < y2)\n\t\t\tg.fillRect(x, y, x2 - x, y2 - y);\n\t\telse if (x > x2 && y < y2)\n\t\t\tg.fillRect(x2, y, x - x2, y2 - y);\n\t\telse if (x < x2 && y > y2)\n\t\t\tg.fillRect(x, y2, x2 - x, y - y2);\n\t\telse\n\t\t\tg.fillRect(x2, y2, x - x2, y - y2);\n\t}",
"private void setup2DGraphics() {\n\n\t\tGL11.glMatrixMode(GL11.GL_PROJECTION);\n\t\tGL11.glLoadIdentity();\n\t\tGL11.glOrtho(0, width, 0, height, 1, -1);\n\t\tGL11.glMatrixMode(GL11.GL_MODELVIEW);\n\t\tGL11.glLoadIdentity();\n\t}",
"public void selectionChanged(DrawingView view) {\n setupAttributes();\n }",
"@Override\n public void paint(Graphics g) {\n g2 = (Graphics2D) g;\n drawBackground();\n drawSquares();\n drawLines();\n gui.hint = new TreeSet<>();\n }",
"public void update_config(Graphics2D g2) {\n this.resized = false;\n this.reconfig = false;\n\n // anti-aliasing\n this.rendering_hints.put(RenderingHints.KEY_ANTIALIASING, preferences.get_anti_alias() ? RenderingHints.VALUE_ANTIALIAS_ON : RenderingHints.VALUE_ANTIALIAS_OFF);\n this.rendering_hints.put(RenderingHints.KEY_TEXT_ANTIALIASING, preferences.get_anti_alias() ? RenderingHints.VALUE_TEXT_ANTIALIAS_ON : RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);\n\n // define the colors\n set_colors( preferences.get_use_more_color(), preferences.get_border_color() );\n border_gradient = new GradientPaint(\n 0, 0, backpanel_color.darker().darker().darker(),\n frame_size.width, frame_size.height , backpanel_color.brighter(),\n true);\n\n // switch width and height if the instrument is displayed on its side\n if ( ( preferences.get_panel_orientation(this.display_unit) == XHSIPreferences.Orientation.RIGHT )\n || ( preferences.get_panel_orientation(this.display_unit) == XHSIPreferences.Orientation.LEFT ) ) {\n this.frame_size.height = this.component_size.width;\n this.frame_size.width = this.component_size.height;\n }\n\n // calculate coordinates\n this.border_left = this.border;\n this.border_right = this.border;\n this.border_top = this.border;\n this.border_bottom = this.border;\n if ( preferences.get_panel_square(this.display_unit) ) {\n if ( this.frame_size.width > (this.frame_size.height ) ) {\n this.border_left += ( this.frame_size.width - ( this.frame_size.height ) ) / 2;\n this.border_right = this.border_left;\n } else {\n this.border_top += ( this.frame_size.height - this.frame_size.width ) / 2;\n this.border_bottom = this.border_top;\n }\n }\n //this.scaling_factor = Math.min( (float)this.frame_size.height, (float)this.frame_size.width ) / 600.0f;\n this.scaling_factor = Math.min( (float)(frame_size.width - border_left - border_right), (float)(frame_size.height - border_top - border_bottom) ) / 600.0f;\n // if the panel gets smaller than 600px, we _should_ try to reduce the size of fonts and images\n this.shrink_scaling_factor = Math.min(1.0f, this.scaling_factor);\n // things like the line thickness can grow when the panel gets bigger than 600px\n this.grow_scaling_factor = Math.max(1.0f, this.scaling_factor);\n // some screen elements like line widths and the border can grow with the power of 2\n if ( preferences.get_panels_locked() ) {\n this.border = preferences.get_panel_border(this.display_unit);\n } else {\n this.border = (int) (INITIAL_BORDER_SIZE * Math.max(1.0f, Math.pow(Math.min((float) this.frame_size.width, (float) this.frame_size.height) / 600.0f, 2)));\n }\n\n // the rectangle for our instrument\n panel_rect = new Rectangle(\n border_left,\n border_top,\n frame_size.width - border_left - border_right,\n frame_size.height - border_top - border_bottom\n );\n\n // a nice frame with rounded corners; it will be painted in InstrumentFrame.java\n Area inner_frame = new Area(new RoundRectangle2D.Float(\n border_left,\n border_top,\n frame_size.width - (border_left + border_right),\n frame_size.height - (border_top + border_bottom),\n (int)(30 * this.grow_scaling_factor),\n (int)(30 * this.grow_scaling_factor)));\n instrument_frame = new Area(new Rectangle2D.Float(0, 0, frame_size.width, frame_size.height));\n instrument_frame.subtract(inner_frame);\n // if the cpu can handle it: a double border\n Area outer_frame = new Area(new RoundRectangle2D.Float(\n border_left - border_left / 3,\n border_top - border_top / 3,\n frame_size.width - (border_left + border_right) + border_left / 3 + border_right / 3,\n frame_size.height - (border_top + border_bottom) + border_top / 3 + border_bottom / 3,\n (int)(30 * this.grow_scaling_factor),\n (int)(30 * this.grow_scaling_factor)));\n instrument_outer_frame = new Area(new Rectangle2D.Float(0, 0, frame_size.width, frame_size.height));\n instrument_outer_frame.subtract(outer_frame);\n\n // fonts\n set_fonts(g2, this.scaling_factor);\n\n }",
"protected void attemptGridStrokeSelection() {\n/* 298 */ StrokeChooserPanel panel = new StrokeChooserPanel(this.gridStrokeSample, this.availableStrokeSamples);\n/* */ \n/* 300 */ int result = JOptionPane.showConfirmDialog(this, panel, localizationResources\n/* 301 */ .getString(\"Stroke_Selection\"), 2, -1);\n/* */ \n/* */ \n/* 304 */ if (result == 0) {\n/* 305 */ this.gridStrokeSample.setStroke(panel.getSelectedStroke());\n/* */ }\n/* */ }",
"public void draw(Graphics2D g)\n {\n //g.setColor(Color.black);\n //g.drawString(statusMsg,20,20);\n\n /* only draw when game is not running */\n if(GAME_RUNNING == false && selectedWidget != null)\n {\n if(SELECT_MODE == SelectMode.SELECTED || SELECT_MODE == SelectMode.DRAGGING)\n {\n /* draw boundary of selected widget */\n g.setColor(Color.orange);\n\n Vector2f[] points = selectedWidget.getBoundary();\n for(int i = 0; i <= 3; i++)\n \t\t{\n \n \t\t\tg.drawLine(\n (int)points[i].getX(),\n (int)points[i].getY(),\n (int)points[(i+1)%4].getX(),\n (int)points[(i+1)%4].getY());\n \t\t}\n }\n\n if(SELECT_MODE == SelectMode.DRAGGING || SELECT_MODE == SelectMode.ADDING)\n {\n /* draw boundary of dragged widget */\n if (timWorld.testPlacement(selectedWidget, mouseX + clickOffsetX, mouseY + clickOffsetY))\n {\n /* placement position is safe, draw green boundary */\n g.setColor(Color.green);\n }\n else\n {\n /* placement position unsafe, draw red boundary */\n g.setColor(Color.red);\n }\n \n Vector2f[] points = selectedWidget.getBoundary();\n for(int i = 0; i <= 3; i++)\n \t\t{\n \n if(SELECT_MODE == SelectMode.ADDING)\n {\n \t\t\tg.drawLine(\n (int)(points[i].getX() + mouseX),\n (int)(points[i].getY() + mouseY),\n (int)(points[(i+1)%4].getX() + mouseX),\n (int)(points[(i+1)%4].getY() + mouseY));\n }\n else\n {\n \t\t\t g.drawLine(\n (int)(points[i].getX() + (mouseX - pressX)),\n (int)(points[i].getY() + (mouseY - pressY)),\n (int)(points[(i+1)%4].getX() + (mouseX - pressX)),\n (int)(points[(i+1)%4].getY() + (mouseY - pressY)));\n }\n \t\t}\n }\n }\n }",
"protected void attemptGridPaintSelection() {\n/* 314 */ Color c = JColorChooser.showDialog(this, localizationResources.getString(\"Grid_Color\"), Color.blue);\n/* */ \n/* 316 */ if (c != null) {\n/* 317 */ this.gridPaintSample.setPaint(c);\n/* */ }\n/* */ }",
"@Override\n protected void paint2d(Graphics2D g) {\n \n }",
"public void restoreGraphics() {\n\n if ( g2 instanceof AimxcelGraphics2D ) {\n AimxcelGraphics2D aimxcelGraphics2D = (AimxcelGraphics2D) g2;\n aimxcelGraphics2D.popState();\n }\n else {\n if ( g2.getRenderingHints() != renderingHints ) {\n g2.setRenderingHints( renderingHints );\n }\n if ( g2.getPaint() != paint ) {\n g2.setPaint( paint );\n }\n if ( g2.getColor() != color ) {\n g2.setColor( color );\n }\n if ( g2.getStroke() != stroke ) {\n g2.setStroke( stroke );\n }\n if ( g2.getComposite() != composite ) {\n g2.setComposite( composite );\n }\n if ( g2.getTransform() != transform ) {\n g2.setTransform( transform );\n }\n if ( g2.getFont() != font ) {\n g2.setFont( font );\n }\n if ( g2.getClip() != clip ) {\n g2.setClip( clip );\n }\n if ( g2.getBackground() != background ) {\n g2.setBackground( background );\n }\n }\n }",
"public void drawSelection(Graphics g, int screenX, int screenY, Case caseSelection, int selectionX, int selectionY) {\n\t\t\n\t}",
"@Override\n public void paintMenu(Graphics g) {\n if (visible) {\n g.drawImage(toDraw, xPos, yPos, null); \n \n if (selection >= 0) {\n g.setColor(Colors.getColor(Colors.selectedColor));\n g.fillRoundRect(xPos + wGap, selection * hItemBox + yPos + hGap, getWidth() - wGap, hItemBox, wGap, hGap);\n }\n \n if (!activated) {\n g.setColor(Colors.getColor(Colors.selectedColor));\n g.fillRoundRect(xPos, yPos, getWidth(), getHeight(), wGap, hGap);\n }\n }\n }",
"protected void applyMouse2DSelection(View view) {\n\n boolean allowCrop = true;\n\n if (!mouseSelection.complete()) {\n return;\n }\n\n\n // Reset selection to UNZOOM\n if (!mouseSelection.growing()) {\n // getChart().getScene().getGraph().setClipBox(null);\n\n if (allowCrop)\n getChart().getScene().getGraph().setClipBox(null);\n\n view.setBoundMode(ViewBoundMode.AUTO_FIT);\n\n }\n // Or apply selection to ZOOM\n else {\n BoundingBox3d bounds = view.getBounds().clone();\n\n configureZoomAccordingTo2DView(view, bounds, mouseSelection);\n\n // Reset mouse selection now so that next rendering will hide it from screen\n mouseSelection = new MouseSelection();\n\n // Won't do anything for irrelevant bounds leading to a flat graph\n if (bounds.getXRange().getRange() <= 0 \n || bounds.getYRange().getRange() <= 0\n || bounds.getZRange().getRange() <= 0)\n return;\n\n //System.out.println(\"Will zoom to \" + bounds);\n\n // Crop and zoom\n if (allowCrop) {\n boolean includeLimits = false; // to avoid inacurrate box scale\n getChart().getScene().getGraph().setClipBox(bounds, includeLimits, false);\n }\n view.setBoundsManual(bounds);\n\n\n }\n\n }",
"public void paintSelected(Graphics2D g2d)\n {\n if (isSelected)\n {\n \tg2d.setColor(Color.black);\n \tg2d.draw(rectForSelection);\n \tg2d.setColor(Color.white);\n \tg2d.fill(rectSelTopLeft);\n \tg2d.fill(rectSelBottomLeft);\n \tg2d.fill(rectSelTopRight);\n \tg2d.fill(rectSelBottomRight);\n \tg2d.setColor(Color.black);\n \tg2d.draw(rectSelTopLeft);\n \tg2d.draw(rectSelBottomLeft);\n \tg2d.draw(rectSelTopRight);\n \tg2d.draw(rectSelBottomRight);\n \t\n }\n }",
"@Override\n\tpublic void draw(Graphics2D g2d) {\n\t\t\n\t}",
"public void paintSelected(Graphics g, int mode, double zx, double zy ){\n \r\n g.setXORMode(Color.WHITE);\r\n \r\n g.setColor(selectedBorderColor);\r\n if(mode == DrawingCanvas.EDIT_LEFT){\r\n paintSelectedBorder(g, (int)(x*zx) , (int)(y*zy), (int)zx, (int)(h*zy+zy));\r\n }\r\n else if(mode == DrawingCanvas.EDIT_RIGHT){\r\n //paintSelectedBorder(g, x + w - 3, y - 3, (int)(6/zx), h + 6);\r\n paintSelectedBorder(g, (int)((x+w)*zx) , (int)(y*zy), (int)zx, (int)(h*zy+zy));\r\n }\r\n else if(mode == DrawingCanvas.EDIT_UPPER){\r\n //paintSelectedBorder(g, x - 3, y - 3, w + 6, (int)(6/zy));\r\n paintSelectedBorder(g, (int)(x*zx) , (int)(y*zy), (int)((w+1)*zx), (int)(zy));\r\n }\r\n else if(mode == DrawingCanvas.EDIT_LOWER){\r\n //paintSelectedBorder(g, x - 3, y + h - 3, w + 6, (int)(6/zy));\r\n paintSelectedBorder(g, (int)(x*zx) , (int)((y+h)*zy), (int)((w+1)*zx), (int)(zy));\r\n }\r\n else if(mode == DrawingCanvas.EDIT_BODY){\r\n paintSelectedBorder(g, x + 5, y + 5, w - 10, h - 10);\r\n }\r\n \r\n }",
"private void drawInteractions(Graphics2D g2d, RenderContext myrc) {\n Composite orig_comp = g2d.getComposite();\n // Draw the interaction\n switch (ui_inter) {\n case PANNING: g2d.setColor(RTColorManager.getColor(\"background\", \"default\")); g2d.fillRect(0,0,getWidth(),getHeight());\n\t g2d.drawImage(myrc.getBase(), m_x1 - m_x0, m_y1 - m_y0, null); \n g2d.setColor(RTColorManager.getColor(\"annotate\", \"cursor\")); int cx = getWidth()/2, cy = getHeight()/2; g2d.drawLine(cx-12,cy,cx+12,cy); g2d.drawLine(cx,cy-12,cx,cy+12);\n break;\n case GRID_LAYOUT:\n\tcase CIRCLE_LAYOUT:\n case SELECTING: int x0 = m_x0 < m_x1 ? m_x0 : m_x1, y0 = m_y0 < m_y1 ? m_y0 : m_y1,\n\t\t\t dx = (int) Math.abs(m_x1 - m_x0), dy = (int) Math.abs(m_y1 - m_y0);\n\t\t\t if (dx == 0) dx = 1; if (dy == 0) dy = 1;\n\t\t\t g2d.setColor(RTColorManager.getColor(\"select\", \"region\"));\n\t\t\t Shape shape;\n\t\t\t if (ui_inter == UI_INTERACTION.SELECTING || ui_inter == UI_INTERACTION.GRID_LAYOUT) {\n shape = new Rectangle2D.Double(x0,y0,dx,dy);\n\t\t\t } else {\n double radius = Math.sqrt(dx*dx+dy*dy);\n shape = new Ellipse2D.Double(m_x0-radius,m_y0-radius,2*radius,2*radius);\n }\n\t\t\t g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f));\n\t\t\t g2d.fill(shape);\n\t\t\t g2d.setComposite(orig_comp);\n\t\t\t if (ui_inter == UI_INTERACTION.SELECTING) {\n String str = \"Selecting...\"; if (last_shft_down && last_ctrl_down) str += \" (Intersect)\";\n\t\t\t else if (last_shft_down ) str += \" (Remove From)\";\n\t\t\t\t\t\t\t else if ( last_ctrl_down) str += \" (Add To)\";\n g2d.drawString(str, x0, y0); \n } else g2d.drawString(\"Layout...\", x0, y0);\n\t\t\t g2d.draw(shape);\n\t\t\t break;\n case MOVING: g2d.drawString(\"Moving...\", 5, getHeight()-5); \n\t Set<String> moving_set_dup = moving_set;\n if (moving_set_dup != null && moving_set_dup.size() > 0) {\n\t\t\t AffineTransform orig = g2d.getTransform(); g2d.setColor(RTColorManager.getColor(\"linknode\", \"movenodes\"));\n\t\t\t g2d.translate(m_x1 - m_x0, m_y1 - m_y0);\n Iterator<String> it = moving_set_dup.iterator();\n\t\t\t while (it.hasNext()) {\n\t\t\t String str = it.next(); shape = myrc.node_to_geom.get(entity_to_sxy.get(str));\n\t\t\t if (shape != null) { g2d.draw(shape); }\n\t\t\t }\n\t\t\t g2d.setTransform(orig);\n\t\t \t }\n break;\n\tcase LINE_LAYOUT: g2d.setColor(RTColorManager.getColor(\"linknode\", \"layout\"));\n\t g2d.drawLine(m_x0, m_y0, m_x1, m_y1);\n\t\t\t break;\n\tcase NONE:\n\t\tbreak;\n\tdefault:\n\t\tbreak;\n }\n }",
"public void setSelection(Pair selection);",
"public void draw(Graphics g) {\n g.setColor(needsHighlight() ? selectColor : Color.GRAY);\n setBbox(x1, y1, x2, y2);\n g.setLineDash(16, 6);\n if (x1 < x2 && y1 < y2) {\n g.drawRect(x1, y1, x2 - x1, y2 - y1);\n } else if (x1 > x2 && y1 < y2) {\n g.drawRect(x2, y1, x1 - x2, y2 - y1);\n } else if (x1 < x2 && y1 > y2) {\n g.drawRect(x1, y2, x2 - x1, y1 - y2);\n } else {\n g.drawRect(x2, y2, x1 - x2, y1 - y2);\n }\n g.setLineDash(0, 0);\n }",
"private void paintSelectingPart(int fromSample, int toSample) {\r\n\t\tGraphics g = getGraphics();\r\n\t\tif (g != null) {\r\n\t\t\tif (SELECT_ALL_CHANNELS || getChannelCount() == 1) {\r\n\t\t\t\t// assumes that above and below graphs is nothing\r\n\t\t\t\tg.setClip(getGraphBounds(ALL_CHANNELS));\r\n\t\t\t} else if (SELECT_LEFT) {\r\n\t\t\t\tg.setClip(getGraphBounds(0));\r\n\t\t\t} else if (SELECT_RIGHT) {\r\n\t\t\t\tg.setClip(getGraphBounds(1));\r\n\t\t\t}\r\n\t\t\tint pixelFrom = toPixelX(fromSample);\r\n\t\t\tint width = toPixelEndX(toSample) - pixelFrom + 1;\r\n\t\t\tg.clipRect(pixelFrom + pv.graphX, 0, width, pv.height);\r\n\t\t\tpaintGraphArea(g);\r\n\t\t\tg.dispose();\r\n\t\t}\r\n\t}",
"void setColorSelection() {\r\n for (int i = 0; i < chooser.length; i++) {\r\n\r\n if (mainclass.getGraphTyp()\r\n == AbstractGraph.GRAPHTYP_RESIDUAL) {\r\n\r\n switch (i) {\r\n case COLOR_EDGE_ONE:\r\n chooser[i].setColorSelected(colors[COLOR_EDGE_FLOW]);\r\n break;\r\n case COLOR_EDGE_TWO:\r\n chooser[i].setColorSelected(colors[COLOR_EDGE_CAP]);\r\n break;\r\n case COLOR_EDGE_TOP:\r\n chooser[i].setColorSelected(colors[COLOR_EDGE_RTOP]);\r\n break;\r\n default:\r\n chooser[i].setColorSelected(colors[i]);\r\n }\r\n } else {\r\n chooser[i].setColorSelected(colors[i]);\r\n }\r\n }\r\n }",
"public void changeToStandard(){\n drawAttributeManager.toggleStandardView();\n getContentPane().setBackground(DrawAttribute.whiteblue);\n canvas.repaint();\n }",
"void pickingDraw(GL2 gl, GLUgl2 glu, Camera camera, PickingCameraEvent event);",
"public void setGraph(Graphics2D g2D) {\n\t\tthis.g2D = g2D;\n\t\tg2D.setColor(Color.RED);\n\t\tmodel.loadPoints();\n\t\tfor (Model.Point point : model.loadPointList()) {\n\t\t\tpoint.xValue = point.xValue;\n\t\t\tpoint.yValue = point.yValue;\n\t\t\tg2D.fillRect((int) point.xValue, (int) point.yValue, 4, 4);\n\t\t}\n\t}",
"public abstract void Draw(Graphics2D g, double zoomFactor);",
"public abstract void Draw(Graphics2D g, double zoomFactor);",
"public void draw(Graphics2D g2) {\n super.draw(g2);\n }",
"public void setGrid(final boolean theSelection) {\n myGrid = theSelection;\n repaint();\n }",
"void graphSelectionChanged(Mode mode);",
"public void display2() { // for drag action -> color change\n stroke (255);\n fill(0,255,255);\n ellipse (location.x, location.y, diameter, diameter);\n }",
"public void init()\n \t{\n \t\tgdsOutputMergesBoxes.setSelected(getBoolean(gdsOutMergesBoxesSetting));\n \t\tgdsOutputWritesExportPins.setSelected(getBoolean(gdsOutWritesExportPinsSetting));\n \t\tgdsOutputUpperCase.setSelected(getBoolean(gdsOutUpperCaseSetting));\n \t\tgdsDefaultTextLayer.setText(Integer.toString(getInt(gdsOutDefaultTextLayerSetting)));\n gdsOutputConvertsBracketsInExports.setSelected(getBoolean(gdsOutputConvertsBracketsInExportsSetting));\n gdsCellNameLenMax.setText(Integer.toString(getInt(gdsCellNameLenMaxSetting)));\n \n \t\t// build the layers list\n \t\tgdsLayersModel = new DefaultListModel();\n \t\tgdsLayersList = new JList(gdsLayersModel);\n \t\tgdsLayersList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n \t\tgdsLayerList.setViewportView(gdsLayersList);\n \t\tgdsLayersList.clearSelection();\n \t\tgdsLayersList.addMouseListener(new MouseAdapter()\n \t\t{\n \t\t\tpublic void mouseClicked(MouseEvent evt) { gdsClickLayer(); }\n \t\t});\n \t\tfor(Iterator<Technology> it = Technology.getTechnologies(); it.hasNext(); )\n \t\t{\n \t\t\tTechnology tech = it.next();\n \t\t\ttechnologySelection.addItem(new TechGDSTab(tech));\n \t\t}\n \t\ttechnologySelection.addActionListener(new ActionListener()\n \t\t{\n \t\t\tpublic void actionPerformed(ActionEvent evt) { techChanged(); }\n \t\t});\n \t\ttechnologySelection.setSelectedItem(Technology.getCurrent());\n \n foundrySelection.addActionListener(new ActionListener()\n \t\t{\n \t\t\tpublic void actionPerformed(ActionEvent evt) { foundryChanged(); }\n \t\t});\n \n \n // to set foundry the first time\n techChanged();\n \n \t\tGDSDocumentListener myDocumentListener = new GDSDocumentListener(this);\n \t\tgdsLayerNumber.getDocument().addDocumentListener(myDocumentListener);\n \t\tgdsLayerType.getDocument().addDocumentListener(myDocumentListener);\n \t\tgdsPinLayer.getDocument().addDocumentListener(myDocumentListener);\n \t\tgdsPinType.getDocument().addDocumentListener(myDocumentListener);\n \t\tgdsTextLayer.getDocument().addDocumentListener(myDocumentListener);\n \t\tgdsTextType.getDocument().addDocumentListener(myDocumentListener);\n \t}",
"public void initSelection(Point2D.Double start, double newW, double newH) {\r\n\r\n\t\tdouble[] dimensions = { start.getX(), start.getY(), newW, newH };\r\n\r\n\t\tx = start.getX();\r\n\t\ty = start.getY();\r\n\t\tw = newW;\r\n\t\th = newH;\r\n\t\tdimensions = calculatePositiveDimensions(dimensions);\r\n\t\trectangleSelection =\r\n\t\t\tnew Rectangle2D.Double(dimensions[0], dimensions[1], dimensions[2],\r\n\t\t\t\tdimensions[3]);\r\n\r\n\t}",
"@Override\n public void mouseReleased(MouseEvent e) {\n\n // 2D mode\n if (getChart().getView().is2D()) {\n View view = getChart().getView();\n applyMouse2DSelection(view);\n }\n }",
"public void updateSelection() {\n\t\t\n\t}",
"public void Draw(Graphics2D g2d, Point mousePosition)\n {\n \n }",
"public void drawSelector(int x) {\n int currentTime = millis() / 100;\n noStroke();\n if (currentTime % 13 == 0) {\n fill(200, 200, 100, 30);\n }\n else if (currentTime % 13 == 1) {\n fill(200, 200, 100, 40);\n }\n else if (currentTime % 13 == 2) {\n fill(200, 200, 100, 50);\n }\n else if (currentTime % 13 == 3) {\n fill(200, 200, 100, 60);\n }\n else if (currentTime % 13 == 4) {\n fill(200, 200, 100, 70);\n }\n else if (currentTime % 13 == 5) {\n fill(200, 200, 100, 80);\n }\n else if (currentTime % 13 == 6) {\n fill(200, 200, 100, 90);\n }\n else if (currentTime % 13 == 7) {\n fill(200, 200, 100, 100);\n }\n else if (currentTime % 13 == 8) {\n fill(200, 200, 100, 110);\n }\n else if (currentTime % 13 == 9) {\n fill(200, 200, 100, 120);\n }\n else if (currentTime % 13 == 10) {\n fill(200, 200, 100, 130);\n }\n else if (currentTime % 13 == 11) {\n fill(200, 200, 100, 140);\n }\n else if (currentTime % 13 == 12) {\n fill(200, 200, 100, 150);\n }\n else {\n fill(255, 200, 100);\n }\n switch(x){\n case 1:\n beginShape();\n vertex(80, 330);\n vertex(50, 360);\n vertex(80, 350);\n vertex(110, 360);\n endShape();\n break;\n case 2:\n beginShape();\n vertex(370, 330);\n vertex(340, 360);\n vertex(370, 350);\n vertex(400, 360);\n endShape();\n break;\n case 3:\n beginShape();\n vertex(80, 600);\n vertex(50, 630);\n vertex(80, 620);\n vertex(110, 630);\n endShape();\n break;\n case 4:\n beginShape();\n vertex(370, 600);\n vertex(340, 630);\n vertex(370, 620);\n vertex(400, 630);\n endShape();\n break;\n }\n\n}",
"@Override\n\tpublic void draw(Graphics2D g) {\n\t\t\n\t}",
"public void drawSelection(int x, int y, int width, int height) {\n implementation.devDrawStrokeRectangle(x, y, width, height, Color.BLUE);\n }",
"public void paint( VisualGraphComponent component, Graphics2D g2d );",
"public GateCanvas(int type_param)\n {\n super();\n // setBackgroundColor( );\n type = type_param;\n inverted = false;\n // setSize(24, 24);\n setVisible(true);\n }",
"void selectionModeChanged(SelectionMode mode);",
"public void draw(Graphics2D g2)\n {\n Rectangle r1 = new Rectangle( xTopLeft, yTopLeft, screenWidth, screenHeight);\n \n Rectangle l1 = new Rectangle( xTopLeft + (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10));\n Rectangle l2 = new Rectangle( xTopLeft + 3 * (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10));\n Rectangle l3 = new Rectangle( xTopLeft + 5 * (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10));\n Rectangle l4 = new Rectangle( xTopLeft + 7 * (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10));\n Rectangle l5 = new Rectangle( xTopLeft + 9 * (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10));\n Rectangle l6 = new Rectangle( xTopLeft + 11 * (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10));\n Rectangle l7 = new Rectangle( xTopLeft + 13 * (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10));\n Rectangle l8 = new Rectangle( xTopLeft + 15 * (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10));\n Rectangle l9 = new Rectangle( xTopLeft + 17 * (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10));\n \n g2.setColor(Color.BLACK);\n \n g2.draw(r1);\n g2.fill(r1);\n \n g2.setColor(Color.YELLOW);\n \n g2.draw(l1);\n g2.fill(l1);\n g2.draw(l2);\n g2.fill(l2);\n g2.draw(l3);\n g2.fill(l3);\n g2.draw(l3);\n g2.fill(l3);\n g2.draw(l4);\n g2.fill(l4);\n g2.draw(l5);\n g2.fill(l5);\n g2.draw(l6);\n g2.fill(l6);\n g2.draw(l7);\n g2.fill(l7);\n g2.draw(l8);\n g2.fill(l8);\n g2.draw(l9);\n g2.fill(l9);\n }",
"public void modeColor(Graphics2D g2d) { g2d.setColor(RTColorManager.getColor(\"label\", \"default\")); }",
"public void paintComponent(Graphics g){\n\t\tGraphics2D g2d = (Graphics2D)g;\n\t\tRectangle r = g2d.getClipBounds();\n\t\tint startx = r.x;\n\t\tint starty = r.y;\n\t\tint endx = startx+r.width;\n\t\tint endy = starty+r.height;\n\t\tint cs = controller.getCurrentZoom();\n \n\t\tstartx = startx/cs;\n\t\tstarty = starty/cs;\n\t\tendx = endx/cs;\n\t\tendy = endy/cs;\n\t\t\n\t\tif(endx < karte.getWidth()){\n\t\t\tendx++;\n\t\t}\n \n\t\tif(endy < karte.getHeight()){\n\t\t\tendy++;\n\t\t}\n \n\t\tfor(int x = startx; x < endx; x++){\n\t\t\tfor(int y = starty; y < endy; y++){\n\t\t\t\tBufferedImage tile = controller.getZoomTileImage(karte.getTileType(x, y));\n\t\t\t\tg2d.drawImage(tile, x*cs, y*cs, this);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!selectionOn){\n\t\t\tg2d.drawImage(controller.getZoomCurrentTileImage(), (mouseX/cs)*cs, (mouseY/cs)*cs, this);\n\t\t}\n\t\t\n\t\tif ((selectionOn) && (smthSelected)){\n\t\t\tg2d.setColor(Color.black);\n\t\t\tg2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.1f));\n\t\t\tint n = controller.getCurrentZoom();\n\t\t\tg2d.fillRect(selX1*n, selY1*n, selX2*n-selX1*n, selY2*n-selY1*n);\n\t\t}\n\t}",
"protected void paint2D (Graphics2D g2) {\n\t AffineTransform tform = AffineTransform.getTranslateInstance( 0, 0);\n\t tform.scale(0.1, 0.1); \n\t //set the properties of g2\n\t g2.setTransform( tform);\n\t g2.setColor( Color.BLUE); \n\t }",
"public void paintComponent(Graphics2D g2)\r\n {\r\n g2.setColor(preferredColor());\r\n if (isPhasing)\r\n g2.draw(shape());\r\n else\r\n g2.fill(shape());\r\n }",
"public void draw(Graphics2D g2) {\n\t\tsuper.draw(g2);\n\t\tg2.setColor(Color.LIGHT_GRAY);\n\t\tif(this.getIsActive())\n\t\t\tg2.setColor(Color.BLUE);\n\t\tg2.fill(new Rectangle2D.Double(this.getX()+1,this.getY()+1,this.getDimension()-1,this.getDimension()/2 -1));\n\t\tg2.setColor(Color.BLACK);\n\t\tg2.setFont(new Font(\"SERIF\", Font.TRUETYPE_FONT, 13));\n\t\tg2.drawString(this.getLabel(), this.getX()+2, this.getY()+this.getDimension()/2 -2);\n\t}",
"public void paint(Graphics2D g) {\r\n\r\n\t\tDouble aPoint = new Double(w);\r\n\t\tDouble bPoint = new Double(h);\r\n\t\tg.setStroke(DASHED_STROKE);\r\n\t\tg.setPaint(FOREGROUND_COLOR);\r\n\r\n\t\tif (!(aPoint.equals(0) && bPoint.equals(0))) {\r\n\t\t\tg.draw(rectangleSelection);\r\n\t\t}\r\n\r\n\t}",
"@Override\r\n\tpublic void init(GLAutoDrawable gld) {\r\n\t\tGL2 gl = gld.getGL().getGL2();\r\n\t\tglu = new GLU();\r\n\r\n\t\tgl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);\r\n\t\tgl.glViewport(-200, -200, 200, 200);\r\n\t\tgl.glMatrixMode(GL2.GL_PROJECTION);\r\n\t\tgl.glLoadIdentity();\r\n\t\tglu.gluOrtho2D(-250.0, 250.0, -250.0, 250.0);\r\n\t}",
"public void draw(Graphics2D g2){\n g2.setColor(color);\n g2.fillOval(x,y, w, w);\n }",
"private void setupDrawing(){\n brushSize = 1;\n lastBrushSize = brushSize;\n drawPath = new Path();\n drawPaint = new Paint();\n drawPaint.setColor(paintColor);\n drawPaint.setAntiAlias(true);\n drawPaint.setStrokeWidth(brushSize);\n drawPaint.setStyle(Paint.Style.STROKE);\n drawPaint.setStrokeJoin(Paint.Join.ROUND);\n drawPaint.setStrokeCap(Paint.Cap.ROUND);\n canvasPaint = new Paint(Paint.DITHER_FLAG);\n }",
"@Override\n public void drawScreen(int n, int n2) {\n void mouseY;\n void mouseX;\n super.drawScreen((int)mouseX, (int)mouseY);\n float[] hsb = Color.RGBtoHSB(this.setting.getValue().getRed(), this.setting.getValue().getGreen(), this.setting.getValue().getBlue(), null);\n Color color = Color.getHSBColor(hsb[0], Float.intBitsToFloat(Float.floatToIntBits(6.4887953f) ^ 0x7F4FA436), Float.intBitsToFloat(Float.floatToIntBits(4.629535f) ^ 0x7F142527));\n Gui.drawRect((int)this.getX(), (int)this.getY(), (int)(this.getX() + this.getWidth()), (int)(this.getY() + 14), (int)new Color(40, 40, 40).getRGB());\n Gui.drawRect((int)(this.getX() + this.getWidth() - 12), (int)(this.getY() + 2), (int)(this.getX() + this.getWidth() - 2), (int)(this.getY() + 12), (int)this.setting.getValue().getRGB());\n RenderUtils.drawOutline(this.getX() + this.getWidth() - 12, this.getY() + 2, this.getX() + this.getWidth() - 2, this.getY() + 12, Float.intBitsToFloat(Float.floatToIntBits(2.7144578f) ^ 0x7F2DB9AD), new Color(20, 20, 20).getRGB());\n if (this.open) {\n Gui.drawRect((int)this.getX(), (int)(this.getY() + 14), (int)(this.getX() + this.getWidth()), (int)(this.getY() + 28), (int)new Color(40, 40, 40).getRGB());\n float i = Float.intBitsToFloat(Float.floatToIntBits(1.3378998E38f) ^ 0x7EC94E07);\n while (i + Float.intBitsToFloat(Float.floatToIntBits(13.8331995f) ^ 0x7EDD54C9) < Float.intBitsToFloat(Float.floatToIntBits(0.07128618f) ^ 0x7F51FE7D)) {\n RenderUtils.drawRecta((float)(this.getX() + 2) + i, this.getY() + 16, Float.intBitsToFloat(Float.floatToIntBits(7.249331f) ^ 0x7F67FA85), Float.intBitsToFloat(Float.floatToIntBits(1.7045807f) ^ 0x7EEA2FB3), Color.getHSBColor(i / Float.intBitsToFloat(Float.floatToIntBits(0.115068644f) ^ 0x7F2BA91C), Float.intBitsToFloat(Float.floatToIntBits(4.3161592f) ^ 0x7F0A1DFA), Float.intBitsToFloat(Float.floatToIntBits(21.075346f) ^ 0x7E289A4F)).getRGB());\n i += Float.intBitsToFloat(Float.floatToIntBits(3.807338f) ^ 0x7E95CD0B);\n }\n RenderUtils.drawOutline(this.getX() + 2, this.getY() + 16, this.getX() + 2 + this.getWidth() - 4, this.getY() + 27, Float.intBitsToFloat(Float.floatToIntBits(2.7503529f) ^ 0x7F3005C8), new Color(0, 0, 0).getRGB());\n RenderUtils.drawRecta((float)(this.getX() + 2) + this.hueWidth, this.getY() + 16, Float.intBitsToFloat(Float.floatToIntBits(5.200255f) ^ 0x7F26687D), Float.intBitsToFloat(Float.floatToIntBits(1.2665411f) ^ 0x7E921E05), new Color(255, 255, 255).getRGB());\n Gui.drawRect((int)this.getX(), (int)(this.getY() + 28), (int)(this.getX() + this.getWidth()), (int)(this.getY() + 42), (int)new Color(40, 40, 40).getRGB());\n RenderUtils.drawSidewaysGradient(this.getX() + 2, this.getY() + 29, this.getWidth() - 4, Float.intBitsToFloat(Float.floatToIntBits(0.19645536f) ^ 0x7F792B98), new Color(255, 255, 255), color, 255, 255);\n RenderUtils.drawOutline(this.getX() + 2, this.getY() + 29, this.getX() + 2 + this.getWidth() - 4, this.getY() + 40, Float.intBitsToFloat(Float.floatToIntBits(103.69628f) ^ 0x7DCF647F), new Color(0, 0, 0).getRGB());\n RenderUtils.drawRecta((float)(this.getX() + 2) + this.satWidth, this.getY() + 29, Float.intBitsToFloat(Float.floatToIntBits(7.3489017f) ^ 0x7F6B2A34), Float.intBitsToFloat(Float.floatToIntBits(0.1948352f) ^ 0x7F7782E1), new Color(255, 255, 255).getRGB());\n Gui.drawRect((int)this.getX(), (int)(this.getY() + 42), (int)(this.getX() + this.getWidth()), (int)(this.getY() + 56), (int)new Color(40, 40, 40).getRGB());\n RenderUtils.drawSidewaysGradient(this.getX() + 2, this.getY() + 42, this.getWidth() - 4, Float.intBitsToFloat(Float.floatToIntBits(1.5246161f) ^ 0x7EF3269F), new Color(0, 0, 0), color, 255, 255);\n RenderUtils.drawOutline(this.getX() + 2, this.getY() + 42, this.getX() + 2 + this.getWidth() - 4, this.getY() + 53, Float.intBitsToFloat(Float.floatToIntBits(3.7803736f) ^ 0x7F71F1A4), new Color(0, 0, 0).getRGB());\n RenderUtils.drawRecta((float)(this.getX() + 2) + this.briWidth, this.getY() + 42, Float.intBitsToFloat(Float.floatToIntBits(8.346171f) ^ 0x7E8589EB), Float.intBitsToFloat(Float.floatToIntBits(0.08925866f) ^ 0x7C86CD3F), new Color(255, 255, 255).getRGB());\n Gui.drawRect((int)this.getX(), (int)(this.getY() + 56), (int)(this.getX() + this.getWidth()), (int)(this.getY() + 70), (int)new Color(40, 40, 40).getRGB());\n this.renderAlphaBG(this.getX() + 2, this.getY() + 55, this.alphaBG);\n RenderUtils.drawSidewaysGradient(this.getX() + 2, this.getY() + 55, this.getWidth() - 4, Float.intBitsToFloat(Float.floatToIntBits(0.13166903f) ^ 0x7F36D43F), new Color(0, 0, 0), color, 0, 255);\n RenderUtils.drawOutline(this.getX() + 2, this.getY() + 55, this.getX() + 2 + this.getWidth() - 4, this.getY() + 66, Float.intBitsToFloat(Float.floatToIntBits(19.69502f) ^ 0x7E9D8F67), new Color(0, 0, 0).getRGB());\n RenderUtils.drawRecta((float)(this.getX() + 2) + this.alphaWidth, this.getY() + 55, Float.intBitsToFloat(Float.floatToIntBits(6.702013f) ^ 0x7F5676E4), Float.intBitsToFloat(Float.floatToIntBits(0.13652846f) ^ 0x7F3BCE1E), new Color(255, 255, 255).getRGB());\n Gui.drawRect((int)this.getX(), (int)(this.getY() + 70), (int)(this.getX() + this.getWidth()), (int)(this.getY() + 84), (int)new Color(40, 40, 40).getRGB());\n Europa.FONT_MANAGER.drawString(\"Rainbow\", this.getX() + 3, (float)(this.getY() + 78) - Europa.FONT_MANAGER.getHeight() / Float.intBitsToFloat(Float.floatToIntBits(0.8730777f) ^ 0x7F5F8205), Color.WHITE);\n Gui.drawRect((int)(this.getX() + this.getWidth() - 12), (int)(this.getY() + 72), (int)(this.getX() + this.getWidth() - 2), (int)(this.getY() + 82), (int)new Color(30, 30, 30).getRGB());\n if (this.setting.getRainbow().booleanValue()) {\n RenderUtils.prepareGL();\n GL11.glShadeModel((int)7425);\n GL11.glEnable((int)2848);\n GL11.glLineWidth((float)Float.intBitsToFloat(Float.floatToIntBits(0.2713932f) ^ 0x7EAAF40D));\n GL11.glBegin((int)1);\n GL11.glColor3f((float)((float)ModuleColor.getActualColor().getRed() / Float.intBitsToFloat(Float.floatToIntBits(0.015137452f) ^ 0x7F070313)), (float)((float)ModuleColor.getActualColor().getGreen() / Float.intBitsToFloat(Float.floatToIntBits(1.1948546f) ^ 0x7CE7F0FF)), (float)((float)ModuleColor.getActualColor().getBlue() / Float.intBitsToFloat(Float.floatToIntBits(0.36357376f) ^ 0x7DC52657)));\n GL11.glVertex2d((double)(this.getX() + this.getWidth() - 8), (double)(this.getY() + 80));\n GL11.glColor3f((float)((float)ModuleColor.getActualColor().getRed() / Float.intBitsToFloat(Float.floatToIntBits(0.015521388f) ^ 0x7F014D6B)), (float)((float)ModuleColor.getActualColor().getGreen() / Float.intBitsToFloat(Float.floatToIntBits(0.01025841f) ^ 0x7F5712E4)), (float)((float)ModuleColor.getActualColor().getBlue() / Float.intBitsToFloat(Float.floatToIntBits(0.10675689f) ^ 0x7EA5A35B)));\n GL11.glVertex2d((double)(this.getX() + this.getWidth() - 8 + 4), (double)(this.getY() + 74));\n GL11.glEnd();\n GL11.glBegin((int)1);\n GL11.glColor3f((float)((float)ModuleColor.getActualColor().getRed() / Float.intBitsToFloat(Float.floatToIntBits(0.009417259f) ^ 0x7F654AD9)), (float)((float)ModuleColor.getActualColor().getGreen() / Float.intBitsToFloat(Float.floatToIntBits(0.07014828f) ^ 0x7EF0A9E7)), (float)((float)ModuleColor.getActualColor().getBlue() / Float.intBitsToFloat(Float.floatToIntBits(0.013465701f) ^ 0x7F239F3E)));\n GL11.glVertex2d((double)(this.getX() + this.getWidth() - 8), (double)(this.getY() + 80));\n GL11.glColor3f((float)((float)ModuleColor.getActualColor().getRed() / Float.intBitsToFloat(Float.floatToIntBits(0.0155056f) ^ 0x7F010B33)), (float)((float)ModuleColor.getActualColor().getGreen() / Float.intBitsToFloat(Float.floatToIntBits(0.011914493f) ^ 0x7F3C3501)), (float)((float)ModuleColor.getActualColor().getBlue() / Float.intBitsToFloat(Float.floatToIntBits(0.012230922f) ^ 0x7F376434)));\n GL11.glVertex2d((double)(this.getX() + this.getWidth() - 10), (double)(this.getY() + 77));\n GL11.glEnd();\n RenderUtils.releaseGL();\n }\n }\n Gui.drawRect((int)(this.getX() - 1), (int)this.getY(), (int)this.getX(), (int)(this.getY() + 84), (int)new Color(30, 30, 30).getRGB());\n Gui.drawRect((int)(this.getX() + this.getWidth()), (int)this.getY(), (int)(this.getX() + this.getWidth() + 1), (int)(this.getY() + 84), (int)new Color(30, 30, 30).getRGB());\n Europa.FONT_MANAGER.drawString(this.setting.getName(), this.getX() + 3, this.getY() + 3, Color.WHITE);\n }",
"@Override\n public void init(GLAutoDrawable gld) {\n GL2 gl = gld.getGL().getGL2();\n glu = new GLU();\n\n gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);\n gl.glViewport(-500, -500, 500, 500);\n gl.glMatrixMode(GL2.GL_PROJECTION);\n gl.glLoadIdentity();\n glu.gluOrtho2D(-500, 500, -500, 500);\n }",
"@Override\n\tvoid draw(Graphics2D g2) {\n\t\t// TODO Auto-generated method stub\n\t\tg2.setColor(color);\n\t\tPoint2D.Double from = new Point2D.Double(this.getXPos(), this.getYPos());\n\t\tPoint2D.Double to = new Point2D.Double(x2, y2);\n\t\tsegment = new Line2D.Double(from, to);\n\t\tg2.drawLine((int) this.getXPos() - 8, (int) this.getYPos() - 96, (int) x2 - 8, (int) y2 - 96);\n\n\t}",
"public void setGraphics(Graphics2D graphics) {\r\n\t\tthis.graphics = graphics;\r\n\t}",
"@Override\n public void onPaint(Graphics2D g) {\n\n }",
"private void init() {\n mSelectedColor = new Paint(Paint.ANTI_ALIAS_FLAG);\n mSelectedColor.setColor(getResources().getColor(R.color.colorPrimary));\n mSelectedColor.setStyle(Paint.Style.FILL);\n\n mUnselectedColor = new Paint(Paint.ANTI_ALIAS_FLAG);\n mUnselectedColor.setColor(getResources().getColor(R.color.textColorSecondaryInverse));\n\n mSelectedColor.setStyle(Paint.Style.FILL);\n mPosition = new RectF();\n\n mTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG);\n mTextPaint.setColor(getResources().getColor(R.color.textColorSecondary));\n mTextPaint.setTextSize(48);\n }",
"@Override\n public void paintComponent(Graphics g) {\n super.paintComponent(g);\n\n Graphics2D g2 = (Graphics2D) g;\n g2.scale(2, 2);\n g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n g2.setColor(Color.WHITE);\n\n Application.grid.draw(g2);\n ui.draw(g2);\n }",
"@Override\n public void disableDraw() {\n drawingTools.disableDraw();\n }",
"private void draw() {\n gsm.draw(g);\n }",
"public void selectionChanged(GraphSelectionEvent gse) {\n if (!updatingSelection) {\n updatingSelection = true;\n List<Fig> selections = gse.getSelections();\n ActionCut.getInstance().setEnabled(\n selections != null && !selections.isEmpty());\n\n // TODO: If ActionCopy is no longer a singleton, how shall\n // this work?\n ActionCopy.getInstance()\n .setEnabled(selections != null && !selections.isEmpty());\n /*\n * ActionPaste.getInstance().setEnabled( Globals.clipBoard\n * != null && !Globals.clipBoard.isEmpty());\n */\n // the old selection\n Collection currentSelection =\n TargetManager.getInstance().getTargets();\n\n List removedTargets = new ArrayList(currentSelection);\n List addedTargets = new ArrayList();\n for (Object selection : selections) {\n Object owner = TargetManager.getInstance().getOwner(selection);\n if (currentSelection.contains(owner)) {\n removedTargets.remove(owner); // remains selected\n } else {\n // add to selection\n addedTargets.add(owner);\n }\n }\n if (addedTargets.size() == 1\n && removedTargets.size() == currentSelection.size()) {\n // Optimize for the normal case to minimize target changes\n TargetManager.getInstance().setTarget(addedTargets.get(0));\n } else {\n for (Object o : removedTargets) {\n TargetManager.getInstance().removeTarget(o);\n }\n for (Object o : addedTargets) {\n TargetManager.getInstance().addTarget(o);\n }\n }\n updatingSelection = false;\n }\n\n }",
"public void update()\n\t{\n\t\tGViewMapManager gViewMapManager = this.guiController.getCurrentStyleMapManager();\n\t\tLayout layout = gViewMapManager.getLayout();\n\n\t\tswitch (layout)\n\t\t{\n\t\t\tcase LINEAR:\n\t\t\t\tthis.linear.setSelected(true);\n\t\t\t\tbreak;\n\t\t\tcase CIRCULAR:\n\t\t\t\tthis.circular.setSelected(true);\n\t\t\t\tbreak;\n default:\n break;\n\t\t}\n\t}",
"public void paintComponent(Graphics g) {\n // Setup\n Graphics2D g2d = (Graphics2D) g; int txt_h = Utils.txtH(g2d, \"0\");\n g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n\n // Paint the super\n super.paintComponent(g2d); \n\n // Get the render context and draw if it's valid\n RenderContext myrc = (RenderContext) rc;\n if (myrc != null) {\n // Draw the interactions\n drawInteractions(g2d, myrc);\n\n // Draw the edge lens\n if (mode() == UI_MODE.EDGELENS) drawEdgeLens(g2d, myrc);\n else if (mode() == UI_MODE.TIMELINE) drawTimeLine(g2d, myrc);\n\n // Draw the selection\n Set<String> sel = getRTParent().getSelectedEntities(); if (sel == null) sel = new HashSet<String>();\n if (sel.size() > 0 || sticky_labels.size() > 0) { drawSelectedEntities(g2d, myrc, sel, sticky_labels, txt_h);\n } else { String str = \"\" + mode(); modeColor(g2d); g2d.drawString(\"\" + str, 5, txt_h); }\n\n // Draw the dynamic labels -- under the mouse for context\n String dyn_labeler_copy = dyn_labeler;\n if (dyn_label_cbmi.isSelected() && \n dyn_labeler_copy != null && \n myrc.node_coord_set.containsKey(dyn_labeler_copy)) drawDynamicLabels(g2d, myrc, dyn_labeler_copy);\n\n // If graph info mode, provide additional information\n if (myrc.provideGraphInfo()) { drawGraphInfo(g2d, myrc, sel); }\n\n // Draw the vertex placement heatmap (experimental)\n if (vertex_placement_heatmap_cbmi.isSelected()) {\n\t// Make sure it's a single selection (and that it's also a vertex);\n if (sel != null && sel.size() == 1) {\n\t String sel_str = sel.iterator().next(); if (entity_to_wxy.containsKey(sel_str)) {\n\t int hm_w = myrc.getRCWidth()/4, hm_h = myrc.getRCHeight()/4;\n\t // Determine if the heatmap will be large enough to provide value\n\t if (hm_w >= 50 && hm_h >= 50) {\n\t // Determine if the heatmap needs to be recalculated (doesn't consider if the size is still correct... or if the node shifted...\n\t if (hm_sel == null || hm_sel.equals(sel_str) == false || hm_bi == null) {\n\t hm_bi = GraphUtils.vertexPlacementHeatmap(new UniGraph(graph), sel_str, entity_to_wxy, hm_w, hm_h);\n\t\thm_sel = sel_str;\n }\n Composite orig_comp = g2d.getComposite(); g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.7f)); // Partially transparent\n\t g2d.drawImage(hm_bi, myrc.getRCWidth() - hm_bi.getWidth(null), myrc.getRCHeight() - hm_bi.getHeight(null), null);\n\t g2d.setComposite(orig_comp);\n\t }\n\t }\n\t}\n }\n\n // Draw the highlighted entities\n highlightEntities(g2d, myrc);\n\n // Draw the excerpts\n drawExcerpts(g2d, myrc);\n }\n\n // Draw the help chart\n if (draw_help) drawHelp(g2d);\n }",
"public void paintComponent(Graphics g, int xBeginMap, int yBeginMap, int xEndMap, int yEndMap,\n int xBeginSrc, int yBeginSrc, int xEndSrc, int yEndSrc)\n {\n if(isSelected==true) {\n g.setColor(new Color(0,255,0,125));\n Graphics2D g2d = (Graphics2D)g;\n Ellipse2D.Double circle = new Ellipse2D.Double(xBeginMap+15,yBeginMap+35, abs(xEndMap - xBeginMap)-30, abs(yEndMap - yBeginMap)-30);\n g2d.fill(circle);\n }\n g.drawImage(mainTexture,xBeginMap,yBeginMap,xEndMap,yEndMap,\n xBeginSrc,yBeginSrc,xEndSrc,yEndSrc,null);\n\n\n\n }",
"public JVDraw() {\r\n\t\tsetDefaultCloseOperation(DISPOSE_ON_CLOSE);\r\n\t\tsetLocation(250, 250);\r\n\t\tsetSize(500, 500);\r\n\t\tsetTitle(\"JVDraw\");\r\n\r\n\t\tsetLayout(new BorderLayout());\r\n\r\n\t\tJPanel toolbar = new JPanel(new FlowLayout(FlowLayout.LEFT));\r\n\r\n\t\tJColorArea jca = new JColorArea(Color.BLACK);\r\n\t\tJColorArea jca2 = new JColorArea(Color.WHITE);\r\n\r\n\t\ttoolbar.add(jca);\r\n\t\ttoolbar.add(jca2);\r\n\t\tShapeButtons sbg = new ShapeButtons(Shape.LINE);\r\n\t\ttoolbar.add(sbg);\r\n\t\tadd(toolbar, BorderLayout.NORTH);\r\n\r\n\t\tdrawingModel = new DrawingModelImpl();\r\n\t\tdrawingCanvas = new JDrawingCanvas(drawingModel);\r\n\r\n\t\tadd(drawingCanvas, BorderLayout.CENTER);\r\n\r\n\t\tdrawingModel.addDrawingModelListener(drawingCanvas);\r\n\t\tmouseCreator = new MouseCreator(drawingModel, jca, jca2, sbg);\r\n\t\tdrawingCanvas.addMouseListener(mouseCreator);\r\n\t\tdrawingCanvas.addMouseMotionListener(mouseCreator);\r\n\r\n\t\tlistModel = new DrawingObjectListModel(drawingModel);\r\n\t\tdrawingModel.addDrawingModelListener(listModel);\r\n\r\n\t\tadd(new DrawingObjectList(listModel), BorderLayout.EAST);\r\n\r\n\t\tJMenuBar menuBar = new JMenuBar();\r\n\t\tsetJMenuBar(menuBar);\r\n\t\tJMenu fileMenu = new JMenu(\"File\");\r\n\t\tmenuBar.add(fileMenu);\r\n\t\tfileMenu.add(new OpenAction(this));\r\n\t\tfileMenu.add(new SaveAction(this));\r\n\t\tfileMenu.add(new SaveAsAction(this));\r\n\t\tfileMenu.add(new ExportAction(this));\r\n\t\tfileMenu.add(new ExitAction(this));\r\n\r\n\t\tdrawingModel.addDrawingModelListener(new DrawingModelListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void objectsRemoved(DrawingModel source, int index0, int index1) {\r\n\t\t\t\tmodified = true;\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void objectsChanged(DrawingModel source, int index0, int index1) {\r\n\t\t\t\tmodified = true;\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void objectsAdded(DrawingModel source, int index0, int index1) {\r\n\t\t\t\tmodified = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tadd(new StatusBar(jca, jca2), BorderLayout.SOUTH);\r\n\t}",
"private void drawSelectedToolArea (IEditableByTool imageModel, Point<Integer> endPoint, int maxWidth, int maxHeight){\n List<Pixel> arrayList = new ArrayList<>();\n\n int minX = Math.max((startPoint.getX() < endPoint.getX()) ? startPoint.getX() : endPoint.getX(),0);\n int maxX = Math.min((startPoint.getX() > endPoint.getX()) ? startPoint.getX() : endPoint.getX(),maxWidth - 1);\n int minY = Math.max((startPoint.getY() < endPoint.getY()) ? startPoint.getY() : endPoint.getY(),0);\n int maxY = Math.min((startPoint.getY() > endPoint.getY()) ? startPoint.getY() : endPoint.getY(),maxHeight - 1);\n\n for(int i = minX; i <= maxX; i++){\n if (i % 5 == 0){\n arrayList.add(new Pixel(i, minY, paintColor));\n arrayList.add(new Pixel(i, maxY, paintColor));\n }\n\n }\n for(int j = minY + 1; j < maxY; j++){\n if (j % 5 == 0) {\n arrayList.add(new Pixel(minX, j, paintColor));\n arrayList.add(new Pixel(maxX, j, paintColor));\n }\n }\n\n imageModel.addToSelectOverlay(arrayList);\n\n }",
"public void draw(){\n\t\tif(selected){\n\t\t\timg.draw(xpos,ypos,scale,Color.blue);\n\t\t}else{\n\t\t\timg.draw(xpos, ypos, scale);\n\t\t}\n\t}",
"public void draw(Graphics g, int... paneOffsets) { }",
"static JPanel createConfigPanel(Viewer viewer,\r\n SelectionModel<Point2D> selectionModel,\r\n SelectionHandler<Point2D> lassoSelectionHandler,\r\n SelectionHandler<Point2D> rectangleSelectionHandler)\r\n {\r\n JPanel configPanel = new JPanel(new BorderLayout());\r\n \r\n JPanel controlPanel = new JPanel(new GridLayout(0,1));\r\n \r\n JCheckBox lassoCheckBox = \r\n new JCheckBox(\"Lasso\", true);\r\n lassoCheckBox.addActionListener(e -> \r\n {\r\n lassoSelectionHandler.disconnect();\r\n rectangleSelectionHandler.disconnect();\r\n if (lassoCheckBox.isSelected())\r\n {\r\n lassoSelectionHandler.connect(viewer, selectionModel);\r\n }\r\n else\r\n {\r\n rectangleSelectionHandler.connect(viewer, selectionModel);\r\n }\r\n });\r\n controlPanel.add(lassoCheckBox);\r\n \r\n JButton setDisplayedWorldAreaButton = \r\n new JButton(\"Reset displayed world area\");\r\n setDisplayedWorldAreaButton.addActionListener(\r\n e -> viewer.setDisplayedWorldArea(\r\n new Rectangle2D.Double(-0.1, -0.1, 1.2, 1.2)));\r\n controlPanel.add(setDisplayedWorldAreaButton);\r\n \r\n JButton resetTransformButton = \r\n new JButton(\"Reset transform\");\r\n resetTransformButton.addActionListener(\r\n e -> viewer.resetTransform());\r\n controlPanel.add(resetTransformButton);\r\n \r\n configPanel.add(controlPanel, BorderLayout.NORTH);\r\n \r\n return configPanel;\r\n }",
"private static void createAndShowGUI()\r\n {\r\n JFrame f = new JFrame(\"Viewer\");\r\n f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n f.getContentPane().setLayout(new BorderLayout());\r\n \r\n JLabel usageLabel = new JLabel(\"<html>\"\r\n + \"Right mouse drags: Translate<br> \"\r\n + \"Left mouse drags: Create selection shape<br>\"\r\n + \" +shift: remove from selection<br>\"\r\n + \" +ctrl: add to selection<br>\"\r\n + \"Left mouse clicks: Select single<br>\"\r\n + \" +ctrl: toggle single selection<br>\"\r\n + \"Mouse wheel: Zoom uniformly<br>\"\r\n + \" +shift: zoom along x<br>\"\r\n + \" +ctrl: zoom along y<br>\"\r\n + \"</html>\");\r\n f.getContentPane().add(usageLabel, BorderLayout.NORTH);\r\n \r\n // Create a viewer, with mouse controls where the rotation is\r\n // disabled (left clicks are intended for the selection here)\r\n Viewer viewer = new Viewer();\r\n viewer.setMouseControl(\r\n MouseControls.createDefault(viewer, false, true));\r\n \r\n // Create the selection model\r\n SelectionModel<Point2D> selectionModel = SelectionModels.create();\r\n selectionModel.addSelectionListener(\r\n new LoggingSelectionListener<Point2D>());\r\n\r\n // Create the painter for the test\r\n ViewerSelectionTestPainter viewerSelectionTestPainter = \r\n new ViewerSelectionTestPainter(selectionModel::isSelected);\r\n \r\n // The painter also serves as the point- and shape based selector.\r\n // Make this clear by assigning it to respective variables\r\n PointBasedSelector<Point2D> pointBasedSelector = \r\n viewerSelectionTestPainter;\r\n ShapeBasedSelector<Point2D> shapeBasedSelector = \r\n viewerSelectionTestPainter;\r\n\r\n // Create a selection handler for clicks, and use it to connect\r\n // the viewer and the selection model\r\n SelectionHandler<Point2D> clickSelectionHandler = \r\n SelectionHandlers.createClick(pointBasedSelector);\r\n clickSelectionHandler.connect(viewer, selectionModel);\r\n \r\n // Create a selection handler for a lasso selection, and use it to \r\n // connect the viewer and the selection model\r\n SelectionHandler<Point2D> lassoSelectionHandler = \r\n SelectionHandlers.createLasso(shapeBasedSelector);\r\n lassoSelectionHandler.connect(viewer, selectionModel);\r\n\r\n // Create a selection handler for rectangles, which can be enabled\r\n // via the config panel\r\n SelectionHandler<Point2D> rectangleSelectionHandler = \r\n SelectionHandlers.createRectangle(shapeBasedSelector);\r\n \r\n viewer.addPainter(\r\n viewerSelectionTestPainter);\r\n f.getContentPane().add(viewer, BorderLayout.CENTER);\r\n\r\n JPanel configPanel = createConfigPanel(viewer, selectionModel, \r\n lassoSelectionHandler, rectangleSelectionHandler);\r\n f.getContentPane().add(configPanel, BorderLayout.EAST);\r\n\r\n JLabel infoLabel = new JLabel(\" \");\r\n f.getContentPane().add(infoLabel, BorderLayout.SOUTH);\r\n \r\n viewer.setPreferredSize(new Dimension(500,500));\r\n f.pack();\r\n viewer.setPreferredSize(null);\r\n f.setLocationRelativeTo(null);\r\n f.setVisible(true);\r\n \r\n viewer.setDisplayedWorldArea(-0.1, -0.1, 1.2, 1.2);\r\n }",
"private void drawSelectedEntities(Graphics2D g2d, RenderContext myrc, Set<String> sel, Set<String> sticks, int txt_h) {\n\tStroke orig_stroke = g2d.getStroke(); g2d.setStroke(new BasicStroke(3.0f));\n\n\t// Draw the selected entities - outline the shape with red and draw labels if appropriate\n\tIterator<String> it = sel.iterator();\n\twhile (it.hasNext()) { \n\t String node = it.next(); String node_coord = entity_to_sxy.get(node);\n\t Shape shape = myrc.node_to_geom.get(node_coord);\n\t if (shape != null) {\n\t g2d.setColor(RTColorManager.getColor(\"linknode\", \"movenodes\")); g2d.draw(shape);\n\t if (myrc.node_lm != null && sel.size() < 100 && sticks.contains(node) == false) { \n\t // Bound it by 100... otherwise, it's going to be unreasonable\n\t myrc.node_lm.draw(g2d, node_coord, (int) shape.getBounds().getCenterX(), (int) shape.getBounds().getMaxY(), true);\n }\n }\n\t}\n\n\t// Draw the sticky labels\n\tit = sticks.iterator();\n\twhile (it.hasNext()) {\n\t String node = it.next(); String node_coord = entity_to_sxy.get(node);\n\t Shape shape = myrc.node_to_geom.get(node_coord);\n\t if (shape != null && myrc.node_lm != null) {\n\t myrc.node_lm.draw(g2d, node_coord, (int) shape.getBounds().getCenterX(), (int) shape.getBounds().getMaxY(), true);\n }\n\t}\n\tg2d.setStroke(orig_stroke);\n\n\t// Provide information on what's selected\n g2d.setColor(RTColorManager.getColor(\"label\", \"default\"));\n g2d.drawString(\"\" + sel.size() + \" Selected\", 5, txt_h);\n\n\tint x_off = Utils.txtW(g2d, \"\" + sel.size() + \" Selected\");\n\n // Print the mode string... doesn't really belong here...\n String str = \"| \" + mode();\n\tmodeColor(g2d);\n g2d.drawString(\"\" + str, 10 + x_off, txt_h);\n }",
"@Override\n\tpublic void Draw(Graphics2D g, double zoomFactor, boolean isDeleted, boolean isSelected) {\n\t\tColor prev = g.getColor();\n\n\t\tif (!isSelected) {\n\t\t\tg.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), 100));\n\t\t}\n\n\t\tif (isSelected) {\n\t\t\tg.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), 200));\n\t\t}\n\n\t\t// Draw the ellipsoid\n\t\tif (area != null) {\n\t\t\tg.fill(area);\n\t\t}\n\n\t\t// Draw the handles\n\t\tsuper.Draw(g, zoomFactor, isDeleted, isSelected);\n\n\t\tg.setColor(prev);\n\t}",
"@Override\n\tpublic void Draw(Graphics2D g, double zoomFactor, boolean isDeleted, boolean isSelected) {\n\t\tColor prev = g.getColor();\n\n\t\tif (!isSelected) {\n\t\t\tg.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), 100));\n\t\t}\n\n\t\tif (isSelected) {\n\t\t\tg.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), 200));\n\t\t}\n\n\t\t// Draw the ellipsoid\n\t\tif (area != null) {\n\t\t\tg.fill(area);\n\t\t}\n\n\t\t// Draw the handles\n\t\tsuper.Draw(g, zoomFactor, isDeleted, isSelected);\n\n\t\tg.setColor(prev);\n\t}",
"public void setGdi(boolean value);",
"public void graphicalSettings(int ps, int tw, int th) {\n\n setZoom(ps);\n T_WIDTH = tw;\n T_HEIGHT = th;\n\n SCREEN_WIDTH = T_WIDTH * P_SCALE + EMBOSS;\n SCREEN_HEIGHT = T_HEIGHT * P_SCALE + EMBOSS;\n }",
"public abstract void draw( Graphics2D gtx );",
"public void setSelectionSettings(MouseSelectionSettings selectionSettings) {\n this.selectionSettings = selectionSettings;\n }",
"public void updateColorsFromSelection() {\n featureDiagramView.reAssignColors(aspectContainer.getSelected());\n }",
"@Override\n\tpublic void draw(Graphics2D g, int x, int y,int width,int height) {\n\n\t}",
"public void setSelection(int x, int y) {\n this.selectionX = x;\n this.selectionY = y;\n\n selectionChanged = true;\n }",
"public void makeSwitcherBall(TPaintDropListItem paintSelectedItem);",
"void draw (Graphics2D g);",
"private void repaint() {\n\t\tclear();\n\t\tfor (PR1Model.Shape c : m.drawDataProperty()) {\n\t\t\tif(!c.getText().equals(defaultshape))\n\t\t\t\tdrawShape(c, false);\n\t\t}\n\t\tif (getSelection() != null) {\n\t\t\tdrawShape(getSelection(), true);\n\t\t}\n\t}",
"@Override\n protected final void setGraphics() {\n super.setGraphics();\n Graphics g = toDraw.getGraphics();\n g.setColor(Color.BLACK); \n \n for (int i = 0; i < choices.size(); i++) { \n g.drawString(choices.get(i).getValue(), wGap, (i + 1) * hItemBox);\n }\n }",
"public void draw(Graphics2D g2)\n {\n // put your code here\n Ellipse2D.Double top= new Ellipse2D.Double(xleft, ybottom, 25,50);\n Ellipse2D.Double bottom= new Ellipse2D.Double(xleft, ybottom+100, 25, 50);\n Rectangle2D.Double middle= new Rectangle2D.Double(xleft, ybottom+12.5, 25, 100);\n \n g2.setColor(Color.black);\n g2.draw(middle);\n g2.draw(top);\n g2.draw(bottom);\n g2.setColor(Color.white);\n g2.fill(top);\n g2.fill(middle);\n g2.fill(bottom);\n \n }",
"@Override\n public void paintComponent(Graphics g) {\n super.paintComponent(g);\n\n Graphics2D g2d = (Graphics2D) g;\n drawAxis(g2d);\n \n drawCurve(g2d);\n \n drawPoints(g2d);\n \n // drawObject(g2d); **\n // El panel, por defecto no es \"focusable\". \n // Hay que incluir estas líneas para que el panel pueda\n // agregarse como KeyListsener.\n this.setFocusable(true);\n this.requestFocusInWindow();\n }",
"public void draw(Graphics2D g, Dimension area);",
"public AxisRenderer2D( final AxisConfig<Q> conf )\r\n\t{\r\n\t\tthis.config = conf;\r\n\t}",
"public void setPaint(Paint paint)\n {\n g2.setPaint(paint);\n }"
] | [
"0.65757394",
"0.6443978",
"0.634887",
"0.6230565",
"0.61977357",
"0.6165017",
"0.6046528",
"0.60027605",
"0.59764326",
"0.58872414",
"0.58502877",
"0.58222157",
"0.58068675",
"0.57884836",
"0.5763446",
"0.57528543",
"0.57518613",
"0.573725",
"0.5733771",
"0.5694192",
"0.56852984",
"0.5680248",
"0.56250316",
"0.5593397",
"0.55688214",
"0.5559403",
"0.5533885",
"0.55272627",
"0.55263484",
"0.55254906",
"0.5525413",
"0.5519719",
"0.5472043",
"0.5453588",
"0.54215384",
"0.54089224",
"0.53957295",
"0.53957295",
"0.5394865",
"0.5376226",
"0.5376022",
"0.5371864",
"0.5357829",
"0.53528386",
"0.5330505",
"0.53281856",
"0.5321711",
"0.5317448",
"0.5316152",
"0.53147703",
"0.53120697",
"0.52874744",
"0.5286583",
"0.52788216",
"0.527689",
"0.5276147",
"0.5272782",
"0.5269324",
"0.5266168",
"0.5258591",
"0.5252594",
"0.5252106",
"0.5251873",
"0.5239593",
"0.52365893",
"0.52352333",
"0.52350926",
"0.52290004",
"0.52224576",
"0.5220089",
"0.521768",
"0.52172685",
"0.52126753",
"0.5210661",
"0.5205833",
"0.5202715",
"0.5192878",
"0.51922506",
"0.51858795",
"0.5185858",
"0.51787686",
"0.5169548",
"0.51676583",
"0.51627827",
"0.51627827",
"0.5152781",
"0.5131874",
"0.51263154",
"0.51198983",
"0.5114095",
"0.5114063",
"0.5095757",
"0.50943935",
"0.5092031",
"0.50883794",
"0.50869745",
"0.5086062",
"0.50832224",
"0.5082232",
"0.50817096",
"0.5078609"
] | 0.0 | -1 |
Inflate the menu; this adds items to the action bar if it is present. | @Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.actions, menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tgetMenuInflater().inflate(R.menu.actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.actions_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main_actions, menu);\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n\t\tinflater.inflate(R.menu.action_bar_menu, menu);\r\n\t\tmMenu = menu;\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.act_bar_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_actions, menu);\r\n\t\treturn true;\r\n //return super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\r\n\t inflater.inflate(R.menu.action_bar_all, menu);\r\n\t return super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\t super.onCreateOptionsMenu(menu);\n\t\tMenuInflater muu= getMenuInflater();\n\t\tmuu.inflate(R.menu.cool_menu, menu);\n\t\treturn true;\n\t\t\n\t\t\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.adventure_archive, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.archive_menu, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n \tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n \t\tinflater.inflate(R.menu.main, menu);\n \t\tsuper.onCreateOptionsMenu(menu, inflater);\n \t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.action_menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater bow=getMenuInflater();\n\t\tbow.inflate(R.menu.menu, menu);\n\t\treturn true;\n\t\t}",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.action_menu, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\t\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\t\t\n\t\t/* Inflate the menu; this adds items to the action bar if it is present */\n\t\tgetMenuInflater().inflate(R.menu.act_main, menu);\t\t\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflate = getMenuInflater();\n inflate.inflate(R.menu.menu, ApplicationData.amvMenu.getMenu());\n return true;\n }",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.menu, menu);\n\t\t\treturn true; \n\t\t\t\t\t\n\t\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.main, menu);\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) \n {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_bar, menu);\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_item, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.menu, menu);\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t \n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\t//menu.clear();\n\t\tinflater.inflate(R.menu.soon_to_be, menu);\n\t\t//getActivity().getActionBar().show();\n\t\t//getActivity().getActionBar().setBackgroundDrawable(\n\t\t\t\t//new ColorDrawable(Color.rgb(223, 160, 23)));\n\t\t//return true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n this.getMenuInflater().inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.main, menu);\n }",
"@Override\n\tpublic void onCreateOptionsMenu( Menu menu, MenuInflater inflater )\n\t{\n\t\tsuper.onCreateOptionsMenu( menu, inflater );\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n \t// We must call through to the base implementation.\r\n \tsuper.onCreateOptionsMenu(menu);\r\n \t\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_menu, menu);\r\n\r\n return true;\r\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.inter_main, menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu (Menu menu){\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.custom_action_bar, menu);\n\t\treturn true;\n\t}",
"public void initMenubar() {\n\t\tremoveAll();\n\n\t\t// \"File\"\n\t\tfileMenu = new FileMenuD(app);\n\t\tadd(fileMenu);\n\n\t\t// \"Edit\"\n\t\teditMenu = new EditMenuD(app);\n\t\tadd(editMenu);\n\n\t\t// \"View\"\n\t\t// #3711 viewMenu = app.isApplet()? new ViewMenu(app, layout) : new\n\t\t// ViewMenuApplicationD(app, layout);\n\t\tviewMenu = new ViewMenuApplicationD(app, layout);\n\t\tadd(viewMenu);\n\n\t\t// \"Perspectives\"\n\t\t// if(!app.isApplet()) {\n\t\t// perspectivesMenu = new PerspectivesMenu(app, layout);\n\t\t// add(perspectivesMenu);\n\t\t// }\n\n\t\t// \"Options\"\n\t\toptionsMenu = new OptionsMenuD(app);\n\t\tadd(optionsMenu);\n\n\t\t// \"Tools\"\n\t\ttoolsMenu = new ToolsMenuD(app);\n\t\tadd(toolsMenu);\n\n\t\t// \"Window\"\n\t\twindowMenu = new WindowMenuD(app);\n\n\t\tadd(windowMenu);\n\n\t\t// \"Help\"\n\t\thelpMenu = new HelpMenuD(app);\n\t\tadd(helpMenu);\n\n\t\t// support for right-to-left languages\n\t\tapp.setComponentOrientation(this);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp=getMenuInflater();\n\t\tblowUp.inflate(R.menu.welcome_menu, menu);\n\t\treturn true;\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.listing, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.item, menu);\n return true;\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.resource, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu,menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.home_action_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.template, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n Log.d(\"onCreateOptionsMenu\", \"create menu\");\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.socket_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_menu, menu);//Menu Resource, Menu\n\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actionbar, menu);\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(toolbar_res, menu);\n updateMenuItemsVisibility(menu);\n return true;\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t// \n\t\tMenuInflater mi = getMenuInflater();\n\t\tmi.inflate(R.menu.thumb_actv_menu, menu);\n\t\t\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n }",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.swag_list_activity_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\n\t\treturn true;\n\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.jarvi, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n menuInflater.inflate(R.menu.main, menu);\n\n }",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.add__listing, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actmain, menu);\r\n return true;\r\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.buat_menu, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.layout.menu, menu);\n\t\treturn true;\n\t}",
"@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n\n\t\n\t\n\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\n\treturn super.onCreateOptionsMenu(menu);\n}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ichat, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater)\n\t{\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\tinflater.inflate(R.menu.expenses_menu, menu);\n\t}",
"@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}",
"@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}",
"@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.action_bar, menu);\n return true;\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp = getMenuInflater();\n\t\tblowUp.inflate(R.menu.status, menu);\n\t\treturn true;\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.menu, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn true;\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ui_main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_activity_actions, menu);\n return true;\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }"
] | [
"0.7246102",
"0.7201358",
"0.7194834",
"0.7176498",
"0.71066517",
"0.7039537",
"0.7037961",
"0.70112145",
"0.70094734",
"0.69807225",
"0.6944953",
"0.69389373",
"0.6933199",
"0.6916928",
"0.6916928",
"0.6891486",
"0.68831646",
"0.68754137",
"0.68745375",
"0.68621665",
"0.68621665",
"0.68621665",
"0.68621665",
"0.68515885",
"0.68467957",
"0.68194443",
"0.6817494",
"0.6813087",
"0.6813087",
"0.6812847",
"0.6805774",
"0.6801204",
"0.6797914",
"0.6791314",
"0.6789091",
"0.67883503",
"0.6783642",
"0.6759701",
"0.6757412",
"0.67478645",
"0.6744127",
"0.6744127",
"0.67411774",
"0.6740183",
"0.6726017",
"0.6723245",
"0.67226785",
"0.67226785",
"0.67208904",
"0.67113477",
"0.67079866",
"0.6704564",
"0.6699229",
"0.66989094",
"0.6696622",
"0.66952467",
"0.66865396",
"0.6683476",
"0.6683476",
"0.6682188",
"0.6681209",
"0.6678941",
"0.66772443",
"0.6667702",
"0.66673946",
"0.666246",
"0.6657578",
"0.6657578",
"0.6657578",
"0.6656586",
"0.66544783",
"0.66544783",
"0.66544783",
"0.66524047",
"0.6651954",
"0.6650132",
"0.66487855",
"0.6647077",
"0.66467404",
"0.6646615",
"0.66464466",
"0.66449624",
"0.6644209",
"0.6643461",
"0.6643005",
"0.66421187",
"0.6638628",
"0.6634786",
"0.6633529",
"0.6632049",
"0.6632049",
"0.6632049",
"0.66315657",
"0.6628954",
"0.66281766",
"0.6627182",
"0.6626297",
"0.6624309",
"0.6619582",
"0.6618876",
"0.6618876"
] | 0.0 | -1 |
Type your code here. | int main()
{
int a,b,count=0;
cin>>a>>b;
int arr1[a],arr2[b];
for(int i=0;i<a;i++)
{
cin>>arr1[i];
}
for(int i=0;i<b;i++)
{
cin>>arr2[i];
}
if(a==b)
{
for(int i=0;i<a;i++)
{
if(arr1[i]==arr2[i])
{
count++;
}
}
if(count==a)
{
cout<<"Same";
}
else
{
cout<<"Not Same";
}
}
else
{
cout<<"Not Same";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void generateCode()\n {\n \n }",
"@Override\r\n\tpublic void code() {\n\t\tus.code();\r\n\t\tSystem.out.println(\"我会java...\");\r\n\t}",
"CD withCode();",
"@Override\r\n\tpublic void code() {\n\t\tSystem.out.println(\"我会C语言....\");\r\n\t}",
"public void genCode(CodeFile code) {\n\t\t\n\t}",
"private void searchCode() {\n }",
"Code getCode();",
"public void generateCode() {\n new CodeGenerator(data).generateCode();\n }",
"public void code (String code) throws LuchthavenException\r\n\t{\r\n\t\tluchthaven.setCode(code);\r\n\t}",
"public abstract int code();",
"public void mo38117a() {\n }",
"public void Tyre() {\n\t\t\r\n\t}",
"@Override public boolean isCodeTask() { return true; }",
"String getCode();",
"String getCode();",
"String getCode();",
"String getCode();",
"String getCode();",
"public Code() {\n\t}",
"public void mo5382o() {\n }",
"public interface Code {\n //运行结果编号\n Integer getCode();\n //运行结果描述\n String getDescription();\n String toString();\n\n}",
"public abstract String getFullCode();",
"void setCode(String code);",
"abstract protected void pre(int code);",
"public void mo9848a() {\n }",
"public void gen(CodeSeq code, ICodeEnv env) {\n\r\n\t}",
"public static void main(String[] args) {\n\t// write your code here\n }",
"public void mo9241ay() {\n }",
"public void exec(PyObject code) {\n }",
"public static void main(String[] args) {\n\t\tBlockCode blockcode = new BlockCode();\n\t\t//blockcode.printName();\n\t\t\n\t\t}",
"java.lang.String getCode();",
"java.lang.String getCode();",
"public void generateCodeItemCode() {\n\t\tcodeItem.generateCodeItemCode();\n\t}",
"private void yy() {\n\n\t}",
"public void ganar() {\n // TODO implement here\n }",
"public void mo5248a() {\n }",
"public void mo3749d() {\n }",
"public void mo115188a() {\n }",
"public void mo21785J() {\n }",
"public static void main(String[] args) {\n\t\tSystem.out.print(\"This is added code\");\n\t\tSystem.out.print(\"This is added code from GitHub\");\n\n\t}",
"public interface CodeFormatter\n{\n}",
"@Override\n\tpublic void Coding() {\n\t\tBefore();\n\t\tcoder.Coding();\n\t\tEnd();\n\t}",
"public void mo97908d() {\n }",
"public void mo4359a() {\n }",
"@Override\n\tpublic void type() {\n\t\t\n\t}",
"public String getCode();",
"public String getCode();",
"public void mo12930a() {\n }",
"public void mo9233aH() {\n }",
"public void addToCode(String code){\r\n\t\tiCode+=getTabs()+code+\"\\n\";\r\n\t}",
"Programming(){\n\t}",
"@Override\n\tpublic void orgasm() {\n\t\t\n\t}",
"public void mo21795T() {\n }",
"public void createCode(){\n\t\tsc = animationScript.newSourceCode(new Coordinates(10, 60), \"sourceCode\",\r\n\t\t\t\t\t\t null, AnimProps.SC_PROPS);\r\n\t\t \r\n\t\t// Add the lines to the SourceCode object.\r\n\t\t// Line, name, indentation, display dealy\r\n\t\tsc.addCodeLine(\"1. Berechne für jede (aktive) Zeile und Spalte der Kostenmatrix\", null, 0, null); // 0\r\n\t\tsc.addCodeLine(\" die Differenz aus dem kleinsten (blau) und zweit-kleinsten (lila)\", null, 0, null);\r\n\t\tsc.addCodeLine(\" Element der entsprechenden Zeile/ Spalte.\", null, 0, null);\r\n\t\tsc.addCodeLine(\"2. Wähle die Zeile oder Spalte (grün) aus bei der sich die größte\", null, 0, null); \r\n\t\tsc.addCodeLine(\" Differenz (blau) ergab.\", null, 0, null);\r\n\t\tsc.addCodeLine(\"3. Das kleinste Element der entsprechenden Spalte\", null, 0, null); \r\n\t\tsc.addCodeLine(\" (bzw. Zeile) gibt nun die Stelle an, welche im\", null, 0, null);\r\n\t\tsc.addCodeLine(\" Transporttableau berechnet wird (blau).\", null, 0, null);\r\n\t\tsc.addCodeLine(\"4. Nun wird der kleinere Wert von Angebots- und\", null, 0, null); // 4\r\n\t\tsc.addCodeLine(\" Nachfragevektor im Tableau eingetragen.\", null, 0, null);\r\n\t\tsc.addCodeLine(\"5. Anschließend wird der eingetragene Wert von den Rändern\", null, 0, null); // 5\r\n\t\tsc.addCodeLine(\" abgezogen (mindestens einer muss 0 werden). \", null, 0, null);\r\n\t\tsc.addCodeLine(\"6. Ist nun der Wert im Nachfragevektor Null so markiere\", null, 0, null); // 6\r\n\t\tsc.addCodeLine(\" die entsprechende Spalte in der Kostenmatrix. Diese\", null, 0, null);\r\n\t\tsc.addCodeLine(\" wird nun nicht mehr beachtet (rot). Ist der Wert des\", null, 0, null);\r\n\t\tsc.addCodeLine(\" Angebotsvektors Null markiere die Zeile der Kostenmatrix.\", null, 0, null);\r\n\t\tsc.addCodeLine(\"7. Der Algorithmus wird beendet, falls lediglich eine Zeile oder\", null, 0, null); // 8\r\n\t\tsc.addCodeLine(\" Spalte der Kostenmatrix unmarkiert ist (eines reicht aus).\", null, 0, null);\r\n\t\tsc.addCodeLine(\"8 . Der entsprechenden Zeile bzw. Spalte im Transporttableau werden\", null, 0, null); // 9\t\t \r\n\t\tsc.addCodeLine(\" die restlichen Angebots- und Nachfragemengen zugeordnet.\", null, 0, null);\r\n\t\t\r\n\t}",
"public void mo21782G() {\n }",
"private List<String> runCode(JasminBytecode code) throws AssembleException {\n // Turn the Jasmin code into a (hopefully) working class file\n if (code == null) {\n throw new AssembleException(\"No valid Jasmin code to assemble\");\n }\n AssembledClass aClass = AssembledClass.assemble(code);\n // Run the class and return the output\n SandBox s = new SandBox();\n s.runClass(aClass);\n return s.getOutput();\n }",
"public void setCode(String code){\n\t\tthis.code = code;\n\t}",
"public void mo8738a() {\n }",
"public void mo44053a() {\n }",
"public void mo21791P() {\n }",
"public void mo6944a() {\n }",
"public void mo3376r() {\n }",
"public void generateCode() {\n\t\tthis.setCharacter();\n\t}",
"public void setCode(String code)\n {\n this.code = code;\n }",
"public void mo21789N() {\n }",
"int getCode();",
"int getCode();",
"int getCode();",
"public void mo5099c() {\n }",
"public void mo56167c() {\n }",
"public String CodeInterpreter() {\n\n\t\tString timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(Calendar.getInstance().getTime());\n\t\treturn \"DA\" + \"_\" + timeStamp;\n\t}",
"CodeType createCodeType();",
"public void mo55254a() {\n }",
"public static void main(String[] args) {\n // write your code here - this is called comment and it always starts with double slash\n // and comlier will ignore this because of the // sign.\n // I am gonna say hello\n // JAVA IS CASE SENSITIVE LANGUAGE\n // System and system are very different things in java\n //Hello AND hello are different for java\n // System.out.println(\"Hello Batch 15!\");\n // System.out.println(\"I am still here.\");\n // System.out.println(\"I love Java.\");\n\n // Write a program to display your information.\n // When you run it, it should have this outcome.\n // I am your name here\n // I am from batch 15\n // I am from your city here\n // I love Java\n\n System.out.println(\"I am Sevim.\");\n System.out.println(\"I am from Batch 15.\");\n System.out.println(\"I'm from New Jersey.\");\n System.out.println(\"I love Java.\");\n\n\n\n }",
"boolean hasCode();",
"boolean hasCode();",
"boolean hasCode();",
"@Deprecated\n\tprivate void oldCode()\n\t{\n\t}",
"CodeBlock createCodeBlock();",
"public static void main() {\n \n }",
"@Override\n\tpublic void compile(CodeBlock c, CompilerEnvironment environment) {\n\n\t}",
"public static void main(String[] args) {\n\t\tSystem.out.println(\"Hello\");\r\n\t\tSystem.out.println(\" code\");\r\n\t\tSystem.out.println(\" added one more line of code\");\r\n\t\t;\r\n\r\n\t}",
"public void mo5097b() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void setCode(String code) {\n this.code = code;\n }",
"public void setCode(String code) {\n this.code = code;\n }",
"public void setCode(String code) {\n this.code = code;\n }",
"public void setCode(String code) {\n this.code = code;\n }",
"public void setCode(String code) {\n this.code = code;\n }",
"public void setCode(String code) {\n this.code = code;\n }",
"public void mo2740a() {\n }",
"public void mo21794S() {\n }",
"public void mo21779D() {\n }",
"@Override\n protected void codeGenMain(DecacCompiler compiler, Registres regs, Pile p) {\n }",
"public Classification codeOf(Object code) {\n throw new IllegalStateException(\"Unknown definition: \" + this); // basically unreachable\n }"
] | [
"0.69843554",
"0.66579396",
"0.6505592",
"0.6464641",
"0.63891697",
"0.62784237",
"0.61395115",
"0.60109365",
"0.5983818",
"0.59798265",
"0.59757096",
"0.59655416",
"0.5955321",
"0.59450895",
"0.59450895",
"0.59450895",
"0.59450895",
"0.59450895",
"0.58090574",
"0.579967",
"0.57771176",
"0.5746926",
"0.5738802",
"0.5716367",
"0.5686658",
"0.56817436",
"0.56588095",
"0.56546193",
"0.56394374",
"0.56385773",
"0.56349754",
"0.56349754",
"0.5627875",
"0.56216484",
"0.5619869",
"0.5619029",
"0.56171507",
"0.5615799",
"0.56115174",
"0.55952626",
"0.55934435",
"0.5587657",
"0.5581622",
"0.55680203",
"0.55662847",
"0.55650973",
"0.55650973",
"0.5563053",
"0.55616146",
"0.5560832",
"0.5560176",
"0.5553142",
"0.55521077",
"0.5547846",
"0.55412984",
"0.553791",
"0.5536079",
"0.55326754",
"0.55315274",
"0.55283976",
"0.5525867",
"0.5523246",
"0.5522231",
"0.5521069",
"0.55129963",
"0.5511227",
"0.5511227",
"0.5511227",
"0.5508527",
"0.5499301",
"0.5497279",
"0.54889804",
"0.5487579",
"0.54825056",
"0.5478623",
"0.5478623",
"0.5478623",
"0.5476512",
"0.5472045",
"0.5471613",
"0.54665506",
"0.54617023",
"0.5452344",
"0.5450026",
"0.5450026",
"0.5450026",
"0.5450026",
"0.5450026",
"0.5450026",
"0.5450026",
"0.54470223",
"0.54470223",
"0.54470223",
"0.54470223",
"0.54470223",
"0.54470223",
"0.543584",
"0.5434638",
"0.54280734",
"0.5426099",
"0.5424342"
] | 0.0 | -1 |
Changes neighbour's links, leads to removing Node from List. | private void remove() {
if (prev != null) {
prev.next = next;
}
if (next != null) {
next.prev = prev;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void removeNeighbours(){\n\t\tgetNeighbours().removeAll(getNeighbours());\n\t}",
"public void remove() {\r\n\t\theadNode.link = headNode.link.link;\r\n\t\tsize--;\r\n\t}",
"void removeNeighbors();",
"void removeNeighbor(IsisNeighbor isisNeighbor);",
"public void cleanNodeListToEdges(CircosEdgeList edges){\n\t\tArrayList<CircosNode> tempnodes = new ArrayList<CircosNode>();\n\t\tHashMap<String,String> tempcolors = new HashMap<String,String>();\n\t\t\n\t\tfor(int i = 0; i < nodes.size(); i++){\n\t\t\tif(edges.containsNodeAsSourceOrTarget(nodes.get(i).getID())){\n\t\t\t\ttempnodes.add(nodes.get(i));\n\t\t\t\ttempcolors.put(nodes.get(i).getID(), colors.get(nodes.get(i).getID()));\n\t\t\t}\n\t\t}\n\t\t\t\n\t\tnodes = tempnodes;\n\t\tcolors = tempcolors;\n\t}",
"@Override\n public void updateNeighbours(String nodeGUID, Set<String> neighboursGUIDS) {\n List<String> existingNeighboursGUIDs = getAllNeighbours(nodeGUID);\n if (isDifferentGraphContext(neighboursGUIDS, existingNeighboursGUIDs)) {\n removeObsoleteEdges(nodeGUID, neighboursGUIDS, existingNeighboursGUIDs);\n }\n }",
"protected void _removeLinks() throws java.rmi.RemoteException, javax.ejb.RemoveException {\n\t\tjava.util.List links = _getLinks();\n\t\tfor (int i = 0; i < links.size(); i++) {\n\t\t\ttry {\n\t\t\t\t((com.ibm.ivj.ejb.associations.interfaces.Link) links.get(i)).remove();\n\t\t\t} catch (javax.ejb.FinderException e) {\n\t\t\t} //Consume Finder error since I am going away\n\t\t}\n\t}",
"public static void delete(Nodelink node){\n\n Nodelink temp = node.next;\n node = null;\n\n node = temp;\n\n }",
"private void deleteConnections() {\n for (int i = 0; !this.sourceConnections.isEmpty(); ) {\n LinkElement wire = (LinkElement) this.sourceConnections.get(i);\n wire.detachSource();\n wire.detachTarget();\n this.graphElement.removeEdge(wire.getEdgeId(), wire);\n }\n\n for (int i = 0; !this.targetConnections.isEmpty(); ) {\n LinkElement wire = (LinkElement) this.targetConnections.get(i);\n wire.detachSource();\n wire.detachTarget();\n this.graphElement.removeEdge(wire.getEdgeId(), wire);\n }\n }",
"public void remove() {\n this.getNext().setPrev(this.getPrev());\n this.getPrev().setNext(this.getNext());\n }",
"public void remove()\n {\n this.prev.next = this.next;\n this.next.prev = this.prev;\n this.next = null;\n this.prev = null;\n }",
"public void setNodesToUnvisited(){\n for(GraphNode node: graphNode){\n if(node.visited){\n node.visited = false;\n }\n }\n }",
"private void deleteNode(Node n) {\n n.next.pre = n.pre;\n n.pre.next = n.next;\n }",
"public void removeLink(int vertexA, int vertexB) {\n\t\ttry {\n\t\t\t// Remove link from A to B\n\t\t\tArrayList<Integer> neighbors = this.adjListMap.get(vertexA);\n\t\t\tneighbors.remove((Integer) vertexB);\n\t\t\tthis.adjListMap.put(vertexA, neighbors);\n\n\t\t\t// Remove a link from B to A\n\t\t\tneighbors = this.adjListMap.get(vertexB);\n\t\t\tneighbors.remove((Integer) vertexA);\n\t\t\tthis.adjListMap.put(vertexB, neighbors);\n\n\t\t\t// Update reachability matrix on every link removal\n\t\t\tbuildReachabilityMatrix(this.adjListMap);\n\t\t} catch (NullPointerException e) {\n\t\t\tSystem.out.println(\"Vertices are out of range. It should be < \" + this.maxNumVertices);\n\t\t}\n\n\t}",
"void updateLinks() {\n\t\tdouble x1, x2, y1, y2;\n\t\tfor(int i=0; i<links.size();i++){\n\t\t\tPNode node1 = links.get(i).getNode1();\n\t\t\tPNode node2 = links.get(i).getNode2();\n\t\t\tx1 = node1.getFullBoundsReference().getCenter2D().getX() + node1.getParent().getFullBounds().getOrigin().getX();\n\t\t\ty1 = node1.getFullBoundsReference().getCenter2D().getY() + node1.getParent().getFullBounds().getOrigin().getY();\n\t\t\tx2 = node2.getFullBoundsReference().getCenter2D().getX() + node2.getParent().getFullBounds().getOrigin().getX();\n\t\t\ty2 = node2.getFullBoundsReference().getCenter2D().getY() + node2.getParent().getFullBounds().getOrigin().getY();\n\t\t\t\n\t\t\t/*\n\t\t\tLine2D line = new Line2D.Double(x1,y1,x2,y2);\n\t\t\tlinks.get(i).getPPath().setPathTo(line);\n */\n\t\t\tsetPolyLine(links.get(i).getPPath(), (float)x1, (float)y1, (float)x2, (float)y2);\n\t\t\t}\n\t\t}",
"protected void _removeLinks() throws java.rmi.RemoteException, javax.ejb.RemoveException {\n\tjava.util.Enumeration links = _getLinks().elements();\n\twhile (links.hasMoreElements()) {\n\t\ttry {\n\t\t\t((com.ibm.ivj.ejb.associations.interfaces.Link) (links.nextElement())).remove();\n\t\t}\n\t\tcatch (javax.ejb.FinderException e) {} //Consume Finder error since I am going away\n\t}\n}",
"public void removeLink(int newID) {\n\t\tfor (int i = 0; i < routingTable.get(0).size(); i++) {\n\t\t\tif ((routingTable.get(0).get(i) == newID) || (routingTable.get(2).get(i) == newID)) {\n\t\t\t\troutingTable.get(1).set(i, -1);\n\t\t\t\troutingTable.get(2).set(i, -1);\n\t\t\t}\n\t\t}\n\t\tfor (Link l : links) {\n\t\t\tif (l.getDestination() == newID) {\n\t\t\t\tint idx = links.indexOf(l);\n\t\t\t\tSystem.out.println(links.get(idx).getDestination());\n\t\t\t\tlinks.remove(idx);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}",
"private void clearLinks() {\n links_ = emptyProtobufList();\n }",
"private void clearEdgeLinks() {\n edges.clear();\n //keep whole tree to maintain its position when it is expanded (within scroll pane bounds)\n Node rootNode = nodes.get(0);\n VBox rootVBox = (VBox) rootNode.getContainerPane().getParent();\n rootVBox.layout();\n Bounds rootNodeChildrenVBoxBounds = rootNode.getChildrenVBox().getBoundsInLocal();\n rootVBox.setLayoutY(Math.abs(rootVBox.getLayoutY() - ((rootNodeChildrenVBoxBounds.getHeight()) - rootNode.getHeight()) / 2 + rootNode.getLayoutY()));\n rootVBox.layout();\n\n for (int i = 0; i < nodes.size(); i++) {\n Pane containerPane = nodes.get(i).getContainerPane();\n //reposition node to the center of its children\n ObservableList<javafx.scene.Node> genericNodes = nodes.get(i).getChildrenVBox().getChildren();\n if (!genericNodes.isEmpty()) {\n nodes.get(i).setLayoutY(((nodes.get(i).getChildrenVBox().getBoundsInLocal().getHeight()) - rootNode.getHeight()) / 2);\n }\n\n for (int j = 0; j < containerPane.getChildren().size(); j++) {\n if (containerPane.getChildren().get(j) instanceof Edge) {\n containerPane.getChildren().remove(j);\n j--;\n }\n }\n }\n redrawEdges(rootNode);\n }",
"void removeNodes(List<CyNode> nodes);",
"private void cleanCollectedLinks() {\n for (Iterator itr = visitedLinks.iterator(); itr.hasNext(); ) {\n String thisURL = (String) itr.next();\n if (urlInLinkedList(NetworkUtils.makeURL(thisURL), collectedLinks)) {\n collectedLinks.remove(thisURL.toString());\n// Log.v(\"DLasync.cleanCollected\", \" from CollectedLinks, just cleaned: \" + thisURL);\n// Log.v(\".cleanCollected\", \" collected set is now:\" + collectedLinks.toString());\n }\n }\n\n }",
"private void removeLinks(int index) {\n ensureLinksIsMutable();\n links_.remove(index);\n }",
"private void removeNode(DNode node) {\n node.prev.next = node.next;\n node.next.prev = node.prev;\n }",
"public void clearNeighborhoods()\n\t{\n\t\tfor (int i=0; i<numberOfNeighborhoods; i++)\n\t\t{\n\t\t\t(listOfNeighborhoods.get(i)).clear();\n\t\t}\n\t}",
"private void removeNoMoreExistingOriginalNodes() {\n for (Node mirrorNode : mirrorGraph.nodes()) {\n if (!isPartOfMirrorEdge(mirrorNode) && !originalGraph.has(mirrorNode)) {\n mirrorGraph.remove(mirrorNode);\n }\n }\n }",
"public void remove(Node n){\n Node before = n.prev, after = n.next;\n before.next = after;\n after.prev = before;\n }",
"public void removed()\n {\n if (prev == null) {\n IBSPColChecker.setNodeForShape(shape, next);\n }\n else {\n prev.next = next;\n }\n\n if (next != null) {\n next.prev = prev;\n }\n }",
"public void freeNodes(){\n\t\t//android.util.Log.d(TAG,\"freeNodes()\");\n\t\tfinal int size = this.nodes.size();\n\t\tfor(int index=0; index < size; index++){\n\t\t\tthis.nodes.delete(this.nodes.keyAt(index));\n\t\t}\n\t}",
"public void deleteCurrent(){\r\n if(curr != null && prev != null){\r\n prev.link = curr.link;\r\n curr = curr.link;\r\n }\r\n else if(curr != null){\r\n head = head.link;\r\n curr = head;\r\n }\r\n\r\n }",
"public void removeAllLinks() {\n\t\tfor (int i=0; i<links.size(); i++){\n\t\t\tlinks.remove(i);\n\t\t}\n\t}",
"private void removeFromList(ListNode node) {\n\t ListNode savedPrev = node.prev;\n\t ListNode savedNext = node.next;\n\n\t savedPrev.next = savedNext;\n\t savedNext.prev = savedPrev;\n\t }",
"void clearLinks();",
"public void deleteNode(Node n){\n\t\tn.item = n.next.item;\n\t\tNode temp = n.next.next;\n\t\t//delete(n.next);\n\t\tn.next = temp;\n\t\t\n\t\t\n\t}",
"public void removeNodeAfterThis() {\r\n\t\tif ( link != null ) {\r\n\t\t\tlink = link.link;\r\n\t\t} // end precondition\r\n\t}",
"public void deleteNodeFrom(Node n)\n\t{\n\t\tif(n==null||n.next==null)\n\t\t{\n\t\t\tSystem.out.println(\"Can not handle such situation\");\n\t\t\treturn;\n\t\t}\n\t\tNode cur = n.next, pre = n;\n\t\twhile(cur.next!=null)\n\t\t{\n\t\t\tpre.value = cur.value;\n\t\t\tcur = cur.next;\n\t\t\tpre = pre.next;\n\t\t}\n\t\tpre.value = cur.value;\n\t\tpre.next = null;\n\t}",
"public void delete() {\n\t\t// pre: length>0\n\t\t// post: delete one node from the end; reduce length\n\t\tif (this.length > 0) {\n\t\t\tCLL_LinkNode temp_node = this.headNode ;\n\t\t\tfor (int i = 1; i < this.length-1; i++) {\n\t\t\t\ttemp_node = temp_node.getNext();\n\t\t\t}\n\t\t\ttemp_node.getNext().setNext(null);\n\t\t\ttemp_node.setNext(this.headNode);\n\t\t\tthis.length--;\n\t\t}\n\t}",
"public abstract void removeEdge(int from, int to);",
"public synchronized void remove(E object) {\n Node<E> temp = first;\n while (temp.next != null) {\n if (first.object.equals(object)) {\n first = first.next;\n } else if (temp.object.equals(object)) {\n Node<E> forChangeLinks = temp;\n temp.next.prev = temp.prev;\n temp.prev.next = temp.next;\n }\n temp = temp.next;\n }\n }",
"public void remove() {\n\t\tif (prev != null && next != null) {\n\t\t\tprev.next = next;\n\t\t\tnext.prev = prev;\n\t\t\tnext = prev = null;\t\n\t\t}\n\t}",
"public final void clearLinks() {\n\t\tlockMe(this);\n\t\tlinks.clear();\n\t\tlinksFromDistance.clear();\n\t\tlinksToDistance.clear();\n\t\tunlockMe(this);\n\t}",
"public void removeAll() {\n\t\thead = new DoublyNode(null);\r\n\t\thead.setPrev(head);\r\n\t\thead.setNext(head);\r\n\t\tnumItems = 0;\r\n\t}",
"public static void main(String[] args) {\n myLinkedList list = new myLinkedList();\n list.add(10);\n list.add(15);\n list.add(12);\n list.add(13);\n list.add(20);\n list.add(14);\n list.printList();\n listNode temp = list.findprev(14);\n temp.next.next = temp;\n list.printList();\n System.out.println(list.detectAndRemoveLoop());\n //list.reverList();\n list.printList();\n //list.swapNodes(list, 15, 13);\n //list.printList();\n\n }",
"public synchronized void prunePeers() {\n\t\tchecker.checkList(this.getPeers());\n\t}",
"private void deleteNode(Node node) {\n node.prev.next = node.next;\n node.next.prev = node.prev;\n }",
"abstract void removeNodeReferences(Node<T> node);",
"private void remove(Node node) {\n Node next = node.next;\n Node previous = node.previous;\n previous.next = next;\n next.previous = previous;\n }",
"@Override\r\n\tpublic boolean unlink(E src, E dst) {\r\n\t\tVertex<E> s = vertices.get(src);\r\n\t\tVertex<E> d = vertices.get(dst);\r\n\t\tif(s != null && d != null) {\r\n\t\t\tadjacencyLists.get(src).remove(new Edge<E>(s.getElement(), d.getElement(), 1)); //remove edge (s,d)\r\n\t\t\tif(!isDirected) { //Remove the other edge if this graph is undirected\r\n\t\t\t\tadjacencyLists.get(dst).remove(new Edge<E>(d.getElement(), s.getElement(), 1));\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"protected void removeNode (int seq, int neighbourIndex)\n {\n Node currentNode = adjacencySequences[seq];\n Node previousNode = null;\n while (currentNode != null && currentNode.neighbourIndex != neighbourIndex)\n {\n previousNode = currentNode;\n currentNode = currentNode.nextNode;\n }\n\n if (currentNode != null)\n {\n if (previousNode != null)\n previousNode.nextNode = currentNode.nextNode;\n else\n adjacencySequences[seq] = currentNode.nextNode;\n }\n }",
"private void linkRemoved(Link link) {\n\n\t}",
"public final void updateMirror() {\n updateOriginalNodesInMirror();\n updateOriginalEdgesInMirror();\n removeNoMoreExistingOriginalEdges();\n removeNoMoreExistingOriginalNodes();\n }",
"@Override\n public void unhighlight() {\n\n // @tag ADJACENT : Removed highlight adjacent\n // boolean highlightedAdjacently = (highlighted == HIGHLIGHT_ADJACENT);\n if (highlighted == HIGHLIGHT_NONE) {\n return;\n }\n // @tag ADJACENT : Removed highlight adjacent\n /*\n * if (!highlightedAdjacently) { // IF we are highlighted as an adjacent\n * node, we don't need to deal // with our connections. if\n * (ZestStyles.checkStyle(getNodeStyle(),\n * ZestStyles.NODES_HIGHLIGHT_ADJACENT)) { // unhighlight the adjacent\n * edges for (Iterator iter = sourceConnections.iterator();\n * iter.hasNext();) { GraphConnection conn = (GraphConnection)\n * iter.next(); conn.unhighlight(); if (conn.getDestination() != this) {\n * conn.getDestination().unhighlight(); } } for (Iterator iter =\n * targetConnections.iterator(); iter.hasNext();) { GraphConnection conn\n * = (GraphConnection) iter.next(); conn.unhighlight(); if\n * (conn.getSource() != this) { conn.getSource().unhighlight(); } } } }\n */\n if (parent.getItemType() == GraphItem.CONTAINER) {\n ((GraphContainer) parent).unhighlightNode(this);\n } else {\n ((Graph) parent).unhighlightNode(this);\n }\n highlighted = HIGHLIGHT_NONE;\n updateFigureForModel(nodeFigure);\n\n }",
"public void deleteNode(GraphNode node){\n // 1. remove node from list\n graphNodes.remove(node);\n // 2. remove node from all adjacent nodes\n for(GraphNode s: node.getAdjacent()){\n s.removeAdjacent(node);\n }\n }",
"private void removeFromList(ListNode node){\n ListNode reservePrev = node.prev;\n ListNode reserveNext = node.next;\n \n // with the help of reserve, connect node prev to node next\n reservePrev.next = reserveNext;\n reserveNext.prev = reservePrev; \n }",
"private void removeNode(Node<E> node) {\n node.prev.next = node.next;\n node.next.prev = node.prev;\n }",
"void removeEdges(List<CyEdge> edges);",
"public void remove() {\n removeNode(this);\n }",
"public void updateNeighbourhood(ArrayList<Node> newNeighbors) {\n\t\tif (newNeighbors.isEmpty() && CDState.getCycle() < crashCycle ){\n\t\t\tthrow new RuntimeException(\"no neighbor found-isolated node\");\n\t\t}\n\t\n\t\tArrayList<Node> added = new ArrayList<Node>(newNeighbors);\n\t\t//added has now all the neighbors(new and old)\n\t\t//remove all the old neighbors\n\t\tadded.removeAll(this.getNeighbors());\n\n\t\tArrayList<Node> removed = new ArrayList<Node>(this.getNeighbors());\n\t\t//removed has now all the old neighbors\n\t\tremoved.removeAll(newNeighbors);\n\n\t\tthis.setNeighbors(newNeighbors);\n\n\t\tDiscoveryListener universeProtocol = (DiscoveryListener) \n\t\t\t\tcurrentNode.getProtocol(universeProtocolId);\n\t\t\n\t\t//add to the list of ur neighbors\n\t\tif (!added.isEmpty()){\n\t\t\t// Notify the higher layers that certain nodes have been discovered.\n\t\t\t//System.out.println(\"cadded\"+ CDState.getCycle() +\",Node: \"+currentNode.getID());\n\t\t\tuniverseProtocol.notifyAddedNodes(currentNode, added);\n\t\t}\n\t\t\n\t\tif (!removed.isEmpty()){\n\t\t\t// Notify the higher layers that certain nodes have been removed.\n\t\t\t//System.out.println(\"cremoved\"+ CDState.getCycle() +\",Node: \"+currentNode.getID());\n\t\t\tuniverseProtocol.notifyRemovedNodes(currentNode, removed);\n\t\t}\n\t\t//System.out.println(\"Node \"+currentNode.getID() + \" neighbors: \" + neighbors.size()); \n\t\tif(neighbors.size()> Neighbor_Threshold){\n\t\t\tthrow new RuntimeException(\"PASSS the maximum number of neighbors plz reduce the discovery radius!\");\n\t\t}\n\t}",
"void removeLine(PNode c){\n\t\tLinkSet ls = null;\n\t\tLink l = null;\n\t\tLinkSet ls1 = new LinkSet();\n\t\tfor(int i=0;i<linksets.size();i++){\n\t\t\tfor(int j=0;j<linksets.get(i).getLinks().size();j++){\n\t\t\t\tif(c==linksets.get(i).getLinks().get(j).getNode1()||c==linksets.get(i).getLinks().get(j).getNode2()){\n\t\t\t\t\tls = linksets.get(i);\n\t\t\t\t\tl = ls.getLinks().get(j);\n\t\t\t\t\tls.removeLink(l);\n\t\t\t\t\tif(ls.getLinks().size()==0){\n\t\t\t\t\t\tlinksets.remove(ls);//remove linkset if it is empty\n\t\t\t\t\t\tls = null;\n\t\t\t\t\t\tl = null;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(ls!=null){\n\t\t\tLink tlink = null;\n\t\t\tfor(Link lnk: ls.getLinks()){\n\t\t\t\tif(lnk.getNode1().getOwner()==l.getNode1().getOwner() && lnk.getNode1().getSignal()==l.getNode1().getSignal()\n\t\t\t\t\t\t|| lnk.getNode2().getOwner()==l.getNode1().getOwner() && lnk.getNode2().getSignal()==l.getNode1().getSignal()){\n\t\t\t\t\ttlink = lnk;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t\tif(tlink!=null){\n\t\t\t\tls1.addLink(tlink);\n\t\t\t\tls.removeLink(tlink);\n\t\t\t\tcheckForNextLink(ls1, ls, tlink);\n\t\t\t}\n\t\t\tif(ls.getLinks().size()==0){\n\t\t\t\tlinksets.remove(ls);\n\t\t\t}\n\t\t\tlinksets.add(ls1);\n\t\t}\n\t\tfor(int i=0; i<links.size();i++){\n\t\t\tLink lnk = links.get(i);\n\t\t\tif (c == lnk.getNode1() || c == lnk.getNode2()){\n\t\t\t\tlayer.removeChild(links.get(i).getPPath());\n\t\t\t\tlinks.remove(i);\n\t\t\t\tremoveLine(c);\n\t\t\t}\n\t\t}\n\t}",
"public void deleteCurrent() {\r\n\t\tif (curr == null)\r\n\t\t\treturn;\r\n\t\tif (curr == head) {\r\n\t\t\thead = head.link; // curr = curr.link\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tprev.link = curr.link; // Points over top of current\r\n\t\tcurr = curr.link;\r\n\r\n\t}",
"private void Clean(){\n \t NodeIterable nodeit = graphModel.getGraph().getNodes();\n \t\n \t for (Node node : nodeit) {\n\t\t\t\n \t\t \n \t\t \n\t\t}\n \t\n }",
"public void clearNodeVisitedMarking() {\n\tfor (Node n : nodes)\n\t n.clearVisitedMark();\n }",
"public void fixEdges() {\n\tfor (LayoutEdge lEdge: edgeList) {\n\t // Get the underlying edge\n\t CyEdge edge = lEdge.getEdge();\n\t CyNode target = (CyNode) edge.getTarget();\n\t CyNode source = (CyNode) edge.getSource();\n\n\t if (nodeToLayoutNode.containsKey(source) && nodeToLayoutNode.containsKey(target)) {\n\t\t// Add the connecting nodes\n\t\tlEdge.addNodes((LayoutNode) nodeToLayoutNode.get(source),\n\t\t\t (LayoutNode) nodeToLayoutNode.get(target));\n\t }\n\t}\n }",
"public void remove() {\n\t\tif(this._prev != null)\n\t\t\tthis._prev._next = this._next;\n\t\tif(this._next != null)\n\t\t\tthis._next._prev = this._prev;\n\n\t\tthis._next = null;\n\t\tthis._prev = null;\n\t}",
"void forceRemoveNodesAndExit(Collection<Node> nodesToRemove) throws Exception;",
"public void tunnel() {\r\n\t\tboolean status = true;\r\n\t\tfor (CellStorage i : node) {\r\n\t\t\tif (i.getCell().tunnelTo != null) {\r\n\t\t\t\tCellStorage tunnelTo = null;\r\n\t\t\t\t// Searching for destinated node from the tunnel\r\n\t\t\t\tfor (int k = 0; k < node.size(); k++) {\r\n\t\t\t\t\tif (node.get(k).getCell() == i.getCell().tunnelTo) {\r\n\t\t\t\t\t\ttunnelTo = node.get(k);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\ti.setTunnel(tunnelTo);\r\n\r\n\t\t\t\t// Calling validateConnection method to make sure that no duplicated connection\r\n\t\t\t\t// is made.\r\n\t\t\t\t// Create new connection if no duplicate.\r\n\r\n\t\t\t\tstatus = validateConnection(i, tunnelTo);\r\n\t\t\t\tif (status == false) {\r\n\t\t\t\t\tHashMapConnectedNodes tunnelSet = new HashMapConnectedNodes();\r\n\t\t\t\t\ttunnelSet.hmConnectedNodesObj.put(i.getIndex(), i);\r\n\t\t\t\t\ttunnelSet.hmConnectedNodesObj.put(tunnelTo.getIndex(), tunnelTo);\r\n\t\t\t\t\thshMConnectedNodes.add(tunnelSet);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void removeEdge(N startNode, N endNode)\r\n/* 80: */ {\r\n/* 81:151 */ assert (checkRep());\r\n/* 82:152 */ if ((contains(startNode)) && (((Map)this.map.get(startNode)).containsKey(endNode)))\r\n/* 83: */ {\r\n/* 84:153 */ ((Map)this.map.get(startNode)).remove(endNode);\r\n/* 85:154 */ ((Map)this.map.get(endNode)).remove(startNode);\r\n/* 86: */ }\r\n/* 87: */ }",
"public void clearLinkRemovalTags() {\n\tfor (Link l : allLinks)\n\t l.clearRemovalTag();\n }",
"public void rLink() {\n\t\tNode prev = tail = null;\n\n\t\twhile ( head != null ) {\n\t\t\t// store the next node\n\t\t\tNode nextNode = head.next;\n\n\t\t\t// point head node to prev\n\t\t\thead.next = prev;\n\n\t\t\t// change prev to head node\n\t\t\tprev = head;\n\n\t\t\t// move forward to next node\n\t\t\thead = nextNode;\n\t\t}\n\n\t\t// change head to new head\n\t\thead = prev;\n\n\t}",
"public void remove(int pos) {\n \tNode2 currentLink = first;\n \tNode2 tempPrevLink = null;\n \tint temp=1;\n \t\n\t while(temp++ != pos) {\n\t \ttempPrevLink = currentLink;\n\t\t currentLink = currentLink.nextLink;\n\t }\n\t currentLink.nextLink.prevLink = tempPrevLink;\n\t tempPrevLink.nextLink = currentLink.nextLink; \n }",
"@Override\n public void remove() {\n if (size == 0) return;\n else if (size == 1) {\n head = tail = null;\n size = 0;\n }\n else {\n Node<E> current1 = head;\n int temp_index = 0;\n for (int i = 0; i <= size - 1; i++) {\n if (current1.equals(current)) {\n temp_index = i;\n break;\n }\n else {\n current1 = current1.next;\n }\n }\n\n current1 = head;\n for (int i = 0; i < temp_index - 1; i++) //find the previous element\n current1 = current1.next;\n if (temp_index == 0) {\n head = head.next;\n current = current.next;\n size--;\n return;\n }\n else if (temp_index == size - 1) {\n current1.next = current.next;\n tail = current1;\n size--;\n return;\n }\n\n current1.next = current.next;\n size--;\n current = current1.next;\n }\n }",
"void removeEdge(int x, int y);",
"void removeDirectedEdge(final Node first, final Node second)\n {\n if (first.connectedNodes.contains(second))\n first.connectedNodes.remove(second);\n\n }",
"public void removeAtFront(){\r\n\t head = head.getLink();\r\n\t cursor = head; \r\n\t precursor = null; \r\n\t \r\n\t manyNodes--;\r\n }",
"void resetLink(Link link, Node source, Node target, Dependency type) {\n\t\tlinks.remove(link);\n\t\tlinks.add(new Link(source, target, type, source));\n\t}",
"public void changingNeighbor() {\n }",
"private void removeNode(DLinkedNode node){\n\t\tDLinkedNode prev = node.prev;\n\t\tDLinkedNode next = node.next;\n\n\t\tprev.next = next;\n\t\tnext.prev = prev;\n\t}",
"public void removeBootStrapNode() throws RemoteException{\n\t\tnodeIp=null;\n\t\thasNeighbours = false;\n\t\n\t}",
"public void removeAllEdges() {\n }",
"public static void removeSample() {\n Node ll1 = new Node(1, new Node(2, new Node(3, new Node(4, new Node(5, null)))));\n Node ll2 = new Node(1, new Node(2, new Node(3, new Node(4, new Node(5, null)))));\n Node ll3 = new Node(1, new Node(2, new Node(3, new Node(4, new Node(5, null)))));\n Node ll4 = new Node(1, new Node(2, new Node(3, new Node(4, new Node(5, null)))));\n Node ll5 = new Node(1, new Node(2, new Node(3, new Node(4, new Node(5, null)))));\n Node ll6 = new Node(1, new Node(2, new Node(3, new Node(4, new Node(5, null)))));\n\n System.out.println(\"remove 1==\");\n Node r1 = ll1.remove(0);\n r1.printList();\n System.out.println(\"remove 2==\");\n Node r2 = ll2.remove(1);\n r2.printList();\n System.out.println(\"remove 3==\");\n Node r3 = ll3.remove(2);\n r3.printList();\n System.out.println(\"remove 4==\");\n Node r4 = ll4.remove(3);\n r4.printList();\n System.out.println(\"remove 5==\");\n Node r5 = ll5.remove(4);\n r5.printList();\n System.out.println(\"remove 6==\");\n Node r6 = ll6.remove(5);\n r6.printList();\n\n }",
"public void uncover ()\n {\n for (DancingNode i=this.U; i!=this; i=i.U) // go up the column\n {\n for (DancingNode j=i.L; j!=i; j=j.L) // go left across the row \n {\n j.C.size++;\n j.relinkUD();\n }\n }\n this.relinkLR();\n }",
"@Override\r\n public void remove() {\n Node current = exp.head;\r\n if( current.next == null ){\r\n exp.head = null;\r\n }\r\n\r\n while( current.next.next != null ){\r\n current = current.next;\r\n }\r\n current.next = null; // current.next son elemani gosterir.\r\n\r\n }",
"private static void removeNode(CFG cfg, SDGNode toRemove) {\n\t\tfinal List<SDGEdge> edgesToAdd = new LinkedList<SDGEdge>();\n\t\tfinal List<SDGEdge> edgesToRemove = new LinkedList<SDGEdge>();\n\t\tfor (SDGEdge eIncoming : cfg.getIncomingEdgesOfKind(toRemove, SDGEdge.Kind.CONTROL_FLOW)) {\n\t\t\tfor (SDGEdge eOutgoing : cfg\n\t\t\t\t\t.getOutgoingEdgesOfKind(toRemove, SDGEdge.Kind.CONTROL_FLOW)) {\n\t\t\t\tedgesToAdd.add(new SDGEdge(eIncoming.getSource(), eOutgoing.getTarget(),\n\t\t\t\t\t\tSDGEdge.Kind.CONTROL_FLOW));\n\t\t\t\tedgesToRemove.add(eIncoming);\n\t\t\t\tedgesToRemove.add(eOutgoing);\n\t\t\t}\n\t\t}\n\n\t\tcfg.addAllEdges(edgesToAdd);\n\t\tcfg.removeAllEdges(edgesToRemove);\n\t\tcfg.removeVertex(toRemove);\n\t}",
"private final void relaxNeighbors(_Node unsettledNode)\r\n {\r\n for (_Edge destinationEdge : map.getDestinations(unsettledNode))\r\n {\r\n \tif (isSettled(destinationEdge.getEndNode())) continue;\r\n \tint shortDist = getShortestDistance(unsettledNode) + destinationEdge.getWeight();// map.getDistance(unsettledNode, destinationEdge.getEndNode());\r\n if (shortDist <= getShortestDistance(destinationEdge.getEndNode()))\r\n {\r\n setShortestDistance(destinationEdge.getEndNode(), shortDist);\r\n setPredecessor(destinationEdge.getEndNode(),unsettledNode);\r\n }\r\n } \r\n }",
"void kickNeighbor(Link l) {\n this.lsd.removeDiscoveredRouter(l.getRemoteRouterDesc().simulatedIPAddress);\n this.broadcastLSARemove(l.getRemoteRouterDesc());\n this.shutdownLink(l);\n }",
"private void clean() {\n nodesToRemove.clear();\n edgesToRemove.clear();\n }",
"public void relinkUD()\n {\n this.U.D = this.D.U = this;\n }",
"public synchronized void removeAllFor(String nodeId) {\n\t/* see if this is a remote node */\n\tRoutesMap rl = forwardTable.remove(nodeId);\n\tif (rl == null) {\n\t /* if not, then see if it's a via node */\n\t Set<String> targets = inverseTable.remove(nodeId);\n\t if (targets != null) {\n\t\tfor (String to : targets) {\n\t\t RoutesMap trl = forwardTable.get(to);\n\t\t if (trl != null) {\n\t\t\ttrl.remove(nodeId);\n\t\t\tif (trl.size() == 0) {\n\t\t\t /* if this was the only route, cleanup */\n\t\t\t forwardTable.remove(to);\n\t\t\t}\n\t\t }\n\t\t}\n\t }\n\t}\n }",
"public void removeNeighbour(final Vertex neighbour){\n\t\tif(getNeighbours().contains(neighbour))\n\t\t\tgetNeighbours().remove(neighbour);\n\t}",
"public void remove() {\n\t\tif (current == head) {\n\t\t\thead = current.getNext();\n\t\t\tcurrent = head;\n\t\t}\n\t\tif (current.getNext() == null) {\n\t\t\tcurrent.getPrevious().setNext(null);\n\t\t\tcurrent = current.getPrevious();\n\t\t}\n\t\telse {\n\t\t\tcurrent.getPrevious().setNext(current.getNext());\n\t\t\tcurrent.getNext().setPrevious(current.getPrevious());\n\t\t\tcurrent = current.getPrevious();\n\t\t}\n\t}",
"protected void alter_for_neighbour_switch() {\n\t\tint this_l, tother_l, ns_i, ns_j, ns_n;\n\t\t\n\t\t// Let the user know...\n\t\tSystem.out.println(\" H THIS IS IN N_SWITCH (nn comparison) mode, for structure \"+INIT_NPHASE);\n\t\tSystem.out.println(\" H en_shift = \"+EN_SHIFT);\n\t\t\n\t\t// Check that there is room at the inn:\n\t\tif( n > MAX_NNS ) {\n\t\t\tthrow( new LSSimException(LSSimException.PARAM,\n\t\t\t\"neighbour switch needs \"+n+\" neighbours in MAX_NNS!\\n\"));\n\t\t}\n\t\t\n\t\t// Make both structures the same:\n\t\tthis_l = INIT_NPHASE;\n\t\ttother_l = 1 - this_l;\n\t\tfor( ns_i = 0; ns_i < n; ns_i++ ) {\n\t\t\tlatt[tother_l][ns_i].x = latt[this_l][ns_i].x;\n\t\t\tlatt[tother_l][ns_i].y = latt[this_l][ns_i].y;\n\t\t\tlatt[tother_l][ns_i].z = latt[this_l][ns_i].z;\n\t\t\t// copy nn lists as well!\n\t\t\tns_n = 0; ns_j = nns[this_l][ns_i][ns_n];\n\t\t\twhile ( ns_j != NO_MORE_NNS ) {\n\t\t\t\tnns[tother_l][ns_i][ns_n] = nns[this_l][ns_i][ns_n];\n\t\t\t\tns_n++; ns_j = nns[this_l][ns_i][ns_n];\n\t\t\t}\n\t\t\tnns[tother_l][ns_i][ns_n] = NO_MORE_NNS;\n\t\t}\n\t\t\n\t\t// Alter the neighbour list for structure 1;\n\t\tmake_it_order_n_squared(1);\n\t}",
"@Override\n\tpublic void clear()\n\t{\n\t\t/*\n\t\t * TODO This doesn't actually notify GraphChangeListeners, is that a\n\t\t * problem? - probably is ... thpr, 6/27/07\n\t\t */\n\t\tnodeEdgeMap.clear();\n\t\tnodeList.clear();\n\t\tedgeList.clear();\n\t}",
"public void relinkLR()\n {\n this.L.R = this.R.L = this;\n }",
"public void deleteList() {\n this.head = deleteListWrap(this.head);\n }",
"private void refreshNodeList() {\n if (UnderNet.router.status.equals(InterfaceStatus.STARTED)) {\n //Using connected and cached nodes if the router has started.\n ArrayList<Node> nodesToList = UnderNet.router.getConnectedNodes();\n for (Node cachedNode :\n EntryNodeCache.cachedNodes) {\n boolean canAdd = true;\n for (Node connectedNode : UnderNet.router.getConnectedNodes()) {\n if (cachedNode.getAddress().equals(connectedNode.getAddress())) {\n canAdd = false;\n }\n }\n if (canAdd) {\n nodesToList.add(cachedNode);\n }\n }\n nodeList.setListData(nodesToList.toArray());\n } else {\n //Using cached nodes if the router isn't online.\n nodeList.setListData(EntryNodeCache.cachedNodes.toArray());\n }\n }",
"public void remove() {\n\n\t\tif (size() > 1) {\n\n\t\t\tNode node = head;\n\n\t\t\tfor (int i = 0; i < size() - 1; i++) {\n\n\t\t\t\tnode = node.getNextNode();\n\n\t\t\t}\n\n\t\t\tif (node != null) {\n\n\t\t\t\tnode.setNextNode(null);\n\t\t\t\tsize--;\n\n\t\t\t}\n\n\t\t} else if (size() == 1) {\n\n\t\t\thead = null;\n\t\t\tsize--;\n\n\t\t}\n\n\t}",
"public void removeWall(Vertex current, Vertex next) {\r\n\r\n\t\tif (current.label + mazeSize == next.label) {\r\n\t\t\t\r\n\t\t\tcurrent.hasDownWall = false;\r\n\t\t\tnext.hasUpWall = false;\r\n\t\t} else if (current.label + 1 == next.label) {\r\n\t\t\t\r\n\t\t\tcurrent.hasRightWall = false;\r\n\t\t\tnext.hasLeftWall = false;\r\n\t\t} else if (current.label - 1 == next.label) {\r\n\t\t\t\r\n\t\t\tcurrent.hasLeftWall = false;\r\n\t\t\tnext.hasRightWall = false;\r\n\t\t} else if (current.label - mazeSize == next.label) {\r\n\t\t\t\r\n\t\t\tcurrent.hasUpWall = false;\r\n\t\t\tnext.hasDownWall = false;\r\n\t\t}\r\n\r\n\t\tcurrent.neighbors.remove(next);\r\n\t\tnext.neighbors.remove(current);\r\n\t}",
"public void clear()\t{nodes.clear(); allLinks.clear();}",
"void removeNi(int node) {\n neighbors.remove(node);\n }",
"public void clearList()\n\t{\n\t\tnodeManager.clearList();\n\t}",
"public void removeAtIndex(int index)\n {\n\n if (index == 0)\n {\n head = head.next;\n size = size - size;\n return ;\n }\n\n if (index == size - 1)\n {\n Node nodeA = head;\n Node nodeB = head;\n\n while (nodeA != tail)\n\n {\n nodeB = nodeA;\n nodeA = nodeA.next;\n }\n\n tail = nodeB;\n tail.next = null;\n\n size = size - size;\n return;\n }\n\n Node myNode = head;\n\n for (int i = 1; i < size - 1; i++)\n {\n if (i == index)\n {\n Node myNode1 = myNode.next;\n myNode1 = myNode1.next;\n myNode.next = myNode1;\n break;\n }\n myNode = myNode.next;\n }\n\n size = size - size;\n\n }"
] | [
"0.71356684",
"0.6581443",
"0.6529229",
"0.6437705",
"0.62342757",
"0.6208623",
"0.61685866",
"0.61526126",
"0.61475563",
"0.60826313",
"0.60149854",
"0.60063595",
"0.6004488",
"0.6003641",
"0.59594345",
"0.59574634",
"0.5910037",
"0.5903891",
"0.5895926",
"0.58929235",
"0.58862734",
"0.5853118",
"0.58431035",
"0.5818176",
"0.58161736",
"0.5804524",
"0.57799417",
"0.57770526",
"0.5770706",
"0.5758466",
"0.5743981",
"0.5734059",
"0.5723446",
"0.5720552",
"0.57144046",
"0.5707965",
"0.5707306",
"0.5700815",
"0.5700438",
"0.56891656",
"0.5688485",
"0.56825906",
"0.56388694",
"0.5636849",
"0.56366014",
"0.5636529",
"0.56361276",
"0.5626986",
"0.5620518",
"0.5617011",
"0.561444",
"0.5611103",
"0.56106836",
"0.56039923",
"0.5596748",
"0.55895925",
"0.5582677",
"0.55775917",
"0.55746806",
"0.556382",
"0.5557889",
"0.555447",
"0.5552739",
"0.55400085",
"0.55250627",
"0.55054843",
"0.5504701",
"0.54975545",
"0.54877394",
"0.5483822",
"0.54789686",
"0.54647756",
"0.5463282",
"0.5461058",
"0.54561937",
"0.54500616",
"0.54495835",
"0.544602",
"0.54362434",
"0.54278684",
"0.54251206",
"0.54241353",
"0.54133064",
"0.54125273",
"0.54082614",
"0.5400726",
"0.53933334",
"0.53762656",
"0.53745043",
"0.53740156",
"0.537156",
"0.5370526",
"0.5367833",
"0.5366751",
"0.53632706",
"0.5363217",
"0.53627515",
"0.5359935",
"0.53582174",
"0.53563005"
] | 0.590262 | 18 |
Checks whether there are no elements in List. | public boolean empty() {
return size == 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean isEmpty(int list) {\n\t\treturn m_lists.getField(list, 0) == -1;\n\t}",
"public boolean checkListIsEmpty(List<WebElement> eleList) {\n if (eleList.size() == 0) {\n return true;\n }\n return false;\n }",
"@Override\n\tpublic boolean isEmpty() {\n\t\treturn list.isEmpty();\n\t}",
"@Override\n\tpublic boolean isEmpty() {\n\t\treturn list.isEmpty();\n\t}",
"public boolean isEmpty(){\n\n \treturn list.size() == 0;\n\n }",
"public static boolean empty() {\n\n if (list.size() != 0){\n return false;\n }\n return true;\n }",
"@Override\n public boolean isEmpty()\n {\n return list.size()<1;\n }",
"public boolean isEmpty(){\n\t\tif(list.isEmpty()){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"boolean isListRemainingEmpty();",
"public boolean isEmpty()\n\t{\n\t\treturn list.isEmpty();\n\t}",
"public boolean empty() {\n\t\treturn list.size() == 0;\n\t}",
"public boolean isEmpty() {\n return list.isEmpty();\n }",
"public boolean isEmpty() {\n\t\treturn list.isEmpty();\n\t}",
"public synchronized boolean isEmpty(){\n return list.isEmpty();\n }",
"public boolean empty() {\n if (list.size() == 0) {\n return true;\n }\n else {\n return false;\n }\n }",
"public synchronized boolean isEmpty () {\n return list.isEmpty();\n }",
"@Override\n\tpublic boolean isEmpty()\n\t{\n if (list.isEmpty())\n {\n return true;\n } \n else\n {\n return false;\n }\n\t}",
"public boolean isEmpty(){\n for(int i = 0; i < arrayList.length; i++) {\n if (arrayList[i] != null)\n return false;\n }\n return true;\n }",
"public static boolean isEmpty(List list){\n\n if(list == null){\n return true;\n }\n if(list.size() == 0){\n return true;\n }\n return false;\n }",
"public boolean isEmpty() {\r\n\t\t\r\n\t\tint i = 0;\r\n\t\tStudent emptyChecker;\r\n\t\tint size = sizeOfList(list);\r\n\t\twhile (i < size) {\r\n\t\t\temptyChecker = list[i];\r\n\t\t\tif (emptyChecker != null) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tnumStudents = 0;\r\n\t return true;\r\n\t}",
"public boolean empty() {\n return list.isEmpty();\n }",
"public /*@ pure @*/ boolean isEmpty() {\n return the_list == null;\n }",
"@Override\r\n\tpublic boolean isEmpty() {\n\t\treturn data != null && data.list != null && data.list.isEmpty();\r\n\t}",
"public boolean isEmpty() {\r\n\t\treturn al.listSize == 0;\r\n\t}",
"public boolean isEmpty(){\n return this.listSize == 0;\n }",
"public boolean isEmpty()\n {\n //this method is used to check length\n //replacing head == null so I don't have to maintain a head\n //also error checks for null lists\n return (entryList == null || (entryList.size() == 0));\n //just doing .size() == 0 will raise a null pointer exception on occasion\n }",
"public boolean checkListNull() {\n\t\treturn ((drawerItems == null) ? true : false);\n\t}",
"public boolean containsNoItems() {\n\t\treturn (this.items.size() == 0);\n\t}",
"protected boolean checkEmptyList(){\n boolean emptyArray = true;\n String empty= alertList.get(AppCSTR.FIRST_ELEMENT).get(AppCSTR.NAME);\n if(!empty.equals(\"null\") && !empty.equals(\"\")) {\n emptyArray = false;\n }\n return emptyArray;\n }",
"public boolean isEmpty()\n {\n return elements.isEmpty();\n }",
"boolean isEmpty() {\n return this.myArrayList.isEmpty();\n }",
"public boolean isEmpty() {\n return dataList.size() <= 0 || (dataList.size() == 1 && dataList.get(0).isEmpty());\n }",
"public boolean isEmpty() {\n return elements.isEmpty();\n }",
"boolean isEmpty() {\n\t\treturn m_list_nodes.size() == 0;\n\t}",
"private Boolean checkForEmptyList() {\n Boolean emptyListAvailable = tin_perLitrePrice.getText().toString().trim().isEmpty() ||\n tin_fuelQuantityLitres.getText().toString().trim().isEmpty() ||\n tin_totalFuelPrice.getText().toString().trim().isEmpty() ||\n tin_currentKm.getText().toString().trim().isEmpty() ||\n tin_startingKm.getText().toString().trim().isEmpty() ||\n tin_distanceCovered.getText().toString().trim().isEmpty() ||\n tv_calculatedAverage_addEdit.getText().toString().trim().isEmpty() ||\n tv_coverableDistance_addEdit.getText().toString().trim().isEmpty() ||\n tv_nextFuelFill_addEdit.getText().toString().trim().isEmpty();\n\n if (emptyListAvailable) {\n validationList(); // set error messages\n }\n Log.d(TAG, \"checkForEmptyList: emptyListAvailable = \" + emptyListAvailable);\n\n\n return emptyListAvailable; //\n }",
"public boolean isEmpty() {\n\t\treturn elements.isEmpty();\n\t}",
"public static <C> boolean isEmpty(LIST<C> L) {\n if ( isNull( L ) || L.list.isEmpty() ) {\n return true;\n }\n if ( L.iter != null ) {\n return ! L.iter.hasNext();\n }\n return false;\n }",
"public boolean isEmpty() {\n\t\treturn elements == 0;\n\t}",
"public void testIsEmpty() {\r\n assertTrue( list.isEmpty());\r\n list.add(\"A\");\r\n assertFalse(list.isEmpty());\r\n }",
"public boolean isEmpty() {\n\n return elements.isEmpty();\n }",
"public boolean isEmpty() {\n return elements == 0;\n }",
"public boolean isEmpty(){\n\t\treturn firstNode == null; //return true if List is empty\n\t}",
"protected static <C> boolean isNull(LIST<C> L) {\n if ( L == null || L.list == null ) {\n return true;\n }\n return false;\n }",
"public boolean isEmpty()\n {\n return ((elements == null) || elements.isEmpty());\n }",
"public boolean empty()\n {\n boolean result = (dataList.size() == 0) ? true : false;\n return result;\n }",
"private boolean isEmpty() {\n\t\treturn size() == 0;\n\t}",
"public boolean isAListEmpty(){\r\n\t\tif((programChairs.size() > 0) && (committeeMembers.size() > 0)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"public boolean isEmpty() {\n\t\treturn allItems.size() == 0;\n\t}",
"public boolean isEmpty() {\n\t\treturn firstNode == null; // return true if List is empty\n\t}",
"public boolean isEmpty() // true if list is empty\r\n\t{\r\n\t\treturn (first == null);\r\n\t}",
"@Override\r\n\tpublic boolean isEmpty() {\r\n\t\treturn count == 0;\r\n\t}",
"public static boolean isEmpty() \r\n\t{\r\n\t\treturn m_count == 0;\r\n }",
"@Override\n public boolean isEmpty() {\n if(first == null){ //if first element does not exist, the whole is empty\n return true;\n }\n else{\n return false; //if first element exist, list is not empty\n }\n }",
"@Override\r\n\tpublic boolean isEmpty() {\n\t\treturn this.size == 0;\r\n\t}",
"@Override\r\n\tpublic boolean isempty() {\n\t\treturn count<=0;\r\n\t\t\r\n\t}",
"public boolean isEmpty()\n\t{\n\t\treturn m_elements.isEmpty();\n\t}",
"@Override\r\n\tpublic boolean isEmpty() {\r\n\t\treturn size() == 0;\r\n\t}",
"@Override\n public boolean isEmpty() {\n return this.count() == 0;\n }",
"@Override\n\tpublic boolean isEmpty() {\n\t\treturn(size() == 0);\n\t}",
"public boolean isEmpty() {\n\t\treturn (_items.size() == 0);\n\t}",
"public boolean isEmpty()\r\n\t{\r\n\t\treturn numItems == 0 ;\r\n\t}",
"@Override\n public boolean isEmpty(){\n return itemCount == 0;\n }",
"public boolean isEmpty() {\r\n return NumItems == 0;\r\n }",
"public boolean isEmpty(){\n return(numItems == 0);\n }",
"public boolean isEmpty()\r\n {\r\n if (count > 0) return false;\r\n else return true;\r\n }",
"public boolean isEmpty() {\n return stack.isListEmpty();\n }",
"@SuppressWarnings(\"rawtypes\")\n public static boolean isEmpty(List values) {\n return values == null || values.isEmpty();\n }",
"public boolean isEmpty() {\n\t\treturn numElements == 0; // Dummy return\n\t}",
"public boolean isEmpty() {\n\t\tif (l.getHead() == null)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}",
"public boolean isEmpty() {\n\t\t//if head is null\n\t\tif (head == null) {\n\t\t\t//return true, no items in list\n\t\t\treturn true;\n\t\t}\n\t\t//otherwise\n\t\treturn false;\n\t}",
"public boolean isEmpty()\r\n\t{\r\n\t\treturn (count == 0);\r\n\t}",
"public boolean isEmpty()\r\n\t{\r\n\t\treturn count == 0;\r\n\t}",
"public boolean isEmpty() {\n\n\t\tif (numItems == 0)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\n\t}",
"public boolean empty() {\n\t\treturn (size() <= 0);\n\t}",
"@Override\n public boolean isEmpty() {\n return size() == 0;\n }",
"@Override\n public boolean isEmpty() {\n return size() == 0;\n }",
"@Override\n public boolean isEmpty() {\n return size() == 0;\n }",
"@Override\n public boolean isEmpty() {\n return size() == 0;\n }",
"@Override\n public boolean isEmpty() {\n return size() == 0;\n }",
"@Override\n public boolean isEmpty() {\n return this.size == 0;\n }",
"public boolean isEmpty(){\r\n\t\treturn size() == 0;\r\n\t}",
"public boolean isEmpty() {\n\t\treturn numElements==0;\n\t}",
"public boolean isEmpty() { return count == 0; }",
"@Override\n public boolean isEmpty() {\n if (count == 0) {\n return true;\n }\n return false;\n }",
"@Override\n public boolean isEmpty(){\n return (count == 0);\n }",
"public boolean isEmpty(){\n return itemCount == 0;\n }",
"public boolean isEmpty() {\n \tif (numItems==0) {\n \t\treturn true;\n \t}\n \treturn false;\n }",
"public boolean isEmpty(){\n\t\treturn sizeOfLinkedList() == 0;\n\t}",
"public static <T> void listNotNullOrEmpty(Iterable<T> list, String listName)\n\t{\n\t\tGuard.notNull(list, listName);\n\n\t\tif (!list.iterator().hasNext())\n\t\t{\n\t\t\tthrow new IllegalArgumentException(String.format(\n\t\t\t\t\"List '%1$s' can't be empty.\", listName));\n\t\t}\n\t}",
"public boolean isEmpty() {\n return (count == 0);\n }",
"public boolean supportsEmptyInList() {\n \t\treturn true;\n \t}",
"public boolean isEmpty() {\n return size() == 0;\n }",
"public boolean isEmpty() {\n\t return size() == 0;\n\t }",
"public boolean isEmpty()\r\n {\r\n return (size() == 0);\r\n }",
"public boolean isEmpty() {\n return (this.count == 0);\n }",
"public boolean isEmpty() {\n return size() == 0;\n }",
"public boolean isEmpty() {\n return size() == 0;\n }",
"public boolean isEmpty() {\n return size() == 0;\n }",
"public boolean isEmpty() {\n return size() == 0;\n }",
"public boolean isEmpty() {\n return size() == 0;\n }",
"public boolean isEmpty() {\n return size() == 0;\n }"
] | [
"0.795757",
"0.7915859",
"0.78181183",
"0.78181183",
"0.7699221",
"0.76919633",
"0.7682379",
"0.76752347",
"0.7663746",
"0.76374656",
"0.7636185",
"0.76041424",
"0.760217",
"0.75960124",
"0.7557167",
"0.7553221",
"0.7544497",
"0.7540183",
"0.7537812",
"0.74515796",
"0.7413601",
"0.7410769",
"0.73245424",
"0.72950965",
"0.72718155",
"0.7259563",
"0.7172374",
"0.71412635",
"0.7077375",
"0.70764494",
"0.70729876",
"0.70557",
"0.7055024",
"0.7036385",
"0.7032077",
"0.7006713",
"0.6980755",
"0.697479",
"0.6974059",
"0.6968849",
"0.6960267",
"0.69341964",
"0.69296056",
"0.6919954",
"0.6916786",
"0.69053465",
"0.69033265",
"0.6902249",
"0.68935126",
"0.68814737",
"0.6863883",
"0.68594545",
"0.68542016",
"0.6839292",
"0.68376",
"0.68314636",
"0.68284744",
"0.6823859",
"0.68159115",
"0.6808097",
"0.68069994",
"0.6806864",
"0.6805976",
"0.679501",
"0.67902964",
"0.6789164",
"0.67802984",
"0.6776129",
"0.67754966",
"0.67719746",
"0.67705464",
"0.67640156",
"0.6755465",
"0.675451",
"0.67537606",
"0.67537606",
"0.67537606",
"0.67537606",
"0.67537606",
"0.67476547",
"0.67329174",
"0.67243433",
"0.6722389",
"0.6722367",
"0.6716309",
"0.671038",
"0.67066956",
"0.66959256",
"0.66922605",
"0.66897744",
"0.6676968",
"0.66743517",
"0.66732424",
"0.66687644",
"0.66660196",
"0.66638213",
"0.66638213",
"0.66638213",
"0.66638213",
"0.66638213",
"0.66638213"
] | 0.0 | -1 |
Finds Node with same key as given. It is guaranteed(due to features of adding function) to be only one such Node | private Node find(String key) {
Node now = head;
while (now != null) {
if (now.pairStringString.getKey().equals(key)) {
return now;
}
now = now.next;
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Node findKey(String key){\n Node N = front;\n while(N != null){\n if(N.key.equals(key)){\n return N; \n }\n else{\n N = N.next; \n }\n }\n return null;\n }",
"private Node _locate(Object key){\n\t\tint hashCode = key.hashCode();\r\n\t\tint bucketNum = hashCode % _numBuckets;\r\n\t\treturn _locate(key, bucketNum);\r\n\t}",
"private Node<Pair<K, V>> findItem(K key) {\n Node<Pair<K, V>> result = null;\n\n int hash1 = hash1(key);\n\n if (table[hash1] != null) {\n Node<Pair<K, V>> node = search(table[hash1].list, key);\n\n if (node != null) {\n result = node;\n }\n }\n\n int hash2 = hash2(key);\n\n if (table[hash2] != null && result == null) {\n Node<Pair<K, V>> node = search(table[hash2].list, key);\n\n if (node != null) {\n result = node;\n }\n }\n\n return result;\n }",
"public TFNode findNode(Object key) {\r\n\r\n // Search for node possibly containing key\r\n TFNode node = search(root(), key);\r\n\r\n // Note the index of where the key should be\r\n int index = FFGTE(node, key);\r\n\r\n // If the index is greater than the number of items in the node, the key is not in the node\r\n if (index < node.getNumItems()) {\r\n // Look for key in node\r\n if (treeComp.isEqual(node.getItem(index).key(), key)) {\r\n return node;\r\n }\r\n }\r\n\r\n // The search hit a leaf without finding the key\r\n return null;\r\n }",
"public RBNode<T, E> searchAndRetrieve(T key) {\r\n\t\tRBNode<T, E> c = root;\r\n\t\tRBNode<T, E> p = nillLeaf;\r\n\t\twhile (c != nillLeaf) {\r\n\t\t\t// if when comparing if it hasnt found the key go to the left\r\n\t\t\tif (key.compareTo(c.uniqueKey) < 0) {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t\t// if when comparing if it hasnt found the key go to the right\r\n\t\t\telse if (key.compareTo(c.uniqueKey) > 0) {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.rightChild;\r\n\t\t\t}\r\n\t\t\t// they are equal\r\n\t\t\telse {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn p;\r\n\t}",
"public Node getNode(String key) {\n \ttmp = first;\n \tint i;\n \tfor (i=0;i<len;i++) {\n \t\tif (tmp.key == key) {\n \t\t\treturn tmp;\n \t\t}\n \t\ttmp = tmp.getNext();\n \t}\n \treturn null;\n }",
"@Override\r\n public Object findElement(Object key) {\r\n\r\n // Search for node possibly containing key\r\n TFNode node = search(root(), key);\r\n \r\n // Note the index of where the key should be\r\n int index = FFGTE(node, key);\r\n\r\n // If the index is greater than the number of items in the node, the key is not in the node\r\n if (index < node.getNumItems()) {\r\n // Look for key in node\r\n if (treeComp.isEqual(node.getItem(index).key(), key)) {\r\n return node.getItem(index);\r\n }\r\n }\r\n\r\n // The search hit a leaf without finding the key\r\n return null;\r\n }",
"public Entry find(Object key) {\n int i = compFunction(key.hashCode());\n SList chain = buckets[i];\n try {\n for (SListNode n = (SListNode) chain.front(); n.isValidNode(); n = (SListNode) n.next()) {\n Entry e = (Entry) n.item();\n if (e.key.equals(key)) {\n return e;\n }\n }\n } catch(InvalidNodeException e) {\n System.out.println(e);\n }\n return null;\n }",
"@Override\n public Node getNodeByKey(String hashKey) {\n long key = Math.abs(Long.valueOf(hashKey));\n\n if (availableNodes.isEmpty()) {\n return null;\n }\n\n int index = (int) (key % availableNodes.size());\n Node node = availableNodes.get(index);\n if (node == null) {\n logger.error(\"failt to get hash node, the hash key:\" + hashKey);\n }\n return node;\n }",
"private SkipNode<K, V> findNode(Object key) {\n\t\tSkipNode<K, V> nodeOut;\n\t\tnodeOut = headNode;\n\t\twhile (true) {\n\t\t\twhile ((nodeOut.getNext().getKey()) != posInf\n\t\t\t\t\t&& (nodeOut.getNext().getKey()).compareTo((Integer) key) <= 0)\n\t\t\t\tnodeOut = nodeOut.getNext();\n\t\t\tif (nodeOut.getDown() != null)\n\t\t\t\tnodeOut = nodeOut.getDown();\n\t\t\telse\n\t\t\t\tbreak;\n\t\t}\n\t\treturn nodeOut;\n\t}",
"private BTNode search(BTNode btNode, DataPair key) {\n int i =0;\n while (i < btNode.mCurrentKeyNum && key.compareTo(btNode.mKeys[i]) > 0)\n i++;\n\n if (i < btNode.mCurrentKeyNum && key.compareTo(btNode.mKeys[i])==0)\n return btNode;//btNode.mKeys[i];\n if (btNode.mIsLeaf)\n return null;\n return search(btNode.mChildren[i],key);\n }",
"private Node findKey(Node R, String targetKey){ \n if(R == null || R.item.key.equals(targetKey)) return R;\n if(R.item.key.compareToIgnoreCase(targetKey)>0) return findKey(R.left, targetKey);\n else return findKey(R.right, targetKey); //(R.item.key.compareToIgnoreCase(targetKey)>0) \n }",
"public Entry find(Object key) {\r\n Entry entry_with_key = new Entry();\r\n entry_with_key.key = key; \r\n int comp_hash = compFunction(entry_with_key.key.hashCode());\r\n if (hash_table[comp_hash] == null) {\r\n return null;\r\n } else {\r\n DList searching = hash_table[comp_hash];\r\n for(Object entry: searching){\r\n if(((Entry) entry).key().equals(key)){\r\n return (Entry) entry;\r\n }\r\n }\r\n return null;\r\n \r\n }\r\n\r\n\r\n }",
"public MyNode findMyNode(Node node){\r\n\t\treturn nodesMap.get(node);\r\n\t}",
"public NodeKey createNodeKey();",
"private Node getReplacementKeyNode(Key key, Node node) {\n\t\tNode ret = node.getChild(node.getDataNumber(key));\r\n\t\t\r\n\t\twhile (!ret.isLeaf()) {\r\n\t\t\tret = ret.getChild(ret.getChildren().size() - 1);\r\n\t\t}\r\n\t\t\r\n\t\treturn ret;\r\n\t}",
"private ListNode find(K key) {\r\n\t\t\tif (key == null) throw new NullPointerException();\r\n\t\t\tListNode current = header;\r\n\t\t\twhile (current != null) {\r\n\t\t\t\tif (current.key.equals(key)) return current;\r\n\t\t\t\tcurrent = current.next;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t}",
"public Entry find(Object key) {\n int hashCode = key.hashCode();\n int index = compFunction(hashCode);\n\n if(defTable[index].isEmpty()) {\n return null;\n }\n\n Entry entry = new Entry();\n ListNode current = defTable[index].front();\n\n try{\n while(true) {\n if(((Entry) current.item()).key().equals(key)) {\n entry.key = key;\n entry.value = ((Entry) current.item()).value();\n return entry;\n }\n if(current==defTable[index].back()) {\n break;\n }\n current = current.next();\n }\n } catch(Exception err) {\n System.out.println(err);\n }\n return null;\n }",
"public Node find(int key) {\n Node current = root; // start at root\n while (current.iData != key) {\n // while no match\n if (key < current.iData)\n // go left\n current = current.leftChild;\n else\n current = current.rightChild;\n if (current == null) // if no child, didn't find it\n return null;\n }\n return current; // found it\n }",
"public NodeT getNode(String key) {\n return nodeTable.get(key);\n }",
"public Node search(K key) {\n\t\tNode currentNode = this.mRoot;\n\t\t// start from the root of the tree that calls the method\n\t\twhile (currentNode != mSentinel && key.compareTo(currentNode.getKey()) != 0) {\n\t\t\t// if the current node is not empty and its key is not equal to the\n\t\t\t// search key\n\t\t\tif (key.compareTo(currentNode.getKey()) < 0) {\n\t\t\t\tcurrentNode = currentNode.getLeftChild();\n\t\t\t\t// go left if the search key is lower\n\t\t\t} else {\n\t\t\t\tcurrentNode = currentNode.getrightChild();\n\t\t\t\t// go right if the search key is higher\n\t\t\t}\n\t\t\t// break the loop if the search key matches the node key\n\t\t}\n\t\tif (currentNode == mSentinel) {\n\t\t\treturn null;\n\t\t\t// if there is not a match return nu;;\n\t\t} else {\n\t\t\treturn currentNode;\n\t\t\t// return the first node with the same key as the search key\n\t\t}\n\t}",
"private K lookup(BSTnode<K> n, K key) {\n\t\tif (n == null) {// if key is not present\n\t\t\treturn null;\n\t\t}\n\t\tif (key.equals(n.getKey())) {// if key is present, return the match to\n\t\t\t\t\t\t\t\t\t\t// be incremented\n\t\t\treturn n.getKey();\n\t\t}\n\t\tif (key.compareTo(n.getKey()) < 0) {\n\t\t\t// key < this node's key; look in left subtree\n\t\t\treturn lookup(n.getLeft(), key);\n\t\t}\n\n\t\telse {\n\t\t\t// key > this node's key; look in right subtree\n\t\t\treturn lookup(n.getRight(), key);\n\t\t}\n\t}",
"private TFNode search(TFNode node, Object key) throws TFNodeException {\r\n\r\n // Check for empty node\r\n if (node.getNumItems() == 0) {\r\n throw new TFNodeException(\"Search discovered an empty node\");\r\n }\r\n\r\n int index = FFGTE(node, key);\r\n TFNode child = node.getChild(index);\r\n\r\n // If the node contains they key, return node\r\n if (index < node.getNumItems()) {\r\n if(treeComp.isEqual(node.getItem(index).key(), key)){\r\n return node;\r\n }\r\n }\r\n \r\n // If the node is a leaf, return node\r\n if (child == null) {\r\n return node;\r\n // If neither of the above, keep searching\r\n } else {\r\n return search(child, key);\r\n }\r\n \r\n }",
"public boolean containsKey(K key) {\r\n int hash = key.hashCode() % data.length;\r\n if (hash < 0){\r\n hash *= -1;\r\n }\r\n Node targetNode = data[hash];\r\n while (targetNode != null) {\r\n if (targetNode.key == key || targetNode.key.equals(key)) {\r\n return true;\r\n }\r\n targetNode = targetNode.next;\r\n }\r\n return false;\r\n }",
"@Override\n\tpublic boolean contains(K key) {\n\t\tNode currentNode = firstNode;\n\t\t\n\t\tif(!isEmpty()){\n\t\t\twhile(currentNode.key != key){\n\t\t\t\tif(currentNode.getNextNode() == null){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"private Node locatePrevNode(K key) { \n\t\tNode p = null; \n\t\tNode current = first; \n\t\twhile (current != null && current.getData().getKey().compareTo(key) < 0) {\n\t\t\tp = current; \n\t\t\tcurrent = current.getNext(); \n\t\t}\n\t\treturn p; \n\t}",
"protected Node<T> getNode(T key) {\n\t\tNode<T> node = root;\n\t\twhile (node != null) {\n\t\t\tif (key.compareTo(node.value) == 0) {\n\t\t\t\treturn node;\n\t\t\t} else if (key.compareTo(node.value) < 0) {\n\t\t\t\tnode = node.right;\n\t\t\t} else {\n\t\t\t\tnode = node.left;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"private Node<Pair<K, V>> search(\n BiDirectionalNullTerminatedTailedLinkedList<Pair<K, V>> list,\n K key) {\n\n for (Node<Pair<K, V>> i = list.getHead().getNext(); i != list.getTail();\n i = i.getNext()) {\n if (i.getData().key.equals(key)) {\n return i;\n }\n }\n\n return null;\n }",
"@Override\r\n\tpublic CacheTreeNode getOneRootNode(String key) {\n\t\treturn searchTreeNode(key);\r\n\t}",
"abstract K getFirstLeafKey();",
"abstract K getFirstLeafKey();",
"public GraphNode getNode(String key) {\n\treturn nodes.get(key);\n }",
"public Entry<K, V> find(K key) {\r\n try {\r\n int hash = key.hashCode();\r\n ListNode<Entry<K, V>> node = table[compFunction(hash)].front();\r\n if (node.isValidNode()) {\r\n return (Entry<K, V>) node.getItem();\r\n }\r\n } catch (Exception e) {\r\n System.out.println(\"Unhashable key: \" + e);\r\n }\r\n return null;\r\n }",
"@VisibleForTesting\n NodeKey getNodeKey() {\n return nodeKey;\n }",
"public Node search(int key) {\n\t\t\t Node node=root;\n\t while (node!= nil){\n\t if(node.id==key){\n\t \treturn node;\n\t }\n\t else if(node.id<key){\n\t \tnode=node.right;\n\t }\n\t else{\n\t \tnode=node.left;\n\t } \n\t }\n\t //key not found in the tree\n\t return nil;\n\t }",
"public Node find(int key) // find node with given key\n\t{ // (assumes non-empty tree)\n\t\tNode current = root; // start at root\n\t\tif(current == null) {\n\t\t\treturn null;\n\t\t}\n\t\twhile(current.iData != key) // while no match,\n\t\t{\n\t\t\tif(key < current.iData) // go left?\n\t\t\t\tcurrent = current.leftChild;\n\t\t\telse // or go right?\n\t\t\t\tcurrent = current.rightChild;\n\t\t\tif(current == null) // if no child,\n\t\t\t\treturn null; // didn't find it\n\t\t}\n\t\treturn current; // found it\n\t}",
"private RadixTree find(Signature key) {\n if (key.isEmpty()) {\n return this;\n } else {\n for (Signature label : children.keySet()) {\n if (label.equals(key)) {\n return children.get(label);\n } else if (label.isPrefix(key)) {\n RadixTree child = children.get(label);\n int len = label.size();\n return child.find(key.suffix(len));\n }\n }\n }\n\n return null;\n }",
"private TFNode findIoS(TFNode node, Object key) {\r\n if (node.getChild(0) != null) {\r\n // Go right once\r\n node = node.getChild(FFGTE(node, key) + 1);\r\n\r\n // Then go left all the way to the bottom\r\n while (node.getChild(0) != null) {\r\n node = node.getChild(0);\r\n }\r\n }\r\n return node;\r\n }",
"Node findLoopByHash(Node n){\n Hashtable<Node,Integer> nodes = new Hashtable<Node,Integer>();\n while (n.next != null){\n if (nodes.containsKey(n)) break;\n nodes.put(n,1);\n n=n.next;\n }\n if (n.next != null) return n;\n return null;\n }",
"private boolean itsRepeated(BTreeNode<T> currentNode, I id) {\n\n for (int i = 0; i < 5; i++) {\n if (currentNode.getKey(i) != null) {\n if (comparator.compare(currentNode.getKey(i), id) == 0) {\n return true;\n }\n }\n }\n\n return false;\n }",
"private Node _locate(Object key, int bucketNum){\n\t\tNode bucketList = _buckets[bucketNum];\r\n\t\twhile(bucketList != null)\r\n\t\t{\r\n\t\t\tif(key == bucketList._key){\t\t\t\t// If the key matches the key of the current node\r\n\t\t\t\tbreak;\t\t\t\t\t\t\t\t// in bucketList, then return the bucketList.\r\n\t\t\t}\r\n\t\t\tbucketList = bucketList._nextNode;\t\t// Otherwise move to the next node.\r\n\t\t}\r\n\t\treturn bucketList;\r\n\t}",
"public RBNode<T> search(T key) {\r\n return search1(key);\r\n//\t\treturn search2(root, key); //recursive version\r\n }",
"@Nullable IStrongSlot find(LuaValue key);",
"private int locate(Key key) {\n\t\tint index = hash(key);\n\t\twhile(this.keys[index] != null && !this.keys[index].equals(key)) {\n\t\t\tindex = increment(index);\n\t\t}\n\t\treturn index;\n\t}",
"protected TSTNode<E> getOrCreateNode(String key) throws NullPointerException, IllegalArgumentException {\n if(key == null) throw new NullPointerException(\"attempt to get or create node with null key\");\n if(key.length() == 0) throw new IllegalArgumentException(\"attempt to get or create node with key of zero length\");\n if(rootNode == null) rootNode = new TSTNode<E>(key.charAt(0), null);\n \n TSTNode<E> currentNode = rootNode;\n int charIndex = 0;\n while(true) {\n int charComp = compareCharsAlphabetically(key.charAt(charIndex), currentNode.splitchar);\n\n if (charComp == 0) {\n charIndex++;\n if(charIndex == key.length()) return currentNode;\n if(currentNode.relatives[TSTNode.EQKID] == null) currentNode.relatives[TSTNode.EQKID] = new TSTNode<E>(key.charAt(charIndex), currentNode);\n\t\tcurrentNode = currentNode.relatives[TSTNode.EQKID];\n } else if(charComp < 0) {\n if(currentNode.relatives[TSTNode.LOKID] == null) currentNode.relatives[TSTNode.LOKID] = new TSTNode<E>(key.charAt(charIndex), currentNode);\n currentNode = currentNode.relatives[TSTNode.LOKID];\n } else { \n // charComp must be greater than zero\n if(currentNode.relatives[TSTNode.HIKID] == null) currentNode.relatives[TSTNode.HIKID] = new TSTNode<E>(key.charAt(charIndex), currentNode);\n currentNode = currentNode.relatives[TSTNode.HIKID];\n }\n }\n }",
"private Node getReference(DNA key) {\n int hash = key.hashCode();\n if(this.debug)\n System.out.println(\"ExtHash::getReference >> buscando: \" + hash);\n\n Node actual_node = this.tree_reference;\n int shift = 0;\n if(this.debug)\n System.out.println(\"ExtHash::getReference >> camino en el arbol:\");\n\n while(!actual_node.hasReference()) {\n if(shift >= 30) {\n if(this.debug)\n System.out.println(\"ExtHash::getReference >> limite de busqueda\");\n break;\n }\n\n if(this.debug)\n System.out.println(\" \" + (hash & (1 << shift)));\n\n if((hash & (1 << shift)) == 0) {\n actual_node = actual_node.getLeftNode();\n } else {\n actual_node = actual_node.getRightNode();\n }\n shift++;\n\n }\n if(this.debug)\n System.out.println(\"ExtHash::getReference >> fin de busqueda\");\n\n return actual_node;\n\n }",
"public boolean search(T key) {\r\n\t\tRBNode<T, E> c = root;\r\n\t\twhile (c != nillLeaf) {\r\n\t\t\t// If Node is less than the current Node then go left.\r\n\t\t\tif (key.compareTo(c.uniqueKey) < 0) {\r\n\t\t\t\t// we go left\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t\t// If Node is bigger than the current Node then go right.\r\n\t\t\telse if (key.compareTo(c.uniqueKey) > 0) {\r\n\t\t\t\t// we go right\r\n\t\t\t\tc = c.rightChild;\r\n\t\t\t}\r\n\t\t\t// Else they are equal\r\n\t\t\telse {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// OtherWise return false, it doesnt exist.\r\n\t\treturn false;\r\n\t}",
"public node_info getNode(int key)\n{\n\treturn getNodes().get(key);\n\t\n}",
"public MutableCachedNode mutable( NodeKey key ) throws NodeNotFoundException, UnsupportedOperationException;",
"public Node namedItem(final String key) {\n final int length = getLength();\n for (int i = 0; i < length; i++) {\n final Node n = item(0);\n if (n instanceof Element) {\n final Element element = (Element) n;\n if (key.equals(element.getAttribute(\"id\")) || key.equals(element.getAttribute(\"name\"))) {\n return n;\n }\n }\n\n }\n return null;\n }",
"private Element getElementByKeyRef(Node node) {\n\t\tElement ref ;\n\t\t\t\n\t\tString refType = getDocumentXpath(node);\n\t\tSystem.out.println(\"search ref for : \"+refType);\n\t\t/* get ref attribute */\n\t\tString refId = node.getTextContent();\n\t\tif (refId == null || refId.equals(\"\")){ \n\t\t\tfor (int i = 0; i< node.getAttributes().getLength(); i++) {\n//\t\t\t\tSystem.out.println(node.getAttributes().item(i).getNodeName()+\" :: \"+node.getAttributes().item(i).getTextContent());\n\t\t\t\tif (node.getAttributes().item(i).getNodeName().equals(refAttribute)){\n\t\t\t\t\t\trefId = node.getAttributes().item(i).getNodeValue();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tString referedType = (String) refType2referedType.get(refType)\t;\t\n\t\t\n\t\tref = (Element) xsKeyNodes.get(referedType+\"#\"+refId);\t\t\n\t\treturn ref;\n\t}",
"public DataItem find(int key){\n\t\tint hashVal = hashFunc(key);\n\t\tint stepSize = hashFunc2(key);\n\t\twhile(hashArray[hashVal] != null){\n\t\t\tif(hashArray[hashVal].getKey() == key){\n\t\t\t\tDataItem temp = hashArray[hashVal]; //find the item\n\t\t\t\treturn temp;\n\t\t\t}\n\t\t\thashVal += stepSize;\n\t\t\thashVal %= arraySize;\n\t\t}\n\t\treturn null;\n\t}",
"public static <K,V> ItemNode<K,V> search(ItemNode<K,V> node, K k) {\n while (node != null && !k.equals(node.k))\n node = node.next;\n return node;\n }",
"public E find(K key){\n\t\tE output= null;\n\t\t\n\t\tint i = 0;\n\t\twhile (i<keys.length && output == null){\n\t\t\tif(keys[i] != null && keys[i].equals(key))\n\t\t\t\toutput = elem[i];\n\t\t\ti = i + 1;\n\t\t}\n\t\treturn output;\n\t}",
"public void addNode(int key)\n{\n Node n1 = new Node(key);\n\t\n\tif(!getNodes().containsKey(n1.getKey())) \n\t{\n\tmc++;\n\tthis.getNodes().put(n1.getKey(),n1);\n\t\t\n\t}\n\telse {\n\t\treturn;\n\t\t//System.out.println(\"Node already in the graph\");\n\t}\n}",
"public Integer search(Integer currentLine, int key) {\r\n\t\t//Key was found or there is not \r\n\t\t//any new Node to search\r\n\t\tif(increaseCompares() && (currentLine==-1 || key==getKey(currentLine))) {\r\n\t\t\treturn currentLine;\r\n\t\t}\r\n\t\t//Get left subtree for searching\t\r\n\t\tif(increaseCompares() && key<getKey(currentLine)) {\r\n\t\t\treturn search(getLeft(currentLine),key);\r\n\t\t}\r\n\t\t//Get right subtree for searching\r\n\t\telse {\r\n\t\t\treturn search(getRight(currentLine),key);\r\n\t\t}\r\n\t\t\r\n\t}",
"public V get(K key) {\r\n int hash = key.hashCode() % data.length;\r\n if (hash < 0){\r\n hash *= -1;\r\n }\r\n V result = null;\r\n if (data[hash] != null) {\r\n Node currentNode = data[hash];\r\n while (currentNode != null) {\r\n if (currentNode.key == key || currentNode.key.equals(key)) {\r\n result = (V) currentNode.value;\r\n }\r\n currentNode = currentNode.next;\r\n }\r\n }\r\n return result;\r\n }",
"public static Node find(Node node, int search_key){\n if(node!=null){ // node ที่รับมาต้องมีตัวตน\n if (search_key== node.key){ //ถ้าเจอ node ที่ตามหา ส่งค่าออกไป\n return node;\n }\n else if (search_key > node.key) { //ถ้า search_key มากกว่า node.key ตอนนี้ แสดงว่า อยู่ทางด้านขวา\n return find(node.right,search_key); // recursive โดยส่ง right-subtree\n }\n else{\n return find(node.left,search_key); // recursive โดยส่ง left-subtree\n }\n }\n else return null;\n\n }",
"protected TSTNode<E> getNode(String key, TSTNode<E> startNode) {\n if(key == null || startNode == null || key.length() == 0) return null;\n TSTNode<E> currentNode = startNode;\n int charIndex = 0;\n \n while(true) {\n if (currentNode == null) return null;\n int charComp = compareCharsAlphabetically(key.charAt(charIndex), currentNode.splitchar);\n \n if (charComp == 0) {\n charIndex++;\n if(charIndex == key.length()) return currentNode;\n currentNode = currentNode.relatives[TSTNode.EQKID];\n } else if(charComp < 0) {\n currentNode = currentNode.relatives[TSTNode.LOKID];\n } else { \n // charComp must be greater than zero\n currentNode = (TSTNode<E>)currentNode.relatives[TSTNode.HIKID];\n }\n }\n }",
"public String lookup(String key){\n Node N = front;\n while( N != null){\n if( N.key.equals(key)){\n return N.value;\n }\n N = N.next;\n }\n return null;\n }",
"@Override\n public node_data getNode(int key) {\n return nodes.get(key);\n }",
"@Override\n\tpublic node_data getNode(int key) {\n\n\t\treturn this.Nodes.get(key);\n\n\t}",
"@Override\r\n protected Node getStoringNode(Integer key) {\r\n return getNetworkNode();\r\n }",
"N getNode(int id);",
"public Key removeFirst(){\n\t\tKey key = firstNode.key;\n\t\tfirstNode = firstNode.next;\n\t\treturn key;\n\t}",
"public Object lookup(String key){\n ListNode<String,Object> temp = getNode(key);\n if(temp != null)\n return temp.value;\n else\n return null;\n }",
"Object getKey();",
"public TreeNode findCommonAncestor(TreeNode node, int key1, int key2){\n\t\tif(node == null) return null;\n\t\tif(node.val == key1 || node.val == key2) return node;\n\n\t\tTreeNode n1 = node.left != null ? findCommonAncestor(node.left, key1, key2) : null;\n\t\tTreeNode n2 = node.right != null ? findCommonAncestor(node.right, key1, key2) : null;\n\n\t\treturn (n1 != null && n2 != null) ? node : (n1 != null ? n1 : n2);\n\t}",
"private Node searchAux(Node tree, K key) {\n if(root == null) { return null; } //empty tree\n int cmp = key.compareTo(tree.key);\n if(cmp == 0 || cmp < 0 && tree.left == null || cmp > 0 && tree.right == null) { //found the node or last checked\n comparisons += 1;\n return tree;\n }\n if(cmp < 0) {\n comparisons += 1;\n return searchAux(tree.left, key);\n } else {\n comparisons += 1;\n return searchAux(tree.right, key);\n }\n }",
"private Node<T> searchRecursively(Node<T> node, T value) {\n\n // If the key is less than that of the current node, calls this method again with the current node's\n // left branch as the new node to compare keys with.\n if (value.compareTo(node.getValue()) == -1) {\n node = node.getLeft();\n return searchRecursively(node, value);\n }\n\n // Otherwise, calls the method again, comparing with the current node's right branch.\n else if (value.compareTo(node.getValue()) == 1) {\n node = node.getRight();\n return searchRecursively(node, value);\n }\n\n // If the current node contains the key, returns this node.\n return node;\n }",
"public String getNodeKey() {\n return nodeKey;\n }",
"private AccessPath findNode(Node n, HashSet s) {\n for (Iterator i = this.succ.iterator(); i.hasNext(); ) {\n IdentityHashCodeWrapper ap = (IdentityHashCodeWrapper)i.next();\n if (!s.contains(ap)) {\n AccessPath p = (AccessPath)ap.getObject();\n if (n == p._n) return p;\n s.add(ap);\n AccessPath q = p.findNode(n, s);\n if (q != null) return q;\n }\n }\n return null;\n }",
"public NodeKey createNodeKeyWithIdentifier( String identifier );",
"public int findNext(Node root, int key){\n\t\tint res = key;\n\t\twhile(root != nil){\n\t\t\tif(root.id <= key){\n\t\t\t\troot = root.right;\n\t\t\t}\n\t\t\tif(root != nil && root.id > key){\n\t\t\t\tres = root.id;\n\t\t\t\troot=root.left;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn res;\n\t}",
"TMNodeModel nodeContaining(TMNode node) {\n if (this.node == node) {\n return this;\n } else {\n return null;\n }\n }",
"public static <K,V> boolean search(ItemNode<K,V> node, K k, Holder<V> old) {\n while (node != null) \n if (k.equals(node.k)) {\n if (old != null) \n old.set(node.v);\n return true;\n } else \n node = node.next;\n return false;\n }",
"public Value get(Key key) {\n if (key == null) {\n return null;\n }\n if(first.key.compareTo(key) == 0) {\n return update(first);\n }\n Node recentNode = first;\n while(recentNode != null) {\n if (recentNode.next.key.compareTo(key) == 0) {\n return update(recentNode);\n }\n recentNode = recentNode.next;\n }\n return null;\n }",
"public V find(K key) {\n Node<K,V> node = root;\n while (node != null) {\n int cmp = key.compareTo(node.key);\n if (cmp < 0) {\n node = node.left;\n } else if (cmp > 0) {\n node = node.right;\n } else {\n return node.value;\n }\n }\n return null;\n }",
"public BTreeNode search(long key) {\n\t\treturn searcher(root, key);\n\t}",
"@Override\n public boolean search(K key) {\n if (rootNode == null)\n return false;\n try {\n return exist(key, rootNode);\n } catch (IllegalArgumentException e) {\n System.out.println(e.getMessage());\n return false;\n }\n }",
"T key();",
"public static Node findNodeById(ConcurrentHashMap<String, Node> idIndex, String id, Logger logger) {\n\t\tNode foundNode = idIndex.get(id);\n\n\t\tif (foundNode == null) {\n\t\t\tlogger.warning(\"WARNING: COULD NOT FIND NODE WITH ID = \" + id + \". HREF IGNORED...\");\n\t\t\treturn null;\n\t\t}\n\n\t\treturn foundNode;\n\n\t\t// ArrayList<Node> foundNodes = new ArrayList<Node>();\n\t\t//\n\t\t// Iterator<Entry<String, Node>> it = idIndex.entrySet().iterator();\n\t\t// while (it.hasNext()) {\n\t\t// Map.Entry<String, Node> pair = (Map.Entry<String, Node>) it.next();\n\t\t//\n\t\t// if (pair.getKey().equals(id)) {\n\t\t// foundNodes.add(pair.getValue());\n\t\t// it.remove();\n\t\t// break;\n\t\t// }\n\t\t// }\n\t\t//\n\t\t// // for (Node n : idIndex.query(\"id\", id)) {\n\t\t// // foundNodes.add(n);\n\t\t// // }\n\t\t//\n\t\t// switch (foundNodes.size()) {\n\t\t// case 0:\n\t\t// logger.warning(\"WARNING: COULD NOT FIND NODE WITH ID = \" + id);\n\t\t// return null;\n\t\t// case 1:\n\t\t// return foundNodes.get(0);\n\t\t// case 2:\n\t\t// if (foundNodes.get(0).getId() < foundNodes.get(1).getId()) {\n\t\t// if (isOld) {\n\t\t// return foundNodes.get(0);\n\t\t// }\n\t\t// return foundNodes.get(1);\n\t\t// } else {\n\t\t// if (isOld) {\n\t\t// return foundNodes.get(1);\n\t\t// }\n\t\t// return foundNodes.get(0);\n\t\t// }\n\t\t// default:\n\t\t// logger.warning(\"WARNING: MULTIPLE NODES HAVE THE SAME ID = \" + id);\n\t\t// return null;\n\t\t// }\n\t}",
"public ElectionTable.ElectionNode searchElection(String key){\n int chain=hashFunction(key);\r\n if (electionTable[chain] !=null) {\r\n System.out.println(\"found Election!!!\");\r\n return electionTable[chain];\r\n } else {\r\n System.out.println(\"not found Election!!!\");\r\n return null;\r\n }\r\n }",
"private int findIndexKey(BTreeNode<T> currentNode, I id) {\n for (int i = 0; i < 5; i++) {\n T tempKey = currentNode.getKey(i);\n if (tempKey != null) {\n if (comparator.compare(tempKey, id) == 0) {\n return i;\n }\n }\n }\n return -1;\n }",
"private Node getNodeWithID(int ID)\r\n {\r\n Node currentNode = first_node;\r\n boolean found = false;\r\n\r\n while(!found && currentNode != null)\r\n {\r\n if(ID == currentNode.getData().getStudent_ID())\r\n {\r\n found = true;\r\n }\r\n else\r\n {\r\n currentNode = currentNode.getNextNode();\r\n }\r\n }\r\n return currentNode;\r\n }",
"public Node<E> getPresentNode(E data){\n for(Node<E> node: nodes.keySet()){\n if(node.data.equals(data)){\n return node;\n }\n }\n return null;\n }",
"@Override\n\tpublic Node findChild(byte partialKey) {\n\t\tpartialKey = BinaryComparableUtils.unsigned(partialKey);\n\t\tfor(int i = 0; i < noOfChildren; i++){\n\t\t\tif(keys[i] == partialKey){\n\t\t\t\treturn children[i];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"private Node getChild(char key) {\n for (Node child : children) {\n if (child.getKey() == key) {\n return child;\n }\n }\n return null;\n }",
"public boolean search(String key){\n DataPair dp = getDataPair(key);\n BTNode out=null;\n if (dp != null)\n out = search(dp);\n return out != null;\n }",
"private int nextNode(int rid) {\n if (!my_game.getMy_game().isRunning()) {\n return -1;\n }\n Robot robot = my_game.getRobots().get(rid);\n List<node_data> tmp = robots_paths.get(rid);\n if (tmp.isEmpty()) {\n fruits_status.remove(rid);\n synchronized (my_game.getFruits()) {\n if (my_game.getFruits().size() > 0) {\n Fruit fruit = findClosestFruit(robot);\n tmp = algo_g.shortestPath(robot.getSrc(),fruit.getEdge().getSrc());\n node_data dest = my_game.getGraph().getNode(fruit.getEdge().getDest());\n tmp.add(dest);\n robots_paths.put(robot.getId(),tmp);\n fruits_status.put(rid,fruit);\n }\n }\n }\n\n node_data n = tmp.get(0);\n tmp.remove(0);\n return n.getKey();\n\n\n// for (int i = 0; i < tmp.size(); i++) {\n// node_data n = tmp.get(i);\n// tmp.remove(i);\n// if (n.getKey() == robot.getSrc())\n// continue;\n// return n.getKey();\n// }\n// return -1;\n }",
"public int find(K key){\r\n int k =0;\r\n int ik;\r\n while(true){\r\n ik = getIndex(k,key);\r\n if(hashTable[ik] == null || hashTable[ik].equals(key))\r\n return ik;\r\n else if(hashTable[ik].isDeleted){ // deleted\r\n break;\r\n }else{\r\n k++;\r\n }\r\n }\r\n int xspot = ik;\r\n while(true){\r\n k++;\r\n if(hashTable[ik]!=null && hashTable[ik].equals(key)){\r\n return ik;\r\n }\r\n if(hashTable[ik] == null){\r\n return xspot;\r\n }\r\n }\r\n }",
"public Node searchElement(Object el) {\n\t\n\t\tfor (Node elemento : this.set) {\n\t\t\tif(elemento.getElemento().equals(el)) {\n\t\t\t\treturn elemento;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public TreeNode find(Integer searchKey) {\n\t\treturn root.find(searchKey);\n\t}",
"public Value get(Key key) {\n\t\tNode node = current_node;\n\t\twhile(!node.key.equals(key)) node = node.next;\n\t\treturn node.value;\n\t}",
"public boolean contains(int key) {\n int i = index(key);\n if(nodes[i] == null) {\n \treturn false;\n }\n Node prev = find(nodes[i], key);\n if(prev.next == null) {\n \treturn false;\n }\n return true;\n }",
"<O> N getNode(Function<N, O> map, O value);",
"public Key lowestCommonAncestor (Node node, Key key1, Key key2){\n \t\tif (node == null)\n return null;\n \t\tif (node.key == key1) {\n \t\t\treturn node.key;\n \t\t}\n \t\tif (node.key == key2) {\n \t\t\treturn node.key;\n \t\t}\n \t\tint cmp1 = node.key.compareTo(key1);\n \t\tint cmp2 = node.key.compareTo(key2);\n \t\t\n if (cmp1 >= 0 && cmp2 >= 0)\n return lowestCommonAncestor(node.left, key1, key2);\n \n if (cmp1 <= 0 && cmp2 <= 0)\n return lowestCommonAncestor(node.right, key1, key2);\n \n return node.key;\n \t}",
"private Node getNode(String n1)\n\t{\n\t\tif (n1 == null) throw new RuntimeException(\"Attempt to add null node\");\n\t\tif (nodes.containsKey(n1)) return nodes.get(n1);\n\t\tnodes.put(n1, new Node(n1));\n\t\treturn nodes.get(n1);\n\t}",
"void removeNode(NodeKey key);",
"public AccessPath findNode(Node n) {\n if (n == this._n) return this;\n HashSet visited = new HashSet();\n IdentityHashCodeWrapper ap = IdentityHashCodeWrapper.create(this);\n visited.add(ap);\n return findNode(n, visited);\n }"
] | [
"0.7201896",
"0.69900155",
"0.6879394",
"0.6788562",
"0.67806566",
"0.6683711",
"0.6674871",
"0.66533554",
"0.6653329",
"0.65583366",
"0.64493096",
"0.64205563",
"0.6380865",
"0.6360142",
"0.63531184",
"0.6321301",
"0.6319908",
"0.63071066",
"0.6288115",
"0.6286384",
"0.6258685",
"0.6236971",
"0.62203926",
"0.62174445",
"0.6203259",
"0.61700386",
"0.6170021",
"0.6169284",
"0.61504275",
"0.6143472",
"0.6143472",
"0.6142403",
"0.61422527",
"0.613159",
"0.6124852",
"0.61103475",
"0.608555",
"0.60448885",
"0.6044362",
"0.60238636",
"0.60194904",
"0.6009045",
"0.6004589",
"0.5994254",
"0.5992362",
"0.59874487",
"0.5984145",
"0.59790784",
"0.59674084",
"0.59569037",
"0.5945346",
"0.59348935",
"0.59142685",
"0.5913925",
"0.5906362",
"0.5855123",
"0.5847372",
"0.58471674",
"0.5841985",
"0.5841297",
"0.58357924",
"0.58292013",
"0.5827631",
"0.58246744",
"0.5819405",
"0.58119416",
"0.5793521",
"0.57790804",
"0.5774175",
"0.57735026",
"0.57704324",
"0.57694536",
"0.5756176",
"0.5754454",
"0.5752388",
"0.57492036",
"0.57406217",
"0.57329255",
"0.5725354",
"0.5724719",
"0.57094014",
"0.5704769",
"0.5694794",
"0.56837946",
"0.5679612",
"0.5679285",
"0.5673154",
"0.56717706",
"0.5668473",
"0.5658776",
"0.5658179",
"0.5651746",
"0.56299275",
"0.56276053",
"0.5622742",
"0.5619233",
"0.5617593",
"0.5617136",
"0.5616112",
"0.5613205"
] | 0.71859974 | 1 |
Checks whether given key appears in List. | public boolean contains(String key) {
return find(key) != null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean contains(Key key);",
"public boolean contains(String key);",
"public boolean containsKey(Key key) ;",
"public boolean contains(K key);",
"public boolean contains( T key )\n {\n if (key == null) return false;\n for ( int i=0 ; i < size() ; ++i )\n if ( get(i).equals( key ) ) \n return true;\n \n return false;\n }",
"public boolean contains(String key) {\n\t\treturn recContains(head, key);\n\t}",
"public boolean containsKey(String key);",
"public boolean contains(String key)\r\n { return get(key) != null; }",
"boolean contains(String key);",
"boolean contains(String key);",
"public boolean contains(long key){\n for (int i = 0; i < numKeys; i++){\n if (keys[i].key == key){\n return true;\n }\n }\n return false;\n }",
"boolean contains(KeyType key);",
"public boolean contains(String key){\r\n\t\treturn get(key) != null;\r\n\t}",
"public boolean contains (String key) {\r\n int arrIndex = hash(key);\r\n\r\n if (hashTableArray[arrIndex] == null) {\r\n hashTableArray[arrIndex] = new LinkedList<>();\r\n }\r\n\r\n for (int i = 0; i < hashTableArray[arrIndex].size(); i++) {\r\n if (hashTableArray[arrIndex].get(i).key.equals(key)){\r\n return true; // returns true when a key already exists\r\n }\r\n }\r\n return false; // returns false when a key does not yet exist\r\n }",
"@Override\n\tpublic boolean contains(String key) {\n\t\tint hashVal = hashFunc(key);\n\t\twhile (hashArray[hashVal] != null) {\n\t\t\tif (hashArray[hashVal].value.equals(key))\n\t\t\t\treturn true;\n\t\t\telse {\n\t\t\t\thashVal++;\n\t\t\t\thashVal = hashVal % size;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public boolean contains(Key key) {\n return get(key) != null;\n }",
"public boolean contains(int key) {\n Entry tab[] = table;\n int index = (key & 0x7FFFFFFF) % tab.length;\n for (Entry e = tab[index]; e != null; e = e.next) {\n if (e.key == key) {\n return true;\n }\n }\n return false;\n }",
"public boolean contains(Key key) {\n\t\treturn get(key) != null;\n\t}",
"boolean containsKey(CoreLabel key);",
"public boolean contains(int key) {\n int hash = key % 7919;\n if (table[hash] == null)\n {\n return false;\n }\n else\n {\n ArrayList<Integer> al = table[hash].al;\n int size = al.size();\n for (int i = 0; i < size; ++i)\n {\n if (al.get(i) == key)\n {\n return true;\n }\n }\n return false;\n }\n }",
"public boolean containsKey(String key) {\n\t\tint HashKey = key.hashCode() % 31;\r\n\t\tif (HashKey > K.length - 1) {\r\n\t\t\twhile (HashKey > K.length - 1) {\r\n\t\t\t\tHashKey %= K.length;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (K[HashKey] == null) {\r\n\t\t\t// LinkedList not exist\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tfor (String c : K[HashKey]) {\r\n\t\t\tif (c.equals(key)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"boolean has(String key);",
"@Override\n public boolean containsKey(Object key) {\n LinkedList<Entry> tempBucket = chooseBucket(key);\n \n for(int i=0;i<tempBucket.size();i++) {\n \t\tEntry tempEntry = tempBucket.get(i);\n \t\t\n \t\tif(tempEntry.getKey() == key) {\n \t\t\treturn true;\n \t\t}\n \t}\n \n return false;\n }",
"public boolean contains(int key) {\n int h = hash(key);\n Iterator<Integer> iterator = data[h].iterator();\n while (iterator.hasNext()) {\n Integer element = iterator.next();\n if (element == key) {\n return true;\n }\n }\n return false;\n }",
"public boolean contains(K key){\r\n int loc = find(key);\r\n if((hashTable[loc]!= null) && hashTable[loc].equals(key))\r\n return true;\r\n else\r\n return false;\r\n }",
"public boolean contains (String key)\n {\n use (key);\n return map.containsKey (key);\n }",
"boolean containsKey(K key);",
"boolean containsKey(K key);",
"private boolean contains(String key) {\n return contains(dict, key);\n }",
"public boolean containsKey(K key) {\n\t\t\n\t\t\n\t\treturn keySet.contains(key);\n }",
"public boolean contains(String key) {\r\n\t\treturn getValue(key) != null;\r\n\t}",
"public boolean containsKey(int key) {\n return getElement(key) != null;\n }",
"public boolean containsKey(K key)\n {\n AssociationList<K, V> bucket = this.get(this.find(key));\n return (bucket != null) && (bucket.containsKey(key));\n }",
"@Override\n public boolean contains(Comparable k) {\n\n // Loop over items and check\n for (int i = 0; i < this.size; i++) {\n if (ls[i].key.equals(k)) {\n return true;\n }\n }\n\n // Return false if not found\n return false;\n }",
"boolean hasKey(String key);",
"public boolean containsKey(String key) {\n\t\treturn containsKey(entries, key);\n\t}",
"public boolean contains(int key) {\n \tfor(int k:set){\n \tif(k==key){\n \t\treturn true;\n \t}\n }\n\t\treturn false;\n }",
"public boolean contains(K key) \n {\n boolean result = false;\n int keyIndex = locateIndex(key);\n if ((keyIndex < numberOfEntries) && \n key.equals(dictionary[keyIndex].getKey()))\n result = true;\n return result;\n }",
"@Override\r\n public boolean containsKey(KeyType key) {\r\n\r\n int index = Math.abs(key.hashCode()) % this.capacity;\r\n\r\n // if the index is within the array of linked lists, the array of linked lists exists, and there\r\n // is a Linked list object at the specified index\r\n if (index < this.capacity && index >= 0 && array[index] != null && array != null) {\r\n\r\n \r\n for (int i = 0; i < array[index].size(); i++) {\r\n\r\n\r\n if (array[index].get(i).getTitle().equals(key)) {\r\n \r\n return true;\r\n \r\n }\r\n \r\n }\r\n \r\n }\r\n \r\n return false;\r\n }",
"@Override\r\n\tpublic boolean containsKey(Object key) {\r\n\t\tif (key == null) throw new NullPointerException();\r\n\t\treturn get(key) != null;\r\n\t}",
"public boolean contains(int key) {\n int h=hash(key);\n if(arr[h]!=null)\n return arr[h].contains(key);\n return false;\n }",
"public boolean contains(String key) {\n\t\treturn serialNumber.contains(key);\n\t}",
"@Override\n\tpublic boolean contains(K key) {\n\t\treturn false;\n\t}",
"public boolean isList(String key)\n {\n return getList(key, null) != null;\n }",
"public boolean contains(int key) {\n\t\tint index = getIndex(key);\n\t\tint pos = getPos(key, index);\n\t\treturn pos >= 0;\n\t}",
"public boolean containsKey(Object key) {\r\n\t\tif (key == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tint slotIndex = Math.abs(key.hashCode()) % table.length;\r\n\r\n\t\tif (table[slotIndex] == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tTableEntry<K, V> currentElement = table[slotIndex];\r\n\r\n\t\tdo {\r\n\t\t\tif (currentElement.key.equals(key)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\tcurrentElement = currentElement.next;\r\n\t\t} while (currentElement != null);\r\n\r\n\t\treturn false;\r\n\t}",
"public boolean contains(int key) {\n if(entry[hashCode(key)]==null) return false;\n return entry[hashCode(key)].contains(key);\n }",
"public boolean contains(K key)\n\t{\n\t\tcheckForNulls(key);\n\t\tint n = Math.abs(key.hashCode() % entries.length);\n\t\t\n\t\treturn (entries[n] == null) ? false : entries[n].contains(new Entry(key, null));\n\t}",
"public boolean contains(int key) {\n return s.contains(key);\n }",
"final boolean hasKey(final E key) {\r\n for (int i=0;i<kcount;i++) {\r\n if (equal(key, (E)k[i])) return true;\r\n }\r\n return false;\r\n }",
"boolean containsKey(long key);",
"public abstract boolean containsKey(K key);",
"public boolean containsKey(K key) {\n return keys[findIndex(key)] != null;\n }",
"protected static boolean hasEntryInList(String key, String entry) {\n String entries = getSPreference(key);\n if (TextUtils.isEmpty(entries))\n return false;\n\n for (String e: entries.split(\":\"))\n if (e.equalsIgnoreCase(entry))\n return true;\n\n return false;\n }",
"public boolean isKeyInMap(String key) {\r\n\t\treturn wikiList.containsKey(key);\r\n\t}",
"@Override\n public boolean containsKey(Object key) {\n return entries.containsKey(key);\n }",
"public boolean containsKey(K key) {\r\n int hash = key.hashCode() % data.length;\r\n if (hash < 0){\r\n hash *= -1;\r\n }\r\n Node targetNode = data[hash];\r\n while (targetNode != null) {\r\n if (targetNode.key == key || targetNode.key.equals(key)) {\r\n return true;\r\n }\r\n targetNode = targetNode.next;\r\n }\r\n return false;\r\n }",
"public boolean existsKey(String inKey);",
"boolean exists(Integer key);",
"public native Boolean has(K key);",
"public boolean containsKey(Object key) {\n\t\treturn false;\r\n\t}",
"@Override\r\n\tpublic boolean exists(T key) {\r\n\t\treturn existsRec(raiz, key);\r\n\t}",
"public boolean containsKey(K key)\r\n\t{\r\n\t\tint slot = findSlot(key, false);\r\n\t\treturn slot >= 0;\r\n\t}",
"@Override\n\t\t\tpublic boolean contains(String key) {\n\t\t\t\treturn false;\n\t\t\t}",
"public boolean containsKey(K key)\r\n\t{\r\n\t\treturn data.contains(new Entry(key,null));\r\n\t}",
"public boolean contains(int key) {\n int index = getIndex(key);\n int index2 = getIndex2(key);\n if(buckets[index] != null){\n return buckets[index][index2] == true; \n }\n return false;\n }",
"@Override\n\tpublic boolean contains(K key) {\n\t\tNode currentNode = firstNode;\n\t\t\n\t\tif(!isEmpty()){\n\t\t\twhile(currentNode.key != key){\n\t\t\t\tif(currentNode.getNextNode() == null){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public boolean containsKey(String key) {\n int index = hashOf(key);\n return index < capacity && values[index] != null;\n }",
"public boolean contains(Key k) {\n\t\tfor (Key l: this){\n\t\t\tif (l == k)\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public boolean contains(Key key) {\n return auxContains(root, key);\n }",
"public boolean containsKey(String key)\n\t{\n\t\tverifyParseState();\n\t\treturn values.containsKey(key);\n\t}",
"@Override\n public boolean contains(String key) {\n if (key == null) {\n throw new IllegalArgumentException(\"argument to contains() is null\");\n }\n return get(root, key, 0) != null;\n }",
"private boolean mapContainsList(HashMap<String,String[]> map, List<String> list){\n\t\tboolean flag = true;\n\t\tSet<String> mapKeys = map.keySet();\n\t\tfor(String temp : list){\n\t\t\tif(!mapKeys.contains(temp)){\n\t\t\t\tflag = false;\n\t\t\t\treturn flag;\n\t\t\t}\n\t\t}\n\t\treturn flag;\n\t}",
"public boolean contains(int key) {\n int i = index(key);\n if(nodes[i] == null) {\n \treturn false;\n }\n Node prev = find(nodes[i], key);\n if(prev.next == null) {\n \treturn false;\n }\n return true;\n }",
"public boolean containsKey(DNA key){\n Node actual_node = this.getReference(key);\n\n if(this.debug)\n System.out.println(\"ExtHash::containsKey >> buscando cadena: \" + key.toString() + \", hashCode: \" + key.hashCode());\n\n int reference_page = actual_node.getReference(), hash = key.hashCode();\n ArrayList<Integer> content = this.fm.read(reference_page); this.in_counter++;\n\n boolean res = false;\n\n while(true) {\n int cant = content.get(0);\n\n for(int i=1; i<=cant; i++) {\n if(content.get(i) == hash) {\n res = true;\n }\n }\n\n if(res)\n break;\n\n if(content.size() != B)\n break;\n\n reference_page = content.get(B-1);\n content = this.fm.read(reference_page); this.in_counter++;\n\n }\n if(this.debug)\n System.out.println(\"ExtHash::containsKey >> cadena encontrada: \" + res);\n\n return res;\n }",
"@Override\n public boolean containsKey(K key) {\n if (key == null) {\n throw new IllegalArgumentException(\"argument to containsKey() is null\");\n }\n return get(key) != null;\n }",
"public boolean contains(int key) {\n\t\tint hashkey = hash(key);\n\t\treturn table[hashkey] != null && table[hashkey][pos(key)];\n\t}",
"public static boolean existKey (Serializable key, List<LocalStore> lStores) {\n\t\treturn countKey (key, lStores) != 0;\n\t}",
"boolean containsKey(Object key) throws NullPointerException;",
"public boolean containsKey(Object key)\r\n/* 386: */ {\r\n/* 387:556 */ return this.headers.containsKey(key);\r\n/* 388: */ }",
"public boolean contains(int key) {\n return map.containsKey(key);\n }",
"public boolean containsKey(String key) {\n int keyBucket = hash(key);\n \n HashNode temp = table[keyBucket];\n while (temp != null) {\n if ((temp.key == null && key == null) \n || (temp.key != null && temp.key.equals(key))) {\n return true;\n }\n temp = temp.next;\n }\n \n return false;\n }",
"public boolean containsKey(String key) {\n if (!index.containsKey(key)) return false;\n else if (index.get(key).isEmpty()) return false;\n else return true;\n }",
"private boolean itemListContains(Item item){\r\n\t\treturn items.containsKey(item.getItemIdentifier());\r\n\t}",
"@Override\n public boolean containsKey(Object key) {\n int index = key.hashCode() % table.length;\n if (index < 0) {\n index += table.length;\n }\n if (table[index] == null) {\n return false;\n }\n for (Entry<K,V> entry : table[index]) {\n if (entry.getKey().equals(key)) {\n return true;\n }\n }\n return false;\n }",
"public boolean containsKey(Comparable key) { return this.store.containsKey(key); }",
"public boolean contains(String key) {\n\t \tNode node = get(key);\n\t return node!=null && node.value!=null;\n\t }",
"public boolean contains(int key) {\n int hash1 = key % buckets;\n int hash2 = key / buckets;\n if(arr[hash1] == null)\n return false;\n return arr[hash1][hash2];\n }",
"public boolean containsKey(K key) {\n int keyBucket = hash(key);\n \n HashMapEntry<K, V> temp = table[keyBucket];\n while (temp != null) {\n if ((temp.key == null && key == null) \n || (temp.key != null && temp.key.equals(key))) {\n return true;\n }\n temp = temp.next;\n }\n \n return false;\n }",
"public boolean isContainedInSharedPreference(String key){\n return mSharedPreferences.contains(key);\n }",
"@Override\r\n public boolean containsKey(KeyType key) {\r\n // if capacity is 0, return false\r\n if (capacity == 0) {\r\n return false;\r\n }\r\n\r\n int index = hashFunction(key); // the index of the pair in the hashTable\r\n\r\n // If the linked list at the index is null, target is not exist\r\n if (hashTable[index] == null) {\r\n return false;\r\n }\r\n\r\n // Find the key in the linked list. If found, return true. Otherwise return false.\r\n for (HashNode node : hashTable[index]) {\r\n if (node.key.equals(key)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }",
"public boolean containsKey(K key) {\r\n\t\tif (get(key) == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"public boolean contains(int key) {\n int index1 = hashfunc1(key);\n int index2 = hashfunc2(key);\n \n if(hset[index1] != null){\n return hset[index1][index2];\n }\n return false; \n }",
"public final boolean containsKey(final E key) {\r\n if (key == null) throw new NullPointerException();\r\n Node<E,V> l = root.c.get(0);\r\n while (l.c != null) l = child(key, l); /* while l is internal */\r\n return l.hasKey(key);\r\n }",
"boolean containsKey(int key) throws ContentStoreException;",
"public boolean containsKey(K theKey) {\n\t\tboolean result = false;\n\t\tint index = hash(theKey);\n\t\t\tfor (WordCode<K, V> wc : myBuckets.get(index)) {\n\t\t\t\tif (wc.myKey.equals(theKey)) result = true;\n\t\t\t}\n\t\t\n\t\t\n\t\treturn result;\n\t}",
"@Override\n\tpublic boolean containsKey(Object key) {\n\t\treturn map.containsKey(key);\n\t}",
"boolean containsInfo(\n int key);",
"public boolean contains(K key, V value) {\r\n \tCollection<V> values = get(key);\r\n \tif (values == null) { return false; }\r\n \treturn values.contains(value);\r\n }",
"public boolean hasKey(String key) {\n return data.containsKey(key);\n }"
] | [
"0.7738161",
"0.7536421",
"0.7523721",
"0.75070614",
"0.75052494",
"0.7341796",
"0.7331238",
"0.7274014",
"0.72226715",
"0.72226715",
"0.7217243",
"0.7199384",
"0.7171813",
"0.71551174",
"0.71545327",
"0.7153255",
"0.71519643",
"0.7148081",
"0.714442",
"0.7123307",
"0.71059686",
"0.70991105",
"0.70962733",
"0.709182",
"0.7067333",
"0.7057917",
"0.70418525",
"0.70418525",
"0.7033678",
"0.7029117",
"0.70265603",
"0.7018115",
"0.70082605",
"0.7002241",
"0.69896543",
"0.69774336",
"0.6975734",
"0.69611806",
"0.69504315",
"0.69499904",
"0.69486004",
"0.69459087",
"0.69434834",
"0.6929477",
"0.69270086",
"0.6906013",
"0.6897397",
"0.6894303",
"0.689169",
"0.68896395",
"0.6887109",
"0.68719065",
"0.6865328",
"0.68535984",
"0.68490225",
"0.6841539",
"0.6825234",
"0.6819452",
"0.68169487",
"0.6793292",
"0.6776897",
"0.67726976",
"0.67713284",
"0.67644083",
"0.67637604",
"0.67622924",
"0.67596406",
"0.674679",
"0.67390805",
"0.67255056",
"0.66987103",
"0.6672477",
"0.6661034",
"0.66503745",
"0.66500753",
"0.6649118",
"0.6641228",
"0.6639746",
"0.6630168",
"0.66286594",
"0.66279763",
"0.6622548",
"0.6618027",
"0.65966976",
"0.65943986",
"0.6576219",
"0.65752137",
"0.65542835",
"0.65509284",
"0.65256983",
"0.65158993",
"0.65088207",
"0.6497949",
"0.6496603",
"0.6482148",
"0.64722514",
"0.647183",
"0.6470388",
"0.64695615",
"0.6460512"
] | 0.7292732 | 7 |
Returns values stored with given key, if any. Null otherwise | public String get(String key) {
Node pos = find(key);
if (pos == null) {
return null;
} else {
return pos.pairStringString.getValue();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private V get(K key) {\n\t\t\tif (keySet.contains(key)) {\n\t\t\t\treturn valueSet.get(keySet.indexOf(key));\n\t\t\t}\n\t\t\treturn null;\n\t\t}",
"public V get(K key) {\n int index = findIndex(key);\n if (keys[index] == null)\n return null;\n else\n return values[index];\n }",
"@Override\n\tpublic V get(Object key) {\n\t\tfor (int i = 0; i < tabla.size(); i++) {\n\t\t\tint indice = tabla.get(i).keySet().indexOf(key);\n\t\t\tif (indice != -1) {\n\t\t\t\treturn tabla.get(i).valueSet().get(indice);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public V get(K key)\n\t{\n\t\tcheckForNulls(key);\n\t\tint n = Math.abs(key.hashCode() % entries.length);\n\t\t\n\t\tif (entries[n] == null)\n\t\t\treturn null;\n\t\t\n\t\tfor (Entry e : entries[n])\n\t\t{\n\t\t\tif (key.equals(e.key) == true)\n\t\t\t\treturn e.value;\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"@Override\n public V get(K key) {\n if(containsKey(key)) {\n LinkedList<Entry<K, V>> pointer = entryArr[Math.floorMod(key.hashCode(), entryArr.length)];\n return pointer.stream().filter(x->x.key.equals(key))\n .collect(Collectors.toList()).get(0).value;\n }\n return null;\n }",
"public Value get(Key key) {\r\n\t\t\tValue ret = null;\r\n\t\t\t\r\n\t\t\tdata.reset();\r\n\t\t\tfor (int i = 0; i < data.size(); i++) {\r\n\t\t\t\tif (data.get().getKey().compareTo(key) == 0) {\r\n\t\t\t\t\tret = data.get().getValue();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tdata.next();\r\n\t\t\t}\r\n\t\t\tdata.reset();\r\n\t\t\t\r\n\t\t\treturn ret;\r\n\t\t}",
"List<V> getAll(K key) {\n List<V> values = store.get(key);\n return values != null ? values : Collections.<V>emptyList();\n }",
"@Override\n\tpublic List<V> get(K key) {\n\t\treturn null;\n\t}",
"public List<S> get(Object key) {\n if (map.containsKey(key))\n return map.get(key);\n else\n return emptyList;\n }",
"public Value get(final Key key) {\n int r = rank(key);\n if (r < size && (keys[r].compareTo(key) == 0)) {\n return values[r];\n }\n return null;\n }",
"@Override\n\tpublic V get(K key) {\n\t\tint h = Math.abs(key.hashCode()) % nrb;// calculam hash-ul asociat cheii\n\t\tfor (int i = 0; i < b.get(h).getEntries().size(); i++) {\n\t\t\t// parcurgerea listei de elemente pentru a gasi cheia ceruta si a\n\t\t\t// intoarte valoarea dorita\n\t\t\tif (b.get(h).getEntries().get(i).getKey().equals(key)) {\n\t\t\t\treturn b.get(h).getEntries().get(i).getValue();\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}",
"@Override\n public V get(Object key) {\n int index = key.hashCode() % table.length;\n if (index < 0) {\n index += table.length;\n }\n if (table[index] == null) {\n return null; // key is not in the table.\n }\n // Search the list at table[index] to find the key.\n for (Entry<K, V> nextItem : table[index]) {\n if (nextItem.key.equals(key)) {\n return nextItem.value;\n }\n }\n\n // assert: key is not in the table.\n return null;\n }",
"V getValue(final E key) {\r\n for (int i=0;i<kcount;i++) {\r\n if (equal(key, (E)k[i])) return (V)v[i];\r\n }\r\n return null;\r\n }",
"public V get(K key)\r\n\t{\r\n\t\tEntry retrieve = data.get(new Entry(key, null));\r\n\t\t\r\n\t\tif(retrieve != null)\r\n\t\t{\r\n\t\t\treturn retrieve.value;\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}",
"public V get(K key) {\n if (key == null) {\n MyEntry<K, V> entry = null;\n try {\n entry = bucket[0];\n if (entry != null) {\n return entry.getValue();\n }\n } catch (NullPointerException e) {\n }\n } else {\n // other keys\n MyEntry<K, V> entry = null;\n int location = hashFunction(key.hashCode());\n entry = bucket[location];\n if (entry != null && entry.getKey() == key) {\n return entry.getValue();\n }\n }\n return null;\n }",
"public AnyType get(AnyType key) {\n \tif (contains(key)) {\n \t\tint currentPos = findPos( key );\n \t\t\treturn ((array[currentPos] != null) ? array[currentPos].value : null); \n \t}\n \telse {\n \t\treturn null;\n \t}\n }",
"public V get(Object key) {\r\n\t\tif (key == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tint slotIndex = Math.abs(key.hashCode()) % table.length;\r\n\r\n\t\tif (table[slotIndex] == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tTableEntry<K, V> currentElement = table[slotIndex];\r\n\r\n\t\tdo {\r\n\t\t\tif (currentElement.key.equals(key)) {\r\n\t\t\t\treturn currentElement.value;\r\n\t\t\t}\r\n\r\n\t\t\tcurrentElement = currentElement.next;\r\n\t\t} while (currentElement != null);\r\n\r\n\t\treturn null;\r\n\t}",
"@Override\n\t@TimeComplexity(\"O(log n)\")\n\tpublic V get(K key) {\n\t/* TCJ\n\t * Binary search operation: log n\n\t */\n\t\tint j = findIndex(key);\n\t\tif ( j == size() || key.compareTo(map.get(j).getKey()) != 0 ) { return null; }\n\t\treturn map.get(j).getValue();\n\t}",
"public V get(K key) {\n V value = null;\n\n if (key != null) {\n int index = indexFor(key);\n if (container[index] != null) {\n value = (V) container[index].value;\n }\n }\n return value;\n }",
"public V get(K key) {\n int index = getIndex(getHash(key));\n Entry<K, V> entry = (Entry<K, V>) table[index];\n\n if (entry == null) {\n return null;\n }\n\n if (!entry.hasNext()) {\n return entry.getValue();\n }\n\n while (entry.hasNext()) {\n if (entry.getKey().equals(key))\n return entry.getValue();\n entry = entry.getNext();\n }\n\n if (entry.getKey().equals(key))\n return entry.getValue();\n\n return null;\n }",
"public V get(K key) {\r\n\t\tint place = hash(key.hashCode());\r\n\t\tif (hashMapArray[place] != null) {\r\n\t\t\tLinkedList<KVPair> temp = hashMapArray[place];\r\n\t\t\tfor (KVPair i : temp) {\r\n\t\t\t\tif (i.getKey().equals(key)) {\r\n\t\t\t\t\treturn i.getValue();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public V get(K key) {\r\n int hash = key.hashCode() % data.length;\r\n if (hash < 0){\r\n hash *= -1;\r\n }\r\n V result = null;\r\n if (data[hash] != null) {\r\n Node currentNode = data[hash];\r\n while (currentNode != null) {\r\n if (currentNode.key == key || currentNode.key.equals(key)) {\r\n result = (V) currentNode.value;\r\n }\r\n currentNode = currentNode.next;\r\n }\r\n }\r\n return result;\r\n }",
"public V get(K key) {\n\t\tfor (int i = map.size() - 1; i >= 0; i--) {\n\t\t\tif (map.get(i).containsKey(key)) {\n\t\t\t\treturn map.get(i).get(key);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public V get(K key) {\n\tint bucket=Math.abs(key.hashCode()%capacity);\n\tfor(MyEntry i:table[bucket]) {\n\t if(i.key.equals(key)) {\n\t\treturn i.value;\n\t }\n\t}\n\treturn null;\n }",
"public V get(String key) {\n int index = hashOf(key);\n if (index >= capacity) return null;\n return (V) values[index];\n }",
"public V getValue(K key)\r\n\t{\r\n\t\tint slot = findSlot(key, false);\r\n\t\t\r\n\t\tif (slot < 0) \r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tMapEntry<K, V> e = table[slot];\r\n\t\treturn e.getValue();\r\n\t}",
"public Collection<V> get(K key) {\r\n \treturn map.get(key);\r\n }",
"public V searchValue (K key) {\n\t\tfor (Map.Entry<K, V> entry : this.entrySet()) {\n\t\t\tif (entry.getKey() == key) {\n\t\t\t\treturn entry.getValue();\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public Value get(Key key);",
"Object get(Object key) throws NullPointerException;",
"public V getValue(K key) {\n int i = findPosition(key);\n if (i==DsConst.NOT_FOUND) {\n return null;\n }\n DictionaryPair p = list.get(i);\n return p.getValue();\n }",
"@Override\n\tpublic V getValue(K key) {\n\t\tNode currentNode = firstNode;\n\t\t\n\t\tif(!isEmpty()){\n\t\t\twhile(currentNode.key != key){\n\t\t\t\tif(currentNode.getNextNode() == null){\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\treturn (V)currentNode.value;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t\t\n\t}",
"public Object get(Object key) {\n\t\tint index = key.hashCode() % SLOTS;\n\t\t// check if key is already present in that slot/bucket.\n\t\tfor(Pair p:table[index]) {\n\t\t\tif(key.equals(p.key))\n\t\t\t\treturn p.value;\n\t\t}\n\t\t// if not found, return null\n\t\treturn null;\n\t}",
"public V get(K key) {\n int hashCode = scaledHashCode(key);\n OwnLinkedList<K, V> list = table[hashCode];\n if (list == null) {\n return null;\n }\n PairNode<K, V> result = list.search(key);\n if (result == null) {\n return null;\n }\n return result.getValue();\n }",
"public E get(String key) {\r\n Integer index = keys.get(key);\r\n if (index == null || index >= items.size()) {\r\n return null;\r\n }\r\n return items.get(index);\r\n }",
"public V getValue(K key)\n {\n V result = null;\n int keyIndex = locateIndex(key);\n if ((keyIndex < numberOfEntries) && \n key.equals(dictionary[keyIndex].getKey()))\n result = dictionary[keyIndex].getValue();\n return result;\n }",
"public Object get(String key);",
"public V get(K key) {\n if (null == key) {\n throw new IllegalStateException(\"Null value for key is \" +\n \"unsupported!\");\n }\n\n V result = null;\n\n Node<Pair<K, V>> node = findItem(key);\n\n if (node != null) {\n result = node.getData().value;\n }\n\n return result;\n\n }",
"public V get(final K key) {\n expunge();\n final int hash = hash(key);\n final int index = index(hash, entries.length);\n Entry<K, V> entry = entries[index];\n while (entry != null) {\n if (entry.hash == hash && key == entry.get()) {\n return entry.value;\n }\n entry = entry.nextEntry;\n }\n return null;\n }",
"public Value get(Key key) ;",
"public Object get(String key) {\n \t\treturn this.get(null, key);\n \t}",
"public V get(Object key) { return _map.get(key); }",
"public ArrayList<KeyVal> readLocalKeyVal(String key){\n\t\tArrayList<KeyVal> keyValList = new ArrayList<KeyVal>();\n\t\tString querySelection = DBHelper.KEY_FIELD+\"=?\";\n\t\tString selection = key;\n\t\tString []querySelectionArgs = new String[]{selection};\n\t\tif(selection.equals(\"@\")){\t// Fetch all the records\n\t\t\tquerySelection = null;\n\t\t\tquerySelectionArgs = null;\n\t\t}\n\t\tCursor cursor = dbHelper.query(null, querySelection, querySelectionArgs, null);\n\t\tif (cursor.moveToFirst()){\n\t\t\tdo{\n\t\t\t\tKeyVal newKeyVal = new KeyVal();\n\t\t\t\tnewKeyVal.setKey(cursor.getString(0));\n\t\t\t\tnewKeyVal.setVal(cursor.getString(1));\n\t\t\t\tnewKeyVal.setVersion(cursor.getString(2));\n\t\t\t\tkeyValList.add(newKeyVal);\n\t\t\t}while(cursor.moveToNext());\n\t\t}\n\t\tcursor.close();\n\t\treturn keyValList;\n\t}",
"public V get(Object key) {\r\n int index = key.hashCode() % mainTable.length;\r\n if (index < 0) {\r\n index += mainTable.length;\r\n }\r\n if (mainTable[index] == null) {\r\n return null; // key is not in the mainTable.\r\n }\r\n\r\n int chainLength = 0;\r\n // Search the list at mainTable[index] to find the key.\r\n for (Entry<K,V> nextItem : mainTable[index]) {\r\n chainLength++;\r\n\r\n if (nextItem.key.equals(key)) {\r\n addChainLength(chainLength);\r\n return nextItem.value;\r\n }\r\n }\r\n\r\n addChainLength(chainLength);\r\n // key is not in the chain\r\n return null;\r\n }",
"public Collection<V> get(String key) {\n return map.get(key);\n }",
"private String getLocalValue(int key)\n {\n // binary search, since the list is sorted\n int start = 0;\n int end = cache.size() - 1;\n while (start <= end)\n {\n int mid = (start + end) / 2;\n Record currentRecord = cache.get(mid);\n if (key == currentRecord.key())\n {\n return currentRecord.value();\n }\n else if (key < currentRecord.key())\n {\n end = mid - 1;\n }\n else\n {\n start = mid + 1;\n }\n }\n \n // not found\n return null; \n }",
"public V get(K key) {\r\n\t\t\tif (key == null) {\r\n\t\t\t\tthrow new NullPointerException();\r\n\t\t\t} else if (find(key) == null) {\r\n\t\t\t\treturn null;\r\n\t\t\t} else {\r\n\t\t\t\treturn find(key).value;\r\n\t\t\t}\r\n\t\t}",
"Object get(String key);",
"Object get(String key);",
"@Override\r\n\tpublic V getElement(K key) {\n\t\tif (hashMap.containsKey(key)){\r\n\t\t\tque.remove(key);\r\n\t\t\tque.add(key);\r\n\t\t\treturn hashMap.get(key);\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}",
"public V value(K key) {\n for(MapEntry<K, V> t : this) {\n if (t == null) continue;\n if (t.key().equals(key)) return t.value();\n }\n\n return null;\n }",
"public String get(int key) {\n String sql = \"SELECT data_val FROM data_map WHERE data_key = ?\";\n\n String value = null;\n try (Connection con = this.connect();\n PreparedStatement pstmt = con.prepareStatement(sql)) {\n pstmt.setInt(1, key);\n ResultSet rs = pstmt.executeQuery();\n\n if (!rs.isClosed()) {\n value = rs.getString(\"data_val\");\n rs.close();\n }\n }\n catch (SQLException e) {\n value = null;\n }\n\n return value;\n }",
"public V get(String key);",
"V get(Object key);",
"@Override\n\tpublic Optional<Value> get(Key k) {\n\t\treturn bst.find(k);\n\t}",
"public V getValue( K key ) {\r\n\t\tint bucketIndex = getBucketIndex( key );\r\n\t\tMapNode<K, V> head = buckets.get(bucketIndex);\r\n\t\twhile( head != null ) {\r\n\t\t\tif( head.key.equals(key)) {\r\n\t\t\t\treturn head.value;\r\n\t\t\t}\r\n\t\t\thead = head.next;\r\n\t\t}\r\n\t\treturn null;\t\r\n\t}",
"public V get(K key){\n\t\t\n\n\t\tNode n=searchkey(root, key);\n\n\t\t\n\t\tif(n!=null && n.value!=null){\n\t\t\treturn n.value;\n\t\t}\n\t\telse{\n\t\t\treturn null;\n\t\t}\n\t}",
"public Optional<V> lookup(K key) {\n Optional<V> mt = Optional.empty();\n return this.entries.foldr(((kvp, o)-> kvp.left.equals(key) ? Optional.of(kvp.right) : o) , mt);\n }",
"public Object getDataValue(String key) {\n\t\t if (data.containsKey(key)) {\n\t\t\t return data.get(key);\n\t\t }\n\t\t return null;\n\t }",
"@Nullable\n public Object getData(final @NotNull String key) {\n return data.get(key);\n }",
"Object get(Object key);",
"public V get(K key);",
"protected ArrayList<String> search(String key) {\n addresses = map.get(key);\n if (addresses == null) {\n return null;\n }\n return addresses;\n }",
"@Override\n public V get(K key) {\n return null;\n }",
"@Override\n\tpublic V get(Object key) {\n\t\treturn null;\n\t}",
"public V get(final K key)\n {\n final StackElement element = this.hashMap.get(key);\n\n if (element != null)\n {\n return element.value;\n }\n\n return null;\n }",
"CACHE_ELEMENT[] get(Key ... keys);",
"public String get(String key){\n\t\tListMapEntry temp = first;\n\t\twhile(temp!=null && !temp.getKey().equals(key)){\n\t\t\ttemp = temp.getNext();\n\t\t}\n\t\tif(temp==null){\n\t\t\treturn null;\n\t\t}\n\t\telse{\n\t\t\treturn temp.getValue();\n\t\t}\n\t}",
"public Value get(Value key) {\n\t\treturn storage.get(key);\n\t}",
"public String getValue(String key) {\n\t\tfinal Iterator<Map.Entry<String, String>> iter = entries.iterator();\n\t\twhile (iter.hasNext()) {\n\t\t\tfinal Map.Entry<String, String> entry = iter.next();\n\t\t\tif (entry.getKey().equals(key)) {\n\t\t\t\treturn entry.getValue();\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public Object get(String key)\n\t{\n\t\tverifyParseState();\n\t\t\n\t\tValue value = values.get(key);\n\t\tif(value == null)\n\t\t\treturn null;\n\t\treturn value.value;\n\t}",
"V get(final K key);",
"@Override\n public Object get(Comparable k) {\n\n // Check if null\n if (k == null) {\n throw new IllegalArgumentException(\"null key\");\n }\n\n else {\n\n // Loop to find key\n for (int i = 0; i < this.size; i++) {\n if (ls[i].key.equals(k)) {\n return ls[i].value; // Return key value if found\n }\n }\n return null; // Null if not found\n }\n }",
"public Object get(Object key){\n\t\tNode tempNode = _locate(key);\r\n\t\tif(tempNode != null){\r\n\t\t\treturn tempNode._value;\r\n\t\t}else{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}",
"@Override\n\tpublic V get(Object key) {\n\t\treturn map.get(key);\n\t}",
"Optional<V> get(K key);",
"public V getValue(K key);",
"public V getValue(K key);",
"public Set<v> getValues(k key) {\n\t\tint b = hash(key);\n\t\tNode<k,v> curr = buckets[b];\n\t\tSet<v> resultSet = new HashSet<v>();\n\t\t\n\t\twhile (curr != null) {\n\t\t\tif (curr.getKey().equals(key))\n\t\t\t\tresultSet.add(curr.getValue());\t\t\t\n\t\t\tcurr = curr.getNext();\n\t\t}\n\t\treturn resultSet;\n\t}",
"public Object lookup(String key){\n ListNode<String,Object> temp = getNode(key);\n if(temp != null)\n return temp.value;\n else\n return null;\n }",
"V get(K key);",
"V get(K key);",
"V get(K key);",
"V get(K key);",
"V get(K key);",
"V get(K key);",
"V get(K key);",
"V getEntry(K key);",
"public E find(K key){\n\t\tE output= null;\n\t\t\n\t\tint i = 0;\n\t\twhile (i<keys.length && output == null){\n\t\t\tif(keys[i] != null && keys[i].equals(key))\n\t\t\t\toutput = elem[i];\n\t\t\ti = i + 1;\n\t\t}\n\t\treturn output;\n\t}",
"public V get(K key) {\n\t\treturn table.get(calcIndex(key)).get(key);\n\t}",
"public Value get(Key key){\n\t\tNode x = root;\n\t\twhile(x!=null){\n\t\t\tif(key.compareTo(x.key)<0)\n\t\t\t\tx = x.left;\n\t\t\telse if(key.compareTo(x.key)>0)\n\t\t\t\tx = x.right;\n\t\t\telse\n\t\t\t\treturn x.value;\n\t\t}\n\t\treturn null;\n\t}",
"@Override\r\n public V get(Object key) {\r\n return get(key,table);\r\n }",
"public abstract V get(K key);",
"@Override\n public Object getValue(String key) {\n return null;\n }",
"private <Key, Value> Value get(Node x, Key key) {\n return null;\n }",
"<T> T getValue(DataKey<T> key);",
"public native V get(K key);",
"public Value get(String key) {\n Node x = get(root, key, 0);\n if (x == null) return null; //node does not exist\n else return (Value) x.val; //found node, but key could be null\n }",
"public Tag get(String key) {\n \t\tfor (int i = 0; i < numTags; i++) {\n \t\t\tif (tags[i].key == key)\n \t\t\t\treturn tags[i];\n \t\t}\n \t\treturn null;\n \t}",
"public V get(K key)\n\t{\n\t\tif(queue.contains(key))\n\t\t{\n\t\t\tqueue.remove(key);\n\t\t\tqueue.add(0, key);\n\t\t\treturn map.get(key);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}",
"private Value get(Node node, Key key ) {\n if ( node.key.equals( key ) ) {\n return (Value) node.value;\n }\n\n if ( key.compareTo( (Key)node.key ) < 0 ) {\n return node.left.value == null ? null : get(node.left,key);\n }\n else {\n return node.right.value == null ? null : get(node.right,key);\n }\n }"
] | [
"0.7355942",
"0.7311905",
"0.72872615",
"0.71952254",
"0.71829545",
"0.7103389",
"0.70966834",
"0.70834184",
"0.70547676",
"0.69593686",
"0.69182813",
"0.68951684",
"0.6885114",
"0.6845771",
"0.6830464",
"0.6828663",
"0.68201685",
"0.67747337",
"0.67715544",
"0.6767795",
"0.67463195",
"0.6735953",
"0.67196095",
"0.6702881",
"0.67001384",
"0.6678748",
"0.66636944",
"0.6658935",
"0.6648969",
"0.66321087",
"0.6619971",
"0.660877",
"0.6605866",
"0.6587297",
"0.6577686",
"0.6558392",
"0.6551408",
"0.6543335",
"0.65427285",
"0.65358704",
"0.65115887",
"0.6509694",
"0.64563674",
"0.6455788",
"0.64446765",
"0.6443185",
"0.64390415",
"0.64152735",
"0.64152735",
"0.6411463",
"0.6401811",
"0.63901806",
"0.63869923",
"0.63805085",
"0.63766885",
"0.6368103",
"0.6363465",
"0.63529706",
"0.6350302",
"0.63264537",
"0.63264114",
"0.63213396",
"0.6319147",
"0.6318427",
"0.63041335",
"0.6303208",
"0.6288782",
"0.62878174",
"0.6285699",
"0.628099",
"0.6270572",
"0.626424",
"0.6259202",
"0.62589604",
"0.6258746",
"0.62535983",
"0.62445605",
"0.62445605",
"0.623873",
"0.62371176",
"0.6235516",
"0.6235516",
"0.6235516",
"0.6235516",
"0.6235516",
"0.6235516",
"0.6235516",
"0.622009",
"0.6206959",
"0.62038666",
"0.6203071",
"0.61885154",
"0.61778486",
"0.6168213",
"0.6159938",
"0.61575127",
"0.6154344",
"0.61473835",
"0.61342347",
"0.61278427",
"0.6117468"
] | 0.0 | -1 |
Modifies element with same key, if any. Adds new element otherwise | public String put(String key, String value) {
PairStringString p = new PairStringString(key, value);
Node pos = find(key);
if (pos == null) {
head = new Node(p, head, null);
if (head.next != null) {
head.next.prev = head;
}
size++;
return null;
} else {
PairStringString tmp = pos.pairStringString;
pos.pairStringString = p;
return tmp.getValue();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void put(K key, T elem);",
"public void put(Object element) {\r\n\t\tObject[] newElements = new Object[elements.length + 1];\r\n\t\tSystem.arraycopy(elements, 0, newElements, 0, elements.length);\r\n\t\tnewElements[elements.length] = element;\r\n\t\telements = newElements;\r\n\t}",
"@Override\n\tpublic boolean update(Eleve o) {\n\t\tmap.replace(o.getId(), o);\n\t\treturn true;\n\t}",
"@Override\n public T update(T element) {\n return manager.merge(element);\n }",
"void addCorrect(String key, String val) {\n List<String> list = map.get(key);\n if (list == null) {\n list = Collections.synchronizedList(new ArrayList<>());\n List<String> exist = map.putIfAbsent(key, list);\n if (exist != null) {\n list = exist;\n }\n }\n list.add(val);\n }",
"public void put(E element);",
"@Override\n public void put(K key, V value) {\n // Note that the putHelper method considers the case when key is already\n // contained in the set which will effectively do nothing.\n root = putHelper(root, key, value);\n size += 1;\n }",
"public void put(K key, V value) {\r\n size++;\r\n checkAndModifySize();\r\n\r\n Node newElement = new Node(key, value);\r\n int currentHash = newElement.hash % data.length;\r\n if (currentHash < 0){\r\n currentHash *= -1;\r\n }\r\n\r\n if (data[currentHash] == null) {\r\n data[currentHash] = newElement;\r\n } else {\r\n Node currentElement = data[currentHash];\r\n while (currentElement.next != null) {\r\n if (currentElement.key == key || currentElement.key.equals(key)) {\r\n currentElement.value = value;\r\n size--;\r\n return;\r\n }\r\n currentElement = currentElement.next;\r\n }\r\n currentElement.next = newElement;\r\n }\r\n }",
"private void elementHit(K key) {\n\t\tint i = hitMap.get(key);\n\t\ti++;\n\t\thitMap.put(key, i);\n\t}",
"public void add(K key, E e){\n\t\tremove(key);\n\t\tnewestIndex = (newestIndex+1)%keys.length;\n\t\tif(keys[newestIndex] == null)\n\t\t\thowMany = howMany + 1;\n\t\tkeys[newestIndex] = key;\n\t\telem[newestIndex] = e;\n\t}",
"public boolean add(E element){\n Object result = map.put(element, \"\");\n return (result == null);\n }",
"public boolean put( AnyType key , AnyType value)\n { \n int currentPos = findPos( key );\t//TODO: test this\n \n if( array[ currentPos ] == null )\n ++occupied;\n array[ currentPos ] = new HashEntry<>(key, value);\n \n theSize++;\n \n // Rehash\n if( occupied > array.length / 2 )\n rehash( );\n \n return true;\n }",
"@Override\r\n\tpublic V putElement(K key, V value) {\n\t\t\r\n\t\tif (capacity == 0)\r\n\t\t\treturn null;\r\n\t\t\r\n\t\tif (hashMap.isEmpty()) {\r\n\t\t\thashMap.put(key, value);\r\n\t\t\tque.add(key);\r\n\t\t\treturn value;\r\n\t\t}\t\t\r\n\t\t\r\n\t\tV element = getElement(key);\r\n\t\tV returnValue = hashMap.get(que.get(0));\r\n\t\t\r\n\t\tif (element == null) {\r\n\t\t\tif (hashMap.size() == capacity){\r\n\t\t\t\tremoveElement(que.get(0));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\thashMap.put(key, value);\r\n\t\t\tque.add(key);\r\n\t\t}\r\n\t\t\r\n\t\treturn returnValue;\r\n\t}",
"protected Object putElement(int key, Object value) {\n int index = key % capacity;\n if (index < 0) {\n index = -index;\n }\n if (map[index] == null) {\n //.... This is a new key since no bucket exists\n objectCounter++;\n map[index] = create(key, value);\n contents++;\n if (contents > maxLoad) {\n rehash();\n }\n return null;\n } else {\n //.... A bucket already exists for this index: check whether \n // we already have a mapping for this key\n MapElement me = map[index];\n while (true) {\n if (me.getKey() == key) {\n return me.atInsert(value);\n } else {\n if (me.getNext() == null) {\n // No next element: so we have no mapping for this key\n objectCounter++;\n MapElement result = create(key, value);\n me.setNext(result);\n contents++;\n if (contents > maxLoad) {\n rehash();\n }\n return null;\n } else {\n me = me.getNext();\n }\n }\n }\n }\n }",
"public boolean add(E key)\r\n {\r\n if(this.contains(key))\r\n {\r\n return false;\r\n }\r\n\r\n else\r\n {\r\n super.add(key);\r\n }\r\n return true;\r\n }",
"void put(Object indexedKey, Object key);",
"void addElement(String name, Element element) {\n if (elementMap.containsKey(name)) {\n elementMap.get(name).add(element);\n } else {\n List<Element> newList = new ArrayList<Element>();\n newList.add(element);\n elementMap.put(name, newList);\n }\n }",
"public void putIfAbsent(T item) {\n synchronized(this) {\n _treeSet.add(item);\n }\n }",
"void add(String key);",
"private void addExistingElement(Node node, Node<K, V>[] newData) {\r\n\r\n int currentHash = node.hash % newData.length;\r\n if (currentHash < 0){\r\n currentHash *= -1;\r\n }\r\n if (newData[currentHash] == null) {\r\n newData[currentHash] = node;\r\n } else {\r\n Node currentElement = newData[currentHash];\r\n while (currentElement.next != null) {\r\n currentElement = currentElement.next;\r\n }\r\n currentElement.next = node;\r\n }\r\n }",
"@Override\n\tpublic V put(K key, V value) {\n\t\tint h = Math.abs(key.hashCode()) % nrb;// calculam hash-ul asociat cheii\n\n\t\tfor (int i = 0; i < b.get(h).getEntries().size(); i++) {\n\t\t\t// caut daca cheya mai este folosita si inlocuiesc elementul entry .\n\t\t\tif (b.get(h).e.get(i).getKey().equals(key)) {\n\t\t\t\tV x = b.get(h).getEntries().get(i).getValue();\n\t\t\t\tremove(key);\n\t\t\t\tb.get(h).e.add(new Entry<K, V>(key, value));\n\t\t\t\treturn x;\n\t\t\t}\n\t\t}\n\n\t\tb.get(h).e.add(new Entry<K, V>(key, value));\n\t\treturn null;\n\t}",
"public void add(long key, C value) {\n if(Long.toString(key).length() != 8) {\n \t//System.out.println(\"Sequence Error: Length is not 8.\\n\");\n return;\n }\n\n //clear the old key\n try {\n this.remove(key); \n } catch(Exception e) {\n sequence.add(new Entry<C>(key, value));\n size++;\n return;\n }\n //System.out.println(\"Found duplicate for key \" + key + \".\\n\"); \n sequence.add(new Entry<C>(key, value));\n size++;\n }",
"void addSameAs(Object newSameAs);",
"@Override\r\n protected void processUpdate(final ICacheElement<K, V> ce)\r\n {\r\n if (!isAlive())\r\n {\r\n log.error(\"{0}: No longer alive; aborting put of key = {1}\",\r\n () -> logCacheName, ce::getKey);\r\n return;\r\n }\r\n\r\n log.debug(\"{0}: Storing element on disk, key: {1}\",\r\n () -> logCacheName, ce::getKey);\r\n\r\n // old element with same key\r\n IndexedDiskElementDescriptor old = null;\r\n\r\n try\r\n {\r\n IndexedDiskElementDescriptor ded = null;\r\n final byte[] data = getElementSerializer().serialize(ce);\r\n\r\n // make sure this only locks for one particular cache region\r\n storageLock.writeLock().lock();\r\n try\r\n {\r\n old = keyHash.get(ce.getKey());\r\n\r\n // Item with the same key already exists in file.\r\n // Try to reuse the location if possible.\r\n if (old != null && data.length <= old.len)\r\n {\r\n // Reuse the old ded. The defrag relies on ded updates by reference, not\r\n // replacement.\r\n ded = old;\r\n ded.len = data.length;\r\n }\r\n else\r\n {\r\n // we need this to compare in the recycle bin\r\n ded = new IndexedDiskElementDescriptor(dataFile.length(), data.length);\r\n\r\n if (doRecycle)\r\n {\r\n final IndexedDiskElementDescriptor rep = recycle.ceiling(ded);\r\n if (rep != null)\r\n {\r\n // remove element from recycle bin\r\n recycle.remove(rep);\r\n ded = rep;\r\n ded.len = data.length;\r\n recycleCnt++;\r\n this.adjustBytesFree(ded, false);\r\n log.debug(\"{0}: using recycled ded {1} rep.len = {2} ded.len = {3}\",\r\n logCacheName, ded.pos, rep.len, ded.len);\r\n }\r\n }\r\n\r\n // Put it in the map\r\n keyHash.put(ce.getKey(), ded);\r\n\r\n if (queueInput)\r\n {\r\n queuedPutList.add(ded);\r\n log.debug(\"{0}: added to queued put list. {1}\",\r\n () -> logCacheName, queuedPutList::size);\r\n }\r\n\r\n // add the old slot to the recycle bin\r\n if (old != null)\r\n {\r\n addToRecycleBin(old);\r\n }\r\n }\r\n\r\n dataFile.write(ded, data);\r\n }\r\n finally\r\n {\r\n storageLock.writeLock().unlock();\r\n }\r\n\r\n log.debug(\"{0}: Put to file: {1}, key: {2}, position: {3}, size: {4}\",\r\n logCacheName, fileName, ce.getKey(), ded.pos, ded.len);\r\n }\r\n catch (final IOException e)\r\n {\r\n log.error(\"{0}: Failure updating element, key: {1} old: {2}\",\r\n logCacheName, ce.getKey(), old, e);\r\n }\r\n }",
"public void put(K key, V value) {\n if (null == key) {\n throw new IllegalStateException(\"Null value for key is \" +\n \"unsupported!\");\n }\n\n Node<Pair<K, V>> node = findItem(key);\n\n if (node != null) {\n node.getData().value = value;\n return;\n }\n\n Pair<K, V> entry = new Pair<>(key, value);\n\n int hash1 = hash1(key);\n int hash2 = hash2(key);\n\n int count1 = table[hash1] == null ? 0 : table[hash1].list.getCount();\n int count2 = table[hash2] == null ? 0 : table[hash2].list.getCount();\n\n if (count1 <= count2) {\n if (table[hash1] == null) {\n table[hash1] = new Entry<>();\n }\n\n table[hash1].list.put(entry);\n } else {\n if (table[hash2] == null) {\n table[hash2] = new Entry<>();\n }\n\n table[hash2].list.put(entry);\n }\n\n if (++elementsCount > table.length * OCCUPANCY) {\n rehash();\n }\n }",
"public void add(String key,String value){\n int index=hash(key);\n if (arr[index] == null)\n {\n arr[index] = new Llist();\n }\n arr[index].add(key, value);\n\n\n }",
"void addBroken(String key, String val) {\n List<String> list = map.get(key);\n if (list == null) {\n list = Collections.synchronizedList(new ArrayList<>());\n map.put(key, list);\n }\n list.add(val);\n }",
"boolean add(Object key, Object value);",
"@Override\n public void put(PairNode<K, V> node) {\n super.put(node);\n keySet.add(node.getKey());\n }",
"@Override\n\tpublic boolean add(T element) {\n\t\titemProbs_.put(element, 1d);\n\t\telementArray_ = null;\n\t\tklSize_ = 0;\n\t\treturn true;\n\t}",
"public boolean add(K key, V value){\r\n int loc = find(key);\r\n if(needToRehash()){\r\n rehash();\r\n }\r\n Entry<K,V> newEntry = new Entry<>(key,value);\r\n if(hashTable[loc]!= null && hashTable[loc].equals(key))\r\n return false;\r\n else{\r\n hashTable[loc] = newEntry;\r\n size++;\r\n return true;\r\n }\r\n }",
"@Override\n public V put(K key, V value) {\n if (!containsKey(key)) {\n keys.add(key);\n }\n\n return super.put(key, value);\n }",
"public void inc(String key);",
"private void add(String key) {\n dict = add(dict, key, 0);\n }",
"private void put(PrimitiveEntry entry) {\n int hashIndex = findHashIndex(entry.getKey());\n entries[hashIndex] = entry;\n }",
"@Override\n\t@TimeComplexity(\"O(n)\")\n\tpublic V put(K key, V value) {\n\t/* TCJ\n\t * Binary search operation: log n\n\t * Iterate through new collection: n\n\t */\n\t\t//.getKey().compareTo(null) == 0\n\t\tV oldValue;\n\t\tint j = findIndex(key);\n\t\tif ( map.get(j) == null ) {\n\t\t\toldValue = null;\n\t\t} else {\n\t\t\toldValue = map.get(j).getValue();\n\t\t}\n\t\t\n\t\tif ( j < size() && key.compareTo(map.get(j).getKey()) == 0) {\n\t\t\tmap.get(j).setValue(value);\n\t\t\treturn oldValue;\n\t\t}\n\t\tmap.add(j, new mapEntry<K, V>(key, value));\n\t\treturn null;\n\t}",
"private void put(K key, V value) {\n\t\t\tif (key == null || value == null)\n\t\t\t\treturn;\n\t\t\telse if (keySet.contains(key)) {\n\t\t\t\tvalueSet.set(keySet.indexOf(key), value);\n\t\t\t} else {\n\t\t\t\tkeySet.add(key);\n\t\t\t\tvalueSet.add(keySet.indexOf(key), value);\n\t\t\t\tsize++;\n\t\t\t}\n\t\t}",
"@Test\n\tpublic void testPutAccessReodersElement() {\n\t\tmap.put(\"key1\", \"value1\");\n\n\t\tSet<String> keySet = map.keySet();\n\t\tassertEquals(\"Calling get on an element did not move it to the front\", \"key1\",\n\t\t\tkeySet.iterator().next());\n\n\t\t// move 2 to the top/front\n\t\tmap.put(\"key2\", \"value2\");\n\t\tassertEquals(\"Calling get on an element did not move it to the front\", \"key2\",\n\t\t\tkeySet.iterator().next());\n\t}",
"@Override\n\tpublic void put(Object key, Object val) {\n\t\tif(st[hash(key)].size()>=k)\n\t\t\tst[hash(key)].clear();\n\t\tst[hash(key)].put(key, st[hash(key)].size());\n\t}",
"public Value put(Key key, Value thing) ;",
"public void put(Key key, Value val) {\n if (val == null) {\n delete(key);\n return;\n }\n\n for (Node x = first; x != null; x = x.next) {\n if (key.equals(x.key)) {\n x.val = val;\n return;\n }\n }\n first = new Node(key, val, first);\n n++;\n }",
"@Override\n public void put(K key, V value) {\n int index = Math.floorMod(key.hashCode(), entryArr.length);\n if(containsKey(key)) {\n LinkedList<Entry<K, V>> pointer = entryArr[index];\n for(int i = 0; i < pointer.size(); i++) {\n if(pointer.get(i).keyEquals(new Entry<K, V>(key, null))) {\n pointer.get(i).value = value;\n break;\n }\n }\n } else {\n if(loadFactor()>maxLoad) {\n resize();\n }\n if (entryArr[index] == null) {\n entryArr[index] = new LinkedList<Entry<K, V>>();\n }\n entryArr[index].addLast(new Entry<K, V>(key, value));\n size++;\n }\n }",
"public void put(int key, int value) {\n\n int index = key % n;\n MapNode node = keys[index];\n// System.out.println(key + \" \" + value + \" \" + (node == null));\n for (int i =0; i < node.list.size(); ++i) {\n if (node.list.get(i) == key) {\n node.list.remove(i);\n vals[index].list.remove(i);\n }\n }\n\n node.list.add(key);\n vals[index].list.add(value);\n }",
"@Test(timeout=1000)\n\tpublic void testAddElementTwice() {\n\t\texception.expect(RuntimeException.class);\n\t\texception.reportMissingExceptionWithMessage(\"Student 2 is already in the HashMap and a RuntimeException should be thrown\");\n\t\tStudent[] array = new Student[7];\n\t\tarray[5] = s2; // This is the correct hash position of this student\n\t\tarray[6] = s4;\n\t\tarray[0] = s5;\n\t\tarray[3] = s1;\n\t\tarray[4] = s3;\n\t\tarray[1] = s7;\n\t\thashmap.setArray(array);\n\t\thashmap.add(s2);\n\t}",
"public void add(K key,V value) {\n DictionaryPair pair = new DictionaryPair(key,value);\n int index = findPosition(key);\n\n if (index!=DsConst.NOT_FOUND) {\n list.set(index,pair);\n } else {\n list.addLast(pair);\n this.count++;\n }\n }",
"@Override\n public T put(String key, T value) {\n T old = null;\n // Do I have an entry for it already?\n Map.Entry<String, T> entry = entries.get(key);\n // Was it already there?\n if (entry != null) {\n // Yes. Just update it.\n old = entry.setValue(value);\n } else {\n // Add it to the map.\n map.put(prefix + key, value);\n // Rebuild.\n rebuildEntries();\n }\n return old;\n }",
"public void set(R key, List<S> value){\n map.remove(key);\n map.put(key, value);\n }",
"private void putKV(KVPair<K, V> element) {\r\n int index = getIndex(element.getKey());\r\n if (chains[index] == null) {\r\n chains[index] = new ArrayDictionary<>(); \r\n //load++;\r\n }\r\n if (!chains[index].containsKey(element.getKey())) {\r\n load++;\r\n }\r\n chains[index].put(element.getKey(), element.getValue());\r\n \r\n \r\n }",
"public void addKey(String key){\n itemMap.put(key, new ArrayList<>());\n }",
"public void insert(K key, E val) {\n MapEntry<K, E> newEntry = new MapEntry<K, E>(key, val);\n int b = hash(key);\n for (SLLNode<MapEntry<K,E>> curr = buckets[b]; curr != null; curr = curr.succ) {\n if (key.equals(((MapEntry<K, E>) curr.element).key)) {\n curr.element = newEntry;\n return;\n }\n }\n buckets[b] = new SLLNode<MapEntry<K,E>>(newEntry, buckets[b]);\n }",
"private void setElement(int index, E element) {\n// if (getElement(index) != null) {\n// setContents.remove(getElement(index));\n// }\n while (index >= contents.size()) {\n contents.add(null);\n }\n contents.set(index, element);\n// contents.put(index, element);\n backwards.put(element, index);\n\n// if (element != null) {\n// setContents.add(getElement(index));\n// }\n }",
"private void addNewHead(final K key, final V value)\n {\n // Create the new element and add to the map\n final StackElement newElement = new StackElement(key, value);\n this.hashMap.put(key, newElement);\n\n // If there were no elements\n if (this.head == null)\n {\n this.head = newElement;\n this.tail = newElement;\n }\n else\n {\n final StackElement previoussHead = this.head;\n this.head = newElement;\n newElement.next = previoussHead;\n previoussHead.previous = newElement;\n }\n }",
"void itemAddedToIndex(Object key, Object o);",
"public boolean mapKeyHasChanged(Object element, AbstractSession session) {\n return false;\n }",
"public void put(final Serializable key, final Serializable value) {\n Mutex lock = checkLockExistsForKey(key);\n try {\n if (value != null) {\n final Element element = new Element(key, value);\n cache.put(element);\n } else {\n cache.remove(key);\n }\n } finally {\n //Release the readlock here. This will have been acquired in the get, where the element was null\n lock.release();\n }\n }",
"public CatalogItem applyKeyToItem(CatalogItem item, Object[] key) {\n return item;\n }",
"public void addElement(int x, int y, BoxContainer element){\n\t\t\tArrayList<Integer> coordinates = new ArrayList<Integer>();\n\t\t\tcoordinates.add(x);\n\t\t\tcoordinates.add(y);\n\t\t\tmap.put(coordinates, element);\n\t\t}",
"@SuppressWarnings(\"unchecked\")\r\n private Node insertHelperSize1(Key key, Value value) {\r\n Node tmp;\r\n if(key.compareTo(keys[0]) < 0) { // add key:value before contents\r\n tmp = children[0].insert(key,value);\r\n if(tmp != children[0]) { // merge interior node that bubbled up\r\n InteriorNode merge = (InteriorNode)tmp;\r\n setKeyValuePairs(merge.keys[0],merge.values[0],keys[0],values[0]);\r\n setChildren(merge.children[0],merge.children[1],children[1]);\r\n }\r\n } else { // add key:value after contents\r\n tmp = children[1].insert(key,value);\r\n if(tmp != children[1]) { // merge interior node that bubbled up\r\n InteriorNode merge = (InteriorNode)tmp;\r\n setKeyValuePairs(keys[0],values[0],merge.keys[0],merge.values[0]);\r\n setChildren(children[0],merge.children[0],merge.children[1]);\r\n }\r\n }\r\n return this;\r\n }",
"@Override\n public Symbol put(String key, Symbol value) {\n value.setIndex(this.local++);\n return super.put(key, value);\n }",
"void addCorrect8(String key, String val) {\n List<String> list = map.computeIfAbsent(key,\n k -> Collections.synchronizedList(new ArrayList<>()));\n list.add(val);\n }",
"public void insert(KeyedItem newItem);",
"public MapElement put(long key, long startCpuTime, long startSystemTime) {\r\n // pass in thread data to differentiate between indirect and direct \r\n putElement(key, null); \r\n MapElement elt = (MapElement) getElement(key);\r\n if (null != elt) {\r\n elt.setTimes(startCpuTime, startSystemTime);\r\n }\r\n return elt;\r\n }",
"public boolean add(Object element);",
"public Object putItem (String key, Object item);",
"@Override\n public boolean put(int key, int firstValue, int secondValue) {\n int position = key << 1;\n array.addEntry(firstValue, position);\n array.addEntry(secondValue, position + 1);\n numStoredKeysCounter.incr();\n return false;\n }",
"public void attach(Object key, Object value);",
"public V add(K key, V value);",
"public Value putIfExists(Key key, Value value) {\r\n\t\t\tdata.reset();\r\n\t\t\t\r\n\t\t\tfor (int i = 0; i < data.size(); i++) {\r\n\t\t\t\tif (data.get().getKey().compareTo(key) == 0) {\r\n\t\t\t\t\tValue ret = data.get().getValue();\r\n\t\t\t\t\tdata.get().setValue(value);\r\n\t\t\t\t\treturn ret;\r\n\t\t\t\t}\r\n\t\t\t\tdata.next();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn null;\r\n\t\t}",
"public void add(String key) {\n if (key == null || key.length() < 1) {\n return;\n }\n Node curr = root;\n for (int i = 0; i < key.length(); i++) {\n char c = key.charAt(i);\n if (!curr.next.items.containsKey(c)) {\n curr.next.items.put(c, new Node(c, false, 256));\n }\n curr = (Node)curr.next.items.get(c);\n }\n curr.isKey = true;\n }",
"public boolean addCacheElement(K key, V value) {\n\t\tif (cacheMap.containsKey(key)) {\n\t\t\telementHit(key);\n\t\t\tInputUtils.printConsoleMessage(\"Hit\");\n\t\t\treturn false;\n\t\t} else if (maxObjects > cacheMap.size()) {\n\t\t\tcacheMap.put(key, value);\n\t\t\thitMap.put(key, 0);\n\t\t\treturn true;\n\t\t} else {\n\t\t\tInputUtils.printConsoleMessage(\"Miss\");\n\t\t\tint min = Integer.MAX_VALUE;\n\t\t\tK searchedKey = null;\n\t\t\tfor (K i : hitMap.keySet()) {\n\t\t\t\tint val = hitMap.get(i);\n\t\t\t\tif (min > val) {\n\t\t\t\t\tsearchedKey = i;\n\t\t\t\t\tmin = val;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcacheMap.remove(searchedKey);\n\t\t\thitMap.remove(searchedKey);\n\t\t\tcacheMap.put(key, value);\n\t\t\thitMap.put(key, 0);\n\t\t\treturn true;\n\t\t}\n\t}",
"public void put(Object key, Object value) {\n\t\tint index = key.hashCode() % SLOTS;\n\t\t// check if key is already present in that slot/bucket.\n\t\tfor(Pair p:table[index]) {\n\t\t\tif(key.equals(p.key)) {\n\t\t\t\tp.value = value; // overwrite value if key already present.\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t// if not present, add key-value pair in that slot/bucket.\n\t\tPair pair = new Pair(key, value);\n\t\ttable[index].add(pair);\n\t}",
"@Override\n public V put(K key, V value) {\n\n \tV tempValue = get(key);\n \t\n \tLinkedList<Entry> tempBucket = chooseBucket(key);\n \t\n \tif(tempValue != null) {\n \t\tfor(int i=0;i<tempBucket.size();i++) {\n\t \t\tEntry tempEntry = tempBucket.get(i);\n\t \t\t\n\t \t\tif(tempEntry.getKey() == key) {\n\t \t\t\tV returnValue = tempEntry.getValue();\n\t \t\t\ttempEntry.setValue(value);\n\t \t\t\treturn returnValue;\n\t \t\t}\n\t \t}\n \t} else {\n \t\tsize ++;\n \t\ttempBucket.add(new Entry(key, value));\n \t}\n \t\n \tif(size > buckets.length*ALPHA) {\n \t\trehash(GROWTH_FACTOR);\n \t}\n \t\n return tempValue;\n }",
"public Object put(short key, Object obj) {\n\t\tObject result = get(key);\n\t\ttheList.add(new Entry(key, obj));\n\t\treturn result;\n\t}",
"@Override\n public V put(K key, V value) {\n int index = key.hashCode() % table.length;\n if (index < 0) {\n index += table.length;\n }\n if (table[index] == null) {\n // Create a new linked list at table[index].\n table[index] = new LinkedList<Entry<K, V>>();\n }\n\n // Search the list at table[index] to find the key.\n for (Entry<K, V> nextItem : table[index]) {\n // If the search is successful, replace the old value.\n if (nextItem.key.equals(key)) {\n // Replace value for this key.\n V oldVal = nextItem.value;\n nextItem.setValue(value);\n return oldVal;\n }\n }\n\n // assert: key is not in the table, add new item.\n table[index].addFirst(new Entry<K, V>(key, value));\n numKeys++;\n if (numKeys > (LOAD_THRESHOLD * table.length)) {\n rehash();\n }\n return null;\n }",
"public void put(K searchKey, V newValue) {\n\t\tint index = hash(searchKey);\n\t\t\n\t\tIterator<WordCode<K, V>> itr = myBuckets.get(index).iterator();\n\t\t\n\t\twhile (itr.hasNext()) {\n\t\t\tWordCode<K, V> wc = itr.next();\n\t\t\tif (wc.myKey.equals(searchKey)) itr.remove();\n\t\t\t\n\t\t}\n\t\tmyBuckets.get(index).add(new WordCode<K, V>(searchKey, newValue));\n\t\t\t\n\t\tnumEntries++;\n\t}",
"@Override\r\n\tpublic V getElement(K key) {\n\t\tif (hashMap.containsKey(key)){\r\n\t\t\tque.remove(key);\r\n\t\t\tque.add(key);\r\n\t\t\treturn hashMap.get(key);\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}",
"public void put(String key, V value) {\n map.computeIfAbsent(key, k -> keepOrder ? new LinkedHashSet<>() : new HashSet<>()).add(value);\n }",
"public int inc(Object key)\r\n {\r\n return add(key, 1);\r\n }",
"private void rehash() {\n if (rehashing) {\n int newCapacity = 2 * capacity + 1;\n if (newCapacity > MAXIMUM_CAPACITY) {\n return;\n }\n\n objectCounter += 2;\n MapElement[] newMap = new MapElement[newCapacity]; \n \n MapElement me = null;\n MapElement t = null;\n MapElement next = null;\n int newIndex = 0;\n \n for (int index = 0; index < capacity; index++) {\n me = map[index];\n while (me != null) {\n next = me.getNext();\n newIndex = me.getKey() % newCapacity;\n if (newIndex < 0) {\n newIndex = -newIndex;\n }\n if (newMap[newIndex] == null) {\n // No element yet for this new index\n newMap[newIndex] = me;\n me.setNext(null);\n } else {\n // Hook the element into the beginning of the chain\n t = newMap[newIndex];\n newMap[newIndex] = me;\n me.setNext(t);\n }\n me = next;\n }\n }\n \n map = newMap;\n capacity = newCapacity;\n // Max. number of elements before a rehash occurs\n maxLoad = (int) (loadFactor * capacity + 0.5f);\n\n newMap = null;\n }\n }",
"@Override\n public void add(K key, V value) {\n if(containsKey(key)){\n List<V> v = getValues(key);\n if(v.contains(value)){return;}\n }\n internalGetValue(key).add(value);\n }",
"public void put(K key, V val) {\n int index = findIndex(key);\n // the real reason we bother to check is \n // to know whether or not to increment pairs.\n if (keys[index] == null) {\n keys[index] = key;\n values[index] = val;\n }\n else\n values[index] = val;\n }",
"public int add(String key, E value) {\r\n int index = items.size();\r\n keys.put(key, index);\r\n items.add(value);\r\n return index;\r\n }",
"public void put(K key, V value) {\n int hash = getHash(key.hashCode());\n Entry<K, V> existing = buckets[hash];\n Entry<K, V> entry = new Entry<>(key, value);\n\n if (existing == null) {\n buckets[hash] = entry;\n } else { // using separating chaining collision resolution. Another way is open addressing, resizing the array to reducing collision.\n while(existing.next != null) {\n if (existing.key.equals(key)) {\n existing.value = value;\n return;\n }\n existing = existing.next;\n }\n if (existing.key.equals(key)) {\n existing.value = value;\n } else {\n existing.next = entry;\n }\n }\n }",
"Object put(Object key, Object value);",
"@SuppressWarnings(\"unchecked\")\n public MapEntryImpl addEntry(MapEntryImpl newEntry, Object key, int hash) {\n int i = indexOfKey(key, hash);\n MapEntryImpl entry = entries[i];\n if (entry != null) return entry; // Entry exists\n entries[i] = newEntry;\n newEntry.key = key;\n newEntry.hash = hash;\n // Check if we need to resize.\n if ((++count << EMPTINESS_LEVEL) > entries.length) {\n resize(entries.length << 1);\n }\n return newEntry;\n }",
"@SuppressWarnings(\"unchecked\")\n\tprivate boolean checkAndAdd(Object key, Object obj, @SuppressWarnings(\"rawtypes\") TreeMap map){\n if (map.containsKey(key))\n return(false);\n else\n map.put(key,obj);\n\n return(true);\n }",
"public boolean updateRecord(Object key, Object record ) \n\t{ \n\t check(\"update\", key, record);\n\t if ( htRecords.get(key) != null )\n\t {\n\t\t //--- Store a copy of the given key+record\n\t\t Object key2 = copy ( key ); // Is it realy useful for the key ?\n\t\t Object record2 = copy ( record );\n\t\t \n\t\t htRecords.put(key2, record2);\n\t\t return true ;\n\t }\n\t else\n\t {\n\t return false ;\n\t }\n\t}",
"public E tryAdd(E o) {\r\n E found = this.map.get(o.hashCode());\r\n if (found != null) {\r\n return found;\r\n }\r\n this.map.put(o.hashCode(), o);\r\n return o;\r\n }",
"public void inc(String key) {\n\t\tif(map.containsKey(key)){\n\t\t\tNode n=map.get(key);\n\t\t\tn.val++;\n\t\t\tmoveToHead(n);\n\t\t}\n\t\telse{\n\t\t\tNode n=new Node(key, 1);\n\t\t\tmap.put(key, n);\n\t\t\tinsert(n, tail);\n\t\t}\n\t}",
"public void inc(String key) {\n if (!keyMap.containsKey(key)) {\n keyMap.put(key, 1);\n DLinkedListNode node = countMap.get(1);\n System.out.println(node);\n if (node == null) {\n node = new DLinkedListNode(1);\n countMap.put(1, node);\n dll.insertAfter(dll.head, node);\n }\n node.keySet.add(key);\n }\n else {\n int count = keyMap.get(key); \n DLinkedListNode oldNode = countMap.get(count);\n oldNode.keySet.remove(key);\n count++;\n keyMap.put(key, count);\n DLinkedListNode newNode = countMap.get(count);\n if (newNode == null) {\n newNode = new DLinkedListNode(count);\n countMap.put(count, newNode);\n dll.insertAfter(oldNode, newNode);\n }\n newNode.keySet.add(key);\n if (oldNode.keySet.size() == 0) {\n dll.remove(oldNode);\n countMap.remove(oldNode.count);\n }\n }\n }",
"@Override\n public void add(Integer element) {\n if (this.contains(element) != -1) {\n return;\n }\n // when already in use\n int index = this.getIndex(element);\n if(this.data[index] != null && this.data[index] != this.thumbstone){\n int i = index + 1;\n boolean foundFreePlace = false;\n while(!foundFreePlace && i != index){\n if(this.data[i] == null && this.data[i] == this.thumbstone){\n foundFreePlace = true;\n }else{\n if(i == this.data.length - 1){\n // start at beginning.\n i = 0;\n }else{\n i++;\n }\n }\n }\n if(foundFreePlace){\n this.data[i] = element;\n }else{\n throw new IllegalStateException(\"Data Structre Full\");\n }\n }\n }",
"@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\r\n\t\tprivate void rehash() {\r\n\t\t\t// double size of array\r\n\t\t\tTableElement<K, V>[] NewDictionary = (TableElement<K, V>[]) new TableElement[dictionary.length * 2];\r\n\r\n\t\t\tcurrentCapacity = dictionary.length * 2;\r\n\r\n\t\t\t// re-mod the keys to get new hash\r\n\t\t\tfor (int i = 0; i < dictionary.length; i++) {\r\n\t\t\t\tif (dictionary[i] != null) {\r\n\t\t\t\t\tint newHash = (Math.abs(dictionary[i].getKey().hashCode()) % currentCapacity);\r\n\r\n\t\t\t\t\t// put re-hashed keys into new array\r\n\t\t\t\t\twhile (NewDictionary[newHash] != null) {\r\n\t\t\t\t\t\tint probe = getProbed(newHash);\r\n\t\t\t\t\t\tnewHash = (newHash + probe) % currentCapacity;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tTableElement element = dictionary[i];\r\n\t\t\t\t\tNewDictionary[newHash] = element;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// set old dictionary to new dictionary\r\n\t\t\tthis.dictionary = NewDictionary;\r\n\t\t}",
"private void rehash(int newCapacity) {\n byte[] oldKeys = keys;\n V[] oldVals = values;\n\n keys = new byte[newCapacity];\n @SuppressWarnings({ \"unchecked\", \"SuspiciousArrayCast\" })\n V[] temp = (V[]) new Object[newCapacity];\n values = temp;\n\n maxSize = calcMaxSize(newCapacity);\n mask = newCapacity - 1;\n\n // Insert to the new arrays.\n for (int i = 0; i < oldVals.length; ++i) {\n V oldVal = oldVals[i];\n if (oldVal != null) {\n // Inlined put(), but much simpler: we don't need to worry about\n // duplicated keys, growing/rehashing, or failing to insert.\n byte oldKey = oldKeys[i];\n int index = hashIndex(oldKey);\n\n for (;;) {\n if (values[index] == null) {\n keys[index] = oldKey;\n values[index] = oldVal;\n break;\n }\n\n // Conflict, keep probing. Can wrap around, but never reaches startIndex again.\n index = probeNext(index);\n }\n }\n }\n }",
"public MutableCachedNode mutable( NodeKey key ) throws NodeNotFoundException, UnsupportedOperationException;",
"private void addOrReplace(List<SubTree> all, SubTree newSubTree){\n\t\tOptional<SubTree> existingOne = all.stream().filter(t -> t.getTag().equalsIgnoreCase(newSubTree.getTag())).findFirst();\n\t\tif (!existingOne.isPresent()){\n\t\t\tall.add(newSubTree);\n\t\t\treturn;\n\t\t}\n\n\t\tdouble accumulatedProbOfExistingOne = existingOne.get().getAccumulatedMinusLogProb();\n\t\tdouble accumulatedProbOfNewOne = newSubTree.getAccumulatedMinusLogProb();\n\n\t\tif (accumulatedProbOfNewOne < accumulatedProbOfExistingOne){\n\t\t\tfor (int i = 0; i < all.size(); i++) {\n\t\t\t\tif (all.get(i).getTag().equalsIgnoreCase(newSubTree.getTag())){\n\t\t\t\t\tall.remove(i);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tall.add(newSubTree);\n\t\t}\n\n\t\treturn;\n\t}",
"public V put(final K key, final V value) {\n expunge();\n final int hash = hash(key);\n final int index = index(hash, entries.length);\n\n for (Entry<K, V> entry = entries[index]; entry != null; entry = entry.nextEntry) {\n if (hash == entry.hash && key == entry.get()) {\n final V oldentry = entry.value;\n if (value != oldentry) {\n entry.value = value;\n }\n return oldentry;\n }\n }\n\n entries[index] = new Entry<K, V>(key, value, refqueue, hash, entries[index]);\n if (++size >= threshold) {\n resize(entries.length * 2);\n }\n return null;\n }",
"public void add(T x) // O(n/M) nel caso medio e peggiore\n {\n // precondizioni\n if (x == null || contains(x)) \n return;\n \n // calcolo della chiave ridotta\n int kr = hash(x);\n \n // inserimento nel bucket di chiave ridotta calcolata\n ListNode n = (ListNode)v[kr]; // nodo header del bucket\n n.setElement(x); // inserimento nel nodo header\n v[kr] = new ListNode(null, n); // nuovo nodo header\n \n // incremento del numero di elementi\n size++; \n }",
"public int putElement(Object key, int value)\r\n {\r\n return put(key, value);\r\n }",
"@Override public void setKey(IndexKey key) {\n listOfKeys.add(key);\n\n }",
"public void add(Key key, Value value) {\n\n\t\tif (2 * this.size > this.capacity) {\n\t\t\tresize(2 * this.capacity);\n\t\t}\n\n\t\t// Add this item to the hash table in the expected location.\n\n\t\tint index = locate(key);\n\t\tthis.keys[index] = key;\n\t\tthis.values[index] = value;\n\t\tthis.size++;\n\t}",
"@Override\r\n\tpublic void updateElement() {\n\r\n\t}"
] | [
"0.622793",
"0.60266364",
"0.6018074",
"0.59547573",
"0.59195143",
"0.5898631",
"0.5869217",
"0.5832564",
"0.58256054",
"0.5803596",
"0.57564867",
"0.5732218",
"0.5714999",
"0.57083726",
"0.5699907",
"0.5688322",
"0.563079",
"0.560729",
"0.55842394",
"0.5583448",
"0.5582886",
"0.554903",
"0.552735",
"0.5502842",
"0.54967326",
"0.54868525",
"0.5437131",
"0.5433938",
"0.5425627",
"0.54210037",
"0.54190916",
"0.541538",
"0.5405545",
"0.54033035",
"0.5384753",
"0.538107",
"0.5379487",
"0.53785366",
"0.5377638",
"0.53697723",
"0.5348677",
"0.53437334",
"0.5341134",
"0.5336774",
"0.5335009",
"0.5326506",
"0.532634",
"0.53192735",
"0.5308421",
"0.53005904",
"0.5297059",
"0.52960813",
"0.52942306",
"0.52818906",
"0.5278979",
"0.52781194",
"0.5272128",
"0.5252899",
"0.5251455",
"0.5245667",
"0.52284133",
"0.5226655",
"0.5225999",
"0.52241826",
"0.5223711",
"0.52235633",
"0.5214823",
"0.5213612",
"0.5191238",
"0.51882094",
"0.51867795",
"0.51844174",
"0.5179157",
"0.5164219",
"0.514837",
"0.51458263",
"0.51437515",
"0.5139166",
"0.5138698",
"0.5135347",
"0.5126464",
"0.5123784",
"0.51215774",
"0.5120125",
"0.5119111",
"0.5115584",
"0.5114953",
"0.5114042",
"0.5114019",
"0.5111993",
"0.51097935",
"0.5108475",
"0.5107669",
"0.5106591",
"0.5104549",
"0.5104419",
"0.5104412",
"0.5101186",
"0.509307",
"0.50909173",
"0.50906944"
] | 0.0 | -1 |
Remove element with same key, if any. | public String remove(String key) {
Node pos = find(key);
if (pos == null) {
return null;
}
size--;
if (head == pos) {
head = pos.next;
}
pos.remove();
return pos.pairStringString.getValue();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic String remove(String key) {\n\t\tint hashVal = hashFunc(key);\n\t\twhile (hashArray[hashVal] != null) {\n\t\t\tif (hashArray[hashVal].value.equals(key)) {\n\t\t\t\thashArray[hashVal] = deleted;\n\t\t\t\tthis.numOfItems--;\n\t\t\t\treturn key;\n\t\t\t}\n\t\t\thashVal++;\n\t\t\thashVal = hashVal % size;\n\n\t\t}\n\t\treturn null;\n\t}",
"public void remove(K key){\n\t\tfor(int i = 0; i<keys.length;i++)\n\t\t\tif (keys[i] != null && keys[i].equals(key)){\n\t\t\t\t\tkeys[i] = null;\n\t\t\t\t\telem[i] = null;\n\t\t\t\t\thowMany = howMany - 1;\n\t\t\t\t}\n\t}",
"@Override\r\n\tpublic void removeElement(K key) {\n\t\tque.remove(key);\r\n\t\thashMap.remove(key);\r\n\t}",
"public Object removeItem (String key);",
"V remove(Object key);",
"public Object remove(String key);",
"V remove(K key);",
"V remove(K key);",
"V remove(K key);",
"public boolean remove(Key key) ;",
"@Override\n\tpublic V remove(K key) {\n\t\tint h = Math.abs(key.hashCode()) % nrb;// calculam hash-ul asociat cheii\n\n\t\tfor (int i = 0; i < b.get(h).getEntries().size(); i++) {\n\t\t\t// parcurgerea listei de elemente pentru a gasi cheia ceruta si\n\t\t\t// stergerea acesteiu din lista\n\t\t\tif (b.get(h).getEntries().get(i).getKey().equals(key)) {\n\t\t\t\tV x = b.get(h).getEntries().get(i).getValue();\n\t\t\t\tb.get(h).e.remove(i);\n\t\t\t\treturn x;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}",
"public void remove(K key);",
"public Entry remove(Object key) {\n int i = compFunction(key.hashCode());\n SList chain = buckets[i];\n try {\n for (SListNode n = (SListNode) chain.front(); n.isValidNode(); n = (SListNode) n.next()) {\n Entry e = (Entry) n.item();\n if (e.key.equals(key)) {\n n.remove();\n size--;\n return e;\n }\n }\n } catch(InvalidNodeException e) {\n System.out.println(e);\n }\n return null; \n }",
"void remove(String key);",
"void remove(String key);",
"void remove(String key);",
"@Override\n public V remove(K key) {\n Entry<K, V> removed = new Entry<>(null, null);\n if(containsKey(key)) {\n LinkedList<Entry<K, V>> pointer = entryArr[Math.floorMod(key.hashCode(), entryArr.length)];\n for(int i = 0; i < pointer.size(); i++) {\n if(pointer.get(i).keyEquals(new Entry<K, V>(key, null))) {\n removed = pointer.get(i);\n pointer.remove(pointer.get(i));\n break;\n }\n }\n size--;\n }\n return removed.value;\n }",
"void remove(K key);",
"void remove(K key);",
"void remove(K key);",
"protected MapElement removeElement(int key) {\n int index = key % capacity;\n if (index < 0) {\n index = -index;\n }\n\n if (map[index] == null) {\n return null;\n } else {\n MapElement me = map[index];\n MapElement prev = null;\n\n while (true) {\n if (me.getKey() == key) {\n // Keys match\n if (me.beforeRemove()) {\n if (prev == null) {\n // The first element in the chain matches\n map[index] = me.getNext();\n } else {\n // An element further down in the chain matches - \n // delete it from the chain\n prev.setNext(me.getNext());\n }\n contents--;\n }\n return me;\n } else {\n // Keys don't match, try the next element\n prev = me;\n me = me.getNext();\n if (me == null) {\n return null;\n }\n }\n }\n }\n }",
"public boolean remove(K key);",
"boolean remove(K key);",
"boolean remove(K key);",
"V remove(final K key);",
"public V remove(K key);",
"public V remove(K key);",
"public Object remove(Object key)\n\t{\n\t\tremoveOperator(key);\n\t\tremoveLogicalOperator(key);\n\t\treturn super.remove(key);\n\t}",
"@Override\n public V remove(K key) {\n// int index = h.apply(key, this.array.length);\n// LinkedList<Entry<K,V>> chain = this.array[index];\n// for (Entry<K,V> item : chain) {\n// if (item.key == key) {\n// chain.remove(item);\n// itemCount--;\n// return item.value;\n// }\n// }\n// return null; // Throw exception\n for (int i = 0; i < this.array.length; i++) {\n if (this.array[i] != null) {\n for (Entry<K,V> item : this.array[i]) {\n if (item.key == key) {\n this.array[i].remove(item);\n itemCount--;\n return item.value;\n }\n }\n }\n }\n return null;\n }",
"@Override\n\tpublic V remove(Object key) {\n\t\tkeys.remove(key);\n\t\treturn map.remove(key);\n\t}",
"@Override\r\n\tpublic V remove(Object key) {\r\n\t\tint index = key.hashCode() % numBuckets;\r\n\t\treturn ((Bucket) buckets[index]).remove((K) key);\r\n\t}",
"public abstract boolean remove(Key key);",
"public void remove(int key) {\n hashMap.removeIf(pair -> pair[0] == key);\n }",
"public V remove(final K key) {\n expunge();\n final int hash = hash(key);\n final int index = index(hash, entries.length);\n Entry<K, V> temp = entries[index];\n Entry<K, V> previous = temp;\n\n while (temp != null) {\n final Entry<K, V> next = temp.nextEntry;\n if (hash == temp.hash && key == temp.get()) {\n size--;\n if (previous == temp) {\n entries[index] = next;\n } else {\n previous.nextEntry = next;\n }\n return temp.value;\n }\n previous = temp;\n temp = next;\n }\n\n return null;\n }",
"void remove(String aKey);",
"public void remove(long key) {\r\n removeElement(key);\r\n }",
"public void remove(K key)\n {\n AssociationList<K, V> bucket = this.get(this.find(key));\n if (bucket != null)\n {\n bucket.remove(key);\n } // if (bucket != null)\n }",
"public <K> boolean remove(K key);",
"public void remove(E key) {\t//O(n)\r\n\t\t//checks if there is an element with the same value as the key\r\n\t\tint index=compareTo(key);\t\r\n\t\tif (index!=-1) {\t//element exists in array\r\n\t\t\tfor (int k=index+1; k<=size;k++) {\t//shifting element\r\n\t\t\t\tlist[k-1]=list[k];\r\n\t\t\t}\r\n\t\t\tsize--;\t//decreasing size\r\n\t\t\t//checks if the size of array is not 0 and less than 25% of the capacity of the array\r\n\t\t\tif (size!=0 && capacity/size >=4)\r\n\t\t\t\tresize(this.capacity/2);\t//decreasing size of array\r\n\t\t\tSystem.out.println(key+\" removed!\");\r\n\t\t} else {\t//element doesn't exist in array\r\n\t\t\tSystem.out.println(key +\" is not in the list\");\r\n\t\t}\r\n\t}",
"public void removeAllWithKey(k key) {\n\t\t\n\t\tint b = hash(key);\n\t\tNode<k,v> curr = buckets[b];\n\t\tNode<k,v> previous = null;\n\t\t\n\t\twhile (curr != null) {\n\t\t\tif (key.equals(curr.getKey())) { // check if keys match\n\t\t\t\n\t\t\t\tif (previous == null) {\n\t\t\t\t\tbuckets[b] = curr.getNext(); // if removing first item, set the next as first\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tprevious.setNext(curr.getNext()); // else set the previous' next to curr's next\n\t\t\t\t}\t\t\n\t\t\t} else {\n\t\t\t\tprevious = curr; // if match wasn't found, set previous to current before moving on\n\t\t\t}\n\t\t\tcurr = curr.getNext(); // move in SLL\n\t\t}\n\t}",
"private Entry1 removeEntryForKey(Object key){\n Object k= maskNull(key);\n int i=hCode(key,table.length);\n Entry1 previous=null;\n for(Entry1 e=table[i]; e!=null; e=e.getNext()){\n if(eq(k, maskNull(e.getKey()))){\n if(e==table[i]){\n table[i]=e.getNext();\n } else{\n previous.setNext(e.getNext());\n }\n return e;\n }\n previous=e;\n }\n return null;\n }",
"void removeValue(String key);",
"void removeEntry(K key);",
"@Test\n void testRemoveDeletesElementAfterMultiplePuts() {\n MyList l = new MyList();\n for (int i = 0; i < 10; i++)\n l.put(\"key\" + i, \"value\" + i);\n l.remove(\"key5\");\n\n assertEquals(false, l.contains(\"key5\"));\n }",
"public void remove(int key) {\n int hashedKey = hash(key);\n Entry entry = map.get(hashedKey);\n if (entry.key == -1) {\n return;\n } else if (entry.key == key) {\n if (entry.next != null) map.set(hashedKey, entry.next);\n else entry.key = -1;\n } else if (entry.next != null) {\n Entry pre = entry, cur = entry.next;\n while (cur.next != null && cur.key != key) {\n pre = cur;\n cur = cur.next;\n }\n if (cur.key == key) {\n pre.next = cur.next;\n }\n }\n }",
"public abstract V remove(K key);",
"@Override\n\t@TimeComplexity(\"O(n)\")\n\tpublic V remove(K key) {\n\t/* TCJ\n\t * Binary search operation: log n\n\t * Iterate through new collection: n\n\t */\n\t\tint j = findIndex(key);\n\t\tif ( j == size() || key.compareTo(map.get(j).getKey()) != 0 ) return null;\n\t\treturn map.remove(j).getValue();\n\t}",
"@Override\n public void remove(K key) {\n super.remove(key);\n keySet.remove(key);\n }",
"@Override\n public V remove(K key, V value) {\n V val = get(key);\n if (val != null && value != null && val.equals(value)) {\n root = removeHelper(root, key);\n size -= 1;\n }\n return val;\n// throw new UnsupportedOperationException(\"Unsupported operation, sorry!\");\n }",
"Object remove(Object key) throws NullPointerException;",
"public void remove(int key) {\n\n }",
"public V remove(K key) {\r\n\t\t// TODO Complete this!\r\n\t\tint place = hash(key.hashCode());\r\n\t\tif (hashMapArray[place] != null) {\r\n\t\t\tLinkedList<KVPair> temp = hashMapArray[place];\r\n\t\t\tfor (KVPair i : temp) {\r\n\t\t\t\tif (i.getKey().equals(key)) {\r\n\t\t\t\t\tV oldKey = i.getValue();\r\n\t\t\t\t\ttemp.remove(i);\r\n\t\t\t\t\tsize--;\r\n\t\t\t\t\treturn oldKey;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public void remove(Object key) {\r\n\t\tif (!containsKey(key)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tmodificationCount++;\r\n\t\tsize--;\r\n\r\n\t\tint slotIndex = Math.abs(key.hashCode()) % table.length;\r\n\r\n\t\tif (table[slotIndex].key.equals(key)) {\r\n\t\t\ttable[slotIndex] = table[slotIndex].next;\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tTableEntry<K, V> previousElement = table[slotIndex];\r\n\t\tTableEntry<K, V> currentElement = table[slotIndex].next;// can't be null\r\n\r\n\t\tdo {\r\n\t\t\tif (currentElement.key.equals(key)) {\r\n\t\t\t\tpreviousElement.next = currentElement.next;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tpreviousElement = currentElement;\r\n\t\t\tcurrentElement = currentElement.next;\r\n\t\t} while (currentElement != null);\r\n\t}",
"Entry<Key, Value> remove(Entry<Key, Value> entry);",
"public void remove(String key) {\n \ttmp = getNode(key);\n \tif (tmp == null) {\n \t\treturn;\n \t} else {\n \t\tif (first.getKey() == key) {\n \t\t\tfirst = first.getNext();\n \t\t\tif (first == null) {\n \t\t\t\tlen--;\n \t\t\t\treturn;\n \t\t\t}\n \t\t\tfirst.setPrev(null);\n \t\t} else if (last.getKey() == key) {\n \t\t\tlast = last.getPrev();\n \t\t\tlast.setNext(null);\n \t\t\tif (last.getKey() == first.getKey()) {\n \t\t\t\tlast = null;\n \t\t\t}\n \t\t} else {\n \t\t\tNode tmp1 = tmp.getNext();\n \t\t\tNode tmp2 = tmp.getPrev();\n \t\t\ttmp1.setPrev(tmp2);\n \t\t\ttmp2.setNext(tmp1);\n \t\t}\n \tlen--;\n \t}\n }",
"public void remove(Key key) {\n\n\t\tif (!contains(key)) return;\n\t\tint index = locate(key);\n\t\tkeys[index] = null;\n\t\tvalues[index] = null;\n\t\tthis.size--;\n\n\t\t// Check to see if any of the items in the table that follow\n\t\t// this one had collided with the key that was just removed.\n\t\t// If so, we need to rehash/reinsert them.\n\n\t\tint i = increment(index);\n\t\twhile (keys[i] != null) {\n\n\t\t\t// Save the key/value pair at this location.\n\n\t\t\tKey savedKey = keys[i];\n\t\t\tValue savedValue = values[i];\n\n\t\t\t// And temporarily remove it from the hash map.\n\n\t\t\tkeys[i] = null;\n\t\t\tvalues[i] = null;\n\n\t\t\t// Figure out where it should go now and reinsert it.\n\n\t\t\tindex = locate(savedKey);\n\t\t\tkeys[index] = savedKey;\n\t\t\tvalues[index] = savedValue;\n\n\t\t\t// Advance to the next item.\n\t\t\ti = increment(i);\n\t\t}\n\t}",
"@Override\n\t\t\tpublic AnalysisResult remove(Object key) {\n\t\t\t\treturn null;\n\t\t\t}",
"void remove(Object indexedKey, Object key);",
"void remove(@NonNull String key);",
"public void remove(Object key){\n map.remove(key);\n }",
"public void remove(T key) {\n Node<T> previous = null;\n Node<T> current = First;\n\n if (current == null) {\n return;\n }\n\n while (current != null) {\n if (current.item == key) {\n if (previous == null) { //第一个就是要找的\n //remove\n First = current.next;\n } else {\n previous.next = current.next; //remove\n }\n } else {\n previous = current; //only happens when nothing removed\n }\n current = current.next;\n }\n }",
"@Override\n public V remove(K key) {\n V val = get(key);\n if (val != null) {\n root = removeHelper(root, key);\n size -= 1;\n }\n return val;\n// throw new UnsupportedOperationException(\"Unsupported operation, sorry!\");\n }",
"public Entry remove(Object key) {\r\n if (find(key) == null) {\r\n return null;\r\n } else { \r\n try{\r\n int index = compFunction(key.hashCode());\r\n if (hash_table[index].size() == 1) {\r\n Entry entry = (Entry)hash_table[index].front().item();\r\n hash_table[index] = null;\r\n return entry;\r\n } else { \r\n DListNode current = (DListNode) hash_table[index].front();\r\n while(current.isValidNode()){\r\n Entry pair = (Entry) current.item();\r\n if(pair.key().equals(key)){\r\n current.remove();\r\n size--;\r\n return pair;\r\n }\r\n current = (DListNode) current.next();\r\n }\r\n \r\n System.out.println(\"Couldn't find the item\");\r\n return null;\r\n }\r\n \r\n }catch(InvalidNodeException e){\r\n return null;\r\n }\r\n }\r\n }",
"void removeKey(int i);",
"@Override\n public T remove(Object key) {\n // Do I have an entry for it?\n Map.Entry<String, T> entry = entries.get((String) key);\n if (entry != null) {\n entries.remove(key);\n // Change the underlying map.\n return map.remove(prefix + key);\n }\n return null;\n }",
"public void remove(K key) {\r\n size--;\r\n int hash = key.hashCode() % data.length;\r\n if (hash < 0){\r\n hash *= -1;\r\n }\r\n if (data[hash] == null) {throw new NullPointerException(\"no such key\");}\r\n if (data[hash].key == key || data[hash].equals(key)){\r\n data[hash] = data[hash].next;\r\n return;\r\n }\r\n Node currentNode = data[hash];\r\n Node targetNode = data[hash].next;\r\n while (targetNode.key != key && !targetNode.key.equals(key)) {\r\n currentNode = currentNode.next;\r\n targetNode = targetNode.next;\r\n }\r\n currentNode.next = targetNode.next;\r\n }",
"synchronized public V removeOne() {\n int i = 0;\n for (; i < keys.length; i++) {\n if (keys[i] == null || keys[i] == skip) {\n continue;\n }\n break;\n }\n if (i == keys.length) {\n return null;\n }\n return (V) remove(keys[i]);\n }",
"@Override\n public V remove(Object key) {\n \t\n \tLinkedList<Entry> tempBucket = chooseBucket(key);\n \t\n \tfor(int i=0;i<tempBucket.size();i++) {\n\t \tEntry tempEntry = tempBucket.get(i);\n\t \t\t\n\t \tif(tempEntry.getKey() == key) {\n\t \t\tV returnValue = tempEntry.getValue();\n\t \t\ttempBucket.remove(i);\n\t \t\tsize --;\n\t \t\treturn returnValue;\n\t \t}\n\t }\n \t\n \tif(size < buckets.length*BETA) {\n \t\trehash(SHRINK_FACTOR);\n \t}\n \t\n \treturn null;\n }",
"boolean remove(Object key, Object value);",
"MapComp<K, V> remove(K k);",
"public DataItem delete(int key){\n\t\tint hashVal = hashFunc(key);\n\t\tint stepSize = hashFunc2(key);\n\t\t\n\t\twhile(hashArray[hashVal] != null){\n\t\t\tif(hashArray[hashVal].getKey() == key){\n\t\t\t\tDataItem temp = hashArray[hashVal];\n\t\t\t\thashArray[hashVal] = nonItem;\n\t\t\t\treturn temp; //find the item\n\t\t\t}\n\t\t\thashVal += stepSize;\n\t\t\thashVal %= arraySize;\n\t\t}\n\t\treturn null;\n\t}",
"@Test\n void testRemoveDeletesHeadAfterMultiplePuts() {\n MyList l = new MyList();\n for (int i = 0; i < 10; i++)\n l.put(\"key\" + i, \"value\" + i);\n String oldHeadKey = l.getHeadKey();\n l.remove(oldHeadKey);\n\n assertEquals(false, l.contains(oldHeadKey));\n }",
"public void remove(int key) {\n newkey = hashfunc(key);\n arr[newkey]= -1;\n \n }",
"boolean remove(byte[] key);",
"public void remove(int key) {\n int index = key % n;\n MapNode node = keys[index];\n for (int i =0; i < node.list.size(); ++i) {\n if (node.list.get(i) == key) {\n node.list.remove(i);\n vals[index].list.remove(i);\n }\n }\n }",
"public Entry remove(Object key) {\n int hashCode = key.hashCode();\n int index = compFunction(hashCode);\n\n if(defTable[index].isEmpty()) {\n return null;\n }\n\n Entry entry = new Entry();\n ListNode current = defTable[index].front();\n try{\n while(true) {\n if(( (Entry) current.item()).key().equals(key)) {\n entry.key = key;\n entry.value = ((Entry) current.item()).value();\n current.remove();\n size--;\n return entry;\n }\n if(current==defTable[index].back()) {\n break;\n }\n current = current.next();\n }\n } catch(Exception err) {\n System.out.println(err);\n }\n return null;\n }",
"@Override\r\n\tpublic Object removeObject(Object key) {\n\t\treturn null;\r\n\t}",
"public void remove(String key) throws IOException;",
"public V remove(K key)\n\t{\n\t\tcheckForNulls(key);\n\t\tint n = Math.abs(key.hashCode() % entries.length);\n\t\t\n\t\tif (entries[n] == null)\n\t\t\treturn null;\n\t\t\n\t\tV ret = null;\n\t\tfor (Entry e : entries[n])\n\t\t{\n\t\t\tif (key.equals(e.key) == true)\n\t\t\t\tret = e.value;\n\t\t}\n\t\t\n\t\tif (ret == null)\n\t\t\treturn null;\n\t\t\n\t\tentries[n].remove(new Entry(key, null));\n\t\treturn ret;\n\t}",
"public void remove(int key) {\n int index = keys.indexOf(key);\n if(index > 0) {\n keys.remove(index);\n values.remove(index);\n }\n }",
"public V removeKey( K key ) {\r\n\t\tint bucketIndex = getBucketIndex( key );\r\n\t\tMapNode<K, V> head = buckets.get(bucketIndex);\r\n\t\tMapNode<K, V> prev = null;\r\n\t\twhile( head != null ) {\r\n\t\t\tif( head.key.equals(key)) {\r\n\t\t\t\tsize--;\r\n\t\t\t\tif( prev == null ) {\r\n\t\t\t\t\t//sbse first key hi h thn second key\r\n\t\t\t\t\t//ko point kra dege arraylist m \r\n\t\t\t\t\tbuckets.set(bucketIndex, head.next );\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tprev.next = head.next;\r\n\t\t\t\t}\r\n\t\t\t\treturn head.value;\r\n\t\t\t}\r\n\t\t\tprev = head;\r\n\t\t\thead = head.next;\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"@Override\n public V remove(Object key) {\n int index = key.hashCode() % table.length;\n if (index < 0) {\n index += table.length;\n }\n if (table[index] == null) {\n return null; // key is not in table\n }\n for (Entry<K, V> entry : table[index]) {\n if (entry.getKey().equals(key)) {\n V value = entry.getValue();\n table[index].remove(entry);\n numKeys--;\n if (table[index].isEmpty()) {\n table[index] = null;\n }\n return value;\n }\n }\n return null;\n }",
"@Override\n public boolean remove(Comparable k) {\n\n boolean found = false; // Boolean for found key\n\n // check is null\n if (k == null) {\n throw new IllegalArgumentException(\"null key\");\n }\n\n else {\n // Temporary array to hold Pairs\n Pair[] newList = new Pair[this.CAPACITY];\n\n // Loop over Pairs\n for (int i = 0; i < this.size; i++) {\n\n // If found the one to remove...\n if (ls[i].key.equals(k)) {\n\n found = true; // Change to true\n this.size--; // Decrease size\n\n // Inner loop to skip item\n for (int j = i; j < this.size; j++) {\n newList[j] = ls[j + 1];\n }\n\n // Change value of this.ls to reference newList\n this.ls = newList;\n\n return found;\n\n } else {\n // If not yet found, add to newList\n newList[i] = ls[i];\n }\n }\n\n // Same thing in reassigning\n this.ls = newList;\n return found;\n }\n }",
"public Entry<C> remove(long key) {\n try {\n int index = search(key);\n Entry<C> temp = sequence.get(index);\n sequence.remove(index);\n size--;\n return temp;\n\n } catch (NullPointerException e) {\n System.out.println(\"Key \" + key + \" does not exist\");\n return null;\n }\n }",
"public CourseReading remove(String key) {\n\t\tif (containsKey(key) == true) {\r\n\t\t\tint HashKey = key.hashCode() % 31;\r\n\t\t\tif (HashKey > K.length - 1) {\r\n\t\t\t\twhile (HashKey > K.length - 1) {\r\n\t\t\t\t\tHashKey %= K.length;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (String c : K[HashKey]) {\r\n\t\t\t\tif (c.equals(key)) {\r\n\t\t\t\t\t// get location of key to delete it\r\n\t\t\t\t\tint KeyLocation = K[HashKey].indexOf(key);\r\n\t\t\t\t\tK[HashKey].remove(KeyLocation);\r\n\t\t\t\t\tV[HashKey].remove(KeyLocation);\r\n\t\t\t\t\tsize--;\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public void remove(int key) {\n int pos = key % this.size;\n Bucket bucket = this.buckets[pos];\n bucket.delete(key);\n }",
"public Entry remove(K key){\r\n int loc = find(key);\r\n if(hashTable[loc]!=null && hashTable[loc].equals(key)){\r\n Entry<K,V> result = hashTable[loc];\r\n hashTable[loc].isDeleted = true;\r\n size--;\r\n return result;\r\n }\r\n else\r\n return null;\r\n }",
"void remove(KeyType key);",
"public V remove(K key, V value) {\n if (key == null || !keySet.contains(key))\n return null;\n int index = reduce(key, buckets.size());\n ArrayList<Entry> items = buckets.get(index);\n for (Entry e : items) {\n if (e.key.equals(key)) {\n if (e.value.equals(value)) {\n\n items.remove(e);\n keySet.remove(key);\n numEntries--;\n return e.value;\n }\n }\n }\n return null;\n }",
"private boolean delete(K key) {\n\t\t\tif (!keySet.contains(key)) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\tint index = keySet.indexOf(key);\n\t\t\t\tkeySet.set(index, keySet.get(size - 1));\n\t\t\t\tvalueSet.set(index, valueSet.get(size - 1));\n\t\t\t\tkeySet.set(size - 1, null);\n\t\t\t\tvalueSet.set(size - 1, null);\n\t\t\t\tsize--;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}",
"private boolean performSingleKeyRemoval(final K key)\r\n {\r\n final boolean removed;\r\n // remove single item.\r\n final IndexedDiskElementDescriptor ded = keyHash.remove(key);\r\n removed = ded != null;\r\n addToRecycleBin(ded);\r\n\r\n log.debug(\"{0}: Disk removal: Removed from key hash, key [{1}] removed = {2}\",\r\n logCacheName, key, removed);\r\n return removed;\r\n }",
"public void delete(String key){\r\n\t\tint hash = hash(key);\r\n for(int i = 0; i < M; i++){\r\n if(hash + i < M){\r\n if(keys[hash + i] != null && keys[hash + i].equals(key)){\r\n remove(hash + i);\r\n N--;\r\n break;\r\n }\r\n }else{\r\n if(keys[hash + i - M] != null && keys[hash + i - M].equals(key)){\r\n remove(hash + i - M);\r\n N--;\r\n break;\r\n }\r\n }\r\n\t\t}\r\n }",
"Object removeFirst();",
"public Entry<K, V> remove(K key) {\r\n try {\r\n int hash = key.hashCode();\r\n ListNode<Entry<K, V>> node = table[compFunction(hash)].front();\r\n if (node.isValidNode()) {\r\n Entry<K, V> entry = (Entry<K, V>) node.getItem();\r\n node.remove();\r\n return entry;\r\n }\r\n } catch (Exception e) {\r\n System.out.println(\"Unhashable key: \" + e);\r\n }\r\n return null;\r\n }",
"@Override\n\tpublic V remove(Object key) {\n\t\tIterator it1 = tabla.iterator();\n\t\tV valor = null;\n\t\tint i = 0;\n\t\twhile (it1.hasNext()) {\n\t\t\tit1.next();\n\t\t\tint indice = tabla.get(i).keySet().indexOf(key);\n\t\t\tif (indice != -1) {\n\t\t\t\tvalor = tabla.get(i).valueSet().get(indice);\n\t\t\t\ttabla.get(i).keySet().remove(indice);\n\t\t\t\ttabla.get(i).valueSet().remove(indice);\n\t\t\t}\n\t\t\ti++;\n\n\t\t}\n\t\treturn valor;\n\t}",
"@Override\n\tpublic V remove(Object key) {\n\t\treturn null;\n\t}",
"@Override\n\tpublic V remove(Object key) {\n\t\treturn null;\n\t}",
"@Override\n public synchronized Object remove(Object key) {\n String strkey = key.toString();\n if (this.ignoreCase) {\n strkey = (String) this.keyMap.remove(strkey.toLowerCase());\n if (strkey == null)\n return null;\n }\n return super.remove(strkey);\n }",
"@Override\n\tpublic V remove(K key) {\n\t\treturn null;\n\t}",
"void remove(K id);",
"public void remove(K key) {\n for (Table.Entry e : entries) {\n if (e.getKey().equals(key)) {\n entries.remove(e);\n return;\n }\n }\n\n\n }"
] | [
"0.72670174",
"0.7196945",
"0.7193945",
"0.71583724",
"0.7072008",
"0.7008126",
"0.69432217",
"0.69432217",
"0.69432217",
"0.69392234",
"0.68541473",
"0.68191385",
"0.68138874",
"0.6795681",
"0.6795681",
"0.6795681",
"0.6785155",
"0.67758",
"0.67758",
"0.67758",
"0.676362",
"0.6753281",
"0.67369264",
"0.67369264",
"0.67150295",
"0.6707708",
"0.6707708",
"0.67029107",
"0.6667475",
"0.6653904",
"0.66152495",
"0.6615126",
"0.6609179",
"0.6585918",
"0.6578876",
"0.65558153",
"0.65492034",
"0.6549006",
"0.6530846",
"0.651411",
"0.6502164",
"0.64869374",
"0.64680564",
"0.6464593",
"0.6463295",
"0.64559484",
"0.64460725",
"0.6445073",
"0.64422876",
"0.6423679",
"0.64110905",
"0.6409096",
"0.63986784",
"0.63894063",
"0.6386165",
"0.6384921",
"0.63759035",
"0.6351615",
"0.63513595",
"0.6351001",
"0.6342043",
"0.63401735",
"0.6338744",
"0.633583",
"0.6319548",
"0.6306312",
"0.62887084",
"0.62872076",
"0.62767994",
"0.62764555",
"0.62713385",
"0.627033",
"0.62572587",
"0.6255556",
"0.62510765",
"0.62294686",
"0.6221712",
"0.6209841",
"0.62028605",
"0.6194489",
"0.6194257",
"0.61930066",
"0.6189841",
"0.61844325",
"0.61731887",
"0.6161505",
"0.6157346",
"0.6151169",
"0.61504436",
"0.6146532",
"0.6140469",
"0.6140413",
"0.6128946",
"0.61277914",
"0.6111284",
"0.6097665",
"0.6097665",
"0.6086529",
"0.60858166",
"0.6061757",
"0.60581696"
] | 0.0 | -1 |
Gets head element from List and removes it. return null if List is empty | public PairStringString popHeadElement() {
if (head == null) {
return null;
}
final PairStringString elem = head.pairStringString;
head.remove();
head = head.next;
size--;
return elem;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public T removeHead()\n\t{\n\t\tif(size == 0)\n\t\t{\n\t\t\tSystem.out.println(\"list is empty\");\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t//advance head reference\n\t\tT value = head.value;\n\t\thead = head.next;\n\t\t\n\t\tsize--;\n\t\treturn value;\n\t\t\n\t}",
"private E removeFirst ()\n {\n Node<E> temp = head;\n if (head != null) {\n head = head.next;\n size--;\n return temp.data;\n }\n else\n return null;\n }",
"public Object removeFirst() {\n if(head == null) return null;\n if(head.getNext() == null) {\n Object temp = head.getElement();\n head = tail = null;\n return temp;\n }\n\n Object temp = head.getElement();\n Node n = head.getNext();\n n.setPrevious(null);\n head = n;\n\n return temp;\n }",
"public T deleteFromHead() {\n if (isEmpty()) \n return null;\n T el = head.info;\n if (head == tail) // if only one node on the list;\n head = tail = null;\n else head = head.next;\n return el;\n }",
"protected T removeFromHead()\n\t{\n\t\tif(head == null)\n\t\t\treturn null;\n\t\t\n\t\tT ret = head.getVal();\n\t\thead = head.getNext();\n\t\t\n\t\tif(head == null)\n\t\t\ttail = head;\n\t\telse\n\t\t\thead.setPrev(null);\n\t\t\n\t\treturn ret;\n\t}",
"T removeFromHead() {\n if (this.size() == 0) {\n throw new RuntimeException(\"Cannot remove from an empty list\");\n }\n return header.removeFromHead();\n }",
"public E removeFirst() { // removes and returns the first element\n // TODO\n if (isEmpty( )) return null;\n Node<E> head = tail.getNext();\n if (head == tail) tail = null;\n else tail.setNext(head.getNext( ));\n size--;\n return head.getElement( );\n }",
"public Object removeFirst(){\n //Check if there is data to be removed, if not return null\n if(size == 0){\t//size 0 indicates no data in the linkedlist\n return null;\n }\n MovieNode removed = head.next;\n head.next = head.next.next;\n size--;\n return removed.data;\n }",
"public T removeFirst() {\r\n \r\n if (size == 0) {\r\n return null;\r\n }\r\n \r\n T deleted = front.element;\r\n front = front.next;\r\n size--;\r\n \r\n return deleted;\r\n }",
"public T removeFirst() throws EmptyCollectionException\n //PRE: list is not empty\n //POS: first node is removed / list has one less node\n //TAS: remove first element and return it\n \n //if (count == 1)\n //{\n // T result = head.getElement();\n // head = null;\n // tail = null;\n // return result;\n //}\n //else {\n // T result = head.getElement();\n // head = head.getNext();\n // count--;\n // return result;\n // }\n \n }\n {\n T result = null;\n\n if(isEmpty()){\n throw new EmptyCollectionException(\"list\");\n }\n\n result = front.getElement();\n front = front.getNext();\n count--;\n\n if(isEmpty()){\n // reset rear after removing the last node\n rear = null;\n }\n\n return result;\n }",
"public Item removeFirst() {\n if (isEmpty()) {\n throw new NoSuchElementException();\n }\n Item item = head.item;\n if (size == 1) {\n tail = null;\n head = null;\n } else {\n Node<Item> nextHead = head.next;\n nextHead.prev = null;\n head = nextHead;\n }\n\n size--;\n return item;\n }",
"public Item removeFirst(){\r\n\t\tif (isEmpty()) throw new NoSuchElementException(\"Queue underflow\");\r\n\t\tItem tmp = list[first];\r\n\t\tlist[first++] = null;\r\n\t\tn--;\r\n\t\tprior=first-1;\r\n\t\tif(first==list.length){first=0;}\r\n\t\tif (n > 0 && n == list.length/4) resize(list.length/2); \r\n\t\treturn tmp;}",
"public E removeFirst() {\n if(isEmpty()){\n return null;\n }else{\n return remove(header.getNext());\n }\n }",
"private static Node deleteFirst(Node head) {\n if (head == null) {\n return null;\n }\n Node current = head;\n\n // only one element\n if (current.next == head) {\n head.next = null; // or head = null is fine for GC\n return null;\n }\n\n while(current.next != head) {\n current = current.next;\n }\n // removing head from list\n current.next = head.next;\n // prevent memory leak\n head.next = null;\n head = current.next;\n return head;\n }",
"public Item removeFirst() {\n\t\tif (isEmpty()) {\n\t\t\tthrow new NoSuchElementException();\n\t\t}\n\t\tNode<Item> tmp = head;\n\t\thead = head.next;\n\t\tif (head == null) {\n\t\t\ttail = null;\n\t\t} else {\n\t\t\thead.prev = null;\n\t\t}\n\t\tN--;\n\t\ttmp.next = null;\n\t\treturn tmp.item;\n\t}",
"public Item removeFirst() {\n //check if the DList is empty or not:\n if(isEmpty()) throw new NoSuchElementException(\"Failed to perform removeFirst() bacause the DList instance is empty!\");\n Node oldFirst = first.next;\n Item item = oldFirst.data; \n\n // pointer re-wiring:\n Node newFirst = oldFirst.next; \n first.next = newFirst;\n newFirst.prev = first;\n oldFirst.next = null;\n oldFirst.prev = null;\n\n // check if last pointer has to be updated or not (paying the peiper):\n if(isEmpty()) {\n last.prev = first; // update the last sentinel node to point to the first sentinel node\n }\n\n // update the size: \n size--;\n\n return item;\n }",
"public E removeFront() {\n\t\tif (count == 0) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tE temp = head.value;\n\t\t\thead = head.next;\n\t\t\tcount--;\n\t\t\treturn temp;\n\t\t}\n\t}",
"public T removeFirst()\r\n {\r\n T removedData; // holds data from removed node\r\n\r\n if (numElements == 0)\r\n throw new NoSuchElementException(\r\n \"Remove attempted on empty list\\n\");\r\n removedData = front.data;\r\n front = front.next;\r\n if (numElements == 1)\r\n rear = null;\r\n \r\n numElements--;\r\n return removedData;\r\n }",
"Node removeFirst() {\n\t\tNode tmp = head;\n\t\thead = head.next;\n\t\treturn tmp;\n\t}",
"public Item removeFirst() {\n if (size == 0) {\n return null;\n } else if (size == 1) {\n StuffNode i = sentinel.next;\n sentinel.next = sentinel;\n sentinel.prev = sentinel;\n size -= 1;\n return i.item;\n } else {\n StuffNode i = sentinel.next;\n sentinel.next = i.next;\n i.next.prev = sentinel;\n size -= 1;\n return i.item;\n }\n }",
"public Item getFirst() {\n Node removed = head.next;\n head.next = removed.next;\n removed.next = null;\n size--;\n return removed.item;\n }",
"public T removeFirst() {\n if (size == 0) {\n return null;\n }\n nextFirst = plusOne(nextFirst);\n size -= 1;\n T toRemove = items[nextFirst];\n items[nextFirst] = null;\n if (isSparse()) {\n resize(capacity / 2);\n }\n return toRemove;\n }",
"T removeFromHead() {\n return this.next.remove();\n }",
"public synchronized T get(){\n if (list.isEmpty()) return null;\n return list.remove(0);\n }",
"public T removeFirst() {\n if (size == 0) {\n return null;\n }\n if (size == 1) {\n size--;\n return array[front];\n }\n this.checkReSizeDown();\n size--;\n front++;\n this.updatePointer();\n return array[Math.floorMod(front - 1, array.length)];\n }",
"public Object removeFirst(){\n if (first == null)\n throw new NoSuchElementException();\n Object element = first.data;\n first = first.next;\n return element ;\n }",
"public Item removeFirst() {\n if (isEmpty()) {\n throw new NoSuchElementException();\n }\n Item item = first.item;\n first = first.next;\n if (first == null) {\n last = null;\n }\n else {\n first.pre = null;\n }\n len--;\n return item;\n }",
"public E removeFirst() {\n\n\t\tif (mSize == 0)\n\t\t\tthrow new NoSuchElementException();\n\n\t\tE retVal = remove(mHead.next);\n\n\t\tmSize--;\n\t\tmodCount++;\n\n\t\treturn retVal;\n\t}",
"public L removeFromFront(){\n\t\tif(isEmpty())//throw exception if List is empty\n\t\tthrow new IllegalStateException(\"List \" + name + \" is empty\");\n\n\t\tL removedItem = (L) firstNode.data; //retrieve data being removed\n\n\t\t//update references firstNode and lastNode\n\t\tif(firstNode == lastNode)\n\t\tfirstNode = lastNode = null;\n\t\telse\n\t\tfirstNode = firstNode.getNext();\n\n\t\treturn removedItem; //return removed node data\n\t}",
"@Override\n public E removeFirst() {\n if (isEmpty()) {\n throw new NoSuchElementException(\"No elements in dequeue\");\n }\n E value = dequeue[head];\n dequeue[head] = null;\n head = ++head % dequeue.length;\n size--;\n if (size < dequeue.length / 2) {\n reduce();\n }\n return value;\n }",
"public T removeFirst(){\n\tT ret = _front.getCargo();\n\t_front = _front.getPrev();\n\t_front.setNext(null);\n\t_size--;\n\treturn ret;\n }",
"public T removeFirst();",
"@Override\n public Item removeFirst() {\n nextFirst = moveForward(nextFirst, 1);\n Item output = items[nextFirst];\n items[nextFirst] = null;\n size -= 1;\n return output;\n }",
"public T removeFirst() \r\n {\r\n if (isEmpty()) throw new NoSuchElementException();\r\n Node<T> currFirst = sentinel.next;\r\n Node<T> toBeFirst = currFirst.next;\r\n T currFirstVal = currFirst.getValue();\r\n toBeFirst.prev = sentinel;\r\n sentinel.next = toBeFirst;\r\n currFirst = null;\r\n size--;\r\n return currFirstVal;\r\n }",
"public Item removeFirst() throws NoSuchElementException {\n checkDequeIsNotEmpty();\n\n Item item = first.item;\n first = first.next;\n size--;\n\n if (isEmpty()) {\n // to avoid loitering; first already points to null\n last = null;\n } else {\n first.prev = null;\n }\n return item;\n }",
"public E removeFirst() throws NoSuchElementException{\n if(size == 0)\n throw new NoSuchElementException();\n else{\n E removedElement = head.getNext().getElement();\n head.setNext(head.getNext().getNext());\n head.getNext().setPrevious(head);\n size--;\n return removedElement;\n }\n }",
"public void removeFirst() {\n\t\t\thead = head.next;\n\t\t}",
"public Item removeFirst() {\n\t\tif (first == null) {\n\t\t\tthrow new java.util.NoSuchElementException();\n\t\t}\n\t\tItem temp = first.item;\n\t\tif (first == last) {\n\t\t\tlast = null;\n\t\t\tfirst = null;\n\t\t} else {\n\t\t\tfirst = first.next;\n\t\t\tfirst.previous = null;\n\t\t}\n\t\tsize--;\n\t\treturn temp;\n\t}",
"@Override\n public E deleteMin()\n {\n return list.removeFirst();\n }",
"public Item removeFirst() {\n if (isEmpty()) {\n throw new NoSuchElementException();\n }\n\n Node oldFirst = this.first;\n this.first = oldFirst.next;\n this.size--;\n\n if (this.size != 0) {\n this.first.prev = null;\n } else {\n this.last = null;\n }\n\n return oldFirst.item;\n }",
"protected T removeBeginning() {\r\n\t\tif (!this.isEmpty()) {\r\n\t\t\tSNode<T> startNode = this.getHead().getPrev();\r\n\t\t\tthis.getHead().setPrev(startNode.getPrev());\r\n\t\t\tsize--;\r\n\t\t\treturn startNode.getValue();\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public T removeFromFront() {\n DoublyLinkedListNode<T> temp = head;\n if (size == 0) {\n throw new NoSuchElementException(\"The list is empty, so there\"\n + \" is nothing to get.\");\n } else {\n if (head == tail) {\n head = tail;\n tail = null;\n return temp.getData();\n } else {\n head = head.getNext();\n head.setPrevious(null);\n size -= 1;\n return temp.getData();\n }\n }\n\n\n }",
"@Override\r\n\tpublic E removeFirst() {\n\t\treturn null;\r\n\t}",
"public T deleteHead(){\n if (head.next != tail || tail.prev != head) {\n T data = head.next.data;\n head = head.next;\n return data;\n }\n return null;\n }",
"public Item removeFirst() {\n if (first == null)\n throw new NoSuchElementException();\n \n final Item element = first.item;\n final Node<Item> next = first.next;\n first.item = null;\n first.next = null; // help GC\n first = next;\n if (next == null)\n last = null;\n else\n next.prev = null;\n size--;\n \n return element;\n }",
"public T removeFirst( ){\r\n\t\t//calls remove onfirst\r\n\t\tT toRemove = getFirst();\r\n\t\treturn remove(toRemove);\r\n\t}",
"Object removeFirst();",
"public E removeFirst(){\r\n return null;\r\n }",
"public T extractMin() {\n\t\tif (heapSize > 0) {\n\t\t\tSystem.out.print(\"LIST: \" );\n\t\t\tprintList();\n\t\t\tT retEle = lstEle.get(0);\n\t\t\tSystem.out.println(\"\\tRemoving : \" +retEle);\n\t\t\tlstEle.set(0, lstEle.get(heapSize - 1));\n\t\t\tlstEle.set(heapSize - 1, null);\n\t\t\theapSize--;\n\t\t\theapify();\n\t\t\tSystem.out.print(\"After HEAPIFY : \");\n\t\t\tprintList();\n\t\t\treturn retEle;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}",
"public T removeFirst() {\n return remove(sentinel.next);\n }",
"public T removeFromFront() throws EmptyListException \n\t{\n\t\tif (isEmpty()) // throw exception if List is empty\n\t\t\tthrow new EmptyListException(name);\n\n\t\tT removedItem = firstNode.data; // retrieve data being removed\n\n\t\t// update references firstNode and lastNode\n\t\tif (firstNode == lastNode)\n\t\t\tfirstNode = lastNode = null;\n\t\telse\n\t\t\tfirstNode = firstNode.nextNode;\n\t\tsize--;\n\t\treturn removedItem; // return removed node data\n\t}",
"public int deleteFromHead() {\n int el = head.info;\r\n if (head == tail) // if only one node on the list;\r\n head = tail = null;\r\n else head = head.next;\r\n return el;\r\n }",
"public E removeFirst();",
"public Item removeFirst() {\n if (isEmpty()) {\n throw new NoSuchElementException(\"queue is empty\");\n }\n Item a;\n a = first.item;\n first = first.next;\n if (first == null) {\n last = null;\n }\n else first.prev = null;\n size--;\n return a;\n }",
"public T removeFromFront() throws EmptyListException {\n if (isEmpty()) {\n throw new EmptyListException(nameList);\n }\n\n //get a generic data from first node\n T removedItem = firstNode.getData();\n \n //if first and last nodes are one node we make them null beacuse the last node of list is deleted\n if (firstNode == lastNode) {\n firstNode = lastNode = null; \n } \n \n //if not empty end not last, get the next node and assign it to first\n else {\n firstNode = firstNode.getNext();\n }\n \n //give generic data back\n return removedItem;\n }",
"public Item removeFirst() {\n if (isEmpty())\n throw new NoSuchElementException();\n Item item = first.item;\n first = first.next;\n if (first != null)\n first.prev = null;\n else\n last = first;\n size--;\n return item;\n }",
"public void removeFirst(){\r\n\t\tNode removedHead = head;\r\n\t\thead = head.next;\r\n\t\tremovedHead = null;\r\n\t}",
"public Item removeFirst(){\n return this.doublyLinkedList.removeFirst();\n }",
"public Item removeFirst() {\n if (!isEmpty()) {\n Item item = first.item;\n first = first.back;\n size--;\n if (size != 0)\n first.front = null;\n return item;\n } else throw new NoSuchElementException(\"?\");\n }",
"public E removeFirst() {\n\t\t// Bitte fertig ausprogrammieren:\n\t\treturn null;\n\t}",
"public Item removeFirst(){\n\t\tif(isEmpty()){\n\t\t\tthrow new NoSuchElementException(\"Queue underflow\");\n\t\t}else{\n\t\t\t//save item to return\n\t\t\tItem returnItem = first.item;\n\t\t\t//delete first node\n\t\t\tfirst = first.next;\n\t\t\tn--;\n\t\t\tif(isEmpty()){\n\t\t\t\tlast = null; // to avoid loitering\n\t\t\t}else{\n\t\t\t\tfirst.prev = null;\n\t\t\t}\n\t\t\treturn returnItem;\n\t\t}\n\t}",
"public T deleteFromTail() {\n if (isEmpty()) \n return null;\n T el = tail.info;\n if (head == tail) // if only one node in the list;\n head = tail = null;\n else { // if more than one node in the list,\n SLLNode<T> tmp; // find the predecessor of tail;\n for (tmp = head; tmp.next != tail; tmp = tmp.next);\n tail = tmp; // the predecessor of tail becomes tail;\n tail.next = null;\n }\n return el;\n }",
"public void removeFirst() throws ListException {\r\n\t\t//This will check if the user is trying to remove from an empty list\r\n\t\tif(isEmpty()){\r\n\t\t\tthrow new ListException(\"Remove from empty list exception\");\r\n\t\t}\r\n\t\t//Set the nextNode pointer past the first element in the list\r\n\t\tDoublyNode nextNode;\r\n\t\tnextNode = head.getNext().getNext();\r\n\r\n\t\tnextNode.setPrev(head);//Set the next nodes previous pointer\r\n\t\thead.setNext(nextNode);//Set the heads next pointer\r\n\t\tnumItems--;//Decrement number of items\r\n\t}",
"public Item removeFirst() {\n\t\tif (count == 0) throw new NoSuchElementException();\n\t\tcount--;\n\t\tItem target = first.item;\n\t\tNode nextNode = first.next;\n\t\tfirst = null;\n\t\tif (count > 0) {\n\t\t\tfirst = nextNode;\n\t\t} \n\t\treturn target;\n\t}",
"public Item removeFirst() {\n if (isEmpty()) throw new NoSuchElementException();\n\n // Set the item to be returned to the item field of the first node\n Item item = headOfDeque.item;\n\n // If this is the last node - reset deque.\n if (lastNode()) {\n resetDeque();\n }\n else { // reassign head\n headOfDeque = headOfDeque.next;\n headOfDeque.previous = null;\n }\n\n dequeSize--;\n\n return item;\n }",
"public Item removeFirst() {\n if (isEmpty()) throw new NoSuchElementException(\"Removing from an empty deque\");\n Node<Item> tmpFirst = first;\n Item firstItem = tmpFirst.item;\n first = tmpFirst.next;\n size--;\n if (isEmpty()) last = null;\n else first.prev = null;\n return firstItem;\n }",
"public PersistentLinkedList<T> removeFirst() {\n return remove(0);\n }",
"@Override\n public T remove(T target){\n if (isEmpty()) {//if list is empty, there's nothing to remove\n return null;\n }\n //if list is not empty\n DLNode<T> current = first; //a reference pointing to the first element\n int index = 0; //we need to find the index of target element with a loop\n while (current != null && !current.elem.equals(target)) {\n current = current.next;\n index++;\n }\n if (current != null && current.elem.equals(target)) {\n return remove(index); //call remove(index) method here when the require index is found\n }\n return null;\n\n }",
"public Item removeFirst() {\r\n if (isEmpty()) {\r\n throw new NoSuchElementException();\r\n }\r\n Item result = items[++firstCursor];\r\n items[firstCursor] = null;\r\n return result;\r\n }",
"public Item removeFirst() throws NoSuchElementException {\n if (isEmpty()) {\n throw new NoSuchElementException(\"Cannot remove first item from empty deque\");\n }\n if (size == 1) { //remove last item in deque of size 1\n Item item = head.getItem(); //item = item to be removed\n head = null;\n tail = null;\n return item;\n }\n Node n = head; //n = temporary Node\n head = head.getNext(); //assign 2nd node as new head, \"removing\" previous head from deque\n size--;\n return n.getItem();\n }",
"public Item removeFirst() {\n if (this.isEmpty())\n throw new java.util.NoSuchElementException();\n\n Item ret = this.first.item;\n\n this.first = this.first.next;\n if (this.first != null)\n this.first.prev = null;\n else\n this.last = null;\n --this.n;\n\n return ret;\n }",
"public synchronized ListNode removeFromEnd() {\n\t\tif (head == null)\n\t\t\treturn null;\n\t\tListNode p = head, q = null, next = head.getNext();\n\t\tif (next == null) {\n\t\t\thead = null;\n\t\t\t// reduce the length of the list\n\t\t\tlength -= 1;\n\t\t\treturn p;\n\t\t}\n\t\twhile ((next = p.getNext()) != null) {\n\t\t\tq = p;\n\t\t\tp = next;\n\t\t}\n\t\tq.setNext(null);\n\t\t// reduce the length of the list\n\t\tlength -= 1;\n\t\treturn p;\n\t}",
"public Item deleteAtStart() { \t\n \tItem returnItem = head.item;\n \thead = head.next;\n \ttail.next = head;\n \tsize--;\n \treturn returnItem;\n }",
"public void deleteFirst(){\n\t\tDLLNode<T> newNode = head;\n\t\t//if the list is empty\n\t\tif ( size == 0 ){\n\t\t\t//set both the head and tail to null\n\t\t\thead = null;\n\t\t\ttail = null;\n\t\t\t//size decreases by 1\n\t\t\tsize--;\n\t\t}\n\t\telse{\n\t\t\t//assign head to the following node\n\t\t\thead = head.getNext();\n\t\t\t//set the previous node (ex-head) to null\n\t\t\thead.setPrev( null );\n\t\t\t//size decreases by 1\n\t\t\tsize--;\n\t\t}\n\t}",
"public E remove() {\r\n\t\tif (curr.next() == null)\r\n\t\t\treturn null; // Nothing to remove\r\n\t\tE it = curr.next().element(); // Remember value\r\n\t\tif (tail == curr.next())\r\n\t\t\ttail = curr; // Removed last\r\n\t\tcurr.setNext(curr.next().next()); // Remove from list\r\n\t\tcnt--; // Decrement count\r\n\t\treturn it; // Return value\r\n\t}",
"int remove(){\n int x = head.val;\n head = head.next;\n if(--n == 0) tail = null;\n return x;\n }",
"public Object removeFirst() {\r\n Object first = header.next.element;\r\n remove(header.next);\r\n return first;\r\n }",
"public void deleteWholeList()\n {\n head = null;\n }",
"@Override\n public T removeFirst() {\n if (size == 0) {\n return null;\n }\n\n int position = plusOne(nextFirst);\n T itemToReturn = array[position];\n array[position] = null;\n nextFirst = position;\n size -= 1;\n\n if ((double)size / array.length < 0.25 && array.length >= 16) {\n resize(array.length / 2);\n }\n return itemToReturn;\n }",
"public T removeFromFront() throws EmptyListException {\n if(isEmpty())\n throw new EmptyListException(name);\n\n // retrieve data being removed\n T removedItem = firstNode.data;\n\n // update references to firstNode and lastNode\n if(firstNode == lastNode)\n firstNode = lastNode = null;\n else\n firstNode = firstNode.nextNode;\n\n return removedItem;\n }",
"public E remove() {\r\n\t\tif (head == null) {\r\n\t\t\tthrow new NoSuchElementException();\r\n\t\t} else {\r\n\t\t\tNode<E> temp = head;\r\n\t\t\tif (head == tail) {\r\n\t\t\t\thead = null;\r\n\t\t\t\ttail = null;\r\n\t\t\t} else {\r\n\t\t\t\thead = head.next;\r\n\t\t\t\thead.prev = null;\r\n\t\t\t}\r\n\t\t\tindices.remove(0);\r\n\t\t\tsize--;\r\n\t\t\treturn temp.data;\r\n\t\t}\r\n\t}",
"T removeFromTail() {\n if (this.size() == 0) {\n throw new RuntimeException(\"Cannot remove from an empty list\");\n }\n return header.removeFromTail();\n }",
"public E pollFirst() {\n\t\tif (mSize == 0)\n\t\t\treturn null;\n\t\tE retVal = mHead.next.data;\n\t\tremove(mHead.next);\n\n\t\tmodCount++;\n\t\tmSize--;\n\n\t\treturn retVal;\n\t}",
"public static <T> T getFirst(List<T> list) {\n\t\treturn list != null && !list.isEmpty() ? list.get(0) : null;\n\t}",
"@Override\n public int remove() {\n isEmptyList();\n int result = first.value;\n first = first.next;\n first.previous = null;\n size--;\n return result;\n }",
"public Item removeFirst() {\n if (isEmpty()) {\n throw new NoSuchElementException(\"Can not call removeFirst() on an empty deque\");\n }\n\n Item item = first.item;\n first = first.next;\n n--;\n if (isEmpty()) {\n last = null;\n }\n else {\n first.prev = null;\n }\n return item;\n\n }",
"synchronized public V removeOne() {\n int i = 0;\n for (; i < keys.length; i++) {\n if (keys[i] == null || keys[i] == skip) {\n continue;\n }\n break;\n }\n if (i == keys.length) {\n return null;\n }\n return (V) remove(keys[i]);\n }",
"public Item removeFirst() {\n if (isEmpty()) {\n throw new NoSuchElementException(\"Trying to remove an item from an empty deque.\");\n }\n\n Item item = first.item; // save item to return\n first = first.next; // delete first node\n if (first == null) {\n last = null;\n } else {\n first.previous = null;\n }\n size--;\n if (isEmpty()) {\n last = null;\n }\n assert check();\n return item; // return the saved item\n }",
"public Item removeFirst() {\n Item val = deck[fFront];\n deck[fFront++] = null;\n return val;\n }",
"public synchronized ListNode removeFromBegin() {\n\t\tListNode node = head;\n\t\tif (node != null) {\n\t\t\thead = node.getNext();\n\t\t\tnode.setNext(null);\n\t\t}\n\t\treturn node;\n\t}",
"public void deleteFirst() {\r\n\t\tif(isEmpty()) return;\r\n\t\thead = head.next;\r\n\t}",
"public T removeFirst() throws EmptyCollectionException;",
"public E remove(int index) {\n if(index > size) return null;\n E element = null;\n for(int i = index+1; i < size; i++) {\n list[i-1] = list[i];\n }\n list[size-1] = null;\n size--;\n return element;\n }",
"private T remove(int idx) {\n if (head == null) {\n throw new IllegalArgumentException(\"The list is empty\");\n }\n if (idx < 0 || idx > size - 1) {\n throw new IndexOutOfBoundsException();\n }\n\n // now the idx is valid\n // if we only have one element\n if (head.prev == null) {\n T ret = (T) head.val;\n head = null;\n tail = null;\n size = 0;\n return ret;\n }\n\n // we have more than one element\n int k = idx;\n ListNode curr = tail;\n while (k-- > 0) {\n curr = curr.next;\n }\n\n T ret = (T) curr.val;\n\n // now we need to remove this curr\n // curr is tail\n if (curr.prev == null) {\n tail = curr.next;\n tail.prev = null;\n }\n // curr is head\n else if (curr.next == null) {\n head = curr.prev;\n head.next = null;\n }\n // curr is in the middle\n else {\n curr.prev.next = curr.next;\n curr.next.prev = curr.prev;\n }\n\n curr.prev = null;\n curr.next = null;\n size--;\n return ret;\n }",
"public synchronized Object removeFirstElement() {\n return _queue.remove(0);\n }",
"public int removeFirstNode() {\n\t\tint tmp = getFirstElement();\n\t\thead = head.next;\n\t\treturn tmp;\n\t}",
"public E removeFirst() {\n return pop();\n }",
"public synchronized DoubleLinkedListNodeInt removeFirst() {\n\t\tDoubleLinkedListNodeInt node = getFirst();\n\t\tif(node != null){\n\t\t\tnode.remove();\n\t\t}\n\t\treturn node;\n\t}",
"public Node deleteFirst() {\n\n\t\tif (first == null) { // means LinkedList in empty, throw exception.\n\t\t\tthrow new LinkedListEmptyException(\n\t\t\t\t\t\"LinkedList doesn't contain any Nodes.\");\n\t\t}\n\n\t\tNode tempNode = first;\n\t\tif (first.next == null) // if only one item\n\t\t\tlast = null; // null <-- last\n\t\telse\n\t\t\tfirst.next.previous = null; // null <-- old next\n\t\tfirst = first.next; // first --> old next\n\t\treturn tempNode;\n\t}",
"@Override\n public E remove(E obj) {\n if (isEmpty())\n return null;\n else {\n Node<E> headPointer = head;\n Node<E> tailPointer = tail;\n if (obj.compareTo(peekFirst()) == 0) {\n removeFirst();\n modificationCounter++;\n return headPointer.data;\n } else if (obj.compareTo(peekLast()) == 0) {\n removeLast();\n modificationCounter++;\n return tailPointer.data;\n } else {\n while (true) {\n if (headPointer.data.compareTo(obj) == 0) {\n Node tempHead = headPointer.previous;\n Node tempTail = headPointer.next;\n tempHead.next = tempTail;\n tempTail.previous = tempHead;\n currentSize--;\n modificationCounter++;\n return headPointer.data;\n } else if (headPointer.next == null) {\n return null;\n } else\n headPointer = headPointer.next;\n }\n }\n }\n }"
] | [
"0.798548",
"0.79255563",
"0.7717867",
"0.75709856",
"0.75650436",
"0.7562299",
"0.7544094",
"0.7489028",
"0.7452165",
"0.74416757",
"0.74001336",
"0.7394807",
"0.7388953",
"0.73828876",
"0.7322106",
"0.7263967",
"0.72309667",
"0.72241336",
"0.7181483",
"0.71593195",
"0.71575314",
"0.71452224",
"0.71386373",
"0.7130868",
"0.7121453",
"0.7113064",
"0.70914227",
"0.7068395",
"0.70588696",
"0.7049353",
"0.70459205",
"0.7034105",
"0.70305574",
"0.70175534",
"0.70135236",
"0.7004859",
"0.7004019",
"0.70011896",
"0.7000997",
"0.6989084",
"0.6985072",
"0.6971986",
"0.6950897",
"0.69252855",
"0.691408",
"0.69112223",
"0.69090605",
"0.69078785",
"0.6904965",
"0.6904741",
"0.6902649",
"0.689362",
"0.6887552",
"0.68715876",
"0.68659717",
"0.68555474",
"0.68540794",
"0.68498415",
"0.68465334",
"0.6846172",
"0.68434316",
"0.68409574",
"0.6840492",
"0.6818015",
"0.68152416",
"0.6814633",
"0.6803416",
"0.6801427",
"0.68000805",
"0.6796376",
"0.6794683",
"0.6790985",
"0.6788883",
"0.67867595",
"0.67594326",
"0.6732952",
"0.67302555",
"0.672669",
"0.67209285",
"0.67132413",
"0.671128",
"0.67081296",
"0.6694907",
"0.66913664",
"0.66292304",
"0.66178447",
"0.6615773",
"0.6609606",
"0.6605316",
"0.6598877",
"0.65854037",
"0.65821373",
"0.6578563",
"0.6562769",
"0.6559024",
"0.65485483",
"0.6544196",
"0.65372145",
"0.65265375",
"0.65245104"
] | 0.6556829 | 95 |
Called when the activity is first created. | @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.list_view);
view = (LinearLayout) findViewById(R.id.list_main_layout);
context = view.getContext();
next25Button = (Button)findViewById(R.id.next_25_button);
next25Button.setOnClickListener(this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t\tinit();\n\t}",
"@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t}",
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}",
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}",
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}",
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}",
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}",
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}",
"@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n }",
"@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n }",
"@Override\n public void onCreate() {\n super.onCreate();\n initData();\n }",
"@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n\n }",
"@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n\n }",
"protected void onCreate() {\n }",
"@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tLog.e(TAG, \"onActivityCreated-------\");\r\n\t}",
"@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tLog.e(TAG, \"onActivityCreated-------\");\r\n\t}",
"@Override\n\tpublic void onActivityCreated(Bundle arg0) {\n\t\tsuper.onActivityCreated(arg0);\n\t}",
"@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tinitData(savedInstanceState);\r\n\t}",
"@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\t\r\n\t\tinitView();\r\n\t}",
"@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tsetview();\r\n\t}",
"@Override\n public void onCreate()\n {\n\n super.onCreate();\n }",
"@Override\n public void onCreate() {\n initData();\n }",
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tLogUtil.d(TAG, \"onActivityCreated---------\");\n\t\tinitData(savedInstanceState);\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}",
"@Override\n public void onCreate() {\n super.onCreate();\n }",
"@Override\n public void onCreate() {\n super.onCreate();\n }",
"@Override\n\tpublic void onActivityCreated(@Nullable Bundle savedInstanceState) {\n\t\tinitView();\n\t\tinitListener();\n\t\tinitData();\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}",
"@Override\n public void onCreate() {\n L.d(\"onCreate is called\");\n super.onCreate();\n }",
"@Override\n\tpublic void onActivityCreated(Activity activity, Bundle savedInstanceState)\n\t{\n\t}",
"@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\n\t}",
"protected void onFirstTimeLaunched() {\n }",
"@Override\n public void onActivityCreated(@Nullable Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n initData(savedInstanceState);\n }",
"@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\t\n\t}",
"@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\t\n\t}",
"@Override\n public void onActivityCreated(Activity activity, Bundle bundle) {}",
"@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t}",
"@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t}",
"@Override\n public void onActivityCreated(Activity activity, Bundle bundle) {\n }",
"@Override\n public void onCreate() {\n }",
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t\tsetupTextviews();\n\t\tsetupHorizontalScrollViews();\n\t\tsetupHorizontalSelectors();\n\t\tsetupButtons();\n\t}",
"@Override\n public void onCreate() {\n\n }",
"@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\t\r\n\t\tinitViewPager();\r\n\t\t\r\n\t\tinitView();\r\n\r\n\t\tinitCursor();\r\n\t\t\r\n\t\tinithuanxin(savedInstanceState);\r\n\t\r\n \r\n\t}",
"public void onCreate() {\n }",
"@Override\n\tpublic void onCreate() {\n\t\tLog.i(TAG, \"onCreate\");\n\t\tsuper.onCreate();\n\t}",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n init();\n }",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsetContentView(R.layout.caifushi_record);\n\t\tsuper.onCreate(savedInstanceState);\n\t\tinitview();\n\t\tMyApplication.getInstance().addActivity(this);\n\t\t\n\t}",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.activity_recent_activity);\n\t\tsetTitleFromActivityLabel(R.id.title_text);\n\t\tsetupStartUp();\n\t}",
"@Override\n\tpublic void onCreate() {\n\n\t}",
"@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\n\t\tgetLocation();\n\n\t\tregisterReceiver();\n\n\t}",
"@Override\n public void onActivityCreated(Activity activity, Bundle savedInstanceState) {\n eventManager.fire(Event.ACTIVITY_ON_CREATE, activity);\n }",
"@Override\n public void onCreate()\n {\n\n\n }",
"@Override\n\tprotected void onCreate() {\n\t}",
"@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tAnnotationProcessor.processActivity(this);\r\n\t}",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n if (!KramPreferences.hasStartedAppBefore(this)) {\n // First time app is started\n requestFirstHug();\n HugRequestService.scheduleHugRequests(this);\n KramPreferences.putHasStartedAppBefore(this);\n }\n\n setContentView(R.layout.activity_main);\n initMonthView(savedInstanceState);\n }",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.act_myinfo);\n\t\tinitView();\n\t\tinitEvents();\n\n\t}",
"public void onCreate();",
"public void onCreate();",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.auth_activity);\n connectVariablesToViews();\n listenToFields();\n WorkSpace.authorizationCompleted = false;\n }",
"@Override\n public void onCreate() {\n Log.d(TAG, TAG + \" onCreate\");\n }",
"@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) \r\n\t{\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\t\t\r\n\t\t// Get a reference to the tranistbuddy model.\r\n\t\tTransitBuddyApp app = (TransitBuddyApp)this.getApplicationContext();\r\n\t\tmModel = app.getTransitBuddyModel();\r\n\t\tmSettings = app.getTransitBuddySettings();\r\n\t\t\r\n\t\tsetTitle( getString(R.string.title_prefix) + \" \" + mSettings.getSelectedCity());\r\n\t}",
"@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tinit();\r\n\t}",
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n // Prepare the loader. Either re-connect with an existing one,\n // or start a new one.\n\t\tgetLoaderManager().initLoader(FORECAST_LOADER_ID, null, this);\n\t\tsuper.onActivityCreated(savedInstanceState); // From instructor correction\n\t}",
"@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\n\t\tDisplayMetrics dm = new DisplayMetrics();\n\t\tgetWindowManager().getDefaultDisplay().getMetrics(dm);\n\n\t\tintScreenX = dm.widthPixels;\n\t\tintScreenY = dm.heightPixels;\n\t\tscreenRect = new Rect(0, 0, intScreenX, intScreenY);\n\n\t\thideTheWindowTitle();\n\n\t\tSampleView view = new SampleView(this);\n\t\tsetContentView(view);\n\n\t\tsetupRecord();\n\t}",
"@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\tif (BuildConfig.DEBUG) {\n\t\t\tLogger.init(getClass().getSimpleName()).setLogLevel(LogLevel.FULL).hideThreadInfo();\n\t\t} else {\n\t\t\tLogger.init(getClass().getSimpleName()).setLogLevel(LogLevel.NONE).hideThreadInfo();\n\t\t}\n\t\tBaseApplication.totalList.add(this);\n\t}",
"@Override\n public void onActivityPreCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {/**/}",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n setupAddPotLaunch();\n setupListView();\n setupPotClick();\n }",
"public void onStart() {\n super.onStart();\n ApplicationStateMonitor.getInstance().activityStarted();\n }",
"@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\tcontext = getApplicationContext();\n\t\t\n\t\tApplicationContextUtils.init(context);\n\t}",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n\n }",
"@Override\n public void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n initArguments();\n }",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\t\t\n\t\tappManager = AppManager.getAppManager();\n\t\tappManager.addActivity(this);\n\t}",
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\n\t\tmContext = (LFActivity) getActivity();\n\t\tinit();\n\t}",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n\tprotected void onCreate(Bundle savedInstanceBundle)\n\t{\n\t\tsuper.onCreate(savedInstanceBundle);\n\t\tView initView = initView();\n\t\tsetBaseView(initView);\n\t\tinitValues();\n\t\tinitListeners();\n\t}",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.listexcursionscreen);\n\n ActionsDelegator.getInstance().synchronizeActionsWithServer(this);\n runId = PropertiesAdapter.getInstance(this).getCurrentRunId();\n\n RunDelegator.getInstance().loadRun(this, runId);\n ResponseDelegator.getInstance().synchronizeResponsesWithServer(this, runId);\n\n }",
"@Override\n\tprotected void onCreate() {\n\t\tSystem.out.println(\"onCreate\");\n\t}",
"@Override\n protected void onStart() {\n Log.i(\"G53MDP\", \"Main onStart\");\n super.onStart();\n }",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tAppManager.getInstance().addActivity(this);\n\t}",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n }",
"@Override\n\tpublic void onCreate() {\n\t\t// TODO Auto-generated method stub\n\t\tsuper.onCreate();\n\t}",
"@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t}",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.add_daily_task);\n init_database();\n init_view();\n init_click();\n init_data();\n init_picker();\n }",
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\t\n\t\tactivity = (MainActivity)getActivity(); \n\t\t\n\t\tactivity.setContListener(this);\n\t\t\n\t\tif(MODE == Const.MODE_DEFAULT){\n\t\t\tinitializeInfoForm();\n\t\t}else{\n\t\t\tinitializeAddEditForm();\t\t\t\n\t\t}\n\t\t\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}",
"@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t}",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\n\t\tinitView();\n\n\t\tinitData();\n\n\t\tinitEvent();\n\n\t\tinitAnimation();\n\n\t\tshowUp();\n\t}",
"@Override\n public void onCreate() {\n Thread.setDefaultUncaughtExceptionHandler(new TryMe());\n\n super.onCreate();\n\n // Write the content of the current application\n context = getApplicationContext();\n display = context.getResources().getDisplayMetrics();\n\n\n // Initializing DB\n App.databaseManager.initial(App.context);\n\n // Initialize user secret\n App.accountModule.initial();\n }",
"@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t}",
"@Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n\n super.onCreate(savedInstanceState);\n }"
] | [
"0.791686",
"0.77270156",
"0.7693263",
"0.7693263",
"0.7693263",
"0.7693263",
"0.7693263",
"0.7693263",
"0.7637394",
"0.7637394",
"0.7629958",
"0.76189965",
"0.76189965",
"0.7543775",
"0.7540053",
"0.7540053",
"0.7539505",
"0.75269467",
"0.75147736",
"0.7509639",
"0.7500879",
"0.74805456",
"0.7475343",
"0.7469598",
"0.7469598",
"0.7455178",
"0.743656",
"0.74256307",
"0.7422192",
"0.73934627",
"0.7370002",
"0.73569906",
"0.73569906",
"0.7353011",
"0.7347353",
"0.7347353",
"0.7333878",
"0.7311508",
"0.72663945",
"0.72612154",
"0.7252271",
"0.72419256",
"0.72131634",
"0.71865886",
"0.718271",
"0.71728176",
"0.7168954",
"0.7166841",
"0.71481615",
"0.7141478",
"0.7132933",
"0.71174103",
"0.7097966",
"0.70979583",
"0.7093163",
"0.7093163",
"0.7085773",
"0.7075851",
"0.7073558",
"0.70698684",
"0.7049258",
"0.704046",
"0.70370424",
"0.7013127",
"0.7005552",
"0.7004414",
"0.7004136",
"0.69996923",
"0.6995201",
"0.69904065",
"0.6988358",
"0.69834954",
"0.69820535",
"0.69820535",
"0.69820535",
"0.69820535",
"0.69820535",
"0.69820535",
"0.69820535",
"0.69820535",
"0.69820535",
"0.69820535",
"0.69820535",
"0.69820535",
"0.69820535",
"0.69783133",
"0.6977392",
"0.69668365",
"0.69660246",
"0.69651115",
"0.6962911",
"0.696241",
"0.6961096",
"0.69608897",
"0.6947069",
"0.6940148",
"0.69358927",
"0.6933102",
"0.6927288",
"0.69265485",
"0.69247025"
] | 0.0 | -1 |
backward search hope new items will go with greater distance | private int getFarmPos(long farmId, float distance)
{
int childCount = view.getChildCount();
FarmLinearLayout childAtPos;
while(childCount > 0)
{
childAtPos = (FarmLinearLayout)view.getChildAt(--childCount);
if (childAtPos.farmId == farmId)
return -1;
if (childAtPos.distance < distance)
return childCount + 1;
}
return 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void thinkAboutNext(ArrayList<Point> pos, boolean hit, boolean destroyedIt) {\n if (!searching && hit) {\n betweenTwo = false;\n System.out.println(\"WAS A NEW TARGET\");\n if(!destroyedIt) {\n int[] d = Direction.DOWN.getDirectionVector();\n Point n = new Point(justBefore.x + d[0], justBefore.y + d[1]);\n if (inBounds(n) && pos.contains(n))\n directionsToGo.add(Direction.DOWN);\n\n d = Direction.UP.getDirectionVector();\n n = new Point(justBefore.x + d[0], justBefore.y + d[1]);\n if (inBounds(n) && pos.contains(n))\n directionsToGo.add(Direction.UP);\n\n d = Direction.LEFT.getDirectionVector();\n n = new Point(justBefore.x + d[0], justBefore.y + d[1]);\n if (inBounds(n) && pos.contains(n))\n directionsToGo.add(Direction.LEFT);\n\n d = Direction.RIGHT.getDirectionVector();\n n = new Point(justBefore.x + d[0], justBefore.y + d[1]);\n if (inBounds(n) && pos.contains(n))\n directionsToGo.add(Direction.RIGHT);\n\n directionLooking = directionsToGo.get(directionsToGo.size() - 1);\n }\n }\n else if (searching) {\n //FILTER OUT ALREADY ATTACKED\n\n System.out.println(\"WAS AN OLD TARGET\");\n\n //FAILED\n if(!hit) {\n justBefore = firstHit;\n int size = directionsToGo.size();\n\n for(int i = size - 1; i >= 0; i--){\n Point n = new Point(justBefore.x + directionsToGo.get(i).getDirectionVector()[0],\n justBefore.y + directionsToGo.get(i).getDirectionVector()[1]);\n if(!pos.contains(n))\n directionsToGo.remove(i);\n }\n directionLooking = directionsToGo.get(0);\n }\n else\n if(!pos.contains(pWD(justBefore, directionLooking))) {\n justBefore = firstHit;\n directionLooking = directionLooking.getOpposite();\n }\n\n }\n if(hit) {\n searching = !destroyedIt;\n }\n }",
"int getEndSearch();",
"private void findPrev() {\n \tthis.find(false);\n }",
"@Override\n\tpublic void search() {\n\t\tpq = new IndexMinPQ<>(graph.getNumberOfStations());\n\t\tpq.insert(startIndex, distTo[startIndex]);\n\t\twhile (!pq.isEmpty()) {\n\t\t\tint v = pq.delMin();\n\t\t\tnodesVisited.add(graph.getStation(v));\n\t\t\tnodesVisitedAmount++;\n\t\t\tfor (Integer vertex : graph.getAdjacentVertices(v)) {\t\n\t\t\t\trelax(graph.getConnection(v, vertex));\n\t\t\t}\n\t\t}\n\t\tpathWeight = distTo[endIndex];\n\t\tpathTo(endIndex);\n\t}",
"private double distanceToCarBack(double fromPosition) {\n\t\t double carBackPosition = Double.POSITIVE_INFINITY;\n\t\t for (Car c : cars)\n\t\t\t if (c.backPosition() >= fromPosition && c.backPosition() < carBackPosition)\n\t\t\t\t carBackPosition = c.backPosition();\n\t\t return carBackPosition;\n\t }",
"private int searchNext(JmtCell prev) {\r\n \t\tRectangle boundspadre = GraphConstants.getBounds((prev).getAttributes()).getBounds();\r\n \t\tObject[] listEdges = null;\r\n \t\tGraphModel graphmodel = graph.getModel();\r\n \t\tList<Object> next = new ArrayList<Object>();\r\n \r\n \t\tif (flag1 == false && prev.seen == false) {\r\n \r\n \t\t\t// Rectangle bounds =\r\n \t\t\t// GraphConstants.getBounds(((JmtCell)prev).getAttributes()).getBounds();\r\n \t\t\tif (!flag2) {\r\n \t\t\t\tboundspadre.setLocation(x, y + ((e + 1) * (42 + heightMax)) - (int) (boundspadre.getHeight() / 2) + 30);\r\n \t\t\t} else {\r\n \t\t\t\tboundspadre.setLocation(x - (int) (boundspadre.getWidth() / 2), y + ((e + 1) * (42 + heightMax))\r\n \t\t\t\t\t\t- (int) (boundspadre.getHeight() / 2) + 30);\r\n \t\t\t}\r\n \r\n \t\t\tGraphConstants.setBounds(prev.getAttributes(), boundspadre);\r\n \t\t\tx = (int) boundspadre.getCenterX() + widthMax + 50;\r\n \t\t\tprev.seen = true;\r\n \t\t\tflag2 = true;\r\n \t\t}\r\n \r\n \t\t// inserisco tutti gli archi uscenti e entranti di min.get(j) in\r\n \t\t// listEdges\r\n \t\tlistEdges = DefaultGraphModel.getOutgoingEdges(graphmodel, prev);\r\n \t\tVector<Object> listEdgestmp = new Vector<Object>();\r\n \t\tfor (Object listEdge : listEdges) {\r\n \t\t\tJmtCell qq = (JmtCell) (graphmodel.getParent(graphmodel.getTarget(listEdge)));\r\n \t\t\tif (!(qq).seen) {\r\n \t\t\t\tlistEdgestmp.add(listEdge);\r\n \t\t\t}\r\n \t\t}\r\n \t\tlistEdges = listEdgestmp.toArray();\r\n \r\n \t\tint numTarget = listEdges.length;\r\n \t\tif (numTarget == 0) {\r\n \t\t\treturn 1;\r\n \t\t}\r\n \r\n \t\tfor (int k = 0; k < numTarget; k++) {\r\n \t\t\tnext.add((graphmodel.getParent(graphmodel.getTarget(listEdges[k]))));\r\n \t\t}\r\n \r\n \t\tint j = 1;\r\n \t\tif (inRepositionSons == false && ((JmtCell) next.get(0)).seen == false) {\r\n \t\t\tj = searchNext((JmtCell) next.get(0));\r\n \t\t} else if (inRepositionSons == true && ((JmtCell) next.get(0)).seen == false) {\r\n \r\n \t\t\tRectangle bounds = GraphConstants.getBounds(((JmtCell) next.get(0)).getAttributes()).getBounds();\r\n \t\t\tbounds.setLocation((int) (boundspadre.getCenterX()) + widthMax + 50 - (int) (bounds.getWidth() / 2), (int) boundspadre.getCenterY()\r\n \t\t\t\t\t- (int) (bounds.getHeight() / 2));\r\n \t\t\tGraphConstants.setBounds(((JmtCell) next.get(0)).getAttributes(), bounds);\r\n \r\n \t\t\t((JmtCell) next.get(0)).seen = true;\r\n \t\t\tj = searchNext((JmtCell) next.get(0));\r\n \t\t}\r\n \r\n \t\tif (numTarget > 0) {\r\n \t\t\tif (!flag) {\r\n \t\t\t\trepositionSons(prev, next, j - 1, 1);\r\n \t\t\t} else {\r\n \t\t\t\trepositionSons(prev, next, -1, 0);\r\n \t\t\t}\r\n \t\t\tflag = false;\r\n \t\t}\r\n \r\n \t\t(prev).sons = 0;\r\n \t\tfor (int w = 0; w < numTarget; w++) {\r\n \t\t\tprev.sons += ((JmtCell) next.get(w)).sons;\r\n \t\t}\r\n \r\n \t\treturn prev.sons;\r\n \t}",
"void compareSearch();",
"void movePrev()\n\t{\n\t\tif (cursor != null) \n\t\t{\n\t\t\tif (cursor == front) \n\t\t\t{\n\t\t\t\tcursor = null;\n index = -1; //added this because i kept failing the test cases on the grading script\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcursor = cursor.prev; //moves cursor toward front of the list\n index--; //added this because i kept failing the test cases on the grading script\n\t\t\t}\n\t\t}\n\t}",
"private int moveForward(int i, int s) {\n if (i + s >= items.length) {\n return ((i + s) - items.length);\n }\n return i + s;\n }",
"public void visiualizeLastSearch(){\r\n\t\tint number=0;\r\n\t\tNode dummy;\r\n\t\tNode next;\r\n\t\tfor(int i=sl.height(); i>=0; i--){\r\n\t\t\tdummy = sl.getFrom(0,0);\r\n\t\t\tnext = sl.getFrom(i,0);\r\n\t\t\tString seperator=\"-\";\r\n\t\t\tfor(int j=0; j<(sl.size()+2); j++){\r\n\r\n\t\t\t\tnumber = next.getKey();\r\n\t\t\t\t\r\n\t\t\t\tif(i<sl.height() && sl.getVisited()[i+1].getKey()!=sl.getVisited()[i].getKey() && number>sl.getVisited()[i+1].getKey() && number<=sl.getVisited()[i].getKey())\r\n\t\t\t\t\tseperator = \"*\";\r\n\t\t\t\telse\r\n\t\t\t\t\tseperator = \"-\";\r\n\r\n\t\t\t\tif(number==dummy.getKey()){\r\n\r\n\t\t\t\t\tif(number==minf)\r\n\t\t\t\t\t\tSystem.out.print(\"-inf\");\r\n\t\t\t\t\telse if(number==inf)\r\n\t\t\t\t\t\tSystem.out.print(repeatStr(seperator,3)+\"inf\");\r\n\t\t\t\t\telse\r\n\t\t\t\t\tSystem.out.print(repeatStr(seperator,2)+number);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\tSystem.out.print(repeatStr(seperator,4));\r\n\t\t\t\t\r\n\t\t\t\tif(dummy.getKey()==number)\r\n\t\t\t\t\tnext = next.getRight();\r\n\t\t\t\t\r\n\t\t\t\tdummy = dummy.getRight();\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}",
"void setEndSearch(int endSearch);",
"private Vector<Vector<BusStopInfo>> findRek (BusStopInterface from, BusStopInterface to, Vector <BusStopInfo> toInfo, Vector<BusStopInfo> visited, int swaps, int transfers )\r\n {\r\n Vector<Vector<BusStopInfo>> sciezka = new Vector<Vector<BusStopInfo>>();\r\n \r\n if(from.getName()==to.getName())\r\n {\r\n sciezka.add(toInfo);\r\n return sciezka;\r\n }\r\n\r\n for(BusStopInfo vis: visited)\r\n {\r\n if(vis.awtobus.busLine.getBusStop(vis.pozycja).getName()==from.getName())\r\n return sciezka;\r\n }\r\n\r\n Vector <BusStopInfo> fromInfo = findStopInfo(from);\r\n\r\n fromInfo = infoFilter(fromInfo, toInfo);\r\n\r\n for(BusStopInfo info: fromInfo)\r\n {\r\n int swapsNow = swaps;\r\n if(visited.size()>0 && info.awtobus.bus.getBusNumber()!=visited.lastElement().awtobus.bus.getBusNumber())\r\n {\r\n swapsNow++;\r\n }\r\n\r\n if(swapsNow <= transfers)\r\n {\r\n int nextPosition = info.pozycja +1; //ide do przodu linii\r\n int prevPosition = info.pozycja -1; //ide do tyłu linii\r\n\r\n Vector<BusStopInfo> temp = new Vector<BusStopInfo>(visited);\r\n temp.add(info);\r\n Vector<Vector<BusStopInfo>> result ;\r\n if(nextPosition<info.awtobus.busLine.getNumberOfBusStops())\r\n {\r\n BusStopInterface nextStop = info.awtobus.busLine.getBusStop(nextPosition);\r\n result = findRek(nextStop, to, toInfo, temp, swapsNow, transfers);\r\n for(Vector<BusStopInfo> res: result)\r\n {\r\n res.add(0, info);\r\n sciezka.add(res);\r\n }\r\n }\r\n if(prevPosition >= 0)\r\n {\r\n BusStopInterface prevStop = info.awtobus.busLine.getBusStop(prevPosition);\r\n result = findRek(prevStop, to, toInfo, temp, swapsNow, transfers);\r\n for(Vector<BusStopInfo> res: result)\r\n {\r\n res.add(0, info);\r\n sciezka.add(res);\r\n }\r\n }\r\n }\r\n }\r\n\r\n return sciezka;\r\n }",
"private void GreedySearch(){\n\n Queue<Node> expanded = new LinkedList<>();\n ArrayList<Node> fringe = new ArrayList<>();\n ArrayList<Node> fringeTemp = new ArrayList<>();\n\n\n Node current = startNode;\n\n while(expanded.size() < 1000){\n\n if(current.getDigit().getDigitString().equals(goalNode.getDigit().getDigitString())){\n //goal is reached.\n solutionPath(current);\n expanded.add(current);\n printExpanded(expanded);\n System.exit(0);\n }\n\n\n boolean b = cycleCheck(current,expanded);\n\n if(!b) {\n expanded.add(current);\n }\n\n if(!b){\n\n if(current.getDigit().last_changed != 0){\n\n if ((Integer.parseInt(current.getDigit().getFirst_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseFirstDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(0);\n\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n\n //+1 child first digit\n if ((Integer.parseInt(current.getDigit().getFirst_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseFirstDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(0);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n\n }\n }\n\n if(current.getDigit().last_changed != 1){\n\n if ((Integer.parseInt(current.getDigit().getSecond_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseSecondDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(1);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n\n //+1 child\n if ((Integer.parseInt(current.getDigit().getSecond_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseSecondDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(1);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n }\n\n if(current.getDigit().last_changed != 2){\n if ((Integer.parseInt(current.getDigit().getThird_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseThirdDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(2);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n //+1 child\n if ((Integer.parseInt(current.getDigit().getThird_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseThirdDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(2);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n }\n\n }\n\n\n\n for(Node n : fringe){\n heuristicSetter(n);\n\n }\n\n fringeTemp.addAll(fringe);\n //now all the nodes in fringe have the heuristic value.\n //We can get the last added minm\n Node minm;\n if(fringeTemp.size() != 0){\n minm = fringeTemp.get(0);\n }else{\n break;\n }\n for(int i = 1; i<fringeTemp.size(); i++){\n if(fringeTemp.get(i).getHeuristic() <= minm.getHeuristic()){\n minm = fringeTemp.get(i);\n }\n }\n\n //now we have the minm for the next stage.\n current = minm;\n fringeTemp.remove(minm);\n fringe.clear();\n }\n\n //While loop ends\n System.out.println(\"No solution found.\");\n printExpanded(expanded);\n\n\n\n }",
"protected int searchRight(double value) {\n int i = search(value);\n while (i < sequence.size() - 1 && value == sequence.get(i + 1)) {\n i += 1;\n }\n return i;\n }",
"private List<Node> backTrackFrom(Node start, Node end, Stack<Node> path, Map<Node,Integer> distance) {\n\t\tfinal List<Node> shortestPath = new ArrayList<Node>();\n\t\tNode n;\n\t\tNode current = start;\n\t\tshortestPath.add(start);\n\t\twhile (!path.isEmpty()) {\n\t\t\tn = path.pop();\n\t\t\t// checks the distance and adds the corresponding neighbor node\n\t\t\tif (current.getNeighbors().contains(n) && distance.get(n) + 1 == distance.get(current)) {\n\t\t\t\tshortestPath.add(n);\n\t\t\t\tcurrent = n;\n\t\t\t\t// stop adding to shortestPath once s is found\n\t\t\t\tif (n.equals(end))\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tCollections.reverse(shortestPath);\n\t\treturn shortestPath;\n\t}",
"public void testFindPanelFirstRowBackwards() {\n JXList list = new JXList( new AbstractListModel() {\n private String[] data = { \"a\", \"b\", \"c\" };\n public Object getElementAt(int index) {\n return data[ index ];\n }\n public int getSize() {\n return data.length;\n }\n });\n JXFindPanel findPanel = new JXFindPanel(list.getSearchable());\n findPanel.init();\n PatternModel patternModel = findPanel.getPatternModel();\n patternModel.setBackwards(true);\n patternModel.setRawText(\"a\");\n int matchIndex = list.getSearchable().search(patternModel.getPattern(),\n patternModel.getFoundIndex(), patternModel.isBackwards());\n assertEquals(\"found match\", matchIndex, findPanel.doSearch());\n }",
"@Override\n\t//loc1 is the start location,loc2 is the destination\n\tpublic ArrayList<MapCoordinate> bfsSearch(MapCoordinate loc1, MapCoordinate loc2, Map m) {\n\t\tSystem.out.println(\"come into bfsSearch\");\n\t\tif(m.isAgentHasAxe() && m.isAgentHasKey()){\n\t\t\tLinkedList<State> queue=new LinkedList<State>();\n\t\t\tArrayList<MapCoordinate> Visited=new ArrayList<MapCoordinate>();\n\t\t\t\n\t\t\t//Visited.add(loc1);\n\t\t\tState s1=new State(loc1,m.getAgentHasNStones(),null);\n\t\t\tqueue.add(s1);\n\t\t\t\n\t\t\twhile(!queue.isEmpty()){\n\t\t\t\tState s=queue.remove();\n\t\t\t\tMapCoordinate currentLocation=s.getLocation();\n\t\t\t\tVisited.add(s.getLocation()); //add to visited every loop\n\t\t\t\tif(loc2.equals(currentLocation)){\n\t\t\t\t\t//means could reach loc2 from loc1\n\t\t\t\t\tArrayList<MapCoordinate> route=new ArrayList<MapCoordinate>();\n\t\t\t\t\twhile(s.getPrevState()!=null){\n\t\t\t\t\t\troute.add(0,s.getLocation()); //add to head\n\t\t\t\t\t\ts=s.getPrevState();\n\t\t\t\t\t}\n\t\t\t\t\treturn route;\n\t\t\t\t}\n\t\t\t\tMapCoordinate temp=new MapCoordinate(currentLocation.getX()+1,currentLocation.getY());\n\t\t\t\tif(m.hasCoordinate(temp)){//state move east\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){ //this is important else if(cTemp!='~'), not barely else,\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp=new MapCoordinate(currentLocation.getX()-1,currentLocation.getY());\n\t\t\t\tif(m.hasCoordinate(temp)){//state move south\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()+1);\n\t\t\t\tif(m.hasCoordinate(temp)){//state move north\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()-1);\n\t\t\t\tif(m.hasCoordinate(temp)){//state move south\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' ){\n\t\t\t\t\t\t\tif(cTemp=='~' &&s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t\treturn null;\n\t\t}else if(m.isAgentHasAxe()){ //only have axe\n\t\t\tLinkedList<State> queue=new LinkedList<State>();\n\t\t\tArrayList<MapCoordinate> Visited=new ArrayList<MapCoordinate>();\n\t\t\t\n\t\t\t//Visited.add(loc1);\n\t\t\tState s1=new State(loc1,m.getAgentHasNStones(),null);\n\t\t\tqueue.add(s1);\n\t\t\t\n\t\t\twhile(!queue.isEmpty()){\n\t\t\t\tState s=queue.remove();\n\t\t\t\tMapCoordinate currentLocation=s.getLocation();\n\t\t\t\tVisited.add(s.getLocation()); //add visited every loop\n\t\t\t\tif(loc2.equals(currentLocation)){\n\t\t\t\t\t//means could reach loc2 from loc1\n\t\t\t\t\tArrayList<MapCoordinate> route=new ArrayList<MapCoordinate>();\n\t\t\t\t\twhile(s.getPrevState()!=null){\n\t\t\t\t\t\troute.add(0,s.getLocation()); //add to head\n\t\t\t\t\t\ts=s.getPrevState();\n\t\t\t\t\t}\n\t\t\t\t\treturn route;\n\t\t\t\t}\n\t\t\t\tMapCoordinate temp=new MapCoordinate(currentLocation.getX()+1,currentLocation.getY());\n\t\t\t\tif(m.hasCoordinate(temp)){//state move south\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp=new MapCoordinate(currentLocation.getX()-1,currentLocation.getY());\n\t\t\t\tif(m.hasCoordinate(temp)){//state move south\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()+1);\n\t\t\t\tif(m.hasCoordinate(temp)){//state move north\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()-1);\n\t\t\t\tif(m.hasCoordinate(temp)){//state move south\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}else if(m.isAgentHasKey()){ //only have key\n\t\t\tLinkedList<State> queue=new LinkedList<State>();\n\t\t\tArrayList<MapCoordinate> Visited=new ArrayList<MapCoordinate>();\n\t\t\t\n\t\t\t//Visited.add(loc1);\n\t\t\tState s1=new State(loc1,m.getAgentHasNStones(),null);\n\t\t\tqueue.add(s1);\n\t\t\t\n\t\t\twhile(!queue.isEmpty()){\n\t\t\t\tState s=queue.remove();\n\t\t\t\tMapCoordinate currentLocation=s.getLocation();\n\t\t\t\tVisited.add(s.getLocation());\n\t\t\t\tif(loc2.equals(currentLocation)){\n\t\t\t\t\t//means could reach loc2 from loc1\n\t\t\t\t\tArrayList<MapCoordinate> route=new ArrayList<MapCoordinate>();\n\t\t\t\t\twhile(s.getPrevState()!=null){\n\t\t\t\t\t\troute.add(0, s.getLocation()); //add to head,in this fashion, return the right order of route\n\t\t\t\t\t\ts=s.getPrevState();\n\t\t\t\t\t}\n\t\t\t\t\treturn route;\n\t\t\t\t}\n\t\t\t\tMapCoordinate temp=new MapCoordinate(currentLocation.getX()+1,currentLocation.getY()); \n\t\t\t\tif(m.hasCoordinate(temp)){//state move east\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp=new MapCoordinate(currentLocation.getX()-1,currentLocation.getY()); //state that move west\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()+1); //state move north\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()-1); //state move south\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){//at least has 1 stone\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for initial state\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t\n\t\t/*\n\t\t * \n\t\t **/\t\t\n\t\telse{ //have no key and axe\n\t\t\tSystem.out.println(\"come into the last elas clause\");\n\t\t\tLinkedList<State> queue=new LinkedList<State>();\n\t\t\tArrayList<MapCoordinate> Visited=new ArrayList<MapCoordinate>();\n\t\t\t\n\t\t\tVisited.add(loc1);\n\t\t\tState s1=new State(loc1,m.getAgentHasNStones(),null);\n\t\t\tqueue.add(s1);\n\t\t\t\n\t\t\t//int i=0;\n\t\t\twhile(!queue.isEmpty()){\n\t\t\t\t//i++;\n\t\t\t\t//System.out.println(\"come into while: \"+i);\n\t\t\t\tState s=queue.remove();\n\t\t\t\tMapCoordinate currentLocation=s.getLocation();\n\t\t\t\tVisited.add(s.getLocation()); //add visited, let program won't stuck in \n\t\t\t\tif(loc2.equals(currentLocation)){\n\t\t\t\t\t//means could reach loc2 from loc1\n\t\t\t\t\tSystem.out.println(\"return computed route\");\n\t\t\t\t\tArrayList<MapCoordinate> route=new ArrayList<MapCoordinate>();\n\t\t\t\t\twhile(s.getPrevState()!=null){\n\t\t\t\t\t\troute.add(0, s.getLocation()); //add to head\n\t\t\t\t\t\ts=s.getPrevState();\n\t\t\t\t\t}\n\t\t\t\t\tfor(MapCoordinate mc:route){\n\t\t\t\t\t\t//System.out.println(\"print returned route in bfssearch\");\n\t\t\t\t\t\tSystem.out.print(\"mc:\"+mc.getX()+\" \"+mc.getY()+\"->\");\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\treturn route;\n\t\t\t\t}\n\t\t\t\tMapCoordinate temp=new MapCoordinate(currentLocation.getX()+1,currentLocation.getY());\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\t//System.out.println(\"1 if\");\n\t\t\t\t\tif(s.getPrevState()!=null &&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if\");\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 if\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 if\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 else\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for the initial state \n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp=new MapCoordinate(currentLocation.getX()-1,currentLocation.getY());\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.add(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for the initial state \n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\tSystem.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()+1);\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*'&&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for the initial state \n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp=new MapCoordinate(currentLocation.getX(),currentLocation.getY()-1);\n\t\t\t\tif(m.hasCoordinate(temp)){\n\t\t\t\t\tif(s.getPrevState()!=null&&!temp.equals(s.getPrevState().getLocation())){\n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\tif(!Visited.contains(temp)&&cTemp!='*' &&cTemp!='T' &&cTemp!='-' ){\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}//do not do any action for not enough stones situation\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(s.getPrevState()==null){ //for the initial state \n\t\t\t\t\t\tchar cTemp=m.getSymbol(temp);\n\t\t\t\t\t\t//System.out.println(\"2 if lalala\");\n\t\t\t\t\t\tif(cTemp!='*' &&cTemp!='T'&&cTemp!='-' ){\n\t\t\t\t\t\t\t//System.out.println(\"3 iflalala\");\n\t\t\t\t\t\t\tif(cTemp=='~' && s.getStoneNumber()>0){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 iflalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber()-1,s);\n\t\t\t\t\t\t\t\tqueue.addLast(newState);\n\t\t\t\t\t\t\t}else if(cTemp!='~'){\n\t\t\t\t\t\t\t\t//System.out.println(\"4 elselalala\");\n\t\t\t\t\t\t\t\tState newState=new State(new MapCoordinate(temp),s.getStoneNumber(),s);\n\t\t\t\t\t\t\t\tqueue.addFirst(newState);\n\t\t\t\t\t\t\t}//do not do any action for not enough stones situation\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t}",
"private void updateBest() {\n if (bestTourOrder == null) {\n bestTourOrder = ants.get(0).trail;\n bestTourLength = ants.get(0)\n .trailLength(graph);\n }\n for (Ant a : ants) {\n if (a.trailLength(graph) > bestTourLength) {\n bestTourLength = a.trailLength(graph);\n bestTourOrder = a.trail.clone();\n }\n }\n\n\n }",
"boolean scavenge()\r\n/* 462: */ {\r\n/* 463:493 */ if (scavengeSome()) {\r\n/* 464:494 */ return true;\r\n/* 465: */ }\r\n/* 466:498 */ this.prev = null;\r\n/* 467:499 */ this.cursor = this.head;\r\n/* 468:500 */ return false;\r\n/* 469: */ }",
"private int bfs(String source, String destination, final Set<String> uniqueWords) {\n\n class Node {\n String word;\n int distance;\n\n public Node(String word, int distance) {\n this.word = word;\n this.distance = distance;\n }\n }\n\n final Queue<Node> queue = new LinkedList<>();\n Set<String> visited = new HashSet<>();\n queue.offer(new Node(source, 0)); //distance of source to source is 0\n visited.add(source);\n\n while (!queue.isEmpty()) {\n\n final Node node = queue.poll();\n final int distance = node.distance;\n\n //if we reached the destination node\n if (node.word.equals(destination))\n return distance + 1;\n\n //try all word which is 1 weight away\n for (String neighbour : getNeighbour(node.word, uniqueWords)) {\n if (!visited.contains(neighbour)) {\n visited.add(neighbour);\n queue.offer(new Node(neighbour, distance + 1));\n }\n }\n\n\n }\n return 0;\n }",
"private void removeTwoStepForwardFromPositionCache(Key currentKey) {\n\n\t\t// Create a two square forward position\n\t\tKey newKey =createTwoStepForwardFromCurrentKey(currentKey);\n\n\t\t// Gets current values stored with key and adds the extra position\n\t\tSet<Key> currentKeyMapping = positionCache.get(currentKey);\n\n\t\t// Remove key if it exists\n\t\tif (currentKeyMapping.contains(newKey)) {\n\t\t\tcurrentKeyMapping.remove(newKey);\n\t\t}\n\n\t\tpositionCache.put(currentKey, currentKeyMapping);\n\t}",
"private int moveBack(int i, int s) {\n if (i - s < 0) {\n return items.length - (s - i);\n }\n return i - s;\n }",
"@Override\r\n\t\t\tpublic double matchingItems(Query query) {\n\t\t\t\treturn 0;\r\n\t\t\t}",
"private void scanForBlockFarAway() {\r\n\t\tList<MapLocation> locations = gameMap.senseNearbyBlocks();\r\n\t\tlocations.removeAll(stairs);\r\n\t\tif (locations.size() == 0) {\r\n\t\t\tblockLoc = null;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t/* remove blocks that can be sensed */\r\n\t\tIterator<MapLocation> iter = locations.iterator();\r\n\t\twhile(iter.hasNext()) {\r\n\t\t\tMapLocation loc = iter.next();\r\n\t\t\tif (myRC.canSenseSquare(loc))\r\n\t\t\t\titer.remove();\r\n\t\t} \r\n\t\t\r\n\t\tlocations = navigation.sortLocationsByDistance(locations);\r\n\t\t//Collections.reverse(locations);\r\n\t\tfor (MapLocation block : locations) {\r\n\t\t\tif (gameMap.get(block).robotAtLocation == null){\r\n\t\t\t\t/* this location is unoccupied */\r\n\t\t\t\tblockLoc = block;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tblockLoc = null;\r\n\t}",
"public void findTrack() {\n for (Node n : start_node.getLinks()) {\n precedenti.put(n, start_node);\n valori.put(n, calculator.calcDistance(n, start_node));\n }\n while (!da_collegare.isEmpty()) {\n Node piu_vicino = null;\n double min = Double.MAX_VALUE;\n for (Node n : da_collegare) {\n double dist = valori.get(n);\n if (dist - min < THRESHOLD) {\n min = dist;\n piu_vicino = n;\n }\n }\n double dist = valori.get(piu_vicino);\n for (Node n : piu_vicino.getLinks()) {\n double ricalc = dist + calculator.calcDistance(n, piu_vicino);\n if (ricalc - valori.get(n) < THRESHOLD) {\n precedenti.put(n, piu_vicino);\n valori.put(n, ricalc);\n }\n }\n da_collegare.remove(piu_vicino);\n }\n }",
"public void backtrack(double distance){\r\n\t\tbackwards((odometer.getX()+Math.sin(Math.toRadians(odometer.getAng())) * distance),(odometer.getY()+ Math.cos(Math.toRadians(odometer.getAng())) * distance));\r\n\t\t}",
"private void locateBestMatch(int queryStartIdx){\n \n double dist;\n double bsfDist = Double.MAX_VALUE;\n int bsfIdx = -1;\n\n double[] query = zNormalise(series, queryStartIdx, this.windowSize, false);\n double[] comparison;\n\n for(int comparisonStartIdx = 0; comparisonStartIdx <= seriesLength-windowSize; comparisonStartIdx+=stride){\n \n // exclusion zone +/- windowSize/2 around the window\n if(comparisonStartIdx >= queryStartIdx-windowSize*1.5 && comparisonStartIdx <= queryStartIdx+windowSize*1.5){\n continue;\n }\n \n // using a bespoke version of this, rather than the shapelet version, for efficiency - see notes with method\n comparison = zNormalise(series, comparisonStartIdx, windowSize, false);\n dist = 0;\n\n for(int j = 0; j < windowSize;j++){\n dist += (query[j]-comparison[j])*(query[j]-comparison[j]);\n if(dist > bsfDist){\n dist = Double.MAX_VALUE;\n break;\n }\n }\n\n if(dist < bsfDist){\n bsfDist = dist;\n bsfIdx = comparisonStartIdx;\n }\n\n }\n \n this.distances[queryStartIdx] = bsfDist;\n this.indices[queryStartIdx] = bsfIdx;\n }",
"protected int insertionIndex(int key) {\r\n\t\tint hash = key & 0x7fffffff;\r\n\t\tint index = this.hashFunc1(hash) * FREE.length;\r\n\t\t// int stepSize = hashFunc2(hash);\r\n\t\tbyte[] cur = new byte[4];\r\n\t\tkeys.position(index);\r\n\t\tkeys.get(cur);\r\n int storehash=(cur[0] << 24)+ ((cur[1] & 0xFF) << 16)+ ((cur[2] & 0xFF) << 8)+ (cur[3] & 0xFF);\r\n\r\n\t\tif (Arrays.equals(cur, FREE)) {\r\n\t\t\treturn index; // empty, all done\r\n\t\t} else if (storehash==key) {\r\n\t\t\treturn -index - 1; // already stored\r\n\t\t} else { // already FULL or REMOVED, must probe\r\n\t\t\t// compute the double hash\r\n\t\t\tfinal int probe = (1 + (hash % (size - 2))) * FREE.length;\r\n\r\n\t\t\t// if the slot we landed on is FULL (but not removed), probe\r\n\t\t\t// until we find an empty slot, a REMOVED slot, or an element\r\n\t\t\t// equal to the one we are trying to insert.\r\n\t\t\t// finding an empty slot means that the value is not present\r\n\t\t\t// and that we should use that slot as the insertion point;\r\n\t\t\t// finding a REMOVED slot means that we need to keep searching,\r\n\t\t\t// however we want to remember the offset of that REMOVED slot\r\n\t\t\t// so we can reuse it in case a \"new\" insertion (i.e. not an update)\r\n\t\t\t// is possible.\r\n\t\t\t// finding a matching value means that we've found that our desired\r\n\t\t\t// key is already in the table\r\n\t\t\tif (!Arrays.equals(cur, REMOVED)) {\r\n\t\t\t\t// starting at the natural offset, probe until we find an\r\n\t\t\t\t// offset that isn't full.\r\n\t\t\t\tdo {\r\n\t\t\t\t\tindex += (probe); // add the step\r\n\t\t\t\t\tindex %= (size * FREE.length); // for wraparound\r\n\t\t\t\t\tcur = new byte[FREE.length];\r\n\t\t\t\t\tkeys.position(index);\r\n\t\t\t\t\tkeys.get(cur);\r\n\t\t\t\t} while (!Arrays.equals(cur, FREE)\r\n\t\t\t\t\t\t&& !Arrays.equals(cur, REMOVED)\r\n\t\t\t\t\t\t&& storehash!=hash);\r\n\t\t\t}\r\n\r\n\t\t\t// if the index we found was removed: continue probing until we\r\n\t\t\t// locate a free location or an element which equal()s the\r\n\t\t\t// one we have.\r\n\t\t\tif (Arrays.equals(cur, REMOVED)) {\r\n\t\t\t\tint firstRemoved = index;\r\n\t\t\t\twhile (!Arrays.equals(cur, FREE)\r\n\t\t\t\t\t\t&& (Arrays.equals(cur, REMOVED) || storehash!=hash)) {\r\n\t\t\t\t\tindex += (probe); // add the step\r\n\t\t\t\t\tindex %= (size * FREE.length); // for wraparound\r\n\t\t\t\t\tcur = new byte[FREE.length];\r\n\t\t\t\t\tkeys.position(index);\r\n\t\t\t\t\tkeys.get(cur);\r\n\t\t\t\t}\r\n\t\t\t\t// NOTE: cur cannot == REMOVED in this block\r\n\t\t\t\treturn (!Arrays.equals(cur, FREE)) ? -index - 1 : firstRemoved;\r\n\t\t\t}\r\n\t\t\t// if it's full, the key is already stored\r\n\t\t\t// NOTE: cur cannot equal REMOVE here (would have retuned already\r\n\t\t\t// (see above)\r\n\t\t\treturn storehash!=hash ? -index - 1 : index;\r\n\t\t}\r\n\t}",
"protected void moveUp(Position<Item<E>> p) {\n int cnt = count(p);\n Position<Item<E>> walk = p;\n while (walk != list.first() && count(list.before(walk)) < cnt) // found smaller access count ahead of Item\n walk = list.before(walk); // set walk to the left position\n if (walk != p) // we need to remove and re-insert the item at its right position\n list.addBefore(walk, list.remove(p)); // remove and re-inser the item\n\n }",
"void bellford(ArrayList<Integer> nlist){\n\n int stval = nlist.get(0);\n dlist.get(stval).setval(stval);\n dlist.get(stval).setDist(0);\n\n for(int i = 0; i < nlist.size()-1; i++){\n for(int key: nlist){\n LinkedList<Node> alist = grp.getOrDefault(key, null);\n if(alist != null){\n for(Node node: alist){\n int val = node.getval();\n int we = node.getDist();\n int ddist = dlist.get(val).getDist();\n int odist = dlist.get(key).getDist();\n if(odist != Integer.MAX_VALUE && ddist > odist+we){\n dlist.get(val).setval(key);\n dlist.get(val).setDist(odist+we);\n }\n }\n }\n }\n }\n for(int key: dlist.keySet()){\n System.out.println(key+\" dist:\"+dlist.get(key).getDist()+\" prev:\"+dlist.get(key).getval());\n }\n System.out.println(\"Negative cycles at:\");\n //iisue should run n-1 times:\n for(int key: nlist){\n LinkedList<Node> alist = grp.getOrDefault(key, null);\n if(alist != null){\n for(Node node: alist){\n int val = node.getval();\n int we = node.getDist();\n int ddist = dlist.get(val).getDist();\n int odist = dlist.get(key).getDist();\n if(odist != Integer.MAX_VALUE && ddist > odist+we){\n dlist.get(val).setval(-999);\n dlist.get(val).setDist(odist+we);\n System.out.println(val);\n }\n }\n }\n }\n }",
"public void keepWalking() {\n\t\t// move along the current segment\n\t\tif (UserParameters.socialInteraction) speed = progressSocial(moveRate);\n\t\telse speed = progress(moveRate);\n\t\tcurrentIndex += speed;\n\t\t// check to see if the progress has taken the current index beyond its goal\n\t\t// given the direction of movement. If so, proceed to the next edge\n\t\tif (linkDirection == 1 && currentIndex > endIndex) {\n\t\t\tCoordinate currentPos = segment.extractPoint(endIndex);\n\t\t\tupdatePosition(currentPos);\n\t\t\ttransitionToNextEdge(currentIndex - endIndex);\n\t\t}\n\t\telse if (linkDirection == -1 && currentIndex < startIndex) {\n\t\t\tCoordinate currentPos = segment.extractPoint(startIndex);\n\t\t\tupdatePosition(currentPos);\n\t\t\ttransitionToNextEdge(startIndex - currentIndex);\n\t\t}\n\t\telse {\n\t\t\t// just update the position!\n\t\t\tCoordinate currentPos = segment.extractPoint(currentIndex);\n\t\t\tupdatePosition(currentPos);\n\t\t}\n\t}",
"protected int searchLeft(double value) {\n int i = search(value);\n while (i > 0 && value == sequence.get(i - 1)) {\n i -= 1;\n }\n return i;\n }",
"public void GeneralSearch()\n {\n mainQuery = new ChildEventListener() {\n @Override\n public void onChildAdded(@NonNull DataSnapshot snapshot, @Nullable String previousChildName) {\n //get the snapshot value as a boulder problem\n BoulderProblem bp = snapshot.getValue(BoulderProblem.class);\n\n //create listener to get the setter display name\n ValueEventListener setterListener = new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot snapshot) {\n //display name is the value of the snapshot\n bp.SetSetter(snapshot.getValue().toString());\n //add the boulder problem to list of boulder problems\n bps.add(bp);\n //call method to display correct list\n BPSearch();\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError error) {\n\n }\n };\n //call method to attach listener for getting setter display name\n AttachSetterListener(bp.GetSetterId(), setterListener);\n }\n\n @Override\n public void onChildChanged(@NonNull DataSnapshot snapshot, @Nullable String previousChildName) {\n\n }\n\n @Override\n public void onChildRemoved(@NonNull DataSnapshot snapshot) {\n //listens for boulder problems removed from the database\n\n //get the snapshot value as a boulder problem object\n BoulderProblem bp = snapshot.getValue(BoulderProblem.class);\n //loop through list of boulder problems to check if it is in the list and if so remove it and re display the list on screen\n for(int i = 0; i < bps.size(); i++)\n {\n if(bps.get(i).GetName().equals(bp.GetName()))\n {\n bps.remove(i);\n BPSearch();\n break;\n }\n }\n }\n\n @Override\n public void onChildMoved(@NonNull DataSnapshot snapshot, @Nullable String previousChildName) {\n\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError error) {\n\n }\n };\n bpRef.child(\"UserCreated\").orderByChild(sortOption).addChildEventListener(mainQuery);\n }",
"protected int find_among_b(Among v[])\n {\n\tint i = 0;\n\tint j = v.length;\n\n\tint c = cursor;\n\tint lb = limit_backward;\n\n\tint common_i = 0;\n\tint common_j = 0;\n\n\tboolean first_key_inspected = false;\n\n\twhile (true) {\n\t int k = i + ((j - i) >> 1);\n\t int diff = 0;\n\t int common = common_i < common_j ? common_i : common_j;\n\t Among w = v[k];\n\t int i2;\n\t for (i2 = w.s.length - 1 - common; i2 >= 0; i2--) {\n\t\tif (c - common == lb) {\n\t\t diff = -1;\n\t\t break;\n\t\t}\n\t\tdiff = current.charAt(c - 1 - common) - w.s[i2];\n\t\tif (diff != 0) break;\n\t\tcommon++;\n\t }\n\t if (diff < 0) {\n\t\tj = k;\n\t\tcommon_j = common;\n\t } else {\n\t\ti = k;\n\t\tcommon_i = common;\n\t }\n\t if (j - i <= 1) {\n\t\tif (i > 0) break;\n\t\tif (j == i) break;\n\t\tif (first_key_inspected) break;\n\t\tfirst_key_inspected = true;\n\t }\n\t}\n\twhile (true) {\n\t Among w = v[i];\n\t if (common_i >= w.s.length) {\n\t\tcursor = c - w.s.length;\n\t\tif (w.method == null) return w.result;\n\n\t\tboolean res;\n\t\ttry {\n\t\t Object resobj = w.method.invoke(this);\n\t\t res = resobj.toString().equals(\"true\");\n\t\t} catch (InvocationTargetException e) {\n\t\t res = false;\n\t\t // FIXME - debug message\n\t\t} catch (IllegalAccessException e) {\n\t\t res = false;\n\t\t // FIXME - debug message\n\t\t}\n\t\tcursor = c - w.s.length;\n\t\tif (res) return w.result;\n\t }\n\t i = w.substring_i;\n\t if (i < 0) return 0;\n\t}\n }",
"private int BFS() {\n adjList.cleanNodeFields();\n\n //Queue for storing current shortest path\n Queue<Node<Integer, Integer>> q = new LinkedList<>();\n\n //Set source node value to 0\n q.add(adjList.getNode(startNode));\n q.peek().key = 0;\n q.peek().d = 0;\n q.peek().visited = true;\n\n //Helper variables\n LinkedList<Pair<Node<Integer, Integer>, Integer>> neighbors;//Array of pairs <neighborKey, edgeWeight>\n Node<Integer, Integer> neighbor, u;\n long speed = (long) (cellSideLength * 1.20);\n\n while (!isCancelled() && q.size() != 0) {\n u = q.poll();\n\n //Marks node as checked\n checkedNodesGC.fillRect((u.value >> 16) * cellSideLength + 0.5f,\n (u.value & 0x0000FFFF) * cellSideLength + 0.5f,\n (int) cellSideLength - 1, (int) cellSideLength - 1);\n\n //endNode found\n if (u.value == endNode) {\n //Draws shortest path\n Node<Integer, Integer> current = u, prev = u;\n\n while ((current = current.prev) != null) {\n shortestPathGC.strokeLine((prev.value >> 16) * cellSideLength + cellSideLength / 2,\n (prev.value & 0x0000FFFF) * cellSideLength + cellSideLength / 2,\n (current.value >> 16) * cellSideLength + cellSideLength / 2,\n (current.value & 0x0000FFFF) * cellSideLength + cellSideLength / 2);\n prev = current;\n }\n return u.d;\n }\n\n //Wait after checking node\n try {\n Thread.sleep(speed);\n } catch (InterruptedException interrupted) {\n if (isCancelled())\n break;\n }\n\n //Checking Neighbors\n neighbors = adjList.getNeighbors(u.value);\n for (Pair<Node<Integer, Integer>, Integer> neighborKeyValuePair : neighbors) {\n neighbor = neighborKeyValuePair.getKey();\n //Relaxation step\n //Checks if neighbor hasn't been checked, if so the assign the shortest path\n if (!neighbor.visited) {\n //Adds checked neighbor to queue\n neighbor.key = u.d + 1;\n neighbor.d = u.d + 1; //Assign shorter path found to neighbor\n neighbor.prev = u;\n neighbor.visited = true;\n q.add(neighbor);\n }\n }\n }\n return Integer.MAX_VALUE;\n }",
"public void moveDown()\n {\n if (!this.search_zone.isDownBorder(this.y_position))\n {\n this.y_position = (this.y_position + 1);\n }\n }",
"void testSearches(Tester t) {\n Vertex v1 = new Vertex(10, 10);\n Vertex v2 = new Vertex(10, 11);\n Vertex v3 = new Vertex(10, 12);\n\n Edge e1 = new Edge(v1, v2, 1);\n Edge e2 = new Edge(v2, v3, 1);\n\n IList<Vertex> map = new Cons<Vertex>(v1, new Cons<Vertex>(v2, new Cons<Vertex>(\n v3, new Empty<Vertex>())));\n\n Player player = new Player(map);\n DepthFirst dp = new DepthFirst(map);\n BreadthFirst bp = new BreadthFirst(map);\n\n t.checkExpect(player.current, v1);\n t.checkExpect(player.finished, false);\n\n t.checkExpect(bp.hasNext(), true);\n t.checkExpect(bp.next(), new Queue<Vertex>());\n\n t.checkExpect(dp.hasNext(), true);\n t.checkExpect(dp.next(), new Stack<Vertex>());\n\n t.checkExpect(player.move(true, e1), v2);\n\n t.checkExpect(player.current, v2);\n t.checkExpect(player.finished, false);\n\n t.checkExpect(bp.hasNext(), false);\n t.checkExpect(bp.next(), v3);\n\n t.checkExpect(dp.hasNext(), false);\n t.checkExpect(dp.next(), v3);\n\n t.checkExpect(player.move(true, e2), v3);\n\n player.finished = true;\n\n t.checkExpect(player.current, v3);\n t.checkExpect(player.finished, true);\n\n Queue<Vertex> q = new Queue<Vertex>(map);\n\n q.enqueue(new Vertex(5, 5));\n\n Deque<Vertex> dq = new Deque<Vertex>();\n dq.addAtHead(v1);\n dq.addAtTail(v2);\n dq.addAtTail(new Vertex(5, 5));\n\n\n t.checkExpect(q.isEmpty(), false);\n t.checkExpect(q.contents, dq);\n\n Stack<Vertex> stack = new Stack<Vertex>(map);\n\n t.checkExpect(stack.isEmpty(), false);\n dq.removeFromHead();\n t.checkExpect(stack.pop(), dq);\n\n t.checkExpect(dp.next(), v2);\n t.checkExpect(bp.hasNext(), true);\n\n }",
"private List<GeographicPoint> backTrack(HashMap<GeographicPoint, List<GeographicPoint>> prev, GeographicPoint goal) {\n\t\tList<GeographicPoint> ans = new ArrayList<GeographicPoint>();\n\t\tList<GeographicPoint> temp = prev.get(goal);\n\t\tif (temp.size() != 0) {\n\t\t\tans.add(goal);\n\t\t\twhile (temp.size() != 0) {\n//\t\t\t\tSystem.out.print(\"Neighbours: \");\n\t\t\t\t// lastNeighbour will be the neighbour node we visited right before moving to the current node\n\t\t\t\tGeographicPoint lastNeighbour = temp.get(temp.size() - 1);\n\t\t\t\tans.add(lastNeighbour);\n\t\t\t\ttemp = prev.get(lastNeighbour);\n\t\t\t}\n\t\t\tCollections.reverse(ans);\n\t\t}\n\t\tif (ans.isEmpty())\n\t\t\treturn null;\n\t\treturn ans;\n\t}",
"private void findNewNearestPub() {\n \t\tevent.SetPubLocation(new PubLocation()/*new nearest found location*/);\n \t\tUpdateFromEvent();\n \t}",
"@Override\n List<NodeData> pathFind() throws NoPathException {\n System.out.println(\"Starting Scenic\");\n\n frontier.add(start);\n\n while(!frontier.isEmpty()) {\n StarNode current = frontier.getLast();\n frontier.removeLast(); // pop the priority queue\n if(current.getXCoord() == goal.getXCoord() && current.getYCoord() == goal.getYCoord()) {\n // If we are at the goal, we need to backtrack through the shortest path\n System.out.println(\"At target!\");\n finalList.add(current); // we have to add the goal to the path before we start backtracking\n while(!(current.getXCoord() == start.getXCoord() && current.getYCoord() == start.getYCoord())) {\n finalList.add(current.getPreviousNode());\n current = current.getPreviousNode();\n System.out.println(current.getNodeID());\n }\n return finalList;\n }\n else {\n // we need to get all the neighbor nodes, identify their costs, and put them into the queue\n LinkedList<StarNode> neighbors = current.getNeighbors();\n // we also need to remove the previous node from the list of neighbors because we do not want to backtrack\n neighbors.remove(current.getPreviousNode());\n\n for (StarNode newnode : neighbors) {\n int nodePlace = this.listContainsId(frontier, newnode);\n if(nodePlace > -1) {\n if (frontier.get(nodePlace).getF() > actionCost(newnode) + distanceToGo(newnode, goal)) {\n System.out.println(\"Here\");\n frontier.remove(frontier.get(nodePlace));\n newnode.setPreviousNode(current);\n frontier.add(newnode);\n newnode.setF(actionCost(newnode) + distanceToGo(newnode, goal));\n }\n }\n else {\n newnode.setPreviousNode(current);\n frontier.add(newnode);\n newnode.setF(actionCost(newnode) + distanceToGo(newnode, goal));\n }\n\n // This fixes the problem with infinitely looping elevators (I hope)\n if(current.getNodeType().equals(\"ELEV\") && newnode.getNodeType().equals(\"ELEV\")) {\n for (Iterator<StarNode> iterator = newnode.neighbors.iterator(); iterator.hasNext();) {\n StarNode newneighbor = iterator.next();\n if (newneighbor.getNodeType().equals(\"ELEV\")) {\n // Remove the current element from the iterator and the list.\n iterator.remove();\n }\n }\n }\n if(current.getNodeType().equals(\"STAI\") && newnode.getNodeType().equals(\"STAI\")) {\n for (Iterator<StarNode> iterator = newnode.neighbors.iterator(); iterator.hasNext();) {\n StarNode newneighbor = iterator.next();\n if (newneighbor.getNodeType().equals(\"STAI\")) {\n // Remove the current element from the iterator and the list.\n iterator.remove();\n }\n }\n }\n // this is where the node is put in the right place in the queue\n Collections.sort(frontier);\n }\n }\n }\n throw new NoPathException(start.getLongName(), goal.getLongName());\n }",
"private void search(int offset, MetricSpaceObject query, ResultCollector collector, double parentToQueryDistance) {\n buffer.position(offset);\n\n //the node should consist of a pointer to each child node then the point data, then the value data\n double nodeRadius = buffer.getDouble();\n double parentToThisDistance = buffer.getDouble();\n int left = buffer.getInt();\n int right = buffer.getInt();\n \n double searchRadius = collector.getRadius();\n\n //check if we can skip a distance calculation using the triangle inequality\n if (!optimise || Double.isNaN(parentToQueryDistance)\n || Math.abs(parentToThisDistance - parentToQueryDistance) <= nodeRadius + searchRadius)\n {\n int vantagePointId = buffer.getInt();\n double distance = query.getDistance(vantagePointId);\n\n if (distance <= searchRadius) {\n //this point is within the distance threshold to the query object, so add it to the results\n collector.add(new SearchResult(query.getObjectID(), vantagePointId, distance));\n \n //update the search radius in case the add changed it\n searchRadius = collector.getRadius();\n }\n\n if (left != 0 && distance <= nodeRadius + searchRadius) {\n //points within a distance threshold to the query object could be inside the radius,\n //so search the left subtree\n search(left, query, collector, distance);\n }\n\n if (right != 0 && distance >= nodeRadius - searchRadius) {\n //points within a distance threshold to the query object could be outside the radius,\n //so search the right subtree\n search(right, query, collector, distance);\n }\n }\n else if (right != 0) {\n search(right, query, collector, Double.NaN);\n }\n }",
"private void backwardIteration() {\n\t\t// variables declaration\n\t\tint ortho;\n\t\tint diago;\n\t\tint diag2;\n\t\tint newVal;\n\n\t\t// Process last line: consider only the pixel just after (on the right)\n\t\tfor (int i = width - 2; i > 0; i--) {\n\t\t\tif (maskProc.getPixel(i, height - 1) != maskLabel)\n\t\t\t\tcontinue;\n\n\t\t\tnewVal = buffer.get(i + 1, height - 1) + weights[0];\n\t\t\tupdateIfNeeded(i, height - 1, newVal);\n\t\t}\n\n\t\t// last pixel of penultimate line: consider the 3 pixels below\n\t\tif (maskProc.getPixel(width - 1, height - 2) == maskLabel) {\n\t\t\tortho = buffer.get(width - 1, height - 1);\n\t\t\tdiago = buffer.get(width - 2, height - 1);\n\t\t\tdiag2 = buffer.get(width - 3, height - 1);\n\t\t\tnewVal = min3w(ortho, diago, diag2);\n\t\t\tupdateIfNeeded(width - 1, height - 2, newVal);\n\t\t}\n\n\t\t// penultimate pixel of penultimate line: consider right pixel, and the 4 pixels below\n\t\tif (maskProc.getPixel(width - 2, height - 2) == maskLabel) {\n\t\t\tortho = min(buffer.get(width - 1, height - 2), buffer.get(width - 2, height - 1));\n\t\t\tdiago = min(buffer.get(width - 1, height - 1), buffer.get(width - 3, height - 1));\n\t\t\tdiag2 = buffer.get(width - 4, height - 1);\n\t\t\tnewVal = min3w(ortho, diago, diag2);\n\t\t\tupdateIfNeeded(width - 2, height - 2, newVal);\n\t\t}\n\n\t\t// Process regular pixels of penultimate line\n\t\tfor (int i = width - 3; i > 0; i--) {\n\t\t\tif (maskProc.getPixel(i, height - 2) != maskLabel)\n\t\t\t\tcontinue;\n\n\t\t\t// minimum distance of neighbor pixels\n\t\t\tortho = min(buffer.get(i + 1, height - 2), buffer.get(i, height - 1));\n\t\t\tdiago = min(buffer.get(i - 1, height - 1), buffer.get(i + 1, height - 1));\n\t\t\tdiag2 = min(buffer.get(i - 2, height - 1), buffer.get(i + 2, height - 1));\n\t\t\t\n\t\t\t// compute new distance of current pixel\n\t\t\tnewVal = min3w(ortho, diago, diag2);\n\n\t\t\t// modify current pixel if needed\n\t\t\tupdateIfNeeded(i, height - 2, newVal);\n\t\t}\n\n\t\t// Process regular lines\n\t\tfor (int j = height - 3; j >= 0; j--) {\n\n\t\t\t// process last pixel of the current line: consider pixels\n\t\t\t// down, down-left and (-2,+1)\n\t\t\tif (maskProc.getPixel(width - 1, j) == maskLabel) {\n\t\t\t\tortho = buffer.get(width - 1, j + 1);\n\t\t\t\tdiago = buffer.get(width - 2, j + 1);\n\t\t\t\tdiag2 = buffer.get(width - 3, j + 1);\n\t\t\t\tnewVal = min3w(ortho, diago, diag2);\n\t\t\t\tupdateIfNeeded(width - 1, j, newVal);\n\t\t\t}\n\n\t\t\n\t\t\t// process penultimate pixel of current line\n\t\t\tif (maskProc.getPixel(width - 2, j) == maskLabel) {\n\n\t\t\t\t// minimum distance of neighbor pixels\n\t\t\t\tortho = min(buffer.get(width - 1, j), buffer.get(width - 2, j + 1));\n\t\t\t\tdiago = min(buffer.get(width - 3, j + 1), buffer.get(width - 1, j + 1));\n\t\t\t\tdiag2 = min3(\n\t\t\t\t\t\tbuffer.get(width - 3, j + 2), \n\t\t\t\t\t\tbuffer.get(width - 1, j + 2), \n\t\t\t\t\t\tbuffer.get(width - 4, j + 1));\n\t\t\t\t\n\t\t\t\t// compute new distance of current pixel\n\t\t\t\tnewVal = min3w(ortho, diago, diag2);\n\n\t\t\t\t// modify current pixel if needed\n\t\t\t\tupdateIfNeeded(width - 2, j, newVal);\n\t\t\t}\n\n\t\t\t// Process pixels in the middle of the current line\n\t\t\tfor (int i = width - 3; i > 1; i--) {\n\t\t\t\t// process only pixels inside structure\n\t\t\t\tif (maskProc.getPixel(i, j) != maskLabel)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// minimum distance of neighbor pixels\n\t\t\t\tortho = min(buffer.get(i + 1, j), buffer.get(i, j + 1));\n\t\t\t\tdiago = min(buffer.get(i - 1, j + 1), buffer.get(i + 1, j + 1));\n\t\t\t\tdiag2 = min(\n\t\t\t\t\t\tmin(buffer.get(i - 1, j + 2), buffer.get(i + 1, j + 2)),\n\t\t\t\t\t\tmin(buffer.get(i - 2, j + 1), buffer.get(i + 2, j + 1)));\n\t\t\t\t\n\t\t\t\t// compute new distance of current pixel\n\t\t\t\tnewVal = min3w(ortho, diago, diag2);\n\n\t\t\t\t// modify current pixel if needed\n\t\t\t\tupdateIfNeeded(i, j, newVal);\n\t\t\t}\n\n\t\t\t// process second pixel of current line: consider pixels right,\n\t\t\t// down-right and down\n\t\t\tif (maskProc.getPixel(1, j) == maskLabel) {\n\t\t\t\tortho = min(buffer.get(2, j), buffer.get(1, j + 1));\n\t\t\t\tdiago = min(buffer.get(0, j + 1), buffer.get(2, j + 1));\n\t\t\t\tdiag2 = min3(buffer.get(3, j + 2), buffer.get(2, j + 1), buffer.get(0, j + 1));\n\t\t\t\tnewVal = min3w(ortho, diago, diag2);\n\t\t\t\tupdateIfNeeded(1, j, newVal);\n\t\t\t}\n\n\t\t\t// process first pixel of current line: consider pixels right,\n\t\t\t// down-right and down\n\t\t\tif (maskProc.getPixel(0, j) == maskLabel) {\n\t\t\t\tortho = min(buffer.get(1, j), buffer.get(0, j + 1));\n\t\t\t\tdiago = buffer.get(1, j + 1);\n\t\t\t\tdiag2 = min(buffer.get(2, j + 2), buffer.get(1, j + 1));\n\t\t\t\tnewVal = min3w(ortho, diago, diag2);\n\t\t\t\tupdateIfNeeded(0, j, newVal);\n\t\t\t}\n\n\t\t} // end of processing for current line\n\t\t \n\t}",
"public static void scanDirty(List<Intersection> sections){\n for(int i = 0; i<sections.size(); i++){\n Intersection section = sections.get(i);\n if(section.dirty != 0){\n int startI = i;\n double min = Double.MAX_VALUE;\n for(int j = 0; j<sections.size(); j++){\n if(j == startI){\n continue;\n }\n Intersection other = sections.get(j);\n\n double m = Vector3DOps.mag(Vector3DOps.difference(other.location, section.location));\n if(m < min){\n min = m;\n }\n if( m < Math.abs(section.dirty) ){\n System.out.println(\"should take it: \" + other.dirty);\n //System.out.println(\"removing: \" + i + \", \" + m + \" < \" + section.dirty);\n //System.out.println(\"\\t by: \" + j + \" , \" + other.dirty);\n if(startI > i){\n continue;\n }\n sections.remove(i);\n i--;j--;\n }\n }\n if( startI > i){\n System.out.println(\"removed\");\n } else{\n System.out.println(\"left\");\n }\n }\n }\n\n\n }",
"private void trickleDown(int index) {\n Map.Entry<String, Double> smallest;\n Map.Entry<String, Double> top = this.get(index);\n int currentSize = this.size();\n\n while (index < currentSize / 2) { // while node has at leat one child\n Map.Entry<String, Double> left = LEFT(this.get(index));\n Map.Entry<String, Double> right = RIGHT(this.get(index));\n\n // find smaller child\n // if right child exists\n if (right != null && left.getValue().compareTo(right.getValue()) > 0) {\n smallest = right;\n } else {\n smallest = left;\n }\n\n // top <= smallest ?\n if (top.getValue().compareTo(smallest.getValue()) <= 0) {\n break;\n }\n\n // shift child up\n int smallestIndex = this.indexOf(smallest);\n Collections.swap(this, index, smallestIndex);\n index = smallestIndex;\n } // end while\n }",
"public void retreat() {\n if( mMatches.hasPrevious() ) {\n setCurrent( mMatches.previous() );\n }\n }",
"void stateBacktracked (Search search);",
"private void trickleUp(int index) {\n Map.Entry<String, Double> bottom = this.get(index);\n\n // if bottom < parent, move up\n while (PARENT(bottom).getValue().compareTo(bottom.getValue()) > 0) {\n Collections.swap(this, this.indexOf(bottom), this.indexOf(PARENT(bottom)));\n }\n\n }",
"private void searchGuide(EditText searchBar, boolean forward)\n \t{\t\n \t\t//private ArrayList<View> guideTextViews;\n \t\t//private int guideIndex;\n \t\t//private int textBlockIndex;\n \t\t\n \t\tString query = searchBar.getText().toString().toLowerCase(AlgorithmContainer.CURRENT_LOCALE);\n \t\tScrollView scrollBar = (ScrollView) findViewById(R.id.scroll_bar);\n \t\t\n \t\twhile(guideIndex >= 0 && guideIndex < guideTextViews.size())\n \t\t{\n \t\t\tView view = guideTextViews.get(guideIndex);\n \t\t\tTextView block = null;\n \t\t\tString textBlock = null;\n \t\t\t\n \t\t\tif(view instanceof TextView)\n \t\t\t{\n \t\t\t\tblock = (TextView) view;\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tsearchBar.setHint(\"An error has occurred\");\n \t\t\t\treturn;\n \t\t\t}\n \t\t\t\n \t\t\ttextBlock = (String) block.getText().toString().toLowerCase(AlgorithmContainer.CURRENT_LOCALE);\n \t\t\t\n \t\t\t\n \t\t\t//Search the given block of text\n \t\t\twhile(textBlockIndex < textBlock.length())\n \t\t\t{\n \t\t\t\ttextBlockIndex = textBlock.indexOf(query,textBlockIndex);\n \t\t\t\tif(textBlockIndex == -1)\n \t\t\t\t{\n \t\t\t\t\ttextBlockIndex = 0;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tint loc[] = {0,1};\n \t\t\t\t\tblock.getLocationInWindow(loc);\n \t\t\t\t\tscrollBar.scrollTo(loc[0],loc[1]);\n \t\t\t\t\tif(forward)\n \t\t\t\t\t{\tsearchBar.clearFocus();\n \t\t\t\t\t\tblock.requestFocus(View.FOCUS_DOWN);\n \t\t\t\t\t\treturn;\n \t\t\t\t\t}\n \t\t\t\t\telse\n \t\t\t\t\t{\n \t\t\t\t\t\tsearchBar.clearFocus();\n \t\t\t\t\t\tblock.requestFocus(View.FOCUS_UP);\n \t\t\t\t\t\treturn;\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t}\n \t\t\t}\n \t\t\ttextBlockIndex = 0;\n \t\t\tif(forward)\n \t\t\t{\n \t\t\t\t++guideIndex;\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\t--guideIndex;\n \t\t\t}\n \t\t}\n \t\tif(guideIndex >= guideTextViews.size() || guideIndex < 0)\n \t\t{\n \t\t\tsearchBar.setText(\"Reached end for \\\"\" + query + \"\\\"\");\n \t\t\tif(forward)\n \t\t\t{\n \t\t\t\tguideIndex = 0;\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tguideIndex = guideTextViews.size() - 1;\n \t\t\t}\n \t\t}\n \t\t\n \t\treturn;\n \t}",
"int toIndex(Position pos);",
"private boolean computeSearchDirection() {\n\t\t// Compute the function's gradient\n\t\tfunction.computeGradient(temp0_Nx1.data);\n\n\t\t// compute the change in gradient\n\t\tfor( int i = 0; i < N; i++ ) {\n\t\t\ty.data[i] = temp0_Nx1.data[i] - g.data[i];\n\t\t\tg.data[i] = temp0_Nx1.data[i];\n\t\t}\n\n\t\t// Update the inverse Hessian matrix\n\t\tif( iterations != 0 ) {\n\t\t\tEquationsBFGS.inverseUpdate(B, s, y, temp0_Nx1, temp1_Nx1);\n\t\t}\n\n\t\t// compute the search direction\n\t\tCommonOps_DDRM.mult(-1,B,g, searchVector);\n\n\t\t// use the line search to find the next x\n\t\tif( !setupLineSearch(fx, x.data, g.data, searchVector.data) ) {\n\t\t\t// the search direction has a positive derivative, meaning the B matrix is\n\t\t\t// no longer SPD. Attempt to fix the situation by resetting the matrix\n\t\t\tresetMatrixB();\n\t\t\t// do the search again, it can't fail this time\n\t\t\tCommonOps_DDRM.mult(-1,B,g, searchVector);\n\t\t\tsetupLineSearch(fx, x.data, g.data, searchVector.data);\n\t\t} else if(Math.abs(derivAtZero) <= gtol ) {\n\t\t\tif( verbose != null ) {\n\t\t\t\tverbose.printf(\"finished select direction, gtest=%e\\n\",Math.abs(derivAtZero));\n\t\t\t}\n\n\t\t\t// the input might have been modified by the function. So copy it\n\t\t\tSystem.arraycopy(function.getCurrentState(),0,x.data,0,N);\n\t\t\treturn terminateSearch(true);\n\t\t}\n\n\t\tmode = 1;\n\t\titerations++;\n\t\treturn false;\n\t}",
"protected int search(double value) {\n int n = sequence.size();\n int left = 0, right = n - 1, index = 0;\n while (left != right) {\n index = (right - left) / 2 + left;\n if (value >= sequence.get(index == left ? index + 1 : index)) {\n left = index == left ? index + 1 : index;\n } else {\n right = index;\n }\n }\n while (left > 0 && value == sequence.get(left - 1)) {\n left -= 1;\n }\n return left;\n }",
"public static ArrayList<String> getWordLadderBFS(String start, String end) {\n Set<String> dict = makeDictionary();\n ArrayList<String> path = new ArrayList<>();\n path.add(start);\n Queue<ArrayList<String>> queue = new LinkedList<>();\n queue.add(path);\n\n /*As we are going through the entire dictionary, we don't want to hit the start word again */\n dict.remove(start);\n\n while (!queue.isEmpty() && !getLastWord(queue.peek()).equals(end)) {//while queue is not empty and\n //head element does not contain end word\n\n ArrayList<String> ladder = queue.remove();\n\n if (getLastWord(ladder).equals(end)) { //we have found destination word\n for (int i = 0; i < ladder.size(); i++) {\n ladder.set(i, ladder.get(i).toLowerCase());\n }\n return ladder;\n }\n Iterator<String> iterator = dict.iterator();\n while (iterator.hasNext()) {\n String string = iterator.next();\n\n if (differByOne(string, getLastWord(ladder))) {\n ArrayList<String> list = new ArrayList<>(ladder);\n list.add(string);\n\n queue.add(list);\n\n iterator.remove();\n }\n }\n\n }\n\n if (!queue.isEmpty()) {\n for (int i = 0; i < queue.peek().size(); i++) {\n queue.peek().set(i, queue.peek().get(i).toLowerCase());\n }\n return queue.peek();\n } else {\n return new ArrayList<>();\n }\n }",
"long getMaxItemFindings();",
"public void search() {\r\n\t\tfloat dist = getDistance(permutationPrev);\r\n\t\tfloat delta = 0;\r\n\t\tfloat prob = 0;\r\n\r\n\t\tboolean accept = false;\r\n\r\n\t\tRandom rand = new Random();\r\n\r\n\t\twhile ((temperature > minTemperature) || (nIter > 0)) {\r\n\t\t\tdisturbPermut(permutationPrev);\r\n\t\t\tdelta = getDistance(permutation) - dist;\r\n\r\n\t\t\tprob = (float) Math.exp(-delta / temperature);\r\n\t\t\taccept = ((delta < 0) || (delta * (prob - rand.nextFloat()) >= 0));\r\n\r\n\t\t\tif (accept) {\r\n\t\t\t\tacceptPermution(permutation);\r\n\t\t\t\tdist = delta + dist;\r\n\t\t\t}\r\n\r\n\t\t\ttemperature *= cBoltzman;\r\n\t\t\tnIter--;\r\n\r\n\t\t\ttrace.add(dist);\r\n\t\t}\r\n\t\tshortestDist = dist;\r\n\t}",
"protected void trickleDown(int i) {\n\n int left = this.leftChild(i);\n int right = this.rightChild(i);\n T element = this.elements[i];\n\n if (left < currentSize && right < currentSize) {\n int min = this.minPosition(right, left);\n\n if ( element.compareTo(this.elements[min]) > 0)\n this.swapTrickleDown(i, min);\n\n } else if (left < currentSize && element.compareTo(this.elements[left]) > 0)\n this.swapTrickleDown(i, left);\n\n }",
"public abstract List<T> findWithOffsetFromPosition(int from, int amount);",
"public static void compareAStarLimitedOpen(List<Position> places, int start, int end, int step) {\n if (end < start) {\n int tmp = end;\n end = start;\n start = tmp;\n }\n Node startNode = graph.findClosest(places.get(0), false);\n Node endNode = graph.findClosest(places.get((1)), false);\n System.out.println(\"==================================================\");\n System.out.println(\"Benchmark A-Star with weighted h\");\n System.out.println(\"From \" + start + \" to \" + end + \" steps \" + step);\n System.out.println(distance.calcDist(startNode, endNode));\n System.out.println(\"==================================================\");\n System.out.println();\n\n AStarResult compareResult;\n try {\n compareResult = AStarAlgorithm.search(graph, startNode, endNode, \"Compare\", 1, 0);\n } catch (Exception e) {\n System.out.println(e.getMessage());\n return;\n }\n\n //\n int curr;\n for (curr = start; curr <= end; curr += step) {\n Path path = new Path(\"\");\n AStarResult result;\n try {\n result = AStarAlgorithm.search(graph, startNode, endNode, \"Compare \" + curr, 1, curr);\n path.addSegment(result.getPath());\n FileWriter fstream = new FileWriter(curr + \".gpx\");\n BufferedWriter out = new BufferedWriter(fstream);\n String gpx = GPXBuilder.build(path.getGeoLineString(true), path.getName());\n out.write(gpx);\n out.close();\n fstream.close();\n System.out.println(\"Result for w=\" + curr);\n System.out.println(\"Expanded Nodes: \" + result.getExpandedNodesCount() + \" (\" + (result.getExpandedNodesCount() - compareResult.getExpandedNodesCount()) + \")\");\n System.out.println(\"Path Length: \" + result.getPath().getLength() + \" (\" + (result.getPath().getLength() - compareResult.getPath().getLength()) + \")\");\n System.out.println(\"SortTime: \" + result.getSorttime() + \" (\" + (result.getSorttime() - compareResult.getSorttime()) + \")\");\n System.out.println(\"Runtime: \" + result.getRuntime() + \" (\" + (result.getRuntime() - compareResult.getRuntime()) + \")\");\n System.out.println();\n } catch (Exception e) {\n System.out.println(e.getMessage());\n }\n }\n }",
"@Override\n public void updateItemSearchIndex() {\n try {\n // all item IDs that don't have a search index yet\n int[] allMissingIds = mDatabaseAccess.itemsDAO().selectMissingSearchIndexIds();\n // Selects the item to the id, extract all parts of the item name to create the\n // search index (all ItemSearchEntity's) and insert them into the database\n for (int missingId : allMissingIds) {\n try {\n ItemEntity item = mDatabaseAccess.itemsDAO().selectItem(missingId);\n List<ItemSearchEntity> searchEntities = createItemSearchIndex(item);\n mDatabaseAccess.itemsDAO().insertItemSearchParts(searchEntities);\n } catch (Exception ex) {\n Log.e(TAG, \"An error occurred trying to create the search index to the id\" +\n missingId, ex);\n }\n }\n } catch (Exception ex) {\n Log.e(TAG, \"A general failure has occurred while trying to load and process all \" +\n \"item IDs to generate a search index\", ex);\n }\n }",
"public void removeSmaller(double value){\r\n\t DoubleNode cursor2; \r\n\tfor(cursor = head; cursor != null; cursor = cursor.getLink()){\r\n\t\tif(cursor.getData() < value){\r\n\t\t\tif(cursor == head){\r\n\t\t\t\thead = head.getLink(); \r\n\t\t\t\tmanyNodes--; \r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tcursor2 = cursor; \r\n\t\t\t\tthis.removeCurrent();\r\n\t\t\t\tcursor = cursor2;\r\n\t\t\t\tmanyNodes--; \r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n }",
"public void filterByMyMostRece() {\n // for each mood event in the list\n for (int i = 0; i < moodListBeforeFilterMy.getCount(); i++ ){\n // get the mood's date\n dateOfMood = moodListBeforeFilterMy.getMoodEvent(i).getDateOfRecord();\n // if it within the range, then add it to the new list\n if (dateOfMood.compareTo(lowerBoundDATE) >= 0 && dateOfMood.compareTo(currentDATE) <= 0) {\n moodListAfterFilter.add(moodListBeforeFilterMy.getMoodEvent(i));\n }\n }\n }",
"private void ensureDistances() {\n if (getDistanceEnd() > distances.length) {\n int newLength = distances.length * 4;\n double[] newDistances = new double[newLength];\n System.arraycopy(distances, 0, newDistances, 0, distances.length);\n Arrays.fill(newDistances, distances.length, newLength, -1);\n distances = newDistances;\n }\n }",
"public static void updateLargestValueFirstSort(long new_value, long[] values, PEPeer new_item, ArrayList items, int start_pos) {\n items.ensureCapacity(values.length);\n for (int i = start_pos; i < values.length; i++) {\n if (new_value >= values[i]) {\n for (int j = values.length - 2; j >= i; j--) { // shift displaced values to the right\n values[j + 1] = values[j];\n }\n\n if (items.size() == values.length) { // throw away last item if list too large\n items.remove(values.length - 1);\n }\n\n values[i] = new_value;\n items.add(i, new_item);\n\n return;\n }\n }\n }",
"public void addTwoStepForwardToPositionCache(Key currentKey) {\n\n\t\tKey newKey = createTwoStepForwardFromCurrentKey(currentKey);\n\n\t\t// Gets current values stored with key and adds the extra position\n\t\tSet<Key> currentKeyMapping = positionCache.get(currentKey);\n\t\tcurrentKeyMapping.add(newKey);\n\t\tpositionCache.put(currentKey, currentKeyMapping);\n\t}",
"private void addAllBelow(@NonNull final Location searchLoc, final int limit) {\n int currX = searchLoc.getScX();\n int currY = searchLoc.getScY();\n int currZ = searchLoc.getScZ();\n \n while (currZ >= limit) {\n currX += MapDisplayManager.TILE_PERSPECTIVE_OFFSET;\n currY -= MapDisplayManager.TILE_PERSPECTIVE_OFFSET;\n currZ--;\n final long foundKey = Location.getKey(currX, currY, currZ);\n synchronized (unchecked) {\n if (!unchecked.contains(foundKey)) {\n unchecked.add(foundKey);\n }\n }\n }\n }",
"@Test\n public void testIterator_Backward() {\n OasisList<Integer> baseList = new SegmentedOasisList<>();\n baseList.addAll(Arrays.asList(1, 2, 6, 8));\n\n ListIterator<Integer> instance = baseList.listIterator();\n\n int i = 0;\n while (instance.hasNext()) {\n instance.next();\n }\n\n i = baseList.size() - 1;\n while (instance.hasPrevious()) {\n assertEquals(baseList.get(i--), instance.previous());\n }\n\n }",
"public static ArrayList<Word> search(String inputString){\n Node current = root;\n \n // remove doubles and make aphameticals\n Word tempWord = new Word(inputString);\n \n String s = tempWord.getTrieWord();\n \n ArrayList<Word> results = new ArrayList<Word>();\n ArrayList<Word> fuzzyResults = new ArrayList<Word>();\n\n while(current != null){\n \n for(int i=0;i<s.length();i++){ \n if(current.subNode(s.charAt(i)) == null){\n System.out.println(\"WE Have an extra letter ------ !!!!\");\n Collections.sort(results, new CustomComparator()); \n return results;\n }\n else\n current = current.subNode(s.charAt(i));\n \n if(i==inputString.length()-2){\n fuzzyResults.addAll(current.possibleWords);\n }\n \n }\n \n if (current.marker == true)\n results.addAll(current.possibleWords);\n \n // return results; // place here for no problems\n \n }\n \n \n \n //remove fuzzyResults from normal results\n for(int r=0; r<results.size(); r++){\n \n if(results.get(r).isFuzzy){\n results.remove(r);\n r--;\n }\n }\n \n \n // Go through fuzzy results and only accept ones that are less than 1 char of search string\n for(int r=0; r<fuzzyResults.size(); r++){\n \n if(((fuzzyResults.get(r).getWord().length()-1)==inputString.length()) && fuzzyResults.get(r).isFuzzy ){\n results.add(fuzzyResults.get(r)); \n }\n }\n \n Collections.sort(results, new CustomComparator()); \n\n return results;\n \n }",
"private void set_distance() {\n int[] k = new int[getQueue().length];\n distance = 0.0;\n for (int i = 1; i < getQueue().length; i++) {\n distance += getPoints().get(way[i]).distance(getPoints().get(way[i - 1]));\n }\n distance += getPoints().get(getQueue()[getPoints().size() - 1]).distance(getPoints().get(0));\n enterd = true;\n }",
"private int searchR(Searching[] array, int start, int half, int end, int value) {\n if (value > array[end].getValue() || value < array[start].getValue()) {\n return -1;\n }\n int a = end - start;\n int b = array[end].getValue() - array[start].getValue();\n int c = value - array[start].getValue();\n int d = (c * a) / b;\n int slide = d + start;\n if (slide > end || slide < start) {\n return -1;\n }\n if (array[slide].getValue() == value) {\n return slide;\n }\n if (value < array[slide].getValue()) {\n end = slide;\n return searchR(array, start, half, end, value);\n } else {\n start = slide;\n return searchR(array, start, half, end, value);\n }\n }",
"void moveNext()\n\t{\n\t\tif (cursor != null) \n\t\t{\n\t\t\tif (cursor == back) \n\t\t\t{\n\t\t\t\tcursor = null;\n index = -1; //added cause i was failing the test scripts and forgot to manage the indices \n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcursor = cursor.next; //moves cursor toward back of the list\n index++; //added cause i was failing to the test scripts and forgot to manage the indicies\n\t\t\t}\n\t\t}\n\t}",
"private static void bfs(int idx) {\n\t\t\n\t\tQueue<node> q =new LinkedList<node>();\n\t\tq.add(new node(idx,0,\"\"));\n\t\twhile (!q.isEmpty()) {\n\t\t\tnode tmp = q.poll();\n\t\t\tif(tmp.idx<0 ||tmp.idx > 200000) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(tmp.cnt> min) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(tmp.idx == k) {\n\t\t\t\tif(tmp.cnt < min) {\n\t\t\t\t\tmin = tmp.cnt;\n\t\t\t\t\tminnode = tmp;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!visit[tmp.idx] && tmp.idx<=100000) {\n\t\t\t\tvisit[tmp.idx]= true;\n\t\t\t\tq.add(new node(tmp.idx*2, tmp.cnt+1,tmp.s));\n\t\t\t\tq.add(new node(tmp.idx-1, tmp.cnt+1,tmp.s));\n\t\t\t\tq.add(new node(tmp.idx+1, tmp.cnt+1,tmp.s));\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"private static int find(int i)\r\n{\n int ind = i;\r\n while (ind != ptrs[ind]) {\r\n ind = ptrs[ind];\r\n }\r\n // fix the link so that it is one hop only\r\n // note: this doesn't implement the full union-find update\r\n\r\n ptrs[i] = ind;\r\n\r\n return ind;\r\n}",
"private void calculate() {\n\t\tList<Edge> path = new ArrayList<>();\n\t\tPriorityQueue<Vert> qv = new PriorityQueue<>();\n\t\tverts[s].dist = 0;\n\t\tqv.add(verts[s]);\n\t\twhile (!qv.isEmpty()) {\n\t\t\tVert v = qv.poll();\n\t\t\tint vidx = v.idx;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tif (e.w==0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tVert vo = verts[e.other(vidx)];\n\t\t\t\tif (vo.dist > v.dist + e.w) {\n\t\t\t\t\tvo.dist = v.dist + e.w;\n\t\t\t\t\tqv.add(vo);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (verts[t].dist < L) {\n\t\t\tok = false;\n\t\t\treturn;\n\t\t} else if (verts[t].dist == L) {\n\t\t\tok = true;\n\t\t\tfor (int i=0; i<m; i++) {\n\t\t\t\tif (edges[i].w == 0) {\n\t\t\t\t\tedges[i].w = MAX_DIST;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// replace 0 with 1, adding to za list\n\t\tfor (int i=0; i<m; i++) {\n\t\t\tif (edges[i].w == 0) {\n\t\t\t\tza[i] = true;\n\t\t\t\tedges[i].w = 1;\n\t\t\t} else {\n\t\t\t\tza[i] = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// looking for shortest path from s to t with 0\n\t\tfor (int i=0; i<n; i++) {\n\t\t\tif (i != s) {\n\t\t\t\tverts[i].dist = MAX_DIST;\n\t\t\t}\n\t\t}\n\t\tqv.clear();\n\t\tqv.add(verts[s]);\n\t\twhile (!qv.isEmpty()) {\n\t\t\tVert v = qv.poll();\n\t\t\tint vidx = v.idx;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tVert vo = verts[e.other(vidx)];\n\t\t\t\tif (vo.dist > v.dist + e.w) {\n\t\t\t\t\tvo.dist = v.dist + e.w;\n\t\t\t\t\tqv.add(vo);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (verts[t].dist > L) {\n\t\t\tok = false;\n\t\t\treturn;\n\t\t}\n\t\tVert v = verts[t];\n\t\twhile (v.dist > 0) {\n\t\t\tlong minDist = MAX_DIST;\n\t\t\tVert vMin = null;\n\t\t\tEdge eMin = null;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tVert vo = verts[e.other(v.idx)];\n\t\t\t\tif (vo.dist+e.w < minDist) {\n\t\t\t\t\tvMin = vo;\n\t\t\t\t\teMin = e;\n\t\t\t\t\tminDist = vMin.dist+e.w;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\tv = vMin;\t\n\t\t\tpath.add(eMin);\n\t\t}\n\t\tCollections.reverse(path);\n\t\tfor (int i=0; i<m; i++) {\n\t\t\tif (za[i]) {\n\t\t\t\tedges[i].w = MAX_DIST;\n\t\t\t}\n\t\t}\n\t\tlong totLen=0;\n\t\tboolean wFixed = false;\n\t\tfor (Edge e : path) {\n\t\t\ttotLen += (za[e.idx] ? 1 : e.w);\n\t\t}\n\t\tfor (Edge e : path) {\n\t\t\tif (za[e.idx]) {\n\t\t\t\tif (!wFixed) {\n\t\t\t\t\te.w = L - totLen + 1;\n\t\t\t\t\twFixed = true;\n\t\t\t\t} else {\n\t\t\t\t\te.w = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tok = true;\n\t}",
"public double getLastMoved();",
"private void e_Neighbours(int u){ \n int edgeDistance = -1; \n int newDistance = -1; \n \n // All the neighbors of v \n for (int i = 0; i < adj.get(u).size(); i++) { \n Node v = adj.get(u).get(i); \n \n // If current node hasn't already been processed \n if (!settled.contains(v.node)) { \n edgeDistance = v.cost; \n newDistance = dist[u] + edgeDistance; \n \n // If new distance is cheaper in cost \n if (newDistance < dist[v.node]) \n dist[v.node] = newDistance; \n \n // Add the current node to the queue \n pq.add(new Node(v.node, dist[v.node])); \n } \n } \n }",
"private int bfs(String source, String destination, Map<String, List<String>> graph) {\n\n class Node {\n String word;\n int distance = 0;\n\n public Node(String word, int distance) {\n this.word = word;\n this.distance = distance;\n }\n }\n\n final Queue<Node> queue = new LinkedList<>();\n Set<String> visited = new HashSet<>();\n queue.offer(new Node(source, 0)); //distance of source to source is 0\n visited.add(source);\n\n while (!queue.isEmpty()) {\n\n final Node node = queue.poll();\n final int distance = node.distance;\n\n //if we reached the destination node\n if (node.word.equals(destination)) {\n return distance + 1;\n }\n\n //try all word which is 1 weight away\n for (String neighbour : graph.getOrDefault(node.word, new ArrayList<>())) {\n if (!visited.contains(neighbour)) {\n visited.add(neighbour);\n queue.offer(new Node(neighbour, distance + 1));\n }\n }\n\n\n }\n return 0;\n }",
"private void limitDistance(double latitude, double longitude, ArrayList<String[]> arrList){\r\n\t\tString[] currArr;//will hold match that is being checked\r\n\t\tDouble dist = 0.0;//holds the computed distance\r\n\t\t\r\n\t\t//for the entire match list\r\n\t\tfor(int i = 0; i < arrList.size(); i++){\r\n\t\t\tcurrArr = arrList.get(i);//current match\r\n\t\t\tdist = distance(latitude, longitude, currArr[0]);//compute the distance\r\n\t\t\t\r\n\t\t\tif(dist > MAX_DISTANCE){//check for distance\r\n\t\t\t\tarrList.remove(i);//remove violating match\r\n\t\t\t\ti--;//compensate for removed item\r\n\t\t\t} else {\r\n\t\t\t\tcurrArr[7] = String.valueOf(dist);//add the distance from the client\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private int search(String query, int from, int to)\n {\n\n if(list.isEmpty() || from >= to){\n return -1;\n }\n\n TreeMap<String, Integer> mapList = new TreeMap<>();\n\n for (int i = 0; i < list.size(); i++) {\n mapList.put(list.get(i), i);\n }\n Collections.sort(list);\n\n\n\n int middle = (from + to) / 2;\n int comparison = query.compareTo(list.get(middle));\n if (comparison == 0){\n return mapList.get(list.get(middle));\n }\n if(comparison > 0){\n\n return search(query, middle, to);\n }\n\n if(comparison < 0){\n return search(query, from, middle);\n }\n\n return -1;\n }",
"@Override\r\n public void extractIndexBetween(List<HistoricalIndexElement> index, long start, long end) {\n historicalBuffersLock.lock();\r\n try {\r\n for (Block block : historicalBlocks) {\r\n HistoricalIndexElement[] elements = block.index.toSortedElements();\r\n for (HistoricalIndexElement historicalIndexElement : elements) {\r\n long time = historicalIndexElement.getTime();\r\n if (time >= start && time < end) {\r\n index.add(historicalIndexElement);\r\n }\r\n }\r\n }\r\n } finally {\r\n historicalBuffersLock.unlock();\r\n }\r\n\r\n if (currentBlock != null) {\r\n // Now the current block\r\n HistoricalIndexElement[] elements = currentBlock.index.toSortedElements();\r\n for (HistoricalIndexElement historicalIndexElement : elements) {\r\n long time = historicalIndexElement.getTime();\r\n if (time >= start && time < end) {\r\n index.add(historicalIndexElement);\r\n }\r\n }\r\n }\r\n\r\n }",
"private List<String> searchByDijkstra(Vertex starting, String end ,Map<String, Vertex> verticesWithDistance) {\n\t\tSet<Vertex> visited = new HashSet<Vertex>();\n\t\tPriorityQueue<Vertex> pq = new PriorityQueue<Vertex>();\n\t\tpq.offer(starting);\n\t\twhile (!pq.isEmpty()) {\n\t\t\tVertex v = pq.poll();\n\t\t\tif (v.name.equals(end))\n\t\t\t\treturn v.route;\n\t\t\tif (!visited.contains(v))\n\t\t\t\tvisited.add(v);\n\t\t\telse\n\t\t\t\tcontinue;\n\t\t\tfor (String n : neighbors.get(v.name)) {\n\t\t\t\tint newDistance = v.distance + edges.get(v.name + \" \" + n);\n\t\t\t\tVertex nextVertex = verticesWithDistance.get(n);\n\t\t\t\tif (nextVertex.distance == -1 || newDistance < nextVertex.distance) {\n\t\t\t\t\tnextVertex.distance = newDistance;\n\t\t\t\t\tnextVertex.route = new LinkedList<String>(v.route);\n\t\t\t\t\tnextVertex.route.add(nextVertex.name);\n\t\t\t\t}\n\t\t\t\tpq.offer(nextVertex);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"void deleteBack()\n\t{\n\t\tif (length == 0) \n\t\t{\n\t\t\tthrow new RuntimeException(\"List Error: cannot call deleteBack() on empty List\");\n\t\t}\n\t\tif (cursor == back) \n\t\t{\n\t\t\tcursor = null;\n\t\t\tindex = -1;\n\t\t}\n \n\t\tback = back.prev; //the back element becomes the previous element in the list\n\t\tlength--;\n\n\t}",
"int getStartSearch();",
"private void bfs() {\n\t\tQueue<Node> q = new ArrayDeque<>();\n\t\tq.add(treeNodes.get(0));\n\t\twhile (!q.isEmpty()) {\n\t\t\tint size = q.size();\n\t\t\tfor (int i = 0; i < size; i++) {\n\t\t\t\tNode curr = q.poll();\n\t\t\t\ttime += curr.informTime;\n\t\t\t\tSet<Node> nextNodes = curr.nextNodes;\n\t\t\t\tif (nextNodes == null || curr.id == treeNodes.get(0).id)\n\t\t\t\t\tcontinue;\n\t\t\t\tfor (Node node : nextNodes) {\n\t\t\t\t\tq.add(node);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}",
"List<V> rangeSearch(K key, String comparator) {\r\n\r\n // linked list for return\r\n List<V> val = new LinkedList<>();\r\n LeafNode node_next = this;\r\n LeafNode node_prev = this.previous;\r\n\r\n // to check the current node's next nodes first\r\n while (node_next != null) {\r\n if (comparator.equals(\"<=\")) {\r\n if (node_next.getFirstLeafKey().compareTo(key) > 0) {\r\n node_next = node_next.next;\r\n continue;\r\n }else{\r\n compare((K) key, comparator, (List<V>) val, node_next);\r\n node_next = node_next.next;\r\n }\r\n } else if (comparator.equals(\">=\")){\r\n if (node_next.getFirstLeafKey().compareTo(key) < 0) {\r\n node_next = node_next.next;\r\n continue;\r\n }\r\n else{\r\n compare((K) key, comparator, (List<V>) val, node_next);\r\n node_next = node_next.next;\r\n }\r\n } else if ( comparator.equals(\"==\")){\r\n if (node_next.getFirstLeafKey().compareTo(key) > 0){\r\n node_next = node_next.next;\r\n continue;\r\n } else {\r\n compare((K) key, comparator, (List<V>) val, node_next);\r\n node_next = node_next.next;\r\n }\r\n }\r\n }\r\n\r\n // to check the previous nodes\r\n while (node_prev != null) {\r\n if (comparator.equals(\"<=\")) {\r\n if (node_prev.getFirstLeafKey().compareTo(key) > 0) {\r\n node_prev = node_prev.previous;\r\n continue;\r\n }else{\r\n compare((K) key, comparator, (List<V>) val, node_prev);\r\n node_prev = node_prev.previous;\r\n }\r\n } else if (comparator.equals(\">=\")){\r\n if (node_prev.getFirstLeafKey().compareTo(key) < 0) {\r\n node_prev = node_prev.previous;\r\n continue;\r\n }\r\n else{\r\n compare((K) key, comparator, (List<V>) val, node_prev);\r\n node_prev = node_prev.previous;\r\n }\r\n } else if ( comparator.equals(\"==\")){\r\n if (node_prev.getFirstLeafKey().compareTo(key) > 0){\r\n node_prev = node_prev.previous;\r\n continue;\r\n } else {\r\n compare((K) key, comparator, (List<V>) val, node_prev);\r\n node_prev = node_prev.previous;\r\n }\r\n }\r\n\r\n\r\n }\r\n\r\n return val;\r\n }",
"private int searchCurrentWord() {\n\n\n int tmpsize2;\n\n\n boolean sw2 = false;\n\n\n boolean retour = false;\n\n\n boolean sw = false;\n\n\n int sub_end = parent.getTextGrp_TField_affiche().length();\n\n\n int size = parent.data.size();\n\n\n int tmpsize = parent.position.size();\n\n\n int i = 0;\n\n\n String TfieldParse;\n\n\n int test = 0;\n\n\n String text = parent.getTextGrp_TField_affiche();\n\n\n System.out.println(\"size de parent.position :\" + tmpsize);\n\n\n String str;\n\n\n String tmpstring;\n\n\n Object[] obj;\n\n\n Object tmpobj;\n\n\n String transMaj1 = null;\n\n\n String transMaj2 = null;\n\n\n tmpobj = parent.position.get(tmpsize - 1);\n\n\n tmpstring = tmpobj.toString();\n\n\n i = Integer.parseInt(tmpstring);\n\n\n retour = verifBorne();\n\n\n if (retour == true) {\n\n\n do {\n\n\n str = getObjectInArray(i, 1, parent.data).toString();\n\n // obj = (Object[]) parent.data.get(i);\n\n //str = (String) obj[1];\n\n\n tmpsize2 = str.length();\n\n\n if (tmpsize2 < sub_end) {\n\n\n TfieldParse = str;\n\n\n i++;\n\n\n sw = false;\n\n\n } else\n\n\n {\n\n\n TfieldParse = str.substring(0, sub_end);\n\n\n }\n\n\n transMaj1 = TfieldParse.toUpperCase();\n\n\n transMaj2 = text.toUpperCase();\n\n\n test = transMaj2.compareTo(transMaj1);\n\n\n if (sw == true && test != 0) {\n\n\n i++;\n\n\n }\n\n\n sw = true;\n\n\n }\n\n\n while (i < size && test > 0);\n\n\n if (transMaj2.compareTo(transMaj1) == 0) {\n\n\n if (i != 0)\n\n\n parent.position.add(new Integer(i));\n\n\n parent.setRowSelectionIntervalGrp_Table_Affiche(i, i);\n\n\n parent.scrollRectToVisibleGrp_table_Affiche(new java.awt.Rectangle(0, parent.getGrp_Table_Affiche().getRowHeight() * i, 20, parent.getGrp_Table_Affiche().getRowHeight()));\n\n\n } else {\n\n\n parent.setTextGrp_TField_affiche(this.tmpText);\n\n\n }\n\n\n }\n\n\n return (i - 1);\n\n\n }",
"private int forwardPosition() {\n\t\treturn (position + 1) % (maxPosition + 1);\n\t}",
"private static SingleLinkedNode findFromEnd(SinglyLinkedList sll, int k) {\n\t\tSingleLinkedNode fast = sll.getHead();\r\n\t\tSingleLinkedNode slow = fast;\r\n\t\tint count = 1;\r\n\t\twhile (fast != null && count < k) {\r\n\t\t\tfast = fast.getNext();\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\tif (fast == null) {\r\n\t\t\treturn null; // not enough elements.\r\n\t\t}\r\n\t\tif (fast.getNext() == null) {\r\n\t\t\t// remove 1st element.\r\n\t\t\tsll.setHead(slow.getNext());\r\n\t\t\treturn slow;\r\n\t\t}\r\n\t\t// Now slow and fast are k elements apart.\r\n\t\t// look 2 ahead so we can remove the element\r\n\t\twhile (fast.getNext().getNext() != null) {\r\n\t\t\tfast = fast.getNext();\r\n\t\t\tslow = slow.getNext();\r\n\t\t}\r\n\t\tfast = slow.getNext(); // temp pointer\r\n\t\tslow.setNext(slow.getNext().getNext());\r\n\t\treturn fast;\r\n\t\t\r\n\t}",
"private static Node updateNextNodeAlgo1(Node nextNode, Node destination) {\n if (nextNode.getDistanceToZ() > destination.getDistanceToZ()) {\n return destination;\n }\n return nextNode;\n }",
"private boolean checkPrevious(String id1, String id2, double[] distances) {\n boolean retVal;\n // Create a string pair.\n var pair = new StringPair(id1, id2);\n double[] oldDistances = this.oldResultMap.get(pair);\n if (oldDistances == null)\n retVal = false;\n else {\n // Copy the cached results to the provided result array.\n System.arraycopy(oldDistances, 0, distances, 0, distances.length);\n retVal = true;\n }\n return retVal;\n }",
"public Vertex moveDown() {\n for (Edge e : current.outEdges) {\n move(e.to.y == current.y + 1, e);\n }\n return current;\n }",
"private void buildPath( PriorityQueue<SearchNode<T>> nodes ) {\n\t\tNode<T> v;\n\t\tSearchNode<T> su, sv;\n\t\tWeightedEdge<T> we;\n\n\t\twhile ( ! nodes.isEmpty() ) { // while Q is not empty:\n\t\t\tsu = nodes.poll(); // u = Q.min()\n\t\t\tif ( su.isUnreachable() ) { break; } //\n\n\t\t\tfor ( Edge<T> edge : su.getEdges() ) { // for each\n\t\t\t\twe = (WeightedEdge<T>)edge; //\n\t\t\t\tv = we.getOtherNode( su.getNode() ); // neighbor v of u\n\t\t\t\tsv = getSearchNode( v ); //\n\t\t\t\tint uToV = su.getDistance() + we.getWeight();// alt = dist[u] + length(u, v)\n\t\t\t\tif (uToV < sv.getDistance() ) { // if alt < dist[v]\n\t\t\t\t\tnodes.remove( sv ); // ( force recalc )\n\t\t\t\t\tsv.setDistance( uToV ); // dist[v] <- alt\n\t\t\t\t\tsv.setPrevious( su.getNode() ); // prev[v] <- u\n\t\t\t\t\tnodes.add( sv ); // Q.decrease_priority(v, alt) (dist recalc)\n\t\t\t\t} // end if\n\t\t\t} // end for\n\t\t} // end while\n\t}",
"private static List<TileDir> nextLayer(Collection<Tile> origins, boolean[][] targets, boolean[][] excludeTgts, boolean[][] blocks,\r\n int xt, int yt, boolean[][] searched, List<Tile> nextLayer, int count) {\r\n List<TileDir> results = new LinkedList<>();\r\n\r\n for (Tile origin : origins) {\r\n for (Direction d : Direction.getValuesRandom()) {\r\n Tile dt = d.getNeighbour(origin.x, origin.y, xt, yt);\r\n\r\n if (searched[dt.x][dt.y] || blocks[dt.x][dt.y] || excludeTgts[dt.x][dt.y]) {\r\n continue;\r\n }\r\n\r\n if (targets[dt.x][dt.y]) {\r\n results.add(TileDir.getTileDir(Tile.getTile(dt.x, dt.y), getOppoDir(d)));\r\n\r\n if (results .size() == count) {\r\n return results;\r\n }\r\n }\r\n\r\n searched[dt.x][dt.y] = true;\r\n\r\n nextLayer.add(Tile.getTile(dt.x, dt.y));\r\n }\r\n }\r\n\r\n return results;\r\n }",
"private Cell findPrev(ArrayList<Cell> list, Cell current) {\r\n\t\t\tint index = isInList(list, current);\r\n\t\t\treturn list.get(index).prev;\r\n\t\t}",
"private static void workDown(Record[] theArray, int initial, int end, int field){\r\n\r\n\t\tint root = initial;\r\n\r\n\t\twhile(((root * 2) + 1) <= end) //keep going condition\r\n\t\t{\r\n\t\t\tint child = (root * 2) + 1; //location\r\n\t\t\t//conditional check\r\n\r\n\t\t\tif((child + 1) <= end && (theArray[child].getData()[field].compareTo(theArray[child + 1].getData()[field]) < 0)) //smaller than\r\n\t\t\t\tchild = child + 1; // point right\r\n\r\n\t\t\tif(theArray[root].getData()[field].compareTo(theArray[child].getData()[field]) < 0){ //smaller than\r\n\t\t\t\tRecord ghostTwo = theArray[root];\r\n\t\t\t\ttheArray[root] = theArray[child];\r\n\t\t\t\ttheArray[child] = ghostTwo;\r\n\t\t\t\troot = child; //continue with child\r\n\t\t\t}else\r\n\r\n\t\t\t\treturn;\r\n\t\t}\r\n\t}",
"boolean scavengeSome()\r\n/* 472: */ {\r\n/* 473:505 */ Recycler.WeakOrderQueue cursor = this.cursor;\r\n/* 474: */ Recycler.WeakOrderQueue prev;\r\n/* 475:506 */ if (cursor == null)\r\n/* 476: */ {\r\n/* 477:507 */ Recycler.WeakOrderQueue prev = null;\r\n/* 478:508 */ cursor = this.head;\r\n/* 479:509 */ if (cursor == null) {\r\n/* 480:510 */ return false;\r\n/* 481: */ }\r\n/* 482: */ }\r\n/* 483: */ else\r\n/* 484: */ {\r\n/* 485:513 */ prev = this.prev;\r\n/* 486: */ }\r\n/* 487:516 */ boolean success = false;\r\n/* 488: */ do\r\n/* 489: */ {\r\n/* 490:518 */ if (cursor.transfer(this))\r\n/* 491: */ {\r\n/* 492:519 */ success = true;\r\n/* 493:520 */ break;\r\n/* 494: */ }\r\n/* 495:522 */ Recycler.WeakOrderQueue next = Recycler.WeakOrderQueue.access$1800(cursor);\r\n/* 496:523 */ if (Recycler.WeakOrderQueue.access$1900(cursor).get() == null)\r\n/* 497: */ {\r\n/* 498:527 */ if (cursor.hasFinalData()) {\r\n/* 499:529 */ while (cursor.transfer(this)) {\r\n/* 500:530 */ success = true;\r\n/* 501: */ }\r\n/* 502: */ }\r\n/* 503:537 */ if (prev != null) {\r\n/* 504:538 */ Recycler.WeakOrderQueue.access$1700(prev, next);\r\n/* 505: */ }\r\n/* 506: */ }\r\n/* 507: */ else\r\n/* 508: */ {\r\n/* 509:541 */ prev = cursor;\r\n/* 510: */ }\r\n/* 511:544 */ cursor = next;\r\n/* 512:546 */ } while ((cursor != null) && (!success));\r\n/* 513:548 */ this.prev = prev;\r\n/* 514:549 */ this.cursor = cursor;\r\n/* 515:550 */ return success;\r\n/* 516: */ }",
"private void firebaseUserSearch(String searchText) {\n AllClubsList.clear();\n Query firebaseSearchQuery = mUserDatabase2.orderByChild(\"item_name\").startAt(searchText).endAt(searchText + \"\\uf8ff\");\n firebaseSearchQuery.addListenerForSingleValueEvent(valueEventListener);\n }",
"static int dfsTopToBottom(int[] weight, int[] value, int W, int cur) {\r\n\t\t\tif(W < 0 || cur >= weight.length)\r\n\t\t\t\treturn 0;\r\n\t\t\tif(weight[cur] > W)\r\n\t\t\t\treturn dfsTopToBottom(weight, value, W, cur+1);\r\n\t\t\tint curVal = value[cur];\r\n\t\t\tint curWeight = weight[cur];\r\n\t\t\tint include = curVal + dfsTopToBottom(weight,value, W-curWeight, cur+1);\r\n//\t\t\tSystem.out.println(\"Include : \"+include);\r\n\t\t\tint noInclude = dfsTopToBottom(weight,value, W, cur+1);\r\n\t\t\tint res = Math.max(include, noInclude);\r\n\t\t\treturn res;\r\n\t\t}",
"private int getOutOfPlaceDistance(Map<Integer, LanguageEntry> query, Map<Integer, LanguageEntry> subject) {\r\n\t\tint distance = 0;\r\n\t\t\r\n\t\tSet<LanguageEntry> les = new TreeSet<>(query.values());\t\t\r\n\t\tfor (LanguageEntry q : les) {\r\n\t\t\tLanguageEntry s = subject.get(q.getKmer());\r\n\t\t\tif (s == null) {\r\n\t\t\t\tdistance += subject.size() + 1;\r\n\t\t\t}else {\r\n\t\t\t\tdistance += s.getRank() - q.getRank();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn distance;\r\n\t}",
"void findSearchOrder() {\n boolean filled = false;\n for(int node: queryGraphNodes.keySet()) {\n\n vertexClass vc = queryGraphNodes.get(node);\n searchOrderSeq.add(node);\n for(int edge: queryGraphNodes.get(node).edges.keySet()) {\n filled = calcOrdering(edge);\n if (filled)\n break;\n }\n if(searchOrderSeq.size() == queryGraphNodes.size())\n break;\n\n }\n\n }",
"private void shrinkChangeCombinationSearchSpace(int usedBanknoteIndex, int remainingAmount,\n\t\t\tList<Integer> tempSearchSpace) {\n\t\ttempSearchSpace.remove(usedBanknoteIndex);\n\t\t// eliminate denominations larger than remaining amount\n\t\tfor (Iterator<Integer> iterator = tempSearchSpace.iterator(); iterator.hasNext();) {\n\t\t\tif (iterator.next() > remainingAmount) {\n\t\t\t\titerator.remove();\n\t\t\t}\n\t\t}\n\t}",
"public static void compareAStarW(List<Position> places, double start, double end, double step) {\n if (end < start) {\n double tmp = end;\n end = start;\n start = tmp;\n }\n Node startNode = graph.findClosest(places.get(0), false);\n Node endNode = graph.findClosest(places.get((1)), false);\n System.out.println(\"==================================================\");\n System.out.println(\"Benchmark A-Star with weighted h\");\n System.out.println(\"From \" + start + \" to \" + end + \" steps \" + step);\n System.out.println(distance.calcDist(startNode, endNode));\n System.out.println(\"==================================================\");\n System.out.println();\n\n // Vergleichs A-Stern mit w = 1\n AStarResult compareResult;\n try {\n compareResult = AStarAlgorithm.search(graph, startNode, endNode, \"Compare\", 1);\n } catch (Exception e) {\n System.out.println(e.getMessage());\n return;\n }\n\n //\n double curr;\n for (curr = start; curr <= end; curr += step) {\n Path path = new Path(\"\");\n AStarResult result;\n try {\n result = AStarAlgorithm.search(graph, startNode, endNode, \"Compare \" + curr, curr);\n path.addSegment(result.getPath());\n FileWriter fstream = new FileWriter(curr + \".gpx\");\n BufferedWriter out = new BufferedWriter(fstream);\n String gpx = GPXBuilder.build(path.getGeoLineString(true), path.getName());\n out.write(gpx);\n out.close();\n fstream.close();\n System.out.println(\"Result for w=\" + curr);\n System.out.println(\"Expanded Nodes: \" + result.getExpandedNodesCount() + \" (\" + (result.getExpandedNodesCount() - compareResult.getExpandedNodesCount()) + \")\");\n System.out.println(\"Path Length: \" + result.getPath().getLength() + \" (\" + (result.getPath().getLength() - compareResult.getPath().getLength()) + \")\");\n System.out.println(\"SortTime: \" + result.getSorttime() + \" (\" + (result.getSorttime() - compareResult.getSorttime()) + \")\");\n System.out.println(\"Runtime: \" + result.getRuntime() + \" (\" + (result.getRuntime() - compareResult.getRuntime()) + \")\");\n System.out.println();\n } catch (Exception e) {\n System.out.println(e.getMessage());\n }\n }\n }",
"public void MyProblemsSearch()\n {\n //set new listener for boulder problems set by the current user\n mainQuery = new ChildEventListener() {\n @Override\n public void onChildAdded(@NonNull DataSnapshot snapshot, @Nullable String previousChildName) {\n //get the snapshot value as a boulder problem object\n BoulderProblem bp = snapshot.getValue(BoulderProblem.class);\n\n //check if the boulder problem was set by the current user\n if(bp.GetSetterId().equals(currentUser.getUid()))\n {\n //set the setter display name of the boulder problem using current user's display name\n bp.SetSetter(currentUser.getDisplayName());\n //add to list of boulder problems\n bps.add(bp);\n //call method to get the correct display list\n BPSearch();\n }\n }\n\n @Override\n public void onChildChanged(@NonNull DataSnapshot snapshot, @Nullable String previousChildName) {\n\n }\n\n @Override\n public void onChildRemoved(@NonNull DataSnapshot snapshot) {\n //listens for removed boulder problems from the database\n\n //get the snapshot value as a boulder problem object\n BoulderProblem bp = snapshot.getValue(BoulderProblem.class);\n //find and remove the bp from the list of boulder problems\n for(int i = 0; i < bps.size(); i++)\n {\n if(bps.get(i).GetName().equals(bp.GetName()))\n {\n bps.remove(i);\n //call method to get correct display list\n BPSearch();\n break;\n }\n }\n }\n\n @Override\n public void onChildMoved(@NonNull DataSnapshot snapshot, @Nullable String previousChildName) {\n\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError error) {\n\n }\n };\n bpRef.child(\"UserCreated\").orderByChild(sortOption).addChildEventListener(mainQuery);\n }"
] | [
"0.5971206",
"0.58346957",
"0.5826075",
"0.56883657",
"0.55769885",
"0.5432267",
"0.53958136",
"0.5346832",
"0.53356516",
"0.53351545",
"0.53239983",
"0.53166616",
"0.5270768",
"0.52606934",
"0.52548957",
"0.52052975",
"0.5204931",
"0.5188672",
"0.5182883",
"0.51779217",
"0.51699287",
"0.5157887",
"0.5108456",
"0.509451",
"0.50875515",
"0.5079995",
"0.5078487",
"0.5078401",
"0.50587165",
"0.5049769",
"0.5043556",
"0.50257736",
"0.5019924",
"0.50189245",
"0.4999776",
"0.4997481",
"0.49888274",
"0.49830145",
"0.49781471",
"0.4976011",
"0.49727225",
"0.49714714",
"0.4971082",
"0.49642968",
"0.49631065",
"0.4946449",
"0.4940342",
"0.49377233",
"0.49320546",
"0.49243686",
"0.49233603",
"0.49198213",
"0.49148288",
"0.49125576",
"0.48987478",
"0.48967558",
"0.48766035",
"0.4876004",
"0.4868224",
"0.48559695",
"0.48472023",
"0.4843195",
"0.48430717",
"0.48378816",
"0.4836197",
"0.483367",
"0.48286474",
"0.48231083",
"0.48226497",
"0.48226357",
"0.4820433",
"0.481879",
"0.48172188",
"0.48154965",
"0.48153508",
"0.481155",
"0.48037294",
"0.48035216",
"0.48031577",
"0.47975695",
"0.47941864",
"0.4792241",
"0.4786623",
"0.47769782",
"0.4769625",
"0.4765347",
"0.47602773",
"0.47601512",
"0.47574013",
"0.4740423",
"0.47379607",
"0.4735072",
"0.473298",
"0.4731506",
"0.47267905",
"0.47244135",
"0.4723613",
"0.4719839",
"0.4719413",
"0.47182032",
"0.4717511"
] | 0.0 | -1 |
Fix any parameter names that are reserved words in Java. Java source code can't have such parameter names, but Kotlin code might, for example. | private ImmutableSet<Property> propertySet(
Executable executable,
Map<String, String> propertyToGetterName,
ImmutableMap<String, String> builderInitializers,
Nullables nullables) {
Map<VariableElement, String> identifiers =
executable.parameters().stream()
.collect(toMap(v -> v, v -> v.getSimpleName().toString()));
fixReservedIdentifiers(identifiers);
return executable.parameters().stream()
.map(
v -> {
String name = v.getSimpleName().toString();
return newProperty(
v,
identifiers.get(v),
propertyToGetterName.get(name),
Optional.ofNullable(builderInitializers.get(name)),
executable.isOptional(name),
nullables);
})
.collect(toImmutableSet());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public String toParamName(String name) {\n name = name.replaceAll(\"-\", \"_\");\n\n // if it's all uppper case, do nothing\n if (name.matches(\"^[A-Z_]*$\")) {\n return name;\n }\n\n // camelize(lower) the variable name\n // pet_id => petId\n name = camelize(name, true);\n\n // for reserved word or word starting with number, append _\n if (reservedWords.contains(name) || name.matches(\"^\\\\d.*\")) {\n name = escapeReservedWord(name);\n }\n\n return name;\n }",
"public void setName(String newName) { throw new NotImplementedException(\"Variable names are final!\"); }",
"@DISPID(1611005960) //= 0x60060008. The runtime will prefer the VTID if present\n @VTID(36)\n void parameterNameSurroundedByTheSymbol(\n short oParameterNameSurroundedByTheSymbol);",
"@Test\n\tpublic void testGetFirstParameterNameFromCombinedRemoveParameterIssue() {\n\t\t// arrange\n\t\tList<String> locationMsgs = new ArrayList<>();\n\t\tlocationMsgs.add(\"Remove this unused method parameter filter\\\".\");\n\t\tlocationMsgs.add(\"Remove this unused method parameter orderBy\\\".\");\n\t\tlocationMsgs.add(\"Remove this unused method parameter orderDirection\\\".\");\n\t\tSonarIssue issue = createSonarIssue(\"Remove these unused method parameters.\", locationMsgs);\n\n\t\t// act\n\t\tSonarQubeObjectTranslator translator = new SonarQubeObjectTranslator();\n\t\tString paramName = translator.getNameOfFirstUnusedParameterInIssue(issue);\n\n\t\t// assert\n\t\tassertThat(paramName).isEqualTo(\"filter\");\n\t}",
"@NotNull\n private static String maybeName(@NotNull String parameterName) {\n return compiler.parametersOptionSupported() ? String.format(\" '%s'\", parameterName) : \"\";\n }",
"public CMakeReservedWord(final String name)\n {\n if (StringUtils.isBlank(name)) {\n throw new IllegalArgumentException(\"name cannot be blank.\"); //$NON-NLS-1$\n }\n \n this.name = name;\n \n }",
"public void updateParameterName(int paramIdx, String name) {\n\t\tparameters.set(paramIdx, parameters.get(paramIdx).updateName(name));\n\t}",
"public void setParamName(String paramName)\r\n/* 18: */ {\r\n/* 19:51 */ this.paramName = paramName;\r\n/* 20: */ }",
"public void setName(String sName)\r\n throws IllegalArgumentException {\r\n\r\n if (DebugFile.trace) {\r\n if (sName.indexOf(' ')>=0 || sName.indexOf(',')>=0 || sName.indexOf(';')>=0 ||\r\n sName.indexOf('|')>=0 || sName.indexOf('&')>=0 || sName.indexOf('?')>=0 ||\r\n sName.indexOf('*')>=0 || sName.indexOf('/')>=0 || sName.indexOf('\\\\')>=0 ||\r\n sName.indexOf('-')>=0 || sName.indexOf('(')>=0 || sName.indexOf(')')>=0 ||\r\n sName.indexOf('+')>=0 || sName.indexOf('[')>=0 || sName.indexOf(']')>=0 ||\r\n sName.indexOf('%')>=0 || sName.indexOf('{')>=0 || sName.indexOf('}')>=0 ||\r\n sName.indexOf('ñ')>=0 || sName.indexOf('Ñ')>=0 || sName.indexOf('^')>=0 ||\r\n sName.indexOf('ç')>=0 || sName.indexOf('Ç')>=0 || sName.indexOf('\"')>=0 ||\r\n sName.indexOf('á')>=0 || sName.indexOf('é')>=0 || sName.indexOf('í')>=0 ||\r\n sName.indexOf('ó')>=0 || sName.indexOf('ú')>=0 || sName.indexOf('à')>=0 ||\r\n sName.indexOf('è')>=0 || sName.indexOf('è')>=0 || sName.indexOf('ò')>=0 ||\r\n sName.indexOf('ù')>=0 || sName.indexOf('`')>=0 || sName.indexOf('´')>=0 ||\r\n sName.indexOf('.')>=0 || sName.indexOf(':')>=0 || sName.indexOf(',')>=0 ||\r\n sName.indexOf(39 )>=0 || sName.indexOf('¡')>=0 || sName.indexOf('¿')>=0) {\r\n }\r\n throw new IllegalArgumentException(\"Question name contains invalid characters\");\r\n } else {\r\n name = sName;\r\n }\r\n }",
"@Override\r\n public void setParameter(String parameters) {\r\n // dummy\r\n }",
"public void removeParameter(String name)\r\n {\r\n // warning, param names are escaped\r\n this.parameters.remove(StringEscapeUtils.escapeHtml(name));\r\n }",
"@Test\n\tpublic void testBasicNamingBad() {\n\t\t// \"Bad\" == \"Should throw an exception\"\n\t\tassertNamingException(\"int foo(int a) { return b; }\");\n\t\tassertNamingException(\"int foo(int a) { { int b = 42; } return b; }\");\n\t\tassertNamingException(\"int foo(int a) { { int b = b; int c = 42; } return a; }\");\n\t\tassertNamingException(\"int foo(int a) { int a = 42; return a; }\");\n\t}",
"private boolean skipMethodParameters() {\r\n \t\tint ch = readCharBackward(); \r\n \t\tif (ch != ')')\r\n \t\t\treturn false;\r\n \t\tint pCount = 1;\r\n \t\twhile (pCount > 0) {\r\n \t\t\tch = readCharBackward();\r\n \t\t\tif (ch == -1)\r\n \t\t\t\treturn false;\r\n \t\t\t\r\n \t\t\tif (ch == '\"' || ch == '\\'') {\r\n \t\t\t\tskipQuotedChars((char)ch);\r\n \t\t\t\tcontinue;\r\n \t\t\t}\r\n \t\t\tif (ch == ')') {\r\n \t\t\t\tpCount++;\r\n \t\t\t\tcontinue;\r\n \t\t\t}\r\n \t\t\tif (ch == '(') {\r\n \t\t\t\tpCount--;\r\n \t\t\t\tcontinue;\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn true;\r\n \t}",
"java.lang.String getParameterName();",
"public void method_2112(int param1, int param2, int param3, aji param4, int param5, int param6) {\r\n // $FF: Couldn't be decompiled\r\n }",
"protected void setParameterName( String strParameterName )\n {\n _strParameterName = strParameterName;\n }",
"protected static String sanitise(final String name) {\n // Replace illegal chars with\n return name.replaceAll(\"[^\\\\w\\\\.\\\\s\\\\-#&_]\", \"_\");\n }",
"public static Name parseJavaName(String text) {\n // Remove the underscore prefixes and suffixes, as they only make sense to avoid conflicts with Java reserved\n // words and they aren't needed in the model:\n while (text.startsWith(\"_\")) {\n text = text.substring(1);\n }\n while (text.endsWith(\"_\")) {\n text = text.substring(0, text.length() - 1);\n }\n\n // Once the name is clean it can be parsed:\n return NameParser.parseUsingCase(text);\n }",
"@Implementation\n protected String getParameters(String keys) {\n return null;\n }",
"private static class_1205 method_6442(String param0, int param1) {\r\n // $FF: Couldn't be decompiled\r\n }",
"public static String removeParameterKeys(String sql, Map<String, Object>\n parameters) {\n String s = sql;\n for (String key : parameters.keySet())\n s = s.replaceAll(key, \"?\");\n return s;\n }",
"public void method_2259(String param1, double param2, double param4, double param6, int param8, double param9, double param11, double param13, double param15) {\r\n // $FF: Couldn't be decompiled\r\n }",
"private static boolean isValidJavaIdentifier(String s)\r\n {\r\n if (s == null || s.length() == 0)\r\n {\r\n return false;\r\n }\r\n char[] c = s.toCharArray();\r\n if (!Character.isJavaIdentifierStart(c[0]))\r\n {\r\n return false;\r\n }\r\n for (int i = 1; i < c.length; i++)\r\n {\r\n if (!Character.isJavaIdentifierPart(c[i]))\r\n {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }",
"public void setParameters(String parameters);",
"public void method_213(String var1) {}",
"protected void missingParams() {\r\n throw new IllegalStateException(\r\n \"Function is missing parameters: \" + getName());\r\n }",
"public static boolean isExplicitUnusedVarName(String name) {\n return name.startsWith(\"ignored\")\n || name.startsWith(\"unused\")\n || \"_\".equals(name); // before java 9 it's ok\n }",
"public KeywordsParam(String param) throws BadParamException {\r\n\t\tsuper(param);\r\n\t}",
"void updateConstructorsNames(Identifier name) throws SourceException {\n }",
"String escapeReservedWords(String query);",
"public interface NameFactory\n{\n /**\n * Returns a unique (descriptive?) parameter name for the specified\n * type.\n *\n * @param sig - signature of the declaring method\n * @param n - the parameter number whose name we want.\n * @return a made up name for the n'th parameter\n */\n public String getParameterName(Signature sig, int n);\n}",
"public interface C5861g {\n /* renamed from: a */\n void mo18320a(C7251a aVar);\n\n @Deprecated\n /* renamed from: a */\n void mo18321a(C7251a aVar, String str);\n\n /* renamed from: a */\n void mo18322a(C7252b bVar);\n\n /* renamed from: a */\n void mo18323a(C7253c cVar);\n\n /* renamed from: a */\n void mo18324a(C7260j jVar);\n}",
"public void checkParameters() {\n }",
"public void setName(String name)\r\n/* */ {\r\n/* 137 */ this.name = name;\r\n/* */ }",
"private LocalParameters() {\n\n\t}",
"public interface ParameterNameDiscoverer {\n\n\t/**\n\t * Return parameter names for a method, or {@code null} if they cannot be determined.\n\t * <p>Individual entries in the array may be {@code null} if parameter names are only\n\t * available for some parameters of the given method but not for others. However,\n\t * it is recommended to use stub parameter names instead wherever feasible.\n\t * @param method the method to find parameter names for\n\t * @return an array of parameter names if the names can be resolved,\n\t * or {@code null} if they cannot\n\t */\n\t@Nullable\n\tString[] getParameterNames(Method method);\n\n\t/**\n\t * Return parameter names for a constructor, or {@code null} if they cannot be determined.\n\t * <p>Individual entries in the array may be {@code null} if parameter names are only\n\t * available for some parameters of the given constructor but not for others. However,\n\t * it is recommended to use stub parameter names instead wherever feasible.\n\t * @param ctor the constructor to find parameter names for\n\t * @return an array of parameter names if the names can be resolved,\n\t * or {@code null} if they cannot\n\t */\n\t@Nullable\n\tString[] getParameterNames(Constructor<?> ctor);\n\n}",
"public void removeParameter(String name) throws IllegalArgumentException {\n LogWriter.logMessage(LogWriter.TRACE_DEBUG, \"removeParameter() \");\n Via via=(Via)sipHeader;\n \n if( name==null )\n throw new IllegalArgumentException\n (\"JAIN-EXCEPTION: parameter is null\");\n else via.removeParameter(name); \n }",
"public static String toUnderscoreSeparated(final String javaName) {\n requireNonNull(javaName);\n final StringBuilder result = new StringBuilder();\n final String input = unQuote(javaName.trim());\n for (int i = 0; i < input.length(); i++) {\n final char c = input.charAt(i);\n if (result.length() == 0) {\n result.append(Character.toLowerCase(c));\n } else if (Character.isUpperCase(c)) {\n result.append(\"_\").append(Character.toLowerCase(c));\n } else {\n result.append(c);\n }\n }\n return result.toString();\n }",
"@Override\n\tpublic void setParams(String[] params) {\n\t}",
"@Override\n\tpublic void setParams(String[] params) {\n\t}",
"private static String renderJavaName(String name, String keywordSuffix, boolean firstCharLowerCase) {\n // First, strip off any custom suffix\n if (name.endsWith(\"__c\") || name.endsWith(\"__r\")) {\n name = name.substring(0, name.length() - CUSTOM_POSTFIX_LENGTH);\n }\n\n // Convert to camelCase\n name = WordUtils.capitalize(name, new char[]{'_'});\n \n //Remove all underscores ('_')\n name = name.replace(\"_\", \"\");\n \n // If the name we're going to generate is a Java keyword\n // then we'll tweak it with the suffix argument\n if (SourceVersion.isKeyword(name.toLowerCase())) {\n name = name + keywordSuffix;\n }\n \n // Enforce the desired case on the first character\n if (firstCharLowerCase) {\n name = WordUtils.uncapitalize(name);\n } else {\n name = WordUtils.capitalize(name);\n }\n \n return name;\n }",
"com.google.protobuf.ByteString getParameterNameBytes();",
"public static void putParameterNameIds(String tenantDatastoreCacheName, Map<String, Integer> newParameters) {\n \n if (enabled) {\n for (Map.Entry<String, Integer> entry : newParameters.entrySet()) {\n putParameterNameId(tenantDatastoreCacheName, entry.getKey(), entry.getValue());\n }\n }\n }",
"@Override\n public boolean insertparam(String name) {\n return false;\n }",
"public void testCreateMethodWithParameters() {\n IDOMMethod method = this.domFactory.createMethod();\n method.setName(\"foo\");\n method.setParameters(new String[] { \"String\", \"int\", \"char[]\" }, new String[] { \"name\", \"number\", \"buffer\" });\n assertSourceEquals(\"source code incorrect\", \"public void foo(String name, int number, char[] buffer) {\\n\" + \"}\\n\", method.getContents());\n }",
"public void setName(String name)\n/* */ {\n/* 84 */ this._name = name;\n/* */ }",
"@Override\n\tpublic void javaMethodBaseWithTwoParams(long longParam, double doubleParam) {\n\t\t\n\t}",
"public void setParamName(String paramName) {\r\n\tthis.paramName = paramName;\r\n }",
"public void setName(String name)\n/* */ {\n/* 53 */ this.name = name;\n/* */ }",
"@Override\n\tpublic void visit(JdbcNamedParameter arg0) {\n\t\t\n\t}",
"public static String toJavaParameters( String parameters ) {\n StringBuffer nat = new StringBuffer( 30 );\n switch ( parameters.charAt( 0 ) ) {\n default:\n throw new IllegalArgumentException( \"unknown native type:\" + parameters.charAt( 0 ) );\n case '+':\n nat.append( \"? extends \" ).append( toJavaParameters( parameters.substring( 1 ) ) );\n break;\n case '-':\n nat.append( \"? super \" ).append( toJavaParameters( parameters.substring( 1 ) ) );\n break;\n case '*':\n nat.append( \"*\" );\n if ( parameters.length() > 1 ) {\n nat.append( \", \" ).append( toJavaParameters( parameters.substring( 1 ) ) );\n }\n break;\n case 'B':\n nat.append( \"byte\" );\n break;\n case 'C':\n nat.append( \"char\" );\n break;\n case 'D':\n nat.append( \"double\" );\n break;\n case 'F':\n nat.append( \"float\" );\n break;\n case 'I':\n nat.append( \"int\" );\n break;\n case 'J':\n nat.append( \"long\" );\n break;\n case 'S':\n nat.append( \"short\" );\n break;\n case 'Z':\n nat.append( \"boolean\" );\n break;\n case 'V':\n nat.append( \"void\" );\n break;\n case 'L':\n int len = parameters.indexOf( '<' );\n if ( len >= 0 ) {\n len = Math.min( len, parameters.indexOf( ';' ) );\n }\n break;\n case 'T':\n int index = parameters.indexOf( ';' );\n nat.append( parameters.substring( 1, index ) );\n if ( parameters.length() > index ) {\n nat.append( \", \" );\n nat.append( parameters.substring( index ) );\n }\n break;\n }\n return nat.toString();\n }",
"private static String handleReservedNames(String filename) {\r\n String filenameWithoutExtension = stripExtensionIfAny(filename);\r\n\r\n if (Stream.of(RESERVED_NAMES).anyMatch(s -> s.equalsIgnoreCase(filenameWithoutExtension))){\r\n return SANITIZATION_TOKEN + filename;\r\n } \r\n return filename;\r\n }",
"@Override\n\tpublic String[] getParameterValues(String name) {\n\t\treturn null;\n\t}",
"public int method_7084(String param1) {\r\n // $FF: Couldn't be decompiled\r\n }",
"private String fixName(String name, String prefix)\n {\n if (name.startsWith(prefix))\n return name.substring(prefix.length());\n return FIXME_INVALID_PREFIX + name;\n }",
"public static String toLegacyKey(String keyword) {\n/* 1272 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"@DSComment(\"Package priviledge\")\n @DSBan(DSCat.DEFAULT_MODIFIER)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:56:28.372 -0500\", hash_original_method = \"E4C63287FA81E5CD749A3DF00B7871AE\", hash_generated_method = \"A395ADC766F313790DA998F5853068A3\")\n \n void nameChanged(String newName){\n \t//Formerly a native method\n \taddTaint(newName.getTaint());\n }",
"public void method_2111(int param1, int param2, int param3, aji param4, int param5, int param6) {\r\n // $FF: Couldn't be decompiled\r\n }",
"@Override\n\t\tpublic String[] getParameterValues(String name) {\n\t\t\treturn null;\n\t\t}",
"private String methodNameMask(String name) {\n\t\tString[] words = name\n\t\t\t\t.replaceAll(\"[\\\\d\\\\'\\\\+\\\\-\\\\:\\\\;\\\\(\\\\)\\\\[\\\\]\\\\{\\\\}\\\\~\\\\^\\\\*\\\\&\\\\#\\\\@\\\\$\\\\<\\\\>\\\\,\\\\_\\\\.\\\\\\\"]\", \"\")\n\t\t\t\t.split(\" \");\n\t\tString forReturn = words[0];\n\t\tfor (int i = 1; i < words.length; i++) {\n\t\t\tif (words[i].isEmpty())\n\t\t\t\tcontinue;\n\t\t\tif (Character.isDigit(words[i].charAt(0)))\n\t\t\t\tforReturn = forReturn + words[i];\n\t\t\telse\n\t\t\t\tforReturn = forReturn + words[i].replaceFirst(String.valueOf(words[i].charAt(0)),\n\t\t\t\t\t\tString.valueOf(words[i].charAt(0)).toUpperCase());\n\t\t}\n\t\treturn forReturn;\n\t}",
"public void validateNamedParameters() {\n if (namedParameters != null) {\n for (Map.Entry<String, Object> e : namedParameters.entrySet()) {\n if (e.getValue() == null) {\n throw log.queryParameterNotSet(e.getKey());\n }\n }\n }\n }",
"public static String[] fixRequestParameterValues(String[] values) {\n\n String[] fixedValues = values;\n if (values != null) {\n fixedValues = new String[values.length];\n for (int i = 0; i < values.length; i++) {\n fixedValues[i] = fixRequestParameterValue(values[i]);\n }\n }\n return fixedValues;\n }",
"public String[] getParamTypeNames()\n/* */ {\n/* 353 */ return this.parameterTypeNames;\n/* */ }",
"public void setParams(String[] names) {\n if (names == null)\n names = new String[0];\n setDescriptor(getProject().getNameCache().getDescriptor(getReturnName(),\n names));\n }",
"public void setName(final String pName){this.aName = pName;}",
"boolean skipMethodName() {\r\n \t\tint endOfToken = index;\r\n \t\tint ch;\r\n \t\twhile((ch = readCharBackward()) != -1) {\r\n \t\t\tif (!Character.isJavaIdentifierPart(ch)) {\r\n \t\t\t\treleaseChar();\r\n \t\t\t\treturn (endOfToken - index > 0);\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn false;\r\n \t}",
"static String eatParameterSignature (String s, int pos[]) {\r\n int first = pos[0];\r\n if (s.charAt(first)=='V') {\r\n pos[0]++;\r\n int n = eatNumber (s, pos);\r\n pos[0]++; // eat ';'\r\n return \"V\"+n+\";\";\r\n }\r\n int n = eatNumber (s, pos);\r\n if (n==0) return null;\r\n int last = first;\r\n for (int i=0; i<n; i++) {\r\n last = s.indexOf (';', last) + 1;\r\n }\r\n pos[0] = last;\r\n return s.substring (first, last);\r\n }",
"void formatName(String name) throws NameFormatException;",
"@Override\r\n public String getParamPostFix(){return \"Movie\";}",
"public void method_7080(String param1, class_1293 param2) {\r\n // $FF: Couldn't be decompiled\r\n }",
"private static String fixParams(String _placeInfo) {\r\n String toLowerCase = _placeInfo.toLowerCase();\r\n if (\"city\".equals(toLowerCase) || \"timezone\".equals(toLowerCase)) {\r\n return toLowerCase;\r\n } else {\r\n switch (toLowerCase) {\r\n case \"latitude\":\r\n return \"lat\";\r\n case \"longitude\":\r\n return \"lon\";\r\n case \"countryname\":\r\n return \"country\";\r\n case \"stateorprov\":\r\n return \"region\";\r\n case \"ip\":\r\n return \"query\";\r\n }\r\n return _placeInfo;\r\n }\r\n }",
"private JavaType(String name) {\n this.name = name;\n }",
"@Override\r\n\t\tpublic PreparedStatement prepareStatement(String sql,\r\n\t\t\t\tString[] columnNames) throws SQLException {\n\t\t\treturn null;\r\n\t\t}",
"void rezervasyonYap(String name, String surname, String islem);",
"public void setParamName(String paramName) {\n this.paramName = paramName;\n }",
"void method_114(int var1, int var2);",
"private void findDeadParameters(MethodContext mctx)\n\t{\n\t\tmctx.getInstructionContexts().forEach(this::findDeadParameters);\n\t}",
"@Override\n\tpublic Annotation[] getParameterAnnotations() {\n\t\treturn new Annotation[]{};\n\t}",
"@DISPID(1611005960) //= 0x60060008. The runtime will prefer the VTID if present\n @VTID(35)\n short parameterNameSurroundedByTheSymbol();",
"private MethodSignatureMatcher(@Nonnull String nameRegex, @Nullable @NonNullableElements String... parameters) {\n this.namePattern = Pattern.compile(nameRegex);\n if (parameters == null) {\n this.parameters = new String[0];\n } else {\n this.parameters = parameters;\n }\n }",
"public boolean hasParameterName() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }",
"public void setParameters(String parameters){\n this.parameters=parameters;\n }",
"@Override\n\tpublic String getParameter(String name) {\n\t\treturn null;\n\t}",
"public org.apache.spark.ml.param.Param<java.lang.String> handleInvalid () { throw new RuntimeException(); }",
"public HttpParams setParameter(String name, Object value) throws UnsupportedOperationException {\n/* 228 */ throw new UnsupportedOperationException(\"Setting parameters in a stack is not supported.\");\n/* */ }",
"protected void initDefaultParameters(String name) {\n\t\t// default parameter - name\n\t\tCaselessParameter cslpar =\n\t\t\tnew CaselessParameter(ISchemaComponent.KEY_NAME, false, new Caseless(name));\n\t\tcslpar.setParameterEvent(new NameChanger());\n\t\tparameters.addParameter(cslpar);\n\t\t\n\t\t// default parameter - component orientation\n\t\tGenericParameter<Orientation> orientpar =\n\t\t\tnew GenericParameter<Orientation>(ISchemaComponent.KEY_ORIENTATION, false,\n\t\t\t\t\tnew Orientation());\n\t\torientpar.getConstraint().setPossibleValues(Orientation.allAllowed);\n\t\tparameters.addParameter(orientpar);\n\t}",
"public void setParameterName(String parameterName) {\n this.parameterName = parameterName;\n }",
"private String checkForChars(String jsArg) {\n\t\tString jsNameToCallArgument = jsArg;\n\n\t\t// TODO replace the current logic for character-by-character comparison\n\t\t// with a more efficient approach\n\t\t/*-// fix to avoid char by char iteration for replacing \"\\'\" char.\n\t\tString jsNametoCallFirstChar = jsNameToCallArgument.substring(0, 1);\n\t\tString jsNametoCallSubStr = jsNameToCallArgument.substring(1, jsNameToCallArgument.length() - 1);\n\t\tString jsNametoCallLastChar = jsNameToCallArgument.substring(jsNameToCallArgument.length() - 1, 1);\n\t\tjsNametoCallSubStr = jsNametoCallSubStr.replaceAll(\"'\", \"\");\n\t\tjsNametoCallSubStr = jsNametoCallFirstChar + jsNametoCallSubStr + jsNametoCallLastChar;\n\t\treturn jsNametoCallSubStr;*/\n\n\t\t// For checking the occurrence of ' in the given string and\n\t\t// removing it\n\t\tfor (int i = 0; i < jsNameToCallArgument.length(); i++) {\n\t\t\tif (jsNameToCallArgument.charAt(i) == '\\'') {\n\t\t\t\tif (i != 0 && i != (jsNameToCallArgument.length() - 1)) {\n\t\t\t\t\tjsNameToCallArgument = jsNameToCallArgument.substring(0, i) + SmartConstants.ENCODE_SINGLE_QUOTE_UTF8 + jsNameToCallArgument.substring(i + 1, jsNameToCallArgument.length());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn jsNameToCallArgument;\n\t}",
"@Test\n public void execute_nameParameter() throws ParseException {\n //No user input\n execute_parameterPredicate_test(0, \" \", \"name\", true, false, Collections.emptyList());\n //Single keyword, ignore case, person found.\n execute_parameterPredicate_test(1, \"ElLe\", \"name\", true, false, Arrays.asList(ELLE));\n //Single keyword, case sensitive, person found.\n execute_parameterPredicate_test(0, \"ElLe\", \"name\", false, false, Collections.emptyList());\n //Multiple keywords, ignore case, or condition, multiple people found\n execute_parameterPredicate_test(3, \"Kurz Elle Kunz\", \"name\", true, false, Arrays.asList(CARL, ELLE, FIONA));\n //Multiple keywords, ignore case, and condition, no one found\n execute_parameterPredicate_test(0, \"kurz Elle kunz\", \"name\", true, true, Collections.emptyList());\n //Multiple keywords, case sensitive, or condition, multiple people found\n execute_parameterPredicate_test(2, \"kurz Elle Kunz\", \"name\", false, false, Arrays.asList(ELLE, FIONA));\n //Multiple keywords, case sensitive, and condition, no one found\n execute_parameterPredicate_test(0, \"Kurz Elle kunz\", \"name\", false, true, Collections.emptyList());\n }",
"@Override\n\t\tpublic String getParameter(String name) {\n\t\t\treturn null;\n\t\t}",
"void setParameter(String name, String[] values);",
"public ParameterNotFoundException( String s )\n\t{\n\t\tsuper( s );\n\t}",
"public void setNamedParams(java.lang.Object[] namedParams) {\n this.namedParams = namedParams;\n }",
"public String getParameterName( )\n {\n return _strParameterName;\n }",
"@Override\n\t\tpublic void load_param() {\n\t\t\tthrow new SnowflakeException(\"unsupported\");\n\n\t\t}",
"@Override\n\tpublic Enumeration<String> getParameterNames() {\n\t\treturn null;\n\t}",
"public void setParameters(String Parameters) {\n this.Parameters = Parameters;\n }",
"public boolean hasParameterName() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }",
"@Override\n public String kind() {\n return \"@param\";\n }",
"@Test\r\n public final void rawInputNamesShouldNotHaveSpaces() {\r\n \tString actual = proc.preprocessRawInputName(\" AndThis String\");\r\n \tassertEquals(\"AndThisString\", actual);\r\n }",
"static boolean isJavaIdentifier (String pValue)\n {\n int len = pValue.length ();\n if (len == 0) {\n return false;\n }\n else {\n if (!Character.isJavaIdentifierStart (pValue.charAt (0))) {\n\treturn false;\n }\n else {\n\tfor (int i = 1; i < len; i++) {\n\t if (!Character.isJavaIdentifierPart (pValue.charAt (i))) {\n\t return false;\n\t }\n\t}\n\treturn true;\n }\n }\n }"
] | [
"0.6043005",
"0.5707023",
"0.54600906",
"0.5351955",
"0.5348021",
"0.5225965",
"0.5193225",
"0.51918834",
"0.5183385",
"0.5147527",
"0.5145508",
"0.5125662",
"0.51221555",
"0.506826",
"0.5029942",
"0.50197995",
"0.50136435",
"0.4985103",
"0.49695626",
"0.49283502",
"0.49210408",
"0.49155754",
"0.49113938",
"0.49065703",
"0.49063927",
"0.4874048",
"0.4864953",
"0.4854213",
"0.48455563",
"0.4840095",
"0.48395097",
"0.48390576",
"0.48371547",
"0.4831152",
"0.48255783",
"0.4821555",
"0.4816114",
"0.47816694",
"0.47801778",
"0.47801778",
"0.47801235",
"0.47791758",
"0.47725853",
"0.4771293",
"0.47677508",
"0.4760428",
"0.47591972",
"0.47555384",
"0.47514108",
"0.4748108",
"0.47268626",
"0.47214654",
"0.47164628",
"0.47152662",
"0.47069818",
"0.47039396",
"0.46873957",
"0.467509",
"0.46679482",
"0.46658552",
"0.4658696",
"0.4647007",
"0.46391478",
"0.46375352",
"0.4628977",
"0.46258247",
"0.46248144",
"0.46213734",
"0.45922267",
"0.45878083",
"0.4584955",
"0.45837817",
"0.4576949",
"0.4573501",
"0.45734885",
"0.45692068",
"0.45685148",
"0.4566859",
"0.45663753",
"0.4564026",
"0.4559289",
"0.45592692",
"0.45552996",
"0.4551945",
"0.45497063",
"0.45467845",
"0.45458394",
"0.45437294",
"0.4538959",
"0.45319635",
"0.4531521",
"0.45195043",
"0.45188597",
"0.4517298",
"0.45111817",
"0.45069888",
"0.4502305",
"0.45004746",
"0.44948676",
"0.4492876",
"0.44860998"
] | 0.0 | -1 |
There's more than one visible executable (constructor or method). We try to find the one that | private Executable matchingExecutable(
TypeElement autoBuilderType,
List<Executable> executables,
ImmutableSet<ExecutableElement> methodsInAutoBuilderType,
String description) {
ImmutableList<Executable> matches =
executables.stream()
.filter(x -> executableMatches(x, methodsInAutoBuilderType))
.collect(toImmutableList());
switch (matches.size()) {
case 0:
throw errorReporter()
.abortWithError(
autoBuilderType,
"[AutoBuilderNoMatch] Property names do not correspond to the parameter names of"
+ " any %s:\n%s",
description,
executableListString(executables));
case 1:
return matches.get(0);
default:
// More than one match, let's see if we can find the best one.
}
int max = matches.stream().mapToInt(e -> e.parameters().size()).max().getAsInt();
ImmutableList<Executable> maxMatches =
matches.stream().filter(c -> c.parameters().size() == max).collect(toImmutableList());
if (maxMatches.size() > 1) {
throw errorReporter()
.abortWithError(
autoBuilderType,
"[AutoBuilderAmbiguous] Property names correspond to more than one %s:\n%s",
description,
executableListString(maxMatches));
}
return maxMatches.get(0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static <T extends ReflectMethod> T findMatchingExecutable(Executable[] executables,\n Object... values) throws NoSuchMethodException, IllegalStateException\n {\n if (values.length == 0)\n {\n for (Executable executable : executables)\n {\n if (executable.getParameterCount() == 0)\n {\n return wrap(executable, true);\n }\n }\n throw new NoSuchMethodException(\"Can't find no-args constructor.\");\n }\n Class<?>[] paramTypes = new Class<?>[values.length];\n for (int i = 0; i < values.length; i++)\n {\n Object value = values[i];\n paramTypes[i] = (value == null) ? null : value.getClass();\n }\n // try to find exact matching constructor, and add any just compatible to collection.\n int exactMatches = 0;\n Executable exact = null;\n Executable bestMatch = null;\n for (Executable executable : executables)\n {\n if (executable.getParameterCount() != values.length)\n {\n continue;\n }\n CompatibleExecutableResults compatibleConstructor = isCompatibleExecutable(executable, paramTypes);\n if (compatibleConstructor == CompatibleExecutableResults.EXACT)\n {\n if (exactMatches >= 1)\n {\n throw new IllegalStateException(\"Ambiguous constructors found \" + Arrays.toString(paramTypes));\n }\n exact = executable;\n exactMatches += 1;\n }\n if (compatibleConstructor != CompatibleExecutableResults.INVALID)\n {\n bestMatch = getMoreSpecialized(bestMatch, executable);\n }\n }\n if (bestMatch == null)\n {\n throw new NoSuchMethodException(\"Can't find matching constructor for: \" + Arrays.toString(paramTypes));\n }\n if (exact != null)\n {\n if (! bestMatch.equals(exact))\n {\n throw new IllegalStateException(\"Ambiguous constructors found \" + Arrays.toString(paramTypes));\n }\n return wrap(exact, true);\n }\n return wrap(bestMatch, true);\n }",
"private void findConstructor() {\n BeanScannerConstructor constructor = BeanScannerConstructor.CACHE.get(beanClass);\n\n Constructor<?> con = constructor.constructor();\n\n MethodHandle mh = unreflectConstructor(con);\n\n OperationTemplate ot;\n if (bean.lifetime.lifetimes().isEmpty()) {\n ot = OperationTemplate.defaults();\n } else {\n ot = bean.lifetime.lifetimes().get(0).template;\n }\n ot = ot.returnType(beanClass);\n\n OperationSetup os = new MemberOperationSetup(bean.installedBy, bean, constructor.operationType(), ot,\n new OperationConstructorTarget(constructor.constructor()), mh);\n bean.operations.add(os);\n resolveNow(os);\n }",
"protected abstract Executable getExecutable();",
"private void handleVirtualCallsAndSuperConstructors() {\n Set<String> affectedClasses = new HashSet<String>();\n for(MethodData m : usedAppMethodData) {\n Set<MethodData> callers = callGraph.get(m);\n if(callers.isEmpty() && !entryPoints.contains(m)) {\n // this is a virtual call that is never invoked at runtime\n // exclude it from used methods\n String subSignature = m.getSubSignature();\n String className = m.getClassName();\n usedAppMethods.get(className).remove(subSignature);\n affectedClasses.add(className);\n } else if (m.getName().equals(\"<init>\")) {\n // check if this constructor is only called in the constructors of its subclasses\n String className = m.getClassName();\n if(!childrenMap.containsKey(className)) {\n // this class has no subclasses, so no need to check\n continue;\n }\n\n Set<String> subClasses = childrenMap.get(className);\n boolean onlyCalledInSubClassConstructor = true;\n for(MethodData caller : callers) {\n String callerClass = caller.getClassName();\n if(!subClasses.contains(callerClass)) {\n // this constructor is not only called in its subclasses\n onlyCalledInSubClassConstructor = false;\n break;\n }\n }\n\n if(onlyCalledInSubClassConstructor) {\n String subSignature = m.getSubSignature();\n usedAppMethods.get(className).remove(subSignature);\n affectedClasses.add(className);\n }\n }\n }\n\n // after removing unused virtual calls and superclass constructor calls\n // we need to update the used classes to filter out those used classes that are included due to these calls\n for(String className : affectedClasses) {\n if(usedAppMethods.get(className).isEmpty()) {\n usedAppMethods.remove(className);\n usedAppClasses.remove(className);\n }\n }\n }",
"protected OpinionFinding() {/* intentionally empty block */}",
"@Override\n public Optional<ExecutableElement> factoryMethod() {\n return ElementFilter.methodsIn(element().getEnclosedElements()).stream()\n .filter(element -> element.getModifiers().contains(Modifier.STATIC))\n .filter(element -> element.getSimpleName().toString().equalsIgnoreCase(\"create\"))\n .filter(element -> element.getReturnType().equals(element().asType()))\n .findAny();\n }",
"private <T> Constructor<T> findConstructor(Class<T> clazz) {\n Constructor<?>[] declaredConstructors = ContainerInterface.getAllConstructors(clazz);\n /**\n * If we find one public constructor we return it\n */\n if (declaredConstructors.length == 1) {\n return (Constructor<T>) declaredConstructors[0];\n }\n\n /**\n * If we find more than one public constructor we search for the one annotated with @Inject\n */\n if (declaredConstructors.length > 1) {\n List<Constructor<?>> constructorsWithInject = Arrays.stream(declaredConstructors)\n .filter(c -> c.isAnnotationPresent(Inject.class))\n .collect(Collectors.toList());\n\n if (constructorsWithInject.isEmpty()) {\n throw new ContainerException(ERROR_MSG +\n \"Found more than one public constructor. Specify which one to choose by annotating it with @Inject\");\n }\n\n if (constructorsWithInject.size() != 1) {\n throw new ContainerException(ERROR_MSG +\n \"Found more than one public constructor annotated with @Inject.\");\n }\n\n return (Constructor<T>) constructorsWithInject.get(0);\n }\n return null;\n }",
"private ExecutableReader() {}",
"private FamixMethod findInvokedMethodOnName(String fromClass, String fromMethod, String invokedClassName, String invokedMethodName) {\n \tFamixMethod result = null;\n\t\t/* Test Helper\n\t\tif (fromClass.equals(\"domain.direct.violating.AccessLocalVariable_SetArgumentValue\")){\n\t\t\tboolean breakpoint = true;\n\t\t} */\n\n \t// 1) If methodNameAsInInvocation matches with a method unique name, return that method. \n \tString searchKey = invokedClassName + \".\" + invokedMethodName;\n \tif (theModel.behaviouralEntities.containsKey(searchKey)) {\n \t\treturn (FamixMethod) theModel.behaviouralEntities.get(searchKey);\n \t}\n \t// 2) Find out if there are more methods with the same name of the invoked class. If only one method is found, then return this method. \n \tString methodName = invokedMethodName.substring(0, invokedMethodName.indexOf(\"(\")); // Methodname without signature\n \t searchKey = invokedClassName + \".\" + methodName;\n \tif (sequencesPerMethod.containsKey(searchKey)){\n \t\tArrayList<FamixMethod> methodsList = sequencesPerMethod.get(searchKey);\n \t\tif (methodsList.size() == 0) {\n \t\t\treturn result;\n \t\t} else if (methodsList.size() == 1) {\n \t\t\t// FamixMethod result1 = methodsList.get(0);\n \t\t\treturn methodsList.get(0);\n \t\t} else { // 3) if there are more methods with the same name, then compare the invocation arguments with the method parameters.\n \t\t\tString invocationSignature = invokedMethodName.substring(invokedMethodName.indexOf(\"(\"));;\n \t\t\tString contentsInvocationSignature = invocationSignature.substring(invocationSignature.indexOf(\"(\") + 1, invocationSignature.indexOf(\")\")); \n \t\t\tString[] invocationArguments = contentsInvocationSignature.split(\",\");\n \t\t\tint numberOfArguments = invocationArguments.length;\n \t\t\t// 3a) If there is only one method with the same number of parameters as invocationArguments, then return this method\n \t\t\tList<FamixMethod> matchingMethods1 = new ArrayList<FamixMethod>();\n\t \t\tfor (FamixMethod method : methodsList){\n\t \t\t\tif ((method.signature != null) && (!method.signature.equals(\"\"))) {\n\t\t \t\t\tString contentsmethodParameter = method.signature.substring(method.signature.indexOf(\"(\") + 1, method.signature.indexOf(\")\")); \n\t\t \t\t\tString[] methodParameters = contentsmethodParameter.split(\",\");\n\t\t \t\t\tif (methodParameters.length == numberOfArguments) {\n\t\t \t\t\t\tmatchingMethods1.add(method);\n\t\t \t\t\t}\n\t \t\t\t}\n\t \t\t} \n\t \t\tif (matchingMethods1.size() == 0)\n\t \t\t\treturn result;\n\t \t\tif (matchingMethods1.size() == 1)\n\t \t\t\treturn matchingMethods1.get(0);\n \t\t\t\n \t\t\t// 3b) If there is only one method where the first parameter type == the first argument type, then return this method \n \t\t\tList<FamixMethod> matchingMethods2 = new ArrayList<FamixMethod>();\n \t\t\tif (numberOfArguments >= 1) {\n \t\t\t\t// Replace the argument string by a type, in case of an attribute\n \t\t\t\tinvocationArguments[0] = getTypeOfAttribute(fromClass, fromMethod, invocationArguments[0]);\n \t \t\tfor (FamixMethod matchingMethod1 : matchingMethods1){\n \t \t\t\tString contentsmethodParameter = matchingMethod1.signature.substring(matchingMethod1.signature.indexOf(\"(\") + 1, matchingMethod1.signature.indexOf(\")\")); \n \t \t\t\tString[] methodParameters = contentsmethodParameter.split(\",\");\n \t \t\t\tif (methodParameters.length >= 1) {\n \t \t\t\tmethodParameters[0] = getfullPathOfDeclaredType(fromClass, methodParameters[0]);\n \t \t\t\t\tif (methodParameters[0].equals(invocationArguments[0])) {\n \t \t\t\t\t\tmatchingMethods2.add(matchingMethod1);\n \t \t\t\t\t}\n \t \t\t\t}\n \t \t\t\t\n \t \t\t} \n \t \t\tif (matchingMethods2.size() == 0)\n \t \t\t\treturn result;\n \t \t\tif (matchingMethods2.size() == 1)\n \t \t\t\treturn matchingMethods2.get(0);\n \t\t\t}\n \t\t\t// If there is only one method where the second parameter type == the first argument type, then return this method \n \t\t\tif (numberOfArguments >= 2) {\n \t\t\t\tmatchingMethods1.clear();\n \t\t\t\t// Replace the argument string by a type, in case of an attribute\n \t\t\t\tinvocationArguments[1] = getTypeOfAttribute(fromClass, fromMethod, invocationArguments[1]);\n \t \t\tfor (FamixMethod matchingMethod2 : matchingMethods2){\n \t \t\t\tString contentsmethodParameter = matchingMethod2.signature.substring(matchingMethod2.signature.indexOf(\"(\") + 1, matchingMethod2.signature.indexOf(\")\")); \n \t \t\t\tString[] methodParameters = contentsmethodParameter.split(\",\");\n \t \t\t\tif (methodParameters.length >= 2) {\n \t \t\t\tmethodParameters[1] = getfullPathOfDeclaredType(fromClass, methodParameters[1]);\n \t \t\t\t\tif (methodParameters[1].equals(invocationArguments[1])) {\n \t \t\t\t\t\tmatchingMethods1.add(matchingMethod2);\n \t \t\t\t\t}\n \t \t\t\t}\n \t \t\t\t\n \t \t\t} \n \t \t\tif (matchingMethods1.size() == 0)\n \t \t\t\treturn result;\n \t \t\tif (matchingMethods1.size() == 1)\n \t \t\t\treturn matchingMethods1.get(0);\n \t\t\t}\n \t\t}\n\t\t}\n \treturn result; \n }",
"public Method getResolvedFactoryMethod()\n/* */ {\n/* 293 */ synchronized (this.constructorArgumentLock) {\n/* 294 */ Object candidate = this.resolvedConstructorOrFactoryMethod;\n/* 295 */ return (candidate instanceof Method) ? (Method)candidate : null;\n/* */ }\n/* */ }",
"public void testPublic() throws IOException {\n String[] publicHello = new String[] { \"method-execution(void HelloWorld.main(java.lang.String[]))\" };\n String[] publicFancyHello = new String[] { \"method-execution(void FancyHelloWorld.main(java.lang.String[]))\", \"method-execution(java.lang.String FancyHelloWorld.getName())\" };\n checkPointcut(\"execution(public * *(..))\", publicHello, publicFancyHello);\n }",
"private boolean executableMatches(\n Executable executable, ImmutableSet<ExecutableElement> methodsInAutoBuilderType) {\n NavigableSet<String> parameterNames = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);\n parameterNames.addAll(executable.parameterNames());\n for (ExecutableElement method : methodsInAutoBuilderType) {\n String name = method.getSimpleName().toString();\n if (name.endsWith(\"Builder\")) {\n String property = name.substring(0, name.length() - \"Builder\".length());\n parameterNames.remove(property);\n }\n if (method.getParameters().size() == 1) {\n parameterNames.remove(name);\n if (name.startsWith(\"set\")) {\n parameterNames.remove(name.substring(3));\n }\n }\n if (parameterNames.isEmpty()) {\n return true;\n }\n }\n return false;\n }",
"private java.lang.reflect.Method m16124a(java.lang.Class r3, java.lang.String r4, java.lang.Class[] r5) {\n /*\n r2 = this;\n r0 = 0\n if (r3 == 0) goto L_0x0028\n boolean r1 = r2.m16125a((java.lang.Object) r4)\n if (r1 == 0) goto L_0x000a\n goto L_0x0028\n L_0x000a:\n r3.getMethods() // Catch:{ Exception -> 0x0015 }\n r3.getDeclaredMethods() // Catch:{ Exception -> 0x0015 }\n java.lang.reflect.Method r3 = r3.getDeclaredMethod(r4, r5) // Catch:{ Exception -> 0x0015 }\n return r3\n L_0x0015:\n java.lang.reflect.Method r3 = r3.getMethod(r4, r5) // Catch:{ Exception -> 0x001a }\n return r3\n L_0x001a:\n java.lang.Class r1 = r3.getSuperclass()\n if (r1 == 0) goto L_0x0028\n java.lang.Class r3 = r3.getSuperclass()\n java.lang.reflect.Method r0 = r2.m16124a((java.lang.Class) r3, (java.lang.String) r4, (java.lang.Class[]) r5)\n L_0x0028:\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.onesignal.shortcutbadger.impl.OPPOHomeBader.m16124a(java.lang.Class, java.lang.String, java.lang.Class[]):java.lang.reflect.Method\");\n }",
"private boolean isConstructor() {\n \tif (line.contains(\"new \")) {\n \t\treturn false;\n \t}\n int bracket = line.indexOf(\"(\");\n if(bracket==-1) {\n return false;\n }\n String declaration = line.substring(0,bracket);\n String[] words = declaration.split(\"\\\\s+\");\n return words[words.length-1].equals(className);\n }",
"public static void main(String[] args) throws IOException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {\n\n Class objectClass = LazyMethodSingleton.class;\n\n Constructor constructor = objectClass.getDeclaredConstructor();\n constructor.setAccessible(true);\n\n LazyMethodSingleton instance = LazyMethodSingleton.getInstance();\n LazyMethodSingleton newInstance = (LazyMethodSingleton) constructor.newInstance();\n\n// HungrySingleton instance = HungrySingleton.getInstance();\n// HungrySingleton newInstance = (HungrySingleton) constructor.newInstance();\n\n// LazyStaticInnerClassSingleton instance = LazyStaticInnerClassSingleton.getInstance();\n// LazyStaticInnerClassSingleton newInstance = (LazyStaticInnerClassSingleton) constructor.newInstance();\n\n System.out.println(instance);\n System.out.println(newInstance);\n System.out.println(instance == newInstance);\n\n\n\n\n }",
"private static Constructor<?> findConstructor(Class<?> archiveImplClazz, Class<?>... argumentTypes) throws Exception \n {\n return archiveImplClazz.getConstructor(argumentTypes);\n }",
"public static void main(String[] args) {\n\n MethodCall m = new MethodCall();\n m.a();\n m.c();\n m.d();\n\n System.out.println(new MethodCall().hashCode());\n System.out.println(new MethodCall().hashCode());\n System.out.println(new MethodCall().hashCode());\n System.out.println(new MethodCall().hashCode());\n System.out.println(new MethodCall().hashCode());\n\n }",
"private void scan() {\n if (classRefs != null)\n return;\n // Store ids rather than names to avoid multiple name building.\n Set classIDs = new HashSet();\n Set methodIDs = new HashSet();\n\n codePaths = 1; // there has to be at least one...\n\n offset = 0;\n int max = codeBytes.length;\n\twhile (offset < max) {\n\t int bcode = at(0);\n\t if (bcode == bc_wide) {\n\t\tbcode = at(1);\n\t\tint arg = shortAt(2);\n\t\tswitch (bcode) {\n\t\t case bc_aload: case bc_astore:\n\t\t case bc_fload: case bc_fstore:\n\t\t case bc_iload: case bc_istore:\n\t\t case bc_lload: case bc_lstore:\n\t\t case bc_dload: case bc_dstore:\n\t\t case bc_ret:\n\t\t\toffset += 4;\n\t\t\tbreak;\n\n\t\t case bc_iinc:\n\t\t\toffset += 6;\n\t\t\tbreak;\n\t\t default:\n\t\t\toffset++;\n\t\t\tbreak;\n\t\t}\n\t } else {\n\t\tswitch (bcode) {\n // These bcodes have CONSTANT_Class arguments\n case bc_instanceof: \n case bc_checkcast: case bc_new:\n {\n\t\t\tint index = shortAt(1);\n classIDs.add(new Integer(index));\n\t\t\toffset += 3;\n\t\t\tbreak;\n\t\t }\n\n\t\t case bc_putstatic: case bc_getstatic:\n case bc_putfield: case bc_getfield: {\n\t\t\tint index = shortAt(1);\n CPFieldInfo fi = (CPFieldInfo)cpool.get(index);\n classIDs.add(new Integer(fi.getClassID()));\n\t\t\toffset += 3;\n\t\t\tbreak;\n }\n\n // These bcodes have CONSTANT_MethodRef_info arguments\n\t\t case bc_invokevirtual: case bc_invokespecial:\n case bc_invokestatic:\n methodIDs.add(new Integer(shortAt(1)));\n messageSends++;\n\t\t\toffset += 3;\n\t\t\tbreak;\n\n\t\t case bc_jsr_w:\n\t\t case bc_invokeinterface:\n methodIDs.add(new Integer(shortAt(1)));\n messageSends++;\n\t\t\toffset += 5;\n\t\t\tbreak;\n\n // Branch instructions\n\t\t case bc_ifeq: case bc_ifge: case bc_ifgt:\n\t\t case bc_ifle: case bc_iflt: case bc_ifne:\n\t\t case bc_if_icmpeq: case bc_if_icmpne: case bc_if_icmpge:\n\t\t case bc_if_icmpgt: case bc_if_icmple: case bc_if_icmplt:\n\t\t case bc_if_acmpeq: case bc_if_acmpne:\n\t\t case bc_ifnull: case bc_ifnonnull:\n\t\t case bc_jsr:\n codePaths++;\n\t\t\toffset += 3;\n\t\t\tbreak;\n\n case bc_lcmp: case bc_fcmpl: case bc_fcmpg:\n case bc_dcmpl: case bc_dcmpg:\n codePaths++;\n\t\t\toffset++;\n break;\n\n\t\t case bc_tableswitch:{\n\t\t\tint tbl = (offset+1+3) & (~3);\t// four byte boundry\n\t\t\tlong low = intAt(tbl, 1);\n\t\t\tlong high = intAt(tbl, 2);\n\t\t\ttbl += 3 << 2; \t\t\t// three int header\n\n // Find number of unique table addresses.\n // The default path is skipped so we find the\n // number of alternative paths here.\n Set set = new HashSet();\n int length = (int)(high - low + 1);\n for (int i = 0; i < length; i++) {\n int jumpAddr = (int)intAt (tbl, i) + offset;\n set.add(new Integer(jumpAddr));\n }\n codePaths += set.size();\n\n\t\t\toffset = tbl + (int)((high - low + 1) << 2);\n\t\t\tbreak;\n\t\t }\n\n\t\t case bc_lookupswitch:{\n\t\t\tint tbl = (offset+1+3) & (~3);\t// four byte boundry\n\t\t\tint npairs = (int)intAt(tbl, 1);\n\t\t\tint nints = npairs * 2;\n\t\t\ttbl += 2 << 2; \t\t\t// two int header\n\n // Find number of unique table addresses\n Set set = new HashSet();\n for (int i = 0; i < nints; i += 2) {\n // use the address half of each pair\n int jumpAddr = (int)intAt (tbl, i + 1) + offset;\n set.add(new Integer(jumpAddr));\n }\n codePaths += set.size();\n \n\t\t\toffset = tbl + (nints << 2);\n\t\t\tbreak;\n\t\t }\n\n // Ignore other bcodes.\n\t\t case bc_anewarray: \n offset += 3;\n break;\n\n\t\t case bc_multianewarray: {\n\t\t\toffset += 4;\n\t\t\tbreak;\n\t\t }\n\n\t\t case bc_aload: case bc_astore:\n\t\t case bc_fload: case bc_fstore:\n\t\t case bc_iload: case bc_istore:\n\t\t case bc_lload: case bc_lstore:\n\t\t case bc_dload: case bc_dstore:\n\t\t case bc_ret: case bc_newarray:\n\t\t case bc_bipush: case bc_ldc:\n\t\t\toffset += 2;\n\t\t\tbreak;\n\t\t \n\t\t case bc_iinc: case bc_sipush:\n\t\t case bc_ldc_w: case bc_ldc2_w:\n\t\t case bc_goto:\n\t\t\toffset += 3;\n\t\t\tbreak;\n\n\t\t case bc_goto_w:\n\t\t\toffset += 5;\n\t\t\tbreak;\n\n\t\t default:\n\t\t\toffset++;\n\t\t\tbreak;\n\t\t}\n\t }\n\t}\n classRefs = expandClassNames(classIDs);\n methodRefs = expandMethodNames(methodIDs);\n }",
"private ContractMethod findMatchedInstance(List arguments) {\n List<ContractMethod> matchedMethod = new ArrayList<>();\n\n if(this.getInputs().size() != arguments.size()) {\n for(ContractMethod method : this.getNextContractMethods()) {\n if(method.getInputs().size() == arguments.size()) {\n matchedMethod.add(method);\n }\n }\n } else {\n matchedMethod.add(this);\n }\n\n if(matchedMethod.size() == 0) {\n throw new IllegalArgumentException(\"Cannot find method with passed parameters.\");\n }\n\n if(matchedMethod.size() != 1) {\n LOGGER.warn(\"It found a two or more overloaded function that has same parameter counts. It may be abnormally executed. Please use *withSolidityWrapper().\");\n }\n\n return matchedMethod.get(0);\n }",
"public boolean callsConstructor(ClassOrInterfaceDeclaration classToVerify) {\n boolean instanceMethod = true;\n List<MethodDeclaration> methods = new ArrayList<>();\n classToVerify.findAll(MethodDeclaration.class).forEach(methodDeclaration -> {\n methods.add(methodDeclaration);\n });\n for (MethodDeclaration declaration : methods) {\n if (declaration.getTypeAsString().equals(classToVerify.getNameAsString())) {\n if (declaration.isStatic()) {\n if (declaration.isPrivate()) {\n classToVerify.findAll(ConstructorDeclaration.class).forEach(\n constructor -> constDeclList.add(constructor));\n instanceMethod &= !isMethodCalledFromPublic(methods, declaration)\n .getIsError(); //\n } else {\n instanceMethod &= true;\n }\n } else {\n instanceMethod = false;\n }\n }\n }\n return instanceMethod;\n }",
"public void firstClass(){\n }",
"private static void setupCallerCheck() {\n try {\n final ClassLoader loader = Loader.getClassLoader();\n // Use wildcard to avoid compile-time reference.\n final Class<?> clazz = loader.loadClass(\"sun.reflect.Reflection\");\n final Method[] methods = clazz.getMethods();\n for (final Method method : methods) {\n final int modifier = method.getModifiers();\n if (method.getName().equals(\"getCallerClass\") && Modifier.isStatic(modifier)) {\n getCallerClass = method;\n return;\n }\n }\n } catch (final ClassNotFoundException cnfe) {\n LOGGER.debug(\"sun.reflect.Reflection is not installed\");\n }\n\n try {\n final PrivateSecurityManager mgr = new PrivateSecurityManager();\n if (mgr.getClasses() != null) {\n securityManager = mgr;\n } else {\n // This shouldn't happen.\n LOGGER.error(\"Unable to obtain call stack from security manager\");\n }\n } catch (final Exception ex) {\n LOGGER.debug(\"Unable to install security manager\", ex);\n }\n }",
"@Override\n protected boolean checkConstructorInvocation(AnnotatedDeclaredType dt,\n AnnotatedExecutableType constructor, NewClassTree src) {\n return true;\n }",
"public void noSuchCommand() {\n }",
"private Main() {}",
"private void visitAdditionalEntrypoints() {\n\tLinkedHashSet<jq_Class> extraClasses = new LinkedHashSet<jq_Class>();\n\tfor(jq_Method m: publicMethods) {\n\t extraClasses.add(m.getDeclaringClass());\n\t}\n\t\n\tfor(jq_Class cl: extraClasses) {\n\t visitClass(cl);\n\t\t\tjq_Method ctor = cl.getInitializer(new jq_NameAndDesc(\"<init>\", \"()V\"));\n\t\t\tif (ctor != null)\n\t\t\t\tvisitMethod(ctor);\n\t}\n\n\tfor(jq_Method m: publicMethods) {\n\t visitMethod(m);\n\t}\n }",
"private void isCommandInstance() throws SystemException {\r\n\t\tif (commandInstance != null) return;\r\n\t\tif (commandResponder != null) SystemException.softwareProblem(\"This was not a command instance. There is a bug. Either the super for the command is not well formed or it called a method it shouldn't.\");\r\n\t\tinstantiateCommand();\r\n\t}",
"int get_ctor_index();",
"protected Constructor<?> findConstructorAlt(Class<?> classType, Object[] args)\n throws NoSuchMethodException {\n\n Object[] zeroArray = new Object[0];\n int i;\n boolean found = false;\n Constructor<?> toInvoke = null;\n Constructor<?>[] cons = null;\n\n // Grab set of constructors, signal error if no public constructors\n cons = classType.getConstructors();\n if (cons.length == 0)\n throw new NoSuchMethodException(\"Class \" + classType\n + \" has no public constructors!\");\n\n // First build a method structure vector for all the\n // constructors. This automatically sorts the constructors so\n // that the first match is the most specific constructor.\n MethodStructureVector items = new MethodStructureVector();\n for (i = 0; i < cons.length; i++)\n items.insertElement(new ConstructorStructure(cons[i], cons[i]\n .getParameterTypes()));\n\n // Now scan the constructor list for the most specific constructor\n ConstructorStructure next = null;\n Object[] sorted = new Object[items.size()];\n items.copyInto(sorted);\n\n if (args == null) {\n args = zeroArray;\n }\n for (i = 0; ((i < sorted.length) && (!found)); i++) {\n next = (ConstructorStructure) sorted[i];\n\n // Compare argument list lengths\n if (args.length != next.argTypes.length)\n continue;\n\n // Found a possible candidate, compare argument types\n found = true;\n toInvoke = next.meth;\n for (int j = 0; j < args.length; j++)\n if (!next.argTypes[j].isInstance(args[j])) {\n found = false;\n break;\n }\n }\n\n if (!found) {\n String argList = \"(\";\n\n if ((args == null) || (args.length == 0))\n argList = argList + \")\";\n else {\n for (i = 0; i < args.length - 1; i++)\n argList = argList + args[i].getClass() + \", \";\n argList = argList + args[i].getClass() + \")\";\n }\n\n throw new NoSuchMethodException(\"No constructor for \" + classType\n + \" with arg types \" + argList);\n }\n\n // Found the constructor, so return it\n return toInvoke;\n }",
"public int hashCode() {\n/* 254 */ if (this.hashCode == 0) {\n/* 255 */ int i = 17;\n/* 256 */ i = 37 * i + this.methodName.hashCode();\n/* 257 */ if (this.argClasses != null) {\n/* 258 */ for (byte b = 0; b < this.argClasses.length; b++)\n/* */ {\n/* 260 */ i = 37 * i + ((this.argClasses[b] == null) ? 0 : this.argClasses[b].hashCode());\n/* */ }\n/* */ }\n/* 263 */ this.hashCode = i;\n/* */ } \n/* 265 */ return this.hashCode;\n/* */ }",
"public static void main(String[] args) {\n\t\t\n\t\tObject a = new ClassObj();\n\t\t ((A) a).Calling();\n\t\t \n\n\t}",
"public void testMethodInfo889() throws Exception {\n\t\tClassInfo var2788 = instantiateClassInfo431();\n\t\tList<ClassInfo> var2764 = Collections.emptyList();\n\t\tList<ParameterInfo> var2766 = Collections.emptyList();\n\t\tList<LocalVariableInfo> var2767 = Collections.emptyList();\n\t\tList<Operation> var2768 = Collections.emptyList();\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tMethodInfo var2789 = new MethodInfo(var2788, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList());\n\t\tClassInfo var2765 = new ClassInfo(\"super\", false, null, var2764, null);\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tClassInfo var2771 = new ClassInfo(\"super\", false, var2765, var2764,\n\t\t\t\tnull);\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2788.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2788.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2788.getSetters();\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2788.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2788.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2788.getSetters();\n\t\tvar2789.isSetter();\n\t\tvar2789.isSetter();\n\t}",
"private CommandLine() {\n\t}",
"public static void main(String[] args) {\n for(int i=0; i<10; i++){\n Constructor c=new Constructor (i);\n c.Constructor(\"Who\");\n \n } \n }",
"private void translateConstructor( ) {\n \n Set<MethodInfoFlags> flags = EnumSet.noneOf( MethodInfoFlags.class );\n \n AVM2Method method = new AVM2Method( null, flags );\n avm2Class.avm2Class.constructor = method;\n \n AVM2MethodBody body = method.methodBody;\n body.maxStack = 1;\n body.maxRegisters = 1;\n body.maxScope = 11;\n body.scopeDepth = 10;\n \n InstructionList il = body.instructions;\n \n// il.append( OP_getlocal0 );\n// il.append( OP_pushscope );\n il.append( OP_getlocal0 );\n il.append( OP_constructsuper, 0 );\n \n// il.append( OP_findpropstrict, new AVM2QName( PUBLIC_NAMESPACE, \"drawTest\" ));\n il.append( OP_getlocal0 );\n \n il.append( OP_callpropvoid, new AVM2QName( EmptyPackage.namespace, \"drawTest\" ), 0 );\n\n il.append( OP_returnvoid );\n }",
"@Test\n @Order(3)\n void testInvalidClassId() {\n assertNull(noArgsRegistry.getConstructor(0));\n }",
"private Main() {\n }",
"public boolean findConstructorCall(\n MethodDeclaration declaration, ConstructorDeclaration constructor) {\n List<ObjectCreationExpr> calledMethods = new ArrayList<>();\n declaration.findAll(ObjectCreationExpr.class).forEach(methodDeclaration -> {\n if (methodDeclaration.getTypeAsString().equals(constructor.getNameAsString())) {\n calledMethods.add(methodDeclaration);\n }\n });\n return !calledMethods.isEmpty();\n }",
"public static void main(String[] args) {\n\t\tthisconstructor rv = new thisconstructor();\n\t\n\t\n\t}",
"public boolean isSingleton () throws java.io.IOException, com.linar.jintegra.AutomationException;",
"public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {\n\r\n Class<?> c = Class.forName(\"Reflect.Student\");\r\n// System.out.println(c);\r\n //返回一个 Constructor对象,该对象反映 Constructor对象表示的类的指定的公共构造器\r\n Constructor<?>[] constructors = c.getConstructors();\r\n //返回一个 Constructor对象,该对象反映 Constructor对象表示的类的所有构造器\r\n Constructor<?>[] declaredConstructors = c.getDeclaredConstructors();\r\n for (Constructor con : declaredConstructors)\r\n System.out.println(con);\r\n\r\n System.out.println(\"-----------------\");\r\n\r\n Constructor<?> dc = c.getDeclaredConstructor(String.class, int.class, String.class);\r\n //dc.setAccessible(true); //暴力反射\r\n System.out.println(dc.newInstance(\"tcp\", 22, \"shangluo\"));\r\n\r\n Constructor<?> constructor = c.getConstructor();\r\n\r\n Object obj = constructor.newInstance();\r\n System.out.println(obj);\r\n\r\n Method function = c.getDeclaredMethod(\"method2\", String.class);\r\n function.setAccessible(true);\r\n function.invoke(obj,\"tangcaiping\");\r\n }",
"public static void main(String args[]){ \n A a=new A();\n a.method();\n }",
"public interface EscapyExecutableObjects extends EscapyExecutable {\n\n\t/** The Constant EXE_OBJECT_MAP. */\n\tpublic static final HashMap<Short, EscapyExecutableObjects> EXE_OBJECT_MAP = new HashMap<>();\n\n\t/**\n\t * Action animation.\n\t */\n\tpublic void actionAnimation();\n\n\t/**\n\t * Action animation apply.\n\t *\n\t * @return true, if successful\n\t */\n\tpublic boolean actionAnimationFinish();\n\n\t/**\n\t * Action.\n\t *\n\t * @param type\n\t * the type\n\t * @param option\n\t * the option\n\t * @param ID\n\t * the id\n\t */\n\tpublic static void action(int type, String option, short ID) {\n\t\tswitch (type) {\n\t\tcase JUST_OBJECT:\n\t\t\t// TODO\n\t\t\tbreak;\n\n\t\tcase DOOR:\n\t\t\tif (option.equalsIgnoreCase(ENTER)) {\n\t\t\t\tEXE_OBJECT_MAP.get(ID).actionAnimation();\n\t\t\t\tEscapyExecutable.typeAction(DOOR, EXE_OBJECT_MAP.get(ID));\n\t\t\t}\n\n\t\t\tif (option.equalsIgnoreCase(INSPECT))\n\t\t\t\tEscapyExecutableDialogs.setDialogToPrint(\"Hero: \\\"Old fullmetal door\\\"\", 3.f);\n\t\t\tif (option.equalsIgnoreCase(KNOCK))\n\t\t\t\tEscapyExecutableDialogs.setDialogToPrint(\"Hero: *knocks on the door*\", 3.f);\n\t\t\tbreak;\n\n\t\tcase ELEVEATOR:\n\t\t\t// TODO\n\t\t\tbreak;\n\n\t\tcase STATIC_NPC:\n\t\t\t// TODO\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t/**\n\t * Inits the executable object.\n\t *\n\t * @param id\n\t * the id\n\t * @param exeobject\n\t * the exeobject\n\t */\n\tpublic static void initExecutableObject(short id, EscapyExecutableObjects exeobject) {\n\t\tEXE_OBJECT_MAP.put(id, exeobject);\n\t}\n\n}",
"private static String getCallingMethodInfo()\r\n\t{\r\n\t\tThrowable fakeException = new Throwable();\r\n\t\tStackTraceElement[] stackTrace = fakeException.getStackTrace();\r\n\r\n\t\tif (stackTrace != null && stackTrace.length >= 2)\r\n\t\t{\r\n\t\t\tStackTraceElement s = stackTrace[2];\r\n\t\t\tif (s != null)\r\n\t\t\t{\r\n\t\t\t\treturn s.getFileName() + \"(\" + s.getMethodName() + \":\" + s.getLineNumber() + \"):\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}",
"public String getExecutable();",
"private ThoseMain()\n {\n // Do nothing\n }",
"ExecutableFilter(boolean isExe) {\n\t\tthis.isExe = isExe;\n\t}",
"public Component getSelf(ExecutionCtrl exec);",
"abstract int firstMethod(int c);",
"private void logTestStart() {\n NullPointerException npe = new NullPointerException();\n StackTraceElement element = npe.getStackTrace()[1];\n\n System.out.println(\"Starting: \" + element.getMethodName());\n }",
"String mainClass();",
"void checkTypesOfInstanceMethodResolvingFunctions() {\r\n \r\n for (int i = 0, nClassInstances = currentModuleTypeInfo.getNClassInstances(); i < nClassInstances; ++i) { \r\n \r\n ClassInstance classInstance = currentModuleTypeInfo.getNthClassInstance(i);\r\n \r\n ParseTreeNode instanceNode = classInstanceMap.get(classInstance.getIdentifier());\r\n if (instanceNode == null) {\r\n // This can occur if we are compiling an adjunct to a module that contains instance declarations.\r\n continue;\r\n }\r\n instanceNode.verifyType(CALTreeParserTokenTypes.INSTANCE_DEFN);\r\n \r\n ParseTreeNode instanceMethodListNode = instanceNode.getChild(2);\r\n instanceMethodListNode.verifyType(CALTreeParserTokenTypes.INSTANCE_METHOD_LIST);\r\n \r\n TypeClass typeClass = classInstance.getTypeClass(); \r\n \r\n for (final ParseTreeNode instanceMethodNode : instanceMethodListNode) {\r\n \r\n instanceMethodNode.verifyType(CALTreeParserTokenTypes.INSTANCE_METHOD);\r\n \r\n ParseTreeNode optionalInstanceMethodCALDocNode = instanceMethodNode.firstChild();\r\n optionalInstanceMethodCALDocNode.verifyType(CALTreeParserTokenTypes.OPTIONAL_CALDOC_COMMENT);\r\n \r\n ParseTreeNode classMethodNameNode = optionalInstanceMethodCALDocNode.nextSibling();\r\n classMethodNameNode.verifyType(CALTreeParserTokenTypes.VAR_ID); \r\n String classMethodName = classMethodNameNode.getText(); \r\n \r\n ClassMethod classMethod = typeClass.getClassMethod(classMethodName); \r\n QualifiedName resolvingFunctionName = classMethodNameNode.nextSibling().toQualifiedName();\r\n \r\n TypeExpr instanceMethodType;\r\n {\r\n TypeExpr classMethodType = classMethod.getTypeExpr();\r\n TypeVar classTypeVar = classMethodType.getTypeClassTypeVar(typeClass.getTypeClassTypeVarName());\r\n classTypeVar.setInstance(classInstance.getType());\r\n instanceMethodType = classMethodType;\r\n }\r\n \r\n TypeExpr resolvingFunctionType = compiler.getTypeChecker().getEntity(resolvingFunctionName).getTypeExpr(); \r\n \r\n if (instanceMethodType.getGenericClassConstrainedPolymorphicVars(null).size() != 0 ||\r\n resolvingFunctionType.getGenericClassConstrainedPolymorphicVars(null).size() != 0) {\r\n //if either the instance method type or the resolving function type involve constrained type vars, then they\r\n //must have identically the same type. For example, for equals in the Eq-List instance, the types of the instance\r\n //method and the resolving instance must both be: Eq a => [a] -> [a] -> Boolean.\r\n if (!instanceMethodType.sameType(resolvingFunctionType)) {\r\n compiler.logMessage(new CompilerMessage(classMethodNameNode, new MessageKind.Error.ResolvingFunctionForInstanceMethodHasWrongTypeSpecific(resolvingFunctionName.getQualifiedName(), classMethodName, instanceMethodType.toString(), resolvingFunctionType.toString())));\r\n \r\n } \r\n } else {\r\n //we allow extra flexibility here, so that e.g. withing the Eq-Integer instance, we can define fromInteger as id (rather than idInteger).\r\n if (!TypeExpr.canPatternMatch(instanceMethodType, resolvingFunctionType, currentModuleTypeInfo)) {\r\n compiler.logMessage(new CompilerMessage(classMethodNameNode, new MessageKind.Error.ResolvingFunctionForInstanceMethodHasWrongTypeGeneral(resolvingFunctionName.getQualifiedName(), classMethodName, instanceMethodType.toString(), resolvingFunctionType.toString())));\r\n } \r\n } \r\n } \r\n } \r\n }",
"public boolean isFactoryMethod(Method candidate)\n/* */ {\n/* 285 */ return (candidate != null) && (candidate.getName().equals(getFactoryMethodName()));\n/* */ }",
"public MainEntryPoint() {\r\n\r\n }",
"public static void main(String[] args) {\nA a=new A();\r\na.m();\r\n\t}",
"String getExecutable();",
"public static void main(String[] args) throws Exception {\n\n Singleton3 ins = Singleton3.getInstance();\n Constructor constructor = Singleton3.class.getDeclaredConstructor();\n constructor.setAccessible(true);\n Singleton3 ins1 = (Singleton3)constructor.newInstance();\n System.out.println(ins == ins1);\n }",
"private void loadFromMethod() {\n // The first parameter is the command sender, so we skip it\n argumentTypes = Arrays.copyOfRange(method.getParameterTypes(), 1, method.getParameterCount());\n\n boolean commandAnnotationFound = false;\n for (Annotation annotation : method.getAnnotations()) {\n if (annotation instanceof Command) {\n commandAnnotationFound = true;\n } else if (annotation instanceof RequiresPlayer) {\n requiresPlayer = true;\n } else if (annotation instanceof RequiresPermissions) {\n requiredPermissions = ((RequiresPermissions) annotation).value();\n } else if (annotation instanceof Arguments) { // Otherwise, multiple arguments are wrapped in here\n arguments = ((Arguments) annotation).value();\n } else if(annotation instanceof Argument) { // If there is one argument then it isn't wrapped\n arguments = new Argument[]{(Argument) annotation};\n } else if (annotation instanceof Description) {\n description = ((Description) annotation).value();\n }\n }\n\n // Sanity checking\n if (!commandAnnotationFound) {\n throw new InvalidCommandException(\"Command methods require the command annotation\");\n }\n }",
"Reproducible newInstance();",
"String getMainClass();",
"private Command findCommand( String commandName )\n {\n Command command = null;\n CommandLine[] commands = commandList;\n\n for (int cmd = 0; cmd < commandList.length; ++cmd)\n {\n if (commandList[cmd].equals( commandName ))\n {\n command = commandList[cmd].command;\n break;\n }\n }\n\n return (command);\n }",
"@Test\n @Order(2)\n void testNoArgsClass() {\n final RuntimeConstructable r =\n noArgsRegistry.getConstructor(ConstructableExample.CLASS_ID).get();\n assertTrue(r instanceof ConstructableExample);\n\n // checks the objects class ID\n assertEquals(ConstructableExample.CLASS_ID, r.getClassId());\n }",
"public static void main(String[] args) throws IOException {\n\t\tChildClass1 ch = new ChildClass1();\n\t\tch.getMethod();\n\t\t\n\n\t}",
"private ClassInstance checkClassInstanceDefinition(ParseTreeNode instanceNode) {\r\n \r\n instanceNode.verifyType(CALTreeParserTokenTypes.INSTANCE_DEFN);\r\n \r\n ParseTreeNode optionalCALDocNode = instanceNode.firstChild();\r\n optionalCALDocNode.verifyType(CALTreeParserTokenTypes.OPTIONAL_CALDOC_COMMENT);\r\n \r\n ParseTreeNode instanceNameNode = optionalCALDocNode.nextSibling();\r\n //do most of the checking for the part of the instance declaration that occurs between the \"instance\" and \"where\" keywords. \r\n ClassInstance classInstance = resolveInstanceName (instanceNameNode);\r\n \r\n ParseTreeNode instanceMethodListNode = instanceNameNode.nextSibling();\r\n instanceMethodListNode.verifyType(CALTreeParserTokenTypes.INSTANCE_METHOD_LIST);\r\n \r\n TypeClass typeClass = classInstance.getTypeClass();\r\n \r\n Set<String> instanceMethodNamesSet = new HashSet<String>();\r\n \r\n for (final ParseTreeNode instanceMethodNode : instanceMethodListNode) {\r\n \r\n instanceMethodNode.verifyType(CALTreeParserTokenTypes.INSTANCE_METHOD);\r\n \r\n ParseTreeNode optionalInstanceMethodCALDocNode = instanceMethodNode.firstChild();\r\n optionalInstanceMethodCALDocNode.verifyType(CALTreeParserTokenTypes.OPTIONAL_CALDOC_COMMENT);\r\n \r\n ParseTreeNode instanceMethodNameNode = optionalInstanceMethodCALDocNode.nextSibling();\r\n instanceMethodNameNode.verifyType(CALTreeParserTokenTypes.VAR_ID); \r\n String instanceMethodName = instanceMethodNameNode.getText(); \r\n \r\n if (!instanceMethodNamesSet.add(instanceMethodName)) {\r\n //each instance method can be defined only once\r\n compiler.logMessage(new CompilerMessage(instanceMethodNameNode, new MessageKind.Error.MethodDefinedMoreThanOnce(instanceMethodName, classInstance.getNameWithContext())));\r\n continue; \r\n }\r\n \r\n ClassMethod classMethod = typeClass.getClassMethod(instanceMethodName);\r\n if (classMethod == null) {\r\n //instance method must first be declared by the type class that the instance is an instance of\r\n compiler.logMessage(new CompilerMessage(instanceMethodNameNode, new MessageKind.Error.MethodNotDeclaredByClass(instanceMethodName, typeClass.getName().getQualifiedName())));\r\n continue;\r\n }\r\n \r\n ParseTreeNode resolvingFunctionNameNode = instanceMethodNameNode.nextSibling();\r\n QualifiedName resolvingFunctionName = resolveResolvingFunction(resolvingFunctionNameNode);\r\n classInstance.addInstanceMethod(classMethod, resolvingFunctionName); \r\n }\r\n \r\n //check that the instance has an instance method defined for each class method in the type class that does not have\r\n //a default class method.\r\n if (typeClass.getNClassMethods() != instanceMethodNamesSet.size()) {\r\n \r\n //(String set) the class methods that are required to be implemented (because they have no defaults) but were not in this instance.\r\n Set<String> unimplementedMethodsNamesSet = new LinkedHashSet<String>();\r\n {\r\n for (int i = 0, nClassMethods = typeClass.getNClassMethods(); i < nClassMethods; ++i) {\r\n ClassMethod classMethod = typeClass.getNthClassMethod(i);\r\n if (!classMethod.hasDefaultClassMethod()) {\r\n unimplementedMethodsNamesSet.add(classMethod.getName().getUnqualifiedName());\r\n }\r\n }\r\n \r\n unimplementedMethodsNamesSet.removeAll(instanceMethodNamesSet);\r\n }\r\n \r\n for (final String methodName : unimplementedMethodsNamesSet) {\r\n \r\n // ClassInstanceChecker: the method {methodName} is not defined by the instance {classInstance.getNameWithContext()}.\r\n compiler.logMessage(new CompilerMessage(instanceNode, new MessageKind.Error.MethodNotDefinedByInstance(methodName, classInstance.getNameWithContext())));\r\n }\r\n }\r\n \r\n return classInstance;\r\n }",
"public Command findTrueCommand (String s)\n\t{\n\t\tCommand c = getCommandOrFunction(s);\n\t\thandleSpecialCases(c);\n\t\tfor(int a = 0; a < c.howManyArguments(); a++) {\n\t\t\ttry {\n\t\t\t\tc.addChild(parseCommand(codeReader.next()));\n\t\t\t}\n\t\t\tcatch(NoSuchElementException e) {\n\t\t\t\tthrow new SLogoException(\"Insufficient arguments for function/command \" + s);\n\t\t\t}\n\t\t}\n\t\treturn c;\n\t}",
"private String processConstructor() {\n int firstBracket = line.indexOf('(');\n //The substring of line after the bracket (inclusive)\n String parameters = line.substring(firstBracket);\n return \"A constructor \"+className+parameters+\" is created.\";\n }",
"private static boolean getInternalPublicMethods(Class<?> paramClass, Map<Signature, Method> paramMap) {\n/* 143 */ Method[] arrayOfMethod = null;\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ try {\n/* 150 */ if (!Modifier.isPublic(paramClass.getModifiers())) {\n/* 151 */ return false;\n/* */ }\n/* 153 */ if (!ReflectUtil.isPackageAccessible(paramClass)) {\n/* 154 */ return false;\n/* */ }\n/* */ \n/* 157 */ arrayOfMethod = paramClass.getMethods();\n/* 158 */ } catch (SecurityException securityException) {\n/* 159 */ return false;\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 168 */ boolean bool = true; byte b;\n/* 169 */ for (b = 0; b < arrayOfMethod.length; b++) {\n/* 170 */ Class<?> clazz = arrayOfMethod[b].getDeclaringClass();\n/* 171 */ if (!Modifier.isPublic(clazz.getModifiers())) {\n/* 172 */ bool = false;\n/* */ \n/* */ break;\n/* */ } \n/* */ } \n/* 177 */ if (bool) {\n/* */ \n/* */ \n/* */ \n/* */ \n/* 182 */ for (b = 0; b < arrayOfMethod.length; b++) {\n/* 183 */ addMethod(paramMap, arrayOfMethod[b]);\n/* */ \n/* */ }\n/* */ \n/* */ }\n/* */ else {\n/* */ \n/* 190 */ for (b = 0; b < arrayOfMethod.length; b++) {\n/* 191 */ Class<?> clazz = arrayOfMethod[b].getDeclaringClass();\n/* 192 */ if (paramClass.equals(clazz)) {\n/* 193 */ addMethod(paramMap, arrayOfMethod[b]);\n/* */ }\n/* */ } \n/* */ } \n/* 197 */ return bool;\n/* */ }",
"public static boolean isMainClass(ClassNode cn) {\n return cn.methods.stream()\n .filter(m -> m.name.equalsIgnoreCase(\"main\")).findFirst().map(m -> {\n //logger.info(\"found main candidate, access: \" + (m.access == ACC_PUBLIC + ACC_STATIC) + \" desc: \" + m.desc);\n return m.access == ACC_PUBLIC + ACC_STATIC && m.desc.equals(\"([Ljava/lang/String;)V\");\n }).orElse(false);\n }",
"public boolean isConstructor();",
"public Main() {\r\n\t}",
"public interface JavaExecutableLocator {\n public String javaExecutable();\n}",
"public void testMethodInfo886() throws Exception {\n\t\tClassInfo var2776 = instantiateClassInfo426();\n\t\tLocalField var2777 = instantiateLocalField425();\n\t\tList<ClassInfo> var2764 = Collections.emptyList();\n\t\tList<ParameterInfo> var2766 = Collections.emptyList();\n\t\tList<LocalVariableInfo> var2767 = Collections.emptyList();\n\t\tList<Operation> var2768 = Collections.emptyList();\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tMethodInfo var2778 = new MethodInfo(var2776, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList());\n\t\tvar2777.getDescription();\n\t\tvar2777.getDescription();\n\t\tClassInfo var2765 = new ClassInfo(\"super\", false, null, var2764, null);\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tClassInfo var2771 = new ClassInfo(\"super\", false, var2765, var2764,\n\t\t\t\tnull);\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2776.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2776.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2776.getSetters();\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2776.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2776.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2776.getSetters();\n\t\tvar2778.isSetter();\n\t\tvar2778.isSetter();\n\t}",
"private static Constructor findComparatorConstructor(Class cls) {\n try {\n return cls.getConstructor(new Class[] { Comparator.class });\n } catch (NoSuchMethodException nsme) {\n return null;\n } catch (Exception e) {\n throw new GeneralException(e);\n }\n }",
"public static void main(String... args) {\n Singletone singletone = Singletone.getInstance();\n try {\n // create obj for Singletone by Accessing private Constructor of\n Class clazz = Class.forName(\"com.krushidj.singletone.Singletone\");\n // get All consturctors of the class\n Constructor[] cons = clazz.getDeclaredConstructors();\n // provide access to private constructor\n cons[0].setAccessible(true);\n Field f = (Singletone.class).getDeclaredField(\"isInstantiated\");\n f.setAccessible(true);\n f.set(true, false);\n // creating obj using the Accessed constructor\n Singletone singletone1 = (Singletone) cons[0].newInstance(null);\n System.out.println(\"singletone hashCode:::\" + singletone.hashCode());\n System.out.println(\"singletone1 hashCode:::\" + singletone1.hashCode());\n } // try\n catch (Exception e) {\n e.printStackTrace();\n }\n\n }",
"private String interpredCommand(String[] data, String commandName) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {\n\n\t\tString ClassCommandName = String.valueOf(commandName.charAt(0)).toUpperCase() + commandName.substring(1);\n\t\tClass<?> commandClass = Class.forName(COMMAND_PATH + ClassCommandName + COMMAND_SUFIX_NAME);\n\n\t\tConstructor<?> declareContructor = commandClass.getDeclaredConstructor(String[].class, Repository.class,\n\t\t\t\tUnitFactory.class);\n\n\t\tExecutable command = (Executable) declareContructor.newInstance(data, this.repository, this.unitFactory);\n\t\treturn command.execute();\n\n\t}",
"public Main() {\r\n }",
"public Main() {\r\n }",
"@Override\n\tpublic void apply(final CtExecutable<?> targetExecutable, final CtConsumer<Object> outputConsumer) {\n\t\tfinal LambdaFilter lambdaFilter = new LambdaFilter();\n\t\tfinal CtQuery lambdaQuery = targetExecutable.getFactory().getModel().filterChildren(lambdaFilter);\n\t\t//the to be searched method\n\t\tCtMethod<?> targetMethod;\n\t\tif (targetExecutable instanceof CtLambda) {\n\t\t\t//the input is lambda\n\t\t\tif (includingSelf && includingLambdas) {\n\t\t\t\toutputConsumer.accept(targetExecutable);\n\t\t\t\tif (query.isTerminated()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//in case of lambda, the target method is the method implemented by lambda\n\t\t\ttargetMethod = ((CtLambda<?>) targetExecutable).getOverriddenMethod();\n\t\t\toutputConsumer.accept(targetMethod);\n\t\t\tif (query.isTerminated()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//the input is the lambda expression, which was already returned or doesn't have to be returned at all because includingSelf == false\n\t\t\t//add extra filter into lambdaQuery which skips that input lambda expression\n\t\t\tlambdaQuery.select(new Filter<CtLambda<?>>() {\n\t\t\t\t@Override\n\t\t\t\tpublic boolean matches(CtLambda<?> lambda) {\n\t\t\t\t\treturn targetExecutable != lambda;\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (targetExecutable instanceof CtMethod) {\n\t\t\tif (includingSelf) {\n\t\t\t\toutputConsumer.accept(targetExecutable);\n\t\t\t\tif (query.isTerminated()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttargetMethod = (CtMethod<?>) targetExecutable;\n\t\t} else {\n\t\t\t//CtConstructor or CtAnonymousExecutable never overrides other executable. We are done\n\t\t\tif (includingSelf) {\n\t\t\t\toutputConsumer.accept(targetExecutable);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tfinal List<CtMethod<?>> targetMethods = new ArrayList<>();\n\t\ttargetMethods.add(targetMethod);\n\t\tCtType<?> declaringType = targetMethod.getDeclaringType();\n\t\tlambdaFilter.addImplementingInterface(declaringType);\n\t\t//search for all declarations and implementations of this method in sub and super classes and interfaces of all related hierarchies.\n\t\tclass Context {\n\t\t\tboolean haveToSearchForSubtypes;\n\t\t}\n\t\tfinal Context context = new Context();\n\t\t//at the beginning we know that we have to always search for sub types too.\n\t\tcontext.haveToSearchForSubtypes = true;\n\t\t//Sub inheritance hierarchy function, which remembers visited sub types and does not returns/visits them again\n\t\tfinal SubInheritanceHierarchyResolver subHierarchyFnc = new SubInheritanceHierarchyResolver(declaringType.getFactory().getModel().getRootPackage());\n\t\t//add hierarchy of `targetMethod` as to be checked for sub types of declaring type\n\t\tsubHierarchyFnc.addSuperType(declaringType);\n\t\t//unique names of all types whose super inheritance hierarchy was searched for rootType\n\t\tSet<String> typesCheckedForRootType = new HashSet<>();\n\t\t//list of sub types whose inheritance hierarchy has to be checked\n\t\tfinal List<CtType<?>> toBeCheckedSubTypes = new ArrayList<>();\n\t\t//add hierarchy of `targetMethod` as to be checked for super types of declaring type\n\t\ttoBeCheckedSubTypes.add(declaringType);\n\t\twhile (!toBeCheckedSubTypes.isEmpty()) {\n\t\t\tfor (CtType<?> subType : toBeCheckedSubTypes) {\n\t\t\t\tClassTypingContext ctc = new ClassTypingContext(subType);\n\t\t\t\t//search for first target method from the same type inheritance hierarchy\n\t\t\t\ttargetMethod = getTargetMethodOfHierarchy(targetMethods, ctc);\n\t\t\t\t//search for all methods with same signature in inheritance hierarchy of `subType`\n\t\t\t\tforEachOverridenMethod(ctc, targetMethod, typesCheckedForRootType, new CtConsumer<CtMethod<?>>() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void accept(CtMethod<?> overriddenMethod) {\n\t\t\t\t\t\ttargetMethods.add(overriddenMethod);\n\t\t\t\t\t\toutputConsumer.accept(overriddenMethod);\n\t\t\t\t\t\tCtType<?> type = overriddenMethod.getDeclaringType();\n\t\t\t\t\t\tlambdaFilter.addImplementingInterface(type);\n\t\t\t\t\t\tsubHierarchyFnc.addSuperType(type);\n\t\t\t\t\t\t//mark that new super type was added, so we have to search for sub types again\n\t\t\t\t\t\tcontext.haveToSearchForSubtypes = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tif (query.isTerminated()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttoBeCheckedSubTypes.clear();\n\t\t\tif (context.haveToSearchForSubtypes) {\n\t\t\t\tcontext.haveToSearchForSubtypes = false;\n\t\t\t\t//there are some new super types, whose sub inheritance hierarchy has to be checked\n\t\t\t\t//search their inheritance hierarchy for sub types\n\t\t\t\tsubHierarchyFnc.forEachSubTypeInPackage(new CtConsumer<CtType<?>>() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void accept(CtType<?> type) {\n\t\t\t\t\t\ttoBeCheckedSubTypes.add(type);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (includingLambdas) {\n\t\t\t//search for all lambdas implementing any of the found interfaces\n\t\t\tlambdaQuery.forEach(outputConsumer);\n\t\t}\n\t}",
"public static void main(String[] args) {\nAbs a=new Abs();\r\na.k();\r\na.m();\r\na.n();\r\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tStaticMethodOverLoading.getName();\n\t\tStaticMethodOverLoading.getName(4);\n\t\t\n\t\tStaticMethodOverLoading.main(7); //static methods can be called by using class name\n\t\t\n\t\tStaticMethodOverLoading.main(7,6);\n\t}",
"public static void main(String[] args){\n\n String clazz = Thread.currentThread().getStackTrace()[1].getClassName();\n String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();\n int lineNumber = Thread.currentThread().getStackTrace()[1].getLineNumber();\n System.out.println(\"class:\"+ clazz+\",method:\"+methodName+\",lineNum:\"+lineNumber);\n\n System.out.println(LogBox.getInstance().getClassName());\n System.out.println(LogBox.getRuntimeClassName());\n System.out.println(LogBox.getRuntimeMethodName());\n System.out.println(LogBox.getRuntimeLineNumber());\n System.out.println();\n System.out.println(LogBox.getTraceInfo());\n }",
"public static void main(String[] args) {\r\n LazySingleton lazySingleton = LazySingleton.getInstance();\r\n LazySingleton lazySingletonReflected = null;\r\n\r\n try {\r\n Class<LazySingleton> clazz = LazySingleton.class;\r\n Constructor<LazySingleton> cons = clazz.getDeclaredConstructor();\r\n cons.setAccessible(true);\r\n lazySingletonReflected = cons.newInstance();\r\n }catch(Exception e){\r\n e.printStackTrace();\r\n }\r\n\r\n System.out.println(\"lazySingleton has code:\"\r\n + lazySingleton.hashCode());\r\n System.out.println(\"lazySingletonReflected hash code:\"\r\n + lazySingletonReflected.hashCode());\r\n }",
"private InterpreterDependencyChecks() {\r\n\t\t// Hides default constructor\r\n\t}",
"public abstract String initExecute() throws Exception;",
"private <T> Constructor<? extends T> findConstructorForInjection(Class<? extends T> impl) {\n return (Constructor<? extends T>) Arrays.stream(impl.getConstructors())\n .filter(con -> con.getAnnotation(Inject.class) != null)\n .findFirst()\n .orElseThrow(ConstructorNotFoundException::new);\n }",
"public static void main(String[] args) {\n C c = new C();\n c.a();\n c.b();\n c.c();\n c.d();\n c.e();\n\t}",
"private List<ParameterMetaData> findParameterMetaData()\n/* */ {\n/* 402 */ List<ParameterMetaData.Builder> parameterBuilders = null;\n/* */ \n/* 404 */ for (Iterator localIterator1 = this.constrainedExecutables.iterator(); localIterator1.hasNext();) { oneExecutable = (ConstrainedExecutable)localIterator1.next();\n/* 405 */ Iterator localIterator2; if (parameterBuilders == null) {\n/* 406 */ parameterBuilders = CollectionHelper.newArrayList();\n/* */ \n/* 408 */ for (localIterator2 = oneExecutable.getAllParameterMetaData().iterator(); localIterator2.hasNext();) { oneParameter = (ConstrainedParameter)localIterator2.next();\n/* 409 */ parameterBuilders.add(new ParameterMetaData.Builder(this.executable\n/* */ \n/* 411 */ .getMember().getDeclaringClass(), oneParameter, this.constraintHelper));\n/* */ }\n/* */ \n/* */ \n/* */ }\n/* */ else\n/* */ {\n/* */ \n/* 419 */ i = 0;\n/* 420 */ for (ConstrainedParameter oneParameter : oneExecutable.getAllParameterMetaData()) {\n/* 421 */ ((ParameterMetaData.Builder)parameterBuilders.get(i)).add(oneParameter);\n/* 422 */ i++;\n/* */ } } }\n/* */ ConstrainedExecutable oneExecutable;\n/* */ ConstrainedParameter oneParameter;\n/* */ int i;\n/* 427 */ Object parameterMetaDatas = CollectionHelper.newArrayList();\n/* */ \n/* 429 */ for (ParameterMetaData.Builder oneBuilder : parameterBuilders) {\n/* 430 */ ((List)parameterMetaDatas).add(oneBuilder.build());\n/* */ }\n/* */ \n/* 433 */ return (List<ParameterMetaData>)parameterMetaDatas;\n/* */ }",
"public void testMethodInfo887() throws Exception {\n\t\tClassInfo var2782 = instantiateClassInfo428();\n\t\tLocalField var2783 = instantiateLocalField427();\n\t\tList<ClassInfo> var2764 = Collections.emptyList();\n\t\tList<ParameterInfo> var2766 = Collections.emptyList();\n\t\tList<LocalVariableInfo> var2767 = Collections.emptyList();\n\t\tList<Operation> var2768 = Collections.emptyList();\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tMethodInfo var2784 = new MethodInfo(var2782, \"voidX()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList());\n\t\tvar2783.getDescription();\n\t\tvar2783.getDescription();\n\t\tClassInfo var2765 = new ClassInfo(\"super\", false, null, var2764, null);\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tClassInfo var2771 = new ClassInfo(\"super\", false, var2765, var2764,\n\t\t\t\tnull);\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2782.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2782.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2782.getSetters();\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2782.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2782.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tvar2782.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tvar2784.isSetter();\n\t\tvar2784.isSetter();\n\t}",
"@Test\n public void testIsNotConstructorInvocation() {\n MethodInvokation init = new MethodInvokation(null,\"<init>\",null,null,null,null);\n assertFalse(\"Standard constructor\", init.isNotConstructorInvocation() );\n\n MethodInvokation clinit = new MethodInvokation(null,\"<clinit>\",null,null,null,null);\n assertFalse(\"Static constructor\", clinit.isNotConstructorInvocation() );\n\n MethodInvokation ordinaryMethod = new MethodInvokation(null,\"ordinary\",null,null,null,null);\n assertTrue(\"Ordinary method\", ordinaryMethod.isNotConstructorInvocation() );\n\n }",
"private static HashMap getPrimaryMethod(HashMap<String, HashMap> primaryParamsMap, Object[] params) throws NoSuchMethodException {\n return getParamsIdCombinations(params, false).stream()\n .filter(primaryParamsMap::containsKey)\n .findFirst().map(primaryParamsMap::get)\n .orElseThrow(() -> new NoSuchMethodException(\"Unable to find a primary method during multiple dispatch\"));\n }",
"public static void main(String[] args) \r\n\t{\n one obj = new one();\r\n\t}",
"public static void main(String[] args) {\n\t\ttry\r\n\t\t{\r\n\t\t\tClass clsName=Class.forName(\"com.sist4.A\");\r\n\t\t\tObject obj=clsName.newInstance();\r\n\t\t\t// A a=new A();\r\n\t\t\tMethod[] m=clsName.getDeclaredMethods();\r\n\t\t\tm[0].invoke(obj, null);\r\n\t\t}catch(Exception ex){}\r\n\t}",
"public Main() {\n }",
"public Main() {\n }",
"String getCaller();",
"public Main() {}",
"private void scanAndCopyMethods() {\n int numMethods = copyShort();\n for (int i = 0; i < numMethods; i++) {\n scanAndCopyAccessFlags();\n copy(4); // name_index, descriptor_index\n int numAttributes = copyShort();\n for (int j = 0; j < numAttributes; j++) {\n // Look for \"Code\" attribute.\n int attrNameIdx = copyShort();\n if (cpIdxIsCode(attrNameIdx)) {\n processCodeAttribute();\n } else {\n copyRestOfAttribute();\n }\n }\n }\n }",
"void legalCommand();",
"protected abstract String getExecutableKey();",
"public void testJavaClassRepository873() throws Exception {\n\t\tJavaClassRepository var2730 = new JavaClassRepository();\n\t\tvar2730.getClass(CyclomaticMethods.class.getCanonicalName());\n\t\tvar2730.getClass(LineNumbersForConditionals.class.getCanonicalName());\n\t\tvar2730.getClass(LoDMultipleSameInvocations.class.getCanonicalName());\n\t}"
] | [
"0.57910293",
"0.5608437",
"0.5538196",
"0.536182",
"0.53419816",
"0.5272181",
"0.52504903",
"0.51729614",
"0.51546884",
"0.51505613",
"0.51330626",
"0.51278615",
"0.51203",
"0.51049644",
"0.50683147",
"0.5065356",
"0.5049612",
"0.50384843",
"0.5003416",
"0.49988687",
"0.49970517",
"0.4989106",
"0.49808916",
"0.49794108",
"0.49661297",
"0.49648547",
"0.494112",
"0.49318177",
"0.49235132",
"0.4915685",
"0.49052063",
"0.49002704",
"0.48926172",
"0.48911324",
"0.488961",
"0.48894566",
"0.48643145",
"0.485102",
"0.484689",
"0.484242",
"0.48413783",
"0.480941",
"0.4808663",
"0.48064283",
"0.4801567",
"0.47956473",
"0.47956243",
"0.47922346",
"0.47840044",
"0.4776563",
"0.4771815",
"0.47712162",
"0.47562546",
"0.4752846",
"0.4749766",
"0.47471097",
"0.47394148",
"0.47352636",
"0.47294587",
"0.47272137",
"0.4719819",
"0.4717546",
"0.47074315",
"0.47051707",
"0.47024813",
"0.47023785",
"0.470225",
"0.46900746",
"0.46860844",
"0.46780694",
"0.4674044",
"0.4669328",
"0.4669271",
"0.4668241",
"0.46676627",
"0.46669257",
"0.46669257",
"0.4666539",
"0.46640858",
"0.46633014",
"0.46578348",
"0.46559912",
"0.46461087",
"0.4645233",
"0.46410945",
"0.46360493",
"0.46340236",
"0.46338755",
"0.462811",
"0.46240672",
"0.46148565",
"0.46074414",
"0.46062988",
"0.46062988",
"0.4606032",
"0.4605326",
"0.46051684",
"0.46048155",
"0.46037477",
"0.45997915"
] | 0.51688385 | 8 |
Start with the complete set of parameter names and remove them one by one as we find corresponding methods. We ignore case, under the assumption that it is unlikely that a case difference is going to allow a candidate to match when another one is better. A parameter named foo could be matched by methods like this: X foo(Y) X setFoo(Y) X fooBuilder() X fooBuilder(Y) There are further constraints, including on the types X and Y, that will later be imposed by BuilderMethodClassifier, but here we just require that there be at least one method with one of these shapes for foo. | private boolean executableMatches(
Executable executable, ImmutableSet<ExecutableElement> methodsInAutoBuilderType) {
NavigableSet<String> parameterNames = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
parameterNames.addAll(executable.parameterNames());
for (ExecutableElement method : methodsInAutoBuilderType) {
String name = method.getSimpleName().toString();
if (name.endsWith("Builder")) {
String property = name.substring(0, name.length() - "Builder".length());
parameterNames.remove(property);
}
if (method.getParameters().size() == 1) {
parameterNames.remove(name);
if (name.startsWith("set")) {
parameterNames.remove(name.substring(3));
}
}
if (parameterNames.isEmpty()) {
return true;
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n\tpublic void testGetFirstParameterNameFromCombinedRemoveParameterIssue() {\n\t\t// arrange\n\t\tList<String> locationMsgs = new ArrayList<>();\n\t\tlocationMsgs.add(\"Remove this unused method parameter filter\\\".\");\n\t\tlocationMsgs.add(\"Remove this unused method parameter orderBy\\\".\");\n\t\tlocationMsgs.add(\"Remove this unused method parameter orderDirection\\\".\");\n\t\tSonarIssue issue = createSonarIssue(\"Remove these unused method parameters.\", locationMsgs);\n\n\t\t// act\n\t\tSonarQubeObjectTranslator translator = new SonarQubeObjectTranslator();\n\t\tString paramName = translator.getNameOfFirstUnusedParameterInIssue(issue);\n\n\t\t// assert\n\t\tassertThat(paramName).isEqualTo(\"filter\");\n\t}",
"public interface ParameterNameDiscoverer {\n\n\t/**\n\t * Return parameter names for a method, or {@code null} if they cannot be determined.\n\t * <p>Individual entries in the array may be {@code null} if parameter names are only\n\t * available for some parameters of the given method but not for others. However,\n\t * it is recommended to use stub parameter names instead wherever feasible.\n\t * @param method the method to find parameter names for\n\t * @return an array of parameter names if the names can be resolved,\n\t * or {@code null} if they cannot\n\t */\n\t@Nullable\n\tString[] getParameterNames(Method method);\n\n\t/**\n\t * Return parameter names for a constructor, or {@code null} if they cannot be determined.\n\t * <p>Individual entries in the array may be {@code null} if parameter names are only\n\t * available for some parameters of the given constructor but not for others. However,\n\t * it is recommended to use stub parameter names instead wherever feasible.\n\t * @param ctor the constructor to find parameter names for\n\t * @return an array of parameter names if the names can be resolved,\n\t * or {@code null} if they cannot\n\t */\n\t@Nullable\n\tString[] getParameterNames(Constructor<?> ctor);\n\n}",
"boolean isMoreSpecific (MethodType type) throws OverloadingAmbiguous {\r\n boolean status = false;\r\n\r\n try {\r\n for (int i = 0, size = arguments.size (); i < size; i++) {\r\n\tIdentifier this_arg = (Identifier) arguments.elementAt (i);\r\n\tIdentifier target_arg = (Identifier) type.arguments.elementAt (i);\r\n\r\n\tint type_diff = this_arg.type.compare (target_arg.type);\r\n\tif (type_diff == 0)\r\n\t continue;\r\n\telse if (type_diff > 0) {\r\n\t if (status == true) throw new OverloadingAmbiguous ();\r\n\t} else {\r\n\t if (i != 0) throw new OverloadingAmbiguous ();\r\n\t status = true;\r\n\t}\r\n }\r\n } catch (OverloadingAmbiguous ex) {\r\n throw ex;\r\n } catch (TypeMismatch ex) {\r\n throw new OverloadingAmbiguous ();\r\n }\r\n\r\n return status;\r\n }",
"@Test\n\tpublic void testChangeMethodParameters() {\n\t\tDeclarationListDelta delta = createClassDelta(\n\t\t\t\t\"int someMethod(String x) { return 0;} \",\n\t\t\t\t\"int someMethod(int x) { return 0;}\");\n\n\t\tassertEquals(1, delta.getAddedDeclarations().size());\n\t\tassertEquals(0, delta.getChangedDeclarations().size());\n\t\tassertEquals(1, delta.getRemovedDeclarations().size());\n\n\t\tString removedMethod = methodSignature(delta.getRemovedDeclarations()\n\t\t\t\t.get(0));\n\t\tassertEquals(\"int someMethod(String)\", removedMethod);\n\n\t\tString addedMethod = methodSignature(delta.getAddedDeclarations()\n\t\t\t\t.get(0));\n\t\tassertEquals(\"int someMethod(int)\", addedMethod);\n\t}",
"private void checkParams(String[] params) throws MethodCallWithNonexistentParameter,\n OutmatchingParametersToMethodCall, OutmatchingParameterType, InconvertibleTypeAssignment {\n ArrayList<Variable> methodParams = this.method.getMethodParameters();\n if (params.length != methodParams.size()) {\n // not enough params somewhere, or more than enough.\n throw new OutmatchingParametersToMethodCall();\n }\n int i = 0;\n for (String toBeParam : params) {\n toBeParam = toBeParam.trim();\n Variable toBeVariable = findParamByName(toBeParam);\n VariableVerifier.VerifiedTypes type = methodParams.get(i).getType();\n if (toBeVariable == null) {\n VariableVerifier.VerifiedTypes typeOfString = VariableVerifier.VerifiedTypes.getTypeOfString(toBeParam);\n if (!type.getConvertibles().contains(typeOfString)) {\n throw new MethodCallWithNonexistentParameter();\n }\n } else {\n checkTypes(toBeVariable, methodParams.get(i));\n checkValue(toBeVariable);\n }\n i++;\n }\n }",
"public Builder clearParameterName() {\n bitField0_ = (bitField0_ & ~0x00000001);\n parameterName_ = getDefaultInstance().getParameterName();\n\n return this;\n }",
"public interface NameFactory\n{\n /**\n * Returns a unique (descriptive?) parameter name for the specified\n * type.\n *\n * @param sig - signature of the declaring method\n * @param n - the parameter number whose name we want.\n * @return a made up name for the n'th parameter\n */\n public String getParameterName(Signature sig, int n);\n}",
"public void testOneOrMoreParameters() {\n int nrParameters = methodToTest.getParameterTypes().length;\n Class[] params = methodToTest.getParameterTypes();\n Object[] foo = new Object[nrParameters];\n \n // set up all parameters. Some methods are invoked with\n // primitives or collections, so we need to create them\n // accordingly\n for (int i = 0; i < nrParameters; i++) {\n try {\n if (params[i].isPrimitive()) {\n String primitiveName = params[i]\n .getName();\n if (primitiveName.equals(\"int\")) {\n foo[i] = Integer.valueOf(0);\n }\n if (primitiveName.equals(\"boolean\")) {\n foo[i] = Boolean.TRUE;\n }\n if (primitiveName.equals(\"short\")) {\n foo[i] = new Short(\"0\");\n }\n } else if (params[i].getName().equals(\"java.util.Collection\")) {\n foo[i] = new ArrayList();\n } else {\n /*\n * this call could easily fall if there is e.g. no public\n * default constructor. If it fails tweak the if/else tree\n * above to accommodate the parameter or check if we need to\n * test the particular method at all.\n */\n foo[i] = params[i].newInstance();\n }\n } catch (InstantiationException e) {\n fail(\"Cannot create an instance of : \"\n + params[i].getName()\n + \", required for \"\n + methodToTest.getName()\n + \". Check if \"\n + \"test needs reworking.\");\n } catch (IllegalAccessException il) {\n fail(\"Illegal Access to : \"\n + params[i].getName());\n }\n }\n \n try {\n methodToTest.invoke(facade, foo);\n fail(methodToTest.getName()\n + \" does not deliver an IllegalArgumentException\");\n } catch (InvocationTargetException e) {\n if (e.getTargetException() instanceof IllegalArgumentException \n || e.getTargetException() instanceof ClassCastException\n || e.getTargetException() instanceof NotImplementedException) {\n return;\n }\n fail(\"Test failed for \" + methodToTest.toString()\n + \" because of: \"\n + e.getTargetException());\n } catch (NotImplementedException e) {\n // If method not supported ignore failure\n } catch (Exception e) {\n fail(\"Test failed for \" + methodToTest.toString()\n + \" because of: \" + e.toString());\n }\n }",
"private MethodSignatureMatcher(@Nonnull String nameRegex, @Nullable @NonNullableElements String... parameters) {\n this.namePattern = Pattern.compile(nameRegex);\n if (parameters == null) {\n this.parameters = new String[0];\n } else {\n this.parameters = parameters;\n }\n }",
"public boolean strictMatches(@Nullable String name, ReflectionClassWrapper[] params) {\n\n if(name != null)\n if(!getName().equals(name))\n return false;\n\n var paramTypes = getExecutable().getParameterTypes();\n\n if(!(paramTypes.length == params.length))\n return false;\n\n for (int i = 0; i < params.length; i++) {\n\n if(!params[i].getName().equals(paramTypes[i].getName()))\n return false;\n\n }\n\n return true;\n\n }",
"private void findParameters(InstructionContext ins)\n\t{\n\t\tif (!(ins.getInstruction() instanceof InvokeInstruction))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tList<Method> methods = ((InvokeInstruction) ins.getInstruction()).getMethods();\n\t\tif (methods.isEmpty())\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tfindConstantParameter(methods, ins);\n\t}",
"public void testCreateMethodWithParameters() {\n IDOMMethod method = this.domFactory.createMethod();\n method.setName(\"foo\");\n method.setParameters(new String[] { \"String\", \"int\", \"char[]\" }, new String[] { \"name\", \"number\", \"buffer\" });\n assertSourceEquals(\"source code incorrect\", \"public void foo(String name, int number, char[] buffer) {\\n\" + \"}\\n\", method.getContents());\n }",
"public QueryMethodType<T> removeMethodParams()\n {\n childNode.remove(\"method-params\");\n return this;\n }",
"private boolean skipMethodParameters() {\r\n \t\tint ch = readCharBackward(); \r\n \t\tif (ch != ')')\r\n \t\t\treturn false;\r\n \t\tint pCount = 1;\r\n \t\twhile (pCount > 0) {\r\n \t\t\tch = readCharBackward();\r\n \t\t\tif (ch == -1)\r\n \t\t\t\treturn false;\r\n \t\t\t\r\n \t\t\tif (ch == '\"' || ch == '\\'') {\r\n \t\t\t\tskipQuotedChars((char)ch);\r\n \t\t\t\tcontinue;\r\n \t\t\t}\r\n \t\t\tif (ch == ')') {\r\n \t\t\t\tpCount++;\r\n \t\t\t\tcontinue;\r\n \t\t\t}\r\n \t\t\tif (ch == '(') {\r\n \t\t\t\tpCount--;\r\n \t\t\t\tcontinue;\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn true;\r\n \t}",
"private String getSuperMethodCallParameters(ExecutableElement sourceMethod) {\n return sourceMethod\n .getParameters()\n .stream()\n .map(parameter -> parameter.getSimpleName().toString())\n .collect(Collectors.joining(\", \"));\n }",
"@Test\n void include() {\n DocServiceFilter include = (plugin, service, method) -> true;\n DocServiceFilter exclude = (plugin, service, method) -> false;\n Map<String, ServiceInfo> services = services(include, exclude);\n assertThat(services).containsOnlyKeys(FOO_NAME, HELLO_NAME);\n\n // 2. Exclude specified.\n exclude = DocServiceFilter.ofMethodName(FOO_NAME, \"bar2\");\n services = services(include, exclude);\n assertThat(services).containsOnlyKeys(FOO_NAME, HELLO_NAME);\n List<String> methods = methods(services);\n\n assertThat(methods).containsExactlyInAnyOrder(\"bar1\", \"bar3\", \"bar4\", \"bar5\", \"bar6\");\n\n // 3-1. Include serviceName specified.\n include = DocServiceFilter.ofServiceName(FOO_NAME);\n // Set the exclude to the default.\n exclude = (plugin, service, method) -> false;\n services = services(include, exclude);\n assertThat(services).containsOnlyKeys(FOO_NAME);\n\n methods = methods(services);\n assertThat(methods).containsExactlyInAnyOrder(\"bar1\", \"bar2\", \"bar3\", \"bar4\", \"bar5\", \"bar6\");\n\n // 3-2. Include methodName specified.\n include = DocServiceFilter.ofMethodName(FOO_NAME, \"bar2\");\n services = services(include, exclude);\n assertThat(services).containsOnlyKeys(FOO_NAME);\n\n methods = methods(services);\n assertThat(methods).containsOnlyOnce(\"bar2\");\n\n // 4-1. Include and exclude specified.\n include = DocServiceFilter.ofServiceName(FOO_NAME);\n exclude = DocServiceFilter.ofMethodName(FOO_NAME, \"bar2\").or(DocServiceFilter.ofMethodName(\"bar3\"));\n services = services(include, exclude);\n assertThat(services).containsOnlyKeys(FOO_NAME);\n\n methods = methods(services);\n assertThat(methods).containsExactlyInAnyOrder(\"bar1\", \"bar4\", \"bar5\", \"bar6\");\n\n // 4-2. Include and exclude specified.\n include = DocServiceFilter.ofMethodName(FOO_NAME, \"bar2\");\n exclude = DocServiceFilter.ofServiceName(FOO_NAME);\n services = services(include, exclude);\n assertThat(services.size()).isZero();\n }",
"public abstract String[] getMethodNames();",
"private static boolean matchName(@NotNull PsiMethod method, @NotNull IHasParameterInfos targetMethodInfo, @NotNull String targetMethodName, boolean isConstructor) {\n if (targetMethodName.startsWith(\"@\")) {\n IType returnType = ((IGosuMethodInfo) targetMethodInfo).getReturnType();\n if ((returnType.equals(JavaTypes.BOOLEAN()) || returnType.equals(JavaTypes.pBOOLEAN()) &&\n !method.getName().equals(\"is\" + targetMethodName.substring(1)))) {\n return true;\n }\n if (!method.getName().equals(\"get\" + targetMethodName.substring(1)) && !method.getName().equals(\"set\" + targetMethodName.substring(1))) {\n return true;\n }\n } else if (!targetMethodName.equals(method.getName()) && !(isConstructor && \"construct\".equals(method.getName()))) {\n return true;\n }\n return false;\n }",
"public void testMethodInfo889() throws Exception {\n\t\tClassInfo var2788 = instantiateClassInfo431();\n\t\tList<ClassInfo> var2764 = Collections.emptyList();\n\t\tList<ParameterInfo> var2766 = Collections.emptyList();\n\t\tList<LocalVariableInfo> var2767 = Collections.emptyList();\n\t\tList<Operation> var2768 = Collections.emptyList();\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tMethodInfo var2789 = new MethodInfo(var2788, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList());\n\t\tClassInfo var2765 = new ClassInfo(\"super\", false, null, var2764, null);\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tClassInfo var2771 = new ClassInfo(\"super\", false, var2765, var2764,\n\t\t\t\tnull);\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2788.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2788.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2788.getSetters();\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2788.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2788.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2788.getSetters();\n\t\tvar2789.isSetter();\n\t\tvar2789.isSetter();\n\t}",
"public void removeParameters() {\n LogWriter.logMessage(LogWriter.TRACE_DEBUG, \"removeParameters() \");\n Via via=(Via)sipHeader;\n \n via.removeParameters();\n }",
"public MethodBuilder() {\n\t\tvisibility = \"public\";\n\t\treturnType = \"void\";\n\t\tname = \"foo\";\n\t\trule = \"\";\n\t\ttype = \"\";\n\t\tparameters = new ArrayList<String>();\n\t\tcommands = new ArrayList<String>();\n\t}",
"public void testMethodInfo885() throws Exception {\n\t\tClassInfo var2769 = instantiateClassInfo424();\n\t\tLocalVariableInfo var2770 = instantiateLocalVariableInfo423();\n\t\tList<ClassInfo> var2764 = Collections.emptyList();\n\t\tList<ParameterInfo> var2766 = Collections.emptyList();\n\t\tList<LocalVariableInfo> var2767 = Collections.emptyList();\n\t\tList<Operation> var2768 = Collections.emptyList();\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tMethodInfo var2772 = new MethodInfo(var2769, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList());\n\t\tClassInfo var2765 = new ClassInfo(\"super\", false, null, var2764, null);\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tClassInfo var2771 = new ClassInfo(\"super\", false, var2765, var2764,\n\t\t\t\tnull);\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2769.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2769.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2769.getSetters();\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2769.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2769.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2769.getSetters();\n\t\tvar2772.isSetter();\n\t\tvar2772.isSetter();\n\t}",
"Enumeration getParameterNames();",
"public interface C0159fv {\n /* renamed from: a */\n void mo4827a(Context context, C0152fo foVar);\n\n /* renamed from: a */\n void mo4828a(C0152fo foVar, boolean z);\n\n /* renamed from: a */\n void mo4829a(C0158fu fuVar);\n\n /* renamed from: a */\n boolean mo4830a();\n\n /* renamed from: a */\n boolean mo4831a(C0153fp fpVar);\n\n /* renamed from: a */\n boolean mo4832a(C0167gc gcVar);\n\n /* renamed from: b */\n void mo4833b();\n\n /* renamed from: b */\n boolean mo4834b(C0153fp fpVar);\n}",
"public void removeIndependentParameter(String name)\n throws ParameterException;",
"public interface MethodCandidate extends Ordered {\n\n /**\n * The default position.\n */\n int DEFAULT_POSITION = 0;\n\n /**\n * Whether the given method name matches this finder.\n *\n * @param methodElement The method element. Never null.\n * @param matchContext The match context. Never null.\n * @return true if it does\n */\n boolean isMethodMatch(@NonNull MethodElement methodElement, @NonNull MatchContext matchContext);\n\n @Override\n default int getOrder() {\n return DEFAULT_POSITION;\n }\n\n /**\n * Builds the method info. The method {@link #isMethodMatch(MethodElement, MatchContext)} should be\n * invoked and checked prior to calling this method.\n *\n * @param matchContext The match context\n * @return The method info or null if it cannot be built. If the method info cannot be built an error will be reported to\n * the passed {@link MethodMatchContext}\n */\n @Nullable\n MethodMatchInfo buildMatchInfo(@NonNull MethodMatchContext matchContext);\n\n}",
"public boolean containsIndependentParameter(String name);",
"public void testMethodInfo888() throws Exception {\n\t\tClassInfo var2785 = instantiateClassInfo430();\n\t\tFieldInfo var2786 = instantiateFieldInfo429();\n\t\tList<ClassInfo> var2764 = Collections.emptyList();\n\t\tList<ParameterInfo> var2766 = Collections.emptyList();\n\t\tList<LocalVariableInfo> var2767 = Collections.emptyList();\n\t\tList<Operation> var2768 = Collections.emptyList();\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tMethodInfo var2787 = new MethodInfo(var2785, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList());\n\t\tClassInfo var2765 = new ClassInfo(\"super\", false, null, var2764, null);\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2785.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2785.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tvar2785.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tClassInfo var2771 = new ClassInfo(\"super\", false, var2765, var2764,\n\t\t\t\tnull);\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2785.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2785.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2785.getSetters();\n\t\tvar2787.isSetter();\n\t\tvar2787.isSetter();\n\t}",
"@Test\n public void execute_nameParameter() throws ParseException {\n //No user input\n execute_parameterPredicate_test(0, \" \", \"name\", true, false, Collections.emptyList());\n //Single keyword, ignore case, person found.\n execute_parameterPredicate_test(1, \"ElLe\", \"name\", true, false, Arrays.asList(ELLE));\n //Single keyword, case sensitive, person found.\n execute_parameterPredicate_test(0, \"ElLe\", \"name\", false, false, Collections.emptyList());\n //Multiple keywords, ignore case, or condition, multiple people found\n execute_parameterPredicate_test(3, \"Kurz Elle Kunz\", \"name\", true, false, Arrays.asList(CARL, ELLE, FIONA));\n //Multiple keywords, ignore case, and condition, no one found\n execute_parameterPredicate_test(0, \"kurz Elle kunz\", \"name\", true, true, Collections.emptyList());\n //Multiple keywords, case sensitive, or condition, multiple people found\n execute_parameterPredicate_test(2, \"kurz Elle Kunz\", \"name\", false, false, Arrays.asList(ELLE, FIONA));\n //Multiple keywords, case sensitive, and condition, no one found\n execute_parameterPredicate_test(0, \"Kurz Elle kunz\", \"name\", false, true, Collections.emptyList());\n }",
"abstract String applicable(Method[] getters) throws InvalidObjectException;",
"public String getMethodName(Class<?> type, String methodName, Class<?>... params);",
"public abstract Builder methods(RequestMethod... paramVarArgs);",
"private static boolean validateMethod(Method method) {\n for (Class<?> param : method.getParameterTypes()) {\n if (null == OvsDbConverter.get(param))\n return false;\n }\n return true;\n }",
"@Test\n public void execute_multiParameter_namePhone() throws ParseException {\n execute_multipleParameterPredicate_test(2, \"alice 95352563\", \"name phone\", true, false,\n Arrays.asList(ALICE, CARL));\n //different paramters from same person, ignore case, and operation\n execute_multipleParameterPredicate_test(1, \"alice 94351253\", \"name phone\", true, true,\n Arrays.asList(ALICE));\n //different paramters from same person, case sensitive, and operation\n execute_multipleParameterPredicate_test(0, \"alice 94351253\", \"name phone\", false, true,\n Collections.emptyList());\n }",
"void clearTypedParameters();",
"public Collection<String> getParamNames();",
"Type getMethodParameterType() throws IllegalArgumentException;",
"private String methodNameMask(String name) {\n\t\tString[] words = name\n\t\t\t\t.replaceAll(\"[\\\\d\\\\'\\\\+\\\\-\\\\:\\\\;\\\\(\\\\)\\\\[\\\\]\\\\{\\\\}\\\\~\\\\^\\\\*\\\\&\\\\#\\\\@\\\\$\\\\<\\\\>\\\\,\\\\_\\\\.\\\\\\\"]\", \"\")\n\t\t\t\t.split(\" \");\n\t\tString forReturn = words[0];\n\t\tfor (int i = 1; i < words.length; i++) {\n\t\t\tif (words[i].isEmpty())\n\t\t\t\tcontinue;\n\t\t\tif (Character.isDigit(words[i].charAt(0)))\n\t\t\t\tforReturn = forReturn + words[i];\n\t\t\telse\n\t\t\t\tforReturn = forReturn + words[i].replaceFirst(String.valueOf(words[i].charAt(0)),\n\t\t\t\t\t\tString.valueOf(words[i].charAt(0)).toUpperCase());\n\t\t}\n\t\treturn forReturn;\n\t}",
"public Builder clearMethodName() {\r\n\t\t\t\tbitField0_ = (bitField0_ & ~0x00000001);\r\n\t\t\t\tmethodName_ = getDefaultInstance().getMethodName();\r\n\t\t\t\tonChanged();\r\n\t\t\t\treturn this;\r\n\t\t\t}",
"private void listParameters(String methodName, JavaSamplerContext context) {\n\t\tIterator<String> iter = context.getParameterNamesIterator();\n\t\twhile (iter.hasNext()) {\n\t\t\tString name = iter.next();\n\t\t\tlog.debug(\"inside {}, name {} = {}\",\n\t\t\t\t\tnew Object[] { methodName, name, context.getParameter(name) });\n\t\t}\n\t}",
"public static String getName(String methodName) {\n\t\tString[] splitMethodName = methodName.split(\"(?<=.)(?=\\\\p{Lu})\");\n\t\tString strMethodName = Arrays.toString(splitMethodName);\n\t\tstrMethodName = strMethodName.substring(1, strMethodName.length() - 1);\n\t\tString covertMethodName = strMethodName.replace(\",\", \"\").replace(\"verify \", \"\");\n\t\treturn covertMethodName;\n\t}",
"private void validateMethods () throws ModelValidationException\n\t\t\t{\n\t\t\t\tModel model = getModel();\n\t\t\t\tObject equalsMethod = getNonObjectMethod(keyClassName, \n\t\t\t\t\t\"equals\", Model.getEqualsArgs()); //NOI18N\n\t\t\t\tObject hashCodeMethod = getNonObjectMethod(keyClassName, \n\t\t\t\t\t\"hashCode\", Model.NO_ARGS); //NOI18N\n\n\t\t\t\t// check equals method\n\t\t\t\tif (!matchesMethod(equalsMethod, Modifier.PUBLIC,\n\t\t\t\t\t0, \"boolean\")) //NOI18N\n\t\t\t\t{\n\t\t\t\t\tthrow new ModelValidationException(keyClass,\n\t\t\t\t\t\tI18NHelper.getMessage(getMessages(), \n\t\t\t\t\t\t\"util.validation.key_class_equals\", //NOI18N\n\t\t\t\t\t\tkeyClassName, getClassName()));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// check hashCode method\n\t\t\t\tif (!matchesMethod(hashCodeMethod, Modifier.PUBLIC,\n\t\t\t\t\t0, \"int\")) //NOI18N\n\t\t\t\t{\n\t\t\t\t\tthrow new ModelValidationException(keyClass,\n\t\t\t\t\t\tI18NHelper.getMessage(getMessages(), \n\t\t\t\t\t\t\"util.validation.key_class_hashcode\", //NOI18N\n\t\t\t\t\t\tkeyClassName, getClassName()));\n\t\t\t\t}\n\t\t\t}",
"public static String methodName(Description description) {\n return description.getMethodName().replaceAll(\"\\\\s?\\\\{.+\\\\}\", \"\");\n }",
"private void findDeadParameters(MethodContext mctx)\n\t{\n\t\tmctx.getInstructionContexts().forEach(this::findDeadParameters);\n\t}",
"@Check\n \tpublic void checkOperatorOverloadsNamesMatch(Name name) {\n \t\t\n \t\tif (name.eContainer() instanceof Def && name.eContainer().eContainer() instanceof Def) {\n \t\t\tDef parent = (Def) name.eContainer().eContainer();\n \t\t\tif (parent.isOverload()) {\n \t\t\t\t// Convert to list of strings to be able to make comparison\n \t\t\t\tArrayList<String> parentNames = new ArrayList<String>();\n \t\t\t\tfor (Name n : parent.getName())\n \t\t\t\t\tparentNames.add(n.getName().getS());\n \t\t\t\t\n \t\t\t\tif (!parentNames.contains(name.getName().getS())) {\n \t\t\t\t\tStringBuilder parentNamesSB = new StringBuilder();\n \t\t\t\t\tIterator<Name> i = parent.getName().iterator();\n \t\t\t\t\twhile (i.hasNext()) {\n \t\t\t\t\t parentNamesSB.append(i.next().getName().getS());\n \t\t\t\t\t if (i.hasNext())\n \t\t\t\t\t \tparentNamesSB.append(\", \");\n \t\t\t\t\t}\n \t\t\t\t\tString msg = String.format(\"Oper name \\\"%1$s\\\" does not occur in parent overload name \\\"%2$s\\\"\", name.getName().getS(), parentNamesSB.toString());\n \t\t\t\t\twarning(msg, GFPackage.Literals.NAME__NAME);\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t}\n \t\t\n \t}",
"@Override\n\tpublic Enumeration<String> getParameterNames() {\n\t\treturn null;\n\t}",
"private void isMethod() {\n isNameExpr = new EditText(this);\n isNameExpr.isMethod(true);\n new MaterialDialog.Builder(this).isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr).isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr).isMethod(isNameExpr, true).isMethod((isParameter, isParameter) -> {\n String isVariable = isNameExpr.isMethod().isMethod().isMethod(\"isStringConstant\", \"isStringConstant\");\n if (isNameExpr.isMethod() == isIntegerConstant) {\n isMethod(isMethod().isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr));\n } else if (isMethod(isNameExpr)) {\n isMethod(isMethod().isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr));\n } else {\n // isComment\n try {\n isNameExpr.isMethod();\n isNameExpr.isMethod(isNameExpr.isFieldAccessExpr, isNameExpr, new DeckTask.TaskData(new Object[] { isNameExpr, isNameExpr }));\n } catch (ConfirmModSchemaException isParameter) {\n // isComment\n ConfirmationDialog isVariable = new ConfirmationDialog();\n isNameExpr.isMethod(isMethod().isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr));\n Runnable isVariable = () -> {\n isNameExpr.isMethod();\n String isVariable = isNameExpr.isMethod().isMethod().isMethod(\"isStringConstant\", \"isStringConstant\");\n isNameExpr.isMethod(isNameExpr.isFieldAccessExpr, isNameExpr, new DeckTask.TaskData(new Object[] { isNameExpr, isNameExpr }));\n isMethod();\n };\n isNameExpr.isMethod(isNameExpr);\n isNameExpr.isMethod(isNameExpr);\n isNameExpr.this.isMethod(isNameExpr);\n }\n isNameExpr.isMethod().isMethod(isNameExpr);\n isMethod();\n }\n }).isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr).isMethod();\n }",
"default List<Parameter<?>> getMethodParameters()\n {\n return Collections.unmodifiableList(Collections.emptyList());\n }",
"public void testMethodInfo886() throws Exception {\n\t\tClassInfo var2776 = instantiateClassInfo426();\n\t\tLocalField var2777 = instantiateLocalField425();\n\t\tList<ClassInfo> var2764 = Collections.emptyList();\n\t\tList<ParameterInfo> var2766 = Collections.emptyList();\n\t\tList<LocalVariableInfo> var2767 = Collections.emptyList();\n\t\tList<Operation> var2768 = Collections.emptyList();\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tMethodInfo var2778 = new MethodInfo(var2776, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList());\n\t\tvar2777.getDescription();\n\t\tvar2777.getDescription();\n\t\tClassInfo var2765 = new ClassInfo(\"super\", false, null, var2764, null);\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tClassInfo var2771 = new ClassInfo(\"super\", false, var2765, var2764,\n\t\t\t\tnull);\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2776.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2776.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2776.getSetters();\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2776.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2776.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2776.getSetters();\n\t\tvar2778.isSetter();\n\t\tvar2778.isSetter();\n\t}",
"boolean skipMethodName() {\r\n \t\tint endOfToken = index;\r\n \t\tint ch;\r\n \t\twhile((ch = readCharBackward()) != -1) {\r\n \t\t\tif (!Character.isJavaIdentifierPart(ch)) {\r\n \t\t\t\treleaseChar();\r\n \t\t\t\treturn (endOfToken - index > 0);\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn false;\r\n \t}",
"public void setUniqueFactoryMethodName(String name)\n/* */ {\n/* 276 */ Assert.hasText(name, \"Factory method name must not be empty\");\n/* 277 */ setFactoryMethodName(name);\n/* 278 */ this.isFactoryMethodUnique = true;\n/* */ }",
"void method_114(int var1, int var2);",
"@Override\n\t\tpublic Enumeration getParameterNames() {\n\t\t\treturn null;\n\t\t}",
"public String[] getParamTypeNames()\n/* */ {\n/* 353 */ return this.parameterTypeNames;\n/* */ }",
"public void setParamName(String paramName)\r\n/* 18: */ {\r\n/* 19:51 */ this.paramName = paramName;\r\n/* 20: */ }",
"boolean match(String mnemonic, ParameterType[] parameters);",
"private void countParams() {\n if( paramCount >= 0 ) {\n return;\n }\n Iterator<AnyType> parser = name.getSignature( types );\n paramCount = needThisParameter ? 1 : 0;\n while( parser.next() != null ) {\n paramCount++;\n }\n valueType = parser.next();\n while( parser.hasNext() ) {\n valueType = parser.next();\n paramCount--;\n }\n }",
"public void removeParameter(String name) throws IllegalArgumentException {\n LogWriter.logMessage(LogWriter.TRACE_DEBUG, \"removeParameter() \");\n Via via=(Via)sipHeader;\n \n if( name==null )\n throw new IllegalArgumentException\n (\"JAIN-EXCEPTION: parameter is null\");\n else via.removeParameter(name); \n }",
"public void removeOption(String[] names) {\n\t\tfor (Opt op : options) {\n\t\t\tfor (String name : names) {\n\t\t\t\tif (op.getName().equals(name)) {\n\t\t\t\t\toptions.remove(op);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}",
"public void setParams(String[] names) {\n if (names == null)\n names = new String[0];\n setDescriptor(getProject().getNameCache().getDescriptor(getReturnName(),\n names));\n }",
"private FamixMethod findInvokedMethodOnName(String fromClass, String fromMethod, String invokedClassName, String invokedMethodName) {\n \tFamixMethod result = null;\n\t\t/* Test Helper\n\t\tif (fromClass.equals(\"domain.direct.violating.AccessLocalVariable_SetArgumentValue\")){\n\t\t\tboolean breakpoint = true;\n\t\t} */\n\n \t// 1) If methodNameAsInInvocation matches with a method unique name, return that method. \n \tString searchKey = invokedClassName + \".\" + invokedMethodName;\n \tif (theModel.behaviouralEntities.containsKey(searchKey)) {\n \t\treturn (FamixMethod) theModel.behaviouralEntities.get(searchKey);\n \t}\n \t// 2) Find out if there are more methods with the same name of the invoked class. If only one method is found, then return this method. \n \tString methodName = invokedMethodName.substring(0, invokedMethodName.indexOf(\"(\")); // Methodname without signature\n \t searchKey = invokedClassName + \".\" + methodName;\n \tif (sequencesPerMethod.containsKey(searchKey)){\n \t\tArrayList<FamixMethod> methodsList = sequencesPerMethod.get(searchKey);\n \t\tif (methodsList.size() == 0) {\n \t\t\treturn result;\n \t\t} else if (methodsList.size() == 1) {\n \t\t\t// FamixMethod result1 = methodsList.get(0);\n \t\t\treturn methodsList.get(0);\n \t\t} else { // 3) if there are more methods with the same name, then compare the invocation arguments with the method parameters.\n \t\t\tString invocationSignature = invokedMethodName.substring(invokedMethodName.indexOf(\"(\"));;\n \t\t\tString contentsInvocationSignature = invocationSignature.substring(invocationSignature.indexOf(\"(\") + 1, invocationSignature.indexOf(\")\")); \n \t\t\tString[] invocationArguments = contentsInvocationSignature.split(\",\");\n \t\t\tint numberOfArguments = invocationArguments.length;\n \t\t\t// 3a) If there is only one method with the same number of parameters as invocationArguments, then return this method\n \t\t\tList<FamixMethod> matchingMethods1 = new ArrayList<FamixMethod>();\n\t \t\tfor (FamixMethod method : methodsList){\n\t \t\t\tif ((method.signature != null) && (!method.signature.equals(\"\"))) {\n\t\t \t\t\tString contentsmethodParameter = method.signature.substring(method.signature.indexOf(\"(\") + 1, method.signature.indexOf(\")\")); \n\t\t \t\t\tString[] methodParameters = contentsmethodParameter.split(\",\");\n\t\t \t\t\tif (methodParameters.length == numberOfArguments) {\n\t\t \t\t\t\tmatchingMethods1.add(method);\n\t\t \t\t\t}\n\t \t\t\t}\n\t \t\t} \n\t \t\tif (matchingMethods1.size() == 0)\n\t \t\t\treturn result;\n\t \t\tif (matchingMethods1.size() == 1)\n\t \t\t\treturn matchingMethods1.get(0);\n \t\t\t\n \t\t\t// 3b) If there is only one method where the first parameter type == the first argument type, then return this method \n \t\t\tList<FamixMethod> matchingMethods2 = new ArrayList<FamixMethod>();\n \t\t\tif (numberOfArguments >= 1) {\n \t\t\t\t// Replace the argument string by a type, in case of an attribute\n \t\t\t\tinvocationArguments[0] = getTypeOfAttribute(fromClass, fromMethod, invocationArguments[0]);\n \t \t\tfor (FamixMethod matchingMethod1 : matchingMethods1){\n \t \t\t\tString contentsmethodParameter = matchingMethod1.signature.substring(matchingMethod1.signature.indexOf(\"(\") + 1, matchingMethod1.signature.indexOf(\")\")); \n \t \t\t\tString[] methodParameters = contentsmethodParameter.split(\",\");\n \t \t\t\tif (methodParameters.length >= 1) {\n \t \t\t\tmethodParameters[0] = getfullPathOfDeclaredType(fromClass, methodParameters[0]);\n \t \t\t\t\tif (methodParameters[0].equals(invocationArguments[0])) {\n \t \t\t\t\t\tmatchingMethods2.add(matchingMethod1);\n \t \t\t\t\t}\n \t \t\t\t}\n \t \t\t\t\n \t \t\t} \n \t \t\tif (matchingMethods2.size() == 0)\n \t \t\t\treturn result;\n \t \t\tif (matchingMethods2.size() == 1)\n \t \t\t\treturn matchingMethods2.get(0);\n \t\t\t}\n \t\t\t// If there is only one method where the second parameter type == the first argument type, then return this method \n \t\t\tif (numberOfArguments >= 2) {\n \t\t\t\tmatchingMethods1.clear();\n \t\t\t\t// Replace the argument string by a type, in case of an attribute\n \t\t\t\tinvocationArguments[1] = getTypeOfAttribute(fromClass, fromMethod, invocationArguments[1]);\n \t \t\tfor (FamixMethod matchingMethod2 : matchingMethods2){\n \t \t\t\tString contentsmethodParameter = matchingMethod2.signature.substring(matchingMethod2.signature.indexOf(\"(\") + 1, matchingMethod2.signature.indexOf(\")\")); \n \t \t\t\tString[] methodParameters = contentsmethodParameter.split(\",\");\n \t \t\t\tif (methodParameters.length >= 2) {\n \t \t\t\tmethodParameters[1] = getfullPathOfDeclaredType(fromClass, methodParameters[1]);\n \t \t\t\t\tif (methodParameters[1].equals(invocationArguments[1])) {\n \t \t\t\t\t\tmatchingMethods1.add(matchingMethod2);\n \t \t\t\t\t}\n \t \t\t\t}\n \t \t\t\t\n \t \t\t} \n \t \t\tif (matchingMethods1.size() == 0)\n \t \t\t\treturn result;\n \t \t\tif (matchingMethods1.size() == 1)\n \t \t\t\treturn matchingMethods1.get(0);\n \t\t\t}\n \t\t}\n\t\t}\n \treturn result; \n }",
"public Method getMethodByParameters(String name, Class<?>... args) {\r\n \t\t\r\n \t\t// Find the correct method to call\r\n \t\tfor (Method method : getMethods()) {\r\n \t\t\tif (Arrays.equals(method.getParameterTypes(), args)) {\r\n \t\t\t\treturn method;\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n \t\t// That sucks\r\n \t\tthrow new RuntimeException(\"Unable to find \" + name + \" in \" + source.getName());\r\n \t}",
"public void removeFromParameterNameValuePairs(entity.LoadParameter element);",
"private static void verifyMethod(final OperationMethod method) {\n assertIdentifierEquals(\"name\", null, null, null, \"Mercator (1SP)\", method.getName());\n assertEquals(\"formula\", \"See EPSG guide.\", method.getFormula().getFormula().toString());\n final ParameterDescriptorGroup parameters = method.getParameters();\n assertEquals(\"parameters.name\", \"Mercator (1SP)\", parameters.getName().getCode());\n final Iterator<GeneralParameterDescriptor> it = parameters.descriptors().iterator();\n CC_OperationParameterGroupTest.verifyMethodParameter(Mercator1SP.LATITUDE_OF_ORIGIN, (ParameterDescriptor<?>) it.next());\n CC_OperationParameterGroupTest.verifyMethodParameter(Mercator1SP.LONGITUDE_OF_ORIGIN, (ParameterDescriptor<?>) it.next());\n assertFalse(\"Unexpected parameter.\", it.hasNext());\n }",
"public Builder clearMethodName() {\n bitField0_ = (bitField0_ & ~0x00000004);\n methodName_ = getDefaultInstance().getMethodName();\n onChanged();\n return this;\n }",
"public Builder clearMethodName() {\n bitField0_ = (bitField0_ & ~0x00000004);\n methodName_ = getDefaultInstance().getMethodName();\n onChanged();\n return this;\n }",
"public abstract Method createDefaultCaseMethod(IClassDefinition cdef);",
"Iterable<ActionParameterTypes> getParameterTypeAlternatives();",
"private void removeCommentsFromParameters(final Collection<String> collection) {\n final List<String> itemsToRemove = new ArrayList<String>();\n\n for (final String parameter : collection) {\n if (parameter.indexOf(\"#\") == 0) {\n itemsToRemove.add(parameter);\n }\n }\n collection.removeAll(itemsToRemove);\n }",
"private boolean methodEqueals(Method m1, Method m2) {\n\t\tif (m1.getName() == m2.getName()) {\n\t\t\tif (!m1.getReturnType().equals(m2.getReturnType()))\n\t\t\t\treturn false;\n\t\t\tClass<?>[] params1 = m1.getParameterTypes();\n\t\t\tClass<?>[] params2 = m2.getParameterTypes();\n\t\t\tif (params1.length == params2.length) {\n\t\t\t\tfor (int i = 0; i < params1.length; i++) {\n\t\t\t\t\tif (params1[i] != params2[i])\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"private void clearChangeNameReq() {\n if (reqCase_ == 12) {\n reqCase_ = 0;\n req_ = null;\n }\n }",
"public interface C11994b {\n /* renamed from: a */\n C11996a mo41079a(String str);\n\n /* renamed from: a */\n C11996a mo41080a(String str, C11997b bVar, String... strArr);\n\n /* renamed from: a */\n C11998c mo41081a(String str, C11999d dVar, String... strArr);\n\n /* renamed from: a */\n C12000e mo41082a(String str, C12001f fVar, String... strArr);\n\n /* renamed from: a */\n void mo41083a();\n\n /* renamed from: a */\n void mo41084a(C12018b bVar, ConnectionState... connectionStateArr);\n\n /* renamed from: b */\n C11996a mo41085b(String str);\n\n /* renamed from: b */\n void mo41086b();\n\n /* renamed from: c */\n C12000e mo41087c(String str);\n\n /* renamed from: c */\n C12017a mo41088c();\n\n /* renamed from: d */\n void mo41089d(String str);\n\n /* renamed from: e */\n C11998c mo41090e(String str);\n\n /* renamed from: f */\n C12000e mo41091f(String str);\n\n /* renamed from: g */\n C11998c mo41092g(String str);\n}",
"HxMethod createConstructor(final String... parameterTypes);",
"boolean hasParameterName();",
"private void initParameters() {\n Annotation[][] paramsAnnotations = method.getParameterAnnotations();\n for (int i = 0; i < paramsAnnotations.length; i++) {\n if (paramsAnnotations[i].length == 0) {\n contentBuilder.addUnnamedParam(i);\n } else {\n for (Annotation annotation : paramsAnnotations[i]) {\n Class<?> annotationType = annotation.annotationType();\n if (annotationType.equals(PathParam.class)\n && pathBuilder != null) {\n PathParam param = (PathParam) annotation;\n pathBuilder.addParam(param.value(), i);\n } else if (annotationType.equals(QueryParam.class)) {\n QueryParam param = (QueryParam) annotation;\n queryBuilder.addParam(param.value(), i);\n } else if (annotationType.equals(HeaderParam.class)) {\n HeaderParam param = (HeaderParam) annotation;\n headerBuilder.addParam(param.value(), i);\n } else if (annotationType.equals(NamedParam.class)) {\n NamedParam param = (NamedParam) annotation;\n contentBuilder.addNamedParam(param.value(), i);\n } else {\n contentBuilder.addUnnamedParam(i);\n }\n }\n }\n }\n }",
"public boolean removeParameter(String name) {\n/* 247 */ throw new UnsupportedOperationException(\"Removing parameters in a stack is not supported.\");\n/* */ }",
"private void handleVirtualCallsAndSuperConstructors() {\n Set<String> affectedClasses = new HashSet<String>();\n for(MethodData m : usedAppMethodData) {\n Set<MethodData> callers = callGraph.get(m);\n if(callers.isEmpty() && !entryPoints.contains(m)) {\n // this is a virtual call that is never invoked at runtime\n // exclude it from used methods\n String subSignature = m.getSubSignature();\n String className = m.getClassName();\n usedAppMethods.get(className).remove(subSignature);\n affectedClasses.add(className);\n } else if (m.getName().equals(\"<init>\")) {\n // check if this constructor is only called in the constructors of its subclasses\n String className = m.getClassName();\n if(!childrenMap.containsKey(className)) {\n // this class has no subclasses, so no need to check\n continue;\n }\n\n Set<String> subClasses = childrenMap.get(className);\n boolean onlyCalledInSubClassConstructor = true;\n for(MethodData caller : callers) {\n String callerClass = caller.getClassName();\n if(!subClasses.contains(callerClass)) {\n // this constructor is not only called in its subclasses\n onlyCalledInSubClassConstructor = false;\n break;\n }\n }\n\n if(onlyCalledInSubClassConstructor) {\n String subSignature = m.getSubSignature();\n usedAppMethods.get(className).remove(subSignature);\n affectedClasses.add(className);\n }\n }\n }\n\n // after removing unused virtual calls and superclass constructor calls\n // we need to update the used classes to filter out those used classes that are included due to these calls\n for(String className : affectedClasses) {\n if(usedAppMethods.get(className).isEmpty()) {\n usedAppMethods.remove(className);\n usedAppClasses.remove(className);\n }\n }\n }",
"private FunctionParametersValidator() {}",
"public MethodSignature getMatchingMethod(\n String methodName,\n SequenceType arguments,\n SequenceType typeArguments,\n List<ShadowException> errors) {\n boolean hasTypeArguments = typeArguments != null;\n MethodSignature candidate = null;\n\n for (MethodSignature signature : recursivelyGetMethodOverloads(methodName)) {\n MethodType methodType = signature.getMethodType();\n\n if (methodType.isParameterized()) {\n if (hasTypeArguments) {\n SequenceType parameters = methodType.getTypeParameters();\n try {\n if (parameters.canAccept(typeArguments, SubstitutionKind.TYPE_PARAMETER)) {\n signature = signature.replace(parameters, typeArguments);\n } else continue;\n } catch (InstantiationException ignored) {\n }\n }\n }\n\n // the list of method signatures starts with the closest (current class) and then adds parents\n // and outer classes\n // always stick with the current if you can\n // (only replace if signature is a subtype of candidate but candidate is not a subtype of\n // signature)\n if (signature.canAccept(arguments)) {\n if (candidate == null\n || (signature.getParameterTypes().isSubtype(candidate.getParameterTypes())\n && !candidate.getParameterTypes().isSubtype(signature.getParameterTypes())))\n candidate = signature;\n else if (!candidate.getParameterTypes().isSubtype(signature.getParameterTypes())) {\n ErrorReporter.addError(\n errors,\n Error.INVALID_ARGUMENTS,\n \"Ambiguous reference to \" + methodName + \" with arguments \" + arguments,\n arguments);\n return null;\n }\n }\n }\n\n if (candidate == null)\n ErrorReporter.addError(\n errors,\n Error.INVALID_METHOD,\n \"No definition of \" + methodName + \" with arguments \" + arguments + \" in this context\",\n arguments);\n\n return candidate;\n }",
"@Override\n public boolean evaluate(@Nonnull MethodInformation methodInformation) {\n boolean matches = namePattern.matcher(methodInformation.getName()).matches();\n final @Nonnull @NonNullableElements List<? extends VariableElement> methodParameters = methodInformation.getElement().getParameters();\n if (parameters.length == methodParameters.size()) {\n for (int i = 0; i < methodParameters.size(); i++) {\n final @Nonnull String nameOfDeclaredType = ProcessingUtility.getQualifiedName(methodParameters.get(i).asType());\n ProcessingLog.debugging(\"name of type: $\", nameOfDeclaredType);\n final @Nonnull String parameter = parameters[i];\n if (!parameter.equals(\"?\")) {\n matches = matches && nameOfDeclaredType.equals(parameter);\n }\n }\n } else {\n matches = false;\n }\n return matches;\n }",
"protected boolean onlyUsesTheseParameters(Set<TypeParameter> parameters) {\n if (isParameterized()) {\n if (isFullyInstantiated()) return true;\n\n for (ModifiedType modifiedType : getTypeParameters()) {\n Type parameter = modifiedType.getType();\n if (parameter instanceof TypeParameter typeParameter) {\n if (!parameters.contains(typeParameter)) return false;\n } else if (!parameter.onlyUsesTheseParameters(parameters)) return false;\n }\n }\n\n return true;\n }",
"boolean removeTypedParameter(Parameter typedParameter);",
"public interface NamingStrategy {\n\n /**\n * @param errorShapeName Name of error shape to derive exception class name from.\n * @return Appropriate name to use for a Java exception class name\n */\n String getExceptionName(String errorShapeName);\n\n\n /**\n * @param operationName Name of operation used to derive request class name.\n * @return Appropriate name to use for the Java class representing the request shape.\n */\n String getRequestClassName(String operationName);\n\n /**\n * @param operationName Name of operation used to derive response class name.\n * @return Appropriate name to use for the Java class representing the response shape.\n */\n String getResponseClassName(String operationName);\n\n /**\n * @param name Some contextual name to derive variable name from (i.e. member name, java class name, etc).\n * @return Appropriate name to use for a Java variable or field.\n */\n String getVariableName(String name);\n\n /**\n * @param enumValue Enum value as defined in the service model used to derive the java name.\n * @return Appropriate name to use for a Java enum value\n */\n String getEnumValueName(String enumValue);\n\n /**\n * @param shapeName Name of structure used to derive Java class name.\n * @return Appropriate name to use for a Java class for an arbitrary (not a request, response, error) structure.\n */\n String getJavaClassName(String shapeName);\n\n /**\n * @param shapeName Name of an authorizer shape used to derive the authorizer name\n * @return Appropriate name to use for a Java class for an Authorizer\n */\n String getAuthorizerClassName(String shapeName);\n\n /**\n * @param memberName Member name to name getter for.\n * @return Name of the getter method for a model class member.\n */\n String getGetterMethodName(String memberName);\n\n /**\n * @param memberName Member name to name setter for.\n * @return Name of the setter method for a model class member.\n */\n String getSetterMethodName(String memberName);\n\n /**\n * @param memberName Member name to name fluent setter for.\n * @return Appropriate name to use for fluent setter method (i.e. withFoo) for a model class member.\n */\n String getFluentSetterMethodName(String memberName);\n}",
"public AmbiguousMethodException() {\n super();\n }",
"public interface C4773c {\n /* renamed from: a */\n void m15858a(int i);\n\n /* renamed from: a */\n void m15859a(int i, int i2);\n\n /* renamed from: a */\n void m15860a(int i, int i2, int i3);\n\n /* renamed from: b */\n void m15861b(int i, int i2);\n}",
"static boolean normalParameterTypes(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"normalParameterTypes\")) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = normalParameterType(b, l + 1);\n r = r && normalParameterTypes_1(b, l + 1);\n exit_section_(b, m, null, r);\n return r;\n }",
"public void removeParam(int pos) {\n String[] origParams = getParamNames();\n if ((pos < 0) || (pos >= origParams.length))\n throw new IndexOutOfBoundsException(\"pos = \" + pos);\n\n String[] params = new String[origParams.length - 1];\n\n for (int i = 0, index = 0; i < origParams.length; i++)\n if (i != pos)\n params[index++] = origParams[i];\n setParams(params);\n }",
"public void changeParameterList(String className, String methodName, List<String> paramNames, List<String> paramTypes)\n\t{\n\t\tstoreViewState();\n\t\tproject.changeParameterList(className, methodName, paramNames, paramTypes);\n\t\tcheckStatus();\n\t}",
"public void validateMethodCall(HashMap<String, ArrayList<String>> callElements) throws\r\n\t\t\tIllegalOperationException, IncompatibleTypeException {\r\n\t\tMap.Entry<String, ArrayList<String>> data = callElements.entrySet().iterator().next();\r\n\t\tString methodName = data.getKey();\r\n\t\tMethodScope curMethod = Sjavac.getGlobalScope().getMethod(methodName);\r\n\t\tArrayList<String> methodArgs = data.getValue();\r\n\t\tif (methodArgs == null) {\r\n\t\t\tif (curMethod.getNumberOfArguments() != 0) {\r\n\t\t\t\tthrow new IllegalOperationException();\r\n\t\t\t}\r\n\t\t} else if (Sjavac.getGlobalScope().containsMethod(callElements)) {\r\n\t\t\t if (methodArgs.size() == curMethod.getNumberOfArguments()) {\r\n\t\t\t\tfor (int i = 0; i < methodArgs.size(); i++) {\r\n\t\t\t\t\tif(!curMethod.getArgument(i).compatibleWith(methodArgs.get(i))){\r\n\t\t\t\t\t\tVariable reference = this.findVariable(methodArgs.get(i));\r\n\t\t\t\t\t\tif(reference==null||!reference.isInitialized()){\r\n\t\t\t\t\t\t\tthrow new IllegalOperationException();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcurMethod.getArgument(i).compatibleWith(reference);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tthrow new IllegalOperationException();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tthrow new IllegalOperationException();\r\n\t\t}\r\n\t}",
"public abstract ImmutableSet<String> getExplicitlyPassedParameters();",
"public static MethodType fromParameters(String name, Type... paramTypes) {\n MethodType type = new MethodType(name);\n type.paramTypes = Arrays.copyOf(paramTypes, paramTypes.length);\n return type;\n }",
"public void method_213(String var1) {}",
"@Test\n\tpublic void testClassHasReplaceLessThanMethod() {\n\t\t// EDIT THESE TO MATCH YOUR METHOD\n\t\tmethodName = \"replaceLessThan\";\n\t\targTypes = \"\";\n\t\treturnType = \"void\";\n\t\t// END EDIT\n\t\t// class exists\n\t\ttry {\n\t\t\tPackage pkg = getClass().getPackage();\n\t\t\tString path = pkg == null ? \"\" : pkg.getName() + \".\";\n\t\t\tcls = Class.forName(path + className);\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tfail(\"File \\\"\" + className + \".class\\\" doesn't have a \\\"\" + className\n\t\t\t\t\t+ \"\\\" class. (is the class name spelled right?)\");\n\t\t}\n\n\t\t// class has method\n\t\ttry {\n\t\t\t// EDIT HERE TO GIVE PARAMETER TYPES\n\t\t\tmethod = cls.getMethod(methodName, int[].class, int.class);\n\t\t\t// END EDIT\n\t\t} catch (NoSuchMethodException | SecurityException e) {\n\t\t\tfail(\"Class \\\"\" + className + \"\\\" doesn't have a \\\"\" + methodName + \"(\" + argTypes\n\t\t\t\t\t+ \")\\\" method. (is the method name spelled right? are its parameters correct?)\");\n\t\t}\n\t\tinvokation = className + \".\" + methodName + \"(\" + argTypes + \")\";\n\t}",
"public void testMethod1() throws JavaModelException {\n\t\tASTNode node = buildAST(\n\t\t\t\"public class X<K, V> {\\n\" +\n\t\t\t\" /*start*/void foo(int i, Object o, java.lang.String s, Class[] c, X<K, V> x) {\\n\" +\n\t\t\t\" }/*end*/\\n\" +\n\t\t\t\"}\"\n\t\t);\n\t\tIBinding binding = ((MethodDeclaration) node).resolveBinding();\n\t\tassertNotNull(\"No binding\", binding);\n\t\tIJavaElement element = binding.getJavaElement();\n\t\tassertElementEquals(\n\t\t\t\"Unexpected Java element\",\n\t\t\t\"foo(int, Object, java.lang.String, Class[], X<K,V>) [in X [in [Working copy] X.java [in <default> [in <project root> [in P]]]]]\",\n\t\t\telement\n\t\t);\n\t\tassertTrue(\"Element should exist\", element.exists());\n\t}",
"static boolean normalFormalParameters(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"normalFormalParameters\")) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = normalFormalParameter(b, l + 1);\n r = r && normalFormalParameters_1(b, l + 1);\n exit_section_(b, m, null, r);\n return r;\n }",
"private String[] getParameterTypeNames(MethodNode method) {\n GenericsMapper mapper = null;\n ClassNode declaringClass = method.getDeclaringClass();\n if (declaringClass.getGenericsTypes() != null && declaringClass.getGenericsTypes().length > 0) {\n if (!mappers.containsKey(declaringClass)) {\n ClassNode thiz = getClassNode();\n mapper = GenericsMapper.gatherGenerics(findResolvedType(thiz, declaringClass), declaringClass);\n } else {\n mapper = mappers.get(declaringClass);\n }\n }\n Parameter[] parameters = method.getParameters();\n String[] paramTypeNames = new String[parameters.length];\n for (int i = 0; i < paramTypeNames.length; i++) {\n ClassNode paramType = parameters[i].getType();\n if (mapper != null && paramType.getGenericsTypes() != null && paramType.getGenericsTypes().length > 0) {\n paramType = VariableScope.resolveTypeParameterization(mapper, VariableScope.clone(paramType));\n }\n paramTypeNames[i] = paramType.getName();\n if (paramTypeNames[i].startsWith(\"[\")) {\n int cnt = Signature.getArrayCount(paramTypeNames[i]);\n String sig = Signature.getElementType(paramTypeNames[i]);\n String qualifier = Signature.getSignatureQualifier(sig);\n String simple = Signature.getSignatureSimpleName(sig);\n StringBuilder sb = new StringBuilder();\n if (qualifier.length() > 0) {\n sb.append(qualifier).append(\".\");\n }\n sb.append(simple);\n for (int j = 0; j < cnt; j++) {\n sb.append(\"[]\");\n }\n paramTypeNames[i] = sb.toString();\n }\n }\n return paramTypeNames;\n }",
"public void checkParameters() {\n }",
"public void testMethodInfo887() throws Exception {\n\t\tClassInfo var2782 = instantiateClassInfo428();\n\t\tLocalField var2783 = instantiateLocalField427();\n\t\tList<ClassInfo> var2764 = Collections.emptyList();\n\t\tList<ParameterInfo> var2766 = Collections.emptyList();\n\t\tList<LocalVariableInfo> var2767 = Collections.emptyList();\n\t\tList<Operation> var2768 = Collections.emptyList();\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tMethodInfo var2784 = new MethodInfo(var2782, \"voidX()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList());\n\t\tvar2783.getDescription();\n\t\tvar2783.getDescription();\n\t\tClassInfo var2765 = new ClassInfo(\"super\", false, null, var2764, null);\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tClassInfo var2771 = new ClassInfo(\"super\", false, var2765, var2764,\n\t\t\t\tnull);\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2782.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setD()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2771.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2782.addMethod(new MethodInfo(var2771, \"void setC()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2782.getSetters();\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2782.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2782.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setB()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PUBLIC, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"void setA()\", -1, null,\n\t\t\t\tvar2766, var2767, Visibility.PRIVATE, var2768, false, false,\n\t\t\t\tCollections.<Integer> emptyList()));\n\t\tvar2765.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tvar2782.addMethod(new MethodInfo(var2765, \"voidX()\", -1, null, var2766,\n\t\t\t\tvar2767, Visibility.PUBLIC, var2768, false, false, Collections\n\t\t\t\t\t\t.<Integer> emptyList()));\n\t\tvar2784.isSetter();\n\t\tvar2784.isSetter();\n\t}",
"void removeQueryParam(String name) {\n if (name == null) {\n throw new IllegalArgumentException(\"Name cannot be null\");\n }\n Iterator<Param> iter = queryParams.iterator();\n while (iter.hasNext()) {\n Param p = iter.next();\n if (p.key.equals(name)) {\n iter.remove();\n }\n }\n }",
"private static boolean isMoreSpecific(AccessibleObject more, Class<?>[] moreParams, boolean moreVarArgs, AccessibleObject less, Class<?>[] lessParams, boolean lessVarArgs) { // TODO clumsy arguments pending Executable in Java 8\n if (lessVarArgs && !moreVarArgs) {\n return true; // main() vs. main(String...) on []\n } else if (!lessVarArgs && moreVarArgs) {\n return false;\n }\n // TODO what about passing [arg] to log(String...) vs. log(String, String...)?\n if (moreParams.length != lessParams.length) {\n throw new IllegalStateException(\"cannot compare \" + more + \" to \" + less);\n }\n for (int i = 0; i < moreParams.length; i++) {\n Class<?> moreParam = Primitives.wrap(moreParams[i]);\n Class<?> lessParam = Primitives.wrap(lessParams[i]);\n if (moreParam.isAssignableFrom(lessParam)) {\n return false;\n } else if (lessParam.isAssignableFrom(moreParam)) {\n return true;\n }\n if (moreParam == Long.class && lessParam == Integer.class) {\n return false;\n } else if (moreParam == Integer.class && lessParam == Long.class) {\n return true;\n }\n }\n // Incomparable. Arbitrarily pick one of them.\n return more.toString().compareTo(less.toString()) > 0;\n }"
] | [
"0.52586234",
"0.5088426",
"0.5009938",
"0.4955979",
"0.48779824",
"0.4828538",
"0.48019266",
"0.47848642",
"0.4781775",
"0.47386086",
"0.46976197",
"0.46801484",
"0.46550742",
"0.4654882",
"0.46539047",
"0.46538234",
"0.46387467",
"0.45942342",
"0.4584431",
"0.45584178",
"0.45293167",
"0.45047557",
"0.4495788",
"0.44944698",
"0.44798297",
"0.44688782",
"0.4467913",
"0.4462034",
"0.44440803",
"0.44415015",
"0.44161105",
"0.44031578",
"0.4399855",
"0.43982723",
"0.43706918",
"0.43644968",
"0.43551242",
"0.43525064",
"0.43413287",
"0.43409246",
"0.4333196",
"0.4331007",
"0.4325823",
"0.43231815",
"0.43104428",
"0.4309317",
"0.4301784",
"0.4300675",
"0.4278795",
"0.42776626",
"0.42729345",
"0.42662442",
"0.42650345",
"0.42615044",
"0.42614603",
"0.4257698",
"0.42535695",
"0.42490533",
"0.42483938",
"0.42449343",
"0.4241547",
"0.4238914",
"0.423465",
"0.42300913",
"0.42277154",
"0.42277154",
"0.42250538",
"0.42243803",
"0.42239222",
"0.42201298",
"0.42164522",
"0.4215009",
"0.42046696",
"0.42007363",
"0.41900834",
"0.4173602",
"0.4169054",
"0.41652912",
"0.41645765",
"0.41603673",
"0.41595018",
"0.415741",
"0.4157376",
"0.41554925",
"0.41506284",
"0.41489932",
"0.41484874",
"0.41469464",
"0.41422236",
"0.41369078",
"0.41342196",
"0.41327715",
"0.41307828",
"0.41232058",
"0.41180187",
"0.41166648",
"0.4112621",
"0.41066653",
"0.41034776",
"0.40988427"
] | 0.440183 | 32 |
It would be MUCH simpler if we could just use ofClass.getAnnotation(Metadata.class). However that would be unsound. We want to shade the Kotlin runtime, including kotlin.Metadata, so as not to interfere with other things on the annotation classpath that might have a different version of the runtime. That means that if we referenced kotlin.Metadata.class here we would actually be referencing autovalue.shaded.kotlin.Metadata.class. Obviously the Kotlin class doesn't have that annotation. | private Optional<AnnotationMirror> kotlinMetadataAnnotation(Element element) {
return element.getAnnotationMirrors().stream()
.filter(
a ->
asTypeElement(a.getAnnotationType())
.getQualifiedName()
.contentEquals(KOTLIN_METADATA_NAME))
.<AnnotationMirror>map(a -> a) // get rid of that stupid wildcard
.findFirst();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean hasAnnotationMetadata();",
"public Framework_annotation<T> build_annotation();",
"AnnotationProvider getClassAnnotationProvider();",
"public interface AnnotationReader\r\n{\r\n /**\r\n * Accessor for the annotations packages supported by this reader.\r\n * @return The annotations packages that will be processed.\r\n */\r\n String[] getSupportedAnnotationPackages();\r\n\r\n /**\r\n * Method to get the MetaData for a class from its annotations.\r\n * @param cls The class\r\n * @param pmd MetaData for the owning package (that this will be a child of)\r\n * @param clr ClassLoader resolver\r\n * @return The ClassMetaData (unpopulated and uninitialised)\r\n */\r\n AbstractClassMetaData getMetaDataForClass(Class cls, PackageMetaData pmd, ClassLoaderResolver clr);\r\n\r\n /**\r\n * Method to return whether this is reading in a persistence context.\r\n * @return Whether this is a persistence context\r\n */\r\n boolean isPersistenceContext();\r\n}",
"private String getMetaAnnotationType(Class<?> clazz, Collection<Class<? extends Annotation>> annotationSet) {\n for (Class<? extends Annotation> annotType : annotationSet) {\n Annotation annotInstance = clazz.getAnnotation(annotType);\n if (annotInstance != null) {\n return (String) invoke(annotInstance, \"value\", null, null);\n }\n }\n return null;\n }",
"private <T extends Annotation> T getMetaAnnotation(Class<T> metaAnnotation, Field field)\r\n {\r\n Annotation[] allAnnotations = field.getAnnotations();\r\n for (Annotation annotation : allAnnotations) {\r\n if (annotation.annotationType().isAnnotationPresent(metaAnnotation)) {\r\n return annotation.annotationType().getAnnotation(metaAnnotation);\r\n }\r\n }\r\n return null;\r\n }",
"boolean hasRuntimeMetadata();",
"com.google.cloud.datalabeling.v1beta1.AnnotationMetadata getAnnotationMetadata();",
"public static boolean needsAnnotationsJarInClasspath(@NotNull IAndroidTarget target) {\n return target.getVersion().getApiLevel() <= 15;\n }",
"public Framework_annotation<T> build_normal();",
"public abstract Annotations getClassAnnotations();",
"default void onDiscovery(@Nonnull A annotation, @Nonnull Class<? extends C> type) {\n }",
"String getMetadataClassName();",
"Set<Class<?>> getClassSetByAnnotation(String packageName, Class<? extends Annotation> annotationClass);",
"AbstractClassMetaData getMetaDataForClass(Class cls, PackageMetaData pmd, ClassLoaderResolver clr);",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"public synchronized MetadataModel<WebAppMetadata> getAnnotationMetadataModel() {\n if (webAppAnnMetadataModel == null) {\n FileObject ddFO = getDeploymentDescriptor();\n File ddFile = ddFO != null ? FileUtil.toFile(ddFO) : null;\n ProjectSourcesClassPathProvider cpProvider = project.getLookup().lookup(ProjectSourcesClassPathProvider.class);\n\n MetadataUnit metadataUnit = MetadataUnit.create(\n cpProvider.getProjectSourcesClassPath(ClassPath.BOOT),\n cpProvider.getProjectSourcesClassPath(ClassPath.COMPILE),\n cpProvider.getProjectSourcesClassPath(ClassPath.SOURCE),\n // XXX: add listening on deplymentDescriptor\n ddFile);\n webAppAnnMetadataModel = WebAppMetadataModelFactory.createMetadataModel(metadataUnit, false);\n }\n return webAppAnnMetadataModel;\n }",
"public A annotation() {\n\t\treturn proxy(annotation, loader, className, map);\n\t}",
"@Test\n public void test01()\n {\n MetaClass.forClass(Class, reflectorFactory)\n }",
"<KEY extends MetadataKey<VALUE>, VALUE> boolean hasMetadata(Class<KEY> keyClass) throws IllegalArgumentException;",
"@Internal\n @NonNull\n AbstractAnnotationMetadataBuilder<?, ?> getAnnotationMetadataBuilder();",
"public void testClassAnnotation() {\r\n TestHelper.assertClassAnnotation(ConfluenceManagementServiceLocal.class, Local.class);\r\n }",
"public interface AnnotationValue {\n}",
"public abstract AnnotationCollector mo30681b(Annotation annotation);",
"<KEY extends MetadataKey<VALUE>, VALUE> VALUE getMetadata(Class<KEY> keyClass) throws IllegalArgumentException;",
"private static FieldTypePair getAnnotatedFieldIfPresent(final Class clazz, Class<? extends Annotation> annotationClass) {\n for (final FieldTypePair fieldTypePair : getDeclaredAndInheritedFieldTypePairs(clazz, true)) {\n Field field = fieldTypePair.getField();\n if (field.isAnnotationPresent(annotationClass)) {\n return fieldTypePair;\n }\n }\n return null;\n }",
"public interface Framework_annotation<T extends Annotation> {\n \n // a builder call which returns the original Framework object\n public Framework_annotation<T> build_normal();\n \n // a builder call which requires that the T be of type Annotation or a subtype of that\n public Framework_annotation<T> build_annotation();\n \n // a call which returns a T element\n public <U extends T> U get();\n \n \n}",
"private void getAnnotatedClass(Class<? extends Annotation> annotation, final Element element) {\n TypeElement typeElement = (TypeElement) element.getEnclosingElement();\n// String fullName = typeElement.getQualifiedName().toString();\n Map<Class<? extends Annotation>, List<Element>> classListMap = mAnnotation.get(typeElement);\n if (classListMap == null) {\n classListMap = new HashMap<>();\n ArrayList<Element> elements=new ArrayList<>();\n elements.add(element);\n classListMap.put(annotation,elements);\n mAnnotation.put(typeElement, classListMap);\n } else {\n List<Element> elements = classListMap.get(annotation);\n if (elements == null) {\n elements = new ArrayList<>();\n elements.add(element);\n classListMap.put(annotation,elements);\n mAnnotation.put(typeElement, classListMap);\n } else\n mAnnotation.get(typeElement).get(annotation).add(element);\n }\n\n// log(annotationList.size() + \"fdas\");\n }",
"@SuppressWarnings(\"unchecked\")\n private <T extends Annotation> Class<T> getLoadedClassFor(final Class<T> clazz) {\n try {\n return (Class<T>) classLoader.loadClass(clazz.getName());\n } catch (final ClassNotFoundException ex) {\n throw new IllegalStateException(\"Could not find class \" + clazz, ex);\n }\n }",
"com.google.cloud.datalabeling.v1beta1.AnnotationMetadataOrBuilder\n getAnnotationMetadataOrBuilder();",
"com.google.dataflow.v1beta3.RuntimeMetadata getRuntimeMetadata();",
"public interface CoreAnnotationProcessorEnv\n{\n /** Map of String -> String */\n Map getOptions();\n\n Messager getMessager();\n\n Filer getFiler();\n\n TypeDeclaration[] getSpecifiedTypeDeclarations();\n\n TypeDeclaration getTypeDeclaration( String s );\n\n Declaration[] getDeclarationsAnnotatedWith( AnnotationTypeDeclaration annotationTypeDeclaration );\n \n void setAttribute( String propertyName, Object value );\n \n Object getAttribute( String propertyName );\n}",
"public abstract Annotations mo30682c();",
"Set<? extends Class<? extends Annotation>> annotations();",
"void addAnnotatedClass( Class clazz );",
"DatastoreMetadataFactory<EntityMetadata, Discriminator> getMetadataFactory();",
"@Override\n public Class<? extends Metadata> getMetadataType() {\n throw new RuntimeException( \"Not yet implemented.\" );\n }",
"HxAnnotated<?> createAnnotated();",
"com.google.cloud.compute.v1.Metadata getMetadata();",
"public ClassInfo declaringClass();",
"private Metadata getMetadata(RubyModule type) {\n for (RubyModule current = type; current != null; current = current.getSuperClass()) {\n Metadata metadata = (Metadata) current.getInternalVariable(\"metadata\");\n \n if (metadata != null) return metadata;\n }\n \n return null;\n }",
"@org.junit.Test(timeout = 10000)\n public void annotated_cf11() {\n com.squareup.javapoet.TypeName simpleString = com.squareup.javapoet.TypeName.get(java.lang.String.class);\n org.junit.Assert.assertFalse(simpleString.isAnnotated());\n org.junit.Assert.assertEquals(simpleString, com.squareup.javapoet.TypeName.get(java.lang.String.class));\n com.squareup.javapoet.TypeName annotated = simpleString.annotated(NEVER_NULL);\n org.junit.Assert.assertTrue(annotated.isAnnotated());\n // AssertGenerator replace invocation\n boolean o_annotated_cf11__11 = // StatementAdderMethod cloned existing statement\n annotated.isBoxedPrimitive();\n // AssertGenerator add assertion\n org.junit.Assert.assertFalse(o_annotated_cf11__11);\n org.junit.Assert.assertEquals(annotated, annotated.annotated());\n }",
"public interface MetadataGenerator\n{\n\n /**\n * Prepares the generator to transform artifacts.\n * \n * @param artifacts The artifacts to install/deploy, must not be {@code null}.\n * @return The metadata to process (e.g. merge with existing metadata) before artifact transformations, never\n * {@code null}.\n */\n Collection<? extends Metadata> prepare( Collection<? extends Artifact> artifacts );\n\n /**\n * Enables the metadata generator to transform the specified artifact.\n * \n * @param artifact The artifact to transform, must not be {@code null}.\n * @return The transformed artifact (or just the input artifact), never {@code null}.\n */\n Artifact transformArtifact( Artifact artifact );\n\n /**\n * Allows for metadata generation based on the transformed artifacts.\n * \n * @param artifacts The (transformed) artifacts to install/deploy, must not be {@code null}.\n * @return The additional metadata to process after artifact transformations, never {@code null}.\n */\n Collection<? extends Metadata> finish( Collection<? extends Artifact> artifacts );\n\n}",
"public AnnotationMirror getAnnotation(Class<? extends Annotation> annotation) {\n\t\tString jvmName = ClassUtils.getJVMName(annotation);\n\t\tfor(AnnotationMirror a : getAnnotations()) {\n\t\t\tif(a.getType().getJVMName().equals(jvmName)) {\n\t\t\t\treturn a;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"@Override\n\tpublic void annotate(JDefinedClass cls) {\n\n\t}",
"@BeforeAll\n public static void beforeClass() {\n scanResult = new ClassGraph()\n .acceptPackages(RetentionPolicyForFunctionParameterAnnotationsTest.class.getPackage().getName())\n .enableAllInfo().scan();\n classInfo = scanResult.getClassInfo(RetentionPolicyForFunctionParameterAnnotationsTest.class.getName());\n }",
"public String metadataClass() {\n return this.metadataClass;\n }",
"Object getMetadata(String key);",
"private boolean isAnnotationPresent(Annotation[] annotations,\n Class<? extends Annotation> cls) {\n for (Annotation annotation : annotations) {\n if (cls.isInstance(annotation)) {\n return true;\n }\n }\n return false;\n }",
"@java.lang.SuppressWarnings({\"ReferenceEquality\"})\n private void mergeMetadata(org.chromium.components.paint_preview.common.proto.PaintPreview.MetadataProto value) {\n value.getClass();\n if (metadata_ != null &&\n metadata_ != org.chromium.components.paint_preview.common.proto.PaintPreview.MetadataProto.getDefaultInstance()) {\n metadata_ =\n org.chromium.components.paint_preview.common.proto.PaintPreview.MetadataProto.newBuilder(metadata_).mergeFrom(value).buildPartial();\n } else {\n metadata_ = value;\n }\n bitField0_ |= 0x00000002;\n }",
"public boolean hasAnnotation(Class<?> aTargetClass, String aFqNameToLookfor) {\n\t\treturn AnnotationsHelper.getAnnotation(aTargetClass, aFqNameToLookfor) != null;\n\t}",
"@Nullable\n @Generated\n @Selector(\"metadata\")\n public native NSDictionary<?, ?> metadata();",
"InstrumentedType withAnnotations(List<? extends AnnotationDescription> annotationDescriptions);",
"Metadata getMetaData();",
"@rdf(FOAF.SPATIALTHING)\npublic interface SpatialThing extends Thing {\n}",
"public abstract Object getMetadata(String key);",
"public interface AnnotationAccess\n{\n /**\n * Returns a provider for annotations on the service class and interface. This will reflect annotations defined by\n * the implementation class itself, plus annotations defined by the service interface (implementation class\n * annotations take precedence).\n * @return an AnnotationProvider instance.\n */\n AnnotationProvider getClassAnnotationProvider();\n\n /**\n * Returns a provider for annotations of a method of the class. This includes annotations on\n * the implementation method, plus annotations on the corresponding service interface method\n * (if such a method exists), with precedence on the implementation class method annotations.\n * @param methodName the name of the method.\n * @param parameterTypes the types of the parameters of the method.\n * @return an AnnotationProvider instance. * \n */\n AnnotationProvider getMethodAnnotationProvider(String methodName, Class... parameterTypes);\n\n}",
"default @org.jetbrains.annotations.Nullable imports.k8s.ObjectMeta getMetadata() {\n return null;\n }",
"boolean hasMetadataFields();",
"public void testFullyQualified(){ \n // when I do this, I need to change the regex as EITHER\n // \n $anno $a = $anno.of(R.class);\n \n @draft.java.proto.SannoTest.R\n class C{} \n _class _c = _class.of(C.class); \n assertNotNull( $a.firstIn(_c) );\n \n @R\n class D{} \n _class _d = _class.of(D.class); \n assertNotNull( $a.firstIn(_d) ); \n }",
"public interface KClass<T> extends KDeclarationContainer, KAnnotatedElement {\n}",
"public interface BuildMetadata {\n File getWorkingDirectory();\n\n BuildCommands getBuildCommands();\n}",
"public static String getRuntimeMetadata() {\n StringBuilder s = new StringBuilder();\n String version;\n\n version = kotlinVersion();\n if (version != null) {\n s.append(\",kt=\").append(version);\n }\n\n version = scalaVersion();\n if (version != null) {\n s.append(\",sc=\").append(version);\n }\n\n version = clojureVersion();\n if (version != null) {\n s.append(\",clj=\").append(version);\n }\n\n version = groovyVersion();\n if (version != null) {\n s.append(\",gy=\").append(version);\n }\n\n version = jRubyVersion();\n if (version != null) {\n s.append(\",jrb=\").append(version);\n }\n\n return s.toString();\n }",
"public ClassAnnotationMetaDataFilter(Class<?> anno) {\n this(new Class[]{ anno });\n }",
"public static Map<String, String> annotations(HasMetadata resource) {\n return annotations(resource.getMetadata());\n }",
"@Override\n\tpublic Set<Class<? extends CoreAnnotation>> requires() {\n\t\tArraySet<Class<? extends CoreAnnotation<?>>> set = new ArraySet<Class<? extends CoreAnnotation<?>>>();\n\t\tif (heat != null && Evaluators.contains(heat)) {\n\t\t\tset.add(MusicalHeatScoreAnnotation.class);\n\t\t\tset.add(MusicalHeatAnnotation.class);\n\t\t}\n\t\tif (musicentity != null && Evaluators.contains(musicentity)) {\n\t\t\tset.add(MusicalEntityAnnotation.class);\n\t\t}\n\t\treturn Collections.unmodifiableSet(set);\n\t}",
"public Class<? extends Annotation> annotationType() {\n\t\treturn null;\r\n\t}",
"public interface AnnotatedBindingBuilder\n extends LinkedBindingBuilder\n{\n\n public abstract LinkedBindingBuilder annotatedWith(Class class1);\n\n public abstract LinkedBindingBuilder annotatedWith(Annotation annotation);\n}",
"@InputFile\n @Incremental\n @PathSensitive(PathSensitivity.NAME_ONLY)\n @Optional\n public abstract RegularFileProperty getAppMetadata();",
"@MyFirstAnnotation(name = \"Tom\")\n public void someMethod() {\n\n }",
"@org.junit.Test(timeout = 10000)\n public void annotated_cf3() {\n com.squareup.javapoet.TypeName simpleString = com.squareup.javapoet.TypeName.get(java.lang.String.class);\n org.junit.Assert.assertFalse(simpleString.isAnnotated());\n org.junit.Assert.assertEquals(simpleString, com.squareup.javapoet.TypeName.get(java.lang.String.class));\n com.squareup.javapoet.TypeName annotated = simpleString.annotated(NEVER_NULL);\n org.junit.Assert.assertTrue(annotated.isAnnotated());\n // StatementAdderOnAssert create null value\n java.lang.Object vc_2 = (java.lang.Object)null;\n // AssertGenerator add assertion\n org.junit.Assert.assertNull(vc_2);\n // AssertGenerator replace invocation\n boolean o_annotated_cf3__13 = // StatementAdderMethod cloned existing statement\n annotated.equals(vc_2);\n // AssertGenerator add assertion\n org.junit.Assert.assertFalse(o_annotated_cf3__13);\n org.junit.Assert.assertEquals(annotated, annotated.annotated());\n }",
"boolean hasAnnotationValue();",
"<T extends Annotation> IList<Object> getAnnotatedObjects(Class<T> type);",
"private void setMetadata(org.chromium.components.paint_preview.common.proto.PaintPreview.MetadataProto value) {\n value.getClass();\n metadata_ = value;\n bitField0_ |= 0x00000002;\n }",
"default void onPreConstruct(@Nonnull A annotation, @Nonnull Class<? extends C> type) {\n }",
"public boolean hasAnnotation(Class<?> aTargetClass, Class<?> aAnnotation) {\n\t\treturn AnnotationsHelper.getAnnotation(aTargetClass, aAnnotation) != null;\n\t}",
"<E extends CtElement> E putMetadata(String key, Object val);",
"public abstract AnnotationMap mo30683d();",
"public interface Annotation {\n\t\n\t/** Return the unique ID associated with the annotation */\n\tpublic String getId();\n\n\t/** Return the type of the annotation (such as \"laughter\", \"speaker\") according to Alveo */\n\tpublic String getType();\n\n\t/** Return the label assigned to the annotation\n\t */\n\tpublic String getLabel();\n\n\t/** Return the start offset of the annotation\n\t */\n\tpublic double getStart();\n\n\t/** Return the end offset of the annotation\n\t */\n\tpublic double getEnd();\n\n\t/** Return the <a href=\"http://www.w3.org/TR/json-ld/#typed-values\">JSON-LD value type</a>\n\t */\n\tpublic String getValueType();\n\n\t/** Return a mapping containing URIs as keys corresponding to fields, and their matching values\n\t * This is used for converting to and from JSON\n\t *\n\t * The URIs correspond to JSON-LD URIs and therefore also to RDF predicate URIs on the server side\n\t *\n\t * @return a URI to value mapping\n\t */\n\tpublic Map<String, Object> uriToValueMap();\n\n\tpublic Document getAnnotationTarget();\n\n\n}",
"public interface SourceAnnotation {\n\n void annotate(AnnotationHolder holder, Document document, int sourceOffset);\n\n}",
"public abstract boolean mo30680a(Annotation annotation);",
"public abstract Class resolveClass(GenerationContext context);",
"@Test\n public void canDetect_ParameterAnnotation_OneRuntimeRetention_OneClassRetention() {\n final MethodInfo methodInfo = classInfo.getMethodInfo()\n .getSingleMethod(\"oneRuntimeRetention_OneClassRetention\");\n\n assertThat(methodInfo.hasParameterAnnotation(ParamAnnoRuntime.class)).isTrue();\n }"
] | [
"0.60237104",
"0.57904065",
"0.5704965",
"0.5649695",
"0.54457766",
"0.5425865",
"0.5377084",
"0.53655654",
"0.535153",
"0.53298676",
"0.5322335",
"0.52947694",
"0.5292114",
"0.5198837",
"0.51944953",
"0.51411265",
"0.51411265",
"0.51411265",
"0.51411265",
"0.51411265",
"0.51411265",
"0.51411265",
"0.51411265",
"0.51411265",
"0.51411265",
"0.51411265",
"0.51411265",
"0.51411265",
"0.51411265",
"0.51411265",
"0.51411265",
"0.51411265",
"0.51411265",
"0.5112746",
"0.51079774",
"0.5096632",
"0.50346565",
"0.5016394",
"0.49991354",
"0.49704763",
"0.4969473",
"0.49276778",
"0.49027967",
"0.48982072",
"0.48871392",
"0.48716187",
"0.48609737",
"0.48511946",
"0.48480657",
"0.48479134",
"0.48403552",
"0.48250982",
"0.4786024",
"0.4760944",
"0.47605926",
"0.47591922",
"0.47567648",
"0.47349542",
"0.47297132",
"0.47266307",
"0.47243893",
"0.47034496",
"0.46699053",
"0.4666795",
"0.46583712",
"0.46444836",
"0.46363842",
"0.46218365",
"0.46158114",
"0.46097744",
"0.46075675",
"0.46025732",
"0.45982006",
"0.4592258",
"0.4590297",
"0.45888105",
"0.45882013",
"0.4587411",
"0.45814046",
"0.4575755",
"0.45744798",
"0.4565553",
"0.45648044",
"0.45640734",
"0.45587054",
"0.45567217",
"0.45516452",
"0.45492348",
"0.45489642",
"0.45345214",
"0.4533128",
"0.4528022",
"0.45197594",
"0.45168653",
"0.45070654",
"0.4490243",
"0.4485087",
"0.44817734",
"0.4479671",
"0.4467322"
] | 0.608572 | 0 |
Annotation methods can't have their own annotations so there's nowhere for us to discover | private ImmutableSet<Property> annotationBuilderPropertySet(TypeElement annotationType) {
Nullables nullables = Nullables.fromMethods(processingEnv, ImmutableList.of());
// Translate the annotation elements into fake Property instances. We're really only interested
// in the name and type, so we can use them to declare a parameter of the generated
// @AutoAnnotation method. We'll generate a parameter for every element, even elements that
// don't have setters in the builder. The generated builder implementation will pass the default
// value from the annotation to those parameters.
return methodsIn(annotationType.getEnclosedElements()).stream()
.filter(m -> m.getParameters().isEmpty() && !m.getModifiers().contains(Modifier.STATIC))
.map(method -> annotationBuilderProperty(method, nullables))
.collect(toImmutableSet());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract Annotations mo30682c();",
"@Override\n public void visit(Tree.AnnotationList al) {\n }",
"@MyFirstAnnotation(name = \"Tom\")\n public void someMethod() {\n\n }",
"Set<Class<? extends Annotation>> getScanMethodAnnotations();",
"public abstract boolean mo30680a(Annotation annotation);",
"public interface AnnotationAccess\n{\n /**\n * Returns a provider for annotations on the service class and interface. This will reflect annotations defined by\n * the implementation class itself, plus annotations defined by the service interface (implementation class\n * annotations take precedence).\n * @return an AnnotationProvider instance.\n */\n AnnotationProvider getClassAnnotationProvider();\n\n /**\n * Returns a provider for annotations of a method of the class. This includes annotations on\n * the implementation method, plus annotations on the corresponding service interface method\n * (if such a method exists), with precedence on the implementation class method annotations.\n * @param methodName the name of the method.\n * @param parameterTypes the types of the parameters of the method.\n * @return an AnnotationProvider instance. * \n */\n AnnotationProvider getMethodAnnotationProvider(String methodName, Class... parameterTypes);\n\n}",
"boolean hasExplicitAnnotation();",
"boolean hasExplicitAnnotation();",
"@Word(word = \"First\", value = 1) \n\t public static void newMethod(){ \n\t\t FullAnnotationProgram obj = new FullAnnotationProgram(); \n\n\t try{ \n\t Class<?> c = obj.getClass(); \n\n\t // Obtain the annotation for newMethod \n\t Method m = c.getMethod(\"newMethod\"); \n\t \n\t // Display the full annotation \n\t Annotation anno = m.getAnnotation(CustomRepeatAnnots.class); \n\t System.out.println(anno); \n\t }catch (NoSuchMethodException e){ \n\t System.out.println(e); \n\t } \n\t }",
"public abstract AnnotationCollector mo30681b(Annotation annotation);",
"private void readMethodsAnnotations() {\n Method[] methods = clazz.getDeclaredMethods();\n for (Method method : methods) {\n Annotation[] annotations = method.getDeclaredAnnotations();\n for (Annotation a : annotations) {\n Class<? extends Annotation> aType = a.annotationType();\n List<Entry<Annotation>> list = entries.get(aType);\n if (list == null) {\n list = new ArrayList();\n entries.put(aType, list);\n }\n list.add(new Entry<>(method, a));\n }\n }\n }",
"public abstract AnnotationMap mo30683d();",
"public String getAnnotation();",
"public Framework_annotation<T> build_annotation();",
"@Test\n public void canDetect_ParameterAnnotation_OneRuntimeRetention_OneClassRetention_ChangedAnnotationOrder() {\n final MethodInfo methodInfo = classInfo.getMethodInfo()\n .getSingleMethod(\"oneRuntimeRetention_OneClassRetention_ChangedAnnotationOrder\");\n\n assertThat(methodInfo.hasParameterAnnotation(ParamAnnoRuntime.class)).isTrue();\n }",
"Annotation getAnnotation();",
"private AnnotationTarget() {\n void var2_-1;\n void var1_-1;\n }",
"boolean hasAnnotationMetadata();",
"public interface SourceAnnotation {\n\n void annotate(AnnotationHolder holder, Document document, int sourceOffset);\n\n}",
"public abstract Annotations getClassAnnotations();",
"Set<? extends Class<? extends Annotation>> annotations();",
"@MyAnnotation(\"abc\")\r\n\t@Override\r\n\tpublic String perform(String arg1) {\n\t\treturn \"hello \";\r\n\t}",
"@Override\r\n\tpublic Annotation annotate() {\n\t\treturn null;\r\n\t}",
"@Override\n\tpublic void annotate(JDefinedClass cls) {\n\n\t}",
"static List<Method> getAnnotatedMethodsList(Class<? extends Annotation> annotationClassName, Method[] methods) {\n List<Method> annotatedMethodsList = new ArrayList<>();\n\n for (Method method : methods) {\n if (method.isAnnotationPresent(annotationClassName)) {\n annotatedMethodsList.add(method);\n }\n }\n\n if (annotatedMethodsList.isEmpty()) {\n log.error(\"No annotiated @{} methods found !\", annotationClassName);\n return null;\n }\n\n return annotatedMethodsList;\n }",
"@Test\n public void canDetect_TwoAnnotations_WithRuntimeRetention_ForSingleParam() {\n final MethodInfo methodInfo = classInfo.getMethodInfo()\n .getSingleMethod(\"twoAnnotations_WithRuntimeRetention_ForSingleParam\");\n\n assertThat(methodInfo.hasParameterAnnotation(ParamAnnoRuntime.class)).isTrue();\n\n assertThat(methodInfo.hasParameterAnnotation(SecondParamAnnoRuntime.class)).isTrue();\n }",
"@Override\n\tpublic Annotation[] getAnnotations() {\n\t\treturn null;\n\t}",
"@Test\n public void canDetect_ParameterAnnotation_OneRuntimeRetention_OneSourceRetention() {\n final MethodInfo methodInfo = classInfo.getMethodInfo()\n .getSingleMethod(\"oneRuntimeRetention_OneSourceRetention\");\n\n assertThat(methodInfo.hasParameterAnnotation(ParamAnnoRuntime.class)).isTrue();\n }",
"public JavaAnnotation getAnnotation( String name );",
"java.util.List<org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall> \n getAnnotationList();",
"@Test\n public void canDetect_ParameterAnnotation_OneRuntimeRetention_OneClassRetention() {\n final MethodInfo methodInfo = classInfo.getMethodInfo()\n .getSingleMethod(\"oneRuntimeRetention_OneClassRetention\");\n\n assertThat(methodInfo.hasParameterAnnotation(ParamAnnoRuntime.class)).isTrue();\n }",
"default void onDiscovery(@Nonnull A annotation, @Nonnull Class<? extends C> type) {\n }",
"@MyFirstAnnotation(name=\"tom\",description=\"write by tom\")\n\tpublic UsingMyFirstAnnotation(){\n\t\t\n\t}",
"@Override\n\tpublic Annotation[] getDeclaredAnnotations() {\n\t\treturn null;\n\t}",
"public Framework_annotation<T> build_normal();",
"public List<J.Annotation> getAllAnnotations() {\n List<Annotation> allAnnotations = new ArrayList<>(leadingAnnotations);\n for (J.Modifier modifier : modifiers) {\n allAnnotations.addAll(modifier.getAnnotations());\n }\n if (typeParameters != null) {\n allAnnotations.addAll(typeParameters.getAnnotations());\n }\n if (returnTypeExpression instanceof AnnotatedType) {\n allAnnotations.addAll(((AnnotatedType) returnTypeExpression).getAnnotations());\n }\n allAnnotations.addAll(name.getAnnotations());\n return allAnnotations;\n }",
"AnnotationProvider getClassAnnotationProvider();",
"Set<Class<? extends Annotation>> getScanTypeAnnotations();",
"@Test\n public void canDetect_ParameterAnnotation_WithRuntimeRetention() {\n final MethodInfo methodInfo = classInfo.getMethodInfo()\n .getSingleMethod(\"parameterAnnotation_WithRuntimeRetention\");\n\n assertThat(methodInfo.hasParameterAnnotation(ParamAnnoRuntime.class)).isTrue();\n }",
"Annotation createAnnotation();",
"Annotation createAnnotation();",
"@Override\n public String visit(AnnotationDeclaration n, Object arg) {\n return null;\n }",
"public interface AnnotationValue {\n}",
"protected boolean hasAnnotation(MethodInvocation invocation, Class<? extends Annotation> annoType) {\n if (hasAnnotationOnClass(invocation, annoType)) {\n return true;\n }\n if (hasAnnotationOnMethod(invocation, annoType)) {\n return true;\n }\n return false;\n }",
"@org.junit.Test(timeout = 10000)\n public void annotatedTwice_cf16426() {\n java.lang.String expected = (\"@\" + (com.squareup.javapoet.AmplAnnotatedTypeNameTest.NN)) + \" @java.lang.Override java.lang.String\";\n com.squareup.javapoet.TypeName type = com.squareup.javapoet.TypeName.get(java.lang.String.class);\n java.lang.String actual = type.annotated(NEVER_NULL).annotated(com.squareup.javapoet.AnnotationSpec.builder(java.lang.Override.class).build()).toString();\n // AssertGenerator replace invocation\n boolean o_annotatedTwice_cf16426__10 = // StatementAdderMethod cloned existing statement\n type.isBoxedPrimitive();\n // AssertGenerator add assertion\n org.junit.Assert.assertFalse(o_annotatedTwice_cf16426__10);\n org.junit.Assert.assertEquals(expected, actual);\n }",
"Set<String> annotations();",
"DataMap getCustomAnnotations();",
"public boolean isAnnotation() {\n return cut.isAnnotation();\n }",
"BasicRestAnnotation() {\n\t}",
"public interface RawAnnotationSet<V> extends ReadableAnnotationSet<V> {\n\n /**\n * @see NindoCursor#begin()\n */\n void begin();\n\n /**\n * @see NindoCursor#finish()\n */\n void finish();\n\n /**\n * Content has been inserted into the document being annotated\n *\n * @param insertSize\n */\n void insert(int insertSize);\n\n String getInherited(String key);\n\n /**\n * Content has been removed from the document being annotated\n *\n * @param deleteSize\n */\n void delete(int deleteSize);\n\n /**\n */\n void skip(int skipSize);\n\n /**\n * @see ModifiableDocument#startAnnotation(String, String)\n */\n void startAnnotation(String key, V value);\n\n /**\n * @see ModifiableDocument#endAnnotation(String)\n */\n void endAnnotation(String key);\n\n /**\n * @return a live updated set of the known keys\n */\n ReadableStringSet knownKeysLive();\n\n public abstract class AnnotationEvent {\n final int index;\n final String key;\n\n private AnnotationEvent(int index, String key) {\n this.index = index;\n this.key = key;\n }\n\n abstract String getChangeKey();\n abstract String getChangeOldValue();\n abstract String getEndKey();\n }\n\n public final class AnnotationStartEvent extends AnnotationEvent {\n final String value;\n AnnotationStartEvent(int index, String key, String value) {\n super(index, key);\n// assert !Annotations.isLocal(key);\n this.value = value;\n }\n\n @Override\n String getChangeKey() {\n return key;\n }\n\n @Override\n String getChangeOldValue() {\n return value;\n }\n\n @Override\n String getEndKey() {\n return null;\n }\n\n @Override\n public String toString() {\n return \"AnnotationStart \" + key + \"=\" + value + \" @\" + index;\n }\n }\n\n public final class AnnotationEndEvent extends AnnotationEvent {\n AnnotationEndEvent(int index, String key) {\n super(index, key);\n }\n\n\n @Override\n String getChangeKey() {\n return null;\n }\n\n @Override\n String getChangeOldValue() {\n return null;\n }\n\n @Override\n String getEndKey() {\n return key;\n }\n\n @Override\n public String toString() {\n return \"AnnotationEndEvent \" + key + \" @\" + index;\n }\n }\n\n}",
"@PropertyGetter(role = ANNOTATION)\n\tList<CtAnnotation<? extends Annotation>> getAnnotations();",
"public interface Annotation {\n\t\n\t/** Return the unique ID associated with the annotation */\n\tpublic String getId();\n\n\t/** Return the type of the annotation (such as \"laughter\", \"speaker\") according to Alveo */\n\tpublic String getType();\n\n\t/** Return the label assigned to the annotation\n\t */\n\tpublic String getLabel();\n\n\t/** Return the start offset of the annotation\n\t */\n\tpublic double getStart();\n\n\t/** Return the end offset of the annotation\n\t */\n\tpublic double getEnd();\n\n\t/** Return the <a href=\"http://www.w3.org/TR/json-ld/#typed-values\">JSON-LD value type</a>\n\t */\n\tpublic String getValueType();\n\n\t/** Return a mapping containing URIs as keys corresponding to fields, and their matching values\n\t * This is used for converting to and from JSON\n\t *\n\t * The URIs correspond to JSON-LD URIs and therefore also to RDF predicate URIs on the server side\n\t *\n\t * @return a URI to value mapping\n\t */\n\tpublic Map<String, Object> uriToValueMap();\n\n\tpublic Document getAnnotationTarget();\n\n\n}",
"@Override\n public String getAnnotation() {\n return annotation;\n }",
"public A annotation() {\n\t\treturn proxy(annotation, loader, className, map);\n\t}",
"public interface Annotator {\n\n\t/**\n\t * @param pamDataBlock Annotated datablock\n\t * @return the number of annotations\n\t */\n\tpublic int getNumAnnotations(PamDataBlock pamDataBlock);\n\t\n\t/**\n\t * Get an Annotation\n\t * @param pamDataBlock Annotated datablock\n\t * @param iAnnotation annotation number\n\t * @return Annotation\n\t */\n\tpublic Annotation getAnnotation(PamDataBlock pamDataBlock, int iAnnotation);\n}",
"public static void main(String[] args) {\n\n Annotation[] annotations1 = B.class.getAnnotations();\n }",
"@org.junit.Test(timeout = 10000)\n public void annotatedTwice_cf16419() {\n java.lang.String expected = (\"@\" + (com.squareup.javapoet.AmplAnnotatedTypeNameTest.NN)) + \" @java.lang.Override java.lang.String\";\n com.squareup.javapoet.TypeName type = com.squareup.javapoet.TypeName.get(java.lang.String.class);\n java.lang.String actual = type.annotated(NEVER_NULL).annotated(com.squareup.javapoet.AnnotationSpec.builder(java.lang.Override.class).build()).toString();\n // StatementAdderOnAssert create random local variable\n java.lang.Object vc_7131 = new java.lang.Object();\n // AssertGenerator replace invocation\n boolean o_annotatedTwice_cf16419__12 = // StatementAdderMethod cloned existing statement\n type.equals(vc_7131);\n // AssertGenerator add assertion\n org.junit.Assert.assertFalse(o_annotatedTwice_cf16419__12);\n org.junit.Assert.assertEquals(expected, actual);\n }",
"InstrumentedType withAnnotations(List<? extends AnnotationDescription> annotationDescriptions);",
"public boolean hasAnnotation(Method aMethod, String aFqNameToLookfor) {\n\t\treturn AnnotationsHelper.getAnnotation(aMethod, aFqNameToLookfor) != null;\n\t}",
"private AnnotatedTypes() { throw new AssertionError(\"Class AnnotatedTypes cannot be instantiated.\");}",
"String[] getSupportedAnnotationPackages();",
"@org.junit.Test(timeout = 10000)\n public void annotatedTwice_cf16418() {\n java.lang.String expected = (\"@\" + (com.squareup.javapoet.AmplAnnotatedTypeNameTest.NN)) + \" @java.lang.Override java.lang.String\";\n com.squareup.javapoet.TypeName type = com.squareup.javapoet.TypeName.get(java.lang.String.class);\n java.lang.String actual = type.annotated(NEVER_NULL).annotated(com.squareup.javapoet.AnnotationSpec.builder(java.lang.Override.class).build()).toString();\n // StatementAdderOnAssert create null value\n java.lang.Object vc_7130 = (java.lang.Object)null;\n // AssertGenerator add assertion\n org.junit.Assert.assertNull(vc_7130);\n // AssertGenerator replace invocation\n boolean o_annotatedTwice_cf16418__12 = // StatementAdderMethod cloned existing statement\n type.equals(vc_7130);\n // AssertGenerator add assertion\n org.junit.Assert.assertFalse(o_annotatedTwice_cf16418__12);\n org.junit.Assert.assertEquals(expected, actual);\n }",
"boolean hasMessageAnnotation();",
"org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall getAnnotation(int index);",
"public interface AnnotationReader\r\n{\r\n /**\r\n * Accessor for the annotations packages supported by this reader.\r\n * @return The annotations packages that will be processed.\r\n */\r\n String[] getSupportedAnnotationPackages();\r\n\r\n /**\r\n * Method to get the MetaData for a class from its annotations.\r\n * @param cls The class\r\n * @param pmd MetaData for the owning package (that this will be a child of)\r\n * @param clr ClassLoader resolver\r\n * @return The ClassMetaData (unpopulated and uninitialised)\r\n */\r\n AbstractClassMetaData getMetaDataForClass(Class cls, PackageMetaData pmd, ClassLoaderResolver clr);\r\n\r\n /**\r\n * Method to return whether this is reading in a persistence context.\r\n * @return Whether this is a persistence context\r\n */\r\n boolean isPersistenceContext();\r\n}",
"public final void annotations() throws RecognitionException {\n int annotations_StartIndex = input.index();\n try { dbg.enterRule(getGrammarFileName(), \"annotations\");\n if ( getRuleLevel()==0 ) {dbg.commence();}\n incRuleLevel();\n dbg.location(527, 1);\n\n try {\n if ( state.backtracking>0 && alreadyParsedRule(input, 70) ) { return ; }\n // Java.g:528:5: ( ( annotation )+ )\n dbg.enterAlt(1);\n\n // Java.g:528:9: ( annotation )+\n {\n dbg.location(528,9);\n // Java.g:528:9: ( annotation )+\n int cnt88=0;\n try { dbg.enterSubRule(88);\n\n loop88:\n do {\n int alt88=2;\n try { dbg.enterDecision(88);\n\n int LA88_0 = input.LA(1);\n\n if ( (LA88_0==73) ) {\n int LA88_2 = input.LA(2);\n\n if ( (LA88_2==Identifier) ) {\n int LA88_3 = input.LA(3);\n\n if ( (synpred128_Java()) ) {\n alt88=1;\n }\n\n\n }\n\n\n }\n\n\n } finally {dbg.exitDecision(88);}\n\n switch (alt88) {\n \tcase 1 :\n \t dbg.enterAlt(1);\n\n \t // Java.g:0:0: annotation\n \t {\n \t dbg.location(528,9);\n \t pushFollow(FOLLOW_annotation_in_annotations2704);\n \t annotation();\n\n \t state._fsp--;\n \t if (state.failed) return ;\n\n \t }\n \t break;\n\n \tdefault :\n \t if ( cnt88 >= 1 ) break loop88;\n \t if (state.backtracking>0) {state.failed=true; return ;}\n EarlyExitException eee =\n new EarlyExitException(88, input);\n dbg.recognitionException(eee);\n\n throw eee;\n }\n cnt88++;\n } while (true);\n } finally {dbg.exitSubRule(88);}\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n if ( state.backtracking>0 ) { memoize(input, 70, annotations_StartIndex); }\n }\n dbg.location(529, 5);\n\n }\n finally {\n dbg.exitRule(getGrammarFileName(), \"annotations\");\n decRuleLevel();\n if ( getRuleLevel()==0 ) {dbg.terminate();}\n }\n\n return ;\n }",
"private boolean isAnnotationPresent(Annotation[] annotations,\n Class<? extends Annotation> cls) {\n for (Annotation annotation : annotations) {\n if (cls.isInstance(annotation)) {\n return true;\n }\n }\n return false;\n }",
"protected abstract void runReturnAnnotationHandler();",
"public AnnotationInfoImpl()\n {\n }",
"<T extends Annotation> IList<Object> getAnnotatedObjects(Class<T> type);",
"public interface CoreAnnotationProcessorEnv\n{\n /** Map of String -> String */\n Map getOptions();\n\n Messager getMessager();\n\n Filer getFiler();\n\n TypeDeclaration[] getSpecifiedTypeDeclarations();\n\n TypeDeclaration getTypeDeclaration( String s );\n\n Declaration[] getDeclarationsAnnotatedWith( AnnotationTypeDeclaration annotationTypeDeclaration );\n \n void setAttribute( String propertyName, Object value );\n \n Object getAttribute( String propertyName );\n}",
"public void onScanMethod(Map<Method, Set<Annotation>> methods, Class<?> clazz, Object instance);",
"boolean hasAnnotationValue();",
"public abstract java.lang.Object a ( ) {\n/* .annotation system Ldalvik/annotation/Signature; */\n/* value = { */\n/* \"()TT;\" */\n/* } */\n}",
"private static Set<NullnessAnnotation> findAnnotations(final DetailAST ast) {\n final Set<NullnessAnnotation> result = new HashSet<>();\n\n final DetailAST modifiers = ast.findFirstToken(TokenTypes.MODIFIERS);\n for (DetailAST child = modifiers.getFirstChild(); child != null; child =\n child.getNextSibling()) {\n if (child.getType() == TokenTypes.ANNOTATION) {\n addNextNullnessAnnotation(result, child);\n }\n }\n\n return result;\n }",
"public List<J.Annotation> getAllAnnotations() {\n List<Annotation> allAnnotations = new ArrayList<>(leadingAnnotations);\n for (J.Modifier modifier : modifiers) {\n allAnnotations.addAll(modifier.getAnnotations());\n }\n if (typeExpression != null && typeExpression instanceof J.AnnotatedType) {\n allAnnotations.addAll(((J.AnnotatedType) typeExpression).getAnnotations());\n }\n return allAnnotations;\n }",
"public interface Framework_annotation<T extends Annotation> {\n \n // a builder call which returns the original Framework object\n public Framework_annotation<T> build_normal();\n \n // a builder call which requires that the T be of type Annotation or a subtype of that\n public Framework_annotation<T> build_annotation();\n \n // a call which returns a T element\n public <U extends T> U get();\n \n \n}",
"private Method getAnnotatedJavaMethod(Method javaMethod) {\n if (javaMethod == null) {\n return null;\n }\n final boolean useMethod = checkForJaxRsAnnotations(javaMethod);\n if (useMethod) {\n return javaMethod;\n }\n final Class<?> methodClass = javaMethod.getDeclaringClass();\n final Class<?> superclass = methodClass.getSuperclass();\n final Method scMethod = getMethodFromClass(superclass, javaMethod);\n Method annotatedMeth = getAnnotatedJavaMethod(scMethod);\n if (annotatedMeth != null) {\n return annotatedMeth;\n }\n final Class<?>[] interfaces = methodClass.getInterfaces();\n for (final Class<?> interfaze : interfaces) {\n final Method ifMethod = getMethodFromClass(interfaze, javaMethod);\n annotatedMeth = getAnnotatedJavaMethod(ifMethod);\n if (annotatedMeth != null) {\n return annotatedMeth;\n }\n }\n return null;\n }",
"public List<J.Annotation> getAllAnnotations() {\n List<Annotation> allAnnotations = new ArrayList<>(leadingAnnotations);\n for (J.Modifier modifier : modifiers) {\n allAnnotations.addAll(modifier.getAnnotations());\n }\n allAnnotations.addAll(kind.getAnnotations());\n return allAnnotations;\n }",
"public List<Annotation> getAnnotations() {\n return this.annotations.obtainAll();\n }",
"public void testFullyQualified(){ \n // when I do this, I need to change the regex as EITHER\n // \n $anno $a = $anno.of(R.class);\n \n @draft.java.proto.SannoTest.R\n class C{} \n _class _c = _class.of(C.class); \n assertNotNull( $a.firstIn(_c) );\n \n @R\n class D{} \n _class _d = _class.of(D.class); \n assertNotNull( $a.firstIn(_d) ); \n }",
"@org.junit.Test(timeout = 10000)\n public void annotatedTwice_cf16507_cf17615_failAssert46() {\n // AssertGenerator generate try/catch block with fail statement\n try {\n java.lang.String expected = (\"@\" + (com.squareup.javapoet.AmplAnnotatedTypeNameTest.NN)) + \" @java.lang.Override java.lang.String\";\n com.squareup.javapoet.TypeName type = com.squareup.javapoet.TypeName.get(java.lang.String.class);\n java.lang.String actual = type.annotated(NEVER_NULL).annotated(com.squareup.javapoet.AnnotationSpec.builder(java.lang.Override.class).build()).toString();\n // AssertGenerator replace invocation\n java.lang.String o_annotatedTwice_cf16507__10 = // StatementAdderMethod cloned existing statement\n type.toString();\n // MethodAssertGenerator build local variable\n Object o_12_0 = o_annotatedTwice_cf16507__10;\n // StatementAdderOnAssert create null value\n java.util.Map<javax.lang.model.element.TypeParameterElement, com.squareup.javapoet.TypeVariableName> vc_7680 = (java.util.Map)null;\n // StatementAdderOnAssert create null value\n javax.lang.model.type.TypeMirror vc_7678 = (javax.lang.model.type.TypeMirror)null;\n // StatementAdderOnAssert create null value\n com.squareup.javapoet.TypeName vc_7676 = (com.squareup.javapoet.TypeName)null;\n // StatementAdderMethod cloned existing statement\n vc_7676.get(vc_7678, vc_7680);\n org.junit.Assert.fail(\"annotatedTwice_cf16507_cf17615 should have thrown NullPointerException\");\n } catch (java.lang.NullPointerException eee) {\n }\n }",
"public List<Annotation> getMembers();",
"public interface IJavaAnnotation extends ITextSourceReference {\n \n \t/**\n \t * Returns resource that declares this annotation.\n \t * \n \t * @return resource that declares this annotation\n \t */\n \tpublic IResource getResource();\n \n \t/**\n \t * Returns fully qualified type name if resolved or element name otherwise.\n \t * \n \t * @return fully qualified type name if resolved or element name otherwise\n \t */\n \tpublic String getTypeName();\n \n \t/**\n\t * Returns annotation type or null if it cannot be resolved.\n \t * \n\t * @return annotation type or null if it cannot be resolved\n \t */\n \tpublic IType getType();\n \t/**\n \t * Returns Java element on which or for which this annotation was created.\n \t * \n \t * @return Java element on which or for which this annotation was created\n \t */\n \tpublic IMember getParentMember();\n \n \t/**\n \t * Returns member value pairs as IAnnotation does.\n \t * \n \t * @return member value pairs as IAnnotation does\n \t */\n \tpublic IMemberValuePair[] getMemberValuePairs();\n \n }",
"@org.junit.Test(timeout = 10000)\n public void annotated_cf11() {\n com.squareup.javapoet.TypeName simpleString = com.squareup.javapoet.TypeName.get(java.lang.String.class);\n org.junit.Assert.assertFalse(simpleString.isAnnotated());\n org.junit.Assert.assertEquals(simpleString, com.squareup.javapoet.TypeName.get(java.lang.String.class));\n com.squareup.javapoet.TypeName annotated = simpleString.annotated(NEVER_NULL);\n org.junit.Assert.assertTrue(annotated.isAnnotated());\n // AssertGenerator replace invocation\n boolean o_annotated_cf11__11 = // StatementAdderMethod cloned existing statement\n annotated.isBoxedPrimitive();\n // AssertGenerator add assertion\n org.junit.Assert.assertFalse(o_annotated_cf11__11);\n org.junit.Assert.assertEquals(annotated, annotated.annotated());\n }",
"List<AnnotationPath> findAnnotationPaths( String annotationCannonicalClassName );",
"public final Set<Annotation> annotations() throws RecognitionException {\n Set<Annotation> annotations = null;\n\n\n Annotation annotation201 = null;\n\n try {\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:1219:3: ( ^( I_ANNOTATIONS ( annotation )* ) )\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:1219:5: ^( I_ANNOTATIONS ( annotation )* )\n {\n HashMap<String, Annotation> annotationMap = Maps.newHashMap();\n match(input, I_ANNOTATIONS, FOLLOW_I_ANNOTATIONS_in_annotations3421);\n if (input.LA(1) == Token.DOWN) {\n match(input, Token.DOWN, null);\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:1220:21: ( annotation )*\n loop39:\n while (true) {\n int alt39 = 2;\n int LA39_0 = input.LA(1);\n if ((LA39_0 == I_ANNOTATION)) {\n alt39 = 1;\n }\n\n switch (alt39) {\n case 1:\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:1220:22: annotation\n {\n pushFollow(FOLLOW_annotation_in_annotations3424);\n annotation201 = annotation();\n state._fsp--;\n\n\n Annotation anno = annotation201;\n Annotation old = annotationMap.put(anno.getType(), anno);\n if (old != null) {\n throw new SemanticException(input, \"Multiple annotations of type %s\", anno.getType());\n }\n\n }\n break;\n\n default:\n break loop39;\n }\n }\n\n match(input, Token.UP, null);\n }\n\n\n if (annotationMap.size() > 0) {\n annotations = ImmutableSet.copyOf(annotationMap.values());\n }\n\n }\n\n } catch (RecognitionException re) {\n reportError(re);\n recover(input, re);\n } finally {\n // do for sure before leaving\n }\n return annotations;\n }",
"@Override\n public boolean canFix(Annotation annotation) {\n return false;\n }",
"public Annotation getAnnotation() {\n return annotation;\n }",
"public boolean hasAnnotation(Method aMethod, Class<?> aAnnotation) {\n\t\treturn AnnotationsHelper.getAnnotation(aMethod, aAnnotation) != null;\n\t}",
"public interface Meta {\r\n\r\n\t/**\r\n\t * Lists method names exposed by endpoint.\r\n\t *\r\n\t * @return method name list\r\n\t */\r\n\t@XRMethod(value = \"system.listMethods\", help = \"List all method names available\")\r\n\tList<String> listMethods();\r\n\r\n\t/**\r\n\t * Provides help/usage information for a method.\r\n\t *\r\n\t * @param methodName\r\n\t * name of the method\r\n\t * @return help/usage information for a method\r\n\t */\r\n\t@XRMethod(value = \"system.help\", help = \"Returns usage information for a method\")\r\n\tString help(String methodName);\r\n\r\n\t// @XRMethod(\"system.multicall\")\r\n\t// List multicall(List calls);\r\n\r\n\t/**\r\n\t * Checks if method is supported by endpoint or not.\r\n\t *\r\n\t * @param methodName\r\n\t * name of the method\r\n\t * @return true if method is supported by endpoint, false otherwise\r\n\t */\r\n\t@XRMethod(value = \"system.supports\", help = \"Returns true if method is supported, false otherwise\")\r\n\tboolean supports(String methodName);\r\n}",
"AnnotationProvider getMethodAnnotationProvider(String methodName, Class... parameterTypes);",
"@BeforeAll\n public static void beforeClass() {\n scanResult = new ClassGraph()\n .acceptPackages(RetentionPolicyForFunctionParameterAnnotationsTest.class.getPackage().getName())\n .enableAllInfo().scan();\n classInfo = scanResult.getClassInfo(RetentionPolicyForFunctionParameterAnnotationsTest.class.getName());\n }",
"default List<AnnotationContext<?>> allAnnotations() {\n\n return annotations().stream()\n .flatMap(annotation -> annotation.valueType().<Stream<AnnotationContext<?>>>map(valueType -> {\n if (valueType.isArray()) {\n final TypeContext componentType = valueType.arrayComponentType();\n final AnnotationContext<Repeatable> rep = componentType.annotation(Repeatable.class);\n if (rep != null && rep.value().equals(annotation.annotationType())) {\n final Annotation[] repeated = annotation.value();\n return Arrays.stream(repeated).map(AnnotationContext::new);\n }\n }\n return Stream.of(annotation);\n }).orElseGet(() -> Stream.of(annotation)))\n .collect(Collectors.toList());\n }",
"@Pointcut(\"(@annotation(HasRole) || @within(HasRole))\")\n public void annotated() {\n }",
"public void onScanType(Set<? extends Annotation> annotations, Class<?> clazz, Object instance);",
"@Override\n\tprotected <A extends Annotation> List<A> resolveAnnotations0(\n\t\t\tClass<A> annotationClass, AnnotationLocation location) {\n\t\treturn annotationResolver.resolveAnnotations0(annotationClass, location,\n\t\t\t\tthis::resolveLocationClass);\n\t}",
"@Ignore\n @Test\n public void discoverSeveralTypes() throws Exception {\n }",
"private void findMethods() {\n List<Method> methods = new ArrayList<Method>(Arrays.asList(getObject().getClass().getMethods()));\r\n List<Method> objectMethods = new ArrayList<Method>(Arrays.asList(Object.class.getMethods()));\r\n methods.removeAll(objectMethods);\r\n \r\n for(Method method:methods) {\r\n //does method have @ManagedAttribute annotation?\r\n if(method.isAnnotationPresent(ManagedAttribute.class) || method.isAnnotationPresent(Property.class)) {\r\n exposeManagedAttribute(method);\r\n }\r\n //or @ManagedOperation\r\n else if (method.isAnnotationPresent(ManagedOperation.class) || isMBeanAnnotationPresentWithExposeAll()){\r\n exposeManagedOperation(method); \r\n } \r\n }\r\n }",
"public AnnotationJava[] getAnnotations() {\n\t\treturn annotations;\n\t}",
"@Override\n public void visit(MethodDeclaration n, Object arg) {\n \tArrayList<String> method = new ArrayList<String>();\n \tif(n.getJavaDoc()!=null){\n\t \tmethod.add(n.getName());\n\t \tString comment = n.getJavaDoc().getContent();\n\t \tcomment = comment.replaceAll(\"\\\\* @param (.*)\",\"\");\n\t \tcomment = comment.replaceAll(\"\\\\* @return (.*)\",\"\");\n\t \tcomment = comment.replaceAll(\"\\\\* @throws (.*)\",\"\");\n\t \tcomment = comment.replaceAll(\"\\\\* \",\"\");\n\t \tmethod.add(comment.trim()); \n\t \tmethods.add(method);\n \t}\n \t}"
] | [
"0.7497529",
"0.70457804",
"0.7030071",
"0.69649005",
"0.69520354",
"0.68902415",
"0.6863871",
"0.6863871",
"0.6849924",
"0.68237644",
"0.6785777",
"0.6752066",
"0.6735647",
"0.67178845",
"0.6644885",
"0.6621273",
"0.66162467",
"0.65541697",
"0.65539",
"0.6522109",
"0.6495186",
"0.6459529",
"0.63693917",
"0.63429135",
"0.63421357",
"0.63283575",
"0.63168836",
"0.6315916",
"0.63129354",
"0.6310393",
"0.6258375",
"0.62526584",
"0.62372464",
"0.62361276",
"0.62211764",
"0.62205905",
"0.61842155",
"0.6139697",
"0.61355734",
"0.6132447",
"0.6132447",
"0.6121744",
"0.6108664",
"0.60771745",
"0.6055393",
"0.6051023",
"0.604602",
"0.6037266",
"0.60231525",
"0.6011623",
"0.59734553",
"0.5965755",
"0.59639883",
"0.5954066",
"0.5941823",
"0.5933721",
"0.5933112",
"0.590124",
"0.58987087",
"0.58900326",
"0.58720696",
"0.5871487",
"0.5868101",
"0.586583",
"0.58651143",
"0.58404624",
"0.5835913",
"0.58348244",
"0.5832089",
"0.58246714",
"0.58237016",
"0.5817014",
"0.5815739",
"0.57933575",
"0.5786009",
"0.5785938",
"0.5776358",
"0.577395",
"0.5773596",
"0.5756209",
"0.5749886",
"0.57479644",
"0.57447916",
"0.574245",
"0.57391965",
"0.57313216",
"0.573037",
"0.5729616",
"0.57223856",
"0.57115525",
"0.57090825",
"0.57044965",
"0.57008666",
"0.5700009",
"0.56795037",
"0.5672106",
"0.5671178",
"0.5667375",
"0.56596994",
"0.5650772",
"0.564821"
] | 0.0 | -1 |
List of PSU account that are made available to the TPP | @ApiModelProperty(required = true, value = "List of PSU account that are made available to the TPP ")
@NotNull
@Valid
public List<AccountResource> getAccounts() {
return accounts;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public List<Account> listAccounts() {\n currentCustomer.findAndUpdateAccounts();\n // return list of accounts the customer owns\n return currentCustomer.getAccounts();\n }",
"private void ViewAccounts() {\n for (int k = 0; k < accountList.size(); k++) {\n\n System.out.print(k + \": \" + accountList.get(k) + \" || \");\n\n }\n }",
"public String ListUsers(){\r\n StringBuilder listUsers = new StringBuilder();\r\n for (Utente u: utenti) { // crea la lista degli utenti registrati al servizio\r\n listUsers.append(u.getUsername()).append(\" \");\r\n \tlistUsers.append(u.getStatus()).append(\"\\n\");\r\n }\r\n return listUsers.toString(); \r\n }",
"String getAccountList(int accountId);",
"java.util.List<com.rpg.framework.database.Protocol.User> \n getUsersList();",
"java.util.List<com.rpg.framework.database.Protocol.User> \n getUsersList();",
"public ArrayList<UserDetail> gettingAllAvailableUsers() throws Exception;",
"@Override\r\n\tpublic List getAccountList() {\n\t\treturn null;\r\n\t}",
"public List<Utilizator> listUsers();",
"public List getAllAccounts() {\n\t\treturn null;\r\n\t}",
"public ArrayList getAccountList() throws RemoteException, SQLException, Exception;",
"@Override\n public List<User> getAccountStatusList(){\n List<User> userList = null;\n userList = adminMapper.getAccountStatusList();\n return userList;\n }",
"public static List<Account> getAccounts()\n\t{\n\t\treturn Application.getAccountLibrary().getAccounts();\n\t}",
"public List<String> listUsers() \n\t{\n\t\treturn this.userList.keys();\n\t\t\n\t}",
"java.util.List<java.lang.String> getServiceAccountIdTokensList();",
"public List <String> getPermittedUsers() throws BusinessServiceException{\r\n\r\n\t\treturn financeManagerBO.getPermittedUsers();\t\t\r\n\t}",
"public LegalValueSet getAccountChoices() {\n return IltdsUtils.getAccountList();\n }",
"List<User> getActivatedUserList();",
"java.util.List<com.google.cloud.compute.v1.ServiceAccount> getServiceAccountsList();",
"public String[] listUsers();",
"java.util.List<com.heroiclabs.nakama.api.User> \n getUsersList();",
"List<Account> getSelectedAccounts() {\n\t\t\n\t\treturn this.accountShuttleList.getRightListItems();\n\n\t}",
"public List<String> getAvailableAssignees()\n {\n // TODO stefan an Rollen knüpfen\n final Matcher<String> m = new BooleanListRulesFactory<String>().createMatcher(\"admin/user/*\");\n final List<GWikiElementInfo> userInfos = wikiContext.getElementFinder()\n .getPageInfos(new GWikiPageIdMatcher(wikiContext, m));\n\n List<String> users = new ArrayList<String>();\n for (final GWikiElementInfo user : userInfos) {\n users.add(GWikiContext.getNamePartFromPageId(user.getId()));\n }\n return users;\n }",
"public List <Account> getAllAccountsByRIB(String RIB);",
"List<TmpUserPayAccount> selectAll();",
"public Set<Account> getAccountsForOwner(String username);",
"public List<String> getUserList() throws Exception {\n\t\tString result = null;\n\t\tArrayList<String> userList = new ArrayList<String>();\n\t\tString adminToken = this.loginAAA(this.adminUsername,\n\t\t\t\tthis.adminPassword);\n\t\tHttpURLConnection httpConn;\n\t\thttpConn = this.setHttpConnection(openAMLocation\n\t\t\t\t+ \"/json/users?_queryID=*\");\n\t\tthis.setHttpTokenInCookie(httpConn, adminToken);\n\t\tthis.setGetHttpConnection(httpConn);\n\n\t\tBufferedReader br = this.getHttpInputReader(httpConn);\n\t\tString str;\n\t\tStringBuffer sb = new StringBuffer();\n\n\t\twhile ((str = br.readLine()) != null) {\n\t\t\tsb.append(str);\n\t\t}\n\n\t\tif (httpConn.getResponseCode() == 200) {\n\t\t\tresult = sb.toString();\n\t\t\tJSONObject JsonObj = new JSONObject(result);\n\t\t\tJSONArray userArray;\n\t\t\tif (JsonObj.has(\"result\")) {\n\t\t\t\tuserArray = JsonObj.getJSONArray(\"result\");\n\t\t\t\tif (userArray != null) {\n\n\t\t\t\t\tfor (int i = 0; i < userArray.length(); i++) {\n\t\t\t\t\t\tString userAccount = userArray.getString(i);\n\t\t\t\t\t\t// System.out.println(userAccount);\n\t\t\t\t\t\tif (!userAccount.equalsIgnoreCase(\"quanta\")\n\t\t\t\t\t\t\t\t&& !userAccount.equalsIgnoreCase(\"mcumanager\")\n\t\t\t\t\t\t\t\t&& !userAccount.equalsIgnoreCase(\"rtpproxy1\")\n\t\t\t\t\t\t\t\t&& !userAccount.equalsIgnoreCase(\"rtpproxy2\")\n\t\t\t\t\t\t\t\t&& !userAccount.equalsIgnoreCase(\"amAdmin\")\n\t\t\t\t\t\t\t\t&& !userAccount.equalsIgnoreCase(\"thcadmin\")\n\t\t\t\t\t\t\t\t&& !userAccount.equalsIgnoreCase(\"cmpadmin\")\n\t\t\t\t\t\t\t\t&& !userAccount.equalsIgnoreCase(\"anonymous\"))\n\t\t\t\t\t\t\tuserList.add(userAccount);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tlogger.error(\"read User List fail, response: {}\", sb.toString());\n\t\t}\n\t\tbr.close();\n\t\t\n\t\tif (adminToken != null) {\n\t\t\tthis.logoutAAA(adminToken);\n\t\t}\n\t\treturn userList;\n\n\t}",
"List<Account> getAccounts(String login);",
"ArrayList<String> getAccounts(Klant klant) throws SessionExpiredException, IllegalArgumentException, RemoteException;",
"public ArrayList<memberjoin> getUserList() {\n\t\treturn Tdao.selectticketList();\r\n\t}",
"public List<User> getUserList();",
"public List<User> getEnabledUsers();",
"@Override\n\tpublic List<PrpUser> getUserList() {\n\t\treturn null;\n\t}",
"public String listUsers(){\n \tStringBuilder sb = new StringBuilder();\n \tif(users.isEmpty()){\n \t\tsb.append(\"No existing Users yet\\n\");\n \t}else{\n \t\tsb.append(\"Meeting Manager Users:\\n\");\n \t\tfor(User u : users){\n \t\t\tsb.append(\"*\"+u.getEmail()+\" \"+ u.getPassword()+\" \\n\"+u.listInterests()+\"\\n\");\n \t\t}\n \t}\n \treturn sb.toString();\n }",
"public String[] getUsers(){\n try {\n names = credentials.keys();\n }catch (java.util.prefs.BackingStoreException e1){\n System.out.println(e1);\n }\n return names;\n }",
"List<Accessprofile> listAll();",
"public Set<P2PUser> getUsers();",
"@Override\r\n\tpublic List<UserVO> userList() {\n\t\treturn adao.UserList();\r\n\t}",
"public static ArrayList<String> getAccountOwners(String accountno) {\n\t\tString query = \"SELECT user FROM \" + EconomosConstants.DB_ACCOUNTENTRIES_TABLENAME +\n\t\t\t\t\" WHERE accountno=\" + accountno + \" AND role='owner'\";\n\t\tConnection conn = null;\n\t\tArrayList<String> users = new ArrayList<String>();\n\t\ttry {\n\t\t\tconn = SQLUtil.getConnection();\n\t\t\tStatement stat = conn.createStatement();\n\t\t\tconn.setAutoCommit(false);\n\t\t\tResultSet rs = stat.executeQuery(query);\n\t\t\twhile (rs.next()) {\n\t\t\t\tusers.add(String.valueOf(rs.getString(1)));\n\t\t\t}\n\t\t\tconn.commit();\n\t\t\tconn.close();\n\t\t} catch (SQLException e) {\n\t\t\ttry {\n\t\t\t\tconn.rollback();\n\t\t\t\tconn.close();\n\t\t\t} catch (SQLException e1) {\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t\treturn users;\n\t}",
"public List<Leveltemp> findAcct() {\n\t\treturn getHibernateTemplate().find(\"from Leveltemp e where e.roleacct = 'N'\");\n\t}",
"public String printAccounts() {\n StringBuilder result;\n result = new StringBuilder((\"--Listing accounts in the database--\\n\"));\n for (int i = 0; i < size; i++) {\n result.append(accounts[i].toString()).append(\"\\n\");\n }\n result.append(\"--end of listing--\");\n return result.toString();\n }",
"public Vector<CarerAccount> getUsers(){\n\t\treturn CarerAccounts;\n\t}",
"public String ListOnlineUsers(){\r\n StringBuilder listUsers = new StringBuilder();\r\n for (Utente u: utenti) { // crea la lista degli utenti registrati al servizio e online\r\n if(u.getStatus().equals(\"ONLINE\")) {\r\n \tlistUsers.append(u.getUsername()).append(\" \");\r\n \tlistUsers.append(u.getStatus()).append(\"\\n\");\r\n }\r\n }\r\n return listUsers.toString(); \r\n }",
"List<UserAccount> getUserAccountListByCompany(Serializable companyId,\r\n Serializable creatorId, Serializable subsystemId);",
"public List<CheckItem> getUserProfileGuestList() {\n\t\treturn null;\r\n//\t\treturn getBoCheckItems(\"userProfileName\", UserProfile.class,new FilterParams(\"networkObj.networkType\",VpnNetwork.VPN_NETWORK_TYPE_GUEST),\r\n//\t\t\t\tCHECK_ITEM_BEGIN_BLANK, CHECK_ITEM_END_NO);\r\n\t}",
"public static List<Utente> lista_utenti(){\r\n\t\tArrayList<Utente> lista=null;\r\n\t\ttry {\r\n\t\t\tDatabase.connect();\r\n\t\t\tResultSet rs = Database.selectRecord(\"utente\", \"utente.username\");\r\n \t\tlista = new ArrayList<Utente>();\r\n \t\twhile(rs.next()) {\r\n \t\t\tint id = rs.getInt(\"id\");\r\n \t\t\tint ruolo = rs.getInt(\"ruolo\");\r\n \t\t\tString username = rs.getString(\"username\");\r\n \t\t\tString email = rs.getString(\"email\");\r\n \t\t\tDate dataSignup = rs.getDate(\"dataSignup\");\r\n \t\t\t\r\n \t\t\tUtente elemento = new Utente(id,ruolo,username,email,dataSignup);\r\n \t\t\tlista.add(elemento);\t\r\n \t\t}\r\n\t\t\tDatabase.close();\t\t\t\r\n\t\t}catch(NamingException e) {\r\n\t\t\tSystem.out.println(\"NamingException\"+e);\r\n\t }catch (SQLException e) {\r\n\t \tSystem.out.println(\"SQLException\"+e);\r\n\t }catch (Exception e) {\r\n\t \tSystem.out.println(\"Exception\"+e); \r\n\t }\r\n\t\treturn lista;\r\n\t}",
"public List<User> getDisabledUsers();",
"@RequestLine(\"GET /accounts\")\n AccountList getAccountsListOfUser();",
"@Override\n\tpublic AccountBean[] list() {\n\t\treturn null;\n\t}",
"public List<User> getUserList()\r\n\t{\r\n\t//\tGet the user list\r\n\t//\r\n\t\treturn identificationService.loadUserList();\r\n\t}",
"@Override\r\n\tpublic List<AccountDTO> getAllUser() {\n\t\treturn accountDao.getAll();\r\n\t}",
"java.util.List<com.orange.network.game.protocol.model.ZhaJinHuaProtos.PBZJHUserPlayInfo> \n getUsersInfoList();",
"public List<CoinbaseAccount> getCoinbaseAccounts() throws IOException {\n\n String path = \"/v2/accounts\";\n String apiKey = exchange.getExchangeSpecification().getApiKey();\n BigDecimal timestamp = coinbase.getTime(Coinbase.CB_VERSION_VALUE).getData().getEpoch();\n String signature = getSignature(timestamp, path);\n showCurl(apiKey, timestamp, signature, path);\n \n return coinbase.getAccounts(Coinbase.CB_VERSION_VALUE, apiKey, signature, timestamp).getData();\n }",
"public List getOwnerUsersList(Map map) {\n\t String currentUser = UserUtil.getCurrentPrincipalUser();\r\n\t\t List ls = (List)map.get(currentUser);\r\n//\t\t System.out.println(\"map.size()\"+currentUser) ;\r\n//\t\t System.out.println(map.size()) ;\r\n\t\treturn ls;\r\n\t}",
"public List<User> listAll() throws Exception;",
"public List<User> list();",
"protected void getUserList() {\n\t\tmyDatabaseHandler db = new myDatabaseHandler();\n\t\tStatement statement = db.getStatement();\n\t\t// db.createUserTable(statement);\n\t\tuserList = new ArrayList();\n\t\tsearchedUserList = new ArrayList();\n\t\tsearchedUserList = db.getUserList(statement);\n\t\tuserList = db.getUserList(statement);\n\t\tusers.removeAllElements();\n\t\tfor (User u : userList) {\n\t\t\tusers.addElement(u.getName());\n\t\t}\n\t}",
"@Override\r\n\tpublic List listAllUser() {\n\t\treturn userDAO.getUserinfoList();\r\n\t}",
"public List<String> getUserList() {\n\t\treturn userList;\n\t}",
"public List<UsuarioDTO> obterListaUsuarios() throws RemoteException;",
"public List<UsrMain> getListUsers() {\n return mobileCtrl.getListUsers();\n }",
"public static Enumeration getActiveAccountNames() {\r\n return (accounts.keys());\r\n }",
"public java.util.List<Reference> account() {\n return getList(Reference.class, FhirPropertyNames.PROPERTY_ACCOUNT);\n }",
"public List<User> getAllUsers() {\n\n\t\tList<User> result = new ArrayList<User>();\n\n\t\ttry {\n\t\t\tjava.sql.PreparedStatement ps = ((org.inria.jdbc.Connection) db).prepareStatement(TCell_QEP_IDs.QEP.EP_getAllUsers);\n\t\t\tResultSet rs = ps.executeQuery();\n\t\t\tString query = \"SELECT IdGlobal, TCELLIP, PUBLICKEY, TCELLPORT from USER\";\n\t\t\tSystem.out.println(\"Executing query : \" + query);\t\t\t\n\n\t\t\twhile (rs.next()) {\n\t\t\t\tint UserGID =rs.getInt(1);\n\t\t\t\tString TCellIP = rs.getString(2);\n\t\t\t\t\n\t\t\t\t//convert Blob to String\n\t\t\t\tBlob myPubKeyBlob = rs.getBlob(3);\n\t\t\t\tbyte[] bPubKey = myPubKeyBlob.getBytes(1, (int) myPubKeyBlob.length());\n\t\t\t\tString pubKey = new String(bPubKey);\n\t\t\t\t\n\t\t\t\tint port = rs.getInt(4);\n\t\t\t\tUser user = new User(UserGID,TCellIP, port, pubKey);\n\t\t\t\tresult.add(user);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\t// Uncomment when the close function will be implemented\n\t\t\t// attemptToClose(ps);\n\t\t\t\n\t\t}\n\n\t\treturn result;\n\n\t}",
"com.google.ads.googleads.v6.resources.UserList getUserList();",
"public List getAllUsers();",
"public List<String> getPropertyOwners();",
"public List<String> displayuser() {\n\t\t// TODO Auto-generated method stub\n\t\tList<String> list = new ArrayList<>();\n\t\tlist = crud1.displayUsers();\n\t\treturn list;\n\t}",
"public List getUsuarios();",
"public List<Usuario> obtenerListaUsuariosActivos(){\n return usuarioBean.obtenerListaUsuariosActivos();\n }",
"List<Agent> listPOSAgentsHaveCredential();",
"public static void viewListOfRegistrants() {\n\t\tArrayList<Registrant> list_reg = getRegControl().listOfRegistrants();\r\n\t\tif (list_reg.size() == 0) {\r\n\t\t\tSystem.out.println(\"No Registrants loaded yet\\n\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"List of registrants:\\n\");\r\n\t\t\tfor (Registrant registrant : list_reg) {\r\n\t\t\t\tSystem.out.println(registrant.toString());\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"@Override\n\tpublic List<Account> GetAllAccounts() {\n\t\tif(accountList.size() > 0)\n\t\t\treturn accountList;\n\t\treturn null;\n\t}",
"@Override\n\tpublic List<Epuser> getList() throws Exception {\n\t\treturn epuserMapper.list() ;\n\t}",
"@XmlTransient\r\n public List<Account> getAccountList() {\r\n return accountList;\r\n }",
"public Accounts accounts() {\n return this.accounts;\n }",
"public List<Account> getAllAccountsFromUser(Integer userId) {\n if(userId == bankAccount.getBankAccountOwnerId())\n {\n List<Account> accountList = accountRepository.findAccountByOwner(userId);\n accountList.add( new Account(bankAccount.getBankAccountIban(), \"current\", 0, 0, 0,0,bankAccount.getBankAccountBalance()));\n return accountList;\n }\n\n return (List<Account>)accountRepository.findAccountByOwner(userId);\n }",
"public ArrayList<User> showUsers(){\n\t\treturn this.userList;\n\t}",
"@Override\r\n\tpublic ArrayList<BankAccountVO> getBankAccountVOList() {\n\t\tArrayList<BankAccountVO> BankAccountList = new ArrayList<>();\r\n\t\tBankAccountList.add(new BankAccountVO(\"SS141250110\",200000));\r\n\t\treturn BankAccountList;\r\n\t}",
"public List<User> list();",
"private void createAllUsersList(){\n\t\tunassignedUsersList.clear();\n\t\tlistedUsersAvailList.clear();\n\t\tArrayList<User> users = jdbc.get_users();\n\t\tfor (int i = 0; i < users.size(); i++) {\n\t\t\tunassignedUsersList.addElement(String.format(\"%s, %s\", users.get(i).get_lastname(), users.get(i).get_firstname()));\n\t\t\tlistedUsersAvailList.addElement(String.format(\"%s, %s\", users.get(i).get_lastname(), users.get(i).get_firstname()));\n\t\t}\n\t}",
"@Override\n\tpublic List<Map<String, Object>> getUserList() {\n\t\tList<Map<String, Object>> list = new ArrayList<Map<String,Object>>();\n\t\tString sql = \"select * from tp_users where userType = 2\";\n\t\tMap<String, Object> map = new HashMap<String, Object>();\n\t\tlist = joaSimpleDao.queryForList(sql, map);\n\t\treturn list;\n\t}",
"ImmutableList<SchemaOrgType> getAccountablePersonList();",
"@GetMapping(\"/accounts\")\n public List<Account> getAccounts() {\n Iterable<Account> accounts = repository.findAll(Sort.by(\"name\"));\n return StreamSupport.stream(accounts.spliterator(), false).collect(Collectors.toList());\n }",
"public static String[] getReservedAccounts()\n {\n String[] asReserved = {\"system\", \"Joing\", \"Join'g\", \"admin\", \"administrator\", getSystemName()};\n \n return asReserved;\n }",
"@Override\r\n\tpublic void viewAllAccountsAllUsers() {\n\t\tas.getAllAccountsAllUsers();\r\n\t}",
"public List<Account> accounts() {\n return getMany(Account.class, Account.TITLE_FOREIGN_KEY_PERSON_DATA);\n }",
"public List<User> getUserList() {\n\t\treturn null;\n\t}",
"public void printAccounts() { \r\n\t\tif ( size == 0 ) {\r\n\t\t\tSystem.out.println(\"Accounts is empty\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"--Listing accounts in the database--\");\r\n\t\tfor(int i = 0; i < accounts.length; i++) {\r\n\t\t\tif ( accounts[i] != null ) {\r\n\t\t\t\tSystem.out.println(accounts[i].toString());\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"--end of listing--\");\r\n\t\tSystem.out.println();\r\n\t\treturn;\r\n\t}",
"@Override\r\n\tpublic List<User> users() {\r\n\t\tList<User> ris = new ArrayList<>();\r\n\t\tList< Map <String,String>> maps = getAll(SELECT_USERS);\r\n\t\tfor (Map<String, String> map : maps) {\r\n\t\t\tris.add(IMappable.fromMap(User.class, map));\r\n\t\t}\r\n\t\treturn ris;\r\n\t}",
"public List<String> getListOfOwner() throws SQLException {\n\t\treturn adminService.listOfOwner();\n\t}",
"public Collection<AccessUser> getMembers()\n {\n return username_to_profile.values();\n }",
"ListView getManageAccountListView();",
"public List<User> list(String currentUsername);",
"public List<IPermissionOwner> getAllPermissionOwners();",
"public void printList(){\n\t\tfor(User u : userList){\r\n\t\t\tSystem.out.println(\"Username: \" + u.getUsername() + \" | User ID: \" + u.getUserID() + \" | Hashcode: \" + u.getHashcode() + \" | Salt: \" + u.getSalt());\r\n\t\t}\r\n\t}",
"public List<User> list() {\n\t\treturn null;\n\t}",
"@Override\r\n\tpublic ArrayList<BankAccountPO> findBankAccountPOList() {\n\t\tArrayList<BankAccountPO> BankAccountList = new ArrayList<>();\r\n\t\tBankAccountList.add(new BankAccountPO(\"SS141250110\",200000));\r\n\t\treturn BankAccountList;\r\n\t}",
"public List<NguoiNhap> getAllUsers() throws SQLException {\r\n rs = connectionAdmin(\"SELECT * FROM USER\");\r\n List<NguoiNhap> listUsers;\r\n if (rs != null) {\r\n\r\n listUsers = new ArrayList<NguoiNhap>() {\r\n {\r\n while (rs.next()) {\r\n add(new NguoiNhap(rs.getString(\"username\"), rs.getString(\"password\"), rs.getString(\"ten\"), rs.getString(\"gioitinh\"), rs.getString(\"ngaysinh\")));\r\n }\r\n rs.close();\r\n stm.close();\r\n con.close();\r\n }\r\n };\r\n\r\n return listUsers;\r\n }\r\n\r\n return null;\r\n }",
"List<Account> selectAll();"
] | [
"0.66134953",
"0.6575067",
"0.6459584",
"0.6451236",
"0.63993967",
"0.63986427",
"0.6361946",
"0.63504785",
"0.6326698",
"0.63189584",
"0.62900084",
"0.6234408",
"0.61945313",
"0.6173855",
"0.61614585",
"0.6141169",
"0.61220634",
"0.6107771",
"0.61066854",
"0.6099686",
"0.6094004",
"0.60593504",
"0.60132",
"0.59926623",
"0.5983606",
"0.59619164",
"0.59599733",
"0.5940675",
"0.593936",
"0.5932814",
"0.59326786",
"0.5917539",
"0.59087664",
"0.5907464",
"0.5902498",
"0.58743525",
"0.5872688",
"0.58677715",
"0.5854101",
"0.58395696",
"0.58395535",
"0.5825479",
"0.58247966",
"0.5822946",
"0.5821724",
"0.58147305",
"0.5813518",
"0.5811719",
"0.58013535",
"0.57920206",
"0.5791775",
"0.5775474",
"0.5763896",
"0.57431763",
"0.57408255",
"0.5735726",
"0.5733354",
"0.5725977",
"0.5725357",
"0.57215196",
"0.5719665",
"0.57133776",
"0.5699997",
"0.5697712",
"0.56909275",
"0.56807494",
"0.5678443",
"0.5660537",
"0.5656905",
"0.56481695",
"0.5647379",
"0.5634988",
"0.56282634",
"0.5628061",
"0.5623692",
"0.56212854",
"0.56189406",
"0.5617988",
"0.56091285",
"0.56079364",
"0.5607485",
"0.56066686",
"0.5597956",
"0.5583812",
"0.55803114",
"0.55795556",
"0.55789775",
"0.5578893",
"0.5575861",
"0.5574146",
"0.5570215",
"0.55694115",
"0.55641806",
"0.5556824",
"0.55566424",
"0.55503416",
"0.5546251",
"0.5544249",
"0.5539677",
"0.55355805"
] | 0.676902 | 0 |
Convert the given object to string with each line indented by 4 spaces (except the first line). | private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private String toIndentedString(Object object) {\n if (object == null) {\n return EndpointCentralConstants.NULL_STRING;\n }\n return object.toString().replace(EndpointCentralConstants.LINE_BREAK,\n EndpointCentralConstants.LINE_BREAK + EndpointCentralConstants.TAB_SPACES);\n }",
"private String toIndentedString(Object o)\n/* */ {\n/* 128 */ if (o == null) {\n/* 129 */ return \"null\";\n/* */ }\n/* 131 */ return o.toString().replace(\"\\n\", \"\\n \");\n/* */ }",
"private String toIndentedString( Object o )\n {\n if ( o == null )\n {\n return \"null\";\n }\n return o.toString().replace( \"\\n\", \"\\n \" );\n }"
] | [
"0.78847593",
"0.75493765",
"0.74971926"
] | 0.746168 | 89 |
update of functional data (name, tel...) | @Override
public void notifyAppointmentUpdated( int nIdAppointment )
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void updateData() {}",
"void updateData();",
"@Override\r\n\tpublic void updateData() {\n\t\t\r\n\t}",
"private void updateData(Multa ant, Multa multa) {\n\t}",
"void updateInformation();",
"@Override\r\n\tpublic void update(String[] getdata) {\n\r\n\t}",
"@Override\n\tpublic void update(finalDataBean t, String[] fields) throws Exception {\n\t\t\n\t}",
"public synchronized void updateData() {\n updateDataFields(this::defaultFetcher);\n }",
"static void editDetails(int index, List<String> data){\n people.get(index).setFirstName(data.get(0));\n people.get(index).setLastName(data.get(1));\n people.get(index).setHeight(Short.parseShort(data.get(2)));\n people.get(index).setWeight(Double.parseDouble(data.get(3)));\n people.get(index).setBirthDate(LocalDate.of(\n Integer.parseInt(data.get(4)),\n Integer.parseInt(data.get(5)),\n Integer.parseInt(data.get(6))));\n people.get(index).setSex(checkSex(data.get(7)));\n people.get(index).setPosition(data.get(8));\n people.get(index).setHireDate(LocalDate.of(\n Integer.parseInt(data.get(9)),\n Integer.parseInt(data.get(10)),\n Integer.parseInt(data.get(11))));\n ;\n }",
"private void update() {\n\n\t\tfloat shopping = Float.parseFloat(label_2.getText());\n\t\tfloat giveing = Float.parseFloat(label_5.getText());\n\t\tfloat companyDemand = Float.parseFloat(label_7.getText());\n\n\t\ttry {\n\t\t\tPreparedStatement statement = DBConnection.connection\n\t\t\t\t\t.prepareStatement(\"update customer_list set Shopping_Account = \"\n\t\t\t\t\t\t\t+ shopping\n\t\t\t\t\t\t\t+ \" , Giving_Money_Account = \"\n\t\t\t\t\t\t\t+ giveing\n\t\t\t\t\t\t\t+ \", Company_demand = \"\n\t\t\t\t\t\t\t+ companyDemand\n\t\t\t\t\t\t\t+ \" where Name = '\"\n\t\t\t\t\t\t\t+ name\n\t\t\t\t\t\t\t+ \"' And Last_Name = '\"\n\t\t\t\t\t\t\t+ lastName + \"' \");\n\t\t\tstatement.execute();\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\n\t\t}\n\n\t}",
"void updatePatientInfo(PatientInfo patientInfo);",
"public void updatePerson() {\n\t\tSystem.out.println(\"****Update Record****\");\n\t\tSystem.out.println(\"Enter contact no.\");\n\t\tlong contactSearch = sc.nextLong();\n\t\tfor (int i = 0; i < details.length; i++) {\n\t\t\tif (details[i] != null && details[i].getPhoneNo() == contactSearch) {\n\t\t\t\tSystem.out.println(details[i].getFirstName());\n\t\t\t\tSystem.out.println(\"Please select field you need to edit\");\n\t\t\t\tSystem.out.println(\"1. Address\");\n\t\t\t\tSystem.out.println(\"2. City\");\n\t\t\t\tSystem.out.println(\"3. State\");\n\t\t\t\tSystem.out.println(\"4. Zipcode\");\n\t\t\t\tSystem.out.println(\"5. Phone Number\");\n\t\t\t\tint choiceUpdate = sc.nextInt();\n\t\t\t\tswitch (choiceUpdate) {\n\t\t\t\tcase 1:\n\t\t\t\t\tSystem.out.println(\"Enter your Address\");\n\t\t\t\t\tString addressUpdate = sc.next();\n\t\t\t\t\tdetails[i].setAddress(addressUpdate);\n\t\t\t\t\tSystem.out.println(\"Address Updated\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tSystem.out.println(\"Enter your City \");\n\t\t\t\t\tString cityUpdate = sc.next();\n\t\t\t\t\tdetails[i].setCity(cityUpdate);\n\t\t\t\t\tSystem.out.println(\"City Updated\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tSystem.out.println(\"Enter your State\");\n\t\t\t\t\tString stateUpdate = sc.next();\n\t\t\t\t\tdetails[i].setState(stateUpdate);\n\t\t\t\t\tSystem.out.println(\"State Updated\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tSystem.out.println(\"Enter Your Zipcode\");\n\t\t\t\t\tint zipcodeUpdate = sc.nextInt();\n\t\t\t\t\tdetails[i].setZip(zipcodeUpdate);\n\t\t\t\t\tSystem.out.println(\"Zipcode Updated\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tSystem.out.println(\"Enter Phone Number\");\n\t\t\t\t\tlong phoneUpdate = sc.nextLong();\n\t\t\t\t\tdetails[i].setPhoneNo(phoneUpdate);\n\t\t\t\t\tSystem.out.println(\"Phone Number Updated\");\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tSystem.out.println(\"Update Invalid choive! Enter again..\\n\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void updateData(restaurantRes res){\r\n \r\n }",
"private void setValueForEditAddrss() {\n ServiceCaller serviceCaller = new ServiceCaller(context);\n serviceCaller.callGetAllAddressByIdService(addressid, new IAsyncWorkCompletedCallback() {\n @Override\n public void onDone(String workName, boolean isComplete) {\n if (isComplete) {\n if (!workName.trim().equalsIgnoreCase(\"no\") && !workName.equalsIgnoreCase(\"\")) {\n ContentDataAsArray contentDataAsArray = new Gson().fromJson(workName, ContentDataAsArray.class);\n for (Data data : contentDataAsArray.getData()) {\n if (data != null) {\n edt_name.setText(data.getName());\n edt_phone.setText(data.getPhone());\n edt_landmark.setText(data.getLandmark());\n edt_address.setText(data.getAddress());\n edt_city.setText(data.getCity());\n edt_state.setText(data.getState());\n }\n }\n }\n }\n }\n });\n\n }",
"@Override\n\t\tpublic void update(Metodologia metodologia,String name) {\n\t\t\t\n\t\t}",
"public void updateContact(View v){\n\n receivedPersonInfo.name = nameField.getText().toString();\n receivedPersonInfo.address = addressField.getText().toString();\n receivedPersonInfo.business = primbusiness.getItemAtPosition(primbusiness.getSelectedItemPosition()).toString();\n receivedPersonInfo.province = province.getItemAtPosition(province.getSelectedItemPosition()).toString();\n receivedPersonInfo.toMap(); // update hash\n appState.firebaseReference.child(receivedPersonInfo.uid).setValue(receivedPersonInfo);\n }",
"public void updateDataComp() {\n\t\tdataEntryDao.updateDataComp();\n\t}",
"void updateCustomer(int id, String[] updateInfo);",
"void update(Information info);",
"public void updateDataCell();",
"public void updateData(String typeActivity) {\n try {\n Float.parseFloat(this.inputNominal.getText());\n } catch (Exception err) {\n this.alert.showMessageDialog(null, \"Silahkan input nominal dengan benar\");\n }\n \n try {\n this.inputDate.getDate().getTime();\n } catch (Exception err) {\n this.alert.showMessageDialog(null, \"Silahkan input tanggal dengan benar\");\n }\n \n Time time = new Time();\n time.setDate(this.inputDate.getDate());\n \n String description = this.inputDescription.getText();\n float nominal = Float.parseFloat(this.inputNominal.getText());\n String dateAt = time.parseDatetime();\n \n ActivityService activityService = new ActivityService();\n \n activityService\n .setId(this.id)\n .setDescription(description)\n .setNominal(nominal)\n .setDateAt(dateAt)\n .setUser(this.dashboard.user);\n \n try {\n if (typeActivity.equals(\"+\")) {\n activityService.updateIncome();\n } else {\n activityService.updateExpense();\n }\n this.dashboard.refreshUI();\n this.dashboard.resetForm();\n } catch (Exception err) {\n this.alert.showMessageDialog(null, err.getMessage());\n }\n }",
"protected abstract void updateInfos();",
"public void updateData(Trick completedTrick);",
"@Override\n public void changeContact(String id,String pass,String newno) throws IOException\n {\n \tNode<Admin> pos = adm_list.getFirst();\n \twhile(pos!=null)\n \t{\n \t\tif(pos.getData().employee_id.equals(id) && pos.getData().password.equals(pass))\n \t\t{\n \t\t\tpos.getData().contact = newno;\n \t\t}\n \t\tpos = pos.getNext();\n \t}\n \twrite_adm_file();\n }",
"public void editarData(){\n\t\talunoTurmaService.inserirAlterar(alunoTurmaAltera);\n\t\t\n\t\t\n\t\tmovimentacao.setDataMovimentacao(alunoTurmaAltera.getDataMudanca());\n\t\tmovimentacaoService.inserirAlterar(movimentacao);\n\t\t\n\t\tFecharDialog.fecharDialogDATAAluno();\n\t\tExibirMensagem.exibirMensagem(Mensagem.SUCESSO);\n\t\talunoTurmaAltera = new AlunoTurma();\n\t\tmovimentacao = new Movimentacao();\n\t\t\n\t\tatualizarListas();\n\t}",
"public void updateInfo() {\n\t}",
"JsonNode updateData(String data);",
"private void fillData() {\n\tparname.setText(UpStudentController.getName());\r\n\tparphone.setText(UpStudentController.getPhone());\r\n\tparmail.setText(UpStudentController.getMail());\r\n\taddres.setText(UpStudentController.getAdr());\r\n\tlocation.setText(UpStudentController.getLoc());\r\n\tkazi.setText(UpStudentController.getOc());\r\n\ttaifa.setText(UpStudentController.getNat());\r\n\t}",
"public Boolean updateData(int position, String oldemail, String category, String name, String dob, String email, String phone){\n return databaseManager.updateInfo(position,oldemail,category,name,dob,email,phone);\n }",
"public updatedata() {\n initComponents();\n }",
"@Override\n\tpublic Item update() {\n\t\t\n\t\treadAll();\n\t\n\t\tLOGGER.info(\"State the shoe name you wish to update\");\n\t\tString name = util.getString().toLowerCase();;\n\t\tLOGGER.info(\"State the size you wish to update\");\n\t\tdouble size = util.getDouble();\n\t\tLOGGER.info(\"Change price\");\n\t\tdouble price = util.getDouble();\n\t\tLOGGER.info(\"Change amount in stock\");\n\t\tlong stock = util.getLong();\n\t\tLOGGER.info(\"\\n\");\n\t\treturn itemDAO.update(new Item(name,size,price,stock));\n\t\t\n\t\t\n\t\t\n\t}",
"public abstract void update(DataAction data, DataRequest source) throws ConnectorOperationException;",
"private void refreshData() {\r\n\tif (fieldSpeciesContextSpec == null){\r\n\t\tsetData(null);\r\n\t} else {\r\n\t\tsetData(fieldSpeciesContextSpec.computeApplicableParameterList());\r\n\t}\r\n}",
"public void updateContact() {\r\n\t\tSystem.out.println(\"enter the name of the contact whose details are to be updated\");\r\n\t\tString name = scanner.nextLine();\r\n\t\tContact existing = service.getContact(name); //get the existing contact details from service<-dao\r\n\t\t\r\n\t\t\r\n\t\tSystem.out.println(\"1. keep the same address\\n2. update the address\");\r\n\t\tint choice = Integer.parseInt(scanner.nextLine());\r\n\t\tString address;\r\n\t\tif(choice==1) {\r\n\t\t\taddress=existing.getAddress();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"enter new address\");\r\n\t\t\taddress = scanner.nextLine();\r\n\t\t}\r\n\t\t\r\n\t\t//mobile number updation\r\n\t\tSystem.out.println(\"1. keep the same mobile number(s)\\n2. add new mobile number\\n3.remove existing added number\");\r\n\t\tchoice = Integer.parseInt(scanner.nextLine());\r\n\t\tString mobileNumber[];\r\n\t\t\r\n\t\t//if the user wants to keep same mobile number(s)\r\n\t\tif(choice==1) {\r\n\t\t\tmobileNumber=existing.getMobileNumber();\r\n\t\t}\r\n\t\t\r\n\t\t//if the user wants to add a new mobile number to already existing \r\n\t\telse if(choice==2) {\r\n\t\t\tmobileNumber=existing.getMobileNumber();\r\n\t\t\tList<String> numberList = new ArrayList<>(Arrays.asList(mobileNumber));\r\n\t\t\tSystem.out.println(\"enter new mobile number\");\r\n\t\t\tString newNumber = scanner.nextLine();\r\n\t\t\tif(numberList.contains(newNumber)) {\r\n\t\t\t\tSystem.out.println(\"the number is already a part of this contact\");\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tnumberList.add(newNumber);\r\n\t\t\t}\r\n\t\t\tmobileNumber=numberList.toArray(new String[0]);\r\n\t\t}\r\n\t\t\r\n\t\t//if the user wants to remove some number from existing numbers\r\n\t\telse {\r\n\t\t\tmobileNumber=existing.getMobileNumber();\r\n\t\t\tList<String> numberList = new ArrayList<>(Arrays.asList(mobileNumber));\r\n\t\t\tSystem.out.println(\"enter mobile number to remove\");\r\n\t\t\tString removingNumber = scanner.nextLine();\r\n\t\t\tif(!numberList.contains(removingNumber)) {\r\n\t\t\t\tSystem.out.println(\"no such mobile number exist\");\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tnumberList.remove(removingNumber);\r\n\t\t\t}\r\n\t\t\tmobileNumber=numberList.toArray(new String[0]);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t//updating the profile picture\r\n\t\tSystem.out.println(\"1. keep the same image\\n2. update the image\");\r\n\t\tchoice = Integer.parseInt(scanner.nextLine());\r\n\t\tString imageReference;\r\n\t\tif(choice==1) {\r\n\t\t\timageReference=existing.getImageReference();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"enter new image path\");\r\n\t\t\timageReference = scanner.nextLine();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t//updating the date of birth\r\n\t\tSystem.out.println(\"1. keep the same date of birth\\n2. update the date of birth\");\r\n\t\tchoice = Integer.parseInt(scanner.nextLine());\r\n\t\tLocalDate dateOfBirth;\r\n\t\tif(choice==1) {\r\n\t\t\tdateOfBirth=existing.getDateOfBirth();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"enter new date of birth\");\r\n\t\t\tdateOfBirth = LocalDate.parse(scanner.nextLine());\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t//updating the email - same logic as that of updating mobile number\r\n\t\tSystem.out.println(\"1. keep the same email Id(s)\\n2. add new email Id\\n3.remove existing email Id\");\r\n\t\tchoice = Integer.parseInt(scanner.nextLine());\r\n\t\tString email[];\r\n\t\tif(choice==1) {\r\n\t\t\temail=existing.getEmail();\r\n\t\t}\r\n\t\telse if(choice==2) {\r\n\t\t\temail=existing.getEmail();\r\n\t\t\tList<String> emailList = new ArrayList<>(Arrays.asList(email));\r\n\t\t\tSystem.out.println(\"enter new email Id\");\r\n\t\t\tString newEmail = scanner.nextLine();\r\n\t\t\tif(emailList.contains(newEmail)) {\r\n\t\t\t\tSystem.out.println(\"the email is already a part of this contact\");\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\temailList.add(newEmail);\r\n\t\t\t}\r\n\t\t\temail=emailList.toArray(new String[0]);\r\n\t\t}\r\n\t\telse {\r\n\t\t\temail=existing.getEmail();\r\n\t\t\tList<String> emailList = new ArrayList<>(Arrays.asList(email));\r\n\t\t\tSystem.out.println(\"enter email to remove\");\r\n\t\t\tString removingEmail = scanner.nextLine();\r\n\t\t\tif(!emailList.contains(removingEmail)) {\r\n\t\t\t\tSystem.out.println(\"no such email exist\");\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\temailList.remove(removingEmail);\r\n\t\t\t}\r\n\t\t\temail=emailList.toArray(new String[0]);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//updating the group id \r\n\t\tSystem.out.println(\"1. keep the same group Id\\n2. update the group Id\");\r\n\t\tchoice = Integer.parseInt(scanner.nextLine());\r\n\t\tint groupId;\r\n\t\tif(choice==1) {\r\n\t\t\tgroupId = existing.getGroupId();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"enter new group Id\");\r\n\t\t\tshowGroups(service); \t\t\t\t\t//this is static method which shows the available groups\r\n\t\t\tgroupId = Integer.parseInt(scanner.nextLine());\r\n\t\t}\r\n\t\t\r\n\t\t//setting up the contact object \r\n\t\tContact updated = new Contact(name, address, mobileNumber, imageReference, dateOfBirth, email, groupId);\r\n\t\t\r\n\t\t//calling the service update method which calls the DAO to update the contact\r\n\t\tint rowsEffected = service.updateExistingContact(existing, updated);\r\n\t\tSystem.out.println(rowsEffected+\" row(s) updated\");\r\n\t\t\r\n\t}",
"public void updateInfo(String ad, String e, Date l) {}",
"public synchronized void updateData(final Function<Table<?>, Result<? extends Record>> fetcher) {\n updateDataFields(fetcher);\n }",
"public void updateData() {\n\n ProgramWorker pw = new ProgramWorker();\n pw.execute();\n\n }",
"@Override\n\tpublic void updateInformation(String firstname, String lastname, String email, int id) {\t\t\n\t\ttry {\n\t\t\tString sql = \"update employees set first_name = '\"+firstname+\"', last_name='\"+lastname+\"',email = '\"+email+\"' where employee_id=\"+id; \n\t\t\tConnection connection = DBConnectionUtil.getConnection();\n\t\t\tStatement statement = connection.createStatement();\t\t\n\t\t\tstatement.executeUpdate(sql);\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void setUpdateData() {\n positionFenceToUpdateinController = Controller.getPositionFenceInArrayById(this.idFenceToUpdate);\n if(positionFenceToUpdateinController >= 0) {\n Fence fence = Controller.fences.get(positionFenceToUpdateinController);\n ((MainActivity)getActivity()).getSupportActionBar().setTitle(Constant.TITLE_VIEW_UPDATE_FENCE + \": \" + fence.getName());\n this.nameFence.setText(fence.getName());\n this.addressFence.setText(fence.getAddress());\n this.cityFence.setText(fence.getCity());\n this.provinceFence.setText(fence.getProvince());\n this.numberFence.setText(fence.getNumber());\n this.textSMSFence.setText(fence.getTextSMS());\n int index = (int)Constant.SPINNER_RANGE_POSITIONS.get(fence.getRange());\n this.spinnerRange.setSelection(index);\n this.spinnerEvent.setSelection(fence.getEvent());\n }\n }",
"protected abstract void updateFaxJobFromInputDataImpl(T inputData,FaxJob faxJob);",
"protected void updateLocalData(Building[] data){\n new DBHandler(cx).updateBuildings(data);\n }",
"public Update_info() {\n initComponents();\n display_data();\n }",
"void applyChanges() {\n trainFunction.setAlias(txtAlias.getText());\n trainFunction.getConfiguration().setAddress(txtAddress.getValue());\n\n trainFunction.getConfiguration().setBit(selectBit.getSelected().orElse(null));\n }",
"public void update() {\n int id = this.id;\n String name = person_name.getText().toString().trim();\n if (name.equals(\"\")) {\n Toast.makeText(getApplicationContext(), \"Enter the Name\", Toast.LENGTH_LONG).show();\n return;\n }\n String no = contact_no.getText().toString().trim();\n if (no.equals(\"\")) {\n Toast.makeText(getApplicationContext(), \"Enter the Contact No.\", Toast.LENGTH_LONG).show();\n return;\n }\n String nickname = nickName.getText().toString().trim();\n if (nickname.equals(\"\")) {\n nickname = \"N/A\";\n }\n String Custno = rootNo.getText().toString().trim();\n if (Custno.equals(\"\")) {\n Toast.makeText(getApplicationContext(), \"Enter the Customer No.\", Toast.LENGTH_LONG).show();\n return;\n }\n float custNo = Float.parseFloat(Custno);\n\n String Fees = monthly_fees.getText().toString().trim();\n if (Fees.equals(\"\")) {\n Toast.makeText(getApplicationContext(), \"Enter the monthly fees\", Toast.LENGTH_LONG).show();\n return;\n }\n int fees = Integer.parseInt(Fees);\n\n String Balance = balance_.getText().toString().trim();\n if (Balance.equals(\"\")) {\n Toast.makeText(getApplicationContext(), \"Enter the balance\", Toast.LENGTH_LONG).show();\n return;\n }\n int balance = Integer.parseInt(Balance);\n String date = startdate.getText().toString().trim();\n if (startdate.equals(\"\")) {\n Toast.makeText(getApplicationContext(), \"Enter the Start Date\", Toast.LENGTH_LONG).show();\n return;\n }\n\n\n dbHendler.updateInfo(new PersonInfo(id, name, no, custNo, fees, balance, areaId, date, nickname));\n person_name.setText(\"\");\n contact_no.setText(\"\");\n rootNo.setText(\"\");\n monthly_fees.setText(\"\");\n balance_.setText(\"\");\n nickName.setText(\"\");\n //changeButton.setEnabled(false);\n finish();\n viewAll();\n\n }",
"void update(String userName, String password, String userFullname,\r\n\t\tString userSex, int userTel, String role);",
"public void editDataInPerson(String alias, ArrayList<String> nameForManipulator, ArrayList<Integer> type,\n ArrayList<Integer> nameIndicator, ArrayList<Integer> typeIndicator, int instanceCount, int countIndicator, boolean exist, int id) {\n\n Person role = dataModel.getPerson(id);\n dataModel.addDatToPerson(role, alias, nameForManipulator, type, nameIndicator, typeIndicator, instanceCount, countIndicator, exist);\n }",
"private void prosesUpdate() {\n final String name = tvName.getText().toString();\r\n\r\n //get dari tabel/collection user\r\n Constants.refAcademicCal.addValueEventListener(new ValueEventListener() {\r\n @Override\r\n public void onDataChange(DataSnapshot dataSnapshot) {\r\n //mengambil data email\r\n AcademicModel emails = dataSnapshot.getValue(AcademicModel.class);\r\n\r\n Constants.refAcademicCal.child(\"name\").setValue(name);\r\n if (isPicChange)\r\n Constants.refAcademicCal.child(\"imgUrl\").setValue(photoUrl.toString());\r\n\r\n Toast.makeText(AcademicCal.this, \"Update berhasil!\", Toast.LENGTH_SHORT).show();\r\n finish();\r\n\r\n }\r\n\r\n @Override\r\n public void onCancelled(DatabaseError error) {\r\n // Failed to read value\r\n Log.w(\"\", \"Failed to read value.\", error.toException());\r\n //showProgress(false);\r\n }\r\n });\r\n }",
"public void update(){}",
"public void update(){}",
"public static void updateFlight() {\n\n String flightId;\n String flightDestination;\n String flightOrigin;\n String airline;\n\n Flights myFlights = new Flights();\n\n if (myFlights == null) {\n System.out.println(\"Flight not available.\");\n updateFlight();\n\n } else {\n flightId = writeText(\"Please enter new flight ID: \");\n myFlights.setFlightId(flightId);\n\n flightDestination = writeText(\"Please enter new destination: \");\n myFlights.setFlightDestination(flightDestination);\n\n flightOrigin = writeText(\"Please enter new flight origin: \");\n myFlights.setFlightOrigin(flightOrigin);\n\n airline = writeText(\"Please enter new airline: \");\n myFlights.setAirline(airline);\n\n }\n\n }",
"public static void update(int id, String nome, String cognome, String email, String citta, Date dataNascita, String username, String password, int ruolo, Date dataSignup ) {\r\n\t\tMap<String, Object> map = new HashMap<String, Object>();\r\n \r\n \tmap.put(\"nome\", nome);\r\n \tmap.put(\"cognome\", cognome);\r\n \tmap.put(\"email\", email);\r\n \tmap.put(\"citta\", citta);\r\n \tmap.put(\"dataNascita\", dataNascita);\r\n \tmap.put(\"username\", username);\r\n \tmap.put(\"password\", crypt(password));\r\n \tmap.put(\"ruolo\", ruolo); // ruolo dell'utente normale \r\n \tmap.put(\"dataSignup\", dataSignup);\r\n\t\ttry {\r\n\t\t\tDatabase.connect();\r\n \t\tDatabase.updateRecord(\"utente\", map, \"utente.id=\"+id);\r\n \t\tDatabase.close(); \t\t\r\n\t\t}catch(NamingException e) {\r\n \t\tSystem.out.println(e);\r\n }catch (SQLException e) {\r\n \tSystem.out.println(e);\r\n }catch (Exception e) {\r\n \tSystem.out.println(e); \r\n }\r\n\r\n\t}",
"public void updateData() {\n\t\tcal = eventsData.getCalendar();\n\t\tfirstDayOfWeek = eventsData.getFirstDayOfWeek();\n\t\tcurrentDayOfMonth = eventsData.getDayNumber();\n\t\tnumberOfDays = eventsData.getNumberOfDays();\n\t\tnumberOfWeeks = eventsData.getNumberOfWeeks();\n\t\tyear = eventsData.getYearNumber();\n\t\tmonth = eventsData.getMonthNumber();\n\t\tday = eventsData.getDayNumber();\n\t\tweek = eventsData.getDayOfWeek();\n\t}",
"public void updateCustomerInfo(){\n nameLabel.setText(customer.getName());\n productWantedLabel.setText(customer.getWantedItem());\n serviceManager.getTotalPrice().updateNode();\n }",
"public void update(String name) {\n\n\t}",
"public void update(Customer myCust){\n }",
"public void updateSupplierDetail(Supplier obj) {\n\t\t\r\n\t}",
"Test update(TestData testData, Test test);",
"@Override\n\t\t\t\t\t\t\t\t\t\tpublic void onData(boolean validity,\n\t\t\t\t\t\t\t\t\t\t\t\tObject obj) {\n\t\t\t\t\t\t\t\t\t\t\tsuper.onData(validity, obj);\n\t\t\t\t\t\t\t\t\t\t\tif (validity) {\n\t\t\t\t\t\t\t\t\t\t\t\tArrayList<Recv_phoneCheck> list = (ArrayList<Recv_phoneCheck>) obj;\n\t\t\t\t\t\t\t\t\t\t\t\tfor (Recv_phoneCheck item : list) {\n\t\t\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDao_Contacts\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.updatePhoneIfo(item);\n\t\t\t\t\t\t\t\t\t\t\t\t\t} catch (DbException e) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// catch block\n\t\t\t\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tP.v(getClass()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getName()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"更新数据失败\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}",
"void populateData();",
"Flight updateFlight(Flight flight);",
"public void update(String name){\n\n return;\n }",
"private void refreshData() {\n\t\tif (error == null) {\n\t\t\terror = \"\";\n\t\t}\n\t\terrorLabel.setText(error);\n\t\tif (error.trim().length() > 0) {\n\t\t\terror = \"\";\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Get instance of system\n\t\tFoodTruckManagementSystem ftms = FoodTruckManagementSystem.getInstance();\n\t\t\n\t\t// Populate info\n\t\tlblItemname.setText(item.getName());\n\t\tlblItemPrice.setText(String.format(\"$%.2f\", item.getPrice()/100.0));\n\t\t\n\t\t\n\t\t// Populate list\n\t\tString prev = supplyList.getSelectedValue();\n\t\tlistModel.clear();\n\t\tIterator<Supply> its = item.getSupplies().iterator();\n\t\tSupply current;\n\t\twhile(its.hasNext()) {\n\t\t\tcurrent = its.next();\n\t\t\tlistModel.addElement(String.format(\"%.20s %.2f\", current.getSupplyType().getName(), current.getQuantity()));\n\t\t}\n\t\tif(prev != null) supplyList.setSelectedValue(prev, true);\n\t\t\n\t\t// Populate combo box\n\t\tprev = (String) ingredientsComboBox.getSelectedItem();\n\t\tingredientsComboBox.removeAllItems();\n\t\tIterator<SupplyType> itst = ftms.getSupplyTypes().iterator();\n\t\twhile(itst.hasNext()) {\n\t\t\tingredientsComboBox.addItem(itst.next().getName());\n\t\t}\n\t\tif(prev != null) ingredientsComboBox.setSelectedItem(prev);\n\t\t\n\t\t// Reset text field\n\t\tqtyTextField.setText(\"\");\n\t}",
"public void updateData() {\n List<Device> devices = Lists.newArrayList();\n CustomAdapter customAdapter = (CustomAdapter) deviceListView.getAdapter();\n for (int i = 0; i < customAdapter.getCount(); i++) {\n Model model = customAdapter.getItem(i);\n if (model.isChecked()) {\n devices.add(model.getDevice());\n }\n }\n\n SensorDao sensorDao = new SensorDao(parentActivity);\n Map<Device, List<Sensor>> sensorDeviceMap = sensorDao.fetchDeviceSpecificSensors(devices);\n\n // Aggregate the information about sensor and devices based on unique\n // Map<BluetoothDevice, Map<FileName, List<SensorLabels>>>\n Map<BluetoothDevice, Map<String, List<String>>> rearrangedSensorDeviceInfo = Maps.newHashMap();\n for (Map.Entry<Device, List<Sensor>> elem : sensorDeviceMap.entrySet()) {\n Device device = elem.getKey();\n BluetoothDevice bluetoothDevice = CommonUtils.getBluetoothAdapter(\n parentActivity, REQUEST_BT_ENABLE).getRemoteDevice(device.getDeviceId());\n Map<String, List<String>> fileNameSensorNameMap = rearrangedSensorDeviceInfo.get(bluetoothDevice);\n List<Sensor> sensors = elem.getValue();\n\n if (fileNameSensorNameMap == null) {\n fileNameSensorNameMap = Maps.newHashMap();\n rearrangedSensorDeviceInfo.put(bluetoothDevice, fileNameSensorNameMap);\n }\n\n for(Sensor sensor : sensors) {\n String dataFilePath = sensor.getSensorDataFilePath();\n String sensorName = sensor.getSensorLabel();\n List<String> sensorNames = fileNameSensorNameMap.get(dataFilePath);\n if (sensorNames == null) {\n fileNameSensorNameMap.put(dataFilePath, Lists.newArrayList(sensorName));\n } else {\n sensorNames.add(sensorName);\n }\n }\n }\n\n IntentFilter intentFilter = new IntentFilter();\n intentFilter.addAction(ServerActionsService.ACTION_TRANSFER_FILE_AND_INSERT_DATA_STARTED);\n intentFilter.addAction(ServerActionsService.ACTION_TRANSFER_FILE_AND_INSERT_DATA_FINISHED);\n intentFilter.addAction(ServerActionsService.ACTION_TRANSFER_FILE_AND_INSERT_DATA_ENDED);\n intentFilter.addAction(ServerActionsService.ACTION_TRANSFER_FILE_AND_INSERT_DATA_INITIATED);\n parentActivity.registerReceiver(broadcastReceiver, intentFilter);\n\n //Start service for every device.\n for (Map.Entry<BluetoothDevice, Map<String, List<String>>> elem : rearrangedSensorDeviceInfo.entrySet()) {\n BluetoothDevice device = elem.getKey();\n Map<String, List<String>> fileNameSensorsMap = elem.getValue();\n if (fileNameSensorsMap.size() > 0) {\n Bundle bundle = new Bundle();\n bundle.putParcelable(ServerActionsService.PARAM_BLUETOOTH_DEVICE, device);\n bundle.putSerializable(PARAM_FILENAME_SENSOR_INFO, (Serializable) fileNameSensorsMap);\n\n Intent intent = new Intent(parentActivity, ServerActionsService.class);\n intent.setAction(ServerActionsService.ACTION_TRANSFER_FILE_AND_INSERT_DATA);\n intent.putExtras(bundle);\n\n parentActivity.startService(intent);\n }\n }\n }",
"public void updateDoctor() {\n\n\t\tSystem.out.println(\"\\n----Update Doctor----\");\n\t\tSystem.out.print(\"\\nEnter Doctor Id : \");\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tString did = sc.nextLine();\n\n\t\tMap<String, String> map = null;\n\t\ttry {\n\t\t\tmap = doctorDao.searchById(did);\n\t\t} catch (SQLException e) {\n\t\t\tlogger.info(e.getMessage());\n\t\t\treturn;\n\t\t}\n\n\t\tif (map == null || map.size() == 0) {\n\t\t\tlogger.info(\"Doctor Not Found!\");\n\t\t} else {\n\n\t\t\tprintPreviousDataOfDoctor(map);\n\n\t\t\tSystem.out.print(\"\\nEnter New Doctor Name : \");\n\t\t\tmap.put(\"dname\", sc.nextLine());\n\t\t\tSystem.out.print(\"\\nEnter New Doctor Speciality : \");\n\t\t\tmap.put(\"speciality\", sc.nextLine());\n\n\t\t\ttry {\n\t\t\t\tif (doctorDao.update(map) > 0) {\n\t\t\t\t\tlogger.info(\"Data Update Successfully...\");\n\t\t\t\t} else {\n\t\t\t\t\tlogger.info(\"Data update unsucessful!\");\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tlogger.info(e.getMessage());\n\t\t\t}\n\t\t}\n\t}",
"@Override\n\tpublic void update() {\n\t\tSystem.out.println(\"Mobile Customer update()\");\n\t}",
"public static void updatePersonDetails(int customerId, Database d) {\r\n\r\n\r\n\t\tCustomer oldCustomer = d.getCustomer(customerId);\r\n\t\tCustomer newCustomer = oldCustomer;\r\n\r\n\t\tboolean update = true;\r\n\t\tboolean[] updatecheck = new boolean[6];\r\n\t\tfor (int c = 0; c < 6; c++) {\r\n\r\n\t\t\tupdatecheck[c] = false;\r\n\r\n\t\t}\r\n\r\n\t\twhile (update) {\r\n\r\n\t\t\tSystem.out.println(\"Your current personal details are: \" + oldCustomer.name + \" , \" + oldCustomer.address\r\n\t\t\t\t\t+ \" , \" + oldCustomer.phone + \" , \" + oldCustomer.sex + \" , \" + oldCustomer.dob);\r\n\t\t\tSystem.out.println(\r\n\t\t\t\t\t\"Press a number to change a value: name (1), address (2), phone(3), sex (4), dob(5), pin(6)\");\r\n\t\t\tSystem.out.println(\"To exit the updating sesson press 0.\");\r\n\t\t\tString input = inputScanner.next();\r\n\t\t\tString newvalue = \"\";\r\n\r\n\t\t\t// stops the updating process\r\n\t\t\tif (input.equals(\"0\")) {\r\n\t\t\t\tupdate = false;\r\n\t\t\t\tSystem.out.println(\"Updating stopped, changes are saved.\");\r\n\t\t\t// changes the customers name\r\n\t\t\t} else if (input.equals(\"1\")) {\r\n\t\t\t\tSystem.out.println(\"Insert new value!\");\r\n\t\t\t\twhile (updatecheck[1] == false) {\r\n\t\t\t\t\tnewvalue = (String) inputScanner.next();\r\n\t\t\t\t\tif (newvalue.length() >= 3 && newvalue.length() < 25) {\r\n\t\t\t\t\t\tnewCustomer.name = newvalue;\r\n\t\t\t\t\t\tupdatecheck[0] = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tSystem.out.println(\"Please enter a name between 3 and 25 charakters.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t// changes the customers address\r\n\t\t\t} else if (input.equals(\"2\")) {\r\n\t\t\t\tSystem.out.println(\"Insert new value!\");\r\n\t\t\t\twhile (updatecheck[1] == false) {\r\n\t\t\t\t\tnewvalue = (String) inputScanner.next();\r\n\t\t\t\t\tif (newvalue.length() >= 5 && newvalue.length() < 40) {\r\n\t\t\t\t\t\tnewCustomer.address = newvalue;\r\n\t\t\t\t\t\tupdatecheck[1] = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tSystem.out.println(\"Please enter a name between 5 and 40 charakters.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t// changes the customers phonenumber\t\r\n\t\t\t} else if (input.equals(\"3\")) {\r\n\t\t\t\tSystem.out.println(\"Insert new value!\");\r\n\t\t\t\twhile (updatecheck[2] == false) {\r\n\t\t\t\t\tnewvalue = (String) inputScanner.next();\r\n\t\t\t\t\tif (newvalue.length() >= 9 && newvalue.length() < 20) {\r\n\t\t\t\t\t\tnewCustomer.phone = newvalue;\r\n\t\t\t\t\t\tupdatecheck[2] = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tSystem.out.println(\"Please enter a name between 9 and 20 charakters.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t// changes the customers gender\r\n\t\t\t} else if (input.equals(\"4\")) {\r\n\t\t\t\tSystem.out.println(\"Insert new value!\");\r\n\t\t\t\twhile (updatecheck[3] == false) {\r\n\t\t\t\t\tnewvalue = (String) inputScanner.next();\r\n\t\t\t\t\tif (newvalue.equals(\"male\") || newvalue.equals(\"female\") || newvalue.equals(\"Male\") || newvalue.equals(\"Female\")) {\r\n\t\t\t\t\t\tnewCustomer.sex = newvalue;\r\n\t\t\t\t\t\tupdatecheck[3] = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tSystem.out.println(\"please write if the costumer is a ``male`` or a ``female``\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t// changes the customers pin, the old PIN is necessary for updating\r\n\t\t\t} else if (input.equals(\"5\")) {\r\n\t\t\t\tSystem.out.println(\"Insert new value!\");\r\n\t\t\t\tnewvalue = (String) inputScanner.next();\r\n\t\t\t\tnewCustomer.dob = newvalue;\r\n\t\t\t} else if (input.equals(\"6\")) {\r\n\t\t\t\tSystem.out.println(\"Insert new pin!\");\r\n\t\t\t\twhile (updatecheck[5] == false) {\r\n\t\t\t\t\tnewvalue = (String) inputScanner.next();\r\n\t\t\t\t\tif (newvalue.length() >= 0 && newvalue.length() < 5) {\r\n\t\t\t\t\t\tupdatecheck[5] = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tSystem.out.println(\"Please enter a number between 0 and 5.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println(\"Repeat new pin!\");\r\n\t\t\t\tString newvalue2 = (String) inputScanner.next();\t\t\t\t\r\n\t\t\t\tif (newvalue.equals(newvalue2)) {\r\n\t\t\t\t\tSystem.out.println(\"Insert old pin!\");\r\n\t\t\t\t\tnewvalue = (String) inputScanner.next();\r\n\t\t\t\t\tif ((oldCustomer.pin).equals(newvalue)) {\r\n\t\t\t\t\t\tnewCustomer.pin = newvalue2;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tSystem.out.println(\"Old PIN was not correct!\");\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tSystem.out.println(\"The PINs did not match!\");\r\n\t\t\t\t}\r\n\t\t\t} \r\n\r\n\t\t\toldCustomer = newCustomer;\r\n\r\n\t\t}\r\n\r\n\t}",
"void updateCoefficients(int eventId, String first, String nobody, String second, String fon, String fos, String son) throws DAOException;",
"public void updateNonDynamicFields() {\n\n\t}",
"Software update( Software s );",
"private void setDataForTicket(){\n int rowId = ticketGui.getSelectedRowId();\n Ticket ticket = controller.getTicketById(rowId);\n\n // setting the data from the ticket i got to the popup gui\n clientNameTextField.setText(ticket.getClientName());\n starIdTextField.setText(ticket.getStarId());\n emailTextField.setText(ticket.getEmail());\n phoneNumberTextField.setText(ticket.getPhoneNumber());\n deviceModelTextField.setText(ticket.getModel());\n descriptionTextArea.setText(ticket.getDescription());\n clubMemberNameTextField.setText(ticket.getMemberName());\n resolutionTextArea.setText(ticket.getResolution());\n\n }",
"public void updatePanel(String id, String name, String contact, String address, String email, String username, String password)\n\t{\n\t\tthis.textField.setText(id);\n\t\tthis.nameField.setText(name);\n\t\tthis.addressField.setText(address);\n\t\tthis.contactField.setText(contact);\n\t\tthis.emailField.setText(email);\n\t\tthis.usernameField.setText(username);\n\t\tthis.passwordField.setText(password);\n\t}",
"public void update() {\n\n dbWork.cleanAll();\n\n List<DataFromServiceKudaGo> list = requestDataFromService();\n\n List<Film> films = new ArrayList<>();\n for (DataFromServiceKudaGo data : list) {\n Film film = new Film(list.indexOf(data), data.getNameMovie(), data.getPosterMoviePath(),\n data.getRunning_time(), data.getPrice(), data.getImax(),\n data.getCountryFilm(), data.getYearFilm(), data.getTrailerFilm(),\n data.getAgeFilm(), data.getDirectorFilm(), data.getNameCinema(),\n data.getAddressCinema(), data.getPhone(), data.getStationAboutCinema(),\n data.getPosterCinemaPath(), data.getBeginning_time(), data.getDescription());\n films.add(film);\n }\n\n dbWork.setFilms(films);\n\n fillShows();\n }",
"@Override\n\tpublic void update(Customer t) {\n\n\t}",
"public void update() {\n System.out.print(\"What do you want to update? A person, address, house, reunion, \" +\n \"or relationship? \");\n Scanner scan = new Scanner(System.in);\n String toUpdate = scan.nextLine();\n if (toUpdate.equalsIgnoreCase(\"person\")) {\n updatePerson();\n }\n else if (toUpdate.equalsIgnoreCase(\"address\")) {\n updateAddress();\n }\n else if (toUpdate.equalsIgnoreCase(\"house\")) {\n updateHouse();\n }\n else if (toUpdate.equalsIgnoreCase(\"reunion\")) {\n // show all reunions\n this.updateReunion();\n }\n else if (toUpdate.equalsIgnoreCase(\"relationship\")) {\n // show all reunions\n this.updateRelationship();\n }\n }",
"public void update(String t, String d, int p, int g)\n {\n this.title = t;\n this.des = d;\n this.price = p;\n this.guests = g;\n }",
"@Override\n\t\t\tpublic void onDataCallBack(String request, int code) {\n\t\t\t\tSQLiteManager.getInstance().updateFamilyUserInfo(\n\t\t\t\t\t\tinfo.getUserID(),\n\t\t\t\t\t\tFamilyUserInfo._FAMILY_USER_NICK_NAME,\n\t\t\t\t\t\tinfo.getNickName(), true);\n\t\t\t\tSQLiteManager.getInstance().updateFamilyInfo(info.getUserID(),\n\t\t\t\t\t\tFamilyInfo._FAMILY_NICKNAME, info.getNickName(), true);\n\t\t\t}",
"public void updateBusinessData(Map<String,Object> params) throws Exception;",
"@FXML\n public void setOldData(ActionEvent event){\n PersonDAO personDAO = new PersonDAO();\n ShopUIController shopUIController = new ShopUIController();\n Person oldUser = personDAO.getUserByID(shopUIController.getId());\n //Fill textfields with old data\n firstName.setText(oldUser.getFirstName());\n lastName.setText(oldUser.getLastName());\n email.setText(oldUser.getEmail());\n password.setText(oldUser.getPassword());\n phone.setText(oldUser.getPhone());\n Address oldAddress = oldUser.getAddress();\n address1.setText(oldAddress.getAddress1());\n address2.setText(oldAddress.getAddress2());\n postalCode.setText(oldAddress.getPostalCode());\n city.setText(oldAddress.getCity());\n country.setText(oldAddress.getCountry());\n googlePassword.setText(oldUser.getTfa());\n }",
"@Override\n\tpublic void update(Unidade obj) {\n\n\t}",
"@FXML private void refreshData(){\n\t\tclearFields();\n\t\treadUsers();\n\t\tshowUsers();\n\t\trefreshInformationsFromTableView(null);\n\t}",
"public void updatePhone(DetailModel detailModel){\n\n }",
"private static void update(int portNummber, InetAddress address, Product product){\n\n for(SensorData sensorData : actualSensorDatas){\n if((sensorData.getPortNummber() == portNummber)\n || (sensorData.getAddress() == address)\n || (sensorData.getProduct().getNameOfProduct() == product.getNameOfProduct()) ){\n sensorData.setProduct(product) ;\n }\n }\n }",
"@Override\n public boolean updateUserPersonalInfo(String text) {\n User tmp = this.getLoggedUser();\n tmp.setPersonal_details(text);\n if(this.setLoggedUser(tmp)) System.out.print(\"done\");\n Connection conn = null;\n Statement stmt = null;\n try \n {\n db_controller.setClass();\n conn = db_controller.getConnection();\n stmt = conn.createStatement();\n String sql;\n \n sql = \"UPDATE user_personal_information set information = + '\" + text + \"' where user_id = \" + this.getLoggedUser().getId();\n \n int result = stmt.executeUpdate(sql);\n \n stmt.close();\n conn.close();\n if(result == 1) return true;\n else return false;\n } \n catch (SQLException ex) { ex.printStackTrace(); return false;} \n catch (ClassNotFoundException ex) { ex.printStackTrace(); return false;} \n \n }",
"@Override\n public void update(String name, String surname) {\n this.name = name;\n this.surname = surname;\n }",
"public void updateinfo(String name) throws BaseException {\n\t\tConnection conn = null;\n\t String ygno = BeanControl.currentLoginControl.getygno();\n\t try {\n\t \tconn = DBUtil.getConnection();\n\t \tString sql = \"update gly_info set yg_name=? where yg_no=?\";\n\t \tjava.sql.PreparedStatement pst = conn.prepareStatement(sql);\n\t \tpst.setString(1, name);\n\t \tpst.setString(2, ygno);\n\t \tpst.execute();\n\t \tpst.close();\n\t \t} catch (SQLException e) {\n\t \t\te.printStackTrace();\n\t \t\tthrow new DbException(e);\n\t \t} finally {\n\t \t\tif (conn != null)\n\t \t\t\ttry {\n\t \t\t\t\tconn.close();\n\t \t\t\t} catch (SQLException e) {\n\t \t\t\t\te.printStackTrace();\n\t \t\t\t}\n\t \t}\n\t}",
"public void editDataInIteration(String alias, ArrayList<String> actName, ArrayList<LocalDate> endDateL, ArrayList<LocalDate> startDateL, ArrayList<String> desc,\n ArrayList<Integer> confIndex, ArrayList<ArrayList<Integer>> workUnitIndexList,\n ArrayList<Integer> workUnitIndicators, ArrayList<Integer> nameIndicator, ArrayList<Integer> endDateIndicator,\n ArrayList<Integer> startDateIndicator, ArrayList<Integer> descIndicator, ArrayList<Integer> confIndicator, boolean exist, int id) {\n Iteration iteration = dataModel.getIteration(id);\n dataModel.addDataToIteration(iteration, alias, actName, endDateL, startDateL, desc,\n confIndex, workUnitIndexList, workUnitIndicators, nameIndicator, endDateIndicator, startDateIndicator, descIndicator, confIndicator, exist);\n }",
"public static void updateAddCredit(String data, ArrayList<String> usersData) {\n\n \tString username = data.substring(3, 18);\n\n \t//the code below gets the user's data string, finds the portion which contains credits\n \t// and then converts it to float\n \tint userDataIndex = BackEnd.findUser(username, usersData);\n \tString userData = usersData.get(userDataIndex); // using index\n\n \tfloat creditsToAdd = Float.parseFloat(data.substring(22,31));\n\t\tSystem.out.println(creditsToAdd);\n\n \tfloat availableCredits = Float.parseFloat(userData.substring(19, 28));\n \tfloat newTotalCredits = availableCredits + creditsToAdd;\n \tString newUserData = userData.substring(0,19) + BackEnd.floatToStringFormat(newTotalCredits, 9);\n\n \tusersData.set(userDataIndex, newUserData);\n \tSystem.out.println(usersData.toString());\n }",
"@Override\n\tpublic void update(Object entidade) {\n\t\t\n\t}",
"public static void updateAllergy(final Context context, final HashMap<String, String> data) {\n\n // Set initial state\n loader.setVisibility(View.VISIBLE);\n allergyRecyclerViewList.setVisibility(View.GONE);\n\n // Url\n String url = ServiceUrls.KEY_HEALTHBOOK_ALLERGIES\n .concat(StringConstants.KEY_UPDATE)\n .concat(data.get(StringConstants.KEY_ALLERGY_P_ID));\n\n // Set Data\n final HashMap<String, Object> postData = new HashMap<>();\n postData.put(StringConstants.KEY_ALLERGY_ID, Integer.valueOf(data.get(StringConstants.KEY_ALLERGY_ID)));\n postData.put(StringConstants.KEY_ALLERGY_TYPE, data.get(StringConstants.KEY_ALLERGY_TYPE));\n postData.put(StringConstants.KEY_ALLERGY_KIND_OF_REACTION, data.get(StringConstants.KEY_ALLERGY_KIND_OF_REACTION));\n postData.put(StringConstants.KEY_START_DATE,\n DateTimeUtils.convertTimestampToUTC(Long.valueOf(data.get(StringConstants.KEY_ALLERGY_DATE_OF_ONSET))));\n postData.put(StringConstants.KEY_COMMENT, data.get(StringConstants.KEY_COMMENT));\n\n // Set Headers\n final HashMap<String, String> headers = new HashMap<>();\n headers.put(StaticConstants.KEY_AUTHORIZATION, StaticConstants.KEY_BEARER.concat(\" \")\n .concat(SharedPreferenceService.getValue(context, StringConstants.KEY_TOKEN)));\n\n if (Validation.isConnected(context)) {\n\n // API Call\n APICallService.PutAPICall(activity, context, url, postData, headers, new APIInterface() {\n\n @Override\n public void onSuccess(JSONObject response) {\n\n try {\n\n /**\n * Fetch and Update Local Database\n */\n Allergy mAllergyModel =\n Allergy.find(Allergy.class, \"p_id = ?\", data.get(StringConstants.KEY_ALLERGY_P_ID)).get(0);\n\n mAllergyModel.setReaction(data.get(StringConstants.KEY_ALLERGY_KIND_OF_REACTION));\n mAllergyModel.setStartDate(\n DateTimeUtils.convertTimestampToDate(Long.valueOf(data.get(StringConstants.KEY_ALLERGY_DATE_OF_ONSET))));\n mAllergyModel.setComment(data.get(StringConstants.KEY_ALLERGY_COMMENTS));\n mAllergyModel.save();\n\n // Notify adapter\n readAllergyList(context);\n\n } catch (Exception e) {\n\n // Show content\n loader.setVisibility(View.GONE);\n allergyRecyclerViewList.setVisibility(View.VISIBLE);\n\n // Log error\n ErrorHandlers.handleError(activity);\n Crashlytics.logException(e);\n }\n }\n\n @Override\n public void onError(VolleyError error) {\n\n // Show content\n loader.setVisibility(View.GONE);\n allergyRecyclerViewList.setVisibility(View.VISIBLE);\n }\n });\n\n } else {\n\n\n // Show content\n loader.setVisibility(View.GONE);\n allergyRecyclerViewList.setVisibility(View.VISIBLE);\n\n // Internet Not Available\n ErrorHandlers.handleInternetConnectionFailure(activity);\n }\n }",
"@Override\r\n\tpublic void update(Cidade obj) {\n\r\n\t}",
"void setDataIntoSuppBusObj() {\r\n supplierBusObj.setValue(txtSuppId.getText(),txtSuppName.getText(), txtAbbreName.getText(),\r\n txtContactName.getText(),txtContactPhone.getText());\r\n }",
"public void dataChanged() {\n\t\tif (wijzigInfo)\n\t\t\twijzigInfo();\n\n\t\tsetChanged();\n\t\tnotifyObservers(\"dataChanged\");\n\t}",
"@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setName(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET name='\"+data.getName()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}",
"public void editDataInCommit(String alias, ArrayList<String> nameForManipulator, ArrayList<Integer> nameIndicator, ArrayList<String> descriptions, ArrayList<Integer> descriptionsIndicator,\n ArrayList<LocalDate> createDate, ArrayList<Integer> createIndicator,\n boolean release, int instanceCount, int countIndicator, boolean exist, int id) {\n Commit commit = dataModel.getCommit(id);\n dataModel.addDataToCommit(commit, alias, nameForManipulator, nameIndicator, descriptions, descriptionsIndicator, createDate, createIndicator, release, instanceCount, countIndicator, exist);\n }",
"public void updateData() throws SQLException {\n pst=con.prepareStatement(\"update employee set name=?,city=? where id=?\");\n System.out.println(\"Enter name: \");\n String name=sc.next();\n pst.setString(1,name);\n\n System.out.println(\"Enter city: \");\n String city=sc.next();\n pst.setString(2,city);\n\n System.out.println(\"Enter id: \");\n int id=sc.nextInt();\n pst.setInt(3,id);\n pst.execute();\n\n System.out.println(\"Data updated successfully\");\n }",
"public Scratch_update_details(String network,String price,String pinn,String batch,String serial,String id){\n try {\n initComponents();\n setTitle(\"Details\");\n setLocationRelativeTo(this);\n loadnetwork();\n lblNetwork.setText(network);\n lblPrice.setText(price);\n pinTXT.setText(pinn);\n batchTXT.setText(batch);\n serialTXT.setText(serial);\n lblid.setText(id);\n \n } catch (Exception ex) {\n Logger.getLogger(Scratch_update_details.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n \n \n \n \n \n }",
"int updateContact(String email, String firstName, String lastName, String phone, String username);",
"@Override\n\tpublic void update(Phone phone) {\n\t\t\n\t}",
"public void updatePerson(){\r\n\r\n // Generally update is performed after search \r\n // need to find out which record is going to update \r\n\r\n if (recordNumber >= 0 && recordNumber < personsList.size())\r\n {\r\n PersonInfo person = (PersonInfo)personsList.get(recordNumber);\r\n\r\n int id = person.getId();\r\n\r\n\t /*get values from text fields*/ \r\n\t name = tfName.getText();\r\n\t address = tfAddress.getText();\r\n\t phone = Integer.parseInt(tfPhone.getText());\r\n email = tfEmail.getText();\r\n\r\n\t /*update data of the given person name*/\r\n\t person = new PersonInfo(id, name, address, phone, email);\r\n pDAO.updatePerson(person);\r\n\r\n\t JOptionPane.showMessageDialog(null, \"Person info record updated successfully.\"); \r\n }\r\n else\r\n { \r\n JOptionPane.showMessageDialog(null, \"No record to Update\"); \r\n }\r\n }",
"private void fillData()\n {\n\n }",
"private void updrec() {\n\t\tsavedata();\n\t\tcontractDetail.retrieve(stateVariable.getXwordn(), stateVariable.getXwabcd());\n\t\tnmfkpinds.setPgmInd36(! lastIO.isFound());\n\t\tnmfkpinds.setPgmInd66(isLastError());\n\t\t// BR00011 Product found on Contract_Detail and NOT ERROR(CONDET)\n\t\tif (! nmfkpinds.pgmInd36() && ! nmfkpinds.pgmInd66()) {\n\t\t\trestoredata();\n\t\t\tcontractDetail.update();\n\t\t\tnmfkpinds.setPgmInd99(isLastError());\n\t\t\tif (nmfkpinds.pgmInd99()) {\n\t\t\t\tmsgObjIdx = setMsgObj(\"Y2U0007\", \"\", msgObjIdx, messages);\n\t\t\t\tstateVariable.setZmsage(subString(errmsg, 1, 78));\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tstateVariable.setZmsage(subString(errmsg, 1, 78));\n\t\t}\n\t}"
] | [
"0.71694046",
"0.70405304",
"0.6534012",
"0.6377777",
"0.63689095",
"0.6290864",
"0.62735224",
"0.62307614",
"0.6123321",
"0.6054586",
"0.5999355",
"0.5977002",
"0.595322",
"0.5948244",
"0.59428316",
"0.5933005",
"0.5909339",
"0.59066546",
"0.5906566",
"0.58832836",
"0.58764917",
"0.58689296",
"0.585091",
"0.58288026",
"0.5822644",
"0.5796727",
"0.5779934",
"0.57702416",
"0.57441646",
"0.5733365",
"0.5730008",
"0.5729207",
"0.57244235",
"0.57079226",
"0.5692576",
"0.56906134",
"0.5687373",
"0.5687148",
"0.56840235",
"0.56788814",
"0.56673473",
"0.5661078",
"0.5660157",
"0.56553537",
"0.56548053",
"0.5646326",
"0.5636844",
"0.5625569",
"0.5625569",
"0.5613817",
"0.56118965",
"0.5609262",
"0.5606994",
"0.560198",
"0.56017905",
"0.55959284",
"0.55909497",
"0.55895525",
"0.5573669",
"0.5573291",
"0.5566289",
"0.5561231",
"0.5559749",
"0.5555104",
"0.5549248",
"0.5548357",
"0.5547947",
"0.5542596",
"0.55407476",
"0.5536882",
"0.55243343",
"0.55163574",
"0.55146444",
"0.549764",
"0.549027",
"0.5488835",
"0.54860884",
"0.5476003",
"0.54650253",
"0.5462978",
"0.5462609",
"0.54454184",
"0.54442596",
"0.5431905",
"0.54283994",
"0.54213166",
"0.54203266",
"0.54189515",
"0.54159844",
"0.5413984",
"0.5412194",
"0.5412189",
"0.54121846",
"0.5409581",
"0.54092926",
"0.53960794",
"0.5395356",
"0.5395172",
"0.5391431",
"0.538531",
"0.5380908"
] | 0.0 | -1 |
it's already called by updatedResource(ResourceEvent event) | @Override
public void notifyAppointmentWFActionTriggered( int nIdAppointment, int nIdAction )
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void updateResourceInformation() {\n\t}",
"@Override\n\tpublic void updateResourceInformation() {\n\t}",
"@Override\n\tpublic void resourceChanged(IResourceChangeEvent arg0) {\n\t\t\n\t}",
"@Override\n public void addedResource( ResourceEvent event )\n {\n }",
"@Override\n public void refreshResources() {\n\n }",
"public void resourceChanged(IResourceChangeEvent event)\r\n\t\t{\n\t\t\tupdateErrors();\r\n\t\t}",
"@Override\n public void updatedResource( ResourceEvent event )\n {\n if ( event.getTypeResource( ).equals( Appointment.APPOINTMENT_RESOURCE_TYPE ) )\n {\n IndexingAppointmentService.getService( ).indexAppointmentStateAndHistory( _appointmentDataSource, _appointmentHistoryDataSource,\n Integer.parseInt( event.getIdResource( ) ) );\n }\n\n }",
"public void update()\n {\n modifier = coral.getCurrentSubject();\n modified = new Date();\n try\n {\n persistence.save(this);\n }\n catch(SQLException e)\n {\n throw new BackendException(\"failed to update resource's persitent image\", e);\n }\n try\n {\n Resource impl = coral.getStore().getResource(getId());\n coralEventHub.getGlobal().fireResourceChangeEvent(impl, modifier);\n }\n catch(EntityDoesNotExistException e)\n {\n throw new BackendException(\"inconsistent data\", e);\n }\n }",
"@Override\r\n\tpublic void update(Resources resources) {\n\t\t\r\n\t}",
"public abstract void onContainerResourceUpdated(\n ContainerId containerId, Resource resource);",
"public void resourceChanged(IResourceChangeEvent event) {\n\n\t\tint eventType = event.getType();\n\t\tIResourceDelta delta = event.getDelta();\n\t\tswitch (eventType) {\n\t\tcase IResourceChangeEvent.POST_CHANGE:\n\t\t\tcheckProjectsAndDescriptorChanges(delta);\n\t\t\tbreak;\n\t\t}\n\t}",
"public void onResourceAdded(final ResourceEvent resourceEvent);",
"void handleNewResource() {\n System.out.println(\"Here at VMLeaseProcessor#handleNewResource\");\n callForBackup();\n resourceManager.createRedundant();\n }",
"private void updateResorce() {\n }",
"public void resourceChanged(Resource item, Subject subject)\n {\n event(\"ResourceChange\",\n item.getId(),\n subject != null ? subject.getId() : -1,\n -1,\n false);\n }",
"public void setResource(ResourceVO newResource) {\n\tresource = newResource;\n}",
"protected void handleChangedResources() {\r\n\t\tif (!changedResources.isEmpty()\r\n\t\t\t\t&& (!isDirty() || handleDirtyConflict())) {\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif (isDirty()) {\r\n\t\t\t\tchangedResources.addAll(editingDomain.getResourceSet()\r\n\t\t\t\t\t\t.getResources());\r\n\t\t\t}\r\n\t\t\teditingDomain.getCommandStack().flush();\r\n\r\n\t\t\tupdateProblemIndication = false;\r\n\t\t\tfor (Resource resource : changedResources) {\r\n\t\t\t\tif (resource.isLoaded()) {\r\n\t\t\t\t\tresource.unload();\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tresource.load(Collections.EMPTY_MAP);\r\n\t\t\t\t\t} catch (IOException exception) {\r\n\t\t\t\t\t\tif (!resourceToDiagnosticMap.containsKey(resource)) {\r\n\t\t\t\t\t\t\tresourceToDiagnosticMap\r\n\t\t\t\t\t\t\t\t\t.put(resource, analyzeResourceProblems(\r\n\t\t\t\t\t\t\t\t\t\t\tresource, exception));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (AdapterFactoryEditingDomain.isStale(editorSelection)) {\r\n\t\t\t\tsetSelection(StructuredSelection.EMPTY);\r\n\t\t\t}\r\n\r\n//\t\t\tupdateProblemIndication = true;\r\n//\t\t\tupdateProblemIndication();\r\n\t\t}\r\n\t}",
"@Override\n public void onResourcesChanged(int resources) {\n }",
"public void resourceChanged(final IResourceChangeEvent event) {\n\t\tif (event.getType() == IResourceChangeEvent.POST_CHANGE) {\n\t\t\tif (event.getDelta() != null) {\n\t\t\t\tif (event.getDelta().getKind() == IResourceDelta.CHANGED || event.getDelta().getKind() == IResourceDelta.REMOVED) {\n\t\t\t\t\tDisplay.getDefault().asyncExec(new Runnable() {\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tpageMainEditor.refreshLstClasses();\n\t\t\t\t\t\t\tpageMainEditor.updateBuildPathStatus(getEditor(1));\n\t\t\t\t\t\t\tpageMainEditor.checkCache();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (event.getType() == IResourceChangeEvent.PRE_CLOSE) {\n\t\t\tDisplay.getDefault().asyncExec(new Runnable() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\tIWorkbenchPage[] pages = getSite().getWorkbenchWindow().getPages();\n\t\t\t\t\tfor (int i = 0; i < pages.length; i++) {\n\t\t\t\t\t\tif (((FileEditorInput) editor.getEditorInput()).getFile().getProject().equals(event.getResource())) {\n\t\t\t\t\t\t\tIEditorPart editorPart = pages[i].findEditor(editor.getEditorInput());\n\t\t\t\t\t\t\tpages[i].closeEditor(editorPart, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}",
"public interface ResourceListener {\n\n\tpublic void update(ResourceList resource);\n}",
"@Override\n\tpublic void onResourceDelivered(ResourceResponse arg0) {\n\t\t\n\t}",
"@Override\r\n\tpublic Ressource update(Ressource obj) {\n\t\treturn null;\r\n\t}",
"public void resourceChanged(IResourceChangeEvent event) {\n \t\t\t\tbarrier[0] = TestBarrier.STATUS_START;\n \t\t\t\ttry {\n \t\t\t\t\tTestBarrier.waitForStatus(barrier, TestBarrier.STATUS_DONE);\n \t\t\t\t} catch (Throwable e) {\n \t\t\t\t\terror[0] = e;\n \t\t\t\t}\n \t\t\t}",
"void resourceChanged(IPath workspacePath);",
"protected void resourceSet(String resource)\r\n {\r\n // nothing to do\r\n }",
"@Override\n public void deletedResource( ResourceEvent event )\n {\n\n }",
"public void setResource(int newResource) throws java.rmi.RemoteException;",
"public void updateResources(int r) {\n\t\t_resources.setText(\"Resources: \"+r);\n\t\tvalidate();\n\t\trepaint();\n\t}",
"@Override\n protected void update(List<Event> result, Ec2LaunchConfiguration oldResource, Ec2LaunchConfiguration newResource) {\n \n }",
"public void onResourceMoved(final ResourceEvent resourceEvent);",
"public void setResource(ResourceInfo resource) {\n\t\tif (this.resource != null) {\n\t\t\tthrow new IllegalStateException(\"The resource pointer can only be set once for Resource [\" + name + \"]\");\n\t\t}\n\t\tthis.resource = resource;\n\t}",
"public void setRWResource(RWResource theResource) {\n resource = theResource;\n }",
"protected void setResource(final Resource resource) {\n this.resource = resource;\n }",
"public void addResourceChangeListener() {\n\t\tif (elementChange == null) {\n\t\t\telementChange = new JavaElementChange();\n\t\t}\n\t}",
"@Override\n public void onLoadResources() {\n }",
"private void recordChangedResources(IResourceDelta delta) throws CoreException {\n \t\tchangedResources.clear();\n \t\tif (delta == null)\n \t\t\treturn;\n \t\tdelta.accept(new IResourceDeltaVisitor() {\n \t\t\t/*\n \t\t\t * @see IResourceDeltaVisitor#visit(IResourceDelta)\n \t\t\t */\n \t\t\tpublic boolean visit(IResourceDelta delta) throws CoreException {\n \t\t\t\tchangedResources.add(delta.getResource());\n \t\t\t\treturn true;\n \t\t\t}\n \t\t});\n \t}",
"private void onResourceUpdateClicked(UpdateClickedEvent event) {\n\t\tUpdateResourceModal updateResourceModal2 = new UpdateResourceModal(\"update-resource-modal\");\n\t\tupdateResourceModal.replaceWith(updateResourceModal2);\n\t\tupdateResourceModal = updateResourceModal2;\n\t\tupdateResourceModal.show(event.getTarget());\n\t}",
"private void updateResourceText() {\n String resourceTextString=\"Available resources: \\n\";\n boolean none=true;\n for (Resource resource :resources.values()) {\n if (resource.getStock()>0) {\n resourceTextString+=resource.getName()+\": \"+resource.getStock()+\"\\n\";\n none=false;\n }\n }\n if (none) {resourceTextString=\"\";}\n resourceText.setText(resourceTextString);\n }",
"@Override\n public void addListener(ResourceListener listener) {\n }",
"public void addResource(PSResource res) {\n/* 72 */ prepareResourceSet();\n/* 73 */ this.resources.add(res);\n/* */ }",
"public void resourceClassChanged(ResourceClass<?> item)\n {\n event(\"ResourceClassChange\",\n item.getId(),\n -1,\n -1,\n false);\n }",
"@Override\r\n\tpublic void setGetResource(ResourceType resource) {\n\t\t\r\n\t}",
"public void onResourceRemoved(final ResourceEvent resourceEvent);",
"private void updateResourceMetaInfo(COElementAbstract element) {\r\n\telement.setId(UUID.uuid());\r\n\telement.setIdParent(null);\r\n\tif (element.isCOContentResourceProxy()) {\r\n\t COContentResourceProxy coResProxy =\r\n\t\t (COContentResourceProxy) element;\r\n\t if (COContentResourceType.DOCUMENT.equals(coResProxy.getResource()\r\n\t\t .getType())) {\r\n\t\tContentResourceEdit newResource;\r\n\t\ttry {\r\n\t\t String uri =\r\n\t\t\t coResProxy.getResource().getProperty(\r\n\t\t\t\t COPropertiesType.IDENTIFIER,\r\n\t\t\t\t COPropertiesType.IDENTIFIER_TYPE_URI);\r\n\t\t newResource = contentHostingService.editResource(uri);\r\n\r\n\t\t newResource.getPropertiesEdit().addProperty(\r\n\t\t\t ResourceProperties.PROP_DESCRIPTION,\r\n\t\t\t coResProxy.getResource().getProperty(\r\n\t\t\t\t COPropertiesType.DESCRIPTION));\r\n\t\t newResource.getPropertiesEdit().addProperty(\r\n\t\t\t ResourceProperties.PROP_COPYRIGHT_CHOICE,\r\n\t\t\t coResProxy.getResource().getProperty(\r\n\t\t\t\t COPropertiesType.LICENSE));\r\n\t/*\r\n\t * SAKAI 11: check for \t ResourceProperties.PROP_TYPE_RESOURCE\r\n\t * \r\n\t * newResource.getPropertiesEdit().addProperty(\r\n\t\t\t ResourceProperties.PROP_TYPE_RESOURCE,\r\n\t\t\t coResProxy.getResource().getProperty(\r\n\t\t\t\t COPropertiesType.ASM_RESOURCE_TYPE));*/\r\n\r\n\t\t contentHostingService.commitResource(newResource,\r\n\t\t\t NotificationService.NOTI_NONE);\r\n\t\t} catch (PermissionException e) {\r\n\t\t e.printStackTrace();\r\n\t\t} catch (IdUnusedException e) {\r\n\t\t e.printStackTrace();\r\n\t\t} catch (TypeException e) {\r\n\t\t e.printStackTrace();\r\n\t\t} catch (InUseException e) {\r\n\t\t e.printStackTrace();\r\n\t\t} catch (OverQuotaException e) {\r\n\t\t e.printStackTrace();\r\n\t\t} catch (ServerOverloadException e) {\r\n\t\t e.printStackTrace();\r\n\t\t}\r\n\t }\r\n\t} else {\r\n\t for (int i = 0; i < element.getChildrens().size(); i++) {\r\n\t\tCOElementAbstract childElement =\r\n\t\t\t(COElementAbstract) element.getChildrens().get(i);\r\n\t\tupdateResourceMetaInfo(childElement);\r\n\t }\r\n\t}\r\n }",
"public void resourceCreated(Resource resource)\n {\n event(\"ResourceCreation\",\n resource.getId(),\n -1,\n -1,\n false);\n }",
"@Override\n\t\tpublic void publishResource(FlexoResource<?> resource, FlexoVersion newVersion) throws Exception {\n\t\t}",
"private void OnInflated() \r\n { \r\n if (_inflatedList != null)\r\n { \r\n for/*each*/ (ResourceReferenceExpression listener : _inflatedList)\r\n {\r\n listener.OnDeferredResourceInflated(this);\r\n } \r\n }\r\n }",
"@Override\r\n\t\tpublic void update() {\n\t\t\t\r\n\t\t}",
"@Override\r\n\t\tpublic void update() {\n\t\t\t\r\n\t\t}",
"@Override\n\t\tpublic void update() {\n\n\t\t}",
"@Override\n\t\tpublic void update() {\n\n\t\t}",
"@Override\n\t\tpublic void update() {\n\n\t\t}",
"private void onResourceMove(ResourceMoveEvent event) throws ROSRSException, ROException {\n\t\tif (currentFolder != null) {\n\t\t\tFolderEntry entry = null;\n\t\t\tfor (FolderEntry e : currentFolder.getFolderEntries().values()) {\n\t\t\t\tif (e.getResource().equals(currentResource)) {\n\t\t\t\t\tentry = e;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (entry != null) {\n\t\t\t\tentry.delete();\n\t\t\t}\n\t\t}\n\t\tif (!event.getFolder().isLoaded()) {\n\t\t\tevent.getFolder().load();\n\t\t}\n\t\tevent.getFolder().addEntry(currentResource, null);\n\t\tsend(getPage(), Broadcast.BREADTH, new ResourceMovedEvent(event.getTarget()));\n\t}",
"@SuppressWarnings(\"MissingSuperCall\")\n @Override\n public void onResourceReady(\n @NonNull Object resource, @Nullable Transition<? super Object> transition) {\n // Avoid calling super.\n }",
"public ModifiableResource(Resource resource) {\n super(resource);\n }",
"public interface ResourceListener extends EventListener {\n\n\t/**\n\t * Called when a resource is added. The URI of the added resource will be in <code>getResoureURI()</code>. The resource description may be in\n\t * <code>getResource()</code>, and information about the parent resource may be in <code>getParentResourceURI()</code> and <code>getParentResource()</code>,\n\t * depending on the implementing class.\n\t * @param resourceEvent The event identifying the added resource.\n\t * @see ResourceEvent#getResourceURI\n\t * @see ResourceEvent#getResource\n\t */\n\tpublic void onResourceAdded(final ResourceEvent resourceEvent);\n\n\t/**\n\t * Called when a resource is removed. The URI of the removed resource will be in <code>getResoureURI()</code>. The resource description may be in\n\t * <code>getResource()</code>, and information about the parent resource may be in <code>getParentResourceURI()</code> and <code>getParentResource()</code>,\n\t * depending on the implementing class.\n\t * @param resourceEvent The event identifying the removed resource.\n\t * @see ResourceEvent#getResourceURI\n\t * @see ResourceEvent#getResource\n\t */\n\tpublic void onResourceRemoved(final ResourceEvent resourceEvent);\n\n\t/**\n\t * Called when a resource is renamed to a different referenceURI. The new URI of the renamed resource will be in <code>getResoureURI()</code>, and its\n\t * resource description may be in <code>getResource()</code>, depending on the implementing class. The old URI of the renamed resource will be in\n\t * <code>getOldResourceURI</code>, and its old resource description may be in <code>getOldResource()</code>, depending on the implementing class. Information\n\t * about the new parent resource may be in <code>getParentResourceURI()</code> and <code>getParentResource()</code>, and information about the old parent\n\t * resource may be in <code>getOldParentResourceURI()</code> and <code>getOldParentResource()</code>, depending on the implementing class.\n\t * @param resourceEvent The event identifying the removed resource.\n\t * @see ResourceEvent#getOldParentResourceURI\n\t * @see ResourceEvent#getOldParentResource\n\t * @see ResourceEvent#getOldResourceURI\n\t * @see ResourceEvent#getOldResource\n\t * @see ResourceEvent#getParentResourceURI\n\t * @see ResourceEvent#getParentResource\n\t * @see ResourceEvent#getResourceURI\n\t * @see ResourceEvent#getResource\n\t */\n\tpublic void onResourceMoved(final ResourceEvent resourceEvent);\n\n}",
"public void upateResources() {\r\n\t\tResourceBase resourcesBase = parent.getResources();\r\n\t\tresourcesBase.getAll().forEach((key, value) -> {\r\n\t\t\tif(resources.containsKey(key))\t//ak už je vypísaná\r\n\t\t\t\tresources.get(key).updateValue();\t//aktualizuje ju to\r\n\t\t\telse{\t//ináč\r\n\t\t\t\tint need = resourcesBase.getRequired(key);\r\n\t\t\t\tint have = resourcesBase.getOwned(key);\r\n\t\t\t\tOtherResourceViewer newViewer = new OtherResourceViewer(key,need, have, parent);\t//vytvorí nový viewer \r\n\t\t\t\tresources.put(key, newViewer);\t//pridá ho do zoznamu viewerov\r\n\t\t\t\tadd(newViewer);\t//aj do panelu\r\n\t\t\t}\r\n\t\t});\r\n\t}",
"@Override\r\n\tpublic void setGiveResource(ResourceType resource) {\n\t\t\r\n\t}",
"public void updateResources(List<Resource> resources) {\n\t\t\n\t}",
"private void updateResourcesList() {\n this.resourcesJList.setModel(new ModelListSelectable(controller.getDemonstration().getResourcesList()));\n }",
"public void giveResourcesToPlayer(Resource resource){\n resources.addResource(resource);\n }",
"@Test\n\tpublic void testUpdateResource()\n\t{\n\t\tLocalDate resDate = null;\n\t\t\n\t\tCategory cat = new Category();\n\t\tcat.setCatId(10);\n\t\tcat.setCatName(\"Clothing\");\n\t\t\n\t\tResource res = new Resource();\n\t\tres.setResId(10);\n\t\tres.setResDate(resDate);\n\t\tres.setCategory(cat);\n\t\tres.setResDescription(\"100% Cotton\");\n\t\tres.setResTitle(\"Shirt\");\n\t\tres.setResPrice(1000);\t\t\n\t\t\n\t\tres.setResId(20);\n\t\tMockito.when(resourceRepository.save(res)).thenReturn(res);\n\t\t\n\t\tassertEquals(res,resourceService.updateResource(res));\n\t\t\n\t}",
"@Override\r\n\tpublic void increaseAmount(ResourceType resource) {\n\t\t\r\n\t}",
"public void setResourceFrom(ServiceCenterITComputingResource newResourceFrom) {\n addPropertyValue(getResourcesProperty(), newResourceFrom);\r\n// setPropertyValue(getResourcesProperty(), resourceTo);\r\n }",
"@Deprecated\n public abstract void onContainerResourceIncreased(\n ContainerId containerId, Resource resource);",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"public void willbeUpdated() {\n\t\t\n\t}",
"@Override\r\n\tpublic void update() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void update() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void update() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void update() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void update() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void setResourceToSend(ResourceType resource) {\n\t\t\r\n\t}",
"@Override\n public <L> void resourcesAdded(InventoryEvent<L> event) {\n return;\n }",
"public void resourceTreeChanged(ResourceInheritance item, boolean added)\n {\n event(\"ResourceTreeChange\",\n item.getParent().getId(),\n item.getChild().getId(),\n -1,\n added);\n }",
"@Override\r\n\tpublic void update() {\r\n\t}",
"public void softwareResources() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void setResourceToReceive(ResourceType resource) {\n\t\t\r\n\t}",
"void setResourceID(String resourceID);",
"@Override\r\n\tpublic void update() {\n\t\tsuper.update();\r\n\t}",
"public AbstractResource resource()\r\n {\r\n\t return this.resource_state;\r\n }",
"public static void updateResources(){\n for(int i = 0 ; i < releaseArr.length; i ++){\n resourceArr[i] += releaseArr[i];\n }\n }",
"public static void update(Resource resource){\n String newUpdate;\n String display = \"What would you like to update?\"+\n \"[1] Type: \" + resource.getType() + \"\\n\" +\n \"[2] Title: \" + resource.getName() + \"\\n\" +\n \"[3] Genre: \" + resource.getGenre() + \"\\n\" +\n \"[4] Author: \" + resource.getAuthor() + \"\\n\" +\n \"[5] Year: \" + resource.getYear() + \"\\n\" +\n \"[0] Exit\";\n\n int edit = getIntInput(display, 0,5);\n\n switch(edit){\n case 1:\n newUpdate = edit(\"type\", resource.getType());\n resource.setType(newUpdate);\n break;\n case 2:\n newUpdate = edit(\"title\", resource.getName());\n resource.setName(newUpdate);\n break;\n case 3:\n newUpdate = edit(\"genre\", resource.getGenre());\n resource.setGenre(newUpdate);\n break;\n case 4:\n newUpdate = edit(\"author\", resource.getAuthor());\n resource.setAuthor(newUpdate);\n break;\n case 5:\n newUpdate = edit(\"year\", resource.getYear());\n resource.setYear(newUpdate);\n break;\n case 0:\n break;\n default:\n JOptionPane.showMessageDialog(null, \"should not reach here\");\n }\n }",
"@Override\r\n public void loadResources() {\n\r\n }",
"@Override\r\n\tpublic void update() {\r\n\r\n\t}",
"private void addToDirtyResources(EObject modelElement) {\n\t\tResource resource = modelElement.eResource();\n\n\t\tif (resource != null) {\n\t\t\tdirtyResourceSet.addDirtyResource(resource);\n\t\t}\n\t}",
"void onReloadSafe(ResourceManager resourceManager);",
"private boolean updateResource(ContactJabberImpl contact,\n FullJid fullJid,\n Presence presence)\n {\n\n if(fullJid == null)\n fullJid = presence.getFrom().asFullJidIfPossible();\n if (fullJid == null)\n return false;\n\n Resourcepart resource = fullJid.getResourceOrNull();\n if (resource != null && resource.length() > 0)\n {\n Map<FullJid, ContactResourceJabberImpl> resources =\n contact.getResourcesMap();\n\n ContactResourceJabberImpl contactResource\n = resources.get(fullJid);\n\n PresenceStatus newPresenceStatus\n = OperationSetPersistentPresenceJabberImpl\n .jabberStatusToPresenceStatus(presence, parentProvider);\n\n if (contactResource == null)\n {\n contactResource = createResource(presence, fullJid, contact);\n\n resources.put(fullJid, contactResource);\n\n contact.fireContactResourceEvent(\n new ContactResourceEvent(contact, contactResource,\n ContactResourceEvent.RESOURCE_ADDED));\n return true;\n }\n else\n {\n boolean oldIndicator = contactResource.isMobile();\n boolean newIndicator =\n mobileIndicator.isMobileResource(fullJid);\n int oldPriority = contactResource.getPriority();\n\n // update mobile indicator, as cabs maybe added after\n // creating the resource for the contact\n contactResource.setMobile(newIndicator);\n\n contactResource.setPriority(presence.getPriority());\n if(oldPriority != contactResource.getPriority())\n {\n // priority has been updated so update and the\n // mobile indicator before firing an event\n mobileIndicator.resourcesUpdated(contact);\n }\n\n if (contactResource.getPresenceStatus().getStatus()\n != newPresenceStatus.getStatus()\n || (oldIndicator != newIndicator)\n || (oldPriority != contactResource.getPriority()))\n {\n contactResource.setPresenceStatus(newPresenceStatus);\n\n contact.fireContactResourceEvent(\n new ContactResourceEvent(contact, contactResource,\n ContactResourceEvent.RESOURCE_MODIFIED));\n return true;\n }\n }\n }\n\n return false;\n }",
"@Override\r\n\tpublic void update() {\n\t}",
"@Override\r\n\tpublic void update() {\n\t}",
"@Override\n\tpublic void update() {}",
"@Override\n\tpublic void update() {}",
"private void deleteResource() {\n }",
"protected void fireAttributeChanged(VAttribute attr)\n\t{\n\t\tResourceEvent event=ResourceEvent.createAttributesChangedEvent(getVRL(),\n\t\t\t\tnew VAttribute[]{attr}); \n\t\tthis.vrsContext.getResourceEventNotifier().fire(event); \n\t}",
"@Override\r\n\tpublic void refresh(Resource resource) {\n\t\tadapterFactory\r\n\t\t\t\t.addAdapterFactory(new IFConfigItemProviderAdapterFactory());\r\n\t\tif (resource.getContents().size() > 0) {\r\n\t\t\tEObject input = resource.getContents().get(0);\r\n\t\t\tif (input instanceof IFConfig)\r\n\t\t\t\tviewer.setInput(input);\r\n\t\t}\r\n\t}",
"@Override\n protected void updateProperties() {\n }",
"@Test(dependsOnMethods = {\"modifyResource\"})\n public void modifyNotExistingResource() throws Exception {\n showTitle(\"modifyNotExistingResource\");\n\n try {\n UmaResource resource = new UmaResource();\n resource.setName(\"Photo Album 3\");\n resource.setIconUri(\"http://www.example.com/icons/flower.png\");\n resource.setScopes(Arrays.asList(\"http://photoz.example.com/dev/scopes/view\", \"http://photoz.example.com/dev/scopes/all\"));\n\n getResourceService().updateResource(\"Bearer \" + pat.getAccessToken(), \"fake_resource_id\", resource);\n } catch (ClientErrorException ex) {\n System.err.println(ex.getResponse().readEntity(String.class));\n int status = ex.getResponse().getStatus();\n assertTrue(status != Response.Status.OK.getStatusCode(), \"Unexpected response status\");\n }\n }",
"private void updateFileResource(Long fileId) {\n editResourceService.getVMFile(fileId, new AsyncCallback<VMFile>() {\n @Override\n public void onFailure(Throwable caught) {\n SC.warn(caught.getMessage());\n }\n\n @Override\n public void onSuccess(VMFile result) {\n FileTreeNode targetNode = (FileTreeNode) fileTreeNodeFactory.findTreeNode(tree, fileId);\n targetNode.setResource(result);\n }\n });\n }",
"@Override\r\n public void setImageResource(int resourceId)\r\n {\r\n new LoadResourceTask().execute(resourceId);\r\n }",
"@Override\r\n\tpublic void onCustomUpdate() {\n\t\t\r\n\t}",
"@DISPID(-2147412091)\n @PropGet\n java.lang.Object onbeforeupdate();"
] | [
"0.8013749",
"0.79665226",
"0.77664846",
"0.74147195",
"0.7206158",
"0.71565545",
"0.71457803",
"0.70236063",
"0.69439757",
"0.6889889",
"0.68886024",
"0.6788903",
"0.6758046",
"0.6746101",
"0.66920465",
"0.66612774",
"0.65913177",
"0.65866005",
"0.6473006",
"0.646137",
"0.6448877",
"0.6393595",
"0.63579863",
"0.63555753",
"0.6259985",
"0.6259403",
"0.61614674",
"0.616113",
"0.6156095",
"0.61517",
"0.6145724",
"0.61308795",
"0.6118758",
"0.61042273",
"0.6086381",
"0.60794866",
"0.60737866",
"0.6067023",
"0.59995115",
"0.5996064",
"0.5962876",
"0.59611297",
"0.59335107",
"0.59285986",
"0.5908753",
"0.588998",
"0.58892477",
"0.5880656",
"0.5880656",
"0.58722186",
"0.58722186",
"0.58722186",
"0.58590794",
"0.5854304",
"0.5848672",
"0.5817567",
"0.58126193",
"0.5811965",
"0.58061033",
"0.5785996",
"0.5784105",
"0.5782586",
"0.5771546",
"0.576727",
"0.57475376",
"0.5729455",
"0.57253176",
"0.57099414",
"0.57099414",
"0.57099414",
"0.57099414",
"0.57099414",
"0.56991106",
"0.5696792",
"0.56767946",
"0.56667596",
"0.56637836",
"0.5659226",
"0.56571627",
"0.5653403",
"0.56458575",
"0.5640804",
"0.5639055",
"0.5635505",
"0.5633819",
"0.5632926",
"0.5630262",
"0.561833",
"0.56032103",
"0.56032103",
"0.5601363",
"0.5601363",
"0.55993074",
"0.55979097",
"0.5596945",
"0.5596388",
"0.55924577",
"0.5590597",
"0.55870473",
"0.5582035",
"0.5581224"
] | 0.0 | -1 |
listener on the actions of the workflow addition of the resource in the workflow_resource_workflow | @Override
public void addedResource( ResourceEvent event )
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void onResourceAdded(final ResourceEvent resourceEvent);",
"void addWorkflow(Workflow workflow);",
"public interface WorkflowExecutionListener {}",
"public interface WorkflowListener extends Configurable {\n\n /**\n * Represents change actions on components.\n */\n public enum Action {\n\n /** The add. */\n ADD,\n /** The remove. */\n REMOVE,\n /** The update. */\n UPDATE\n }\n\n /**\n * Notification of transaction starting.\n *\n * @throws Exception the exception\n */\n public void beginTransaction() throws Exception;\n\n /**\n * Notification pre-commit.\n *\n * @throws Exception the exception\n */\n public void preCommit() throws Exception;\n\n /**\n * Notification post-commit.\n *\n * @throws Exception the exception\n */\n public void postCommit() throws Exception;\n\n /**\n * Notification of a cancelled operation.\n */\n public void cancel();\n\n /**\n * Refset changed.\n *\n * @param refset the refset\n * @param action the action\n * @throws Exception the exception\n */\n public void refsetChanged(Refset refset, Action action) throws Exception;\n\n /**\n * Translation changed.\n *\n * @param translation the translation\n * @param action the action\n * @throws Exception the exception\n */\n public void translationChanged(Translation translation, Action action)\n throws Exception;\n\n /**\n * Refset descriptor ref set member changed.\n *\n * @param member the member\n * @param action the action\n * @throws Exception the exception\n */\n public void refsetDescriptorRefsetMemberChanged(\n RefsetDescriptorRefsetMember member, Action action) throws Exception;\n\n /**\n * Description type ref set member changed.\n *\n * @param member the member\n * @param action the action\n * @throws Exception the exception\n */\n public void descriptionTypeRefsetMemberChanged(\n DescriptionType member, Action action) throws Exception;\n\n /**\n * Concept changed.\n *\n * @param concept the concept\n * @param action the action\n * @throws Exception the exception\n */\n public void conceptChanged(Concept concept, Action action) throws Exception;\n\n /**\n * Member changed.\n *\n * @param member the member\n * @param action the action\n * @throws Exception the exception\n */\n public void memberChanged(ConceptRefsetMember member, Action action)\n throws Exception;\n}",
"public void addResource(PSResource res) {\n/* 72 */ prepareResourceSet();\n/* 73 */ this.resources.add(res);\n/* */ }",
"void handleNewResource() {\n System.out.println(\"Here at VMLeaseProcessor#handleNewResource\");\n callForBackup();\n resourceManager.createRedundant();\n }",
"org.hl7.fhir.ResourceReference addNewPerformer();",
"@Override\n public <L> void resourcesAdded(InventoryEvent<L> event) {\n return;\n }",
"public interface ResourceListener {\n\n\tpublic void update(ResourceList resource);\n}",
"public void secondaryAddI13nActResourceSet(com.hps.july.persistence.I13nActResourceSet anI13nActResourceSet) throws java.rmi.RemoteException;",
"public void resourceCreated(Resource resource)\n {\n event(\"ResourceCreation\",\n resource.getId(),\n -1,\n -1,\n false);\n }",
"@Override\n \tpublic void addActions() {\n \t\t\n \t}",
"public boolean allowAddAction(ResourceToolAction action, ContentEntity entity);",
"com.microsoft.schemas.crm._2011.contracts.ArrayOfRequiredResource addNewRequiredResources();",
"public void handleAdd(ActionEvent actionEvent) {\n }",
"public void addResourceChangeListener() {\n\t\tif (elementChange == null) {\n\t\t\telementChange = new JavaElementChange();\n\t\t}\n\t}",
"@Override\n\t\t\t\tpublic void onAddSuccess() {\n\t\t\t\t\tif (addListener != null) {\n\t\t\t\t\t\taddListener.onAddSuccess();\n\t\t\t\t\t}\n\t\t\t\t}",
"@Override\n public void addListener(ResourceListener listener) {\n }",
"@Override\n protected void hookUpActionListeners() {\n }",
"void addHas_action(Action newHas_action);",
"public abstract void addAction(Context context, NAAction action);",
"public AddNodeWorkflow(AddNodeRequest request) {\n this.id = UUID.randomUUID();\n this.request = request;\n actions = ImmutableList.of(new BootstrapNode(),\n new AddNodeToLayout(),\n new RestoreRedundancy());\n }",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tadd();\n\t\t\t}",
"void notifyDepositChanges(int id, ResourceContainer resourceContainer, boolean added);",
"public interface AttachmentsListener {\n\n /**\n * Fires when user presses 'add' button.\n */\n void onAddAttachments();\n}",
"public void addAction(Action action) {\n\t\t\n\t}",
"@Override\n public Event add(Ec2LaunchConfiguration newResource) {\n return null;\n }",
"public void addResource(Resource res) {\n \tresourceDisplay.getChildren().add(new ResourceContainer(res));\r\n }",
"private void add(EResource resource) {\n switch (resource) {\n case BRICK:\n brick++;\n break;\n case GRAIN:\n grain++;\n break;\n case LUMBER:\n lumber++;\n break;\n case ORE:\n ore++;\n break;\n case WOOL:\n wool++;\n break;\n }\n }",
"private void AddNewScenario(HttpServletRequest request, HttpServletResponse response) {\n XMLTree.getInstance().AddNewScenario();\n }",
"public void addActionListeners() {\n\t\tApp.sc.createListener(\"/\" + this.getID() + \"/action/sent\", new OSCListener() {\n\t\t\t@Override\n\t\t\tpublic void acceptMessage(Date time, OSCMessage message) {\n\t\t\t\tConnector actionOutConnector = getConnector(ConnectorType.ACTION_OUT);\n\t\t\t\tactionOutConnector.flashConnection();\n\t\t\t}\n\t\t});\n\t}",
"public void resourceChanged(IResourceChangeEvent event) {\n\n\t\tint eventType = event.getType();\n\t\tIResourceDelta delta = event.getDelta();\n\t\tswitch (eventType) {\n\t\tcase IResourceChangeEvent.POST_CHANGE:\n\t\t\tcheckProjectsAndDescriptorChanges(delta);\n\t\t\tbreak;\n\t\t}\n\t}",
"public void addResource(Resource resource) {\n\t\tresources.add(resource);\n\t}",
"private void acceptListener() {\n addDialog.getAccept().addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n try {\n Task newTask = new Task(addDialog.getTaskName().getText(), addDialog.getTaskDesc().getText(),\n Integer.parseInt(addDialog.getTaskDate().getText()));\n toDoList.addTask(newTask);\n } catch (NumberFormatException | InvalidTitleException a) {\n addDialog.dispose();\n }\n addDialog.dispose();\n refresh();\n }\n });\n }",
"@Override\n public void onAddSugarRaised() {\n }",
"public void registerWorkflowStatusListener(WorkflowStatusListener listener) {\n\t\tthis.workflowStatusListeners.add(listener);\n\t}",
"public void addResource(ITranslationResource resource){\n\t\tresources.add(resource);\n\t}",
"public void registerProcessing(Cycle _cycle, String _requestId) throws PersistenceResourceAccessException, CycleManagerException;",
"@Override\n\tpublic void addActionListener(ActionListener listener) {\n\t\tlisteners.add(listener);\n\t}",
"public void addActionlistener(ActionListener l) {\r\n cancelButton.addActionListener(l);\r\n addButton.addActionListener(l);\r\n }",
"public void onAdd(TimelineAddEvent e) {\n\t\tevent = new TimelineEvent(new Booking(), e.getStartDate(), e.getEndDate(), true, e.getGroup());\n\n\t\t// add the new event to the model in case if user will close or cancel the \"Add dialog\"\n\t\t// without to update details of the new event. Note: the event is already added in UI.\n\t\tmodel.add(event);\n\t}",
"@Override\r\n\tpublic void increaseAmount(ResourceType resource) {\n\t\t\r\n\t}",
"@ReceiveEvent\r\n public void onLogicTreeAddActionEvent(LogicTreeAddActionEvent event, EntityRef entity, ScenarioComponent component) {\r\n TriggerActionListComponent actions = event.getTriggerEntity().getComponent(TriggerActionListComponent.class);\r\n //Sets up basic action as a give block component\r\n EntityRef newActionEntity = entityManager.create(assetManager.getAsset(\"scenario:givePlayerBlockAction\", Prefab.class).get());\r\n\r\n ArgumentParser argParser = new ArgumentParser();\r\n argParser.setAssetManager(assetManager);\r\n argParser.setBlockManager(blockManager);\r\n argParser.setEntityManager(entityManager);\r\n\r\n\r\n\r\n argParser.parseDefaults(newActionEntity);\r\n newActionEntity.setOwner(event.getTriggerEntity());\r\n actions.actions.add(newActionEntity);\r\n event.getTriggerEntity().saveComponent(actions);\r\n entity.saveComponent(component);\r\n\r\n if (event.getHubScreen() != null) {\r\n event.getHubScreen().getEntity().getComponent(ExpandedComponent.class).expandedList.add(event.getTriggerEntity());\r\n event.getHubScreen().getEntity().getComponent(ExpandedComponent.class).expandedList.add(event.getTriggerEntity().getComponent(TriggerNameComponent.class).entityForAction);\r\n event.getHubScreen().getEntity().saveComponent(event.getHubScreen().getEntity().getComponent(ExpandedComponent.class));\r\n event.getHubScreen().setAddedEntity(newActionEntity);\r\n event.getHubScreen().updateTree(entity);\r\n }\r\n }",
"void addActionListener(IActionListener actionListener);",
"void resourceChanged(IPath workspacePath);",
"@Override\n\tprotected void addAction(HashSet<String> addSet){\n\t\t((AdaptDependencyManager)MiddleWareConfig.getInstance().getDepManager()).addNewDeploymentNodeBySet(addSet);\n\t}",
"void addAction(ActionDefinition actd) throws ResultException, DmcValueException {\n \t\n \t// We have to resolve the action at this point because we iterate over \n \t// references that it contains. This should be okay because the attributes\n \t// should have been loaded first\n \ttry {\n\t\t\tactd.resolveReferences(this,currentResolver);\n\t\t} catch (DmcValueExceptionSet e) {\n\t\t\te.printStackTrace();\n\t\t}\n \t\n if (checkAndAdd(actd.getObjectName(),actd,actionDefs) == false){\n \tResultException ex = new ResultException();\n \tex.addError(clashMsg(actd.getObjectName(),actd,actionDefs,\"action names\"));\n throw(ex);\n }\n\n if (checkAndAddDOT(actd.getDotName(),actd,globallyUniqueMAP,null) == false){\n \tResultException ex = new ResultException();\n \tex.addError(clashMsgDOT(actd.getObjectName(),actd,globallyUniqueMAP,\"definition names\"));\n \tthrow(ex);\n }\n \n if (actd.getObjectName().getNameString().length() > longestActionName)\n longestActionName = actd.getObjectName().getNameString().length();\n\n Iterator<AttributeDefinition> it = null;\n if ( (it = actd.getMayParm()) != null){\n while(it.hasNext()){\n AttributeDefinition ad = it.next();\n ad.addUsingAction(actd);\n }\n }\n\n if ( (it = actd.getMustParm()) != null){\n while(it.hasNext()){\n AttributeDefinition ad = it.next();\n ad.addUsingAction(actd);\n }\n }\n\n Iterator<ClassDefinition> cdit = null;\n if ( (cdit = actd.getAttachToClass()) != null){\n while(cdit.hasNext()){\n ClassDefinition cd = cdit.next();\n actd.addAttachedToClass(cd);\n }\n }\n \n if (extensions.size() > 0){\n \tfor(SchemaExtensionIF ext : extensions.values()){\n \t\text.addAction(actd);\n \t}\n }\n\n }",
"@Override\r\n public void addNotify() {\r\n super.addNotify();\r\n \r\n // add listener\r\n component.getResults().addLabTestListener(this);\r\n }",
"private void OnInflated() \r\n { \r\n if (_inflatedList != null)\r\n { \r\n for/*each*/ (ResourceReferenceExpression listener : _inflatedList)\r\n {\r\n listener.OnDeferredResourceInflated(this);\r\n } \r\n }\r\n }",
"public void addSuccessor(AllocatableAction successor) {\n this.resourceSuccessors.add(successor);\n }",
"public void addAction(String act) {\n\t\tpathCost++;\n\t\tactionSequence += act;\n\t\t//System.out.println(\"Action: \" + act + \" H: \" + current.getValue() + \" \" + current.getString());\n\n\t}",
"@Override\n public boolean registerNewResource(API api, Map resourceAttributes) throws APIManagementException {\n\n return true;\n }",
"@Override\r\n\tpublic void add(Resources resources) {\n\t\t\r\n\t}",
"public interface WFEventListener extends ActivityInsEventListener, ProcessInsEventListener {\r\n\r\n /**\r\n * called when a timer event is fired;\r\n */\r\n public void onTimerEvent();\r\n\r\n public void addECAList(ECAList list);\r\n\r\n}",
"public static void registerListener(AltResource resource, Object listener){\n Set<Object> resourceListeners;\n if(listeners.containsKey(resource))\n resourceListeners = listeners.get(resource);\n else\n resourceListeners = new HashSet<>();\n resourceListeners.add(listener);\n listeners.put(resource, resourceListeners);\n }",
"public abstract void onContainerResourceUpdated(\n ContainerId containerId, Resource resource);",
"public void addAction(StageAction action, StageComponent component) {\n\t\tgetCurrentActions().put(action, component);\n\t\tcomponent.addToJson(action, getStageJson()); // The component handles adding to the JSON with keys and values\n\t}",
"@Override\n\tpublic void resourceChanged(IResourceChangeEvent arg0) {\n\t\t\n\t}",
"@Override\n\tprotected void addedLayerActions(ILayer layer) {\n\n\t\tsuper.addedLayerActions(layer);\n\n\t\tchangedLayerListActions();\n\n\t}",
"public void addAddEpisodeButtonListener(ActionListener l)\n\t{\n\t\taddEpisodeButton.setActionCommand(\"Add Episode\");\n\t\taddEpisodeButton.addActionListener(l);\n\t}",
"private JButton createAddResourceButton() {\n\n JButton addBtn = new JButton(\"Add\");\n addBtn.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n try {\n\n List<Resource> resourcesList = controller.getResoucesList();\n\n for (Resource resource : controller.getDemonstration().getResourcesList()) {\n resourcesList.remove(resource);\n }\n\n if (resourcesList.isEmpty()) {\n throw new IllegalArgumentException();\n }\n\n DialogSelectable dialogoNewResource = new DialogSelectable(CreateDemonstrationUI.this, resourcesList, \"Select Resource from list:\");\n Resource selectedResource = (Resource) dialogoNewResource.getSelectedItem();\n if (selectedResource == null) {\n throw new NullPointerException();\n }\n\n if (controller.addResource(selectedResource)) {\n updateResourcesList();\n String successMessage = \"Resource added successfully!\";\n String successTitle = \"Resource added.\";\n\n JOptionPane.showMessageDialog(rootPane, successMessage, successTitle, JOptionPane.INFORMATION_MESSAGE);\n }\n } catch (NullPointerException ex) {\n\n } catch (IllegalArgumentException ex) {\n\n String warningMessage = \"There is no more resources to add\";\n String warningTitle = \"No more resources in system\";\n\n JOptionPane.showMessageDialog(rootPane, warningMessage, warningTitle, JOptionPane.WARNING_MESSAGE);\n\n } catch (Exception ex) {\n\n String warningMessage = \"Something wen't wrong please try again.\";\n String warningTitle = \"ERROR 404\";\n\n JOptionPane.showMessageDialog(rootPane, warningMessage, warningTitle, JOptionPane.WARNING_MESSAGE);\n }\n\n }\n });\n return addBtn;\n }",
"private void addRequest(InstanceRequest request) {\r\n\t\t\r\n\t}",
"private void fireContentModelCreated(final String id, final String xmlData) throws SystemException {\r\n for (final ResourceListener contentModelListener : this.contentModelListeners) {\r\n contentModelListener.resourceCreated(id, xmlData);\r\n }\r\n }",
"public void resourceChanged(IResourceChangeEvent event)\r\n\t\t{\n\t\t\tupdateErrors();\r\n\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\taddOrUpdate();\n\t\t\t}",
"public void addResource(Resource resource) {\n\t\tif (resource != null) {\n\t\t\tthis.getResources().add(resource);\n\t\t\tresource.setSystem(this);\n\t\t}\n\t}",
"public void addActionListener (ActionListener listener) {\n\t\t_remoteButton.addActionListener(listener);\n\t}",
"protected void addListenerTo(BioResource BioResource) {\n\t\t\tBioResource.addListener(this);\n\t\t}",
"void addButton_actionPerformed(ActionEvent e) {\n doAdd();\n }",
"public void addNumOfActionTaken() {\n this.numOfActionTaken++;\n }",
"void add(SpaceInstanceAddedEventListener eventListener, boolean includeExisting);",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\taddNewItem();\n\t\t\t}",
"public void addResource(TIdentifiable resource) {\r\n // make sure that the resource doesn't exists already\r\n\t if (resourceExists(resource)) return;\t \r\n\t \r\n // check to see if we need to expand the array:\r\n\t if (m_current_resources_count == m_current_max_resources) expandTable(1, 2);\t \t \r\n\t m_resources.addID(resource);\r\n\t m_current_resources_count++;\r\n }",
"public void onAddAgendaItem() {\n AgendaItemDialog agendaItemDialog = AgendaItemDialog.getNewInstance();\n Optional<AgendaItem> result = agendaItemDialog.showAndWait();\n if (!result.isPresent()) {\n return;\n }\n\n if (controller.addAgendaItem(result.get())) {\n return;\n }\n\n AlertHelper.showError(LanguageKey.ERROR_AGENDAITEM_ADD, null);\n }",
"@FXML\n void addTaskClicked(ActionEvent event)\n {\n createTask();\n }",
"public void addNewStage() {\n\t\tif (stage != 0 && getCurrentActions().isEmpty()) { // This should be validated by the command\n\t\t\tthrow new IllegalStateException(\"Cannot progress stage without actions\");\n\t\t}\n\n\t\tstage = amountOfStages\n\t\t\t\t+ 1; // The stage that is being edited may not be the latest so make sure not to duplicate\n\t\tamountOfStages++;\n\t\tstagesOfActions.putIfAbsent(stage, new LinkedHashMap<>());\n\t\tstageJsons.putIfAbsent(stage, new JsonObject());\n\t}",
"public void addActionListener(ActionListener l) {\n\t\tactionListeners.add(l);\n\t}",
"public void addAddMovieButtonListener(ActionListener l)\n\t{\n\t\taddMovieButton.setActionCommand(\"Add Movie\");\n\t\taddMovieButton.addActionListener(l);\n\t}",
"private void addListeners(){\n Conservable[] listenerFromProductTypeRelation = this.productRelation.getListener();\n this.listener[0] = listenerFromProductTypeRelation[0];\n this.listener[1] = listenerFromProductTypeRelation[1];\n this.listener[2] = this.post;\n this.listener[3] = this.productRelation;\n this.listener[4] = this;\n }",
"@Override\n public void addResources(ResourceType resourceType, int numResources) throws DepotException {\n boolean notExist = true;\n for (SpecialContainer selectedContainer : specialContainers) {\n if (selectedContainer.getType() == resourceType) {\n selectedContainer.addResource(numResources);\n notExist = false;\n }\n }\n if (notExist) throw new DepotException(\"Impossible to add resources, SpecialDepot not active\");\n notifyObserver(new UpdatedSpecialDepotMessage(toReduced()));\n }",
"void addLifecycleCallback(LifecycleCallbackItem lifecycleCallbackItem);",
"public void addActionListeners(ActionListener evt)\r\n\t{\r\n\t\tconfirmButton.addActionListener(evt);\r\n\t\tstartButton.addActionListener(evt);\r\n\t}",
"@Override\n public void updatedResource( ResourceEvent event )\n {\n if ( event.getTypeResource( ).equals( Appointment.APPOINTMENT_RESOURCE_TYPE ) )\n {\n IndexingAppointmentService.getService( ).indexAppointmentStateAndHistory( _appointmentDataSource, _appointmentHistoryDataSource,\n Integer.parseInt( event.getIdResource( ) ) );\n }\n\n }",
"public synchronized void addCompletionListener(ActionListener l) {\n if (Trace.isTracing(Trace.MASK_APPLICATION))\n {\n Trace.record(Trace.MASK_APPLICATION, BEANNAME, \"addCompletionListener registered\");\n }\n completionListeners.addElement(l); //add listeners\n }",
"protected void add(ResourceMapping mapping) throws CoreException {\n SyncInfoTree set = getUnaddedResource(mapping);\n add(new ResourceMapping[] { mapping });\n assertAdded(mapping, set);\n }",
"void onAddAttachments();",
"public void add(ResourceReference definition, InjectionSite injectionSite) {\n super.add(definition);\n Injectable injectable = new Injectable(InjectableType.RESOURCE, definition.getName());\n addInjectionSite(injectionSite, injectable);\n injectionSiteMapping.put(definition, injectionSite);\n }",
"@ReceiveEvent\r\n public void onLogicTreeAddActionEvent(LogicTreeAddActionEvent event, EntityRef entity, ScenarioHubToolUpdateComponent component) {\r\n TriggerActionListComponent actions = event.getTriggerEntity().getComponent(TriggerActionListComponent.class);\r\n //Sets up the default basic action as a give block component\r\n EntityRef newActionEntity = entityManager.create(assetManager.getAsset(\"scenario:givePlayerBlockAction\", Prefab.class).get());\r\n\r\n argumentParser.parseDefaults(newActionEntity);\r\n newActionEntity.setOwner(event.getTriggerEntity());\r\n actions.actions.add(newActionEntity);\r\n event.getTriggerEntity().saveComponent(actions);\r\n scenarioEntity.saveComponent(scenarioEntity.getComponent(ScenarioComponent.class));\r\n\r\n if (event.getHubScreen() != null) {\r\n event.getHubScreen().getComponent(HubToolExpansionComponent.class).expandedList.add(event.getTriggerEntity());\r\n event.getHubScreen().getComponent(HubToolExpansionComponent.class).expandedList.add(event.getTriggerEntity().getComponent(TriggerNameComponent.class).entityForAction);\r\n event.getHubScreen().saveComponent(event.getHubScreen().getComponent(HubToolExpansionComponent.class));\r\n event.getHubScreen().getComponent(ScenarioHubToolUpdateComponent.class).addedEntity = newActionEntity;\r\n event.getHubScreen().saveComponent(event.getHubScreen().getComponent(ScenarioHubToolUpdateComponent.class));\r\n }\r\n\r\n for (EntityRef e : entityManager.getEntitiesWith(ScenarioHubToolUpdateComponent.class)) {\r\n e.send(new HubtoolRewriteLogicEvent());\r\n }\r\n }",
"void setAddListener(AddNeededCollaborationListener addNeededCollaborationListener);",
"public void actionPerformed(ActionEvent e){\n\t\t\topenAdd();\n\t\t}",
"void addIsPerformOf(Role newIsPerformOf);",
"public boolean addReceivedExternalDocument(AddReceivedExternalDocumentsCommand aCommand);",
"@Override\r\n\tprotected SelectionListener createAddButtonActionListener() {\r\n\t\t// the value must by initialized! (don't return new AddActionListener()) \r\n\t\tthis.addButtonListener = new EventTypeAddActionListener();\r\n\t\t\r\n\t\treturn addButtonListener;\r\n\t}",
"@Override\r\n\t\t\t\t\tpublic void addItemEventOccurred(AddItemEvent event) {\n\r\n\t\t\t\t\t}",
"public void addTransition(Models.Transition transition) {\n GameHelper.getInstance(SceneEditor.this).addTransition(transition, new Response.Listener<Models.Transition>() {\n @Override\n public void onResponse(Models.Transition response) {\n //TODO: Add call back functionality?\n Toast.makeText(SceneEditor.this, \"Transition Created\", Toast.LENGTH_SHORT).show();\n\n }\n });\n }",
"private void onAddRole() {\n\t\troleProxy.addRoleToUser(user, selectedRole);\n\t}",
"public void addResource(ResourceInterface resource) {\n if (resource != null && !this.resources.contains(resource)) {\n this.resources.add(resource);\n forceUpdate();\n }\n }",
"public synchronized void onNewRequest() {\r\n\t\tallRequestsTracker.onNewRequest();\r\n\t\trecentRequestsTracker.onNewRequest();\r\n\t}",
"public void addChangeListener(ChangeListener l) {\n repositoryStep.addChangeListener(l);\n }",
"public void addListener(ServiceRequest req, NamingService.Listener l) {\n namingService.addListener(req, l);\n }"
] | [
"0.6565708",
"0.65187967",
"0.57728124",
"0.5628926",
"0.5590104",
"0.5574626",
"0.5544838",
"0.552557",
"0.54793257",
"0.5472313",
"0.5462646",
"0.5456876",
"0.54439664",
"0.54414594",
"0.5433109",
"0.5402873",
"0.53716516",
"0.5357178",
"0.5354817",
"0.5301927",
"0.5285442",
"0.52808917",
"0.5271521",
"0.5264274",
"0.52624524",
"0.52613604",
"0.52569556",
"0.5244155",
"0.52203524",
"0.52140355",
"0.5186134",
"0.51792634",
"0.51548874",
"0.51375604",
"0.51363206",
"0.5134126",
"0.51157576",
"0.511083",
"0.5090347",
"0.5084771",
"0.50840527",
"0.5079397",
"0.50716436",
"0.5068198",
"0.5059972",
"0.50471735",
"0.5045244",
"0.5034287",
"0.50294536",
"0.50289685",
"0.5016628",
"0.5006201",
"0.5004988",
"0.4990319",
"0.4989051",
"0.4983733",
"0.49642262",
"0.49635342",
"0.4955281",
"0.4951876",
"0.4949016",
"0.49443114",
"0.4943945",
"0.49365553",
"0.49351352",
"0.4933089",
"0.49311396",
"0.49252146",
"0.49235803",
"0.4921182",
"0.49164945",
"0.491631",
"0.49136353",
"0.49117574",
"0.49099708",
"0.49027565",
"0.4892221",
"0.48917788",
"0.48896468",
"0.48826343",
"0.48781228",
"0.48775932",
"0.48637122",
"0.48626783",
"0.48496687",
"0.48492962",
"0.48479804",
"0.4846254",
"0.48458645",
"0.48457736",
"0.4839396",
"0.48384538",
"0.48374605",
"0.48292482",
"0.48255885",
"0.48248443",
"0.48235154",
"0.48131308",
"0.4811856",
"0.4811106"
] | 0.6217944 | 2 |
listener on the actions of the workflow it's already called by notifyAppointmentRemoval( int nIdAppointment ) | @Override
public void deletedResource( ResourceEvent event )
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void notifyAppointmentWFActionTriggered( int nIdAppointment, int nIdAction )\n {\n }",
"public abstract void onRemoveAction();",
"public void removeAppointment(Appointment a)\n {\n this.agenda.remove(a);\n }",
"protected void removeAppointment(Appointment a) {\n appointments.remove(a);\n }",
"public void addAppointmentComponentClosed(ScheduledAppointment appointment);",
"void removeOldNotification();",
"@Override\n public void onYesClicked() {\n // Find the appointment in Firestore and delete.\n final AppointmentModel deleteAppt = appointmentList.get(deletePos);\n final String deleteApptDate = deleteAppt.getDate();\n final String deleteApptTime = deleteAppt.getTime();\n final String deleteApptAddress = deleteAppt.getAddress();\n\n // Delete the patient's appointment\n apptListRef.addSnapshotListener(this, new EventListener<QuerySnapshot>() {\n @Override\n public void onEvent(QuerySnapshot queryApptSnapshots, FirebaseFirestoreException e) {\n if (e != null) {\n return;\n }\n\n for (QueryDocumentSnapshot deleteApptSnapshot : queryApptSnapshots) {\n AppointmentModel apptDelete = deleteApptSnapshot.toObject(AppointmentModel.class);\n String daDateCheck = apptDelete.getDate(); String daTimeCheck = apptDelete.getTime();\n DocumentReference deleteA = deleteApptSnapshot.getReference();\n if (deleteApptDate.equals(daDateCheck) && deleteApptTime.equals(daTimeCheck)) {\n deleteA.delete();\n Toast.makeText(AdminCalendar.this, \"Appointment Successfully Canceled!\", Toast.LENGTH_SHORT).show();\n\n // Send a cancellation email\n String tempAMorPM = deleteApptTime.substring(0, 2);\n String tempTime = deleteApptTime.substring(3);\n String emailSubject = \"Cancellation of appointment set for \" + deleteApptDate + \" at \" + deleteApptAddress;\n String emailMessage = \"Hello \" + name + \",\\n\\n\" +\n \"Your appointment scheduled for \" + deleteApptDate + \" at \" + tempTime + ' ' + tempAMorPM + \" at \"\n + deleteApptAddress + \" has been cancelled...\" + \"\\n\\nThank you,\\n\" + \"TT&T Scheduling\";\n JavaMailAPI sendEmail = new JavaMailAPI(AdminCalendar.this, deleteAppt.getEmail(), emailSubject, emailMessage);\n sendEmail.execute();\n\n break;\n }\n }\n }\n });\n\n appointmentList.remove(deletePos);\n adapter.notifyItemRemoved(deletePos);\n }",
"@Override\n\tpublic void removeAction(int actionId) {\n\t\t\n\t}",
"Notification createAppointmentConfirmationNotification(Appointment appointment);",
"@Override\n public void notifyAppointmentUpdated( int nIdAppointment )\n {\n }",
"@Override\n public void delete() {\n this.parent.handleRemoveSignal(this.deadline.getCourseName(),\n this.deadline.getName(),\n this.deadline.getYear(),\n this.deadline.getMonth(),\n this.deadline.getDay());\n }",
"@Override\n public void cleanUpPendingTask(String workflowExtRef) throws WorkflowException {\n\n if (log.isDebugEnabled()) {\n log.debug(\"Starting cleanup task for APIStateChangeWSWorkflowExecutor for :\" + workflowExtRef);\n }\n String errorMsg;\n super.cleanUpPendingTask(workflowExtRef);\n try {\n ApiMgtDAO apiMgtDAO = ApiMgtDAO.getInstance();\n apiMgtDAO.deleteWorkflowRequest(workflowExtRef);\n } catch (APIManagementException axisFault) {\n errorMsg = \"Error sending out cancel pending application approval process message. cause: \" + axisFault\n .getMessage();\n throw new WorkflowException(errorMsg, axisFault);\n }\n }",
"@Override\n\t\t\tpublic void handleEvent(Event event) {\n\t\t\t\tboolean done= humanInteractions.getNotifications().getNotification().remove(selectedNotification);\n\t\t\t\tnotficationViewer.setInput(createNotificationModle());\n\n\t\t\t}",
"void unsetAppointmentsToIgnore();",
"public abstract void removeAction(Context context, NAAction action);",
"private void removePendingAction(PermissionsResultAction paramPermissionsResultAction) {\n }",
"@FXML\r\n void onActionWeek(ActionEvent event) {\r\n\r\n appointmentListType();\r\n\r\n }",
"@Override\n public void onClick(DialogInterface paramDialogInterface, int paramInt) {\n cancelAppointment(staffid);\n }",
"@Override\n public void onClick(View view) {\n ((MainActivity)parent.getContext()).removeAlarm(position);\n }",
"public void onPressRemoveFromCalendar() {\r\n new ActionConfirmationFragment(this, this)\r\n .setTitle(getString(R.string.event_confirmation_delete_event_calendar_entry))\r\n .setMessage(getString(R.string.action_confirmation_cannot_be_undone))\r\n .setRequestID(REQUEST_CONFIRMATION_DELETE_EVENT_CALENDAR_ENTRY)\r\n .show(getSupportFragmentManager(), null);\r\n }",
"private void removeFromCalendar() {\r\n CalendarUtil.deleteEntry(this, event);\r\n database.eventDao().update(event);\r\n updateSpeedDialActionItems();\r\n showToast(getString(R.string.event_calendar_remove_event_success), Toast.LENGTH_LONG);\r\n }",
"<T extends ListenableEvent> void removeActions(ActionType<T> type);",
"public void processRemoveStation() {\n AppYesNoDialogSingleton dialog = AppYesNoDialogSingleton.getSingleton();\n \n // POP UP THE DIALOG\n dialog.show(\"Remove Station\", \"Are you sure you want to remove this station?\");\n \n // DO REMOVE LINE \n dataManager.removeStation(); \n }",
"Notification createAppointmentRequestSubmissionConfirmationNotification(AppointmentRequest appointmentRequest, List<Appointment> appointments );",
"public abstract void onRemove();",
"@FXML\n\tvoid disapproveActionButton(ActionEvent event) {\n\t\tdeleteRequest();\n\t\tUsefulMethods.instance().close(event);\n\t}",
"@Override\r\n public void onClick(DialogInterface dialog, int which) {\n subjectDAO.deleteFridayEntry(employee);\r\n subjectListAdapter.remove(employee);\r\n Toast.makeText(getActivity(), \"Subject Deleted\",\r\n Toast.LENGTH_SHORT).show();\r\n\r\n }",
"public void onRemoveAgendaItem() {\n AgendaItem agendaItem = outputAgendaItemsPreparation.getSelectionModel().getSelectedItem();\n\n if (agendaItem == null) {\n AlertHelper.showError(LanguageKey.ERROR_AGENDAITEM_NULL, null);\n return;\n }\n\n if (controller.removeAgendaItem(agendaItem)) {\n return;\n }\n\n AlertHelper.showError(LanguageKey.ERROR_AGENDAITEM_REMOVE, null);\n }",
"public void onUnload(ClientEvent clientEvent) {\n \n try {\n String action = (String) AdfFacesContext.getCurrentInstance().getPageFlowScope().get(\"lstbpmaction\");\n logger.error(\"PropValApproveBean : onUnload..action..\"+action);\n if(\"addcomment\".equalsIgnoreCase(action))\n updateBPMTask();\n } catch(Exception e) {\n e.printStackTrace();\n logger.error(\"onUnload\", e);\n }\n // closeTaskFlow();\n\n }",
"public void deleteTeam(ActionEvent actionEvent) {}",
"@FXML\r\n void onActionAll(ActionEvent event) {\r\n\r\n appointmentListType();\r\n\r\n }",
"public void removeAppointmentRequest(int appointmentId)\n {\n AppointmentListSingleton appointments = AppointmentListSingleton.getInstance();\n appointments.removeRequest(appointmentId);\n }",
"Notification createNewAppointmentNotification(Appointment appointment);",
"void declineNotification(NotificationDTO selectedNotification);",
"public void actionPerformed(ActionEvent e) {\n\t\tif (e.getSource() == attendBut) {\n\t\t\tAppt appt = new Appt();\n\t\t\tappt.setID(con.getusableid());\n\t\t\tappt.setTimeSpan(inviteAppt.TimeSpan());\n\t\t\tappt.setstarttime(inviteAppt.getstarttime());\n\t\t\tappt.setendtime(inviteAppt.getendtime());\n\t\t\tappt.setTitle(inviteAppt.getTitle());\n\t\t\tappt.setInfo(inviteAppt.getInfo());\n\t\t\tappt.setJoint(true);\n\t\t\tappt.setJoinID(inviteAppt.getID());\n\t\t\tappt.setusername(con.getusername());\n\t\t\tappt.setLocation(inviteAppt.getLocation());\n\t\t\tcon.ManageAppt(appt, con.NEW);\n\t\t\tinviteAppt.addAttendant(con.getDefaultUser().ID());\n\t\t\tinviteAppt.removeWaitingList(con.getDefaultUser().ID());\n\t\t\tcon.ManageAppt(inviteAppt, con.MODIFY);\n\t\t}\n\t\tif (e.getSource() == rejectBut) {\n//\t\t\tinviteAppt.addReject(con.getDefaultUser().ID());\n//\t\t\tinviteAppt.removeWaitingList(con.getDefaultUser().ID());\n \t\tfor (Object key : con.mApptStorage.mAppts.keySet()){\n \t\t\tif(con.mApptStorage.mAppts.get(key).getID()==inviteAppt.getID()){\n \t\t\t\tcon.mApptStorage.mAppts.remove(key);\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tif(con.mApptStorage.mAppts.get(key).getJoinID()==inviteAppt.getID())\n \t\t\t{con.mApptStorage.mAppts.remove(key);}\n \t\t}\n \tcon.mApptStorage.saveApptToTxt();\t\n\t\t}\n\t\tdispose();\n\t}",
"@FXML\r\n void onActionMonth(ActionEvent event) {\r\n appointmentListType();\r\n }",
"protected void detachNotification(Txn txn) {\r\n }",
"@Bugs(ids = \"69132\")\n\t@Test(\tdescription = \"Delete a basic appointment in the month view\",\n\t\t\tgroups = { \"functional\" })\n\tpublic void DeleteAppointment_01() throws HarnessException {\n\t\tString subject = \"appointment\" + ZmailSeleniumProperties.getUniqueString();\n\t\t\n\t\tAppointmentItem.createAppointmentSingleDay(\n\t\t\t\tapp.zGetActiveAccount(),\n\t\t\t\tCalendar.getInstance(),\n\t\t\t\t120,\n\t\t\t\tnull,\n\t\t\t\tsubject,\n\t\t\t\t\"content\" + ZmailSeleniumProperties.getUniqueString(),\n\t\t\t\t\"location\" + ZmailSeleniumProperties.getUniqueString(),\n\t\t\t\tnull);\n\n\t\t\n\t\t// Refresh the calendar\n\t\tapp.zPageCalendar.zToolbarPressButton(Button.B_REFRESH);\n\n\t\t// Select the appointment\n\t\tapp.zPageCalendar.zListItem(Action.A_LEFTCLICK, subject);\n\t\t\n\t\t// Click the \"delete\" button\n\t\tDialogConfirmDeleteAppointment dialog = (DialogConfirmDeleteAppointment)app.zPageCalendar.zToolbarPressButton(Button.B_DELETE);\n\n\t\t// Send the notification immediately\n\t\tdialog.zClickButton(Button.B_YES);\n\n\t\t\n\t\t\n\t\t// Verify that the appointment is in the trash now\n\t\tFolderItem trash = FolderItem.importFromSOAP(app.zGetActiveAccount(), FolderItem.SystemFolder.Trash);\n\t\tAppointmentItem deleted = AppointmentItem.importFromSOAP(app.zGetActiveAccount(), \"subject:(\"+ subject +\") is:anywhere\");\n\t\tZAssert.assertNotNull(deleted, \"Verify the deleted appointment exists\");\n\t\tZAssert.assertEquals(deleted.getFolder(), trash.getId(), \"Verify the deleted appointment exists\");\n\t \n\t}",
"@FXML\n\tvoid approveActionButton(ActionEvent event) {\n\t\t// change the duration\n\t\tboolean res = false;\n\t\tMessage messageToServer = new Message();\n\t\tmessageToServer.setMsg(req.getEcode() + \" \" + req.getNewDur());\n\t\tmessageToServer.setOperation(\"updateExamDurationTime\");\n\t\tmessageToServer.setControllerName(\"ExamController\");\n\t\tres = (boolean) ClientUI.client.handleMessageFromClientUI(messageToServer);\n\t\tif (!res) {\n\t\t\tUsefulMethods.instance().display(\"error in approval duration!\");\n\t\t} else\n\t\t\tdeleteRequest();\n\t\tUsefulMethods.instance().close(event);\n\t}",
"public void clearAppointments(){\n appointments.clear();\n }",
"private void removeListener() {\n buttonPanel.getRemoveTask().addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n for (int i = 0;i<toDoList.toDoListLength();i++) {\n JRadioButton task = toDoButtonList.get(i);\n if (task.isSelected()&& !task.getText().equals(\"\")) {\n toDoList.removeTask(i);\n }\n }\n refresh();\n }\n });\n }",
"@Override\n public void onSlideComplete(@NonNull SlideToActView slideToActView) {\n stopAlarmService();\n }",
"@Override\r\n\tpublic void eliminar(IndicadorActividadEscala iae) {\n\r\n\t}",
"void removeHas_action(Action oldHas_action);",
"private void deletePastEvents() {\n Date now = new Date(); //gets the current date\n ArrayList<Integer> listofEventIDS = eventManager.getListOfEventIDs(); //gets list of all eventIDs in the system\n //checks every eventID, and if its in the past, then deletes everything related to that event\n for (Integer eventID: listofEventIDS) {\n //if the event happened before right now, delete the event, and remove all attendees that are attending that event, organizer, speaker and free up the room.\n if (eventManager.getEvent(eventID).getTime().before(now)){\n ArrayList<String> peopleAttending = eventManager.getEvent(eventID).getAttendees(); //list of userid of all people attending\n\n for (String attendeeID: peopleAttending){\n //check if attendee is a organizer attending the event\n if (organizerManager.userExist(attendeeID)){\n organizerManager.removeEvent(eventID, attendeeID);\n }\n //if its not a organizer, it must be a attendee\n else {\n attendeeManager.removeEvent(eventID,attendeeID);\n }\n }\n //NOTE: THIS WORKS RIGHT NOW BECAUSE WE ONLY HAVE 1 SPEAKER, IN PHASE 2 WE WILL HAVE MULTIPLE SPEAKERS\n speakerManager.getSpeaker(eventManager.getEvent(eventID).getSpeakerID()).removeAssignEvent(eventID);\n String organizerOfThisEvent = eventManager.getEvent(eventID).getOrganizerID(); //gets the userid of the organizer of this event\n //in the organizer's list of events that he/she created, this event is removed.\n organizerManager.removeEvent(eventID, organizerOfThisEvent);\n //removes the event from the room. NOTE THIS IS NOT NECESSARY AS YOU WILL NEVER BE ABLE TO ASSIGN A ROOM IN THE PAST, BUT JUST AS A SAFETY MEASURE.\n roomManager.removeEventFromRoom(eventManager.getEvent(eventID).getLocation(), eventID, eventManager.getTime(eventID));\n // and finally removes the event object itself from the event manager.\n eventManager.removeEvent(eventID);\n }\n }\n }",
"public void removeBtn(){\r\n\t\t\r\n\t\tWorkflowEntry entryToBeRemoved = (WorkflowEntry) tableView.getSelectionModel().getSelectedItem();\r\n\t\t\r\n\t\tdata.remove(entryToBeRemoved);\r\n\t\t\r\n\t}",
"@Override\n\tpublic void ApplicationNotificationAction(int arg0, String arg1) {\n\t\t\n\t}",
"@Override\n public void onClick(ClickEvent event) {\n onRemoveAction();\n }",
"public void onRemovedWork(Map<DuccId, IDuccWork> removedWorkMap);",
"public void removeAlarms (){\n AlarmManager alarmManager = (AlarmManager) getContext().getSystemService(Context.ALARM_SERVICE);\n for (int i = 0; i < dogMetaDataArrayList.size(); i++){\n Intent recreateIntent = new Intent(getContext(), OneTimeReciveNotification.class);\n PendingIntent pendingIntent = PendingIntent.getBroadcast(getContext(), i, recreateIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n pendingIntent.cancel();\n alarmManager.cancel(pendingIntent);\n }\n }",
"public void onEventAction(final Event event, final String textMsg, final int action) {\n if (action == R.id.ic_action_vector_resend_message) {\n getActivity().runOnUiThread(new Runnable() {\n @Override\n public void run() {\n resend(event);\n }\n });\n } else if (action == R.id.ic_action_vector_redact_message) {\n getActivity().runOnUiThread(new Runnable() {\n @Override\n public void run() {\n new AlertDialog.Builder(getActivity())\n .setMessage(getString(R.string.redact) + \" ?\")\n .setCancelable(false)\n .setPositiveButton(R.string.ok,\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n if (event.isUndelivered() || event.isUnknownDevice()) {\n // delete from the store\n mSession.getDataHandler().deleteRoomEvent(event);\n\n // remove from the adapter\n mAdapter.removeEventById(event.eventId);\n mAdapter.notifyDataSetChanged();\n mEventSendingListener.onMessageRedacted(event);\n } else {\n redactEvent(event.eventId);\n }\n }\n })\n .setNegativeButton(R.string.cancel, null)\n .show();\n }\n });\n } else if (action == R.id.ic_action_vector_copy) {\n getActivity().runOnUiThread(new Runnable() {\n @Override\n public void run() {\n SystemUtilsKt.copyToClipboard(getActivity(), textMsg);\n }\n });\n } else if ((action == R.id.ic_action_vector_cancel_upload) || (action == R.id.ic_action_vector_cancel_download)) {\n getActivity().runOnUiThread(new Runnable() {\n @Override\n public void run() {\n new AlertDialog.Builder(getActivity())\n .setMessage((action == R.id.ic_action_vector_cancel_upload) ?\n R.string.attachment_cancel_upload : R.string.attachment_cancel_download)\n .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n mRoom.cancelEventSending(event);\n\n getActivity().runOnUiThread(new Runnable() {\n @Override\n public void run() {\n mAdapter.notifyDataSetChanged();\n }\n });\n }\n })\n .setNegativeButton(R.string.no, null)\n .show();\n }\n });\n } else if (action == R.id.ic_action_vector_quote) {\n Activity attachedActivity = getActivity();\n\n if ((null != attachedActivity) && (attachedActivity instanceof VectorRoomActivity)) {\n // Quote all paragraphs instead\n String[] messageParagraphs = textMsg.split(\"\\n\\n\");\n String quotedTextMsg = \"\";\n for (int i = 0; i < messageParagraphs.length; i++) {\n if (!messageParagraphs[i].trim().equals(\"\")) {\n quotedTextMsg += \"> \" + messageParagraphs[i];\n }\n\n if (!((i + 1) == messageParagraphs.length)) {\n quotedTextMsg += \"\\n\\n\";\n }\n }\n ((VectorRoomActivity) attachedActivity).insertQuoteInTextEditor(quotedTextMsg + \"\\n\\n\");\n }\n } else if ((action == R.id.ic_action_vector_share) || (action == R.id.ic_action_vector_forward) || (action == R.id.ic_action_vector_save)) {\n //\n Message message = JsonUtils.toMessage(event.getContent());\n\n String mediaUrl = null;\n String mediaMimeType = null;\n EncryptedFileInfo encryptedFileInfo = null;\n\n if (message instanceof ImageMessage) {\n ImageMessage imageMessage = (ImageMessage) message;\n\n mediaUrl = imageMessage.getUrl();\n mediaMimeType = imageMessage.getMimeType();\n encryptedFileInfo = imageMessage.file;\n } else if (message instanceof VideoMessage) {\n VideoMessage videoMessage = (VideoMessage) message;\n\n mediaUrl = videoMessage.getUrl();\n encryptedFileInfo = videoMessage.file;\n\n if (null != videoMessage.info) {\n mediaMimeType = videoMessage.info.mimetype;\n }\n } else if (message instanceof FileMessage) {\n FileMessage fileMessage = (FileMessage) message;\n\n mediaUrl = fileMessage.getUrl();\n mediaMimeType = fileMessage.getMimeType();\n encryptedFileInfo = fileMessage.file;\n }\n\n // media file ?\n if (null != mediaUrl) {\n onMediaAction(action, mediaUrl, mediaMimeType, message.body, encryptedFileInfo);\n } else if ((action == R.id.ic_action_vector_share) || (action == R.id.ic_action_vector_forward) || (action == R.id.ic_action_vector_quote)) {\n // use the body\n final Intent sendIntent = new Intent();\n\n sendIntent.setAction(Intent.ACTION_SEND);\n sendIntent.putExtra(Intent.EXTRA_TEXT, textMsg);\n sendIntent.setType(\"text/plain\");\n\n if (action == R.id.ic_action_vector_forward) {\n CommonActivityUtils.sendFilesTo(getActivity(), sendIntent);\n } else {\n startActivity(sendIntent);\n }\n }\n } else if (action == R.id.ic_action_vector_permalink) {\n SystemUtilsKt.copyToClipboard(getActivity(), PermalinkUtils.createPermalink(event));\n } else if (action == R.id.ic_action_vector_report) {\n onMessageReport(event);\n } else if ((action == R.id.ic_action_view_source) || (action == R.id.ic_action_view_decrypted_source)) {\n getActivity().runOnUiThread(new Runnable() {\n @Override\n public void run() {\n View view = getActivity().getLayoutInflater().inflate(R.layout.dialog_event_content, null);\n TextView textview = view.findViewById(R.id.event_content_text_view);\n\n Gson gson = new GsonBuilder()\n .disableHtmlEscaping()\n .setPrettyPrinting()\n .create();\n\n textview.setText(gson.toJson(JsonUtils.toJson((action == R.id.ic_action_view_source) ? event : event.getClearEvent())));\n\n new AlertDialog.Builder(getActivity())\n .setView(view)\n .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n dialog.cancel();\n }\n })\n .show();\n }\n });\n } else if (action == R.id.ic_action_device_verification) {\n onE2eIconClick(event, mAdapter.getDeviceInfo(event.eventId));\n } else if (action == R.id.ic_action_re_request_e2e_key) {\n mSession.getCrypto().reRequestRoomKeyForEvent(event);\n\n mReRequestKeyDialog = new AlertDialog.Builder(getActivity())\n .setTitle(R.string.e2e_re_request_encryption_key_dialog_title)\n .setMessage(R.string.e2e_re_request_encryption_key_dialog_content)\n .setPositiveButton(R.string.ok, null)\n .setOnDismissListener(new DialogInterface.OnDismissListener() {\n @Override\n public void onDismiss(DialogInterface dialog) {\n mReRequestKeyDialog = null;\n }\n })\n .show();\n }\n }",
"public boolean deleteAppintment(Appointment appointment) {\n\t\treturn false;\r\n\t}",
"public void buttonRemoveItem(ActionEvent actionEvent) {\n }",
"@RequestMapping(value=\"/Scheduling/removeAppointment\", method= {RequestMethod.DELETE, RequestMethod.GET})\r\n\tpublic String removeAppointment(long id) {\r\n\t\tschedulingService.removeAppointment(id);\r\n\t\treturn \"redirect:/Scheduling\";\r\n\t}",
"public static void deleteTimeButtonClicked() {\n ObservableList<Occasion> allTimes;\n allTimes = tableHoliday.getItems();\n Occasion occasion = tableHoliday.getSelectionModel().getSelectedItem();\n\n allTimes.remove(occasion);\n OccasionCommunication.removeOccasion(occasion.getId());\n }",
"public interface WorkflowExecutionListener {}",
"public void UnPostAllEvents();",
"@Override\n public void actionPerformed(ActionEvent e) {\n setOnVacationOk(atc, guiD, sm);\n }",
"@Override\r\n\tpublic void onDetach() {\n\t\tif(!operFlag&&task.getAlarmTime()<=Calendar.getInstance().getTimeInMillis())\r\n\t\t\ttaskMgr.overdueTask(task);\r\n\t\tsuper.onDetach();\r\n\t\tGlobalVar.todoAdapter.refreshAdapter();\r\n\t\tgetActivity().finish();\r\n\t}",
"public void processAppointmentRequest(int appointmentId)\n {\n AppointmentListSingleton appointments = AppointmentListSingleton.getInstance();\n appointments.approveRequest(appointmentId);\n }",
"public void appointmentDelete(final long appointmentID){\n Callback<Appointment> callback = new Callback<Appointment>() {\n @Override\n public void success(Appointment serverResponse, Response response2) {\n BusProvider.getInstance().post(produceAppointmentServerEvent(serverResponse));\n Log.d(TAG,\"Success, appointment deleted \"+ appointmentID);\n }\n\n @Override\n public void failure(RetrofitError error) {\n if(error != null ){\n Log.e(TAG, error.getMessage());\n error.printStackTrace();\n }\n BusProvider.getInstance().post(produceErrorEvent(-200,error.getMessage()));\n }\n };\n communicatorInterface.deleteAppointment(appointmentID, callback);\n }",
"public void deleteItem(ActionEvent actionEvent) {\n // find the list that the item belongs in\n // removeItem() from its parenting list\n }",
"public void deleteApp(Appointment app, Date dat)\n {\n List z = cal.get(dat);\n boolean flag = true;\n int i = 0;\n while(flag){\n if(z.get(i)==app){\n z.remove(app);\n flag = false;\n }\n i++;\n }\n \n }",
"public interface NotificationCleanupListener {\n void onStarted();\n void onStopped();\n //void onDismiss();\n}",
"public void onClick(DialogInterface arg0, int arg1) {\n\t\t\t\t\t\t\n\t\t\t\t\t //remove the task then update the UI\n\t\t\t\t\t\tcurrentTaskItems.remove(editPosition);\n\t\t\t\t\t\tupdateListViewAndCount();\t\t\t\t\t\t\n\t\t\t\t\t\t}",
"@Override\r\n public void removeNotify() {\r\n // remove listener\r\n component.getResults().removeLabTestListener(this);\r\n \r\n super.removeNotify();\r\n }",
"private void act() {\n\t\tmyAction.embodiment();\n\t}",
"private void removeActionListeners() {\n for (Integer key: app.getWorkSpace().getWorkSpaceMap().keySet()) {\n removeActionListener(app.getWorkSpace().getGridCell(key));\n }\n }",
"private void popCancellationNotification(Passenger p) {\n Seat s = p.getSeat();\n int row = s.getRow();\n int col = s.getCol();\n System.out.printf(\"Successfully canceled seat %d%s for %s.\\n\",\n row, convertSeatColToString(col),p.getName());\n }",
"private void removeNotification(int index, boolean rescheduled){\r\n\t\tif(_debug) Log.v(_context, \"NotificationViewFlipper.removeNotification()\");\r\n\t\t//Get the current notification object.\r\n\t\tNotification notification = getNotification(index);\r\n\t\tif(notification == null){\r\n\t\t\tif(_debug) Log.v(_context, \"NotificationViewFlipper.removeNotification() Notification is null. Exiting...\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tint notificationType = notification.getNotificationType();\r\n\t\t//Adjust for Preview notifications.\r\n\t\tif(notificationType > 1999){\r\n\t\t\tnotificationType -= 2000;\r\n\t\t}\t\t\r\n\t\tint notificationSubType = notification.getNotificationSubType();\r\n\t\t//Set notification as being viewed.\r\n\t\tif(!rescheduled) setNotificationViewed(notification);\r\n \t//Update specific type counts.\r\n\t\tswitch(notificationType){\r\n\t\t\tcase Constants.NOTIFICATION_TYPE_PHONE:{\r\n\t\t\t\t_missedCallCount--;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tcase Constants.NOTIFICATION_TYPE_SMS:{\r\n\t\t\t\t_smsCount--;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tcase Constants.NOTIFICATION_TYPE_MMS:{\r\n\t\t\t\t_mmsCount--;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tcase Constants.NOTIFICATION_TYPE_CALENDAR:{\r\n\t\t\t\t_calendarCount--;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tcase Constants.NOTIFICATION_TYPE_K9:{\r\n\t\t\t\t_k9Count--;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tint viewCount = this.getChildCount();\r\n\t\tif(viewCount > 1){\r\n\t\t\ttry{\r\n\t\t\t\t// Fade out current notification.\r\n\t\t\t\tsetOutAnimation(_context, android.R.anim.fade_out);\r\n\t\t\t\t// If this is the last notification, slide in from left.\r\n\t\t\t\tif(index + 1 == viewCount){\r\n\t\t\t\t\tsetInAnimation(inFromLeftAnimation());\r\n\t\t\t\t\t//Update the navigation information on the previous view before we switch to it.\r\n\t\t\t\t\tfinal View previousView = this.getChildAt(index - 1);\r\n\t\t\t\t\tupdateView(previousView, index - 1, 1);\r\n\t\t\t\t}else{ // Else slide in from right.\r\n\t\t\t\t\tsetInAnimation(inFromRightAnimation());\r\n\t\t\t\t\t//Update the navigation information on the next view before we switch to it.\r\n\t\t\t\t\tfinal View nextView = this.getChildAt(index + 1);\r\n\t\t\t\t\tupdateView(nextView, index + 1, -1);\r\n\t\t\t\t}\r\n\t\t\t\t// Remove the view from the ViewFlipper.\r\n\t\t\t\tremoveViewAt(index);\r\n\t\t \t//Update the status bar notifications.\r\n\t\t\t\tif(notificationType != Constants.NOTIFICATION_TYPE_GENERIC){\r\n\t\t\t \tupdateStatusBarNotifications(notificationType, notificationSubType);\r\n\t\t\t\t}\r\n\t\t\t}catch(Exception ex){\r\n\t\t\t\tif(_debug) Log.v(_context, \"NotificationViewFlipper.removeNotification() [Total Notification > 1] ERROR: \" + ex.toString());\r\n\t\t\t}\r\n\t\t}else{\t\r\n\t\t\ttry{\r\n\t\t\t\t// Remove the view from the ViewFlipper.\r\n\t\t\t\tremoveViewAt(index);\r\n\t\t\t\t//Close the ViewFlipper and finish the Activity.\r\n\t\t\t\t_notificationActivity.finishActivity();\r\n\t\t\t}catch(Exception ex){\r\n\t\t\t\tif(_debug) Log.v(_context, \"NotificationViewFlipper.removeNotification() [TotalNotification <= 1] ERROR: \" + ex.toString());\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void clickedPresentationDelete() {\n\t\tif(mainWindow.getSelectedRowPresentation().length <= 0) ApplicationOutput.printLog(\"YOU DID NOT SELECT ANY PRESENTATION\");\n\t\telse if(mainWindow.getSelectedRowPresentation().length > 1) ApplicationOutput.printLog(\"Please select only one presentation to edit\");\n\t\telse {\n\t\t\tint tmpSelectedRow = mainWindow.getSelectedRowPresentation()[0];\n\t\t\tPresentations tmpPresentation = presentationList.remove(tmpSelectedRow);\t\t\t\n\t\t\tappDriver.hibernateProxy.deletePresentation(tmpPresentation);\t\n\t\t\trefreshPresentationTable();\t\t\t\n\t\t}\n\t}",
"@Override\n public void action() {\n DFAgentDescription appointmentAgentDescription = dfSubscription.getAgentDescription();\n List<AllocationState> preferredAllocations = patientAgent.getAllocationStates();\n\n if (patientAgent.getCurrentAllocation() == GlobalAgentConstants.APPOINTMENT_UNINITIALIZED) {\n /* Patient agent has not got any appointment from the hospital agent yet */\n return;\n\n } else if (preferredAllocations.isEmpty()) {\n /* Patient Agent has its most preferred appointment */\n isHappyWithAppointment = true;\n\n } else if (appointmentAgentDescription != null) {\n\n /* Loop executed when action is executed for the first time */\n if (preferredAllocationsIterator == null) {\n /* Querying patient preferences */\n preferredAllocationsIterator = patientAgent.getAllocationStates().iterator();\n currentSize = patientAgent.getAllocationStates().size();\n }\n\n\n if (!preferredAllocationsIterator.hasNext()) {\n /* Condition executed when no more swaps available */\n updatePreferences();\n\n } else if (expectedMessageTemplate == null) {\n\n /* We are not expecting any response, we can make another swap proposal */\n proposeSwap(preferredAllocationsIterator.next(), appointmentAgentDescription);\n\n } else {\n /* Some message has been sent, awaiting a response */\n ACLMessage expectedMessage = patientAgent.receive(expectedMessageTemplate);\n if (expectedMessage != null) {\n boolean wasSwapSuccessful = receiveResponse(expectedMessage, appointmentAgentDescription);\n expectedMessageTemplate = null;\n currentlyProposedAllocationSwap = null;\n\n /* If swap has been successful, we need to update our preference list\n as the patient agent has got new appointment */\n if (wasSwapSuccessful) {\n updatePreferences();\n }\n }\n }\n }\n }",
"@FXML\n public void OAWeekView(ActionEvent event) {\n Appointment.clearWeeklyAppointments();\n Appointment.setWeekAppointments();\n Appointments.setItems(Appointment.getWeekAppointments());\n }",
"public void actionPerformed( ActionEvent event )\n {\n software.getUpdatePlan().remove( configurationFile );\n // add an event\n parent.getEnvironmentWindow().getChangeEvents().add(\n \"Delete software \" + name + \" configuration file \" + configurationFile.getName() );\n // update the journal pane\n parent.getEnvironmentWindow().updateJournalPane();\n // update the pane\n update();\n }",
"public void notifyRemoved(String publicID) {\n }",
"@FXML\n public void OAMonthView(ActionEvent event) {\n Appointment.clearMonthlyAppointment();\n Appointment.setMonthAppointments();\n Appointments.setItems(Appointment.getMonthAppointments());\n\n }",
"@FXML\n\tprivate void deleteSelected(ActionEvent event) {\n\t\tint selectedIndex = taskList.getSelectionModel().getSelectedIndex();\n\t\tString task = taskList.getItems().get(selectedIndex);\n\t\ttaskList.getSelectionModel().clearSelection();\n\t\ttaskList.getItems().remove(task);\n\t\tchatView.setText(\"\");\n\t\ttaskList.getItems().removeAll();\n\t\tString task_split[] = task.split(\" \", 2);\n\t\tString removeTask = task_split[1];\n\t\tif (task.contains(\"due by\")) {\n\t\t\tString[] taskDate = task_split[1].split(\"\\\\s+\");\n\t\t\tSystem.out.println(taskDate);\n\t\t\tString end = taskDate[taskDate.length - 3];\n\t\t\tSystem.out.println(end);\n\t\t\tremoveTask = task_split[1].substring(0, task_split[1].indexOf(end)).trim();\n\t\t\tSystem.out.println(removeTask);\n\n\t\t}\n\t\tclient.removeTask(removeTask.replace(\"\\n\", \"\"));\n\t}",
"public void delete() {\n\t\tTimelineUpdater timelineUpdater = TimelineUpdater.getCurrentInstance(\":mainForm:timeline\");\n\t\tmodel.delete(event, timelineUpdater);\n\n\t\tFacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, \"The booking \" + getRoom() + \" has been deleted\", null);\n\t\tFacesContext.getCurrentInstance().addMessage(null, msg);\n\t}",
"protected abstract void checkRemoved();",
"@FXML void supprimerPersonnel(ActionEvent event) {\r\n\r\n }",
"private void removeClickList() {\n\t\t\n\t\tmyGame.removeChatRequestListener(this);\n\t\tmyGame.removeNotificationListener(this);\n\t\tmyGame.removeZoneRequestListener(this);\n\t\tmyGame.removeConnectionRequestListener(this);\n\t\t\n\t}",
"@Override\n public void onClick(View v) {\n \tToast.makeText(TaskActivity.this, \"Deleting Logs!\", Toast.LENGTH_SHORT).show();\n \tReadCalendar.deleteAllEvents(getApplicationContext());\n }",
"public void processDeletion() {\n\n\t\tString iD = idIn.getText();\n\n\t\tfc = fitnessProg.getFitnessClassWithID(iD);\n\t\tint indexPos = 0;\n\t\t\n\t\tif (fc != null) {\n\t\t\t\n\t\t\tint startTime = fc.getStartTime();\n\t\t\tindexPos = startTime - 9;\n\t\t\tfitnessClass [indexPos] = null;\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\tJOptionPane.showMessageDialog(null, \"There is no scheduled class with this ID\",\n\t\t\t\t\t\"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t}\n\t}",
"@Override\n\t\t\t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,\n\t\t\t\t\t\t\t\t\t\t\tint which) {\n\t\t\t\t\t\t\t\t\t\tjob.deleteJob(list.get(arg2).getId());\n\t\t\t\t\t\t\t\t\t\tlist.remove(arg2);\n\t\t\t\t\t\t\t\t\t\tadapter.notifyDataSetChanged();\n\t\t\t\t\t\t\t\t\t}",
"public void setupAppointments() {\n\n\t\t// // remember for animation\n\t\t// final List<AbstractClusteredDayAppointmentPane>\n\t\t// lOldClusteredDayAppointmentPanes = new\n\t\t// ArrayList<AbstractClusteredDayAppointmentPane>(\n\t\t// clusteredAppointmentPanes);\n\t\t// final List<WholedayAppointmentPane> lOldWholedayAppointmentPanes =\n\t\t// new ArrayList<WholedayAppointmentPane>(\n\t\t// wholedayAppointmentPanes);\n\t\t//\n\t\t// // clear\n\t\t// clusteredAppointmentPanes.clear();\n\t\t// wholedayAppointmentPanes.clear();\n\t\t// if (calendarObjectProperty.get() == null) {\n\t\t// return;\n\t\t// }\n\t\t//\n\t\t// // scan all appointments and filter the ones for this day\n\t\t// for (Agenda.Appointment lAppointment : getSkinnable().appointments())\n\t\t// {\n\t\t//\n\t\t// // different panes depending on the appointment time\n\t\t// if (lAppointment.isWholeDay()) {\n\t\t//\n\t\t// // if appointment falls on the same date as this day pane\n\t\t// if (isSameDay(calendarObjectProperty.get(),\n\t\t// lAppointment.getStartTime())) {\n\t\t// WholedayAppointmentPane lAppointmentPane = new\n\t\t// WholedayAppointmentPane(\n\t\t// lAppointment, this);\n\t\t// wholedayAppointmentPanes.add(lAppointmentPane);\n\t\t// lAppointmentPane.setId(lAppointmentPane.getClass()\n\t\t// .getSimpleName() + wholedayAppointmentPanes.size());\n\t\t// }\n\t\t// } else if (lAppointment.getEndTime() == null) {\n\t\t//\n\t\t// // an not-wholeday appointment without an enddate is a task\n\t\t// if (isSameDay(calendarObjectProperty.get(),\n\t\t// lAppointment.getStartTime())) {\n\t\t// TaskAppointmentPane lAppointmentPane = new TaskAppointmentPane(\n\t\t// lAppointment, this);\n\t\t// clusteredAppointmentPanes.add(lAppointmentPane);\n\t\t// lAppointmentPane\n\t\t// .setId(lAppointmentPane.getClass().getSimpleName()\n\t\t// + clusteredAppointmentPanes.size());\n\t\t// }\n\t\t// } else {\n\t\t// // appointments may span multiple days, but the appointment pane\n\t\t// // will clamp the start and end date\n\t\t// RegularAppointmentPane lAppointmentPane = new RegularAppointmentPane(\n\t\t// lAppointment, this);\n\t\t//\n\t\t// // check if the appointment falls in the same day as this day\n\t\t// // pane\n\t\t// if (isSameDay(calendarObjectProperty.get(),\n\t\t// lAppointmentPane.start)\n\t\t// && isSameDay(calendarObjectProperty.get(),\n\t\t// lAppointmentPane.end)) {\n\t\t// clusteredAppointmentPanes.add(lAppointmentPane);\n\t\t// lAppointmentPane\n\t\t// .setId(lAppointmentPane.getClass().getSimpleName()\n\t\t// + clusteredAppointmentPanes.size());\n\t\t// }\n\t\t// }\n\t\t// }\n\t\t//\n\t\t// // sort on start time and then decreasing duration\n\t\t// Collections.sort(clusteredAppointmentPanes,\n\t\t// new Comparator<AbstractDayAppointmentPane>() {\n\t\t// @Override\n\t\t// public int compare(AbstractDayAppointmentPane o1,\n\t\t// AbstractDayAppointmentPane o2) {\n\t\t// if (o1.startAsString.equals(o2.startAsString) == false) {\n\t\t// return o1.startAsString.compareTo(o2.startAsString);\n\t\t// }\n\t\t// return o1.durationInMS > o2.durationInMS ? -1 : 1;\n\t\t// }\n\t\t// });\n\t\t//\n\t\t// // start placing appointments in the tracks\n\t\t// AbstractClusteredDayAppointmentPane lClusterOwner = null;\n\t\t// for (AbstractClusteredDayAppointmentPane lAppointmentPane :\n\t\t// clusteredAppointmentPanes) {\n\t\t// // if there is no cluster owner\n\t\t// if (lClusterOwner == null) {\n\t\t//\n\t\t// // than the current becomes an owner\n\t\t// // only create a minimal cluster, because it will be setup fully\n\t\t// // in the code below\n\t\t// lClusterOwner = lAppointmentPane;\n\t\t// lClusterOwner.clusterTracks = new\n\t\t// ArrayList<List<AbstractClusteredDayAppointmentPane>>();\n\t\t// }\n\t\t//\n\t\t// // in which track should it be added\n\t\t// int lTrackNr = determineTrackWhereAppointmentCanBeAdded(\n\t\t// lClusterOwner.clusterTracks, lAppointmentPane);\n\t\t// // if it can be added to track 0, then we have a \"situation\". Track\n\t\t// // 0 could mean\n\t\t// // - we must start a new cluster\n\t\t// // - the appointment is still linked to the running cluster by means\n\t\t// // of a linking appointment in the higher tracks\n\t\t// if (lTrackNr == 0) {\n\t\t//\n\t\t// // So let's see if there is a linking appointment higher up\n\t\t// boolean lOverlaps = false;\n\t\t// for (int i = 1; i < lClusterOwner.clusterTracks.size()\n\t\t// && lOverlaps == false; i++) {\n\t\t// lOverlaps =\n\t\t// checkIfTheAppointmentOverlapsAnAppointmentAlreadyInThisTrack(\n\t\t// lClusterOwner.clusterTracks, i, lAppointmentPane);\n\t\t// }\n\t\t//\n\t\t// // if it does not overlap, we start a new cluster\n\t\t// if (lOverlaps == false) {\n\t\t// lClusterOwner = lAppointmentPane;\n\t\t// lClusterOwner.clusterMembers = new\n\t\t// ArrayList<AbstractClusteredDayAppointmentPane>();\n\t\t// lClusterOwner.clusterTracks = new\n\t\t// ArrayList<List<AbstractClusteredDayAppointmentPane>>();\n\t\t// lClusterOwner.clusterTracks\n\t\t// .add(new ArrayList<AbstractClusteredDayAppointmentPane>());\n\t\t// }\n\t\t// }\n\t\t//\n\t\t// // add it to the track (and setup all other cluster data)\n\t\t// lClusterOwner.clusterMembers.add(lAppointmentPane);\n\t\t// lClusterOwner.clusterTracks.get(lTrackNr).add(lAppointmentPane);\n\t\t// lAppointmentPane.clusterOwner = lClusterOwner;\n\t\t// lAppointmentPane.clusterTrackIdx = lTrackNr;\n\t\t// // for debug System.out.println(\"----\"); for (int i = 0; i <\n\t\t// // lClusterOwner.clusterTracks.size(); i++) { System.out.println(i +\n\t\t// // \": \" + lClusterOwner.clusterTracks.get(i) ); }\n\t\t// // System.out.println(\"----\");\n\t\t// }\n\t\t//\n\t\t// // laying out the appointments is fairly complex, so we use listeners\n\t\t// // and a relayout method instead of binding\n\t\t// relayout();\n\t\t//\n\t\t// // and swap the appointments; old ones out, new ones in\n\t\t// // TODO: animation? we could move the old appointments to the\n\t\t// equivalent\n\t\t// // positions on the drag pane, then animate them to their new\n\t\t// positions,\n\t\t// // remove the old, and insert the new ones.\n\t\t// // however, this needs to be cross-days, so it cannot be done here\n\t\t// (this\n\t\t// // is only one day), but after the complete setupAppointments()\n\t\t// getChildren().removeAll(lOldClusteredDayAppointmentPanes);\n\t\t// getChildren().removeAll(lOldWholedayAppointmentPanes);\n\t\t// getChildren().addAll(wholedayAppointmentPanes);\n\t\t// getChildren().addAll(clusteredAppointmentPanes);\n\t\t//\n\t\t// // we're done, now have the header updated\n\t\t// dayHeaderPane.setupAppointments();\n\t}",
"@Override\n public void onTaskRemoved(Intent rootIntent) {\n Log.d(TAG, TAG + \" onTaskRemoved\");\n }",
"private void removeClubEvent () {\n boolean okToDelete = true;\n if (CommonPrefs.getShared().confirmDeletes()) {\n int userOption = JOptionPane.showConfirmDialog(\n navToolBar, \n \"Really delete this Event?\",\n \"Delete Confirmation\",\n JOptionPane.YES_NO_OPTION,\n JOptionPane.QUESTION_MESSAGE,\n Home.getShared().getIcon());\n okToDelete = (userOption == JOptionPane.YES_OPTION);\n }\n if (okToDelete) {\n if (position.isNewClubEvent()) {\n position = new ClubEventPositioned();\n position.setIndex (clubEventList.size());\n display(); \n } else {\n noFindInProgress();\n boolean deleted = writer.delete(eventsFile, localPath);\n if (! deleted) {\n Trouble.getShared().report(this, \n \"Event could not be deleted\", \n \"Delete Failure\", \n JOptionPane.ERROR_MESSAGE);\n }\n position = clubEventList.remove (position);\n positionAndDisplay();\n currentFileModified = true;\n } // end if new ClubEvent not yet saved\n }\n \n }",
"@Override\r\n protected void doActionDelegate(int actionId)\r\n {\n \r\n }",
"public void onConfirmFavouriteDeletion();",
"@Override\r\n public void onClick(View view) {\n entries.remove(position);\r\n notifyItemRemoved(position);\r\n notifyItemRangeChanged(position, entries.size());\r\n Toast.makeText(mContext, \"Rejected : \" + u, Toast.LENGTH_SHORT).show();\r\n }",
"@Override\n public void onMenuAction(Alarm alarm, MenuItem item, int position) {\n switch (item.getItemId()) {\n\n case R.id.delete:\n // when user click edit remove alarm\n alarmAdapter.removeAlarm(position);\n // refresh\n alarmAdapter.notifyDataSetChanged();\n // get alarm id to delete alarm in database\n int alarmId = (int) alarm.getId();\n // delete alarm from database\n dataBaseManager.delete(alarmId);\n // cancel pendingIntent\n deleteCancel(alarm);\n break;\n }\n\n }",
"@Override\n public void actionPerformed(ActionEvent e) {\n Workout workout = (Workout) object;\n workoutSet.removeWorkout(workoutSet.indexOf(workout));\n gui.createViewWorkoutsScreen();\n gui.getCards().show(gui.getContainer(), \"view workouts\");\n }",
"void btnRemoveDelivery(Delivery delivery);",
"@FXML\r\n void onActionDelete(ActionEvent event) throws IOException {\r\n\r\n Appointment toDelete = appointmentsTable.getSelectionModel().getSelectedItem();\r\n\r\n\r\n Alert alert = new Alert(Alert.AlertType.CONFIRMATION, \"Are you sure you want to delete appointment ID# \" + toDelete.getAppointmentID() + \" Title: \" + toDelete.getTitle()\r\n + \" Type: \" + toDelete.getType());\r\n Optional<ButtonType> result = alert.showAndWait();\r\n if (result.isPresent() && result.get() == ButtonType.OK) {\r\n\r\n DBAppointments.deleteAppointment(toDelete.getAppointmentID());\r\n\r\n stage = (Stage) ((Button) event.getSource()).getScene().getWindow();\r\n scene = FXMLLoader.load(getClass().getResource(\"/view/appointments.fxml\"));\r\n stage.setScene(new Scene(scene));\r\n stage.show();\r\n }\r\n }",
"private void onDeleteConfirmed() {\n stopService();\n\n Intent intent = new Intent(this, StartRecordingActivity.class);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(intent);\n finish();\n }",
"@Override\n\tpublic void onRemove() {\n\n\t}",
"public void onCancelFavouriteDeletion();",
"@Override\n public void removeNotify()\n {\n unregisterListeners();\n super.removeNotify();\n }",
"@FXML\n void removeAction(ActionEvent event) {\n\n cm.setAutoHide(true);\n\n //Creates menuItems and adds listeners\n MenuItem removeQueue = new MenuItem(\"From queue\");\n removeQueue.setOnAction(this::removeFromQueue);\n MenuItem removeNotes = new MenuItem(\"Notes\");\n removeNotes.setOnAction(this::deleteNotes);\n MenuItem deletePod = new MenuItem(\"Delete podcast\");\n deletePod.setOnAction(this::deletePodcast);\n MenuItem deleteMP3 = new MenuItem(\"Delete MP3 file\");\n deleteMP3.setOnAction(this::deletePodcastMP3);\n\n //Removes all previous options from contextMenu\n cm.getItems().clear();\n\n //Based on the properties of the podcast will determine which options pop-up\n if(podcast.isQueued()){\n cm.getItems().add(removeQueue);\n }\n if(podcast.hasNotes()){\n cm.getItems().add(removeNotes);\n }\n if(podcast.hasNotes() || podcast.isQueued()){\n cm.getItems().add(new SeparatorMenuItem());\n }\n cm.getItems().addAll(deleteMP3, deletePod);\n\n if(!cm.isShowing()) {\n removeBtn.addEventHandler(MouseEvent.MOUSE_CLICKED, mouseEvent -> cm.show(removeBtn, mouseEvent.getScreenX()\n , mouseEvent.getScreenY()));\n }\n }",
"public void processAction(CIDAction action);",
"void onIdentityDismiss(int position);"
] | [
"0.6650744",
"0.63791794",
"0.6188498",
"0.61716515",
"0.6162935",
"0.61070603",
"0.59891504",
"0.5978538",
"0.5915783",
"0.5876467",
"0.5774697",
"0.57204384",
"0.56944466",
"0.56846595",
"0.56569546",
"0.5641968",
"0.56287086",
"0.5626513",
"0.5579629",
"0.5556913",
"0.554518",
"0.5484406",
"0.5475352",
"0.54733485",
"0.5464017",
"0.5460553",
"0.54435205",
"0.54209924",
"0.5414433",
"0.54044956",
"0.54035616",
"0.5396295",
"0.5385716",
"0.53734845",
"0.53706646",
"0.5365928",
"0.53647304",
"0.53643477",
"0.5342111",
"0.5342109",
"0.5318541",
"0.5315122",
"0.531458",
"0.5306995",
"0.53061247",
"0.5300518",
"0.5295824",
"0.52929395",
"0.52880937",
"0.52598786",
"0.5254528",
"0.52447975",
"0.5242429",
"0.5238102",
"0.52336353",
"0.5230634",
"0.5214493",
"0.52065194",
"0.5201768",
"0.51948774",
"0.5192013",
"0.51910204",
"0.51842916",
"0.51763064",
"0.5165911",
"0.515913",
"0.5158257",
"0.51469886",
"0.51327366",
"0.5116189",
"0.5100031",
"0.50901616",
"0.50775546",
"0.507386",
"0.50714034",
"0.50690347",
"0.5061373",
"0.50577605",
"0.5051099",
"0.5050833",
"0.5039922",
"0.5037453",
"0.50317854",
"0.50284284",
"0.50273657",
"0.50233966",
"0.50213885",
"0.501111",
"0.5010842",
"0.5010536",
"0.50093895",
"0.5007258",
"0.5006782",
"0.50061315",
"0.4998756",
"0.49950278",
"0.49940366",
"0.49930987",
"0.49930868",
"0.49839744",
"0.49830154"
] | 0.0 | -1 |
listener on the actions of the workflow | @Override
public void updatedResource( ResourceEvent event )
{
if ( event.getTypeResource( ).equals( Appointment.APPOINTMENT_RESOURCE_TYPE ) )
{
IndexingAppointmentService.getService( ).indexAppointmentStateAndHistory( _appointmentDataSource, _appointmentHistoryDataSource,
Integer.parseInt( event.getIdResource( ) ) );
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface WorkflowExecutionListener {}",
"public interface WorkflowListener extends Configurable {\n\n /**\n * Represents change actions on components.\n */\n public enum Action {\n\n /** The add. */\n ADD,\n /** The remove. */\n REMOVE,\n /** The update. */\n UPDATE\n }\n\n /**\n * Notification of transaction starting.\n *\n * @throws Exception the exception\n */\n public void beginTransaction() throws Exception;\n\n /**\n * Notification pre-commit.\n *\n * @throws Exception the exception\n */\n public void preCommit() throws Exception;\n\n /**\n * Notification post-commit.\n *\n * @throws Exception the exception\n */\n public void postCommit() throws Exception;\n\n /**\n * Notification of a cancelled operation.\n */\n public void cancel();\n\n /**\n * Refset changed.\n *\n * @param refset the refset\n * @param action the action\n * @throws Exception the exception\n */\n public void refsetChanged(Refset refset, Action action) throws Exception;\n\n /**\n * Translation changed.\n *\n * @param translation the translation\n * @param action the action\n * @throws Exception the exception\n */\n public void translationChanged(Translation translation, Action action)\n throws Exception;\n\n /**\n * Refset descriptor ref set member changed.\n *\n * @param member the member\n * @param action the action\n * @throws Exception the exception\n */\n public void refsetDescriptorRefsetMemberChanged(\n RefsetDescriptorRefsetMember member, Action action) throws Exception;\n\n /**\n * Description type ref set member changed.\n *\n * @param member the member\n * @param action the action\n * @throws Exception the exception\n */\n public void descriptionTypeRefsetMemberChanged(\n DescriptionType member, Action action) throws Exception;\n\n /**\n * Concept changed.\n *\n * @param concept the concept\n * @param action the action\n * @throws Exception the exception\n */\n public void conceptChanged(Concept concept, Action action) throws Exception;\n\n /**\n * Member changed.\n *\n * @param member the member\n * @param action the action\n * @throws Exception the exception\n */\n public void memberChanged(ConceptRefsetMember member, Action action)\n throws Exception;\n}",
"@Override\n protected void hookUpActionListeners() {\n }",
"interface ActionDelegate {\n\n /** Called when value of the 'Working directory' field has been changed. */\n void onWorkingDirectoryChanged();\n\n /** Called when value of the 'Arguments' field has been changed. */\n void onArgumentsChanged();\n }",
"private void act() {\n\t\tmyAction.embodiment();\n\t}",
"public abstract void onAction();",
"@Override\n\tpublic void onActionStart(int action) {\n\t\t\n\t}",
"public void action() {\n action.action();\n }",
"public void addActionListeners() {\n\t\tApp.sc.createListener(\"/\" + this.getID() + \"/action/sent\", new OSCListener() {\n\t\t\t@Override\n\t\t\tpublic void acceptMessage(Date time, OSCMessage message) {\n\t\t\t\tConnector actionOutConnector = getConnector(ConnectorType.ACTION_OUT);\n\t\t\t\tactionOutConnector.flashConnection();\n\t\t\t}\n\t\t});\n\t}",
"@Override\n public void action() {\n System.out.println(\"Matchmaker Behaviour\");\n addBehaviour(new RequestToMatchMakerBehaviour());\n\n }",
"@Override\n public void action() {\n }",
"@Override\n public void action() {\n }",
"@Override\n public void action() {\n }",
"public interface ActionDelegate {\n /** Performs some actions in response to a user's choosing entering a Project Name on the wizardS. */\n void onSelectProject();\n \n \n\n }",
"@Override\n\tpublic void action() {\n\t\tSystem.out.println(\"action now!\");\n\t}",
"public void act() \r\n {\r\n // Add your action code here.\r\n }",
"public void act() \r\n {\r\n // Add your action code here.\r\n }",
"public void act() \n {\n // Add your action code here.\n }",
"public void act() \n {\n // Add your action code here.\n }",
"public void act() \n {\n // Add your action code here.\n }",
"public void act() \n {\n // Add your action code here.\n }",
"public void act() \n {\n // Add your action code here.\n }",
"public void act() \n {\n // Add your action code here.\n }",
"public void act() \n {\n // Add your action code here.\n }",
"public void act() \n {\n // Add your action code here.\n }",
"@Override\n\tpublic void action() {\n\t\tACLMessage msgRx = myAgent.receive();\n\t\tif (msgRx != null && msgRx.getPerformative() == ACLMessage.REQUEST) {\n\t\t\tContentManager contentManager = myAgent.getContentManager();\n\t\t\tSystem.out.println(\"RECEIVED = \" + msgRx.getContent());\n\t\t\tmsgRx.setLanguage(\"fipa-sl\");\n\t\t\tmsgRx.setOntology(\"blocks-ontology\");\n\t\t\t\n\t\t\ttry {\n\t\t\t\tContentElementList elementList = (ContentElementList) contentManager\n\t\t\t\t\t\t.extractContent(msgRx);\n\n\t\t\t\tIterator elementIterator = elementList.iterator();\n\n\t\t\t\twhile (elementIterator.hasNext()) {\n\t\t\t\t\tAction action = (Action) elementIterator.next();\n\t\t\t\t\t((Environment) myAgent).getWorld().getActionList().add((Executable) (action.getAction()));\n//\t\t\t\t\t((Executable) (action.getAction()))\n//\t\t\t\t\t\t\t.execute((Environment) myAgent);\n\t\t\t\t}\n\n\t\t\t} catch (UngroundedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (CodecException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (OntologyException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} else {\n\t\t\tblock();\n\t\t}\n\t\t\n\t}",
"@Override\r\n\tpublic void action() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void execute(LiftEvent e) {\n\t\t\t\t\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void execute(LiftEvent e) {\n\t\t\t\t\r\n\t\t\t}",
"@Override\n\t\t\t\tpublic void handle(ActionEvent event) {\n\n\t\t\t\t}",
"@Override\n\t\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\t}",
"public void actionStarted(ActionStreamEvent action);",
"@Override\n\tpublic void action() {\n\n\t}",
"@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\t\n\t\t\t}",
"@Override\n \tpublic void addActions() {\n \t\t\n \t}",
"public interface OnActionSelectedListener {\n\t\t\tpublic void onActionSelected(Tweet tweet, String action);\n\t}",
"interface ActionDelegate {\n\n void onRouteUrlsChanged();\n\n void onResetRouteUrls();\n\n void onSaveRouteUrls();\n }",
"protected abstract void actionExecuted(SUT system, State state, Action action);",
"public void actionPerformed(ActionEvent evt) {\r\n if (listener != null) {\r\n listener.actionPerformed(evt);\r\n } else {\r\n System.out.println(\"RefactoringAction.actionPerformed()\");\r\n updateMetaData();\r\n System.out.println(\"RefactoringAction.actionPerformed() - 2\");\r\n TypeSummary[] typeSummaryArray = getTypeSummaryArray();\r\n System.out.println(\"RefactoringAction.actionPerformed() - 3\");\r\n activateListener(typeSummaryArray, evt);\r\n System.out.println(\"RefactoringAction.actionPerformed() - 4\");\r\n\r\n CurrentSummary.get().reset();\r\n System.out.println(\"RefactoringAction.actionPerformed() - 5\");\r\n }\r\n }",
"interface Action {\n /**\n * Executes the action. Called upon state entry or exit by an automaton.\n */\n void execute();\n }",
"public void processAction(CIDAction action);",
"@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t}",
"void noteActionEvaluationStarted(ActionLookupData actionLookupData, Action action);",
"public void performAction() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}",
"@Override\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSystem.out.println(\"My Listener 2\");\n\t\t}",
"@Override\n public void actionPerformed(ActionEvent e) {\n handleAction();\n }",
"public interface IActionCallBack {\n\n /**\n *\n * @param action action\n * @return will be execute this action\n */\n boolean onPreExecute(IAction action);\n\n /**\n *\n * @param action\n * @param result\n */\n void onExecuteDone(IAction action, ActionResult result);\n\n void onExecuteCancel(IAction action);\n\n}",
"public void performAction();",
"@Override\r\n\tpublic void initActions() {\n\t\t\r\n\t}",
"@SkylarkModule(\n name = \"feedback.action\",\n doc = \"An action that will be executed in a feedback workflow or on_finish hook\",\n category = SkylarkModuleCategory.TOP_LEVEL_TYPE,\n documented = false)\npublic interface Action {\n\n void run(SkylarkContext<?> context) throws ValidationException, RepoException;\n\n String getName();\n\n /** Returns a key-value ist of the options the action was instantiated with. */\n ImmutableSetMultimap<String, String> describe();\n}",
"void actionChanged( final ActionAdapter action );",
"public void actionSuccessful() {\n System.out.println(\"Action performed successfully!\");\n }",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\tSystem.out.println(\"My Listener 1\");\n\t}",
"Iterator actionListeners();",
"protected void notifyWorkflowStatusListeners() {\n\t\tfor (WorkflowStatusListener listener : workflowStatusListeners) {\n\t\t\tlistener.workflowStatusChanged(this);\n\t\t}\n\t}",
"@Override\n\tpublic void HandleEvent(int action) {\n\t\tsetActiveAction(action);\n\t\tSystem.out.println(\"action is :\" + action);\n\t\t\n\t}",
"@Override\r\n\t\t\tpublic void handle(ActionEvent arg0) {\n\t\t\t}",
"@Override\n protected void doAct() {\n }",
"@Override\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent e) {\n\t\t\t\t\n\t\t\t}",
"void handleActionEvent(ActionEvent event);",
"@Override\r\n\tprotected void listeners() {\n\t\t\r\n\t}",
"public void initiateAction() {\r\n\t\t// TODO Auto-generated method stub\t\r\n\t}",
"protected void createActions()\n {\n super.createActions();\n \n wireAction(\n new ContentAssistAction(\n PerlEditorMessages.getResourceBundle(),\n \"ContentAssistProposal.\",\n this),\n PerlEditorCommandIds.CONTENT_ASSIST,\n PerlEditorActionIds.CONTENT_ASSIST);\n \n // each marker clearing action gets its own wiring\n wireAction(new ClearMarkerAction.Critic(this), PerlEditorCommandIds.CLEAR_MARKER,\n PerlEditorActionIds.CLEAR_CRITIC_MARKERS);\n wireAction(new ClearMarkerAction.PodChecker(this), PerlEditorCommandIds.CLEAR_MARKER,\n PerlEditorActionIds.CLEAR_POD_MARKERS);\n wireAction(new ClearMarkerAction.AllMarkers(this), PerlEditorCommandIds.CLEAR_MARKER,\n PerlEditorActionIds.CLEAR_ALL_MARKERS);\n \n wireAction(new PodCheckerAction(this), PerlEditorCommandIds.POD_CHECKER,\n PerlEditorActionIds.POD_CHECKER);\n wireAction(new ToggleCommentAction(this), PerlEditorCommandIds.TOGGLE_COMMENT,\n PerlEditorActionIds.TOGGLE_COMMENT);\n wireAction(new PerlCriticAction(this), PerlEditorCommandIds.CRITIQUE_SOURCE,\n PerlEditorActionIds.PERL_CRITIC);\n wireAction(new FormatSourceAction(this), PerlEditorCommandIds.FORMAT_SOURCE,\n PerlEditorActionIds.FORMAT_SOURCE);\n wireAction(new Jump2BracketAction(this), PerlEditorCommandIds.MATCHING_BRACKET,\n PerlEditorActionIds.MATCHING_BRACKET);\n wireAction(new ExportHtmlSourceAction(this), PerlEditorCommandIds.HTML_EXPORT,\n PerlEditorActionIds.HTML_EXPORT);\n wireAction(new ValidateSourceAction(this), PerlEditorCommandIds.VALIDATE_SYNTAX,\n PerlEditorActionIds.VALIDATE_SYNTAX);\n wireAction(new OpenDeclarationAction(this), PerlEditorCommandIds.OPEN_DECLARATION,\n PerlEditorActionIds.OPEN_DECLARATION);\n wireAction(new PerlDocAction(this), PerlEditorCommandIds.PERL_DOC,\n PerlEditorActionIds.PERL_DOC);\n wireAction(new ExtractSubroutineAction(this), PerlEditorCommandIds.EXTRACT_SUBROUTINE,\n PerlEditorActionIds.EXTRACT_SUBROUTINE);\n }",
"@Override\r\n protected void doActionDelegate(int actionId)\r\n {\n \r\n }",
"public void act() \r\n {\r\n \r\n // Add your action code here\r\n MovimientoNave();\r\n DisparaBala();\r\n Colisiones();\r\n //muestraPunto();\r\n //archivoTxt();\r\n }",
"String getOnAction();",
"public void act() \n {\n checkClicked();\n }",
"void actionCompleted(ActionLookupData actionLookupData);",
"void determineNextAction();",
"private void setActionListeners() {\r\n gm.getSave().addActionListener(e -> {\r\n gtm.saveChanges();\r\n this.serialize();\r\n });\r\n gm.getSaveAs().addActionListener(e -> {\r\n gtm.saveChanges();\r\n this.serializeAs();\r\n });\r\n gm.getOpen().addActionListener(e -> {\r\n if (!newFile && !path.equals(\"\")) {\r\n this.serializeBeforeOpen();\r\n }\r\n this.serializeOpen();\r\n });\r\n gm.getNewToDo().addActionListener(e -> {\r\n gtm.addToDo();\r\n });\r\n gm.getClose().addActionListener(e -> {\r\n System.exit(0);\r\n });\r\n gm.getMinimize().addActionListener(e -> {\r\n this.setState(Frame.ICONIFIED);\r\n });\r\n gm.getZoom().addActionListener(e -> {\r\n this.setExtendedState(this.getExtendedState() | JFrame.MAXIMIZED_BOTH);\r\n });\r\n }",
"public void createEvents(){\r\n\t\tbtnCurrent.addActionListener((ActionEvent e) -> JLabelDialog.run());\r\n\t}",
"public interface ActivityAction {\r\n public void viewedActivity(String condition, String viewerFullName);\r\n}",
"@Override\r\n\tpublic void handle(ActionEvent arg0) {\n\t\t\r\n\t}",
"public abstract void init_actions() throws Exception;",
"@Override\n\tpublic void step(int actionType) {\n\n\t}",
"@Override\n public void act() {\n }",
"abstract public void performAction();",
"@Override\r\n\tpublic void visit(SimpleAction action)\r\n\t{\n\t\t\r\n\t}",
"public void executeAction( String actionInfo );",
"@Override\n\tpublic void newAction() {\n\t\t\n\t}",
"public interface ActionCallBack {\n void acceptOrder(int position);\n void cancelOrder(int position);\n void readyToDeliver(int position);\n void showDetails(int position);\n\n\n\n}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\n\t\t\t}",
"public interface MyActions {\n\n String GET_ROUTINES = \"get-routines\";\n String RENAME_ROUTINE = \"rename-routine\";\n String DELETE_ROUTINE = \"delete-routine\";\n String CREATE_ROUTINE = \"create-routine\";\n String UPDATE_TASKS = \"update-tasks\";\n String GET_TASKS = \"get-tasks\";\n\n String CREATE_TASK = \"create-task\";\n String DELETE_TASK = \"delete-task\";\n void deleteTask(String routine, Task task);\n String UPDATE_TASK = \"update-task\";\n String UPDATE_BREAK_INTERVAL = \"update-break-interval\";\n String GET_BREAK_INTERVAL = \"get-break-interval\";\n String SAVE_HISTORY = \"save-history\"; //save after each task completes\n String GET_HISTORY = \"get-history\";\n String LOGIN = \"login\";\n\n void getRoutines();\n\n void renameRoutine(String oldName, String newName);\n\n void deleteRoutine(String routine);\n\n void createRoutine(String name, int priority);\n\n void updateTask(String routine, Task oldTask, Task newTask, int position);\n\n void updateBreakInterval(String routine, int interval);\n\n void getBreakInterval(String routine);\n\n void getTasks(String routine);\n\n void createTask(String routine, Task task, int priority);\n\n void updateTasks(String routine, List<Task> tasks);\n\n void login(String userEmail);\n\n void saveHistory(String routine, Task task, String date, String time);\n\n void getHistory();\n\n}",
"@Override\n\tpublic void preProcessAction(GwtEvent e) {\n\t\t\n\t}",
"public void doAction(){}",
"public interface OnTaskClickedListener {\n\n void taskOpened(int taskId);\n}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}",
"public interface WorkflowOrchestrator {\n\n <T> Workflow<T> start(WorkflowMeta workflowMeta, Entity<T> entity);\n List<Task> onComplete(Task task, ExecutionContext context);\n List<Task> onFailure(Task task);\n}",
"@Override\n public void accept(Action action) {\n }",
"public interface ActionListener {\n\n /**\n * Process a action sent to {@link ActionListener}.\n *\n * @param action Action to be processed.\n */\n void process(Action action);\n\n /**\n * The firing cycle has ended, the actions can be sent\n */\n void flush();\n}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t}",
"public void doInitialAction(){}",
"public void actionPerformed(ActionEvent ev)\r\n\t\t\t{\t\t\t\t\r\n\t\t\t\tviewJob();\t\t\t\t\r\n \t\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t\t\t}",
"@Override\n\tpublic void handle(ActionEvent event) {\n\n\t}",
"interface OperationCallbacks {\n /**\n * Fired when checking of view status is completed\n * @param isViewed true if is viewed, false otherwise\n */\n void onCheckViewedComplete(boolean isViewed);\n }"
] | [
"0.70694035",
"0.6575323",
"0.6326163",
"0.6313839",
"0.6232856",
"0.6218226",
"0.62072515",
"0.6137374",
"0.60833615",
"0.6029923",
"0.60189635",
"0.60189635",
"0.60189635",
"0.6006857",
"0.59776735",
"0.5972139",
"0.5972139",
"0.5953821",
"0.5953821",
"0.5953821",
"0.5953821",
"0.5953821",
"0.5953821",
"0.5953821",
"0.5953821",
"0.5939714",
"0.5939665",
"0.59254074",
"0.59254074",
"0.5913892",
"0.59006965",
"0.58920854",
"0.5835007",
"0.5828165",
"0.5828165",
"0.58226985",
"0.5817663",
"0.58093554",
"0.58003056",
"0.57996505",
"0.5797562",
"0.578945",
"0.5785038",
"0.57835436",
"0.5775292",
"0.57680446",
"0.5750082",
"0.5732092",
"0.5728169",
"0.57044953",
"0.57011884",
"0.5683374",
"0.568191",
"0.56783205",
"0.5672239",
"0.5668044",
"0.566714",
"0.56588066",
"0.5650409",
"0.5636482",
"0.5635754",
"0.5635642",
"0.5614643",
"0.5611614",
"0.5596718",
"0.55964035",
"0.5593186",
"0.55809563",
"0.556628",
"0.5563474",
"0.55599844",
"0.5559647",
"0.55586207",
"0.55581814",
"0.5556589",
"0.5551492",
"0.5544312",
"0.5536571",
"0.55357313",
"0.55351424",
"0.5534918",
"0.5534588",
"0.55248797",
"0.5524722",
"0.5522485",
"0.5520647",
"0.5519892",
"0.5517791",
"0.5517791",
"0.5517791",
"0.5517791",
"0.5513762",
"0.5511986",
"0.55119115",
"0.5506868",
"0.55068177",
"0.5505565",
"0.5505482",
"0.5505482",
"0.5505356",
"0.55006504"
] | 0.0 | -1 |
Construct the Str variable | public Str(String data) {
this.data = data;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String makeString()\n {\n return \"ArcanaDungeonSource\";\n }",
"public abstract String construct();",
"@Override\n public String createString() {\n return null;\n }",
"public String build();",
"public String build();",
"public String makeString()\n\t{\n\t\treturn \"RandomLevelSource\";\n\t}",
"public static Value makeAnyStr() {\n return theStrAny;\n }",
"StringValue createStringValue();",
"StringValue createStringValue();",
"StringValue createStringValue();",
"StringValue createStringValue();",
"PTString() \n {\n _str = \"\";\n }",
"public String makeString()\n {\n return \"RandomLevelSource\";\n }",
"StringConstant createStringConstant();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"java.lang.String getCsStr();",
"StringOperation createStringOperation();",
"public String toString() {\n\t\treturn str;\n\t}",
"public String toString() {\n\t\treturn String.format(\"Append \" + result.length() + \" chars to String\\n\" + \"final string length = \" + result.length());\n\t}",
"public String toString()\n\t{\n\t\treturn \"\" + storedVar1 + storedVar2;\n\t}",
"public static String create()\n\t{\n\t\treturn new String(B64Code.encode(createBytes()));\n\t}",
"@Override\n public Object construct(Object... args) {\n CharSequence stringData = (args.length > 0 ? ToString(realm(), args[0]) : \"\");\n ExoticString obj = new ExoticString(realm(), stringData);\n obj.setPrototype(realm().getIntrinsic(Intrinsics.StringPrototype));\n return obj;\n }",
"@Export\n static DOMString constant() {\n String constant = \"1234567890 äöüäöüß \" // umlaute\n + \"𝟘𝟙𝟚𝟛𝟜𝟝𝟞𝟟𝟠𝟡 𝒥𝒶𝓋𝒶𝓈𝒸𝓇𝒾𝓅𝓉 \" // surrogate chars\n + \"abcdefghijklmnopqrstuvwxyz\";\n return JSObject.domString( constant );\n }",
"public static Symbol string()\r\n\t{\r\n\t\tString str_text = buffer.toString();\r\n\t\tToken token = new Token(fname, str_text, str_linepos, str_charpos,\r\n\t\t\t\tstr_colpos);\r\n\t\treturn new Symbol(sym.STRING, str_linepos, str_colpos, token);\r\n\t}",
"@Override\n public String toString() {\n return (this.str);\n }",
"protected StringValue() {\r\n value = \"\";\r\n typeLabel = BuiltInAtomicType.STRING;\r\n }",
"public String toString() { return stringify(this, true); }",
"public static Value makeAnyStrIdent() {\n return theStrIdent;\n }",
"public String toString() {\r\n\t\tString result = null;\r\n\t\tif (varname != null){\r\n\t\t\tif (isFormal())\r\n\t\t\t\tresult = \"(?)\" + varname;\r\n\t\t\telse\r\n\t\t\t\tresult = \"($)\"+ varname;\t\r\n\t\t} \r\n\t\telse\r\n\t\t\tresult = super.toString();\r\n\t\t\t\r\n\t\treturn result;\r\n\t}",
"public String toString() {\n\t\tString svar = \"\" + vaerdi; // vaerdi som streng, f.eks. \"4\"\n\t\treturn svar;\n\t}",
"StringExpression createStringExpression();",
"StringContent createStringContent();",
"@Override\n public StringType asString() {\n return TypeFactory.getStringType(this.getValue());\n }",
"public String getString(){\n\t\treturn \t_name + String.format(\"\\nWeight: %s\", _weight) + String.format( \"\\nNumber of wheels: %s\", _numberOfWheels ) + \n\t\t\t\tString.format( \"\\nMax of speed: %s\", _maxOfSpeed ) + String.format( \"\\nMax acceleration: %s\", _maxAcceleration ) + \n\t\t\t\tString.format( \"\\nHeight: %s\", _height ) + String.format( \"\\nLength: %s\", _length ) + String.format( \"\\nWidth: %s\", _width );\n\t}",
"public String buildingString() {\r\n\t\twhichBuild = 1 - whichBuild;\r\n\t\tif (whichBuild == 1) {\r\n\r\n\t\t}\r\n\t\treturn \"420 400;10 10 140 60 60 60 10;140 10 240 60 180 60 10;240 10 400 60 320 60 20 ;10 90 120 180 40 90 15;120 90 280 180 160 90 10;280 90 400 180 340 90 10\";\r\n\t}",
"String getString();",
"String getString();",
"String getString();",
"public String toString()\n\t{\n\t\treturn \"\" + val;\n\t}",
"public String convert()\r\n\t{\r\n\t\treturn str;\r\n\t}",
"public java.lang.String getCsStr() {\n java.lang.Object ref = csStr_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n csStr_ = s;\n }\n return s;\n }\n }",
"public Value createStringValue(short type, String value, CSSEngine engine) throws DOMException {\n/* 53 */ throw createDOMException();\n/* */ }",
"public static Value makeAnyStrUInt() {\n return theStrUInt;\n }",
"public static Value makeJSONStr() {\n return theJSONStr;\n }",
"@Override\n\tpublic String toString()\n\t{\n\t\treturn this.str;\n\t}",
"private static Object Stringbuilder() {\n\t\treturn null;\n\t}",
"String string() {\n return _charsString;\n }",
"public static String create()\n\t{\n\t\tfinal byte[] bytes = getTLS().compute();\n\n\t\treturn new String(B64Code.encode(bytes));\n\t}",
"@NotNull\n String toNbtString();",
"String getString_lit();",
"public String asString();",
"public String toStr() {\r\n return value.toString();\r\n }",
"@Override\n public StringValue toStringBuilder()\n {\n UnicodeBuilderValue sb = new UnicodeBuilderValue();\n\n sb.append(VHelper.noCtx(), this);\n\n return sb;\n }",
"public static String stringType(Obj type) {\n\t\tString str = ObjStr.get(type);\n\t\t\treturn str != null ? str : \"\";\n\t}",
"public String ToStr(){\n\t\tswitch(getTkn()){\n\t\tcase Kali:\n\t\t\treturn \"*\";\n\t\tcase Bagi:\n\t\t\treturn \"/\";\n\t\tcase Div:\n\t\t\treturn \"div\";\n\t\tcase Tambah:\n\t\t\treturn \"+\";\n\t\tcase Kurang:\n\t\t\treturn \"-\";\n\t\tcase Kurungbuka:\n\t\t\treturn \"(\";\n\t\tcase Kurungtutup:\n\t\t\treturn \")\";\n\t\tcase Mod:\n\t\t\treturn \"mod\";\n\t\tcase And:\n\t\t\treturn \"and\";\n\t\tcase Or:\n\t\t\treturn \"or\";\n\t\tcase Xor:\n\t\t\treturn \"xor\";\n\t\tcase Not:\n\t\t\treturn \"!\";\n\t\tcase Bilangan:\n\t\t\tString s = new String();\n\t\t\tswitch (getTipeBilangan()){\n\t\t\tcase _bool:\n\t\t\t\tif (getBilanganBool())\n\t\t\t\t\treturn \"true\";\n\t\t\t\telse\treturn \"false\";\n\t\t\tcase _int:\n\t\t\t\ts+=(getBilanganInt());\n\t\t\t\tbreak;\n\t\t\tcase _float:\n\t\t\t\ts+=(getBilanganFloat());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn s;\n\t\t}\n\t\treturn null;\n\t}",
"public String makeString(){\n\t\tString title = getTitle();\n\t\tString xlabel = getXLabel();\n\t\tString ylabel = getYLabel();\n\t\tString GraphableDataInfoString = (\"<\" + title + \",\" + xlabel + \",\" + ylabel + \">\");\n\t\treturn GraphableDataInfoString;\n\t}",
"private String strBufToString() {\n return new String(strBuf, 0, strBufLen);\n }",
"private void createString() {\n\n\t\tString value = String.valueOf(data[currentIndex++]);\n\t\twhile (currentIndex < data.length && data[currentIndex] != '\"') {\n\t\t\tif (data[currentIndex] == '\\\\') {\n\t\t\t\tcurrentIndex++;\n\t\t\t\tif (currentIndex >= data.length) {\n\t\t\t\t\tthrow new LexerException(\n\t\t\t\t\t\t\t\"Invalid escaping in STRING token.\");\n\t\t\t\t}\n\n\t\t\t\tswitch (data[currentIndex]) {\n\t\t\t\tcase '\"':\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tvalue += data[currentIndex++];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'n':\n\t\t\t\t\tvalue += '\\n';\n\t\t\t\t\tcurrentIndex++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'r':\n\t\t\t\t\tvalue += '\\r';\n\t\t\t\t\tcurrentIndex++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 't':\n\t\t\t\t\tvalue += '\\t';\n\t\t\t\t\tcurrentIndex++;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new LexerException(\n\t\t\t\t\t\t\t\"Invalid escaping in STRING token.\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvalue += data[currentIndex++];\n\t\t\t}\n\t\t}\n\n\t\tif (currentIndex < data.length) {\n\t\t\tvalue += data[currentIndex++];\n\t\t} else {\n\t\t\tthrow new LexerException(\"Missing end: \\\".\");\n\t\t}\n\n\t\ttoken = new Token(TokenType.STRING, value);\n\t}",
"private void createStringConcat( AOpExpr node){\n\t\til.append(fi.createNew(\"java.lang.StringBuilder\"));\n \til.append(InstructionConstants.DUP);\n \tnode.getLeft().apply(this); //Load the left string.\n \til.append(fi.createInvoke(\"java.lang.StringBuilder\", \"<init>\", org.apache.bcel.generic.Type.VOID, new org.apache.bcel.generic.Type[] { org.apache.bcel.generic.Type.STRING }, Constants.INVOKESPECIAL));\n \tnode.getRight().apply(this); \n \til.append(fi.createInvoke(\"java.lang.StringBuilder\", \"append\", new org.apache.bcel.generic.ObjectType(\"java.lang.StringBuilder\"), new org.apache.bcel.generic.Type[] { org.apache.bcel.generic.Type.STRING }, Constants.INVOKEVIRTUAL));\n \til.append(fi.createInvoke(\"java.lang.StringBuilder\", \"toString\", org.apache.bcel.generic.Type.STRING, org.apache.bcel.generic.Type.NO_ARGS, Constants.INVOKEVIRTUAL));\n\t}",
"java.lang.String getScStr();",
"public String toString() {\n\treturn createString(data);\n }",
"public String toString(){return \"(X\" + variable + \" (\"+ zero + \")\" + \" (\" + one +\"))\";}",
"protected String myString(){\n \treturn( \"gate \" + name ); \n }",
"@Override\n public String toString() {\n StringBuilder sb = new StringBuilder(name.trim());\n sb.append(\"=\\\"\");\n sb.append(value);\n sb.append('\"');\n return sb.toString() ;\n }",
"public java.lang.String getCsStr() {\n java.lang.Object ref = csStr_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n csStr_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public String toString()\n\t{\n\t\treturn (new String(wLocalBuffer)) ;\n\t}",
"public static String create()\n\t{\n\t\tBASE64Encoder\tencoder = new BASE64Encoder();\n\n\t\treturn encoder.encode(createBytes());\n\t}",
"public String string() {\n\treturn string;\n }",
"public String getWriteString() {\r\n\t\t\treturn \"Dest \"+name+\" \"+x+\" \"+y+\" \"+z;\r\n\t}",
"public java.lang.String toString() {\n return this.stringValue;\n }",
"@Override\n public String toString() {\n\t\treturn literal;\n\t}",
"private static String generateCRString (CRType<?> cr) {\r\n\t\tString res = \"\";\r\n\t\tif (cr.getAU_A() == null) {\r\n\t\t\tif (cr.getAU_L() != null) res += cr.getAU_L() + \", \" + cr.getAU_F().replaceAll(\"([A-Z])\", \"$1.\"); \r\n\t\t} else {\r\n\t\t\tres += cr.getAU_A().replaceAll(\";\", \",\");\r\n\t\t}\r\n\t\tres += \",\";\r\n\t\tif (cr.getTI() != null)\tres += cr.getTI();\r\n\t\tif (cr.getRPY() != null) res += \" (\" + cr.getRPY() + \") \";\r\n\t\tif (cr.getJ_N() != null) res += cr.getJ_N();\r\n\t\tif (cr.getVOL() != null) res += \", \" + cr.getVOL();\r\n\t\tif (cr.getPAG() != null) res += \", pp.\" + cr.getPAG();\r\n\t\tif (cr.getDOI() != null) res += \", DOI \" + cr.getDOI();\r\n\r\n\t\treturn res;\r\n\t}",
"public String toString() {\r\n return this.variable;\r\n }"
] | [
"0.67573315",
"0.6750779",
"0.6607704",
"0.658998",
"0.658998",
"0.65866065",
"0.65630877",
"0.64709353",
"0.64709353",
"0.64709353",
"0.64709353",
"0.6409344",
"0.63396066",
"0.6312567",
"0.6287129",
"0.6287129",
"0.6287129",
"0.6287129",
"0.6287129",
"0.6287129",
"0.6287129",
"0.6287129",
"0.6287129",
"0.6287129",
"0.6287129",
"0.6287129",
"0.6287129",
"0.6287129",
"0.6287129",
"0.6287129",
"0.6287129",
"0.6287129",
"0.6287129",
"0.6287129",
"0.6287129",
"0.6287129",
"0.6287129",
"0.6287129",
"0.6287129",
"0.6287129",
"0.6287129",
"0.6287129",
"0.6252566",
"0.61329365",
"0.611925",
"0.6112335",
"0.6102868",
"0.6048146",
"0.60469794",
"0.6041602",
"0.60327536",
"0.59959954",
"0.5988738",
"0.5985059",
"0.5983884",
"0.5966642",
"0.59654844",
"0.5959502",
"0.59380394",
"0.59311855",
"0.59279406",
"0.5926892",
"0.5925452",
"0.5925452",
"0.5925452",
"0.59129024",
"0.5912025",
"0.5908563",
"0.59081554",
"0.5905111",
"0.5899099",
"0.58864564",
"0.58832926",
"0.58690786",
"0.5855033",
"0.5841039",
"0.58403826",
"0.58337194",
"0.5824911",
"0.5808969",
"0.5798131",
"0.57944137",
"0.579105",
"0.579037",
"0.5786688",
"0.5786571",
"0.5785063",
"0.57845646",
"0.57735455",
"0.5772055",
"0.57686543",
"0.57604647",
"0.57537645",
"0.5737782",
"0.572845",
"0.57252693",
"0.57250935",
"0.5698443",
"0.569453",
"0.569441"
] | 0.6242621 | 43 |
Construct the Str variable from bytes | public Str(byte[] data) {
unpack(data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static String createString(byte b[]) {\n\treturn StringConverter.byteToHex(b);\n }",
"private static String bytes2String(byte[] bytes) {\n StringBuffer stringBuffer = new StringBuffer();\n for (int i = 0; i < bytes.length; i++) {\n stringBuffer.append((char) bytes[i]);\n }\n return stringBuffer.toString();\n }",
"public BEROctetString(byte[] string)\n {\n this(string, DEFAULT_CHUNK_SIZE);\n }",
"public Str(String data) {\n this.data = data;\n }",
"static ByteString toBytes(String str) {\n return ByteString.copyFrom(str.getBytes(Internal.UTF_8));\n }",
"private static Buffer toBytes(String str) {\n try {\n return new Buffer(str.getBytes(\"UTF-8\"));\n } catch(java.io.UnsupportedEncodingException e) {\n throw new RuntimeException(\"UTF-8 not supported.\", e);\n }\n }",
"public static String readString(Value value) {\n return SafeEncoder.encode((byte[]) value.get());\n }",
"private String strBufToString() {\n return new String(strBuf, 0, strBufLen);\n }",
"public static String decodeToString(byte[] bytes){\n\t\treturn new String(decode(bytes));\n\t}",
"public BEROctetString(byte[] string, int segmentSize)\n {\n this(string, null, segmentSize);\n }",
"public Builder setScStrBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n scStr_ = value;\n onChanged();\n return this;\n }",
"com.google.protobuf.ByteString\n getFromBytes();",
"com.google.protobuf.ByteString\n getFromBytes();",
"com.google.protobuf.ByteString\n getScStrBytes();",
"private String popString() {\n String result = new String(bytes, 0, len, StandardCharsets.UTF_8);\n len = 0;\n return result;\n }",
"@Override\n public String deserialize(byte[] bytes) throws SerializationException {\n return new String(bytes, UTF8);\n }",
"public Builder setStringValueBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n typeCase_ = 5;\n type_ = value;\n onChanged();\n return this;\n }",
"@Test\n public void testBuildRequiredStringWithGoodUtf8() throws Exception {\n assertThat(StringWrapper.newBuilder().setReqBytes(UTF8_BYTE_STRING).getReq())\n .isEqualTo(UTF8_BYTE_STRING_TEXT);\n }",
"@Override\n\tpublic String toString()\n\t{\n\t\treturn new String(bytes);\n\t}",
"private String substring(byte[] bytes, int length) {\n return new String(bytes, 0, Math.min(bytes.length, length), StandardCharsets.UTF_8);\n }",
"ByteArray(String s) {\n\tdata = StringConverter.hexToByte(s);\n }",
"public static String bytesToString(byte[] bytes) {\n if (bytes == null) {\n return \"\";\n }\n return new String(bytes, ENCODING);\n }",
"public static String create()\n\t{\n\t\treturn new String(B64Code.encode(createBytes()));\n\t}",
"@Override\n\t\tpublic byte[] convert(String s) {\n\t\t\treturn s.getBytes();\n\t\t}",
"public Builder setCsStrBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n csStr_ = value;\n onChanged();\n return this;\n }",
"private static String toString (byte[] ba) {\r\n return toString(ba, 0, ba.length);\r\n }",
"private String bytesToString(byte[] someBytes) {\n String retStr = \"\";\n\n for (int i = 0; i < someBytes.length; ++i) {\n retStr += \" \" + someBytes[i];\n }\n\n return retStr;\n }",
"public static String bytesToString(byte[] b) {\n\t\tString s=new String(b);\n\t\treturn s.trim();\n\t}",
"public static String dictIdToString(byte[] idBytes, int offset, int length) {\n try {\n return new String(idBytes, offset, length, \"ISO-8859-1\");\n } catch (UnsupportedEncodingException e) {\n // never happen\n return null;\n }\n }",
"public abstract byte[] mo32305a(String str);",
"int retrieveString(byte s[]);",
"java.lang.String getEncoded();",
"private String asString(ByteBuffer buffer) {\n\t\tByteBuffer copy = buffer.duplicate();\n\t\tbyte[] bytes = new byte[copy.remaining()];\n\t\tcopy.get(bytes);\n\t\treturn new String(bytes, StandardCharsets.UTF_8);\n\t}",
"StringVector(final byte[] data, int offset, long type) throws IllegalVariantTypeException,\n UnsupportedEncodingException\n {\n this.type = type;\n read(data, offset);\n }",
"private static String loadConvert(String str) {\n\t\tint off = 0;\n\t\tint len = str.length();\n\t\tchar[] in = str.toCharArray();\n\t\tchar[] convtBuf = new char[1024];\n\t\tif (convtBuf.length < len) {\n\t\t\tint newLen = len * 2;\n\t\t\tif (newLen < 0) {\n\t\t\t\tnewLen = Integer.MAX_VALUE;\n\t\t\t}\n\t\t\tconvtBuf = new char[newLen];\n\t\t}\n\t\tchar aChar;\n\t\tchar[] out = convtBuf;\n\t\tint outLen = 0;\n\t\tint end = off + len;\n\n\t\twhile (off < end) {\n\t\t\taChar = in[off++];\n\t\t\tif (aChar == '\\\\') {\n\t\t\t\taChar = in[off++];\n\t\t\t\tif (aChar == 'u') {\n\t\t\t\t\t// Read the xxxx\n\t\t\t\t\tint value = 0;\n\t\t\t\t\tfor (int i = 0; i < 4; i++) {\n\t\t\t\t\t\taChar = in[off++];\n\t\t\t\t\t\tswitch (aChar) {\n\t\t\t\t\t\tcase '0':\n\t\t\t\t\t\tcase '1':\n\t\t\t\t\t\tcase '2':\n\t\t\t\t\t\tcase '3':\n\t\t\t\t\t\tcase '4':\n\t\t\t\t\t\tcase '5':\n\t\t\t\t\t\tcase '6':\n\t\t\t\t\t\tcase '7':\n\t\t\t\t\t\tcase '8':\n\t\t\t\t\t\tcase '9':\n\t\t\t\t\t\t\tvalue = (value << 4) + aChar - '0';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'a':\n\t\t\t\t\t\tcase 'b':\n\t\t\t\t\t\tcase 'c':\n\t\t\t\t\t\tcase 'd':\n\t\t\t\t\t\tcase 'e':\n\t\t\t\t\t\tcase 'f':\n\t\t\t\t\t\t\tvalue = (value << 4) + 10 + aChar - 'a';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'A':\n\t\t\t\t\t\tcase 'B':\n\t\t\t\t\t\tcase 'C':\n\t\t\t\t\t\tcase 'D':\n\t\t\t\t\t\tcase 'E':\n\t\t\t\t\t\tcase 'F':\n\t\t\t\t\t\t\tvalue = (value << 4) + 10 + aChar - 'A';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tthrow new IllegalArgumentException(\"Malformed \\\\uxxxx encoding.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tout[outLen++] = (char) value;\n\t\t\t\t} else {\n\t\t\t\t\tif (aChar == 't')\n\t\t\t\t\t\taChar = '\\t';\n\t\t\t\t\telse if (aChar == 'r')\n\t\t\t\t\t\taChar = '\\r';\n\t\t\t\t\telse if (aChar == 'n')\n\t\t\t\t\t\taChar = '\\n';\n\t\t\t\t\telse if (aChar == 'f')\n\t\t\t\t\t\taChar = '\\f';\n\t\t\t\t\tout[outLen++] = aChar;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tout[outLen++] = aChar;\n\t\t\t}\n\t\t}\n\t\treturn new String(out, 0, outLen);\n\t}",
"public Builder setStringValueBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000008;\n stringValue_ = value;\n onChanged();\n return this;\n }",
"com.google.protobuf.ByteString\n getStringValueBytes();",
"com.google.protobuf.ByteString\n getStringValueBytes();",
"public static String deserializeString(ByteBuffer bb) {\n int length = bb.getInt();\n byte[] bytes = new byte[length];\n for (int i = 0; i < length; i++){\n bytes[i] = bb.get();\n }\n return new String(bytes);\n }",
"String decodeString();",
"public static int unserializeString(byte[] arr, int offset, StringBuffer sb) {\n\t\tint i;\n\t\tint len;\n\t\tbyte[] str_byte;\n\t\n\t\tlen = unserializeUint32(arr, offset);\n\t\toffset += 4;\n\t\tstr_byte = new byte[len];\n\t\tfor (i = 0; i < len; i++)\n\t\t\tstr_byte[i] = arr[offset + i];\n\t\n\t\tsb.append(new String(str_byte));\n\t\treturn offset + len;\n\t}",
"public static String data(byte[] a)\n {\n if (a == null)\n return null;\n StringBuilder ret = new StringBuilder();\n int i = 0;\n while (a[i] != 0)\n {\n ret.append((char) a[i]);\n i++;\n }\n return ret.toString();\n }",
"public Builder addStrValuesBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureStrValuesIsMutable();\n strValues_.add(value);\n onChanged();\n return this;\n }",
"com.google.protobuf.ByteString\n getCsStrBytes();",
"public Builder setStringIdBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n stringId_ = value;\n onChanged();\n return this;\n }",
"public Builder setStringIdBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n stringId_ = value;\n onChanged();\n return this;\n }",
"private ByteBuffer encode(String str) {\n ByteBuffer bb = null;\n CharsetEncoder isoencoder = UTF8.newEncoder();\n try {\n bb = isoencoder.encode(CharBuffer.wrap(str));\n } catch (CharacterCodingException e) {\n log.error(e);\n }\n return bb;\n }",
"@Override\n public byte[] serialize(String str) throws SerializationException {\n return str.getBytes(UTF8);\n }",
"public String getString() throws IOException {\n\n String encoding;\n\n switch ( type ) {\n\n // Not all are Latin-1 but it's the closest thing\n case DerParser.NUMERIC_STRING:\n case DerParser.PRINTABLE_STRING:\n case DerParser.VIDEOTEX_STRING:\n case DerParser.IA5_STRING:\n case DerParser.GRAPHIC_STRING:\n case DerParser.ISO646_STRING:\n case DerParser.GENERAL_STRING:\n encoding = \"ISO-8859-1\";\n break;\n\n case DerParser.BMP_STRING:\n encoding = \"UTF-16BE\";\n break;\n\n case DerParser.UTF8_STRING:\n encoding = \"UTF-8\";\n break;\n\n case DerParser.UNIVERSAL_STRING:\n throw new IOException( BaseMessages\n .getString( MQTTPublisherMeta.PKG, \"MQTTClientSSL.Error.InvalidDERCantHandleUCS4String\" ) );\n\n default:\n throw new IOException( BaseMessages\n .getString( MQTTPublisherMeta.PKG, \"MQTTClientSSL.Error.InvalidDERObjectIsNotAString\" ) );\n }\n\n return new String( value, encoding );\n }",
"public EncodeAndDecodeStrings() {}",
"@NonNull\n public static String byteToString(byte[] byteArray) throws UnsupportedEncodingException\n {\n return new String(byteArray, \"UTF-8\");\n }",
"@Test\n public void stringFromBytesArray() {\n byte[] input = new byte[]{\n 12,\n -68,\n 102,\n 17,\n -11,\n 84,\n 11,\n -48,\n -128,\n -102,\n 56,\n -115,\n -55,\n 90,\n 97,\n 91\n };\n\n assertEquals(\n \"0cbc6611f5540bd0809a388dc95a615b\",\n JdkHashTools.getStringFromByteArray(input)\n );\n }",
"abstract public Buffer createBufferFromString(String data);",
"@Benchmark\n public String bytesToStringOkio() {\n return BenchmarkUtils.decodeUtf8(decodeArray);\n }",
"public static String\n adnStringFieldToString(byte[] data, int offset, int length) {\n if (length == 0) {\n return \"\";\n }\n if (length >= 1) {\n if (data[offset] == (byte) 0x80) {\n int ucslen = (length - 1) / 2;\n String ret = null;\n\n try {\n ret = new String(data, offset + 1, ucslen * 2, \"utf-16be\");\n } catch (UnsupportedEncodingException ex) {\n Rlog.e(LOG_TAG, \"implausible UnsupportedEncodingException\",\n ex);\n }\n\n if (ret != null) {\n // trim off trailing FFFF characters\n\n ucslen = ret.length();\n while (ucslen > 0 && ret.charAt(ucslen - 1) == '\\uFFFF')\n ucslen--;\n\n return ret.substring(0, ucslen);\n }\n }\n }\n\n boolean isucs2 = false;\n char base = '\\0';\n int len = 0;\n\n if (length >= 3 && data[offset] == (byte) 0x81) {\n len = data[offset + 1] & 0xFF;\n if (len > length - 3)\n len = length - 3;\n\n base = (char) ((data[offset + 2] & 0xFF) << 7);\n offset += 3;\n isucs2 = true;\n } else if (length >= 4 && data[offset] == (byte) 0x82) {\n len = data[offset + 1] & 0xFF;\n if (len > length - 4)\n len = length - 4;\n\n base = (char) (((data[offset + 2] & 0xFF) << 8) |\n (data[offset + 3] & 0xFF));\n offset += 4;\n isucs2 = true;\n }\n\n if (isucs2) {\n StringBuilder ret = new StringBuilder();\n\n while (len > 0) {\n // UCS2 subset case\n\n if (data[offset] < 0) {\n ret.append((char) (base + (data[offset] & 0x7F)));\n offset++;\n len--;\n }\n\n // GSM character set case\n\n int count = 0;\n while (count < len && data[offset + count] >= 0)\n count++;\n\n ret.append(GsmAlphabet.gsm8BitUnpackedToString(data,\n offset, count));\n\n offset += count;\n len -= count;\n }\n\n return ret.toString();\n }\n\n Resources resource = Resources.getSystem();\n String defaultCharset = \"\";\n try {\n defaultCharset =\n resource.getString(com.android.internal.R.string.gsm_alphabet_default_charset);\n } catch (NotFoundException e) {\n // Ignore Exception and defaultCharset is set to a empty string.\n }\n return GsmAlphabet.gsm8BitUnpackedToString(data, offset, length, defaultCharset.trim());\n }",
"public static String toByteString(byte value) {\n String str = String.format(\"%x\", value);\n if (str.length() == 1)\n str = \"0\" + str;\n return str;\n }",
"public static String bytesToString(byte[] txtInByte){\n \treturn hexToString(bytesToHex(txtInByte));\n }",
"public static String encodeToString(byte[] bytes){\n\t\treturn encodeToString(bytes, false);\n\t}",
"PTString() \n {\n _str = \"\";\n }",
"public static String m24634a(Context context, byte[] bArr, String str) {\n byte[] b = m24637b(context, bArr, str);\n if (b == null) {\n return null;\n }\n try {\n return new String(b, \"UTF-8\");\n } catch (UnsupportedEncodingException unused) {\n return null;\n }\n }",
"protected String getUTF8Str(String str) throws UnsupportedEncodingException {\n return new String(str.getBytes(\"iso-8859-1\"), \"utf-8\");\r\n }",
"public String getString_data() { \n char carr[] = new char[Math.min(net.tinyos.message.Message.MAX_CONVERTED_STRING_LENGTH,60)];\n int i;\n for (i = 0; i < carr.length; i++) {\n if ((char)getElement_data(i) == (char)0) break;\n carr[i] = (char)getElement_data(i);\n }\n return new String(carr,0,i);\n }",
"public static String byte2str(byte b) {\r\n String s = String.format(\"%8s\", Integer.toBinaryString(b & 0xFF)).replace(\r\n ' ', '0');\r\n return s;\r\n }",
"private byte[] stringToBytes(String bytesInStringForm) {\n byte[] bytes = new byte[16];\n String[] byteValues = bytesInStringForm.split(\",\");\n for (int byteIndex = 0; byteIndex < 16; byteIndex++) {\n bytes[byteIndex] = (byte) Integer.parseInt(byteValues[byteIndex]);\n }\n return bytes;\n\n }",
"public void write_string_variable(int size, String str) throws IOException {\n\n // Creem una seqüència amb la mida\n byte bHeader[] = new byte[size];\n String strHeader;\n int numBytes = 0;\n\n // Creem la capçalera amb el nombre de bytes que codifiquen la mida\n numBytes = str.length();\n\n strHeader = String.valueOf(numBytes);\n int len;\n if ((len = strHeader.length()) < size)\n for (int i = len; i < size; i++) {\n strHeader = \"0\" + strHeader;\n }\n for (int i = 0; i < size; i++)\n bHeader[i] = (byte) strHeader.charAt(i);\n // Enviem la capçalera\n dos.write(bHeader, 0, size);\n // Enviem l'string writeBytes de DataOutputStrem no envia el byte més alt dels chars.\n dos.writeBytes(str);\n }",
"public static String create()\n\t{\n\t\tfinal byte[] bytes = getTLS().compute();\n\n\t\treturn new String(B64Code.encode(bytes));\n\t}",
"public static byte[] stringToBytes(String str) {\n\t\tif (str==null)\n\t\t\treturn null;\n\t\tif (str.charAt(str.length()-1)!='\\0') str+='\\0';\n\t\treturn str.getBytes();\n\t}",
"StringVector(final byte[] data, int offset) throws IllegalVariantTypeException,\n UnsupportedEncodingException\n {\n type = LittleEndian.getUShort(data, offset);\n offset += LittleEndian.INT_SIZE; //skip padding as well.\n read(data, offset);\n }",
"public com.google.protobuf.ByteString\n getFromBytes() {\n Object ref = from_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n from_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public abstract String construct();",
"public static String create()\n\t{\n\t\tBASE64Encoder\tencoder = new BASE64Encoder();\n\n\t\treturn encoder.encode(createBytes());\n\t}",
"public byte[] readRawString() throws IOException {\n int length = in.readInt();\n byte[] bytes = new byte[5 + length];\n bytes[0] = (byte) Type.STRING.code;\n bytes[1] = (byte) (0xff & (length >> 24));\n bytes[2] = (byte) (0xff & (length >> 16));\n bytes[3] = (byte) (0xff & (length >> 8));\n bytes[4] = (byte) (0xff & length);\n in.readFully(bytes, 5, length);\n return bytes;\n }",
"byte toStringValue() {\n return (byte) String.valueOf(value).charAt(0);\n }",
"public static String convert(byte[] bytes) {\n/* 34 */ StringBuffer sb = new StringBuffer(bytes.length * 2);\n/* 35 */ for (int i = 0; i < bytes.length; i++) {\n/* 36 */ sb.append(hexs[bytes[i] >> 4 & 0xF]);\n/* 37 */ sb.append(hexs[bytes[i] & 0xF]);\n/* */ } \n/* 39 */ return sb.toString();\n/* */ }",
"StringContent createStringContent();",
"@NotNull\n String toNbtString();",
"private String byteToBase64(final byte[] bytes) {\n String str = DatatypeConverter.printBase64Binary(bytes);\n return str;\n }",
"public String extractString()\n\t{\n\t\t// holds the string builder object to return\n\t\tStringBuilder sb = new StringBuilder();\n\t\t\n\t\t// for every byte\n\t\tfor (int i = 0; i < bytes.length; i++)\n\t\t{\n\t\t\t// extract the current character\n\t\t\tchar current = (char) (bytes[i] & 0xFF);\n\t\t\t\n\t\t\t// append the character\n\t\t\tif (current > 0)\n\t\t\t{\n\t\t\t\tsb.append(current);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// return the string\n\t\treturn sb.toString();\n\t}",
"private static String m3299b(byte[] bArr, String str) throws C1108a {\n try {\n return new String(f3068kj.mo6438c(bArr, str), \"UTF-8\");\n } catch (C1157a e) {\n throw new C1108a(e);\n } catch (UnsupportedEncodingException e2) {\n throw new C1108a(e2);\n }\n }",
"public String convert()\r\n\t{\r\n\t\treturn str;\r\n\t}",
"@Test\n public void testAtomString_7() {\n LOGGER.info(\"testAtomString_7\");\n final String s = \"Hello\";\n final byte[] b = s.getBytes(US_ASCII);\n AtomString atomString1 = new AtomString(b);\n AtomString atomString2 = new AtomString(s);\n assertEquals(atomString1, atomString2);\n }",
"public static Symbol string()\r\n\t{\r\n\t\tString str_text = buffer.toString();\r\n\t\tToken token = new Token(fname, str_text, str_linepos, str_charpos,\r\n\t\t\t\tstr_colpos);\r\n\t\treturn new Symbol(sym.STRING, str_linepos, str_colpos, token);\r\n\t}",
"private String byteToString(byte[] bytes) {\n String bytesInStringForm = \"\";\n for (int byteChecked = 0; byteChecked < bytes.length; byteChecked++) {\n bytesInStringForm += (Integer.toString(bytes[byteChecked]));\n bytesInStringForm += (\",\");\n }\n return bytesInStringForm;\n }",
"public com.google.protobuf.ByteString\n getFromBytes() {\n Object ref = from_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n from_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"String asString();",
"public static String toString(byte[] buf) {\r\n if (buf == null) {\r\n return \"null\";\r\n }\r\n return toString(buf, 0, buf.length);\r\n }",
"public static String bufferToString(Buffer buffer) {\n return buffer.readString(Charset.defaultCharset());\n }",
"private byte[] toBytes(String obj){\n return Base64.getDecoder().decode(obj);\n }",
"public byte[] getUTF8Bytes(String str) {\n\t try { return str.getBytes(\"UTF-8\"); } catch (Exception ex) { return null; }\n\t }",
"public static String toString(String hexStr) {\n\t\treturn new String(toBytes(hexStr));\n\t}",
"public com.google.protobuf.ByteString\n getFromBytes() {\n Object ref = from_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n from_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"String readString(int start, int len)\n {\n char[] val = new char[len];\n int end = start + len;\n\n int idx = 0;\n for(int i = start; i < end; i++)\n val[idx++] = (char)buffer[i];\n\n return new String(val);\n }",
"private CData convert(EValueType type, String str) {\n switch (type)\n {\n case DOUBLE_64:\n return new CData(type, Double.valueOf(str));\n case FLOAT_32:\n return new CData(type, Float.valueOf(str));\n case INT_16:\n return new CData(type, Short.valueOf(str));\n case INT_32:\n return new CData(type, Integer.valueOf(str));\n case INT_64:\n return new CData(type, Long.valueOf(str));\n case INT_8:\n return new CData(type, str.charAt(0));\n case UINT_64:\n return new CData(type, Long.valueOf(str));\n case UINT_32:\n return new CData(type, Long.valueOf(str));\n case UINT_16:\n return new CData(type, Character.valueOf(str.charAt(0)));\n case UINT_8:\n return new CData(type, str.charAt(0));\n case VOID:\n default:\n return CData.VOID;\n }\n }",
"public static String decode(byte[] bytes) {\r\n try {\r\n return new String(CHARSET.newDecoder().decode(ByteBuffer.wrap(bytes)).array());\r\n } catch (CharacterCodingException e) {\r\n throw new IllegalArgumentException(\"Encoding failed\", e);\r\n }\r\n }",
"protected String decodeString(byte[] data) {\n\t\tString rv = null;\n\t\ttry {\n\t\t\tif (data != null) {\n\t\t\t\trv = new String(data, charset);\n\t\t\t}\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t\treturn rv;\n\t}",
"public String read_string_variable(int size) throws IOException {\n byte bHeader[] = new byte[size];\n char cHeader[] = new char[size];\n int numBytes = 0;\n\n // Llegim els bytes que indiquen la mida de l'string\n bHeader = read_bytes(size);\n // La mida de l'string ve en format text, per tant creem un string i el parsejem\n for (int i = 0; i < size; i++) {\n cHeader[i] = (char) bHeader[i];\n }\n numBytes = Integer.parseInt(new String(cHeader));\n\n // Llegim l'string\n byte bStr[] = new byte[numBytes];\n char cStr[] = new char[numBytes];\n bStr = read_bytes(numBytes);\n for (int i = 0; i < numBytes; i++)\n cStr[i] = (char) bStr[i];\n return String.valueOf(cStr);\n }",
"private void sstring(Tlv tlv, String a){\n if(a != null){\n byte[] data = StringUtil.bytesOfStringCP_1251(a); \n //uint16 value (length)\n uint16(tlv, data.length + 1);\n //asciiz string \n tlv.addTlvData(DataWork.putArray(data)); \n tlv.addTlvData(DataWork.putByte(0x00)); \n }else{\n tlv.addTlvData(DataWork.putWordLE(0x00));\n tlv.addTlvData(DataWork.putWordLE(0x00));\n } \n }",
"public static Value makeStr(String s) {\n Value r = new Value();\n r.str = s;\n return canonicalize(r);\n }",
"String getString() throws IOException {\n\n\t\t\tString encoding;\n\n\t\t\tswitch (this.type) {\n\n\t\t\t// Not all are ISO-8859-1 but it's the closest thing\n\t\t\tcase DerParser.NUMERIC_STRING:\n\t\t\tcase DerParser.PRINTABLE_STRING:\n\t\t\tcase DerParser.VIDEOTEX_STRING:\n\t\t\tcase DerParser.IA5_STRING:\n\t\t\tcase DerParser.GRAPHIC_STRING:\n\t\t\tcase DerParser.ISO646_STRING:\n\t\t\tcase DerParser.GENERAL_STRING:\n\t\t\t\tencoding = \"ISO-8859-1\";\n\t\t\t\tbreak;\n\n\t\t\tcase DerParser.BMP_STRING:\n\t\t\t\tencoding = \"UTF-16BE\";\n\t\t\t\tbreak;\n\n\t\t\tcase DerParser.UTF8_STRING:\n\t\t\t\tencoding = \"UTF-8\";\n\t\t\t\tbreak;\n\n\t\t\tcase DerParser.UNIVERSAL_STRING:\n\t\t\t\tthrow new IOException(\"Invalid DER: can't handle UCS-4 string\");\n\n\t\t\tcase DerParser.OID:\n\t\t\t\treturn getObjectIdentifier(this.value);\n\t\t\tdefault:\n\t\t\t\tthrow new IOException(String.format(\"Invalid DER: object (%d) is not a string\", this.type));\n\t\t\t}\n\n\t\t\treturn new String(this.value, encoding);\n\t\t}",
"String readString();"
] | [
"0.6570744",
"0.64188266",
"0.6183927",
"0.61105335",
"0.6057891",
"0.6054184",
"0.59788597",
"0.5963041",
"0.5936896",
"0.59287965",
"0.5924632",
"0.5905083",
"0.5905083",
"0.5885344",
"0.5877883",
"0.58591884",
"0.58547723",
"0.5846739",
"0.5839099",
"0.58130735",
"0.58096397",
"0.5788348",
"0.5767411",
"0.5766482",
"0.5754937",
"0.5728828",
"0.5719551",
"0.56945026",
"0.569176",
"0.5683629",
"0.56828284",
"0.5681195",
"0.5680773",
"0.56735706",
"0.56734526",
"0.56538814",
"0.56537145",
"0.56537145",
"0.5652792",
"0.5645181",
"0.562984",
"0.56105757",
"0.56017995",
"0.56012166",
"0.55965924",
"0.55965924",
"0.55910236",
"0.55896944",
"0.55691504",
"0.55628",
"0.5551248",
"0.55430835",
"0.55417895",
"0.5537091",
"0.5535071",
"0.5522771",
"0.55176127",
"0.55111283",
"0.55089086",
"0.5501413",
"0.54948205",
"0.5493937",
"0.54911417",
"0.548737",
"0.5484902",
"0.54671454",
"0.5467071",
"0.5460205",
"0.5447318",
"0.54468775",
"0.5438314",
"0.54361904",
"0.5435163",
"0.54200923",
"0.5420064",
"0.5412446",
"0.53968865",
"0.53935426",
"0.5391161",
"0.5390952",
"0.5388513",
"0.53870815",
"0.53699344",
"0.53667235",
"0.53575754",
"0.5349424",
"0.5328105",
"0.5323804",
"0.53237695",
"0.530842",
"0.53067034",
"0.5306291",
"0.52936864",
"0.52846444",
"0.5265986",
"0.52545303",
"0.52517086",
"0.525032",
"0.52474785",
"0.5241436"
] | 0.6819339 | 0 |
Code to be executed when an ad request fails. | @Override
public void onAdFailedToLoad(int errorCode) {
logger.logError(TAG, "ad failed to load: error code: " + errorCode);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void onAdError(BannerAd ad, String error) {\n Log.d(TAG, \"Something went wrong with the request: \" + error);\n }",
"@Override\n\tpublic void onAdError(String arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void onAdFailed(String arg0) {\n\t\tLog.i(\"AdBannerActivity\", \"onAdFailed\");\n\t}",
"@Override\r\n public void onAdFailedToLoad(int errorCode) {\n }",
"@Override\n public void onAdFailedToLoad(int errorCode) {\n }",
"@Override\n public void onAdFailedToLoad(int errorCode) {\n }",
"@Override\n public void onAdFailedToLoad(int errorCode) {\n }",
"@Override\n public void onAdFailedToLoad(int errorCode) {\n }",
"@Override\n public void onAdFailedToLoad(int errorCode) {\n }",
"@Override\n public void onAdFailedToLoad(int errorCode) {\n }",
"@Override\n public void onAdFailedToLoad(int errorCode) {\n }",
"@Override\n public void onAdFailedToLoad(int errorCode) {\n }",
"@Override\n public void onAdFailedToLoad(int errorCode) {\n }",
"@Override\n public void onAdFailedToLoad(int errorCode) {\n }",
"@Override\n public void onAdFailedToLoad(int errorCode) {\n }",
"@Override\n public void onAdFailedToLoad(int errorCode) {\n }",
"@Override\n public void onAdFailedToLoad(int errorCode) {\n }",
"@Override\r\n\tpublic void onFailedToReceiveAd(Ad arg0, ErrorCode arg1) {\n\t\tLog.d(\"AdMob\", \"失敗\");\r\n\t arg0.stopLoading();\r\n\t arg0.loadAd(new AdRequest());\r\n\t}",
"@Override\n\tpublic void getDisplayAdResponseFailed(String arg0) {\n\t\t\n\t}",
"@Override\n public void onAdFailedToLoad(LoadAdError adError) {\n Log.d(\"ADMOB_ERROR_CODE\", \"admob error code: \" + adError);\n }",
"@Override\n public void onError(Ad ad, AdError adError) {\n Log.e(TAG, \"Native ad failed to load: \" + adError.getErrorMessage());\n }",
"@Override\n public void onAdFailedToLoad(int i) {\n Log.w(TAG, \"onAdFailedToLoad:\" + i);\n }",
"@Override\n public void onAdFailedToLoad(LoadAdError loadAdError) {\n String error =\n String.format(\n \"domain: %s, code: %d, message: %s\",\n loadAdError.getDomain(), loadAdError.getCode(), loadAdError.getMessage());\n Log.e(\n \"MainActivity\",\n \"The previous banner ad failed to load with error: \"\n + error\n + \". Attempting to\"\n + \" load the next banner ad in the items list.\");\n loadBannerAd(index + ITEMS_PER_AD);\n }",
"@Override\n public void onAdFailedToLoad(int errorCode) {\n Log.i(\"Ads\", \"onAdFailedToLoad\");\n }",
"@Override\n public void onAdFailedToLoad(int errorCode) {\n Log.i(\"Ads\", \"onAdFailedToLoad\");\n }",
"@Override\n public void onAdFailedToLoad(int errorCode) {\n Log.i(\"Ads\", \"onAdFailedToLoad\");\n }",
"@Override\n\t\t\t\t\t\t\t\t\t\tpublic void onRequestFail() {\n\n\t\t\t\t\t\t\t\t\t\t}",
"@Override\n public void onAdFailedToLoad(int errorCode) {\n }",
"@Override\n public void onAdFailedToLoad(int errorCode) {\n Log.i(\"Ads\", \"xxx Banner onAdFailedToLoad: \" + errorCode);\n }",
"@Override\n public void onAdFailedToLoad(int errorCode) {\n Log.i(\"Ads\", \"xxx WelcomeAd onAdFailedToLoad: \" + errorCode);\n }",
"@Override\n public void onAdFailedToLoad(LoadAdError loadAdError) {\n org.appcelerator.kroll.common.Log.d(TAG, \"onAdFailedToLoad\");\n Log.d(TAG, loadAdError.getMessage());\n isLoadingAd = false;\n\n KrollDict errorCallback = new KrollDict();\n errorCallback.put(\"cause\", loadAdError.getCause());\n errorCallback.put(\"code\", loadAdError.getCode());\n errorCallback.put(\"reason\", AdmobModule.getErrorReason(loadAdError.getCode()));\n errorCallback.put(\"message\", loadAdError.getMessage());\n\n if (hasListeners(AdmobModule.AD_FAILED_TO_LOAD)) {\n fireEvent(AdmobModule.AD_FAILED_TO_LOAD, errorCallback);\n }\n\n //DEPRECATED\n if (hasListeners(AdmobModule.AD_NOT_RECEIVED)) {\n org.appcelerator.kroll.common.Log.w(TAG, \"AD_NOT_RECEIVED has been deprecated and should be replaced by AD_FAILED_TO_LOAD\");\n fireEvent(AdmobModule.AD_NOT_RECEIVED, errorCallback);\n }\n }",
"public void onFailedToReceiveAd(AdView adView);",
"@Override\r\n\tpublic void onFail() {\n\t\tif(bSendStatus)\r\n\t\t\tnativeadstatus(E_ONFAIL);\r\n\t}",
"@Override\n public void onAdFailedToLoad(int errorCode) {\n Log.e(\"MainActivity\", \"The previous ad failed to load. Attempting to\"\n + \" load the next ad in the items list at position \" + index);\n loadNativeExpressAd(index + ITEMS_PER_AD);\n }",
"@Override\n public void onAdFailedToLoad(int errorCode) {\n Log.d(\"TAG\",\"Ad failed to load\");\n }",
"@Override\n public void onRewardedAdFailedToLoad(LoadAdError adError) {\n }",
"@Override\n public void onRewardedAdFailedToLoad(LoadAdError adError) {\n }",
"public void onRequestFailure(Request request, IOException e) { }",
"@Override\n\tpublic void onBannerFailed(MoPubView arg0, MoPubErrorCode arg1) {\n\t\t\n\t}",
"@Override\n public void onAdFailedToLoad(int errorCode) {\n Log.e(\"MainActivity\", \"The previous native ad failed to load. Attempting to\"\n + \" load another.\");\n if (!adLoader.isLoading()) {\n insertAdsInMenuItems();\n }\n }",
"public synchronized void onRequestFailed(String reason) {\r\n\t\tallRequestsTracker.onRequestFailed(reason);\r\n\t\trecentRequestsTracker.onRequestFailed(reason);\r\n\t\tmeter.mark();\r\n\t}",
"public final /* synthetic */ void d() {\n this.f8097d.onAdFailedToLoad(1);\n }",
"protected void handleFailMessage(Request request, IOException e) {\n\t\tonRequestFailure(request, e);\n\t}",
"@Override\n\t\tpublic void onUnityAdsError(UnityAds.UnityAdsError arg0, String arg1) {\n\n\t\t}",
"public synchronized void onRequestFailed(Throwable reason) {\r\n\t\tallRequestsTracker.onRequestFailed(reason);\r\n\t\trecentRequestsTracker.onRequestFailed(reason);\r\n\t\tmeter.mark();\r\n\t}",
"@Override\n\tpublic void getFullScreenAdResponseFailed(int arg0) {\n\t\t\n\t}",
"@Override\n public void onAdFailedToLoad(int errorCode) {\n sponsoredLinearLayout.setVisibility(View.GONE);\n adView.setVisibility(View.GONE);\n adProgressBar.setVisibility(View.GONE);\n adFailedLinearLayout.setVisibility(View.VISIBLE);\n }",
"public void requestFailed(RequestFailureEvent e);",
"public final void adError(java.lang.String r11) {\n /*\n r10 = this;\n int r0 = r11.hashCode()\n switch(r0) {\n case -2026653947: goto L_0x0044;\n case -1958363695: goto L_0x003a;\n case -1477010874: goto L_0x0030;\n case -507110949: goto L_0x0026;\n case 297538105: goto L_0x001c;\n case 350741825: goto L_0x0012;\n case 844170097: goto L_0x0008;\n default: goto L_0x0007;\n }\n L_0x0007:\n goto L_0x004e\n L_0x0008:\n java.lang.String r0 = \"Too Slow Connection\"\n boolean r0 = r11.equals(r0)\n if (r0 == 0) goto L_0x004e\n r0 = 4\n goto L_0x004f\n L_0x0012:\n java.lang.String r0 = \"Timeout\"\n boolean r0 = r11.equals(r0)\n if (r0 == 0) goto L_0x004e\n r0 = 5\n goto L_0x004f\n L_0x001c:\n java.lang.String r0 = \"Ad Not Ready\"\n boolean r0 = r11.equals(r0)\n if (r0 == 0) goto L_0x004e\n r0 = 6\n goto L_0x004f\n L_0x0026:\n java.lang.String r0 = \"No market installed on the device\"\n boolean r0 = r11.equals(r0)\n if (r0 == 0) goto L_0x004e\n r0 = 3\n goto L_0x004f\n L_0x0030:\n java.lang.String r0 = \"Connection Error\"\n boolean r0 = r11.equals(r0)\n if (r0 == 0) goto L_0x004e\n r0 = 0\n goto L_0x004f\n L_0x003a:\n java.lang.String r0 = \"No Ads\"\n boolean r0 = r11.equals(r0)\n if (r0 == 0) goto L_0x004e\n r0 = 2\n goto L_0x004f\n L_0x0044:\n java.lang.String r0 = \"Internal error\"\n boolean r0 = r11.equals(r0)\n if (r0 == 0) goto L_0x004e\n r0 = 1\n goto L_0x004f\n L_0x004e:\n r0 = -1\n L_0x004f:\n switch(r0) {\n case 0: goto L_0x0068;\n case 1: goto L_0x0065;\n case 2: goto L_0x0062;\n case 3: goto L_0x005f;\n case 4: goto L_0x005c;\n case 5: goto L_0x0059;\n case 6: goto L_0x0056;\n default: goto L_0x0052;\n }\n L_0x0052:\n java.lang.String r0 = \"\"\n L_0x0054:\n r6 = r0\n goto L_0x006b\n L_0x0056:\n java.lang.String r0 = \"error_ad_not_ready\"\n goto L_0x0054\n L_0x0059:\n java.lang.String r0 = \"error_timeout\"\n goto L_0x0054\n L_0x005c:\n java.lang.String r0 = \"error_slow_connection\"\n goto L_0x0054\n L_0x005f:\n java.lang.String r0 = \"error_no_market\"\n goto L_0x0054\n L_0x0062:\n java.lang.String r0 = \"error_no_ads\"\n goto L_0x0054\n L_0x0065:\n java.lang.String r0 = \"error_internal_error\"\n goto L_0x0054\n L_0x0068:\n java.lang.String r0 = \"error_connection_error\"\n goto L_0x0054\n L_0x006b:\n com.appnext.ads.interstitial.Interstitial r0 = com.appnext.ads.interstitial.Interstitial.this\n java.lang.String r1 = r0.getTID()\n com.appnext.ads.interstitial.Interstitial r0 = com.appnext.ads.interstitial.Interstitial.this\n java.lang.String r2 = r0.getVID()\n com.appnext.ads.interstitial.Interstitial r0 = com.appnext.ads.interstitial.Interstitial.this\n java.lang.String r3 = r0.getAUID()\n com.appnext.ads.interstitial.Interstitial r0 = com.appnext.ads.interstitial.Interstitial.this\n java.lang.String r4 = r0.getPlacementID()\n com.appnext.ads.interstitial.Interstitial r0 = com.appnext.ads.interstitial.Interstitial.this\n java.lang.String r5 = r0.getSessionId()\n java.lang.String r7 = \"current_interstitial\"\n java.lang.String r8 = \"\"\n java.lang.String r9 = \"\"\n com.appnext.core.f.a((java.lang.String) r1, (java.lang.String) r2, (java.lang.String) r3, (java.lang.String) r4, (java.lang.String) r5, (java.lang.String) r6, (java.lang.String) r7, (java.lang.String) r8, (java.lang.String) r9)\n com.appnext.ads.interstitial.Interstitial r0 = com.appnext.ads.interstitial.Interstitial.this\n com.appnext.core.callbacks.OnAdError r0 = r0.userOnAdError\n if (r0 == 0) goto L_0x00a3\n com.appnext.ads.interstitial.Interstitial r0 = com.appnext.ads.interstitial.Interstitial.this\n com.appnext.core.callbacks.OnAdError r0 = r0.userOnAdError\n r0.adError(r11)\n L_0x00a3:\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.appnext.ads.interstitial.Interstitial.AnonymousClass1.adError(java.lang.String):void\");\n }",
"@Override\n public void onRequestError(RequestError requestError) {\n interstitialIntent = null;\n Log.d(TAG, \"IS: Something went wrong with the request: \" + requestError.getDescription());\n Toast.makeText(MainActivity.this, \"IS: Something went wrong with the request: \", Toast.LENGTH_SHORT).show();\n }",
"public void onFail(int statusCode, String address);",
"@Override\n public void onRewardedVideoAdFailedToLoad(int i) {\n }",
"public void onApiRequestFailed();",
"public void httpfailure(String errmsg) {\n\t\t\n\t}",
"@Override\n\tpublic void getAwardPointsResponseFailed(String arg0) {\n\t\t\n\t}",
"public void onLoadingFailure() {\n AppSession.showDataLoadError(\"post\");\n onLoadingComplete();\n }",
"@Override\n public void onAdFailedToShowFullScreenContent(AdError adError) {\n Log.d(\"TAG\", \"The ad failed to show.\");\n }",
"public void onError(Request request, Throwable exception) {\n\t\t\t logger.severe(\"HTTP error occurred\");\n\t\t\t \tdeliveryPoint.onDeliveryProblem(letterBox, 0);\n\t\t\t }",
"@Override\n public void onAdFailedToLoad(LoadAdError adError) {\n adContainerView.setVisibility(View.GONE);\n }",
"@Override\n public void onAdFailedToShowFullScreenContent(AdError adError) {\n appOpenAd = null;\n isShowingAd = false;\n\n org.appcelerator.kroll.common.Log.d(TAG, \"Ad failed to show.\");\n if (hasListeners(AdmobModule.AD_FAILED_TO_SHOW)) {\n KrollDict rewardedError = new KrollDict();\n rewardedError.put(\"cause\", adError.getCause());\n rewardedError.put(\"code\", adError.getCode());\n rewardedError.put(\"message\", adError.getMessage());\n fireEvent(AdmobModule.AD_FAILED_TO_SHOW, rewardedError);\n }\n\n // load();\n }",
"public void processBlockwiseResponseTransferFailed() {\n //to be overridden by extending classes\n }",
"public synchronized void onRequestFailed(String message, Throwable ex) {\r\n\t\tString reason = message + \": \" + ex.getClass().getName() + \": \" + ex.getMessage();\r\n\t\tallRequestsTracker.onRequestFailed(reason);\r\n\t\trecentRequestsTracker.onRequestFailed(reason);\r\n\t\tmeter.mark();\r\n\t}",
"@Override\n\t\t\t\t\tpublic void httpFail(String response) {\n\t\t\t\t\t}",
"@Override\n\t\t\tpublic void onError(Request request, Throwable exception) {\n\t\t\t\t\n\t\t\t}",
"protected void onConnectionError() {\n\t}",
"void onDownloadFailed(EzDownloadRequest downloadRequest, int errorCode, String errorMessage);",
"@Override\n\t\t\t\t\tpublic void onError(Request request, Throwable exception) {\n\n\t\t\t\t\t}",
"@Override\n\t\t\tpublic void onFail(int code) {\n\t\t\t\t\n\t\t\t}",
"@Override\n public void onRequestFailure(SpiceException spiceException) {\n }",
"@Override\n\tprotected void onResponseFailure(ReqTag tag, MamaHaoServerError error,\n\t\t\tMamaHaoError clientError) {\n\t\tsuper.onResponseFailure(tag, error, clientError);\n\t}",
"@Override\n\t\t\tpublic void onFail(int code) {\n\t\t\t\t\t\n\t\t\t}",
"@Override\n public void onFailure(int statusCode, Headers headers, String response, Throwable throwable) {\n Log.i(\"doRequest\", \"doRequest failed\");\n\n }",
"public void onFailure();",
"public void onConnectionError()\n\t\t{\n\t\t}",
"@Override\n\t\t\t\tpublic void onException(Exception e) {\n\t\t\t\t\tLog.d(\"SD_TRACE\", \"load api exception\" + e.toString());\n\t\t\t\t\tmLoadSuccess = false;\n\t\t\t\t}",
"public void fail( String reason );",
"@Override\n\t\t\t\t\t\t\tpublic void HttpFail(int ErrCode) {\n\n\t\t\t\t\t\t\t}",
"@Override\r\n\t\t\t\t\tpublic void onFailure(Request arg0, IOException arg1) {\n\t\t\t\t\t\tsToast(\"失败\");\r\n\t\t\t\t\t}",
"public void queryError()\r\n {\r\n myFailedQueryCountProvider.setValue(Integer.valueOf(myFailedQueryCounter.incrementAndGet()));\r\n }",
"@Override\n\tpublic void onCardFail() {\n\t\tLoggerUtils.d(\"onCardFail Start!!!\");\n\t\tonFail();\n\t}",
"@Override\n\t\t\t\t\t\tpublic void onFailure(HttpException arg0, String arg1) {\n\t\t\t\t\t\t\tnew Tus(AddIncomeActivity.this)\n\t\t\t\t\t\t\t\t\t.toast(\"网络异常,请稍后······\");\n\t\t\t\t\t\t}",
"@Override\n public void adNotDisplayed(Ad arg0) {\n\n }",
"@Override\n public void adNotDisplayed(Ad arg0) {\n\n }",
"private void handleDownloadFailure(){\n Toast.makeText(this,\n \"Could not establish connection to service.\\n\" +\n \"Please check your internet connection and \\n\" +\n \"make sure internet permissions are granted.\",\n Toast.LENGTH_LONG\n ).show();\n }",
"@Override\r\n\t\t\tpublic void onFailure(Request arg0, IOException arg1) {\n\t\t\t\tsToast(\"失败\");\r\n\t\t\t}",
"public void onError(final Request request, final Throwable exception) {\n \t\t}",
"@Override\n\t\t\tpublic void onError(int httpcode) {\n\t\t\t\t\n\t\t\t}",
"public void inquiryError() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void onFailure(Request request, IOException e) {\n\t\t\t\t Log.i(\"info\",\"hehe\");\n\t\t\t}",
"public void checkErrorLimit(int increment) {\n errorCounter += increment;\n if (errorCounter >= AppyAdService.getInstance().maxErrors()) {\n setAdProcessing(false);\n // todo ????\n }\n }",
"@Override\n public void onAdNotAvailable(AdFormat adFormat) {\n interstitialIntent = null;\n Log.d(TAG, \"IS: No ad available\");\n Toast.makeText(MainActivity.this, \"IS: No ad available\", Toast.LENGTH_SHORT).show();\n }",
"@Override\n\tpublic void getSpendPointsResponseFailed(String arg0) {\n\t\t\n\t}",
"@Override\n public void onRewardedAdFailedToShow(AdError adError) {\n }",
"@Override\n\t\t\t\t\tpublic void onFailure(HttpException arg0, String arg1) {\n\t\t\t\t\t\thandler.sendEmptyMessage(HANDLER_NET_FAILURE);\n\t\t\t\t\t}",
"@Override\n\t\t\t\t\tpublic void onFailure(HttpException arg0, String arg1) {\n\t\t\t\t\t\thandler.sendEmptyMessage(HANDLER_NET_FAILURE);\n\t\t\t\t\t}",
"@Override\n public void onAdUnavailable(final String target) {\n this.cordova.getActivity().runOnUiThread(new Runnable() {\n @Override\n public void run() {\n String event = \"javascript:cordova.fireDocumentEvent('onAdUnavailable', {'zone':'\"+target+\"'})\";\n webView.loadUrl(event);\n }\n });\n\n }",
"@Override\r\n\t\t\t\t\t\t\tpublic void onFail(String msg) {\n\t\t\t\t\t\t\t\tToast.makeText(PhotoImagePagerActivity.this, \"服务器错误\", Toast.LENGTH_SHORT).show();\r\n\t\t\t\t\t\t\t}",
"@Override\n\t\t\tpublic void onBizFailure(String responseDescription, JSONObject data, String flag) {\n\n\t\t\t}",
"void queryError(String queryId, Exception e);",
"@Override\n\tpublic void onFailure(TAResponse response) {\n\t}"
] | [
"0.7860469",
"0.776646",
"0.7336795",
"0.71065897",
"0.710294",
"0.710294",
"0.710294",
"0.710294",
"0.710294",
"0.710294",
"0.710294",
"0.710294",
"0.710294",
"0.710294",
"0.710294",
"0.7080937",
"0.7080937",
"0.70792836",
"0.7066696",
"0.7062845",
"0.7009126",
"0.70053905",
"0.69896764",
"0.6971595",
"0.6964096",
"0.6964096",
"0.6954108",
"0.6936623",
"0.687962",
"0.6817487",
"0.6782381",
"0.6745036",
"0.67198175",
"0.67112696",
"0.66607225",
"0.66065085",
"0.66065085",
"0.6604388",
"0.64704895",
"0.6365124",
"0.6354998",
"0.63174516",
"0.62938124",
"0.6287415",
"0.62749517",
"0.6252423",
"0.62131804",
"0.62119526",
"0.620235",
"0.617772",
"0.6171882",
"0.6118927",
"0.6094237",
"0.6087571",
"0.6005523",
"0.6004887",
"0.59678215",
"0.596058",
"0.59276",
"0.5926019",
"0.59256727",
"0.5907447",
"0.5887257",
"0.58700186",
"0.58675903",
"0.58580095",
"0.5841979",
"0.5840721",
"0.58395886",
"0.5821579",
"0.58101255",
"0.58097434",
"0.57826036",
"0.5777825",
"0.5772066",
"0.5770957",
"0.5764422",
"0.5756675",
"0.5755897",
"0.57438993",
"0.57391095",
"0.57390416",
"0.57390416",
"0.5726945",
"0.5721613",
"0.5711551",
"0.5706565",
"0.56999016",
"0.56984043",
"0.5691517",
"0.56822556",
"0.56731963",
"0.5668854",
"0.566648",
"0.566648",
"0.5662568",
"0.5655364",
"0.56548166",
"0.56533736",
"0.5649574"
] | 0.70694214 | 18 |
Code to be executed when an ad opens an overlay that covers the screen. | @Override
public void onAdOpened() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void onOpened(AdColonyInterstitial ad) {\n notifyShown();\n notifyStarted();\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n mAdView.setVisibility(View.VISIBLE);\n }",
"@Override\r\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\r\n\tpublic void onPresentScreen(Ad arg0) {\n\t\t\r\n\t}",
"@Override\n public void onAdOpened() {\n Log.i(\"Ads\", \"xxx Banner onAdOpened\");\n }",
"@Override\n public void onAdOpened() {\n Log.i(\"Ads\", \"onAdOpened\");\n }",
"@Override\n public void onAdOpened() {\n Log.i(\"Ads\", \"onAdOpened\");\n }",
"@Override\n public void onAdOpened() {\n Log.i(\"Ads\", \"onAdOpened\");\n }",
"@Override\n public void onAdLoaded() {\n Log.i(\"Ads\", \"xxx Banner onAdLoaded; isShow==\" + view.isShown());\n }",
"static void showOverlay() {\n\t\ti1.setOverlay(OL);\n\t}",
"@Override\n public void onInterstitialDisplayed(Ad ad) {\n Log.e(TAG, \"Interstitial ad displayed.\");\n // pd.cancel();\n // showDialog(\"Success!\", \"Adfly earning has been activated successfully. You will see Adfly ads when you click links in articles.\");\n }",
"@Override\n public void onAdOpened() {\n Log.i(\"Ads\", \"xxx WelcomeAd onAdOpened\");\n }",
"public void onShow() {\n this.controller.notifyAdEvent(\"adsWillShow\");\n }",
"@Override\n public void onAdShowedFullScreenContent() {\n Log.d(TAG, \"Ad showed fullscreen content.\");\n if (hasListeners(AdmobModule.AD_SHOWED_FULLSCREEN_CONTENT)) {\n fireEvent(AdmobModule.AD_SHOWED_FULLSCREEN_CONTENT, new KrollDict());\n }\n }",
"@Kroll.method\n public void show(){\n if (isShowingAd) {\n Log.w(TAG, \"The App Open Ad is already showing.\");\n return;\n }\n\n // If the app open ad is still loading, you can not show the ad.\n if (isLoadingAd){\n Log.w(TAG, \"The App Open Ad is still loading. Hang on!\");\n return;\n }\n\n // If the app open ad is not available yet, invoke the callback then load the ad.\n if (!isAdAvailable()) {\n Log.w(TAG, \"The App Open Ad is not available. Did you call load() method?\");\n if (hasListeners(AdmobModule.AD_NOT_READY)) {\n KrollDict rewardedError = new KrollDict();\n rewardedError.put(\"message\", \"Ad not ready yet! You should run the method load() first and wait for the callbacks\");\n fireEvent(AdmobModule.AD_NOT_READY, rewardedError);\n }\n // load();\n return;\n }\n\n if(isAdAvailable()){\n isShowingAd = true;\n appOpenAd.show(TiApplication.getAppCurrentActivity());\n }\n }",
"@Override\n public void onAdOpened() {\n Log.d(\"TAG\",\"Ad opened\");\n }",
"@Override\n public void onAdLoaded(Ad ad) {\n interstitialAd.show();\n enableButton();\n }",
"@Override\n public void onInterstitialDisplayed(Ad ad) {\n }",
"@Override\n public void onInterstitialDisplayed(Ad ad) {\n }",
"@Override\n public void onAdDismissedFullScreenContent() {\n Log.d(TAG, \"Ad dismissed fullscreen content.\");\n appOpenAd = null;\n isShowingAd = false;\n\n if (hasListeners(AdmobModule.AD_CLOSED)) {\n fireEvent(AdmobModule.AD_CLOSED, new KrollDict());\n }\n\n // load();\n }",
"@Override\r\n public void onAdLoaded()//When interstitial is ready to be shoved\r\n {\r\n mInterstitial.showAd();\r\n }",
"@Override\n public void onAdLoaded(Ad ad) {\n Log.d(TAG, \"Interstitial ad is loaded and ready to be displayed!\");\n // Show the ad\n\n }",
"@Override\n public void onAdDismissedFullScreenContent() {\n Log.d(\"TAG\", \"The ad was dismissed.\");\n }",
"@Override\n public void onInterstitialDisplayed(Ad ad) {\n Log.e(TAG, \"Interstitial ad displayed.\");\n }",
"@Override\n public void onInterstitialDisplayed(Ad ad) {\n Log.e(TAG, \"Interstitial ad displayed.\");\n }",
"@Override\n public void onInterstitialDisplayed(Ad ad) {\n Log.e(TAG, \"Interstitial ad displayed.\");\n }",
"@Override\n public void onAdLoaded() {\n mButton.setEnabled(true);\n if (mAd.isLoaded()){\n mAd.show();\n }\n\n }",
"public void overlayChanged() {\r\n\t\toverlayItem.setSelection(overlay.isVisible());\r\n\t}",
"@Override\n public void onAdClicked() {\n }",
"private void bannerAds() {\n Log.d(TAG, \"bannerAds invoked\");\n BannerAdView bannerAdView = new BannerAdView(MainActivity.this);\n bannerAdView.loadOnAttach();\n FrameLayout bannerPlaceholder = findViewById(R.id.banner_placeholder);\n bannerPlaceholder.addView(bannerAdView);\n bannerAdView = new BannerAdView(this)\n .withListener(new BannerAdListener() {\n @Override\n public void onAdError(BannerAd ad, String error) {\n // Called when the banner triggered an error\n Log.d(TAG, \"Something went wrong with the request: \" + error);\n }\n\n @Override\n public void onAdLoaded(BannerAd ad) {\n // Called when the banner has been successfully loaded\n Log.d(TAG, \"Banner successfully loaded\");\n\n }\n\n @Override\n public void onAdClicked(BannerAd ad) {\n // Called when the banner was clicked\n Log.d(TAG, \"User clicked on banner\");\n }\n\n @Override\n public void onAdLeftApplication(BannerAd ad) {\n // Called when the banner interaction causes an external application to be open\n Log.d(TAG, \"User directed out of app by banner\");\n }\n });\n }",
"@Override\n public void onAdLoaded() {\n adContainerView.setVisibility(View.VISIBLE);\n }",
"public void setOverlay(PlacementOverlay overlay);",
"@Override\n public void adClicked(Ad arg0) {\n\n }",
"@Override\n public void onAdClicked() {\n }",
"@Override\n public void onAdClicked() {\n }",
"@Override\n public void onAdClicked() {\n }",
"@Override\n public void onAdClicked() {\n }",
"@Override\n public void onAdClicked() {\n }",
"@Override\n public void onAdClicked() {\n }",
"@Override\n public void onAdClicked() {\n }",
"@Override\n public void onAdClicked() {\n }",
"@Override\n public void onAdClicked(BannerAd ad) {\n Log.d(TAG, \"User clicked on banner\");\n }",
"@Override\n public void adClicked(Ad arg0) {\n\n }",
"@Override\n public void adClicked(Ad arg0) {\n\n }",
"@Override\r\n public void onAdClicked() {\n }",
"@Override\r\n\t\t\tpublic void onAdReceive() {\n\t\t\t\tad.showAd();\r\n\t\t\t}",
"@Override\n public void onAdLoaded() {\n if (mInterstitialAd.isLoaded()) {\n mInterstitialAd.show();\n } else {\n Log.d(\"TAG\", \"The interstitial wasn't loaded yet.\");\n }\n }",
"@Override\n public void onAdLoaded(Ad ad) {\n Log.d(TAG, \"Interstitial ad is loaded and ready to be displayed!\");\n // Show the ad\n// interstitialAd.show();\n }",
"@Override\n public void onAdShowedFullScreenContent() {\n mInterstitialAd = null;\n Log.d(\"TAG\", \"The ad was shown.\");\n }",
"@Override\n public void onAdLoaded() {\n mAdView.setVisibility(View.VISIBLE);\n }",
"@Override\n public void onInterstitialDisplayed(Ad ad) {\n Log.e(\"onInterstitialDisplayed\",\"\"+ad);\n }",
"@Override\r\n\t\t\tpublic void onAdClick() {\n\t\t\t\t\r\n\t\t\t}",
"@Override\n public void onAdLoaded(Ad ad) {\n Log.d(TAG, \"Interstitial ad is loaded and ready to be displayed!\");\n // Show the ad\n //pd.cancel();\n interstitialAd.show();\n }",
"@Override\n\tpublic void onSmartWallAdShowing() {\n\t\t\n\t}",
"@Override\r\n\tpublic void onDismissScreen(Ad arg0) {\n\t\t\r\n\t}",
"protected void onScreenActivate() {\r\n }",
"@Override\r\n\tpublic void onAdClick() {\n\r\n\t}",
"@Override\n public void onAdLoaded(AppOpenAd ad) {\n Log.d(TAG, \"Ad was loaded.\");\n appOpenAd = ad;\n isLoadingAd = false;\n\n setAppOpenEvents();\n\n KrollDict sCallback = new KrollDict();\n\n if (hasListeners(AdmobModule.AD_LOADED)) {\n fireEvent(AdmobModule.AD_LOADED, sCallback);\n }\n\n // DEPRECATED\n if (hasListeners(AdmobModule.AD_RECEIVED)) {\n org.appcelerator.kroll.common.Log.w(TAG, \"AD_RECEIVED has been deprecated and should be replaced by AD_LOADED\");\n fireEvent(AdmobModule.AD_RECEIVED, sCallback);\n }\n }",
"@Override\n public void onAdLoaded(Ad ad) {\n Log.d(TAG, \"Interstitial ad is loaded and ready to be displayed!\");\n\n }",
"abstract void onShown();",
"public interface InterAdListener {\n void onClick(int position, String type);\n}",
"@Override\n public void onAdClicked(Ad ad) {\n }",
"@Override\n public void onAdLoaded() {\n sponsoredLinearLayout.setVisibility(View.VISIBLE);\n adView.setVisibility(View.VISIBLE);\n adProgressBar.setVisibility(View.GONE);\n adFailedLinearLayout.setVisibility(View.GONE);\n }",
"@Override\n public void adDisplayed(Ad ad) {\n\n }",
"@Override\n public void adDisplayed(Ad ad) {\n\n }",
"public void mo1636a() {\n if (this.f9849a.f9856g != null) {\n this.f9849a.f9856g.onAdClicked(this.f9849a);\n }\n }",
"@Override\r\n\tpublic void fullScreenAdClose(boolean arg0) {\n\t\t\r\n\t}",
"@Override\n public void onAdClosed() {\n vInterstitialAdEntertainingFactActivity.loadAd(new AdRequest.Builder().build());\n }",
"@Override\n public void onAdClicked() {\n Log.d(TAG, \"Ad was clicked.\");\n if (hasListeners(AdmobModule.AD_CLICKED)) {\n fireEvent(AdmobModule.AD_CLICKED, new KrollDict());\n }\n }",
"@Override\n public void onAdLoaded(@NonNull InterstitialAd interstitialAd) {\n interstitialAd.show(context);\n\n }",
"@Override\n\tpublic void onBannerClicked(MoPubView arg0) {\n\t\t\n\t}",
"@Override\n public void onAdAvailable(Intent intent) {\n interstitialIntent = intent;\n Log.d(TAG, \"IS: Offers are available\");\n Toast.makeText(MainActivity.this, \"IS: Offers are available\", Toast.LENGTH_SHORT).show();\n showOW.setEnabled(false);\n }",
"@Override\n public void onClick(View view) {\n if (mInterstitialAd.isLoaded()) {\n mInterstitialAd.show();\n } else {\n goToNextActivity();\n }\n }",
"@Override\n public void onAdClosed() {\n Toast.makeText(Apply3Activity.this,\"Ad closed\",Toast.LENGTH_SHORT).show();\n Log.d(\"TAG\",\"Ad Closed\");\n }",
"@Override\n public void onAdClosed() {\n Log.i(\"Ads\", \"xxx Banner onAdClosed\");\n }",
"@Override\n public void onAdLoaded() {\n }",
"@Override\n public void onAdLoaded() {\n }",
"@Override\n public void onAdLoaded() {\n }",
"@Override\n public void onAdLoaded() {\n }",
"@Override\n public void onAdLoaded() {\n }",
"@Override\n public void onAdLoaded() {\n }",
"@Override\n public void onAdLoaded() {\n }",
"@Override\n public void onAdLoaded() {\n }",
"@Override\n public void onAdShown(final String target){\n this.cordova.getActivity().runOnUiThread(new Runnable() {\n @Override\n public void run() {\n String event = \"javascript:cordova.fireDocumentEvent('onAdShown', {'zone':'\"+target+\"'})\";\n webView.loadUrl(event);\n }\n });\n }"
] | [
"0.67206573",
"0.6544345",
"0.64849514",
"0.64849514",
"0.64849514",
"0.6484929",
"0.64773303",
"0.64709985",
"0.639373",
"0.61741036",
"0.61687344",
"0.61687344",
"0.61652154",
"0.6103518",
"0.6075111",
"0.60521466",
"0.60094076",
"0.6005782",
"0.59800327",
"0.59728587",
"0.59713244",
"0.5936912",
"0.5933614",
"0.5933614",
"0.59171414",
"0.59117025",
"0.58924204",
"0.5885742",
"0.58801377",
"0.58801377",
"0.58801377",
"0.5858235",
"0.58577675",
"0.58330846",
"0.58164006",
"0.581534",
"0.58059263",
"0.580245",
"0.57870203",
"0.57870203",
"0.57870203",
"0.57870203",
"0.57870203",
"0.57870203",
"0.57870203",
"0.57870203",
"0.5786878",
"0.5779583",
"0.5779583",
"0.5764236",
"0.57411546",
"0.5734136",
"0.57161504",
"0.5705135",
"0.5703007",
"0.56978935",
"0.56936175",
"0.5691995",
"0.56918806",
"0.5677451",
"0.5666223",
"0.56656814",
"0.5628592",
"0.562384",
"0.5610557",
"0.560271",
"0.5589423",
"0.5579073",
"0.556276",
"0.556276",
"0.5557509",
"0.5540895",
"0.55389655",
"0.55230075",
"0.5520429",
"0.55203503",
"0.5514223",
"0.5512993",
"0.55080205",
"0.5506484",
"0.55019575",
"0.55019575",
"0.55019575",
"0.55019575",
"0.55019575",
"0.55019575",
"0.55019575",
"0.55019575",
"0.5488444"
] | 0.65378547 | 12 |
Code to be executed when the user clicks on an ad. | @Override
public void onAdClicked() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void adClicked(Ad arg0) {\n\n }",
"@Override\n public void adClicked(Ad arg0) {\n\n }",
"@Override\n public void adClicked(Ad arg0) {\n\n }",
"@Override\n public void onAdClicked() {\n Log.d(TAG, \"Ad was clicked.\");\n if (hasListeners(AdmobModule.AD_CLICKED)) {\n fireEvent(AdmobModule.AD_CLICKED, new KrollDict());\n }\n }",
"@Override\r\n\t\t\tpublic void onAdClick() {\n\t\t\t\t\r\n\t\t\t}",
"@Override\n public void onAdClicked(BannerAd ad) {\n Log.d(TAG, \"User clicked on banner\");\n }",
"@Override\r\n public void onAdClicked() {\n }",
"@Override\n\tpublic void onAdClick(String arg0) {\n\t\tLog.i(\"AdBannerActivity\", \"onAdClick\");\n\t}",
"@Override\r\n\tpublic void onAdClick() {\n\r\n\t}",
"@Override\n public void onAdClicked(Ad ad) {\n }",
"@Override\n public void onAdClicked() {\n }",
"public void mo1636a() {\n if (this.f9849a.f9856g != null) {\n this.f9849a.f9856g.onAdClicked(this.f9849a);\n }\n }",
"@Override\n public void onAdClicked() {\n Toast.makeText(Apply3Activity.this,\"Logged in SuccessFully\",Toast.LENGTH_SHORT).show();\n Log.d(\"TAG\",\"Ad clicked\");\n }",
"@Override\n\tpublic void onClick(View v) {\n\t\tMoPubExtension.log(\"SAS interstitial clicked.\");\n\t\tif(listener != null)\n\t\t\tlistener.onInterstitialClicked();\n\t}",
"@Override\n\tpublic void onRealClickAd() {\n\t}",
"@Override\n public void onAdClicked(final String target){\n this.cordova.getActivity().runOnUiThread(new Runnable() {\n @Override\n public void run() {\n String event = \"javascript:cordova.fireDocumentEvent('onAdClicked', {'zone':'\"+target+\"'})\";\n webView.loadUrl(event);\n }\n });\n }",
"@Override\r\n\tpublic void onClick() {\n\t\tif(bSendStatus)\r\n\t\t\tnativeadstatus(E_ONCLICK);\r\n\t}",
"public void handleAdClicks(View v) {\n if (!tozAdCampaign.isEmpty()) {\n AppyAd toa = tozAdCampaign.get(getDisplayedChild());\n if (toa != null) {\n if (toa.mTracking) AppyAdService.getInstance().trackAdCampaign(this, toa);\n String link = toa.mLink;\n if (link != null) {\n if ((link.startsWith(\"app/\")) && (link.length() > 4)) {\n String param = link.substring(4);\n if ((parentHandler != null) && (parentControl != null)) {\n Message message = parentHandler.obtainMessage();\n message.obj = param;\n message.what = parentControl;\n parentHandler.sendMessage(message);\n }\n }\n else if (!link.toLowerCase().equals(\"none\")) {\n try {\n Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(link));\n getContext().startActivity(browserIntent);\n }\n catch (Exception e) {\n AppyAdService.getInstance().errorOut(TAG, \"Unable to navigate to specified link - \"+link);\n }\n }\n }\n }\n }\n }",
"@Override\n\tpublic void onBannerClicked(MoPubView arg0) {\n\t\t\n\t}",
"@Override\n public void adDisplayed(Ad ad) {\n\n }",
"@Override\n public void adDisplayed(Ad ad) {\n\n }",
"@Override\n public void onInterstitialDisplayed(Ad ad) {\n Log.e(TAG, \"Interstitial ad displayed.\");\n // pd.cancel();\n // showDialog(\"Success!\", \"Adfly earning has been activated successfully. You will see Adfly ads when you click links in articles.\");\n }",
"public void onClicked();",
"public interface InterAdListener {\n void onClick(int position, String type);\n}",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n Log.i(\"Ads\", \"xxx Banner onAdOpened\");\n }",
"@Override\n public void onAdOpened() {\n Log.d(\"TAG\",\"Ad opened\");\n }",
"@Override\r\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n Log.i(\"Ads\", \"onAdOpened\");\n }",
"@Override\n public void onAdOpened() {\n Log.i(\"Ads\", \"onAdOpened\");\n }",
"public void onAdvertismentClicked1() {\n HashMap<String, String> params = new HashMap<String, String>();\n\t\t\n // Passing a computing event is a little complex\n\t\t// First the Sub-Category needs to be specified in a Parameter + Value combination\n\t\t// Then the Weightage of the Value needs to be specified in a Value + Weightage Combination\n\t\t// In below Example 30%off is a Sub-Category and 1 is the Weightage of the same\n params.put(\"ParameterName\", \"30%off\");\n params.put(\"30%off\", \"1\");\n\t\t\n\t\t// Event is triggered with EventId and Parameters prepared above, the same are passed in this function\n AdGyde.onComputingEvent(\"Sale\", params);\n Toast.makeText(this, \"Computing event Ad1 clicked\", Toast.LENGTH_SHORT).show();\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onClick(View view) {\n if (mInterstitialAd.isLoaded()) {\n mInterstitialAd.show();\n } else {\n goToNextActivity();\n }\n }",
"@Override\n public void onAdOpened() {\n Log.i(\"Ads\", \"onAdOpened\");\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"public void onChangedAdBtnPressed() {\n String uniqueID = advertisement.getUniqueID();\n view.showEditView(uniqueID);\n }",
"@Override\n public void onInterstitialDisplayed(Ad ad) {\n Log.e(TAG, \"Interstitial ad displayed.\");\n }",
"@Override\n public void onInterstitialDisplayed(Ad ad) {\n Log.e(TAG, \"Interstitial ad displayed.\");\n }",
"@Override\n public void onInterstitialDisplayed(Ad ad) {\n Log.e(TAG, \"Interstitial ad displayed.\");\n }",
"@Override\n public void onAdOpened() {\n Log.i(\"Ads\", \"xxx WelcomeAd onAdOpened\");\n }",
"@Override\n public void onAdLoaded(Ad ad) {\n interstitialAd.show();\n enableButton();\n }",
"private void ads(View view){\n String ID = \"95b9dd1c47e6407db176bc2398bda2c8323030f814183567\" ;\n\n Appodeal.initialize((Activity)view.getContext(),ID,Appodeal.INTERSTITIAL);\n Appodeal.show((Activity)view.getContext(), Appodeal.INTERSTITIAL);\n Appodeal.isLoaded(Appodeal.INTERSTITIAL);\n\n }",
"@Override\n public void onInterstitialDisplayed(Ad ad) {\n }",
"@Override\n public void onInterstitialDisplayed(Ad ad) {\n }",
"@Override\n public void onAdImpression() {\n Log.d(TAG, \"Ad recorded an impression.\");\n }",
"@Override\n public void onInterstitialDisplayed(Ad ad) {\n Log.e(\"onInterstitialDisplayed\",\"\"+ad);\n }",
"@Override\n public void onAdLoaded(Ad ad) {\n Log.d(TAG, \"Interstitial ad is loaded and ready to be displayed!\");\n // Show the ad\n\n }",
"@Override\n public void onAdLoaded() {\n mButton.setEnabled(true);\n if (mAd.isLoaded()){\n mAd.show();\n }\n\n }",
"private void bannerAds() {\n Log.d(TAG, \"bannerAds invoked\");\n BannerAdView bannerAdView = new BannerAdView(MainActivity.this);\n bannerAdView.loadOnAttach();\n FrameLayout bannerPlaceholder = findViewById(R.id.banner_placeholder);\n bannerPlaceholder.addView(bannerAdView);\n bannerAdView = new BannerAdView(this)\n .withListener(new BannerAdListener() {\n @Override\n public void onAdError(BannerAd ad, String error) {\n // Called when the banner triggered an error\n Log.d(TAG, \"Something went wrong with the request: \" + error);\n }\n\n @Override\n public void onAdLoaded(BannerAd ad) {\n // Called when the banner has been successfully loaded\n Log.d(TAG, \"Banner successfully loaded\");\n\n }\n\n @Override\n public void onAdClicked(BannerAd ad) {\n // Called when the banner was clicked\n Log.d(TAG, \"User clicked on banner\");\n }\n\n @Override\n public void onAdLeftApplication(BannerAd ad) {\n // Called when the banner interaction causes an external application to be open\n Log.d(TAG, \"User directed out of app by banner\");\n }\n });\n }",
"public void simpleEvent() {\n AdGyde.onSimpleEvent(\"SimpleEventID\");\n Toast.makeText(this, \"Simple event clicked\", Toast.LENGTH_SHORT).show();\n }",
"@Override\n\tpublic void onAdDisplay(String arg0) {\n\t\tLog.i(\"AdBannerActivity\", \"onDisplayAd\");\n\t}",
"@Override\n public void onAdLoaded(BannerAd ad) {\n Log.d(TAG, \"Banner successfully loaded\");\n\n }",
"@Override\n public void onAdLoaded(AppOpenAd ad) {\n Log.d(TAG, \"Ad was loaded.\");\n appOpenAd = ad;\n isLoadingAd = false;\n\n setAppOpenEvents();\n\n KrollDict sCallback = new KrollDict();\n\n if (hasListeners(AdmobModule.AD_LOADED)) {\n fireEvent(AdmobModule.AD_LOADED, sCallback);\n }\n\n // DEPRECATED\n if (hasListeners(AdmobModule.AD_RECEIVED)) {\n org.appcelerator.kroll.common.Log.w(TAG, \"AD_RECEIVED has been deprecated and should be replaced by AD_LOADED\");\n fireEvent(AdmobModule.AD_RECEIVED, sCallback);\n }\n }",
"@Override\n\tprotected void OnClick() {\n\t\t\n\t}",
"@Override\n\tpublic void onClick(ClickEvent arg0) {\n\t\t\n\t}",
"@Override\n public void onItemClick(View view, Campaign campaign) {\n\n }",
"@Override\n public void onClick(View v) {\n ArticleUtil.launchDetailActivity(mContext, bean.getAid(), bean.getSid(), bean.getAl(), false, bean);\n GoogleAnalyticsTracker.setGoogleAnalyticsEvent(mContext, \"Related Article\", \"Related article: Article Clicked\", \"Article detail page\");\n FlurryAgent.logEvent(\"Related Article: \" + \"Article Clicked\");\n }",
"@Override\n\t\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t\tmCurriculumVitaeInterface.onAddAwards();\n\t\t\t\t\t}",
"@Override\n\t\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t\tmCurriculumVitaeInterface.onAddAwards();\n\t\t\t\t\t}",
"void issuedClick(String item);",
"@Override\n public void onAdLoaded() {\n Log.i(\"Ads\", \"xxx WelcomeAd onAdLoaded\");\n }",
"@Override\n public void onAdLoaded(Ad ad) {\n Log.d(TAG, \"Interstitial ad is loaded and ready to be displayed!\");\n // Show the ad\n// interstitialAd.show();\n }",
"@Override\n public void onAdLoaded(Ad ad) {\n }",
"@Override\n public void onAdLoaded() {\n Log.i(\"Ads\", \"onAdLoaded\");\n }",
"@Override\n public void onAdLoaded() {\n Log.i(\"Ads\", \"onAdLoaded\");\n }",
"@Override\n public void onAdLoaded() {\n Log.i(\"Ads\", \"onAdLoaded\");\n }",
"public void onClick(View arg0) {\r\n\t\t\t\t}",
"@Override\n public void onAdLoaded(Ad ad) {\n }",
"public void onClick(View arg0) {\n\t\t\t\t\n\t\t\t}",
"private void OnClick(){\n onWidgetClickListener.onClick(getViewId());\n }",
"@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\n\t\t\t}",
"@Override\n public void onClick(View v) {\n\n if(!dateStr.equalsIgnoreCase(\"Not set\")) {\n if (mInterstitialAd.isLoaded()) {\n mInterstitialAd.show();\n } else {\n showDetails();\n }\n\n }else{\n showDialog(MainActivity.this, getString(R.string.error_title), getString(R.string.error_text));\n }\n\n }",
"void onClick(Address addr);",
"@Override\n public void onAdLoaded() {\n }",
"@Override\n public void onAdLoaded() {\n }",
"@Override\n public void onAdLoaded() {\n }",
"@Override\n public void onAdLoaded() {\n }",
"@Override\n public void onAdLoaded() {\n }",
"@Override\n public void onAdLoaded() {\n }"
] | [
"0.8257777",
"0.8257777",
"0.82576305",
"0.8239794",
"0.8229377",
"0.7977129",
"0.7972096",
"0.79458547",
"0.7907658",
"0.79013443",
"0.7847889",
"0.75544065",
"0.74914664",
"0.6922352",
"0.69017684",
"0.68146175",
"0.6796534",
"0.67813796",
"0.6759583",
"0.6753615",
"0.6753615",
"0.67494833",
"0.65157986",
"0.64515823",
"0.64149183",
"0.64149183",
"0.64149183",
"0.64149183",
"0.64149183",
"0.64149183",
"0.64149183",
"0.64149183",
"0.64149183",
"0.64149183",
"0.64149183",
"0.64149183",
"0.6401255",
"0.6392834",
"0.6391603",
"0.6391275",
"0.63893664",
"0.63893664",
"0.63864684",
"0.6386369",
"0.63800335",
"0.6378403",
"0.6369722",
"0.6369722",
"0.6369722",
"0.6358511",
"0.6350158",
"0.6350158",
"0.6350158",
"0.629919",
"0.6299121",
"0.6294249",
"0.628632",
"0.628632",
"0.62719405",
"0.6259404",
"0.6238706",
"0.6210144",
"0.61783755",
"0.61633086",
"0.61430305",
"0.6136169",
"0.61152416",
"0.6110506",
"0.60906154",
"0.6082478",
"0.6047249",
"0.6042034",
"0.6042034",
"0.6029251",
"0.6021474",
"0.6019888",
"0.60170734",
"0.60118836",
"0.60118836",
"0.60097355",
"0.6005982",
"0.5995079",
"0.59918284",
"0.5991816",
"0.5990692",
"0.5990148",
"0.5988397",
"0.5980814",
"0.5980814",
"0.5980814",
"0.5980814",
"0.5980814",
"0.5980814"
] | 0.7977144 | 12 |
Code to be executed when the user has left the app. | @Override
public void onAdLeftApplication() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void onLeaveApplication(Ad arg0) {\n\t\t\r\n\t}",
"public void onLeave()\n\t{\n\t}",
"private void userDidLeave() {\n DeviceSingleton deviceSingleton = DeviceSingleton.getInstance();\n deviceSingleton.setImInARoom(false);\n deviceSingleton.setJoinedChat(false);\n\n SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);\n SharedPreferences.Editor editor = prefs.edit();\n editor.putBoolean(\"savedJoinedChat\", false);\n editor.commit();\n Intent intent2 = new Intent(ShowMapActivity.this, LoginActivity.class);\n startActivity(intent2);\n// break;\n\n }",
"public void onUserLeaveHint() {\n\t\tsuper.onUserLeaveHint();\n\t\tfinish();\n\t}",
"private void onLost() {\n // TODO: broadcast\n }",
"@Override\n public void onAdLeftApplication(BannerAd ad) {\n Log.d(TAG, \"User directed out of app by banner\");\n }",
"@Override\n public void onAdLeftApplication() {\n }",
"@Override\r\n public void leftSystem() {\n }",
"@Override\r\n\tprotected void onPause() {\n\t\tif (SystemCheckTools.isApplicationSentToBackground(AppStartToMainActivity.this) == true) {\r\n\t\t\tExitApp.getInstance().exit();\r\n\t\t}\r\n\t\tsuper.onPause();\r\n\t}",
"@Override\r\n\tpublic void leave() {\n\t\t\r\n\t}",
"@Override\n public void onAdLeftApplication() {\n }",
"@Override\n public void onAdLeftApplication() {\n }",
"@Override\n public void onAdLeftApplication() {\n }",
"private void handleLose(){\n\t ButtonType goBackBtn = new ButtonType(\"Go back to menu\");\n\t Alert alert = new Alert(Alert.AlertType.INFORMATION,\n \"You've lost the game, retry?\", ButtonType.YES, goBackBtn);\n\t alert.setTitle(\"Lost\");\n Optional<ButtonType> result = alert.showAndWait();\n if(!result.isPresent())\n return;\n if(result.get() == ButtonType.YES){\n Screen screen = new Screen(stage, \"Dungeon\", \"View/DungeonPlayScreen.fxml\");\n try {\n Map reloadedMap = Map.loadFromFile(new FileInputStream(\n \"map/\" + map.getMapName() + \".dungeon\"));\n screen.display(new DungeonPlayController(stage, reloadedMap));\n } catch (FileNotFoundException e){\n e.printStackTrace();\n }\n }\n if(result.get() == goBackBtn){\n handleModeScreenButton();\n }\n }",
"@Override\r\n public void onAdLeftApplication() {\n }",
"public void onStateLeft();",
"public void exitApp() {\n\t\tSystem.out.println(\"Exiting PhoneBook\");\n\n\t}",
"@Override\n protected void onUserLeaveHint() {\n super.onUserLeaveHint();\n notification.showNotification();\n moveTaskToBack(true);\n }",
"@Override\n protected void onUserLeaveHint() {\n super.onUserLeaveHint();\n notification.showNotification();\n moveTaskToBack(true);\n }",
"static void playerLost() {\n\n\t\tSystem.exit(0); // This code ends the program\n\t}",
"void gameResumed();",
"@Override\n public void onPause() {\n AppEventsLogger.deactivateApp(this);\n isResumed = false;\n\n super.onPause();\n uiHelper.onPause();\n }",
"public void onActive() {\n Methods.showMessage(\"Warning\", \"Welcome Back!\", \"Please Continue Filling Out Your Questionanire!\");\n }",
"@Override\n public void onAdLeftApplication() {\n }",
"@Override\n public void onTerminate() {\n Log.i(\"Application\", \"application destory\");\n if (MySocket.getInstance().getConnected()) {\n MySocket.getInstance().stop();\n DataManager manager = DataManager.getInstance();\n manager.setSceneList(manager.getSceneList());\n manager.setEquipmentList(manager.getEquipmentList());\n for (Record record : manager.getCurrentRecords()) {\n if (record.getValues().size() == 0) {\n continue;\n }\n record.setEndTime(new Date());\n manager.addToEquipmentRecordsList(record.getId(), record.clone());\n }\n Log.i(\"Home\", \"destory\");\n Process.killProcess(Process.myPid());\n }\n super.onTerminate();\n }",
"public void onBackPresed() {\n\t\t\tandroid.os.Process.killProcess(android.os.Process.myPid());\n\t\t\t\n\n\t}",
"@OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)\n public void onAppDestroyed() {\n Log.i(\"AppLifecycleListener\", \"onAppDestroyed\");\n }",
"default void appWillBeClosed(boolean isRestart) {\n }",
"private void onRemoteUserLeft() {\n removeRemoteVideo();\n }",
"public void onUnload() {\n\t}",
"@Override\n\tpublic void onUserResumed(String arg0, boolean arg1, String arg2) {\n\t\t\n\t}",
"public void leaveGame() {\n if (gameId != null) {\n logger.info(\"Left game: \" + gameId.toString());\n if (connectionHandler != null) connectionHandler.getMessageEmitter().sendLeaveGameMessage(gameId);\n else logger.warn(\"MessageEmitter is null in leaveGame()!\");\n } else logger.warn(\"GameId is null in leaveGame()!\");\n reset();\n }",
"@Override\n public void onAdLeftApplication() {\n Log.i(\"Ads\", \"onAdLeftApplication\");\n }",
"@Override\n public void onAdLeftApplication() {\n Log.i(\"Ads\", \"onAdLeftApplication\");\n }",
"public void onExit();",
"@Override\n public void onExitAmbient() {\n\n Toast.makeText(getApplicationContext(), \"Exit\", Toast.LENGTH_LONG).show();\n }",
"@Override\n public void onAdLeftApplication() {\n Log.i(\"Ads\", \"onAdLeftApplication\");\n }",
"public void resign(){\n\t\tif(Main.getInstance().getScreen() instanceof GEngine){\r\n\t\t\tPlayer user = getUserPlayer();\r\n\t\t\tPlayer winner = state.players[user.playerId == 0 ? 1 : 0];\r\n\t\t\t\r\n\t\t\tnew Popup(\"Game over\", true,\r\n\t\t\t\tnew Label(String.format(\"Player %s has won the game!\", winner.getDisplayName()), Assets.SKIN), \r\n\t\t\t\tComponentFactory.createButton(\"OK\", new ClickListener() {\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic void clicked(InputEvent event, float x, float y) {\r\n\t\t\t\t\t\tMain.getInstance().setScreen(MainMenu.getInstance());\r\n\t\t\t\t\t\tPopup.getCurrentPopup().close();\r\n\t\t\t\t\t}\r\n\t\t\t\t})).show();\r\n\t\t}\r\n\t\t\r\n\t\tMain.getInstance().games.endGame(this);\r\n\t}",
"void onExit();",
"public void onOK() {\n\t\t\t\t\t\t\tlogout();\n\t\t\t\t\t\t}",
"void leave();",
"void leave();",
"void leave();",
"public void leave() {\n OffRequestManager.instance().removeOffRequestListener(instance);\n OnRequestManager.instance().removeOnRequestListener(instance);\n ParkRequestManager.instance().removeParkListener(instance);\n }",
"@Override\n public void onDeactivate() {\n }",
"private void exitApplication() {\n\t\tBPCC_Logger.logInfoMessage(classNameForLogger, logMessage_applicationFrameClosed);\r\n\t\tSystem.exit(0);\r\n\t}",
"public void lifeLost() {\n\t\t--lives;\n\t\tif (lives == 0) {\n\t\t\tSystem.exit(0);\n\t\t}\n\t}",
"public void onDisconnected() {\n\t\t\r\n\t}",
"public int onLeave( int dir )\n {\n return OK;\n }",
"public void onLeftUp();",
"protected void onAppsChanged() {\n\t\t\n\t}",
"@Override\n\t\t\t\t\tpublic void windowClosed(WindowEvent e) {\n\t\t\t\t\t\tsetStillRunning(false);\n\t\t\t\t\t}",
"@Override\n public void onAdLeftApplication() {\n Log.d(\"TAG\",\"Adleftapplication\");\n }",
"void onDisconnected();",
"public void interactWhenLeaving() {\r\n\t\t\r\n\t}",
"@Override\n\tprotected void onShutdown(ApplicationEvent event) {\n\t\t\n\t}",
"public void onBackPressed() {\n // do nothing. We want to force user to stay in this activity and not drop out.\n }",
"public void onIdle() {\n Methods.showMessage(\"Warning\", \"No User Action for the Last 5 Minutes!\", \"Do You Need More Time?\");\n }",
"public void onExit() {\n Intent homeIntent = new Intent(Intent.ACTION_MAIN);\n homeIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n homeIntent.addCategory(Intent.CATEGORY_HOME);\n startActivity(homeIntent);\n finish();\n }",
"public abstract void onLostGame();",
"protected void destroyApp(boolean arg0) throws MIDletStateChangeException {\n\r\n\t}",
"@Override\n public void onLeftUser(WebkeyVisitor webkeyVisitor) {\n stopImageSenderStream();\n mContext.unregisterComponentCallbacks(this);\n }",
"private void handleAppStart() {\n Trace.traceBegin(8, \"appStart:closeZswapd\");\n removeMessagesToStart();\n curState = 1;\n Message msg = handler.obtainMessage();\n msg.what = 3;\n Slog.i(TAG, \"handle app start, stop zswapd.\");\n closeZswapd();\n handler.sendMessageDelayed(msg, (long) (appStartDelay * 1000));\n Trace.traceEnd(8);\n }",
"@Override\n protected void appStop() {\n }",
"@Override\n public void windowClosing(WindowEvent e)\n {\n gui.exitApp();\n }",
"void notifyGameRestored();",
"void lose() {\n System.out.println(\"You have lost the game!!!\" + \"\\n\" + \"You spend: \" + Time.getSecondsPassed() + \" seconds playing the game!\");\n System.exit(0);\n\n }",
"public void lose() {\n displayErrorMessage(\"You Lose!\");\n if(controller.aiGame && !controller.loggedIn()){\n controller.switchToLogin();\n } else\n controller.switchToLobby();\n }",
"@Override\n public void onBackPressed() {\n super.onBackPressed();\n socket.emit(\"user_disconnected\",\"\");\n }",
"@Override\n public void onPeerLeft(Room room, List<String> strings) {\n if (!mPlaying && shouldCancelGame(room)) {\n if (timer!= null)\n timer.cancel();\n if (mRoomId != null)\n Games.RealTimeMultiplayer.leave(getApiClient(), this, mRoomId);\n getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);\n if (!dialogShown)\n finish();\n }\n }",
"public void onPause() {\n MainTask.GetInstance().SetUserCallBack((UserCallBack) null);\n super.onPause();\n Log.d(TAG, \"-----onPause-----\");\n }",
"public void onDestroy() {\n if (getIntent() != null && getIntent().getBooleanExtra(Constants.EXTRA_FROM_MAINACTIVITY, false)) {\n MainActivity.gotoMainActivity(this);\n }\n super.onDestroy();\n }",
"@Override\n\tpublic void onUserLeftLobby(LobbyData arg0, String arg1) {\n\t\t\n\t}",
"@Override\n\tpublic void onDeactivate() {\n\t}",
"public void executeLeftGame() {\r\n //COME BACK TO THIS\r\n }",
"@Override\n\tpublic void onExit() {\n\t\t\n\t}",
"public void leaveChannel() {\n mRtcEngine.leaveChannel();\n appointment.removeOfCall(new DatabaseUser(MainUser.getMainUser().getId()));\n }",
"public void onUninstalled() {\n }",
"public void onLogout() {\n ParseUser.logOut();\n\n promptForLogin();\n }",
"@Override\r\n\tpublic void onCloseApplication() {\n\t}",
"void leave(User user);",
"public void onDisconnected() {\n\n }",
"public void onDisconnected() {\n\n }",
"public void user_lost() {\n\tresetExpComp();\r\n }",
"@Override\n\tpublic void onDisconnected() {\n\t\t\n\t}",
"@Override\n\tpublic void onDisconnected() {\n\t\t\n\t}"
] | [
"0.74342304",
"0.7096355",
"0.6900877",
"0.6877666",
"0.67685103",
"0.6690852",
"0.6677258",
"0.6610862",
"0.6512196",
"0.65119964",
"0.65039283",
"0.65039283",
"0.65039283",
"0.6502804",
"0.64663637",
"0.642442",
"0.6390627",
"0.6386039",
"0.6386039",
"0.6377675",
"0.63728994",
"0.6360025",
"0.63583785",
"0.63200897",
"0.6252978",
"0.6246637",
"0.62047124",
"0.61984265",
"0.6196328",
"0.6184955",
"0.6183397",
"0.61741424",
"0.61652786",
"0.61652786",
"0.6132901",
"0.6091634",
"0.6084397",
"0.60841507",
"0.60811",
"0.607476",
"0.6057405",
"0.6057405",
"0.6057405",
"0.6056078",
"0.6041627",
"0.6040203",
"0.6039809",
"0.60275084",
"0.601847",
"0.6017552",
"0.60040075",
"0.6000299",
"0.59978855",
"0.5993899",
"0.59934515",
"0.5986036",
"0.5980663",
"0.59782964",
"0.5974076",
"0.5972564",
"0.5954508",
"0.594919",
"0.59477043",
"0.59438545",
"0.59437746",
"0.5943028",
"0.594151",
"0.5940667",
"0.59388447",
"0.5932213",
"0.592108",
"0.5920985",
"0.5917728",
"0.5904944",
"0.5896279",
"0.5893148",
"0.58836514",
"0.5877597",
"0.58723456",
"0.5870812",
"0.5870625",
"0.58668554",
"0.58668554",
"0.58640957",
"0.5863976",
"0.5863976"
] | 0.6583283 | 21 |
Code to be executed when the user is about to return to the app after tapping on an ad. | @Override
public void onAdClosed() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void onAdLeftApplication(BannerAd ad) {\n Log.d(TAG, \"User directed out of app by banner\");\n }",
"@Override\n public void onBackPressed() {\n /*startAppAd.onBackPressed();\n super.onBackPressed();*/\n\n if(blnExit)\n {\n super.onBackPressed();\n return;\n }\n this.blnExit = true;\n // startAppAd.onBackPressed();\n\n\n Toast.makeText(ActHome.this,\"Please click BACK again to EXIT.\",Toast.LENGTH_SHORT).show();\n new Handler().postDelayed(new Runnable() {\n @Override\n public void run() {\n blnExit = false;\n }\n },2000);\n }",
"@Override\n public void onAdClosed() {\n finish();\n }",
"@Override\n public void onAdClosed() {\n Intent intent=new Intent(UpdateActivity.this,PurchaseActivity.class);\n startActivity(intent);\n }",
"@Override\n public void onAdLeftApplication() {\n }",
"@Override\n public void onAdLeftApplication() {\n }",
"@Override\n public void onAdLeftApplication() {\n }",
"@Override\n public void onAdClosed() {\n Log.i(\"Ads\", \"xxx WelcomeAd onAdClosed\");\n }",
"@Override\n public void onAdLeftApplication() {\n }",
"@Override\n public void onAdLeftApplication() {\n }",
"@Override\n public void onAdLeftApplication() {\n }",
"@Override\n public void onAdLeftApplication() {\n }",
"@Override\n public void onAdLeftApplication() {\n }",
"@Override\n public void onAdLeftApplication() {\n }",
"@Override\n public void onAdLeftApplication() {\n }",
"@Override\n public void onAdLeftApplication() {\n }",
"@Override\n public void onAdLeftApplication() {\n }",
"@Override\n public void onAdLeftApplication() {\n }",
"@Override\n public void onAdLeftApplication() {\n }",
"@Override\n public void onAdLeftApplication() {\n }",
"@Override\n public void onAdLeftApplication() {\n }",
"@Override\n public void onAdLeftApplication() {\n }",
"@Override\n public void onAdLeftApplication() {\n }",
"@Override\n public void onAdClosed() {\n Intent intent1 = new Intent(Home.this, RoomIdPassActivity.class);\n startActivity(intent1);\n mInterstitialAd1.loadAd(new AdRequest.Builder().build());\n }",
"@Override\n public void onAdLeftApplication() {\n }",
"@Override\r\n public void onAdClosed() {\n super.onAdClosed();\r\n finish();\r\n }",
"@Override\n public void onAdClicked() {\n Log.d(TAG, \"Ad was clicked.\");\n if (hasListeners(AdmobModule.AD_CLICKED)) {\n fireEvent(AdmobModule.AD_CLICKED, new KrollDict());\n }\n }",
"@Override\n public void onAdLeftApplication() {\n }",
"@Override\n public void onAdLeftApplication() {\n Log.d(\"TAG\",\"Adleftapplication\");\n }",
"@Override\r\n\tpublic void onLeaveApplication(Ad arg0) {\n\t\t\r\n\t}",
"@Override\r\n public void onAdLeftApplication() {\n }",
"public void onAdClosed() {\n\t\t\t}",
"@Override\n public void onAdClosed() {\n }",
"@Override\n public void onAdClosed() {\n }",
"@Override\r\n\tpublic void onDismissScreen(Ad arg0) {\n\t\t\r\n\t}",
"@Override\n public void onAdClosed() {\n Log.i(\"Ads\", \"onAdClosed\");\n }",
"@Override\n public void onAdClosed() {\n Log.i(\"Ads\", \"onAdClosed\");\n }",
"@Override\n public void onAdClosed() {\n Log.i(\"Ads\", \"onAdClosed\");\n }",
"@Override\n public void onAdClosed() {\n startActivity(new Intent(MainActivity.this,new InterstitialActivity().getClass()));\n mInterstitialAd.loadAd(new AdRequest.Builder().build());\n }",
"@Override\n public void onAdClosed() {\n Log.i(\"Ads\", \"xxx Banner onAdClosed\");\n }",
"@Override\n public void onAdLoaded(AppOpenAd ad) {\n Log.d(TAG, \"Ad was loaded.\");\n appOpenAd = ad;\n isLoadingAd = false;\n\n setAppOpenEvents();\n\n KrollDict sCallback = new KrollDict();\n\n if (hasListeners(AdmobModule.AD_LOADED)) {\n fireEvent(AdmobModule.AD_LOADED, sCallback);\n }\n\n // DEPRECATED\n if (hasListeners(AdmobModule.AD_RECEIVED)) {\n org.appcelerator.kroll.common.Log.w(TAG, \"AD_RECEIVED has been deprecated and should be replaced by AD_LOADED\");\n fireEvent(AdmobModule.AD_RECEIVED, sCallback);\n }\n }",
"@Override\n public void onAdClicked(BannerAd ad) {\n Log.d(TAG, \"User clicked on banner\");\n }",
"@Override\n public void onPause() {\n super.onPause();\n startAppAd.onPause();\n }",
"@Override\n public void onAdLeftApplication() {\n Log.i(\"Ads\", \"onAdLeftApplication\");\n }",
"@Override\n public void onAdLeftApplication() {\n Log.i(\"Ads\", \"onAdLeftApplication\");\n }",
"@Override\n public void onAdLeftApplication() {\n Log.i(\"Ads\", \"onAdLeftApplication\");\n }",
"@Override\r\n\t\t\tpublic void onAdClose() {\n\t\t\t\t\r\n\t\t\t}",
"@Override\n public void onAdLeftApplication() {\n Log.i(\"Ads\", \"xxx Banner onAdLeftApplication\");\n }",
"@Override\n public void onAdClosed() {\n Toast.makeText(Apply3Activity.this,\"Ad closed\",Toast.LENGTH_SHORT).show();\n Log.d(\"TAG\",\"Ad Closed\");\n }",
"@Override\n public void onAdLeftApplication() {\n Log.i(\"Ads\", \"xxx WelcomeAd onAdLeftApplication\");\n }",
"@Override\n public void onAdClosed() {\n mAdView.loadAd(adRequest);\n }",
"@Override\r\n public void onBackPressed() {\r\n \t// Handle the back button click event such that if user \r\n \t// is performing an IMCI or CCM assessment then a confirmation dialog \r\n \t// will be displayed to confirm that the user wishes to exit the \r\n \t// patient assessment\r\n \texitAssessmentDialogHandler();\r\n }",
"@Override\n public void onAdClosed() {\n TastyToast.makeText(getApplicationContext(), \"Disfruta tu Episodio\", TastyToast.LENGTH_LONG, TastyToast.INFO);\n go2ChooseServer();\n }",
"@Override\n public void onAdClicked() {\n }",
"@Override\n public void onAdClicked() {\n }",
"@Override\n public void onAdClicked() {\n }",
"@Override\n public void onAdClicked() {\n }",
"@Override\n public void onAdClicked() {\n }",
"@Override\n public void onAdClicked() {\n }",
"@Override\n public void onAdClicked() {\n }",
"@Override\n public void onAdClicked() {\n }",
"@Override\n public void onAdClicked() {\n }",
"@Override\n public void onAdClicked() {\n Toast.makeText(Apply3Activity.this,\"Logged in SuccessFully\",Toast.LENGTH_SHORT).show();\n Log.d(\"TAG\",\"Ad clicked\");\n }",
"@Override\r\n public void onAdClicked() {\n }",
"@Override\r\n\t\t\tpublic void onAdClick() {\n\t\t\t\t\r\n\t\t\t}",
"@Override\n public void onAdDismissedFullScreenContent() {\n Log.d(\"TAG\", \"The ad was dismissed.\");\n }",
"@Override\n public void onAdDismissedFullScreenContent() {\n Log.d(TAG, \"Ad dismissed fullscreen content.\");\n appOpenAd = null;\n isShowingAd = false;\n\n if (hasListeners(AdmobModule.AD_CLOSED)) {\n fireEvent(AdmobModule.AD_CLOSED, new KrollDict());\n }\n\n // load();\n }",
"@Override\n public void onInterstitialDismissed(Ad ad) {\n if (i == 1) {\n Intent intent = new Intent(AdSpaceActivity.this, MainActivity.class);\n startActivity(intent);\n finish();\n }else if (i == 2){\n Intent intent = new Intent(AdSpaceActivity.this, BlogActivity.class);\n startActivity(intent);\n finish();\n }else if (i == 3){\n Intent intent = new Intent(AdSpaceActivity.this, WebsiteActivity.class);\n startActivity(intent);\n finish();\n }\n }",
"@Override\n public void onInterstitialDisplayed(Ad ad) {\n Log.e(TAG, \"Interstitial ad displayed.\");\n // pd.cancel();\n // showDialog(\"Success!\", \"Adfly earning has been activated successfully. You will see Adfly ads when you click links in articles.\");\n }",
"@Override\n public void onAdClosed() {\n vInterstitialAdEntertainingFactActivity.loadAd(new AdRequest.Builder().build());\n }",
"@Override\n public void onAdClicked(Ad ad) {\n }",
"public void mo1636a() {\n if (this.f9849a.f9856g != null) {\n this.f9849a.f9856g.onAdClicked(this.f9849a);\n }\n }",
"@Override\n public void onAdClosed(final String target) {\n this.cordova.getActivity().runOnUiThread(new Runnable() {\n @Override\n public void run() {\n String event = \"javascript:cordova.fireDocumentEvent('onAdClosed', {'zone':'\"+target+\"'})\";\n webView.loadUrl(event);\n }\n });\n }",
"@Override\n protected void onPause() {\n super.onPause();\n MobclickAgent.onPageEnd(\"ACGwenDangActivity\");\n MobclickAgent.onPause(this);\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\r\n\tpublic void onAdClick() {\n\r\n\t}",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }",
"@Override\n public void onAdOpened() {\n }"
] | [
"0.7181162",
"0.6675511",
"0.6667841",
"0.6647972",
"0.6594055",
"0.6594055",
"0.6594055",
"0.6593624",
"0.6593246",
"0.6593246",
"0.6593246",
"0.6593246",
"0.6593246",
"0.6593246",
"0.6593246",
"0.6593246",
"0.6593246",
"0.6593246",
"0.6593246",
"0.6593246",
"0.6593246",
"0.6593246",
"0.6593246",
"0.65882266",
"0.6580529",
"0.6563651",
"0.6560564",
"0.6555693",
"0.6542159",
"0.65218407",
"0.6519343",
"0.6467965",
"0.6426753",
"0.6418254",
"0.6407705",
"0.6397627",
"0.6397627",
"0.63895386",
"0.6361356",
"0.63576025",
"0.63520586",
"0.6339704",
"0.6320907",
"0.6311491",
"0.6311491",
"0.6310107",
"0.62958515",
"0.6270569",
"0.62368095",
"0.62263066",
"0.6224689",
"0.6215805",
"0.6159611",
"0.6157523",
"0.6144506",
"0.6144506",
"0.6144506",
"0.6144506",
"0.6144506",
"0.6144506",
"0.6144506",
"0.6144506",
"0.6129556",
"0.6114192",
"0.6101401",
"0.61003643",
"0.6087621",
"0.6084463",
"0.60838723",
"0.6080746",
"0.6002493",
"0.5957557",
"0.5932453",
"0.59208035",
"0.59076226",
"0.5901616",
"0.58968323",
"0.58968323",
"0.58968323",
"0.5887362",
"0.5887362",
"0.5887362",
"0.5887362",
"0.5887362",
"0.5887362",
"0.5887362",
"0.5887362",
"0.5887362",
"0.5887362",
"0.5887362",
"0.5887362"
] | 0.64159405 | 41 |
Created by Administrator on 2017/9/5. | public interface MediaMapper {
List<MediaUtil> selectMediaReportCount(MediaUtil mediaUtil);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private stendhal() {\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"private static void cajas() {\n\t\t\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"@Override\n public void memoria() {\n \n }",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"public void mo38117a() {\n }",
"public final void mo51373a() {\n }",
"public void mo4359a() {\n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"private Rekenhulp()\n\t{\n\t}",
"@Override\n public void settings() {\n // TODO Auto-generated method stub\n \n }",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\n public void init() {\n\n }",
"Petunia() {\r\n\t\t}",
"public contrustor(){\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"private TMCourse() {\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\n\tpublic void create () {\n\n\t}",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"public Pitonyak_09_02() {\r\n }",
"public void designBasement() {\n\t\t\r\n\t}",
"private void init() {\n\n\t}",
"@Override\n\tpublic void create() {\n\t\t\n\t}",
"public void mo55254a() {\n }",
"protected MetadataUGWD() {/* intentionally empty block */}",
"public void mo6081a() {\n }",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\n void init() {\n }",
"public void autoDetails() {\n\t\t\r\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"public void verarbeite() {\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n public void init() {\n }",
"private void poetries() {\n\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"public void create() {\n\t\t\n\t}",
"private UsineJoueur() {}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\n\t}",
"private Singletion3() {}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\n\tpublic void create() {\n\n\t}",
"public void mo12930a() {\n }",
"@Override\n\tpublic void afterInit() {\n\t\t\n\t}",
"@Override\n\tpublic void afterInit() {\n\t\t\n\t}",
"@SuppressWarnings(\"unused\")\n\tprivate void version() {\n\n\t}",
"@Override\r\n\tpublic void create() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}"
] | [
"0.62633514",
"0.6139725",
"0.5884613",
"0.5870621",
"0.5846664",
"0.5832992",
"0.5819169",
"0.5766528",
"0.5761951",
"0.575422",
"0.575422",
"0.57422554",
"0.57422537",
"0.57422537",
"0.57251835",
"0.5719461",
"0.5673361",
"0.5673163",
"0.5672905",
"0.5672217",
"0.5666823",
"0.5665643",
"0.56469387",
"0.5638544",
"0.5606977",
"0.55987465",
"0.5583558",
"0.5573347",
"0.5566272",
"0.55638397",
"0.55491734",
"0.55401284",
"0.55401284",
"0.55401284",
"0.55401284",
"0.55401284",
"0.55401284",
"0.55401284",
"0.5513024",
"0.5502097",
"0.5500741",
"0.5499979",
"0.5499979",
"0.5499979",
"0.5499979",
"0.5499979",
"0.5499979",
"0.5493784",
"0.5482536",
"0.5471514",
"0.5461511",
"0.54609096",
"0.5457062",
"0.54570186",
"0.54558396",
"0.5443256",
"0.54404336",
"0.5437181",
"0.5436911",
"0.5435577",
"0.54241973",
"0.5422778",
"0.5416654",
"0.5408048",
"0.54033023",
"0.5403147",
"0.54025155",
"0.5402458",
"0.5402434",
"0.5402227",
"0.5402227",
"0.53943706",
"0.53943706",
"0.53943706",
"0.53943706",
"0.53943706",
"0.53909004",
"0.5382104",
"0.5378533",
"0.53750265",
"0.53713626",
"0.5369738",
"0.5369738",
"0.536723",
"0.53622985",
"0.5356394",
"0.5356394",
"0.5356394",
"0.53511906",
"0.53511804",
"0.5341839",
"0.53345025",
"0.53345025",
"0.5332899",
"0.5331839",
"0.5331543",
"0.5331543",
"0.5331543",
"0.5326014",
"0.5326014",
"0.5326014"
] | 0.0 | -1 |
/ Envoie sous la forme d'un string les 4couleurs | String getMessage()
{
String message = "";
for(int i =0;i<4;i++)
{
message = message + String.valueOf(listePeg[i].getColor());
}
return message;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n public String AggiungiQualcosa() {\r\n// ritorna una stringa\r\n// perché qui ho informazioni in più\r\n return \"\\ne capace di cuocere il pollo\";\r\n }",
"private void createString(){\n for(int i=0;i<this.textPalindrome.length;i++){\n this.joinedTextPalindrome=this.joinedTextPalindrome.concat(this.textPalindrome[i]);\n }\n }",
"@Override\r\n public String AggiungiQualcosa() {\r\n// ritorna una stringa\r\n// perché qui ho informazioni in più\r\n return \"\\ne capace di friggere un uovo\";\r\n }",
"@Override\r\n\tpublic String desencriptar(String string) {\n\r\n\t\tString palabra = string;\r\n\t\tString[] parts = string.split(\",\");\r\n String newName=\"\";\r\n for (int i = 0; i < parts.length; i++) {\r\n // instrucción switch con tipo de datos int\r\n switch (parts[i]) \r\n {\r\n case \"1\" : newName+=\"a\";\r\n break;\r\n case \"2\" : newName+=\"b\";\r\n break;\r\n case \"3\" : newName+=\"c\";\r\n break;\r\n case \"4\" : newName+=\"d\";\r\n break;\r\n case \"5\" : newName+=\"e\";\r\n break;\r\n case \"6\" : newName+=\"f\";\r\n break;\r\n case \"7\" : newName+=\"g\";\r\n break;\r\n case \"8\" : newName+=\"h\";\r\n break;\r\n case \"9\" : newName+=\"i\";\r\n break;\r\n case \"10\" : newName+=\"j\";\r\n break;\r\n case \"11\" : newName+=\"k\";\r\n break;\r\n case \"12\" : newName+=\"l\";\r\n break;\r\n case \"13\" : newName+=\"m\";\r\n break;\r\n case \"14\" : newName+=\"n\";\r\n break;\r\n case \"15\" : newName+=\"ñ\";\r\n break;\r\n case \"16\" : newName+=\"o\";\r\n break;\r\n case \"17\" : newName+=\"p\";\r\n break;\r\n case \"18\" : newName+=\"q\";\r\n break;\r\n case \"19\" : newName+=\"r\";\r\n break;\r\n case \"20\" : newName+=\"s\";\r\n break;\r\n case \"21\" : newName+=\"t\";\r\n break;\r\n case \"22\" : newName+=\"u\";\r\n break;\r\n case \"23\" : newName+=\"v\";\r\n break;\r\n case \"24\" : newName+=\"w\";\r\n break;\r\n case \"25\" : newName+=\"x\";\r\n break;\r\n case \"26\" : newName+=\"y\";\r\n break;\r\n case \"27\" : newName+=\"z\";\r\n break;\r\n case \"0\" : newName+=\" \";\r\n break;\r\n case \"28\" : newName+=\" \";\r\n break;\r\n \r\n \r\n }\r\n \r\n }\r\n \r\n return newName ;\r\n\t}",
"@Override\n public String comer(String c)\n {\n c=\"Gato No puede Comer Nada\" ;\n \n return c;\n }",
"public void generarCodigo(){\r\n this.setCodigo(\"c\"+this.getNombre().substring(0,3));\r\n }",
"private String e19BuildStaffGageString(String s) {\n String tmp1 = null;\n if ((s != null) && (s.length() > 0)) {\n tmp1 = String.format(\"%c%s-%c\", SEP_CHAR, s, SEP_CHAR);\n } else {\n tmp1 = String.format(\"%c-----%c\", SEP_CHAR, SEP_CHAR);\n }\n\n return tmp1;\n }",
"public static void main(String[] args) {\n char[] cadeiaCaracter = {'B','E','N','G','I','L'};\n String cadeiaChar = new String(cadeiaCaracter);\n System.out.println(cadeiaChar);\n //Criar string a partir de intervalo de cadeias de caractere\n char[] abcdef = {'A','B','C','D','E','F'};\n String abc = new String(abcdef, 0,3);\n System.out.println(abc);\n //Array de byte, cada byte representa um caractere da tabela ascii\n byte[] ascii = {65,66,67,68,69};\n String abcde = new String(ascii);\n System.out.println(abcde);\n String cde = new String(ascii,1,3);\n System.out.println(cde);\n //Atribuição sem o new\n String let = \"Letícia\";\n String lettis = \"Letícia\";\n System.out.println(let);\n }",
"public final String deu() {\n String str;\n AppMethodBeat.i(26738);\n String str2 = \"\";\n synchronized (this) {\n try {\n if (this.iPr == null || this.iPr.size() <= 0) {\n str = \"\";\n } else {\n int i = 0;\n while (i < this.iPr.size()) {\n com.tencent.mm.plugin.wenote.model.a.c cVar = (com.tencent.mm.plugin.wenote.model.a.c) this.iPr.get(i);\n switch (cVar.getType()) {\n case -1:\n str = str2 + \"<hr/>\";\n break;\n case 1:\n i iVar = (i) cVar;\n if (!bo.isNullOrNil(iVar.content)) {\n str2 = str2 + iVar.content;\n if (i + 1 < this.iPr.size() && ((com.tencent.mm.plugin.wenote.model.a.c) this.iPr.get(i + 1)).getType() == 1 && !bo.isNullOrNil(((i) this.iPr.get(i + 1)).content)) {\n str = str2 + \"<br/>\";\n break;\n }\n }\n str = str2 + \"<br/>\";\n break;\n case 2:\n str = str2 + dO(((f) cVar).uOo, 2);\n break;\n case 3:\n str = str2 + dO(((g) cVar).uOo, 3);\n break;\n case 4:\n l lVar = (l) cVar;\n str = str2 + dO(lVar.uOo, lVar.getType());\n break;\n case 5:\n str = str2 + dO(((d) cVar).uOo, 5);\n break;\n case 6:\n str = str2 + dO(((k) cVar).uOo, 6);\n break;\n case 20:\n str = str2 + dO(((com.tencent.mm.plugin.wenote.model.a.b) cVar).uOo, 20);\n break;\n default:\n str = str2;\n break;\n }\n i++;\n str2 = str;\n }\n str = str2.replaceAll(IOUtils.LINE_SEPARATOR_UNIX, \"<br/>\");\n AppMethodBeat.o(26738);\n }\n } finally {\n while (true) {\n AppMethodBeat.o(26738);\n }\n }\n }\n return str;\n }",
"public String comunica() {\r\n// ritorna una stringa\r\n// posso usare il metodo astratto \r\n return msg + AggiungiQualcosa();\r\n }",
"public String toString() {\n\t\tString svar = \"\" + vaerdi; // vaerdi som streng, f.eks. \"4\"\n\t\treturn svar;\n\t}",
"@Override\n\tpublic String hablar() {\n\t\treturn \"Hola, soy un Buitre y sť volar\";\n\t}",
"public static String conocidosToString(List<String> conocidos){\r\n String s = \"\"; \r\n for(int i= 0; i<conocidos.size(); i++){\r\n String c = conocidos.get(i);\r\n s = s + c + \" \";\r\n }\r\n return s;\r\n \r\n}",
"@Override\r\n\tpublic String falar() {\r\n\t\treturn \"[ \"+getNome()+\" ] Sou Um Professor\";\r\n\t}",
"@Override\r\n\tpublic String encriptar(String string) {\n\r\n \r\n String newName=\"\";\r\n for (int i = 0; i < string.length(); i++) {\r\n // instrucción switch con tipo de datos int\r\n switch (string.charAt(i)) \r\n {\r\n case 'a' : newName+=\"1,\";\r\n break;\r\n case 'b' : newName+=\"2,\";\r\n break;\r\n case 'c' : newName+=\"3,\";\r\n break;\r\n case 'd' : newName+=\"4,\";\r\n break;\r\n case 'e' : newName+=\"5,\";\r\n break;\r\n case 'f' : newName+=\"6,\";\r\n break;\r\n case 'g' : newName+=\"7,\";\r\n break;\r\n case 'h' : newName+=\"8,\";\r\n break;\r\n case 'i' : newName+=\"9,\";\r\n break;\r\n case 'j' : newName+=\"10,\";\r\n break;\r\n case 'k' : newName+=\"11,\";\r\n break;\r\n case 'l' : newName+=\"12,\";\r\n break;\r\n case 'm' : newName+=\"13,\";\r\n break;\r\n case 'n' : newName+=\"14,\";\r\n break;\r\n case 'ñ' : newName+=\"15,\";\r\n break;\r\n case 'o' : newName+=\"16,\";\r\n break;\r\n case 'p' : newName+=\"17,\";\r\n break;\r\n case 'q' : newName+=\"18,\";\r\n break;\r\n case 'r' : newName+=\"19,\";\r\n break;\r\n case 's' : newName+=\"20,\";\r\n break;\r\n case 't' : newName+=\"21,\";\r\n break;\r\n case 'u' : newName+=\"22,\";\r\n break;\r\n case 'v' : newName+=\"23,\";\r\n break;\r\n case 'w' : newName+=\"24,\";\r\n break;\r\n case 'x' : newName+=\"25,\";\r\n break;\r\n case 'y' : newName+=\"26,\";\r\n break;\r\n case 'z' : newName+=\"27,\";\r\n break;\r\n case ' ' : newName+=\"0,\";\r\n break;\r\n \r\n \r\n }\r\n \r\n }\r\n \r\n String palabraFinal= eliminarComaSi(newName);\r\n return palabraFinal;\r\n\t}",
"public String toString(){\n return \"+-----------------------+\\n\" +\n \"| Boleto para el metro |\\n\" +\n \"|derjere0ranfeore |\\n\" +\n \"+-----------------------+\\n\" ;\n }",
"public void write_string_variable(int size, String str) throws IOException {\n\n // Creem una seqüència amb la mida\n byte bHeader[] = new byte[size];\n String strHeader;\n int numBytes = 0;\n\n // Creem la capçalera amb el nombre de bytes que codifiquen la mida\n numBytes = str.length();\n\n strHeader = String.valueOf(numBytes);\n int len;\n if ((len = strHeader.length()) < size)\n for (int i = len; i < size; i++) {\n strHeader = \"0\" + strHeader;\n }\n for (int i = 0; i < size; i++)\n bHeader[i] = (byte) strHeader.charAt(i);\n // Enviem la capçalera\n dos.write(bHeader, 0, size);\n // Enviem l'string writeBytes de DataOutputStrem no envia el byte més alt dels chars.\n dos.writeBytes(str);\n }",
"public String afficherInfoFichierTexte(){\n\t\tString fichierComplet = \"\";\n\t\tfor (Joueur j: ListJoueur) {\n\t\t\tfichierComplet += j.afficherFichierTexte();\n\t\t}\n\t\treturn fichierComplet;\n\t}",
"public static String string() {\n\t\t\tString s = \"\";\n\t\t\ts += \"Locaux :\\n\";\n\t\t\tfor(String key : locaux.keySet()) {\n\t\t\t\tIdent i = locaux.get(key);\n\t\t\t\ts += key+\", \"+i.toString()+\"\\n\";\n\t\t\t}\n\t\t\ts += \"Globaux :\\n\";\n\t\t\tfor(String key : globaux.keySet()) {\n\t\t\t\tIdent i = globaux.get(key);\n\t\t\t\ts += key+\", \"+i.toString()+\"\\n\";\n\t\t\t}\n\n\t\t\treturn s;\n\t\t}",
"protected String myString(){\n \treturn( \"gate \" + name ); \n }",
"private String getCampo3() {\n String campo = this.campoLivre.substring(15);\n System.out.println(\"campo3 \" + campo);\n return boleto.getDigitoCampo(campo);\n }",
"private static String createPrepStmPlaceHolder(int num) {\n\t\tchar[] c_ar = new char[num*3];\n\t\tc_ar[0] = '(';\n\t\tc_ar[1] = '?';\n\t\tfor(int i=1; i<num; ++i) {\n\t\t\tc_ar[3*i-1] = ',';\n\t\t\tc_ar[3*i] = ' ';\n\t\t\tc_ar[3*i+1] = '?';\n\t\t}\n\t\tc_ar[3*num-1] = ')';\n\t\treturn new String(c_ar);\n\t}",
"@Override\n public String toString(){\n return '+' + code + number.substring(0, 3) + '-' + number.substring(3, 6) + '-' +number.substring(6);\n }",
"public String buildingString() {\r\n\t\twhichBuild = 1 - whichBuild;\r\n\t\tif (whichBuild == 1) {\r\n\r\n\t\t}\r\n\t\treturn \"420 400;10 10 140 60 60 60 10;140 10 240 60 180 60 10;240 10 400 60 320 60 20 ;10 90 120 180 40 90 15;120 90 280 180 160 90 10;280 90 400 180 340 90 10\";\r\n\t}",
"@Override\n public String toString() {\n return getAcideAmine()+\", \"+ getCodon() +\", \"+ getNucleotide1()+ \", \"\n + getNucleotide2() +\", \"+ getNucleotide3();\n }",
"private String creatNewText() {\n\t\tRandom rnd = new Random();\n\t\treturn \"Some NEW teXt U9\" + Integer.toString(rnd.nextInt(999999));\n\t}",
"@Override public String getCarne(){\n return \"salchicha y jamón \";\n }",
"public static void main(String[] args) {\n\r\n\t\tString s1 = \"Tatyana\";\r\n\t\tString s2 = \"Tatyanat\";\r\n\t\tString s3 = \"Toneva\";\r\n\t\tString s4 = s1+ \" \" +s2 + \" \" +s3;\r\n\t\tSystem.out.println(s4);\r\n\t}",
"private void strin() {\n\n\t}",
"public void toStr()\r\n {\r\n numar = Integer.toString(read());\r\n while(numar.length() % 3 != 0){\r\n numar = \"0\" + numar; //Se completeaza cu zerouri pana numarul de cifre e multiplu de 3.\r\n }\r\n }",
"@Override\n\tpublic String parler() {\n\t\treturn \"Je suis un Orc\";\n\t}",
"void stringConstruction()\t{\n\n\t\tString symbol = \"#\";\n\t\t\n\t\tfor (int i = 1; i < q - 1; i++)\tsymbol = symbol + \"#\";\n\t\ts1 = symbol + s1 + symbol;\n\t\ts2 = symbol + s2 + symbol;\n\t\tlength1 += (q-1) * 2;\t\t\n\t\tlength2 += (q-1) * 2;\t\t\n\t}",
"public String makeString()\n {\n return \"ArcanaDungeonSource\";\n }",
"private String getCampo3() {\r\n String campo = this.campoLivre.substring(15);\r\n return boleto.getDigitoCampo(campo);\r\n }",
"public String generateString() {\n List<Trip<String, String, String>> sequence = super.generateSequence(startTrip, endTrip);\n sequence = sequence.subList(1, sequence.size()-1);\n String generated = \"\";\n for (int i = 0; i<sequence.size()-2; i++) generated += sequence.get(i).getThird() + \" \";\n return generated.substring(0, generated.length()-1);\n }",
"private static CharSequence makeCarierString(CharSequence plmn, CharSequence spn) {\n final boolean plmnValid = !TextUtils.isEmpty(plmn);\n final boolean spnValid = !TextUtils.isEmpty(spn);\n if (plmnValid && spnValid) {\n return plmn + \"|\" + spn;\n } else if (plmnValid) {\n return plmn;\n } else if (spnValid) {\n return spn;\n } else {\n return \"\";\n }\n }",
"public void cogerLetra(String letra){\r\n sb.append(letra);\r\n }",
"private String elaboraIncipit() {\n String testo = VUOTA;\n\n if (usaHeadIncipit) {\n testo += elaboraIncipitSpecifico();\n testo += A_CAPO;\n }// fine del blocco if\n\n return testo;\n }",
"private String tulostuksenApu(){\r\n String apu = \"Rivitiedosto: \";\r\n for(int i = 0; i<rivitiedot.length; i++){\r\n apu = apu + i+\": \";\r\n for(int k = 1; k <= rivitiedot[i].getKoko(); k++){\r\n apu = apu + \" \"+rivitiedot[i].get(k);\r\n }\r\n apu = apu + \" \";\r\n }\r\n\r\n return apu;\r\n }",
"private StringBuilder generateRowStringValue(PuzzlePiece col1, PuzzlePiece col2, PuzzlePiece col3, PuzzlePiece col4) {\n StringBuilder builder = new StringBuilder();\n int[][] arrayPuzzle1 = col1 != null ? col1.getArrayPuzzle() : null;\n int[][] arrayPuzzle2 = col2 != null ? col2.getArrayPuzzle() : null;\n int[][] arrayPuzzle3 = col3 != null ? col3.getArrayPuzzle() : null;\n int[][] arrayPuzzle4 = col4 != null ? col4.getArrayPuzzle() : null;\n for (int i = 0; i < 5; i++) {\n for (int j = 0; j < 20; j++) {\n if (j < 5) {\n if (col1 != null) {\n builder.append(arrayPuzzle1[i][j] == 1 ? \"o\" : \" \");\n } else {\n builder.append(\" \");\n }\n } else if (j < 10) {\n int jj = j - 5;\n if (col2 != null) {\n builder.append(arrayPuzzle2[i][jj] == 1 ? \"o\" : \" \");\n } else {\n builder.append(\" \");\n }\n } else if (j < 15) {\n int jj = j - 10;\n if (col3 != null) {\n builder.append(arrayPuzzle3[i][jj] == 1 ? \"o\" : \" \");\n } else {\n builder.append(\" \");\n }\n } else {\n int jj = j - 15;\n if (col4 != null) {\n builder.append(arrayPuzzle4[i][jj] == 1 ? \"o\" : \" \");\n } else {\n builder.append(\" \");\n }\n }\n }\n builder.append(\"\\n\");\n }\n return builder;\n }",
"private static String m60359b(String str, String str2, String str3) {\n StringBuilder sb = new StringBuilder(String.valueOf(str).length() + 4 + String.valueOf(str2).length() + String.valueOf(str3).length());\n sb.append(str);\n sb.append(\"|T|\");\n sb.append(str2);\n sb.append(\"|\");\n sb.append(str3);\n return sb.toString();\n }",
"private static String generateCRString (CRType<?> cr) {\r\n\t\tString res = \"\";\r\n\t\tif (cr.getAU_A() == null) {\r\n\t\t\tif (cr.getAU_L() != null) res += cr.getAU_L() + \", \" + cr.getAU_F().replaceAll(\"([A-Z])\", \"$1.\"); \r\n\t\t} else {\r\n\t\t\tres += cr.getAU_A().replaceAll(\";\", \",\");\r\n\t\t}\r\n\t\tres += \",\";\r\n\t\tif (cr.getTI() != null)\tres += cr.getTI();\r\n\t\tif (cr.getRPY() != null) res += \" (\" + cr.getRPY() + \") \";\r\n\t\tif (cr.getJ_N() != null) res += cr.getJ_N();\r\n\t\tif (cr.getVOL() != null) res += \", \" + cr.getVOL();\r\n\t\tif (cr.getPAG() != null) res += \", pp.\" + cr.getPAG();\r\n\t\tif (cr.getDOI() != null) res += \", DOI \" + cr.getDOI();\r\n\r\n\t\treturn res;\r\n\t}",
"public String toString(){\n String combinedStr = this.string1 + \" \" + this.string2 + \" \" + this.string3;\n return combinedStr;\n }",
"String mo1888b(String str, String str2, String str3, String str4);",
"private String gettxt(String num) {\n\t\tString str=\"Full Time\";\n\t\tif(num.equals(\"1\"))\n\t\t\tstr = \"Volunteer\";\n\t\telse if(num.equals(\"2\")){\n\t\t\tstr =\"Part Time\";\n\t\t}\n\t\telse if(num.equals(\"4\")){\n\t\t\tstr =\"Internship\";\n\t\t}\n\t\telse if(num.equals(\"5\")){\n\t\t\tstr =\"Freelancer\";\n\t\t}\n\t\t\n\t\treturn str;\n\t}",
"public String getString_data() { \n char carr[] = new char[Math.min(net.tinyos.message.Message.MAX_CONVERTED_STRING_LENGTH,60)];\n int i;\n for (i = 0; i < carr.length; i++) {\n if ((char)getElement_data(i) == (char)0) break;\n carr[i] = (char)getElement_data(i);\n }\n return new String(carr,0,i);\n }",
"public String toString(){\r\n\t\t\t\t\treturn \"перший в черзі і шлях вільний\";\r\n\t\t\t\t}",
"private String elaboraAvvisoScrittura() {\n String testo = VUOTA;\n\n if (usaHeadNonScrivere) {\n testo += TAG_NON_SCRIVERE;\n testo += A_CAPO;\n }// end of if cycle\n\n return testo;\n }",
"CamembertdeNormandie(Machecoulais machecoulais, Context context, String str) {\n super(0);\n this.f16562a = machecoulais;\n this.f16563b = context;\n this.f16564c = str;\n }",
"public void grabarString(String x, int cant) throws IOException\r\n {\r\n writeString(maestro, x, cant);\r\n }",
"@Override\n\tpublic String toString() {\n\t\treturn this.getsTenkhoanquy() + \" : \" + this.fSotienconlai\n\t\t\t\t+ this.sLoaitiente;\n\t}",
"void stampaMessaggio(String messaggio);",
"public String encode(List<String> strs) {\n StringBuilder b = new StringBuilder();\n for (String s : strs) {\n b.append(s.length()).append(\"#\").append(s);\n }\n return b.toString();\n }",
"java.lang.String getS4();",
"protected String finalizarGenerateStringCamposFiltro(String listCamposFiltro){\r\n\t\t//Eliminamos la ultima coma y espacio introducidos.\r\n\t\tif(listCamposFiltro != \"\"){\r\n\t\t\tlistCamposFiltro = listCamposFiltro.substring(0, listCamposFiltro.length()-2);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlistCamposFiltro = null; //Devolvemos null si no hay ningun filtro introducido\r\n\t\t}\r\n\r\n\t\tsetCamposFiltro(listCamposFiltro);\r\n\t\treturn listCamposFiltro;\r\n\t}",
"private static String criaStringDeSaida(Graph grafo, ArrayList<Integer> busca) {\r\n\t\tint[] ordenaSaida = new int[grafo.getVertexNumber() * 3 + 3];\r\n\r\n\t\tfor (int i = 0; i < busca.size(); i += 3) {\r\n\t\t\tordenaSaida[busca.get(i) * 3] = busca.get(i); // vertice\r\n\t\t\tordenaSaida[busca.get(i) * 3 + 1] = busca.get(i + 1); // nivel\r\n\t\t\tordenaSaida[busca.get(i) * 3 + 2] = busca.get(i + 2); // pai\r\n\t\t}\r\n\r\n\t\tString retorno = \"\";\r\n\r\n\t\tfor (int i = 3; i < ordenaSaida.length; i += 3) {\r\n\t\t\tretorno += ordenaSaida[i] + \" - \" + ordenaSaida[i + 1] + \" \";\r\n\t\t\tif (ordenaSaida[i + 2] == 0) {\r\n\t\t\t\tretorno += \"-\";\r\n\r\n\t\t\t} else {\r\n\t\t\t\tretorno += ordenaSaida[i + 2];\r\n\t\t\t}\r\n\r\n\t\t\tretorno += \"\\n\";\r\n\t\t}\r\n\r\n\t\treturn retorno;\r\n\t}",
"public static void main(String[] args) {\n String a = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ#-\";\r\n //---------------------------------------------------------------------\r\n \r\n //Memanggil alfabet String yang diinginkan\r\n //Menentukan alfabet untuk Nama\r\n char hasil1 = a.charAt(0);\r\n char hasil2 = a.charAt(25);\r\n char hasil3 = a.charAt(7);\r\n char hasil4 = a.charAt(0);\r\n char hasil5 = a.charAt(17);\r\n char hasil6 = a.charAt(27);\r\n char hasil7 = a.charAt(1);\r\n char hasil8 = a.charAt(4);\r\n char hasil9 = a.charAt(17);\r\n char hasil10 = a.charAt(11);\r\n char hasil11 = a.charAt(8);\r\n char hasil12 = a.charAt(0);\r\n char hasil13 = a.charAt(13);\r\n char hasil14 = a.charAt(0);\r\n //---------------------------------------------------------------------\r\n \r\n //Menentukan alfabet untuk Kelas\r\n char hasil15 = a.charAt(23);\r\n char hasil16 = a.charAt(8);\r\n char hasil17 = a.charAt(8);\r\n char hasil18 = a.charAt(27);\r\n char hasil19 = a.charAt(17);\r\n char hasil20 = a.charAt(15);\r\n char hasil21 = a.charAt(11);\r\n char hasil22 = a.charAt(27);\r\n char hasil23 = a.charAt(1);\r\n //---------------------------------------------------------------------\r\n \r\n //Saat nya memanggil output yang telah di tentukan pada variable-variable diatas\r\n System.out.println(\"ALFABET TERSEDIA : \"+a);\r\n //---------------------------------------------------------------------\r\n \r\n //---------------------------------------------------------------------\r\n System.out.println(\"---------------------------------------------------\"\r\n + \"------------------\");\r\n //---------------------------------------------------------------------\r\n \r\n //Pemanggilan Nama\r\n System.out.println(\"Nama : \"+hasil1+\"\"+hasil2+\"\"+hasil3+\"\"+hasil4+\r\n \"\"+hasil5+\"\"+hasil6+\"\"+hasil7+\"\"+hasil8+\"\"+hasil9+\"\"+hasil10+\"\"\r\n +hasil11+\"\"+hasil12+\"\"+hasil13+\"\"+hasil14);\r\n //---------------------------------------------------------------------\r\n \r\n //Pemanggilan Kelas\r\n System.out.println(\"Kelas : \"+hasil15+\"\"+hasil16+\"\"+hasil17+\"\"+\r\n hasil18+\"\"+hasil19+\"\"+hasil20+\"\"+hasil21+\"\"+hasil22+\"\"+hasil23);\r\n //---------------------------------------------------------------------\r\n \r\n //---------------------------------------------------------------------\r\n System.out.println(\"---------------------------------------------------\"\r\n + \"------------------\");\r\n //---------------------------------------------------------------------\r\n \r\n }",
"java.lang.String getPrenume();",
"private static String lettre2Chiffre1(String n) {\n\t\tString c= new String() ;\n\t\tswitch(n) {\n\t\tcase \"A\": case \"J\":\n\t\t\tc=\"1\";\n\t\t\treturn c;\n\t\tcase \"B\": case \"K\": case \"S\":\n\t\t\tc=\"2\";\n\t\t\treturn c;\n\t\tcase \"C\": case\"L\": case \"T\":\n\t\t\tc=\"3\";\n\t\t\treturn c;\n\t\tcase \"D\": case \"M\": case \"U\":\n\t\t\tc=\"4\";\n\t\t\treturn c;\n\t\tcase \"E\": case \"N\": case \"V\":\n\t\t\tc=\"5\";\n\t\t\treturn c;\n\t\tcase \"F\": case \"O\": case \"W\":\n\t\t\tc=\"6\";\n\t\t\treturn c;\n\t\tcase \"G\": case \"P\": case \"X\":\n\t\t\tc=\"7\";\n\t\t\treturn c;\n\t\tcase \"H\": case \"Q\": case \"Y\":\n\t\t\tc=\"8\";\n\t\t\treturn c;\n\t\tcase \"I\": case \"R\": case \"Z\":\n\t\t\tc=\"4\";\n\t\t\treturn c;\n\t\t\t\n\t\t}\n\t\treturn c;\n\t\t\n\t\n\t\t}",
"void addDictContent (String[] parts){\n String s2;\n\n // добавление ИНов и АУТов в СПРАВОЧНИК\n for (int i = 1; i<this.counterString1+1; i++) {\n s2=parts[0]+\"|\"+parts[4];\n\n if (s2.equals( this.string1 [i][1])) {\n if (parts[2].equals(\"IN\")){\n this.string1 [i][2]=this.string1 [i][2]+parts[1]+\"|\"+parts[3]+\"|\";\n }\n if (parts[2].equals(\"OUT\")){\n this.string1 [i][3]=this.string1 [i][3]+parts[1]+\"|\"+parts[3]+\"|\";\n }\n\n }\n } // endif I\n }",
"public String toString()\n {\n String textoADevolver = \"\";\n if (tareaCompletada)\n {\n textoADevolver += \"HECHA \";\n }\n textoADevolver += descripcion + \" (\" +prioridad+ \").\";\n return textoADevolver;\n }",
"public static void main(String args[]) {\n\t String str1 = \"Welcome\";\n\t String str2 = \" to \";\n\t String str3 = \" HOME \";\n\t str1 = str1.concat(str2).concat(str3);\n\t System.out.println(str1);\n\t \n\t \n\t \n\t }",
"@Test \n\tpublic void testToString() {\n\t\t\n\t\tString saida = \"decio neto - 56554522\";\n\t\tassertEquals(contato1.toString(), saida);\n\t}",
"abstract String mo1748c();",
"@Override\r\n\tpublic String sonido() {\n\t\treturn \"Miauu\";\r\n\t}",
"public void drawString(String var1, int var2, int var3, int var4, int var5) {\n boolean var11 = field_759;\n\n try {\n byte[] var6 = field_748[var4];\n int var7 = 0;\n if(var11 || var7 < var1.length()) {\n do {\n label165: {\n if(var1.charAt(var7) == 64 && var7 + 4 < var1.length() && var1.charAt(var7 + 4) == 64) {\n label166: {\n if(var1.substring(var7 + 1, var7 + 4).equalsIgnoreCase(\"red\")) {\n var5 = 16711680;\n if(!var11) {\n break label166;\n }\n }\n\n if(var1.substring(var7 + 1, var7 + 4).equalsIgnoreCase(\"lre\")) {\n var5 = 16748608;\n if(!var11) {\n break label166;\n }\n }\n\n if(var1.substring(var7 + 1, var7 + 4).equalsIgnoreCase(\"yel\")) {\n var5 = 16776960;\n if(!var11) {\n break label166;\n }\n }\n\n if(var1.substring(var7 + 1, var7 + 4).equalsIgnoreCase(\"gre\")) {\n var5 = '\\uff00';\n if(!var11) {\n break label166;\n }\n }\n\n if(var1.substring(var7 + 1, var7 + 4).equalsIgnoreCase(\"blu\")) {\n var5 = 255;\n if(!var11) {\n break label166;\n }\n }\n\n if(var1.substring(var7 + 1, var7 + 4).equalsIgnoreCase(\"cya\")) {\n var5 = '\\uffff';\n if(!var11) {\n break label166;\n }\n }\n\n if(var1.substring(var7 + 1, var7 + 4).equalsIgnoreCase(\"mag\")) {\n var5 = 16711935;\n if(!var11) {\n break label166;\n }\n }\n\n if(var1.substring(var7 + 1, var7 + 4).equalsIgnoreCase(\"whi\")) {\n var5 = 16777215;\n if(!var11) {\n break label166;\n }\n }\n\n if(var1.substring(var7 + 1, var7 + 4).equalsIgnoreCase(\"bla\")) {\n var5 = 0;\n if(!var11) {\n break label166;\n }\n }\n\n if(var1.substring(var7 + 1, var7 + 4).equalsIgnoreCase(\"dre\")) {\n var5 = 12582912;\n if(!var11) {\n break label166;\n }\n }\n\n if(var1.substring(var7 + 1, var7 + 4).equalsIgnoreCase(\"ora\")) {\n var5 = 16748608;\n if(!var11) {\n break label166;\n }\n }\n\n if(var1.substring(var7 + 1, var7 + 4).equalsIgnoreCase(\"ran\")) {\n var5 = (int)(Math.random() * 1.6777215E7D);\n if(!var11) {\n break label166;\n }\n }\n\n if(var1.substring(var7 + 1, var7 + 4).equalsIgnoreCase(\"or1\")) {\n var5 = 16756736;\n if(!var11) {\n break label166;\n }\n }\n\n if(var1.substring(var7 + 1, var7 + 4).equalsIgnoreCase(\"or2\")) {\n var5 = 16740352;\n if(!var11) {\n break label166;\n }\n }\n\n if(var1.substring(var7 + 1, var7 + 4).equalsIgnoreCase(\"or3\")) {\n var5 = 16723968;\n if(!var11) {\n break label166;\n }\n }\n\n if(var1.substring(var7 + 1, var7 + 4).equalsIgnoreCase(\"gr1\")) {\n var5 = 12648192;\n if(!var11) {\n break label166;\n }\n }\n\n if(var1.substring(var7 + 1, var7 + 4).equalsIgnoreCase(\"gr2\")) {\n var5 = 8453888;\n if(!var11) {\n break label166;\n }\n }\n\n if(var1.substring(var7 + 1, var7 + 4).equalsIgnoreCase(\"gr3\")) {\n var5 = 4259584;\n }\n }\n\n var7 += 4;\n if(!var11) {\n break label165;\n }\n }\n\n if(var1.charAt(var7) == 126 && var7 + 4 < var1.length() && var1.charAt(var7 + 4) == 126) {\n char var8 = var1.charAt(var7 + 1);\n char var9 = var1.charAt(var7 + 2);\n char var10 = var1.charAt(var7 + 3);\n if(var8 >= 48 && var8 <= 57 && var9 >= 48 && var9 <= 57 && var10 >= 48 && var10 <= 57) {\n var2 = Integer.parseInt(var1.substring(var7 + 1, var7 + 4));\n }\n\n var7 += 4;\n if(!var11) {\n break label165;\n }\n }\n\n int var13 = field_749[var1.charAt(var7)];\n if(this.loggedIn && var5 != 0) {\n this.method_268(var13, var2 + 1, var3, 0, var6);\n }\n\n if(this.loggedIn && var5 != 0) {\n this.method_268(var13, var2, var3 + 1, 0, var6);\n }\n\n this.method_268(var13, var2, var3, var5, var6);\n var2 += var6[var13 + 7];\n }\n\n ++var7;\n } while(var7 < var1.length());\n\n }\n } catch (Exception var12) {\n System.out.println(\"drawstring: \" + var12); // authentic System.out.println\n var12.printStackTrace();\n }\n }",
"private void yas(){\n System.out.println(namn);\n \n try{\n String fraga = \"SELECT TEXT FROM INLAGG WHERE RUBRIK = 'Borttappad strumpa'\";\n String XD = db.fetchSingle(fraga);\n System.out.println(XD);\n txtInlagg.append(XD);\n }\n catch(InfException e){\n JOptionPane.showMessageDialog(null, \"Kunde ej hämta inlägg\");\n }\n }",
"private VectorArit VectorToString(VectorArit v) {\r\n LinkedList<Object> l = new LinkedList<>();\r\n for (int i = 0; i < v.getTamanio(); i++) {\r\n l.add(v.Acceder(i).toString());\r\n }\r\n return new VectorArit(TipoPrimitivo.STRING, l);\r\n }",
"public String get(){\n\t\tString s = value%13+1+\"\"+suits[value/13]+\" \";\r\n\t\treturn s;\r\n\t}",
"protected String decrisToi(){\r\n return \"\\t\"+this.nomVille+\" est une ville de \"+this.nomPays+ \", elle comporte : \"+this.nbreHabitants+\" habitant(s) => elle est donc de catégorie : \"+this.categorie;\r\n }",
"@Override\n public String saveString() {\n AtomicReference<String> s = new AtomicReference<>(String.valueOf(finalistID) + \":\"); //Atomic reference since we modifying with lambda\n answers.forEach(a -> { s.set( s.get() + a + \":\"); });\n return s.get().substring(0, s.get().length()-1); //remove last ':'\n }",
"public void mo5994p() {\n this.f5411d = this.f5389I.getString(R.string.new_recording) + \" \" + C1398b.m6805a();\n C1413m.f5726x = this.f5411d;\n }",
"static String cetak_nama1() {\n return \"Nama Saya : Aprianto\";\r\n }",
"private String formulerMonNom() {\n\t return \"Je m'appelle \" + this.nom; // appel de la propriété nom\n\t }",
"public String Alrevez() {\n String retorno = \"\";\n for (int i = getCadena().length() - 1; i >= 0; i--) {\n retorno += getCadena().charAt(i);\n }\n return retorno;\n }",
"public String creerDureeJtable(String chaine){\r\n\t\tif(chaine.length() == 1){\r\n\t\t\treturn chaine+\"h00\";\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn chaine.substring(0, 1)+\"h\"+chaine.substring(1, chaine.length());\r\n\t\t}\r\n\t\t\r\n\t}",
"String mo1889a(String str, String str2, String str3, String str4);",
"abstract String moodString();",
"private String stringShortener(String str) {\n if (str.length() <= 5) {\n return str;\n }\n str = str.substring(0, 5);\n str = str + \"...\";\n return str;\n }",
"public String encode(List<String> strs) {\n \n StringBuilder ans = new StringBuilder(\"\");\n for(String str:strs) {\n ans.append(str.length()+\"@\");\n ans.append(str);\n }\n return ans.toString();\n }",
"public String toString2() {\n return calle.isEmpty() ? \"\" : (calle + \" \" + numeroExterior + \" \" + (numeroInterior.isEmpty() ? \"\" : \" \" + numeroInterior)\n + (referencia.isEmpty() ? \"\" : \"\" + referencia + \" \")\n + (colonia.isEmpty() ? \"\" : colonia));\n }",
"public void insertar (String p) {\n int x = p.length();\n for (int i = x-1; i >=0; i--) {\n System.out.println(p.charAt(i));\n pila.add(p.charAt(i)+\"\");\n }\n }",
"public static void main(String[] args) {\n StringBuilder sb = new StringBuilder();\n sb.append(1);\n sb.append(\"00\");\n sb.append(\"%\");\n sb.append(' ');\n sb.append('P');\n \n String createdString = sb.toString();\n System.out.println(\"createdString = \" + createdString);\n\n }",
"public void Tarifa(String tipoTarifa){\n Tarifa = tipoTarifa;\n Regular = \"R\";\n Comercial = \"C\";\n\n }",
"private String addCharacter() {\n\t\t// Two Parameters: CharaNumber, CharaName\n\t\tStringBuilder tag = new StringBuilder();\n\t\ttag.append(\"|chara\");\n\t\tif (!parameters[0].equals(\"0\")) {\n\t\t\ttag.append(parameters[0]);\n\t\t}\n\t\ttag.append(\":\" + parameters[1]);\n\t\treturn tag.toString();\n\n\t}",
"private static String getUniqueString() {\n char[] buf = new char[NUM_CHARS];\n\n carry(lastString, buf.length - 1);\n for (int i = 0; i < buf.length; i++) {\n buf[i] = CHARS.charAt(lastString[i]);\n }\n return new String(buf);\n }",
"private String cadenaABinario(String cadena){\n String cb = \"\";\n int longitud;\n for(int i = 0; i < cadena.length(); i++){\n cb += String.format(\"%8s\",Integer.toBinaryString(cadena.charAt(i)));\n }\n cb = formato(cb);\n return cb;\n }",
"private String encodeMessage() {\n\t\tString encode = \"\";\n\t\tfor (int i = 0; i < message.length(); i++) {\n\t\t\tencode += map.get(message.charAt(i));\n\t\t}\n\t\tgenerateBack();\n\t\treturn encode;\n\t}",
"private void convertToString(String s)\n\t{\n\t\tchar chars[] = s.toCharArray();\n\t\tfor(int i = 0; i < chars.length; i+=3)\n\t\t{\n\t\t\tString temp = \"\";\n\t\t\ttemp += chars[i];\n\t\t\ttemp += chars[i+1];\n\t\t\tif(chars[i] < '3')\n\t\t\t{\n\t\t\t\ttemp += chars[i+2];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ti -= 1;\n\t\t\t}\n\t\t\t\n\t\t\tif(!temp.equals(\"256\"))\n\t\t\t{\n\t\t\t\tmyDecryptedMessage += (char)(Integer.parseInt(temp));\n\t\t\t}\n\t\t}\n\t}",
"public String getString(){\n\t\treturn \t_name + String.format(\"\\nWeight: %s\", _weight) + String.format( \"\\nNumber of wheels: %s\", _numberOfWheels ) + \n\t\t\t\tString.format( \"\\nMax of speed: %s\", _maxOfSpeed ) + String.format( \"\\nMax acceleration: %s\", _maxAcceleration ) + \n\t\t\t\tString.format( \"\\nHeight: %s\", _height ) + String.format( \"\\nLength: %s\", _length ) + String.format( \"\\nWidth: %s\", _width );\n\t}",
"@Override\n public String toString()\n {\n String aDevolver= \"\";\n aDevolver += super.toString();\n aDevolver += \"potenciaCV: \" + potenciaCV + \"\\n\";\n return aDevolver;\n }",
"private void fillString() {\n information = new String[4];\n information[0] = htmlConverter.fromHtml(event.getSummary()).toString();\n information[1] = event.getBeginTime() + \" - \" + event.getEndTime();\n information[2] = htmlConverter.fromHtml(event.getLocation()).toString();\n information[3] = htmlConverter.fromHtml(event.getDescription()).toString();\n }",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tString xStringA = scan.next() + \"111111\";\n\t\tchar[] xCharA = xStringA.toCharArray();\n\t\tString[] xAlpha = new String[26];\n\t\txAlpha[0]=\"a\";\n\t\txAlpha[1]=\"B\";\n\t\txAlpha[2]=\"C\";\n\t\txAlpha[3]=\"D\";\n\t\txAlpha[4]=\"E\";\n\t\txAlpha[5]=\"F\";\n\t\txAlpha[6]=\"G\";\n\t\txAlpha[7]=\"H\";\n\t\txAlpha[8]=\"I\";\n\t\txAlpha[9]=\"J\";\n\t\txAlpha[10]=\"K\";\n\t\txAlpha[11]=\"L\";\n\t\txAlpha[12]=\"M\";\n\t\txAlpha[13]=\"N\";\n\t\txAlpha[14]=\"O\";\n\t\txAlpha[15]=\"P\";\n\t\txAlpha[16]=\"Q\";\n\t\txAlpha[17]=\"R\";\n\t\txAlpha[18]=\"S\";\n\t\txAlpha[19]=\"T\";\n\t\txAlpha[20]=\"U\";\n\t\txAlpha[21]=\"V\";\n\t\txAlpha[22]=\"W\";\n\t\txAlpha[23]=\"X\";\n\t\txAlpha[24]=\"Y\";\n\t\txAlpha[25]=\"Z\";\n\t\t\n\t\t\n\t\tchar one = xStringA.charAt(0);\n\t\tchar two = xStringA.charAt(1);\n\t\tchar three = xStringA.charAt(2);\n\t\tchar four = xStringA.charAt(3);\n\t\tchar five = xStringA.charAt(4);\n\t\tchar six = xStringA.charAt(5);\n\n\t\tString sOne = Character.toString(one);\n\t\tString sTwo = Character.toString(two);\n\t\tString sThree = Character.toString(three);\n\t\tString sFour = Character.toString(four);\n\t\tString sFive = Character.toString(five);\n\t\tString sSix = Character.toString(six);\n\t/*\t\n\t\tSystem.out.println(sOne);\n\t\tSystem.out.println(sTwo);\n\t\tSystem.out.println(sThree);\n\t\tSystem.out.println(sFour);\n\t\tSystem.out.println(sFive);\n\t\tSystem.out.println(sSix);\n\t*/\n\t\t\n\t\tfor (int i = 0; i < 26 ; i++) {\n\t\t\tif (sOne != xAlpha[i]) {\n\t\t\t\tint oneVar = 1;\n\t\t\t\toneVar = i+1;\n\t\t\t\tSystem.out.println(\"Value is\");\n\t\t\t\tSystem.out.println(sOne + \" \" +xAlpha[i]);\n\t\t\t\tSystem.out.println(oneVar);\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"no value was similar1\");\n\t\t\t}\n\t\t\t\n\t\t\tif (sTwo != xAlpha[i]) {\n\t\t\t\tint twoVar = 2;\n\t\t\t\ttwoVar = i+1;\n\t\t\t\tSystem.out.println(\"Value is\");\n\t\t\t\tSystem.out.println(sTwo + \" \" +xAlpha[i]);\n\t\t\t\tSystem.out.println(twoVar);\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"no value was similar2\");\n\t\t\t}\n\t\t\t}\n\t\t}",
"public abstract java.lang.String getAcma_cierre();",
"public String getPatronAutorizacion()\r\n/* 204: */ {\r\n/* 205:349 */ this.patronAutorizacion = \"\";\r\n/* 206:350 */ if (this.indicadorFacturaElectronica) {\r\n/* 207:351 */ for (int i = 0; i < 37; i++) {\r\n/* 208:352 */ this.patronAutorizacion += \"9\";\r\n/* 209: */ }\r\n/* 210: */ } else {\r\n/* 211:355 */ for (int i = 0; i < 10; i++) {\r\n/* 212:356 */ this.patronAutorizacion += \"9\";\r\n/* 213: */ }\r\n/* 214: */ }\r\n/* 215:359 */ return this.patronAutorizacion;\r\n/* 216: */ }",
"public String encode(List<String> strs) {\n String res = \"\";\n for(String s : strs)\n {\n int len = s.length();\n res += len + \"/\" + s;\n }\n return res;\n }",
"public String cifrar(String palabra){\n\n String cifrado= \" \";\n char auxiliar;\n int i = 0;\n \n for(i=0;i<palabra.length();i++){\n auxiliar=palabra.charAt(i);\n if(auxiliar ==' '){\n \n }else{\n auxiliar++;\n if(auxiliar=='{'){\n auxiliar='a';\n }\n }\n cifrado=cifrado+\"\"+auxiliar;\n }\n return cifrado;\n }",
"@Override\npublic String toString() {\n\treturn (super.toString()+\"\"+this.matiere);\n}",
"public String getWriteString() {\r\n\t\t\treturn \"Dest \"+name+\" \"+x+\" \"+y+\" \"+z;\r\n\t}",
"private CharSequence replacewithZawgyi(String zawgyi, String myString1) {\n\t\ttry {\n JSONArray rule_array = new JSONArray(zawgyi);\n int max_loop = rule_array.length();\n \n myString1 = myString1.replace(\"null\", \"\\uFFFF\\uFFFF\");\n for (int i = 0; i < max_loop; i++) {\n JSONObject obj = rule_array.getJSONObject(i);\n String from = obj.getString(\"from\");\n String to = obj.getString(\"to\");\n myString1 = myString1.replaceAll(from, to);\n myString1 = myString1.replace(\"null\", \"\");\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\t\tmyString1 = myString1.replace(\"\\uFFFF\\uFFFF\", \"null\");\n return myString1;\n \n\t}",
"public abstract String mo24851a(String str);"
] | [
"0.63023007",
"0.62419415",
"0.61168516",
"0.6091279",
"0.6055349",
"0.60551673",
"0.60377586",
"0.59819764",
"0.59529555",
"0.58781284",
"0.5876822",
"0.5865624",
"0.5861922",
"0.5799864",
"0.57980365",
"0.57829916",
"0.577963",
"0.5734321",
"0.57319546",
"0.5708975",
"0.5695054",
"0.56875247",
"0.56718093",
"0.56668466",
"0.56646264",
"0.5660742",
"0.565752",
"0.56557924",
"0.5653777",
"0.5648292",
"0.5630457",
"0.5625944",
"0.5610126",
"0.56097454",
"0.56075794",
"0.5603798",
"0.5588052",
"0.55862236",
"0.5585475",
"0.55818063",
"0.5580195",
"0.5579706",
"0.55691123",
"0.55571955",
"0.5553765",
"0.55520797",
"0.5551385",
"0.55511165",
"0.554421",
"0.553493",
"0.55279315",
"0.55158067",
"0.55118096",
"0.55089563",
"0.5508634",
"0.550099",
"0.54980195",
"0.54977125",
"0.5491297",
"0.548935",
"0.54833335",
"0.5480242",
"0.5478488",
"0.5477428",
"0.54771",
"0.5476096",
"0.5474105",
"0.54694927",
"0.5467788",
"0.5466673",
"0.54660445",
"0.5463994",
"0.546364",
"0.5460528",
"0.5448889",
"0.5445936",
"0.54386854",
"0.54318756",
"0.5430451",
"0.5429496",
"0.54252476",
"0.5424615",
"0.5417823",
"0.54122394",
"0.5408989",
"0.54052466",
"0.5401902",
"0.5401605",
"0.5398934",
"0.53961015",
"0.5395291",
"0.5392815",
"0.5391657",
"0.53857565",
"0.538203",
"0.5381411",
"0.53798294",
"0.5377828",
"0.5368037",
"0.5366926",
"0.53653604"
] | 0.0 | -1 |
/ Etape permettant d'apeller afficherReponse de la respLine de la pegline courante | boolean afficherReponse(String reponse)
{
return respLine.afficherReponse(reponse);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tprotected void processRespond() {\n\r\n\t}",
"@Override\r\n\tprotected void processRespond() {\n\r\n\t}",
"void envoiReponseSansDonnees(HttpServletResponse reponse);",
"@Override\r\n\tpublic void newLineRecieved() {\n\t\tString response = grblPort.readNextLine();\r\n\t\tresponse.trim();\r\n\t\tSystem.out.println(\"Recieve: \" + response);\r\n\t\t//System.out.println(\"HAHAHAH\");\r\n\t\tif (response.contains(\"ok\") && grblPort.ok == false){\t\t\t\r\n\t\t\tgrblPort.ok = true;\t\t\r\n\t\t\tSystem.out.println(\"Got ACK\");\r\n\t\t\tif (!sendLines.isEmpty()){//If there is more stuff in the buffer, keep on sending it.\r\n\t\t\t\tsendLines.remove(0);\r\n\t\t\t\tgrblPort.sendDataLine(sendLines.get(0)); \t\t\r\n\t \t}\r\n\t\t}\r\n\t\tif (response.contains(\"error\")){\r\n\t\t\tSystem.out.println(\"ERROR...ERROR...ERROR...ERROR...ERROR...ERROR...ERROR...ERROR...ERROR\");\r\n\t\t\tgrblPort.sendDataLine(sendLines.get(0)); \r\n\t\t}\r\n\t\tif (response.contains(\"<\")&&response.contains(\">\")){\r\n\t\t\tif (!sendLines.isEmpty()){//If there is more stuff in the buffer, keep on sending it.\r\n\t\t\t//\tgrblPort.sendDataLine(sendLines.remove(0)); \t\t\r\n\t \t}\r\n\t\t\tresponse = response.replaceAll(\"<\", \"\");\r\n\t\t\tresponse = response.replaceAll(\">\", \"\");\r\n\t\t\tString data[] = response.split(\",\");\r\n\t\t\tfor (String string : data) {\r\n\t\t\t\tstring = string.toUpperCase();\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"************************************* \"+data[0]);\r\n\t\t\tswitch (data[0].toUpperCase()) {\r\n\t\t\tcase \"IDLE\":\r\n\t\t\t\tmachineState = MachineState.IDLE;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"RUN\":\r\n\t\t\t\tmachineState = MachineState.RUNNING;\r\n\t\t\t\treturn;\r\n\t\t\t\t//break;\r\n\t\t\tcase \"QUEUE\":\r\n\t\t\t\tmachineState = MachineState.QUEUE;\r\n\t\t\t\treturn;\r\n\t\t\tdefault:\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}",
"<TEntite> void envoiReponseAvecDonnees(TEntite entite, HttpServletResponse reponse, int codeDeStatutHttp, String message) throws IOException;",
"public void setRespp(java.lang.CharSequence value) {\n this.respp = value;\n }",
"static void processResponse(CTPResponse response)\n {\n \tfor(int i=0;i<response.GetNumResponses();i++)\n \t{\n \t\tint type = response.getReponseType(i);\n \t\tswitch (type) {\n\t \t\tcase CTPResponse.ERROR_RSP:{\n\t \t\t\tif(response.getStatus(i)== -1)\n\t \t\t\tSystem.out.println(\"ERROR_RSP Invalid client request\");\t\n\t \t\t\telse\n\t \t\t\tSystem.out.println(\"ERROR_RSP \"+response.getErrorText(i));\t\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tcase CTPResponse.ACKCONNECT_RSP:{\n\t \t\t\tSystem.out.println(\"ACKCONNECT_RSP received\");\t\n\t \t\t\tbreak;\n\t \t\t}\n\t\t\t\tcase CTPResponse.ACKOPEN_RSP:{\n\t\t\t\t\tSystem.out.println(\"ACKOPEN_RSP received\");\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase CTPResponse.ACKLOCK_RSP:{\n\t\t\t\t\tSystem.out.println(\"ACKLOCK_RSP received\");\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase CTPResponse.ACKEDIT_RSP:{\n\t\t\t\t\tSystem.out.println(\"ACKEDIT_RSP received\");\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase CTPResponse.SERVRELEASE_RSP:{\n\t\t\t\t\tSystem.out.println(\"SERVRELEASE_RSP received\");\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase CTPResponse.CONTENTS_RSP:{\n\t\t\t\t\tSystem.out.println(\"CONTENTS_RSP received\");\t\n\t\t\t\t\tSystem.out.println(\"Position in file = \"+response.getPosInfile(i));\n\t\t\t\t\tSystem.out.println(\"file data = \"+response.getFilData(i));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase CTPResponse.MOVE_RSP:{\n\t\t\t\t\tSystem.out.println(\"MOVE_RSP received\");\t\n\t\t\t\t\tSystem.out.println(\"Cursor position in file= \"+response.getPosInfile(i));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase CTPResponse.STATUS_RSP:{\n\t\t\t\t\tSystem.out.println(\"STATUS_RSP received\");\t\n\t\t\t\t\tSystem.out.println(\"Checksum = \"+response.getChecksum(i));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase CTPResponse.EDIT_RSP:{\n\t\t\t\t\tSystem.out.println(\"EDIT_RSP received\");\t\n\t\t\t\t\tSystem.out.println(\"action = \"+response.getEditAction(i));\n\t\t\t\t\tSystem.out.println(\"Position in file = \"+response.getPosInfile(i));\n\t\t\t\t\tSystem.out.println(\"file data = \"+response.getFilData(i));\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tcase CTPResponse.CLOSE_RSP:{\n\t\t\t\t\tSystem.out.println(\"CLOSE_RSP received\");\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: \n\t\t\t\t\tSystem.out.println(\"Invalid Response type received\");\t\n \t\t}//end switch\n \t}//end for loop\n }",
"private void writeResponseLine(final DataOutput out) throws IOException {\n out.writeBytes(HTTP_VERSION);\n out.writeBytes(SP);\n out.writeBytes(code + \"\");\n out.writeBytes(SP);\n if (responseString != null) {\n out.writeBytes(responseString);\n }\n out.writeBytes(CRLF);\n }",
"@Override\n\tpublic void sendResponse() {\n\t\t\n\t}",
"private void clientResponse(String msg) {\n JSONObject j = new JSONObject();\n j.put(\"statuscode\", 200);\n j.put(\"sequence\", ++sequence);\n j.put(\"response\", new JSONArray().add(msg));\n output.println(j);\n output.flush();\n }",
"@Override\n\tpublic void sendResponse() {\n\n\t}",
"public java.lang.CharSequence getRespp() {\n return respp;\n }",
"@Override\n public void onResponse(String response) {\n opprettListe(response);\n }",
"public interface HttpResponseProxylet extends Proxylet {\n \n /**\n * Possible return code of method 'accept'.\n * <br/>The proxylet accepts the message and will not block while processing it\n */\n public static final int ACCEPT = 0x03;\n /**\n * Possible return code of method 'accept'.\n * the proxylet accepts the message but might block while processing it\n */\n public static final int ACCEPT_MAY_BLOCK = 0x7;\n /**\n * Possible return code of method 'accept'.\n * <br/>The proxylet is not interested in the message\n */\n public static final int IGNORE = 0;\n \n /**\n * Called by the Engine to know how the proxylet will handle the Response.\n * <br/>The possible return codes are: ACCEPT, ACCEPT_MAY_BLOCK, IGNORE.\n * <b>NOTE: This method can be called by the Engine several times in a row for the same request.</b>\n * Therefore it should behave accordingly.\n * @param prolog the response prolog\n * @param headers the response headers\n * @return ACCEPT, ACCEPT_MAY_BLOCK, or IGNORE\n */\n public int accept(HttpResponseProlog prolog, HttpHeaders headers);\n \n}",
"public java.lang.CharSequence getRespp() {\n return respp;\n }",
"public void startResponse()\n\t\t\t{\n\t\t\t\tsend(\"<response>\", false);\n\t\t\t}",
"void faild_response();",
"public void messageResp(int respId) {\n\r\n\t}",
"@Override\n\tpublic void processResponse(ResponseEvent responseEvent) {\n\t\tResponse response = responseEvent.getResponse();\n\t\ttry {\n\t\t\t// Display the response message in the text area.\n\t\t\t//printMessage(\"\\nReceived response: \" + response.toString());\n\n\t\t\tClientTransaction tid = responseEvent.getClientTransaction();\n\t\t\tCSeqHeader cseq = (CSeqHeader) response.getHeader(CSeqHeader.NAME);\n\t\t\tif (response.getStatusCode() == Response.OK) {\n\t\t\t\tif (cseq.getMethod().equals(Request.REGISTER)) {\n\t\t\t\t\tSystem.out.println(\"regist ACK OK\");\n\t\t\t\t\t//onInvite();\n\t\t\t\t} else if (cseq.getMethod().equals(Request.INVITE)) {\n\t\t\t\t\tDialog dialog = inviteTid.getDialog();\n\t\t\t\t\tRequest ackRequest = dialog.createAck(cseq.getSeqNumber());\n\t\t\t\t\tdialog.sendAck(ackRequest);\n\t\t\t\t\tSystem.out.println(\"Sending ACK\");\n\t\t\t\t} else if (cseq.getMethod().equals(Request.MESSAGE)) {\n\t\t\t\t\tSystem.out.println(\"Send OK !\");\n\t\t\t\t} else if (cseq.getMethod().equals(Request.CANCEL)) {\n\t\t\t\t\tSystem.out.println(\"Sending BYE -- cancel went in too late !!\");\n\t\t\t\t}\n\t\t\t} else if (response.getStatusCode() == Response.PROXY_AUTHENTICATION_REQUIRED\n\t\t\t\t\t|| response.getStatusCode() == Response.UNAUTHORIZED) {\n\t\t\t\tauthenticationHelper = ((SipStackExt) sipStack)\n\t\t\t\t\t\t.getAuthenticationHelper(new AccountManagerImpl(),\n\t\t\t\t\t\t\t\theaderFactory);\n\t\t\t\tinviteTid = authenticationHelper.handleChallenge(response, tid,\n\t\t\t\t\t\tsipProvider, 5);\n\t\t\t\tinviteTid.getRequest().addHeader(\n\t\t\t\t\t\theaderFactory.createExpiresHeader(3600));\n\t\t\t\tinviteTid.getRequest().setMethod(Request.REGISTER);\n\t\t\t\tinviteTid.sendRequest();\n\t\t\t\tinvco++;\n\t\t\t\tprintMessage(\"[processResponse] Request sent:\\n\" + inviteTid.getRequest().toString() + \"\\n\\n\");\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t\tSystem.exit(0);\n\t\t}\n\t}",
"@Override\r\n public void AjouterPropositionAReponse(long idP, long idR) {\r\n QuestionReponse r = questionReponseFacade.RechercherReponseParID(idR);\r\n QuestionProposition p = questionPropositionFacade.RechercherPropositionParID(idP);\r\n //questionReponseFacade.AjouterListPropositionAReponse(p, r);\r\n }",
"@Override\n public void onResponseSuccess(final String resp) {\n }",
"protected ACLMessage prepareResponse(ACLMessage msg) {\n ACLMessage reply = msg.createReply();\n try {\n Object contentRebut = (Object)msg.getContent();\n showMessage(\"RECIEVED \"+msg.getSender().getName() + \", \"+msg.getPerformative());\n if(contentRebut.equals(\"Movement request\")) {\n showMessage(\"Movement request received\");\n reply.setPerformative(ACLMessage.AGREE);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n showMessage(\"Answer sent Movement requet recieved\"); //: \\n\"+reply.toString());\n return reply;\n }",
"@Override\r\n\tprotected void processRespond() throws SGSException {\n\r\n\t}",
"@Override\n public void processResponse(ChannelSession chnl, TransportBuffer buffer)\n { \n if (buffer.length() < 40)\n return;\n \n outputString.delete(0, outputString.length());\n \n // If message, display which channel Session this is on\n for (int i = 0; i < channelSessions.size(); ++i)\n {\n if (channelSessions.get(i).channelInfo().channel() == ((EDFChannelSession)chnl).channelInfo().channel())\n {\n outputString.append(\"\\n<Realtime Channel \" + i + \"> \");\n break;\n }\n }\n \n // clear decode iterator\n dIter.clear();\n \n outputString.append(\"SEQ NO: \" + ((EDFChannelSession)chnl).channelInfo().readArgs().seqNum() + \" \");\n \n // set buffer and version info\n dIter.setBufferAndRWFVersion(buffer, chnl.channel().majorVersion(), chnl.channel()\n .minorVersion());\n\n int ret = responseMsg.decode(dIter);\n if (ret != CodecReturnCodes.SUCCESS)\n {\n System.out.println(\"\\nDecodeMsg(): Error \" + ret + \" on SessionData Channel=\"\n + chnl.channel().selectableChannel() + \" Size \"\n + (buffer.data().limit() - buffer.data().position()));\n closeChannel();\n System.exit(TransportReturnCodes.FAILURE);\n }\n\n ChannelInfo channelInfo = ((EDFChannelSession) chnl).channelInfo();\n\n for (ChannelInfo chanInfo : ((EDFChannelSession)chnl).channels())\n {\n if (chanInfo.connectOptions().unifiedNetworkInfo().address() == channelInfo.connectOptions().unifiedNetworkInfo().address() &&\n chanInfo.connectOptions().unifiedNetworkInfo().serviceName() == channelInfo.connectOptions().unifiedNetworkInfo().serviceName())\n {\n \n if ( channelInfo.readArgs().seqNum() > chanInfo.gapInfo().start + 1 && chanInfo.gapInfo().start != 0)\n {\n gapDetected = true;\n chanInfo.gapInfo().start = chanInfo.gapInfo().start + 1;\n chanInfo.gapInfo().end = channelInfo.readArgs().seqNum() - 1;\n }\n else\n {\n chanInfo.gapInfo().start = channelInfo.readArgs().seqNum();\n chanInfo.gapInfo().end = channelInfo.readArgs().seqNum();\n }\n \n // Check if address and port are on this gapInfo, if not, put it on based on channel's info\n if (chanInfo.gapInfo().address.data() == null)\n {\n chanInfo.gapInfo().address.data(channelInfo.connectOptions().unifiedNetworkInfo().address());\n chanInfo.gapInfo().port = Integer.valueOf(channelInfo.connectOptions().unifiedNetworkInfo().serviceName());\n }\n\n break;\n }\n }\n \n\n\n processResponse(chnl, responseMsg, dIter, outputString);\n }",
"private void remplissage() throws Exception\r\n\t\t{\r\n\t\tlistRequest.removeAll();\r\n\t\tfor(int i=0; i<itemList.size(); i++)\r\n\t\t\t{\r\n\t\t\tMainStatusLine msl = new MainStatusLine(itemList.get(i));\r\n\t\t\tmsl.setFond((i%2==0)?Color.WHITE:Color.LIGHT_GRAY);\r\n\t\t\tlineList.add(msl);\r\n\t\t\tlistRequest.add(msl);\r\n\t\t\t}\r\n\t\tthis.repaint();\r\n\t\tthis.validate();\r\n\t\t}",
"@Override\n\tpublic void afficherRendezvous(Rendezvous rv) {\n\t\tSystem.out.println(\"client à un nom: \" + rv.getNom());//affiche le nom du client\n\t\tSystem.out.println(\"l'heure du rendezvous est de ...a : \" + rv.getHeure());//affiche lheure du rendez vous du client\n\t\tSystem.out.println(\"le rendezvous aura lieu de .. a: \" + rv.getDate());//affiche la date du rendez vous\n\t\tSystem.out.println(\"le telephone du client du client est: \" + rv.getTelephone());//affiche le telephone du client\n\t\tSystem.out.println(\"le type de soin du client: \"+ rv.getSoins()); //affiche le type de soin du client\n\t\t// TODO Auto-generated method stub\n\n\t}",
"@Override\n\t\t\t\t\tpublic void onResponse(String s) {\n\t\t\t\t\t\t\n\t\t\t\t\t}",
"public void validaSeleciona_Base_SinistroPendente_Faixa(String ano, HttpServletResponse response) {\n\n\t\tVisaoExecutiva_Diaria_DAO dao = new VisaoExecutiva_Diaria_DAO();\n\t\tList<SinistroPendente_base_FaixaVO> lista = dao.seleciona_Base_SinistroPendente_Faixa(ano);\n\t\ttry {\n\t\t\t// Write the header line\n\t\t\tOutputStream out = response.getOutputStream();\n\t\t\tString header = \"LEGADO;ANOMES_REF;ORG;MOVIMENTO;RAMO;PROD;DIA;SINISTRO;APOLICE;COMUNICADO;OCORRENCIA;FAVORECIDO;VL_LIDER;VL_COSSEGURO;VL_RESSEGURO;VL_TOTAL;COD_OPERACAO;OPERACAO;FTE_PREM;FTE_AVIS;AVISO;SEGURADO;CAUSA;GRUPO_CAUSA;GRUPO;TIPO;FAIXA_DE_VALOR;DATA_AVISO;HOJE;TEMPO_PENDENTE;FAIXA_TEMPO_PENDENTE\\n\";\n\t\t\tout.write(header.getBytes());\n\t\t\t// Write the content\n\t\t\tfor (int i = 0; i < lista.size(); i++) {\n\n\t\t\t\tString line = new String(lista.get(i).getLEGADO() + \";\" + lista.get(i).getANOMES_REF() + \";\"\n\t\t\t\t\t\t+ lista.get(i).getORG() + \";\" + lista.get(i).getMOVIMENTO() + \";\" + lista.get(i).getRAMO() + \";\"\n\t\t\t\t\t\t+ lista.get(i).getPROD() + \";\" + lista.get(i).getDIA() + \";\" + lista.get(i).getSINISTRO() + \";\"\n\t\t\t\t\t\t+ lista.get(i).getAPOLICE() + \";\" + lista.get(i).getCOMUNICADO() + \";\"\n\t\t\t\t\t\t+ lista.get(i).getOCORRENCIA() + \";\" + lista.get(i).getFAVORECIDO() + \";\"\n\t\t\t\t\t\t+ lista.get(i).getVL_LIDER() + \";\" + lista.get(i).getVL_COSSEGURO() + \";\"\n\t\t\t\t\t\t+ lista.get(i).getVL_RESSEGURO() + \";\" + lista.get(i).getVL_TOTAL() + \";\"\n\t\t\t\t\t\t+ lista.get(i).getCOD_OPERACAO() + \";\" + lista.get(i).getOPERACAO() + \";\"\n\t\t\t\t\t\t+ lista.get(i).getFTE_PREM() + \";\" + lista.get(i).getFTE_AVIS() + \";\" + lista.get(i).getAVISO()\n\t\t\t\t\t\t+ \";\" + lista.get(i).getSEGURADO() + \";\" + lista.get(i).getCAUSA() + \";\"\n\t\t\t\t\t\t+ lista.get(i).getGRUPO_CAUSA() + \";\" + lista.get(i).getGRUPO() + \";\" + lista.get(i).getTIPO()\n\t\t\t\t\t\t+ \";\" + lista.get(i).getFAIXA_DE_VALOR() + \";\" + lista.get(i).getData_aviso() + \";\"\n\t\t\t\t\t\t+ lista.get(i).getHoje() + \";\" + lista.get(i).getTEMPO_PENDENTE() + \";\"\n\t\t\t\t\t\t+ lista.get(i).getFAIXA_TEMPO_PENDENTE() + \";\\n\");\n\t\t\t\tout.write(line.toString().getBytes());\n\n\t\t\t}\n\t\t\tout.flush();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"@Override\n\tpublic void processResponse(Response response)\n\t{\n\t\t\n\t}",
"protected ACLMessage prepareResponse(ACLMessage cfp) throws NotUnderstoodException, RefuseException {\n\t\t\tabrirFrame(subasta.getTituloLibro());\n\t\t\tguiSubasta.addMensaje(cfp.getSender().getLocalName()+\": \"+cfp.getContent());\n\t\t\tguiSubasta.addMensaje(\"Mi credito para esta subasta = \"+credito);\n\t\t\tACLMessage respuesta = cfp.createReply();\n\t\t\trespuesta.setPerformative(ACLMessage.PROPOSE);\n\t\t\trespuesta.setContent(\"\"+credito);\n\n\t\t\treturn respuesta;\n\t\t}",
"public com.example.DNSLog.Builder setRespp(java.lang.CharSequence value) {\n validate(fields()[4], value);\n this.respp = value;\n fieldSetFlags()[4] = true;\n return this;\n }",
"private String leerRespuestaApi(InputStream stream) throws IOException {\n //NECESITAMOS UN LECTOR DEL FLUJO\n BufferedReader buffer = new BufferedReader(new InputStreamReader(stream));\n //TENEMOS QUE LEER EL FLUJO Y PONER UN SEPARADOR DE ENTER\n //ENTRE LAS LINEAS\n String linea = \"\";\n //UN STRINGBUFFER SIRVE PARA LEER CONTENIDO MUY GRANDE\n StringBuffer data = new StringBuffer();\n //EL SEPARADOR DE ENTER DE CADA LINEA\n String separador = \"\";\n //MIENTRAS QUE EXISTAN LINEAS EN EL XML, DENTRO BUCLE\n while ((linea = buffer.readLine()) != null) {\n //AÑADIMOS EL CONTENIDO DE DATOS A DATA\n data.append(separador + linea);\n separador = \"\\n\";\n }\n //RECUPERAMOS LOS DATOS COMO STRING\n String response = data.toString();\n return response;\n }",
"@Override\n\t\t\t\t\t\tpublic void onResponse(String response) {\n\t\t\t\t\t\t\tparseRespense(response);\n\t\t\t\t\t\t}",
"private void onValider() {\n recuperation(Reponse.getText());\r\n\r\n }",
"private void trappingResponse(ComputingResponse resp, long sourceIF, long destIF){\n\n\t\tlog.info(\"First ERO SubObject type \"+resp.getResponseList().get(0).getPath(0).geteRO().getEROSubobjectList().getFirst().getClass());\n\t\tlog.info(\"Second ERO SubObject type \"+resp.getResponseList().get(0).getPath(0).geteRO().getEROSubobjectList().get(1).getClass());\n\t\tlog.info(\"Last ERO SubObject type \"+resp.getResponseList().get(0).getPath(0).geteRO().getEROSubobjectList().getLast().getClass());\n\t\tInet4Address firstIP=((UnnumberIfIDEROSubobject)resp.getResponseList().get(0).getPath(0).geteRO().getEROSubobjectList().getFirst()).getRouterID();\n\n\t\tEROSubobject label= resp.getResponseList().get(0).getPath(0).geteRO().getEROSubobjectList().get(1);\n\t\tresp.getResponseList().get(0).getPath(0).geteRO().getEROSubobjectList().add(0, label);\n\n\t\tUnnumberIfIDEROSubobject firsteroso= new UnnumberIfIDEROSubobject();\n\t\tfirsteroso.setRouterID(firstIP);\n\t\tfirsteroso.setInterfaceID(sourceIF);\n\t\tfirsteroso.setLoosehop(false);\n\t\tresp.getResponseList().get(0).getPath(0).geteRO().getEROSubobjectList().add(0, firsteroso);\n\n\n\t\tint size=resp.getResponseList().get(0).getPath(0).geteRO().getEROSubobjectList().size();\n\t\tInet4Address lastIP=((IPv4prefixEROSubobject)resp.getResponseList().get(0).getPath(0).geteRO().getEROSubobjectList().getLast()).getIpv4address();\n\t\tresp.getResponseList().get(0).getPath(0).geteRO().getEROSubobjectList().removeLast();\n\t\tUnnumberIfIDEROSubobject lasteroso= new UnnumberIfIDEROSubobject();\n\t\tlasteroso.setRouterID(lastIP);\n\t\tlasteroso.setInterfaceID(destIF);\n\t\tlasteroso.setLoosehop(false);\n\t\tresp.getResponseList().get(0).getPath(0).geteRO().getEROSubobjectList().add(lasteroso);\n\t\tresp.getResponseList().get(0).getPath(0).geteRO().getEROSubobjectList().add(label);\n\t}",
"public abstract void indicarRespuesta(CombinacionRespuesta combinacionAdversario);",
"public Respuesta addRespuesta(String resp, Pregunta p, Usuario autor);",
"@Override\n public void onResponse(String response) {\n System.out.print(\"respuesta Server\"+response);\n responseRequest(sync_id);\n /*if (sync_id != 0) {\n responseRequest(sync_id);\n } else {\n background_response = \"ID Sync null\";\n restartRequest(background_response);\n }*/\n }",
"private static void readResponse(ClientResponse response)\r\n\t{\r\n\t// Response\r\n\tSystem.out.println();\r\n\tSystem.out.println(\"Response: \" + response.toString());\r\n\r\n\t}",
"public String receiveResponse()\n\t{\n\t\t\n\t}",
"@Override\n protected void doGet(HttpServletRequest requete, HttpServletResponse reponse) throws ServletException, IOException {\n Integer idSousTournoiRecherche = tentativeRecuperationIdSousTournoi(requete);\n if (idSousTournoiRecherche == null){\n envoyerReponseMauvaisId(reponse);\n }\n else{\n SousTournoiDto sousTournoiTrouve = sousTournoiService.consulterSousTournoiSeul(idSousTournoiRecherche);\n if(sousTournoiTrouve != null){\n envoyerReponseRecuperationSousTournoi(sousTournoiTrouve, reponse);\n }\n else{\n envoyerReponseSousTournoiIntrouvable(reponse);\n }\n }\n }",
"@Test\n\tpublic void driverRespuestaDeChirp() {\n\t\tfinal Object testingData[][] = {\n\t\t\t{\n\t\t\t\t\"chorbi1\", \"Envio1\", \"text1\", 287, null\n\t\t\t}, {\n\t\t\t\t\"manager1\", \"Envio4\", \"text4\", 279, IllegalArgumentException.class\n\t\t\t}, {\n\t\t\t\t\"chorbi1\", \"Envio1\", \"\", 287, ConstraintViolationException.class\n\t\t\t}, {\n\t\t\t\t\"chorbi1\", \"Envio2\", \"text1\", 280, IllegalArgumentException.class\n\t\t\t}\n\t\t};\n\n\t\tfor (int i = 0; i < testingData.length; i++)\n\t\t\tthis.respuestaDeChirp((String) testingData[i][0], (String) testingData[i][1], (String) testingData[i][2], (int) testingData[i][3], (Class<?>) testingData[i][4]);\n\t}",
"@Override\n public void onMoveLegResponse(MoveLegResponse ind) {\n\n }",
"@Override\n\tpublic void offLineResult(Pair<Boolean, Object> res, int offLineRequestType) {\n\t\tLog.i(TAG, \"offLineResult()offLineRequestType:\" + offLineRequestType\n\t\t\t\t+ \",res.second\" + (res.second != null));\n\t\tif (res.first) {\n\t\t\toffLineToast(getString(R.string.save_success));\n\t\t\tfinish();\n\t\t} else {\n\t\t\toffLineToast((String) res.second);\n\t\t}\n\t}",
"@Override\n public void onResponse(String response)\n {\n httpReturn.setText(\"RESPOSTA:\\n\" + response.toString());\n httpReturn.setTextColor(Color.BLUE);\n httpReturn.setTextSize((float) 22.5);\n }",
"public void impostaDatiDaResponseESessione(RicercaDettaglioMassivaCapitoloEntrataPrevisioneResponse response, SessionHandler sessionHandler) {\n\t\t// Dovrebbe essere l'unico capitolo presente\n\t\tCapitoloMassivaEntrataPrevisione capitoloInResponse = response.getCapitoloMassivaEntrataPrevisione();\n\t\t\n\t\t//Popolamento dei campi\n\t\tcapitoloEntrataPrevisione = capitoloInResponse;\n\t\t\n\t\t/* Ottenuti dalla sessione */\n\t\timpostaLabelDaSessione(sessionHandler);\n\t\t\n\t\t// Classificatori\n\t\tsetTipoFinanziamento(capitoloInResponse.getTipoFinanziamento());\n\t\tsetTipoFondo(capitoloInResponse.getTipoFondo());\n\t\timpostaClassificatoriGenericiDaLista(capitoloInResponse.getListaClassificatori());\n\t\t\n\t\timpostaImportiCapitoloEntrataPrevisione(capitoloInResponse.getListaImportiCapitoloEP());\n\t\t\n\t\tsetTitoloEntrata(capitoloInResponse.getTitoloEntrata());\n\t\tsetTipologiaTitolo(capitoloInResponse.getTipologiaTitolo());\n\t\tsetCategoriaTipologiaTitolo(capitoloInResponse.getCategoriaTipologiaTitolo());\n\t\tsetStrutturaAmministrativoContabile(capitoloInResponse.getStrutturaAmministrativoContabile());\n\t\tsetElementoPianoDeiConti(capitoloInResponse.getElementoPianoDeiConti());\n\t\t\n\t\tsetSiopeEntrata(capitoloInResponse.getSiopeEntrata());\n\t\tsetRicorrenteEntrata(capitoloInResponse.getRicorrenteEntrata());\n\t\tsetPerimetroSanitarioEntrata(capitoloInResponse.getPerimetroSanitarioEntrata());\n\t\tsetTransazioneUnioneEuropeaEntrata(capitoloInResponse.getTransazioneUnioneEuropeaEntrata());\n\t\t\n\t\tlistaUEBCollegate = ElementoCapitoloFactory.getInstances(response.getCapitoloMassivaEntrataPrevisione().getElencoCapitoli(), false, isGestioneUEB());\n\t}",
"public interface Response extends Message\n\t{\n public static final String RESPONSE_TO = \"aether.response.response-to\";\n\t}",
"public void setResph(java.lang.CharSequence value) {\n this.resph = value;\n }",
"@Override\n public ResponseInput generateResponseMessage() throws IllegalStateException {\n char asw=0;\n if (!responseIsReady)\n throw new IllegalStateException(\"Input non ancora presi\");\n\n return new ResponseRespawn(targetSpawnPoint);\n }",
"<TEntite> void envoiReponseAvecDonnees(ArrayList<TEntite> listeEntites, HttpServletResponse reponse, int codeDeStatutHttp, String message) throws IOException;",
"public java.lang.CharSequence getResph() {\n return resph;\n }",
"@Override\n\t\t\t\t\tpublic void onResponse(String response) {\n\n\t\t\t\t\t}",
"protected void handleAllResponses(Vector respuestas, Vector aceptadas){\n\t\t\tint nPujas = 0;\n\t\t\t//String pujas = getPujas(respuestas);\n\n\t\t\tfor(Object resp : respuestas){\n\t\t\t\tACLMessage mensaje = (ACLMessage) resp;\n\n\t\t\t\tif(mensaje.getPerformative() == ACLMessage.PROPOSE){\t// Si los mensajes son proposiciones\n\t\t\t\t\tACLMessage respuesta = mensaje.createReply();\n\n\t\t\t\t\tint puja = Integer.parseInt(mensaje.getContent());\n\n\t\t\t\t\tif(puja >= subasta.getPrecioActual()){\t\t\t\t// El credito del comprador es superior al pedido en la puja - PUJA\n\t\t\t\t\t\trespuesta.setPerformative(ACLMessage.ACCEPT_PROPOSAL);\n\t\t\t\t\t\t// Se le envia la informacion de las pujas a cada comprador\n\t\t\t\t\t\trespuesta.setContent(getPujas(respuestas, mensaje.getSender()));\n\t\t\t\t\t\tSystem.out.println(myAgent.getLocalName()+\": \"+mensaje.getSender().getLocalName()+\" ha pujado\");\n\t\t\t\t\t\tabrirFrame(subasta.getTituloLibro());\n\t\t\t\t\t\tguiSubasta.addMensaje(mensaje.getSender().getLocalName()+\" ha pujado\");\n\n\t\t\t\t\t\tif(nPujas == 0) subasta.setGanador(mensaje.getSender());\n\t\t\t\t\t\tnPujas++;\n\n\t\t\t\t\t}else{\t\t\t\t\t\t\t\t\t\t\t\t// El credito del comprador es inferior al pedido - NO PUEDE PUJAR\n\t\t\t\t\t\trespuesta.setPerformative(ACLMessage.REJECT_PROPOSAL);\t\n\t\t\t\t\t\trespuesta.setContent(\"Su puja ha sido rechazada\");\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\taceptadas.add(respuesta);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(nPujas <= 1){\n\t\t\t\tsubasta.terminada(true);\n\t\t\t}\n\t\t}",
"public void validaSeleciona_Base_SinistrosCompleta(String ano, HttpServletResponse response) {\n\n\t\tVisaoExecutiva_Diaria_DAO dao = new VisaoExecutiva_Diaria_DAO();\n\n\t\tList<Sinistros_base_VO> lista = dao.seleciona_Base_sinistroCompleta(ano);\n\t\ttry {\n\t\t\t// Write the header line\n\t\t\tOutputStream out = response.getOutputStream();\n\t\t\tString header = \"LEGADO;ANOMES_REF;ORG;MOVIMENTO;RAMO;PROD;DIA;SINISTRO;APOLICE;COMUNICADO;OCORRENCIA;FAVORECIDO;VL_LIDER;VL_COSSEGURO;VL_RESSEGURO;VL_TOTAL;COD_OPERACAO;OPERACAO;FTE_PREM;FTE_AVIS;AVISO;SEGURADO;CAUSA;GRUPO_CAUSA\\n\";\n\t\t\tout.write(header.getBytes());\n\t\t\t// Write the content\n\t\t\tfor (int i = 0; i < lista.size(); i++) {\n\n\t\t\t\tString line = new String(lista.get(i).getLEGADO() + \";\" + lista.get(i).getANOMES_REF() + \";\"\n\t\t\t\t\t\t+ lista.get(i).getORG() + \";\" + lista.get(i).getMOVIMENTO() + \";\" + lista.get(i).getRAMO() + \";\"\n\t\t\t\t\t\t+ lista.get(i).getPROD() + \";\" + lista.get(i).getDIA() + \";\" + lista.get(i).getSINISTRO() + \";\"\n\t\t\t\t\t\t+ lista.get(i).getAPOLICE() + \";\" + lista.get(i).getCOMUNICADO() + \";\"\n\t\t\t\t\t\t+ lista.get(i).getOCORRENCIA() + \";\" + lista.get(i).getFAVORECIDO() + \";\"\n\t\t\t\t\t\t+ lista.get(i).getVL_LIDER() + \";\" + lista.get(i).getVL_COSSEGURO() + \";\"\n\t\t\t\t\t\t+ lista.get(i).getVL_RESSEGURO() + \";\" + lista.get(i).getVL_TOTAL() + \";\"\n\t\t\t\t\t\t+ lista.get(i).getCOD_OPERACAO() + \";\" + lista.get(i).getOPERACAO() + \";\"\n\t\t\t\t\t\t+ lista.get(i).getFTE_PREM() + \";\" + lista.get(i).getFTE_AVIS() + \";\" + lista.get(i).getAVISO()\n\t\t\t\t\t\t+ \";\" + lista.get(i).getSEGURADO() + \";\" + lista.get(i).getCAUSA() + \";\"\n\t\t\t\t\t\t+ lista.get(i).getGRUPO_CAUSA() + \";\\n\");\n\t\t\t\tout.write(line.toString().getBytes());\n\n\t\t\t}\n\t\t\tout.flush();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"@Override\n\t\t\t\tpublic void onResponse(String arg0) {\n\t\t\t\t\tSystem.out.println(arg0);\n\t\t\t\t\t\n\t\t\t\t}",
"@Override\n public void atacar(Jinete jinete, Pieza receptor) {\n }",
"private void serviceResponser(ServiceJSResponse sresp, HttpServletResponse resp) throws Exception {\r\n\t\tString ret = \"\";\r\n\t\tswitch (sresp.getFormat()) {\r\n\t\t\tcase XML:\r\n\t\t\t\tret = new GenerateXmlWithCDATA().generate(sresp.getData());\r\n\t\t\t\tresp.setContentType(\"text/xml\");\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tresp.setContentLength(ret.length());\r\n\t\tresp.getWriter().println(ret);\r\n\t\tresp.getWriter().close();\r\n\t}",
"public void setResponseView(String message){\n messageStatusView.append(message);\n messageStatusView.append(\"\\n\");\n }",
"@Override\n protected void doPut(HttpServletRequest requete, HttpServletResponse reponse) throws ServletException, IOException {\n Integer idSousTournoiAValider = tentativeRecuperationIdSousTournoi(requete);\n if (idSousTournoiAValider == null){\n envoyerReponseMauvaisId(reponse);\n }\n else{\n SousTournoiSimplifieDto sousTournoiValide = sousTournoiService.validerSousTournoi(idSousTournoiAValider);\n if(sousTournoiValide != null){\n envoyerReponseRecuperationSousTournoiSimplifie(sousTournoiValide, reponse);\n }\n else{\n envoyerReponseSousTournoiIntrouvable(reponse);\n }\n }\n }",
"public void endResponse()\n\t\t\t{\n\t\t\t\tsend(\"</response>\", false);\n\t\t\t}",
"public void setRespuesta(int Respuesta) {\n iRespuesta = Respuesta;\n }",
"public Object handleCommandResponse(Object response) throws RayoProtocolException;",
"public void tractaResposta(String s) throws IOException {\n if (s.equals(\"OK\")){\n ResponseSuccess = true;\n }else{\n KOMessage = diStream.readUTF();\n ResponseSuccess = false;\n }\n }",
"public void sendArpResponse(Packet packet) {\n Packet p = new Packet();\n Ethernet e = Ethernet.makeArpEthernet();\n e.setSrcMac(this.getMacAddress());\n e.setDestMac(packet.getSrcMac());\n p.setL2(e);\n\n Arp arp = Arp.makeArpResponse();\n arp.setSendIp(((Arp) packet.getL3()).getRecvIp());\n arp.setRecvIp(((Arp) packet.getL3()).getSendIp());\n arp.setSendMac(this.getMacAddress());\n arp.setRecvMac(packet.getSrcMac());\n p.setL3(arp);\n this.handleOut(packet);\n }",
"public void endResponse() throws IOException {\n out.println();\n //out.println(\"--End\");\n out.flush();\n endedLastResponse = true;\n }",
"public java.lang.CharSequence getResph() {\n return resph;\n }",
"protected ACLMessage prepareResultNotification(ACLMessage msg, ACLMessage response) {\n ACLMessage reply = msg.createReply();\n reply.setPerformative(ACLMessage.INFORM);\n \n Object content = (Object)msg.getContent();\n \n // Prepare response for a ships movement request\n if(content.equals(\"Movement request\")){\n prepareMovementResultNotitication(reply);\n \n // Prepare response for a start negotiation requests\n }else if(content.equals(\"Negotiation request\")){\n \n }\n \n showMessage(\"Answer sent inform movement\"); //+reply.toString());\n return reply;\n\n }",
"@Override\n public void onResponse(String response) {\n Log.i(\"Checking\", response + \" \");\n if(new ServerReply(response).getStatus())\n {\n Toast.makeText(context,new ServerReply(response).getReason(),Toast.LENGTH_LONG).show();\n }\n\n }",
"@Override\n public void onServerResponse(Object json) {\n runOnUiThread(() -> {\n loadRaters();\n ((TextView) findViewById(R.id.labelmenos1)).setText(\"Seleccione un evaluador de la lista a continuación\");\n });\n scrollDown();\n }",
"@Override\n\tpublic void visit(Request r) {\n\t\tif (!ph.getPeerChoked()) {\n\t\t\tSystem.out.println(\"requete rećue\");\n\t\t\tbyte[] body = r.getBody();\n\t\t\tbyte[] indexB = new byte[4], beginB = new byte[4], lengthB = new byte[4];\n\t\t\tTorrent torrent = ph.getTorrent();\n\t\t\tint index = 0, begin = 0, length = 0;\n\n\t\t\tindexB = Arrays.copyOfRange(body, 0, 4);\n\t\t\tindex = byteArrayToInt(indexB);\n\n\t\t\tbeginB = Arrays.copyOfRange(body, 4, 8);\n\t\t\tbegin = byteArrayToInt(beginB);\n\n\t\t\tlengthB = Arrays.copyOfRange(body, 8, body.length);\n\t\t\tlength = byteArrayToInt(lengthB);\n\n\t\t\tPiece piece = torrent.getPieces().get(index);\n\t\t\tif (index <= torrent.getPieces().size()) {\n\t\t\t\tbyte[] block = new byte[length];\n\t\t\t\tbyte[] pieceByte = piece.getData();\n\t\t\t\tfor (int i = 0; i < length; i++) {\n\t\t\t\t\tblock[i] = pieceByte[begin + i];\n\t\t\t\t}\n\t\t\t\tsb = new SendBlock(index, begin, block);\n\t\t\t\tthis.ph.addMessageQueue(sb);\n\t\t\t\tSystem.out.println(\"sendBlock envoyé\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Index trop grand\");\n\t\t\t}\n\t\t}\n\t}",
"public abstract boolean repOk();",
"private void __getReply() throws IOException\n {\n __getReply(true); // tagged response\n }",
"@Override\n protected boolean processReceivedLine(String fullLine, String header, String value, boolean moreAvailable) throws Exception {\n if (getResponseStarted() && mFileLinesHaveStarted) {\n // Look for end marker\n if (\"AE\".equals(header)) {\n mFileLinesHaveStarted = false;\n } else if (getFileLineReceivedDelegate() != null) {\n // Allow delegate to see the line\n getFileLineReceivedDelegate().fileLineReceived(fullLine, moreAvailable);\n }\n\n // Consume all the lines\n return true;\n } else {\n if (super.processReceivedLine(fullLine, header, value, moreAvailable)) {\n return true;\n } else if (this.getResponseStarted()) {\n if (\"AB\".equals(header)) {\n mFileLinesHaveStarted = true;\n } else {\n return false;\n }\n\n return true;\n }\n }\n\n return false;\n }",
"@Override\n public void onResponse(Response response) throws IOException {\n }",
"@CommandDescription(name=\"importFuncionarioResponse\", kind=CommandKind.ResponseCommand, requestPrimitive=\"importFuncionarioResponse\")\npublic interface ImportFuncionarioResponse extends MessageHandler {\n\n\tvoid importFuncionarioResponse(ImportFuncionarioOutput response);\n\t\n\tvoid importFuncionarioResponseError(ErrorPayload error);\n\n}",
"@Override\n\tpublic void handleResponse() {\n\t\t\n\t}",
"@Override\n public void onResponse(String response)\n {\n\n }",
"protected void fakeResponse(\n StatusLine statusline, \n HeaderGroup responseheaders,\n InputStream responseStream\n ) {\n // set used so that the response can be read\n this.used = true;\n this.statusLine = statusline;\n this.responseHeaders = responseheaders;\n this.responseBody = null;\n this.responseStream = responseStream;\n }",
"int postProcessREPLResponse(String received, Appendable error) {\n if (DEBUG) {\n System.out.println(\"Received from phone: \\\"\" + received + \"\\\"\");\n }\n int responsesFound = 0; // Just for sanity testing\n leftOver.append(received);\n String candidate = leftOver.toString();\n while (true) {\n Matcher completeResponse = grossResponseP.matcher(candidate);\n if (!completeResponse.find()) {\n leftOver.setLength(0);\n leftOver.append(candidate);\n return responsesFound;\n }\n responsesFound++;\n candidate = candidate.substring(completeResponse.end());\n checkNoise(completeResponse.group(1), error);\n parseAndSendResponse(completeResponse.group(2), error);\n }\n }",
"@Override\n public void onResponse(JSONObject response) {\n Log.e(\"puto\",\"PRECEOSA \");\n procesarRespuesta(response);\n\n Log.e(\"puto\",\"respuetsa -\"+response);\n }",
"@Override\n\tpublic boolean repOk() {\n\t\treturn true;\n\t}",
"@Override\r\n\tpublic void service(Request request,Response response) {\n\t\tresponse.print(\"lalaa\");\r\n\r\n\t\t\r\n\t}",
"private void confirmarVentaRespuesta(final TransaccionCelda resp) {\n final ConfirmarVentaMapaDatos datos = service.getDatosConfirmar();\n respImprimir = resp;\n service.setDatosConfirmar(null);\n mostrarMensaje(getString(R.string.msg_venta_paquete_exitoso, datos.getPlaca()));\n contenedorBotonVenta.setVisibility(View.GONE);\n contenedorBotonImpresion.setVisibility(View.VISIBLE);\n final double costoTotal = service.getCostoTotal(resp);\n final String auditoria = getString(\n R.string.msg_venta_paquete_auditoria,\n datos.getZona().getNombre(), datos.getTarifa().getNombre(),\n datos.getPlaca(), format.formatearDecimal(costoTotal));\n AppLog.debug(TAG, \"Auditoría: %s\", auditoria);\n final String pin = String.valueOf(resp.getId());\n subscribeSinProcesando(api.auditoria(getIdUsuario(), \"Compra pin\", \"Pin de transito\",\n pin, \"App movil\", auditoria, String.valueOf(datos.getZona().getId()),\n datos.getPlaca(), Constantes.AUDITORIA_VACIO, Constantes.AUDITORIA_VACIO),\n this::respuestaAuditoria);\n }",
"@Override\n public void onResponse(String response) {\n }",
"@Override\n public void onResponse(String response) {\n }",
"@Override\n public void onResponse(String response) {\n }",
"@Override\n public void onResponse(String response) {\n }",
"@Override\n\t\t\tprotected void deliverResponse(String response) {\n\n\t\t\t}",
"public void txtResponse(String response , Player player);",
"private void reply(HttpServletRequest request, HttpServletResponse response) throws IOException {\n\t\tint id = Integer.parseInt(request.getParameter(\"id\"));\r\n\t\tcomplainVo complainVo = new complainVo();\r\n\t\tcomplainVo.setComplainId(id);\r\n\t\tcomplainDao complainDao = new complainDao();\r\n\t\tList ls = complainDao.edit(complainVo);\r\n\t\tHttpSession session = request.getSession();\r\n\t\tsession.setAttribute(\"replyList\", ls);\r\n\t\t\r\n\t\tresponse.sendRedirect(\"Admin/replyComplain.jsp\");\r\n\t}",
"@Override\n public void onResponse(String response) {\n }",
"@Override\r\n\tprotected void processOk() {\n\t\tboolean isExito = consultarSustentoProxy.isExito();\r\n\t\tif (isExito) {\r\n\t\t\tint status = consultarSustentoProxy.getResponse().getStatus();\r\n\t\t\tif (status == 0) {\r\n\t\t\t\tList<SustentoTO> sustento = consultarSustentoProxy.getResponse().getListaSustento();\r\n\t\t\t\tadap = new EfficientAdapter(this, sustento);\r\n\t\t\t\tsetListAdapter(adap);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tshowToast(consultarSustentoProxy.getResponse().getDescripcion());\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tprocessError();\r\n\t\t}\r\n\t\tsuper.processOk();\r\n\t}",
"public void appendMessage(String response) {\n\t\tthis.append(response + newline);\n\t}",
"void responseSent( C conn ) ;",
"public pam_response(Pointer src) {\n useMemory(src);\n read();\n }",
"private void contractNetRespond() {\n\t\t\n\t\tMessageTemplate template = MessageTemplate.and(\n\t\t\t\tMessageTemplate.MatchProtocol(FIPANames.InteractionProtocol.FIPA_CONTRACT_NET),\n\t\t\t\tMessageTemplate.MatchPerformative(ACLMessage.CFP));\n\n\t\taddBehaviour(new ParkingLotBehavior(this, template));\n\t}",
"@Override\n public void onResponse(String response) {\n System.out.println(\"Recieved Response: \" + response);\n }",
"@Override\r\n\t\t\tpublic void sendResponse(String string) {\n\t\t\t\t\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void sendResponse(String string) {\n\t\t\t\t\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void sendResponse(String string) {\n\t\t\t\t\r\n\t\t\t}"
] | [
"0.6062228",
"0.6062228",
"0.5885069",
"0.58318913",
"0.58119243",
"0.5762904",
"0.5750488",
"0.57383215",
"0.5712672",
"0.5690476",
"0.5686342",
"0.5682495",
"0.56654465",
"0.5662064",
"0.562877",
"0.5619863",
"0.559009",
"0.55633295",
"0.5557388",
"0.55358374",
"0.5531772",
"0.5525684",
"0.5513393",
"0.55107325",
"0.54968977",
"0.5467111",
"0.5463874",
"0.5461561",
"0.54135644",
"0.54038125",
"0.5400334",
"0.5400302",
"0.53879654",
"0.53870875",
"0.5385327",
"0.53851366",
"0.53623897",
"0.5359326",
"0.5349643",
"0.5349575",
"0.53407216",
"0.53378254",
"0.53333575",
"0.53177387",
"0.5314485",
"0.5310869",
"0.53029186",
"0.5294231",
"0.52936566",
"0.5292117",
"0.52823526",
"0.52755994",
"0.5272217",
"0.5267469",
"0.52598405",
"0.5255356",
"0.5254322",
"0.5253919",
"0.5244117",
"0.52395743",
"0.52357864",
"0.5231547",
"0.522844",
"0.52235186",
"0.5222087",
"0.52210623",
"0.52114916",
"0.5203896",
"0.52024275",
"0.5200188",
"0.519919",
"0.5195401",
"0.5192415",
"0.51879704",
"0.517335",
"0.51688147",
"0.5167938",
"0.5162078",
"0.51610327",
"0.5159858",
"0.5158928",
"0.5154217",
"0.51531845",
"0.51502526",
"0.51502526",
"0.51502526",
"0.5148313",
"0.5144472",
"0.51441574",
"0.5144108",
"0.51417047",
"0.51343966",
"0.51299673",
"0.51246166",
"0.51233864",
"0.51114875",
"0.5107455",
"0.510639",
"0.510639",
"0.510639"
] | 0.6809884 | 0 |
The exception driven method implementation. | public List<String> readKeysFromMissingObjects_Original(List<String> objectIDs) {
List<String> resultSet = new ArrayList<>();
for (String objectIDString : objectIDs) {
try {
Long objectID = Long.valueOf(objectIDString);
IdentifiableManager.current().getIdentifiable(objectID);
} catch (IdentifiableNotFoundException e) {
resultSet.add(objectIDString);
} catch (NumberFormatException e) {
//ignore, not an objectID
}
}
return resultSet;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void doException() {\n\r\n\t}",
"protected abstract void exceptionsCatching( ExceptionType exceptionType );",
"void mo57276a(Exception exc);",
"public abstract void onException(Exception e);",
"@Override\n\t\tpublic void onException(Exception arg0) {\n\t\t\t\n\t\t}",
"protected abstract void onException(final Exception exception);",
"@Override\n\t\t\tpublic void onException(Exception arg0) {\n\n\t\t\t}",
"public interface RoutineException {}",
"protected void connectionException(Exception exception) {}",
"@Override\r\n public void onException(Exception arg0) {\n\r\n }",
"@Override\n public void onException(Exception arg0) {\n }",
"void dispatchException(Throwable exception);",
"@Override\n\tpublic void onException(Exception e) {\n\n\t}",
"void onException(Exception e);",
"void handleError(Exception ex);",
"@Override\n\tpublic void exucute() {\n\t\t\n\t}",
"public interface ExceptionHandler\n{\n //TODO not sure how to handle this\n}",
"public void toss(Exception e);",
"void failed (Exception e);",
"public void onException(Exception ex) {\n \t\t\t}",
"void exceptionCaught(Throwable cause) throws Exception;",
"void exceptionCaught(Throwable cause) throws Exception;",
"public void throwException()\n\t{\n\t\tthrow new RuntimeException(\"Dummy RUNTIME Exception\");\n\t}",
"public void handle() throws Exception {}",
"@Override\n\tpublic void exceptionHandler(Handler<Exception> handler) {\n\t\t\n\t}",
"private static void throwException() throws Exception {\n\t\tthrow new Exception();\r\n\t}",
"void throwEvents();",
"@Override\n\tpublic void exceptionCaught(IoSession arg0, Throwable arg1)\n\t\t\tthrows Exception {\n\n\t}",
"private static Exception method_7085(Exception var0) {\r\n return var0;\r\n }",
"public static void test() throws Exception {\n\t}",
"public FaultException raise(Throwable e);",
"@Override\n\tpublic void demoCheckedException() throws IOException {\n\n\t}",
"@Override\n\tpublic void catching(Throwable t) {\n\n\t}",
"public void inquiryError() {\n\t\t\n\t}",
"private void inizia() throws Exception {\n }",
"private void inizia() throws Exception {\n }",
"private void inizia() throws Exception {\n }",
"private void inizia() throws Exception {\n }",
"private void inizia() throws Exception {\n }",
"public interface ExceptionHandler {\n public void onException(Exception e);\n}",
"void Crash(T ex) throws T;",
"String getException();",
"String getException();",
"ExceptionEvaluationCondition getException();",
"protected void runTest() throws Throwable {\n\t\t\t\t\t\t\t\tthrow e;\n\t\t\t\t\t\t\t}",
"public Exception getException ()\n {\n return exception;\n }",
"public abstract void Test() throws Exception;",
"@Override\n\tpublic void processIOException(IOExceptionEvent exceptionEvent) {\n\t}",
"public void excavate();",
"void L3() throws Exception{\n\t\tSystem.out.println(\"1\");\n\t\tthrow e;\n\t}",
"public abstract void doSomething() throws Exception;",
"abstract void onError(Exception e);",
"public void error(Exception e);",
"public void socketException(PacketChannel pc, Exception ex);",
"@Override\n\t\t\t\t\t\tpublic void onFailure(Method method, Throwable exception) {\n\n\t\t\t\t\t\t}",
"@Override\n\tprotected Respond exceptHandle(Exception e) {\n\t\treturn SqlTool.normalExceptionDeal(new RspSingleRow(), e);\n\t}",
"@Override\n\t\t\t\t\t\t\tpublic void error(Exception e) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}",
"@Override\n protected boolean shouldSendThrowException() {\n return false;\n }",
"UsedExceptions getExceptions();",
"abstract void run() throws Exception;",
"public void onException(RequestException e);",
"void handleException(Context context, Throwable exc, String description);",
"@Override\n\tpublic void demoRunTimeException() throws RuntimeException {\n\n\t}",
"Throwable cause();",
"private V e() throws com.amap.api.col.n3.gh {\n /*\n r6 = this;\n r0 = 0\n r1 = 0\n L_0x0002:\n int r2 = r6.b\n if (r1 >= r2) goto L_0x00cd\n com.amap.api.col.n3.ki r2 = com.amap.api.col.n3.ki.c() // Catch:{ ic -> 0x0043, gh -> 0x0032, Throwable -> 0x002a }\n android.content.Context r3 = r6.d // Catch:{ ic -> 0x0043, gh -> 0x0032, Throwable -> 0x002a }\n java.net.Proxy r3 = com.amap.api.col.n3.ik.a(r3) // Catch:{ ic -> 0x0043, gh -> 0x0032, Throwable -> 0x002a }\n r6.a((java.net.Proxy) r3) // Catch:{ ic -> 0x0043, gh -> 0x0032, Throwable -> 0x002a }\n byte[] r2 = r2.a((com.amap.api.col.n3.kj) r6) // Catch:{ ic -> 0x0043, gh -> 0x0032, Throwable -> 0x002a }\n java.lang.Object r2 = r6.a((byte[]) r2) // Catch:{ ic -> 0x0043, gh -> 0x0032, Throwable -> 0x002a }\n int r0 = r6.b // Catch:{ ic -> 0x0025, gh -> 0x0020, Throwable -> 0x002a }\n r1 = r0\n r0 = r2\n goto L_0x0002\n L_0x0020:\n r0 = move-exception\n r5 = r2\n r2 = r0\n r0 = r5\n goto L_0x0033\n L_0x0025:\n r0 = move-exception\n r5 = r2\n r2 = r0\n r0 = r5\n goto L_0x0044\n L_0x002a:\n com.amap.api.col.n3.gh r0 = new com.amap.api.col.n3.gh\n java.lang.String r1 = \"未知错误\"\n r0.<init>(r1)\n throw r0\n L_0x0032:\n r2 = move-exception\n L_0x0033:\n int r1 = r1 + 1\n int r3 = r6.b\n if (r1 < r3) goto L_0x0002\n com.amap.api.col.n3.gh r0 = new com.amap.api.col.n3.gh\n java.lang.String r1 = r2.a()\n r0.<init>(r1)\n throw r0\n L_0x0043:\n r2 = move-exception\n L_0x0044:\n int r1 = r1 + 1\n int r3 = r6.b\n if (r1 >= r3) goto L_0x008a\n int r3 = r6.e // Catch:{ InterruptedException -> 0x0053 }\n int r3 = r3 * 1000\n long r3 = (long) r3 // Catch:{ InterruptedException -> 0x0053 }\n java.lang.Thread.sleep(r3) // Catch:{ InterruptedException -> 0x0053 }\n goto L_0x0002\n L_0x0053:\n java.lang.String r0 = \"http连接失败 - ConnectionException\"\n java.lang.String r1 = r2.getMessage()\n boolean r0 = r0.equals(r1)\n if (r0 != 0) goto L_0x0082\n java.lang.String r0 = \"socket 连接异常 - SocketException\"\n java.lang.String r1 = r2.getMessage()\n boolean r0 = r0.equals(r1)\n if (r0 != 0) goto L_0x0082\n java.lang.String r0 = \"服务器连接失败 - UnknownServiceException\"\n java.lang.String r1 = r2.getMessage()\n boolean r0 = r0.equals(r1)\n if (r0 == 0) goto L_0x0078\n goto L_0x0082\n L_0x0078:\n com.amap.api.col.n3.gh r0 = new com.amap.api.col.n3.gh\n java.lang.String r1 = r2.a()\n r0.<init>(r1)\n throw r0\n L_0x0082:\n com.amap.api.col.n3.gh r0 = new com.amap.api.col.n3.gh\n java.lang.String r1 = \"http或socket连接失败 - ConnectionException\"\n r0.<init>(r1)\n throw r0\n L_0x008a:\n java.lang.String r0 = \"http连接失败 - ConnectionException\"\n java.lang.String r1 = r2.getMessage()\n boolean r0 = r0.equals(r1)\n if (r0 != 0) goto L_0x00c5\n java.lang.String r0 = \"socket 连接异常 - SocketException\"\n java.lang.String r1 = r2.getMessage()\n boolean r0 = r0.equals(r1)\n if (r0 != 0) goto L_0x00c5\n java.lang.String r0 = \"未知的错误\"\n java.lang.String r1 = r2.a()\n boolean r0 = r0.equals(r1)\n if (r0 != 0) goto L_0x00c5\n java.lang.String r0 = \"服务器连接失败 - UnknownServiceException\"\n java.lang.String r1 = r2.getMessage()\n boolean r0 = r0.equals(r1)\n if (r0 == 0) goto L_0x00bb\n goto L_0x00c5\n L_0x00bb:\n com.amap.api.col.n3.gh r0 = new com.amap.api.col.n3.gh\n java.lang.String r1 = r2.a()\n r0.<init>(r1)\n throw r0\n L_0x00c5:\n com.amap.api.col.n3.gh r0 = new com.amap.api.col.n3.gh\n java.lang.String r1 = \"http或socket连接失败 - ConnectionException\"\n r0.<init>(r1)\n throw r0\n L_0x00cd:\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.amap.api.col.n3.gi.e():java.lang.Object\");\n }",
"@Override\n\tpublic void handleException(DPFTActionException e) throws DPFTActionException {\n\t\t\n\t}",
"@Override\r\n\tpublic boolean doCatch(Throwable ex) throws Exception\r\n\t{\n\t\treturn false;\r\n\t}",
"void method21()\n throws IOException\n {\n }",
"public void process() throws Exception {\n\n }",
"public void exceptionEncountered(IOException ioe) {}",
"abstract public void run() throws Exception;",
"@Override\n\tpublic void exceptionCaught(ChannelHandlerContext ctx, Throwable cause)\n\t\t\tthrows Exception {\n\t\tsuper.exceptionCaught(ctx, cause);\n\t}",
"void method22()\n throws IOException\n {\n }",
"private void throwsError() throws OBException {\n }",
"void entry() throws Exception;",
"@Override\n public void errorReceived(Exception ex) {\n }",
"@Override\n public void errorReceived(Exception ex) {\n }",
"void apply() throws Exception;",
"private void doCatch() throws NotConnectedException, NotSuspendedException, NoResponseException\n\t{\n\t\twaitTilHalted();\n\n String typeToCatch = null;\n\n\t\t/* currentXXX may NOT be invalid! */\n\t\tif (!hasMoreTokens())\n\t\t{\n\t\t\terr(\"Catch requires an exception name.\");\n\t\t\treturn;\n\t\t}\n\n typeToCatch = nextToken();\n if (typeToCatch == null || typeToCatch.length() == 0)\n {\n \terr(\"Illegal argument\");\n \treturn;\n }\n\n Value type = null;\n if (typeToCatch.equals(\"*\")) //$NON-NLS-1$\n {\n \ttypeToCatch = null;\n }\n else\n {\n\t type = getSession().getGlobal(typeToCatch);\n\t if (type == null)\n\t {\n\t \terr(\"Type not found.\");\n\t \treturn;\n\t }\n\n\t String typeName = type.getTypeName();\n\t int at = typeName.indexOf('@');\n\t if (at != -1)\n\t \ttypeName = typeName.substring(0, at);\n\t if (!typeName.endsWith(\"$\"))\n\t {\n\t \terr(\"Not a type: \" + type);\n\t \treturn;\n\t }\n }\n\n CatchAction c;\n\t\ttry {\n\t\t\tc = addCatch(typeToCatch);\n\t\t} catch (NotSupportedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\treturn;\n\t\t}\n\n \tMap<String, Object> args = new HashMap<String, Object>();\n \targs.put(\"id\", c.getId()); //$NON-NLS-1$\n \tc.getId();\n\t}",
"public abstract void engineWork() throws Exception;",
"private void inizia() throws Exception {\n }",
"static void ex5() {\n\t\tDog spot=new Dog();\n\t\ttry {\n\t\t\tspot.run();\n\t\t}\n\t\tcatch(ArrayIndexOutOfBoundsException a) {\n\t\t\tSystem.out.println(a);\n\t\t}\n\t\t/*\n\t\tcatch(IndexOutOfBoundsException a) {\n\t\t\tSystem.out.println(\"IndexOutOfBoundsException is caught\");\n\t\t\tSystem.out.println(\"exception is \"+a);\n\t\t}*/\n\t/*\tcatch(Exception e) {\n\t\t\tSystem.out.println(\"exception exception is \"+e);\n\t\t}*/\n\t}",
"public void falschesSpiel(SpielException e);",
"public abstract void run() throws Exception;",
"String getOnExceptionEnd();",
"private void handleInvokeException(Exception e) {\n log.warn(\"invoke()\", e);\n // Removed reset of setLegDetail - as a performance tuning we are\n // not returning leg details from train route api for the moment - SM (10/2009)\n // setLegDetail(null);\n }",
"private void sendOldError(Exception e) {\n }",
"@Override\r\n\tpublic void myMethod() throws ArithmeticException{\n\t}",
"public FaultException raise(Throwable e, Object argument);",
"private void logException(java.lang.Exception e) {\n }",
"public void handleInvokerException(HttpRequest request, HttpResponse response, Exception e)\n {\n handleException(request, response, e);\n }",
"public final void accept(Throwable th) {\n }",
"public final void accept(Throwable th) {\n }",
"public final void accept(Throwable th) {\n }",
"public interface FaultService\r\n{\r\n\t\r\n\t/**\r\n\t * Raise an exception based on the given exception/argument\r\n\t * @param e the thrown error\r\n\t * @param argument the processed argument\r\n\t * @return the wrapped exception\r\n\t * @throws FaultException the GEDI exception will be thrown\r\n\t */\r\n\tpublic FaultException raise(Throwable e, Object argument);\r\n\t\r\n\t\r\n\t/**\r\n\t * Raise an exception based on the given exception\r\n\t * @param e the thrown error\r\n\t * @return the wrapper exception\r\n\t * @throws FaultException the GEDI exception will be thrown\r\n\t */\r\n\tpublic FaultException raise(Throwable e);\r\n\t\r\n}",
"static void fun() \n\t { \n\t try\n\t { \n\t throw new NullPointerException(\"demo\"); \n\t } \n\t catch(NullPointerException e) \n\t { \n\t System.out.println(\"Caught inside fun().\"); \n\t throw e; // rethrowing the exception \n\t } \n\t }",
"@Override\r\npublic void onException(Throwable arg0, WebDriver arg1) {\n\tSystem.out.println(\"as\");\r\n}",
"void afterThrow(T resource, Exception exception);",
"public void run() throws Exception;",
"public Object call() throws Exception{\n return null;\n }",
"public void doTheFaultyThing();"
] | [
"0.7629578",
"0.71638715",
"0.71361285",
"0.7136005",
"0.7059486",
"0.70276064",
"0.6854222",
"0.6851731",
"0.67633677",
"0.6709606",
"0.6707195",
"0.6704016",
"0.6686326",
"0.66565245",
"0.66400546",
"0.66357183",
"0.6622442",
"0.6592557",
"0.65889466",
"0.65710336",
"0.6516607",
"0.6516607",
"0.6449503",
"0.64462733",
"0.6430762",
"0.64207214",
"0.6404571",
"0.63812387",
"0.63599896",
"0.6344904",
"0.63396096",
"0.63342357",
"0.63180095",
"0.63080627",
"0.63054067",
"0.63054067",
"0.63054067",
"0.63054067",
"0.63054067",
"0.6278985",
"0.6278609",
"0.624485",
"0.624485",
"0.6243961",
"0.62288475",
"0.62279075",
"0.6224035",
"0.62178415",
"0.62175876",
"0.61876607",
"0.61736476",
"0.61713463",
"0.6158534",
"0.61400473",
"0.6139163",
"0.61277086",
"0.6121177",
"0.6106781",
"0.6096721",
"0.60964215",
"0.6090055",
"0.60825455",
"0.60633576",
"0.6058776",
"0.6056994",
"0.6053914",
"0.60432494",
"0.603724",
"0.6035641",
"0.6035326",
"0.60277927",
"0.601865",
"0.6018018",
"0.601537",
"0.6004442",
"0.599616",
"0.599616",
"0.59900755",
"0.59774715",
"0.5970163",
"0.5969621",
"0.5963669",
"0.59546703",
"0.5945944",
"0.5939849",
"0.59375167",
"0.5922963",
"0.5916158",
"0.58959997",
"0.58907557",
"0.5887926",
"0.5885669",
"0.5885669",
"0.5885669",
"0.58806336",
"0.58799803",
"0.5876138",
"0.5875367",
"0.586554",
"0.5864868",
"0.586356"
] | 0.0 | -1 |
Fixed the most important execution path. This is still for demo purposes. Here are a lot of other issues that still need to be fixed. | public List<String> readKeysFromMissingObjects_Fixed(List<String> objectIDs) {
List<String> resultSet = new ArrayList<>();
for (String objectIDString : objectIDs) {
try {
Long objectID = Long.valueOf(objectIDString);
if (!IdentifiableManager.current().containsIdentifiable(objectID)) {
resultSet.add(objectIDString);
}
} catch (NumberFormatException e) {
//ignore, not an objectID
}
}
return resultSet;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void verifyPathsInSequence() {\n LOG.debug(\"### Executing \"+ Thread.currentThread().getStackTrace()[1].getMethodName() +\" ####\");\n testGetCompanyHome();\n testGetCabinetFolder();\n testGetCaseFolder();\n testGetDocumentLibraryFolder();\n testEvidenceBankFolder();\n\n }",
"@Test\n public void testReuseforkstrue() throws Exception {\n String testName = \"reuseforkstrue\";\n EkstaziPaths.removeEkstaziDirectories(getClass(), testName);\n executeCleanTestStep(testName, 0, 1);\n }",
"private void debugProgram(AbsoluteAddress location, BPState curState, FileProcess fileState, FileProcess bkFile) {\n\t\tString fileName = Program.getProgram().getFileName();\n\t\tif (location != null && (location.toString().contains(\"FFFFFFFFF\")\n\t\t// ******************************************\n\t\t// Virus.Win32.HLLO.Momac.a\n\t\t\t\t|| (fileName.equals(\"Virus.Win32.HLLO.Momac.a\") && (location.toString().contains(\"40130c\")))\n\t\t\t\t// ******************************************\n\t\t\t\t// Email-Worm.Win32.Atak.e\n\t\t\t\t|| (fileName.equals(\"Email-Worm.Win32.Atak.e\") && (location.toString().contains(\"404cf0\")))\n\t\t\t\t// ******************************************\n\t\t\t\t// Virus.Win32.ZMist\n\t\t\t\t|| (fileName.equals(\"Virus.Win32.ZMist\") && (location.toString().contains(\"402d01\")))\n\t\t\t\t// ******************************************\n\t\t\t\t// api_test_pespin.exe\n\t\t\t\t|| (fileName.equals(\"api_test_pespin.exe\") && (location.toString().contains(\"40669e\")))\n\t\t\t\t// ******************************************\n\t\t\t\t// api_test_yoda.exe\n\t\t\t\t|| (fileName.equals(\"api_test_yoda.exe\") && (location.toString().contains(\"4045fb\")))\n\t\t\t\t// ******************************************\n\t\t\t\t// api_test_vmprotect.exe\n\t\t\t\t|| (fileName.equals(\"api_test_vmprotect.exe\") && (\n\t\t\t\t// location.toString().contains(\"4c11b0\")\n\t\t\t\tlocation.toString().contains(\"4b9da5\")))\n\t\t\t\t// ******************************************\n\t\t\t\t// api_test_yc1.2.exe\n\t\t\t\t|| (fileName.equals(\"api_test_v2.3_lvl1.exe\") && \n\t\t\t\t(location.toString().contains(\"00000000001\")\n\t\t\t\t|| location.toString().contains(\"424a41\") // API GetLocalTime\n\t\t\t\t|| location.toString().contains(\"436daf\") // API CreateFile\n\t\t\t\t|| location.toString().contains(\"436ef8\") // API CreateFile\t\t\t\t\n\t\t\t\t|| location.toString().contains(\"436bc7\") // RET\n\t\t\t\t|| location.toString().contains(\"437b16\") // After STI\n\t\t\t\t|| location.toString().contains(\"43ce7c\") // After STI \n\t\t\t\t|| location.toString().contains(\"43f722\") // API GetVersionExA\n\t\t\t\t|| location.toString().contains(\"43d397\") // API GetCommandLine\t\t\t\t\n\t\t\t\t\n\t\t\t\t|| location.toString().contains(\"44228a\") // Target\n\t\t\t\t))\n\t\t\t\t// ******************************************\n\t\t\t\t// api_test_aspack.exe\n\t\t\t\t|| (fileName.equals(\"api_test_aspack.exe\") && (location.toString().contains(\"4043c2\")\n\t\t\t\t// || location.toString().contains(\"408184\")\n\t\t\t\t))\n\t\t\t\t// ******************************************\n\t\t\t\t// api_test_aspack.exe\n\t\t\t\t|| (fileName.equals(\"Virus.Win32.Cabanas.2999\") && (location.toString().contains(\"40497b\")\n\t\t\t\t// || location.toString().contains(\"408184\")\n\t\t\t\t))\n\t\t\t\t// ******************************************\n\t\t\t\t// Email-Worm.Win32.Apbost.c\n\t\t\t\t|| (fileName.equals(\"Email-Worm.Win32.Apbost.c\") && (location.toString().contains(\"4046e8\")\n\t\t\t\t// || location.toString().contains(\"408184\")\n\t\t\t\t))\n\t\t// ******************************************\n\t\t\t\t// ******************************************\n\t\t\t\t// Email-Worm.Win32.Navidad.b\n\t\t\t\t|| (fileName.equals(\"Email-Worm.Win32.Navidad.b\") && \n\t\t\t\t\t\t(location.toString().contains(\"409239\")\n\t\t\t\t|| location.toString().contains(\"409227\")\n\t\t\t\t))\n\t\t\t\t\n\t\t\t\t|| (fileName.equals(\"Virus.Win32.Adson.1559\") && \n\t\t\t\t\t\t(location.toString().contains(\"4094b3\")\n\t\t\t\t\t\t//|| location.toString().contains(\"402058\")\n\t\t\t\t// || location.toString().contains(\"408184\")\n\t\t\t\t))\n\t\t\t\t\n\t\t\t\t|| (fileName.equals(\"Virus.Win32.HLLP.Delf.d\") && \n\t\t\t\t\t\t(location.toString().contains(\"401324\")\n\t\t\t\t\t\t//|| location.toString().contains(\"402058\")\n\t\t\t\t// || location.toString().contains(\"408184\")\n\t\t\t\t))\n\t\t\t\t\n\t\t\t\t|| (fileName.equals(\"Virus.Win32.HLLC.Asive\") && \n\t\t\t\t(location.toString().contains(\"401130\")\n\t\t\t\t\t\t//|| location.toString().contains(\"402058\")\n\t\t\t\t// || location.toString().contains(\"408184\")\n\t\t\t\t))\n\n\t\t// Virus.Win32.Aztec.01\n\t\t\t\t|| (fileName.equals(\"Virus.Win32.Aztec.01\") && \n\t\t\t\t(location.toString().contains(\"40134e\")\n\t\t\t\t|| location.toString().contains(\"401312\")\n\t\t\t\t|| location.toString().contains(\"40106c\")\n\t\t\t\t)))) {\n\t\t\t//if (curState.getEnvironement().getRegister().getRegisterValue(\"eax\").toString().equals(\"7c800c00\"))\t\t\t\n\t\t\tbackupState(curState, fileState);\n\t\t\t//backupStateAll(curState, bkFile);\n\t\t\t//program.generageCFG(program.getAbsolutePathFile() + \"_test\");\n\t\t\t//program.generageCFG(\"/asm/cfg/\" + program.getFileName() + \"_test\");\n\t\t\tSystem.out.println(\"Debug at:\" + location.toString());\n\t\t}\n\t\t/*\n\t\t * if (location != null && location.toString().contains(\"0040481b\") &&\n\t\t * Program.getProgram().getFileName()\n\t\t * .equals(\"Virus.Win32.Cabanas.2999\")) { // Value ecx =\n\t\t * env.getRegister().getRegisterValue(\"ecx\"); String s1 =\n\t\t * curState.getEnvironement().getMemory() .getText(this, 4215362, 650);\n\t\t * System.out.println(\"Decrypted String: \" + s1); }\n\t\t */\n\t}",
"@Override\n protected void startup() throws Throwable {\n\n\tsetTraceBase(baseDir);\n\n }",
"@Override\n\tpublic void coreProblemExecution() {\n\t\t\n\t}",
"@Override\n\tpublic void coreProblemExecution() {\n\t\t\n\t}",
"public static void main(String... args) {\nPath path = Paths.get(\".\");\ntry {\n out.println(path.normalize());\n} catch(IOException e){out.println(e);}\n\ntry {\n out.println(path.toRealPath());\n} catch(IOException e){out.println(e);}\n\n}",
"@Override\n public boolean executeBeforeRunTask(ExecutionEnvironment env) {\n throw new RuntimeException(\n String.format(\n \"Unexpected code path: program runner %s, executor: %s\",\n env.getRunner().getClass(), env.getExecutor().getId()));\n }",
"static public void order66() {\n System.exit(0);\n }",
"public void testDebugNoModifications() throws Exception {\n startTest();\n openFile(\"debug.html\", LineDebuggerTest.current_project);\n EditorOperator eo = new EditorOperator(\"debug.html\");\n setLineBreakpoint(eo, \"window.console.log(a);\");\n\n openFile(\"linebp.js\", LineDebuggerTest.current_project);\n eo = new EditorOperator(\"linebp.js\");\n setLineBreakpoint(eo, \"console.log(\\\"start\\\");\");\n setLineBreakpoint(eo, \"if (action === \\\"build\\\") {\");\n setLineBreakpoint(eo, \"var d = new Date();\");\n eo.close();\n runFile(LineDebuggerTest.current_project, \"debug.html\");\n evt.waitNoEvent(GeneralHTMLProject.RUN_WAIT_TIMEOUT);\n EditorOperator currentFile = EditorWindowOperator.getEditor();\n VariablesOperator vo = new VariablesOperator(\"Variables\");\n\n assertEquals(\"Unexpected file opened at breakpoint\", \"debug.html\", currentFile.getName());\n assertEquals(\"Debugger stopped at wrong line\", 14, currentFile.getLineNumber());\n evt.waitNoEvent(1000);\n waitForVariable(\"step\");\n assertEquals(\"Step variable is unexpected\", \"1\", ((Map<String, Variable>) vo.getVariables()).get(\"step\").value);\n\n new ContinueAction().performMenu();\n evt.waitNoEvent(1000);\n currentFile = EditorWindowOperator.getEditor();\n vo = new VariablesOperator(\"Variables\");\n evt.waitNoEvent(1000);\n waitForVariable(\"step\");\n assertEquals(\"Unexpected file opened at breakpoint\", \"linebp.js\", currentFile.getName());\n assertEquals(\"Debugger stopped at wrong line\", 4, currentFile.getLineNumber());\n assertEquals(\"Step variable is unexpected\", \"2\", ((Map<String, Variable>) vo.getVariables()).get(\"step\").value);\n\n new StepOverAction().performMenu();\n new StepOverAction().performMenu();\n new StepOverAction().performMenu();\n evt.waitNoEvent(500);\n currentFile = EditorWindowOperator.getEditor();\n vo = new VariablesOperator(\"Variables\");\n evt.waitNoEvent(1000);\n assertEquals(\"Debugger stopped at wrong line\", 7, currentFile.getLineNumber());\n waitForVariable(\"step\");\n assertEquals(\"Step variable is unexpected\", \"3\", ((Map<String, Variable>) vo.getVariables()).get(\"step\").value);\n\n new ContinueAction().performMenu();\n evt.waitNoEvent(1000);\n currentFile = EditorWindowOperator.getEditor();\n vo = new VariablesOperator(\"Variables\");\n assertEquals(\"Debugger stopped at wrong line\", 15, currentFile.getLineNumber());\n evt.waitNoEvent(1000);\n waitForVariable(\"step\");\n assertEquals(\"Step variable is unexpected\", \"4\", ((Map<String, Variable>) vo.getVariables()).get(\"step\").value);\n\n new StepOverAction().performMenu();\n new StepOverAction().performMenu();\n evt.waitNoEvent(1000);\n currentFile = EditorWindowOperator.getEditor();\n vo = new VariablesOperator(\"Variables\");\n assertEquals(\"Debugger stopped at wrong line\", 17, currentFile.getLineNumber());\n evt.waitNoEvent(1000);\n waitForVariable(\"step\");\n assertEquals(\"Step variable is unexpected\", \"5\", ((Map<String, Variable>) vo.getVariables()).get(\"step\").value);\n\n new StepIntoAction().performMenu();\n new StepIntoAction().performMenu();\n evt.waitNoEvent(1000);\n vo = new VariablesOperator(\"Variables\");\n evt.waitNoEvent(1000);\n waitForVariable(\"step\");\n if(GeneralHTMLProject.inEmbeddedBrowser){ // embedded browser stops on line with function(){\n assertEquals(\"Step variable is unexpected\", \"5\", ((Map<String, Variable>) vo.getVariables()).get(\"step\").value);\n }else{\n assertEquals(\"Step variable is unexpected\", \"6\", ((Map<String, Variable>) vo.getVariables()).get(\"step\").value); \n }\n\n endTest();\n }",
"public void pathFinder() {\n String oldPath = path;\n ProcessHandle.allProcesses()\n .forEach(process -> checkProcess(process.info()));\n writePath();\n //return (oldPath != path);\n }",
"static void ex4() {\n\t\tSystem.out.println(\"subPath\");\n\t\t/*\n\t\t * this is a path within a path\n\t\t */\n\t\tString parent=\"C:/Users/noelf/OneDrive/JavaProgrammer2019-20/WorkSpace2/F9.2InteractingWithPathAndFiles\";\n\t\tString child=\"src/com/android/Examples.java\";\n\t\tPath fullPath=Paths.get(parent,child);\n\t\tSystem.out.println(fullPath);\n\t\tSystem.out.println(\"is this an absolute path \"+fullPath.isAbsolute());\n\t\t/*C:\\Users\\noelf\\OneDrive\\JavaProgrammer2019-20\\WorkSpace2\\F9.2InteractingWithPathAndFiles\n\t\t\\src\\com\\android\\Examples.java\n\t\t*/\n\t\t//this path has 10 elements, 9 folders and one file\n\t\t//the elements use array numbering, so these elements go from 0 to 9\n\t\tSystem.out.println(\"there are \"+fullPath.getNameCount()+\" elements in the path\");\n\t\t/*\n\t\t * subpath returns any relative subpath within the abseloute path\n\t\t * there are 10 elements in this path\n\t\t * so this path goes from index postion 0, up to index positiion 5, but DOES NOT include\n\t\t * index position 5, operates exact same way as the subString() method of the String\n\t\t * this creates the relative path\n\t\t * Users\\noelf\\OneDrive\\JavaProgrammer2019-20\\WorkSpace2\n\t\t * subpath returns a relative path\n\t\t */\n\t\tSystem.out.println(\"subpath from 0 to 5 but not including 5 \"+fullPath.subpath(0, 5));\n\t\t/*\n\t\t * this starts at index position 3, which is the folder \"JavaProgrammer2019-20\"\n\t\t * and up to index position 7, but not including position 7, which will be the folder \"src\"\n\t\t */\n\t\tPath relPath=fullPath.subpath(3, 7);\n\t\t//prints off\n\t\t/*\n\t\t * JavaProgrammer2019-20\\->index postion 3\n\t\t * WorkSpace2\\ -> index position 4\n\t\t * F9.2InteractingWithPathAndFiles -> index position 5\n\t\t * \\src -> index position 6\n\t\t * index position 7 is NOT included\n\t\t */\n\t\tSystem.out.println(relPath);\n\t\tSystem.out.println(relPath.isAbsolute());//false as it's a relative path\n\t\t/*\n\t\t * this will print\n\t\t * C:\\Users\\noelf\\OneDrive\\JavaProgrammer2019-20\\WorkSpace2\\F9.2InteractingWithPathAndFiles\\\n\t\t * JavaProgrammer2019-20\\WorkSpace2\\F9.2InteractingWithPathAndFiles\\src\n\t\t */\n\t\tSystem.out.println(relPath.toAbsolutePath());\n\t\ttry {\n\t\t\t/*\n\t\t\t * if you attempt to access an element in a path by subpath that does not exist\n\t\t\t * you will get an IllegalArguementException\n\t\t\t */\n\t\t\tSystem.out.println(\"subpath from 0 to 10 \"+fullPath.subpath(0, 10));//this wil compile, no exception\n\t\t\t//this will give us an illegalArugmenmt exception as this is out of bounds as only\n\t\t\t//10 elements in our path, so only goes UP TO 10, but numbering is 0 t0 9\n\t\t//\tSystem.out.println(\"subpath from 0 to 11 \"+fullPath.subpath(0, 11));\n\t\t\t/*\n\t\t\t * can't have an empty path or subpath, this is a empty path, so this will throw an\n\t\t\t * IllegalArguement exception as well\n\t\t\t */\n\t\t\tSystem.out.println(\"subpath from 2 to 2 \"+fullPath.subpath(2, 2));\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\tSystem.out.println(\"exception is \"+e);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}",
"@Test\n public void testReuseforksfalse() throws Exception {\n String testName = \"reuseforksfalse\";\n EkstaziPaths.removeEkstaziDirectories(getClass(), testName);\n executeCleanTestStep(testName, 0, 1);\n }",
"@Override\r\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\texecutable.feedbackExecutionError();\r\n\t\t\t\t\t}",
"private String solutionPath(State goal)\n\t{\n\t\t// TODO \n\t\t\n\t\treturn null; \n\t}",
"public void test_61843() {\n \t\t// create the project and manually give it a settings file\n \t\tfinal String qualifier = getUniqueString();\n \t\tfinal IProject project = getProject(getUniqueString());\n \t\tensureExistsInWorkspace(project, true);\n \t\tIFile settingsFile = getFileInWorkspace(project, qualifier);\n \n \t\t// write some property values in the settings file\n \t\tProperties properties = new Properties();\n \t\tproperties.put(\"key\", \"value\");\n \t\tOutputStream output = null;\n \t\ttry {\n \t\t\tFile file = settingsFile.getLocation().toFile();\n \t\t\tfile.getParentFile().mkdirs();\n \t\t\toutput = new BufferedOutputStream(new FileOutputStream(file));\n \t\t\tproperties.store(output, null);\n \t\t} catch (FileNotFoundException e) {\n \t\t\tfail(\"1.0\", e);\n \t\t} catch (IOException e) {\n \t\t\tfail(\"1.1\", e);\n \t\t} finally {\n \t\t\ttry {\n \t\t\t\tif (output != null)\n \t\t\t\t\toutput.close();\n \t\t\t} catch (IOException e) {\n \t\t\t\t// ignore\n \t\t\t}\n \t\t}\n \n \t\t// add a log listener to ensure that no errors are reported silently\n \t\tILogListener logListener = new ILogListener() {\n \t\t\tpublic void logging(IStatus status, String plugin) {\n \t\t\t\tThrowable exception = status.getException();\n \t\t\t\tif (exception == null || !(exception instanceof CoreException))\n \t\t\t\t\treturn;\n \t\t\t\tif (IResourceStatus.WORKSPACE_LOCKED == ((CoreException) exception).getStatus().getCode())\n \t\t\t\t\tfail(\"3.0\");\n \t\t\t}\n \t\t};\n \n \t\t// listener to react to changes in the workspace\n \t\tIResourceChangeListener rclistener = new IResourceChangeListener() {\n \t\t\tpublic void resourceChanged(IResourceChangeEvent event) {\n \t\t\t\tnew ProjectScope(project).getNode(qualifier);\n \t\t\t}\n \t\t};\n \n \t\t// add the listeners\n \t\tPlatform.addLogListener(logListener);\n \t\tgetWorkspace().addResourceChangeListener(rclistener, IResourceChangeEvent.POST_CHANGE);\n \n \t\ttry {\n \t\t\tproject.refreshLocal(IResource.DEPTH_INFINITE, getMonitor());\n \t\t} catch (CoreException e) {\n \t\t\tfail(\"4.0\", e);\n \t\t} finally {\n \t\t\tPlatform.removeLogListener(logListener);\n \t\t\tgetWorkspace().removeResourceChangeListener(rclistener);\n \t\t}\n \t}",
"public void testDebugging() throws Throwable {\n // Status bar tracer\n MainWindowOperator.StatusTextTracer stt = MainWindowOperator.getDefault().getStatusTextTracer();\n SourcePackagesNode sourcePackagesNode = new SourcePackagesNode(SAMPLE_PROJECT_NAME);\n JavaNode sampleClass1Node = new JavaNode(sourcePackagesNode, SAMPLE1_PACKAGE_NAME + \"|\" + SAMPLE1_FILE_NAME);\n // flag to stop debugger in finally\n boolean debuggerStarted = false;\n try {\n // find sample file in Editor\n EditorOperator eo = new EditorOperator(SAMPLE1_FILE_NAME);\n eo.setCaretPosition(\"public static void main\", true);\n final int insertLine = eo.getLineNumber() + 2;\n\n // if file not contains brpText from previous test cases, insert it\n String brpText = \"System.out.println(\\\"Hello\\\");\"; // NOI18N\n if (!eo.contains(brpText)) {\n eo.insert(brpText + \"\\n\", insertLine, 1);\n }\n eo.select(brpText);\n\n ToggleBreakpointAction toggleBreakpointAction = new ToggleBreakpointAction();\n try {\n // toggle breakpoint via Shift+F8\n toggleBreakpointAction.performShortcut(eo);\n waitBreakpoint(eo, insertLine);\n } catch (TimeoutExpiredException e) {\n // need to be realiable test => repeat action once more to be sure it is problem in IDE\n // this time use events instead of Robot\n MainWindowOperator.getDefault().pushKey(\n toggleBreakpointAction.getKeyStrokes()[0].getKeyCode(),\n toggleBreakpointAction.getKeyStrokes()[0].getModifiers());\n waitBreakpoint(eo, insertLine);\n }\n\n // if file not contains second brpText from previous test cases, insert it\n brpText = \"System.out.println(\\\"Good bye\\\");\"; // NOI18N\n if (!eo.contains(brpText)) {\n eo.insert(brpText + \"\\n\", insertLine + 1, 1);\n }\n eo.select(brpText);\n // toggle breakpoint via pop-up menu\n // clickForPopup(0, 0) used in the past sometimes caused that menu\n // was opened outside editor area because editor roll up after \n // text was selected\n toggleBreakpointAction.perform(eo.txtEditorPane());\n // wait second breakpoint established\n waitBreakpoint(eo, insertLine + 1);\n // start to track Main Window status bar\n stt.start();\n debuggerStarted = true;\n // start debugging\n new DebugJavaFileAction().performMenu(sampleClass1Node);\n // check the first breakpoint reached\n // wait status text \"Thread main stopped at SampleClass1.java:\"\n // increase timeout to 60 seconds\n MainWindowOperator.getDefault().getTimeouts().setTimeout(\"Waiter.WaitingTime\", 60000);\n String labelLine = Bundle.getString(\"org.netbeans.modules.debugger.jpda.ui.Bundle\",\n \"CTL_Thread_stopped\",\n new String[]{\"main\", SAMPLE1_FILE_NAME, null, String.valueOf(insertLine)}); // NOI18N\n stt.waitText(labelLine);\n // continue debugging\n new ContinueAction().perform();\n // check the second breakpoint reached\n // wait status text \"Thread main stopped at SampleClass1.java:\"\n String labelLine1 = Bundle.getString(\"org.netbeans.modules.debugger.jpda.ui.Bundle\",\n \"CTL_Thread_stopped\",\n new String[]{\"main\", SAMPLE1_FILE_NAME, null, String.valueOf(insertLine)}); // NOI18N\n stt.waitText(labelLine1);\n // check \"Hello\" was printed out in Output\n OutputTabOperator oto = new OutputTabOperator(\"debug-single\"); // NOI18N\n // wait until text Hello is not written in to the Output\n oto.waitText(\"Hello\"); // NOI18N\n } catch (Throwable th) {\n try {\n // capture screen before cleanup in finally clause is completed\n PNGEncoder.captureScreen(getWorkDir().getAbsolutePath() + File.separator + \"screenBeforeCleanup.png\");\n } catch (Exception e1) {\n // ignore it\n }\n th.printStackTrace(getLog());\n throw th;\n } finally {\n if (debuggerStarted) {\n // finish debugging\n new FinishDebuggerAction().perform();\n // check status line\n // \"SampleProject (debug-single)\"\n String outputTarget = Bundle.getString(\n \"org.apache.tools.ant.module.run.Bundle\",\n \"TITLE_output_target\",\n new Object[]{SAMPLE_PROJECT_NAME, null, \"debug-single\"}); // NOI18N\n // \"Finished building SampleProject (debug-single)\"\n String finishedMessage = Bundle.getString(\n \"org.apache.tools.ant.module.run.Bundle\",\n \"FMT_finished_target_status\",\n new Object[]{outputTarget});\n stt.waitText(finishedMessage);\n }\n stt.stop();\n // delete sample class\n sampleClass1Node.delete();\n String confirmTitle = Bundle.getString(\"org.netbeans.modules.refactoring.java.ui.Bundle\", \"LBL_SafeDel_Delete\"); // NOI18N\n String confirmButton = UIManager.getDefaults().get(\"OptionPane.okButtonText\").toString(); // NOI18N\n // \"Confirm Object Deletion\"\n new JButtonOperator(new NbDialogOperator(confirmTitle), confirmButton).push();\n }\n }",
"private void generateSolution() {\n\t\t// TODO\n\n\t}",
"@Override\n\tpublic void homeTestRun() {\n\t\t\n\t}",
"public static void main(String[] args) throws Exception {\n \t\t(new PathTest()).run();\n \t}",
"private void createJavaWebStartPath() {\n String[] onlyFolderNames = new String[] {\n mInstance.getJavaWebStartPath(),\n mModuleName\n };\n\n mJavaWebStartPath = StringUtils.makeFilePath (onlyFolderNames, false);\n }",
"public static void ChromeExePathSetUp() {\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \r\n\t\t\t\t\"D:\\\\VisionITWorkspace\\\\dependencies\\\\chromedriver_win32\\\\chromedriver.exe\");\r\n\t\tReporter.log(\"Chrome Exe path Set up\", true);\r\n\t}",
"@Test\n public void test9MLog_Siebel_SingleRun() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IOException, IllegalAccessException {\n String logPath_base = \"/home/xiaohe/workspace/DATA/FakeData4TestingPerf/Pub_fake.log\";\n// Common.testLog_multiTimes(logPath_base, 5, true); //eager eval\n\n// Common.testLog_multiTimes(logPath_base, 1, false); //lazy eval\n\n// String logPath_base = \"/home/xiaohe/workspace/DATA/ldccComplete_MonpolyStyle\";\n\n String[] args = new String[]{\"./test/count/insert.sig\", \"./test/count/insert.fl\", logPath_base};\n Main.main(args);\n\n }",
"public void testDebugModifications() throws Exception {\n startTest();\n\n openFile(\"debugMod.html\", LineDebuggerTest.current_project);\n EditorOperator eo = new EditorOperator(\"debugMod.html\");\n setLineBreakpoint(eo, \"window.console.log(a);\");\n openFile(\"linebpMod.js\", LineDebuggerTest.current_project);\n eo = new EditorOperator(\"linebpMod.js\");\n setLineBreakpoint(eo, \"console.log(\\\"start\\\");\");\n eo.close();\n runFile(LineDebuggerTest.current_project, \"debugMod.html\");\n evt.waitNoEvent(GeneralHTMLProject.RUN_WAIT_TIMEOUT);\n new ContinueAction().performMenu();\n evt.waitNoEvent(1000);\n EditorOperator currentFile = EditorWindowOperator.getEditor();\n currentFile.setCaretPositionToEndOfLine(3);\n currentFile.insert(\"\\nconsole.log(\\\"1js\\\");\\nconsole.log(\\\"2js\\\");\\nconsole.log(\\\"3js\\\");\");\n// if (LineDebuggerTest.inEmbeddedBrowser) { // workaround for 226022\n// (new EmbeddedBrowserOperator(\"Web Browser\")).close();\n// saveAndWait(currentFile, 1000);\n// runFile(LineDebuggerTest.current_project, \"debugMod.html\");\n// evt.waitNoEvent(GeneralHTMLProject.RUN_WAIT_TIMEOUT);\n// } else {\n saveAndWait(currentFile, 1500);\n\n new ContinueAction().performMenu();\n evt.waitNoEvent(1000);\n currentFile = EditorWindowOperator.getEditor();\n assertEquals(\"Unexpected file opened at breakpoint\", \"linebpMod.js\", currentFile.getName());\n assertEquals(\"Debugger stopped at wrong line\", 7, currentFile.getLineNumber());\n currentFile.deleteLine(4);\n currentFile.deleteLine(4);\n\n// if (LineDebuggerTest.inEmbeddedBrowser) {\n// (new EmbeddedBrowserOperator(\"Web Browser\")).close();\n// saveAndWait(currentFile, 1000);\n// runFile(LineDebuggerTest.current_project, \"debugMod.html\");\n// evt.waitNoEvent(GeneralHTMLProject.RUN_WAIT_TIMEOUT);\n// } else {\n saveAndWait(currentFile, 1500);\n\n new ContinueAction().performMenu();\n evt.waitNoEvent(1000);\n currentFile = EditorWindowOperator.getEditor();\n assertEquals(\"Unexpected file opened at breakpoint\", \"linebpMod.js\", currentFile.getName());\n assertEquals(\"Debugger stopped at wrong line\", 5, currentFile.getLineNumber());\n\n\n currentFile.setCaretPositionToEndOfLine(3);\n currentFile.insert(\"\\nconsole.log(\\\"1js\\\");\\nconsole.log(\\\"2js\\\");\\nconsole.log(\\\"3js\\\");\"); \n\n// if (LineDebuggerTest.inEmbeddedBrowser) {\n// (new EmbeddedBrowserOperator(\"Web Browser\")).close();\n// saveAndWait(currentFile, 1000);\n// runFile(LineDebuggerTest.current_project, \"debugMod.html\");\n// evt.waitNoEvent(GeneralHTMLProject.RUN_WAIT_TIMEOUT);\n// } else {\n saveAndWait(currentFile, 1500);\n\n new ContinueAction().performMenu();\n evt.waitNoEvent(1000);\n currentFile = EditorWindowOperator.getEditor();\n assertEquals(\"Unexpected file opened at breakpoint\", \"linebpMod.js\", currentFile.getName());\n assertEquals(\"Debugger stopped at wrong line\", 8, currentFile.getLineNumber());\n currentFile.close();\n\n endTest();\n }",
"private static void incrementLaunchOrder()\r\n\t{\r\n\t\tlaunchOrder++;\r\n\t}",
"public static void main(String[] args) {\n\t\tPath path = Paths.get(\"F:\\\\AccentureMayBatch\\\\JSTLProject\");\r\n\r\n\t\r\n\r\n\t\tSystem.out.format(\"toString: %s%n\", path.toString());\r\n\t\tSystem.out.format(\"getFileName: %s%n\", path.getFileName());\r\n\t\tSystem.out.format(\"getName(0): %s%n\", path.getName(0));\r\n\t\tSystem.out.format(\"getNameCount: %d%n\", path.getNameCount());\r\n\t\tSystem.out.format(\"subpath(0,2): %s%n\", path.subpath(0,2));\r\n\t\tSystem.out.format(\"getParent: %s%n\", path.getParent());\r\n\t\tSystem.out.format(\"getRoot: %s%n\", path.getRoot());\r\n\t\t\r\n\t\ttry {\r\n\t\t\tFiles.list(new File(\".\").toPath())\r\n\t\t\t .forEach(System.out::println);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tFiles.walk(new File(\".\").toPath())\r\n\t\t .filter(p -> !p.getFileName()\r\n\t\t .toString().startsWith(\".\"))\r\n\t\t .forEach(System.out::println);\r\n\t\t\t\r\n\t\t\tFiles.lines(new File(\"./src/com/polaris/utility/PathDemo.java\").toPath())\r\n\t\t .map(s -> s.trim())\r\n\t\t .filter(s -> !s.isEmpty())\r\n\t\t .forEach(System.out::println);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t//finding path and sub path into string\r\n\t\t Path start = Paths.get(\".\");\r\n\t\t int maxDepth = 5;\r\n\t\t try (Stream<Path> stream = Files.find(start, maxDepth, (path2, attr) -> String.valueOf(path2).endsWith(\".java\"))) \r\n\t\t {\r\n\t\t String joined = stream\r\n\t\t .sorted()\r\n\t\t .map(String::valueOf)\r\n\t\t .collect(Collectors.joining(\"; \"));\r\n\t\t System.out.println(\"Found: \" + joined);\r\n\t\t } catch (IOException e1) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\t\t \r\n\t\t\r\n\t\tPath source = Paths.get(\"./src/com/polaris/utility/PathDemo.java\");\r\n\t\tPath target = Paths.get(\"F:/yatrabakup\");\r\n\t\t\r\n/*\r\n\t\ttry {\r\n\t\t // Files.copy(source, target);\r\n\t\t} catch(FileAlreadyExistsException fae) {\r\n\t\t fae.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t // something else went wrong\r\n\t\t e.printStackTrace();\r\n\t\t}\r\n\t\t*/\r\n\t\ttry (BufferedReader reader = Files.newBufferedReader(Paths.get(\"f:\\\\yatrabakup\\\\EmployeeData.csv\"))) {\r\n\t\t reader.lines().map(String::toLowerCase).forEach(System.out::println);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"private static void removeBreakPoint() {\n for (int i=1;i<=dvm.getSourceCodeLength();i++) {\n dvm.setBreakPoint(i-1, false);\n }\n }",
"private void randomizeEnvironment() {\n }",
"public static void main() {\n \n }",
"@Test\n public void testArgline() throws Exception {\n String testName = \"argline\";\n EkstaziPaths.removeEkstaziDirectories(getClass(), testName);\n executeCleanTestStep(testName, 0, 1);\n }",
"private static void runTestCWE9() {\n}",
"private static void runTestCWE9() {\n}",
"protected void foundGoal( Path pathToGoal ) {\n\t\t/* A dummy implementation that does nothing with this\n\t\t exciting news. */\n\t}",
"public void test7() throws Exception {\n //$NON-NLS-1$\n IFolder buildFolder = newTest(\"test7\");\n //$NON-NLS-1$\n String buildXMLPath = buildFolder.getFile(\"build.xml\").getLocation().toOSString();\n Properties properties = new Properties();\n //$NON-NLS-1$ //$NON-NLS-2$\n properties.put(\"reference_location\", buildFolder.getFile(\"before\").getLocation().toOSString());\n //$NON-NLS-1$ //$NON-NLS-2$\n properties.put(\"current_location\", buildFolder.getFile(\"after\").getLocation().toOSString());\n //$NON-NLS-1$\n properties.put(\"report_location\", buildFolder.getLocation().toOSString());\n //$NON-NLS-1$\n runAntScript(buildXMLPath, new String[] { \"run\" }, buildFolder.getLocation().toOSString(), properties);\n //$NON-NLS-1$ //$NON-NLS-2$\n assertFalse(\"allNonApiBundles must not exist\", buildFolder.getFolder(\"allNonApiBundles\").exists());\n //$NON-NLS-1$\n IFolder folder = buildFolder.getFolder(\"deltatest\");\n //$NON-NLS-1$\n assertTrue(\"deltatest folder must exist\", folder.exists());\n //$NON-NLS-1$ //$NON-NLS-2$\n assertTrue(\"report.xml file must be there\", folder.getFile(\"report.xml\").exists());\n }",
"private static void runTestCWE7() {\n}",
"private static void runTestCWE7() {\n}",
"public static void main(String args[]) throws Exception\n {\n \n \n \n }",
"@Test\n\tpublic void executeInvalidFileForSlash() {\n\t\tassertEquals(null, Helper.isValidFile(\n\t\t\t\tnew File(System.getProperty(\"user.dir\")), \"\\\\/\"));\n\t\tassertEquals(null, Helper.isValidFile(\n\t\t\t\tnew File(System.getProperty(\"user.dir\")), \"\\\\\"));\n\t\tassertEquals(null, Helper.isValidFile(\n\t\t\t\tnew File(System.getProperty(\"user.dir\")), \"//\"));\n\t\tassertEquals(null, Helper.isValidFile(\n\t\t\t\tnew File(System.getProperty(\"user.dir\")), \"/\"));\n\t}",
"private static void testRunHardcodedCmd() {\n\t\tString[] cmdArray = { \"./runAsUser/runAsUser.exe\", \"c:\\\\procesos\", \"martin.zaragoza@ACCUSYSARGBSAS\", \"Marzo2015\", \"\\\"C:\\\\WINDOWS\\\\system32\\\\cmd.exe\\\"\",\n\t\t\t\t\"\\\"/c a.exe 1\\\"\" };\n\t\ttry {\n\t\t\tFile wrkDir = new File(\"c:\\\\procesos\");\n\n\t\t\tProcess process = Runtime.getRuntime().exec(cmdArray, null, wrkDir);\n\t\t\tprintStdout(process.getInputStream());\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public IStatus prepareRuntimeDirectory(IPath baseDir);",
"public static void main(String[] args) {\n System.out.println(new SimplifyPath().simplifyPath(\"/...\"));\n }",
"public void test25() throws Exception {\n runTestInDirectory(\"regression\");\n }",
"public static void main(String[] args) throws IOException {\r\n\t\tString folderPath = \"F:\\\\2.true-false-timewindow\";\r\n\t\tfolderPath = \"f:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\1.true-false-selectivity\";\r\n\t\tfolderPath = \"f:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\2.true-false-timewindow\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\3.false-selectivity\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\4.false-timewindow\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\5.true-selectivity\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\6.true-timewindow\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\7.inconsistent-selectivity\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\8.inconsistent-timewindow\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Imprecise\\\\1.true-false-selectivity\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Imprecise\\\\3.true-false-uncertaintyinterval\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Imprecise\\\\2.true-false-timewindow\";\r\n\t\t\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Imprecise2.0\\\\a.1\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\imprecise3.0\\\\confidence\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\imprecise3.0\\\\true\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\imprecise3.0\\\\true-false\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\dpc\\\\half3\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\dpc\\\\half1\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\dpc\\\\half2\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\dpc\\\\obelix\\\\half5\";\t\t\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\dpc\\\\obelix\\\\half5-largerwindow\";\r\n\r\n\t\t\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\3.false-selectivity\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\4.false-timewindow\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\5.true-selectivity\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\6.true-timewindow\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\7.inconsistent-selectivity\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\8.inconsistent-timewindow\";\r\n\t\t\r\n\t\t\r\n\t\tGroupResultSet rSet = new GroupResultSet(folderPath);\r\n\t\trSet.printResults();\r\n\t\t//rSet.printAttribute(\"averageThroughput\");\r\n\t\trSet.printAttribute(\"Throughput\");\r\n\t\trSet.printAttribute(\"Number Of Runs Created\");\r\n\t\trSet.printAttribute(\"Time for compute confidence\");\r\n\t\trSet.printAttribute(\"Time on Create New Run Baseline\");\r\n\t\trSet.printAttribute(\"Time for sorting events in imprecise\");\r\n\t\trSet.printAttribute(\"Pattern matching time\");\r\n\t\trSet.printAttribute(\"Enumeration time\");\r\n\t\trSet.printAttribute(\"Time for compute confidence\");\r\n\t\trSet.printAttribute(\"Total Running Time\");\r\n\t\t\r\n\t}",
"private void gotoPath() {\n\t\tfinal String hdfs = getFullPath(txtRootPath.getText().trim());\n\t\tif (StringUtils.isEmpty(hdfs)) {\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tFileStatus fs = getFileStatusWithProgress(hdfs);\n\t\t\tgotoPath(fs);\n\t\t} catch (Exception e) {\n\t\t\tMessageDialog.openError(getShell(), Messages.msgError, e.getMessage());\n\t\t}\n\t}",
"void reapplyBreakpoints()\n\t{\n\t\t// give us a bit of time to process the newly loaded swf\n\t\tif (propertyGet(METADATA_ATTEMPTS) > 0)\n\t\t\ttry { waitForMetaData(80); } catch(InProgressException ipe) { }\n\n\t\tint count = breakpointCount();\n\t\tfor(int i=0; i<count; i++)\n\t\t{\n\t\t\tBreakAction a = breakpointAt(i);\n\t\t\ta.clearHits();\n\t\t\ta.setStatus(BreakAction.UNRESOLVED);\n\t\t}\n\n\t\tStringBuilder sb = new StringBuilder();\n\t\tresolveBreakpoints(sb);\n\t\tout(sb.toString());\n\t}",
"private void m20349g() {\n boolean z = true;\n if (this.f17414c.exists()) {\n if (!this.f17416e.exists()) {\n FileTree.m20516b(this.f17414c);\n } else {\n z = false;\n }\n }\n if (z) {\n try {\n C3945c.m20520a(this.f17416e);\n } catch (C3945c.C3946a unused) {\n CacheErrorLogger aVar = this.f17417f;\n CacheErrorLogger.EnumC3922a aVar2 = CacheErrorLogger.EnumC3922a.WRITE_CREATE_DIR;\n Class<?> cls = f17413b;\n aVar.mo27388a(aVar2, cls, \"version directory could not be created: \" + this.f17416e, null);\n }\n }\n }",
"private static void runTestCWE4() {\n}",
"private static void runTestCWE4() {\n}",
"private static void printUsageAndExit() {\n\t\t printUsageAndExit(null);\n\t\t }",
"@Test\n\tpublic void testMainValidFile() throws Exception {\n\t\tString testPathResource = System.getProperty(\"user.dir\") + \"/src/test/resources/instructions-file\";\n\t\tString[] arguments = { testPathResource };\n\t\tAutomaticMowerMain.main(arguments);\n\t}",
"@Override\n public final void noteAbsoluteEntryPoint(int address) {\n }",
"public void projectWorkDirChanged() { }",
"public void projectWorkDirChanged() { }",
"void logPrgStateExec() throws FileNotFoundException, IOException;",
"@Test\n\tpublic void executeInvalidDirectoryForSlash() {\n\t\tassertEquals(null, Helper.isValidFile(\n\t\t\t\tnew File(System.getProperty(\"user.dir\")), \"\\\\/\"));\n\t\tassertEquals(null, Helper.isValidFile(\n\t\t\t\tnew File(System.getProperty(\"user.dir\")), \"\\\\\"));\n\t\tassertEquals(null, Helper.isValidFile(\n\t\t\t\tnew File(System.getProperty(\"user.dir\")), \"//\"));\n\t\tassertEquals(null, Helper.isValidFile(\n\t\t\t\tnew File(System.getProperty(\"user.dir\")), \"/\"));\n\t}",
"public void testResolveTargetLocation() throws Exception {\n System.out.println(\"resolveTargetLocation\");\n \n instance.resolveTargetLocation();\n \n }",
"void prepare(final boolean triggerCompile) throws Exception {\n if (triggerCompile) {\n triggerCompile();\n }\n if (debug == null) {\n // debug mode not specified\n // make sure 5005 is not used, we don't want to just fail if something else is using it\n // we don't check this on restarts, as the previous process is still running\n if (debugPortOk == null) {\n try (Socket socket = new Socket(InetAddress.getByAddress(new byte[] { 127, 0, 0, 1 }), 5005)) {\n getLog().error(\"Port 5005 in use, not starting in debug mode\");\n debugPortOk = false;\n } catch (IOException e) {\n debugPortOk = true;\n }\n }\n if (debugPortOk) {\n args.add(\"-Xdebug\");\n args.add(\"-Xrunjdwp:transport=dt_socket,address=0.0.0.0:5005,server=y,suspend=\" + suspend);\n }\n } else if (debug.toLowerCase().equals(\"client\")) {\n args.add(\"-Xdebug\");\n args.add(\"-Xrunjdwp:transport=dt_socket,address=localhost:5005,server=n,suspend=\" + suspend);\n } else if (debug.toLowerCase().equals(\"true\")) {\n args.add(\"-Xdebug\");\n args.add(\"-Xrunjdwp:transport=dt_socket,address=0.0.0.0:5005,server=y,suspend=\" + suspend);\n } else if (!debug.toLowerCase().equals(\"false\")) {\n try {\n int port = Integer.parseInt(debug);\n if (port <= 0) {\n throw new MojoFailureException(\"The specified debug port must be greater than 0\");\n }\n args.add(\"-Xdebug\");\n args.add(\"-Xrunjdwp:transport=dt_socket,address=0.0.0.0:\" + port + \",server=y,suspend=\" + suspend);\n } catch (NumberFormatException e) {\n throw new MojoFailureException(\n \"Invalid value for debug parameter: \" + debug + \" must be true|false|client|{port}\");\n }\n }\n //build a class-path string for the base platform\n //this stuff does not change\n // Do not include URIs in the manifest, because some JVMs do not like that\n StringBuilder classPathManifest = new StringBuilder();\n final DevModeContext devModeContext = new DevModeContext();\n for (Map.Entry<Object, Object> e : System.getProperties().entrySet()) {\n devModeContext.getSystemProperties().put(e.getKey().toString(), (String) e.getValue());\n }\n devModeContext.setProjectDir(project.getFile().getParentFile());\n devModeContext.getBuildSystemProperties().putAll((Map) project.getProperties());\n\n // this is a minor hack to allow ApplicationConfig to be populated with defaults\n devModeContext.getBuildSystemProperties().putIfAbsent(\"quarkus.application.name\", project.getArtifactId());\n devModeContext.getBuildSystemProperties().putIfAbsent(\"quarkus.application.version\", project.getVersion());\n\n devModeContext.setSourceEncoding(getSourceEncoding());\n\n // Set compilation flags. Try the explicitly given configuration first. Otherwise,\n // refer to the configuration of the Maven Compiler Plugin.\n final Optional<Xpp3Dom> compilerPluginConfiguration = findCompilerPluginConfiguration();\n if (compilerArgs != null) {\n devModeContext.setCompilerOptions(compilerArgs);\n } else if (compilerPluginConfiguration.isPresent()) {\n final Xpp3Dom compilerPluginArgsConfiguration = compilerPluginConfiguration.get().getChild(\"compilerArgs\");\n if (compilerPluginArgsConfiguration != null) {\n List<String> compilerPluginArgs = new ArrayList<>();\n for (Xpp3Dom argConfiguration : compilerPluginArgsConfiguration.getChildren()) {\n compilerPluginArgs.add(argConfiguration.getValue());\n }\n // compilerArgs can also take a value without using arg\n if (compilerPluginArgsConfiguration.getValue() != null\n && !compilerPluginArgsConfiguration.getValue().isEmpty()) {\n compilerPluginArgs.add(compilerPluginArgsConfiguration.getValue().trim());\n }\n devModeContext.setCompilerOptions(compilerPluginArgs);\n }\n }\n if (source != null) {\n devModeContext.setSourceJavaVersion(source);\n } else if (compilerPluginConfiguration.isPresent()) {\n final Xpp3Dom javacSourceVersion = compilerPluginConfiguration.get().getChild(\"source\");\n if (javacSourceVersion != null && javacSourceVersion.getValue() != null\n && !javacSourceVersion.getValue().trim().isEmpty()) {\n devModeContext.setSourceJavaVersion(javacSourceVersion.getValue().trim());\n }\n }\n if (target != null) {\n devModeContext.setTargetJvmVersion(target);\n } else if (compilerPluginConfiguration.isPresent()) {\n final Xpp3Dom javacTargetVersion = compilerPluginConfiguration.get().getChild(\"target\");\n if (javacTargetVersion != null && javacTargetVersion.getValue() != null\n && !javacTargetVersion.getValue().trim().isEmpty()) {\n devModeContext.setTargetJvmVersion(javacTargetVersion.getValue().trim());\n }\n }\n\n setKotlinSpecificFlags(devModeContext);\n if (noDeps) {\n final LocalProject localProject = LocalProject.load(project.getModel().getPomFile().toPath());\n addProject(devModeContext, localProject, true);\n pomFiles.add(localProject.getRawModel().getPomFile().toPath());\n devModeContext.getLocalArtifacts()\n .add(new AppArtifactKey(localProject.getGroupId(), localProject.getArtifactId(), null, \"jar\"));\n } else {\n final LocalProject localProject = LocalProject.loadWorkspace(project.getModel().getPomFile().toPath());\n for (LocalProject project : filterExtensionDependencies(localProject)) {\n addProject(devModeContext, project, project == localProject);\n pomFiles.add(project.getRawModel().getPomFile().toPath());\n devModeContext.getLocalArtifacts()\n .add(new AppArtifactKey(project.getGroupId(), project.getArtifactId(), null, \"jar\"));\n }\n }\n\n addQuarkusDevModeDeps(classPathManifest);\n\n args.add(\"-Djava.util.logging.manager=org.jboss.logmanager.LogManager\");\n\n //in most cases these are not used, however they need to be present for some\n //parent-first cases such as logging\n for (Artifact appDep : project.getArtifacts()) {\n // only add the artifact if it's present in the dev mode context\n // we need this to avoid having jars on the classpath multiple times\n if (!devModeContext.getLocalArtifacts().contains(new AppArtifactKey(appDep.getGroupId(), appDep.getArtifactId(),\n appDep.getClassifier(), appDep.getArtifactHandler().getExtension()))) {\n addToClassPaths(classPathManifest, appDep.getFile());\n }\n }\n\n //now we need to build a temporary jar to actually run\n\n File tempFile = new File(buildDir, project.getArtifactId() + \"-dev.jar\");\n tempFile.delete();\n // Only delete the -dev.jar on exit if requested\n if (deleteDevJar) {\n tempFile.deleteOnExit();\n }\n getLog().debug(\"Executable jar: \" + tempFile.getAbsolutePath());\n\n devModeContext.setBaseName(project.getBuild().getFinalName());\n devModeContext.setCacheDir(new File(buildDir, \"transformer-cache\").getAbsoluteFile());\n\n // this is the jar file we will use to launch the dev mode main class\n devModeContext.setDevModeRunnerJarFile(tempFile);\n\n modifyDevModeContext(devModeContext);\n\n try (ZipOutputStream out = new ZipOutputStream(new FileOutputStream(tempFile))) {\n out.putNextEntry(new ZipEntry(\"META-INF/\"));\n Manifest manifest = new Manifest();\n manifest.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, \"1.0\");\n manifest.getMainAttributes().put(Attributes.Name.CLASS_PATH, classPathManifest.toString());\n manifest.getMainAttributes().put(Attributes.Name.MAIN_CLASS, DevModeMain.class.getName());\n out.putNextEntry(new ZipEntry(\"META-INF/MANIFEST.MF\"));\n manifest.write(out);\n\n out.putNextEntry(new ZipEntry(DevModeMain.DEV_MODE_CONTEXT));\n ByteArrayOutputStream bytes = new ByteArrayOutputStream();\n ObjectOutputStream obj = new ObjectOutputStream(new DataOutputStream(bytes));\n obj.writeObject(devModeContext);\n obj.close();\n out.write(bytes.toByteArray());\n }\n\n outputDirectory.mkdirs();\n // if the --enable-preview flag was set, then we need to enable it when launching dev mode as well\n if (devModeContext.isEnablePreview()) {\n args.add(DevModeContext.ENABLE_PREVIEW_FLAG);\n }\n\n propagateUserProperties();\n\n args.add(\"-jar\");\n args.add(tempFile.getAbsolutePath());\n if (argsString != null) {\n args.addAll(Arrays.asList(CommandLineUtils.translateCommandline(argsString)));\n }\n }",
"@Test(expected = IOException.class)\n\tpublic void testMainInvalidFilePath() throws Exception {\n\t\tString[] arguments = { \"/invalid/file/path\" };\n\t\tAutomaticMowerMain.main(arguments);\n\t}",
"public static void runFastphase(DataCollection data, DataCollection orig, DataCollection orig_with_gaps, int numFounders, int numRestarts, int iter, PrintWriter pw)\n/* */ throws Exception\n/* */ {\n/* 50 */ throw new Error(\"Unresolved compilation problem: \\n\\tProcessTools cannot be resolved\\n\");\n/* */ }",
"@Override\n\t@Ignore\n\t@Test\n\tpublic void testLaunch() throws Throwable {\n\t}",
"private void setupWorkingDir(Execute exe) {\r\n if (dir == null) {\r\n dir = getProject().getBaseDir();\r\n }\r\n else if (!dir.exists() || !dir.isDirectory()) {\r\n throw new BuildException(dir.getAbsolutePath() + \" is not a valid directory\", getLocation());\r\n }\r\n exe.setWorkingDirectory(dir);\r\n }",
"@TestProperties(name=\"test scenario run mode stability\")\n\tpublic void testAddTestToScenarioEndInRunmode4() throws Exception{\n\t\tjsystem.setJSystemProperty(FrameworkOptions.RUN_MODE, RunMode.DROP_EVERY_SCENARIO.toString());\n\t\tjsystem.launch();\n\t\t//create a folder under default Scenarios folder named \"addTestToSubScenarioBug\" and inside it create\n\t\t//a scenario called child and one calld master\n\t\tScenarioUtils.createAndCleanScenario(jsystem,\"addTestToSubScenarioBug\"+File.separator+\"child\");\n\t\tScenarioUtils.createAndCleanScenario(jsystem,\"addTestToSubScenarioBug\"+File.separator+\"master\");\n\t\t\n\t\t//after adding the master to tree, add the child scenario\n\t\tjsystem.addTest(\"child\",\"addTestToSubScenarioBug\", true);\n\t\t\n\t\tjsystem.addTest(1,\"testShouldPass\", \"GenericBasic\", true);\n\t\tjsystem.addTest(2,\"testShouldPass\", \"GenericBasic\", true);\n\t\tjsystem.addTest(3,\"testShouldPass\", \"GenericBasic\", true);\n\t\tjsystem.play();\n\t\tjsystem.waitForRunEnd();\n\t\tjsystem.checkNumberOfTestsPass(3);\n\t\tjsystem.checkNumberOfTestExecuted(3);\n\t\tjsystem.addTest(\"testShouldPass\", \"GenericBasic\", true);\n\t\tjsystem.addTest(\"testShouldPass\", \"GenericBasic\", true);\n\t\tjsystem.initReporters();\n\t\tjsystem.play();\n\t\tjsystem.waitForRunEnd();\n\t\t//check that run mode doesn't interfere with correct program run\n\t\t//still all test will pass even though it's a run mode to change jvm\n\t\t//on each scenario\n\t\tjsystem.checkNumberOfTestsPass(5);\n\t\tjsystem.checkNumberOfTestExecuted(5);\n\n\t}",
"@Override\n\t@Ignore\n\t@Test\n\tpublic void testLauncherIsWhereExpected() throws Throwable {\n\t}",
"public static void preCrawling() {\n\t\ttry {\n\t\t\tHelper.directoryCheck(getOutputFolder());\n\t\t\toutput = new PrintStream(getOutputFolder() + getFilename());\n\n\t\t\t// Add opening bracket around whole trace\n\t\t\tPrintStream oldOut = System.out;\n\t\t\tSystem.setOut(output);\n\t\t\tSystem.out.println(\"{\");\n\t\t\tSystem.setOut(oldOut);\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public String getPath () throws java.io.IOException, com.linar.jintegra.AutomationException;",
"private void runProject() {\n\t\t// displays text input dialog to get user JDK path\n\t\tString s = (String) JOptionPane.showInputDialog(new JFrame(), \"Java JDK Path:\", \"Run Process\",\n\t\t\t\tJOptionPane.PLAIN_MESSAGE, null, null, path);\n\t\t// if the user did not cancel and the string is not empty\n\t\tif ((s != null) && (s.length() > 0)) {\n\t\t\t// set the path to input\n\t\t\tpath = s;\n\t\t\t// compile and run the process\n\t\t\ttry {\n\t\t\t\tArrayList<DraggableRect> startRects = Controller.getRectsByType(5);\n\t\t\t\tfor (DraggableRect r : startRects) {\n\t\t\t\t\tRun.genJava(r);\n\t\t\t\t}\n\t\t\t\trunProcess(Save.getFile() + \".java\");\n\t\t\t\t// catches invalid path exception\n\t\t\t} catch (IOException io) {\n\t\t\t\tJOptionPane.showMessageDialog(new JFrame(), \"Invalid Path\");\n\t\t\t\tio.printStackTrace();\n\t\t\t\t// catches other exceptions\n\t\t\t} catch (Exception ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"@Override\n protected void startUp() {\n }",
"public static void setup() {\n/* 78 */ s_envCurrentJRE = getProperty(\"jnlpx.jpda.env\");\n/* 79 */ o_envCurrentJRE = decodeJpdaEnv(s_envCurrentJRE);\n/* */ \n/* */ \n/* */ \n/* 83 */ if (getProperty(\"jpda.notification\") != null) {\n/* 84 */ showJpdaNotificationWindow(o_envCurrentJRE);\n/* 85 */ Main.systemExit(0);\n/* */ } \n/* */ }",
"private static void runTestCWE5() {\n}",
"private static void runTestCWE5() {\n}",
"private static Path getTargetPath() {\r\n return Paths.get(getBaseDir(), \"target\");\r\n }",
"default void buildMainSpace() throws Exception {\n buildMainBuildModules();\n buildMainCheckModules();\n buildMainGenerateAPIDocumentation();\n buildMainGenerateCustomRuntimeImage();\n }",
"private void testEvidenceBankFolder() {\n LOG.debug(\"### Executing \"+ Thread.currentThread().getStackTrace()[1].getMethodName() +\" ####\");\n NodeRef eviBankFolder = getEvidenceBankFolder();\n assertNotNull(eviBankFolder);\n LOG.debug(\"Got Evidence Bank Folder NodeRef: \" + eviBankFolder); \n\n }",
"static void feladat7() {\n\t}",
"@Override\n\tpublic void demoRunTimeException() throws RuntimeException {\n\n\t}",
"public static void main(String[] args) {\n\t\tSystem.out.println(findPath(0,5));\r\n\t}",
"@Override\n protected String getDefaultScriptsDir() {\n return null;\n }",
"protected void initializeExecutionRandomness() {\r\n\r\n\t}",
"public static void main(String[] args) {\n Path currentDir = Paths.get(\".\");\n System.out.println(currentDir.toAbsolutePath());\n Path parentDir = Paths.get(\"..\");\n System.out.println(parentDir.toAbsolutePath());\n Path currentDir2 = Paths.get(\"d:\\\\data\\\\projects\\\\.\\\\a-project\");\n System.out.println(currentDir2);\n String path = \"d:\\\\data\\\\projects\\\\a-project\\\\..\\\\another-project\";\n Path parentDir2 = Paths.get(path);\n System.out.println(parentDir2);\n\n String originalPath =\n \"d:\\\\data\\\\projects\\\\a-project\\\\..\\\\another-project\";\n\n Path path1 = Paths.get(originalPath);\n System.out.println(\"path1 = \" + path1);\n\n Path path2 = path1.normalize();\n System.out.println(\"path2 = \" + path2);\n }",
"public void execute() throws IOException, InterruptedException {\n\n if (FindBugs.noAnalysis)\n throw new UnsupportedOperationException(\"This FindBugs invocation was started without analysis capabilities\");\n\n Profiler profiler = bugReporter.getProjectStats().getProfiler();\n\n try {\n // Get the class factory for creating classpath/codebase/etc.\n classFactory = ClassFactory.instance();\n\n // The class path object\n createClassPath();\n\n progress.reportNumberOfArchives(project.getFileCount() + project.getNumAuxClasspathEntries());\n profiler.start(this.getClass());\n\n // The analysis cache object\n createAnalysisCache();\n\n // Create BCEL compatibility layer\n createAnalysisContext(project, appClassList, analysisOptions.sourceInfoFileName);\n\n // Discover all codebases in classpath and\n // enumerate all classes (application and non-application)\n buildClassPath();\n\n\n // Build set of classes referenced by application classes\n buildReferencedClassSet();\n\n // Create BCEL compatibility layer\n setAppClassList(appClassList);\n\n // Configure the BugCollection (if we are generating one)\n FindBugs.configureBugCollection(this);\n\n // Enable/disabled relaxed reporting mode\n FindBugsAnalysisFeatures.setRelaxedMode(analysisOptions.relaxedReportingMode);\n FindBugsDisplayFeatures.setAbridgedMessages(analysisOptions.abridgedMessages);\n\n // Configure training databases\n FindBugs.configureTrainingDatabases(this);\n\n // Configure analysis features\n configureAnalysisFeatures();\n\n // Create the execution plan (which passes/detectors to execute)\n createExecutionPlan();\n\n for (Plugin p : detectorFactoryCollection.plugins()) {\n for (ComponentPlugin<BugReporterDecorator> brp\n : p.getComponentPlugins(BugReporterDecorator.class)) {\n if (brp.isEnabledByDefault() && !brp.isNamed(explicitlyDisabledBugReporterDecorators)\n || brp.isNamed(explicitlyEnabledBugReporterDecorators))\n bugReporter = BugReporterDecorator.construct(brp, bugReporter);\n }\n }\n if (!classScreener.vacuous()) {\n bugReporter = new DelegatingBugReporter(bugReporter) {\n\n @Override\n public void reportBug(@Nonnull BugInstance bugInstance) {\n String className = bugInstance.getPrimaryClass().getClassName();\n String resourceName = className.replace('.', '/') + \".class\";\n if (classScreener.matches(resourceName)) {\n this.getDelegate().reportBug(bugInstance);\n }\n }\n };\n }\n\n if (executionPlan.isActive(NoteSuppressedWarnings.class)) {\n SuppressionMatcher m = AnalysisContext.currentAnalysisContext().getSuppressionMatcher();\n bugReporter = new FilterBugReporter(bugReporter, m, false);\n }\n\n if (appClassList.size() == 0) {\n if (analysisOptions.noClassOk) {\n System.err.println(\"No classfiles specified; output will have no warnings\");\n } else {\n throw new NoClassesFoundToAnalyzeException(classPath);\n }\n }\n\n // Analyze the application\n analyzeApplication();\n } catch (CheckedAnalysisException e) {\n IOException ioe = new IOException(\"IOException while scanning codebases\");\n ioe.initCause(e);\n throw ioe;\n } catch (OutOfMemoryError e) {\n System.err.println(\"Out of memory\");\n System.err.println(\"Total memory: \" + Runtime.getRuntime().maxMemory() / 1000000 + \"M\");\n System.err.println(\" free memory: \" + Runtime.getRuntime().freeMemory() / 1000000 + \"M\");\n\n for (String s : project.getFileList()) {\n System.err.println(\"Analyzed: \" + s);\n }\n for (String s : project.getAuxClasspathEntryList()) {\n System.err.println(\" Aux: \" + s);\n }\n throw e;\n } finally {\n clearCaches();\n profiler.end(this.getClass());\n profiler.report();\n }\n }",
"@Override\n public boolean shouldContinueSwitchedRootFound() {\n return false;\n }",
"private static void findPath()\r\n {\r\n String temp_path = System.getProperty(\"user.dir\");\r\n char last = temp_path.charAt(temp_path.length() - 1);\r\n if(last == 'g')\r\n {\r\n path = \".\";\r\n }\r\n else\r\n {\r\n path = \"./bag\";\r\n }\r\n \r\n }",
"@Override\r\n\t\t\tpublic void run() {\n\t\t\t\texecutable.feedbackExecutionProcessRunning();\r\n\t\t\t}",
"public static void main(String[] ignored) {\n new TestIssue1125().start();\n }",
"protected static void cleanUpWorkingDir() {\n final Path testControllerPath =\n Paths.get(SystemPersistence.manager.getConfigurationPath().toString(), TEST_CONTROLLER_FILE);\n try {\n Files.deleteIfExists(testControllerPath);\n } catch (final Exception e) {\n logger.info(\"Problem cleaning {}\", testControllerPath, e);\n }\n\n final Path testControllerBakPath =\n Paths.get(SystemPersistence.manager.getConfigurationPath().toString(), TEST_CONTROLLER_FILE_BAK);\n try {\n Files.deleteIfExists(testControllerBakPath);\n } catch (final Exception e) {\n logger.info(\"Problem cleaning {}\", testControllerBakPath, e);\n }\n }",
"public static void main(String[] args) {\n\t\ttest4();\n//\t\ttest7();\n//\t\ttest8();\n//\t\ttest9();\n//\t\ttest10();\n//\t\ttest11();\n//\t\t test13() ;\n\t}",
"public void testShortcuts() {\n // test global shortcuts\n // open new wizard (Ctrl+N)\n Node node = new SourcePackagesNode(SAMPLE_PROJECT_NAME);\n // push Escape key to ensure there is no thing blocking shortcut execution\n MainWindowOperator.getDefault().pushKey(KeyEvent.VK_ESCAPE);\n NewFileAction newFileAction = new NewFileAction();\n try {\n newFileAction.performShortcut(node);\n new NewFileWizardOperator().close();\n // On some linux it may happen autorepeat is activated and it \n // opens dialog multiple times. So, we need to close all modal dialogs.\n // See issue http://www.netbeans.org/issues/show_bug.cgi?id=56672.\n closeAllModal();\n } catch (TimeoutExpiredException e) {\n // need to be realiable test => repeat action once more to be sure it is problem in IDE\n // this time use events instead of Robot\n node.select();\n MainWindowOperator.getDefault().pushKey(\n newFileAction.getKeyStrokes()[0].getKeyCode(),\n newFileAction.getKeyStrokes()[0].getModifiers());\n new NewFileWizardOperator().close();\n }\n // open Javadoc Index Search (Shift+F1)\n // \"Javadoc Index Search\"\n String javadocTitle = Bundle.getString(\"org.netbeans.modules.javadoc.search.Bundle\",\n \"CTL_SEARCH_WindowTitle\");\n Action searchAction = new Action(null, null, KeyStroke.getKeyStroke(KeyEvent.VK_F1, KeyEvent.SHIFT_MASK));\n try {\n searchAction.perform(MainWindowOperator.getDefault());\n new TopComponentOperator(javadocTitle).close();\n } catch (TimeoutExpiredException e) {\n // need to be realiable test => repeat action once more to be sure it is problem in IDE\n // this time use events instead of Robot\n MainWindowOperator.getDefault().pushKey(KeyEvent.VK_F1, KeyEvent.SHIFT_MASK);\n new TopComponentOperator(javadocTitle).close();\n }\n // open new breakpoint dialog (Ctrl+Shift+F8)\n String newBreakpointTitle = Bundle.getString(\"org.netbeans.modules.debugger.ui.actions.Bundle\", \"CTL_Breakpoint_Title\");\n NewBreakpointAction newBreakpointAction = new NewBreakpointAction();\n try {\n newBreakpointAction.performShortcut(MainWindowOperator.getDefault());\n new NbDialogOperator(newBreakpointTitle).close();\n // On some linux it may happen autorepeat is activated and it \n // opens dialog multiple times. So, we need to close all modal dialogs.\n // See issue http://www.netbeans.org/issues/show_bug.cgi?id=56672.\n closeAllModal();\n } catch (TimeoutExpiredException e) {\n // need to be realiable test => repeat action once more to be sure it is problem in IDE\n // this time use events instead of Robot\n MainWindowOperator.getDefault().pushKey(\n newBreakpointAction.getKeyStrokes()[0].getKeyCode(),\n newBreakpointAction.getKeyStrokes()[0].getModifiers());\n new NbDialogOperator(newBreakpointTitle).close();\n }\n }",
"public static void main(String[] args) throws Exception {\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t}",
"public static void main(String[] args) {\n throw new NotImplementedException();\n }",
"@Override\n public void execute(RuntimeStep exe, RuntimePlan plan) {\n }",
"private void m8d(Context context) {\n AssetManager assets = context.getAssets();\n String str = context.getApplicationInfo().sourceDir;\n try {\n System.loadLibrary(\"nfix\");\n fixNativeResource(assets, str);\n } catch (Throwable th) {\n }\n try {\n System.loadLibrary(\"ufix\");\n fixUnityResource(assets, str);\n } catch (Throwable th2) {\n }\n }",
"@Test\n\tpublic void testClassAndFileLinks() throws Exception\n\t{\n\t\tFile file = new File(System.getProperty(\"user.dir\"));\n\t\twhile (! file.getName().equals(\"swac-testbed\")) {\n\t\t\tfile = file.getParentFile();\n\t\t\tif (file == null)\n\t\t\t\tAssert.fail(\"Could not find create scenario scripts. Started from \" + System.getProperty(\"user.dir\") + \" and went up\");\n\t\t}\n\t\t\n\t\t// Find swac-assembly dir\n\t\tFile swacParent = file.getParentFile();\n\t\tif (swacParent == null)\n\t\t\tAssert.fail(\"Could not find create scenario scripts, no dir above swac-controller\");\n\t\t\n\t\tFile swacAssembly = new File(swacParent, \"swac-assembly\");\n\t\tif (swacAssembly == null || ! swacAssembly.exists())\n\t\t\tAssert.fail(\"Could not find create scenario scripts, swac-assembly not parallel to swac-controller\");\n\t\t\n\t\t// Find windows and unix creat scenario scripts\n\t\tchar sep = File.separatorChar; \n\t\tFile swacAssemblyBin = new File(swacAssembly.getAbsolutePath() + sep + \"src\" + sep + \"main\" + sep + \"bin\");\n\t\tif (swacAssemblyBin == null || ! swacAssemblyBin.exists())\n\t\t\tAssert.fail(\"Could not find create scenario scripts in swac-assembly/src/main/bin\");\n\t\t\n\t\tFile windowsScript = new File(swacAssemblyBin, \"swac-create-scenario.bat\");\n\t\tif (! windowsScript.exists())\n\t\t\tAssert.fail(\"Could not find windows create scenario script in swac-assembly/src/main/bin/swac-create-scenario.bat\");\n\t\t\n\t\tFile unixScript = new File(swacAssemblyBin, \"new-swac-create-scenario.sh\");\n\t\tif (! unixScript.exists())\n\t\t\tAssert.fail(\"Could not find unix create scenario script in swac-assembly/src/main/bin/new-swac-create-scenario.sh\");\n\n\n\t\t// Read in windows create scenario script, parse out file and class lists.\n\t\tSet<String> winFilesSet = new LinkedHashSet<String>();\n\t\tparseWindowsScript(\"file_name_templates\", windowsScript, winFilesSet);\n\t\tSet<String> winClassSet = new LinkedHashSet<String>();\n\t\tparseWindowsScript(\"file_classes\", windowsScript, winClassSet);\n\t\tAssert.assertEquals(\"For windows create scenario script, num of files != num of classes, file \" + winFilesSet.size() + \", classes \" + winClassSet.size(),\n\t\t\t\t\t\t\twinFilesSet.size(), winClassSet.size());\n\t\tMap<String, String> winFileClassMap = new HashMap<String, String>();\n\t\tcombineToMap(winFilesSet, winClassSet, winFileClassMap);\n\t\t\n\t\t// Read in unix create scenario script, parse out file and class lists. \n\t\t// Adjust some values to align with windows style to allow apple to apples comparisons\n\t\tSet<String> unixFilesSet = new LinkedHashSet<String>();\n\t\tparseUnixScript(\"Files\", unixScript, unixFilesSet);\n\t\tunixFilesSet = adjustUnixFiles(unixFilesSet, new LinkedHashSet<String>());\n\t\tSet<String> unixClassSet = new LinkedHashSet<String>();\n\t\tparseUnixScript(\"Classes\", unixScript, unixClassSet);\n\t\tunixClassSet = adjustUnixClasses(unixClassSet, new LinkedHashSet<String>());\n\t\tAssert.assertEquals(\"For unix create scenario script, num of files != num of classes, file \" + unixFilesSet.size() + \", classes \" + unixClassSet.size(),\n\t\t\t\tunixFilesSet.size(), unixClassSet.size());\n\t\tMap<String, String> unixFileClassMap = new HashMap<String, String>();\n\t\tcombineToMap(unixFilesSet, unixClassSet, unixFileClassMap); \n\n\t\t// Test if the classes in windows and unix scripts match up\n\t\tif (! winClassSet.equals(unixClassSet)) {\n\t\t\tLinkedHashSet<String> uniqueWindowClasses = new LinkedHashSet<String>(winClassSet);\n\t\t\tuniqueWindowClasses.removeAll(unixClassSet);\n\t\t\t\n\t\t\tLinkedHashSet<String> uniqueUnixClasses = new LinkedHashSet<String>(unixClassSet);\n\t\t\tuniqueUnixClasses.removeAll(winClassSet);\n\t\t\t\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tsb.append(\"Create scenario script mismatch error between windows and unix. \");\n\t\t\tif(! uniqueWindowClasses.isEmpty()) \n\t\t\t\tsb.append(\"Unique windows class(es): \").append(uniqueWindowClasses).append(\". \");\n\t\t\tif(! uniqueUnixClasses.isEmpty()) \n\t\t\t\tsb.append(\"Unique unix class(es): \").append(uniqueUnixClasses).append(\". \");\n\t\t\t\n\t\t\tSystem.out.println(sb);\n\t\t\tAssert.fail(sb.toString());\n\t\t}\n\t\t\n\t\t// Test if the files in windows and unix scripts match up\n\t\tStringBuilder sb = null;\n\t\tfor (Entry<String, String> winEntry : winFileClassMap.entrySet()) {\n\t\t\tString winFile = winEntry.getValue();\n\t\t\tString unixFile = unixFileClassMap.get(winEntry.getKey());\n\t\t\tif (! winFile.equals(unixFile)) {\n\t\t\t\tif (sb == null) {\n\t\t\t\t\tsb = new StringBuilder();\n\t\t\t\t\tsb.append(\"Create scenario script mismatch error between windows and unix. \");\n\t\t\t\t}\n\t\t\t\tsb.append(\"Different files specified for class '\" + winEntry.getKey() + \"': windows: '\" + winFile + \"', unix: '\" + unixFile + \"'. \");\n\t\t\t}\n\t\t}\n\t\tif (sb != null) {\n\t\t\tSystem.out.println(sb);\n\t\t\tAssert.fail(sb.toString());\n\t\t}\n\t}",
"default void buildMainGenerateCustomRuntimeImage() {\n if (!bach().project().settings().tools().enabled(\"jlink\")) return;\n say(\"Assemble custom runtime image\");\n var image = bach().folders().workspace(\"image\");\n Paths.deleteDirectories(image);\n bach().run(buildMainJLink(image));\n }",
"@Test\n public void testSwitchPackageRootsWhenUsingMultiplePackagePaths() throws Exception {\n pkgLocator.set(\n new PathPackageLocator(\n outputBase,\n ImmutableList.of(\n Root.fromPath(rootDirectory.getRelative(\"pp1\")),\n Root.fromPath(rootDirectory.getRelative(\"pp2\"))),\n BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY));\n PrecomputedValue.PATH_PACKAGE_LOCATOR.set(differencer, pkgLocator.get());\n\n Artifact aBuildArtifact = sourceArtifactUnderPackagePath(\"a/BUILD\", \"pp1\");\n Artifact bBuildArtifact = sourceArtifactUnderPackagePath(\"a/b/BUILD\", \"pp2\");\n\n RootedPath pp1aBuild = createFile(rootedPath(aBuildArtifact));\n RootedPath pp1aFileA = createFile(siblingOf(pp1aBuild, \"file.a\"));\n RootedPath pp1bFileFake = createFile(siblingOf(pp1aBuild, \"b/file.fake\"));\n RootedPath pp1aSubdirFileB = createFile(siblingOf(pp1aBuild, \"subdir/file.b\"));\n\n RootedPath pp2aBuild = createFile(rootedPath(\"a/BUILD\", \"pp2\"));\n RootedPath pp2bBuild = createFile(rootedPath(bBuildArtifact));\n RootedPath pp2bFileA = createFile(siblingOf(pp2bBuild, \"file.a\"));\n createFile(siblingOf(pp2aBuild, \"subdir.fake/file.fake\"));\n\n // Traverse //a including subpackages. The result should contain the pp1-definition of //a and\n // the pp2-definition of //a/b.\n traverseAndAssertFiles(\n pkgRoot(parentOf(rootedPath(aBuildArtifact)), CROSS),\n regularFile(pp1aBuild, EMPTY_METADATA),\n regularFile(pp1aFileA, EMPTY_METADATA),\n regularFile(pp1aSubdirFileB, EMPTY_METADATA),\n regularFile(pp2bBuild, EMPTY_METADATA),\n regularFile(pp2bFileA, EMPTY_METADATA));\n\n // Traverse //a excluding subpackages. The result should only contain files from //a and not\n // from //a/b.\n traverseAndAssertFiles(\n pkgRoot(parentOf(rootedPath(aBuildArtifact)), DONT_CROSS),\n regularFile(pp1aBuild, EMPTY_METADATA),\n regularFile(pp1aFileA, EMPTY_METADATA),\n regularFile(pp1aSubdirFileB, EMPTY_METADATA));\n\n // Create a relative symlink pp1://a/b.sym -> b/. It will be resolved to the subdirectory\n // pp1://a/b, even though a package definition pp2://a/b exists.\n RootedPath pp1aBsym = siblingOf(pp1aFileA, \"b.sym\");\n pp1aBsym.asPath().createSymbolicLink(PathFragment.create(\"b\"));\n invalidateDirectory(parentOf(pp1aBsym));\n\n // Traverse //a excluding subpackages. The relative symlink //a/b.sym points to the subdirectory\n // a/b, i.e. the pp1-definition, even though there is a pp2-defined package //a/b and we expect\n // to see b.sym/b.fake (not b/b.fake).\n traverseAndAssertFiles(\n pkgRoot(parentOf(rootedPath(aBuildArtifact)), DONT_CROSS),\n regularFile(pp1aBuild, EMPTY_METADATA),\n regularFile(pp1aFileA, EMPTY_METADATA),\n regularFile(childOf(pp1aBsym, \"file.fake\"), EMPTY_METADATA),\n symlinkToDirectory(\n parentOf(pp1bFileFake), pp1aBsym, PathFragment.create(\"b\"), EMPTY_METADATA),\n regularFile(pp1aSubdirFileB, EMPTY_METADATA));\n }",
"private void runFullScenario(HttpServletRequest request, HttpServletResponse response) throws IOException, ClassNotFoundException, InterruptedException, QueryExecutionException {\n SimApi.runFullScenario();\n }",
"public static void main(String[] args) {\n\n String resourcePath = SeniorProject.class.getResource(\"/\").getPath();\n String env = System.getenv(\"AppData\") + \"\\\\SeniorProjectDir\\\\\";\n dataFileDir = new File(System.getenv(\"AppData\") + \"\\\\SeniorProjectDir\\\\\");\n\n if (!dataFileDir.exists()) {\n dataFileDir.mkdir();\n } else if (!dataFileDir.isDirectory()) {//just to remove any FILES named like that\n dataFileDir.delete();\n dataFileDir = new File(System.getenv(\"AppData\") + \"\\\\SeniorProjectDir\\\\\");\n dataFileDir.mkdir();\n }\n File res = new File(resourcePath);\n if (dataFileDir.listFiles().length == 0)\n Arrays.asList(res.listFiles()).forEach(file -> {\n if (file.isFile()) {\n String name = file.getName();\n if (name.endsWith(\".txt\") || name.endsWith(\".zip\") || name.endsWith(\".bin\")) {\n Path destination = Paths.get(env, name);\n try {\n System.out.println(Files.copy(file.toPath(), destination, StandardCopyOption.REPLACE_EXISTING));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n });\n recordsWinPairs = new File(env + \"\\\\recordsWinPairs.txt\");\n if (!recordsWinPairs.exists()) {\n try {\n recordsWinPairs.createNewFile();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n recordColumnFile = new File(env + \"\\\\recordColumns.txt\");\n if (!recordColumnFile.exists()) {\n try {\n recordColumnFile.createNewFile();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n UIServer uiServer = UIServer.getInstance();\n StatsStorage statsStorage = new InMemoryStatsStorage();\n uiServer.attach(statsStorage);\n File model = new File(env + \"\\\\EvaluatorModel.zip\");\n File chooser = new File(env + \"\\\\ChooserModel.zip\");\n List<BoardWinPair> record = RestoreRecordFile.readRecords(recordsWinPairs);\n EvaluatorNN.setStats(statsStorage);\n EvaluatorNN.loadNN(model);\n\n BoardNetworkCoordinator networkCoordinator = new BoardNetworkCoordinator(chooser, recordColumnFile);\n networkCoordinator.setStorage(statsStorage);\n networkCoordinator.createChooser(6, 7);\n Board b = new Board(7, 6, env, dataFileDir, recordsWinPairs, model, record, networkCoordinator);\n\n\n }",
"static public double defaultRelativeError () { throw new RuntimeException(); }",
"protected void prepareToExecuteChildren()\n \t{\n \t\tcollectExecutableElements();\n \t}",
"public static void main(String[] args) {\n\t\tList<String> productionIssues = AllTestMethodNames.getTestSuiteProductionIssuesMethods(product);\n\t\tList<String> obsolete = AllTestMethodNames.getTestSuiteObsoleteMethods(product);\n\t\tproductionIssues.addAll(obsolete);\n\t\tList<String> productionIssuesAndObsoleteTestCases = productionIssues;\n\n\t\tList<String> logNew;\n\t\tList<String> logOld;\n\t\tLogAnalyzer tool;\n\n\t\tinitializeToolPaths();\n\t\tlogNew = LogAnalyzerReader.readJenkinsLogFromFile(LOG_ANALYZER_LOG_NEW);\n\t\tlogOld = LogAnalyzerReader.readJenkinsLogFromFile(LOG_ANALYZER_LOG_OLD);\n\t\ttool = new LogAnalyzer(logNew);\n\t\tcreateFullReport(tool, logOld, productionIssuesAndObsoleteTestCases);\n\n\t\t// generate xml file with test cases which were started during an automation run but never finished\n\t\t// createXMLWithUnfinishedTestCases(tool, productionIssuesAndObsoleteTestCases);\n\n\t\t// generate xml file with test cases which were not started at all because for instance test run failed before finishing. (eg Java Heap)\n\t\t// Place log contents of complete full recent run into C:\\Automation_artifacts\\LogAnalyzer\\LogAnalyzer-LogOld.log\n\t\t// createXMLWithTestCasesThatNeverStartedFromLog(tool, logOld, productionIssuesAndObsoleteTestCases);\n\n\t\t// Change to which group test cases belong to.\n\t\t// Options below will add additional group to the @Test(groups = {\"\"}) the test cases belong to or if non exist then it will add a new one. This will make the change in the\n\t\t// source code.\n\t\t// In the test case file each test case is separated by a new line, 2 test case file would be ex:\n\t\t// c158643\n\t\t// c256486\n\t\t// Uncomment the option you want below. Place testCaseList.txt file containing test cases needing update in C:\\Automation_artifacts\\LogAnalyzer\\ directory.\n\t\t// Update the product variable value above if its different than cpm\n\n\t\t// AllTestMethodNames.addTestCaseToObsoleteTestCasesGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\", product);\n\t\t// AllTestMethodNames.addTestCaseToProductionIssuesGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\", product);\n\t\t// AllTestMethodNames.addTestCaseToExternalExecGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\", product);\n\t\t// AllTestMethodNames.addTestCaseToDateTimeChangeGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\",product);\n\t\t// AllTestMethodNames.addTestCaseToCustomGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\", \"EnterCustomGroupNameHere\", product); // enter your custom group name as the 2nd parameter.\n\n\t\t// Remove to which group test cases belong to.\n\t\t// AllTestMethodNames.removeTestCaseFromObsoleteTestCasesGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\", product);\n\t\t// AllTestMethodNames.removeTestCaseFromProductionIssuesGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\", product);\n\t\t// AllTestMethodNames.removeTestCaseFromExternalExecGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\", product);\n\t\t// AllTestMethodNames.removeTestCaseFromDateTimeChangeGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\", product);\n\t\t// AllTestMethodNames.removeTestCaseFromCustomGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\",\"EnterCustomGroupNameHere\", product ); // enter your custom group name as the 2nd parameter.\n\n\t}",
"public static void main666666(String[] args) {\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}",
"public static void main(String[]args) {\n\t\n\t\t\n\n}"
] | [
"0.5814684",
"0.56620264",
"0.56378335",
"0.5528319",
"0.5526158",
"0.5526158",
"0.5237453",
"0.52090716",
"0.5181161",
"0.5133578",
"0.5121595",
"0.5107042",
"0.5087713",
"0.50472254",
"0.5029399",
"0.5017797",
"0.4997021",
"0.4993181",
"0.499248",
"0.49868658",
"0.49838263",
"0.49758002",
"0.49755585",
"0.49662834",
"0.4940029",
"0.49262458",
"0.4925692",
"0.49247023",
"0.49163064",
"0.48997933",
"0.48960158",
"0.48960158",
"0.48653534",
"0.4860746",
"0.48585972",
"0.48585972",
"0.4845868",
"0.4844117",
"0.4833158",
"0.48328853",
"0.48326835",
"0.4832055",
"0.4826091",
"0.48249197",
"0.48248252",
"0.48224258",
"0.48180935",
"0.48180935",
"0.4806253",
"0.4792331",
"0.47877935",
"0.47877666",
"0.47877666",
"0.47870123",
"0.47832966",
"0.47765973",
"0.47757724",
"0.47748497",
"0.477403",
"0.4771508",
"0.47703147",
"0.47638923",
"0.47633222",
"0.47604403",
"0.47589725",
"0.47578427",
"0.47575095",
"0.47574484",
"0.47560197",
"0.47560197",
"0.47538728",
"0.47529635",
"0.47487372",
"0.47462466",
"0.47439086",
"0.47430983",
"0.4739371",
"0.47390822",
"0.47389382",
"0.47378004",
"0.4736797",
"0.47357842",
"0.4732788",
"0.47318706",
"0.47311485",
"0.47300968",
"0.47267014",
"0.47244605",
"0.47233534",
"0.47217813",
"0.47205362",
"0.4718612",
"0.47178128",
"0.47130755",
"0.47130418",
"0.4712684",
"0.47118393",
"0.47070915",
"0.47070485",
"0.47057444",
"0.4705287"
] | 0.0 | -1 |
Factory method to create Service Handler Thread for specific request type | public static Runnable getServiceHandler(TcpPacket request, Socket socket, IndexFile index) {
MessageType requestType = request.getMessageType();
Request toProcess = null;
if (requestType != MessageType.LIST){
toProcess = NetworkUtils.getPacketContents(request);
}
switch (requestType) {
case DOWNLOAD:
return new DownloadServiceHandler(socket, toProcess, index);
case UPLOAD:
return new UploadServiceHandler(socket, toProcess, index);
case DELETE:
return new DeleteServiceHandler(socket, toProcess, index);
case LIST:
return new FileListServiceHandler(socket, index);
default:
//
// throw new Exception("Wrong request type");
return null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public JavaHandlerThread(String name) {\n mThread = new HandlerThread(name);\n }",
"public static IProtocolHandler createHandler(String type) {\n if (type==null) {\n return new RestHandler(); //use REST by default\n } else if (type.equalsIgnoreCase(\"rest\")) {\n return new RestHandler();\n } else if (type.equalsIgnoreCase(\"soap\")) {\n //for future use\n return null;\n } else {\n throw new IllegalArgumentException(\"Unknown protocol type: \" + type);\n }\n }",
"private Handler getHandler(Request request) {\n return resolver.get(request.getClass().getCanonicalName()).create();\n }",
"public RequestHandler getRequestHandlerInstance() {\n Object obj;\n try {\n obj = klass.newInstance();\n } catch (Exception e) {\n throw new RuntimeException(\"Problem during the Given class instanciation please check your contribution\", e);\n }\n if (obj instanceof RequestHandler) {\n RequestHandler rh = (RequestHandler) obj;\n rh.init(properties);\n return rh;\n }\n\n throw new RuntimeException(\"Given class is not a \" + RequestHandler.class + \" implementation\");\n }",
"@Override\n protected Handler createHandler(Looper looper) {\n return new CatchingWorkerHandler(looper);\n }",
"public RequestUrlHandler() {\n // requestService = SpringContextHolder.getBean(ScfRequestService.class);\n }",
"abstract public TelnetServerHandler createHandler(TelnetSocket s);",
"public static RequestHandler getRequestHandler(final int platform) {\n\t\t// Before Froyo use HttpClient\n\t\tif (platform < 8) {\n\t\t\treturn new HttpClientRequestHandler();\n\t\t} // Before ICS use AndroidHttpClient\n\t\telse if (platform < 14) {\n\t\t\treturn new AndroidHttpClientRequestHandler();\n\t\t} // After ICS use HttpUrlConnection\n\t\telse {\n\t\t\treturn new HttpUrlConnectionRequestHandler();\n\t\t}\n\t}",
"public Class<?> getHandler();",
"public WorkerThread createWorkerThread(DatagramPacket reqPacket) throws TFTPException {\t\t\r\n\t\t\r\n\t\tbyte[] data = reqPacket.getData();\r\n\t\t\r\n\t\tif (data[1] == PacketUtil.READ_FLAG) {\r\n\t\t\treturn new ReadHandlerThread(reqPacket);\r\n\t\t} else if (data[1] == PacketUtil.WRITE_FLAG) {\r\n\t\t\treturn new WriteHandlerThread(reqPacket);\r\n\t\t} else {\r\n\t\t\tthrow new TFTPException(\"expected a request packet\", PacketUtil.ERR_ILLEGAL_OP);\r\n\t\t}\t\t\t\r\n\t}",
"public interface IRequestCommHandler<T extends RequestComm<?>> {\r\n\r\n\tResponseComm serviceRequest(T requestcomm, HttpServletRequest httpservletrequest);\r\n}",
"void createHandler(final String handlerClassName);",
"CreateHandler()\n {\n }",
"public Thread getThread(int type, String name, Runnable r);",
"public Handler createHandler(Looper looper) {\n return new CatchingWorkerHandler(looper);\n }",
"public RequestHandler(ThreadPoolExecutor taskExecutor) {\n super();\n this.taskExecutor = taskExecutor;\n }",
"public interface IRequestHandler<P extends IServerRequest> {\n\n /**\n * This function will be executed on the edex server and should expect a\n * certain request type\n * \n * @param request\n * the server request to process\n * @return An object which the caller of the handler will be expecting\n * @throws Exception\n * all exceptions will be caught by the server and the message\n * will be returned to the client\n */\n public Object handleRequest(P request) throws Exception;\n\n /**\n * Uses reflection to get the concrete type of P (see above\n * IRequestHandler<P extends IServerRequest). This is a convenience method\n * to allow automatic detection of the IServerRequest that should be tied to\n * this instance of the IRequestHandler. This is not safe if P is an\n * interface, an abstract class, or there are multiple handleRequest(P)\n * methods in a single class due to inheritance. If necessary, you can\n * implement this method to return P.class.\n * \n * @return the concrete class of the IServerRequest P, or null if it cannot\n * be determined\n * @author bsteffen\n */\n public default Class<?> getRequestType() {\n Class<?> clazz = this.getClass();\n /* Simple case that this class directly implements the interface */\n for (Type interfaze : clazz.getGenericInterfaces()) {\n if (interfaze instanceof ParameterizedType) {\n ParameterizedType parameterizedInterface = (ParameterizedType) interfaze;\n if (parameterizedInterface.getRawType()\n .equals(IRequestHandler.class)) {\n Type actualParameterType = parameterizedInterface\n .getActualTypeArguments()[0];\n if (actualParameterType instanceof Class) {\n return (Class<?>) actualParameterType;\n }\n return null;\n\n }\n }\n }\n Type superType = clazz.getGenericSuperclass();\n if (!(superType instanceof ParameterizedType)) {\n /*\n * The type of request must be a generic parameter on the super\n * type. Which means that the type of request to handle is not\n * inherited, it must be declared directly on this class.\n */\n return null;\n }\n\n Class<?> superClass = clazz.getSuperclass();\n Type[] actualTypeArguments = ((ParameterizedType) superType)\n .getActualTypeArguments();\n TypeVariable<?>[] typeParameters = superClass.getTypeParameters();\n\n Map<Type, Type> resolvedTypes = new HashMap<>();\n for (int i = 0; i < actualTypeArguments.length; i++) {\n resolvedTypes.put(typeParameters[i], actualTypeArguments[i]);\n }\n /*\n * Loop over the super types, matching generic parameters on the class\n * to generic parameters on the superclass. The loop terminates if no\n * generic parameters can be matched.\n */\n while (!resolvedTypes.isEmpty()) {\n for (Type interfaze : superClass.getGenericInterfaces()) {\n if (interfaze instanceof ParameterizedType) {\n ParameterizedType parameterizedInterface = (ParameterizedType) interfaze;\n if (parameterizedInterface.getRawType()\n .equals(IRequestHandler.class)) {\n Type actualParameterType = parameterizedInterface\n .getActualTypeArguments()[0];\n actualParameterType = resolvedTypes\n .get(actualParameterType);\n if (actualParameterType instanceof Class) {\n return (Class<?>) actualParameterType;\n }\n return null;\n }\n }\n }\n superType = clazz.getGenericSuperclass();\n if (!(superType instanceof ParameterizedType)) {\n return null;\n }\n superClass = superClass.getSuperclass();\n actualTypeArguments = ((ParameterizedType) superType)\n .getActualTypeArguments();\n typeParameters = superClass.getTypeParameters();\n /*\n * Match generic parameters on this superclass back to the\n * parameters on the original class.\n */\n Map<Type, Type> deepResolvedTypes = new HashMap<>();\n for (int i = 0; i < actualTypeArguments.length; i++) {\n Type resolvedType = resolvedTypes.get(actualTypeArguments[i]);\n if (resolvedType != null) {\n deepResolvedTypes.put(typeParameters[i], resolvedType);\n }\n }\n resolvedTypes = deepResolvedTypes;\n }\n return null;\n }\n}",
"public interface HookRequestFactory {\n\n\t/**\n\t *\n\t * @param url The target URL used by the HookRequest.\n\t * @return A HookRequest object\n\t */\n\tHookRequest createHookRequest(String url);\n\n}",
"netthread(String url,Handler h) {\n this.urlstring = url;\n this.ntthrd_handler = h;//指定activity\n }",
"public GenericHandler() {\n\n }",
"IExceptionHandler createHandlerFor(java.lang.Class typeOfExceptionToHandle);",
"@Override\r\n public void onCreate() {\n HandlerThread thread = new HandlerThread(\"ServiceStartArguments\",\r\n 10);\r\n thread.start();\r\n\r\n // Get the HandlerThread's Looper and use it for our Handler\r\n serviceLooper = thread.getLooper();\r\n serviceHandler = new ServiceHandler(serviceLooper);\r\n }",
"Handler getHandler(Service service, HandlerFactory handlerFactory) {\n String serializationName = \"PROTOBUF\";\n Driver.Serialization serialization;\n try {\n serialization = Driver.Serialization.valueOf(serializationName);\n } catch (Exception e) {\n LOG.error(\"Unknown message serialization type for \" + serializationName);\n throw e;\n }\n\n Handler handler = handlerFactory.getHandler(service, serialization);\n LOG.info(\"Instantiated \" + handler.getClass() + \" for Quark Server\");\n\n return handler;\n }",
"public RESTWorkItemHandler() {\n\t}",
"public interface HttpRequestFactory\n{\n\n\tpublic abstract HttpRequest buildHttpRequest(HttpMethod httpmethod, String s);\n\n\tpublic abstract HttpRequest buildHttpRequest(HttpMethod httpmethod, String s, Map map);\n\n\tpublic abstract PinningInfoProvider getPinningInfoProvider();\n\n\tpublic abstract void setPinningInfoProvider(PinningInfoProvider pinninginfoprovider);\n}",
"@Override\n public void onCreate() {\n HandlerThread thread = new HandlerThread(\"ServiceStartArguments\", Process.THREAD_PRIORITY_BACKGROUND);\n thread.start();\n\n //Get the HandlerThread's Looper and use it for ur Handler\n mServiceLooper = thread.getLooper();\n mServiceHandler = new ServiceHandler(mServiceLooper);\n }",
"private Thread createThread() {\n return new Thread(this::_loadCatalog, \"CDS Hooks Catalog Retrieval\"\n );\n }",
"Object handle(Object request);",
"public RequestAction geRequestHandler(String request){\n RequestAction requestHandler =requestHandlerMap.get(request);\n if(requestHandler ==null)\n return requestHandlerMap.get(\"notSupported\");\n return requestHandler;\n }",
"public interface ThreadHandlerWorker {\n Message obtainThreadMessage(int what);\n\n void sendEmptyThreadMessage(int what);\n\n void sendThreadMessage(Message msg);\n\n void sendThreadMessageDelay(Message msg, long timeMillis);\n\n void sendEmptyThreadMessageDelay(int what, long timeMillis);\n\n void postThread(Runnable runnable);\n\n void postThreadDelay(Runnable runnable, long delay);\n\n void removeThreadCallbacks(Runnable runnable);\n\n void removeThreadMessage(int what);\n\n Handler obtainThreadHandler();\n}",
"private void handleRequest(Request request) throws IOException{\n switch (request){\n case NEXTODD:\n case NEXTEVEN:\n new LocalThread(this, request, nextOddEven).start();\n break;\n case NEXTPRIME:\n case NEXTEVENFIB:\n case NEXTLARGERRAND:\n new NetworkThread(this, userID, serverIPAddress, request).start();\n break;\n default:\n break;\n }\n }",
"public interface Handler {\n void handleRequest(String s);\n}",
"public interface Handler {\n boolean supports(HttpServletRequest request);\n\n void handle(HttpServletRequest request, HttpServletResponse response);\n}",
"private CustomRequest getCustomRequestFor(HttpRequest aRequest,\n Handler aHandler) {\n int lRequestMapped = mapToVolleyMethodCode(aRequest.getMethod());\n RequestComposite lMap = new RequestComposite();\n lMap.setHttpReq(aRequest);\n Handler lHandler = aHandler == null ? mainHandler : aHandler;\n Listener<String> lListener = getListenerForRequest(lMap, lHandler);\n Response.ErrorListener lErrorListener = getErrorListenerForRequest(lMap,\n lHandler);\n CustomRequest lReq = new CustomRequest(lRequestMapped,\n aRequest.getUrl(), lListener, lErrorListener, aRequest);\n // update the reference in the map.\n lMap.setVolleyReq(lReq);\n return lReq;\n }",
"public void handleRequest(Request req) {\n\n }",
"@Override\r\n public void onCreate() {\n HandlerThread thread = new HandlerThread(\"ServiceStartArguments\",\r\n Process.THREAD_PRIORITY_BACKGROUND);\r\n thread.start();\r\n\r\n // Get the HandlerThread's Looper and use it for our Handler\r\n mServiceLooper = thread.getLooper();\r\n mServiceHandler = new ServiceHandler(mServiceLooper);\r\n }",
"@Override\n\tpublic Thread newThread(Runnable r) {\n\t\t\n\t\tThread th = new Thread(r,\" custum Thread\");\n\t\treturn th;\n\t}",
"public interface ResponseHandlerInterface {\n\n /**\n * Returns data whether request completed successfully\n *\n * @param response HttpResponse object with data\n * @throws java.io.IOException if retrieving data from response fails\n */\n void sendResponseMessage(HttpResponse response) throws IOException;\n\n /**\n * Notifies callback, that request started execution\n */\n void sendStartMessage();\n\n /**\n * Notifies callback, that request was completed and is being removed from thread pool\n */\n void sendFinishMessage();\n\n /**\n * Notifies callback, that request (mainly uploading) has progressed\n *\n * @param bytesWritten number of written bytes\n * @param bytesTotal number of total bytes to be written\n */\n void sendProgressMessage(int bytesWritten, int bytesTotal);\n\n /**\n * Notifies callback, that request was cancelled\n */\n void sendCancelMessage();\n\n /**\n * Notifies callback, that request was handled successfully\n *\n * @param statusCode HTTP status code\n * @param headers returned headers\n * @param responseBody returned data\n */\n void sendSuccessMessage(int statusCode, Header[] headers, byte[] responseBody);\n\n /**\n * Returns if request was completed with error code or failure of implementation\n *\n * @param statusCode returned HTTP status code\n * @param headers returned headers\n * @param responseBody returned data\n * @param error cause of request failure\n */\n void sendFailureMessage(int statusCode, Header[] headers, byte[] responseBody, Throwable error);\n\n /**\n * Notifies callback of retrying request\n *\n * @param retryNo number of retry within one request\n */\n void sendRetryMessage(int retryNo);\n\n /**\n * Returns URI which was used to request\n *\n * @return uri of origin request\n */\n public URI getRequestURI();\n\n /**\n * Returns Header[] which were used to request\n *\n * @return headers from origin request\n */\n public Header[] getRequestHeaders();\n\n /**\n * Helper for handlers to receive Request URI info\n *\n * @param requestURI claimed request URI\n */\n public void setRequestURI(URI requestURI);\n\n /**\n * Helper for handlers to receive Request Header[] info\n *\n * @param requestHeaders Headers, claimed to be from original request\n */\n public void setRequestHeaders(Header[] requestHeaders);\n\n /**\n * Can set, whether the handler should be asynchronous or synchronous\n *\n * @param useSynchronousMode whether data should be handled on background Thread on UI Thread\n */\n void setUseSynchronousMode(boolean useSynchronousMode);\n\n /**\n * Returns whether the handler is asynchronous or synchronous\n *\n * @return boolean if the ResponseHandler is running in synchronous mode\n */\n boolean getUseSynchronousMode();\n}",
"@Override\n protected Thread createThread(final Runnable runnable, final String name) {\n return new Thread(runnable, Thread.currentThread().getName() + \"-exec\");\n }",
"private void requestHandler(Object context)\n {\n final String funcName = \"requestHandler\";\n @SuppressWarnings(\"unchecked\")\n TrcRequestQueue<Request>.RequestEntry entry = (TrcRequestQueue<Request>.RequestEntry) context;\n Request request = entry.getRequest();\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.TASK, \"request=%s\", request);\n }\n\n request.canceled = entry.isCanceled();\n if (!request.canceled)\n {\n if (request.readRequest)\n {\n request.buffer = readData(request.address, request.length);\n if (debugEnabled)\n {\n if (request.buffer != null)\n {\n dbgTrace.traceInfo(funcName, \"readData(addr=0x%x,len=%d)=%s\",\n request.address, request.length, Arrays.toString(request.buffer));\n \n }\n }\n }\n else\n {\n request.length = writeData(request.address, request.buffer, request.length);\n }\n }\n\n if (request.completionEvent != null)\n {\n request.completionEvent.set(true);\n }\n\n if (request.completionHandler != null)\n {\n request.completionHandler.notify(request);\n }\n\n if (debugEnabled)\n {\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.TASK);\n }\n }",
"public interface RequestHandler {\n\tpublic Map<String,Object> handleRequest(Map<String,Object> request,\n\t\t\t InetAddress client);\n}",
"public interface INetworkHandlerManager {\n public void registerHandler (String handlerName, INetworkHandler handler);\n public INetworkHandler getHandler (INetworkMessage message);\n}",
"public interface HttpRequestHandler {\n public boolean canHandle(String uri);\n public httpResponse handle(httpRequest request);\n}",
"public void createServiceRequest() {\n getMainActivity().startService(new Intent(getMainActivity(), RequestService.class));\n }",
"private void initHandler(Class<? extends Handler> handlerClass) throws InstantiationException, IllegalAccessException {\n\t\tsynchronized (waitingThreads) {\n\t\t\t/* start waiting handler threads */\n\t\t\twhile (waitingThreads.size() < handlers) {\n\t\t\t\tHandler h = addHandler(handlerClass.newInstance());\n\n\t\t\t\th.setHandlerPool(this);\n\t\t\t\th.start(); // start this handler thread\n\t\t\t}\n\t\t\t\n\t\t\tclosed = Boolean.FALSE;\n\t\t}\n\t}",
"public SwitchYardServiceTaskHandler(String name) {\n super(name);\n }",
"public void createThread() {\n }",
"public interface CommandHandlerFactory {\n public CommandHandler getHandler(Command command);\n}",
"public interface Controller {\r\n Object handle(WebRequest request);\r\n}",
"public ServiceHandler createServiceHandler(\n Reactor reactor,\n SelectableChannel handle) {\n try {\n return new TestAcceptHandler(reactor, handle, this._pool);\n } catch (IOException ex) {\n MDMS.ERROR(ex.getMessage());\n return null;\n }\n }",
"public interface IHttpThreadExecutor {\n public void addTask(Runnable runnable);\n}",
"@Override\n public void onCreate() {\n HandlerThread thread = new HandlerThread(\"ServiceStartArguments\");\n thread.start();\n\n // Get the HandlerThread's Looper and use it for our Handler\n mLooper = thread.getLooper();\n mServiceHandle = new ServiceHandle(mLooper);\n }",
"public interface IRequest<T, O> {\r\n /**\r\n * Call back interface method for processing the Server Request\r\n *\r\n * @param requestInfo - RequestInfo Object which holds all the required Request Details\r\n */\r\n void processRequest(RequestInfo<T, O> requestInfo, Class<T> TClass, Class<O> OClass, boolean invalidateCache);\r\n\r\n void registerListener(INetworkListener networkListener);\r\n\r\n boolean cancelRequest();\r\n}",
"public Handler(Class<?> implementation) {\r\n this.implementation = implementation;\r\n }",
"public HandlerExecutionChain getHandler(HttpServletRequest request) throws Exception {\n String uri = request.getRequestURI();\n return new SpecHandlerExecutionChain(new SpecHandler(uri));\n }",
"public SocketHandler createSocketHandler (String host, int port) {\r\n\t\t\t\t\t\t\t\r\n\t\tSocketHandler socketHandler = null;\r\n\r\n\t\ttry {\r\n\t\t\t\t\t\t \t\r\n\t\t\tsocketHandler = new SocketHandler(host, port);\r\n\t\t\t\t\t\t\t\t\r\n\t\t} catch (SecurityException | IOException e) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\t\t\t\t \r\n\t\treturn socketHandler;\r\n\t}",
"protected synchronized ScriptHandler getScriptHandler(String request, String[] params) {\r\n \thandlerLock.lock();\r\n if (currentLoader != null || currentScriptHandler != null) {\r\n }\r\n if (params == null)\r\n currentScriptHandler = new ScriptHandler(request);\r\n else\r\n currentScriptHandler = new ScriptHandler(request, params);\r\n return currentScriptHandler;\r\n }",
"public Handler getHandler();",
"@FunctionalInterface\n\tinterface RequestHandler {\n\t public Request handle(Request req);\n\n\t // !!! write a method handle that accept request and returns new request here\n\t // it allows to use lambda expressions for creating handlers below\n\n\t // !!! write a default method for combining this and other handler single one\n\t // the order of execution may be any but you need to consider it when composing handlers\n\t // the method may has any name\n\t \n\t default RequestHandler combine(RequestHandler h) {\n\t \t\n\t \treturn req -> h.handle(this.handle(req));\n\t }\n\t \n\t \n\t}",
"public interface ZmoteHTTPDRequestHandler{\n\tpublic String getURI();\n\tpublic Response serve(String uri, String method, Properties header, Properties parms, Properties files, ZmoteHTTPD httpd);\t\n\tpublic ZmoteHTTPDRequestHandler clone();\n}",
"public CallAppAbilityConnnectionHandler createHandler() {\n EventRunner create = EventRunner.create();\n if (create != null) {\n return new CallAppAbilityConnnectionHandler(create);\n }\n HiLog.error(LOG_LABEL, \"createHandler: no runner.\", new Object[0]);\n return null;\n }",
"public Object handleRequest(P request) throws Exception;",
"private synchronized Handler getCustomHandler( ) {\n if( (customHandler != null ) \n ||(customHandlerError) ) \n {\n return customHandler;\n }\n LogService logService = getLogService( );\n if( logService == null ) {\n return null;\n }\n String customHandlerClassName = null;\n try {\n customHandlerClassName = logService.getLogHandler( );\n\n customHandler = (Handler) getInstance( customHandlerClassName );\n // We will plug in our UniformLogFormatter to the custom handler\n // to provide consistent results\n if( customHandler != null ) {\n customHandler.setFormatter( new UniformLogFormatter(componentManager.getComponent(Agent.class)) );\n }\n } catch( Exception e ) {\n customHandlerError = true; \n new ErrorManager().error( \"Error In Initializing Custom Handler \" +\n customHandlerClassName, e, ErrorManager.GENERIC_FAILURE );\n }\n return customHandler;\n }",
"public HandlerExecutionChain getHandler(HttpServletRequest request) {\n\t\tString url = request.getServletPath();\n\t\tSystem.out.println(url+\" 123\");\n\t\tController ctl = (Controller) ApplicationContext.getBean(url);\n\t\tHandlerExecutionChain chain = new HandlerExecutionChain();\n\t\tchain.setHandler(ctl);\n\t\treturn chain;\n\t}",
"static SecurityHandler create() {\n return DEFAULT_INSTANCE;\n }",
"public interface CallMultiplexerFactory {\n <T> T createCallMultiplexer(Class<T> clazz, DispatchExceptionHandler h, T[] delegates) throws Exception;\n}",
"public SwitchYardServiceTaskHandler() {\n }",
"@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic final ISafeDispatchWorker createSafeDispatchWorker(IServiceContext serviceContext) {\n\t\tAdaptationInWorker adaptationInWorker = \r\n\t\t\tnew AdaptationInWorker(this.getConnector());\r\n\t\tadaptationInWorker.setAdaptationHandler(adaptationHandler);\r\n\t\tadaptationInWorker.setServiceContext(serviceContext);\t\t\r\n\t\treturn adaptationInWorker;\r\n\t}",
"ThreadStart createThreadStart();",
"@Override\n\tpublic void onCreate() {\n\t\t\n\t\tHandlerThread thread = new HandlerThread(\"ServiceStartArguments\",\n\t\t\t\tProcess.THREAD_PRIORITY_BACKGROUND);\n\t\tthread.start();\n\t\t// Get the HandlerThread's Looper and use it for our Handler\n\t\tmServiceLooper = thread.getLooper();\n\t\tmServiceHandler = new ServiceHandler(mServiceLooper);\n\t}",
"@Override\n @SuppressWarnings(\"unchecked\")\n public <T extends AbstractChartDefinition<?, ?>> Class<? extends ChartRequestHandler<T, ?>> getChartRequestHandlerService(Class<? extends AbstractChartDefinition> chartDefinition) {\n Collection<Class<?>> serviceClasses = getChartRequestHandlerServices();\n\n // Filter by generic implementation and get the one with the lowest priority value\n Optional<Class<?>> requestHandlerClasses = serviceClasses.stream()\n .filter(aClass -> ReflectionUtil.isGenericImplementation(aClass, ChartRequestHandler.class, chartDefinition))\n .sorted(Comparator.comparingLong(chartRequestHandlerServicePriorityFunction))\n .findFirst();\n\n // Make it typed (already checked in filter)\n Class<? extends ChartRequestHandler<T, ?>> requestHandlerClassesTyped = null;\n if(requestHandlerClasses.isPresent()) {\n requestHandlerClassesTyped = (Class<? extends ChartRequestHandler<T, ?>>) requestHandlerClasses.get();\n }\n\n return requestHandlerClassesTyped;\n }",
"public void create(HandlerContext context, Management request, Management response) {\n\t\t// TODO Auto-generated method stub\n\n\t}",
"EthHandler create(EthVersion version);",
"public interface EndpointBase {\n\n boolean isIdleNow();\n\n /**\n * @param connectionTimeout\n * @param methodTimeout\n */\n void setTimeouts(int connectionTimeout, int methodTimeout);\n\n /**\n * @param alwaysMainThread\n */\n void setCallbackThread(boolean alwaysMainThread);\n\n /**\n * @param flags\n */\n void setDebugFlags(int flags);\n\n int getDebugFlags();\n\n /**\n * @param delay\n */\n void setDelay(int delay);\n\n void addErrorLogger(ErrorLogger logger);\n\n void removeErrorLogger(ErrorLogger logger);\n\n void setOnRequestEventListener(OnRequestEventListener listener);\n\n\n void setPercentLoss(float percentLoss);\n\n int getThreadPriority();\n\n void setThreadPriority(int threadPriority);\n\n\n ProtocolController getProtocolController();\n\n void setUrlModifier(UrlModifier urlModifier);\n\n /**\n * No log.\n */\n int NO_DEBUG = 0;\n\n /**\n * Log time of requests.\n */\n int TIME_DEBUG = 1;\n\n /**\n * Log request content.\n */\n int REQUEST_DEBUG = 2;\n\n /**\n * Log response content.\n */\n int RESPONSE_DEBUG = 4;\n\n /**\n * Log cache behavior.\n */\n int CACHE_DEBUG = 8;\n\n /**\n * Log request code line.\n */\n int REQUEST_LINE_DEBUG = 16;\n\n /**\n * Log request and response headers.\n */\n int HEADERS_DEBUG = 32;\n\n /**\n * Log request errors\n */\n int ERROR_DEBUG = 64;\n\n /**\n * Log cancellations\n */\n int CANCEL_DEBUG = 128;\n\n /**\n * Log cancellations\n */\n int THREAD_DEBUG = 256;\n\n /**\n * Log everything.\n */\n int FULL_DEBUG = TIME_DEBUG | REQUEST_DEBUG | RESPONSE_DEBUG | CACHE_DEBUG | REQUEST_LINE_DEBUG | HEADERS_DEBUG | ERROR_DEBUG | CANCEL_DEBUG;\n\n int INTERNAL_DEBUG = FULL_DEBUG | THREAD_DEBUG;\n\n /**\n * Created by Kuba on 17/07/14.\n */\n interface UrlModifier {\n\n String createUrl(String url);\n\n }\n\n interface OnRequestEventListener {\n\n void onStart(Request request, int requestsCount);\n\n void onStop(Request request, int requestsCount);\n\n }\n}",
"public interface IHttpRequestHandler extends INamedObject\r\n{\t\r\n public HandlerResponse handleRequest( HttpRequestData httpRequest ) throws IOException;\r\n}",
"@Override\n\t\t\tpublic Thread newThread(final Runnable r) {\n\t\t\t\tint id = threadNumber.getAndIncrement();\n\t\t\t\tString threadName = leftPad(String.valueOf(id), 2, \"0\");\n\t\t\t\tThread th = new Thread(r);\n\t\t\t\tth.setName(threadName);\n\t\t\t\tth.setDaemon(false);\n\t\t\t\treturn th;\n\t\t\t}",
"protected abstract void runHandler();",
"public interface Factory {\n /* renamed from: a */\n Call mo35727a(Request request);\n }",
"private void init(int threadCount, Type type) {\r\n //The backend starts to polling threads.\r\n mPoolThread=new Thread(){\r\n @Override\r\n public void run() {\r\n Looper.prepare();\r\n mPoolThreadHandler=new Handler(){\r\n @Override\r\n public void handleMessage(Message msg) {\r\n //take a thread from the thread pool and execute it.\r\n mThreadPool.execute(getTask());\r\n try {\r\n mSemaphoreThreadPool.acquire();\r\n } catch (InterruptedException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n };\r\n //if this thread is finished, release a signal to the handler.\r\n mSemaphorePoolThreadHandler.release();\r\n Looper.loop();\r\n }\r\n };\r\n mPoolThread.start();\r\n //Get the maximum available memory for our service.\r\n int maxMemory= (int) Runtime.getRuntime().maxMemory();\r\n int cacheMemory = maxMemory / 8;//8\r\n mLruCache=new LruCache<String, Bitmap>(cacheMemory){\r\n @Override\r\n protected int sizeOf(String key, Bitmap value) {\r\n return value.getRowBytes()*value.getHeight();\r\n }\r\n };\r\n mThreadPool= Executors.newFixedThreadPool(threadCount);\r\n mTaskQueue=new LinkedList<>();\r\n mType=type==null? Type.LIFO:type;\r\n mSemaphoreThreadPool=new Semaphore(threadCount);\r\n\r\n }",
"public ESocketThreadNew() {\n ac = new FileSystemXmlApplicationContext(\"classpath*:applicationContext.xml\");\n if (ESocketThreadNew.service == null) {\n ESocketThreadNew.service = ac.getBean(VnsAuthorGETServiceNew.class);\n }\n if (ESocketThreadNew.resultService == null) {\n ESocketThreadNew.resultService = ac.getBean(VnsResultService.class);\n }\n if (ESocketThreadNew.vnsPulseService == null) {\n ESocketThreadNew.vnsPulseService = ac.getBean(VnsPulseService.class);\n }\n if (ESocketThreadNew.locationService == null) {\n ESocketThreadNew.locationService = ac.getBean(VnsLocationService.class);\n }\n }",
"RequestDelegator getDelegator();",
"Handler<Q, R> handler();",
"public interface HttpRequestService {\n\n String get(String url,HashMap<String,String> params) throws IOException;\n\n String get(String url) throws IOException;\n\n String post(String url,HashMap<String,String> params) throws Exception;\n\n}",
"TypedRequest createTypedRequest();",
"private GDMThreadFactory(){}",
"protected Object getHandlerInternal(HttpServletRequest request) {\n String lookupPath = WebUtils.getLookupPathForRequest(request, this.alwaysUseFullPath);\n logger.debug(\"Looking up handler for: \" + lookupPath);\n return lookupHandler(lookupPath);\n }",
"public GenericWSRequest(int requestId, int requestType, HttpServletRequest req, HttpServletResponse res, ServletConfig config, ServletContext servletContext) {\n super(requestId, null);\n this.requestType = requestType;\n this.httpServletRequest = req;\n this.httpServletRespone = res;\n this.servletConfig = config;\n this.servletContext = servletContext;\n }",
"public InternalNameServiceHandler() {\n }",
"public TypeHandlerFactory getTypeHandlerFactory() {\r\n\t\treturn typeHandlerFactory;\r\n\t}",
"private Thread createThreadFor(Agent ag) {\n ProcessData data = getDataFor(ag);\n\n data.thread = new Thread(threadGroup, ag);\n data.thread.setPriority(THREAD_PRIORITY);\n\n return data.thread;\n }",
"void filterCreate(ServerContext context, CreateRequest request,\n ResultHandler<Resource> handler, RequestHandler next);",
"void handleRequest();",
"public interface BeforeHandler {\n void execute(Map<String, Object> body,HttpServletRequest request) throws Exception;\n}",
"public interface Message {\n\n final class Factory {\n\n public static <R> Message create(String action, Object body, Looper looper,\n Handler<AsyncResult<R>> replyHandler) {\n return new MessageImpl<>(action, body, looper, replyHandler);\n }\n }\n\n final class Builder {\n\n private String action;\n private Object body;\n private Message msg;\n private Looper looper;\n\n public Builder setAction(String action) {\n this.action = action;\n return this;\n }\n\n public Builder setBody(Object body) {\n this.body = body;\n return this;\n }\n\n public Builder setLooper(Looper looper) {\n this.looper = looper;\n return this;\n }\n\n public <R> Builder setReplyHandler(Handler<AsyncResult<R>> replyHandler) {\n if (looper == null) {\n looper = Looper.myLooper();\n }\n msg = Message.Factory.create(action, body, looper, replyHandler);\n return this;\n }\n\n public Message build() {\n if (msg == null) {\n if (looper == null) {\n looper = Looper.myLooper();\n }\n msg = Message.Factory.create(action, body, looper, null);\n }\n return msg;\n }\n }\n\n String action();\n\n <T> T body();\n\n void reply(Object response);\n\n void fail(String failureMessage);\n\n void fail(Throwable throwable);\n}",
"public static HttpLogKafkaHandler getKafkaHandler(String kafkaType){\t\t\n\t\treturn _kafkaHandlerList.get(kafkaType);\n\t}",
"public interface TaskStartHandler2 {\n\n Object process(OperationContext context);\n}",
"public static Handler getInstance() {\n Object object = sHandler;\n if (object != null) {\n return sHandler;\n }\n object = MainThreadAsyncHandler.class;\n synchronized (object) {\n Handler handler = sHandler;\n if (handler == null) {\n handler = Looper.getMainLooper();\n sHandler = handler = HandlerCompat.createAsync((Looper)handler);\n }\n return sHandler;\n }\n }",
"ResponseHandler createResponseHandler();",
"public NotificationHubWorkItemHandler() {}",
"protected Object lookupHandler(String urlPath, HttpServletRequest request) throws Exception\r\n\t{\n\t\tObject handler = super.lookupHandler(urlPath, request);\r\n\t\tif (handler == null)\r\n\t\t{ // 800, 如果uri直接查找不到,则匹配前面一个\r\n\t\t\tString path = urlPath.substring(0, urlPath.indexOf('/', 2));\r\n\t\t\thandler = super.lookupHandler(path, request);\r\n//\t\t\tSystem.out.println(\"path: \" + path + \":\" + handler);\r\n\t\t}\r\n\t\thandler = handler == null ? getRootHandler() : handler;\r\n//\t\tSystem.out.println(\"urlPath: \" + urlPath + \":\" + handler);\r\n\t\treturn handler;\r\n\t}"
] | [
"0.61550105",
"0.60182756",
"0.596373",
"0.5953679",
"0.5816643",
"0.5722027",
"0.5713399",
"0.57035995",
"0.57029873",
"0.5669337",
"0.56087303",
"0.5605279",
"0.5593124",
"0.55600417",
"0.5532596",
"0.54745704",
"0.53913105",
"0.53909045",
"0.5387357",
"0.5386811",
"0.5384042",
"0.53571755",
"0.53488255",
"0.5336008",
"0.5316022",
"0.52982354",
"0.52947855",
"0.5292191",
"0.52685475",
"0.5264466",
"0.5257944",
"0.5237524",
"0.52061784",
"0.5201764",
"0.5200982",
"0.5198648",
"0.517393",
"0.51667863",
"0.5128328",
"0.51281226",
"0.51279855",
"0.51157385",
"0.51119727",
"0.51096237",
"0.509978",
"0.509973",
"0.5093687",
"0.5078161",
"0.5065936",
"0.5055608",
"0.5052672",
"0.50491303",
"0.5044005",
"0.50401855",
"0.5037614",
"0.50319135",
"0.5023664",
"0.5018843",
"0.4997933",
"0.49960512",
"0.49943358",
"0.49826866",
"0.4980466",
"0.49800798",
"0.49797073",
"0.49761373",
"0.49700403",
"0.4969455",
"0.49638128",
"0.4944001",
"0.49115172",
"0.49022645",
"0.48895273",
"0.48820534",
"0.4880236",
"0.48782027",
"0.48778006",
"0.48758188",
"0.48717433",
"0.48670375",
"0.48656622",
"0.4860435",
"0.4844178",
"0.4834181",
"0.48292795",
"0.48237664",
"0.482346",
"0.48121986",
"0.48118004",
"0.48045322",
"0.47963095",
"0.47953162",
"0.47817314",
"0.47811198",
"0.47807872",
"0.4777993",
"0.47711968",
"0.47696036",
"0.47671747",
"0.47593313"
] | 0.62883645 | 0 |
/ Compares two strings based on its ending. (nonJavadoc) | public int compare(String str1, String str2) {
int num1 = Integer.parseInt(str1.substring(4, str1.length()));
int num2 = Integer.parseInt(str2.substring(4, str2.length()));
return num1 - num2;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static boolean endOther(String a, String b) {\n String larger, smaller;\n if (a.length() > b.length()){\n larger = a;\n smaller = b;\n }\n else{\n larger = b;\n smaller = a;\n }\n larger = larger.toLowerCase();\n smaller = smaller.toLowerCase();\n int i = larger.length() - smaller.length();\n return ((larger.substring(i, larger.length())).equals(smaller));\n }",
"public boolean endsWithSpecificString(String str, String str2)\r\n{\r\n if(str.length()== str2.length())\r\n {\r\n return compare2Strings(str,str2);\r\n }\r\n else if(str.length()> str2.length())\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n return str.endsWith(str2);\r\n }\r\n}",
"public boolean isARotation(String s1, String s2) {\n\t\tif(s1.length() != s2.length()) return false;\n\t\t\n\t\tStringBuilder stb = new StringBuilder();\n\t\tint i = 0;\n\t\twhile(i < s1.length()) {\n\t\t\tif(s1.charAt(i) == s1.charAt(i)) {\n\t\t\t\treturn subString(s1.substring(0, i), s2) \n\t\t\t\t\t\t&& stb.toString().compareTo(s2.substring(i, s2.length()-1)) == 0;\n\t\t\t}\n\t\t\ti++;\n\t\t\tstb.append(s1.charAt(i));\n\t\t}\n\t\treturn false;\n\t}",
"@Override\r\n\tpublic boolean matches(String first, String last) {\n\t\treturn false;\r\n\t}",
"boolean sameName(String a, String b){\n\t\tif(a.length()!=b.length()){\r\n\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tfor(int i=0;i<a.length();i++){\r\n\t\t\tif(a.charAt(i)!=b.charAt(i)){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"static String twoStrings(String s1, String s2){\n // Complete this function\n String letters = \"abcdefghijklmnopqrstuvwxyz\";\n for(int i=0;i<letters.length();i++){\n char lettersChar = letters.charAt(i); \n if(s1.indexOf(lettersChar) > -1 && s2.indexOf(lettersChar) > -1){\n return \"YES\";\n }\n }\n \n return \"NO\";\n }",
"private boolean isIn(String s1, String s2) {\n\t for(int i = 0; i <= s2.length() - s1.length(); i++) {\n\t \n\t if(s2.substring(i, i+s1.length()).equals(s1) ) {\n\t // System.out.println(\"+ \" + s2.substring(i, i+s1.length()) + \" \" + s1);\n\t return true;\n\t }\n\t }\n\t return false;\n\t}",
"public int stringMatch(String a, String b) {\n int result = 0;\n int end = (a.length()<=b.length()? a.length():b.length());\n for (int i = 0; i <end-1 ; i++){\n if (a.substring(i, i + 2).equals(b.substring(i, i + 2))) {\n result++;\n }\n }\n return result;\n }",
"public boolean compare_same(String x, String y) {\n\t\tint fuzzy = 0;\n\t\tif (x.length() != y.length()) return false;\n\t\tfor (int i = 0, j = 0; i<x.length() && j<y.length();) {\n\t\t\tif (i>0 && x.charAt(i-1)=='_' && '0'<=x.charAt(i) && x.charAt(i)<='9') {\n\t\t\t\twhile (i<x.length() && '0'<=x.charAt(i) && x.charAt(i)<='9') i++;\n\t\t\t}\n\t\t\tif (j>0 && y.charAt(j-1)=='_' && '0'<=y.charAt(j) && y.charAt(j)<='9') {\n\t\t\t\twhile (j<y.length() && '0'<=y.charAt(j) && y.charAt(j)<='9') j++;\n\t\t\t}\n\t\t\tif (i<x.length() && j<y.length() && x.charAt(i) != y.charAt(j)) {\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\ti++; j++;\n\t\t}\n\t\treturn true;\n\t}",
"public boolean compare2StringsIgnoringCasses(String s1, String s2)\r\n {\r\n String a=s1.toLowerCase();\r\n String b=s2.toLowerCase();\r\n if(a.length()!= b.length())\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n for(int i=0; i<a.length(); i++)\r\n {\r\n if(!comparet2Chars(a.charAt(i),b.charAt(i)))\r\n {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n }",
"public boolean isSubSequence(String x, String y){\n\t\tint j = 0;\n\t\tfor(int i = 0 ; i < x.length() && j< y.length(); i++){\n\t\t\tif(x.charAt(j) == y.charAt(i)){\n\t\t\t\tj++;\n\t\t\t}\n\t\t}\n\t\treturn j == x.length();\n\t}",
"private static boolean diffOne(String s1, String s2) {\n int count = 0;\n for (int i = 0; i < s1.length(); i++) {\n if (s1.charAt(i) != s2.charAt(i)) count++;\n if (count > 1) return false;\n }\n return count == 1;\n }",
"private boolean translateWith2ExchangedChars(String input1, String input2) {\n if (StringUtils.isBlank(input1) || StringUtils.isBlank(input2) || input1.length() != input2.length()) {\n return false;\n }\n if (input1.equals(input2)) {\n for (int i = 0; i < input1.length(); i++) {\n char current = input1.charAt(i);\n if (input1.lastIndexOf(current) != i) {\n return true;\n }\n }\n return false;\n } else {\n int first = -1, second = -1;\n for (int i = 0; i < input1.length(); i++) {\n if (input1.charAt(i) != input2.charAt(i)) {\n if (first == -1) {\n first = i;\n } else if (second == -1) {\n second = i;\n } else {\n return false;\n }\n }\n }\n return input1.charAt(first) == input2.charAt(second)\n && input1.charAt(second) == input2.charAt(first);\n }\n }",
"static int compare(String a, String b) {\n if (a == null) a = \"\";\n if (b == null) b = \"\";\n\n int i = 0;\n while (i < a.length() && i < b.length()) {\n char x = a.charAt(i), y = b.charAt(i);\n if (x != y) return x - y;\n i++;\n }\n return a.length() - b.length();\n }",
"private static boolean afterStar(String v1, String v2) {\n\t\t\n\t\tif(v1.length() < (v2.length() - 1) ) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tchar[] value1 = v1.toCharArray();\n\t\tchar[] value2 = v2.toCharArray();\n\t\tint i = v1.length() - 1;\n\t\tint j = v2.length() - 1;\n\t\t\n\t\twhile(true) {\n\t\t\t\n\t\t\tif( (value1[i] != value2[j]) && value2[j] != '*') {\n\t\t\t\treturn false;\n\t\t\t}else if(value2[j] == '*') {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\ti--;\n\t\t\tj--;\n\t\t\t\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public static boolean stringRotation(String str1, String str2) {\n String temp = str2 + str2;\n return temp.contains(str1);\n }",
"private boolean alphabCheck(String first, String second) {\n\t\tif (first.length() == 1 || second.length() == 1) {\n\t\t\tif (first.compareTo(second) < 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (first.substring(0, 1).compareTo(second.substring(0,1)) < 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (first.substring(0, 1).compareTo(second.substring(0,1)) == 0) {\n\t\t\t\t\treturn alphabCheck(first.substring(1, first.length()),second.substring(1,second.length()));\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"private boolean containedIn(String a, String b){\n if(a.length() > b.length())return false;\n int aInd = 0;\n int bInd = 0;\n\n while(bInd < b.length()){\n if(aInd >= a.length())return true;\n char bChar = b.charAt(bInd);\n char aChar = a.charAt(aInd);\n if(bChar == aChar){\n aInd++;\n }\n bInd++;\n }\n return false;\n }",
"public boolean checkPalindromeFormation(String a, String b) {\n int n = a.length();\n return findCommonSubstring(a.toCharArray(), b.toCharArray(), 0, n - 1) ||\n findCommonSubstring(b.toCharArray(), a.toCharArray(), 0, n - 1);\n }",
"public int String_Compare(String A, String B) {\n\t\t\n\t\tint shorter_length;\n\t\tif(A.length() >= B.length()) {\n\t\t\tshorter_length=B.length();\n\t\t}\n\t\telse {\n\t\t\tshorter_length=A.length();\n\t\t}\n\t\t\n\n\t\t\n\t\t\n\t\tint i = 0;\n\t\tint A_char;\n\t\tint B_char;\n\t\t\n\t\twhile(i < shorter_length ) {\n\t\t\tA_char = (int)A.charAt(i);\n\t\t\tB_char = (int)B.charAt(i);\n\n\t\t\tif(A_char != B_char) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\ti+=1;\n\t\t}\n\t\treturn 0;\n\t}",
"private boolean oneCharOff( String word1, String word2 )\n {\n if( word1.length( ) != word2.length( ) )\n return false;\n int diffs = 0;\n for( int i = 0; i < word1.length( ); i++ )\n if( word1.charAt( i ) != word2.charAt( i ) )\n if( ++diffs > 1 )\n return false;\n return diffs == 1;\n }",
"private boolean isRotation(String s1, String s2) {\n\t\treturn (s1.length() == s2.length()) && isSubstring(s1 + s1, s2);\n\t}",
"private static boolean equalityTest4(String a, String b)\n {\n if(a.length() == 0 && b.length() == 0)\n {\n return true;\n }\n else\n {\n if(a.length() == 0 || b.length() == 0)\n {\n return false;\n }\n if(a.charAt(0) == b.charAt(0))\n {\n return equalityTest4(a.substring(1), b.substring(1));\n }\n else\n {\n return false;\n }\n }\n }",
"public static boolean isEqual(String s1, String s2) {\r\tif(s1.length() != s2.length()){\r\t return false;\r\t}\r\tfor(int i = 0; i< s1.length();i++){\r\t if (s1.charAt(i) != s2.charAt(i)){\r\t\treturn false;\r\t }\r\t}\r\treturn true;\r }",
"private static boolean beforeStar(String v1, String v2) {\n\t\t\n\t\tif(v1.length() < (v2.length() - 1) ) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tchar[] value1 = v1.toCharArray();\n\t\tchar[] value2 = v2.toCharArray();\n\t\tint i = 0;\n\t\tint j = 0;\n\t\tint n = v1.length();\n\t\t\n\t\twhile(true) {\n\t\t\t\n\t\t\tif( (value1[i] != value2[j]) && value2[j] != '*') {\n\t\t\t\treturn false;\n\t\t\t}else if(value2[j] == '*') {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\ti++;\n\t\t\tj++;\n\t\t\t\n\t\t\tif(i == n) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public boolean endsWith(String suffix) {\n/* 371 */ return this.m_str.endsWith(suffix);\n/* */ }",
"public static boolean replace(String s1, String s2){\n\t\tboolean flag = false;\n\t\tfor (int i = 0; i < s1.length(); i++){\n\t\t\tif (s1.charAt(i) != s2.charAt(i)){\n\t\t\t\tif (flag){\n\t\t\t\t\treturn false;\n\t\t\t\t}else{\n\t\t\t\t\tflag = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"@Test\n\tpublic void testareFirstAndLastTwoCharactersTheSame_BasicNegative() \n\t{\n\t\tassertFalse(helper.areFirstAndLastTwoCharactersTheSame(\"ABCD\"));\n\t}",
"@Test\n public void testAreFirstAndLastCharactersTheSame() {\n \n assertTrue(stringHelper.areFirstAndLastCharactersTheSame(\"AA\"));\n \n }",
"public static boolean validate(String str1, String str2 ) {\n return (str2 + str2).contains(str1);\n }",
"public boolean endsWith(\n String... suffix\n ) {\n \t// TODO optimize\n int offset = size() - suffix.length;\n if (offset < 0) return false;\n for(\n int index = 0;\n index < suffix.length;\n index++\n ) {\n if(!suffix[index].equals(this.getSegment(offset+index).toClassicRepresentation())) return false;\n }\n return true; \n }",
"private static int indexOfFirstDifferentChar(@NotNull CharSequence s1, int start1, @NotNull String s2, int start2) {\n boolean ignoreCase = !SystemInfo.isFileSystemCaseSensitive;\n int len1 = s1.length();\n int len2 = s2.length();\n while (start1 < len1 && start2 < len2) {\n char c1 = s1.charAt(start1);\n char c2 = s2.charAt(start2);\n if (!StringUtil.charsMatch(c1, c2, ignoreCase)) {\n return start1;\n }\n start1++;\n start2++;\n }\n return start1;\n }",
"public static boolean isRotation(String str1, String str2) {\n if ((str1.length() != str2.length()) || str1.isEmpty() || str2.isEmpty()\n || str1 == null || str2 == null) {\n return false;\n }\n return isSubString(str1, str2 + str2);\n // return (str2 + str2).contains(str1);\n // return ((str2 + str2).indexOf(str1) > -1);\n }",
"public boolean isMatch(String str1, String str2) {\n \r\n if( str1 == null || str2 == null)\r\n return false;\r\n \r\n int i = 0;\r\n int j = 0;\r\n char preChar = ' ';\r\n \r\n while( i < str1.length() && j < str2.length() ){\r\n char c1 = str1.charAt(i);\r\n char c2 = str2.charAt(j);\r\n \r\n if( c1 == c2 || c2 == '.' ){\r\n i++;\r\n \r\n preChar = c2;\r\n j++;\r\n }\r\n else{\r\n if( c2 == '*' ){\r\n if( c1 == preChar || preChar == '.' ){\r\n i++;\r\n }\r\n else if( j+1 < str2.length() ){\r\n if( c1 == str2.charAt(j+1) || str2.charAt(j+1) == '.' ){\r\n i++;\r\n \r\n preChar = str2.charAt(j+1);\r\n j = j+2;\r\n }\r\n else\r\n return false;\r\n }\r\n else\r\n return false;\r\n }\r\n else{\r\n if( j+1 < str2.length() && str2.charAt(j+1) == '*' ){\r\n i++;\r\n \r\n preChar = c2;\r\n j = j+2;\r\n } \r\n else\r\n return false;\r\n }\r\n }\r\n }\r\n \r\n if( i == str1.length() ){\r\n if( j == str2.length() )\r\n return true;\r\n else if( str2.charAt(j)=='*' ){\r\n \r\n int countStr1 = 0;\r\n for(int k = str1.length()-1; k >= 0; k--){\r\n if( str1.charAt(k) == preChar )\r\n countStr1++;\r\n else\r\n break;\r\n }\r\n \r\n int countStr2 = 0;\r\n int countStarInStr2 = 0;\r\n for(int k = str2.length()-1; k >= 0; k--){\r\n if( str2.charAt(k) == preChar || str2.charAt(k) == '.' )\r\n countStr2++;\r\n else if( str2.charAt(k) == '*' )\r\n countStarInStr2++;\r\n else\r\n break;\r\n } \r\n \r\n if( countStr2 - countStarInStr2 <= countStr1 )\r\n return true;\r\n else\r\n return false;\r\n }\r\n else\r\n }\r\n else \r\n return false;\r\n }",
"public String nonStart(String a, String b) {\r\n String shortA = a.length() > 0 ? a.substring(1) : a;\r\n String shortB = b.length() > 0 ? b.substring(1) : b;\r\n\r\n return shortA + shortB;\r\n }",
"public static boolean is_rotation_of_another_string(String word1, String word2) {\n\n String s3 = word1 + word1;\n\n if (s3.contains(word2))\n return true;\n else\n return false;\n }",
"public boolean checkSam(String stringA, String stringB) {\r\n\t\tString[] s1 = stringA.split(\" \");\r\n\t\tString[] s2 = stringB.split(\" \");\r\n\t\tif(s1.length == s2.length){\r\n\t\t\tint count = 0;\r\n\t\t\tfor (String sB : s2) {\r\n\t\t\t\tfor (String sA : s1) {\r\n\t\t\t\t\tif(sA.equals(sB)){\r\n\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(count == s2.length){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n }",
"static String doit(final String string1, final String string2) {\n String shorterString; // a\n String longerString; // b\n if (string1.length() > string2.length()) {\n shorterString = string2;\n longerString = string1;\n } else {\n longerString = string2;\n shorterString = string1;\n }\n String r = \"\";\n\n for (int i = 0; i < shorterString.length(); i++) {\n for (int j = shorterString.length() - i; j > 0; j--) {\n for (int k = 0; k < longerString.length() - j; k++) {\n if (shorterString.regionMatches(i, longerString, k, j) && j > r.length()) {\n r = shorterString.substring(i, i + j);\n }\n }\n } // Ah yeah\n }\n return r;\n\n }",
"static int isSubstring(String s1, String s2) {\n int m = s1.length();\n int n = s2.length();\n\n // A loop to slide pat[] one by one\n for (int i = 0; i <= n - m; i++) {\n int j;\n\n // For current index i, check for pattern match\n for (j = 0; j < m; j++) {\n if (s2.charAt(i + j) != s1.charAt(j)) {\n break;\n }\n }\n\n if (j == m) {\n return i;\n }\n }\n return -1;\n }",
"public static boolean checkString(String s, Predicate<String> pre1,Predicate<String> pre2) {\n return pre1.or(pre2).test(s);\n }",
"public boolean compareStrings(String A, String B) {\n if(A.length()<B.length())\n \treturn false;\n char[] a=A.toCharArray();\n char[] b=B.toCharArray();\n ArrayList<Character> aa=new ArrayList<>();\n ArrayList<Character> bb=new ArrayList<>();\n for(int i=0;i<a.length;i++){\n \taa.add(a[i]);\n }\n for(int i=0;i<b.length;i++){\n \tbb.add(b[i]);\n }\n while(bb.size()!=0){\n \tint flag=0;\n \tfor(int i=0;i<aa.size();i++){\n \t\tif(bb.get(0).equals(aa.get(i))){\n \t\t\tbb.remove(0);\n \t\t\taa.remove(i);\n \t\t\tSystem.out.println(bb);\n \t\t\tSystem.out.println(aa);\n \t\t\tflag=1;\n \t\t\tbreak;\n \t\t}\n \t}\n \tif (flag==0)\n \t\treturn false;\n }\n return true; \n }",
"public static boolean substring(String first,String second)\r\n {\r\n return second.toLowerCase().contains(first.toLowerCase());\r\n }",
"public String prefix(String a, String b) {\n\t\tint minLength = Math.min(a.length(), b.length());\n\t\tfor (int i = 0; i < minLength; i++) {\n\t\t\tif (a.charAt(i) != b.charAt(i)) {\n\t\t\t\treturn a.substring(0, i);\n\t\t\t}\n\t\t}\n\t\treturn a.substring(0, minLength);\n\t}",
"public static boolean isSubString(String shortStr, String longStr) {\n if ((shortStr.length() > longStr.length()) || shortStr.isEmpty() || longStr.isEmpty()) {\n return false;\n }\n for (int i = 0; i < longStr.length() - shortStr.length() + 1; i++) {\n int j = 0;\n for (; j < shortStr.length(); j++) {\n if (shortStr.charAt(j) == longStr.charAt(i + j)) {\n continue;\n } else {\n break;\n }\n }\n if (j == shortStr.length()) {\n return true;\n }\n }\n return false;\n }",
"public static boolean stringIntersect(String a, String b, int len) {\n\t\tif(len == 0) return true;\n\t\tSet<String> first = new HashSet<String>();\n\t\tSet<String> second = new HashSet<String>();\n\t\tfor(int i = 0; i < a.length() - len + 1; i++){\n\t\t\tfirst.add(a.substring(i, i + len));\n\t\t}\n\t\tfor(int i = 0; i < b.length() - len + 1; i++){\n\t\t\tsecond.add(b.substring(i, i + len));\n\t\t}\n\t\tboolean intersects = !Collections.disjoint(first, second);\n\t\treturn intersects;\n\t}",
"static String twoStrings(String s1, String s2) {\n Hashtable<Character, Integer> shortDict = null;\n Hashtable<Character, Integer> longDict = null;\n \n boolean isCommonSubset = false;\n \n String longerString = s1.length() >= s2.length() ? s1 : s2;\n String shorterString = s1.length() < s2.length() ? s1 : s2;\n \n longDict = prepareHashtable(longerString);\n shortDict = prepareHashtable(shorterString);\n \n for (char ch: shortDict.keySet()) {\n if (longDict.containsKey(ch)) {\n isCommonSubset = true;\n break;\n }\n }\n \n return isCommonSubset ? \"YES\" : \"NO\";\n }",
"@Override\n public int compare(String left, String right) {\n int result = 0;\n int length = left.length() > right.length()\n ? right.length() : left.length();\n for (int i = 0; i < length; i++) {\n result = Character.compare(left.charAt(i), right.charAt(i));\n if (result != 0) {\n break;\n }\n }\n if (result == 0) {\n result = left.length() - right.length();\n }\n return result;\n\n }",
"static String abbreviation(String a, String b) {\r\n \r\n HashSet<Character> aSet = new HashSet<>();\r\n\r\n for(int i = 0 ; i< a.length() ; i++){\r\n aSet.add(a.charAt(i));\r\n }\r\n \r\n for(int i = 0 ; i < b.length() ; i++){\r\n \r\n if(aSet.contains(b.charAt(i)) ){\r\n aSet.remove(b.charAt(i));\r\n }\r\n else if(aSet.contains(Character.toLowerCase(b.charAt(i)))){\r\n aSet.remove(Character.toLowerCase(b.charAt(i)));\r\n }\r\n else{\r\n return \"NO\";\r\n }\r\n \r\n\r\n }\r\n\r\n Iterator<Character> it = aSet.iterator();\r\n while(it.hasNext()){\r\n\r\n if(!isLowerCase(it.next())){\r\n return \"NO\";\r\n }\r\n }\r\n return \"YES\";\r\n \r\n /*\r\n String regex = \"\";\r\n for(int i = 0 ; i < b.length() ; i++){\r\n regex += \"[a-z]*\" + \"[\" + b.charAt(i) + \"|\" + Character.toLowerCase(b.charAt(i)) + \"]\";\r\n }\r\n regex += \"[a-z]*\";\r\n Pattern ptrn = Pattern.compile(regex);\r\n Matcher matcher = ptrn.matcher(a);\r\n\r\n return matcher.matches() ? \"YES\" : \"NO\";\r\n*/\r\n \r\n /*\r\n int aPtr = 0;\r\n\r\n //b e F g H\r\n // E F H\r\n for(int i = 0 ; i < b.length() ; i++){\r\n\r\n if(aPtr + 1 >= a.length())\r\n return \"NO\";\r\n //if(aPtr + 1 == a.length() && i + 1 == b.length())\r\n // return \"YES\";\r\n\r\n System.out.println(b.charAt(i) + \" \" + a.charAt(aPtr));\r\n if(b.charAt(i) == a.charAt(aPtr)){\r\n aPtr++;\r\n }else if(b.charAt(i) == Character.toUpperCase(a.charAt(aPtr)) && isLowerCase(a.charAt(aPtr))){\r\n aPtr++;\r\n\r\n } else if(b.charAt(i) != a.charAt(aPtr) && !isLowerCase(a.charAt(aPtr))){\r\n return \"NO\";\r\n }else if(b.charAt(i) != a.charAt(aPtr) && isLowerCase(a.charAt(aPtr))){\r\n aPtr++;\r\n i--;\r\n }\r\n\r\n\r\n\r\n }\r\n for(int i = aPtr ; i < a.length() ; i++){\r\n if(!isLowerCase(a.charAt(i)))\r\n return \"NO\";\r\n }\r\n\r\n return \"YES\";\r\n */\r\n\r\n }",
"private boolean compareActualAndExpectedOutputs(String string,\r\n\t\t\tString string2) {\r\n\t\treturn string.equals(string2);\r\n\t}",
"int main()\n{\n string str1,str2;\n cin>>str1;\n while(str2!=\"####\"){\n \t\n cin>>str2;\n int len=str1.length();\n if(str1[len-1]==str2[0]){\n \tcout<<str1<<endl;\n }\n else{\n \tbreak;\n \t}\n str1=str2;\n }\n cout<<str1;\n}",
"public boolean isAccepted2(String word) {\r\n\t return word.endsWith(\"baa\");\r\n \r\n }",
"public static boolean compareSubstring(List<String> pieces, String s)\n {\n\n boolean result = true;\n int len = pieces.size();\n\n int index = 0;\n\nloop: for (int i = 0; i < len; i++)\n {\n String piece = pieces.get(i);\n\n // If this is the first piece, then make sure the\n // string starts with it.\n if (i == 0)\n {\n if (!s.startsWith(piece))\n {\n result = false;\n break loop;\n }\n }\n\n // If this is the last piece, then make sure the\n // string ends with it.\n if (i == len - 1)\n {\n result = s.endsWith(piece);\n break loop;\n }\n\n // If this is neither the first or last piece, then\n // make sure the string contains it.\n if ((i > 0) && (i < (len - 1)))\n {\n index = s.indexOf(piece, index);\n if (index < 0)\n {\n result = false;\n break loop;\n }\n }\n\n // Move string index beyond the matching piece.\n index += piece.length();\n }\n\n return result;\n }",
"public void testCompareStrings() {\n\t\tString one = \"Hello\";\n\t\tString two = \"in the house\";\n\t\t//Gro▀schreibung vor Kleinschreibung\n\t\tassertTrue(comp.compareStrings(one, two) < 0);\n\t\tassertEquals(0, comp.compareStrings(one, one));\n\t\tassertTrue(comp.compareStrings(two, one) > 0);\n\t}",
"@Test\n public void whenEndsWithPrefixThenTrue() {\n char[] word = {'H', 'e', 'l', 'l', 'o'};\n char[] post = {'l', 'o'};\n boolean result = ArrayChar.endsWith(word, post);\n assertThat(result, is(true));\n }",
"public static boolean isOneAway(String string1, String string2) {\n int lengthDifference = Math.abs(string1.length() - string2.length());\n if (lengthDifference > 1) {\n return false;\n }\n\n String shorterString;\n String longerString;\n\n if (string1.length() < string2.length()) {\n shorterString = string1;\n longerString = string2;\n } else {\n shorterString = string2;\n longerString = string1;\n }\n\n int index1 = 0;\n int index2 = 0;\n\n boolean foundDifference = false;\n\n while (index1 < shorterString.length() && index2 < longerString.length()) {\n if (shorterString.charAt(index1) != longerString.charAt(index2)) {\n if (foundDifference) {\n return false;\n }\n\n foundDifference = true;\n\n if (shorterString.length() == longerString.length()) {\n // Replace edit\n index1++;\n } // Else -> insert or delete edit -> do not move index 1\n } else {\n index1++;\n }\n\n index2++;\n }\n\n return true;\n }",
"public static boolean stringIntersect(String a, String b, int len) {\n\t\tHashSet<String> mySet = new HashSet<String>();\n\t\tfor (int i=0; i+len <= a.length(); i++){\n\t\t\tmySet.add(a.substring(i, i+len));\n\t\t}\n\t\tfor (int i=0; i+len <= b.length(); i++){\n\t\t\tif (mySet.contains(b.substring(i, i+len))){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false; // TO DO ADD YOUR CODE HERE\n\t}",
"public static String longerString(String s1, String s2) {\n \tif(s1.length()>s2.length()) {\n \t\treturn s1;\n \t}else if(s1.length()<s2.length()) {\n \t\treturn s2;\n \t}\n return \"equal\";\n }",
"private boolean m81840a(String str, String str2) {\n boolean isEmpty = TextUtils.isEmpty(str);\n boolean isEmpty2 = TextUtils.isEmpty(str2);\n if (isEmpty && isEmpty2) {\n return true;\n }\n if (!isEmpty && isEmpty2) {\n return false;\n }\n if (!isEmpty || isEmpty2) {\n return str.equals(str2);\n }\n return false;\n }",
"abstract StringCompareImpl getOpposite();",
"public boolean rotationCheck(String a, String b) {\r\n\t\tif(a.length() != b.length()) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tString c = a + a;\r\n\t\tif(c.contains(b)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public static void check2StringIfContains(String value1, String value2){\n System.out.println(\"Check 2 string if contains:\\n1st: '\" + value1 + \"'\\n2nd: '\" + value2 + \"'\");\n Assert.assertTrue(value1.contains(value2));\n }",
"public static boolean namesEqual(String name1, String name2) {\n if (StringUtil.isEmpty(name1) && StringUtil.isEmpty(name2)) {\n return true;\n }\n if (normalizer.isDelimited(defaultRule, name1)) {\n if (!Objects.equals(name1, name2)) {\n return false;\n }\n } else {\n if (!StringUtil.equalsIgnoreCase(name1, name2)) {\n return false;\n }\n }\n return true;\n }",
"@Test\n public void testEqualChars2()\n {\n assertTrue(offBy2.equalChars('a', 'c')); // true\n assertTrue(offBy2.equalChars('c', 'a')); // true\n assertTrue(offBy2.equalChars('e', 'g')); // true\n\n assertFalse(offBy2.equalChars('C', 'c')); // false\n assertFalse(offBy2.equalChars('a', 'e')); // false\n assertFalse(offBy2.equalChars('z', 'a')); // false\n assertFalse(offBy2.equalChars('k', 's')); // false\n }",
"static Boolean isOneAway(String s1, String s2) {\r\n\t\tboolean results = false;\r\n\t\tchar[] chars1 = s1.toCharArray();\r\n\t\tchar[] chars2 = s2.toCharArray();\r\n\t\tif(s1.equals(s2)) {\r\n\t\t\tresults = true;\r\n\t\t}else if(chars1.length==chars2.length) {\r\n\t\t\tint mismatches = 0;\r\n\t\t\tfor(int i = 0; i < chars1.length; i++ ) {\r\n\t\t\t\tif(chars1[i]!=chars2[i]) {\r\n\t\t\t\t\tmismatches++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(mismatches <= 1) results = true;\r\n\t\t}else if(Math.abs(s1.length() - s2.length())==1) {\r\n\t\t\tif(s1.length() > s2.length()) {\r\n\t\t\t\tchars1 = s1.toCharArray();\r\n\t\t\t\tchars2 = s2.toCharArray();\r\n\t\t\t}else {\r\n\t\t\t\tchars1 = s2.toCharArray();\r\n\t\t\t\tchars2 = s1.toCharArray();\r\n\t\t\t}\r\n\t\t\tint mismatches = 0;\r\n\t\t\tint cursor1 = 0;\r\n\t\t\tint cursor2 = 0;\r\n\t\t\twhile((cursor1 < chars1.length) && (cursor2 < chars2.length)) {\r\n\t\t\t\tif(chars1[cursor1] != chars2[cursor2]) {\r\n\t\t\t\t\tmismatches++;\r\n\t\t\t\t\tcursor1++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tcursor1++;\r\n\t\t\t\t\tcursor2++;\r\n\t\t\t\t}\t\t\t\t \r\n\t\t\t}\r\n\t\t\tif(mismatches <= 1) results = true;\r\n\t\t}else {\r\n\t\t\tresults = false;\r\n\t\t}\r\n\t\r\n\t\treturn results;\r\n\t}",
"private boolean equals(String str1, String str2)\n\t{\n\t\tif (str1.length() != str2.length()) // Easiest to check is if they are the same to potentially avoid running remaining code\n\t\t\treturn false;\n\t\tfor(int i = 0; i < str1.length(); i++)\n\t\t{\n\t\t\tif (str1.charAt(i) != str2.charAt(i)) // If at any point one char is not equal to the same char at a given index then they are disimilar\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true; // If no discrepancies are found then the strings must be equal\n\t}",
"protected int stringCompare(String s1,String s2)\r\n\t{\r\n\t\tint shortLength=Math.min(s1.length(), s2.length());\r\n\t\tfor(int i=0;i<shortLength;i++)\r\n\t\t{\r\n\t\t\tif(s1.charAt(i)<s2.charAt(i))\r\n\t\t\t\treturn 0;\r\n\t\t\telse if(s1.charAt(i)>s2.charAt(i))\r\n\t\t\t\treturn 1;\t\r\n\t\t}\r\n\t\t//if the first shrotLenghtTH characters of s1 and s2 are same \r\n\t\tif(s1.length()<=s2.length()) //it's a close situation. \r\n\t\t\treturn 0;\r\n\t\telse \r\n\t\t\treturn 1; \r\n\t\t\r\n\t}",
"boolean checkChar(String s1, String s2);",
"public static boolean fullNamesEqual(String name1, String name2) {\n if (StringUtil.isEmpty(name1) && StringUtil.isEmpty(name2)) {\n return true;\n }\n // Split multi-part names into individual components and compare\n // each component. If delimited, do case compare.\n String[] names1 = normalizer.splitName(defaultRule, name1);\n String[] names2 = normalizer.splitName(defaultRule, name2);\n if (names1.length != names2.length) {\n return false;\n }\n for (int i = 0; i < names1.length; i++) {\n if (normalizer.isDelimited(defaultRule, names1[i])) {\n if (!Objects.equals(names1[i],names2[i])) {\n return false;\n }\n } else {\n if (!StringUtil.equalsIgnoreCase(names1[i],names2[i])) {\n return false;\n }\n }\n }\n return true;\n }",
"static String twoStrings(String s1, String s2) {\n String bigstr = s1.length() > s2.length() ? s1 : s2;\n String smallstr = s1.length() > s2.length() ? s2 : s1;\n int bigstrSize = bigstr.length();\n int smallstrSize = smallstr.length();\n\n boolean string_check[] = new boolean[1000];\n\n for (int i = 0; i < bigstrSize; i++) {\n string_check[bigstr.charAt(i) - 'A'] = true;\n }\n // if at least one char is present in boolean array\n for (int i = 0; i < smallstrSize; i++) {\n if (string_check[smallstr.charAt(i) - 'A'] == true) {\n return \"YES\";\n }\n }\n return \"NO\";\n }",
"public static boolean compareTimeBetweenStrings(String init, String end, String current, String format) {\n\t\tboolean result = false;\n\t\tif (DEBUG) Log.i(TAG, \"+++ compareTimeBetweenStrings: o1=\" + init + \" o2=\" + end + \" ===> \" + current + \" +++ \");\n\t\tDate initDate = DateUtils.string2Date(init,format);\n\t\tDate endDate = DateUtils.string2Date(end,format);\n\t\tDate currentDate = DateUtils.string2Date(current,format);\n\n\t\tif (initDate.after(endDate)) {\n\t\t\tresult = (currentDate.after(endDate) && currentDate.after(initDate))\n\t\t\t\t\t|| (currentDate.before(endDate) && currentDate.before(initDate));\n\t\t\tif (DEBUG) Log.i(TAG, \"+++ compareTimeBetweenStrings initDate.after(endDate) => \" + result);\n\t\t} else {\n\t\t\tresult = currentDate.after(initDate) && currentDate.before(endDate);\n\t\t\tif (DEBUG) Log.i(TAG, \"+++ compareTimeBetweenStrings endDate.after(initDate) => \" + result);\n\t\t}\n\n\t\treturn result;\n\t}",
"public boolean adjacent(String a, String b) {\n\t\tint nDifferent = 0;\n\t\tint length = a.length();\n\t\tfor (int i = 0; i < length; i++) {\n\t\t\tif (a.charAt(i) != b.charAt(i)) {\n\t\t\t\tnDifferent++;\n\t\t\t}\n\t\t\tif (nDifferent > 1)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"@Override\n\t\t\t\tpublic int compare(String o1, String o2) {\n\t\t\t\t\tif(o1.length()-o2.length() != 0) {\n\t\t\t\t\t\treturn o1.length()-o2.length();\n\t\t\t\t\t}else {\n\t\t\t\t\t\treturn o1.compareTo(o2);\n\t\t\t\t\t}\n\t\t\t\t}",
"private static int strStr(String a, String b)\n\t{\n\t\tint aL=a.length();\n\t\tint bL=b.length();\n\t\tif(a.equals(b)){\n\t\t\treturn 0;\n\t\t}\n\t\tfor(int i=0;i<aL;i++){\n\t\t\tint j=i+bL;\n\t\t\tif(j<=aL){\n\t\t\t\tString subStr=a.substring(i, j);\n\t\t\t\tif(subStr.equals(b)){\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}",
"@Override\n\t\tpublic int compare(String string1, String string2) {\n\t\t\treturn string1.charAt(string1.length() - 1) - string2.charAt(string2.length() - 1);\n\t\t}",
"private static boolean checkIfCanBreak( String s1, String s2 ) {\n\n if (s1.length() != s2.length())\n return false;\n\n Map<Character, Integer> map = new HashMap<>();\n for (Character ch : s2.toCharArray()) {\n map.put(ch, map.getOrDefault(ch, 0) + 1);\n }\n\n for (Character ch : s1.toCharArray()) {\n\n char c = ch;\n while ((int) (c) <= 122 && !map.containsKey(c)) {\n c++;\n }\n\n if (map.containsKey(c)) {\n map.put(c, map.getOrDefault(c, 0) - 1);\n\n if (map.get(c) <= 0)\n map.remove(c);\n }\n }\n\n return map.size() == 0;\n }",
"public static boolean testStrings(String expected, String actual) {\n System.out.println(\"Expected: \" + expected + \"\\nActual: \" + actual);\n if(expected.equals(actual)) {\n System.out.println(\"Test case passed\\n\");\n } else {\n System.out.println(\"Test case failed\\n\");\n }\n return expected.equals(actual);\n }",
"private void assertStringContains(final String expected, final String comparison) {\n final String cleanedExpected = expected.replaceAll(\"[\\t\\n]\", \"\")\n .replaceAll(\" {2,}\", \" \");\n final String cleanedTest = comparison.replaceAll(\"[\\t\\n]\", \"\")\n .replaceAll(\" {2,}\", \" \");\n assertTrue(cleanedTest.contains(cleanedExpected));\n }",
"public boolean endsLy(String str) {\r\n return str.length() > 1 ? str.substring(str.length() - 2, str.length()).equals(\"ly\") : false;\r\n }",
"public String lastChars(String a, String b) {\r\n String result = \"\";\r\n\r\n if (a.isEmpty()) {\r\n result += \"@\";\r\n } else {\r\n result += a.charAt(0);\r\n }\r\n\r\n if (b.isEmpty()) {\r\n result += \"@\";\r\n } else {\r\n result += b.charAt(b.length() - 1);\r\n }\r\n\r\n return result;\r\n }",
"public static int compareStringVersion(String ver1, String ver2)\n throws NumberFormatException {\n int i1, i2;\n while (ver1 != null || ver2 != null) {\n if (ver1 != null) {\n\tint d1 = ver1.indexOf(\".\");\n\tif (d1 == -1) {\n\t i1 = Integer.parseInt(ver1.trim());\n\t ver1 = null;\n\t} else {\n\t i1 = Integer.parseInt(ver1.substring(0, d1).trim());\n\t ver1 = ver1.substring(d1 + 1);\n\t}\n } else {\n\ti1 = 0;\n }\n if (ver2 != null) {\n\tint d2 = ver2.indexOf(\".\");\n\tif (d2 == -1) {\n\t i2 = Integer.parseInt(ver2.trim());\n\t ver2 = null;\n\t} else {\n\t i2 = Integer.parseInt(ver2.substring(0, d2).trim());\n\t ver2 = ver2.substring(d2 + 1);\n\t}\n } else {\n\ti2 = 0;\n }\n if (i1 < i2) {\n\treturn -1;\n }\n if (i1 > i2) {\n\treturn 1;\n }\n }\n return 0;\n }",
"static String morganAndString(String a, String b) {\n\n\t\tString result = \"\";\n\n\t\tint pointerA = 0, pointerB = 0;\n\n\t\touter:\n\t\t\twhile ( pointerA < a.length() || pointerB < b.length()){\n\t\t\t\tif ( pointerA == a.length()) {\n\t\t\t\t\tresult = result + b.charAt(pointerB++);\n\t\t\t\t}\n\t\t\t\telse if ( pointerB == b.length()) {\n\t\t\t\t\tresult = result + a.charAt(pointerA++);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tchar ca = a.charAt ( pointerA );\n\t\t\t\t\tchar cb = b.charAt ( pointerB );\n\n\t\t\t\t\tif ( ca < cb ) {\n\t\t\t\t\t\tresult = result + ca;\n\t\t\t\t\t\tpointerA++;\n\t\t\t\t\t}\n\t\t\t\t\telse if ( cb < ca ){\n\t\t\t\t\t\tresult = result + cb;\n\t\t\t\t\t\tpointerB++;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// Find the smallest successor.\n\t\t\t\t\t\tint extraPointer = 1;\n\t\t\t\t\t\twhile ( pointerA + extraPointer < a.length() && pointerB + extraPointer < b.length()){\n\t\t\t\t\t\t\tchar cEa = a.charAt ( pointerA + extraPointer);\n\t\t\t\t\t\t\tchar cEb = b.charAt ( pointerB + extraPointer);\n\n\t\t\t\t\t\t\tif ( cEa < cEb ){\n\t\t\t\t\t\t\t\tresult = result + cEa;\n\t\t\t\t\t\t\t\tpointerA++;\n\t\t\t\t\t\t\t\tcontinue outer;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if ( cEb < cEa ){\n\t\t\t\t\t\t\t\tresult = result + cEb;\n\n\n\t\t\t\t\t\t\t\tpointerB++;\n\t\t\t\t\t\t\t\tcontinue outer;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\textraPointer++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// We got to the point in which both are the same.\n\t\t\t\t\t\tif ( pointerA + extraPointer == a.length() && pointerB + extraPointer == b.length()){\n\t\t\t\t\t\t\t// Both are equal. It doesn't matter which one I take it from.\n\t\t\t\t\t\t\tresult = result + ca;\n\t\t\t\t\t\t\tpointerA++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tif ( pointerA + extraPointer == a.length() ){\n\t\t\t\t\t\t\t\t// Compare the current one of B with the next letter.\n\t\t\t\t\t\t\t\t// If next letter is smaller than current one, cut from here.\n\t\t\t\t\t\t\t\t// else, cut from A.\n\t\t\t\t\t\t\t\tif ( b.charAt ( pointerB + extraPointer ) > b.charAt ( pointerB + extraPointer + 1)){\n\t\t\t\t\t\t\t\t\tresult = result + cb;\n\t\t\t\t\t\t\t\t\tpointerB++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tresult = result + ca;\n\t\t\t\t\t\t\t\t\tpointerA++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// The opposite.\n\t\t\t\t\t\t\t\t// Compare the current one of B with the next letter.\n\t\t\t\t\t\t\t\t// If next letter is smaller than current one, cut from here.\n\t\t\t\t\t\t\t\t// else, cut from A.\n\t\t\t\t\t\t\t\tif ( a.charAt ( pointerA + extraPointer ) > a.charAt ( pointerA + extraPointer + 1)){\n\t\t\t\t\t\t\t\t\tresult = result + ca;\n\t\t\t\t\t\t\t\t\tpointerA++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tresult = result + cb;\n\t\t\t\t\t\t\t\t\tpointerB++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\treturn result;\n\n\n\t}",
"private int compareInternal(String shorter, String longer) {\n int lengthDiff = longer.length() - shorter.length();\n\n for (int compareStartIndexInsideLonger = 0; compareStartIndexInsideLonger <= lengthDiff; compareStartIndexInsideLonger++) {\n String compariosonPartFromLonger = longer.substring(compareStartIndexInsideLonger, compareStartIndexInsideLonger + shorter.length());\n //we have found an answer if they are not equal\n int result = shorter.compareTo(compariosonPartFromLonger);\n if (result != 0) {\n return result;\n }\n }\n\n //the are equal\n return 0;\n }",
"public boolean match(String string1, String string2) {\n\t\tMap<Character, Character>hash_map = new HashMap<Character, Character>();\n\n\t\t//If string length is not same, then it will return false\n\t\tif(string1.length()>string2.length() || string1.length()<string2.length()) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tfor(int i=0; i<string1.length(); i++) {\t\n\t\t\tif(!hash_map.containsKey(string1.charAt(i))) {\n\t\t\t\thash_map.put(string1.charAt(i), string2.charAt(i));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(!hash_map.get(string1.charAt(i)).equals(string2.charAt(i))) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"public String comboString(String a, String b) {\r\n return a.length() > b.length() ? b + a + b : a + b + a;\r\n }",
"private static boolean compareOrg(String antStr, String anaStr) {\n\t\t\tif(antStr.replaceAll(\"\\\\.\", \"\").equals(anaStr) ||\n\t\t\t\tanaStr.replaceAll(\"\\\\.\", \"\").equals(antStr)){\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tif(antStr.length()>anaStr.length()){\n\t\t\t\t\tString[] acr=getAcronyms(antStr);\n\t\t\t\t\tString s=loseInitialThe(anaStr);\n\t\t\t\t\treturn matchesAny(s,acr);\n\t\t\t\t} else {\n\t\t\t\t\tString[] acr=getAcronyms(anaStr);\n\t\t\t\t\tString s=loseInitialThe(antStr);\n\t\t\t\t\treturn matchesAny(s,acr);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"@Override\n public int compare(String o1, String o2) {\n return o1.length() - o2.length();\n }",
"public static boolean checkInclusion(String s1, String s2) {\n\n if (s1.length() > s2.length()) {\n return false;\n }\n\n // Assume the input strings contain only lower case letters [a-z] <-> [97-123] in ASCII\n int[] aux1 = generateFrequencyArray(s1);\n\n for (int i = 0; i <= s2.length() - s1.length(); i++) {\n String temp = s2.substring(i, i + s1.length());\n int[] aux = generateFrequencyArray(temp);\n if (Arrays.equals(aux1, aux)) {\n return true;\n }\n }\n return false;\n }",
"@Test\n public void testEqualChar3() {\n char a = '%';\n char b = '!';\n char c = '\\t';\n char d = '\\n';\n\n boolean result1 = offByOne.equalChars(a, b);\n boolean result2 = offByOne.equalChars(c, d);\n\n assertFalse(result1);\n assertTrue(result2);\n }",
"boolean equal(String s1, String s2) {\n return compareStrings(s1, s2) == 0;\n }",
"private static boolean letterDifferByOne(String word1, String word2) {\n if (word1.length() != word2.length()) {\n return false;\n }\n\n int differenceCount = 0;\n for (int i = 0; i < word1.length(); i++) {\n if (word1.charAt(i) != word2.charAt(i)) {\n differenceCount++;\n }\n }\n return (differenceCount == 1);\n }",
"private boolean isSubSequence(char str1[], char str2[]) {\n int j = 0;\n int m = str1.length;\n int n = str2.length;\n for (int i=0; i<n&&j<m; i++)\n if (str1[j] == str2[i])\n j++;\n return (j==m);\n }",
"public static boolean oneAway(String str1, String str2) {\n\t\t\n\t\t// If lengths make impossible to be one away\n\t\tif (Math.abs(str1.length()-str2.length()) > 1) return false;\n\t\t\n\t\t// if length of one of the strings is 0 (meaning other is 1 and\n\t\t// there by statisfies the one away add/delete edits\n\t\tif(str1.length() == 0 || str2.length() == 0) return true;\n\t\t\n\t\t// If strings are identical, return true\n\t\tif (str1.equals(str2)) return true;\n\t\t\n\t\t// Else determine if these strings are one away\n\t\t\n\t\t// check for one away by change: O(n)\n\t\tif(str1.length() == str2.length()) {\n\t\t\tint numDiff = 0;\n\t\t\t// for each character in string 1\n\t\t\tfor (int i = 0; i < str1.length(); i++) {\n\t\t\t\t// check for equality by index\n\t\t\t\tif (str1.charAt(i) != str2.charAt(i)) ++numDiff;\n\t\t\t\t// If exceeded 1 difference, return false\n\t\t\t\tif (numDiff > 1) return false;\n\t\t\t}\n\t\t\t// There was 1 difference, strings are off by one\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// check for off by one by delete: O(n)\n\t\telse if(str1.length() > str2.length()) {\n\t\t\tint p2 = 0; // pointer for string 2\n\t\t\tint numDiff = 0;\n\t\t\t\n\t\t\tfor (int i = 0; i < str1.length(); i++) {\n\t\t\t\tif (str2.charAt(p2) != str1.charAt(i)) {\n\t\t\t\t\t++numDiff;\n\t\t\t\t} else {\n\t\t\t\t\t++p2;\n\t\t\t\t}\n\t\t\t\t// If exceeded 1 difference, return false\n\t\t\t\tif (numDiff > 1) return false;\n\t\t\t}\n\t\t\t// There was 1 difference, strings are off by one\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// check for off by one by addition O(n)\n\t\telse {\n\t\t\tint p1 = 0; // pointer for string 1\n\t\t\tint numDiff = 0;\n\t\t\tfor (int i = 0; i < str2.length(); i++) {\n\t\t\t\tif (str1.charAt(p1) != str2.charAt(i)) {\n\t\t\t\t\t++numDiff;\n\t\t\t\t} else {\n\t\t\t\t\t++p1;\n\t\t\t\t}\n\t\t\t\t// If exceeded 1 difference, return false\n\t\t\t\tif (numDiff > 1) return false;\n\t\t\t}\n\t\t\t// There was 1 difference, strings are off by one\n\t\t\treturn true;\n\t\t}\n\t\t\n\t}",
"@Test\n public void testEqualChars2() {\n char a = 'a';\n char b = 'b';\n char c = '1';\n char d = '2';\n\n boolean result1 = offByOne.equalChars(a, b);\n boolean result2 = offByOne.equalChars(c, d);\n\n assertTrue(result1);\n assertTrue(result2);\n }",
"@Override\n\t\tpublic int compare(String string1, String string2) {\n\t\t\treturn string2.length() - string1.length();\n\t\t}",
"boolean isSubStr(String s, String t) {\n\t\tint k = 0;\n\t\tfor (int i = 0; i < s.length(); ++i) {\n\t\t\tboolean found = false;\n\t\t\tfor (; k < t.length(); ++k) if (found = (t.charAt(k) == s.charAt(i))) break;\n\t\t\tif (!found) return false;\n\t\t\t++k;\n\t\t}\n\t\treturn true;\n\t}",
"public static String between(String src, String str1, String str2) {\n String rt = src;\n rt = right(rt, str1);\n rt = left(rt, str2);\n return rt;\n }",
"public static boolean checkTwoStringsAreZeroOrOneEditsAway(String first, String second) {\n if (first.length() == second.length()) {\n return oneEditReplace(first, second);\n }else if(first.length() - 1 == second.length()){\n return oneEditInsert(second, first);\n }else if(first.length() + 1 == second.length())\n return oneEditInsert(first, second);\n\n return false;\n }",
"@Override\n\t\tpublic int compare(String string1, String string2) {\n\t\t\treturn string1.length() - string2.length();\n\t\t}",
"@Override\r\n\tpublic int compare(String s1, String s2) {\n\t\treturn s1.length() - s2.length();\r\n\t}",
"public boolean test(String a, String b)\n\t{\n\t\treturn false;\n\t}",
"public String helper(String s, int begin, int end) {\n\twhile (begin >= 0 && end <= s.length() - 1 && s.charAt(begin) == s.charAt(end)) {\n\t\tbegin--;\n\t\tend++;\n\t}\n\treturn s.substring(begin + 1, end);\n}"
] | [
"0.7607939",
"0.685001",
"0.6687958",
"0.66855514",
"0.6610328",
"0.64812654",
"0.6328248",
"0.630188",
"0.6236402",
"0.6191365",
"0.61858803",
"0.6157136",
"0.6153949",
"0.61183393",
"0.61081004",
"0.6106521",
"0.6106425",
"0.6073984",
"0.6064213",
"0.605905",
"0.6051654",
"0.6044362",
"0.6030106",
"0.60096306",
"0.5991602",
"0.59843725",
"0.59300315",
"0.5906503",
"0.5906223",
"0.5902028",
"0.5899388",
"0.58961964",
"0.5894742",
"0.58873945",
"0.587571",
"0.58678293",
"0.58670616",
"0.58630705",
"0.58627295",
"0.58544374",
"0.5841272",
"0.5825541",
"0.5822463",
"0.5812064",
"0.57904327",
"0.5790349",
"0.57885104",
"0.57797605",
"0.5772623",
"0.57495344",
"0.5748083",
"0.57442963",
"0.57399535",
"0.5738316",
"0.57333606",
"0.5723667",
"0.56974864",
"0.56973207",
"0.56961596",
"0.5694035",
"0.5691794",
"0.56794965",
"0.5664872",
"0.5648905",
"0.56456274",
"0.5633785",
"0.5632501",
"0.5629238",
"0.56254405",
"0.559693",
"0.55957973",
"0.5588858",
"0.5567926",
"0.55650306",
"0.5560413",
"0.5551086",
"0.55474925",
"0.5547275",
"0.55321187",
"0.5504629",
"0.5497526",
"0.54964846",
"0.54952437",
"0.54928666",
"0.54922795",
"0.54921824",
"0.5480096",
"0.5477808",
"0.5473159",
"0.54693663",
"0.54630464",
"0.5451556",
"0.5448035",
"0.54407424",
"0.5437066",
"0.5432831",
"0.54243565",
"0.54229844",
"0.5421218",
"0.54205596",
"0.54031837"
] | 0.0 | -1 |
Creates a new AddPatchGraphGenerator based on graph gen. The graph gen is dupplicated. | public AddPatchGraphGenerator(GraphGenerator gen) {
super(gen, "AddPatch");
this.addedElem = null;
if(gen.isIntraPatchDist()) {
throw new IllegalArgumentException("Intra patch distance is not supported");
}
graph = gen.dupGraphWithout(Collections.EMPTY_LIST, Collections.EMPTY_LIST);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void patternGenAdded(PatternGen patternGen) {\n\t}",
"@Override\n\tpublic void add(Generator generator) {\n\t}",
"private GraphPattern translateToGP(){\r\n\r\n\t\t//Generate the graph pattern object\r\n\t\tGraphPattern gp = new GraphPattern();\r\n\r\n\r\n\t\t//For each Node object, create an associated MyNode object\r\n\t\tint nodeCount = 0;\r\n\t\tfor (Node n : allNodes){\r\n\t\t\tMyNode myNode = new MyNode(nodeCount, \"PERSON\");\r\n\t\t\tnodesMap.put(n, myNode);\r\n\t\t\tgp.addNode(myNode);\r\n\r\n\t\t\tnodeCount++;\r\n\t\t}\r\n\r\n\t\t//For k random MyNodes add the id as an attribute/property.\r\n\t\t//This id is used for cypher queries.\r\n\t\t//This process uses simple random sampling\r\n\t\tif (rooted > allNodes.size()){\r\n\t\t\trooted = allNodes.size();\r\n\t\t}\r\n\r\n\t\tList<Node> allNodesClone = new ArrayList<Node>();\r\n\t\tallNodesClone.addAll(allNodes);\r\n\r\n\t\tfor (int i = 0; i < rooted; i++){\r\n\t\t\t//Pick a random node from allNodes and get it's corresponding MyNode\r\n\t\t\tint idx = random.nextInt(allNodesClone.size());\r\n\t\t\tNode node = allNodesClone.get(idx);\r\n\t\t\tMyNode myNode = nodesMap.get(node);\r\n\r\n\t\t\t//Add the property to myNode\r\n\t\t\ttry (Transaction tx = graphDb.beginTx()){\r\n\t\t\t\tmyNode.addAttribute(\"id\", node.getProperty(\"id\")+\"\");\r\n\t\t\t\ttx.success();\r\n\t\t\t}\r\n\t\t\t//Remove the node from allNodesClone list.\r\n\t\t\tallNodesClone.remove(idx);\r\n\t\t}\r\n\r\n\t\t//Process the relationships\r\n\t\tint relCount = 0;\r\n\t\tString relPrefix = \"rel\";\r\n\r\n\t\tfor (Relationship r : rels){\r\n\r\n\t\t\tMyNode source = null, target = null;\r\n\t\t\tRelType type = null;\r\n\r\n\t\t\t//For each relationship in rels, create a corresponding relationship in gp.\r\n\t\t\ttry (Transaction tx = graphDb.beginTx()){\r\n\t\t\t\tsource = nodesMap.get(r.getStartNode());\r\n\t\t\t\ttarget = nodesMap.get(r.getEndNode());\r\n\t\t\t\ttype = GPUtil.translateRelType(r.getType());\r\n\t\t\t\ttx.success();\r\n\t\t\t}\r\n\r\n\t\t\tMyRelationship rel = new MyRelationship(source, target, type, relCount);\r\n\t\t\trelCount++;\r\n\r\n\t\t\tif (relCount >= 25){\r\n\t\t\t\trelCount = 0;\r\n\t\t\t\trelPrefix = relPrefix + \"l\";\r\n\t\t\t}\r\n\r\n\t\t\tgp.addRelationship(rel);\r\n\t\t\trelsMap.put(r, rel);\r\n\t\t}\r\n\r\n\t\t//Set the attribute requirements\r\n\t\tattrsReq(gp, true);\r\n\t\tattrsReq(gp, false);\r\n\t\treturn gp;\r\n\t}",
"private void createGraphs() {\n initialGraphCreation.accept(caller, listener);\n graphCustomization.accept(caller, listener);\n caller.generateAndAdd(params.getNumCallerEvents(), callerAddToGraphTest);\n listener.generateAndAdd(params.getNumListenerEvents(), listenerAddToGraphTest);\n generationDefinitions.accept(caller, listener);\n }",
"private DGraph initFactory(DGraph g) {\n\t\tg= new DGraph();\n\t\tNodeData d0 = new NodeData(0);\n\t\tNodeData d1 = new NodeData(1);\n\t\tNodeData d2 = new NodeData(2);\n\t\tNodeData d3 = new NodeData(3);\n\t\tNodeData d4 = new NodeData(4);\n\t\tg.addNode(d0);\n\t\tg.addNode(d1);\n\t\tg.addNode(d2);\n\t\tg.addNode(d3);\n\t\tg.addNode(d4);\n\t\tg.connect(1, 2, 3);\n\t\tg.connect(2, 1, 4);\n\t\tg.connect(3, 4, 5);\n\t\tg.connect(4,3, 7);\n\t\tg.connect(3,2, 4);\n\t\tg.connect(3,1, 5);\n\t\tg.connect(1,3, 2);\n\t\treturn g;\n\t}",
"void makeSampleGraph() {\n\t\tg.addVertex(\"a\");\n\t\tg.addVertex(\"b\");\n\t\tg.addVertex(\"c\");\n\t\tg.addVertex(\"d\");\n\t\tg.addVertex(\"e\");\n\t\tg.addVertex(\"f\");\n\t\tg.addVertex(\"g\");\n\t\tg.addEdge(\"a\", \"b\");\n\t\tg.addEdge(\"b\", \"c\");\n\t\tg.addEdge(\"b\", \"f\");\n\t\tg.addEdge(\"c\", \"d\");\n\t\tg.addEdge(\"d\", \"e\");\n\t\tg.addEdge(\"e\", \"f\");\n\t\tg.addEdge(\"e\", \"g\");\n\t}",
"@Override\n\tpublic graph copy() {\n\t\tgraph copy = new DGraph();\n\t\tCollection<node_data> nColl = this.GA.getV();\n\t\tfor (node_data node : nColl) {\n\t\t\tnode_data temp = new Node((Node) node );\n\t\t\tcopy.addNode(node);\n\t\t}\n\t\tCollection<node_data> nColl2 = this.GA.getV();\n\t\tfor (node_data node1 : nColl2) {\n\t\t\tCollection<edge_data> eColl = this.GA.getE(node1.getKey());\n\t\t\tif (eColl!=null) {\n\t\t\t\tfor (edge_data edge : eColl) {\n\t\t\t\t\tcopy.connect(edge.getSrc(), edge.getDest(), edge.getWeight());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn copy;\n\t}",
"public interface BaseGraphCollection<\n G extends GraphHead,\n V extends Vertex,\n E extends Edge,\n LG extends BaseGraph<G, V, E, LG, GC>,\n GC extends BaseGraphCollection<G, V, E, LG, GC>>\n extends GraphCollectionLayout<G, V, E>, BaseGraphCollectionOperators<G, V, E, LG, GC> {\n\n /**\n * Returns the Gradoop Flink configuration.\n *\n * @return the Gradoop Flink configuration\n */\n GradoopFlinkConfig getConfig();\n\n /**\n * Get the factory that is responsible for creating an instance of {@link GC}.\n *\n * @return a factory that can be used to create a {@link GC} instance\n */\n BaseGraphCollectionFactory<G, V, E, LG, GC> getFactory();\n\n /**\n * Get the factory that is responsible for creating an instance of {@link LG}.\n *\n * @return a factory that can be used to create a {@link LG} instance\n */\n BaseGraphFactory<G, V, E, LG, GC> getGraphFactory();\n\n //----------------------------------------------------------------------------\n // Base Graph / Graph Head Getters\n //----------------------------------------------------------------------------\n\n @Override\n default LG getGraph(final GradoopId graphID) {\n // filter vertices and edges based on given graph id\n DataSet<G> graphHead = getGraphHeads()\n .filter(new BySameId<>(graphID));\n DataSet<V> vertices = getVertices()\n .filter(new InGraph<>(graphID));\n DataSet<E> edges = getEdges()\n .filter(new InGraph<>(graphID));\n\n return getGraphFactory().fromDataSets(graphHead, vertices, edges);\n }\n\n @Override\n default GC getGraphs(final GradoopIdSet identifiers) {\n DataSet<G> newGraphHeads = this.getGraphHeads()\n .filter((FilterFunction<G>) graphHead -> identifiers.contains(graphHead.getId()));\n\n // build new vertex set\n DataSet<V> vertices = getVertices()\n .filter(new InAnyGraph<>(identifiers));\n\n // build new edge set\n DataSet<E> edges = getEdges()\n .filter(new InAnyGraph<>(identifiers));\n\n return getFactory().fromDataSets(newGraphHeads, vertices, edges);\n }\n\n //----------------------------------------------------------------------------\n // Utility methods\n //----------------------------------------------------------------------------\n\n @Override\n default DataSet<Boolean> isEmpty() {\n return getGraphHeads()\n .map(new True<>())\n .distinct()\n .union(getConfig().getExecutionEnvironment().fromElements(false))\n .reduce(new Or())\n .map(new Not());\n }\n}",
"public PlainGraph createGraph() {\n PlainGraph graph = new PlainGraph(getUniqueGraphName(), GraphRole.RULE);\n graphNodeMap.put(graph, new HashMap<>());\n return graph;\n }",
"@Override\n public weighted_graph copy() {\n weighted_graph copy = new WGraph_DS(this.ga);//create the copy graph via copy constructor\n return copy;\n }",
"public void addPatch(Geometry geom, double capa) throws IOException {\n if(addedElem != null) {\n throw new IllegalStateException(\"Graph already contains an added element\");\n }\n \n BasicGraphBuilder builder = new BasicGraphBuilder();\n // crée le noeud\n DefaultFeature patch = getProject().createPatch(geom, capa);\n Node node = builder.buildNode();\n node.setObject(patch);\n graph.getNodes().add(node);\n \n // puis crée les liens\n HashMap<DefaultFeature, Path> newLinks = getLinkset().calcNewLinks(patch);\n for(DefaultFeature d : newLinks.keySet()) {\n Path path = new Path(patch, d, newLinks.get(d).getCost(), newLinks.get(d).getDist()); \n if(getType() != PRUNED || getCost(path) <= getThreshold()) {\n Node nodeB = null;\n for(Node n : (Collection<Node>)getGraph().getNodes()) {\n if(((Feature)n.getObject()).getId().equals(d.getId())) {\n nodeB = n;\n break;\n }\n }\n if(nodeB == null) {\n throw new IllegalStateException(\"Graph does not contain the patch node : \" + d.getId());\n }\n Edge edge = builder.buildEdge(node, nodeB);\n edge.setObject(path);\n node.add(edge);\n nodeB.add(edge);\n graph.getEdges().add(edge);\n }\n }\n \n addedElem = node;\n \n components = null;\n compFeatures = null;\n }",
"protected void addGraph(IGraph graph) {\n\n if (graph != null) {\n\n this.ids.add(graph.getID());\n this.graphMap.put(graph.getID(), graph);\n }\n }",
"public Population(Graph graph)\r\n/* 13: */ {\r\n/* 14:36 */ g = graph.cloneGraph();\r\n/* 15: */ }",
"protected IWeightedGraph<GraphNode, WeightedEdge> createGraph() {\r\n\t\treturn createGraph(goapUnit.getGoalState());\r\n\t}",
"public AddPatchTask(Geometry addedGeom, double capaGeom, GraphGenerator gen, GlobalMetric metric, \n HashMap<Geometry, Double> testGeoms, ProgressBar monitor) {\n super(monitor);\n this.addedGeom = addedGeom;\n this.capaGeom = capaGeom;\n this.metric = metric;\n this.gen = gen;\n this.graphName = gen.getName();\n this.testGeoms = testGeoms;\n geoms = new ArrayList<>(testGeoms.keySet());\n }",
"public BegsBuilder(Graph graph) {\n this.graph = graph;\n }",
"public Object clone() throws CloneNotSupportedException {\n/* 206 */ CustomXYURLGenerator clone = (CustomXYURLGenerator)super.clone();\n/* 207 */ clone.urlSeries = new ArrayList(this.urlSeries);\n/* 208 */ return clone;\n/* */ }",
"@Override\n public BankPatch createNewPatch() {\n return super.createNewPatch();\n }",
"GraphFactory getGraphFactory();",
"@Override\n\t\tpublic ImmutableSequentialGraph copy() {\n\t\t\treturn new ComposedGraph( g0, g1.copy() );\n\t\t}",
"@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2014-09-06 12:51:01.208 -0400\", hash_original_method = \"02D67B7BBDDCEC9BC9A477128D96A70E\", hash_generated_method = \"73DCA79669D2BAEA0D08C443D09F446C\")\n \npublic Stub()\n{\nthis.attachInterface(this, DESCRIPTOR);\n}",
"@SuppressWarnings(\"unchecked\")\n\tpublic AnalysisGraph createNewInstance() {\n\t\tAnalysisGraph graph = new AnalysisGraph();\n\t\tgraph.currentIndex = currentIndex;\n\t\t\n\t\tgraph.nodes = (HashMap<String, Node>) nodes.clone();\n\t\tgraph.nodeList = (ArrayList<Node>)((ArrayList<Node>) nodeList).clone();\n\t\tgraph.links = (ArrayList<Link>)((ArrayList<Link>) links).clone();\n\t\treturn graph;\n\t}",
"public DynamicStencilOperator generate(Python pythonSpec, MutableModule module) {\n\t\tassert module != null : \"Null moduled passed.\";\n\t\t\n\t\tregisterEnv(pythonSpec.getEnvironment());\n\t\tJythonOperator legend = new JythonOperator(module.getModuleData().getName(), pythonSpec.getName());\n\t\tfor (PythonFacet b: pythonSpec.getFacets()) {\n\t\t\tif (b.getName().equals(INIT_BLOCK_TAG)) {invokeInitBlock(b, pythonSpec.getEnvironment()); continue;}\n\t\t\t\n\t\t\ttry {legend.add(new JythonEncapsulation(pythonSpec,b,this), b);}\n\t\t\tcatch (Exception e) {throw new RuntimeException(String.format(\"Error creating encapsulation for facet %1$s (%2$s).\", b.getName(), b.getBody()),e);}\n\t\t}\n\n\t\tmodule.addOperator(legend);\n\t\t\n\t\treturn legend;\n\t}",
"public RandomNetworkGenerator copy()\n\t{\n\t\t\n\t\treturn new DegreePreservingNetworkRandomizer(mOriginal, mDirected, mIterations); \n\t}",
"public void createGraph() {\n System.out.println(\"The overlay graph will be created from scratch\");\n graph = new MatrixOverlayGraph();\n parse(dumpPath);\n saveGraph();\n graph.createSupporters(kdTreeSupporterActived);\n saveSupporters();\n }",
"public GraphPool() {\n\t\tmMetadataPool = new PoolNodeMetadata();\n\t\tmIdentifierPool = new PoolNodeIdentifier(mMetadataPool);\n\t\tmLinkPool = new PoolExpandedLink(mIdentifierPool, mMetadataPool);\n\t}",
"public DynamicInducedSubgraph(Graph g) {\n\t\tsuper();\n\t\tGraphTools.copyGraph(g, this);\n\t\tllVertices = new LinkedHashSet<AdjListVertex>(vertices);\n\t\tllEdges = new LinkedHashSet<AdjListEdge>(edges);\n\t}",
"private void initGraph() {\n nodeMap = Maps.newIdentityHashMap();\n stream.forEach(t -> {\n Object sourceKey = sourceId.extractValue(t.get(sourceId.getTableId()));\n Object targetKey = targetId.extractValue(t.get(targetId.getTableId()));\n ClosureNode sourceNode = nodeMap.get(sourceKey);\n ClosureNode targetNode = nodeMap.get(targetKey);\n if (sourceNode == null) {\n sourceNode = new ClosureNode(sourceKey);\n nodeMap.put(sourceKey, sourceNode);\n }\n if (targetNode == null) {\n targetNode = new ClosureNode(targetKey);\n nodeMap.put(targetKey, targetNode);\n }\n sourceNode.next.add(targetNode);\n });\n\n }",
"@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 13:00:49.404 -0500\", hash_original_method = \"CD5C82C799E78C74801FDB521CEE7324\", hash_generated_method = \"CD5C82C799E78C74801FDB521CEE7324\")\n \nContext ()\n {\n copyTables();\n }",
"private void createGraph() {\n \t\t\n \t\t// Check capacity\n \t\tCytoscape.ensureCapacity(nodes.size(), edges.size());\n \n \t\t// Extract nodes\n \t\tnodeIDMap = new OpenIntIntHashMap(nodes.size());\n \t\tginy_nodes = new IntArrayList(nodes.size());\n \t\t// OpenIntIntHashMap gml_id2order = new OpenIntIntHashMap(nodes.size());\n \n \t\tfinal HashMap gml_id2order = new HashMap(nodes.size());\n \n \t\tSet nodeNameSet = new HashSet(nodes.size());\n \n \t\tnodeMap = new HashMap(nodes.size());\n \n \t\t// Add All Nodes to Network\n \t\tfor (int idx = 0; idx < nodes.size(); idx++) {\n \t\t\t\n \t\t\tif (taskMonitor != null) {\n \t\t\t\ttaskMonitor.setPercentCompleted(percentUtil.getGlobalPercent(1,\n \t\t\t\t\t\tidx, nodes.size()));\n \t\t\t}\n \n \t\t\t// Get a node object (NOT a giny node. XGMML node!)\n \t\t\tfinal cytoscape.generated2.Node curNode = (cytoscape.generated2.Node) nodes\n \t\t\t\t\t.get(idx);\n \t\t\tfinal String nodeType = curNode.getName();\n \t\t\tfinal String label = (String) curNode.getLabel();\n \n \t\t\treadAttributes(label, curNode.getAtt(), NODE);\n \n \t\t\tnodeMap.put(curNode.getId(), label);\n \n \t\t\tif (nodeType != null) {\n \t\t\t\tif (nodeType.equals(\"metaNode\")) {\n \t\t\t\t\tfinal Iterator it = curNode.getAtt().iterator();\n \t\t\t\t\twhile (it.hasNext()) {\n \t\t\t\t\t\tfinal Att curAttr = (Att) it.next();\n \t\t\t\t\t\tif (curAttr.getName().equals(\"metanodeChildren\")) {\n \t\t\t\t\t\t\tmetanodeMap.put(label, ((Graph) curAttr.getContent()\n \t\t\t\t\t\t\t\t\t.get(0)).getNodeOrEdge());\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (nodeNameSet.add(curNode.getId())) {\n \t\t\t\tfinal Node node = (Node) Cytoscape.getCyNode(label, true);\n \n \t\t\t\tginy_nodes.add(node.getRootGraphIndex());\n \t\t\t\tnodeIDMap.put(idx, node.getRootGraphIndex());\n \n \t\t\t\t// gml_id2order.put(Integer.parseInt(curNode.getId()), idx);\n \n \t\t\t\tgml_id2order.put(curNode.getId(), Integer.toString(idx));\n \n \t\t\t\t// ((KeyValue) node_root_index_pairs.get(idx)).value = (new\n \t\t\t\t// Integer(\n \t\t\t\t// node.getRootGraphIndex()));\n \t\t\t} else {\n \t\t\t\tthrow new XGMMLException(\"XGMML id \" + nodes.get(idx)\n \t\t\t\t\t\t+ \" has a duplicated label: \" + label);\n \t\t\t\t// ((KeyValue)node_root_index_pairs.get(idx)).value = null;\n \t\t\t}\n \t\t}\n \t\tnodeNameSet = null;\n \n \t\t// Extract edges\n \t\tginy_edges = new IntArrayList(edges.size());\n \t\tSet edgeNameSet = new HashSet(edges.size());\n \n \t\tfinal CyAttributes edgeAttributes = Cytoscape.getEdgeAttributes();\n \n \t\t// Add All Edges to Network\n \t\tfor (int idx = 0; idx < edges.size(); idx++) {\n \n \t\t\tif (taskMonitor != null) {\n \t\t\t\ttaskMonitor.setPercentCompleted(percentUtil.getGlobalPercent(2,\n \t\t\t\t\t\tidx, edges.size()));\n \t\t\t}\n \t\t\tfinal cytoscape.generated2.Edge curEdge = (cytoscape.generated2.Edge) edges\n \t\t\t\t\t.get(idx);\n \n \t\t\tif (gml_id2order.containsKey(curEdge.getSource())\n \t\t\t\t\t&& gml_id2order.containsKey(curEdge.getTarget())) {\n \n \t\t\t\tString edgeName = curEdge.getLabel();\n \n \t\t\t\tif (edgeName == null) {\n \t\t\t\t\tedgeName = \"N/A\";\n \t\t\t\t}\n \n \t\t\t\tint duplicate_count = 1;\n \t\t\t\twhile (!edgeNameSet.add(edgeName)) {\n \t\t\t\t\tedgeName = edgeName + \"_\" + duplicate_count;\n \t\t\t\t\tduplicate_count += 1;\n \t\t\t\t}\n \n \t\t\t\tEdge edge = Cytoscape.getRootGraph().getEdge(edgeName);\n \n \t\t\t\tif (edge == null) {\n \n \t\t\t\t\tfinal String sourceName = (String) nodeMap.get(curEdge\n \t\t\t\t\t\t\t.getSource());\n \t\t\t\t\tfinal String targetName = (String) nodeMap.get(curEdge\n \t\t\t\t\t\t\t.getTarget());\n \n \t\t\t\t\tfinal Node node_1 = Cytoscape.getRootGraph().getNode(\n \t\t\t\t\t\t\tsourceName);\n \t\t\t\t\tfinal Node node_2 = Cytoscape.getRootGraph().getNode(\n \t\t\t\t\t\t\ttargetName);\n \n \t\t\t\t\tfinal Iterator it = curEdge.getAtt().iterator();\n \t\t\t\t\tAtt interaction = null;\n \t\t\t\t\tString itrValue = \"unknown\";\n \t\t\t\t\twhile (it.hasNext()) {\n \t\t\t\t\t\tinteraction = (Att) it.next();\n \t\t\t\t\t\tif (interaction.getName().equals(\"interaction\")) {\n \t\t\t\t\t\t\titrValue = interaction.getValue();\n \t\t\t\t\t\t\tif (itrValue == null) {\n \t\t\t\t\t\t\t\titrValue = \"unknown\";\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \n \t\t\t\t\tedge = Cytoscape.getCyEdge(node_1, node_2,\n \t\t\t\t\t\t\tSemantics.INTERACTION, itrValue, true);\n \n \t\t\t\t\t// Add interaction to CyAttributes\n \t\t\t\t\tedgeAttributes.setAttribute(edge.getIdentifier(),\n \t\t\t\t\t\t\tSemantics.INTERACTION, itrValue);\n \t\t\t\t}\n \n \t\t\t\t// Set correct ID, canonical name and interaction name\n \t\t\t\tedge.setIdentifier(edgeName);\n \n \t\t\t\treadAttributes(edgeName, curEdge.getAtt(), EDGE);\n \n \t\t\t\tginy_edges.add(edge.getRootGraphIndex());\n \t\t\t\t// ((KeyValue) edge_root_index_pairs.get(idx)).value = (new\n \t\t\t\t// Integer(\n \t\t\t\t// edge.getRootGraphIndex()));\n \t\t\t} else {\n \t\t\t\tthrow new XGMMLException(\n \t\t\t\t\t\t\"Non-existant source/target node for edge with gml (source,target): \"\n \t\t\t\t\t\t\t\t+ nodeMap.get(curEdge.getSource()) + \",\"\n \t\t\t\t\t\t\t\t+ nodeMap.get(curEdge.getTarget()));\n \t\t\t}\n \t\t}\n \t\tedgeNameSet = null;\n \n \t\tif (metanodeMap.size() != 0) {\n \t\t\tfinal Iterator it = metanodeMap.keySet().iterator();\n \t\t\twhile (it.hasNext()) {\n \t\t\t\tfinal String key = (String) it.next();\n \t\t\t\tcreateMetaNode(key, (List) metanodeMap.get(key));\n \t\t\t}\n \t\t}\n \t}",
"private Graph<Node, DefaultEdge> addEdges(Graph<Node, DefaultEdge> g) {\n List<Edge> edges = edgeRepository.findAll();\n edges.forEach(e -> g.addEdge(new Node(e.getA()), new Node(e.getB())));\n return g;\n }",
"public gov.nih.nlm.ncbi.www.SeqIdDocument.SeqId.Gpipe addNewGpipe()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n gov.nih.nlm.ncbi.www.SeqIdDocument.SeqId.Gpipe target = null;\r\n target = (gov.nih.nlm.ncbi.www.SeqIdDocument.SeqId.Gpipe)get_store().add_element_user(GPIPE$36);\r\n return target;\r\n }\r\n }",
"protected Graph<Integer, Edge<Integer>> generateGraph() {\n Graph<Integer, Edge<Integer>> graph = newGraph();\n Integer[] integersArray = new Integer[25];\n\n /*\n * add all integers in [0,24]\n */\n for (int i = 0; i < 25; i++) {\n integersArray[i] = new Integer(i);\n graph.addVertex(integersArray[i]);\n }\n\n /*\n * create edges between all integers i, j for which (i + j) is even\n */\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n continue;\n }\n graph.addEdge(new UnweightedEdge(integersArray[i], integersArray[j]));\n }\n }\n\n return graph;\n }",
"public Rule rewriteSeparateGM() {\n\n // Extract all the variables used in the rule\n final Set<String> vars = new HashSet<String>();\n vars.addAll(Algebra.extractVariables(this.deleteExpr, false));\n vars.addAll(Algebra.extractVariables(this.insertExpr, false));\n vars.addAll(Algebra.extractVariables(this.whereExpr, false));\n\n // Select a fresh graph variable\n String graphVarName = \"g\";\n int index = 0;\n while (vars.contains(graphVarName)) {\n graphVarName = \"g\" + index++;\n }\n final Var graphVar = new Var(graphVarName);\n\n // Generate the where expr if missing\n TupleExpr whereExpr = this.whereExpr;\n if (whereExpr == null) {\n whereExpr = new StatementPattern(new Var(\"s\"), new Var(\"p\"), new Var(\"o\"),\n graphVar.clone());\n }\n\n // Rewrite the rule\n final TupleExpr newDeleteExpr = Algebra.rewriteGraph(this.deleteExpr, graphVar);\n final TupleExpr newInsertExpr = Algebra.rewriteGraph(this.insertExpr, graphVar);\n final TupleExpr newWhereExpr = Algebra.rewriteGraph(whereExpr, graphVar);\n return new Rule(newID(this.id.stringValue()), this.fixpoint, this.phase, newDeleteExpr,\n newInsertExpr, newWhereExpr);\n }",
"public DotGraph(String graphname) {\n this.graphname = graphname;\n this.isSubGraph = false;\n this.nodes = new HashMap<String, DotGraphNode>(100);\n this.drawElements = new LinkedList<Renderable>();\n this.attributes = new LinkedList<DotGraphAttribute>();\n }",
"public void buildGraph(){\n\t}",
"@Override\n\tpublic AbstractTreeAdjacencyGraph<N, E> cloneAdd(final E newEdge)\n\t{\n\t\treturn (AbstractTreeAdjacencyGraph<N, E>) super.cloneAdd(newEdge);\n\t}",
"public GraphWrapper() {\n\t\tthis.graph = new Graph<T,E>();\n\t}",
"@Override\n default LG getGraph(final GradoopId graphID) {\n // filter vertices and edges based on given graph id\n DataSet<G> graphHead = getGraphHeads()\n .filter(new BySameId<>(graphID));\n DataSet<V> vertices = getVertices()\n .filter(new InGraph<>(graphID));\n DataSet<E> edges = getEdges()\n .filter(new InGraph<>(graphID));\n\n return getGraphFactory().fromDataSets(graphHead, vertices, edges);\n }",
"@Override\r\n public weighted_graph copy() {\n weighted_graph copy = new WGraph_DS();\r\n for (node_info curr : this.Graph.getV()) { //The loop passes through all the ver' of the graph\r\n Nodes t = new Nodes(curr); //create new node\r\n copy.addNode(t.key); //copy the the old node to the new node\r\n }\r\n for (node_info curr0 : this.Graph.getV()) {\r\n for (node_info curr1 : this.Graph.getV(curr0.getKey())) { //this loops pass over the all nodes and copy the connection\r\n double i = this.Graph.getEdge(curr0.getKey(), curr1.getKey());\r\n if (i != -1) {\r\n copy.connect(curr0.getKey(), curr1.getKey(), i);\r\n }\r\n }\r\n }\r\n return copy;\r\n\r\n }",
"public Generation(Generation lastGen, double differenceImportance) {\n rules = lastGen.rules;\n this.differenceImportance = differenceImportance;\n lastGen.sortDNAs();\n for (int i = 0; i < 10; i++) {\n for (int j = 0; j < 10; j++) {\n DNA dna = new DNA(lastGen.getDNAs().get(i), lastGen.getDNAs().get(j));\n dna.mutate();\n DNAs.add(dna);\n }\n }\n for (int i = 0; i < DNAs.size(); i++) {\n DNAs.get(i).setDifferenceImportance(differenceImportance);\n }\n }",
"private Graph<Node, DefaultEdge> addNodes(Graph<Node, DefaultEdge> g) {\n List<Node> nodes = nodeRepository.findAll();\n nodes.forEach(g::addVertex);\n return g;\n }",
"ISourceGenPatch[] getSourceGenPatches();",
"void createGraphForSingleLoad();",
"public void generate() {\n\t\tthis.initializePathBindingClass();\n\t\t// managed at abstract level ; name provided at binding generation time\n\t\t// this.addGetName();\n\t\t// this.addGetType();\n\n\t\t// add all properties methods\n\t\tthis.addProperties();\n\t\t// add getter that provides property list\n\t\tthis.addGetChildBindings();\n\n\t\t// initialize class declaration (*Binding)\n\t\tthis.initializeRootBindingClass();\n\t\t// add constructors\n\t\tthis.addConstructors();\n\t\t// add getWithRoot method\n\t\tthis.addGetWithRoot();\n\t\t// add getSafelyWithRoot method\n\t\tthis.addGetSafelyWithRoot();\n\n\t\tthis.addGeneratedTimestamp();\n\t\tthis.addSerialVersionUID();\n\t\tthis.saveCode(this.pathBindingClass);\n\t\tthis.saveCode(this.rootBindingClass);\n\t}",
"public static Graph makeMeAGraph(Set<Operation> operations, State init){\n Graph graph = new implementGraph(operations , init) ;\n return graph;\n\n\t //\t throw new NotImplementedException();\n }",
"private static void addDepotToGraph(Depot newDepot, Graph<Node, WeightEdge> graph, List<Node> depots, List<Node> trips, Problem problem){\n Node depotSource = new Node(newDepot, newDepot.getNumberOfVehicles(), true);\n graph.addVertex(depotSource);\n depots.add(depotSource);\n\n // add the depot sink vertex\n Node depotSink = new Node(newDepot, -newDepot.getNumberOfVehicles(), false);\n graph.addVertex(depotSink);\n depots.add(depotSink);\n\n // add edges from this depot source to all existing trips entry\n // add edges from all existing trips exit to this depot sink\n for(Node trip : trips){\n if(!trip.isExitNode()){\n // from depot source to trip startPoint\n WeightEdge depotToTripWeightEdge = new BoundedWeightEdge(0, 1);\n graph.addEdge(depotSource, trip, depotToTripWeightEdge);\n graph.setEdgeWeight(depotToTripWeightEdge, problem.getCost(depotSource.getLocation(), trip.getLocation()).toMinutes());\n }else{ //ending point\n // from trip endPoint to depot sink\n WeightEdge tripToDepotWeightEdge = new BoundedWeightEdge(0, 1);\n graph.addEdge(trip, depotSink, tripToDepotWeightEdge);\n graph.setEdgeWeight(tripToDepotWeightEdge, problem.getCost(trip.getLocation(), depotSink.getLocation()).toMinutes());\n }\n }\n\n // add arc from depot source to depot sink with lowerBound: 0 end upperBound: depot.numberOfAvailableVehicles\n // this arc is necessary when some vehicles in the depot are nod used\n Integer numberOfAvailableVehicles = ((Depot) depotSource.getLocation()).getNumberOfVehicles();\n WeightEdge sourceToSinkWeightEdge = new BoundedWeightEdge(0, numberOfAvailableVehicles);\n graph.addEdge(depotSource, depotSink, sourceToSinkWeightEdge);\n graph.setEdgeWeight(sourceToSinkWeightEdge, 0);\n\n }",
"void createGraphForDistributedSingleLoad();",
"public weighted_graph copy();",
"private void buildGraph()\n\t{\n\t\taddVerticesToGraph();\n\t\taddLinkesToGraph();\n\t}",
"public GPHolder createDBBasedGP(Node seed){\r\n\r\n\t\t//Setup allNodes and nodesPool\r\n\t\tif (seed == null){\r\n\t\t\t//Randomly pick the very first node if the input nodes list is blank\r\n\t\t\tNode node = pickRandomNode();\r\n\t\t\tallNodes.add(node);\r\n\t\t} else {\r\n\t\t\t//If the input nodes list is not blank, then add the input nodes list \r\n\t\t\t//to nodePool and allNodes\r\n\t\t\tallNodes.add(seed);\r\n\t\t}\r\n\r\n\t\t//Gather the nodesfor the patterns\r\n\t\tphaseOne();\r\n\r\n\t\t//For all pairs of nodes in allNodes, if a relationship exists between them\r\n\t\t//in the database, then ensure that relationship also exists in rels.\r\n\t\tphaseTwo();\r\n\r\n\t\t//Make sure that gp passes the minimum number of relationships requirement. \r\n\t\tint minRels = (int)Math.floor((allNodes.size()-1)*complete);\r\n\r\n\t\tif (rels.size() < minRels){\r\n\t\t\tSystem.out.println(\"failed here: \" + complete + \", \" + minRels + \" \" + rels.size() + \" \" + allNodes.size());\r\n\t\t\treturn null; \r\n\t\t}\r\n\r\n\r\n\t\t//Translate the allNodes and rels lists to GraphPattern\r\n\t\tGraphPattern gp = translateToGP(); \r\n\r\n\t\t//Generate the mutual exclusion constraints\r\n\t\tList<Pair<MyNode, MyNode>> mex = generateMex(gp.getNodes());\r\n\r\n\t\t//Generate the GPHolder\r\n\t\tthis.gpHolder = new GPHolder(gp, mex, new HashMap<String, MyNode>());\r\n\t\t\r\n\t\t//Check if result schema size is greater than the number of nodes\r\n\t\tif (resSize > gp.getNodes().size()){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t\t//Set the result schema\r\n\t\tList<MyNode> resultSchema = new ArrayList<MyNode>();\r\n\t\tresultSchema.addAll(gp.getNodes());\r\n\t\twhile(resultSchema.size() > resSize){\r\n\t\t\tresultSchema.remove(random.nextInt(resultSchema.size()));\r\n\t\t}\r\n\t\tthis.gpHolder.setResultSchema(resultSchema);\r\n\r\n\t\treturn this.gpHolder;\r\n\t}",
"public BPELGeneratorImpl() {\r\n \t\tsuper(GENERATOR_NAME);\r\n \t}",
"@Override\n public void addVertex(V pVertex, TimeFrame tf) {\n if (pVertex.getId() < 0) {\n int id = vertexIdGen.getNextAvailableID();\n //System.out.println(\" :: vertex new id = \" + id);\n pVertex.setId(id);\n mapAllVertices.add(id, pVertex);\n if (darrGlobalAdjList.get(id) == null) {\n darrGlobalAdjList.add(id, new HashMap<>());\n }\n }\n //System.out.println(\" darrGlobalAdjList.get(pVertex.getId()) : \" + darrGlobalAdjList.get(pVertex.getId()));\n if (!darrGlobalAdjList.get(pVertex.getId()).containsKey(tf)) {\n darrGlobalAdjList.get((pVertex.getId())).put(tf, new LinkedList<>());\n }\n hmpGraphsAtTimeframes.get(tf).addVertex(pVertex);\n //System.out.println(\" \\t\\t\\t\\t\\t DynamicGraph.addVertex tf = \" + tf.getTimeFrameName() + \" :: \" +this.getGraphTitle());\n //System.out.println(\" \\t\\t\\t\\t\\t DynamicGraph.addVertex mapAllVertices = \" + mapAllVertices.getIds());\n //System.out.println(\" \\t\\t\\t\\t\\t DynamicGraph.addVertex tf = \" + hmpGraphsAtTimeframes.get(tf));\n //System.out.println(\" \\t\\t\\t\\t\\t DynamicGraph.addVertex hmpGraphsAtTimeframes.get(tf) all vertexIds = \" + hmpGraphsAtTimeframes.get(tf).getAllVertexIds());\n }",
"public void addRequestGenerator(RequestGenerator rg) {\n requestGenerators.add(rg);\n }",
"void addPreviewGenerator(PreviewGenerator generator) {\n synchronized (previewGenerators) {\n previewGenerators.add(generator);\n Collections.sort(previewGenerators, new Comparator<PreviewGenerator>() {\n public int compare(PreviewGenerator a, PreviewGenerator b) {\n return Integer.valueOf(b.getPriority()).compareTo(a.getPriority());\n }\n });\n }\n }",
"public DotGraph createSubGraph(String label) {\n // file name is used as label of sub graph.\n DotGraph subgraph = new DotGraph(label);\n subgraph.isSubGraph = true;\n\n this.drawElements.add(subgraph);\n\n return subgraph;\n }",
"public static Multigraph smartAddEdge(Multigraph graph, Edge edge, boolean stopIfMissing) {\n\n if (!graph.containsVertex(edge.getSource())) {\n if(stopIfMissing){\n throw new IllegalStateException(\"Missing source node for edge \"+ edge);\n }\n graph.addVertex(edge.getSource());\n }\n if (!graph.containsVertex(edge.getDestination())) {\n if(stopIfMissing){\n throw new IllegalStateException(\"Missing destination node for edge \"+ edge);\n }\n graph.addVertex(edge.getDestination());\n }\n //That a good mapping edge, add to the related query\n graph.addEdge(edge.getSource(), edge.getDestination(), edge.getLabel());\n return graph;\n }",
"private PlainGraph mergeGraphsInternal(PlainGraph g1, PlainGraph g2) {\n // Create all nodes of g2 in g1\n // AddNode does check if the node does exist already, if so it doesn't create a new one\n for (Map.Entry<String, PlainNode> entry: graphNodeMap.get(g2).entrySet()){\n addNode(g1, entry.getKey(), null);\n }\n\n // create all edges of g2 in g1\n for (PlainEdge edge: g2.edgeSet()) {\n // check if the edge exists in g1, if so check if the variable names of the source and the target are also the same and not just the node names\n // Since the node names are numbered in each graph starting with 0, collisions could exists without the 2nd and 3rd check\n // Inverse the whole such that if this edge doesn't exist create it in g1\n if (! (g1.containsEdge(edge) && getVarName(g2, edge.source()).equals(getVarName(g1, edge.source())) && getVarName(g2, edge.target()).equals(getVarName(g1, edge.target())))) {\n addEdge(g1, getVarName(g2, edge.source()), edge.label().text(), getVarName(g2, edge.target()));\n }\n }\n return g1;\n }",
"@Override\n public Graph newInstance(int vertexesCount) {\n return new SimpleGraph();\n }",
"@Override\n\tpublic directed_weighted_graph copy() {\n\t\tdirected_weighted_graph copy = new DWGraph_DS();\n\t\tCollection<node_data> vertex = dwg.getV();\n\t\tfor (node_data v : vertex) {\n\t\t\tNodeData ver = new NodeData(v.getKey(), v.getLocation(), v.getWeight());\n\t\t\tcopy.addNode(ver);// Add node\n\t\t\tcopy.getNode(v.getKey()).setInfo(v.getInfo());// Set info to node\n\t\t\tcopy.getNode(v.getKey()).setTag(v.getTag());// Set tag to node\n\t\t}\n\n\t\tfor (node_data n : vertex) {\n\t\t\tCollection<edge_data> edges = dwg.getE(n.getKey());\n\t\t\tif (edges != null) {\n\t\t\t\tfor (edge_data e : edges) {// Add all edges (0 or more) by connecting key,dest and weight\n\t\t\t\t\tcopy.connect(e.getSrc(), e.getDest(), e.getWeight());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn copy;\n\t}",
"abstract public Vertex cloneMe();",
"public PlainGraph cloneGraph(PlainGraph graph) {\n PlainGraph g = graph.clone();\n Map<String, PlainNode> nodeMap = cloneNodeMap(graph);\n\n g.setName(getUniqueGraphName());\n graphNodeMap.put(g, nodeMap);\n return g;\n }",
"protected IWeightedGraph<GraphNode, WeightedEdge> createGraph(List<GoapState> goalState) {\r\n\t\tIWeightedGraph<GraphNode, WeightedEdge> generatedGraph = this.generateGraphObject();\r\n\r\n\t\taddVertices(generatedGraph, goalState);\r\n\t\taddEdges(generatedGraph);\r\n\r\n\t\treturn generatedGraph;\r\n\t}",
"public ObjectGraph createScopedGraph(Object... modules) {\n return graph.plus(modules);\n }",
"@Override\n public void populateDAG(DAG dag, Configuration conf)\n {\n\n RandomNumberGenerator randomGenerator = dag.addOperator(\"randomGenerator\", RandomNumberGenerator.class);\n randomGenerator.setNumTuples(10000);\n SetupOperator setupOperator = dag.addOperator(\"SetupOperator\", SetupOperator.class);\n\n dag.addStream(\"randomData\", randomGenerator.out, setupOperator.inputPort);\n }",
"@DebugLog\n private void buildDaggerGraph(){\n mComponent = DaggerAppComponent.builder()\n .appModule(new AppModule(this))\n .dataModule(new DataModule())\n .uiModule(new UiModule())\n .apiModule(new ApiModule())\n .infoModule(new InfoModule())\n .build();\n mComponent.inject(this);\n }",
"GraphLayout createGraphLayout();",
"PackageBuilder() {\n\t\tweightMap = new HashMap<>();\n\t\tcostMap = new HashMap<>();\n\t\tcombinations = new ArrayList<>();\n\t}",
"public static Graph instantiateAdjacencyMapGraph() {\r\n\t\treturn new AdjacencyMapGraph();\r\n\t}",
"public Object clone() throws CloneNotSupportedException {\n\n\t\tAbstractCategoryItemLabelGenerator clone = (AbstractCategoryItemLabelGenerator) super.clone();\n\n\t\tif (this.numberFormat != null) {\n\t\t\tclone.numberFormat = (NumberFormat) this.numberFormat.clone();\n\t\t}\n\n\t\tif (this.dateFormat != null) {\n\t\t\tclone.dateFormat = (DateFormat) this.dateFormat.clone();\n\t\t}\n\n\t\treturn clone;\n\n\t}",
"public Graph createGraph() {\n String fileName;\n// fileName =\"./428333.edges\";\n String line;\n Graph g = new Graph();\n// List<String> vertexNames = new ArrayList<>();\n// try\n// {\n// BufferedReader in=new BufferedReader(new FileReader(fileName));\n// line=in.readLine();\n// while (line!=null) {\n////\t\t\t\tSystem.out.println(line);\n// String src = line.split(\" \")[0];\n// String dst = line.split(\" \")[1];\n//// vertexNames.add(src);\n//// vertexNames.add(dst);\n//// System.out.println(src+\" \"+dst);\n// g.addEdge(src, dst, 1);\n// line=in.readLine();\n// }\n// in.close();\n// } catch (Exception e) {\n//\t\t\te.printStackTrace();\n// }\n\n fileName=\"./788813.edges\";\n// List<String> vertexNames = new ArrayList<>();\n try\n {\n BufferedReader in=new BufferedReader(new FileReader(fileName));\n line=in.readLine();\n while (line!=null) {\n//\t\t\t\tSystem.out.println(line);\n String src = line.split(\" \")[0];\n String dst = line.split(\" \")[1];\n g.addEdge(src, dst, 1);\n line=in.readLine();\n }\n in.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n// Graph g = new Graph(new String[]{\"v0\", \"v1\", \"v2\", \"v3\", \"v4\", \"v5\", \"v6\", \"v7\", \"v8\"});\n// // Add the required edges.\n// g.addEdge(\"v0\", \"v1\", 4); g.addEdge(\"v0\", \"v7\", 8);\n// g.addEdge(\"v1\", \"v2\", 8); g.addEdge(\"v1\", \"v7\", 11); g.addEdge(\"v2\", \"v1\", 8);\n// g.addEdge(\"v2\", \"v8\", 2); g.addEdge(\"v2\", \"v5\", 4); g.addEdge(\"v2\", \"v3\", 7);\n// g.addEdge(\"v3\", \"v2\", 7); g.addEdge(\"v3\", \"v5\", 14); g.addEdge(\"v3\", \"v4\", 9);\n// g.addEdge(\"v4\", \"v3\", 9); g.addEdge(\"v4\", \"v5\", 10);\n// g.addEdge(\"v5\", \"v4\", 10); g.addEdge(\"v5\", \"v3\", 9); g.addEdge(\"v5\", \"v2\", 4);\n// g.addEdge(\"v5\", \"v6\", 2);\n// g.addEdge(\"v6\", \"v7\", 1); g.addEdge(\"v6\", \"v8\", 6); g.addEdge(\"v6\", \"v5\", 2);\n// g.addEdge(\"v7\", \"v0\", 8); g.addEdge(\"v7\", \"v8\", 7); g.addEdge(\"v7\", \"v1\", 11);\n// g.addEdge(\"v7\", \"v6\", 1);\n// g.addEdge(\"v8\", \"v2\", 2); g.addEdge(\"v8\", \"v7\", 7); g.addEdge(\"v8\", \"v6\", 6);\n\n//\n return g;\n }",
"private void createDummyData() {\n YangInstanceIdentifier yiid;\n // create 2 links (stored in waitingLinks)\n LeafNode<String> link1Source = ImmutableNodes.leafNode(TopologyQNames.LINK_SOURCE_NODE_QNAME,\n UNDERLAY_NODE_ID_1);\n LeafNode<String> link2Source = ImmutableNodes.leafNode(TopologyQNames.LINK_SOURCE_NODE_QNAME,\n UNDERLAY_NODE_ID_3);\n\n ContainerNode source1Container = ImmutableContainerNodeBuilder\n .create(ImmutableNodes.containerNode(Source.QNAME)).withChild(link1Source).build();\n ContainerNode source2Container = ImmutableContainerNodeBuilder\n .create(ImmutableNodes.containerNode(Source.QNAME)).withChild(link2Source).build();\n\n LeafNode<String> link1Dest = ImmutableNodes.leafNode(TopologyQNames.LINK_DEST_NODE_QNAME, UNDERLAY_NODE_ID_2);\n LeafNode<String> link2Dest = ImmutableNodes.leafNode(TopologyQNames.LINK_DEST_NODE_QNAME, UNDERLAY_NODE_ID_4);\n ContainerNode dest1Container = ImmutableContainerNodeBuilder\n .create(ImmutableNodes.containerNode(Destination.QNAME)).withChild(link1Dest).build();\n ContainerNode dest2Container = ImmutableContainerNodeBuilder\n .create(ImmutableNodes.containerNode(Destination.QNAME)).withChild(link2Dest).build();\n\n MapEntryNode link1 = ImmutableNodes.mapEntryBuilder(Link.QNAME, TopologyQNames.NETWORK_LINK_ID_QNAME, LINK_ID_1)\n .withChild(source1Container).withChild(dest1Container).build();\n MapEntryNode link2 = ImmutableNodes.mapEntryBuilder(Link.QNAME, TopologyQNames.NETWORK_LINK_ID_QNAME, LINK_ID_2)\n .withChild(source2Container).withChild(dest2Container).build();\n\n yiid = DUMMY_LINK_CREATOR.createNodeIdYiid(LINK_ID_1);\n UnderlayItem item = new UnderlayItem(link1, null, TOPOLOGY_ID, LINK_ID_1, CorrelationItemEnum.Link);\n ntLinkCalculator.processCreatedChanges(yiid, item, TOPOLOGY_ID);\n\n yiid = DUMMY_LINK_CREATOR.createNodeIdYiid(LINK_ID_2);\n item = new UnderlayItem(link2, null, TOPOLOGY_ID, LINK_ID_2, CorrelationItemEnum.Link);\n ntLinkCalculator.processCreatedChanges(yiid, item, TOPOLOGY_ID);\n\n // create 2 supporting nodes under two overlay nodes\n yiid = YangInstanceIdentifier.builder()\n .nodeWithKey(Node.QNAME, TopologyQNames.NETWORK_NODE_ID_QNAME, OVERLAY_NODE_ID_1).build();\n Map<QName, Object> suppNode1KeyValues = new HashMap<>();\n suppNode1KeyValues.put(TopologyQNames.TOPOLOGY_REF, TOPOLOGY_ID);\n suppNode1KeyValues.put(TopologyQNames.NODE_REF, UNDERLAY_NODE_ID_1);\n MapEntryNode menSuppNode1 = ImmutableNodes.mapEntryBuilder()\n .withNodeIdentifier(new NodeIdentifierWithPredicates(SupportingNode.QNAME, suppNode1KeyValues)).build();\n MapNode suppNode1List = ImmutableNodes.mapNodeBuilder(SupportingNode.QNAME).addChild(menSuppNode1).build();\n MapEntryNode overlayNode1 = ImmutableNodes\n .mapEntryBuilder(Node.QNAME, TopologyQNames.NETWORK_NODE_ID_QNAME, OVERLAY_NODE_ID_1)\n .addChild(suppNode1List).build();\n item = new UnderlayItem(overlayNode1, null, TOPOLOGY_ID, OVERLAY_NODE_ID_1, CorrelationItemEnum.Node);\n // overlayNode1 is created\n ntLinkCalculator.processCreatedChanges(yiid, item, TOPOLOGY_ID);\n\n yiid = YangInstanceIdentifier.builder()\n .nodeWithKey(Node.QNAME, TopologyQNames.NETWORK_NODE_ID_QNAME, OVERLAY_NODE_ID_2).build();\n Map<QName, Object> suppNode2KeyValues = new HashMap<>();\n suppNode2KeyValues.put(TopologyQNames.TOPOLOGY_REF, TOPOLOGY_ID);\n suppNode2KeyValues.put(TopologyQNames.NODE_REF, UNDERLAY_NODE_ID_2);\n MapEntryNode menSuppNode2 = ImmutableNodes.mapEntryBuilder()\n .withNodeIdentifier(new NodeIdentifierWithPredicates(SupportingNode.QNAME, suppNode2KeyValues)).build();\n MapNode suppNode2List = ImmutableNodes.mapNodeBuilder(SupportingNode.QNAME).addChild(menSuppNode2).build();\n MapEntryNode overlayNode2 = ImmutableNodes\n .mapEntryBuilder(Node.QNAME, TopologyQNames.NETWORK_NODE_ID_QNAME, OVERLAY_NODE_ID_2)\n .addChild(suppNode2List).build();\n item = new UnderlayItem(overlayNode2, null, TOPOLOGY_ID, OVERLAY_NODE_ID_2, CorrelationItemEnum.Node);\n // overlayNode2 is created and link:1 is matched\n ntLinkCalculator.processCreatedChanges(yiid, item, TOPOLOGY_ID);\n\n // create a third supporting node under a third overlay node\n yiid = YangInstanceIdentifier.builder()\n .nodeWithKey(Node.QNAME, TopologyQNames.NETWORK_NODE_ID_QNAME, OVERLAY_NODE_ID_3).build();\n Map<QName, Object> suppNode3KeyValues = new HashMap<>();\n suppNode3KeyValues.put(TopologyQNames.TOPOLOGY_REF, TOPOLOGY_ID);\n suppNode3KeyValues.put(TopologyQNames.NODE_REF, UNDERLAY_NODE_ID_3);\n MapEntryNode menSuppNode3 = ImmutableNodes.mapEntryBuilder()\n .withNodeIdentifier(new NodeIdentifierWithPredicates(SupportingNode.QNAME, suppNode3KeyValues)).build();\n MapNode suppNode3List = ImmutableNodes.mapNodeBuilder(SupportingNode.QNAME).addChild(menSuppNode3).build();\n MapEntryNode node3 = ImmutableNodes\n .mapEntryBuilder(Node.QNAME, TopologyQNames.NETWORK_NODE_ID_QNAME, OVERLAY_NODE_ID_3)\n .addChild(suppNode3List).build();\n item = new UnderlayItem(node3, null, TOPOLOGY_ID, OVERLAY_NODE_ID_3, CorrelationItemEnum.Node);\n\n ntLinkCalculator.processCreatedChanges(yiid, item, TOPOLOGY_ID);\n\n // create another matched link (link:3)\n LeafNode<String> link3Source = ImmutableNodes.leafNode(TopologyQNames.LINK_SOURCE_NODE_QNAME,\n UNDERLAY_NODE_ID_2);\n ContainerNode source3Container = ImmutableContainerNodeBuilder\n .create(ImmutableNodes.containerNode(Source.QNAME)).withChild(link3Source).build();\n LeafNode<String> link3Dest = ImmutableNodes.leafNode(TopologyQNames.LINK_DEST_NODE_QNAME, UNDERLAY_NODE_ID_3);\n ContainerNode dest3Container = ImmutableContainerNodeBuilder\n .create(ImmutableNodes.containerNode(Destination.QNAME)).withChild(link3Dest).build();\n MapEntryNode link3 = ImmutableNodes.mapEntryBuilder(Link.QNAME, TopologyQNames.NETWORK_LINK_ID_QNAME, LINK_ID_3)\n .withChild(source3Container).withChild(dest3Container).build();\n yiid = DUMMY_LINK_CREATOR.createNodeIdYiid(LINK_ID_3);\n item = new UnderlayItem(link3, null, TOPOLOGY_ID, LINK_ID_3, CorrelationItemEnum.Link);\n ntLinkCalculator.processCreatedChanges(yiid, item, TOPOLOGY_ID);\n }",
"public SimAbstractGraph(GraphConfig graphConfig, SimpleDirectedGraph innerGraph) {\n super(innerGraph);\n referenceGraph = new JungAdapterGraph<Agent, TestbedEdge>((SimpleDirectedGraph) innerGraph.clone());\n this.graphConfig = graphConfig;\n }",
"private void addGeneratedTimestamp() {\n\t\tif (getConfig().skipGeneratedTimestamps()) {\n\t\t\treturn;\n\t\t}\n\t\tString value = Processor.class.getName();\n\t\tString date = new SimpleDateFormat(\"dd MMM yyyy hh:mm\").format(new Date());\n\t\tthis.pathBindingClass.addImports(Generated.class);\n\t\tthis.pathBindingClass.addAnnotation(\"@Generated(value = \\\"\" + value + \"\\\", date = \\\"\" + date + \"\\\")\");\n\t\tthis.rootBindingClass.addImports(Generated.class);\n\t\tthis.rootBindingClass.addAnnotation(\"@Generated(value = \\\"\" + value + \"\\\", date = \\\"\" + date + \"\\\")\");\n\t}",
"LoadGenerator createLoadGenerator();",
"LoadGenerator createLoadGenerator();",
"public HallwayGenerator(IRoomGenerationStrategy generator) {\n\t\tsetGenerationStrategy(generator);\n\t}",
"protected Patch createNewPatch() { // overridden by subclass\n return null;\n }",
"@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:32:42.023 -0500\", hash_original_method = \"B071A6644C9AA816555B15D21EE52FB4\", hash_generated_method = \"D65569BC7D40591501907DE0DFE452CE\")\n \n public void addPackageName(String packageName){\n \taddTaint(packageName.getTaint());\n }",
"@Override\r\n\tpublic Dog Clone() throws CloneNotSupportedException {\r\n\t\treturn new Poodle(this.getName(), this.getWeight(), this.getColor(), this.getGender(), this.getInfo()); \r\n\t}",
"public JavaDomainMetamodelGenerator(\n Path generationPath,\n String tablePrefix,\n PackageName rootPackageName,\n ContextName contextName,\n AggregateRootGenerator aggregateRootGenerator,\n AggregateRootIdGenerator aggregateRootIdGenerator,\n AggregateEntityGenerator aggregateEntityGenerator,\n AggregateEntityIdGenerator aggregateEntityIdGenerator,\n ValueObjectGenerator valueObjectGenerator,\n DomainEventGenerator domainEventGenerator,\n RepositoryGenerator repositoryGenerator,\n DomainServiceGenerator domainServiceGenerator,\n SupportiveEntityGenerator supportiveEntityGenerator,\n SupportiveEntityIdGenerator supportiveEntityIdGenerator,\n SupportiveEntityRepositoryGenerator supportiveEntityRepositoryGenerator,\n ConstantsExporter constantsExporter,\n ProjectionGenerator projectionGenerator,\n ProjectionIdGenerator projectionIdGenerator,\n ProjectionRepositoryGenerator projectionRepositoryGenerator,\n DomainMessageDataGenerator domainMessageDataGenerator,\n DomainMessageDataRepositoryGenerator domainMessageDataRepositoryGenerator,\n DomainMessagePublishedDataGenerator domainMessagePublishedDataGenerator,\n DomainMessagePublishedDataRepositoryGenerator domainMessagePublishedDataRepositoryGenerator) {\n super(generationPath);\n this.tablePrefix = tablePrefix;\n this.rootPackageName = rootPackageName;\n this.contextName = contextName;\n this.aggregateRootGenerator = aggregateRootGenerator;\n this.aggregateRootIdGenerator = aggregateRootIdGenerator;\n this.aggregateEntityGenerator = aggregateEntityGenerator;\n this.aggregateEntityIdGenerator = aggregateEntityIdGenerator;\n this.valueObjectGenerator = valueObjectGenerator;\n this.domainEventGenerator = domainEventGenerator;\n this.repositoryGenerator = repositoryGenerator;\n this.domainServiceGenerator = domainServiceGenerator;\n this.supportiveEntityGenerator = supportiveEntityGenerator;\n this.supportiveEntityIdGenerator = supportiveEntityIdGenerator;\n this.supportiveEntityRepositoryGenerator = supportiveEntityRepositoryGenerator;\n this.constantsExporter = constantsExporter;\n this.projectionGenerator = projectionGenerator;\n this.projectionIdGenerator = projectionIdGenerator;\n this.projectionRepositoryGenerator = projectionRepositoryGenerator;\n this.domainMessageDataGenerator = domainMessageDataGenerator;\n this.domainMessageDataRepositoryGenerator = domainMessageDataRepositoryGenerator;\n this.domainMessagePublishedDataGenerator = domainMessagePublishedDataGenerator;\n this.domainMessagePublishedDataRepositoryGenerator =\n domainMessagePublishedDataRepositoryGenerator;\n }",
"public Builder<T> copyIn(FlowGraph<T> graph) {\n basicBuilder.copyIn(graph);\n return this;\n }",
"private void createCallgraph() {\n final DirectedGraph<ICallgraphNode, ICallgraphEdge> graph =\n m_module.getContent().getNativeCallgraph();\n\n final List<FunctionBlock> blocks = new ArrayList<FunctionBlock>();\n final List<FunctionEdge> edges = new ArrayList<FunctionEdge>();\n\n final HashMap<ICallgraphNode, FunctionBlock> blockMap =\n new HashMap<ICallgraphNode, FunctionBlock>();\n\n final HashMap<INaviFunction, Function> functionMap = new HashMap<INaviFunction, Function>();\n\n for (final Function function : m_functions) {\n functionMap.put(function.getNative(), function);\n }\n\n for (final ICallgraphNode block : graph.getNodes()) {\n final FunctionBlock newBlock = new FunctionBlock(functionMap.get(block.getFunction()));\n\n blockMap.put(block, newBlock);\n\n blocks.add(newBlock);\n }\n\n for (final ICallgraphEdge edge : graph.getEdges()) {\n final FunctionBlock source = blockMap.get(edge.getSource());\n final FunctionBlock target = blockMap.get(edge.getTarget());\n\n edges.add(new FunctionEdge(source, target));\n }\n\n m_callgraph = new Callgraph(blocks, edges);\n }",
"private static WeightedUndirectedGraph addNodesGraph(WeightedUndirectedGraph g, int k, String graph, NodesMapper<String> mapper) throws IOException {\n ReadFile rf = new ReadFile();\n String[] lines = rf.readLines(graph);\n\n // map the words into id for g stilo\n //NodesMapper<String> mapper = new NodesMapper<String>();\n // creathe the graph\n // keep in mind that the id of a word is mapper.getId(s1) - 1 (important the -1)\n int n = lines.length;\n for (int i = 0; i < n; i++) {\n // split the line in 3 parts: node1, node2, and weight\n String[] line = lines[i].split(\" \");\n if (Integer.parseInt(line[3]) == k) {\n String node1 = line[0];\n String node2 = line[1];\n Double w = Double.parseDouble(line[2]);\n // the graph is directed, add links in both ways\n g.add(mapper.getId(node1) - 1, mapper.getId(node2) - 1, w);\n //g.add(mapper.getId(node2) - 1, mapper.getId(node1) - 1, w);\n }\n\n }\n return g;\n }",
"private void addGlobalNodes() {\n for (Procedure proc : globalProcSet) {\n CFGraph cfg = cfgMap.get(proc);\n// System.out.println(\"ExitNode Size: \" + cfg.getExitNodes().size() + \", proc: \" + proc.getSymbolName());\n DFANode node = cfg.getEntry();\n // entry cfgNode\n DFANode entryNode = new DFANode();\n entryNode.putData(\"cfg_node\", node);\n entryNode.putData(\"psg_type\", \"entry\");\n accessIdxMap.put(\"entry_\" + proc.getSymbolName(), entryNode);\n node.putData(\"psg_entry_global\", entryNode);\n // exit cfgNode\n List<DFANode> exitNodeList = cfg.getExitNodes();\n int idx = 0;\n for (DFANode dfaNode : exitNodeList) {\n DFANode exitNode = new DFANode();\n exitNode.putData(\"cfg_node\", dfaNode);\n exitNode.putData(\"psg_type\", \"exit\");\n accessIdxMap.put(\"exit_\" + proc.getSymbolName() + idx++, exitNode);\n dfaNode.putData(\"psg_exit_global\", exitNode);\n }\n }\n\n // add call and return cfgNode (must check all the procs)\n for (Procedure proc : procList) {\n CFGraph cfg = cfgMap.get(proc);\n Iterator cfgIter = cfg.iterator();\n while (cfgIter.hasNext()) {\n DFANode node = (DFANode) cfgIter.next();\n Traversable currentIR = (Traversable) CFGraph.getIR(node);\n if (currentIR == null) {\n continue;\n }\n List<FunctionCall> fcList = IRTools.getFunctionCalls(currentIR);\n if (fcList == null || fcList.size() == 0) {\n continue;\n }\n Set<DFANode> callList = new HashSet<DFANode>();\n Set<DFANode> returnList = new HashSet<DFANode>();\n for (FunctionCall fc : fcList) {\n Procedure callee = fc.getProcedure();\n if (callee == null) {\n continue;\n }\n if (globalProcSet.contains(callee) == false) {\n continue;\n }\n DFANode callNode = new DFANode();\n callNode.putData(\"cfg_node\", node);\n callNode.putData(\"psg_type\", \"call\");\n callNode.putData(\"proc\", callee);\n callList.add(callNode);\n DFANode entryNode = accessIdxMap.get(\"entry_\" + callee.getSymbolName());\n if (entryNode == null) {\n throw new RuntimeException(\"No Entry Node found: \" + \"entry_\" + callee.getSymbolName());\n }\n callNode.addSucc(entryNode);\n entryNode.addPred(callNode);\n // return\n DFANode returnNode = new DFANode();\n returnNode.putData(\"cfg_node\", node);\n returnNode.putData(\"psg_type\", \"return\");\n returnNode.putData(\"proc\", callee);\n returnList.add(returnNode);\n CFGraph cfgCallee = cfgMap.get(callee);\n List<DFANode> calleeExitList = cfgCallee.getExitNodes();\n for (int idx = 0; idx < calleeExitList.size(); idx++) {\n DFANode exitNode = accessIdxMap.get(\"exit_\" + callee.getSymbolName() + idx);\n if (exitNode == null) {\n throw new RuntimeException(\"No Exit Node found: \" + \"exit_\" + callee.getSymbolName());\n }\n returnNode.addPred(exitNode);\n exitNode.addSucc(returnNode);\n }\n }\n if (callList.size() > 0) {\n node.putData(\"psg_call_global\", callList);\n }\n if (returnList.size() > 0) {\n node.putData(\"psg_return_global\", returnList);\n }\n }\n }\n }",
"public static ImmutableSequentialGraph line( final ImmutableGraph g, final String mapBasename, final File tempDir, final int batchSize, final ProgressLogger pl ) throws IOException {\n\t\tfinal int n = g.numNodes();\n\t\tfinal int[] source = new int[ batchSize ] , target = new int[ batchSize ];\n\t\tint currBatch = 0, pairs = 0;\n\t\tfinal ObjectArrayList<File> batches = new ObjectArrayList<File>();\n\t\tfinal long[] edge = new long[ (int)g.numArcs() ];\n\t\tint edgesSoFar = 0;\n\t\tNodeIterator nodeIterator = g.nodeIterator();\n\t\tif ( pl != null ) {\n\t\t\tpl.itemsName = \"nodes\";\n\t\t\tpl.expectedUpdates = n;\n\t\t\tpl.start( \"Producing batches for line graph\" );\n\t\t}\n\t\tlong expNumberOfArcs = 0;\n\t\twhile ( nodeIterator.hasNext() ) {\n\t\t\tint x = nodeIterator.nextInt();\n\t\t\tint d = nodeIterator.outdegree();\n\t\t\texpNumberOfArcs += d * d;\n\t\t\tint[] succ = nodeIterator.successorArray();\n\t\t\t// New edges\n\t\t\tfor ( int i = 0; i < d; i++ ) {\n\t\t\t\tif ( succ[ i ] == x ) throw new IllegalArgumentException( \"The graph contains a loop on node \" + x );\n\t\t\t\tedge[ edgesSoFar++ ] = ( (long)x << 32 ) | succ[ i ];\n\t\t\t}\n\t\t}\n\t\tLOGGER.info( \"Expected number of arcs: \" + expNumberOfArcs );\n\t\tArrays.sort( edge );\n\t\tnodeIterator = g.nodeIterator();\n\n\t\twhile ( nodeIterator.hasNext() ) {\n\t\t\tint x = nodeIterator.nextInt();\n\t\t\tint d = nodeIterator.outdegree();\n\t\t\tint[] succ = nodeIterator.successorArray().clone();\n\t\t\tfor ( int i = 0; i < d; i++ ) {\n\t\t\t\tint from0 = x; //Math.min( x, succ[ i ] );\n\t\t\t\tint to0 = succ[ i ]; //Math.max( x, succ[ i ] );\n\t\t\t\tint edge0 = LongArrays.binarySearch( edge, 0, edgesSoFar, ( (long)from0 << 32 ) | to0 );\n\t\t\t\tif ( ASSERTS ) assert edge0 >= 0;\n\t\t\t\tint dNext = g.outdegree( to0 );\n\t\t\t\tint[] succNext = g.successorArray( to0 );\n\t\t\t\tfor ( int j = 0; j < dNext; j++ ) {\n\t\t\t\t\tint from1 = to0; //Math.min( x, succ[ j ] );\n\t\t\t\t\tint to1 = succNext[ j ]; //Math.max( x, succ[ j ] );\n\t\t\t\t\tint edge1 = LongArrays.binarySearch( edge, 0, edgesSoFar, ( (long)from1 << 32 ) | to1 );\n\t\t\t\t\tif ( ASSERTS ) assert edge1 >= 0;\n\t\t\t\t\tif ( currBatch == batchSize ) {\n\t\t\t\t\t\tpairs += processBatch( batchSize, source, target, tempDir, batches );\n\t\t\t\t\t\tcurrBatch = 0;\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tsource[ currBatch ] = edge0;\n\t\t\t\t\ttarget[ currBatch++ ] = edge1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( pl != null ) pl.lightUpdate();\n\t\t}\n\t\tif ( currBatch > 0 ) {\n\t\t\tpairs += processBatch( currBatch, source, target, tempDir, batches );\n\t\t\tcurrBatch = 0;\t\t\t\t\t\t\n\t\t}\n\t\tif ( edgesSoFar != edge.length ) throw new IllegalArgumentException( \"Something went wrong (probably the graph was not symmetric)\" );\n\t\tDataOutputStream dosSource = new DataOutputStream( new BufferedOutputStream( new FileOutputStream( mapBasename + \".source\" ) ) );\n\t\tDataOutputStream dosTarget = new DataOutputStream( new BufferedOutputStream( new FileOutputStream( mapBasename + \".target\" ) ) );\n\t\tfor ( long e: edge ) {\n\t\t\tdosSource.writeInt( (int)( e >> 32 ) );\n\t\t\tdosTarget.writeInt( (int)( e & 0xFFFFFFFF ) );\n\t\t}\n\t\tdosSource.close();\n\t\tdosTarget.close();\n\t\tif ( DEBUG )\n\t\t\tfor ( int i = 0; i < edgesSoFar; i++ ) {\n\t\t\t\tSystem.out.println( i + \" <- (\" + ( edge[ i ] >> 32 ) + \",\" + ( edge[ i ] & 0xFFFFFFFF ) +\")\" );\n\t\t\t}\n\t\tif ( pl != null ) {\n\t\t\tpl.done();\n\t\t\tlogBatches( batches, pairs, pl );\n\t\t}\n\t\treturn new BatchGraph( edgesSoFar, -1, batches );\n\t}",
"private void generateDummyEA(HashMap<Integer, OWLIndividual> compHash, ClassDiagram dg) {\n\t\tint num = 2;\r\n\t\t// dummy role with PubSub style\r\n\t\tOWLClass publisherClass = factory.getOWLClass(IRI.create(IRI_NAME + \"#Publisher\"));\r\n\t\tOWLClass subscriberClass = factory.getOWLClass(IRI.create(IRI_NAME + \"#Subscriber\"));\r\n\t\t\r\n\t\tfor (nz.aucklanduni.archchecker.object.Package pkg : dg.getPackageList()) {\r\n\t\t\tOWLIndividual publishCompIndv = compHash.get(pkg.getId());\r\n\t\t\tSystem.out.println(\"inserting dummy connectors..\"+num);\r\n\t\t\t\r\n\t\t\tList<Dependency> callers = dg.getDependencyByTarget(pkg.getId());\r\n\t\t\tif(callers.size()!=0) {\r\n\t\t\t\tOWLIndividual subscribeCompIndv = compHash.get(callers.get(0).getSource().getRefId());\r\n\t\t\t\t// create connector for the caller\r\n\t\t\t\tString connName = \"conn\"+ pkg.getId()+\"_dummy_\" + RandomString.randomString(2);\r\n\t\t\t\tOWLIndividual connectorIndv = factory\r\n\t\t\t\t\t\t.getOWLNamedIndividual(IRI.create(IRI_NAME + \"#\"+connName));\r\n\t\r\n\t\t\t\t// create provider role\r\n\t\t\t\tOWLIndividual publisherRole = factory\r\n\t\t\t\t\t\t.getOWLNamedIndividual(IRI.create(IRI_NAME + \"#publisher\"+connName));\r\n\t\t\t\tOWLClassAssertionAxiom provClassAssertion = factory.getOWLClassAssertionAxiom(publisherClass, publisherRole);\r\n\t\t\t\tmanager.addAxiom(ontology, provClassAssertion);\r\n\t\r\n\t\t\t\t// create consumer role\r\n\t\t\t\tOWLIndividual subscriberRole = factory\r\n\t\t\t\t\t\t.getOWLNamedIndividual(IRI.create(IRI_NAME + \"#subscriber\"+connName));\r\n\t\t\t\tOWLClassAssertionAxiom consuClassAssertion = factory.getOWLClassAssertionAxiom(subscriberClass, subscriberRole);\r\n\t\t\t\tmanager.addAxiom(ontology, consuClassAssertion);\r\n\t\t\t\t\r\n\t\t\t\t// bind connector and roles\r\n\t\t\t\tOWLObjectPropertyExpression hasRoleExpr = factory.getOWLObjectProperty(IRI.create(IRI_NAME + \"#hasRole\"));\r\n\t\t\t\tOWLObjectPropertyAssertionAxiom providerHasRoleAxiom = factory\r\n\t\t\t\t\t\t.getOWLObjectPropertyAssertionAxiom(hasRoleExpr, connectorIndv, publisherRole);\r\n\t\t\t\tmanager.addAxiom(ontology, providerHasRoleAxiom);\r\n\t\t\t\tOWLObjectPropertyAssertionAxiom consumerHasRoleAxiom = factory\r\n\t\t\t\t\t\t.getOWLObjectPropertyAssertionAxiom(hasRoleExpr, connectorIndv, subscriberRole);\r\n\t\t\t\tmanager.addAxiom(ontology, consumerHasRoleAxiom);\r\n\t\t\t\t\r\n\t\t\t\t//OWLIndividual publishPort = portDict.get(pkg.getId());\r\n\t\t\t\t//OWLIndividual subscribPort = portDict.get(callers.get(0).getSource().getRefId());\r\n\t\t\t\t// create new port\r\n\t\t\t\tOWLIndividual publishPort = factory\r\n\t\t\t\t\t\t.getOWLNamedIndividual(IRI.create(IRI_NAME + \"#publish\"+pkg.getId()+\"_\" + RandomString.randomString(4)));\r\n\t\t\t\tOWLObjectPropertyExpression hasPortExpr = factory.getOWLObjectProperty(IRI.create(IRI_NAME + \"#hasPort\"));\r\n\t\t\t\tOWLObjectPropertyAssertionAxiom providerHasPortAxiom = factory\r\n\t\t\t\t\t\t.getOWLObjectPropertyAssertionAxiom(hasPortExpr, publishCompIndv, publishPort);\r\n\t\t\t\tmanager.addAxiom(ontology, providerHasPortAxiom);\r\n\t\r\n\t\t\t\t// attach publisher role to publish port\r\n\t\t\t\tOWLObjectPropertyExpression hasAttachmentExpr = factory\r\n\t\t\t\t\t\t.getOWLObjectProperty(IRI.create(IRI_NAME + \"#hasAttachment\"));\r\n\t\t\t\tOWLObjectPropertyAssertionAxiom publisherhasAttachAxiom = factory\r\n\t\t\t\t\t\t.getOWLObjectPropertyAssertionAxiom(hasAttachmentExpr, publishPort, publisherRole);\r\n\t\t\t\tmanager.addAxiom(ontology, publisherhasAttachAxiom);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tOWLIndividual subscribePort = factory\r\n\t\t\t\t\t\t.getOWLNamedIndividual(IRI.create(IRI_NAME + \"#publish\"+pkg.getId()+\"_\" + RandomString.randomString(4)));\r\n\t\t\t\tOWLObjectPropertyAssertionAxiom subscriberHasPortAxiom = factory\r\n\t\t\t\t\t\t.getOWLObjectPropertyAssertionAxiom(hasPortExpr, subscribeCompIndv, subscribePort);\r\n\t\t\t\tmanager.addAxiom(ontology, subscriberHasPortAxiom);\r\n\t\t\t\t\r\n\t\t\t\t// attach subscriber role to subscribe port\r\n\t\t\t\tOWLObjectPropertyAssertionAxiom subscriberhasAttachAxiom = factory\r\n\t\t\t\t\t\t.getOWLObjectPropertyAssertionAxiom(hasAttachmentExpr, subscribePort, subscriberRole);\r\n\t\t\t\tmanager.addAxiom(ontology, subscriberhasAttachAxiom);\r\n\t\t\t\tnum--;\r\n\t\t\t} else {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t\r\n\t\t\tif(num ==0)\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t}\r\n\t}",
"public static void generateAndSaveExampleGraph() {\n EuclidDirectedGraph graph1 = new EuclidDirectedGraph();\n //vertexes added and created edge\n BoundsGraphVertex ver1 = new BoundsGraphVertex(10, 10, \"source\");\n BoundsGraphVertex ver2 = new BoundsGraphVertex(10, 30, \"secondNode\");\n BoundsGraphVertex ver3 = new BoundsGraphVertex(10, 40, \"thirdNode\");\n BoundsGraphVertex ver4 = new BoundsGraphVertex(10, 50, \"sink\");\n BoundsGraphVertex ver5 = new BoundsGraphVertex(10, 60, \"fiveNode - loop from second\");\n BoundsGraphVertex ver6 = new BoundsGraphVertex(10, 70, \"sixNode - loop from five\");\n BoundsGraphVertex ver7 = new BoundsGraphVertex(10, 80, \"sevenNode - loop from six to third\");\n\n graph1.addNode(ver1);\n graph1.addNode(ver2);\n graph1.addNode(ver3);\n graph1.addNode(ver4);\n graph1.addNode(ver5);\n graph1.addNode(ver6);\n graph1.addNode(ver7);\n //use .addEuclidEdge to compute edge's length automatically\n graph1.addEuclidEdge(ver1, ver2);\n graph1.addEuclidEdge(ver2, ver3);\n graph1.addEuclidEdge(ver3, ver4);\n graph1.addEuclidEdge(ver2, ver5);\n graph1.addEuclidEdge(ver5, ver6);\n graph1.addEuclidEdge(ver6, ver7);\n graph1.addEuclidEdge(ver7, ver3);\n //created graph #2\n EuclidDirectedGraph graph2 = new EuclidDirectedGraph();\n try {\n //save into file from graph #1\n XMLSerializer.write(graph1, \"input.xml\", false);\n //read from file into graph #2\n graph2 = (EuclidDirectedGraph) XMLSerializer.read(\"input.xml\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"abstract public Vertex cloneFamily();",
"private void generateGraphSignature() {\n \t this.generateVertexSignatures();\n \t Collections.sort(this.vertexSignatures);\n \t this.graphSignature = this.vertexSignatures.get(0);\n \t}",
"@Override\n public void addEdge(E pEdge, TimeFrame tf) {\n \n // If The Edge ID is not initialized yet, initalialize it\n if (pEdge.getId() < 0) {\n int id = edgeIdGen.getNextAvailableID();\n pEdge.setId(id);\n mapAllEdges.add(id, pEdge);\n //System.out.println(\"\\t\\t\\t\\t\\t\\t====***************** DynamicGraph.addEdge() edge (id, mapAllEdges.size) = \" + id + \", \" + mapAllEdges.size());\n }\n // Adding to the adjacent list\n if (!darrGlobalAdjList.get(pEdge.getSource().getId()).get(tf).contains(pEdge)) {\n darrGlobalAdjList.get(pEdge.getSource().getId()).get(tf).add(pEdge);\n //System.out.println(\"\\t\\t\\t\\t\\t\\t====***************** DynamicGraph.addEdge() ading to darrGlobalAdjList \");\n if(!pEdge.isDirected() &&\n !darrGlobalAdjList.get(pEdge.getDestination().getId()).get(tf).contains(pEdge)) {\n darrGlobalAdjList.get(pEdge.getDestination().getId()).get(tf).add(pEdge);\n }\n }\n \n hmpGraphsAtTimeframes.get(tf).addEdge(pEdge);\n \n }",
"public void createG1(String eq){\n graph1 = false;\n Equation e1 = new Equation(eq);\n q1 = new XYPoints(e1, range);\n createCP(range);\n executeGraphs();\n updateGraph(q1);\n graph1 = true;\n }",
"public Graph(){//constructor\n //edgemap\n srcs=new LinkedList<>();\n maps=new LinkedList<>();\n chkIntegrity(\"edgemap\");\n \n nodes=new LinkedList<>();\n //m=new EdgeMap();\n }",
"public directed_weighted_graph deepCopy() {\n DWGraph_DS copyGraph = new DWGraph_DS(this); //create a new graph with the original graph data (only primitives)\n HashMap<Integer, node_data> copyNodesMap = new HashMap<>(); //create a new nodes HashMap for the new graph\n for (node_data node : nodes.values()) { //loop through all nodes in the original graph\n copyNodesMap.put(node.getKey(), new NodeData((NodeData) node)); //makes a duplicate of the original HashMap\n }\n copyGraph.nodes = copyNodesMap; //set the new graph nodes to the new HashMap we made.\n return copyGraph;\n }",
"public static Graph<Vertex,Edge> createGraphObject()\n\t{\n\t\tGraph<Vertex,Edge> g = new DirectedSparseMultigraph<Vertex, Edge>();\n\t\treturn g;\n\t}",
"private static void setGraph()\n\t\t{\n\t\t\tmap = new HashMap();\n\t\t\t\n\t\t\twordNum = 0;\n\t\t\twordList = new String[txtStr.length()];\n\t\t\tfor(int i = 0; i<strList.length; i++)\n\t\t\t{\n\t\t\t\tif(!map.containsKey(strList[i]))\n\t\t\t\t{\n\t\t\t\t\tmap.put(strList[i], wordNum);\n\t\t\t\t\twordList[wordNum] = strList[i];\n\t\t\t\t\twordNum++;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tg = new MyGraph(wordNum);\n\t\t\tfor(int i=0; i<strList.length - 1; i++)\n\t\t\t{\n\t\t\t\tint v0 = (int)(map.get(strList[i]));\n\t\t\t\tint v1 = (int)(map.get(strList[i+1]));\n\t\t\t\tint cost = g.getEdge(v0, v1);\n\t\t\t\t\n\t\t\t\tg.setEdge(v0, v1, cost+1);\n\t\t\t}\n\t\t//\treturn g;\n\t\t\t\t\t\n\t\t}",
"protected Patch generatePatch(Point2D[] points, float[][] color) {\n/* 52 */ return new TensorPatch(points, color);\n/* */ }",
"public void generateGraph() {\n\t\tMap<Integer, MovingFObject> map = sc.getInitPos();\r\n\t\tgraph = new boolean[map.size()][map.size()];\r\n\t\tfor(int i = 0; i < map.size(); i++) {\r\n\t\t\tMovingFObject cloned = map.get(i).duplicate();\r\n\t\t\tArrayList<Location> locs = sc.traceLinearMotion(i,sc.getMaxVelocity(),cloned.getGoal());\r\n\t\t\tfor(int j = 0; j < map.size(); j++) {\r\n\t\t\t\tif(j != i) {\r\n\t\t\t\t\tfor(int k = 0; k < locs.size(); k++) {\r\n\t\t\t\t\t\tcloned.setLocation(locs.get(k));\r\n\t\t\t\t\t\tif(cloned.locationTouchingLocation(1, map.get(j), 2)) {\r\n\t\t\t\t\t\t\tgraph[i][j] = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(cloned.locationTouchingLocation(1, map.get(j), 0)) {\r\n\t\t\t\t\t\t\tgraph[j][i] = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public ProcessingTarget buildGraph(){\n \t\tgetTibbrGraph();\n \n \t\t//Init a project - and therefore a workspace\n \t\tProjectController pc = Lookup.getDefault().lookup(ProjectController.class);\n \t\tpc.newProject();\n \t\tWorkspace workspace = pc.getCurrentWorkspace();\n \n \t\t//Get a graph model - it exists because we have a workspace\n \t\tGraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();\n \t\tAttributeModel attributeModel = Lookup.getDefault().lookup(AttributeController.class).getModel();\n \t\tImportController importController = Lookup.getDefault().lookup(ImportController.class);\n \n \t\t//Import file \n \t\tContainer container;\n \t\ttry {\n \t\t\tFile f = new File(this.filename);\n \t\t\tcontainer = importController.importFile(f);\n \t\t\tcontainer.getLoader().setEdgeDefault(EdgeDefault.DIRECTED); //Force DIRECTED\n \t\t container.setAllowAutoNode(false); //Don't create missing nodes\n \t\t} catch (Exception ex) {\n \t\t\tex.printStackTrace();\n \t\t\treturn null;\n \t\t}\n \n \t\t//Append imported data to GraphAPI\n \t\timportController.process(container, new DefaultProcessor(), workspace);\n \n \t\t//See if graph is well imported\n \t\t//DirectedGraph graph = graphModel.getDirectedGraph();\n \t\t//---------------------------\n \n \t\t//Layout for 1 minute\n \t\tAutoLayout autoLayout = new AutoLayout(5, TimeUnit.SECONDS);\n \t\tautoLayout.setGraphModel(graphModel);\n \t\t//YifanHuLayout firstLayout = new YifanHuLayout(null, new StepDisplacement(1f));\n \t\tForceAtlasLayout secondLayout = new ForceAtlasLayout(null);\n \t\tAutoLayout.DynamicProperty adjustBySizeProperty = AutoLayout.createDynamicProperty(\"forceAtlas.adjustSizes.name\", Boolean.TRUE, 0.1f);//True after 10% of layout time\n \t\tAutoLayout.DynamicProperty repulsionProperty = AutoLayout.createDynamicProperty(\"forceAtlas.repulsionStrength.name\", new Double(10000.), 0f);//500 for the complete period\n \t\t//autoLayout.addLayout( firstLayout, 0.5f );\n \t\tautoLayout.addLayout(secondLayout, 1f, new AutoLayout.DynamicProperty[]{adjustBySizeProperty, repulsionProperty});\n \t\tautoLayout.execute();\n \n \n \n \n \n \t\t//Rank color by Degree\n \t\tRankingController rankingController = Lookup.getDefault().lookup(RankingController.class);\n\t\tRanking<?> degreeRanking = rankingController.getModel().getRanking(Ranking.NODE_ELEMENT, Ranking.DEGREE_RANKING);\n\t\tAbstractColorTransformer<?> colorTransformer = (AbstractColorTransformer<?>) rankingController.getModel().getTransformer(Ranking.NODE_ELEMENT, Transformer.RENDERABLE_COLOR);\n \n \t\tcolorTransformer.setColors(new Color[]{new Color(0xFEF0D9), new Color(0xB30000)});\n \t\trankingController.transform(degreeRanking,colorTransformer);\n \n \t\t//Get Centrality\n \t\tGraphDistance distance = new GraphDistance();\n \t\tdistance.setDirected(true);\n \t\tdistance.execute(graphModel, attributeModel);\n \n \t\t//Rank size by centrality\n \t\tAttributeColumn centralityColumn = attributeModel.getNodeTable().getColumn(GraphDistance.BETWEENNESS);\n\t\tRanking<?> centralityRanking = rankingController.getModel().getRanking(Ranking.NODE_ELEMENT, centralityColumn.getId());\n\t\tAbstractSizeTransformer<?> sizeTransformer = (AbstractSizeTransformer<?>) rankingController.getModel().getTransformer(Ranking.NODE_ELEMENT, Transformer.RENDERABLE_SIZE);\n \t\tsizeTransformer.setMinSize(3);\n \t\tsizeTransformer.setMaxSize(20);\n \t\trankingController.transform(centralityRanking,sizeTransformer);\n \n \t\t//Rank label size - set a multiplier size\n\t\tRanking<?> centralityRanking2 = rankingController.getModel().getRanking(Ranking.NODE_ELEMENT, centralityColumn.getId());\n\t\tAbstractSizeTransformer<?> labelSizeTransformer = (AbstractSizeTransformer<?>) rankingController.getModel().getTransformer(Ranking.NODE_ELEMENT, Transformer.LABEL_SIZE);\n \t\tlabelSizeTransformer.setMinSize(1);\n \t\tlabelSizeTransformer.setMaxSize(3);\n \t\trankingController.transform(centralityRanking2,labelSizeTransformer);\n \n \t\tfloat[] positions = {0f,0.33f,0.66f,1f};\n \t\tcolorTransformer.setColorPositions(positions);\n \t\tColor[] colors = new Color[]{new Color(0x0000FF), new Color(0xFFFFFF),new Color(0x00FF00),new Color(0xFF0000)};\n \t\tcolorTransformer.setColors(colors);\n \n \t\t\n \t\t//---------------------------------\n \t\t//Preview configuration\n \t\tPreviewController previewController = Lookup.getDefault().lookup(PreviewController.class);\n \t\tPreviewModel previewModel = previewController.getModel();\n \t\tpreviewModel.getProperties().putValue(PreviewProperty.DIRECTED, Boolean.TRUE);\n \t\tpreviewModel.getProperties().putValue(PreviewProperty.BACKGROUND_COLOR, Color.BLACK);\n \t\tpreviewModel.getProperties().putValue(PreviewProperty.SHOW_NODE_LABELS, Boolean.TRUE);\n \t\tpreviewModel.getProperties().putValue(PreviewProperty.NODE_LABEL_COLOR, new DependantOriginalColor(Color.YELLOW));\n \t\t\n \t\t\n \t\t//previewModel.getProperties().putValue(PreviewProperty.EDGE_CURVED, Boolean.TRUE);\n \t\t//previewModel.getProperties().putValue(PreviewProperty.EDGE_OPACITY, 100);\n \t\t//previewModel.getProperties().putValue(PreviewProperty.EDGE_RADIUS, 1f);\n \t\t//previewModel.getProperties().putValue(PreviewProperty.EDGE_THICKNESS,0.2f);\n \t\t//previewModel.getProperties().putValue(PreviewProperty.ARROW_SIZE,0.2f);\n \n \t\tpreviewController.refreshPreview();\n \n \t\t//----------------------------\n \n \t\t//New Processing target, get the PApplet\n \t\tProcessingTarget target = (ProcessingTarget) previewController.getRenderTarget(RenderTarget.PROCESSING_TARGET);\n \t\t\n \t\tPApplet applet = target.getApplet();\n \t\tapplet.init();\n \n \t\t// Add .1 second delay to fix stability issue - per Gephi forums\n try {\n \t\t\t\tThread.sleep(100);\n \t\t\t} catch (InterruptedException e) {\n \t\t\t\t// TODO Auto-generated catch block\n \t\t\t\te.printStackTrace();\n \t\t\t}\n \n \t\t\n \t\t//Refresh the preview and reset the zoom\n \t\tpreviewController.render(target);\n \t\ttarget.refresh();\n \t\ttarget.resetZoom();\n \t\ttarget.zoomMinus();\n \t\ttarget.zoomMinus();\n \t\t\n \t\treturn target;\n \t\t\n \n \t}",
"Graph<Integer, DefaultEdge> buildMap();"
] | [
"0.5279847",
"0.5157971",
"0.5120709",
"0.50413895",
"0.49994463",
"0.49582082",
"0.4867479",
"0.48654854",
"0.4861771",
"0.4847616",
"0.47941154",
"0.4789531",
"0.47849238",
"0.47817296",
"0.47750747",
"0.4773091",
"0.47713274",
"0.47350967",
"0.4732534",
"0.4715162",
"0.47044003",
"0.46861777",
"0.46850798",
"0.468355",
"0.4677012",
"0.46556434",
"0.46476805",
"0.46379077",
"0.46139356",
"0.46003556",
"0.45869276",
"0.45851898",
"0.45683646",
"0.45606533",
"0.4558041",
"0.45552465",
"0.45546192",
"0.4547826",
"0.45254555",
"0.45111415",
"0.44984093",
"0.44902727",
"0.44791",
"0.4448908",
"0.4447782",
"0.44414857",
"0.44400838",
"0.44371936",
"0.4428746",
"0.4427719",
"0.442711",
"0.44192225",
"0.44110143",
"0.44073746",
"0.43975562",
"0.43974304",
"0.4393856",
"0.4390738",
"0.43895668",
"0.4387786",
"0.43862954",
"0.4385602",
"0.43546423",
"0.43470627",
"0.43459025",
"0.4341361",
"0.4335429",
"0.4325984",
"0.43193656",
"0.4318925",
"0.4318657",
"0.4316708",
"0.43149278",
"0.43081808",
"0.4303005",
"0.4303005",
"0.42998442",
"0.42991444",
"0.42991194",
"0.42913982",
"0.42902425",
"0.4281847",
"0.42808995",
"0.42774716",
"0.42733005",
"0.4263042",
"0.42577064",
"0.42571452",
"0.42485008",
"0.42427334",
"0.42329082",
"0.42236745",
"0.4220981",
"0.4214784",
"0.421149",
"0.4210208",
"0.4204705",
"0.42037538",
"0.42013413",
"0.420071"
] | 0.80920523 | 0 |
Add a patch in this graph. The graph can only have one added patch. Add also the links (edges) linking the patch with others. | public void addPatch(Geometry geom, double capa) throws IOException {
if(addedElem != null) {
throw new IllegalStateException("Graph already contains an added element");
}
BasicGraphBuilder builder = new BasicGraphBuilder();
// crée le noeud
DefaultFeature patch = getProject().createPatch(geom, capa);
Node node = builder.buildNode();
node.setObject(patch);
graph.getNodes().add(node);
// puis crée les liens
HashMap<DefaultFeature, Path> newLinks = getLinkset().calcNewLinks(patch);
for(DefaultFeature d : newLinks.keySet()) {
Path path = new Path(patch, d, newLinks.get(d).getCost(), newLinks.get(d).getDist());
if(getType() != PRUNED || getCost(path) <= getThreshold()) {
Node nodeB = null;
for(Node n : (Collection<Node>)getGraph().getNodes()) {
if(((Feature)n.getObject()).getId().equals(d.getId())) {
nodeB = n;
break;
}
}
if(nodeB == null) {
throw new IllegalStateException("Graph does not contain the patch node : " + d.getId());
}
Edge edge = builder.buildEdge(node, nodeB);
edge.setObject(path);
node.add(edge);
nodeB.add(edge);
graph.getEdges().add(edge);
}
}
addedElem = node;
components = null;
compFeatures = null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public AddPatchGraphGenerator(GraphGenerator gen) {\n super(gen, \"AddPatch\");\n this.addedElem = null;\n \n if(gen.isIntraPatchDist()) {\n throw new IllegalArgumentException(\"Intra patch distance is not supported\");\n }\n \n graph = gen.dupGraphWithout(Collections.EMPTY_LIST, Collections.EMPTY_LIST);\n }",
"public boolean linkPatches() { // TODO needs to check all layers!!\n \t\tunlinkAll(Patch.class);\n \t\t// sort points by layer id\n \t\tfinal HashMap<Long,ArrayList<Integer>> m = new HashMap<Long,ArrayList<Integer>>();\n \t\tfor (int i=0; i<n_points; i++) {\n \t\t\tArrayList<Integer> a = m.get(p_layer[i]);\n \t\t\tif (null == a) {\n \t\t\t\ta = new ArrayList<Integer>();\n \t\t\t\tm.put(p_layer[i], a);\n \t\t\t}\n \t\t\ta.add(i);\n \t\t}\n \t\tboolean must_lock = false;\n \t\t// For each layer id, search patches whose perimeter includes\n \t\t// one of the backbone points in this path:\n \t\tfor (Map.Entry<Long,ArrayList<Integer>> e : m.entrySet()) {\n \t\t\tfinal Layer layer = layer_set.getLayer(e.getKey().longValue());\n \t\t\tfor (Displayable patch : layer.getDisplayables(Patch.class)) {\n \t\t\t\tfinal Polygon perimeter = patch.getPerimeter();\n \t\t\t\tfor (Integer in : e.getValue()) {\n \t\t\t\t\tfinal int i = in.intValue();\n \t\t\t\t\tif (perimeter.contains(p[0][i], p[1][i])) {\n \t\t\t\t\t\tthis.link(patch);\n \t\t\t\t\t\tif (patch.locked) must_lock = true;\n \t\t\t\t\t\tbreak;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \n \t\t// set the locked flag to this and all linked ones\n \t\tif (must_lock && !locked) {\n \t\t\tsetLocked(true);\n \t\t\treturn true;\n \t\t}\n \n \t\treturn false;\n \t}",
"public void Add( TopoDS_Shape aShape) {\n OCCwrapJavaJNI.ShapeFix_EdgeConnect_Add__SWIG_1(swigCPtr, this, TopoDS_Shape.getCPtr(aShape), aShape);\n }",
"public void setPatch(String patch) {\n this.patch = patch;\n }",
"public void add(Figure geofig) {\n\t\tchildren.add(geofig);\n\t}",
"public void setPatch(ScriptedPatchRequest patch) {\n this.patch = patch;\n }",
"public net.opengis.gml.x32.AbstractSurfacePatchType addNewAbstractSurfacePatch()\n {\n synchronized (monitor())\n {\n check_orphaned();\n net.opengis.gml.x32.AbstractSurfacePatchType target = null;\n target = (net.opengis.gml.x32.AbstractSurfacePatchType)get_store().add_element_user(ABSTRACTSURFACEPATCH$0);\n return target;\n }\n }",
"public void addList()\n\t{\n\t\tdlm_patch.clear();\n\t\tif (pf.getAllPatch_DB() != null)\n\t\t{\n\t\t\tfor ( Patch p : pf.getAllPatch_DB() )\n\t\t\t\tdlm_patch.addElement(p);\n\t\t}\n\t}",
"@Override\n public BankPatch createNewPatch() {\n return super.createNewPatch();\n }",
"public AddPatchTask(Geometry addedGeom, double capaGeom, GraphGenerator gen, GlobalMetric metric, \n HashMap<Geometry, Double> testGeoms, ProgressBar monitor) {\n super(monitor);\n this.addedGeom = addedGeom;\n this.capaGeom = capaGeom;\n this.metric = metric;\n this.gen = gen;\n this.graphName = gen.getName();\n this.testGeoms = testGeoms;\n geoms = new ArrayList<>(testGeoms.keySet());\n }",
"protected Patch createNewPatch() { // overridden by subclass\n return null;\n }",
"protected void sendPatch(Patch p) {\n sendPatchWorker(p);\n }",
"void addEdges(Collection<ExpLineageEdge> edges);",
"public void addVertex (){\t\t \n\t\tthis.graph.insert( new MyList<Integer>() );\n\t}",
"public void Add( TopoDS_Edge aFirst, TopoDS_Edge aSecond) {\n OCCwrapJavaJNI.ShapeFix_EdgeConnect_Add__SWIG_0(swigCPtr, this, TopoDS_Edge.getCPtr(aFirst), aFirst, TopoDS_Edge.getCPtr(aSecond), aSecond);\n }",
"void add(Edge edge);",
"protected JSLFrame editPatch(Patch p) {\n ErrorMsg.reportError(\"Error\", \"The Driver for this patch does not support Patch Editing.\");\n return null;\n }",
"int addEdge(int tail, int head);",
"@Override\n protected void setPatchNum(int patchNum) {\n }",
"public void add(DefaultEdge edge) {\n edges.add(edge);\n groupObject.add(edge);\n }",
"public void setPatchedView(final PatchBase patch) {\n\t\tsetPatchedView(patch, MATCH_PARENT, MATCH_PARENT);\n\t}",
"public abstract void onNewPatchset(TicketModel ticket);",
"void addEdge(int x, int y);",
"public void changePolyAdd() {\n this.changePoly(this.aadd, this.badd, this.cadd, this.dadd, this.yadd);\n }",
"public void changePatch(Model tempModel)\n {\n // Here you do stuff that changes patches on the synth.\n // You probably want to look at tryToSendSysex() and tryToSendMIDI()\n //\n // This method is used primariily to switch to a new patch prior to loading it\n // from the synthesizer or emitting it to the synthesizer. Many synthesizers do \n // not report their patch location information when emitting a dump to Edisyn. \n // If this is the case, you might want add some code at the end of this method which\n // assumes that the patch change and subsequent parse were successful, so you can\n // just change the patch information in your model directly here in this method. \n // You should NOT do this when changing a patch for the purpose of merging. \n // So in this case (and ONLY in this case) you should end this method with something \n // along the lines of:\n //\n // // My synth doesn't report patch info in its parsed data, so here assume that we successfully did it\n // if (!isMerging())\n // {\n // boolean midi = getSendMIDI(); // is MIDI turned off right now?\n // setSendMIDI(false); // you should always turn off MIDI prior to messing with the model so nothing gets emitted, just in case\n // model.set(\"number\", number);\n // model.set(\"bank\", bank);\n // setSendMIDI(midi); // restore to whatever state it was\n // }\n }",
"ISlot add(ISlot newEntry);",
"public Link add(Link link);",
"public void addNotify() {\n synchronized(getTreeLock()) {\n if (peer == null)\n peer = getComponentFactory().createButton(this);\n super.addNotify();\n }\n }",
"public abstract void doPatch(RawPcodeImpl patchPcode);",
"protected void addEdge(CyEdge edge) {\n\tLayoutEdge newEdge = new LayoutEdge(edge);\n\tupdateWeights(newEdge);\n\tedgeList.add(newEdge);\n }",
"public void addVertex();",
"public void appendAjxPatch() {\n if (this.isRunning) {\n Ajx3BundleAppendPatchTask ajx3BundleAppendPatchTask = new Ajx3BundleAppendPatchTask(this.mGroups, this, this.mDownloadType);\n mTask = ajx3BundleAppendPatchTask;\n ajx3BundleAppendPatchTask.execute(new String[]{\"\"});\n }\n }",
"public void addOne()\n\t{\n\t\tBlock b = new Block(p1.tail.oldPosX, p1.tail.oldPosY, p1.tail, this);\n\t\tBlock b2 = new Block(p2.tail.oldPosX, p2.tail.oldPosY, p2.tail, this);\n\t\t\n\t\tb.setFill(Color.RED.desaturate());\n\t\tb2.setFill(Color.BLUE.desaturate());\n\n\t\tp1.tail = b;\n\t\tp2.tail = b2;\n\t\taddBlock(b);\n\t\taddBlock(b2);\n\t}",
"Patch createNewPatch(IDriver driver, String fileName, int size);",
"public void addEdge(DrawView edge){\n drawnEdges.add(edge);\n }",
"public void AddLink() {\n snake.add(tail + 1, new Pair(snake.get(tail).GetFirst(), snake.get(tail).GetSecond())); //Set the new link to the current tail link\n tail++;\n new_link = true;\n }",
"void addEdge(JNode edge) {\n List<JNode> newEdges = this.getEdges();\n newEdges.add(edge);\n this.setEdges(newEdges);\n }",
"public void addShape(TShape aShape){\r\n // fShapes.remove(aShape); // just in case it was already there\r\n\r\n /*unfortunately we need to have a front to back screen order, properties at the back\r\n (drawn first), then individuals, finally relations between individuals*/\r\n\r\n /* if (aShape instanceof TLine)\r\n fShapes.add(aShape); // add at the end\r\n else if (aShape instanceof TProperty)\r\n fShapes.add(0,aShape); // add at the beginning\r\n else {\r\n int insertIndex=0;\r\n if (fShapes.size() > 0) {\r\n Iterator iter = fShapes.iterator();\r\n\r\n while (iter.hasNext()) {\r\n if (! ((TShape) iter.next()instanceof TProperty))\r\n break; //put it after rectangles\r\n else\r\n insertIndex++;\r\n }\r\n }\r\n fShapes.add(insertIndex,aShape);\r\n }*/\r\n\r\n\r\n // aShape.setSemantics(fSemantics);\r\n\r\n aShape.addChangeListener(this); // and we'll listen for any of its changes, such as being selected\r\n\r\n addShapeToList(aShape,fShapes);\r\n\r\n if (aShape instanceof TInterpretationBoard)\r\n ((TInterpretationBoard)aShape).setSemantics(fSemantics);\r\n\r\n\r\n fPalette.check(); // some of the names may need updating\r\n\r\n repaint();\r\n }",
"public void addEdge(Edge e){\n\t\tedges.put(e.hashCode(), e);\n\t\te.getHead().addConnection(e);\n\t\te.getTail().addConnection(e);\n\t}",
"void updateLinks() {\n\t\tdouble x1, x2, y1, y2;\n\t\tfor(int i=0; i<links.size();i++){\n\t\t\tPNode node1 = links.get(i).getNode1();\n\t\t\tPNode node2 = links.get(i).getNode2();\n\t\t\tx1 = node1.getFullBoundsReference().getCenter2D().getX() + node1.getParent().getFullBounds().getOrigin().getX();\n\t\t\ty1 = node1.getFullBoundsReference().getCenter2D().getY() + node1.getParent().getFullBounds().getOrigin().getY();\n\t\t\tx2 = node2.getFullBoundsReference().getCenter2D().getX() + node2.getParent().getFullBounds().getOrigin().getX();\n\t\t\ty2 = node2.getFullBoundsReference().getCenter2D().getY() + node2.getParent().getFullBounds().getOrigin().getY();\n\t\t\t\n\t\t\t/*\n\t\t\tLine2D line = new Line2D.Double(x1,y1,x2,y2);\n\t\t\tlinks.get(i).getPPath().setPathTo(line);\n */\n\t\t\tsetPolyLine(links.get(i).getPPath(), (float)x1, (float)y1, (float)x2, (float)y2);\n\t\t\t}\n\t\t}",
"protected void addPolyline( SimpleFeature feature, PointMergeOperations mergeOps )\n \t{\n \t\tPoint point1 = mergePoint( feature, 0 );\n \t\tPoint point2 = mergePoint( feature, -1 );\n \t\tString id1 = point1.getId().toString();\n \t\tString id2 = point2.getId().toString();\n \t\tString fid = feature.getID();\n \t\n \t\tNode node1 = graph.getNode( id1 );\n \t\tNode node2 = graph.getNode( id2 );\n \t\tEdge edge = null;\n \t\t\n \t\tif( mergeDuplicateEdge && node1 != null && node2 != null )\n \t\t{\n \t\t\tedge = node1.getEdgeToward( node2.getId() );\n \t\t\t\n \t\t\tif( edge == null )\n \t\t\t\tedge = node1.getEdgeFrom( node2.getId() );\n \t\t}\n \n \t\tif( node1 == null )\n \t\t{\n \t\t\tnode1 = graph.addNode( id1 );\n \t\t\taddNodeAttributes( node1, fid, point1 );\n \t\t}\n \n \t\tif( node2 == null )\n \t\t{\n \t\t\tnode2 = graph.addNode( id2 );\n \t\t\taddNodeAttributes( node2, fid, point2 );\n \t\t}\n \t\n \t\tif( edge == null )\n \t\t{\n \t\t\tAttributeSet attr = new AttributeSet( feature );\n \t\t\tEdgeDirecter.Direction dir = edgeDirecter.edgeDirection( point1, point2, attr );\n \t\t\tboolean isDir = true;\n \n \t\t\tif( dir == EdgeDirecter.Direction.TO_FROM )\n \t\t\t{\n \t\t\t\tString id = id2;\n \t\t\t\tid2 = id1;\n \t\t\t\tid1 = id;\n \t\t\t}\n \t\t\telse if( dir == EdgeDirecter.Direction.UNDIRECTED )\n \t\t\t{\n \t\t\t\tisDir = false;\n \t\t\t}\n \t\t\t\n \t\t\tedge = graph.addEdge( fid, id1, id2, isDir );\n \t\t\t\n \t\t\tif( addEdgeLengths ) {\n \t\t\t\tedge.addAttribute( \"length\",\n \t\t\t\t\t\t((Geometry)feature.getDefaultGeometry()).getLength() );\n \t\t\t}\n \t\t\t\n \t\t\tif( addEdgeShapeAttribute ) {\n \t\t\t\taddEdgeShape(edge, ((Geometry)feature.getDefaultGeometry()).getCoordinates());\n \t\t\t}\n \t\t\n \t\t\tmergeAttributes( edge, attr, edgeAttributeFilter, feature );\n \t\t}\n \t}",
"public void add(PolytopePoint addition){\n\t\t//edges of the polytope hole\n\t\tArrayList<PolytopeEdge> edges = new ArrayList<PolytopeEdge>();\n\t\t//iterator over the faces\n\t\tIterator<PolytopeTriangle> loopControl = faces.iterator();\n\t\t\n\t\t//loop through the faces removing any that \"see\" the new point, and store their edges\n\t\twhile(loopControl.hasNext()){\n\t\t\tPolytopeTriangle face = loopControl.next();//current face being processed\n\t\t\t//check if the face can see the new point\n\t\t\tif(VecUtil.subtract(addition.supportFinal, face.s1.start.supportFinal).dot(face.normal) > 0){\n\t\t\t\t\n\t\t\t\t//used to mark which edges of this face should be added to the edge array that forms the edges\n\t\t\t\t//of the hole that is being formed\n\t\t\t\tboolean add1 = true, add2 = true, add3 = true;\n\t\t\t\t\n\t\t\t\tIterator<PolytopeEdge> edgeIterator = edges.iterator();\n\t\t\t\t//iterate over the edges currently stored\n\t\t\t\twhile(edgeIterator.hasNext()){\n\t\t\t\t\tPolytopeEdge curEdge = edgeIterator.next();\n\t\t\t\t\t//test the individual edges of this face if any of them are in this edge list\n\t\t\t\t\t//remove them and flag that edge as do not add\n\t\t\t\t\tif(curEdge.equals(face.s1)){\n\t\t\t\t\t\tadd1 = false;\n\t\t\t\t\t\tedgeIterator.remove();\n\t\t\t\t\t}else if(curEdge.equals(face.s2)){\n\t\t\t\t\t\tadd2 = false;\n\t\t\t\t\t\tedgeIterator.remove();\n\t\t\t\t\t}else if(curEdge.equals(face.s3)){\n\t\t\t\t\t\tadd3 = false;\n\t\t\t\t\t\tedgeIterator.remove();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//check which edges have been flagged as do not add and add the ones that we have\n\t\t\t\t//determined to be valid\n\t\t\t\tif (add1) {\n\t\t\t\t\tedges.add(face.s1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (add2) {\n\t\t\t\t\tedges.add(face.s2);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (add3) {\n\t\t\t\t\tedges.add(face.s3);\n\t\t\t\t}\n\t\t\t\t//remove the currently processed triangle face from the polytope\n\t\t\t\tloopControl.remove();\n\t\t\t}\n//\t\t\tSystem.out.println(faces.size());\n//\t\t\tSystem.out.println(edges.size());\n\t\t}\n//\t\tSystem.out.println(\"outside loop\");\n\t\t//construct new faces with the new support point\n\t\tfor(PolytopeEdge edge : edges){\n\t\t\tfaces.add(new PolytopeTriangle(edge.start, edge.end, addition));\n\t\t}\n\t}",
"private void addLinks(org.chromium.components.paint_preview.common.proto.PaintPreview.LinkDataProto value) {\n value.getClass();\n ensureLinksIsMutable();\n links_.add(value);\n }",
"interface Patch {\n\n }",
"public void addEdge(E e){\n\t\tedges.add(e);\n\t}",
"protected void storePatch(Patch p, int bankNum, int patchNum) {\n setBankNum(bankNum);\n setPatchNum(patchNum);\n sendPatch(p);\n }",
"public abstract void onMergePatchset(TicketModel ticket);",
"public void addPallet(Pallet e) {\r\n PalletNode pn=new PalletNode();//creates new pallet node\r\n pn.setContents(e);//set new pallet nodes contents\r\n pn.next=palletHead; //connects new pallet node to pallet head reference\r\n palletHead=pn; // sets new pallet node as head reference\r\n\r\n }",
"public void addEdge(Edge e){\n edgeList.add(e);\n }",
"public void AddNewGraph() {\n EQNum++;\n LineGraph line = new LineGraph();\n JButton GraphButton = new JButton(\"Graph\");\n JButton MakeRoot = new JButton(\"Bring To Top\");\n JTextField Eqinput = new JTextField();\n Eqinput.setPreferredSize(new Dimension(300, 20));\n JPanel EqPanel = new JPanel();\n EqPanel.add(new JLabel(\"f(x) =\"));\n EqPanel.add(Eqinput);\n GraphActionListener g = new GraphActionListener(this, Eqinput);\n Eqinput.addActionListener(g);\n Eqinput.setActionCommand(\"Graph\");\n EqPanel.add(GraphButton);\n EqPanel.add(MakeRoot);\n GraphButton.addActionListener(g);\n MakeRoot.addActionListener(g);\n EquationCardLayout.add(EqPanel, Integer.toString(EQNum));\n CardLayout c = (CardLayout) EquationCardLayout.getLayout();\n c.show(EquationCardLayout, Integer.toString(EQNum));\n EquationNum.setModel(new SpinnerNumberModel(EQNum, 1, EQNum, 1));\n lineGraphs.add(line);\n }",
"protected void addEdgeShape( Edge edge, Coordinate coos[] )\n \t{\n \t\tint n = coos.length;\n \n \t\tif( n > 1 )\n \t\t{\n \t\t\tObject xyz[] = new Object[n*3];\n \t\t\t\n \t\t\tfor( int i=0; i<n; ++i )\n \t\t\t{\n \t\t\t\tint j = i*3;\n \t\t\t\t\n \t\t\t\txyz[j+0] = (float) coos[i].x;\n \t\t\t\txyz[j+1] = (float) coos[i].y;\n \t\t\t\txyz[j+2] = (float) 0;\n \t\t\t}\n \t\t\t\n \t\t\tedge.setAttribute( \"ui.points\", xyz );\n \t\t}\n \t}",
"public void addEdge(Edge edgeToAdd){\n for(int i = 0; i<edges.size(); i++){\n Edge edge = edges.get(i);\n if(edge.end() == edgeToAdd.end()){\n edge.setWeight(edgeToAdd.weight()); // Change weight and return if edge is present\n return;\n }\n }\n this.edges.add(edgeToAdd); // Add edge normally\n }",
"public E addEdge(V tail, V head);",
"public net.opengis.gml.x32.AbstractSurfacePatchType insertNewAbstractSurfacePatch(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n net.opengis.gml.x32.AbstractSurfacePatchType target = null;\n target = (net.opengis.gml.x32.AbstractSurfacePatchType)get_store().insert_element_user(ABSTRACTSURFACEPATCH$1, ABSTRACTSURFACEPATCH$0, i);\n return target;\n }\n }",
"protected void addGraph(IGraph graph) {\n\n if (graph != null) {\n\n this.ids.add(graph.getID());\n this.graphMap.put(graph.getID(), graph);\n }\n }",
"Patch createNewPatch(byte[] gsysex, IDriver driver);",
"public void addToPainter(OSMNode node) {\r\n\t\tGeoPosition geoP = new GeoPosition(Double.parseDouble(node.getLat()), Double.parseDouble((node.getLon())));\r\n\t\tgeopoints.add(geoP);\r\n\t\t \r\n\t\t//waypoints.add(new DefaultWaypoint(geoP));\r\n\t}",
"@Override\n\tpublic void addEdge(Location src, Location dest, Path edge) {\n\t\tint i = locations.indexOf(src);\n\t\tpaths.get(locations.indexOf(src)).add(edge);\n\t}",
"@Override\n public void add(Note note) {\n }",
"Patch createNewPatch(byte[] gsysex, Device device);",
"public void add() {\n //TODO: Fill in this method, then remove the RuntimeException\n throw new RuntimeException(\"RatPolyStack->add() unimplemented!\\n\");\n }",
"void add(int head, int relation, int tail, List<Pair<List<Integer>, Double>> path2prob_list) {\n fb_h.add(head);\n fb_r.add(relation);\n fb_l.add(tail);\n fb_path2prob.add(path2prob_list);\n\n Pair<Integer, Integer> key = new Pair<>(head, relation);\n if (!head_relation2tail.containsKey(key)) {\n head_relation2tail.put(key, new HashSet<>());\n }\n Set<Integer> tail_set = head_relation2tail.get(key);\n tail_set.add(tail);\n }",
"public RequestDataBuilder patch() {\n\t\tRequest request = new Request(urlPattern, RequestMethod.PATCH);\n\t\tmap.put(request, clazz);\n\t\treturn this;\n\t}",
"void addPeer(Uuid peer) throws RemoteException;",
"@Override\n\tpublic void add(CommentModel comment) {\n\t\tcomments.add(comment);\n\t}",
"public static native PatchResult patch(String oldApkPath, String patchPath, String newApkPath);",
"public void setPatchVersion(String patchVersion) {\n this.patchVersion = patchVersion;\n }",
"public void addFigEdge(final FigEdge figEdge, final String sourcePortFigId,\n final String destPortFigId, final String sourceFigNodeId,\n final String destFigNodeId) {\n figEdges.add(new EdgeData(figEdge, sourcePortFigId, destPortFigId,\n sourceFigNodeId, destFigNodeId));\n }",
"private void addLinkesToGraph()\n\t{\n\t\tString from,to;\n\t\tshort sourcePort,destPort;\n\t\tMap<Long, Set<Link>> mapswitch= linkDiscover.getSwitchLinks();\n\n\t\tfor(Long switchId:mapswitch.keySet())\n\t\t{\n\t\t\tfor(Link l: mapswitch.get(switchId))\n\t\t\t{\n\t\t\t\tfrom = Long.toString(l.getSrc());\n\t\t\t\tto = Long.toString(l.getDst());\n\t\t\t\tsourcePort = l.getSrcPort();\n\t\t\t\tdestPort = l.getDstPort();\n\t\t\t\tm_graph.addEdge(from, to, Capacity ,sourcePort,destPort);\n\t\t\t} \n\t\t}\n\t\tSystem.out.println(m_graph);\n\t}",
"void addPeerEndpoint(PeerEndpoint peer);",
"private LPGActionGraph getAddNeighbor(PlanGraphStep stepToAdd, \n\t\t\tUnsupportedPrecondition inconsistency, int currentLevel) {\n\t\t\n\t\tLPGActionGraph neighbor = this.copyActionGraph();\n\t\tneighbor.addStep(stepToAdd, currentLevel);\n\t\tneighbor.graphQuality = neighbor.calculateQuality();\n\t\treturn neighbor;\n\t\t\n\t}",
"public boolean add(Node peer) {\n\t\t\tboolean res = super.add(peer);\n\t\t\taddNotifier.notifyObservers(peer);\n\t\t\treturn res;\n\t\t}",
"@java.lang.Override\n public boolean hasPatch() {\n return instance.hasPatch();\n }",
"public void add(Shape shapes) {\n\t\tshapesList.add(shapes);\n\t}",
"public void addNotify() {\n synchronized (getTreeLock()) {\n if (peer == null) {\n peer = ((PeerBasedToolkit) getToolkit()).createWindow(this);\n }\n super.addNotify();\n }\n }",
"void addEdge(Edge e) {\n if (e.getTail().equals(this)) {\n outEdges.put(e.getHead(), e);\n\n return;\n } else if (e.getHead().equals(this)) {\n indegree++;\n inEdges.put(e.getTail(), e);\n\n return;\n }\n\n throw new RuntimeException(\"Cannot add edge that is unrelated to current node.\");\n }",
"void addAll(Graph graph);",
"public PatchNotesDownloader(String patchNotesLink) {\n // Check to see if patchNotesLink starts with C:\\ or a similar path and then append file:\\\\ if true?\n PATCH_NOTES_LINK = patchNotesLink;\n }",
"public void addPolyLine() {\n abstractEditor.drawNewShape(new ELineDT());\n }",
"private void attachEdges(Diagram d) {\n for (EdgeData edgeData : figEdges) {\n final FigEdge edge = edgeData.getFigEdge();\n\n Object modelElement = modelElementsByFigEdge.get(edge);\n if (modelElement != null) {\n if (edge.getOwner() == null) {\n edge.setOwner(modelElement);\n }\n }\n }\n\n for (EdgeData edgeData : figEdges) {\n final FigEdge edge = edgeData.getFigEdge();\n\n Fig sourcePortFig = findFig(edgeData.getSourcePortFigId());\n Fig destPortFig = findFig(edgeData.getDestPortFigId());\n final FigNode sourceFigNode = getFigNode(edgeData\n .getSourceFigNodeId());\n final FigNode destFigNode = getFigNode(edgeData.getDestFigNodeId());\n\n if (sourceFigNode instanceof FigEdgePort) {\n sourcePortFig = sourceFigNode;\n }\n\n if (destFigNode instanceof FigEdgePort) {\n destPortFig = destFigNode;\n }\n\n if (sourcePortFig == null && sourceFigNode != null) {\n sourcePortFig = getPortFig(sourceFigNode);\n }\n\n if (destPortFig == null && destFigNode != null) {\n destPortFig = getPortFig(destFigNode);\n }\n\n if (sourcePortFig == null || destPortFig == null\n || sourceFigNode == null || destFigNode == null) {\n LOG.log(Level.SEVERE,\n \"Can't find nodes for FigEdge: \" + edge.getId() + \":\"\n + edge.toString());\n edge.removeFromDiagram();\n } else {\n edge.setSourcePortFig(sourcePortFig);\n edge.setDestPortFig(destPortFig);\n edge.setSourceFigNode(sourceFigNode);\n edge.setDestFigNode(destFigNode);\n }\n }\n\n // Once all edges are connected do a compute route on each to make\n // sure that annotations and the edge port is positioned correctly\n // Only do this after all edges are connected as compute route\n // requires all edges to be connected to nodes.\n // TODO: It would be nice not to have to do this and restore annotation\n // positions instead.\n for (Object edge : d.getLayer().getContentsEdgesOnly()) {\n FigEdge figEdge = (FigEdge) edge;\n figEdge.computeRouteImpl();\n }\n }",
"public synchronized void add(WhiteboardShape s,Reference refInst)\t\n\t{\n\t\tshapes.add(s);\n\t\tfor(Reference r:clients)\t//broadcast to all connected clients\n\t\t{\n\t\t\tif(r!=refInst)\n\t\t\t\tr.sendShape(s);\n\t\t}\n\t}",
"public void add(Shape s)\n {\n shapes.add(s);\n }",
"protected void mutateAddLink() {\n\t\t// Make sure network is not fully connected\n\n\t\t// Sum number of connections\n\t\tint totalconnections = numGenes();\n\n\t\t// Find number of each type of node\n\t\tint in = population.numInputs;\n\t\tint out = population.numOutputs;\n\t\tint hid = numNodes() - (in + out);\n\n\t\t// Find the number of possible connections.\n\t\t// Links cannot end with an input\n\t\tint fullyconnected = 0;\n\t\tfullyconnected = (in + out + hid) * (out + hid);\n\n\t\tif (totalconnections == fullyconnected)\n\t\t\treturn;\n\n\t\t// Pick 2 nodes for a new connection and submit it\n\t\tNNode randomstart;\n\t\tNNode randomend;\n\t\tdo {\n\t\t\trandomstart = getRandomNode();\n\t\t\trandomend = getRandomNode();\n\t\t} while (randomend.type == NNode.INPUT\n\t\t\t\t|| hasConnection(randomstart.ID, randomend.ID));\n\n\t\tint newgeneinno = population\n\t\t\t\t.getInnovation(randomstart.ID, randomend.ID);\n\t\tGene newgene = new Gene(newgeneinno, randomstart.ID, randomend.ID,\n\t\t\t\tBraincraft.randomWeight(), true);\n\t\tpopulation.registerGene(newgene);\n\t\tsubmitNewGene(newgene);\n\n\t\tif (Braincraft.gatherStats)\n\t\t\tBraincraft.genetics.add(\"link creation mutation \" + ID + \" \"\n\t\t\t\t\t+ newgene.innovation + \" \" + randomstart.ID + \" \"\n\t\t\t\t\t+ randomend.ID);\n\t}",
"public void addEdge(StubEdge e) {\n }",
"public IHyperLink attachLink()\n throws OculusException;",
"VirtualMachineInstallPatchesResult installPatches(\n String resourceGroupName,\n String name,\n VirtualMachineInstallPatchesParameters installPatchesInput,\n Context context);",
"public UnifiedPatch(byte[] patch, int level) {\n\t\tif (patch == null) {throw new IllegalArgumentException();}\n\t\tthis.patch = patch;\n\t\tthis.level = level;\n\t}",
"public void add(Shape c) {\n\t\tc.centerXProperty().addListener(doubleListener);\n\t\tc.centerYProperty().addListener(doubleListener);\n\t\tc.radiusProperty().addListener(doubleListener);\n\t\tc.colorProperty().addListener(colorListener);\n\t\tc.widthProperty().addListener(doubleListener);\n\t\tc.heightProperty().addListener(doubleListener);\n\t\tc.arcWidthProperty().addListener(doubleListener);\n\t\tc.arcHeightProperty().addListener(doubleListener);\n\t\tc.textProperty().addListener(textListener);\n\t\tc.typeProperty().addListener(typeListener);\n\t\tc.deleteProperty().addListener(deleteListener);\n\t\tdrawData.add(c);\n\t}",
"public void add(List<IShape> component)\n\t{\n\t\tfilterShapes(component);\n\t\tfilterGroups(component);\n\t}",
"public void addShape(Shape shape)\n {\n shapes.add(shape);\n }",
"public void insertIntoGraph(mxICell cell) {\n mxICell parent = cell.getParent();\n mxICell source = cell.getTerminal(true);\n mxICell target = cell.getTerminal(false);\n\n // Fixes possible inconsistencies during insert into graph\n cell.setTerminal(null, false);\n cell.setTerminal(null, true);\n cell.setParent(null);\n\n if (parent != null) {\n parent.insert(cell);\n }\n\n if (source != null) {\n source.insertEdge(cell, true);\n }\n\n if (target != null) {\n target.insertEdge(cell, false);\n }\n }",
"Patch createNewPatch(byte[] gsysex);",
"@Override\n\tpublic void add(GalaxyNote phone) {\n\t\t\n\t}",
"public void addDependencyGraph(DAGraph<DataT, NodeT> dependencyGraph) {\n this.rootNode.addDependency(dependencyGraph.rootNode.key());\n Map<String, NodeT> sourceNodeTable = dependencyGraph.nodeTable;\n Map<String, NodeT> targetNodeTable = this.nodeTable;\n this.merge(sourceNodeTable, targetNodeTable);\n dependencyGraph.parentDAGs.add(this);\n if (this.hasParents()) {\n this.bubbleUpNodeTable(this, new LinkedList<String>());\n }\n }",
"public abstract void addComponent(DrawingComponent component);",
"public void addHop(TCSObjectReference<Point> newHop) {\n requireNonNull(newHop, \"newHop\");\n hops.add(newHop);\n }",
"VirtualMachineInstallPatchesResult installPatches(\n String resourceGroupName, String name, VirtualMachineInstallPatchesParameters installPatchesInput);",
"private void addEdge() {\n childMatrix[randomParent][childMatrix[randomParent][0]] = randomChild;\n childMatrix[randomParent][0]++;\n parentMatrix[randomChild][parentMatrix[randomChild][0]] = randomParent;\n parentMatrix[randomChild][0]++;\n }",
"void addEdge(int source, int destination, int weight);",
"public void addNote(Note newNote) throws NotepadOverflowException {\n for (int i = 0; i < _notes.length; i++) {\n if (_notes[i] == null) {\n _notes[i] = newNote;\n return;\n }\n }\n if (DynamicNotepad) {\n enlargeNotepad(_notes.length);\n addNote(newNote);\n }\n throw new NotepadOverflowException(_notes.length);\n }"
] | [
"0.6908067",
"0.54096085",
"0.5406806",
"0.53370214",
"0.52347046",
"0.51580226",
"0.51366365",
"0.51322335",
"0.50797755",
"0.50244874",
"0.48946247",
"0.4885261",
"0.48685697",
"0.48671922",
"0.48363638",
"0.48303133",
"0.48245513",
"0.48219848",
"0.4821879",
"0.47752768",
"0.47572637",
"0.47541538",
"0.47419432",
"0.4738067",
"0.47353363",
"0.4733328",
"0.47331473",
"0.4727953",
"0.4722874",
"0.47189072",
"0.46997917",
"0.46934602",
"0.46886882",
"0.46640807",
"0.46616572",
"0.46592402",
"0.4652579",
"0.4648665",
"0.46458215",
"0.46265894",
"0.46258727",
"0.46190146",
"0.46168134",
"0.4597077",
"0.45909652",
"0.45849034",
"0.45796323",
"0.45711106",
"0.45566064",
"0.45360962",
"0.45337802",
"0.45275813",
"0.4526024",
"0.45128813",
"0.45033535",
"0.45022938",
"0.44999444",
"0.44960976",
"0.44959226",
"0.44839007",
"0.44831046",
"0.44679528",
"0.44671088",
"0.4461991",
"0.44571006",
"0.44567564",
"0.44558343",
"0.44546056",
"0.44531015",
"0.44493467",
"0.44492218",
"0.4438376",
"0.44383335",
"0.4436218",
"0.4425541",
"0.44136694",
"0.44117883",
"0.43955448",
"0.438306",
"0.4376888",
"0.4375257",
"0.4373963",
"0.43673155",
"0.4362671",
"0.43609813",
"0.4352916",
"0.43457472",
"0.4345536",
"0.43424806",
"0.4341795",
"0.43394858",
"0.4339317",
"0.43350774",
"0.4334671",
"0.4334316",
"0.43262383",
"0.4304799",
"0.43047476",
"0.4301781",
"0.43012348"
] | 0.67314583 | 1 |
Creates new form SPARQL | public SPARQL() {
initComponents();
model = ModelFactory.createOntologyModel(OntModelSpec.OWL_LITE_MEM_RDFS_INF);
model.setDynamicImports(true);
model.read("file:"+"data/ontologies/Papers_Ready.owl", "http://www.l3g.pl/ontologies/OntoBeef/Papers.owl", "N-TRIPLE");
model.loadImports();
for (Individual i : model.listIndividuals(model.getOntClass("http://www.l3g.pl/ontologies/OntoBeef/Conceptualisation.owl#Category")).toSet())
{
System.out.println(i.listLabels(null).toSet());
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Object executeQuery(String sparqlQuery);",
"public SemanticWorkflow addQueryGraph(String q){\n SPARQLProcess sp = new SPARQLProcess(q);\n sp.setResult(GRAPH);\n return add(sp);\n }",
"private MetaSparqlRequest createInsertMT1() {\n\t\tString sparqlStr = \"\"+\n\t\t\t\t\"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\\r\\n\" + \n\t\t\t\t\"PREFIX ub: \"+_ontology+\"\\r\\n\" + \n\t\t\t\t\"INSERT DATA { GRAPH \"+_graph+\" { \"+\n\t\t\t\tbuilderBindInsert\n\t\t\t\t+\" } }\";\n\t\t\n\t\tSparqlObj sparql= new SparqlObj(sparqlStr) ;\n\t\tEndPoint endPointHost= new EndPoint(_protocol,_host,_port,\"/update\");\n\t\tMetaSparqlRequest msr = new MetaSparqlRequest(new SparqlRequest(sparql,endPointHost));\n\t\tmsr.setTripleInsert(createTripleBaseMT1());\n\t\treturn msr;\n\t}",
"public void createQuery(String s) throws HibException;",
"public static void querying(String constructQuery2) {\n\t\t//construct the new query\n\t\t//String constructQuery2 = prefix+\" \"+select+\" \"+selectValues+\" \"+where+openBracket+openBracket+\" \"+local+\" \"+service+\" \"+openBracket+\" \"+remote+\" \"+closeBracket+closeBracket;\n\t\t//constructQuery2 = constructQuery2+\" UNION \"+\" \"+openBracket+\" \"+local+\" \"+service+\" \"+openBracket+\" \"+remote+\" \"+closeBracket+closeBracket+closeBracket;\n\t\t\n\t\tSystem.out.println(constructQuery2);\n\t\tQuery query2 = QueryFactory.create(constructQuery2);\n\t\tQueryExecution qe2 = QueryExecutionFactory.sparqlService(\n\t\t\t\t\"http://localhost:3030/USNA/query\", query2);\n\t\t\n\t\tResultSet results1 = qe2.execSelect();\n\t\tif(constantOutput == \"\") {\n\t\t\tResultSetFormatter.out(System.out, results1);\n\t\t}else {\n\t\t\tString NS = \"http://www.usna.org/ns#\";\n\t\t\tModel rdfssExample = ModelFactory.createDefaultModel();\n\t\t\tString [] constant = constantOutput.trim().split(\" \");\n\t\t\t\n\t\t\tString [] headers = selectValues.split(\" \");\n\t\t System.out.println(\"--------------------------------------------------------------------------------------------------------------------------------------------\");\n\t\t\tfor(int i = 0; i< headers.length; i++) {\n\t\t\t\t//System.out.print(headers[i].substring(1,headers[i].length()).trim()+\"\\t\\t\\t\\t\\t\\t\");\n\t\t\t\tSystem.out.print(headers[i].substring(1,headers[i].length()).trim()+\"\\t\\t\\t\\t\\t\\t\");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"----------------------------------------------------------------------------------------------------------------------------------------------\");\n\t\t\tSystem.out.println();\n\t\t\t\n\t\t\ttry {\n\t\t\t\t int count = 0;\n\t\t while ( results1.hasNext() ) {\n\t\t \t //Resource Response = rdfssExample.createResource(NS+constant[count]);\n\t\t \t \n\t\t QuerySolution soln = results1.nextSolution();\n\t\t Resource first = soln.getResource(headers[0].substring(1,headers[0].length()).trim());\n\t\t //Resource second = soln.getResource(headers[1].substring(1,headers[1].length()).trim());\n\t\t //Resource third = soln.getResource(headers[2].substring(1,headers[2].length()).trim());\n\t\t //Resource fourth = soln.getResource(headers[3].substring(1,headers[3].length()).trim());\n\t\t for(int i=0; i< constant.length; i++) {\n\t\t \t Resource Response = rdfssExample.createResource(NS+constant[i]);\n\t\t \t System.out.format(\"%10s %50s\",first, Response);\n\t\t \t System.out.println();\n\t\t\t\t\t //count++;\n\t\t }\n\t\t //System.out.format(\"%10s %50s\",first, Response);\n\t\t //System.out.format(\"%10s\",first);\n\t\t\t\t System.out.println();\n\t\t\t\t //count++;\n\t\t\t\t \n\t\t\t\t //System.out.println(count);\n\t\t \n\t\t }\n\t\t } finally {\n\t\t \t qe2.close();\n\t\t}\n\t\t\t \n\t\t}\t\t \n\t}",
"public Query( String queryString ) {\r\n\tStringTokenizer tok = new StringTokenizer( queryString );\r\n\twhile ( tok.hasMoreTokens() ) {\r\n\t terms.add( tok.nextToken() );\r\n\t weights.add( new Double(1) );\r\n\t} \r\n }",
"public abstract String createQuery();",
"com.exacttarget.wsdl.partnerapi.QueryRequest addNewQueryRequest();",
"public interface SPARQLService {\n // TODO: Create methods for at least CRUD \n}",
"@Test\n\tpublic void testSparqlQuery() throws OWLOntologyCreationException,\n\t\t\tIOException {\n\t\tInputStream ontStream = LDLPReasonerTest.class\n\t\t\t\t.getResourceAsStream(\"/data/university0-0.owl\");\n\t\tOWLOntologyManager manager = OWLManager.createOWLOntologyManager();\n\t\tOWLOntology ontology = manager\n\t\t\t\t.loadOntologyFromOntologyDocument(ontStream);\n\n\t\tInputStream queryStream = LDLPReasonerTest.class\n\t\t\t\t.getResourceAsStream(\"/data/lubm-query4.sparql\");\n\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(\n\t\t\t\tqueryStream));\n\t\tString line;\n\t\tString queryText = \"\";\n\t\twhile ((line = reader.readLine()) != null) {\n\t\t\tqueryText = queryText + line + \"\\n\";\n\t\t}\n\n\t\tQuery query = QueryFactory.create(queryText, Syntax.syntaxARQ);\n\t\tLDLPReasoner reasoner = new LDLPReasoner(ontology);\n\t\tList<Literal> results = reasoner.executeQuery(query);\n\t\tSystem.out.println(results.size() + \" answers :\");\n\t\tfor (Literal result : results) {\n\t\t\tSystem.out.println(result);\n\t\t}\n\t\tLDLPCompilerManager m = LDLPCompilerManager.getInstance();\n\n\t\t// m.dump();\n\n\t}",
"Graph callConstructQuery(String name, Map<String, String> params);",
"public void constructQuery(String query) {\n\t\tQuery q = QueryFactory.create(query);\n\t\tQueryExecution qe = QueryExecutionFactory.create(q, model);\n\t\tModel result = qe.execConstruct();\n\t\tprintModel(result);\n\t\tmodel.add(result);\n\t\tqe.close();\n\t}",
"@Override\n\tpublic Query createQuery(String qlString) {\n\t\treturn null;\n\t}",
"@Test\n public void example13 () throws Exception {\n Map<String, Stmt> inputs = example2setup();\n conn.setNamespace(\"ex\", \"http://example.org/people/\");\n conn.setNamespace(\"ont\", \"http://example.org/ontology/\");\n String prefix = \"PREFIX ont: \" + \"<http://example.org/ontology/>\\n\";\n \n String queryString = \"select ?s ?p ?o where { ?s ?p ?o} \";\n TupleQuery tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, queryString);\n assertSetsEqual(\"SELECT result:\", inputs.values(),\n statementSet(tupleQuery.evaluate()));\n \n assertTrue(\"Boolean result\",\n conn.prepareBooleanQuery(QueryLanguage.SPARQL,\n prefix + \n \"ask { ?s ont:name \\\"Alice\\\" } \").evaluate());\n assertFalse(\"Boolean result\",\n conn.prepareBooleanQuery(QueryLanguage.SPARQL,\n prefix + \n \"ask { ?s ont:name \\\"NOT Alice\\\" } \").evaluate());\n \n queryString = \"construct {?s ?p ?o} where { ?s ?p ?o . filter (?o = \\\"Alice\\\") } \";\n GraphQuery constructQuery = conn.prepareGraphQuery(QueryLanguage.SPARQL, queryString);\n assertSetsEqual(\"Construct result\",\n mapKeep(new String[] {\"an\"}, inputs).values(),\n statementSet(constructQuery.evaluate()));\n \n queryString = \"describe ?s where { ?s ?p ?o . filter (?o = \\\"Alice\\\") } \";\n GraphQuery describeQuery = conn.prepareGraphQuery(QueryLanguage.SPARQL, queryString);\n assertSetsEqual(\"Describe result\",\n mapKeep(new String[] {\"an\", \"at\"}, inputs).values(),\n statementSet(describeQuery.evaluate()));\n }",
"public void gerarRDF() throws SenseRDFException;",
"public static void main( String[] args ) {\n\n Model m = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM_RDFS_INF);\n\n\n FileManager.get().readModel( m, owlFile );\n String myOntologyName = \"http://www.w3.org/2002/07/owl#\";\n String myOntologyNS = \"http://www.w3.org/2002/07/owl#\";\n////\n////\n// String rdfPrefix = \"PREFIX rdf: <\"+RDF.getURI()+\">\" ;\n// String myOntologyPrefix = \"PREFIX \"+myOntologyName+\": <\"+myOntologyNS+\">\" ;\n// String myOntologyPrefix1 = \"PREFIX \"+myOntologyName ;\n String myOntologyPrefix2 = \"prefix pizza: <http://www.w3.org/2002/07/owl#> \";\n//\n//\n//// String queryString = myOntologyPrefix + NL\n//// + rdfPrefix + NL +\n//// \"SELECT ?subject\" ;\n \n String queryString = rdfPrefix + myOntologyPrefix2 +\n// \t\t \"prefix pizza: <http://www.w3.org/2002/07/owl#> \"+ \n \t\t \"prefix rdfs: <\" + RDFS.getURI() + \"> \" +\n \t\t \"prefix owl: <\" + OWL.getURI() + \"> \" +\n// \t\t \"select ?o where {?s ?p ?o}\";\n \n//\t\t\t\t\t\t\"select ?s where {?s rdfs:label \"苹果\"@zh}\";\n \n// \"SELECT ?label WHERE { ?subject rdfs:label ?label }\" ;\n// \"SELECT DISTINCT ?predicate ?label WHERE { ?subject ?predicate ?object. ?predicate rdfs:label ?label .}\";\n// \"SELECT DISTINCT ?s WHERE {?s rdfs:label \\\"Italy\\\"@en}\" ;\n// \"SELECT DISTINCT ?s WHERE {?s rdfs:label \\\"苹果\\\"@zh}\" ;\n// \"SELECT DISTINCT ?s WHERE\" +\n// \"{?object rdfs:label \\\"水果\\\"@zh.\" +\n// \"?subject rdfs:subClassOf ?object.\" +\n// \"?subject rdfs:label ?s}\";\n //星号是转义字符,分号是转义字符\n\t\t\t\t\"SELECT DISTINCT ?e ?s WHERE {?entity a ?subject.?subject rdfs:subClassOf ?object.\"+\n \"?object rdfs:label \\\"富士苹果\\\"@zh.?entity rdfs:label ?e.?subject rdfs:label ?s}ORDER BY ?s\";\n \t\t\n\n \n \t\tcom.hp.hpl.jena.query.Query query = QueryFactory.create(queryString);\n \t\tQueryExecution qe = QueryExecutionFactory.create(query, m);\n \t\tcom.hp.hpl.jena.query.ResultSet results = qe.execSelect();\n\n \t\tResultSetFormatter.out(System.out, results, query);\n \t\tqe.close();\n\n// Query query = QueryFactory.create(queryString) ;\n\n query.serialize(new IndentedWriter(System.out,true)) ;\n System.out.println() ;\n\n\n\n QueryExecution qexec = QueryExecutionFactory.create(query, m) ;\n\n try {\n\n ResultSet rs = qexec.execSelect() ;\n\n\n for ( ; rs.hasNext() ; ){\n QuerySolution rb = rs.nextSolution() ;\n RDFNode y = rb.get(\"person\");\n System.out.print(\"name : \"+y+\"--- \");\n Resource z = (Resource) rb.getResource(\"person\");\n System.out.println(\"plus simplement \"+z.getLocalName());\n }\n }\n finally{\n qexec.close() ;\n }\n }",
"public abstract List createQuery(String query);",
"private MetaSparqlRequest createQueryMT2() {\n\t\treturn createQueryMT1();\n\t}",
"public void testInsertPredicate() {\n part.insertPredicate(\"<http://dbpedia.org/ontology/deathPlace>\", 10);\n WebResource endpoint = part.getService();\n String checkquery= \"SELECT (COUNT(*) as ?no) \"\n + \"{?s <http://dbpedia.org/ontology/deathPlace> ?o }\";\n assertEquals(10,\n Integer.parseInt(\n endpoint.path(\"sparql\").queryParam(\"query\", checkquery)\n\t\t\t .accept(\"application/sparql-results+csv\")\n\t\t\t .get(String.class).replace(\"no\\n\", \"\").trim()));\n }",
"public void createGraphDB() throws SQLException {\n \t\tString nodes = \"insert into nodes(id,label,url,sex,single) select fbid,name,'http://www.facebook.com/profile.php?id='||fbid,sex,single from users;\";\n \t\tString edges = \"insert into edges select distinct users.fbid as source, friends.friendfbid as target, '5' as weight, 'knows' as name from users join friends where friends.userid=users.id\";\n \t\tpreparedStatement = connect.prepareStatement(nodes);\n \t\tpreparedStatement.execute();\n \t\tpreparedStatement = connect.prepareStatement(edges);\n \t\tpreparedStatement.execute();\n \t\tpreparedStatement.close();\n \t}",
"public void newQuery(String query){\n\t\tparser = new Parser(query);\n\t\tQueryClass parsedQuery = parser.createQueryClass();\n\t\tqueryList.add(parsedQuery);\n\t\t\n\t\tparsedQuery.matchFpcRegister((TreeRegistry)ps.getRegistry());\n\t\tparsedQuery.matchAggregatorRegister();\n\t\t\n\t\t\n\t}",
"CampusSearchQuery generateQuery();",
"Query createQuery(final String query);",
"private MetaSparqlRequest createPrepareInsertMT3() {\n\t\t\tString sparqlStr = \"\"+\n\t\t\t\t\t\"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\\r\\n\" + \n\t\t\t\t\t\"PREFIX ub: \"+_ontology+\"\\r\\n\" + \n\t\t\t\t\t\"INSERT DATA { GRAPH \"+_graph+\" { \"+\n\t\t\t\t\tbuilderBindInsert\n\t\t\t\t\t+\" } }\";\n\t\t\t\n\t\t\tSparqlObj sparql= new SparqlObj(sparqlStr) ;\n\t\t\tEndPoint endPointHost= new EndPoint(_protocol,_host,_port,\"/update\");\n\t\t\tMetaSparqlRequest msr = new MetaSparqlRequest(new SparqlRequest(sparql,endPointHost));\n\t\t\tmsr.setTripleInsert(createTripleBaseMT3A());\n\t\t\treturn msr;\n\t\t}",
"com.synergyj.cursos.webservices.ordenes.XMLBFactura addNewXMLBFactura();",
"public void testWriteRDF() {\n\n\t\trunQuery(new LinkQueryTerm(relationVocabulary.is_a(),NEURON), \"subclass\");\n\n\t\trunQuery(new LinkQueryTerm(MELANOCYTE),\"any link\");\n\t\t\n\t\trunQuery(new LinkQueryTerm(relationVocabulary.part_of(),MELANOCYTE),\"part_of (class)\");\n\t\t\n\t\trunQuery(new LinkQueryTerm(relationVocabulary.inheres_in(),\tnew LinkQueryTerm(relationVocabulary.part_of(),HUMAN_EYE)),\"phenotype in some part of the eye\");\n\t\t\n\t\trunQuery(new AnnotationLinkQueryTerm(MELANOCYTE),\"anything annotated to melanocyte\");\n\t\t\n\t\trunQuery(new AnnotationLinkQueryTerm(new LinkQueryTerm(relationVocabulary.inheres_in(),\tMELANOCYTE)),\"anything annotated to a melanocyte phenotype\");\n\t\t\n\t\tQueryTerm classQt =\tnew BooleanQueryTerm(new LinkQueryTerm(relationVocabulary.inheres_in(),NEURON),\tnew LinkQueryTerm(relationVocabulary.inheres_in(),BEHAVIOR));\n\t\t\n\t\trunQuery(new AnnotationLinkQueryTerm(classQt),\"boolean query\");\n\n\n\t}",
"public static SPARQLResult make(InputStream in, Model model)\n {\n return new XMLInputSAX(in, model) ;\n }",
"public Collection<URI> searchWithSPARQL(final String queryString)\n {\n if (DEBUG.SEARCH) Log.debug(\"searchWithSPARQL; queryString:\\n\" + Util.tags(queryString));\n \n final Collection<URI> resultSet = new ArrayList<URI>();\n final com.hp.hpl.jena.query.Query query = QueryFactory.create(queryString);\n \n if (DEBUG.SEARCH) Log.debug(\"QF created \" + Util.tag(query)\n + \"; memory=\" + Runtime.getRuntime().freeMemory()\n + \"\\n\" + query.toString().trim().replaceAll(\"\\n\\n\", \"\\n\"));\n\n final QueryExecution qe = QueryExecutionFactory.create(query, this); // 2nd arg is for Model or for FileManager?\n if (DEBUG.SEARCH) Log.debug(\"created QEF \" + qe + \"; memory=\" + Runtime.getRuntime().freeMemory());\n\n final ResultSet results = qe.execSelect();\n if (DEBUG.SEARCH) Log.debug(\"execSelect returned; memory=\" + Runtime.getRuntime().freeMemory());\n \n while (results.hasNext()) {\n final QuerySolution qs = results.nextSolution();\n if (DEBUG.SEARCH) {\n final String qss = qs.toString().replaceAll(\"<http://vue.tufts.edu\", \"...\"); // shorten debug output\n Log.debug(\"qSol \" + String.format(\"%.190s%s\", qss, qss.length() > 190 ? (\"...x\"+qss.length()) : \"\"));\n }\n if (false) {\n // debug debug all vars from query\n //Util.dumpIterator(qs.varNames());\n Iterator<String> vn = qs.varNames(); \n while (vn.hasNext()) {\n String v = vn.next();\n Log.debug(\"\\t\" + Util.tags(v) + \"=\" + Util.tags(qs.get(v)));\n }\n }\n try {\n resultSet.add(new URI(qs.getResource(\"rid\").getURI()));\n } catch (Throwable t) {\n Log.warn(\"handling QuerySolution \" + qs, t);\n }\n }\n qe.close();\n return resultSet;\n }",
"private void creatingNewQuestion() {\r\n AbstractStatement<?> s;\r\n ListQuestions lq = new ListQuestions(ThemesController.getThemeSelected());\r\n switch ((String) typeQuestion.getValue()) {\r\n case \"TrueFalse\":\r\n // just to be sure the answer corresponds to the json file\r\n Boolean answer = CorrectAnswer.getText().equalsIgnoreCase(\"true\");\r\n s = new TrueFalse<>(Text.getText(), answer);\r\n break;\r\n\r\n case \"MCQ\":\r\n s = new MCQ<>(Text.getText(), TextAnswer1.getText(), TextAnswer2.getText(), TextAnswer3.getText(), CorrectAnswer.getText());\r\n break;\r\n\r\n default:\r\n s = new ShortAnswer<>(Text.getText(), CorrectAnswer.getText());\r\n break;\r\n }\r\n lq.addQuestion(new Question(s, ThemesController.getThemeSelected(), Difficulty.fromInteger((Integer) difficulty.getValue()) ));\r\n lq.writeJson(ThemesController.getThemeSelected());\r\n }",
"Query query();",
"stars.StarListDocument.StarList addNewStarList();",
"public void setNewSearch(String query){\n isNewSearch = true;\n this.query = query;\n }",
"private void runQuery(QueryTerm qt, String name) {\n\t\tqt.setInferred(false);\n\t\tRDFQuery q = new RDFQuery(qt);\n\t\tSystem.out.println(\"=== \"+name+\" ===\\n* OBD Query:\\n \"+qt);\n\t\tSystem.out.println(\"\\n* Autogenerated SPARQL:\\n \"+q.toSPARQL()+\"\\n\\n\");\n\t\tfor (Node n : this.shard.getNodesByQuery(qt)){\n\t\t\tSystem.out.println(\"Node: \" + n.toString());\n\t\t}\n\t\n\t}",
"private void buildQueryTaxon(TermsList termsList) \n \t\tthrows UnsupportedEncodingException {\n final String value = this.taxon;\n \n if ((value != null) && (!(value.equals(\"\")))) {\n termsList.addTerm(value);\n String parenthesizedValue = parenthesizeQueryValue(value);\n String escapedValue = Search.escapeQueryChars(parenthesizedValue);\n String encodedValue = URLEncoder.encode(escapedValue, \"UTF-8\");\n String taxonQuery = String.format(\"taxonomic:%s\", encodedValue);\n updateQString(taxonQuery);\n }\n }",
"com.soa.SolicitarServicioDocument.SolicitarServicio addNewSolicitarServicio();",
"public interface SparqlQueryService {\n\n\t/**\n\t * Generic method to invoke a supplied query regardless of its type. The\n\t * client has to inspect and cast the result object accordingly.\n\t * \n\t * @param name\n\t * @param params\n\t * @return\n\t */\n\tObject executeQuery(String sparqlQuery);\n\n\t/**\n\t * Generic method to invoke a query regardless of its type. The client has\n\t * to inspect and cast the result object accordingly.\n\t * \n\t * @param name\n\t * @param params\n\t * @return\n\t */\n\tObject callQuery(String name, Map<String, String> params);\n\n\t/**\n\t * Invocation of a SPARQL SELECT query. The resultant JSON structure is\n\t * serialized according to the W3C SPARQL 1.1 Query Results JSON Format.\n\t * \n\t * @see http://www.w3.org/TR/sparql11-query/#select\n\t * @param name\n\t * @param params\n\t * @return JSON result structure.\n\t */\n\tSparqlResultObject callSelectQuery(String name, Map<String, String> params);\n\n\t/**\n\t * Invocation of a SPARQL CONSTRUCT query resulting in new graph serialized\n\t * according to RDF/JSON format\n\t * (http://jena.apache.org/documentation/io/rdf-json.html).\n\t * \n\t * \n\t * @see http://www.w3.org/TR/sparql11-query/#construct\n\t * @param name\n\t * @param params\n\t * @return\n\t */\n\tGraph callConstructQuery(String name, Map<String, String> params);\n\n\t/**\n\t * Invocation of a SPARQL ASK query resulting in a boolean value.\n\t * \n\t * @see\n\t * \n\t * @param name\n\t * Unique name of the query.\n\t * @param params\n\t * Map of required parameter-value pairs.\n\t * @return true or false, depending whether the pattern matches.\n\t */\n\tBoolean callAskQuery(String name, Map<String, String> params);\n\n}",
"private MetaSparqlRequest createQueryMT3() {\n\t\t\treturn createQueryMT1();\n\t\t}",
"TSearchResults createSearchResults(TSearchQuery searchQuery);",
"private ASTQuery() {\r\n dataset = Dataset.create();\r\n }",
"Statement createStatement();",
"Statement createStatement();",
"Statement createStatement();",
"public void createSurvey(int tid);",
"private static boolean make_type_x(String query, DataDir dir, \n\t\t\t\t int query_type, Z39session zsession, boolean addOID) {\n\t StringTokenizer st = new StringTokenizer(query);\n\t nodes node[] = new nodes[st.countTokens()];\n\t int rc = 0;\n\t DataDir parm = dir;\n\n//System.out.println(\"make type x: num nodes: \" + node.length);\n\n\t if (node.length==0)\n\t {\n if (zsession != null && zsession.logger != null && \n\t\t zsession.logger.getLevel() != Z39logging.OFF)\n\t\t zsession.logger.println(\"No query provided!\");\n\t\treturn false;\n\t }\n\n \t String q = query.trim();\n\n \t int i=0, j, o, len, nodecnt=0;\n\n try {\n \t for (o=0, len = q.length(); o < len; o=j+1) {\n \t if (q.charAt(o) == '\"') {\n\t\ti = q.indexOf('\"', o+1);\n\t\tif (i == -1)\n\t\t i = o;\n \t }\n\t else\n\t\ti = o;\n\n \t j = q.indexOf(' ', i);\n \t if (j == -1)\n\t j = q.length();\n\n // If length > 0, add new node \n if ( (j-o) > 0 ) {\n node[nodecnt] = new nodes(q.substring(o,j), query_type, zsession);\n\n if (zsession != null && zsession.logger != null && \n\t\t zsession.logger.getLevel() != Z39logging.OFF)\n\t\t zsession.logger.println(\n\t\t \"node[\"+nodecnt+\"].type=\" + nodes.operators[node[nodecnt].type]+\n\t\t \", .term='\"+node[nodecnt].term+\"'\");\n\n \t //System.out.println(\"node[\"+nodecnt+\"].type=\" + nodes.operators[node[nodecnt].type]+\n\t\t //\", .term='\"+node[nodecnt].term+\"'\");\n\n nodecnt++; \n }\n\t }\n }\n catch (Exception e) {\n System.out.println(\"caught exception from nodemaker\");\n e.printStackTrace();\n }\n\n\n//System.out.println(\"link nodes \" + (nodecnt-1));\n\n\n\t rc=nodes.linkNodes(node, nodecnt-1); //node.length-1);\n\t if (rc != -1)\n\t {\n if (zsession != null && zsession.logger != null && \n\t\t zsession.logger.getLevel() != Z39logging.OFF)\n\t\t zsession.logger.println(\n\t\t \"Ill formed query, linkNodes returned \" + rc);\n\t\treturn false;\n\t }\n\n if (zsession != null && zsession.logger != null && \n\t\tzsession.logger.getLevel() != Z39logging.OFF)\n\t\tzsession.logger.println(\"building type-\"+query_type+\" query\");\n\n if (addOID) {\n \t parm = dir.add(query_type, ASN1.CONTEXT);\n\t parm.addOID(ASN1.OBJECTIDENTIFIER, ASN1.UNIVERSAL, \n\t\t\"1.2.840.10003.3.1\");\n }\n\t node[nodecnt-1].buildQuery(parm);\n\n\t return true;\n\t}",
"public void newDocument();",
"QueryType createQueryType();",
"com.icare.eai.schema.om.evSORequest.EvSORequestDocument.EvSORequest addNewEvSORequest();",
"@RequestMapping(value = \"/queryrdf\", method = {RequestMethod.GET, RequestMethod.POST})\n public void queryRdf(@RequestParam(\"query\") final String query,\n @RequestParam(value = RdfCloudTripleStoreConfiguration.CONF_QUERY_AUTH, required = false) String auth,\n @RequestParam(value = RdfCloudTripleStoreConfiguration.CONF_CV, required = false) final String vis,\n @RequestParam(value = RdfCloudTripleStoreConfiguration.CONF_INFER, required = false) final String infer,\n @RequestParam(value = \"nullout\", required = false) final String nullout,\n @RequestParam(value = RdfCloudTripleStoreConfiguration.CONF_RESULT_FORMAT, required = false) final String emit,\n @RequestParam(value = \"padding\", required = false) final String padding,\n @RequestParam(value = \"callback\", required = false) final String callback,\n final HttpServletRequest request,\n final HttpServletResponse response) {\n SailRepositoryConnection conn = null;\n final Thread queryThread = Thread.currentThread();\n auth = StringUtils.arrayToCommaDelimitedString(provider.getUserAuths(request));\n final Timer timer = new Timer();\n timer.schedule(new TimerTask() {\n\n @Override\n public void run() {\n log.debug(\"interrupting\");\n queryThread.interrupt();\n\n }\n }, QUERY_TIME_OUT_SECONDS * 1000);\n\n try {\n final ServletOutputStream os = response.getOutputStream();\n conn = repository.getConnection();\n\n final Boolean isBlankQuery = StringUtils.isEmpty(query);\n final ParsedOperation operation = QueryParserUtil.parseOperation(QueryLanguage.SPARQL, query, null);\n\n final Boolean requestedCallback = !StringUtils.isEmpty(callback);\n final Boolean requestedFormat = !StringUtils.isEmpty(emit);\n\n if (!isBlankQuery) {\n if (operation instanceof ParsedGraphQuery) {\n // Perform Graph Query\n final RDFHandler handler = new RDFXMLWriter(os);\n response.setContentType(\"text/xml\");\n performGraphQuery(query, conn, auth, infer, nullout, handler);\n } else if (operation instanceof ParsedTupleQuery) {\n // Perform Tuple Query\n TupleQueryResultHandler handler;\n\n if (requestedFormat && emit.equalsIgnoreCase(\"json\")) {\n handler = new SPARQLResultsJSONWriter(os);\n response.setContentType(\"application/json\");\n } else {\n handler = new SPARQLResultsXMLWriter(os);\n response.setContentType(\"text/xml\");\n }\n\n performQuery(query, conn, auth, infer, nullout, handler);\n } else if (operation instanceof ParsedUpdate) {\n // Perform Update Query\n performUpdate(query, conn, os, infer, vis);\n } else {\n throw new MalformedQueryException(\"Cannot process query. Query type not supported.\");\n }\n }\n\n if (requestedCallback) {\n os.print(\")\");\n }\n } catch (final Exception e) {\n log.error(\"Error running query\", e);\n throw new RuntimeException(e);\n } finally {\n if (conn != null) {\n try {\n conn.close();\n } catch (final RepositoryException e) {\n log.error(\"Error closing connection\", e);\n }\n }\n }\n\n timer.cancel();\n }",
"public void create(int x, int y, int parentx, int parenty, String description, String status) throws SQLException {\n var statement = connection.prepareStatement(\"INSERT INTO nodes (x, y, parentx, parenty, status, owner, description) VALUES (?, ?, ?, ?, ?, ?, ?)\");\n statement.setInt(1, x);\n statement.setInt(2, y);\n statement.setInt(3, parentx);\n statement.setInt(4, parenty);\n statement.setString(5, status);\n statement.setString(6, \"temp\");\n description=swearFilter(description); //METHOD TAKES IN THE DESCRIPTION AND FILTERS FOR SWEAR WORDS\n statement.setString(7, description);\n statement.execute();\n statement.close();\n }",
"amdocs.iam.pd.pdwebservices.GetQuoteDocument.GetQuote addNewGetQuote();",
"public void createQuestion(int sid,int qid,String qtype,String qtitle,String answer_a,String answer_b,String answer_c,String answer_d);",
"SparqlResultObject callSelectQuery(String name, Map<String, String> params);",
"public static SPARQLResult make(String str, Model model)\n {\n return new XMLInputSAX(str, model) ;\n }",
"public Statement createStatement(Resource s, Property p, RDFNode o) {\n \t\treturn new NamedGraphStatement(s, p, o, this);\n \t}",
"private synchronized String processCreate(String query) {\r\n\t\tString[] valuesCommand = query.split(\" \");\r\n\t\tif ( valuesCommand.length != 3 )\r\n\t\t\treturn \"ERROR Bad syntaxe command CREATE - Usage : CREATE id initial_solde\";\r\n\t\tString id = valuesCommand[1];\r\n\t\tif ( this.bank.existAccount(id) ) {\r\n\t\t\treturn \"ERROR Account alwready exist\";\r\n\t\t}\r\n\t\tdouble number = Double.valueOf(valuesCommand[2]);\r\n\t\tthis.bank.createAccount(id, number);\r\n\t\treturn \"OK \" + this.bank.getLastOperation(id);\r\n\t}",
"public Query(String expression) {\r\n\t\t_product = Product.class;\r\n\t\t_variable = \"p\";\r\n\t\t_expression = expression;\r\n\r\n\t}",
"public static void add(Transcription t) throws IOException, SQLException\r\n {\r\n IndexWriter writer = null;\r\n Analyzer analyser;\r\n Directory directory;\r\n /**@TODO parameterize this location*/\r\n String dest = \"/usr/indexTranscriptions\";\r\n\r\n directory = FSDirectory.getDirectory(dest, true);\r\n analyser = new StandardAnalyzer();\r\n writer = new IndexWriter(directory, analyser, true);\r\n Document doc=new Document();\r\n Field field;\r\n field = new Field(\"text\", t.getText(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"comment\", t.getComment(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"creator\", \"\" + t.UID, Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"security\", \"\" + \"private\", Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"line\", \"\" + t.getLine(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"page\", \"\" + t.getFolio(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"id\", \"\" + t.getLineID(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"manuscript\", \"\" + new Manuscript(t.getFolio()).getID(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"projectID\", \"\" + t.getProjectID(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n writer.addDocument(doc);\r\n writer.commit();\r\n \twriter.close();\r\n\r\n }",
"private static List<Supplier> createSupplierData(ConsumerQuery query, boolean testing) {\n\t\tRepository repository;\n\t\t\n\t\t//use name of processes in query to retrieve subset of relevant supplier data from semantic infrastructure\n\t\tList<String> processNames = new ArrayList<String>();\t\n\n\t\tif (query.getProcesses() == null || query.getProcesses().isEmpty()) {\n\t\t\tSystem.err.println(\"There are no processes specified!\");\n\t\t} else {\n\t\t\n\t\tfor (Process process : query.getProcesses()) {\n\t\t\tprocessNames.add(process.getName());\n\t\t}\n\t\t}\n\t\t\t\n\t\t\n\t\tlong startTime = System.currentTimeMillis();\n\n\t\tif (testing == false) {\n\n\t\t\tMap<String, String> headers = new HashMap<String, String>();\n\t\t\theaders.put(\"Authorization\", AUTHORISATION_TOKEN);\n\t\t\theaders.put(\"accept\", \"application/JSON\");\n\n\t\t\trepository = new SPARQLRepository(SPARQL_ENDPOINT );\n\n\t\t\trepository.initialize();\n\t\t\t((SPARQLRepository) repository).setAdditionalHttpHeaders(headers);\n\n\t\t} else {\n\n\t\t\t//connect to GraphDB\n\t\t\trepository = new HTTPRepository(GRAPHDB_SERVER, REPOSITORY_ID);\n\t\t\trepository.initialize();\n\t\t}\n\t\t\n\t\t//creates a SPARQL query that is run against the Semantic Infrastructure\n\t\tString strQuery = SparqlQuery.createQueryMVP(processNames);\n\t\t\n\t\t//System.out.println(strQuery);\n\n\t\t//open connection to GraphDB and run SPARQL query\n\t\tSet<SparqlRecord> recordSet = new HashSet<SparqlRecord>();\n\t\tSparqlRecord record;\n\t\ttry(RepositoryConnection conn = repository.getConnection()) {\n\n\t\t\tTupleQuery tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, strQuery);\t\t\n\n\t\t\t//if querying the local KB, we need to set setIncludeInferred to false, otherwise inference will include irrelevant results.\n\t\t\t//when querying the Semantic Infrastructure the non-inference is set in the http parameters.\n\t\t\tif (testing == true) {\n\t\t\t\t//do not include inferred statements from the KB\n\t\t\t\ttupleQuery.setIncludeInferred(false);\n\t\t\t}\n\n\t\t\ttry (TupleQueryResult result = tupleQuery.evaluate()) {\t\t\t\n\n\t\t\t\twhile (result.hasNext()) {\n\n\t\t\t\t\tBindingSet solution = result.next();\n\n\t\t\t\t\t//omit the NamedIndividual types from the query result\n\t\t\t\t\tif (!solution.getValue(\"processType\").stringValue().equals(\"http://www.w3.org/2002/07/owl#NamedIndividual\")\n\t\t\t\t\t\t\t&& !solution.getValue(\"certificationType\").stringValue().equals(\"http://www.w3.org/2002/07/owl#NamedIndividual\")\n\t\t\t\t\t\t\t&& !solution.getValue(\"materialType\").stringValue().equals(\"http://www.w3.org/2002/07/owl#NamedIndividual\")) {\n\n\t\t\t\t\t\trecord = new SparqlRecord();\n\t\t\t\t\t\trecord.setSupplierId(solution.getValue(\"supplierId\").stringValue().replaceAll(\"\\\\s+\",\"\"));\n\t\t\t\t\t\trecord.setProcess(stripIRI(solution.getValue(\"processType\").stringValue().replaceAll(\"\\\\s+\",\"\")));\n\t\t\t\t\t\trecord.setMaterial(stripIRI(solution.getValue(\"materialType\").stringValue().replaceAll(\"\\\\s+\",\"\")));\n\t\t\t\t\t\trecord.setCertification(stripIRI(solution.getValue(\"certificationType\").stringValue().replaceAll(\"\\\\s+\",\"\")));\n\n\t\t\t\t\t\trecordSet.add(record);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t}\tcatch (Exception e) {\n\t\t\t\tSystem.err.println(e.getMessage());\n\t\t\t\tSystem.err.println(\"Wrong test data!\");\n\t\t\t}\n\t\t\t\n\n\t\t\t\n\n\t\t}\n\n\t\t//close connection to KB repository\n\t\trepository.shutDown();\n\n\t\tlong stopTime = System.currentTimeMillis();\n\t\tlong elapsedTime = stopTime - startTime;\n\n\t\tif (testing == true ) {\n\t\tSystem.out.println(\"The SPARQL querying process took \" + elapsedTime/1000 + \" seconds.\");\n\t\t}\n\n\t\t//get unique supplier ids used for constructing the supplier structure below\n\t\tSet<String> supplierIds = new HashSet<String>();\n\t\tfor (SparqlRecord sr : recordSet) {\n\t\t\tsupplierIds.add(sr.getSupplierId());\n\t\t}\n\n\t\tCertification certification = null;\n\t\tSupplier supplier = null;\n\t\tList<Supplier> suppliersList = new ArrayList<Supplier>();\n\n\t\t//create a map of processes and materials relevant for each supplier\n\t\tMap<String, SetMultimap<Object, Object>> multimap = new HashMap<String, SetMultimap<Object, Object>>();\n\n\t\tfor (String id : supplierIds) {\n\t\t\tSetMultimap<Object, Object> map = HashMultimap.create();\n\n\t\t\tString supplierID = null;\n\n\t\t\tfor (SparqlRecord sr : recordSet) {\n\n\t\t\t\tif (sr.getSupplierId().equals(id)) {\n\n\t\t\t\t\tmap.put(sr.getProcess(), sr.getMaterial());\n\n\t\t\t\t\tsupplierID = sr.getSupplierId();\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tmultimap.put(supplierID, map);\n\t\t}\t\t\n\n\t\tProcess process = null;\n\n\t\t//create supplier objects (supplier id, processes (including materials) and certifications) based on the multimap created in the previous step\n\t\tfor (String id : supplierIds) {\n\t\t\tSetMultimap<Object, Object> processAndMaterialMap = null;\n\n\t\t\tList<Certification> certifications = new ArrayList<Certification>();\n\t\t\tList<Process> processes = new ArrayList<Process>();\t\t\n\n\t\t\tfor (SparqlRecord sr : recordSet) {\n\n\t\t\t\tif (sr.getSupplierId().equals(id)) {\n\n\t\t\t\t\t//add certifications\n\t\t\t\t\tcertification = new Certification(sr.getCertification());\n\t\t\t\t\tif (!certifications.contains(certification)) {\n\t\t\t\t\t\tcertifications.add(certification);\n\t\t\t\t\t}\n\n\t\t\t\t\t//add processes and associated materials\n\t\t\t\t\tprocessAndMaterialMap = multimap.get(sr.getSupplierId());\n\n\t\t\t\t\tString processName = null;\n\n\t\t\t\t\tSet<Object> list = new HashSet<Object>();\n\n\t\t\t\t\t//iterate processAndMaterialMap and extract process and relevant materials for that process\n\t\t\t\t\tfor (Entry<Object, Collection<Object>> e : processAndMaterialMap.asMap().entrySet()) {\n\n\t\t\t\t\t\tSet<Material> materialsSet = new HashSet<Material>();\n\n\t\t\t\t\t\t//get list/set of materials\n\t\t\t\t\t\tlist = new HashSet<>(e.getValue());\n\n\t\t\t\t\t\t//transform to Set<Material>\n\t\t\t\t\t\tfor (Object o : list) {\n\t\t\t\t\t\t\tmaterialsSet.add(new Material((String)o));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tprocessName = (String) e.getKey();\n\n\t\t\t\t\t\t//add relevant set of materials together with process name\n\t\t\t\t\t\tprocess = new Process(processName, materialsSet);\n\n\t\t\t\t\t\t//add processes\n\t\t\t\t\t\tif (!processes.contains(process)) {\n\t\t\t\t\t\t\tprocesses.add(process);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tsupplier = new Supplier(id, processes, certifications );\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsuppliersList.add(supplier);\n\t\t}\n\n\t\treturn suppliersList;\n\n\t}",
"QuoteTerm createQuoteTerm();",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n String queryString = request.getParameter(\"queryString\");\n String returnTable = null;\n String error = null;\n\n SesameClient rdfClient = new SesameClient(sesameServerURl, repositoryID);\n try {\n rdfClient.Connect();\n TupleQueryResult result = rdfClient.executeQuery(queryString);\n List<String> bindingNames = result.getBindingNames();\n\n returnTable = \"<table border=1>\";\n returnTable = returnTable + \"<tr>\";\n for (int i = 0; i < bindingNames.size(); i++) {\n returnTable = returnTable + \"<td>\" + bindingNames.get(i) + \"</td>\";\n }\n returnTable = returnTable + \"</tr>\";\n int j=0;\n while (result.hasNext()) {\n BindingSet bindingSet = result.next();\n returnTable = returnTable + \"<tr>\";\n for (int i = 0; i < bindingNames.size(); i++) {\n if (bindingSet.getValue(bindingNames.get(i)) == null) {\n returnTable = returnTable + \"<td> </td>\";\n } else {\n String name= bindingNames.get(i);\n String bindValue = bindingSet.getValue(name).stringValue();\n returnTable = returnTable + \"<td>\" + bindValue + \"</td>\";\n }\n }\n returnTable = returnTable + \"</tr>\";\n j++;\n }\n result.close();\n returnTable = returnTable +j+\"Results found</table>\";\n } catch (OpenRDFException ex) {\n Logger.getLogger(MusicServlet.class.getName()).log(Level.SEVERE, null, ex);\n error = ex.getLocalizedMessage();\n } \n queryString = queryString.substring(queryString.lastIndexOf(\"#>\") + 2);\n\n request.setAttribute(\"queryString\", queryString);\n request.setAttribute(\"result\", returnTable);\n request.setAttribute(\"error\", error);\n\n\n RequestDispatcher rd = request.getRequestDispatcher(\"/index.jsp\");\n rd.forward(request, response);\n }",
"public InternalBlazegraphQueryHandler(){\n\t\tFile ieee8500 = new File(\"ieee13.xml\");\n \n\t\ttry {\n//\t\t\tFile journal = File.createTempFile(\"bigdata\", \".jnl\");\n//\t\t\tfinal String CIF = \"http://iec.ch/TC57/2012/CIM-schema-cim16#\";\n//\t\t\tfinal String modelID = \"_676B0EA4-162F-4D4A-8FDD-B5FB7C2B7270\";\n//\t journal.deleteOnExit();\n//\t final Properties properties = new Properties();\n//\t properties.setProperty(BigdataSail.Options.FILE, journal\n//\t .getAbsolutePath());\n//\t \n//\t // instantiate a sail\n//\t BigdataSail sail = new BigdataSail(properties);\n//\t repo = new BigdataSailRepository(sail);\n//\t repo.initialize();\n//\n//\t con = repo.getConnection();\n//\t \n//\t String idQuery = \"SELECT ?x WHERE {<\"+CIF+modelID+\"> ?p ?x}\";\n//\t TupleQuery tupleQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, idQuery);\n//\t TupleQueryResult result = tupleQuery.evaluate();\n//\t if(!result.hasNext()) {\n//\t \t System.out.println(\"ABOUT TO LOAD\");\n//\t \t con.add(ieee8500, CIF, RDFFormat.RDFXML);\n//\t \t System.out.println(\"LOADED\");\n//\t }\n//\t \n//\t con.close();\n \n \n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} \n\t}",
"public static void createSimple() throws Exception {\n\t\t// create a sesame memory sail\n\t\tMemoryStore memoryStore = new MemoryStore();\n\n\t\t// create a lucenesail to wrap the memorystore\n\t\tLuceneSail lucenesail = new LuceneSail();\t\t\n\t\t// set this parameter to let the lucene index store its data in ram\n\t\tlucenesail.setParameter(LuceneSail.LUCENE_RAMDIR_KEY, \"true\");\n\t\t// set this parameter to store the lucene index on disk\n\t\t// lucenesail.setParameter(LuceneSail.LUCENE_DIR_KEY, \"./data/mydirectory\");\n\t\t\n\t\t// wrap memorystore in a lucenesail\n\t\tlucenesail.setDelegate(memoryStore);\n\t\t\n\t\t// create a Repository to access the sails\n\t\tSailRepository repository = new SailRepository(lucenesail);\n\t\trepository.initialize();\n\t\t\n\t\t// add some test data, the FOAF ont\n\t\tSailRepositoryConnection connection = repository.getConnection();\n\t\tconnection.begin();\n\t\ttry {\n//\t\t\tconnection.setAutoCommit(false);\n\t\t\tFile file = new File(\"/Users/sschenk/Downloads/foaf.rdfs\");\n\t\t\tSystem.out.println(file.exists());\n\t\t\tconnection.add(\n\t\t\t\t\tfile,\n\t\t\t\t\t\"\", \n\t\t\t\t\tRDFFormat.RDFXML);\n\t\t\tconnection.commit();\n\t\t\t\n\t\t\t// search for all resources that mention \"person\"\n\t\t\tString queryString = \"PREFIX search: <\"+LuceneSailSchema.NAMESPACE+\"> \\n\" +\n\t\t\t\t\t\"SELECT ?x ?score ?snippet WHERE {?x search:matches ?match. \\n\" +\n\t\t\t\t\t\"?match search:query \\\"person\\\"; \\n\" +\n\t\t\t\t\t\"search:score ?score; \\n\" +\n\t\t\t\t\t\"search:snippet ?snippet. }\" ;\n\t\t\tSystem.out.println(\"Running query: \\n\"+queryString);\n\t\t\tTupleQuery query = connection.prepareTupleQuery(QueryLanguage.SPARQL, queryString);\n\t\t\tTupleResult result = query.evaluate();\n\t\t\ttry { \n\t\t\t\t// print the results\n\t\t\t\twhile (result.hasNext()){\n\t\t\t\t\tBindingSet bindings = result.next();\n\t\t\t\t\tSystem.out.println(\"found match: \");\n\t\t\t\t\tfor (Binding binding : bindings) {\n\t\t\t\t\t\tSystem.out.println(\" \"+binding.getName()+\": \"+binding.getValue());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tresult.close();\n\t\t\t}\n\t\t} finally {\n\t\t\tconnection.close();\n\t\t\trepository.shutDown();\n\t\t}\n\t\t\n\t}",
"org.landxml.schema.landXML11.RoadsideDocument.Roadside addNewRoadside();",
"private MetaSparqlRequest createInsertMT2() {\n\t\t//is the same of MT1\n\t\treturn createInsertMT1();\n\t}",
"ch.crif_online.www.webservices.crifsoapservice.v1_00.FinancialStatement addNewFinancialStatements();",
"stockFilePT102.StockDocument.Stock addNewStock();",
"ObstacleQuery createObstacleQuery();",
"private void buildQueryIdentifier(TermsList termsList)\n\t\t\tthrows UnsupportedEncodingException {\n\t\tString value = this.identifier;\n\n\t\tif ((value != null) && (!(value.equals(\"\")))) {\n\n\t\t\ttermsList.addTerm(value);\n\n\t\t\t/*\n\t\t\t * If the user entered a PASTA identifier, convert it to a packageId\n\t\t\t * value so that it will match the Solr 'packageid' field. (We don't\n\t\t\t * index the PASTA identifier in Solr.)\n\t\t\t */\n\t\t\tString packageId = PastaClient.pastaURLtoPackageId(value);\n\t\t\tif (packageId != null) {\n\t\t\t\tvalue = packageId;\n\t\t\t}\n\n\t\t String parenthesizedValue = parenthesizeQueryValue(value);\n\t\t\tString escapedValue = Search.escapeQueryChars(parenthesizedValue);\n\t\t\tString encodedValue = URLEncoder.encode(escapedValue, \"UTF-8\");\n\t\t\tString doiQuery = String.format(\"doi:%s\", encodedValue);\n\t\t\tupdateQString(doiQuery);\n\t\t\tString packageIdQuery = String.format(\"packageid:%s\", encodedValue);\n\t\t\tupdateQString(packageIdQuery);\n\t\t\tString idQuery = String.format(\"id:%s\", encodedValue);\n\t\t\tupdateQString(idQuery);\n\t\t}\n\t}",
"public PseudoQuery() {\r\n\t}",
"public abstract Search create(String search, SearchBuilder builder);",
"private static String createGraphqlAddTemplate(InputStream iStream, String issuerSector) throws IOException {\n\t\tObjectNode variables = new ObjectMapper().createObjectNode();\r\n\r\n\t\t// add a nested node object to our current node\r\n\t\tObjectNode input = variables.putObject(\"issuerSector\");\r\n\t\tinput.put(ISSUER_SECTOR_FIELD,issuerSector);\r\n\t\t\r\n\r\n\t\t// Now parse the graphql file to a request payload string\r\n\t\tString graphqlPayload = GraphqlTemplate.parseGraphql(iStream, variables);\r\n\t\treturn graphqlPayload;\r\n\t}",
"public SPQRLQueryPanel(SPARQLQueryEngine rdqlqi) {\n\t\t\tspqrlQueryManager=rdqlqi;\n\t\t\tsetBorder(new TitledBorder(\"SPQRL query\"));\n\t\t\tsetLayout(new BorderLayout());\n\t\t\t\n\t\t\tspqrlQueryTextArea=new JTextArea(spqrlQueryManager.query,8,60);\n\t\t\tadd(spqrlQueryTextArea,BorderLayout.CENTER);\n\t\t\t\n\t\t\t\n\t\t\t//rdqlHelperComboBox=new OntoHintBox(inspect.myRDFScapeInstance);\n\t\t\t//rdqlHelperComboBox.registerListener(this);\n\t\t\t//JPanel buttonPanel=new JPanel();\n\t\t\t//clearButton=new JButton(\"Delete Query\");\n\t\t\t\n\t\t}",
"net.webservicex.www.WeatherForecasts addNewWeatherForecasts();",
"ch.crif_online.www.webservices.crifsoapservice.v1_00.ScoreAnalysis addNewScoreAnalysis();",
"int create(String title, String publisher, String releaseDate,\n String description, String targetAudience, String language, String genre,\n String url, String keywords) throws SQLException;",
"TSearchQuery createSearchQuery(SearchQueryDefinitionAPI searchQueryDefinition);",
"private static void initSPARQLAnythingEngine() {\n\t\t// Register the JSON-LD parser factory for extension .json\n\t\tReaderRIOTFactory parserFactoryJsonLD = new RiotUtils.ReaderRIOTFactoryJSONLD();\n\t\tRDFParserRegistry.registerLangTriples(RiotUtils.JSON, parserFactoryJsonLD);\n\t\t// Setup FX executor\n\t\tJenaSystem.init();\n\t\tQC.setFactory(ARQ.getContext(), FacadeX.ExecutorFactory);\n\t}",
"String getInsertDataLiteralQuery(String graph, String subject, String predicate, String object, String datatype);",
"int insert(Terms record);",
"void create(Trubriques trubriques);",
"public SolrQuery() {\n super(null);\n store = null;\n }",
"amdocs.iam.pd.webservices.quotation.getquoteinput.GetQuoteInput addNewROOT();",
"org.landxml.schema.landXML11.RoadwayDocument.Roadway addNewRoadway();",
"com.exacttarget.wsdl.partnerapi.QueryRequestMsgDocument.QueryRequestMsg addNewQueryRequestMsg();",
"int insert(SPerms record);",
"protected static Boolean newCorpus() throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException {\n String[] subqueries = query.split(\"\\\\s+\"); //split around white space\n if (subqueries[0].equals(\"index\") && subqueries.length > 1) {\n JOptionPane.showOptionDialog(GUI.indexingCorpusMessage, \"Indexing corpus please wait\", \"Indexing Corpus\", javax.swing.JOptionPane.DEFAULT_OPTION, javax.swing.JOptionPane.INFORMATION_MESSAGE, null, null, null);\n GUI.JListModel.clear();\n GUI.ResultsLabel.setText(\"Indexing\");\n startIndexing(Paths.get(subqueries[1]), 0);\n GUI.SearchBarTextField.setText(\"Enter a new search or 'q' to exit\");\n\n return true;\n }\n return false;\n }",
"public Query() {\n\n// oriToRwt = new HashMap();\n// oriToRwt.put(); // TODO\n }",
"public abstract DatabaseQuery createDatabaseQuery(ParseTreeContext context);",
"public SPARQLBooleanXMLParser() {\n\t\tsuper();\n\t}",
"public static QueryInterface createQuery() {\n return new XmlQuery();\n }",
"public void Save() throws Exception {\n\t\tTriple triple;\n\t\tsuper.rootRDFSave();\n\t\t\n\t\tMap<Triple, String> saveData = new HashMap<Triple, String>();\n\t\t\n\t\tif(personURI != null) {\n\t\t\ttriple = new Triple(getURI(), \"qc:appliedBy\", personURI);\n\t\t\tsaveData.put(triple, \"Object\");\n//\t\t\tSparqlEndPoint.insertTriple(triple);\n\t\t}\n\t\t\n\t\tif(jobURI != null) {\n\t\t\ttriple = new Triple(getURI(), \"qc:appliedFor\", jobURI);\n\t\t\tsaveData.put(triple, \"Object\");\n//\t\t\tSparqlEndPoint.insertTriple(triple);\n\t\t\tJobPosting jp = JobPosting.getJobPosting(jobURI);\n\t\t\tjp.apply(this);\n\t\t\tjp.Save();\n\t\t}\n\t\t\n\t\tif(expectedSalary != null) {\n\t\t\ttriple = new Triple(getURI(), \"qc:hasExpectedSalary\", expectedSalary);\n\t\t\tsaveData.put(triple, \"String\");\n//\t\t\tSparqlEndPoint.insertPropertyValue(triple);\n\t\t}\n\t\t\n\t\tif(availableAt != null) {\n\t\t\ttriple = new Triple(getURI(), \"qc:isAvailableAt\", availableAt);\n\t\t\tsaveData.put(triple, \"String\");\n//\t\t\tSparqlEndPoint.insertPropertyValue(triple);\n\t\t}\n\t\t\n\t\tif(salaryCurrency != null) {\n\t triple = new Triple(getURI(), \"qc:expectedSalaryCurrency\", salaryCurrency);\n\t saveData.put(triple, \"String\");\n//\t SparqlEndPoint.insertPropertyValue(triple);\n }\n\t\t\n\t\tSparqlEndPoint.insertTriples(saveData);\n\t}",
"public void gerarRDF(Dataset dataset) throws SenseRDFException;",
"ch.crif_online.www.webservices.crifsoapservice.v1_00.PublicationList addNewPublicationList();",
"public abstract Query<T> setQuery(String oql);",
"public org.apache.xmlbeans.XmlAnySimpleType addNewSearchTerms()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlAnySimpleType target = null;\n target = (org.apache.xmlbeans.XmlAnySimpleType)get_store().add_attribute_user(SEARCHTERMS$6);\n return target;\n }\n }",
"protected Query newGraphSynonymQuery(Iterator<Query> queries) {\n BooleanQuery.Builder builder = new BooleanQuery.Builder();\n while (queries.hasNext()) {\n builder.add(queries.next(), BooleanClause.Occur.SHOULD);\n }\n BooleanQuery bq = builder.build();\n if (bq.clauses().size() == 1) {\n return bq.clauses().get(0).getQuery();\n }\n return bq;\n }",
"public SPARQLQuerying(@NonNull SPARQLQueryingDelegate delegate) {\n this.delegate = delegate;\n }",
"EQLDecomposition createEQLDecomposition();",
"private InputStream runSparqlQuery(String query) throws IOException {\n\t\ttry {\n\t\t\tString queryString = \"query=\" + URLEncoder.encode(query, \"UTF-8\")\n\t\t\t\t\t+ \"&format=json\";\n\t\t\tURL url = new URL(\"https://query.wikidata.org/sparql?\"\n\t\t\t\t\t+ queryString);\n\t\t\tHttpURLConnection connection = (HttpURLConnection) url\n\t\t\t\t\t.openConnection();\n\t\t\tconnection.setRequestMethod(\"GET\");\n\n\t\t\treturn connection.getInputStream();\n\t\t} catch (UnsupportedEncodingException | MalformedURLException e) {\n\t\t\tthrow new RuntimeException(e.getMessage(), e);\n\t\t}\n\t}",
"ShippingDocument createShippingDocument();"
] | [
"0.61610156",
"0.6121742",
"0.60562915",
"0.57344806",
"0.5673968",
"0.5611922",
"0.561006",
"0.55941236",
"0.5499227",
"0.5481994",
"0.5404786",
"0.5367294",
"0.53657734",
"0.5356505",
"0.5316394",
"0.52740085",
"0.526882",
"0.5238063",
"0.5216489",
"0.5187307",
"0.5186428",
"0.5180372",
"0.5166072",
"0.51515394",
"0.5116653",
"0.5090693",
"0.5090571",
"0.50790703",
"0.5058425",
"0.50443393",
"0.50131106",
"0.4995069",
"0.49857694",
"0.4973898",
"0.49464825",
"0.49394602",
"0.49103907",
"0.49088916",
"0.4908649",
"0.49014282",
"0.49014282",
"0.49014282",
"0.48914298",
"0.48910543",
"0.48633787",
"0.48622096",
"0.48616183",
"0.48611462",
"0.48558223",
"0.48439357",
"0.48372734",
"0.48360446",
"0.4829988",
"0.4817952",
"0.48099467",
"0.4803943",
"0.47955167",
"0.4791993",
"0.47851735",
"0.4781293",
"0.47802004",
"0.47790617",
"0.4778124",
"0.47578037",
"0.47534534",
"0.47476766",
"0.4747584",
"0.47453547",
"0.47394538",
"0.473264",
"0.4725416",
"0.47214115",
"0.4706054",
"0.47055426",
"0.46956506",
"0.46907964",
"0.46881124",
"0.4678462",
"0.46727434",
"0.46665925",
"0.46622556",
"0.46615463",
"0.46553236",
"0.4644407",
"0.46443856",
"0.46348748",
"0.46240738",
"0.4618131",
"0.46177977",
"0.46176443",
"0.46156913",
"0.46140286",
"0.46113172",
"0.46091726",
"0.46016422",
"0.4596008",
"0.4592165",
"0.45888337",
"0.45858467",
"0.45832533"
] | 0.5657449 | 5 |
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor. | @SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
sparqlQuery = new javax.swing.JTextArea();
jScrollPane2 = new javax.swing.JScrollPane();
sparqlAnswer = new javax.swing.JTextArea();
label1 = new java.awt.Label();
label2 = new java.awt.Label();
sparqlStart = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setName("Form"); // NOI18N
jScrollPane1.setName("jScrollPane1"); // NOI18N
sparqlQuery.setColumns(20);
sparqlQuery.setRows(5);
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(GUI.OntoBeefApplication.class).getContext().getResourceMap(SPARQL.class);
sparqlQuery.setText(resourceMap.getString("sparqlQuery.text")); // NOI18N
sparqlQuery.setName("sparqlQuery"); // NOI18N
jScrollPane1.setViewportView(sparqlQuery);
jScrollPane2.setName("jScrollPane2"); // NOI18N
sparqlAnswer.setColumns(20);
sparqlAnswer.setRows(5);
sparqlAnswer.setName("sparqlAnswer"); // NOI18N
jScrollPane2.setViewportView(sparqlAnswer);
label1.setName("label1"); // NOI18N
label1.setText(resourceMap.getString("label1.text")); // NOI18N
label2.setName("label2"); // NOI18N
label2.setText(resourceMap.getString("label2.text")); // NOI18N
sparqlStart.setText(resourceMap.getString("sparqlStart.text")); // NOI18N
sparqlStart.setName("sparqlStart"); // NOI18N
sparqlStart.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
sparqlStartActionPerformed(evt);
}
});
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(label2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(label1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jScrollPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 824, Short.MAX_VALUE))
.addContainerGap())
.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
.add(sparqlStart)
.add(380, 380, 380)))
.add(layout.createSequentialGroup()
.add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 824, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap())))
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(9, 9, 9)
.add(label1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(2, 2, 2)
.add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 99, Short.MAX_VALUE)
.add(26, 26, 26)
.add(sparqlStart)
.add(19, 19, 19)
.add(label2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 240, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(28, 28, 28))
);
pack();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Form() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public frmRectangulo() {\n initComponents();\n }",
"public form() {\n initComponents();\n }",
"public AdjointForm() {\n initComponents();\n setDefaultCloseOperation(HIDE_ON_CLOSE);\n }",
"public FormListRemarking() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n \n }",
"public FormPemilihan() {\n initComponents();\n }",
"public GUIForm() { \n initComponents();\n }",
"public FrameForm() {\n initComponents();\n }",
"public TorneoForm() {\n initComponents();\n }",
"public FormCompra() {\n initComponents();\n }",
"public muveletek() {\n initComponents();\n }",
"public Interfax_D() {\n initComponents();\n }",
"public quanlixe_form() {\n initComponents();\n }",
"public SettingsForm() {\n initComponents();\n }",
"public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\n }",
"public Soru1() {\n initComponents();\n }",
"public FMainForm() {\n initComponents();\n this.setResizable(false);\n setLocationRelativeTo(null);\n }",
"public soal2GUI() {\n initComponents();\n }",
"public EindopdrachtGUI() {\n initComponents();\n }",
"public MechanicForm() {\n initComponents();\n }",
"public AddDocumentLineForm(java.awt.Frame parent) {\n super(parent);\n initComponents();\n myInit();\n }",
"public BloodDonationGUI() {\n initComponents();\n }",
"public quotaGUI() {\n initComponents();\n }",
"public Customer_Form() {\n initComponents();\n setSize(890,740);\n \n \n }",
"public PatientUI() {\n initComponents();\n }",
"public Oddeven() {\n initComponents();\n }",
"public Magasin() {\n initComponents();\n }",
"public myForm() {\n\t\t\tinitComponents();\n\t\t}",
"public intrebarea() {\n initComponents();\n }",
"public RadioUI()\n {\n initComponents();\n }",
"public NewCustomerGUI() {\n initComponents();\n }",
"public ZobrazUdalost() {\n initComponents();\n }",
"public FormUtama() {\n initComponents();\n }",
"public p0() {\n initComponents();\n }",
"public INFORMACION() {\n initComponents();\n this.setLocationRelativeTo(null); \n }",
"public ProgramForm() {\n setLookAndFeel();\n initComponents();\n }",
"public AmountReleasedCommentsForm() {\r\n initComponents();\r\n }",
"public form2() {\n initComponents();\n }",
"public MainForm() {\n\t\tsuper(\"Hospital\", List.IMPLICIT);\n\n\t\tstartComponents();\n\t}",
"public kunde() {\n initComponents();\n }",
"public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n setRequestFocusEnabled(false);\n setVerifyInputWhenFocusTarget(false);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 465, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 357, Short.MAX_VALUE)\n );\n }",
"public MusteriEkle() {\n initComponents();\n }",
"public frmMain() {\n initComponents();\n }",
"public frmMain() {\n initComponents();\n }",
"public DESHBORDPANAL() {\n initComponents();\n }",
"public frmVenda() {\n initComponents();\n }",
"public GUIForm() {\n initComponents();\n inputField.setText(NO_FILE_SELECTED);\n outputField.setText(NO_FILE_SELECTED);\n progressLabel.setBackground(INFO);\n progressLabel.setText(SELECT_FILE);\n }",
"public Botonera() {\n initComponents();\n }",
"public FrmMenu() {\n initComponents();\n }",
"public OffertoryGUI() {\n initComponents();\n setTypes();\n }",
"public JFFornecedores() {\n initComponents();\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(255, 255, 255));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 983, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 769, Short.MAX_VALUE)\n );\n\n pack();\n }",
"public vpemesanan1() {\n initComponents();\n }",
"public EnterDetailsGUI() {\n initComponents();\n }",
"public Kost() {\n initComponents();\n }",
"public FormHorarioSSE() {\n initComponents();\n }",
"public frmacceso() {\n initComponents();\n }",
"public HW3() {\n initComponents();\n }",
"public UploadForm() {\n initComponents();\n }",
"public Managing_Staff_Main_Form() {\n initComponents();\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n pack();\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }",
"public sinavlar2() {\n initComponents();\n }",
"public P0405() {\n initComponents();\n }",
"public MiFrame2() {\n initComponents();\n }",
"public IssueBookForm() {\n initComponents();\n }",
"public Choose1() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n\n String oldAuthor = prefs.get(\"AUTHOR\", \"\");\n if(oldAuthor != null) {\n this.authorTextField.setText(oldAuthor);\n }\n String oldBook = prefs.get(\"BOOK\", \"\");\n if(oldBook != null) {\n this.bookTextField.setText(oldBook);\n }\n String oldDisc = prefs.get(\"DISC\", \"\");\n if(oldDisc != null) {\n try {\n int oldDiscNum = Integer.parseInt(oldDisc);\n oldDiscNum++;\n this.discNumberTextField.setText(Integer.toString(oldDiscNum));\n } catch (Exception ex) {\n this.discNumberTextField.setText(oldDisc);\n }\n this.bookTextField.setText(oldBook);\n }\n\n\n }",
"public GUI_StudentInfo() {\n initComponents();\n }",
"public Lihat_Dokter_Keseluruhan() {\n initComponents();\n }",
"public JFrmPrincipal() {\n initComponents();\n }",
"public bt526() {\n initComponents();\n }",
"public Pemilihan_Dokter() {\n initComponents();\n }",
"public Ablak() {\n initComponents();\n }",
"@Override\n\tprotected void initUi() {\n\t\t\n\t}",
"@SuppressWarnings(\"unchecked\")\n\t// <editor-fold defaultstate=\"collapsed\" desc=\"Generated\n\t// Code\">//GEN-BEGIN:initComponents\n\tprivate void initComponents() {\n\n\t\tlabel1 = new java.awt.Label();\n\t\tlabel2 = new java.awt.Label();\n\t\tlabel3 = new java.awt.Label();\n\t\tlabel4 = new java.awt.Label();\n\t\tlabel5 = new java.awt.Label();\n\t\tlabel6 = new java.awt.Label();\n\t\tlabel7 = new java.awt.Label();\n\t\tlabel8 = new java.awt.Label();\n\t\tlabel9 = new java.awt.Label();\n\t\tlabel10 = new java.awt.Label();\n\t\ttextField1 = new java.awt.TextField();\n\t\ttextField2 = new java.awt.TextField();\n\t\tlabel14 = new java.awt.Label();\n\t\tlabel15 = new java.awt.Label();\n\t\tlabel16 = new java.awt.Label();\n\t\ttextField3 = new java.awt.TextField();\n\t\ttextField4 = new java.awt.TextField();\n\t\ttextField5 = new java.awt.TextField();\n\t\tlabel17 = new java.awt.Label();\n\t\tlabel18 = new java.awt.Label();\n\t\tlabel19 = new java.awt.Label();\n\t\tlabel20 = new java.awt.Label();\n\t\tlabel21 = new java.awt.Label();\n\t\tlabel22 = new java.awt.Label();\n\t\ttextField6 = new java.awt.TextField();\n\t\ttextField7 = new java.awt.TextField();\n\t\ttextField8 = new java.awt.TextField();\n\t\tlabel23 = new java.awt.Label();\n\t\ttextField9 = new java.awt.TextField();\n\t\ttextField10 = new java.awt.TextField();\n\t\ttextField11 = new java.awt.TextField();\n\t\ttextField12 = new java.awt.TextField();\n\t\tlabel24 = new java.awt.Label();\n\t\tlabel25 = new java.awt.Label();\n\t\tlabel26 = new java.awt.Label();\n\t\tlabel27 = new java.awt.Label();\n\t\tlabel28 = new java.awt.Label();\n\t\tlabel30 = new java.awt.Label();\n\t\tlabel31 = new java.awt.Label();\n\t\tlabel32 = new java.awt.Label();\n\t\tjButton1 = new javax.swing.JButton();\n\n\t\tlabel1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel1.setText(\"It seems that some of the buttons on the ATM machine are not working!\");\n\n\t\tlabel2.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel2.setText(\"Unfortunately these numbers are exactly what Professor has to use to type in his password.\");\n\n\t\tlabel3.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel3.setText(\n\t\t\t\t\"If you want to eat tonight, you have to help him out and construct the numbers of the password with the working buttons and math operators.\");\n\n\t\tlabel4.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tlabel4.setText(\"Denver's Password: 2792\");\n\n\t\tlabel5.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel5.setText(\"import java.util.Scanner;\\n\");\n\n\t\tlabel6.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel6.setText(\"public class ATM{\");\n\n\t\tlabel7.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel7.setText(\"public static void main(String[] args){\");\n\n\t\tlabel8.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel8.setText(\"System.out.print(\");\n\n\t\tlabel9.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel9.setText(\" -\");\n\n\t\tlabel10.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel10.setText(\");\");\n\n\t\ttextField1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttextField1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tlabel14.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel14.setText(\"System.out.print( (\");\n\n\t\tlabel15.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel15.setText(\"System.out.print(\");\n\n\t\tlabel16.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel16.setText(\"System.out.print( ( (\");\n\n\t\tlabel17.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel17.setText(\")\");\n\n\t\tlabel18.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel18.setText(\" +\");\n\n\t\tlabel19.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel19.setText(\");\");\n\n\t\tlabel20.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel20.setText(\" /\");\n\n\t\tlabel21.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel21.setText(\" %\");\n\n\t\tlabel22.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel22.setText(\" +\");\n\n\t\tlabel23.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel23.setText(\");\");\n\n\t\tlabel24.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel24.setText(\" +\");\n\n\t\tlabel25.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel25.setText(\" /\");\n\n\t\tlabel26.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel26.setText(\" *\");\n\n\t\tlabel27.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\t\tlabel27.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel27.setText(\")\");\n\n\t\tlabel28.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel28.setText(\")\");\n\n\t\tlabel30.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel30.setText(\"}\");\n\n\t\tlabel31.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel31.setText(\"}\");\n\n\t\tlabel32.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel32.setText(\");\");\n\n\t\tjButton1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tjButton1.setText(\"Check\");\n\t\tjButton1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\tjButton1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n\t\tlayout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(28).addGroup(layout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING).addComponent(getDoneButton()).addComponent(jButton1)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, 774, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addGap(92).addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15, GroupLayout.PREFERRED_SIZE, 145,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(37))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(174)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(7)))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label23, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20).addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(23).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16, GroupLayout.PREFERRED_SIZE, 177,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createParallelGroup(Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap()\n\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup().addGroup(layout.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(19)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(78)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(76)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(75)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(27))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel23,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(29)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))))\n\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t.addGap(30)\n\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(25)\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(26).addComponent(jButton1).addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(getDoneButton()).addContainerGap(23, Short.MAX_VALUE)));\n\t\tthis.setLayout(layout);\n\n\t\tlabel16.getAccessibleContext().setAccessibleName(\"System.out.print( ( (\");\n\t\tlabel17.getAccessibleContext().setAccessibleName(\"\");\n\t\tlabel18.getAccessibleContext().setAccessibleName(\" +\");\n\t}",
"public Pregunta23() {\n initComponents();\n }",
"public FormMenuUser() {\n super(\"Form Menu User\");\n initComponents();\n }",
"public AvtekOkno() {\n initComponents();\n }",
"public busdet() {\n initComponents();\n }",
"public ViewPrescriptionForm() {\n initComponents();\n }",
"public Ventaform() {\n initComponents();\n }",
"public Kuis2() {\n initComponents();\n }",
"public POS1() {\n initComponents();\n }",
"public CreateAccount_GUI() {\n initComponents();\n }",
"public Carrera() {\n initComponents();\n }",
"public EqGUI() {\n initComponents();\n }",
"public JFriau() {\n initComponents();\n this.setLocationRelativeTo(null);\n this.setTitle(\"BuNus - Budaya Nusantara\");\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setBackground(new java.awt.Color(204, 204, 204));\n setMinimumSize(new java.awt.Dimension(1, 1));\n setPreferredSize(new java.awt.Dimension(760, 402));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 750, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n }",
"public nokno() {\n initComponents();\n }",
"public dokter() {\n initComponents();\n }",
"public ConverterGUI() {\n initComponents();\n }",
"public hitungan() {\n initComponents();\n }",
"public Modify() {\n initComponents();\n }",
"public frmAddIncidencias() {\n initComponents();\n }",
"public CovidGUI(){\n initComponents();\n }"
] | [
"0.73197734",
"0.72908777",
"0.72908777",
"0.72908777",
"0.72870827",
"0.7248368",
"0.7213462",
"0.7208004",
"0.7195763",
"0.7189973",
"0.7184436",
"0.7159332",
"0.71478266",
"0.709268",
"0.7080727",
"0.7057287",
"0.6986775",
"0.6977119",
"0.69554067",
"0.69548035",
"0.6945748",
"0.69436246",
"0.6936225",
"0.69309264",
"0.6927764",
"0.6925464",
"0.69240505",
"0.6911828",
"0.69114214",
"0.6893614",
"0.68917346",
"0.6891525",
"0.6891501",
"0.6889125",
"0.68829834",
"0.6882533",
"0.68808794",
"0.687905",
"0.687687",
"0.68740726",
"0.68708014",
"0.68595254",
"0.68561274",
"0.68560076",
"0.6854643",
"0.6854604",
"0.6853724",
"0.685311",
"0.685311",
"0.6844816",
"0.6836794",
"0.6835743",
"0.68294543",
"0.6828841",
"0.682637",
"0.68245006",
"0.6823792",
"0.68175477",
"0.6817179",
"0.6811031",
"0.68096155",
"0.6809008",
"0.68087083",
"0.68081945",
"0.6801884",
"0.6795609",
"0.6793828",
"0.67930275",
"0.67915165",
"0.6789997",
"0.6788734",
"0.6788487",
"0.67816335",
"0.67663425",
"0.6765744",
"0.67648494",
"0.6757314",
"0.6755897",
"0.67526966",
"0.6750367",
"0.67429197",
"0.67399955",
"0.6736908",
"0.6736084",
"0.6734342",
"0.6726562",
"0.67264515",
"0.67205596",
"0.6716381",
"0.67154187",
"0.67150515",
"0.6709329",
"0.6708348",
"0.67050624",
"0.67021835",
"0.6700595",
"0.6699073",
"0.6698866",
"0.66942847",
"0.6690904",
"0.66897583"
] | 0.0 | -1 |
/ renamed from: a | public final String mo62918a(Context context) {
C0032h.m44b(context, "context");
if (C5203i.f3650c != null) {
String a = C5203i.f3650c;
if (a == null) {
C0032h.m40a();
}
return a;
}
SynchronousQueue synchronousQueue = new SynchronousQueue();
new Handler(Looper.getMainLooper()).post(new C5205a(context, synchronousQueue));
C5203i.f3650c = (String) synchronousQueue.take();
String a2 = C5203i.f3650c;
if (a2 == null) {
C0032h.m40a();
}
return a2;
} | {
"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 from: a */\n void mo85415a(String str);\n }",
"interface C10331b {\n /* renamed from: a */\n void mo26876a(int i);\n }",
"public interface C0779a {\n /* renamed from: a */\n void mo2311a();\n}",
"public interface C6788a {\n /* renamed from: a */\n void mo20141a();\n }",
"public interface C0237a {\n /* renamed from: a */\n void mo1791a(String str);\n }",
"public interface C35013b {\n /* renamed from: a */\n void mo88773a(int i);\n}",
"public interface C11112n {\n /* renamed from: a */\n void mo38026a();\n }",
"@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}",
"public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }",
"interface C0312e {\n /* renamed from: a */\n void mo4671a(View view, int i, int i2, int i3, int i4);\n }",
"public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }",
"public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }",
"private String convertir(String a) {\n StringBuilder atributo = new StringBuilder(a);\n atributo.insert(0, Character.toUpperCase(atributo.charAt(0)));\n return atributo.deleteCharAt(1).toString();\n }",
"protected m a(String name) {\n/* 42 */ return this.a.get(name);\n/* */ }",
"public interface AbstractC23925a {\n /* renamed from: a */\n void mo105476a();\n }",
"private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }",
"public interface C3598a {\n /* renamed from: a */\n void mo11024a(int i, int i2, String str);\n }",
"public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}",
"public interface am extends ak {\r\n /* renamed from: a */\r\n void mo194a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo195a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo196b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo197b(boolean z);\r\n\r\n /* renamed from: c */\r\n void mo198c(boolean z) throws RemoteException;\r\n\r\n /* renamed from: g */\r\n float mo199g() throws RemoteException;\r\n\r\n /* renamed from: h */\r\n int mo200h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n List<LatLng> mo201i() throws RemoteException;\r\n\r\n /* renamed from: j */\r\n boolean mo202j();\r\n\r\n /* renamed from: k */\r\n boolean mo203k();\r\n}",
"public interface C32459e<T> {\n /* renamed from: a */\n void mo83698a(T t);\n }",
"public interface C32458d<T> {\n /* renamed from: a */\n void mo83695a(T t);\n }",
"public interface C5482b {\n /* renamed from: a */\n void mo27575a();\n\n /* renamed from: a */\n void mo27576a(int i);\n }",
"public interface C27084a {\n /* renamed from: a */\n void mo69874a();\n\n /* renamed from: a */\n void mo69875a(List<Aweme> list, boolean z);\n }",
"public void a() {\n ((a) this.a).a();\n }",
"public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }",
"public interface C13373b {\n /* renamed from: a */\n void mo32681a(String str, int i, boolean z);\n}",
"public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}",
"public interface AbstractC17367b {\n /* renamed from: a */\n void mo84655a();\n }",
"@Override\r\n\tpublic void a() {\n\t\t\r\n\t}",
"public interface C43270a {\n /* renamed from: a */\n void mo64942a(String str, long j, long j2);\n}",
"public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}",
"public interface C0087c {\n /* renamed from: a */\n String mo150a(String str);\n}",
"public interface C1529m {\n /* renamed from: a */\n void mo3767a(int i);\n\n /* renamed from: a */\n void mo3768a(String str);\n}",
"interface C4483e {\n /* renamed from: a */\n boolean mo34114a();\n}",
"public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}",
"public interface C10965j<T> {\n /* renamed from: a */\n T mo26439a();\n}",
"public interface C28772a {\n /* renamed from: a */\n View mo73990a(View view);\n }",
"@Override\n\tpublic void a() {\n\t\t\n\t}",
"public interface C8326b {\n /* renamed from: a */\n C8325a mo21498a(String str);\n\n /* renamed from: a */\n void mo21499a(C8325a aVar);\n}",
"void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}",
"public interface C2367a {\n /* renamed from: a */\n C2368d mo1698a();\n }",
"interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }",
"public interface C4211a {\n\n /* renamed from: com.iab.omid.library.oguryco.c.a$a */\n public interface C4212a {\n /* renamed from: a */\n void mo28760a(View view, C4211a aVar, JSONObject jSONObject);\n }\n\n /* renamed from: a */\n JSONObject mo28758a(View view);\n\n /* renamed from: a */\n void mo28759a(View view, JSONObject jSONObject, C4212a aVar, boolean z);\n}",
"public interface C4697a extends C5595at {\n /* renamed from: a */\n void mo12634a();\n\n /* renamed from: a */\n void mo12635a(String str);\n\n /* renamed from: a */\n void mo12636a(boolean z);\n\n /* renamed from: b */\n void mo12637b();\n\n /* renamed from: c */\n void mo12638c();\n }",
"public interface C4773c {\n /* renamed from: a */\n void m15858a(int i);\n\n /* renamed from: a */\n void m15859a(int i, int i2);\n\n /* renamed from: a */\n void m15860a(int i, int i2, int i3);\n\n /* renamed from: b */\n void m15861b(int i, int i2);\n}",
"public interface C4869f {\n /* renamed from: a */\n C4865b mo6249a();\n}",
"public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }",
"public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}",
"public interface C0601aq {\n /* renamed from: a */\n void mo9148a(int i, ArrayList<C0889x> arrayList);\n}",
"public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}",
"public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}",
"public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }",
"public interface C6178c {\n /* renamed from: a */\n Map<String, String> mo14888a();\n}",
"public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}",
"public interface C19045k {\n /* renamed from: a */\n void mo50368a(int i, Object obj);\n\n /* renamed from: b */\n void mo50369b(int i, Object obj);\n}",
"public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }",
"public interface C7720a {\n /* renamed from: a */\n long mo20406a();\n}",
"public String a()\r\n/* 25: */ {\r\n/* 26:171 */ return \"dig.\" + this.a;\r\n/* 27: */ }",
"public interface ayt {\n /* renamed from: a */\n int mo1635a(long j, List list);\n\n /* renamed from: a */\n long mo1636a(long j, alb alb);\n\n /* renamed from: a */\n void mo1637a();\n\n /* renamed from: a */\n void mo1638a(long j, long j2, List list, ayp ayp);\n\n /* renamed from: a */\n void mo1639a(ayl ayl);\n\n /* renamed from: a */\n boolean mo1640a(ayl ayl, boolean z, Exception exc, long j);\n}",
"public interface C24221b extends C28343z<C28318an> {\n /* renamed from: a */\n void mo62991a(int i);\n\n String aw_();\n\n /* renamed from: e */\n Aweme mo62993e();\n}",
"public interface C4051c {\n /* renamed from: a */\n boolean mo23707a();\n}",
"public interface C45112b {\n /* renamed from: a */\n List<C45111a> mo107674a(Integer num);\n\n /* renamed from: a */\n List<C45111a> mo107675a(Integer num, Integer num2);\n\n /* renamed from: a */\n void mo107676a(C45111a aVar);\n\n /* renamed from: b */\n void mo107677b(Integer num);\n\n /* renamed from: c */\n long mo107678c(Integer num);\n}",
"public void acionou(int a){\n\t\t\tb=a;\n\t\t}",
"public interface C44963i {\n /* renamed from: a */\n void mo63037a(int i, int i2);\n\n void aA_();\n\n /* renamed from: b */\n void mo63039b(int i, int i2);\n}",
"public interface C32457c<T> {\n /* renamed from: a */\n void mo83699a(T t, int i, int i2, String str);\n }",
"public interface C5861g {\n /* renamed from: a */\n void mo18320a(C7251a aVar);\n\n @Deprecated\n /* renamed from: a */\n void mo18321a(C7251a aVar, String str);\n\n /* renamed from: a */\n void mo18322a(C7252b bVar);\n\n /* renamed from: a */\n void mo18323a(C7253c cVar);\n\n /* renamed from: a */\n void mo18324a(C7260j jVar);\n}",
"public interface C0937a {\n /* renamed from: a */\n void mo3807a(C0985po[] poVarArr);\n }",
"public interface C8466a {\n /* renamed from: a */\n void mo25956a(int i);\n\n /* renamed from: a */\n void mo25957a(long j, long j2);\n }",
"public interface C39684b {\n /* renamed from: a */\n void mo98969a();\n\n /* renamed from: a */\n void mo98970a(C29296g gVar);\n\n /* renamed from: a */\n void mo98971a(C29296g gVar, int i);\n }",
"public interface C43470b {\n /* renamed from: a */\n void mo61496a(C43469a aVar, C43471c cVar);\n }",
"public interface AbstractC18255a {\n /* renamed from: a */\n void mo88521a();\n\n /* renamed from: a */\n void mo88522a(String str);\n\n /* renamed from: b */\n void mo88523b();\n\n /* renamed from: c */\n void mo88524c();\n }",
"public interface C1436d {\n /* renamed from: a */\n C1435c mo1754a(C1433a c1433a, C1434b c1434b);\n}",
"public interface C4150sl {\n /* renamed from: a */\n void mo15005a(C4143se seVar);\n}",
"public void a(nm paramnm)\r\n/* 28: */ {\r\n/* 29:45 */ paramnm.a(this);\r\n/* 30: */ }",
"public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }",
"public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }",
"public interface C39504az {\n /* renamed from: a */\n int mo98207a();\n\n /* renamed from: a */\n void mo98208a(boolean z);\n\n /* renamed from: b */\n int mo98209b();\n\n /* renamed from: c */\n int mo98355c();\n\n /* renamed from: d */\n int mo98356d();\n\n /* renamed from: e */\n int mo98357e();\n\n /* renamed from: f */\n int mo98358f();\n}",
"protected a<T> a(Tag.e<T> var0) {\n/* 80 */ Tag.a var1 = b(var0);\n/* 81 */ return new a<>(var1, this.c, \"vanilla\");\n/* */ }",
"public interface C35565a {\n /* renamed from: a */\n C45321i mo90380a();\n }",
"public interface C21298a {\n /* renamed from: a */\n void mo57275a();\n\n /* renamed from: a */\n void mo57276a(Exception exc);\n\n /* renamed from: b */\n void mo57277b();\n\n /* renamed from: c */\n void mo57278c();\n }",
"public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }",
"public interface C0456a {\n /* renamed from: a */\n void mo2090a(C0455b bVar);\n\n /* renamed from: a */\n boolean mo2091a(C0455b bVar, Menu menu);\n\n /* renamed from: a */\n boolean mo2092a(C0455b bVar, MenuItem menuItem);\n\n /* renamed from: b */\n boolean mo2093b(C0455b bVar, Menu menu);\n }",
"public interface C4724o {\n /* renamed from: a */\n void mo4872a(int i, String str);\n\n /* renamed from: a */\n void mo4873a(C4718l c4718l);\n\n /* renamed from: b */\n void mo4874b(C4718l c4718l);\n}",
"public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }",
"public interface C2603a {\n /* renamed from: a */\n String mo1889a(String str, String str2, String str3, String str4);\n }",
"public interface afp {\n /* renamed from: a */\n C0512sx mo169a(C0497si siVar, afj afj, afr afr, Context context);\n}",
"public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}",
"public interface a {\n\n /* renamed from: c.b.a.c.b.b.a$a reason: collision with other inner class name */\n /* compiled from: DiskCache */\n public interface C0054a {\n a build();\n }\n\n /* compiled from: DiskCache */\n public interface b {\n boolean a(File file);\n }\n\n File a(c cVar);\n\n void a(c cVar, b bVar);\n}",
"public interface C0940d {\n /* renamed from: a */\n void mo3305a(boolean z);\n }",
"public interface AbstractC17368c {\n /* renamed from: a */\n void mo84656a(float f);\n }",
"interface C0932a {\n /* renamed from: a */\n void mo7438a(int i, int i2);\n\n /* renamed from: b */\n void mo7439b(C0933b bVar);\n\n /* renamed from: c */\n void mo7440c(int i, int i2, Object obj);\n\n /* renamed from: d */\n void mo7441d(C0933b bVar);\n\n /* renamed from: e */\n RecyclerView.ViewHolder mo7442e(int i);\n\n /* renamed from: f */\n void mo7443f(int i, int i2);\n\n /* renamed from: g */\n void mo7444g(int i, int i2);\n\n /* renamed from: h */\n void mo7445h(int i, int i2);\n }",
"public interface C10330c {\n /* renamed from: a */\n C7562b<C10403b, C10328a> mo25041a();\n}",
"public interface C3819a {\n /* renamed from: a */\n void mo23214a(Message message);\n }",
"private Proof atoAImpl(Expression a) {\n Proof where = axm2(a, arrow(a, a), a); //a->(a->a) -> (a->(a->a)->a) -> (a -> a)\n Proof one = axm1(a, a); //a->a->a\n Proof two = axm1(a, arrow(a, a)); //a->(a->a)->A\n return mpTwice(where, one, two);\n }",
"interface C1939a {\n /* renamed from: a */\n Bitmap mo1406a(Bitmap bitmap, float f);\n}",
"public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }",
"public b[] a() {\n/* 95 */ return this.a;\n/* */ }",
"interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }"
] | [
"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.5794689",
"0.57890314",
"0.57838726",
"0.5775679",
"0.57694733",
"0.5769128",
"0.57526815",
"0.56907034",
"0.5677874",
"0.5670547",
"0.56666386",
"0.56592244",
"0.5658682",
"0.56574154",
"0.5654324",
"0.5644676",
"0.56399715",
"0.5638734",
"0.5630582",
"0.56183887",
"0.5615435",
"0.56069666",
"0.5605207",
"0.56005067",
"0.559501",
"0.55910283",
"0.5590222",
"0.55736613",
"0.5556682",
"0.5554544",
"0.5550076",
"0.55493855",
"0.55446684",
"0.5538079",
"0.5529058",
"0.5528109",
"0.552641",
"0.5525864",
"0.552186",
"0.5519972",
"0.5509587",
"0.5507195",
"0.54881203",
"0.5485328",
"0.54826045",
"0.5482066",
"0.5481586",
"0.5479751",
"0.54776895",
"0.54671466",
"0.5463307",
"0.54505056",
"0.54436916",
"0.5440517",
"0.5439747",
"0.5431944",
"0.5422869",
"0.54217863",
"0.5417556",
"0.5403905",
"0.5400223",
"0.53998446",
"0.5394735",
"0.5388649",
"0.5388258",
"0.5374842",
"0.5368887",
"0.53591394",
"0.5357029",
"0.5355688",
"0.535506",
"0.5355034",
"0.53494394",
"0.5341044",
"0.5326166",
"0.53236824",
"0.53199095",
"0.53177035",
"0.53112453",
"0.5298229"
] | 0.0 | -1 |
Called when the activity is first created. | @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.pzp);
ctx = getApplicationContext();
PlatformInit.init(this);
initUI();
uiThread = viewHandler.getLooper().getThread().getId();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t\tinit();\n\t}",
"@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t}",
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}",
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}",
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}",
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}",
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}",
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}",
"@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n }",
"@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n }",
"@Override\n public void onCreate() {\n super.onCreate();\n initData();\n }",
"@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n\n }",
"@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n\n }",
"protected void onCreate() {\n }",
"@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tLog.e(TAG, \"onActivityCreated-------\");\r\n\t}",
"@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tLog.e(TAG, \"onActivityCreated-------\");\r\n\t}",
"@Override\n\tpublic void onActivityCreated(Bundle arg0) {\n\t\tsuper.onActivityCreated(arg0);\n\t}",
"@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tinitData(savedInstanceState);\r\n\t}",
"@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\t\r\n\t\tinitView();\r\n\t}",
"@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tsetview();\r\n\t}",
"@Override\n public void onCreate()\n {\n\n super.onCreate();\n }",
"@Override\n public void onCreate() {\n initData();\n }",
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tLogUtil.d(TAG, \"onActivityCreated---------\");\n\t\tinitData(savedInstanceState);\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}",
"@Override\n public void onCreate() {\n super.onCreate();\n }",
"@Override\n public void onCreate() {\n super.onCreate();\n }",
"@Override\n\tpublic void onActivityCreated(@Nullable Bundle savedInstanceState) {\n\t\tinitView();\n\t\tinitListener();\n\t\tinitData();\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}",
"@Override\n public void onCreate() {\n L.d(\"onCreate is called\");\n super.onCreate();\n }",
"@Override\n\tpublic void onActivityCreated(Activity activity, Bundle savedInstanceState)\n\t{\n\t}",
"@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\n\t}",
"protected void onFirstTimeLaunched() {\n }",
"@Override\n public void onActivityCreated(@Nullable Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n initData(savedInstanceState);\n }",
"@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\t\n\t}",
"@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\t\n\t}",
"@Override\n public void onActivityCreated(Activity activity, Bundle bundle) {}",
"@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t}",
"@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t}",
"@Override\n public void onActivityCreated(Activity activity, Bundle bundle) {\n }",
"@Override\n public void onCreate() {\n }",
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t\tsetupTextviews();\n\t\tsetupHorizontalScrollViews();\n\t\tsetupHorizontalSelectors();\n\t\tsetupButtons();\n\t}",
"@Override\n public void onCreate() {\n\n }",
"@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\t\r\n\t\tinitViewPager();\r\n\t\t\r\n\t\tinitView();\r\n\r\n\t\tinitCursor();\r\n\t\t\r\n\t\tinithuanxin(savedInstanceState);\r\n\t\r\n \r\n\t}",
"public void onCreate() {\n }",
"@Override\n\tpublic void onCreate() {\n\t\tLog.i(TAG, \"onCreate\");\n\t\tsuper.onCreate();\n\t}",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n init();\n }",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsetContentView(R.layout.caifushi_record);\n\t\tsuper.onCreate(savedInstanceState);\n\t\tinitview();\n\t\tMyApplication.getInstance().addActivity(this);\n\t\t\n\t}",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.activity_recent_activity);\n\t\tsetTitleFromActivityLabel(R.id.title_text);\n\t\tsetupStartUp();\n\t}",
"@Override\n\tpublic void onCreate() {\n\n\t}",
"@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\n\t\tgetLocation();\n\n\t\tregisterReceiver();\n\n\t}",
"@Override\n public void onActivityCreated(Activity activity, Bundle savedInstanceState) {\n eventManager.fire(Event.ACTIVITY_ON_CREATE, activity);\n }",
"@Override\n public void onCreate()\n {\n\n\n }",
"@Override\n\tprotected void onCreate() {\n\t}",
"@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tAnnotationProcessor.processActivity(this);\r\n\t}",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n if (!KramPreferences.hasStartedAppBefore(this)) {\n // First time app is started\n requestFirstHug();\n HugRequestService.scheduleHugRequests(this);\n KramPreferences.putHasStartedAppBefore(this);\n }\n\n setContentView(R.layout.activity_main);\n initMonthView(savedInstanceState);\n }",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.act_myinfo);\n\t\tinitView();\n\t\tinitEvents();\n\n\t}",
"public void onCreate();",
"public void onCreate();",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.auth_activity);\n connectVariablesToViews();\n listenToFields();\n WorkSpace.authorizationCompleted = false;\n }",
"@Override\n public void onCreate() {\n Log.d(TAG, TAG + \" onCreate\");\n }",
"@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) \r\n\t{\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\t\t\r\n\t\t// Get a reference to the tranistbuddy model.\r\n\t\tTransitBuddyApp app = (TransitBuddyApp)this.getApplicationContext();\r\n\t\tmModel = app.getTransitBuddyModel();\r\n\t\tmSettings = app.getTransitBuddySettings();\r\n\t\t\r\n\t\tsetTitle( getString(R.string.title_prefix) + \" \" + mSettings.getSelectedCity());\r\n\t}",
"@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tinit();\r\n\t}",
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n // Prepare the loader. Either re-connect with an existing one,\n // or start a new one.\n\t\tgetLoaderManager().initLoader(FORECAST_LOADER_ID, null, this);\n\t\tsuper.onActivityCreated(savedInstanceState); // From instructor correction\n\t}",
"@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\n\t\tDisplayMetrics dm = new DisplayMetrics();\n\t\tgetWindowManager().getDefaultDisplay().getMetrics(dm);\n\n\t\tintScreenX = dm.widthPixels;\n\t\tintScreenY = dm.heightPixels;\n\t\tscreenRect = new Rect(0, 0, intScreenX, intScreenY);\n\n\t\thideTheWindowTitle();\n\n\t\tSampleView view = new SampleView(this);\n\t\tsetContentView(view);\n\n\t\tsetupRecord();\n\t}",
"@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\tif (BuildConfig.DEBUG) {\n\t\t\tLogger.init(getClass().getSimpleName()).setLogLevel(LogLevel.FULL).hideThreadInfo();\n\t\t} else {\n\t\t\tLogger.init(getClass().getSimpleName()).setLogLevel(LogLevel.NONE).hideThreadInfo();\n\t\t}\n\t\tBaseApplication.totalList.add(this);\n\t}",
"@Override\n public void onActivityPreCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {/**/}",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n setupAddPotLaunch();\n setupListView();\n setupPotClick();\n }",
"public void onStart() {\n super.onStart();\n ApplicationStateMonitor.getInstance().activityStarted();\n }",
"@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\tcontext = getApplicationContext();\n\t\t\n\t\tApplicationContextUtils.init(context);\n\t}",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n\n }",
"@Override\n public void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n initArguments();\n }",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\t\t\n\t\tappManager = AppManager.getAppManager();\n\t\tappManager.addActivity(this);\n\t}",
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\n\t\tmContext = (LFActivity) getActivity();\n\t\tinit();\n\t}",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }",
"@Override\n\tprotected void onCreate(Bundle savedInstanceBundle)\n\t{\n\t\tsuper.onCreate(savedInstanceBundle);\n\t\tView initView = initView();\n\t\tsetBaseView(initView);\n\t\tinitValues();\n\t\tinitListeners();\n\t}",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.listexcursionscreen);\n\n ActionsDelegator.getInstance().synchronizeActionsWithServer(this);\n runId = PropertiesAdapter.getInstance(this).getCurrentRunId();\n\n RunDelegator.getInstance().loadRun(this, runId);\n ResponseDelegator.getInstance().synchronizeResponsesWithServer(this, runId);\n\n }",
"@Override\n\tprotected void onCreate() {\n\t\tSystem.out.println(\"onCreate\");\n\t}",
"@Override\n protected void onStart() {\n Log.i(\"G53MDP\", \"Main onStart\");\n super.onStart();\n }",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tAppManager.getInstance().addActivity(this);\n\t}",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n }",
"@Override\n\tpublic void onCreate() {\n\t\t// TODO Auto-generated method stub\n\t\tsuper.onCreate();\n\t}",
"@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t}",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.add_daily_task);\n init_database();\n init_view();\n init_click();\n init_data();\n init_picker();\n }",
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\t\n\t\tactivity = (MainActivity)getActivity(); \n\t\t\n\t\tactivity.setContListener(this);\n\t\t\n\t\tif(MODE == Const.MODE_DEFAULT){\n\t\t\tinitializeInfoForm();\n\t\t}else{\n\t\t\tinitializeAddEditForm();\t\t\t\n\t\t}\n\t\t\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}",
"@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t}",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\n\t\tinitView();\n\n\t\tinitData();\n\n\t\tinitEvent();\n\n\t\tinitAnimation();\n\n\t\tshowUp();\n\t}",
"@Override\n public void onCreate() {\n Thread.setDefaultUncaughtExceptionHandler(new TryMe());\n\n super.onCreate();\n\n // Write the content of the current application\n context = getApplicationContext();\n display = context.getResources().getDisplayMetrics();\n\n\n // Initializing DB\n App.databaseManager.initial(App.context);\n\n // Initialize user secret\n App.accountModule.initial();\n }",
"@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t}",
"@Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n\n super.onCreate(savedInstanceState);\n }"
] | [
"0.791686",
"0.77270156",
"0.7693263",
"0.7693263",
"0.7693263",
"0.7693263",
"0.7693263",
"0.7693263",
"0.7637394",
"0.7637394",
"0.7629958",
"0.76189965",
"0.76189965",
"0.7543775",
"0.7540053",
"0.7540053",
"0.7539505",
"0.75269467",
"0.75147736",
"0.7509639",
"0.7500879",
"0.74805456",
"0.7475343",
"0.7469598",
"0.7469598",
"0.7455178",
"0.743656",
"0.74256307",
"0.7422192",
"0.73934627",
"0.7370002",
"0.73569906",
"0.73569906",
"0.7353011",
"0.7347353",
"0.7347353",
"0.7333878",
"0.7311508",
"0.72663945",
"0.72612154",
"0.7252271",
"0.72419256",
"0.72131634",
"0.71865886",
"0.718271",
"0.71728176",
"0.7168954",
"0.7166841",
"0.71481615",
"0.7141478",
"0.7132933",
"0.71174103",
"0.7097966",
"0.70979583",
"0.7093163",
"0.7093163",
"0.7085773",
"0.7075851",
"0.7073558",
"0.70698684",
"0.7049258",
"0.704046",
"0.70370424",
"0.7013127",
"0.7005552",
"0.7004414",
"0.7004136",
"0.69996923",
"0.6995201",
"0.69904065",
"0.6988358",
"0.69834954",
"0.69820535",
"0.69820535",
"0.69820535",
"0.69820535",
"0.69820535",
"0.69820535",
"0.69820535",
"0.69820535",
"0.69820535",
"0.69820535",
"0.69820535",
"0.69820535",
"0.69820535",
"0.69783133",
"0.6977392",
"0.69668365",
"0.69660246",
"0.69651115",
"0.6962911",
"0.696241",
"0.6961096",
"0.69608897",
"0.6947069",
"0.6940148",
"0.69358927",
"0.6933102",
"0.6927288",
"0.69265485",
"0.69247025"
] | 0.0 | -1 |
Set Excel Download Header. | private void setExcelDownloadHeader(HttpServletResponse response, String fileName) {
// 设置response参数,可以打开下载页面
response.reset();
response.setContentType("application/vnd.ms-excel;charset=utf-8");
try {
response.setHeader("Content-Disposition", "attachment;filename=" + new String((fileName + ".xlsx").getBytes(), "iso-8859-1"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void xsetHeader(org.apache.xmlbeans.XmlString header);",
"private void writeColumnHeader() throws WriteException, IOException {\r\n WriteXLS.getInstance().writeColumnLabels();\r\n }",
"public void setPageHeader(String header)\n {\n // ignore\n }",
"void setHeader(java.lang.String header);",
"public void setHeader(String header) {\n\t\tthis.header = header;\n\t\tthis.handleConfig(\"header\", header);\n\t}",
"protected void updateHeader() {\n\t}",
"public ExcelSimpleWriter<?> header(List<String> titles) {\n this.titles = titles;\n return this;\n }",
"@Override\n public void setHeader(String arg0, String arg1) {\n\n }",
"public void setHeader(String header) {\n this.header = header;\n }",
"public void setHeader(String header) {\n\t\t_header = header;\n\t}",
"void setHeader(HttpServletResponse response, String name, String value);",
"public void setHeader(String header) {\n\t\tthis.header = header;\n\t}",
"@Override\n\tprotected void buildExcelDocument(Map<String, Object> model,\n\t\t\tHSSFWorkbook workbook, HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws Exception {\n\t\tDate date = new Date();\n\t\tString filename = Tools.date2Str(date, \"yyyyMMddHHmmss\");\n\t\tHSSFSheet sheet;\n\t\tHSSFCell cell;\n\t\tresponse.setContentType(\"application/octet-stream\");\n\t\tresponse.setHeader(\"Content-Disposition\", \"attachment;filename=\"+filename+\".xls\");\n\t\tsheet = workbook.createSheet(\"sheet1\");\n\t\t\n\t\t//第一行表头\n\t\tPageData pdHead = (PageData) model.get(\"pdHead\");\n\t\t//第二行标题\n\t\tList<String> titles = (List<String>) model.get(\"titles\");\n\t\tint row = 0;\n\t\t\n\t\tif(StringUtil.isNotEmpty(pdHead)) {\n\t\t\tHSSFCellStyle headerStyle = workbook.createCellStyle(); //标题样式\n\t\t\theaderStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);\n\t\t\theaderStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);\n\t\t\tHSSFFont headerFont = workbook.createFont();\t//标题字体\n\t\t\theaderFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);\n\t\t\theaderFont.setFontHeightInPoints((short)11);\n\t\t\theaderStyle.setFont(headerFont);\n\t\t\t\n\t\t\tCellRangeAddress region = new CellRangeAddress(row, row, (short) 0, (short) titles.size()); \n\t\t\t\n\t\t\tString title = pdHead.getString(\"name\");\n\t\t\tcell = getCell(sheet, row, 0);\n\t\t\tcell.setCellStyle(headerStyle);\n\t\t\tsetText(cell,title);\n\t\t\tshort height=25*18*2;\n\t\t\tsheet.getRow(row).setHeight(height);\n\t\t\tsheet.addMergedRegion(region);\n\t\t\t\n\t\t\trow = 1;\n\t\t}\n\t\t\n\t\t\n\t\tint len = titles.size();\n\t\tHSSFCellStyle headerStyle = workbook.createCellStyle(); //标题样式\n\t\theaderStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);\n\t\theaderStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);\n\t\tHSSFFont headerFont = workbook.createFont();\t//标题字体\n\t\theaderFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);\n\t\theaderFont.setFontHeightInPoints((short)11);\n\t\theaderStyle.setFont(headerFont);\n\t\tshort width = 20,height=25*20;\n\t\tsheet.setDefaultColumnWidth(width);\n\t\tfor(int i=0; i<len; i++){ //设置标题\n\t\t\tString title = titles.get(i);\n\t\t\tcell = getCell(sheet, row, i);\n\t\t\tcell.setCellStyle(headerStyle);\n\t\t\tsetText(cell,title);\n\t\t}\n\t\t\n\t\tsheet.getRow(row).setHeight(height);\n\t\t\n\t\tHSSFCellStyle contentStyle = workbook.createCellStyle(); //内容样式\n\t\tcontentStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);\n\t\tList<PageData> varList = (List<PageData>) model.get(\"varList\");\n\t\tint varCount = varList.size();\n\t\tfor(int i=0; i<varCount; i++){\n\t\t\trow++;\n\t\t\tPageData vpd = varList.get(i);\n\t\t\tfor(int j=0;j<len;j++){\n\t\t\t\tString varstr = vpd.get(\"var\"+(j+1)).toString() != null ? vpd.get(\"var\"+(j+1)).toString() : \"\";\n\n\n\t\t\t\tcell = getCell(sheet, row, j);\n\t\t\t\tcell.setCellStyle(contentStyle);\n\t\t\t\tsetText(cell,varstr);\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"@Override\n\tprotected String getHeaderTitle() {\n\t\treturn \"\";\n\t}",
"public void setColumnName(Vector header) {\r\n numberOfcolumns = header.size();\r\n columnNames = header;\r\n /**\r\n * create new column to handle status of row. You can hide or visible it by comment or not the line code follow.\r\n */\r\n //columnNames.add(\"RecordStatus\");\r\n }",
"public void setDateHeader(String header, long date)\n\t{\n\t\tif (httpServletResponse != null)\n\t\t{\n\t\t\thttpServletResponse.setDateHeader(header, date);\n\t\t}\n\t}",
"org.apache.xmlbeans.XmlString xgetHeader();",
"public void setHeader(String _header) {\n\t\tthis.header = _header;\n\t}",
"public void setAttachmentHeader(String filename)\n\t{\n\t\tsetHeader(\"Content-Disposition\", \"attachment\"\n\t\t\t\t+ ((!Strings.isEmpty(filename)) ? (\"; filename=\\\"\" + filename + \"\\\"\") : \"\"));\n\t}",
"protected void setColumnHeader(final BaseColumn modelColumn,\n final String header) {\n modelColumn.setHeader(header);\n final int iModelColumn = model.getExpandedColumns().indexOf(modelColumn);\n uiModel.getColumns().get(iModelColumn).getHeaderMetaData().get(0).setTitle(header);\n }",
"public static void header(String s) {\n\t\t// header2.set(s);\n\t}",
"private void createHeaders(WritableSheet sheet)\r\n\t\t\tthrows WriteException {\n\t\taddHeader(sheet, 0, 0, reportProperties.getProperty(\"header1\"));\r\n\t\taddHeader(sheet, 1, 0, reportProperties.getProperty(\"header2\"));\r\n\t\taddHeader(sheet, 2, 0, reportProperties.getProperty(\"header3\"));\r\n\t\taddHeader(sheet, 3, 0, reportProperties.getProperty(\"header4\"));\r\n\t\t\r\n\r\n\t}",
"void setHeader(String headerName, String headerValue);",
"public final void setTableHeader() {\n this.addColumn(java.util.ResourceBundle.\n getBundle(\"swt/client/module/game/resources/GameLogTableModel\").\n getString(\"column.date\"));\n this.addColumn(java.util.ResourceBundle.\n getBundle(\"swt/client/module/game/resources/GameLogTableModel\").\n getString(\"column.percent.solved\"));\n this.addColumn(java.util.ResourceBundle.\n getBundle(\"swt/client/module/game/resources/GameLogTableModel\").\n getString(\"column.log.type\"));\n }",
"public final void setMxSheet_HeaderStyle(xlsreport.proxies.MxCellStyle mxsheet_headerstyle)\r\n\t{\r\n\t\tsetMxSheet_HeaderStyle(getContext(), mxsheet_headerstyle);\r\n\t}",
"public void setColumnHeader(int columnIndex, String header) {\n\t\tcheckColumnIndex(columnIndex);\n\t\ttableViewer.getTable().getColumn(columnIndex).setText(header);\n\t}",
"public void setupDataTableHeader() {\r\n\t\tif (this.dataTableTabItem != null && !this.dataTableTabItem.isDisposed()) this.dataTableTabItem.setHeader();\r\n\t}",
"private void writeHEADER() throws IOException {\n\t\tmeta.compute_checksum();\n\t\tmeta.write();\n\t\t\n\t\t// We could also generate a non-aldus metafile :\n\t\t// writeClipboardHeader(meta);\n\t\t\n\t\t// Generate the standard header common to all metafiles.\n\t\thead.write();\n\t}",
"private void addHeaderForSummary(Workbook p_workBook, Sheet p_sheet)\n {\n int col = 0;\n int row = SUMMARY_HEADER_ROW;\n Row summaryHeaderRow = getRow(p_sheet, row);\n\n Cell cell_A = getCell(summaryHeaderRow, col);\n cell_A.setCellValue(m_bundle.getString(\"lb_company\"));\n cell_A.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n\n Cell cell_B = getCell(summaryHeaderRow, col);\n cell_B.setCellValue(m_bundle.getString(\"lb_job_id\"));\n cell_B.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n\n Cell cell_C = getCell(summaryHeaderRow, col);\n cell_C.setCellValue(m_bundle.getString(\"lb_job_name\"));\n cell_C.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 30 * 256);\n col++;\n\n Cell cell_D = getCell(summaryHeaderRow, col);\n cell_D.setCellValue(m_bundle.getString(\"lb_language\"));\n cell_D.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n\n Cell cell_E = getCell(summaryHeaderRow, col);\n cell_E.setCellValue(m_bundle.getString(\"lb_workflow_state\"));\n cell_E.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n\n Cell cell_F = getCell(summaryHeaderRow, col);\n cell_F.setCellValue(m_bundle.getString(\"lb_mt_word_count\"));\n cell_F.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n\n if (usePerplexity)\n {\n Cell cell = getCell(summaryHeaderRow, col);\n cell.setCellValue(m_bundle.getString(\"lb_perplexity_wordcount\"));\n cell.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n }\n\n Cell cell_G = getCell(summaryHeaderRow, col);\n cell_G.setCellValue(m_bundle.getString(\"lb_total_word_count\"));\n cell_G.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n\n Cell cell_H = getCell(summaryHeaderRow, col);\n cell_H.setCellValue(m_bundle.getString(\"lb_average_edit_distance\"));\n cell_H.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 30 * 256);\n col++;\n\n Cell cell_I = getCell(summaryHeaderRow, col);\n cell_I.setCellValue(m_bundle.getString(\"lb_translation_error_rate\"));\n cell_I.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n\n Cell cell_J = getCell(summaryHeaderRow, col);\n cell_J.setCellValue(m_bundle.getString(\"lb_engine_name\"));\n cell_J.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n }",
"public void setHeader(final Header header) {\n mHeader=header;\n updateFields();\n }",
"void setStockHeader(stockFilePT102.StockHeaderDocument.StockHeader stockHeader);",
"void setHeaderInfo(float rFree, float rWork, float resolution, String title, String depositionDate, \n\t\t\tString releaseDate, String[] experimnetalMethods);",
"public void setupHistoTableHeader() {\r\n\t\tif (this.histoTableTabItem != null && !this.histoTableTabItem.isDisposed()) this.histoTableTabItem.setHeader();\r\n\t}",
"public void setHeader(boolean isHeader) {\n this.isHeader = isHeader;\n }",
"public void generateGetHeader (\n HttpServletRequest request, HttpServletResponse response)\n throws IOException\n {\n BuildHtmlHeader(new PrintWriter (response.getOutputStream()), getTitle());\n }",
"@Override\n public void setHeader(String name, String value) {\n this._getHttpServletResponse().setHeader(name, value);\n }",
"private void rewriteRepHeader() {\r\n\t\t// assume that the value of headVersionNum has been \r\n\t\t// incremented before coming here\r\n\t\ttry {\r\n\t\t\t// 1. delete current header\r\n\t\t\tif (client==null) this.initAnnoteaClient();\r\n\t\t\tclient.delete(this.repHeaderLoc);\r\n\t\t\t// 2. post new header\r\n\t\t\tDescription header = new Description();\r\n\t\t\tURI[] headerURI = new URI[1];\r\n\t\t\theaderURI[0] = new URI(this.repositoryURI.toString() + \"#header\");\r\n\t\t\theader.setAnnotates(headerURI);\r\n\t\t\theader.setAuthor(this.repositoryAuthor);\r\n\t\t\theader.setCreated(this.reposityCreatedDate);\r\n\t\t\theader.setAnnotatedEntityDefinition(this.baseOntologyURI.toString());\r\n\t\t\theader.setBody(String.valueOf(this.headVersionNumber));\r\n\t\t\theader.setBodyType(\"text/html\");\r\n\t\t\theader.setAnnotationType(this.annotType);\r\n\t\t\t// 3. update new header location URL\r\n\t\t\trepHeaderLoc = client.post(header);\r\n\t\t\t// 4. update value in versionDescriptions array and update swoopModel' versionRepository\r\n\t\t\tthis.versionDescriptions[0] = header;\r\n\t\t\tswoopModel.updateVersionRepository(this.repositoryURI, versionDescriptions);\r\n\t\t}\r\n\t\tcatch (Exception ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t}\r\n\t}",
"@Override\n public void setDateHeader(String arg0, long arg1) {\n\n }",
"private void setBottomSheetHeader(View child) {\n if (child instanceof BottomSheetBehaviorView) {\n View view = child.findViewWithTag(BottomSheetHeaderView.TAG);\n if (view != null && view instanceof BottomSheetHeaderView) {\n BottomSheetBehaviorView b = (BottomSheetBehaviorView) child;\n RNBottomSheetBehavior behavior = b.behavior;\n headerView = (BottomSheetHeaderView) view;\n headerView.registerFields();\n headerView.toggle(behavior.getState() == RNBottomSheetBehavior.STATE_COLLAPSED);\n behavior.setHeader(headerView);\n }\n }\n }",
"@Override\n public void setHeaderIndices() {\n }",
"@Override\n public void setDateHeader(String name, long date) {\n this._getHttpServletResponse().setDateHeader(name, date);\n }",
"public void exportXLS() {\n\t\t// Create a Workbook\n\t\tWorkbook workbook = new HSSFWorkbook(); // new HSSFWorkbook() for\n\t\t\t\t\t\t\t\t\t\t\t\t// generating `.xls` file\n\n\t\t/*\n\t\t * CreationHelper helps us create instances of various things like DataFormat,\n\t\t * Hyperlink, RichTextString etc, in a format (HSSF, XSSF) independent way\n\t\t */\n\t\tCreationHelper createHelper = workbook.getCreationHelper();\n\n\t\t// Create a Sheet\n\t\tSheet sheet = workbook.createSheet(\"العقود\");\n\n\t\t// Create a Font for styling header cells\n\t\tFont headerFont = workbook.createFont();\n\t\theaderFont.setBold(true);\n\t\theaderFont.setFontHeightInPoints((short) 14);\n\t\theaderFont.setColor(IndexedColors.RED.getIndex());\n\n\t\t// Create a CellStyle with the font\n\t\tCellStyle headerCellStyle = workbook.createCellStyle();\n\t\theaderCellStyle.setFont(headerFont);\n\n\t\t// Create a Row\n\t\tRow headerRow = sheet.createRow(0);\n\n\t\tString[] columns = { \"الرقم\", \"رقم العقد \", \"تاريخ البداية\", \"تاريخ النهاية\", \"المستثمر\", \"حالة الفاتورة\" };\n\t\t// Create cells\n\t\tfor (int i = 0; i < columns.length; i++) {\n\t\t\tCell cell = headerRow.createCell(i);\n\t\t\tcell.setCellValue(columns[i]);\n\t\t\tcell.setCellStyle(headerCellStyle);\n\t\t}\n\n\t\t// Create Cell Style for formatting Date\n\t\tCellStyle dateCellStyle = workbook.createCellStyle();\n\t\tdateCellStyle.setDataFormat(createHelper.createDataFormat().getFormat(\"dd-MM-yyyy\"));\n\n\t\t// Create Other rows and cells with employees data\n\t\tint rowNum = 1;\n\t\tint num = 1;\n//\t\tfor (ContractDirect contObj : contractsDirectList) {\n//\t\t\tRow row = sheet.createRow(rowNum++);\n//\t\t\trow.createCell(0).setCellValue(num);\n//\t\t\trow.createCell(1).setCellValue(contObj.getContractNum());\n//\n//\t\t\tif (!tableHigriMode) {\n//\t\t\t\tCell date1 = row.createCell(2);\n//\t\t\t\tdate1.setCellValue(contObj.getStartContDate());\n//\t\t\t\tdate1.setCellStyle(dateCellStyle);\n//\t\t\t\tCell date2 = row.createCell(3);\n//\t\t\t\tdate2.setCellValue(contObj.getEndContDate());\n//\t\t\t\tdate2.setCellStyle(dateCellStyle);\n//\t\t\t} else {\n//\t\t\t\tCell date1 = row.createCell(2);\n//\t\t\t\tdate1.setCellValue(contObj.getStartDate());\n//\t\t\t\tdate1.setCellStyle(dateCellStyle);\n//\t\t\t\tCell date2 = row.createCell(3);\n//\t\t\t\tdate2.setCellValue(contObj.getEndDate());\n//\t\t\t\tdate2.setCellStyle(dateCellStyle);\n//\t\t\t}\n//\n//\t\t\tInvestor inv = (Investor) dataAccessService.findEntityById(Investor.class, contObj.getInvestorId());\n//\t\t\trow.createCell(4).setCellValue(inv.getName());\n//\t\t\trow.createCell(5).setCellValue(contObj.getPayStatusName());\n//\t\t\tnum++;\n//\t\t}\n\n\t\t// Resize all columns to fit the content size\n\t\tfor (int i = 0; i < columns.length; i++) {\n\t\t\tsheet.autoSizeColumn(i);\n\t\t}\n\n\t\t// Write the output to a file\n\n\t\ttry {\n\t\t\tString path = \"D:/العقود.xls\";\n\t\t\tFileOutputStream fileOut = new FileOutputStream(path);\n\t\t\tworkbook.write(fileOut);\n\t\t\tfileOut.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\ttry {\n\n\t\t\tworkbook.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// Closing the workbook\n\n\t}",
"public void setHeader() {\n tvHeader.setText(getResources().getString(R.string.text_skill));\n tvDots.setVisibility(View.INVISIBLE);\n }",
"@Override\n protected void buildExcelDocument(Map<String, Object> model, Workbook workbook,\n HttpServletRequest request, HttpServletResponse response) throws Exception {\n response.setHeader(\"Content-Disposition\", \"attachment; filename=\\\"Du Report.xls\\\"\");\n\n @SuppressWarnings(\"unchecked\")\n List<ReportByGroup> reportList = (List<ReportByGroup>) model.get(\"reportList\");\n\n String[] month = new String[] { \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\", \"January\",\n \"February\", \"March\" };\n\n // create excel xls sheet\n Sheet sheet = workbook.createSheet(\"Report Du Detail\");\n // sheet.setDefaultColumnWidth(12);\n\n // create style for header cells\n CellStyle style = workbook.createCellStyle();\n Font font = workbook.createFont();\n font.setFontName(\"Arial\");\n style.setFillForegroundColor(HSSFColor.BLUE.index);\n style.setFillPattern(FillPatternType.SOLID_FOREGROUND);\n style.setAlignment(HorizontalAlignment.CENTER);\n style.setWrapText(true);\n style.setBorderRight(BorderStyle.THIN);\n style.setRightBorderColor(IndexedColors.BLACK.getIndex());\n style.setBorderLeft(BorderStyle.THIN);\n style.setLeftBorderColor(IndexedColors.BLACK.getIndex());\n style.setBorderTop(BorderStyle.THIN);\n style.setTopBorderColor(IndexedColors.BLACK.getIndex());\n style.setBorderBottom(BorderStyle.THIN);\n style.setBottomBorderColor(IndexedColors.BLACK.getIndex());\n font.setBold(true);\n font.setColor(HSSFColor.WHITE.index);\n style.setFont(font);\n\n CellStyle style1 = workbook.createCellStyle();\n // style1.setAlignment(HorizontalAlignment.CENTER);\n // style1.setWrapText(true);\n style1.setBorderRight(BorderStyle.THIN);\n style1.setRightBorderColor(IndexedColors.BLACK.getIndex());\n style1.setBorderLeft(BorderStyle.THIN);\n style1.setLeftBorderColor(IndexedColors.BLACK.getIndex());\n style1.setBorderTop(BorderStyle.THIN);\n style1.setTopBorderColor(IndexedColors.BLACK.getIndex());\n style1.setBorderBottom(BorderStyle.THIN);\n style1.setBottomBorderColor(IndexedColors.BLACK.getIndex());\n // style1.setFont(font);\n\n // create header row\n Row header = sheet.createRow(0);\n Row header1 = sheet.createRow(1);\n Row header2 = sheet.createRow(2);\n\n header.createCell(0).setCellValue(\"STT\");\n header.getCell(0).setCellStyle(style);\n sheet.addMergedRegion(new CellRangeAddress(0, // first row (0-based)\n 2, // last row (0-based)\n 0, // first column (0-based)\n 0 // last column (0-based)\n ));\n header.createCell(1).setCellValue(\"Vị trí\");\n header.getCell(1).setCellStyle(style);\n sheet.addMergedRegion(new CellRangeAddress(0, // first row (0-based)\n 2, // last row (0-based)\n 1, // first column (0-based)\n 1 // last column (0-based)\n ));\n\n header.createCell(2).setCellValue(\"\");\n header.getCell(2).setCellStyle(style);\n sheet.addMergedRegion(new CellRangeAddress(0, // first row (0-based)\n 2, // last row (0-based)\n 2, // first column (0-based)\n 2 // last column (0-based)\n ));\n\n header.createCell(3).setCellValue(\"Số lượng đã tuyển trong tháng\");\n header.getCell(3).setCellStyle(style);\n sheet.addMergedRegion(new CellRangeAddress(0, // first row (0-based)\n 0, // last row (0-based)\n 3, // first column (0-based)\n 26 // last column (0-based)\n ));\n header.createCell(27).setCellValue(\"SL tuyển dụng \" + this.year);\n header.getCell(27).setCellStyle(style);\n sheet.addMergedRegion(new CellRangeAddress(0, // first row (0-based)\n 2, // last row (0-based)\n 27, // first column (0-based)\n 27 // last column (0-based)\n ));\n\n header1.createCell(0).setCellValue(\"\");\n header1.getCell(0).setCellStyle(style);\n header1.createCell(1).setCellValue(\"\");\n header1.getCell(1).setCellStyle(style);\n int k = 0;\n for (int i = 3; i < 27; i++) {\n if (i % 2 != 0) {\n header1.createCell(i).setCellValue(month[k++]);\n header1.getCell(i).setCellStyle(style);\n sheet.addMergedRegion(new CellRangeAddress(1, // first row (0-based)\n 1, // last row (0-based)\n i, // first column (0-based)\n i + 1 // last column (0-based)\n ));\n } else {\n header1.createCell(i).setCellValue(\"\");\n header1.getCell(i).setCellStyle(style);\n }\n }\n\n header2.createCell(0).setCellValue(\"\");\n header2.getCell(0).setCellStyle(style);\n header2.createCell(1).setCellValue(\"\");\n header2.getCell(1).setCellStyle(style);\n for (int i = 3; i < 27; i++) {\n if (i % 2 != 0) {\n header2.createCell(i).setCellValue(\"NEW\");\n header2.getCell(i).setCellStyle(style);\n } else {\n header2.createCell(i).setCellValue(\"TT\");\n header2.getCell(i).setCellStyle(style);\n }\n }\n\n int rowCount = 3;\n\n for (ReportByGroup item : reportList) {\n Row row = sheet.createRow(rowCount++);\n row.createCell(0).setCellValue(rowCount - 3);\n if (item.getDepartment() == null) {\n row.createCell(1).setCellValue(item.getGroup());\n } else {\n row.createCell(1).setCellValue(\"\");\n }\n row.createCell(2).setCellValue(item.getDepartment());\n int a = 3;\n for (StatisticMonth number : item.getStatisticMonth()) {\n if (number.getNumberOfNew() == 0) {\n row.createCell(a++).setCellValue(\"\");\n } else {\n row.createCell(a++).setCellValue(number.getNumberOfNew());\n }\n if (number.getNumberOfTT() == 0) {\n row.createCell(a++).setCellValue(\"\");\n } else {\n row.createCell(a++).setCellValue(number.getNumberOfTT());\n }\n }\n if (item.getTotal() == 0) {\n row.createCell(a).setCellValue(\"\");\n } else {\n row.createCell(a).setCellValue(item.getTotal());\n }\n\n for (int i = 0; i < 28; i++) {\n row.getCell(i).setCellStyle(style1);\n }\n }\n sheet.autoSizeColumn(0);\n sheet.autoSizeColumn(1);\n sheet.autoSizeColumn(2);\n sheet.autoSizeColumn(3);\n sheet.autoSizeColumn(4);\n sheet.autoSizeColumn(5);\n sheet.autoSizeColumn(6);\n sheet.autoSizeColumn(7);\n sheet.autoSizeColumn(8);\n sheet.autoSizeColumn(9);\n sheet.autoSizeColumn(10);\n sheet.autoSizeColumn(11);\n sheet.autoSizeColumn(12);\n sheet.autoSizeColumn(13);\n sheet.autoSizeColumn(14);\n sheet.autoSizeColumn(15);\n sheet.autoSizeColumn(16);\n sheet.autoSizeColumn(17);\n sheet.autoSizeColumn(18);\n sheet.autoSizeColumn(19);\n sheet.autoSizeColumn(20);\n sheet.autoSizeColumn(21);\n sheet.autoSizeColumn(22);\n sheet.autoSizeColumn(23);\n sheet.autoSizeColumn(24);\n sheet.autoSizeColumn(25);\n }",
"protected void initializeHeader() throws PiaRuntimeException, IOException{\n try{\n super.initializeHeader();\n if( firstLineOk && headersObj == null ){\n\t// someone just give us the first line\n\theadersObj = new Headers();\n }\n }catch(PiaRuntimeException e){\n throw e;\n }catch(IOException ioe){\n throw ioe;\n }\n }",
"public void setHeader(JMSControl.HeaderType type,Object value);",
"public void createHeader() throws DocumentException\n {\n createHeader(100f, Element.ALIGN_LEFT);\n }",
"public void setHeader1(TempTableHeader header1) { this.header1 = header1; }",
"public static void writeExcelHeader(XSSFSheet sheet, String[] title, int[] cloumnWidth) {\n\t\tfor (int i = 0; i < title.length; i++) {\n\t\t\tsetCell(sheet, title[i], 0, i);\n\t\t}\n\n\t\tfor (int i = 0; i < cloumnWidth.length; i++) {\n\t\t\tsheet.setColumnWidth(i, cloumnWidth[i]);\n\t\t}\n\t}",
"public void setResponseHeader(Response.Header header, String value) {\n setNonStandardHeader(header.code, value);\n }",
"void addHeader(HttpServletResponse response, String name, String value);",
"public void setHeader(String header, String value)\n\t{\n\t\tif (httpServletResponse != null)\n\t\t{\n\t\t\thttpServletResponse.setHeader(header, value);\n\t\t}\n\t}",
"public void downloadSingleExcel(QueryParameter query) {\n try {\n // Get excel\n HttpPost httppost = new HttpPost(HttpURL.getBillURL());\n List<NameValuePair> exportExcelFields = new ArrayList<NameValuePair>();\n exportExcelFields.add(new BasicNameValuePair(\"reservedProp(timeYear)\", query.getYearString()));\n exportExcelFields.add(new BasicNameValuePair(\"reservedProp(timeMonth)\", LAST_MONTH));\n exportExcelFields.add(new BasicNameValuePair(\"reservedProp(yearId)\", query.getYearString()));\n exportExcelFields.add(new BasicNameValuePair(\"reservedProp(chars)\", \"\"));\n exportExcelFields.add(new BasicNameValuePair(\"reservedProp(hiddenDate)\", query.getYearString() + LAST_MONTH));\n exportExcelFields.add(new BasicNameValuePair(\"reservedProp(type)\", \"power\"));\n exportExcelFields.add(new BasicNameValuePair(\"errorInfo\", \"power\"));\n exportExcelFields.add(new BasicNameValuePair(\"maxrow\", \"12\"));\n exportExcelFields.add(new BasicNameValuePair(\"action\", \"expExcel\"));\n httppost.setEntity(new UrlEncodedFormEntity(exportExcelFields, \"UTF-8\"));\n HttpEntity entity = this.client.execute(httppost).getEntity();\n this.saveExcelFile(entity, getTempExcelName(this.account, query));\n EntityUtils.consume(entity);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void setHeaderTitle(final String headerTitle) {\n\t\tthis.headerTitle = headerTitle;\n\t}",
"private ConfigurationHTMLPrinter doHeaderCell(final String value) {\n return print(\"<td class='header_cell'>\").print0(value).print0ln(\"</td>\");\n }",
"private static String header() {\r\n String output = \"\";\r\n output += \"\\\\documentclass[a4paper,10pt]{article}\\n\";\r\n output += \"\\\\title{Wilcoxon Signed Ranks test.}\\n\";\r\n output += \"\\\\date{\\\\today}\\n\\\\author{KEEL non-parametric statistical module}\\n\\\\begin{document}\\n\\n\\\\pagestyle{empty}\\n\\\\maketitle\\n\\\\thispagestyle{empty}\\n\\n\";\r\n\r\n return output;\r\n\r\n }",
"public final void setMxSheet_HeaderStyle(com.mendix.systemwideinterfaces.core.IContext context, xlsreport.proxies.MxCellStyle mxsheet_headerstyle)\r\n\t{\r\n\t\tif (mxsheet_headerstyle == null)\r\n\t\t\tgetMendixObject().setValue(context, MemberNames.MxSheet_HeaderStyle.toString(), null);\r\n\t\telse\r\n\t\t\tgetMendixObject().setValue(context, MemberNames.MxSheet_HeaderStyle.toString(), mxsheet_headerstyle.getMendixObject().getId());\r\n\t}",
"private void setPOSHeadersToTable() {\r\n\t\tthis.selectedRow = -1;\r\n\t\tif(FileData.getFileModel(FileType.POS) != null) {\r\n\t\t\tColumnData.setPOSHeadersToTableData(FileData.getFileModel(FileType.POS).getFileContents().getHeaderNames());\r\n\t\t}else {\r\n\t\t\tColumnData.getTableData().setRowCount(0);\r\n\t\t}\r\n\t}",
"public void setHeader(String header) {\n this.header = header == null ? null : header.trim();\n }",
"private void emitHeader(OutputStream stream) throws IOException {\n int header = 0x0;\n header |= WORKBUF_PROTOCOL_VERSION;\n stream.write(TfWorkbufProtocol.intToFourBytes(header));\n }",
"@RequestMapping(\"/findingRate/downloadExcel/format\")\r\n\t@ResponseBody\r\n\tpublic String excelFormatDownload(\r\n\t\t\t@RequestParam(value = \"headingVal\") String headingVal,Principal principal){\r\n\t\t\r\n\t\tString retVal = \"-1\";\r\n\t\tString fileName = principal.getName()+new java.util.Date().getTime()+\".xls\";\r\n\t\tString filePath = uploadDirecotryPath + File.separator +\"excelfilecontent\" + File.separator;\r\n\t\tString tempHeadVal[] = headingVal.split(\",\");\r\n\t\t\r\n\t\t try {\r\n\t String filename = filePath+fileName;\r\n\t HSSFWorkbook workbook = new HSSFWorkbook();\r\n\t HSSFSheet sheet = workbook.createSheet(\"FirstSheet\"); \r\n\r\n\t HSSFRow rowhead = sheet.createRow((short)0);\r\n\t for(int i=0;i<tempHeadVal.length;i++){\r\n\t \t rowhead.createCell(i).setCellValue(tempHeadVal[i].toString());\r\n\t }\r\n\t \r\n\t FileOutputStream fileOut = new FileOutputStream(filename);\r\n\t workbook.write(fileOut);\r\n\t fileOut.close();\r\n\t workbook.close();\r\n\t retVal = fileName;\r\n\t } catch ( Exception ex ) {\r\n\t System.out.println(ex);\r\n\t retVal = \"-2\";\r\n\t }\r\n\t\t\r\n\t\treturn retVal;\r\n\t}",
"void xsetTitle(org.apache.xmlbeans.XmlString title);",
"private void initHeader(boolean newHeader) throws IOException {\n\n if (newHeader) writeHeader();\n /*\n if (rafShp.read() == -1) { \n //File is empty, write a new one (what else???)\n writeHeader();\n } \n */ \n readHeader();\n }",
"@Override\r\n\tpublic void loadHeader() {\n\r\n\t}",
"void setPageHeader(PageHeader pageHeader);",
"void setPageHeader(PageHeader pageHeader);",
"public void setHeaderFlag(boolean flag) {\n configuration.put(ConfigTag.HEADER, flag);\n }",
"@Override\n public StreamHeader getHeader() throws Exception {\n return header;\n }",
"private void resetHeaderSmoothly() {\n if (null != mViewHandler) {\n isChanging = true;\n Message message = new Message();\n message.what = ViewHandler.SMOOTH_CHANGE_START;\n message.arg1 = ViewHandler.SMOOTH_TYPE_HEADER;\n mViewHandler.sendMessage(message);\n } else\n resetHeaderState();\n }",
"private void writeCsvHeader(String h1, String h2, String h3,String h4,String h5) throws IOException\r\n {\r\n \t String line = String.format(\"%s,%s,%s,%s,%s\\n\",h1,h2,h3,h4,h5);\r\n \t writer.write(line);\r\n }",
"@attribute(value = \"\", required = false, defaultValue = \"default value is false\")\r\n\tpublic void setHeader(Boolean isHeader) {\r\n\t\tthis.header = isHeader;\r\n\t}",
"private static void addHeading(Sheet sheet) throws IOException {\r\n sheet.ensureRowCount(4);\r\n sheet.ensureColumnCount(10);\r\n sheet.getCellAt(\"A1\").setValue(\"income\");\r\n sheet.getCellAt(\"A2\").setValue(\"expense\");\r\n sheet.getCellAt(\"A3\").setValue(\"sum\");\r\n sheet.getCellAt(\"B1\").setValue(0.0);\r\n sheet.getCellAt(\"B2\").setValue(0.0);\r\n sheet.getCellAt(\"B3\").setValue(0.0);\r\n sheet.getCellAt(\"A4\").setValue(\"id\");\r\n sheet.getCellAt(\"B4\").setValue(\"amount\");\r\n sheet.getCellAt(\"C4\").setValue(\"date\");\r\n sheet.getCellAt(\"D4\").setValue(\"info\");\r\n }",
"abstract public void header();",
"@Override\n public void setIntHeader(String arg0, int arg1) {\n\n }",
"@Override\n\tpublic void addHeader(String name, String value) {\n\t}",
"@Override\n public void addHeader(String arg0, String arg1) {\n\n }",
"public String getHeader()\r\n\t{\r\n\t\treturn header;\r\n\t}",
"public void setColumnHeaders(String[] headers) {\n\t\tif (headers.length > getColumnCount()) {\n\t\t\tsetColumnsCount(headers.length);\n\t\t}\n\t\tfor (int i = 0; i < headers.length; i++) {\n\t\t\ttableViewer.getTable().getColumn(i).setText(headers[i]);\n\t\t}\n\t}",
"protected void writeHeader() throws IOException {\n _baos = new ByteArrayOutputStream();\n _dos = new DataOutputStream(_baos);\n _dos.write(PushCacheProtocol.instance().header(), 0, PushCacheProtocol.instance().header().length);\n }",
"public void setColumnHeaderView(Component paramComponent) {\n/* 1143 */ if (getColumnHeader() == null) {\n/* 1144 */ setColumnHeader(createViewport());\n/* */ }\n/* 1146 */ getColumnHeader().setView(paramComponent);\n/* */ }",
"public void setContentDisposition\n (ContentDispositionHeader contentDispositionHeader) {\n this.setHeader( contentDispositionHeader);\n \n }",
"public void setRequestHeader(Header header) {\n \n Header[] headers = getRequestHeaderGroup().getHeaders(header.getName());\n \n for (int i = 0; i < headers.length; i++) {\n getRequestHeaderGroup().removeHeader(headers[i]);\n }\n \n getRequestHeaderGroup().addHeader(header);\n \n }",
"private void setResponseHeaders(final HttpServletResponse response, final boolean isSave) {\n /* Browser will open the document only if this is set */\n LOGGER.debug(\"Inside response headers\");\n response.reset();\n response.setHeader(\"Expires\", \"0\");\n response.setHeader(\"Cache-Control\", \"must-revalidate, post-check=0,pre-check=0\");\n response.setHeader(\"Pragma\", \"public\");\n response.setHeader(\"Pragma\", \"no-cache\"); // HTTP 1.0\n response.setDateHeader(\"Expires\", 0); /* prevents caching at the proxy */\n response.setHeader(\"Cache-Control\", \"no-cache\"); // HTTP 1.1\n response.setHeader(\"Cache-Control\", \"max-age=0\");\n\n if (isSave) {\n response.setHeader(\"Content-Disposition\", \"attachment; filename=paymentReceipt.pdf\");\n } else {\n response.setHeader(\"Content-disposition\", \"inline; filename=paymentReceipt.pdf\");\n }\n /* Set content type to application / pdf */\n response.setContentType(\"application/pdf\");\n }",
"private void generateHeader() throws IOException {\r\n\t\tcharset = Charset.forName(encoding);\r\n\t\t\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\t\t\r\n\t\t//first line\r\n\t\tsb.append(\"HTTP/1.1 \");\r\n\t\tsb.append(statusCode);\r\n\t\tsb.append(\" \");\r\n\t\tsb.append(statusText);\r\n\t\tsb.append(\"\\r\\n\");\r\n\t\t\r\n\t\t//second line\r\n\t\tsb.append(\"Content-type: \");\r\n\t\tsb.append(mimeType);\r\n\t\tif (mimeType.startsWith(\"text/\")) {\r\n\t\t\tsb.append(\" ;charset= \");\r\n\t\t\tsb.append(encoding);\r\n\t\t}\r\n\t\tsb.append(\"\\r\\n\");\r\n\t\t\r\n\t\t//third line\r\n\t\tif (contentLength > 0) {\r\n\t\t\tsb.append(\"Content-Length: \");\r\n\t\t\tsb.append(contentLength);\r\n\t\t\tsb.append(\"\\r\\n\");\r\n\t\t}\r\n\t\t\r\n\t\t//fourth line\r\n\t\tgetOutputCookies(sb);\r\n\t\tsb.append(\"\\r\\n\");\r\n\t\t\r\n\t\toutputStream.write(sb.toString().getBytes(Charset.forName(\"ISO_8859_1\")));\r\n\t\t\r\n\t\theaderGenerated = true;\r\n\t}",
"public void setPlayerListHeader ( String header ) {\n\t\texecute ( handle -> handle.setPlayerListHeader ( header ) );\n\t}",
"@Override\n public void setHeading(String heading) {\n }",
"protected JTableHeader createDefaultTableHeader() {\r\n \treturn new JTableHeader(columnModel) {\r\n \t\t\r\n \t\tprivate static final long serialVersionUID = 1L;\r\n \t\t\r\n \t\tpublic String getToolTipText(MouseEvent e) {\r\n \t\t\tjava.awt.Point p = e.getPoint();\r\n \t\t\tint index = columnModel.getColumnIndexAtX(p.x);\r\n \t\t\tint realColumnIndex = convertColumnIndexToModel(index);\r\n \t\t\tif ((realColumnIndex >= 0) && (realColumnIndex < getModel().getColumnCount()))\r\n \t\t\t\treturn \"The column \" + getModel().getColumnName(realColumnIndex);\r\n \t\t\telse\r\n \t\t\t\treturn \"\";\r\n \t\t}\r\n \t};\r\n }",
"public String getHeader() {\n return header;\n }",
"public String getHeader() {\n return header;\n }",
"public void setHeaderLabel() {\n\t\t\tlblGameBoard\n\t\t\t\t\t.setText(LABEL);\n\t}",
"public void onHeaderRefresing();",
"public void setRowHeaderView(Component paramComponent) {\n/* 1074 */ if (getRowHeader() == null) {\n/* 1075 */ setRowHeader(createViewport());\n/* */ }\n/* 1077 */ getRowHeader().setView(paramComponent);\n/* */ }",
"public void setHeaderText(String headerText) {\n this.headerText = headerText;\n }",
"public abstract void setMimeHeader(String name, String value);",
"public void setHeaderId(Number value) {\n setAttributeInternal(HEADERID, value);\n }",
"public void setHeaderId(Number value) {\n setAttributeInternal(HEADERID, value);\n }",
"private void setupHeader(final String filePath) throws IOException{\n\t\tFile headerFile = new File(filePath);\n\t\tString dataString = new String();\n\t\tBufferedReader reader = new BufferedReader(new FileReader(headerFile));\n\t\twhile((dataString = reader.readLine()) != null){\n\t\t\theaderText.append(dataString);\n\t\t\theaderText.append(System.lineSeparator());\n\t\t}\n\t\treader.close();\n\t}",
"void setHeader(@NonNull String name, @Nullable String value) {\n if (value == null) {\n removeHeader(name);\n } else {\n headers.put(name, value);\n }\n }",
"@Override\n protected void writeStreamHeader() throws IOException {\n reset();\n }",
"@Override\n\tprotected PortletRenderResult callInternal() throws Exception {\n\t final String characterEncoding = response.getCharacterEncoding();\n\t final RenderPortletOutputHandler renderPortletOutputHandler = new RenderPortletOutputHandler(characterEncoding);\n\t \n final PortletRenderResult result = portletRenderer.doRenderHeader(portletWindowId, request, response, renderPortletOutputHandler);\n \n this.output = renderPortletOutputHandler.getOutput();\n \n return result;\n\t}"
] | [
"0.65792406",
"0.5985253",
"0.59837985",
"0.5933894",
"0.59285784",
"0.59021956",
"0.5902036",
"0.58863837",
"0.58681226",
"0.585383",
"0.58529586",
"0.583617",
"0.58051",
"0.5735276",
"0.57133126",
"0.56922895",
"0.56870306",
"0.5677878",
"0.5675071",
"0.56714153",
"0.56442326",
"0.5641429",
"0.5601064",
"0.5593534",
"0.5560479",
"0.5508752",
"0.54858506",
"0.5483046",
"0.54674804",
"0.54612374",
"0.5447766",
"0.5443696",
"0.5443518",
"0.5406032",
"0.53879625",
"0.53849775",
"0.53808373",
"0.5378521",
"0.53479326",
"0.53449",
"0.5344825",
"0.53411394",
"0.533987",
"0.5339765",
"0.5326498",
"0.53044236",
"0.52927184",
"0.5291894",
"0.52904785",
"0.5278616",
"0.5269119",
"0.52687544",
"0.5253627",
"0.523873",
"0.52037674",
"0.5193336",
"0.5191186",
"0.5180236",
"0.5175818",
"0.5175658",
"0.5156332",
"0.5139487",
"0.51342505",
"0.5133623",
"0.5128021",
"0.5128021",
"0.5120836",
"0.51125795",
"0.51055294",
"0.50986403",
"0.5096022",
"0.5087507",
"0.50718415",
"0.5070723",
"0.5064881",
"0.5057823",
"0.5057038",
"0.5052875",
"0.5049864",
"0.5047577",
"0.5026095",
"0.5021687",
"0.50192803",
"0.50153404",
"0.5010008",
"0.49935296",
"0.49933204",
"0.49876788",
"0.49876788",
"0.49811605",
"0.49805793",
"0.49800995",
"0.49724326",
"0.49609217",
"0.4947896",
"0.4947896",
"0.49469697",
"0.4933954",
"0.49293435",
"0.49255392"
] | 0.731079 | 0 |
Launch the serious error dialog (actually an activity) | public static void start(Context _this, Throwable t, String... strings) {
// build the info string
StringBuilder sb = new StringBuilder();
if (strings != null && strings.length > 0) {
for (String string : strings) {
sb.append(string);
sb.append('\n');
}
}
if (t != null) {
sb.append("stacktrace:\n");
sb.append(Util.getStackTrace(t));
}
final String info = sb.toString();
Intent intent = new Intent(_this, ErrorDialog.class);
intent.putExtra(INFO, info);
_this.startActivity(intent);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void showErrorDialog(int errorCode) {\n\t\t\n }",
"private void showErrorDialogue() {\n\t\ttry {\n\t\t\tnew AlertDialog.Builder(mContext)\n\t\t\t\t\t.setTitle(\"Something unfortunate happened...\")\n\t\t\t\t\t.setMessage(\"Your device was not able to verify activation. Please check your internet connection and ensure you are using the latest version of the application.\")\n\t\t\t\t\t.setNeutralButton(\"Close\", new DialogInterface.OnClickListener() {\n\t\t\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.show();\n\t\t} catch (Exception e) {\n\t\t\t//not in main activity, not a problem\n\t\t\tLog.w(TAG, e.getMessage());\n\t\t}\n\t}",
"public static void displayLaunchError(Shell shell, ILaunchConfiguration config, Exception e) {\n\t\tString title = \"Problem Occured\"; \n\t\tString message = \"Opening the configuration dialog has encoutered a problem.\\n\\n\" + e.getLocalizedMessage();\n\t\tMessageDialog.openError(shell, title, message);\n\t}",
"private void ShowRetrievedErrorPopupDialog(){\n ShowWhaitSpinner();\n //there is an error, show popup message\n Context context;\n AlertDialog.Builder builder = new AlertDialog.Builder(getContext());\n builder.setMessage(R.string.error_message_download_resources)\n .setCancelable(false)\n .setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n startActivity(new Intent(getContext(), MainActivity.class));\n }\n });\n AlertDialog alertDialog = builder.create();\n alertDialog.show();\n\n }",
"private void openSelectedProfileError() {\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Error Opening Profile\");\n alert.setHeaderText(null);\n alert.setContentText(\"An error occurred while opening the selected profile.\");\n alert.showAndWait();\n }",
"public void openTVErrorDialog(String message, String headerTitle, boolean shouldNavigateToLogin) {\n try {\n Bundle bundle = new Bundle();\n bundle.putBoolean(currentActivity.getString(R.string.retry_key), false);\n bundle.putBoolean(currentActivity.getString(R.string.register_internet_receiver_key), false);\n bundle.putString(currentActivity.getString(R.string.tv_dialog_msg_key), message);\n bundle.putString(currentActivity.getString(R.string.tv_dialog_header_key),\n headerTitle.toUpperCase()\n );\n bundle.putBoolean(currentActivity.getString(R.string.shouldNavigateToLogin), shouldNavigateToLogin);\n\n Intent args = new Intent(AppCMSPresenter.ERROR_DIALOG_ACTION);\n args.putExtra(currentActivity.getString(R.string.retryCallBundleKey), bundle);\n currentActivity.sendBroadcast(args);\n } catch (Exception e) {\n //Log.e(TAG, \"DialogType launching TV DialogType Activity\");\n }\n }",
"private void showErrorAlert()\n {\n \tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n \tbuilder.setMessage(getResources().getString(R.string.app_error_str))\n \t .setCancelable(false)\n \t .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n \t public void onClick(DialogInterface dialog, int id) {\n \t dialog.cancel();\n \t }\n \t });\n \t \n \tAlertDialog alert = builder.create();\n \talert.show();\n }",
"private void errorPopUp() {\n new AlertDialog.Builder(mActivity)\n .setTitle(\"Oops\")\n .setMessage(\"Please choose an emotional state or enter a date and time\")\n .setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n //Go back without changing anything\n dialogInterface.dismiss();\n }\n })\n .create()\n .show();\n }",
"private void showErrorDialog(int resultCode) {\n // Get the error dialog from Google Play Services\n Dialog errorDialog = GooglePlayServicesUtil.getErrorDialog(\n resultCode, this, CONNECTION_FAILURE_RESOLUTION_REQUEST);\n\n if (errorDialog != null) {\n // Display error\n errorDialog.show();\n }\n }",
"private void showErrorDialog(String msg) {\n\t\tJFXDialogLayout content = new JFXDialogLayout();\n\t\tcontent.setHeading(new Text(\"ERROR\"));\n\t\tcontent.setBody(new Text(msg));\n\t\tJFXDialog dialog = new JFXDialog(stackPane, content, JFXDialog.DialogTransition.CENTER);\n\t\t;\n\n\t\tJFXButton button = new JFXButton(\"I understand\");\n\t\tbutton.setButtonType(ButtonType.RAISED);\n\t\tbutton.setCursor(Cursor.HAND);\n\t\tbutton.setOnAction(e -> dialog.close());\n\t\tcontent.setActions(button);\n\t\tdialog.show();\n\t}",
"private void error(String message) { \n Alert alert = new Alert(Alert.AlertType.ERROR, message);\n alert.setTitle(I18n.tr(\"imagesizedialog.error.title\"));\n alert.setContentText(message);\n alert.showAndWait();\n }",
"private void displayErrorDialog(String message) {\n AlertDialog.Builder builder;\n\n builder = new AlertDialog.Builder(this);\n builder.setTitle(getString(R.string.er_error))\n .setMessage(message)\n .setNegativeButton(getString(R.string.bt_close), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n }\n }).setIcon(android.R.drawable.stat_notify_error).show();\n }",
"protected void showErrorDialog(String msg) {\n\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n\n builder.setTitle(com.mytechia.robobo.framework.R.string.title_error_dialog).\n setMessage(msg);\n builder.setPositiveButton(com.mytechia.robobo.framework.R.string.ok_msg, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n finish();\n System.exit(0);\n }\n });\n\n AlertDialog dialog = builder.create();\n dialog.show();\n\n }",
"private static void displayError(Shell shell, String msg) {\n MessageBox mbox = new MessageBox(shell, SWT.ICON_ERROR|SWT.OK);\n mbox.setMessage(msg);\n mbox.setText(\"USBDM - Can't create launch configuration\");\n mbox.open();\n }",
"public ErrorAlert(String message) {\r\n\r\n JOptionPane.showMessageDialog(MainWindow.getInstance(), message);\r\n\r\n }",
"protected void showAlertDialog(Exception e) {\n\t\tshowAlertDialog(\"Error\", e.toString());\n\t}",
"@Override\n public void run() {\n waitDialog.dismiss();\n\n //show an error dialog\n\n\n }",
"private void showErrorDialog(String message){\n new AlertDialog.Builder(this)\n .setTitle(\"Error\")\n .setMessage(message)\n .setPositiveButton(android.R.string.ok,null)\n .setIcon(android.R.drawable.ic_dialog_alert)\n .show();\n }",
"public static AbstractErrDialog waitForErrorDialog() {\n\t\treturn waitForDialogComponent(AbstractErrDialog.class);\n\t}",
"private void errorAlert(String msg) {\n Alert dialog = new Alert(Alert.AlertType.ERROR);\n dialog.setTitle(\"Error\");\n dialog.setHeaderText(\"!!\");\n dialog.setContentText(msg);\n dialog.show();\n }",
"private void showErrorDialog(String message) {\n\n new AlertDialog.Builder(this)\n .setTitle(\"Oops\")\n .setMessage(message)\n .setPositiveButton(android.R.string.ok, null)\n .setIcon(android.R.drawable.ic_dialog_alert)\n .show();\n }",
"private void errorLogButtonActionPerformed() {\n ImportExportLogDialog logDialog;\n\n if(ascopy != null && ascopy.isCopying()) {\n logDialog = new ImportExportLogDialog(null, ImportExportLogDialog.DIALOG_TYPE_IMPORT, ascopy.getCurrentProgressMessage());\n logDialog.setTitle(\"Current Data Transfer Errors\");\n } else {\n logDialog = new ImportExportLogDialog(null, ImportExportLogDialog.DIALOG_TYPE_IMPORT, migrationErrors);\n logDialog.setTitle(\"Data Transfer Errors\");\n }\n\n logDialog.showDialog();\n }",
"@Override\n\t\t\t\t\t\tpublic void onError(DialogError e) {\n\t\t\t\t\t\t\tToast.makeText(FBactivity.this, \"dialogError\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\t}",
"public static AlertDialog newErrorHandlerDialog(final Activity activity, String dialogTitle,\n Exception error) {\n String screenMessage = error.getLocalizedMessage();\n\n AlertDialog.Builder builder = new AlertDialog.Builder(activity);\n builder.setTitle(dialogTitle);\n builder.setMessage(screenMessage);\n builder.setIcon(android.R.drawable.ic_dialog_alert);\n builder.setCancelable(false);\n builder.setPositiveButton(activity.getString(android.R.string.ok), new OnClickListener() {\n\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n }\n });\n\n if (IntentSupport.isIntentAvailable(activity, Intent.ACTION_SEND,\n IntentSupport.MIME_TYPE_EMAIL)) {\n int buttonId = activity.getResources().getIdentifier(\n \"droidfu_dialog_button_send_error_report\", \"string\", activity.getPackageName());\n String buttonText = activity.getString(buttonId);\n int bugEmailAddressId = activity.getResources().getIdentifier(\n \"droidfu_error_report_email_address\", \"string\", activity.getPackageName());\n String bugReportEmailAddress = activity.getString(bugEmailAddressId);\n int bugEmailSubjectId = activity.getResources().getIdentifier(\n \"droidfu_error_report_email_subject\", \"string\", activity.getPackageName());\n String bugReportEmailSubject = activity.getString(bugEmailSubjectId);\n final String diagnosis = DiagnosticSupport.createDiagnosis(activity, error);\n final Intent intent = IntentSupport.newEmailIntent(activity, bugReportEmailAddress,\n bugReportEmailSubject, diagnosis);\n builder.setNegativeButton(buttonText, new OnClickListener() {\n\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n activity.startActivity(intent);\n }\n });\n }\n\n return builder.create();\n }",
"public static void showErrorDialog(final Shell shell, Throwable t) {\n\t\tMultiStatus status = createMultiStatus(t.getLocalizedMessage(), t);\n\t\t// show error dialog\n\t\tErrorDialog.openError(shell, \"Error\", \"This is an error\", status);\n\t}",
"private void showErrorDialog(){\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n\n builder.setTitle(getString(R.string.booking_not_created));\n builder.setMessage(getString(R.string.customer_already_has_active_booking_error));\n builder.setIcon(R.drawable.ic_error_black_24dp);\n builder.setCancelable(false);\n // When users confirms dialog, close the activity\n builder.setPositiveButton(android.R.string.ok, (dialog, which) -> {\n // Close the Activity..\n finish();\n });\n\n AlertDialog dialog = builder.create();\n dialog.setCanceledOnTouchOutside(false);\n dialog.show();\n\n // Change button colors\n Button positiveButton = dialog.getButton(AlertDialog.BUTTON_POSITIVE);\n positiveButton.setTextColor(getColor(R.color.colorPrimary));\n }",
"public void showErrorDialog(String header, String content) {\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Error\");\n alert.setHeaderText(header);\n Label label = new Label(content);\n label.setWrapText(true);\n alert.getDialogPane().setContent(label);\n alert.showAndWait();\n }",
"protected void showErrorDialog(String msg) {\n JOptionPane.showMessageDialog(mainFrame, msg, errorDialogTitle, JOptionPane.ERROR_MESSAGE);\n }",
"private void errorMessage(String message) {\n \tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n \tAlertDialog dialog = builder.setMessage(message).setTitle(\"Error\").create();\n \tdialog.show();\n }",
"private void displayError(Exception ex)\n {\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Error dialog\");\n alert.setHeaderText(null);\n alert.setContentText(ex.getMessage());\n\n alert.showAndWait();\n }",
"public abstract void showErrorBox(Throwable error);",
"private void showErrorDialog(int errorCode) {\n\n\t\t// Get the error dialog from Google Play services\n\t\tDialog errorDialog = GooglePlayServicesUtil.getErrorDialog(errorCode, getActivity(), LocationUtils.CONNECTION_FAILURE_RESOLUTION_REQUEST);\n\n\t\t// If Google Play services can provide an error dialog\n\t\tif (errorDialog != null) {\n\t\t\terrorDialog.show();\n\t\t}\n\t}",
"public void showErrorDialog(final int code) {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n Dialog d = GooglePlayServicesUtil.getErrorDialog(\n code,\n FilmgurActivity.this,\n 100);\n d.show();\n }\n });\n }",
"public void reportError(Error error) {\r\n Object[] dialogContent; \r\n if(error.hasException()){\r\n javax.swing.JScrollPane exceptionPane = new javax.swing.JScrollPane();\r\n javax.swing.JTextArea exceptionTextArea = new javax.swing.JTextArea();\r\n exceptionTextArea.setText(error.getException().toString() + \"\\n\");\r\n StackTraceElement[] stacktrace = error.getException().getStackTrace();\r\n for(int i = 0; i<stacktrace.length; i++){\r\n exceptionTextArea.append(\" \" + stacktrace[i].toString() + \"\\n\");\r\n }\r\n exceptionPane.getViewport().setViewPosition(SelectableComponent.getDefaultOrigin());\r\n exceptionTextArea.setColumns(20);\r\n exceptionTextArea.setRows(5);\r\n exceptionPane.setViewportView(exceptionTextArea);\r\n dialogContent = new Object[]{error.getMessage() + \"\\n\", exceptionPane};\r\n } else {\r\n dialogContent = new Object[]{error.getMessage() + \"\\n\"};\r\n }\r\n \r\n JOptionPane.showMessageDialog(this, dialogContent, error.getTitle(), JOptionPane.ERROR_MESSAGE);\r\n }",
"public void createErrorDialog(int title, int message) {\n //Couldn't load the image, display an error message\n new AlertDialog.Builder(MainActivity.this)\n .setTitle(title)\n .setMessage(message)\n .setNeutralButton(android.R.string.ok, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n //Do nothing\n }\n })\n .setIcon(android.R.drawable.ic_dialog_alert)\n .show();\n }",
"DialogResult show();",
"public static void showError (Exception e)\n\t{\n\t\tString message = getErrorMessage(e);\n\t\n\t\t// filter out cancelled actions by the user which end up as\n\t\t// ModelExceptions after veto\n\t\tif (message != null)\n\t\t{\n\t\t\tNotifyDescriptor desc = new NotifyDescriptor.Message(\n\t\t\t\tmessage, NotifyDescriptor.ERROR_MESSAGE);\n\n\t\t\tDialogDisplayer.getDefault().notify(desc);\n\t\t}\n\t}",
"public static void openError(Shell parent, String title, String message)\n {\n open(MessageDialog.ERROR, parent, title, message, SWT.NONE);\n }",
"public static void showErrorDialog(Shell shell, String message) {\r\n\t\tshowDialog(shell, \"Error\", message, SWT.ICON_ERROR);\r\n\t}",
"private void reportError(Exception x)\n {\n ErrorDialog.openError(getShell(),\n \"eclipse.dialogtitle\",\n \"eclipse.projecterror\",\n new Status(IStatus.ERROR,\n \t\t\"org.totori\",\n IStatus.ERROR,\n x.getMessage() != null ? x.getMessage()\n : x.toString(),\n x));\n }",
"private void showErrorDialog(int errorCode) {\n\n\t\t// Get the error dialog from Google Play services\n\t\tDialog errorDialog = GooglePlayServicesUtil.getErrorDialog(\n\t\t\t\terrorCode,\n\t\t\t\tthis,\n\t\t\t\tLocationUtils.CONNECTION_FAILURE_RESOLUTION_REQUEST);\n\n\t\t// If Google Play services can provide an error dialog\n\t\tif (errorDialog != null) {\n\n\t\t\t// Create a new DialogFragment in which to show the error dialog\n\t\t\tErrorDialogFragment errorFragment = new ErrorDialogFragment();\n\n\t\t\t// Set the dialog in the DialogFragment\n\t\t\terrorFragment.setDialog(errorDialog);\n\n\t\t\t// Show the error dialog in the DialogFragment\n\t\t\terrorFragment.show(getSupportFragmentManager(), LocationUtils.APPTAG);\n\t\t}\n\t}",
"@Override\n\tpublic boolean onTaskFailed(Appstart arg0, Exception arg1) {\n\t\tnew AlertDialog.Builder(getContext())\n\t\t.setIcon(getContext().getResources().getDrawable(R.drawable.login_error_icon))\n\t\t.setTitle(\"Sorry\").setMessage(arg1.getMessage()+\"!\")\n\t\t\t.setPositiveButton(\"OK\", new OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\tdialog.dismiss();\n\t\t\t\tgetContext().openActivity(PrepLogin.class); //AppManager.getInstance().AppExit(getContext());//System.exit(0);\n\t\t\t}\n\t\t})\n\t\t.create().show();\n\t\treturn true;\n\t}",
"private static void error( Exception e ) {\n e.printStackTrace();\n System.exit(-1);\n }",
"static void errorNotification(Context context,String exception) {\n AlertDialog.Builder errorDialogBox= new AlertDialog.Builder(context);\n errorDialogBox.setTitle(\"Exception\");\n errorDialogBox.setMessage(exception);\n errorDialogBox.setNeutralButton(android.R.string.ok,new DialogInterface.OnClickListener(){\n\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n }\n });\n //Activates the dialog box\n AlertDialog errorDialog = errorDialogBox.create();\n errorDialog.show();\n\n }",
"@Override\n\t\t\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\t\tWindow.alert(\"Fail\");\n\t\t\t\t\t}",
"private void showErrorToast() {\n }",
"public void showGoogleErrorDialog(ConnectionResult connectionResult) {\n try {\n // Create a fragment for the error dialog\n connectionResult.startResolutionForResult(this, GoogleAPIConnectionConstants.REQUEST_RESOLVE_ERROR);\n }\n catch (IntentSender.SendIntentException e) {\n Log.e(MainActivity.TAG,\"SendIntentException occurred.\");\n checkGoogleApiAvailability();\n }\n }",
"public void showErrorMessageDialog(String error){\n JOptionPane.showMessageDialog(null,error, \"Error\",JOptionPane.ERROR_MESSAGE);\n }",
"@Override\r\n\tpublic void showErrReq() {\n\t\tdialog.cancel();\r\n\t\tshowNetView(true);\r\n\t}",
"public void displayError(String message){\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setContentText(message);\n //alert.initOwner(owner);\n alert.show();\n }",
"@Override\r\n\t\tpublic void onError(DialogError e) {\n\t\t}",
"@Override\n public void reportError(String msg) {\n JOptionPane.showMessageDialog(null, msg);\n }",
"private void printErrorAlert(String title, String header, String message) {\r\n\t\tAlert alert = new Alert(Alert.AlertType.ERROR);\r\n\t\tif(title.length()>0)\r\n\t\t\talert.setTitle(title);\r\n\t\tif(header.length()>0)\r\n\t\t\talert.setHeaderText(header);\r\n\t\tif(message.length()>0)\r\n\t\t\talert.setContentText(message);\r\n\t\tStage stage = (Stage) alert.getDialogPane().getScene().getWindow();\r\n\t\tstage.getIcons().add(new Image(this.getClass().getResource(\"x.png\").toString()));\r\n\t\talert.showAndWait();\r\n\t}",
"public void onMoviesError() {\n\n // Hide progress indicator\n resultsProgressIndicator.setVisible(false);\n\n Platform.runLater(() -> {\n\n // Creating an alert dialog\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Error\");\n alert.setHeaderText(\"Connectivity Error\");\n alert.setContentText(\"Poster Grabber could not connect. Your connection might be down for the moment or the host is down.\\nPlease check your internet connection and try again later.\");\n alert.initOwner(primaryStage);\n\n // Setting custom style\n DialogPane dialogPane = alert.getDialogPane();\n dialogPane.getStylesheets().add(getClass().getResource(\"/ErrorDialog.css\").toExternalForm());\n dialogPane.getStyleClass().add(\"myDialog\");\n\n // Displaying the alert dialog\n alert.show();\n });\n\n }",
"@Override\n public void onFailure(@NonNull Exception e) {\n dialog.dismiss();\n //Display err toast msg\n Toast.makeText(getApplicationContext(), e.getMessage(), Toast.LENGTH_SHORT).show();\n }",
"private void displayError(Exception e)\n\t{\n\t\tJOptionPane.showMessageDialog(frame,\n\t\t\t\te.toString(),\n\t\t\t\t\"EXCEPTION\",\n\t\t\t\tJOptionPane.WARNING_MESSAGE);\n\t}",
"private void showErroAlert(String errorMessage) {\n LOGGER.log(Level.INFO, \"Showing Alert window with error message...\");\n Alert errorAlert = new Alert(Alert.AlertType.ERROR, errorMessage, ButtonType.OK);\n errorAlert.show();\n }",
"void errorMsg(String msg) {\n Alert errorAlert = new Alert(\"error\", msg, null, AlertType.ERROR);\n errorAlert.setCommandListener(this);\n errorAlert.setTimeout(Alert.FOREVER);\n Display.getDisplay(this).setCurrent(errorAlert);\n }",
"public void showExceptionDialog(Exception InputException)\r\n {\r\n JOptionPane.showMessageDialog(MainFrame,\r\n InputException.getMessage(),\r\n \"Error\",\r\n JOptionPane.ERROR_MESSAGE);\r\n }",
"public static void showErrorDialog(Shell shell, Exception e) {\r\n\t\tString message = \"Oops... an unexpected error occurred\";\r\n\t\tif (e != null) {\r\n\t\t\tif (e instanceof MusicTunesException) {\r\n\t\t\t\tmessage = e.getMessage();\r\n\t\t\t}\r\n\t\t}\r\n\t\tshowErrorDialog(shell, message);\r\n\t}",
"private void showError(String msg)\n {\n \tJOptionPane.showMessageDialog(this, msg, \"Error\",\n \t\t\t\t JOptionPane.ERROR_MESSAGE);\n }",
"public synchronized void showErrorMessage(String message) {\r\n \t\tComponent parent = mainWindow;\r\n \t\tif (resultsWindow != null && resultsWindow.hasFocus()) {\r\n \t\t\tparent = resultsWindow;\r\n \t\t}\r\n \t\tJOptionPane.showMessageDialog(parent, message, \"Error\", JOptionPane.ERROR_MESSAGE);\r\n \t}",
"@Override\r\n\t\t\t\t\tpublic void onError(DialogError e) {\n\t\t\t\t\t\t\r\n\t\t\t\t\t}",
"public void fatalError(final String log_file) {\n File file = new File(log_file);\n\n Uri path = FileProvider.getUriForFile(context, context.getApplicationContext().getPackageName() + \".provider\", file);\n\n Intent intent = new Intent(Intent.ACTION_VIEW);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\n Intent.createChooser(intent, context.getResources().getString(R.string.open_file_with));\n intent.setDataAndType(path, context.getContentResolver().getType(path));\n intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n\n PendingIntent pi = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE);\n\n NotificationCompat.Builder builder = new NotificationCompat.Builder(this, Notifications.CHANNEL_ID)\n .setSmallIcon(R.drawable.icon)\n .setContentTitle(\"Vulkan Samples Error\")\n .setContentText(\"Fatal Error: click to view\")\n .setStyle(new NotificationCompat.BigTextStyle().bigText(\"Log: \" + log_file))\n .setAutoCancel(true)\n .setContentIntent(pi)\n .setPriority(NotificationCompat.PRIORITY_HIGH);\n\n NotificationManagerCompat nm = NotificationManagerCompat.from(context);\n nm.notify(Notifications.getNotificationId(this), builder.build());\n }",
"public void stopActivityAndDisplayDialog(\n final String title,\n final String message,\n final boolean error);",
"public static void failMenu(QWidget parent, String s){\n \t\t\n \t\tQMessageBox.critical(parent, \"Major problem\",s);\n \t}",
"private void showErrorDialog(int errorCode) {\n Dialog errorDialog = GooglePlayServicesUtil.getErrorDialog(\n errorCode,\n this,\n LocationUtils.CONNECTION_FAILURE_RESOLUTION_REQUEST);\n\n // If Google Play services can provide an error dialog\n if (errorDialog != null) {\n\n // Create a new DialogFragment in which to show the error dialog\n ErrorDialogFragment errorFragment = new ErrorDialogFragment();\n\n // Set the dialog in the DialogFragment\n errorFragment.setDialog(errorDialog);\n\n // Show the error dialog in the DialogFragment\n errorFragment.show(getSupportFragmentManager(), LocationUtils.APPTAG);\n }\n }",
"private void displayPopUpError(View view) {\n LayoutInflater inflater = (LayoutInflater)\n getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n View popupView = inflater.inflate(R.layout.popup_error_creation_service, null);\n\n // create the popup window\n int width = LinearLayout.LayoutParams.WRAP_CONTENT;\n int height = LinearLayout.LayoutParams.WRAP_CONTENT;\n boolean focusable = true; // lets taps outside the popup also dismiss it\n final PopupWindow popupWindow = new PopupWindow(popupView, width, height, focusable);\n\n // show the popup window\n // which view you pass in doesn't matter, it is only used for the window tolken\n popupWindow.showAtLocation(view, Gravity.CENTER, 0, 0);\n\n Button btnCancel = popupView.findViewById(R.id.btn_cancel);\n\n btnCancel.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n popupWindow.dismiss();\n Intent intent = new Intent(view.getContext(), HomeActivity.class);\n intent.putExtra(\"userConnected\", userConnected);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(intent);\n\n }\n });\n }",
"protected static synchronized void writeError(String errorMessage) {\n JOptionPane optionPane = new JOptionPane(errorMessage, JOptionPane.ERROR_MESSAGE);\n JDialog dialog = optionPane.createDialog(\"Error\");\n dialog.setAlwaysOnTop(true);\n dialog.setVisible(true);\n }",
"private static void showApiKeyErrorDialog(Activity currentActivity) {\n final AlertDialog.Builder alertDialog = new AlertDialog.Builder(currentActivity);\n\n alertDialog.setTitle(\"Error\");\n alertDialog.setMessage(\"API_KEY not set\");\n alertDialog.setCancelable(false);\n alertDialog.setPositiveButton(currentActivity.getResources().getString(R.string.ok_label), new DialogInterface.OnClickListener() {\n\n public void onClick(DialogInterface dialog, int which) {\n android.os.Process.killProcess(android.os.Process.myPid());\n }\n });\n\n alertDialog.show();\n }",
"public void displayError(String title, String message, Throwable error) {\n\t\tMessageDialog.openError(getShell(), title, message);\n\t\terror.printStackTrace();\n\t}",
"@Override\n\t\t\tpublic void onError(DialogError e) {\n\t\t\t\t\n\t\t\t}",
"public void showError(String error);",
"private void showError(String text, String title){\n JOptionPane.showMessageDialog(this,\n text, title, JOptionPane.ERROR_MESSAGE);\n }",
"@Override\n\tpublic void setFailedError() {\n\t\tnew Customdialog_Base(this, \"정보가 올바르지 않습니다.\").show();\n\t}",
"public void messageErreur(Exception ex) throws HeadlessException {\n JOptionPane.showMessageDialog(null, ex.getMessage(), \"ERROR\", JOptionPane.ERROR_MESSAGE);\n }",
"private void showErrorMessage(String msgRes)\r\n {\r\n applicationContext.getGUISynchronizer().asyncInvoke(\r\n createErrorRunnable(msgRes));\r\n }",
"@Override\n\t\t\t\t\t\tpublic void onError(DialogError error) {\n\n\t\t\t\t\t\t}",
"@Override\n public void showError() {\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n int errorCode = this.getArguments().getInt(DIALOG_ERROR);\n return GooglePlayServicesUtil.getErrorDialog(errorCode,\n getActivity(), REQUEST_RESOLVE_ERROR);\n }",
"void showError(String message);",
"void showError(String message);",
"@Override\n\t\t\tpublic void onError(DialogError e) {\n\n\t\t\t}",
"public void showError(String message) {\n JOptionPane.showMessageDialog(this, message, \"Error!\", JOptionPane.ERROR_MESSAGE);\n }",
"void showError(Throwable throwable);",
"@Override\n\t\t\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\t\tWindow.alert(\"Failure : \" + caught.getMessage());\n\t\t\t\t\t}",
"@Override\n\t\t\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\t\tWindow.alert(\"Failure : \" + caught.getMessage());\n\t\t\t\t\t}",
"public static void sofbusDatabaseErrorDialog(Activity context) {\n\n // Get tracker\n Tracker tracker = ((GlobalEntity) context.getApplicationContext())\n .getTracker(TrackerName.APP_TRACKER);\n if (tracker == null) {\n return;\n }\n\n // Build and send an Event\n tracker.send(new HitBuilders.EventBuilder()\n .setCategory(\"Database Error Dialog\")\n .setAction(\"sofbusDatabaseErrorDialog\")\n .setLabel(\"sofbusDatabaseErrorDialog\").build());\n }",
"public void msgErreur(){\n \n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Entrée invalide\");\n alert.setHeaderText(\"Corriger les entrées invalides.\");\n alert.setContentText(\"Les informations entrées sont erronnées\");\n\n alert.showAndWait();\n \n\n}",
"public void run() {\n Intent in = new Intent(activity, serverconnectionerror.class);\n in.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n activity.startActivity(in);\n }",
"private void showErrorPage() {\n setContentView(R.layout.main);\n\n // The specified network connection is not available. Displays error message.\n WebView myWebView = (WebView) findViewById(R.id.webview);\n myWebView.loadData(getResources().getString(R.string.connection_error),\n \"text/html\", null);\n }",
"public void displayError(String e){\n\t\tJOptionPane.showMessageDialog(null, e, \"Error\", JOptionPane.ERROR_MESSAGE);\n\t}",
"@Override\n public void onPlayerError(ExoPlaybackException error) {\n AlertDialog.Builder adb = new AlertDialog.Builder(this);\n adb.setTitle(\"Could not able to stream video\");\n adb.setMessage(\"It seems that something is going wrong.\\nPlease try again.\");\n adb.setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n finish(); // take out user from this activity. you can skip this\n }\n });\n AlertDialog ad = adb.create();\n ad.show();\n }",
"private static void fatalError(Exception e) {\n\t\tif (SwingUtilities.isEventDispatchThread()) {\n\t\t\tfinal StringWriter stacktraceW = new StringWriter();\n\t\t\te.printStackTrace(new PrintWriter(stacktraceW, true));\n\n\t\t\tjavax.swing.JOptionPane\n\t\t\t\t\t.showMessageDialog(null,\n\t\t\t\t\t\t\te.getClass() + \"\\n\" + e.getLocalizedMessage() + \"\\n\\nStacktrace:\\n\"\n\t\t\t\t\t\t\t\t\t+ stacktraceW.getBuffer().toString(),\n\t\t\t\t\t\t\t\"Fatal Error\", javax.swing.JOptionPane.ERROR_MESSAGE);\n\t\t\te.printStackTrace();\n\t\t} else {\n\t\t\t// If not on EDT, then schedule for execution on EDT\n\t\t\ttry {\n\t\t\t\tSwingUtilities.invokeAndWait(new Runnable() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tfatalError(e);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} catch (InvocationTargetException | InterruptedException e1) {\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"public static void setErrorMessage(String text) {\n\t JOptionPane optionPane = new JOptionPane(text,JOptionPane.ERROR_MESSAGE);\n\t JDialog dialog = optionPane.createDialog(\"Erro\");\n\t dialog.setAlwaysOnTop(true);\n\t dialog.setVisible(true);\n\t}",
"public void showError(String errorMessage);",
"private void showMissingPermissionError() {\n PermissionUtils.PermissionDeniedDialog\n .newInstance(true).show(getFragmentManager(), \"dialog\");\n }",
"private void notifyUiApiFailure() {\n\n if (stillAlive()) {\n\n AlertDialog.Builder alertDialog = new AlertDialog.Builder(getActivity());\n View convertView = getActivity().getLayoutInflater().inflate(R.layout.api_error_alert_title, null);\n alertDialog.setCustomTitle(convertView);\n\n alertDialog.setNegativeButton(\"OK\", new DialogInterface.OnClickListener() {\n\n @Override\n public void onClick(DialogInterface dialog, int id) {\n\n }\n });\n\n // Set the line color\n Dialog d = alertDialog.show();\n int dividerId = d.getContext().getResources().getIdentifier(\"android:id/titleDivider\", null, null);\n View divider = d.findViewById(dividerId);\n divider.setBackground(new ColorDrawable(Color.parseColor(\"#00274c\")));\n }\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n int errorCode = this.getArguments().getInt(DIALOG_ERROR);\n return GooglePlayServicesUtil.getErrorDialog(errorCode,\n this.getActivity(), REQUEST_RESOLVE_ERROR);\n }",
"private void popupMessage(String message) {\n\t\tJOptionPane.showMessageDialog(this, message, \"Error\", JOptionPane.ERROR_MESSAGE);\n\t}",
"@Override\n public void onFailure(@NonNull Exception e) {\n if (progressDialog.isShowing()) {\n progressDialog.dismiss();\n }\n\n showErrorMessageDialogue(\"Some error just happened. \" +\n \"Please try again in a little bit.\");\n\n }"
] | [
"0.70707214",
"0.69691235",
"0.6491161",
"0.6490379",
"0.6486897",
"0.64805144",
"0.6471342",
"0.6386883",
"0.6347939",
"0.62415487",
"0.62271184",
"0.62115294",
"0.6205256",
"0.62052083",
"0.61896336",
"0.6166855",
"0.6139896",
"0.6086913",
"0.6075707",
"0.6073965",
"0.60696363",
"0.6069619",
"0.6062316",
"0.6055113",
"0.60330135",
"0.6032752",
"0.60090965",
"0.5954571",
"0.59524494",
"0.5948195",
"0.5934156",
"0.5927116",
"0.59097016",
"0.590573",
"0.5905034",
"0.58906955",
"0.5890694",
"0.5885946",
"0.58670634",
"0.58589137",
"0.5855804",
"0.5855674",
"0.58514977",
"0.5847965",
"0.58460915",
"0.5826396",
"0.5821282",
"0.58164567",
"0.5810983",
"0.58068544",
"0.57832557",
"0.57787734",
"0.57652366",
"0.57633775",
"0.57609326",
"0.5750325",
"0.57500213",
"0.57468283",
"0.574547",
"0.5743751",
"0.57375836",
"0.57339674",
"0.57250303",
"0.5717589",
"0.5707841",
"0.57047457",
"0.57028097",
"0.57016903",
"0.56989825",
"0.569454",
"0.56903017",
"0.5689603",
"0.5688642",
"0.5687906",
"0.5682294",
"0.56786233",
"0.56774074",
"0.5672575",
"0.56683034",
"0.56573874",
"0.56546044",
"0.56546044",
"0.5653242",
"0.56512105",
"0.56399125",
"0.5638994",
"0.5638994",
"0.56368047",
"0.5634451",
"0.56343216",
"0.5631941",
"0.56275016",
"0.5610993",
"0.5608008",
"0.5601648",
"0.5597275",
"0.55937827",
"0.5593613",
"0.5590793",
"0.558882",
"0.5577288"
] | 0.0 | -1 |
try to shut down some things gracefully | public void shutdown() {
YbkService.stop(ErrorDialog.this);
System.runFinalizersOnExit(true);
// schedule actual shutdown request on a background thread to give the service a chance to stop on the
// foreground thread
new Thread(new Runnable() {
public void run() {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
}
System.exit(-1);
}
}).start();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void abnormalShutDown() {\n\t}",
"public void shutDown();",
"void shutDown();",
"public void shutDown ()\n {\n org.omg.CORBA.portable.InputStream $in = null;\n try {\n org.omg.CORBA.portable.OutputStream $out = _request (\"shutDown\", true);\n $in = _invoke ($out);\n return;\n } catch (org.omg.CORBA.portable.ApplicationException $ex) {\n $in = $ex.getInputStream ();\n String _id = $ex.getId ();\n throw new org.omg.CORBA.MARSHAL (_id);\n } catch (org.omg.CORBA.portable.RemarshalException $rm) {\n shutDown ( );\n } finally {\n _releaseReply ($in);\n }\n }",
"public void ShutDown()\n {\n bRunning = false;\n \n LaunchLog.Log(COMMS, LOG_NAME, \"Shut down instruction received...\");\n\n for(LaunchServerSession session : Sessions.values())\n {\n LaunchLog.Log(COMMS, LOG_NAME, \"Closing session...\");\n session.Close();\n }\n \n LaunchLog.Log(COMMS, LOG_NAME, \"...All sessions are closed.\");\n }",
"public synchronized void shutDown() {\n\t state.shutDown();\n\t}",
"private void shutDown() {\r\n\t\t\r\n\t\t// send shutdown to children\r\n\t\tlogger.debug(\"BagCheck \"+ this.lineNumber+\" has sent an EndOfDay message to it's Security.\");\r\n\t\tthis.securityActor.tell(new EndOfDay(1));\r\n\r\n\t\t// clear all references\r\n\t\tthis.securityActor = null;\r\n\t}",
"protected abstract void shutdown();",
"public void cleanShutDown () {\n shutdown = true;\n }",
"public void shutdown() {\n fsManager.getOpenFileSystems().forEach(JGitFileSystem::close);\n shutdownSSH();\n forceStopDaemon();\n fsManager.clear();\n }",
"void shutdown() throws Exception;",
"@Override\n protected void shutDown() {\n }",
"public static void shutdown() {\n\t}",
"public void shutdown() {\n shutdown(false);\n }",
"public void shutdown() {\r\n System.exit(0);\r\n }",
"public synchronized void shutdown() {\n try {\n stop();\n } catch (Exception ex) {\n }\n \n try {\n cleanup();\n } catch (Exception ex) {\n }\n }",
"@Override\n public void shutDown() {\n }",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"void shutdown();",
"public void shutdown();",
"public void shutdown();",
"public void shutdown();",
"public void shutdown();",
"public void shutdownSilently() {\n shutdownSilently(true);\n }",
"public static void shutdown() {\n\t\t// Ignore\n\t}",
"public abstract void shutdown();",
"public abstract void shutdown();",
"public abstract void shutdown();",
"public abstract void shutdown();",
"public void shutdown()\n {\n // todo\n }",
"private void shutdown() {\n\t\ttry {\n\t\t\tsock.close();\n\t\t\tgame.handleExit(this);\n\t\t\tstopped = true;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t}",
"private static void shutdownGracefully() {\n //record out file time for the last access to the stream.\n try {\n disruptor.shutdown();\n setLastReadTime();\n closeCouchbaseClient();\n } catch (Exception ex) {\n //not much we can do, what if our logging is already shutdown or not up\n // when this happens?\n ex.printStackTrace();\n }\n\n }",
"boolean isShutdownGraceful();",
"private void shutdown()\n\t\t{\n\t\tif (myChannelGroup != null)\n\t\t\t{\n\t\t\tmyChannelGroup.close();\n\t\t\t}\n\t\tif (myHttpServer != null)\n\t\t\t{\n\t\t\ttry { myHttpServer.close(); } catch (IOException exc) {}\n\t\t\t}\n\t\tmyLog.log (\"Stopped\");\n\t\t}",
"public void shutDown()\n {\n // Runtime.getRuntime().removeShutdownHook(shutdownListener);\n //shutdownListener.run();\n }",
"public void shutDown() {\n StunStack.shutDown();\n stunStack = null;\n stunProvider = null;\n requestSender = null;\n\n this.started = false;\n\n }",
"public void shutdown() {\n // For now, do nothing\n }",
"private void gracefullyShutdown() {\n try {\n this.inputStream.close();\n this.outputStream.close();\n } catch (IOException e) {\n // If there is an exception then there's nothing to be done.\n }\n }",
"protected void takeDown() {\n\t\ttry {\r\n\t\t\tDFService.deregister(this);\r\n\t\t}\r\n\t\tcatch (FIPAException fe) {\r\n\t\t\tfe.printStackTrace();\r\n\t\t}\r\n\r\n // connec.desconectar();\r\n\t\t// Printout a dismissal message\r\n\t\tSystem.out.println(\"Supplier-agent \"+getAID().getName()+\" terminating.\");\r\n\t}",
"private static void shutdown() {\n\t\tSystem.out.println(\"Shutting down ...\");\n\t\tpool.shutdown();\n\t\tfor (Client client : clientMap.values()) {\n\t\t\tclient.cleanup();\n\t\t}\n\n\t\t// wait until all threads complete\n\t\ttry {\n\t\t\tif (!pool.awaitTermination(30, TimeUnit.SECONDS)) {\n\t\t\t\tSystem.out.println(\"Force shutdown after 30 seconds ...\");\n\t\t\t\tpool.shutdownNow();\n\t\t\t\tif (!pool.awaitTermination(30, TimeUnit.SECONDS)) {\n\t\t\t\t\tSystem.out.println(\"Terminate the process.\");\n\t\t\t\t\tThread.currentThread().interrupt();\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (InterruptedException e) {\n\t\t\tThread.currentThread().interrupt();\n\t\t}\n\t}",
"public void shutdown(){\n \tSystem.out.println(\"SHUTTING DOWN..\");\n \tSystem.exit(0);\n }",
"public void shutdown() {\n\t\t\n\t}",
"public static void systemShutdown() throws IOException {\n\t\t/*Runtime runtime = Runtime.getRuntime();\n\t\tProcess proc = runtime.exec(\"shutdown -l -t 30\");//.exec(\"shutdown -l\");//.exec(\"shutdown -l -t 0\").exec(\"shutdown -r\");\t\t\n\t\tSystem.out.println(\"\"+proc);\n\t\tSystem.exit(0);*/\n\t}",
"public void shutDown() throws CouponSystemException, SQLException {\r\n\r\n\t\ttry {\r\n\t\t\tConnectionPool.getInstance().closeAllCon();\r\n\t\t} catch (CouponSystemException e) {\r\n\t\t\tCouponSystemException coupSyEx = new CouponSystemException(\"Failed to close all connections\");\r\n\t\t\tthrow coupSyEx;\r\n\t\t}\r\n\t}",
"void shutDownServer() throws Exception;",
"private void shutDown() {\n this.setState(State.SHUTTING);\n // clean all msg queues\n if (isRoot()) {\n System.out.println(String.format(\"%s: shutdown\", Thread.currentThread().getName()));\n Neighbor pseudoParent = null;\n ArrayList<Neighbor> children = node.getChildren();\n if (children.isEmpty()) {\n // shutDown fast\n } else {\n System.out.println(String.format(\"%s: looking for next root\", Thread.currentThread().getName()));\n for (Neighbor child : node.getChildren()) {\n try {\n child.sendMessage(\n new RootMessage(),\n child::detach\n ).get();\n pseudoParent = child;\n break;\n } catch (InterruptedException | CancellationException | ExecutionException e) {\n e.printStackTrace();\n System.err.println(Thread.currentThread().getName() + \": child not available\");\n }\n }\n\n if (pseudoParent != null) {\n System.out.println(String.format(\"%s: found next root\", Thread.currentThread().getName()));\n broadcastRejoin(pseudoParent);\n } else {\n // shutdown fast\n System.out.println(String.format(\"%s: didn't find next root\", Thread.currentThread().getName()));\n }\n }\n } else {\n try {\n Neighbor parent = node.parent;\n broadcastRejoin(parent);\n parent.sendMessage(new LeaveMessage(), this::detachParent).get();\n } catch (InterruptedException | ExecutionException e) {\n e.printStackTrace();\n }\n }\n setState(State.TERMINATED);\n }",
"protected void shutdown()\n throws SwiftletException {\n if (config == null)\n return;\n if (traceSpace.enabled) traceSpace.trace(getName(), \"shutdown ...\");\n rlgroups.clear();\n groups.clear();\n users.clear();\n publicRLGroup = null;\n publicGroup = null;\n authenticationOff = true;\n config = null;\n if (traceSpace.enabled) traceSpace.trace(getName(), \"shutdown: done.\");\n }",
"public void shutdown() {\n }",
"public void shutdown() {\n mGameHandler.shutdown();\n mTerminalNetwork.terminate();\n }",
"private void shutdown() {\n log.info(\"Shutting down\");\n kafka.shutdown();\n zookeeper.shutdown();\n }",
"public void shutdown() {\n // no-op\n }",
"public void shutdown()\n {\n // nothing to do here\n }",
"public void shutdown() {\n\t\tInput.cleanUp();\n\t\tVAO.cleanUp();\n\t\tTexture2D.cleanUp();\n\t\tResourceLoader.cleanUp();\n\t}",
"public void shutdown() {\n/* 188 */ this.shutdown = true;\n/* */ }",
"public void shutdown() {\n logger.debug(\"Shutting down.\");\n try {\n // stop the cleaner first\n if (cleaner != null)\n Utils.swallow(new Runnable() {\n @Override\n public void run() {\n cleaner.shutdown();\n }\n });\n // flush the logs to ensure latest possible recovery point\n Utils.foreach(allLogs(), new Callable1<Log>() {\n @Override\n public void apply(Log _) {\n _.flush();\n }\n });\n // close the logs\n Utils.foreach(allLogs(), new Callable1<Log>() {\n @Override\n public void apply(Log _) {\n _.close();\n }\n });\n // update the last flush point\n checkpointRecoveryPointOffsets();\n // mark that the shutdown was clean by creating the clean shutdown marker file\n Utils.foreach(logDirs, new Callable1<File>() {\n @Override\n public void apply(final File dir) {\n Utils.swallow(new Runnable() {\n @Override\n public void run() {\n try {\n new File(dir, Logs.CleanShutdownFile).createNewFile();\n } catch (IOException e) {\n throw new KafkaException(e);\n }\n }\n });\n }\n });\n } finally {\n // regardless of whether the close succeeded, we need to unlock the data directories\n Utils.foreach(dirLocks, new Callable1<FileLock>() {\n @Override\n public void apply(FileLock _) {\n _.destroy();\n }\n });\n }\n\n logger.debug(\"Shutdown complete.\");\n }",
"@Override\n protected void shutdown() {\n super.shutdown();\n // Now perform any other shutdown tasks you need.\n // ...\n }",
"void prepareForShutdown();",
"public static void shutdown() {\n\t\tSystem.err.println(\"shutdown initiated!\");\n\t\tBaseFuture bf0 = master.shutdown();\n\t\tbf0.awaitUninterruptibly();\n\t\tSystem.err.println(\"shutdown master done!\");\n\t\t\n\t\tBaseFuture bf1 = unreachable1.shutdown();\n\t\tbf1.awaitUninterruptibly();\n\t\tSystem.err.println(\"shutdown unreachable1 done!\");\n\n\t\tBaseFuture bf2 = unreachable2.shutdown();\n\t\tbf2.awaitUninterruptibly();\n\t\tSystem.err.println(\"shutdown unreachable 2 done!\");\n\t}",
"private static void kill() {\n if (redirectErr != null) {\n redirectErr.close();\n redirectErr.interrupt();\n redirectErr = null;\n }\n\n if (redirectOut != null) {\n redirectOut.close();\n redirectOut.interrupt();\n redirectOut = null;\n }\n\n if (JVM != null) {\n JVM.destroy();\n JVM = null;\n }\n\n JVMrunning = false;\n\n println(\"JVM reset on \" + java.util.Calendar.getInstance().getTime().toString(), progErr);\n }",
"@Override\n public void close() throws Exception {\n Future<Boolean> stopped = gracefulStop(mgr, Duration.create(5, TimeUnit.SECONDS));\n Await.result(stopped, Duration.create(5, TimeUnit.SECONDS));\n\n system.terminate();\n Await.result(system.whenTerminated(), Duration.create(5, TimeUnit.SECONDS));\n }",
"public void shutdown() {\n try {\n infoServer.stop();\n } catch (Exception e) {\n }\n this.shouldRun = false;\n ((DataXceiveServer) this.dataXceiveServer.getRunnable()).kill();\n try {\n this.storage.closeAll();\n } catch (IOException ie) {\n }\n }",
"@Override\r\n protected void shutdownInternal() {\r\n service.stop();\r\n }",
"public void shutdown() {\n this.shallRun = false;\n this.interrupt();\n Log.getLog().info(\"catched caretaker termination signal\");\n }",
"public void shutDown()\n\t{\n\t\tthis.threadPool.shutdown();\n\t}",
"public static void shutDown(){\n for(int i = PS3_LIST_.size()-1; i >= 0; i--){\n PS3 instance = PS3_LIST_.get(i);\n instance.setLed(false);\n instance.destroy();\n }\n PS3Logger.log(PS3Logger.TYPE.DEBUG, null, \"PS3 SHUTDOWN\");\n }",
"public void shutdown() {\n drivers.stream().filter(ClosingAwareWebDriver::isAlive)\n .forEach(ClosingAwareWebDriver::forceShutdown);\n }",
"protected void shutDown() throws Exception {\n logger.error(\"FetchCoinTask has been requested to shutdown\");\n }",
"protected void takeDown() {\n\t\t// Deregister from the yellow pages\n\t\ttry {\n\t\t\tDFService.deregister(this);\n\t\t}\n\t\tcatch (FIPAException fe) {\n\t\t\tfe.printStackTrace();\n\t\t}\n\t\t// Close the GUI\n\t\tmyGui.dispose();\n\t\t// Printout a dismissal message\n\t\tSystem.out.println(\"agent \"+getAID().getName()+\" terminating.\");\n\t}",
"private void doCleanup() {\n Log.INFO(\"Final cleanup\");\n try { // return to full-cluster-running state\n restartNode(); \n } catch (HoneycombTestException e) {\n Log.ERROR(\"Final cleanup failed: \" + e);\n }\n }",
"public void shutdown() {\n this.dontStop = false;\n }",
"public synchronized void terminate () {\n shutdown = true;\n }",
"public void stop() {\n if (isStop.compareAndSet(false, true)) {\n if (bootstrap.config().group() != null) {\n Future future = bootstrap.config().group().shutdownGracefully();\n ((io.netty.util.concurrent.Future) future).syncUninterruptibly();\n }\n for (BrpcChannelGroup channelGroup : healthyInstances) {\n channelGroup.close();\n }\n for (BrpcChannelGroup channelGroup : unhealthyInstances) {\n channelGroup.close();\n }\n if (timeoutTimer != null) {\n timeoutTimer.stop();\n }\n if (namingService != null) {\n namingService.unsubscribe(subscribeInfo);\n }\n if (healthCheckTimer != null) {\n healthCheckTimer.stop();\n }\n if (loadBalanceStrategy != null) {\n loadBalanceStrategy.destroy();\n }\n if (callbackThread != null) {\n callbackThread.shutdown();\n }\n if (threadPool != null) {\n threadPool.stop();\n }\n }\n }",
"@Override\n\tprotected void shutdown() throws Throwable {\n\t\t\n\t}",
"public void shutDown(){\n sequence128db.shutDown();\n }",
"private void stopDistributedSystem() {\n try {\n disconnectFromSystem();\n } catch (Exception e) {\n // disconnectFromSystem already prints any Exceptions\n } catch (VirtualMachineError err) {\n SystemFailure.initiateFailure(err);\n throw err;\n } catch (Error e) {\n // Whenever you catch Error or Throwable, you must also catch VirtualMachineError (see above).\n // However, there is _still_ a possibility that you are dealing with a cascading error\n // condition,\n // so you also need to check to see if the JVM is still usable:\n SystemFailure.checkFailure();\n }\n }",
"public void shutDown() {\n isShutdown = true;\n eventLoopGroup.shutdownGracefully().awaitUninterruptibly();\n timer.stop();\n }",
"public void shutdown() throws IOException, AutomationException {\n /*\n * The SOE should release its reference on the Server Object Helper.\n */\n this.serverLog.addMessage(3, 200, \"Shutting down \" + this.getClass().getName() + \" SOI.\");\n this.serverLog = null;\n }",
"private void shutdownThreads() {\n\t\tif (backupHeartbeatBroadcaster != null) {\n\t\t\tbackupHeartbeatBroadcaster.cancel();\n\t\t}\n\t\tif (activeHeartbeatTimer != null) {\n\t\t\tactiveHeartbeatTimer.cancel();\n\t\t}\n\t\tif (serverLatencyProcessorTimer != null) {\n\t\t\tserverLatencyProcessorTimer.cancel();\n\t\t}\n\t\tif (backupHeartbeatTimer != null) {\n\t\t\tbackupHeartbeatTimer.cancel();\n\t\t}\n\t\tif (reElectionTimer != null) {\n\t\t\treElectionTimer.cancel();\n\t\t}\n\t\tif (preElectionTimeoutTimer != null) {\n\t\t\tpreElectionTimeoutTimer.cancel();\n\t\t}\n\t}",
"public void shutdown() {\n logger.info(\"Shutting down modules.\");\n for (Module module : modules) {\n module.stop();\n }\n logger.info(\"Shutting down reporters.\");\n for (Reporter reporter : reporters.values()) {\n reporter.stop();\n }\n }",
"@Override\r\n\tprotected void shutdownSpecific() {\n\r\n\t}",
"@Override\r\n\tpublic void shutDown() {\r\n\t\tdown.set(true);\r\n\t\tif (shutDownImmediatelly) {\r\n\t\t\ttry {\r\n\t\t\t\tsuper.shutDown();\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tThread thread = new Thread(new Runnable() {\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void run() {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tSessionForUI.super.shutDown();\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tthread.setDaemon(true);\r\n\t\t\tthread.start();\r\n\t\t}\r\n\t}",
"public void shutdown() {\n for (TServer server : thriftServers) {\n server.stop();\n }\n try {\n zookeeper.shutdown();\n discovery.close();\n } catch (IOException ex) {\n //don't care\n }\n }",
"private void cleanUp(){\n\t\tSSHUtil sSHUtil=(SSHUtil) SpringUtil.getBean(\"sSHUtil\");\n\t\ttry {\n\t\t\tsSHUtil.disconnect();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void shutdown() {\n for (Connection connection : connections) { //Try closing all connections\n closeConnection(connection);\n }\n }",
"private static void giveUp() {\r\n\t\tSystem.out.println(\"The server will now terminate.\");\r\n\t\tthrow(new RuntimeException());\r\n\t}"
] | [
"0.7669424",
"0.74391806",
"0.7390662",
"0.7198128",
"0.7083221",
"0.70388037",
"0.70349085",
"0.7000221",
"0.69372785",
"0.69358224",
"0.6909055",
"0.6907676",
"0.68610823",
"0.6858003",
"0.6853744",
"0.6836953",
"0.68356276",
"0.68241405",
"0.68241405",
"0.68241405",
"0.68241405",
"0.68241405",
"0.68241405",
"0.68241405",
"0.68241405",
"0.68241405",
"0.68241405",
"0.68241405",
"0.68241405",
"0.68241405",
"0.68241405",
"0.68241405",
"0.68241405",
"0.68241405",
"0.6803451",
"0.6803451",
"0.6803451",
"0.6803451",
"0.6785129",
"0.67778474",
"0.67695856",
"0.67695856",
"0.67695856",
"0.67695856",
"0.6715115",
"0.66847205",
"0.66729",
"0.6665063",
"0.6662621",
"0.6646278",
"0.66322434",
"0.66196936",
"0.661708",
"0.6607782",
"0.66074723",
"0.66006273",
"0.6590717",
"0.6588895",
"0.6583424",
"0.6540192",
"0.6536798",
"0.652512",
"0.6522269",
"0.6516499",
"0.6497506",
"0.6495529",
"0.6479504",
"0.64730835",
"0.64596194",
"0.64522755",
"0.64515597",
"0.644989",
"0.642413",
"0.64168286",
"0.6409603",
"0.63984406",
"0.63943976",
"0.63853836",
"0.6384092",
"0.6367472",
"0.6351835",
"0.6348801",
"0.634067",
"0.6339324",
"0.6336199",
"0.6325937",
"0.632512",
"0.63207895",
"0.63205177",
"0.6315403",
"0.62997967",
"0.62985635",
"0.6297794",
"0.6297734",
"0.6295739",
"0.6294844",
"0.6290625",
"0.6289843",
"0.6282388",
"0.6278107"
] | 0.66351587 | 50 |
Called when the activity is going away. | @Override
protected void onStop() {
try {
super.onStop();
} catch (RuntimeException rte) {
Util.unexpectedError(this, rte);
} catch (Error e) {
Util.unexpectedError(this, e);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void onActivityDestroyed() {\n\t\tmTaskDetailNavigator = null;\n\t}",
"@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tActivityCollector.removeActivity(this);\n\t}",
"public void onActivityDestroy() {\n if (currentScreen != null) {\n currentScreen.onActivityDestroy();\n }\n }",
"public void onDestroy() {\n\t\tif (activity != null)\r\n\t\t\tactivity.finish();\r\n\t\tmUpdateTools.onDestroy();\r\n\t\tmDBTools.close();\r\n\t\tmNM.cancel(NOTIFICATION_ID);\r\n\t}",
"@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tMyApplication.getInstance().finishActivity(this);\n\t}",
"@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tAppManager.getAppManager().finishActivity(this);\n\t}",
"@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\trunActivity = 0;\r\n\t}",
"public void onDestroy() {\n if (getIntent() != null && getIntent().getBooleanExtra(Constants.EXTRA_FROM_MAINACTIVITY, false)) {\n MainActivity.gotoMainActivity(this);\n }\n super.onDestroy();\n }",
"@Override\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tManager.onDestroy();\n\t\tSystem.out.println(\"DESTROYING APP\");\n//\t\tManager.analytics.sendUserTiming(\"Total Activity Time\", System.currentTimeMillis() - game.activityStartTime);\n\t}",
"@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tappManager.finishActivity(this);\n\t}",
"@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\t\r\n\t\tImemberApplication.getInstance().getLogonSuccessManager().removeLogonSuccessListener(this);\r\n\t\tImemberApplication.getInstance().getLoginSuccessManager().removeLoginSuccessListener(this);\r\n\t\t\r\n\t\tSystem.out.println(\"MyCardListActivity---------kill\");\r\n\t}",
"@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\t// 结束Activity从堆栈中移除\r\n//\t\tActivityManagerUtil.getActivityManager().finishActivity(this);\r\n\t}",
"public void onDeactivation() { }",
"@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\ttActivityDisplay.setText(\"On Destroy called\");\n\t}",
"protected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t}",
"public void onStop() {\n super.onStop();\n ApplicationStateMonitor.getInstance().activityStopped();\n }",
"public void onDestroy();",
"public void onDestroy();",
"@Override\r\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tif (wt != null && !wt.isCancelled()) {\r\n\t\t\twt.cancel(true);\r\n\t\t}\r\n\t}",
"public void onDestroy() {\n BroadcastReceiver broadcastReceiver = this.mConnectionReceiver;\n if (broadcastReceiver != null) {\n unregisterReceiver(broadcastReceiver);\n }\n Handler handler = this.mHandler;\n if (handler != null) {\n handler.removeCallbacksAndMessages((Object) null);\n }\n NetworkDiagnosticsActivity.super.onDestroy();\n }",
"@Override\n public void onDestroy() {\n setStatusMessage(R.string.not_tracking);\n // Stop the persistent notification.\n mNotificationManager.cancel(NOTIFICATION_ID);\n // Release the wakelock\n if (mWakelock != null) {\n mWakelock.release();\n }\n super.onDestroy();\n }",
"@Override\n protected void onDestroy() {\n mActivityGraph = null;\n super.onDestroy();\n }",
"@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\t MainService.allActivity.remove(this);\n\t}",
"@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tdismissWindow();\n\t}",
"@Override\n protected void onDestroy() {\n\n activitiesLaunched.getAndDecrement();\n\n super.onDestroy();\n\n }",
"@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tstop();\n\t}",
"@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tSystem.exit(0);\n\t}",
"@Override\r\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tLog.e(TAG, \"ondestory\");\r\n\t}",
"@Override\r\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tLog.e(TAG, \"ondestory\");\r\n\t}",
"public void onDetachedFromWindow() {\n AppMethodBeat.m2504i(92670);\n super.onDetachedFromWindow();\n if (this.accessTokenTracker != null) {\n this.accessTokenTracker.stopTracking();\n }\n dismissToolTip();\n AppMethodBeat.m2505o(92670);\n }",
"@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tCleanup();\r\n\t}",
"private void closeActivity() {\n final Handler handler = new Handler(Looper.getMainLooper());\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n finish();\n }\n }, 250);\n }",
"protected void onDestroy() {\n }",
"public void onDestroy() {\n WorkAsyncTask workAsyncTask = this.mWorkAsyncTask;\n if (workAsyncTask != null) {\n workAsyncTask.setClose();\n this.mWorkAsyncTask = null;\n }\n super.onDestroy();\n }",
"protected void onDestroy()\n {\n super.onDestroy();\n Log.d(TAG, \"onDestroy() called in InfoActivity\");\n }",
"@Override\n protected void onDestroy() {\n Initialization.exit(this);\n super.onDestroy();\n }",
"protected void onExit() {\r\n\t\tnew DelayAsyncTask(this, 500).execute();\r\n\t}",
"public void onDestroy() {\n this.mZxingview.onDestroy();\n super.onDestroy();\n }",
"public void onDestroy() {\r\n }",
"protected void onDestroy ()\n\t{\n\t\tsuper.onDestroy ();\n\t}",
"@Override\r\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tif (wt != null && !wt.isCancelled()) {\r\n\t\t\twt.cancel(true);\r\n\t\t}\r\n\t\t\r\n\t\tactivity.unregisterReceiver(receiver);\r\n\t}",
"public void onDestroy() {\n LOG.mo8825d(\"[onDestroy]\");\n super.onDestroy();\n }",
"public void destroy() {\n Logger.d(TAG, \"onDestroy() entry\");\n if (mActivity != null) {\n mActivity = null;\n }\n if (mListener != null) {\n mListener = null;\n }\n if (mData != null) {\n mData.clear();\n }\n Logger.d(TAG, \"onDestroy() exit\");\n }",
"public void onDestroy() {\n \twifiLock.release();\n \tstopForeground(true);\n \tradio.stop();\n \tradio.release();\n \tradio = null;\n }",
"@Override\n\tprotected void onDestroy() {\n\t\tthread.interrupt();\n\t\tsuper.onDestroy();\n\t}",
"private void disconnect() {\n activityRunning = false;\n MRTClient.getInstance().doHangup();\n MRTClient.getInstance().removeClientListener(this);\n\n finish();\n }",
"@Override\n public void onDestroy() {\n super.onDestroy();\n Log.d(msg, \"The onDestroy() event\");\n }",
"@Override\n public void onDestroy() {\n super.onDestroy();\n Log.d(msg, \"The onDestroy() event\");\n }",
"public void onDestroy() {\n super.onDestroy();\n }",
"public void onDestroy() {\n super.onDestroy();\n }",
"public void onDestroy() {\n super.onDestroy();\n }",
"@Override\n protected void onDestroy() {\n \tsuper.onDestroy();\n \tmActivities.removeActivity(\"SetOrResetWifi\");\n \tunregisterReceiver(receiver);\n }",
"@Override\n public void onDestroy() {\n super.onDestroy();\n finish();\n }",
"@Override\n\tprotected void onDestroy() {\n\t\tSystem.out.println(\"----->main activity onDestory!\");\n\t\tsuper.onDestroy();\n\t}",
"@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tLog.e(TAG, \"onDestroy\");\r\n\t}",
"@Override\n\t\tpublic void onDestroy() {\n\t\t\tsuper.onDestroy();\n\t\t\tToast.makeText(getApplicationContext(), \"onDestroy\", Toast.LENGTH_SHORT).show();\n\n\t\t\tLog.d(msg, \"The onDestroy() event\");\n\t\t}",
"public void onDestroy() {\n WhiteListActivity.super.onDestroy();\n try {\n getLoaderManager().destroyLoader(100);\n getContentResolver().unregisterContentObserver(this.j);\n } catch (Exception e2) {\n Log.e(\"WhiteListActivity\", e2.toString());\n }\n }",
"public void onDetachedFromWindow() {\n super.onDetachedFromWindow();\n removeCallbacks(this.aul);\n }",
"@Override\n\tprotected void onDestroy() {\n\n\t\t// Force-stop the timer if required.\n\t\tif (timerUpdateThread != null) {\n\t\t\ttimerUpdateThread.interrupt();\n\t\t\ttimerUpdateThread = null;\n\t\t}\n\n\t\t// if we're in the middle of a session, stop it gracefully.\n\t\t// TODO Maybe refactor so we don't stop the session here.\n\t\tif (workoutService != null) {\n\t\t\tworkoutService.getService().setWorkoutServiceListener(null);\n\n\t\t\tif (workoutService.getService().getStatus().isMonitoring()) {\n\t\t\t\tworkoutService.getService().endWorkout();\n\t\t\t\tlogger.debug(\"onDestroy(): Stopped an in-progress session before quitting activity.\");\n\t\t\t}\n\t\t}\n\n\t\t// Unbind from, and stop, the workout service here.\n\t\t// TODO Maybe don't stop the service.\n\t\tif (workoutServiceIntent != null) {\n\t\t\tunbindService(workoutServiceConn);\n\t\t\tstopService(workoutServiceIntent);\n\t\t\tlogger.debug(\"onDestroy(): Unbound from Workout service.\");\n\t\t}\n\n\t\tsuper.onDestroy();\n\t}",
"public void onDestroy() {\n super.onDestroy();\n onFinish();\n MediaController.getInstance().setFeedbackView(this.chatActivityEnterView, false);\n if (this.wakeLock.isHeld()) {\n this.wakeLock.release();\n }\n BackupImageView backupImageView = this.avatarImageView;\n if (backupImageView != null) {\n backupImageView.setImageDrawable((Drawable) null);\n }\n }",
"@Override\n\tprotected void onDestroy()\n\t{\n\t\tif (this.isInvalidLaunch) {\n\t\t\tactivityOnDestroy();\n\t\t\treturn;\n\t\t}\n\n\t\t// Remove the onNewIntent() listener from the root activity.\n\t\tTiRootActivity rootActivity = getTiApp().getRootActivity();\n\t\tif (rootActivity != null) {\n\t\t\trootActivity.removeOnNewIntentListener(this.rootNewIntentListener);\n\t\t}\n\t\tthis.rootNewIntentListener = null;\n\n\t\t// Invoke the activity proxy's \"onDestroy\" callback.\n\t\tfireOnDestroy();\n\n\t\t// Destroy this activity.\n\t\tsuper.onDestroy();\n\t}",
"@Override\n\tpublic void onDestroy() {\n\t\tif (meichecked)\n\t\t\tmeil.stopLog();\n\t\twlock.release();\n\t\tdestroyNotification();\n\t\tsuper.onDestroy();\n\t}",
"public void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tmWakeLock.release();\n\t}",
"@Override\r\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t}",
"@Override\r\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t}",
"@Override\r\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t}",
"@Override\r\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t}",
"public void onBackPressed() {\n // do nothing. We want to force user to stay in this activity and not drop out.\n }",
"@Override\n\tprotected void onDestroy(){\n\t\tsuper.onDestroy();\n\t\tLog.d(msg, \"HomePageActivity onDestroy() event\");\n\t}",
"@Override\n protected void onDestroy() {\n android.os.Process.killProcess(android.os.Process.myPid());\n super.onDestroy();\n // this.finish();\n }",
"@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t}",
"@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t}",
"@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t}",
"@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t}",
"@Override\r\n protected void onDestroy() {\n super.onDestroy();\r\n Log.i(TAG, \"onDestroy\");\r\n\r\n }",
"@Override\n public void onDestroy() {\n notificationManager.cancel(AbstractTrackerActivity.NOTIFICATION_ID);\n locationManager.removeUpdates(this);\n super.onDestroy();\n }",
"@Override\n\tprotected void onDestroy() {\n\t\thandler.removeCallbacks(null);\n\t\tMyApplication.Tag = 0;\n\t\tsuper.onDestroy();\n\t}",
"private void stop() {\n if (lifecycle != null) {\n lifecycle.removeObserver(this);\n return;\n }\n activity.getApplication().unregisterActivityLifecycleCallbacks(this);\n }",
"@Override\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\n\n\t\tif (D)\n\t\t\tLog.e(TAG, \"--- ON DESTROY ---\");\n\t}",
"@Override\n protected void onDestroy() {\n super.onDestroy();\n if (fireworkView.isRunning()) {\n fireworkView.setRunning(false);\n }\n }",
"@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tstopTimer();\r\n\t}",
"public void onDestroy() {\n }",
"@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\n\t\t// Log\n\t\tString log_msg = \"Destroying...\";\n\n\t\tLog.d(\"[\" + \"ShowMapActv.java : \"\n\t\t\t\t+ +Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t+ \" : \"\n\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getMethodName()\n\t\t\t\t+ \"]\", log_msg);\n\t\tthis.finish();\n\t\t\n\t\tthis.overridePendingTransition(0, 0);\n\t\t\n\t\tlocationObtained = false;\n\t\t\n\t}",
"@Override\n public void onDestroy() {\n\t\tmNotificationManager.cancel(NOTIFICATION_ID);\n\t}",
"public void onDisconnected() {\n\t\t\r\n\t}",
"@Override\n public void onTaskRemoved(Intent intent) {\n stopSelf();\n }",
"public void exitActivity() {\n\n finish();\n\n }",
"@Override\n\tprotected void onDestroy() {\n\t\t\n\t\tsuper.onDestroy();\n\t}",
"@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tLog.e(TAG, \"onDestroy\");\n\t}",
"@Override\n protected void onDestroy() {\n super.onDestroy();\n Log.d(TAG, \"onDestroy() called\");\n }",
"@Override\n public void onDestroy() {\n // Stop location manager\n if (locationManager != null) {\n locationManager.stopUsingGPS();\n }\n // Release video\n if (videoPlayer != null) {\n videoPlayer.stop();\n videoPlayer.release();\n videoPlayer = null;\n }\n\n // Remove eventId\n UserPreferences.sharedInstance().setEventId(null);\n super.onDestroy();\n }",
"@Override\n public void onDestroy() {\n super.onDestroy();\n\n this.stopForeground(true);\n }",
"@Override\n\tprotected void onDestroy() {\n\t\n\t\t\tLog.d(\"collectData\", \"onDestroy\");\n\t\t\t((MyApp)getApplicationContext()).stopTryToConnect();\n\t\t\t\n\t\t\n\t\t\n\t\tsuper.onDestroy();\n\t}",
"@Override\r\n public void onDestroy() {\n super.onDestroy();\r\n }",
"@Override\r\n public void onDestroy() {\n super.onDestroy();\r\n }",
"@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tLog.e(\"mainactivity\", \"destroyed\");\n\t}",
"@Override\n public void onDetach() {\n if (callbackManager != null) callbackManager.setActivity(null);\n super.onDetach();\n }",
"@Override\n public void onDetach()\n {\n super.onDetach();\n mActivity = null;\n mTask.cancel(true);\n }",
"public void onDestroy() {\n cancelPausedTimer();\n k.a().b();\n stopSocket();\n clearAllMapData();\n if (this.pushManager != null) {\n this.pushManager.i();\n this.pushManager = null;\n }\n if (this.liveAnimationView != null) {\n this.liveAnimationView.onDestroy();\n }\n if (this.mLivePusherInfoView != null) {\n this.mLivePusherInfoView.onDestroy();\n }\n if (this.countDownAnimSet != null) {\n this.countDownAnimSet.cancel();\n }\n if (this.mainHandler != null) {\n this.mainHandler.removeCallbacksAndMessages(null);\n this.mainHandler = null;\n }\n if (this.workHandler != null) {\n this.workHandler.removeCallbacksAndMessages(null);\n this.workHandler = null;\n }\n if (this.mGiftBoxView != null) {\n this.mGiftBoxView.release();\n }\n if (this.mInputTextMsgDialog != null) {\n this.mInputTextMsgDialog.onDestroy();\n this.mInputTextMsgDialog = null;\n }\n super.onDestroy();\n }",
"@Override\r\n\tpublic void onDestroy() {\n\t\t\r\n\t}",
"public void onStop() {\n super.onStop();\n finish();\n }"
] | [
"0.7614211",
"0.7410722",
"0.7336401",
"0.72238016",
"0.7170945",
"0.7142572",
"0.7139328",
"0.707454",
"0.7038665",
"0.7036801",
"0.6947479",
"0.69331825",
"0.6918942",
"0.6914844",
"0.6897789",
"0.6893693",
"0.6890087",
"0.6890087",
"0.68834716",
"0.6882826",
"0.6882218",
"0.6881478",
"0.68797976",
"0.6875739",
"0.6860219",
"0.6857397",
"0.68522257",
"0.6835041",
"0.6835041",
"0.6833271",
"0.6827715",
"0.6825938",
"0.68188494",
"0.68134856",
"0.6813283",
"0.68108696",
"0.6804236",
"0.679016",
"0.67889845",
"0.6788145",
"0.6785939",
"0.67851216",
"0.67812157",
"0.6763878",
"0.6759088",
"0.67499065",
"0.6742703",
"0.6742703",
"0.674098",
"0.674098",
"0.674098",
"0.6735702",
"0.6735123",
"0.6723386",
"0.6720347",
"0.67126507",
"0.6702621",
"0.67015785",
"0.6701536",
"0.6690259",
"0.66844964",
"0.66779757",
"0.66731024",
"0.66730237",
"0.66730237",
"0.66730237",
"0.66730237",
"0.6670141",
"0.66682845",
"0.6662603",
"0.6660084",
"0.6660084",
"0.6660084",
"0.6660084",
"0.665938",
"0.6658708",
"0.6656614",
"0.6646478",
"0.66457343",
"0.6640608",
"0.6637352",
"0.6636349",
"0.6635626",
"0.66217804",
"0.66177386",
"0.66097134",
"0.6609587",
"0.6607654",
"0.66068405",
"0.6604159",
"0.6601439",
"0.6599069",
"0.65897614",
"0.6587585",
"0.6587585",
"0.65849245",
"0.6580887",
"0.65781575",
"0.6577611",
"0.6577239",
"0.6573304"
] | 0.0 | -1 |
1, 2D DP, O(N^4) time | public int maxSumSubmatrix(int[][] matrix, int k) {
int res=Integer.MIN_VALUE;
int rows=matrix.length, cols=matrix[0].length;
int[][] areas=new int[rows][cols];
for(int i=0; i<rows; i++){
for(int j=0; j<cols; j++){
int area=matrix[i][j];
if(i>0) area+=areas[i-1][j];
if(j>0) area+=areas[i][j-1];
if(i>0 && j>0) area-=areas[i-1][j-1];
areas[i][j]=area;
}
}
for(int r1=0; r1<rows; r1++){
for(int c1=0; c1<cols; c1++){
for(int r2=r1; r2<rows; r2++){
for(int c2=c1; c2<cols; c2++){
int sec=areas[r2][c2];
if(r1>0) sec-=areas[r1-1][c2];
if(c1>0) sec-=areas[r2][c1-1];
if(r1>0 && c1>0) sec+= areas[r1-1][c1-1];
if(sec<=k) res=Math.max(sec, res);
}
}
}
}
return res;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int solve() {\n dp[0][0] = 1;\n IntStream.rangeClosed(1, m).forEach(i ->\n IntStream.rangeClosed(0, n).forEach(j ->\n dp[i][j] = j - i >= 0 ?\n (dp[i - 1][j] + dp[i][j - i]) % M :\n dp[i - 1][j]));\n return dp[m][n];\n }",
"public static void main(String[] args) {\n\t\tint width=35;\n\t\tint length=31;\n\t\tlong[][] dp = new long[width+1][length+1];\n\t\tdp[0][0]=0;\n\t\tfor(int i=1;i<length+1;i++){\n\t\t\tif(badCheck(0,i,0,i-1)){\n\t\t\t\tdp[0][i]=0;\n\t\t\t\tfor(int k=i+1;k<length+1;k++){\n\t\t\t\t\tdp[0][k]=0;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}else{\n\t\t\t\tdp[0][i]=1;\n\t\t\t}\n\t\t}\n\t\tfor(int i=1;i<width+1;i++){\n\t\t\tif(badCheck(i,0,i-1,0)){\n\t\t\t\tdp[i][0]=0;\n\t\t\t\tfor(int k=i+1;k<width+1;k++){\n\t\t\t\t\tdp[k][0]=0;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}else{\n\t\t\t\tdp[i][0]=1;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i=1;i<=width;i++){\n\t\t\tfor(int j=1;j<=length;j++){\n\t\t\t\tif(!badCheck(i-1,j,i,j)){\n\t\t\t\t\tdp[i][j]+=dp[i-1][j];\n\t\t\t\t}\n\t\t\t\tif(!badCheck(i,j-1,i,j)){\n\t\t\t\t\tdp[i][j]+=dp[i][j-1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//System.out.println(dp[6][6]);\n\t\t//System.out.println(dp[2][2]);\n\t\t//System.out.println(dp[1][1]);\n\t\tSystem.out.println(dp[35][31]);\n\t}",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt(), M = scanner.nextInt();\n int[][] graph = new int[N + 1][N + 1];\n\n for (int i = 0; i < M; i++) {\n int from = scanner.nextInt(), to = scanner.nextInt();\n int weight = scanner.nextInt();\n graph[from][to] = weight;\n }\n \n int[][][] dp = new int[N + 1][N + 1][N + 1];\n\n for (int i = 1; i <= N; i++) {\n for (int j = 1; j <= N; j++) {\n if (graph[i][j] != 0) {\n dp[0][i][j] = graph[i][j];\n } else {\n dp[0][i][j] = Integer.MAX_VALUE;\n }\n }\n }\n \n for (int k = 0; k <= N; k++) {\n for (int i = 1; i <= N; i++) {\n dp[k][i][i] = 0;\n }\n }\n\n for (int k = 1; k <= N; k++) {\n for (int i = 1; i <= N; i++) {\n for (int j = 1; j <= N; j++) {\n if (dp[k - 1][i][k] != Integer.MAX_VALUE && dp[k - 1][k][j] != Integer.MAX_VALUE) {\n dp[k][i][j] = Math.min(dp[k - 1][i][j], dp[k -1][i][k] + dp[k -1][k][j]);\n } else {\n dp[k][i][j] = dp[k - 1][i][j];\n }\n }\n }\n }\n\n int Q = scanner.nextInt();\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < Q; i++) {\n int from = scanner.nextInt(), to = scanner.nextInt();\n int res = dp[N][from][to] == Integer.MAX_VALUE ? -1 : dp[N][from][to];\n sb.append(res).append('\\n');\n }\n System.out.println(sb.toString());\n }",
"private static void dp() {\n\t\tm[0] = 0;\n\t\tk[0] = 0;\n\n\t\t// base case 1:for 1 cent we need give 1 cent\n\t\tm[1] = 1;\n\t\tk[1] = 1;\n\n\t\tfor (int i = 2; i <= n; i++) {\n\t\t\tint min = Integer.MAX_VALUE;\n\t\t\tint sel = -1;\n\t\t\tfor (int j = 0; j < sd; j++) {\n\t\t\t\tint a = d[j];\n\t\t\t\tif (a > i) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tint v = 1 + m[i - a];\n\t\t\t\tif (v < min) {\n\t\t\t\t\tmin = v;\n\t\t\t\t\tsel = a;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (sel == -1)\n\t\t\t\tthrow new NullPointerException(\"sel != -1\");\n\t\t\tm[i] = min;\n\t\t\tk[i] = sel;\n\t\t}\n\t}",
"public static void main(String[] args)\n {\n Scanner sc = new Scanner(System.in);\n int sum = sc.nextInt();\n int N = sc.nextInt();\n sc.nextLine();\n int [][] arr = new int[N][2];\n for(int i = 0;i<N;i++)\n {\n arr[i][0] = sc.nextInt();\n arr[i][1] = sc.nextInt();\n sc.nextLine();\n }\n //Arrays.sort(arr, new Comparator<int[]>() {\n // @Override\n // public int compare(int[] o1, int[] o2) {\n // return o1[1]-o2[1]; //按第二列价值排个序。\n // }\n //});\n int [][] dp = new int[N+1][sum+1];\n int [][] path = new int[N+1][sum+1];\n for(int i = 1;i<=N;i++)\n {\n for(int j = 1;j<=sum;j++)\n {\n if(j<arr[i-1][0])\n dp[i][j] = dp[i-1][j];\n else\n {\n if(dp[i-1][j]<dp[i-1][j-arr[i-1][0]]+arr[i-1][1])\n path[i][j] = 1;\n dp[i][j] = Math.max(dp[i-1][j],dp[i-1][j-arr[i-1][0]]+arr[i-1][1]);\n }\n }\n }\n System.out.println(dp[N][sum]);\n\n int i = N;\n int j = sum;\n while (i>0&&j>0)\n {\n if(path[i][j]==1)\n {\n System.out.print(1+\" \");\n j -=arr[i-1][0];\n }\n else\n {\n i--;\n System.out.print(0+\" \");\n }\n }\n\n\n // 改进版。只使用一维数组。\n // int [] f = new int[sum+1];\n // for(int i = 0;i<N;i++)\n // {\n // for (int j = sum;j>=0;j--)\n // {\n // if(j>=arr[i][0])\n // f[j] = Math.max(f[j], f[j-arr[i][0]]+arr[i][1]);\n // }\n // }\n // System.out.println(f[sum]);\n\n }",
"public static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint t = s.nextInt();\n\t\twhile(t-->0)\n\t\t{\n\t\t\tint n = s.nextInt();\n\t\t\tint k = s.nextInt();\n\t\t\tint[] arr = new int[n];\n\t\t\tfor(int i=0;i<n;i++)\n\t\t\t\tarr[i] = s.nextInt();\n\t\t\tArrays.sort(arr);\n\t\t\tint[][] dp = new int[k+1][n+1];\n\t\t\tfor(int i=0;i<=k;i++)\n\t\t\t\tfor(int j=0;j<=n;j++)\n\t\t\t\t{\n\t\t\t\t\tif(i==0)\n\t\t\t\t\t\tdp[i][j] = 0;\n\t\t\t\t\telse if(j==0)\n\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\telse if(i-arr[j-1]>=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tint val1 = dp[i-arr[j-1]][j-1];\n\t\t\t\t\t\tint val2 = dp[i][j-1];\n\t\t\t\t\t\tif(val1!=-1 && val2!=-1)\n\t\t\t\t\t\t\tdp[i][j] = Math.min(1+val1,val2);\n\t\t\t\t\t\telse if(val1!=-1)\n\t\t\t\t\t\t\tdp[i][j] = 1+val1;\n\t\t\t\t\t\telse if(val2!=-1)\n\t\t\t\t\t\t\tdp[i][j] = val2;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(dp[i][j-1]==-1)\n\t\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdp[i][j] = dp[i][j-1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif(dp[k][n]!=-1)\n\t\t\t\tSystem.out.println(dp[k][n]);\n\t\t\telse\n\t\t\t\tSystem.out.println(\"impossible\");\n\t\t}\n\t}",
"static int paths_dp(int[][] matrix) {\n\t\tint n = matrix.length;\n\t\tint m = matrix[0].length;\n\t\t\n\t\tint[][] dp = new int[n][m];\n\t\tdp[0][0] = matrix[0][0] == 1? 0 : 1;\n\t\t\n\t\tfor(int i = 1; i < m; i++) {\n\t\t\tif(matrix[0][i] == 1) {\n\t\t\t\tdp[0][i] = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdp[0][i] = dp[0][i-1];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tif(matrix[i][0] == 1) {\n\t\t\t\tdp[i][0] = 0;\n\t\t\t} else {\n\t\t\t\tdp[i][0] = dp[i-1][0];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tfor(int j = 1; j < m; j++) {\n\t\t\t\tif(matrix[i][j] == 1 ) {\n\t\t\t\t\tdp[i][j] = 0;\n\t\t\t\t} else {\n\t\t\t\t\tdp[i][j] = dp[i-1][j] + dp[i][j+1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn dp[n-1][m-1];\n\t}",
"private int dfs(int[][] matrix, int i, int j, int d) {\n if (i < 0 || j < 0 || i == matrix.length || j == matrix[0].length || matrix[i][j] != 0)\n return 0;\n if (dp[i][j][d] > 0) return dp[i][j][d];\n timeComplexityCount++;\n maxI = Math.max(maxI, i);\n int res;\n if (d == 1)\n res = Math.max(dfs(matrix, i, j + 1, 1), dfs(matrix, i, j + 1, 2));\n else if (d == 0)\n res = Math.max(dfs(matrix, i, j - 1, 0), dfs(matrix, i, j - 1, 2));\n else\n res = Math.max(dfs(matrix, i + 1, j, 0), Math.max(dfs(matrix, i + 1, j, 1), dfs(matrix, i + 1, j, 2)));\n dp[i][j][d] = res + 1;\n return res + 1;\n }",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint [][][] dp = new int[n+1][m+1][m+1];\n\t\tint [][] arr = new int[n+1][m+1];\n\t\tint max = 1;\n\t\tfor (int i = 1; i <= n; i++) {\n\t\t\tfor (int j = 1; j <= m; j++) {\n\t\t\t\tarr[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor (int i = 1; i <= n; i++) {\n\t\t\tfor (int j = 1; j <= m; j++) {\n\t\t\t\tif (arr[i][j] == 1) {\n\t\t\t\t\tfor (int z = j; z <= m && arr[i][z] == 1; z++) {\n\t\t\t\t\t\tdp[i][j][z] = dp[i-1][j][z] + 1;\n\t\t\t\t\t\tmax = Math.max(max, Math.min(dp[i][j][z], z-j+1));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(max);\n\t}",
"int DFS(int i, int j) {\n if (dp[i][j] != 0)\n return dp[i][j];\n\n int steps = 0;\n int trial = 0;\n if (i < dp.length - 1 && matrix[i][j] < matrix[i+1][j]) {\n trial = DFS(i + 1, j);\n if (trial > steps)\n steps = trial;\n }\n if (i > 0 && matrix[i][j] < matrix[i-1][j]) {\n trial = DFS(i - 1, j);\n if (trial > steps)\n steps = trial;\n }\n if (j < dp[0].length - 1 && matrix[i][j] < matrix[i][j+1]) {\n trial = DFS(i, j + 1);\n if (trial > steps)\n steps = trial;\n }\n if (j > 0 && matrix[i][j] < matrix[i][j-1]) {\n trial = DFS(i, j - 1);\n if (trial > steps)\n steps = trial;\n }\n\n dp[i][j] = steps + 1;\n return dp[i][j];\n }",
"public static void main(String[] args) {\n \tlong[] fact = new long[MAXDOMINOES+1];\r\n \tfact[0] = 1;\r\n \tfor (int i=1; i<=MAXDOMINOES; i++)\r\n \t\tfact[i] = (fact[i-1]*i)%MOD;\r\n\r\n Scanner stdin = new Scanner(System.in);\r\n int numCases = stdin.nextInt();\r\n\r\n // Process each case.\r\n for (int loop=0; loop<numCases; loop++) {\r\n\r\n // Read in this case.\r\n n = stdin.nextInt();\r\n list = new int[n][2];\r\n for (int i=0; i<n; i++)\r\n for (int j=0; j<2; j++)\r\n list[i][j] = stdin.nextInt();\r\n\r\n // Special case - if all the dominoes are the same, all orderings work.\r\n if (same(list)) {\r\n \tSystem.out.println(fact[n]);\r\n \tcontinue;\r\n }\r\n\r\n // dp[mask][last][orientation] will store the number of permutations using the dominoes indicated by\r\n // mask, with the last domino last facing in the direction dictated by orientation. If orientation is 0,\r\n // this is the original input orientation, if it is 1, it's flipped.\r\n long[][][] dp = new long[1<<n][n][2];\r\n\r\n // Always 1 way to place one domino in a fixed orientation.\r\n for (int i=0; i<n; i++) {\r\n dp[1<<i][i][0] = 1;\r\n dp[1<<i][i][1] = 1;\r\n }\r\n\r\n // Outer DP loop, solve all problem instances for each subset of dominoes.\r\n for (int mask=3; mask<(1<<n); mask++) {\r\n\r\n // Now, try each domino as the last domino in mask.\r\n for (int last=0; last<n; last++) {\r\n\r\n // Not a valid state.\r\n if ((mask&(1<<last)) == 0) continue;\r\n\r\n int prevmask = mask - (1<<last);\r\n\r\n for (int i=0; i<n; i++) {\r\n\r\n if ((prevmask&(1<<i)) == 0) continue;\r\n\r\n // Both i and last are in regular orientation.\r\n if (list[i][1] == list[last][0])\r\n dp[mask][last][0] = (dp[mask][last][0]+dp[prevmask][i][0])%MOD;\r\n\r\n // Here i is flipped and last is regular.\r\n else if (list[i][0] == list[last][0])\r\n dp[mask][last][0] = (dp[mask][last][0]+dp[prevmask][i][1])%MOD;\r\n\r\n // i is regular but last is flipped.\r\n if (list[i][1] == list[last][1])\r\n dp[mask][last][1] = (dp[mask][last][1]+dp[prevmask][i][0])%MOD;\r\n\r\n // Both i and last are flipped.\r\n else if (list[i][0] == list[last][1])\r\n dp[mask][last][1] = (dp[mask][last][1]+dp[prevmask][i][1])%MOD;\r\n }\r\n } // end last loop\r\n } // end mask loop\r\n\r\n // Sum up result - all ways to place all dominoes over all possible last dominoes in either orientation.\r\n // Since we screened out our special case, no over-counting will occur here.\r\n long res = 0L;\r\n for (int last=0; last<n; last++) {\r\n \tres = (res + dp[(1<<n)-1][last][0])%MOD;\r\n \tif (list[last][0] != list[last][1])\r\n \t\tres = (res + dp[(1<<n)-1][last][1])%MOD;\r\n }\r\n System.out.println(res);\r\n }\r\n }",
"public static int f2(int N) { \n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n)\n // O(n)`\n for(int j = 0; j < i; j++) \n x++;\n return x;\n }",
"public int[] squareUp(int n) {\r\n int[]arreglo=new int[(n*n)]; // O(1)\r\n if(n==0){ // O(1)\r\n return arreglo; // O(1)\r\n }\r\n for(int i=n-1;i<arreglo.length;i=i+n){ // O(n)\r\n for (int j=i;j>=i-(i/n);j--){ // O(1)\r\n arreglo[j]=1+(i-j); // O(1)\r\n }\r\n }\r\n return arreglo; // O(1)\r\n}",
"public int numSolutions(int N, int M) {\n HashMap<Integer, Integer> dp = new HashMap<Integer, Integer>();\n dp.put(0, 1);\n for (int i = 0; i < N; ++i) {\n for (int j = 0; j < M; ++j) {\n HashMap<Integer, Integer> nDp = new HashMap<Integer, Integer>();\n for (Integer key : dp.keySet()) {\n int leftCell = getCell(key, j - 1);\n int upCell = getCell(key, j);\n int count = dp.get(key);\n if (upCell != 0) {\n // This is the last chance to fulfill upCell.\n if (upCell == 1 || upCell == 3) {\n // Don't paint this cell.\n int newKey = setCell(key, j, 0);\n addValue(nDp, newKey, count);\n } else {\n // Paint this cell.\n int current = 2 + (leftCell == 0 ? 0 : 1);\n int newKey = setCell(key, j, current);\n if (leftCell != 0) {\n newKey = setCell(newKey, j - 1, leftCell + 1);\n }\n addValue(nDp, newKey, count);\n }\n } else {\n // Don't paint this cell.\n int newKey = setCell(key, j, 0);\n addValue(nDp, newKey, count);\n // Paint this cell.\n if (leftCell == 0) {\n newKey = setCell(key, j, 1);\n } else {\n newKey = setCell(key, j - 1, leftCell + 1);\n newKey = setCell(newKey, j, 2);\n }\n addValue(nDp, newKey, count);\n }\n }\n dp = nDp;\n }\n }\n int result = 0;\n for (Integer key : dp.keySet()) {\n boolean valid = true;\n for (int i = 0; i < M; ++i) {\n int current = getCell(key, i);\n if (current == 2 || current == 4) {\n valid = false;\n break;\n }\n }\n if (valid) {\n result = (result + dp.get(key)) % MOD;\n }\n }\n return result;\n }",
"public boolean canPartition(int[] nums) {\n int sum = 0;\n int n = nums.length;\n for (int num : nums) sum += num;\n // sum cannot be splitted evenly\n if ((sum & 1) == 1) return false;\n int target = sum / 2;\n \n // dp[i][j] represents whether 0~i-1 numbers can reach\n // weight capacity j\n boolean[][] dp = new boolean[n+1][target+1];\n \n for (int i = 1; i <= n; i++) dp[i][0] = true;\n for (int j = 1; j <= target; j++) dp[0][j] = false;\n dp[0][0] = true;\n \n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= target; j++) {\n // if don't pick current number\n dp[i][j] = dp[i-1][j];\n if (j >= nums[i-1]) {\n dp[i][j] = dp[i][j] || dp[i-1][j-nums[i-1]];\n }\n }\n }\n return dp[n][target];\n \n \n // Solution2: optimizing to save space\n // https://leetcode.com/problems/partition-equal-subset-sum/discuss/90592/01-knapsack-detailed-explanation/94996\n int sum = 0;\n int n = nums.length;\n for (int num : nums) sum += num;\n if ((sum & 1) == 1) return false;\n int target = sum / 2;\n boolean[] dp = new boolean[target+1];\n dp[0] = true;\n for (int num : nums) {\n // here is the trick to save space\n // because we have to update dp[j] based on \n // previous dp[j-num] and dp[j] from previous loop.\n // if we update dp from left to right\n // we first update smaller dp which is dp[j-num]\n // then we won't be able to get original dp[j-num] and dp[j]\n // from previous loop, and eventually we get the wrong\n // answer. But if we update dp from right to left\n // we can assure everything is based on previous state\n for (int j = target; j >= num; j--) {\n // if (j >= num) {\n dp[j] = dp[j] || dp[j-num];\n // }\n }\n }\n return dp[target];\n }",
"public static void main(String[] args) {\n int[][] map = new int[N][N];\r\n // 1D to 2D index map\r\n CustomPair[] indToVal = new CustomPair[(N * N) + 1];\r\n // 2D to value map\r\n Map<CustomPair, Integer> gridToValue = new HashMap<>();\r\n // Direction to start\r\n Direction dir = Direction.RIGHT;\r\n int j = 1;\r\n int y = N / 2;\r\n // shift left for even n's\r\n int x = (N % 2 == 0) ? y - 1 : y;\r\n /**\r\n * We use y, x here because the grid is sort of turned around.\r\n * */\r\n while(j <= ((N * N))) {\r\n CustomPair currentIndex = new CustomPair(y, x);\r\n // if the number is not prime it is traversable\r\n if (!isPrime(j)) {\r\n map[y][x] = 1;\r\n gridToValue.put(currentIndex, j);\r\n } else {\r\n map[y][x] = -1;\r\n }\r\n // add the value to 1d to 2d index values\r\n indToVal[j] = currentIndex;\r\n switch(dir){\r\n case RIGHT:\r\n if(x <= (N - 1) && map[y - 1][x] == 0 && j > 1)\r\n dir = Direction.UP;\r\n break;\r\n case UP:\r\n if(map[y][x - 1] == 0)\r\n dir = Direction.LEFT;\r\n break;\r\n case LEFT:\r\n if(x == 0 || map[y + 1][x] == 0)\r\n dir = Direction.DOWN;\r\n break;\r\n case DOWN:\r\n if(map[y][x + 1] == 0)\r\n dir = Direction.RIGHT;\r\n break;\r\n }\r\n // update the grid index\r\n switch(dir){\r\n case RIGHT:\r\n x++;\r\n break;\r\n case UP:\r\n y--;\r\n break;\r\n case LEFT:\r\n x--;\r\n break;\r\n case DOWN:\r\n y++;\r\n break;\r\n }\r\n // update 1D index\r\n j++;\r\n }\r\n\r\n Scanner sc = new Scanner(System.in);\r\n int caseNum = 1;\r\n while (sc.hasNextInt()) {\r\n int start = sc.nextInt();\r\n int goal = sc.nextInt();\r\n // find the shortest path\r\n Queue<CustomPair> q = new LinkedList<>();\r\n // 2D grid to distance values\r\n Map<CustomPair, Integer> distMap = new HashMap<>();\r\n // start is 0\r\n distMap.put(indToVal[start], 0);\r\n q.add(indToVal[start]);\r\n while (!q.isEmpty()) {\r\n CustomPair cur = q.remove();\r\n // for each neighbour (4 potential moves)\r\n for (int i = 0; i < 4; i++) {\r\n int nx = cur.a + X_NEIG_INDEX[i];\r\n int ny = cur.b + Y_NEIG_INDEX[i];\r\n CustomPair neighP = new CustomPair(nx, ny);\r\n // if the value is not in the grid\r\n if (!gridToValue.containsKey(neighP))\r\n continue;\r\n // if the value is already visited\r\n if (distMap.containsKey(neighP))\r\n continue;\r\n distMap.put(neighP, distMap.get(cur) + 1);\r\n q.add(neighP);\r\n }\r\n }\r\n // print for Kattis reasons\r\n String msg = \"Case \" + caseNum + \": \";\r\n if (!distMap.containsKey(indToVal[goal]) ||\r\n distMap.getOrDefault(indToVal[goal], -1) == -1 && start != goal)\r\n System.out.println(msg + \" impossible\");\r\n else\r\n System.out.println(msg + \"\" + distMap.get(indToVal[goal]));\r\n caseNum++;\r\n }\r\n }",
"public static void main(String[] args) {\n\t\tScanner scan=new Scanner(System.in);\n\t\tint N=scan.nextInt();\n\t\tint a=scan.nextInt();\n\t\tint b=scan.nextInt();\n\t\tint[] nums=new int[N];\n\t\tint[][] weight=new int[N][N];\n\t\tfor(int i=0;i<N;i++){\n\t\t\tnums[i]=scan.nextInt();\n\t\t\tweight[i][i]=nums[i];\n\t\t}\n\t\tfor(int i=0;i<N;i++){\n\t\t\tfor(int j=i+1;j<N;j++){\n\t\t\t\tweight[i][j]=weight[i][j-1]+nums[j];\n\t\t\t}\n\t\t}\n\t\tlong[][] dp=new long[N][N];\n\t\tfor(int i=2;i<=N;i++){//dis\n\t\t\tfor(int j=0;j<=N-i;j++){//start\n\t\t\t\tint end=j+i-1;\n\t\t\t\tlong min=Integer.MAX_VALUE;\n\t\t\t\tfor(int k=j;k<end;k++){\n\t\t\t\t\tmin=Math.min(min, dp[j][k]+dp[k+1][end]+weight[j][k]*a+weight[k+1][end]*b);\n\t\t\t\t}\n\t\t\t\tdp[j][end]=min;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(dp[0][N-1]);\n\t\tscan.close();\n\t}",
"static void TwoDimTrav(int[][] arr, int row, int col){\n\n int[] dr = new int[]{ -1, 1, 0, 0};\n int[] dc = new int[]{ 0, 0, 1, -1};\n\n for(int i = 0; i < 4; i++){\n int newRow = row + dr[i];\n int newCol = col + dc[i];\n\n if(newRow < 0 || newCol < 0 || newRow >= arr.length || newCol >= arr[0].length)\n continue;\n\n // do your code here\n\n }\n\n // All Directions\n // North, South, East, West, NW NE SW SE\n // dr = [ -1, 1, 0, 0 -1, -1, 1, 1 ]\n // dc = [ 0, 0, 1, -1 -1, 1, 1, -1 ]\n\n// int[] dr = new int[]{ -1, 1, 0, 0, -1, -1, 1, 1};\n// int[] dc = new int[]{ 0, 0, 1, -1, -1, 1, -1, 1};\n//\n// for(int i = 0; i < 8; i++){\n// int newRow = row + dr[i];\n// int newCol = col + dc[i];\n//\n// if(newRow < 0 || newCol < 0 || newRow >= arr.length || newCol >= arr[0].length)\n// continue;\n//\n// // do your code here\n//\n// }\n }",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int T = sc.nextInt();\n for(int i = 0 ; i < T; i++) {\n int n = sc.nextInt();\n int a = sc.nextInt();\n int b = sc.nextInt();\n PriorityQueue<Integer> queue = new PriorityQueue<Integer>();\n int[][] m = new int[n][n];\n //n^2 * log(n)\n for(int row = 0; row < n; row++) {\n for(int col = 0; col < n; col++) {\n if(row == 0 && col == 0 && n != 1) {\n continue;\n }else if(row == 0) {\n m[row][col] = m[row][col - 1] + a;\n }else if(col == 0) {\n m[row][col] = m[row-1][col] + b;\n }else {\n m[row][col] = m[row-1][col-1] + a + b;\n }\n\n if(row + col == (n -1)) {\n pool.add(m[row][col]); //log(n)\n }\n }\n }\n //O(n*log(n))\n for (Integer item:pool) {\n queue.add(item); //O(logn)\n }\n while(!queue.isEmpty()) {\n System.out.print(queue.poll() + \" \"); //O(1)\n }\n System.out.println();\n queue.clear();\n pool.clear();\n }\n }",
"private int uniquePaths(int x, int y, int[][] dp) {\n \t\tif (x == 0 || y == 0) return 1;\n \t\tif (dp[x][y] == 0)\n \t\t\tdp[x][y] = uniquePaths(x - 1, y, dp) + uniquePaths(x, y - 1, dp);\n \t\treturn dp[x][y];\n \t}",
"public List<int[][]> evaluate(IBoard board){\n\n int area = board.getHeight() * board.getWidth();\n\n int[][] newArray = new int[area][2];\n\n int k = 0;\n\n while (k < newArray.length) {\n for (int i = 0; i < board.getHeight(); i++) {\n for (int j = 0; j < board.getWidth(); j++) {\n newArray[k][0] = i;\n newArray[k][1] = j;\n k++;\n }\n }\n }\n\n List<int[][]> Allmoves = new ArrayList<>();\n\n int res = newArray.length / board.getHeight();\n\n /*For rows*/\n int q = 0;\n int w = res;\n\n for (int i = 0; i < res; i++) {\n int[][] arr = new int[res][2];\n\n int e = 0;\n\n for (int j = q; j < w; j++) {\n arr[e][0] = newArray[j][0];\n arr[e][1] = newArray[j][1];\n e++;\n }\n\n w += res;\n q += res;\n\n Allmoves.add(arr);\n\n }\n\n /*For columns*/\n int r = 0;\n for (int i = 0; i < res; i++) {\n\n int[][] arr = new int[res][2];\n int e = 0;\n\n for (int j = 0; j < res; j++) {\n arr[e][0] = newArray[r][0];\n arr[e][1] = newArray[r][1];\n\n r += res;\n e++;\n }\n r = 0;\n r += i + 1;\n\n Allmoves.add(arr);\n }\n\n /*For diagonal - 1*/\n int[][] arr = new int[res][2];\n int d1 = res + 1;\n int d = 0;\n int e = 0;\n for (int i = 0; i < res; i++) {\n arr[e][0] = newArray[d][0];\n arr[e][1] = newArray[d][1];\n d += d1;\n e++;\n }\n\n Allmoves.add(arr);\n\n int[][] arr1 = new int[res][2];\n int d2 = res - 1;\n int D = res - 1;\n int p = 0;\n for (int i = 0; i < res; i++) {\n arr1[p][0] = newArray[D][0];\n arr1[p][1] = newArray[D][1];\n D += d2;\n p++;\n }\n\n Allmoves.add(arr1);\n\n return Allmoves;\n\n }",
"private ASSPSolution floydWarshall(Double[][] aMatrix, Integer[][] pMatrix)\n {\n Double best[][][] = new Double[2][this.numIntxns][this.numIntxns];\n Integer pred[][][] = new Integer[2][this.numIntxns][this.numIntxns];\n\n best[0] = aMatrix;\n best[1] = aMatrix;\n\n pred[0] = pMatrix;\n pred[1] = pMatrix;\n\n int solnIndex = 0;\n\n for (int k = 0; k < this.numIntxns; k++)\n {\n for (int u = 0; u < this.numIntxns; u++)\n {\n for (int v = 0; v < this.numIntxns; v++)\n {\n // we only need to keep two matrices in memory and swap\n // between them. i and j alternate.\n int i = k % 2;\n int j = (i == 0) ? 1 : 0;\n\n best[i][u][v] = best[j][u][v];\n\n // note that null represents infinity\n if (best[i][u][k] != null && best[i][k][v] != null)\n {\n // if this spot is infinite, anything is better\n if (best[i][u][v] == null)\n {\n best[i][u][v] = best[j][u][k] + best[j][k][v];\n pred[i][u][v] = k;\n }\n else if \n ((best[j][u][k] + best[j][k][v]) < best[i][u][v])\n {\n best[i][u][v] = best[j][u][k] + best[j][k][v];\n pred[i][u][v] = k;\n }\n\n // Stores the last i value so that the correct answers \n // can be sent back to the user.\n if (v == this.numIntxns - 1)\n {\n solnIndex = i;\n }\n }\n }\n }\n }\n\n return new ASSPSolution(best[solnIndex], pred[solnIndex]);\n }",
"public int minPathSum(int[][] grid) {\n\t\tint m = grid.length;\n\t\tint n = grid[0].length;\n\t\tif (n < m) {\n\t\t\tint[] dp = new int[n];\n\t\t\tdp[n-1] = grid[m-1][n-1];\n\t\t\tfor(int i = n-2; i >= 0; i--) {\n\t\t\t\tdp[i] = grid[m-1][i] + dp[i+1];\n\t\t\t}\n\t\t\tfor(int i = m-2; i >= 0; i--) {\n\t\t\t\tfor(int j = n-1; j >= 0; j--) {\n\t\t\t\t\tif(j == n-1) {\n\t\t\t\t\t\tdp[j] += grid[i][j];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdp[j] = grid[i][j] + Math.min(dp[j], dp[j+1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dp[0];\n\t\t} else {\n\t\t\tint[] dp = new int[m];\n\t\t\tdp[m-1] = grid[m-1][n-1];\n\t\t\tfor(int i = m-2; i >= 0; i--) {\n\t\t\t\tdp[i] = grid[i][n-1] + dp[i+1];\n\t\t\t}\n\t\t\tfor(int i = n-2; i >= 0; i--) {\n\t\t\t\tfor(int j = m-1; j >= 0; j--) {\n\t\t\t\t\tif(j == m-1) {\n\t\t\t\t\t\tdp[j] += grid[j][i];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdp[j] = grid[j][i] + Math.min(dp[j], dp[j+1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dp[0];\n\t\t}\n\t}",
"public void generateNeighborhood(TSPSolution s){\r\n\t\tint [] rounte = new int[problem.city_num+1];\r\n\t\tfor(int i=0;i<problem.city_num;i++) rounte[i] = s.route[i];\r\n\t\trounte[problem.city_num] = rounte[0];\r\n\t\tint [] pos = new int[problem.city_num];\r\n\t\tproblem.calculatePosition(rounte, pos);\r\n\t\tint pos1 = 0;\r\n\t\tint pos2 = 0;\r\n\t\tfor(int k=0;k<problem.city_num;k++){\r\n\t\t\tint i = k;\r\n\t\t\tpos1 = i;\r\n\t\t\tint curIndex = rounte[i];\r\n\t\t\tint nextIndex = rounte[i+1];\r\n\t\t\tArrayList<Integer> candidate = problem.candidateList.get(curIndex);\r\n\t\t\tIterator<Integer> iter = candidate.iterator();\r\n\t\t\twhile(iter.hasNext()){\r\n\t\t\t\tint next = iter.next();\r\n\t\t\t\tpos2 = pos[next];\r\n\t\t\t\tint curIndex1 = rounte[pos2];\r\n\t\t\t\tint nextIndex1 = rounte[pos2+1];\r\n\t\t\t\tif(curIndex == nextIndex1) continue;\r\n\t\t\t\tif(curIndex == curIndex1) continue;\r\n\t\t\t\tif(nextIndex == nextIndex1) continue;\r\n\t\t\t\tif(curIndex1 == nextIndex) continue;\r\n\t\t\t\tint betterTimes = 0;\r\n\t\t\t\tTSPSolution solution = new TSPSolution(problem.city_num, problem.obj_num, -1);\r\n\t\t\t\tfor(int j=0;j<problem.obj_num;j++){\r\n\t\t\t\t\tint gain = problem.disMatrix[j*problem.city_num*problem.city_num+curIndex*problem.city_num+curIndex1] +\r\n\t\t\t\t\t\t\tproblem.disMatrix[j*problem.city_num*problem.city_num+nextIndex*problem.city_num+nextIndex1] - \r\n\t\t\t\t\t\t\t(problem.disMatrix[j*problem.city_num*problem.city_num+curIndex*problem.city_num+nextIndex]+\r\n\t\t\t\t\t\t\tproblem.disMatrix[j*problem.city_num*problem.city_num+curIndex1*problem.city_num+nextIndex1]);\r\n\t\t\t\t\tif(gain<0) betterTimes++;\r\n\t\t\t\t\tsolution.object_val[j] = s.object_val[j] + gain;\r\n\t\t\t\t}\r\n\t\t\t\tif(betterTimes==0) continue;\r\n\t\t\t\tsolution.route = s.route.clone();\r\n\r\n\t\t\t\tif(problem.kdSet.add(solution)){\r\n\t\t\t\t\tproblem.converse(pos1, pos2, solution.route, 0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private static void dfs(int x, int y) {\n arr[x][y] = 1;\n area++;\n \n for(int i=0; i<4; i++) {\n int nx = x + dx[i];\n int ny = y + dy[i];\n \n if(0 <= nx && nx < m && 0 <= ny && ny < n) {\n if(arr[nx][ny] == 0)\n dfs(nx, ny);\n }\n }\n\t\t\n\t}",
"static int[] find2(int a[]){\r\n int sum = a[0];\r\n int pro = a[0];\r\n for(int i=1;i<a.length;i++){\r\n sum += a[i];\r\n pro += a[i]*a[i];\r\n }\r\n int s = (n*(n+1))/2 - sum;\r\n int p = (n*(n+1)*(2*n+1))/6 - pro;\r\n return solveSP(s, p);\r\n }",
"public int solution(int[] A) {\n\t \n\t int n = A.length;\n\t int N =0;\n\t for(int i=0;i<n;i++){\n\t N += A[i];\n\t }\n\t boolean[][] P = new boolean[N/2+1][n+1];\n\t for(int i=0;i<n;i++){\n\t P[0][i] = true;\n\t }\n\t \n\t for(int i = 1;i<=N/2;i++)\n\t for(int j = 1;j<=n;j++)\n\t if(A[j-1]<=i)\n\t P[i][j] = P[i][j-1] || P[i - A[j - 1]][ j - 1];\n\t else\n\t P[i][j] = P[i][j-1];\n\t if (P[N/2][n] == true)\n\t return 1;\n\t else \n\t return 0;\n\t }",
"public void sum2(int n){\n int sum =0; //1\n for (int j = 0; j < n; j++) //2n+2\n for (int k = 0; k < n; k++) //2n+2\n sum += k + j; //1\n for (int l = 0; l < n; l++) //2n+2\n sum += l; //1\n }",
"public int calculateMinimumHP(ArrayList<ArrayList<Integer>> grid) {\n\t\t\t\t int m =grid.size(), n = grid.get(0).size();\n\t\t\t\t int[][][] dp = new int[m+1][n+1][2];\n\t\t\t\t \n\t\t\t\t dp[0][0][0] = 0;\n\t\t\t\t dp[0][0][1] = 0;\n\t\t\t\t dp[0][1][0] = 1; // start with life\n\t\t\t\t dp[0][1][1] = 0; // balance life\n\t\t\t\t dp[1][0][0] = 1;\n\t\t\t\t dp[1][0][1] = 0;\n\t\t\t\t for(int i=2;i<dp[0].length;i++){\n\t\t\t\t\t dp[0][i][0] = Integer.MAX_VALUE;\n\t\t\t\t\t dp[0][i][1] = 0;\n\t\t\t\t }\n\t\t\t\t for(int i=2;i<dp.length;i++){\n\t\t\t\t\t dp[i][0][0] = Integer.MAX_VALUE;\n\t\t\t\t\t dp[i][0][1] = 0;\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t for(int i=1;i<dp.length;i++){\n\t\t\t\t\t for(int j=1;j<dp[0].length;j++){\n\t\t\t\t\t\t \n\t\t\t\t\t\t if(grid.get(i-1).get(j-1) < 0){\n\t\t\t\t\t\t\t int[] fromCell = dp[i-1][j][0]< dp[i][j-1][0]?dp[i-1][j]:dp[i][j-1];\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t dp[i][j][0] = fromCell[0] - grid.get(i-1).get(j-1) - fromCell[1];\n\t\t\t\t\t\t\t dp[i][j][1] = fromCell[1]+ grid.get(i-1).get(j-1)>0?fromCell[1]+ grid.get(i-1).get(j-1):0;\n\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t int[] fromCell = dp[i-1][j][0]< dp[i][j-1][0]?dp[i-1][j]:dp[i][j-1];\n\t\t\t\t\t\t\t dp[i][j][0] = fromCell[0];\n\t\t\t\t\t\t\t dp[i][j][1] = fromCell[1]+grid.get(i-1).get(j-1);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t return dp[m][n][0];\n\t\t\t\t \n\t\t\t }",
"private boolean dfs(int n, int[] P) { // 0 is empty, 1 is false, 2 is true\n if (P[n] != 0) {\n if (P[n] == 1) {\n return false;\n }\n else {\n return true;\n }\n }\n\n if (n == 1) {\n P[1] = 2;\n //return true;\n }\n else if (n == 2) {\n P[2] = 2;\n //return true;\n }\n else if (n == 3) {\n P[3] = 1;\n //return false;\n }\n else {\n boolean res = dfs(n-2, P) && dfs(n-3, P) || dfs(n-3, P) && dfs(n-4, P);\n P[n] = res ? 2 : 1;\n }\n\n return P[n] == 2;\n\n //P[n] = P[n-2] + P[n-3] == 4 || P[n-3] + P[n-4] == 4 ? 2 : 1;\n //boolean res = dfs(n-2, P) && dfs(n-3, P) || dfs(n-3, P) && dfs(n-4, P);\n //P[n] = res ? 2 : 1;\n //return res;\n }",
"void B_time()\n {\n System.out.println(\"Ghost current position: ( \"+X+\",\"+Y+\")\");\n double[][] dup = new double[n][n];\n //int temp = rand.nextInt(10);\n for (int i = 0; i < n; i++)\n {\n for (int j = 0; j < n; j++)\n {\n double x = 0;\n //*****SIDEWAYS****\n\n if( (j-1 >= 0) && (j-1 < n))\n {\n double a = side_neighbour(i,j-1);\n x += arr[i][j-1] * sw * (1.0/a);\n }\n if( (j+1 >= 0) && (j+1 < n))\n {\n double a = side_neighbour(i,j+1);\n x += arr[i][j+1] * sw * (1.0/a);\n }\n if( (i-1 >= 0) && (i-1 < n))\n {\n double a = side_neighbour(i-1,j);\n x += arr[i-1][j] * sw * (1.0/a);\n }\n if( (i+1 >= 0) && (i+1 < n))\n {\n double a = side_neighbour(i+1,j);\n x += arr[i+1][j] * sw * (1.0/a);\n }\n\n //*****CORNERS****\n if( (i-1 >= 0) && (i-1 < n) && (j-1 >= 0) && (j-1 < n))\n {\n double a = corner_neighbours(i-1,j-1);\n x += arr[i-1][j-1] * c *(1.0/a);\n }\n if( (i+1 >= 0) && (i+1 < n) && (j+1 >= 0) && (j+1 < n))\n {\n double a = corner_neighbours(i+1,j+1);\n x += arr[i+1][j+1] * c *(1.0/a);\n }\n if( (i-1 >= 0) && (i-1 < n) && (j+1 >= 0) && (j+1 < n))\n {\n double a = corner_neighbours(i-1,j+1);\n x += arr[i-1][j+1] * c * (1.0/a);\n }\n if( (i+1 >= 0) && (i+1 < n) && (j-1 >= 0) && (j-1 < n))\n {\n double a = corner_neighbours(i+1,j-1);\n x += arr[i+1][j-1] * c * (1.0/a);\n }\n\n double a = corner_neighbours(i,j);\n x += arr[i][j] * c * (1.0/a);\n\n //arr[i][j] = x;\n dup[i][j] = x;\n }\n }\n\n\n\n arr = dup;\n B_print();\n curr_pos(X,Y);\n\n }",
"private int getSumD2(int[][] a) {\n int sum = 0;\n\n int jd1 = 0;\n int jd2 = a.length - 1;\n while (jd1 < a.length) {\n sum += a[jd1][jd2];\n jd2--;\n jd1++;\n }\n return sum;\n }",
"public static void dynamicProgramming2(int[][] myArray){ \t\r\n\t\tint countNode = myArray.length;\r\n\t\tint rows = myArray[0].length;\r\n\t\tif(rows != countNode) {\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t\r\n \tint[] cost = new int[countNode];\r\n \tint[] prev = new int[countNode];\r\n \tboolean[] visited = new boolean[countNode];\r\n \t\r\n \tfor(int i = 0; i < countNode; i++) {\r\n \t\tcost[i] = myArray[0][i];\r\n \t\tprev[i] = 0;\r\n \t\tvisited[i] = false;\r\n \t}\r\n \t\r\n \tint cur = 0; \t\r\n \twhile(true)\r\n \t{\r\n \t\tfor(int i = cur; i < countNode; i++)\r\n \t\t{\r\n \t\t\tif(myArray[cur][i] + cost[cur] < cost[i])\r\n \t\t\t{\r\n \t\t\t\tcost[i] = myArray[cur][i] + cost[cur];\r\n \t\t\t\tprev[i] = cur;\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n \t\tvisited[cur] = true;\r\n \t\tif(AllVisited(visited)) break;\r\n \t\t\r\n \t\t// Choose the node which is not visited yet\r\n \t\t// and has the minimum cost so far.\r\n \t\tint min = Integer.MAX_VALUE;\r\n \t\tfor(int i = 0; i < countNode; i++){\r\n \t\t\tif(!visited[i] && cost[i] < min) {\r\n \t\t\t\tcur = i;\r\n \t\t\t\tmin = cost[i];\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n \tSystem.out.println(\"Dynamic Programming2:\");\r\n \tSystem.out.println(\"Minimum Cost to go from 1 to \" + countNode + \" is \" + cost[countNode - 1]);\r\n \tStack<Integer> s = new Stack<Integer>();\r\n \tint traveller = countNode - 1;\r\n \ts.push(countNode);\r\n \twhile(traveller != 0)\r\n \t{\r\n \t\ts.push(prev[traveller] + 1);\r\n \t\ttraveller = prev[traveller];\r\n \t}\r\n \t\r\n \tStringBuilder sb = new StringBuilder();\r\n \twhile(!s.empty())\r\n \t{\r\n \t\tsb.append(s.pop());\r\n \t\tif (!s.empty()) {\r\n \t\tsb.append(\" -> \");\r\n \t\t}\r\n \t}\r\n \t\r\n \tSystem.out.println(\"Path from 1 to end is \" + sb.toString()); \r\n \tSystem.out.println();\r\n }",
"private static void solution() {\n for (int i = 0; i < n; i++) {\n Coord here = coords[i]; // start, end, dir, gen\n for (int j = 0; j < here.gen; j++) {\n // Rotate degree of 90.\n List<Pair> changed = rotate(here.coord, here.endPoint);\n boolean first = true;\n for(Pair p: changed){\n if(first) {\n here.endPoint = new Pair(p.x, p.y);\n first = false;\n }\n here.coord.add(new Pair(p.x, p.y));\n }\n }\n }\n // count the number of squares enclosing all angles with dragon curve\n for (int i = 0; i < n; i++) {\n for(Pair p: coords[i].coord)\n board[p.y][p.x] = true;\n }\n int cnt = 0;\n for (int i = 0; i < 100; i++)\n for (int j = 0; j < 100; j++)\n if(board[i][j] && board[i + 1][j] && board[i][j + 1] && board[i + 1][j + 1])\n cnt += 1;\n System.out.println(cnt);\n }",
"private void generateSinglyEven(int size)\n\t{\n\t\tint[][] ranges = new int[4][2];\t\t//Array to store the min and max value, and min and max index for each quadrant\n\t\tint boxesInEachRowQ = size/2;\n\t\tint currentVal = 0;\n\t\tint nBoxesInEachQ = boxesInEachRowQ*boxesInEachRowQ;\n\t\tfor (int i=0; i<ranges.length; i++)\n\t\t{\n\t\t\tranges[i][0] = currentVal + 1;\t\t//Min value\n\t\t\tcurrentVal += nBoxesInEachQ;\n\t\t\tranges[i][1] = currentVal;\t\t\t//Max Value\n\t\t}\n\t\t//Switch the ranges\n\t\t/*\n\t\t * Switch Quadrant 3 and 4\n\t\t * Switch Quadrant 2 and 4\n\t\t */\n\t\tint[] temp = ranges[2];\n\t\tranges[2] = ranges[3];\n\t\tranges[3] = temp;\n\t\ttemp = ranges[1];\n\t\tranges[1] = ranges[3];\n\t\tranges[3] = temp;\n\t\t\n\t\t//Calculate the start and end indexes for each quadrant\n\t\tPoint[][] indexes = new Point[4][2];\n\t\tint currentRow = 0;\n\t\tint currentCol = 0;\n\t\tfor (int i=0; i<indexes.length; i++)\n\t\t{\n\t\t\tPoint start = new Point(currentRow, currentCol);\n\t\t\tindexes[i][0] = start;\n\t\t\tPoint end = new Point(start.x + boxesInEachRowQ-1, start.y + boxesInEachRowQ-1);\n\t\t\tindexes[i][1] = end;\n\t\t\tcurrentCol = end.y + 1;\n\t\t\tif (currentCol > size-1)\n\t\t\t{\n\t\t\t\tcurrentCol = 0;\n\t\t\t\tcurrentRow += boxesInEachRowQ;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Fill in the numbers\n\t\tfor (int i=0; i<ranges.length; i++)\n\t\t{\n\t\t\tthis.generateOdd(size, \n\t\t\t\t\t\t\t\t\tranges[i][0], \n\t\t\t\t\t\t\t\t\tranges[i][1], \n\t\t\t\t\t\t\t\t\tindexes[i][0], \n\t\t\t\t\t\t\t\t\tindexes[i][1]);\n\t\t}\n\t\t\n\t\t//Swap quadrant A and D\n\t\tint indexMiddle = boxesInEachRowQ/2;\n\t\tint rowsSwapped = 0;\n\t\tfor (int i=0, j=boxesInEachRowQ, k=indexMiddle+1, l=1 + boxesInEachRowQ + indexMiddle; i<indexMiddle; i++, j++, k++, l++)\n\t\t{\n\t\t\tfor (int a=0; a<indexMiddle; a++)\n\t\t\t{\n\t\t\t\t//Swap top\n\t\t\t\tint num = this.matrix[i][a];\n\t\t\t\tthis.matrix[i][a] = this.matrix[j][a];\n\t\t\t\tthis.matrix[j][a] = num;\n\t\t\t\t\n\t\t\t\t//Swap bottom\n\t\t\t\tnum = this.matrix[k][a];\n\t\t\t\tthis.matrix[k][a] = this.matrix[l][a];\n\t\t\t\tthis.matrix[l][a] = num;\n\t\t\t}\n\t\t\trowsSwapped++;\n\t\t}\n\t\t//Swap Center\n\t\tfor (int i=0; i<rowsSwapped; i++)\n\t\t{\n\t\t\tint num = this.matrix[indexMiddle][i+1];\n\t\t\tthis.matrix[indexMiddle][i+1] = this.matrix[boxesInEachRowQ + indexMiddle][i+1];\n\t\t\tthis.matrix[boxesInEachRowQ + indexMiddle][i+1] = num;\n\t\t}\n\t\t\n\t\t//Identify points to be swapped between B and C\n\t\tint highlightEachRow = boxesInEachRowQ/2-1;\n\t\tfor (int i=0, j=boxesInEachRowQ; i<boxesInEachRowQ; i++, j++)\n\t\t{\n\t\t\tfor (int a=size-highlightEachRow; a<size; a++)\t//because get second last index\n\t\t\t{\n\t\t\t\tint num = this.matrix[i][a];\n\t\t\t\tthis.matrix[i][a] = this.matrix[j][a];\n\t\t\t\tthis.matrix[j][a] = num;\n\t\t\t}\n\t\t}\n\t}",
"static public int solve(int n,int A[])\n {\n int freqArr[] = new int[1001];\n int dp[] = new int[1001];\n\n for(int i=0; i<n; i++){\n freqArr[A[i]]++;\n }\n\n dp[0] = 0;\n dp[1] = freqArr[1] > 0 ? freqArr[1] : 0;\n\n for(int i=2; i<=1000; i++){\n dp[i] = Math.max(dp[i-2] + i*freqArr[i], dp[i-1]);\n }\n return dp[1000];\n }",
"private final int m()\n\t { int n = 0;\n\t int i = 0;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break; i++;\n\t }\n\t i++;\n\t while(true)\n\t { while(true)\n\t { if (i > j) return n;\n\t if (cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t n++;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t }\n\t }",
"public static void main(String[] args) throws Exception {\r\n Scanner input = new Scanner(System.in);\r\n int n;\r\n // System.out.println(\"Enter the number of element\");\r\n n = input.nextInt();\r\n // System.out.println(\"here is n\"+n);\r\n int arr[] = new int[n];\r\n // System.out.println(\"Enter the element of the array\");\r\n for (int i = 0; i < n; i++) {\r\n arr[i] = input.nextInt();\r\n }\r\n int sol_arr_1[][] = new int[n][n], sol_arr_2[][] = new int[n][n];\r\n \r\n //*****intialization*****//\r\n for(int i=0;i<n;i++)\r\n {\r\n for(int j=0;j<n;j++)\r\n {\r\n sol_arr_1[i][j]=0;\r\n sol_arr_2[i][j]=0;\r\n }\r\n }\r\n //*****end*****//\r\n \r\n \r\n \r\n \r\n \r\n int k_for_j = 1;\r\n int i = 0, j = 1;\r\n for (int q = 0; q < n - 1; q++) {\r\n // System.out.println(\"q=\"+q);\r\n j = k_for_j;\r\n i=0;\r\n if (q == 0) {\r\n while (j < n) {\r\n sol_arr_1[i][j] = (arr[i] + arr[j]) % 100;\r\n sol_arr_2[i][j] = (arr[i] * arr[j]);\r\n i++;\r\n j++;\r\n }\r\n }\r\n else\r\n {\r\n while(j<n)\r\n {\r\n int color1,smog1;\r\n color1=(arr[j]+sol_arr_1[i][j-1])%100;\r\n smog1=sol_arr_2[i][j-1]+(arr[j]*sol_arr_1[i][j-1]);\r\n int color2,smog2;\r\n color2 =(sol_arr_1[i+1][j]+arr[j-2])%100;\r\n smog2=(sol_arr_1[i+1][j]*arr[j-2])+sol_arr_2[i+1][j];\r\n if(smog1>smog2)\r\n {\r\n sol_arr_1[i][j]=color2;\r\n sol_arr_2[i][j]=smog2;\r\n }\r\n else\r\n {\r\n sol_arr_1[i][j]=color1;\r\n sol_arr_2[i][j]=smog1;\r\n }\r\n i++;\r\n j++;\r\n }\r\n }\r\n k_for_j++;\r\n }\r\n System.out.println(sol_arr_2[0][n-1]);\r\n }",
"public static int MatrixChainMultDP(){\n int dp[][] = new int[n][n];\n\n // cost is zero when multiplying one matrix. \n for(int i=0;i<n;i++)\n dp[i][i] = 0;\n\n for(int L = 2;L < n;L++){\n for(int i=1;i<n;i++){\n int j = i + L - 1;\n if(j >= n)\n continue;\n dp[i][j] = Integer.MAX_VALUE;\n for(int k = i;k<j;k++){\n dp[i][j] = Math.min(dp[i][j] , dp[i][k] + dp[k+1][j] + (ar[i-1] * ar[k] * ar[j]));\n }\n }\n }\n return dp[1][n-1];\n\n }",
"private static void longestIncPath(int[][] matrix) {\n\t\t \n\t\t int total_elem = matrix.length * (matrix[0].length);\n\t ArrayList<ArrayList<Integer>> g = new ArrayList<ArrayList<Integer>>();\n\t int[] outdegree = new int[total_elem];\n\t int[][] dp = new int[matrix.length][matrix[0].length];\n\t int m = matrix[0].length;\n\t \n\t for(int i=0;i<matrix.length;i++){\n\t for(int j=0;j<matrix[0].length;j++){\n\t \tg.add(new ArrayList<Integer>());\n\t }\n\t }\n\t \n\t for(int i=0;i<matrix.length;i++){\n\t for(int j=0;j<matrix[0].length;j++){\n\t \n\t int left=-1;\n\t int right=-1;\n\t int up=-1;\n\t int down=-1;\n\t int curr = matrix[i][j];\n\t if(j-1>=0)\n\t left = matrix[i][j-1]; \n\t if(j+1<matrix[0].length)\n\t right = matrix[i][j+1];\n\t if(i-1>=0)\n\t up=matrix[i-1][j];\n\t if(i+1<matrix.length)\n\t down=matrix[i+1][j];\n\t \n\t if(left!=-1 && curr>left)\n\t addedge(g,(m*i+(j-1)),(m*i+j),outdegree);\n\t if(right!=-1 && curr>right)\n\t addedge(g,(m*i+(j+1)),(m*i+j),outdegree);\n\t if(up!=-1 && curr>up)\n\t addedge(g,(m*(i-1)+j),(m*i+j),outdegree);\n\t if(down!=-1 && curr>down)\n\t addedge(g,(m*(i+1)+j),(m*i+j),outdegree);\n\t \n\t \n\t }\n\t }\n\t \n\t Queue<Integer> q = new LinkedList<Integer>();\n\t \n\t for(int i:outdegree){\n\t if(i==0)\n\t q.add(i);\n\t }\n\t \n\t \n\t while(!q.isEmpty()){\n\t int temp = q.poll();\n\t int r = temp/m;\n\t int c = temp - r*m;\n\t int max=0;\n\t \n\t for(int i:g.get(temp)){\n\t int row = i/m;\n\t int col = i - r*m;\n\t max=Math.max(max,dp[row][col]+1);\n\t outdegree[i]--;\n\t if(outdegree[i]==0)\n\t q.add(i);\n\t }\n\t \n\t dp[r][c]=max;\n\t }\n\t \n\t\t\n\t}",
"int removeObstacle(int numRows, int numColumns, List<List<Integer>> lot)\r\n {\r\n \tint m = 0;\r\n \tint n = 0;\r\n \tfor(List<Integer> rowList: lot) {\r\n \t\tfor(Integer num: rowList) {\r\n \t\t\tif(num == 9 ) {\r\n \t\t\t\tbreak;\r\n \t\t\t}\r\n \t\t\tn++;\r\n \t\t}\r\n \t\tm++;\r\n \t}\r\n \t// to store min cells required to be \r\n // covered to reach a particular cell \r\n int dp[][] = new int[numRows][numColumns]; \r\n \r\n // initially no cells can be reached \r\n for (int i = 0; i < numRows; i++) \r\n for (int j = 0; j < numColumns; j++) \r\n dp[i][j] = Integer.MAX_VALUE; \r\n \r\n // base case \r\n dp[0][0] = 1; \r\n \r\n for (int i = 0; i < lot.size(); i++) {\r\n \tList<Integer> columnList = lot.get(i);\r\n for (int j = 0; j < columnList.size(); j++) { \r\n \r\n // dp[i][j] != INT_MAX denotes that cell \r\n // (i, j) can be reached from cell (0, 0) \r\n // and the other half of the condition \r\n // finds the cell on the right that can \r\n // be reached from (i, j) \r\n if (dp[i][j] != Integer.MAX_VALUE && \r\n (j + columnList.get(j)) < numColumns && (dp[i][j] + 1) \r\n < dp[i][j + columnList.get(j)]\r\n \t\t && columnList.get(j) != 0) \r\n dp[i][j + columnList.get(j)] = dp[i][j] + 1; \r\n \r\n if (dp[i][j] != Integer.MAX_VALUE && \r\n (i + columnList.get(j)) < numRows && (dp[i][j] + 1) \r\n < dp[i + columnList.get(j)][j] && columnList.get(j) != 0) \r\n dp[i + columnList.get(j)][j] = dp[i][j] + 1; \r\n } \r\n } \r\n \r\n if (dp[m - 1][n - 1] != Integer.MAX_VALUE) \r\n return dp[m - 1][n - 1]; \r\n \r\n return -1; \r\n }",
"public int dp_os(int[] arr) {\n\n\t\tint[][] dp = new int[arr.length][arr.length];\n\t\t\n\t\tfor (int gap=0; gap<arr.length; gap++) {\n\t\t\n\t\t\tfor (int i=0,j=gap; j<arr.length; i++, j++) {\n\t\t\t\n\t\t\t\tint x = (i+2 <= j) ? dp[i+2][j] : 0;\n\t\t\t\tint y = (i+1 <= j-1) ? dp[i+1][j-1] : 0;\n\t\t\t\tint z = (i <= j-2) ? dp[i][j-2] : 0;\n\n\t\t\t\tdp[i][j] = Math.max(arr[i] + Math.min(x,y), arr[j] + Math.min(y,z));\n\t\t\t}\n\t\t}\n\n\t\treturn dp[0][arr.length-1];\n\t}",
"public static int[][] optimalBST2(double[] p,double[] q, int num){\n double[][] e = new double[num+2][num+2];//子树期望代价\n double[][] w = new double[num+2][num+2];//子树总概率\n //why e and w is two bigger than num?\n //because when i==j, e[i][i-1] + e[i+1][j] + w[i][j];\n\n int[][] root = new int[num+1][num+1];//记录根节点\n //root[i][j] -- 用来存放i-j组成的最优二叉查找树的根节点\n\n //init--初始化\n for(int i=1; i<num+2; i++){\n e[i][i-1] = q[i-1];\n w[i][i-1] = q[i-1];\n }\n\n for(int d = 0; d<num; d++){\n //插入个数 : 0 - num-1, 从0开始\n for(int i=1; i<=num-d; i++){\n //起始下标 : 1 - num, 从1开始\n int j = i + d;\n e[i][j] = 9999;\n w[i][j] = w[i][j-1] + p[j] + q[j];//\n\n //because of root[i][j-1] <= root[i][j] <= root[i+1][j]\n //so why?\n //\n //进行优化!!!\n if(i == j){\n root[i][j] = i;\n e[i][j] = e[i][i-1] + e[i+1][i] + w[i][i];\n }else{\n for(int k=root[i][j-1]; k<=root[i+1][j]; k++){\n //中间下标\n double temp = e[i][k-1] + e[k+1][j] + w[i][j];\n if(temp < e[i][j]){\n e[i][j] = temp;\n //找到小的,记录下来\n root[i][j] = k;\n }\n\n }\n }\n }\n }\n return root;\n }",
"static void updateGrid(int[][] G, int[][][] P){\n \n \n for(int i=1; i<G.length; i++){\n for (int j=1; j<G[i].length; j++){\n if (P[i][j][0]==1){ //if there's only one candidate left in P[i][j][0]\n if (G[i][j]==0){ //double check it's not filled already\n for (int k=1; k<G[i].length; k++){ //enter loop to check the THIRD DIMENSION\n if (P[i][j][k]==1){ //grab the index number of the last candidate\n G[i][j] = k; //SMACK\n }\n }\n }\n }\n \n }\n \n }\n \n \n }",
"private static long redelpol(int n, int k, int[][] untried, int startIndex, int endIndex, boolean[][] field)\n {\n if(k == n)\n return 1;\n\n else\n {\n long l = 0;\n\n for(int i = startIndex; i <= endIndex; ++i)\n {\n int x = untried[i][0], y = untried[i][1];\n\n field[x+n-1][y+1] = false;\n\n int cursor = 0;\n boolean a = false, b = false, c = false, d = false;\n\n if(x+1 < n && (field[x+1+n-1][y+1]))\n {\n field[x+1+n-1][y+1] = false;\n cursor++;\n untried[cursor+endIndex][0] = x+1;\n untried[cursor+endIndex][1] = y;\n a = true;\n }\n\n if(y + 1 < n && (field[x+n-1][y+1+1]))\n {\n field[x+n-1][y+1+1] = false;\n cursor++;\n untried[cursor+endIndex][0] = x;\n untried[cursor+endIndex][1] = y+1;\n b = true;\n }\n\n if(x-1 > -n && (field[x-1+n-1][y+1]))\n {\n field[x-1+n-1][y+1] = false;\n cursor++;\n untried[cursor+endIndex][0] = x-1;\n untried[cursor+endIndex][1] = y;\n c = true;\n }\n\n if(y-1 >= -1 && (field[x+n-1][y-1+1]))\n {\n field[x+n-1][y-1+1] = false;\n cursor++;\n untried[cursor+endIndex][0] = x;\n untried[cursor+endIndex][1] = y-1;\n d = true;\n }\n\n l += redelpol(n, k+1, untried, i+1, endIndex+cursor, field);\n\n if(a)\n field[x+1+n-1][y+1] = true;\n if(b)\n field[x+n-1][y+1+1] = true;\n if(c)\n field[x-1+n-1][y+1] = true;\n if(d)\n field[x+n-1][y-1+1] = true;\n }\n\n return l;\n }\n }",
"static long dp(int a, int b, int c, int d, int e, int k) {\n if(f[a][b][c][d][e] > 0) {\n return f[a][b][c][d][e];\n }\n if(!v[k]) {\n return dp(a, b, c, d, e, k + 1);\n }\n if(a < 5 && k > maxr[0] && k > maxc[a]) {\n f[a][b][c][d][e] += dp(a + 1, b, c, d, e, k + 1);\n }\n if(b < a && k > maxr[1] && k > maxc[b]) {\n f[a][b][c][d][e] += dp(a, b + 1, c, d, e, k + 1);\n }\n if(c < b && k > maxr[2] && k > maxc[c]) {\n f[a][b][c][d][e] += dp(a, b, c + 1, d, e, k + 1);\n }\n if(d < c && k > maxr[3] && k > maxc[d]) {\n f[a][b][c][d][e] += dp(a, b, c, d + 1, e, k + 1);\n }\n if(e < d && k > maxr[4] && k > maxc[e]) {\n f[a][b][c][d][e] += dp(a, b, c, d, e + 1, k + 1);\n }\n return f[a][b][c][d][e];\n }",
"static int gen(int n)\n{ \n int []S = new int [n + 1];\n \n S[0] = 0;\n if(n != 0)\n S[1] = 1;\n \n for (int i = 2; i <= n; i++)\n { \n \n // S(2 * n) = 4 * S(n)\n if (i % 2 == 0)\n S[i] = 4 * S[i / 2];\n \n // S(2 * n + 1) = 4 * S(n) + 1\n else\n S[i] = 4 * S[i/2] + 1;\n }\n \n return S[n];\n}",
"static void updatePossible(int[][] G, int[][][] P){\n //only makes changes to possibility array\n \n int k;\n \n for(int i=1; i<G.length; i++){\n for (int j=1; j<G[i].length; j++){\n if (G[i][j]>0) {\n int m = G[i][j]; //this is the candidate # being removed from P[][][]\n \n //remove m as candidate, from P[i][j][m] for rows\n for(int ii=1; ii<G.length; ii++){\n if (ii!=i){ //skip the current box\n if (P[ii][j][0]>1 && P[ii][j][m]>0){ //only change candidate values if it's not filled\n P[ii][j][m] = 0; //set candidate value to 0\n P[ii][j][0] -= 1; //subtract 1 from total candidates for this cell\n }\n }\n }\n \n //remove m from P[i][j][m] for columns\n for(int jj=1; jj<G.length; jj++){\n if (jj!=j){ //skip the current box\n if (P[i][jj][0]>1 && P[i][jj][m]>0){ //only change candidate values if it's not filled\n P[i][jj][m] = 0; //set candidate value to 0\n P[i][jj][0] -= 1; //subtract 1 from total candidates for this cell\n }\n }\n }\n \n //remove m from P[i][j][m] for box!\n int I = getAnchor(i);\n int J = getAnchor(j);\n for(int s=I; s<=I+2; s++){\n for(int t=J; t<=J+2; t++){\n if((s!=i)||(t!=j)){\n if (P[s][t][0]>1 && P[s][t][m]>0){ //only change candidate values if it's not filled\n P[s][t][m] = 0; //set candidate value to 0\n P[s][t][0] -= 1; //subtract 1 from total candidates for this cell\n }\n }\n }\n }\n \n }\n }\n }\n }",
"private int DP(int dp)\n\t{\n\t\tint result = DP(DENSITY, dp);\n\t\treturn result;\n\t}",
"int catalanDP(int n) {\n int[] catalan = new int[n+1]; \n \n // Initialize first two values in table \n catalan[0] = catalan[1] = 1; \n\n // Fill entries in catalan[] using recursive formula \n for (int i=2; i<=n; i++) { \n catalan[i] = 0; \n for (int j=0; j<i; j++) \n catalan[i] += catalan[j] * catalan[i-j-1]; \n } \n \n // Return last entry \n return catalan[n]; \n }",
"private long solveHelper(BitSet S){\n if(dp.containsKey(S))\n return dp.get(S);\n\n boolean allset = true;\n for(int i=0; i<SLen; ++i)\n allset = allset && S.get(i);\n\n if(allset)\n return 0;\n\n long minflip = INF;\n\n int idx = 0;\n for(; idx<=SLen-K; ++idx)\n if(!S.get(idx))\n break;\n\n if(idx <= SLen-K){\n track.add(S);\n S.flip(idx, idx+K);\n minflip = Math.min(minflip, solveHelper(S) + 1);\n }\n\n /*for(; idx<=SLen-K; ++idx){\n S.flip(idx, idx+K);\n if(!track.contains(S)) {\n\n track.remove(S);\n }\n S.flip(idx, idx+K);\n }*/\n\n dp.put(S, minflip);\n return minflip;\n }",
"public int solution(int K, int[] A) {\n HashMap<Integer,ArrayList<Integer>> map = new HashMap<Integer,ArrayList<Integer>>();\n \n int dup=0,nonDup=0;\n for (int i=0;i< A.length;i++){\n if(2*A[i]==K){\n if(!map.containsKey(A[i])){\n dup++;\n map.put(A[i],new ArrayList<Integer>());\n }\n continue;\n }\n \n if(!map.containsKey(A[i])){\n \tmap.put(A[i],new ArrayList<Integer>());\n }\n map.get(A[i]).add(i);\n nonDup+=map.get(K-A[i]).size();\n }\n return nonDup*2+dup;\n }",
"public int solution2(int N) {\n\n int l = 0; // 2*l - r\n int r = 1; // 2*r - l\n\n return search2(l, r, N);\n }",
"public void seekWalls() {\n\t\t for (int j=0; j<visited[0].length; j++){\n\t\t\tfor (int i=visited.length-1; i>=0; i--) {\t\t\t\n\t\t\t\tif (i!=0 && j!= visited[0].length-1) {//general position\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i-1][j]) == maxComb && !isFree(i,j,2)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'N';\n\t\t\t\t\t\treturn;//not break!!!!! return to exit !\n\t\t\t\t\t}\n\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i][j+1]) == maxComb && !isFree(i,j,4)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'E';\t\n\t\t\t\t\t\treturn;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if (i==0 && j!= visited[0].length-1) {\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i][j+1]) == maxComb && !isFree(i,j,4)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'E';\t\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse if (i!=0 && j== visited[0].length-1) {\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i-1][j]) == maxComb && !isFree(i,j,2)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'N';\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\telse {//if (i==0 && j== visited[0].length-1) {\n\t\t\t\t\t//no solution\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public int dfs(int row, int col, int[][] grid) {\n //when current position is in bound and current element is 1, add area by 1 and continue recursively\n //find other 1's, until all four directions reach 0, finally we get area of current island\n if (col >= 0 && row >= 0 && row < grid.length && col < grid[0].length && grid[row][col] == 1) {\n grid[row][col] = 0;\n return 1 + dfs(row + 1, col, grid) + dfs(row - 1, col, grid)\n + dfs(row, col + 1, grid) + dfs(row, col - 1, grid);\n }\n //DO NOT forget return 0 for recursion exit when reach 0\n return 0;\n }",
"public boolean winner2DP(int[] a) {\n int[][] dp = new int[a.length][a.length];\n for (int s = a.length - 1; s >= 0; s--) {\n dp[s][s] = a[s];\n for (int e = s + 1; e < a.length; e++) {\n int c1 = a[s] - dp[s + 1][e];\n int c2 = a[e] - dp[s][e - 1];\n dp[s][e] = Math.max(c1, c2);\n }\n }\n for (int[] ar : dp)\n System.out.println(Arrays.toString(ar));\n return dp[0][a.length - 1] >= 0;\n }",
"public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int[][] array2D = new int[n][n];\n\n for(int a=0;a<n;a++){\n for(int i=0;i<n;i++){\n array2D[a][i] = sc.nextInt();\n }\n }\n\n boolean isSymmetric = true;\n for(int a=0;a<n;a++){\n for(int b=0;b<n;b++){\n if(array2D[a][b] != array2D[b][a]){\n isSymmetric = false;\n break;\n }\n }\n }\n\n System.out.println((isSymmetric)? \"YES\" : \"NO\");\n\n }",
"public static int example2(int[] arr) { // O(1)\r\n\t\tint n = arr.length, total = 0; // O(1)\r\n\t\tfor (int j = 0; j < n; j += 2) // note the increment of 2 // O(1)\r\n\t\t\ttotal += arr[j];\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: Once Again, we have a (for) loop and it runs (n) times and this\r\n\t\t * for loop dominates the runtime.So this is linear time and the answer is O(n).\r\n\t\t * \r\n\t\t */\r\n\t}",
"public int[] solver(int startPlayerId, int curplayer, int[][] oneP, int[][][] memory, int count) {\n\r\n int[][] one = oneP.clone(); // OnePlay Input\r\n int[] k; // onePlay points\r\n int j = curplayer;\r\n int[][][] m = memory.clone();\r\n int[] minCard = new int[3];\r\n int[] t;\r\n ArrayList<int[]> store = new ArrayList<>();\r\n minCard[2] = 100000;\r\n t = new int[3];\r\n for (int i = 0; i < 4; i++) { // 4 types of cards\r\n for (int l = 2; l < cardPerPlayer + 2; l++) {\r\n if (m[j][i][l] == 1 || m[j][i][l] == 2) {\r\n one[j][0] = i;\r\n one[j][1] = l;\r\n remove(new int[] { i, l }, m);\r\n if ((j + 1) % players != startPlayerId) {\r\n t = solver(startPlayerId, (j + 1) % players, one, m, count);\r\n one[(j + 1) % players][0] = t[0];\r\n one[(j + 1) % players][1] = t[1];\r\n }\r\n // } else if ((j + 2) % players != startPlayerId) {\r\n // t = solver(startPlayerId, (j + 2) % players, one, m, count);\r\n // one[(j + 1) % players][0] = t[0];\r\n // one[(j + 1) % players][1] = t[1];\r\n // } else if ((j + 3) % players != startPlayerId) {\r\n // t = solver(startPlayerId, (j + 3) % players, one, m, count);\r\n // one[(j + 1) % players][0] = t[0];\r\n // one[(j + 1) % players][1] = t[1];\r\n // }\r\n\r\n k = onePlay(one, startPlayerId);\r\n int curpoint = 0;\r\n if (count != cardPerPlayer - 1) { // cardPerPlayer - 1 = 12\r\n t = solver(k[0], k[0], new int[4][2], m, count++);\r\n curpoint = t[2];\r\n }\r\n\r\n if (k[0] == myID) {\r\n curpoint += k[1] + k[2] * 12;\r\n }\r\n store.add(new int[] { i, l, curpoint });\r\n if (curpoint < minCard[2]) {\r\n minCard[2] = curpoint;\r\n minCard[0] = i;\r\n minCard[1] = l;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return minCard;\r\n }",
"static int[] OnepassSol1(int[]a, int n){\r\n Map<Integer, Integer> map = new HashMap<>();\r\n for (int i = 0; i < a.length; i++) {\r\n int complement = n - a[i];\r\n if (map.containsKey(complement)) {\r\n return new int[] { map.get(complement), i };\r\n }\r\n map.put(a[i], i);\r\n }\r\n int[] ans = {-1,-1};\r\n return ans;\r\n }",
"static void print(int i, int j) {\n\t\tif (i == n - 1 && j == n - 1)\n\t\t\treturn;\n\t\tif (j < n - 1 && i < n) {\n\t\t\tif (dp(i, j) == grid[i][j] + dp(i, j + 1)) {\n\t\t\t\tSystem.out.print(\"R\");\n\t\t\t\tprint(i, j + 1);\n\t\t\t}\n\t\t} else {\n\t\t\tif (dp(i, j) == grid[i][j] + dp(i + 1, j)) {\n\t\t\t\tSystem.out.print(\"D\");\n\t\t\t\tprint(i + 1, j);\n\t\t\t}\n\t\t}\n\t}",
"public static int example3(int[] arr) { // O(n)\r\n\t\tint n = arr.length, total = 0; // O(1)\r\n\t\tfor (int j = 0; j < n; j++) // loop from 0 to n-1 // O(n^2)\r\n\t\t\tfor (int k = 0; k <= j; k++) // loop from 0 to j\r\n\t\t\t\ttotal += arr[j];\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: Since we have nested for loop which dominates here and it is\r\n\t\t * O(n^2) and we always take the maximum. so the answer is quadratic time O(n^2)\r\n\t\t * \r\n\t\t */\r\n\t}",
"int help(int n, int k, int[][] map) {\n if (n <= 0 || k < 0) return 0;\n if (0 == k) return 1;\n if (1 == k) return n - 1;\n if (map[n][k] > 0) return map[n][k];\n long sum = 0;\n for (int i = 1; i <= k; i ++) {\n for (int j = 0; j < n; j ++) {\n// System.out.println(\"i = \" + i + \", j = \" + j + \", j - i = \" + (j - i) + \", j + i = \" + (j + i) + \", f0 = \" + (n - j + i - 1) + \", f1 = \" + (n - j - i - 1) + \", k - i = \" + (k - i));\n int g = 0, g0 = 0, g1 = 0;\n if (j - i >= 0) {\n g += help(n - j + i - 1, k - i, map);\n sum += g;\n// System.out.println(\"g0 = \" + g0 + \", g1 = \" + g1 + \", g = \" + g + \", sum = \" + sum);\n// System.out.println(\"-\");\n }\n }\n\n }\n// System.out.println(\"sum = \" + sum + \" ----\");\n map[n][k] = (int)sum;\n return (int)sum;\n }",
"public int solution(int[][] A) {\n int countSaddlePoint = 0;\n for (int p = 1 ; p < A.length -1 ; p++)\n for (int q =1 ; q < A.length - 1; q ++)\n {\n\n System.out.println(\"P: \" + p);\n System.out.println(\"Q: \" + q);\n\n if (((A[p][q-1] > A[p][q]) && (A[p][q] < A[p][q+1])\n && (A[p-1][q] < A[p][q]) && (A[p][q] > A[p+1][q]))\n || ((A[p][q-1] < A[p][q]) && (A[p][q] > A[p][q+1])\n && (A[p-1][q] > A[p][q]) && (A[p][q] < A[p+1][q]))\n )\n {\n System.out.println(\"Entering Here for \" + p);\n System.out.println(\"Entering Here for \" + q);\n ++countSaddlePoint;\n\n }\n\n }\n\n return countSaddlePoint;\n }",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint[] arr = new int[n+1];\n\t\tint[] dp = new int[n+1];\n\t\tfor (int i = 1; i < arr.length; i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\t\n\t\tfor (int i = 1; i < arr.length; i++) {\n\t\t\tfor (int j = 1; j <= i; j++) {\n\t\t\t\tdp[i] = Math.max(dp[i], dp[i-j] + arr[j]);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(dp[arr.length-1]);\n\t}",
"public static void main(String[] args) throws IOException{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint[] array = new int[n];\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tarray[i] = sc.nextInt();\n\t\t}\n\t\tint[][] dp = new int[n][n];\n\t\tint[][] c = new int[n][n];\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tint count=0,max=0;\n\t\t\tfor(int j=i;j<n;j++)\n\t\t\t{\n\t\t\t\tif(j==i){\n\t\t\t\t\tdp[i][j]=array[j];\n\t\t\t\t\tcount++;\n\t\t\t\t\tc[i][j]=count;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\telse{\n\t\t\t\t\tif(array[j]==array[j-1]){\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t\tif(max<count) {\n\t\t\t\t\t\t\tmax =count;\n\t\t\t\t\t\t\tdp[i][j]=array[j];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\tdp[i][j]=dp[i][j-1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tc[i][j]=count;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tcount =1;\n\t\t\t\t\t\tdp[i][j] = dp[i][j-1];\n\t\t\t\t\t\tc[i][j]=count;\n\t\t\t\t\t\t\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\t//System.out.print(dp[i][j]+\" \");\n\t\t\t}\n\t\t\t//System.out.println();\n\t\t}\n\t\t\n\t\tfor(int i=0;i<m;i++)\n\t\t{\n\t\t\tint l = sc.nextInt()-1;\n\t\t\tint r = sc.nextInt()-1;\n\t\t\tint k = sc.nextInt();\n\t\t\tif(c[l][r]>k)\n\t\t\t{\n\t\t\t\tSystem.out.println(dp[l][r]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(-1);\n\t\t\t}\n\t\t}\n\t}",
"public static void main(String[] args) {\n\t\t\r\n\t\tint n = 6;\r\n\t\t\r\n\t\t// Using recursion(top-down DP) with TIme O(n) Space O(n)+StackSpace\r\n\t\t\r\n//\t\tint[] dp = new int[n+1];\r\n//\t\tint res = getNumberOfWays(n,dp);\r\n//\t\tSystem.out.println(res);\r\n\t\t\r\n\t\t\r\n\t\t// Using recursion(bottom-up DP) with TIme O(n) Space O(n)\r\n\t\t\r\n\t\tint[ ] dp = new int[n+1];\r\n\t\t\r\n\t\tdp[0] = 0;\r\n\t\tdp[1] = 1;\r\n\t\tdp[2] = 2;\r\n\t\t\r\n\t\tfor(int i =3;i<=n;i++) {\r\n\t\t\tdp[i] = dp[i-1]+dp[i-2];\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(dp[n]);\r\n\r\n\t}",
"private void tred2() {\n // This is derived from the Algol procedures tred2 by\n // Bowdler, Martin, Reinsch, and Wilkinson, Handbook for\n // Auto. Comp., Vol.ii-Linear Algebra, and the corresponding\n // Fortran subroutine in EISPACK.\n\n d.assign(v.viewColumn(n - 1));\n\n // Householder reduction to tridiagonal form.\n\n for (int i = n - 1; i > 0; i--) {\n\n // Scale to avoid under/overflow.\n\n double scale = d.viewPart(0, i).norm(1);\n double h = 0.0;\n\n\n if (scale == 0.0) {\n e.setQuick(i, d.getQuick(i - 1));\n for (int j = 0; j < i; j++) {\n d.setQuick(j, v.getQuick(i - 1, j));\n v.setQuick(i, j, 0.0);\n v.setQuick(j, i, 0.0);\n }\n } else {\n\n // Generate Householder vector.\n\n for (int k = 0; k < i; k++) {\n d.setQuick(k, d.getQuick(k) / scale);\n h += d.getQuick(k) * d.getQuick(k);\n }\n double f = d.getQuick(i - 1);\n double g = Math.sqrt(h);\n if (f > 0) {\n g = -g;\n }\n e.setQuick(i, scale * g);\n h -= f * g;\n d.setQuick(i - 1, f - g);\n for (int j = 0; j < i; j++) {\n e.setQuick(j, 0.0);\n }\n\n // Apply similarity transformation to remaining columns.\n\n for (int j = 0; j < i; j++) {\n f = d.getQuick(j);\n v.setQuick(j, i, f);\n g = e.getQuick(j) + v.getQuick(j, j) * f;\n for (int k = j + 1; k <= i - 1; k++) {\n g += v.getQuick(k, j) * d.getQuick(k);\n e.setQuick(k, e.getQuick(k) + v.getQuick(k, j) * f);\n }\n e.setQuick(j, g);\n }\n f = 0.0;\n for (int j = 0; j < i; j++) {\n e.setQuick(j, e.getQuick(j) / h);\n f += e.getQuick(j) * d.getQuick(j);\n }\n double hh = f / (h + h);\n for (int j = 0; j < i; j++) {\n e.setQuick(j, e.getQuick(j) - hh * d.getQuick(j));\n }\n for (int j = 0; j < i; j++) {\n f = d.getQuick(j);\n g = e.getQuick(j);\n for (int k = j; k <= i - 1; k++) {\n v.setQuick(k, j, v.getQuick(k, j) - (f * e.getQuick(k) + g * d.getQuick(k)));\n }\n d.setQuick(j, v.getQuick(i - 1, j));\n v.setQuick(i, j, 0.0);\n }\n }\n d.setQuick(i, h);\n }\n\n // Accumulate transformations.\n\n for (int i = 0; i < n - 1; i++) {\n v.setQuick(n - 1, i, v.getQuick(i, i));\n v.setQuick(i, i, 1.0);\n double h = d.getQuick(i + 1);\n if (h != 0.0) {\n for (int k = 0; k <= i; k++) {\n d.setQuick(k, v.getQuick(k, i + 1) / h);\n }\n for (int j = 0; j <= i; j++) {\n double g = 0.0;\n for (int k = 0; k <= i; k++) {\n g += v.getQuick(k, i + 1) * v.getQuick(k, j);\n }\n for (int k = 0; k <= i; k++) {\n v.setQuick(k, j, v.getQuick(k, j) - g * d.getQuick(k));\n }\n }\n }\n for (int k = 0; k <= i; k++) {\n v.setQuick(k, i + 1, 0.0);\n }\n }\n d.assign(v.viewRow(n - 1));\n v.viewRow(n - 1).assign(0);\n v.setQuick(n - 1, n - 1, 1.0);\n e.setQuick(0, 0.0);\n }",
"static boolean subSetSumProblem(int[] arr,int sum){\n// init\n int n = arr.length;\n boolean[][] dp = new boolean[n+1][sum+1];\n\n for (int j = 0;j<=sum;j++){\n dp[0][j] = false;\n }\n\n for (int i = 0;i<=n;i++){\n dp[i][0] = true;\n }\n\n for (int i = 1;i<=n;i++){\n for (int j = 1;j<=sum;j++){\n if (arr[i-1] <= j){\n dp[i][j] = dp[i-1][j] || dp[i-1][j-arr[i-1]];\n }else{\n dp[i][j] = dp[i-1][j];\n }\n }\n }\n return dp[n][sum];\n }",
"@Override\n\tpublic void algorithm() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t\t\n\t\tint change = 2;\n\t\t\n\t\tfor(int i=0; i<this.getGridGame().getGridRow(); i++) {\n\t\t\t\n\t\t\tfor(int j=0; j<this.getGridGame().getGridCol(); j++) {\n\t\t\t\t\n\t\t\t\tif(j > 0 && j < this.getGridGame().getGridCol()) {\n\t\t\t\t\t\n\t\t\t\t\tif(this.getGridGame().getPattern(i,j-1) != this.getGridGame().getPattern(i,j)) {\n\t\t\t\t\t\n\t\t\t\t\t\tchange--;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(change > 0) {\n\t\t\t\t\t\n\t\t\t\t\tthis.getArray()[i][0] += this.getGridGame().getPattern(i,j);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tthis.getArray()[i][1] += this.getGridGame().getPattern(i,j);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t//System.out.println(change + \" \");\n\t\t\tchange = 2;\n\t\t\t\n\t\t\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i=0; i<this.getGridGame().getGridRow(); i++) {\n\t\t\t\n\t\t\tif(this.getArray()[i][1] == 0) {\n\t\t\t\t\n\t\t\t\tthis.getArray()[i][1] = this.getArray()[i][0];\n\t\t\t\tthis.getArray()[i][0] = 0;\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i=0; i<this.getGridGame().getGridRow(); i++) {\n\t\t\t\n\t\t\tfor(int j=0; j<2; j++) {\n\t\t\t\n\t\t\t\tSystem.out.print(this.getArray()[i][j] + \" \");\n\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println(\" \");\n\t\t\t\n\t\t}\n\t\t\n\t\n\t}",
"public abstract int[] solve(double[][] costs);",
"public static int[] solution(int[] T) {\n int capital = -1;\n Map<Integer,List<Integer>> con = new HashMap<Integer,List<Integer>>(); //store the connectivity between cities\n for(int i=0;i<T.length;i++){\n if(i==T[i]){\n capital = i;\n }\n //there is a single road path between these cities\n if(!con.containsKey(i)){\n con.put(i, new ArrayList<Integer>());\n }\n if(i!=T[i])\n con.get(i).add(T[i]);\n //we can also go other way round\n if(!con.containsKey(T[i])){\n con.put(T[i], new ArrayList<Integer>());\n }\n if(i!=T[i])\n con.get(T[i]).add(i);\n //System.out.println(\"adding pairs:\"+T[i]+\" and:\"+i);\n \n }\n //for(Integer ii:con.keySet()){\n // System.out.println(\"node \"+ii+\" has neighbors:\"+Arrays.toString(con.get(ii).toArray()));\n //}\n //after initializing the one-road connectivity between the cities, we need to count the\n //number of cities at each distance\n int[] citCount = new int[T.length-1];\n // assume it starts from 0 but has the equivalence to 1 index array, i.e. we store citCount[0] as the no. of cities having 1 dist to capital\n HashSet<Integer> visitedCities = new HashSet<Integer>();\n List<Integer> lastCities = null;\n for(int i=0;i<T.length;i++){\n //last iteration cities\n if(i==0){\n lastCities = con.get(capital);\n citCount[i] = lastCities.size(); //the nodes directly connected to capital city\n visitedCities.addAll(con.get(capital));\n visitedCities.add(capital);\n System.out.println(\"the \"+(i+1)+\" neighbors of \"+capital+\"..are:\"+Arrays.toString(con.get(capital).toArray()));\n }else{\n //get the neighbor of the last cities\n int neighborcount = 0;\n List<Integer> newCities = new ArrayList<Integer>();\n for(Integer ii:lastCities){\n List<Integer> n = con.get(ii);\n for(Integer nn:n){\n if(!visitedCities.contains(nn)){\n neighborcount++;\n newCities.add(nn);\n }\n }\n }\n visitedCities.addAll(lastCities);\n citCount[i] = neighborcount;\n System.out.println(\"the \"+(i+1)+\" neighbors of \"+capital+\"..are:\"+Arrays.toString(newCities.toArray()));\n lastCities.clear();\n lastCities.addAll(newCities);\n //lastCities.removeAll(visitedCities);\n }\n \n }\n \n \n return citCount;\n }",
"public int uniquePathsWithObstaclesDP(int[][] obstacleGrid) {\n int m=obstacleGrid.length;\n int n=obstacleGrid[0].length;\n if (obstacleGrid[0][0]==1||obstacleGrid[m-1][n-1]==1)\n return 0;\n int[][] paths = new int[m][n];\n paths[0][0]=1;\n for(int i=1;i<m;i++){\n if(obstacleGrid[i][0]==1)\n paths[i][0]=0;\n else\n paths[i][0]=paths[i-1][0];\n }\n\n for(int j=1;j<n;j++){\n if(obstacleGrid[0][j]==1)\n paths[0][j]=0;\n else\n paths[0][j]=paths[0][j-1];\n }\n\n for(int i=1; i<m;i++){\n for(int j=1;j<n;j++){\n if (obstacleGrid[i][j]==1)\n paths[i][j]=0;\n else\n paths[i][j]=paths[i-1][j]+paths[i][j-1];\n }\n }\n return paths[m-1][n-1];\n }",
"public int findPairsTwoPointers(int[] nums, int k) {\n if (k < 0) {\n return 0;\n }\n Arrays.sort(nums); // O(N*logN)\n\n int i = 0;\n int j = 1;\n int count = 0;\n while (j < nums.length) { // O(N)\n if (i == j || nums[j] - nums[i] < k) {\n j++;\n } else if (nums[j] - nums[i] > k) {\n i++;\n } else {\n count += 1;\n j++;\n while (j < nums.length && nums[j] == nums[j - 1]) {\n j++;\n }\n }\n }\n return count;\n }",
"public int[] findDiagonalOrder(List<List<Integer>> nums) {\n\t\tMap<Integer, Stack<Integer>> map = new LinkedHashMap<>();\n\t\tint c = 0;\n\t\tfor (int i = 0; i < nums.size(); i++) {\n\t\t\tfor (int j = 0; j < nums.get(i).size(); j++) {\n\t\t\t\tmap.putIfAbsent(i + j, new Stack<>());\n\t\t\t\tmap.get(i + j).push(nums.get(i).get(j));\n\t\t\t\tc++;\n\t\t\t}\n\t\t}\n\t\tint[] res = new int[c];\n\t\tint i = 0;\n\t\tfor (Stack<Integer> stack : map.values()) {\n\t\t\twhile (!stack.isEmpty())\n\t\t\t\tres[i++] = stack.pop();\n\t\t}\n\t\treturn res;\n\t}",
"public static int iterativeFactDP(int n){\n int[] table = new int[n+1];\n table[0] = 0;\n table[1] = 1;\n for (int i = 2; i <=n ; i++) {\n table[i] = table[i-2]+table[i-1];\n }\n return table[n];\n }",
"public BitSet floodFill2DBitSet() {\r\n\r\n int xDim = dims[0];\r\n int yDim = dims[1];\r\n Point pt;\r\n Point tempPt;\r\n Stack<Point> stack = new Stack<Point>();\r\n int indexY;\r\n int x, y;\r\n\r\n if (mask.get((seed2DPt.y * xDim) + seed2DPt.x)) {\r\n stack.push(seed2DPt);\r\n mask.clear((seed2DPt.y * xDim) + seed2DPt.x);\r\n\r\n while (!stack.empty()) {\r\n pt = (Point) stack.pop();\r\n x = pt.x;\r\n y = pt.y;\r\n indexY = y * xDim;\r\n\r\n newMask.set(indexY + x);\r\n\r\n if ((x + 1) < xDim) {\r\n\r\n if (mask.get(indexY + x + 1)) {\r\n tempPt = new Point(x + 1, y);\r\n stack.push(tempPt);\r\n mask.clear(indexY + tempPt.x);\r\n }\r\n }\r\n\r\n if ((x - 1) >= 0) {\r\n\r\n if (mask.get(indexY + x - 1)) {\r\n tempPt = new Point(x - 1, y);\r\n stack.push(tempPt);\r\n mask.clear(indexY + tempPt.x);\r\n }\r\n }\r\n\r\n if ((y + 1) < yDim) {\r\n\r\n if (mask.get(((y + 1) * xDim) + x)) {\r\n tempPt = new Point(x, y + 1);\r\n stack.push(tempPt);\r\n mask.clear((tempPt.y * xDim) + x);\r\n }\r\n }\r\n\r\n if ((y - 1) >= 0) {\r\n\r\n if (mask.get(((y - 1) * xDim) + x)) {\r\n tempPt = new Point(x, y - 1);\r\n stack.push(tempPt);\r\n mask.clear((tempPt.y * xDim) + x);\r\n }\r\n }\r\n }\r\n }\r\n\r\n setCompleted(true);\r\n\r\n return newMask;\r\n }",
"public static boolean checkPath(int[][] bs, int i) {\n\t\tArrayList<Integer> temp_cP = new ArrayList<Integer>();\n\t\tSet<Integer> temp_setcP = new HashSet<Integer>();\n\t\tboolean denoter = true;\n\t\twhile (i == 3) {\n\t\t\tfor (int k = 0; k < i; k++) {\n\t\t\t\tfor (int e = 0; e < 3; e++) {\n\t\t\t\t\ttemp_cP.add(e, bs[k][e]);\n\t\t\t\t}\n\t\t\t}\n\t\t\ttemp_setcP = new HashSet<Integer>(temp_cP);\n\t\t\tif (temp_cP.size() > temp_setcP.size()) {\n\t\t\t\tdenoter = false;\n\t\t\t\tbreak;\n\n\t\t\t} else {\n\t\t\t\ttemp_cP.clear();\n\t\t\t\ttemp_setcP.clear();\n\n\t\t\t\tfor (int k = 0; k < i; k++) {\n\t\t\t\t\tfor (int e = 3; e < 6; e++) {\n\t\t\t\t\t\ttemp_cP.add(bs[k][e]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp_setcP = new HashSet<Integer>(temp_cP);\n\t\t\t\tif (temp_cP.size() > temp_setcP.size()) {\n\t\t\t\t\tdenoter = false;\n\t\t\t\t\tbreak;\n\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\twhile (i == 6) {\n\n\t\t\tfor (int k = 3; k < i; k++) {\n\t\t\t\tfor (int e = 0; e < 3; e++) {\n\t\t\t\t\ttemp_cP.add(e, bs[k][e]);\n\t\t\t\t}\n\t\t\t}\n\t\t\ttemp_setcP = new HashSet<Integer>(temp_cP);\n\t\t\tif (temp_cP.size() > temp_setcP.size()) {\n\t\t\t\tdenoter = false;\n\t\t\t\tbreak;\n\n\t\t\t} else {\n\t\t\t\ttemp_cP.clear();\n\t\t\t\ttemp_setcP.clear();\n\n\t\t\t\tfor (int k = 3; k < i; k++) {\n\t\t\t\t\tfor (int e = 3; e < 6; e++) {\n\t\t\t\t\t\ttemp_cP.add(bs[k][e]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp_setcP = new HashSet<Integer>(temp_cP);\n\t\t\t\tif (temp_cP.size() > temp_setcP.size()) {\n\t\t\t\t\tdenoter = false;\n\t\t\t\t\tbreak;\n\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn denoter;\n\t}",
"static int recursion(int steps, int arrLen, int index, int[][] dp) {\n\n if (steps == 0 && index == 0) {\n return 1;\n }\n\n // extra base condition is index> steps , because we cannot return from there at all.\n if (steps == 0 || index < 0 || index >= arrLen || index > steps) return 0;\n\n if (dp[steps][index] != -1) return dp[steps][index];\n\n int ans = 0;\n\n // we can go either left , right or stay there itself.\n ans = (ans + recursion(steps - 1, arrLen, index, dp)) % MOD;\n ans = (ans + recursion(steps - 1, arrLen, index + 1, dp)) % MOD;\n ans = (ans + recursion(steps - 1, arrLen, index - 1, dp)) % MOD;\n dp[steps][index] = ans % MOD;\n return dp[steps][index];\n }",
"public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t\tint a[] = {2,1,3,-4,-2};\n\t\t//int a[] = {1 ,2, 3, 7, 5};\n\t\tboolean found = false;\n\t\t\n\t\t//this will solve in o n^2\n\t\tfor(int i = 0 ; i < a.length ; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = i ; j< a.length ; j++){\n\t\t\t\tsum += a[j] ;\n\t\t\t\tif(sum == 0){\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(found)\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t\n\t\t// link : https://www.youtube.com/watch?v=PSpuM9cimxA&list=PLKKfKV1b9e8ps6dD3QA5KFfHdiWj9cB1s&index=49\n\t\tSystem.out.println(found + \" found\");\n\t\tfound = false;\n\t\t//solving with O of N with the help sets\n\t\t// x + 0 = y\n\t\tSet<Integer> set = new HashSet<>();\n\t\tint sum = 0;\n\t\tfor(int element : a){\n\t\t\tset.add(sum);\n\t\t\tsum += element;\n\t\t\tif(set.contains(sum)){\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(set);\n\t\t\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t\tfound = false;\n\t\t// when the sum of subarray is K\n\t\t\n\t\t//solving with O of N with the help sets\n\t\t//x + k = y >>>\n\t\tSet<Integer> set1 = new HashSet<>();\n\t\tint k = 12;\n\t\tint summ = 0;\n\t\tfor(int element : a){\n\t\t\tset1.add(summ);\n\t\t\tsumm += element;\n\t\t\tif(set1.contains(summ - k)){ // y - k = x(alredy presnt or not)\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(set1);\n\t\tSystem.out.println();\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t}",
"public static void main(String[] args) throws Exception {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tBufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\t\tStringTokenizer st = new StringTokenizer(br.readLine(), \" \");\n\n\t\tint N = Integer.parseInt(st.nextToken());\n\t\tint K = Integer.parseInt(st.nextToken());\n\t\tlong[][] dp = new long[MAX][MAX]; // dp[K][N] N을 만들기 위해서 필요한 K개의 정수를 의미함\n\n\t\tfor (int i = 0; i < MAX; i++) {\n\t\t\tdp[i][0] = 1; // 몇 개의 정수를 사용하든 0을 만드는 방법은 모두 1가지임\n\t\t\tdp[1][i] = 1; // 어떤 정수를 만들든 1개만 사용하는 경우는 자기자신 1가지 뿐임\n\t\t}\n\n\t\tfor (int i = 1; i < MAX; i++) {\n\t\t\tdp[2][i] = i + 1; // 2개의 정수를 사용해서 N을 만드는 방법은 규칙을 보면 N+1개가 있다\n\t\t}\n\t\t\n\t\t\n\t\tfor (int i = 1; i <= K; i++) {\n\t\t\tfor (int j = 1; j <= N; j++) {\n\t\t\t\tdp[i][j] = (dp[i][j - 1] + dp[i - 1][j]) % 1000000000;\n\t\t\t}\n\t\t}\n\t\t\n\t\tbw.append(Long.toString(dp[K][N]));\n\t\tbw.flush();\n\t}",
"private static int solve(int[] wt, int[] val, int n, int w) {\n int[][] dp = new int[n+1][w + 1];\n\n for (int i = 1; i <= n; ++i) {\n for (int j = 1; j <= w; ++j) {\n if (wt[i-1] <= j) dp[i][j] = Math.max(dp[i-1][j] , val[i-1]+dp[i-1][j-wt[i-1]]);\n else dp[i][j] = dp[i-1][j];\n }\n }\n return dp[n][w];\n }",
"private void helper(int[][] A, int x, int y) {\n if(x >= 0 && x < A.length && y >= 0 && y < A[0].length && A[x][y] == 1) {\n A[x][y] = 2;\n for(int i = 0; i < 4; i++) {\n int new_x = x + dx[i];\n int new_y = y + dy[i];\n helper(A, new_x, new_y);\n }\n }\n }",
"private void helper(int[][] A, int x, int y) {\n if(x >= 0 && x < A.length && y >= 0 && y < A[0].length && A[x][y] == 1) {\n A[x][y] = 2;\n for(int i = 0; i < 4; i++) {\n int new_x = x + dx[i];\n int new_y = y + dy[i];\n helper(A, new_x, new_y);\n }\n }\n }",
"public abstract MyPair<double[],Double> fastPlayouts(MachineState state, int numSimulationsPerPlayout, int maxDepth) throws TransitionDefinitionException, MoveDefinitionException, GoalDefinitionException, StateMachineException;",
"static double[][] cStar_m2(int N, int G, double gamma) {\n\tdouble alpha0=1; \n\tdouble beta0=1;\n\t// %1000 for time horizon (i.e. number of 1000 samples collected)\n //%it should be large enough to approximate the dynamic programming\n\t//int N=1000;\n\n\t// %start with the matrix of forwarding all at c=0;\n // c_star=tril(ones(N+1,N+1)); \n\n\tdouble[][] c_star = Mu.matrix(N+1,N+1);\n\tfor(int i=0; i< c_star.length; i++) {\n\t for(int j=0; j< c_star[i].length; j++) {\n\t\tc_star[i][j] = (j<i ? 1 : 0);\n\t }\t \n\t}\n\n\n\t//for k=1:gridSize\n\tfor(int k=1; k<=G; k++) {\n\t //%set c and resolve the DP and found the forwarding\n\t //%decision at each state (1 for forwarding and 0 for not\n\t //%forwarding)\n\t // c=k/gridSize;\n\t final double c= k/(double)G;\n\t //V=zeros(N+1,N+1); %value function at each state\n\t double[][] V = Mu.matrix(N+1,N+1);\n\t //M=zeros(N+1,N+1); %mean mu_n at each state\n\n\t //idx=ones(N+1,N+1); %optimal choice (1 to forward and 0 for not forward) at each state\n\n\t //for i=N:-1:0 % the total number of samples taken is n=N\n\t for(int i=N; i>=0; i--) {\n\t\t//M(i+1,i+1)=(alpha0+i)/(alpha0+beta0+N); %mean at termination state\n\t\tdouble m =(alpha0+i)/(alpha0+beta0+N); \n\t\t//EfReward(i+1,i+1)=0;\n\t\t//% This value is a lower bound, which comes from the\n\t\t//% better of two policies: don't forward anything\n\t\t//% (value of 0) forward now, and forever into the\n\t\t//% future (value of M-c, summed over the geometric\n\t\t//% series of gamma^n)\n\t\t// [V(i+1,i+1),idx(i+1,i+1)]=max([0,M(i+1,i+1)-c]/(1-gamma));\n\t\tdouble q = m-c;\n\t\tif (q>0) {\n\t\t V[i][i] = q/(1-gamma);\n\t\t c_star[i][i] += 1;\n\t\t}\n\t }\n\t // for n=N-1:-1:0 % n is the total number of samples taken\n\t for(int n=N-1; n>=0; n--) {\n\t\t//for i=0:1:n % i is the number of sucesses, so n-i is the number of failures\n\t\tfor(int i=0;i<=n; i++) {\n\t\t //M(i+N-n+1,i+1)=(alpha0+i)/(alpha0+beta0+n); %mean calculated at each state\n\t\t double m = (alpha0+i)/(alpha0+beta0+n);\n\t\t //EfReward(i+N-n+1,i+1)=gamma*(\n\t\t //(1-M(i+N-n+1,i+1))*V(i+N-n,i+1)+M(i+N-n+1,i+1)*V(i+N-n+1,i+2)\n\t\t //);\n \n\t\t double efReward=gamma*((1-m)*V[i+N-n-1][i]+m*V[i+N-n][i+1]);\n\t\t //[V(i+N-n+1,i+1),idx(i+N-n+1,i+1)]=\n\t\t // max([0,M(i+N-n+1,i+1)-c+EfReward(i+N-n+1,i+1)]);\n\t\t double q = m - c + efReward;\n\t\t if (q>0) {\n\t\t\tV[i+N-n][i] = q;\n\t\t\tc_star[i+N-n][i] += 1;\n\t\t }\n\t\t}\n\t }\n\n\t // idx=idx-ones(N+1,N+1); %idx tells us the optimal decision at each state, 1 for forwarding and 0 for not\n \n\t //c_star=c_star+idx; %accumulate optimal decisions at every state to figure out c*\n\t}\n\n\t// c_star=c_star/gridSize; %compute c* by normalizing it\n\tfor(int i=0; i< c_star.length; i++) {\n\t for(int j=0; j< c_star[i].length; j++) {\n\t\tc_star[i][j] /= G;\n\t }\t \n\t}\n\t// reverse order\n\tdouble [][] tmp = new double[c_star.length][];\n\tfor(int i=0; i< c_star.length; i++) {\n\t tmp[i] = c_star[c_star.length-1-i];\n\t}\t\n\treturn tmp;\n }",
"private static int betterSolution(int n) {\n return n*n*n;\n }",
"public List<Integer> diffWaysToCompute(String input) {\n List<Integer> result=new ArrayList<>();\n if(input==null||input.length()==0) return result;\n List<String> ops=new ArrayList<>();\n for(int i=0; i<input.length(); i++){\n int j=i;\n while(j<input.length()&&Character.isDigit(input.charAt(j)))\n j++;\n ops.add(input.substring(i, j));\n if(j!=input.length()) ops.add(input.substring(j, j+1));\n i=j;\n }\n int N=(ops.size()+1)/2; //num of integers\n ArrayList<Integer>[][] dp=(ArrayList<Integer>[][]) new ArrayList[N][N];\n for(int d=0; d<N; d++){\n if(d==0){\n for(int i=0; i<N; i++){\n dp[i][i]=new ArrayList<>();\n dp[i][i].add(Integer.valueOf(ops.get(i*2)));\n }\n continue;\n }\n for(int i=0; i<N-d; i++){\n dp[i][i+d]=new ArrayList<>();\n for(int j=i; j<i+d; j++){\n ArrayList<Integer> left=dp[i][j], right=dp[j+1][i+d];\n String operator=ops.get(j*2+1);\n for(int leftNum:left)\n for(int rightNum:right){\n if(operator.equals(\"+\"))\n dp[i][i+d].add(leftNum+rightNum);\n else if(operator.equals(\"-\"))\n dp[i][i+d].add(leftNum-rightNum);\n else\n dp[i][i+d].add(leftNum*rightNum);\n }\n }\n }\n }\n return dp[0][N-1];\n}",
"public static int degreeOfArray(List<Integer> arr) { arr.length = n\n // num of Keys = k\n // O(n + k)\n // max value count = m\n //\n PriorityQueue<Node> pq = new PriorityQueue<>((i, j)-> j.count - i.count);\n Map<Integer, NodePosition> posMap = new HashMap<>();\n Map<Integer, Node> countMap = new HashMap<>();\n // [1, 2, 3, 4, 5, 6]\n for (int i = 0; i < arr.size(); i++) {\n int cur = arr.get(i);\n\n if (!countMap.containsKey(cur)) {\n countMap.put(cur, new Node(cur, 1));\n } else {\n Node curNode = countMap.get(cur);\n curNode.count++;\n countMap.put(cur, curNode);\n }\n\n if (!posMap.containsKey(cur)) {\n posMap.put(cur, new NodePosition(i, i));\n } else {\n NodePosition curNodePos = posMap.get(cur);\n curNodePos.endIndex = i;\n posMap.put(cur, curNodePos);\n }\n }\n //Iterator<Map.Entry<Integer, Node> it = new Iterator<>(countMap);\n for (Map.Entry<Integer, Node> e : countMap.entrySet()) {\n pq.add(e.getValue());\n }\n\n // [1, 2, 1, 3 ,2]\n // 1 , 2 , 3\n Node curNode = pq.remove();\n int maxCount = curNode.count;\n\n int minRange = posMap.get(curNode.num).endIndex - posMap.get(curNode.num).startIndex;\n\n while (!pq.isEmpty() && maxCount == pq.peek().count) {\n curNode = pq.remove();\n NodePosition nPos = posMap.get(curNode.num);\n minRange = Math.min(minRange, nPos.endIndex - nPos.startIndex);\n }\n\n return minRange + 1;\n }",
"public List<List<Integer>> fourSum_optimization(int[] nums, int target) {\n int len = nums.length;\n Arrays.sort(nums);\n if (len < 4)\n return Collections.emptyList();\n List<List<Integer>> arr = new ArrayList<>();\n\n for (int i = 0; i < len - 1; i++) {\n for (int j = i + 1; j < len - 1; j++) {\n int Left = j + 1;\n int Right = len - 1;\n int left_target_sum = target - nums[i] + nums[j];\n\n while (Left < Right) {\n int two_sum = nums[Left] + nums[Right];\n if (two_sum < left_target_sum)\n Left++;\n else if (two_sum > left_target_sum)\n Right--;\n else {\n List<Integer> arr2 = new ArrayList<>();\n if (left_target_sum + two_sum == target) {\n arr2.add(nums[i]);\n arr2.add(nums[j]);\n arr2.add(nums[Left]);\n arr2.add(nums[Right]);\n arr.add(arr2);\n }\n while (Left < Right && nums[Left] == arr2.get(2))\n ++Left;\n while (Left < Right && nums[Right] == arr2.get(3))\n --Right;\n }\n }\n while (i + 1 < len && nums[i + 1] == nums[i])\n ++i;\n while (j + 1 < len && nums[j + 1] == nums[j])\n ++j;\n }\n }\n\n return arr;\n }",
"ArrayList<ArrayList<Integer>> solveSoduku(ArrayList<ArrayList<Integer>> board) {\n solvePartialSodoku(0,0, board);\n return board;\n }",
"public static int[][] optimalBST(double[] p, int num){\n double[][] e = new double[num+2][num+2];\n double[][] w = new double[num+1][num+1];\n //this will to easy count the sum of w from i to j\n //so use w[i][j] = w[i][j-1] + p[j]\n //therefor the size of w is also need num+1\n\n int[][] root = new int[num+1][num+1];//记录根节点\n //root[i][j] -- 用来存放i-j组成的最优二叉查找树的根节点\n\n for(int d = 0; d<num; d++){\n for(int i=1; i<=num-d; i++){\n int j = i + d;\n e[i][j] = Double.MAX_VALUE;\n w[i][j] = w[i][j-1] + p[j-1];//\n for(int k=i; k<=j; k++){\n double temp = w[i][j] + e[i][k-1] + e[k+1][j];;\n if(temp < e[i][j]){\n e[i][j] = temp;\n root[i][j] = k;\n }\n }\n }\n }\n ArrayTool.printDoubleMatrix(w);\n System.out.println(\"the total Search probability of this optimal BST is \"+ e[1][num]);\n return root;\n }",
"private int[] optimum(int x1, int y1, int x2, int y2) {\n if (lookupNodes[x1][y1][x2][y2] != Integer.MAX_VALUE) {\n return new int[]{lookupNodes[x1][y1][x2][y2], lookupDepth[x1][y1][x2][y2]};\n }\n if (hasOneColor(x1, y1, x2, y2)) {\n lookupNodes[x1][y1][x2][y2] = 1;\n lookupDepth[x1][y1][x2][y2] = 0;\n return new int[]{1, 0};\n }\n int nodes;\n int depth;\n for (int X = x1; X < x2; X++) {\n nodes = optimum(x1, y1, X, y2)[0] + optimum(X+1, y1, x2, y2)[0] + 1;\n depth = Math.max(optimum(x1, y1, X, y2)[1], optimum(X+1, y1, x2, y2)[1]) + 1;\n updateLookupNodes(nodes, x1, y1, x2, y2);\n updateLookupDepth(depth, x1, y1, x2, y2);\n }\n for (int Y = y1; Y < y2; Y++) {\n nodes = optimum(x1, y1, x2, Y)[0] + optimum(x1, Y+1, x2, y2)[0] + 1;\n depth = Math.max(optimum(x1, y1, x2, Y)[1], optimum(x1, Y+1, x2, y2)[1]) + 1;\n updateLookupNodes(nodes, x1, y1, x2, y2);\n updateLookupDepth(depth, x1, y1, x2, y2);\n }\n return new int[]{lookupNodes[x1][y1][x2][y2], lookupDepth[x1][y1][x2][y2]};\n }",
"static long solve(long[] d) {\n int len = d.length;\n long[] dp = new long[len];\n\n Set<Long> set = new HashSet<>();\n\n for (int index1 = len - 1; index1 >= 0; index1--) {\n int count = 0;\n for (int index2 = index1 + 1; index2 < len; index2++) {\n if (d[index2] > d[index1]) {\n if( set.contains(d[index2] ) )continue;\n set.add(d[index2]);\n count++;\n }\n }\n set = new HashSet<>();\n dp[index1] = count;\n }\n\n long res = 0;\n Set<Long> distinct = new HashSet<>();\n for (int index1 = 0; index1 < len; index1++) {\n long curr = d[index1];\n if (distinct.contains(curr)) {\n continue;\n } else distinct.add(curr);\n for (int index2 = index1 + 1; index2 < len; index2++) {\n if (d[index2] > curr) {\n if (set.contains(d[index2])) continue;\n res += dp[index2];\n set.add(d[index2]);\n }\n }\n set = new HashSet<>();\n }\n\n return res;\n\n }",
"public static int solveEfficient(int n) {\n if (n == 0 || n == 1)\n return 1;\n\n int n1 = 1;\n int n2 = 1;\n int sum = 0;\n\n for (int i = 2; i <= n; i++) {\n sum = n1 + n2;\n n1 = n2;\n n2 = sum;\n }\n return sum;\n }",
"static void solveKTUtil(int x, int y, int movei,\n int sol[][], int xMove[],\n int yMove[], List<int[][]> result) {\n int k, next_x, next_y;\n if (movei == N * N){\n \tresult.add(copy(sol));\n return ;\n }\n\n /* Try all next moves from the current coordinate\n x, y */\n for (k = 0; k < 8; k++) {\n next_x = x + xMove[k];\n next_y = y + yMove[k];\n if (isSafe(next_x, next_y, sol)) {\n sol[next_x][next_y] = movei;\n solveKTUtil(next_x, next_y, movei + 1,\n sol, xMove, yMove, result);\n \n sol[next_x][next_y] = -1;// backtracking\n }\n }\n\n \n }",
"static int cntDisPairs(int arr[], int N, int K) {\n\t\t// Stores count of distinct pairs\n\t\t// whose sum equal to K\n\t\tint cntPairs = 0;\n\n\t\t// Sort the array\n\t\tArrays.sort(arr);\n\n\t\t// Stores index of\n\t\t// the left pointer\n\t\tint i = 0;\n\n\t\t// Stores index of\n\t\t// the right pointer\n\t\tint j = N - 1;\n\n\t\t// Calculate count of distinct\n\t\t// pairs whose sum equal to K\n\t\twhile (i < j) {\n\n\t\t\t// If sum of current pair\n\t\t\t// is equal to K\n\t\t\tif (arr[i] + arr[j] == K) {\n\n\t\t\t\t// Remove consecutive duplicate\n\t\t\t\t// array elements\n\t\t\t\twhile (i < j && arr[i] == arr[i + 1]) {\n\n\t\t\t\t\t// Update i\n\t\t\t\t\ti++;\n\t\t\t\t}\n\n\t\t\t\t// Remove consecutive duplicate\n\t\t\t\t// array elements\n\t\t\t\twhile (i < j && arr[j] == arr[j - 1]) {\n\n\t\t\t\t\t// Update j\n\t\t\t\t\tj--;\n\t\t\t\t}\n\n\t\t\t\t// Update cntPairs\n\t\t\t\tcntPairs += 1;\n\n\t\t\t\t// Update i\n\t\t\t\ti++;\n\n\t\t\t\t// Update j\n\t\t\t\tj--;\n\t\t\t}\n\n\t\t\t// if sum of current pair\n\t\t\t// less than K\n\t\t\telse if (arr[i] + arr[j] < K) {\n\n\t\t\t\t// Update i\n\t\t\t\ti++;\n\t\t\t} else {\n\n\t\t\t\t// Update j\n\t\t\t\tj--;\n\t\t\t}\n\t\t}\n\t\treturn cntPairs;\n\t}",
"private boolean canPartitionDP(int[] array, int sum) {\n int len = array.length;\n boolean[][] dp = new boolean[len + 1][sum + 1];\n\n for (int i = 0; i < len + 1; i++) dp[i][0] = true;\n\n for (int i = 1; i < len + 1; i++) {\n for (int j = 1; j < sum + 1; j++) {\n if (array[i - 1] <= j) dp[i][j] = dp[i - 1][j] || dp[i - 1][j - array[i - 1]];\n else dp[i][j] = dp[i - 1][j];\n }\n }\n\n return dp[len][sum];\n }",
"public static void main(String[] args) throws IOException {\n\t\tBufferedReader br= new BufferedReader(new InputStreamReader (System.in));\n\t\tBufferedWriter bw= new BufferedWriter(new OutputStreamWriter(System.out));\n\t\tString[] str;\n\t\tstr=br.readLine().split(\" \");\n\t\tint n=Integer.parseInt(str[0]);\n\t\tint m=Integer.parseInt(str[1]);\n\t\tint[][] num=new int[n][n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tstr=br.readLine().split(\" \");\n\t\t\tfor(int j=0;j<n;j++) {num[i][j]=Integer.parseInt(str[j]);}\n\t\t}\n\t\tint [][] loc=new int[4][m];\n\t\tfor(int i=0;i<m;i++) {\n\t\t\tstr=br.readLine().split(\" \");\n\t\t\tloc[0][i]=Integer.parseInt(str[0])-1;\n\t\t\tloc[1][i]=Integer.parseInt(str[1])-1;\n\t\t\tloc[2][i]=Integer.parseInt(str[2])-1;\n\t\t\tloc[3][i]=Integer.parseInt(str[3])-1;\n\t\t}\n\t\tint[][] sumDP=new int[n][n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tfor(int j=0;j<n;j++) {\n\t\t\t\tif(i==0) {\n\t\t\t\t\tif(j==0) sumDP[i][j]=num[i][j];\n\t\t\t\t\telse sumDP[i][j]=num[i][j]+sumDP[i][j-1];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif(j==0) sumDP[i][j]=num[i][j]+sumDP[i-1][j];\n\t\t\t\t\telse{\n\t\t\t\t\t\tsumDP[i][j]=num[i][j]+sumDP[i-1][j]+sumDP[i][j-1]-sumDP[i-1][j-1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<m;i++) {\n\t\t\tint x1=loc[0][i];\n\t\t\tint y1=loc[1][i];\n\t\t\tint x2=loc[2][i];\n\t\t\tint y2=loc[3][i];\n\t\t\tint ans;\n\t\t\tif(x1==0&&y1==0) ans=sumDP[x2][y2];\n\t\t\telse if(x1==0) ans=sumDP[x2][y2]-sumDP[x2][y1-1];\n\t\t\telse if(y1==0) ans=sumDP[x2][y2]-sumDP[x1-1][y2];\n\t\t\telse ans=sumDP[x2][y2]-sumDP[x1-1][y2]-sumDP[x2][y1-1]+sumDP[x1-1][y1-1];\n\t\t\tbw.write(String.valueOf(ans)+\"\\n\");\n\t\t}\n\t\t\n\t\tbr.close();\n\t\tbw.close();\n\t}",
"public static int solution2(int[] A) {\n\n HashMap<Integer, Integer> hm = new HashMap<>();\n\n int n = A.length;\n\n // Finding frequency of each number.\n for (int i = 0; i < n; i++) {\n if (hm.containsKey(A[i]))\n hm.put(A[i], hm.get(A[i]) + 1);\n else\n hm.put(A[i], 1);\n }\n int ans = 0;\n\n // Calculating count of pairs with equal values\n for (Map.Entry<Integer, Integer> it : hm.entrySet()) {\n int count = it.getValue();\n ans += (count * (count - 1)) / 2;\n }\n return ans;\n }",
"public static void sequntailFloydW() {\r\n \t\r\n \t\r\n \t\r\n \r\n //This makes the main matrix d[][] ready\r\n \r\n \r\n //System.out.println(\"Printing... intial matrix\");\r\n \r\n for (int k = 0; k < dim; k++) {\r\n for (int i = 0; i < dim; i++) {\r\n for (int j = 0; j < dim; j++) {\r\n if (d[i][k] == I || d[k][j] == I) {\r\n continue;\r\n } else if (d[i][j] > d[i][k] + d[k][j]) {\r\n d[i][j] = d[i][k] + d[k][j];\r\n }\r\n }\r\n }\r\n //System.out.println(\"sequntial pass \" + (k + 1) + \"/\" + dim);\r\n \r\n //System.out.println();\r\n }\r\n \r\n adjacencyMatrix = d.clone();// reuse adjacencyMatrix as a matrix for comparison with parallel execution, and clone as d[][] \r\n \t\t\t\t\t\t\t\r\n \r\n \r\n //print(adjacencyMatrix);\r\n }"
] | [
"0.6467575",
"0.634383",
"0.62800395",
"0.6208486",
"0.6199294",
"0.61530954",
"0.61524606",
"0.6143202",
"0.60714936",
"0.60695875",
"0.60619277",
"0.6020264",
"0.5947631",
"0.59435856",
"0.5876857",
"0.5875153",
"0.5785866",
"0.5749918",
"0.5748085",
"0.5741712",
"0.57348716",
"0.5716826",
"0.5701261",
"0.5676044",
"0.56628",
"0.56478477",
"0.56469774",
"0.56458855",
"0.56412154",
"0.56383216",
"0.5634675",
"0.56133527",
"0.5606218",
"0.5601628",
"0.5587338",
"0.5582002",
"0.5573681",
"0.55713934",
"0.55680877",
"0.5559215",
"0.55277574",
"0.55140126",
"0.55127996",
"0.5510022",
"0.55059785",
"0.5492876",
"0.54831004",
"0.54807234",
"0.54779255",
"0.54705906",
"0.5467795",
"0.54587734",
"0.54553586",
"0.54415745",
"0.5432141",
"0.54292434",
"0.5413743",
"0.54134446",
"0.54104304",
"0.5406253",
"0.5405858",
"0.54013985",
"0.53984016",
"0.5396967",
"0.53954196",
"0.5391702",
"0.53808504",
"0.53614694",
"0.53601325",
"0.5353962",
"0.5342146",
"0.53309953",
"0.5328366",
"0.5326159",
"0.5322414",
"0.53112584",
"0.5309626",
"0.5306035",
"0.5300556",
"0.5294617",
"0.52838707",
"0.52824765",
"0.52796865",
"0.52796865",
"0.5276911",
"0.5274571",
"0.52742815",
"0.52727306",
"0.52724534",
"0.52666956",
"0.52621526",
"0.5260403",
"0.52570826",
"0.52570003",
"0.5253267",
"0.52490646",
"0.52488506",
"0.52474725",
"0.5244559",
"0.5244367",
"0.52436775"
] | 0.0 | -1 |
2, 2D dp, O(N^3 logN) time, use treeset to find left boundary each floor | public int maxSumSubmatrix(int[][] matrix, int k) {
int res=Integer.MIN_VALUE;
int rows=matrix.length, cols=matrix[0].length;
int[][] areas=new int[rows][cols];
for(int i=0; i<rows; i++){
for(int j=0; j<cols; j++){
int area=matrix[i][j];
if(i>0) area+=areas[i-1][j];
if(j>0) area+=areas[i][j-1];
if(i>0 && j>0) area-=areas[i-1][j-1];
areas[i][j]=area;
}
}
for(int r1=0; r1<rows; r1++){
for(int r2=r1; r2<rows; r2++){
TreeSet<Integer> set=new TreeSet<Integer>();
set.add(0);
for(int c=0; c<cols; c++){
int sec=areas[r2][c];
if(r1>0) sec-= areas[r1-1][c];
Integer ceiling=set.ceiling(sec-k);
if(ceiling!=null)
res=Math.max(res, sec-ceiling);
set.add(sec);
}
}
}
return res;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void wallsAndGates(int[][] rooms) {\n if (rooms.length == 0 || rooms[0].length == 0) {\n return;\n }\n\n int m = rooms.length;\n int n = rooms[0].length;\n\n Queue<int[]> queue = new LinkedList();\n boolean[][] visited = new boolean[m][n];\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n if (rooms[i][j] == 0) {\n queue.add(new int[] {i, j});\n }\n }\n }\n\n int level = 1;\n while (!queue.isEmpty()) {\n int size = queue.size();\n for (int i = 0; i < size; i++) {\n int[] cur = queue.poll();\n int currow = cur[0];\n int curcol = cur[1];\n\n int row;\n int col;\n\n //up\n row = currow-1;\n col = curcol;\n if (row >= 0) {\n if (rooms[row][col] == Integer.MAX_VALUE && !visited[row][col]) {\n visited[row][col] = true;\n rooms[row][col] = level;\n queue.add(new int[] {row, col});\n }\n }\n\n //down\n row = currow+1;\n if (row < m) {\n if (rooms[row][col] == Integer.MAX_VALUE && !visited[row][col]) {\n visited[row][col] = true;\n rooms[row][col] = level;\n queue.add(new int[] {row, col});\n }\n }\n\n //left\n row = currow;\n col = curcol-1;\n if (col >= 0) {\n if (rooms[row][col] == Integer.MAX_VALUE && !visited[row][col]) {\n visited[row][col] = true;\n rooms[row][col] = level;\n queue.add(new int[] {row, col});\n }\n }\n\n //right\n row = currow;\n col = curcol + 1;\n if (col < n) {\n if (rooms[row][col] == Integer.MAX_VALUE && !visited[row][col]) {\n visited[row][col] = true;\n rooms[row][col] = level;\n queue.add(new int[] {row, col});\n }\n }\n }\n level++;\n }\n\n }",
"static long gridlandMetro(long n, int m, int k, int[][] track) {\n Map<Integer, Stack<int[]>> map = new HashMap<>();\n for (int i = 0; i < k; i++) {\n int r = track[i][0];\n int c1 = track[i][1];\n int c2 = track[i][2];\n Stack<int[]> stack = map.get(r);\n if (stack == null) {\n stack = new Stack<>();\n stack.push(new int[] { c1, c2 });\n map.put(r, stack);\n } else {\n int[] c = stack.peek();\n if (c[1] >= c1)\n c[1] = Math.max(c[1], c2);\n else\n stack.push(new int[] { c1, c2 });\n }\n }\n return (long) n * m - map.values().stream().flatMap(Collection::stream).mapToLong(c -> c[1] - c[0] + 1).sum();\n}",
"public void buildInitialBand()\r\n\t{\n\t\r\n\tint bl = boundary.size();\r\n\tfor(int i=0; i<bl; i++) \r\n\t\t{\r\n\t\tInt2d bCur = boundary.get(i);\r\n\t\t//System.out.println(bCur.x + \", \" + bCur.y + \": size = \" + heap.size());\r\n\t\t\r\n\t\ttestPointsAround(bCur.x,bCur.y);\r\n\t\t}\r\n\t\r\n\t}",
"private int count1D(SearchContext ctx) {\n\t\tfinal SearchNode curNode = ctx.current();\n\n\t\tfinal int last1d = Integer.numberOfLeadingZeros(~curNode.contained);\n\t\tWaveletMatrix wm = zoWM[last1d];\n\t\tfinal WMNode wmNode = curNode.wmNodes[last1d];\n\t\tfinal int lv = wmNode.level;\n\t\tfinal int start = wmNode.start;\n\t\tfinal int end = start + curNode.width;\n\n\t\t// query range\n\t\tfinal int qmin = ctx.qmins[last1d];\n\t\tfinal int qmax = ctx.qmaxs[last1d];\n\n\t\t// path range (possible range of WaveletMatrix node)\n\t\tfinal int pmin = wmNode.path;\n\t\tfinal int pmax = pmin | ((1 << (lv+1)) - 1);\n\n\t\t// relation of query range and path range intersection\n\t\t// [qmin , qmax] query range\n\t\t// [pmin,pmax] path range contain minimum of query range\n\t\t// [pmin,pmax] path range contain maximum of query range\n\t\t// [pmin , pmax] path range fully contain query range\n\n\t\tif (pmax <= qmax) {\n\t\t\treturn end - start - little1D(lv, start, end, qmin, wm);\n\t\t}\n\t\telse if (qmin <= pmin) {\n\t\t\treturn little1D(lv, start, end, qmax + 1, wm);\n\t\t}\n\t\telse {\n\t\t\treturn little1D(lv, start, end, qmax + 1, wm) - little1D(lv, start, end, qmin, wm);\n\t\t}\n\t}",
"public static long solve(long[] data, long k) {\n int n = data.length;\n\n Buffer<Interval> buffer = new Buffer<>(Interval::new, x -> {}, n * 2);\n\n Randomized.shuffle(data);\n Arrays.sort(data);\n\n List<Interval> lastLevel = new ArrayList<>(n);\n List<Interval> curLevel = new ArrayList<>(n);\n lastLevel.add(newInterval(buffer, 0, n - 1));\n int level = Log2.floorLog(data[n - 1]);\n long mask = 0;\n for (; level >= 0; level--) {\n curLevel.clear();\n for (Interval interval : lastLevel) {\n int l = interval.l;\n int r = interval.r;\n int m = r;\n while (m >= l && Bits.get(data[m], level) == 1) {\n m--;\n }\n interval.m = m;\n }\n long total = 0;\n for (Interval interval : lastLevel) {\n total += (long) (interval.m - interval.l + 1) * (interval.relative.m - interval.relative.l + 1);\n total += (long) (interval.r - interval.m) * (interval.relative.r - interval.relative.m);\n }\n if (total < k) {\n k -= total;\n mask = Bits.set(mask, level, true);\n for (Interval interval : lastLevel) {\n if (interval.relative == interval) {\n if (interval.l <= interval.m && interval.m < interval.r) {\n Interval a = newInterval(buffer, interval.l, interval.m);\n Interval b = newInterval(buffer, interval.m + 1, interval.r);\n a.relative = b;\n b.relative = a;\n curLevel.add(a);\n curLevel.add(b);\n }\n } else if (interval.r >= interval.relative.r) {\n if (interval.l <= interval.m && interval.relative.r > interval.relative.m) {\n Interval a = newInterval(buffer, interval.l, interval.m);\n Interval b = newInterval(buffer, interval.relative.m + 1, interval.relative.r);\n a.relative = b;\n b.relative = a;\n curLevel.add(a);\n curLevel.add(b);\n }\n if (interval.m < interval.r && interval.relative.m >= interval.relative.l) {\n Interval a = newInterval(buffer, interval.m + 1, interval.r);\n Interval b = newInterval(buffer, interval.relative.l, interval.relative.m);\n a.relative = b;\n b.relative = a;\n curLevel.add(a);\n curLevel.add(b);\n }\n }\n }\n } else {\n for (Interval interval : lastLevel) {\n if (interval.relative == interval) {\n if (interval.l <= interval.m) {\n Interval a = newInterval(buffer, interval.l, interval.m);\n a.relative = a;\n curLevel.add(a);\n }\n if (interval.m < interval.r) {\n Interval a = newInterval(buffer, interval.m + 1, interval.r);\n a.relative = a;\n curLevel.add(a);\n }\n } else if (interval.r >= interval.relative.r) {\n if (interval.l <= interval.m && interval.relative.l <= interval.relative.m) {\n Interval a = newInterval(buffer, interval.l, interval.m);\n Interval b = newInterval(buffer, interval.relative.l, interval.relative.m);\n a.relative = b;\n b.relative = a;\n curLevel.add(a);\n curLevel.add(b);\n }\n if (interval.m < interval.r && interval.relative.m < interval.relative.r) {\n Interval a = newInterval(buffer, interval.m + 1, interval.r);\n Interval b = newInterval(buffer, interval.relative.m + 1, interval.relative.r);\n a.relative = b;\n b.relative = a;\n curLevel.add(a);\n curLevel.add(b);\n }\n }\n }\n }\n\n for (Interval interval : lastLevel) {\n buffer.release(interval);\n }\n\n List<Interval> tmp = curLevel;\n curLevel = lastLevel;\n lastLevel = tmp;\n }\n\n return mask;\n }",
"public void seekWalls() {\n\t\t for (int j=0; j<visited[0].length; j++){\n\t\t\tfor (int i=visited.length-1; i>=0; i--) {\t\t\t\n\t\t\t\tif (i!=0 && j!= visited[0].length-1) {//general position\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i-1][j]) == maxComb && !isFree(i,j,2)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'N';\n\t\t\t\t\t\treturn;//not break!!!!! return to exit !\n\t\t\t\t\t}\n\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i][j+1]) == maxComb && !isFree(i,j,4)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'E';\t\n\t\t\t\t\t\treturn;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if (i==0 && j!= visited[0].length-1) {\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i][j+1]) == maxComb && !isFree(i,j,4)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'E';\t\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse if (i!=0 && j== visited[0].length-1) {\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i-1][j]) == maxComb && !isFree(i,j,2)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'N';\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\telse {//if (i==0 && j== visited[0].length-1) {\n\t\t\t\t\t//no solution\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private Point[] d(Point[] left, Point[] right){\n\t\tif(left == null | right == null){\r\n\t\t\tif(left == null)\r\n\t\t\t\treturn right;\r\n\t\t\telse\r\n\t\t\t\treturn left;\r\n\t\t}\r\n\r\n\t\tdouble dLeft = Math.sqrt(Math.pow(left[0].getX()-left[1].getX(), 2) + Math.pow(left[0].getY()-left[1].getY(), 2));\r\n\t\tdouble dRight = Math.sqrt(Math.pow(right[0].getX()-right[1].getX(), 2) + Math.pow(right[0].getY()-right[1].getY(), 2));\r\n\t\t\r\n\t\tdouble minD = Math.min(dLeft, dRight);\r\n\t\tif(dLeft == minD)\r\n\t\t\treturn left;\r\n\t\telse \r\n\t\t\treturn right;\r\n\t}",
"public void wallsAndGates(int[][] rooms) {\n if (rooms == null || rooms.length == 0 || rooms[0] == null || rooms[0].length == 0)\n return;\n\n Queue<int[]> queue = new LinkedList<>();\n\n for (int i = 0; i < rooms.length; i++) {\n for (int j = 0; j < rooms[0].length; j++) {\n if (rooms[i][j] == 0)\n queue.add(new int[]{i,j});\n }\n }\n\n while (!queue.isEmpty()) {\n int[] top = queue.remove();\n int row = top[0];\n int col = top[1];\n if (row > 0 && rooms[row - 1][col] == Integer.MAX_VALUE) {\n rooms[row - 1][col] = rooms[row][col] + 1;\n queue.add(new int[]{row - 1, col});\n }\n if (row < rooms.length - 1 && rooms[row + 1][col] == Integer.MAX_VALUE) {\n rooms[row+1][col] = rooms[row][col] + 1;\n queue.add(new int[]{row + 1, col});\n }\n if (col > 0 && rooms[row][col - 1] == Integer.MAX_VALUE){\n rooms[row][col -1] = rooms[row][col] + 1;\n queue.add(new int[]{row, col - 1});\n }\n if (col < rooms[0].length - 1 && rooms[row][col + 1] == Integer.MAX_VALUE) {\n rooms[row][col +1] = rooms[row][col] + 1;\n queue.add(new int[]{row, col + 1});\n }\n }\n\n }",
"private Set<Cell> findShortestRoad(Set<Cell> b, Land land) {\n\t\tfor (Cell cell : b) {\n\t\t\tif (isNextToRoad(cell.i, cell.j, land))\n\t\t\t\treturn new HashSet<Cell>();\n\t\t}\n\t\t\n\t\tSet<Cell> output = new HashSet<Cell>();\n\t\tboolean[][] checked = new boolean[land.side][land.side];\n\t\tQueue<Cell> queue = new LinkedList<Cell>();\n\t\t// add border cells that don't have a road currently\n\t\t// dummy cell to serve as road connector to perimeter cells\n\t\tCell source = new Cell(Integer.MAX_VALUE, Integer.MAX_VALUE);\n\t\tfor (int z = 0; z < land.side; z++) {\n\t\t\tif (b.contains(new Cell(0, z)) || b.contains(new Cell(z, 0)) || b.contains(new Cell(land.side - 1, z))\n\t\t\t\t\t|| b.contains(new Cell(z, land.side - 1)))\n\t\t\t\treturn output;\n\t\t\tif (land.unoccupied(0, z))\n\t\t\t\tqueue.add(new Cell(0, z, source));\n\t\t\tif (land.unoccupied(z, 0))\n\t\t\t\tqueue.add(new Cell(z, 0, source));\n\t\t\tif (land.unoccupied(z, land.side - 1))\n\t\t\t\tqueue.add(new Cell(z, land.side - 1, source));\n\t\t\tif (land.unoccupied(land.side - 1, z))\n\t\t\t\tqueue.add(new Cell(land.side - 1, z, source));\n\t\t}\n\t\t// add cells adjacent to current road cells\n\t\tfor (Cell p : road_cells) {\n\t\t\tfor (Cell q : p.neighbors()) {\n\t\t\t\tif (!road_cells.contains(q) && land.unoccupied(q) && !b.contains(q))\n\t\t\t\t\tqueue.add(new Cell(q.i, q.j, p)); // use tail field of cell\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// to keep track of\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// previous road cell\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// during the search\n\t\t\t}\n\t\t}\n\t\twhile (!queue.isEmpty()) {\n\t\t\tCell p = queue.remove();\n\t\t\tchecked[p.i][p.j] = true;\n\t\t\tfor (Cell x : p.neighbors()) {\n\t\t\t\tif (b.contains(x)) { // trace back through search tree to find\n\t\t\t\t\t\t\t\t\t\t// path\n\t\t\t\t\tCell tail = p;\n\t\t\t\t\twhile (!b.contains(tail) && !road_cells.contains(tail) && !tail.equals(source)) {\n\t\t\t\t\t\toutput.add(new Cell(tail.i, tail.j));\n\t\t\t\t\t\ttail = tail.previous;\n\t\t\t\t\t}\n\t\t\t\t\tif (!output.isEmpty())\n\t\t\t\t\t\treturn output;\n\t\t\t\t} else if (!checked[x.i][x.j] && land.unoccupied(x.i, x.j)) {\n\t\t\t\t\tx.previous = p;\n\t\t\t\t\tqueue.add(x);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\tif (output.isEmpty() && queue.isEmpty())\n\t\t\treturn null;\n\t\telse\n\t\t\treturn output;\n\t}",
"public void wallsAndGates(int[][] rooms) {\n if (rooms.length == 0 || rooms[0].length == 0) return;\n Queue<int[]> queue = new LinkedList<>();\n for (int i = 0; i < rooms.length; i++) {\n for (int j = 0; j < rooms[0].length; j++) {\n if (rooms[i][j] == 0) queue.add(new int[]{i, j});\n }\n }\n while (!queue.isEmpty()) {\n int[] top = queue.remove();\n int row = top[0], col = top[1];\n if (row > 0 && rooms[row - 1][col] == Integer.MAX_VALUE) {\n rooms[row - 1][col] = rooms[row][col] + 1;\n queue.add(new int[]{row - 1, col});\n }\n if (row < rooms.length - 1 && rooms[row + 1][col] == Integer.MAX_VALUE) {\n rooms[row + 1][col] = rooms[row][col] + 1;\n queue.add(new int[]{row + 1, col});\n }\n if (col > 0 && rooms[row][col - 1] == Integer.MAX_VALUE) {\n rooms[row][col - 1] = rooms[row][col] + 1;\n queue.add(new int[]{row, col - 1});\n }\n if (col < rooms[0].length - 1 && rooms[row][col + 1] == Integer.MAX_VALUE) {\n rooms[row][col + 1] = rooms[row][col] + 1;\n queue.add(new int[]{row, col + 1});\n }\n }\n }",
"public static void test(String args[]) {\n int[][] input = {{1,1,1,1,1,1,1,0},{1,0,0,0,0,1,1,0},{1,0,1,0,1,1,1,0},{1,0,0,0,0,1,0,1},{1,1,1,1,1,1,1,0}};\n int[][] input2 = {{0,0,1,0,0},{0,1,0,1,0},{0,1,1,1,0}};\n int[][] input3 = {{1,1,1,1,1,1,1},\n {1,0,0,0,0,0,1},\n {1,0,1,1,1,0,1},\n {1,0,1,0,1,0,1},\n {1,0,1,1,1,0,1},\n {1,0,0,0,0,0,1},\n {1,1,1,1,1,1,1}};\n System.out.println(closedIsland(input));\n System.out.println(closedIsland(input2));\n System.out.println(closedIsland(input3));\n }",
"public ArrayList<ArrayList<Integer>> buildingOutline(int[][] buildings) {\n ArrayList<ArrayList<Integer>> rst = new ArrayList<>();\n if(buildings==null || buildings.length==0){\n return rst;\n }\n\n ArrayList<Edge> edges = new ArrayList<>();\n PriorityQueue<Integer> heights = new PriorityQueue<>(10, Collections.reverseOrder());\n for(int[] one : buildings){\n edges.add(new Edge(one[0],true,one[2]));\n edges.add(new Edge(one[1],false,one[2]));\n }\n //shit stupid question\n Collections.sort(edges, new Comparator<Edge>(){\n public int compare(Edge b1, Edge b2){\n if(b1.x!=b2.x){\n return b1.x - b2.x;\n } else if(b1.isStart && b2.isStart){\n return b2.h - b1.h;\n } else if(!b1.isStart && !b2.isStart){\n return b1.h - b2.h;\n } else if(b1.isStart){\n return -1;\n } return 1;\n\n }\n });\n\n ArrayList<Integer> otl = new ArrayList<>();\n for(Edge e : edges){\n if(otl.size()==0){\n heights.add(e.h);\n otl.add(e.x);\n continue;\n }\n if(e.isStart==true){\n\n int hi = heights.peek();\n\n heights.add(e.h);\n if(e.h>hi){\n otl.add(e.x);\n otl.add(hi);\n rst.add(otl);\n otl = new ArrayList<>();\n otl.add(e.x);\n }\n }else{\n heights.remove(e.h);\n if(heights.size()==0){\n otl.add(e.x);\n otl.add(e.h);\n rst.add(otl);\n otl = new ArrayList<>();\n continue;\n }\n int hi = heights.peek();\n\n if(e.h>hi){\n otl.add(e.x);\n otl.add(e.h);\n rst.add(otl);\n otl = new ArrayList<>();\n otl.add(e.x);\n }\n }\n\n }\n return rst;\n }",
"private void buildTree(int nodeNum, AABB nodeBounds,\n ArrayList<AABB> allPrimBounds,\n IntArray primNums, int nPrims, int depth,\n int badRefines) {\n if (nPrims <= maxPrims || depth == 0) {\n if ((nPrims > 16) && (depth == 0)) {\n System.out.println(\"reached max. KdTree depth with \" + nPrims + \n \" primitives\");\n }\n \n nodesW.add(makeLeaf(primNums, nPrims, primitives));\n totalPrims += nPrims;\n totalDepth += (maxDepth - depth);\n totalLeafs += 1;\n return;\n }\n \n /* Split - Position bestimmen */\n \n int bestAxis = -1, bestOffset = -1;\n float bestCost = Float.POSITIVE_INFINITY;\n float oldCost = isectCost * (float)nPrims;\n Vector d = nodeBounds.max.sub(nodeBounds.min);\n float totalSA = (2.f * (d.x*d.y + d.x*d.z + d.y*d.z));\n float invTotalSA = 1.f / totalSA;\n \n /* Achse wählen */\n int axis = d.dominantAxis();\n int retries = 0;\n boolean retry = false;\n ArrayList<BoundEdge> edges = null;\n \n// final int splitCount = edges[axis].length;\n \n do {\n edges = mkEdges(allPrimBounds, primNums, axis);\n Collections.sort(edges);\n final int splitCount = edges.size();\n \n// java.util.Arrays.sort(edges[axis], 0, splitCount);\n \n /* beste Split - Position für diese Achse finden */\n int nBelow = 0, nAbove = nPrims;\n \n for (int i = 0; i < splitCount; ++i) {\n if (edges.get(i).type == EdgeType.END) --nAbove;\n float edget = edges.get(i).t;\n \n if (edget > nodeBounds.min.get(axis) &&\n edget < nodeBounds.max.get(axis)) {\n // Compute cost for split at _i_th edge\n int otherAxis[][] = { {1,2}, {0,2}, {0,1} };\n int otherAxis0 = otherAxis[axis][0];\n int otherAxis1 = otherAxis[axis][1];\n \n float belowSA = 2 * (d.get(otherAxis0) * d.get(otherAxis1) +\n (edget - nodeBounds.min.get(axis)) *\n (d.get(otherAxis0) + d.get(otherAxis1)));\n \n float aboveSA = 2 * (d.get(otherAxis0) * d.get(otherAxis1) +\n (nodeBounds.max.get(axis) - edget) *\n (d.get(otherAxis0) + d.get(otherAxis1)));\n \n float pBelow = belowSA * invTotalSA;\n float pAbove = aboveSA * invTotalSA;\n \n float eb = (nAbove == 0 || nBelow == 0) ? emptyBonus : 0.f;\n float cost = traversalCost + isectCost * (1.f - eb) *\n (pBelow * nBelow + pAbove * nAbove);\n \n if (cost < bestCost) {\n /* neuer bester gefunden */\n bestCost = cost;\n bestAxis = axis;\n bestOffset = i;\n }\n }\n \n if (edges.get(i).type == EdgeType.START) ++nBelow;\n }\n \n if (!(nBelow == nPrims && nAbove == 0))\n throw new IllegalStateException(\"hmm\");\n \n retry = ((bestAxis == -1) && (retries < 2));\n \n if (retry) {\n ++retries;\n axis = (axis+1) % 3;\n }\n \n } while (retry);\n \n if (bestCost > oldCost) ++badRefines;\n if ((bestCost > 4.f * oldCost && nPrims < 16) ||\n bestAxis == -1 || badRefines == 3) {\n nodesW.add(makeLeaf(primNums, nPrims, primitives));\n if (nPrims > 16)\n System.out.println(\"aborting KdTree build recursion (bc=\" +\n bestCost + \", oc=\" + oldCost + \", #prims=\" + \n nPrims + \", br=\" + badRefines + \")\");\n totalPrims += nPrims;\n totalDepth += (maxDepth - depth);\n totalLeafs += 1;\n return;\n }\n \n /* Primitive nach oben / unten sortieren */\n int n0 = 0, n1 = 0;\n \n final ArrayList<Integer> prims0Tmp = new ArrayList<Integer>();\n final ArrayList<Integer> prims1Tmp = new ArrayList<Integer>();\n \n for (int i = 0; i < bestOffset; ++i) {\n if (edges.get(i).type == EdgeType.START) {\n prims0Tmp.add(edges.get(n0++).primNum);\n// prims0.set(n0++, edges[bestAxis][i].primNum);\n }\n }\n \n for (int i = bestOffset + 1; i < edges.size(); ++i) {\n if (edges.get(i).type == EdgeType.END) {\n prims1Tmp.add(edges.get(n1++).primNum);\n// prims1.set(n1++, edges[bestAxis][i].primNum);\n }\n }\n \n /* rekursiver Abstieg */\n float tsplit = edges.get(bestOffset).t;\n \n nodesW.add(makeInterior(bestAxis, tsplit));\n \n AABB bounds[] = nodeBounds.split(tsplit, bestAxis);\n \n final IntArray prims0 = new IntArray(prims0Tmp.size());\n for (int i=0; i < prims0Tmp.size(); i++) {\n prims0.set(i, prims0Tmp.get(i));\n }\n \n final IntArray prims1 = new IntArray(prims1Tmp.size());\n for (int i=0; i < prims1Tmp.size(); i++) {\n prims1.set(i, prims1Tmp.get(i));\n }\n \n buildTree(nodeNum+1, bounds[0], allPrimBounds,\n prims0, n0, depth-1, badRefines);\n \n nodesW.get(nodeNum).setAboveChild(nodesW.size());\n \n buildTree(nodesW.size(), bounds[1], allPrimBounds,\n prims1, n1, depth-1, badRefines);\n }",
"public void reinitiallizeDistanceFunctionInside() {\n\t\tint i, j;\r\n\t\tfor (i = 0; i < _levelSet.length; i++) {\r\n\t\t\tfor (j = 0; j < _levelSet[i].length; j++) {\r\n\t\t\t\tint iPlus = imposeBorder(i + 1, _iSize);\r\n\t\t\t\tint iMinus = imposeBorder(i - 1, _iSize);\r\n\t\t\t\tint jPlus = imposeBorder(j + 1, _iSize);\r\n\t\t\t\tint jMinus = imposeBorder(j - 1, _iSize);\r\n\t\t\t\tif (_levelSet[i][j] <= 0) // // the check for points in region\r\n\t\t\t\t\t// // the check for points in border\r\n\t\t\t\t\tif (MatrixMath.anyNeighborIsOutside(_levelSet, i, j, iPlus,\r\n\t\t\t\t\t\t\tiMinus, jPlus, jMinus)) {\r\n\t\t\t\t\t\t// points in border are placed in narrowband\r\n\t\t\t\t\t\t// _narrowBandInside.add(new Location(i, j));\r\n\t\t\t\t\t\t_narrowBandInside.add(new Location(i, j));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// and location in distance matrix is set to infinite\r\n\t\t\t\t\t\t_levelSet[i][j] = Double.NEGATIVE_INFINITY;\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// iterate until narrow band is empty\r\n\t\t// OrderByLevelSetValue comparator = new OrderByLevelSetValue();\r\n\t\t// while (_narrowBandInside.size() > 0) {\r\n\t\twhile (_narrowBandInside.size() > 0) {\r\n\t\t\t// get the maximum value\r\n\t\t\t// Location maxVal = _narrowBandInside.last();\r\n\t\t\tLocation maxVal = _narrowBandInside.last();\r\n\t\t\t// System.out.println(\"maxVal \" + maxVal);\r\n\t\t\t// System.out.println(\"_narrowBandInside.contains(maxVal) \"\r\n\t\t\t// + _narrowBandInside.contains(maxVal));\r\n\t\t\t// System.out.println(\"maxVal.compareTo(maxVal) \"\r\n\t\t\t// + maxVal.compareTo(maxVal));\r\n\r\n\t\t\t// get the neighbors that are still in _faraway\r\n\t\t\tint iPlus = imposeBorder(maxVal.i + 1, _iSize);\r\n\t\t\tint iMinus = imposeBorder(maxVal.i - 1, _iSize);\r\n\t\t\tint jPlus = imposeBorder(maxVal.j + 1, _iSize);\r\n\t\t\tint jMinus = imposeBorder(maxVal.j - 1, _iSize);\r\n\t\t\ttransferNeighborInside(iPlus, maxVal.j);\r\n\t\t\ttransferNeighborInside(iMinus, maxVal.j);\r\n\t\t\ttransferNeighborInside(maxVal.i, jPlus);\r\n\t\t\ttransferNeighborInside(maxVal.i, jMinus);\r\n\t\t\t// remove the value from the narrowband\r\n\t\t\t// _narrowBandInside.remove(maxVal);\r\n\t\t\t_narrowBandInside.remove(maxVal);\r\n\t\t}\r\n\t\t// done\r\n\t}",
"public int chooseRightOrLeftNode(int[][] grayIntegralImage, int[][] squaredGrayIntegralImage, int x, int y, float scale) {\n int w = (int) (scale * size.x);\n int h = (int) (scale * size.y);\n /*\n * Calcola l'inverso dell'area della finestra di coordinate w*h\n */\n double inverseArea = 1. / (w * h);\n /*\n * Sfruttando l'immagine integrale e la sua forma quadratica calcola l'area e \n * l'area quadratica della finestra,\n * senza compiere iterazioni.\n */\n int sum = grayIntegralImage[x + w][y + h] + grayIntegralImage[x][y] - grayIntegralImage[x][y + h] - grayIntegralImage[x + w][y];\n int powSum2 = squaredGrayIntegralImage[x + w][y + h] + squaredGrayIntegralImage[x][y] - squaredGrayIntegralImage[x][y + h] - squaredGrayIntegralImage[x + w][y];\n /* \n * Calcolo la media e la deviazione standard della finestra\n */\n double mean = sum * inverseArea;\n double standardDeviation = powSum2 * inverseArea - mean * mean;\n standardDeviation = (standardDeviation > 1) ? Math.sqrt(standardDeviation) : 1;\n int rectanglesSum = 0;\n for (int n = 0; n < numberOfRectangles; n++) {\n MyRectangle rectangle = rectangles[n];\n /*\n * Scala il rettangolo in base alla grandezza della finestra.\n */\n int rectangleX1 = x + (int) (scale * rectangle.x);\n int rectangleX2 = x + (int) (scale * (rectangle.x + rectangle.width));\n int rectangleY1 = y + (int) (scale * rectangle.y);\n int rectangleY2 = y + (int) (scale * (rectangle.y + rectangle.height));\n MyRectangle scaledRectangle = new MyRectangle(rectangleX1, rectangleY1,\n Math.round(scale * rectangle.width), Math.round(scale * rectangle.height), rectangle.weight);\n scaledRectangles[n] = scaledRectangle;\n /*\n * Calcolo la somma dei pixel nel rettangolo (pesata con il peso del rettangolo).\n */\n rectanglesSum += (int) ((grayIntegralImage[rectangleX1][rectangleY1]\n + grayIntegralImage[rectangleX2][rectangleY2]\n - grayIntegralImage[rectangleX1][rectangleY2]\n - grayIntegralImage[rectangleX2][rectangleY1])\n * rectangle.weight);\n }\n double rectangleSumMultipliesInverseArea = rectanglesSum * inverseArea;\n /*\n * Scelgo il nodo a sinistra o a destra comparando il valore soglia con \n * il valore rectangleSumMultipliesInverseArea.\n */\n return (rectangleSumMultipliesInverseArea < thresholdValue * standardDeviation) ? Tree.LEFT : Tree.RIGHT;\n }",
"int removeObstacle(int numRows, int numColumns, List<List<Integer>> lot)\r\n {\r\n \tint m = 0;\r\n \tint n = 0;\r\n \tfor(List<Integer> rowList: lot) {\r\n \t\tfor(Integer num: rowList) {\r\n \t\t\tif(num == 9 ) {\r\n \t\t\t\tbreak;\r\n \t\t\t}\r\n \t\t\tn++;\r\n \t\t}\r\n \t\tm++;\r\n \t}\r\n \t// to store min cells required to be \r\n // covered to reach a particular cell \r\n int dp[][] = new int[numRows][numColumns]; \r\n \r\n // initially no cells can be reached \r\n for (int i = 0; i < numRows; i++) \r\n for (int j = 0; j < numColumns; j++) \r\n dp[i][j] = Integer.MAX_VALUE; \r\n \r\n // base case \r\n dp[0][0] = 1; \r\n \r\n for (int i = 0; i < lot.size(); i++) {\r\n \tList<Integer> columnList = lot.get(i);\r\n for (int j = 0; j < columnList.size(); j++) { \r\n \r\n // dp[i][j] != INT_MAX denotes that cell \r\n // (i, j) can be reached from cell (0, 0) \r\n // and the other half of the condition \r\n // finds the cell on the right that can \r\n // be reached from (i, j) \r\n if (dp[i][j] != Integer.MAX_VALUE && \r\n (j + columnList.get(j)) < numColumns && (dp[i][j] + 1) \r\n < dp[i][j + columnList.get(j)]\r\n \t\t && columnList.get(j) != 0) \r\n dp[i][j + columnList.get(j)] = dp[i][j] + 1; \r\n \r\n if (dp[i][j] != Integer.MAX_VALUE && \r\n (i + columnList.get(j)) < numRows && (dp[i][j] + 1) \r\n < dp[i + columnList.get(j)][j] && columnList.get(j) != 0) \r\n dp[i + columnList.get(j)][j] = dp[i][j] + 1; \r\n } \r\n } \r\n \r\n if (dp[m - 1][n - 1] != Integer.MAX_VALUE) \r\n return dp[m - 1][n - 1]; \r\n \r\n return -1; \r\n }",
"private boolean rightLeftFull(int i, int j) { // part of isfull1\n if (j != 0 && j != count) { // not edges\n if (id[i][j - 1] == 1 && ic[i][j - 1] != 1 && !targetReached) { // and not marked as old patern in ic a N*N array\n ic[i][j - 1] = 1;\n isFull1(i + 1, j);\n }\n if (id[i][j + 1] == 1 && ic[i][j + 1] != 1 && !targetReached) { // and not marked as old patern in ic a N*N array\n ic[i][j + 1] = 1;\n isFull1(i + 1, j + 2);\n }\n\n } else if (j == 0) { // right site\n if (id[i][j + 1] == 1 && ic[i][j + 1] != 1 && !targetReached) { // and not marked as old patern in ic a N*N array\n ic[i][j + 1] = 1;\n isFull1(i + 1, j + 2);\n }\n\n } else { // left site\n if (id[i][j - 1] == 1 && ic[i][j - 1] != 1 && !targetReached) { // and not marked as old patern in ic a N*N array\n ic[i][j - 1] = 1;\n isFull1(i + 1, j);\n }\n }\n\n\n return false;\n }",
"private Point[] nearestPairRec(Point[] range, boolean axis) {\n\t\t\tPoint[] Answer = new Point[2];\n\t\t\tif (range.length < 4) return nearestPair3Points(range);\n\t\t\tPoint[] MinPointsLeft = new Point[2];\n\t\t\tPoint[] MinPointsRight = new Point[2];\n\t\t\tPoint[] MinPointsInStrip = new Point[2];\n\t\t\tdouble MinDistance = -1; //it will be change for sure, because we pass the array only if it containes 4 points and above.\n\t\t\tdouble MinDistanceInStrip;\n\t\t\t//step 4\n\t\t\tif (axis){\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(range[0].getX(), range[(range.length)/2].getX(), axis), axis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(range[((range.length)/2)+1].getX(), range[range.length-1].getX() ,axis), axis);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(range[0].getY(), range[(range.length)/2].getY(), axis), axis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(range[((range.length)/2)+1].getY(), range[range.length-1].getY() ,axis), axis);\n\t\t\t}\n\t\t\t//step 5\n\t\t\tif (MinPointsLeft!=null && MinPointsRight!=null){\n\t\t\t\tif (Distance(MinPointsLeft[0], MinPointsLeft[1]) > Distance(MinPointsRight[0], MinPointsRight[1])){\n\t\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\t\tAnswer = MinPointsRight;\n\t\t\t\t}else{\n\t\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t\t}\n\t\t\t}else if (MinPointsLeft!=null && MinPointsRight==null) {\n\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t}else if (MinPointsRight!=null && MinPointsLeft==null){\n\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\tAnswer = MinPointsRight;\n\t\t\t}\n\t\t\t//step 6 find the nearest point around the median\n\t\t\tint upper;\n\t\t\tint lower;\n\t\t\tif (MinDistance==-1) MinDistance = 0;\n\t\t\tif (axis){\n\t\t\t\tupper = (int) (range[(range.length)/2].getX()+MinDistance);\n\t\t\t\tlower = (int) (range[(range.length)/2].getX()-MinDistance);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tupper = (int) (range[(range.length)/2].getY()+MinDistance);\n\t\t\t\tlower = (int) (range[(range.length)/2].getY()-MinDistance);\n\t\t\t}\n\t\t\trange = getPointsInRangeOppAxis(lower, upper, axis);\n\t\t\tif (range.length>=2) MinPointsInStrip = nearestPointInArray(range);\n\t\t\tif (MinPointsInStrip[0]!=null){\n\t\t\t\tMinDistanceInStrip = Distance(MinPointsInStrip[0], MinPointsInStrip[1]);\n\t\t\t\tif (MinDistanceInStrip < MinDistance) return MinPointsInStrip;\n\t\t\t}\n\t\t\treturn Answer;\n\t\t}",
"boolean splitAndInsert(T t, Pair<String,LeafNode> ln){\n\n int splitTimes=0;\n\n Interval[] intervals = ln.second().getIntervals();\n assert intervals.length==leafNodeCapacity;\n Interval[] leftIntervals = new Interval[leafNodeCapacity];\n Interval[] rightIntervals = new Interval[leafNodeCapacity];\n Interval[] tempIntervals = null;\n\n int leftIntervalNumber=0;\n int rightIntervalNumber=0;\n TriangleShape lnTriangle = ln.second().triangle;\n String lnString=ln.first();\n TriangleShape leftTriangle=null;\n TriangleShape rightTriangle=null;\n String leftString=null;\n String rightString =null;\n\n while(leftIntervalNumber==0 || rightIntervalNumber==0){\n\n if(splitTimes==10000) {\n System.out.println(\"splitTimes=\"+splitTimes);\n System.out.println(\"you should increase the parameter leafNodeCapaity value!!!\");\n assert false;\n }\n else\n splitTimes++;\n\n leftTriangle=lnTriangle.leftTriangle();\n leftIntervalNumber=0;\n rightIntervalNumber=0;\n\n for(Interval i: intervals){\n if(Geom2DSuits.contains(leftTriangle,i.getLowerBound(),i.getUpperBound())){\n leftIntervals[leftIntervalNumber]=i;\n leftIntervalNumber++;\n }\n else{\n rightIntervals[rightIntervalNumber]=i;\n rightIntervalNumber++;\n }\n }\n\n if(leftIntervalNumber==0){//all located at left side\n rightTriangle = lnTriangle.rightTriangle();\n rightString = lnString+\"1\";\n leftString=lnString+\"0\";\n emptyNodes.add(leftString);\n lnTriangle = rightTriangle;\n lnString=rightString;\n\n tempIntervals=intervals;\n intervals=rightIntervals;\n rightIntervals=tempIntervals;\n }\n else if(rightIntervalNumber==0){//all located at right side\n rightString = lnString+\"1\";\n leftString=lnString+\"0\";\n emptyNodes.add(rightString);\n lnTriangle = leftTriangle;\n lnString=leftString;\n\n tempIntervals=intervals;\n intervals=leftIntervals;\n leftIntervals=tempIntervals;\n }\n else { //spit successfully\n\n leftString=lnString+\"0\";\n LeafNode leftNode = new LeafNode();\n leftNode.intervals=leftIntervals;\n leftNode.size=leftIntervalNumber;\n leftNode.triangle=leftTriangle;\n\n rightString = lnString+\"1\";\n LeafNode rightNode = new LeafNode();\n rightTriangle = lnTriangle.rightTriangle();\n rightNode.triangle=rightTriangle;\n rightNode.size=rightIntervalNumber;\n rightNode.intervals=rightIntervals;\n\n if(leftNode.insert(t)!=1){\n rightNode.insert(t);\n }\n\n Identifier lnPage =leafInfos.remove(ln.first());\n writeNode(leftNode,lnPage);\n Identifier rightPage = CommonSuits.createIdentifier(-1L);\n writeNode(rightNode,rightPage);\n\n leafInfos.put(leftString,lnPage);\n leafInfos.put(rightString,rightPage);\n return true;\n }\n }\n return false;\n }",
"public static int[][] optimalBST2(double[] p,double[] q, int num){\n double[][] e = new double[num+2][num+2];//子树期望代价\n double[][] w = new double[num+2][num+2];//子树总概率\n //why e and w is two bigger than num?\n //because when i==j, e[i][i-1] + e[i+1][j] + w[i][j];\n\n int[][] root = new int[num+1][num+1];//记录根节点\n //root[i][j] -- 用来存放i-j组成的最优二叉查找树的根节点\n\n //init--初始化\n for(int i=1; i<num+2; i++){\n e[i][i-1] = q[i-1];\n w[i][i-1] = q[i-1];\n }\n\n for(int d = 0; d<num; d++){\n //插入个数 : 0 - num-1, 从0开始\n for(int i=1; i<=num-d; i++){\n //起始下标 : 1 - num, 从1开始\n int j = i + d;\n e[i][j] = 9999;\n w[i][j] = w[i][j-1] + p[j] + q[j];//\n\n //because of root[i][j-1] <= root[i][j] <= root[i+1][j]\n //so why?\n //\n //进行优化!!!\n if(i == j){\n root[i][j] = i;\n e[i][j] = e[i][i-1] + e[i+1][i] + w[i][i];\n }else{\n for(int k=root[i][j-1]; k<=root[i+1][j]; k++){\n //中间下标\n double temp = e[i][k-1] + e[k+1][j] + w[i][j];\n if(temp < e[i][j]){\n e[i][j] = temp;\n //找到小的,记录下来\n root[i][j] = k;\n }\n\n }\n }\n }\n }\n return root;\n }",
"public void findUpperAndLowerEdge() throws NoSudokuFoundException{\n int bestUpperHit = 0;\n int bestLowerHit = 0;\n double t = INTERSECT_TOLERANCE;\n for (int h=0; h<nextH; h++) {\n int upperHit = 0;\n int lowerHit = 0;\n // for every horizontal line, check if vertical edge points A and B \n // are on that line.\n double[] hline = horizontalLines[h];\n double hy1 = hline[1],\n hy2 = hline[3];\n for (int v=0; v<nextV; v++){\n double[] vec = verticalLines[v];\n double ay = vec[1],\n by = vec[3];\n // if they are, count them\n if(ay < by) { // A is above B\n if ((hy1<=ay+t && ay<=hy2+t) || (hy1+t>=ay && ay+t>=hy2)){\n // A is between the left and right edge point.\n // only count it if it is above the screen center.\n if(hy1 < centerY && hy2 < centerY) {\n upperHit++;\n }\n } else if ((hy1<=by+t && by<=hy2+t) || (hy1+t>=by && by+t>=hy2)) {\n if(hy1 > centerY && hy2 > centerY) {\n lowerHit++;\n }\n }\n } else { // B is above A\n if ((hy1<=by+t && by<=hy2+t) || (hy1+t>=by && by+t>=hy2)) {\n if(hy1 < centerY && hy2 < centerY) {\n upperHit++;\n }\n } else if ((hy1<=ay+t && ay<=hy2+t) || (hy1+t>=ay && ay+t>=hy2)) {\n if(hy1 > centerY && hy2 > centerY) {\n lowerHit++;\n }\n } \n }\n }\n // take the lines with the highest counts\n if(upperHit > bestUpperHit) {\n edges[0] = horizontalLines[h];\n bestUpperHit = upperHit;\n } else if (lowerHit > bestLowerHit){\n edges[2] = horizontalLines[h];\n bestLowerHit = lowerHit;\n }\n }\n if(bestUpperHit < LINE_THRESHOLD || bestLowerHit < LINE_THRESHOLD){\n throw new NoSudokuFoundException(\"Number of upper (\"+bestUpperHit+\") or lower (\"+bestLowerHit+\") line ends below threshold. h\");\n }\n // Log.v(TAG, \"Best upper hit: \" + bestUpperHit + \", best lower: \" + bestLowerHit);\n }",
"public double minAreaFreeRect(int[][] points) {\n if (points.length < 4) {\n return 0;\n }\n\n //key: info of distance, x,y center positions\n double minVal = Double.MAX_VALUE;\n Map<String, List<int[]>> map = new HashMap<>();\n for (int i = 0; i < points.length - 1; i++) {\n for (int j = i + 1; j < points.length; j++) {\n long dis = (points[i][0] - points[j][0]) * (points[i][0] - points[j][0]) +\n (points[i][1] - points[j][1]) * (points[i][1] - points[j][1]);\n double centerX = (double)(points[i][0] + points[j][0]) / 2;\n double centerY = (double)(points[i][1] + points[j][1]) / 2;\n String key = dis + \" \" + centerX + \" \" + centerY;\n if (!map.containsKey(key)) {\n map.put(key, new ArrayList<int[]>());\n }\n map.get(key).add(new int[]{i,j});\n }\n }\n\n //therefore all vals stored in same key can form rectangles\n //just try all of them to find the one with smallest area\n for (String key: map.keySet()) {\n if (map.get(key).size() < 2) {\n continue;\n }\n List<int[]> values = map.get(key);\n for (int i = 0; i < values.size() - 1; i++) {\n for (int j = i + 1; j < values.size(); j++) {\n int p1 = values.get(i)[0];\n int p2 = values.get(i)[1];\n int p3 = values.get(j)[0];\n\n double len1 = Math.sqrt((points[p1][0] - points[p3][0]) * (points[p1][0] - points[p3][0]) + (points[p1][1] - points[p3][1]) * (points[p1][1] - points[p3][1]));\n double len2 = Math.sqrt((points[p2][0] - points[p3][0]) * (points[p2][0] - points[p3][0]) + (points[p2][1] - points[p3][1]) * (points[p2][1] - points[p3][1]));\n\n minVal = Math.min(minVal, len1 * len2);\n }\n }\n }\n return minVal == Double.MAX_VALUE? 0: minVal;\n\n }",
"public void findLeftAndRightEdge() throws NoSudokuFoundException{\n int bestLeftHit = 0;\n int bestRightHit = 0;\n for (int v=0; v<nextV; v++) {\n int leftHit = 0;\n int rightHit = 0;\n // for every vertical line, check if horizontal edge points A B\n // are on that line.\n double[] vline = verticalLines[v];\n double vx1 = vline[0],\n vx2 = vline[2];\n for (int h=0; h<nextH; h++){\n double[] vec = horizontalLines[h];\n double ax = vec[0],\n bx = vec[2];\n if(ax < bx) { // A is left of B\n if ((vx1<=ax && ax<=vx2) || (vx1>=ax && ax>=vx2)){\n // A is between the upper and lower edge point\n if(vx1 < centerX && vx2 < centerX) {\n leftHit++;\n }\n } else if ((vx1<=bx&& bx<=vx2) || (vx1>=bx && bx>=vx2)){\n if(vx1 > centerX && vx2 > centerX) {\n rightHit++;\n }\n }\n } else {\n if ((vx1<=bx && bx<=vx2) || (vx1>=bx && bx>=vx2)){\n if(vx1 < centerX && vx2 < centerX) {\n leftHit++;\n }\n } else if ((vx1<=ax && ax<=vx2) || (vx1>=ax && ax>=vx2)){\n if(vx1 > centerX && vx2 > centerX) {\n rightHit++;\n }\n }\n }\n }\n // take the lines with the highest counts\n if(leftHit > bestLeftHit) {\n edges[3] = verticalLines[v];\n bestLeftHit = leftHit;\n } else if (rightHit > bestRightHit){\n edges[1] = verticalLines[v];\n bestRightHit = rightHit;\n }\n }\n if(bestLeftHit < LINE_THRESHOLD || bestRightHit < LINE_THRESHOLD){\n throw new NoSudokuFoundException(\"Number of left or right line ends below threshold: L\" + bestLeftHit + \" R\" + bestRightHit);\n }\n Log.v(TAG, \"Best left hit: \" + bestLeftHit + \", best right: \" + bestRightHit);\n }",
"static int m36189a(Rect rect, Set<Rect> set) {\n int i = 0;\n if (set.isEmpty()) {\n return 0;\n }\n ArrayList<Rect> arrayList = new ArrayList<>();\n arrayList.addAll(set);\n Collections.sort(arrayList, new Comparator<Rect>() {\n /* renamed from: a */\n public final int compare(Rect rect, Rect rect2) {\n return Integer.valueOf(rect.top).compareTo(Integer.valueOf(rect2.top));\n }\n });\n ArrayList arrayList2 = new ArrayList();\n for (Rect rect2 : arrayList) {\n arrayList2.add(Integer.valueOf(rect2.left));\n arrayList2.add(Integer.valueOf(rect2.right));\n }\n Collections.sort(arrayList2);\n int i2 = 0;\n while (i < arrayList2.size() - 1) {\n int i3 = i + 1;\n if (!((Integer) arrayList2.get(i)).equals(arrayList2.get(i3))) {\n Rect rect3 = new Rect(((Integer) arrayList2.get(i)).intValue(), rect.top, ((Integer) arrayList2.get(i3)).intValue(), rect.bottom);\n int i4 = rect.top;\n for (Rect rect4 : arrayList) {\n if (Rect.intersects(rect4, rect3)) {\n if (rect4.bottom > i4) {\n i2 += rect3.width() * (rect4.bottom - Math.max(i4, rect4.top));\n i4 = rect4.bottom;\n }\n if (rect4.bottom == rect3.bottom) {\n break;\n }\n }\n }\n }\n i = i3;\n }\n return i2;\n }",
"public static int find_land (int a [][], int x, int y){\r\n int count_land = 0;\r\n for (int i = 0; i < x; i++){\r\n for (int j = 0; j < y; j++){\r\n if (a[i][j] > 0){\r\n count_land ++;\r\n //x[i][j] = 0;\r\n check_island(i, j);\r\n }\r\n }\r\n }\r\n return count_land;\r\n }",
"public Iterable<Point2D> range(RectHV rect) {\n\t\tif (rect == null) {\n\t\t\tthrow new NullPointerException();\n\t\t}\n\t\tQueue<Point2D> queue = new Queue<Point2D>();\n\t\tStack<Node> stack = new Stack<>();\n\t\tstack.push(root);\n\t\twhile (!stack.isEmpty()) {\n\t\t\tNode nCur = stack.pop();\n\t\t\tPoint2D pCur = nCur.point;\n\t\t\tif (rect.contains(pCur)) {\n\t\t\t\tqueue.enqueue(pCur);\n\t\t\t\tif (nCur.right != null) {\n\t\t\t\t\tstack.push(nCur.right);\n\t\t\t\t}\n\t\t\t\tif (nCur.left != null) {\n\t\t\t\t\tstack.push(nCur.left);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (nCur.bDirection == USING_X) {\n\t\t\t\t\tif (nCur.x < rect.xmin() && nCur.right != null) {\n\t\t\t\t\t\tstack.push(nCur.right);\n\t\t\t\t\t} else if (nCur.x > rect.xmax() && nCur.left != null) {\n\t\t\t\t\t\tstack.push(nCur.left);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (nCur.right != null) {\n\t\t\t\t\t\t\tstack.push(nCur.right);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (nCur.left != null) {\n\t\t\t\t\t\t\tstack.push(nCur.left);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (nCur.y < rect.ymin() && nCur.right != null) {\n\t\t\t\t\t\tstack.push(nCur.right);\n\t\t\t\t\t} else if (nCur.y > rect.ymax() && nCur.left != null) {\n\t\t\t\t\t\tstack.push(nCur.left);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (nCur.right != null) {\n\t\t\t\t\t\t\tstack.push(nCur.right);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (nCur.left != null) {\n\t\t\t\t\t\t\tstack.push(nCur.left);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn queue;\n\t}",
"private static double divideAndConquer(ArrayList<Point> X, ArrayList<Point> Y) {\n\n\t\t//Assigns size of array\n\t\tint size = X.size();\n\n\t\t//If less than 3 points, efficiency is better by brute force\n\t\tif (size <= 3) {\n\t\t\treturn BruteForceClosestPairs(X);\n\t\t}\n\t\t\n\t\t//Ceiling of array size / 2\n\t\tint ceil = (int) Math.ceil(size / 2);\n\t\t//Floor of array size / 2\n\t\tint floor = (int) Math.floor(size / 2);\n\t\t\n\t\t//Array list for x & y values left of midpoint\n\t\tArrayList<Point> xL = new ArrayList<Point>();\t\n\t\tArrayList<Point> yL = new ArrayList<Point>();\n\t\t\n\t\t//for [0 ... ceiling of array / 2]\n\t\t//add the points onto the new arrays\n\t\tfor (int i = 0; i < ceil; i++) {\n\t\t\t\n\t\t\txL.add(X.get(i));\n\t\t\tyL.add(Y.get(i));\n\t\t}\n\t\t\n\t\t// Array list for x & y values right of midpoint\n\t\tArrayList<Point> xR = new ArrayList<Point>();\n\t\tArrayList<Point> yR = new ArrayList<Point>();\n\t\t\n\t\t//for [floor of array / 2 ... size of array]\n\t\t//add the points onto the new arrays\n\t\tfor (int i = floor; i < size - 1; i++) {\n\n\t\t xR.add(X.get(i));\n\t\t\tyR.add(Y.get(i));\n\t\t}\n\t\t\n\t\t//Recursively find the shortest distance\n\t\tdouble distanceL = divideAndConquer(xL, yL);\n\t\tdouble distanceR = divideAndConquer(xR, xL);\n\t\t//Smaller of both distances\n\t\tdouble distance = Math.min(distanceL, distanceR);\n\t\t//Mid-line\n\t\tdouble mid = X.get(ceil - 1).getX();\n\n\t\tArrayList<Point> S = new ArrayList<Point>();\n\n\t\t//copy all the points of Y for which |x - m| < d into S[0..num - 1]\n\t\tfor (int i = 0; i < Y.size() - 1; i++) {\n\n\t\t\tif (Math.abs(X.get(i).getX() - mid) < distance) {\n\t\t\t\tS.add(Y.get(i));\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Square minimum distance\n\t\tdouble dminsq = distance * distance;\n\t\t//Counter\n\t\tint k = 0;\n\t\tint num = S.size();\n\n\t\tfor (int i = 0; i < num - 2; i++) {\n\t\t\t\n\t\t\tk = i + 1;\n\t\t\t\n\t\t\twhile (k <= num - 1 && (Math.pow((S.get(k).getY() - S.get(i).getY()), 2) < dminsq)) {\n\n\t\t\t\t//Find distance between points and find the minimum compared to dminsq\n\t\t\t\tdminsq = Math.min(Math.pow(S.get(k).getX() - S.get(i).getX(), 2) \n\t\t\t\t\t\t\t\t+ Math.pow(S.get(k).getY() - S.get(i).getY(), 2), dminsq);\n\n\t\t\t\tk = k + 1;\n\t\t\t}\n\t\t}\n\n\t\treturn Math.sqrt(dminsq);\n\t}",
"private static List<int[]> getSkyLineRecur(int[][] buildings, int start, int end) {\n List<int[]> result = new ArrayList<>();\n if (start == end) {\n int[] building = buildings[start];\n result.add(new int[]{building[0], building[2]});\n result.add(new int[]{building[1], 0});\n return result;\n }\n int mid = start + (end - start) / 2;\n List<int[]> leftPoints = getSkyLineRecur(buildings, start, mid);\n List<int[]> rightPoints = getSkyLineRecur(buildings, mid + 1, end);\n int prevLeftHeight = 0, prevRightHeight = 0;\n int prevHeight = 0;\n int l = 0, r = 0;\n for(; l < leftPoints.size() && r < rightPoints.size();) {\n int[] leftPoint = leftPoints.get(l);\n int[] rightPoint = rightPoints.get(r);\n if (leftPoint[0] < rightPoint[0]) {\n int newHeight = Math.max(leftPoint[1], prevRightHeight);\n if (newHeight != prevHeight) {\n result.add(new int[]{leftPoint[0], newHeight});\n prevHeight = newHeight;\n }\n prevLeftHeight = leftPoint[1];\n l++;\n } else if (leftPoint[0] > rightPoint[0]) {\n int newHeight = Math.max(rightPoint[1], prevLeftHeight);\n if (newHeight != prevHeight) {\n result.add(new int[]{rightPoint[0], newHeight});\n prevHeight = newHeight;\n }\n prevRightHeight = rightPoint[1];\n r++;\n } else {\n int newHeight = Math.max(leftPoint[1], rightPoint[1]);\n if (newHeight != prevHeight) {\n result.add(new int[]{leftPoint[0], newHeight});\n prevHeight = newHeight;\n }\n prevLeftHeight = leftPoint[1];\n prevRightHeight = rightPoint[1];\n l++;\n r++;\n }\n }\n List<int[]> rest = (l == leftPoints.size()) ? rightPoints : leftPoints;\n int i = (l == leftPoints.size()) ? r : l;\n for (; i < rest.size(); ++i) {\n result.add(rest.get(i));\n }\n return result;\n }",
"private final void computeAllEdgeLevelsFast() {\n int[] currentLevelEdgeNodes = new int[nEdges*2];\n int[] currentLevelEdgeIndexes = new int[nEdges*2];\n int currEdge = 0;\n int nextLevelEnd = 0;\n\n /**\n * \\ neighbours are behind the current edge.\n * '. \\\n * '. \\ nNeighbours[vi][ei] = 2\n * '.\\\n * O-----------> [next]\n * vi ei\n */\n\n\n int[][] nNeighbours = new int[nNodes][];\n for (int vi=0; vi<nNodes; ++vi) {\n int currX = xPositions[vi];\n int currY = yPositions[vi];\n\n int nOutgoingEdges = nOutgoingEdgess[vi];\n int[] outgoingEdges = outgoingEdgess[vi];\n \n int[] currNodeNNeighbours = new int[nOutgoingEdges];\n for (int ei=0; ei<nOutgoingEdges; ++ei) {\n // For each directed edge\n int ni = outgoingEdges[ei];\n int nextX = xPositions[ni];\n int nextY = yPositions[ni];\n\n // Count taut outgoing edges\n int count = 0;\n\n int nNextOutgoingEdges = nOutgoingEdgess[vi];\n int[] nextOutgoingEdges = outgoingEdgess[vi];\n for (int j=0; j<nNextOutgoingEdges; ++j) {\n int di = nextOutgoingEdges[j];\n if (graph.isTaut(nextX, nextY, currX, currY, xPositions[di], yPositions[di])) {\n ++count;\n }\n }\n\n currNodeNNeighbours[ei] = count;\n if (count == 0) {\n currentLevelEdgeNodes[nextLevelEnd] = vi;\n currentLevelEdgeIndexes[nextLevelEnd] = ei;\n ++nextLevelEnd;\n }\n }\n nNeighbours[vi] = currNodeNNeighbours;\n }\n\n \n int currLevel = 1;\n while (currEdge < nextLevelEnd && currLevel < levelLimit) {\n\n int currentLevelEnd = nextLevelEnd;\n for (; currEdge < currentLevelEnd; ++currEdge) {\n int currNode = currentLevelEdgeNodes[currEdge];\n int currEdgeIndex = currentLevelEdgeIndexes[currEdge];\n\n if (edgeLevels[outgoingEdgeIndexess[currNode][currEdgeIndex]] != LEVEL_W) continue;\n // Set edge level\n edgeLevels[outgoingEdgeIndexess[currNode][currEdgeIndex]] = currLevel;\n\n /**\n * Curr side must have no neighbours.\n * Opp side (next node) may have neighbours.\n * So remove neighbours from opposite side.\n * __\n * /| __\n * / .-'|\n * (no neighbours) / .-'\n * /.-'\n * O-----------> [n]\n * vi ei\n */\n // No need to remove neighbours from opposite edge. They are ignored automatically.\n\n\n int nextNode = outgoingEdgess[currNode][currEdgeIndex];\n\n int currX = xPositions[currNode];\n int currY = yPositions[currNode];\n int nextX = xPositions[nextNode];\n int nextY = yPositions[nextNode];\n\n int[] outgoingEdges = outgoingEdgess[nextNode];\n int nOutgoingEdges = nOutgoingEdgess[nextNode];\n\n int[] outgoingEdgeIndexes = outgoingEdgeIndexess[nextNode];\n\n int[] nextNodeNNeighbours = nNeighbours[nextNode];\n for (int j=0; j<nOutgoingEdges; ++j) {\n if (edgeLevels[outgoingEdgeIndexes[j]] != LEVEL_W) continue;\n int nextnextNode = outgoingEdges[j];\n int nextnextX = xPositions[nextnextNode];\n int nextnextY = yPositions[nextnextNode];\n if (!graph.isTaut(currX, currY, nextX, nextY, nextnextX, nextnextY)) continue;\n\n --nextNodeNNeighbours[j];\n if (nextNodeNNeighbours[j] == 0) {\n // push into next level's list.\n currentLevelEdgeNodes[nextLevelEnd] = nextNode;\n currentLevelEdgeIndexes[nextLevelEnd] = j;\n ++nextLevelEnd;\n }\n\n if (nextNodeNNeighbours[j] < 0) System.out.println(\"ERROR\");\n }\n }\n\n ++currLevel;\n }\n }",
"static int minDrops(int n, int E) {\n\n\t\t//f[n][k] = ?\n\n\t\t//use one egg broken or not\n\n\t\t//try floor 1 2 3 4 5 6 with one egg.\n\n\n\n\t\t//floor i. ok if we broken something, didn't broken only go up. or it broke, then\n\t\t// f[n][e] = min( max(f[n - i][e], f[i][e-1]) for i)\n\t\t//\n\t\t// \n\n\t\tint[][] f = new int[n + 1][E + 1];\n\t\t//1 floor. ew need1\n\n\t\tfor (int i = 1; i <= n; ++i) {\n\t\t\tf[i][1] = i;\n\t\t}\n\n\n\t\tfor (int i = 1; i <= E; ++i) {\n\t\t\tf[1][i] = 1;\n\t\t}\n\n\t\tfor (int h = 2; h <= n; ++h) {\n\t\t\tfor (int e = 2; e <= E; ++e) {\n\n\t\t\t\tf[h][e] = h;\n\t\t\t\tfor (int i = 1; i <= h; ++i) { //try each floor\n\t\t\t\t\tf[h][e] = Math.min(f[h][e], Math.max(f[h - i][e], f[i - 1][e - 1]) + 1);\n\n\t\t\t\t\t// h ith floor. not broken h - i// check all the remaining\n\t\t\t\t\t//\n\t\t\t\t\t// h ith flor.. borken. check i - 1 then check i -1 broken or not?!\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn f[n][E];\n\t}",
"public List<Integer> findMinHeightTrees(int n, int[][] edges) {\n List<Integer> ans = new ArrayList<>();\n if (n == 0) return ans;\n if (n == 1) {\n ans.add(0);\n return ans;\n }\n if (n == 2) {\n ans.add(0);\n ans.add(1);\n return ans;\n }\n\n //build graph\n List<Integer>[] graph = new ArrayList[n];\n for (int i = 0; i < n; i++) {\n graph[i] = new ArrayList<>();\n }\n for (int i = 0; i < edges.length; i++) {\n int v1 = edges[i][0];\n int v2 = edges[i][1];\n\n graph[v1].add(v2);\n graph[v2].add(v1);\n }\n\n //initial leaves\n List<Integer> leaves = new ArrayList<>();\n for (int i = 0; i < n; i++) {\n if (graph[i].size() == 1) {\n leaves.add(i);\n }\n }\n\n int count = n;\n\n while (count > 2) {\n int leasize = leaves.size();\n count -= leasize;\n List<Integer> newleaves = new ArrayList<Integer>();\n for (int i = 0; i < leasize; i++) {\n int leavenode = leaves.get(i);\n int verToleave = graph[leavenode].get(0);\n graph[verToleave].remove(Integer.valueOf(leavenode));\n if (graph[verToleave].size() == 1) {\n newleaves.add(verToleave);\n }\n }\n\n leaves = newleaves;\n }\n return leaves;\n\n\n }",
"public Set<MapCoordinate> getAllSurroundingCellsAsMapCoordinatesStartingFromTopLeft(MapCoordinate topLeftMapCoordinate, int distance, Set<MapCoordinate> alreadyFound) {\n int currentX = topLeftMapCoordinate.getXAsInt();\n int currentY = topLeftMapCoordinate.getYAsInt();\n\n // first row\n int topLeftYMinusDistance = currentY - distance;\n int topLeftXMinusDistance = currentX - distance;\n\n int totalWidth = (distance + entityData.getWidthInCells() + distance) - 1;\n int totalHeight = (distance + entityData.getHeightInCells() + distance) - 1;\n\n Set<MapCoordinate> result = new HashSet<>(alreadyFound);\n\n // -1, because it is 0 based\n for (int x = 0; x <= totalWidth; x++) {\n result.add(MapCoordinate.create(topLeftXMinusDistance + x, topLeftYMinusDistance));\n }\n\n // then all 'sides' of the structure (left and right)\n // also start one row 'lower' since we do not want to calculate the top left/right twice (as we did it\n // in the above loop already)\n // totalHeight - 2 for same reason, -1 == zero based, -2 to reduce one row\n for (int y = 1; y <= (totalHeight - 1); y++) {\n int calculatedY = topLeftYMinusDistance + y;\n\n // left side\n result.add(MapCoordinate.create(topLeftXMinusDistance, calculatedY));\n\n // right side\n int rightX = topLeftXMinusDistance + totalWidth;\n result.add(MapCoordinate.create(rightX, calculatedY));\n }\n\n // bottom row\n int bottomRowY = topLeftYMinusDistance + totalHeight;\n for (int x = 0; x <= totalWidth; x++) {\n result.add(MapCoordinate.create(topLeftXMinusDistance + x, bottomRowY));\n }\n\n if (distance > 1) {\n return getAllSurroundingCellsAsMapCoordinatesStartingFromTopLeft(topLeftMapCoordinate, (distance-1), result);\n }\n return result;\n }",
"public int dfs(int row, int col, int[][] grid) {\n //when current position is in bound and current element is 1, add area by 1 and continue recursively\n //find other 1's, until all four directions reach 0, finally we get area of current island\n if (col >= 0 && row >= 0 && row < grid.length && col < grid[0].length && grid[row][col] == 1) {\n grid[row][col] = 0;\n return 1 + dfs(row + 1, col, grid) + dfs(row - 1, col, grid)\n + dfs(row, col + 1, grid) + dfs(row, col - 1, grid);\n }\n //DO NOT forget return 0 for recursion exit when reach 0\n return 0;\n }",
"private void intervals1D(int dim, int lv, int s, int e, int path, int qmin, int qmax, Intervals result) {\n\t\tfinal WaveletMatrix wm = zoWM[dim];\n\t\tfinal SuccinctBitVector sbv = wm.mWM[lv];\n\t\tfinal int s1 = sbv.rank1(s);\n\t\tfinal int e1 = sbv.rank1(e);\n\t\tfinal int s0 = s - s1;\n\t\tfinal int e0 = e - e1;\n\t\tfinal int levelBit = 1 << lv;\n\n\t\t// search zero-bits child\n\t\tCHILD_0: if (s0 < e0) {\n\t\t\t// [pmin, pmax] : possible range of child\n\t\t\tfinal int pmin = path;\n\t\t\tfinal int pmax = pmin | (levelBit - 1);\n\t\t\tif (pmin > qmax || pmax < qmin) {\n\t\t\t\t// out of query range\n\t\t\t\tbreak CHILD_0;\n\t\t\t}\n\t\t\telse if (pmin >= qmin && pmax <= qmax) {\n\t\t\t\t// in range\n\t\t\t\tresult.add(s0, e0, dim, lv - 1);\n\t\t\t\tbreak CHILD_0;\n\t\t\t}\n\t\t\tintervals1D(dim, lv - 1, s0, e0, pmin, qmin, qmax, result);\n\t\t}\n\t\t// search one-bits child\n\t\tCHILD_1: if (s1 < e1) {\n\t\t\t// [pmin, pmax] : possible range of child\n\t\t\tfinal int pmin = path | levelBit;\n\t\t\tfinal int pmax = pmin | (levelBit - 1);\n\t\t\tif (pmin > qmax || pmax < qmin) {\n\t\t\t\t// out of query range\n\t\t\t\tbreak CHILD_1;\n\t\t\t}\n\t\t\telse if (pmin >= qmin && pmax <= qmax) {\n\t\t\t\t// in range\n\t\t\t\tresult.add(s1 + wm.mZ[lv], e1 + wm.mZ[lv], dim, lv - 1);\n\t\t\t\tbreak CHILD_1;\n\t\t\t}\n\t\t\tintervals1D(dim, lv - 1, s1 + wm.mZ[lv], e1 + wm.mZ[lv], pmin, qmin, qmax, result);\n\t\t}\n\t}",
"private int first_leaf() { return n/2; }",
"public int calculateMinimumHP(ArrayList<ArrayList<Integer>> grid) {\n\t\t\t\t int m =grid.size(), n = grid.get(0).size();\n\t\t\t\t int[][][] dp = new int[m+1][n+1][2];\n\t\t\t\t \n\t\t\t\t dp[0][0][0] = 0;\n\t\t\t\t dp[0][0][1] = 0;\n\t\t\t\t dp[0][1][0] = 1; // start with life\n\t\t\t\t dp[0][1][1] = 0; // balance life\n\t\t\t\t dp[1][0][0] = 1;\n\t\t\t\t dp[1][0][1] = 0;\n\t\t\t\t for(int i=2;i<dp[0].length;i++){\n\t\t\t\t\t dp[0][i][0] = Integer.MAX_VALUE;\n\t\t\t\t\t dp[0][i][1] = 0;\n\t\t\t\t }\n\t\t\t\t for(int i=2;i<dp.length;i++){\n\t\t\t\t\t dp[i][0][0] = Integer.MAX_VALUE;\n\t\t\t\t\t dp[i][0][1] = 0;\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t for(int i=1;i<dp.length;i++){\n\t\t\t\t\t for(int j=1;j<dp[0].length;j++){\n\t\t\t\t\t\t \n\t\t\t\t\t\t if(grid.get(i-1).get(j-1) < 0){\n\t\t\t\t\t\t\t int[] fromCell = dp[i-1][j][0]< dp[i][j-1][0]?dp[i-1][j]:dp[i][j-1];\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t dp[i][j][0] = fromCell[0] - grid.get(i-1).get(j-1) - fromCell[1];\n\t\t\t\t\t\t\t dp[i][j][1] = fromCell[1]+ grid.get(i-1).get(j-1)>0?fromCell[1]+ grid.get(i-1).get(j-1):0;\n\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t int[] fromCell = dp[i-1][j][0]< dp[i][j-1][0]?dp[i-1][j]:dp[i][j-1];\n\t\t\t\t\t\t\t dp[i][j][0] = fromCell[0];\n\t\t\t\t\t\t\t dp[i][j][1] = fromCell[1]+grid.get(i-1).get(j-1);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t return dp[m][n][0];\n\t\t\t\t \n\t\t\t }",
"private static int findMaxPointsFromTopLeftToBottomRight(char[][] matrix, int startingCellX, int startingCellY, int endCellX, int endCellY, int[][] memory) {\n if (!inRange(matrix, startingCellX, startingCellY)) {\n return 0;\n }\n\n/*\n if (visited[startingCellX][startingCellY]) {\n return 0;\n }\n*/\n\n if (memory[startingCellX][startingCellY] != -1) {\n return memory[startingCellX][startingCellY];\n }\n\n char ch = matrix[startingCellX][startingCellY];\n\n //visited[startingCellX][startingCellY] = true;\n\n if (ch == '#') {\n return 0;\n }\n\n if (startingCellX == endCellX && startingCellY == endCellY) {\n if (ch == '#' || ch == '.') {\n return 0;\n }\n return 1; // if '*'\n }\n\n if (ch == '*') {\n\n int maxPointsFromDown = findMaxPointsFromTopLeftToBottomRight(matrix, startingCellX + 1, startingCellY, endCellX, endCellY, memory);\n int maxPointsFromRight = findMaxPointsFromTopLeftToBottomRight(matrix, startingCellX, startingCellY + 1, endCellX, endCellY, memory);\n\n /* if (maxPointsFromRight < maxPointsFromDown) {\n if (inRange(matrix, startingCellX, startingCellY + 1)) {\n visited[startingCellX][startingCellY + 1] = false;\n }\n } else {\n if (inRange(matrix, startingCellX + 1, startingCellY)) {\n visited[startingCellX + 1][startingCellY] = false;\n }\n }\n*/\n int maxPoints = 1 + Math.max(maxPointsFromRight, maxPointsFromDown);\n\n // memoization for top-down approach\n memory[startingCellX][startingCellY] = maxPoints;\n\n return maxPoints;\n\n } else if (ch == '.') {\n\n int maxPointsFromDown = findMaxPointsFromTopLeftToBottomRight(matrix, startingCellX + 1, startingCellY, endCellX, endCellY, memory);\n int maxPointsFromRight = findMaxPointsFromTopLeftToBottomRight(matrix, startingCellX, startingCellY + 1, endCellX, endCellY, memory);\n\n /* if (maxPointsFromRight < maxPointsFromDown) {\n if (inRange(matrix, startingCellX, startingCellY + 1)) {\n visited[startingCellX][startingCellY + 1] = false;\n }\n } else {\n if (inRange(matrix, startingCellX + 1, startingCellY)) {\n visited[startingCellX + 1][startingCellY] = false;\n }\n }*/\n\n int maxPoints = Math.max(maxPointsFromRight, maxPointsFromDown);\n\n // memoization for top-down approach\n memory[startingCellX][startingCellY] = maxPoints;\n\n return maxPoints;\n } else { // if ch == '#'\n\n int maxPoints = 0;\n\n // memoization for top-down approach\n memory[startingCellX][startingCellY] = 0;\n\n return 0;\n }\n }",
"public void findBoundaryGivenPhi() {\n \r\n boundary.removeAllElements();\r\n \r\n \tfor(int i=0; i<pixelsWide-1; i++)\r\n \t\tfor(int j=0; j<pixelsHigh-1; j++) {\r\n Int2d pi = new Int2d(i,j);\r\n \r\n double sgnIJ = Math.signum( phi[i][j] );\r\n if( sgnIJ != Math.signum( phi[i+1][j] ) ) {\r\n if(!boundary.contains(pi)) boundary.add(pi);\r\n Int2d p2 = new Int2d(i+1,j);\r\n if(!boundary.contains(p2)) boundary.add(p2);\r\n }\r\n if( sgnIJ != Math.signum( phi[i][j+1] ) ) {\r\n if(!boundary.contains(pi)) boundary.add(pi);\r\n Int2d p2 = new Int2d(i,j+1);\r\n if(!boundary.contains(p2)) boundary.add(p2); \r\n }\r\n \r\n }\r\n \r\n \r\n }",
"static public int getAtLeastKVisitors(int[][] rectangles, int k) {\n\n if(rectangles.length==0)\n return 0;\n if(k > rectangles.length)\n return 0;\n\n TreeSet<Rectangle> avlTree = new TreeSet<>();//To store the rectangles ordered\n TreeSet<Integer> Ys = new TreeSet<>();\n\n for(int[] coordinates: rectangles) {\n //x2 = x2 + 1 , y2 = y2 +1 for the inclusive constraints\n Rectangle r = new Rectangle(coordinates[0], coordinates[1], coordinates[2]+1, coordinates[3]+1);\n avlTree.add(r);\n if(!Ys.contains(r.getY1()))\n Ys.add(r.getY1());\n if(!Ys.contains(r.getY2()))\n Ys.add(r.getY2());\n }\n\n int ans = 0;\n Iterator<Integer> yIterator = Ys.iterator();\n int previousY = yIterator.next();\n\n //Traverse by slices of Y's\n while(yIterator.hasNext()) {\n\n int currentY = yIterator.next();\n List<int[]> segments = new ArrayList<>();\n Iterator<Rectangle> treeIterator = avlTree.iterator();\n\n //Look for the rectangles that fall in the slice and create a segment's list\n while(treeIterator.hasNext()) {\n Rectangle r = treeIterator.next();\n //We stop traversing the tree once the rectangles are completely above the slice\n if(r.getY1()>currentY)\n break;\n if(r.getY1()<= previousY && r.getY2()>=currentY) {\n int[] segmentL = new int[2]; int[] segmentR = new int[2];\n segmentL[0] = r.getX1(); segmentL[1] = Type.OPEN.getValue();\n segmentR[0] = r.getX2(); segmentR[1] = Type.CLOSED.getValue();\n segments.add(segmentL); segments.add(segmentR);\n }\n //We remove the rectangles that are left behind by the slice\n if(r.getY2() < previousY)\n treeIterator.remove();\n }\n\n //Sort the segments to analyze them\n Collections.sort(segments, (a, b) -> Integer.compare(a[0], b[0]));\n Iterator<int[]> it = segments.iterator();\n int[] segmentEnd, segmentStart = it.next();\n int nRectangles = Type.OPEN.getValue(); //The first interval will always be opening\n\n while(it.hasNext()) {\n segmentEnd = it.next();\n if(nRectangles >=k) {\n ans+= (currentY - previousY) * (segmentEnd[0] - segmentStart[0]);\n }\n segmentStart = segmentEnd;\n nRectangles += segmentEnd[1];\n }\n\n previousY = currentY;\n }\n\n return ans;\n }",
"void ompleBlocsHoritzontals() {\r\n\r\n for (int i = 0; i < N; i = i + SRN) // for diagonal box, start coordinates->i==j \r\n {\r\n ompleBloc(i, i);\r\n }\r\n }",
"private static long redelpol(int n, int k, int[][] untried, int startIndex, int endIndex, boolean[][] field)\n {\n if(k == n)\n return 1;\n\n else\n {\n long l = 0;\n\n for(int i = startIndex; i <= endIndex; ++i)\n {\n int x = untried[i][0], y = untried[i][1];\n\n field[x+n-1][y+1] = false;\n\n int cursor = 0;\n boolean a = false, b = false, c = false, d = false;\n\n if(x+1 < n && (field[x+1+n-1][y+1]))\n {\n field[x+1+n-1][y+1] = false;\n cursor++;\n untried[cursor+endIndex][0] = x+1;\n untried[cursor+endIndex][1] = y;\n a = true;\n }\n\n if(y + 1 < n && (field[x+n-1][y+1+1]))\n {\n field[x+n-1][y+1+1] = false;\n cursor++;\n untried[cursor+endIndex][0] = x;\n untried[cursor+endIndex][1] = y+1;\n b = true;\n }\n\n if(x-1 > -n && (field[x-1+n-1][y+1]))\n {\n field[x-1+n-1][y+1] = false;\n cursor++;\n untried[cursor+endIndex][0] = x-1;\n untried[cursor+endIndex][1] = y;\n c = true;\n }\n\n if(y-1 >= -1 && (field[x+n-1][y-1+1]))\n {\n field[x+n-1][y-1+1] = false;\n cursor++;\n untried[cursor+endIndex][0] = x;\n untried[cursor+endIndex][1] = y-1;\n d = true;\n }\n\n l += redelpol(n, k+1, untried, i+1, endIndex+cursor, field);\n\n if(a)\n field[x+1+n-1][y+1] = true;\n if(b)\n field[x+n-1][y+1+1] = true;\n if(c)\n field[x-1+n-1][y+1] = true;\n if(d)\n field[x+n-1][y-1+1] = true;\n }\n\n return l;\n }\n }",
"public int orangesRotting(int[][] grid) {\n /**\n 经典的bfs 队列模拟\n 要注意的是 记录层数即为times的消耗 用queue.size 来遍历 每次先记录queue的大小 若size减为0 则说明当前层遍历完\n\n 这题要注意几个corner case\n 1.有永远新鲜的水果 1的周围都是0\n 2.原本就没有水果 全是空格0\n\n **/\n int time=0;\n if(grid==null||grid.length==0)return 0;\n\n Queue<int[]> queue=new LinkedList<>();\n\n\n int flag=0;\n for(int i=0;i<grid.length;i++){\n for(int j=0;j<grid[0].length;j++){\n if(grid[i][j]==2)\n queue.add(new int[]{i,j});\n if(grid[i][j]==1)\n flag=1;\n }\n }\n if(queue.isEmpty()&&flag==0)return 0;\n\n int dir[][]={{0,1},{0,-1},{1,0},{-1,0}};\n\n\n\n while(!queue.isEmpty()){\n int size=queue.size();\n while(size>0){\n int[] cur=queue.poll();\n\n for(int i=0;i<4;i++){\n int x=cur[0]+dir[i][0];\n int y=cur[1]+dir[i][1];\n if(x<0||x>=grid.length||y<0||y>=grid[0].length)continue;\n if(grid[x][y]==1){\n grid[x][y]=2;\n queue.add(new int[]{x,y});\n }\n\n }\n size--;\n }\n\n time++;\n\n }\n\n for(int i=0;i<grid.length;i++){\n for(int j=0;j<grid[0].length;j++){\n if(grid[i][j]==1)\n return -1;\n }\n }\n\n\n return time-1;\n }",
"static void roundTable(final List<double[]> table) {\n if (table.size() == 0) return;\n \n\tint numRows = table.size();\n\tint numCols = table.get(0).length;\n\t\n\tdouble[] rowSum = new double[numRows];\n\tdouble[] colSum = new double[numCols];\n\tdouble[][] newTable = new double[numRows][numCols];\n\t\n\tfor (int i = 0; i < numRows; i++) {\n\t\tfor (int j = 0; j < numCols; j++) {\n\t\t\tnewTable[i][j] = table.get(i)[j];\n\t\t\trowSum[i] += table.get(i)[j];\n\t\t\tcolSum[j] += table.get(i)[j];\n\t\t}\n\t}\n\t\n\tInteger source = -numCols - 1;\n\tInteger sink = numRows + 1;\n\tList<Integer> nodes = new ArrayList<Integer>();\n\t\n for (int i = 0; i < numRows + 1; i++) {\n \tnodes.add(i);\n }\n for (int i = 0; i < numCols + 1; i++) {\n \tnodes.add(-i);\n }\n \n\tToDoubleBiFunction<Integer, Integer> minEdgeFlow = (a, b) -> {\n\t\tif (a.equals(source) && (b < 0 && b >= -numCols)) {\n\t\t\treturn Math.floor(colSum[-b - 1]);\n\t\t} else if ((a > 0 && a <= numRows) && b.equals(sink)) {\n\t\t\treturn Math.floor(rowSum[a - 1]);\n\t\t} else if ((b > 0 && b <= numRows) && (a < 0 && a >= -numCols)) {\n\t\t\treturn Math.floor(newTable[b - 1][-a - 1]);\n\t\t}\n\t\treturn 0.0;};\n\t\n\tToDoubleBiFunction<Integer, Integer> maxEdgeFlow = (a, b) -> {\n\t\tif (a.equals(source) && (b < 0 && b >= -numCols)) {\n\t\t\treturn Math.ceil(colSum[-b - 1]);\n\t\t} else if ((a > 0 && a <= numRows) && b.equals(sink)) {\n\t\t\treturn Math.ceil(rowSum[a - 1]);\n\t\t} else if ((b > 0 && b <= numRows) && (a < 0 && a >= -numCols)) {\n\t\t\treturn Math.ceil(newTable[b - 1][-a - 1]);\n\t\t}\n\t\treturn 0.0;};\n\t\n\tToDoubleBiFunction<Integer, Integer> flow = findFeasibleBoundedFlow(source, sink, nodes,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tminEdgeFlow, maxEdgeFlow);\n\tfor (int i = 0; i < numCols; i++) {\n\t\tfor (int j = 0; j < numRows; j++) {\n\t\t\ttable.get(j)[i] = flow.applyAsDouble(-i - 1, j + 1);\n\t\t}\n\t}\n }",
"public static void main(String[] args) {\n TreeNode n20 = new TreeNode(20);\n TreeNode n8 = new TreeNode(8);\n TreeNode n4 = new TreeNode(4);\n TreeNode n7 = new TreeNode(7);\n TreeNode n12 = new TreeNode(12);\n TreeNode n14 = new TreeNode(14);\n TreeNode n21 = new TreeNode(21);\n TreeNode n22 = new TreeNode(22);\n TreeNode n25 = new TreeNode(25);\n TreeNode n24 = new TreeNode(24);\n n20.left = n8;\n n20.right = n22;\n n8.left = n4;\n n8.right = n12;\n n4.right = n7;\n n12.right = n14;\n n22.left = n21;\n n22.right = n25;\n n25.left = n24;\n\n for (Integer i : printBoundary(n20)) {\n System.out.println(i);\n }\n }",
"public int getMinFloor();",
"public void findBoundary(boolean useDestinations)\r\n\t{\n\tdouble maxSpacing = res/5.0;\r\n\tif(maxSpacing<1) maxSpacing = 1;\r\n\t\r\n\t//First make sure point sampling is dense enough:\t\r\n\tVector<Int2d> surfaceT = new Vector<Int2d>();\t\r\n\tfor(int it=0; it<sl; it++)\r\n\t\t{\r\n\t\tInt2d p = surface.get(it);\r\n\t\tsurfaceT.add(p);\r\n\t\tInt2d p2 = surface.get((it+1)%sl);\r\n\t\tdouble pdist = p2.distance(p);\r\n\t\tif(pdist > maxSpacing)\r\n\t\t\t{\r\n\t\t\t// populate this line segment with points\r\n\t\t\tint extraPoints = (int)(pdist/maxSpacing); // - 2 cause we already have 2 points\r\n\t\t\t\r\n\t\t\tfor(int i=0; i<extraPoints; i++)\r\n\t\t\t\t{\r\n\t\t\t\tInt2d pN = new Int2d(p);\r\n\t\t\t\tInt2d diff = new Int2d();\r\n\t\t\t\tdiff.sub(p2,p);\r\n\t\t\t\tpN.scaleAdd((double)(i+1.)/(extraPoints+1.),diff,pN);\r\n\t\t\t\tsurfaceT.add(pN);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t//System.out.println(\"got here2.1\");\r\n\tsurface = surfaceT;\r\n\tcanvas1.surface = surface;\r\n\tsl = surfaceT.size();\r\n\t\t\r\n\t//System.out.println(sl);\r\n\t\r\n\t\t\t\t\r\n\tfor(int it=0; it<sl; it++)\r\n\t\t{\r\n\t\tInt2d p = surface.get(it);\r\n\t\tint i = (int)(p.x/res);\r\n\t\tint j = (int)(p.y/res);\r\n\t\tboolean extraWide = false;\r\n\t\tboolean extraHigh = false;\t\t\r\n\t\t\r\n\t\tif((p.y % res) == 0)\r\n\t\t\t{\r\n\t\t\t//System.out.println(\"Extra high at i,j = \" + i + \", \" + j);\r\n\t\t\textraHigh = true;\r\n\t\t\t}\r\n\t\tif((p.x % res) == 0)\r\n\t\t\t{\r\n\t\t\textraWide = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\tint len = 4;\r\n\t\tif(extraWide && extraHigh) len = 9;\r\n\t\telse if(extraWide || extraHigh) len = 6;\r\n\t\t\r\n\t\tInt2d[] pi = new Int2d[len];\r\n\t\tint[] ic = new int[len];\r\n\t\tint[] jc = new int[len];\r\n\t\t\r\n\t\tgenerateStencil(i,j,extraWide,extraHigh,ic,jc,pi,len);\r\n\t\t\r\n\t\tfor(int c=0; c<len; c++)\r\n\t\t\t{\r\n\t\t\tif(withinBounds(ic[c],jc[c]))\r\n\t\t\t\t{\r\n\t\t\t\tif(!useDestinations)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif(!boundary.contains(pi[c])) boundary.add(pi[c]);\r\n\t\t\t\t\tInt2d piX = new Int2d(res*pi[c].x,res*pi[c].y);\r\n\t\t\t\t\tdouble dCur = piX.distance(p);\r\n\t\t\t\t\tint sign = 1;\r\n\t\t\t\t\tif(poly.contains(res*pi[c].x,res*pi[c].y)) sign = -1;\r\n\t\t\t\t\t//if(ic[c] == 10 && jc[c] == 10) System.out.println(\"sign = \" + sign);\r\n\t\t\t\t\tif(dCur<Math.abs(phi[ic[c]][jc[c]]))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tphi[ic[c]][jc[c]] = sign*dCur;\r\n\t\t\t\t\t\t//System.out.println(sign*dCur);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t//else phi[ic[c]][jc[c]] = -phiStart;\r\n\t\t\t\t// Way suggested in paper, but this looks bad with interpolation\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//System.out.println(\"got here2.2\");\r\n\t\t\r\n\tif(useDestinations) //Use destinations\r\n\t\t{\t\t\r\n\t\t// Sets destination point distances accordingly\r\n\t\t\r\n\t\tint dl = destinations.size();\r\n\t\tfor(int it=0; it<dl; it++)\r\n\t\t\t{\r\n\t\t\tInt2d p = destinations.get(it);\r\n\t\t\tint i = (int)(p.x/res);\r\n\t\t\tint j = (int)(p.y/res);\r\n\t\t\tboolean extraWide = false;\r\n\t\t\tboolean extraHigh = false;\t\t\r\n\t\t\t\r\n\t\t\tif((p.y % res) == 0)\r\n\t\t\t\t{\r\n\t\t\t\t//System.out.println(\"Extra high at i,j = \" + i + \", \" + j);\r\n\t\t\t\textraHigh = true;\r\n\t\t\t\t}\r\n\t\t\tif((p.x % res) == 0)\r\n\t\t\t\t{\r\n\t\t\t\textraWide = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\tint len = 4;\r\n\t\t\tif(extraWide && extraHigh) len = 9;\r\n\t\t\telse if(extraWide || extraHigh) len = 6;\r\n\t\t\t\r\n\t\t\tInt2d[] pi = new Int2d[len];\r\n\t\t\tint[] ic = new int[len];\r\n\t\t\tint[] jc = new int[len];\r\n\t\t\t\r\n\t\t\tgenerateStencil(i,j,extraWide,extraHigh,ic,jc,pi,len);\r\n\t\t\t\r\n\t\t\tfor(int c=0; c<len; c++)\r\n\t\t\t\t{\r\n\t\t\t\tif(withinBounds(ic[c],jc[c]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif(!boundary.contains(pi[c])) boundary.add(pi[c]);\r\n\t\t\t\t\tInt2d piX = new Int2d(res*pi[c].x,res*pi[c].y);\r\n\t\t\t\t\tdouble dCur = piX.distance(p);\r\n\t\t\t\t\tint sign = 1;\r\n\t\t\t\t\tif(poly.contains(res*pi[c].x,res*pi[c].y)) sign = -1;\r\n\t\t\t\t\t//if(ic[c] == 10 && jc[c] == 10) System.out.println(\"sign = \" + sign);\r\n\t\t\t\t\tif(dCur<Math.abs(phi[ic[c]][jc[c]]))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tphi[ic[c]][jc[c]] = sign*dCur;\r\n\t\t\t\t\t\t//System.out.println(sign*dCur);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\t\t\r\n\tint bl = boundary.size();\r\n\t/*\r\n\tfor(int k=0; k<bl; k++)\r\n\t\t{\r\n\t\tSystem.out.println(boundary.get(k).x + \", \" + boundary.get(k).y + \": element \" + k);\r\n\t\t}\r\n\t\t*/\r\n\t\t\t\r\n\tfor(int i=0; i<bl; i++)\r\n\t\t{\r\n\t\tInt2d pi = boundary.get(i);\r\n\t\tpi.phi = phi[pi.x][pi.y];\r\n\t\t}\r\n\t}",
"static int surfaceArea(int[][] A) {\n int rowLength = A.length;\n int colLength = A[0].length;\n int left = 0;\n int right = 0;\n int front = 0;\n int back = 0;\n int up = colLength * rowLength;\n int down = colLength * rowLength;\n int result = 0;\n\n for(int i = 0; i < rowLength; i++) {\n for(int j = 0; j < colLength; j ++) {\n if(j == 0){\n left += A[i][j];\n }\n else {\n if(A[i][j] > A[i][j - 1]) left += A[i][j] - A[i][j - 1];\n }\n }\n }\n\n for(int i = 0; i < colLength; i++) {\n for(int j = 0; j < rowLength; j ++) {\n if(j == 0){\n back += A[j][i];\n }\n else {\n if(A[j][i] > A[j - 1][i]) back += A[j][i] - A[j - 1][i];\n }\n }\n }\n\n for(int i = rowLength - 1; i >= 0; i--) {\n for(int j = colLength - 1; j >= 0; j--) {\n if(j == colLength - 1) {\n right += A[i][j];\n }\n else {\n if(A[i][j] > A[i][j + 1]) left += A[i][j] - A[i][j + 1];\n }\n\n }\n }\n\n for(int i = colLength - 1; i >= 0; i--) {\n for(int j = rowLength - 1; j >= 0; j--) {\n if(j == rowLength - 1) {\n up += A[j][i];\n }\n else {\n if(A[j][i] > A[j + 1][i]) up += A[j][i] - A[j + 1][i];\n }\n\n }\n }\n\n result = right + left + up + down + front + back;\n\n return result;\n\n }",
"private void splitIntoRoots() {\n\t\tArrayList<ArrayList<Coord>> circ = findCircles();\n\t\tcombinePastRoots(circ);\n\t}",
"public List<Integer> findMinHeightTrees(int n, int[][] edges) {\n List<Integer> res = new ArrayList<Integer>();\n if (n == 1) {\n res.add(0);\n return res;\n }\n\n List<List<Integer>> adjList = new ArrayList<List<Integer>>();\n for (int i=0; i<n; i++) {\n adjList.add(new ArrayList<Integer>());\n }\n int[] degree = new int[n];\n for (int i=0; i<edges.length; i++) {\n adjList.get(edges[i][0]).add(edges[i][1]);\n adjList.get(edges[i][1]).add(edges[i][0]);\n degree[edges[i][0]]++;\n degree[edges[i][1]]++;\n }\n\n Queue<Integer> queue = new ArrayDeque<Integer>();\n for (int i = 0; i < n; i++) {\n if (degree[i] == 1) {\n queue.offer(i);\n }\n }\n\n while (!queue.isEmpty()) {\n List leaves = new ArrayList<Integer>();\n int size = queue.size();\n for (int i = 0; i < size; i++){\n int curr = queue.poll();\n leaves.add(curr);\n for(int next : adjList.get(curr)) {\n degree[next]--;\n if (degree[next]==1) {\n queue.offer(next);\n }\n }\n }\n res = leaves;\n }\n return res;\n }",
"public static void main(String[] args)throws Exception{\n BufferedReader bf = new BufferedReader(new FileReader(new File(\"data.txt\")));\n\n int t = Integer.parseInt(bf.readLine());\n map = new int[t][t];\n group = new int[t][t];\n for( int i = 0 ; i < t; i ++){\n String[] strArr = bf.readLine().split(\" \");\n for(int j = 0 ; j < t; j ++){\n map[i][j] = Integer.parseInt(strArr[j]);\n }\n }\n int g = 2;\n LinkedList<Point> gQueue = new LinkedList<>();\n for(int i = 0 ; i < t ; i ++){\n for(int j = 0 ; j < t ; j ++){\n if(map[i][j] == 1 && group[i][j] == 0){\n gQueue.add(new Point(i,j));\n while(!gQueue.isEmpty()){\n Point p = gQueue.remove();\n int startI = p.i;\n int startJ = p.j;\n group[startI][startJ] = g;\n for(int k = 0 ; k < 4; k ++){\n int tmpI = startI+mI[k];\n int tmpJ = startJ+mJ[k];\n if(tmpI >=0 && tmpJ >=0 && tmpI < t && tmpJ < t){\n if(group[tmpI][tmpJ] == 0 && map[tmpI][tmpJ] == 1){\n gQueue.add(new Point(tmpI,tmpJ));\n group[tmpI][tmpJ] = g;\n }\n }\n }\n }\n g++;\n }\n }\n }\n LinkedList<Point> queue = new LinkedList<>();\n int cnt = 0;\n while(true) {\n boolean flag = false;\n boolean match = false;\n cnt++;\n for (int i = 0; i < t; i++) {\n for (int j = 0; j < t; j++) {\n if (map[i][j] == cnt) {\n flag = true;\n int sI = i;\n int sJ = j;\n for (int k = 0; k < 4; k++) {\n int tmpI = sI + mI[k];\n int tmpJ = sJ + mJ[k];\n if (tmpI >= 0 && tmpJ >= 0 && tmpI < t && tmpJ < t) {\n if (map[tmpI][tmpJ] == 0) {\n map[tmpI][tmpJ] = map[sI][sJ] + 1;\n group[tmpI][tmpJ] = group[sI][sJ];\n }\n }\n }\n }\n }\n }\n if(!flag){\n break;\n }\n }\n for(int i = 0 ; i < t ; i ++){\n for(int j = 0 ; j < t ; j ++){\n for(int k = 0 ; k < 4 ; k ++){\n int tmpI = i + mI[k];\n int tmpJ = j + mJ[k];\n if (tmpI >= 0 && tmpJ >= 0 && tmpI < t && tmpJ < t) {\n if(group[i][j] != group[tmpI][tmpJ]){\n answer = Math.min(answer,map[i][j]+map[tmpI][tmpJ]);\n }\n }\n }\n }\n }\n System.out.println(answer-2);\n }",
"Long getResultMaskBoundary();",
"public static int[][] optimalBST(double[] p,double[] q, int num){\n double[][] e = new double[num+2][num+2];//子树期望代价\n double[][] w = new double[num+2][num+2];//子树总概率\n //why e and w is two bigger than num?\n //because when i==j, e[i][i-1] + e[i+1][j] + w[i][j];\n //when i = 1 or j = num, so e[1][0]、e[num+1][num]\n //here w can use the size of num+1, but in order not to so much complexity in init to judge i\n //so add a bigger w is look good!\n\n int[][] root = new int[num+1][num+1];//记录根节点\n //root[i][j] -- 用来存放i-j组成的最优二叉查找树的根节点\n\n //init--初始化\n for(int i=1; i<num+2; i++){\n e[i][i-1] = q[i-1];\n w[i][i-1] = q[i-1];\n }\n\n for(int d = 0; d<num; d++){\n //插入个数 : 0 - num-1, 从0开始\n for(int i=1; i<=num-d; i++){\n //起始下标 : 1 - num, 从1开始\n int j = i + d;\n e[i][j] = 9999;\n w[i][j] = w[i][j-1] + p[j] + q[j];//\n for(int k=i; k<=j; k++){\n //中间下标\n double temp = e[i][k-1] + e[k+1][j] + w[i][j];\n if(temp < e[i][j]){\n e[i][j] = temp;\n //找到小的,记录下来\n System.out.println(\"i--> \"+i+\", j--> \"+j);\n root[i][j] = k;\n }\n }\n }\n }\n return root;\n }",
"static int eggDropDP(int n, int k) {\r\n int[][] eggFloor = new int[n + 1][k + 1];\r\n int res;\r\n int i, j, x;\r\n\r\n //we need one trial for one floor and 0 trial for 0 floor\r\n for(i = 1; i <= n; i++) {\r\n eggFloor[i][1] = 1;\r\n // eggFloor[i][0] = 0;\r\n }\r\n\r\n //we always need j trials for one egg and j floors\r\n for(j = 1; j <= k; j++) {\r\n eggFloor[1][j] = j;\r\n }\r\n\r\n //fill rest of the entries in table using optimal substructure\r\n for(i = 2; i <= n; i++) { //eggs //n\r\n for(j = 2; j <= k; j++) { //floor //k\r\n eggFloor[i][j] = Integer.MAX_VALUE; \r\n for(x = 1; x <= j; x++) { //e\r\n res = 1 + Math.max(eggFloor[i - 1][x - 1], eggFloor[i][j - x]);\r\n if(res < eggFloor[i][j]) {\r\n eggFloor[i][j] = res;\r\n }\r\n }\r\n }\r\n }\r\n\r\n //eggfloor[n][k] holds the result\r\n return eggFloor[n][k];\r\n }",
"private TreeSet<Integer> getNeightborSets(DisjointSets<Pixel> ds, int root)\n {\n return null; //TODO: remove and replace this line\n }",
"private int removeBoxes(int[] boxes, int l, int r, int k, Integer[][][] dp) {\n if (l > r)\n return 0;\n if (dp[l][r][k] != null)\n return dp[l][r][k];\n int x = l, y = r, z = k;\n while (l+1 <= r && boxes[l] == boxes[l+1]) {\n l++; //\n k++; // count of same elements in a row, starting from l\n }\n int ans = (k+1) * (k+1) + removeBoxes(boxes, l+1, r, 0, dp);\n for (int j = l+1; j <= r; ++j) {\n if (boxes[l] == boxes[j]) {\n ans = Math.max(ans, removeBoxes(boxes, j, r, k+1, dp) + removeBoxes(boxes, l+1, j-1, 0, dp));\n }\n }\n return dp[x][y][z] = ans;\n }",
"private static int queryLazy(int[] segtree, int[] lazyValue, int l, int r, int ns, int ne, int index) {\n if(lazyValue[index]!=0){\n segtree[index]+=lazyValue[index];\n if(ns!=ne){\n lazyValue[2*index]+=lazyValue[index];\n lazyValue[2*index+1]+=lazyValue[index];\n }\n lazyValue[index]=0;\n }\n if(r<ns || l>ne){\n //no overlap\n return Integer.MAX_VALUE;\n }\n if(ns>=l && ne<=r){\n //complete overlap\n return segtree[index];\n }else{\n //partial overlap\n int mid=(ns+ne)/2;\n int leftAns=queryLazy(segtree, lazyValue, l, r, ns, mid, 2*index);\n int rightAns=queryLazy(segtree, lazyValue, l, r, mid+1, ne, 2*index+1);\n return Math.min(leftAns,rightAns);\n }\n }",
"public static int mergeStones(int[] stones, int K) {\n int N = stones.length;\n if ((N-1)%(K-1)!=0) return -1;\n\n // dp[i][j] stores from i to j if can merge, what is the min cost, if (Len(j, i)-1)%(K-1) == 0 that means it can merge to 1 pile, otherwise, we only calculate\n // (from i(start point) to the farest point which can finally merge to 1 pile)'s merge cost\n int[][] dp = new int[N][N];\n\n int[] sum = new int[N+1];\n for (int i=0; i<N; i++) sum[i+1] = sum[i]+stones[i];\n\n for (int L=K; L<=N; L++) { // L is the length of small range\n // i is the subPiles is start point\n for (int i=0; i<=N-L; i++) {\n // j is the end point, L 不一定是K的倍数\n int j=i+L-1;\n dp[i][j]=Integer.MAX_VALUE;\n\n // each time we need keep from i to m is a \"can-merge-to-one-pile\" piles set, so m step is K-1; because each time besides i, we add(K-1) to the piles\n // [i, i+K-1] length is K\n // 把区间[i, j] split to [i, m] and [m+1,j], the left range must be merged to one pile, the right one maybe can or can not\n for (int m=i; m<j; m+=K-1) {\n dp[i][j]=Math.min(dp[i][j], dp[i][m] + dp[m+1][j]);\n }\n if ((j-i)%(K-1)==0) {\n dp[i][j]+=sum[j+1] - sum[i]; // if [i, j] can merge to 1 pile, we need finally add each elem from i to j\n System.out.println(dp[i][j]);\n }\n }\n }\n\n return dp[0][N-1];\n }",
"public static void removeSomeWalls(TETile[][] t) {\n for (int x = 1; x < WIDTH - 1; x++) {\n for (int y = 1; y < HEIGHT - 1; y++) {\n if (t[x][y] == Elements.TREE\n && t[x + 1][y] == Elements.FLOOR) {\n if (t[x - 1][y] == Elements.FLOOR\n && t[x][y + 1] == Elements.FLOOR) {\n if (t[x][y - 1] == Elements.FLOOR\n && t[x + 1][y + 1] == Elements.FLOOR) {\n if (t[x + 1][y - 1] == Elements.FLOOR\n && t[x - 1][y + 1] == Elements.FLOOR) {\n if (t[x - 1][y - 1] == Elements.FLOOR) {\n t[x][y] = Elements.FLOOR;\n }\n }\n }\n }\n }\n }\n }\n }",
"private static Stack<Point> grahamScan(Set<Point> points){\n List<Point> sortedPoints = new ArrayList<>(sortedPointsSet(points));\n\n if(sortedPoints.size() < 3)\n throw new IllegalArgumentException(\"At least three unique points must be provided\");\n if(pointsAreCollinear(sortedPoints))\n throw new IllegalArgumentException(\"Points must not be collinear\");\n\n Stack<Point> stack = new Stack<>();\n stack.push(sortedPoints.get(0));\n stack.push(sortedPoints.get(1));\n stack.push(sortedPoints.get(2));\n\n for (int i = 3; i < sortedPoints.size(); i++) {\n Point top = stack.pop();\n Point nextToTop = stack.peek();\n Point pi = sortedPoints.get(i);\n\n AngleDirection direction = getAngleDirection(nextToTop, top, pi);\n\n switch (direction){\n case COUNTERCLOCKWISE: {\n stack.push(top);\n stack.push(pi);\n break;\n }\n case CLOCKWISE: {\n i--;\n break;\n }\n case COLLINEAR:{\n stack.push(pi);\n break;\n }\n }\n }\n return stack;\n }",
"private int little1D(int lv, int s, int e, int c, final WaveletMatrix wm) {\n\t\tint result = 0;\n\t\tc <<= ~lv;\n\t\tfor (; lv >= 0; c <<= 1, lv--) {\n\t\t\tSuccinctBitVector sbv = wm.mWM[lv];\n\t\t\tint s1 = sbv.rank1(s);\n\t\t\tint e1 = sbv.rank1(e);\n\t\t\tif (c < 0) {\n\t\t\t\t// If bit of c is 1, the 0's children are always less than c. So add the number of 0's children to result.\n\t\t\t\tif (s1 < e1) {\n\t\t\t\t\tresult += (e - e1) - (s - s1); // equivalent to e0 - s0\n\t\t\t\t\ts = s1 + wm.mZ[lv];\n\t\t\t\t\te = e1 + wm.mZ[lv];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tresult += e - s;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\ts -= s1;\n\t\t\t\te -= e1;\n\t\t\t\tif (s >= e) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}",
"public boolean isAdjacentFloor(int x, int y) {\n Position pUp = new Position(x, y + 1);\n Position pDown = new Position(x, y - 1);\n Position pLeft = new Position(x - 1, y);\n Position pRight = new Position(x + 1, y);\n Position pUpLeft = new Position(x - 1, y + 1);\n Position pUpRight = new Position(x + 1, y + 1);\n Position pDownLeft = new Position(x - 1, y - 1);\n Position pDownRight = new Position(x + 1, y - 1);\n if (pUp.y < worldHeight - 1) {\n if (world[pUp.x][pUp.y].equals(Tileset.FLOOR)) {\n return true;\n }\n }\n if (pDown.y > 0) {\n if (world[pDown.x][pDown.y].equals(Tileset.FLOOR)) {\n return true;\n }\n }\n if (pLeft.x > 0) {\n if (world[pLeft.x][pLeft.y].equals(Tileset.FLOOR)) {\n return true;\n }\n }\n if (pRight.x < worldWidth - 1) {\n if (world[pRight.x][pRight.y].equals(Tileset.FLOOR)) {\n return true;\n }\n }\n if (pUpLeft.y < worldHeight - 1 && pUpLeft.x > 0) {\n if (world[pUpLeft.x][pUpLeft.y].equals(Tileset.FLOOR)) {\n return true;\n }\n }\n if (pUpRight.y < worldHeight - 1 && pUpRight.x < worldWidth - 1) {\n if (world[pUpRight.x][pUpRight.y].equals(Tileset.FLOOR)) {\n return true;\n }\n }\n if (pDownLeft.y > 0 && pDownLeft.x > 0) {\n if (world[pDownLeft.x][pDownLeft.y].equals(Tileset.FLOOR)) {\n return true;\n }\n }\n if (pDownRight.y > 0 && pDownRight.x < worldWidth - 1) {\n if (world[pDownRight.x][pDownRight.y].equals(Tileset.FLOOR)) {\n return true;\n }\n }\n return false;\n }",
"private static int dfs( int n, int level, int min ) {\n\n if (n == 0 || level >= min) return level; //returns only number of perfect squares\n\n for (int i = (int) Math.sqrt(n); i > 0; i--) { //Math.sqrt = same as prime-sieve of prime numbers\n\n min = dfs(n - ((int) Math.pow(i, 2)), level + 1, min);\n\n }\n return min;\n }",
"public static void main(String[] args) {\n\t\tint array[]={2,3,4,6};\n\t\tint n=array.length;\n\t\tint maximum=Integer.MIN_VALUE;\n\t\tint minimum=Integer.MAX_VALUE;\n\t\tfor(int i:array)\n\t\t{\n\t\t\tif(i>maximum)\n\t\t\t\tmaximum=i;\n\t\t\tif(i<minimum)\n\t\t\t\tminimum=i;\n\t\t}\n\t\t\n\t\tint mark[]=new int[maximum+2];\n\t\tint value[]=new int[maximum+2];\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tmark[array[i]]=1; // marking ki exist karta hai no need to search in the array.\n\t\t\tvalue[array[i]]=1; //har value se ek fbt to banega hi (1 node ka)\n\t\t}\n\t\tint ans=0;\n\t\tfor(int i=minimum;i<=maximum;i++){\n\t\t\tif(mark[i]==1) // element is present in the array.// we have found the first factor now find 2nd factor.\n\t\t\t{\n\t\t// find the multiples of arr[i] which are less than max value and also less than its square\n\t\t\tfor(int j=i+i ;j<=maximum && j/i<=i;j=j+i)\n\t\t\t{\n\t\t\t\tif(mark[j]==1 && mark[j/i]==1) // i is the first factor and j/i is the 2nd factor.j is the product that serves as root.\n\t\t\t\t{\n\t\t\t\t\t// value =all combination of left child with right child.\n\t\t\t\t\tvalue[j]=value[j] + (value[i] * value[j/i]);\n\t\t\t\t\t\n\t\t\t\t\t// if the 2 child are not same then one more orientation.\n\t\t\t\t\tif(i!=(j/i))\n\t\t\t\t\t\tvalue[j]=value[j] + (value[i] * value[j/i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t}\n\t\t\tans=ans+value[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}",
"@Override\n\tpublic void run() {\n\t\tMap<Integer, Integer> roots = new TreeMap<Integer, Integer>();\n\t\t\n\t\tEdge[] edges = new Edge[this.edges.length];\n\t\tint n, weight, relevantEdges, root, lowerBound = 0;\n\t\n\t\t// Sort edges by weight.\n\t\tquickSort(0, this.edges.length - 1);\n\t\n\t\t// Compute initial lower bound (best k - 1 edges).\n\t\t// Choosing the cheapest k - 1 edges is not very intelligent. There is no guarantee\n\t\t// that this subset of edges even induces a subgraph over the initial graph.\n\t\t// TODO: Find a better initial lower bound.\n\t\tfor (int i = 0; i < solution.length; i++) {\n\t\t\tlowerBound += this.edges[i].weight;\n\t\t}\n\t\n\t\t// Iterate over all nodes in the graph and run Prim's algorithm\n\t\t// until k - 1 edges are fixed.\n\t\t// As all induced subgraphs have k nodes and are connected according to Prim, they\n\t\t// are candidate solutions and thus submitted.\n\t\tfor (root = 0; root < taken.length; root++) {\n\t\t\ttaken = new boolean[taken.length];\n\t\t\tSystem.arraycopy(this.edges, 0, edges, 0, this.edges.length);\n\n\t\t\ttaken[root] = true;\n\t\t\tn = 0;\n\t\t\tweight = 0;\n\t\t\trelevantEdges = this.edges.length;\n\n\t\t\twhile (n < solution.length) { \n\t\t\t\tfor (int i = 0; i < relevantEdges; i++) {\n\t\t\t\t\t// XOR to check if connected and no circle.\n\t\t\t\t\tif (taken[edges[i].node1] ^ taken[edges[i].node2]) {\n\t\t\t\t\t\ttaken[taken[edges[i].node1] ? edges[i].node2 : edges[i].node1] = true;\n\t\t\t\t\t\tsolution[n++] = edges[i];\n\t\t\t\t\t\tweight += edges[i].weight;\n\t\t\t\t\t\tSystem.arraycopy(edges, i + 1, edges, i, --relevantEdges - i);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t// Check for circle.\n\t\t\t\t\telse if (taken[edges[i].node1]) {\n\t\t\t\t\t\tSystem.arraycopy(edges, i + 1, edges, i, --relevantEdges - i);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Sum up what we've just collected and submit this\n\t\t\t// solution to the framework.\n\t\t\tHashSet<Edge> set = new HashSet<Edge>(solution.length);\n\t\t\tfor (int i = 0; i < solution.length; i++) {\n\t\t\t\tset.add(solution[i]);\n\t\t\t}\n\t\t\tsetSolution(weight, set);\n\t\t\troots.put(weight, root);\n\t\t}\n\n\t\t// Now for the real business, let's do some Branch-and-Bound. Roots of \"k Prim Spanning Trees\"\n\t\t// are enumerated by weight to increase our chances to obtain the kMST earlier.\n\t\tfor (int item : roots.values()) {\n\t\t\ttaken = new boolean[taken.length];\n\t\t\tSystem.arraycopy(this.edges, 0, edges, 0, this.edges.length);\n\t\t\ttaken[item] = true;\n\t\t\tbranchAndBound(edges, solution.length, 0, lowerBound);\n\t\t}\n\t}",
"@Override\n public ArrayList<ArrayList<String>> getNeighborhood(ArrayList<String> point, double argument1, double argument2) {\n ArrayList<ArrayList<String>> neighborhood = new ArrayList<>();\n String[] moves = {\"U\", \"D\", \"L\", \"R\"};\n if(point.size() == 0){\n point.add(moves[(int)(Math.random()*4)]);\n }\n\n //kazde rozwiązanie powstaje przez wstawienie każdego ruchu w środku ścieżki\n for(int i = 0; i<point.size(); i++){\n for(String move : moves){\n ArrayList<String> newPath = arrayListDeepCopy(point);\n newPath.add(i, move);\n newPath = cleanUpPath(newPath);\n if(testFunction.check(newPath)) neighborhood.add(newPath);\n }\n for(String move : moves){\n ArrayList<String> newPath = arrayListDeepCopy(point);\n newPath.add(i, move);\n newPath.add(i, move);\n newPath = cleanUpPath(newPath);\n if(testFunction.check(newPath)) neighborhood.add(newPath);\n }\n }\n\n //kazde rozwiązanie powstaje przez usunięcie jednego elementu\n for(int i=0; i<point.size(); i++){\n ArrayList<String> newPath = arrayListDeepCopy(point);\n newPath.remove(i);\n newPath = cleanUpPath(newPath);\n if(testFunction.check(newPath)) neighborhood.add(newPath);\n }\n\n //kazde rozwiązanie powstaje przez swapowanie wszystkich z losowym\n int random = (int)(Math.random()*point.size());\n for(int i=0; i<point.size(); i++){\n ArrayList<String> newPath = arrayListDeepCopy(point);\n newPath.set(i, point.get(random));\n newPath.set(random, point.get(i));\n newPath = cleanUpPath(newPath);\n if(testFunction.check(newPath)) neighborhood.add(newPath);\n }\n\n //System.out.println(neighborhood.size());\n\n ArrayList<ArrayList<String>> newNeighborhood = new ArrayList<>();\n for (int i = 0; i < neighborhood.size(); i++) {\n newNeighborhood.add(shortenPath(neighborhood.get(i)));\n }\n\n return newNeighborhood;\n }",
"public Point[] nearestPair() {\n\t\t\tPoint[] Answer = new Point[2];\n\t\t\tif (this.size<2)\treturn null; //step 1\n\t\t\tif (this.size==2){\n\t\t\t\tAnswer[0]=this.minx.getData();\n\t\t\t\tAnswer[1]=this.maxx.getData();\n\t\t\t\treturn Answer;\t\t\t\n\t\t\t}\n\t\t\tdouble MinDistance=-1; // for sure it will be change in the next section, just for avoid warrning.\n\t\t\tdouble MinDistanceInStrip=-1;\n\t\t\tPoint[] MinPointsLeft = new Point[2];\n\t\t\tPoint[] MinPointsRight = new Point[2];\n\t\t\tPoint[] MinPointsInStrip = new Point[2]; // around the median\n\t\t\tboolean LargestAxis = getLargestAxis(); //step 2\n\t\t\tContainer median = getMedian(LargestAxis); //step 3\n\t\t\tif (LargestAxis){// step 4 - calling the recursive function nearestPairRec\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(this.minx.getData().getX(), median.getData().getX(),LargestAxis), LargestAxis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(median.getNextX().getData().getX(), this.maxx.getData().getX(),LargestAxis), LargestAxis);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(this.miny.getData().getY(), median.getData().getY(),LargestAxis), LargestAxis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(median.getNextY().getData().getY(), this.maxy.getData().getY(),LargestAxis), LargestAxis);\n\t\t\t}\n\t\t\t//step 5\n\t\t\tif (MinPointsLeft!=null && MinPointsRight!=null){\n\t\t\t\tif (Distance(MinPointsLeft[0], MinPointsLeft[1]) > Distance(MinPointsRight[0], MinPointsRight[1])){\n\t\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\t\tAnswer = MinPointsRight;\n\t\t\t\t}else{\n\t\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (MinPointsLeft!=null) {\n\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t}\n\t\t\telse if (MinPointsRight!=null){\n\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\tAnswer = MinPointsRight;\n\t\t\t}\n\t\t\t//step 6 - nearest point around the median\n\t\t\tif (MinDistance==-1) MinDistance=0;\n\t\t\tMinPointsInStrip = nearestPairInStrip(median, MinDistance*2, LargestAxis);\n\t\t\tif (MinPointsInStrip != null){\n\t\t\t\tMinDistanceInStrip = Distance(MinPointsInStrip[0], MinPointsInStrip[1]);\n\t\t\t\tif (MinDistanceInStrip < MinDistance) return MinPointsInStrip;\n\t\t\t}\n\t\t\treturn Answer;\n\t\t}",
"NBLK(int[][] origMap) {\r\n\r\n\t\t\r\n\t\t// suppose it's a matrix for numberlink\r\n\t\tn_row = origMap.length;\r\n\t\tn_col = origMap[0].length;\r\n\t\tlength = n_row * n_col;\r\n\t\tadjaMatrix=new int[length][length];\r\n\t\tStartPoint=new HashMap<Integer, Node>();\r\n\t\tEndPoint=new HashMap<Integer, Node>();\r\n\t\tnowMap= new HashMap<Integer,LinkedList<Integer>>();\r\n\t\t\r\n\t\tpaths=new HashMap<Integer, Stack<Node>>();\r\n\t\tallNodes= new HashMap<Integer,Node>();\r\n\t\t\r\n\t\t\r\n\t\tlastPath=0;\r\n\t\t\r\n\t\tcount=0;\r\n\t\tfor (int i = 0; i < n_row; i++) {\r\n\t\t\tfor (int j = 0; j < n_col; j++) {\r\n\t\t\t\tif (origMap[i][j] > -1) {\r\n\t\t\t\t\t//we can use that point to represent a blocked point (i,j) as matrix[i][j]=-1\r\n\t\t\t\t\tint index = i * n_col + j;\r\n\t\t\t\t\tNode n = new Node(i, j, index, origMap[i][j]);\r\n\t\t\t\t\tallNodes.put(index, n);\r\n\t\t\t\t\tLinkedList<Integer> neibors = new LinkedList<Integer>();\r\n\r\n\t\t\t\t\tif (i > 0 && origMap[i-1][j] > -1) {\r\n\t\t\t\t\t\t//left\r\n\t\t\t\t\t\tadjaMatrix[index][(i - 1) * n_col + j] = 1;\r\n\t\t\t\t\t\tadjaMatrix[(i - 1) * n_col + j][index] = 1;\r\n\t\t\t\t\t\tneibors.addLast((i - 1) * n_col + j);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (i < n_row - 1 && origMap[i+1][j] > -1) {\r\n\t\t\t\t\t\t//right\r\n\t\t\t\t\t\tadjaMatrix[index][(i + 1) * n_col + j] = 1;\r\n\t\t\t\t\t\tadjaMatrix[(i + 1) * n_col + j][index] = 1;\r\n\t\t\t\t\t\tneibors.addLast((i + 1) * n_col + j);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (j > 0 && origMap[i][j-1] > -1) {\r\n\t\t\t\t\t\t//top\r\n\t\t\t\t\t\tadjaMatrix[index][i * n_col + j - 1] = 1;\r\n\t\t\t\t\t\tadjaMatrix[i * n_col + j - 1][index] = 1;\r\n\t\t\t\t\t\tneibors.addLast(i * n_col + j - 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (j < n_col - 1 && origMap[i][j+1] > -1) {\r\n\t\t\t\t\t\t//bottom\r\n\t\t\t\t\t\tadjaMatrix[index][i * n_col + j + 1] = 1;\r\n\t\t\t\t\t\tadjaMatrix[i * n_col + j + 1][index] = 1;\r\n\t\t\t\t\t\tneibors.addLast(i * n_col + j + 1);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tnowMap.put(index, neibors);\r\n\t\t\t\t\tif (origMap[i][j] > 0) {\r\n\r\n\t\t\t\t\t\tif (!StartPoint.containsKey(origMap[i][j])) {\r\n\t\t\t\t\t\t\tStartPoint.put(origMap[i][j], n);\r\n\t\t\t\t\t\t\tStack<Node> tp = new Stack<Node>();\r\n\t\t\t\t\t\t\ttp.push(n);\r\n\t\t\t\t\t\t\tpaths.put(origMap[i][j], tp);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tEndPoint.put(origMap[i][j], n);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}",
"private void intervalsRootScan(SearchContext ctx, Intervals result) {\n\t\tfinal int dimension = numDim;\n\t\tfinal int[] mins = ctx.qmins;\n\t\tfinal int[] maxs = ctx.qmaxs;\n\t\tfinal SearchNode curNode = ctx.current();\n\t\tfinal int contained = curNode.contained;\n\t\tfinal int rootStart = curNode.rootStart;\n\t\tfinal int rootEnd = rootStart + curNode.width;\n\t\tfinal int notContained = dimension - Integer.bitCount(contained);;\n\t\tint intervalStart = -1;\n\t\tif (notContained == 1) {\n\t\t\t// sequential-scan on final dimension\n\t\t\tfinal int last1d = Integer.numberOfLeadingZeros(~contained);\n\t\t\tfinal int[] basearray = zoPoints[last1d];\n\t\t\tfinal int min = mins[last1d];\n\t\t\tfinal int max = maxs[last1d];\n\t\t\tfor (int j = rootStart; j < rootEnd; j++) {\n\t\t\t\tint val = basearray[j];\n\t\t\t\tif (val >= min && val <= max) {\n\t\t\t\t\tif (intervalStart < 0) {\n\t\t\t\t\t\tintervalStart = j;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (intervalStart >= 0) {\n\t\t\t\t\t\tresult.addRoot(intervalStart, j);\n\t\t\t\t\t\tintervalStart = -1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// sequential-scan on not contained dimensions\n\t\t\tfinal int[] dims = ctx.work1;\n\t\t\tfor (int ptr = 0, d = 0; d < dimension; d++) {\n\t\t\t\tif (contained << d < 0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tdims[ptr++] = d;\n\t\t\t}\n\t\t\tJLOOP: for (int j = rootStart; j < rootEnd; j++) {\n\t\t\t\tfor (int ptr = 0; ptr < notContained; ptr++) {\n\t\t\t\t\tfinal int d = dims[ptr];\n\t\t\t\t\tfinal int val = zoPoints[d][j];\n\t\t\t\t\tif (val < mins[d] || val > maxs[d]) {\n\t\t\t\t\t\tif (intervalStart >= 0) {\n\t\t\t\t\t\t\tresult.addRoot(intervalStart, j);\n\t\t\t\t\t\t\tintervalStart = -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue JLOOP;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (intervalStart < 0) {\n\t\t\t\t\tintervalStart = j;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (intervalStart >= 0) {\n\t\t\tresult.addRoot(intervalStart, rootEnd);\n\t\t}\n\t}",
"public int findMin(int[] nums) {\n\t\t// corner\n\t\tif (nums.length == 1) {\n\t\t\treturn nums[0];\n\t\t}\n\t\t// Not rotated.\n\t\tif (nums[0] < nums[nums.length - 1]) {\n\t\t\treturn nums[0];\n\t\t}\n\n\t\t// Binary Search.\n\t\tint left = 0;\n\t\tint right = nums.length - 1;\n\t\t// int right = nums.length; // NG! (R = M version)\n\t\twhile (left <= right) {\n\t\t\t// while (left < right) { // NG! (R = M version)\n\t\t\tint mid = left + (right - left) / 2;\n\n\t\t\t// Find the valley.\n\t\t\t// nums[mid + 1] could cause array index out of bound when nums[mid] is the last\n\t\t\t// element.\n\t\t\t// However, for this problem, when nums[mid] is the second to the last, it\n\t\t\t// returns and\n\t\t\t// nums[mid] never reaches to the last element.\n\t\t\t// R = M version is NG because nums[mid] skips the second to the last and hits\n\t\t\t// the last\n\t\t\t// element depending on the case, in which case, nums[mid + 1] causes array\n\t\t\t// index out of bound.\n\t\t\tif (nums[mid] > nums[mid + 1]) {\n\t\t\t\treturn nums[mid + 1];\n\t\t\t}\n\t\t\t// Assert nums[mid] < nums[mid + 1] (no duplicates)\n\n\t\t\t// nums[mid - 1] could cause array index out of bound when the target is the\n\t\t\t// first element or\n\t\t\t// the second element.\n\t\t\t// However, for this problem, the code above returns when mid is equal to 0.\n\t\t\t// To be exact, when you use R = M - 1 version, mid is approaching index 0 as\n\t\t\t// the following:\n\t\t\t// 1. 2 -> 0 -> 1\n\t\t\t// 2. 3 -> 1 -> 0\n\t\t\t// ex) 1. [ 5, 1, 2, 3, 4 ], 2. [ 6, 1, 2, 3, 4, 5]\n\t\t\t// For case 1, the code above returns when mid is equal to 0, and nums[-1] never\n\t\t\t// occurs.\n\t\t\t// For case 2, the code below returns when mid is equal to 1, and nums[-1] never\n\t\t\t// occurs.\n\t\t\t//\n\t\t\t// Be careful!\n\t\t\t// Not rotated array can cause nums[-1] here for both of the two cases above\n\t\t\t// because\n\t\t\t// the code above does not return when mid is equal to 0, which causes index out\n\t\t\t// of bound here.\n\t\t\t// So, eliminate this case in advance.\n\t\t\tif (nums[mid - 1] > nums[mid]) {\n\t\t\t\treturn nums[mid];\n\t\t\t}\n\n\t\t\t// If the mid does not hit the valley, then keep searching.\n\t\t\t// I don't know why nums[mid] > nums[0] is ok in the LeetCode solution yet.\n\t\t\t// (No need to explore any further)\n\t\t\tif (nums[mid] > nums[left]) {\n\t\t\t\t// The min is in the right subarray.\n\t\t\t\tleft = mid + 1;\n\t\t\t} else {\n\t\t\t\t// The min is in the left subarray.\n\t\t\t\tright = mid - 1;\n\t\t\t\t// right = mid; // NG! (R = M version)\n\t\t\t}\n\t\t}\n\n\t\treturn -1;\n\t}",
"public static FPoint2[] findSnapErrors(Grid grid, SnapArrangement ar) {\n\n DArray a = new DArray();\n do {\n extractSnapPoints(ar);\n\n // construct a list of segment sections between snap points\n DArray fragList = new DArray();\n FRect fragBounds = null;\n\n Graph g = ar.getGraph();\n for (int jj = 0; jj < ar.nNodes(); jj++) {\n int id1 = jj + ar.idBase();\n for (int kk = 0; kk < g.nCount(id1); kk++) {\n int id2 = g.neighbor(id1, kk);\n if (id2 < id1)\n continue;\n\n // Segment seg = segs[i];\n // for (int j = 0; j < seg.nSnapPoints() - 1; j++) {\n Endpoints ep = new Endpoints(grid, ar.hotPixel(id1), ar.hotPixel(id2));\n if (fragBounds == null)\n fragBounds = new FRect(ep.v0, ep.v1);\n fragBounds.add(ep.v0);\n fragBounds.add(ep.v1);\n fragList.add(ep);\n }\n }\n\n if (fragList.isEmpty())\n break;\n\n // to speed up this process, divide bounds into a grid of bucket/pixels.\n // Each bucket contains the fragments whose minimum bounding rectangles\n // intersect the bucket's pixel. \n // Thus we need only compare fragments against others from the same bucket.\n\n int nBuckets = Math.max(1, ar.nNodes() / 60);\n DArray[] buckets = new DArray[nBuckets * nBuckets];\n {\n double bWidth = fragBounds.width / nBuckets, bHeight = fragBounds.height\n / nBuckets;\n for (int i = 0; i < buckets.length; i++)\n buckets[i] = new DArray();\n for (int i = 0; i < fragList.size(); i++) {\n Endpoints e = (Endpoints) fragList.get(i);\n // add endpoint to every bucket it may intersect\n int y0 = (int) ((Math.min(e.v0.y, e.v1.y) - fragBounds.y) / bHeight);\n int y1 = MyMath.clamp(\n (int) ((Math.max(e.v0.y, e.v1.y) - fragBounds.y) / bHeight), 0,\n nBuckets - 1);\n int x0 = (int) ((Math.min(e.v0.x, e.v1.x) - fragBounds.x) / bWidth);\n int x1 = MyMath.clamp(\n (int) ((Math.max(e.v0.x, e.v1.x) - fragBounds.x) / bWidth), 0,\n nBuckets - 1);\n\n for (int y = y0; y <= y1; y++) {\n for (int x = x0; x <= x1; x++) {\n buckets[y * nBuckets + x].add(e);\n }\n }\n }\n }\n\n final double NEARZERO = .00001;\n\n for (int k = 0; k < buckets.length; k++) {\n DArray b = buckets[k];\n for (int i = 0; i < b.size(); i++) {\n Endpoints ei = (Endpoints) b.get(i);\n\n for (int j = i + 1; j < b.size(); j++) {\n Endpoints ej = (Endpoints) b.get(j);\n\n FPoint2 pt = MyMath.lineSegmentIntersection(ei.v0, ei.v1, ej.v0,\n ej.v1, null);\n if (pt == null)\n continue;\n String err = null;\n\n // make sure the intersection occurs at an endpoint of each\n double di = Math.min(pt.distance(ei.v0), pt.distance(ei.v1));\n double dj = Math.min(pt.distance(ej.v0), pt.distance(ej.v1));\n\n // in triangle grid, fragment endpoint can lie on other fragment.\n // To eliminate this possibility, intersection point must be\n // distinct from all four endpoints.\n\n if (Math.min(di, dj) > NEARZERO) {\n err = \"\";\n }\n if (err != null) {\n a.add(pt);\n // a.add(err);\n }\n }\n }\n }\n } while (false);\n return (FPoint2[]) a.toArray(FPoint2.class);\n }",
"public static void main(String[] args) {\n Random r = new Random();\n// r.setSeed(1982);\n int R = 500;\n int L = 100000;\n\n int start = -500;\n int end = 500;\n HashSet<Point> hi3 = new HashSet<>();\n List<Point> hi5 = new ArrayList<>();\n Stopwatch sw = new Stopwatch();\n for (int i = 0; i < L; i += 1) {\n double ran = r.nextDouble();\n double x = start + (ran * (end - start));\n ran = r.nextDouble();\n double y = start + (ran * (end - start));\n Point temp = new Point(x, y);\n hi5.add(temp);\n\n }\n KDTree speedTest = new KDTree(hi5);\n NaivePointSet speedTest2 = new NaivePointSet(hi5);\n\n// for (int i = 0; i < 1000; i++) {\n// double ran = r.nextDouble();\n// double x2 = start + (ran *(end - start));\n// ran = r.nextDouble();\n// double y2 = start + (ran *(end - start));\n// assertEquals(speedTest2.nearest(x2, y2), speedTest.nearest(x2, y2 ));\n// }\n// assertEquals(speedTest2.nearest(r.nextInt(R + 1 - 500) + 500,\n// r.nextInt(R + 1 - 500) + 100), speedTest.nearest(427.535670, -735.656403));\n\n System.out.println(\"elapsed time1: \" + sw.elapsedTime());\n\n int R2 = 100;\n int L2 = 10000;\n Stopwatch sw2 = new Stopwatch();\n for (int i = 0; i < L2; i += 1) {\n\n speedTest2.nearest(r.nextDouble(), r.nextDouble());\n }\n\n System.out.println(\"elapsed time: \" + sw2.elapsedTime());\n }",
"void segregate0and1(int arr[], int size)\n {\n int left = 0;\n int right = size - 1;\n while(left < right){\n while(arr[left] !=1 && left< right){\n left ++;\n }\n while(arr[right] !=0 && left < right){\n right --;\n }\n if(left != right){\n int tmp = arr[left];\n arr[left] = arr[right];\n arr[right] = tmp;\n left ++;\n right -- ;\n }\n }\n }",
"private int recurse(int[] numbers, int left, int right) {\n\n // Base Case\n if (left >= right) {\n return numbers[right] >= 0 ? 1 : 0;\n }\n\n // Divide\n int center = (left + right) / 2;\n int leftCount = this.recurse(numbers, left, center);\n int rightCount = this.recurse(numbers, center+1, right);\n\n // Merge\n return leftCount+rightCount;\n }",
"public int shortestBridge(int[][] A) {\n for(int i = 0; i < A.length; i++) {\n if(found) {\n break;\n }\n for(int j = 0; j < A[0].length; j++) {\n if(A[i][j] == 1) {\n helper(A, i, j);\n found = true;\n break;\n }\n }\n }\n // Put all '2' into queue as candidate initial start points\n Queue<int[]> q = new LinkedList<int[]>();\n for(int i = 0; i < A.length; i++) {\n for(int j = 0; j < A[0].length; j++) {\n if(A[i][j] == 2) {\n q.offer(new int[] {i, j});\n }\n }\n }\n int distance = 0;\n while(!q.isEmpty()) {\n int size = q.size();\n for(int i = 0; i < size; i++) {\n int[] cur = q.poll();\n for(int j = 0; j < 4; j++) {\n int new_x = cur[0] + dx[j];\n int new_y = cur[1] + dy[j];\n if(new_x >= 0 && new_x < A.length && new_y >= 0 && new_y < A[0].length) {\n if(A[new_x][new_y] == 1) {\n return distance;\n } else if(A[new_x][new_y] == 0) {\n // Update from 0 to 2 which means expand first island boundary\n // which also avoid using visited to check\n A[new_x][new_y] = 2;\n q.offer(new int[] {new_x, new_y});\n }\n }\n }\n }\n distance++;\n }\n return distance;\n }",
"public int[] mRtreeFromSource(int s,int k){\n double INFINITY = Double.MAX_VALUE;\n boolean[] SPT = new boolean[intersection];\n double[] d = new double[intersection];\n int[] parent = new int[intersection];\n\n for (int i = 0; i <intersection ; i++) {\n d[i] = INFINITY;\n parent[i] = -1;\n }\n\n d[s] = 0;\n parent[s]=s;\n\n MinHeap minHeap = new MinHeap(k);\n for (int i = 0; i <intersection ; i++) {\n minHeap.add(i,d[i]);\n }\n while(!minHeap.isEmpty()){\n\n int extractedVertex = minHeap.extractMin();\n\n if(d[extractedVertex]==INFINITY)\n break;\n\n SPT[extractedVertex] = true;\n\n LinkedList<Edge> list = g.adjacencylist[extractedVertex];\n for (int i = 0; i <list.size() ; i++) {\n Edge edge = list.get(i);\n int destination = edge.destination;\n if(SPT[destination]==false ) {\n\n double newKey = edge.weight ; //the different part with previous method\n double currentKey = d[destination];\n if(currentKey>=newKey){\n if(currentKey==newKey){\n if(extractedVertex<parent[destination]){\n minHeap.updateKey(newKey, destination, d[destination]);\n parent[destination] = extractedVertex;\n d[destination] = newKey;\n }\n }\n else {\n minHeap.updateKey(newKey, destination, d[destination]);\n parent[destination] = extractedVertex;\n d[destination] = newKey;\n }\n }\n }\n }\n }\n return parent;\n }",
"private float[] getBounds(TileCoolantPipe tile) {\n float[] bounds = new float[6];\n boolean[] connected = tile.getConnectedSides();\n float hDiameter = cableDiameter / 2.0F;\n for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {\n float width = 0.5F;\n if (!connected[dir.ordinal()]) {//(sides & dir.flag) != dir.flag) {\n width = hDiameter;\n }\n if (dir.ordinal() % 2 == 0) {\n width *= -1;\n }\n bounds[dir.ordinal()] = 0.5F + width;\n }\n return bounds;\n }",
"private static void dfsBribe(int n, List<Integer>[] ch, long[] w) {\n if (ch[n].size() == 0){\n In[n] = w[n];\n OutD[n] = Long.MAX_VALUE;\n OutU[n] = 0;\n }\n //recurrance case: non.leaf, do dfs for all subordinates then calculate In, OutUp & OutDown.\n else{\n for (int c:ch[n])\n dfsBribe(c, ch, w); //running once for each child thereby O(N)\n In[n] = w[n];\n for (int c:ch[n]){ //O(N) running time\n In[n] += OutU[c];\n OutU[n] += Math.min(In[c], OutD[c]);\n OutD[n] += Math.min(In[c], OutD[c]);\n }\n OutD[n] += delta(n, ch); //add delta for no in Children\n }\n\n }",
"public static void main(String[] args) {\n\t\tint width=35;\n\t\tint length=31;\n\t\tlong[][] dp = new long[width+1][length+1];\n\t\tdp[0][0]=0;\n\t\tfor(int i=1;i<length+1;i++){\n\t\t\tif(badCheck(0,i,0,i-1)){\n\t\t\t\tdp[0][i]=0;\n\t\t\t\tfor(int k=i+1;k<length+1;k++){\n\t\t\t\t\tdp[0][k]=0;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}else{\n\t\t\t\tdp[0][i]=1;\n\t\t\t}\n\t\t}\n\t\tfor(int i=1;i<width+1;i++){\n\t\t\tif(badCheck(i,0,i-1,0)){\n\t\t\t\tdp[i][0]=0;\n\t\t\t\tfor(int k=i+1;k<width+1;k++){\n\t\t\t\t\tdp[k][0]=0;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}else{\n\t\t\t\tdp[i][0]=1;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i=1;i<=width;i++){\n\t\t\tfor(int j=1;j<=length;j++){\n\t\t\t\tif(!badCheck(i-1,j,i,j)){\n\t\t\t\t\tdp[i][j]+=dp[i-1][j];\n\t\t\t\t}\n\t\t\t\tif(!badCheck(i,j-1,i,j)){\n\t\t\t\t\tdp[i][j]+=dp[i][j-1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//System.out.println(dp[6][6]);\n\t\t//System.out.println(dp[2][2]);\n\t\t//System.out.println(dp[1][1]);\n\t\tSystem.out.println(dp[35][31]);\n\t}",
"private static Array<int[]> findAllOpenAreas(int[][] board, int width, int height) {\n Array<int[]> positions = new Array<int[]>();\n boolean[][] good = new boolean[board.length][board[0].length];\n\n // go across horizontally, finding areas where the rectangle may fit\n // width wise\n for (int y = 1; y < board[0].length-1; ++y) {\n int horizontal_count = 0;\n for (int x = 1; x < board.length-1; ++x) {\n // count up in areas where there is no room\n if (board[x][y] == NULL)\n horizontal_count++;\n // if we encounter a room, the rectangle can not fit there\n else\n horizontal_count = 0;\n\n // when we've reached the edge of our rectangle's width\n // we can mark that this is a safe place to measure from\n if (horizontal_count == width) {\n good[x - width + 1][y] = true;\n // increment back one in case the next space is also\n // acceptable for being a rectangle\n horizontal_count--;\n }\n }\n }\n\n // now that count verticals we have established good lines of where a\n // rectangle may start\n // we need to count vertically down where it can fit\n\n for (int x = 0; x < board.length; ++x) {\n int vertical_count = 0;\n for (int y = 0; y < board[0].length; ++y) {\n // check against only the points that we flagged as potentially\n // okay\n if (good[x][y])\n vertical_count++;\n // if we didn't flag that point, then we can't fit a rectangle\n // there vertically\n else\n vertical_count = 0;\n\n // when our rectangle is fully formed, we can add it as a\n // plausible location\n if (vertical_count == height) {\n positions.add(new int[] { x, y - height + 1 });\n vertical_count--;\n }\n }\n }\n\n return positions;\n }",
"public static void main(String[] args) {\n \n PointSET pset = new PointSET();\n System.out.println(\"Empty: \" + pset.isEmpty());\n pset.insert(new Point2D(0.5, 0.5));\n pset.insert(new Point2D(0.5, 0.5));\n pset.insert(new Point2D(0.5, 0.6));\n pset.insert(new Point2D(0.5, 0.7));\n pset.insert(new Point2D(0.5, 0.8));\n pset.insert(new Point2D(0.1, 0.5));\n pset.insert(new Point2D(0.8, 0.5));\n pset.insert(new Point2D(0.1, 0.1));\n System.out.println(\"Empty: \" + pset.isEmpty());\n System.out.println(\"Size: \" + pset.size());\n System.out.println(\"Nearest to start: \" + pset.nearest(new Point2D(0.0, 0.0)));\n System.out.println(\"Contains #1: \" + pset.contains(new Point2D(0.0, 0.0)));\n System.out.println(\"Contains #2: \" + pset.contains(new Point2D(0.5, 0.5)));\n System.out.print(\"Range #1: \");\n for (Point2D p : pset.range(new RectHV(0.001, 0.001, 0.002, 0.002)))\n System.out.print(p.toString() + \"; \");\n System.out.print(\"\\n\");\n System.out.print(\"Range #2: \");\n for (Point2D p : pset.range(new RectHV(0.05, 0.05, 0.15, 0.15)))\n System.out.print(p.toString() + \"; \");\n System.out.print(\"\\n\");\n System.out.print(\"Range #3: \");\n for (Point2D p : pset.range(new RectHV(0.25, 0.35, 0.65, 0.75)))\n System.out.print(p.toString() + \"; \");\n System.out.print(\"\\n\");\n \n }",
"public int findSpanningTree(List<Graph.Edge> edges) {\n while (!isSpanningTree()) {\n toZeroWeightGraph();\n shrinkComponents();\n }\n return populateEdges(edges);\n }",
"private static int buildSegmentTree(int[] arr, int[] segtree, int beg, int end, int treeIndex) {\n if (beg == end) {\n segtree[treeIndex] = arr[beg];\n } else {\n // recursive case\n int mid = (beg + end) / 2;\n int leftPart = buildSegmentTree(arr, segtree, beg, mid, 2 * treeIndex);\n int rightPart = buildSegmentTree(arr, segtree, mid + 1, end, 2 * treeIndex + 1);\n segtree[treeIndex] = Math.min(leftPart, rightPart);\n }\n return segtree[treeIndex];\n }",
"public int shortestBridge(int[][] A) {\n for(int i = 0; i < A.length && !found; i++) {\n for(int j = 0; j < A[0].length && !found; j++) {\n if(A[i][j] == 1) {\n helper(A, i, j);\n found = true;\n }\n }\n }\n // Put all '2' into queue as candidate initial start points\n Queue<int[]> q = new LinkedList<int[]>();\n for(int i = 0; i < A.length; i++) {\n for(int j = 0; j < A[0].length; j++) {\n if(A[i][j] == 2) {\n q.offer(new int[] {i, j});\n }\n }\n }\n int distance = 0;\n while(!q.isEmpty()) {\n int size = q.size();\n for(int i = 0; i < size; i++) {\n int[] cur = q.poll();\n for(int j = 0; j < 4; j++) {\n int new_x = cur[0] + dx[j];\n int new_y = cur[1] + dy[j];\n if(new_x >= 0 && new_x < A.length && new_y >= 0 && new_y < A[0].length) {\n if(A[new_x][new_y] == 1) {\n return distance;\n } else if(A[new_x][new_y] == 0) {\n // Update from 0 to 2 which means expand first island boundary\n // which also avoid using visited to check\n A[new_x][new_y] = 2;\n q.offer(new int[] {new_x, new_y});\n }\n }\n }\n }\n distance++;\n }\n return distance;\n }",
"public static int findOneDPeakRecursive(int [] nums, int low, int high) {\n if (high < low) {\n return -1;\n }\n\n int mid = (high + low)/2;\n // Conquer\n int placement = peakOneD(mid, nums);\n // Divide/Combine\n if (placement == -1) {\n return findOneDPeakRecursive(nums, low, mid);\n }\n else if (placement == 1) {\n return findOneDPeakRecursive(nums, mid + 1, high);\n }\n else {\n return mid;\n }\n }",
"public int largestIsland(int[][] grid) {\n // First of all calculate the area of all of the islands. Assign unique id to every island.\n // Island ids start from 2 because our grid already has numbers 0 and 1\n // Replace the 1's of the island with the id of the island. Create a map of the island id and the area\n // Then again iterate over every element in the grid. Now, everytime we get zero (0), replace the zero \n // with one (1) and look at all four sides of the replace one. If we have island at any side of the \n // replaced one the add the area of that island to the max area and count the replaced one in it.\n if (grid == null || grid.length == 0) {\n return 0;\n }\n \n int max = 0;\n int islandId = 2;\n int row = grid.length;\n int col = grid[0].length;\n Map<Integer, Integer> islandArea = new HashMap<Integer, Integer>();\n int[][] directions = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};\n \n // Finding the area of every island\n for (int i = 0; i < row; i++) {\n for (int j = 0; j < col; j++) {\n if (grid[i][j] == 1) {\n int sizeOfCurrentIsland = getIslandSize(grid, i, j, islandId);\n max = Math.max(max, sizeOfCurrentIsland);\n islandArea.put(islandId++, sizeOfCurrentIsland);\n }\n }\n }\n \n // Iterating over the grid again and see if we change the value of zero (0) then what would be the max\n // area of the island.\n for (int i = 0; i < row; i++) {\n for (int j = 0; j < col; j++) {\n if (grid[i][j] == 0) {\n Set<Integer> setOfIslands = new HashSet<Integer>();\n for (int[] direction : directions) {\n int x = direction[0] + i;\n int y = direction[1] + j;\n if (x > -1 && y > -1 && x < row && y < col && grid[x][y] != 0) {\n setOfIslands.add(grid[x][y]);\n }\n }\n // Count current zero as well. So, sum is initialized to 1\n int sum = 1;\n \n for (int num : setOfIslands) {\n int value = islandArea.get(num);\n sum += value;\n }\n \n max = Math.max(max, sum);\n }\n }\n }\n \n return max;\n }",
"public int shortDistanceNW(int[][] grid) {\n\t\t// steps\n\t\t// for every empty land count dist till all houses r reached\n\t\t// if dist is less than minDist update minDist\n\t\tint m = grid.length;\n\t\tint n = grid[0].length;\n\t\tint minDist = Integer.MAX_VALUE;\n\n\t\tint numOfLands = 0;\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\tif (grid[i][j] == 1)\n\t\t\t\t\tnumOfLands++;\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\t// call bfs\n\t\t\t\tif (grid[i][j] == 0)\n\t\t\t\t\tminDist = Math.min(minDist, bfsNW(grid, m, n, new int[] { i, j }, numOfLands));\n\t\t\t}\n\t\t}\n\t\treturn minDist;\n\t}",
"private void findLaneLines(int[] pixels, int row, int leftStartingX, int rightStartingX) {\n if (row > getCameraHeight() * LOOK_DIST) {\n Point lastLeftPoint = leftLine.getLeftPoint(pixels, row, getScreenWidth(), leftStartingX);\n Point lastRightPoint = rightLine.getRightPoint(pixels, row, getScreenWidth(), rightStartingX, getCameraWidth());\n leftLine.getLanePoints().add(lastLeftPoint);\n rightLine.getLanePoints().add(lastRightPoint);\n\n // If no lane was found, search from the last startingX\n if (lastLeftPoint.isEmpty() && lastRightPoint.isEmpty()) {\n findLaneLines(pixels, row - 1, leftStartingX, rightStartingX);\n\n // If Only the right lane was found, right starts from last starting X. Left starts from last startingX\n } else if (lastLeftPoint.isEmpty()) {\n int startSearchX = lastRightPoint.getX() - SEARCH_OFFSET;\n findLaneLines(pixels, row - 1, startSearchX, startSearchX);\n\n // If Only the left lane was found, left starts from last starting X. Right starts from last startingX\n } else if (lastRightPoint.isEmpty()) {\n int startSearchX = lastLeftPoint.getX() + SEARCH_OFFSET;\n findLaneLines(pixels, row - 1, startSearchX, startSearchX);\n\n // If Both lanes are found start search from last X + or - 100.\n } else {\n findLaneLines(pixels, row - 1, lastLeftPoint.getX() + SEARCH_OFFSET,\n lastRightPoint.getX() - SEARCH_OFFSET);\n }\n }\n }",
"public int maxDistance(int[][] grid) {\n boolean[][] visited = new boolean[grid.length][grid[0].length]; // mark which cells have been already been visited\n Queue<int[]> queue = new LinkedList<>();\n\n //put 1 cells into queue to start with and mark then visited\n for (int i = 0; i < grid.length; i++) {\n for (int j = 0; j < grid[0].length; j++) {\n if (grid[i][j] == 1) {\n queue.add(new int[]{i,j});\n visited[i][j] = true; //mark cell as visited\n }\n }\n }\n\n int distance = -1;\n int[][] directions = {{-1,0}, {0,1}, {1,0}, {0,-1}}; //all possible 4 directions\n while (!queue.isEmpty()) {\n int size = queue.size(); //since this is BFS we need to traverse level by level\n\n while (size > 0) { //iterate only till nodes in current level\n int[] pair = queue.poll();\n\n for (int[] direction : directions) { // check in all possible directions\n int x = pair[0] + direction[0];\n int y = pair[1] + direction[1];\n\n //if target cell is with in bounds and is not visited, add it to queue\n if (x >= 0 && x < grid.length && y >= 0 && y < grid[0].length && !visited[x][y]) {\n queue.add(new int[]{x,y});\n visited[x][y] = true;\n }\n }\n size--;\n }\n distance++; //increment the size only after level traversal is complete\n }\n\n //this is required because distance can be zero. This is possible if grid contains all 1's and all 1's are\n //consider level 1 as we are starting with them. So, need to return -1\n return distance == 0 ? -1 : distance;\n }",
"List<Long> getBestSolIntersection();",
"private static Point findFarthestState(Cells[][] wallBoard, int column, int row)\n\t{\n\t\tint tries = 100;\n\t\tint farthest = 0;\n\t\tint farthestX = 0;\n\t\tint farthestY = 0;\n\t\tPoint farthestPos = new Point();\n\n\t\t_DF = new DeadlocksFinder(wallBoard);\n\n\t\tint[][] staticDLMap = _DF.getStaticDLMap();\n\n\t\tdo\n\t\t{\n\t\t\tint i = rn.nextInt(rows);\n\t\t\tint j = rn.nextInt(columns);\n\n\t\t\tif(board[i][j]==Cells.FLOOR && staticDLMap[i][j]!=1 && canStillReachEveryCrates(wallBoard, j, i))\n\t\t\t{\n\t\t\t\tArrayList<Point> path = _PF.findAReversedWay(column, row, j, i);\n\t\t\t\tint distance = path.size();\n\n\t\t\t\tif(distance==0)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tPoint ppos = new Point((int)path.get(path.size()-1).getX(), (int)path.get(path.size()-1).getY());\n\n\t\t\t\tif(distance > farthest)\n\t\t\t\t{\n\t\t\t\t\tfarthestX=j;\n\t\t\t\t\tfarthestY=i;\n\t\t\t\t\tfarthest=distance;\n\t\t\t\t\tfarthestPos=ppos;\n\t\t\t\t}\n\t\t\t}\n\t\t} while(tries-->0);\n\t\t\t\t\n\n\n\t\t/*for(int i=0; i<rows; i++)\n\t\t{\n\t\t\tfor(int j=0; j<columns; j++)\n\t\t\t{\n\t\t\t\tif(board[i][j]==Cells.FLOOR && staticDLMap[i][j]!=1)// && canStillReachEveryCrates(wallBoard, j, i))\n\t\t\t\t{\n\t\t\t\t\tArrayList<Point> path = _PF.findAReversedWay(column, row, j, i);\n\t\t\t\t\tint distance = path.size();\n\n\t\t\t\t\tif(distance==0)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tPoint ppos = new Point((int)path.get(path.size()-1).getX(), (int)path.get(path.size()-1).getY());\n\n\t\t\t\t\tif(distance > farthest)\n\t\t\t\t\t{\n\t\t\t\t\t\tfarthestX=j;\n\t\t\t\t\t\tfarthestY=i;\n\t\t\t\t\t\tfarthest=distance;\n\t\t\t\t\t\tfarthestPos=ppos;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}*/\n\n\t\tplayerPos.add(farthestPos);\n\t\treturn new Point(farthestX, farthestY);\n\t}",
"private int helper(int[] nums, int left, int right) {\n if (left == right) return nums[left];\n\n int mid = (left + right) / 2;\n\n int leftSum = helper(nums, left, mid);\n int rightSum = helper(nums, mid + 1, right);\n int crossSum = crossSum(nums, left, right, mid);\n\n return Math.max(Math.max(leftSum, rightSum), crossSum);\n }",
"private List<Collection<Pixel>> holeFinder() {\n\n\t\tList<Pixel> holePixels = new LinkedList<Pixel>();\n\t\tList<Pixel> boundaryPixels = new LinkedList<Pixel>();\n\t\tQueue<Pixel> bfsQueue = new LinkedList<Pixel>();\n\t\tboolean[][] marked = new boolean[mRows][mCols];\n\n\t\tPixel pixel = findFirstHolePixel();\n\t\tbfsQueue.add(pixel);\n\t\tholePixels.add(pixel);\n\t\tmarked[pixel.getRow()][pixel.getCol()] = true;\n\n\t\twhile (!bfsQueue.isEmpty()) {\n\t\t\tPixel currentPixel = bfsQueue.remove();\n\n\t\t\tList<Pixel> connectedPixels = mConnections.getConnections(currentPixel);\n\n\t\t\t// iterates on the pixels who are connected to current pixel\n\t\t\t// if the pixel was already visited skip it\n\t\t\t// else, if the pixel is a hole add it to the list of the holes and to the BFS Queue to expand the hole\n\t\t\t// \t\t else add it to the result list, the pixel belongs to the boundary\n\t\t\tfor (Pixel p : connectedPixels) {\n\t\t\t\tint indexRow = p.getRow();\n\t\t\t\tint indexCol = p.getCol();\n\n\t\t\t\tif (!marked[indexRow][indexCol]) {\n\t\t\t\t\tmarked[indexRow][indexCol] = true;\n\n\t\t\t\t\tif (mImage[indexRow][indexCol] == HOLE) {\n\t\t\t\t\t\tholePixels.add(p);\n\t\t\t\t\t\tbfsQueue.add(p);\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\tp.setColor(mImage[p.getRow()][p.getCol()]);\n\t\t\t\t\t\tboundaryPixels.add(p);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tList<Collection<Pixel>> result = new LinkedList<Collection<Pixel>>();\n\t\tresult.add(boundaryPixels);\n\t\tresult.add(holePixels);\n\t\treturn result;\n\t}",
"public static double prepareDivideAndConquer(ArrayList<Point> P) {\n\n\t\t//Sort by X\n\t\tArrayList<Point> X = new ArrayList<Point>(P);\n\t\tsortX(X);\n\t\t//Sort by Y\n\t\tArrayList<Point> Y = new ArrayList<Point>(P);\n\t\tsortY(Y);\n\t\t//Call divide and conquer closest pairs algorithm for solution\n\t\treturn divideAndConquer(X, Y);\n\n\t}",
"public List<Integer> findMinHeightTrees(int n, int[][] edges) {\n if (n == 1)\n return Collections.singletonList(0);\n List<Set<Integer>> graph = new ArrayList<>(n);\n for (int i = 0; i < n; i++)\n graph.add(new HashSet<>());\n for (int[] edge : edges) {\n graph.get(edge[0]).add(edge[1]);\n graph.get(edge[1]).add(edge[0]);\n }\n\n List<Integer> oneDegreeNodes = new LinkedList<>();\n for (int i = 0; i < n; i++)\n if (graph.get(i).size() == 1)\n oneDegreeNodes.add(i);\n\n while (n > 2) {\n n -= oneDegreeNodes.size();\n List<Integer> oneDegreeNodes0 = new LinkedList<>();\n for (Integer oneDegreeNode : oneDegreeNodes) {\n Integer neighbor = graph.get(oneDegreeNode).iterator().next();\n graph.get(neighbor).remove(oneDegreeNode);\n if (graph.get(neighbor).size() == 1)\n oneDegreeNodes0.add(neighbor);\n }\n oneDegreeNodes = oneDegreeNodes0;\n }\n return oneDegreeNodes;\n }",
"static int Floor(int[] arr, int target){\r\n int start = 0;\r\n int end = arr.length - 1;\r\n\r\n while(start <= end){\r\n //Find the middle element\r\n int mid = start + (end - start) / 2;\r\n if (target < arr[mid]){\r\n end = mid - 1;\r\n }else if (target > arr[mid]){\r\n start = mid + 1;\r\n }else {\r\n return mid;\r\n }\r\n }\r\n return start;\r\n }",
"private LinkedList<int[]> neighborFinder(){\n LinkedList<int[]> neighborhood= new LinkedList<>();\n int[] curr_loc = blankFinder();\n int x = curr_loc[0];\n int y = curr_loc[1];\n if(x >0){\n neighborhood.add(new int[]{x-1, y});\n }\n if(x < n-1){\n neighborhood.add(new int[]{x+1, y});\n }\n if(y > 0){\n neighborhood.add(new int[]{x, y-1});\n }\n if(y < n-1) {\n neighborhood.add(new int[]{x, y+1});\n }\n\n\n return neighborhood;\n }",
"static boolean findBridge(Triangulator triRef, int ind, int i, int start,\n\t\t\t int[] ind1, int[] i1) {\n\tint i0, i2, j, numDist = 0;\n\tint ind0, ind2;\n\tBBox bb;\n\tDistance old[] = null;\n\tboolean convex, coneOk;\n\n\t// sort the points according to their distance from start.\n\tind1[0] = ind;\n\ti1[0] = i;\n\tif (i1[0] == start) return true;\n\tif (numDist >= triRef.maxNumDist) {\n\t // System.out.println(\"(1) Expanding distances array ...\");\n\t triRef.maxNumDist += triRef.INC_DIST_BK;\n\t old = triRef.distances;\n\t triRef.distances = new Distance[triRef.maxNumDist];\n\t System.arraycopy(old, 0, triRef.distances, 0, old.length);\n\t for (int k = old.length; k < triRef.maxNumDist; k++)\n\t\ttriRef.distances[k] = new Distance();\n\t}\n\n\ttriRef.distances[numDist].dist = Numerics.baseLength(triRef.points[start],\n\t\t\t\t\t\t\t triRef.points[i1[0]]);\n\ttriRef.distances[numDist].ind = ind1[0];\n\t++numDist;\n\n\n\tind1[0] = triRef.fetchNextData(ind1[0]);\n\ti1[0] = triRef.fetchData(ind1[0]);\n\twhile (ind1[0] != ind) {\n\t if (i1[0] == start) return true;\n\t if (numDist >= triRef.maxNumDist) {\n\t\t// System.out.println(\"(2) Expanding distances array ...\");\n\t\ttriRef.maxNumDist += triRef.INC_DIST_BK;\n\t\told = triRef.distances;\n\t\ttriRef.distances = new Distance[triRef.maxNumDist];\n\t\tSystem.arraycopy(old, 0, triRef.distances, 0, old.length);\n\t\tfor (int k = old.length; k < triRef.maxNumDist; k++)\n\t\t triRef.distances[k] = new Distance();\n\t }\n\n\t triRef.distances[numDist].dist = Numerics.baseLength(triRef.points[start],\n\t\t\t\t\t\t\t\t triRef.points[i1[0]]);\n\t triRef.distances[numDist].ind = ind1[0];\n\t ++numDist;\n\t ind1[0] = triRef.fetchNextData(ind1[0]);\n\t i1[0] = triRef.fetchData(ind1[0]);\n\t}\n\n\t// qsort(distances, num_dist, sizeof(distance), &d_comp);\n\tsortDistance(triRef.distances, numDist);\n\n\t// find a valid diagonal. note that no node with index i1 > start can\n\t// be feasible!\n\tfor (j = 0; j < numDist; ++j) {\n\t ind1[0] = triRef.distances[j].ind;\n\t i1[0] = triRef.fetchData(ind1[0]);\n\t if (i1[0] <= start) {\n\t\tind0 = triRef.fetchPrevData(ind1[0]);\n\t\ti0 = triRef.fetchData(ind0);\n\t\tind2 = triRef.fetchNextData(ind1[0]);\n\t\ti2 = triRef.fetchData(ind2);\n\t\tconvex = triRef.getAngle(ind1[0]) > 0;\n\n\t\tconeOk = Numerics.isInCone(triRef, i0, i1[0], i2, start, convex);\n\t\tif (coneOk) {\n\t\t bb = new BBox(triRef, i1[0], start);\n\t\t if (!NoHash.noHashEdgeIntersectionExists(triRef, bb, -1, -1, ind1[0], -1))\n\t\t\treturn true;\n\t\t}\n\t }\n\t}\n\n\t// the left-most point of the hole does not lie within the outer\n\t// boundary! what is the best bridge in this case??? I make a\n\t// brute-force decision... perhaps this should be refined during a\n\t// revision of the code...\n\tfor (j = 0; j < numDist; ++j) {\n\t ind1[0] = triRef.distances[j].ind;\n\t i1[0] = triRef.fetchData(ind1[0]);\n\t ind0 = triRef.fetchPrevData(ind1[0]);\n\t i0 = triRef.fetchData(ind0);\n\t ind2 = triRef.fetchNextData(ind1[0]);\n\t i2 = triRef.fetchData(ind2);\n\t bb = new BBox(triRef, i1[0], start);\n\t if (!NoHash.noHashEdgeIntersectionExists(triRef, bb, -1, -1, ind1[0], -1))\n\t\treturn true;\n\t}\n\n\t// still no diagonal??? yikes! oh well, this polygon is messed up badly!\n\tind1[0] = ind;\n\ti1[0] = i;\n\n\treturn false;\n }",
"KDNode(Datum[] datalist) throws Exception{\r\n\r\n\t\t\t/*\r\n\t\t\t * This method takes in an array of Datum and returns \r\n\t\t\t * the calling KDNode object as the root of a sub-tree containing \r\n\t\t\t * the above fields.\r\n\t\t\t */\r\n\r\n\t\t\t// ADD YOUR CODE BELOW HERE\t\t\t\r\n\t\t\t\r\n\t\t\tif(datalist.length == 1) {\r\n\t\t\t\t\r\n\t\t\t\tleaf = true;\r\n\t\t\t\tleafDatum = datalist[0];\r\n\t\t\t\tlowChild = null;\r\n\t\t\t\thighChild = null;\r\n\t\t\t\tnumLeaves ++;\r\n\t\t\t\t\r\n\t\t\t\treturn;\r\n\t\t\t\r\n\t\t\t}else {\r\n\t\r\n\t\t\t\tint dim = 0;\r\n\t\t\t\tint range = 0;\r\n\t\t\t\tint max = 0;\r\n\t\t\t\tint min = 0;\r\n\t\t\t\tint Max = 0;\r\n\t\t\t\tint Min = 0;\r\n\t\t\t\tfor(int i = 0; i < k; i++) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tmax = datalist[0].x[i];\r\n\t\t\t\t\tmin = datalist[0].x[i];\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor(int j = 0; j < datalist.length; j++) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(datalist[j].x[i] >= max) {\r\n\t\t\t\t\t\t\tmax = datalist[j].x[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(datalist[j].x[i] <= min) {\r\n\t\t\t\t\t\t\tmin = datalist[j].x[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(max - min >= range) {\r\n\t\t\t\t\t\trange = max - min;\r\n\t\t\t\t\t\tMax = max;\r\n\t\t\t\t\t\tMin = min;\r\n\t\t\t\t\t\tdim = i;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(range == 0) {\r\n\t\t\t\t\tleaf = true;\r\n\t\t\t\t\tleafDatum = datalist[0];\r\n\t\t\t\t\tlowChild = null;\r\n\t\t\t\t\thighChild = null;\r\n\t\t\t\t\t\r\n\t\t\t\t\tnumLeaves ++;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\t//if greatest range is zero, all points are duplicates\r\n\t\t\t\t\r\n\t\t\t\tsplitDim = dim;\r\n\t\t\t\tsplitValue = (double)(Max + Min) / 2.0;\t//get the split dim and value\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tArrayList<Datum> lList = new ArrayList<Datum>();\r\n\t\t\t\tint numL = 0;\r\n\t\t\t\tArrayList<Datum> hList = new ArrayList<Datum>();\r\n\t\t\t\tint numH = 0;\r\n\t\t\t\r\n\t\t\t\tfor(int i = 0; i < datalist.length; i ++) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(datalist[i].x[splitDim] <= splitValue) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tlList.add(datalist[i]);\r\n\t\t\t\t\t\t\tnumL ++;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\thList.add(datalist[i]);\r\n\t\t\t\t\t\tnumH ++;\r\n\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t//get the children list without duplicate but with null in the back\r\n\t\t\t\t\t//Don't check duplicates in children Nodes!!!\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tlowChild = new KDNode( lList.toArray(new Datum[numL]) );\r\n\t\t\t\thighChild = new KDNode( hList.toArray(new Datum[numH]) );\t//create the children nodes\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// ADD YOUR CODE ABOVE HERE\r\n\r\n\t\t}",
"private static float[] getPlanBounds(List<float[]> list) {\n float xStart = Float.MAX_VALUE;\n float yStart = Float.MAX_VALUE;\n float zStart = Float.MAX_VALUE;\n float xEnd = Float.MIN_VALUE;\n float yEnd = Float.MIN_VALUE;\n float zEnd = Float.MIN_VALUE;\n for (float[] point : list) {\n if (point[0] < xStart) {\n xStart = point[0];\n }\n if (point[0] > xEnd) {\n xEnd = point[0];\n }\n if (point[1] < yStart) {\n yStart = point[1];\n }\n if (point[1] > yEnd) {\n yEnd = point[1];\n }\n if (point[2] < zStart) {\n zStart = point[2];\n }\n if (point[2] > zEnd) {\n zEnd = point[2];\n }\n }\n return new float[]{xStart, xEnd, yStart, yEnd, zStart, zEnd};\n }",
"private void searchForNearest(KdNode kdNode, Point2D p, RectHV rectangle) {\n int comparison;\n // 2 rectangles that will store the coordinates of the rectangles that are delimited by kdNode's children,\n // used in order to calculate the distance to them and see if it's worth looking down the path inside them as well\n // (i.e. if the distance from point p to the rectangle is less than the distance to an already established nearest)\n RectHV rectLeftBelow, rectRightAbove;\n\n if (kdNode.point.equals(p)) {\n // if the point we're looking at actually equals the query point, we return here,\n // as we can no longer find a distance lower than 0\n nearest = kdNode.point;\n return;\n }\n\n // if the point in the current node is closer to the searched node, we update nearest\n if (p.distanceSquaredTo(kdNode.point) < p.distanceSquaredTo(nearest))\n nearest = kdNode.point;\n\n if (kdNode.dimension) { // if this KdNode is vertical (root.dimension == true), then we have left/right rectangles\n rectLeftBelow = new RectHV(rectangle.xmin(), rectangle.ymin(),\n kdNode.point.x(), rectangle.ymax());\n rectRightAbove = new RectHV(kdNode.point.x(), rectangle.ymin(),\n rectangle.xmax(), rectangle.ymax());\n }\n else { // if this KdNode is horizontal (root.dimension == false), then we have below/above rectangles\n rectLeftBelow = new RectHV(rectangle.xmin(), rectangle.ymin(),\n rectangle.xmax(), kdNode.point.y());\n rectRightAbove = new RectHV(rectangle.xmin(), kdNode.point.y(),\n rectangle.xmax(), rectangle.ymax());\n }\n // we look at which rectangle is nearest to the query point, in order to go down that path first\n comparison = Double.compare(rectLeftBelow.distanceSquaredTo(p),\n rectRightAbove.distanceSquaredTo(p));\n\n if (comparison < 0) { // if distance to left/lower rectangle is lower than to right/upper\n if (kdNode.left != null) {\n if (rectLeftBelow.distanceSquaredTo(p) < p.distanceSquaredTo(nearest)) {\n searchForNearest(kdNode.left, p, rectLeftBelow);\n }\n // if it's larger than to nearest, the distance to the other\n // rectangle will certainly be even larger, so we return here\n else return;\n }\n if (kdNode.right != null) {\n if (rectRightAbove.distanceSquaredTo(p) < p.distanceSquaredTo(nearest)) {\n searchForNearest(kdNode.right, p, rectRightAbove);\n }\n // else return; // return statement not needed, if (comparison < 0) statement terminates here anyway\n }\n }\n else { // comparison < 0, the opposite situation holds: distance to right/upper rectangle is lower than to left/lower\n if (kdNode.right != null) {\n if (rectRightAbove.distanceSquaredTo(p) < p.distanceSquaredTo(nearest)) {\n searchForNearest(kdNode.right, p, rectRightAbove);\n }\n else return;\n }\n if (kdNode.left != null) {\n if (rectLeftBelow.distanceSquaredTo(p) < p.distanceSquaredTo(nearest)) {\n searchForNearest(kdNode.left, p, rectLeftBelow);\n }\n }\n\n }\n }",
"private List<Cell> getSurroundingCells(int x, int y) {\n ArrayList<Cell> cells = new ArrayList<>();\n for (int i = x - 1; i <= x + 1; i++) {\n for (int j = y - 1; j <= y + 1; j++) {\n // Don't include the current position i != x && j != y &&\n if ( isValidCoordinate(i, j)) {\n if (i == x && j == y) {\n continue;\n } else {\n cells.add(gameState.map[j][i]);\n }\n }\n }\n }\n return cells;\n }"
] | [
"0.62719864",
"0.58649385",
"0.5858445",
"0.57926714",
"0.5714096",
"0.56916124",
"0.5686149",
"0.5683357",
"0.566206",
"0.56609756",
"0.5656466",
"0.5651889",
"0.5630468",
"0.5600726",
"0.5577441",
"0.5561226",
"0.55579966",
"0.55430835",
"0.5537966",
"0.5534166",
"0.5489104",
"0.54824996",
"0.5466602",
"0.5455663",
"0.5448905",
"0.54418355",
"0.54287606",
"0.5428126",
"0.5426681",
"0.541305",
"0.5401873",
"0.5397497",
"0.53973645",
"0.5396544",
"0.5393387",
"0.53901064",
"0.5386027",
"0.53795433",
"0.53609204",
"0.5341527",
"0.53320605",
"0.5328562",
"0.5321784",
"0.5320052",
"0.53060967",
"0.53010446",
"0.53003335",
"0.5278182",
"0.52742827",
"0.5273834",
"0.5266286",
"0.52623904",
"0.5260177",
"0.5250789",
"0.5226466",
"0.522161",
"0.5218205",
"0.5200913",
"0.5200704",
"0.5199321",
"0.5195012",
"0.519469",
"0.5193916",
"0.518597",
"0.5185471",
"0.51782143",
"0.51631236",
"0.51565117",
"0.51558465",
"0.51552343",
"0.5145257",
"0.5143205",
"0.51388675",
"0.51359415",
"0.51268303",
"0.51152384",
"0.5113",
"0.511278",
"0.5109746",
"0.51076263",
"0.5107581",
"0.51012117",
"0.5098662",
"0.50972354",
"0.50931174",
"0.509023",
"0.509",
"0.50889665",
"0.5088382",
"0.50883263",
"0.5087865",
"0.50877446",
"0.50871295",
"0.508645",
"0.50860065",
"0.5085556",
"0.50836205",
"0.50795346",
"0.5078011",
"0.50775486",
"0.5064118"
] | 0.0 | -1 |
3, simplified. 1, space use only one D, to store each loop; 2, judge col & row for directions | public int maxSumSubmatrix(int[][] matrix, int target) {
int row = matrix.length;
if(row==0)return 0;
int col = matrix[0].length;
int m = Math.min(row,col);
int n = Math.max(row,col);
//indicating sum up in every row or every column
boolean colIsBig = col>row;
int res = Integer.MIN_VALUE;
for(int i = 0;i<m;i++){
int[] array = new int[n];
// sum from row j to row i
for(int j = i;j>=0;j--){
int val = 0;
TreeSet<Integer> set = new TreeSet<Integer>();
set.add(0);
//traverse every column/row and sum up
for(int k = 0;k<n;k++){
array[k]=array[k]+(colIsBig?matrix[j][k]:matrix[k][j]);
val = val + array[k];
//use TreeMap to binary search previous sum to get possible result
Integer subres = set.ceiling(val-target);
if(null!=subres){
res=Math.max(res,val-subres);
}
set.add(val);
}
}
}
return res;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static void TwoDimTrav(int[][] arr, int row, int col){\n\n int[] dr = new int[]{ -1, 1, 0, 0};\n int[] dc = new int[]{ 0, 0, 1, -1};\n\n for(int i = 0; i < 4; i++){\n int newRow = row + dr[i];\n int newCol = col + dc[i];\n\n if(newRow < 0 || newCol < 0 || newRow >= arr.length || newCol >= arr[0].length)\n continue;\n\n // do your code here\n\n }\n\n // All Directions\n // North, South, East, West, NW NE SW SE\n // dr = [ -1, 1, 0, 0 -1, -1, 1, 1 ]\n // dc = [ 0, 0, 1, -1 -1, 1, 1, -1 ]\n\n// int[] dr = new int[]{ -1, 1, 0, 0, -1, -1, 1, 1};\n// int[] dc = new int[]{ 0, 0, 1, -1, -1, 1, -1, 1};\n//\n// for(int i = 0; i < 8; i++){\n// int newRow = row + dr[i];\n// int newCol = col + dc[i];\n//\n// if(newRow < 0 || newCol < 0 || newRow >= arr.length || newCol >= arr[0].length)\n// continue;\n//\n// // do your code here\n//\n// }\n }",
"private Direction calcDirection(int rowD, int colD) {\n // Kuninkaan alapuolella\n if (rowD < 0) {\n if (colD < 0) return Direction.SOUTHWEST;\n if (colD > 0) return Direction.SOUTHEAST;\n return Direction.SOUTH;\n }\n // Kuninkaan yläpuolella\n if (rowD > 0) {\n if (colD < 0) return Direction.NORTHWEST;\n if (colD > 0) return Direction.NORTHEAST;\n return Direction.NORTH;\n }\n // Kuninkaan tasossa\n if (colD < 0) return Direction.WEST;\n return Direction.EAST;\n }",
"private int getDist(int x, int y, int direction) {\n\t\tint Spaces = 0;\n\t\tif(direction == 0)\n\t\t{\n\t\t\t\n\t\t\tPoint nextPoint = new Point(x, y++);\n\t\t\twhile(totalMap.isFreeSpace(nextPoint) && totalMap.isInsideGrid(nextPoint.x, nextPoint.y))\n\t\t\t{\n\t\t\t\tSpaces++;\n\t\t\t\tnextPoint.setLocation(x, y++);\n\t\t\t}\n\t\t}\n\t\tif(direction == 1)\n\t\t{\n\t\t\tPoint nextPoint = new Point(x++, y);\n\t\t\twhile(totalMap.isFreeSpace(nextPoint) && totalMap.isInsideGrid(nextPoint.x, nextPoint.y))\n\t\t\t{\n\t\t\t\tSpaces++;\n\t\t\t\tnextPoint.setLocation(x++, y);\n\t\t\t}\n\t\t}\n\t\tif(direction == 2)\n\t\t{\n\t\t\tPoint nextPoint = new Point(x--, y);\n\t\t\twhile(totalMap.isFreeSpace(nextPoint) && totalMap.isInsideGrid(nextPoint.x, nextPoint.y))\n\t\t\t{\n\t\t\t\tSpaces++;\n\t\t\t\tnextPoint.setLocation(x--, y);\n\t\t\t}\n\t\t}\n\t\tif(direction == 3)\n\t\t{\n\t\t\tPoint nextPoint = new Point(x, y--);\n\t\t\twhile(totalMap.isFreeSpace(nextPoint) && totalMap.isInsideGrid(nextPoint.x, nextPoint.y))\n\t\t\t{\n\t\t\t\tSpaces++;\n\t\t\t\tnextPoint.setLocation(x, y--);\n\t\t\t}\n\t\t}\n\t\treturn Spaces;\n\t}",
"private static void solution() {\n for (int i = 0; i < n; i++) {\n Coord here = coords[i]; // start, end, dir, gen\n for (int j = 0; j < here.gen; j++) {\n // Rotate degree of 90.\n List<Pair> changed = rotate(here.coord, here.endPoint);\n boolean first = true;\n for(Pair p: changed){\n if(first) {\n here.endPoint = new Pair(p.x, p.y);\n first = false;\n }\n here.coord.add(new Pair(p.x, p.y));\n }\n }\n }\n // count the number of squares enclosing all angles with dragon curve\n for (int i = 0; i < n; i++) {\n for(Pair p: coords[i].coord)\n board[p.y][p.x] = true;\n }\n int cnt = 0;\n for (int i = 0; i < 100; i++)\n for (int j = 0; j < 100; j++)\n if(board[i][j] && board[i + 1][j] && board[i][j + 1] && board[i + 1][j + 1])\n cnt += 1;\n System.out.println(cnt);\n }",
"public int CalcDistance ( )\r\n\t{\r\n\t\tfor ( int i = 0; i<size; i++ )\r\n\t\t{\r\n\t\t\tfor ( int offR = 0; offR <= size/2; offR++ )\r\n\t\t\t{\r\n\t\t\t\tfor ( int c = 0; c <= size/2; c++ )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( offR == 0 && maze [offR] [c].isOpenUp() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenUp() && maze [offR-1] [c].isOpenDown() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR-1] [c].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( c == 0 && maze [offR] [c].isOpenLeft() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenLeft() && maze [offR] [c-1].isOpenRight() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR] [c-1].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfor ( int c = size-1; c >= size/2; c-- )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( offR == 0 && maze [offR] [c].isOpenUp() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenUp() && maze [offR-1] [c].isOpenDown() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR-1] [c].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( c == size-1 && maze [offR] [c].isOpenRight() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenRight() && maze [offR] [c+1].isOpenLeft() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR] [c+1].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor ( int offR = size-1; offR >= size/2; offR-- )\r\n\t\t\t{\r\n\t\t\t\tfor ( int c = 0; c <= size/2; c++ )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( offR == size-1 && maze [offR] [c].isOpenDown() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenDown() && maze [offR+1] [c].isOpenUp() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR+1] [c].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( c == 0 && maze [offR] [c].isOpenLeft() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenLeft() && maze [offR] [c-1].isOpenRight() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR] [c-1].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfor ( int c = size-1; c >= size/2; c-- )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( offR == size-1 && maze [offR] [c].isOpenDown() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenDown() && maze [offR+1] [c].isOpenUp() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR+1] [c].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( c == size-1 && maze [offR] [c].isOpenRight() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenRight() && maze [offR] [c+1].isOpenLeft() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR] [c+1].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn maze [currentRow] [currentCol].getDistanceToExit();\r\n\t}",
"public static boolean diagonalJudge(String playerMarker, int row, int column){\n\n boolean victoryFlag = false;\n\n int subRow = 0;\n int subColumn = 0;\n int victoryCounter = 0;\n\n // Checking first Diagonal\n // North West\n\n subRow = row;\n subColumn = column;\n\n // Store the player's latest move's coordinates\n\n winList.add(subColumn);\n winList.add(subColumn);\n\n while ( subRow >= 0 && subColumn >= 0 && !victoryFlag ){\n\n subRow--;\n subColumn--;\n\n if ( subRow >= 0 && subColumn >= 0 ){\n\n if ( gameBoard[subRow][subColumn].equals(playerMarker) ){\n winList.add(subRow);\n winList.add(subColumn);\n victoryCounter++;\n\n if ( victoryCounter == 3){\n victoryFlag = true;\n }\n }\n\n else{\n break;\n }\n }\n }\n\n // South East\n\n subRow = row;\n subColumn = column;\n\n while ( subRow < 6 && subColumn < 7 && !victoryFlag ){\n\n subRow++;\n subColumn++;\n\n if ( subRow < 6 && subColumn < 7 ){\n\n if ( gameBoard[subRow][subColumn].equals(playerMarker) ){\n winList.add(subRow);\n winList.add(subColumn);\n victoryCounter++;\n\n if ( victoryCounter == 3){\n victoryFlag = true;\n }\n }\n\n else{\n break;\n }\n }\n }\n\n if ( !victoryFlag ){\n winList.clear(); // reset the list, if no one won\n }\n else{\n winDirection = \"Left Diagonal\";\n }\n\n // Checking the other diagonal\n // North East\n\n victoryCounter = 0;\n subRow = row;\n subColumn = column;\n winList.add(subRow);\n winList.add(subColumn);\n\n while ( subRow >= 0 && subColumn < 7 && !victoryFlag ){\n\n subRow--;\n subColumn++;\n\n if ( subRow >= 0 && subColumn < 7 ){\n\n if ( gameBoard[subRow][subColumn].equals(playerMarker) ){\n winList.add(subRow);\n winList.add(subColumn);\n victoryCounter++;\n\n if ( victoryCounter == 3){\n winDirection = \"Right Diagonal\";\n victoryFlag = true;\n }\n }\n\n else{\n break;\n }\n }\n }\n\n // South East\n\n subRow = row;\n subColumn = column;\n\n while ( subRow < 6 && subColumn >= 0 && !victoryFlag ){\n\n subRow++;\n subColumn--;\n\n if ( subRow <= 5 && subColumn >= 0 ){\n\n if ( gameBoard[subRow][subColumn].equals(playerMarker) ){\n winList.add(subRow);\n winList.add(subColumn);\n victoryCounter++;\n\n if ( victoryCounter == 3){\n winDirection = \"Right Diagonal\";\n victoryFlag = true;\n }\n }\n\n else{\n break;\n }\n }\n }\n\n if ( !victoryFlag ){\n winList.clear();\n }\n\n return victoryFlag;\n }",
"public boolean isLegalDiag(MoveDirection dir){\r\n GamePosition curPos = currentGame.getCurrentPosition();\n\t\tPlayer white = currentGame.getWhitePlayer();\n\t\t\n\t\tPlayer toMove;\n\t\tPlayer oppo;\n\n\t\tint col, row;\n\t\tif(curPos.getPlayerToMove().equals(white)) {\n\t\t\n\t\t\tcol = curPos.getWhitePosition().getTile().getColumn();\n\t\t\trow = curPos.getWhitePosition().getTile().getRow();\n\t\t\t\n\t\t\ttoMove = white;\n\t\t\toppo = currentGame.getBlackPlayer();\n\t\t} else {\n\t\t\tcol = curPos.getBlackPosition().getTile().getColumn();\n\t\t\trow = curPos.getBlackPosition().getTile().getRow();\n\t\t\t\n\t\t\toppo = white;\n\t\t\ttoMove = currentGame.getBlackPlayer();\n\t\t}\n\t\t\n\t\tif (dir == MoveDirection.NorthEast) {\n\t\t\tif(col==9 || row ==1) return false;\n\t\t} else if(dir == MoveDirection.NorthWest) {\n\t\t\tif(col==1 || row ==1) return false;\n\t\t} else if(dir == MoveDirection.SouthEast) {\n\t\t\tif(col==9 || row ==9) return false;\n\t\t} else if(dir == MoveDirection.SouthWest) {\n\t\t\tif(col==1 || row ==9) return false;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t\t//Tiles are drawn by row then by column. 0= row1 col1, \n\t\t\n\t\t//Checking the has opponent first\n\t\tboolean correct = false;\n\t\t//Check down\n\t\tif(QuoridorController.hasOpponent(1, 0)) {\n\t\t\tif(QuoridorController.noWallBlock(toMove, 1, 0)) {\n\t\t\t\tif(QuoridorController.noWallBlock(oppo, 1, 0) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\tif(QuoridorController.noWallBlock(oppo, 0, -1)) {\n\t\t\t\t\t\t//Jump diagonal- check left\n\t\t\t\t\t\tif(dir == MoveDirection.SouthWest) return true;\n\t\t\t\t\t\t\n\t\t\t\t\t} \n\t\t\t\t\tif(QuoridorController.noWallBlock(oppo, 0, 1)) {\n\t\t\t\t\t\t//Jump diagonal- check right\n\t\t\t\t\t\tif(dir == MoveDirection.SouthEast) return true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\t\t//Check up\n\t\t} else if(QuoridorController.hasOpponent(-1, 0)) {\n\t\t\tif(QuoridorController.noWallBlock(toMove, -1, 0)) {\n\t\t\t\tif(QuoridorController.noWallBlock(oppo, -1, 0) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\tif(QuoridorController.noWallBlock(oppo, 0, -1)) {\n\t\t\t\t\t\t//Jump diagonal- check left\n\t\t\t\t\t\tif(dir == MoveDirection.NorthWest) return true;\n\t\t\t\t\t\t\n\t\t\t\t\t} \n\t\t\t\t\tif(QuoridorController.noWallBlock(oppo, 0, 1)) {\n\t\t\t\t\t\t//Jump diagonal- check right\n\t\t\t\t\t\tif(dir == MoveDirection.NorthEast) return true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\t\t//Check right\n\t\t} else if(QuoridorController.hasOpponent(0, 1)) {\n\t\t\tif(QuoridorController.noWallBlock(toMove, 0, 1)) {\n\t\t\t\tif(QuoridorController.noWallBlock(oppo, 0, 1) ) {\n\t\t\t\t\t//Jump straight allowed\n\t\t\t\t\treturn false;\t\n\t\t\t\t} else {\n\t\t\t\t\tif(QuoridorController.noWallBlock(oppo, -1, 0)) {\n\t\t\t\t\t\t//Jump diagonal- check up\n\t\t\t\t\t\tif(dir == MoveDirection.NorthEast) return true;\n\t\t\t\t\t} \n\t\t\t\t\tif(QuoridorController.noWallBlock(oppo, 1, 0)) {\n\t\t\t\t\t\t//Jump diagonal- check down\n\t\t\t\t\t\tif(dir == MoveDirection.SouthEast) return true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t//Check left\n\t\t} else if(QuoridorController.hasOpponent(0, -1)) {\n\t\t\tif(QuoridorController.noWallBlock(toMove, 0, -1)) {\n\t\t\t\tif(QuoridorController.noWallBlock(oppo, 0, -1) ) {\n\t\t\t\t\t//Jump straight allowed\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\tif(QuoridorController.noWallBlock(oppo, -1, 0)) {\n\t\t\t\t\t\t//Jump diagonal- check up\n\t\t\t\t\t\tif(dir == MoveDirection.NorthWest) return true;\n\t\t\t\t\t} \n\t\t\t\t\tif(QuoridorController.noWallBlock(oppo, 1, 0)) {\n\t\t\t\t\t\t//Jump diagonal- check down\n\t\t\t\t\t\tif(dir == MoveDirection.SouthWest) return true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\r\n }",
"private static int[][] distanceGrid(final int[][] board) {\n final int numRows = board.length;\n final int numCols = board[0].length;\n\n final int distance = 0;\n\n final int[][] distanceGrid = new int[numRows][numCols];\n for (final int[] row : distanceGrid) {\n Arrays.fill(row, INACCESSABLE_SPACE_DISTANCE);\n }\n // For each space on the board\n for (int r = 0; r < numRows; r++) {\n nextBoardSpace:\n for (int c = 0; c < numCols; c++) {\n ArrayList<int[]> explored = new ArrayList<>();\n Queue<int[]> toExplore = new LinkedList<>();\n Map<String,Integer> dists = new HashMap<>();\n\n // Add the space to the explore queue\n toExplore.add(new int[] {r, c, 0});\n \n // While there is more to explore\n while (!toExplore.isEmpty()) {\n int[] currExplor = toExplore.remove();\n explored.add(currExplor);\n int explRow = currExplor[0];\n int explCol = currExplor[1];\n int explDist = currExplor[2];\n\n String key = Arrays.toString(new int[] {explRow, explCol});\n dists.put(key, 1);\n \n // If the space contains a player's move, add the distance to the \n //distanceGrid, and continue on the next boardspace\n if (board[explRow][explCol] > 0) {\n distanceGrid[r][c] = explDist;\n continue nextBoardSpace;\n }\n \n // Otherwise, if the space is empty, add it's neighbours to the queue\n if (board[explRow][explCol] == 0) {\n ArrayList<int[]> neighbours = Utils.neighbours(explRow, explCol, numRows, numCols);\n for (int[] neighbour : neighbours) {\n int[] temp = new int[] {neighbour[0], neighbour[1], explDist+1};\n if (dists.containsKey(key)) continue;\n toExplore.add(temp);\n }\n }\n }\n\n // If a path to one of our spaces is not found, space is inaccessable\n if (board[r][c] != 0) {\n distanceGrid[r][c] = -1;\n }\n\n }\n }\n return distanceGrid;\n }",
"public void seekWalls() {\n\t\t for (int j=0; j<visited[0].length; j++){\n\t\t\tfor (int i=visited.length-1; i>=0; i--) {\t\t\t\n\t\t\t\tif (i!=0 && j!= visited[0].length-1) {//general position\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i-1][j]) == maxComb && !isFree(i,j,2)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'N';\n\t\t\t\t\t\treturn;//not break!!!!! return to exit !\n\t\t\t\t\t}\n\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i][j+1]) == maxComb && !isFree(i,j,4)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'E';\t\n\t\t\t\t\t\treturn;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if (i==0 && j!= visited[0].length-1) {\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i][j+1]) == maxComb && !isFree(i,j,4)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'E';\t\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse if (i!=0 && j== visited[0].length-1) {\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i-1][j]) == maxComb && !isFree(i,j,2)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'N';\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\telse {//if (i==0 && j== visited[0].length-1) {\n\t\t\t\t\t//no solution\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"static int f(char[] turns, int nturns, int r, int c, int dr, int dc, int cnt) {\n if (!range(r, c)) return 0;\n if (board[r][c] != '.') return 0;\n int ntouch = 0;\n if (r == 0) ntouch++;\n if (r == N - 1) ntouch++;\n if (c == 0) ntouch++;\n if (c == M - 1) ntouch++;\n if (ntouch >= 2) return 0; // touched corner\n if (cnt != 0 && ntouch == 1) { // touched edge second time\n out.println(\"DONE : \" + r + \" \" + c);\n return 1;\n }\n int near = 0;\n for (int[] d : new int[][] {{1, 0}, {-1, 0}, {0, 1}, {0, -1}}) {\n int nr = r + d[0];\n int nc = c + d[1];\n if (range(nr, nc) && board[nr][nc] == '*') near++;\n }\n if (cnt != 0 && !(ntouch == 0 && near == 1)) {\n return 0;\n }\n out.println(r + \" \" + c + \" \" + dr + \" \" + dc);\n board[r][c] = '*';\n int tot = 0;\n tot += f(turns, nturns, r + dr, c + dc, dr, dc, cnt + 1);\n if (nturns < 2 && cnt > 0) {\n if (nturns == 0) {\n for (char cc : new char[] {'L', 'R'}) {\n turns[0] = cc;\n int ndr = dc;\n int ndc = dr;\n if (cc == 'L') ndr = -ndr;\n if (cc == 'R') ndc = -ndc;\n tot += f(turns, nturns + 1, r + ndr, c + ndc, ndr, ndc, cnt + 1);\n }\n } else {\n char cc = turns[0] == 'L' ? 'R' : 'L';\n turns[1] = cc;\n int ndr = dc;\n int ndc = dr;\n if (cc == 'L') ndr = -ndr;\n if (cc == 'R') ndc = -ndc;\n tot += f(turns, nturns + 1, r + ndr, c + ndc, ndr, ndc, cnt + 1);\n }\n }\n board[r][c] = '.';\n return tot;\n }",
"private void findPath(int[][] path){\n int row = rows-1;\n int col = cols-1;\n int count = 1;\n int[][] newpath = new int[row+1][col+1];\n while(row>0 && col> 0){\n if(path[row-1][col-1]+1 == path[row][col]){\n newpath[row][col] = path[row][col];\n System.out.println(\"edit distance: \" + count + \"--> replace '\" + oriString.charAt(row-1) + \"' with '\" + fixString.charAt(col-1)+\"'\");\n count++;\n row--;\n col--;\n }else if(path [row-1][col]+1 == path[row][col]){\n newpath[row][col] = path[row][col];\n System.out.println(\"edit distance: \" + count + \"--> remove '\" + oriString.charAt(row-1) + \"' from str1\");\n row--;\n count++;\n\n }else if(path [row][col-1]+1 == path[row][col]){\n newpath[row][col] = path[row][col];\n System.out.println(\"edit distance: \" + count + \"--> add '\" + fixString.charAt(col-1) + \"' to str1\");\n count++;\n col--;\n }else if(path [row-1][col-1] == path[row][col]){\n newpath[row][col] = path[row][col];\n row--;\n col--;\n }\n }\n if( row != 0){\n while(row > 0){\n if(path[row][col] == path[row-1][col]+1){\n newpath[row][col] = path[row][col];\n System.out.println(\"edit distance: \" + count + \"--> remove '\" + oriString.charAt(row-1) + \"' to str1\");\n count++;\n row--;\n }\n }\n }\n if( col != 0){\n while(col > 0){\n if(path[row][col] == path[row][col-1]+1){\n newpath[row][col] = path[row][col];\n System.out.println(\"edit distance: \" + count + \"--> add '\" + fixString.charAt(col-1) + \"' to str1\");\n count++;\n col--;\n }\n }\n }\n // printPath(newpath);\n }",
"public static void main(String[] args) {\n int[][] inp = new int[][] {\n {1,2,3},\n {5,6,7},\n {9,10,11}};\n \n int temp;\n \n\t for(int i = inp.length-1,j=0; i>=0 ; i--,j=0)\n {\n System.out.print(inp[i][j] + \" \");\n\t\t \n temp = i; // store old row where we started \n \n\t\t while(i+1 < inp.length && j+1 < inp[0].length)\n {\n System.out.print(inp[i+1][j+1] + \" \"); // keep print right diagonal\n i++;j++;\n }\n \n\t\t i = temp; // restore old row\n \n\t\t System.out.println();\n\t\t \n\t\t // special case - when we switch from processing row to processing column\n if(i == 0)\n {\n\t\t\t // now, column will go from 1 to inp[0].length-1\n\t\t\t \n for (int k = 1; k < inp[0].length; k++) {\n\n\t\t\t\t temp = k; // save old column\n \n\t\t\t\t System.out.print(inp[i][k] + \" \");\n\t\t\t\t \n\t\t\t\t // keep getting right diagonal\n while (i + 1 < inp.length && k + 1 < inp[0].length) {\n System.out.print(inp[i + 1][k + 1] + \" \");\n i++;\n k++;\n }\n \n\t\t\t\t k = temp;\n \n\t\t\t\t i = 0;\n \n\t\t\t\t System.out.println();\n\n }\n }\n }\n \n }",
"public int move_diagonally(Square[][] squares, int [] move, Boolean turn) {\n\n /* going down and right = f4 h2 [4,5,6,7] */\n if (move[2] > move[0] && move[3] > move[1]) {\n ////System.out.println(\"Down right\");\n int x = move[0];\n int y = move[1];\n x++;\n y++;\n while (x < move[2] && y < move[3]) {\n if (squares[x][y] instanceof Piece) {\n ////System.out.println(\"Piece in between \"+x + \" \" + y);\n return -1;\n }\n x++;\n y++;\n }\n }\n /* going down and left */\n else if (move[2] > move[0] && move[3] < move[1]){\n ////System.out.println(\"Down Left\");\n int x = move[0];\n int y = move[1];\n x++;\n y--;\n while (x < move[2] && y > move[3]) {\n if (squares[x][y] instanceof Piece) {\n ////System.out.println(\"Piece in between \"+x + \" \" + y);\n return -1;\n }\n x++;\n y--;\n }\n }\n /* going up and left */\n else if (move[2] < move[0] && move[3] < move[1]){\n ////System.out.println(\"Up Left\");\n int x = move[0];\n int y = move[1];\n x--;\n y--;\n while (x > move[2] && y > move[3]) {\n if (squares[x][y] instanceof Piece) {\n ////System.out.println(\"Piece in between \"+x + \" \" + y);\n return -1;\n }\n x--;\n y--;\n }\n }\n /* going up and right c1 f4 [7,2,4,5] */\n else if (move[2] < move[0] && move[3] > move[1]){\n ////System.out.println(\"Up right\");\n int x = move[0];\n int y = move[1];\n x--;\n y++;\n while (x > move[2] && y < move[3]) {\n if (squares[x][y] instanceof Piece) {\n ////System.out.println(\"Piece in between \"+x + \" \" + y);\n return -1;\n }\n x--;\n y++;\n }\n }\n return 0;\n }",
"private void checkForConversions() {\n\n for(int r=0; r<COLUMN_ROW_COUNT; r++) {\n for(int c=0; c<COLUMN_ROW_COUNT; c++) {\n Piece p = cells[r][c];\n if(p == null) continue;\n\n if (p.getType().equals(Type.GUARD)) {\n int surroundingDragons = 0;\n Piece piece;\n\n if ((c - 1) >= 0) {\n piece = cells[r][c - 1];\n if (piece != null && piece.getType().equals(Type.DRAGON)) surroundingDragons++;\n }\n if ((r- 1) >= 0) {\n piece = cells[r- 1][c];\n if (piece != null && piece.getType().equals(Type.DRAGON)) surroundingDragons++;\n }\n if ((c + 1) < COLUMN_ROW_COUNT) {\n piece = cells[r][c + 1];\n if (piece != null && piece.getType().equals(Type.DRAGON)) surroundingDragons++;\n }\n if ((r+ 1) < COLUMN_ROW_COUNT) {\n piece = cells[r+ 1][c];\n if (piece != null && piece.getType().equals(Type.DRAGON)) surroundingDragons++;\n }\n\n if (surroundingDragons >= 3) {\n cells[r][c].changeType(Type.DRAGON);\n }\n }\n\n /*\n if(p.getType().equals(Type.KING)) {\n int blockedDirections = 0;\n Piece piece;\n\n if ((c - 1) >= 0) {\n piece = cells[r][c - 1];\n if (piece != null) {\n if (piece.getType().equals(Type.DRAGON)) {\n blockedDirections++;\n } else if (piece.getType().equals(Type.GUARD) && (c - 2) >= COLUMN_ROW_COUNT && cells[r][c-2] != null) {\n blockedDirections++;\n }\n }\n } else blockedDirections++;\n\n if ((r- 1) >= 0) {\n piece = cells[r- 1][c];\n if (piece != null) {\n if (piece.getType().equals(Type.DRAGON)) {\n blockedDirections++;\n } else if (piece.getType().equals(Type.GUARD) && (r - 2) >= COLUMN_ROW_COUNT && cells[r-2][c] != null) {\n blockedDirections++;\n }\n }\n } else blockedDirections++;\n\n if ((c + 1) < COLUMN_ROW_COUNT) {\n piece = cells[r][c+1];\n if (piece != null) {\n if (piece.getType().equals(Type.DRAGON)) {\n blockedDirections++;\n } else if (piece.getType().equals(Type.GUARD) && (c + 2) < COLUMN_ROW_COUNT && cells[r][c+2] != null) {\n blockedDirections++;\n }\n }\n } else blockedDirections++;\n\n if ((r+ 1) < COLUMN_ROW_COUNT) {\n piece = cells[r+1][c];\n if (piece != null) {\n if (piece.getType().equals(Type.DRAGON)) {\n blockedDirections++;\n } else if (piece.getType().equals(Type.GUARD) && (r + 2) < COLUMN_ROW_COUNT && cells[r+2][c] != null) {\n blockedDirections++;\n }\n }\n } else blockedDirections++;\n\n if(blockedDirections == 4) {\n //gameOver = true;\n }\n }*/\n }\n }\n }",
"private boolean scanWinDir(char symbol, int row, int col, int rowd, int cold) {\n int backDist = 0, forwardDist = 0;\n boolean backCont = true, forwardCont = true;\n for(int i = 1; i < inline; i++) {\n if(backCont && gameBoardCompareSafe(symbol, row - rowd * i, col - cold * i))\n backDist++;\n else\n backCont = false;\n\n if(forwardCont && gameBoardCompareSafe(symbol, row + rowd * i, col + cold * i))\n forwardDist++;\n else\n forwardCont = false;\n\n if(1 + backDist + forwardDist == inline) {\n return true;\n }\n\n }\n return false;\n }",
"private void memorization(Direction d){\n\t\tcurrent.setExit(d);\n\t\tvisited.add(current);\n\t\tswitch(d){\n\t\tcase NORTH:\n\t\t\tcurrent = new Square(current.x,current.y+1);\n\t\t\tbreak;\n\t\tcase SOUTH:\n\t\t\tcurrent = new Square(current.x,current.y-1);\n\t\t\tbreak;\n\t\tcase WEST:\n\t\t\tcurrent = new Square(current.x-1,current.y);\n\t\t\tbreak;\n\t\tcase EAST:\n\t\t\tcurrent = new Square(current.x+1,current.y);\n\t\t}\n\t}",
"private boolean thereispath(Move m, Tile tile, Integer integer, Graph g, Board B) {\n\n boolean result = true;\n boolean result1 = true;\n\n int start_dest_C = tile.COLUMN;\n int start_dest_R = tile.ROW;\n\n int move_column = m.getX();\n int move_row = m.getY();\n\n int TEMP = 0;\n int TEMP_ID = 0;\n int TEMP_ID_F = tile.id;\n int TEMP_ID_FIRST = tile.id;\n\n int final_dest_R = (integer / B.width);\n int final_dest_C = (integer % B.width);\n\n //System.out.println(\"* \" + tile.toString() + \" \" + integer + \" \" + m.toString());\n\n // Y ROW - X COLUMN\n\n for (int i = 0; i != 2; i++) {\n\n TEMP_ID_FIRST = tile.id;\n\n // possibility 1\n if (i == 0) {\n\n\n // first move columns\n for (int c = 0; c != Math.abs(move_column) && result != false; c++) {\n\n if (c == 0) {\n TEMP_ID_FIRST = tile.id;\n\n } else {\n TEMP_ID_FIRST = B.a.get(start_dest_R).get(start_dest_C).id;\n\n }\n\n TEMP = move_column / Math.abs(move_column);\n\n //System.out.println(\"1C:\" + TEMP);\n\n //System.out.println(\" \" + TEMP_ID_FIRST + \" - > \" + (start_dest_C + TEMP));\n\n start_dest_C += TEMP;\n\n TEMP_ID = B.a.get(start_dest_R).get(start_dest_C).id;\n\n //System.out.println(TEMP_ID_FIRST + \" = \" + TEMP_ID);\n\n if (g.adj.get(TEMP_ID_FIRST).contains(TEMP_ID)) {\n\n // System.out.println(\"OK\");\n\n } else {\n\n result = false;\n\n // System.out.println(\"NOPE\");\n\n\n }\n }\n\n for (int r = 0; r != Math.abs(move_row) && result != false; r++) {\n\n TEMP_ID_FIRST = B.a.get(start_dest_R).get(start_dest_C).id;\n\n TEMP = move_row / Math.abs(move_row);\n\n //System.out.println(\"1R:\" + TEMP);\n\n //System.out.println(start_dest_R + \" - > \" + (start_dest_R + TEMP));\n\n start_dest_R += TEMP;\n\n TEMP_ID = B.a.get(start_dest_R).get(start_dest_C).id;\n\n // System.out.println(TEMP_ID_FIRST + \" and \" + TEMP_ID);\n\n if (g.adj.get(TEMP_ID_FIRST).contains(TEMP_ID)) {\n\n //System.out.println(\"OK\");\n\n\n } else {\n\n result = false;\n\n //System.out.println(\"NOPE\");\n\n\n }\n }\n\n if (result == true) {\n return true;\n }\n\n\n }\n\n TEMP_ID = 0;\n\n if (i == 1) {\n\n result = true;\n\n start_dest_C = tile.COLUMN;\n start_dest_R = tile.ROW;\n // first move row\n for (int r = 0; r != Math.abs(move_row) && result1 != false; r++) {\n\n if (r == 0) {\n TEMP_ID_FIRST = tile.id;\n\n } else {\n TEMP_ID_FIRST = B.a.get(start_dest_R).get(start_dest_C).id;\n\n }\n\n TEMP_ID_FIRST = B.a.get(start_dest_R).get(start_dest_C).id;\n\n TEMP = move_row / Math.abs(move_row);\n\n //System.out.println(\"1R:\" + TEMP);\n\n //System.out.println(start_dest_R + \" - > \" + (start_dest_R + TEMP));\n\n start_dest_R += TEMP;\n\n TEMP_ID = B.a.get(start_dest_R).get(start_dest_C).id;\n\n\n //System.out.println(TEMP_ID_FIRST + \" = \" + TEMP_ID);\n\n if (g.adj.get(TEMP_ID_FIRST).contains(TEMP_ID)) {\n\n //System.out.println(\"OK\");\n\n } else {\n\n //System.out.println(\"NOPE\");\n\n result = false;\n\n }\n\n\n }\n\n // first move columns\n for (int c = 0; c != Math.abs(move_column) && result1 != false; c++) {\n\n\n TEMP_ID_FIRST = B.a.get(start_dest_R).get(start_dest_C).id;\n\n TEMP = move_column / Math.abs(move_column);\n\n //System.out.println(\"1C:\" + TEMP);\n\n //System.out.println(\" \" + TEMP_ID_FIRST + \" - > \" + (start_dest_C + TEMP));\n\n start_dest_C += TEMP;\n\n TEMP_ID = B.a.get(start_dest_R).get(start_dest_C).id;\n\n //System.out.println(TEMP_ID_FIRST + \" and \" + TEMP_ID);\n\n if (g.adj.get(TEMP_ID_FIRST).contains(TEMP_ID)) {\n\n //System.out.println(\"OK\");\n\n } else {\n result = false;\n\n //System.out.println(\"NOPE\");\n\n\n }\n }\n\n if (result == false) {\n return false;\n\n }\n\n\n }\n\n\n }\n\n\n return true;\n }",
"public void fillDirectionPlot(){\n for(int i=0; i<arraysize; i++){\n for(int j=0; j<arraysize; j++){\n int current = Integer.parseInt(AltPlot[i][j]);\n \n int min = current;\n String minDirection = \"c\";\n int right;\n int left;\n int up;\n int down;\n \n if((j+1)<arraysize){\n right = Integer.parseInt(AltPlot[i][j+1]);\n if(right<min){\n min = right;\n minDirection = \"r\";\n }\n }\n if((j-1)>=0){\n left = Integer.parseInt(AltPlot[i][j-1]);\n if(left<min){\n min = left;\n minDirection = \"l\";\n }\n }\n if((i-1)>=0){\n up = Integer.parseInt(AltPlot[i-1][j]);\n if(up<min){\n min = up;\n minDirection = \"u\";\n }\n }\n if((i+1)<arraysize){\n down = Integer.parseInt(AltPlot[i+1][j]);\n if(down<min){\n min = down;\n minDirection = \"d\";\n }\n }\n \n //check for which is the minimum number of the 5 and update\n //directionPlot accordingly\n if(min == current){\n sinkCounter +=1;\n \n directionPlot[i][j] = Integer.toString(sinkCounter);\n }\n else{\n \n directionPlot[i][j] = minDirection;//indicates which way water flows\n }\n }\n }\n }",
"private boolean winsByDiagonalTopLeftToBottomRight(char symbol){\n int max_diagonal_count = 0;\n\n // Deals with the diagonals below the midpoint in the array. Iterates through diagonals from last row to the\n // first row.\n for (int i = this.boardRows - 1; i > 0; i--) {\n\n // reset counter at each new diagonal\n int count = 0;\n\n // Iterates through the diagonal with origin (top left point) at first element of row i\n for (int j = 0, x = i; x < this.boardRows; j++, x++) {\n\n // If j surpasses the number of available cols we break out the inner for loop. This happens when the\n // num of rows and cols in the array are different\n if (j>=this.boardColumns){\n break;\n }\n // If char symbol is the same as the element in the diagonal, we increment counter by 1 and update\n // max_diagonal_count if possible.\n if(symbol == this.gameBoard[x][j]){\n count+=1;\n\n if (count>max_diagonal_count){\n max_diagonal_count=count;\n }\n }\n //Otherwise, we reset the counter to 0\n else {\n count = 0;\n }\n }\n }\n\n // Deals with the diagonals at and after the midpoint in the array. Iterates through diagonals from first column to the\n // last column\n for (int i = 0; i < this.boardColumns; i++) {\n\n // Resets counter for each new diagonal\n int count = 0;\n\n // Iterates through diagonal values with origin (top left point) at first element of col i\n for (int j = 0, y = i; y < this.boardColumns; j++, y++) {\n\n // If j surpasses the number of available cols we break out the inner for loop. This happens when the\n // num of rows and cols in the array are different\n if (j>=this.boardRows){\n break;\n }\n\n // If char symbol is the same as the element in the diagonal, we increment counter by 1 and update\n // max_diagonal_count if possible.\n if(symbol == this.gameBoard[j][y]){\n count+=1;\n\n if (count>max_diagonal_count){\n max_diagonal_count=count;\n }\n }\n //Otherwise, we reset the counter to 0\n else {\n count = 0;\n }\n }\n }\n\n // If the max_diagonal_count is greater than or equal to tilesNeeded, then we have sufficient tiles in a diagonal\n // for char symbol to win so we return true. Otherwise, we return false.\n if (max_diagonal_count >= this.tilesNeeded){\n return true;\n }\n else {\n return false;\n }\n\n }",
"public int[] calcTargetCoords(char direction, int row, int col)\n {\n int tRow = row, tCol = col; // target row and column\n if (direction == 'N') {\n tRow--;\n }\n else if (direction == 'E') {\n tCol++;\n }\n else if (direction == 'S') {\n tRow++;\n }\n else if (direction == 'W') {\n tCol--;\n }\n return new int[] { tRow, tCol };\n }",
"protected int bestDirection(int _y, int _x)\n {\n int sX = -1, sY = -1;\n for (int i = 0; i < m; i++) {\n boolean breakable = false;\n for (int j = 0; j < n; j++) {\n if (map[i][j] == 'p' || map[i][j] == '5') {\n sX = i;\n sY = j;\n breakable = true;\n break;\n }\n }\n if(breakable) break;\n sX =0; sY = 0;\n }\n Pair s = new Pair(sX, sY);\n Queue<Pair> queue = new Queue<Pair>();\n int[][] distance = new int[m][n];\n for (int i = 0; i < m; i++)\n for (int j = 0; j < n; j++)\n distance[i][j] = -1;\n distance[sX][sY] = 0;\n queue.add(s);\n /*\n System.out.println(\"DEBUG TIME!!!!\");\n for(int i = 0; i < m; i++)\n {\n for(int j = 0; j < n; j++)\n System.out.print(map[i][j]);\n System.out.println();\n }\n System.out.println();\n */\n while (!queue.isEmpty())\n {\n Pair u = queue.remove();\n for (int i = 0; i < 4; i++)\n {\n int x = u.getX() + hX[i];\n int y = u.getY() + hY[i];\n if (!validate(x, y)) continue;\n if (distance[x][y] != -1) continue;\n if (!canGo.get(map[x][y])) continue;\n distance[x][y] = distance[u.getX()][u.getY()] + 1;\n queue.add(new Pair(x, y));\n }\n }\n\n //slove if this enemy in danger\n //System.out.println(_x + \" \" + _y);\n if (inDanger[_x][_y])\n {\n int direction = -1;\n boolean canAlive = false;\n int curDistance = dangerDistance[_x][_y];\n int distanceToBomber = m * n;\n if (curDistance == -1) return 0;\n for (int i = 0; i < 4; i++)\n {\n int x = _x + hX[i];\n int y = _y + hY[i];\n if (!validate(x, y)) continue;\n if (dangerDistance[x][y] == -1) continue;\n if (dangerDistance[x][y] < curDistance)\n {\n curDistance = dangerDistance[x][y];\n direction = i;\n distanceToBomber = distance[x][y];\n } else if (dangerDistance[x][y] == curDistance)\n {\n if (distanceToBomber == -1 || distanceToBomber > distance[x][y])\n {\n direction = i;\n distanceToBomber = distance[x][y];\n }\n }\n }\n if (direction == -1) direction = random.nextInt(4);\n allowSpeedUp = true;\n return direction;\n }\n // or not, it will try to catch bomber\n else\n {\n /*\n System.out.println(\"x = \" + _x + \"y = \" + _y);\n for(int i = 0; i < n; i++) System.out.printf(\"%2d \",i);\n System.out.println();\n for(int i = 0; i < m; i++)\n {\n for(int j = 0; j < n; j++)\n System.out.printf(\"%2d \",distance[i][j]);\n System.out.println();\n }\n System.out.println();\n System.out.println();\n */\n int direction = -1;\n int[] die = new int[4];\n for (int i = 0; i < 4; i++)\n die[i] = 0;\n int curDistance = distance[_x][_y];\n for (int i = 0; i < 4; i++)\n {\n int x = _x + hX[i];\n int y = _y + hY[i];\n if (!validate(x, y))\n {\n die[i] = 1;\n continue;\n }\n ;\n if (inDanger[x][y])\n {\n die[i] = 2;\n continue;\n }\n if (distance[x][y] == -1) continue;\n if (distance[x][y] < curDistance)\n {\n curDistance = distance[x][y];\n direction = i;\n }\n }\n if(curDistance < 4) allowSpeedUp = true;\n else allowSpeedUp = false; //TODO: TEST :))\n if (direction == -1)\n {\n for (int i = 0; i < 4; i++)\n if (die[i] == 0) return i;\n for (int i = 0; i < 4; i++)\n if (die[i] == 1) return i;\n return 0;\n } else return direction;\n }\n }",
"public void getNeighbors(){\n // North \n if(this.row - this.value>=0){\n this.north = adjacentcyList[((this.row - this.value)*col_size)+col];\n }\n // South\n if(this.row + value<row_size){\n this.south = adjacentcyList[((this.row+this.value)*row_size)+col];\n }\n // East\n if(this.col + this.value<col_size){\n this.east = adjacentcyList[((this.col+this.value)+(this.row)*(col_size))];\n }\n // West\n if(this.col - this.value>=0){\n this.west = adjacentcyList[((this.row*col_size)+(this.col - this.value))];\n }\n }",
"public static void main(String[] args){\n java.util.Scanner read = new java.util.Scanner(System.in);\n\n char[][] one = {\n {' ',' ',' '},\n {' ','|',' '},\n {' ','|',' '},\n };\n char[][] two = {\n {' ','_',' '},\n {' ','_','|'},\n {'|','_',' '},\n };\n char[][] three = {\n {' ','_',' '},\n {' ','_','|'},\n {' ','_','|'},\n };\n char[][] four = {\n {' ',' ',' '},\n {'|','_','|'},\n {' ',' ','|'},\n };\n char[][] five = {\n {' ','_',' '},\n {'|','_',' '},\n {' ','_','|'},\n };\n char[][] six = {\n {' ','_',' '},\n {'|','_',' '},\n {'|','_','|'},\n };\n char[][] seven = {\n {' ','_',' '},\n {'|',' ','|'},\n {' ',' ','|'},\n };\n char[][] eighth = {\n {' ','_',' '},\n {'|','_','|'},\n {'|','_','|'},\n };\n char[][] nine = {\n {' ','_',' '},\n {'|','_','|'},\n {' ',' ','|'},\n };\n char[][] zero = {\n {' ','_',' '},\n {'|',' ','|'},\n {'|','_','|'},\n };\n\n double num = read.nextDouble();\n\n int k = 0;\n while(num>1 ) {\n num = num/10;\n k++;\n }\n char[][] canvas = new char[3][k*3];\n int[] dig = new int[k];\n for(int l= 0;l<k;l++){\n num = (num*10)-(((int)num)*10);\n dig[l] = (int)num;\n }\n\n\n //asignar para imprimir\n int w = 0;\n int o =0;\n //filas\n for(int n = 0;n<3;n++){\n w=0;\n o=0;\n //columnas\n while(w<k){\n //asignacion\n for(int j = 0;j<3;j++){\n if(dig[w] == 1) {\n canvas[n][o+j] = one[n][j];\n }\n else if(dig[w] == 2) {\n canvas[n][o+j] = two[n][j];\n }\n else if(dig[w] == 3) {\n canvas[n][o+j] = three[n][j];\n }\n else if(dig[w] == 4) {\n canvas[n][o+j] = four[n][j];\n }\n else if(dig[w] == 5) {\n canvas[n][o+j] = five[n][j];\n }\n else if(dig[w] == 6) {\n canvas[n][o+j] = six[n][j];\n }\n else if(dig[w] == 7) {\n canvas[n][o+j] = seven[n][j];\n }\n else if(dig[w] == 8) {\n canvas[n][o+j] = eighth[n][j];\n }\n else if(dig[w] == 9) {\n canvas[n][o+j] = nine[n][j];\n }\n else if(dig[w] == 0) {\n canvas[n][o+j] = zero[n][j];\n }\n }\n o+=3;\n w++;\n }\n }\n //print\n for(int u =0;u<3;u++)\n {\n for (int i = 0; i < k*3; i++) {\n System.out.print(canvas[u][i]);\n }\n System.out.println();\n }\n }",
"private int xyToOneD(int row, int col) {\n return ((row - 1) * grid.length) + (col - 1);\n }",
"public List<int[]> getCoords(Board lev){\n \tint[][] coords;\n \tColumn c = lev.getColumns().get(col);\n \tint[] p1 = c.getFrontPoint1();\n \tint[] p2 = c.getFrontPoint2();\n\n \tif (isPod && z < Board.BOARD_DEPTH) {\n \t\tint cx = p1[0] + (p2[0]-p1[0])/2;\n \t\tint cy = p1[1] + (p2[1]-p1[1])/2;\n\n \t\t// define outer and inner diamonds\n \t\tint[][] outer = new int[4][3];\n \t\tint[][] inner = new int[4][3];\n \t\touter[0][0] = cx;\n \t\touter[0][1] = cy - PODSIZE;\n \t\touter[0][2] = (int)z;\n \t\touter[1][0] = cx + PODSIZE;\n \t\touter[1][1] = cy;\n \t\touter[1][2] = (int) z;\n \t\touter[2][0] = cx;\n \t\touter[2][1] = cy + PODSIZE;\n \t\touter[2][2] = (int) z;\n \t\touter[3][0] = cx - PODSIZE;\n \t\touter[3][1] = cy;\n \t\touter[3][2] = (int) z;\n \t\tinner[0][0] = cx;\n \t\tinner[0][1] = cy - PODSIZE/3;\n \t\tinner[0][2] = (int) z;\n \t\tinner[1][0] = cx + PODSIZE/3;\n \t\tinner[1][1] = cy;\n \t\tinner[1][2] = (int) z;\n \t\tinner[2][0] = cx;\n \t\tinner[2][1] = cy + PODSIZE/3;\n \t\tinner[2][2] = (int) z;\n \t\tinner[3][0] = cx - PODSIZE/3;\n \t\tinner[3][1] = cy;\n \t\tinner[3][2] = (int) z;\n\n \t\t// define line path through those diamonds:\n \t\tcoords = new int[17][3];\n \t\tcoords[0] = outer[0];\n \t\tcoords[1] = outer[1];\n \t\tcoords[2] = inner[1];\n \t\tcoords[3] = inner [0];\n \t\tcoords[4] = outer[1];\n \t\tcoords[5] = outer[2];\n \t\tcoords[6] = inner[2];\n \t\tcoords[7] = inner[1];\n \t\tcoords[8] = outer[2];\n \t\tcoords[9] = outer[3];\n \t\tcoords[10]= inner[3];\n \t\tcoords[11]= inner[2];\n \t\tcoords[12]= outer[3];\n \t\tcoords[13]= outer[0];\n \t\tcoords[14]= inner[0];\n \t\tcoords[15]= inner[3];\n \t\tcoords[16]= outer[0];\n \t}\n \telse { \n \t\tcoords = new int[7][3];\n \t\tswitch (s) {\n \t\tcase STRAIGHT:\n \t\t\tcoords[0][0] = p1[0];\n \t\t\tcoords[0][1] = p1[1];\n \t\t\tcoords[0][2] = (int) (z-EXHEIGHT_H);\n \t\t\tcoords[1][0] = p2[0];\n \t\t\tcoords[1][1] = p2[1];\n \t\t\tcoords[1][2] = (int) (z+EXHEIGHT_H);\n \t\t\tcoords[2][0] = p2[0] - (p2[0]-p1[0])/3;\n \t\t\tcoords[2][1] = p2[1] - (p2[1]-p1[1])/3;\n \t\t\tcoords[2][2] = (int) z;\n \t\t\tcoords[3][0] = p2[0];\n \t\t\tcoords[3][1] = p2[1];\n \t\t\tcoords[3][2] = (int) (z-EXHEIGHT_H);\n \t\t\tcoords[4][0] = p1[0];\n \t\t\tcoords[4][1] = p1[1];\n \t\t\tcoords[4][2] = (int) (z+EXHEIGHT_H);\n \t\t\tcoords[5][0] = p1[0] + (p2[0]-p1[0])/3;\n \t\t\tcoords[5][1] = p1[1] + (p2[1]-p1[1])/3;\n \t\t\tcoords[5][2] = (int) z;\n \t\t\tcoords[6][0] = p1[0];\n \t\t\tcoords[6][1] = p1[1];\n \t\t\tcoords[6][2] = (int) (z-EXHEIGHT_H);\n \t\t\tbreak;\n\n \t\tcase JUMPRIGHT1:\n \t\tcase LANDRIGHT2:\n \t\t\tcoords[0][0] = p1[0] + (p2[0]-p1[0])/4;\n \t\t\tcoords[0][1] = p1[1] + (p2[1]-p1[1])/4;\n \t\t\tcoords[0][2] = (int) (z+EXHEIGHT_H*2);\n \t\t\tcoords[1][0] = p2[0] + (p2[0]-p1[0])/4;\n \t\t\tcoords[1][1] = p2[1] + (p2[1]-p1[1])/4;\n \t\t\tcoords[1][2] = (int) (z+EXHEIGHT_H*2);\n \t\t\tcoords[2][0] = p2[0] - (p2[0]-p1[0])/11;\n \t\t\tcoords[2][1] = p2[1] - (p2[1]-p1[1])/11;\n \t\t\tcoords[2][2] = (int) (z+EXHEIGHT_H*1.8);\n \t\t\tcoords[3][0] = p2[0];\n \t\t\tcoords[3][1] = p2[1];\n \t\t\tcoords[3][2] = (int) z;\n \t\t\tcoords[4][0] = (int) (p1[0] + (p2[0]-p1[0])/2);\n \t\t\tcoords[4][1] = (int) (p1[1] + (p2[1]-p1[1])/2);\n \t\t\tcoords[4][2] = (int) (z+ EXHEIGHT_H*5);\n \t\t\tcoords[5][0] = (int) (p2[0] - (p2[0]-p1[0])/2.5);\n \t\t\tcoords[5][1] = (int) (p2[1] - (p2[1]-p1[1])/2.5);\n \t\t\tcoords[5][2] = (int) (z+EXHEIGHT_H *2.6);\n \t\t\tcoords[6] = coords[0];\n \t\t\tbreak;\n\n \t\tcase JUMPLEFT1:\n \t\tcase LANDLEFT2:\n \t\t\tcoords[0][0] = p1[0];\n \t\t\tcoords[0][1] = p1[1];\n \t\t\tcoords[0][2] = (int) z;\n \t\t\tcoords[1][0] = (int) (p1[0] + (p2[0]-p1[0])/2);\n \t\t\tcoords[1][1] = (int) (p1[1] + (p2[1]-p1[1])/2);\n \t\t\tcoords[1][2] = (int) (z+ EXHEIGHT_H*5);\n \t\t\tcoords[2][0] = (int) (p1[0] + (p2[0]-p1[0])/2.5);\n \t\t\tcoords[2][1] = (int) (p1[1] + (p2[1]-p1[1])/2.5);\n \t\t\tcoords[2][2] = (int) (z+EXHEIGHT_H *2.6);\n \t\t\tcoords[3][0] = p2[0] - (p2[0]-p1[0])/4;\n \t\t\tcoords[3][1] = p2[1] - (p2[1]-p1[1])/4;\n \t\t\tcoords[3][2] = (int) (z+EXHEIGHT_H*2);\n \t\t\tcoords[4][0] = p1[0] - (p2[0]-p1[0])/4;\n \t\t\tcoords[4][1] = p1[1] - (p2[1]-p1[1])/4;\n \t\t\tcoords[4][2] = (int) (z+EXHEIGHT_H*2);\n \t\t\tcoords[5][0] = p1[0] + (p2[0]-p1[0])/11;\n \t\t\tcoords[5][1] = p1[1] + (p2[1]-p1[1])/11;\n \t\t\tcoords[5][2] = (int) (z+EXHEIGHT_H*1.8);\n \t\t\tcoords[6] = coords[0];\n \t\t\tbreak;\n\n \t\tcase JUMPLEFT2:\n \t\tcase LANDLEFT1:\n \t\t\tcoords[0][0] = p1[0];\n \t\t\tcoords[0][1] = p1[1];\n \t\t\tcoords[0][2] = (int) z;\n \t\t\tcoords[1][0] = (int) (p1[0] + (p2[0]-p1[0])/4.5);\n \t\t\tcoords[1][1] = (int) (p1[1] + (p2[1]-p1[1])/4.5);\n \t\t\tcoords[1][2] = (int) (z+ EXHEIGHT_H*8);\n \t\t\tcoords[2][0] = (int) (p1[0] + (p2[0]-p1[0])/4.5);\n \t\t\tcoords[2][1] = (int) (p1[1] + (p2[1]-p1[1])/4.5);\n \t\t\tcoords[2][2] = (int) (z+EXHEIGHT_H *4);\n \t\t\tcoords[3][0] = p2[0] - (p2[0]-p1[0])/2;\n \t\t\tcoords[3][1] = p2[1] - (p2[1]-p1[1])/2;\n \t\t\tcoords[3][2] = (int) (z+EXHEIGHT_H*4);\n \t\t\tcoords[4][0] = (int) (p1[0] - (p2[0]-p1[0])/3.5);\n \t\t\tcoords[4][1] = (int) (p1[1] - (p2[1]-p1[1])/3.5);\n \t\t\tcoords[4][2] = (int) (z+EXHEIGHT_H*1.8);\n \t\t\tcoords[5][0] = p1[0];// - (p2[0]-p1[0])/15;\n \t\t\tcoords[5][1] = p1[1];// - (p2[1]-p1[1])/15;\n \t\t\tcoords[5][2] = (int) (z+EXHEIGHT_H*1.8);\n \t\t\tcoords[6] = coords[0];\n \t\t\tbreak;\n\n \t\tcase JUMPRIGHT2:\n \t\tcase LANDRIGHT1:\n \t\t\tcoords[0][0] = p2[0] - (p2[0]-p1[0])/2;\n \t\t\tcoords[0][1] = p2[1] - (p2[1]-p1[1])/2;\n \t\t\tcoords[0][2] = (int) (z+EXHEIGHT_H*4);\n \t\t\tcoords[1][0] = (int) (p2[0] + (p2[0]-p1[0])/3.5);\n \t\t\tcoords[1][1] = (int) (p2[1] + (p2[1]-p1[1])/3.5);\n \t\t\tcoords[1][2] = (int) (z+EXHEIGHT_H*1.8);\n \t\t\tcoords[2][0] = p2[0];// - (p2[0]-p1[0])/15;\n \t\t\tcoords[2][1] = p2[1];// - (p2[1]-p1[1])/15;\n \t\t\tcoords[2][2] = (int) (z+EXHEIGHT_H*1.8);\n \t\t\tcoords[3][0] = p2[0];\n \t\t\tcoords[3][1] = p2[1];\n \t\t\tcoords[3][2] = (int) z;\n \t\t\tcoords[4][0] = (int) (p2[0] - (p2[0]-p1[0])/4.5);\n \t\t\tcoords[4][1] = (int) (p2[1] - (p2[1]-p1[1])/4.5);\n \t\t\tcoords[4][2] = (int) (z+ EXHEIGHT_H*8);\n \t\t\tcoords[5][0] = (int) (p2[0] - (p2[0]-p1[0])/4.5);\n \t\t\tcoords[5][1] = (int) (p2[1] - (p2[1]-p1[1])/4.5);\n \t\t\tcoords[5][2] = (int) (z+EXHEIGHT_H *4);\n \t\t\tcoords[6] = coords[0];\n \t\t\tbreak;\n \t\t}\n \t}\n\n \treturn Arrays.asList(coords);\n }",
"@Override\n\tpublic List<Cell> calcNeighbors(int row, int col) {\n\t\tList<Cell> neighborLocs = new ArrayList<>();\n\t\tint shift_constant = 1 - 2*((row+col) % 2);\n\t\tif(!includesDiagonals) {\n\t\t\tfor(int a = col - 1; a <= col + 1; a++) {\n\t\t\t\tif(a == col)\n\t\t\t\t\taddLocation(row + shift_constant,a,neighborLocs);\n\t\t\t\telse \n\t\t\t\t\taddLocation(row,a,neighborLocs);\n\t\t\t}\n\t\t\treturn neighborLocs;\n\t\t}\n\t\tfor(int b = col - 2; b <= col + 2; b++) {\n\t\t\tfor(int a = row; a != row + 2*shift_constant; a += shift_constant) {\n\t\t\t\tif(a == row && b == col)\n\t\t\t\t\tcontinue;\n\t\t\t\taddLocation(a,b,neighborLocs);\n\t\t\t}\n\t\t}\n\t\tfor(int b = col -1; b <= col + 1; b++) {\n\t\t\taddLocation(row - shift_constant,b,neighborLocs);\n\t\t}\n\t\treturn neighborLocs;\n\t}",
"private void buildPath() {\r\n int xNext = 1;\r\n int yNext = map.getStartPos() + 1;\r\n CellLayered before = cells[yNext][xNext];\r\n while(true)\r\n {\r\n Byte[] xy = map.getDirection(xNext-1, yNext-1);\r\n xNext = xNext + xy[0];\r\n yNext = yNext + xy[1];\r\n\r\n CellLayered next = cells[yNext][xNext];\r\n\r\n if(xy[0]==-1)\r\n before.setRight(false);\r\n else\r\n before.setRight(true);\r\n before.setPath(true);\r\n if(next==null)\r\n break;\r\n\r\n before.setNextInPath(next);\r\n before = next;\r\n }\r\n }",
"private ArrayList<Pair> getPossibleDestinations(int sourceRow, int sourceCol, int dr, int dc) {\n ArrayList<Pair> possibleDest = new ArrayList<>();\n\n for (int i = 1; i < 8; i++) {\n\n int destRow = sourceRow + dr * i;\n int destCol = sourceCol + dc * i;\n\n if (0 <= destRow && destRow < 8 && 0 <= destCol && destCol < 8)\n possibleDest.add(new Pair<>(destRow, destCol));\n else\n break;\n }\n\n return possibleDest;\n }",
"public void adjustMap(MapData mapd){\n int[][] map = mapd.getMap();\n int mx=mapd.getX();\n int my=mapd.getY();\n for(int y=0;y<my;y++){\n for(int x=0;x<mx;x++){\n boolean l = false;\n boolean r = false;\n boolean t = false;\n boolean b = false;\n boolean tl = false;\n boolean tr = false;\n boolean bl = false;\n boolean br = false;\n \n\n if(map[x][y]>0 && map[x][y]<26) {\n int mustSet = 0;\n //LEFT\n if (x > 0 && map[x - 1][y] > 0 && map[x-1][y]<26) {\n l = true;\n }\n //RIGHT\n if (x < mx - 1 && map[x + 1][y] > 0 && map[x+1][y]<26) {\n r = true;\n }\n //TOP\n if (y > 0 && map[x][y - 1] > 0 && map[x][y-1]<26) {\n t = true;\n }\n //Bottom\n if (y < my - 1 && map[x][y + 1] > 0 && map[x][y+1]<26) {\n b = true;\n }\n //TOP LEFT\n if (x > 0 && y > 0 && map[x - 1][y - 1] > 0 && map[x-1][y-1]<26) {\n tl = true;\n }\n //TOP RIGHT\n if (x < mx - 1 && y > 0 && map[x + 1][y - 1] > 0 && map[x+1][y-1]<26) {\n tr = true;\n }\n //Bottom LEFT\n if (x > 0 && y < my - 1 && map[x - 1][y + 1] > 0 && map[x-1][y+1]<26) {\n bl = true;\n }\n //Bottom RIGHT\n if (x < mx - 1 && y < my - 1 && map[x + 1][y + 1] > 0 && map[x+1][y+1]<26) {\n br = true;\n }\n\n //Decide Image to View\n if (!r && !l && !t && !b) {\n mustSet = 23;\n }\n if (r && !l && !t && !b) {\n mustSet = 22;\n }\n if (!r && l && !t && !b) {\n mustSet = 25;\n }\n if (!r && !l && t && !b) {\n mustSet = 21;\n }\n if (!r && !l && !t && b) {\n mustSet = 19;\n }\n if (r && l && !t && !b) {\n mustSet = 24;\n }\n if (!r && !l && t && b) {\n mustSet = 20;\n }\n if (r && !l && t && !b && !tr) {\n mustSet = 11;\n }\n if (r && !l && t && !b && tr) {\n mustSet = 2;\n }\n if (!r && l && t && !b && !tl) {\n mustSet = 12;\n }\n if (!r && l && t && !b && tl) {\n mustSet = 3;\n }\n if (r && !l && !t && b && br) {\n mustSet = 1;\n }\n if (r && !l && !t && b && !br) {\n mustSet = 10;\n }\n if (!r && l && !t && b && bl) {\n mustSet = 4;\n }\n if (r && !l && t && b && !tr) {\n mustSet = 15;\n }\n if (r && !l && t && b && tr) {\n mustSet = 6;\n }\n if (!r && l && t && b && !tl) {\n mustSet = 17;\n }\n if (!r && l && t && b && tl) {\n mustSet = 8;\n }\n if (r && l && !t && b && !br) {\n mustSet = 14;\n }\n if (r && l && !t && b && br) {\n mustSet = 5;\n }\n if (r && l && t && !b && !tr) {\n mustSet = 16;\n }\n if (r && l && t && !b && tr) {\n mustSet = 7;\n }\n if (!r && l && !t && b && !bl) {\n mustSet = 13;\n }\n if (r && l && t && b && br && tl) {\n mustSet = 9;\n }\n if (r && l && t && b && !br && !tl) {\n mustSet = 18;\n }\n\n //System.out.println(\"MAP SEGMENT : \" + mustSet);\n map[x][y] = mustSet;\n }\n mapd.setMap(map);\n }\n }\n System.out.println(\"Map Adjust OK !\");\n }",
"public boolean diag2(){\n\tboolean trouve=false;\n\tint i=0;\n\tObject tmp='@';\n\twhile(i<5 && !trouve){\n\t\tif(gc[i][gc.length-i-1]==tmp)\n\t\t\ttrouve=true;\n\t\telse\n\t\t\ti++;\n\t}\n\treturn trouve;\n}",
"private int diagonalCount() {\n\t\treturn Math.abs(destRow-curRow) > Math.abs(destCol-curCol) ?\n\t\t\t Math.abs(destCol-curCol) : Math.abs(destRow-curRow);\n\t}",
"public Cell diagonal(UTTTSubBoard board, List<Cell> cells) {\n Iterator iterator = cells.iterator();\n while(iterator.hasNext()) {\n Cell cell = (Cell) iterator.next();\n\n int x = cell.getCell().getRow();\n int y = cell.getCell().getRow();\n\n if ((x + y)%2 == 0){ \n\n if (x == 1 && y == 1){\n int firstXIndexToCheck = ((((x+1)%3)+3)%3);\n int secondXIndexToCheck = ((((x-1)%3)+3)%3);\n\n int firstYIndexToCheck = ((((y+1)%3)+3)%3);\n int secondYIndexToCheck = ((((y-1)%3)+3)%3);\n\n Coords firstCoord = new Coords(firstXIndexToCheck, firstYIndexToCheck);\n Coords secondCoord = new Coords(secondXIndexToCheck, secondYIndexToCheck);\n Coords thirdCoord = new Coords(secondXIndexToCheck, firstYIndexToCheck);\n Coords fourthCoord = new Coords(firstXIndexToCheck, secondYIndexToCheck);\n \n Cell firstCell = board.getCell(firstCoord);\n Cell secondCell = board.getCell(secondCoord);\n Cell thirdCell = board.getCell(thirdCoord);\n Cell fourthCell = board.getCell(fourthCoord);\n\n if (firstCell.getPlayer() == PlayerEnum.ME && secondCell.getPlayer() == PlayerEnum.ME){\n return cell;\n }\n else if (thirdCell.getPlayer() == PlayerEnum.ME && fourthCell.getPlayer() == PlayerEnum.ME){\n return cell;\n }\n // else if (firstCell.getPlayer() == PlayerEnum.ME || secondCell.getPlayer() == PlayerEnum.ME\n // || thirdCell.getPlayer() == PlayerEnum.ME || fourthCell.getPlayer() == PlayerEnum.ME) {\n // matchedCells.add(cell);\n // }\n }\n\n else {\n\n int firstXIndexToCheck = ((((x+1)%3)+3)%3);\n int secondXIndexToCheck = ((((x-1)%3)+3)%3);\n\n int firstYIndexToCheck = ((((y+1)%3)+3)%3);\n int secondYIndexToCheck = ((((y-1)%3)+3)%3);\n\n Coords firstCoord = new Coords(firstXIndexToCheck, firstYIndexToCheck);\n Coords secondCoord = new Coords(secondXIndexToCheck, secondYIndexToCheck);\n\n Cell firstCell = board.getCell(firstCoord);\n Cell secondCell = board.getCell(secondCoord);\n\n if (firstCell.getPlayer() == PlayerEnum.ME && secondCell.getPlayer() == PlayerEnum.ME){\n return cell;\n }\n else if (firstCell.getPlayer() == PlayerEnum.ME || secondCell.getPlayer() == PlayerEnum.ME) {\n matchedCells.add(cell);\n }\n\n }//else\n }\n }\n return null;\n }",
"public static Matrix generateBigDiagonal(int size, boolean oppositedirection, double... ds) throws Exception {\n\t\tdouble[][] a = new double[size][size];\n\t\tint numparams = ds.length;\n\t\t\n\t\tif(!oppositedirection) {\n\t\t\tswitch(numparams) {\n\t\t\t\tcase 1: for(int i = 0; i<size; i++){\n\t\t\t \t\t\tfor(int j =0; j<size; j++){\n\t\t\t \t\t\t\tif(j == i) a[i][j] = ds[0];\n\t\t\t \t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 3: for(int i = 0; i<size; i++){\n\t\t\t \t\t\tfor(int j =0; j<size; j++){\n\t\t\t \t\t\t\tif(j == i-1) a[i][j] = ds[0];\n\t\t\t \t\t\t\tif(j == i) a[i][j] = ds[1];\n\t\t\t \t\t\t\tif(j == i+1) a[i][j] = ds[2];\n\t\t\t \t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 5: for(int i = 0; i<size; i++){\n\t \t\t\t\t\tfor(int j =0; j<size; j++){\n\t \t\t\t\t\t\tif(j == i-2) a[i][j] = ds[0];\n\t \t\t\t\t\t\tif(j == i-1) a[i][j] = ds[1];\n\t \t\t\t\t\t\tif(j == i) a[i][j] = ds[2];\n\t \t\t\t\t\t\tif(j == i+1) a[i][j] = ds[3];\n\t \t\t\t\t\t\tif(j == i+2) a[i][j] = ds[4];\n\t \t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault: throw new Exception(\"Invalid number of parameters\");\n\t\t\t}\n\t\t} else {\n\t\t\tswitch(numparams) {\n\t\t\tcase 1: for(int i = 0; i<size; i++){\n\t\t \t\t\tfor(int j =0; j<size; j++){\n\t\t \t\t\t\tif(j+i == size-1) a[i][j] = ds[0];\n\t\t \t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 3: for(int i = 0; i<size; i++){\n\t\t \t\t\tfor(int j =0; j<size; j++){\n\t\t \t\t\t\tif(j+i == size-2) a[i][j] = ds[0];\n\t\t \t\t\t\tif(j+i == size-1) a[i][j] = ds[1];\n\t\t \t\t\t\tif(j+i == size) a[i][j] = ds[2];\n\t\t \t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 5: for(int i = 0; i<size; i++){\n \t\t\t\t\tfor(int j =0; j<size; j++){\n \t\t\t\t\t\tif(j+i == size-3) a[i][j] = ds[0];\n \t\t\t\t\t\tif(j+i == size-2) a[i][j] = ds[1];\n \t\t\t\t\t\tif(j+i == size-1) a[i][j] = ds[2];\n \t\t\t\t\t\tif(j+i == size) a[i][j] = ds[3];\n \t\t\t\t\t\tif(j+i == size+1) a[i][j] = ds[4];\n \t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\n\t\t\tdefault: throw new Exception(\"Invalid number of parameters\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tMatrix A = new Matrix(a);\n\t\n\t\treturn A;\n\t}",
"public boolean canMove(int direction) {\r\n //right\r\n if (direction == 0) {\r\n if (map[i][j + 1] == '0' && map[i + 1][j] != '0' && map[i + 1][j] != map[i][j])\r\n return true;\r\n else return false;\r\n }\r\n //left\r\n else if (direction == 1) {\r\n if (map[i][j - 1] == '0' && map[i + 1][j] != '0' && map[i + 1][j] != map[i][j])\r\n return true;\r\n else return false;\r\n }\r\n return false;\r\n }",
"private void findWay(MazeCell[] surrounds) {\r\n for (int i = 0; i < surrounds.length; i++) {\r\n if (surrounds[i].isMovable && surrounds[i].getFootprint()) {\r\n int d = faceDir.ordinal();\r\n faceDir = Direction.values()[(d + i) % 4];\r\n }\r\n }\r\n }",
"private void assignDirection(char d) throws InputMismatchException{\n\t\tif(d == NL) {\n\t\t\tdir = NL;\n\t\t}else if(d == NR) {\n\t\t\tdir = NR;\n\t\t}else if(d == SL) {\n\t\t\tdir = SL;\n\t\t}else if(d == SR){\n\t\t\tdir = SR;\n\t\t}else {\n\t\t\tthrow new InputMismatchException(\"There is no such filling direction.\");\n\t\t}\n\t}",
"public static void main(String[] args) {\n\tScanner s = new Scanner(System.in);\n\tSystem.out.println(\"rows?\");\n\tint r = s.nextInt();\n\tSystem.out.println(\"Col?\");\n\tint c = s.nextInt();\n\tint[][] arr = new int[r][c];\n\tfor (int i = 0; i < arr.length; i++) {\n\t\tfor (int j = 0; j < arr[0].length; j++) {\n\t\t\tarr[i][j] = 0x3f3f3f3f;\n\t\t}\n\t}\n\tfor (int i = 0; i < arr.length; i++) {\n\t\tarr[i][i] = 0;\n\t}\n\twhile(true)\n\t{\n\t\t//System.out.println(\"Vertex 1?\");\n\t\tint x = s.nextInt();\n\t\t//System.out.println(\"Vertex 2?\");\n\t\tint y = s.nextInt();\n\t\t//System.out.println(\"Distance?\");\n\t\tint d = s.nextInt();\n\t\t\n\t\tif (x == -1) {\n\t\t\tbreak;\n\t\t}\n\t\tarr[x][y] = d;\n\t\tarr[y][x] = d;\n\t}\n\tfor(int k = 0; k < arr.length;k++)\n\t{\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tfor (int j = 0; j < arr.length; j++) {\n\t\t\t\tif(arr[i][k] + arr[k][j] < arr[i][j])\n\t\t\t\t{\n\t\t\t\t\tarr[i][j] = arr[i][k] + arr[k][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tSystem.out.println(arr[0][4]);\n\t\n}",
"private AntArea.Cell getCellInDirection(Pair<Integer, Integer> direction) {\n int newX = location.getKey() + direction.getKey();\n int newY = location.getValue() + direction.getValue();\n\n //Torus shape\n newX = newX < 0 ? antArea.getAreaWidth() - 1 : newX;\n newY = newY < 0 ? antArea.getAreaHeight() - 1 : newY;\n newX %= antArea.getAreaWidth();\n newY %= antArea.getAreaHeight();\n\n return antArea.getMap()[newX][newY];\n }",
"private void go(int i) {\n\t\tcol[i] = 1;\r\n\t\tint j = f[i];\r\n\t\tint cnt = 0;\r\n\t\tint delAll = 0;\r\n\t\tint[][] cd = new int[1000][3];\r\n\t\tint sa = 0;\r\n\t\tint sb = 0;\r\n\t\tint m1 = Integer.MAX_VALUE;\r\n\t\tint m2 = Integer.MAX_VALUE;\r\n\t\tint m1a = 0;\r\n\t\tint m2a = 0;\r\n\t\tint m1b = 0;\r\n\t\tint m2b = 0;\r\n\t\twhile (j != -1) {\r\n\t\t\tif (col[e[j]] == 0) {\r\n\t\t\t\tgo(e[j]);\r\n\t\t\t\tdelAll += a[e[j]];\r\n\t\t\t\tint dif = b[e[j]] - a[e[j]];\r\n\t\t\t\tif (dif < m1) {\r\n\t\t\t\t\tm2 = m1;\r\n\t\t\t\t\tm2b = m1b;\r\n\t\t\t\t\tm2a = m1a;\r\n\t\t\t\t\tm1 = dif;\r\n\t\t\t\t\tm1a = a[e[j]];\r\n\t\t\t\t\tm1b = b[e[j]];\r\n\t\t\t\t} else if (dif < m2) {\r\n\t\t\t\t\tm2 = dif;\r\n\t\t\t\t\tm2a = a[e[j]];\r\n\t\t\t\t\tm2b = b[e[j]];\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tsa += a[e[j]];\r\n\t\t\t\tsb += a[e[j]];\r\n\t\t\t\tcd[cnt][0] = a[e[j]];\r\n\t\t\t\tcd[cnt][1] = b[e[j]];\r\n\t\t\t\tcd[cnt][2] = b[e[j]] - a[e[j]];\r\n\t\t\t\tcnt++;\r\n\t\t\t}\r\n\t\t\tj = next[j];\r\n\t\t}\r\n\t\tif (cnt == 0) {\r\n\t\t\ta[i] = 1;\r\n\t\t\tb[i] = 0;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tArrays.sort(cd, new Comparator<int[]>() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(int[] o1, int[] o2) {\r\n\t\t\t\t// TODO Auto-generated method stub\t\t\t\t\r\n\t\t\t\treturn o1[2] - o2[2];\r\n\t\t\t}\r\n\t\t});\r\n\t\ta[i] = delAll + 1;\r\n\t\t//leave 0 or 2\r\n\t\tint cost1 = 0;\r\n\t\tint cost = 0;\r\n\t\tfor (j = 2; j < cnt; j++)\r\n\t\t\tcost1 += cd[j][0];\r\n\t\tif (cnt >= 2) {\r\n\t\t\tcost += m1b + m2b + sa - m1a - m2a;\r\n\t\t\tcost1 += cd[0][1] + cd[1][1];\r\n\t\t} else {\r\n\t\t\tcost += sa;\r\n\t\t\tcost1 += cd[0][0];\r\n\t\t}\r\n\t\tif (cost1 != cost)\r\n\t\t\tSystem.err.println(\"FUCK\");\r\n\t\tb[i] = cost;\r\n\t}",
"public void doDfsGraphMatrix(char[][] grid) {\n boolean[] myVisited = new boolean[8];\n // row number represents node, so row number will be pushed to stack\n Stack<Integer> stack = new Stack<>();\n stack.push(0);\n myVisited[0] = true;\n // should be same idea, when adj list, loop the row\n while (!stack.isEmpty()) {\n int r = stack.pop();\n System.out.print(\"[\" + r + \"] \");\n for (int c = 0; c < grid[r].length; c++) {\n // when there is a path\n if (grid[r][c] == '1' && !visited[c]) {\n stack.push(c);\n visited[c] = true;\n }\n }\n }\n\n\n }",
"public static void main(String[] args) {\n int[][] map = new int[N][N];\r\n // 1D to 2D index map\r\n CustomPair[] indToVal = new CustomPair[(N * N) + 1];\r\n // 2D to value map\r\n Map<CustomPair, Integer> gridToValue = new HashMap<>();\r\n // Direction to start\r\n Direction dir = Direction.RIGHT;\r\n int j = 1;\r\n int y = N / 2;\r\n // shift left for even n's\r\n int x = (N % 2 == 0) ? y - 1 : y;\r\n /**\r\n * We use y, x here because the grid is sort of turned around.\r\n * */\r\n while(j <= ((N * N))) {\r\n CustomPair currentIndex = new CustomPair(y, x);\r\n // if the number is not prime it is traversable\r\n if (!isPrime(j)) {\r\n map[y][x] = 1;\r\n gridToValue.put(currentIndex, j);\r\n } else {\r\n map[y][x] = -1;\r\n }\r\n // add the value to 1d to 2d index values\r\n indToVal[j] = currentIndex;\r\n switch(dir){\r\n case RIGHT:\r\n if(x <= (N - 1) && map[y - 1][x] == 0 && j > 1)\r\n dir = Direction.UP;\r\n break;\r\n case UP:\r\n if(map[y][x - 1] == 0)\r\n dir = Direction.LEFT;\r\n break;\r\n case LEFT:\r\n if(x == 0 || map[y + 1][x] == 0)\r\n dir = Direction.DOWN;\r\n break;\r\n case DOWN:\r\n if(map[y][x + 1] == 0)\r\n dir = Direction.RIGHT;\r\n break;\r\n }\r\n // update the grid index\r\n switch(dir){\r\n case RIGHT:\r\n x++;\r\n break;\r\n case UP:\r\n y--;\r\n break;\r\n case LEFT:\r\n x--;\r\n break;\r\n case DOWN:\r\n y++;\r\n break;\r\n }\r\n // update 1D index\r\n j++;\r\n }\r\n\r\n Scanner sc = new Scanner(System.in);\r\n int caseNum = 1;\r\n while (sc.hasNextInt()) {\r\n int start = sc.nextInt();\r\n int goal = sc.nextInt();\r\n // find the shortest path\r\n Queue<CustomPair> q = new LinkedList<>();\r\n // 2D grid to distance values\r\n Map<CustomPair, Integer> distMap = new HashMap<>();\r\n // start is 0\r\n distMap.put(indToVal[start], 0);\r\n q.add(indToVal[start]);\r\n while (!q.isEmpty()) {\r\n CustomPair cur = q.remove();\r\n // for each neighbour (4 potential moves)\r\n for (int i = 0; i < 4; i++) {\r\n int nx = cur.a + X_NEIG_INDEX[i];\r\n int ny = cur.b + Y_NEIG_INDEX[i];\r\n CustomPair neighP = new CustomPair(nx, ny);\r\n // if the value is not in the grid\r\n if (!gridToValue.containsKey(neighP))\r\n continue;\r\n // if the value is already visited\r\n if (distMap.containsKey(neighP))\r\n continue;\r\n distMap.put(neighP, distMap.get(cur) + 1);\r\n q.add(neighP);\r\n }\r\n }\r\n // print for Kattis reasons\r\n String msg = \"Case \" + caseNum + \": \";\r\n if (!distMap.containsKey(indToVal[goal]) ||\r\n distMap.getOrDefault(indToVal[goal], -1) == -1 && start != goal)\r\n System.out.println(msg + \" impossible\");\r\n else\r\n System.out.println(msg + \"\" + distMap.get(indToVal[goal]));\r\n caseNum++;\r\n }\r\n }",
"void GenerateBoardPath() {\n\t\t\t\n\t\t\tint rows = board.getRowsNum();\n\t\t\tint columns = board.getColsNum();\n\t\t\tint space_number = 1; \n\t\t\t\n\t\t\t\n\t\t\tfor (int i = rows - 1; i >= 0; i--) \n\t\t\t\t//If the row is an odd-number, move L-R\n\t\t\t\tif (i % 2 != 0) {\n\t\t\t\t\tfor (int j = 0; j < columns; j++) \n\t\t\t\t\t\tBoardPathRepository.put(space_number++, board.getTile(i, j));}\n\t\t\t\telse {\n\t\t\t\t\tfor (int j = columns-1; j >=0; j--) \n\t\t\t\t\t\tBoardPathRepository.put(space_number++, board.getTile(i, j));\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t}",
"int cellFromDistance(int d) {\n int d2 = d - GUTTER_SIZE;\n if (d2 < 0) {\n return -1;\n } else {\n d2 /= (CELL_SIZE + GUTTER_SIZE);\n int next = cellDistance(d2 + 1);\n if (next - d <= GUTTER_SIZE)\n return -1;\n else\n return d2;\n }\n }",
"private int checkDiagonal() {\n if ((this.board[0][0] == this.board[1][1]) && this.board[0][0] == this.board[2][2]) {\n return this.board[0][0];\n } else if ((this.board[0][2] == this.board[1][1]) && this.board[0][2] == this.board[2][0]) {\n return this.board[0][2];\n } else {\n return 0;\n }\n }",
"public boolean diag1(){\n\tboolean trouve=false;\n\tint i=0;\n\tObject tmp='@';\n\twhile(i<5 && !trouve){\n\t\tif(gc[i][i]==tmp)\n\t\t\ttrouve=true;\n\t\telse\n\t\t\ti++;\n\t}\n\treturn trouve;\n}",
"public void findValidMoveDirections(){\n\t\t\n\t\tif(currentTile == 2 && (tileRotation == 0 || tileRotation == 180)){ // in vertical I configuration\n\t\t\tcanMoveNorth = true; canMoveSouth = true;\n\t\t\tcanMoveEast = false; canMoveWest = false;\n//\t\t\tSystem.out.println(\"Current Tile: \" + currentTile + \" Rotatation: \" + tileRotation +\n//\t\t\t\t\t\" N,S: T E,W: F\");\n\t\t}\n\t\telse if(currentTile == 2 && (tileRotation == 90 || tileRotation == 270)){ // in horizontal I configuration\n\t\t\tcanMoveNorth = false; canMoveSouth = false;\n\t\t\tcanMoveEast = true; canMoveWest = true;\n//\t\t\tSystem.out.println(\"Current Tile: \" + currentTile + \" Rotatation: \" + tileRotation +\n//\t\t\t\t\t\" N,S: F E,W: T\");\n\t\t}\n\t\t\n\t\t\n\t\telse if(currentTile == 3 && tileRotation == 0){ // L rotated 0 degrees\n\t\t\tcanMoveNorth = true; canMoveSouth = false;\n\t\t\tcanMoveEast = true; canMoveWest = false;\n//\t\t\tSystem.out.println(\"Current Tile: \" + currentTile + \" Rotatation: \" + tileRotation +\n//\t\t\t\t\t\" N,E: T S,W: F\");\n\t\t}\n\t\telse if(currentTile == 3 && tileRotation == 90){ // L rotated 90 degrees\n\t\t\tcanMoveNorth = true; canMoveSouth = false;\n\t\t\tcanMoveEast = false; canMoveWest = true;\n//\t\t\tSystem.out.println(\"Current Tile: \" + currentTile + \" Rotatation: \" + tileRotation +\n//\t\t\t\t\t\" N,W: T S,E: F\");\n\t\t}\n\t\telse if(currentTile == 3 && tileRotation == 180){ // L rotated 180 degrees\n\t\t\tcanMoveNorth = false; canMoveSouth = true;\n\t\t\tcanMoveEast = false; canMoveWest = true;\n//\t\t\tSystem.out.println(\"Current Tile: \" + currentTile + \" Rotatation: \" + tileRotation +\n//\t\t\t\t\t\" S,W: T N,E: F\");\n\t\t}\n\t\telse if(currentTile == 3 && tileRotation == 270){ // L rotated 270 degrees\n\t\t\tcanMoveNorth = false; canMoveSouth = true;\n\t\t\tcanMoveEast = true; canMoveWest = false;\n//\t\t\tSystem.out.println(\"Current Tile: \" + currentTile + \" Rotatation: \" + tileRotation +\n//\t\t\t\t\t\" S,E: T N,W: F\");\n\t\t}\n\t\t\n\t\t\n\t\telse if(currentTile == 4 && tileRotation == 0){ // T rotated 0 degrees\n\t\t\tcanMoveNorth = false; canMoveSouth = true;\n\t\t\tcanMoveEast = true; canMoveWest = true;\n//\t\t\tSystem.out.println(\"Current Tile: \" + currentTile + \" Rotatation: \" + tileRotation +\n//\t\t\t\t\t\" S,W,E: T N: F\");\n\t\t}\n\t\telse if(currentTile == 4 && tileRotation == 90){ // T rotated 90 degrees\n\t\t\tcanMoveNorth = true; canMoveSouth = true;\n\t\t\tcanMoveEast = true; canMoveWest = false;\n//\t\t\tSystem.out.println(\"Current Tile: \" + currentTile + \" Rotatation: \" + tileRotation +\n//\t\t\t\t\t\" N,S,E: T W: F\");\n\t\t}\n\t\telse if(currentTile == 4 && tileRotation == 180){ // T rotated 180 degrees\n\t\t\tcanMoveNorth = true; canMoveSouth = false;\n\t\t\tcanMoveEast = true; canMoveWest = true;\n//\t\t\tSystem.out.println(\"Current Tile: \" + currentTile + \" Rotatation: \" + tileRotation +\n//\t\t\t\t\t\" N,W,E: T S: F\");\n\t\t}\n\t\telse if(currentTile == 4 && tileRotation == 270){ // T rotated 270 degrees\n\t\t\tcanMoveNorth = true; canMoveSouth = true;\n\t\t\tcanMoveEast = false; canMoveWest = true;\n//\t\t\tSystem.out.println(\"Current Tile: \" + currentTile + \" Rotatation: \" + tileRotation +\n//\t\t\t\t\t\" N,S,W: T E: F\");\n\t\t}\n\t\telse if(currentTile == 5){ //in plus tile\n\t\t\tcanMoveNorth = true; canMoveSouth = true;\n\t\t\tcanMoveEast = true; canMoveWest = true;\n//\t\t\tSystem.out.println(\"Current Tile: \" + currentTile + \" Rotatation: \" + tileRotation +\n//\t\t\t\t\t\" N,S,W,E: T\");\n\t\t}\n\t\t\n\t}",
"public static void solve(char[][] board) {\n\t\t\n\t\tint height = board.length;\n\t\tif(height==0){\n\t\t\treturn;\n\t\t}\n\t\tint width = board[0].length;\n\t\t\n\t\tLinkedList<int[]> queue = new LinkedList<int[]>();\n\t\t//top edge & bottom edge\n\t\tfor (int i = 0; i < width; i++) {\n\t\t\tif(board[0][i]=='O'){\n\t\t\t\tint[] coord = {0, i};\n\t\t\t\tqueue.add(coord);\n\t\t\t}\n\t\t\t\n\t\t\tif(board[height-1][i]=='O'){\n\t\t\t\tint[] coord = {height-1, i};\n\t\t\t\tqueue.add(coord);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//left edge & right edge\n\t\tfor (int i = 0; i < height; i++) {\n\t\t\tif(board[i][0]=='O'){\n\t\t\t\tint[] coord = {i, 0};\n\t\t\t\tqueue.add(coord);\n\t\t\t}\n\t\t\t\n\t\t\tif(board[i][width-1]=='O'){\n\t\t\t\tint[] coord = {i, width-1};\n\t\t\t\tqueue.add(coord);\n\t\t\t}\n\t\t}\n\t\t\n\t\twhile(queue.size()>0){\n\t\t\tint[] coord = queue.removeLast();\n\t\t\tint row = coord[0];\n\t\t\tint column = coord[1];\n\t\t\tif(board[row][column]=='O'){\n\t\t\t\tboard[row][column]='.';\n\t\t\t}\n\t\t\t//check left cell.\n\t\t\tif(column-1>0 && board[row][column-1]=='O'){\n\t\t\t\tint[] newCoord = {row, column-1};\n\t\t\t\tqueue.add(newCoord);\n\t\t\t}\n\t\t\t\n\t\t\t//check right cell.\n\t\t\tif(column+1 < width-1&& board[row][column+1]=='O'){\n\t\t\t\tint[] newCoord = {row, column+1};\n\t\t\t\tqueue.add(newCoord);\n\t\t\t}\n\t\t\t\n\t\t\t//check upper cell.\n\t\t\tif(row-1>0 && board[row-1][column]=='O'){\n\t\t\t\tint[] newCoord = {row-1, column};\n\t\t\t\tqueue.add(newCoord);\n\t\t\t}\n\t\t\t\n\t\t\t//check lower cell.\n\t\t\tif(row+1<height-1 && board[row+1][column]=='O'){\n\t\t\t\tint[] newCoord = {row+1, column};\n\t\t\t\tqueue.add(newCoord);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//convert \".\" to \"O\" and \"O\" to \"X\".\n\t\tfor (int i = 0; i < height; i++) {\n\t\t\tfor (int j = 0; j < width; j++) {\n\t\t\t\tif(board[i][j]=='.'){\n\t\t\t\t\tboard[i][j] = 'O';\n\t\t\t\t}else if(board[i][j]=='O'){\n\t\t\t\t\tboard[i][j] = 'X';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void step() {\n\n if (n8) {\n // Your code here\n \n \n //by here, after your code, the cellsNext array should be updated properly\n }\n\n if (!n8) { // neighbours-4\n // your code here\n\n //by here, after your code, the cellsNext array should be updated properly\n }\n\n // Flip the arrays now.\n stepCounter++;\n\ttmp = cellsNow;\n cellsNow = cellsNext;\n\tcellsNext = tmp;\n\n }",
"public void generateAdjList(int row, int col) {\n\t\tBoardCell originCell = this.getCell(row, col);\t\t\t\t\t\t\t\t\t\t// Creates a temporary cell called originCell for convenience\n\t\tBoardCell testCell;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// another temporary cell called testCell\n\t\tif(originCell.getInitial() != 'W' && !originCell.isRoomCenter()) {\t\t\t\t\t// Checks for cells that are in rooms and are not centers\n\t\t\treturn;\n\t\t}\n\t\tif(originCell.getInitial() != 'W' && originCell.isRoomCenter()) {\t\t\t\t\t// Checks for cells that are in rooms and are centers\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\tSet<BoardCell> doors = roomMap.get(originCell.getInitial()).getDoors();\t\t\t// grabs all the doors for a certain room\n\t\t\tSystem.out.println(doors.size());\n\t\t\tfor (Iterator<BoardCell> it = doors.iterator(); it.hasNext();) {\t\t\t\t// iterates through the set of doors\n\t\t\t\ttestCell = it.next();\t\t\t\t\t\t\t\t\t\t\t\t\t\t// sets test cell to be the next door in the set of doors\n\t\t\t\toriginCell.addAdj(this.getCell(testCell.getRow(),testCell.getCol()));\t\t// all doors are adjacent to the room center\n\t\t\t}\n\t\t\tif(roomMap.get(originCell.getInitial()).isSecretPassage()) {\t\t\t\t\t// determines if that room has a secret passage\n\t\t\t\tCharacter passage = roomMap.get(originCell.getInitial()).getSecretPassage();// creates a temporary char that is equal to the initial of the originCell's secret passage room\n\t\t\t\tBoardCell passageCell = roomMap.get(passage).getCenterCell();\t\t\t\t// creates a temporary cell that is equal to the center of the room \n\t\t\t\toriginCell.addAdj(this.getCell(passageCell.getRow(), passageCell.getCol()));// adds the corresponding cell from the board to the adjacency set\t\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\telse if(originCell.getInitial() == 'W' && !originCell.isDoorway()) {\t\t\t\t// checks if the originCell is a walkway but not a doorway\n\t\t\tif(row > 0) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Makes sure the cell has a cell above it to avoid null pointer exceptions\n\t\t\t\ttestCell = this.getCell(row-1, col);\t\t\t\t\t\t\t\t\t\t// initializes the test cell to the cell in that location\n\t\t\t\tif(testCell.getInitial() == 'W'){\t\t\t\t\t\t\t\t\t\t\t// Since non-door walkways can only be adjacent to walkways, if the test cell is a walkway...\n\t\t\t\t\toriginCell.addAdj(testCell);\t\t\t\t\t\t\t\t\t\t\t// add it to the adjacency set\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(col > 0) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Makes sure the cell has a cell to the left to avoid null pointer exceptions\n\t\t\t\ttestCell = this.getCell(row, col-1);\t\t\t\t\t\t\t\t\t\t// initializes the test cell to the cell in that location\n\t\t\t\tif(testCell.getInitial() == 'W'){\t\t\t\t\t\t\t\t\t\t\t// Since non-door walkways can only be adjacent to walkways, if the test cell is a walkway...\n\t\t\t\t\toriginCell.addAdj(testCell);\t\t\t\t\t\t\t\t\t\t\t// add it to the adjacency set\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(row < this.getNumRows()-1) {\t\t\t\t\t\t\t\t\t\t\t\t\t// Makes sure the cell has a cell below it to avoid null pointer exceptions\n\t\t\t\ttestCell = this.getCell(row+1, col);\t\t\t\t\t\t\t\t\t\t// initializes the test cell to the cell in that location\n\t\t\t\tif(testCell.getInitial() == 'W'){\t\t\t\t\t\t\t\t\t\t\t// Since non-door walkways can only be adjacent to walkways, if the test cell is a walkway...\n\t\t\t\t\toriginCell.addAdj(testCell);\t\t\t\t\t\t\t\t\t\t\t// add it to the adjacency set\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(col < this.getNumColumns()-1) {\t\t\t\t\t\t\t\t\t\t\t\t// Makes sure the cell has a cell to the right to avoid null pointer exceptions\n\t\t\t\ttestCell = this.getCell(row, col+1);\t\t\t\t\t\t\t\t\t\t// initializes the test cell to the cell in that location\n\t\t\t\tif(testCell.getInitial() == 'W'){\t\t\t\t\t\t\t\t\t\t\t// Since non-door walkways can only be adjacent to walkways, if the test cell is a walkway...\n\t\t\t\t\toriginCell.addAdj(testCell);\t\t\t\t\t\t\t\t\t\t\t// add it to the adjacency set\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\t\n\t\t}\n\t\telse if(originCell.getInitial() == 'W' && originCell.isDoorway()) {\t\t\t\t\t// checks to see if the cell is a doorway\n\t\t\tif(row > 0) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Makes sure the cell has a cell above it to avoid null pointer exceptions\n\t\t\t\ttestCell = this.getCell(row-1, col);\t\t\t\t\t\t\t\t\t\t// initializes the test cell to the cell in that location\n\t\t\t\tif(originCell.getDoorDirection() == DoorDirection.UP)\t\t\t\t\t\t// checks to see if the door direction is up\n\t\t\t\t\toriginCell.addAdj(roomMap.get(testCell.getInitial()).getCenterCell());\t// adds the center of the room corresponding to the character of the test cell to the adjacency list\n\t\t\t\telse if(testCell.getInitial() == 'W')\t\t\t\t\t\t\t\t\t\t// otherwise, if the test cell above is a walkway...\n\t\t\t\t\toriginCell.addAdj(testCell);\t\t\t\t\t\t\t\t\t\t\t// add it to the adjacency set\n\t\t\t}\n\t\t\tif(col > 0) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Makes sure the cell has a cell top the left to avoid null pointer exceptions\n\t\t\t\ttestCell = this.getCell(row, col-1);\t\t\t\t\t\t\t\t\t\t// initializes the test cell to the cell in that location\n\t\t\t\tif(originCell.getDoorDirection() == DoorDirection.LEFT)\t\t\t\t\t\t// checks to see if the door direction is left\n\t\t\t\t\toriginCell.addAdj(roomMap.get(testCell.getInitial()).getCenterCell());\t// adds the center of the room corresponding to the character of the test cell to the adjacency list\n\t\t\t\telse if(testCell.getInitial() == 'W')\t\t\t\t\t\t\t\t\t\t// otherwise, if the test cell above is a walkway...\n\t\t\t\t\toriginCell.addAdj(testCell);\t\t\t\t\t\t\t\t\t\t\t// add it to the adjacency set\n\t\t\t}\n\t\t\tif(row < this.getNumRows()-1) {\t\t\t\t\t\t\t\t\t\t\t\t\t// Makes sure the cell has a cell below it to avoid null pointer exceptions\n\t\t\t\ttestCell = this.getCell(row+1, col);\t\t\t\t\t\t\t\t\t\t// initializes the test cell to the cell in that location\n\t\t\t\tif(originCell.getDoorDirection() == DoorDirection.DOWN)\t\t\t\t\t\t// checks to see if the door direction is down\n\t\t\t\t\toriginCell.addAdj(roomMap.get(testCell.getInitial()).getCenterCell());\t// adds the center of the room corresponding to the character of the test cell to the adjacency list\n\t\t\t\telse if(testCell.getInitial() == 'W')\t\t\t\t\t\t\t\t\t\t// otherwise, if the test cell above is a walkway...\n\t\t\t\t\toriginCell.addAdj(testCell);\t\t\t\t\t\t\t\t\t\t\t// add it to the adjacency set\n\t\t\t}\n\t\t\tif(col < this.getNumColumns()-1) {\t\t\t\t\t\t\t\t\t\t\t\t// Makes sure the cell has a cell to the right to avoid null pointer exceptions\n\t\t\t\ttestCell = this.getCell(row, col+1);\t\t\t\t\t\t\t\t\t\t// initializes the test cell to the cell in that location\n\t\t\t\tif(originCell.getDoorDirection() == DoorDirection.RIGHT)\t\t\t\t\t// checks to see if the door direction is right\n\t\t\t\t\toriginCell.addAdj(roomMap.get(testCell.getInitial()).getCenterCell());\t// adds the center of the room corresponding to the character of the test cell to the adjacency list\n\t\t\t\telse if(testCell.getInitial() == 'W')\t\t\t\t\t\t\t\t\t\t// otherwise, if the test cell above is a walkway...\n\t\t\t\t\toriginCell.addAdj(testCell);\t\t\t\t\t\t\t\t\t\t\t// add it to the adjacency set\n\t\t\t}\n\t\t\treturn;\t\n\t\t}\n\t\treturn;\n\t}",
"private int dfs(int[][] matrix, int i, int j, int d) {\n if (i < 0 || j < 0 || i == matrix.length || j == matrix[0].length || matrix[i][j] != 0)\n return 0;\n if (dp[i][j][d] > 0) return dp[i][j][d];\n timeComplexityCount++;\n maxI = Math.max(maxI, i);\n int res;\n if (d == 1)\n res = Math.max(dfs(matrix, i, j + 1, 1), dfs(matrix, i, j + 1, 2));\n else if (d == 0)\n res = Math.max(dfs(matrix, i, j - 1, 0), dfs(matrix, i, j - 1, 2));\n else\n res = Math.max(dfs(matrix, i + 1, j, 0), Math.max(dfs(matrix, i + 1, j, 1), dfs(matrix, i + 1, j, 2)));\n dp[i][j][d] = res + 1;\n return res + 1;\n }",
"public static boolean checkDiagonal(){\nif(gamebd[0][0]==gamebd[1][1]&&gamebd[1][1]==gamebd[2][2]&&gamebd[0][0]>0)\r\n{\r\n\tif(gamebd[0][0]==player1)\r\n\t\tSystem.out.println(\"Player 1 won\");\r\n\telse\r\n\t\tSystem.out.println(\"Player 2 won\");\r\nreturn true;\t\t\r\n}\r\nif(gamebd[0][2]==gamebd[1][1]&&gamebd[1][1]==gamebd[2][0]&&gamebd[0][2]>0)\r\n{\r\n\tif(gamebd[0][2]==player1)\r\n\t\tSystem.out.println(\"Player 1 won\");\r\n\telse\r\n\t\tSystem.out.println(\"Player 2 won\");\r\n\treturn true;\t\r\n}\r\n\treturn false;\r\n}",
"private static void DFSinfect(char[][] grid, int row, int column) {\n int rowLength = grid.length - 1;\n int colLength = grid[0].length - 1;\n if (row < 0 || row > rowLength || column < 0 || column > colLength) {\n return;\n }\n char val = grid[row][column];\n if (val == '0')\n return;\n grid[row][column] = '0';\n DFSinfect(grid, row + 1, column);\n DFSinfect(grid, row - 1, column);\n DFSinfect(grid, row, column + 1);\n DFSinfect(grid, row, column - 1);\n }",
"public static void main( String [ ] args )\r\n {\r\n \r\n \t\r\n \t\r\n \tint maze_row=0;\r\n \tint maze_column=0;\r\n \t\r\n\t\t\r\n\t\tScanner type = new Scanner(System.in);\r\n\t\t\r\n\t\t\r\n\t\tdo\r\n\t\t\t{\r\n\t\t\ttry \r\n\t\t\t\r\n\t\t\t{\r\n\t\t\t\tSystem.out.print(\"Please enter number of row between 1 and 20: \");\r\n\t\t\t\tmaze_row = Integer.valueOf(type.next());\r\n\t\t\t}\r\n\t\t\tcatch (NumberFormatException e)\r\n\t\t\t{\r\n\t\t\t\t//System.out.println(\"Input didn't match with the requirement: Try Again\");\r\n\t\t\t\tmaze_row=21;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t}\r\n\t\twhile(maze_row>20 || maze_row<1);\r\n\t\tdo\r\n\t\t{\r\n\t\ttry \r\n\t\t\r\n\t\t{\r\n\t\t\tSystem.out.print(\"Please enter number of column between 1 and 20: \");\r\n\t\t\tmaze_column = Integer.valueOf(type.next());\r\n\t\t}\r\n\t\tcatch (NumberFormatException e)\r\n\t\t{\r\n\t\t\t//System.out.println(\"Input didn't match with the requirement: Try Again\");\r\n\t\t\tmaze_column=21;\r\n\t\t\t\t\r\n\t\t}\r\n\t\t}\r\n\twhile(maze_column>20 ||maze_column<1);\r\n\t\t\r\n\t\ttype.close();\r\n\t\tSystem.out.println();\r\n \tcreateMaze(maze_row,maze_column);\r\n \tshowMaze();\r\n \t\r\n \t\r\n \t\r\n \t\r\n \t\r\n \t\r\n \t\r\n \t\r\n \t/* int NumElements = 128;\r\n int NumInSameSet = 16;\r\n\r\n DisjSets ds = new DisjSets( NumElements );\r\n int set1, set2;\r\n\r\n for( int k = 1; k < NumInSameSet; k *= 2 )\r\n {\r\n for( int j = 0; j + k < NumElements; j += 2 * k )\r\n {\r\n set1 = ds.find( j );\r\n set2 = ds.find( j + k );\r\n ds.union( set1, set2 );\r\n }\r\n }\r\n\r\n for( int i = 0; i < NumElements; i++ )\r\n {\r\n System.out.print( ds.find( i )+ \"*\" );\r\n if( i % NumInSameSet == NumInSameSet - 1 )\r\n System.out.println( );\r\n }\r\n System.out.println( );*/\r\n }",
"private List<Integer> generateAdjacentCells(int i, String s) {\r\n LinkedList<Integer> validNeighbors = new LinkedList<Integer>();\r\n int iX = this.rowPos(i);\r\n int iY = this.colPos(i);\r\n int nX = iX - 1;\r\n int nY = iY - 1;\r\n //counter for validNeighbors array\r\n int c = 0;\r\n int t = 0;\r\n for (int k = 0; k < 9; k++) {\r\n if (nX >= 0 && nY >= 0 && nX < squareDimension && nY < squareDimension \r\n && !markBoard[nX][nY] && (nX != iX || nY != iY) \r\n && s.toUpperCase().startsWith(wordBoard[nX][nY])) {\r\n \r\n validNeighbors.add((nX * squareDimension + nY));\r\n }\r\n \r\n t++;\r\n nY++;\r\n \r\n if (t == 3) {\r\n nX++;\r\n nY -= 3;\r\n t = 0;\r\n }\r\n }\r\n //no valid neighbors so return null\r\n if (validNeighbors.size() == 0) {\r\n return new LinkedList<Integer>();\r\n }\r\n return validNeighbors;\r\n }",
"@Test\n\tpublic void testCuatroEnRayaDiag2() {\n\t\t\n\t\tint []posX = new int[4];\n\t\tint []posY = new int[4];\n\t\tfor (int i = 1; i <= 12; ++i) {\n\t\t\tint sx = Math.min(i, 7);\n\t\t\tint sy = Math.min(13 - i, 6);\n\t\t\twhile ((sy - 4 >= 0) && (sx - 4 >= 0)) {\n\t\t\t\tfor (int l = 0; l < 4; ++l) {\n\t\t\t\t\tposX[l] = sx - l;\n\t\t\t\t\tposY[l] = sy - l;\n\t\t\t\t}\n\t\t\t\tpruebaCuatroEnRaya(posX, posY);\n\t\t\t\tsy--; sx--;\n\t\t\t}\n\t\t}\n\t}",
"public static int[] findDiagonalOrder(int[][] matrix){\n if( matrix == null || matrix.length == 0)\n return new int[0];\n int i = 0;\n int j =0;\n int k = 0;\n int size = matrix.length * matrix[0].length;\n int[] result = new int[size];\n boolean moveUp =true;\n while(k< size){\n\n if(moveUp){\n for(;i >=0 && j<= matrix[0].length-1;i--, j++){\n result[k] = matrix[i][j];\n k++;\n }\n // while moving up there are two conditions\n// 1. only row moves beyod 0 th row and column is in range (check for both row and column)\n //2. both row and column moves out ( check for column only)\n //case 1\n if(i<0 && j <= matrix[0].length-1){\n i = 0; // reset row to 0 and move down\n moveUp = !moveUp;\n }\n //case 2\n if(j == matrix[0].length){\n i = i+2; // reset row\n j--; // reduce column and move down\n moveUp = !moveUp;\n }\n\n }\n else\n {\n // moving down increment row and decrement column\n for(;j>=0 && i <= matrix.length - 1; i++, j-- ){\n result[k] = matrix[i][j];\n k++;\n }\n // while moving down there are two cases\n // 1. column goes out but rows in order (we need to check both)\n // 2. both column and row goes out (we can only have row check)\n if(j < 0 && i<= matrix.length-1){\n j = 0;\n moveUp = !moveUp;\n }\n if( i == matrix.length){\n j = j+2;\n i--;\n moveUp = !moveUp;\n }\n\n }\n\n\n }\n return result;\n }",
"public void convertNeighbors(int x, int i, int j){\n if((j+1)<arraysize){\n if(directionPlot[i][j+1].equals(\"l\")){\n int currval = sinkCounterMap.get(x);\n sinkCounterMap.put(x, currval+1);\n convertNeighbors(x, i, (j+1)); //run this recursively\n }\n }\n if((j-1)>=0){\n if(directionPlot[i][j-1].equals(\"r\")){\n int currval = sinkCounterMap.get(x);\n sinkCounterMap.put(x, currval+1);\n convertNeighbors(x, i, (j-1)); //run this recursively\n }\n }\n if((i-1)>=0){\n if(directionPlot[i-1][j].equals(\"d\")){\n int currval = sinkCounterMap.get(x);\n sinkCounterMap.put(x, currval+1);\n convertNeighbors(x, (i-1), j); //run this recursively\n }\n }\n if((i+1)<arraysize){\n if(directionPlot[i+1][j].equals(\"u\")){\n int currval = sinkCounterMap.get(x);\n sinkCounterMap.put(x, currval+1);\n convertNeighbors(x, (i+1), j); //run this recursively\n }\n }\n \n }",
"int removeObstacle(int numRows, int numColumns, List<List<Integer>> lot)\r\n {\r\n \tint m = 0;\r\n \tint n = 0;\r\n \tfor(List<Integer> rowList: lot) {\r\n \t\tfor(Integer num: rowList) {\r\n \t\t\tif(num == 9 ) {\r\n \t\t\t\tbreak;\r\n \t\t\t}\r\n \t\t\tn++;\r\n \t\t}\r\n \t\tm++;\r\n \t}\r\n \t// to store min cells required to be \r\n // covered to reach a particular cell \r\n int dp[][] = new int[numRows][numColumns]; \r\n \r\n // initially no cells can be reached \r\n for (int i = 0; i < numRows; i++) \r\n for (int j = 0; j < numColumns; j++) \r\n dp[i][j] = Integer.MAX_VALUE; \r\n \r\n // base case \r\n dp[0][0] = 1; \r\n \r\n for (int i = 0; i < lot.size(); i++) {\r\n \tList<Integer> columnList = lot.get(i);\r\n for (int j = 0; j < columnList.size(); j++) { \r\n \r\n // dp[i][j] != INT_MAX denotes that cell \r\n // (i, j) can be reached from cell (0, 0) \r\n // and the other half of the condition \r\n // finds the cell on the right that can \r\n // be reached from (i, j) \r\n if (dp[i][j] != Integer.MAX_VALUE && \r\n (j + columnList.get(j)) < numColumns && (dp[i][j] + 1) \r\n < dp[i][j + columnList.get(j)]\r\n \t\t && columnList.get(j) != 0) \r\n dp[i][j + columnList.get(j)] = dp[i][j] + 1; \r\n \r\n if (dp[i][j] != Integer.MAX_VALUE && \r\n (i + columnList.get(j)) < numRows && (dp[i][j] + 1) \r\n < dp[i + columnList.get(j)][j] && columnList.get(j) != 0) \r\n dp[i + columnList.get(j)][j] = dp[i][j] + 1; \r\n } \r\n } \r\n \r\n if (dp[m - 1][n - 1] != Integer.MAX_VALUE) \r\n return dp[m - 1][n - 1]; \r\n \r\n return -1; \r\n }",
"public int getWallDirection(int d, int s) {\n\t\t// d = player direction\n\t\t// s = screen gfx position\n\n\t\t//I should be able to use the below in an array to work out all directions\n\t\t//current plus direction = wall face i.e.\n\t\t//If a wall is currently North which is a 0 + player direction. Say Player is facing East = 1\n\t\t// 0 + 1 = 1 (North Wall becomes East)\n\t\tint[] Wall = new int [32];\n\t\tWall[0] = 0;\n\t\tWall[1] = 1;\n\t\tWall[2] = 2;\n\t\tWall[3] = 3;\n\t\tWall[4] = 2;\n\t\tWall[5] = 1;\n\t\tWall[6] = 2;\n\t\tWall[7] = 3;\n\t\tWall[8] = 2;\n\t\tWall[9] = 2;\n\t\tWall[10] = 1;\n\t\tWall[11] = 2;\n\t\tWall[12] = 3;\n\t\tWall[13] = 2;\n\t\tWall[14] = 2;\n\t\tWall[15] = 1;\n\t\tWall[16] = 2;\n\t\tWall[17] = 3;\n\t\tWall[18] = 2;\n\t\tWall[19] = 1;\n\t\tWall[20] = 2;\n\t\tWall[21] = 1;\n\t\tWall[22] = 3;\n\t\tWall[23] = 2;\n\t\tWall[24] = 3;\n\t\tWall[25] = 2;\n\t\tWall[26] = 1;\n\t\tWall[27] = 3;\n\t\tWall[28] = 2;\n\t\tWall[29] = 3; //2\n\t\tWall[30] = 0; //3\n\t\tWall[31] = 1; //0\n\n\t\tWall[s] = Wall[s] + d;\n\n\t\tif (Wall[s] > 3) {\n\t\t\tWall[s] = (Wall[s] - 3) -1;\n\t\t}\n\n\n\t\treturn Wall[s];\n\n\n\t}",
"public int dfs(int row, int col, int[][] grid) {\n //when current position is in bound and current element is 1, add area by 1 and continue recursively\n //find other 1's, until all four directions reach 0, finally we get area of current island\n if (col >= 0 && row >= 0 && row < grid.length && col < grid[0].length && grid[row][col] == 1) {\n grid[row][col] = 0;\n return 1 + dfs(row + 1, col, grid) + dfs(row - 1, col, grid)\n + dfs(row, col + 1, grid) + dfs(row, col - 1, grid);\n }\n //DO NOT forget return 0 for recursion exit when reach 0\n return 0;\n }",
"@Test\n\tpublic void testCuatroEnRayaDiag1() {\n\t\t\n\t\tint []posX = new int[4];\n\t\tint []posY = new int[4];\n\t\tfor (int i = 1; i <= 12; ++i) {\n\t\t\tint sx = Math.max(1, i-5);\n\t\t\tint sy = Math.min(i, 6);\n\t\t\twhile ((sy - 4 >= 0) && (sx + 3 <= 7)) {\n\t\t\t\tfor (int l = 0; l < 4; ++l) {\n\t\t\t\t\tposX[l] = sx + l;\n\t\t\t\t\tposY[l] = sy - l;\n\t\t\t\t}\n\t\t\t\tpruebaCuatroEnRaya(posX, posY);\n\t\t\t\tsy--; sx++;\n\t\t\t}\n\t\t}\n\t}",
"public static void main(String args[]) throws IOException {\n int[] distance = new int[999 * 999]; // 999 is the max size of rows and cols\n int[] grid = new int[999 * 999];\n int tests = Integer.parseInt(getLine().trim());\n for (int i = 1; i <= tests; i++) {\n int rows = Integer.parseInt(getLine().trim());\n int cols = Integer.parseInt(getLine().trim());\n for (int r = 0; r < rows; r++) {\n StringTokenizer st = new StringTokenizer(getLine());\n for (int c = 0; c < cols; c++) {\n grid[r * cols + c] = Integer.parseInt(st.nextToken());\n }\n }\n\n int goal = (rows - 1) * cols + (cols - 1);\n int start = 0;\n Arrays.fill(distance, 0, rows * cols, INFINITY);\n distance[start] = grid[0];\n CustomPriorityQueue pq = new CustomPriorityQueue();\n pq.add(new Tuple(grid[0], start), grid[0]);\n while (!pq.isEmpty()) {\n Tuple current = pq.remove();\n if (distance[current.cell] < current.d); // we know shorter path already\n if (current.cell == goal) break;\n int r = current.cell / cols;\n int c = current.cell % cols;\n for (int j = 0; j < DELTA_R.length; j++) {\n int nr = r + DELTA_R[j];\n int nc = c + DELTA_C[j];\n if (nr < 0 || nr >= rows || nc < 0 || nc >= cols) continue; // out of bounds\n int next = nr * cols + nc;\n if (distance[next] > distance[current.cell] + grid[next]) {\n distance[next] = distance[current.cell] + grid[next];\n pq.add(new Tuple(distance[next], next), grid[next]);\n }\n }\n }\n\n out.println(distance[goal]);\n }\n out.close();\n }",
"public void loopThroughEdge()\n {\n int margin = 2;\n\n if (getX() < margin) //left side\n { \n setLocation(getWorld().getWidth()+ margin, getY());\n }\n else if (getX() > getWorld().getWidth() - margin) //right side\n {\n setLocation(margin, getY());\n }\n\n if (getY() < margin) //top side\n { \n setLocation(getX(), getWorld().getHeight() - margin);\n }\n else if(getY() > getWorld().getHeight() - margin) //bottom side\n { \n setLocation(getX(), margin);\n }\n }",
"public static void mazeSize(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze four = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct = null;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\tif(randomDirection == 1)\n\t\t\t\tdirect = \"right\";\n\t\t\t//System.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = four.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\t//System.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.find(randomNumber) != S.find(randomNumber + n)){\n\t\t\t\t\t\tS.unionBySize(randomNumber, randomNumber+n);\n\t\t\t\t\t\tfour.remove_wall(col, row, 'u');\n\t\t\t\t\t\t//S.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.find(randomNumber) != S.find(randomNumber+1)){\n\t\t\t\t\t\tS.unionBySize(randomNumber, randomNumber+1);\n\t\t\t\t\t\tfour.remove_wall(col, row, 'r');\n\t\t\t\t\t\t//S.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(four, n);\n\t\tuserSelection_SolveMaze(n);\n\n\n\t\tStdDraw.show(0);\n\t\tfour.draw();\n\t\tfour.printCellNumbers();\t\n\t}",
"private void startGame() { \n \n int body = 0;\n int column = 0;\n int end = 0;\n int fill = 0;\n int increment = 2; \n int numPerSide = 0; \n int prefixIndex = 0;\n int row = 0; \n int start = 1; \n int userNum = 0; \n \n String lineContent = \"\";\n \n // Get user input\n System.out.println(\"FOR A PRETTY DIAMOND PATTERN,\");\n System.out.print(\"TYPE IN AN ODD NUMBER BETWEEN 5 AND 21? \");\n userNum = scan.nextInt();\n System.out.println(\"\");\n \n // Calcuate number of diamonds to be drawn on each side of screen\n numPerSide = (int) (LINE_WIDTH / userNum); \n\n end = userNum; \n \n // Begin loop through each row of diamonds\n for (row = 1; row <= numPerSide; row++) {\n \n // Begin loop through top and bottom halves of each diamond\n for (body = start; increment < 0 ? body >= end : body <= end; body += increment) {\n\n lineContent = \"\";\n \n // Add whitespace\n while (lineContent.length() < ((userNum - body) / 2)) {\n lineContent += \" \";\n }\n \n // Begin loop through each column of diamonds\n for (column = 1; column <= numPerSide; column++) {\n \n prefixIndex = 1;\n \n // Begin loop that fills each diamond with characters\n for (fill = 1; fill <= body; fill++) {\n \n // Right side of diamond\n if (prefixIndex > PREFIX.length()) {\n \n lineContent += SYMBOL; \n \n }\n // Left side of diamond\n else {\n \n lineContent += PREFIX.charAt(prefixIndex - 1);\n prefixIndex++;\n \n } \n \n } // End loop that fills each diamond with characters\n \n // Column finished\n if (column == numPerSide) {\n \n break;\n \n }\n // Column not finishd\n else {\n \n // Add whitespace\n while (lineContent.length() < (userNum * column + (userNum - body) / 2)) {\n lineContent += \" \";\n }\n \n } \n \n } // End loop through each column of diamonds\n \n System.out.println(lineContent);\n\n } // End loop through top and bottom half of each diamond\n\n if (start != 1) {\n\n start = 1;\n end = userNum;\n increment = 2; \n \n }\n else {\n \n start = userNum - 2;\n end = 1;\n increment = -2; \n row--;\n\n } \n\n } // End loop through each row of diamonds\n \n }",
"public static int drawLowestElevPath(Graphics g, int[][] grid, int row){\n int i = row;\n int elevation = 0;\n \n for(int j = 0; j < 839; j++)\n { //Straight //Up //Straight //Down \n if(i - 1 < 0)\n i = i + 1;\n else if(i + 1 > 479)\n i--;\n \n int straight = (grid[i][j+1] - grid[i][j]);\n int up = (grid[i - 1][j+1] - grid[i][j]);\n int down = (grid[i + 1][j+1] - grid[i][j]);\n \n \n\n if((straight < up) && (straight < down))\n { //straight is least \n g.drawRect(j + 1, i, 1, 1);\n elevation += Math.abs((grid[i][j+1] - grid[i][j]));\n } \n else if((up < down) && (up < straight))\n { //up is least\n g.drawRect(j + 1, i - 1, 1, 1);\n if(i - 1 > 0)\n {\n elevation += Math.abs((grid[i - 1][j+1] - grid[i][j]));\n i--;\n }\n } \n else if((down < up) && (down < straight))\n { //down is least\n g.drawRect(j + 1, i + 1, 1, 1);\n if(i + 1 < 480)\n {\n elevation += Math.abs((grid[i + 1][j+1] - grid[i][j]));\n i++;\n }\n } \n else if(up == down)\n {\n double rand = Math.random();\n int path = (int)(rand * 2);\n \n if(path == 0)\n {\n g.drawRect(j + 1, i + 1, 1, 1);\n if(i + 1 < 480)\n {\n elevation += Math.abs((grid[i + 1][j+1] - grid[i][j]));\n i++;\n }\n }\n else if(path == 1)\n {\n g.drawRect(j + 1, i - 1, 1, 1);\n if(i - 1 > 0)\n {\n elevation += Math.abs((grid[i - 1][j+1] - grid[i][j]));\n i--;\n }\n }\n } //Straight //Up //Straight //Down //Straight //Down //Straight //Up\n else if(((straight == up) && (straight < down)) || ((straight == down) && (straight < up)))\n {\n g.drawRect(j + 1, i, 1, 1);\n elevation += Math.abs((grid[i][j+1] - grid[i][j]));\n }\n }\n\n return elevation;\n }",
"public void step()\n {\n\t int rows = grid.length-1;\n\t int cols = grid[0].length-1;\n\t int direction = (int) (Math.random()*3);\n\t direction--;\n\t int row = (int) (Math.random()*rows);\n\t //System.out.println(row);\n\t int col = (int) (Math.random()*cols);\n\t //System.out.println(col);\n\t if(grid[row][col] == SAND && (grid[row+1][col] == EMPTY || grid[row+1][col] == WATER)) {\n\t\t grid[row+1][col] = SAND;\n\t\t grid[row][col] = EMPTY;\n\t }\n\t if(grid[row][col] == WATER && grid[row+1][col] == EMPTY) {\n\t\t if(col != 0) {\n\t\t\t grid[row+1][col+direction] = WATER;\n\t\t\t grid[row][col] = EMPTY;\n\t\t }\n\t\t else {\n\t\t\t grid[row+1][col] = WATER;\n\t\t\t grid[row][col] = EMPTY;\n\t\t }\n\t }\n }",
"public void ParseDirectionPlot(){\n int tempCounter = 0; //counter for how many sinks we've found so far.\n sinkCounterMap(); //we'll make the map first;\n for(int i=0; i<arraysize; i++){\n for(int j=0; j<arraysize; j++){\n String curr = directionPlot[i][j];\n //if it's a sink, we'll find it's basin area\n //with the convertNeighbors procedure\n if(isInteger(curr)){\n tempCounter += 1;\n convertNeighbors(Integer.parseInt(curr), i, j);\n }\n if(tempCounter == sinkCounter) break; \n }\n if(tempCounter == sinkCounter) break; //we don't want to keep looking for sinks if we've found all of them \n }\n }",
"public void revisaColisionMapa() {\n\t\tactualCol = (int)x / tamTile;\n\t\tactualRen = (int)y / tamTile;\n\t\t\n\t\txdest = x + dx;\n\t\tydest = y + dy;\n\t\t\n\t\txtemp = x;\n\t\tytemp = y;\n\t\t\n\t\tcalcularEsquinas(x, ydest);\n\t\tif(dy < 0) {\n\t\t\tif(arribaIzq || arribaDer) {\n\t\t\t\tdy = 0;\n\t\t\t\tytemp = actualRen * tamTile + claltura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tytemp += dy;\n\t\t\t}\n\t\t}\n\t\tif(dy > 0) {\n\t\t\tif(abajoIzq || abajoDer) {\n\t\t\t\tdy = 0;\n\t\t\t\tcayendo = false;\n\t\t\t\tytemp = (actualRen + 1) * tamTile - claltura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tytemp += dy;\n\t\t\t}\n\t\t}\n\t\t\n\t\tcalcularEsquinas(xdest, y);\n\t\tif(dx < 0) {\n\t\t\tif(arribaIzq || abajoIzq) {\n\t\t\t\tdx = 0;\n\t\t\t\txtemp = actualCol * tamTile + clanchura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\txtemp += dx;\n\t\t\t}\n\t\t}\n\t\tif(dx > 0) {\n\t\t\tif(arribaDer || abajoDer) {\n\t\t\t\tdx = 0;\n\t\t\t\txtemp = (actualCol + 1) * tamTile - clanchura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\txtemp += dx;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!cayendo) {\n\t\t\tcalcularEsquinas(x, ydest + 1);\n\t\t\tif(!abajoIzq && !abajoDer) {\n\t\t\t\tcayendo = true;\n\t\t\t}\n\t\t}\n\t}",
"private static void fillDistances(CellData[][] cells) {\n\t\tSet<Pair<Integer, Integer>> currentLayer = new HashSet<>();\n\t\tfor (int x = 0; x < cells.length; x++) {\n\t\t\tfor (int y = 0; y < cells[0].length; y++) {\n\t\t\t\tif (cells[x][y].getType() == TrackCell.PRE_START_LINE) {\n\t\t\t\t\tcells[x][y].offerDistanceToFinish(1);\n\t\t\t\t\tcurrentLayer.add(Pair.of(x, y));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint currentDistance = 1;\n\t\twhile (true) {\n\t\t\t// iterate over the current layer cells and fill in the next layer\n\t\t\tSet<Pair<Integer, Integer>> nextLayer = new HashSet<>();\n\t\t\tfor (Pair<Integer, Integer> curLayerCell : currentLayer) {\n\t\t\t\tint x = curLayerCell.getLeft();\n\t\t\t\tint y = curLayerCell.getRight();\n\t\t\t\tTrackCell from = cells[x][y].getType();\n\t\t\t\tif (isNavigableFrom(cells, x - 1, y, from)\n\t\t\t\t\t\t&& cells[x - 1][y]\n\t\t\t\t\t\t\t\t.offerDistanceToFinish(currentDistance + 1)) {\n\t\t\t\t\tnextLayer.add(Pair.of(x - 1, y));\n\t\t\t\t}\n\t\t\t\tif (isNavigableFrom(cells, x + 1, y, from)\n\t\t\t\t\t\t&& cells[x + 1][y]\n\t\t\t\t\t\t\t\t.offerDistanceToFinish(currentDistance + 1)) {\n\t\t\t\t\tnextLayer.add(Pair.of(x + 1, y));\n\t\t\t\t}\n\t\t\t\tif (isNavigableFrom(cells, x, y - 1, from)\n\t\t\t\t\t\t&& cells[x][y - 1]\n\t\t\t\t\t\t\t\t.offerDistanceToFinish(currentDistance + 1)) {\n\t\t\t\t\tnextLayer.add(Pair.of(x, y - 1));\n\t\t\t\t}\n\t\t\t\tif (isNavigableFrom(cells, x, y + 1, from)\n\t\t\t\t\t\t&& cells[x][y + 1]\n\t\t\t\t\t\t\t\t.offerDistanceToFinish(currentDistance + 1)) {\n\t\t\t\t\tnextLayer.add(Pair.of(x, y + 1));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (nextLayer.isEmpty()) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcurrentLayer = nextLayer;\n\t\t\tcurrentDistance++;\n\t\t}\n\n\t}",
"static void print(int i, int j) {\n\t\tif (i == n - 1 && j == n - 1)\n\t\t\treturn;\n\t\tif (j < n - 1 && i < n) {\n\t\t\tif (dp(i, j) == grid[i][j] + dp(i, j + 1)) {\n\t\t\t\tSystem.out.print(\"R\");\n\t\t\t\tprint(i, j + 1);\n\t\t\t}\n\t\t} else {\n\t\t\tif (dp(i, j) == grid[i][j] + dp(i + 1, j)) {\n\t\t\t\tSystem.out.print(\"D\");\n\t\t\t\tprint(i + 1, j);\n\t\t\t}\n\t\t}\n\t}",
"public void generate_maze()\n\t{\n\t\tint i, j, r, c;\n\n\t\t// choose a cell at random and make it the current cell\n\t\tRandom rand = new Random(666);\n\t\tr = (int)(rand.nextFloat() * (ROWS - 1));\n\t\tc = (int)(rand.nextFloat() * (COLS - 1));\n\t\tint[] curr = {r,c}; // current search location\n\t\tint visited = 1;\n\t\tint total = ROWS*COLS;\n\t\tint tos = 0; // index for top of cell stack \n\n\t\t// arrays of single step movements between cells\n\t\t// north east south west\n\t\tint[][] move = {{-1, 0}, {0, 1}, {1, 0}, {0,-1}};\n\t\tint[][] next = {{0, 0}, {0, 0}, {0, 0}, {0, 0}};\n\n\t\twhile (visited < total)\n\t\t{\n\t\t\t// find all neighbors of current cell with all walls intact\n\t\t\tj = 0;\n\t\t\tfor (i = 0; i < 4; i++)\n\t\t\t{\n\t\t\t\tr = curr[0] + move[i][0];\n\t\t\t\tc = curr[1] + move[i][1];\n\n\t\t\t\t// check for valid next cell\n\t\t\t\tif ((0 <= r) && (r < ROWS) && (0 <= c) && (c < COLS))\n\t\t\t\t{\n\t\t\t\t\t// check if previously visited\n\t\t\t\t\tif ((Maze[r][c] == 15))//N) && (Maze[r][c] == E) && (Maze[r][c] == S) && (Maze[r][c] == W))\n\t\t\t\t\t{\n\t\t\t\t\t\t// not visited, so add to possible next cells\n\t\t\t\t\t\tnext[j][0] = r;\n\t\t\t\t\t\tnext[j][1] = c;\n\t\t\t\t\t\tj++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (j > 0)\n\t\t\t{\n\t\t\t\t// current cell has one or more unvisited neighbors, so choose one at random \n\t\t\t\t// and knock down the wall between it and the current cell\n\t\t\t\ti = (int)(rand.nextFloat() * (j-1));\n\n\t\t\t\tif ((next[i][0] - curr[0]) == 0) // next on same row\n\t\t\t\t{\n\t\t\t\t\tr = next[i][0];\n\t\t\t\t\tif (next[i][1] > curr[1]) // move east\n\t\t\t\t\t{\n\t\t\t\t\t\tc = curr[1];\n\t\t\t\t\t\tMaze[r][c] &= ~E; // clear E wall\n\t\t\t\t\t\tc = next[i][1];\n\t\t\t\t\t\tMaze[r][c] &= ~W; // clear W wall\n\t\t\t\t\t}\n\t\t\t\t\telse // move west\n\t\t\t\t\t{\n\t\t\t\t\t\tc = curr[1];\n\t\t\t\t\t\tMaze[r][c] &= ~W; // clear W wall\n\t\t\t\t\t\tc = next[i][1];\n\t\t\t\t\t\tMaze[r][c] &= ~E; // clear E wall\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse // next on same column\n\t\t\t\t{\n\t\t\t\t\tc = next[i][1];\n\t\t\t\t\t if (next[i][0] > curr[0]) // move south \n\t\t\t\t\t {\n\t\t\t\t\t \tr = curr[0];\n\t\t\t\t\t \tMaze[r][c] &= ~S; // clear S wall\n\t\t\t\t\t \tr = next[i][0];\n\t\t\t\t\t \tMaze[r][c] &= ~N; // clear N wall\n\t\t\t\t\t }\n\t\t\t\t\t else // move north\n\t\t\t\t\t {\n\t\t\t\t\t \tr = curr[0];\n\t\t\t\t\t \tMaze[r][c] &= ~N; // clear N wall\n\t\t\t\t\t \tr = next[i][0];\n\t\t\t\t\t \tMaze[r][c] &= ~S; // clear S wall\n\t\t\t\t\t }\n\t\t\t\t}\n\n\t\t\t\ttos++; // push current cell location\n\t\t\t\tstack.elementAt(tos)[0] = curr[0];\n\t\t\t\tstack.elementAt(tos)[1] = curr[1];\n\n\t\t\t\tcurr[0] = next[i][0]; // make next cell the current cell\n\t\t\t\tcurr[1] = next[i][1];\n\n\t\t\t\tvisited++; // increment count of visited cells\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// reached dead end, backtrack\n\t\t\t\t// pop the most recent cell from the cell stack \n\t\t\t\t// and make it the current cell\n\t\t\t\tcurr[0] = stack.elementAt(tos)[0];\n\t\t\t\tcurr[1] = stack.elementAt(tos)[1];\n\t\t\t\ttos--;\n\t\t\t}\n\t\t}\n\t}",
"protected int mirrorDirection(int direction) {\n\t\tif (direction < 4) {\n\t\t\treturn (direction + 2)%4;\n\t\t} else {\n\t\t\treturn (direction + 2)%4 + 4;\n\t\t}\n\t}",
"private Cell scanSecondDiagonal(Figure value) {\n Figure oppositeValue = game.getOppositeFigure(value);\n int emptyString = 0;\n int emptyRow = 0;\n int emptyCnt = 0;\n int row = 0;\n for (int string = game.getFieldSize() - 1; string >= 0; string--) {\n Figure fieldValue = game.getFieldValue(string,row);\n if (fieldValue.equals(oppositeValue)) {\n emptyCnt = 0;\n break;\n } else if (fieldValue.equals(EMPTY)) {\n emptyCnt++;\n emptyRow = row;\n emptyString = string;\n\n }\n row++;\n }\n if (emptyCnt == 1) {\n return new Cell(emptyString, emptyRow);\n }\n return null;\n }",
"private boolean dia2HasFour(int row, int col) {\n boolean four = false;\n int colCount = 0;\n if (getBoard()[row][col] == null)\n return false;\n if (row < rows - 1 && col > 0)\n for (int i = row + 1, j = col - 1; i < rows && j > 0; i++, j--) {\n if (getBoard()[i][j] == null) {\n break;\n }\n if (getBoard()[row][col].equals(getBoard()[i][j])) {\n colCount++;\n } else {\n break;\n }\n }\n\n if (row > 0 && col < cols - 1)\n for (int i = row - 1, j = col + 1; i > 0 && j < cols; i--, j++) {\n if (getBoard()[i][j] == null) {\n break;\n }\n\n if (getBoard()[row][col].equals(getBoard()[i][j])) {\n colCount++;\n } else {\n break;\n }\n }\n if (colCount >= (winCount - 1)) {\n four = true;\n }\n return four;\n }",
"private Point[] generateInstructions(){\n\t\tPoint[] movement = new Point[d];\n\t\tfor(int i = 0; i < d; i++){\n\t\t\tmovement[i] = new Point(dancers[i].next_pos.x-this.last_positions[i].x,dancers[i].next_pos.y-this.last_positions[i].y);\n\t\t\tif(movement[i].x * movement[i].x + movement[i].y * movement[i].y > 4){\n\t\t\t\tSystem.out.println(\"dancer \" + i + \" move too far\");\n\t\t\t\tSystem.out.println(\"soulmate: \" + dancers[i].soulmate);\n\t\t\t\tSystem.out.println(\"connected? \" + this.connected);\n\t\t\t\tmovement[i] = new Point(0,0);\n\t\t\t}\n\t\t}\n\t\treturn movement;\n\t}",
"public boolean isLegalStep(MoveDirection dir){\r\n GamePosition curPos = currentGame.getCurrentPosition();\n\t\tPlayer white = currentGame.getWhitePlayer();\n\t\tint[] toCheckPos = new int[2];\n\t\tint[] existingPos = new int[2];\n\t\tif(curPos.getPlayerToMove().equals(white)) {\n\t\t\ttoCheckPos[0] = curPos.getWhitePosition().getTile().getColumn();\n\t\t\ttoCheckPos[1] = curPos.getWhitePosition().getTile().getRow();\n\t\t\t\n\t\t\texistingPos[0] = curPos.getBlackPosition().getTile().getColumn();\n\t\t\texistingPos[1] = curPos.getBlackPosition().getTile().getRow();\n\t\t\t\n\t\t} else {\n\t\t\ttoCheckPos[0] = curPos.getBlackPosition().getTile().getColumn();\n\t\t\ttoCheckPos[1] = curPos.getBlackPosition().getTile().getRow();\n\t\t\t\n\t\t\texistingPos[0] = curPos.getWhitePosition().getTile().getColumn();\n\t\t\texistingPos[1] = curPos.getWhitePosition().getTile().getRow();\n\t\t}\n\t\t//0 = column, 1 = row\n\t\tif(dir == MoveDirection.North) {\n\t\t\tif(toCheckPos[1] == 1) return false;\n\t\t\tif(toCheckPos[1] - 1 == existingPos[1] && toCheckPos[0] == existingPos[0]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), -1, 0);\n\t\t} else if(dir == MoveDirection.South) {\n\t\t\tif(toCheckPos[1] == 9) return false;\n\t\t\tif(toCheckPos[1] + 1 == existingPos[1] && toCheckPos[0] == existingPos[0]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 1, 0);\n\t\t} else if(dir == MoveDirection.East) {\n\t\t\tif(toCheckPos[0] == 9) return false;\n\t\t\tif(toCheckPos[0] + 1 == existingPos[0] && toCheckPos[1] == existingPos[1]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 0, 1);\n\t\t} else if(dir == MoveDirection.West) {\n\t\t\tif(toCheckPos[0] == 1) return false;\n\t\t\tif(toCheckPos[0] - 1 == existingPos[0] && toCheckPos[1] == existingPos[1]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 0, -1);\n\t\t}\n\t\t\n\t\treturn false;\r\n }",
"public void move(Cell[][] maze) {\n // check monster still alive or not\n if (!alive) {\n return;\n }\n //four directions: left, right, up, down\n int[][] dirs = {{0, -1}, {0, 1}, {-1, 0}, {1, 0}};\n // a list to store all valid directions to move\n List<int[]> validDir = new ArrayList<>();\n for (int[] dir : dirs) {\n int newRow = this.current_row + dir[0];\n int newCol = this.current_column + dir[1];\n // try finding a location where is not wall, not the previous location, not a place 3 sides surrounded by walls\n // and save it to valid directions list\n if (maze[newRow][newCol].getValue() != 1 && !(newRow == pre_row && newCol == pre_column)\n && validNextMove(newRow, newCol, maze)) {\n int[] newLocation = new int[]{newRow, newCol};\n validDir.add(newLocation);\n }\n }\n //If there is no valid move choice, the monster has to backtrack\n if (validDir.size() == 0) {\n this.current_row = this.pre_row;\n this.current_column = this.pre_column;\n this.pre_row = this.current_row;\n this.pre_column = this.current_column;\n } else {\n // randomly select a valid direction to move\n Random random = new Random();\n int ranNum = random.nextInt(validDir.size());\n int[] newLoc = validDir.get(ranNum);\n int newRow = newLoc[0];\n int newCol = newLoc[1];\n this.pre_row = this.current_row;\n this.pre_column = this.current_column;\n this.current_row = newRow;\n this.current_column = newCol;\n }\n }",
"public static boolean swipe(direction d, Board board, Game game) {\n\t\tint[][] M = new int[board.size][board.size];\n\t\tint[] zeroNum = new int[board.size];\n\t\tint i, j, k;\n\t\tboolean changed = false;\n\n\t\tif (d == direction.left) {\n\t\t\tfor (i = 0; i < board.size; i++) {\n\n\t\t\t\tzeroNum[i] = board.size;// record the number of zeros in each\n\t\t\t\t\t\t\t\t\t\t// line\n\n\t\t\t\tk = 0;\n\t\t\t\tfor (j = 0; j < board.size; j++) {\n\t\t\t\t\tif (board.board[i][j] != 0) {\n\t\t\t\t\t\tif (M[i][k] == 0) {\n\t\t\t\t\t\t\tM[i][k] = board.board[i][j];\n\t\t\t\t\t\t\tzeroNum[i]--;\n\t\t\t\t\t\t} else if (M[i][k] == board.board[i][j]) {\n\t\t\t\t\t\t\tM[i][k] = board.board[i][j] * 2;\n\t\t\t\t\t\t\tgame.board.roundScore += M[i][k] * 10; // adding up\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the score\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// for this\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move\n\t\t\t\t\t\t\tk++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tk++;\n\t\t\t\t\t\t\tM[i][k] = board.board[i][j];\n\t\t\t\t\t\t\tzeroNum[i]--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// see if there is any change\n\t\t\t\tif (!Arrays.equals(board.board[i], M[i])) {\n\t\t\t\t\tchanged = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (changed == false) {\n\t\t\t\tif (isFull(board)) {\n\t\t\t\t\t// full& not movable leads to gameover\n\t\t\t\t\tif (!isMovable(board)) {\n\t\t\t\t\t\t// playing to game over\n\t\t\t\t\t\tgame.context.state.nextState(game);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tboard.board = M.clone();\n\t\t\t\tgenerateNewBlock(zeroNum, board);// all direction here is left\n\t\t\t}\n\t\t}\n\n\t\tif (d == direction.right) {\n\t\t\tl2r(board);\n\t\t\tchanged = swipe(direction.left, board, game);\n\t\t\tl2r(board);\n\t\t}\n\n\t\tif (d == direction.up) {\n\t\t\ttrans(board);\n\t\t\tchanged = swipe(direction.left, board, game);\n\t\t\ttrans(board);\n\t\t}\n\t\tif (d == direction.down) {\n\t\t\ttrans(board);\n\t\t\tl2r(board);\n\t\t\tchanged = swipe(direction.left, board, game);\n\t\t\tl2r(board);\n\t\t\ttrans(board);\n\t\t}\n\n\t\treturn changed;\n\n\t}",
"@Test\n\tpublic void testAdjacencyDoorways()\n\t{\n\t\t// Test beside a door direction RIGHT\n\t\tSet<BoardCell> testList = board.getAdjList(18, 18);\n\t\tassertTrue(testList.contains(board.getCellAt(18, 17)));\n\t\tassertTrue(testList.contains(board.getCellAt(19, 18)));\n\t\tassertTrue(testList.contains(board.getCellAt(18, 19)));\n\t\tassertTrue(testList.contains(board.getCellAt(17, 18)));\n\t\tassertEquals(4, testList.size());\n\t\t// Test beside a door direction DOWN\n\t\ttestList = board.getAdjList(5, 17);\n\t\tassertTrue(testList.contains(board.getCellAt(6, 17)));\n\t\tassertTrue(testList.contains(board.getCellAt(4, 17)));\n\t\tassertTrue(testList.contains(board.getCellAt(5, 16)));\n\t\tassertTrue(testList.contains(board.getCellAt(5, 18)));\n\t\tassertEquals(4, testList.size());\n\t\t// Test beside a door direction LEFT\n\t\ttestList = board.getAdjList(11, 18);\n\t\tassertTrue(testList.contains(board.getCellAt(11, 19)));\n\t\tassertTrue(testList.contains(board.getCellAt(11, 17)));\n\t\tassertTrue(testList.contains(board.getCellAt(10, 18)));\n\t\tassertTrue(testList.contains(board.getCellAt(12, 18)));\n\t\tassertEquals(4, testList.size());\n\t\t// Test beside a door direction UP\n\t\ttestList = board.getAdjList(8, 4);\n\t\tassertTrue(testList.contains(board.getCellAt(8, 5)));\n\t\tassertTrue(testList.contains(board.getCellAt(8, 3)));\n\t\tassertTrue(testList.contains(board.getCellAt(7, 4)));\n\t\tassertTrue(testList.contains(board.getCellAt(9, 4)));\n\t\tassertEquals(4, testList.size());\n\t}",
"private static void dfs(int x, int y) {\n arr[x][y] = 1;\n area++;\n \n for(int i=0; i<4; i++) {\n int nx = x + dx[i];\n int ny = y + dy[i];\n \n if(0 <= nx && nx < m && 0 <= ny && ny < n) {\n if(arr[nx][ny] == 0)\n dfs(nx, ny);\n }\n }\n\t\t\n\t}",
"private void randomDirection(ArrayList<ArrayList<Cell>> cells) {\n\t\tfinal int UP = 0;\n\t\tfinal int RIGHT = 1;\n\t\tfinal int DOWN = 2;\n\t\tfinal int LEFT = 3;\n\t\tfinal int MAX_TRAVERSABLE_DIRECTIONS = 4;\n\t\tint direction = -1;\n\t\tboolean[] traversableDirections = new boolean[MAX_TRAVERSABLE_DIRECTIONS];\n\t\tif (checkTraversable(cells, getxPos(), getyPos() - 1)) {\n\t\t\ttraversableDirections[UP] = true;\n\t\t}\n\t\tif (checkTraversable(cells, getxPos() + 1, getyPos())) {\n\t\t\ttraversableDirections[RIGHT] = true;\n\t\t}\n\t\tif (checkTraversable(cells, getxPos(), getyPos() + 1)) {\n\t\t\ttraversableDirections[DOWN] = true;\n\t\t}\n\t\tif (checkTraversable(cells, getxPos() - 1, getyPos())) {\n\t\t\ttraversableDirections[LEFT] = true;\n\t\t}\n\t\twhile (direction == -1) {\n\t\t\tint randomDirection = new Random().nextInt(MAX_TRAVERSABLE_DIRECTIONS);\n\t\t\tif (traversableDirections[randomDirection]) {\n\t\t\t\tdirection = randomDirection;\n\t\t\t} else {\n\t\t\t\tdirection = -1;\n\t\t\t}\n\t\t}\n\t\tif (direction == UP) {\n\t\t\tsetyPos(getyPos() - 1);\n\t\t} else if (direction == RIGHT) {\n\t\t\tsetxPos(getxPos() + 1);\n\t\t} else if (direction == DOWN) {\n\t\t\tsetyPos(getyPos() + 1);\n\t\t} else if (direction == LEFT) {\n\t\t\tsetxPos(getxPos() - 1);\n\t\t}\n\t}",
"public void printGrid() {\n // Creation of depth Z\n for (int d = 0; d < grid[0][0].length; d++) {\n System.out.println(\"\");\n int layer = d + 1;\n System.out.println(\"\");\n System.out.println(\"Grid layer: \" + layer);\n // Creation of height Y\n for (int h = 1; h < grid.length; h++) {\n System.out.println(\"\");\n // Creation of width X\n for (int w = 1; w < grid[0].length; w++) {\n if (grid[h][w][d] == null) {\n System.out.print(\" . \");\n } else {\n String gridContent = grid[h][w][d];\n char identifier = gridContent.charAt(0);\n\n int n = 0;\n if(grid[h][w][d].length() == 3) {\n n = grid[h][w][d].charAt(2) % 5;\n } else if (grid[h][w][d].length() == 2) {\n n = grid[h][w][d].charAt(1)%5;\n }\n if(n == 0) n = 6;\n\n // Labelling\n if (identifier == 'G' && grid[h][w][d].length() == 3) {\n System.out.print(\"\\033[47m\");\n System.out.print(grid[h][w][d]);\n System.out.print(\"\\033[0m\");\n } else if (identifier == 'G') {\n System.out.print(\"\\033[47m\");\n System.out.print(grid[h][w][d]);\n System.out.print(\"\\033[0m\");\n System.out.print(\" \");\n } else if (identifier == 'L' && grid[h][w][d].length() == 3) {\n System.out.print(\"\\033[3\"+ n + \"m\");\n System.out.print(grid[h][w][d]);\n System.out.print(\"\\033[0m\");\n } else if (identifier == 'L') {\n System.out.print(\"\\033[3\"+ n + \"m\");\n System.out.print(grid[h][w][d]);\n System.out.print(\"\\033[0m\");\n System.out.print(\" \");\n }\n }\n }\n }\n }\n System.out.println(\"\");\n }",
"private void createMaze(int cWidth, int cHeight) {\n\t\tCompass[] direction = Compass.values();\n\t\tCollections.shuffle(Arrays.asList(direction));\n\t\tfor (Compass pointing: direction) {\n\t\t\tPoint currentPoint = new Point(cWidth, cHeight);\n\t\t\tvisited.add(currentPoint);\n\t\t\tint nextW = cWidth + pointing.genX;\n\t\t\tint nextH = cHeight + pointing.genY;\n\t\t\tPoint nextPoint = new Point(nextW, nextH);\n\t\t\tif (arrayBounds(nextW, width) && arrayBounds (nextH, height) && maze[nextW][nextH] == 0 && !visited.contains(nextPoint)) {\n\t\t\t\tmaze[cWidth + pointing.mapX][cHeight + pointing.mapY] = 0;\n\t\t\t\tcreateMaze(nextW, nextH);\n\t\t\t}\n\t\t} \n\t}",
"private boolean checkTopLeftDownDiag(char playerSymbol) {\n //checking the top left-bottom right diagonal\n for (int i = 0; i < N; i++) {\n if (grid[i][i].getSymbol() != playerSymbol) {\n return false;\n }\n }\n return true;\n }",
"private boolean isPathH(Board B, Move M, Graph G, int row, int column, Tile tile) {\n\n Tile t = tile;\n\n boolean result = true;\n boolean tempa = true;\n\n int sourceid = 0;\n\n\n int c = M.getX(), r = M.getY();\n\n if (r <= 0 && c <= 0) {\n\n\n } else if (r <= 0 && c >= 0) {\n\n\n } else if (r >= 0 && c >= 0) {\n\n for (int y = 0; y != 2; y++) {\n\n sourceid = (row * B.width) + column;\n\n // System.out.println(\"source id: \" + sourceid);\n\n if (y == 0) {\n\n\n //aab\n for (int i = 0; i != r; i++) {\n\n System.out.println(G.adj(sourceid).toString());\n\n if (G.adj.get(sourceid).contains(sourceid + B.width)) {\n\n // System.out.println(\"row artı\");\n\n } else {\n\n result = false;\n\n }\n\n sourceid += B.width;\n\n }\n\n for (int i = 0; i != c; i++) {\n\n\n if (G.adj.get(sourceid).contains(sourceid + 1)) {\n\n // System.out.println(\"okk\");\n\n } else {\n\n //return false;\n\n }\n\n sourceid += 1;\n\n System.out.println(\"b\");\n\n }\n } else {\n\n sourceid = row * B.width + column;\n\n for (int i = 0; i != c; i++) {\n // System.out.println(\"a\");\n\n }\n for (int i = 0; i != r; i++) {\n // System.out.println(\"b\");\n\n }\n }\n\n\n }\n\n\n }\n\n\n return result;\n }",
"static void nextIteration(int matrix[][], int NUMBER_OF_ROWS, int NUMBER_OF_COLUMNS) {\n\t\t// variable to hold the matrix of original size of the matrix\n\t\tint[][] nextMatrixCycle = new int[NUMBER_OF_ROWS][NUMBER_OF_COLUMNS];\n\n\t\t/**\n\t\t * Looping through each row cell of the matrix Starting from 1 as matrix[1][1]\n\t\t * is first cell with neighbours (in first row) Going only till rows-1 as last\n\t\t * cell with neighbours is matrix[#row-1][#col-1]\n\t\t */\n\t\tfor (int rowCellCounter = 1; rowCellCounter < NUMBER_OF_ROWS - 1; rowCellCounter++) {\n\t\t\t/**\n\t\t\t * Loop to iterate through each column till all columns have been visited\n\t\t\t * Starting from 1 as matrix[1][1] is first cell with neighbours (in first\n\t\t\t * column) Going only till rows-1 as last cell with neighbours is\n\t\t\t * matrix[#row-1][#col-1]\n\t\t\t */\n\t\t\tfor (int colVisitCounter = 1; colVisitCounter < NUMBER_OF_COLUMNS - 1; colVisitCounter++) {\n\t\t\t\t// Variable to store the number of live Neighbouring cells\n\t\t\t\tint liveNeighbourCells = 0;\n\t\t\t\t/**\n\t\t\t\t * Loop to get column neighbour cell values\n\t\t\t\t * Going only from -1 to 1 (0 to 2) as neighbours exists between 0 and 2 only\n\t\t\t\t */\n\t\t\t\tfor (int row = -1; row <= 1; row++)\n\t\t\t\t\t/**\n\t\t\t\t\t * Loop to get row neighbour cell values\n\t\t\t\t\t * Going only from -1 to 1 (0 to 2) as neighbours exists between 0 and 2 only\n\t\t\t\t\t */\n\t\t\t\t\tfor (int col = -1; col <= 1; col++)\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Add the matrix[x][y] cell value to live neighbour cell count\n\t\t\t\t\t\t * where x = rowCellCounter + i, and y = colVisitCounter + j\n\t\t\t\t\t\t * [x][y] ranges from [0][0] to [2][2], that is all neighbours\n\t\t\t\t\t\t * Including the current cell as well\n\t\t\t\t\t\t */\n\t\t\t\t\t\tliveNeighbourCells = liveNeighbourCells + matrix[rowCellCounter + row][colVisitCounter + col];\n\n\t\t\t\t// The current cell needs to be subtracted as it has been counted before already\n\t\t\t\tliveNeighbourCells = liveNeighbourCells - matrix[rowCellCounter][colVisitCounter];\n\n\t\t\t\t/**\n\t\t\t\t * The live cell dies if either The number of neighbouring cells is less than 2\n\t\t\t\t * for a live cell The number of neighbouring cells is more than 3 for a live\n\t\t\t\t * cell\n\t\t\t\t */\n\t\t\t\tif ((matrix[rowCellCounter][colVisitCounter] == 1)\n\t\t\t\t\t\t&& ((liveNeighbourCells < 2) || (liveNeighbourCells > 3))) {\n\t\t\t\t\tnextMatrixCycle[rowCellCounter][colVisitCounter] = 0;\n\t\t\t\t}\n\t\t\t\t// Dead cell becomes a live cell iff there are exactly 3 neighbouring cells\n\t\t\t\t// around it\n\t\t\t\telse if ((matrix[rowCellCounter][colVisitCounter] == 0) && (liveNeighbourCells == 3)) {\n\t\t\t\t\tnextMatrixCycle[rowCellCounter][colVisitCounter] = 1;\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * For any other condition, state of the cell does not change at all, and Just\n\t\t\t\t * take the value from the original matrix and copy it as is\n\t\t\t\t */\n\t\t\t\telse {\n\t\t\t\t\tnextMatrixCycle[rowCellCounter][colVisitCounter] = matrix[rowCellCounter][colVisitCounter];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Print the matrix\n\t\tprintMatrix(nextMatrixCycle, NUMBER_OF_ROWS, NUMBER_OF_COLUMNS);\n\t}",
"public static void main(String[] args) {\n\t\tint width=35;\n\t\tint length=31;\n\t\tlong[][] dp = new long[width+1][length+1];\n\t\tdp[0][0]=0;\n\t\tfor(int i=1;i<length+1;i++){\n\t\t\tif(badCheck(0,i,0,i-1)){\n\t\t\t\tdp[0][i]=0;\n\t\t\t\tfor(int k=i+1;k<length+1;k++){\n\t\t\t\t\tdp[0][k]=0;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}else{\n\t\t\t\tdp[0][i]=1;\n\t\t\t}\n\t\t}\n\t\tfor(int i=1;i<width+1;i++){\n\t\t\tif(badCheck(i,0,i-1,0)){\n\t\t\t\tdp[i][0]=0;\n\t\t\t\tfor(int k=i+1;k<width+1;k++){\n\t\t\t\t\tdp[k][0]=0;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}else{\n\t\t\t\tdp[i][0]=1;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i=1;i<=width;i++){\n\t\t\tfor(int j=1;j<=length;j++){\n\t\t\t\tif(!badCheck(i-1,j,i,j)){\n\t\t\t\t\tdp[i][j]+=dp[i-1][j];\n\t\t\t\t}\n\t\t\t\tif(!badCheck(i,j-1,i,j)){\n\t\t\t\t\tdp[i][j]+=dp[i][j-1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//System.out.println(dp[6][6]);\n\t\t//System.out.println(dp[2][2]);\n\t\t//System.out.println(dp[1][1]);\n\t\tSystem.out.println(dp[35][31]);\n\t}",
"public static void wallsAndGates(int[][] rooms) {\n if (rooms.length == 0 || rooms[0].length == 0) {\n return;\n }\n\n int m = rooms.length;\n int n = rooms[0].length;\n\n Queue<int[]> queue = new LinkedList();\n boolean[][] visited = new boolean[m][n];\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n if (rooms[i][j] == 0) {\n queue.add(new int[] {i, j});\n }\n }\n }\n\n int level = 1;\n while (!queue.isEmpty()) {\n int size = queue.size();\n for (int i = 0; i < size; i++) {\n int[] cur = queue.poll();\n int currow = cur[0];\n int curcol = cur[1];\n\n int row;\n int col;\n\n //up\n row = currow-1;\n col = curcol;\n if (row >= 0) {\n if (rooms[row][col] == Integer.MAX_VALUE && !visited[row][col]) {\n visited[row][col] = true;\n rooms[row][col] = level;\n queue.add(new int[] {row, col});\n }\n }\n\n //down\n row = currow+1;\n if (row < m) {\n if (rooms[row][col] == Integer.MAX_VALUE && !visited[row][col]) {\n visited[row][col] = true;\n rooms[row][col] = level;\n queue.add(new int[] {row, col});\n }\n }\n\n //left\n row = currow;\n col = curcol-1;\n if (col >= 0) {\n if (rooms[row][col] == Integer.MAX_VALUE && !visited[row][col]) {\n visited[row][col] = true;\n rooms[row][col] = level;\n queue.add(new int[] {row, col});\n }\n }\n\n //right\n row = currow;\n col = curcol + 1;\n if (col < n) {\n if (rooms[row][col] == Integer.MAX_VALUE && !visited[row][col]) {\n visited[row][col] = true;\n rooms[row][col] = level;\n queue.add(new int[] {row, col});\n }\n }\n }\n level++;\n }\n\n }",
"private Cell scanFirstDiagonal(Figure value) {\n Figure oppositeValue = game.getOppositeFigure(value);\n int emptyString = 0;\n int emptyRow = 0;\n int emptyCnt = 0;\n int row = 0;\n for (int string = 0; string < game.getFieldSize(); string++) {\n Figure fieldValue = game.getFieldValue(string,row);\n if (fieldValue.equals(oppositeValue)) {\n emptyCnt = 0;\n break;\n } else if (fieldValue.equals(EMPTY)) {\n emptyCnt++;\n emptyRow = row;\n emptyString = string;\n }\n row++;\n }\n if (emptyCnt == 1) {\n return new Cell(emptyString, emptyRow);\n }\n return scanSecondDiagonal(value);\n }",
"static boolean checkForDiagonalPositions(int i, int j, String[][] board, boolean playerWins) {\r\n\t\tif ((board[i][j].equals(board[0][2]) && board[0][2].equals(\"*\") && board[i][j].equals(board[1][1])\r\n\t\t\t\t&& board[1][1].equals(\"*\") && board[i][j].equals(board[2][0]) && board[2][0].equals(\"*\"))\r\n\t\t\t\t|| (board[i][j].equals(board[0][0]) && board[0][0].equals(\"*\") && board[i][j].equals(board[1][1])\r\n\t\t\t\t\t\t&& board[1][1].equals(\"*\") && board[i][j].equals(board[2][2]) && board[2][2].equals(\"*\"))) {\r\n\t\t\tplayerWins = true;\r\n\t\t}\r\n\t\treturn playerWins;\r\n\t}",
"private boolean checkDiagonalForWinner(String mark,int buttonId)\n {\n \tint rows =3;\n \tint columns = 3;\n \tboolean winStatus=false;\n \tint columnNumber = buttonId%columns;\n \tint rownumber = buttonId/rows;\n \tint rowIndex= 0;\n \tint columnIndex = 0;\n \tint index;\n \tif(columnNumber==rownumber)\n \t{\n \t\t//int index; \n\t \twhile (rowIndex<rows)\n\t \t{\n\t \t\tindex = getIndex(rowIndex,columnIndex,columns);\n\t \t\tif(movesPlayed[index]!=mark|| movesPlayed[index]==\"\")\n\t \t\t{\n\t \t\t\treturn winStatus;\n\t \t\t}\n\t \t\telse\n\t \t\t{\n\t \t\t\trowIndex++;\n\t \t\t\tcolumnIndex++;\n\t \t\t}\n\t \t}\n\t \twinStatus=true;\n\t \treturn winStatus;\n \t}\n \t//Detect right to left diagonal\n \tint sum = columnNumber + rownumber;\n \tif(sum==rows-1)\n \t{\n \t\trowIndex = 0;\n \t\tcolumnIndex = columns-1;\n \t\twhile (rowIndex<rows)\n\t \t{\n\t \t\tindex = getIndex(rowIndex,columnIndex,columns);\n\t \t\tif(movesPlayed[index]!=mark|| movesPlayed[index]==\"\")\n\t \t\t{\n\t \t\t\treturn winStatus;\n\t \t\t}\n\t \t\telse\n\t \t\t{\n\t \t\t\trowIndex++;\n\t \t\t\tcolumnIndex--;\n\t \t\t}\n\t \t}\n\t \twinStatus=true;\n\t \treturn winStatus;\n \t}\n \t\n \treturn false;\n }",
"public int numIslands(char[][] grid){\n int count = 0;\n for (nt i = 0; i < grid.length; i++){\n for (int j = 0; j < grid[0].length; j++){\n if (grid[i][j] == '1'){\n dfs(grid, i, j);\n count++;\n }\n }\n }\n return count;\n}",
"private int xyTo1D(int row, int col)\n {\n validate(row, col);\n return (row-1) * gridSize + col-1;\n }",
"public void createMaze(int rows, int cols) {\n\t\t\n\t\tint total = rows*cols;\n\t\tDisjSets ds = new DisjSets(total); //Create an object of the disjoint set class\n\t\t \n\t\tList<List<Node>> maze = new ArrayList<List<Node>>();\n\t\t \n\t\tmaze = initializeMaze(rows, cols, maze); //Initialize the maze\n\t\t \n\t\tRandom rand = new Random();\n\t\t \n\t\twhile(ds.find(0) != ds.find(total - 1)) {\n\t\t\t \n\t\t\tint currRow = rand.nextInt(rows); //Random row number\n\t\t\tint currCol = rand.nextInt(cols); //Random column number\n\t\t\tNode currNode = maze.get(currRow).get(currCol); //Current node(cell)\n\t\t\tint currValue = currNode.value;\n\t\t\t \n\t\t\tint root1 = ds.find(currValue); //Find on current node(cell)\n\t\t\tint root2;\n\t\t\tboolean removeHorizontal = false;\n\t\t\t \n\t\t\tif(currValue == total - 1) {\n\t\t\t\tcontinue; //Don't do anything if the current cell is the bottom-rightmost cell\n\t\t\t}\n\t\t\t \n\t\t\tif(currRow == rows - 1) {\n\t\t\t\t//Last row -- can only break the right wall, can't break the wall to the bottom \n\t\t\t\troot2 = ds.find(currValue + 1);\n\t\t\t} else if(currCol == cols - 1) {\n\t\t\t\t//Last column -- can only break the wall to the bottom, can't break the right wall \n\t\t\t\troot2 = ds.find(currValue + cols);\n\t\t\t\tremoveHorizontal = true;\n\t\t\t} else {\n\t\t\t\t//Neither last row nor last column\n\t\t\t\t//Randomly select either right wall or wall to the bottom to break\n\t\t\t\tboolean selectRight;\n\t\t\t\tselectRight = rand.nextBoolean();\n\t\t\t\t \n\t\t\t\tif(selectRight) {\n\t\t\t\t\troot2 = ds.find(currValue + 1);\n\t\t\t\t} else {\n\t\t\t\t\troot2 = ds.find(currValue + cols);\n\t\t\t\t\tremoveHorizontal = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Finds resulted in different sets\n\t\t\tif(root1 != root2) {\n\t\t\t\t \n\t\t\t\tds.union(root1, root2); //Take union of the two sets\n\t\t\t\t \n\t\t\t\tif(removeHorizontal) {\n\t\t\t\t\tcurrNode.horizontal = false; //Break the horizontal wall\n\t\t\t\t} else {\n\t\t\t\t\tcurrNode.vertical = false; //Break the vertical wall\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Leave the bottom right corner open\n\t\tNode destination = maze.get(rows - 1).get(cols - 1);\n\t\tdestination.horizontal = false;\n\t\tdestination.vertical = false;\n\t\t \n\t\tprintMaze(rows, cols, maze); //Print the final maze\n\t}",
"private boolean createDiagonalProtectingMoves(Chessboard chessboard, boolean colour) {\n\t\tint row = position / 8;\n\t\tint col = position % 8;\n\t\tint maxMovement = 0;\n\t\tif (row < 4 && col < 4) {\n\t\t\tmaxMovement = 7 - Math.max(row, col);\n\t\t} else if (row < 4 && col > 3) {\n\t\t\tmaxMovement = Math.min(col, 7 - row);\n\t\t} else if (row > 3 && col < 4) {\n\t\t\tmaxMovement = Math.min(row, 7 - col);\n\t\t} else {\n\t\t\tmaxMovement = Math.min(row, col);\n\t\t}\n\t\tboolean neBlocked = false, seBlocked = false, swBlocked = false, nwBlocked = false;\n\t\tint nePosition, sePosition, swPosition, nwPosition;\n\t\tfor (int i = 1; i <= maxMovement; i++) {\n\t\t\t// check north-east\n\t\t\tnePosition = (row - i) * 8 + col + i;\n\t\t\tsePosition = (row + i) * 8 + col + i;\n\t\t\tswPosition = (row + i) * 8 + col - i;\n\t\t\tnwPosition = (row - i) * 8 + col - i;\n\t\t\tif (!neBlocked && row - i >= 0 && col + i < 8) {\n\t\t\t\tPiece piece = chessboard.getSquareContents(nePosition);\n\t\t\t\tif (chessboard.getSquareContents(row-i, col+i) == null) {\n\t\t\t\t\t// the route is clear, continue\n\t\t\t\t} else if ((piece instanceof Bishop || piece instanceof Queen) && piece.amIWhite() == colour) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tneBlocked = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// check south-east\n\t\t\tif (!seBlocked && row + i < 8 && col + i < 8) {\n\t\t\t\tPiece piece = chessboard.getSquareContents(sePosition);\n\t\t\t\tif (chessboard.getSquareContents(row+i, col+i) == null) {\n\t\t\t\t\t// the route is clear, continue\n\t\t\t\t} else if ((piece instanceof Bishop || piece instanceof Queen) && piece.amIWhite() == colour) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tseBlocked = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// check south-west\n\t\t\tif (!swBlocked && row + i < 8 && col - i >= 0) {\n\t\t\t\tPiece piece = chessboard.getSquareContents(swPosition);\n\t\t\t\tif (chessboard.getSquareContents(row+i, col-i) == null) {\n\t\t\t\t\t// the route is clear, continue\n\t\t\t\t} else if ((piece instanceof Bishop || piece instanceof Queen) && piece.amIWhite() == colour) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tswBlocked = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// check nort-west\n\t\t\tif (!nwBlocked && row - i >= 0 && col - i >= 0) {\n\t\t\t\tPiece piece = chessboard.getSquareContents(nwPosition);\n\t\t\t\tif (chessboard.getSquareContents(row-i, col-i) == null) {\n\t\t\t\t\t// the route is clear, continue\n\t\t\t\t} else if ((piece instanceof Bishop || piece instanceof Queen) && piece.amIWhite() == colour) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tnwBlocked = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public void moveDown()\n {\n // runs through column first, row second\n for ( int column = 0; column < grid[0].length; column++) {\n\n // check is set to false, meaning no combinations have been made\n boolean check = false;\n for ( int row = grid.length-2; row >= 0; row--) {\n int compare = row;\n if ( grid[compare][column] != 0 ) { \n\n // loop continues whiel there are still zero values below the current\n // tile\n while ( grid[compare+1][column] == 0 ) {\n\n // switches places of the current tile with the zero tile\n grid[compare+1][column] = grid[compare][column];\n grid[compare][column] = 0;\n compare ++;\n\n // if you reach the bottom of your board, break from the loop\n if ( compare == grid.length-1 ){\n break;\n }\n }\n // if a combination was made on the previous loop, set check to false\n if ( check == true ){\n check = false;\n }\n // if a combination wasn't made on the previous loop and two tiles \n // next to each other have the same value, combine them\n else if ( compare != grid.length-1 &&\n grid[compare+1][column] == grid[compare][column]) {\n grid[compare+1][column] = 2*grid[compare+1][column];\n grid[compare][column] = 0;\n\n // sets check to true to indicate a combination was made\n check = true;\n\n // increases your score by the value of the combined tile\n score+= grid[compare+1][column];\n } \n }\n }\n } \n }",
"private int[] nextDiagWin(){ \r\n\t\t//left diagonal\r\n\t\tif (board[0][0] == board[1][1] && board[2][2] == '-' && board[0][0] != '-'){\r\n\t\t\tdiagWin[0] = 2; \r\n\t\t\tdiagWin[1] = 2;\r\n\t\t\treturn diagWin;\r\n\t\t}\r\n\t\telse if (board[1][1] == board[2][2] && board[0][0] == '-' && board[1][1] != '-'){\r\n\t\t\tdiagWin[0] = 0; \r\n\t\t\tdiagWin[1] = 0;\r\n\t\t\treturn diagWin;\r\n\t\t}\r\n\t\telse if (board[0][0] == board[2][2] && board[1][1] == '-' && board[0][0] != '-'){\r\n\t\t\tdiagWin[0] = 1; \r\n\t\t\tdiagWin[1] = 1;\r\n\t\t\treturn diagWin;\r\n\t\t}\r\n\t\t//right diagonal\r\n\t\telse if (board[0][2] == board[2][0] && board[1][1] == '-' && board[0][2] != '-'){\r\n\t\t\tdiagWin[0] = 1; \r\n\t\t\tdiagWin[1] = 1;\r\n\t\t\treturn diagWin;\r\n\t\t}\r\n\t\telse if (board[0][2] == board[1][1] && board[2][0] == '-' && board[0][2] != '-'){\r\n\t\t\tdiagWin[0] = 2; \r\n\t\t\tdiagWin[1] = 0;\r\n\t\t\treturn diagWin;\r\n\t\t}\t\t\r\n\t\telse if (board[1][1] == board[2][0] && board[0][2] == '-' && board[1][1] != '-'){\r\n\t\t\tdiagWin[0] = 0; \r\n\t\t\tdiagWin[1] = 2;\r\n\t\t\treturn diagWin;\r\n\t\t}\r\n\t\treturn diagWin;\r\n\t}",
"public void setPoints(int numOfIter) {\n\t\tint x = getX();\n\t\tint y = getY();\n\t\tint w = getW();\n\t\tint h = getH();\n\t\th = ((int) (getH() - w*0.29));\n\t\tint numOfSides = 3 * power(4, numOfIter);\n\t\n\t\t\n\t\tif(numOfIter == 0) {\n\t\t\txPointsD = new double[numOfSides];\n\t\t\tyPointsD = new double[numOfSides];\n\t\t\t\n\t\t\txPointsD[2] = x;\n\t\t\tyPointsD[2] = y + h;\n\t\t\t\n\t\t\txPointsD[1] = (double) x + ((double) w)/2;\n\t\t\tyPointsD[1] = y;\n\t\t\t\n\t\t\txPointsD[0] = x + w;\n\t\t\tyPointsD[0] = y + h;\n\t\t} else {\n\t\t\tsetPoints(numOfIter - 1);\n\t\t\tint numOfSidesBefore = xPoints.length;\n\t\t\tdouble[] xPointsDB = xPointsD;\n\t\t\tdouble[] yPointsDB = yPointsD;\n\t\t\txPointsD = new double[numOfSides];\n\t\t\tyPointsD = new double[numOfSides];\n\t\t\t\n\t\t\tfor(int i = 0; i < numOfSidesBefore; i++) {\n\t\t\t\txPointsD[4*i] = xPointsDB[i];\n\t\t\t\tyPointsD[4*i] = yPointsDB[i];\n\t\t\t\t\n\t\t\t\tdouble nextXPointsDB;\n\t\t\t\tdouble nextYPointsDB;\n\t\t\t\tif(i < numOfSidesBefore - 1) {\n\t\t\t\t\tnextXPointsDB = xPointsDB[i+1];\n\t\t\t\t\tnextYPointsDB = yPointsDB[i+1];\n\t\t\t\t} else {\n\t\t\t\t\tnextXPointsDB = xPointsDB[0];\n\t\t\t\t\tnextYPointsDB = yPointsDB[0];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//4i + 1 --> U = (2A+B)/3\n\t\t\t\txPointsD[4*i + 1] = (2 * xPointsDB[i] + nextXPointsDB)/3;\n\t\t\t\tyPointsD[4*i + 1] = (2 * yPointsDB[i] + nextYPointsDB)/3;\n\t\t\t\t\n\t\t\t\t//4i + 2 --> this one is complicated --> V = U + (AB/3)*(cos(ang(AB) + pi.3), sin(ang(AB) + pi/3))\n\t\t\t\tdouble angAB = Math.atan2(nextYPointsDB-yPointsDB[i], nextXPointsDB-xPointsDB[i]);\n\t\t\t\txPointsD[4*i + 2] = xPointsD[4*i + 1] + \n\t\t\t\t\t\t(Math.sqrt((nextXPointsDB - xPointsDB[i])*(nextXPointsDB - xPointsDB[i]) +\n\t\t\t\t\t\t\t\t(nextYPointsDB - yPointsDB[i])*(nextYPointsDB - yPointsDB[i]))/3.0) *\n\t\t\t\t\t\tMath.cos(angAB + Math.PI/3.0); \n\t\t\t\t\n\t\t\t\tyPointsD[4*i + 2] = yPointsD[4*i + 1] + \n\t\t\t\t\t\t(Math.sqrt((nextXPointsDB - xPointsDB[i])*(nextXPointsDB - xPointsDB[i]) +\n\t\t\t\t\t\t\t\t(nextYPointsDB - yPointsDB[i])*(nextYPointsDB - yPointsDB[i]))/3.0) *\n\t\t\t\t\t\tMath.sin(angAB + Math.PI/3.0);\n\t\t\t\t\n\t\t\t\t//4i + 3 --> W = (A + 2B)/3\n\t\t\t\txPointsD[4*i + 3] = (xPointsDB[i] + 2 * nextXPointsDB)/3;\n\t\t\t\tyPointsD[4*i + 3] = (yPointsDB[i] + 2 * nextYPointsDB)/3;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\txPoints = new int[numOfSides];\n\t\tyPoints = new int[numOfSides];\n\t\tfor(int i = 0; i < numOfSides; i++) {\n\t\t\txPoints[i] = (int) xPointsD[i];\n\t\t\tyPoints[i] = (int) yPointsD[i];\n\t\t}\n\t\t\n\t}",
"public static void main(String [] args){\n\t\t\n\t\t\n\t\t\n\t\n\t\tint [] [] matrix = new int [5][5];\n\t\tint count= 1;\n\t for(int i= 0 ; i < matrix.length; i++){\n\t \tSystem.out.println(\"\");\n\t \tfor(int j=0; j<matrix.length; j++){\n\t \t\t matrix[i][j]= count;\n\t \t\t //System.out.print(matrix[i][j]+\" \");\n\t \t\t count++;\n\t \t}\n\t \t\n\t }\n\t\tcount = 0;\n\t\tint i= 0;\n \tint j =0;\n \tint topLevel=0;\n \tint leftLevel=0;\n \tint bottumLevel =0;\n \tint rightLevel= 0;\n\t while(count<25){\n\t \t\n\t \t\n\t \t//move L-R \n\t \ti=topLevel;\n\t \tj=leftLevel;\n\t \tfor(;j <= (matrix.length-1)-rightLevel ;j++){\n\t \t\tSystem.out.println(matrix[i][j]);\n\t \t\tcount ++;\n\t \t}\n\t \ttopLevel++;\n\t \t//move T-B\n\t \tfor(i=topLevel;i<=(matrix.length-1)-bottumLevel;i++){\n\t \t\tSystem.out.println(matrix[i][j-1]);\n\t \t\tcount ++;\n\t \t}\n\t \trightLevel++;\n\t //Move R-L \n\t \tif(i==j){\n\t \t\ti=j=i-1;\n\t \t\tfor(j=j-1;j>=leftLevel;j--){\n\t \t\t\tSystem.out.println(matrix[i][j]);\n\t \t\t\tcount ++;\n\t \t\t}\n\t \t\tbottumLevel++;\n\t \t}\n\t \t//Move B-T\n\t \tj++;\n\t \tfor(i=i-1;i>=topLevel;i--){\n\t \t\tSystem.out.println(matrix[i][j]);\n\t \t\tcount ++;\n\t \t}\n\t \tleftLevel++;\n\t \t\n\t \t\n\t \t\n\t }\n\t\t\n\t}",
"@Override\n\tpublic boolean linear(InternalCoordinate c) {\n\t\tif (x == c.getX()) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// The two diagonals\n\t\tint tmpx = x;\n\t\tint tmpy = y;\n\t\tif (isDown(x, y)) {\n\t\t\t// Down right\n\t\t\tif (c.getY() > y) {\n\t\t\t\twhile (tmpx > c.getX() || tmpy < c.getY()) {\n\t\t\t\t\ttmpx += isDown(tmpx, tmpy) ? 0 : -1;\n\t\t\t\t\ttmpy += isDown(tmpx, tmpy) ? 1 : 0;\n\t\t\t\t\t\n\t\t\t\t\tif (tmpx == c.getX() && tmpy == c.getY()) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t//Down left\n\t\t\t} else if (c.getY() < y) {\n\t\t\t\twhile (tmpx > c.getX() || tmpy > c.getY()) {\n\t\t\t\t\ttmpx += isDown(tmpx, tmpy) ? 0 : -1;\n\t\t\t\t\ttmpy += isDown(tmpx, tmpy) ? -1 : 0;\n\t\t\t\t\t\n\t\t\t\t\tif (tmpx == c.getX() && tmpy == c.getY()) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t} else {\n\t\t\t// Up right\n\t\t\tif (c.getY() > y) {\n\t\t\t\twhile (tmpx < c.getX() || tmpy < c.getY()) {\n\t\t\t\t\ttmpx += isDown(tmpx, tmpy) ? 1 : 0;\n\t\t\t\t\ttmpy += isDown(tmpx, tmpy) ? 0 : 1;\n\t\t\t\t\t\n\t\t\t\t\tif (tmpx == c.getX() && tmpy == c.getY()) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t//Up left\n\t\t\t} else if (c.getY() < y) {\n\t\t\t\twhile (tmpx < c.getX() || tmpy > c.getY()) {\n\t\t\t\t\ttmpx += isDown(tmpx, tmpy) ? 1 : 0;\n\t\t\t\t\ttmpy += isDown(tmpx, tmpy) ? 0 : -1;\n\t\t\t\t\t\n\t\t\t\t\tif (tmpx == c.getX() && tmpy == c.getY()) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t\t\n\t\treturn false;\n\t}"
] | [
"0.6818437",
"0.6564824",
"0.6464539",
"0.6263662",
"0.6231886",
"0.61891246",
"0.6177159",
"0.60566145",
"0.59723186",
"0.59680766",
"0.59254956",
"0.5890348",
"0.5865209",
"0.5846478",
"0.5830472",
"0.58259434",
"0.5822984",
"0.5817125",
"0.5788202",
"0.5781435",
"0.57796186",
"0.57562256",
"0.57555085",
"0.5743688",
"0.57228863",
"0.57134765",
"0.56981003",
"0.56857246",
"0.56794345",
"0.567926",
"0.5665001",
"0.5656053",
"0.5644243",
"0.5625794",
"0.5620786",
"0.56183183",
"0.5599492",
"0.5597882",
"0.5591103",
"0.5588529",
"0.558166",
"0.55721974",
"0.5564737",
"0.55631006",
"0.5556598",
"0.5551695",
"0.55503935",
"0.5546186",
"0.5542357",
"0.5539439",
"0.5525351",
"0.55150926",
"0.5506692",
"0.5503976",
"0.55032545",
"0.5502033",
"0.54963577",
"0.5494792",
"0.54863924",
"0.5478578",
"0.5473676",
"0.54682815",
"0.5460379",
"0.5459925",
"0.5440229",
"0.54398286",
"0.542936",
"0.5425869",
"0.5424365",
"0.5419061",
"0.5418684",
"0.5410753",
"0.5408905",
"0.54075545",
"0.54065186",
"0.5404363",
"0.54023576",
"0.5400526",
"0.5398464",
"0.5396005",
"0.5394239",
"0.53900105",
"0.53828853",
"0.5379167",
"0.5377106",
"0.5376644",
"0.5367345",
"0.5359825",
"0.53594935",
"0.5351206",
"0.5348724",
"0.5345079",
"0.5344458",
"0.53425443",
"0.5342492",
"0.5340521",
"0.5334144",
"0.53281265",
"0.5325956",
"0.53244853",
"0.5323848"
] | 0.0 | -1 |
/ Enabled aggressive block sorting | @Override
protected void subscribeActual(Subscriber<? super T> object) {
MaybeSource<? extends T>[] arrmaybeSource = this.sources;
int n = arrmaybeSource.length;
SimpleQueue simpleQueue = n <= MaybeMergeArray.bufferSize() ? new MpscFillOnceSimpleQueue(n) : new ClqSimpleQueue();
simpleQueue = new MergeMaybeObserver(object, n, (SimpleQueueWithConsumerIndex<Object>)simpleQueue);
object.onSubscribe((Subscription)((Object)simpleQueue));
object = ((MergeMaybeObserver)simpleQueue).error;
int n2 = arrmaybeSource.length;
n = 0;
do {
MaybeSource maybeSource;
block4: {
block3: {
if (n >= n2) break block3;
maybeSource = arrmaybeSource[n];
if (!((MergeMaybeObserver)simpleQueue).isCancelled() && ((AtomicReference)object).get() == null) break block4;
}
return;
}
maybeSource.subscribe(simpleQueue);
++n;
} while (true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void sortBlocks(){\n\t\tCurrentSets = getCurrentSets();\n\t\tif(CurrentSets == 1){\n\t\t\treturn;\n\t\t}else{\n\t\t\tfor(i = 0; i < CurrentSets - 1; i++){\n\t\t\t\tfor(j = i + 1; j < CurrentSets; j++){\n\t\t\t\t\tif((Integer.parseInt(blocks[i].getHexTag(), 16)) > (Integer.parseInt(blocks[j].getHexTag(), 16))){\n\t\t\t\t\t\ttemp = blocks[j];\n\t\t\t\t\t\tblocks[j] = blocks[i];\n\t\t\t\t\t\tblocks[i] = temp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public void sort(IAlg algorithm, boolean decrescent){}",
"private static void sortingMemo() {\n\t\t\n\t}",
"public void sort()throws InterruptedException{\n\t\tfor (int i = 0; i < a.length - 1; i++) {\n\t\t\tint minPos = minPosition(i);\n\t\t\tsortStateLock.lock();\n\t\t\ttry{\n\t\t\t\tswap(minPos, i);\n\t\t\t\t// For animation\n\t\t\t\talreadySorted = i;\n\t\t\t}\n\t\t\tfinally{\n\t\t\t\tsortStateLock.unlock();\n\t\t \t\t}\n\t\t\tpause(2);\n\t }\n }",
"public FastNondominatedSorting() {\r\n\t\tthis(new ParetoDominanceComparator());\r\n\t}",
"private PerfectMergeSort() {}",
"@Override\r\n\tpublic void sort() {\r\n\t\tint minpos;\r\n\t\tfor (int i = 0; i < elements.length-1; i++) {\r\n\t\t\tminpos=AuxMethods.minPos(elements, i);\r\n\t\t\telements=AuxMethods.swapElements(elements, i, minpos);\r\n\t\t\t\r\n\t\t}\r\n\t}",
"public void sort() {\n compares = 0;\n shuttlesort((int[]) indexes.clone(), indexes, 0, indexes.length);\n }",
"public void sort() {\r\n int k = start;\r\n for (int i = 0; i < size - 1; i++) {\r\n int p = (k + 1) % cir.length;\r\n for (int j = i + 1; j < size; j++) {\r\n if ((int) cir[p] < (int) cir[k % cir.length]) {\r\n Object temp = cir[k];\r\n cir[k] = cir[p];\r\n cir[p] = temp;\r\n }\r\n p = (p + 1) % cir.length;\r\n }\r\n k = (k + 1) % cir.length;\r\n }\r\n }",
"public void oldSort()\n\t{\n\t\tfor (int index = 0; index < arraySize; index++) {\n\t\t\tfor (int secondIndex = index + 1; secondIndex < arraySize; secondIndex++) {\n\t\t\t\tint temp = 0;\n\t\t\t\tif (array[index] > array[secondIndex]) {\n\t\t\t\t\ttemp = array[index];\n\t\t\t\t\tarray[index] = array[secondIndex];\n\t\t\t\t\tarray[secondIndex] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"private void sort() {\n\t\trunPassZero();\n\t\tList<TupleReaderBinary> buffers = new ArrayList<>();\n\t\tList<Tuple> sortStage = new ArrayList<>();\n\t\tassert (readerBucketID == 0);\n\t\tassert (writerBucketID == 0);\n\t\tassert (passNumber == 1);\n\t\tassert (currentGroup == 1);\n\t\toutputBuffer.clear();\n\n\t\t// assign buffers\n\t\tfor (int i = 0; i < numInputBuffers; i++) {\n\t\t\tbuffers.add(null);\n\t\t\tassignBuffer(buffers, i);\n\t\t\tsortStage.add(null);\n\t\t}\n\n\t\tassert (buffers.size() == numInputBuffers);\n\t\tassert (sortStage.size() == numInputBuffers);\n\n\t\t// read from buffers into list of size numInputBuffers\n\t\tfor (int i = 0; i < numInputBuffers; i++) {\n\t\t\tsortStage.set(i, readFromBuffer(buffers, i));\n\t\t}\n\n\t\toutputWriter = new TupleWriterBinary(DatabaseCatalog.getInstance().getTempDirectory() + \"/\" + instanceHashcode\n\t\t\t\t+ \"_\" + passNumber + \"_\" + writerBucketID);\n\n\t\twhile (true) {\n\t\t\tif (!findAndReplaceSmallest(buffers, sortStage)) {\n\t\t\t\tprevPrevTotalBuckets = prevTotalBuckets;\n\t\t\t\tprevTotalBuckets = writerBucketID + 1;\n\t\t\t\tflushOutputBuffer();\n\t\t\t\toutputWriter.close();\n\n\t\t\t\t// We are done! Return\n\t\t\t\tif (prevTotalBuckets == 1) {\n\t\t\t\t\tdeleteTempFiles();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\twriterBucketID = 0;\n\t\t\t\treaderBucketID = 0;\n\t\t\t\twriterFlushes = 0;\n\t\t\t\tdeleteTempFiles();\n\t\t\t\tpassNumber++;\n\t\t\t\tcurrentGroup = 1;\n\n\t\t\t\tfor (int i = 0; i < numInputBuffers; i++) {\n\t\t\t\t\tassignBuffer(buffers, i);\n\t\t\t\t\tsortStage.add(null);\n\t\t\t\t}\n\t\t\t\tfor (int i = 0; i < numInputBuffers; i++) {\n\t\t\t\t\tsortStage.set(i, readFromBuffer(buffers, i));\n\t\t\t\t}\n\n\t\t\t\toutputWriter = new TupleWriterBinary(DatabaseCatalog.getInstance().getTempDirectory() + \"/\"\n\t\t\t\t\t\t+ instanceHashcode + \"_\" + passNumber + \"_\" + writerBucketID);\n\t\t\t}\n\t\t}\n\n\t}",
"public void radixSorting() {\n\t\t\n\t}",
"public void sort() {\n }",
"public void sort() {\n\t\tdivider(0, array.size() - 1);\n\t}",
"public void setBubbleSort() \n\t{\n\t\tint last = recordCount + NOT_FOUND; //array.length() - 1\n\n\t\twhile(last > RESET_VALUE) //last > 0\n\t\t{\n\t\t\tint localIndex = RESET_VALUE; \n\t\t\tboolean swap = false;\n\n\t\t\twhile(localIndex < last) \n\t\t\t{\n\t\t\t\tif(itemIDs[localIndex] > itemIDs[localIndex + 1]) \n\t\t\t\t{\n\t\t\t\t\tsetSwapArrayElements(localIndex);\n\t\t\t\t\tswap = true;\n\t\t\t\t}\n\t\t\t\tlocalIndex++;\n\t\t\t}\n\n\t\t\tif(swap == false) \n\t\t\t{\n\t\t\t\tlast = RESET_VALUE;\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tlast = last + NOT_FOUND;\n\t\t\t}\n\n\t\t}//END while(last > RESET_VALUE)\n\t\treturn;\n\t}",
"private void trIntroSort(int r34, int r35, int r36, int r37, int r38, io.netty.handler.codec.compression.Bzip2DivSufSort.TRBudget r39, int r40) {\n /*\n r33 = this;\n r0 = r33;\n r0 = r0.SA;\n r16 = r0;\n r4 = 64;\n r0 = new io.netty.handler.codec.compression.Bzip2DivSufSort.StackEntry[r4];\n r29 = r0;\n r32 = 0;\n r27 = 0;\n r4 = r38 - r37;\n r22 = trLog(r4);\n r28 = r27;\n r23 = r22;\n L_0x001a:\n if (r23 >= 0) goto L_0x02b6;\n L_0x001c:\n r4 = -1;\n r0 = r23;\n if (r0 != r4) goto L_0x01a4;\n L_0x0021:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 != 0) goto L_0x0050;\n L_0x002d:\n r22 = r23;\n L_0x002f:\n r26 = 0;\n L_0x0031:\n r0 = r26;\n r1 = r28;\n if (r0 >= r1) goto L_0x072a;\n L_0x0037:\n r4 = r29[r26];\n r4 = r4.d;\n r5 = -3;\n if (r4 != r5) goto L_0x004d;\n L_0x003e:\n r4 = r29[r26];\n r4 = r4.b;\n r5 = r29[r26];\n r5 = r5.c;\n r0 = r33;\n r1 = r34;\n r0.lsUpdateGroup(r1, r4, r5);\n L_0x004d:\n r26 = r26 + 1;\n goto L_0x0031;\n L_0x0050:\n r6 = r35 + -1;\n r10 = r38 + -1;\n r4 = r33;\n r5 = r34;\n r7 = r36;\n r8 = r37;\n r9 = r38;\n r25 = r4.trPartition(r5, r6, r7, r8, r9, r10);\n r0 = r25;\n r8 = r0.first;\n r0 = r25;\n r9 = r0.last;\n r0 = r37;\n if (r0 < r8) goto L_0x0072;\n L_0x006e:\n r0 = r38;\n if (r9 >= r0) goto L_0x016d;\n L_0x0072:\n r0 = r38;\n if (r8 >= r0) goto L_0x0087;\n L_0x0076:\n r17 = r37;\n r31 = r8 + -1;\n L_0x007a:\n r0 = r17;\n if (r0 >= r8) goto L_0x0087;\n L_0x007e:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x007a;\n L_0x0087:\n r0 = r38;\n if (r9 >= r0) goto L_0x009c;\n L_0x008b:\n r17 = r8;\n r31 = r9 + -1;\n L_0x008f:\n r0 = r17;\n if (r0 >= r9) goto L_0x009c;\n L_0x0093:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x008f;\n L_0x009c:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = 0;\n r6 = 0;\n r4.<init>(r5, r8, r9, r6);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + -1;\n r6 = -2;\n r0 = r37;\n r1 = r38;\n r4.<init>(r5, r0, r1, r6);\n r29[r27] = r4;\n r4 = r8 - r37;\n r5 = r38 - r9;\n if (r4 > r5) goto L_0x0117;\n L_0x00bd:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x00e3;\n L_0x00c2:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r38 - r9;\n r5 = trLog(r5);\n r0 = r35;\n r1 = r38;\n r4.<init>(r0, r9, r1, r5);\n r29[r28] = r4;\n r38 = r8;\n r4 = r8 - r37;\n r22 = trLog(r4);\n L_0x00dd:\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x00e3:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x00f3;\n L_0x00e8:\n r37 = r9;\n r4 = r38 - r9;\n r22 = trLog(r4);\n r27 = r28;\n goto L_0x00dd;\n L_0x00f3:\n if (r28 != 0) goto L_0x00fa;\n L_0x00f5:\n r27 = r28;\n r22 = r23;\n L_0x00f9:\n return;\n L_0x00fa:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n goto L_0x00dd;\n L_0x0117:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x0138;\n L_0x011c:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r8 - r37;\n r5 = trLog(r5);\n r0 = r35;\n r1 = r37;\n r4.<init>(r0, r1, r8, r5);\n r29[r28] = r4;\n r37 = r9;\n r4 = r38 - r9;\n r22 = trLog(r4);\n goto L_0x00dd;\n L_0x0138:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x0148;\n L_0x013d:\n r38 = r8;\n r4 = r8 - r37;\n r22 = trLog(r4);\n r27 = r28;\n goto L_0x00dd;\n L_0x0148:\n if (r28 != 0) goto L_0x014f;\n L_0x014a:\n r27 = r28;\n r22 = r23;\n goto L_0x00f9;\n L_0x014f:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n goto L_0x00dd;\n L_0x016d:\n r17 = r37;\n L_0x016f:\n r0 = r17;\n r1 = r38;\n if (r0 >= r1) goto L_0x017e;\n L_0x0175:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r17;\n r17 = r17 + 1;\n goto L_0x016f;\n L_0x017e:\n if (r28 != 0) goto L_0x0186;\n L_0x0180:\n r27 = r28;\n r22 = r23;\n goto L_0x00f9;\n L_0x0186:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n goto L_0x00dd;\n L_0x01a4:\n r4 = -2;\n r0 = r23;\n if (r0 != r4) goto L_0x01ea;\n L_0x01a9:\n r27 = r28 + -1;\n r4 = r29[r27];\n r8 = r4.b;\n r4 = r29[r27];\n r9 = r4.c;\n r11 = r35 - r34;\n r4 = r33;\n r5 = r34;\n r6 = r36;\n r7 = r37;\n r10 = r38;\n r4.trCopy(r5, r6, r7, r8, r9, r10, r11);\n if (r27 != 0) goto L_0x01c8;\n L_0x01c4:\n r22 = r23;\n goto L_0x00f9;\n L_0x01c8:\n r27 = r27 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x01ea:\n r4 = r16[r37];\n if (r4 < 0) goto L_0x0202;\n L_0x01ee:\n r8 = r37;\n L_0x01f0:\n r4 = r16[r8];\n r4 = r4 + r34;\n r16[r4] = r8;\n r8 = r8 + 1;\n r0 = r38;\n if (r8 >= r0) goto L_0x0200;\n L_0x01fc:\n r4 = r16[r8];\n if (r4 >= 0) goto L_0x01f0;\n L_0x0200:\n r37 = r8;\n L_0x0202:\n r0 = r37;\n r1 = r38;\n if (r0 >= r1) goto L_0x028c;\n L_0x0208:\n r8 = r37;\n L_0x020a:\n r4 = r16[r8];\n r4 = r4 ^ -1;\n r16[r8] = r4;\n r8 = r8 + 1;\n r4 = r16[r8];\n if (r4 < 0) goto L_0x020a;\n L_0x0216:\n r4 = r16[r8];\n r4 = r4 + r34;\n r4 = r16[r4];\n r5 = r16[r8];\n r5 = r5 + r35;\n r5 = r16[r5];\n if (r4 == r5) goto L_0x0241;\n L_0x0224:\n r4 = r8 - r37;\n r4 = r4 + 1;\n r24 = trLog(r4);\n L_0x022c:\n r8 = r8 + 1;\n r0 = r38;\n if (r8 >= r0) goto L_0x0244;\n L_0x0232:\n r9 = r37;\n r31 = r8 + -1;\n L_0x0236:\n if (r9 >= r8) goto L_0x0244;\n L_0x0238:\n r4 = r16[r9];\n r4 = r4 + r34;\n r16[r4] = r31;\n r9 = r9 + 1;\n goto L_0x0236;\n L_0x0241:\n r24 = -1;\n goto L_0x022c;\n L_0x0244:\n r4 = r8 - r37;\n r5 = r38 - r8;\n if (r4 > r5) goto L_0x0264;\n L_0x024a:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = -3;\n r0 = r35;\n r1 = r38;\n r4.<init>(r0, r8, r1, r5);\n r29[r28] = r4;\n r35 = r35 + 1;\n r38 = r8;\n r22 = r24;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0264:\n r4 = 1;\n r5 = r38 - r8;\n if (r4 >= r5) goto L_0x0282;\n L_0x0269:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r37;\n r1 = r24;\n r4.<init>(r5, r0, r8, r1);\n r29[r28] = r4;\n r37 = r8;\n r22 = -3;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0282:\n r35 = r35 + 1;\n r38 = r8;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x028c:\n if (r28 != 0) goto L_0x0294;\n L_0x028e:\n r27 = r28;\n r22 = r23;\n goto L_0x00f9;\n L_0x0294:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x02b6:\n r4 = r38 - r37;\n r5 = 8;\n if (r4 > r5) goto L_0x02d5;\n L_0x02bc:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 != 0) goto L_0x02cc;\n L_0x02c8:\n r22 = r23;\n goto L_0x002f;\n L_0x02cc:\n r33.trInsertionSort(r34, r35, r36, r37, r38);\n r22 = -3;\n r23 = r22;\n goto L_0x001a;\n L_0x02d5:\n r22 = r23 + -1;\n if (r23 != 0) goto L_0x0331;\n L_0x02d9:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 == 0) goto L_0x002f;\n L_0x02e5:\n r15 = r38 - r37;\n r10 = r33;\n r11 = r34;\n r12 = r35;\n r13 = r36;\n r14 = r37;\n r10.trHeapSort(r11, r12, r13, r14, r15);\n r8 = r38 + -1;\n L_0x02f6:\n r0 = r37;\n if (r0 >= r8) goto L_0x032b;\n L_0x02fa:\n r4 = r16[r8];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r9 = r8 + -1;\n L_0x030a:\n r0 = r37;\n if (r0 > r9) goto L_0x0329;\n L_0x030e:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r4 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n if (r4 != r0) goto L_0x0329;\n L_0x0320:\n r4 = r16[r9];\n r4 = r4 ^ -1;\n r16[r9] = r4;\n r9 = r9 + -1;\n goto L_0x030a;\n L_0x0329:\n r8 = r9;\n goto L_0x02f6;\n L_0x032b:\n r22 = -3;\n r23 = r22;\n goto L_0x001a;\n L_0x0331:\n r8 = r33.trPivot(r34, r35, r36, r37, r38);\n r0 = r16;\n r1 = r37;\n r2 = r16;\n swapElements(r0, r1, r2, r8);\n r4 = r16[r37];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r31 = r0.trGetC(r1, r2, r3, r4);\n r9 = r37 + 1;\n L_0x034e:\n r0 = r38;\n if (r9 >= r0) goto L_0x0369;\n L_0x0352:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x0369;\n L_0x0366:\n r9 = r9 + 1;\n goto L_0x034e;\n L_0x0369:\n r8 = r9;\n r0 = r38;\n if (r9 >= r0) goto L_0x039e;\n L_0x036e:\n r0 = r32;\n r1 = r31;\n if (r0 >= r1) goto L_0x039e;\n L_0x0374:\n r9 = r9 + 1;\n r0 = r38;\n if (r9 >= r0) goto L_0x039e;\n L_0x037a:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 > r1) goto L_0x039e;\n L_0x038e:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x0374;\n L_0x0394:\n r0 = r16;\n r1 = r16;\n swapElements(r0, r9, r1, r8);\n r8 = r8 + 1;\n goto L_0x0374;\n L_0x039e:\n r17 = r38 + -1;\n L_0x03a0:\n r0 = r17;\n if (r9 >= r0) goto L_0x03bb;\n L_0x03a4:\n r4 = r16[r17];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x03bb;\n L_0x03b8:\n r17 = r17 + -1;\n goto L_0x03a0;\n L_0x03bb:\n r18 = r17;\n r0 = r17;\n if (r9 >= r0) goto L_0x03f5;\n L_0x03c1:\n r0 = r32;\n r1 = r31;\n if (r0 <= r1) goto L_0x03f5;\n L_0x03c7:\n r17 = r17 + -1;\n r0 = r17;\n if (r9 >= r0) goto L_0x03f5;\n L_0x03cd:\n r4 = r16[r17];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 < r1) goto L_0x03f5;\n L_0x03e1:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x03c7;\n L_0x03e7:\n r0 = r16;\n r1 = r17;\n r2 = r16;\n r3 = r18;\n swapElements(r0, r1, r2, r3);\n r18 = r18 + -1;\n goto L_0x03c7;\n L_0x03f5:\n r0 = r17;\n if (r9 >= r0) goto L_0x045a;\n L_0x03f9:\n r0 = r16;\n r1 = r16;\n r2 = r17;\n swapElements(r0, r9, r1, r2);\n L_0x0402:\n r9 = r9 + 1;\n r0 = r17;\n if (r9 >= r0) goto L_0x042c;\n L_0x0408:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 > r1) goto L_0x042c;\n L_0x041c:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x0402;\n L_0x0422:\n r0 = r16;\n r1 = r16;\n swapElements(r0, r9, r1, r8);\n r8 = r8 + 1;\n goto L_0x0402;\n L_0x042c:\n r17 = r17 + -1;\n r0 = r17;\n if (r9 >= r0) goto L_0x03f5;\n L_0x0432:\n r4 = r16[r17];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 < r1) goto L_0x03f5;\n L_0x0446:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x042c;\n L_0x044c:\n r0 = r16;\n r1 = r17;\n r2 = r16;\n r3 = r18;\n swapElements(r0, r1, r2, r3);\n r18 = r18 + -1;\n goto L_0x042c;\n L_0x045a:\n r0 = r18;\n if (r8 > r0) goto L_0x0716;\n L_0x045e:\n r17 = r9 + -1;\n r26 = r8 - r37;\n r30 = r9 - r8;\n r0 = r26;\n r1 = r30;\n if (r0 <= r1) goto L_0x046c;\n L_0x046a:\n r26 = r30;\n L_0x046c:\n r19 = r37;\n r21 = r9 - r26;\n L_0x0470:\n if (r26 <= 0) goto L_0x0484;\n L_0x0472:\n r0 = r16;\n r1 = r19;\n r2 = r16;\n r3 = r21;\n swapElements(r0, r1, r2, r3);\n r26 = r26 + -1;\n r19 = r19 + 1;\n r21 = r21 + 1;\n goto L_0x0470;\n L_0x0484:\n r26 = r18 - r17;\n r4 = r38 - r18;\n r30 = r4 + -1;\n r0 = r26;\n r1 = r30;\n if (r0 <= r1) goto L_0x0492;\n L_0x0490:\n r26 = r30;\n L_0x0492:\n r19 = r9;\n r21 = r38 - r26;\n L_0x0496:\n if (r26 <= 0) goto L_0x04aa;\n L_0x0498:\n r0 = r16;\n r1 = r19;\n r2 = r16;\n r3 = r21;\n swapElements(r0, r1, r2, r3);\n r26 = r26 + -1;\n r19 = r19 + 1;\n r21 = r21 + 1;\n goto L_0x0496;\n L_0x04aa:\n r4 = r9 - r8;\n r8 = r37 + r4;\n r4 = r18 - r17;\n r9 = r38 - r4;\n r4 = r16[r8];\n r4 = r4 + r34;\n r4 = r16[r4];\n r0 = r31;\n if (r4 == r0) goto L_0x04d3;\n L_0x04bc:\n r4 = r9 - r8;\n r24 = trLog(r4);\n L_0x04c2:\n r17 = r37;\n r31 = r8 + -1;\n L_0x04c6:\n r0 = r17;\n if (r0 >= r8) goto L_0x04d6;\n L_0x04ca:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x04c6;\n L_0x04d3:\n r24 = -1;\n goto L_0x04c2;\n L_0x04d6:\n r0 = r38;\n if (r9 >= r0) goto L_0x04eb;\n L_0x04da:\n r17 = r8;\n r31 = r9 + -1;\n L_0x04de:\n r0 = r17;\n if (r0 >= r9) goto L_0x04eb;\n L_0x04e2:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x04de;\n L_0x04eb:\n r4 = r8 - r37;\n r5 = r38 - r9;\n if (r4 > r5) goto L_0x060c;\n L_0x04f1:\n r4 = r38 - r9;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x0571;\n L_0x04f7:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x051e;\n L_0x04fc:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r27] = r4;\n r38 = r8;\n r23 = r22;\n goto L_0x001a;\n L_0x051e:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x0538;\n L_0x0523:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r37 = r9;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0538:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x0549;\n L_0x053d:\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x0549:\n if (r28 != 0) goto L_0x054f;\n L_0x054b:\n r27 = r28;\n goto L_0x00f9;\n L_0x054f:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0571:\n r4 = r8 - r37;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x05c6;\n L_0x0577:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x059e;\n L_0x057c:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r27] = r4;\n r38 = r8;\n r23 = r22;\n goto L_0x001a;\n L_0x059e:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x05c0;\n L_0x05a3:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x05c0:\n r37 = r9;\n r23 = r22;\n goto L_0x001a;\n L_0x05c6:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x05f5;\n L_0x05cb:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r27] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x05f5:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r38 = r8;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x060c:\n r4 = r8 - r37;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x067b;\n L_0x0612:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x0639;\n L_0x0617:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r27] = r4;\n r37 = r9;\n r23 = r22;\n goto L_0x001a;\n L_0x0639:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x0653;\n L_0x063e:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r38 = r8;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0653:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x0664;\n L_0x0658:\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x0664:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r38;\n r3 = r22;\n r4.<init>(r0, r1, r2, r3);\n r29[r28] = r4;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x067b:\n r4 = r38 - r9;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x06d0;\n L_0x0681:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x06a8;\n L_0x0686:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r27] = r4;\n r37 = r9;\n r23 = r22;\n goto L_0x001a;\n L_0x06a8:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x06ca;\n L_0x06ad:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x06ca:\n r38 = r8;\n r23 = r22;\n goto L_0x001a;\n L_0x06d0:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x06ff;\n L_0x06d5:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r27] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x06ff:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r37 = r9;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0716:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 == 0) goto L_0x002f;\n L_0x0722:\n r22 = r22 + 1;\n r35 = r35 + 1;\n r23 = r22;\n goto L_0x001a;\n L_0x072a:\n r27 = r28;\n goto L_0x00f9;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: io.netty.handler.codec.compression.Bzip2DivSufSort.trIntroSort(int, int, int, int, int, io.netty.handler.codec.compression.Bzip2DivSufSort$TRBudget, int):void\");\n }",
"public void sort()\n\t{\n\t\tfor(int i=0;i<bowlers.size()-1;i++)\n\t\t{\n\t\t\tfor(int j=i+1;j<bowlers.size();j++)\n\t\t\t{\n\t\t\t\tif(bowlers.get(i).getBall()<bowlers.get(j).getBall())\n\t\t\t\t{\n\t\t\t\t\tBowler bowler=bowlers.get(i);\n\t\t\t\t\tbowlers.set(i,bowlers.get(j));\n\t\t\t\t\tbowlers.set(j,bowler);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<bowlers.size();i++)\n\t\t{\n\t\tSystem.out.println(bowlers.get(i).getBall());\n\t\t}\n\t}",
"@Override\r\n\tpublic void editSort() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void addSort() {\n\t\t\r\n\t}",
"@Override\n protected void runAlgorithm() {\n for (int i = 0; i < getArray().length; i++) {\n for (int j = i + 1; j < getArray().length; j++) {\n if (applySortingOperator(getValue(j), getValue(i))) {\n swap(i, j);\n }\n }\n }\n }",
"@Override\n\tvoid sort(int[] array, SortingVisualizer display) {\n\t\tSystem.out.println(\"a\");\n\t\tboolean sorted = false;\n\t\tboolean h = true;\n\t\twhile (sorted == false) {\nh=true;\n\t\t\t// System.out.println(\"1\");\n\t\t\tRandom x = new Random();\n\t\t\tint y = x.nextInt(array.length);\n\n\t\t\tint el1 = array[y];\n\t\t\tint z = x.nextInt(array.length);\n\t\t\tint el2 = array[z];\n\n\t\t\tarray[y] = el2;\n\t\t\tarray[z] = el1;\n\t\t\tfor (int i = 0; i < array.length - 1; i++) {\n/*\n\t\t\t\tif (array[i] < array[i + 1]) {\n\n\t\t\t\t\th = true;\n\n\t\t\t\t}*/\n\n\t\t\t\tif (array[i] > array[i + 1]) {\n\t\t\t\t\th = false;\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (h == true) {\n\n\t\t\t\tsorted = true;\n\t\t\t}\n\n\t\t\tdisplay.updateDisplay();\n\t\t\t\n\t\t}\n\t}",
"public List<SimulinkBlock> generateBlockOrder(UnmodifiableCollection<SimulinkBlock> unmodifiableCollection,\n\t\t\tSet<SimulinkBlock> unsortedBlocks) {\n\t\tSet<SimulinkBlock> unsorted = new HashSet<SimulinkBlock>();\n\t\tSet<SimulinkBlock> unsortedRev = new HashSet<SimulinkBlock>();\n\t\tList<SimulinkBlock> sorted = new LinkedList<SimulinkBlock>();\n\n\t\t// start with source blocks without input\n\t\tfor (SimulinkBlock block : unmodifiableCollection) {\n\t\t\tif (block.getInPorts().isEmpty()) {\n\t\t\t\tsorted.add(block);\n\t\t\t} else {\n\t\t\t\tunsorted.add(block);\n\t\t\t}\n\t\t}\n\n\t\tint sizeBefore = 0;\n\t\tint sizeAfter = 0;\n\t\tdo {\n\t\t\tsizeBefore = unsorted.size();\n\t\t\tfor (SimulinkBlock myBlock : unsorted) {\n\t\t\t\tunsortedRev.add(myBlock);\n\t\t\t}\n\t\t\tunsorted.clear();\n\t\t\tfor (SimulinkBlock block : unsortedRev) {\n\t\t\t\tboolean allPredeccesorsAvailable = specialBlockChecking(block, sorted);\n\t\t\t\tif (allPredeccesorsAvailable) {\n\t\t\t\t\tsorted.add(block);\n\t\t\t\t} else {\n\t\t\t\t\tunsorted.add(block);\n\t\t\t\t}\n\t\t\t}\n\t\t\tsizeAfter = unsorted.size();\n\t\t\tunsortedRev.clear();\n\t\t} while ((!(unsorted.isEmpty())) && (!(sizeBefore == sizeAfter)));\n\n\t\tfor (SimulinkBlock block : unsorted) {\n\t\t\t// TODO sort the last unsorted blocks\n\t\t\tPluginLogger\n\t\t\t\t\t.info(\"Currently unsorted after sorting : \" + block.getName() + \" of type \" + block.getType());\n\t\t\tsorted.add(block);\n\t\t\tunsortedBlocks.add(block);\n\t\t}\n\t\treturn sorted;\n\t}",
"@Test\n public void doubleSortWithExchangeUnbalancedNodes() {\n ExternalSort es1 = new ExternalSort(OpProps.prototype(0, Long.MAX_VALUE).cloneWithMemoryExpensive(true).cloneWithMemoryFactor(options.getOption(SORT_FACTOR)).cloneWithBound(options.getOption(SORT_BOUNDED)), ARBTRIARY_LEAF, Collections.emptyList(), false);\n SingleSender ss = new SingleSender(OpProps.prototype(1, Long.MAX_VALUE).cloneWithMemoryFactor(options.getOption(SORT_FACTOR)).cloneWithBound(options.getOption(SORT_BOUNDED)), Mockito.mock(BatchSchema.class), es1, 0,\n MinorFragmentIndexEndpoint.newBuilder().setMinorFragmentId(0).build());\n Fragment f1 = new Fragment();\n f1.addOperator(ss);\n Wrapper w1 = new Wrapper(f1, 0);\n w1.overrideEndpoints(Arrays.asList(N1, N2));\n\n UnorderedReceiver or = new UnorderedReceiver(OpProps.prototype(1, Long.MAX_VALUE), Mockito.mock(BatchSchema.class), 0, Collections.emptyList(), false);\n ExternalSort es2 = new ExternalSort(OpProps.prototype(0, Long.MAX_VALUE).cloneWithMemoryExpensive(true).cloneWithMemoryFactor(options.getOption(SORT_FACTOR)).cloneWithBound(options.getOption(SORT_BOUNDED)), or, Collections.emptyList(), false);\n Fragment f2 = new Fragment();\n f2.addOperator(es2);\n Wrapper w2 = new Wrapper(f2, 0);\n w2.overrideEndpoints(Collections.singletonList(N1));\n\n\n MemoryAllocationUtilities.setMemory(options, ImmutableMap.of(f1, w1, f2, w2), 10 + adjustReserve);\n assertEquals(3L, es1.getProps().getMemLimit());\n assertEquals(3L, es2.getProps().getMemLimit());\n }",
"@Override\n\t\tpublic void run() {\n\t\t\tfor (int i = 0; i < 1000000; i++) {\n\t\t\t\tint[] a = Util.generateRandomArray(500, 200000);\n\t\t\t\tint[] b = a.clone();\n\t\t\t\t\n\t\t\t\ta = sort(a);\n\t\t\t\tArrays.sort(b);\n\t\t\t\t\n\t\t\t\tfor (int j = 0; j < b.length; j++) {\n\t\t\t\t\tUtil.Assert(a[j] == b[j], \"shit\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Heap sort ok\");\n\t\t}",
"private Sort() { }",
"public void sort() {\n\t\tSystem.out.println(\"Quick Sort Algorithm invoked\");\n\n\t}",
"@Override\n public void sortCurrentList(FileSortHelper sort) {\n }",
"public String doSort();",
"public void sortArray() {\n\t\tSystem.out.println(\"QUICK SORT\");\n\t}",
"@Override\n public void sort() throws IOException {\n long i = 0;\n // j represents the turn of writing the numbers either to g1 or g2 (or viceversa)\n long j = 0;\n long runSize = (long) Math.pow(2, i);\n long size;\n\n long startTime = System.currentTimeMillis();\n\n System.out.println(\"Strart sorting \"+ this.inputFileName);\n\n while(i <= Math.ceil(Math.log(this.n) / Math.log(2))){\n j = 0;\n do{\n size = merge(runSize, destinationFiles[(int)j % 2]);\n j += 1;\n }while (size/2 == runSize);\n\n System.out.println(\"iteration: \" + i + \", Run Size:\" + runSize + \", Total time elapsed: \" + (System.currentTimeMillis() - startTime));\n i += 1;\n runSize = (long) Math.pow(2, i);\n swipe();\n }\n System.out.println(\"The file has been sorted! Total time elapsed: \"+(System.currentTimeMillis() - startTime));\n\n destinationFiles[0].close();\n destinationFiles[1].close();\n originFiles[0].close();\n originFiles[1].close();\n\n createFile(OUT_PATH +inputFileName);\n copyFile(new File(originFileNames[0]), new File(\"out/TwoWayMergesort/OUT_\"+inputFileName));\n\n }",
"private void updateOrder() {\n Arrays.sort(positions);\n }",
"@Override\n public void sort() {\n for (int i = 0; i < size; i++) {\n for (int j = i + 1; j < size; j++) {\n if (((Comparable) data[i]).compareTo(data[j]) > 0) {\n E c = data[i];\n data[i] = data[j];\n data[j] = c;\n\n }\n }\n }\n }",
"void order() {\n for (int i = 0; i < numVertices; i++) {\n if (simp[i][numParams] < simp[best][numParams]) {\n best = i;\n }\n if (simp[i][numParams] > simp[worst][numParams]) {\n worst = i;\n }\n }\n nextWorst = best;\n for (int i = 0; i < numVertices; i++) {\n if (i != worst) {\n if (simp[i][numParams] > simp[nextWorst][numParams]) {\n nextWorst = i;\n }\n }\n }\n }",
"public void shellSort(int[] a) \n {\n int increment = a.length / 2;\n while (increment > 0) \n {\n \n for (int i = increment; i < a.length; i++) //looping over the array\n {\n int j = i;\n int temp = a[i]; // swapping the values to a temporary array\n try\n {\n if(!orderPanel) // checking for Descending order\n {\n while (j >= increment && a[j - increment] > temp) \n {\n a[j] = a[j - increment]; //swapping the values\n thread.sleep(100);\n repaint();\n this.setThreadState();\n j = j - increment;\n }\n }\n \n else\n {\n while (j >= increment && a[j - increment] < temp) //checking for Ascending order\n {\n a[j] = a[j - increment];\n thread.sleep(200);\n repaint();\n this.setThreadState();\n j = j - increment;\n }\n \n }\n }\n catch(Exception e)\n {\n System.out.println(\"Exception occured\" + e);\n }\n a[j] = temp;\n }\n \n if (increment == 2) \n {\n increment = 1;\n } \n else \n {\n increment *= (5.0 / 11);\n }\n }\n }",
"void sort();",
"void sort();",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e)\n\t\t\t{\n\t\t\t\tif (currentSize >= size)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"MERGESORT END\");\n\t\t\t\t\ttimer.stop();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// deciding the block to to merged\n\t\t\t\telse if (mergeSortCodeFlag == 1)\n\t\t\t\t{\n\t\t\t\t\tif (leftStart >= size - 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tcurrentSize = currentSize * 2;\n\t\t\t\t\t\tleftStart = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tmid = leftStart + currentSize - 1;\n\t\t\t\t\t\tif (leftStart + 2 * currentSize - 1 >= size - 1)\n\t\t\t\t\t\t\trightEnd = size - 1;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\trightEnd = leftStart + 2 * currentSize - 1;\n\t\t\t\t\t\tbox.setBaseColor(BASE_COLOR);\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tmergeSortDelayFlag1 = 1;\n\t\t\t\t\t\tmergeSortdelay1 = 0;\n\t\t\t\t\t\tmergeSortCodeFlag = 0;\n\t\t\t\t\t\tif(mid >= rightEnd)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tleftStart += 2 * currentSize;\n\t\t\t\t\t\t\tmergeSortDelayFlag1 = 0;\n\t\t\t\t\t\t\tmergeSortCodeFlag = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (mergeSortDelayFlag1 == 1)\n\t\t\t\t{\n\t\t\t\t\tmergeSortdelay1++;\n\t\t\t\t\tif (mergeSortdelay1 >= DELAY)\n\t\t\t\t\t{\n\t\t\t\t\t\tl = leftStart;\n\t\t\t\t\t\tm = mid;\n\t\t\t\t\t\tr = rightEnd;\n\t\t\t\t\t\tmergeSortDelayFlag1 = 0;\n\t\t\t\t\t\tmergeInitializeFlag = 1;\n\t\t\t\t\t\tleftStart += 2 * currentSize;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Merging the block selected\n\t\t\t\t\n\t\t\t\t// initializing the variables needed by the merge block \n\t\t\t\telse if (mergeInitializeFlag == 1)\n\t\t\t\t{\n\t\t\t\t\ti = l;\n\t\t\t\t\tj = m + 1;\n\t\t\t\t\tindex = 0;\n\t\t\t\t\tcurrentDownCount = 0;\n\t\t\t\t\tindexRightCount = 0;\n\t\t\t\t\tcurrentLeftCount = 0;\n\t\t\t\t\tcurrentUpCount = 0;\n\t\t\t\t\tcodeFlag = 1;\n\t\t\t\t\trightFlag = 0;\n\t\t\t\t\trightBlockFlag = 0;\n\t\t\t\t\tdownFlag = 0;\n\t\t\t\t\tupFlag = 0;\n\t\t\t\t\tleftFlag = 0;\n\t\t\t\t\tdelay1 = 0;\n\t\t\t\t\tdelayFlag1 = 0;\n\t\t\t\t\tdelay2 = 0;\n\t\t\t\t\tdelayFlag2 = 0;\n\t\t\t\t\tcolorFlag1 = 1;\n\t\t\t\t\tcolorDelayFlag1 = 0;\n\t\t\t\t\tcolorDelay1 = 0;\n\t\t\t\t\tcolorFlag2 = 1;\n\t\t\t\t\tcolorDelayFlag2 = 0;\n\t\t\t\t\tcolorDelay2 = 0;\n\t\t\t\t\tbox.setBaseColor(BASE_COLOR);\n\t\t\t\t\tbox.setColorRange(l, m, BLOCK_COLOR1);\n\t\t\t\t\tbox.setColorRange(m + 1, r, BLOCK_COLOR2);\n\t\t\t\t\tpaintBox();\n\t\t\t\t\t\n\t\t\t\t\tmergeFlag = 1;\n\t\t\t\t\tmergeInitializeFlag = 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// actual merging starts here\n\t\t\t\telse if (mergeFlag == 1)\n\t\t\t\t{\n\t\t\t\t\t// step zero check whether to continue merging or not\n\t\t\t\t\tif (j > r)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (i >= j)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmergeFlag = 0;\n\t\t\t\t\t\t\tmergeSortCodeFlag = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (colorFlag1 == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbox.getRectangle(i).setColor(END_COLOR);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\tcolorDelay1 = 0;\n\t\t\t\t\t\t\tcolorDelayFlag1 = 1;\n\t\t\t\t\t\t\tcolorFlag1 = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (colorDelayFlag1 == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcolorDelay1++;\n\t\t\t\t\t\t\tif (colorDelay1 >= DELAY)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\tcolorDelayFlag1 = 0;\n\t\t\t\t\t\t\t\tcolorFlag1 = 1;\n\t\t\t\t\t\t\t\tcolorDelay1 = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse if (i >= j)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (j > r)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmergeFlag = 0;\n\t\t\t\t\t\t\tmergeSortCodeFlag = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (colorFlag2 == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbox.getRectangle(j).setColor(END_COLOR);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\tcolorDelay2 = 0;\n\t\t\t\t\t\t\tcolorDelayFlag2 = 1;\n\t\t\t\t\t\t\tcolorFlag2 = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (colorDelayFlag2 == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcolorDelay2++;\n\t\t\t\t\t\t\tif (colorDelay2 >= DELAY)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t\t\tcolorDelayFlag2 = 0;\n\t\t\t\t\t\t\t\tcolorFlag2 = 1;\n\t\t\t\t\t\t\t\tcolorDelay2 = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Step one Check whether a[i] <= a[j]\n\t\t\t\t\telse if (codeFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tRectangle currRect = box.getRectangle(i);\n\t\t\t\t\t\tRectangle scanRect = box.getRectangle(j);\n\t\t\t\t\t\tcurrRect.setColor(FOCUS_COLOR1);\n\t\t\t\t\t\tscanRect.setColor(FOCUS_COLOR2);\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tdelayFlag2 = 1;\n\t\t\t\t\t\tcodeFlag = 0;\n\t\t\t\t\t\tdelay2 = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse if (delayFlag2 == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tdelay2++;\n\t\t\t\t\t\tif (delay2 >= DELAY)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tRectangle currRect = box.getRectangle(i);\n\t\t\t\t\t\t\tRectangle scanRect = box.getRectangle(j);\n\t\t\t\t\t\t\tif (currRect.getData() < scanRect.getData())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbox.getRectangle(i).setColor(END_COLOR);\n\t\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\t\tdelay1 = 0;\n\t\t\t\t\t\t\t\tdelayFlag2 = 0;\n\t\t\t\t\t\t\t\tdelayFlag1 = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbox.getRectangle(j).setColor(END_COLOR);\n\t\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\t\tdelayFlag2 = 0;\n\t\t\t\t\t\t\t\tdownFlag = 1;\n\t\t\t\t\t\t\t\tcurrentDownCount = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (delayFlag1 == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tdelay1++;\n\t\t\t\t\t\tif (delay1 >= DELAY)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcodeFlag = 1;\n\t\t\t\t\t\t\tdelayFlag1 = 0;\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Moving the first rectangle on right down (if it was smaller than the first one on the left)\n\t\t\t\t\telse if (downFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.addOffsetRectangle(j, 0, YCHANGE);\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tcurrentDownCount += YCHANGE;\n\t\t\t\t\t\tif (currentDownCount >= DOWN)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint excess = currentDownCount - DOWN;\n\t\t\t\t\t\t\tbox.addOffsetRectangle(j, 0, -excess);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\tdownFlag = 0;\n\t\t\t\t\t\t\trightBlockFlag = 1;\n\t\t\t\t\t\t\tindexRightCount = 0;\n\t\t\t\t\t\t\tindex = j - 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// moving each of the rectangles in the block to the right(between the two smallest rectangle on both side)\n\t\t\t\t\t// including the first rectangle\n\t\t\t\t\telse if (rightBlockFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (index < i)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trightBlockFlag = 0;\n\t\t\t\t\t\t\tleftFlag = 1;\n\t\t\t\t\t\t\tcurrentLeftCount = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trightFlag = 1;\n\t\t\t\t\t\t\trightBlockFlag = 0;\n\t\t\t\t\t\t\tindexRightCount = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// moving a rectangle in the block to the right\n\t\t\t\t\telse if (rightFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.addOffsetRectangle(index, XCHANGE, 0);\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tindexRightCount += XCHANGE;\n\t\t\t\t\t\tif (indexRightCount >= width)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint excess = indexRightCount - width;\n\t\t\t\t\t\t\tbox.addOffsetRectangle(index, -excess, 0);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\trightFlag = 0;\n\t\t\t\t\t\t\trightBlockFlag = 1;\n\t\t\t\t\t\t\tindex--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// moving the rectangle left (the smallest in the un-merged block)\n\t\t\t\t\telse if (leftFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.addOffsetRectangle(j, -XCHANGE, 0);\n\t\t\t\t\t\tcurrentLeftCount += XCHANGE;\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tif (currentLeftCount >= width * (j - i))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint excess = currentLeftCount - width * (j - i);\n\t\t\t\t\t\t\tbox.addOffsetRectangle(j, excess, 0);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tleftFlag = 0;\n\t\t\t\t\t\t\tupFlag = 1;\n\t\t\t\t\t\t\tcurrentUpCount = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// moving the rectangle up (the smallest in the un-merged block)\n\t\t\t\t\telse if (upFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.addOffsetRectangle(j, 0, -YCHANGE);\n\t\t\t\t\t\tcurrentUpCount += YCHANGE;\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tif (currentUpCount >= DOWN)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint excess = currentUpCount - DOWN;\n\t\t\t\t\t\t\tbox.addOffsetRectangle(j, 0, excess);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tRectangle smallestRect = box.getRectangle(j);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (int t = j - 1; t >= i; t--)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbox.setRectangle(box.getRectangle(t), t + 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbox.setRectangle(smallestRect, i);\n\t\t\t\t\t\t\tupFlag = 0;\n\t\t\t\t\t\t\tcodeFlag = 1;\n\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"private void externalSort() throws IOException{\n\t\t/*\n\t\t * Pass 0: internal sort\n\t\t */\n\t\t// Read in from child;Write out runs of B pages;\n\t\t\n\t\tint numPerRun = B * 4096 / (schema.size() * 4); // # of tuples per run given in Pass0\n\t\tboolean buildMore;\n\t\tint numRuns = 0;\n\t\tif(sortAttrsIndex == null) {\n\t\t\tthis.buildAttrsIndex();\n\t\t}\n\t\texComparator myComp = new exComparator();\n\t\tinternal = new PriorityQueue<Tuple>(myComp);\n\t\tdo {\n\t\t\tbuildMore = this.buildHeap(numPerRun);\n\t\t\tnumRuns++;\n\t\t\t\n\t\t\t// write out the (numRuns)th run\n\t\t\tTupleWriter TW;\n\t\t\tif(!buildMore && numRuns == 1) {\n\t\t\t\tTW = new TupleWriter(new FileOutputStream(tempsubdir + \"sortResult\"));\n\t\t\t} else {\n\t\t\t\tTW = new TupleWriter(new FileOutputStream(tempsubdir + \"0_\" + numRuns));\n\t\t\t}\n\t\t\twhile(!internal.isEmpty()) {\n//\t\t\t\tSystem.out.println(internal.peek().data);\n\t\t\t\tTW.setNextTuple(internal.poll()); \n\t\t\t}\n\t\t\t// leftover, fill with zero and write out\n\t\t\tif(!TW.bufferEmpty()) { // TW would never know the end of writing\n\t\t\t\tTW.fillFlush(); \n\t\t\t}\n\t\t\tTW.close();\n\t\t\t// internal must be empty until this point\n\t\t}while (buildMore);\n\t\t\n\t\t/*\n\t\t * Pass 1 and any following\n\t\t */\n\t\tif(numRuns > 1) { // if numRuns generated in Pass 0 is 1 already, file sorted already, no need to merge\n\t\t\tthis.merge(numRuns, myComp);\n\t\t}\n\t\t\n\t}",
"public void sortByLength()\n {\n boolean swapMade;//has a swap been made in the most recent pass?\n \n //repeat looking for swaps\n do\n {\n swapMade=false;//just starting this pass, so no swap yet\n \n //go through entire array. looking for swaps that need to be done\n for(int i = 0; i<currentRide-1; i++)\n {\n //if the other RideLines has less people\n if(rides[i].getCurrentPeople()<rides[i+1].getCurrentPeople())\n {\n // standard swap, using a temporary. swap with less people\n RideLines temp = rides[i];\n rides[i]=rides[i+1];\n rides[i+1]=temp;\n \n swapMade=true;//remember this pass made at least one swap\n }\n \n } \n }while(swapMade);//until no swaps were found in the most recent past\n \n redrawLines();//redraw the image\n \n }",
"private void sortByAmount(){\n int stopPos = 0;\n while(colours.size()-stopPos > 0){\n int inARow = 1;\n for(int i = colours.size() - 1; i > stopPos; i--){\n if(colours.get(i-1).getAmount() < colours.get(i).getAmount()){\n rgb temp = new rgb(colours.get(i-1));\n colours.set(i-1, colours.get(i));\n colours.set(i, temp);\n }else{\n inARow++;\n }\n }\n stopPos++;\n if(inARow == colours.size()){\n break;\n }\n }\n }",
"public static void specialSets() {\n\t\tSystem.out.printf(\"%12s%15s%15s%10s%10s%10s%10s%n\",\"Size\",\"Range\",\"Pre-Sort Type\",\"Insertion\",\"Selectuon\",\"Quick\",\"Merge\");\n\t\tint[] array;\n\t\t//200K\n\t\tSystem.out.printf(\"%12d%15s%15s\",200000,\"1-200k\",\"N/A\");\n\t\tarray = generateArray(200000, 1, 200000);\n\t\tfourSorts(array);\n\t\tSystem.out.println();\n\t\t//Sorted array\n\t\tSystem.out.printf(\"%12d%15s%15s\",200000,\"1-200k\",\"Sorted\");\n\t\tfourSorts(array);\n\t\tSystem.out.println();\n\t\t//Reverse Sorted\n\t\tSystem.out.printf(\"%12d%15s%15s\",200000,\"1-200k\",\"Reverse Sorted\");\n\t\tint[] temp = new int[array.length];\n\t\tfor(int i = 0; i < array.length; i++) {\n\t\t\ttemp[i] = array[array.length -1 -i];\n\t\t}\n\t\tfourSorts(temp);\n\t\tSystem.out.println();\n\t\t//Range 1-20\n\t\tSystem.out.printf(\"%12d%15s%15s\",200000,\"1-20\",\"N/A\");\n\t\tarray = generateArray(200000, 1, 20);\n\t\tfourSorts(array);\n\t\tSystem.out.println();\n\t}",
"public void selectionSort()\r\n {\r\n for(int x = 0; x < numItems; x++)\r\n {\r\n int smallestLoc = x;\r\n for(int y = x+1; y<numItems; y++)\r\n {\r\n if(mArray[y]< mArray[smallestLoc])\r\n {\r\n smallestLoc = y;\r\n }\r\n }\r\n int temp = mArray[x];\r\n mArray[x] = mArray[smallestLoc];\r\n mArray[smallestLoc] = temp;\r\n }\r\n }",
"public void sortCompetitors(){\n\t\t}",
"public void sortPassing(){\n\t\tpassing.sort(PlayingCard.PlayingCardComparator_ACEHIGH);\n\t}",
"@Override\n\tvoid sort(int[] arr, SortingVisualizer display) {\n\t\tint current = 0;\n\t\tint x;\n\t\tint y;\n\t\tboolean complete = false;\n\t\twhile(complete == false) {\n\t\t\tcurrent = 0;\n\t\t\tcomplete = true;\n\t\t\tfor(int i = 0 ; i < arr.length; i ++) {\n\t\t\t\tdisplay.updateDisplay();\n\t\t\t\tif(arr[current] > arr[i]) {\n\t\t\t\t\tx = arr[i];\n\t\t\t\t\ty = arr[current];\n\t\t\t\t\tarr[i] = y;\n\t\t\t\t\tarr[current] = x;\n\t\t\t\t\tcomplete = false;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\tcurrent = i;\n\t\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public BucketSort()\n {\n for(int i = 0; i < 30; i++)\n {\n a[i] = generator.nextInt(50)+1;\n b[i] = a[i];\n }\n }",
"@Override\n\tpublic void setSortCounters(boolean sortCounters) {\n\t\t\n\t}",
"public void sort() {\n /*int jokers = this.getJokers();\n\t\tif (jokers > 0 && this.size() > 2) {\n\t\t\tArrayList<Tile> list = new ArrayList<>();\n for (int i=0; i<this.size(); i++) {\n\t\t\t\tif (this.get(i).getColour() == 'J') {\n\t\t\t\t\tTile joker = this.remove(this.get(i));\n\t\t\t\t\tlist.add(joker);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (Tile j : list) {\n\t\t\t\tthis.addInSort(j);\n\t\t\t}\n }*/\n \n\n //may need something in here to accomodate a joker changing its form\n\n if (tiles.size() > 1) { //will only sort a meld with any tiles in it\n //Override default comparator to compare by tile value (ints)\n Collections.sort(tiles, new Comparator<Tile>() {\n @Override \n public int compare(Tile t1, Tile t2) { \n if (t1.getColour() > t2.getColour()) {\n return 1;\n } else if (t1.getColour() < t2.getColour()) {\n return -1;\n }\n if (t1.getValue() > t2.getValue()) {\n return 1;\n } else if (t1.getValue() < t2.getValue()) {\n return -1;\n } else {\n return 0;\n }\n }\n });\n }\n\n }",
"public void sort() {\n\n // Fill in the blank here.\n\tfor(int i = 0; i < size; i++){\n\t\tint currentLowest, cLIndex, temp;\n\t\tcurrentLowest = elements[i];\n\t\tcLIndex = i; \n\t\tfor(int c = i+1; c < size; c++){\n\t\t\tif(currentLowest > elements[c]){\n\t\t\t\tcurrentLowest = elements[c];\n\t\t\t\tcLIndex = c;\n\t\t\t} \n\t\t}\n\t\ttemp = elements[i];\n\t\telements[i] = elements[cLIndex];\n\t\telements[cLIndex] = temp;\n\t\t\n\t}\n System.out.println(\"Sorting...\");\n }",
"private void setup() {\r\n final int gsz = _g.getNumNodes();\r\n if (_k==2) {\r\n\t\t\tNodeComparator2 comp = new NodeComparator2();\r\n\t\t\t_origNodesq = new TreeSet(comp);\r\n\t\t} else { // _k==1\r\n\t\t\tNodeComparator4 comp = new NodeComparator4();\r\n\t\t\t_origNodesq = new TreeSet(comp);\r\n\t\t}\r\n for (int i=0; i<gsz; i++) {\r\n _origNodesq.add(_g.getNodeUnsynchronized(i)); // used to be _g.getNode(i)\r\n }\r\n _nodesq = new TreeSet(_origNodesq);\r\n //System.err.println(\"done sorting\");\r\n }",
"public void changeSortOrder();",
"private void sortEntities(){\n for (int i = 1; i < sorted.size; i++) {\n for(int j = i ; j > 0 ; j--){\n \tEntity e1 = sorted.get(j);\n \tEntity e2 = sorted.get(j-1);\n if(getRL(e1) < getRL(e2)){\n sorted.set(j, e2);\n sorted.set(j-1, e1);\n }\n }\n }\n }",
"private static void selectionSort(ArrayList<Box> BoxArray) { \n\n\t\tfor ( int i = 0; i < BoxArray.size(); i++ ) { \n\t\t\tint lowPos = i; \n\t\t\tfor ( int j = i + 1; j < BoxArray.size(); j++ ) \n\t\t\t\tif ( BoxArray.get(j).volume() < BoxArray.get(lowPos).volume() ) \n\t\t\t\t\tlowPos = j;\n\t\t\tif ( BoxArray.get(lowPos) != BoxArray.get(i) ) { \n\t\t\t\tBox temp = BoxArray.get(lowPos);\n\t\t\t\tBoxArray.set(lowPos, BoxArray.get(i));\n\t\t\t\tBoxArray.set(i, temp);\n\t\t\t}\n\t\t}\n\t}",
"public void sort() {\n\t\t\tfor (int j = nowLength - 1; j > 1; j--) {\n\t\t\t\tfor (int i = 0; i < j; i++) {\n\t\t\t\t\tif (ray[i] > ray[i+1]) {\n\t\t\t\t\t\tint tmp = ray [i];\n\t\t\t\t\t\tray[i] = ray[i+1];\n\t\t\t\t\t\tray[i+1] = tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tprint();\n\t\t\t}\n\t}",
"public BubSortList() {\n\t\tray = new int[MAXSIZE];\n\t\tnowLength = 0;\n\t}",
"public static void s1AscendingTest() {\n int key = 903836722;\n SortingLab<Integer> sli = new SortingLab<Integer>(key);\n int M = 600000;\n int N = 1000;\n double start;\n double elapsedTime;\n System.out.print(\"Sort 1 Ascending\\n\");\n for (; N < M; N *= 2) {\n Integer[] ai = getRandomArray(N, Integer.MAX_VALUE);\n Arrays.sort(ai);\n start = System.nanoTime();\n sli.sort1(ai);\n elapsedTime = (System.nanoTime() - start) / 1_000_000_000d;\n System.out.print(N + \"\\t\");\n System.out.printf(\"%4.3f\\n\", elapsedTime);\n }\n }",
"public void sortByDefault() {\r\n\t\tcomparator = null;\r\n\t}",
"public static int[] partialSort(int[] a) {\n for (int i = 0; i < 2; i++) {\n for (int j = 0; j < 2 - i; j++) {\n if (a[j] > a[j+1]) {\n int temp = a[j+1];\n a[j+1] = a[j];\n a[j] = temp;\n }\n }\n }\n return a;\n}",
"public void setSortOnCPUTime() {\n this.sortedJobList = new TreeSet<Job>(new Comparator<Job>() {\n @Override\n public int compare(Job a, Job b) {\n\n int aCPUUsed = 0;\n int bCPUUsed = 0;\n\n try {\n aCPUUsed = a.getCPUUsed();\n bCPUUsed = b.getCPUUsed();\n } catch (AS400SecurityException e) {\n e.printStackTrace();\n } catch (ErrorCompletingRequestException e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ObjectDoesNotExistException e) {\n e.printStackTrace();\n }\n\n if (aCPUUsed == bCPUUsed) return 0;\n else return bCPUUsed - aCPUUsed;\n }\n });\n }",
"@Override\n \tpublic void sort() {\n \t\tArrays.sort(data);\n \t}",
"public void sortOccurred() {\n //SET ALL THE ROWS TO -1, (THEY INITIALIZE TO 0).\n \tfor(int i = 0; i < data.length; i++) {\n \t\tdata[i] = null;\n \t\trowIndexLookup[i] = -1;\n \t}\t\t\n }",
"public void doTheAlgorithm() {\n this.swapCount = 0;\n this.compCount = 0;\n \n\t\tdoQuickSort(0, this.sortArray.length - 1);\n\t}",
"@VTID(28)\n boolean getSortUsingCustomLists();",
"private void sort()\n {\n // This implements Shell sort.\n // Unfortunately we cannot use the sorting functions from the library\n // (e.g. java.util.Arrays.sort), since the ones that work on int\n // arrays do not accept a comparison function, but only allow\n // sorting into natural order.\n int jump = length;\n boolean done;\n \n while( jump>1 ){\n jump /= 2;\n \n do {\n done = true;\n \n for( int j = 0; j<(length-jump); j++ ){\n int i = j + jump;\n \n if( !areCorrectlyOrdered( indices[j], indices[i] ) ){\n // Things are in the wrong order, swap them and step back.\n int tmp = indices[i];\n indices[i] = indices[j];\n indices[j] = tmp;\n done = false;\n }\n }\n } while( !done );\n }\n \n // TODO: integrate this with the stuff above.\n for( int i=1; i<length; i++ ){\n commonality[i] = commonLength( indices[i-1], indices[i] );\n }\n commonality[0] = -1;\n }",
"public void sort() {\n Collections.sort(jumpers, new SortJumperByPoints()); \n }",
"private static void sort2(int[] a) {\n for(int i=0; i<a.length; i++){\n //find smallest from i to end \n int minIndex=i;\n for(int j=i ; j<a.length; j++)\n if(a[j]<a[minIndex])\n minIndex=j;\n //swap\n int t = a[i];\n a[i] = a[minIndex];\n a[minIndex] = t;\n }\n }",
"void sortV();",
"private void sortAndEmitUpTo(double maxX)\n {\n /**\n * Heuristic: Check if there are no obvious segments to process\n * and skip sorting & processing if so\n * \n * This is a heuristic only.\n * There may be new segments at the end of the buffer\n * which are less than maxx. But this should be rare,\n * and they will all get processed eventually.\n */\n if (bufferHeadMaxX() >= maxX)\n return;\n \n // this often sorts more than are going to be processed.\n //TODO: Can this be done faster? eg priority queue?\n \n // sort segs in buffer, since they arrived in potentially unsorted order\n Collections.sort(segmentBuffer, ORIENT_COMPARATOR);\n int i = 0;\n int n = segmentBuffer.size();\n LineSeg prevSeg = null;\n \n //reportProcessed(maxX);\n \n while (i < n) {\n LineSeg seg = (LineSeg) segmentBuffer.get(i);\n if (seg.getMaxX() >= maxX)\n \tbreak;\n \n i++;\n if (removeDuplicates) {\n if (prevSeg != null) {\n // skip this segment if it is a duplicate\n if (prevSeg.equals(seg)) {\n // merge in side label of dup seg\n prevSeg.merge(seg);\n continue;\n }\n }\n prevSeg = seg;\n }\n // remove interior segments (for dissolving)\n if (removeInteriorSegs\n && seg.getTopoLabel() == TopologyLabel.BOTH_INTERIOR)\n continue;\n \n segSink.process(seg);\n }\n //System.out.println(\"SegmentStreamSorter: total segs = \" + n + \", processed = \" + i);\n removeSegsFromBuffer(i);\n }",
"public void sort(){\n for(int i = array.length-1;i >= 0;i--){\n sink(i);\n }\n while(size > 0){\n swap(0, size-1);\n size -= 1;\n sink(0);\n }\n }",
"public static void main(String[] args) throws FileNotFoundException{\n int[] quicktimes1 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes1[i] = (int)endTime;\n }\n \n int[] mergetimes1 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes1[i] = (int)endTime;\n }\n \n int[] heaptimes1 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes1[i] = (int)endTime;\n }\n \n int[] quicktimes2 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[i] = j;\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes2[i] = (int)endTime;\n }\n \n int[] mergetimes2 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes2[i] = (int)endTime;\n }\n \n int[] heaptimes2 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes2[i] = (int)endTime;\n }\n \n int[] quicktimes3 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes3[i] = (int)endTime;\n }\n \n int[] mergetimes3 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes3[i] = (int)endTime;\n }\n \n int[] heaptimes3 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes3[i] = (int)endTime;\n }\n \n int[] quicktimes4 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes4[i] = (int)endTime;\n }\n \n int[] mergetimes4 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes4[i] = (int)endTime;\n }\n \n int[] heaptimes4 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes4[i] = (int)endTime;\n }\n \n \n //THESE WILL GENERATE THE MERGE/HEAP/QUICK SORT FOR THE REVERSE SORTED ARRAYS OF VARIOUS LENGTHS\n int[] quicktimes5 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes5[i] = (int)endTime;\n }\n \n int[] mergetimes5 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes5[i] = (int)endTime;\n }\n \n int[] heaptimes5 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes5[i] = (int)endTime;\n }\n \n int[] quicktimes6 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes6[i] = (int)endTime;\n }\n \n int[] mergetimes6 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes6[i] = (int)endTime;\n }\n \n int[] heaptimes6 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes6[i] = (int)endTime;\n }\n \n int[] quicktimes7 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes7[i] = (int)endTime;\n }\n \n int[] mergetimes7 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes7[i] = (int)endTime;\n }\n \n int[] heaptimes7 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes7[i] = (int)endTime;\n }\n \n int[] quicktimes8 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes8[i] = (int)endTime;\n }\n \n int[] mergetimes8 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes8[i] = (int)endTime;\n }\n \n int[] heaptimes8 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes8[i] = (int)endTime;\n }\n \n //THESE WILL GENERATE THE MERGE/HEAP/QUICK SORT FOR THE RANDOM ARRAYS OF VARIOUS LENGTHS\n int[] quicktimes9 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999);\n long startTime = System.nanoTime();\n Sorting.quickSort(rarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes9[i] = (int)endTime;\n }\n \n int[] mergetimes9 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999);\n long startTime = System.nanoTime();\n Sorting.mergeSort(rarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes9[i] = (int)endTime;\n }\n \n int[] heaptimes9 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999);\n long startTime = System.nanoTime();\n Sorting.heapSort(rarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes9[i] = (int)endTime;\n }\n \n int[] quicktimes10 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[10000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(9999);\n long startTime = System.nanoTime();\n Sorting.quickSort(rarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes10[i] = (int)endTime;\n }\n \n int[] mergetimes10 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[10000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(9999);\n long startTime = System.nanoTime();\n Sorting.mergeSort(rarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes10[i] = (int)endTime;\n }\n \n int[] heaptimes10 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[10000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(9999);\n long startTime = System.nanoTime();\n Sorting.heapSort(rarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes10[i] = (int)endTime;\n }\n \n int[] quicktimes11 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[100000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(99999);\n long startTime = System.nanoTime();\n Sorting.quickSort(rarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes11[i] = (int)endTime;\n }\n \n int[] mergetimes11 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[100000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(99999);\n long startTime = System.nanoTime();\n Sorting.mergeSort(rarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes11[i] = (int)endTime;\n }\n \n int[] heaptimes11 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[100000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(99999);;\n long startTime = System.nanoTime();\n Sorting.heapSort(rarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes11[i] = (int)endTime;\n }\n \n int[] quicktimes12 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999999);\n long startTime = System.nanoTime();\n Sorting.quickSort(rarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes12[i] = (int)endTime;\n }\n \n int[] mergetimes12 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999999);\n long startTime = System.nanoTime();\n Sorting.mergeSort(rarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes12[i] = (int)endTime;\n }\n \n int[] heaptimes12 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999999);\n long startTime = System.nanoTime();\n Sorting.heapSort(rarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes12[i] = (int)endTime;\n }\n \n //PRINTING THE RESULTS OUT INTO FILE\n File f = new File(\"Results.txt\");\n FileOutputStream fos = new FileOutputStream(f);\n PrintWriter pw = new PrintWriter(fos);\n pw.println(\"SORTED ARRAYS TIMES:\");\n pw.printf(\"1000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes1), medVal(quicktimes1), varVal(quicktimes1, meanVal(quicktimes1)));\n pw.printf(\"10000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes2), medVal(quicktimes2), varVal(quicktimes2, meanVal(quicktimes2)));\n pw.printf(\"100000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes3), medVal(quicktimes3), varVal(quicktimes3, meanVal(quicktimes3)));\n pw.printf(\"1000000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes4), medVal(quicktimes4), varVal(quicktimes4, meanVal(quicktimes4)));\n pw.printf(\"1000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes1), medVal(mergetimes1), varVal(mergetimes1, meanVal(mergetimes1)));\n pw.printf(\"10000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes2), medVal(mergetimes2), varVal(mergetimes2, meanVal(mergetimes2)));\n pw.printf(\"100000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes3), medVal(mergetimes3), varVal(mergetimes3, meanVal(mergetimes3)));\n pw.printf(\"1000000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes4), medVal(mergetimes4), varVal(mergetimes4, meanVal(mergetimes4)));\n pw.printf(\"1000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes1), medVal(heaptimes1), varVal(heaptimes1, meanVal(heaptimes1)));\n pw.printf(\"10000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes2), medVal(heaptimes2), varVal(heaptimes2, meanVal(heaptimes2)));\n pw.printf(\"100000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes3), medVal(heaptimes3), varVal(heaptimes3, meanVal(heaptimes3)));\n pw.printf(\"1000000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes4), medVal(heaptimes4), varVal(heaptimes4, meanVal(heaptimes4)));\n pw.println(\"REVERSE SORTED ARRAYS TIMES:\");\n pw.printf(\"1000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes5), medVal(quicktimes5), varVal(quicktimes5, meanVal(quicktimes5)));\n pw.printf(\"10000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes6), medVal(quicktimes6), varVal(quicktimes6, meanVal(quicktimes6)));\n pw.printf(\"100000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes7), medVal(quicktimes7), varVal(quicktimes7, meanVal(quicktimes7)));\n pw.printf(\"1000000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes8), medVal(quicktimes8), varVal(quicktimes8, meanVal(quicktimes8)));\n pw.printf(\"1000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes5), medVal(mergetimes5), varVal(mergetimes5, meanVal(mergetimes5)));\n pw.printf(\"10000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes6), medVal(mergetimes6), varVal(mergetimes6, meanVal(mergetimes6)));\n pw.printf(\"100000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes7), medVal(mergetimes7), varVal(mergetimes7, meanVal(mergetimes7)));\n pw.printf(\"1000000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes8), medVal(mergetimes8), varVal(mergetimes8, meanVal(mergetimes8)));\n pw.printf(\"1000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes5), medVal(heaptimes5), varVal(heaptimes5, meanVal(heaptimes5)));\n pw.printf(\"10000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes6), medVal(heaptimes6), varVal(heaptimes6, meanVal(heaptimes6)));\n pw.printf(\"100000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes7), medVal(heaptimes7), varVal(heaptimes7, meanVal(heaptimes7)));\n pw.printf(\"1000000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes8), medVal(heaptimes8), varVal(heaptimes8, meanVal(heaptimes8)));\n pw.println(\"RANDOM ARRAYS TIMES:\");\n pw.printf(\"1000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes9), medVal(quicktimes9), varVal(quicktimes9, meanVal(quicktimes9)));\n pw.printf(\"10000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes10), medVal(quicktimes10), varVal(quicktimes10, meanVal(quicktimes10)));\n pw.printf(\"100000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes11), medVal(quicktimes11), varVal(quicktimes11, meanVal(quicktimes11)));\n pw.printf(\"1000000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes12), medVal(quicktimes12), varVal(quicktimes12, meanVal(quicktimes12)));\n pw.printf(\"1000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes9), medVal(mergetimes9), varVal(mergetimes9, meanVal(mergetimes9)));\n pw.printf(\"10000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes10), medVal(mergetimes10), varVal(mergetimes10, meanVal(mergetimes10)));\n pw.printf(\"100000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes11), medVal(mergetimes11), varVal(mergetimes11, meanVal(mergetimes11)));\n pw.printf(\"1000000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes12), medVal(mergetimes12), varVal(mergetimes12, meanVal(mergetimes12)));\n pw.printf(\"1000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes9), medVal(heaptimes9), varVal(heaptimes9, meanVal(heaptimes9)));\n pw.printf(\"10000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes10), medVal(heaptimes10), varVal(heaptimes10, meanVal(heaptimes10)));\n pw.printf(\"100000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes11), medVal(heaptimes11), varVal(heaptimes11, meanVal(heaptimes11)));\n pw.printf(\"1000000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes12), medVal(heaptimes12), varVal(heaptimes12, meanVal(heaptimes12)));\n pw.close();\n }",
"public void sort() {\r\n lang.setInteractionType(Language.INTERACTION_TYPE_AVINTERACTION);\r\n\r\n int nrElems = array.getLength();\r\n ArrayMarker iMarker = null, jMarker = null;\r\n // highlight method header\r\n code.highlight(\"header\");\r\n lang.nextStep();\r\n\r\n // check if array is null\r\n code.toggleHighlight(\"header\", \"ifNull\");\r\n incrementNrComparisons(); // if null\r\n lang.nextStep();\r\n\r\n // switch to variable declaration\r\n\r\n code.toggleHighlight(\"ifNull\", \"variables\");\r\n lang.nextStep();\r\n\r\n // initialize i\r\n code.toggleHighlight(\"variables\", \"initializeI\");\r\n iMarker = installArrayMarker(\"iMarker\", array, nrElems - 1);\r\n incrementNrAssignments(); // i =...\r\n lang.nextStep();\r\n\r\n // switch to outer loop\r\n code.unhighlight(\"initializeI\");\r\n\r\n while (iMarker.getPosition() >= 0) {\r\n code.highlight(\"outerLoop\");\r\n lang.nextStep();\r\n\r\n code.toggleHighlight(\"outerLoop\", \"innerLoop\");\r\n if (jMarker == null) {\r\n jMarker = installArrayMarker(\"jMarker\", array, 0);\r\n } else\r\n jMarker.move(0, null, DEFAULT_TIMING);\r\n incrementNrAssignments();\r\n while (jMarker.getPosition() <= iMarker.getPosition() - 1) {\r\n incrementNrComparisons();\r\n lang.nextStep();\r\n code.toggleHighlight(\"innerLoop\", \"if\");\r\n array.highlightElem(jMarker.getPosition() + 1, null, null);\r\n array.highlightElem(jMarker.getPosition(), null, null);\r\n incrementNrComparisons();\r\n lang.nextStep();\r\n\r\n if (array.getData(jMarker.getPosition()) > array.getData(jMarker\r\n .getPosition() + 1)) {\r\n // swap elements\r\n code.toggleHighlight(\"if\", \"swap\");\r\n array.swap(jMarker.getPosition(), jMarker.getPosition() + 1, null,\r\n DEFAULT_TIMING);\r\n incrementNrAssignments(3); // swap\r\n lang.nextStep();\r\n code.unhighlight(\"swap\");\r\n } else {\r\n code.unhighlight(\"if\");\r\n }\r\n // clean up...\r\n // lang.nextStep();\r\n code.highlight(\"innerLoop\");\r\n array.unhighlightElem(jMarker.getPosition(), null, null);\r\n array.unhighlightElem(jMarker.getPosition() + 1, null, null);\r\n if (jMarker.getPosition() <= iMarker.getPosition())\r\n jMarker.move(jMarker.getPosition() + 1, null, DEFAULT_TIMING);\r\n incrementNrAssignments(); // j++ will always happen...\r\n }\r\n lang.nextStep();\r\n code.toggleHighlight(\"innerLoop\", \"decrementI\");\r\n array.highlightCell(iMarker.getPosition(), null, DEFAULT_TIMING);\r\n if (iMarker.getPosition() > 0)\r\n iMarker.move(iMarker.getPosition() - 1, null, DEFAULT_TIMING);\r\n else\r\n iMarker.moveBeforeStart(null, DEFAULT_TIMING);\r\n incrementNrAssignments();\r\n lang.nextStep();\r\n code.unhighlight(\"decrementI\");\r\n }\r\n\r\n // some interaction...\r\n TrueFalseQuestionModel tfQuestion = new TrueFalseQuestionModel(\"tfQ\");\r\n tfQuestion.setPrompt(\"Did this work?\");\r\n tfQuestion.setPointsPossible(1);\r\n tfQuestion.setGroupID(\"demo\");\r\n tfQuestion.setCorrectAnswer(true);\r\n tfQuestion.setFeedbackForAnswer(true, \"Great!\");\r\n tfQuestion.setFeedbackForAnswer(false, \"argh!\");\r\n lang.addTFQuestion(tfQuestion);\r\n\r\n lang.nextStep();\r\n HtmlDocumentationModel link = new HtmlDocumentationModel(\"link\");\r\n link.setLinkAddress(\"http://www.heise.de\");\r\n lang.addDocumentationLink(link);\r\n\r\n lang.nextStep();\r\n MultipleChoiceQuestionModel mcq = new MultipleChoiceQuestionModel(\"mcq\");\r\n mcq.setPrompt(\"Which AV system can handle dynamic rewind?\");\r\n mcq.setGroupID(\"demo\");\r\n mcq.addAnswer(\"GAIGS\", -1, \"Only static images, not dynamic\");\r\n mcq.addAnswer(\"Animal\", 1, \"Good!\");\r\n mcq.addAnswer(\"JAWAA\", -2, \"Not at all!\");\r\n lang.addMCQuestion(mcq);\r\n\r\n lang.nextStep();\r\n MultipleSelectionQuestionModel msq = new MultipleSelectionQuestionModel(\r\n \"msq\");\r\n msq.setPrompt(\"Which of the following AV systems can handle interaction?\");\r\n msq.setGroupID(\"demo\");\r\n msq.addAnswer(\"Animal\", 2, \"Right - I hope!\");\r\n msq.addAnswer(\"JHAVE\", 2, \"Yep.\");\r\n msq.addAnswer(\"JAWAA\", 1, \"Only in Guido's prototype...\");\r\n msq.addAnswer(\"Leonardo\", -1, \"Nope.\");\r\n lang.addMSQuestion(msq);\r\n lang.nextStep();\r\n // Text text = lang.newText(new Offset(10, 20, \"array\", \"S\"), \"Hi\", \"hi\",\r\n // null);\r\n // lang.nextStep();\r\n }",
"public void shellSort(){\n int increment = list.size() / 2;\n while (increment > 0) {\n for (int i = increment; i < list.size(); i++) {\n int j = i;\n int temp = list.get(i);\n while (j >= increment && list.get(j - increment) > temp) {\n list.set(j, list.get(j - increment));\n j = j - increment;\n }\n list.set(j, temp);\n }\n if (increment == 2) {\n increment = 1;\n } else {\n increment *= (5.0 / 11);\n }\n }\n }",
"public void sort() {\n\t\tif (data.size() < 10) {\n\t\t\tbubbleSort();\n\t\t\tSystem.out.println(\"Bubble Sort\");\n\t\t} else {\n\t\t\tquickSort();\n\t\t\tSystem.out.println(\"Quick Sort\");\n\t\t}\n\t}",
"public void insertReorderBarrier() {\n\t\t\n\t}",
"private static void allSorts(int[] array) {\n\t\tSystem.out.printf(\"%12d\",array.length);\n\t\tint[] temp;\n\t\tStopWatch1 timer;\n\t\t\n\t\t//Performs bubble sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.bubbleSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\t\tfourSorts(array);\n\t\tSystem.out.println();\n\t}",
"public static void main(String[] args) {\n\t\tSystem.out.println(\"\\tSelection\\tBubble\\tInsertion\\tCollections\\tQuick\\tinPlaceQuick\\tMerge\");\r\n\t\tfor (int n = 1000; n <= 7000; n += 500) {\r\n\t\t\tAPArrayList<Double> lists = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listb = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listi = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listc = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listq = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listipq = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listm = new APArrayList<Double>();\r\n\t\t\t\r\n\t\t\tfor (int i = 0; i < n; i++) {\r\n\t\t\t\tDouble val = Math.random();\r\n\t\t\t\tlists.add(val);\r\n\t\t\t\tlistb.add(val);\r\n\t\t\t\tlisti.add(val);\r\n\t\t\t\tlistc.add(val);\r\n\t\t\t\tlistq.add(val);\r\n\t\t\t\tlistipq.add(val);\r\n\t\t\t\tlistm.add(val);\r\n\t\t\t}\r\n\r\n\t\t\tlong selStartTime = System.nanoTime();\r\n\t\t\tlists.selectionSort();\r\n\t\t\tlong selEndTime = System.nanoTime();\r\n\t\t\tlong selSortTime = selEndTime - selStartTime;\r\n\t\t\tlists.clear();\r\n\t\t\t\r\n\t\t\tlong bubStartTime = System.nanoTime();\r\n\t\t\tlistb.bubbleSort();\r\n\t\t\tlong bubEndTime = System.nanoTime();\r\n\t\t\tlong bubSortTime = bubEndTime - bubStartTime;\r\n\t\t\tlistb.clear();\r\n\t\t\t\r\n\t\t\tlong insStartTime = System.nanoTime();\r\n\t\t\tlisti.insertionSort();\r\n\t\t\tlong insEndTime = System.nanoTime();\r\n\t\t\tlong insSortTime = insEndTime - insStartTime;\r\n\t\t\tlisti.clear();\r\n\t\t\t\r\n\t\t\tlong CollStartTime = System.nanoTime();\r\n\t\t\tlistc.sort();\r\n\t\t\tlong CollEndTime = System.nanoTime();\r\n\t\t\tlong CollSortTime = CollEndTime - CollStartTime;\r\n\t\t\tlistc.clear();\r\n\t\t\t\r\n\t\t\tlong quickStartTime = System.nanoTime();\r\n\t\t\tlistq.simpleQuickSort();\r\n\t\t\tlong quickEndTime = System.nanoTime();\r\n\t\t\tlong quickSortTime = quickEndTime - quickStartTime;\r\n\t\t\tlistq.clear();\r\n\t\t\t\r\n\t\t\tlong inPlaceQuickStartTime = System.nanoTime();\r\n\t\t\tlistipq.inPlaceQuickSort();\r\n\t\t\tlong inPlaceQuickEndTime = System.nanoTime();\r\n\t\t\tlong inPlaceQuickSortTime = inPlaceQuickEndTime - inPlaceQuickStartTime;\r\n\t\t\tlistipq.clear();\r\n\t\t\t\r\n\t\t\tlong mergeStartTime = System.nanoTime();\r\n\t\t\tlistm.mergeSort();\r\n\t\t\tlong mergeEndTime = System.nanoTime();\r\n\t\t\tlong mergeSortTime = mergeEndTime - mergeStartTime;\r\n\t\t\tlistq.clear();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tSystem.out.println(n + \"\\t\" + selSortTime + \"\\t\" + bubSortTime + \"\\t\" + insSortTime + \"\\t\" + CollSortTime + \"\\t\" + quickSortTime + \"\\t\" + inPlaceQuickSortTime + \"\\t\" + mergeSortTime);\r\n\t\t}\r\n\t}",
"@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n\t@Override\n\tpublic void sort() {\n\t\t\n\t\t// create maxHeap\n\t\tHeap<E> maxHeap = new MaxHeap<E>(arr);\n\t\t\n\t\telapsedTime = System.nanoTime(); // get time of start\n\t\t\n\t\tfor (int i = length - 1; i > 0; i--) {\n\n\t\t\tmaxHeap.swap(arr, 0, i);\n\t\t\tmaxHeap.heapSize--;\n\t\t\t((MaxHeap) maxHeap).maxHeapify(arr, 0);\n\n\t\t}\n\t\t\n\t\telapsedTime = System.nanoTime() - elapsedTime; // get elapsed time\n\t\t\n\t\tprint(); // print sorted array\n\t\tprintElapsedTime(); // print elapsed time\n\t\t\n\t\t\n\t}",
"private void collapseIgloo() {\n blocks.sort(Comparator.comparing(a -> a.center.getY()));\n\n double minDistance, distance;\n Point3D R = new Point3D(0, -1, 0);\n for (int i = 0; i < blocks.size(); i++) {\n minDistance = Double.MAX_VALUE;\n for (int j = i - 1; j >= 0; j--) {\n if (boundingSpheresIntersect(blocks.get(i), blocks.get(j))) {\n distance = minDistance(blocks.get(i), blocks.get(j), R);\n if (distance < minDistance) {\n minDistance = distance;\n }\n }\n }\n if (minDistance != Double.MAX_VALUE) {\n blocks.get(i).move(R.multiply(minDistance));\n }\n }\n }",
"public void sortAllRows(){\n\t\t/* code goes here */ \n\t\t\n\t\t\n\t\t//WHY SHOULD THEY BE SORTED LIKE THE EXAMPLE SAYS???????\n\t\t\n\t}",
"private void sortGallery_10_Runnable() {\r\n\r\n\t\tif (_allPhotos == null || _allPhotos.length == 0) {\r\n\t\t\t// there are no files\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tfinal GalleryMT20Item[] virtualGalleryItems = _galleryMT20.getAllVirtualItems();\r\n\t\tfinal int virtualSize = virtualGalleryItems.length;\r\n\r\n\t\tif (virtualSize == 0) {\r\n\t\t\t// there are no items\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// sort photos with new sorting algorithm\r\n\t\tArrays.sort(_sortedAndFilteredPhotos, getCurrentComparator());\r\n\r\n\t\tupdateUI_GalleryItems(_sortedAndFilteredPhotos, null);\r\n\t}",
"private static long sortingTime(String[] array, boolean isStandardSort) {\n long start = System.currentTimeMillis(); // starting time\n if (isStandardSort) \n Arrays.sort(array);\n selectionSort(array);\n return System.currentTimeMillis() - start; // measure time consumed\n }",
"@Override // java.util.Comparator\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public int compare(androidx.recyclerview.widget.GapWorker.Task r6, androidx.recyclerview.widget.GapWorker.Task r7) {\n /*\n r5 = this;\n androidx.recyclerview.widget.GapWorker$Task r6 = (androidx.recyclerview.widget.GapWorker.Task) r6\n androidx.recyclerview.widget.GapWorker$Task r7 = (androidx.recyclerview.widget.GapWorker.Task) r7\n androidx.recyclerview.widget.RecyclerView r5 = r6.view\n r0 = 0\n r1 = 1\n if (r5 != 0) goto L_0x000c\n r2 = r1\n goto L_0x000d\n L_0x000c:\n r2 = r0\n L_0x000d:\n androidx.recyclerview.widget.RecyclerView r3 = r7.view\n if (r3 != 0) goto L_0x0013\n r3 = r1\n goto L_0x0014\n L_0x0013:\n r3 = r0\n L_0x0014:\n r4 = -1\n if (r2 == r3) goto L_0x001d\n if (r5 != 0) goto L_0x001b\n L_0x0019:\n r0 = r1\n goto L_0x0037\n L_0x001b:\n r0 = r4\n goto L_0x0037\n L_0x001d:\n boolean r5 = r6.immediate\n boolean r2 = r7.immediate\n if (r5 == r2) goto L_0x0026\n if (r5 == 0) goto L_0x0019\n goto L_0x001b\n L_0x0026:\n int r5 = r7.viewVelocity\n int r1 = r6.viewVelocity\n int r5 = r5 - r1\n if (r5 == 0) goto L_0x002f\n L_0x002d:\n r0 = r5\n goto L_0x0037\n L_0x002f:\n int r5 = r6.distanceToItem\n int r6 = r7.distanceToItem\n int r5 = r5 - r6\n if (r5 == 0) goto L_0x0037\n goto L_0x002d\n L_0x0037:\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: androidx.recyclerview.widget.GapWorker.AnonymousClass1.compare(java.lang.Object, java.lang.Object):int\");\n }",
"private static void performSort(TestApp testApp) {\n testApp.testPartition();\n\n /*\n Date end = new Date();\n System.out.println(\"Sort ended @ \" + end.getTime());\n System.out.println(\"Total time = \" + (end.getTime() - start.getTime())/1000.0 + \" seconds...\");\n */\n }",
"public void sort() {\n\t\tfor (int i = 1; i < this.dataModel.getLength(); i++) {\n\t\t\tfinal int x = this.dataModel.get(i);\n\n\t\t\t// Find location to insert using binary search\n\t\t\tfinal int j = Math.abs(this.dataModel.binarySearch(0, i, x) + 1);\n\n\t\t\t// Shifting array to one location right\n\t\t\tthis.dataModel.arrayCopy(j, j + 1, i - j);\n\n\t\t\t// Placing element at its correct location\n\t\t\tthis.dataModel.set(j, x);\n\t\t\tthis.repaint(this.count++);\n\t\t}\n\t}",
"public void sortieBloc() {\n this.tableLocaleCourante = this.tableLocaleCourante.getTableLocalPere();\n }",
"private static void fourSorts(int[] array) {\n\t\tStopWatch1 timer;\n\t\tint[] temp;\n\t\t//Performs insertion sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.insertionSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\n\n\t\t//Performs selection sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.selectionSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\n\t\t//Performs quick sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.quickSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\n\t\t//Performs merge sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.mergeSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\n\t}",
"private void orderSegments() {\n //insert numOrder for the db\n int i = 0;\n for(TransportSegmentLogic transportSegment: transportSegments){\n transportSegment.setOrder(i);\n i++;\n }\n\n\n\n /*int i = 0;\n int j = 1;\n\n\n TransportSegmentLogic swapSegment;\n\n while(j < transportSegments.size()){\n if(transportSegments.get(j).getOrigin().equals(transportSegments.get(i).getDestination())){\n swapSegment = transportSegments.get(j);\n transportSegments.remove(swapSegment);\n transportSegments.add(i +1, swapSegment);\n i = i + 1;\n j = i + 1;\n }\n j++;\n }\n\n j = transportSegments.size() -1;\n\n while(j > i){\n if(transportSegments.get(j).getDestination().equals(transportSegments.get(0).getOrigin())){\n swapSegment = transportSegments.get(j);\n transportSegments.remove(swapSegment);\n transportSegments.add(0, swapSegment);\n i = i + 1;\n j = transportSegments.size();\n }\n j--;\n } */\n }",
"public void run()\n { // checking for appropriate sorting algorithm\n \n if(comboAlgorithm.equals(\"Shell Sort\"))\n {\n this.shellSort(randInt);\n }\n \n if(comboAlgorithm.equals(\"Selection Sort\"))\n {\n this.selectionSort(randInt);\n }\n \n if(comboAlgorithm.equals(\"Insertion Sort\"))\n {\n this.insertionSort(randInt);\n }\n if(comboAlgorithm.equals(\"Bubble Sort\"))\n {\n this.bubbleSort(randInt);\n }\n \n }",
"private synchronized void freshSort(){\n Process[] newQueue = new Process[pros.proSize()];\n for(int i = 0; i <queue.length; i++){\n if(pros.isInList(queue[i])){\n newQueue[i] = queue[i];\n }\n }\n queue = new Process[pros.proSize()];\n queue = newQueue;\n }",
"public void sortFullList()\r\n {\r\n if (log.isDebugEnabled())\r\n {\r\n log.debug(\"[\" + this.id + \"] sorting full data\");\r\n }\r\n sortRowList(this.getRowListFull());\r\n }",
"private void updateFilteringAndSorting() {\n log.debug(\"update filtering of adapter called\");\n if (lastUsedComparator != null) {\n sortWithoutNotify(lastUsedComparator, lastUsedAsc);\n }\n Filter filter = getFilter();\n if (filter instanceof UpdateableFilter){\n ((UpdateableFilter)filter).updateFiltering();\n }\n }",
"private static void evaluateMergesortVogellaThreaded() {\n\n // LOGGER.info(\"evaluating parallel mergesort with Java Threads based on the Vogella version\");\n\n // The time before start to sort.\n long startTime;\n\n // The time after sort.\n long endTime;\n\n // generate sorted array\n numbers = generateSortedArray(ARRAY_SIZE);\n\n // get array to evaluate\n generateWorstUnsortArray(numbers);\n\n // get systemtime before sorting\n startTime = System.currentTimeMillis();\n\n // sort\n msVogellaJThreads.sort(numbers);\n\n // get systemtime after sorting\n endTime = System.currentTimeMillis();\n\n // show the result of the sorting process\n System.out.println(\"\\n- Sortierergebnis: Java Threads (Vogella) -\");\n System.out.println(\"Die sortierte Folge lautet: \" + arrayToString(numbers));\n System.out.printf(\"Für die Sortierung wurden %d ms benötigt\", endTime - startTime);\n System.out.println(\"\\n------------------------------------------------\\n\");\n }",
"public void sortSpeeds() {\n\n//\t\tSystem.out.println(\"BEGIN: SORT SPEEDS\");\n\t\tthis.printMoves();\n\n\t\tArrayList<Move> temp = new ArrayList<Move>();\n\t\tint i = 1;\n\t\tint x = 0;\n\t\tboolean y = true;\n\n\t\ttemp.add(niceMoves.get(0));\n\t\tint size = niceMoves.size();\n\n\t\twhile (i < niceMoves.size()) {\n\n//\t\t\tSystem.out.println(\"Reiterating.\");\n\t\t\ty = true;\n\n\t\t\twhile (y) {\n\n\t\t\t\t//System.out.println(\"I: \" + i + \" X: \" + x);\n\n\t\t\t\ttry {\n\n\t\t\t\t\tif (niceMoves.get(i).getSpeed() > temp.get(x).getCalcedSpeed()) {\n\n//\t\t\t\t\t\tSystem.out.println(\"Adding \" + niceMoves.get(i).getCaster() + \" to spot \" + x);\n\t\t\t\t\t\ttemp.add(x, niceMoves.get(i));\n\t\t\t\t\t\ty = false;\n\t\t\t\t\t}\n\t\t\t\t\t//X has cycled through temp, meaning nicemoves.i should be added to the end\n\t\t\t\t\t//The only way to check for this is to let it overflow lol\n\t\t\t\t} catch (Exception E) {\n//\t\t\t\t\tSystem.out.println(\"Adding \" + niceMoves.get(i).getCaster() + \" to spot \" + x);\n\t\t\t\t\ttemp.add(x, niceMoves.get(i));\n\t\t\t\t\ty = false;\n\n\t\t\t\t}\n\n\t\t\t\tx += 1;\n\t\t\t}\n\n\t\t\ti += 1;\n\t\t\tx = 0;\n\t\t}\n\n\t\tniceMoves = temp;\n\n//\t\tSystem.out.println();\n//\t\tSystem.out.println(\"Sorting Complete! New Order: \");\n//\t\tthis.printMoves();\n\t\t//end of sort speeds\n\t}",
"public void sort() {\r\n // sort the process variables\r\n Arrays.sort(pvValues, categoryComparator);\r\n fireTableDataChanged();\r\n }",
"public void sort() throws IOException {\n for(int i = 0; i < 32; i++)\n {\n if(i%2 == 0){\n filePointer = file;\n onePointer = one;\n }else{\n filePointer = one;\n onePointer = file;\n }\n filePointer.seek(0);\n onePointer.seek(0);\n zero.seek(0);\n zeroCount = oneCount = 0;\n for(int j = 0; j < totalNumbers; j++){\n int n = filePointer.readInt();\n sortN(n,i);\n }\n //Merging\n onePointer.seek(oneCount*4);\n zero.seek(0L);\n for(int j = 0; j < zeroCount; j++){\n int x = zero.readInt();\n onePointer.writeInt(x);\n }\n //One is merged\n }\n }",
"void sortUI();",
"private static long sortingTime(double[] array, boolean isStandardSort) {\n long start = 0; // starting time\n if (isStandardSort) { \n start = System.currentTimeMillis(); \n Arrays.sort(array);\n } else {\t\n start = System.currentTimeMillis();\n selectionSort(array);\n }\n return System.currentTimeMillis() - start; // measure time consumed\n }",
"private void compressBlocks(final int phaseId) {\n // 1. uncross all crossing blocks: O(|G|)\n popBlocks(head -> head.isTerminal() && head.getPhaseId() < phaseId,\n tail -> tail.isTerminal() && tail.getPhaseId() < phaseId);\n\n List<BlockRecord<N, S>> shortBlockRecords = new ArrayList<>();\n List<BlockRecord<N, S>> longBlockRecords = new ArrayList<>();\n\n // 2. get all blocks: O(|G|)\n slp.getProductions().stream().forEach(rule -> consumeBlocks(rule.getRight(), shortBlockRecords::add, longBlockRecords::add, letter -> true));\n\n // 3.1 sort short blocks using RadixSort: O(|G|)\n sortBlocks(shortBlockRecords);\n\n // 3.2 sort long blocks O((n+m) log(n+m))\n Collections.sort(longBlockRecords, blockComparator);\n List<BlockRecord<N, S>> blockRecords = mergeBlocks(shortBlockRecords, longBlockRecords);\n\n // compress blocks\n BlockRecord<N, S> lastRecord = null;\n S letter = null;\n\n // 4. compress blocks: O(|G|)\n for(BlockRecord<N, S> record : blockRecords) {\n\n // check when it is the correct time to introduce a fresh letter\n if(lastRecord == null || !lastRecord.equals(record)) {\n letter = terminalAlphabet.createTerminal(phase, 1L, record.node.getElement().getLength() * record.block.getLength(), record.block);\n lastRecord = record;\n }\n replaceBlock(record, letter);\n }\n }",
"@Test(timeout = SHORT_TIMEOUT)\n public void testAdaptiveInsertionSort() {\n //Test adaptiveness of completely ordered sort\n\n //Generate sorted array\n toSort = randArrDuplicates(MAX_ARR_SIZE, new Random(2110));\n Arrays.parallelSort(toSort, comp);\n sortedInts = cloneArr(toSort);\n\n comp.resetCount();\n Sorting.insertionSort(sortedInts, comp);\n int numComparisons = comp.getCount();\n\n assertSorted(sortedInts, comp);\n\n //Should require only 1 pass through array, for n-1 comparisons\n assertTrue(\"Too many comparisons: \" + numComparisons,\n numComparisons <= MAX_ARR_SIZE - 1);\n\n //Check adaptiveness with 1 item out-of-order\n\n //Set up list\n toSort = new IntPlus[6];\n for (int i = 0; i < toSort.length; i++) {\n toSort[i] = new IntPlus(2 * i);\n }\n toSort[3] = new IntPlus(-1);\n\n sortedInts = cloneArr(toSort);\n\n /*\n Initial Array: [0, 2, 4, -1, 8, 10]\n Should require 7 comparisons to sort\n */\n comp.resetCount();\n Sorting.insertionSort(sortedInts, comp);\n numComparisons = comp.getCount();\n\n assertSorted(sortedInts, comp);\n\n assertTrue(\"Too many comparisons: \" + numComparisons,\n numComparisons <= 7);\n }",
"public static void main(String[] args) {\n\r\n\t\t int[] arr = generateRandomArrayWithRandomNum();\r\n\t int checksSelectionSort = 0;\r\n\t int checksBubbleSort = 0;\r\n\t int checksMergeSort = 0;\r\n\t int checksQuickSort = 0;\r\n\t int[] copyArr = new int[1000];\r\n\t for (int x = 0; x < 20; x++) {\r\n\t System.arraycopy(arr, 0, copyArr, 0, 1000);\r\n\t checksSelectionSort += doSelectionSort(arr);\r\n\r\n\t \r\n\t System.arraycopy(copyArr, 0, arr, 0, 1000);\r\n\t checksBubbleSort += bubbleSort(copyArr);\r\n\t System.arraycopy(arr, 0, copyArr, 0, 1000);\r\n\t checksMergeSort += new mergeSort().sort(arr);\r\n\t System.arraycopy(copyArr, 0, arr, 0, 1000);\r\n\t checksQuickSort += new quickSort().sort(copyArr);\r\n\t }\r\n\t System.out.println(\"Analysis Of Sorting algorithms \");\r\n\t System.out.println(\"Selection Sort : \"+checksSelectionSort/20);\r\n\t System.out.println(\"Bubble Sort : \"+checksBubbleSort/20);\r\n\t System.out.println(\"Merge Sort : \"+checksMergeSort/20);\r\n\t System.out.println(\"Quick Sort : \"+checksQuickSort/20);\r\n\r\n\t \r\n\t }",
"public void sort(){\n ListNode t, x, b = new ListNode(null, null);\n while (firstNode != null){\n t = firstNode; firstNode = firstNode.nextNode;\n for (x = b; x.nextNode != null; x = x.nextNode) //b is the first node of the new sorted list\n if (cmp.compare(x.nextNode.data, t.data) > 0) break;\n t.nextNode = x.nextNode; x.nextNode = t;\n if (t.nextNode==null) lastNode = t;\n }\n firstNode = b.nextNode;\n }"
] | [
"0.719662",
"0.6253113",
"0.6209965",
"0.60641325",
"0.6062344",
"0.60514784",
"0.6039714",
"0.6020895",
"0.6018125",
"0.6015914",
"0.59652436",
"0.5950544",
"0.5932971",
"0.5900926",
"0.58313674",
"0.5802383",
"0.5788351",
"0.57315594",
"0.56716985",
"0.56670487",
"0.5629508",
"0.5613598",
"0.5612099",
"0.5611703",
"0.5592451",
"0.55917716",
"0.5588461",
"0.55848163",
"0.5554659",
"0.5554079",
"0.5549377",
"0.55441636",
"0.5537118",
"0.5532984",
"0.5532803",
"0.5532803",
"0.55292463",
"0.55275965",
"0.5522279",
"0.5519424",
"0.551642",
"0.5511716",
"0.55057514",
"0.5502017",
"0.54939586",
"0.5476436",
"0.54741585",
"0.5473029",
"0.5441123",
"0.54384875",
"0.54355913",
"0.5428854",
"0.5424462",
"0.5404587",
"0.54042906",
"0.5398141",
"0.53981346",
"0.5394633",
"0.5393649",
"0.53902",
"0.538549",
"0.53852785",
"0.5384685",
"0.53686666",
"0.5345649",
"0.5341686",
"0.53390706",
"0.53294265",
"0.53148216",
"0.53070915",
"0.53057426",
"0.5305577",
"0.5304475",
"0.5292254",
"0.52918285",
"0.5290364",
"0.5287865",
"0.52842516",
"0.52834797",
"0.52813774",
"0.5267899",
"0.52645266",
"0.5263191",
"0.5262101",
"0.5261538",
"0.5259155",
"0.52528334",
"0.5249513",
"0.524533",
"0.5243381",
"0.5239559",
"0.5239141",
"0.5237668",
"0.52372295",
"0.5224401",
"0.5223193",
"0.5222278",
"0.522134",
"0.5221159",
"0.5217173",
"0.52171165"
] | 0.0 | -1 |
/ Enabled aggressive block sorting | void drainFused() {
int n;
int n2 = 1;
Subscriber<T> subscriber = this.actual;
SimpleQueueWithConsumerIndex<Object> simpleQueueWithConsumerIndex = this.queue;
do {
if (this.cancelled) {
simpleQueueWithConsumerIndex.clear();
return;
}
Throwable throwable = (Throwable)this.error.get();
if (throwable != null) {
simpleQueueWithConsumerIndex.clear();
subscriber.onError(throwable);
return;
}
n = simpleQueueWithConsumerIndex.producerIndex() == this.sourceCount ? 1 : 0;
if (!simpleQueueWithConsumerIndex.isEmpty()) {
subscriber.onNext(null);
}
if (n != 0) {
subscriber.onComplete();
return;
}
n2 = n = this.addAndGet(-n2);
} while (n != 0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void sortBlocks(){\n\t\tCurrentSets = getCurrentSets();\n\t\tif(CurrentSets == 1){\n\t\t\treturn;\n\t\t}else{\n\t\t\tfor(i = 0; i < CurrentSets - 1; i++){\n\t\t\t\tfor(j = i + 1; j < CurrentSets; j++){\n\t\t\t\t\tif((Integer.parseInt(blocks[i].getHexTag(), 16)) > (Integer.parseInt(blocks[j].getHexTag(), 16))){\n\t\t\t\t\t\ttemp = blocks[j];\n\t\t\t\t\t\tblocks[j] = blocks[i];\n\t\t\t\t\t\tblocks[i] = temp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public void sort(IAlg algorithm, boolean decrescent){}",
"private static void sortingMemo() {\n\t\t\n\t}",
"public void sort()throws InterruptedException{\n\t\tfor (int i = 0; i < a.length - 1; i++) {\n\t\t\tint minPos = minPosition(i);\n\t\t\tsortStateLock.lock();\n\t\t\ttry{\n\t\t\t\tswap(minPos, i);\n\t\t\t\t// For animation\n\t\t\t\talreadySorted = i;\n\t\t\t}\n\t\t\tfinally{\n\t\t\t\tsortStateLock.unlock();\n\t\t \t\t}\n\t\t\tpause(2);\n\t }\n }",
"public FastNondominatedSorting() {\r\n\t\tthis(new ParetoDominanceComparator());\r\n\t}",
"private PerfectMergeSort() {}",
"@Override\r\n\tpublic void sort() {\r\n\t\tint minpos;\r\n\t\tfor (int i = 0; i < elements.length-1; i++) {\r\n\t\t\tminpos=AuxMethods.minPos(elements, i);\r\n\t\t\telements=AuxMethods.swapElements(elements, i, minpos);\r\n\t\t\t\r\n\t\t}\r\n\t}",
"public void sort() {\n compares = 0;\n shuttlesort((int[]) indexes.clone(), indexes, 0, indexes.length);\n }",
"public void sort() {\r\n int k = start;\r\n for (int i = 0; i < size - 1; i++) {\r\n int p = (k + 1) % cir.length;\r\n for (int j = i + 1; j < size; j++) {\r\n if ((int) cir[p] < (int) cir[k % cir.length]) {\r\n Object temp = cir[k];\r\n cir[k] = cir[p];\r\n cir[p] = temp;\r\n }\r\n p = (p + 1) % cir.length;\r\n }\r\n k = (k + 1) % cir.length;\r\n }\r\n }",
"public void oldSort()\n\t{\n\t\tfor (int index = 0; index < arraySize; index++) {\n\t\t\tfor (int secondIndex = index + 1; secondIndex < arraySize; secondIndex++) {\n\t\t\t\tint temp = 0;\n\t\t\t\tif (array[index] > array[secondIndex]) {\n\t\t\t\t\ttemp = array[index];\n\t\t\t\t\tarray[index] = array[secondIndex];\n\t\t\t\t\tarray[secondIndex] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"private void sort() {\n\t\trunPassZero();\n\t\tList<TupleReaderBinary> buffers = new ArrayList<>();\n\t\tList<Tuple> sortStage = new ArrayList<>();\n\t\tassert (readerBucketID == 0);\n\t\tassert (writerBucketID == 0);\n\t\tassert (passNumber == 1);\n\t\tassert (currentGroup == 1);\n\t\toutputBuffer.clear();\n\n\t\t// assign buffers\n\t\tfor (int i = 0; i < numInputBuffers; i++) {\n\t\t\tbuffers.add(null);\n\t\t\tassignBuffer(buffers, i);\n\t\t\tsortStage.add(null);\n\t\t}\n\n\t\tassert (buffers.size() == numInputBuffers);\n\t\tassert (sortStage.size() == numInputBuffers);\n\n\t\t// read from buffers into list of size numInputBuffers\n\t\tfor (int i = 0; i < numInputBuffers; i++) {\n\t\t\tsortStage.set(i, readFromBuffer(buffers, i));\n\t\t}\n\n\t\toutputWriter = new TupleWriterBinary(DatabaseCatalog.getInstance().getTempDirectory() + \"/\" + instanceHashcode\n\t\t\t\t+ \"_\" + passNumber + \"_\" + writerBucketID);\n\n\t\twhile (true) {\n\t\t\tif (!findAndReplaceSmallest(buffers, sortStage)) {\n\t\t\t\tprevPrevTotalBuckets = prevTotalBuckets;\n\t\t\t\tprevTotalBuckets = writerBucketID + 1;\n\t\t\t\tflushOutputBuffer();\n\t\t\t\toutputWriter.close();\n\n\t\t\t\t// We are done! Return\n\t\t\t\tif (prevTotalBuckets == 1) {\n\t\t\t\t\tdeleteTempFiles();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\twriterBucketID = 0;\n\t\t\t\treaderBucketID = 0;\n\t\t\t\twriterFlushes = 0;\n\t\t\t\tdeleteTempFiles();\n\t\t\t\tpassNumber++;\n\t\t\t\tcurrentGroup = 1;\n\n\t\t\t\tfor (int i = 0; i < numInputBuffers; i++) {\n\t\t\t\t\tassignBuffer(buffers, i);\n\t\t\t\t\tsortStage.add(null);\n\t\t\t\t}\n\t\t\t\tfor (int i = 0; i < numInputBuffers; i++) {\n\t\t\t\t\tsortStage.set(i, readFromBuffer(buffers, i));\n\t\t\t\t}\n\n\t\t\t\toutputWriter = new TupleWriterBinary(DatabaseCatalog.getInstance().getTempDirectory() + \"/\"\n\t\t\t\t\t\t+ instanceHashcode + \"_\" + passNumber + \"_\" + writerBucketID);\n\t\t\t}\n\t\t}\n\n\t}",
"public void radixSorting() {\n\t\t\n\t}",
"public void sort() {\n }",
"public void sort() {\n\t\tdivider(0, array.size() - 1);\n\t}",
"public void setBubbleSort() \n\t{\n\t\tint last = recordCount + NOT_FOUND; //array.length() - 1\n\n\t\twhile(last > RESET_VALUE) //last > 0\n\t\t{\n\t\t\tint localIndex = RESET_VALUE; \n\t\t\tboolean swap = false;\n\n\t\t\twhile(localIndex < last) \n\t\t\t{\n\t\t\t\tif(itemIDs[localIndex] > itemIDs[localIndex + 1]) \n\t\t\t\t{\n\t\t\t\t\tsetSwapArrayElements(localIndex);\n\t\t\t\t\tswap = true;\n\t\t\t\t}\n\t\t\t\tlocalIndex++;\n\t\t\t}\n\n\t\t\tif(swap == false) \n\t\t\t{\n\t\t\t\tlast = RESET_VALUE;\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tlast = last + NOT_FOUND;\n\t\t\t}\n\n\t\t}//END while(last > RESET_VALUE)\n\t\treturn;\n\t}",
"private void trIntroSort(int r34, int r35, int r36, int r37, int r38, io.netty.handler.codec.compression.Bzip2DivSufSort.TRBudget r39, int r40) {\n /*\n r33 = this;\n r0 = r33;\n r0 = r0.SA;\n r16 = r0;\n r4 = 64;\n r0 = new io.netty.handler.codec.compression.Bzip2DivSufSort.StackEntry[r4];\n r29 = r0;\n r32 = 0;\n r27 = 0;\n r4 = r38 - r37;\n r22 = trLog(r4);\n r28 = r27;\n r23 = r22;\n L_0x001a:\n if (r23 >= 0) goto L_0x02b6;\n L_0x001c:\n r4 = -1;\n r0 = r23;\n if (r0 != r4) goto L_0x01a4;\n L_0x0021:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 != 0) goto L_0x0050;\n L_0x002d:\n r22 = r23;\n L_0x002f:\n r26 = 0;\n L_0x0031:\n r0 = r26;\n r1 = r28;\n if (r0 >= r1) goto L_0x072a;\n L_0x0037:\n r4 = r29[r26];\n r4 = r4.d;\n r5 = -3;\n if (r4 != r5) goto L_0x004d;\n L_0x003e:\n r4 = r29[r26];\n r4 = r4.b;\n r5 = r29[r26];\n r5 = r5.c;\n r0 = r33;\n r1 = r34;\n r0.lsUpdateGroup(r1, r4, r5);\n L_0x004d:\n r26 = r26 + 1;\n goto L_0x0031;\n L_0x0050:\n r6 = r35 + -1;\n r10 = r38 + -1;\n r4 = r33;\n r5 = r34;\n r7 = r36;\n r8 = r37;\n r9 = r38;\n r25 = r4.trPartition(r5, r6, r7, r8, r9, r10);\n r0 = r25;\n r8 = r0.first;\n r0 = r25;\n r9 = r0.last;\n r0 = r37;\n if (r0 < r8) goto L_0x0072;\n L_0x006e:\n r0 = r38;\n if (r9 >= r0) goto L_0x016d;\n L_0x0072:\n r0 = r38;\n if (r8 >= r0) goto L_0x0087;\n L_0x0076:\n r17 = r37;\n r31 = r8 + -1;\n L_0x007a:\n r0 = r17;\n if (r0 >= r8) goto L_0x0087;\n L_0x007e:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x007a;\n L_0x0087:\n r0 = r38;\n if (r9 >= r0) goto L_0x009c;\n L_0x008b:\n r17 = r8;\n r31 = r9 + -1;\n L_0x008f:\n r0 = r17;\n if (r0 >= r9) goto L_0x009c;\n L_0x0093:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x008f;\n L_0x009c:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = 0;\n r6 = 0;\n r4.<init>(r5, r8, r9, r6);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + -1;\n r6 = -2;\n r0 = r37;\n r1 = r38;\n r4.<init>(r5, r0, r1, r6);\n r29[r27] = r4;\n r4 = r8 - r37;\n r5 = r38 - r9;\n if (r4 > r5) goto L_0x0117;\n L_0x00bd:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x00e3;\n L_0x00c2:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r38 - r9;\n r5 = trLog(r5);\n r0 = r35;\n r1 = r38;\n r4.<init>(r0, r9, r1, r5);\n r29[r28] = r4;\n r38 = r8;\n r4 = r8 - r37;\n r22 = trLog(r4);\n L_0x00dd:\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x00e3:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x00f3;\n L_0x00e8:\n r37 = r9;\n r4 = r38 - r9;\n r22 = trLog(r4);\n r27 = r28;\n goto L_0x00dd;\n L_0x00f3:\n if (r28 != 0) goto L_0x00fa;\n L_0x00f5:\n r27 = r28;\n r22 = r23;\n L_0x00f9:\n return;\n L_0x00fa:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n goto L_0x00dd;\n L_0x0117:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x0138;\n L_0x011c:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r8 - r37;\n r5 = trLog(r5);\n r0 = r35;\n r1 = r37;\n r4.<init>(r0, r1, r8, r5);\n r29[r28] = r4;\n r37 = r9;\n r4 = r38 - r9;\n r22 = trLog(r4);\n goto L_0x00dd;\n L_0x0138:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x0148;\n L_0x013d:\n r38 = r8;\n r4 = r8 - r37;\n r22 = trLog(r4);\n r27 = r28;\n goto L_0x00dd;\n L_0x0148:\n if (r28 != 0) goto L_0x014f;\n L_0x014a:\n r27 = r28;\n r22 = r23;\n goto L_0x00f9;\n L_0x014f:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n goto L_0x00dd;\n L_0x016d:\n r17 = r37;\n L_0x016f:\n r0 = r17;\n r1 = r38;\n if (r0 >= r1) goto L_0x017e;\n L_0x0175:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r17;\n r17 = r17 + 1;\n goto L_0x016f;\n L_0x017e:\n if (r28 != 0) goto L_0x0186;\n L_0x0180:\n r27 = r28;\n r22 = r23;\n goto L_0x00f9;\n L_0x0186:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n goto L_0x00dd;\n L_0x01a4:\n r4 = -2;\n r0 = r23;\n if (r0 != r4) goto L_0x01ea;\n L_0x01a9:\n r27 = r28 + -1;\n r4 = r29[r27];\n r8 = r4.b;\n r4 = r29[r27];\n r9 = r4.c;\n r11 = r35 - r34;\n r4 = r33;\n r5 = r34;\n r6 = r36;\n r7 = r37;\n r10 = r38;\n r4.trCopy(r5, r6, r7, r8, r9, r10, r11);\n if (r27 != 0) goto L_0x01c8;\n L_0x01c4:\n r22 = r23;\n goto L_0x00f9;\n L_0x01c8:\n r27 = r27 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x01ea:\n r4 = r16[r37];\n if (r4 < 0) goto L_0x0202;\n L_0x01ee:\n r8 = r37;\n L_0x01f0:\n r4 = r16[r8];\n r4 = r4 + r34;\n r16[r4] = r8;\n r8 = r8 + 1;\n r0 = r38;\n if (r8 >= r0) goto L_0x0200;\n L_0x01fc:\n r4 = r16[r8];\n if (r4 >= 0) goto L_0x01f0;\n L_0x0200:\n r37 = r8;\n L_0x0202:\n r0 = r37;\n r1 = r38;\n if (r0 >= r1) goto L_0x028c;\n L_0x0208:\n r8 = r37;\n L_0x020a:\n r4 = r16[r8];\n r4 = r4 ^ -1;\n r16[r8] = r4;\n r8 = r8 + 1;\n r4 = r16[r8];\n if (r4 < 0) goto L_0x020a;\n L_0x0216:\n r4 = r16[r8];\n r4 = r4 + r34;\n r4 = r16[r4];\n r5 = r16[r8];\n r5 = r5 + r35;\n r5 = r16[r5];\n if (r4 == r5) goto L_0x0241;\n L_0x0224:\n r4 = r8 - r37;\n r4 = r4 + 1;\n r24 = trLog(r4);\n L_0x022c:\n r8 = r8 + 1;\n r0 = r38;\n if (r8 >= r0) goto L_0x0244;\n L_0x0232:\n r9 = r37;\n r31 = r8 + -1;\n L_0x0236:\n if (r9 >= r8) goto L_0x0244;\n L_0x0238:\n r4 = r16[r9];\n r4 = r4 + r34;\n r16[r4] = r31;\n r9 = r9 + 1;\n goto L_0x0236;\n L_0x0241:\n r24 = -1;\n goto L_0x022c;\n L_0x0244:\n r4 = r8 - r37;\n r5 = r38 - r8;\n if (r4 > r5) goto L_0x0264;\n L_0x024a:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = -3;\n r0 = r35;\n r1 = r38;\n r4.<init>(r0, r8, r1, r5);\n r29[r28] = r4;\n r35 = r35 + 1;\n r38 = r8;\n r22 = r24;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0264:\n r4 = 1;\n r5 = r38 - r8;\n if (r4 >= r5) goto L_0x0282;\n L_0x0269:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r37;\n r1 = r24;\n r4.<init>(r5, r0, r8, r1);\n r29[r28] = r4;\n r37 = r8;\n r22 = -3;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0282:\n r35 = r35 + 1;\n r38 = r8;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x028c:\n if (r28 != 0) goto L_0x0294;\n L_0x028e:\n r27 = r28;\n r22 = r23;\n goto L_0x00f9;\n L_0x0294:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x02b6:\n r4 = r38 - r37;\n r5 = 8;\n if (r4 > r5) goto L_0x02d5;\n L_0x02bc:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 != 0) goto L_0x02cc;\n L_0x02c8:\n r22 = r23;\n goto L_0x002f;\n L_0x02cc:\n r33.trInsertionSort(r34, r35, r36, r37, r38);\n r22 = -3;\n r23 = r22;\n goto L_0x001a;\n L_0x02d5:\n r22 = r23 + -1;\n if (r23 != 0) goto L_0x0331;\n L_0x02d9:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 == 0) goto L_0x002f;\n L_0x02e5:\n r15 = r38 - r37;\n r10 = r33;\n r11 = r34;\n r12 = r35;\n r13 = r36;\n r14 = r37;\n r10.trHeapSort(r11, r12, r13, r14, r15);\n r8 = r38 + -1;\n L_0x02f6:\n r0 = r37;\n if (r0 >= r8) goto L_0x032b;\n L_0x02fa:\n r4 = r16[r8];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r9 = r8 + -1;\n L_0x030a:\n r0 = r37;\n if (r0 > r9) goto L_0x0329;\n L_0x030e:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r4 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n if (r4 != r0) goto L_0x0329;\n L_0x0320:\n r4 = r16[r9];\n r4 = r4 ^ -1;\n r16[r9] = r4;\n r9 = r9 + -1;\n goto L_0x030a;\n L_0x0329:\n r8 = r9;\n goto L_0x02f6;\n L_0x032b:\n r22 = -3;\n r23 = r22;\n goto L_0x001a;\n L_0x0331:\n r8 = r33.trPivot(r34, r35, r36, r37, r38);\n r0 = r16;\n r1 = r37;\n r2 = r16;\n swapElements(r0, r1, r2, r8);\n r4 = r16[r37];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r31 = r0.trGetC(r1, r2, r3, r4);\n r9 = r37 + 1;\n L_0x034e:\n r0 = r38;\n if (r9 >= r0) goto L_0x0369;\n L_0x0352:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x0369;\n L_0x0366:\n r9 = r9 + 1;\n goto L_0x034e;\n L_0x0369:\n r8 = r9;\n r0 = r38;\n if (r9 >= r0) goto L_0x039e;\n L_0x036e:\n r0 = r32;\n r1 = r31;\n if (r0 >= r1) goto L_0x039e;\n L_0x0374:\n r9 = r9 + 1;\n r0 = r38;\n if (r9 >= r0) goto L_0x039e;\n L_0x037a:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 > r1) goto L_0x039e;\n L_0x038e:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x0374;\n L_0x0394:\n r0 = r16;\n r1 = r16;\n swapElements(r0, r9, r1, r8);\n r8 = r8 + 1;\n goto L_0x0374;\n L_0x039e:\n r17 = r38 + -1;\n L_0x03a0:\n r0 = r17;\n if (r9 >= r0) goto L_0x03bb;\n L_0x03a4:\n r4 = r16[r17];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x03bb;\n L_0x03b8:\n r17 = r17 + -1;\n goto L_0x03a0;\n L_0x03bb:\n r18 = r17;\n r0 = r17;\n if (r9 >= r0) goto L_0x03f5;\n L_0x03c1:\n r0 = r32;\n r1 = r31;\n if (r0 <= r1) goto L_0x03f5;\n L_0x03c7:\n r17 = r17 + -1;\n r0 = r17;\n if (r9 >= r0) goto L_0x03f5;\n L_0x03cd:\n r4 = r16[r17];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 < r1) goto L_0x03f5;\n L_0x03e1:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x03c7;\n L_0x03e7:\n r0 = r16;\n r1 = r17;\n r2 = r16;\n r3 = r18;\n swapElements(r0, r1, r2, r3);\n r18 = r18 + -1;\n goto L_0x03c7;\n L_0x03f5:\n r0 = r17;\n if (r9 >= r0) goto L_0x045a;\n L_0x03f9:\n r0 = r16;\n r1 = r16;\n r2 = r17;\n swapElements(r0, r9, r1, r2);\n L_0x0402:\n r9 = r9 + 1;\n r0 = r17;\n if (r9 >= r0) goto L_0x042c;\n L_0x0408:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 > r1) goto L_0x042c;\n L_0x041c:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x0402;\n L_0x0422:\n r0 = r16;\n r1 = r16;\n swapElements(r0, r9, r1, r8);\n r8 = r8 + 1;\n goto L_0x0402;\n L_0x042c:\n r17 = r17 + -1;\n r0 = r17;\n if (r9 >= r0) goto L_0x03f5;\n L_0x0432:\n r4 = r16[r17];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 < r1) goto L_0x03f5;\n L_0x0446:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x042c;\n L_0x044c:\n r0 = r16;\n r1 = r17;\n r2 = r16;\n r3 = r18;\n swapElements(r0, r1, r2, r3);\n r18 = r18 + -1;\n goto L_0x042c;\n L_0x045a:\n r0 = r18;\n if (r8 > r0) goto L_0x0716;\n L_0x045e:\n r17 = r9 + -1;\n r26 = r8 - r37;\n r30 = r9 - r8;\n r0 = r26;\n r1 = r30;\n if (r0 <= r1) goto L_0x046c;\n L_0x046a:\n r26 = r30;\n L_0x046c:\n r19 = r37;\n r21 = r9 - r26;\n L_0x0470:\n if (r26 <= 0) goto L_0x0484;\n L_0x0472:\n r0 = r16;\n r1 = r19;\n r2 = r16;\n r3 = r21;\n swapElements(r0, r1, r2, r3);\n r26 = r26 + -1;\n r19 = r19 + 1;\n r21 = r21 + 1;\n goto L_0x0470;\n L_0x0484:\n r26 = r18 - r17;\n r4 = r38 - r18;\n r30 = r4 + -1;\n r0 = r26;\n r1 = r30;\n if (r0 <= r1) goto L_0x0492;\n L_0x0490:\n r26 = r30;\n L_0x0492:\n r19 = r9;\n r21 = r38 - r26;\n L_0x0496:\n if (r26 <= 0) goto L_0x04aa;\n L_0x0498:\n r0 = r16;\n r1 = r19;\n r2 = r16;\n r3 = r21;\n swapElements(r0, r1, r2, r3);\n r26 = r26 + -1;\n r19 = r19 + 1;\n r21 = r21 + 1;\n goto L_0x0496;\n L_0x04aa:\n r4 = r9 - r8;\n r8 = r37 + r4;\n r4 = r18 - r17;\n r9 = r38 - r4;\n r4 = r16[r8];\n r4 = r4 + r34;\n r4 = r16[r4];\n r0 = r31;\n if (r4 == r0) goto L_0x04d3;\n L_0x04bc:\n r4 = r9 - r8;\n r24 = trLog(r4);\n L_0x04c2:\n r17 = r37;\n r31 = r8 + -1;\n L_0x04c6:\n r0 = r17;\n if (r0 >= r8) goto L_0x04d6;\n L_0x04ca:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x04c6;\n L_0x04d3:\n r24 = -1;\n goto L_0x04c2;\n L_0x04d6:\n r0 = r38;\n if (r9 >= r0) goto L_0x04eb;\n L_0x04da:\n r17 = r8;\n r31 = r9 + -1;\n L_0x04de:\n r0 = r17;\n if (r0 >= r9) goto L_0x04eb;\n L_0x04e2:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x04de;\n L_0x04eb:\n r4 = r8 - r37;\n r5 = r38 - r9;\n if (r4 > r5) goto L_0x060c;\n L_0x04f1:\n r4 = r38 - r9;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x0571;\n L_0x04f7:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x051e;\n L_0x04fc:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r27] = r4;\n r38 = r8;\n r23 = r22;\n goto L_0x001a;\n L_0x051e:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x0538;\n L_0x0523:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r37 = r9;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0538:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x0549;\n L_0x053d:\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x0549:\n if (r28 != 0) goto L_0x054f;\n L_0x054b:\n r27 = r28;\n goto L_0x00f9;\n L_0x054f:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0571:\n r4 = r8 - r37;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x05c6;\n L_0x0577:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x059e;\n L_0x057c:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r27] = r4;\n r38 = r8;\n r23 = r22;\n goto L_0x001a;\n L_0x059e:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x05c0;\n L_0x05a3:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x05c0:\n r37 = r9;\n r23 = r22;\n goto L_0x001a;\n L_0x05c6:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x05f5;\n L_0x05cb:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r27] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x05f5:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r38 = r8;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x060c:\n r4 = r8 - r37;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x067b;\n L_0x0612:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x0639;\n L_0x0617:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r27] = r4;\n r37 = r9;\n r23 = r22;\n goto L_0x001a;\n L_0x0639:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x0653;\n L_0x063e:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r38 = r8;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0653:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x0664;\n L_0x0658:\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x0664:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r38;\n r3 = r22;\n r4.<init>(r0, r1, r2, r3);\n r29[r28] = r4;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x067b:\n r4 = r38 - r9;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x06d0;\n L_0x0681:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x06a8;\n L_0x0686:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r27] = r4;\n r37 = r9;\n r23 = r22;\n goto L_0x001a;\n L_0x06a8:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x06ca;\n L_0x06ad:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x06ca:\n r38 = r8;\n r23 = r22;\n goto L_0x001a;\n L_0x06d0:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x06ff;\n L_0x06d5:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r27] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x06ff:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r37 = r9;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0716:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 == 0) goto L_0x002f;\n L_0x0722:\n r22 = r22 + 1;\n r35 = r35 + 1;\n r23 = r22;\n goto L_0x001a;\n L_0x072a:\n r27 = r28;\n goto L_0x00f9;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: io.netty.handler.codec.compression.Bzip2DivSufSort.trIntroSort(int, int, int, int, int, io.netty.handler.codec.compression.Bzip2DivSufSort$TRBudget, int):void\");\n }",
"public void sort()\n\t{\n\t\tfor(int i=0;i<bowlers.size()-1;i++)\n\t\t{\n\t\t\tfor(int j=i+1;j<bowlers.size();j++)\n\t\t\t{\n\t\t\t\tif(bowlers.get(i).getBall()<bowlers.get(j).getBall())\n\t\t\t\t{\n\t\t\t\t\tBowler bowler=bowlers.get(i);\n\t\t\t\t\tbowlers.set(i,bowlers.get(j));\n\t\t\t\t\tbowlers.set(j,bowler);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<bowlers.size();i++)\n\t\t{\n\t\tSystem.out.println(bowlers.get(i).getBall());\n\t\t}\n\t}",
"@Override\r\n\tpublic void editSort() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void addSort() {\n\t\t\r\n\t}",
"@Override\n protected void runAlgorithm() {\n for (int i = 0; i < getArray().length; i++) {\n for (int j = i + 1; j < getArray().length; j++) {\n if (applySortingOperator(getValue(j), getValue(i))) {\n swap(i, j);\n }\n }\n }\n }",
"@Override\n\tvoid sort(int[] array, SortingVisualizer display) {\n\t\tSystem.out.println(\"a\");\n\t\tboolean sorted = false;\n\t\tboolean h = true;\n\t\twhile (sorted == false) {\nh=true;\n\t\t\t// System.out.println(\"1\");\n\t\t\tRandom x = new Random();\n\t\t\tint y = x.nextInt(array.length);\n\n\t\t\tint el1 = array[y];\n\t\t\tint z = x.nextInt(array.length);\n\t\t\tint el2 = array[z];\n\n\t\t\tarray[y] = el2;\n\t\t\tarray[z] = el1;\n\t\t\tfor (int i = 0; i < array.length - 1; i++) {\n/*\n\t\t\t\tif (array[i] < array[i + 1]) {\n\n\t\t\t\t\th = true;\n\n\t\t\t\t}*/\n\n\t\t\t\tif (array[i] > array[i + 1]) {\n\t\t\t\t\th = false;\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (h == true) {\n\n\t\t\t\tsorted = true;\n\t\t\t}\n\n\t\t\tdisplay.updateDisplay();\n\t\t\t\n\t\t}\n\t}",
"public List<SimulinkBlock> generateBlockOrder(UnmodifiableCollection<SimulinkBlock> unmodifiableCollection,\n\t\t\tSet<SimulinkBlock> unsortedBlocks) {\n\t\tSet<SimulinkBlock> unsorted = new HashSet<SimulinkBlock>();\n\t\tSet<SimulinkBlock> unsortedRev = new HashSet<SimulinkBlock>();\n\t\tList<SimulinkBlock> sorted = new LinkedList<SimulinkBlock>();\n\n\t\t// start with source blocks without input\n\t\tfor (SimulinkBlock block : unmodifiableCollection) {\n\t\t\tif (block.getInPorts().isEmpty()) {\n\t\t\t\tsorted.add(block);\n\t\t\t} else {\n\t\t\t\tunsorted.add(block);\n\t\t\t}\n\t\t}\n\n\t\tint sizeBefore = 0;\n\t\tint sizeAfter = 0;\n\t\tdo {\n\t\t\tsizeBefore = unsorted.size();\n\t\t\tfor (SimulinkBlock myBlock : unsorted) {\n\t\t\t\tunsortedRev.add(myBlock);\n\t\t\t}\n\t\t\tunsorted.clear();\n\t\t\tfor (SimulinkBlock block : unsortedRev) {\n\t\t\t\tboolean allPredeccesorsAvailable = specialBlockChecking(block, sorted);\n\t\t\t\tif (allPredeccesorsAvailable) {\n\t\t\t\t\tsorted.add(block);\n\t\t\t\t} else {\n\t\t\t\t\tunsorted.add(block);\n\t\t\t\t}\n\t\t\t}\n\t\t\tsizeAfter = unsorted.size();\n\t\t\tunsortedRev.clear();\n\t\t} while ((!(unsorted.isEmpty())) && (!(sizeBefore == sizeAfter)));\n\n\t\tfor (SimulinkBlock block : unsorted) {\n\t\t\t// TODO sort the last unsorted blocks\n\t\t\tPluginLogger\n\t\t\t\t\t.info(\"Currently unsorted after sorting : \" + block.getName() + \" of type \" + block.getType());\n\t\t\tsorted.add(block);\n\t\t\tunsortedBlocks.add(block);\n\t\t}\n\t\treturn sorted;\n\t}",
"@Test\n public void doubleSortWithExchangeUnbalancedNodes() {\n ExternalSort es1 = new ExternalSort(OpProps.prototype(0, Long.MAX_VALUE).cloneWithMemoryExpensive(true).cloneWithMemoryFactor(options.getOption(SORT_FACTOR)).cloneWithBound(options.getOption(SORT_BOUNDED)), ARBTRIARY_LEAF, Collections.emptyList(), false);\n SingleSender ss = new SingleSender(OpProps.prototype(1, Long.MAX_VALUE).cloneWithMemoryFactor(options.getOption(SORT_FACTOR)).cloneWithBound(options.getOption(SORT_BOUNDED)), Mockito.mock(BatchSchema.class), es1, 0,\n MinorFragmentIndexEndpoint.newBuilder().setMinorFragmentId(0).build());\n Fragment f1 = new Fragment();\n f1.addOperator(ss);\n Wrapper w1 = new Wrapper(f1, 0);\n w1.overrideEndpoints(Arrays.asList(N1, N2));\n\n UnorderedReceiver or = new UnorderedReceiver(OpProps.prototype(1, Long.MAX_VALUE), Mockito.mock(BatchSchema.class), 0, Collections.emptyList(), false);\n ExternalSort es2 = new ExternalSort(OpProps.prototype(0, Long.MAX_VALUE).cloneWithMemoryExpensive(true).cloneWithMemoryFactor(options.getOption(SORT_FACTOR)).cloneWithBound(options.getOption(SORT_BOUNDED)), or, Collections.emptyList(), false);\n Fragment f2 = new Fragment();\n f2.addOperator(es2);\n Wrapper w2 = new Wrapper(f2, 0);\n w2.overrideEndpoints(Collections.singletonList(N1));\n\n\n MemoryAllocationUtilities.setMemory(options, ImmutableMap.of(f1, w1, f2, w2), 10 + adjustReserve);\n assertEquals(3L, es1.getProps().getMemLimit());\n assertEquals(3L, es2.getProps().getMemLimit());\n }",
"@Override\n\t\tpublic void run() {\n\t\t\tfor (int i = 0; i < 1000000; i++) {\n\t\t\t\tint[] a = Util.generateRandomArray(500, 200000);\n\t\t\t\tint[] b = a.clone();\n\t\t\t\t\n\t\t\t\ta = sort(a);\n\t\t\t\tArrays.sort(b);\n\t\t\t\t\n\t\t\t\tfor (int j = 0; j < b.length; j++) {\n\t\t\t\t\tUtil.Assert(a[j] == b[j], \"shit\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Heap sort ok\");\n\t\t}",
"private Sort() { }",
"public void sort() {\n\t\tSystem.out.println(\"Quick Sort Algorithm invoked\");\n\n\t}",
"@Override\n public void sortCurrentList(FileSortHelper sort) {\n }",
"public String doSort();",
"public void sortArray() {\n\t\tSystem.out.println(\"QUICK SORT\");\n\t}",
"@Override\n public void sort() throws IOException {\n long i = 0;\n // j represents the turn of writing the numbers either to g1 or g2 (or viceversa)\n long j = 0;\n long runSize = (long) Math.pow(2, i);\n long size;\n\n long startTime = System.currentTimeMillis();\n\n System.out.println(\"Strart sorting \"+ this.inputFileName);\n\n while(i <= Math.ceil(Math.log(this.n) / Math.log(2))){\n j = 0;\n do{\n size = merge(runSize, destinationFiles[(int)j % 2]);\n j += 1;\n }while (size/2 == runSize);\n\n System.out.println(\"iteration: \" + i + \", Run Size:\" + runSize + \", Total time elapsed: \" + (System.currentTimeMillis() - startTime));\n i += 1;\n runSize = (long) Math.pow(2, i);\n swipe();\n }\n System.out.println(\"The file has been sorted! Total time elapsed: \"+(System.currentTimeMillis() - startTime));\n\n destinationFiles[0].close();\n destinationFiles[1].close();\n originFiles[0].close();\n originFiles[1].close();\n\n createFile(OUT_PATH +inputFileName);\n copyFile(new File(originFileNames[0]), new File(\"out/TwoWayMergesort/OUT_\"+inputFileName));\n\n }",
"private void updateOrder() {\n Arrays.sort(positions);\n }",
"@Override\n public void sort() {\n for (int i = 0; i < size; i++) {\n for (int j = i + 1; j < size; j++) {\n if (((Comparable) data[i]).compareTo(data[j]) > 0) {\n E c = data[i];\n data[i] = data[j];\n data[j] = c;\n\n }\n }\n }\n }",
"void order() {\n for (int i = 0; i < numVertices; i++) {\n if (simp[i][numParams] < simp[best][numParams]) {\n best = i;\n }\n if (simp[i][numParams] > simp[worst][numParams]) {\n worst = i;\n }\n }\n nextWorst = best;\n for (int i = 0; i < numVertices; i++) {\n if (i != worst) {\n if (simp[i][numParams] > simp[nextWorst][numParams]) {\n nextWorst = i;\n }\n }\n }\n }",
"public void shellSort(int[] a) \n {\n int increment = a.length / 2;\n while (increment > 0) \n {\n \n for (int i = increment; i < a.length; i++) //looping over the array\n {\n int j = i;\n int temp = a[i]; // swapping the values to a temporary array\n try\n {\n if(!orderPanel) // checking for Descending order\n {\n while (j >= increment && a[j - increment] > temp) \n {\n a[j] = a[j - increment]; //swapping the values\n thread.sleep(100);\n repaint();\n this.setThreadState();\n j = j - increment;\n }\n }\n \n else\n {\n while (j >= increment && a[j - increment] < temp) //checking for Ascending order\n {\n a[j] = a[j - increment];\n thread.sleep(200);\n repaint();\n this.setThreadState();\n j = j - increment;\n }\n \n }\n }\n catch(Exception e)\n {\n System.out.println(\"Exception occured\" + e);\n }\n a[j] = temp;\n }\n \n if (increment == 2) \n {\n increment = 1;\n } \n else \n {\n increment *= (5.0 / 11);\n }\n }\n }",
"void sort();",
"void sort();",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e)\n\t\t\t{\n\t\t\t\tif (currentSize >= size)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"MERGESORT END\");\n\t\t\t\t\ttimer.stop();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// deciding the block to to merged\n\t\t\t\telse if (mergeSortCodeFlag == 1)\n\t\t\t\t{\n\t\t\t\t\tif (leftStart >= size - 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tcurrentSize = currentSize * 2;\n\t\t\t\t\t\tleftStart = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tmid = leftStart + currentSize - 1;\n\t\t\t\t\t\tif (leftStart + 2 * currentSize - 1 >= size - 1)\n\t\t\t\t\t\t\trightEnd = size - 1;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\trightEnd = leftStart + 2 * currentSize - 1;\n\t\t\t\t\t\tbox.setBaseColor(BASE_COLOR);\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tmergeSortDelayFlag1 = 1;\n\t\t\t\t\t\tmergeSortdelay1 = 0;\n\t\t\t\t\t\tmergeSortCodeFlag = 0;\n\t\t\t\t\t\tif(mid >= rightEnd)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tleftStart += 2 * currentSize;\n\t\t\t\t\t\t\tmergeSortDelayFlag1 = 0;\n\t\t\t\t\t\t\tmergeSortCodeFlag = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (mergeSortDelayFlag1 == 1)\n\t\t\t\t{\n\t\t\t\t\tmergeSortdelay1++;\n\t\t\t\t\tif (mergeSortdelay1 >= DELAY)\n\t\t\t\t\t{\n\t\t\t\t\t\tl = leftStart;\n\t\t\t\t\t\tm = mid;\n\t\t\t\t\t\tr = rightEnd;\n\t\t\t\t\t\tmergeSortDelayFlag1 = 0;\n\t\t\t\t\t\tmergeInitializeFlag = 1;\n\t\t\t\t\t\tleftStart += 2 * currentSize;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Merging the block selected\n\t\t\t\t\n\t\t\t\t// initializing the variables needed by the merge block \n\t\t\t\telse if (mergeInitializeFlag == 1)\n\t\t\t\t{\n\t\t\t\t\ti = l;\n\t\t\t\t\tj = m + 1;\n\t\t\t\t\tindex = 0;\n\t\t\t\t\tcurrentDownCount = 0;\n\t\t\t\t\tindexRightCount = 0;\n\t\t\t\t\tcurrentLeftCount = 0;\n\t\t\t\t\tcurrentUpCount = 0;\n\t\t\t\t\tcodeFlag = 1;\n\t\t\t\t\trightFlag = 0;\n\t\t\t\t\trightBlockFlag = 0;\n\t\t\t\t\tdownFlag = 0;\n\t\t\t\t\tupFlag = 0;\n\t\t\t\t\tleftFlag = 0;\n\t\t\t\t\tdelay1 = 0;\n\t\t\t\t\tdelayFlag1 = 0;\n\t\t\t\t\tdelay2 = 0;\n\t\t\t\t\tdelayFlag2 = 0;\n\t\t\t\t\tcolorFlag1 = 1;\n\t\t\t\t\tcolorDelayFlag1 = 0;\n\t\t\t\t\tcolorDelay1 = 0;\n\t\t\t\t\tcolorFlag2 = 1;\n\t\t\t\t\tcolorDelayFlag2 = 0;\n\t\t\t\t\tcolorDelay2 = 0;\n\t\t\t\t\tbox.setBaseColor(BASE_COLOR);\n\t\t\t\t\tbox.setColorRange(l, m, BLOCK_COLOR1);\n\t\t\t\t\tbox.setColorRange(m + 1, r, BLOCK_COLOR2);\n\t\t\t\t\tpaintBox();\n\t\t\t\t\t\n\t\t\t\t\tmergeFlag = 1;\n\t\t\t\t\tmergeInitializeFlag = 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// actual merging starts here\n\t\t\t\telse if (mergeFlag == 1)\n\t\t\t\t{\n\t\t\t\t\t// step zero check whether to continue merging or not\n\t\t\t\t\tif (j > r)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (i >= j)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmergeFlag = 0;\n\t\t\t\t\t\t\tmergeSortCodeFlag = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (colorFlag1 == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbox.getRectangle(i).setColor(END_COLOR);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\tcolorDelay1 = 0;\n\t\t\t\t\t\t\tcolorDelayFlag1 = 1;\n\t\t\t\t\t\t\tcolorFlag1 = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (colorDelayFlag1 == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcolorDelay1++;\n\t\t\t\t\t\t\tif (colorDelay1 >= DELAY)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\tcolorDelayFlag1 = 0;\n\t\t\t\t\t\t\t\tcolorFlag1 = 1;\n\t\t\t\t\t\t\t\tcolorDelay1 = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse if (i >= j)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (j > r)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmergeFlag = 0;\n\t\t\t\t\t\t\tmergeSortCodeFlag = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (colorFlag2 == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbox.getRectangle(j).setColor(END_COLOR);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\tcolorDelay2 = 0;\n\t\t\t\t\t\t\tcolorDelayFlag2 = 1;\n\t\t\t\t\t\t\tcolorFlag2 = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (colorDelayFlag2 == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcolorDelay2++;\n\t\t\t\t\t\t\tif (colorDelay2 >= DELAY)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t\t\tcolorDelayFlag2 = 0;\n\t\t\t\t\t\t\t\tcolorFlag2 = 1;\n\t\t\t\t\t\t\t\tcolorDelay2 = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Step one Check whether a[i] <= a[j]\n\t\t\t\t\telse if (codeFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tRectangle currRect = box.getRectangle(i);\n\t\t\t\t\t\tRectangle scanRect = box.getRectangle(j);\n\t\t\t\t\t\tcurrRect.setColor(FOCUS_COLOR1);\n\t\t\t\t\t\tscanRect.setColor(FOCUS_COLOR2);\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tdelayFlag2 = 1;\n\t\t\t\t\t\tcodeFlag = 0;\n\t\t\t\t\t\tdelay2 = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse if (delayFlag2 == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tdelay2++;\n\t\t\t\t\t\tif (delay2 >= DELAY)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tRectangle currRect = box.getRectangle(i);\n\t\t\t\t\t\t\tRectangle scanRect = box.getRectangle(j);\n\t\t\t\t\t\t\tif (currRect.getData() < scanRect.getData())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbox.getRectangle(i).setColor(END_COLOR);\n\t\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\t\tdelay1 = 0;\n\t\t\t\t\t\t\t\tdelayFlag2 = 0;\n\t\t\t\t\t\t\t\tdelayFlag1 = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbox.getRectangle(j).setColor(END_COLOR);\n\t\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\t\tdelayFlag2 = 0;\n\t\t\t\t\t\t\t\tdownFlag = 1;\n\t\t\t\t\t\t\t\tcurrentDownCount = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (delayFlag1 == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tdelay1++;\n\t\t\t\t\t\tif (delay1 >= DELAY)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcodeFlag = 1;\n\t\t\t\t\t\t\tdelayFlag1 = 0;\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Moving the first rectangle on right down (if it was smaller than the first one on the left)\n\t\t\t\t\telse if (downFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.addOffsetRectangle(j, 0, YCHANGE);\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tcurrentDownCount += YCHANGE;\n\t\t\t\t\t\tif (currentDownCount >= DOWN)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint excess = currentDownCount - DOWN;\n\t\t\t\t\t\t\tbox.addOffsetRectangle(j, 0, -excess);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\tdownFlag = 0;\n\t\t\t\t\t\t\trightBlockFlag = 1;\n\t\t\t\t\t\t\tindexRightCount = 0;\n\t\t\t\t\t\t\tindex = j - 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// moving each of the rectangles in the block to the right(between the two smallest rectangle on both side)\n\t\t\t\t\t// including the first rectangle\n\t\t\t\t\telse if (rightBlockFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (index < i)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trightBlockFlag = 0;\n\t\t\t\t\t\t\tleftFlag = 1;\n\t\t\t\t\t\t\tcurrentLeftCount = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trightFlag = 1;\n\t\t\t\t\t\t\trightBlockFlag = 0;\n\t\t\t\t\t\t\tindexRightCount = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// moving a rectangle in the block to the right\n\t\t\t\t\telse if (rightFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.addOffsetRectangle(index, XCHANGE, 0);\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tindexRightCount += XCHANGE;\n\t\t\t\t\t\tif (indexRightCount >= width)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint excess = indexRightCount - width;\n\t\t\t\t\t\t\tbox.addOffsetRectangle(index, -excess, 0);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\trightFlag = 0;\n\t\t\t\t\t\t\trightBlockFlag = 1;\n\t\t\t\t\t\t\tindex--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// moving the rectangle left (the smallest in the un-merged block)\n\t\t\t\t\telse if (leftFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.addOffsetRectangle(j, -XCHANGE, 0);\n\t\t\t\t\t\tcurrentLeftCount += XCHANGE;\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tif (currentLeftCount >= width * (j - i))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint excess = currentLeftCount - width * (j - i);\n\t\t\t\t\t\t\tbox.addOffsetRectangle(j, excess, 0);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tleftFlag = 0;\n\t\t\t\t\t\t\tupFlag = 1;\n\t\t\t\t\t\t\tcurrentUpCount = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// moving the rectangle up (the smallest in the un-merged block)\n\t\t\t\t\telse if (upFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.addOffsetRectangle(j, 0, -YCHANGE);\n\t\t\t\t\t\tcurrentUpCount += YCHANGE;\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tif (currentUpCount >= DOWN)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint excess = currentUpCount - DOWN;\n\t\t\t\t\t\t\tbox.addOffsetRectangle(j, 0, excess);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tRectangle smallestRect = box.getRectangle(j);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (int t = j - 1; t >= i; t--)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbox.setRectangle(box.getRectangle(t), t + 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbox.setRectangle(smallestRect, i);\n\t\t\t\t\t\t\tupFlag = 0;\n\t\t\t\t\t\t\tcodeFlag = 1;\n\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"private void externalSort() throws IOException{\n\t\t/*\n\t\t * Pass 0: internal sort\n\t\t */\n\t\t// Read in from child;Write out runs of B pages;\n\t\t\n\t\tint numPerRun = B * 4096 / (schema.size() * 4); // # of tuples per run given in Pass0\n\t\tboolean buildMore;\n\t\tint numRuns = 0;\n\t\tif(sortAttrsIndex == null) {\n\t\t\tthis.buildAttrsIndex();\n\t\t}\n\t\texComparator myComp = new exComparator();\n\t\tinternal = new PriorityQueue<Tuple>(myComp);\n\t\tdo {\n\t\t\tbuildMore = this.buildHeap(numPerRun);\n\t\t\tnumRuns++;\n\t\t\t\n\t\t\t// write out the (numRuns)th run\n\t\t\tTupleWriter TW;\n\t\t\tif(!buildMore && numRuns == 1) {\n\t\t\t\tTW = new TupleWriter(new FileOutputStream(tempsubdir + \"sortResult\"));\n\t\t\t} else {\n\t\t\t\tTW = new TupleWriter(new FileOutputStream(tempsubdir + \"0_\" + numRuns));\n\t\t\t}\n\t\t\twhile(!internal.isEmpty()) {\n//\t\t\t\tSystem.out.println(internal.peek().data);\n\t\t\t\tTW.setNextTuple(internal.poll()); \n\t\t\t}\n\t\t\t// leftover, fill with zero and write out\n\t\t\tif(!TW.bufferEmpty()) { // TW would never know the end of writing\n\t\t\t\tTW.fillFlush(); \n\t\t\t}\n\t\t\tTW.close();\n\t\t\t// internal must be empty until this point\n\t\t}while (buildMore);\n\t\t\n\t\t/*\n\t\t * Pass 1 and any following\n\t\t */\n\t\tif(numRuns > 1) { // if numRuns generated in Pass 0 is 1 already, file sorted already, no need to merge\n\t\t\tthis.merge(numRuns, myComp);\n\t\t}\n\t\t\n\t}",
"public void sortByLength()\n {\n boolean swapMade;//has a swap been made in the most recent pass?\n \n //repeat looking for swaps\n do\n {\n swapMade=false;//just starting this pass, so no swap yet\n \n //go through entire array. looking for swaps that need to be done\n for(int i = 0; i<currentRide-1; i++)\n {\n //if the other RideLines has less people\n if(rides[i].getCurrentPeople()<rides[i+1].getCurrentPeople())\n {\n // standard swap, using a temporary. swap with less people\n RideLines temp = rides[i];\n rides[i]=rides[i+1];\n rides[i+1]=temp;\n \n swapMade=true;//remember this pass made at least one swap\n }\n \n } \n }while(swapMade);//until no swaps were found in the most recent past\n \n redrawLines();//redraw the image\n \n }",
"private void sortByAmount(){\n int stopPos = 0;\n while(colours.size()-stopPos > 0){\n int inARow = 1;\n for(int i = colours.size() - 1; i > stopPos; i--){\n if(colours.get(i-1).getAmount() < colours.get(i).getAmount()){\n rgb temp = new rgb(colours.get(i-1));\n colours.set(i-1, colours.get(i));\n colours.set(i, temp);\n }else{\n inARow++;\n }\n }\n stopPos++;\n if(inARow == colours.size()){\n break;\n }\n }\n }",
"public static void specialSets() {\n\t\tSystem.out.printf(\"%12s%15s%15s%10s%10s%10s%10s%n\",\"Size\",\"Range\",\"Pre-Sort Type\",\"Insertion\",\"Selectuon\",\"Quick\",\"Merge\");\n\t\tint[] array;\n\t\t//200K\n\t\tSystem.out.printf(\"%12d%15s%15s\",200000,\"1-200k\",\"N/A\");\n\t\tarray = generateArray(200000, 1, 200000);\n\t\tfourSorts(array);\n\t\tSystem.out.println();\n\t\t//Sorted array\n\t\tSystem.out.printf(\"%12d%15s%15s\",200000,\"1-200k\",\"Sorted\");\n\t\tfourSorts(array);\n\t\tSystem.out.println();\n\t\t//Reverse Sorted\n\t\tSystem.out.printf(\"%12d%15s%15s\",200000,\"1-200k\",\"Reverse Sorted\");\n\t\tint[] temp = new int[array.length];\n\t\tfor(int i = 0; i < array.length; i++) {\n\t\t\ttemp[i] = array[array.length -1 -i];\n\t\t}\n\t\tfourSorts(temp);\n\t\tSystem.out.println();\n\t\t//Range 1-20\n\t\tSystem.out.printf(\"%12d%15s%15s\",200000,\"1-20\",\"N/A\");\n\t\tarray = generateArray(200000, 1, 20);\n\t\tfourSorts(array);\n\t\tSystem.out.println();\n\t}",
"public void selectionSort()\r\n {\r\n for(int x = 0; x < numItems; x++)\r\n {\r\n int smallestLoc = x;\r\n for(int y = x+1; y<numItems; y++)\r\n {\r\n if(mArray[y]< mArray[smallestLoc])\r\n {\r\n smallestLoc = y;\r\n }\r\n }\r\n int temp = mArray[x];\r\n mArray[x] = mArray[smallestLoc];\r\n mArray[smallestLoc] = temp;\r\n }\r\n }",
"public void sortCompetitors(){\n\t\t}",
"public void sortPassing(){\n\t\tpassing.sort(PlayingCard.PlayingCardComparator_ACEHIGH);\n\t}",
"@Override\n\tvoid sort(int[] arr, SortingVisualizer display) {\n\t\tint current = 0;\n\t\tint x;\n\t\tint y;\n\t\tboolean complete = false;\n\t\twhile(complete == false) {\n\t\t\tcurrent = 0;\n\t\t\tcomplete = true;\n\t\t\tfor(int i = 0 ; i < arr.length; i ++) {\n\t\t\t\tdisplay.updateDisplay();\n\t\t\t\tif(arr[current] > arr[i]) {\n\t\t\t\t\tx = arr[i];\n\t\t\t\t\ty = arr[current];\n\t\t\t\t\tarr[i] = y;\n\t\t\t\t\tarr[current] = x;\n\t\t\t\t\tcomplete = false;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\tcurrent = i;\n\t\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public BucketSort()\n {\n for(int i = 0; i < 30; i++)\n {\n a[i] = generator.nextInt(50)+1;\n b[i] = a[i];\n }\n }",
"@Override\n\tpublic void setSortCounters(boolean sortCounters) {\n\t\t\n\t}",
"public void sort() {\n /*int jokers = this.getJokers();\n\t\tif (jokers > 0 && this.size() > 2) {\n\t\t\tArrayList<Tile> list = new ArrayList<>();\n for (int i=0; i<this.size(); i++) {\n\t\t\t\tif (this.get(i).getColour() == 'J') {\n\t\t\t\t\tTile joker = this.remove(this.get(i));\n\t\t\t\t\tlist.add(joker);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (Tile j : list) {\n\t\t\t\tthis.addInSort(j);\n\t\t\t}\n }*/\n \n\n //may need something in here to accomodate a joker changing its form\n\n if (tiles.size() > 1) { //will only sort a meld with any tiles in it\n //Override default comparator to compare by tile value (ints)\n Collections.sort(tiles, new Comparator<Tile>() {\n @Override \n public int compare(Tile t1, Tile t2) { \n if (t1.getColour() > t2.getColour()) {\n return 1;\n } else if (t1.getColour() < t2.getColour()) {\n return -1;\n }\n if (t1.getValue() > t2.getValue()) {\n return 1;\n } else if (t1.getValue() < t2.getValue()) {\n return -1;\n } else {\n return 0;\n }\n }\n });\n }\n\n }",
"public void sort() {\n\n // Fill in the blank here.\n\tfor(int i = 0; i < size; i++){\n\t\tint currentLowest, cLIndex, temp;\n\t\tcurrentLowest = elements[i];\n\t\tcLIndex = i; \n\t\tfor(int c = i+1; c < size; c++){\n\t\t\tif(currentLowest > elements[c]){\n\t\t\t\tcurrentLowest = elements[c];\n\t\t\t\tcLIndex = c;\n\t\t\t} \n\t\t}\n\t\ttemp = elements[i];\n\t\telements[i] = elements[cLIndex];\n\t\telements[cLIndex] = temp;\n\t\t\n\t}\n System.out.println(\"Sorting...\");\n }",
"private void setup() {\r\n final int gsz = _g.getNumNodes();\r\n if (_k==2) {\r\n\t\t\tNodeComparator2 comp = new NodeComparator2();\r\n\t\t\t_origNodesq = new TreeSet(comp);\r\n\t\t} else { // _k==1\r\n\t\t\tNodeComparator4 comp = new NodeComparator4();\r\n\t\t\t_origNodesq = new TreeSet(comp);\r\n\t\t}\r\n for (int i=0; i<gsz; i++) {\r\n _origNodesq.add(_g.getNodeUnsynchronized(i)); // used to be _g.getNode(i)\r\n }\r\n _nodesq = new TreeSet(_origNodesq);\r\n //System.err.println(\"done sorting\");\r\n }",
"public void changeSortOrder();",
"private void sortEntities(){\n for (int i = 1; i < sorted.size; i++) {\n for(int j = i ; j > 0 ; j--){\n \tEntity e1 = sorted.get(j);\n \tEntity e2 = sorted.get(j-1);\n if(getRL(e1) < getRL(e2)){\n sorted.set(j, e2);\n sorted.set(j-1, e1);\n }\n }\n }\n }",
"private static void selectionSort(ArrayList<Box> BoxArray) { \n\n\t\tfor ( int i = 0; i < BoxArray.size(); i++ ) { \n\t\t\tint lowPos = i; \n\t\t\tfor ( int j = i + 1; j < BoxArray.size(); j++ ) \n\t\t\t\tif ( BoxArray.get(j).volume() < BoxArray.get(lowPos).volume() ) \n\t\t\t\t\tlowPos = j;\n\t\t\tif ( BoxArray.get(lowPos) != BoxArray.get(i) ) { \n\t\t\t\tBox temp = BoxArray.get(lowPos);\n\t\t\t\tBoxArray.set(lowPos, BoxArray.get(i));\n\t\t\t\tBoxArray.set(i, temp);\n\t\t\t}\n\t\t}\n\t}",
"public void sort() {\n\t\t\tfor (int j = nowLength - 1; j > 1; j--) {\n\t\t\t\tfor (int i = 0; i < j; i++) {\n\t\t\t\t\tif (ray[i] > ray[i+1]) {\n\t\t\t\t\t\tint tmp = ray [i];\n\t\t\t\t\t\tray[i] = ray[i+1];\n\t\t\t\t\t\tray[i+1] = tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tprint();\n\t\t\t}\n\t}",
"public BubSortList() {\n\t\tray = new int[MAXSIZE];\n\t\tnowLength = 0;\n\t}",
"public static void s1AscendingTest() {\n int key = 903836722;\n SortingLab<Integer> sli = new SortingLab<Integer>(key);\n int M = 600000;\n int N = 1000;\n double start;\n double elapsedTime;\n System.out.print(\"Sort 1 Ascending\\n\");\n for (; N < M; N *= 2) {\n Integer[] ai = getRandomArray(N, Integer.MAX_VALUE);\n Arrays.sort(ai);\n start = System.nanoTime();\n sli.sort1(ai);\n elapsedTime = (System.nanoTime() - start) / 1_000_000_000d;\n System.out.print(N + \"\\t\");\n System.out.printf(\"%4.3f\\n\", elapsedTime);\n }\n }",
"public void sortByDefault() {\r\n\t\tcomparator = null;\r\n\t}",
"public static int[] partialSort(int[] a) {\n for (int i = 0; i < 2; i++) {\n for (int j = 0; j < 2 - i; j++) {\n if (a[j] > a[j+1]) {\n int temp = a[j+1];\n a[j+1] = a[j];\n a[j] = temp;\n }\n }\n }\n return a;\n}",
"public void setSortOnCPUTime() {\n this.sortedJobList = new TreeSet<Job>(new Comparator<Job>() {\n @Override\n public int compare(Job a, Job b) {\n\n int aCPUUsed = 0;\n int bCPUUsed = 0;\n\n try {\n aCPUUsed = a.getCPUUsed();\n bCPUUsed = b.getCPUUsed();\n } catch (AS400SecurityException e) {\n e.printStackTrace();\n } catch (ErrorCompletingRequestException e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ObjectDoesNotExistException e) {\n e.printStackTrace();\n }\n\n if (aCPUUsed == bCPUUsed) return 0;\n else return bCPUUsed - aCPUUsed;\n }\n });\n }",
"@Override\n \tpublic void sort() {\n \t\tArrays.sort(data);\n \t}",
"public void sortOccurred() {\n //SET ALL THE ROWS TO -1, (THEY INITIALIZE TO 0).\n \tfor(int i = 0; i < data.length; i++) {\n \t\tdata[i] = null;\n \t\trowIndexLookup[i] = -1;\n \t}\t\t\n }",
"public void doTheAlgorithm() {\n this.swapCount = 0;\n this.compCount = 0;\n \n\t\tdoQuickSort(0, this.sortArray.length - 1);\n\t}",
"@VTID(28)\n boolean getSortUsingCustomLists();",
"private void sort()\n {\n // This implements Shell sort.\n // Unfortunately we cannot use the sorting functions from the library\n // (e.g. java.util.Arrays.sort), since the ones that work on int\n // arrays do not accept a comparison function, but only allow\n // sorting into natural order.\n int jump = length;\n boolean done;\n \n while( jump>1 ){\n jump /= 2;\n \n do {\n done = true;\n \n for( int j = 0; j<(length-jump); j++ ){\n int i = j + jump;\n \n if( !areCorrectlyOrdered( indices[j], indices[i] ) ){\n // Things are in the wrong order, swap them and step back.\n int tmp = indices[i];\n indices[i] = indices[j];\n indices[j] = tmp;\n done = false;\n }\n }\n } while( !done );\n }\n \n // TODO: integrate this with the stuff above.\n for( int i=1; i<length; i++ ){\n commonality[i] = commonLength( indices[i-1], indices[i] );\n }\n commonality[0] = -1;\n }",
"public void sort() {\n Collections.sort(jumpers, new SortJumperByPoints()); \n }",
"private static void sort2(int[] a) {\n for(int i=0; i<a.length; i++){\n //find smallest from i to end \n int minIndex=i;\n for(int j=i ; j<a.length; j++)\n if(a[j]<a[minIndex])\n minIndex=j;\n //swap\n int t = a[i];\n a[i] = a[minIndex];\n a[minIndex] = t;\n }\n }",
"void sortV();",
"private void sortAndEmitUpTo(double maxX)\n {\n /**\n * Heuristic: Check if there are no obvious segments to process\n * and skip sorting & processing if so\n * \n * This is a heuristic only.\n * There may be new segments at the end of the buffer\n * which are less than maxx. But this should be rare,\n * and they will all get processed eventually.\n */\n if (bufferHeadMaxX() >= maxX)\n return;\n \n // this often sorts more than are going to be processed.\n //TODO: Can this be done faster? eg priority queue?\n \n // sort segs in buffer, since they arrived in potentially unsorted order\n Collections.sort(segmentBuffer, ORIENT_COMPARATOR);\n int i = 0;\n int n = segmentBuffer.size();\n LineSeg prevSeg = null;\n \n //reportProcessed(maxX);\n \n while (i < n) {\n LineSeg seg = (LineSeg) segmentBuffer.get(i);\n if (seg.getMaxX() >= maxX)\n \tbreak;\n \n i++;\n if (removeDuplicates) {\n if (prevSeg != null) {\n // skip this segment if it is a duplicate\n if (prevSeg.equals(seg)) {\n // merge in side label of dup seg\n prevSeg.merge(seg);\n continue;\n }\n }\n prevSeg = seg;\n }\n // remove interior segments (for dissolving)\n if (removeInteriorSegs\n && seg.getTopoLabel() == TopologyLabel.BOTH_INTERIOR)\n continue;\n \n segSink.process(seg);\n }\n //System.out.println(\"SegmentStreamSorter: total segs = \" + n + \", processed = \" + i);\n removeSegsFromBuffer(i);\n }",
"public void sort(){\n for(int i = array.length-1;i >= 0;i--){\n sink(i);\n }\n while(size > 0){\n swap(0, size-1);\n size -= 1;\n sink(0);\n }\n }",
"public static void main(String[] args) throws FileNotFoundException{\n int[] quicktimes1 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes1[i] = (int)endTime;\n }\n \n int[] mergetimes1 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes1[i] = (int)endTime;\n }\n \n int[] heaptimes1 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes1[i] = (int)endTime;\n }\n \n int[] quicktimes2 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[i] = j;\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes2[i] = (int)endTime;\n }\n \n int[] mergetimes2 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes2[i] = (int)endTime;\n }\n \n int[] heaptimes2 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes2[i] = (int)endTime;\n }\n \n int[] quicktimes3 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes3[i] = (int)endTime;\n }\n \n int[] mergetimes3 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes3[i] = (int)endTime;\n }\n \n int[] heaptimes3 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes3[i] = (int)endTime;\n }\n \n int[] quicktimes4 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes4[i] = (int)endTime;\n }\n \n int[] mergetimes4 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes4[i] = (int)endTime;\n }\n \n int[] heaptimes4 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes4[i] = (int)endTime;\n }\n \n \n //THESE WILL GENERATE THE MERGE/HEAP/QUICK SORT FOR THE REVERSE SORTED ARRAYS OF VARIOUS LENGTHS\n int[] quicktimes5 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes5[i] = (int)endTime;\n }\n \n int[] mergetimes5 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes5[i] = (int)endTime;\n }\n \n int[] heaptimes5 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes5[i] = (int)endTime;\n }\n \n int[] quicktimes6 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes6[i] = (int)endTime;\n }\n \n int[] mergetimes6 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes6[i] = (int)endTime;\n }\n \n int[] heaptimes6 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes6[i] = (int)endTime;\n }\n \n int[] quicktimes7 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes7[i] = (int)endTime;\n }\n \n int[] mergetimes7 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes7[i] = (int)endTime;\n }\n \n int[] heaptimes7 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes7[i] = (int)endTime;\n }\n \n int[] quicktimes8 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes8[i] = (int)endTime;\n }\n \n int[] mergetimes8 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes8[i] = (int)endTime;\n }\n \n int[] heaptimes8 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes8[i] = (int)endTime;\n }\n \n //THESE WILL GENERATE THE MERGE/HEAP/QUICK SORT FOR THE RANDOM ARRAYS OF VARIOUS LENGTHS\n int[] quicktimes9 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999);\n long startTime = System.nanoTime();\n Sorting.quickSort(rarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes9[i] = (int)endTime;\n }\n \n int[] mergetimes9 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999);\n long startTime = System.nanoTime();\n Sorting.mergeSort(rarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes9[i] = (int)endTime;\n }\n \n int[] heaptimes9 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999);\n long startTime = System.nanoTime();\n Sorting.heapSort(rarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes9[i] = (int)endTime;\n }\n \n int[] quicktimes10 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[10000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(9999);\n long startTime = System.nanoTime();\n Sorting.quickSort(rarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes10[i] = (int)endTime;\n }\n \n int[] mergetimes10 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[10000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(9999);\n long startTime = System.nanoTime();\n Sorting.mergeSort(rarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes10[i] = (int)endTime;\n }\n \n int[] heaptimes10 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[10000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(9999);\n long startTime = System.nanoTime();\n Sorting.heapSort(rarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes10[i] = (int)endTime;\n }\n \n int[] quicktimes11 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[100000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(99999);\n long startTime = System.nanoTime();\n Sorting.quickSort(rarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes11[i] = (int)endTime;\n }\n \n int[] mergetimes11 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[100000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(99999);\n long startTime = System.nanoTime();\n Sorting.mergeSort(rarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes11[i] = (int)endTime;\n }\n \n int[] heaptimes11 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[100000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(99999);;\n long startTime = System.nanoTime();\n Sorting.heapSort(rarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes11[i] = (int)endTime;\n }\n \n int[] quicktimes12 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999999);\n long startTime = System.nanoTime();\n Sorting.quickSort(rarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes12[i] = (int)endTime;\n }\n \n int[] mergetimes12 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999999);\n long startTime = System.nanoTime();\n Sorting.mergeSort(rarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes12[i] = (int)endTime;\n }\n \n int[] heaptimes12 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999999);\n long startTime = System.nanoTime();\n Sorting.heapSort(rarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes12[i] = (int)endTime;\n }\n \n //PRINTING THE RESULTS OUT INTO FILE\n File f = new File(\"Results.txt\");\n FileOutputStream fos = new FileOutputStream(f);\n PrintWriter pw = new PrintWriter(fos);\n pw.println(\"SORTED ARRAYS TIMES:\");\n pw.printf(\"1000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes1), medVal(quicktimes1), varVal(quicktimes1, meanVal(quicktimes1)));\n pw.printf(\"10000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes2), medVal(quicktimes2), varVal(quicktimes2, meanVal(quicktimes2)));\n pw.printf(\"100000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes3), medVal(quicktimes3), varVal(quicktimes3, meanVal(quicktimes3)));\n pw.printf(\"1000000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes4), medVal(quicktimes4), varVal(quicktimes4, meanVal(quicktimes4)));\n pw.printf(\"1000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes1), medVal(mergetimes1), varVal(mergetimes1, meanVal(mergetimes1)));\n pw.printf(\"10000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes2), medVal(mergetimes2), varVal(mergetimes2, meanVal(mergetimes2)));\n pw.printf(\"100000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes3), medVal(mergetimes3), varVal(mergetimes3, meanVal(mergetimes3)));\n pw.printf(\"1000000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes4), medVal(mergetimes4), varVal(mergetimes4, meanVal(mergetimes4)));\n pw.printf(\"1000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes1), medVal(heaptimes1), varVal(heaptimes1, meanVal(heaptimes1)));\n pw.printf(\"10000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes2), medVal(heaptimes2), varVal(heaptimes2, meanVal(heaptimes2)));\n pw.printf(\"100000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes3), medVal(heaptimes3), varVal(heaptimes3, meanVal(heaptimes3)));\n pw.printf(\"1000000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes4), medVal(heaptimes4), varVal(heaptimes4, meanVal(heaptimes4)));\n pw.println(\"REVERSE SORTED ARRAYS TIMES:\");\n pw.printf(\"1000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes5), medVal(quicktimes5), varVal(quicktimes5, meanVal(quicktimes5)));\n pw.printf(\"10000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes6), medVal(quicktimes6), varVal(quicktimes6, meanVal(quicktimes6)));\n pw.printf(\"100000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes7), medVal(quicktimes7), varVal(quicktimes7, meanVal(quicktimes7)));\n pw.printf(\"1000000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes8), medVal(quicktimes8), varVal(quicktimes8, meanVal(quicktimes8)));\n pw.printf(\"1000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes5), medVal(mergetimes5), varVal(mergetimes5, meanVal(mergetimes5)));\n pw.printf(\"10000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes6), medVal(mergetimes6), varVal(mergetimes6, meanVal(mergetimes6)));\n pw.printf(\"100000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes7), medVal(mergetimes7), varVal(mergetimes7, meanVal(mergetimes7)));\n pw.printf(\"1000000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes8), medVal(mergetimes8), varVal(mergetimes8, meanVal(mergetimes8)));\n pw.printf(\"1000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes5), medVal(heaptimes5), varVal(heaptimes5, meanVal(heaptimes5)));\n pw.printf(\"10000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes6), medVal(heaptimes6), varVal(heaptimes6, meanVal(heaptimes6)));\n pw.printf(\"100000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes7), medVal(heaptimes7), varVal(heaptimes7, meanVal(heaptimes7)));\n pw.printf(\"1000000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes8), medVal(heaptimes8), varVal(heaptimes8, meanVal(heaptimes8)));\n pw.println(\"RANDOM ARRAYS TIMES:\");\n pw.printf(\"1000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes9), medVal(quicktimes9), varVal(quicktimes9, meanVal(quicktimes9)));\n pw.printf(\"10000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes10), medVal(quicktimes10), varVal(quicktimes10, meanVal(quicktimes10)));\n pw.printf(\"100000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes11), medVal(quicktimes11), varVal(quicktimes11, meanVal(quicktimes11)));\n pw.printf(\"1000000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes12), medVal(quicktimes12), varVal(quicktimes12, meanVal(quicktimes12)));\n pw.printf(\"1000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes9), medVal(mergetimes9), varVal(mergetimes9, meanVal(mergetimes9)));\n pw.printf(\"10000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes10), medVal(mergetimes10), varVal(mergetimes10, meanVal(mergetimes10)));\n pw.printf(\"100000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes11), medVal(mergetimes11), varVal(mergetimes11, meanVal(mergetimes11)));\n pw.printf(\"1000000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes12), medVal(mergetimes12), varVal(mergetimes12, meanVal(mergetimes12)));\n pw.printf(\"1000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes9), medVal(heaptimes9), varVal(heaptimes9, meanVal(heaptimes9)));\n pw.printf(\"10000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes10), medVal(heaptimes10), varVal(heaptimes10, meanVal(heaptimes10)));\n pw.printf(\"100000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes11), medVal(heaptimes11), varVal(heaptimes11, meanVal(heaptimes11)));\n pw.printf(\"1000000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes12), medVal(heaptimes12), varVal(heaptimes12, meanVal(heaptimes12)));\n pw.close();\n }",
"public void sort() {\r\n lang.setInteractionType(Language.INTERACTION_TYPE_AVINTERACTION);\r\n\r\n int nrElems = array.getLength();\r\n ArrayMarker iMarker = null, jMarker = null;\r\n // highlight method header\r\n code.highlight(\"header\");\r\n lang.nextStep();\r\n\r\n // check if array is null\r\n code.toggleHighlight(\"header\", \"ifNull\");\r\n incrementNrComparisons(); // if null\r\n lang.nextStep();\r\n\r\n // switch to variable declaration\r\n\r\n code.toggleHighlight(\"ifNull\", \"variables\");\r\n lang.nextStep();\r\n\r\n // initialize i\r\n code.toggleHighlight(\"variables\", \"initializeI\");\r\n iMarker = installArrayMarker(\"iMarker\", array, nrElems - 1);\r\n incrementNrAssignments(); // i =...\r\n lang.nextStep();\r\n\r\n // switch to outer loop\r\n code.unhighlight(\"initializeI\");\r\n\r\n while (iMarker.getPosition() >= 0) {\r\n code.highlight(\"outerLoop\");\r\n lang.nextStep();\r\n\r\n code.toggleHighlight(\"outerLoop\", \"innerLoop\");\r\n if (jMarker == null) {\r\n jMarker = installArrayMarker(\"jMarker\", array, 0);\r\n } else\r\n jMarker.move(0, null, DEFAULT_TIMING);\r\n incrementNrAssignments();\r\n while (jMarker.getPosition() <= iMarker.getPosition() - 1) {\r\n incrementNrComparisons();\r\n lang.nextStep();\r\n code.toggleHighlight(\"innerLoop\", \"if\");\r\n array.highlightElem(jMarker.getPosition() + 1, null, null);\r\n array.highlightElem(jMarker.getPosition(), null, null);\r\n incrementNrComparisons();\r\n lang.nextStep();\r\n\r\n if (array.getData(jMarker.getPosition()) > array.getData(jMarker\r\n .getPosition() + 1)) {\r\n // swap elements\r\n code.toggleHighlight(\"if\", \"swap\");\r\n array.swap(jMarker.getPosition(), jMarker.getPosition() + 1, null,\r\n DEFAULT_TIMING);\r\n incrementNrAssignments(3); // swap\r\n lang.nextStep();\r\n code.unhighlight(\"swap\");\r\n } else {\r\n code.unhighlight(\"if\");\r\n }\r\n // clean up...\r\n // lang.nextStep();\r\n code.highlight(\"innerLoop\");\r\n array.unhighlightElem(jMarker.getPosition(), null, null);\r\n array.unhighlightElem(jMarker.getPosition() + 1, null, null);\r\n if (jMarker.getPosition() <= iMarker.getPosition())\r\n jMarker.move(jMarker.getPosition() + 1, null, DEFAULT_TIMING);\r\n incrementNrAssignments(); // j++ will always happen...\r\n }\r\n lang.nextStep();\r\n code.toggleHighlight(\"innerLoop\", \"decrementI\");\r\n array.highlightCell(iMarker.getPosition(), null, DEFAULT_TIMING);\r\n if (iMarker.getPosition() > 0)\r\n iMarker.move(iMarker.getPosition() - 1, null, DEFAULT_TIMING);\r\n else\r\n iMarker.moveBeforeStart(null, DEFAULT_TIMING);\r\n incrementNrAssignments();\r\n lang.nextStep();\r\n code.unhighlight(\"decrementI\");\r\n }\r\n\r\n // some interaction...\r\n TrueFalseQuestionModel tfQuestion = new TrueFalseQuestionModel(\"tfQ\");\r\n tfQuestion.setPrompt(\"Did this work?\");\r\n tfQuestion.setPointsPossible(1);\r\n tfQuestion.setGroupID(\"demo\");\r\n tfQuestion.setCorrectAnswer(true);\r\n tfQuestion.setFeedbackForAnswer(true, \"Great!\");\r\n tfQuestion.setFeedbackForAnswer(false, \"argh!\");\r\n lang.addTFQuestion(tfQuestion);\r\n\r\n lang.nextStep();\r\n HtmlDocumentationModel link = new HtmlDocumentationModel(\"link\");\r\n link.setLinkAddress(\"http://www.heise.de\");\r\n lang.addDocumentationLink(link);\r\n\r\n lang.nextStep();\r\n MultipleChoiceQuestionModel mcq = new MultipleChoiceQuestionModel(\"mcq\");\r\n mcq.setPrompt(\"Which AV system can handle dynamic rewind?\");\r\n mcq.setGroupID(\"demo\");\r\n mcq.addAnswer(\"GAIGS\", -1, \"Only static images, not dynamic\");\r\n mcq.addAnswer(\"Animal\", 1, \"Good!\");\r\n mcq.addAnswer(\"JAWAA\", -2, \"Not at all!\");\r\n lang.addMCQuestion(mcq);\r\n\r\n lang.nextStep();\r\n MultipleSelectionQuestionModel msq = new MultipleSelectionQuestionModel(\r\n \"msq\");\r\n msq.setPrompt(\"Which of the following AV systems can handle interaction?\");\r\n msq.setGroupID(\"demo\");\r\n msq.addAnswer(\"Animal\", 2, \"Right - I hope!\");\r\n msq.addAnswer(\"JHAVE\", 2, \"Yep.\");\r\n msq.addAnswer(\"JAWAA\", 1, \"Only in Guido's prototype...\");\r\n msq.addAnswer(\"Leonardo\", -1, \"Nope.\");\r\n lang.addMSQuestion(msq);\r\n lang.nextStep();\r\n // Text text = lang.newText(new Offset(10, 20, \"array\", \"S\"), \"Hi\", \"hi\",\r\n // null);\r\n // lang.nextStep();\r\n }",
"public void shellSort(){\n int increment = list.size() / 2;\n while (increment > 0) {\n for (int i = increment; i < list.size(); i++) {\n int j = i;\n int temp = list.get(i);\n while (j >= increment && list.get(j - increment) > temp) {\n list.set(j, list.get(j - increment));\n j = j - increment;\n }\n list.set(j, temp);\n }\n if (increment == 2) {\n increment = 1;\n } else {\n increment *= (5.0 / 11);\n }\n }\n }",
"public void sort() {\n\t\tif (data.size() < 10) {\n\t\t\tbubbleSort();\n\t\t\tSystem.out.println(\"Bubble Sort\");\n\t\t} else {\n\t\t\tquickSort();\n\t\t\tSystem.out.println(\"Quick Sort\");\n\t\t}\n\t}",
"public void insertReorderBarrier() {\n\t\t\n\t}",
"private static void allSorts(int[] array) {\n\t\tSystem.out.printf(\"%12d\",array.length);\n\t\tint[] temp;\n\t\tStopWatch1 timer;\n\t\t\n\t\t//Performs bubble sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.bubbleSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\t\tfourSorts(array);\n\t\tSystem.out.println();\n\t}",
"public static void main(String[] args) {\n\t\tSystem.out.println(\"\\tSelection\\tBubble\\tInsertion\\tCollections\\tQuick\\tinPlaceQuick\\tMerge\");\r\n\t\tfor (int n = 1000; n <= 7000; n += 500) {\r\n\t\t\tAPArrayList<Double> lists = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listb = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listi = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listc = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listq = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listipq = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listm = new APArrayList<Double>();\r\n\t\t\t\r\n\t\t\tfor (int i = 0; i < n; i++) {\r\n\t\t\t\tDouble val = Math.random();\r\n\t\t\t\tlists.add(val);\r\n\t\t\t\tlistb.add(val);\r\n\t\t\t\tlisti.add(val);\r\n\t\t\t\tlistc.add(val);\r\n\t\t\t\tlistq.add(val);\r\n\t\t\t\tlistipq.add(val);\r\n\t\t\t\tlistm.add(val);\r\n\t\t\t}\r\n\r\n\t\t\tlong selStartTime = System.nanoTime();\r\n\t\t\tlists.selectionSort();\r\n\t\t\tlong selEndTime = System.nanoTime();\r\n\t\t\tlong selSortTime = selEndTime - selStartTime;\r\n\t\t\tlists.clear();\r\n\t\t\t\r\n\t\t\tlong bubStartTime = System.nanoTime();\r\n\t\t\tlistb.bubbleSort();\r\n\t\t\tlong bubEndTime = System.nanoTime();\r\n\t\t\tlong bubSortTime = bubEndTime - bubStartTime;\r\n\t\t\tlistb.clear();\r\n\t\t\t\r\n\t\t\tlong insStartTime = System.nanoTime();\r\n\t\t\tlisti.insertionSort();\r\n\t\t\tlong insEndTime = System.nanoTime();\r\n\t\t\tlong insSortTime = insEndTime - insStartTime;\r\n\t\t\tlisti.clear();\r\n\t\t\t\r\n\t\t\tlong CollStartTime = System.nanoTime();\r\n\t\t\tlistc.sort();\r\n\t\t\tlong CollEndTime = System.nanoTime();\r\n\t\t\tlong CollSortTime = CollEndTime - CollStartTime;\r\n\t\t\tlistc.clear();\r\n\t\t\t\r\n\t\t\tlong quickStartTime = System.nanoTime();\r\n\t\t\tlistq.simpleQuickSort();\r\n\t\t\tlong quickEndTime = System.nanoTime();\r\n\t\t\tlong quickSortTime = quickEndTime - quickStartTime;\r\n\t\t\tlistq.clear();\r\n\t\t\t\r\n\t\t\tlong inPlaceQuickStartTime = System.nanoTime();\r\n\t\t\tlistipq.inPlaceQuickSort();\r\n\t\t\tlong inPlaceQuickEndTime = System.nanoTime();\r\n\t\t\tlong inPlaceQuickSortTime = inPlaceQuickEndTime - inPlaceQuickStartTime;\r\n\t\t\tlistipq.clear();\r\n\t\t\t\r\n\t\t\tlong mergeStartTime = System.nanoTime();\r\n\t\t\tlistm.mergeSort();\r\n\t\t\tlong mergeEndTime = System.nanoTime();\r\n\t\t\tlong mergeSortTime = mergeEndTime - mergeStartTime;\r\n\t\t\tlistq.clear();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tSystem.out.println(n + \"\\t\" + selSortTime + \"\\t\" + bubSortTime + \"\\t\" + insSortTime + \"\\t\" + CollSortTime + \"\\t\" + quickSortTime + \"\\t\" + inPlaceQuickSortTime + \"\\t\" + mergeSortTime);\r\n\t\t}\r\n\t}",
"@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n\t@Override\n\tpublic void sort() {\n\t\t\n\t\t// create maxHeap\n\t\tHeap<E> maxHeap = new MaxHeap<E>(arr);\n\t\t\n\t\telapsedTime = System.nanoTime(); // get time of start\n\t\t\n\t\tfor (int i = length - 1; i > 0; i--) {\n\n\t\t\tmaxHeap.swap(arr, 0, i);\n\t\t\tmaxHeap.heapSize--;\n\t\t\t((MaxHeap) maxHeap).maxHeapify(arr, 0);\n\n\t\t}\n\t\t\n\t\telapsedTime = System.nanoTime() - elapsedTime; // get elapsed time\n\t\t\n\t\tprint(); // print sorted array\n\t\tprintElapsedTime(); // print elapsed time\n\t\t\n\t\t\n\t}",
"private void collapseIgloo() {\n blocks.sort(Comparator.comparing(a -> a.center.getY()));\n\n double minDistance, distance;\n Point3D R = new Point3D(0, -1, 0);\n for (int i = 0; i < blocks.size(); i++) {\n minDistance = Double.MAX_VALUE;\n for (int j = i - 1; j >= 0; j--) {\n if (boundingSpheresIntersect(blocks.get(i), blocks.get(j))) {\n distance = minDistance(blocks.get(i), blocks.get(j), R);\n if (distance < minDistance) {\n minDistance = distance;\n }\n }\n }\n if (minDistance != Double.MAX_VALUE) {\n blocks.get(i).move(R.multiply(minDistance));\n }\n }\n }",
"public void sortAllRows(){\n\t\t/* code goes here */ \n\t\t\n\t\t\n\t\t//WHY SHOULD THEY BE SORTED LIKE THE EXAMPLE SAYS???????\n\t\t\n\t}",
"private void sortGallery_10_Runnable() {\r\n\r\n\t\tif (_allPhotos == null || _allPhotos.length == 0) {\r\n\t\t\t// there are no files\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tfinal GalleryMT20Item[] virtualGalleryItems = _galleryMT20.getAllVirtualItems();\r\n\t\tfinal int virtualSize = virtualGalleryItems.length;\r\n\r\n\t\tif (virtualSize == 0) {\r\n\t\t\t// there are no items\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// sort photos with new sorting algorithm\r\n\t\tArrays.sort(_sortedAndFilteredPhotos, getCurrentComparator());\r\n\r\n\t\tupdateUI_GalleryItems(_sortedAndFilteredPhotos, null);\r\n\t}",
"private static long sortingTime(String[] array, boolean isStandardSort) {\n long start = System.currentTimeMillis(); // starting time\n if (isStandardSort) \n Arrays.sort(array);\n selectionSort(array);\n return System.currentTimeMillis() - start; // measure time consumed\n }",
"@Override // java.util.Comparator\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public int compare(androidx.recyclerview.widget.GapWorker.Task r6, androidx.recyclerview.widget.GapWorker.Task r7) {\n /*\n r5 = this;\n androidx.recyclerview.widget.GapWorker$Task r6 = (androidx.recyclerview.widget.GapWorker.Task) r6\n androidx.recyclerview.widget.GapWorker$Task r7 = (androidx.recyclerview.widget.GapWorker.Task) r7\n androidx.recyclerview.widget.RecyclerView r5 = r6.view\n r0 = 0\n r1 = 1\n if (r5 != 0) goto L_0x000c\n r2 = r1\n goto L_0x000d\n L_0x000c:\n r2 = r0\n L_0x000d:\n androidx.recyclerview.widget.RecyclerView r3 = r7.view\n if (r3 != 0) goto L_0x0013\n r3 = r1\n goto L_0x0014\n L_0x0013:\n r3 = r0\n L_0x0014:\n r4 = -1\n if (r2 == r3) goto L_0x001d\n if (r5 != 0) goto L_0x001b\n L_0x0019:\n r0 = r1\n goto L_0x0037\n L_0x001b:\n r0 = r4\n goto L_0x0037\n L_0x001d:\n boolean r5 = r6.immediate\n boolean r2 = r7.immediate\n if (r5 == r2) goto L_0x0026\n if (r5 == 0) goto L_0x0019\n goto L_0x001b\n L_0x0026:\n int r5 = r7.viewVelocity\n int r1 = r6.viewVelocity\n int r5 = r5 - r1\n if (r5 == 0) goto L_0x002f\n L_0x002d:\n r0 = r5\n goto L_0x0037\n L_0x002f:\n int r5 = r6.distanceToItem\n int r6 = r7.distanceToItem\n int r5 = r5 - r6\n if (r5 == 0) goto L_0x0037\n goto L_0x002d\n L_0x0037:\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: androidx.recyclerview.widget.GapWorker.AnonymousClass1.compare(java.lang.Object, java.lang.Object):int\");\n }",
"private static void performSort(TestApp testApp) {\n testApp.testPartition();\n\n /*\n Date end = new Date();\n System.out.println(\"Sort ended @ \" + end.getTime());\n System.out.println(\"Total time = \" + (end.getTime() - start.getTime())/1000.0 + \" seconds...\");\n */\n }",
"public void sort() {\n\t\tfor (int i = 1; i < this.dataModel.getLength(); i++) {\n\t\t\tfinal int x = this.dataModel.get(i);\n\n\t\t\t// Find location to insert using binary search\n\t\t\tfinal int j = Math.abs(this.dataModel.binarySearch(0, i, x) + 1);\n\n\t\t\t// Shifting array to one location right\n\t\t\tthis.dataModel.arrayCopy(j, j + 1, i - j);\n\n\t\t\t// Placing element at its correct location\n\t\t\tthis.dataModel.set(j, x);\n\t\t\tthis.repaint(this.count++);\n\t\t}\n\t}",
"public void sortieBloc() {\n this.tableLocaleCourante = this.tableLocaleCourante.getTableLocalPere();\n }",
"private static void fourSorts(int[] array) {\n\t\tStopWatch1 timer;\n\t\tint[] temp;\n\t\t//Performs insertion sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.insertionSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\n\n\t\t//Performs selection sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.selectionSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\n\t\t//Performs quick sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.quickSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\n\t\t//Performs merge sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.mergeSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\n\t}",
"private void orderSegments() {\n //insert numOrder for the db\n int i = 0;\n for(TransportSegmentLogic transportSegment: transportSegments){\n transportSegment.setOrder(i);\n i++;\n }\n\n\n\n /*int i = 0;\n int j = 1;\n\n\n TransportSegmentLogic swapSegment;\n\n while(j < transportSegments.size()){\n if(transportSegments.get(j).getOrigin().equals(transportSegments.get(i).getDestination())){\n swapSegment = transportSegments.get(j);\n transportSegments.remove(swapSegment);\n transportSegments.add(i +1, swapSegment);\n i = i + 1;\n j = i + 1;\n }\n j++;\n }\n\n j = transportSegments.size() -1;\n\n while(j > i){\n if(transportSegments.get(j).getDestination().equals(transportSegments.get(0).getOrigin())){\n swapSegment = transportSegments.get(j);\n transportSegments.remove(swapSegment);\n transportSegments.add(0, swapSegment);\n i = i + 1;\n j = transportSegments.size();\n }\n j--;\n } */\n }",
"public void run()\n { // checking for appropriate sorting algorithm\n \n if(comboAlgorithm.equals(\"Shell Sort\"))\n {\n this.shellSort(randInt);\n }\n \n if(comboAlgorithm.equals(\"Selection Sort\"))\n {\n this.selectionSort(randInt);\n }\n \n if(comboAlgorithm.equals(\"Insertion Sort\"))\n {\n this.insertionSort(randInt);\n }\n if(comboAlgorithm.equals(\"Bubble Sort\"))\n {\n this.bubbleSort(randInt);\n }\n \n }",
"private synchronized void freshSort(){\n Process[] newQueue = new Process[pros.proSize()];\n for(int i = 0; i <queue.length; i++){\n if(pros.isInList(queue[i])){\n newQueue[i] = queue[i];\n }\n }\n queue = new Process[pros.proSize()];\n queue = newQueue;\n }",
"public void sortFullList()\r\n {\r\n if (log.isDebugEnabled())\r\n {\r\n log.debug(\"[\" + this.id + \"] sorting full data\");\r\n }\r\n sortRowList(this.getRowListFull());\r\n }",
"private void updateFilteringAndSorting() {\n log.debug(\"update filtering of adapter called\");\n if (lastUsedComparator != null) {\n sortWithoutNotify(lastUsedComparator, lastUsedAsc);\n }\n Filter filter = getFilter();\n if (filter instanceof UpdateableFilter){\n ((UpdateableFilter)filter).updateFiltering();\n }\n }",
"private static void evaluateMergesortVogellaThreaded() {\n\n // LOGGER.info(\"evaluating parallel mergesort with Java Threads based on the Vogella version\");\n\n // The time before start to sort.\n long startTime;\n\n // The time after sort.\n long endTime;\n\n // generate sorted array\n numbers = generateSortedArray(ARRAY_SIZE);\n\n // get array to evaluate\n generateWorstUnsortArray(numbers);\n\n // get systemtime before sorting\n startTime = System.currentTimeMillis();\n\n // sort\n msVogellaJThreads.sort(numbers);\n\n // get systemtime after sorting\n endTime = System.currentTimeMillis();\n\n // show the result of the sorting process\n System.out.println(\"\\n- Sortierergebnis: Java Threads (Vogella) -\");\n System.out.println(\"Die sortierte Folge lautet: \" + arrayToString(numbers));\n System.out.printf(\"Für die Sortierung wurden %d ms benötigt\", endTime - startTime);\n System.out.println(\"\\n------------------------------------------------\\n\");\n }",
"public void sortSpeeds() {\n\n//\t\tSystem.out.println(\"BEGIN: SORT SPEEDS\");\n\t\tthis.printMoves();\n\n\t\tArrayList<Move> temp = new ArrayList<Move>();\n\t\tint i = 1;\n\t\tint x = 0;\n\t\tboolean y = true;\n\n\t\ttemp.add(niceMoves.get(0));\n\t\tint size = niceMoves.size();\n\n\t\twhile (i < niceMoves.size()) {\n\n//\t\t\tSystem.out.println(\"Reiterating.\");\n\t\t\ty = true;\n\n\t\t\twhile (y) {\n\n\t\t\t\t//System.out.println(\"I: \" + i + \" X: \" + x);\n\n\t\t\t\ttry {\n\n\t\t\t\t\tif (niceMoves.get(i).getSpeed() > temp.get(x).getCalcedSpeed()) {\n\n//\t\t\t\t\t\tSystem.out.println(\"Adding \" + niceMoves.get(i).getCaster() + \" to spot \" + x);\n\t\t\t\t\t\ttemp.add(x, niceMoves.get(i));\n\t\t\t\t\t\ty = false;\n\t\t\t\t\t}\n\t\t\t\t\t//X has cycled through temp, meaning nicemoves.i should be added to the end\n\t\t\t\t\t//The only way to check for this is to let it overflow lol\n\t\t\t\t} catch (Exception E) {\n//\t\t\t\t\tSystem.out.println(\"Adding \" + niceMoves.get(i).getCaster() + \" to spot \" + x);\n\t\t\t\t\ttemp.add(x, niceMoves.get(i));\n\t\t\t\t\ty = false;\n\n\t\t\t\t}\n\n\t\t\t\tx += 1;\n\t\t\t}\n\n\t\t\ti += 1;\n\t\t\tx = 0;\n\t\t}\n\n\t\tniceMoves = temp;\n\n//\t\tSystem.out.println();\n//\t\tSystem.out.println(\"Sorting Complete! New Order: \");\n//\t\tthis.printMoves();\n\t\t//end of sort speeds\n\t}",
"public void sort() {\r\n // sort the process variables\r\n Arrays.sort(pvValues, categoryComparator);\r\n fireTableDataChanged();\r\n }",
"public void sort() throws IOException {\n for(int i = 0; i < 32; i++)\n {\n if(i%2 == 0){\n filePointer = file;\n onePointer = one;\n }else{\n filePointer = one;\n onePointer = file;\n }\n filePointer.seek(0);\n onePointer.seek(0);\n zero.seek(0);\n zeroCount = oneCount = 0;\n for(int j = 0; j < totalNumbers; j++){\n int n = filePointer.readInt();\n sortN(n,i);\n }\n //Merging\n onePointer.seek(oneCount*4);\n zero.seek(0L);\n for(int j = 0; j < zeroCount; j++){\n int x = zero.readInt();\n onePointer.writeInt(x);\n }\n //One is merged\n }\n }",
"void sortUI();",
"private static long sortingTime(double[] array, boolean isStandardSort) {\n long start = 0; // starting time\n if (isStandardSort) { \n start = System.currentTimeMillis(); \n Arrays.sort(array);\n } else {\t\n start = System.currentTimeMillis();\n selectionSort(array);\n }\n return System.currentTimeMillis() - start; // measure time consumed\n }",
"private void compressBlocks(final int phaseId) {\n // 1. uncross all crossing blocks: O(|G|)\n popBlocks(head -> head.isTerminal() && head.getPhaseId() < phaseId,\n tail -> tail.isTerminal() && tail.getPhaseId() < phaseId);\n\n List<BlockRecord<N, S>> shortBlockRecords = new ArrayList<>();\n List<BlockRecord<N, S>> longBlockRecords = new ArrayList<>();\n\n // 2. get all blocks: O(|G|)\n slp.getProductions().stream().forEach(rule -> consumeBlocks(rule.getRight(), shortBlockRecords::add, longBlockRecords::add, letter -> true));\n\n // 3.1 sort short blocks using RadixSort: O(|G|)\n sortBlocks(shortBlockRecords);\n\n // 3.2 sort long blocks O((n+m) log(n+m))\n Collections.sort(longBlockRecords, blockComparator);\n List<BlockRecord<N, S>> blockRecords = mergeBlocks(shortBlockRecords, longBlockRecords);\n\n // compress blocks\n BlockRecord<N, S> lastRecord = null;\n S letter = null;\n\n // 4. compress blocks: O(|G|)\n for(BlockRecord<N, S> record : blockRecords) {\n\n // check when it is the correct time to introduce a fresh letter\n if(lastRecord == null || !lastRecord.equals(record)) {\n letter = terminalAlphabet.createTerminal(phase, 1L, record.node.getElement().getLength() * record.block.getLength(), record.block);\n lastRecord = record;\n }\n replaceBlock(record, letter);\n }\n }",
"@Test(timeout = SHORT_TIMEOUT)\n public void testAdaptiveInsertionSort() {\n //Test adaptiveness of completely ordered sort\n\n //Generate sorted array\n toSort = randArrDuplicates(MAX_ARR_SIZE, new Random(2110));\n Arrays.parallelSort(toSort, comp);\n sortedInts = cloneArr(toSort);\n\n comp.resetCount();\n Sorting.insertionSort(sortedInts, comp);\n int numComparisons = comp.getCount();\n\n assertSorted(sortedInts, comp);\n\n //Should require only 1 pass through array, for n-1 comparisons\n assertTrue(\"Too many comparisons: \" + numComparisons,\n numComparisons <= MAX_ARR_SIZE - 1);\n\n //Check adaptiveness with 1 item out-of-order\n\n //Set up list\n toSort = new IntPlus[6];\n for (int i = 0; i < toSort.length; i++) {\n toSort[i] = new IntPlus(2 * i);\n }\n toSort[3] = new IntPlus(-1);\n\n sortedInts = cloneArr(toSort);\n\n /*\n Initial Array: [0, 2, 4, -1, 8, 10]\n Should require 7 comparisons to sort\n */\n comp.resetCount();\n Sorting.insertionSort(sortedInts, comp);\n numComparisons = comp.getCount();\n\n assertSorted(sortedInts, comp);\n\n assertTrue(\"Too many comparisons: \" + numComparisons,\n numComparisons <= 7);\n }",
"public static void main(String[] args) {\n\r\n\t\t int[] arr = generateRandomArrayWithRandomNum();\r\n\t int checksSelectionSort = 0;\r\n\t int checksBubbleSort = 0;\r\n\t int checksMergeSort = 0;\r\n\t int checksQuickSort = 0;\r\n\t int[] copyArr = new int[1000];\r\n\t for (int x = 0; x < 20; x++) {\r\n\t System.arraycopy(arr, 0, copyArr, 0, 1000);\r\n\t checksSelectionSort += doSelectionSort(arr);\r\n\r\n\t \r\n\t System.arraycopy(copyArr, 0, arr, 0, 1000);\r\n\t checksBubbleSort += bubbleSort(copyArr);\r\n\t System.arraycopy(arr, 0, copyArr, 0, 1000);\r\n\t checksMergeSort += new mergeSort().sort(arr);\r\n\t System.arraycopy(copyArr, 0, arr, 0, 1000);\r\n\t checksQuickSort += new quickSort().sort(copyArr);\r\n\t }\r\n\t System.out.println(\"Analysis Of Sorting algorithms \");\r\n\t System.out.println(\"Selection Sort : \"+checksSelectionSort/20);\r\n\t System.out.println(\"Bubble Sort : \"+checksBubbleSort/20);\r\n\t System.out.println(\"Merge Sort : \"+checksMergeSort/20);\r\n\t System.out.println(\"Quick Sort : \"+checksQuickSort/20);\r\n\r\n\t \r\n\t }",
"public void sort(){\n ListNode t, x, b = new ListNode(null, null);\n while (firstNode != null){\n t = firstNode; firstNode = firstNode.nextNode;\n for (x = b; x.nextNode != null; x = x.nextNode) //b is the first node of the new sorted list\n if (cmp.compare(x.nextNode.data, t.data) > 0) break;\n t.nextNode = x.nextNode; x.nextNode = t;\n if (t.nextNode==null) lastNode = t;\n }\n firstNode = b.nextNode;\n }"
] | [
"0.719662",
"0.6253113",
"0.6209965",
"0.60641325",
"0.6062344",
"0.60514784",
"0.6039714",
"0.6020895",
"0.6018125",
"0.6015914",
"0.59652436",
"0.5950544",
"0.5932971",
"0.5900926",
"0.58313674",
"0.5802383",
"0.5788351",
"0.57315594",
"0.56716985",
"0.56670487",
"0.5629508",
"0.5613598",
"0.5612099",
"0.5611703",
"0.5592451",
"0.55917716",
"0.5588461",
"0.55848163",
"0.5554659",
"0.5554079",
"0.5549377",
"0.55441636",
"0.5537118",
"0.5532984",
"0.5532803",
"0.5532803",
"0.55292463",
"0.55275965",
"0.5522279",
"0.5519424",
"0.551642",
"0.5511716",
"0.55057514",
"0.5502017",
"0.54939586",
"0.5476436",
"0.54741585",
"0.5473029",
"0.5441123",
"0.54384875",
"0.54355913",
"0.5428854",
"0.5424462",
"0.5404587",
"0.54042906",
"0.5398141",
"0.53981346",
"0.5394633",
"0.5393649",
"0.53902",
"0.538549",
"0.53852785",
"0.5384685",
"0.53686666",
"0.5345649",
"0.5341686",
"0.53390706",
"0.53294265",
"0.53148216",
"0.53070915",
"0.53057426",
"0.5305577",
"0.5304475",
"0.5292254",
"0.52918285",
"0.5290364",
"0.5287865",
"0.52842516",
"0.52834797",
"0.52813774",
"0.5267899",
"0.52645266",
"0.5263191",
"0.5262101",
"0.5261538",
"0.5259155",
"0.52528334",
"0.5249513",
"0.524533",
"0.5243381",
"0.5239559",
"0.5239141",
"0.5237668",
"0.52372295",
"0.5224401",
"0.5223193",
"0.5222278",
"0.522134",
"0.5221159",
"0.5217173",
"0.52171165"
] | 0.0 | -1 |
file at root Catalog (it will be txt) | @Before
public void setUp() throws Exception {
fileFinder = new FileFinder();
testFiles = new ArrayList<>(10);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Path getMainCatalogueFilePath();",
"@Override\n public void command(String path) {\n StringBuilder html = new StringBuilder();\n html.append(\"<!doctype html>\\n\");\n html.append(\"<html lang='en'>\\n\");\n\n html.append(\"<head>\\n\");\n html.append(\"<meta charset='utf-8'>\\n\");\n html.append(\"<title>optional.Catalog</title>\\n\");\n html.append(\"</head>\\n\\n\");\n\n html.append(\"<body>\\n\");\n html.append(\"<h1>optional.Catalog</h1>\\n\");\n html.append(\"<p>Nume catalog:\" + c.getName() + \"</p>\\n\");\n html.append(\"<p>Path catalog:\" + c.getPath() + \"</p>\\n\");\n html.append(\"<p>Documents: </p>\\n\");\n html.append(\"<ul>\\n\");\n for (Document document : c.getDocuments()) {\n System.out.println(document);\n html.append(\"<li>\" + document + \"</li>\\n\");\n }\n html.append(\"</ul>\\n\");\n html.append(\"</body>\\n\\n\");\n\n html.append(\"</html>\");\n try (FileWriter fout = new FileWriter(path)){\n String htmlString = html.toString();\n fout.write(htmlString);\n Desktop desktop = Desktop.getDesktop();\n desktop.open(new File(path));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"Path getCartFilePath();",
"String getFile();",
"String getFile();",
"String getFile();",
"private void createCatalogFileIfNoneExists(){\n\t\t\n\t\tinOut = new IOUtility();\n\t\t\n\t\tif (inOut.checkLocalCache()) {\n\t\t\tcatalog = inOut.readCatalogFromFile();\n\t\t}\n\n\t\telse {\n\n\t\t\ttry {\n\t\t\t\tinOut.createCatalogFile();\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t} \n\t\t}\n\t\t\n\t}",
"public abstract String getFileLocation();",
"public String toStringFile(){\n return null;\n }",
"private String getOptionsGoldenFile() {\n String dataDir = \"\";\n try {\n dataDir = getDataDir().getCanonicalPath();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n return dataDir + File.separator + \"permanentUI\" + File.separator + \"options\" + File.separator + \"options-categories.txt\";\n }",
"public void readFile();",
"public File getOutputDb();",
"public String getDescription() {\n return \"Text file (.text)\";\n }",
"Path getContent(String filename);",
"public void readFile()\n {\n try {\n fileName = JOptionPane.showInputDialog(null,\n \"Please enter the file you'd like to access.\"\n + \"\\nHint: You want to access 'catalog.txt'!\");\n \n File aFile = new File(fileName);\n Scanner myFile = new Scanner(aFile);\n \n String artist, albumName; \n while(myFile.hasNext())\n { //first we scan the document\n String line = myFile.nextLine(); //for the next line. then we\n Scanner myLine = new Scanner(line); //scan that line for our info.\n \n artist = myLine.next();\n albumName = myLine.next();\n ArrayList<Track> tracks = new ArrayList<>();\n \n while(myLine.hasNext()) //to make sure we get all the tracks\n { //that are on the line.\n Track song = new Track(myLine.next());\n tracks.add(song);\n }\n myLine.close();\n Collections.sort(tracks); //sort the list of tracks as soon as we\n //get all of them included in the album.\n Album anAlbum = new Album(artist, albumName, tracks);\n catalog.add(anAlbum);\n }\n myFile.close();\n }\n catch (NullPointerException e) {\n System.err.println(\"You failed to enter a file name!\");\n System.exit(1);\n }\n catch (FileNotFoundException e) {\n System.err.println(\"Sorry, no file under the name '\" + fileName + \"' exists!\");\n System.exit(2);\n }\n }",
"void file(Context context) {\n context.getFilesDir();\n File file = new File(context.getFilesDir() + \"/Comments.xml\");\n System.out.println(context.getFilesDir());\n if (!file.exists())\n {\n XmlSerializer serializer = Xml.newSerializer();\n StringWriter writer = new StringWriter();\n try {\n serializer.setOutput(writer);\n serializer.startDocument(\"UTF-8\", true);\n serializer.startTag(\"\", \"lista\");\n serializer.text(\"\");\n serializer.endTag(\"\", \"lista\");\n serializer.endDocument();\n String result = writer.toString();\n\n FileOutputStream fos = context.openFileOutput(\"Comments.xml\", Context.MODE_PRIVATE);\n fos.write(result.getBytes(), 0, result.getBytes().length);\n fos.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }",
"@Override\n\tpublic void printToFile() {\n\t\t\n\t}",
"@Override\r\n\tpublic void handleFile(String inFilename, String outFilename) \r\n\t{\n\r\n\r\n\t\tString s = slurpFile(inFilename);\r\n\t\tDocument teiDocument = parsePlainText(s);\r\n\t\ttry \r\n\t\t{\r\n\t\t\tPrintStream pout = new PrintStream(new FileOutputStream(outFilename));\r\n\t\t\tpout.print(XML.documentToString(teiDocument));\r\n\t\t\tpout.close();\r\n\t\t} catch (FileNotFoundException e) \r\n\t\t{\r\n\t\t\te.printStackTrace\r\n\t\t\t();\r\n\r\n\t\t}\t\r\n\t}",
"public void catalogToTextArea(Catalog theCatalog, JTextArea textArea) {\n textArea.setText(\"CONTENTS OF CATALOG:\\n\\n\");\n for (int CDNum = 0; CDNum < theCatalog.getNumItems(); CDNum++) {\n CD cd = (CD) theCatalog.getItem(CDNum);\n // display the title, composer and performer for the CD\n textArea.append(cd.displayStringWithTag() + \"\\n\");\n // display all the tracks, indented using a tab character\n for (int trackNum = 0; trackNum < cd.getNumTracks(); trackNum++) {\n textArea.append(\"\\t\" + cd.getTrack(trackNum) + \"\\n\");\n } // end for trackNum\n } // end for CDNum\n }",
"private static void readFileOnClient(FileStore.Client client) throws SystemException, TException {\n String fileName = \"sample.txt\";\n NodeID nodeId = client.findSucc(getSHA(fileName));\n TTransport transport = new TSocket(nodeId.getIp(), nodeId.getPort());\n transport.open();\n\n TProtocol protocol = new TBinaryProtocol(transport);\n FileStore.Client readFileClient = new FileStore.Client(protocol);\n\n RFile rFile = readFileClient.readFile(fileName);\n System.out.println(\"Filename - \" + rFile.getMeta().getFilename());\n System.out.println(\"Version Number - \" + rFile.getMeta().getVersion());\n System.out.println(\"Content - \" + rFile.getContent());\n transport.close();\n }",
"FileObject getFile();",
"FileObject getFile();",
"public abstract String FileOutput();",
"String getFilepath();",
"public void readFromFile() {\n\n\t}",
"private static void writeCatalog(XMLStreamWriter w, RepositoryConnection con)\n\t\tthrows XMLStreamException {\n\t\tString cat = \"http://data.gov.be/catalog\";\n\n\t\tw.writeStartElement(\"rdf:RDF\");\n\t\twritePrefixes(w);\n\n\t\tw.writeStartElement(\"dcat:Catalog\");\n\t\tw.writeAttribute(\"dct:identifier\", cat);\n\t\tw.writeAttribute(\"rdf:about\", cat);\n\n\t\tIRI uri = con.getValueFactory().createIRI(cat);\n\t\twriteGeneric(w, con, uri);\n\t\twriteReferences(w, con, uri, FOAF.HOMEPAGE, \"foaf:homepage\");\n\t\twriteReferences(w, con, uri, DCTERMS.LICENSE, \"dct:license\");\n\t\twriteDatasets(w, con);\n\t\twriteDataservices(w, con);\n\t\tw.writeEndElement();\n\n\t\twriteAgents(w, con);\n\n\t\twriteLocations(w, con);\n\t\n\t\twriteDocuments(w, con, DCTERMS.PROVENANCE, \"dct:ProvenanceStatement\");\n\t\twriteDocuments(w, con, DCTERMS.LICENSE, \"dct:LicenseDocument\");\n\t\twriteDocuments(w, con, DCTERMS.RIGHTS, \"dct:RightsStatement\");\n\t\twriteDocuments(w, con, DCTERMS.CONFORMS_TO, \"dct:Standard\");\n\n\t\twriteConcepts(w, con, DCTERMS.ACCESS_RIGHTS, \"dct:RightsStatement\");\n\t\twriteConcepts(w, con, DCTERMS.ACCRUAL_PERIODICITY, \"dct:Frequency\");\n\t\twriteConcepts(w, con, DCTERMS.LANGUAGE, \"dct:LinguisticSystem\");\n\t\twriteConcepts(w, con, DCTERMS.FORMAT, \"dct:MediaTypeOrExtent\");\n\t\twriteConcepts(w, con, DCTERMS.TYPE, \"skos:Concept\");\n\t\twriteConcepts(w, con, DCAT.MEDIA_TYPE, \"dct:MediaType\");\n\t\twriteConcepts(w, con, DCAT.COMPRESS_FORMAT, \"dct:MediaType\");\n\t\twriteConcepts(w, con, DCAT.THEME, \"skos:Concept\");\n\n\t\tw.writeEndElement();\n\t}",
"public File getDataFile();",
"@Override\n public void writeDataToTxtFile() {\n\n }",
"public String getFile() {\n return \"null\"; // getFileTopic().getCompositeValue().getTopic(FILE_PATH);\n }",
"public void startDocument()\r\n\t{\r\n\t marc_out.add(\"=LDR 00000nam\\\\\\\\22000007a\\\\4500\") ;\r\n\t marc_out.add(\"=001 etd_\" + pid);\r\n\t marc_out.add(\"=003 MiAaPQ\");\r\n\t marc_out.add(\"=006 m\\\\\\\\\\\\\\\\fo\\\\\\\\d\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\");\r\n\t marc_out.add(\"=007 cr\\\\mnu\\\\\\\\\\\\aacaa\");\r\n\t marc_out.add(\"=040 \\\\\\\\$aMiAaPQ$beng$cDGW$dDGW\");\r\n\t marc_out.add(\"=049 \\\\\\\\$aDGWW\");\r\n\t marc_out.add(\"=504 \\\\\\\\$aIncludes bibliographical references.\");\r\n\t marc_out.add(\"=538 \\\\\\\\$aMode of access: Internet\");\r\n marc_out.add(\"=996 \\\\\\\\$aNew title added ; 20\" + running_date);\r\n marc_out.add(\"=998 \\\\\\\\$cgwjshieh ; UMI-ETDxml conv ; 20\" + running_date);\r\n\t marc_out.add(\"=852 8\\\\$bgwg ed$hGW: Electronic Dissertation\");\r\n\t marc_out.add(\"=856 40$uhttp://etd.gelman.gwu.edu/\" + pid + \".html$zClick here to access.\");\r\n\r\n }",
"private static void info ( File f ) {\n\tString nume = f . getName () ;\n\tif( f.isFile () )\n\tSystem.out.println ( \" Fisier : \" + nume ) ;\n\telse\n\tif( f.isDirectory () )\n\tSystem.out.println ( \" Director : \" + nume ) ;\n\tSystem.out.println (\n\t\" Cale absoluta : \" + f.getAbsolutePath () +\n\t\" \\n Poate citi : \" + f.canRead () +\n\t\" \\n Poate scrie : \" + f.canWrite () +\n\t\" \\n Parinte : \" + f.getParent () +\n\t\" \\n Cale : \" + f.getPath () +\n\t\" \\n Lungime : \" + f.length () +\n\t\" \\n Data ultimei modificari : \" +\n\tnew Date ( f.lastModified () ) ) ;\n\tSystem.out.println ( \" --------------\" ) ;\n\t}",
"void loadProducts(String filename);",
"public File getFile();",
"public File getFile();",
"String getNoticeFileContent();",
"public void recordOrder(){ \n PrintWriter output = null;\n try{\n output = \n new PrintWriter(new FileOutputStream(\"record.txt\", true));\n }\n catch(Exception e){\n System.out.println(\"File not found\");\n System.exit(0);\n }\n output.println(Tea);//writes into the file contents of String Tea\n output.close();//closes file\n }",
"File getFile();",
"File getFile();",
"String getFilePath();",
"private void read() {\n\n\t\t\t\tString road=getActivity().getFilesDir().getAbsolutePath()+\"product\"+\".txt\";\n\n\t\t\t\ttry {\n\t\t\t\t\tFile file = new File(road); \n\t\t\t\t\tFileInputStream fis = new FileInputStream(file); \n\t\t\t\t\tint length = fis.available(); \n\t\t\t\t\tbyte [] buffer = new byte[length]; \n\t\t\t\t\tfis.read(buffer); \n\t\t\t\t\tString res1 = EncodingUtils.getString(buffer, \"UTF-8\"); \n\t\t\t\t\tfis.close(); \n\t\t\t\t\tjson(res1.toString());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} \n\t\t\t}",
"FileContent createFileContent();",
"protected abstract void readFile();",
"public static File fMibsTextDir() \r\n\t{\r\n\t\treturn new File(fMibsDir() + File.separator + \"txt\");\t\r\n\t}",
"public abstract TextDocument getTextDocumentFromFile(String path) throws FileNotFoundException, IOException;",
"private void saveTextToFile(String content, File file) {\n try {\n PrintWriter writer;\n writer = new PrintWriter(file);\n writer.println(content);\n writer.close();\n } catch (IOException ex) {\n Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"String getFileOutput();",
"public String getRecordFile();",
"stockFilePT102.StockFileDocument.StockFile getStockFile();",
"public static void main(String[] args) {\n File file = new File (\"tesEt.txt\");\n // Path file = Paths.get(\"test.txt\");\n // System.out.println(file.get);\n System.out.println(file.getAbsoluteFile());\n System.out.println(file.isAbsolute());\n System.out.println(file.exists());\n \n // try {\n // // File.createTempFile(\"prefix\", \"suffix\");\n // sy\n // } catch (IOException e) {\n // // TODO Auto-generated catch block\n // e.printStackTrace();\n // }finally\n // {\n // System.out.println(\"hehehehe\");\n // }\n // file.\n\n }",
"public abstract String toStringForFileName();",
"public void process(final String filename) throws JDOMException, IOException {\n\n // Parsing our XML file being located below \"resources\"\n final Document docInput = builder.build(\n getClass().getClassLoader().getResource(filename)\n );\n\n // Accessing the document's root element <catalog>\n final Element docRoot = docInput.getRootElement();\n\n // Accessing the <item> children of parent element <catalog>\n docRoot.getChildren().stream().\n map(item -> \"Article: \" + item.getText() +\n \", order number: \" + item.getAttributeValue(\"orderNo\")).\n forEach(System.out::println);\n }",
"void printFile(String path) {\n try {\n String[] readFileOutPut = readFile(path);\n for (int i = 0; i < readFileOutPut.length;i++) System.out.println(readFileOutPut[i]);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"public String getStringFile(){\n return fileView(file);\n }",
"public void salvaPartita(String file) {\n\r\n }",
"public void outputToFile(String filemame)\n {\n }",
"public File getFile ();",
"private Log() {\r\n readFile(\"Save.bin\",allLogs);\r\n readFile(\"Tag.bin\", allTags);\r\n readFile(\"Password.bin\", userInfo);\r\n }",
"public void createFileObjects() {\n List<String> externalFiles = abbreviationsPreferences.getExternalJournalLists();\n externalFiles.forEach(name -> openFile(Paths.get(name)));\n }",
"@Test\n public void createFile(){\n try\n {\n URI uri = new URI(\"http://www.yu.edu/documents/doc390\");//given the complete uri\n String path = uri.getAuthority() + this.disectURI(uri);//get the Path which is www.yu.edu\\documents\n File file = new File(baseDir.getAbsolutePath() + File.separator + path);//make a File with the full class path and with the \"URI Path\"\n Files.createDirectories(file.toPath());//create the directories we didn't have before, ie not apart of the baseDir\n\n File theFile = new File(file.getAbsolutePath() + File.separator + \"doc390.txt\");//create a new File with the document as the last piece\n //wrap in a try because if the file is already there than we don't need to create a file\n if(!theFile.exists())Files.createFile(theFile.toPath());//create this file in the computer\n\n //write to the file -- in the real application this is the writing of the json\n FileWriter fileWriter = new FileWriter(theFile);\n fileWriter.write(\"HaYom sishi BShabbos\");\n fileWriter.flush();\n fileWriter.close();\n\n }\n catch(Exception e){\n e.printStackTrace();\n }\n }",
"void printToFile() throws IOException {\n\t\tBufferedWriter writer = new BufferedWriter( new FileWriter(\"Provider_Directory.txt\") );\n\t\twriter.write(\"PROVIDER DIRECTORY:\");\n\t\tfor (int i = 0; i < services.size(); i++) {\n\t\t\tString service = services.get(i).getServiceName() + \" (\" + services.get(i).getServiceNumber() + \") for $\" + services.get(i).getServiceFee();\n\t\t\twriter.write(\"\\t\");\n\t\t\twriter.write(service);\n\t\t}\n\t\twriter.close();\n\t}",
"public void writeFile() {\n\t\ttry {\n\t\t\tFile dir = Environment.getExternalStorageDirectory();\n\t\t\tFile myFile = new File(dir.toString() + File.separator + FILENAME);\n\t\t\tLog.i(\"MyMovies\", \"SeSus write : \" + myFile.toString());\n\t\t\tmyFile.createNewFile();\n\t\t\tFileOutputStream fOut = new FileOutputStream(myFile);\n\t\t\tOutputStreamWriter myOutWriter = \n\t\t\t\t\tnew OutputStreamWriter(fOut);\n\t\t\tfor (Map.Entry<String, ValueElement> me : hm.entrySet()) {\n\t\t\t\tString refs = (me.getValue().cRefMovies>0? \"MOVIE\" : \"\");\n\t\t\t\trefs += (me.getValue().cRefBooks>0? \"BOOK\" : \"\");\n\t\t\t\tString line = me.getKey() + DELIMITER + me.getValue().zweiteZeile \n\t\t\t\t\t\t //+ DELIMITER\n\t\t\t\t\t\t //+ me.getValue().count\n\t\t\t\t\t \t+ DELIMITER\n\t\t\t\t\t \t+ refs\n\t\t\t\t\t \t + System.getProperty(\"line.separator\");\n\t\t\t\t//Log.i(\"MyMovies\", \"SeSus extracted : \" + line);\n\t\t\t\tmyOutWriter.write(line);\n\t\t\t}\n\t\t\tmyOutWriter.close();\n\t\t\tfOut.close();\n\t\t} catch (IOException e) {\n\t\t\t//\n\t\t\tLog.i(\"MyMovies\", \"SeSus write Exception : \");\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void storeToFile() throws IOException {\n\t\t\n\t\tDLProgramStorer storer = new DLProgramStorerImpl();\n\t\t\n\t\t//String datalogFile = inputCKR.getGlobalOntologyFilename() + \".dlv\";\n\t\t//String datalogFile = \"./testcase/output.dlv\";\n\t\t//System.out.println(datalogGlobal.getStatements().size());\n\t\t\n\t\tFileWriter writer = new FileWriter(outputFilePath);\n\t\tstorer.store(datalogCKR, writer);\n\t\t//writer.flush();\n\t\twriter.close();\n\t\t\n\t\t//System.out.println(\"CKR program saved in: \" + outputFilePath);\n\t}",
"String readDocument(String path, Charset charset);",
"public Path getCatalogPath() {\n return getRef().catalogPath;\n }",
"private void grabarArchivo() {\n\t\tPrintWriter salida;\n\t\ttry {\n\t\t\tsalida = new PrintWriter(new FileWriter(super.salida));\n\t\t\tsalida.println(this.aDevolver);\n\t\t\tsalida.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"void addEntry(IvyXmlWriter xw) \n{\n xw.begin(\"USERFILE\");\n xw.field(\"NAME\",access_name);\n xw.field(\"JARNAME\",context_name);\n xw.field(\"ACCESS\",file_mode);\n xw.end(\"USERFILE\");\n}",
"public String getFile() {\n \n // return it\n return theFile;\n }",
"public FilePersistence(String file) {\n this.file = file;\n }",
"java.lang.String getFilePath();",
"VirtualDirectory getRootContents();",
"public String toFile(){\n return String.format(\"%s:%s:%s:%s:%s:%s:%s\",hashIndex,id,super.toFile(), \r\n facultyAbbr.getAbbreviation(), courseName.getCourseName(),tutorialGroup,session);\r\n }",
"public String getText()\n{\n //String base = _type==FileType.PACKAGE_DIR? _proj.getPackageName(_file) :\n // _file.isRoot()? _file.getSite().getName() : _file.getName();\n //String prefix = _vc.isModified(_file)? \">\" : \"\";\n //String suffix = _file.isUpdateSet()? \" *\" : \"\";\n //return prefix + base + suffix;\n String text = _file.getName();\n return text.length()>0? text : \"Sample Files\";\n}",
"public File getTemplateFile();",
"private static void createIndexDocument(String path, Configuration c, LODEParser l, Properties lang){\n //the boolean valuas come from the configuration.\n String textToWrite = Constants.getIndexDocument(\"resources\",c, l, lang);\n saveDocument(path+File.separator+\"index-\"+c.getCurrentLanguage()+\".html\", textToWrite,c);\n }",
"private void saveNewCatalog() {\n\n\t}",
"private void writeInfoToFile() {\n createInfoFile(\"infoList.txt\", fwExMessage);\n outFile.println(\"منشی\");\n outFile.println(username);\n outFile.println(password);\n outFile.println(\" \");\n outFile.close();\n }",
"public n501070324_PedidosAssistencia() {\n super(\"Pedidos.txt\");\n }",
"private void setFile() {\n\t}",
"@Override\n public String getDescription() {\n return \"Text documents (*.xml)\";\n }",
"public abstract void writeToFile( );",
"public String getFormattedFileContents ();",
"String prepareFile();",
"String getSchemaFile();",
"private void ReadTextFile(String FilePath) {\n\t\t\n\t\t\n\t}",
"public void save(){\n\tif(currentFile == null){\n\t // TODO: add popup to select where to save file and file name\n\t // currentFile = new TextFile(os, title, null);\n\t}else{\n\t currentFile.setBody(textArea.getText());\n\t}\n }",
"public void persist() {\n\t\ttry {\n\t\t\tFileOutputStream fos = this._context.openFileOutput(\n\t\t\t\t\tConstants.CATALOG_XML_FILE_NAME, Context.MODE_PRIVATE);\n\t\t\tfos.write(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" ?>\\n\".getBytes());\n\t\t\tfos.write(\"<orders>\\n\".getBytes());\n\t\t\tfor (int i = 0; i < getOrderEntryCount(); i++) {\n\t\t\t\tOrderEntry oe = getOrderEntry(i);\n\t\t\t\tfos.write(oe.toXMLString().getBytes());\n\t\t\t}\n\t\t\tfos.write(\"</orders>\\n\".getBytes());\n\t\t\tfos.flush();\n\t\t\tfos.close();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tLog.d(Constants.LOGTAG, \" \" + OrderList.CLASSTAG\n\t\t\t\t\t+ \"Failed to write out file?\" + e.getMessage());\n\t\t}\n\t}",
"public void saveCart() throws IOException {\n String fileName = userid + \"cart.txt\";\n File file=new File(fileName);\n if(file.exists())\n {\n FileOutputStream fos = new FileOutputStream(fileName);\n ObjectOutputStream oos = new ObjectOutputStream(fos);\n oos.writeObject(this.cartContents);\n oos.flush();\n oos.close();\n fos.close();\n }\n else{\n file.createNewFile();\n }\n }",
"void toFile (String fileName);",
"private FileManager()\n {\n bookFile.open(\"bookdata.txt\");\n hisFile.open(\"history.txt\");\n idFile.open(\"idpassword.txt\");\n createIDMap();\n createHisMap(Customer.getInstance());\n }",
"public String getLogCollectionPath();",
"public static void init(){\n Path path = FileDirectoryUtil.getPath(\"src\", \"fileIO\", \"test.txt\");\n FileDirectoryUtil.tryCreateDirectory(path);\n\n // Try to create the file\n path = Paths.get(path.toAbsolutePath().toString(), \"test.txt\");\n FileDirectoryUtil.tryCreateFile(path);\n\n // Print out the final location of the file\n System.out.println(path.toAbsolutePath());\n\n // Try to write to the file\n IOUtil.tryWriteToFile(getContent(), path);\n\n // Try to print the content of the file\n IOUtil.tryPrintContents(path);\n\n }",
"@Override\n protected File getDataFile(String relFilePath) {\n return new File(getDataDir(), relFilePath);\n }",
"public FileViewer()\n {\n // initialise instance variables\n super(\"File Viewer 1.0\");\n setSize(300,400);\n getContentPane().add(txtIsiFile);\n try{\n txtIsiFile.setText(fl1.bacaFile(\"data.txt\"));\n }catch(Exception e){e.printStackTrace();}\n setVisible(true);\n }",
"public void fileInfo(String info);",
"public String getFile(Element temp){\r\n\t\t//Element temp = getPlace(where,\"Characters\");\r\n\t\treturn temp.getChildText(\"Path\") + temp.getChildText(\"File\");\r\n\t}",
"private void get_text() {\n InputStream inputStream = JsonUtil.class.getClassLoader().getResourceAsStream(\"data.txt\");\n BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));\n StringBuilder sb = new StringBuilder();\n String line = null;\n try {\n while ((line = reader.readLine()) != null) {\n sb.append(line);\n }\n } catch (Exception e) {\n e.printStackTrace();\n System.out.println(e.getMessage());\n }\n this.text = sb.toString().trim();\n }",
"Path getModBookFilePath();",
"private static void read(Client client,String user,String filename) throws SystemException, TException {\n\t\t\n\t\tString keyString = user + \":\" + filename;\n\t\tString key = sha_256(keyString);\n\t\t\n\t\t\n\t\tNodeID succNode = client.findSucc(key);\n\t\tString predIP = succNode.ip;\n\t\t// predIP = \"127.0.0.1\";\n\t\tint predPort = succNode.port;\n\t\ttry {\n\t\t\tTSocket transport = new TSocket(predIP, predPort);\n\t\t\ttransport.open();\n\t\t\tTBinaryProtocol protocol = new TBinaryProtocol(transport);\n\t\t\tchord_auto_generated.FileStore.Client client1 = new chord_auto_generated.FileStore.Client(protocol);\n\t\t\tSystem.out.println(\"Reading file location : \" + predPort + \" File :\"+filename+\"Owner : \"+user);\n\t\t\tRFile rFile = new RFile();\n\t\t\trFile = client1.readFile(filename, user);\n\t\t\tSystem.out.println(rFile.getContent());\n\t\t\tSystem.out.println(rFile.getMeta().getVersion());\n\t\t\tSystem.out.println(rFile.getMeta().getContentHash());\n\t\t\tSystem.out.println(\"Reading file Done----------\");\n\t\t\ttransport.close();\n\t\t} catch (TTransportException e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(0);\n\t\t}\n\t}",
"public SecurityLog()\n {\n String fileName = \"Log.txt\";\n File output = new File(fileName);\n if(output.exists())\n readFile(fileName);\n }",
"String savedFile();",
"public void writeXML(InvCatalogImpl catalog, String filename) throws IOException {\n BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream(filename));\n writeXML(catalog, os, false);\n os.close();\n }"
] | [
"0.68494034",
"0.62724",
"0.58964044",
"0.5834224",
"0.5834224",
"0.5834224",
"0.5811175",
"0.5795255",
"0.5763858",
"0.5699503",
"0.56514037",
"0.5628187",
"0.56185454",
"0.56074756",
"0.5579164",
"0.5577988",
"0.55410534",
"0.5497796",
"0.54913306",
"0.5485729",
"0.5484564",
"0.5484564",
"0.5482712",
"0.5473461",
"0.54715604",
"0.5461601",
"0.54178226",
"0.541125",
"0.53979605",
"0.5397454",
"0.5394417",
"0.5392883",
"0.5391317",
"0.5391317",
"0.5389913",
"0.5370066",
"0.5369944",
"0.5369944",
"0.5369689",
"0.5351066",
"0.5339117",
"0.53357524",
"0.53275114",
"0.53217363",
"0.5316459",
"0.5313032",
"0.5311405",
"0.5302969",
"0.52992684",
"0.52912587",
"0.5290421",
"0.5284321",
"0.5269692",
"0.5269112",
"0.5254988",
"0.52527416",
"0.5252588",
"0.52514917",
"0.5249422",
"0.5246504",
"0.5245912",
"0.52452564",
"0.5242409",
"0.5235975",
"0.52311933",
"0.52223593",
"0.522079",
"0.5217302",
"0.5216815",
"0.52130926",
"0.5212224",
"0.52094424",
"0.5204711",
"0.5198104",
"0.519539",
"0.5193613",
"0.5191322",
"0.5188808",
"0.51771635",
"0.5165683",
"0.5151625",
"0.5151616",
"0.51471734",
"0.5145941",
"0.5145591",
"0.5142555",
"0.51369405",
"0.5128473",
"0.51258004",
"0.51241237",
"0.5123988",
"0.51180863",
"0.51142013",
"0.5111544",
"0.510962",
"0.51095676",
"0.51087254",
"0.510229",
"0.50999665",
"0.50960314",
"0.5082611"
] | 0.0 | -1 |
Here we test method with Mask like ? or .that is incorrect regular expression this why we use our private method (String replaseIncorrectRegularExpression(String mask)). | @Test
public void findWithMaskIncorrectRegularExpression() throws Exception {
List<File> fileList = fileFinder.find(path, "?.txt", fileFinder.getFILES());
System.out.println(fileList.size());
int sero = fileList.size();
assertThat(sero == (fileList.size()), is(true));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean isRegex() {\n return false;\n }",
"@Override\n\tpublic boolean test(MyRegex t) {\n\t\treturn false;\n\t}",
"@Test\n @Disabled\n public void testValidateFormat() {\n assertTrue(RegExprMain.validateFormat(\"CC222CC\"));\n assertTrue(RegExprMain.validateFormat(\"DD333DD\"));\n assertTrue(RegExprMain.validateFormat(\"AA999AA\"));\n assertTrue(RegExprMain.validateFormat(\"VV555VV\"));\n assertTrue(RegExprMain.validateFormat(\"JJ777JJ\"));\n assertFalse(RegExprMain.validateFormat(\"J777JJ\"));\n assertFalse(RegExprMain.validateFormat(\"JJ777J\"));\n assertFalse(RegExprMain.validateFormat(\"JJ77JJ\"));\n assertFalse(RegExprMain.validateFormat(\"JJ777AA\"));\n assertFalse(RegExprMain.validateFormat(\"AA777JJ\"));\n \n\n }",
"private static String adaptRegEx(Mode mode, String regex, int flagMask, boolean removeWhitespace)\n throws QueryException {\n StringBuilder sb = new StringBuilder();\n boolean escaped = false;\n boolean groupStart = false;\n int completeGroups = 0;\n int backRef = 0;\n int charClassDepth = 0;\n int groupDepth = 0;\n\n for (char c : regex.toCharArray()) {\n if (escaped) {\n if (backRef == 0 && c == '0') {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION, \"Reference to group 0 not allowed\");\n } else if (c >= '0' && c <= '9') {\n if (charClassDepth > 0) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION,\n \"Back references in character class expressions\" + \" are disallowed.\");\n }\n backRef = backRef * 10 + Integer.parseInt(Character.toString(c));\n continue;\n }\n }\n\n if (backRef > 0) {\n // Check back reference that just ended\n if (backRef > completeGroups) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION,\n \"Back reference to nonexisting or unfinished group.\");\n } else {\n backRef = 0;\n escaped = false;\n }\n }\n\n if (c == '\\\\' && !escaped) {\n // Not preceded by backslash\n escaped = true;\n groupStart = false;\n continue;\n }\n\n if (c == '(' && !escaped) {\n groupStart = true;\n groupDepth++;\n escaped = false;\n continue;\n }\n\n if (c == '?' && !escaped && groupStart) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION,\n \"Pure groups are not supported in XQuery regular expressions.\");\n } else if (c == ')' && !escaped) {\n if (--groupDepth < 0) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION, \"Invalid sequence of brackets.\");\n }\n completeGroups++;\n } else if (c == '[' && !escaped) {\n charClassDepth++;\n } else if (c == ']' && !escaped) {\n if (--charClassDepth < 0) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION, \"Invalid sequence of brackets.\");\n }\n } else if (removeWhitespace) {\n // Remove whitespace outside of character classes\n if (charClassDepth == 0 && WHITESPACE.contains(c)) {\n // Don't touch boolean flags\n continue;\n }\n\n sb.append(c);\n }\n\n groupStart = false;\n escaped = false;\n }\n\n // Check for trailing '\\' (only valid with subsequent characters)\n if (escaped && backRef == 0) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION, \"Trailing backslash character in pattern.\");\n }\n\n // Check back reference if that was last token in pattern\n if (backRef > 0 && backRef > completeGroups) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION,\n \"Back reference to nonexisting or unfinished group.\");\n }\n\n // Check for dangling brackets\n if (charClassDepth != 0 || groupDepth != 0) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION, \"Pattern contains dangling brackets.\");\n }\n\n if (!removeWhitespace) {\n sb.append(regex);\n }\n\n if (mode == Mode.MATCH) {\n // Adapt for XQuery substring matching by extending pattern\n if (sb.charAt(0) != '^' || ((flagMask & Pattern.MULTILINE) == Pattern.MULTILINE)) {\n if ((flagMask & Pattern.DOTALL) == Pattern.DOTALL) {\n sb.insert(0, \".*\");\n } else {\n sb.insert(0, \"(?s:.*)\");\n }\n }\n\n if (sb.charAt(sb.length() - 1) != '$' || ((flagMask & Pattern.MULTILINE) == Pattern.MULTILINE)) {\n if ((flagMask & Pattern.DOTALL) == Pattern.DOTALL) {\n sb.append(\".*\");\n } else {\n sb.append(\"(?s:.*)\");\n }\n }\n }\n\n return sb.toString();\n }",
"@Test\n //@Disabled\n public void testValidateEmail() {\n assertTrue(RegExprMain.validateEmail(\"lubo.xaviluna@gmail.com\"));\n assertTrue(RegExprMain.validateEmail(\"lubo26@gmail.com\"));\n assertTrue(RegExprMain.validateEmail(\"lubo_xaviluna@gmail.com\"));\n assertTrue(RegExprMain.validateEmail(\"lubo06.xaviluna@gmail.com\"));\n assertFalse(RegExprMain.validateEmail(\"lubo@gmail.com6\"));\n assertFalse(RegExprMain.validateEmail(\"luna@gmail\"));\n assertFalse(RegExprMain.validateEmail(\"xaviluna@gmail0.com\"));\n assertFalse(RegExprMain.validateEmail(\"lubo.xaviluna@gmai_l.com\"));\n assertTrue(RegExprMain.validateEmail(\"luna#xavi@gmail.com\"));\n assertTrue(RegExprMain.validateEmail(\".xaviluna@gmail.com\"));\n \n \n\n }",
"@Test\n\tvoid runRegEx_IllegalCharacters() throws Exception {\n\t\tmaxScore += 10;\n\t\tRegEx.regEx = \"|*\";\n\t\ttry {\n\t\t\tRegExTree ret = RegEx.parse();\n\t\t\tAutomaton a = RegEx.RegExTreeToAutomaton(ret);\n\t\t\ta.toTable();\n\t\t\ta.eliminateEpsilonTransitions();\n\t\t\ta.minimize();\n\t\t\tfail();\n\t\t} catch (Exception e) {\n\t\t\tactualScore += 10;\n\t\t}\n\t}",
"@Test\n public void maskedpanTest() {\n assertEquals(\"400000******0002\", authResponse.getMaskedpan());\n }",
"@BeforeEach\n\tvoid setUpInvalidRE(){\n\t\tinvalidRE= new String[lengthInvalid];\n\t\t// (ab\n\t\tinvalidRE[0] = \"(ab\";\n\t\t// ab)\n\t\tinvalidRE[1] = \"ab)\";\n\t\t// *\n\t\tinvalidRE[2] = \"*\";\n\t\t// ?\n\t\tinvalidRE[3] = \"?\";\n\t\t// +\n\t\tinvalidRE[4] = \"+\";\n\t\t// a | b | +c\n\t\tinvalidRE[5] = \"a | b | +c\";\n\t\t// a | b | *c\n\t\tinvalidRE[6] = \"a | b | *c\";\n\t\t// a | b | ?c\n\t\tinvalidRE[7] = \"a | b | ?c\";\n\t\t// a | b | | c\n\t\tinvalidRE[8] = \"a | b | | c\";\n\t\t// uneven parenthesis\n\t\tinvalidRE[9] = \"(a(b(c(d)*)+)*\";\n\t\t// a | b |\n\t\tinvalidRE[10] = \"a | b | \";\n\t\t// invalid symbols\n\t\tinvalidRE[11] = \"a | b | $ | -\";\n\t\t// (*)\n\t\tinvalidRE[12] = \"(*)\";\n\t\t// (|a)\n\t\tinvalidRE[13] = \"(|a)\";\n\t\t// (.b)\n\t\tinvalidRE[14] = \"(.b)\";\n\t}",
"public Pattern getValidStringPattern();",
"private static boolean containsIllegals(String toExamine) {\n Pattern pattern = Pattern.compile(\"[+]\");\n Matcher matcher = pattern.matcher(toExamine);\n return matcher.find();\n }",
"java.lang.String getRegex();",
"java.lang.String getRegex();",
"protected abstract Regex pattern();",
"@Test(expected = IllegalArgumentException.class)\n public void testInvalidMakeNegativeMaskedAddressIPv4() {\n Ip4Address ipAddress = Ip4Address.valueOf(\"1.2.3.5\");\n Ip4Address ipAddressMasked;\n\n ipAddressMasked = Ip4Address.makeMaskedAddress(ipAddress, -1);\n }",
"public interface RegExp {\n String NAME_REGEXP = \"^[А-Я][а-я]{2,30}$\";\n String AGE_REGEXP = \"^((1[012][0-9])|([1-9][0-9]))$\";\n String EMAIL_REGEXP = \"^[-z0-9_.]{1,30}@([A-z]+[A-z0-9]{1,15}.){1,2}([A-z]+[A-z0-9]{1,15})$\";\n String CELL_PHONE_REGEXP = \"([\\\\+]\\\\d{2}\\\\s?)?(([\\\\(\\\\s]\\\\d{3}[\\\\)\\\\s])|\" +\n \"(\\\\d{3}))[\\\\s-]?\\\\d{3}[\\\\s-]?\\\\d{2}[\\\\s-]?\\\\d{2}$\";\n String CELL_PHONE_OPTIONAL_REGEXP = \"^(([\\\\+]\\\\d{2}\\\\s?)?(([\\\\(\\\\s]\\\\d{3}[\\\\)\\\\s])|\" +\n \"(\\\\d{3}))[\\\\s-]?\\\\d{3}[\\\\s-]?\\\\d{2}[\\\\s-]?\\\\d{2})?\";\n String LOCAL_PHONE_REGEXP = \"^([\\\\+]\\\\d{2}\\\\s?)?(([\\\\(\\\\s]\\\\d{3}[\\\\)\\\\s])|(\\\\d{3}))?[\\\\s-]?\\\\d{3}[\\\\s-]?\\\\d{3}$\";\n String COMMENT_REGEXP = \"^([\\\\d\\\\s\\\\w\\\\.\\\\,\\\\!]){0,127}$\";\n String GROUP_REGEXP = \"^[А-я]{4,10}$\";\n String SKYPE_NICK_REGEXP = \"^[\\\\w\\\\d\\\\_]{3,20}$\";\n String INDEX_REGEXP = \"^[\\\\d]{8}$\";\n String CITY_STREET_REGEXP = \"^[А-Я][а-я]{3,20}$\";\n String BUILDING_REGEXP = \"^[\\\\d]{1,3}[\\\\w]?$\";\n String FLAT_REGEXP = \"^[\\\\d]{1,3}$\";\n}",
"@Test(expected = InvalidRegexpException.class)\n public void testParseRegexp_invalid8() throws Throwable {\n BasicRegexp.parseRegexp(\"()\");\n }",
"public String applyMask( String stringToMask ) {\n Pattern p = Pattern.compile( getMatchRegex() );\n Matcher m = p.matcher( stringToMask );\n String maskedResult = applyMaskFn.apply( m );\n return maskedResult == null ? stringToMask : \n stringToMask.substring( 0, m.start( 1 ) )\n + maskedResult\n + stringToMask.substring( m.end() );\n }",
"boolean hasRegex();",
"@Test\n public void testParseRegexp_valid7() throws InvalidRegexpException {\n BasicRegexp re = BasicRegexp.parseRegexp(\"abc*def\");\n assertEquals(re.toString(), \"abc*def\");\n }",
"@Test(expected = IllegalArgumentException.class)\n public void testInvalidMakeTooLongMaskedAddressIPv4() {\n Ip4Address ipAddress = Ip4Address.valueOf(\"1.2.3.5\");\n Ip4Address ipAddressMasked;\n\n ipAddressMasked = Ip4Address.makeMaskedAddress(ipAddress, 33);\n }",
"private static String wildcardAsRegex( String wildcard ) {\n\t\tStringBuilder sb = new StringBuilder( wildcard.length() * 110 / 100 );\n\t\tfor ( int i = 0; i < wildcard.length(); i++ ) {\n\t\t\tfinal char c = wildcard.charAt( i );\n\t\t\tswitch (c) {\n\t\t\tcase '*':\n\t\t\t\tsb.append( \".*?\" );\n\t\t\t\tbreak;\n\n\t\t\tcase '?':\n\t\t\t\tsb.append( \".\" );\n\t\t\t\tbreak;\n\n\t\t\t// chars that have magic regex meaning. They need quoting to be taken\n\t\t\t// literally\n\t\t\tcase '$':\n\t\t\tcase '(':\n\t\t\tcase ')':\n\t\t\tcase '+':\n\t\t\tcase '-':\n\t\t\tcase '.':\n\t\t\tcase '[':\n\t\t\tcase '\\\\':\n\t\t\tcase ']':\n\t\t\tcase '^':\n\t\t\tcase '{':\n\t\t\tcase '|':\n\t\t\tcase '}':\n\t\t\t\tsb.append( '\\\\' );\n\t\t\t\tsb.append( c );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tsb.append( c );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\t}",
"public final void checkWholeExpFails(\n String sql,\n String expected)\n {\n assert sql.indexOf('^') < 0;\n checkExpFails(\"^\" + sql + \"^\", expected);\n }",
"@Test(expected = IllegalArgumentException.class)\n public void testInvalidMakeNegativeMaskPrefixIPv4() {\n Ip4Address ipAddress;\n\n ipAddress = Ip4Address.makeMaskPrefix(-1);\n }",
"@Test\n public void isEmailNotValidTest(){\n String email = \"ciao ij\";\n ReportSettingsPresenter.isEmailValid(email);\n\n Assert.assertEquals(false, matcher.matches());\n }",
"@Test\n public void testMaskPreserveGroup() {\n SSNUSMaskingProviderConfig configuration = new SSNUSMaskingProviderConfig();\n configuration.setMaskPreserveAreaNumber(false);\n MaskingProvider maskingProvider = new SSNUSMaskingProvider(configuration);\n SSNUSIdentifier identifier = new SSNUSIdentifier();\n\n String ssn = \"123-54-9876\";\n String maskedValue = maskingProvider.mask(ssn);\n SSNUS ssnUS = identifier.parseSSNUS(ssn);\n SSNUS maskedUS = identifier.parseSSNUS(maskedValue);\n\n assertFalse(maskedValue.equals(ssn));\n assertTrue(identifier.isOfThisType(maskedValue));\n assertFalse(\"Masked value:\" + maskedValue, maskedValue.startsWith(\"123\"));\n assertTrue(ssnUS.getGroup().equals(maskedUS.getGroup()));\n }",
"@Test(expected = IllegalArgumentException.class)\n public void testInvalidMakeTooLongMaskPrefixIPv4() {\n Ip4Address ipAddress;\n\n ipAddress = Ip4Address.makeMaskPrefix(33);\n }",
"@Test\n @Disabled\n public void testValidateTLF() {\n assertTrue(RegExprMain.validateTLF(\"622 24 64 59\"));\n assertTrue(RegExprMain.validateTLF(\"634 84 34 54\"));\n assertTrue(RegExprMain.validateTLF(\"645 74 44 53\"));\n assertFalse(RegExprMain.validateTLF(\"656 154 54 56\"));\n assertTrue(RegExprMain.validateTLF(\"656 14 54 56\"));\n assertTrue(RegExprMain.validateTLF(\"667 54 74 55\"));\n assertFalse(RegExprMain.validateTLF(\"656 16 5 56\"));\n assertFalse(RegExprMain.validateTLF(\"656 15A 54 56\"));\n assertTrue(RegExprMain.validateTLF(\"611 34 84 57\"));\n assertFalse(RegExprMain.validateTLF(\"6564 15 54 56\"));\n \n\n }",
"@Test\n\tvoid runRegExUnfoundText_LegalCase() throws Exception {\n\t\tmaxScore += 10;\n\t\tRegEx.regEx = \"Introuvable\";\n\t\ttry {\n\t\t\tRegExTree ret = RegEx.parse();\n\t\t\tAutomaton a = RegEx.RegExTreeToAutomaton(ret);\n\t\t\ta.toTable();\n\t\t\ta.eliminateEpsilonTransitions();\n\t\t\ta.minimize();\n\t\t\tArrayList<MatchResponse> response = a.search(\"books/babylon.txt\");\n\t\t\tassertEquals(0, response.size());\n\t\t} catch (Exception e) {\n\t\t\tfail();\n\t\t}\n\t\tactualScore += 10;\n\t}",
"public void testUnmatchedPassword() {\n\n // unmatched length\n boolean test1 = UserService.checkPasswordMatch(\"password123\", \"ppassword123\");\n assertFalse(test1);\n\n boolean test2 = UserService.checkPasswordMatch(\"ppassword123\", \"password123\");\n assertFalse(test2);\n\n // unmatched number\n boolean test3 = UserService.checkPasswordMatch(\"password123\", \"password124\");\n assertFalse(test3);\n\n // unmatched letter (case sensitive)\n boolean test4 = UserService.checkPasswordMatch(\"123password\", \"123Password\");\n assertFalse(test4);\n\n // unmatched letter\n boolean test5 = UserService.checkPasswordMatch(\"123password\", \"123passward\");\n assertFalse(test5);\n\n // unmatched letter/number\n boolean test6 = UserService.checkPasswordMatch(\"123password\", \"12password3\");\n assertFalse(test6);\n }",
"@Test\n\tvoid runRegExNoOperands_LegalCase() throws Exception {\n\t\tmaxScore += 10;\n\t\tRegEx.regEx = \"Sargon\";\n\t\ttry {\n\t\t\tRegExTree ret = RegEx.parse();\n\t\t\tAutomaton a = RegEx.RegExTreeToAutomaton(ret);\n\t\t\ta.toTable();\n\t\t\ta.eliminateEpsilonTransitions();\n\t\t\ta.minimize();\n\t\t\tArrayList<MatchResponse> response = a.search(\"books/babylon.txt\");\n\t\t} catch (Exception e) {\n\t\t\tfail();\n\t\t}\n\t\tactualScore += 10;\n\t}",
"private boolean isRegexValid(String string)\n {\n try\n {\n Pattern.compile(string, Pattern.MULTILINE);\n return true;\n }\n catch (PatternSyntaxException e)\n {\n return false;\n }\n }",
"public String getRegex();",
"@Test\n @Disabled\n public void testValidateMatriculaCoche() {\n assertFalse(RegExprMain.validateMatriculaCoche(\"543 JTD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"5432 JTD\"));\n assertFalse(RegExprMain.validateMatriculaCoche(\"5433 JAD\"));\n assertFalse(RegExprMain.validateMatriculaCoche(\"54333 JTD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"5432 JTD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"6784 CLD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"4563 BVB\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"6789 LMN\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"2435 JKD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"4567 GJD\"));\n \n\n }",
"@Test\n\tvoid testFormattedRE() {\n\t\tRegularLanguage rl[] = new RegularLanguage[lengthToFormatRE]; \n\t\tint i = 0;\n\t\tfor (String re : toFormatRE) {\n\t\t\trl[i++] = RegularExpression.isValidRE(re);\n\t\t}\n\t\t// Verify if all objects were created\n\t\tfor (RegularLanguage re : rl) {\n\t\t\tif (re.equals(null)) {\n\t\t\t\tfail(); // object couldn't be created\n\t\t\t}\n\t\t}\n\n\t\t// a***** -> a*\n\t\tassertEquals(\"a*\", rl[0].getRE().getFormattedRegex());\n\t\t// aa????? -> a?\n\t\tassertEquals(\"a?\", rl[1].getRE().getFormattedRegex());\n\t\t// a+++++ -> a+\n\t\tassertEquals(\"a+\", rl[2].getRE().getFormattedRegex());\n\t\t// a?*?*?***???* -> a*\n\t\tassertEquals(\"a*\", rl[3].getRE().getFormattedRegex());\n\t\t// a?+?+?+++???+ -> a*\n\t\tassertEquals(\"a*\", rl[4].getRE().getFormattedRegex());\n\t\t// a*+*+*++++***+* -> a*\n\t\tassertEquals(\"a*\", rl[5].getRE().getFormattedRegex());\n\t\t// a?+*?+?***???+++***?+?*+* -> a*\n\t\tassertEquals(\"a*\", rl[6].getRE().getFormattedRegex());\n\t\t\t\n\t}",
"@Test //TEST FIVE\n void testSpecialCharactersRabbitName()\n {\n Rabbit_RegEx rabbit_Name = new Rabbit_RegEx();\n rabbit_Name.setRabbitName(\"Pot!at!*\"); //potat or potato w/out an o\n assertFalse(rabbit_Name.getRabbitName().matches(\"[A-Za-z-]*\"));\n }",
"public Boolean maskText();",
"public String getRegEx();",
"@Test\n public void testReplacingFailure()\n {\n String expectedValue=\"datly fry\",actualValue;\n actualValue=replaceingchar.replaceChar(inputString);\n assertNotEquals(expectedValue,actualValue);\n }",
"@Test //TEST SIX\n void testSpecialCharactersBreedName()\n {\n Rabbit_RegEx rabbit_breed = new Rabbit_RegEx();\n rabbit_breed.setBreedName(\"Champagne d'Argent\");\n assertFalse(rabbit_breed.getBreedName().matches(\"^[A-Za-z][a-zA-Z- ][a-zA-z- ]*\"));\n }",
"@Test(timeout = 4000)\n public void test026() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.getMetaData((Connection) null, \"43X50.U\", \"43X50.U\", true, false, false, true, \"#hl2(.N!cDa@pc@R\", true);\n fail(\"Expecting exception: PatternSyntaxException\");\n \n } catch(PatternSyntaxException e) {\n //\n // Unclosed group near index 16\n // #hl2(.N!cDa@pc@R\n //\n verifyException(\"java.util.regex.Pattern\", e);\n }\n }",
"@Test\n public void testParseRegexp_valid3() throws InvalidRegexpException {\n BasicRegexp re = BasicRegexp.parseRegexp(\"a b c d\");\n assertEquals(re.toString(), \"abcd\");\n }",
"private static boolean checkWithRegex(String expression, String pattern) {\n Pattern p = Pattern.compile(pattern, Pattern.UNICODE_CHARACTER_CLASS);\n Matcher m = p.matcher(expression);\n return m.matches();\n }",
"public void assertNotEval(final String expression, final String textPattern);",
"@Test\n public void testOptimise_3() throws InvalidRegexpException {\n BasicRegexp re1 = BasicRegexp.parseRegexp(\"a*a*\");\n BasicRegexp re2 = BasicRegexp.parseRegexp(\"a*a?\");\n BasicRegexp re3 = BasicRegexp.parseRegexp(\"a?a*\");\n BasicRegexp re4 = BasicRegexp.parseRegexp(\"a?a?a?a?a*\");\n BasicRegexp re5 = BasicRegexp.parseRegexp(\"a?a*a*a?a*a?a?a?a*a*a?a*a?\");\n\n assertEquals(re1.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"a*\");\n assertEquals(re2.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"a*\");\n assertEquals(re3.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"a*\");\n assertEquals(re4.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"a*\");\n assertEquals(re5.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"a*\");\n }",
"@NCheck(failSpecificationType = IObjectStringNotMatchingFail.class)\n boolean isStringNotMatching(Object caller, String referenceA, String regex);",
"@Test\n public void testParseRegexp_correctness1new()\n throws InvalidRegexpException {\n BasicRegexp re = BasicRegexp.parseRegexp(\"(01|10)*1111\");\n assertEquals(re.toString(), \"(01|10)*1111\");\n }",
"@BeforeEach\n\tvoid setUpValidRE(){\n\t\tvalidRE= new String[lengthValid];\n\t\t// ab\n\t\tvalidRE[0] = \"ab\";\n\t\t// (ab)\n\t\tvalidRE[1] = \"(ab)\";\n\t\t//(ab)*\n\t\tvalidRE[2] = \"(ab)*\";\n\t\t// a???\n\t\tvalidRE[3] = \"a???\";\n\t\t// a***\n\t\tvalidRE[4] = \"a***\";\n\t\t// a+++\n\t\tvalidRE[5] = \"a+++\";\n\t\t// (((a)))\n\t\tvalidRE[6] = \"(((a)))\";\n\t\t// (a | ab | c*)*\n\t\tvalidRE[7] = \"(a | ab | c*)*\";\n\t\t// (a | ab | c*)**??\n\t\tvalidRE[8] = \"(a | ab | c*)*??\";\n\t\t// ( a | (ab | cd)+ )+\n\t\tvalidRE[9] = \"(a | (ab | cd)+)+\";\n\t\t// 0 (01 | (02) * | (03)++) | (1?01?)\n\t\tvalidRE[10] = \"0 (01 | (02) * | (03)++) | (a?01?)\";\n\t\t// a | &\n\t\tvalidRE[11] = \"a | &\";\n\t\t// &*\n\t\tvalidRE[12] = \"&*\";\n\t\t// (())* (empty language)\n\t\tvalidRE[13] = \"(())*\";\n\t\t// (a*b)*\n\t\tvalidRE[14] = \"(a*b)*\";\n\t\t// (a | & | a*b?c+)*\n\t\tvalidRE[15] = \"(a | & | a*b?c+)*\";\n\t}",
"@Test\n public void testCrazyPatterns() {\n assertEquals(\"java\\\\.\\\\{.*\\\\}\\\\.Array\", glob2Pattern(\"java.{**}.Array\").pattern());\n assertEquals(\"java\\\\./.*<>\\\\.Array\\\\$1\", glob2Pattern(\"java./**<>.Array$1\").pattern());\n assertEquals(\"\\\\+\\\\^\\\\$\", glob2Pattern(\"+^$\").pattern());\n }",
"public boolean containsIllegals(String toExamine) {\n Pattern pattern = Pattern.compile(APIConstants.REGEX_ILLEGAL_CHARACTERS_FOR_API_METADATA);\n Matcher matcher = pattern.matcher(toExamine);\n return matcher.find();\n }",
"String getErrorLinePattern();",
"public static void main(String[] args) {\r\n\t\t boolean matches_1 = Pattern.matches(\"[a-zA-Z0-9]{4}\", \"0Aa1\");\r\n\t\t boolean matches_2 = Pattern.matches(\"[a-zA-Z0-9]{4}\", \"0A@a1\");\r\n\t\t\t System.out.println(\"Regular Expression is \"+matches_1 +\" for given string(0Aa1)\");\r\n\t\t\t System.out.println(\"Regular Expression is \"+matches_2 +\" for given string(0A@a1)\");\r\n\t}",
"private static boolean checkPatternAppropriateness(String pattern,String input){\n Pattern p1=Pattern.compile(pattern);\n Matcher m1=p1.matcher(input);\n return m1.matches();\n }",
"@Test\n public void testParseRegexp_valid6() throws InvalidRegexpException {\n BasicRegexp re = BasicRegexp.parseRegexp(\"ab(cd(e))ff\");\n assertEquals(re.toString(), \"abcdeff\");\n }",
"@Test public void testCaretNegation() {\n String sql = \"select a from abc where ^a = 1\";\n String expected = \"SELECT `ABC`.`A`\\n\"\n + \"FROM `ABC` AS `ABC`\\n\"\n + \"WHERE ^`ABC`.`A` = 1\";\n getTester().checkRewrite(sql, expected);\n }",
"@Test(timeout = 4000)\n public void test06() throws Throwable {\n String string0 = SQLUtil.normalize(\"T/ayt.^*^>$)r\", false);\n assertEquals(\"T / ayt.^ * ^ > $) r\", string0);\n }",
"public boolean checkReg(String op) {\r\n\t\tString pattern = \"(R[1-2][0-9])|R[3][0-2]|R[0-9]$\";\r\n\t\tPattern reg = Pattern.compile(pattern);\r\n\t\tMatcher match = reg.matcher(op);\r\n\t\t\r\n\t\treturn match.find();\r\n\t}",
"public boolean match( DataExp p ) { return false; }",
"@Override public boolean\r\n matches(String regex, CharSequence input) {\n return false;\r\n }",
"@Test\n\tpublic void test61() {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//bug 10\n\t\tfor(int i =0;i<200;i++) {\n\t\t\tboolean dummy = RegExpMatcher.matches(String.valueOf(i), \"([0-9])+\");\n\t\t\tif(!dummy) {\n\t\t\t\t//System.err.print(i);\n \t\t\t\tassertTrue(dummy);\t\n\t\t\t\t}\n\t\t\telse {\n\t\t\t\t//System.out.println(\"no bug on index \"+i);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t//System.out.println(\"hello\");\n\t\t//assertTrue(RegExpMatcher.matches(\"\", \"([0-9])+\"));\n\t}",
"@Test\n void checkIsFalseForStringWithNumbersAndOtherChars() {\n // Act, Assert\n assertFalse(IsNumeric.check(\"a3\"));\n assertFalse(IsNumeric.check(\"3l\"));\n assertFalse(IsNumeric.check(\"345L\"));\n assertFalse(IsNumeric.check(\"32b\"));\n assertFalse(IsNumeric.check(\"*3.2 \"));\n assertFalse(IsNumeric.check(\"/0.2\"));\n assertFalse(IsNumeric.check(\"0.28L\"));\n assertFalse(IsNumeric.check(\"0.28.\"));\n assertFalse(IsNumeric.check(\"3.2.4\"));\n assertFalse(IsNumeric.check(\"0x400\"));\n assertFalse(IsNumeric.check(\"0.24Dd\"));\n }",
"private static String convertPattern(String pattern) {\n if (Strings.isNullOrEmpty(pattern)) {\n return pattern;\n }\n\n return \"^\" + pattern\n .replaceAll(\"\\\\[\", \"\\\\[\")\n .replaceAll(\"]\", \"\\\\]\")\n .replaceAll(\"\\\\.\", \"\\\\.\")\n .replaceAll(\"\\\\*\", \"\\\\*\")\n .replaceAll(\"(?<!\\\\\\\\)_\", \".\")\n .replaceAll(\"\\\\\\\\_\", \"_\")\n .replaceAll(\"(?<!\\\\\\\\)%\", \".*\")\n .replaceAll(\"\\\\\\\\%\", \"%\") +\n \"$\";\n }",
"@Test\n public void labelIsNotWithInvalidPattern() {\n String[] invalidLabels = StringUtil.INVALID_USERNAME;\n for (String label : invalidLabels) {\n propertyIsNot(label, descriptionS, CodeI18N.FIELD_PATTERN_INCORRECT_USERNAME,\n \"label property does not fulfill the username pattern restrictions\");\n }\n }",
"@Test\n public void testOptimise_5() throws InvalidRegexpException {\n BasicRegexp re1 = BasicRegexp.parseRegexp(\"a*b*\");\n BasicRegexp re2 = BasicRegexp.parseRegexp(\"a*b?\");\n BasicRegexp re3 = BasicRegexp.parseRegexp(\"a?b*\");\n BasicRegexp re4 = BasicRegexp.parseRegexp(\"a?a?b?a?a*\");\n BasicRegexp re5 = BasicRegexp.parseRegexp(\"a?a*a*a?a*b?a?a?a*b*a?a*a?\");\n\n assertEquals(re1.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"a*b*\");\n assertEquals(re2.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"a*b?\");\n assertEquals(re3.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"a?b*\");\n assertEquals(re4.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"a?a?b?a*\");\n assertEquals(re5.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"a*b?a*b*a*\");\n }",
"@Test(timeout = 4000)\n public void test076() throws Throwable {\n String string0 = SQLUtil.normalize(\"renamed,k3__[c*z4nv8e@bl6\", true);\n assertEquals(\"renamed, k3__ [ c * z4nv8e @ bl6\", string0);\n }",
"@Test\n\tpublic void TestR1NonIntegerParseableChars() {\n\t\tString invalid_solution = \"a74132865635897241812645793126489357598713624743526189259378416467251938381964572\";\n\t\tassertEquals(-1, sv.verify(invalid_solution));\n\t}",
"private String getMatchPattern(String pattern) {\n String mandatoryPart = pattern.trim().replaceAll(\"(\\\\s+?)\\\\[.+?\\\\]\", \"($1.+?(\\\\\\\\s|\\\\$))*\");\n mandatoryPart = mandatoryPart.replaceAll(\"\\\\s+\", \"\\\\\\\\s+\");\n return mandatoryPart.replaceAll(\"<.+?>\", \".+?\");\n }",
"@Test\r\n\tpublic void testNameInvalid() {\r\n\t\tassertFalse(Activity5Query.isNameCorrect(\"\"));\r\n\t\tassertFalse(Activity5Query.isNameCorrect(\"*\"));\r\n\t\tassertFalse(Activity5Query.isNameCorrect(\"-\"));\r\n\t\tassertFalse(Activity5Query.isNameCorrect(\"0-\"));\r\n\t\tassertFalse(Activity5Query.isNameCorrect(\"324tggs\"));\r\n\t\tassertFalse(Activity5Query.isNameCorrect(\"-feioj\"));\r\n\t\tassertFalse(Activity5Query.isNameCorrect(\"/\"));\r\n\t\tassertFalse(Activity5Query.isNameCorrect(\"@\"));\r\n\t\tassertFalse(Activity5Query.isNameCorrect(\" \"));\r\n\t}",
"@Test\r\n public void testInvalidRegularAssignmentExpressionWithSIUnits2() throws IOException {\n checkError(\"varM = 3 m\", \"0xA0182\");\r\n }",
"public void setPattern(String pattern) {\n/* 234 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"public static void main(String[] args) throws Exception {\n String patronA = \"[0-5]\";\n\n // conjunto de letras de \"a\" a \"c\"\n String patronB = \"[a-c]\";\n\n // conjunto de todas las letras minusculas\n String patronC = \"[a-z]\";\n\n // conjunto de numeros\n String patronD = \"[0-9]\";\n\n // ejemplo con tipo de dato string\n String textoAlfanumerico = \"0123aaaa\";\n System.out.println(\"Texto alfanumerico:\" + textoAlfanumerico);\n\n String replace1 = textoAlfanumerico.replaceAll(patronA, \"X\");\n System.out.println(\"Reemplazo de numeros con X: \" + replace1);\n\n String replace2 = textoAlfanumerico.replaceAll(patronB, \"X\");\n System.out.println(\"Reemplazo de letras con X: \" + replace2);\n\n\n //[0-5][a-c];\n //String patronComplejo = patronA + patronB;\n\n //[a-c]*[0-5]*\n //String patronComplejo = patronA + \"*\" + patronB + \"*\";\n\n //\"[a-z]+\"\n\n // + = una coincidencia\n // * = ninguna o muchas\n\n //String patronComplejo = \"(\" + patronA + patronC + \")+\";\n String patronComplejo = \"(\" + patronC + \")+\";\n\n String texto = \"hola, aacc este bbcc es mi 55222aaa texto 2663aaaa blah blah\";\n System.out.println(\"patron complejo:\" + patronComplejo);\n System.out.println(texto);\n\n Pattern pattern = Pattern.compile(patronComplejo);\n Matcher matcher = pattern.matcher(texto);\n\n // buscar ocurrencias\n while (matcher.find()) {\n System.out.println(\"Encontrado:\" + matcher.group());\n }\n\n\n }",
"public boolean isMatch(String inpWord, String targetWord){\n if (targetWord.contains(\"*\")){\n //do regexp compare of strings\n //String escapeMask=targetWord.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\+\\?\\.\\\\\\^\\$\\|]/g, \"\\\\$&\");\n String regexString=targetWord.replace(\"*\", \".*\");\n boolean test=inpWord.matches(\"(?i:\"+regexString+\")\");\n if (test){\n Log.i(\"ABTest\",\"wildcard match inp is \"+inpWord +\" and tgt word is \"+targetWord);\n }\n return test;\n } else {\n if (inpWord.equalsIgnoreCase(targetWord)){\n Log.i(\"ABTest\",\"exact match inp is \"+inpWord +\" and tgt word is \"+targetWord);\n return true;\n } else {\n return false;\n }\n }\n }",
"public static void main(String[] args) {\n Pattern p = Pattern.compile(\"2*5?$\");\n Matcher m = p.matcher(regex1);\n if (m.matches()) {\n System.out.println(\"YES ¦ \");\n } else {\n System.out.println(\"NO\");\n }\n\n }",
"@Test\r\n public void testMatchOptionsFallbackRegex() {\r\n File file = new File(MockFileSystem.getMockRoot().toFile(), \"The Office (US) - 1x02.mkv\");\r\n EpisodeMatch expResult = new EpisodeMatch(\"The Office (US)\", 1, 2);\r\n expResult.setEpisodeFile(file);\r\n TVMatcherOptions o = new TVMatcherOptions(new StandardTVElementMatcher()).fallbackTVMatcher();\r\n EpisodeMatch result = new TVMatcher(o).match(file.toPath());\r\n assertEpisodeMatchEquals(expResult, result);\r\n }",
"@Test\n @Disabled\n public void testValidateNIF() {\n assertTrue(RegExprMain.validateNIF(\"46098494P\"));\n assertFalse(RegExprMain.validateNIF(\"46098494A\"));\n assertTrue(RegExprMain.validateNIF(\"43267890C\"));\n assertFalse(RegExprMain.validateNIF(\"46098494A\"));\n assertFalse(RegExprMain.validateNIF(\"4609844AA\"));\n assertFalse(RegExprMain.validateNIF(\"4609844A\"));\n assertTrue(RegExprMain.validateNIF(\"45678932D\"));\n assertTrue(RegExprMain.validateNIF(\"41256789S\"));\n assertFalse(RegExprMain.validateNIF(\"460984943A\"));\n assertFalse(RegExprMain.validateNIF(\"46098494\"));\n\n }",
"@Test\r\n\tpublic void testIsValidPasswordNoUpperAlpha()\r\n\t{\r\n\t\ttry{\r\n\t\t\tassertTrue(PasswordCheckerUtility.isValidPassword(\"rainbow\"));\r\n\t\t}\r\n\t\tcatch(NoUpperAlphaException e)\r\n\t\t{\r\n\t\t\tassertTrue(\"Successfully threw a NoUpperAlphaExcepetion\",true);\r\n\t\t}\r\n\t}",
"private static boolean checkGenericPattern(String paramSaInput) {\r\n\t\tString saInput = paramSaInput;\r\n\t\tif (null != saInput) {\r\n\t\t\ttry {\r\n\t\t\t\tsaInput = URLDecoder.decode(saInput);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t// LOGGER.error(\"Problem in URLDecode saInput is \" + saInput);\r\n\t\t\t\t// LOGGER.error(e);\r\n\t\t\t\tLOGGER.info(\"Exception:\" + e);\r\n\t\t\t}\r\n\r\n\t\t\tRegularExpression regex = null;\r\n\t\t\ttry {\r\n\t\t\t\tfor (int ilCounter = 0; ilCounter < lSqlFilters.length; ilCounter++) {\r\n\t\t\t\t\tregex = new RegularExpression(lSqlFilters[ilCounter], \"i\");\r\n\r\n\t\t\t\t\tif (regex.matches(saInput)) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// if\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// for\r\n\t\t\tcatch (Exception e) {\r\n\t\t\t\tLOGGER.info(\"Exception\" + e);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// if not null\r\n\r\n\t\treturn true;\r\n\t}",
"public interface RegExp {\n String NUMBER_OF_COMPOSITION = \"^[1-2][0-9]|[1-9]$\";\n String BREAK_DATE_BY_DOT = \"[.]\";\n String IDENTIFY_BUMDLE = \"^([E|e][N|n])|[У|у][К|к][Р|р]$\";\n String DURATION = \"^[1-9]|[1-9][0-9]|[1-4][0-9][0-9]$\";\n}",
"public static boolean isValidinput(String query){\r\n\t\tPattern regex = Pattern.compile(\"[$&+,:;=@#|]\");\r\n\t\tMatcher matcher = regex.matcher(query);\r\n\t\tif (matcher.find()){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t}",
"public String checkRegularExpression(String input) {\n String actualResult=\"\";\n String pattern=\".*harry*\";\n boolean value= Pattern.matches(pattern,input);\n actualResult+=\"Is harry there?\"+value;\n return actualResult;\n\n }",
"private boolean isValidPattern(String pattern) {\n return !pattern.startsWith(\"-\") && !pattern.contains(\",\");\n }",
"@Test\n public void testOptimise_1() throws InvalidRegexpException {\n BasicRegexp re1 = BasicRegexp.parseRegexp(\"a**\");\n BasicRegexp re2 = BasicRegexp.parseRegexp(\"a+*\");\n BasicRegexp re3 = BasicRegexp.parseRegexp(\"a*+\");\n BasicRegexp re4 = BasicRegexp.parseRegexp(\"a*********************\");\n BasicRegexp re5 = BasicRegexp.parseRegexp(\"a++++++++++++++++++++*\");\n BasicRegexp re6 = BasicRegexp.parseRegexp(\"a????????????????????*\");\n BasicRegexp re7 = BasicRegexp.parseRegexp(\"a********************?\");\n BasicRegexp re8 = BasicRegexp.parseRegexp(\"a+?*+?*+?*\");\n BasicRegexp re9 = BasicRegexp.parseRegexp(\"a+?\");\n BasicRegexp re10 = BasicRegexp.parseRegexp(\"a?+\");\n\n assertEquals(re1.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"a*\");\n assertEquals(re2.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"a*\");\n assertEquals(re3.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"a*\");\n assertEquals(re4.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"a*\");\n assertEquals(re5.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"a*\");\n assertEquals(re6.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"a*\");\n assertEquals(re7.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"a*\");\n assertEquals(re8.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"a*\");\n assertEquals(re9.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"a*\");\n assertEquals(re10.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"a*\");\n }",
"default String patternConstraint(String pattern) {\n return switch (getType()) {\n case STRING -> validationPattern(pattern);\n default -> throw new RuntimeException(\"Only String can have a pattern\");\n };\n }",
"public void testNmCode() throws Exception {\n String nmCode = \"E1-541-392740-1-img.E1-543-392740-1-a.E1-4-DengLu-1-a.E1-38-red&ChaDian-1-a.UT-601-392740-2*2-a\";\r\n //Pattern p = Pattern.compile(\"\\\\w+-(?:543|601)-(\\\\w+)-(\\\\d+(\\\\*\\\\d+)?)-\\\\w+\\\\.?\");\r\n Pattern p = Pattern.compile(\"(\\\\w+)-(\\\\w+)-(\\\\w+)-(\\\\d+(\\\\*\\\\d+)?)-\\\\w+\\\\.?\");\r\n //Pattern p = Pattern.compile(\".+-(?:639|640)-(\\\\w+)-(\\\\d+(\\\\*\\\\d+)?)-.*\");\r\n Matcher m = p.matcher(nmCode);\r\n while (m.find()) {\r\n p(m.group(1) + \",\" + m.group(2) + \",\" + m.group(3));\r\n }\r\n }",
"@Test\n public void testOptimise_2() throws InvalidRegexpException {\n BasicRegexp re1 = BasicRegexp.parseRegexp(\"a+++++++++++++++++++++\");\n\n assertEquals(re1.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"a+\");\n }",
"public static void main(String[] args) {\n// System.out.println(alphanumeric.replaceAll(\"[aei]\", \"x\"));\n\n\n String regex = \"^[A-Z]|[a-z]\";\n String username = \"kaaviya\";\n\n System.out.println(username.replaceAll( \"^[A-Za-z][A-Za-z0-9_]{7,29}$\", \"x\"));\n System.out.println(username.matches(regex));\n\n }",
"private Annotation[] testRegEx(String regEx) {\n\t\tQueriableAnnotation data = this.parent.getActiveDocument();\n\t\treturn ((data == null) ? null : Gamta.extractAllMatches(data, regEx, 64));\n\t}",
"@Test\n public void shouldNotBeAbleToInputSpecialCharactersInTradeInValueField() {\n }",
"@Test\r\n public void testGetRegexp() {\r\n final Regexp re = rs.getRegexp(reString);\r\n assertTrue(rs.hasRegexp(reString));\r\n assertSame(rs.getRegexp(reString), re);\r\n }",
"public String validateRegexFormat(String input) {\n String regexFootball = \"^(.+?)(\\\\d+)-(\\\\d+)(.+?)$\";\n // Regex to check valid tennis game.\n String regexTennis = \"^(.+?) (\\\\W)(\\\\d+)(\\\\W) (\\\\d+) (.{2,})-(.{2,}) (\\\\W)(\\\\d+)(\\\\W) (.+?)$\";\n // Regex to check valid american football game.\n String regexAmericanFootball = \"^(.+?) (\\\\d+)-(\\\\d+) (.+) (.+(?= Quarter)) (Quarter)$\";\n\n\n if (input.matches(regexAmericanFootball)) {\n return this.getAmericanFootballResult(input);\n } else if (input.matches(regexTennis)) {\n return this.getTennisResult(input);\n } else if (input.matches(regexFootball)) {\n return this.getFootballResult(input);\n } else {\n return \"Format not detected! Verify the input text.\";\n }\n\n }",
"private void validCharachter() throws DisallowedCharachter {\n if (!test.equals(\"X\") && !test.equals(\"O\")) {\n throw (new DisallowedCharachter());\n }\n }",
"@Test //TEST THREE\n void testallNumbersRabbitName()\n {\n Rabbit_RegEx rabbit_Name = new Rabbit_RegEx();\n rabbit_Name.setRabbitName(\"12345\");\n assertFalse(rabbit_Name.getRabbitName().matches(\"[A-Za-z-]*\"));\n }",
"public void testInvalidInput(){\n\t\tString input = \"bye\";\n\t\tString actual = operation.processOperation(input);\n\t\tString expected = \"bye bye could not be performed\";\n\t\tassertEquals(expected,actual);\n\t}",
"@Override\n protected void compileRegex(String regex) {\n }",
"@Test\n public void containsIllegalCharacters() {\n assertTrue(Deadline.containsIllegalCharacters(INVALID_DEADLINE_ILLEGAL_CHAR_DAY.toString()));\n\n // Deadline contains illegal character in Month -> true\n assertTrue(Deadline.containsIllegalCharacters(INVALID_DEADLINE_ILLEGAL_CHAR_MONTH.toString()));\n\n // Deadline contains illegal character in Year -> true\n assertTrue(Deadline.containsIllegalCharacters(INVALID_DEADLINE_ILLEGAL_CHAR_YEAR.toString()));\n\n // No illegal character -> false\n assertFalse(Deadline.containsIllegalCharacters(VALID_1ST_JAN_2018.toString()));\n assertFalse(Deadline.containsIllegalCharacters(VALID_1ST_JAN_WITHOUT_YEAR.toString()));\n }",
"@Test\n public void testOptimise_8() throws InvalidRegexpException {\n BasicRegexp re1 = BasicRegexp.parseRegexp(\"(a|b)*(b|a)*\");\n BasicRegexp re2 = BasicRegexp.parseRegexp(\"(c|d)*|(d|c)*\");\n\n assertEquals(re1.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"(a|b)*\");\n assertEquals(re2.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"(c|d)*\");\n\n }",
"@Test\n public void test025() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n ArrayStringFilter.Mode arrayStringFilter_Mode0 = ArrayStringFilter.Mode.EXACT;\n String[] stringArray0 = new String[6];\n stringArray0[0] = \"iul \";\n stringArray0[1] = \"iul \";\n stringArray0[2] = \"iul \";\n ArrayStringFilter arrayStringFilter0 = new ArrayStringFilter(arrayStringFilter_Mode0, stringArray0);\n String string0 = arrayStringFilter0.toString();\n Any any0 = new Any((Component) errorPage0, (CharSequence) \"EXACT:iul ,iul ,iul ,null,null,null\");\n }",
"protected void validatePassword(){\n //Only Checking For Word Type Password With Minimum Of 8 Digits, At Least One Capital Letter,At Least One Number,At Least One Special Character\n Boolean password = Pattern.matches(\"^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9](?=.*[!@#$%^&*()])).{8,}$\",getPassword());\n System.out.println(passwordResult(password));\n }",
"@Test\n public void testDebugPrintBasicRegexp() throws InvalidRegexpException {\n BasicRegexp re1 = BasicRegexp.parseRegexp(\"(01|10)*1111\");\n BasicRegexp.debugPrintBasicRegexp(0, re1);\n }",
"@Test(timeout = 4000)\n public void test05() throws Throwable {\n String string0 = SQLUtil.normalize(\" Y*-X>Nz.q@~K^o8Z]v\", true);\n assertEquals(\"Y * - X > Nz.q @ ~ K ^ o8Z ] v\", string0);\n }",
"public void testRegEx(){\n\t\tString emptyLineRegEx = \"\\\\s*\";\r\n\t\t\r\n\t\tassertTrue(\"\".matches(emptyLineRegEx));\r\n\t\tassertTrue(\" \".matches(emptyLineRegEx));\r\n\t\tassertTrue(\"\\n\".matches(emptyLineRegEx));\r\n\t\tassertTrue(\"\\t\".matches(emptyLineRegEx));\r\n\t\tassertTrue(\"\\r\".matches(emptyLineRegEx));\r\n\t\tassertTrue(\"\\n \\t \".matches(emptyLineRegEx));\r\n\t\tassertTrue(\" \\n \\t \\n\\n\\n \".matches(emptyLineRegEx));\r\n\t\tassertFalse(\" . \\n \".matches(emptyLineRegEx));\r\n\t\t\r\n\t\t// space or tab any number of times\r\n\t\tString spaceTabRegEx = \"[ \\t]*\";\r\n\t\t\r\n\t\tassertTrue(\"\".matches(spaceTabRegEx));\r\n\t\tassertTrue(\" \".matches(spaceTabRegEx));\r\n\t\tassertTrue(\"\\t\".matches(spaceTabRegEx));\r\n\t\tassertTrue(\" \".matches(spaceTabRegEx));\r\n\t\tassertTrue(\"\\t\\t\".matches(spaceTabRegEx));\r\n\t\tassertTrue(\" \\t \\t \\t \".matches(spaceTabRegEx));\r\n\t\tassertFalse(\"\\n\".matches(spaceTabRegEx));\r\n\t\tassertFalse(\" l \".matches(spaceTabRegEx));\r\n\t\tassertFalse(\"\\t\\n\".matches(spaceTabRegEx));\r\n\t\t\r\n\t\t\r\n\t\t//Nucleotide sequence\r\n\t\tString ntRegEx = \"[ACGTacgt]+\";\r\n\t\t\r\n\t\tassertTrue(\"CAGTATGCATACC\".matches(ntRegEx));\r\n\t\tassertTrue(\"CTTATTTCAGGAAAATTTTTTCAAAACTGTAAAACAAAAACCATTTTTCACAGAATCTAAGGGTATCTGAAAGCTTAAAATAACTTCAGAAAGATATCAATTCCAGCTGTTTAGTACCTGAACTGTCTGTAAACGTTTCTTCTCGAATTATAGAAAATTTTCCACTTTTTCAAGTTCAGGTTTTCAAGAAACCCCACGATTTCCACTCATCGTTTCCAATGTCCAATTTCCCATCCAATTTGCCGCACTCTGACCCAATGACTTGTTCCTTTGCCAATCAATGCTACCTAATAAATTTAAAAGTTTAACACGCATCCAATTGACACACAGGTAACCGCCCTTTCTTCTTTTACATAATTCGGAAACTTCAAAGAGCCGAAGGTGTCGGTTGTAGCAGCAGCGGAGGAACGGATGCCAATTGCGCAACTCTCGGCTCAACTCTTTTAGTGCTCCGAGAGCAGGAAGAAGAATACTGTTGGGTTGTAATAAAGACGGATGTTTTTGTTCAGAGTAGATTAGCTCGTGTTTGATTGGATTTGACCGGATCAAGAGGGGAATGTCCTGGTGGAATTAAATTTTATTAGAATAAATTGTATTTGGTGTTTAAATTCGAATCAATAATATTTATGAGCTTTAATGAATAAGTGTTAGATTATATAATTCTATAATTTTTGAACAAGCAATTCAAAAAGAAAACAAATTTTAGTAACCTCCGAAATCAAGCTGGGTGGCCTCTAGAAGTTTTGAAAAAACTTTTTTTATATTCTGTTGGAGTTTTTTTAAGTTTTATAATTATAGGTTAATCTTTCTAATTTGTAAGCTTTTTCTTAACCAATTTTTTTTGTTAACATTTTTTTGGAATTATGCTATATGACCTATACCTAAAACAGTTTAAAAGTTTAAAAAAATTTTCTATATTTTTCACTTCGTATTGAACCTCCTGGGTACATATATTGACAGCACATATCTTGTTTGTCTCAGATTTTATCAAATAAGTTTAACAAGTAAACCATGCACCAAATATTTTTCTAGGTCTCTGTAGTTAGGAAATATTTAATAAAAATAAAAATAACCGAGATATGAGCCATCAAAGTAGATCAATTAAGGCACAGGAAAAAAGATCTGAATAAAATCGAAGTTCTTAAAAATATAAATCAAACAAAATTTTTTCCAGAATTTCAGCCGAGAATTTCCAGCCGATTTGTTTATATTTTCCACATCACTCCCCACACTTCTCTCACACAAACACGATAAAATCTTGAGAAGCAATTAGCGCCAATCAACTCAACACAAAAACGAAAAGCCAACGAAAAGCTAAAGCTATCATCGTTGTCGCGTCTATGAGCAACTCAATCGTTCATCATCCTCATCTTCAGAGTGCTCAAACCTACCGTAACCCGAATTGGGCGGAGCCAAAGGGTCCGAAACAGTGCACCAGGGCGGGGAGGGACCCTGAGAAACGAGAGGGAAGTGAGCAATTGTTGAAGTGTCAGTTGTGCTCATCGAGGTCCGATGAAGAGACGCGCCTGCTCACCTACACAACTGACTTCCCCCATATACCTTTTTCTAGAATTTCCTTTTTTAGATTTATACGGTCAGGTAAAAAGGTAGAGTTTTACAGTGTAGAAATTAGGAAATTGCTCAAAAAGCCGAGCAGAATGCATATAAGAAGTACCATAGCCCCAAAGATTCGATTTTCCAGGGTTCAATCAATTTTTGTACTTTGACAGCGTATATCTCAGTTTTCTTTGATTTTATCAAAAACTAGTCAACTGACAAAATACTTGAAAAGTATTCCTTTATATTTTGGTAGCTGACCATTGTTTGTTAAAATATAAGGGAATCGAAATGTCGGTTATCAAAGTAGAACCTAACCTAAATCGCTATATATGCTATTTTTCAAAAAAAAAAACACGTTTTACTTTGTCTCAACTTATTAATATTCTTTAATATTTTTTCTATTTCTACCATTTTCCAAATTTTCCAATAATTTTCCAGAA\".matches(ntRegEx));\r\n\t\tassertTrue(\"cagtagta\".matches(ntRegEx));\r\n\t\tassertTrue(\"aCgtTG\".matches(ntRegEx));\r\n\t\tassertFalse(\"a CgtTG\".matches(ntRegEx));\r\n\t\tassertFalse(\"aCXtTG\".matches(ntRegEx));\r\n\t\tassertFalse(\"a.CgtTG\".matches(ntRegEx));\r\n\t\tassertFalse(\"a1CgtTG\".matches(ntRegEx));\r\n\t\tassertFalse(\"aNCgtTG\".matches(ntRegEx));\r\n\t\tassertFalse(\"AGTATAATGACAACTTACAAAzTTGGGAAATCTGGAAAACCGAGC\".matches(ntRegEx));\r\n\t\t\r\n\t\t//PWM line \r\n\t\t// unicode for | is \\u007C\r\n\t\t// space: \\u0020\r\n\t\t\r\n\t\t\r\n\t\tSystem.out.println(\"\\u007C\");\r\n\r\n\t\tString pwmRexEx = \"[ACGT][\\\\t ]+\\\\|([\\\\t ]+[0-9]+)+\";\r\n\t\t\r\n\t\tassertTrue(\"G\t|\t12 \t2\t 2343\".matches(pwmRexEx));\r\n\t\tassertTrue(\"A | 1 2 3\".matches(pwmRexEx));\r\n\t\tassertTrue(\"C | 11 2234 3\".matches(pwmRexEx));\r\n\t\tassertTrue(\"T |\t1\t12\t3123\".matches(pwmRexEx));\r\n\t\tassertTrue(\"A\t|\t49\t0\t288\t26\t77\t67\t45\t50\".matches(pwmRexEx));\r\n\t\tassertTrue(\"A\\t|\\t49\\t0\\t288\\t26\\t77\\t67\\t45\\t50\".matches(pwmRexEx));\r\n\t\tassertFalse(\"a | 1 2 3\".matches(pwmRexEx));\r\n\t\tassertFalse(\"A |\\n 1 2 3\".matches(pwmRexEx));\r\n\t\tassertFalse(\"A 1 2 3\".matches(pwmRexEx));\r\n\t\tassertFalse(\"A |\t1 C 3\".matches(pwmRexEx));\r\n\t\tassertFalse(\"C |1 2 3\".matches(pwmRexEx));\r\n\t\t\r\n\t\t\r\n\t\t// fasta sequence name\r\n\t\t\r\n\t\tString fastaNameSeqRegEx = \">[ \\t]*\\\\w+.*\"; \r\n\t\t\r\n\t\tassertTrue(\"> name \".matches(fastaNameSeqRegEx));\r\n\t\tassertTrue(\">name\".matches(fastaNameSeqRegEx));\r\n\t\tassertTrue(\">\\t name\\t\".matches(fastaNameSeqRegEx));\r\n\t\tassertTrue(\"> name123 stuf\\t12342 \\t\".matches(fastaNameSeqRegEx));\r\n\t\tassertTrue(\">check sda\".matches(fastaNameSeqRegEx));\r\n\t\tassertTrue(\"> negExSeq_0_B0304.1\".matches(fastaNameSeqRegEx));\r\n\t\t\r\n\t\tassertFalse(\"\".matches(fastaNameSeqRegEx));\r\n\t\tassertFalse(\" > name \".matches(fastaNameSeqRegEx));\r\n\t\tassertFalse(\">\\tname\\t\\n\".matches(fastaNameSeqRegEx));\r\n\t\tassertFalse(\">\\t\".matches(fastaNameSeqRegEx));\r\n\t\t\r\n\t\t\r\n\t\t//fasta file sequence\r\n\t\t\r\n\t\tString oneFastaSection = \"\\\\s*\" + fastaNameSeqRegEx + \"\\\\s*\\n+\" + \"[ACGTacgt]+\" ;\r\n\t\tString fastaSeqRegEx = \"(\" + oneFastaSection + \"[ \\t\\r]*\\n\" + \")*\" + oneFastaSection + \"\\\\s*\" ;\r\n\t\t\r\n\t\tassertTrue(\"> Y105E8B.1c\\nacgtacgtacggttacCTTACAAAATTGGGAAATCTGGAAAACCGAGC\".matches(fastaSeqRegEx));\r\n\t\tassertTrue(\"> negExSeq_0_B0304.1\\nCCACGCTTGATATATGGA\\n\".matches(fastaSeqRegEx));\r\n\t\tassertTrue(\"> negExSeq_0_B0304.1\\nCCACGCTTGATATATGGAAGCGTACAACAGGCATTATTCCATC\\n>C02B8.4\\nCTTATTTCAGGAAAATTTTTTCAAA\".matches(fastaSeqRegEx));\r\n\t\tassertTrue(\"\\t\\t\\t\\t\\t\\n> negExSeq_0_B0304.1\\nCCACGCTTGATATATGGAAGCGTACAACAGGCATTATTCCATC\\n\\t\\t\\t\\t\\n> C02B8.4\\nCTTATTTCAGGAAAATTTTTTCAAAA\\n\\t\\t \\n \\t\".matches(fastaSeqRegEx));\r\n\t\tassertTrue(\"\\t\\t\\t\\t\\r\\n> negExSeq_0_B0304.1\\r\\nCCACGCTTGATATATGGAAGCGTACAACAGGCATTATTCCATC\\n\\t\\t\\t\\t\\n> C02B8.4\\nCTTATTTCAGGAAAATTTTTTCAAAA\\n\\t\\t \\n \\t\".matches(fastaSeqRegEx));\r\n\t\tString realOutput = \"\\t\\t\\t\\t\\t\\r\\n> B0304.1\\r\\nCTTATTTCAGGGAA\\r\\n\\r\\n> F29F11.5\\r\\nGCCACATGG\\r\\n\\r\\n\\t\\t\\t\";\r\n\t\tassertTrue(realOutput.matches(fastaSeqRegEx));\r\n\t\r\n\t\t\r\n\t\t\r\n\t\tassertFalse(\"\".matches(fastaSeqRegEx));\r\n\t\tassertFalse(\"> Y105E8B.1c\\n\".matches(fastaSeqRegEx));\r\n\t\tassertFalse(\"> Y105E8B.1c\\nAGTATAATGACAACTTACAAAzTTGGGAAATCTGGAAAACCGAGC\".matches(fastaSeqRegEx));\r\n\t\tassertFalse(\"> Y105E8B.1c acgtacgtacggttacCTTACAAAATTGGGAAATCTGGAAAACCGAGC\".matches(fastaSeqRegEx));\r\n\t\tassertFalse(\"> negExSeq_0_B0304.1\\nCCACGCTTGATATATGGAAGCGTACAACAGGCATTATTCCATC >C02B8.4\\nCTTATTTCAGGAAAATTTTTTCAAA\".matches(fastaSeqRegEx));\r\n\t\tassertFalse(\"> negExSeq_0_B0304.1\\nCCACGCTTGATATATGGAAGCGTACAACAGGCATTATTCCATC\\n\\nCTTATTTCAGGAAAATTTTTTCAAA\".matches(fastaSeqRegEx));\r\n\t\tassertFalse(\"\".matches(fastaSeqRegEx));\r\n\t\t\r\n\t\t\r\n\t\t// pwm line: \r\n\r\n\t\tString pwmLineRegEx1 = \"[ACGTacgt][ \\t]*\\\\|([ \\t]*\\\\d+)+[ \\t]*\";\r\n\t\t\r\n\t\tassertTrue(\"A | 2 26 7\".matches(pwmLineRegEx1));\r\n\t\tassertTrue(\"A |2 26 7\".matches(pwmLineRegEx1));\r\n\t\tassertTrue(\"A| 2 26 7\".matches(pwmLineRegEx1));\r\n\t\tassertTrue(\"A\\t| \\t2 \\t\\t\\t26 7\\t\\t \".matches(pwmLineRegEx1));\r\n\r\n\t\tassertFalse(\"\".matches(pwmLineRegEx1));\r\n\t\tassertFalse(\" \\t \\t \".matches(pwmLineRegEx1));\r\n\t\tassertFalse(\"abra-cadabra\".matches(pwmLineRegEx1));\r\n\t\tassertFalse(\"> test A | 1 2 3\".matches(pwmLineRegEx1));\r\n\t\tassertFalse(\"A 2 26 7\".matches(pwmLineRegEx1));\r\n\t\tassertFalse(\"A | 2 A 7\".matches(pwmLineRegEx1));\r\n\t\tassertFalse(\"A 2 26 7\".matches(pwmLineRegEx1));\r\n\t\tassertFalse(\"A [ 2 26 7]\".matches(pwmLineRegEx1));\r\n\t\t\r\n\t\t\r\n\t\tString pwmLineRegEx2 = \"[ACGTacgt][ \\t]*\\\\[([ \\t]*\\\\d+)+[ \\t]*\\\\][ \\t]*\";\r\n\r\n\t\tassertTrue(\"A [ 2 26 7]\".matches(pwmLineRegEx2));\r\n\t\tassertTrue(\"A\\t[\\t2\\t26\\t7\\t]\".matches(pwmLineRegEx2));\r\n\t\tassertTrue(\"A[ 2 26 7]\".matches(pwmLineRegEx2));\r\n\t\t\r\n\t\tassertFalse(\"\".matches(pwmLineRegEx2));\r\n\t\tassertFalse(\" \\t \\t \".matches(pwmLineRegEx2));\r\n\t\tassertFalse(\"abra-cadabra\".matches(pwmLineRegEx2));\r\n\t\tassertFalse(\"> test A | 1 2 3\".matches(pwmLineRegEx2));\r\n\t\tassertFalse(\"A 2 26 7\".matches(pwmLineRegEx2));\r\n\t\tassertFalse(\"2 26 7\".matches(pwmLineRegEx2));\r\n\t\tassertFalse(\"A | 2 A 7\".matches(pwmLineRegEx2));\r\n\t\tassertFalse(\"A 2 26 7\".matches(pwmLineRegEx2));\r\n\t\tassertFalse(\"A 2 26 7\".matches(pwmLineRegEx2));\r\n\t\tassertFalse(\"A [ 2 26 7\".matches(pwmLineRegEx2));\r\n\t\tassertFalse(\"A [ ]\".matches(pwmLineRegEx2));\r\n\t\tassertFalse(\"A | 2 26 7\".matches(pwmLineRegEx2));\r\n\t\t\r\n\t\tString pwmRegEx1 = \"[Aa][ \\t]*\\\\|([ \\t]*\\\\d+)+[ \\t]*\\\\s*\\n\" +\r\n\t\t\t\t\"[Cc][ \\t]*\\\\|([ \\t]*\\\\d+)+[ \\t]*\\\\s*\\n\" +\r\n\t\t\t\t\"[Gg][ \\t]*\\\\|([ \\t]*\\\\d+)+[ \\t]*\\\\s*\\n\" +\r\n\t\t\t\t\"[Tt][ \\t]*\\\\|([ \\t]*\\\\d+)+[ \\t]*\\\\s*\";\r\n\t\t\r\n\t\tassertTrue(\"A | 2 26 7\\nC | 2 26 7\\nG | 2 26 7\\nT | 2 26 7\".matches(pwmRegEx1));\r\n\t\tassertTrue(\"A | 2 26 7\\nC | 2 26 7\t\\nG | 2 26 7\\nT |\t2\t\t26 7\\r\\n\".matches(pwmRegEx1));\r\n\r\n\t\tassertFalse(\"\".matches(pwmRegEx1));\r\n\t\tassertFalse(\"A | 2 26 7\\nC | 2 26 7\\nG | 2 26 7\".matches(pwmRegEx1));\r\n\t\tassertFalse(\"A 2 26 7\\nC | 2 26 7\t\\nG | 2 26 7\\nT |\t2\t\t26 7\\r\\n\".matches(pwmRegEx1));\r\n\r\n\t\r\n\t\tString pwmRegEx2 = \"[Aa][ \\t]*\\\\[([ \\t]*\\\\d+)+[ \\t]*\\\\][ \\t]*\\\\s*\\n\" +\r\n\t\t\"[Cc][ \\t]*\\\\[([ \\t]*\\\\d+)+[ \\t]*\\\\][ \\t]*\\\\s*\\n\" +\r\n\t\t\"[Gg][ \\t]*\\\\[([ \\t]*\\\\d+)+[ \\t]*\\\\][ \\t]*\\\\s*\\n\" +\r\n\t\t\"[Tt][ \\t]*\\\\[([ \\t]*\\\\d+)+[ \\t]*\\\\][ \\t]*\\\\s*\";\r\n\r\n\t\tassertTrue(\"A [ 2 26 7]\\r\\nC [ 2 26 7]\\r\\nG [ 2 26 7]\\nT [ 2 26 7]\".matches(pwmRegEx2));\r\n\t\tassertTrue(\"A [\\t2 26 7]\\r\\nC [ 2 26 7]\\r\\nG [ 2 26 7]\\nT [ 2 26 7]\\n\".matches(pwmRegEx2));\r\n\r\n\t\tassertFalse(\"\".matches(pwmRegEx2));\r\n\t\tassertFalse(\"A [ 2 26 7]\\r\\nC [ 2 26 7]\\r\\nG [ 2 26 7]\\nT [ 2 26 7\".matches(pwmRegEx2));\r\n\t\tassertFalse(\"A [ 2 26 7]\\r\\nC [ 2 26 7]G [ 2 26 7]\\nT [ 2 26 7]\".matches(pwmRegEx2));\r\n\t\tassertFalse(\"A [ 2 26 7]\\r\\nC [ 2 26 7]\\r\\nG [ 2 26 7]\\nA [ 2 26 7]\".matches(pwmRegEx2));\r\n\t\tassertFalse(\"\\tA [ 2 26 7]\\r\\nC [ 2 26 7]\\r\\nG [ 2 26 7]\\nT [ 2 26 7]\".matches(pwmRegEx2));\r\n\t\t\r\n\t}"
] | [
"0.5937936",
"0.5840171",
"0.576688",
"0.57652235",
"0.57536376",
"0.5716944",
"0.5684111",
"0.5641903",
"0.56361824",
"0.5568839",
"0.5538428",
"0.5538428",
"0.5519104",
"0.55109954",
"0.54756796",
"0.54637533",
"0.5448868",
"0.54363054",
"0.541988",
"0.54038775",
"0.5394659",
"0.53874224",
"0.5366244",
"0.53561217",
"0.5344027",
"0.53436285",
"0.5343043",
"0.532514",
"0.5323677",
"0.53167695",
"0.5302731",
"0.52974886",
"0.5295152",
"0.52947503",
"0.5292952",
"0.52686936",
"0.5252287",
"0.5247903",
"0.5247298",
"0.5242114",
"0.52400994",
"0.5239095",
"0.5237427",
"0.5218918",
"0.52118224",
"0.52045095",
"0.5150699",
"0.5144979",
"0.5143077",
"0.51355666",
"0.51355374",
"0.5132494",
"0.5123643",
"0.51204544",
"0.51058495",
"0.5101577",
"0.5100943",
"0.5095167",
"0.5091431",
"0.50901973",
"0.5080394",
"0.5070727",
"0.507069",
"0.5069294",
"0.50687003",
"0.5061405",
"0.5059134",
"0.5055872",
"0.50430864",
"0.503978",
"0.5032092",
"0.503063",
"0.5028381",
"0.50272924",
"0.5027009",
"0.50223744",
"0.5021419",
"0.5018546",
"0.501055",
"0.5009968",
"0.5009536",
"0.5004249",
"0.49975836",
"0.49965358",
"0.49738738",
"0.49736616",
"0.4970748",
"0.49688777",
"0.49630895",
"0.4957311",
"0.49559465",
"0.49554202",
"0.495339",
"0.4952258",
"0.49516466",
"0.4951029",
"0.49469668",
"0.49452764",
"0.49426308",
"0.49272814"
] | 0.55479455 | 10 |
4. Client creates "visitor" objects and passes each to accept() calls | public static void main(String[] args) {
UpVisitor_6 up = new UpVisitor_6();
DownVisitor_7 down = new DownVisitor_7();
for (int i = 0; i < list.length; i++) {
list[i].accept(up);
}
for (int i = 0; i < list.length; i++) {
list[i].accept(down);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void accept(ConnectionClientSocket client) {\n client.visit(this);\n }",
"public abstract void accept(Visitor visitor);",
"void accept(Visitor visitor);",
"public void accept(Visitor visitor);",
"@Override\n public void accept(VisitorMessageFromServer visitorMessageFromServer) {\n visitorMessageFromServer.visit(this);\n }",
"public void accept(MessageVisitor visitor);",
"public void accept(IVisitor visitor);",
"public abstract void accept0(IASTNeoVisitor visitor);",
"void accept(Visitor<V> visitor);",
"public abstract void accept(Visitor v);",
"public Object accept(Visitor v, Object params);",
"interface VisitorAccept {\n\t/**\n\t * Methode permettant d'accepter le visiteur.\n\t * \n\t * @param visitor\n\t * ; MessageVisitor\n\t */\n\tpublic void accept(MessageVisitor visitor);\n}",
"@Test\n public void testServer() throws Exception{\n ServerMain s=new ServerMain(1,3,2,\"test\",InetAddress.getLocalHost(),null);\n uut=new ChatMessageRequest(\"test\",\"test2\",\"test\",MessageTypes.PM);\n uut.serverVisit(new Client(\"test\",s).getServerVisitor());\n\n uut=new ChatMessageRequest(\"test\",\"test2\",\"test\",MessageTypes.MATCH);\n uut.serverVisit(new Client(\"test\",s).getServerVisitor());\n\n uut=new ChatMessageRequest(\"test\",\"test2\",\"test\",MessageTypes.MATCH);\n uut.serverVisit(new Client(\"testInvalid\",s).getServerVisitor());\n }",
"public static void main(String[] args) throws IOException {\n ServerSocket server = new ServerSocket(8080);\n ExecutorService service = Executors.newCachedThreadPool();\n while (true) {\n Socket socket = server.accept();\n System.out.println(\"Client accept\");\n service.submit(new ClientSession(socket));\n }\n\n }",
"public static void main(String[] args) throws IOException\n {\n ServerSocket listener = new ServerSocket(PORT);\n\n while (true)\n {\n System.out.println(\"[SERVER] Waiting for connection . . . \");\n //takes in the user client sockets\n Socket client = listener.accept();\n //Announces that the user has connected\n System.out.println(\"[SERVER] Connected to client \" + client.getInetAddress());\n ClientHandler clientThread = new ClientHandler(client, clients);\n\n pool.execute(clientThread);\n }\n }",
"@Override\n public void run(){\n System.out.println(clientID+\" run\");\n open();\n if(isHost){ //HostClient listening\n try{\n controller.sendHostAddress(ip, port);\n socket = hostSocket.accept();\n System.out.println(clientID+\": run: accept\");\n close(); //closes hostSocket\n connected = true;\n open(); //gets streams\n controller.sendConnect(); \n }catch(IOException e){\n System.out.println(clientID+\": run: accept: failed: IOException: \"+e);\n }\n }\n while(connected){ //interprets requests from other client\n try{\n String request = streamIn.readUTF();\n System.out.println(clientID+\": receive: \"+request);\n String response[] = request.split(\"<&>\");\n controller.interpretRequest(response);\n }catch(IOException ioe){\n System.out.println(clientID+\": receive: failed: IOException:\"+ioe);\n connected = false; \n }\n }\n }",
"interface MessageVisitor {\n\t/**\n\t * Methode de visite du Message\n\t * \n\t * @param message\n\t * : Message\n\t */\n\tpublic void visit(Message message);\n\n\t/**\n\t * Methode de visite du BitField\n\t * \n\t * @param bf\n\t * : BitField\n\t */\n\tpublic void visit(BitField bf);\n\n\t/**\n\t * Methode de visite du Choke\n\t * \n\t * @param c\n\t * ; Choke\n\t */\n\tpublic void visit(Choke c);\n\n\t/**\n\t * Methode de visite du Have\n\t * \n\t * @param h\n\t * : Have\n\t */\n\tpublic void visit(Have h);\n\n\t/**\n\t * Methode de visite du Interested\n\t * \n\t * @param i\n\t * : Interested\n\t */\n\tpublic void visit(Interested i);\n\n\t/**\n\t * Methode de visite du KeepAlive\n\t * \n\t * @param ka\n\t * : KeepAlive\n\t */\n\tpublic void visit(KeepAlive ka);\n\n\t/**\n\t * Methode de visite du NotInterested\n\t * \n\t * @param ni\n\t * : NotInterested\n\t */\n\tpublic void visit(NotInterested ni);\n\n\t/**\n\t * Methode de visite du Request\n\t * \n\t * @param r\n\t * : Request\n\t */\n\tpublic void visit(Request r);\n\n\t/**\n\t * Methode de visite du SendBlock\n\t * \n\t * @param sb\n\t * : SendBlock\n\t */\n\tpublic void visit(SendBlock sb);\n\n\t/**\n\t * Methode de visite du Unchoke\n\t * \n\t * @param uc\n\t * : Unchoke\n\t */\n\tpublic void visit(Unchoke uc);\n\t\n\tpublic void visit(SendRSAKey srsak);\n\t\n\tpublic void visit(SendSymmetricKey ssyk);\n}",
"void visit(Visitor visitor);",
"private static void getClients() throws IOException {\r\n\t\tbidders=new ArrayList<Socket>();\r\n\t\tserverSocket=new ServerSocket(portno);\r\n\t\twhile ((bidders.size()<numBidders)&&(auctioneer==null)) {\r\n\t\t\tSocket temp=serverSocket.accept();\r\n\t\t\t//if (this client is a bidder)\r\n\t\t\t\tbidders.add(temp);\r\n\t\t\t//if (this client is the auctioneer)\r\n\t\t\t\tauctioneer=temp;\r\n\t\t}\r\n\t}",
"@Override\n public void accept(Visitor visitor) {\n visitor.visit(this);\n }",
"@Override\n public void accept(Visitor visitor) {\n visitor.visit(this);\n }",
"void clientConnected(Client client);",
"@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:36:07.245 -0500\", hash_original_method = \"4C7BE72C58D9A70D111AB53708810EA4\", hash_generated_method = \"AF157A7772AD2D9C1E3D30BCBFFC6CCE\")\n \npublic LocalSocket accept() throws IOException\n {\n LocalSocketImpl acceptedImpl = new LocalSocketImpl();\n\n impl.accept (acceptedImpl);\n\n return new LocalSocket(acceptedImpl);\n }",
"public static void main(String[] args) throws Throwable {\n ServerSocket server = new ServerSocket();\n server.bind(new InetSocketAddress(3000));\n System.out.println(\"Blocking Socket : listening for new Request\");\n while (true) { // <1>\n Socket socket = server.accept();\n //each incomming request(socket request) allocate in a separate thread\n new Thread(clientHandler(socket)).start();\n }\n }",
"public void run() {\n\t\tString choice = null;\n\t\tBufferedReader inFromClient = null;\n\t\tDataOutputStream outToClient = null;\n\t\t\n\t\ttry {\n\t\t\tinFromClient = new BufferedReader(new InputStreamReader(client.getInputStream()));\n\t\t\toutToClient = new DataOutputStream(client.getOutputStream());\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\ttry {\n\t\t\t// Loops until the client's connection is lost\n\t\t\twhile (true) {\t\n\t\t\t\t// Request that was sent from the client\n\t\t\t\tchoice = inFromClient.readLine();\n\t\t\t\tif(choice != null) {\n\t\t\t\t\tSystem.out.println(choice);\n\t\t\t\t\tswitch (choice) {\n\t\t\t\t\t\t// Calculates the next even fib by creating a new\n\t\t\t\t\t\t// thread to handle that calculation\n\t\t\t\t\t\tcase \"NEXTEVENFIB\":\n\t\t\t\t\t\t\tnew EvenFib(client).run();\n\t\t\t\t\t\t\t// Increments the fib index tracker so no duplicates\n\t\t\t\t\t\t\t// are sent\n\t\t\t\t\t\t\tServer.fib++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t// Calculates the next even nextLargerRan by creating a new\n\t\t\t\t\t\t// thread to handle that calculation\n\t\t\t\t\t\tcase \"NEXTLARGERRAND\":\n\t\t\t\t\t\t\tnew NextLargeRan(client).run();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t// Calculates the next prime by creating a new\n\t\t\t\t\t\t// thread to handle that calculation\n\t\t\t\t\t\tcase \"NEXTPRIME\":\n\t\t\t\t\t\t\tnew NextPrime(client).run();\n\t\t\t\t\t\t\t// Increments the prime index tracker so no duplicates\n\t\t\t\t\t\t\t// are sent\n\t\t\t\t\t\t\tServer.prime++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// Displays that the client it was connected to\n\t\t\t// has disconnected\n\t\t\tSystem.out.println(\"Client Disconnected\");\n\t\t}\n\n\t}",
"public void accept(Visitor visitor) {\n\t\tvisitor.visit(this);\n\t}",
"private void treatAccept(SelectionKey key) throws IOException\n {\n ServerSocketChannel ssc = (ServerSocketChannel) key.channel();\n SocketChannel sc = ssc.accept();\n sc.configureBlocking(false);\n SelectionKey clientKey = sc.register(selector, SelectionKey.OP_READ,\n new RequestCommandHandler(root));\n\n System.out\n .println(\"New connection accepted for : \"\n + sc.socket().getRemoteSocketAddress() + \", key : \"\n + clientKey);\n }",
"public abstract void handleClient(Client conn);",
"public void run() {\n try {\n //Create the input object stream and output object stream for this client\n toClient = new ObjectOutputStream(client.getOutputStream());\n fromClient = new ObjectInputStream(client.getInputStream());\n login = false;\n\n while (!login) {/*Wait for a client to login*/\n try {\n receviedProtocol = (Protocol) fromClient.readObject();\n if (receviedProtocol.getMethod().equals(\"HELP\"))\n sendHelpMenu();\n else if (receviedProtocol.getMethod().equals(\"LOGIN\")) {\n authorize(receviedProtocol);\n login = true;\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n logout = false;\n while (!logout) {/*Keep conncetion between client and server until the client logout*/\n try{\n receviedProtocol = (Protocol)fromClient.readObject(); //Wait for client input\n startIndex = 0;//This will be used to track the starting point of next n groups to be send\n if(receviedProtocol.getMethod().equals(\"AG\"))\n allGroupHandler(receviedProtocol);\n else if(receviedProtocol.getMethod().equals(\"LOGOUT\")){\n logout();\n logout = true;\n }\n }catch (Exception e){\n e.printStackTrace();\n }\n\n }\n\n } catch (IOException e) {\n System.out.println(e);\n\n } finally {\n try {\n client.close();\n } catch (IOException e) {\n System.out.println(e);\n }\n }\n }",
"void initAndListen() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tSocket clientSocket = serverSocket.accept();\n\t\t\t\t// Startuje nowy watek z odbieraniem wiadomosci.\n\t\t\t\tnew ClientHandler(clientSocket, this);\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(\"Accept failed.\");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}\n\t}",
"public void listen(){\n \ttry{ \t\t\n \t\twhile(true){\n \t \t\tSocket socket = server.accept();\n \t \t\tString nickname = new String(\"Guest_\" + String.valueOf(nextId));\n \t \t\t\n \t \t\t// Create a server connection and connect it to the appropriate user.\n \t \t\tServerConnection userConnection = new ServerConnection(nextId, socket, this);\n \t \t\tUser user = new User(nextId, nickname, userConnection);\n \t \t\tuserConnection.setUser(user);\n \t \t\t\n \t \t\tsynchronized(userMap){\n \t \t\t\tuserMap.put(nextId, user);\n \t \t\t}\n \t \t\t// Send a response that connection was successful;\n \t \t\tuserConnection.sendMessage(new Message(Command.REPLY_SUCCESS, \"\", Calendar.getInstance(), \"\"));\n \t \t\t\n \t \t\tnextId++;\n \t\t}\n \t}\n \tcatch(IOException e){\n \t\te.printStackTrace();\n \t}\n }",
"@Override\n\tpublic void accept(Visitor visitor) {\n\t\t\n\t}",
"@Override\r\n\tpublic void run() {\r\n\t\twhile (closer) {\r\n\t\t\ttry {\r\n\t\t\t\tObjectInputStream ois = new ObjectInputStream(client.getInputStream());\r\n\t\t\t\tObject object = ois.readObject();\r\n\t\t\t\tArrayList<String> input = (ArrayList<String>) object;\r\n\t\t\t\tInteger election = inputTransformer(input);\r\n\t\t\t\tif (election == 1) {\r\n\t\t\t\t\tsl.getLogger().info(\"IncomingMessage on Client Type 1 - For Chat\");\r\n\t\t\t\t}\r\n\t\t\t\tif (election == 2) {\r\n\t\t\t\t\tsl.getLogger().info(\"IncomingMessage on Client Type 2 - For Points\");\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public AcceptThread() throws IOException {\n setName(\"TcpHarvester AcceptThread\");\n setDaemon(true);\n selector = Selector.open();\n for (ServerSocketChannel channel : serverSocketChannels) {\n channel.configureBlocking(false);\n channel.register(selector, SelectionKey.OP_ACCEPT);\n }\n }",
"private void beginAcceptClients() throws Exception {\r\n \t\tClientAcceptThread acceptClientsThread = new ClientAcceptThread(this.serverSocket, this);\r\n \t\tacceptClientsThread.start();\r\n \r\n \t\tLogger.logMessage(\"ClientAcceptThread started\");\r\n \t}",
"@Override\n\tpublic void accept(MessageHandlerVisitor visitor) {\n\n\t\tvisitor.visit(this, null, null, null);\n\t}",
"Object visitorResponse();",
"@Override\n\tpublic void acceptSession(int id, String agent) {\n\t\t\n\t}",
"@Override\r\n\tpublic void accept(Visitor v) {\r\n\t\tv.visit(this);\t\r\n\t}",
"public EchoClientHandler() {\n firstMessage = Unpooled.buffer(EchoClient.SIZE);\n for (int i = 0; i < firstMessage.capacity(); i ++) {\n firstMessage.writeByte((byte) i);\n }\n }",
"@Override\r\n\tpublic void accept(Visitor visitor) {\r\n\t\tvisitor.visit(this);\r\n\t}",
"@Override\n public void accept(VisitorMessageFromClient visitorMessageFromClient) {\n throw new UnsupportedOperationException();\n }",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\twhile (true) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tSocket socket = serverSocket.accept();\n\t\t\t\t\t\tclients.add(new Client(socket));\n\t\t\t\t\t\tSystem.out.println(\"[클라이언트 접속] \" + socket.getRemoteSocketAddress() + \": \"\n\t\t\t\t\t\t\t\t+ Thread.currentThread().getName());\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t// TODO: handle exception\n\t\t\t\t\t\tif (!serverSocket.isClosed()) {\n\t\t\t\t\t\t\tstopServer();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"public static void main(String[] args) throws IOException {\n ServerSocket ss = new ServerSocket(3000);\n\n // infinite loop is running for getting client request\n while (true) {\n Socket serverSocket = null;\n\n try {\n // server socket object receive incoming client requests\n serverSocket = ss.accept();\n count++;\n\n System.out.println(\"A new client\" + clientNum++ + \" is connected : \" + serverSocket);\n\n // getting input and out streams\n DataInputStream dataInputStream = new DataInputStream(serverSocket.getInputStream());\n DataOutputStream dataOutputStream = new DataOutputStream(serverSocket.getOutputStream());\n\n System.out.println(\"Allocating new thread for this client\" + clientNum);\n\n // create a new thread object\n Thread newThread = new ClientHandler(serverSocket, dataInputStream, dataOutputStream, count);\n\n // Invoking the start() method\n newThread.start();\n\n } catch (Exception e) {\n serverSocket.close();\n e.printStackTrace();\n }\n }\n }",
"public abstract double accept(TopologyVisitor visitor);",
"public void run() {\n try {\n // accepts the connection request.\n SelectableChannel peerHandle = this._handle.accept();\n if (peerHandle != null) {\n // now, create a service handler object to serve the\n // the client.\n ServiceHandler handler =\n this._factory.createServiceHandler(\n this._reactor,\n peerHandle);\n if (handler != null)\n // give the service handler object a chance to initialize itself.\n handler.open();\n }\n } catch (IOException ex) {\n MDMS.ERROR(ex.getMessage());\n }\n }",
"public Visitor() {}",
"@Override\n\tpublic void accept(Visitor visitor) {\n\t\tvisitor.visit(this);\n\t}",
"@Override\r\n \tpublic final void accept(IASTNeoVisitor visitor) {\r\n \t\tassertNotNull(visitor);\r\n \t\t\r\n \t\t// begin with the generic pre-visit\r\n \t\tif(visitor.preVisit(this)) {\r\n \t\t\t// dynamic dispatch to internal method for type-specific visit/endVisit\r\n \t\t\taccept0(visitor);\r\n \t\t}\r\n \t\t// end with the generic post-visit\r\n \t\tvisitor.postVisit(this);\r\n \t}",
"void startListening()\n {\n if (outstanding_accept != null || open_connection != null) {\n return;\n }\n \n outstanding_accept = new AcceptThread(bt_adapter, handler);\n outstanding_accept.start();\n }",
"@Override\n public void run() {\n // When we read from the input stream, broadcast it to all client observers to relay to the clients via the respective socket.\n try {\n Object dataFromClient = inputFromClient.readObject();\n while (dataFromClient != null) {\n setChanged();\n if(dataFromClient instanceof Integer){\n Integer clientID = (Integer) dataFromClient;\n // This client sent its client id to be added to or removed from registered users. So, send the updated list to all observers to push to ALL clients.\n if(registeredUsers.contains(clientID)){\n removeClient(clientID);\n clientData.remove(clientID);\n }else {\n registeredUsers.add((Integer)dataFromClient); // Add the new client's future ID to the list of registered users. ID sent\n }\n System.out.println(\"Server sending \" + registeredUsers);\n notifyObservers(registeredUsers);\n }else if (dataFromClient instanceof Group){\n System.out.println(\"Server received \" + dataFromClient);\n Group group = (Group)dataFromClient;\n if(group.getGroupID() == -1){ // Indicates group is asking for proper id.\n group.setGroupID(currentGroupNumber);\n System.out.println(\"Here ya go, number \" + currentGroupNumber);\n currentGroupNumber++;\n }\n notifyObservers(group);\n }else{\n notifyObservers(dataFromClient);\n }\n System.out.println(\"Server sent \" + dataFromClient);\n dataFromClient = inputFromClient.readObject();\n }\n } catch (IOException | ClassNotFoundException e) {\n System.out.println(\"Could not read data from client\");\n }\n }",
"public abstract <E, F, D, I> E accept(ReturnVisitor<E, F, D, I> visitor);",
"@Override\n\tpublic void accept(Visitor v) {\n\t\tv.visit(this);\n\t}",
"@Override\n\tpublic void run(){\n\t\tInetAddress IPAddress = serverTcpSocket.getInetAddress();\n\t\tfor (ClientObj c: clients)\n\t\t\tif (c.getId() == client.getId()){\n\t\t\t\tSystem.out.print(IPAddress + \" Client already connected!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\ttry{\n\t\t\t// Check handshake received for correctness\n\t\t\t//(connect c->s) [herader | \"JUSTIN\\0\" | connection port] (udp)\n\t\t\t//(connect response s->c) [header | client id | port] (udp)\n\t \n\t // open the connection\n\t\t clientSocket = null;\n\t\t Socket clientListener = null;\n\t\t // wait for client connection on tcp port\n\t\t //serverTcpSocket.setSoTimeout(5000);\n\t \tSystem.out.println (\" Waiting for tcp connection.....\");\n\t \tclientSocket = serverTcpSocket.accept();\n\t \tclientListener = serverTcpSocket.accept();\n\t \tclient.setListenerSocket(clientListener);\n\t\t\tIPAddress = clientSocket.getInetAddress();\n\t\t\tint recv_port = clientSocket.getPort();\n\t\t\tSystem.out.println(IPAddress + \": Client connected @ port \" + recv_port);\n\n\t\t // handle tcp connection\n\t\t\tclientSocket.setSoTimeout(Constants.ACK_TIMEOUT);\n\t\t out = new BufferedOutputStream(clientSocket.getOutputStream());\n\t\t\tin = new BufferedInputStream(clientSocket.getInputStream());\n\t\t\tclient.setAddress(clientSocket.getInetAddress());\n\t\t\tclient.setPort(clientSocket.getPort());\n\t\t clients.add(client);\n\t\t\t\n\t\t // handle requests\n\t\t\twhile (!shutdown_normally) {\n\t\t\t\t// read just the header, then handle the req based on the info in the header\n\t\t\t\tif ((buf = Utility.readIn(in, Constants.HEADER_LEN)) == null)\n\t\t\t\t\tbreak;\n\t\t\t\tint flag = buf.getInt(0);\n\t\t\t\tint len2 = buf.getInt(4);\n\t\t\t\tint id = buf.getInt(8);\n\t\t\t\t\n\t\t\t\t// check for correctness of header\n\t\t\t\t\n\t\t\t\tif (flag < Constants.OPEN_CONNECTION || \n\t\t\t\t\t\tflag > Constants.NUM_FLAGS || \n\t\t\t\t\t\tid != client.getId() || \n\t\t\t\t\t\tlen2 < 0){\n\t\t\t\t\tout.close(); \n\t\t\t\t\tin.close(); \n\t\t\t\t\tclientSocket.close(); \n\t\t\t\t\tserverTcpSocket.close();\n\t\t\t\t\tclients.remove(client);\n\t\t\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\t\t\"Connection - FAILURE! (malformed header)\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// read payload\n\t\t\t\tif ((buf = Utility.readIn(in, Utility.getPaddedLength(len2))) == null)\n\t\t\t\t\tthrow new IOException(\"read failed.\");\n\t\t\t\t// update address (necessary?)\n\t\t\t\tclients.get(clients.indexOf(client)).setAddress(clientSocket.getInetAddress());\n\t\t\t\tclient.setAddress(clientSocket.getInetAddress());\n\t\t\t\tswitch (flag){\n\t\t\t\t\tcase Constants.ACK:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.VIEW_REQ:\n\t\t\t\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\t\t\t\": Processing view request...\");\n\t\t\t\t\t\tViewFiles(buf);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.DOWNLOAD_REQ:\n\t\t\t\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\t\t\t\": Processing download request...\");\n\t\t\t\t\t\tDownload(buf);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.UPLOAD_REQ:\n\t\t\t\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\t\t\t\": Processing upload request...\");\n\t\t\t\t\t\tUpload(buf);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.DOWNLOAD_ACK:\n\t\t\t\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\t\t\t\": Processing download acknowledgment...\");\n\t\t\t\t\t\tDownloadCompleted(buf);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.CLOSE_CONNECTION:\n\t\t\t\t\t\tshutdown_normally = true;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// close all open sockets\n\t\t out.close(); \n\t\t in.close(); \n\t\t clientSocket.close(); \n\t\t serverTcpSocket.close();\n\t\t} catch (SocketTimeoutException e) {\n\t\t\tSystem.err.println(IPAddress + \": Timeout waiting for response.\");\n\t\t} catch (UnknownHostException e) {\n\t\t\t// IPAdress unknown\n\t\t\tSystem.err.println(\"Don't know about host \" + IPAddress);\n\t\t} catch (IOException e) {\n\t\t\t// Error in communication\n\t\t\tSystem.err.println(\"Couldn't get I/O for the connection to \" +\n\t\t\t\t\tIPAddress);\n\t\t} catch (RuntimeException e){\n\t\t\t// Malformed Header or payload most likely\n\t\t\tSystem.err.println(IPAddress + \": Connection - FAILURE! (\" + e.getMessage() + \")\");\n\t\t} finally {\n\t\t\t// remove this client from active lists, close all (possibly) open sockets\n\t\t\tSystem.out.println(IPAddress + \": Connection - Closing!\");\n\t\t\tclients.remove(client);\n\t\t\ttry {\n\t\t\t\tSocket clientConnection = client.getListenerSocket();\n\t\t\t\tOutputStream out_c = new BufferedOutputStream(clientConnection.getOutputStream());\n\t\t\t\tbuf = Utility.addHeader(Constants.CLOSE_CONNECTION, 0, client.getId());\n\t\t\t\tout_c.write(buf.array());\n\t\t\t\tout_c.flush();\n\t\t\t\tout_c.close();\n\t\t\t\tclientConnection.close();\n\n\t\t\t\tif (out != null)\n\t\t\t\t\tout.close();\n\t\t\t\tif (in != null)\n\t\t\t\t\tin.close();\n\t\t\t\tif (!clientSocket.isClosed())\n\t\t\t\t\tclientSocket.close();\n\t\t\t\tif (!serverTcpSocket.isClosed())\n\t\t\t\t\tserverTcpSocket.close();\n\t\t\t} catch (IOException e){\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n }",
"public void visit(SendBlock sb);",
"public interface ClientHandler {\r\n\r\n\t/**\r\n\t * Handle client.\r\n\t *\r\n\t * @param inFromClient the in from client\r\n\t * @param outToServer the out to server\r\n\t */\r\n\tpublic void handleClient(InputStream inFromClient, OutputStream outToServer);\r\n}",
"public void run()\n {\n try\n {\n String ack = \"You are online!\";\n DatagramPacket outPacket = new DatagramPacket(ack.getBytes(), ack.getBytes().length, clientAddress, udpPort);\n DatagramSocket outSocket = new DatagramSocket();\n outSocket.send(outPacket);\n clients.add(new Client(inMsg.split(\",\")[1], clientAddress));\n System.out.println(LocalDateTime.now() + \n \"\\nClient \" + inMsg.split(\",\")[1] + \" connected!\" +\n \"\\nClient address is : \" + clientAddress + \" (\" + clientUDPPort + \")\" +\n \"\\n============================================\");\n }\n catch(SocketException e)\n {\n System.out.println(\"SocketException in ConnectionAccepter : \" +\n \"\\n\" + e + \n \"\\n============================================\");\n }\n catch(IOException e)\n {\n System.out.println(\"IOException in ConnectionAccepter : \" +\n \"\\n\" + e + \n \"\\n============================================\");\n }\n }",
"public void start() {\n\t\tconnection.start((sender, message) -> message.accept(new Visitor(sender)));\n\t\tloadData();\n\t}",
"@Override\n\tpublic void accept(NodeVisitor visitor) {\n\t\tvisitor.visit(this);\n\t}",
"public static void main(String[] args)throws IOException {\n\t\tMethod m=new Method();//taking an object\r\n\t\r\n\t\tm.accept();\r\n\t\t\r\n\t//here it is accepting the object class \r\n\t}",
"public static void echo_server_single( int portno ) \nthrows IOException\n {\n ServerSocket acc = new ServerSocket( portno );\n print_my_host_port( portno );\n while( true )\n {\n stdout.printf(\"accepting incoming connections (hash== %s) ...\\n\", \n acc.hashCode());\n Socket com = acc.accept();\n tcp_peeraddr_print( com );\n EchoServerWorker esw = new EchoServerWorker(com);\n esw.run();\n } // while\n}",
"private TestAcceptFactory() {\n this._pool = new DirectExecutor();\n }",
"public ConnectionAccepter(String inMsg, InetAddress clientAddress, int clientUDPPort, ArrayList<Client> clients, int udpPort)\n {\n this.inMsg = inMsg;\n this.clientAddress = clientAddress;\n this.clientUDPPort = clientUDPPort;\n this.clients = clients;\n this.udpPort = udpPort;\n }",
"public Object accept (Visitor v) {\n return v.visit(this);\n }",
"@Override\n public void completed(AsynchronousSocketChannel sockChannel, AsynchronousServerSocketChannel serverSock ) {\n serverSock.accept( serverSock, this );\n\n try{\n //Print IP Address\n System.out.println( sockChannel.getLocalAddress().toString());\n\n //Add To Client List\n list.add(list.size(), sockChannel);\n\n }catch(IOException e) {\n e.printStackTrace();\n }\n\n //start to read message from the client\n startRead( sockChannel );\n \n }",
"@SuppressWarnings(\"java:S2189\")\n public static void main(String[] args) {\n ExecutorService executorService = Executors.newFixedThreadPool(4);\n try (ServerSocket serverSocket = new ServerSocket(8080)) {\n log.info(\"Waiting For New Clients...\");\n while (true) {\n Socket sock = serverSocket.accept();\n log.info(\"Connected to a client...\");\n executorService.execute(new ServeRequests(sock));\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void accept(Visitor v) {\n\t\tv.visit(this);\n\t}",
"public abstract void accept(GameObjectVisitor v);",
"public static void main(String[] args) {\n try {\r\n ServerSocket server=new ServerSocket(port);\r\n System.out.println(\"Waiting for a client...\");\r\n\r\n connections=new ArrayList<>();\r\n ExecutorService es = Executors.newFixedThreadPool(max_clients);\r\n\r\n Connection tmp;\r\n while(true) {\r\n\r\n\r\n Socket socket = server.accept();\r\n if(max_clients<=clients){\r\n OutputStream out = socket.getOutputStream();\r\n BufferedWriter rout= new BufferedWriter(new OutputStreamWriter(out));\r\n rout.write(\"Chat is full(\"+max_clients+\" users). You can't join. Try again later.\");\r\n rout.write(\"\\n\");\r\n rout.flush();\r\n socket.close();\r\n out.close();\r\n continue;\r\n }\r\n\r\n tmp=new Connection(socket);\r\n es.submit(tmp);\r\n clients++;\r\n System.out.println(\"New user has joined. Number of users - \"+clients);\r\n connections.add(tmp);\r\n }\r\n\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }",
"private JavashipsServer() {\n\t\ttry {\n\t\t\tServerSocket server = new ServerSocket(PORT);\n\n\t\t\tSystem.out.println(new Date().toString() + \" - Now accepting clients.\");\n\n\t\t\t/* Listen for connecting players */\n\t\t\twhile (true) {\n\t\t\t\tSystem.out.println(\"Waiting for 2 players to connect.\");\n\n\t\t\t\t/* Intercept the first player. */\n\t\t\t\tPlayer player1 = new Player(server.accept(), \"Player 1\");\n\t\t\t\tSystem.out.println(new Date().toString() +\n\t\t\t\t\t\t\" - First player has been found: \" +\n\t\t\t\t\t\tplayer1.playerSocket.getInetAddress().getHostAddress() +\n\t\t\t\t\t\t\"/\" +\n\t\t\t\t\t\tplayer1.playerSocket.getPort());\n\n\t\t\t\tplayer1.setFirstAttacker();\n\n\t\t\t\t/* Intercept the second player. */\n\t\t\t\tPlayer player2 = new Player(server.accept(), \"Player 2\");\n\t\t\t\tSystem.out.println(new Date().toString() +\n\t\t\t\t\t\t\" - Second player has been found: \" +\n\t\t\t\t\t\tplayer2.playerSocket.getInetAddress().getHostAddress() +\n\t\t\t\t\t\t\"/\" +\n\t\t\t\t\t\tplayer2.playerSocket.getPort());\n\n\t\t\t\t/* Let the players know who to talk to when talking to their opponent. */\n\t\t\t\tplayer1.setOpponent(player2);\n\t\t\t\tplayer2.setOpponent(player1);\n\n\t\t\t\tplayer1.start();\n\t\t\t\tplayer2.start();\n\t\t\t}\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void handleClient(InputStream inFromClient, OutputStream outToClient);",
"@Override\n public void completed(AsynchronousSocketChannel sockChannel, AsynchronousServerSocketChannel serverSockMain ) {\n serverSockMain.accept( serverSockMain, this );\n\n //Print IP Address\n try{\n System.out.println( sockChannel.getLocalAddress());\n clientChannel = sockChannel;\n }catch(IOException e) {\n\n e.printStackTrace();\n }\n\n //Add To Client List\n //list.add(list.size(), sockChannel);\n\n //start to read message from the client\n startRead( sockChannel );\n \n }",
"public interface FlightSupplierResponse {\r\n\r\n <T> T accept(FlightSupplierResponseVisitor<T> visitor);\r\n}",
"public static void main(String[] args) {\n\n // Set up the thread pool\n threadPool = Executors.newFixedThreadPool(THREAD_POOL_SIZE);\n\n // The server socket that waits for clients to connect\n // Opened in a try-catch block\n try (ServerSocket serverSocket = new ServerSocket(SERVER_PORT_NUMBER)) {\n // looping continuously to accept connections from clients\n while (true) {\n // try-catch to catch IOException cause by the accept() method\n try {\n // getting a client connection, creating a runnable and granting it a thread.\n Socket clientConnectionSocket = serverSocket.accept();\n System.out.println(\"received a request\");\n ServeRequestRunnable serveClientRunnable = new ServeRequestRunnable(clientConnectionSocket);\n threadPool.submit(serveClientRunnable);\n } catch (IOException ioe) {\n ioe.printStackTrace();\n }\n }\n } catch (IOException ioe) {\n ioe.printStackTrace();\n } finally {\n threadPool.shutdown();\n }\n }",
"public static void main(String[] args) throws IOException {\n\t\tServerSocket ss= new ServerSocket(5000); \r\n\t\tSocket s = null; \r\n\t\twhile(true) {\r\n\t\t\ts = ss.accept();\r\n\t\t\t\r\n\t\t\tDataOutputStream out = new DataOutputStream(s.getOutputStream());\r\n\t\t\tDataInputStream in = new DataInputStream(s.getInputStream());\r\n\t\t\t\r\n\t\t\tserverHelper c = new serverHelper(s,\"client\"+clientCount,in,out);\r\n\t\t\t\r\n\t\t\tThread t = new Thread(c);\r\n\t\t\t//System.out.println(\"client\"+clientCount+\"is online\");\r\n\t\t\tclients.add(c);\r\n\t\t\tt.start();\r\n\t\t\tclientCount++;\r\n\t\t}\r\n\t}",
"public void acceptSocket(AsynchronousSocketChannel arg0) {\n\r\n\t\tnew TCPClient(arg0);\r\n\t}",
"public void accept(Visitor v, Context c) {\n\t\tv.visit(this, c);\n\t}",
"void accept(A a, B b, C c);",
"@Override\n\tpublic Object accept(Visitor visitor) {\n\t\treturn visitor.visit(this);\n\t}",
"public void runServer() {\n\t\tint i = 0;\n\n\t\tclientList = new ArrayList<>();\n\t\ttry {\n\t\t\tServerSocket listener = new ServerSocket(port);\n\n\t\t\tSocket server;\n\n\t\t\tprintDetails();\n\n\t\t\twhile ((i++ < maxConnections) || (maxConnections == 0)) {\n\n\t\t\t\tserver = listener.accept();\n\t\t\t\tSession session = new Session(server, this.storageLocation );\n\n\t\t\t\tnew Thread(session).start();\n\n\t\t\t\tString name = session.getName();\n\t\t\t\tSystem.out.printf(\"%s STARTED\\r\\n\", name );\n\t\t\t\tclientList.add( session );\n\t\t\t\tdoGC();\n\n\t\t\t}\n\t\t} catch (IOException ioe) {\n\t\t\tSystem.out.println(\"IOException on socket listen: \" + ioe);\n\t\t\tioe.printStackTrace();\n\t\t}\n\t}",
"private void acceptClient(ServerSocket server) {\n try {\n while (true) {\n Socket socket = server.accept();\n System.out.println(\"Client accepted\");\n new Thread(() -> {\n receive(socket);\n }).start();\n }\n } catch (final Exception e) {\n System.out.println(\"Get an error trying to accept a client.\\n\" + e);\n }\n }",
"public void run() {\n while(!serverSocket.isClosed()) {\n try {\n Socket newClient = serverSocket.accept();\n PrintWriter pw = new PrintWriter(newClient.getOutputStream());\n if(connections.size() < MAX_CONNECTIONS) {\n synchronized(this) {\n connections.addElement(newClient);\n writers.addElement(pw);\n pw.print(\"TelnetAppender v1.0 (\" + connections.size()\n\t\t + \" active connections)\" + EOL + EOL);\n pw.flush();\n }\n } else {\n pw.print(\"Too many connections.\" + EOL);\n pw.flush();\n newClient.close();\n }\n } catch(Exception e) {\n if (e instanceof InterruptedIOException || e instanceof InterruptedException) {\n Thread.currentThread().interrupt();\n }\n if (!serverSocket.isClosed()) {\n LogLog.error(\"Encountered error while in SocketHandler loop.\", e);\n }\n break;\n }\n }\n\n try {\n serverSocket.close();\n } catch(InterruptedIOException ex) {\n Thread.currentThread().interrupt();\n } catch(IOException ex) {\n }\n }",
"protected void serveClient() {\r\n\t\tif (lineIn == null || lineOut == null) {\r\n\t\t\tSystem.err.printf(\"I/O has not been set up.%n\");\r\n\t\t} else {\r\n\t\t\ttry {\r\n\t\t\t\tString clientRequest;\r\n\t\t\t\tStringTokenizer args;\r\n\r\n\t\t\t\t// control loop, receiving client requests\r\n\t\t\t\twhile (!exitRecieved) {\r\n\t\t\t\t\t// PRESENT PROMPT\r\n\t\t\t\t\tsendMessage(PROMPT);\r\n\r\n\t\t\t\t\t// ACCEPT & PROCESS INPUT\r\n\t\t\t\t\tclientRequest = receiveMessage();\r\n\t\t\t\t\targs = new StringTokenizer(clientRequest);\r\n\t\t\t\t\tprocessCommand(args);\r\n\t\t\t\t}\r\n\r\n\t\t\t} catch (IOException ioe) {\r\n\t\t\t\tSystem.err.printf(\"IO Error receiving client input: %s%n\", ioe);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public interface Client {\n\n}",
"public void listen() {\n\t\t\n\t\twhile(true) {\n\t\t\t\n\t\t\tDatagramPacket packet = new DatagramPacket(recieveData, MAX_SIZE);\n\t\t\tint available = 0;\n\t\t\t\n\t\t\ttry {\n\t\t\t\t//The 'receive(...)' method fills up the buffer of the packet we passed into it with the data received\n\t\t\t\tmainSocket.receive(packet);\n\t\t\t\t//available = packet.getLength();\n\t\t\t\tbyte[] data = packet.getData();\n\t\t\t\t\n\t\t\t\tif(data[0] == HEADER && data[1] == CONNECTION)\n\t\t\t\t\tif(askUser(packet, available))\n\t\t\t\t\t\tmakeClientThread();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t}\n\t\t\tcatch(PortUnreachableException ex) {\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"PortUnreachableException caught in server side.\\n Unable to recieve packet\\n\");\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t\tcatch (IOException ex) {\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"1. IOException Caught in server side.\\n Unable to vertify user\\n\");\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"private void createAndListen() {\n\n\t\t\n\t}",
"public void accept(Visitor visitor)\n {\n visitor.startService(this);\n for (Iterator iterator = nameToOperation.values().iterator(); iterator.hasNext();)\n {\n OperationInfo operationInfo = (OperationInfo) iterator.next();\n operationInfo.accept(visitor);\n }\n visitor.endService(this);\n }",
"public interface DataRelayClient {\n\n /**\n * Send data in a loop over UDP\n */\n public void streamData(String pathToFile) throws IOException;\n\n /**\n * Receive data in a loop via UDP\n */\n public void receiveData() throws IOException;\n\n /**\n * Initialize TCP connection\n */\n public void initializeTCP() throws IOException;\n /**\n * Initialize UDP connection\n */\n public void initializeUDP() throws IOException;\n\n /**\n * Get client ID from the server\n */\n public void setID() throws IOException;\n\n /**\n * Check if client is first to connect\n */\n public boolean isFirstToConnect() throws IOException;\n\n /**\n * Initialize the client\n */\n public void initialize() throws Exception;\n}",
"public Client(Client client) {\n\n }",
"public static void main(String[] args) throws IOException\n {\n Scanner sc=new Scanner(System.in);\n System.out.print(\"Enter Port No:\");\n int port=sc.nextInt();\n ServerSocket server_sokt=new ServerSocket(port); //Server Created \n System.out.println(\"Server Hosted at Port \"+port);\n\n while(true)\n {\n Socket socket_object=null; // Initialize Listening Socket\n try \n {\n socket_object=server_sokt.accept(); //Accept Connection Request from Client\n cnt+=1; \n DataInputStream inpt=new DataInputStream(socket_object.getInputStream());\n // String name=\"Client\"+cnt; // I can also put names like client1,client2 ......\n String name=inpt.readUTF(); // Read Name of Client \n System.out.println(\"Client \"+name+\" Connected\"); \n Thread new_client_thread=new ClientHandle(socket_object,inpt,name); // Creating a thread for a client\n new_client_thread.start(); //starting thread\n } \n catch (Exception e)\n {\n socket_object.close();\n e.printStackTrace();\n break;\n }\n }\n server_sokt.close();\n sc.close();\n }",
"@Override\n public <T> T accept(Visitor<T> v) {\n return v.visit(this);\n }",
"SockHandle(Socket client,String my_ip,String my_port,int my_c_id,HashMap<Integer, SockHandle> c_list,HashMap<Integer, SockHandle> s_list, boolean rx_hdl,boolean svr_hdl,ClientNode cnode) \n {\n \tthis.client = client;\n \tthis.my_ip = my_ip;\n \tthis.my_port = my_port;\n this.my_c_id = my_c_id;\n this.remote_c_id = remote_c_id;\n this.c_list = c_list;\n this.s_list = s_list;\n this.rx_hdl = rx_hdl;\n this.svr_hdl = svr_hdl;\n this.cnode = cnode;\n // get input and output streams from socket\n \ttry \n \t{\n \t in = new BufferedReader(new InputStreamReader(client.getInputStream()));\n \t out = new PrintWriter(client.getOutputStream(), true);\n \t} \n \tcatch (IOException e) \n \t{\n \t System.out.println(\"in or out failed\");\n \t System.exit(-1);\n \t}\n try\n {\n // only when this is started from a listening node\n // send a initial_setup message to the initiator node (like an acknowledgement message)\n // and get some information from the remote initiator node\n if(rx_hdl == true)\n {\n \t System.out.println(\"send cmd 1: setup sockets to other clients\");\n out.println(\"initial_setup\");\n ip = in.readLine();\n \t System.out.println(\"ip:\"+ip);\n port=in.readLine();\n \t System.out.println(\"port:\"+port);\n remote_c_id=Integer.valueOf(in.readLine());\n \t out.println(my_ip);\n \t out.println(my_port);\n \t out.println(my_c_id);\n \t System.out.println(\"neighbor connection, PID:\"+ Integer.toString(remote_c_id)+ \" ip:\" + ip + \" port = \" + port);\n // when this handshake is done\n // add this object to the socket handle list as part of the main Client object\n synchronized (c_list)\n {\n c_list.put(remote_c_id,this);\n }\n }\n }\n \tcatch (IOException e)\n \t{\n \t System.out.println(\"Read failed\");\n \t System.exit(1);\n \t}\n \t// handle unexpected connection loss during a session\n \tcatch (NullPointerException e)\n \t{\n \t System.out.println(\"peer connection lost\");\n \t System.exit(1);\n \t}\n // thread that continuously runs and waits for incoming messages\n // to process it and perform actions accordingly\n \tThread read = new Thread()\n {\n \t public void run()\n {\n \t while(rx_cmd(in,out) != 0) { }\n }\n \t};\n \tread.setDaemon(true); \t// terminate when main ends\n read.setName(\"rx_cmd_\"+my_c_id+\"_SockHandle_to_Server\"+svr_hdl);\n read.start();\t\t// start the thread\t\n }",
"public synchronized void listen() {\n// synchronized (this) {\n try {\n String input;\n if ((input = in.readLine()) != null) {\n parseCommand(input);\n }\n } catch (IOException ex) {\n Logger.getLogger(ClientIO.class.getName()).log(Level.SEVERE, null, ex);\n }\n// }\n }",
"public abstract void accept(PhysicalPlanVisitor visitor);",
"public Visitor visitor(Visitor v) \n { \n return visitor = v; \n }",
"public static void main(String[] args) {\n\n Server server = new Server();\n // Accepts any new connections and opens a new socket for data transfer\n while (true) {\n Socket connectionSocket = server.AcceptIncomingConnections();\n if (connectionSocket != null) {\n new Thread(new ServerInstance(connectionSocket)).start();\n } else {\n // Error accepting , terminate server\n System.out.println(\"Error accepting incoming connections. Server shutting down\");\n break;\n }\n }\n }",
"public Socket accept() throws IOException {\n\t\treturn new FBSSocket(new URL(rotateUrlList()).openStream());\n\t}",
"public static void main(String args[]) {\r\n try {\r\n int serverPort = 7896; // the server port\r\n ServerSocket listenSocket = new ServerSocket(serverPort);\r\n while (true) {\r\n Socket clientSocket = listenSocket.accept();\r\n Connection c = new Connection(clientSocket);\r\n }\r\n } catch (IOException e) {\r\n System.out.println(\"Listen socket:\" + e.getMessage());\r\n\r\n }\r\n }",
"public static void main(String[] args) throws IOException {\n\n if (args.length != 1) // Test for correct argument list\n throw new IllegalArgumentException(\"Parameter(s): <Port>\");\n\n int servPort = Integer.parseInt(args[0]);\n\n // Create a selector to multiplex client connections.\n Selector selector = Selector.open();\n\n DatagramChannel channel = DatagramChannel.open();\n channel.configureBlocking(false);\n channel.socket().bind(new InetSocketAddress(servPort));\n channel.register(selector, SelectionKey.OP_READ, new ClientRecord());\n\n while (true) { // Run forever, receiving and echoing datagrams\n // Wait for task or until timeout expires\n if (selector.select(TIMEOUT) == 0) {\n System.out.print(\".\");\n continue;\n }\n\n // Get iterator on set of keys with I/O to process\n Iterator<SelectionKey> keyIter = selector.selectedKeys().iterator();\n while (keyIter.hasNext()) {\n SelectionKey key = keyIter.next(); // Key is bit mask\n\n // Client socket channel has pending data?\n if (key.isReadable())\n handleRead(key);\n\n // Client socket channel is available for writing and\n // key is valid (i.e., channel not closed).\n if (key.isValid() && key.isWritable())\n handleWrite(key);\n\n keyIter.remove();\n }\n }\n }",
"public PubSubAgent(EventInterface server) throws RemoteException {\r\n this.server = server;\r\n if (server != null)\r\n this.agentID = server.connect(this);\r\n subscriberTopics = new ArrayList<>();\r\n subscriberKeywords = new ArrayList<>();\r\n receivedEvents = new ArrayList<>();\r\n receivedTopics = new ArrayList<>();\r\n pubTopics = new ArrayList<>();\r\n pubEvents = new ArrayList<>();\r\n }",
"public abstract void visit();"
] | [
"0.709015",
"0.6400882",
"0.62701744",
"0.62634486",
"0.61718655",
"0.6097047",
"0.59725595",
"0.5948307",
"0.5938647",
"0.58919954",
"0.58213204",
"0.5798589",
"0.57981384",
"0.57383627",
"0.57244205",
"0.5722761",
"0.5699643",
"0.5698542",
"0.56926715",
"0.56328416",
"0.56328416",
"0.5627097",
"0.5626663",
"0.56186026",
"0.5616767",
"0.5611777",
"0.55856204",
"0.55645597",
"0.5554357",
"0.55426264",
"0.5540741",
"0.5540107",
"0.55242705",
"0.55117774",
"0.5506034",
"0.5495933",
"0.5495599",
"0.54671013",
"0.5465168",
"0.54645777",
"0.54633176",
"0.54611456",
"0.5456323",
"0.54410994",
"0.54322076",
"0.5430634",
"0.5424783",
"0.5422279",
"0.541317",
"0.5387759",
"0.5386238",
"0.53795385",
"0.53647894",
"0.5355479",
"0.53436947",
"0.53379947",
"0.5319756",
"0.5312837",
"0.5299817",
"0.52867335",
"0.52862793",
"0.5283106",
"0.52672946",
"0.5260843",
"0.52605253",
"0.52497077",
"0.52489203",
"0.5240508",
"0.52365285",
"0.523335",
"0.52329105",
"0.5231166",
"0.5229364",
"0.5218433",
"0.5215437",
"0.5201176",
"0.5199032",
"0.51975423",
"0.5186904",
"0.51684725",
"0.5164319",
"0.5162995",
"0.51570106",
"0.51501757",
"0.51463515",
"0.5131159",
"0.51262367",
"0.51233923",
"0.5119301",
"0.51174617",
"0.51173156",
"0.5100255",
"0.5098904",
"0.50988543",
"0.5097157",
"0.50958705",
"0.5094712",
"0.5094539",
"0.509043",
"0.5087447",
"0.5085112"
] | 0.0 | -1 |
Get the ViewPager and set its PagerAdapter so that it can display items | private void initViewPager() {
ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager);
if (viewPager != null) {
viewPager.setAdapter(new MainPagerAdapter(getFragmentManager()));
}
// Give the TabLayout the ViewPager
TabLayout tabLayout = (TabLayout) findViewById(R.id.sliding_tabs);
if (tabLayout != null) {
tabLayout.setTabMode(TabLayout.MODE_FIXED);
tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);
tabLayout.setupWithViewPager(viewPager);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void initializeViewPager() {\n mProductsViewPagerAdapter = new ProductsViewPagerAdapter(this, mMobileImages);\n mBinding.vPPdpProductImages.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {\n @Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n }\n\n @Override\n public void onPageSelected(int position) {\n EcomUtil.setViewPagerSelectedDot(mBinding.vPPdpProductImages.getContext(), mDots,\n mDotsCount, position);\n }\n\n @Override\n public void onPageScrollStateChanged(int state) {\n }\n });\n }",
"private void setupViewPager() {\n // Get the ViewPager and set it's PagerAdapter so that it can display items\n viewPager = (ViewPager) findViewById(R.id.viewpager);\n fragmentAdapter = new LovesPagerAdapter(getSupportFragmentManager());\n viewPager.setAdapter(fragmentAdapter);\n\n // Give the PagerSlidingTabStrip the ViewPager\n tabsStrip = (PagerSlidingTabStrip) findViewById(R.id.tabs);\n // Attach the view pager to the tab strip\n tabsStrip.setViewPager(viewPager);\n }",
"private void bindViewPager() {\n\t\tmAdapter = new FragmentPagerAdapter(getSupportFragmentManager()) {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic int getCount() {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\treturn 2;\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic Fragment getItem(int arg0) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tswitch (arg0) {\r\n\t\t\t\tcase 0:\r\n\t\t\t\t\treturn new VideoInforFragment();\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\treturn new VideoReplayFragment();\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t};\r\n\t\tmViewPager.setAdapter(mAdapter);\r\n\t}",
"private void initViewPager() {\n }",
"private void initListView() {\n viewPager.setAdapter(adapter);\n }",
"private void setupAdapterAndViewPager() {\n mFragmentAdapter = new MyPagerAdapter(getSupportFragmentManager());\n mViewPager.setAdapter(mFragmentAdapter);\n mViewPager.setOffscreenPageLimit(4);\n\n //Set up the Tablayout\n mTabLayout.setupWithViewPager(mViewPager);\n }",
"private void setupViewPager(ViewPager viewPager, Bundle savedInstanceState) {\n adapter = new Adapter(getSupportFragmentManager());\n\n adapter.addFragment(new EventDescription(), \"Descrizione\");\n adapter.addFragment(new JoinersList(), \"Partecipanti\");\n adapter.addFragment(new Contacts(), \"Contatti\");\n viewPager.setAdapter(adapter);\n\n\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_view_pager, container, false);\n\n getLoaderManager().initLoader(0, null, this);\n\n mPagerAdapter = new MyPagerAdapter(getFragmentManager(), mTwoPane);\n mPager = (ViewPager) rootView.findViewById(R.id.pager);\n mPager.setAdapter(mPagerAdapter);\n mPager.setPageMargin((int) TypedValue\n .applyDimension(TypedValue.COMPLEX_UNIT_DIP,\n 1,\n getResources().getDisplayMetrics()));//Margin between two pages\n mPager.setPageMarginDrawable(new ColorDrawable(0x22000000));\n\n mSimpleOnPageChangeListener = new ViewPager.SimpleOnPageChangeListener() {\n\n @Override\n public void onPageSelected(int position) {\n if (mPagerAdapter.mCursor != null) {\n mPagerAdapter.mCursor.moveToPosition(position);\n\n mSelectedItemId = mPagerAdapter.mCursor.getLong(ArticleLoader.Query._ID);\n }\n }\n };\n\n mPager.addOnPageChangeListener(mSimpleOnPageChangeListener);\n\n return rootView;\n }",
"private void setUpViewPager() {\n\n mDbProducts = realm.where(DbProduct.class).findAll();\n try {\n mViewPager.setAdapter(new FeedPagerAdapter(getChildFragmentManager()));\n } catch (Exception e) {\n// getFragmentManager().popBackStack();\n Log.e(LOG_TAG, e.toString());\n }\n\n int index = 0;\n\n try {\n long openingProductId = getActivity().getIntent().getLongExtra(MainActivity.EXTRA_PRODUCT_ID, 0);\n if (openingProductId != 0) {\n\n index = mDbProducts.indexOf(mDbProducts.where().equalTo(DbProduct.PRODUCT_ID, openingProductId).findFirst());\n }\n } catch (Exception e) {\n index = 0;\n }\n\n ViewPager.OnPageChangeListener onPageChangeListener = new ViewPager.OnPageChangeListener() {\n @Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n\n }\n\n @Override\n public void onPageSelected(int position) {\n try {\n setHeaderText(mDbProducts.get(position).getProductName());\n } catch (Exception e) {\n //\n }\n }\n\n @Override\n public void onPageScrollStateChanged(int state) {\n\n }\n };\n mViewPager.addOnPageChangeListener(onPageChangeListener);\n\n try {\n // indicator.setupWithViewPager(mViewPager);\n // indicator.addOnPageChangeListener(onPageChangeListener);\n\n } catch (Exception e)\n {\n\n }\n\n Log.d(LOG_TAG, \"Product Size: \" + mDbProducts.size() + \" Index: \" + index);\n\n mViewPager.setCurrentItem(index, true);\n setHeaderText(mDbProducts.get(index).getProductName());\n\n ivLeft.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n int currentPosition = mViewPager.getCurrentItem();\n try {\n mViewPager.setCurrentItem(currentPosition - 1, true);\n } catch (Exception e) {\n //do nothing\n }\n }\n });\n\n ivRight.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n int currentPosition = mViewPager.getCurrentItem();\n try {\n mViewPager.setCurrentItem(currentPosition + 1, true);\n } catch (Exception e) {\n //do nothing\n }\n }\n });\n }",
"private void setupViewPager(ViewPager viewPager) {\n\n Adapter adapter = new Adapter(getChildFragmentManager());\n adapter.addFragment(new ListofMedGroupsFragment(), \"Groups\");\n adapter.addFragment(new ListofMedsFragment(), \"Medications\");\n adapter.addFragment(new ListofMeasurementsFragment(), \"Measurements\");\n viewPager.setAdapter(adapter);\n\n }",
"private void setupPager() {\n SectionsPagerAdapter pagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager(), getResources());\n ViewPager pager = findViewById(R.id.pager);\n pager.setAdapter(pagerAdapter);\n TabLayout tabLayout = findViewById(R.id.tabs);\n tabLayout.setupWithViewPager(pager);\n pager.addOnPageChangeListener(addPageChangeListener());\n }",
"private void setupViewPager(ViewPager viewPager) {\n\n try {\n mFragmentList.clear();\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n adapter.notifyDataSetChanged();\n\n mFragmentList.add(Constants.mMainActivity.productListPendingFragment);\n mFragmentTitleList.add(\"Pending\");\n\n mFragmentList.add(Constants.mMainActivity.productListApprovedFragment);\n mFragmentTitleList.add(\"Approved\");\n\n mFragmentList.add(Constants.mMainActivity.productListRejectedFragment);\n mFragmentTitleList.add(\"Rejected\");\n\n viewPager.setAdapter(adapter);\n }",
"@Override\n public PagerAdapter getAdapter() {\n return wrappedPagerAdapter;\n }",
"private void setAdapterAndListener() {\r\n CustomPagerAdapter = new CustomPagerAdapter(getSupportFragmentManager(), PhotoViewActivity.this, dataModelArrayList);\r\n pager.setAdapter(CustomPagerAdapter);\r\n pager.setOffscreenPageLimit(3);\r\n pager.setCurrentItem(position);\r\n\r\n pager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {\r\n @Override\r\n public void onPageScrolled(final int pos, float positionOffset, int positionOffsetPixels) {\r\n /*\r\n * Setting the title on toolbar\r\n * */\r\n position = pos;\r\n String name = dataModelArrayList.get(position).getFile().getName();\r\n String actualName = FileUtils.getSecureFileName(name);\r\n if (actualName != null && !actualName.equalsIgnoreCase(\"\")) {\r\n updateTileBar(actualName);\r\n } else {\r\n updateTileBar(name);\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n @Override\r\n public void onPageSelected(int num) {\r\n int pos = 0;\r\n //Update the toolbar menu item on page change\r\n invalidateOptionsMenu();\r\n\r\n }\r\n\r\n @Override\r\n public void onPageScrollStateChanged(int state) {\r\n\r\n }\r\n });\r\n }",
"private void setUpViewPager() {\n ViewPagerAdapter viewPagerAdapter = new ViewPagerAdapter(getSupportFragmentManager(), this);\n mViewPager.setAdapter(viewPagerAdapter);\n mTabLayout.setupWithViewPager(mViewPager);\n }",
"private void initialisePaging() {\n\nList<Fragment> fragments = new Vector<Fragment>();\nfragments.add(Fragment.instantiate(this, Fragment0.class.getName()));\nfragments.add(Fragment.instantiate(this, Fragment1.class.getName()));\nfragments.add(Fragment.instantiate(this, Fragment2.class.getName()));\nthis.mPagerAdapter = new MyPagerAdapter(super.getSupportFragmentManager(), fragments);\n\nViewPager pager = (ViewPager) super.findViewById(R.id.awesomepager);\npager.setAdapter(this.mPagerAdapter);\n}",
"private void setupViewPager(ViewPager viewPager) {\n Adapter adapter = new Adapter(getSupportFragmentManager());\n\n PopularFragment popular = new PopularFragment();\n adapter.addFragment(popular, getString(R.string.popular_key));\n\n RatedFragment rated = new RatedFragment();\n adapter.addFragment(rated, getString(R.string.rated_key));\n\n FavouriteFragment favourite = new FavouriteFragment();\n adapter.addFragment(favourite, getString(R.string.favourite_key));\n\n viewPager.setAdapter(adapter);\n }",
"protected void initializeViewPager(){\n //get ViewPager component\n initializeViewPager(DEFAULT_VIEW_PAGER_ID);\n }",
"private void initializePaging() {\r\n\t\t\r\n\t\tList<Fragment> fragments = new Vector<Fragment>();\r\n\t\tfragments.add(Fragment.instantiate(this, ContactBookFragment.class.getName()));\r\n\t\tfragments.add(Fragment.instantiate(this, MainDashBoardFragment.class.getName()));\r\n\t\tfragments.add(Fragment.instantiate(this, GroupDashBoardFragment.class.getName()));\r\n\t\tthis.mPagerAdapter = new PagerAdapter(super.getSupportFragmentManager(), fragments);\r\n\t\t//\r\n\t\tViewPager pager = (ViewPager)super.findViewById(R.id.viewpager);\r\n\t\tpager.setAdapter(this.mPagerAdapter);\r\n\t\tpager.setCurrentItem(1);\t// Set the default page to Main Dash Board\r\n\t}",
"private void setupViewPager(ViewPager viewPager) {\n Adapter adapter = new Adapter(getSupportFragmentManager());\n adapter.addFragment(MovieFragment.newInstance(), getString(R.string.movies));\n adapter.addFragment(TvShowFragment.newInstance(fragmentManager), getString(R.string.tvshow));\n adapter.addFragment(FavoriteFragment.newInstance(fragmentManager), getString(R.string.movies));\n adapter.addFragment(FragmentFavoriteTvShow.newInstance(fragmentManager), getString(R.string.tvshow));\n viewPager.setAdapter(adapter);\n }",
"private void setupViewPager(ViewPager viewPager) {\n ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager());\n adapter.addFragment(new WatchFragment(), \"Watch\");\n adapter.addFragment(new AddBlackListOne(), \"Add Blacklist\");\n adapter.addFragment(new SearchBlacklistFragment(), \"Search Blacklist\");\n viewPager.setAdapter(adapter);\n }",
"private void setupListViewPager() {\n\t\tmSeverityListPager = (ViewPager) getView().findViewById(\n\t\t\t\tR.id.severity_list_viewpager);\n\t\tmSeverityListPageIndicator = (TabPageIndicator) getView().findViewById(\n\t\t\t\tR.id.severity_list_tabindicator);\n\t\t// Bind the tab indicator to the adapter\n\t\tmSeverityListPagerAdapter = retrievePagerAdapter();\n\t\tLog.d(TAG,\n\t\t\t\t\"current severity: \"\n\t\t\t\t\t\t+ mSeverityListPagerAdapter.getCurrentObject());\n\t\tmSeverityListPagerAdapter.setFragmentManager(getChildFragmentManager());\n\t\tmSeverityListPager.setAdapter(mSeverityListPagerAdapter);\n\t\tmSeverityListPager.setOffscreenPageLimit(1);\n\t\tmSeverityListPageIndicator.setViewPager(mSeverityListPager);\n\n\t\tmSeverityListPageIndicator.setCurrentItem(mSeverityListPagerAdapter\n\t\t\t\t.getCurrentPosition());\n\t\t// mCallbackMain.onSeveritySelected(mSeverityListPagerAdapter.getCurrentObject());\n\n\t\tmSeverityListPageIndicator\n\t\t\t\t.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onPageSelected(int position) {\n\t\t\t\t\t\tLog.d(TAG, \"EventCategoryFragment:onPageSelected(\"\n\t\t\t\t\t\t\t\t+ position + \")\");\n\t\t\t\t\t\tmSeverityListPagerAdapter.setCurrentPosition(position);\n\n\t\t\t\t\t\tmCallbackMain\n\t\t\t\t\t\t\t\t.onSeveritySelected(mSeverityListPagerAdapter\n\t\t\t\t\t\t\t\t\t\t.getCurrentObject());\n\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onPageScrollStateChanged(int position) {\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t}",
"private void initializePager() {\n\t\tmViewPager = (ViewPager) root.findViewById(R.id.pager);\r\n\t\t// Create the adapter that will return a fragment for each of the three\r\n\t\t// primary sections of the app.\r\n\t\tthis.mSectionAdapter = new SectionAdapter(getSupportFragmentManager(),\r\n\t\t\t\tthis, mViewPager);\r\n\t\tmViewPager.setAdapter(mSectionAdapter);\r\n\t\tmViewPager.setOnPageChangeListener(new OnPageChangeListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onPageScrollStateChanged(int arg0) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onPageSelected(int arg0) {\r\n\t\t\t\t// Configurations.getConfigs().setAdapterSection(arg0);\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t\tmViewPager.setOffscreenPageLimit(6);\r\n\t}",
"private void setupViewPager(ViewPager viewPager) {\n ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager());\n\n Bundle bundle = new Bundle();\n Intent intent = getIntent();\n\n if (intent.getExtras() != null) {\n bundle.putString(\"uid\", intent.getStringExtra(\"uid\"));\n }\n\n UserPhotoFragment userPhotoFragment = new UserPhotoFragment();\n userPhotoFragment.setArguments(bundle);\n\n UserFollowingFragment userFollowingFragment = new UserFollowingFragment();\n userFollowingFragment.setArguments(bundle);\n\n UserLikesFragment userLikesFragment = new UserLikesFragment();\n userLikesFragment.setArguments(bundle);\n\n adapter.addFragment(userPhotoFragment, \"PHOTOS\");\n adapter.addFragment(userFollowingFragment, \"FOLLOWING\");\n adapter.addFragment(userLikesFragment, \"LIKES\");\n viewPager.setAdapter(adapter);\n }",
"public void setupView() {\n PagerAdapter mPagerAdapter = new ScreenSlidePagerAdapter(getSupportFragmentManager());\n viewPager.setAdapter(mPagerAdapter);\n viewPager.setCurrentItem(0);\n\n }",
"private void setupViewPager(ViewPager viewPager) {\n ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager());\n adapter.addFragment(new ListMovieFragment(), Constants.MOVIES);\n adapter.addFragment(new FavouriteMovieFragment(), Constants.FAVOURITE);\n adapter.addFragment(new SettingEmptyFragment(), Constants.SETTINGS);\n adapter.addFragment(new AboutFragment(), Constants.ABOUT);\n viewPager.setAdapter(adapter);\n }",
"private void setupViewPager(ViewPager viewPager)\n {\n ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager());\n adapter.addFragment(One, \"Courses\");\n adapter.addFragment(new TwoFragment(), \"Grades\");\n adapter.addFragment(Three, \"Notifications\");\n viewPager.setAdapter(adapter);\n }",
"protected void initializeViewPager(int id){\n //get ViewPager component\n mViewPager = (ViewPager)mActivity.findViewById(id);\n }",
"public IgniterViewPager getViewPager() {\n return viewPager;\n }",
"private void setPersonPagerData() {\n viewPageAdaptor = new ViewPagePersonAdaptor(getChildFragmentManager());\n viewPagerPerson.setAdapter(viewPageAdaptor);\n tbPerson.setupWithViewPager(viewPagerPerson);\n }",
"private void setupViewPager(ViewPager viewPager) {\n ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager());\n adapter.addFragment(new UpcomingFragment(), \"Upcoming\");\n adapter.addFragment(new NowplayingFragment(), \"Now Playing\");\n adapter.addFragment(new PopularFragment(), \"Popular\");\n viewPager.setAdapter(adapter);\n }",
"private void setupViewPager(ViewPager viewPager) {\n LunchActivity_ViewPageAdapter adapter = new LunchActivity_ViewPageAdapter(getSupportFragmentManager());\n adapter.addFragment(new LunchActivity_Tab_One(), \"Elementary School\");\n adapter.addFragment(new LunchActivity_Tab_Two(), \"Middle School\");\n adapter.addFragment(new LunchActivity_Tab_Three(), \"High School\");\n\n\n viewPager.setAdapter(adapter);\n\n }",
"public void bindViewPager(ViewPager viewPager){\n if (mViewPager != null) {\n // If we've already been setup with a ViewPager, remove us from it\n if (mPageChangeListener != null) {\n mViewPager.removeOnPageChangeListener(mPageChangeListener);\n }\n }\n\n if (mCurrentVpSelectedListener != null) {\n // If we already have a tab selected listener for the ViewPager, remove it\n mCurrentVpSelectedListener = null;\n }\n\n if (viewPager != null) {\n mViewPager = viewPager;\n\n // Add our custom OnPageChangeListener to the ViewPager\n if (mPageChangeListener == null) {\n mPageChangeListener = new BottomBarLayoutOnPageChangeListener(this);\n }\n mPageChangeListener.reset();\n viewPager.addOnPageChangeListener(mPageChangeListener);\n\n // Now we'll add a tab selected listener to set ViewPager's current item\n mCurrentVpSelectedListener = new BottomBarLayout.ViewPagerOnTabSelectedListener(viewPager);\n setScrollPosition(viewPager.getCurrentItem(), 0f, true);\n } else {\n // We've been given a null ViewPager so we need to clear out the internal state,\n // listeners and observers\n mViewPager = null;\n }\n }",
"private void initViewPager() {\n List<Fragment> fragments = new ArrayList<>();\n FragmentManager fragmentManager = getSupportFragmentManager();\n ChatsFragment chatsFragment = new ChatsFragment();\n Bundle bundle = new Bundle();\n bundle.putSerializable(\"currentUser\", currentUser);\n chatsFragment.setArguments(bundle);\n GroupsFragment groupsFragment = new GroupsFragment();\n groupsFragment.setArguments(bundle);\n ContactsFragment contactsFragment = new ContactsFragment();\n contactsFragment.setArguments(bundle);\n fragments.add(chatsFragment);\n fragments.add(contactsFragment);\n fragments.add(groupsFragment);\n List<String> titles = new ArrayList<>();\n titles.add(\"Chats\");\n titles.add(\"Contacts\");\n titles.add(\"Groups\");\n TabsAdapter tabsAdapter = new TabsAdapter(fragmentManager, fragments, titles);\n viewPager.setAdapter(tabsAdapter);\n tabLayout.setupWithViewPager(viewPager);\n }",
"private void setupViewPager(){\n viewPager = (ViewPager) findViewById(R.id.pager);\n\n SectionsPagerAdapter adapter = new SectionsPagerAdapter(getSupportFragmentManager());\n adapter.addFragment(new SearchFragment()); //index 0\n adapter.addFragment(new ARViewFragment()); //index 1\n adapter.addFragment(new UpdatedsFragment()); //index 2\n\n\n viewPager.setAdapter(adapter);\n viewPager.setCurrentItem(1);\n\n viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {\n @Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n\n }\n\n @Override\n public void onPageSelected(int position) {\n\n int C = viewPager.getCurrentItem();\n Fragment ARV = adapter.getItem(1);\n\n\n if (C != 1){\n ARV.onPause();\n }else\n ARV.onResume();\n\n\n }\n\n @Override\n public void onPageScrollStateChanged(int state) {\n\n }\n });\n\n }",
"private void setupViewPager(ViewPager viewPager, List<Blog> blogs) {\n }",
"private void updateAdapterForViewPager() {\n\n// Stops the page loading animation when response is received successfully\n binding.shimmerFrameLayoutVP.stopShimmer();\n binding.shimmerFrameLayoutVP.setVisibility(View.GONE);\n\n if (vp_adapter == null) {\n vp_adapter = new MainActivityVP_Adapter(this, now_playing_movies, this);\n binding.homeViewPagerID.setAdapter(vp_adapter);\n vp_adapter.notifyDataSetChanged();\n } else if (movieNow_vm.getListLiveDataMovieNow().getValue() != null) {\n vp_adapter = new MainActivityVP_Adapter(this, movieNow_vm.getListLiveDataMovieNow().getValue(), this);\n binding.homeViewPagerID.setAdapter(vp_adapter);\n } else {\n vp_adapter.notifyDataSetChanged();\n }\n\n }",
"private void setupViewPager(ViewPager viewpager){\n pokearticle.ViewPagerAdapter adapter = new pokearticle.ViewPagerAdapter(\n getSupportFragmentManager());\n if(tab2 == null && tab3 == null){\n tab1 = new TabActivity1();\n tab2 = new TabActivity2();\n tab3 = new TabActivity3();\n\n setupTab1();\n setupTab2();\n setupTab3();\n\n }\n else if(tab3==null){\n setupTab3();\n }\n\n\n adapter.addFragment(tab1, \"Stats\");\n adapter.addFragment(tab2, \"Overview\");\n adapter.addFragment(tab3, \"Articles\");\n\n\n viewpager.setAdapter(adapter);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_offer, container, false);\n\n mOfferViewPager = view.findViewById(R.id.offerViewPager);\n mImageView = view.findViewById(R.id.offerMainImage);\n mRTL = view.findViewById(R.id.offerRTL);\n mDb = FirebaseFirestore.getInstance();\n mList = new ArrayList<>();\n\n getData();\n\n Log.d(TAG, \"onCompleteMlist: \"+getmList().size());\n adapter = new OfferPagerAdapter(getFragmentManager(), 0, mList);\n Log.d(TAG, \"onCreateView: \"+mList.size());\n\n mOfferViewPager.setAdapter(adapter);\n mRTL.hasFixedSize();\n OfferRTLAdapter RTLadapter = new OfferRTLAdapter(mOfferViewPager);\n Log.d(TAG, \"onCreateView: position\"+ RTLadapter.getCurrentIndicatorPosition());\n Log.d(TAG, \"onCreateView: \"+mOfferViewPager.getCurrentItem());\n mRTL.setUpWithAdapter(RTLadapter);\n\n Log.d(TAG, \"onCreateView: \"+pos);\n mRTL.setIndicatorColor(Color.RED);\n Picasso.get().load(R.drawable.offer_main_pic).into(mImageView);\n return view;\n }",
"public void setupViewPager(ViewPager viewPager) {\n ViewPagerAdapter adapter = new ViewPagerAdapter(getChildFragmentManager());\n adapter.addFragment(FollowingNotificationFragment.newInstance(), getActivity().getResources().getString(R.string.notification_following_tab));\n adapter.addFragment(YouNotificationFragment.newInstance(), getActivity().getResources().getString(R.string.notification_you_tab));\n viewPager.setAdapter(adapter);\n viewPager.setCurrentItem(1);\n }",
"private void init() {\n\t\tpager = (MainViewPager) findViewById(R.id.main_pager);\n\t\tfrageManager = getSupportFragmentManager();\n\t\tfoot_group = (RadioGroup) findViewById(R.id.foot_group);\n\t\tadapter = new MyFragmentAdapter(frageManager, list);\n\t}",
"private void setupViewPagerOne(ViewPager viewPager) {\n\n // Initialize new Bundle for Fragment arguments\n Bundle bundle = new Bundle();\n bundle.putBoolean(\"isHeaderVisible\", false);\n\n // Initialize Fragments\n productsNewest = new ProductsNewest();\n productsOnSale = new ProductsOnSale();\n productsFeatured = new ProductsFeatured();\n \n productsNewest.setArguments(bundle);\n productsOnSale.setArguments(bundle);\n productsFeatured.setArguments(bundle);\n\n \n // Initialize ViewPagerAdapter with ChildFragmentManager for ViewPager\n ViewPagerCustomAdapter viewPagerCustomAdapter = new ViewPagerCustomAdapter(getChildFragmentManager());\n \n // Add the Fragments to the ViewPagerAdapter with TabHeader\n viewPagerCustomAdapter.addFragment(productsNewest, getString(R.string.newest));\n viewPagerCustomAdapter.addFragment(productsOnSale, getString(R.string.super_deals));\n viewPagerCustomAdapter.addFragment(productsFeatured, getString(R.string.featured));\n\n \n viewPager.setOffscreenPageLimit(2);\n \n // Attach the ViewPagerAdapter to given ViewPager\n viewPager.setAdapter(viewPagerCustomAdapter);\n \n \n /*Configuration config = getResources().getConfiguration();\n if (config.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {\n //use the RTL trick here\n viewPager.setRotationY(180);\n viewPager.setLayoutDirection(View.LAYOUT_DIRECTION_RTL);\n }*/\n \n }",
"private void setupViewPager() {\n SectionPagerAdapter sectionPagerAdapter = new SectionPagerAdapter(getSupportFragmentManager());\n sectionPagerAdapter.addFragment(new CameraFragment());\n sectionPagerAdapter.addFragment(new HomeFragment());\n sectionPagerAdapter.addFragment(new MessagesFragment());\n\n mViewPager.setAdapter(sectionPagerAdapter);\n\n // setting up the top tab bar\n tabLayout.setupWithViewPager(mViewPager);\n\n tabLayout.getTabAt(0).setIcon(R.drawable.ic_camera);\n tabLayout.getTabAt(1).setIcon(R.drawable.instagram_logo);\n tabLayout.getTabAt(2).setIcon(R.drawable.ic_arrow);\n\n // Default fragment is the feed fragment\n mViewPager.setCurrentItem(1);\n }",
"private void setupViewPager(ViewPager viewPager) {\n ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager());\n adapter.addFrag(new HomeFragment(), \"ONE\");\n adapter.addFrag(new HistoryFragment(), \"TWO\");\n adapter.addFrag(new HelpFragment(), \"THREE\");\n adapter.addFrag(new MyAccountFragment(), \"FOUR\");\n viewPager.setAdapter(adapter);\n\n }",
"@NonNull\n protected abstract View onCreatePagerView(LayoutInflater inflater, ViewGroup container, int position);",
"@NonNull\n @Override\n public Fragment getItem(int position) {\n return pagerFragments.get(position);\n }",
"private void setupViewPager() {\n SectionsPagerAdapter adapter = new SectionsPagerAdapter(getSupportFragmentManager());\n adapter.addFragment(new MainFragment());\n\n mViewPager.setAdapter(adapter);\n\n TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);\n tabLayout.setupWithViewPager(mViewPager);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View oursellerpriceView = inflater.inflate(R.layout.fragment_our_seller_price, container, false);\n\n mCustomPagerAdapter = new CustomPagerAdapter(getContext());\n\n mViewPager = (ViewPager) oursellerpriceView.findViewById(R.id.pager);\n mViewPager.setAdapter(mCustomPagerAdapter);\n// TitlePageIndicator indicator = (TitlePageIndicator) oursellerpriceView.findViewById(R.id.indicator);\n// indicator.setViewPager(mViewPager);\n CirclePageIndicator indicator =(CirclePageIndicator) oursellerpriceView.findViewById(R.id.indicator);\n indicator.setFillColor(R.color.redToolbar);\n indicator.setViewPager(mViewPager);\n\n //indicator.setSelectedItem(int, true);\n// TabLayout tabLayout = (TabLayout) oursellerpriceView.findViewById(R.id.tabDots);\n// tabLayout.setupWithViewPager(mViewPager, true);\n // mRecyclerView = (RecyclerView) oursellerpriceView.findViewById(R.id.recycler_view);\n// mRecyclerView.setHasFixedSize(true);\n// mLayoutManager = new LinearLayoutManager(getContext());\n// mRecyclerView.setLayoutManager(mLayoutManager);\n return oursellerpriceView;\n }",
"@Override\n\t\t\tpublic void onPageSelected(int arg0) {\n\t\t\t\tLog.i(\"\", \"Enter hereeeeeeeeeeeeeeeeeeeee(onPageSelected!!!\");\n\t\t\t\t\n\t\t\t\t//adapter.instantiateItem(pager, arg0);\n\t\t\t\tadapter.notifyDataSetChanged();\n\t\t\t}",
"private void init() {\n\t\tinitData();\n\t\tmViewPager = (ViewPagerCompat) findViewById(R.id.id_viewpager);\n\t\tnaviBar = findViewById(R.id.navi_bar);\n\t\tNavigationBarUtils.initNavigationBar(this, naviBar, true, ScreenContents.class, false, ScreenViewPager.class,\n\t\t\t\tfalse, ScreenContents.class);\n\t\tmViewPager.setPageTransformer(true, new DepthPageTransformer());\n\t\t// mViewPager.setPageTransformer(true, new RotateDownPageTransformer());\n\t\tmViewPager.setAdapter(new PagerAdapter() {\n\t\t\t@Override\n\t\t\tpublic Object instantiateItem(ViewGroup container, int position) {\n\n\t\t\t\tcontainer.addView(mImageViews.get(position));\n\t\t\t\treturn mImageViews.get(position);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void destroyItem(ViewGroup container, int position, Object object) {\n\n\t\t\t\tcontainer.removeView(mImageViews.get(position));\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic boolean isViewFromObject(View view, Object object) {\n\t\t\t\treturn view == object;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic int getCount() {\n\t\t\t\treturn mImgIds.length;\n\t\t\t}\n\t\t});\n\t}",
"@Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n SID = (UUID) getIntent().getSerializableExtra(EXTRA_ID);\n\n mQurans = QueryUtilsList.get(this).getAllPages();\n\n mBinding = ActivitySurhPagerBinding.inflate(getLayoutInflater());\n setContentView(mBinding.getRoot());\n\n\n // setContentView(R.layout.activity_surh_pager);\n\n mainToolbar = findViewById(R.id.qourn_toolbar) ;\n\n setSupportActionBar(mainToolbar);\n\n getSupportActionBar().setDisplayHomeAsUpEnabled(true);\n\n\n\n // isActionBarHidden = false;\n mActionBarStatus.setActionBarStatus(false);\n\n\n int p = (int)getIntent().getSerializableExtra(EXTRA_SURH_START_PAGE) ;\n\n\n\n\n // QueryUtilsList queryUtilsList = QueryUtilsList.get(this);\n\n\n\n Spinner spinner = (Spinner) findViewById(R.id.spinner);\n\n\n mBinding.surhViewPager.setAdapter(new FragmentStateAdapter(this) {\n @NonNull\n @Override\n public Fragment createFragment(int position) {\n\n //quran = mQurans.get(position);\n\n // return QuranFragment.newInstance(quran.getId());\n return QuranFragment.arrayList.get(position);\n\n }\n\n @Override\n public int getItemCount() {\n //return mQurans.size();\n\n return QuranFragment.arrayList.size();\n }\n });\n\n mBinding.surhViewPager.registerOnPageChangeCallback(pageChangeCallback);\n mBinding.surhViewPager.setCurrentItem(p-1, false) ;\n\n\n\n\n// mViewPager = findViewById(R.id.surh_view_pager);\n/*\n\n mViewPager.setAdapter(new FragmentStateAdapter(this) {\n @NonNull\n @Override\n public Fragment createFragment(int position) {\n quran = mQurans.get(position);\n return QuranFragment.newInstance(quran.getId());\n }\n\n @Override\n public int getItemCount() {\n return mQurans.size();\n }\n\n\n });\n\n mPageChangeCallback = new ViewPager2.OnPageChangeCallback() {\n @Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n super.onPageScrolled(position, positionOffset, positionOffsetPixels);\n\n }\n\n @Override\n public void onPageSelected(int position) {\n super.onPageSelected(position);\n Toast.makeText(SurhPagerActivity.this, \" position= \" +position , Toast.LENGTH_SHORT).show();\n\n\n }\n\n @Override\n public void onPageScrollStateChanged(int state) {\n super.onPageScrollStateChanged(state);\n }\n };*/\n\n\n\n\n\n\n\n\n\n\n }",
"@Override\n public Object instantiateItem(ViewGroup container, int position) {\n View itemView = LayoutInflater.from(context).inflate(R.layout.pager_item, container, false);\n\n Resources res = context.getResources();\n String[] pagerContents = res.getStringArray(R.array.pagerContents);\n String[] pagerTitles = res.getStringArray(R.array.pagerTitles);\n\n int index = position - 1;\n if (position == 0) {\n index = count - 1;\n } else if (position == count + 1) {\n index = 0;\n }\n TextView title = (TextView) itemView.findViewById(R.id.viewPager_Title);\n TextView content = (TextView) itemView.findViewById(R.id.viewPager_Content);\n\n title.setText(pagerTitles[index]);\n content.setText(pagerContents[index]);\n\n\n container.addView(itemView);\n return itemView;\n }",
"private void setupTheFrangment() {\n viewPager = (ViewPager) findViewById(R.id.viewpager);\n adapterViewPager = new MyPagerAdapter(getSupportFragmentManager());\n viewPager.setAdapter(adapterViewPager);\n\n // Give the TabLayout the ViewPager\n TabLayout tabLayout = (TabLayout) findViewById(R.id.sliding_tabs);\n tabLayout.setupWithViewPager(viewPager);\n }",
"private void initViews() {\n tabLayout = findViewById(R.id.tabs);\n viewPager = findViewById(R.id.viewpager);\n myAdapter=new MyAdapter(getSupportFragmentManager());\n viewPager.setAdapter(myAdapter);\n viewPager.setAllowedSwipeDirection(SwipeDirection.all);\n\n Intent intent = getIntent();\n\n if(intent.hasExtra(\"matchStatus\")){\n sessionManager.setRefreshChatFragment(true);\n viewPager.setCurrentItem(2);\n }\n else\n viewPager.setCurrentItem(1);\n\n\n\n tabLayout.post(new Runnable() {\n @Override\n public void run() {\n tabLayout.setupWithViewPager(viewPager);\n setupIcons();\n }\n });\n\n receivePushNotification();\n }",
"public void initViewPager() {\n setWillNotDraw(false);\n setDescendantFocusability(262144);\n setFocusable(true);\n Context context = getContext();\n this.mScroller = new Scroller(context, sInterpolator);\n ViewConfiguration viewConfiguration = ViewConfiguration.get(context);\n float f = context.getResources().getDisplayMetrics().density;\n this.mTouchSlop = ViewConfigurationCompat.getScaledPagingTouchSlop(viewConfiguration);\n this.mMinimumVelocity = (int) (400.0f * f);\n this.mMaximumVelocity = viewConfiguration.getScaledMaximumFlingVelocity();\n this.mLeftEdge = new EdgeEffectCompat(context);\n this.mRightEdge = new EdgeEffectCompat(context);\n this.mFlingDistance = (int) (25.0f * f);\n this.mCloseEnough = (int) (2.0f * f);\n this.mDefaultGutterSize = (int) (f * 16.0f);\n ViewCompat.setAccessibilityDelegate(this, new MyAccessibilityDelegate());\n if (ViewCompat.getImportantForAccessibility(this) == 0) {\n ViewCompat.setImportantForAccessibility(this, 1);\n }\n }",
"private void setupViewPage(ViewPager viewPager) {\n ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager());\n adapter.addFrag(new SavedGamesFragment(), savedGamesLabel);\n adapter.addFrag(new HostGamesFragment(), hostedGamesLabel);\n viewPager.setAdapter(adapter);\n }",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_survey); // calls layout activity_survey.xml\n viewPager=(ViewPager) findViewById(R.id.survey); // survey declared in activity_survey.xml\n FragmentManager fm = getSupportFragmentManager();\n viewPager.setAdapter(new MyAdapter(fm));\n }",
"@Override\n public void onPageSelected(int position) {\n viewPager.getAdapter().notifyDataSetChanged();\n Log.d(\"ADebugTag\", \"***************notifyDataSetChanged*************** \");\n\n }",
"public ScreenSlidePagerAdapter(FragmentManager fm) {\n\n super(fm);\n }",
"private void initPager(View v)\n {\n pager = (ViewPager) v.findViewById(R.id.pager);\n pager.setPageMargin(10);\n\n pager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {\n\n @Override\n public void onPageSelected(int pos) {\n if (vDots == null || vDots.getTag() == null)\n return;\n ((ImageView) vDots.getTag())\n .setImageResource(R.drawable.dot_gray);\n ((ImageView) vDots.getChildAt(pos))\n .setImageResource(R.drawable.dot_blue);\n vDots.setTag(vDots.getChildAt(pos));\n }\n\n @Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n }\n\n @Override\n public void onPageScrollStateChanged(int arg0) {\n }\n });\n vDots = (LinearLayout) v.findViewById(R.id.vDots);\n\n pager.setAdapter(new PageAdapter());\n setupDotbar(v);\n }",
"private void setCategoryPageAdapter(int position) {\n categoryRecyclerView.setAdapter(categoryPageAdapter);\n categoryPageAdapter.notifyDataSetChanged();\n }",
"private void setupViewPager(ViewPager viewPager) {\n statisticsTabAdapter adapter = new statisticsTabAdapter(getSupportFragmentManager());\n adapter.addFragment(new statisticsTabOne(), \"TODAY\");\n adapter.addFragment(new statisticsTabTwo(), \"WEEK\");\n adapter.addFragment(new statisticsTabThree(), \"MONTH\");\n viewPager.setAdapter(adapter);\n }",
"public Object instantiateItem(ViewGroup container, int position)\n {\n \n container.addView(mPagersList.get(position));\n return mPagersList.get(position);\n \n }",
"@Override\n protected void initViews() {\n ButterKnife.bind(this);\n effcetTitleTablayout.setupWithViewPager(effectViewpager);\n adapter = new EffectViewPagerAdapter(getSupportFragmentManager());\n effectViewpager.setAdapter(adapter);\n }",
"public MyPagerAdapter(FragmentManager fm) {\n super(fm);\n }",
"@Override\n public void onViewCreated(View view, Bundle savedInstanceState) {\n TextPagerAdapter mTextPagerAdapter = new TextPagerAdapter(\n getChildFragmentManager(), getMyData());\n mViewPager = (ViewPager) view.findViewById(R.id.pager);\n mViewPager.setAdapter(mTextPagerAdapter);\n }",
"private void setUiPageViewController() {\n mBinding.llPdpProductImagePosition.removeAllViews();\n mDotsCount = mProductsViewPagerAdapter.getCount();\n mDots = new ImageView[mDotsCount];\n if (mDotsCount > ZERO) {\n EcomUtil.setViewPagerDots(this, mDots, mDotsCount, mBinding.llPdpProductImagePosition);\n }\n }",
"@Override\n\tpublic Object instantiateItem(ViewGroup container, int position) {\n\n\t\tLayoutInflater inflater = (LayoutInflater) context.getSystemService(context.LAYOUT_INFLATER_SERVICE);\n\t\tView page;\n\n\t\tLog.e(\"position == \", \"\" + position);\n\n\t\tpage = inflater.inflate(R.layout.featured_pager_item, null);\n\t\tImageView image = (ImageView) page.findViewById(R.id.imageView1);\n\t\tTextView title = (TextView) page.findViewById(R.id.textTitle);\n\t\tTextView textcontent = (TextView) page.findViewById(R.id.textContent);\n\t\tTextView textcontent1 = (TextView) page.findViewById(R.id.textContent1);\n\n\t\t// ().setBackgroundResource(urls.get(position));\n\t\t// Add the page to the front of the queue\n\t\tImageLoader loader = new ImageLoader(context);\n\n\t\t//loader.DisplayImage(MainActivity.featured.get(position).getShow_img(), image);\n\t\tPicasso.with(this.context).load(MainActivity.featured.get(position).getShow_img()).into(image);\n\t\ttitle.setText(MainActivity.featured.get(position).getTitle());\n\t\ttextcontent.setText(MainActivity.featured.get(position).getCat_name());\n\t\ttextcontent1.setText(\"Episodes: \" + MainActivity.featured.get(position).getNo_of_episode());\n\t\t((ViewPager) container).addView(page, 0);\n\n\n\t\treturn page;\n\t}",
"private void initViews() {\n\t\tmViewPager = (ViewPager) findViewById(R.id.view_pager); \n mIndicator = (IconTabPageIndicator) findViewById(R.id.indicator); \n fragments = initFragments(); \n FragmentAdapter adapter = new FragmentAdapter(fragments, getSupportFragmentManager()); \n mViewPager.setAdapter(adapter); \n mIndicator.setViewPager(mViewPager); \n mViewPager.setCurrentItem(whichPage);\n \n \n \n\t}",
"@Override\n public void setRecyclerViewAdapter() {\n recyclerView.setAdapter(favouritePageRecyclerViewAdapter);\n\n }",
"private void initViewPager() {\n\t RelativeLayout.LayoutParams rl = new RelativeLayout.LayoutParams(\n\t ContextUtil.getWidth(SecurityMonitorActivity.this) / 2, PixelUtils.dp2px(2));\n\t rl.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, RelativeLayout.TRUE);\n\t cursor.setLayoutParams(rl);\n\t\toffset = (ContextUtil.getWidth(SecurityMonitorActivity.this) / 2 - cursor.getWidth()/2);// 计算偏移量\n\t\tbmpW = cursor.getWidth();\n\t\tMatrix matrix = new Matrix();\n\t\tmatrix.postTranslate(offset, 0);\n\t\tcursor.setImageMatrix(matrix);// 设置动画初始位置\n\n\t\tmonitorPreviewFragment = new MonitorPreviewFragment();\n\t\tvideoPlaybackFragment = new VideoPlaybackFragment();\n\n\t mFragments.add(monitorPreviewFragment);\n\t mFragments.add(videoPlaybackFragment);\n\t tv_title1.setTextColor(getResources().getColor(R.color.gray));\n\t pager.setOffscreenPageLimit(3);\n\t pager.setAdapter(new MyPagerAdapter(SecurityMonitorActivity.this.getSupportFragmentManager(), mFragments));\n\t pager.setCurrentItem(0);\n\t pager.setOnPageChangeListener(new MyOnPageChangeListener());\n\t}",
"public void initViewPager() {\n\n PagerAdapter adapter = new FragOrder.MyPagerAdapter();\n pager.setAdapter(adapter);\n pager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {\n\n @Override\n public void onPageSelected(int index) {\n // TODO Auto-generated method stub\n for (int i = 0; i < tvs.size(); i++) {\n if (i == index) {\n tvs.get(i).setTextColor(Color.BLUE);\n } else {\n tvs.get(i).setTextColor(Color.rgb(55, 55, 55));\n }\n }\n }\n\n @Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n // TODO Auto-generated method stub\n\n }\n\n @Override\n public void onPageScrollStateChanged(int arg0) {\n // TODO Auto-generated method stub\n\n }\n });\n }",
"private void initView() {\n List<Fragment> fragmentList = new ArrayList<>();\n fragmentList.add(new FourthFragment());\n fragmentList.add(new FifthFragment(imagePath));\n// set titles\n List<String> title = new ArrayList<>();\n title.add(\"第一页\");\n title.add(\"第二页\");\n// set the adapter\n viewPager.setAdapter(new FragmentPagerAdapter(getChildFragmentManager()) {\n @NonNull\n @NotNull\n @Override\n public Fragment getItem(int position) {\n return fragmentList.get(position);\n }\n\n @Override\n public int getCount() {\n return fragmentList.size();\n }\n\n @Nullable\n @org.jetbrains.annotations.Nullable\n @Override\n public CharSequence getPageTitle(int position) {\n return title.get(position);\n }\n });\n tabLayout.setupWithViewPager(viewPager);\n }",
"IPager createPager(PagedList.Config config);",
"@Override\n public Object instantiateItem(ViewGroup container, int position) {\n ((ViewPager)container).addView(viewContainter.get(position));\n return viewContainter.get(position);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_two, container, false);\n\n TabLayout tl = v.findViewById(R.id.viewpagertab);\n viewPager = v.findViewById(R.id.viewpager);\n LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());\n linearLayoutManager.setOrientation(RecyclerView.VERTICAL);\n viewPager.setAdapter(new viewpageradapter(getFragmentManager(), tl.getTabCount()));\n viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tl));\n tl.setTabMode(TabLayout.MODE_FIXED);\n tl.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener(){\n\n @Override\n public void onTabSelected(TabLayout.Tab tab) {\n viewPager.setCurrentItem(tab.getPosition());\n }\n\n @Override\n public void onTabUnselected(TabLayout.Tab tab) {\n\n }\n\n @Override\n public void onTabReselected(TabLayout.Tab tab) {\n\n }\n });\n return v;\n }",
"@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n View rootview= inflater.inflate(R.layout.fragment_board, container, false);\n mViewPager = (ViewPager) rootview.findViewById(R.id.viewPager);\n\n\n\n\n mCardAdapter = new CardPagerAdapter();\n mCardAdapter.addCardItem(new CardItem(R.string.title_1, R.string.text_1));\n mCardAdapter.addCardItem(new CardItem(R.string.title_2, R.string.text_1));\n mCardAdapter.addCardItem(new CardItem(R.string.title_3, R.string.text_1));\n\n\n\n mViewPager.setAdapter(mCardAdapter);\n\n mViewPager.setOffscreenPageLimit(3);\n\n return rootview;}",
"private void setup() {\n adapter = new HomeAdapter(this);\n\n linearLayoutManager = new LinearLayoutManager\n (this, LinearLayoutManager.VERTICAL, false);\n rv.setLayoutManager(linearLayoutManager);\n rv.setItemAnimator(new DefaultItemAnimator());\n\n rv.setAdapter(adapter);\n showWait();\n if (NetworkUtils.isNetworkConnected(this)) {\n\n presenter.loadPage(currentPage);\n } else {\n onFailure(NetworkError.NETWORK_ERROR_MESSAGE);\n }\n rv.addOnScrollListener(new PaginationScrollListener(linearLayoutManager) {\n @Override\n protected void loadMoreItems() {\n AppLogger.d(TAG,\"currentPage:\"+currentPage);\n isLoading = true;\n currentPage += 1;\n presenter.loadPage(currentPage);\n\n\n }\n\n @Override\n public int getTotalPageCount() {\n AppLogger.d(TAG,\"TOTAL_PAGES:\"+TOTAL_PAGES);\n return TOTAL_PAGES;\n }\n\n @Override\n public boolean isLastPage() {\n return isLastPage;\n }\n\n @Override\n public boolean isLoading() {\n return isLoading;\n }\n });\n\n\n }",
"@Override\r\n\tpublic Object instantiateItem(View container, int position) {\n\t\t((ViewPager)container).addView(mViews.get(position));\r\n\t\treturn mViews.get(position);\r\n\t}",
"private void initView() {\n\t\tmVPImageScanner=(ViewPager) findViewById(R.id.vp_image_scanner);\n\t}",
"public void setUptoptabbar(){\n\n\n FragmentPagerItemAdapter adapter = new FragmentPagerItemAdapter(\n getSupportFragmentManager(), FragmentPagerItems.with(this)\n\n .add(\"All Songs\", All_Song_Fragment.class)\n .add(\"Albums\",All_Album_Fragment.class)\n .add(\"Artists\",All_Artist_Fragment.class)\n .add(\"Genres\",All_Song_Fragment.class)\n .add(\"Playlists\",All_Song_Fragment.class)\n .create());\n ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager);\n viewPager.setAdapter(adapter);\n\n SmartTabLayout viewPagerTab = (SmartTabLayout) findViewById(R.id.viewpagertab);\n viewPagerTab.setViewPager(viewPager);\n }",
"public AppPagerAdapter(FragmentManager fm) {\n super(fm);\n }",
"private void initViews() {\n setActionBarTitle(R.string.my_energy_metabolism);\n mViewPager = (CustomViewPager) findViewById(R.id.viewPager);\n }",
"public NonSwipeableViewPager(Context context) {\n super(context);\n setMyScroller();\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_view_pager, container, false);\n for (int i = 0; i < books.size(); i++)\n {\n this.fragments.add(BookDetailsFragment.newInstance(books.get(i)));\n }\n viewPager = view.findViewById(R.id.viewPager);\n myFragmentAdapter = new MyFragmentAdapter(getFragmentManager());\n viewPager.setAdapter(myFragmentAdapter);\n\n return view;\n }",
"public void setupAdapter() {\n recyclerAdapter = new PhotosAdapter(this);\n recyclerViewPhotos.setAdapter(recyclerAdapter);\n }",
"private void init() {\n UsersListAdapter usersListAdapter = new UsersListAdapter(getSupportFragmentManager());\n mViewPagerUserListing.setAdapter(usersListAdapter);\n\n // attach tab layout with view pager\n mTabLayoutUserListing.setupWithViewPager(mViewPagerUserListing);\n\n }",
"@Override\n\tpublic View getView(int position) {\n\t\treturn pagerFragments.get(position).getContent();\n\t}",
"@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_friends, container, false);\r\n tabLayout = (TabLayout)rootView.findViewById(R.id.tab_layout);\r\n\r\n //Initializing viewPager\r\n viewPager = (ViewPager)rootView.findViewById(R.id.pager);\r\n tabLayout.addTab(tabLayout.newTab().setText(\"Friends\"));\r\n tabLayout.addTab(tabLayout.newTab().setText(\"Requests\"));\r\n tabLayout.addTab(tabLayout.newTab().setText(\"Search\"));\r\n tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);\r\n\r\n\r\n FriendPagerAdapter friendPagerAdapter = new FriendPagerAdapter(getChildFragmentManager(),tabLayout.getTabCount());\r\n viewPager.setAdapter(friendPagerAdapter);\r\n\r\n viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));\r\n tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {\r\n @Override\r\n public void onTabSelected(TabLayout.Tab tab) {\r\n viewPager.setCurrentItem(tab.getPosition());\r\n /* switch (tab.getPosition()){\r\n case 0:\r\n break;\r\n case 1:\r\n break;\r\n }*/\r\n\r\n\r\n }\r\n\r\n @Override\r\n public void onTabUnselected(TabLayout.Tab tab) {\r\n viewPager.setCurrentItem(tab.getPosition());\r\n }\r\n\r\n @Override\r\n public void onTabReselected(TabLayout.Tab tab) {\r\n viewPager.setCurrentItem(tab.getPosition());\r\n }\r\n\r\n });\r\n return rootView;\r\n }",
"@Override\n\tpublic View instantiateItem(ViewGroup container, int position) {\n\t\tif(convertView == null){\n\t\t\tconvertView = mInflater.inflate(R.layout.pager_item, null);\n\t\t}\n\t\tTextView textView = (TextView) convertView.findViewById(R.id.title);\n\t\tWebView webView = (WebView) convertView.findViewById(R.id.webView);\n\t\t\n\t\ttextView.setText(mStories.get(position).getTitle());\n\t\tString html = \"<html><head></head><body>\"\n\t\t\t\t/*+ \"<img src=\\\"\" + imagePath + \"\\\">\"*/\n\t\t\t\t\t\t+ \"My Text\"+mStories.get(position).getBody()\n\t\t\t\t\t\t+ \"</body></html>\";\n\t\twebView.loadDataWithBaseURL(\"\", html, \"text/html\", \"utf-8\", \"\");\n\t\treturn convertView;\n\t}",
"@Override\n protected void onPostExecute(Void result) {\n startViewPagerThread();\n\n }",
"public TweetsPagerAdapter(FragmentManager fm) {\n super(fm);\n }",
"public SectionsPagerAdapter(FragmentManager fm) {\n super(fm);\n }",
"public SectionsPagerAdapter(FragmentManager fm) {\n super(fm);\n }",
"@Override\n public void onPageSelected(int position) {\n mViewPager.setCurrentItem(position);\n selectTab(position);\n }",
"public Fragment getItem(int position) {\n\t\treturn pagerFragments.get(position);\n\t}",
"public ViewPagerAdapter(FragmentManager fm, Context context,ArrayList<Fragment> viewPagerFragments) {\n super(fm);\n mContext = context;\n pagerFragments = new ArrayList<>();\n pagerFragments.addAll(viewPagerFragments);\n }",
"@Override\n public void onViewCreated(View view, Bundle savedInstanceState) {\n mViewPager = (ViewPager) view.findViewById(R.id.viewpager2);\n mViewPager.setAdapter(new SamplePagerAdapter());\n\n // Give the SlidingTabLayout the ViewPager, this must be done AFTER the ViewPager has had\n // it's PagerAdapter set.\n mSlidingTabLayout = (SlidingTabLayout) view.findViewById(R.id.sliding_tabs2);\n mSlidingTabLayout.setViewPager(mViewPager);\n }",
"public MainFragmentPagerAdapter(FragmentManager fm) {\r\n super(fm);\r\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(\n R.layout.fragment_pager,\n container,\n false);\n findViews(view);\n setupAdapter();\n setupTabLayout();\n return view;\n }"
] | [
"0.71702206",
"0.69975734",
"0.69870186",
"0.69778335",
"0.6964479",
"0.69599247",
"0.6955801",
"0.69445014",
"0.6938361",
"0.6927485",
"0.6918815",
"0.6883868",
"0.6831151",
"0.68289685",
"0.6828031",
"0.67952454",
"0.67879266",
"0.67844737",
"0.67779756",
"0.6769411",
"0.67377436",
"0.6723536",
"0.66912425",
"0.66832566",
"0.66831183",
"0.66556364",
"0.6649728",
"0.663793",
"0.6634198",
"0.6623516",
"0.6612987",
"0.65935373",
"0.659199",
"0.65638196",
"0.65141344",
"0.6508544",
"0.64507437",
"0.64239347",
"0.6403665",
"0.63982457",
"0.6390577",
"0.63691115",
"0.63629293",
"0.6360903",
"0.63465077",
"0.6344724",
"0.63112366",
"0.6286817",
"0.6261296",
"0.62609154",
"0.6252679",
"0.6237399",
"0.62123865",
"0.61772853",
"0.61596674",
"0.6157553",
"0.6123404",
"0.6116233",
"0.61007464",
"0.6095985",
"0.6088907",
"0.60884625",
"0.6084964",
"0.6083466",
"0.60821646",
"0.6070568",
"0.60694456",
"0.6048766",
"0.6019221",
"0.6014299",
"0.60109323",
"0.6000528",
"0.5990264",
"0.59893495",
"0.5985348",
"0.5942761",
"0.59258837",
"0.5922459",
"0.5909247",
"0.5906148",
"0.5885616",
"0.5843442",
"0.5830442",
"0.5826249",
"0.58223295",
"0.5813209",
"0.5794176",
"0.57909656",
"0.57854795",
"0.5775159",
"0.5763717",
"0.57533467",
"0.5734451",
"0.5734451",
"0.57329905",
"0.5727034",
"0.57255954",
"0.572451",
"0.5718378",
"0.5717862"
] | 0.64297533 | 37 |
Code here will be triggered once the drawer opens, we don't need anything to happen yet, hence leave it blank | @Override
public void onDrawerClosed(View drawerView) {
super.onDrawerClosed(drawerView);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\t\t\tpublic void onDrawerOpened() {\n\t\t\t\tshowDown();\n\t\t\t}",
"@Override\n public void onDrawerStateChanged(int newState) {\n }",
"@Override\n public void onDrawerStateChanged(int newState) {\n }",
"@Override\n public void onDrawerStateChanged(int newState) {\n }",
"@Override\n public void onDrawerStateChanged(int newState) {\n }",
"@Override\n public void onDrawerOpened(View drawerView) {\n }",
"@Override\n public void onDrawerStateChanged(int newState) {\n }",
"@Override\n public void onDrawerOpened(View drawerView) {\n }",
"@Override\n public void onDrawerOpened(View drawerView) {\n Log.d(\"Apps Main\", \"Open drawer \");\n }",
"@Override\n public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }",
"@Override\n public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }",
"@Override\n public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }",
"@Override\n public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }",
"@Override\n public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }",
"@Override\n public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }",
"@Override\n public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }",
"@Override\n public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }",
"@Override\n public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }",
"@Override\n public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }",
"@Override\n public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }",
"@Override\n public void onDrawerOpened(View drawerView) {\n\n super.onDrawerOpened(drawerView);\n }",
"@Override\n public void onDrawerOpened(View drawerView) {\n\n super.onDrawerOpened(drawerView);\n }",
"@Override\n public void onDrawerOpened(View drawerView) {\n\n super.onDrawerOpened(drawerView);\n }",
"@Override\n\t\t\tpublic void onDrawerClosed() {\n\t\t\t\tshowUp();\n\t\t\t}",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n handleEvent_onDrawerOpened(drawerView);\n }",
"@Override\n public void onDrawerClosed(View drawerView) {\n }",
"@Override\n public void onDrawerClosed(View drawerView) {\n }",
"public void onDrawerOpened(View drawerView) {\n\n }",
"@Override\n public void onDrawerClosed(View drawerView) {\n }",
"private void MenuHOOKS() {\n drawerLayout = findViewById(R.id.drawer_layout);\n navigationView = findViewById(R.id.navigation_view);\n burger_icon = findViewById(R.id.burger_icon);\n contentView = findViewById(R.id.content);\n\n //Navigation Drawer\n navigationView.bringToFront();\n navigationView.setNavigationItemSelectedListener(this);\n navigationView.setCheckedItem(R.id.nav_home);\n\n burger_icon.setOnClickListener(this);\n\n //Animation Function\n animateNavigationDrawer();\n\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n //getActionBar().setTitle(mDrawerTitle);\n //invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n //getActionBar().setTitle(mDrawerTitle);\n //invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }",
"private void setupDrawerContent() {\n previousMenuItem = navigationView.getMenu().findItem(R.id.nav_category);\n previousMenuItem.setChecked(true);\n previousMenuItem.setCheckable(true);\n\n navigationView.setNavigationItemSelectedListener(\n new NavigationView.OnNavigationItemSelectedListener() {\n @Override\n public boolean onNavigationItemSelected(MenuItem menuItem) {\n\n drawerLayout.closeDrawer(Gravity.LEFT);\n\n if (previousMenuItem.getItemId() == menuItem.getItemId())\n return true;\n\n menuItem.setCheckable(true);\n menuItem.setChecked(true);\n previousMenuItem.setChecked(false);\n previousMenuItem = menuItem;\n\n switch (menuItem.getItemId()) {\n case R.id.nav_category:\n displayView(CATEGORIES_FRAG, null);\n break;\n case R.id.nav_favorites:\n displayView(FAVORITE_FRAG, null);\n break;\n case R.id.nav_reminder:\n displayView(REMINDER_FRAG, null);\n break;\n case R.id.nav_about:\n displayView(ABOUT_FRAG, null);\n break;\n case R.id.nav_feedback:\n IntentHelper.sendEmail(BaseDrawerActivity.this);\n break;\n case R.id.nav_rate_us:\n IntentHelper.voteForAppInBazaar(BaseDrawerActivity.this);\n break;\n case R.id.nav_settings:\n displayView(SETTINGS_FRAG, null);\n break;\n\n }\n\n\n return true;\n }\n }\n\n );\n }",
"public void onDrawerClosed(View view) {\n }",
"public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n\n\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n getSupportActionBar().setTitle(\"Navigation!\");\n //invalidateOptionsMenu();\n //creates call to onPrepareOptionsMenu()\n }",
"public void onDrawerOpened(View drawerView) {\n\t\t\t\t\t invalidateOptionsMenu(); \n\t\t\t\t\t }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n getActionBar().setTitle(R.string.drawer_open);\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }",
"void displayDrawer() {\n //toolbar = (Toolbar) findViewById(R.id.toolbar);\n setSupportActionBar(toolbar);\n actionbar = getSupportActionBar();\n actionbar.setDisplayHomeAsUpEnabled(true);\n\n actionbar.setHomeAsUpIndicator(R.drawable.ic_menu);\n\n navigationView.setNavigationItemSelectedListener(\n new NavigationView.OnNavigationItemSelectedListener() {\n @Override\n public boolean onNavigationItemSelected(MenuItem menuItem) {\n // set item as selected to persist highlight\n menuItem.setChecked(true);\n // close drawer when item is tapped\n mdrawer.closeDrawers();\n\n String choice = menuItem.getTitle().toString();\n\n switch (choice) {\n case \"Register\":\n Intent i = new Intent(getBaseContext(), SignIn.class);\n startActivity(i);\n break;\n case \"Log In\":\n Intent p = new Intent(getBaseContext(), LoginActivity.class);\n startActivity(p);\n break;\n\n case \"Profile Picture\":\n Intent pic = new Intent(getBaseContext(), ImageUpload.class);\n startActivity(pic);\n break;\n\n case \"Users\":\n Intent users = new Intent(getBaseContext(), Userlist.class);\n startActivity(users);\n break;\n\n case \"Chats\":\n Intent chats = new Intent(getBaseContext(), ChatList.class);\n startActivity(chats);\n break;\n }\n\n // Add code here to update the UI based on the item selected\n // For example, swap UI fragments here\n\n return true;\n }\n });\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n // getSupportActionBar().setTitle(mDrawerTitle);\n //invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }",
"@Override\n\t\t\tpublic void onDrawerOpened() {\n\t\t\t\tbottomLayout.setVisibility(View.INVISIBLE);\n\t\t\t}",
"public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n // Do whatever you want here\n }",
"public void doDrawerStuff() {\n Toolbar myToolbar = (Toolbar) findViewById(R.id.my_toolbar);\n setSupportActionBar(myToolbar);\n\n mPlanetTitles = getResources().getStringArray(R.array.planets_array);\n mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);\n\n\n mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout,myToolbar, R.string.drawer_open, R.string.drawer_close) {\n\n /** Called when a drawer has settled in a completely closed state. */\n public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n // getSupportActionBar().setTitle(mTitle);\n\n //invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }\n\n /** Called when a drawer has settled in a completely open state. */\n public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n // getSupportActionBar().setTitle(mDrawerTitle);\n //invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }\n };\n\n // Set the drawer toggle as the DrawerListener\n mDrawerLayout.setDrawerListener(mDrawerToggle);\n\n getSupportActionBar().setDisplayHomeAsUpEnabled(true);\n getSupportActionBar().setHomeButtonEnabled(true);\n\n\n\n mDrawerList = (ListView) findViewById(R.id.left_drawer);\n\n // Set the adapter for the list view\n mDrawerList.setAdapter(new ArrayAdapter<String>(this,\n R.layout.drawer_list_item, mPlanetTitles));\n // Set the list's click listener\n mDrawerList.setOnItemClickListener(new DrawerItemClickListener());\n\n\n\n\n\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n invalidateOptionsMenu();\n }",
"public void onDrawerClosed(View view) {\n\t\t\t\t\t invalidateOptionsMenu(); \n\t\t\t\t\t }",
"private void setUpNavigationDrawer() {\n navigationView.setNavigationItemSelectedListener(item -> {\n Fragment nextFragment = findNextFragment(item.getItemId());\n\n if (nextFragment instanceof WalkFragment && areLocationServicesDisabled()) {\n MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(this);\n builder.setTitle(R.string.location_services_not_enabled_title);\n builder.setMessage(R.string.location_services_not_enabled_message);\n builder.setPositiveButton(R.string.ok, null);\n\n builder.show();\n } else {\n changeFragment(nextFragment);\n\n item.setChecked(true);\n drawerLayout.closeDrawers();\n setUpNewFragment(item.getTitle(), item.getItemId());\n }\n\n return true;\n });\n }",
"@Override\n public void run() {\n drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);\n\n // Hides the toolbar\n ViewGroup.LayoutParams layoutParams = toolbar.getLayoutParams();\n layoutParams.height = 0;\n toolbar.setLayoutParams(layoutParams);\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n// getActionBar().setTitle(\"Select Destination\");\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n getSupportActionBar().setTitle(\"Timesheet\");\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n\n\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"public void onDrawerOpened(View drawerView) {\n supportInvalidateOptionsMenu();\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n //getSupportActionBar().setTitle(\"Navigation Drawer\");\n invalidateOptionsMenu();\n }",
"@Override\n public void onDrawerClosed(View drawerView) {\n invalidateOptionsMenu();\n Log.d(\"Apps Main\", \"Close drawer \");\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n getSupportActionBar().setTitle(\"Navigation!\");\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }",
"private void setupDrawer(){\n NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);\n assert navigationView != null;\n navigationView.setNavigationItemSelectedListener(this);\n View hView = navigationView.getHeaderView(0);\n\n this.nameInput = (TextView) hView.findViewById(R.id.nav_user_name);\n this.emailInput = (TextView) hView.findViewById(R.id.nav_user_email);\n\n this.userImage = (NetworkImageView) hView.findViewById(R.id.nav_user_image);\n\n assert drawer != null;\n drawer.addDrawerListener(new DrawerLayout.SimpleDrawerListener() {\n @Override\n public void onDrawerOpened(View drawerView) {\n mSearchView.setLeftMenuOpen(false);\n }\n });\n\n View switchView = navigationView.getMenu().findItem(R.id.nav_service).getActionView();\n SwitchCompat mSwitch = (SwitchCompat) switchView.findViewById(R.id.service_switcher);\n\n mSwitch.setChecked(leaveServiceOnAfterDestroy);\n mSwitch.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n SwitchCompat mSwitch = (SwitchCompat) v;\n if(mSwitch.isChecked()){\n //turn service on after destroy without question\n serviceSwitcher(true);\n }else{\n //if user want to turn service off then show dialog\n serviceSettingsDialog(v);\n }\n }\n });\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n getSupportActionBar().setTitle(mDrawerTitle);\n //updateView(5, 99, true);\n }",
"public void onDrawerOpened(View drawerView) {\r\n super.onDrawerOpened(drawerView);\r\n if(!mUserLearnedDrawer){\r\n\r\n mUserLearnedDrawer=true;\r\n Utility utility=new Utility();\r\n utility.writeToSharedPref(getApplicationContext(),KEY_USER_LEARNED_DRAWER,mUserLearnedDrawer+\"\");\r\n }\r\n invalidateOptionsMenu();\r\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n\n\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n displaySelectedScreen(id);\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n DrawerLayout drawer = findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n\n DrawerLayout drawer = findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n getSupportActionBar().setTitle(\"Navigation\");\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }",
"@Override\n\t\t\tpublic void onDrawerClosed() {\n\t\t\t\tlayoutParams = new FrameLayout.LayoutParams(\n\t\t\t\t\t\tLayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);\n\t\t\t\tslidingDrawer.setLayoutParams(layoutParams);\n\t\t\t\tbottomLayout.setVisibility(View.VISIBLE);\n\t\t\t}",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n// getActionBar().setTitle(\"WXTJ Student Radio\");\n }",
"public void onDrawerOpened(View drawerView) {\n getActionBar().setTitle(\"Opened Drawer\");\n }",
"protected void onCreateDrawer() {\n toolbar = (Toolbar) findViewById(R.id.tool_bar);\n setSupportActionBar(toolbar);\n\n //Initializing NavigationView\n navigationView = (NavigationView) findViewById(R.id.navigation_view);\n\n navigationView.setNavigationItemSelectedListener(new NavigationViewItemListener());\n\n // Initializing Drawer Layout and ActionBarToggle\n drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);\n actionBarDrawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, R.string.open_drawer, R.string.close_drawer){\n\n @Override\n public void onDrawerClosed(View drawerView) {\n // Code here will be triggered once the drawer closes as we don't want anything to happen so we leave this blank\n super.onDrawerClosed(drawerView);\n }\n\n @Override\n public void onDrawerOpened(View drawerView) {\n // Code here will be triggered once the drawer open as we don't want anything to happen so we leave this blank\n super.onDrawerOpened(drawerView);\n }\n };\n\n //Setting the actionbarToggle to drawer layout\n drawerLayout.addDrawerListener(actionBarDrawerToggle);\n\n //calling sync state is necessary or else your hamburger icon wont show up\n actionBarDrawerToggle.syncState();\n\n UpdateHeader(this, navigationView);\n\n if (YummySession.selectedItemPosition != -1) {\n navigationView.getMenu().getItem(YummySession.selectedItemPosition).setChecked(true);\n }\n\n }",
"@Override\n\tpublic void onSidebarOpened() {\n\t\tLog.d(TAG, \"opened\");\n\n\t}",
"public void onDrawerClosed(View drawerView) {\n\n }",
"public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n //getActionBar().setTitle(mTitle);\n //invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }",
"public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n //getActionBar().setTitle(mTitle);\n //invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }",
"public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n\n }",
"@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tmCallbacks.openDrawerExhi();\r\n\t\t\t}",
"public void onDrawerOpened(View drawerView) {\n\t\t\t\tsuper.onDrawerOpened(drawerView);\n\t\t\t\tgetSupportActionBar().setTitle(\"Munchies\");\n\t\t\t\tinvalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n\t\t\t}",
"public void onDrawerOpened(View drawerView) {\n\t\t\t\tLog.d(TAG, \"nav drawer opened state\");\n\t\t\t\tgetActionBar().setTitle(drawerTitle);\n\t\t\t\tinvalidateOptionsMenu();// goes to onPrepareOptionsMenu()\n\t\t\t}",
"public void onDrawerOpened(View drawerView) {\n if (Build.VERSION.SDK_INT >= 11) {\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n } else {\n //Call it directly on gingerbread.\n onPrepareOptionsMenu(mMenu);\n }\n }",
"public void onDrawerClosed(View view) {\n getActionBar().setTitle(\"Closed Drawer\");\n }",
"@Override\n public void onDrawerSlide(View drawerView, float slideOffset) {\n }",
"@Override\n public void onDrawerSlide(View drawerView, float slideOffset) {\n }"
] | [
"0.7960581",
"0.768245",
"0.768245",
"0.768245",
"0.768245",
"0.76421607",
"0.76346356",
"0.7600924",
"0.7567198",
"0.7517056",
"0.7517056",
"0.7517056",
"0.7517056",
"0.7517056",
"0.7517056",
"0.7517056",
"0.7517056",
"0.7517056",
"0.7517056",
"0.7517056",
"0.7467916",
"0.7467916",
"0.7467916",
"0.740462",
"0.7329304",
"0.7329304",
"0.7329304",
"0.7329304",
"0.7289929",
"0.7248869",
"0.7248869",
"0.72331405",
"0.71925014",
"0.7159789",
"0.71575046",
"0.71575046",
"0.71575046",
"0.71575046",
"0.7119577",
"0.7119577",
"0.7114669",
"0.7067533",
"0.7030539",
"0.7020952",
"0.70173407",
"0.70090437",
"0.70014733",
"0.6980414",
"0.69784033",
"0.69713974",
"0.69713026",
"0.6968327",
"0.6936476",
"0.69175565",
"0.69078547",
"0.69007105",
"0.6882353",
"0.68775684",
"0.68679404",
"0.68606067",
"0.68478507",
"0.6845754",
"0.6839137",
"0.68388784",
"0.6838479",
"0.6822748",
"0.6815346",
"0.6807095",
"0.6805185",
"0.68018854",
"0.6795341",
"0.6792156",
"0.67892164",
"0.6786477",
"0.67855775",
"0.67709196",
"0.6770047",
"0.6769916",
"0.6769916",
"0.67692417",
"0.67665136",
"0.6761771",
"0.6758062",
"0.67546195",
"0.67534035",
"0.6752197",
"0.6749484"
] | 0.70649767 | 55 |
Code here will be triggered once the drawer opens, we don't need anything to happen yet, hence leave it blank | @Override
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\t\t\tpublic void onDrawerOpened() {\n\t\t\t\tshowDown();\n\t\t\t}",
"@Override\n public void onDrawerStateChanged(int newState) {\n }",
"@Override\n public void onDrawerStateChanged(int newState) {\n }",
"@Override\n public void onDrawerStateChanged(int newState) {\n }",
"@Override\n public void onDrawerStateChanged(int newState) {\n }",
"@Override\n public void onDrawerOpened(View drawerView) {\n }",
"@Override\n public void onDrawerStateChanged(int newState) {\n }",
"@Override\n public void onDrawerOpened(View drawerView) {\n }",
"@Override\n public void onDrawerOpened(View drawerView) {\n Log.d(\"Apps Main\", \"Open drawer \");\n }",
"@Override\n public void onDrawerOpened(View drawerView) {\n\n super.onDrawerOpened(drawerView);\n }",
"@Override\n public void onDrawerOpened(View drawerView) {\n\n super.onDrawerOpened(drawerView);\n }",
"@Override\n public void onDrawerOpened(View drawerView) {\n\n super.onDrawerOpened(drawerView);\n }",
"@Override\n\t\t\tpublic void onDrawerClosed() {\n\t\t\t\tshowUp();\n\t\t\t}",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n handleEvent_onDrawerOpened(drawerView);\n }",
"@Override\n public void onDrawerClosed(View drawerView) {\n }",
"@Override\n public void onDrawerClosed(View drawerView) {\n }",
"public void onDrawerOpened(View drawerView) {\n\n }",
"@Override\n public void onDrawerClosed(View drawerView) {\n }",
"private void MenuHOOKS() {\n drawerLayout = findViewById(R.id.drawer_layout);\n navigationView = findViewById(R.id.navigation_view);\n burger_icon = findViewById(R.id.burger_icon);\n contentView = findViewById(R.id.content);\n\n //Navigation Drawer\n navigationView.bringToFront();\n navigationView.setNavigationItemSelectedListener(this);\n navigationView.setCheckedItem(R.id.nav_home);\n\n burger_icon.setOnClickListener(this);\n\n //Animation Function\n animateNavigationDrawer();\n\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n //getActionBar().setTitle(mDrawerTitle);\n //invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n //getActionBar().setTitle(mDrawerTitle);\n //invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }",
"private void setupDrawerContent() {\n previousMenuItem = navigationView.getMenu().findItem(R.id.nav_category);\n previousMenuItem.setChecked(true);\n previousMenuItem.setCheckable(true);\n\n navigationView.setNavigationItemSelectedListener(\n new NavigationView.OnNavigationItemSelectedListener() {\n @Override\n public boolean onNavigationItemSelected(MenuItem menuItem) {\n\n drawerLayout.closeDrawer(Gravity.LEFT);\n\n if (previousMenuItem.getItemId() == menuItem.getItemId())\n return true;\n\n menuItem.setCheckable(true);\n menuItem.setChecked(true);\n previousMenuItem.setChecked(false);\n previousMenuItem = menuItem;\n\n switch (menuItem.getItemId()) {\n case R.id.nav_category:\n displayView(CATEGORIES_FRAG, null);\n break;\n case R.id.nav_favorites:\n displayView(FAVORITE_FRAG, null);\n break;\n case R.id.nav_reminder:\n displayView(REMINDER_FRAG, null);\n break;\n case R.id.nav_about:\n displayView(ABOUT_FRAG, null);\n break;\n case R.id.nav_feedback:\n IntentHelper.sendEmail(BaseDrawerActivity.this);\n break;\n case R.id.nav_rate_us:\n IntentHelper.voteForAppInBazaar(BaseDrawerActivity.this);\n break;\n case R.id.nav_settings:\n displayView(SETTINGS_FRAG, null);\n break;\n\n }\n\n\n return true;\n }\n }\n\n );\n }",
"public void onDrawerClosed(View view) {\n }",
"@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }",
"@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }",
"@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }",
"@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }",
"@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }",
"@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }",
"@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }",
"@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }",
"@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }",
"@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }",
"@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }",
"@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }",
"@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }",
"@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }",
"public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n\n\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n getSupportActionBar().setTitle(\"Navigation!\");\n //invalidateOptionsMenu();\n //creates call to onPrepareOptionsMenu()\n }",
"public void onDrawerOpened(View drawerView) {\n\t\t\t\t\t invalidateOptionsMenu(); \n\t\t\t\t\t }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n getActionBar().setTitle(R.string.drawer_open);\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }",
"void displayDrawer() {\n //toolbar = (Toolbar) findViewById(R.id.toolbar);\n setSupportActionBar(toolbar);\n actionbar = getSupportActionBar();\n actionbar.setDisplayHomeAsUpEnabled(true);\n\n actionbar.setHomeAsUpIndicator(R.drawable.ic_menu);\n\n navigationView.setNavigationItemSelectedListener(\n new NavigationView.OnNavigationItemSelectedListener() {\n @Override\n public boolean onNavigationItemSelected(MenuItem menuItem) {\n // set item as selected to persist highlight\n menuItem.setChecked(true);\n // close drawer when item is tapped\n mdrawer.closeDrawers();\n\n String choice = menuItem.getTitle().toString();\n\n switch (choice) {\n case \"Register\":\n Intent i = new Intent(getBaseContext(), SignIn.class);\n startActivity(i);\n break;\n case \"Log In\":\n Intent p = new Intent(getBaseContext(), LoginActivity.class);\n startActivity(p);\n break;\n\n case \"Profile Picture\":\n Intent pic = new Intent(getBaseContext(), ImageUpload.class);\n startActivity(pic);\n break;\n\n case \"Users\":\n Intent users = new Intent(getBaseContext(), Userlist.class);\n startActivity(users);\n break;\n\n case \"Chats\":\n Intent chats = new Intent(getBaseContext(), ChatList.class);\n startActivity(chats);\n break;\n }\n\n // Add code here to update the UI based on the item selected\n // For example, swap UI fragments here\n\n return true;\n }\n });\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n // getSupportActionBar().setTitle(mDrawerTitle);\n //invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }",
"@Override\n\t\t\tpublic void onDrawerOpened() {\n\t\t\t\tbottomLayout.setVisibility(View.INVISIBLE);\n\t\t\t}",
"public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n // Do whatever you want here\n }",
"public void doDrawerStuff() {\n Toolbar myToolbar = (Toolbar) findViewById(R.id.my_toolbar);\n setSupportActionBar(myToolbar);\n\n mPlanetTitles = getResources().getStringArray(R.array.planets_array);\n mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);\n\n\n mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout,myToolbar, R.string.drawer_open, R.string.drawer_close) {\n\n /** Called when a drawer has settled in a completely closed state. */\n public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n // getSupportActionBar().setTitle(mTitle);\n\n //invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }\n\n /** Called when a drawer has settled in a completely open state. */\n public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n // getSupportActionBar().setTitle(mDrawerTitle);\n //invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }\n };\n\n // Set the drawer toggle as the DrawerListener\n mDrawerLayout.setDrawerListener(mDrawerToggle);\n\n getSupportActionBar().setDisplayHomeAsUpEnabled(true);\n getSupportActionBar().setHomeButtonEnabled(true);\n\n\n\n mDrawerList = (ListView) findViewById(R.id.left_drawer);\n\n // Set the adapter for the list view\n mDrawerList.setAdapter(new ArrayAdapter<String>(this,\n R.layout.drawer_list_item, mPlanetTitles));\n // Set the list's click listener\n mDrawerList.setOnItemClickListener(new DrawerItemClickListener());\n\n\n\n\n\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n invalidateOptionsMenu();\n }",
"public void onDrawerClosed(View view) {\n\t\t\t\t\t invalidateOptionsMenu(); \n\t\t\t\t\t }",
"private void setUpNavigationDrawer() {\n navigationView.setNavigationItemSelectedListener(item -> {\n Fragment nextFragment = findNextFragment(item.getItemId());\n\n if (nextFragment instanceof WalkFragment && areLocationServicesDisabled()) {\n MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(this);\n builder.setTitle(R.string.location_services_not_enabled_title);\n builder.setMessage(R.string.location_services_not_enabled_message);\n builder.setPositiveButton(R.string.ok, null);\n\n builder.show();\n } else {\n changeFragment(nextFragment);\n\n item.setChecked(true);\n drawerLayout.closeDrawers();\n setUpNewFragment(item.getTitle(), item.getItemId());\n }\n\n return true;\n });\n }",
"@Override\n public void run() {\n drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);\n\n // Hides the toolbar\n ViewGroup.LayoutParams layoutParams = toolbar.getLayoutParams();\n layoutParams.height = 0;\n toolbar.setLayoutParams(layoutParams);\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n// getActionBar().setTitle(\"Select Destination\");\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n getSupportActionBar().setTitle(\"Timesheet\");\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n\n\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"public void onDrawerOpened(View drawerView) {\n supportInvalidateOptionsMenu();\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n //getSupportActionBar().setTitle(\"Navigation Drawer\");\n invalidateOptionsMenu();\n }",
"@Override\n public void onDrawerClosed(View drawerView) {\n invalidateOptionsMenu();\n Log.d(\"Apps Main\", \"Close drawer \");\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n getSupportActionBar().setTitle(\"Navigation!\");\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }",
"private void setupDrawer(){\n NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);\n assert navigationView != null;\n navigationView.setNavigationItemSelectedListener(this);\n View hView = navigationView.getHeaderView(0);\n\n this.nameInput = (TextView) hView.findViewById(R.id.nav_user_name);\n this.emailInput = (TextView) hView.findViewById(R.id.nav_user_email);\n\n this.userImage = (NetworkImageView) hView.findViewById(R.id.nav_user_image);\n\n assert drawer != null;\n drawer.addDrawerListener(new DrawerLayout.SimpleDrawerListener() {\n @Override\n public void onDrawerOpened(View drawerView) {\n mSearchView.setLeftMenuOpen(false);\n }\n });\n\n View switchView = navigationView.getMenu().findItem(R.id.nav_service).getActionView();\n SwitchCompat mSwitch = (SwitchCompat) switchView.findViewById(R.id.service_switcher);\n\n mSwitch.setChecked(leaveServiceOnAfterDestroy);\n mSwitch.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n SwitchCompat mSwitch = (SwitchCompat) v;\n if(mSwitch.isChecked()){\n //turn service on after destroy without question\n serviceSwitcher(true);\n }else{\n //if user want to turn service off then show dialog\n serviceSettingsDialog(v);\n }\n }\n });\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n getSupportActionBar().setTitle(mDrawerTitle);\n //updateView(5, 99, true);\n }",
"public void onDrawerOpened(View drawerView) {\r\n super.onDrawerOpened(drawerView);\r\n if(!mUserLearnedDrawer){\r\n\r\n mUserLearnedDrawer=true;\r\n Utility utility=new Utility();\r\n utility.writeToSharedPref(getApplicationContext(),KEY_USER_LEARNED_DRAWER,mUserLearnedDrawer+\"\");\r\n }\r\n invalidateOptionsMenu();\r\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n\n\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n displaySelectedScreen(id);\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n DrawerLayout drawer = findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n\n DrawerLayout drawer = findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n getSupportActionBar().setTitle(\"Navigation\");\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }",
"@Override\n\t\t\tpublic void onDrawerClosed() {\n\t\t\t\tlayoutParams = new FrameLayout.LayoutParams(\n\t\t\t\t\t\tLayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);\n\t\t\t\tslidingDrawer.setLayoutParams(layoutParams);\n\t\t\t\tbottomLayout.setVisibility(View.VISIBLE);\n\t\t\t}",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n// getActionBar().setTitle(\"WXTJ Student Radio\");\n }",
"public void onDrawerOpened(View drawerView) {\n getActionBar().setTitle(\"Opened Drawer\");\n }",
"protected void onCreateDrawer() {\n toolbar = (Toolbar) findViewById(R.id.tool_bar);\n setSupportActionBar(toolbar);\n\n //Initializing NavigationView\n navigationView = (NavigationView) findViewById(R.id.navigation_view);\n\n navigationView.setNavigationItemSelectedListener(new NavigationViewItemListener());\n\n // Initializing Drawer Layout and ActionBarToggle\n drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);\n actionBarDrawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, R.string.open_drawer, R.string.close_drawer){\n\n @Override\n public void onDrawerClosed(View drawerView) {\n // Code here will be triggered once the drawer closes as we don't want anything to happen so we leave this blank\n super.onDrawerClosed(drawerView);\n }\n\n @Override\n public void onDrawerOpened(View drawerView) {\n // Code here will be triggered once the drawer open as we don't want anything to happen so we leave this blank\n super.onDrawerOpened(drawerView);\n }\n };\n\n //Setting the actionbarToggle to drawer layout\n drawerLayout.addDrawerListener(actionBarDrawerToggle);\n\n //calling sync state is necessary or else your hamburger icon wont show up\n actionBarDrawerToggle.syncState();\n\n UpdateHeader(this, navigationView);\n\n if (YummySession.selectedItemPosition != -1) {\n navigationView.getMenu().getItem(YummySession.selectedItemPosition).setChecked(true);\n }\n\n }",
"@Override\n\tpublic void onSidebarOpened() {\n\t\tLog.d(TAG, \"opened\");\n\n\t}",
"public void onDrawerClosed(View drawerView) {\n\n }",
"public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n //getActionBar().setTitle(mTitle);\n //invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }",
"public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n //getActionBar().setTitle(mTitle);\n //invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }",
"public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n\n }",
"@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tmCallbacks.openDrawerExhi();\r\n\t\t\t}",
"public void onDrawerOpened(View drawerView) {\n\t\t\t\tsuper.onDrawerOpened(drawerView);\n\t\t\t\tgetSupportActionBar().setTitle(\"Munchies\");\n\t\t\t\tinvalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n\t\t\t}",
"public void onDrawerOpened(View drawerView) {\n\t\t\t\tLog.d(TAG, \"nav drawer opened state\");\n\t\t\t\tgetActionBar().setTitle(drawerTitle);\n\t\t\t\tinvalidateOptionsMenu();// goes to onPrepareOptionsMenu()\n\t\t\t}",
"public void onDrawerOpened(View drawerView) {\n if (Build.VERSION.SDK_INT >= 11) {\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n } else {\n //Call it directly on gingerbread.\n onPrepareOptionsMenu(mMenu);\n }\n }",
"public void onDrawerClosed(View view) {\n getActionBar().setTitle(\"Closed Drawer\");\n }",
"@Override\n public void onDrawerSlide(View drawerView, float slideOffset) {\n }",
"@Override\n public void onDrawerSlide(View drawerView, float slideOffset) {\n }"
] | [
"0.7960581",
"0.768245",
"0.768245",
"0.768245",
"0.768245",
"0.76421607",
"0.76346356",
"0.7600924",
"0.7567198",
"0.7467916",
"0.7467916",
"0.7467916",
"0.740462",
"0.7329304",
"0.7329304",
"0.7329304",
"0.7329304",
"0.7289929",
"0.7248869",
"0.7248869",
"0.72331405",
"0.71925014",
"0.7159789",
"0.71575046",
"0.71575046",
"0.71575046",
"0.71575046",
"0.7119577",
"0.7119577",
"0.7114669",
"0.7067533",
"0.70649767",
"0.70649767",
"0.70649767",
"0.70649767",
"0.70649767",
"0.70649767",
"0.70649767",
"0.70649767",
"0.70649767",
"0.70649767",
"0.70649767",
"0.70649767",
"0.70649767",
"0.70649767",
"0.7030539",
"0.7020952",
"0.70173407",
"0.70090437",
"0.70014733",
"0.6980414",
"0.69784033",
"0.69713974",
"0.69713026",
"0.6968327",
"0.6936476",
"0.69175565",
"0.69078547",
"0.69007105",
"0.6882353",
"0.68775684",
"0.68679404",
"0.68606067",
"0.68478507",
"0.6845754",
"0.6839137",
"0.68388784",
"0.6838479",
"0.6822748",
"0.6815346",
"0.6807095",
"0.6805185",
"0.68018854",
"0.6795341",
"0.6792156",
"0.67892164",
"0.6786477",
"0.67855775",
"0.67709196",
"0.6770047",
"0.6769916",
"0.6769916",
"0.67692417",
"0.67665136",
"0.6761771",
"0.6758062",
"0.67546195",
"0.67534035",
"0.6752197",
"0.6749484"
] | 0.7517056 | 19 |
/ Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml. | @Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
drawerLayout.openDrawer(GravityCompat.START);
return true;
case R.id.action_qr_code:
showQrDialog();
return true;
}
return super.onOptionsItemSelected(item);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n //\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // Back button clicked\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // app icon in action bar clicked; goto parent activity.\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n switch (id) {\r\n case android.R.id.home:\r\n // app icon in action bar clicked; go home\r\n this.finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // app icon in action bar clicked; go home\n finish();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n Log.e(\"clik\", \"action bar clicked\");\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n\t public boolean onOptionsItemSelected(MenuItem item) {\n\t int id = item.getItemId();\n\t \n\t\t\tif (id == android.R.id.home) {\n\t\t\t\t// Respond to the action bar's Up/Home button\n\t\t\t\t// NavUtils.navigateUpFromSameTask(this);\n\t\t\t\tonBackPressed();\n\t\t\t\treturn true;\n\t\t\t}\n\t \n\t \n\t return super.onOptionsItemSelected(item);\n\t }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n // Respond to the action bar's Up/Home button\r\n case android.R.id.home:\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // Intent homeIntent = new Intent(this, MainActivity.class);\n // homeIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // startActivity(homeIntent);\n finish();\n return true;\n default:\n return (super.onOptionsItemSelected(item));\n }\n\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if(id == android.R.id.home){\n onBackPressed();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n\r\n case android.R.id.home:\r\n /*Intent i= new Intent(getApplication(), MainActivity.class);\r\n i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n startActivity(i);*/\r\n onBackPressed();\r\n finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId ()) {\n case android.R.id.home:\n onBackPressed ();\n return true;\n\n default:\n break;\n }\n return super.onOptionsItemSelected ( item );\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n onBackPressed();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n int id = item.getItemId();\n\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // This ID represents the Home or Up button. In the case of this\n // activity, the Up button is shown. Use NavUtils to allow users\n // to navigate up one level in the application structure. For\n // more details, see the Navigation pattern on Android Design:\n //\n // http://developer.android.com/design/patterns/navigation.html#up-vs-back\n //\n \tgetActionBar().setDisplayHomeAsUpEnabled(false);\n \tgetFragmentManager().popBackStack();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId())\n {\n case android.R.id.home :\n super.onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onActionHomePressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if(item.getItemId()==android.R.id.home){\n super.onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle presses on the action bar items\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n case R.id.action_clear:\n return true;\n case R.id.action_done:\n\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // android.R.id.home是Android内置home按钮的id\n finish();\n break;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n\n }\n\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // setResult and close the activity when Action Bar Up Button clicked.\n if (item.getItemId() == android.R.id.home) {\n setResult(RESULT_CANCELED);\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n//noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n// finish the activity\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t switch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\t// app icon in action bar clicked; go home \n\t\t\tIntent intent = new Intent(this, Kelutral.class); \n\t\t\tintent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); \n\t\t\tstartActivity(intent); \n\t\t\treturn true;\t\t\n\t case R.id.Search:\n\t \treturn onSearchRequested();\n\t\tcase R.id.AppInfo:\n\t\t\t// Place holder menu item\n\t\t\tIntent newIntent = new Intent(Intent.ACTION_VIEW,\n\t\t\t\t\tUri.parse(\"http://forum.learnnavi.org/mobile-apps/\"));\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\n\t\tcase R.id.Preferences:\n\t\t\tnewIntent = new Intent(getBaseContext(), Preferences.class);\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\t\n\t }\n\t return false;\n\t}",
"@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif(item.getItemId()==android.R.id.home)\r\n\t\t{\r\n\t\t\tgetActivity().onBackPressed();\r\n\t\t}\r\n\t\treturn super.onOptionsItemSelected(item);\r\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n return false;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if ( id == android.R.id.home ) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n\r\n int id = item.getItemId();\r\n if(id==android.R.id.home){\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case android.R.id.home:\n this.finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@RequiresApi(api = Build.VERSION_CODES.M)\n @Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if(id == android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n //Back arrow\n case android.R.id.home:\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()){\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return true;\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if (id == android.R.id.home) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n //Fixes the Up Button\n if(id == android.R.id.home) {\n BuildRoute.this.finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n this.onBackPressed();\n return false;\n }\n return false;\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n break;\r\n }\r\n return true;\r\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif (item.getItemId() == android.R.id.home) {\n\t\t\tfinish();\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}",
"@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\r\n\t switch (item.getItemId()) {\r\n\t \t// back to previous page\r\n\t case android.R.id.home:\r\n\t finish();\r\n\t return true;\r\n\t }\r\n\t return super.onOptionsItemSelected(item);\r\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if(id==android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tint id = item.getItemId();\n\t\tif (id == android.R.id.home) {\n\t\t\tfinish();\n\t\t\treturn true;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if (id == android.R.id.home) {\n NavUtils.navigateUpFromSameTask(this);\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item)\n {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if( id == android.R.id.home ) // Back button of the actionbar\n {\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n\n case android.R.id.home:\n this.finish();\n return true;\n }\n return true;\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n return true;\n }\n return false;\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n if (item.getItemId() == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n NavUtils.navigateUpFromSameTask(getActivity());\n return true;\n case R.id.action_settings:\n Intent i = new Intent(getActivity(), SettingsActivity.class);\n startActivity(i);\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n onBackPressed();\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }",
"@Override\r\n\t\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\t\tswitch (item.getItemId()) {\r\n\t\t\tcase android.R.id.home:\r\n\t\t\t\tfinish();\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\treturn super.onOptionsItemSelected(item);\r\n\t\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n finish();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.home) {\r\n NavUtils.navigateUpFromSameTask(this);\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_about) {\r\n AboutDialog();\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_exit) {\r\n finish();\r\n return true;\r\n }\r\n\r\n\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\r\n\t\tcase android.R.id.home:\r\n\t\t\tsetResult(RESULT_OK, getIntent());\r\n\t\t\tfinish();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n\r\n if(id == android.R.id.home) {\r\n this.finish();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n super.onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // todo: goto back activity from here\n finish();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n\n case android.R.id.home:\n Intent i = new Intent(Activity_MarkerGoogleMaps.this, Activity_Dashboard.class);\n startActivity(i);\n finish();\n\n break;\n\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n //NavUtils.navigateUpFromSameTask(this);\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item)\n {\n if(item.getItemId() == android.R.id.home)\n {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId())\n {\n case android.R.id.home:\n this.finish();\n return (true);\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n // Handle item selection\r\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n return true;\r\n\r\n case me.cchiang.lookforthings.R.id.action_sample:\r\n// Snackbar.make(parent_view, item.getTitle() + \" Clicked \", Snackbar.LENGTH_SHORT).show();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tcase R.id.scan_menu:\n\t\t\tonScan();\n\t\t\tbreak;\n\t\tcase R.id.opt_about:\n\t\t\t//onAbout();\n\t\t\tbreak;\n\t\tcase R.id.opt_exit:\n\t\t\tfinish();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t\treturn true;\n\t}",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }"
] | [
"0.80291903",
"0.7851101",
"0.7825998",
"0.7809197",
"0.77423245",
"0.7730639",
"0.7656539",
"0.76486015",
"0.7575833",
"0.7523627",
"0.74841017",
"0.7479448",
"0.7477789",
"0.7473363",
"0.74726325",
"0.74652255",
"0.746521",
"0.74541456",
"0.745017",
"0.74453014",
"0.74453014",
"0.74408484",
"0.7437712",
"0.74376094",
"0.7437584",
"0.74254596",
"0.7418346",
"0.7412836",
"0.7403578",
"0.7399499",
"0.73806065",
"0.73786575",
"0.73786575",
"0.7376785",
"0.73666775",
"0.73611236",
"0.73588437",
"0.7356498",
"0.7355071",
"0.73519766",
"0.7342476",
"0.73387814",
"0.7335802",
"0.73331845",
"0.73254883",
"0.73185456",
"0.73145616",
"0.73145616",
"0.73145616",
"0.7303895",
"0.7296219",
"0.7295751",
"0.72923714",
"0.72817934",
"0.72817934",
"0.72796947",
"0.7267968",
"0.72674525",
"0.7263352",
"0.7261501",
"0.72601205",
"0.7259786",
"0.7259786",
"0.7254103",
"0.7249544",
"0.7249213",
"0.7242293",
"0.7240949",
"0.72404104",
"0.72262686",
"0.72262686",
"0.72243524",
"0.722393",
"0.72221845",
"0.72205687",
"0.7201952",
"0.7197063",
"0.7197031",
"0.7194205",
"0.7184679",
"0.7181371",
"0.717574",
"0.71756744",
"0.71756744",
"0.71756744",
"0.71756744",
"0.717419",
"0.71700823",
"0.7166585",
"0.7148786",
"0.7147062",
"0.7144966",
"0.714374",
"0.7133072",
"0.71281123",
"0.7123671",
"0.7112994",
"0.7112994",
"0.7106648",
"0.71039563",
"0.7097481"
] | 0.0 | -1 |
/ PAYMENTS INTEGRATION ENDS HERE | @Override
public void onRequestPermissionsResult(int requestCode, @NonNull String permissions[],
@NonNull int[] grantResults) {
switch (requestCode) {
case FINE_LOCATION_PERMISSION_REQUEST: {
// If request is cancelled, the result arrays are empty.
if ((grantResults.length > 0) &&
(grantResults[0] == PackageManager.PERMISSION_GRANTED)) {
Log.d(TAG, "discovery supported (BLE and BL will be supported)");
} else {
Log.d(TAG, "discovery unsupported (BLE and BL will not be supported)");
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void autoPay() {}",
"public void calculatePayment() {}",
"CarPaymentMethod processPayPal();",
"private void launchPayUMoneyFlow(String name, String number, String description, String amt) {\n\n PayUmoneyConfig payUmoneyConfig = PayUmoneyConfig.getInstance();\n\n //Use this to set your custom text on result screen button\n payUmoneyConfig.setDoneButtonText(\"Done\");\n\n //Use this to set your custom title for the activity\n payUmoneyConfig.setPayUmoneyActivityTitle(\"DeliveryHUB PAYMENTS\");\n\n payUmoneyConfig.disableExitConfirmation(isDisableExitConfirmation);\n\n PayUmoneySdkInitializer.PaymentParam.Builder builder = new PayUmoneySdkInitializer.PaymentParam.Builder();\n\n double amount = 0;\n try {\n amount = Double.parseDouble(amt);\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n String txnId = \"SH\" + System.currentTimeMillis();\n //String txnId = \"TXNID720431525261327973\";\n String phone = number;\n String productName = description;\n String firstName = name;\n String email = \"nasuruddinshaik@gmail.com\";\n String udf1 = \"\";\n String udf2 = \"\";\n String udf3 = \"\";\n String udf4 = \"\";\n String udf5 = \"\";\n String udf6 = \"\";\n String udf7 = \"\";\n String udf8 = \"\";\n String udf9 = \"\";\n String udf10 = \"\";\n\n AppEnvironment appEnvironment = ((BaseApplication) getActivity().getApplication()).getAppEnvironment();\n builder.setAmount(String.valueOf(amount))\n .setTxnId(txnId)\n .setPhone(phone)\n .setProductName(productName)\n .setFirstName(firstName)\n .setEmail(email)\n .setsUrl(appEnvironment.surl())\n .setfUrl(appEnvironment.furl())\n .setUdf1(udf1)\n .setUdf2(udf2)\n .setUdf3(udf3)\n .setUdf4(udf4)\n .setUdf5(udf5)\n .setUdf6(udf6)\n .setUdf7(udf7)\n .setUdf8(udf8)\n .setUdf9(udf9)\n .setUdf10(udf10)\n .setIsDebug(appEnvironment.debug())\n .setKey(appEnvironment.merchant_Key())\n .setMerchantId(appEnvironment.merchant_ID());\n\n try {\n mPaymentParams = builder.build();\n\n /*\n * Hash should always be generated from your server side.\n * */\n // generateHashFromServer(mPaymentParams);\n\n /* *//**\n * Do not use below code when going live\n * Below code is provided to generate hash from sdk.\n * It is recommended to generate hash from server side only.\n * */\n mPaymentParams = calculateServerSideHashAndInitiatePayment1(mPaymentParams);\n\n\n PayUmoneyFlowManager.startPayUMoneyFlow(mPaymentParams, getActivity(), R.style.AppTheme_pink, true);\n\n\n } catch (Exception e) {\n // some exception occurred\n Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_LONG).show();\n // payNowButton.setEnabled(true);\n }\n }",
"@Override\n public void execute(ProcessBundle bundle) throws Exception {\n HttpServletRequest request = RequestContext.get().getRequest();\n VariablesSecureApp vars = new VariablesSecureApp(request);\n\n try {\n OBContext.setAdminMode();\n // Variable declaration\n // Variable declaration\n String proposalId = null;\n String proposalattrId = null;\n if (bundle.getParams().get(\"Escm_Proposalmgmt_ID\") != null) {\n proposalId = bundle.getParams().get(\"Escm_Proposalmgmt_ID\").toString();\n }\n if (bundle.getParams().get(\"Escm_Proposal_Attr_ID\") != null) {\n proposalattrId = bundle.getParams().get(\"Escm_Proposal_Attr_ID\").toString();\n EscmProposalAttribute proposalAttr = OBDal.getInstance().get(EscmProposalAttribute.class,\n proposalattrId);\n proposalId = proposalAttr.getEscmProposalmgmt().getId();\n }\n EscmProposalMgmt proposalmgmt = OBDal.getInstance().get(EscmProposalMgmt.class, proposalId);\n final String clientId = bundle.getContext().getClient();\n final String orgId = proposalmgmt.getOrganization().getId();\n final String userId = bundle.getContext().getUser();\n User user = OBDal.getInstance().get(User.class, userId);\n String purchaseOrderType = \"PUR\";\n List<EscmPurchaseOrderConfiguration> config = new ArrayList<EscmPurchaseOrderConfiguration>();\n List<Location> bploclist = new ArrayList<Location>();\n List<Warehouse> warehouselist = new ArrayList<Warehouse>();\n List<PriceList> priceListlist = new ArrayList<PriceList>();\n List<PaymentTerm> paymentTermList = new ArrayList<PaymentTerm>();\n Location bplocation = null;\n String yearId = null, transdoctypeId = null;\n SimpleDateFormat d1 = new SimpleDateFormat(\"dd-MM-yyyy\");\n Warehouse warehouse = null;\n PriceList priceList = null;\n PaymentTerm paymentTerm = null;\n String startingDate = \"\", budgetReferenceId = null;\n\n String motContactPerson = \"\";\n String motContactPosition = \"\";\n String description = null;\n String alertWindow = sa.elm.ob.scm.util.AlertWindow.contractUser;\n String windowId = \"2ADDCB0DD2BF4F6DB13B21BBCCC3038C\";\n NextRoleByRuleVO nextApproval = null;\n\n ProposalManagementProcessDAO proposalDAO = new ProposalManagementProcessDAOImpl();\n // get the connection\n Connection conn = OBDal.getInstance().getConnection();\n\n boolean isMinProposalApproved = false;\n if (proposalmgmt.getProposalstatus().equals(\"PAWD\")) {\n isMinProposalApproved = proposalDAO.isMinProposalApproved(proposalmgmt);\n }\n\n if ((proposalmgmt.getProposalappstatus().equals(\"APP\")\n && proposalmgmt.getProposalstatus().equals(\"AWD\"))\n || (proposalmgmt.getProposalstatus().equals(\"PAWD\")\n && (isMinProposalApproved || proposalmgmt.getProposalappstatus().equals(\"APP\")))) {\n\n // based on configuration minvalue , getting purchase order type is purchase order /contract\n if (proposalmgmt.getProposalstatus().equals(\"PAWD\")) {\n config = proposalDAO.getPOTypeBasedOnValue(orgId, proposalmgmt.getAwardamount());\n } else {\n config = proposalDAO.getPOTypeBasedOnValue(orgId, proposalmgmt.getTotalamount());\n }\n\n if (config.size() > 0) {\n purchaseOrderType = config.get(0).getOrdertype();\n\n // Setting mot contact person and position\n\n EscmPurchaseOrderConfiguration configuration = config.get(0);\n motContactPosition = configuration.getMOTContactPosition();\n motContactPerson = configuration.getMOTContactPerson() != null\n ? configuration.getMOTContactPerson().getName()\n : null;\n\n } else {\n\n // Setting mot contact person and position\n\n EscmPurchaseOrderConfiguration configuration = PurchaseAgreementCalloutDAO\n .checkDocTypeConfig(OBContext.getOBContext().getCurrentClient().getId(),\n proposalmgmt.getOrganization().getId(), purchaseOrderType);\n\n motContactPosition = configuration.getMOTContactPosition();\n motContactPerson = configuration.getMOTContactPerson() != null\n ? configuration.getMOTContactPerson().getName()\n : null;\n\n }\n\n // Throw error if contract category is inactive\n if (proposalmgmt != null && proposalmgmt.getContractType() != null\n && !proposalmgmt.getContractType().isActive()) {\n OBError result = OBErrorBuilder.buildMessage(null, \"error\",\n \"@Escm_ContractCategoryInactive@\");\n bundle.setResult(result);\n return;\n }\n\n startingDate = proposalDAO.getPeriodStartDate(clientId);\n budgetReferenceId = proposalDAO.getBudgetFromPeriod(clientId, startingDate);\n if (\"\".equals(budgetReferenceId)) {\n OBError result = OBErrorBuilder.buildMessage(null, \"error\",\n \"@Efin_Budget_Init_Mandatory@\");\n bundle.setResult(result);\n return;\n }\n if (budgetReferenceId != null) {\n if (!proposalmgmt.getEfinBudgetinitial().getId().equals(budgetReferenceId)) {\n // OBError result = OBErrorBuilder.buildMessage(null, \"error\", \"@Escm_YearClosed_Err@\");\n // bundle.setResult(result);\n // return;\n }\n }\n\n // fetching finacial year\n yearId = proposalDAO.getFinancialYear(clientId);\n if (\"\".equals(yearId)) {\n OBError result = OBErrorBuilder.buildMessage(null, \"error\",\n \"@ESCM_FinancialYear_NotDefine@\");\n bundle.setResult(result);\n return;\n }\n\n // fetching warehouse\n warehouselist = proposalDAO.getWarehouse(proposalmgmt.getClient().getId());\n if (warehouselist.size() > 0) {\n warehouse = warehouselist.get(0);\n } else {\n OBError result = OBErrorBuilder.buildMessage(null, \"error\", \"@ESCM_Warehouse_NotDefine@\");\n bundle.setResult(result);\n return;\n }\n\n // fetching bplocation\n bploclist = proposalDAO.getLocation(proposalmgmt.getSupplier().getId());\n if (bploclist.size() > 0)\n bplocation = bploclist.get(0);\n else {\n String message = OBMessageUtils.messageBD(\"ESCM_SuppLoc_NotDefine\");\n message = message.replace(\"%\", proposalmgmt.getSupplier().getName());\n OBError result = OBErrorBuilder.buildMessage(null, \"error\", message);\n bundle.setResult(result);\n return;\n }\n\n // fetching pricelist\n priceListlist = proposalDAO.getPriceList(proposalmgmt.getClient().getId());\n if (priceListlist.size() > 0)\n priceList = priceListlist.get(0);\n else {\n OBError result = OBErrorBuilder.buildMessage(null, \"error\", \"@ESCM_PriceList_NotDefine@\");\n bundle.setResult(result);\n return;\n }\n\n // fetching payment term\n paymentTermList = proposalDAO.getPaymentTerm(proposalmgmt.getClient().getId());\n if (paymentTermList.size() > 0)\n paymentTerm = paymentTermList.get(0);\n else {\n OBError result = OBErrorBuilder.buildMessage(null, \"error\",\n \"@ESCM_PaymentTerm_NotDefine@\");\n bundle.setResult(result);\n return;\n }\n if (user.getBusinessPartner() == null) {\n OBError result = OBErrorBuilder.buildMessage(null, \"error\",\n \"@ESCM_CrtPOfrmProsal_NotBP@\");\n bundle.setResult(result);\n return;\n }\n // default value brought for mot contact person/position so no need validation.\n /*\n * if (user.getBusinessPartner() != null && user.getBusinessPartner().getEhcmPosition() ==\n * null) { OBError result = OBErrorBuilder.buildMessage(null, \"error\",\n * \"@ESCM_LoggUser_PosNotDef@\"); bundle.setResult(result); return; }\n */\n\n // fetching document type\n Object transdoctype = proposalDAO.getTransactionDoc(orgId, clientId);\n if (transdoctype != null) {\n transdoctypeId = (String) transdoctype;\n } else {\n OBError result = OBErrorBuilder.buildMessage(null, \"error\", \"@ESCM_PODocType_NotDefine@\");\n bundle.setResult(result);\n return;\n }\n\n if (transdoctypeId != null && paymentTerm != null && priceList != null && warehouse != null\n && bplocation != null && yearId != null) {\n Order order = OBProvider.getInstance().get(Order.class);\n order.setClient(proposalmgmt.getClient());\n order.setOrganization(proposalmgmt.getOrganization());\n order.setCreatedBy(user);\n order.setUpdatedBy(user);\n order.setSalesTransaction(false);\n order.setDocumentType(OBDal.getInstance().get(DocumentType.class, \"0\"));\n order.setTransactionDocument(OBDal.getInstance().get(DocumentType.class, transdoctypeId));\n order.setDocumentNo(UtilityDAO.getSequenceNo(conn, clientId,\n order.getTransactionDocument().getDocumentSequence().getName(), true));\n order.setDocumentStatus(\"DR\");\n order.setDocumentAction(\"CO\");\n order.setAccountingDate(new java.util.Date());\n order.setOrderDate(new java.util.Date());\n order.setBusinessPartner(proposalmgmt.getSupplier());\n order.setEscmRevision(0L);\n order.setEscmAppstatus(\"DR\");\n order.setEscmFinanyear(OBDal.getInstance().get(Year.class, yearId));\n if (proposalmgmt.getEscmBidmgmt() != null\n && proposalmgmt.getEscmBidmgmt().getBidname() != null) {\n order.setEscmProjectname(proposalmgmt.getEscmBidmgmt().getBidname());\n } else {\n order.setEscmProjectname(proposalmgmt.getBidName());\n }\n // order.setEscmOnboarddateh(new java.util.Date());\n order.setEscmOrdertype(purchaseOrderType);\n // order.setEscmOnboarddategreg(d1.format(new Date()));\n order.setPartnerAddress(bplocation);\n order.setEscmContractduration(null);\n // order.setEscmPeriodtype(\"DT\");\n order.setWarehouse(warehouse);\n order.setPriceList(priceList);\n order.setPaymentTerms(paymentTerm);\n order.setInvoiceTerms(\"D\");\n order.setDeliveryTerms(\"A\");\n order.setFreightCostRule(\"I\");\n order.setFormOfPayment(\"B\");\n order.setDeliveryMethod(\"P\");\n order.setPriority(\"5\");\n order.setEscmAdRole(OBContext.getOBContext().getRole());\n order.setEscmAppstatus(\"DR\");\n order.setEscmAdvpaymntPercntge(BigDecimal.ZERO);\n Currency objCurrency = OBDal.getInstance().get(Currency.class, \"317\");\n order.setCurrency(proposalmgmt.getOrganization().getCurrency() == null ? objCurrency\n : proposalmgmt.getOrganization().getCurrency());\n\n if (proposalmgmt.getProposalstatus().equals(\"PAWD\")) {\n order.setGrandTotalAmount(proposalmgmt.getAwardamount());\n } else {\n order.setGrandTotalAmount(proposalmgmt.getTotalamount());\n }\n\n order.setDocumentStatus(\"DR\");\n order.setEscmDocaction(\"CO\");\n // order.setEscmContractstartdate(new java.util.Date());\n // order.setEscmContractenddate(new java.util.Date());\n order.setEscmBuyername(user);\n order.setEscmRatedategre(d1.format(new Date()));\n if (budgetReferenceId != null)\n order.setEfinBudgetint(\n OBDal.getInstance().get(EfinBudgetIntialization.class, budgetReferenceId));\n order.setEscmProposalmgmt(proposalmgmt);\n // order.setEscmMotcontperson(user.getBusinessPartner().getName());\n // order.setEscmMotcontposition(user.getBusinessPartner().getEhcmPosition());\n order.setEscmMotcontperson(motContactPerson);\n order.setEscmMotcontposition(motContactPosition);\n if (proposalmgmt.getSecondsupplier() != null)\n order.setEscmSecondsupplier(proposalmgmt.getSecondsupplier());\n if (proposalmgmt.getSecondBranchname() != null)\n order.setEscmSecondBranchname(proposalmgmt.getSecondBranchname());\n order.setEscmIssecondsupplier(proposalmgmt.isSecondsupplier());\n if (proposalmgmt.getIBAN() != null)\n order.setEscmSecondIban(proposalmgmt.getIBAN());\n if (proposalmgmt.getSubcontractors() != null)\n order.setEscmSubcontractors(proposalmgmt.getSubcontractors());\n if (proposalmgmt.isTaxLine()) {\n order.setEscmIstax(proposalmgmt.isTaxLine());\n\n }\n if (proposalmgmt.getEfinTaxMethod() != null) {\n order.setEscmTaxMethod(proposalmgmt.getEfinTaxMethod());\n }\n order.setEscmCalculateTaxlines(true);\n if (proposalmgmt.getContractType() != null) {\n order.setEscmContactType(proposalmgmt.getContractType());\n if (proposalmgmt.getContractType().getReceiveType().getSearchKey().equals(\"AMT\")) {\n order.setEscmReceivetype(\"AMT\");\n } else {\n order.setEscmReceivetype(\"QTY\");\n }\n } else {\n order.setEscmContactType(null);\n }\n OBQuery<EscmProposalsourceRef> sourceRef = OBDal.getInstance().createQuery(\n EscmProposalsourceRef.class,\n \"as e where e.escmProposalmgmtLine.id in (select ln.id from \"\n + \"Escm_Proposalmgmt_Line ln where ln.escmProposalmgmt.id=:propId)\");\n sourceRef.setNamedParameter(\"propId\", proposalmgmt.getId());\n List<EscmProposalsourceRef> propSrclist = sourceRef.list();\n if (propSrclist.size() > 0) {\n EscmProposalsourceRef propSrcRef = propSrclist.get(0);\n if (propSrcRef.getRequisition() != null) {\n order.setEscmMaintenanceProject(\n propSrcRef.getRequisition().getEscmMaintenanceProject());\n }\n if (propSrcRef.getRequisition() != null) {\n order.setEscmMaintenanceCntrctNo(\n propSrcRef.getRequisition().getESCMMaintenanceContractNo());\n }\n }\n if (proposalmgmt.getEscmBidmgmt() != null) {\n OBQuery<Escmbidsourceref> bidSrcref = OBDal.getInstance().createQuery(\n Escmbidsourceref.class,\n \"as e where e.escmBidmgmtLine.id in (select bid.id from escm_bidmgmt_line bid where bid.escmBidmgmt.id=:bidId)\");\n bidSrcref.setNamedParameter(\"bidId\", proposalmgmt.getEscmBidmgmt().getId());\n List<Escmbidsourceref> bidSrcList = bidSrcref.list();\n if (bidSrcList.size() > 0) {\n Escmbidsourceref bidSrcRef = bidSrcList.get(0);\n if (bidSrcRef.getRequisition() != null) {\n order.setEscmMaintenanceProject(\n bidSrcRef.getRequisition().getEscmMaintenanceProject());\n order.setEscmMaintenanceCntrctNo(\n bidSrcRef.getRequisition().getESCMMaintenanceContractNo());\n }\n }\n }\n\n OBDal.getInstance().save(order);\n\n proposalmgmt.setDocumentNo(order);\n OBDal.getInstance().save(proposalmgmt);\n\n // Updating the PO reference in PEE(Proposal Attribute)\n // Fetching the PEE irrespective of Proposal Version\n OBQuery<EscmProposalAttribute> proposalAttr = OBDal.getInstance().createQuery(\n EscmProposalAttribute.class,\n \" as a join a.escmProposalevlEvent b where b.status='CO' and a.escmProposalmgmt.proposalno= :proposalID \");\n proposalAttr.setNamedParameter(\"proposalID\", proposalmgmt.getProposalno());\n List<EscmProposalAttribute> proposalAttrList = proposalAttr.list();\n if (proposalAttrList.size() > 0) {\n EscmProposalAttribute proposalAttrObj = proposalAttrList.get(0);\n proposalAttrObj.setOrder(order);\n OBDal.getInstance().save(proposalAttrObj);\n }\n\n OBDal.getInstance().flush();\n\n int ordercount = POcontractAddproposalDAO.insertOrderline(conn, proposalmgmt, order);\n\n if (ordercount == 1) {\n // send an alert to contract user when po is created\n description = sa.elm.ob.scm.properties.Resource\n .getProperty(\"scm.contractuser.alert\", vars.getLanguage())\n .concat(\"\" + proposalmgmt.getProposalno());\n AlertUtility.alertInsertBasedonPreference(order.getId(), order.getDocumentNo(),\n \"ESCM_Contract_User\", order.getClient().getId(), description, \"NEW\", alertWindow,\n \"scm.contractuser.alert\", Constants.GENERIC_TEMPLATE, windowId, null);\n String message = OBMessageUtils.messageBD(\"ESCM_CreatePOForProposal_Success\");\n message = message.replace(\"%\", order.getDocumentNo());\n OBError result = OBErrorBuilder.buildMessage(null, \"success\", message);\n bundle.setResult(result);\n } else {\n OBError result = OBErrorBuilder.buildMessage(null, \"error\",\n \"@ESCM_CreatePOForProsalNotSuccess@\");\n bundle.setResult(result);\n }\n }\n }\n } catch (OBException e) {\n OBDal.getInstance().rollbackAndClose();\n log.error(\" Exception in CreatePOFromProposal: \" + e);\n OBError result = OBErrorBuilder.buildMessage(null, \"error\", e.getMessage());\n bundle.setResult(result);\n return;\n } catch (Exception e) {\n log.error(\"Exeception in CreatePOFromProposal Process:\", e);\n // Throwable t = DbUtility.getUnderlyingSQLException(e);\n final OBError error = OBMessageUtils.translateError(bundle.getConnection(), vars,\n vars.getLanguage(), OBMessageUtils.messageBD(\"HB_INTERNAL_ERROR\"));\n bundle.setResult(error);\n } finally {\n OBContext.restorePreviousMode();\n }\n }",
"private void launchPayUMoneyFlow() {\n\n PayUmoneyConfig payUmoneyConfig = PayUmoneyConfig.getInstance();\n\n //Use this to set your custom text on result screen button\n payUmoneyConfig.setDoneButtonText(\"Continue\");\n\n //Use this to set your custom title for the activity\n payUmoneyConfig.setPayUmoneyActivityTitle(\"VUCabs\");\n\n PayUmoneySdkInitializer.PaymentParam.Builder builder = new PayUmoneySdkInitializer.PaymentParam.Builder();\n\n double amount = 0;\n try {\n amount = Double.parseDouble(String.valueOf(Amount));\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n String txnId = System.currentTimeMillis() + \"\";\n String phone = mobile_til.getEditText().getText().toString().trim();\n String productName = \"VUCabs\";\n String firstName = name_et.getText().toString();\n String email = email_til.getEditText().getText().toString().trim();\n String udf1 = \"\";\n String udf2 = \"\";\n String udf3 = \"\";\n String udf4 = \"\";\n String udf5 = \"\";\n String udf6 = \"\";\n String udf7 = \"\";\n String udf8 = \"\";\n String udf9 = \"\";\n String udf10 = \"\";\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n builder.setAmount(amount)\n .setTxnId(txnId)\n .setPhone(phone)\n .setProductName(productName)\n .setFirstName(firstName)\n .setEmail(email)\n .setsUrl(appEnvironment.surl())\n .setfUrl(appEnvironment.furl())\n .setUdf1(udf1)\n .setUdf2(udf2)\n .setUdf3(udf3)\n .setUdf4(udf4)\n .setUdf5(udf5)\n .setUdf6(udf6)\n .setUdf7(udf7)\n .setUdf8(udf8)\n .setUdf9(udf9)\n .setUdf10(udf10)\n .setIsDebug(appEnvironment.debug())\n .setKey(appEnvironment.merchant_Key())\n .setMerchantId(appEnvironment.merchant_ID());\n\n try {\n mPaymentParams = builder.build();\n\n /*\n * Hash should always be generated from your server side.\n * */\n generateHashFromServer(mPaymentParams);\n\n /* *//**\n * Do not use below code when going live\n * Below code is provided to generate hash from sdk.\n * It is recommended to generate hash from server side only.\n * *//*\n mPaymentParams = calculateServerSideHashAndInitiatePayment1(mPaymentParams);\n\n if (AppPreference.selectedTheme != -1) {\n PayUmoneyFlowManager.startPayUMoneyFlow(mPaymentParams,PayUMoneyActivity.this, AppPreference.selectedTheme,mAppPreference.isOverrideResultScreen());\n } else {\n PayUmoneyFlowManager.startPayUMoneyFlow(mPaymentParams,PayUMoneyActivity.this, R.style.AppTheme_default, mAppPreference.isOverrideResultScreen());\n }*/\n\n } catch (Exception e) {\n // some exception occurred\n Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();\n payNowButton.setEnabled(true);\n }\n }",
"void purchaseMade();",
"@RequestMapping(value = \"confirmpurchase/v1/wallets/{walletId}/serviceproviders/{spId}/widgets/{widgetId}\", method = RequestMethod.GET)\n public TicketPurchaseResponse confirmPurchaseV1(@PathVariable(value = \"walletId\") String walletId,\n @PathVariable(value = \"spId\") String spId, @PathVariable(value = \"widgetId\") String widgetId) {\n LOG.info(\"########confirmPurchaseV1 started\");\n TicketPurchaseResponse ticketPurchaseResponse = null;\n String result = \"Success\";\n String productRef;\n GenerateProductIDResponse generateProductIDResponse;\n String status = \"success\";\n try {\n /* MIFAREHttpClient mifareClient = new MIFAREHttpClient(DIGITIZE_BASE_URI, GENERATE_PRODUCT_REFERENCE); */\n // MIFAREHttpClient mifareClient = new MIFAREHttpClient.Builder().serviceURL(DIGITIZE_BASE_URI)\n // .apiURL(GENERATE_PRODUCT_REFERENCE).build();\n GenerateProductIDRequest request = new GenerateProductIDRequest();\n RequestContextV1 requestContext = new RequestContextV1();\n requestContext.setServiceProviderId(spId);\n String idRequest = \"\" + System.currentTimeMillis();\n requestContext.setCorrelationId(idRequest);\n requestContext.setRequestId(idRequest);\n request.setRequestContext(requestContext);\n Products products = new Products();\n products.setProductTypeId(widgetId);\n productRef = UUID.randomUUID().toString();\n products.setSpProductReference(productRef);\n request.setProductOrders(new ArrayList<>(Arrays.asList(products)));\n \n /** calling seglan service InitPurchaseOrder API if serviceProviderId is NAME_CRTM */\n if (spId.equals(configBean.getCrtmServiceProviderId())) {\n InitPurchaseOrderRequest InitPurchaseOrderRequest = new InitPurchaseOrderRequest();\n InitPurchaseOrderRequest.setDeviceId(\"1234\");\n InitPurchaseOrderRequest.setGoogleAccountId(\"gsrini@gmail.com\");\n InitPurchaseOrderRequest.setProduct(widgetId);\n InitPurchaseOrderResponse initPurchaseOrderResponse = crtmService.processInitPurchaseOrder(InitPurchaseOrderRequest);\n if (!initPurchaseOrderResponse.getResponseCode().equals(\"00\")) {\n status = \"failed\";\n result = \"failed\";\n }\n ticketPurchaseResponse = TicketPurchaseResponse.builder().status(status).ticketId(productRef)\n .digitalTicketId(initPurchaseOrderResponse.getM2gReference()).build();\n } else {\n Header[] headers = new Header[] {\n new BasicHeader(\"content-type\", ContentType.APPLICATION_JSON.getMimeType())};\n // generateProductIDResponse = mifareClient.invokePost(request, GenerateProductIDResponse.class, headers);\n generateProductIDResponse = utils.postRequestWithAbsoluteURL1(request, configBean, configBean.getDIGITIZE_BASE_URI() + configBean.getGENERATE_PRODUCT_REFERENCE(),\n GenerateProductIDResponse.class);\n ticketPurchaseResponse = TicketPurchaseResponse.builder()\n .status(generateProductIDResponse.getResponseContext().getResponseMessage()).ticketId(productRef)\n .digitalTicketId(generateProductIDResponse.getReferences().get(0).getM2gReference()).build();\n result = JsonUtil.toJSON(generateProductIDResponse);\n }\n LOG.info(\"########confirmPurchaseV1 result:\" + result);\n } catch (Exception e) {\n LOG.info(\"#Error occurred during confirm purchase:\" + e);\n result = \"failed\";\n LOG.info(\"########confirmPurchaseV1 result:\" + result);\n ticketPurchaseResponse = TicketPurchaseResponse.builder().status(result).build();\n }\n return ticketPurchaseResponse;\n }",
"void payBills();",
"void pay(Order order);",
"@POST(\"/dev/gig/create_payment/\")\n Call<BuyGigResp> buyGig(@Header(\"authorization\") String auth, @Body BuyGigReqBody buyGigReqBody);",
"public void startPayment() {\r\n final Activity activity = this;\r\n\r\n final Checkout co = new Checkout();\r\n\r\n try {\r\n JSONObject options = new JSONObject();\r\n options.put(\"name\", \"Farm2Home\");\r\n options.put(\"description\", \"Consumption charges\");\r\n //You can omit the image option to fetch the image from dashboard\r\n // options.put(\"image\", \"https://rzp-mobile.s3.amazonaws.com/images/rzp.png\");\r\n options.put(\"currency\", \"INR\");\r\n options.put(\"amount\", \"500\");\r\n\r\n // JSONObject preFill = new JSONObject();\r\n // preFill.put(\"email\", \"sm@razorpay.com\");\r\n // preFill.put(\"contact\", \"9876543210\");\r\n\r\n // options.put(\"prefill\", preFill);\r\n\r\n co.open(activity, options);\r\n } catch (Exception e) {\r\n Toast.makeText(activity, \"Error in payment: \" + e.getMessage(), Toast.LENGTH_SHORT)\r\n .show();\r\n e.printStackTrace();\r\n }\r\n }",
"int payInTurbo(String turboCardNo, float turboAmount, String destinationTurboOfCourse, String installmentsButInTurbo);",
"public interface AccountEmailService {\n\n GrassrootEmail generateDonationShareEmail(String fromName, String toAddress, String linkToDonate);\n\n}",
"@Override\r\n public void pay() {\n }",
"public void createInvoice() {\n\t}",
"public PAYMENTS() {\n initComponents();\n }",
"public void CashPayment()\n {\n }",
"@Path(\"/{version}/confirmation-of-funds\")\n@Api(value = \"/{version}/accounts}\", tags = { \"Confirmation\"}, consumes = \"application/json\", produces = \"application/json\")\npublic interface Confirmation {\n\n\t/**\n\t * For /v1/confirmation-of-funds requests\n\t * \t \n\t * @param version Version\n\t * @param processId ID of the transaction as determined by the initiating party (UUID)\n\t * @param requestId ID of the request (UUID)\n\t * @param signature A signature of the request by the TPP on application level\n\t * @param certificate The certificate used for signing the request\n\t * @param date Standard https header element for Date and Time\n\t * @param confirmationOfFundsRequest Body data\n\t * @return Response\n\t */\n\t@POST\n\t@Path(\"/{provider-id}\")\n\t@Consumes(MediaType.APPLICATION_JSON)\n\t@Produces(MediaType.APPLICATION_JSON)\n\t@ApiOperation(value = \"Confirmation of Funds (page 84) - creates a confirmation of funds request at the ASPSP\")\n\t@ApiResponses(\n\t\t{@ApiResponse(code = 201, message = \"OK, funds request was correctly performe\", response = ConfirmationOfFundsResponse.class),\n\t\t\t@ApiResponse(code = 400, message = \"(Bad Request) Validation error occured\"),\n\t\t\t@ApiResponse(code = 401, message = \"(Unauthorized) Access Token is not valid\"),\n\t\t\t@ApiResponse(code = 406, message = \"(Not Acceptable) ? - not documented but necessary hier\") })\n\tpublic Response confirmationOfFunds(\n\t\t\t@ApiParam(value = \"Version\") @PathParam(\"version\") String version,\n\t\t\t@ApiParam(value = \"Provider Identification\") @PathParam(\"provider-id\") String providerId,\n\t\t\t@ApiParam(value = \"ID of the transaction as determined by the initiating party (UUID)\", required = true) \n\t\t\t\t@HeaderParam(\"Process-ID\") String processId, \n\t\t\t@ApiParam(value = \"ID of the request (UUID)\", required = true)\n\t\t\t\t@HeaderParam(\"Request-ID\") String requestId,\t\t\t\t\n\t\t\t@ApiParam(value = \"A signature of the request by the TPP on application level\", required = false)\n\t\t\t\t@HeaderParam(\"signature\") String signature,\t\n\t\t\t@ApiParam(value = \"The certificate used for signing the request\", required = false)\n\t\t\t\t@HeaderParam(\"certificate\") String certificate,\n\t\t\t@ApiParam(value = \"Standard https header element for Date and Time\", required = true)\n\t\t\t\t@HeaderParam(\"Date\") String date,\n\t\t\t@ApiParam(value = \"Request body\", required = true)\n\t\t\t\tConfirmationOfFundsRequest confirmationOfFundsRequest);\n\n\t\n}",
"@PayEntryGenerator(\n packageName = \"example.loo.com.fastec\",\n payEntryTemplate = WXPayEntryTemplate.class\n)\npublic interface WeChatPayEntry {\n}",
"void submit(String accountName, String accountDescription, String currency);",
"BillingSource billingSource();",
"PaymentHandler createPaymentHandler();",
"private void pay() {\r\n System.out.println(\"Customer sent payment\");\r\n }",
"void paymentOrder(long orderId);",
"String makePayment(String userName, String teamName, Payment payment) throws RemoteException, InterruptedException;",
"@Test\n void testDoPaymentInitiationRequest() {\n String PIS_BASE = \"https://api-sandbox.rabobank.nl/openapi/sandbox/payments/payment-initiation/pis/v1\";\n raboUtilUnderTest.doPaymentInitiationRequest(PIS_BASE, \"/payments/sepa-credit-transfers\", \"token\", \"payload\", \"redirect\");\n\n // Verify the results\n verify(webClient).post(anyString(),any(),any());\n }",
"public void navigateToBaseActivity() {\n\n //merchantKey = \"gtKFFx\"; //Testing\n merchantKey = \"ImrH8w\"; //Live\n //merchantKey = ((EditText) findViewById(R.id.editTextMerchantKey)).getText().toString();\n // String amount = ((EditText) findViewById(R.id.editTextAmount)).getText().toString();\n // String email = ((EditText) findViewById(R.id.editTextEmail)).getText().toString();\n\n // String value = environmentSpinner.getSelectedItem().toString();\n int environment;\n // String TEST_ENVIRONMENT = getResources().getString(R.string.test);\n // if (value.equals(TEST_ENVIRONMENT))\n //environment = PayuConstants.MOBILE_STAGING_ENV;\n // else\n environment = PayuConstants.PRODUCTION_ENV;\n\n userCredentials = merchantKey + \":\" + \"anafali2000@gmail.com\";// + new AppPreferences(PlaceOrderActivity.this).getEmail();\n\n //TODO Below are mandatory params for hash genetation\n mPaymentParams = new PaymentParams();\n /**\n * For Test Environment, merchantKey = \"gtKFFx\"\n * For Production Environment, merchantKey should be your live key or for testing in live you can use \"0MQaQP\"\n */\n mPaymentParams.setKey(merchantKey);\n mPaymentParams.setAmount(String.valueOf(discountedAmount));\n mPaymentParams.setProductInfo(\"FarmFresh24\");\n mPaymentParams.setFirstName(new AppPreferences(PlaceOrderActivity.this).getFname());\n mPaymentParams.setEmail(new AppPreferences(PlaceOrderActivity.this).getEmail());\n\n /*\n * Transaction Id should be kept unique for each transaction.\n * */\n mPaymentParams.setTxnId(\"\" + System.currentTimeMillis());\n\n /**\n * Surl --> Success url is where the transaction response is posted by PayU on successful transaction\n * Furl --> Failre url is where the transaction response is posted by PayU on failed transaction\n */\n mPaymentParams.setSurl(\"https://payu.herokuapp.com/success\");\n mPaymentParams.setFurl(\"https://payu.herokuapp.com/failure\");\n\n /*\n * udf1 to udf5 are options params where you can pass additional information related to transaction.\n * If you don't want to use it, then send them as empty string like, udf1=\"\"\n * */\n mPaymentParams.setUdf1(\"udf1\");\n mPaymentParams.setUdf2(\"udf2\");\n mPaymentParams.setUdf3(\"udf3\");\n mPaymentParams.setUdf4(\"udf4\");\n mPaymentParams.setUdf5(\"udf5\");\n\n /**\n * These are used for store card feature. If you are not using it then user_credentials = \"default\"\n * user_credentials takes of the form like user_credentials = \"merchant_key : user_id\"\n * here merchant_key = your merchant key,\n * user_id = unique id related to user like, email, phone number, etc.\n * */\n mPaymentParams.setUserCredentials(userCredentials);\n\n //TODO Pass this param only if using offer key\n //mPaymentParams.setOfferKey(\"cardnumber@8370\");\n\n //TODO Sets the payment environment in PayuConfig object\n payuConfig = new PayuConfig();\n payuConfig.setEnvironment(environment);\n\n //TODO It is recommended to generate hash from server only. Keep your key and salt in server side hash generation code.\n //generateHashFromServer(mPaymentParams);\n\n /**\n * Below approach for generating hash is not recommended. However, this approach can be used to test in PRODUCTION_ENV\n * if your server side hash generation code is not completely setup. While going live this approach for hash generation\n * should not be used.\n * */\n String salt = \"BBq8CTgS\"; //Live\n // String salt = \"eCwWELxi\"; //Test\n generateHashFromSDK(mPaymentParams, salt);\n\n }",
"void pay(Payment payment) {\n\n\t}",
"ShipmentItemBilling createShipmentItemBilling();",
"private String CreateInvoice() throws Exception {\n\n\t\tgetDriver().get(\"https://stg.autobrain.com/worker/retail_fulfillment/new_invoice\");\n\n\t\t// Add Quantity\n\t\tString s = prop.getProperty(\"no_of_devices\");\n\t\tint quantity = Integer.parseInt(s);\n\n\t\tfor (int i = 0; i < quantity; i++) {\n\t\t\tVisibilityOfElementByXpath(\"//div[@class='input-group number-picker']/span[2]/button\", 15).click();\n\t\t\tThread.sleep(500);\n\t\t}\n\n\t\t// Get invoice auto-generated number\n\t\tinvoice_id_before = VisibilityOfElementByXpath(\"//code[@class='name-preview']\", 15).getText();\n\t\tinvoice_id_before = invoice_id_before.replace(\"#\", \"\");\n\n\t\t// Description\n\t\tVisibilityOfElementByID(\"invoice_description\", 15).sendKeys(\"testing_\" + invoice_id_before);\n\n\t\t// Select account type\n\t\tSelect select = new Select(VisibilityOfElementByID(\"invoice_account_type\", 15));\n\n\t\tif (prop.getProperty(\"account_type\").equalsIgnoreCase(\"Autobrain Family\")) {\n\t\t\tinvoice_account_type = \"personal\";\n\t\t}\n\n\t\telse if (prop.getProperty(\"account_type\").equalsIgnoreCase(\"Autobrain Business\")) {\n\t\t\tinvoice_account_type = \"business\";\n\t\t}\n\n\t\tselect.selectByVisibleText(invoice_account_type);\n\n\t\t// Submit button\n\t\twait(getDriver(), 10).until(ExpectedConditions.visibilityOfElementLocated(By.name(\"commit\"))).click();\n\n\t\t// Validate invoice created\n\t\t// Get invoice auto-generated number\n\t\tString invoice_id_after = VisibilityOfElementByXpath(\"//code[@class='name-preview']\", 15).getText();\n\n\t\tif (!invoice_id_before.equals(invoice_id_after)) {\n\t\t\tSystem.out.println(\"Invoice created successfully!\");\n\t\t}\n\n\t\telse if (invoice_id_before.equals(invoice_id_after)) {\n\t\t\tAssert.assertEquals(true, false, \"Invoice not created successfully!\");\n\t\t}\n\n\t\treturn invoice_name = \"testing_\" + invoice_id_before;\n\n\t}",
"public void makePayment(String amount, String paymentRef) {\n JudoSDKManager.setKeyAndSecret(getApplicationContext(), API_TOKEN, API_SECRET);\n\n// Set environment to Sandbox\n JudoSDKManager.setSandboxMode(getApplicationContext());\n\n String customerRef = Settings.Secure.getString(getApplicationContext().getContentResolver(),\n Settings.Secure.ANDROID_ID);\n\n Intent intent = JudoSDKManager.makeAPayment(getApplicationContext(), JUDO_ID, \"GBP\", amount, paymentRef, customerRef, null);\n startActivityForResult(intent, ACTION_CARD_PAYMENT);\n }",
"String getPaymentInformation();",
"public String paypalSubscription(StudentProfileDetail studentProfileDetail,int planId, PlanRate planRate, int selectDuration){\r\n\t\tString token =\"\";\r\n\t\tPaymentDetailsType paymentDetails = new PaymentDetailsType();\r\n\t\t paymentDetails.setPaymentAction(PaymentActionCodeType.fromValue(\"Sale\"));\r\n\r\n\t\t BasicAmountType orderTotal = new BasicAmountType();\r\n\t\t \r\n\t\tString currencyName=studentProfileDetail.getCountryMaster().getCurrency().getCurrencyName();\r\n\t\t\r\n\t\tif(currencyName.equalsIgnoreCase(\"US\")){\r\n\t\t\torderTotal.setCurrencyID(CurrencyCodeType.fromValue(\"USD\"));\r\n\t\t}\r\n\t\telse if(currencyName.equalsIgnoreCase(\"MXN\")){\r\n\t\t\torderTotal.setCurrencyID(CurrencyCodeType.fromValue(\"MXN\"));\r\n\t\t}\r\n\t\telse if(currencyName.equalsIgnoreCase(\"EURO\")){\r\n\t\t\torderTotal.setCurrencyID(CurrencyCodeType.fromValue(\"EUR\"));\r\n\t\t}\r\n\t\t \r\n\t\t orderTotal.setValue(\"0\");\r\n\t\t paymentDetails.setOrderTotal(orderTotal);\r\n\t\t List<PaymentDetailsType> paymentDetailsList = new ArrayList<PaymentDetailsType>();\r\n\t\t paymentDetailsList.add(paymentDetails);\r\n\r\n\t\t SetExpressCheckoutRequestDetailsType setExpressCheckoutRequestDetails = new SetExpressCheckoutRequestDetailsType();\r\n\t\t setExpressCheckoutRequestDetails.setReturnURL(returnURLSub+\"=\"+planId+\"&selectDuration=\"+selectDuration);\r\n\r\n\t\t setExpressCheckoutRequestDetails.setCancelURL(cancelURL);\r\n\r\n\t\t setExpressCheckoutRequestDetails.setPaymentDetails(paymentDetailsList);\r\n\t\t setExpressCheckoutRequestDetails.setNoShipping(\"1\"); \r\n\t\t BillingAgreementDetailsType billingAgreement = new BillingAgreementDetailsType(BillingCodeType.fromValue(\"RecurringPayments\"));\r\n\t\t\r\n\t\tbillingAgreement.setBillingAgreementDescription(\"This is subscription plan\");\r\n\t\t\r\n\t\t List<BillingAgreementDetailsType> billList = new ArrayList<BillingAgreementDetailsType>();\r\n\t\t billList.add(billingAgreement);\r\n\t\t setExpressCheckoutRequestDetails.setBillingAgreementDetails(billList);\r\n\r\n\t\t SetExpressCheckoutRequestType setExpressCheckoutRequest = new SetExpressCheckoutRequestType(setExpressCheckoutRequestDetails);\r\n\t\t setExpressCheckoutRequest.setVersion(\"104.0\");\r\n\t\t //setExpressCheckoutRequest.getSetExpressCheckoutRequestDetails().setNoShipping(\"1\");\r\n\t\t SetExpressCheckoutReq setExpressCheckoutReq = new SetExpressCheckoutReq();\r\n\t\t setExpressCheckoutReq.setSetExpressCheckoutRequest(setExpressCheckoutRequest);\r\n\t\t Map<String, String> sdkConfig = new HashMap<String, String>();\r\n\t\t sdkConfig.put(\"mode\", mode);\r\n\t\t sdkConfig.put(\"acct1.UserName\", acctUserName);\r\n\t\t sdkConfig.put(\"acct1.Password\", acctPassword);\r\n\t\t sdkConfig.put(\"acct1.Signature\",acctSignature);\r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t PayPalAPIInterfaceServiceService service = new PayPalAPIInterfaceServiceService(sdkConfig);\r\n\t\t \r\n\t\t //PayPalAPIInterfaceServiceService service=new PayPalAPIInterfaceServiceService();\r\n\t\t SetExpressCheckoutResponseType setExpressCheckoutResponse;\r\n\t\ttry {\r\n\t\t\tsetExpressCheckoutResponse = service.setExpressCheckout(setExpressCheckoutReq);\r\n\t\t\t\r\n\t\t\ttoken=setExpressCheckoutResponse.getToken();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} \r\n\t\t\r\n\t\treturn token;\r\n\t\t \r\n\t \t\r\n\t}",
"public void generateInvoice() throws InvoicePrintException {\n authInvoice = null;\n try {\n signedInvoice = signer.sign(xmlGenerate.generateXMLFile(getInvoice(), getCustomer(), issuer), issuer.getCertificate(), issuer.getPassword());\n final List<Autorizacion> authResponse = authorization.syncRequest(signedInvoice, ServiceEnvironment.TEST, 20);\n if (!authResponse.isEmpty()) {\n final Autorizacion autorizacion = authResponse.get(0);\n final String authorizationStatus = autorizacion.getEstado();\n LOG.info(String.format(\"Invoice status: %s\", authorizationStatus));\n FacesMessageHelper.addInfo(String.format(\"Factura %s\", authorizationStatus), null);\n FacesMessageHelper.addQueryMessages(autorizacion.getMensajes().getMensaje());\n\n if (AuthorizationState.AUTORIZADO.name().equals(authorizationStatus)) {\n authInvoice = autorizacion.getNumeroAutorizacion() == null ? null : autorizacion;\n List<Attachment> attachments = createAttachments(autorizacion);\n stroreDocument(AuthorizationState.AUTORIZADO);\n sendMailWithAttachments(attachments);\n }\n } else {\n FacesMessageHelper.addError(\"Existe Problemas con el Servicio de Rentas Internas \", \"\");\n stroreDocument(AuthorizationState.NO_AUTORIZADO);\n }\n\n } catch (ReturnedInvoiceException rie) {\n final Comprobante comprobante = rie.getComprobantes().get(0);\n FacesMessageHelper.addRequestMessages(comprobante.getMensajes().getMensaje());\n stroreDocument(AuthorizationState.NO_AUTORIZADO);\n } catch (SignerException e) {\n LOG.error(e, e);\n FacesMessageHelper.addError(String.format(\"Hubo un error al firmar el documento: %s\", e.getMessage()), \"\");\n stroreDocument(AuthorizationState.NO_AUTORIZADO);\n } catch (Exception e) {\n FacesMessageHelper.addError(\"Existe Problemas con el Servicio de Rentas Internas \", \"Reintente la facturacion\");\n stroreDocument(AuthorizationState.NO_AUTORIZADO);\n }\n }",
"private void initiateCCAvenuePurchase() {\n try {\n String strAmount = Double.toString(planToPurchaseDiscountedPrice);\n Intent intent = new Intent(currentActivity, EnterMobileNumberActivity.class);\n //Intent intent = new Intent(currentActivity, WebViewActivity.class);\n //Intent intent = new Intent(currentActivity, PaymentOptionsActivity.class);\n intent.putExtra(AvenuesParams.CURRENCY, currencyCode);\n intent.putExtra(AvenuesParams.AMOUNT, strAmount);\n intent.putExtra(currentActivity.getString(R.string.app_cms_site_name), appCMSSite.getGist().getSiteInternalName());\n intent.putExtra(currentActivity.getString(R.string.app_cms_user_id), getLoggedInUser());\n intent.putExtra(currentActivity.getString(R.string.app_cms_plan_id), planToPurchase);\n intent.putExtra(\"plan_to_purchase_name\", planToPurchaseName);\n intent.putExtra(\"siteId\", appCMSSite.getGist().getSiteInternalName());\n intent.putExtra(\"email\", getLoggedInUserEmail());\n intent.putExtra(\"authorizedUserName\", getLoggedInUser());\n intent.putExtra(\"x-api-token\", apikey);\n intent.putExtra(\"auth_token\", getAuthToken());\n intent.putExtra(\"renewable\", isRenewable);\n intent.putExtra(\"mobile_number\", \"\");\n intent.putExtra(\"api_base_url\", appCMSMain.getApiBaseUrl());\n intent.putExtra(\"si_frequency\", \"2\");\n intent.putExtra(\"si_frequency_type\", renewableFrequency);\n intent.putExtra(\"color_theme\", getAppCMSMain().getBrand().getCta().getPrimary().getBackgroundColor());\n currentActivity.startActivity(intent);\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }",
"ch.crif_online.www.webservices.crifsoapservice.v1_00.Amount addNewCapitalPayed();",
"private void addPaymentStartEvent() {\n /*09th July 2019, Resolved Pyze library issue*/\n HashMap<String, Object> customAttributes = new HashMap<String, Object>();\n customAttributes.put(\"packageID\", String.valueOf(PackageID));\n customAttributes.put(\"userID\", String.valueOf(UserID));\n customAttributes.put(\"paymentType\", getIntent().getStringExtra(\"PaymentType\"));\n PyzeEvents.PyzeCommercePayment.postPaymentStarted(customAttributes);\n }",
"@Override\r\n\tpublic void payCheck() {\n\t\t\r\n\t}",
"public void startPayment() {\n double ruppes = Double.parseDouble(price);\n final Activity activity = this;\n final Checkout co = new Checkout();\n try {\n JSONObject options = new JSONObject();\n options.put(\"name\", getResources().getString(R.string.application_name));\n options.put(\"description\", \"\");\n //You can omit the image option to fetch the image from dashboard\n options.put(\"image\", getResources().getDrawable(R.mipmap.ic_app_logo));\n options.put(\"currency\", \"INR\");\n options.put(\"amount\", ruppes * 100);\n JSONObject preFill = new JSONObject();\n preFill.put(\"email\", \"multipz.paresh@gmail.com\");\n preFill.put(\"contact\", \"8758689113\");\n options.put(\"prefill\", preFill);\n co.open(activity, options);\n } catch (Exception e) {\n Toast.makeText(activity, \"Error in payment: \" + e.getMessage(), Toast.LENGTH_SHORT)\n .show();\n e.printStackTrace();\n }\n }",
"public IBankTransfert payment();",
"ShipmentGatewayUsps createShipmentGatewayUsps();",
"private void processPayment(ProcessPaymentEvent event) {\n try {\r\n message.setInt(\"invoiceId\", event.getInvoiceId());\r\n message.setInt(\"processId\", (event.getProcessId() == null) ? -1 : event.getProcessId());\r\n message.setInt(\"runId\", (event.getRunId() == null) ? -1 : event.getRunId());\r\n message.setStringProperty(\"type\", \"payment\");\r\n \r\n // add additional fields from the associated plug-in\r\n IAsyncPaymentParameters task = getPluggableTask(entityId, \r\n Constants.PLUGGABLE_TASK_ASYNC_PAYMENT_PARAMS);\r\n task.addParameters(message);\r\n } catch (Exception e) {\r\n throw new SessionInternalError(\"Error transforming message \", \r\n this.getClass(), e);\r\n }\r\n }",
"public interface PayService {\n\n /**\n * 支付完成处理 下线支付流程\n */\n PayResult payOver(PayOverParam payOverParam);\n}",
"CarPaymentMethod processHotDollars();",
"private void handleConfirmBillPayment() {\n\t\t// TODO Auto-generated method stub\n\t\ttry {\n\t\t\tPaymentBiller request = new PaymentBiller();\n\t\t\tObjectFactory f = new ObjectFactory();\n\t\t\tCommonParam2 commonParam = f.createCommonParam2();\n\t\t\t\n\t\t\tcommonParam.setProcessingCode(f.createCommonParam2ProcessingCode(\"100601\"));\n\t\t\tcommonParam.setChannelId(f.createCommonParam2ChannelId(\"6018\"));\n\t\t\tcommonParam.setChannelType(f.createCommonParam2ChannelType(\"PB\"));\n\t\t\tcommonParam.setNode(f.createCommonParam2Node(\"WOW_CHANNEL\"));\n\t\t\tcommonParam.setCurrencyAmount(f.createCommonParam2CurrencyAmount(\"IDR\"));\n\t\t\tcommonParam.setAmount(f.createCommonParam2Amount(String.valueOf(billPayBean.getBillAmount())));\n\t\t\tcommonParam.setCurrencyfee(f.createCommonParam2Currencyfee(billPayBean.getFeeCurrency()));\n\t\t\tcommonParam.setFee(f.createCommonParam2Fee(String.valueOf(billPayBean.getFeeAmount())));\n\t\t\tcommonParam.setTransmissionDateTime(f.createCommonParam2TransmissionDateTime(PortalUtils.getSaveXMLGregorianCalendar(Calendar.getInstance()).toXMLFormat()));\n\t\t\tcommonParam.setRequestId(f.createCommonParam2RequestId(MobiliserUtils.getExternalReferenceNo(isystemEndpoint)));\n\t\t\tcommonParam.setAcqId(f.createCommonParam2AcqId(\"213\"));\n\t\t\tcommonParam.setReferenceNo(f.createCommonParam2ReferenceNo(String.valueOf(billPayBean.getReferenceNumber())));\n\t\t\tcommonParam.setTerminalId(f.createCommonParam2TerminalId(\"WOW\"));\n\t\t\tcommonParam.setTerminalName(f.createCommonParam2TerminalName(\"WOW\"));\n\t\t\tcommonParam.setOriginal(f.createCommonParam2Original(billPayBean.getAdditionalData()));\n\t\t\t\n\t\t\trequest.setCommonParam(commonParam);\n\t\t\tPhoneNumber phone = new PhoneNumber(this.getMobiliserWebSession().getBtpnLoggedInCustomer().getUsername());\n\t\t\trequest.setAccountNo(phone.getNationalFormat());\n\t\t\trequest.setBillerCustNo( billPayBean.getSelectedBillerId().getId()); \n\t\t\trequest.setDebitType(\"0\");\n\t\t\trequest.setInstitutionCode(billPayBean.getBillerId());\n\t\t\trequest.setProductID(billPayBean.getProductId());\n\t\t\trequest.setUnitId(\"0901\");\n\t\t\trequest.setProcessingCodeBiller(\"501000\");\n\t\t\t\n\t\t\tString desc1=\"Bill Payment\";\n\t\t\tString desc2= billPayBean.getBillerId();\n\t\t\tString desc3=\"\";\n\t\t\t\n\t\t\trequest.setAdditionalData1(desc1);\n\t\t\trequest.setAdditionalData2(desc2);\n\t\t\trequest.setAdditionalData3(desc3);\n\t\t\t\n\t\t\tPaymentBillerResponse response = new PaymentBillerResponse();\n\t\t\t\n\t\t\tresponse = (PaymentBillerResponse) webServiceTemplete.marshalSendAndReceive(request, \n\t\t\t\t\tnew WebServiceMessageCallback() {\n\t\t\t\t\n\t\t\t\t@Override\n\t\t\t\tpublic void doWithMessage(WebServiceMessage message) throws IOException,\n\t\t\t\t\t\tTransformerException {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t((SoapMessage) message)\n\t\t\t\t\t.setSoapAction(\"com_btpn_biller_ws_provider_BtpnBillerWsTopup_Binder_paymentBiller\");\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tif (response.getResponseCode().equals(\"00\")) {\n\t\t\t\tbillPayBean.setStatusMessage(getLocalizer().getString(\"success.perform.billpayment\", this));\n\t\t\t\tsetResponsePage(new BankBillPaymentStatusPage(billPayBean));\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(MobiliserUtils.errorMessage(response.getResponseCode(), response.getResponseDesc(), getLocalizer(), this));\n\t\t\t\t\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\terror(getLocalizer().getString(\"error.exception\", this));\n\t\t\tLOG.error(\"An exception was thrown\", e);\n\t\t}\n\t}",
"private String PayAgentPayment(HttpServletRequest request) {\n\n try {\n HttpSession session = request.getSession();\n int serviceId = Integer.parseInt(request.getParameter(CONFIG.PARAM_SERVICE_ID));\n int operationId = Integer.parseInt(request.getParameter(CONFIG.OPERATION_ID));\n String amount = request.getParameter(CONFIG.AMOUNT);\n String agentIdentifier = request.getParameter(CONFIG.PARAM_MSISDN);\n int custId = Integer.parseInt((String) request.getSession().getAttribute(CONFIG.PARAM_PIN));\n String lang = request.getSession().getAttribute(CONFIG.lang).equals(\"\") ? \"en\" : \"ar\";\n\n Donation_AgentPaymentRequestDTO agentPaymentRequestDTO = new Donation_AgentPaymentRequestDTO();\n agentPaymentRequestDTO.setSERVICE_ID(serviceId);\n agentPaymentRequestDTO.setOPERATION_ID(operationId);\n agentPaymentRequestDTO.setAMOUNT(amount);\n agentPaymentRequestDTO.setCUSTOMER_ID(custId);\n agentPaymentRequestDTO.setAGENT_IDENTIFIER(agentIdentifier);\n agentPaymentRequestDTO.setCHANNEL(\"WEB\");\n agentPaymentRequestDTO.setLANG(lang);\n String national_id = request.getParameter(\"national_ID\");\n agentPaymentRequestDTO.setNATIONAL_ID(national_id);\n\n DonationAgentPaymentRespponseDto agentPaymentRespponseDto = MasaryManager.getInstance().do_agent_payment_without_inquiry(agentPaymentRequestDTO);\n MasaryManager.logger.info(\"Error code \" + agentPaymentRespponseDto.getSTATUS_CODE());\n if (agentPaymentRespponseDto.getSTATUS_CODE().equals(\"200\")) {\n\n session.setAttribute(\"donationPaymentResponse\", agentPaymentRespponseDto);\n session.setAttribute(\"SERVICE_ID\", (String.valueOf(serviceId)));\n\n// request.setAttribute(\"Fees\", fees.trim());\n return CONFIG.PAGE_PAY_AGENTPAYMENT;\n } else {\n request.getSession().setAttribute(\"ErrorCode\", CONFIG.getBillErrorCode(request.getSession())\n .concat(agentPaymentRespponseDto.getSTATUS_CODE())\n .concat(\" \")\n .concat(agentPaymentRespponseDto.getSTATUS_MESSAGE()));\n return CONFIG.PAGE_Agent_Payment;\n\n }\n\n } catch (Exception e) {\n MasaryManager.logger.error(\"Exception\" + e.getMessage(), e);\n\n request.getSession().setAttribute(\"ErrorCode\", e.getMessage());\n return CONFIG.PAGE_Agent_Payment;\n }\n\n }",
"@Override\npublic void investment() {\n\t\n}",
"@Override\n\tpublic void setupAddFields(EquationStandardTransaction transaction)\n\t{\n\t\ttransaction.setFieldValue(\"GZBRNM\", \"LOND\"); // Branch mnemonic (4A)\n\t\ttransaction.setFieldValue(\"GZPBR\", \"IPS2\"); // Posting group id or user id, and group level (5A)\n\t\ttransaction.setFieldValue(\"GZVFR\", \"1000106\"); // Value from date (7S,0)\n\t\ttransaction.setFieldValue(\"GZBRND\", \"LOND\"); // Branch mnemonic (4A)\n\t\ttransaction.setFieldValue(\"GZDRF\", \"0014620010\"); // Users own reference for deals, reconciliation etc (16A)\n\t\ttransaction.setFieldValue(\"GZAMA\", \"1500-\"); // Ordinary amount in minor currency units (15P,0)\n\t\ttransaction.setFieldValue(\"GZCCY\", \"PHP\"); // Currency mnemonic (3A)\n\t\ttransaction.setFieldValue(\"GZNPE\", \"1\"); // Number of posting entries (5P,0)\n\t\ttransaction.setFieldValue(\"GZNR1\", \"STOP\"); // Narrative line 1 (35A)\n\t\ttransaction.setFieldValue(\"GZRFR\", \"N\"); // Referred item? (1A)\n\t\ttransaction.setFieldValue(\"GZAUT\", \"Y\"); // Authorised item? (1A)\n\t\ttransaction.setFieldValue(\"GZSSI\", \"N\"); // Special item? (1A)\n\t\ttransaction.setFieldValue(\"GZTTP\", \"C\"); // Transaction type (1A)\n\t\ttransaction.setFieldValue(\"GZHSRL\", \"0014620010\"); // Serial \"number\" forming the key to a stop order (16A)\n\t\ttransaction.setFieldValue(\"GZHAMT\", \"1500-\"); // Stop order amount (15P,0)\n\t\ttransaction.setFieldValue(\"GZAUTC\", \"MASSEYR1\"); // Referred item authorisation code (12A)\n\t\ttransaction.setFieldValue(\"GZCED\", \"2\"); // Currency edit field (1A)\n\t\ttransaction.setFieldValue(\"GZCHQ\", \"N\"); // Cheque item? (1A)\n\t\ttransaction.setFieldValue(\"GZDRFN\", \"0\"); // Cheque serial number (16P,0)\n\t\ttransaction.setFieldValue(\"GZTCCY\", \"PHP\"); // Transaction currency (3A)\n\t\ttransaction.setFieldValue(\"GZTAMA\", \"1500\"); // Transaction amount (15P,0)\n\t\ttransaction.setFieldValue(\"GZHCCY\", \"PHP\"); // Stop order currency (3A)\n\t\ttransaction.setFieldValue(\"GZPSQ7\", \"0000182\"); // 7 Long posting sequence number (7P,0)\n\t}",
"@Test\n\tpublic void refundByBankTransferEuSEPA() throws Exception {\n\t\ttry {\n\t\t\tUtility.initConfiguration();\n\t\t\tThread.sleep(3000);\n\t\t\t// Login to back end and check payment method is enabled or not\n\t\t\tUtility.wooCommerceBackEndLogin();\n\t\t\tThread.sleep(3000);\n\t\t\tElementLocators element = PageFactory.initElements(driver, ElementLocators.class);\n\t\t\ttest = extend.createTest(\"Vendor script execution for SEPA 'REFUND_BY_BANK_TRANSFER_EU'\");\n\t\t\tActions actions = new Actions(driver);\n\t\t\tactions.moveToElement(element.WooCommerce).perform();\n\t\t\tThread.sleep(3000);\n\t\t\telement.WooCommerce_Settings.click();\n\t\t\telement.Payment_Tab.click();\n\t\t\tThread.sleep(2000);\n\t\t\telement.Sepa_Payment_Display.click();\n\t\t\t// Checking payment method enabled or disabled\n\t\t\tif (!element.Sepa_Enable_Payment_Method_Checkbox.isSelected()) {\n\t\t\t\telement.Sepa_Enable_Payment_Method_Checkbox.click();\n\t\t\t\tThread.sleep(3000);\n\t\t\t}\n\t\t\t// Checking Guarantee payment enabled or disabled\n\t\t\tif (element.Sepa_Enable_Payment_Guarantee_CheckBox.isSelected()) {\n\t\t\t\telement.Sepa_Enable_Payment_Guarantee_CheckBox.click();\n\t\t\t\tThread.sleep(3000);\n\t\t\t}\n\t\t\telement.Sepa_Payment_Save_Changes.click();\n\t\t\tThread.sleep(3000);\n\t\t\tdriver.navigate().to(Constant.shopfrontendurl);\n\t\t\tThread.sleep(3000);\n\t\t\tUtility.wooCommerceCheckOutProcess();\n\t\t\tThread.sleep(3000);\n\t\t\t// Read the data from excel sheet\n\t\t\tMap<String, String> UserData = new HashMap<String, String>();\n\t\t\tUserData = Data.ExcelReader_PaymentMethods();\n\t\t\t// Check whether payment method is displayed in checkout page\n\t\t\tif (element.Sepa_Label.isDisplayed()) {\n\t\t\t\tif (element.Sepa_Radio_button.isDisplayed() == true) {\n\t\t\t\t\telement.Sepa_Radio_button.click();\n\t\t\t\t}\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);\n\t\t\t\telement.Sepa_Iban_TextBox.sendKeys(UserData.get(\"SEPAIBAN\"));\n\t\t\t\telement.Place_Order.click();\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(25, TimeUnit.SECONDS);\n\t\t\t\t// After order placed successfully verify Thank you message displayed\n\t\t\t\tString thankyoumessage = element.FE_Thank_You_Page_Text.getText();\n\t\t\t\tif (thankyoumessage.equals(\"Thank you. Your order has been received.\")) {\n\t\t\t\t\tSystem.out.println(\"Order placed successfully using Direct Debit SEPA\");\n\t\t\t\t\ttest.log(Status.INFO, \"Order placed successfully using Direct Debit SEPA\");\n\t\t\t\t\tThread.sleep(3000);\n\t\t\t\t\tString totalOrderAmount = element.OrderDetails_TotalAmount.getText().replaceAll(\"[^0-9]\", \"\");\n\t\t\t\t\tString TID = element.OrderDetails_Note_TID.getText().replaceAll(\"[^0-9]\", \"\");\n\t\t\t\t\tSystem.out.println(\"Order amount:\" + totalOrderAmount);\n\t\t\t\t\tSystem.out.println(\"TID:\" + TID);\n\t\t\t\t\t// Go to callback execution site and enter vendor script URL\n\t\t\t\t\tdriver.navigate().to(Constant.vendorscripturl);\n\t\t\t\t\tThread.sleep(4000);\n\t\t\t\t\telement.Vendor_Script_Url.sendKeys((Constant.shopfrontendurl) + \"?wc-api=novalnet_callback\");\n\t\t\t\t\t// Enter required parameter\n\t\t\t\t\telement.Vendor_Id.clear();\n\t\t\t\t\telement.Vendor_Id.sendKeys(\"4\");\n\t\t\t\t\telement.Vendor_Auth_Code.clear();\n\t\t\t\t\telement.Vendor_Auth_Code.sendKeys(\"JyEtHUjjbHNJwVztW6JrafIMHQvici\");\n\t\t\t\t\telement.Product_Id.clear();\n\t\t\t\t\telement.Product_Id.sendKeys(\"14\");\n\t\t\t\t\telement.Tariff_Id.clear();\n\t\t\t\t\telement.Tariff_Id.sendKeys(\"30\");\n\t\t\t\t\telement.Payment_Type_Edit_Button.click();\n\t\t\t\t\tSelect selectpaymenttype = new Select(element.Payment_Type_Selectbox);\n\t\t\t\t\tselectpaymenttype.selectByVisibleText(\"REFUND_BY_BANK_TRANSFER_EU\");\n\t\t\t\t\telement.Test_Mode.clear();\n\t\t\t\t\telement.Test_Mode.sendKeys(\"1\");\n\t\t\t\t\telement.Tid_Payment.clear();\n\t\t\t\t\telement.Tid_Payment.sendKeys(TID);\n\t\t\t\t\telement.Amount.clear();\n\t\t\t\t\telement.Amount.sendKeys(totalOrderAmount);\n\t\t\t\t\telement.Currency.clear();\n\t\t\t\t\telement.Currency.sendKeys(\"EUR\");\n\t\t\t\t\telement.Status.clear();\n\t\t\t\t\telement.Status.sendKeys(\"100\");\n\t\t\t\t\telement.Tid_Status.clear();\n\t\t\t\t\telement.Tid_Status.sendKeys(\"100\");\n\t\t\t\t\telement.Tid.clear();\n\t\t\t\t\telement.Tid.sendKeys(\"13245678945612345\");\n\t\t\t\t\telement.Execute_Button.click();\n\t\t\t\t\tString callback_message = element.callback_message.getText();\t\t\t\t\t\n\t\t\t\t\tString callback_message_updated = callback_message.substring(9, callback_message.length());\n\t\t\t\t\tSystem.out.println(\"Callback execution message: \" + callback_message_updated);\n\t\t\t\t\tif (callback_message.contains(\n\t\t\t\t\t\t\t\"Novalnet callback received. Refund/Bookback executed successfully for the TID:\")) {\n\t\t\t\t\t\t// Go to shop front end and check the order status update\n\t\t\t\t\t\tdriver.navigate().to(Constant.shopbackendurl);\n\t\t\t\t\t\tactions.moveToElement(element.WooCommerce).perform();\n\t\t\t\t\t\tThread.sleep(3000);\n\t\t\t\t\t\telement.WooCommerce_Orders.click();\n\t\t\t\t\t\telement.Backend_Order_Number.click();\n\t\t\t\t\t\tString BEOrderNotes_CallBackMessage = element.BE_OrderNotes_Message.getText();\n\t\t\t\t\t\tSystem.out.println(\"Back end order note: \" + BEOrderNotes_CallBackMessage);\n\t\t\t\t\t\t// Verify the callback execution message is updated in the order note\n\t\t\t\t\t\tif (BEOrderNotes_CallBackMessage.equalsIgnoreCase(callback_message_updated)) {\n\t\t\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\t\t\"TC PASSED: REFUND_BY_BANK_TRANSFER_EU execution message and back end order note message text was matched successfully\");\n\t\t\t\t\t\t\ttest.log(Status.PASS,\n\t\t\t\t\t\t\t\t\t\"TC PASSED: REFUND_BY_BANK_TRANSFER_EU execution message and back end order note message text was matched successfully\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\t\t\"TC FAILED: REFUND_BY_BANK_TRANSFER_EU execution message and back end order note message text was not matched successfully\");\n\t\t\t\t\t\t\ttest.log(Status.FAIL,\n\t\t\t\t\t\t\t\t\t\"TC PASSED: REFUND_BY_BANK_TRANSFER_EU execution and back end order note message text was not matched successfully\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println(\"ERROR: Callback response message is displayed wrongly\");\n\t\t\t\t\t\ttest.log(Status.ERROR, \"ERROR: Callback response message is displayed wrongly\");\n\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"ERROR: Order was not placed successfully using Direct Debit SEPA\");\n\t\t\t\t\ttest.log(Status.ERROR, \"ERROR: Order was not placed successfully using Direct Debit SEPA\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Close browser\n\t\t\tUtility.closeBrowser();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"ERROR: Unexpected error from 'refundByBankTransferEuSEPA' method\");\n\t\t\ttest.log(Status.ERROR, \"ERROR: Unexpected error from 'refundByBankTransferEuSEPA' method\");\n\t\t}\n\t}",
"public String formPaymentNeeded()\r\n {\r\n return formError(\"402 Payment required\",\"Payment is required\");\r\n }",
"public static ANetApiResponse run(String apiLoginId, String transactionKey, String eMail) {\n ApiOperationBase.setEnvironment(Environment.SANDBOX);\n \n // Create object with merchant authentication details\n MerchantAuthenticationType merchantAuthenticationType = new MerchantAuthenticationType() ;\n merchantAuthenticationType.setName(apiLoginId);\n merchantAuthenticationType.setTransactionKey(transactionKey);\n\n // Populate the payment data\n CreditCardType creditCard = new CreditCardType();\n creditCard.setCardNumber(\"4111111111111111\");\n creditCard.setExpirationDate(\"1225\");\n PaymentType paymentType = new PaymentType();\n paymentType.setCreditCard(creditCard);\n\n // Set payment profile data\n CustomerPaymentProfileType customerPaymentProfileType = new CustomerPaymentProfileType();\n customerPaymentProfileType.setCustomerType(CustomerTypeEnum.INDIVIDUAL);\n customerPaymentProfileType.setPayment(paymentType);\n\n // Set customer profile data\n CustomerProfileType customerProfileType = new CustomerProfileType();\n customerProfileType.setMerchantCustomerId(\"M_\" + eMail);\n customerProfileType.setDescription(\"Profile description for \" + eMail);\n customerProfileType.setEmail(eMail);\n customerProfileType.getPaymentProfiles().add(customerPaymentProfileType);\n\n // Create the API request and set the parameters for this specific request\n CreateCustomerProfileRequest apiRequest = new CreateCustomerProfileRequest();\n apiRequest.setMerchantAuthentication(merchantAuthenticationType);\n apiRequest.setProfile(customerProfileType);\n apiRequest.setValidationMode(ValidationModeEnum.TEST_MODE);\n\n // Call the controller\n CreateCustomerProfileController controller = new CreateCustomerProfileController(apiRequest);\n controller.execute();\n\n // Get the response\n CreateCustomerProfileResponse response = new CreateCustomerProfileResponse();\n response = controller.getApiResponse();\n \n // Parse the response to determine results\n if (response!=null) {\n // If API Response is OK, go ahead and check the transaction response\n if (response.getMessages().getResultCode() == MessageTypeEnum.OK) {\n System.out.println(response.getCustomerProfileId());\n if (!response.getCustomerPaymentProfileIdList().getNumericString().isEmpty()) {\n System.out.println(response.getCustomerPaymentProfileIdList().getNumericString().get(0));\n }\n if (!response.getCustomerShippingAddressIdList().getNumericString().isEmpty()) {\n System.out.println(response.getCustomerShippingAddressIdList().getNumericString().get(0));\n }\n if (!response.getValidationDirectResponseList().getString().isEmpty()) {\n System.out.println(response.getValidationDirectResponseList().getString().get(0));\n }\n }\n else\n {\n System.out.println(\"Failed to create customer profile: \" + response.getMessages().getResultCode());\n }\n } else {\n // Display the error code and message when response is null \n ANetApiResponse errorResponse = controller.getErrorResponse();\n System.out.println(\"Failed to get response\");\n if (!errorResponse.getMessages().getMessage().isEmpty()) {\n System.out.println(\"Error: \"+errorResponse.getMessages().getMessage().get(0).getCode()+\" \\n\"+ errorResponse.getMessages().getMessage().get(0).getText());\n }\n }\n return response;\n\n }",
"@Test\n public void makeAndRetrievePbaPaymentsByProbate() {\n String accountNumber = testProps.existingAccountNumber;\n CreditAccountPaymentRequest accountPaymentRequest = PaymentFixture.aPbaPaymentRequestForProbate(\"90.00\",\n \"PROBATE\",accountNumber);\n accountPaymentRequest.setAccountNumber(accountNumber);\n PaymentDto paymentDto = paymentTestService.postPbaPayment(USER_TOKEN, SERVICE_TOKEN, accountPaymentRequest).then()\n .statusCode(CREATED.value()).body(\"status\", equalTo(\"Success\")).extract().as(PaymentDto.class);\n\n assertTrue(paymentDto.getReference().startsWith(\"RC-\"));\n\n // Get pba payment by reference\n PaymentDto paymentsResponse =\n paymentTestService.getPbaPayment(USER_TOKEN, SERVICE_TOKEN, paymentDto.getReference()).then()\n .statusCode(OK.value()).extract().as(PaymentDto.class);\n\n assertThat(paymentsResponse.getAccountNumber()).isEqualTo(accountNumber);\n\n // delete payment record\n paymentTestService.deletePayment(USER_TOKEN, SERVICE_TOKEN, paymentDto.getReference()).then().statusCode(NO_CONTENT.value());\n\n }",
"public void processReturnShipment() {\n \n }",
"@Test( groups ={\"PaymentMethodValidation\"})\r\n\t\r\n\tpublic static void PayLaterOption(){\r\n\r\n\t\ttry {\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\tPaymentMethod PaymentMethodObj \t= \tnew PaymentMethod() ;\r\n\t\t\t\r\n\t\t\tPaymentMethodObj.setPaymentMethod(\"PayLater\");\r\n\t\t\t\r\n\t\t\tCommonTestLibrary.launchDefaultProduct() ;\r\n\r\n\t\t\tAssert.assertEquals(CommonTestLibrary.purchaseProduct(\tTestApplicationParams.getDefaultUser(), \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tTestApplicationParams.getDefaultShippingAddress(),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tTestApplicationParams.getDefaultBillingAddress(), \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrue, \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tPaymentMethodObj,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tTestApplicationParams.getDefaultDiscount(), \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Address\"), true) ;\r\n\t\t\t\r\n\t\t\tWaitUtil.waitFor(Driver,\"THREAD_SLEEP\", (long)200);\t\r\n\t\t\tAssert.assertEquals(new FrontEndCommonPage(Driver).logout(),true) ;\t\t\r\n\t\t\t\r\n\t\t} \r\n\t\tcatch ( TestException Te)\r\n\t\t{\r\n\t\t\tTestLog.logTestStep(\"Error/Exception : \" + Te.getExceptionName());\r\n\t\t\tTe.printException();\r\n\t\t\tassert(false);\r\n\t\t}\t\t\r\n\t\tcatch (InterruptedException e){\r\n\t\t\t//do nothing\t\t\r\n\t\t}\r\n\t\tcatch ( Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\tTestLog.logTestStep(\"Error/Exception \" + e.getMessage());\r\n\t\t\tassert(false) ;\r\n\t\t}\r\n\t\t\r\n\t}",
"@Override\r\n\tpublic void paidBehavior() {\n\t\tSystem.out.println(\"You paid using your Vias card\");\r\n\t\t\r\n\t}",
"public JSONObject getInvoiceForGSTR3BTaxable(JSONObject reqParams) throws JSONException, ServiceException {\n /**\n * Get Invoice total sum\n */\n String companyId=reqParams.optString(\"companyid\");\n reqParams.put(\"entitycolnum\", reqParams.optString(\"invoiceentitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"invoiceentityValue\"));\n JSONObject jSONObject = new JSONObject();\n List<Object> invoiceData = accEntityGstDao.getInvoiceDataWithDetailsInSql(reqParams);\n reqParams.remove(\"isb2cs\"); // remove to avoid CN index while fetching data\n double taxableAmountInv = 0d;\n double totalAmountInv = 0d;\n double IGSTAmount = 0d;\n double CGSTAmount = 0d;\n double SGSTAmount = 0d;\n double CESSAmount = 0d;\n int count=0;\n if (!reqParams.optBoolean(GSTR3BConstants.DETAILED_VIEW_REPORT, false)) {\n for (Object object : invoiceData) {\n Object[] data = (Object[]) object;\n String term = data[1]!=null?data[1].toString():\"\";\n double termamount = data[0]!=null?(Double) data[0]:0;\n count = data[4]!=null?((BigInteger) data[4]).intValue():0;\n totalAmountInv = data[3]!=null?(Double) data[3]:0;\n if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputIGST\").toString())) {\n taxableAmountInv += data[2]!=null?(Double) data[2]:0;\n IGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCGST\").toString())) {\n taxableAmountInv += data[2]!=null?(Double) data[2]:0;\n CGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputSGST\").toString())) {\n SGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputUTGST\").toString())) {\n SGSTAmount += termamount;\n } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCESS\").toString())) {\n CESSAmount += termamount;\n } else if(StringUtil.isNullOrEmpty(term)){\n taxableAmountInv += data[2]!=null?(Double) data[2]:0;\n }\n }\n jSONObject.put(\"count\", count);\n jSONObject.put(\"taxableamt\", authHandler.formattedAmount(taxableAmountInv, companyId));\n jSONObject.put(\"igst\", authHandler.formattedAmount(IGSTAmount,companyId));\n jSONObject.put(\"cgst\", authHandler.formattedAmount(CGSTAmount,companyId));\n jSONObject.put(\"sgst\", authHandler.formattedAmount(SGSTAmount,companyId));\n jSONObject.put(\"csgst\", authHandler.formattedAmount(CESSAmount,companyId));\n jSONObject.put(\"totaltax\", authHandler.formattedAmount(IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n jSONObject.put(\"totalamount\", authHandler.formattedAmount(taxableAmountInv+IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n } else {\n jSONObject = accGSTReportService.getSalesInvoiceJSONArrayForGSTR3B(invoiceData, reqParams, companyId);\n }\n return jSONObject;\n }",
"public interface FixFieldConstants {\r\n\t\r\n public final static String SIDE_BUY = \"1\";\r\n public final static String SIDE_SELL = \"2\";\r\n\r\n\r\n\r\n public final static String PUT_CALL_CALL = \"1\";\r\n public final static String PUT_CALL_PUT = \"0\";\r\n\r\n\r\n public final static String ORDER_TYPE_MARKET = \"1\";\r\n public final static String ORDER_TYPE_LIMIT = \"2\";\r\n public final static String ORDER_TYPE_STOP = \"3\";\r\n public final static String ORDER_TYPE_STOPLIMIT = \"4\";\r\n public final static String ORDER_TYPE_MARKETLIMIT = \"K\";\r\n \r\n\r\n public final static String TIME_IN_FORCE_DAY = \"0\"; \r\n public final static String TIME_IN_FORCE_GTC = \"1\";\r\n public final static String TIME_IN_FORCE_FAK = \"3\";\r\n public final static String TIME_IN_FORCE_FOK = \"4\";\r\n public final static String TIME_IN_FORCE_GTD = \"6\"; \r\n \r\n public final static String HANDL_INST_AUTOMATED = \"1\";\r\n \r\n \r\n public final static String SECURITY_TYPE_FUTURE = \"FUT\";\r\n public final static String SECURITY_TYPE_OPTION = \"OPT\"; \r\n public final static String SECURITY_TYPE_FX = \"FOR\";\r\n\r\n\r\n public final static String CUSTOMER_OR_FIRM_CUSTOMER = \"0\"; \r\n public final static String CUSTOMER_OR_FIRM_FIRM = \"1\";\r\n\r\n public final static String CTI_CODE_BROKER_OWN_ACCOUNT = \"1\";\r\n public final static String CTI_CODE_BROKER_HOUSE_ACCOUNT = \"2\";\r\n public final static String CTI_CODE_BROKER_BROKER_ACCOUNT = \"3\";\r\n public final static String CTI_CODE_BROKER_CUSTOMER_ACCOUNT = \"4\"; \r\n \r\n public final static String FEE_BILLING_CBOE_MEMBER = \"B\"; \r\n public final static String FEE_BILLING_NON_MEMBER = \"C\"; \r\n public final static String FEE_BILLING_EQUITY_MEMBER = \"E\"; \r\n public final static String FEE_BILLING_106HJ_MEMBER = \"H\"; \r\n public final static String FEE_BILLING_LESSEE_MEMBER = \"L\"; \r\n\r\n\r\n public final static String CMTA_GIVEUP_CODE_GIVEUP = \"GU\";\r\n public final static String CMTA_GIVEUP_CODE_SGX_OFFSET = \"SX\"; \r\n\r\n}",
"void onPaymentRequestParamsInitiated(PaymentRequestParams params);",
"public void transact() {\n\t\truPay.transact();\n\n\t}",
"public interface PayService {\n\n /**\n * 支付订单\n * @param orderDTO 被支付的订单对应的orderDTO对象\n */\n PayResponse create(OrderDTO orderDTO);\n\n /**\n * 异步返回支付信息\n * @param notifyData\n */\n PayResponse notify(String notifyData);\n\n /**\n * 退款\n * @param orderDTO\n */\n RefundResponse refund(OrderDTO orderDTO);\n}",
"@Override\n\t\t\tpublic void mainBuyPro() {\n\t\t\t\tif (iap_is_ok && mHelper != null) {\n\t\t\t\t\t\n\t\t\t\t\t String payload = \"\";\n\t\t\t\t\t mHelper.launchPurchaseFlow(MainActivity.this, Paid_Id_VF, RC_REQUEST, mPurchaseFinishedListener);\n\t\t\t\t}else{\n\t\t\t\t}\n\t\t\t}",
"@Override\n\tpublic void pay() {\n\t\tcreditCard.makePayment();\n\n\t}",
"private void generateAndSubmitOrder()\n {\n OrderSingle order = Factory.getInstance().createOrderSingle();\n order.setOrderType(OrderType.Limit);\n order.setPrice(BigDecimal.ONE);\n order.setQuantity(BigDecimal.TEN);\n order.setSide(Side.Buy);\n order.setInstrument(new Equity(\"METC\"));\n order.setTimeInForce(TimeInForce.GoodTillCancel);\n if(send(order)) {\n recordOrderID(order.getOrderID());\n }\n }",
"public interface AutoLoadConfigurationChangePushToGateService {\r\n /**\r\n * @return request sequence number\r\n */\r\n Integer requestAutoLoadConfigurationChange(String cardNumber, Integer autoLoadState, Long pickUpLocation);\r\n}",
"public interface EnchantmentTrigger {}",
"public interface AliAppPayService {\n\n /**\n * 支付宝支付-APP支付\n *\n * @param request\n * @param response\n * @throws AlipayApiException\n * @throws IOException\n */\n void executeAppPay(HttpServletRequest request, HttpServletResponse response) throws AlipayApiException, IOException;\n\n /**\n * 支付宝APP支付之异步通知\n *\n * @param request\n * @param response\n * @return\n * @throws AlipayApiException\n */\n String receiveSyncNotify(HttpServletRequest request, HttpServletResponse response) throws AlipayApiException;\n}",
"@Test\n\tpublic void generatePaymentReport(){\n\t\t\t\tWebDriver driver = new FirefoxDriver();\n\t\t\t\t// Alternatively the same thing can be done like this\n\t\t // driver.get(\"http://www.google.com\");\n\t\t\t\tdriver.navigate().to(determineUrl());\n\t\t\t\t// Find the text input element by its name\n\t\t\t\tWebElement user_name = driver.findElement(By.id(\"user_email\"));\n\t\t\t\tuser_name.sendKeys(user);\n\t\t\t\t\n\t\t\t\tWebElement password = driver.findElement(By.id(\"user_password\"));\n\t\t\t\tpassword.sendKeys(password_login);\n\t\t\t\tpassword.submit();\n\t\t\t\t\n\t\t\t\tWebElement select_venue = driver.findElement(By.id(\"change_venue\"));\n\t\t\t\tselect_venue.sendKeys(venue);\n\t\t\t\tselect_venue.submit();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tWebElement report = driver.findElement(By.linkText(\"Reporting\"));\n\t\t\t\treport.click();\n\t\t\t\t\n\t\t\t\tWebElement select_report = driver.findElement(By.id(\"report_type_chooser\"));\n\t\t\t\tselect_report.sendKeys(\"Payments Report\");\n\t\t\t\tWebElement select_event = driver.findElement(By.id(\"report_event\"));\n\t\t\t\tselect_event.sendKeys(event);\n\t\t\t\tselect_event.submit();\n\t\t\t\tdriver.close();\n\t\t\n\t}",
"@Test\n\tpublic void creditEntrySEPA() throws Exception {\n\t\ttry {\n\t\t\t// Launch the browser and load the default URL\n\t\t\tUtility.initConfiguration();\n\t\t\tThread.sleep(3000);\n\t\t\t// Login to back end and check payment method is enabled or disabled\n\t\t\tUtility.wooCommerceBackEndLogin();\n\t\t\tThread.sleep(3000);\n\t\t\tElementLocators element = PageFactory.initElements(driver, ElementLocators.class);\n\t\t\t// Title for HTML report\n\t\t\ttest = extend.createTest(\"Vendor script execution for 'CREDIT_ENTRY_SEPA'\");\n\t\t\t// Steps\n\t\t\tActions actions = new Actions(driver);\n\t\t\tactions.moveToElement(element.WooCommerce).perform();\n\t\t\tThread.sleep(3000);\n\t\t\telement.WooCommerce_Settings.click();\n\t\t\telement.Payment_Tab.click();\n\t\t\tThread.sleep(2000);\n\t\t\telement.Sepa_Payment_Display.click();\n\t\t\t// Checking payment method enabled or disabled\n\t\t\tif (!element.Sepa_Enable_Payment_Method_Checkbox.isSelected()) {\n\t\t\t\telement.Sepa_Enable_Payment_Method_Checkbox.click();\n\t\t\t\tThread.sleep(3000);\n\t\t\t}\n\t\t\t// Checking Guarantee payment enabled or disabled\n\t\t\tif (element.Sepa_Enable_Payment_Guarantee_CheckBox.isSelected()) {\n\t\t\t\telement.Sepa_Enable_Payment_Guarantee_CheckBox.click();\n\t\t\t\tThread.sleep(3000);\n\t\t\t}\n\t\t\telement.Sepa_Payment_Save_Changes.click();\n\t\t\tThread.sleep(3000);\n\t\t\tdriver.navigate().to(Constant.shopfrontendurl);\n\t\t\tThread.sleep(3000);\n\t\t\tUtility.wooCommerceCheckOutProcess();\n\t\t\tThread.sleep(4000);\n\t\t\t// Read the datafrom excel sheet\n\t\t\tMap<String, String> UserData = new HashMap<String, String>();\n\t\t\tUserData = Data.ExcelReader_PaymentMethods();\n\t\t\t// Check whether payment method is displayed in checkout page\n\t\t\tif (element.Sepa_Label.isDisplayed()) {\n\t\t\t\tif (element.Sepa_Radio_button.isDisplayed() == true) {\n\t\t\t\t\telement.Sepa_Radio_button.click();\n\t\t\t\t}\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);\n\t\t\t\telement.Sepa_Iban_TextBox.sendKeys(UserData.get(\"SEPAIBAN\"));\n\t\t\t\telement.Place_Order.click();\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(25, TimeUnit.SECONDS);\n\t\t\t\t// After order placed successfully verify Thank you message displayed\n\t\t\t\tString thankyoumessage = element.FE_Thank_You_Page_Text.getText();\n\t\t\t\tif (thankyoumessage.equals(\"Thank you. Your order has been received.\")) {\n\t\t\t\t\tSystem.out.println(\"Order placed successfully using Direct Debit SEPA\");\n\t\t\t\t\ttest.log(Status.INFO, \"Order placed successfully using Direct Debit SEPA\");\n\t\t\t\t\tThread.sleep(3000); // Get the amount from order success page front end\n\t\t\t\t\tString totalOrderAmount = element.OrderDetails_TotalAmount.getText().replaceAll(\"[^0-9]\", \"\");\n\t\t\t\t\tString TID = element.OrderDetails_Note_TID.getText().replaceAll(\"[^0-9]\", \"\");\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);\n\t\t\t\t\t// Go to callback execution site and enter vendor script URL\n\t\t\t\t\tdriver.navigate().to(Constant.vendorscripturl);\n\t\t\t\t\tThread.sleep(4000);\n\t\t\t\t\telement.Vendor_Script_Url.sendKeys((Constant.shopfrontendurl) + \"?wc-api=novalnet_callback\");\n\t\t\t\t\telement.Vendor_Id.clear();\n\t\t\t\t\telement.Vendor_Id.sendKeys(\"4\");\n\t\t\t\t\telement.Vendor_Auth_Code.clear();\n\t\t\t\t\telement.Vendor_Auth_Code.sendKeys(\"JyEtHUjjbHNJwVztW6JrafIMHQvici\");\n\t\t\t\t\telement.Product_Id.clear();\n\t\t\t\t\telement.Product_Id.sendKeys(\"14\");\n\t\t\t\t\telement.Tariff_Id.clear();\n\t\t\t\t\telement.Tariff_Id.sendKeys(\"30\");\n\t\t\t\t\telement.Payment_Type_Edit_Button.click();\n\t\t\t\t\tSelect selectpaymenttype = new Select(element.Payment_Type_Selectbox);\n\t\t\t\t\tselectpaymenttype.selectByVisibleText(\"CREDIT_ENTRY_SEPA\");\n\t\t\t\t\telement.Test_Mode.clear();\n\t\t\t\t\telement.Test_Mode.sendKeys(\"1\");\n\t\t\t\t\telement.Tid_Payment.clear();\n\t\t\t\t\telement.Tid_Payment.sendKeys(TID);\n\t\t\t\t\telement.Amount.clear();\n\t\t\t\t\telement.Amount.sendKeys(totalOrderAmount);\n\t\t\t\t\telement.Currency.clear();\n\t\t\t\t\telement.Currency.sendKeys(\"EUR\");\n\t\t\t\t\telement.Status.clear();\n\t\t\t\t\telement.Status.sendKeys(\"100\");\n\t\t\t\t\telement.Tid_Status.clear();\n\t\t\t\t\telement.Tid_Status.sendKeys(\"100\");\n\t\t\t\t\telement.Tid.clear();\n\t\t\t\t\telement.Tid.sendKeys(\"13245678945612345\");\n\t\t\t\t\telement.Execute_Button.click();\n\t\t\t\t\tString callback_message = element.callback_message.getText();\t\t\t\t\t\n\t\t\t\t\tString callback_message_updated = callback_message.substring(9, callback_message.length());\n\t\t\t\t\tSystem.out.println(\"Callback execution message: \" + callback_message_updated);\n\t\t\t\t\tif (callback_message.contains(\"Novalnet Callback Script executed successfully for the TID:\")) {\n\t\t\t\t\t\tThread.sleep(2000);\n\t\t\t\t\t\tdriver.navigate().to(Constant.shopbackendurl);\n\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\tactions.moveToElement(element.WooCommerce).perform();\n\t\t\t\t\t\tThread.sleep(1500);\n\t\t\t\t\t\telement.WooCommerce_Orders.click();\n\t\t\t\t\t\telement.Backend_Order_Number.click();\n\t\t\t\t\t\tString BEOrderNotesMessage = element.BE_OrderNotes_Message.getText();\n\t\t\t\t\t\tSystem.out.println(\"Back end order note: \" + BEOrderNotesMessage);\n\t\t\t\t\t\tif (callback_message_updated.equals(BEOrderNotesMessage)) {\n\t\t\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\t\t\"TC PASSED: CREDIT_ENTRY_SEPA execution message and back end order note message text was matched successfully\");\n\t\t\t\t\t\t\ttest.log(Status.PASS,\n\t\t\t\t\t\t\t\t\t\"TC PASSED: CREDIT_ENTRY_SEPA execution message and back end order note message text was matched successfully\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\t\t\"TC FAILED: CREDIT_ENTRY_SEPA execution message and back end order note message text was not matched\");\n\t\t\t\t\t\t\ttest.log(Status.FAIL,\n\t\t\t\t\t\t\t\t\t\"TC FAILED: CREDIT_ENTRY_SEPA execution message and back end order note message text was not matched\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println(\"ERROR: Callback response message is displayed wrongly\");\n\t\t\t\t\t\ttest.log(Status.ERROR, \"ERROR: Callback response message is displayed wrongly\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"TC FAILED: Order was not placed successfully using Direct Debit SEPA\");\n\t\t\t\t\ttest.log(Status.FAIL, \"TC FAILED: Order was not placed successfully using Direct Debit SEPA\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Close browser\n\t\t\tUtility.closeBrowser();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"ERROR: Unexpected error from 'creditEntrySEPA' method\");\n\t\t\ttest.log(Status.ERROR, \"ERROR: Unexpected error from 'creditEntrySEPA' method\");\n\t\t}\n\t}",
"public interface WithHoldOrderContract {\r\n\r\n ResponseData resendWithholdOrder();\r\n \r\n}",
"private void weChatPay(WeChatPayBean.BodyBean body) {\n IWXAPI api = WXAPIFactory.createWXAPI(this, \"wxb4ba3c02aa476ea1\");\n if (body != null && body.getAppid() != null) {\n PayReq req = new PayReq();\n //req.appId = \"wxf8b4f85f3a794e77\"; // 测试用appId\n req.appId = body.getAppid();\n req.partnerId = body.getPartnerid();\n req.prepayId = body.getPrepayid();\n req.nonceStr = body.getNoncestr();\n req.timeStamp = body.getTimestamp();\n req.packageValue = body.getPackageX();\n req.sign = body.getSign();\n // 在支付之前,如果应用没有注册到微信,应该先调用IWXMsg.registerApp将应用注册到微信\n api.sendReq(req);\n }\n\n\n }",
"Receipt chargeOrder(PizzaOrder order, CreditCard creditCard);",
"private void automaticPayment(String accountName, String reciever, String billName, final int amount, String date) {\n Log.d(TAG, \"makeTransaction: Has been called\");\n final DocumentReference senderDocRef = db.collection(\"users\").document(user.getEmail())\n .collection(\"accounts\").document(accountName);\n\n final DocumentReference recieverDocRef = db.collection(\"companies\").document(reciever);\n\n final DocumentReference billDocRef = db.collection(\"companies\").document(reciever).collection(\"customer\")\n .document(user.getEmail()).collection(\"bills\").document(billName);\n\n db.runTransaction(new Transaction.Function<Void>() {\n @Override\n public Void apply(Transaction transaction) throws FirebaseFirestoreException {\n DocumentSnapshot sender = transaction.get(senderDocRef);\n DocumentSnapshot reciever = transaction.get(recieverDocRef);\n\n\n int senderBalance = sender.getLong(\"balance\").intValue();\n int recieverBalance = reciever.getLong(\"amount\").intValue();\n int transactionBalance = Math.abs(amount);\n\n if (senderBalance >= transactionBalance) {\n transaction.update(senderDocRef, \"balance\", senderBalance - transactionBalance);\n transaction.update(recieverDocRef, \"amount\", recieverBalance + transactionBalance);\n transaction.update(billDocRef, \"isPaid\", true);\n\n\n SimpleDateFormat dateformat = new SimpleDateFormat(\"dd-MM-yyyy\");\n Date newDate = new Date();\n Calendar cal = Calendar.getInstance();\n cal.setTime(newDate);\n cal.add(Calendar.MONTH, 1);\n newDate = cal.getTime();\n transaction.update(billDocRef, \"recurring\", dateformat.format(newDate));\n } else {\n Log.d(TAG, \"apply: Transaction ikke fuldført\");\n }\n\n // Success\n return null;\n }\n }).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Log.d(TAG, \"Transaction success!\");\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.w(TAG, \"Transaction failure.\", e);\n }\n });\n\n }",
"public void XxGamMaCreateTicket(Number nPayment, \n OAPageContext pageContext) {\n //Buscamos el Payment con el id para poder asociarlo con el nuevo ticket\n // searchPayment(nPayment);\n //Obteniendo el registro actual de XxGamMaTicketPVORowImpl\n XxGamMaPaymentReqVORowImpl rowXxGamMaPaymentReqVO = null;\n rowXxGamMaPaymentReqVO = (XxGamMaPaymentReqVORowImpl)getCurrentRow();\n\n RowIterator riXxGamMaPaymentPVO = null;\n //Verificando que el row no venga vacio\n if (rowXxGamMaPaymentReqVO == null) {\n throw new OAException(\"No es posible crear el ticket\", \n OAException.ERROR);\n\n }\n //Obteniendo el row iterador de ticket para los vuelos\n riXxGamMaPaymentPVO = rowXxGamMaPaymentReqVO.getXxGamMaTicketPVO();\n if (riXxGamMaPaymentPVO == null) {\n throw new OAException(\"No es posible crear el ticket\", \n OAException.ERROR);\n\n }\n XxGamMaTicketPVOImpl voXxGamMaTicketPVOImpl = null;\n //Creamos variable de AM para obtener su referencia\n XxGamModAntAMImpl amXxGamModAnt = null;\n try {\n /** AGAA Obtiene la Filial **/\n String filial = \n (String)pageContext.getTransactionValue(\"orgNameEmp\");\n\n //Obtenemos el AM\n amXxGamModAnt = getXxGamModAntAM();\n //Obtenemos la referencia a la implementacion de la VO deTicket\n voXxGamMaTicketPVOImpl = amXxGamModAnt.getXxGamMaTicketPVO3();\n //Llamamos el metodo para agregar un nuevo vuelo\n voXxGamMaTicketPVOImpl.addNewTicket(filial);\n } catch (Exception e) {\n e.printStackTrace();\n throw new OAException(\"No es posible crear el ticket\", \n OAException.ERROR);\n }\n }",
"@Override\n\tpublic void processPayment() {\n\t\t\n\t\tsetIsSuccessful();\n\t}",
"private void returnDeposit(String paymentInfo) {\n }",
"public static Map<String, Object> autoSendPaymentReceivedEmail(DispatchContext dctx, Map<String, ? extends Object> context) throws ApiException, SdkException, Exception {\n Delegator delegator = dctx.getDelegator();\n LocalDispatcher dispatcher = dctx.getDispatcher();\n Locale locale = (Locale) context.get(\"locale\");\n GenericValue userLogin = EntityQuery.use(delegator).from(\"UserLogin\").where(\"userLoginId\", \"system\").queryOne();\n\n if (UtilValidate.isEmpty(context.get(\"productStoreId\")) && UtilValidate.isEmpty(context.get(\"jobId\"))) {\n return ServiceUtil.returnFailure(UtilProperties.getMessage(RESOURCE, \"EbayStoreRequiredProductStoreId\", locale));\n }\n\n String jobId = (String) context.get(\"jobId\");\n String productStoreId = (String) context.get(\"productStoreId\");\n\n String isAutoSendEmail = \"N\";\n GenericValue ebayProductStorePref = null;\n\n try {\n ApiContext apiContext = EbayStoreHelper.getApiContext(productStoreId, locale, delegator);\n ebayProductStorePref = EntityQuery.use(delegator).from(\"EbayProductStorePref\").where(\"productStoreId\", productStoreId, \"autoPrefEnumId\", \"EBAY_AUTO_FB_RMD\").queryOne();\n if (UtilValidate.isNotEmpty(ebayProductStorePref) && UtilValidate.isNotEmpty(ebayProductStorePref.getString(\"autoPrefJobId\"))) {\n isAutoSendEmail = ebayProductStorePref.getString(\"enabled\");\n // if isAutoPositiveFeedback is N that means not start this job run service\n if (\"Y\".equals(isAutoSendEmail) && jobId.equals(ebayProductStorePref.getString(\"autoPrefJobId\"))) {\n // start getting sold item list from ebay follow your site\n GetSellingManagerSoldListingsCall sellingManagerSoldListings = new GetSellingManagerSoldListingsCall(apiContext);\n List<SellingManagerSoldOrderType> items = new LinkedList<SellingManagerSoldOrderType>();\n SellingManagerSoldOrderType[] sellingManagerSoldOrders = sellingManagerSoldListings.getSellingManagerSoldListings();\n if (UtilValidate.isNotEmpty(sellingManagerSoldOrders)) {\n for (SellingManagerSoldOrderType solditem : sellingManagerSoldOrders) {\n SellingManagerOrderStatusType orderStatus = solditem.getOrderStatus();\n if (orderStatus != null) {\n SellingManagerPaidStatusCodeType paidStatus = orderStatus.getPaidStatus();\n //Buyer has paid for this item. and seller received\n if (SellingManagerPaidStatusCodeType.PAID.equals(paidStatus)) {\n items.add(solditem);\n }\n }\n }\n\n // call service send email (get template follow productStoreId)\n for (SellingManagerSoldOrderType item : items) {\n // call send\n Map<String, Object> sendMap = new HashMap<>();\n GenericValue productStoreEmail = EntityQuery.use(delegator).from(\"ProductStoreEmailSetting\").where(\"productStoreId\", productStoreId, \"emailType\", \"EBAY_PAY_RECIEVED\").queryOne();\n String bodyScreenLocation = productStoreEmail.getString(\"bodyScreenLocation\");\n sendMap.put(\"bodyScreenUri\", bodyScreenLocation);\n String subjectString = productStoreEmail.getString(\"subject\");\n sendMap.put(\"userLogin\", userLogin);\n sendMap.put(\"subject\", subjectString);\n sendMap.put(\"contentType\", productStoreEmail.get(\"contentType\"));\n sendMap.put(\"sendFrom\", productStoreEmail.get(\"fromAddress\"));\n sendMap.put(\"sendCc\", productStoreEmail.get(\"ccAddress\"));\n sendMap.put(\"sendBcc\", productStoreEmail.get(\"bccAddress\"));\n sendMap.put(\"sendTo\", item.getBuyerEmail());\n\n Map<String, Object> bodyParameters = new HashMap<>();\n bodyParameters.put(\"buyerUserId\", item.getBuyerID());\n sendMap.put(\"bodyParameters\", bodyParameters);\n\n try {\n dispatcher.runAsync(\"sendMailFromScreen\", sendMap);\n } catch (GenericServiceException e) {\n Debug.logError(e, MODULE);\n return ServiceUtil.returnError(e.getMessage());\n }\n }\n }\n }\n }\n } catch (Exception e) {\n return ServiceUtil.returnFailure(UtilProperties.getMessage(RESOURCE, \"EbayStoreProblemConnectingToEbaySite\", locale) + e);\n }\n\n return ServiceUtil.returnSuccess();\n }",
"@Override\r\n\tpublic String paypalSubscriptionRegister(\r\n\t\t\tStudentProfileDetail studentProfileDetail, int planId,\r\n\t\t\tPlanRate planRate, int selectDuration) {\r\n\t\tString token =\"\";\r\n\t\tPaymentDetailsType paymentDetails = new PaymentDetailsType();\r\n\t\t paymentDetails.setPaymentAction(PaymentActionCodeType.fromValue(\"Sale\"));\r\n\r\n\t\t BasicAmountType orderTotal = new BasicAmountType();\r\n\t\t \r\n\t\tString currencyName=studentProfileDetail.getCountryMaster().getCurrency().getCurrencyName();\r\n\t\t\r\n\t\tif(currencyName.equalsIgnoreCase(\"US\")){\r\n\t\t\torderTotal.setCurrencyID(CurrencyCodeType.fromValue(\"USD\"));\r\n\t\t}\r\n\t\telse if(currencyName.equalsIgnoreCase(\"MXN\")){\r\n\t\t\torderTotal.setCurrencyID(CurrencyCodeType.fromValue(\"MXN\"));\r\n\t\t}\r\n\t\telse if(currencyName.equalsIgnoreCase(\"EURO\")){\r\n\t\t\torderTotal.setCurrencyID(CurrencyCodeType.fromValue(\"EUR\"));\r\n\t\t}\r\n\t\t \r\n\t\t orderTotal.setValue(\"0\");\r\n\t\t paymentDetails.setOrderTotal(orderTotal);\r\n\t\t List<PaymentDetailsType> paymentDetailsList = new ArrayList<PaymentDetailsType>();\r\n\t\t paymentDetailsList.add(paymentDetails);\r\n\r\n\t\t SetExpressCheckoutRequestDetailsType setExpressCheckoutRequestDetails = new SetExpressCheckoutRequestDetailsType();\r\n\t\t setExpressCheckoutRequestDetails.setReturnURL(returnURLSubRegister+\"?planId=\"+planId+\"&selectDuration=\"+selectDuration+\"&userId=\"+studentProfileDetail.getUser().getUser_Id());\r\n\r\n\t\t setExpressCheckoutRequestDetails.setCancelURL(cancelUrlRegister);\r\n\r\n\t\t setExpressCheckoutRequestDetails.setPaymentDetails(paymentDetailsList);\r\n\t\t setExpressCheckoutRequestDetails.setNoShipping(\"1\"); \r\n\t\t BillingAgreementDetailsType billingAgreement = new BillingAgreementDetailsType(BillingCodeType.fromValue(\"RecurringPayments\"));\r\n\t\t\r\n\t\tbillingAgreement.setBillingAgreementDescription(\"This is subscription plan\");\r\n\t\tList<BillingAgreementDetailsType> billList = new ArrayList<BillingAgreementDetailsType>();\r\n\t\t billList.add(billingAgreement);\r\n\t\t setExpressCheckoutRequestDetails.setBillingAgreementDetails(billList);\r\n\r\n\t\t SetExpressCheckoutRequestType setExpressCheckoutRequest = new SetExpressCheckoutRequestType(setExpressCheckoutRequestDetails);\r\n\t\t setExpressCheckoutRequest.setVersion(\"104.0\");\r\n\t\t //setExpressCheckoutRequest.getSetExpressCheckoutRequestDetails().setNoShipping(\"1\");\r\n\t\t SetExpressCheckoutReq setExpressCheckoutReq = new SetExpressCheckoutReq();\r\n\t\t setExpressCheckoutReq.setSetExpressCheckoutRequest(setExpressCheckoutRequest);\r\n\t\t Map<String, String> sdkConfig = new HashMap<String, String>();\r\n\t\t sdkConfig.put(\"mode\", mode);\r\n\t\t sdkConfig.put(\"acct1.UserName\", acctUserName);\r\n\t\t sdkConfig.put(\"acct1.Password\", acctPassword);\r\n\t\t sdkConfig.put(\"acct1.Signature\",acctSignature);\r\n\t\t \r\n\t\t \r\n\t\t PayPalAPIInterfaceServiceService service = new PayPalAPIInterfaceServiceService(sdkConfig);\r\n\t\t \r\n\t\t //PayPalAPIInterfaceServiceService service=new PayPalAPIInterfaceServiceService();\r\n\t\t SetExpressCheckoutResponseType setExpressCheckoutResponse;\r\n\t\ttry {\r\n\t\t\tsetExpressCheckoutResponse = service.setExpressCheckout(setExpressCheckoutReq);\r\n\t\t\t\r\n\t\t\ttoken=setExpressCheckoutResponse.getToken();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} \r\n\t\t\r\n\t\treturn token;\r\n\t}",
"public JSONResponse pay(HashMap<String, String> parameters) {\n\t\tString pos = parameters.get(\"pos\"); \t\t\t\t\t\t// the point of sale code.\n\t\tString reservationid = parameters.get(\"reservationid\");\t\t// the ID of the reservation.\n\t\tString date = parameters.get(\"date\"); \t\t\t\t\t\t// the date of the payment.\n\t\tString emailaddress = parameters.get(\"emailaddress\"); \t\t// the email address of the payer.\n\t\tString cardholder = parameters.get(\"cardholder\");\t\t\t// the card holder name.\n\t\tString cardnumber = parameters.get(\"cardnumber\");\t\t\t// the card number.\n\t\tString cardmonth = parameters.get(\"cardmonth\");\t\t\t\t// the card expiry month.\n\t\tString cardyear = parameters.get(\"cardyear\");\t\t\t\t// the card expiry year.\n\t\tString cardcode = parameters.get(\"cardcode\");\t\t\t\t// the card CCV code.\n\t\tString amount = parameters.get(\"amount\");\t\t\t\t\t// the amount to be charged to the card.\n\t\tString remote_host = parameters.get(\"remote_host\");\t\t\t// the remote host URL.\n\n\t\tDouble value = Double.valueOf(amount);\n\t\tif (pos == null || pos.isEmpty() || Model.decrypt(pos).length() > 10) {throw new ServiceException(Error.pos_invalid, pos);}\n\t\tif (reservationid == null || reservationid.isEmpty() || reservationid.length() > 10) {throw new ServiceException(Error.reservation_id, reservationid);}\n\t\tif (emailaddress == null || emailaddress.isEmpty() || !Party.isEmailAddress(emailaddress)) {throw new ServiceException(Error.party_emailaddress, emailaddress);}\n\t\tif (cardholder == null || cardholder.isEmpty() || cardholder.length() > 100) {throw new ServiceException(Error.card_holder, cardholder);}\n\t\tif (cardnumber == null || cardnumber.isEmpty() || cardnumber.length() > 20) {throw new ServiceException(Error.card_number, cardnumber);}\n\t\tif (cardmonth == null || cardmonth.isEmpty() || cardmonth.length() != 2) {throw new ServiceException(Error.card_month, cardmonth);}\n\t\tif (cardyear == null || cardyear.isEmpty() || cardyear.length() != 4) {throw new ServiceException(Error.card_year, cardyear);}\n\t\tif (cardcode == null || cardcode.isEmpty() || cardcode.length() < 3) {throw new ServiceException(Error.card_code, cardcode);}\n\t\tif (value == null || value <= 0.0) {throw new ServiceException(Error.card_amount, amount);}\n\n\t\tSqlSession sqlSession = RazorServer.openSession();\n\t\tPayWidgetItem result = new PayWidgetItem();\n\t\ttry {\n\t\t\tJSONService.getParty(sqlSession, pos);\n\t\t\tReservation reservation = sqlSession.getMapper(ReservationMapper.class).read(reservationid);\n//\t\t\tParty customer = JSONService.getCustomer (sqlSession, emailaddress, familyname, firstname, reservation.getOrganizationid(), agent.getId());\n//\t\t\treservation.setCustomerid(customer.getId());\n//\t\t\tFinance finance = JSONService.getFinance(sqlSession, customer.getId(), cardholder, cardnumber, cardmonth, cardyear,\tcardcode);\n//\t\t\treservation.setFinanceid(finance.getId());\n//\t\t\treservation.setNotes(notes);\n//\t\t\tsqlSession.getMapper(ReservationMapper.class).update(reservation);\n\n\t\t\tElement element = PaygateHandler.getXML(reservation.getName(), cardholder, cardnumber, cardmonth + cardyear, value, reservation.getCurrency(), cardcode, emailaddress, remote_host);\n\n\t\t\tEvent<Journal> event = JSONService.cardReceipt(sqlSession, reservation, element, cardholder, value);\n\t\t\tresult.setId(reservation.getOrganizationid());\n\t\t\tresult.setName(event.getName());\n\t\t\tresult.setState(RazorWidget.State.SUCCESS.name());\n\t\t\tresult.setAmount(value);\n\t\t\tresult.setCurrency(reservation.getCurrency());\n\t\t\tresult.setMessage(JSONService.getNotes(element));\n\t\t\tsqlSession.commit();\n\t\t}\n\t\tcatch (Throwable x) {\n\t\t\tsqlSession.rollback();\n\t\t\tresult.setId(null);\n\t\t\tresult.setName(null);\n\t\t\tresult.setState(RazorWidget.State.FAILURE.name());\n\t\t\tresult.setAmount(value == null ? 0.0 : value);\n\t\t\tresult.setCurrency(Currency.Code.USD.name());\n\t\t\tresult.setMessage(x.getMessage());\n\t\t}\n\t\tfinally {sqlSession.close();}\n\t\treturn result;\n\t}",
"public JSONObject getAdvanceForGSTR3BTaxable(JSONObject reqParams) throws JSONException, ServiceException {\n String companyId=reqParams.optString(\"companyid\");\n JSONObject jSONObject = new JSONObject();\n double taxableAmountAdv = 0d;\n double IGSTAmount = 0d;\n double CGSTAmount = 0d;\n double SGSTAmount = 0d;\n double CESSAmount = 0d;\n reqParams.put(\"entitycolnum\", reqParams.optString(\"receiptentitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"receiptentityValue\"));\n if (reqParams.optBoolean(\"at\")) {\n /**\n * Get Advance for which invoice not linked yet\n */\n\n reqParams.put(\"at\", true);\n List<Object> receiptList = accEntityGstDao.getAdvanceDetailsInSql(reqParams);\n JSONArray bulkData = gSTR1DeskeraServiceDao.createJsonForAdvanceDataFetchedFromDB(receiptList, reqParams);\n Map<String, JSONArray> advanceMap = AccountingManager.getSortedArrayMapBasedOnJSONAttribute(bulkData, GSTRConstants.receiptadvanceid);\n for (String advdetailkey : advanceMap.keySet()) {\n double rate = 0d;\n JSONArray adDetailArr = advanceMap.get(advdetailkey);\n JSONObject advanceobj = adDetailArr.getJSONObject(0);\n taxableAmountAdv += advanceobj.optDouble(GSTRConstants.receiptamount) - advanceobj.optDouble(GSTRConstants.receipttaxamount);\n for (int index = 0; index < adDetailArr.length(); index++) {\n JSONObject invdetailObj = adDetailArr.getJSONObject(index);\n String defaultterm = invdetailObj.optString(GSTRConstants.defaultterm);\n\n /**\n * Iterate applied GST and put its Percentage and Amount\n * accordingly\n */\n double termamount = invdetailObj.optDouble(GSTRConstants.termamount);\n double taxrate = invdetailObj.optDouble(GSTRConstants.taxrate);\n /**\n * calculate tax amount by considering partial case\n */\n termamount = (advanceobj.optDouble(GSTRConstants.receiptamount) - advanceobj.optDouble(GSTRConstants.receipttaxamount)) * invdetailObj.optDouble(GSTRConstants.taxrate) / 100;\n if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputIGST\").toString())) {\n IGSTAmount += termamount;\n } else if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCGST\").toString())) {\n CGSTAmount += termamount;\n } else if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputSGST\").toString())) {\n SGSTAmount += termamount;\n } else if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputUTGST\").toString())) {\n SGSTAmount += termamount;\n } else if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCESS\").toString())) {\n CESSAmount += termamount;\n }\n }\n }\n\n// reqParams.put(\"entitycolnum\", reqParams.optString(\"receiptentitycolnum\"));\n// reqParams.put(\"entityValue\", reqParams.optString(\"receiptentityValue\"));\n// List<Object> AdvData = accEntityGstDao.getAdvanceDetailsInSql(reqParams);\n// for (Object object : AdvData) {\n// Object[] data = (Object[]) object;\n// String term = data[1].toString();\n// double termamount = (Double) data[0];\n// if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputIGST\").toString())) {\n// taxableAmountAdv += (Double) data[2];\n// IGSTAmount += termamount;\n// } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCGST\").toString())) {\n// taxableAmountAdv += (Double) data[2];\n// CGSTAmount += termamount;\n// } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputSGST\").toString())) {\n// SGSTAmount += termamount;\n// } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputUTGST\").toString())) {\n// SGSTAmount += termamount;\n// } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCESS\").toString())) {\n// CESSAmount += termamount;\n// }\n// }\n } else {\n /**\n * Get Advance for which invoice isLinked\n */\n reqParams.put(\"atadj\", true);\n List<Object> receiptList = accEntityGstDao.getAdvanceDetailsInSql(reqParams);\n JSONArray bulkData = gSTR1DeskeraServiceDao.createJsonForAdvanceDataFetchedFromDB(receiptList, reqParams);\n Map<String, JSONArray> advanceMap = AccountingManager.getSortedArrayMapBasedOnJSONAttribute(bulkData, GSTRConstants.receiptadvanceid);\n for (String advdetailkey : advanceMap.keySet()) {\n double rate = 0d;\n JSONArray adDetailArr = advanceMap.get(advdetailkey);\n JSONObject advanceobj = adDetailArr.getJSONObject(0);\n taxableAmountAdv += advanceobj.optDouble(GSTRConstants.adjustedamount);\n for (int index = 0; index < adDetailArr.length(); index++) {\n JSONObject invdetailObj = adDetailArr.getJSONObject(index);\n String defaultterm = invdetailObj.optString(GSTRConstants.defaultterm);\n\n /**\n * Iterate applied GST and put its Percentage and Amount\n * accordingly\n */\n double termamount = invdetailObj.optDouble(GSTRConstants.termamount);\n double taxrate = invdetailObj.optDouble(GSTRConstants.taxrate);\n /**\n * calculate tax amount by considering partial case\n */\n termamount = advanceobj.optDouble(GSTRConstants.adjustedamount) * invdetailObj.optDouble(GSTRConstants.taxrate) / 100;\n if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputIGST\").toString())) {\n IGSTAmount += termamount;\n } else if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCGST\").toString())) {\n CGSTAmount += termamount;\n } else if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputSGST\").toString())) {\n SGSTAmount += termamount;\n } else if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputUTGST\").toString())) {\n SGSTAmount += termamount;\n } else if (defaultterm.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCESS\").toString())) {\n CESSAmount += termamount;\n }\n }\n }\n\n// reqParams.put(\"entitycolnum\", reqParams.optString(\"receiptentitycolnum\"));\n// reqParams.put(\"entityValue\", reqParams.optString(\"receiptentityValue\"));\n// List<Object> AdvDataLinked = accEntityGstDao.getAdvanceDetailsInSql(reqParams);\n// for (Object object : AdvDataLinked) {\n// Object[] data = (Object[]) object;\n// String term = data[1].toString();\n// double termamount = (Double) data[0];\n// taxableAmountAdv = (Double) data[2];\n// if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputIGST\").toString())) {\n// taxableAmountAdv += (Double) data[2];\n// IGSTAmount += termamount;\n// } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCGST\").toString())) {\n// taxableAmountAdv += (Double) data[2];\n// CGSTAmount += termamount;\n// } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputSGST\").toString())) {\n// SGSTAmount += termamount;\n// } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputUTGST\").toString())) {\n// SGSTAmount += termamount;\n// } else if (term.equalsIgnoreCase(LineLevelTerms.GSTName.get(\"OutputCESS\").toString())) {\n// CESSAmount += termamount;\n// }\n// }\n }\n\n jSONObject.put(\"taxableamt\", authHandler.formattedAmount(taxableAmountAdv,companyId));\n jSONObject.put(\"igst\", authHandler.formattedAmount(IGSTAmount,companyId));\n jSONObject.put(\"cgst\", authHandler.formattedAmount(CGSTAmount,companyId));\n jSONObject.put(\"sgst\", authHandler.formattedAmount(SGSTAmount,companyId));\n jSONObject.put(\"csgst\", authHandler.formattedAmount(CESSAmount,companyId));\n jSONObject.put(\"totaltax\", authHandler.formattedAmount(IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n jSONObject.put(\"totalamount\", authHandler.formattedAmount(taxableAmountAdv+IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n return jSONObject;\n }",
"@ResponseBody\n @RequestMapping(value = \"/pay_notify.html\")\n public Object payCallback(AliPayBackModel model,HttpServletRequest request){\n if(this.validateSign(request)){\n this.payRecordService.pay(model);\n return \"success\";\n }\n return \"fail\";\n }",
"@Async\n public boolean sendTransferFromNotificationSMS(Customer source, Customer dest, Double rewardQty, RewardCurrency rewardCurrency, MessageWrapper messageWrapper) throws InspireNetzException {\n HashMap<String,String> fields = new HashMap<>(0);\n\n // Add the qty\n fields.put(\"#qty\",generalUtils.getFormattedValue(rewardQty));\n\n // Add the currencyname\n fields.put(\"#currencyname\",rewardCurrency.getRwdCurrencyName());\n\n // Add the recepient name\n fields.put(\"#receipientname\",dest.getCusLoyaltyId());\n\n /* // Get the reward balance\n CustomerRewardBalance customerRewardBalance = customerRewardBalanceService.findByCrbLoyaltyIdAndCrbMerchantNoAndCrbRewardCurrency(source.getCusLoyaltyId(),source.getCusMerchantNo(),rewardCurrency.getRwdCurrencyId());\n*/\n //get the reward balance\n List<CustomerRewardBalance> customerRewardBalances = customerRewardBalanceService.searchBalances(source.getCusMerchantNo(),source.getCusLoyaltyId(),rewardCurrency.getRwdCurrencyId());\n\n //if the list contains any entries set reward balance to the placeholder\n if(customerRewardBalances != null && customerRewardBalances.size()>0){\n\n // Send the points formatted\n fields.put(\"#points\",generalUtils.getFormattedValue(customerRewardBalances.get(0).getCrbRewardBalance()));\n\n }\n\n // Set the date\n String toDay = generalUtils.convertDateToFormat(new Date(System.currentTimeMillis()),\"dd MMM yyyy\");\n\n // Set the value for #date placeholder\n fields.put(\"#date\", toDay);\n\n //log the activity\n customerActivityService.logActivity(source.getCusLoyaltyId(), CustomerActivityType.TRANSFER_POINT, \"Transferred \" + generalUtils.getFormattedValue(rewardQty) + \" points to :\" + dest.getCusLoyaltyId(), source.getCusMerchantNo(), \"\");\n\n messageWrapper.setParams(fields);\n\n messageWrapper.setSpielName(MessageSpielValue.SPIEL_TRANSFER_POINT_FROM);\n\n\n messageWrapper.setMerchantNo(source.getCusMerchantNo());\n\n messageWrapper.setLoyaltyId(source.getCusLoyaltyId());\n\n messageWrapper.setChannel(MessageSpielChannel.ALL);\n\n messageWrapper.setIsCustomer(IndicatorStatus.YES);\n\n return userMessagingService.transmitNotification(messageWrapper);\n\n }",
"@Test\n\tpublic void returnDebitSEPA() throws Exception {\n\t\ttry {\n\t\t\t// Launch the browser and load the default URL\n\t\t\tUtility.initConfiguration();\n\t\t\tThread.sleep(3000);\n\t\t\t// Login to back end and check payment method is enabled or disabled\n\t\t\tUtility.wooCommerceBackEndLogin();\n\t\t\tThread.sleep(3000);\n\t\t\tElementLocators element = PageFactory.initElements(driver, ElementLocators.class);\n\t\t\t// Title for HTML report\n\t\t\ttest = extend.createTest(\"Vendor script execution for SEPA 'RETURN_DEBIT_SEPA'\");\n\t\t\t// Steps\n\t\t\tActions actions = new Actions(driver);\n\t\t\tactions.moveToElement(element.WooCommerce).perform();\n\t\t\tThread.sleep(3000);\n\t\t\telement.WooCommerce_Settings.click();\n\t\t\telement.Payment_Tab.click();\n\t\t\tThread.sleep(2000);\n\t\t\telement.Sepa_Payment_Display.click();\n\t\t\t// Checking payment method enabled or disabled\n\t\t\tif (!element.Sepa_Enable_Payment_Method_Checkbox.isSelected()) {\n\t\t\t\telement.Sepa_Enable_Payment_Method_Checkbox.click();\n\t\t\t\tThread.sleep(3000);\n\t\t\t}\n\t\t\t// Checking Guarantee payment enabled or disabled\n\t\t\tif (element.Sepa_Enable_Payment_Guarantee_CheckBox.isSelected()) {\n\t\t\t\telement.Sepa_Enable_Payment_Guarantee_CheckBox.click();\n\t\t\t\tThread.sleep(3000);\n\t\t\t}\n\t\t\telement.Sepa_Payment_Save_Changes.click();\n\t\t\tThread.sleep(3000);\n\t\t\tdriver.navigate().to(Constant.shopfrontendurl);\n\t\t\tThread.sleep(3000);\n\t\t\tUtility.wooCommerceCheckOutProcess();\n\t\t\tThread.sleep(4000);\n\t\t\t// Read the data from excel sheet\n\t\t\tMap<String, String> UserData = new HashMap<String, String>();\n\t\t\tUserData = Data.ExcelReader_PaymentMethods();\n\t\t\t// Check whether payment method is displayed in checkout page\n\t\t\tif (element.Sepa_Label.isDisplayed()) {\n\t\t\t\tif (element.Sepa_Radio_button.isDisplayed() == true) {\n\t\t\t\t\telement.Sepa_Radio_button.click();\n\t\t\t\t}\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);\n\t\t\t\telement.Sepa_Iban_TextBox.sendKeys(UserData.get(\"SEPAIBAN\"));\n\t\t\t\telement.Place_Order.click();\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(25, TimeUnit.SECONDS);\n\t\t\t\t// After order placed successfully verify Thank you message displayed\n\t\t\t\tString thankyoumessage = element.FE_Thank_You_Page_Text.getText();\n\t\t\t\tif (thankyoumessage.equals(\"Thank you. Your order has been received.\")) {\n\t\t\t\t\tSystem.out.println(\"Order placed successfully using Direct Debit SEPA\");\n\t\t\t\t\ttest.log(Status.INFO, \"Order placed successfully using Direct Debit SEPA\");\n\t\t\t\t\tThread.sleep(3000);\n\t\t\t\t\t// Get the amount from order success page front end\n\t\t\t\t\tString totalOrderAmount = element.OrderDetails_TotalAmount.getText().replaceAll(\"[^0-9]\", \"\");\n\t\t\t\t\t// Get the TID from order success page front end\n\t\t\t\t\tString TID = element.OrderDetails_Note_TID.getText().replaceAll(\"[^0-9]\", \"\");\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);\n\t\t\t\t\t// Go to callback execution site and enter vendor script URL\n\t\t\t\t\tdriver.navigate().to(Constant.vendorscripturl);\n\t\t\t\t\tThread.sleep(4000);\n\t\t\t\t\telement.Vendor_Script_Url.sendKeys((Constant.shopfrontendurl) + \"?wc-api=novalnet_callback\");\n\t\t\t\t\t// Enter required parameter\n\t\t\t\t\telement.Vendor_Id.clear();\n\t\t\t\t\telement.Vendor_Id.sendKeys(\"4\");\n\t\t\t\t\telement.Vendor_Auth_Code.clear();\n\t\t\t\t\telement.Vendor_Auth_Code.sendKeys(\"JyEtHUjjbHNJwVztW6JrafIMHQvici\");\n\t\t\t\t\telement.Product_Id.clear();\n\t\t\t\t\telement.Product_Id.sendKeys(\"14\");\n\t\t\t\t\telement.Tariff_Id.clear();\n\t\t\t\t\telement.Tariff_Id.sendKeys(\"30\");\n\t\t\t\t\telement.Payment_Type_Edit_Button.click();\n\t\t\t\t\tSelect selectpaymenttype = new Select(element.Payment_Type_Selectbox);\n\t\t\t\t\tselectpaymenttype.selectByVisibleText(\"RETURN_DEBIT_SEPA\");\n\t\t\t\t\telement.Test_Mode.clear();\n\t\t\t\t\telement.Test_Mode.sendKeys(\"1\");\n\t\t\t\t\telement.Tid_Payment.clear();\n\t\t\t\t\telement.Tid_Payment.sendKeys(TID);\n\t\t\t\t\telement.Amount.clear();\n\t\t\t\t\telement.Amount.sendKeys(totalOrderAmount);\n\t\t\t\t\telement.Currency.clear();\n\t\t\t\t\telement.Currency.sendKeys(\"EUR\");\n\t\t\t\t\telement.Status.clear();\n\t\t\t\t\telement.Status.sendKeys(\"100\");\n\t\t\t\t\telement.Tid_Status.clear();\n\t\t\t\t\telement.Tid_Status.sendKeys(\"100\");\n\t\t\t\t\telement.Tid.clear();\n\t\t\t\t\telement.Tid.sendKeys(\"13245678945612345\");\n\t\t\t\t\telement.Execute_Button.click();\n\t\t\t\t\tString callback_message = element.callback_message.getText();\n\t\t\t\t\tString callback_message_updated = callback_message.substring(9, callback_message.length());\n\t\t\t\t\tSystem.out.println(\"Callback execution message: \" + callback_message_updated);\n\t\t\t\t\tif (callback_message\n\t\t\t\t\t\t\t.contains(\"Novalnet callback received. Chargeback executed successfully for the TID:\")) {\n\t\t\t\t\t\tThread.sleep(2000);\n\t\t\t\t\t\tdriver.navigate().to(Constant.shopbackendurl);\n\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\tactions.moveToElement(element.WooCommerce).perform();\n\t\t\t\t\t\tThread.sleep(1500);\n\t\t\t\t\t\telement.WooCommerce_Orders.click();\n\t\t\t\t\t\telement.Backend_Order_Number.click();\n\t\t\t\t\t\tString BEOrderNotesMessage = element.BE_OrderNotes_Message.getText();\n\t\t\t\t\t\tSystem.out.println(\"Backend order note: \" + BEOrderNotesMessage);\n\t\t\t\t\t\tif (callback_message_updated.equals(BEOrderNotesMessage)) {\n\t\t\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\t\t\"TC PASSED: RETURN_DEBIT_SEPA execution message and back end order note message text was matched successfully.\");\n\t\t\t\t\t\t\ttest.log(Status.PASS,\n\t\t\t\t\t\t\t\t\t\"TC PASSED: RETURN_DEBIT_SEPA execution message and back end order note message text was matched successfully.\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\t\t\"TC FAILED: RETURN_DEBIT_SEPA execution message and back end order note message text was not matched.\");\n\t\t\t\t\t\t\ttest.log(Status.FAIL,\n\t\t\t\t\t\t\t\t\t\"TC FAILED: RETURN_DEBIT_SEPA execution messageA and back end order note message text was not matched.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println(\"ERROR: Callback response message is displayed wrongly\");\n\t\t\t\t\t\ttest.log(Status.ERROR, \"ERROR: Callback response message is displayed wrongly\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"TC FAILED: Order was not placed successfully using Direct Debit SEPA\");\n\t\t\t\t\ttest.log(Status.FAIL, \"TC FAILED: Order was not placed successfully using Direct Debit SEPA\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Close browser\n\t\t\tUtility.closeBrowser();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"ERROR: Unexpected error from 'returnDebitSEPA' method\");\n\t\t\ttest.log(Status.ERROR, \"ERROR: Unexpected error from 'returnDebitSEPA' method\");\n\t\t}\n\t}",
"@Test\n\tpublic void generatePosGosPaymentsReport(){\n\t\t\t\tWebDriver driver = new FirefoxDriver();\n\t\t\t\t// Alternatively the same thing can be done like this\n\t\t // driver.get(\"http://www.google.com\");\n\t\t\t\tdriver.navigate().to(determineUrl());\n\t\t\t\t// Find the text input element by its name\n\t\t\t\tWebElement user_name = driver.findElement(By.id(\"user_email\"));\n\t\t\t\tuser_name.sendKeys(user);\n\t\t\t\t\n\t\t\t\tWebElement password = driver.findElement(By.id(\"user_password\"));\n\t\t\t\tpassword.sendKeys(password_login);\n\t\t\t\tpassword.submit();\n\t\t\t\t\n\t\t\t\tWebElement select_venue = driver.findElement(By.id(\"change_venue\"));\n\t\t\t\tselect_venue.sendKeys(venue);\n\t\t\t\tselect_venue.submit();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tWebElement report = driver.findElement(By.linkText(\"Reporting\"));\n\t\t\t\treport.click();\n\t\t\t\t\n\t\t\t\tWebElement select_report = driver.findElement(By.id(\"report_type_chooser\"));\n\t\t\t\tselect_report.sendKeys(\"Pos to Gos Report\");\n\t\t\t\tWebElement select_event = driver.findElement(By.id(\"report_event\"));\n\t\t\t\tselect_event.sendKeys(event);\n\t\t\t\tselect_event.submit();\n\t\t\t\tdriver.close();\n\t\t\n\t}",
"public interface QxService {\n String transmission(String data, String appId, String sign);\n}",
"public String generateURL(HashMap<String, String> params) throws java.security.NoSuchAlgorithmException{\n\t\tDBA = params.get(\"merchantName\");\n\t\tRETURN_URL = params.get(\"returnURL\");\n\t\tTRANSACTION_TYPE = params.get(\"transactionType\");\n\t\tDISCOVER_IMAGE = params.get(\"acceptDiscover\").toUpperCase().startsWith(\"Y\") ? \"discvr.gif\" : \"spacer.gif\";\n\t\tAMEX_IMAGE = params.get(\"acceptAmex\").toUpperCase().startsWith(\"Y\") ? \"amex.gif\" : \"spacer.gif\";\n\t\tAMOUNT = params.get(\"amount\");\n\t\tPROTECT_AMOUNT = params.get(\"protectAmount\");\n\t\tREBILLING = params.get(\"rebilling\").toUpperCase().startsWith(\"Y\") ? \"1\" : \"0\";\n\t\tREB_PROTECT = params.get(\"rebProtect\");\n\t\tREB_AMOUNT = params.get(\"rebAmount\");\n\t\tREB_CYCLES = params.get(\"rebCycles\");\n\t\tREB_FIRST_DATE = params.get(\"rebStartDate\");\n\t\tREB_EXPR = params.get(\"rebFrequency\");\n\t\tCUSTOM_ID1 = params.get(\"customID1\");\n\t\tPROTECT_CUSTOM_ID1 = params.get(\"protectCustomID1\");\n\t\tCUSTOM_ID2 = params.get(\"customID2\");\n\t\tPROTECT_CUSTOM_ID2 = params.get(\"protectCustomID2\");\n\t\tSHPF_FORM_ID = params.get(\"paymentTemplate\");\n\t\tRECEIPT_FORM_ID = params.get(\"receiptTemplate\");\n\t\tREMOTE_URL = params.get(\"receiptTempRemoteURL\");\n\t\tCARD_TYPES = setCardTypes();\n\t\tRECEIPT_TPS_DEF = \"SHPF_ACCOUNT_ID SHPF_FORM_ID RETURN_URL DBA AMEX_IMAGE DISCOVER_IMAGE SHPF_TPS_DEF\";\n\t\tRECEIPT_TPS_STRING = setReceiptTpsString();\n\t\tRECEIPT_TAMPER_PROOF_SEAL = calcURLTps(RECEIPT_TPS_STRING);\n\t\tRECEIPT_URL = setReceiptURL();\n\t\tBP10EMU_TPS_DEF = addDefProtectedStatus(\"MERCHANT APPROVED_URL DECLINED_URL MISSING_URL MODE TRANSACTION_TYPE TPS_DEF\");\n\t\tBP10EMU_TPS_STRING = setBp10emuTpsString();\n\t\tBP10EMU_TAMPER_PROOF_SEAL = calcURLTps(BP10EMU_TPS_STRING);\n\t\tSHPF_TPS_DEF = addDefProtectedStatus(\"SHPF_FORM_ID SHPF_ACCOUNT_ID DBA TAMPER_PROOF_SEAL AMEX_IMAGE DISCOVER_IMAGE TPS_DEF SHPF_TPS_DEF\");\n\t\tSHPF_TPS_STRING = setShpfTpsString();\n\t\tSHPF_TAMPER_PROOF_SEAL = calcURLTps(SHPF_TPS_STRING);\n\t\treturn calcURLResponse();\n\t}",
"public JSONObject getInvoiceForGSTR3BZeroRated(JSONObject reqParams) throws JSONException, ServiceException {\n /**\n * Get Invoice total sum\n */\n String companyId=reqParams.optString(\"companyid\");\n reqParams.put(\"entitycolnum\", reqParams.optString(\"invoiceentitycolnum\"));\n reqParams.put(\"entityValue\", reqParams.optString(\"invoiceentityValue\"));\n JSONObject jSONObject = new JSONObject();\n List<Object> invoiceData = accEntityGstDao.getInvoiceDataWithDetailsInSql(reqParams);\n if (!reqParams.optBoolean(GSTR3BConstants.DETAILED_VIEW_REPORT, false)) {\n double taxableAmountInv = 0d;\n double taxableAmountCN = 0d;\n double taxableAmountAdv = 0d;\n double taxableAmountAdvAdjusted = 0d;\n double IGSTAmount = 0d;\n double CGSTAmount = 0d;\n double SGSTAmount = 0d;\n double CESSAmount = 0d;\n for (Object object : invoiceData) {\n Object[] data = (Object[]) object;\n// String term = data[1]!=null?data[1].toString():\"\";\n// double termamount = data[0]!=null?(Double) data[0]:0;\n taxableAmountInv = data[2]!=null?(Double) data[2]:0;\n }\n\n// /**\n// * Get CN amount\n// */\n// reqParams.put(\"entitycolnum\", reqParams.optString(\"cnentitycolnum\"));\n// reqParams.put(\"entityValue\", reqParams.optString(\"cnentityValue\"));\n// reqParams.put(\"isGSTINnull\", false);\n// reqParams.put(\"GST3B\", true);\n// List<Object> cnData = accEntityGstDao.getCNDNWithInvoiceDetailsInSql(reqParams);\n// for (Object object : cnData) {\n// Object[] data = (Object[]) object;\n// String term = data[1].toString();\n// double termamount = (Double) data[0];\n// taxableAmountCN = (Double) data[2];\n// }\n//\n// /**\n// * Get Advance for which idx not linked yet\n// */\n// reqParams.put(\"entitycolnum\", reqParams.optString(\"receiptentitycolnum\"));\n// reqParams.put(\"entityValue\", reqParams.optString(\"receiptentityValue\"));\n// reqParams.put(\"isGSTINnull\", false);\n// reqParams.put(\"GST3B\", true);\n// reqParams.put(\"at\", true);\n// reqParams.remove(\"atadj\");\n// List<Object> AdvData = accEntityGstDao.getAdvanceDetailsInSql(reqParams);\n// for (Object object : AdvData) {\n// Object[] data = (Object[]) object;\n// String term = data[1].toString();\n// double termamount = (Double) data[0];\n// taxableAmountAdv = (Double) data[2];\n//\n// }\n// /**\n// * Get Advance for which invoice isLinked\n// */\n// reqParams.put(\"entitycolnum\", reqParams.optString(\"receiptentitycolnum\"));\n// reqParams.put(\"entityValue\", reqParams.optString(\"receiptentityValue\"));\n// reqParams.put(\"isGSTINnull\", false);\n// reqParams.put(\"GST3B\", true);\n// reqParams.remove(\"at\");\n// reqParams.put(\"atadj\", true);\n// AdvData = accEntityGstDao.getAdvanceDetailsInSql(reqParams);\n// for (Object object : AdvData) {\n// Object[] data = (Object[]) object;\n// String term = data[1].toString();\n// double termamount = (Double) data[0];\n// taxableAmountAdvAdjusted = (Double) data[2];\n//\n// }\n jSONObject.put(\"Nature of Supplies\", \"b) Outward taxable supplies (zero rated)\");\n jSONObject.put(\"taxableamt\", authHandler.formattedAmount(taxableAmountInv,companyId));\n jSONObject.put(\"igst\", authHandler.formattedAmount(IGSTAmount,companyId));\n jSONObject.put(\"cgst\", authHandler.formattedAmount(CGSTAmount,companyId));\n jSONObject.put(\"sgst\", authHandler.formattedAmount(SGSTAmount,companyId));\n jSONObject.put(\"csgst\", authHandler.formattedAmount(CESSAmount,companyId));\n jSONObject.put(\"totaltax\", authHandler.formattedAmount(IGSTAmount+CGSTAmount+SGSTAmount+CESSAmount,companyId));\n jSONObject.put(\"totalamount\", authHandler.formattedAmount(taxableAmountInv,companyId));\n } else {\n jSONObject = accGSTReportService.getSalesInvoiceJSONArrayForGSTR3B(invoiceData, reqParams, companyId);\n }\n return jSONObject;\n }",
"public void makePayment() {\r\n System.out.println(\"pay\");\r\n setPayed(true);\r\n }",
"public void makeAnotherPayment() {\n btnMakeAnotherPayment().click();\n }",
"@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n if (requestCode == PayUmoneyFlowManager.REQUEST_CODE_PAYMENT && resultCode == RESULT_OK && data !=\n null) {\n TransactionResponse transactionResponse = data.getParcelableExtra(PayUmoneyFlowManager\n .INTENT_EXTRA_TRANSACTION_RESPONSE);\n\n ResultModel resultModel = data.getParcelableExtra(PayUmoneyFlowManager.ARG_RESULT);\n\n // Check which object is non-null\n if (transactionResponse != null && transactionResponse.getPayuResponse() != null) {\n if (transactionResponse.getTransactionStatus().equals(TransactionResponse.TransactionStatus.SUCCESSFUL)) {\n //Success Transaction\n AddPayment(name, ridequantity, Amount);\n } else {\n Intent intent = new Intent();\n setResult(RESULT_OK, intent);\n finish();\n\n }\n\n // Response from Payumoney\n// String payuResponse = transactionResponse.getPayuResponse();\n//\n//// Response from SURl and FURL\n// String merchantResponse = transactionResponse.getTransactionDetails();\n//\n// new AlertDialog.Builder(this)\n// .setCancelable(false)\n// .setMessage(\"Payu's Data : \" + payuResponse + \"\\n\\n\\n Merchant's Data: \" + merchantResponse)\n// .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {\n// public void onClick(DialogInterface dialog, int whichButton) {\n// dialog.dismiss();\n// }\n// }).show();\n\n } else if (resultModel != null && resultModel.getError() != null) {\n Log.d(TAG, \"Error response : \" + resultModel.getError().getTransactionResponse());\n } else {\n Log.d(TAG, \"Both objects are null!\");\n }\n }\n }",
"void buyDevCard();",
"@Override\r\n\tpublic void pay(long dateTime, float charge) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic ReturnMsgEnum pay(Payee payee) {\n\t\tString url = \"https://www.joinpay.com/payment/pay/singlePay\";\r\n\t\tJSONObject json = new JSONObject();\r\n\t\tjson.put(\"userNo\", getUserNo());\r\n\t\tjson.put(\"productCode\", getProductCode());\r\n\t\tjson.put(\"requestTime\", getRequestTime());\r\n\t\tjson.put(\"merchantOrderNo\", getMerchantOrderNo());\r\n\t\tjson.put(\"receiverAccountNoEnc\", getReceiverAccountNoEnc());\r\n\t\tjson.put(\"receiverNameEnc\", getReceiverNameEnc());\r\n\t\tjson.put(\"receiverAccountType\",getReceiverAccountType());\r\n\t\tjson.put(\"paidAmount\", getPaidAmount());\r\n\t\tjson.put(\"currency\",getCurrency());\r\n\t\tjson.put(\"isChecked\",getIsChecked());\r\n\t\tjson.put(\"paidDesc\", getPaidDesc());\r\n\t\tjson.put(\"paidUse\",getPaidUse());\r\n\t\tjson.put(\"callbackUrl\", getCallbackUrl());\r\n\t\tjson.put(\"hmac\",getHmac());\r\n\t\tlogger.info(\"汇聚代付请求参数:{}\",json.toJSONString());\r\n\t\tString result = HttpRequest.post(url).body(json.toJSONString()).charset(\"UTF-8\").execute().body();\r\n\t\tlogger.info(\"汇聚代付响应结果:{}\",result);\r\n\t\tJSONObject resp = JSONObject.parseObject(result);\r\n\t\tif (resp.getString(\"statusCode\").equals(\"2001\")){\r\n\t\t\treturn ReturnMsgEnum.success.setMsg(\"汇聚代付受理成功,等待汇聚出款\");\r\n\t\t}\r\n\t\treturn ReturnMsgEnum.error.setMsg(\"代付失败【\"+resp.getString(\"message\")+\"】\");\r\n\t}",
"public void anualTasks(){\n List<Unit> units = unitService.getUnits();\n for(Unit unit: units){\n double amount = 10000; //@TODO calculate amount based on unit type\n Payment payment = new Payment();\n payment.setPaymentMethod(PaymentMethod.Cash);\n Calendar calendar = Calendar.getInstance();\n calendar.set(Calendar.MONTH, 1);\n calendar.set(Calendar.DATE, 30);\n payment.setDate(LocalDate.now());\n TimeZone tz = calendar.getTimeZone();\n ZoneId zid = tz == null ? ZoneId.systemDefault() : tz.toZoneId();\n payment.setAmount(amount);\n payment.setDueDate(LocalDateTime.ofInstant(calendar.toInstant(), zid).toLocalDate());\n payment.setClient(unit.getOwner());\n payment.setUnit(unit);\n payment.setRecurringInterval(365L);\n payment.setStatus(PaymentStatus.Pending);\n paymentService.savePayment(payment);\n }\n }",
"String confirmPayment(String userName, String teamName, Payment payment) throws RemoteException,\n InterruptedException;",
"private void makeDeposit() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\t\t\t\t\t\t\t\t\tpublic void Payment(String result) {\n\r\n\t\t\t\t\t\t\t\t\t\t\t}",
"Delivery createDelivery();",
"@Test\n public void loanWithCahargesAndUpfrontAccrualAccountingEnabled() {\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n Integer percentageDisbursementCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\"));\n addCharges(charges, percentageDisbursementCharge, \"1\", null);\n\n Integer percentageSpecifiedDueDateCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", false));\n addCharges(charges, percentageSpecifiedDueDateCharge, \"1\", \"29 September 2011\");\n\n Integer percentageInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", false));\n addCharges(charges, percentageInstallmentFee, \"1\", \"29 September 2011\");\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n Assertions.assertNotNull(clientCollateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanProductID = createLoanProduct(false, ACCRUAL_UPFRONT, assetAccount, incomeAccount, expenseAccount,\n overpaymentAccount);\n final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, \"12,000.00\", collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n verifyLoanRepaymentSchedule(loanSchedule);\n\n List<HashMap> loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageDisbursementCharge, loanCharges, \"1\", \"120.00\", \"0.0\", \"0.0\");\n validateCharge(percentageSpecifiedDueDateCharge, loanCharges, \"1\", \"120.00\", \"0.0\", \"0.0\");\n validateCharge(percentageInstallmentFee, loanCharges, \"1\", \"120.00\", \"0.0\", \"0.0\");\n\n // check for disbursement fee\n HashMap disbursementDetail = loanSchedule.get(0);\n validateNumberForEqual(\"120.00\", String.valueOf(disbursementDetail.get(\"feeChargesDue\")));\n\n // check for charge at specified date and installment fee\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"149.11\", String.valueOf(firstInstallment.get(\"feeChargesDue\")));\n\n // check for installment fee\n HashMap secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"29.70\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(\"20 September 2011\", loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(\"20 September 2011\", loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"605.94\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 September 2011\", assetAccountInitialEntry);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 September 2011\",\n new JournalEntry(Float.parseFloat(\"605.94\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageDisbursementCharge, loanCharges, \"1\", \"0.0\", \"120.00\", \"0.0\");\n\n LOG.info(\"-------------Make repayment 1-----------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 October 2011\", Float.parseFloat(\"3300.60\"), loanID);\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageDisbursementCharge, loanCharges, \"1\", \"0.00\", \"120.00\", \"0.0\");\n validateCharge(percentageSpecifiedDueDateCharge, loanCharges, \"1\", \"0.00\", \"120.0\", \"0.0\");\n validateCharge(percentageInstallmentFee, loanCharges, \"1\", \"90.89\", \"29.11\", \"0.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3300.60\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3300.60\"), JournalEntry.TransactionType.CREDIT));\n\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentageSpecifiedDueDateCharge), \"29 October 2011\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"149.70\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n LOG.info(\"----------- Waive installment charge for 2nd installment ---------\");\n LOAN_TRANSACTION_HELPER.waiveChargesForLoan(loanID, (Integer) getloanCharge(percentageInstallmentFee, loanCharges).get(\"id\"),\n LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageInstallmentFee, loanCharges, \"1\", \"61.19\", \"29.11\", \"29.70\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"29.7\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForExpenseAccount(expenseAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"29.7\"), JournalEntry.TransactionType.DEBIT));\n\n LOG.info(\"----------Make repayment 2------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3271.49\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3271.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3271.49\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"--------------Waive interest---------------\");\n LOAN_TRANSACTION_HELPER.waiveInterest(\"20 December 2011\", String.valueOf(61.79), loanID);\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"60.59\", String.valueOf(thirdInstallment.get(\"interestOutstanding\")));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 December 2011\",\n new JournalEntry(Float.parseFloat(\"61.79\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForExpenseAccount(expenseAccount, \"20 December 2011\",\n new JournalEntry(Float.parseFloat(\"61.79\"), JournalEntry.TransactionType.DEBIT));\n\n Integer percentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", true));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentagePenaltySpecifiedDueDate), \"29 September 2011\", \"1\"));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentagePenaltySpecifiedDueDate, loanCharges, \"1\", \"0.00\", \"120.0\", \"0.0\");\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"120\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // checking the journal entry as applied penalty has been collected\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3300.60\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3300.60\"), JournalEntry.TransactionType.CREDIT));\n\n LOG.info(\"----------Make repayment 3 advance------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3301.78\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3301.78\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3301.78\"), JournalEntry.TransactionType.CREDIT));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentagePenaltySpecifiedDueDate), \"10 January 2012\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"120\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3240.58\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Pay applied penalty ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"120\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"120\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"120\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"0\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3120.58\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Make over payment for repayment 4 ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"3220.58\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"3220.58\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3120.58\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForLiabilityAccount(overpaymentAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.CREDIT));\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.getLoanDetail(REQUEST_SPEC, RESPONSE_SPEC, loanID, \"status\");\n LoanStatusChecker.verifyLoanAccountIsOverPaid(loanStatusHashMap);\n }",
"@Override\n public ExtensionResult doSendComplaint(ExtensionRequest extensionRequest) {\n Map<String, String> output = new HashMap<>();\n ExtensionResult extensionResult = new ExtensionResult();\n StringBuilder sbCX = new StringBuilder();\n\n String ticketNumber = extensionRequest.getIntent().getTicket().getTicketNumber();\n\n String Bearer = \"\";\n String nama = getEasyMapValueByName(extensionRequest, \"person\");\n String perusahaan = getEasyMapValueByName(extensionRequest, \"company\");\n String posisi = getEasyMapValueByName(extensionRequest, \"position\");\n String email = getEasyMapValueByName(extensionRequest, \"email\");\n String nohp = getEasyMapValueByName(extensionRequest, \"phone\");\n String keluhan = \"\";\n String masukan = \"\";\n\n // 1.get data dari form\n // ambil token\n Bearer = getToken();\n\n // request API dolphin\n System.out.println(\"bearer = \" + Bearer);\n\n DatumComplaint data = new DatumComplaint();\n data = getFormComplaint(Bearer, ticketNumber);\n // 2. parsing data\n\n keluhan = data.getKeluhan();\n masukan = data.getMasukan();\n sbCX.append(\"<html>\").append(\"<body>\");\n sbCX.append(getHeaderEmail(\"Complaint\", nama, posisi, perusahaan, email, nohp).toString());\n sbCX\n .append(\"<td>6.</td>\").append(\"<td>Keluhan</td>\").append(\"<td>:</td>\").append(\"<td>\" + keluhan + \"</td>\")\n .append(\"</tr><tr>\")\n .append(\"<td>7.</td>\").append(\"<td>Masukan</td>\").append(\"<td>:</td>\").append(\"<td>\" + masukan + \"</td>\")\n .append(\"</tr>\");\n sbCX.append(\"</table>\");\n\n sbCX.append(getFooterEmail().toString())\n .append(\"</body>\").append(\"</html>\");\n\n int codeCX = sendGridEmail(sbCX, email, \"Kakak CX\", \"SAMI - Complaint (\" + keluhan + \")\");\n\n String result = \"\";\n if (codeCX == 202) {\n result = \"Baik kak silahkan tunggu konfirmasi ya kak\";\n } else {\n result = \"Maaf kak pengiriman email gagal. Boleh diulangi kak\";\n }\n\n output.put(OUTPUT, result);\n extensionResult.setAgent(false);\n extensionResult.setRepeat(false);\n extensionResult.setSuccess(true);\n extensionResult.setNext(true);\n extensionResult.setValue(output);\n return extensionResult;\n }",
"@Override\n public String getDescription() {\n return \"Digital goods delivery\";\n }"
] | [
"0.64588827",
"0.6262021",
"0.6156113",
"0.5940736",
"0.59161603",
"0.5906324",
"0.58464515",
"0.58417356",
"0.5815419",
"0.5786655",
"0.5765715",
"0.57393456",
"0.57337445",
"0.5708306",
"0.5707951",
"0.5669845",
"0.5667047",
"0.5658102",
"0.5644464",
"0.5597369",
"0.55553496",
"0.5545942",
"0.5528255",
"0.5519179",
"0.55111647",
"0.54995525",
"0.54928684",
"0.54915756",
"0.5485648",
"0.54704434",
"0.54684097",
"0.54628783",
"0.5462557",
"0.545904",
"0.5449962",
"0.5447704",
"0.5440959",
"0.5430001",
"0.5417771",
"0.5400039",
"0.5370383",
"0.5368234",
"0.5356686",
"0.5356366",
"0.53468096",
"0.5346167",
"0.53398603",
"0.53364617",
"0.5329239",
"0.53268534",
"0.53244054",
"0.5320504",
"0.5310841",
"0.5307483",
"0.5305513",
"0.5301753",
"0.5301059",
"0.5299848",
"0.5297913",
"0.5287974",
"0.52828336",
"0.5274974",
"0.5270976",
"0.5266307",
"0.52623445",
"0.525837",
"0.5258009",
"0.52456105",
"0.5233994",
"0.5232538",
"0.52252954",
"0.52197427",
"0.52079916",
"0.52027404",
"0.5200074",
"0.5194463",
"0.5184734",
"0.51792467",
"0.5172022",
"0.5170519",
"0.51687306",
"0.51664615",
"0.51639086",
"0.5163568",
"0.5163231",
"0.5158959",
"0.5157996",
"0.51577187",
"0.51474226",
"0.5145465",
"0.5144433",
"0.5143576",
"0.514337",
"0.51425415",
"0.5139764",
"0.51369816",
"0.5134668",
"0.5130935",
"0.512971",
"0.51255184",
"0.5113369"
] | 0.0 | -1 |
TODO: init peers should probably be called in onStart? (e.g. if connection settings change > need to reload) TODO: do we need to stop the servers/clients first before we lose the references? | private void initPeers() {
this.servers.clear();
this.clients.clear();
if (SharedPrefUtils.isConnectionNfcEnabled(this)) {
clients.add(new NFCClient(this, walletServiceBinder));
servers.add(new NFCServerACSCLTV(this, walletServiceBinder));
servers.add(new NFCServerCLTV(this, walletServiceBinder));
}
if (SharedPrefUtils.isConnectionBluetoothLeEnabled(this)) {
clients.add(new BluetoothLEClient(this, walletServiceBinder));
servers.add(new BluetoothLEServer(this, walletServiceBinder));
}
if (SharedPrefUtils.isConnectionWiFiDirectEnabled(this)) {
clients.add(new WiFiClient(this, walletServiceBinder));
servers.add(new WiFiServer(this, walletServiceBinder));
}
for (AbstractServer server : servers) {
server.setPaymentRequestDelegate(getClientPaymentRequestDelegate());
}
for (AbstractClient client : clients) {
client.setPaymentRequestDelegate(getClientPaymentRequestDelegate());
if(client instanceof NFCClient) {
client.start();
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void initialize()\n {\n localPeerIDCount = 0;\n\n }",
"private void setUpPeers() {\n SdxParticipantsConfig.PeerConfig peer1 =\n new SdxParticipantsConfig.PeerConfig(Optional.of(PEER1_NAME),\n IpAddress.valueOf(PEER_IP),\n SW1_ETH1,\n INTERFACE_SW1_ETH1);\n\n // Set up the related expectations\n expect(participantsConfig.getPortForPeer(IpAddress.valueOf(PEER_IP)))\n .andReturn(SW1_ETH1).anyTimes();\n expect(participantsConfig.\n getInterfaceNameForPeer(IpAddress.valueOf(PEER_IP)))\n .andReturn(INTERFACE_SW1_ETH1).anyTimes();\n expect(participantsConfig.getPeerForName(Optional.of(PEER1_NAME)))\n .andReturn(peer1).anyTimes();\n expect(participantsConfig.getPeerForIp(IpAddress.valueOf(PEER_IP)))\n .andReturn(peer1).anyTimes();\n\n // Set up expectations for peers that will be added\n expect(participantsConfig.\n getInterfaceNameForPeer(IpAddress.valueOf(NEW_PEER1_IP)))\n .andReturn(null).anyTimes();\n expect(participantsConfig.getPortForPeer(IpAddress.valueOf(NEW_PEER1_IP)))\n .andReturn(null).anyTimes();\n expect(participantsConfig.getPeerForIp(IpAddress.valueOf(NEW_PEER1_IP)))\n .andReturn(null).anyTimes();\n expect(participantsConfig.\n getInterfaceNameForPeer(IpAddress.valueOf(NEW_PEER2_IP)))\n .andReturn(null).anyTimes();\n expect(participantsConfig.getPortForPeer(IpAddress.valueOf(NEW_PEER2_IP)))\n .andReturn(null).anyTimes();\n expect(participantsConfig.getPeerForName(Optional.of(NEW_PEER_NAME)))\n .andReturn(null).anyTimes();\n expect(participantsConfig.node()).andReturn(null).anyTimes();\n }",
"public void setup_connections()\n {\n setup_servers();\n setup_clients();\n }",
"private void reEstablishConnections() {\n// System.out.println(\"Impossible to create overlay, starting over...\");\n for (NodeRecord node : registeredNodes.values()) {\n node.getNodesToConnectToList().clear();\n node.resetNumberOfConnections();\n }\n createOverlay();\n }",
"boolean set_up_connection_to_peers() {\n sockets = new Socket[num_peers];\n int cnt = 0;\n for (int i = 0; i < peer_ip.length; i++) {\n if (peer_id[i] < id) {\n try {\n sockets[i] = new Socket(peer_ip[i], peer_port[i]);\n tcp_out_stream[i] = new ObjectOutputStream(sockets[i].getOutputStream());\n print(\"Peer \" + id + \" successfully connects to \" + peer_id[i]);\n cnt++;\n } catch (IOException e) {\n // TODO Auto-generated catch block\n print(\"Failed to connect to \" + peer_id[i] + \", \" + peer_ip[i] + \":\" + peer_port[i]);\n return false;\n }\n } else {\n sockets[i] = null; //to be connected by later peers.\n }\n }\n print(\"Peer \" + id + \" TCP connection done. Connected to \" + cnt + \" peers\");\n return true;\n }",
"private void establishConnection() {\n\n try {\n\n for(Clone clone:this.clones){\n ClearConnection connection = new ClearConnection();\n connection.connect(clone.getIp(), clone.getOffloadingPort(), 5 * 1000);\n this.connections.add(connection);\n }\n\n this.protocol = new ERAMProtocol();\n this.ode = new ERAMode();\n\n } catch (Exception e) {\n Log.e(TAG,\"Connection setup with the Remote Server failed - \" + e);\n }\n }",
"public Service() {\n if (peers[0] == null) {\n Service.peers[0] = new Peer(clave7);\n Service.peers[1] = new Peer(clave8);\n Service.peers[2] = new Peer(clave9);\n Service.peers[0].addPeer(new EntradaTEncam(clave1, HOSTS[0], PUERTO));\n Service.peers[0].addPeer(new EntradaTEncam(clave2, HOSTS[0], PUERTO));\n Service.peers[0].addPeer(new EntradaTEncam(clave3, HOSTS[0], PUERTO));\n Service.peers[0].addPeer(new EntradaTEncam(clave4, HOSTS[1], PUERTO));\n Service.peers[0].addPeer(new EntradaTEncam(clave5, HOSTS[1], PUERTO));\n Service.peers[0].addPeer(new EntradaTEncam(clave6, HOSTS[1], PUERTO));\n //Service.peers[0].addPeer(new EntradaTEncam(clave7, HOSTS[2], PUERTO));\n Service.peers[0].addPeer(new EntradaTEncam(clave8, HOSTS[2], PUERTO));\n Service.peers[0].addPeer(new EntradaTEncam(clave9, HOSTS[2], PUERTO));\n Service.peers[1].addPeer(new EntradaTEncam(clave1, HOSTS[0], PUERTO));\n Service.peers[1].addPeer(new EntradaTEncam(clave2, HOSTS[0], PUERTO));\n Service.peers[1].addPeer(new EntradaTEncam(clave3, HOSTS[0], PUERTO));\n Service.peers[1].addPeer(new EntradaTEncam(clave4, HOSTS[1], PUERTO));\n Service.peers[1].addPeer(new EntradaTEncam(clave5, HOSTS[1], PUERTO));\n Service.peers[1].addPeer(new EntradaTEncam(clave6, HOSTS[1], PUERTO));\n Service.peers[1].addPeer(new EntradaTEncam(clave7, HOSTS[2], PUERTO));\n //Service.peers[1].addPeer(new EntradaTEncam(clave8, HOSTS[2], PUERTO));\n Service.peers[1].addPeer(new EntradaTEncam(clave9, HOSTS[2], PUERTO));\n Service.peers[2].addPeer(new EntradaTEncam(clave1, HOSTS[0], PUERTO));\n Service.peers[2].addPeer(new EntradaTEncam(clave2, HOSTS[0], PUERTO));\n Service.peers[2].addPeer(new EntradaTEncam(clave3, HOSTS[0], PUERTO));\n Service.peers[2].addPeer(new EntradaTEncam(clave4, HOSTS[1], PUERTO));\n Service.peers[2].addPeer(new EntradaTEncam(clave5, HOSTS[1], PUERTO));\n Service.peers[2].addPeer(new EntradaTEncam(clave6, HOSTS[1], PUERTO));\n Service.peers[2].addPeer(new EntradaTEncam(clave7, HOSTS[2], PUERTO));\n Service.peers[2].addPeer(new EntradaTEncam(clave8, HOSTS[2], PUERTO));\n //Service.peers[2].addPeer(new EntradaTEncam(clave9, HOSTS[2], PUERTO));\n }\n }",
"public void init(){\n\t\tmultiplexingClientServer = new MultiplexingClientServer(selectorCreator);\n\t}",
"private void processPeers() {\n\t\tif (System.currentTimeMillis() - lastPeerUpdate > 20000) {\n\t\t\tupdatePeers();\n\t\t\tlastPeerUpdate = System.currentTimeMillis();\n\t\t}\n\t\tif (System.currentTimeMillis() - lastPeerCheck > 5000) {\n\t\t\tcleanPeerList();\n\t\t\tlastPeerCheck = System.currentTimeMillis();\n\t\t}\n\t}",
"public void initializeConnections(){\n cc = new ConnectorContainer();\n cc.setLayout(null);\n cc.setAutoscrolls(true);\n connections = new LinkedList<JConnector>();\n agents = new LinkedList<JConnector>();\n }",
"private void connectingPeer() {\n for (int index = 0; index < this.peers.size(); index++) {\n String peerUrl = urlAdderP2PNodeName((String) this.peers.get(index));\n try {\n Node distNode = NodeFactory.getNode(peerUrl);\n P2PService peer = (P2PService) distNode.getActiveObjects(P2PService.class.getName())[0];\n \n if (!peer.equals(this.localP2pService)) {\n // Send a message to the remote peer to record me\n peer.register(this.localP2pService);\n // Add the peer in my group of acquaintances\n this.acqGroup.add(peer);\n }\n } catch (Exception e) {\n logger.debug(\"The peer at \" + peerUrl +\n \" couldn't be contacted\", e);\n }\n }\n }",
"public void setup_clients()\n {\n ClientInfo t = new ClientInfo();\n for(int i=0;i<5;i++)\n {\n // for mesh connection between clients\n // initiate connection to clients having ID > current node's ID\n if(i > my_c_id)\n {\n // get client info\n String t_ip = t.hmap.get(i).ip;\n int t_port = Integer.valueOf(t.hmap.get(i).port);\n Thread x = new Thread()\n {\n \tpublic void run()\n {\n try\n {\n Socket s = new Socket(t_ip,t_port);\n // SockHandle instance with svr_hdl false and rx_hdl false as this is the socket initiator\n // and is a connection to another client node\n SockHandle t = new SockHandle(s,my_ip,my_port,my_c_id,c_list,s_list,false,false,cnode);\n }\n catch (UnknownHostException e) \n {\n \tSystem.out.println(\"Unknown host\");\n \tSystem.exit(1);\n } \n catch (IOException e) \n {\n \tSystem.out.println(\"No I/O\");\n e.printStackTrace(); \n \tSystem.exit(1);\n }\n \t}\n };\n \n x.setDaemon(true); \t// terminate when main ends\n x.setName(\"Client_\"+my_c_id+\"_SockHandle_to_Client\"+i);\n x.start(); \t\t\t// start the thread\n }\n }\n\n // another thread to check until all connections are established ( ie. socket list size =4 )\n // then send a message to my_id+1 client to initiate its connection setup phase\n Thread y = new Thread()\n {\n public void run()\n {\n int size = 0;\n // wait till client connections are setup\n while (size != 4)\n {\n synchronized(c_list)\n {\n size = c_list.size();\n }\n }\n // if this is not the last client node (ID =4)\n // send chain init message to trigger connection setup\n // phase on the next client\n if(my_c_id != 4)\n {\n c_list.get(my_c_id+1).send_setup();\n System.out.println(\"chain setup init\");\n }\n // send the setup finish, from Client 4\n // indicating connection setup phase is complete\n else\n {\n c_list.get(0).send_setup_finish();\n }\n }\n };\n \n y.setDaemon(true); \t// terminate when main ends\n y.start(); \t\t\t// start the thread\n }",
"private ResolverService(Peer peer, EndpointService epService)\n {\n super(peer, RESSERVICE_NAME);\n\n // init fields\n initFields();\n \n \n this.epService = epService;\n epService.addListener(serviceName, this); //adding listener to end\n // point service\n\n cache = Cache.createInstance(); //creating cache\n cache.addResource(peer);\n \n\n // get SeedPeerList\n EndpointAddress[] seedPeerList = getSeedURIs();\n \n if (seedPeerList != null && seedPeerList.length > 0)\n {\n int seedListSize = (neighbors > seedPeerList.length ? seedPeerList.length : neighbors);\n seedURI = new EndpointAddress[seedListSize][1];\n for (int i = 0; i < seedListSize; i++)\n {\n seedURI[i][0] = seedPeerList[i];\n }\n }\n// try\n// {\n// mcastURI = new EndpointAddress(null, null, 0);\n// } catch (Exception e)\n// {\n// e.printStackTrace();\n// }\n\n// myPeer = peer;\n peerId = peer.getID().toString(); //TBD kuldeep - Is this needed?\n// peername = myPeer.getName();\n }",
"void initialise() {\n this.sleep = false;\n this.owner = this;\n renewNeighbourClusters();\n recalLocalModularity();\n }",
"public void clearPeers() {\n peers_.clear();\n ((PeersAdapter)adapter_).update();\n }",
"private void initEngineAndJoinChannel() {\n // Join and start call\n initializeEngine();\n setupVideoConfig();\n setupLocalVideo();\n joinChannel();\n }",
"public void destroy(){\n\t\tMLog.log(\"destryoing peers\");\n\t\twhile(peers.size()>0){\n\t\t\tPeerInt p=peers.get(peers.size()-1);\n\t\t\tdestroy(p);\n\t\t}\n\t\t\n\t}",
"public Peer start() throws IOException {\n\t\tboolean isBehindFirewallSet = false;\n\t\tif (behindFirewall == null) {\n\t\t\tbehindFirewall = false;\n\t\t} else {\n\t\t\tisBehindFirewallSet = true;\n\t\t}\n\n\t\tboolean isTcpPortSet = false;\n\t\tif (tcpPort == -1) {\n\t\t\ttcpPort = Ports.DEFAULT_PORT;\n\t\t} else {\n\t\t\tisTcpPortSet = true;\n\t\t}\n\t\t\n\t\tboolean isUdpPortSet = false;\n\t\tif (udpPort == -1) {\n\t\t\tudpPort = Ports.DEFAULT_PORT;\n\t\t} else {\n\t\t\tisUdpPortSet = true;\n\t\t}\n\t\t\n\t\tif (channelServerConfiguration == null) {\n\t\t\tchannelServerConfiguration = createDefaultChannelServerConfiguration();\n\t\t} \n\t\t\n\t\t//post config\n\t\tif(isBehindFirewallSet) {\n\t\t\tchannelServerConfiguration.behindFirewall(behindFirewall);\n\t\t}\n\t\tif(isTcpPortSet || isUdpPortSet) {\n\t\t\tchannelServerConfiguration.ports(new Ports(tcpPort, udpPort));\n\t\t}\n\t\t\n\t\tif(tcpPortForwarding == -1 && udpPortForwarding == -1) {\n\t\t\tchannelServerConfiguration.portsForwarding(new Ports());\n\t\t} else {\n\t\t\tchannelServerConfiguration.portsForwarding(new Ports(tcpPortForwarding, udpPortForwarding));\n\t\t}\n\t\t\n\t\tif (channelClientConfiguration == null) {\n\t\t\tchannelClientConfiguration = createDefaultChannelClientConfiguration();\n\t\t}\n\t\tif (keyPair == null) {\n\t\t\tkeyPair = EMPTY_KEY_PAIR;\n\t\t}\n\t\tif (p2pID == -1) {\n\t\t\tp2pID = 1;\n\t\t}\n\t\t\n\t\t\n\t\tif (bindings == null) {\n\t\t\tbindings = new Bindings();\n\t\t} else {\n\t\t\tchannelServerConfiguration.bindings(bindings);\n\t\t\tchannelClientConfiguration.bindings(bindings);\n\t\t}\n\t\tif (peerMap == null) {\n\t\t\tpeerMap = new PeerMap(new PeerMapConfiguration(peerId));\n\t\t}\n\n\t\tif (masterPeer == null && scheduledExecutorService == null) {\n\t\t\tscheduledExecutorService = Executors.newScheduledThreadPool(1);\n\t\t}\n\n\t\tif(sendBehavior == null) {\n\t\t\tsendBehavior = new DefaultSendBehavior();\n\t\t}\n\t\t\n\t\tfinal PeerCreator peerCreator;\n\t\tif (masterPeer != null) {\n\t\t\tpeerCreator = new PeerCreator(masterPeer.peerCreator(), peerId, keyPair);\n\t\t} else {\n\t\t\tpeerCreator = new PeerCreator(p2pID, peerId, keyPair, channelServerConfiguration,\n\t\t\t channelClientConfiguration, scheduledExecutorService, sendBehavior);\n\t\t}\n\n\t\tfinal Peer peer = new Peer(p2pID, peerId, peerCreator);\n\t\t//add shutdown hook to master peer\n\t\tif (masterPeer != null) {\n\t\t\tmasterPeer.addShutdownListener(new Shutdown() {\n\t\t\t\t@Override\n\t\t\t\tpublic BaseFuture shutdown() {\n\t\t\t\t\treturn peer.shutdown();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tPeerBean peerBean = peerCreator.peerBean();\n\t\t\n\t\tpeerBean.addPeerStatusListener(peerMap);\n\t\t\n\t\tConnectionBean connectionBean = peerCreator.connectionBean();\n\n\t\tpeerBean.peerMap(peerMap);\n\t\tpeerBean.keyPair(keyPair);\n\n\t\tif (bloomfilterFactory == null) {\n\t\t\tpeerBean.bloomfilterFactory(new DefaultBloomfilterFactory());\n\t\t}\n\n\t\tif (broadcastHandler == null) {\n\t\t\tbroadcastHandler = new StructuredBroadcastHandler();\n\t\t}\n\t\tbroadcastHandler.init(peer);\n\t\t\n\t\t// set/enable RPC\n\n\t\tif (isEnableHandShakeRPC()) {\n\t\t\tPingRPC pingRPC = new PingRPC(peerBean, connectionBean);\n\t\t\tpeer.pingRPC(pingRPC);\n\t\t}\n\t\t\n\t\tif (isEnableQuitRPC()) {\n\t\t\tQuitRPC quitRPC = new QuitRPC(peerBean, connectionBean);\n\t\t\tquitRPC.addPeerStatusListener(peerMap);\n\t\t\tpeer.quitRPC(quitRPC);\n\t\t}\n\n\t\tif (isEnableNeighborRPC()) {\n\t\t\tNeighborRPC neighborRPC = new NeighborRPC(peerBean, connectionBean);\n\t\t\tpeer.neighborRPC(neighborRPC);\n\t\t}\n\n\t\tif (isEnableDirectDataRPC()) {\n\t\t\tDirectDataRPC directDataRPC = new DirectDataRPC(peerBean, connectionBean);\n\t\t\tpeer.directDataRPC(directDataRPC);\n\t\t}\n\n\t\tif (isEnableBroadcast()) {\n\t\t\tBroadcastRPC broadcastRPC = new BroadcastRPC(peerBean, connectionBean, broadcastHandler);\n\t\t\tpeer.broadcastRPC(broadcastRPC);\n\t\t}\n\t\t\n\t\tif (isEnableRouting() && isEnableNeighborRPC()) {\n\t\t\tDistributedRouting routing = new DistributedRouting(peerBean, peer.neighborRPC());\n\t\t\tpeer.distributedRouting(routing);\n\t\t}\n\n\t\tif (maintenanceTask == null && isEnableMaintenance()) {\n\t\t\tmaintenanceTask = new MaintenanceTask();\n\t\t}\n\n\t\tif (maintenanceTask != null) {\n\t\t\tmaintenanceTask.init(peer, connectionBean.timer());\n\t\t\tmaintenanceTask.addMaintainable(peerMap);\n\t\t}\n\t\tpeerBean.maintenanceTask(maintenanceTask);\n\n\t\t\t\t\n\t\tfor (PeerInit peerInit : toInitialize) {\n\t\t\tpeerInit.init(peer);\n\t\t}\n\t\t\n\t\treturn peer;\n\t}",
"public synchronized void start() throws IOException, ClassNotFoundException, RemoteReadException, InstantiationException, IllegalAccessException, InterruptedException\n\t{\n\t\t// Start up the peer. 06/14/2017, Bing Li\n\t\tif (!this.peer.isStarted())\n\t\t{\n\t\t\tthis.peer.start();\n\t\t}\n\n\t\t// Retrieve all of the registered IP addresses of the distributed nodes in the cluster from the registry server. 07/05/2017, Bing Li\n\t\tClusterIPResponse ipResponse = (ClusterIPResponse)this.peer.read(RegistryConfig.PEER_REGISTRY_ADDRESS, RegistryConfig.PEER_REGISTRY_PORT, new ClusterIPRequest());\n\t\tif (ipResponse.getIPs() != null)\n\t\t{\n\t\t\t// Add the IP addresses to the client pool. 07/05/2017, Bing Li\n\t\t\tfor (IPAddress ip : ipResponse.getIPs().values())\n\t\t\t{\n\t\t\t\tthis.peer.getClientPool().addIP(ip.getIP(), ip.getPort());\n\t\t\t}\n\n\t\t\t// Initialize the cluster root IP address broadcast notifier. 07/05/2017, Bing Li\n\t\t\tthis.rootIPBroadcastNotifier = new ClusterRootBroadcastNotifier<IPAddress, OldRootIPAddressBroadcastNotification, RootIPAddressBroadcastNotificationCreator>(this.peer.getClientPool(), MulticastConfig.MULTICASTOR_POOL_SIZE, MulticastConfig.RESOURCE_WAIT_TIME, new RootIPAddressBroadcastNotificationCreator());\n\t\t\t// Broadcast the root IP address to each child in the cluster. 07/05/2017, Bing Li\n\t\t\tthis.rootIPBroadcastNotifier.notifiy(new IPAddress(this.peer.getPeerID(), this.peer.getPeerIP(), this.peer.getPort()), MulticastConfig.ROOT_BRANCH_COUNT, MulticastConfig.SUB_BRANCH_COUNT);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Initialize the cluster root IP address broadcast notifier. 07/05/2017, Bing Li\n\t\t\tthis.rootIPBroadcastNotifier = new ClusterRootBroadcastNotifier<IPAddress, OldRootIPAddressBroadcastNotification, RootIPAddressBroadcastNotificationCreator>(this.peer.getClientPool(), MulticastConfig.MULTICASTOR_POOL_SIZE, MulticastConfig.RESOURCE_WAIT_TIME, new RootIPAddressBroadcastNotificationCreator());\n\t\t}\n\t}",
"void connect() throws UnsupportedProtocolVersionException {\n if (isShutdown) return;\n\n List<Host> hosts = new ArrayList<Host>(cluster.metadata.getContactPoints());\n // shuffle so that multiple clients with the same contact points don't all pick the same control\n // host\n Collections.shuffle(hosts);\n setNewConnection(reconnectInternal(hosts.iterator(), true));\n }",
"public void shutdown() {\n\t\t//We call peers.values() and put into Array to create an unchanging copy, one that\n\t\t//does not shrink even as the sockets remove themselves from the peers list\n\t\t//this prevents a ConcurrentModificationException\n\t\tonline = false;\n\t\tArrayList<DecentSocket> connections = new ArrayList<DecentSocket>(peers.values());\n\t\tfor(DecentSocket socket: connections) {\n\t\t\tsocket.stop();\n\t\t}\n\t\tlistener.stop();\n\t\tchecker.stop();\n\t}",
"private void rebind() {\n\t\tnotaryServers = Client.locateNotaries();\n\t\tconnectToUsers();\n\t\t//lookUpUsers();\n\n\t}",
"protected void beforeConnect()\n throws IOException {\n // Bootstrap once for clients\n if (!isConnected()) {\n mContext.loadConfIfNotLoaded(getConfAddress());\n }\n }",
"private void readPeers() {\n\t\tif(peersFile.exists()) {\n\t\t\ttry {\n\t\t\t\tBufferedReader reader = new BufferedReader(new FileReader(peersFile));\n\t\t\t\tString line = reader.readLine();\n\t\t\t\tint lineNumber = 1;\n\t\t\t\twhile(line != null && peers.size() < maximumConnections) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tInetAddress candidate = InetAddress.getByName(line);\n\t\t\t\t\t\tcheckPeer(candidate);\n\t\t\t\t\t} catch (UnknownHostException e) {\n\t\t\t\t\t\tString logMsg = String.format(\"Invalid host address \\\"%s\\\" in file %s at line number %d\", line, peersFile.getName(), lineNumber);\n\t\t\t\t\t\tDecentLogger.write(logMsg);\n\t\t\t\t\t}\n\t\t\t\t\tline = reader.readLine();\n\t\t\t\t\tlineNumber++;\n\t\t\t\t}\n\t\t\t\treader.close();\n\t\t\t}\n\t\t\tcatch (FileNotFoundException e1) {\n\t\t\t\tString logMsg = String.format(\"Peer file %s not found\", peersFile.getName());\n\t\t\t\tDecentLogger.write(logMsg);\n\t\t\t} \n\t\t\tcatch (IOException e1) {\n\t\t\t\tDecentLogger.write(\"Unable to read file due to \"+e1.getMessage());\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\ttry {\n\t\t\t\tpeersFile.createNewFile();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"@Override\r\n\tpublic void initial() {\n\t\ttry {\r\n\t\t\tserverSocket = new ServerSocket(port);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t// System.out.println(\"LocalProxy run on \" + port);\r\n\t}",
"public void getAlreadyConnectedPeers() {\n ArrayList<Peer> alreadyConnected = parent.getConnections(name);\n for(Peer p : alreadyConnected) {\n if(p.connected()) {\n addPeer(p.getIP());\n nodeConnection(p.getIP());\n }\n }\n }",
"public void askForPeers() {\n\t\tif(peers.size() < maximumConnections) {\n\t\t\tpropagateToAllPeers(new PeerAskMessage());\n\t\t}\n\t}",
"public void init(){\n taskClient.connect(\"127.0.0.1\", 9123);\n }",
"private void initialize(){\n\t\ttry\n\t\t{\n\t\t\tString[] packet = setPacket();\n\t\t\tif (validatePacket(packet))\n\t\t\t{\n\t\t\t\tsend(packet);\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(e.getMessage());\n\t\t\tSystem.out.println(\"Something went wrong...\");\n\t\t\tresetClient();\n\t\t}\n\t}",
"private void cleanPeerList() {\n\t\tfor (int i = 0; i < peers.size(); i++) {\n\t\t\tPeer p = peers.get(i);\n\t\t\tif (p == null)\n\t\t\t\tcontinue;\n\t\t\tif (p.closed()) {\n\t\t\t\tp.cancelAllPieces();\n\t\t\t\tsynchronized (this) {\n\t\t\t\t\tpeers.remove(i--);\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tp.checkDisconnect();\n\t\t\t}\n\t\t}\n\t}",
"private void initialyzeServer(int port) {\n\n try {\n server = new ServerSocket(port);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n while (true) {\n try {\n\n Client c = new Client(server.accept(), \"client \" + clientIterator, this);\n\n sockets.add(c);\n ex.submit(c);\n\n System.out.println(race);\n\n race.getBroker().registerClient(c);\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n clientIterator++;\n\n System.out.println(\"Client\" + clientIterator + \" has connected the server\");\n }\n }",
"@Override\r\n\tpublic void onPeersAvailable(WifiP2pDeviceList peers) {\n\t\t\r\n\t}",
"public void initMultiPlayer() {\r\n\t\tnew ConnectThread().start();\r\n\t}",
"@Override\n protected void connectionEstablished()\n {\n peer.resetConnectionClosed();\n\n // send our handshake directly as it doesn't fit into peer message\n // and there is always space in send buffer on new connection\n //enqueue(pmCache.handshake(torrent.getTorrentId(), torrent.getClientId()));\n }",
"public SuperPeer initialize() {\n try {\n // read config file (e.g., all-to-all.config, linear.config)\n Scanner sc = new Scanner(new FileInputStream(this.config));\n\n // process each line\n while (sc.hasNextLine()) {\n // parse and decompose line\n String[] line = sc.nextLine().split(\" \");\n String type = line[0];\n IPv4 peer;\n\n switch (type) {\n case \"c\":\n break;\n case \"s\":\n // SuperPeer definition: 'other' is neighbor to associate with this SuperPeer\n peer = new IPv4(line[1]);\n if (this.equals(peer)) {\n this.neighbors.add(line[2]);\n }\n break;\n case \"p\":\n // peer definition: 'other' is peer to associate with this SuperPeer\n peer = new IPv4(line[1]);\n if (this.equals(peer)) {\n this.leafs.add(line[2]);\n }\n break;\n default:\n this.log(String.format(\"Unknown type '%s'. Ignoring...\", type));\n break;\n }\n }\n sc.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return this;\n }",
"public void init() {\n configuration.init();\n \n //Connections connections = configuration.getBroker().getConnections(\"topic\");\n Connections connections = configuration.getBrokerPool().getBroker().getConnections(\"topic\");\n \n if (connections == null) {\n handleException(\"Couldn't find the connection factor: \" + \"topic\");\n }\n \n sensorCatalog = new SensorCatalog();\n clientCatalog = new ClientCatalog();\n \n nodeCatalog = new NodeCatalog();\n \n updateManager = new UpdateManager(configuration, sensorCatalog, this);\n updateManager.init();\n \n endpointAllocator = new EndpointAllocator(configuration, nodeCatalog);\n\n registry = new JCRRegistry(this);\n registry.init();\n\n // Initialize Public-End-Point\n if(!isPublicEndPointInit) {\n \tinitPublicEndpoint();\n }\n }",
"private void updatePeers() {\n\t\tif (files == null)\n\t\t\treturn;\n\t\tArrayList<Piece> neededPieces = files.getNeededPieces();\n\t\tfor (int i = 0; i < peers.size(); i++) {\n\t\t\tPeer p = peers.get(i);\n\t\t\tboolean hasNoPieces = true;\n\t\t\tfor (int j = 0; j < neededPieces.size(); j++) {\n\t\t\t\tif (p.getClient().getBitfield().hasPiece(neededPieces.get(j).getIndex())) {\n\t\t\t\t\thasNoPieces = false;\n\t\t\t\t\tif (!p.getClient().isInterested()) {\n\t\t\t\t\t\tp.addToQueue(new MessageInterested());\n\t\t\t\t\t\tp.getClient().interested();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (hasNoPieces && p.getClient().isInterested()) {\n\t\t\t\tp.addToQueue(new MessageUninterested());\n\t\t\t\tp.getClient().uninterested();\n\t\t\t}\n\t\t\tif (p.getMyClient().isInterested() && p.getClient().isChoked()) {\n\t\t\t\tp.addToQueue(new MessageUnchoke());\n\t\t\t\tp.getClient().unchoke();\n\t\t\t} else if (!p.getMyClient().isInterested() && !p.getClient().isChoked()) {\n\t\t\t\tp.addToQueue(new MessageChoke());\n\t\t\t\tp.getClient().choke();\n\t\t\t}\n\t\t}\n\t}",
"protected void startAll() throws Throwable {\n\t\tthis.udpServer = new UDPServer(this.agent);\n\t\tthis.connectionServer = new TCPServer(this.agent);\n\t}",
"public interface IPeerManager\r\n{\r\n /**\r\n * Add a new PeerEndpoint to the list of peers\r\n * \r\n * @param peer\r\n */\r\n void addPeerEndpoint(PeerEndpoint peer);\r\n\r\n /**\r\n * Returns a current snapshot of all known peers\r\n * \r\n * @return An iterable list of all the peers\r\n */\r\n Set<String> getPeerSnapshot();\r\n\r\n /**\r\n * Returns the PeerEnpoint matching the key\r\n * \r\n * @param key\r\n * @return the requested PeerEndpoint\r\n */\r\n PeerEndpoint getPeerEndpoint(String key);\r\n\r\n /**\r\n * Deletes the PeerEndpoint matching the provided key\r\n * \r\n * @param key\r\n */\r\n void removePeerEndpoint(String key);\r\n\r\n /**\r\n * Returns the number of currentlyn known peers\r\n * \r\n * @return number of currently known peers\r\n */\r\n int getPeerCount();\r\n}",
"public void startListener() throws IOException {\n\t\tthis.listener = new ServerSocket(this.port);\n\n Runnable serverThread = new Runnable() {\n @Override\n public void run() {\n try {\n System.out.println(\"Waiting for clients to connect...\");\n\n while (true) {\n \t// Wait for connections\n Socket newSocket = listener.accept();\n\n // Init new peer and add it to our list\n PeerCommunicator newCommunication = new PeerCommunicator(id, \"\", newSocket);\n activePeers.add(newCommunication);\n\n // Span new thread\n Thread clientThread = new Thread(new ReceivedConnection(newCommunication, fm));\n clientThread.start();\n }\n } catch (Exception e) {\n System.err.println(\"Unable to process incoming client\");\n e.printStackTrace();\n }\n }\n };\n\n // Start it up\n (new Thread(serverThread)).start();\n\n // Once everything's good, mark server as running\n //this.status = Status.RUNNING;\n\t}",
"private void starter(QuorumPeer self, QuorumCnxManager manager) {\n this.self = self;\n proposedLeader = -1;\n proposedZxid = -1;\n\n sendqueue = new LinkedBlockingQueue<>();\n recvqueue = new LinkedBlockingQueue<>();\n this.messenger = new Messenger(manager);\n }",
"int reInitializeCommunities();",
"private void onPeersCleared()\n {\n for (PeerListener listener : getListeners()) {\n listener.onPeersCleared();\n }\n }",
"private void startFedServer(){\r\n \r\n try {\r\n System.out.println(\"Start server to listen for client connection....\");\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", \"Start server to listen for client connection....\", \"info\");\r\n sSocket = new ServerSocket(serverPort);\r\n sSocket.setReuseAddress(true);\r\n //System.out.println(\"FedServer is launching\");\r\n } catch (IOException ex) {\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", \"Error listening on port \" + serverPort, \"severe\");\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", FedLog.getExceptionStack(ex), \"severe\");\r\n }\r\n List<Thread> proc_list = new ArrayList();\r\n while (FLAG) {\r\n if (proc_list.size() == PROC_MAX) {\r\n boolean full = true;\r\n //check if thread number reach the maximum number, if yes, sleep; \r\n while (full) {\r\n for (int i = proc_list.size() - 1; i >= 0; i--) {\r\n if (!proc_list.get(i).isAlive()) {\r\n proc_list.remove(i);\r\n full = false;\r\n }\r\n }\r\n if (full) {\r\n try {\r\n Thread.sleep(1000);\r\n } catch (InterruptedException ex) {\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", FedLog.getExceptionStack(ex), \"severe\");\r\n }\r\n }\r\n }\r\n }\r\n //if not full, accpet new client connection\r\n try {\r\n cSocket = sSocket.accept();\r\n //System.out.println(\"[C4C-Notification] Accept connection from client\");\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", \"Accept connection from client\", \"info\");\r\n //create new thread to process client request\r\n // System.out.println(\"Accept connection from client -step 1\");\r\n Thread request = new Thread(new processRequest(cSocket));\r\n request.start();\r\n proc_list.add(request);\r\n } catch (IOException ex) {\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", FedLog.getExceptionStack(ex), \"severe\");\r\n }\r\n\r\n }\r\n closeFedSockets();\r\n }",
"public void onStart() {\n Configuration curatorDiscoveryConf = Configuration.root().getConfig(\"curator.service.discovery\");\n\n if (curatorDiscoveryConf == null) {\n Logger.info(\"Curator Discovery settings not found.\");\n } else {\n serviceName = curatorDiscoveryConf.getString(\"name\", \"Play2CuratorService\");\n serviceDescription = curatorDiscoveryConf.getString(\"description\", \"Play2 Curator Service\");\n servicePath = curatorDiscoveryConf.getString(\"path\", \"/play2-curator-service-discovery-plugin\");\n autoRegister = curatorDiscoveryConf.getBoolean(\"autoregister\", Boolean.TRUE);\n uriSpecParam = curatorDiscoveryConf.getString(\"uri.spec\", \"{scheme}://{address}:{port}\");\n uriSpecSslParam = curatorDiscoveryConf.getString(\"ssl.uri.spec\", \"{scheme}://{address}:{ssl-port}\");\n\n Logger.info(\"CuratorServiceDiscoveryPlugin Settings:\");\n Logger.info(\" * serviceName: \" + serviceName);\n Logger.info(\" * serviceDescription: \" + serviceDescription);\n Logger.info(\" * servicePath: \" + servicePath);\n Logger.info(\" * autoRegister: \" + autoRegister);\n Logger.info(\" * uriSpec: \" + uriSpecParam);\n Logger.info(\" * uriSpecSsl: \" + uriSpecSslParam);\n\n zooServers = curatorDiscoveryConf.getString(\"zooServers\", \"localhost:2181\");\n Logger.info(\" * zooKeeper servers: \" + zooServers);\n\n if (zooServers.toLowerCase().contains(\"mock\")) {\n try {\n mockZooKeeper = new TestingServer(2181);\n zooServers = mockZooKeeper.getConnectString();\n Logger.info(\"Mock ZooKeeper started at: \" + zooServers);\n } catch (Exception e) {\n Logger.error(\"Could not start mock ZooKeeper server on port 2181: \" + e.getMessage());\n return;\n }\n }\n\n Logger.info(\"Curator Discovery settings found. ZooKeeper servers: \" + zooServers);\n if (autoRegister) {\n int port = 0;\n String sPort = Configuration.root().getString(\"http.port\");\n if (sPort != null) {\n try {\n port = Integer.parseInt(sPort);\n Logger.info(\" * port: \" + port);\n } catch (NumberFormatException nfe) {\n Logger.debug(\"port is not valid\");\n }\n }\n\n sPort = Configuration.root().getString(\"https.port\");\n int sslPort = 0;\n if (sPort != null) {\n try {\n sslPort = Integer.parseInt(sPort);\n Logger.info(\" * sslPort: \" + sslPort);\n } catch (NumberFormatException nfe) {\n Logger.debug(\"ssl-port is not valid\");\n }\n }\n if (port == 0 && sslPort == 0) {\n Logger.error(\"Can't register service. Port / sslPort not set\");\n } else {\n register(serviceName, serviceDescription, port, sslPort);\n }\n }\n }\n }",
"public Intermediary()\r\n\t{\r\n\t\ttry {\r\n\t\t\treceiveSocket = new DatagramSocket(68);\r\n\t\t\tsendReceiveSocket = new DatagramSocket();\t\t\t\r\n\t\t\t\r\n\t\t} catch (SocketException se) {\r\n\t\t\tse.printStackTrace();\r\n\t\t\tSystem.exit(1);\r\n\t\t} \r\n\t\t\r\n\t\treqID = 1;\r\n\t\tSystem.out.println(\"===== INTERMEDIATE HOST STARTED =====\\n\");\r\n\t}",
"@Override\n\tpublic void run()\n\t{\n\t\tSocket clientSocket;\n\t\tMemoryIO serverIO;\n\t\t// Detect whether the listener is shutdown. If not, it must be running all the time to wait for potential connections from clients. 11/27/2014, Bing Li\n\t\twhile (!super.isShutdown())\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Wait and accept a connecting from a possible client residing on the coordinator. 11/27/2014, Bing Li\n\t\t\t\tclientSocket = super.accept();\n\t\t\t\t// Check whether the connected server IOs exceed the upper limit. 11/27/2014, Bing Li\n\t\t\t\tif (MemoryIORegistry.REGISTRY().getIOCount() >= ServerConfig.MAX_SERVER_IO_COUNT)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// If the upper limit is reached, the listener has to wait until an existing server IO is disposed. 11/27/2014, Bing Li\n\t\t\t\t\t\tsuper.holdOn();\n\t\t\t\t\t}\n\t\t\t\t\tcatch (InterruptedException e)\n\t\t\t\t\t{\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If the upper limit of IOs is not reached, a server IO is initialized. A common Collaborator and the socket are the initial parameters. The shared common collaborator guarantees all of the server IOs from a certain client could notify with each other with the same lock. Then, the upper limit of server IOs is under the control. 11/27/2014, Bing Li\n//\t\t\t\tserverIO = new MemoryIO(clientSocket, super.getCollaborator(), ServerConfig.COORDINATOR_PORT_FOR_MEMORY);\n\t\t\t\tserverIO = new MemoryIO(clientSocket, super.getCollaborator());\n\t\t\t\t// Add the new created server IO into the registry for further management. 11/27/2014, Bing Li\n\t\t\t\tMemoryIORegistry.REGISTRY().addIO(serverIO);\n\t\t\t\t// Execute the new created server IO concurrently to respond the client requests in an asynchronous manner. 11/27/2014, Bing Li\n\t\t\t\tsuper.execute(serverIO);\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"protected int numPeers() {\n\t\treturn peers.size();\n\t}",
"private Client() {\n solution_set = new HashSet<>();\n contentsMap = new HashMap<>();\n current_state = new HashSet<>();\n next_state = new HashSet<>();\n }",
"private void InitiateRelevantActiveTransaction() {\n try {\n /**\n * Create a client socket with the host,\n * port, and timeout information.\n */\n mSocket = new Socket();\n mSocket.bind(null);\n mSocket.connect((new InetSocketAddress(mPeer.mIPAddr, Constants.WELCOME_SOCKET_PORT)), 3000);\n } catch (UnknownHostException e) {\n e.printStackTrace();\n return;\n } catch (IOException e) {\n e.printStackTrace();\n return;\n }\n\n if (mSocket == null) {\n return;\n }\n\n switch (mQueryCode) {\n case Constants.CONNECTION_CODE_DISCOVER: {\n ActiveDiscoveryProcedure();\n break;\n }\n }\n\n }",
"public void run() {\n try {\n peerBootstrap = createPeerBootStrap();\n\n peerBootstrap.setOption(\"reuseAddr\", true);\n peerBootstrap.setOption(\"child.keepAlive\", true);\n peerBootstrap.setOption(\"child.tcpNoDelay\", true);\n peerBootstrap.setOption(\"child.sendBufferSize\", Controller.SEND_BUFFER_SIZE);\n\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }",
"public Echange_Client() throws UnknownHostException, IOException {\n start_Connexion(); \n }",
"@Override\n protected void preClientStart() {\n client.registerListener(new BuddycloudLocationChannelListener(\n getContentResolver()\n ));\n client.registerListener(new BuddycloudChannelMetadataListener(\n getContentResolver()\n ));\n BCConnectionAtomListener atomListener = new BCConnectionAtomListener(\n getContentResolver(), this);\n registerListener(atomListener);\n }",
"private void init() {\n DatabaseInitializer databaseInitializer = new DatabaseInitializer();\n try {\n for (int i = 0; i < DEFAULT_POOL_SIZE; i++) {\n ProxyConnection connection = new ProxyConnection(databaseInitializer.getConnection());\n connections.put(connection);\n }\n } catch (InterruptedException e) {\n logger.log(Level.ERROR, e);\n }\n }",
"private void initializeConnections() {\n connectionsCB.getItems().clear();\n connectionsCB.valueProperty().addListener(this);\n ConnectionsWrapper connection = (ConnectionsWrapper) XMLFileManager.loadXML(\"connections.xml\", ConnectionsWrapper.class);\n if (connection != null && connection.getConnectionList() != null) {\n fillConnectionItem(connection.getConnectionList());\n }\n }",
"public void setup(){\n\t\ttry{\n\t\t\tSocket serverSocket;\n\t\t\tboolean serverRunning = true;\n\t\t\twhile(serverRunning == true){\n\t\t\t\t serverSocket = server.accept();\n\t\t\t\t System.out.println(\"Connected to the server!\");\n\t\t\t\t DungeonClient connectedClient = new DungeonClient(serverSocket, game);\n\t\t\t\t connectedClient.start();\n\t\t\t}\n\t\t}\n\t\tcatch(IOException e){\n\t\t\tSystem.out.println(\"Sorry, there was an IOException!\");\n\t\t}\n\t}",
"public void setPeer(Peer peer);",
"private ClientExecutorEngine() {\n ClientConfigReader.readConfig();\n DrillConnector.initConnection();\n HzConfigReader.readConfig();\n }",
"public void init() {\n\t\t\n\t\tdebugPrintln(\"Doing init.\");\n\t\t\n\t\t// can sanity check some things by requesting notification when nodes\n\t\t// are created/deleted/etc.\n\t\t// It does not notify when playBufs reach the end of a buffer, though.\n\t\t// Too bad, that. Would have to poll.\n\t\tsendMessage(\"/notify\", new Object[] { 1 });\n\n\t\t//start by cleaning up any detritus from previous runs on the same server:\n\t\tcleanup();\n\n\t\t//sclang creates the default group, not supercollider, so let's follow that convention.\n\t\tcreateGroup(1, 0);\n\n\t\t// create a mother group, under the default group (1),\n\t\t// which will contain all of the SCSoundControl objects.\n\t\t//this is where we would query if another node == _motherGroupID already exists.\n\t\t//if so, would need to choose an alternate groupID (e.g. += 10000)\n\t\tcreateGroup(_motherGroupID, 1);\n\t\t\n\t}",
"public void init(SessionProperties params) {\n \t\tlocalport = Integer.parseInt(params.getProperty(\"localport\"));\n \t\tserverName = params.getProperty(\"servername\");\n \n \t\tString gossipHost = params.getProperty(\"gossiphost\");\n \t\tint gossipPort = Integer.parseInt(params.getProperty(\"gossipport\"));\n \n \t\ttry {\n \t\t\tgossipServers = new InetSocketAddress[1];\n \t\t\tgossipServers[0] = new InetSocketAddress(InetAddress.getByName(gossipHost),gossipPort);\n \t\t\tSystem.out.println(\"Gossip: \"+gossipServers[0]);\n \t\t} catch (UnknownHostException e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t}",
"public void peersAdded(List<Response> peerList) {\n peerList.stream()\n .filter(peer -> connectionMap.get(peer.getString(\"address\")) == null &&\n !peer.getString(\"version\").isEmpty())\n .forEach(peer -> {\n connectionList.add(peer);\n connectionMap.put(peer.getString(\"address\"), peer);\n if (State.fromCode(peer.getInt(\"state\")) == State.CONNECTED)\n activeCount++;\n });\n fireTableDataChanged();\n }",
"@Ignore\n @Test\n public void startReiver() throws IOException, InterruptedException {\n\n final int maxPeers = 10;\n PeerDHT[] peers = createPeers(PORT, maxPeers, \"receiver\");\n for (int i = 1; i < maxPeers; i++) {\n \tPeerDHT peer = peers[i];\n peer.peer().bootstrap().peerAddress(peers[0].peer().peerAddress()).start().awaitUninterruptibly();\n peer.peer().objectDataReply(new ObjectDataReply() {\n @Override\n public Object reply(final PeerAddress sender, final Object request) throws Exception {\n System.out.println(\"got it!\");\n return \"recipient got it\";\n }\n });\n }\n Thread.sleep(Long.MAX_VALUE);\n }",
"private RelationManager() {\n\t\tserver = XMPPServer.getInstance();\n\t}",
"private void init() {\n\n\t\tgroup = new NioEventLoopGroup();\n\t\ttry {\n\t\t\thandler = new MoocHandler();\n\t\t\tBootstrap b = new Bootstrap();\n\t\t\t\n\t\t\t\n\t\t\t//ManagementInitializer ci=new ManagementInitializer(false);\n\t\t\t\n\t\t\tMoocInitializer mi=new MoocInitializer(handler, false);\n\t\t\t\n\t\t\t\n\t\t\t//ManagemenetIntializer ci = new ManagemenetIntializer(handler, false);\n\t\t\t//b.group(group).channel(NioSocketChannel.class).handler(handler);\n\t\t\tb.group(group).channel(NioSocketChannel.class).handler(mi);\n\t\t\tb.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 10000);\n\t\t\tb.option(ChannelOption.TCP_NODELAY, true);\n\t\t\tb.option(ChannelOption.SO_KEEPALIVE, true);\n\n\t\t\t// Make the connection attempt.\n\t\t\tchannel = b.connect(host, port).syncUninterruptibly();\n\n\t\t\t// want to monitor the connection to the server s.t. if we loose the\n\t\t\t// connection, we can try to re-establish it.\n\t\t\tChannelClosedListener ccl = new ChannelClosedListener(this);\n\t\t\tchannel.channel().closeFuture().addListener(ccl);\n\t\t\tSystem.out.println(\" channle is \"+channel);\n\t\t} catch (Exception ex) {\n\t\t\tlogger.error(\"failed to initialize the client connection\", ex);\n\n\t\t}\n\n\t\t// start outbound message processor\n\t//\tworker = new OutboundWorker(this);\n\t//\tworker.start();\n\t}",
"public static void main(String[] args) throws Exception {\n\t\tSystem.out.println(\"Peer Server Started!!\");\r\n\t\tServerSocket serverSocket=null;\r\n\t\ttry {\r\n\t\t\tserverSocket =new ServerSocket(PEER_LISTEN_PORT);\r\n\t\t\tSystem.out.println(\"Peer Client Started!!\");\r\n\t\t\tnew PeerClient().start();\r\n\t\t\t\r\n\t\t\twhile(true)\r\n\t\t\t{\r\n\t\t\t\t new PeerServer(serverSocket.accept()).start();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tfinally\r\n\t\t{\r\n\t\t\tserverSocket.close();\r\n\t\t}\r\n\t\t\r\n\t}",
"private void restoreInitConnectors() {\n if (!hasPlug()) {\n return; // Already in original state\n }\n\n // We have to check for a plug connector.\n Long id = getPlugBlockID();\n if (id != null && !id.equals(Block.NULL)) {\n disconnectBlock(id);\n }\n\n // Always synchronize! We can't have both a plug and a before.\n removePlug();\n resetBeforeAndAfter();\n RenderableBlock.getRenderableBlock(getBlockID()).updateConnectors();\n notifyRenderable();\n }",
"private void resetClient()\n\t{\n\t\tSystem.out.println(\"\\n---Resetting client...\");\n\t\tSystem.out.println(\"\\n\");\n\t\tinitialize();\n\t}",
"public ServerPlayers() {\n sockets = new ArrayList<Socket>();\n }",
"private void checkSeeds() {\n\t\t//proceed on mainloop 1 second intervals if we're a seed and we want to force disconnects\n\t\tif ((mainloop_loop_count % MAINLOOP_ONE_SECOND_INTERVAL) != 0)\n\t\t\treturn;\n\n\t\tif (!disconnect_seeds_when_seeding ){\n\t\t\treturn;\n\t\t}\n\n\t\tArrayList to_close = null;\n\n\t\tfinal ArrayList peer_transports = peer_transports_cow;\n\t\tfor (int i = 0; i < peer_transports.size(); i++) {\n\t\t\tfinal PEPeerTransport pc = (PEPeerTransport) peer_transports.get(i);\n\n\t\t\tif (pc != null && pc.getPeerState() == PEPeer.TRANSFERING && ((isSeeding() && pc.isSeed()) || pc.isRelativeSeed())) {\n\t\t\t\tif( to_close == null ) to_close = new ArrayList();\n\t\t\t\tto_close.add( pc );\n\t\t\t}\n\t\t}\n\n\t\tif( to_close != null ) {\t\t\n\t\t\tfor( int i=0; i < to_close.size(); i++ ) { \t\t\t\n\t\t\t\tcloseAndRemovePeer( (PEPeerTransport)to_close.get(i), \"disconnect other seed when seeding\", false );\n\t\t\t}\n\t\t}\n\t}",
"public static void init() {\n startTime = System.currentTimeMillis();\n if (clientExecutorEngine == null) {\n clientExecutorEngine = new ClientExecutorEngine();\n HzClient.initClient();\n }\n }",
"public void start() {\n\n // ask information\n String address = JOptionPane.showInputDialog(null, \"Connect to server:\", \"Input\", JOptionPane.QUESTION_MESSAGE);\n String ac = JOptionPane.showInputDialog(null, \"Username:\", \"Input\", JOptionPane.QUESTION_MESSAGE);\n String pw = JOptionPane.showInputDialog(null, \"Password:\", \"Input\", JOptionPane.QUESTION_MESSAGE);\n\n try {\n\n // connect to server\n Socket s = new Socket(address, 9000);\n\n ObjectOutputStream w = new ObjectOutputStream(s.getOutputStream());\n ObjectInputStream r = new ObjectInputStream(s.getInputStream());\n\n Hash h = new Hash(); // hash password\n w.writeObject(new Message(ac, \"Teacher\", \"LOGIN\", 0, h.getHashCode(pw), null)); // check login status\n w.flush();\n Message m = (Message) r.readObject();\n if (m.command.equals(\"LOGIN_FAILED\")) { // display message and exit if fail\n\n JOptionPane.showMessageDialog(null, \"Login fail\", \"Message\", JOptionPane.INFORMATION_MESSAGE);\n System.exit(1);\n\n }\n\n server = address;\n peerList = (PeerList) m.peerList;\n port = (int) m.data;\n\n new Thread(new GUI()).start();\n while (initialized == false){ // wait until setup all GUI components\n\n Thread.sleep(500);\n\n }\n\n new Thread(new upload()).start();\n new Thread(new updateList()).start();\n new Thread(new download(address, 9001)).start(); // try to connect server by port 9001, 9002, 9003...\n\n } catch (Exception e) {\n\n System.exit(1);\n\n }\n\n }",
"private int getNumPeers() {\n String[] peerIdList = skylinkConnection.getPeerIdList();\n if (peerIdList == null) {\n return 0;\n }\n // The first Peer is the local Peer.\n return peerIdList.length - 1;\n }",
"private boolean initiateConnections(RegistrySendsNodeManifest event)\n\t\t\tthrows UnknownHostException, IOException {\n\t\t// close all getConnections() from previous overlay.\n\t\tfor (Map.Entry<Integer, TCPConnection> entry : this.nodesToSendTo.getConnections()\n\t\t\t\t.entrySet()) {\n\t\t\tTCPConnection connector = entry.getValue();\n\t\t\tconnector.closeSocket();\n\t\t}\n\t\t//Create sockets to peers\n\t\tallNodes = event.getAllNodes();\n\t\tint numConnectionsToMake = event.getRoutingTableSize();\n\t\tnodesToSendTo = new TCPConnectionsCache();\n\t\tfor (int i = 0; i < numConnectionsToMake; i++) {\n\t\t\tString ipAdd = \"\";\n\t\t\tfor (int j = 0; j < event.getIPLen(i); j++) {\n\t\t\t\tint ipPortion = event.getHopIP(i)[j] & 0xFF;\n\t\t\t\tipAdd += ipPortion;\n\t\t\t\tif (j < event.getIPLen(i) - 1)\n\t\t\t\t\tipAdd += \".\";\n\t\t\t}\n\t\t\tSocket hopSocket = new Socket(ipAdd, event.getHopPort(i));\n\t\t\tTCPConnection hop = new TCPConnection(hopSocket, this);\n\t\t\tnodesToSendTo.putConnection(hop, event.getHopID(i));\n\t\t}\n\t\t//Ensure each socket connection was successful\n\t\tboolean connectionsAllGood = true;\n\t\tfor (Map.Entry<Integer, TCPConnection> entry : nodesToSendTo.getConnections()\n\t\t\t\t.entrySet()) {\n\t\t\tTCPConnection value = entry.getValue();\n\t\t\tif (!value.checkSocketStatus())\n\t\t\t\treturn false;\n\t\t}\n\t\treturn connectionsAllGood;\n\t}",
"public TCPMessengerServer() {\n initComponents();\n customInitComponents();\n listenForClient(); \n }",
"@BeforeClass\n public static void setUp() throws Exception {\n int port = 10001;\n System.out.println(port);\n int reconnectPeriod = 200;\n client = Exchangers.connect(URL.valueOf(\"telnet://127.0.0.1:\" + port + \"?client=netty&serialization=protobuf&check=false&\"+Constants.RECONNECT_KEY+\"=\"+reconnectPeriod ), new TelnetClientHandler());\n server = Exchangers.bind(URL.valueOf(\"telnet://127.0.0.1:\" + port + \"?server=netty&serialization=protobuf\"), new TelnetServerHandler());\n System.out.println(client.isConnected());\n while(!client.isConnected()){\n TimeUnit.SECONDS.sleep(1);\n }\n System.out.println(client.isConnected());\n }",
"protected synchronized void startClients() throws Exception {\r\n if (this.clients != null) {\r\n for (Client client : this.clients) {\r\n client.start();\r\n }\r\n }\r\n }",
"@Before\n\tpublic void reset()\n\t{\n\t\tClientPlayerManager.resetSingleton();\n\t\tChatManager.resetSingleton();\n\t\tQualifiedObservableConnector.resetSingleton();\n\t}",
"protected void startConnect() {\n if (tcp) {\n connection = new TCPConnection(this);\n } else {\n connection = new UDPConnection(this, udpSize);\n }\n connection.connect(remoteAddr, localAddr);\n }",
"public synchronized void prunePeers() {\n\t\tchecker.checkList(this.getPeers());\n\t}",
"private boolean initClients(boolean useCert) {\n try {\n _defaultClient = _vcVlsi.connect(_vcCreds, useCert, false);\n _cloneClient = _vcVlsi.connect(_vcCreds, useCert, true);\n if ((_defaultClient == null) || (_cloneClient == null)) {\n _log.log(Level.WARNING, \"Unable to get VC client\");\n return false;\n }\n return true;\n } catch (Exception e) {\n _log.log(Level.WARNING, \"VC connection failed (\"+e.getClass()+\"): \"+e.getMessage());\n return false;\n }\n }",
"@Override\n\tpublic void initialize() {\n\t\ttransportManager = newServerTransportManager();\n\t\ttransportServer = newTransportServer();\n\t\tserverStateMachine = newTransportServerStateMachine();\n\n\t\tserverStateMachine.setServerTransportComponentFactory(this);\n\t\ttransportManager.setServerTransportComponentFactory(this);\n\t\ttransportServer.setServerTransportComponentFactory(this);\n\t\ttransportServer.setServerHostConfig(getServerHostConfig());\n\n\t\tsetInitialized(true);\n\t}",
"@Before\n public void setUp() throws Exception {\n\n clientObserver = mock(MarshalObserver.class);\n client2Observer = mock(MarshalObserver.class);\n serverObserver = mock(MarshalObserver.class);\n\n client = getClientStrategy();\n client2 = getClientStrategy();\n server = getServerStrategy();\n\n client.setListener(clientObserver);\n client2.setListener(client2Observer);\n server.setListener(serverObserver);\n }",
"public void start(){\n log.debug(\"Starting Host Router\");\n lobbyThread = pool.submit(new Runnable() {\n public void run() {\n waitForClients();\n }\n });\n }",
"private void initServer() throws IOException {\r\n \t\tLogger.logMessage(\"Binding Server to \" + this.serverIpAddress + \":\" + this.serverPort);\r\n \r\n \t\tthis.isAlive = true;\r\n \t\tthis.serverSocket = new ServerSocket(this.serverPort, this.backLog, this.serverIpAddress);\r\n \t\tthis.dataLayer = DataLayerFactory.getDataLayer();\r\n \r\n \t\t// Generate the grouplist\r\n \t\tCollection<String> dbGroupList = this.dataLayer.getGroups();\r\n \r\n \t\tfor (String group : dbGroupList) {\r\n \t\t\tthis.groupList.addGroup(group);\r\n \t\t}\r\n \r\n \t\tLogger.logMessage(\"Server successfuly bound!\");\r\n \t}",
"private void connection() {\n boolean connect;\n try {\n connect = true;\n this.jTextArea1.setText(\"Server starts...\");\n server = new MultiAgentServer(this);\n String ip = \"\";\n int errorBit = 256;\n for (int i = 0; i < server.getIpAddr().length; i++) {\n int currentIP = server.getIpAddr()[i];\n if (currentIP < 0) {\n currentIP += errorBit;\n }\n ip += currentIP + \".\";\n }\n ip = ip.substring(0, ip.length() - 1);\n System.out.println(ip);\n Naming.rebind(\"//\" + ip + \"/server\", server);\n this.jTextArea1.setText(\"Servername: \" + ip);\n this.jTextArea1.append(\"\\nServer is online\");\n } catch (MalformedURLException | RemoteException e) {\n this.jTextArea1.append(\"\\nServer is offline, something goes wrong!!!\");\n connect = false;\n }\n if (dialog.getMusicBox().isSelected()) {\n sl = new SoundLoopExample();\n }\n reconnectBtn.setEnabled(!connect);\n }",
"void initAndListen() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tSocket clientSocket = serverSocket.accept();\n\t\t\t\t// Startuje nowy watek z odbieraniem wiadomosci.\n\t\t\t\tnew ClientHandler(clientSocket, this);\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(\"Accept failed.\");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}\n\t}",
"void initAgents() {\n Runtime rt = Runtime.instance();\n\n //Create a container to host the Default Agent\n Profile p = new ProfileImpl();\n p.setParameter(Profile.MAIN_HOST, \"localhost\");\n //p.setParameter(Profile.MAIN_PORT, \"10098\");\n p.setParameter(Profile.GUI, \"false\");\n ContainerController cc = rt.createMainContainer(p);\n\n HashMap<Integer, String> neighbors = new HashMap <Integer, String>();\n neighbors.put(1, \"2, 4, 3\");\n neighbors.put(2, \"1, 3\");\n neighbors.put(3, \"1, 2, 4\");\n neighbors.put(4, \"1, 3, 5\");\n neighbors.put(5, \"4\");\n\n//Create a container to host the Default Agent\n try {\n for (int i = 1; i <= MainController.numberOfAgents; i++) {\n AgentController agent = cc.createNewAgent(Integer.toString(i), \"ru.spbu.mas.DefaultAgent\",\n new Object[]{neighbors.get(i)});\n agent.start();\n }\n } catch (StaleProxyException e) {\n e.printStackTrace();\n }\n }",
"public ServerNMS() {\n\t\tclients = new LinkedList<PrintWriter>();\n\t}",
"public void onPeerConnectionClosed();",
"@Override\n\tpublic boolean init()\n\t{\n\t\tentityMap = new EntityIDMap();\n\t\t\n\t\tServerBootstrap bootstrap = new ServerBootstrap();\n\t\tbootstrap.group(bossGroup, workerGroup)\n\t\t\t\t.channel(NioServerSocketChannel.class) // Channel type\n\t\t\t\t.childHandler(new ChannelInitializer<SocketChannel>() // Setup ChannelInitializer\n\t\t\t\t{\n\t\t\t\t\t@Override\n\t\t\t\t\tprotected void initChannel(SocketChannel ch)\n\t\t\t\t\t{\n\t\t\t\t\t\t// On client connect:\n\t\t\t\t\t\t// Send back client-id\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Client side:\n\t\t\t\t\t\t// Send back position of player\n\t\t\t\t\t\t// client id | pos x | pos y | pos z\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Server side:\n\t\t\t\t\t\t// Broadcast all player positions\n\t\t\t\t\t\tch.pipeline().addLast(new LengthFieldPrepender(2));\n\t\t\t\t\t\tch.pipeline().addLast(new LengthFieldBasedFrameDecoder(0xFFFF, 0, 2));\n\t\t\t\t\t\tch.pipeline().addLast(new PacketCodec());\n\t\t\t\t\t\tch.pipeline().addLast(new ServerChannelHandler(instance));\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.option(ChannelOption.SO_BACKLOG, 128)\n\t\t\t\t.childOption(ChannelOption.SO_KEEPALIVE, true);\n\t\t\n\t\t// Bind & start accepting connections\n\t\ttry\n\t\t{\n\t\t\tChannelFuture f = bootstrap.bind(this.hostPort).sync();\n\t\t\tserverChannel = f.channel();\n\t\t}\n\t\tcatch (InterruptedException e)\n\t\t{\n\t\t\tSystem.err.println(\"Unable to bind to the requested port\");\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public synchronized void start() {\n\t\tif(isStarted) {\n\t\t\treturn;\n\t\t}\n\t\tif(isStopped) {\n\t\t\tthrow new IllegalStateException(\"Cannot restart a TorClient instance. Create a new instance instead.\");\n\t\t}\n\t\tlogger.info(\"Starting Orchid (version: \"+ Tor.getFullVersion() +\")\");\n\t\tverifyUnlimitedStrengthPolicyInstalled();\n\t\tdirectoryDownloader.start(directory);\n\t\tcircuitManager.startBuildingCircuits();\n\t\tif(dashboard.isEnabledByProperty()) {\n\t\t\tdashboard.startListening();\n\t\t}\n\t\tisStarted = true;\n\t}",
"private void init() {\n // To account for race conditions, if sharding manager is still null. Then ignore it;\n if (ShardingManager.getInstance() == null)\n return;\n\n // Get a list of all of the shards, since the channels could be on any one.\n Map<Integer, InternalShard> shards = ShardingManager.getInstance().getShards();\n\n // Check the shard for either one, keep in mind its possible that the channels could be on different servers/shards\n for (InternalShard s : shards.values()) {\n if (debugChannel == null) {\n debugChannel = s.getJda().getTextChannelById(debugChannelId);\n }\n if (errorChannel == null) {\n errorChannel = s.getJda().getTextChannelById(errorChannelId);\n }\n if (errorChannel != null && debugChannel != null) {\n // If we found them both then stop looking\n break;\n }\n }\n if (errorChannel != null || debugChannel != null) {\n // If one is found we know that we can get channels but the other is just setup wrong. It will be ignored in logic\n initialized = true;\n }\n }",
"public void bluetooth_setup_client()\r\n {\n\r\n\t\tIntentFilter filter = new IntentFilter();\r\n\t\tfilter.addAction(BluetoothDevice.ACTION_FOUND);\r\n\t\tfilter.addAction(BluetoothAdapter.ACTION_DISCOVERY_FINISHED);\r\n\t\tif(client_receiver != null) {\r\n\t\t\tLoaderActivity.m_Activity.unregisterReceiver(client_receiver);\r\n\t\t}\r\n\t\tclient_receiver = new Bluetooth_Device_Found_Revicer();\r\n\t\tLoaderActivity.m_Activity.registerReceiver(client_receiver, filter);\r\n\t\tbluetooth_adapter.startDiscovery();\r\n\t\tmessages.clear();\r\n }",
"public void init() {\r\n\t\ttry {\r\n\t\t\tmessages = new ConcurrentLinkedDeque<>();\r\n\t\t\tout = sock.getOutputStream();\r\n\t\t\tin = sock.getInputStream();\t\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tstartMessageThread();\r\n\t}",
"public DuckSourceRemote initialize() throws Exception;",
"public void setup_servers()\n {\n // get ServerInfo\n ServerInfo t = new ServerInfo();\n // all 3 servers\n for(int i=0;i<3;i++)\n {\n // get the server IP and port info\n String t_ip = t.hmap.get(i).ip;\n int t_port = Integer.valueOf(t.hmap.get(i).port);\n Thread x = new Thread()\n {\n public void run()\n {\n try\n {\n Socket s = new Socket(t_ip,t_port);\n // SockHandle instance with svr_hdl true and rx_hdl false as this is the socket initiator\n SockHandle t = new SockHandle(s,my_ip,my_port,my_c_id,c_list,s_list,false,true,cnode);\n }\n catch (UnknownHostException e) \n {\n \tSystem.out.println(\"Unknown host\");\n \tSystem.exit(1);\n } \n catch (IOException e) \n {\n \tSystem.out.println(\"No I/O\");\n e.printStackTrace(); \n \tSystem.exit(1);\n }\n }\n };\n \n x.setDaemon(true); \t// terminate when main ends\n x.setName(\"Client_\"+my_c_id+\"_SockHandle_to_Server\"+i);\n x.start(); \t\t\t// start the thread\n }\n }",
"public MyModel() {\n mazeGeneratingServer = new Server(5400, 1000, new ServerStrategyGenerateMaze());\n solveSearchProblemServer = new Server(5401, 1000, new ServerStrategySolveSearchProblem());\n //Raise the servers\n }",
"@Test\n public void runTests() throws Exception {\n HFClient client = clientFactory.createHFClient(peerorg1.getAdmin());\n Channel channel1 = channelClient.createChannel(\n client, CHANNEL1, channel1Config,\n Arrays.asList(\n ordererorg1.getOrderers().get(ORDERER1)\n ),\n Arrays.asList(\n peerorg1.getAdmin(), peerorg2.getAdmin()\n )\n );\n\n assertThat(channel1.isInitialized()).isFalse();\n\n /**\n * Request to join channel for [peer1.peerorg1, peer2.peerorg1, peer1.peerorg1]\n */\n channel1 = channelClient.joinPeer(client, channel1, peerorg1.getPeers().get(PEER1));\n channel1 = channelClient.joinPeer(client, channel1, peerorg1.getPeers().get(PEER2));\n\n client.setUserContext(peerorg2.getAdmin());\n channel1 = channelClient.joinPeer(client, channel1, peerorg2.getPeers().get(PEER1));\n channel1.initialize();\n assertThat(channel1.isInitialized()).isTrue();\n\n /**\n * Create a Channel instance for created already\n */\n assertThat(client.getChannel(CHANNEL1)).isNotNull();\n client = clientFactory.createHFClient(peerorg1.getAdmin());\n assertThat(client.getChannel(CHANNEL1)).isNull();\n\n channel1 = channelClient.buildChannel(\n client, CHANNEL1,\n Arrays.asList(\n ordererorg1.getOrderers().get(ORDERER1)\n ),\n Arrays.asList(\n peerorg1.getPeers().get(PEER1),\n peerorg1.getPeers().get(PEER2),\n peerorg2.getPeers().get(PEER1)\n )\n );\n assertThat(channel1.isInitialized()).isFalse();\n channel1.initialize();\n assertThat(channel1.isInitialized()).isTrue();\n }",
"void init() {\n CometUtils.printCometSdkVersion();\n validateInitialParams();\n this.connection = ConnectionInitializer.initConnection(\n this.apiKey, this.baseUrl, this.maxAuthRetries, this.getLogger());\n this.restApiClient = new RestApiClient(this.connection);\n // mark as initialized\n this.alive = true;\n }",
"public void initReceiver() {\n }"
] | [
"0.67200506",
"0.64776325",
"0.64512944",
"0.63968784",
"0.6334722",
"0.6316276",
"0.6219813",
"0.6203452",
"0.61991",
"0.6155754",
"0.606091",
"0.60518074",
"0.59104055",
"0.5904325",
"0.58820224",
"0.5875123",
"0.58669025",
"0.5847091",
"0.5823106",
"0.58195",
"0.5812666",
"0.5812588",
"0.58023304",
"0.5800246",
"0.57899594",
"0.5786251",
"0.5781044",
"0.57665336",
"0.5759784",
"0.5748055",
"0.5743228",
"0.57355535",
"0.5730395",
"0.5729205",
"0.5725344",
"0.57144344",
"0.57143915",
"0.5692843",
"0.5686731",
"0.5686655",
"0.56840956",
"0.5681432",
"0.5671402",
"0.56678516",
"0.5657027",
"0.5653951",
"0.56347847",
"0.563183",
"0.56288284",
"0.56238514",
"0.5622107",
"0.5618909",
"0.5614621",
"0.56141454",
"0.56059045",
"0.56003225",
"0.5587783",
"0.5580453",
"0.55577606",
"0.5557409",
"0.55514604",
"0.55467176",
"0.5545661",
"0.5545523",
"0.5543612",
"0.5537657",
"0.5536088",
"0.553433",
"0.5527012",
"0.5520553",
"0.5519984",
"0.5511258",
"0.55072784",
"0.55036503",
"0.5494354",
"0.549304",
"0.54772675",
"0.5469296",
"0.546439",
"0.5460122",
"0.54592496",
"0.5458025",
"0.54573065",
"0.545382",
"0.5452538",
"0.5451893",
"0.54437244",
"0.54382044",
"0.5432248",
"0.5432218",
"0.5425051",
"0.5417723",
"0.5416538",
"0.5411528",
"0.54110485",
"0.5404589",
"0.53962505",
"0.5390424",
"0.53766197",
"0.5375065"
] | 0.78112334 | 0 |
Implemented by classes that allow to search for patterns in their keys. | public interface IPatternMap<K, V> {
/**
* return a Hashtable of the entries that matche the pattern
* @param pattern
* @return
*/
public Hashtable<K, V> getPattern(String pattern);
/**
* return a Hashtable of the entries that match the wildcard (*)
* @param pattern
* @return
*/
public Hashtable<K, V> getWildcard(String wildcard);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Set<String> getKeysMatchingPattern(String pattern);",
"public Iterable<String> keysThatMatch(String pattern)\r\n {\r\n Queue<String> q = new Queue<String>();\r\n if ((pattern.equals(\"\") || pattern.equals(\".\")) && null_str_val != null)\r\n q.enqueue(\"\");\r\n collect(root, \"\", pattern, q);\r\n return q;\r\n }",
"public List<String> getKeysByPattern(String patternKey){\n RKeys keys = redissonClient.getKeys();\n Iterable<String> foundedKeys = keys.getKeysByPattern(patternKey);\n List<String> list = new ArrayList<>();\n foundedKeys.forEach(key -> list.add(key));\n return list;\n }",
"boolean matches(String key) {\n int keyLength = key.length();\n int patternLength = pattern.length();\n boolean[][] state = new boolean[keyLength + 1][patternLength + 1];\n state[0][0] = true; // empty key matches empty pattern\n for (int i = 0; i < patternLength; i++) {\n if (pattern.charAt(i) == '*') state[0][i + 1] = state[0][i]; // whether first empty matches pattern\n }\n for (int i = 0; i < keyLength; i++) {\n for (int j = 0; j < patternLength; j++) {\n char ch = pattern.charAt(j);\n if (ch == '?' || key.charAt(i) == ch) {\n state[i + 1][j + 1] = state[i][j];\n } else if (ch == '*') {\n state[i + 1][j + 1] = state[i][j + 1] || state[i + 1][j];\n }\n }\n }\n return state[keyLength][patternLength];\n }",
"public Hashtable<K, V> getPattern(String pattern);",
"public Iterable<String> keysThatMatch(String pat) {\n LinkedList<String> q = new LinkedList<String>();\n collect(root, pat, \"\", q);\n return q;\n }",
"public Set<String> regexFindKeys(String regex);",
"public TypeFilterHonSearch(String key) {\r\n\t\temptyKey = StringUtils.isEmpty(key);\r\n\t\tif (emptyKey == false) {\r\n\t\t\tkey = key.trim().toLowerCase();\r\n\t\t\tif (key.length() > 0) {\r\n\t\t\t\tif (key.charAt(key.length() - 1) != '*') {\r\n\t\t\t\t\tkey += '*';\r\n\t\t\t\t}\r\n\t\t\t\tpattern = Pattern.compile(StringUtils.replace(key, \"*\", \".*\"));\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"@Override\r\n public Map<K, ICacheElement<K, V>> processGetMatching(final String pattern)\r\n {\r\n final Map<K, ICacheElement<K, V>> elements = new HashMap<>();\r\n Set<K> keyArray = null;\r\n storageLock.readLock().lock();\r\n try\r\n {\r\n keyArray = new HashSet<>(keyHash.keySet());\r\n }\r\n finally\r\n {\r\n storageLock.readLock().unlock();\r\n }\r\n\r\n final Set<K> matchingKeys = getKeyMatcher().getMatchingKeysFromArray(pattern, keyArray);\r\n\r\n for (final K key : matchingKeys)\r\n {\r\n final ICacheElement<K, V> element = processGet(key);\r\n if (element != null)\r\n {\r\n elements.put(key, element);\r\n }\r\n }\r\n return elements;\r\n }",
"@Override\n public Map<K, ICacheElement<K, V>> getMatchingCacheElements( final String pattern )\n {\n return this.getCacheControl().getMatching( pattern );\n }",
"public interface Analyzer {\n\n Map<String, List<Integer>> search(StringBuffer text, String... pattern);\n}",
"public void handlePatternKey(KnightSubject source);",
"@Override\n public Map<K, V> getMatching( final String pattern )\n {\n final Map<K, V> unwrappedResults;\n\n final Map<K, ICacheElement<K, V>> wrappedResults = this.getCacheControl().getMatching( pattern );\n\n if ( wrappedResults == null )\n {\n unwrappedResults = new HashMap<>();\n }\n else\n {\n unwrappedResults = wrappedResults.entrySet()\n .stream()\n .filter(entry -> entry.getValue() != null)\n .collect(Collectors.toMap(\n Entry::getKey,\n entry -> entry.getValue().getVal()));\n }\n\n return unwrappedResults;\n }",
"private boolean matchString(String s, String key)\n {\n if (s.equals(key)) return true;\n int min = s.length()<key.length()?s.length():key.length();\n for (int i=0;i<min; ++i)\n {\n \n if(key.charAt(i) == '*')\n return true;\n if(s.charAt(i) != key.charAt(i) && key.charAt(i) != '?')\n return false;\n }\n for (int i=s.length();i<key.length();i++)\n {\n if (key.charAt(i)!='*') \n return false;\n }\n return true;\n }",
"public Hashtable<K, V> getWildcard(String wildcard);",
"PatternMapping getPatternMapping();",
"public WildcardPattern(String pattern) {\r\n this.pattern = pattern;\r\n }",
"public static Iterator getKeysMatching(String inKeyPrefix) {\r\n HashSet matchingKeys = new HashSet();\r\n for (Iterator i = getProperties().keySet().iterator(); i.hasNext(); ) {\r\n String key = (String) i.next();\r\n if (key.startsWith(inKeyPrefix)) {\r\n matchingKeys.add(key);\r\n }\r\n }\r\n return matchingKeys.iterator();\r\n }",
"public abstract List<String> getAllKeys();",
"private void findMatches(String key, String path, boolean caseSensitive, boolean fileName) {\n\t\tfor (String word : document) {\n\t\t\tif (contains(key, word, caseSensitive)) {\n\t\t\t\tif (fileName) {\n\t\t\t\t\tSystem.out.println(path);\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(word);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"String search(int key);",
"@Override\n protected FilterResults performFiltering(CharSequence arg0) {\n String[] tmp = API.it().getKeywords(arg0.toString());\n FilterResults results = new FilterResults();\n results.values = tmp;\n results.count = tmp.length;\n return results;\n }",
"private void initRegs(){\n\n keyWordReg = \"\";\n\n for (String seg: keyWordMap.keySet()){\n\n keyWordReg += seg + \"|\";\n\n }\n\n symbolReg = \"[\\\\&\\\\*\\\\+\\\\(\\\\)\\\\.\\\\/\\\\,\\\\-\\\\]\\\\;\\\\~\\\\}\\\\|\\\\{\\\\>\\\\=\\\\[\\\\<]\";\n intReg = \"[0-9]+\";\n strReg = \"\\\"[^\\\"\\n]*\\\"\";\n idReg = \"[a-zA-Z_]\\\\w*\";\n\n tokenPatterns = Pattern.compile(idReg + \"|\" + keyWordReg + symbolReg + \"|\" + intReg + \"|\" + strReg);\n }",
"public abstract boolean lookup(Key key);",
"private static boolean doesPatternExist(Map<Byte, byte[]> haystack,\n byte[] needle) {\n if (needle == null)\n return false;\n for (Byte key : haystack.keySet()) {\n if (Arrays.equals(haystack.get(key), needle)) {\n return true;\n }\n }\n return false;\n }",
"@Override\n\tpublic int hashCode() {\n\t\treturn pattern.hashCode();\n\t\t// just enough fields for a reasonable distribution\n\t}",
"protected abstract Regex pattern();",
"int containsMatchingPattern(Set<String> values, String pattern, boolean matchPrefix) {\n return memoizer.matches(values, pattern, matchPrefix, () -> {\n int match = -1;\n for(String val : values) {\n String replaced = val.replaceAll(\"\\\\.\", \"\\\\\\\\.\").replaceAll(\"\\\\*\", \".*\");\n if(Pattern.compile(replaced).matcher(pattern).matches() || (matchPrefix && val.startsWith(pattern + \".\"))) {\n match = replaced.contains(\"*\") ? 0 : 1;\n break;\n }\n }\n return match;\n });\n }",
"public static void main(String[] args) {\n HashMap<String, String> dict1 = new HashMap<>();\n dict1.put(\"a\", \"x\");\n System.out.println(resolve(\"<%a%>\", dict1)); // x\n\n /* test case 2 */\n HashMap<String, String> dict2 = new HashMap<>();\n dict2.put(\"a\", \"x\");\n System.out.println(resolve(\"<%%>\", dict2)); // <%%>\n\n /* test case 3 */\n HashMap<String, String> dict3 = new HashMap<>();\n dict3.put(\"a\", \"x\");\n System.out.println(resolve(\"x<%a%>x\", dict3)); // xxx\n\n /* test case 4 */\n HashMap<String, String> dict4 = new HashMap<>();\n dict4.put(\"b\", \"y\");\n dict4.put(\"c\", \"z\");\n System.out.println(resolve(\"aaaaa<%%>bbbbb<%b%>ccccc<%c%>\", dict4)); // aaaaa<%%>bbbbbycccccz\n\n /* test case 5 */\n HashMap<String, String> dict5 = new HashMap<>();\n dict5.put(\"a\", \"x\");\n dict5.put(\"b\", \"y\");\n dict5.put(\"c\", \"z\");\n System.out.println(resolve(\"aaaaa<%a%>bbbbb<%b%>ccccc<%c%>\", dict5)); // aaaaaxbbbbbycccccz\n\n /* test case 6 */\n HashMap<String, String> dict6 = new HashMap<>();\n dict6.put(\"aa\", \"x\");\n dict6.put(\"b\", \"y\");\n dict6.put(\"c\", \"z\");\n System.out.println(resolve(\"aaaaa<%aa%>bbbbb<%b%>ccccc<%c%>\", dict6)); // aaaaaxbbbbbycccccz\n\n /* test case 7 */\n HashMap<String, String> dict7 = new HashMap<>();\n dict7.put(\"a\", \"x\");\n System.out.println(resolve(\"aaaaa<%a%>bbbbb<%a%>ccccc<%a%>\", dict7)); // aaaaaxbbbbbxcccccx\n\n /* test case 8 */\n HashMap<String, String> dict8 = new HashMap<>();\n dict8.put(\"a\", \"x\");\n dict8.put(\"b\", \"y\");\n dict8.put(\"c\", \"z\");\n System.out.println(resolve(\"aaaaa<%dd%>bbbbb<%b%>ccccc<%c%>\", dict8)); // aaaaa<%dd%>bbbbbycccccz\n }",
"@Override\n\t\t\tpublic boolean contains(String key) {\n\t\t\t\treturn false;\n\t\t\t}",
"private String regex() {\n final List<String> keys = new LinkedList<>();\n for (final String key : this.template.split(\"\\\\.\")) {\n if (key.equals(\"*\")) {\n keys.add(\"\\\\w+\");\n } else {\n keys.add(key);\n }\n }\n return String.join(\"\\\\.\", keys);\n }",
"public static interface KeyValueFilter {\r\n\t}",
"static Pattern m36427k(String str) {\n Pattern pattern;\n if (f24496af == null) {\n f24496af = new HashMap<>();\n pattern = null;\n } else {\n pattern = (Pattern) f24496af.get(str);\n }\n if (pattern != null) {\n return pattern;\n }\n if (f24496af.size() == 10) {\n f24496af.clear();\n }\n Pattern compile = Pattern.compile(str, 40);\n f24496af.put(str, compile);\n return compile;\n }",
"protected ArrayList<Pattern> keywordsToPatterns(ArrayList<String> keywords){ \r\n ArrayList<Pattern> keywordPatterns = new ArrayList<Pattern>(); \r\n\r\n //update keywords variable\r\n for(int i = 0 ; i < keywords.size() ; i++ ){\r\n keywordPatterns.add(Pattern.compile(\".*(\" + keywords.get(i) + \").*\"));\r\n }\r\n return keywordPatterns; \r\n }",
"public ContentEntry find(String[] keys, Object[] values);",
"String getKeyFormat();",
"private List<Map.Entry<String, Pattern>> addPatterns (String syntax, List<Map.Entry<String, Pattern>> translations) {\n var resources = ResourceBundle.getBundle(syntax);\n for (var key : Collections.list(resources.getKeys())) {\n var regex = resources.getString(key);\n translations.add(new AbstractMap.SimpleEntry<>(key,\n Pattern.compile(regex, Pattern.CASE_INSENSITIVE)));\n }\n return translations;\n }",
"public static ArrayList<String> getPossibilities(String key) {\n ArrayList<String> hints = new ArrayList<>();\n\n for (String a : keywords) {\n if (a.toLowerCase().startsWith(key.toLowerCase())) {\n hints.add(a);\n }\n }\n return hints;\n }",
"@In String search();",
"private Object[] getPatternItems() {\n\t\tif (patternItems != null) {\n\t\t\treturn patternItems;\n\t\t}\n\n\t\tpatternItems = PARSED_PATTERN_CACHE.get(pattern);\n\t\tif (patternItems != null) {\n\t\t\treturn patternItems;\n\t\t}\n\n\t\tboolean isPrevQuote = false;\n\t\tboolean inQuote = false;\n\t\tStringBuilder text = new StringBuilder();\n\t\tchar itemType = 0; // 0 for string literal, otherwise date/time pattern character\n\t\tint itemLength = 1;\n\n\t\tList<Object> items = new ArrayList<Object>();\n\n\t\tfor (int i = 0; i < pattern.length(); i++) {\n\t\t\tchar ch = pattern.charAt(i);\n\t\t\tif (ch == '\\'') {\n\t\t\t\tif (isPrevQuote) {\n\t\t\t\t\ttext.append('\\'');\n\t\t\t\t\tisPrevQuote = false;\n\t\t\t\t} else {\n\t\t\t\t\tisPrevQuote = true;\n\t\t\t\t\tif (itemType != 0) {\n\t\t\t\t\t\titems.add(new PatternItem(itemType, itemLength));\n\t\t\t\t\t\titemType = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tinQuote = !inQuote;\n\t\t\t} else {\n\t\t\t\tisPrevQuote = false;\n\t\t\t\tif (inQuote) {\n\t\t\t\t\ttext.append(ch);\n\t\t\t\t} else {\n\t\t\t\t\tif ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) {\n\t\t\t\t\t\t// a date/time pattern character\n\t\t\t\t\t\tif (ch == itemType) {\n\t\t\t\t\t\t\titemLength++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (itemType == 0) {\n\t\t\t\t\t\t\t\tif (text.length() > 0) {\n\t\t\t\t\t\t\t\t\titems.add(text.toString());\n\t\t\t\t\t\t\t\t\ttext.setLength(0);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\titems.add(new PatternItem(itemType, itemLength));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\titemType = ch;\n\t\t\t\t\t\t\titemLength = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// a string literal\n\t\t\t\t\t\tif (itemType != 0) {\n\t\t\t\t\t\t\titems.add(new PatternItem(itemType, itemLength));\n\t\t\t\t\t\t\titemType = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttext.append(ch);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// handle last item\n\t\tif (itemType == 0) {\n\t\t\tif (text.length() > 0) {\n\t\t\t\titems.add(text.toString());\n\t\t\t\ttext.setLength(0);\n\t\t\t}\n\t\t} else {\n\t\t\titems.add(new PatternItem(itemType, itemLength));\n\t\t}\n\n\t\tpatternItems = items.toArray(new Object[items.size()]);\n\n\t\tPARSED_PATTERN_CACHE.put(pattern, patternItems);\n\n\t\treturn patternItems;\n\t}",
"public abstract HashMap search(String keyword);",
"abstract protected Map<String, T> lookup(List<String> values);",
"public String[] getPatterns()\n/* */ {\n/* 92 */ return this.patterns;\n/* */ }",
"@Test\n public void testCrazyPatterns() {\n assertEquals(\"java\\\\.\\\\{.*\\\\}\\\\.Array\", glob2Pattern(\"java.{**}.Array\").pattern());\n assertEquals(\"java\\\\./.*<>\\\\.Array\\\\$1\", glob2Pattern(\"java./**<>.Array$1\").pattern());\n assertEquals(\"\\\\+\\\\^\\\\$\", glob2Pattern(\"+^$\").pattern());\n }",
"@Override\r\n\tpublic void search(Pattern pattern) {\r\n\t\tregularSearch.setPattern(pattern);\r\n\t\tStringBuffer result = regularSearch.lookAt(new StringBuffer(source\r\n\t\t\t\t.toString()));\r\n\t\tmatchFound(result, source);\r\n\t}",
"IIndexFragmentBinding[] findBindings(Pattern[] patterns, boolean isFullyQualified, IndexFilter filter, IProgressMonitor monitor) throws CoreException;",
"UrlMap findByKey(String key);",
"public Query regEx(String key, Object value) {\n Preconditions.checkNotNull(key);\n builder.addFilter(builder.getOperator(QueryFilterBuilder.Operators.REGEX), key, value);\n return this;\n }",
"public interface Patterns {\n String LOGIN = \"[a-zA-Z0-9]+\";\n String PASSWORD = \"[a-zA-Z0-9.-]+\";\n String EMAIL = \"[a-zA-Z0-9.-@]+\";\n}",
"public int hashCode() {\n\treturn ignoreCase ? pattern.hashCode() : ~pattern.hashCode();\n }",
"private static void findPropertyFunctions(Context context, \n BasicPattern pattern,\n PropertyFunctionRegistry registry,\n List<Triple> propertyFunctionTriples)\n {\n for ( Triple t : pattern )\n {\n if ( isMagicProperty(registry, t) )\n propertyFunctionTriples.add(t) ;\n }\n }",
"public List<HPTMatch<V>> searchSubsequences(List<K> key) {\n return searchSubsequences(key, null);\n }",
"private static Map<String, Method> buildMethoMap(final Class<?> c, String patternStr) throws Exception {\n\t\tMap<String, Method> methodMap = new HashMap<String, Method>();\n\t\tpatternStr = patternStr + \"([A-Z])(\\\\w+)\";\n\t\t\n\t\tfor (Method method : c.getMethods()) {\n\t\t\tString methodName = method.getName();\n\t\t\tPattern pattern = Pattern.compile(patternStr);\n\t\t\tMatcher matcher = pattern.matcher(methodName);\n\t\t\tif (!matcher.find()) continue;\n\t\t\t\n\t\t\tString fieldName = matcher.group(1).toLowerCase() + matcher.group(2);\n\t\t\t// Put the field into the hash table with its name as the key\n\t\t\tmethodMap.put(fieldName, method);\n\t\t}\n\t\t\n\t\treturn methodMap;\n\t}",
"protected ArrayList<String> search(String key) {\n addresses = map.get(key);\n if (addresses == null) {\n return null;\n }\n return addresses;\n }",
"@Override\n\tpublic Map<File, List<String>> grep(File directory, String fileSelectionPattern, String substringSelectionPattern,\n\t\t\tboolean recursive) {\n\t\tFile[] fileList=directory(directory,recursive,fileSelectionPattern);\n\t\t//Map<File, List<String>> grepped=new HashMap<File, List<String>>();\n\t\treturn PatternMatcher(fileList,Pattern.compile(substringSelectionPattern));\n\t}",
"String getLookupKey();",
"@Override\r\n\tpublic Node visitPatternExpr(PatternExprContext ctx) {\n\t\treturn super.visitPatternExpr(ctx);\r\n\t}",
"boolean contains(String key);",
"boolean contains(String key);",
"public String searchByMaterial(String string, ArrayList<String> materiallist, int count, Set<String> keys, Collection<String> values, Map<String, String> dataTable1) {\nfor(String s:materiallist) {\r\n\t\t\t\r\n\t\t\tif (string.equals(s)) {\r\n\t\t\t//\tSystem.out.print(s);\r\n\t\t\t\tcount--;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t\t}\r\nSystem.out.println(\"A List of Home that matches the Material \"+string+\":\");\r\n\r\nfor(String k: keys) {\r\n\t\r\n\tarraytoprintkey=k.split(\"_\");\r\n\r\n\r\n\t\r\n\t\tif(arraytoprintkey[1].equals(string)) {\r\n\t\t\t\r\n\t\t\t\tSystem.out.print(k);\r\n\t\t\t\tSystem.out.println(\" \"+dataTable1.get(k));\r\n\t\t\t\t\r\n\t\t}\r\n\r\n\t\t\r\n}\r\nSystem.out.println();\r\n\t\tif(count==0) {\r\n\t\t\treturn string;\r\n\t\t}\r\n\t\t\t\r\n\t\treturn null;\r\n\t}",
"@Override\n public Traversal<Vertex, Long> get_pattern_16_test() {\n return g.V().match(\n __.as(\"a\").out(\"KNOWS\").out(\"KNOWS\").as(\"c\"),\n __.as(\"a\").out(\"KNOWS\").as(\"c\"))\n .select(\"a\", \"c\")\n .by(\"firstName\")\n .by(\"firstName\")\n .count();\n }",
"@Override\n public Object processChars(char[] pattern, int k) {\n\n int b = clog2(k + 1) + 1;\n int l = Math.min(pattern.length, 31 / b);\n int lim = k << ((l - 1) * b);\n int ovmask = 0;\n int mask = 1 << (b - 1);\n\n for (int j = 0; j < l; ++j) {\n ovmask |= mask;\n mask <<= b;\n }\n\n int tInit = ovmask >> (b - 1);\n CharIntMap T = createCharIntMap(pattern, l, tInit);\n\n lim += 1 << ((l - 1) * b);\n mask = 1;\n\n for (int j = 0; j < l; ++j) {\n T.set(pattern[j], T.get(pattern[j]) & ~mask);\n mask <<= b;\n }\n\n return new Object[] { T, mask - 1, ovmask, lim, b };\n\n }",
"static private String applyPattern(String key, Object[] messageArguments) {\n String message = getString(key);\n MessageFormat formatter = new MessageFormat(message);\n String output = formatter.format(message, messageArguments);\n return output;\n }",
"@Override\n public boolean visit(String key, String value) {\n String[] parts = key.split(\"/\"); //$NON-NLS-1$\n StringBuilder f = new StringBuilder();\n for (int i = 0; i < parts.length; i++) {\n f.append(parts[i]);\n visitor.folder(f.toString());\n f.append(\"/\"); //$NON-NLS-1$\n }\n return true;\n }",
"public interface Keys {\n String STRING = \"string\";\n String NUM = \"num\";\n String PERSON = \"person\";\n}",
"public boolean contains(String key);",
"public void suggestions(String mispelledPattern) \r\n\t{\r\n\t\ttry \r\n\t\t{\r\n\t\t\t// String scanned to find the pattern.\r\n\t\t\tString line = \" \";\r\n\t\t\tString reg_ex = \"[\\\\w]+[@$%^&*()!?=.{}\\b\\n\\t]*\";\r\n\r\n\t\t\t// Create a Pattern object\r\n\t\t\tPattern pat = Pattern.compile(reg_ex);\r\n\t\t\t// Creating matcher object.\r\n\t\t\tMatcher my_match = pat.matcher(line);\r\n\t\t\tint file_Number = 0;\r\n\t\t\ttry \r\n\t\t\t{\r\n\t\t\t\tFile my_directory = new File(\"C:\\\\Users\\\\Asmita\\\\eclipse-workspace\\\\MyWebSearchEngine\\\\src\\\\HTMLFiles\");\r\n\t\t\t\tFile[] fileArray = my_directory.listFiles();\r\n\t\t\t\tfor (int i = 0; i < fileArray.length; i++)\r\n\r\n\t\t\t\t{\r\n\t\t\t\t\tfindWord(fileArray[i], file_Number, my_match, mispelledPattern);\r\n\t\t\t\t\tfile_Number++;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tSet keys = new HashSet();\r\n\t\t\t\tInteger val = 0;\r\n\t\t\t\tInteger value = 1;\r\n\t\t\t\t\r\n\t\t\t\tint counter = 0;\r\n\r\n\t\t\t\tSystem.out.println(\"\\nDid you mean? \");\r\n\t\t\t\tfor (Map.Entry entry : numbers.entrySet()) \r\n\t\t\t\t{\r\n\t\t\t\t\tif (val == entry.getValue()) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (value == entry.getValue()) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (counter == 0)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tSystem.out.print(entry.getKey());\r\n\t\t\t\t\t\t\t\tcounter++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tSystem.out.print(\" or \" + entry.getKey());\r\n\t\t\t\t\t\t\t\tcounter++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} \r\n\t\t\tcatch (Exception e) \r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Exception:\" + e);\r\n\t\t\t} \r\n\t\t\tfinally \r\n\t\t\t{\r\n\t\t\t}\r\n\t\t} \r\n\t\tcatch (Exception e) \r\n\t\t{\r\n\r\n\t\t}\r\n\t}",
"public Iterable<String> matches(String prefix, int k) {\n\t\tmatchesList = new ArrayList<String>();\n\t\t\n\t\tif(prefix != null){\n\t\t\tfor(Term term : data.getRawList()){\n\t\t\t\tif((term.getWord().startsWith(prefix))&&(matchesList.size() < k)){\n\t\t\t\t\tmatchesList.add(term.getWord());\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn matchesList;\n\t\t}\n\t\telse{\n\t\t\treturn null;\n\t\t}\n\t}",
"private List<String> getListForRealKey(String realKey) {\n return List.of(realKey);\n }",
"public static ArrayList<String> searchDictCommands(String query) {\n ArrayList<String> curSearch = new ArrayList<>();\n\n // Iterating through arguments of the same command\n for (int i = 0; i < commandDict.size(); i++) {\n // Checking if current Dictionary key matches what\n // the user has entered so far.\n if (commandDict.get(i).getKey().startsWith(query)) {\n curSearch.add(commandDict.get(i).getKey());\n }\n }\n\n // Returns an empty ArrayList if no match has been found.\n return curSearch;\n }",
"@Override\r\n public List<Asset> findByKeyWord(Map<String, Object> params) {\n return assetDao.findByKeyWord(params);\r\n }",
"abstract public String getKey();",
"public abstract Function<E, K> keyExtractor();",
"java.lang.String getKey();",
"java.lang.String getKey();",
"java.lang.String getKey();",
"java.lang.String getKey();",
"java.lang.String getKey();",
"java.lang.String getKey();",
"public Iterable<String> getKeys(String keyPrefix);",
"String[] supportedKeys();",
"PathKeys getPathKeys();",
"private static void findTokensByPattern (Document doc, String text, int start, int end) {\n\tMatcher emailMatcher = emailPat.matcher(text).region(start,end);\n\tspecialTokenEnd = new HashMap<Integer, Integer>();\n\tspecialTokenType = new HashMap<Integer, String>();\n\twhile (emailMatcher.find()) {\n\t\tint tokenStart = emailMatcher.start();\n\t\tint tokenEnd = emailMatcher.end();\n\t\tspecialTokenEnd.put(tokenStart, tokenEnd);\n\t\tspecialTokenType.put(tokenStart, \"email\");\n\t}\n\tMatcher urlMatcher = urlPat.matcher(text).region(start,end);\n\twhile (urlMatcher.find()) {\n\t\tint tokenStart = urlMatcher.start();\n\t\tint tokenEnd = urlMatcher.end();\n\t\tspecialTokenEnd.put(tokenStart, tokenEnd);\n\t\tspecialTokenType.put(tokenStart, \"url\");\n\t}\n}",
"private static Collection<Map.Entry<String, String>> getEntriesContainingKey(Collection<Map.Entry<String, String>> entries, String key) {\n\t\tfinal Iterator<Map.Entry<String, String>> iter = entries.iterator();\n\t\tfinal Collection<Map.Entry<String, String>> matchingEntries = new ArrayList<>();\n\t\twhile (iter.hasNext()) {\n\t\t\tfinal Map.Entry<String, String> entry = iter.next();\n\t\t\tif (entry.getKey().equals(key)) {\n\t\t\t\tmatchingEntries.add(entry);\n\t\t\t}\n\t\t}\n\t\treturn matchingEntries;\n\t}",
"public abstract String mapItemToKey(String str);",
"public void setPattern(String pattern)\n/* */ {\n/* 71 */ setPatterns(new String[] { pattern });\n/* */ }",
"StringList keys();",
"private void ensureValidKeyNames() {\n assertThat(Iterables.any(graphiteMockServer.content, containsPattern(\"\\\\.\\\\.\")), is(false));\n assertThat(Iterables.any(graphiteMockServer.content, containsPattern(\"\\\\[\")), is(false));\n assertThat(Iterables.any(graphiteMockServer.content, containsPattern(\"\\\\]\")), is(false));\n assertThat(Iterables.any(graphiteMockServer.content, containsPattern(\"\\\\(\")), is(false));\n assertThat(Iterables.any(graphiteMockServer.content, containsPattern(\"\\\\)\")), is(false));\n }",
"private static boolean matches(char[] achName, int ofName, char[] achPattern, int ofPattern)\n {\n int cchName = achName.length;\n int cchPattern = achPattern.length;\n while (ofName < cchName && ofPattern < cchPattern)\n {\n char chName = achName[ofName];\n char chPattern = achPattern[ofPattern];\n\n // latin conversion\n if (chName >= 'A' && chName <= 'Z')\n {\n chName = (char) ('a' + (chName - 'A'));\n }\n if (chPattern >= 'A' && chPattern <= 'Z')\n {\n chPattern = (char) ('a' + (chPattern - 'A'));\n }\n\n switch (chPattern)\n {\n case '?':\n // any char is OK\n break;\n\n case '*':\n {\n if (ofPattern == cchPattern-1)\n {\n // asterisk is at end of pattern ... any name\n // goes at this point\n return true;\n }\n\n char chTag = achPattern[ofPattern+1];\n for (int ofTag = ofName; ofTag < cchName; ++ofTag)\n {\n if ((chTag == '?' || achName[ofTag] == chTag) &&\n matches(achName, ofTag, achPattern, ofPattern+1))\n {\n return true;\n }\n }\n }\n return false;\n\n default:\n if (chName != chPattern)\n {\n return false;\n }\n break;\n }\n\n ++ofName;\n ++ofPattern;\n }\n\n // equal iff both name and pattern were exhausted\n return (ofName == cchName && ofPattern == cchPattern);\n }",
"@Override public RebaseSearcher findSymbols(String pattern,String kind)\n{\n RebaseJavaSearch search = new RebaseJavaSearch(this);\n\n findSymbols(search,pattern,kind);\n\n return search;\n}",
"public void addPattern(String pattern) {\n\t\tArrayList<String> patterns = new ArrayList<String>();\n\t\tStringTokenizer entries = new StringTokenizer(pattern, \":,\");\n\t\twhile (entries.hasMoreTokens()) {\n\t\t\tpatterns.add(entries.nextToken());\n\t\t}\n\n\t\taddPatterns((String[]) patterns.toArray(new String[patterns.size()]));\n\t}",
"public interface CacheKey {\n\n String CK_TOPICS = \"ck.mqtt.service\";\n String CK_TOPICS_FRESH = \"ck.mqtt.topics.is.refresh\";\n String CK_TOPIC_IS_SUBSCRIBE = \"ck.mqtt.topic.is.subscribe.%s\";\n}",
"@Override\n List<String> keys();",
"public OrderedPair search(String key) {\n return getRoot().search(key.toLowerCase());\n }",
"public boolean containsKey(String key);",
"@Override\n\tpublic String getSearchkeys() {\n\t\treturn matricule+\",\"+nom;\n\t}",
"Comparator<String> getPatternComparator(String path);",
"@Override\n public boolean contains(String key) {\n if (key == null || key.length() == 0 || root == null)\n return false;\n Node p = root;\n for (int i = 0; i < key.length(); i++) {\n char current = key.charAt(i);\n Node next = p.next.get(current);\n if (next == null) {\n return false;\n }\n p = next;\n }\n return p.isKey;\n }",
"public interface Keys {\n String VIEW_PAGER_INDEX = \"view_pager_index\";\n String LOCAL_MUSIC_POSITION = \"local_music_position\";\n String LOCAL_MUSIC_OFFSET = \"local_music_offset\";\n String PLAYLIST_POSITION = \"playlist_position\";\n String PLAYLIST_OFFSET = \"playlist_offset\";\n}",
"protected static void searchByKeysHashID(String keys, String myId) {\n String[] splitWords = new String[keys.split(\"[ ]+\").length];\n splitWords = keys.split(\"[ ]+\");\n System.out.println(splitWords[0]);\n for (String keyWord : splitWords) {\n keyWord = keyWord.toLowerCase();\n if (map.get(keyWord) != null) {\n ArrayList<Integer> allInstancesofWord = (ArrayList<Integer>) map.get(keyWord);\n {\n for (int i = 0; i < allInstancesofWord.size(); i++) {\n\n Product e = productList.get(allInstancesofWord.get(i));\n if (e.productIdMatch(myId)) // if an element has the desired id and it has the correct key terms. it is printed.\n {\n System.out.println(\"I hope this Worksid\");\n System.out.println(productList.get(allInstancesofWord.get(i)));\n ProductGUI.Display(e.toString() + \"\\n\");\n }\n }\n }\n }\n if (map.get(keyWord) == null) {\n System.out.println(\"The products you are searching for were not found\");\n }\n }\n }"
] | [
"0.73151857",
"0.6962186",
"0.6826672",
"0.6543227",
"0.65428674",
"0.65017444",
"0.64191",
"0.6406253",
"0.62909096",
"0.60970753",
"0.5913391",
"0.5865319",
"0.5742614",
"0.5638488",
"0.56011385",
"0.5583521",
"0.5477716",
"0.54657024",
"0.53782874",
"0.53707033",
"0.53600645",
"0.53553706",
"0.5341326",
"0.5339644",
"0.5283913",
"0.52652246",
"0.52276695",
"0.5199933",
"0.5188272",
"0.51868385",
"0.5172905",
"0.51654506",
"0.5154698",
"0.5142015",
"0.5130577",
"0.51158017",
"0.5114421",
"0.51005393",
"0.50967175",
"0.5092135",
"0.50908726",
"0.5081912",
"0.5081132",
"0.5079159",
"0.5076363",
"0.5058232",
"0.50560975",
"0.50484335",
"0.50426215",
"0.5036415",
"0.5034356",
"0.5034352",
"0.50245017",
"0.5013115",
"0.5010629",
"0.50104207",
"0.501032",
"0.500673",
"0.500673",
"0.5005233",
"0.49832317",
"0.49809194",
"0.49682388",
"0.4966102",
"0.49646562",
"0.49571028",
"0.49472836",
"0.49390674",
"0.4933127",
"0.49289122",
"0.49286783",
"0.49261716",
"0.49129263",
"0.49091932",
"0.49091932",
"0.49091932",
"0.49091932",
"0.49091932",
"0.49091932",
"0.49064463",
"0.49031177",
"0.49027383",
"0.49020717",
"0.48991615",
"0.4894712",
"0.48930827",
"0.4882529",
"0.48812965",
"0.48782295",
"0.487745",
"0.48736894",
"0.4872836",
"0.48676282",
"0.4865401",
"0.48647967",
"0.486467",
"0.4861292",
"0.4861088",
"0.4859448",
"0.48587"
] | 0.6536436 | 5 |
return a Hashtable of the entries that matche the pattern | public Hashtable<K, V> getPattern(String pattern); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n public Map<K, ICacheElement<K, V>> processGetMatching(final String pattern)\r\n {\r\n final Map<K, ICacheElement<K, V>> elements = new HashMap<>();\r\n Set<K> keyArray = null;\r\n storageLock.readLock().lock();\r\n try\r\n {\r\n keyArray = new HashSet<>(keyHash.keySet());\r\n }\r\n finally\r\n {\r\n storageLock.readLock().unlock();\r\n }\r\n\r\n final Set<K> matchingKeys = getKeyMatcher().getMatchingKeysFromArray(pattern, keyArray);\r\n\r\n for (final K key : matchingKeys)\r\n {\r\n final ICacheElement<K, V> element = processGet(key);\r\n if (element != null)\r\n {\r\n elements.put(key, element);\r\n }\r\n }\r\n return elements;\r\n }",
"Set<String> getKeysMatchingPattern(String pattern);",
"@Override\n\tpublic int hashCode() {\n\t\treturn pattern.hashCode();\n\t\t// just enough fields for a reasonable distribution\n\t}",
"private static Map<Integer, List<String>> getIpPatternMap()\n\t{\n\t\tMap<Integer, List<String>> map = new HashMap<>();\n\t\tfor(int a = 1; a <= 3; a++)\n\t\t{\n\t\t\tfor( int b = 1; b <= 3; b++)\n\t\t\t{\n\t\t\t\tfor(int c = 1 ; c <= 3; c++)\n\t\t\t\t{\n\t\t\t\t\tfor( int d = 1; d <= 3; d++)\n\t\t\t\t\t{\n\t\t\t\t\t\tfinal int patternCount = a + b + c + d;\n\t\t\t\t\t\tList<String> patterns;\n\t\t\t\t\t\tif(!map.containsKey(patternCount))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpatterns = new ArrayList<>();\n\t\t\t\t\t\t\tmap.put(patternCount, patterns);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpatterns = map.get(patternCount);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpatterns.add(String.format(\"%1$d%2$d%3$d%4$d\", a,b,c,d));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn map;\n\t}",
"@Override\n public Map<K, V> getMatching( final String pattern )\n {\n final Map<K, V> unwrappedResults;\n\n final Map<K, ICacheElement<K, V>> wrappedResults = this.getCacheControl().getMatching( pattern );\n\n if ( wrappedResults == null )\n {\n unwrappedResults = new HashMap<>();\n }\n else\n {\n unwrappedResults = wrappedResults.entrySet()\n .stream()\n .filter(entry -> entry.getValue() != null)\n .collect(Collectors.toMap(\n Entry::getKey,\n entry -> entry.getValue().getVal()));\n }\n\n return unwrappedResults;\n }",
"public void createHashTable() {\n\n String[] tempArray = new String[words.size()];\n\n for (int i = 0; i < words.size(); i++) {\n char[] word = words.get(i).toCharArray(); // char[] snarf\n Arrays.sort(word); // char[] afnrs\n tempArray[i] = toString(word); // String afnrs\n }\n\n for (int i = 0; i < words.size(); i++) {\n String word = tempArray[i];\n hashTable.put(word.substring(0, 4), i); // plocka bort bokstav nr 5\n String subString4 = (word.substring(0, 3) + word.substring(4, 5)); // plocka bort bokstav nr 4\n hashTable.put(subString4, i);\n String subString3 = (word.substring(0, 2) + word.substring(3, 5)); // plocka bort bokstav nr 3\n hashTable.put(subString3, i);\n String subString2 = (word.substring(0, 1) + word.substring(2, 5)); // plocka bort bokstav nr 2\n hashTable.put(subString2, i);\n hashTable.put(word.substring(1, 5), i); // plocka bort bokstav nr 1\n }\n }",
"public interface IPatternMap<K, V> {\r\n\r\n\t/**\r\n\t * return a Hashtable of the entries that matche the pattern\r\n\t * @param pattern\r\n\t * @return\r\n\t */\r\n\tpublic Hashtable<K, V> getPattern(String pattern);\r\n\t\r\n\r\n\t/**\r\n\t * return a Hashtable of the entries that match the wildcard (*)\r\n\t * @param pattern\r\n\t * @return\r\n\t */\r\n\tpublic Hashtable<K, V> getWildcard(String wildcard);\r\n\r\n\r\n\r\n}",
"private TreeMap<String, double[]> readFlowInfo(XSSFSheet sheet) {\n\t\tIterator<Row> rowIterator = sheet.iterator();\n\t\t\n\t\trowIterator.next();//Ignore the column names. We actually know it.\n\t\tRow row = null;\n\t\tTreeMap<String, double[]> treeMap = new TreeMap<String, double[]>();\n\n\t\twhile(rowIterator.hasNext()){\n\t\t\trow = rowIterator.next();\n\t\t\t//The composed key: [newID+type.firstLetter+hour]\n\t\t\tString key =Math.round(row.getCell(CELLMATCHKEY).getNumericCellValue())+\n\t\t\t\t\trow.getCell(CELLDAYTYPE).getStringCellValue().substring(0, 1)+\n\t\t\t\t\tMath.round(row.getCell(CELLHOUR).getNumericCellValue());\n\t\t\t//System.out.println(key);\n\t\t\tdouble[] values = new double[16];\n\t\t\t\n\t\t\tfor(int i=0;i<16;i++){\n\t\t\t\tvalues[i]=row.getCell(i+6).getNumericCellValue();\n\t\t\t}\n\t\t\t\n\t\t\ttreeMap.put(key,values);\n\t\t}\n\t\treturn treeMap;\n\t}",
"@Override\n public Map<K, ICacheElement<K, V>> getMatchingCacheElements( final String pattern )\n {\n return this.getCacheControl().getMatching( pattern );\n }",
"public Iterable<String> keysThatMatch(String pattern)\r\n {\r\n Queue<String> q = new Queue<String>();\r\n if ((pattern.equals(\"\") || pattern.equals(\".\")) && null_str_val != null)\r\n q.enqueue(\"\");\r\n collect(root, \"\", pattern, q);\r\n return q;\r\n }",
"public ArrayList<WordCode<K, V>> entrySet() {\n\t\tArrayList<WordCode<K, V>> entrySet = new ArrayList<>();\n\t\t\n\t\tfor (LinkedList<WordCode<K, V>> ll : myBuckets) {\n\t\t\tfor (WordCode<K, V> wc : ll) {\n\t\t\t\tentrySet.add(wc);\n\t\t\t}\n\t\t}\n\t\treturn entrySet;\n\t}",
"private static void getPatterns(int size) {\n\t\t// TODO Auto-generated method stub\n\t\thashOne = new HashMap<SequencePair,Integer>();\n\t\thashTwo = new HashMap<SequencePair,Integer>();\n\t\tArrayList<Integer> first;\n\t\tArrayList<Integer> second;\n\t\tArrayList<Integer> third;\n\t\t\n\t\t//System.out.println(lrcSeq.size());\n\t\t\n\t\tfor(int i = 0; i < lrcSeq.size() - size ;++i) {\n\t\t\tfirst = new ArrayList<Integer>();\n\t\t\tsecond = new ArrayList<Integer>();\n\t\t\tthird = new ArrayList<Integer>();\n\t\t\t\n\t\t\tfor(int j = i; j < i+ size ;++j) {\n\t\t\t\tfirst.add(lrcSeq.get(j));\n\t\t\t\tsecond.add(meloSeq.get(j));\n\t\t\t\tthird.add(durSeq.get(j));\n\t\t\t}\n\t\t\t//System.out.println(first);\n\t\t\t//System.out.println(second);\n\t\t\t//System.out.println(third);\n\t\t\tSequencePair cur= new SequencePair(first, second);\n\t\t\n\t\t\tint count = hashOne.containsKey(cur)?hashOne.get(cur):0;\n\t\t\thashOne.put(cur, count+1);\n\t\t\t\n\t\t\tcur = new SequencePair(second, third);\n\t\t\tcount = hashTwo.containsKey(cur)?hashTwo.get(cur):0;\n\t\t\thashTwo.put(cur, count+1);\n\t\t\n\t\t}\n\t\n\t}",
"HSet entrySet();",
"private int[] computeLspTable(String pattern) {\n\t\tint lsp[] = new int[pattern.length()];\n\t\tlsp[0] = 0;\n\t\tfor (int i = 1; i < pattern.length(); i++) {\n\t\t\tint j = lsp[i - 1];\n\t\t\twhile (j > 0 && pattern.charAt(i) != pattern.charAt(j)) {\n\t\t\t\tj = lsp[j - 1]; // in worst case, this instruction will be called (pattern.length - 1) times\n//\t\t\t\tSystem.out.print(j + \",\");\n\t\t\t}\n\t\t\tif (pattern.charAt(i) == pattern.charAt(j)) {\n\t\t\t\tj++;\n\t\t\t}\n\t\t\tlsp[i] = j;\n\t\t}\n\t\treturn lsp;\n\t\t\n//\t a a a a b\n//\t 0 1 2 3 0\n\t \n//\t a b c a b c a c a //abcdbcddd\n//\t 0 0 0 1 2 3 4 0 1\n\t \n//\t a b c d b c d d d //abcdbcddd\n//\t 0 0 0 0 0 0 0 0 0\n//\t a b a b a b c\n//\t 0 0 1 2 3 4 0\n\t}",
"private Map<String,List<Invertedindex>> collecting() //\r\n {\r\n Map<String,List<Invertedindex>> maps = new TreeMap<>();\r\n for (Core pon:pondred){\r\n for(Map.Entry<String,Double> term:pon.allTerms.entrySet()){\r\n if (maps.containsKey(term.getKey())){\r\n List<Invertedindex> index = maps.get(term.getKey());\r\n index.add(new Invertedindex(pon.m_cle,term.getValue(),pon.getBalise(term.getKey())));\r\n maps.put(term.getKey(), index);\r\n }else {\r\n List<Invertedindex> index = new ArrayList<>();\r\n index.add(new Invertedindex(pon.m_cle,term.getValue(),pon.getBalise(term.getKey())));\r\n maps.put(term.getKey(), index);\r\n }\r\n if(cleFreq.containsKey(pon.m_cle))\r\n cleFreq.put(pon.m_cle,cleFreq.get(pon.m_cle)+term.getValue());\r\n else cleFreq.put(pon.m_cle,term.getValue());\r\n\r\n }\r\n }\r\n return maps;\r\n }",
"public Iterable<String> keysThatMatch(String pat) {\n LinkedList<String> q = new LinkedList<String>();\n collect(root, pat, \"\", q);\n return q;\n }",
"private HashMap<String, ArrayList<String>> getAllTableContents(String table) {\r\n return getAllTableContentsWhere(table, null, null);\r\n }",
"private TreeMap<String, ArrayList<String>> fillLists (char guess) {\r\n \t//Tree Map to Return\r\n \tTreeMap <String, ArrayList<String>> lists = new TreeMap<String, ArrayList<String>>();\r\n \t\r\n \t//Loop through the Active Words\r\n \tfor (int word = 0; word < activeWords.size(); word ++) {\r\n \t\tStringBuilder currentPattern = new StringBuilder();\r\n \t\t//Use existing pattern as base\r\n \t\tcurrentPattern.append(pattern);\r\n \t\t\r\n \t\t//New pattern is created based on each Active Word's relation to guess\r\n \t\tfor (int letter = 0; letter < activeWords.get(word).length(); letter++) {\r\n \t\t\t//If match, update pattern\r\n \t\t\tif (activeWords.get(word).charAt(letter) == guess) {\r\n \t\t\t\tcurrentPattern.setCharAt(letter, guess);\r\n \t\t\t}\r\n \t\t}\t\r\n \t\t//Convert Builder to String here for simplicity\r\n \t\tString newPattern = currentPattern.toString();\r\n \t\t\r\n \t\t//Each temp is the ArrayList of words for each pattern\r\n \t\tArrayList <String> temp = new ArrayList <String>();\r\n \t\t//Below takes into account if this key's list already has other words in it.\r\n \t\tif (lists.containsKey(newPattern)) {\r\n \t\t\ttemp = lists.get(newPattern);\r\n \t\t}\t\r\n \t\t\r\n \t\t//Add current word\r\n\t\t\ttemp.add(activeWords.get(word));\r\n\t\t\t//Add updated list to key (pattern created)\r\n\t\t\tlists.put(newPattern, temp);\r\n \t} \t\r\n \treturn lists;\r\n }",
"private TreeMap<String, double[]> readFactorsInfo(XSSFSheet sheet) {\n\t\tIterator<Row> rowIterator = sheet.iterator();\n\t\t\n\t\trowIterator.next();//Ignore the column names. We actually know it.\n\t\trowIterator.next();//Ignore second column\n\t\tRow row = null;\n\t\tTreeMap<String, double[]> treeMap = new TreeMap<String, double[]>();\n\n\t\twhile(rowIterator.hasNext()){\n\t\t\trow = rowIterator.next();\n\t\t\t//The composed key: [newID+type.firstLetter+hour]\n\t\t\tString key =row.getCell(CELL_POLLUTANT).getStringCellValue();\n\t\t\tSystem.out.println(key);\n\t\t\tdouble[] values = new double[30];\n\t\t\t\n\t\t\tfor(int i=0;i<30;i++){\n\t\t\t\tvalues[i]=row.getCell(i+1).getNumericCellValue();\n\t\t\t}\n\t\t\t\n\t\t\ttreeMap.put(key,values);\n\t\t}\n\t\treturn treeMap;\n\t}",
"public Hashtable<String, String> convertTagsToTable() {\r\n final Hashtable<String, String> table = new Hashtable<String, String>();\r\n\r\n final String groupPrefix = \"dicom_0x\";\r\n final String elemPrefix = \"el_0x\";\r\n\r\n String group, elem, data;\r\n VR vr;\r\n int index;\r\n\r\n for (int varIndex = 0; varIndex < getVarArray().length; varIndex++) {\r\n index = getVarElem(varIndex).name.indexOf(groupPrefix);\r\n\r\n if (index != -1) {\r\n group = getVarElem(varIndex).name.substring(groupPrefix.length());\r\n\r\n for (int attIndex = 0; attIndex < getVarElem(varIndex).vattArray.length; attIndex++) {\r\n index = getVarElem(varIndex).getVattElem(attIndex).name.indexOf(elemPrefix);\r\n\r\n if (index != -1) {\r\n elem = getVarElem(varIndex).getVattElem(attIndex).name.substring(elemPrefix.length());\r\n vr = DicomDictionary.getVR(new FileDicomKey(group + \",\" + elem));\r\n if (vr != null && vr.equals(VR.SQ)) {\r\n continue;\r\n }\r\n\r\n data = new String(\"\");\r\n\r\n if (getVarElem(varIndex).getVattElem(attIndex).nc_type == FileInfoMinc.NC_CHAR) {\r\n\r\n for (int i = 0; i < getVarElem(varIndex).getVattElem(attIndex).nelems; i++) {\r\n data += getVarElem(varIndex).getVattElem(attIndex).values[i];\r\n }\r\n } else {\r\n\r\n for (int i = 0; i < getVarElem(varIndex).getVattElem(attIndex).nelems; i++) {\r\n data += \"\" + getVarElem(varIndex).getVattElem(attIndex).values[i] + \" \";\r\n }\r\n }\r\n\r\n table.put(\"(\" + group.toUpperCase() + \",\" + elem.toUpperCase() + \")\", data.trim());\r\n }\r\n }\r\n }\r\n }\r\n\r\n return table;\r\n }",
"public Object[] entrySet() {\n MyStack<Object> result = new MyStack<>();\n\n for (Object entry : this.table) {\n if (entry != null) {\n Entry<K, V> current = (Entry<K, V>) entry;\n\n while (current.hasNext()) {\n result.push(current);\n current = current.getNext();\n }\n result.push(current);\n }\n }\n return result.toArray();\n }",
"public Hashtable<K, V> getWildcard(String wildcard);",
"@Override\n\tpublic Set<Entry<K, V>> entrySet() {\n\t\tSet<Entry<K, V>> set = new HashSet<Entry<K, V>>();\n\t\tIterator it1 = tabla.iterator();\n\t\tint i = 0;\n\t\twhile (it1.hasNext()) {\n\t\t\tit1.next();\n\t\t\tIterator it2 = tabla.get(i).keySet().iterator();\n\t\t\tint j = 0;\n\t\t\twhile (it2.hasNext()) {\n\t\t\t\tit2.next();\n\t\t\t\tK clave = tabla.get(i).keySet().get(j);\n\t\t\t\tV valor = tabla.get(i).valueSet().get(j);\n\t\t\t\tEntrada<K, V> entry = new Entrada<K, V>(clave, valor);\n\t\t\t\tset.add(entry);\n\t\t\t\tj++;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\treturn set;\n\t}",
"private HashMap getTableFieldsAttribs(String s){\n HashMap<String, String> map = new HashMap<String, String>();\n String name = \"(.*)(?<=name)(=\\\\\\\")(\\\\w+)(.*)\"; // 3rd group\n String type = \"(.*)(?<=type)(=\\\\\\\")(\\\\w+:)(\\\\w+)(.*)\"; // 4th group\n String maxO = \"(.*)(?<=maxOccurs)(=\\\\\\\")(\\\\w+)(.*)\"; //3rd group\n String minO = \"(.*)(?<=minOccurs)(=\\\\\\\")(\\\\w+)(.*)\"; //3rd group\n String fraction = \"(.*)(?<=fraction)(=\\\\\\\")(\\\\w+)(.*)\"; //3rd group\n String date = \"(.*)(?<=date)(=\\\\\\\")(.*)(\\\\\\\")(.*)\"; //3rd group\n Matcher m = Pattern.compile(name).matcher(s);\n Matcher m1 = Pattern.compile(type).matcher(s);\n Matcher m2 = Pattern.compile(maxO).matcher(s);\n Matcher m3 = Pattern.compile(minO).matcher(s);\n Matcher m4 = Pattern.compile(fraction).matcher(s);\n Matcher m5 = Pattern.compile(date).matcher(s);\n if(m.find()){\n map.put(\"name\",m.group(3));\n }\n if(m1.find()){\n map.put(\"type\",m1.group(4));\n }\n if(m2.find()){\n map.put(\"maxOccurs\",m2.group(3));\n }\n if(m3.find()){\n map.put(\"minOccurs\",m3.group(3));\n }\n if(m4.find()){\n map.put(\"fraction\",m4.group(3));\n }\n if(m5.find()){\n map.put(\"date\",m5.group(3));\n }\n return map;\n }",
"public int hashCode() {\n\treturn ignoreCase ? pattern.hashCode() : ~pattern.hashCode();\n }",
"Entry<V>[][] getList() {\n @SuppressWarnings(\"unchecked\")\n Entry<V>[][] res = new Entry[4][2 * sizeCache];\n int i = 0;\n for (Entry<V> e = list1.next; e != mid1.next; e = e.next) {\n res[0][i++] = e;\n }\n\n i = 0;\n for (Entry<V> e = mid1.next; e != list1; e = e.next) {\n res[1][i++] = e;\n }\n\n i = 0;\n for (Entry<V> e = list2.next; e != mid2.next; e = e.next) {\n res[2][i++] = e;\n }\n\n i = 0;\n for (Entry<V> e = mid2.next; e != list2; e = e.next) {\n res[3][i++] = e;\n }\n\n\n return res;\n }",
"public Set<Map.Entry<String, List<String>>> entrySet()\r\n/* 431: */ {\r\n/* 432:592 */ return this.headers.entrySet();\r\n/* 433: */ }",
"private void createHashtable()\n {\n int numLanguages = languages.length;\n mapping = new Hashtable(numLanguages, 1.0f);\n for (int i = 0; i < numLanguages; i++)\n mapping.put(languages[i], values[i]);\n }",
"private Map<Symbol, Entry<T>> getInternalTable() {\n\t\tif (internalTable == null) {\n\t\t\t// Iterate table [external -> (internal, value) list] and build new map [internal -> (external, value)]\n\t\t\tinternalTable = new HashMap<Symbol, Entry<T>>();\n\t\t\tList<Table.Entry<Symbol, List<Entry<T>>>> entries = table.toList();\n\t\t\tfor (Table.Entry<Symbol, List<Entry<T>>> entry : entries) {\n\t\t\t\tfor (Entry<T> internals : entry.value) {\n\t\t\t\t\tinternalTable.put(internals.symbol, new Entry<T>(entry.key /* external symbol */, internals.value, internals.index));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn internalTable;\n\t}",
"public List<String> getKeysByPattern(String patternKey){\n RKeys keys = redissonClient.getKeys();\n Iterable<String> foundedKeys = keys.getKeysByPattern(patternKey);\n List<String> list = new ArrayList<>();\n foundedKeys.forEach(key -> list.add(key));\n return list;\n }",
"void Create(){\n map = new TreeMap<>();\r\n\r\n // Now we split the words up using punction and spaces\r\n String wordArray[] = wordSource.split(\"[{ \\n\\r.,]}}?\");\r\n\r\n // Now we loop through the array\r\n for (String wordArray1 : wordArray) {\r\n String key = wordArray1.toLowerCase();\r\n // If this word is not present in the map then add it\r\n // and set the word count to 1\r\n if (key.length() > 0){\r\n if (!map.containsKey(map)){\r\n map.put(key, 1);\r\n }\r\n else {\r\n int wordCount = map.get(key);\r\n wordCount++;\r\n map.put(key, wordCount);\r\n }\r\n }\r\n } // end of for loop\r\n \r\n // Get all entries into a set\r\n // I think that before this we just have key-value pairs\r\n entrySet = map.entrySet();\r\n \r\n }",
"public static void main(String[] args) {\n\n\t\tHashMap<String,String> hm = new HashMap<String, String>();\n\t\t\n\t\thm.put(\"e\",\"a1\");\n\t\thm.put(\"b\",\"a1\");\n\t\thm.put(\"a\",\"a2\");\n\t\t \n\t\thm.put(\"a\",\"a5\");\n\t\t\n\t\tSet s = hm.entrySet();\n\t\tIterator it = s.iterator();\n\t\t\n\t\tfor(Map.Entry me : hm.entrySet())\n\t\t\tSystem.out.println(me.getKey()+\" \"+me.getValue());\n\t\t\n\t\t\n\t\twhile(it.hasNext())\n\t\t{\n\t\t\tMap.Entry mentry = (Map.Entry) it.next();\n\t\t\tSystem.out.println(mentry.getKey() +\" \"+mentry.getValue());\n\t\t\t\n\t\t}\n\t\t\n\tMap<String,String> thmp = \tnew TreeMap<String,String> (hm);\n\tSystem.out.println();\n\tfor(Map.Entry g : thmp.entrySet())\n\t\tSystem.out.println(g.getKey()+\" \"+g.getValue());\n\t\n\t\n\tSystem.out.println(hm.containsKey(\"a\")+\" \"+hm.containsValue(\"a5\"));\n\t\n\t\t\n\t\t\n\t\t\n\t}",
"public static void main(String[] args) {\n Map<Integer, String> ht = new Hashtable<>();\n \n // hash = 7, so, (7 & 0x7FFFFFFF) % 11 => 7 % 11 => 7. So, it stores the element in 7th index bucket location\n ht.put(7, \"aa\"); \n ht.put(11, \"ba\");\n ht.put(1, \"ad\");\n ht.put(15, \"sa\");\n ht.put(20, \"rea\");\n \n // hash = 18, so, (18 & 0x7FFFFFFF) % 11 => 18 % 11 => 7. So, it stores the element in 7th index bucket location.\n // But we already have one element then this new element will have next pointer variable. It will point to the element whcih already exists.\n // Then this new element will be placed in the 7th index.\n ht.put(18, \"ewa\");\n\n // When we iterate the elements it will iterate from top to bottom and right to left only.\n // Same index we have a possibility of multiple elements. So, it will read it from right to left.\n System.out.println(ht);\n }",
"public Map<String, List<String>> mo133923b() {\n Map<String, List<String>> map = this.f114455b;\n if (map != null) {\n return map;\n }\n TreeMap treeMap = new TreeMap(String.CASE_INSENSITIVE_ORDER);\n for (Map.Entry<String, String> entry : this.f114454a) {\n ArrayList arrayList = new ArrayList();\n if (treeMap.containsKey(entry.getKey())) {\n arrayList.addAll((Collection) treeMap.get(entry.getKey()));\n }\n arrayList.add(entry.getValue());\n treeMap.put(entry.getKey(), Collections.unmodifiableList(arrayList));\n }\n this.f114455b = Collections.unmodifiableMap(treeMap);\n return this.f114455b;\n }",
"int[] prefix_suffix_tabble(String pattern){\n\n // ABAB\n int[] table = pattern.length;\n\n int M = pattern.length();\n int i=0;\n int j=1;\n\n table[0] = 0;\n\n while(j<M){\n if(pattern.charAt(i) == pattern.charAt(j)){\n table[j] = i+1;\n i++;\n j++;\n }\n else{ // charAt(i) != charAt(j)\n\n\n if(i==0){ // cant go to previous, so just set it to 0 and move on. Almost our base case\n table[j] = 0;\n j++;\n continue;\n }\n\n // set i to the value of the previous and keep doing it\n int valueAtPrevious = table[i-1];\n i = valueAtPrevious;\n }\n }\n return table;\n // ith index indicates a prefix that is also a suffix from 0 including i. Cant be the whole String\n\n\n }",
"public Set<Map.Entry<Integer, String>> entrySet() {\n return Collections.unmodifiableSet(getMacrosses().entrySet());\n }",
"public String searchByMaterial(String string, ArrayList<String> materiallist, int count, Set<String> keys, Collection<String> values, Map<String, String> dataTable1) {\nfor(String s:materiallist) {\r\n\t\t\t\r\n\t\t\tif (string.equals(s)) {\r\n\t\t\t//\tSystem.out.print(s);\r\n\t\t\t\tcount--;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t\t}\r\nSystem.out.println(\"A List of Home that matches the Material \"+string+\":\");\r\n\r\nfor(String k: keys) {\r\n\t\r\n\tarraytoprintkey=k.split(\"_\");\r\n\r\n\r\n\t\r\n\t\tif(arraytoprintkey[1].equals(string)) {\r\n\t\t\t\r\n\t\t\t\tSystem.out.print(k);\r\n\t\t\t\tSystem.out.println(\" \"+dataTable1.get(k));\r\n\t\t\t\t\r\n\t\t}\r\n\r\n\t\t\r\n}\r\nSystem.out.println();\r\n\t\tif(count==0) {\r\n\t\t\treturn string;\r\n\t\t}\r\n\t\t\t\r\n\t\treturn null;\r\n\t}",
"public LinkedHashMap<String, LinkedHashSet<String>> getConditionsFromTable() {\n\t\tLinkedHashMap<String, LinkedHashSet<String>> toReturn = new LinkedHashMap<String, LinkedHashSet<String>>();\n\t\tfor (int i = 0; i < modelCondTable.getRowCount(); i++) {\n\t\t\tString key = (String) modelCondTable.getValueAt(i, 0);\n\t\t\tString value = (String) modelCondTable.getValueAt(i, 1);\n\t\t\tLinkedHashSet<String> setValue = new LinkedHashSet<String>(Arrays.asList(value.split(\";\")));\n\n\t\t\ttoReturn.put(key, setValue);\n\t\t}\n\t\treturn toReturn;\n\t}",
"public static Hashtable shiftTable(char[] p, char[] t) {\n Hashtable<Character, Integer> table = new Hashtable<Character, Integer>();\n List<Character> charList;\n\n charList = charList(t);\n\n int m = p.length;\n\n for (char c : charList) {\n table.put(c, m);\n }\n for (int j = 0; j <= m - 2; j++) {\n char nextChar = p[j];\n table.put(nextChar, m - 1 - j);\n }\n System.out.println(table);\n return table;\n }",
"public String toString() {\n\tString HashTable=\"\";\n\tfor(int i=0;i<this.capacity;i++) {\n\t for(MyEntry k:table[i]) {\n\t\tHashTable=HashTable+k.value+\" \"+k.key+\"\\n\";\n\t }\n\t}\n\treturn HashTable;\n }",
"public Map<AdornedAtom, List<AdornedTgd>> adornedMap() {\n Map<AdornedAtom, List<AdornedTgd>> map = new HashMap<>();\n for(AdornedAtom p: adornedPredicates) {\n ArrayList<AdornedTgd> tgd = new ArrayList<>();\n for(AdornedTgd t : adornedRules) {\n if(t.getHead().equals(p)) {\n tgd.add(t);\n }\n }\n map.put(p, tgd);\n }\n\n return map;\n }",
"public Iterable<Entry<K, V>> entrySet() {\n ArrayList<Entry<K, V>> buffer = new ArrayList<>();\n for (int h = 0; h < capacity; h++)\n if (!isAvailable(h)) buffer.add(table[h]);\n return buffer;\n }",
"void buildTable(){\n HashMap<String, Integer> map = new HashMap<String, Integer>();\n while (first.hasNext()){\n String s = first.next();\n for(String key: s.split(SPLIT)) {\n int val = map.getOrDefault(key, 0);\n map.put(key, val + 1);\n }\n }\n ArrayList<Tuple> arr = new ArrayList<>();\n for (String key: map.keySet()){\n int num = map.get(key);\n //filter the unusual items\n if (num >= this.support){\n arr.add(new Tuple(key, num));\n }\n }\n //descending sort\n arr.sort((Tuple t1, Tuple t2)->{\n if (t1.num <= t2.num)\n return 1;\n else\n return -1;\n });\n\n int idx = 0;\n for(Tuple t: arr){\n this.table.add(new TableEntry(t.item, t.num));\n this.keyToNum.put(t.item, t.num);\n this.keyToIdx.put(t.item, idx);\n idx += 1;\n }\n /*\n for(TableEntry e: table){\n System.out.println(e.getItem()+ \" \"+ e.getNum());\n }*/\n }",
"public HashMap<String, Integer> getHashMap(){\n\t\tHashMap <String, Integer> hm1 = new HashMap <String, Integer>();\n\t\t//get each line of the book and store it as an arrayList\n\t\twords = wordData.getLines();\n\t \n\t\tfor(int i =0; i<words.size(); i++){\n\t\t\t \n\t\t\tString[] aLine = words.get(i).split(\" \");\n\t\t\t\n\t\t\tfor(int j = 0; j<aLine.length; j++){\n\t\t\t\t\n\t\t\t\t// convert all upper case to lower case & remove all non-alphabetic symbols;\n\t\t\t\t\t\n\t\t\t\tsparsedWords.add(aLine[j].toLowerCase().replaceAll(\"[^\\\\w]\", \"\"));\n\t\t\t}\n\t\t}\n\t\t//put in key and value in hashmap\n\t\tfor(int key = 0; key < sparsedWords.size(); key++){\n\t\t\t\n\t\t\tif (hm1.containsKey(sparsedWords.get(key))){\n\t\t\t\tint count = hm1.get(sparsedWords.get(key));\n\t\t\t\thm1.put(sparsedWords.get(key), count + 1);\n\t\t\t}else{\n\t\t\t\thm1.put(sparsedWords.get(key), 1);\n\t\t\t}\n\t\t}\n\t\treturn hm1;\n\t\t \t\n\t\t}",
"@Override\n public Set<Map.Entry<String, T>> entrySet() {\n Set<Map.Entry<String, T>> entrySet = new TreeSet<>();\n for (Map.Entry<String, Map.Entry<String, T>> v : entries.entrySet()) {\n entrySet.add(new Entry<>(v));\n }\n return entrySet;\n }",
"private Map<S, Long> getPatternOccurrence(final S terminal) {\n Map<S, Long> occInNonTerminal = new HashMap<>();\n if(matchingBlocks) {\n Iterator<P> it = slp.getOrderedProductions().descendingIterator();\n while (it.hasNext()) {\n P production = it.next();\n long ntOcc = production.getRight().stream().map(s -> {\n if(!s.isTerminal()) {\n return occInNonTerminal.get(s);\n }\n else if(s.getBlockId() == terminal.getBlockId() && s.getWeight() >= terminal.getWeight()) {\n return s.getWeight() - terminal.getWeight() + 1;\n }\n else {\n return 0L;\n }\n }).reduce(0L, (a,b) -> a + b);\n occInNonTerminal.put(production.getLeft(), ntOcc);\n }\n }\n else {\n Iterator<P> it = slp.getOrderedProductions().descendingIterator();\n while (it.hasNext()) {\n P production = it.next();\n long ntOcc = production.getRight().stream().map(s -> !s.isTerminal() ? occInNonTerminal.get(s) : (s.equals(terminal) ? 1L : 0L)).reduce(0L, (a,b) -> a+b);\n occInNonTerminal.put(production.getLeft(), ntOcc);\n }\n }\n\n\n return occInNonTerminal;\n }",
"public static void main(String[] args) \n\t { \n\t\t \n\t//\t ScrabbleCheater11 cheat = new ScrabbleCheater11();\n\t//\t Dictionary11 dict = new Dictionary11(1,\"C:\\\\words\\\\words-279k.txt\");\n\t \n\t\t MyHashTable11 htable = new MyHashTable11(7591,\"src/lab11_scrabble/wordsList_collins2019.txt\"); \n\t \t\n\t \tSystem.out.print(\"All the words in the bucket where the word \"+ \" \\\"against\\\" \" + \" is located: \");\n\t \tSystem.out.println();\n\t \thtable.getWordsFromSameBucket(\"against\");\n\t \tSystem.out.println();\n\t \tSystem.out.println();\n\t \thtable.findPermutation(\"against\");\n\t \n\t \tSystem.out.println();\n\t \tSystem.out.print(\"All the words in the bucket where the word \"+ \" \\\"airport\\\" \" + \" is located: \");\n\t \tSystem.out.println();\n\t \thtable.getWordsFromSameBucket(\"airport\");\n\t \tSystem.out.println();\n\t \tSystem.out.println();\n\t \thtable.findPermutation(\"airport\");\n\t \t\n\t \tSystem.out.println();\n\t \tSystem.out.print(\"All the words in the bucket where the word \"+ \" \\\"between\\\" \" + \" is located: \");\n\t \tSystem.out.println();\n\t \thtable.getWordsFromSameBucket(\"between\");\n\t \tSystem.out.println();\n\t \tSystem.out.println();\n\t \thtable.findPermutation(\"between\");\n\n\t \tSystem.out.println();\n\t\t System.out.print(\"All the words in the bucket where the word \"+ \"\\\"married\\\"\" + \" is located: \");\n\t\t System.out.println();htable.getWordsFromSameBucket(\"married\");\n\t\t System.out.println();\n\t\t System.out.println();\n\t\t htable.findPermutation(\"married\");\n\t\t \n\t\t System.out.println();\n\t \tSystem.out.print(\"All the words in the bucket where the word \"+ \" \\\"ashbdap\\\" \" + \" is located: \");\n\t \tSystem.out.println();\n\t \thtable.getWordsFromSameBucket(\"ashbdap\");\n\t \tSystem.out.println();\n\t \tSystem.out.println();\n\t \thtable.findPermutation(\"ashbdap\");\n\t \t\n\t \t//test remove and size()\n\t \tSystem.out.println(htable.remove(\"speaned\"));\n\t \tSystem.out.println(htable.get(\"speaned\"));\n\t \tSystem.out.println(htable.size());\n\t }",
"public final /* synthetic */ Map mo33710j(List list) {\n HashMap hashMap = new HashMap();\n for (C2168bw next : this.f1705f.values()) {\n String str = next.f1693c.f1686a;\n if (list.contains(str)) {\n C2168bw bwVar = (C2168bw) hashMap.get(str);\n if ((bwVar == null ? -1 : bwVar.f1691a) < next.f1691a) {\n hashMap.put(str, next);\n }\n }\n }\n return hashMap;\n }",
"public HashMap<RoutingTableKey, RoutingTableInfo> getRoutingEntries() {\r\n synchronized (lockRoutingTable) {\r\n return routingEntries;\r\n }\r\n }",
"public Hashtable getRemappedValues() throws Exception;",
"public static void main(String[] args) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tHashtable<Temp, String> h = new Hashtable<>();\r\n\t\th.put(new Temp(1), \"A\");\r\n\t\th.put(new Temp(25), \"B\");\r\n\t\th.put(new Temp(30), \"C\");\r\n\t\th.put(new Temp(10), \"D\");\r\n\t\tSystem.out.println(h);\r\n\t\t//{30=C, 10=D, 25=B, 1=A}---when hashcode returns i\r\n\t\t//{25=B, 30=C, 1=A, 10=D}---when hashcode returns i%9\r\n\t\t\r\n\t\t//constructor with initial capacity\r\n\t\t//here if hashcode exceeds 4 then, modules of 5 is done. \r\n\t\tHashtable<Temp1, String> h1 = new Hashtable<>(5);\r\n\t\th1.put(new Temp1(1), \"A\");\r\n\t\th1.put(new Temp1(25), \"B\");\r\n\t\th1.put(new Temp1(30), \"C\");\r\n\t\th1.put(new Temp1(10), \"D\");\r\n\t\tSystem.out.println(h1);\r\n\t\t//{25=B, 10=D, 1=A, 30=C}\r\n\t\t\r\n\t\t//constructor using initial capacity and fill ratio.\r\n\t\tHashtable<Temp1, String> h2 = new Hashtable<>(5,0.4f);\r\n\t\th2.put(new Temp1(1), \"A\");\r\n\t\th2.put(new Temp1(25), \"B\");\r\n\t\th2.put(new Temp1(30), \"C\");\r\n\t\th2.put(new Temp1(10), \"D\");\r\n\t\tSystem.out.println(h2);\r\n\t\t//{30=C, 1=A, 10=D, 25=B}\r\n\t\t//{25=B, 10=D, 1=A, 30=C}\r\n\t\t\r\n\t\t//constructor using Map\r\n\t\tHashtable<Temp1, String> h3 = new Hashtable<>(h2);\r\n\t\tSystem.out.println(h3);\r\n\t}",
"private UInteger[] getHashValues() {\n int hashWindowSize = 48;\n UInteger[] hashValues = new UInteger[this.fileContent.length];\n int shiftAmount = this.getShiftAmount(hashWindowSize);\n int i = 0;\n\n int[] lookupTable =\n {0x5e3f7c48, 0x796a0d2b, 0xbecd4e32, 0x6f16159c, 0x687312bc, 0x12a6f30a, 0x8fca2662,\n 0x79b83d14, 0x3fab3f30, 0x984d6ca2, 0x4df5fe6c, 0x4acd3196, 0x6245ad21,\n 0x3a15e5ba, 0x90db6499, 0x05aacb6b, 0x791cf724, 0x504cd910, 0x98093570,\n 0x090392df, 0xf193e5b8, 0x42023c5b, 0x80a95c6a, 0x11e676be, 0xc70f2117,\n 0xeed4587f, 0x6479e9bd, 0x1b0c427c, 0x410486ba, 0x30f5b837, 0xf957d307,\n 0x1535f121, 0xabe45e90, 0x7a1ab8f0, 0x1c6887e4, 0x4170b7ba, 0x8b491bed,\n 0x5c920e73, 0x1b1ed791, 0x7a0ed482, 0xcce86619, 0x45dc7290, 0x57e71362,\n 0x2e24f01c, 0x0a0637f3, 0x0e8c5565, 0x15944012, 0x34f7eeea, 0xbc628141,\n 0x1e200874, 0xe9244379, 0x3e63aeca, 0x7a3b3cce, 0x73f8a245, 0xd734e215,\n 0x834fa434, 0xf96a0904, 0xfb39a424, 0x0bfa963a, 0x9b236ee2, 0xa2131005,\n 0x3eb70acf, 0x2907bcd8, 0x3f685f3a, 0x3765fd37, 0x1c1c34d2, 0x03a95179,\n 0x024be6c3, 0x06128960, 0x844e7490, 0xe2b371a3, 0x3382909c, 0x3d519a77,\n 0x90971ec9, 0x6ea745e5, 0x490b3a5c, 0x7f3916f7, 0xbc150351, 0x241a7ba0,\n 0xec93c2bb, 0x6c7083aa, 0xf3937751, 0xe6aa1df1, 0x129fc001, 0xb90709b9,\n 0x7e59a4fc, 0x4509e58a, 0x8a93ed43, 0x6934ce62, 0x8ec6af1a, 0xf36581a9,\n 0x53d01d93, 0xb34eef69, 0x08494a84, 0x0f6dff34, 0x74729aa3, 0x48b5475f,\n 0xb986dc84, 0xd0424c8d, 0xb72ad089, 0x0adbbdb8, 0x824fdbe8, 0x99ad1058,\n 0x98faec38, 0xe746242b, 0x2b7ee7fc, 0x2e151fa7, 0x6413270f, 0x68ed7239,\n 0x7729e2d3, 0x5697b3a5, 0x0b90a6c3, 0xdf7cefcf, 0xded46a48, 0x46956888,\n 0xb3bb6dc4, 0xe987578f, 0xf82e74b7, 0xc8eeeba4, 0xdd960ff9, 0x482ed28d,\n 0x4f343078, 0x563ab8a4, 0x3ec7aa0d, 0x2481d448, 0x5fe98704, 0x5aafc580,\n 0x841d81ec, 0xae7fe8fd, 0x6b31ccb6, 0x911ebdd4, 0x75f4703d, 0xe6855a0f,\n 0x6184b42e, 0x147a4a95, 0x39528e48, 0xe975b416, 0x3cba13d3, 0x1e23e544,\n 0xf7955286, 0xa5f96b7f, 0xaaa697aa, 0x29e794e3, 0x87628c09, 0xfeebf5f1,\n 0xf8b070cd, 0xe361b627, 0x8c7a8682, 0x69cab331, 0xca867ad1, 0xd0151a96,\n 0xfc19a6b9, 0x6d7439e7, 0x64cd62ac, 0x4a650747, 0x9ddbfa28, 0x337c8bed,\n 0xf12a6860, 0x3767ffd3, 0x13559ced, 0x71ac2011, 0xc11dc687, 0x260b7105,\n 0xc13bca0c, 0xcd0af893, 0x793b54e6, 0x89d27fc3, 0xc6bd1c88, 0xe3337313,\n 0x387bc671, 0x61280de4, 0x76941a36, 0xaa52a2b9, 0x6d7cb52c, 0x18ff4d70,\n 0x8987cf38, 0x306e47ed, 0xf7df8135, 0x18a8e024, 0xc9eb085f, 0xc1a7c769,\n 0xd5667a12, 0x9c8be93a, 0x028781b1, 0x6213dada, 0x07fef4f5, 0x5e6bf91d,\n 0x469ea798, 0xb9654a37, 0x1cb5e74e, 0x525d502d, 0xe805ec68, 0xdd8c4320,\n 0x7890848f, 0x61e59c8e, 0x1d99f9ef, 0x25b60b20, 0x2f198088, 0xe01b6926,\n 0xffa4917f, 0xb2fa0f22, 0xee8ac924, 0x18a1c5a7, 0xb76d8d7f, 0x88ad5e0d,\n 0x7b3fb12b, 0xc8a91add, 0x762a6f4e, 0x056fad31, 0xebecfab8, 0xea54cd17,\n 0x71f5af9f, 0xfaececa1, 0x08a52f4d, 0xbb5efebe, 0x5bcb04c2, 0xcb2530b0,\n 0x01bb862b, 0xbb5d54f0, 0x404deb4b, 0x038658bd, 0x09399005, 0xddd862c8,\n 0x8985776f, 0xcfcfd717, 0xbec756cb, 0x52aecc5a, 0x09ac3f62, 0x62c1c6fb,\n 0x76cc3221, 0xcde6d028, 0x844d9291, 0xc143eeac, 0x0ea5e772, 0x8855456e,\n 0xeb03a426, 0x3398475d, 0x73dc8107, 0x681605d0, 0xd18b6264, 0x934e43eb,\n 0x59e76d21, 0xd3ce2b77, 0x4ccfee1c, 0x2f4af76d, 0x8b12a309, 0x849bb415,\n 0xf45ad809, 0xc7bccae7, 0xac891c35, 0x59db2274, 0xbcd71393, 0x2c9b1705,\n 0xcb536a69, 0xb2800f00, 0x111313fc};\n\n while (i < this.fileContent.length) {\n UInteger hashValue = i == 0 ? uint(0) : hashValues[i - 1];\n int trailingEdgeData = i < hashWindowSize ? ubyte(0).intValue() :\n ubyte(this.fileContent[i - hashWindowSize]).intValue();\n int leadingEdgeData = ubyte(this.fileContent[i]).intValue();\n UInteger val = hashValue.xor(uint(lookupTable[trailingEdgeData]))\n .xor(uint(lookupTable[leadingEdgeData]));\n hashValues[i] =\n val.leftShift(2).inclusiveOr(val.rightShift(Integer.SIZE - shiftAmount));\n i++;\n }\n\n return hashValues;\n }",
"public HashMap<K,V> listAll();",
"public final Set<Entry<String, C0591m>> mo5562h() {\n return this.f1464a.entrySet();\n }",
"public static void hashMapEx() {\n\t\tString str = \"habiletechE\";\n\t\tstr = str.toLowerCase();\n\t\tchar[] ch = str.toCharArray();\n\t\tint size = ch.length;\n\n\t\tHashMap<Character, Integer> hmap = new HashMap<Character, Integer>();\n\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tif (!hmap.containsKey(ch[i]))\n\t\t\t\thmap.put(ch[i], 1);\n\t\t\telse {\n\t\t\t\tint val = hmap.get(ch[i]) + 1;\n\t\t\t\thmap.put(ch[i], val);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Duplicate Charaacters :\");\n\t\tfor (Map.Entry<Character, Integer> hm : hmap.entrySet()) {\n\t\t\tif (hm.getValue() > 1)\n\t\t\t\tSystem.out.println(hm.getKey() + \" \" + hm.getValue());\n\t\t}\n\t}",
"private SequentialSearchSymbolTable() {\n\t\t\tkeySet = new ArrayList<>();\n\t\t\tvalueSet = new ArrayList<>();\n\t\t\tsize = 0;\n\t\t}",
"@VisibleForTesting\n static Map<String, Set<String>> parseMtab(String mtab)\n throws IOException {\n Map<String, Set<String>> ret = new HashMap<>();\n BufferedReader in = null;\n Set<String> validCgroups =\n CGroupsHandler.CGroupController.getValidCGroups();\n\n try {\n FileInputStream fis = new FileInputStream(new File(mtab));\n in = new BufferedReader(new InputStreamReader(fis, \"UTF-8\"));\n\n for (String str = in.readLine(); str != null;\n str = in.readLine()) {\n Matcher m = MTAB_FILE_FORMAT.matcher(str);\n boolean mat = m.find();\n if (mat) {\n String path = m.group(1);\n String type = m.group(2);\n String options = m.group(3);\n\n if (type.equals(CGROUPS_FSTYPE)) {\n Set<String> cgroupList =\n new HashSet<>(Arrays.asList(options.split(\",\")));\n // Collect the valid subsystem names\n cgroupList.retainAll(validCgroups);\n ret.put(path, cgroupList);\n }\n }\n }\n } catch (IOException e) {\n if (Shell.LINUX) {\n throw new IOException(\"Error while reading \" + mtab, e);\n } else {\n // Ignore the error, if we are running on an os other than Linux\n LOG.warn(\"Error while reading \" + mtab, e);\n }\n } finally {\n IOUtils.cleanupWithLogger(LOG, in);\n }\n\n return ret;\n }",
"public static Hashtable<Integer, Integer> BuildSectionForPositionMap(Passagem[] passagens)\n {\n Hashtable results = new Hashtable<Integer, Integer>();\n TreeSet<String> used = new TreeSet<>();\n int section = -1;\n\n if(passagens != null) {\n for (int i = 0; i < passagens.length; i++) {\n String letter = passagens[i].getNome().substring(0, 1);\n\n if (!used.contains(letter)) {\n section++;\n used.add(letter);\n }\n\n results.put(i, section);\n }\n }\n return results;\n }",
"public LinkedList<MapEntry<String, Integer>> entrySet(){\r\n return this.list;\r\n }",
"public Map<String, Integer> describeThisHist() {\n \tchar[] copyOfLut = new char[256];\n \tlut[0]='+';\n \tfor (int a=1; a<255; a++) {\n \t\tif (lut[a]>lut[a-1]) copyOfLut[a]='+';\n \t\telse copyOfLut[a]='-';\n \t}\n \tSystem.out.println(Arrays.toString(lut));\n \t\n \t// TODELETE START\n \t\n \t for (int maxlit=0, maxlval=0,\n \t\t\t maxrit=0, maxrval=0,\n \t\t\t lit=0, rit=255;;lit++,rit--) {\n \t\t\t if (lut[lit]>maxlval) {maxlit=lit; maxlval=lut[lit]; histDesc.put(\"peak1idx\", lit); histDesc.put(\"peak1val\", lut[lit]);}\n \t\t\t if (lut[rit]>maxrval) {maxrit=rit; maxrval=lut[rit]; histDesc.put(\"peak2idx\", rit); histDesc.put(\"peak2val\", lut[rit]);}\n \t\t\t if (maxlit==maxrit && maxlval==maxrval) break;\n \t}\n \t\n \t// Now find the minimum between the peaks\n \tfor (int i=histDesc.get(\"peak1idx\"), valleyidx=0, valleyval=255; i<histDesc.get(\"peak2idx\"); i++) {\n \t\tif (lut[i]<valleyval) {valleyval=lut[i]; valleyidx=i; histDesc.put(\"valleyidx\", i); histDesc.put(\"valleyval\", lut[i]);}\n \t} \n \t\n \t// TODELETE END\n \t\n \tboolean isSmoothed=false;\n \tint windowSize=4;\n \tint sensitivity=2;\n \t\n \twhile (!isSmoothed) {\n \t\tisSmoothed=true;\n \t\tint noOfPluses=0;\n \t\tfor (int i=0; i<copyOfLut.length-windowSize-1; i++) {\n \t\t\tfor (int j=0; j<windowSize; j++) if (lut[i+j+1]>lut[i+j]) noOfPluses++;\n \t\t\tif (noOfPluses>=sensitivity) {\n \t\t\t\tif (copyOfLut[i]=='-') {\n \t\t\t\t\tcopyOfLut[i]='+';\n \t\t\t\t\tisSmoothed=false;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n \t\n \tisSmoothed=false;\n \t\n \twhile (!isSmoothed) {\n \t\tisSmoothed=true;\n \t\tint noOfPluses=0;\n \t\tfor (int i=0; i<copyOfLut.length-windowSize-1; i++) {\n \t\t\tfor (int j=0; j<windowSize; j++) if (lut[i+j+1]<lut[i+j]) noOfPluses++;\n \t\t\tif (noOfPluses>=sensitivity) {\n \t\t\t\tif (copyOfLut[i]=='+') {\n \t\t\t\t\tcopyOfLut[i]='-';\n \t\t\t\t\tisSmoothed=false;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n \t\n \tArrayList<Paire> listofpluses = new ArrayList<>();\n \t\n \tint startcounter=0; int endcounter=0; boolean counting=false;\n \tfor (int i=0; i<copyOfLut.length; i++){\n \t\tif (copyOfLut[i]=='+') {\n \t\t\tif (counting) endcounter=i;\n \t\t\telse {startcounter=i; counting=true;}\n \t\t}\n \t\tif (copyOfLut[i]=='-') {\n \t\t\tif (counting) {\n \t\t\t\tendcounter=i-1;\n \t\t\t\tlistofpluses.add(new Paire(startcounter,endcounter));\n \t\t\t\tcounting=false;\n \t\t\t}\n \t\t}\n \t}\n \t\n // \tlistofpluses.forEach(x -> System.out.println(x));\n \t\n \t\n \t\n \treturn histDesc; \t\n }",
"public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n HashMap<Integer, Character> hashMap = new HashMap<Integer, Character>();\n hashMap.put(0,'F');hashMap.put(1,'G');hashMap.put(2,'R');\n hashMap.put(3,'S');hashMap.put(4,'T');hashMap.put(5,'L');\n hashMap.put(6,'M');hashMap.put(7,'N');hashMap.put(8,'O');\n hashMap.put(9,'P');hashMap.put(10,'Q');hashMap.put(11,'W');\n hashMap.put(12,'X');hashMap.put(13,'Y');hashMap.put(14,'Z');\n hashMap.put(15,'U');hashMap.put(16,'A');hashMap.put(17,'G');\n hashMap.put(18,'H');hashMap.put(19,'I');hashMap.put(20,'J');\n hashMap.put(21,'K');hashMap.put(22,'B');hashMap.put(23,'C');\n hashMap.put(24,'D');hashMap.put(25,'E');hashMap.put(26,'l');\n hashMap.put(27,'m');hashMap.put(28,'n');hashMap.put(29,'o');\n hashMap.put(30,'p');hashMap.put(31,'i');hashMap.put(32,'j');\n hashMap.put(33,'k');hashMap.put(34,'f');hashMap.put(35,'g');\n hashMap.put(36,'h');hashMap.put(37,'a');hashMap.put(38,'b');\n hashMap.put(39,'c');hashMap.put(40,'d');hashMap.put(41,'e');\n hashMap.put(42,'q');hashMap.put(43,'r');hashMap.put(44,'w');\n hashMap.put(45,'x');hashMap.put(46,'y');hashMap.put(47,'z');\n hashMap.put(48,'s');hashMap.put(49,'t');hashMap.put(50,'u');\n hashMap.put(51,'v');\n while(in.hasNext()){\n String str = in.next();\n\n String[] arr = str.split(\"[#]+\");\n\n StringBuffer ss = new StringBuffer();\n\n for (int i = 0; i < arr.length; i++) {\n\n //System.out.println(arr[i]);\n\n StringBuffer sb = new StringBuffer();\n\n for (int j = 0; j < arr[i].length(); j++) {\n\n int a = arr[i].charAt(j)=='-'?0:1;\n sb.append(a);\n }\n\n long b = Long.valueOf(sb.toString(),2);\n\n if (b>51||b<0){\n ss.replace(0,ss.length(),\"\");\n ss.append(\"ERROR\");\n break;\n }else {\n ss.append(hashMap.get((int)b));\n }\n }\n System.out.println(ss);\n\n }\n }",
"@Override\n public Set<String> makeGuess(char guess) throws GuessAlreadyMadeException {\n\n for(String word : myDictionary) {\n ArrayList<Integer> indices = new ArrayList<>();\n for (int i = 0; i < word.length(); i++) {\n if(word.charAt(i) == guess) {\n indices.add(i);\n }\n }\n boolean matchFound = false;\n for (Map.Entry<Pattern, Set<String>> entry : myMap.entrySet()) {\n Pattern myPattern = entry.getKey();\n Set<String> myStrings = entry.getValue();\n if(indices.equals(myPattern.ReturnIndices())) {\n myStrings.add(word);\n //myNewDictionary.add(word);\n matchFound = true;\n }\n\n }\n if(matchFound == false) {\n Pattern myNewPattern = new Pattern(word.length(), word, indices);\n Set<String> myNewString = new HashSet<>();\n myNewString.add(word);\n //myNewDictionary.add(word);\n myMap.put(myNewPattern, myNewString);\n }\n\n }\n this.myDictionary = RunEvilAlgorithm();\n this.myMap = new HashMap<>();\n //make a function to run evil algorithm\n return myDictionary;\n }",
"public ArrayList<Table> find(DataEntry entry) {\n\t\tArrayList<Table> foundTables = new ArrayList<>();\n\t\tfor (Table table : tables.values()) {\n\t\t\tif (table.contains(entry)) {\n\t\t\t\tfoundTables.add(table);\n\t\t\t}\n\t\t}\n\t\treturn foundTables;\n\t}",
"public static Hashtable<String, Vector<String>> getMetaData3(String tablename) {\n\t\tHashtable<String, Vector<String>> temp = new Hashtable<String, Vector<String>>();\n\t\tBufferedReader fileReader = null;\n\t\tString[] array;\n\n\t\ttry {\n\t\t\tString l = \"\";\n\t\t\tfileReader = new BufferedReader(new FileReader(\"src/main/resources/metadata.csv\"));\n\t\t\twhile ((l = fileReader.readLine()) != null) {\n\t\t\t\tVector<String> v = new Vector<>();\n\t\t\t\tarray = l.split(\",\");\n\t\t\t\tif (array[0].equals(tablename)) {\n\t\t\t\t\tv.add(array[5]);\n\t\t\t\t\tv.add(array[6]);\n\t\t\t\t\ttemp.put(array[1], v);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn temp;\n\t}",
"public List<Symbol> internals() {\n\t\tList<Table.Entry<Symbol, List<Entry<T>>>> entries = table.toList();\n\t\tList<Entry<T>> internals = new ArrayList<Entry<T>>();\n\t\t\n\t\tfor (Table.Entry<Symbol, List<Entry<T>>> entry : entries) {\n\t\t\tinternals.addAll(entry.value);\n\t\t}\n\t\t\n\t\tCollections.sort(internals, new EntryComparator());\n\n\t\tList<Symbol> ret = new ArrayList<Symbol>(internals.size());\n\t\tfor (Entry<T> entry : internals) {\n\t\t\tret.add(entry.symbol);\n\t\t}\n\t\treturn ret;\n\t}",
"public static Map<String, String> stringToHashtable(String file) {\r\n if (file == null) {\r\n return null;\r\n }\r\n\r\n String sansComments = eraseComments(file);\r\n int pos = 0, count = sansComments.length();\r\n Map<String, String> retval = new HashMap<String, String>();\r\n\r\n // Split the file, line by line, into key/value pairs\r\n while (pos < count) {\r\n int eol = offsetToEOL(sansComments, pos);\r\n int next = offsetToNextLine(sansComments, pos);\r\n if (eol > 0) {\r\n String line = sansComments.substring(pos, pos + eol);\r\n StringTokenizer st = new StringTokenizer(line, \"=\");\r\n String key = st.nextToken();\r\n String value = \"\";\r\n if (st.hasMoreTokens()) {\r\n value = st.nextToken();\r\n }\r\n\r\n // Place scalar values in the hashtable directly\r\n // otherwise break comma separated ones into Vectors.\r\n // If they can be, items are inserted as Doubles, failing\r\n // that, as Strings.\r\n // int comma = value.indexOf(\",\");\r\n // if (comma == -1) {\r\n // try {\r\n // retval.put(key, new Double(value));\r\n // } catch (NumberFormatException nfe) {\r\n retval.put(key, value);\r\n // } // endtry\r\n // } else {\r\n // Vector<Comparable> v = new Vector<Comparable>();\r\n // StringTokenizer values = new StringTokenizer(value, \",\");\r\n // while (values.hasMoreTokens()) {\r\n // String s = values.nextToken();\r\n // try {\r\n // v.addElement(new Double(s));\r\n // } catch (NumberFormatException nfe) {\r\n // v.addElement(s.trim());\r\n // } // endtry\r\n // } // endwhile\r\n // retval.put(key, v);\r\n // } // endif\r\n } // endif\r\n pos += next;\r\n } // endwhile\r\n\r\n return retval;\r\n }",
"public static ResultModel search(String text, String pattern) {\n long startTime = System.nanoTime();\n ResultModel Result = new ResultModel();\n String positionText = \"\";\n int Count = 0;\n // Write your code here\n int M = pattern.length(); \n int N = text.length(); \n int i, j; \n int p = 0; // hash value for pattern \n int t = 0; // hash value for txt \n int h = 1; \n \n // The value of h would be \"pow(d, M-1)%q\" \n for (i = 0; i < M-1; i++) {\n h = (h*d)%q; \n }\n // Calculate the hash value of pattern and first \n // window of text \n for (i = 0; i < M; i++) \n { \n p = (d*p + pattern.charAt(i))%q; \n t = (d*t + text.charAt(i))%q; \n\n\n } \n \n \n // Slide the pattern over text one by one \n for (i = 0; i <= N - M; i++) \n { \n \n // Check the hash values of current window of text \n // and pattern. If the hash values match then only \n // check for characters on by one \n if ( p == t ) \n { \n /* Check for characters one by one */\n for (j = 0; j < M; j++) \n { \n if (text.charAt(i+j) != pattern.charAt(j)) \n break; \n } \n \n // if p == t and pat[0...M-1] = txt[i, i+1, ...i+M-1] \n if (j == M) { \n \tCount ++;\n\t // return i\n\t if(positionText == \"\") {\n\t positionText += (i+ 1) + \"th\";\n\t }else {\n\t positionText = positionText + \", \" + (i+1) + \"th\";\n\t }\n }\n } \n \n // Calculate hash value for next window of text: Remove \n // leading digit, add trailing digit \n if ( i < N-M ) \n { \n\n t = (d*(t - text.charAt(i)*h) + text.charAt(i+M))%q; \n \n // We might get negative value of t, converting it \n // to positive \n if (t < 0) {\n\n t = (t + q); \n }\n \n } \n \n } \n\n //End of code\n\n long endTime = System.nanoTime();\n long totalTime = endTime - startTime;\n\n Result.setExecutionTime(TimeUnit.NANOSECONDS.toMillis(totalTime));\n Result.setFoundCount(Count);\n Result.setPosition(positionText);\n return Result;\n }",
"public static Hashtable<Integer, Integer> BuildPositionForSectionMap(Passagem[] passagens)\n {\n Hashtable results = new Hashtable<Integer, Integer>();\n TreeSet<String> used = new TreeSet<>();\n int section = -1;\n\n if(passagens != null) {\n for (int i = 0; i < passagens.length; i++) {\n String letter = passagens[i].getNome().substring(0, 1);\n\n if (!used.contains(letter)) {\n section++;\n used.add(letter);\n results.put(section, i);\n }\n }\n }\n return results;\n }",
"public Map<Integer, Set<PartialPath>> getTemplateSetInfo(PartialPath pathPattern)\n throws MetadataException {\n Map<Integer, Set<PartialPath>> result = new HashMap<>();\n try (MNodeCollector<?> collector =\n new MNodeCollector<Void>(root, pathPattern, store, false) {\n @Override\n protected boolean acceptFullMatchedNode(IMNode node) {\n return (node.getSchemaTemplateId() != NON_TEMPLATE)\n || super.acceptFullMatchedNode(node);\n }\n\n @Override\n protected boolean acceptInternalMatchedNode(IMNode node) {\n return (node.getSchemaTemplateId() != NON_TEMPLATE)\n || super.acceptInternalMatchedNode(node);\n }\n\n @Override\n protected Void collectMNode(IMNode node) {\n result\n .computeIfAbsent(node.getSchemaTemplateId(), k -> new HashSet<>())\n .add(getPartialPathFromRootToNode(node));\n return null;\n }\n\n @Override\n protected boolean shouldVisitSubtreeOfFullMatchedNode(IMNode node) {\n // descendants of the node cannot set another template, exit from this branch\n return (node.getSchemaTemplateId() == NON_TEMPLATE)\n && super.shouldVisitSubtreeOfFullMatchedNode(node);\n }\n\n @Override\n protected boolean shouldVisitSubtreeOfInternalMatchedNode(IMNode node) {\n // descendants of the node cannot set another template, exit from this branch\n return (node.getSchemaTemplateId() == NON_TEMPLATE)\n && super.shouldVisitSubtreeOfFullMatchedNode(node);\n }\n }) {\n collector.traverse();\n }\n return result;\n }",
"static Map<String, Handlers> getIntentMap()\n\t{\n\t\tMap<String, Handlers> h_map = new HashMap<>();\n\t\t\n\t\t\n\t\th_map.put (ADDRESS_ADD , Handlers.NODE_CREATE);\n\t\th_map.put (ADDRESS_ASSOCIATE , Handlers.LINK_CREATE);\n\t\th_map.put (ADDRESS_DELETE , Handlers.NODE_DELETE);\n\t\th_map.put (EVENT_ADD , Handlers.NODE_CREATE_AND_LINK);\n\t\th_map.put (EVENT_DELETE , Handlers.NODE_DELETE);\n\t\th_map.put (GROUP_ADD , Handlers.NODE_CREATE);\n\t\th_map.put (GROUP_DELETE , Handlers.NODE_DELETE);\n\t\th_map.put (GROUP_MEMBER_ADD , Handlers.LINK_CREATE);\n\t\th_map.put (GROUP_MEMBER_DELETE, Handlers.LINK_DELETE);\n\t\th_map.put (PERSON_ADD , Handlers.NODE_CREATE);\n\t\th_map.put (PERSON_DELETE , Handlers.NODE_DELETE);\n\t\th_map.put (SUBSCRIPTION_ADD , Handlers.NODE_CREATE_AND_MULTILINK);\n\t\th_map.put (SUBSCRIPTION_DELETE, Handlers.NODE_DELETE);\n\t\th_map.put (USER_DELETE , Handlers.NODE_DELETE);\n\t\th_map.put (USER_REGISTER , Handlers.REGISTER_USER);\n\n\t\treturn h_map;\n\t}",
"private int[] genKeys() {\n HashSet<Integer> set = new HashSet<Integer>();\n HashSet<int[]> next = new HashSet<int[]>();\n rowKeys = new HashMap<Integer, Integer>();\n int[] rowKeys2combo = new int[keySize];\n\n // 1st set starts with 0004, 0040, 0400, 4000\n int counter = 0;\n int key;\n for (int i = 0; i < rowSize; i++) {\n int[] temp = new int[rowSize];\n temp[i] = rowSize;\n key = rowCombo2Key(temp);\n rowKeys2combo[counter] = key;\n rowKeys.put(key, counter++);\n set.add(key);\n next.add(temp);\n }\n\n while (next.size() > 0) {\n HashSet<int[]> expand = next;\n next = new HashSet<int[]>();\n for (int[] combo : expand) {\n for (int i = 0; i < rowSize; i++) {\n if (combo[i] > 0) {\n for (int j = 0; j < rowSize; j++) {\n if (i != j) {\n int[] shift = new int[rowSize];\n System.arraycopy(combo, 0, shift, 0, rowSize);\n shift[i] = combo[i] - 1;\n shift[j] = combo[j] + 1;\n key = rowCombo2Key(shift);\n if (!set.contains(key)) {\n rowKeys2combo[counter] = key;\n rowKeys.put(key, counter++);\n set.add(key);\n next.add(shift);\n }\n }\n }\n }\n }\n }\n }\n\n final int splitIdx = counter;\n\n // 2nd set starts with 0003, 0030, 0300, 3000\n for (int i = 0; i < rowSize; i++) {\n int[] temp = new int[rowSize];\n temp[i] = rowSize - 1;\n key = rowCombo2Key(temp);\n rowKeys2combo[counter] = key;\n rowKeys.put(key, counter++);\n set.add(key);\n next.add(temp);\n }\n\n while (next.size() > 0) {\n HashSet<int[]> expand = next;\n next = new HashSet<int[]>();\n for (int[] combo : expand) {\n for (int i = 0; i < rowSize; i++) {\n if (combo[i] > 0) {\n for (int j = 0; j < rowSize; j++) {\n if (i != j) {\n int[] shift = new int[rowSize];\n System.arraycopy(combo, 0, shift, 0, rowSize);\n shift[i] = combo[i] - 1;\n shift[j] = combo[j] + 1;\n key = rowCombo2Key(shift);\n if (!set.contains(key)) {\n rowKeys2combo[counter] = key;\n rowKeys.put(key, counter++);\n set.add(key);\n next.add(shift);\n }\n }\n }\n }\n }\n }\n }\n return genKeyLink(splitIdx, rowKeys2combo);\n }",
"private void genPattern(int[] rowKeyLink) {\n ptnKeys = new HashMap<Integer, Integer>();\n pattern = new byte[patternSize];\n ptnLink = new int[patternSize * rowSize * 2];\n final int rowBitsSize = 6;\n final int zeroBitsSize = 4;\n\n /* starts with 4000 // 6 bits each\n 0400\n 0040\n 0003 | 3 (4 bits for zero row index)\n total 4 x 6 bits + 4 bits = 28 bits for combo */\n int initCombo = 0;\n for (int i = 0; i < rowSize - 1; i++) {\n int key = rowSize << ((rowSize - i - 1) * 3);\n initCombo = (initCombo << rowBitsSize) | rowKeys.get(key);\n }\n initCombo = (initCombo << rowBitsSize) | rowKeys.get(rowSize - 1);\n initCombo = (initCombo << zeroBitsSize) | (rowSize - 1);\n int ctPtn = 0;\n byte moves = 0;\n int[] ptnKeys2combo = new int[patternSize];\n\n ptnKeys2combo[ctPtn] = initCombo;\n ptnKeys.put(initCombo, ctPtn);\n pattern[ctPtn++] = moves;\n boolean loop = true;\n int top = 0;\n int top2 = 0;\n int end = 1;\n int end2 = 1;\n\n while (loop) {\n moves++;\n top = top2;\n end = end2;\n top2 = end2;\n loop = false;\n\n for (int i = top; i < end; i++) {\n int currPtn = ptnKeys2combo[i];\n int ptnCombo = currPtn >> zeroBitsSize;\n int zeroRow = currPtn & 0x000F;\n int zeroIdx = getRowKey(ptnCombo, zeroRow);\n int linkBase = i * rowSize * 2;\n\n // space down, tile up\n if (zeroRow < rowSize - 1) {\n int lowerIdx = getRowKey(ptnCombo, zeroRow + 1);\n for (int j = 0; j < rowSize; j++) {\n if (rowKeyLink[lowerIdx * rowSize + j] != -1) {\n int newPtn = 0;\n int pairKeys = (rowKeyLink[zeroIdx * rowSize + j] << rowBitsSize)\n | rowKeyLink[lowerIdx * rowSize + j];\n\n switch (zeroRow) {\n case 0:\n newPtn = (pairKeys << 2 * rowBitsSize)\n | (ptnCombo & partialPattern[0]);\n break;\n case 1:\n newPtn = (ptnCombo & partialPattern[1])\n | (pairKeys << rowBitsSize)\n | (ptnCombo & partialPattern[2]);\n break;\n case 2:\n newPtn = (ptnCombo & partialPattern[3]) | pairKeys;\n break;\n default:\n System.err.println(\"ERROR\");\n }\n\n newPtn = (newPtn << zeroBitsSize) | (zeroRow + 1);\n if (ptnKeys.containsKey(newPtn)) {\n ptnLink[linkBase + j * 2] = ptnKeys.get(newPtn);\n } else {\n ptnKeys2combo[ctPtn] = newPtn;\n ptnKeys.put(newPtn, ctPtn);\n pattern[ctPtn] = moves;\n ptnLink[linkBase + j * 2] = ctPtn++;\n loop = true;\n end2++;\n }\n } else {\n ptnLink[linkBase + j * 2] = -1;\n }\n }\n } else {\n ptnLink[linkBase] = -1;\n ptnLink[linkBase + 2] = -1;\n ptnLink[linkBase + 4] = -1;\n ptnLink[linkBase + 6] = -1;\n }\n\n // space up, tile down\n if (zeroRow > 0) {\n int upperIdx = getRowKey(ptnCombo, zeroRow - 1);\n for (int j = 0; j < rowSize; j++) {\n if (rowKeyLink[upperIdx * rowSize + j] != -1) {\n int newPtn = 0;\n int pairKeys = (rowKeyLink[upperIdx * rowSize + j] << rowBitsSize)\n | rowKeyLink[zeroIdx * rowSize + j];\n\n switch (zeroRow) {\n case 1:\n newPtn = (ptnCombo & partialPattern[0])\n | (pairKeys << 2 * rowBitsSize);\n break;\n case 2:\n newPtn = (ptnCombo & partialPattern[1])\n | (pairKeys << rowBitsSize)\n | (ptnCombo & partialPattern[2]);\n break;\n case 3:\n newPtn = (ptnCombo & partialPattern[3]) | pairKeys;\n break;\n default:\n System.err.println(\"ERROR\");\n }\n\n newPtn = (newPtn << zeroBitsSize) | (zeroRow - 1);\n if (ptnKeys.containsKey(newPtn)) {\n ptnLink[linkBase + j * 2 + 1] = ptnKeys.get(newPtn);\n } else {\n ptnKeys2combo[ctPtn] = newPtn;\n ptnKeys.put(newPtn, ctPtn);\n pattern[ctPtn] = moves;\n ptnLink[linkBase + j * 2 + 1] = ctPtn++;\n loop = true;\n end2++;\n }\n } else {\n ptnLink[linkBase + j * 2 + 1] = -1;\n }\n }\n } else {\n ptnLink[linkBase + 1] = -1;\n ptnLink[linkBase + 3] = -1;\n ptnLink[linkBase + 5] = -1;\n ptnLink[linkBase + 7] = -1;\n }\n }\n }\n }",
"public int hashCode()\r\n\t{\n\t\treturn (i % 9); //this will make the values to store in the table based on size of hashtable is 9 and calculation will be (i %9)\r\n\t}",
"public Iterable<Entry<K, V>> entries();",
"public final /* synthetic */ Map mo34041c(List list) {\n HashMap hashMap = new HashMap();\n for (C1844cm next : this.f589f.values()) {\n String str = next.f577c.f570a;\n if (list.contains(str)) {\n C1844cm cmVar = (C1844cm) hashMap.get(str);\n if ((cmVar == null ? -1 : cmVar.f575a) < next.f575a) {\n hashMap.put(str, next);\n }\n }\n }\n return hashMap;\n }",
"private final Map<String, Object> m7134b() {\n HashMap hashMap = new HashMap();\n zzcf.zza zzco = this.f11698b.zzco();\n hashMap.put(\"v\", this.f11697a.zzawx());\n hashMap.put(\"gms\", Boolean.valueOf(this.f11697a.zzcm()));\n hashMap.put(\"int\", zzco.zzaf());\n hashMap.put(\"up\", Boolean.valueOf(this.f11700d.mo17775a()));\n hashMap.put(\"t\", new Throwable());\n return hashMap;\n }",
"public int[] keySet() {\n objectCounter++;\n int[] keys = new int[contents];\n int cnt = 0;\n MapElement me = null;\n\n for (int i = 0; i < capacity; i++) {\n if (map[i] != null) {\n me = map[i];\n while (null != me) {\n keys[cnt++] = me.getKey();\n me = me.getNext();\n }\n }\n }\n return keys;\n }",
"private static Map<String, Method> buildMethoMap(final Class<?> c, String patternStr) throws Exception {\n\t\tMap<String, Method> methodMap = new HashMap<String, Method>();\n\t\tpatternStr = patternStr + \"([A-Z])(\\\\w+)\";\n\t\t\n\t\tfor (Method method : c.getMethods()) {\n\t\t\tString methodName = method.getName();\n\t\t\tPattern pattern = Pattern.compile(patternStr);\n\t\t\tMatcher matcher = pattern.matcher(methodName);\n\t\t\tif (!matcher.find()) continue;\n\t\t\t\n\t\t\tString fieldName = matcher.group(1).toLowerCase() + matcher.group(2);\n\t\t\t// Put the field into the hash table with its name as the key\n\t\t\tmethodMap.put(fieldName, method);\n\t\t}\n\t\t\n\t\treturn methodMap;\n\t}",
"public DesignHashmap() {\n\t\ttable = new boolean[buckets][];\n\t}",
"public Map<String, Match> getReferenceMatches();",
"@Override\n public Set<Map.Entry<String,Componente>> entrySet() {\n \n //resultado\n Set<Map.Entry<String,Componente>> r = new HashSet<>();\n \n \n Componente c;\n \n try {\n \n conn = Connect.connect();// abrir uma conecção\n \n // querie que obtem os dados para poder\n PreparedStatement stm = conn.prepareStatement(\"SELECT nome, tipo, designacao, preco, stock FROM Componente WHERE visivel=TRUE;\");\n \n // agora executa a querie\n ResultSet rs = stm.executeQuery();\n \n //percorrer o resultado\n while (rs.next()) {\n c = new Componente(rs.getString(\"nome\"),rs.getString(\"tipo\"),rs.getString(\"designacao\"),rs.getDouble(\"preco\"),rs.getInt(\"stock\"));\n \n /*\n AGORA FALTA OS METUDOS PARA PREENCHER A LISTA DAS CONFIGURAÇÕES\n \n Agora temos de ter \n */\n \n this.adicionarIncompativeis(c);\n this.adicionarObrigatorias(c);\n\n \n r.add(new AbstractMap.SimpleEntry(c.getNome(),c));\n }\n } catch (SQLException | ClassNotFoundException e) {\n e.printStackTrace();\n } finally {\n Connect.close(conn); // fechar a connecção\n }\n \n return r;\n }",
"@Override\n\tpublic Set<Entry<K, V>> entrySet() {\n\t\tSet<Entry<K, V>> entrySet = map.entrySet();\n\t\tListSet<Entry<K, V>> listSet = new ListSet<Map.Entry<K,V>>();\n\t\tfor (K key : keys) {\n\t\t\t\n\t\t\tfor (Entry<K, V> entry : entrySet) {\n\t\t\t\tif (entry.getKey().equals(key)) {\n\t\t\t\t\tlistSet.add(entry);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn listSet;\n\t}",
"PatternMapping getPatternMapping();",
"@Override\n public Set<Map.Entry<String,Pacote>> entrySet() {\n \n //resultado\n Set<Map.Entry<String,Pacote>> r = new HashSet<>();\n \n \n Pacote p;\n \n try {\n \n conn = Connect.connect();// abrir uma conecção\n \n // querie que obtem os dados para poder\n PreparedStatement stm = conn.prepareStatement(\"SELECT nomePacote, preco FROM Pacote WHERE visivel=TRUE;\");\n \n // agora executa a querie\n ResultSet rs = stm.executeQuery();\n \n //percorrer o resultado\n while (rs.next()) {\n p = new Pacote(rs.getString(\"nomePacote\"),rs.getDouble(\"preco\"));\n \n \n /*\n AGORA FALTA OS METUDOS PARA PREENCHER A LISTA DAS CONFIGURAÇÕES\n */\n \n this.addComponentes(p);\n \n \n \n r.add(new AbstractMap.SimpleEntry(p.getNome(),p));\n }\n } catch (SQLException | ClassNotFoundException e) {\n e.printStackTrace();\n } finally {\n Connect.close(conn); // fechar a connecção\n }\n return r;\n }",
"private Object[] getPatternItems() {\n\t\tif (patternItems != null) {\n\t\t\treturn patternItems;\n\t\t}\n\n\t\tpatternItems = PARSED_PATTERN_CACHE.get(pattern);\n\t\tif (patternItems != null) {\n\t\t\treturn patternItems;\n\t\t}\n\n\t\tboolean isPrevQuote = false;\n\t\tboolean inQuote = false;\n\t\tStringBuilder text = new StringBuilder();\n\t\tchar itemType = 0; // 0 for string literal, otherwise date/time pattern character\n\t\tint itemLength = 1;\n\n\t\tList<Object> items = new ArrayList<Object>();\n\n\t\tfor (int i = 0; i < pattern.length(); i++) {\n\t\t\tchar ch = pattern.charAt(i);\n\t\t\tif (ch == '\\'') {\n\t\t\t\tif (isPrevQuote) {\n\t\t\t\t\ttext.append('\\'');\n\t\t\t\t\tisPrevQuote = false;\n\t\t\t\t} else {\n\t\t\t\t\tisPrevQuote = true;\n\t\t\t\t\tif (itemType != 0) {\n\t\t\t\t\t\titems.add(new PatternItem(itemType, itemLength));\n\t\t\t\t\t\titemType = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tinQuote = !inQuote;\n\t\t\t} else {\n\t\t\t\tisPrevQuote = false;\n\t\t\t\tif (inQuote) {\n\t\t\t\t\ttext.append(ch);\n\t\t\t\t} else {\n\t\t\t\t\tif ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) {\n\t\t\t\t\t\t// a date/time pattern character\n\t\t\t\t\t\tif (ch == itemType) {\n\t\t\t\t\t\t\titemLength++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (itemType == 0) {\n\t\t\t\t\t\t\t\tif (text.length() > 0) {\n\t\t\t\t\t\t\t\t\titems.add(text.toString());\n\t\t\t\t\t\t\t\t\ttext.setLength(0);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\titems.add(new PatternItem(itemType, itemLength));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\titemType = ch;\n\t\t\t\t\t\t\titemLength = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// a string literal\n\t\t\t\t\t\tif (itemType != 0) {\n\t\t\t\t\t\t\titems.add(new PatternItem(itemType, itemLength));\n\t\t\t\t\t\t\titemType = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttext.append(ch);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// handle last item\n\t\tif (itemType == 0) {\n\t\t\tif (text.length() > 0) {\n\t\t\t\titems.add(text.toString());\n\t\t\t\ttext.setLength(0);\n\t\t\t}\n\t\t} else {\n\t\t\titems.add(new PatternItem(itemType, itemLength));\n\t\t}\n\n\t\tpatternItems = items.toArray(new Object[items.size()]);\n\n\t\tPARSED_PATTERN_CACHE.put(pattern, patternItems);\n\n\t\treturn patternItems;\n\t}",
"@Override\n public Set<K> keySet() {\n Set<K> keySet = new HashSet<K>(size());\n for (LinkedList<Entry<K,V>> list : table) {\n for (Entry<K,V> entry : list) {\n if (entry != null) {\n keySet.add(entry.getKey());\n }\n }\n }\n return keySet;\n }",
"public HashMap<String, Integer> process(IProject project, String pattern) {\n\t\tHashMap<String, Integer> numOfOccuranceInEachFile = new HashMap<String, Integer>();\n\n\t\tSystem.out.println(\"begining a iteration for pattern \" + pattern);\n\t\tString elementName = null;\n\t\tSearchMatch[] newMatches = null;\n\t\tSearchMatch[] matches = PHPSearchEngine.findMethodCall(pattern,\n\t\t\t\tPHPSearchEngine.createProjectScope(project));\n\t\t// must distinguish between method declaration and method call!!!!\n\t\tIModelElement iModelElement;\n\t\tObject obj = null;\n\t\tSystem.out.println(\"maches size = \" + matches.length);\n\t\tif (matches.length > 0) {\n\t\t\tfor (SearchMatch match : matches) {\n\t\t\t\tobj = match.getElement();\n\t\t\t\tif (obj instanceof IModelElement) {\n\t\t\t\t\tiModelElement = (IModelElement) obj;\n\t\t\t\t\tString filePath = iModelElement.getPath().toString();\n\t\t\t\t\telementName = iModelElement.getElementName();\n\t\t\t\t\t/*\n\t\t\t\t\t * System.out.println(\"iModelElement.getElementName() = \" +\n\t\t\t\t\t * elementName + \" --path= \" + filePath);\n\t\t\t\t\t */\n\t\t\t\t\tif (Utils.isInTransactionLevel(iModelElement)) {// right\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// now, we\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// consider\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// only the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// transactional\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// level\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// occurance\n\t\t\t\t\t\tif (numOfOccuranceInEachFile.containsKey(filePath)) {\n\t\t\t\t\t\t\tnumOfOccuranceInEachFile.put(filePath,\n\t\t\t\t\t\t\t\t\tnumOfOccuranceInEachFile.get(filePath) + 1);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnumOfOccuranceInEachFile.put(filePath, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t/*\n\t\t\t\t\t * if(iModelElement.getElementType() ==\n\t\t\t\t\t * IModelElement.METHOD){ IMethod iMethod =\n\t\t\t\t\t * (IMethod)iModelElement; iMethod. }\n\t\t\t\t\t */\n\t\t\t\t\t/*\n\t\t\t\t\t * if (!elementName.equals(pattern)) { // avoid recursive,\n\t\t\t\t\t * or // iterative method, // temp implementation, // should\n\t\t\t\t\t * be // modified!!!! pattern = elementName;\n\t\t\t\t\t * System.out.println(\"begining next iteration\");\n\t\t\t\t\t * process(project, pattern);\n\t\t\t\t\t * System.out.println(\"return from an iteration\"); } else\n\t\t\t\t\t * {// it is recursive/iterative, we regard it as the // top\n\t\t\t\t\t * level method call (temp implementation!!!!!)\n\t\t\t\t\t * System.out.println(\"Top Level(recursive reason): \" +\n\t\t\t\t\t * \"iModelElement.getElementName() = \" + elementName +\n\t\t\t\t\t * \" --path= \" + iModelElement.getPath().toString()); }\n\t\t\t\t\t */// comment out Feb. 9, 2014 temporarily\n\t\t\t\t}\n\n\t\t\t}\n\t\t} else { // if there is no callers, then means it is the top level\n\n\t\t\t/*\n\t\t\t * System.out.println(\"Top Level(real reason): \" + \"pattern = \" +\n\t\t\t * pattern);\n\t\t\t */\n\n\t\t}\n\t\tSystem.out.println(\"end of an iteration\");\n\t\treturn numOfOccuranceInEachFile;\n\n\t}",
"public static int[] prefixTable(String str) {\n\n if (str == null) {\n throw new IllegalArgumentException(\"NULL 'str' parameter passed\");\n }\n\n if (str.length() == 0) {\n return new int[]{};\n }\n\n final int strLength = str.length();\n int[] prefixTable = new int[strLength];\n prefixTable[0] = 0;\n\n for (int i = 1; i < str.length(); i++) {\n\n int patternIndex = i;\n int baseIndex = 0;\n\n while (patternIndex < strLength\n && str.charAt(baseIndex) == str.charAt(patternIndex)) {\n ++patternIndex;\n ++baseIndex;\n }\n\n prefixTable[i] = baseIndex;\n }\n\n return prefixTable;\n }",
"private void getMapping() {\n double [][] chars = new double[CHAR_SET_SIZE][1];\n for (int i = 0; i < chars.length; i++) {\n chars[i][0] = i;\n }\n Matrix b = new Matrix(key).times(new Matrix(chars));\n map = b.getArray();\n }",
"public Iterable<HashNode> iterator() {\n\t\treturn bucket;\n\t\t//for(HashTable<Character, Integer>.HashNode x : HT.iterator()) {\n\t}",
"public Set<String> regexFindKeys(String regex);",
"public abstract String getRegexTableMarker();",
"private HashMap<Integer, ArrayList<Integer>> getHashFromTransMatrix(\r\n\t\t\tArrayList<ArrayList<Integer>> tMat){\r\n\t\tHashMap<Integer, ArrayList<Integer>> codeToColHash = \r\n\t\t\tnew HashMap<Integer, ArrayList<Integer>>();\r\n\t\tArrayList<Integer> binaryCodeList = generateBinaryCodeList(tMat);\r\n\t\tfor (int i = 0; i < binaryCodeList.size(); i++){\r\n\t\t\tif (codeToColHash.containsKey(binaryCodeList.get(i))){\r\n\t\t\t\tArrayList<Integer> currCols = codeToColHash.get(binaryCodeList.get(i));\r\n\t\t\t\tcurrCols.add(i);\r\n\t\t\t\tcodeToColHash.put(binaryCodeList.get(i), currCols);\r\n\t\t\t} else {\r\n\t\t\t\tArrayList<Integer> newColsList = new ArrayList<Integer>();\r\n\t\t\t\tnewColsList.add(i);\r\n\t\t\t\tcodeToColHash.put(binaryCodeList.get(i), newColsList);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn codeToColHash;\r\n\t}",
"List<Integer> buildPi(String pattern) {\n List<Integer> pi = new ArrayList<>(Collections.nCopies(pattern.length(), 0));\n for (int i = 1; i < pattern.length(); i++) {\n for (int j = 0; j < pattern.length() && i < pattern.length(); j++) {\n if (pattern.charAt(i) == pattern.charAt(j)) {\n pi.set(i, j);\n i++;\n } else {\n break;\n }\n }\n }\n return pi;\n }",
"@Override\n public List<K> keys() {\n List<K> keys = new AList<>();\n for(int i =0; i < capacity; i++){\n Entry n = (Entry) table[i];\n if(n != null && !n.isRemoved())\n keys.add(n.getKey());\n }\n assert keys.size() == size;\n return keys;\n }",
"private HashMap<String, ArrayList<String>> getAllTableContentsWhere(String table, String where,\r\n String whereValue) {\r\n HashMap<String, ArrayList<String>> contents = new HashMap<String, ArrayList<String>>();\r\n // Get the records associated with the table and conditions\r\n Cursor allRecords = sqlExecutor.selectRecords(table, where, whereValue);\r\n if (allRecords == null) {\r\n return new HashMap<>();\r\n }\r\n // For each column, add a key to contents with the column name\r\n for (int i = 0; i < allRecords.getColumnCount(); i++) {\r\n contents.put(allRecords.getColumnName(i), new ArrayList<String>());\r\n }\r\n // add all row values to the ArrayList mapped to each column\r\n for (int i = 0; i < allRecords.getCount(); i++) {\r\n for (int e = 0; e < allRecords.getColumnCount(); e++) {\r\n contents.get(allRecords.getColumnName(e)).add(allRecords.getString(e));\r\n }\r\n // Move to next row\r\n allRecords.moveToNext();\r\n }\r\n return contents;\r\n }",
"private Map<S, List<Node<S>>> getAllOccurrences() {\n List<P> productions = slp.getOrderedProductions();\n Map<S, List<Node<S>>> predecessorMap = new HashMap<>();\n slp.getProductions().stream().map(p -> p.getLeft()).forEach(symbol -> predecessorMap.put(symbol, new ArrayList<>()));\n\n // gather all occurrence\n productions.stream()\n .map(rule -> rule.getRight())\n .flatMap(word -> word.nodeStream())\n .filter(node -> !node.getElement().isTerminal())\n .forEach(node -> predecessorMap.get(node.getElement()).add(node));\n\n return predecessorMap;\n }",
"public char[][] regenCharTable();",
"private static int[] computeTemporaryArray(String pattern)\r\n\t{\r\n\t\t// Temp array is of the same size of the pattern.\r\n\t\t// Every point tells us what is the longest suffix length which is also the prefix in this temp array.\r\n\t\tint [] lps = new int[pattern.length()];\r\n\t\t\r\n\t\t// First point is always 0\r\n\t\tint j =0;\r\n\r\n\t\t// Note that there is no i++ here in this for()\r\n\t\tfor(int i=1; i < pattern.length();)\r\n\t\t{\r\n\t\t\t// Match is found\r\n\t\t\tif(pattern.charAt(i) == pattern.charAt(j))\r\n\t\t\t{\r\n\t\t\t\tlps[i] = j + 1;\r\n\t\t\t\tj++;\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\r\n\t\t\t// Match is not found\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// If j is not at zero, move back and do not increase i\r\n\t\t\t\tif(j != 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tj = lps[j-1];\r\n\t\t\t\t}\r\n\t\t\t\t// If j is at zero, there is no other option but to proceed further and mark that cell as zero\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tlps[i] =0;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn lps;\r\n\t}",
"public final synchronized Set<String> m111z() {\n return this.f112Y.keySet();\n }"
] | [
"0.6068619",
"0.6048493",
"0.5913475",
"0.5888525",
"0.5813764",
"0.58076847",
"0.5799221",
"0.56931216",
"0.5659939",
"0.5645634",
"0.55130005",
"0.5504227",
"0.5500853",
"0.54843545",
"0.54813087",
"0.5466314",
"0.5462176",
"0.54165167",
"0.53841025",
"0.5362029",
"0.5361409",
"0.53491044",
"0.53424925",
"0.53382397",
"0.53367645",
"0.52863485",
"0.5280328",
"0.52729994",
"0.5228617",
"0.52263594",
"0.5224285",
"0.5218465",
"0.5177434",
"0.5142682",
"0.514214",
"0.5125092",
"0.51120526",
"0.5110035",
"0.5097994",
"0.50956494",
"0.5083076",
"0.5074951",
"0.5065079",
"0.5060588",
"0.5058903",
"0.50578666",
"0.5054985",
"0.5044607",
"0.5042512",
"0.50407296",
"0.5040669",
"0.5027625",
"0.5015404",
"0.50121695",
"0.49939677",
"0.49782827",
"0.49753308",
"0.49672815",
"0.4955046",
"0.4953687",
"0.49501643",
"0.49486873",
"0.49364227",
"0.49319133",
"0.49262133",
"0.49234298",
"0.49078462",
"0.4897869",
"0.48951966",
"0.4889084",
"0.48868248",
"0.48862946",
"0.48861498",
"0.48777637",
"0.48709592",
"0.48692262",
"0.48666972",
"0.4859833",
"0.48370358",
"0.4835358",
"0.4833445",
"0.48330116",
"0.48305315",
"0.4830272",
"0.48292416",
"0.4827962",
"0.48127198",
"0.48120207",
"0.48098817",
"0.4808377",
"0.48058942",
"0.48053473",
"0.4799717",
"0.47996664",
"0.4797245",
"0.47965145",
"0.47951323",
"0.4791535",
"0.4790016",
"0.4788882"
] | 0.71880645 | 0 |
return a Hashtable of the entries that match the wildcard () | public Hashtable<K, V> getWildcard(String wildcard); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Set<String> getKeysMatchingPattern(String pattern);",
"public Hashtable<K, V> getPattern(String pattern);",
"public interface IPatternMap<K, V> {\r\n\r\n\t/**\r\n\t * return a Hashtable of the entries that matche the pattern\r\n\t * @param pattern\r\n\t * @return\r\n\t */\r\n\tpublic Hashtable<K, V> getPattern(String pattern);\r\n\t\r\n\r\n\t/**\r\n\t * return a Hashtable of the entries that match the wildcard (*)\r\n\t * @param pattern\r\n\t * @return\r\n\t */\r\n\tpublic Hashtable<K, V> getWildcard(String wildcard);\r\n\r\n\r\n\r\n}",
"public Iterable<String> keysThatMatch(String pat) {\n LinkedList<String> q = new LinkedList<String>();\n collect(root, pat, \"\", q);\n return q;\n }",
"public Iterable<String> keysThatMatch(String pattern)\r\n {\r\n Queue<String> q = new Queue<String>();\r\n if ((pattern.equals(\"\") || pattern.equals(\".\")) && null_str_val != null)\r\n q.enqueue(\"\");\r\n collect(root, \"\", pattern, q);\r\n return q;\r\n }",
"@Override\n public Map<K, V> getMatching( final String pattern )\n {\n final Map<K, V> unwrappedResults;\n\n final Map<K, ICacheElement<K, V>> wrappedResults = this.getCacheControl().getMatching( pattern );\n\n if ( wrappedResults == null )\n {\n unwrappedResults = new HashMap<>();\n }\n else\n {\n unwrappedResults = wrappedResults.entrySet()\n .stream()\n .filter(entry -> entry.getValue() != null)\n .collect(Collectors.toMap(\n Entry::getKey,\n entry -> entry.getValue().getVal()));\n }\n\n return unwrappedResults;\n }",
"@Override\r\n public Map<K, ICacheElement<K, V>> processGetMatching(final String pattern)\r\n {\r\n final Map<K, ICacheElement<K, V>> elements = new HashMap<>();\r\n Set<K> keyArray = null;\r\n storageLock.readLock().lock();\r\n try\r\n {\r\n keyArray = new HashSet<>(keyHash.keySet());\r\n }\r\n finally\r\n {\r\n storageLock.readLock().unlock();\r\n }\r\n\r\n final Set<K> matchingKeys = getKeyMatcher().getMatchingKeysFromArray(pattern, keyArray);\r\n\r\n for (final K key : matchingKeys)\r\n {\r\n final ICacheElement<K, V> element = processGet(key);\r\n if (element != null)\r\n {\r\n elements.put(key, element);\r\n }\r\n }\r\n return elements;\r\n }",
"@Override\n public Map<K, ICacheElement<K, V>> getMatchingCacheElements( final String pattern )\n {\n return this.getCacheControl().getMatching( pattern );\n }",
"@Override\n\tpublic Map<File, List<String>> grep(File directory, String fileSelectionPattern, String substringSelectionPattern,\n\t\t\tboolean recursive) {\n\t\tFile[] fileList=directory(directory,recursive,fileSelectionPattern);\n\t\t//Map<File, List<String>> grepped=new HashMap<File, List<String>>();\n\t\treturn PatternMatcher(fileList,Pattern.compile(substringSelectionPattern));\n\t}",
"public ArrayList<Table> find(DataEntry entry) {\n\t\tArrayList<Table> foundTables = new ArrayList<>();\n\t\tfor (Table table : tables.values()) {\n\t\t\tif (table.contains(entry)) {\n\t\t\t\tfoundTables.add(table);\n\t\t\t}\n\t\t}\n\t\treturn foundTables;\n\t}",
"public HashMap<K,V> listAll();",
"public Collection<String> query(String queryStr) {\n\t\t// TODO: Implement this method (FOR A BONUS)\n\t\tArrayList<String> result = new ArrayList<String>();\n\t\t\n\t\tfor(Map.Entry<String,Integer> entry : this.dict.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t \n\t\t\t String temp = wild(key,queryStr); \n\t\t\t if(temp != null && !(\"\".equalsIgnoreCase(temp))){\n\t\t\t\t result.add(temp);\n\t\t\t }\n\t\t\t // System.out.println(key + \" => \" + value);\n\t\t\t}\n\t\t\t//wild(this.dict.get,queryStr);\n\t\tif(result.isEmpty()){\n\t\t\treturn null;\n\t\t}\n\t\tSystem.out.println(result);\n\t\treturn result;\n\t}",
"private HashMap<String, ArrayList<String>> getAllTableContents(String table) {\r\n return getAllTableContentsWhere(table, null, null);\r\n }",
"List<String> getFileSystemEntries(String path, String searchPattern) throws IOException;",
"public static List<Handset> search(Map<String, String> reqParam) {\n\n\t\tList<Handset> temp = new ArrayList<Handset>();\n\t\ttemp.addAll(cache.values());\n\n\t\tfor (String param : reqParam.keySet()) {\n\t\t\tString val = (String) reqParam.get(param);\n\n\t\t\tswitch (param) {\n\t\t\tcase \"priceEur\": {\n\t\t\t\ttemp = temp.stream().filter(handset -> handset.getRelease().getPriceEur() == Integer.parseInt(val))\n\t\t\t\t\t\t.collect(Collectors.toList());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"sim\": {\n\t\t\t\ttemp = temp.stream().filter(handset -> handset.getSim().toLowerCase().contains(val.toLowerCase()))\n\t\t\t\t\t\t.collect(Collectors.toList());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"announceDate\": {\n\t\t\t\ttemp = temp.stream().filter(handset -> handset.getRelease().getAnnounceDate().equalsIgnoreCase(val))\n\t\t\t\t\t\t.collect(Collectors.toList());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\ttemp = new ArrayList<Handset>();\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"filtered handset size \" + temp.size());\n\t\treturn temp;\n\n\t}",
"public List<Entry> getByTitle(String title) {\n List<Entry> matches = new ArrayList<>();\n for (Entry l : litRegister) {\n\n if (l.getTitle().contains(title)) {\n matches.add(l);\n }\n }\n return matches;\n }",
"public Hashtable getFilters() {\n // we need to build the hashtable dynamically\n return globalFilterSet.getFilterHash();\n }",
"public Map getMailcapList(String mime_type) {\n/* 126 */ Map search_result = null;\n/* 127 */ Map wildcard_result = null;\n/* */ \n/* */ \n/* 130 */ search_result = (Map)this.type_hash.get(mime_type);\n/* */ \n/* */ \n/* 133 */ int separator = mime_type.indexOf('/');\n/* 134 */ String subtype = mime_type.substring(separator + 1);\n/* 135 */ if (!subtype.equals(\"*\")) {\n/* 136 */ String type = mime_type.substring(0, separator + 1) + \"*\";\n/* 137 */ wildcard_result = (Map)this.type_hash.get(type);\n/* */ \n/* 139 */ if (wildcard_result != null)\n/* 140 */ if (search_result != null) {\n/* 141 */ search_result = mergeResults(search_result, wildcard_result);\n/* */ } else {\n/* */ \n/* 144 */ search_result = wildcard_result;\n/* */ } \n/* */ } \n/* 147 */ return search_result;\n/* */ }",
"Map<String, String> getFilters();",
"public Set<String> regexFindKeys(String regex);",
"public String searchByMaterial(String string, ArrayList<String> materiallist, int count, Set<String> keys, Collection<String> values, Map<String, String> dataTable1) {\nfor(String s:materiallist) {\r\n\t\t\t\r\n\t\t\tif (string.equals(s)) {\r\n\t\t\t//\tSystem.out.print(s);\r\n\t\t\t\tcount--;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t\t}\r\nSystem.out.println(\"A List of Home that matches the Material \"+string+\":\");\r\n\r\nfor(String k: keys) {\r\n\t\r\n\tarraytoprintkey=k.split(\"_\");\r\n\r\n\r\n\t\r\n\t\tif(arraytoprintkey[1].equals(string)) {\r\n\t\t\t\r\n\t\t\t\tSystem.out.print(k);\r\n\t\t\t\tSystem.out.println(\" \"+dataTable1.get(k));\r\n\t\t\t\t\r\n\t\t}\r\n\r\n\t\t\r\n}\r\nSystem.out.println();\r\n\t\tif(count==0) {\r\n\t\t\treturn string;\r\n\t\t}\r\n\t\t\t\r\n\t\treturn null;\r\n\t}",
"public abstract HashMap search(String keyword);",
"public List<String> getKeysByPattern(String patternKey){\n RKeys keys = redissonClient.getKeys();\n Iterable<String> foundedKeys = keys.getKeysByPattern(patternKey);\n List<String> list = new ArrayList<>();\n foundedKeys.forEach(key -> list.add(key));\n return list;\n }",
"public Set<String> getVariablesWithin(String exp) {\r\n Set<String> all=new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);\r\n String add=null;\r\n\r\n for(StringTokenizer tkz=new StringTokenizer(exp,SYMBOLS,true); tkz.hasMoreTokens(); ) {\r\n String tkn=tkz.nextToken().trim();\r\n\r\n if (tkn.length()!=0 && Character.isLetter(tkn.charAt(0))) { add=tkn; }\r\n else if(tkn.length()==1 && tkn.charAt(0)=='(' ) { add=null; }\r\n else if(add!=null && !constants.containsKey(add) ) { all.add(add); }\r\n }\r\n if(add!=null && !constants.containsKey(add)) { all.add(add); }\r\n return all;\r\n }",
"default Collection<ItemStack> getContentsMatching(Predicate<ItemStack> predicate) {\n\t\treturn this.getContents().values().stream().filter(predicate).collect(Collectors.toList());\n\t}",
"private HashMap<String, ArrayList<String>> getAllTableContentsWhere(String table, String where,\r\n String whereValue) {\r\n HashMap<String, ArrayList<String>> contents = new HashMap<String, ArrayList<String>>();\r\n // Get the records associated with the table and conditions\r\n Cursor allRecords = sqlExecutor.selectRecords(table, where, whereValue);\r\n if (allRecords == null) {\r\n return new HashMap<>();\r\n }\r\n // For each column, add a key to contents with the column name\r\n for (int i = 0; i < allRecords.getColumnCount(); i++) {\r\n contents.put(allRecords.getColumnName(i), new ArrayList<String>());\r\n }\r\n // add all row values to the ArrayList mapped to each column\r\n for (int i = 0; i < allRecords.getCount(); i++) {\r\n for (int e = 0; e < allRecords.getColumnCount(); e++) {\r\n contents.get(allRecords.getColumnName(e)).add(allRecords.getString(e));\r\n }\r\n // Move to next row\r\n allRecords.moveToNext();\r\n }\r\n return contents;\r\n }",
"private static Collection<Map.Entry<String, String>> getEntriesContainingKey(Collection<Map.Entry<String, String>> entries, String key) {\n\t\tfinal Iterator<Map.Entry<String, String>> iter = entries.iterator();\n\t\tfinal Collection<Map.Entry<String, String>> matchingEntries = new ArrayList<>();\n\t\twhile (iter.hasNext()) {\n\t\t\tfinal Map.Entry<String, String> entry = iter.next();\n\t\t\tif (entry.getKey().equals(key)) {\n\t\t\t\tmatchingEntries.add(entry);\n\t\t\t}\n\t\t}\n\t\treturn matchingEntries;\n\t}",
"public Map getMailcapFallbackList(String mime_type) {\n/* 159 */ Map search_result = null;\n/* 160 */ Map wildcard_result = null;\n/* */ \n/* */ \n/* 163 */ search_result = (Map)this.fallback_hash.get(mime_type);\n/* */ \n/* */ \n/* 166 */ int separator = mime_type.indexOf('/');\n/* 167 */ String subtype = mime_type.substring(separator + 1);\n/* 168 */ if (!subtype.equals(\"*\")) {\n/* 169 */ String type = mime_type.substring(0, separator + 1) + \"*\";\n/* 170 */ wildcard_result = (Map)this.fallback_hash.get(type);\n/* */ \n/* 172 */ if (wildcard_result != null)\n/* 173 */ if (search_result != null) {\n/* 174 */ search_result = mergeResults(search_result, wildcard_result);\n/* */ } else {\n/* */ \n/* 177 */ search_result = wildcard_result;\n/* */ } \n/* */ } \n/* 180 */ return search_result;\n/* */ }",
"List<Dish> getDishesWhichContains(String subStr);",
"HSet entrySet();",
"public Set<Map.Entry<String, List<String>>> entrySet()\r\n/* 431: */ {\r\n/* 432:592 */ return this.headers.entrySet();\r\n/* 433: */ }",
"public abstract List<String> getAllKeys();",
"public Iterable<Entry<K, V>> entrySet() {\n ArrayList<Entry<K, V>> buffer = new ArrayList<>();\n for (int h = 0; h < capacity; h++)\n if (!isAvailable(h)) buffer.add(table[h]);\n return buffer;\n }",
"public static Iterator getKeysMatching(String inKeyPrefix) {\r\n HashSet matchingKeys = new HashSet();\r\n for (Iterator i = getProperties().keySet().iterator(); i.hasNext(); ) {\r\n String key = (String) i.next();\r\n if (key.startsWith(inKeyPrefix)) {\r\n matchingKeys.add(key);\r\n }\r\n }\r\n return matchingKeys.iterator();\r\n }",
"public Set<Map.Entry<Integer, String>> entrySet() {\n return Collections.unmodifiableSet(getMacrosses().entrySet());\n }",
"public Set<String> getEntry(String key){\n if(mTable == null )\n return new TreeSet<String>();\n if(mTable.containsKey(key)){\n return mTable.get(key);\n }\n return new TreeSet<String>();\n }",
"private ArrayList<String> findChampions() {\n\t\tString searchContents = search.getText();\n\t\tArrayList<String> result = new ArrayList<String>();\n\t\tfor (String c : CHAMPIONLIST) {\n\t\t\tif (c.toLowerCase().contains(searchContents.toLowerCase())) {\n\t\t\t\tresult.add(c);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}",
"Set<Entry<K, V>> getRegisteredValues();",
"public Collection<TapKey> findAllKeys();",
"public ArrayList<WordCode<K, V>> entrySet() {\n\t\tArrayList<WordCode<K, V>> entrySet = new ArrayList<>();\n\t\t\n\t\tfor (LinkedList<WordCode<K, V>> ll : myBuckets) {\n\t\t\tfor (WordCode<K, V> wc : ll) {\n\t\t\t\tentrySet.add(wc);\n\t\t\t}\n\t\t}\n\t\treturn entrySet;\n\t}",
"public synchronized Hashtable getFileList(String wc) throws IOException {\r\n Hashtable ht = new Hashtable();\r\n String pattern = translatePattern(wc);\r\n\tout.rlsWrite(\"lrc_get_pfn_wc\"); // RPC call name\r\n\tout.rlsWrite(pattern); // LFN being looked for\r\n\tout.rlsWrite(\"0\"); // offset\r\n\tout.rlsWrite(\"0\"); // max results\r\n \r\n\tint res = (int)in.rlsReadLong();\r\n if (res == 12) {\r\n // If we get \"LFN does not exist\", return empty hashtable rather than\r\n // throwing an exception\r\n in.rlsRead();\r\n return ht;\r\n }\r\n\r\n\tif (res != 0) {\r\n in.rlsRead();\r\n\t throw new IOException(\"Error getting file locations for \" + wc +\r\n\t\t\t\t \" from RLS: \" + errorCodeToString(res));\r\n\t}\r\n\r\n String lfn = in.rlsRead();\r\n if (lfn.length() == 0) {\r\n // empty result set\r\n return ht;\r\n }\r\n String pfn = in.rlsRead();\r\n\r\n String oldlfn = lfn;\r\n \r\n Vector v = new Vector();\r\n\r\n v.add(pfn);\r\n\r\n // loop over lfn/pfn pairs returned\r\n while (pfn.length() > 0) {\r\n\r\n if (!oldlfn.equals(lfn)) {\r\n ht.put(oldlfn, v);\r\n v = new Vector();\r\n }\r\n v.add(pfn);\r\n\r\n oldlfn = lfn;\r\n lfn = in.rlsRead();\r\n if (lfn.length() == 0) {\r\n ht.put(oldlfn, v);\r\n return ht;\r\n }\r\n pfn = in.rlsRead();\r\n }\r\n\r\n ht.put(oldlfn, v);\r\n\r\n return ht;\r\n }",
"public List<Entry> getByPublisher(String publisher) {\n List<Entry> matches = new ArrayList<>();\n for (Entry l : litRegister) {\n if (l.getPublisher().contains(publisher)) {\n matches.add(l);\n }\n }\n return matches;\n }",
"public interface Analyzer {\n\n Map<String, List<Integer>> search(StringBuffer text, String... pattern);\n}",
"public String[] search(String tableName, String[] keyValue) {\r\n List<String> retVal = new ArrayList<String>();\r\n Connection con = null;\r\n Statement stmt = null;\r\n try {\r\n con = ConnectionManager.getInstance().getConnection(databaseName);\r\n stmt = con.createStatement();\r\n TableObject table = _create(tableName);\r\n if (table != null) {\r\n StringBuffer whereClause = new StringBuffer();\r\n for (int i = 0; i < keyValue.length; i++) {\r\n String[] kV = keyValue[i].split(\"=\");\r\n if (whereClause.length() < 1) {\r\n whereClause.append(\" AND \");\r\n }\r\n int multi = kV[1].indexOf(\",\");\r\n boolean isChar = false;\r\n TableField field = table.fields.get(kV[0]);\r\n isChar = field.fieldType.startsWith(\"VARCHAR\");\r\n if(multi < 0){\r\n if(isChar){\r\n whereClause.append( kV[0] + \" LIKE '%\" + kV[1] + \"%' \");\r\n }else{\r\n field.setValue(kV[1]);\r\n whereClause.append(kV[0] + \" = \" + convertValue(field));\r\n }\r\n }else{\r\n whereClause.append(kV[0] + \" in (\" + kV[0] + \") \");\r\n }\r\n }\r\n String searchQry = \"SELECT \" + table.key + \" FROM \" + tableName + \" WHERE \" + whereClause.toString();\r\n ResultSet rs = stmt.executeQuery(searchQry);\r\n while (rs.next()) {\r\n String keyVal = rs.getString(1);\r\n retVal.add(retrieve(tableName, keyVal));\r\n }\r\n }\r\n\r\n } catch (Exception e) {\r\n Logger.getLogger(Converter.class.getName()).log(Level.SEVERE, null, e);\r\n } finally {\r\n if (stmt != null) {\r\n try {\r\n stmt.close();\r\n } catch (Exception e) {\r\n Logger.getLogger(Converter.class.getName()).log(Level.SEVERE, null, e);\r\n }\r\n }\r\n if (con != null) {\r\n try {\r\n //con.close();\r\n } catch (Exception e) {\r\n Logger.getLogger(Converter.class.getName()).log(Level.SEVERE, null, e);\r\n }\r\n }\r\n }\r\n return (String[])retVal.toArray();\r\n }",
"public Wildcard getWildcard() {\n return _wildcard;\n }",
"public TypeFilterHonSearch(String key) {\r\n\t\temptyKey = StringUtils.isEmpty(key);\r\n\t\tif (emptyKey == false) {\r\n\t\t\tkey = key.trim().toLowerCase();\r\n\t\t\tif (key.length() > 0) {\r\n\t\t\t\tif (key.charAt(key.length() - 1) != '*') {\r\n\t\t\t\t\tkey += '*';\r\n\t\t\t\t}\r\n\t\t\t\tpattern = Pattern.compile(StringUtils.replace(key, \"*\", \".*\"));\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public static List<Result> getDataByRegex(String tableName, String regexKey) {\n RegexStringComparator rc = new RegexStringComparator(regexKey);\n RowFilter rowFilter = new RowFilter(CompareFilter.CompareOp.EQUAL, rc);\n\n Scan scan = new Scan();\n scan.setFilter(rowFilter);\n return getResultsFromScan(tableName, scan);\n }",
"boolean allHits();",
"@Override\n\tpublic Set<Entry<K, V>> entrySet() {\n\t\tSet<Entry<K, V>> entrySet = map.entrySet();\n\t\tListSet<Entry<K, V>> listSet = new ListSet<Map.Entry<K,V>>();\n\t\tfor (K key : keys) {\n\t\t\t\n\t\t\tfor (Entry<K, V> entry : entrySet) {\n\t\t\t\tif (entry.getKey().equals(key)) {\n\t\t\t\t\tlistSet.add(entry);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn listSet;\n\t}",
"public static void main(String[] args) {\n\n\t\tHashMap<String,String> hm = new HashMap<String, String>();\n\t\t\n\t\thm.put(\"e\",\"a1\");\n\t\thm.put(\"b\",\"a1\");\n\t\thm.put(\"a\",\"a2\");\n\t\t \n\t\thm.put(\"a\",\"a5\");\n\t\t\n\t\tSet s = hm.entrySet();\n\t\tIterator it = s.iterator();\n\t\t\n\t\tfor(Map.Entry me : hm.entrySet())\n\t\t\tSystem.out.println(me.getKey()+\" \"+me.getValue());\n\t\t\n\t\t\n\t\twhile(it.hasNext())\n\t\t{\n\t\t\tMap.Entry mentry = (Map.Entry) it.next();\n\t\t\tSystem.out.println(mentry.getKey() +\" \"+mentry.getValue());\n\t\t\t\n\t\t}\n\t\t\n\tMap<String,String> thmp = \tnew TreeMap<String,String> (hm);\n\tSystem.out.println();\n\tfor(Map.Entry g : thmp.entrySet())\n\t\tSystem.out.println(g.getKey()+\" \"+g.getValue());\n\t\n\t\n\tSystem.out.println(hm.containsKey(\"a\")+\" \"+hm.containsValue(\"a5\"));\n\t\n\t\t\n\t\t\n\t\t\n\t}",
"private RowFilter<Object, Object> getFilter(List<String> selectedCheckBoxes, final String regex) {\n FilterMapKey key = new FilterMapKey(selectedCheckBoxes);\n if (tableFilterMap.containsKey(key)) {\n return tableFilterMap.get(key);\n }\n\n RowFilter<Object, Object> filter = new RowFilter<Object, Object>() {\n @Override\n public boolean include(RowFilter.Entry entry) {\n String severity = (String) entry.getValue(1);\n return severity.matches(regex);\n }\n };\n tableFilterMap.put(key, filter);\n return filter;\n }",
"public static void main(String[] args) \n\t { \n\t\t \n\t//\t ScrabbleCheater11 cheat = new ScrabbleCheater11();\n\t//\t Dictionary11 dict = new Dictionary11(1,\"C:\\\\words\\\\words-279k.txt\");\n\t \n\t\t MyHashTable11 htable = new MyHashTable11(7591,\"src/lab11_scrabble/wordsList_collins2019.txt\"); \n\t \t\n\t \tSystem.out.print(\"All the words in the bucket where the word \"+ \" \\\"against\\\" \" + \" is located: \");\n\t \tSystem.out.println();\n\t \thtable.getWordsFromSameBucket(\"against\");\n\t \tSystem.out.println();\n\t \tSystem.out.println();\n\t \thtable.findPermutation(\"against\");\n\t \n\t \tSystem.out.println();\n\t \tSystem.out.print(\"All the words in the bucket where the word \"+ \" \\\"airport\\\" \" + \" is located: \");\n\t \tSystem.out.println();\n\t \thtable.getWordsFromSameBucket(\"airport\");\n\t \tSystem.out.println();\n\t \tSystem.out.println();\n\t \thtable.findPermutation(\"airport\");\n\t \t\n\t \tSystem.out.println();\n\t \tSystem.out.print(\"All the words in the bucket where the word \"+ \" \\\"between\\\" \" + \" is located: \");\n\t \tSystem.out.println();\n\t \thtable.getWordsFromSameBucket(\"between\");\n\t \tSystem.out.println();\n\t \tSystem.out.println();\n\t \thtable.findPermutation(\"between\");\n\n\t \tSystem.out.println();\n\t\t System.out.print(\"All the words in the bucket where the word \"+ \"\\\"married\\\"\" + \" is located: \");\n\t\t System.out.println();htable.getWordsFromSameBucket(\"married\");\n\t\t System.out.println();\n\t\t System.out.println();\n\t\t htable.findPermutation(\"married\");\n\t\t \n\t\t System.out.println();\n\t \tSystem.out.print(\"All the words in the bucket where the word \"+ \" \\\"ashbdap\\\" \" + \" is located: \");\n\t \tSystem.out.println();\n\t \thtable.getWordsFromSameBucket(\"ashbdap\");\n\t \tSystem.out.println();\n\t \tSystem.out.println();\n\t \thtable.findPermutation(\"ashbdap\");\n\t \t\n\t \t//test remove and size()\n\t \tSystem.out.println(htable.remove(\"speaned\"));\n\t \tSystem.out.println(htable.get(\"speaned\"));\n\t \tSystem.out.println(htable.size());\n\t }",
"public static Set getKeySet(Hashtable table) {\n\t\treturn (table == null) ? Collections.EMPTY_SET : table.keySet();\n\t}",
"public Set<StorageQueue> getMatchingStorageQueues(String routingKey) {\n Set<StorageQueue> matchingQueues = new HashSet<>();\n\n if (StringUtils.isNotEmpty(routingKey)) {\n\n // constituentDelimiter is quoted to avoid making the delimiter a regex symbol\n String[] constituents = routingKey.split(Pattern.quote(constituentsDelimiter),-1);\n\n int noOfCurrentMaxConstituents = constituentTables.size();\n\n // If given routingKey has more constituents than any subscriber has, then create constituent tables\n // for those before collecting matching subscribers\n if (constituents.length > noOfCurrentMaxConstituents) {\n for (int i = noOfCurrentMaxConstituents; i < constituents.length; i++) {\n addEmptyConstituentTable();\n }\n }\n\n // Keeps the results of 'AND' operations between each bit sets\n BitSet andBitSet = new BitSet(storageQueueList.size());\n\n // Since BitSet is initialized with false for each element we need to flip\n andBitSet.flip(0, storageQueueList.size());\n\n // Get corresponding bit set for each constituent in the routingKey and operate bitwise AND operation\n for (int constituentIndex = 0; constituentIndex < constituents.length; constituentIndex++) {\n String constituent = constituents[constituentIndex];\n Map<String, BitSet> constituentTable = constituentTables.get(constituentIndex);\n\n BitSet bitSetForAnd = constituentTable.get(constituent);\n\n if (null == bitSetForAnd) {\n // The constituent is not found in the table, hence matching with 'other' constituent\n bitSetForAnd = constituentTable.get(OTHER_CONSTITUENT);\n }\n\n andBitSet.and(bitSetForAnd);\n }\n\n // If there are more constituent tables, get the null constituent in each of them and operate bitwise AND\n for (int constituentIndex = constituents.length; constituentIndex < constituentTables.size();\n constituentIndex++) {\n Map<String, BitSet> constituentTable = constituentTables.get(constituentIndex);\n andBitSet.and(constituentTable.get(NULL_CONSTITUENT));\n }\n\n\n // Valid queues are filtered, need to pick from queue pool\n int nextSetBitIndex = andBitSet.nextSetBit(0);\n while (nextSetBitIndex > -1) {\n matchingQueues.add(storageQueueList.get(nextSetBitIndex));\n nextSetBitIndex = andBitSet.nextSetBit(nextSetBitIndex + 1);\n }\n\n } else {\n log.warn(\"Cannot retrieve storage queues via bitmap handler since routingKey to match is empty\");\n }\n\n return matchingQueues;\n }",
"public HashSet<String> loadGrepResults(String word) throws Exception {\n\t\tBufferedReader br = new BufferedReader(new FileReader(\"grepTest.txt\"));\n\t\tString line;\n\t\tboolean foundSection = false;\n\t\tHashSet<String> found = new HashSet<String>();\n\n\t\twhile ((line = br.readLine()) != null) {\n\t\t\tif (foundSection & line.contains(\"Word: \"))\n\t\t\t\tbreak;\n\t\t\tif (line.contains(\"Word:\") && line.contains(word)) {\n\t\t\t\tfoundSection = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!foundSection)\n\t\t\t\tcontinue;\n\t\t\tfound.add(line.toLowerCase());\n\t\t}\n\t\t// fails if section wasn't found\n\t\tassertTrue(foundSection);\n\t\treturn found;\n\t}",
"Set<String> getKeys();",
"Set<String> getDictionary();",
"public String[] fetchAllKeys();",
"public List<Dictionary> getDictionaryLikeDictEntry(String dictEntry) throws LIMSRuntimeException {\n\t List<Dictionary> list = new Vector<Dictionary>();\n\t String searchString = \"%\" + dictEntry.toUpperCase().trim() + \"%\";\n\t String sql = \"from Dictionary d where upper(d.dictEntry) like :dictionaryEntry\";\n try{\n Query query = HibernateUtil.getSession().createQuery(sql);\n query.setString(\"dictionaryEntry\", searchString);\n list = query.list();\n closeSession();\n }catch(HibernateException e){\n handleException(e, \"getDictionaryLikeDictEntry\");\n }\n \n\t return list;\n\t}",
"private ArrayList<Trie> matchAll(DotNode dotNode, int wordID) {\n ArrayList<Trie> trieList = new ArrayList<>();\n HashMap<Integer, ? extends Trie> childrenTbl = dotNode.trieNode.getChildren();\n\n if (childrenTbl != null && wordID >= 0) {\n // get all the extensions, map to string, check for *, build regexp\n for (Map.Entry<Integer, ? extends Trie> entry : childrenTbl.entrySet()) {\n Integer arcID = entry.getKey();\n if (arcID == wordID) {\n trieList.add(entry.getValue());\n } else {\n String arcWord = Vocabulary.word(arcID);\n if (Vocabulary.word(wordID).matches(arcWord)) {\n trieList.add(entry.getValue());\n }\n }\n }\n }\n return trieList;\n }",
"public Set<String> getEntriesName(){\n return _entries.keySet(); \n }",
"@Override\n public Set<Restaurant> getMatches(String queryString) {\n\n /* Setup grammar listener */\n CharStream stream = new ANTLRInputStream(queryString);\n QueryLexer lexer = new QueryLexer(stream);\n TokenStream tokens = new CommonTokenStream(lexer);\n QueryParser parser = new QueryParser(tokens);\n ParseTree tree = parser.root();\n ParseTreeWalker walker = new ParseTreeWalker();\n\n // Setup custom walker\n QueryCreator creator = new QueryCreator();\n walker.walk(creator, tree);\n\n Set<Restaurant> matches = new HashSet<Restaurant>();\n RestaurantHandle rH = creator.getHandle();\n Expression expTree = creator.getExpression();\n\n // Look through every restaurant, if one matches query add it to the set\n for (Restaurant r : this.restaurantMap.values()) {\n rH.setRestaurant(r);\n if (expTree.eval()) {\n matches.add(r);\n }\n }\n\n return matches;\n }",
"@Override\n\tpublic List<HashMap<String, Object>> getMetaListByTableName(String tableName,String condition) {\n\t\tList<HashMap<String, Object>> hm = metaDao.getMetaListByTableName(tableName,condition);\n\t\treturn hm;\n\t}",
"@Override\n public Set<Map.Entry<String, T>> entrySet() {\n Set<Map.Entry<String, T>> entrySet = new TreeSet<>();\n for (Map.Entry<String, Map.Entry<String, T>> v : entries.entrySet()) {\n entrySet.add(new Entry<>(v));\n }\n return entrySet;\n }",
"public final Set<Entry<String, C0591m>> mo5562h() {\n return this.f1464a.entrySet();\n }",
"Map<String, String> findAllInMap();",
"public ArrayList<NameRecord> getMatches(String partialName){\n\t\tpartialName=partialName.toLowerCase();\n\t\tArrayList<NameRecord> result = new ArrayList<NameRecord>();\n\t\tfor (int i = 0;i<names.size();i++){\n\t\t\tString s = names.get(i).toLowerCase();\n\t\t\tif (s.contains(partialName)){\n\t\t\t\tresult.add(list.get(i));\n\t\t\t}\n\t\t}\t\n\t\treturn result;\n\t}",
"public abstract Iterator getMatchingMimeHeaders(String names[]);",
"public Term[] allMatches(String prefix) {\r\n if (prefix == null) {\r\n throw new java.lang.NullPointerException();\r\n }\r\n Term temporary = new Term(prefix, 0);\r\n \r\n int x = BinarySearchDeluxe.firstIndexOf(queries, temporary, Term.byPrefixOrder(prefix.length()));\r\n int y = BinarySearchDeluxe.lastIndexOf(queries, temporary, Term.byPrefixOrder(prefix.length()));\r\n \r\n if (x == -1 || y == -1) {\r\n throw new java.lang.NullPointerException();\r\n }\r\n Term[] matches = new Term[y - x + 1];\r\n matches = Arrays.copyOfRange(queries, x, y);\r\n Arrays.sort(matches, Term.byReverseWeightOrder());\r\n return matches;\r\n }",
"Match getMatches();",
"protected Map<String, String> getFilter() {\n\t\tMap<String, String> filterMap = new HashMap<String, String>();\n\t\tfilterMap.clear();\n\t\tString filterGrade = \"\";\n\t\tString elemGrade=\"\";\n\t\t\n\t\tString eleGrade = getSelectedFilter(eleGradePanelUc);\n\t\tif (!eleGrade.isEmpty()) {\n\t\t\tfilterGrade+=eleGrade;\n\t\t}\n\t\tString midGrade = getSelectedFilter(middleGradePanelUc);\n\t\tif (!midGrade.isEmpty()) {\n\t\t\tif(filterGrade.equals(\"\")){\n\t\t\t\tif(elemGrade.isEmpty()){\n\t\t\t\t\tfilterGrade+=midGrade;\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\tfilterGrade+=\",\"+midGrade;\n\t\t\t}\n\t\t}\n\t\tString highGrade = getSelectedFilter(highrGradePanelUc);\n\t\tif (!highGrade.isEmpty()) {\n\t\t\tif(filterGrade.equals(\"\")){\n\t\t\t\tfilterGrade+=highGrade;\n\t\t\t}else{\n\t\t\t\tfilterGrade+=\",\"+highGrade;\n\t\t\t}\n\t\t}\n\t\tif(filterGrade!=null && !filterGrade.equals(\"\")){\n\t\t\tfilterMap.put(IsSearchView.GRADE_FLT, filterGrade);\n\t\t}\n\t\tString selectedSubject = getSelectedFilter(subjectPanelUc, \"~~\");\n\t\tif (!selectedSubject.isEmpty()) {\n\t\t\tfilterMap.put(IsSearchView.SUBJECT_FLT, selectedSubject);\n\t\t}\n\t\treturn filterMap;\n\t}",
"@Override\n\tpublic List<HomeDetails> multimatchquery(String input) {\n\t\treturn null;\n\t}",
"List<String> getLookupValues();",
"Enumeration<URL> findEntries(String path, String pattern, boolean recurse) throws IOException;",
"List<T> findMatches(final String value);",
"StringList keys();",
"abstract protected Map<String, T> lookup(List<String> values);",
"Map<String, Object> getFilterScratchpad();",
"public Weet[] getWeetsContaining(String query) {\n Weet[] a = tree.toArray(query);\n\n if (a.length != 0) {\n return a;\n }\n return null;\n }",
"public Set<String> keysOfMap() {\n Map<String, String> tempMap = createSimpleMap(\"Elevensies\",\"Grapes\");\n\t\tSet<String> keys = hashMap.keySet();\n\t\treturn tempMap.keySet();\n\t}",
"public static Entry[] startsWith(MaxFrequencyHeap h, char letter) {\r\n\t\tEntry[] top5 = new Entry[CAPACITY];\r\n\r\n\t\tint counter = 0;\r\n\r\n\t\t// While our heap is not empty and we\r\n\t\t// havent found the top 5 words of the minimum length n\r\n\t\t// remove the max word from our heap\r\n\t\twhile(h.size()>0 && counter!=5){\r\n\r\n\t\t\tEntry current_entry = h.removeMax();\r\n\r\n\t\t\tString current_word = current_entry.getWord();\r\n\r\n\t\t\t// If the current entry word starts with the letter we are looking for\r\n\t\t\t// add the entry to our top5 array\r\n\t\t\tif(current_word.charAt(0)==letter){\r\n\r\n\t\t\t\ttop5[counter] = current_entry;\r\n\t\t\t\tcounter++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn top5;\r\n\t}",
"public static synchronized Set<Map.Entry<Class<?>, String>> entrySet() {\n\t\treturn ClassRegistry.dictionary.entrySet();\n\t}",
"List<Map<String, Object>> searchIngredient(String name);",
"@Override\n protected FilterResults performFiltering(CharSequence arg0) {\n String[] tmp = API.it().getKeywords(arg0.toString());\n FilterResults results = new FilterResults();\n results.values = tmp;\n results.count = tmp.length;\n return results;\n }",
"List<String> getKeys();",
"public static List<Cancion> selectAllH2(String pattern) {\n\t\tList<Cancion> result = new ArrayList();\n\n\t\ttry {\n\t\t\tmanager = Connection.connectToH2();\n\t\t\tmanager.getTransaction().begin();\n\n\t\t\tString q = \"FROM Cancion\";\n\n\t\t\tif (pattern.length() > 0) {\n\t\t\t\tq += \" WHERE nombre LIKE ?\";\n\t\t\t}\n\n\t\t\tif (pattern.length() > 0) {\n\t\t\t\tresult = manager.createQuery(\"FROM Cancion WHERE nombre LIKE '\" + pattern + \"%'\").getResultList();\n\t\t\t} else {\n\t\t\t\tresult = manager.createQuery(\"FROM Cancion\").getResultList();\n\t\t\t}\n\n\t\t\tmanager.getTransaction().commit();\n\t\t} catch (Exception ex) {\n\t\t\tSystem.out.println(ex);\n\t\t}\n\n\t\treturn result;\n\t}",
"protected final <T> Map<String, T> scan(byte[] prefix, Class<T> classOfT) {\n byte[] stopKey = createStopKey(prefix);\n\n try {\n Map<String, T> map = Maps.newHashMap();\n Scanner scan = table.scan(prefix, stopKey);\n Row next;\n while ((next = scan.next()) != null) {\n byte[] columnValue = next.get(COLUMN);\n T value = GSON.fromJson(new String(columnValue, Charsets.UTF_8), classOfT);\n String key = new String(next.getRow(), prefix.length, next.getRow().length - prefix.length, Charsets.UTF_8);\n map.put(key, value);\n }\n return map;\n } catch (Exception e) {\n throw Throwables.propagate(e);\n }\n }",
"Collection<V> getAllEntries();",
"public ArrayList< LocationHandler >getAllLocationFilter (String filter){\n\t\tArrayList< LocationHandler> locationList = new ArrayList< LocationHandler>();\n\t\tString selectQuery = \"SELECT * FROM \" + table_location + \" WHERE \" + key_name + \" LIKE + \" + \" '%\" + filter + \"%'\" + \" ORDER BY \" + key_date_entry; \n\t\tSQLiteDatabase db = this.getWritableDatabase();\n\t\tCursor cursor = db.rawQuery(selectQuery, null);\n\t\tif (cursor.moveToFirst()) {\n\t\t\tdo {\n\t\t\t\tLocationHandler locationHandlerArray = new LocationHandler();\n\t\t\t\tlocationHandlerArray.setId(cursor.getInt(0)); \n\t\t\t\tlocationHandlerArray.setBase_id(cursor.getInt(1)); \n\t\t\t\tlocationHandlerArray.setDate_entry(cursor.getString(2)); \n\t\t\t\tlocationHandlerArray.setLongitude(cursor.getDouble(3)); \n\t\t\t\tlocationHandlerArray.setLatitude(cursor.getDouble(4)); \n\t\t\t\tlocationHandlerArray.setName(cursor.getString(5)); \n\t\t\t\tlocationHandlerArray.setType(cursor.getString(6));\n\t\t\t\tlocationHandlerArray.setSearchTag(cursor.getString(7));\n\t\t\t\tlocationHandlerArray.setSearchTag(cursor.getString(7));\n\t\t\t\tlocationHandlerArray.setAmountables(cursor.getDouble(8));\n\t\t\t\tlocationHandlerArray.setDescription(cursor.getString(9));\n\t\t\t\tlocationHandlerArray.setBestSeller(cursor.getString(10));\n\t\t\t\tlocationHandlerArray.setWebsite(cursor.getString(11));\n\t\t\t\tlocationList.add(locationHandlerArray);\n\t\t\t} while (cursor.moveToNext());\n\t\t}\n\t\tdb.close();\n\t\treturn locationList;\n\t}",
"default Set<String> getSubkeys() {\n return Collections.emptySet();\n }",
"public Set keySet() {\n\treturn table.keySet();\n }",
"public static Collection<Character> getWhitelist(){\n\t\treturn new HashSet<Character>(kanjiWhitelist);\n\t}",
"public List<ITuple> listByTag(String tag) {\n\t\tsynchronized(cache) {\n\t\t\tList<ITuple> result = new ArrayList<ITuple>();\n\t\t\tIterator<String>itr = cache.keySet().iterator();\n\t\t\tString id;\n\t\t\tITuple t;\n\t\t\twhile (itr.hasNext()) {\n\t\t\t\tid = itr.next();\n\t\t\t\tt = cache.get(id);\n\t\t\t\tif (tag.equals(\"*\"))\n\t\t\t\t\tresult.add(t);\n\t\t\t\telse if (t.getTag().equals(tag))\n\t\t\t\t\tresult.add(t);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}",
"HSet keySet();",
"default Set<StackKey> findAll(Predicate<ItemStack> filter) {\n Set<StackKey> items = new HashSet<>();\n for (IInventoryAdapter inventoryObject : this) {\n for (IInvSlot slot : InventoryIterator.get(inventoryObject)) {\n ItemStack stack = slot.getStack();\n if (!InvTools.isEmpty(stack) && filter.test(stack)) {\n stack = stack.copy();\n InvTools.setSize(stack, 1);\n items.add(StackKey.make(stack));\n }\n }\n }\n return items;\n }",
"public HashMap<String, Shelter> getByRestriction(CharSequence gender, CharSequence age,\n CharSequence name){\n HashMap<String, Shelter> searchedList = shelters;\n if (!(gender == null)) {\n Set entries = searchedList.entrySet();\n for(Iterator<Map.Entry<String, Shelter>> it = entries.iterator();\n it.hasNext(); ) {\n Map.Entry<String, Shelter> entry = it.next();\n Shelter shelter = entry.getValue();\n String genderVal = shelter.getGender();\n if (!genderVal.contains(gender) && (genderVal.contains(\"Men\")\n || genderVal.contains(\"Women\"))){\n it.remove();\n }\n }\n }\n if (!(age == null)) {\n Set entries = searchedList.entrySet();\n for(Iterator<Map.Entry<String, Shelter>> it = entries.iterator();\n it.hasNext(); ) {\n Map.Entry<String, Shelter> entry = it.next();\n Shelter shelter = entry.getValue();\n String genderVal = shelter.getGender();\n if (!genderVal.contains(age) && (genderVal.contains(\"Children\")\n || genderVal.contains(\"Families w/ newborns\")\n || genderVal.contains(\"Young adults\"))){\n it.remove();\n }\n }\n }\n if (!(name == null)) {\n Set entries = searchedList.entrySet();\n for(Iterator<Map.Entry<String, Shelter>> it = entries.iterator();\n it.hasNext(); ) {\n Map.Entry<String, Shelter> entry = it.next();\n Shelter shelter = entry.getValue();\n String nameVal = shelter.getName();\n if (!nameVal.contains(name)){\n it.remove();\n }\n }\n }\n return searchedList;\n }",
"@Override \n public Set<String> keySet() {\n // definido um set onde colocar o resultado\n Set<String> r = new HashSet<>();\n try {\n // abre uma conecção\n conn = Connect.connect();\n // abrir um statment com a querie que temos de executar\n PreparedStatement stm = conn.prepareStatement(\"SELECT username FROM Administrador WHERE visivel=TRUE;\");\n // o resultado colocado em rs\n ResultSet rs = stm.executeQuery();\n while (rs.next()) // enquanto existir o next\n r.add(rs.getString(\"username\")); // adiciona o aluno\n } catch (SQLException | ClassNotFoundException e) {\n e.printStackTrace();\n } finally {\n Connect.close(conn);\n }\n return r;\n }",
"public interface Matcher {\n\n char WILDCARD = '*';\n\n void addFilter(String filter);\n\n boolean matches(String word);\n}",
"public static final Iterator<String> filenames() {\n return tableTracker.keySet().iterator();\r\n }",
"public static ArrayList<String> searchDictCommands(String query) {\n ArrayList<String> curSearch = new ArrayList<>();\n\n // Iterating through arguments of the same command\n for (int i = 0; i < commandDict.size(); i++) {\n // Checking if current Dictionary key matches what\n // the user has entered so far.\n if (commandDict.get(i).getKey().startsWith(query)) {\n curSearch.add(commandDict.get(i).getKey());\n }\n }\n\n // Returns an empty ArrayList if no match has been found.\n return curSearch;\n }"
] | [
"0.63731754",
"0.62905836",
"0.6243083",
"0.6129169",
"0.5939918",
"0.5777408",
"0.57610524",
"0.5732689",
"0.54086035",
"0.5368946",
"0.5366362",
"0.53629136",
"0.5346965",
"0.53101826",
"0.52508205",
"0.5188951",
"0.51817703",
"0.5176121",
"0.51127756",
"0.5107946",
"0.50375646",
"0.50280803",
"0.49849433",
"0.49843526",
"0.49698907",
"0.49698702",
"0.49494177",
"0.49285483",
"0.49197653",
"0.49068183",
"0.48617953",
"0.48499933",
"0.48336616",
"0.4829394",
"0.47972322",
"0.47942322",
"0.4783646",
"0.47829092",
"0.47713244",
"0.47690064",
"0.4765143",
"0.47551146",
"0.47498468",
"0.47449166",
"0.47389972",
"0.47357994",
"0.47078598",
"0.47069654",
"0.4706351",
"0.46957144",
"0.46833643",
"0.46697146",
"0.46641427",
"0.4662472",
"0.4657942",
"0.46513146",
"0.46508738",
"0.463876",
"0.4638609",
"0.46368116",
"0.4634289",
"0.46327928",
"0.4632555",
"0.46272048",
"0.46227664",
"0.46123114",
"0.46107465",
"0.46065983",
"0.46029302",
"0.45885503",
"0.45756975",
"0.45741683",
"0.45549214",
"0.45482388",
"0.452649",
"0.45161763",
"0.4514709",
"0.45120353",
"0.45083904",
"0.45026764",
"0.45025516",
"0.45021433",
"0.44912907",
"0.44840178",
"0.44786054",
"0.44729823",
"0.4472703",
"0.44711858",
"0.4470372",
"0.4468332",
"0.44679776",
"0.44653666",
"0.44594884",
"0.44589546",
"0.4456514",
"0.44390282",
"0.44387585",
"0.44355297",
"0.44324455",
"0.44301757"
] | 0.7875116 | 0 |
Tries to move this object on the given lawn Does nothing if Move can't move on the given lawn | void moveForward(Lawn lawn); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract boolean attemptMove(Player currentPlayerObj, Coordinate move);",
"public void tryMove() {\n if(!currentPlayer.getHasPlayed()){\n if (!currentPlayer.isEmployed()) {\n String destStr = chooseNeighbor();\n\n currentPlayer.moveTo(destStr, getBoardSet(destStr));\n if(currentPlayer.getLocation().getFlipStage() == 0){\n currentPlayer.getLocation().flipSet();\n }\n refreshPlayerPanel();\n }\n else {\n view.showPopUp(currentPlayer.isComputer(), \"Since you are employed in a role, you cannot move but you can act or rehearse if you have not already\");\n }\n }\n else{ \n view.showPopUp(currentPlayer.isComputer(), \"You've already moved, rehearsed or acted this turn. Try a different command or click `end turn` to end turn your turn.\");\n }\n view.updateSidePanel(playerArray);\n }",
"public void move()\n {\n move(WALKING_SPEED);\n }",
"private void moveLaser() {\r\n\t\tif(laser != null) {\r\n\t\t\tlaser.move(-FIREBALL_SPEED, 0);\r\n\t\t\t//checkWeaponCollisions(laser);\r\n\t\t\tlaserCollisions();\r\n\t\t\tmoveOffScreen(laser);\r\n\t\t}\r\n\t}",
"@Override\r\n\tpublic void move() {\n\t\tPoint target = strategy.search(this.getLocation(), new Point(0,0));\r\n\r\n\t\tint tries = 0;\r\n\t\t\r\n\t\twhile(!state.equals(\"Inactive\") && !game.movement(this, target.x, target.y)){\r\n\t\t\ttarget = strategy.search(new Point(x,y),playerLocation);\r\n\t\t\ttries++;\r\n\t\t\tif(tries > 4) return; // the search strategy has 4 tries to pick a valid location to move to\r\n\t\t}\r\n\t\t\r\n\t\tx = target.x;\r\n\t\ty = target.y;\r\n\r\n\t\tmoveSprite();\r\n\t}",
"public void move(int moveDirection) {\n //if same or opposite direction, check if movable\n if ((direction - moveDirection) % 6 == 0) {\n this.direction = moveDirection;\n if (moveable()) {\n if (direction == 12) {\n this.setLocation(new Point(this.getX(),\n this.getY() - speed));\n }\n //move right\n if (direction == 3) {\n this.setLocation(new Point(this.getX() + speed,\n this.getY()));\n\n }\n //move down\n if (direction == 6) {\n this.setLocation(new Point(this.getX(),\n this.getY() + speed));\n }\n //move left\n if (direction == 9) {\n this.setLocation(new Point(this.getX() - speed,\n this.getY()));\n }\n\n }\n } // if it is turning, check if can turn or not. If can turn then turn and move according to the direction before turn, otherwise, just leave the monster there\n else {\n Point snapToGridPoint = GameUtility.GameUtility.snapToGrid(\n this.getLocation());\n Point gridPoint = GameUtility.GameUtility.toGridCordinate(\n this.getLocation());\n Point nextPoint = new Point(gridPoint.x, gridPoint.y);\n //if the distance is acceptable\n if (GameUtility.GameUtility.distance(snapToGridPoint,\n this.getLocation()) < GameUtility.GameUtility.TILE_SIZE / 2.5) {\n\n if (moveDirection == 3) {\n int x = Math.max(0, gridPoint.x + 1);\n nextPoint = new Point(x, gridPoint.y);\n } else if (moveDirection == 6) {\n int y = Math.max(0, gridPoint.y + 1);\n nextPoint = new Point(gridPoint.x, y);\n } else if (moveDirection == 9) {\n int x = Math.min(19, gridPoint.x - 1);\n nextPoint = new Point(x, gridPoint.y);\n } else if (moveDirection == 12) {\n int y = Math.min(19, gridPoint.y - 1);\n nextPoint = new Point(gridPoint.x, y);\n }\n // if the turn is empty, then snap the monster to the grid location\n if (!(GameManager.getGameMap().getFromMap(nextPoint) instanceof Wall) && !(GameManager.getGameMap().getFromMap(\n nextPoint) instanceof Bomb)) {\n if (GameUtility.GameUtility.distance(snapToGridPoint,\n this.getLocation()) < GameUtility.GameUtility.TILE_SIZE / 10) {\n this.setLocation(snapToGridPoint);\n this.direction = moveDirection;\n } else {\n if (direction == 9 || direction == 3) {\n int directionOfMovement = (snapToGridPoint.x - getX());\n directionOfMovement = directionOfMovement / Math.abs(\n directionOfMovement);\n this.setLocation(new Point(\n this.getX() + directionOfMovement * speed,\n this.getY()));\n } else if (direction == 12 || direction == 6) {\n int directionOfMovement = (snapToGridPoint.y - getY());\n directionOfMovement = directionOfMovement / Math.abs(\n directionOfMovement);\n this.setLocation(new Point(\n this.getX(),\n this.getY() + directionOfMovement * speed));\n }\n }\n }\n }\n }\n }",
"public boolean tryMove(Move m) {\n \tif(m.getSource().getColor() != turn) return false;\n \treturn m.getSource().move(m);\n }",
"public void move() {\n\t\tGrid<Actor> gr = getGrid();\n\t\tif (gr == null) {\n\t\t\treturn;\n\t\t}\n\t\tLocation loc = getLocation();\n\t\tLocation next = loc.getAdjacentLocation(getDirection());\n\t\t\n\t\tLocation next2 = next.getAdjacentLocation(getDirection());\n\t\tif (gr.isValid(next2)) {\n\t\t\tmoveTo(next2);\n\t\t} else {\n\t\t\tremoveSelfFromGrid();\n\t\t}\n\t}",
"public void move() {\n\n if (_currentFloor == Floor.FIRST) {\n _directionOfTravel = DirectionOfTravel.UP;\n }\n if (_currentFloor == Floor.SEVENTH) {\n _directionOfTravel = DirectionOfTravel.DOWN;\n }\n\n\n if (_directionOfTravel == DirectionOfTravel.UP) {\n _currentFloor = _currentFloor.nextFloorUp();\n } else if (_directionOfTravel == DirectionOfTravel.DOWN) {\n _currentFloor = _currentFloor.nextFloorDown();\n }\n\n if(_currentFloor.hasDestinationRequests()){\n stop();\n } \n\n }",
"private void tryMove(int row, int column) {\n game.move(new Point(row, column));\n }",
"public void move() {\n\n\tGrid<Actor> gr = getGrid();\n\tif (gr == null) {\n\n\t return;\n\t}\n\n\tLocation loc = getLocation();\n\tif (gr.isValid(next)) {\n\n\t setDirection(loc.getDirectionToward(next));\n\t moveTo(next);\n\n\t int counter = dirCounter.get(getDirection());\n\t dirCounter.put(getDirection(), ++counter);\n\n\t if (!crossLocation.isEmpty()) {\n\t\t\n\t\t//reset the node of previously occupied location\n\t\tArrayList<Location> lastNode = crossLocation.pop();\n\t\tlastNode.add(next);\n\t\tcrossLocation.push(lastNode);\t\n\t\t\n\t\t//push the node of current location\n\t\tArrayList<Location> currentNode = new ArrayList<Location>();\n\t\tcurrentNode.add(getLocation());\n\t\tcurrentNode.add(loc);\n\n\t\tcrossLocation.push(currentNode);\t\n\t }\n\n\t} else {\n\t removeSelfFromGrid();\n\t}\n\n\tFlower flower = new Flower(getColor());\n\tflower.putSelfInGrid(gr, loc);\n\t\n\tlast = loc;\n\t\t\n }",
"public boolean move() {\n\t\tint nextDirection;\n\t\tint pacmanX = parent.getPacManX();\n\t\tint pacmanY = parent.getPacManY();\n\t\t\n\t\tint[] directionPriority = new int[4];\n\t\t/** The direction is added to the priority in order to achieve it once the move is chosen */\n\t\tdirectionPriority[0]=(pacmanX-pixelLocationX)*(10)*state+GameCharacter.RIGHT;\n\t\tdirectionPriority[1]=((pacmanX-pixelLocationX)*(-10)*state+GameCharacter.LEFT);\n\t\tdirectionPriority[2]=(pacmanY-pixelLocationY)*(10)*state+GameCharacter.DOWN;\n\t\tdirectionPriority[3]=((pacmanY-pixelLocationY)*(-10)*state+GameCharacter.UP);\n\t\tArrays.sort(directionPriority);\n\t\t\n\t\tint i=3;\n\t\t\n\t\tdo {\n\t\t\tnextDirection = directionPriority[i]%10;\n\t\t\tif (nextDirection < 0) {\n\t\t\t\tnextDirection += 10;\n\t\t\t}\n\t\t\tif(isLegalMove(nextDirection) && (Math.abs(nextDirection-currentDirection) != 2) || i==0) {\n\t\t\t\tsetDirection(nextDirection);\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ti--;\n\t\t}\n\t\twhile (i>=0);\n\t\treturn super.move();\n\t}",
"public void moveLeft() {\n if (!this.state.equals(\"onLeftWall\")) {\n this.dir = -1;\n this.xTargetSpeed = this.X_MAX_SPEED;\n }\n }",
"public void move() {\n if(Objects.nonNull(this.position)) {\n Position position = this.getPosition();\n Function<Position, Position> move = moveRobotInDirectionMap.get(position.getDirection());\n this.position = move.apply(position);\n }\n }",
"public boolean move();",
"public void move(){\n System.out.println(\"I can't move...\");\n }",
"private void move(){\n \n currentAnimation = idleDown;\n \n if(playerKeyInput.allKeys[VK_W]){\n int ty = (int) (objectCoordinateY - speed + bounds.y) / 16;\n \n if(!collisionDetection((int) (objectCoordinateX + bounds.x)/16, ty)){\n objectCoordinateY -= speed;\n currentAnimation = upWalk;\n }\n } \n \n if(playerKeyInput.allKeys[VK_S]){\n int ty = (int) (objectCoordinateY + speed + bounds.y + bounds.height) / 16;\n if(!collisionDetection((int) (objectCoordinateX + bounds.x)/16, ty)){\n objectCoordinateY += speed;\n currentAnimation = downWalk;\n }\n } \n \n if(playerKeyInput.allKeys[VK_A]){\n int tx = (int) (objectCoordinateX - speed + bounds.x) / 16;\n if(!collisionDetection(tx, (int) (objectCoordinateY + bounds.y)/16)){\n objectCoordinateX -= speed;\n currentAnimation = sideWalkLeft;\n }\n } \n \n if(playerKeyInput.allKeys[VK_D]){\n int tx = (int) (objectCoordinateX + speed + bounds.x + bounds.width) / 16;\n if(!collisionDetection(tx, (int) (objectCoordinateY + bounds.y)/16)){\n objectCoordinateX += speed;\n currentAnimation = sideWalkRight;\n }\n } \n \n if(playerKeyInput.allKeys[VK_E]){\n currentAnimation = pickUp;\n } \n }",
"boolean doMove();",
"public void makeMove(Location loc)\n {\n \tLocation curLoc = getLocation();\n \tint curDirection = getDirection();\n // get 2 left locations\n\t\tLocation leftNeighborLoc = curLoc.getAdjacentLocation(curDirection + Location.LEFT);\n Location leftNextNeighborLoc = leftNeighborLoc.getAdjacentLocation(curDirection + Location.LEFT);\n // get 2 right locations\n Location rightNeighborLoc = curLoc.getAdjacentLocation(curDirection + Location.RIGHT);\n Location rightNextNeighborLoc = rightNeighborLoc.getAdjacentLocation(curDirection + Location.RIGHT);\n // initial a null\n Actor leftNeighborActor = null;\n Actor leftNextNeighborActor = null;\n Actor rightNeighborActor = null;\n Actor rightNextNeighborActor = null;\n\n boolean isLeftValid = false;\n boolean isRightValid = false;\n\n Grid<Actor> grid = getGrid();\n // if left valid\n if (grid.isValid(leftNeighborLoc) && grid.isValid(leftNextNeighborLoc))\n {\n \tleftNeighborActor = grid.get(leftNeighborLoc);\n \tleftNextNeighborActor = grid.get(leftNextNeighborLoc);\n \t\n \tif (leftNeighborActor == null && leftNextNeighborActor == null) {\n \t\tisLeftValid = true;\n }\n }\n // if right valid\n if (grid.isValid(rightNeighborLoc) && grid.isValid(rightNextNeighborLoc))\n {\n \trightNeighborActor = grid.get(rightNeighborLoc);\n \trightNextNeighborActor = grid.get(rightNextNeighborLoc);\n\n \tif (rightNeighborActor == null && leftNextNeighborActor == null) {\n \t\tisRightValid = true;\n }\n }\n // if both valid\n if (isLeftValid && isRightValid)\n {\n\t // move ramdonly\n if (Math.random() < 0.5)\n\t {\n\t \tmoveTo(leftNextNeighborLoc);\n\t \n\t }\n\t else{\n\t \tmoveTo(rightNextNeighborLoc);\n\t }\n }\n // right valid only\n else if (isRightValid && !isLeftValid)\n {\n \tmoveTo(rightNextNeighborLoc);\n }\n // left valid only\n else if (!isRightValid && isLeftValid)\n {\n \tmoveTo(leftNextNeighborLoc);\n }\n else\n {\n \tsuper.makeMove(loc);\n }\n \n }",
"public static boolean move() {\n S.rc.setIndicatorString(2, \"move\");\n if (target == null) {\n System.err.println(\"ERROR: tried to move without target\");\n return false;\n }\n\n // Check if we are close enough.\n int distanceSqToTarget = S.rc.getLocation().distanceSquaredTo(target);\n if (distanceSqToTarget <= thresholdDistanceSq) {\n // Stop bugging.\n start = null;\n S.rc.setIndicatorString(2, \"close enough\");\n return moveCloserToTarget();\n }\n\n if (start == null) {\n // Not currently bugging.\n forward = S.rc.getLocation().directionTo(target);\n S.rc.setIndicatorString(2, \"not buggin\");\n if (moveForwardish()) return true;\n // Start bugging.\n start = S.rc.getLocation();\n forward = forward.rotateRight().rotateRight();\n return move();\n } else {\n // Already bugging.\n // Stop bugging if we got closer to the target than when we started bugging.\n if (distanceSqToTarget < start.distanceSquaredTo(target)) {\n start = null;\n return move();\n }\n\n // Stop bugging if back-left is clear.\n // This means that we must have bugged around something that has since moved.\n if (canMove(forward.rotateLeft().rotateLeft().rotateLeft())) {\n start = null;\n forward = S.rc.getLocation().directionTo(target);\n S.rc.setIndicatorString(2, \"back left clear, forward \" + forward);\n return moveForwardish();\n }\n\n S.rc.setIndicatorString(2, \"scan circle\");\n forward = forward.rotateLeft().rotateLeft();\n // Try moving left, and try every direction in a circle from there.\n for (int i = 0; i < 8; i++) {\n if (moveForwardStrict()) return true;\n forward = forward.rotateRight();\n }\n return false;\n }\n }",
"private void goAcrossWall() {\n\t\t// TODO Auto-generated method stub\n\t\tthis.move();\n\t\tthis.turnRight();\n\t}",
"static boolean tryMove(Direction dir) throws GameActionException {\n\t\treturn tryMove(dir,20,4);\n\t}",
"public void move(Maze here) {\n\n\t\tCoordinates target = here.getPlayer().find(); // where the player is\n\n\t\tArrayList<Coordinates> canMove = freeMoves(here); // the ways that aren't\n\t\t\t\t\t\t\t\t\t\t\t\t\t// blocked\n\n\t\tif (!canMove.isEmpty()) { // you can move\n\n\t\t\tCoordinates go = find(); // go is the new coordinates\n\n\t\t\tif (here.getMCell(target).dark()) {\n\t\t\t\tthis.sleep = true;\n\t\t\t\tCollections.shuffle(canMove);\n\t\t\t\tgo = charge(canMove.get(0), here);\n\t\t\t}\n\n\t\t\t// only one option\n\t\t\telse if (canMove.size() == 1)\n\t\t\t\tgo = charge(canMove.get(0), here);\n\n\t\t\telse { // select the best\n\n\t\t\t\t// not too dissimilar to the search method in wargames\n\t\t\t\tPair<Coordinates, Double> best = new Pair<>(target, Double.MAX_VALUE);\n\n\t\t\t\tfor (Coordinates options : canMove) {\n\t\t\t\t\tCoordinates guess = go.add(options);\n\n\t\t\t\t\tdouble gDist = guess.dist(target);\n\n\t\t\t\t\tif (gDist < best.second()) {\n\t\t\t\t\t\tbest.first(options);\n\t\t\t\t\t\tbest.second(gDist);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tgo = charge(best.first(), here);\n\t\t\t}\n\t\t\tmove(go, here);\n\t\t}\n\t}",
"public void move(){\n \n currentFloor = currentFloor + ( 1 * this.direction);\n //if we're at the bottom or top after move, flip the bit\n if(Elevator.MIN_FLOOR == currentFloor \n || currentFloor == Elevator.MAX_FLOOR)\n this.direction *= -1;\n \n if(destinedPassengers[ currentFloor ] > 0)\n elevatorStop( currentFloor, true );\n \n if(building.floor(currentFloor).passengersWaiting() > 0)\n elevatorStop(currentFloor, false);\n \n }",
"public void move(long timePassed) {\r\n\t\t// if ship is moving left and reached the left side of the screen, don't move\r\n\t\tif ((dx < 0) && (x < 10)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// if ship is moving right and reached the right side of the screen, don't move\r\n\t\tif ((dx > 0) && (x > 530)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsuper.move(timePassed);\r\n\t}",
"private void move() {\n\n if(currentPosition.getX() == -1 && currentPosition.getY() == -1) {\n System.out.println(\"Robot is not placed, yet.\");\n return;\n }\n\n Position.Direction direction = currentPosition.getDirection();\n int newX = -1;\n int newY = -1;\n switch (direction) {\n case EAST:\n newX = currentPosition.getX() + 1;\n newY = currentPosition.getY();\n break;\n case WEST:\n newX = currentPosition.getX() - 1;\n newY = currentPosition.getY();\n break;\n case NORTH:\n newX = currentPosition.getX();\n newY = currentPosition.getY() + 1;\n break;\n case SOUTH:\n newX = currentPosition.getX();\n newY = currentPosition.getY() - 1;\n break;\n }\n\n if(newX < lowerBound.getX() || newY < lowerBound.getY()\n || newX > upperBound.getX() || newY > upperBound.getY()) {\n System.out.println(\"Cannot move to \" + direction);\n return;\n }\n\n currentPosition.setX(newX);\n currentPosition.setY(newY);\n }",
"public void move() {\n Grid<Actor> gr = getGrid();\n if (gr == null) {\n return;\n }\n Location loc = getLocation();\n if (gr.isValid(next)) {\n setDirection(getLocation().getDirectionToward(next));\n moveTo(next);\n } else {\n removeSelfFromGrid();\n }\n Flower flower = new Flower(getColor());\n flower.putSelfInGrid(gr, loc);\n }",
"public void move() {\n\t\tGrid<Actor> gr = getGrid();\n\t\tif (gr == null) {\n\t\t\treturn;\n\t\t}\n\t\tLocation loc = getLocation();\n\t\tif (gr.isValid(next)) {\n\t\t\tsetDirection(getLocation().getDirectionToward(next));\n\t\t\tmoveTo(next);\n\t\t} else {\n\t\t\tremoveSelfFromGrid();\n\t\t}\n\t\tFlower flower = new Flower(getColor());\n\t\tflower.putSelfInGrid(gr, loc);\n\t}",
"void makeMove(Location loc);",
"private void moveOrTurn() {\n\t\t// TEMP: look at center of canvas if out of bounds\n\t\tif (!isInCanvas()) {\n\t\t\tlookAt(sens.getXMax() / 2, sens.getYMax() / 2);\n\t\t}\n\n\t\t// if we're not looking at our desired direction, turn towards. Else, move forward\n\t\tif (needToTurn()) {\n\t\t\tturnToDesiredDirection();\n\t\t} else {\n\t\t\tmoveForward(2.0);\n\t\t}\n\n\t\t// move in a random direction every 50 roaming ticks\n\t\tif (tickCount % 100 == 0) {\n\t\t\tgoRandomDirection();\n\t\t}\n\t\ttickCount++;\n\t}",
"public void move() {\n spriteBase.move();\n\n Double newX = spriteBase.getXCoordinate() + spriteBase.getDxCoordinate();\n Double newY = spriteBase.getYCoordinate() + spriteBase.getDyCoordinate();\n\n if (!newX.equals(spriteBase.getXCoordinate())\n || !newY.equals(spriteBase.getYCoordinate())) {\n Logger.log(String.format(\"Monster moved from (%f, %f) to (%f, %f)\",\n spriteBase.getXCoordinate(), spriteBase.getYCoordinate(), newX, newY));\n }\n }",
"public void move() {\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t}",
"public void move();",
"public void move();",
"public abstract boolean changeMove();",
"public static void moveTest() {\n\t\tOthelloBoard Board = new OthelloBoard(BOARD_SIZE,BOARD_SIZE);\n\t Board.setBoard();\n\t Board.decPieceCount();\n\t System.out.println(Board.getPieceCount());\n\t System.out.println(Board.move(\n\t TEST_MOVE_X1, TEST_MOVE_Y1, Board.WHITE_PIECE));\n\t Board.m_Pieces[TEST_PIECE_X][TEST_PIECE_Y]=Board.WHITE_PIECE;\n\t System.out.println(\"\");\n\t System.out.println(\"\");\n\t\tBoard.checkWin();\n\t\tSystem.out.println(\"Valid inputs\");\n\t\tSystem.out.println(\"OthelloBoard.move() - Begin\");\n\t\tSystem.out.println(\"Expected output: false\");\n\t\tSystem.out.println(\"\");\n\t\tSystem.out.println(\"Actual output: \" + \n\t\tBoard.move(OUTPUT_MOVE_TEST_X,OUTPUT_MOVE_TEST_Y,Board.BLACK_PIECE));\n\t System.out.println(\"\");\n\t}",
"private void tryMovePlayer(int direction) {\n int layerOffset = 0, rowOffset = 0, colOffset = 0;\n boolean canMove = false;\n Maze3D.Cell currentCell = maze3D[playerLayer][playerRow][playerCol];\n Maze3D.Cell nextCell = null;\n try {\n switch (direction)\n {\n case Maze3D.UP:\n nextCell = maze3D[playerLayer][playerRow - 1][playerCol];\n canMove = !(currentCell.isWallTop() || nextCell.isWallBottom());\n rowOffset = -1;\n break;\n case Maze3D.DOWN:\n nextCell = maze3D[playerLayer][playerRow + 1][playerCol];\n canMove = !(currentCell.isWallBottom() || nextCell.isWallTop());\n rowOffset = 1;\n break;\n case Maze3D.LEFT:\n nextCell = maze3D[playerLayer][playerRow][playerCol - 1];\n canMove = !(currentCell.isWallLeft() || nextCell.isWallRight());\n colOffset = -1;\n break;\n case Maze3D.RIGHT:\n nextCell = maze3D[playerLayer][playerRow][playerCol + 1];\n canMove = !(currentCell.isWallRight() || nextCell.isWallLeft());\n colOffset = 1;\n break;\n case Maze3D.FRONT:\n nextCell = maze3D[playerLayer - 1][playerRow][playerCol];\n canMove = !(currentCell.isWallFront() || nextCell.isWallBack());\n layerOffset = -1;\n break;\n case Maze3D.BACK:\n nextCell = maze3D[playerLayer + 1][playerRow][playerCol];\n canMove = !(currentCell.isWallBack() || nextCell.isWallFront());\n layerOffset = 1;\n break;\n }\n //if cell is not null and can move, then move\n if (nextCell != null && canMove)\n {\n playerLayer += layerOffset;\n playerRow += rowOffset;\n playerCol += colOffset;\n mazeView.setPlayerLocation(playerLayer, playerRow, playerCol);\n moves++;\n }\n //if new position is the solution, then game is solved\n if (isSolved())\n {\n notifyGameEnd();\n }\n }\n catch (ArrayIndexOutOfBoundsException e)\n {\n Log.d(TAG, \"tryMovePlayer: player tried to move to edge\");\n }\n }",
"boolean makeMove(Bouger m) {\n\tlong oldBits[] = { pieceBits[LIGHT], pieceBits[DARK] };\n\n\tint from, to;\n\t/*\n\t* test to see if a castle move is legal and move the rook (the king is\n\t* moved with the usual move code later)\n\t*/\n\tif ((m.bits & 2) != 0) {\n\n\tif (inCheck(side))\n\treturn false;\n\tswitch (m.getTo()) {\n\tcase 62:\n\tif (color[F1] != EMPTY || color[G1] != EMPTY\n\t|| attack(F1, xside) || attack(G1, xside))\n\treturn false;\n\tfrom = H1;\n\tto = F1;\n\tbreak;\n\tcase 58:\n\tif (color[B1] != EMPTY || color[C1] != EMPTY\n\t|| color[D1] != EMPTY || attack(C1, xside)\n\t|| attack(D1, xside))\n\treturn false;\n\tfrom = A1;\n\tto = D1;\n\tbreak;\n\tcase 6:\n\tif (color[F8] != EMPTY || color[G8] != EMPTY\n\t|| attack(F8, xside) || attack(G8, xside))\n\treturn false;\n\tfrom = H8;\n\tto = F8;\n\tbreak;\n\tcase 2:\n\tif (color[B8] != EMPTY || color[C8] != EMPTY\n\t|| color[D8] != EMPTY || attack(C8, xside)\n\t|| attack(D8, xside))\n\treturn false;\n\tfrom = A8;\n\tto = D8;\n\tbreak;\n\tdefault: /* shouldn't get here */\n\tfrom = -1;\n\tto = -1;\n\tbreak;\n\t}\n\tcolor[to] = color[from];\n\tpiece[to] = piece[from];\n\tcolor[from] = EMPTY;\n\tpiece[from] = EMPTY;\n\tpieceBits[side] ^= (1L << from) | (1L << to);\n\t}\n\t/* back up information so we can take the move back later. */\n\n\tHistoryData h = new HistoryData();\n\th.m = m;\n\tto = m.getTo();\n\tfrom = m.getFrom();\n\th.capture = piece[to];\n\th.castle = castle;\n\th.ep = ep;\n\th.fifty = fifty;\n\th.pawnBits = new long[] { pawnBits[LIGHT], pawnBits[DARK] };\n\th.pieceBits = oldBits;\n\thistDat[hply++] = h;\n\n\t/*\n\t* update the castle, en passant, and fifty-move-draw variables\n\t*/\n\tcastle &= castleMask[from] & castleMask[to];\n\tif ((m.bits & 8) != 0) {\n\tif (side == LIGHT)\n\tep = to + 8;\n\telse\n\tep = to - 8;\n\t} else\n\tep = -1;\n\tif ((m.bits & 17) != 0)\n\tfifty = 0;\n\telse\n\t++fifty;\n\n\t/* move the piece */\n\tint thePiece = piece[from];\n\tif (thePiece == KING)\n\tkingSquare[side] = to;\n\tcolor[to] = side;\n\tif ((m.bits & 32) != 0) {\n\tpiece[to] = m.promote;\n\tpieceMat[side] += pieceValue[m.promote];\n\t} else\n\tpiece[to] = thePiece;\n\tcolor[from] = EMPTY;\n\tpiece[from] = EMPTY;\n\tlong fromBits = 1L << from;\n\tlong toBits = 1L << to;\n\tpieceBits[side] ^= fromBits | toBits;\n\tif ((m.bits & 16) != 0) {\n\tpawnBits[side] ^= fromBits;\n\tif ((m.bits & 32) == 0)\n\tpawnBits[side] |= toBits;\n\t}\n\tint capture = h.capture;\n\tif (capture != EMPTY) {\n\tpieceBits[xside] ^= toBits;\n\tif (capture == PAWN)\n\tpawnBits[xside] ^= toBits;\n\telse\n\tpieceMat[xside] -= pieceValue[capture];\n\t}\n\n\t/* erase the pawn if this is an en passant move */\n\tif ((m.bits & 4) != 0) {\n\tif (side == LIGHT) {\n\tcolor[to + 8] = EMPTY;\n\tpiece[to + 8] = EMPTY;\n\tpieceBits[DARK] ^= (1L << (to + 8));\n\tpawnBits[DARK] ^= (1L << (to + 8));\n\t} else {\n\tcolor[to - 8] = EMPTY;\n\tpiece[to - 8] = EMPTY;\n\tpieceBits[LIGHT] ^= (1L << (to - 8));\n\tpawnBits[LIGHT] ^= (1L << (to - 8));\n\t}\n\t}\n\n\t/*\n\t* switch sides and test for legality (if we can capture the other guy's\n\t* king, it's an illegal position and we need to take the move back)\n\t*/\n\tside ^= 1;\n\txside ^= 1;\n\tif (inCheck(xside)) {\n\ttakeBack();\n\treturn false;\n\t}\n\treturn true;\n\t}",
"protected void move()\n {\n // Find a location to move to.\n Debug.print(\"Fish \" + toString() + \" attempting to move. \");\n Location nextLoc = nextLocation();\n\n // If the next location is different, move there.\n if ( ! nextLoc.equals(location()) )\n {\n // Move to new location.\n Location oldLoc = location();\n changeLocation(nextLoc);\n\n // Update direction in case fish had to turn to move.\n Direction newDir = environment().getDirection(oldLoc, nextLoc);\n changeDirection(newDir);\n Debug.println(\" Moves to \" + location() + direction());\n }\n else\n Debug.println(\" Does not move.\");\n }",
"public void move() {\n\t\t// Override move so we don't move, then get location set by owner.\n\t}",
"boolean makeMove();",
"Move moveToward(Point target) {\n if (standing) {\n // Run to the destination\n if (pos.x != target.x) {\n if (pos.y != target.y) {\n // Run diagonally.\n return new Move(\"run\",\n pos.x + clamp(target.x - pos.x, -1, 1),\n pos.y + clamp(target.y - pos.y, -1, 1));\n }\n // Run left or right\n return new Move(\"run\",\n pos.x + clamp(target.x - pos.x, -2, 2),\n pos.y);\n }\n\n if (pos.y != target.y)\n // Run up or down.\n return new Move(\"run\",\n pos.x,\n pos.y + clamp(target.y - pos.y, -2, 2));\n } else {\n // Crawl to the destination\n if (pos.x != target.x)\n // crawl left or right\n return new Move(\"crawl\",\n pos.x + clamp(target.x - pos.x, -1, 1),\n pos.y);\n\n if (pos.y != target.y)\n // crawl up or down.\n return new Move(\"crawl\",\n pos.x,\n pos.y + clamp(target.y - pos.y, -1, 1));\n }\n\n // Nowhere to move, just reutrn the idle move.\n return new Move();\n }",
"public void move(){\n\t\t\n\t}",
"public void makeMove(Move m) {\n \tPieceColor moved = m.getSource().getColor();\n\n \t//before the move is made, record the move in the movelist\n \tupdateMoveList(m);\n \t\n \t//store locations\n \tint sx = m.getSource().getLocation().getX();\n \tint sy = m.getSource().getLocation().getY();\n \tint dx = m.getDest().getLocation().getX();\n \tint dy = m.getDest().getLocation().getY();\n \tString name_moved = m.getSource().getName();\n \t\n \t//store new king location if it moved\n \tif(name_moved.equals(\"King\")) {\n \t\tif(moved == PieceColor.White) {\n \t\t\twKing = m.getDest().getLocation();\n \t\t\t\n \t\t\t//remove castle rights on both sides\n \t\t\tcastle[0] = false;\n \t\t\tcastle[1] = false;\n \t\t}\n \t\telse if(moved == PieceColor.Black) {\n \t\t\tbKing = m.getDest().getLocation();\n \t\t\t\n \t\t\t//remove castle rights on both sides\n \t\t\tcastle[2] = false;\n \t\t\tcastle[3] = false;\n \t\t}\n \t\telse System.exit(0);\n \t}\n \t\n \t//rook check for castling rights\n \tif(name_moved.equals(\"Rook\")) {\n \t\tif(moved == PieceColor.White) {\n \t\t\tif(sx == 0 && sy == 0) removeCastle(moved, false);\n \t\t\tif(sx == 7 && sy == 0) removeCastle(moved, true);\n \t\t}\n \t\t\n \t\telse if(moved == PieceColor.Black) {\n \t\t\tif(sx == 0 && sy == 7) removeCastle(moved, false);\n \t\t\tif(sx == 7 && sy == 7) removeCastle(moved, true);\n \t\t}\n \t}\n \t\n \tPiece temp = getPiece(sx, sy);\n \t\n \tsetPiece(sx, sy, new NoPiece(sx, sy));\n \t\n \tif(temp.getName().equals(\"Pawn\") && ((Pawn)temp).getPromo() == dy) {\n \t\ttemp = new Queen(dx, dy, temp.getColor(), this);\n \t}\n \t\n \t\n \ttemp.setLocation(new Square(dx, dy));\n \t\n \t//check for en passant\n \tif(name_moved.equals(\"Pawn\")) {\n \t\tint loc = ((Pawn)temp).advance();\n \t\t((Pawn)temp).setMoved(moveList.size());\n \t\t\n \t\t//only a valid en passant move if the pawn moves diagonally\n \t\t//and the destination square is empty\n \t\tif(sx != dx && getPiece(dx, dy).getName().equals(\"None\")) {\n \t\t\tsetPiece(dx, dy-loc, new NoPiece(dx, dy-loc));\n \t\t}\n \t}\n \t\n \tsetPiece(dx, dy, temp);\n \t\n \tif(turn == PieceColor.White) turn = PieceColor.Black;\n \telse turn = PieceColor.White;\n \t\n \t//check if the move was a castle\n \tif(name_moved.equals(\"King\")) {\n \t\t\n \t\tif(moved == PieceColor.White) { \n\t \t\t//if king moved positive x, then moved king side\n\t \t\tif(dx - sx == 2) {\n\t \t\t\ttemp = getPiece(7, 0);\n\t \t\t\tsetPiece(7, 0, new NoPiece(7, 0));\n\t \t\t\t\n\t \t\t\ttemp.setLocation(new Square(5,0));\n\t \t\t\tsetPiece(5, 0, temp);\n\t \t\t}\n\t \t\t\n\t \t\telse if(sx - dx == 2) {\n\t \t\t\ttemp = getPiece(0, 0);\n\t \t\t\tsetPiece(0, 0, new NoPiece(0, 0));\n\t \t\t\t\n\t \t\t\ttemp.setLocation(new Square(3, 0));\n\t \t\t\tsetPiece(3, 0, temp);\n\t \t\t}\n \t\t}\n \t\t\n \t\tif(moved == PieceColor.Black) { \n\t \t\t//if king moved positive x, then moved king side\n\t \t\tif(dx - sx == 2) {\n\t \t\t\ttemp = getPiece(7, 7);\n\t \t\t\tsetPiece(7, 7, new NoPiece(7, 7));\n\t \t\t\t\n\t \t\t\ttemp.setLocation(new Square(5, 7));\n\t \t\t\tsetPiece(5, 7, temp);\n\t \t\t}\n\t \t\t\n\t \t\telse if(sx - dx == 2) {\n\t \t\t\ttemp = getPiece(0, 7);\n\t \t\t\tsetPiece(0, 7, new NoPiece(0, 7));\n\t \t\t\t\n\t \t\t\ttemp.setLocation(new Square(3, 7));\n\t \t\t\tsetPiece(3, 7, temp);\n\t \t\t}\n \t\t}\n \t}\n }",
"public abstract void move();",
"public abstract void move();",
"public abstract void move();",
"public abstract void move();",
"public abstract void move();",
"public abstract void move();",
"public abstract void move();",
"public void InvalidMove();",
"public void movePlayer(String direction) {\n if(playerAlive(curPlayerRow, curPlayerCol)){\n if(direction.equals(\"u\")&&(curPlayerRow-1)>=0){\n overwritePosition(curPlayerRow, curPlayerCol, (curPlayerRow-1), curPlayerCol);\n curPlayerRow -= 1;\n }else if(direction.equals(\"d\")&&(curPlayerRow+1)<=7){\n overwritePosition(curPlayerRow, curPlayerCol, (curPlayerRow+1), curPlayerCol);\n curPlayerRow += 1;\n }else if(direction.equals(\"l\")&&(curPlayerCol-1)>=0){\n overwritePosition(curPlayerRow, curPlayerCol, curPlayerRow, (curPlayerCol-1));\n curPlayerCol -= 1;\n }else if(direction.equals(\"r\")&&(curPlayerCol+1)<=9){\n overwritePosition(curPlayerRow, curPlayerCol, curPlayerRow, (curPlayerCol+1));\n curPlayerCol += 1;\n }\n }\n if(playerFoundTreasure(curPlayerRow, curPlayerCol)){\n playerWins();\n }\n adjustPlayerLifeLevel(curPlayerRow, curPlayerCol);\n int[] array = calcNewTrollCoordinates(curPlayerRow, curPlayerCol, curTrollRow, curTrollCol);\n if(curPlayerRow == curTrollRow && curPlayerCol == curTrollCol){\n gameBoard[curTrollRow][curTrollCol] = new TrollPiece();\n }else{\n int newTrollRow = array[0];\n int newTrollCol = array[1];\n overwritePosition(curTrollRow, curTrollCol, newTrollRow, newTrollCol);\n curTrollRow = newTrollRow;\n curTrollCol = newTrollCol;\n }\n }",
"private void move() {\n\t\t\tangle += Math.PI/24;\n\t\n\t\t\tcow.locX = Math.sin(angle) * 2.5 + player.getLocation().getX();\n\t\t\tcow.locZ = Math.cos(angle) * 2.5 + player.getLocation().getZ();\n\t\t\t\n\t\t\tLocation loc = new Location(player.getWorld(), cow.locX, player.getLocation().getY() + 1.5, cow.locZ);\n\t\t\tloc.setDirection(player.getLocation().subtract(loc).toVector()); //Look at the player\n\t\t\t\n\t\t\tPacketHandler.teleportFakeEntity(player, cow.getId(), loc);\n\t\t}",
"public void moveLeft() {\n \tif(!move.moveLeft()) {\n \t\tif(physinteractor(getX()-1,getY())) {\n \t\t\tmove.moveLeft();\n \t\t\tnonphysinteractor(getX(),getY());\n \t\t\tupdatemove();\n \t\t}\n }else {\n \tupdatemove();\n \tnonphysinteractor(getX(),getY());\n }\n }",
"@Override\n public Status move(){\n\n if(onNode.getNextNode(this)==null){\n return Status.NOT_EMPTY_CAR;\n }\n List<Train> on = onNode.getNextNode(this).getTrains();\n if(!on.isEmpty()) return Status.CRASHED;\n\n Node next = onNode.getNextNode(this);\n prevNode.removeTrain(this);\n next.addTrain(this);\n x=next.getX();\n y=next.getY();\n try {\n ((Station)next).setGetOff();\n }\n catch (Exception e) {}\n \n return nextCar.move();\n }",
"private Direction moveToGoal() throws GameActionException {\n Direction toGoal = location.directionTo(goal);\n if (rc.canMove(toGoal)) {\n return toGoal;\n } else {\n return getHandOnWall();\n }\n }",
"public void move()\n {\n if (!alive) {\n return;\n }\n\n if (speedTimer > 0) {\n speedTimer --;\n } else if (speedTimer == 0 && speed != DEFAULT_SPEED) {\n speed = DEFAULT_SPEED;\n }\n\n Location last = playerLocations.get(playerLocations.size()-1);\n Location next = null;\n\n // For the speed, iterate x blocks between last and next\n\n if (direction == UPKEY)\n {\n next = getLocation(last.getX(), (int)(last.getY() - speed * getPixelSize()));\n } else if (direction == DOWNKEY)\n {\n next = getLocation(last.getX(), (int)(last.getY() + speed * getPixelSize()));\n } else if (direction == LEFTKEY)\n {\n next = getLocation((int)(last.getX() - speed * getPixelSize()), last.getY());\n } else if (direction == RIGHTKEY)\n {\n next = getLocation((int)(last.getX() + speed * getPixelSize()), last.getY());\n }\n\n ArrayList<Location> line = getLine(last, next);\n\n if (line.size() == 0) {\n gameOver();\n return;\n }\n\n for (Location loc : line) {\n if (checkCrash (loc)) {\n gameOver();\n return;\n } else {\n // Former bug: For some reason when a player eats a powerup a hole appears in the line where the powerup was.\n Location l2 = getLocation(loc.getX(), loc.getY());\n l2.setType(LocationType.PLAYER);\n l2.setColor(this.col);\n\n playerLocations.add(l2);\n getGridCache().add(l2);\n }\n }\n }",
"public void move() {\n if (!canMove) {\n return;\n }\n int moveX = currDirection == EAST ? PACE : currDirection == WEST ? -PACE : 0;\n int moveY = currDirection == NORTH ? PACE : currDirection == SOUTH ? -PACE : 0;\n if (grid == null || grid.isOutside(currX + moveX, currY + moveY)) {\n return;\n }\n currX += moveX;\n currY += moveY;\n }",
"@Override\r\n public void move() {\r\n Grid<Actor> gr = getGrid();\r\n if (gr == null) {\r\n return;\r\n }\r\n Location loc = getLocation();\r\n if (gr.isValid(next)) {\r\n setDirection(getLocation().getDirectionToward(next));\r\n moveTo(next);\r\n } else {\r\n removeSelfFromGrid();\r\n }\r\n Flower flower = new Flower(getColor());\r\n flower.putSelfInGrid(gr, loc);\r\n }",
"void move();",
"static void moving() throws GameActionException {\n\n\t\tcheckLumberjack();\n\n\t\trc.setIndicatorLine(myLocation, myLocation.add(robotDirection), 0, 0, 0);\n\n\t\tif (rc.canBuildRobot(RobotType.SCOUT, robotDirection)\n\t\t\t\t&& rc.readBroadcast(Channels.COUNT_SCOUT) < Constants.MAX_COUNT_SCOUT) {\n\t\t\trc.buildRobot(RobotType.SCOUT, robotDirection);\n\t\t\tCommunication.countMe(RobotType.SCOUT);\n\t\t\treturn;\n\t\t}\n\t\t// } else if (rc.canBuildRobot(RobotType.SOLDIER, buildDirection) &&\n\t\t// rc.readBroadcast(Channels.COUNT_SOLDIER) <\n\t\t// Constants.MAX_COUNT_SOLDIER) {\n\t\t// rc.buildRobot(RobotType.SOLDIER, buildDirection);\n\t\t// Communication.countMe(RobotType.SOLDIER);\n\t\t// return;\n\t\t// }\n\n\t}",
"private void move() {\n resetUpdate();\n\n gameMessage.setSpace1(clientMessage.getSpace1());\n gameMessage.resetGameMessage();\n gameMessage.notify(gameMessage);\n\n\n if( liteGame.isWinner() ) endOfTheGame = true;\n }",
"public void move() {\n\n }",
"public WorldPixel move() {\n this.lastMoveDirection = getDirection();\n\n WorldPixel head = getTrail().peekLast();\n int oldX = head.getX();\n int oldY = head.getY();\n\n int newX = oldX + getDirection().getXDelta();\n int newY = oldY + getDirection().getYDelta();\n if (newX < getSector().getWorldXStart() || newX >= getSector().getWorldXEnd()\n || newY < getSector().getWorldYStart() || newY >= getSector().getWorldYEnd())\n return null;\n\n WorldPixel newPos = getWorld().getPixel(newX, newY);\n getTrail().addLast(newPos);\n return newPos;\n }",
"public static void turn() throws GameActionException {\n RobotInfo[] robots = rc.senseNearbyRobots(RobotType.LUMBERJACK.bodyRadius+GameConstants.LUMBERJACK_STRIKE_RADIUS, them);\n\n if(robots.length > 0 && !rc.hasAttacked()) {\n // Use strike() to hit all nearby robots!\n rc.strike();\n } else {\n // No close robots, so search for robots within sight radius\n robots = rc.senseNearbyRobots(-1,them);\n\n // If there is a robot, move towards it\n if(robots.length > 0) {\n MapLocation enemyLocation = robots[0].getLocation();\n Direction toEnemy = here.directionTo(enemyLocation);\n\n Util.tryMove(toEnemy);\n } else {\n \t\n \tchopTrees();\n \t\n // Move Randomly\n \tUtil.tryMove(Util.randomDirection());\n \t\n \t\n }\n }\n\t}",
"boolean move(Unit unit, Direction direction);",
"@Test\n public void testMove() {\n Point Left_1_North = Day1.move(\"L\", 1, new Point(0, 0), \"NORTH\");\n assertEquals(new Point(-1, 0), Left_1_North);\n\n Point Left_1_South = Day1.move(\"L\", 1, new Point(0, 0), \"SOUTH\");\n assertEquals(new Point(1, 0), Left_1_South);\n\n Point Left_1_East = Day1.move(\"L\", 1, new Point(0, 0), \"EAST\");\n assertEquals(new Point(0, 1), Left_1_East);\n\n Point Left_1_West = Day1.move(\"L\", 1, new Point(0, 0), \"WEST\");\n assertEquals(new Point(0, -1), Left_1_West);\n\n //turn right when facing North, South, East and West\n Point Right_1_North = Day1.move(\"R\", 1, new Point(0, 0), \"NORTH\");\n assertEquals(new Point(1, 0), Right_1_North);\n\n Point Right_1_South = Day1.move(\"R\", 1, new Point(0, 0), \"SOUTH\");\n assertEquals(new Point(-1, 0), Right_1_South);\n\n Point Right_1_East = Day1.move(\"R\", 1, new Point(0, 0), \"EAST\");\n assertEquals(new Point(0, -1), Right_1_East);\n\n Point Right_1_West = Day1.move(\"R\", 1, new Point(0, 0), \"WEST\");\n assertEquals(new Point(0, 1), Right_1_West);\n\n //wrong Input, return current point\n Point wrong = Day1.move(\"A\", 1, new Point(0, 0), \"B\");\n assertEquals(new Point(0, 0), wrong);\n\n }",
"private void move() {\n if(this.movement[0]) {\n moveRight();\n } else {\n moveLeft();\n }\n if(this.movement[1]) {\n moveDown();\n } else {\n moveUp();\n }\n\n //Checking boundaries of the game\n if(this.XPosition + this.ballWidth > instance.getWidth()) {\n this.movement[0] = false;\n } else if(XPosition <= 0) {\n this.movement[0] = true;\n } else if(YPosition <= 0) {\n this.movement[1] = true;\n } else if(YPosition + ballHeight >= instance.getHeight()) {\n instance.missedBall();\n if (instance.getBalls() > 0){\n this.lostLife.play();\n }\n this.XPosition = instance.getWidth() / 2;\n this.YPosition = instance.getHeight() - 43;\n this.movement[1] = false;\n Player.setPlayerX((instance.getWidth() - 111) / 2);\n Player.setPlayerY(instance.getHeight() - 19);\n instance.isPaused(true);\n }\n\n if (this.boundingBox.intersects(this.playerBoundingBox)){\n Rectangle leftHalfOfPlayer = new Rectangle((int)this.playerBoundingBox.getWidth() / 2, (int)this.playerBoundingBox.getHeight(),\n this.playerBoundingBox.x, this.playerBoundingBox.y);\n this.movement[0] = !this.boundingBox.intersects(leftHalfOfPlayer);\n this.movement[1] = false;\n } else {\n // Check if ball collides with brick;\n for (Bricks[] bricks : instance.getBricks()){\n for (Bricks brick: bricks){\n if (brick.collidesWith(new Rectangle(this.XPosition , this.YPosition , this.ballWidth , this.ballHeight))){\n Rectangle iRect = brick.brickHitBox.intersection(this.boundingBox);\n brick.destroy();\n //Sound brickBreak = new Sound(\"res/Break-Sound.wav\");\n this.brickBreak.play();\n // make logic\n this.movement[1] = true;\n if ((this.boundingBox.x+(this.boundingBox.width/2))<(iRect.x+(iRect.width/2))) {\n this.movement[0] = false;\n }\n if ((this.boundingBox.x+(this.boundingBox.width/2))>(iRect.x+(iRect.width/2))) {\n this.movement[0] = true;\n }\n if ((this.boundingBox.y+(this.boundingBox.height/2))<(iRect.y+(iRect.height/2))) {\n this.movement[1] = false;\n }\n }\n }\n }\n\n }\n\n }",
"public void move(){\n super.move();\n if(getX() >= Main.WIDTH - getWidth() * 1.5) {\n setDirection(-1);\n } else if(getX() <= 50) {\n setDirection(1);\n }\n }",
"public void move(String direction) {\n \n }",
"public void move()\n\t{\n\t\tVector v = ship.v;\n\t\tb = b.getLocation().add(v).getBlock();\n\t\tif(triangle != null) triangle.move();\n\t\tif(rear != null) rear.move();\n\t\tif(foreAndAft != null) foreAndAft.move();\n\t\tif(sails != null) for(int i = 0; i < sails.size(); i++)\n\t\t{\n\t\t\tSail sail = sails.get(i);\n\t\t\tsail.move();\n\t\t}\n\t}",
"public final EObject ruleMove() throws RecognitionException {\n EObject current = null;\n\n EObject this_MoveLeft_0 = null;\n\n EObject this_MoveRight_1 = null;\n\n EObject this_MoveUp_2 = null;\n\n EObject this_MoveDown_3 = null;\n\n\n\n \tenterRule();\n\n try {\n // InternalBoundingBox.g:151:2: ( (this_MoveLeft_0= ruleMoveLeft | this_MoveRight_1= ruleMoveRight | this_MoveUp_2= ruleMoveUp | this_MoveDown_3= ruleMoveDown ) )\n // InternalBoundingBox.g:152:2: (this_MoveLeft_0= ruleMoveLeft | this_MoveRight_1= ruleMoveRight | this_MoveUp_2= ruleMoveUp | this_MoveDown_3= ruleMoveDown )\n {\n // InternalBoundingBox.g:152:2: (this_MoveLeft_0= ruleMoveLeft | this_MoveRight_1= ruleMoveRight | this_MoveUp_2= ruleMoveUp | this_MoveDown_3= ruleMoveDown )\n int alt3=4;\n switch ( input.LA(1) ) {\n case 13:\n {\n alt3=1;\n }\n break;\n case 14:\n {\n alt3=2;\n }\n break;\n case 15:\n {\n alt3=3;\n }\n break;\n case 16:\n {\n alt3=4;\n }\n break;\n default:\n NoViableAltException nvae =\n new NoViableAltException(\"\", 3, 0, input);\n\n throw nvae;\n }\n\n switch (alt3) {\n case 1 :\n // InternalBoundingBox.g:153:3: this_MoveLeft_0= ruleMoveLeft\n {\n\n \t\t\tnewCompositeNode(grammarAccess.getMoveAccess().getMoveLeftParserRuleCall_0());\n \t\t\n pushFollow(FOLLOW_2);\n this_MoveLeft_0=ruleMoveLeft();\n\n state._fsp--;\n\n\n \t\t\tcurrent = this_MoveLeft_0;\n \t\t\tafterParserOrEnumRuleCall();\n \t\t\n\n }\n break;\n case 2 :\n // InternalBoundingBox.g:162:3: this_MoveRight_1= ruleMoveRight\n {\n\n \t\t\tnewCompositeNode(grammarAccess.getMoveAccess().getMoveRightParserRuleCall_1());\n \t\t\n pushFollow(FOLLOW_2);\n this_MoveRight_1=ruleMoveRight();\n\n state._fsp--;\n\n\n \t\t\tcurrent = this_MoveRight_1;\n \t\t\tafterParserOrEnumRuleCall();\n \t\t\n\n }\n break;\n case 3 :\n // InternalBoundingBox.g:171:3: this_MoveUp_2= ruleMoveUp\n {\n\n \t\t\tnewCompositeNode(grammarAccess.getMoveAccess().getMoveUpParserRuleCall_2());\n \t\t\n pushFollow(FOLLOW_2);\n this_MoveUp_2=ruleMoveUp();\n\n state._fsp--;\n\n\n \t\t\tcurrent = this_MoveUp_2;\n \t\t\tafterParserOrEnumRuleCall();\n \t\t\n\n }\n break;\n case 4 :\n // InternalBoundingBox.g:180:3: this_MoveDown_3= ruleMoveDown\n {\n\n \t\t\tnewCompositeNode(grammarAccess.getMoveAccess().getMoveDownParserRuleCall_3());\n \t\t\n pushFollow(FOLLOW_2);\n this_MoveDown_3=ruleMoveDown();\n\n state._fsp--;\n\n\n \t\t\tcurrent = this_MoveDown_3;\n \t\t\tafterParserOrEnumRuleCall();\n \t\t\n\n }\n break;\n\n }\n\n\n }\n\n\n \tleaveRule();\n\n }\n\n catch (RecognitionException re) {\n recover(input,re);\n appendSkippedTokens();\n }\n finally {\n }\n return current;\n }",
"@Test\r\n public void should_not_be_allowed_to_move_in_wrong_direction() {\r\n game.nextTurn(); // will throw [1,2] and thus black starts\r\n assertFalse(game.move(Location.R12, Location.R10));\r\n }",
"abstract void move();",
"@Override\n\tpublic Direction getMove() {\n if (ticks < MAX_TICKS_PER_ROUND - 100) {\n Direction[] dirs = Direction.values();\n return dirs[random.nextInt(dirs.length)];\n } else {\n // Move towards boat\n int deltaX = 0;\n int deltaY = 0;\n if (currentLocation.getX() < 0)\n deltaX = 1;\n else if (currentLocation.getX() > 0)\n deltaX = -1;\n\n if (currentLocation.getY() < 0)\n deltaY = 1;\n else if (currentLocation.getY() > 0)\n deltaY = -1;\n\n if (deltaX > 0 && deltaY == 0) {\n return Direction.E;\n } else if (deltaX > 0 && deltaY > 0) {\n return Direction.NE;\n } else if (deltaX > 0 && deltaY < 0) {\n return Direction.SE;\n } else if (deltaX == 0 && deltaY == 0) {\n return Direction.STAYPUT;\n } else if (deltaX == 0 && deltaY < 0) {\n return Direction.N;\n } else if (deltaX == 0 && deltaY > 0) {\n return Direction.S;\n } else if (deltaX < 0 && deltaY == 0) {\n return Direction.W;\n } else if (deltaX < 0 && deltaY > 0) {\n return Direction.NW;\n } else if (deltaX < 0 && deltaY < 0) {\n return Direction.NE;\n } else {\n throw new RuntimeException(\"I HAVE NO IDEA\");\n }\n }\n\t}",
"@Override\n\tpublic void move() {\n\t\theading = Heading.randHeading();\n\t\tif (heading == Heading.NORTH) {\n\t\t\tthis.location.y -= Utilities.rng.nextInt(Simulation.WORLD_SIZE/10);\n\t\t} else if (heading == Heading.EAST) {\n\t\t\tthis.location.x += Utilities.rng.nextInt(Simulation.WORLD_SIZE/10);\n\t\t} else if (heading == Heading.SOUTH) {\n\t\t\tthis.location.y += Utilities.rng.nextInt(Simulation.WORLD_SIZE/10);\n\t\t} else if (heading == Heading.WEST) {\n\t\t\tthis.location.x -= Utilities.rng.nextInt(Simulation.WORLD_SIZE/10);\n\t\t}\n\t\tadjustPos();\n\t\tinfect();\n\t}",
"@Test\n void RookMoveLeftBlocked() {\n Board board = new Board(8, 8);\n Piece rook1 = new Rook(board, 6, 2, 1);\n Piece rook2 = new Rook(board, 4, 2, 1);\n\n board.getBoard()[6][2] = rook1;\n board.getBoard()[4][2] = rook2;\n\n board.movePiece(rook1, 1, 2);\n\n Assertions.assertEquals(rook1, board.getBoard()[6][2]);\n Assertions.assertEquals(rook2, board.getBoard()[4][2]);\n Assertions.assertNull(board.getBoard()[1][2]);\n }",
"@Override\r\n public void makeMove(final Move move) {\n if (this.getMoves().size() >= 4) {\r\n this.resetNewDirBots();\r\n }\r\n \r\n // It is OK to now make the default move\r\n // basically add a New Point to the move queue\r\n super.makeMove(move); \r\n initDirBotMove(this.north);\r\n initDirBotMove(this.south);\r\n initDirBotMove(this.east);\r\n initDirBotMove(this.west); \r\n }",
"public void move() {\n\r\n\t}",
"@Override\n\tpublic boolean movable(Entity obj) {\n\t\tif (!(obj instanceof Player)) return false;\n\t\tPlayer player = (Player) obj;\n\t\t\n\t\tint futureX = this.getX();\n\t\tint futureY = this.getY();\n\t\t\n\t\t\n\t\tint playerX = player.getX();\n\t\tint playerY = player.getY();\n\t\t\n\t\tif (playerX == this.getX()) {\n\t\t\t// player moving either up or down\n\t\t\tif (playerY > this.getY()) {\n\t\t\t\t// player moving up so check what's up of boulder\n\t\t\t\tfutureY = this.getY() - 1;\n\t\t\t} else {\n\t\t\t\t// player moving down ''\n\t\t\t\tfutureY = this.getY() + 1;\n\t\t\t}\n\t\t} else if (playerY == this.getY()) {\n\t\t\t// player moving either left or right\n\t\t\tif (playerX > this.getX()) {\n\t\t\t\t// player moving left ''\n\t\t\t\tfutureX = this.getX() - 1;\n\t\t\t} else {\n\t\t\t\t// player moving right ''\n\t\t\t\tfutureX = this.getX() + 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\tboolean result = checkMoveable(futureX, futureY);\n\t\treturn result;\n\t}",
"public void move(String direction);",
"public void move() {\n\t\tmoveX();\n\t\tmoveY();\n\t}",
"private void turnAround() {\r\n this.setCurrentDirection(-getCurrentDirection());\r\n }",
"public void move()\n {\n double angle = Math.toRadians( getRotation() );\n int x = (int) Math.round(getX() + Math.cos(angle) * WALKING_SPEED);\n int y = (int) Math.round(getY() + Math.sin(angle) * WALKING_SPEED);\n setLocation(x, y);\n }",
"private int Win_Move() {\n\t\tfinal int POSSIBLE_WIN = 8;\n\t\tint move = NO_MOVE;\n\t\tif(( gameBoard[TOP_LEFT] + gameBoard[TOP_CENTER] + gameBoard[TOP_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_LEFT] == EMPTY){\n\t\t\t\tmove = TOP_LEFT;\n\t\t\t}else if (gameBoard[TOP_CENTER] == EMPTY){\n\t\t\t\tmove = TOP_CENTER;\n\t\t\t}else if (gameBoard[TOP_RIGHT] == EMPTY){\n\t\t\t\tmove = TOP_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[CTR_LEFT] + gameBoard[CTR_CENTER] + gameBoard[CTR_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[CTR_LEFT] == EMPTY){\n\t\t\t\tmove = CTR_LEFT;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[CTR_RIGHT] == EMPTY){\n\t\t\t\tmove = CTR_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[BTM_LEFT] + gameBoard[BTM_CENTER] + gameBoard[BTM_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[BTM_LEFT] == EMPTY){\n\t\t\t\tmove = BTM_LEFT;\n\t\t\t}else if (gameBoard[BTM_CENTER] == EMPTY){\n\t\t\t\tmove = BTM_CENTER;\n\t\t\t}else if (gameBoard[BTM_RIGHT] == EMPTY){\n\t\t\t\tmove = BTM_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_LEFT] + gameBoard[CTR_LEFT] + gameBoard[BTM_LEFT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_LEFT] == EMPTY){\n\t\t\t\tmove = TOP_LEFT;\n\t\t\t}else if (gameBoard[CTR_LEFT] == EMPTY){\n\t\t\t\tmove = CTR_LEFT;\n\t\t\t}else if (gameBoard[BTM_LEFT] == EMPTY){\n\t\t\t\tmove = BTM_LEFT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_CENTER] + gameBoard[CTR_CENTER] + gameBoard[BTM_CENTER]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_CENTER] == EMPTY){\n\t\t\t\tmove = TOP_CENTER;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[BTM_CENTER] == EMPTY){\n\t\t\t\tmove = BTM_CENTER;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_RIGHT] + gameBoard[CTR_RIGHT] + gameBoard[BTM_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_RIGHT] == EMPTY){\n\t\t\t\tmove = TOP_RIGHT;\n\t\t\t}else if (gameBoard[CTR_RIGHT] == EMPTY){\n\t\t\t\tmove = CTR_RIGHT;\n\t\t\t}else if (gameBoard[BTM_RIGHT] == EMPTY){\n\t\t\t\tmove = BTM_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_LEFT] + gameBoard[CTR_CENTER] + gameBoard[BTM_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_LEFT] == EMPTY){\n\t\t\t\tmove = TOP_LEFT;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[BTM_RIGHT] == EMPTY){\n\t\t\t\tmove = BTM_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_RIGHT] + gameBoard[CTR_CENTER] + gameBoard[BTM_LEFT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_RIGHT] == EMPTY){\n\t\t\t\tmove = TOP_RIGHT;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[BTM_LEFT] == EMPTY){\n\t\t\t\tmove = BTM_LEFT;\n\t\t\t}\n\t\t}\n\t\treturn move;\n\t}",
"public void move() {\n\t\tif (isLuck) {\n\t\t\tif (rand.nextBoolean()) {\n\t\t\t\txPos++;\n\t\t\t}\n\t\t} else {\n\t\t\tif (rightCount < skill) {\n\t\t\t\trightCount++;\n\t\t\t\txPos++;\n\t\t\t}\n\t\t}\n\t}",
"private void handleMovement() {\n if (movements.isEmpty()) return;\n try {\n switch (movements.peek()) {\n case MOVE_UP:\n game.movePlayer(Direction.N);\n break;\n case MOVE_LEFT:\n game.movePlayer(Direction.W);\n break;\n case MOVE_DOWN:\n game.movePlayer(Direction.S);\n break;\n case MOVE_RIGHT:\n game.movePlayer(Direction.E);\n break;\n }\n } catch (Exception ignored) { }\n }",
"protected void makeAmove(Board b, Player p){\r\n\t\tthis.setMove(0);\t\t\r\n\t\tif (this.winnable(b) != 0)\r\n\t\t\tthis.setMove(this.winnable(b));\r\n\t\telse if (p.winnable(b) != 0)\r\n\t\t\tthis.setMove(p.winnable(b));\r\n\t\telse if (b.getTile(5) == ' ')\r\n\t\t\tthis.setMove(5);\r\n\t\telse{\r\n\t\t\tRandom tile = new Random();\r\n\t\t\tdo{\r\n\t\t\t\tthis.move = (tile.nextInt(9) + 1);\r\n\t\t\t\t// int 0-8 inclusive and adding 1 makes it 1-9 incl\r\n\t\t\t}while ((b.getTile(this.getMove())=='O') || \r\n\t\t\t\t\t(b.getTile(this.getMove())=='X'));\r\n\t\t\t// just checks to see if it's is a valid move\r\n\t\t\t// empty and within the bounds of 1-9\r\n\t\t}\r\n\t\tb.setTile(this.getMove(), this.getSymbol());\r\n\t\tSystem.out.println(\"Player \"+this.ID+\" (computer) chooses position \"+this.getMove());\r\n\t}",
"public boolean move() {\r\n\t\tif (direction == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tint newPosX = this.posX;\r\n\t\tint newPosY = this.posY;\r\n\r\n\t\tswitch (this.direction) {\r\n\t\tcase NORTH:\r\n\t\t\tnewPosY++;\r\n\t\t\tbreak;\r\n\t\tcase WEST:\r\n\t\t\tnewPosX--;\r\n\t\t\tbreak;\r\n\t\tcase SOUTH:\r\n\t\t\tnewPosY--;\r\n\t\t\tbreak;\r\n\t\tcase EAST:\r\n\t\t\tnewPosX++;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tboolean canMoveToNewPosition = tabletop.canMove(newPosX, newPosY);\r\n\t\tif (!canMoveToNewPosition) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tthis.posX = newPosX;\r\n\t\tthis.posY = newPosY;\r\n\r\n\t\treturn true;\r\n\t}",
"private void moveMower(final char movement) {\n int nextYPosition = this.getPosition().getPositionY();\n int nextXPosition = this.getPosition().getPositionX();\n switch (this.getPosition().getOrientation()) {\n case N:\n nextYPosition++;\n break;\n case S:\n nextYPosition--;\n break;\n case W:\n nextXPosition--;\n break;\n case E:\n default:\n nextXPosition++;\n break;\n }\n if (garden.isPositionAvailable(nextXPosition, nextYPosition)) {\n logger.debug(\"Moving mower : ({}, {}) -> ({}, {})\",\n this.position.getPositionX(), this.position.getPositionY(),\n nextXPosition, nextYPosition);\n this.getPosition().setPositionX(nextXPosition);\n this.getPosition().setPositionY(nextYPosition);\n } else {\n logger.debug(\"Cannot move mower : ({}, {}) -> ({}, {})\",\n this.position.getPositionX(), this.position.getPositionY(),\n this.position.getPositionX(), this.position.getPositionY());\n }\n }",
"public void move() {\n super.move(DIRECTION.getRandom());\n }",
"public void move() {\n\t\tif(right) {\n\t\t\tgoRight();\n\t\t\tstate++;\n\t\t\tif(state > 5) {\n\t\t\t\tstate = 3;\n\t\t\t}\n\t\t}\n\t\telse if(left) {\n\t\t\tgoLeft();\n\t\t\tstate++;\n\t\t\tif(state > 2) {\n\t\t\t\tstate = 0;\n\t\t\t}\n\t\t}\n\t}",
"void move(Tile t);",
"public boolean attemptMove(int x, int y)\n {\n return setPosition(x, y);\n }",
"void move() {\r\n\t\tif (x + xa < 0){\r\n\t\t\txa = mov;\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\telse if (x + xa > game.getWidth() - diameter){\r\n\t\t\txa = -mov;\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\tif (y + ya < 0){\r\n\t\t\tya = mov;\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\telse if (y + ya > game.getHeight() - diameter){\r\n\t\t\tgame.gameOver();\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\tif (colisionPalas()){\r\n\t\t\tya = -mov;\r\n\t\t}\r\n\t\telse if(colisionEstorbos()){\r\n\t\t\tgame.puntuacion+=2;\r\n\t\t}\r\n\t\t\r\n\t\tx = x + xa;\r\n\t\ty = y + ya;\r\n\t}",
"private void turnLeft() {\n\n if(currentPosition.getX() == -1 && currentPosition.getY() == -1) {\n System.out.println(\"Robot is not placed, yet.\");\n return;\n }\n\n Position.Direction direction = currentPosition.getDirection();\n switch (direction) {\n case EAST:\n direction = Position.Direction.NORTH;\n break;\n case WEST:\n direction = Position.Direction.SOUTH;\n break;\n case NORTH:\n direction = Position.Direction.WEST;\n break;\n case SOUTH:\n direction = Position.Direction.EAST;\n break;\n }\n\n currentPosition.setDirection(direction);\n }",
"@Override\r\n public void makeLogicMove() {\r\n\r\n this.printThoughts();\r\n this.printMessages();\r\n \r\n // If dead, don't make a move //\r\n if (this.isDead()) {\r\n return;\r\n } \r\n \r\n if (this.getVerbose()) {\r\n System.err.println(\"Making logic move for aibotscorer - \" + this.getMoves().size());\r\n }\r\n \r\n final AIBotScoreModel scores = scoreAllDirections();\r\n if (this.getVerbose()) {\r\n System.err.println(scores);\r\n }\r\n if (this.getMoves().size() <= 3) {\r\n super.makeLogicMove();\r\n return;\r\n }\r\n \r\n if (this.getMoves().size() == 26) {\r\n this.addMessages(\"-5000-AI: using default move, on 30 clause\");\r\n super.makeLogicMove();\r\n return;\r\n }\r\n \r\n final int randomMoveFlag = random.nextInt(16);\r\n if (randomMoveFlag == 1) {\r\n this.addMessages(\"-4000-AI: using default move, random case\");\r\n super.makeLogicMove();\r\n return;\r\n }\r\n \r\n final Move lastMove = this.getLastMoveNull();\r\n if (lastMove == null) {\r\n this.addMessages(\"-3000-AI: using default move, last move null\");\r\n // Revert back to the default move\r\n super.makeLogicMove();\r\n return;\r\n }\r\n \r\n final Move north = lastMove.decy();\r\n final Move south = lastMove.incy();\r\n final Move east = lastMove.incx();\r\n final Move west = lastMove.decx();\r\n \r\n final LinkedHashMap<Double, Move> map = new LinkedHashMap<Double, Move>();\r\n map.put(new Double(scores.getScoreNorth()), north);\r\n map.put(new Double(scores.getScoreSouth()), south);\r\n map.put(new Double(scores.getScoreEast()), east);\r\n map.put(new Double(scores.getScoreWest()), west);\r\n final LinkedHashMap<Double, Move> scoreMap = BotUtilityMap.sortMapByKey(map);\r\n \r\n if (this.getVerbose()) {\r\n System.err.println(scoreMap);\r\n }\r\n \r\n final boolean validScoreCheck = this.makeLogicMoveAIValidateScores(scoreMap);\r\n if (!validScoreCheck) {\r\n // If on the valid case, the move has already been made \r\n super.makeLogicMove();\r\n return;\r\n } // End of if //\r\n }",
"private void moveForwards() {\n\t\tposition = MoveAlgorithmExecutor.getAlgorithmFromCondition(orientation).execute(position);\n\t\t\n\t\t// Extracted the condition to check if tractor is in Ditch\n\t\tif(isTractorInDitch()){\n\t\t\tthrow new TractorInDitchException();\n\t\t}\n\t}",
"public void move() {\n\t\tsetHealth(getHealth() - 1);\n\t\t//status();\n\t\tint row = getPosition().getRow() ;\n\t\tint column = getPosition().getColumn();\n\t\tint randomInt = (int)((Math.random()*2) - 1);\n\t\t\n\t\tif(hunter == false && row < 33) {\n\t\t\tif(row == 32) {\n\t\t\t\tgetPosition().setCoordinates(row -1 , randomInt);\n\t\t\t\tsetPosition(getPosition()) ;\n\t\t\t}\n\t\t\tif(row == 0) {\n\t\t\t\tgetPosition().setCoordinates(row + 1 , randomInt);\n\t\t\t\tsetPosition(getPosition()) ;\n\t\t\t}\n\t\t\tif(column == 99) {\n\t\t\t\tgetPosition().setCoordinates(randomInt , column - 1);\n\t\t\t\tsetPosition(getPosition()) ;\n\t\t\t}\n\t\t\tif(column == 0) {\n\t\t\t\tgetPosition().setCoordinates(randomInt , column + 1);\n\t\t\t\tsetPosition(getPosition()) ;\n\t\t\t}\n\t\t}\n\t\tif(hunter == false && row > 32) {\n\t\t\t//setHealth(100);\n\t\t\tgetPosition().setCoordinates(row -1 , randomInt);\n\t\t\tsetPosition(getPosition()) ;\n\t\t}\n\t\telse {\n\t\t\tif(row < 65 && hunter == true) {\n\t\t\t\tgetPosition().setCoordinates(row + 1, column);\n\t\t\t\tsetPosition(getPosition()) ;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgetPosition().setCoordinates(65, column);\n\t\t\t\tsetPosition(getPosition());\n\t\t\t\t//Check if there is a gazelle\n\t\t\t\tPair [][] range = {{Drawer.pairs[row+1][column-1],Drawer.pairs[row+1][column],\n\t\t\t\t\t\t\t Drawer.pairs[row+1][column+1]}, {\n\t\t\t\t\t\t\t Drawer.pairs[row+2][column-1],\n\t\t\t\t\t\t\t Drawer.pairs[row+2][column],Drawer.pairs[row+2][column+1]}};\n\t\t\t\t\n\t\t\t\tfor(Pair [] line: range) {\n\t\t\t\t\tfor(Pair prey: line) {\n\t\t\t\t\t\tif(prey.getAnimal() instanceof Gazelle ) {\n\t\t\t\t\t\t\tattack();\n\t\t\t\t\t\t\tprey.getAnimal().die();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}"
] | [
"0.6661239",
"0.6470996",
"0.6424009",
"0.63251394",
"0.6313694",
"0.6265652",
"0.6261051",
"0.6251393",
"0.6235675",
"0.62053263",
"0.61391884",
"0.6129989",
"0.61154735",
"0.6113722",
"0.60952187",
"0.60868067",
"0.6070527",
"0.60011023",
"0.5993102",
"0.59905195",
"0.5976132",
"0.5971771",
"0.59705675",
"0.5968968",
"0.5968966",
"0.5967061",
"0.5966406",
"0.5966248",
"0.5965853",
"0.5964538",
"0.59438413",
"0.5943642",
"0.5943083",
"0.5943083",
"0.5938032",
"0.5933465",
"0.5930142",
"0.5916074",
"0.5911536",
"0.59021455",
"0.59005564",
"0.58926034",
"0.58921874",
"0.58648425",
"0.58416873",
"0.58416873",
"0.58416873",
"0.58416873",
"0.58416873",
"0.58416873",
"0.58416873",
"0.5839555",
"0.5836113",
"0.583384",
"0.58318454",
"0.5824186",
"0.58215976",
"0.5821025",
"0.5811942",
"0.5811448",
"0.5797761",
"0.5792686",
"0.5788505",
"0.5776794",
"0.57603276",
"0.57585883",
"0.57509774",
"0.57466656",
"0.574656",
"0.5744411",
"0.57346636",
"0.573392",
"0.5733267",
"0.5716861",
"0.57127595",
"0.57038456",
"0.5700062",
"0.5699888",
"0.56972903",
"0.56942815",
"0.56890774",
"0.56880385",
"0.56829524",
"0.5682845",
"0.5671251",
"0.5667232",
"0.56658083",
"0.5664028",
"0.5662016",
"0.56554896",
"0.56554806",
"0.56507486",
"0.5649262",
"0.56465226",
"0.5644942",
"0.56437427",
"0.5640415",
"0.5637069",
"0.5635202",
"0.56347203"
] | 0.7187081 | 0 |
Gives the next hypothetical position of the Move | String computeNextLawnPosition(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected int getMove() \t\t\t\t{\treturn move;\t\t}",
"protected int getMove(){\r\n\t\treturn this.move;\r\n\t}",
"public double getDirectionMove();",
"@Override\n\tpublic Direction getMove() {\n\t\t//Equal probability for each of the 8 compass direction, as well as staying stationary\n\t\treturn choices[this.random.nextInt(9)];\n\t}",
"@Override\n\tpublic Direction getMove() {\n if (ticks < MAX_TICKS_PER_ROUND - 100) {\n Direction[] dirs = Direction.values();\n return dirs[random.nextInt(dirs.length)];\n } else {\n // Move towards boat\n int deltaX = 0;\n int deltaY = 0;\n if (currentLocation.getX() < 0)\n deltaX = 1;\n else if (currentLocation.getX() > 0)\n deltaX = -1;\n\n if (currentLocation.getY() < 0)\n deltaY = 1;\n else if (currentLocation.getY() > 0)\n deltaY = -1;\n\n if (deltaX > 0 && deltaY == 0) {\n return Direction.E;\n } else if (deltaX > 0 && deltaY > 0) {\n return Direction.NE;\n } else if (deltaX > 0 && deltaY < 0) {\n return Direction.SE;\n } else if (deltaX == 0 && deltaY == 0) {\n return Direction.STAYPUT;\n } else if (deltaX == 0 && deltaY < 0) {\n return Direction.N;\n } else if (deltaX == 0 && deltaY > 0) {\n return Direction.S;\n } else if (deltaX < 0 && deltaY == 0) {\n return Direction.W;\n } else if (deltaX < 0 && deltaY > 0) {\n return Direction.NW;\n } else if (deltaX < 0 && deltaY < 0) {\n return Direction.NE;\n } else {\n throw new RuntimeException(\"I HAVE NO IDEA\");\n }\n }\n\t}",
"public static Image movePoint()\n\t{\n\t\treturn movePoint;\n\t}",
"private void nextPosition()\n\t{\n\t\tdouble playerX = Game.player.getX();\n\t\tdouble playerY = Game.player.getY();\n\t\tdouble diffX = playerX - x;\n\t\tdouble diffY = playerY - y;\n\t\tif(Math.abs(diffX) < 64 && Math.abs(diffY) < 64)\n\t\t{\n\t\t\tclose = true;\n\t\t} \n\t\telse\n\t\t{\n\t\t\tclose = false;\n\t\t}\n\t\tif(close)\n\t\t{\n\t\t\tattackPlayer();\n\t\t} \n\t\telse if(alarm.done())\n\t\t{\n\t\t\tdirection = Math.abs(random.nextInt() % 360) + 1;\n\t\t\talarm.setTime(50);\n\t\t}\n\t\thspd = MathMethods.lengthDirX(speed, direction);\n\t\tvspd = MathMethods.lengthDirY(speed, direction);\n\t\tif(hspd > 0 && !flippedRight)\n\t\t{\n\t\t\tflippedRight = true;\n\t\t\tsetEnemy();\n\t\t} \n\t\telse if(hspd < 0 && flippedRight)\n\t\t{\n\t\t\tflippedRight = false;\n\t\t\tsetEnemy();\n\t\t}\n\t\tmove();\n\t\talarm.tick();\n\t\tshootTimer.tick();\n\t}",
"public Coordinate getMoveTo();",
"MazePoint getExpectedMovementPosition(MazePoint point, Direction dir);",
"public Player nextMove() {\n\t\treturn null;\n\t\t\n\t}",
"public int[] move(){\n double inProb = Math.random();\n if (inProb < .25){\n y--;\n }\n else if (inProb < .5){\n y ++;\n }\n else if (inProb <.75){\n x--;\n }\n else {\n x++;\n }\n int[]loc = new int[2];\n loc[0] = x;\n loc[1] = y;\n \n return loc;\n }",
"public Direction getMove() {\n\n // If 'count' is >= 3, then reset 'value' for next random direction.\n if (this.count >= 3) {\n this.value = this.generator.nextInt(4); // new value\n this.count = 0; // reset count to 0\n }\n \n ++this.count; // increment count for each call\n if (this.value == 0) {\n return Direction.NORTH;\n }\n else if (this.value == 1) {\n return Direction.SOUTH;\n }\n else if (this.value == 2) {\n return Direction.WEST;\n }\n else { // if value == 3\n return Direction.EAST;\n }\n }",
"public void getMove(){\n\t\t\n\t}",
"public int getMove(){\n return this.move;\n }",
"private float getPlayerMove() {\r\n\t\treturn 1.0f / 5;\r\n\t}",
"public WorldPixel move() {\n this.lastMoveDirection = getDirection();\n\n WorldPixel head = getTrail().peekLast();\n int oldX = head.getX();\n int oldY = head.getY();\n\n int newX = oldX + getDirection().getXDelta();\n int newY = oldY + getDirection().getYDelta();\n if (newX < getSector().getWorldXStart() || newX >= getSector().getWorldXEnd()\n || newY < getSector().getWorldYStart() || newY >= getSector().getWorldYEnd())\n return null;\n\n WorldPixel newPos = getWorld().getPixel(newX, newY);\n getTrail().addLast(newPos);\n return newPos;\n }",
"private Position getTestPos1() {\r\n Grid grid = GridBuilder.builder()\r\n .withMaxX(10)\r\n .withMaxY(10)\r\n .withMinY(-20)\r\n .withMinY(-20)\r\n .build();\r\n Moveable moveable = MoveableBuilder.builder()\r\n .withGrid(grid)\r\n .withShape(PositionShapeBuilder.builder()\r\n .withPosition(Positions.of(Directions.S, 0, 0, 0))\r\n .build())\r\n .withVelocity(100)\r\n .build();\r\n moveable.moveForward();\r\n moveable.turnRight();\r\n moveable = MoveableBuilder.builder()\r\n .withGrid(grid)\r\n .withShape(PositionShapeBuilder.builder()\r\n .withPosition(moveable.getPosition())\r\n .build())\r\n .withVelocity(50)\r\n .build();\r\n moveable.moveForward();\r\n PositionImpl position = (PositionImpl) moveable.getPosition();\r\n moveable.makeTurn(position.calcAbsoluteAngle() - position.getDirection().getAngle());\r\n return moveable.getPosition();\r\n }",
"int getMove2Value();",
"public String getMove() {\n\t\treturn move;\n\t}",
"public Position getResultPosition(Move move)\n {\n return new TAPosition(position-(int)move.getMove());\n }",
"public Position getNextMove(TicTacToeBoard state) throws Exception {\r\n\t\treturn getRandomMove(state);\r\n\t}",
"public Coordinate getNextMove() {\n\n if (targetMode && salvationMode == false) {\n\n Coordinate bestNextTarget;\n\n if (!fixedDirection) { // direction is not known\n\n int maxCount = 0;\n bestNextTarget = this.previousTarget;\n\n // find the best target around the last target //\n\n if (inBound(this.axis.y + 1, this.axis.x)) {\n maxCount = countGrid[this.axis.y + 1][this.axis.x];\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y + 1);\n direction = 0; // north by default\n }\n\n if (inBound(this.axis.y - 1, this.axis.x)) {\n if (countGrid[this.axis.y - 1][this.axis.x] > maxCount) {\n maxCount = countGrid[this.axis.y - 1][this.axis.x];\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y - 1);\n direction = 2;\n }\n }\n\n if (inBound(this.axis.y, this.axis.x + 1)) { // try east\n if (countGrid[this.axis.y][this.axis.x + 1] > maxCount) {\n maxCount = countGrid[this.axis.y][this.axis.x + 1];\n bestNextTarget = new Coordinate(this.axis.x + 1, this.axis.y);\n direction = 1;\n }\n }\n\n if (inBound(this.axis.y, this.axis.x - 1)) { // try west\n if (countGrid[this.axis.y][this.axis.x - 1] > maxCount) {\n maxCount = countGrid[this.axis.y][this.axis.x - 1];\n bestNextTarget = new Coordinate(this.axis.x - 1, this.axis.y);\n direction = 3;\n }\n }\n\n seekAgain = false;\n\n } else { // direction is known\n\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y);\n\n if (direction == 0) { // north\n if (inBound(this.axis.y + distanceFromHit, this.axis.x)) {\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y + distanceFromHit);\n } else { // else go south\n distanceFromHit = 1;\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y - distanceFromHit);\n direction = 2;\n }\n\n } else if (direction == 1) { // east\n if (inBound(this.axis.y, this.axis.x + distanceFromHit)) {\n bestNextTarget = new Coordinate(this.axis.x + distanceFromHit, this.axis.y);\n } else { // else go west\n distanceFromHit = 1;\n bestNextTarget = new Coordinate(this.axis.x - distanceFromHit, this.axis.y);\n direction = 3;\n }\n\n } else if (direction == 2) { // south\n if (inBound(this.axis.y - distanceFromHit, this.axis.x)) {\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y - distanceFromHit);\n } else { // else go north\n distanceFromHit = 1;\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y + distanceFromHit);\n direction = 0;\n }\n\n } else if (direction == 3) { // west\n if (inBound(this.axis.y, this.axis.x - distanceFromHit)) {\n bestNextTarget = new Coordinate(this.axis.x - distanceFromHit, this.axis.y);\n } else { // else go east\n distanceFromHit = 1;\n bestNextTarget = new Coordinate(this.axis.x + distanceFromHit, this.axis.y);\n direction = 1;\n }\n }\n }\n\n this.previousTarget = bestNextTarget;\n\n } else {\n this.previousTarget = getGlobalHighestCount();\n }\n\n toExclude.add(new Coordinate(this.previousTarget.y, this.previousTarget.x));\n\n this.countGrid[this.previousTarget.y][this.previousTarget.x] = 0;\n\n return this.previousTarget;\n }",
"public int getWhoseMove() {\n\t\treturn playerToMove;\n\t}",
"@Override\n public void calculateMove() {\n int xa = 0, ya = 0;\n if (steps <= 0) {\n direction = ep.calculateDirection();\n steps = MAX_STEPS;\n }\n if (direction == 0) {\n ya--;\n }\n if (direction == 2) {\n ya++;\n }\n if (direction == 3) {\n xa--;\n }\n if (direction == 1) {\n xa++;\n }\n if (canMove(xa, ya)) {\n steps -= 1 + rest;\n move(xa * speed, ya * speed);\n moving = true;\n } else {\n steps = 0;\n moving = false;\n }\n }",
"int getMove1Value();",
"private void getNextPosition() {\n \n if (turnLeft) {\n angleSpeed += angleMoveSpeed;\n if (angleSpeed > maxAngleSpeed) {\n angleSpeed = maxAngleSpeed;\n }\n angle += angleSpeed;\n \n if (angle > 360) {\n angle = angle - 360 + angleSpeed;\n }\n \n if (forward)\n {\n speed += moveSpeed;\n if (speed > maxSpeed)\n {\n speed = maxSpeed;\n }\n } else if (backwards)\n {\n speed -= moveSpeed;\n if (speed < -maxSpeed)\n {\n speed = -maxSpeed;\n }\n }\n }\n //moving in negative x direction\n if (turnRight) {\n angleSpeed -= angleMoveSpeed;\n if (angleSpeed < -maxAngleSpeed) {\n angleSpeed = -maxAngleSpeed;\n }\n angle += angleSpeed;\n \n if (angle < -360) {\n angle = angle + 360 - angleSpeed;\n }\n \n if (backwards)\n {\n speed -= moveSpeed;\n if (speed < -maxSpeed)\n {\n speed = -maxSpeed;\n }\n } else if (forward)\n {\n speed += moveSpeed;\n if (speed > maxSpeed)\n {\n speed = maxSpeed;\n }\n }\n }\n \n //moving in positive y direction\n if (backwards) {\n speed += moveSpeed;\n if (speed > maxSpeed) {\n speed = maxSpeed;\n }\n }\n //moving in negative y direction\n if (forward) {\n speed -= moveSpeed;\n if (speed < -maxSpeed) {\n speed = -maxSpeed;\n }\n }\n \n //not moving forward or backwards direction\n if (isNotMoving()) {\n //stop moving in the x direction\n if (speed > 0) {\n speed -= stopSpeed;\n if (speed < 0) {\n speed = 0;\n }\n }\n else if (speed < 0) {\n speed += stopSpeed;\n if (speed > 0) {\n speed = 0;\n }\n }\n \n if (isNotTurning()) {\n //stop moving in the y direction\n if (angleSpeed > 0) {\n angleSpeed -= stopSpeed;\n if (angleSpeed < 0) {\n angleSpeed = 0;\n }\n }\n else if (angleSpeed < 0) {\n angleSpeed += stopSpeed;\n if (angleSpeed > 0) {\n angleSpeed = 0;\n }\n }\n } \n }\n }",
"private Action doNextMove(Action move){\n\t\t// update east or north\n\t\tif (move == Action.East){\n\t\t\teast++;\n\t\t} else if (move == Action.West){\n\t\t\teast--;\n\t\t} else if (move == Action.North){\n\t\t\tnorth++;\n\t\t} else if (move == Action.South){\n\t\t\tnorth--;\n\t\t}\n\t\treturn move;\n\t}",
"public abstract int makeMove();",
"@Override\n public Point peekNextPosition() {\n int nextX = (current.x + 1) % 3;\n int nextY = (current.y + 1) % 3;\n// System.out.println(\"Next X: \" + nextX);\n// System.out.println(\"Next Y: \" + nextY);\n boolean wrapsInX = nextX < current.x;\n boolean wrapsInY = nextY < current.y;\n boolean singleWrap = wrapsInX != wrapsInY;\n if (singleWrap) {\n return invalidPosition();\n } else {\n return new Point(nextX, nextY);\n }\n }",
"public Direction getMove(){\n\t\tif (diam < 3){\n\t\t\tdiam++;\n\t\t\tjustnow = \"east\";\n\t\t\treturn Direction.EAST;\n\t\t}\n\t\telse if (diam < 6){\n\t\t\tdiam++;\n\t\t\tjustnow = \"south\";\n\t\t\treturn Direction.SOUTH;\n\t\t}\n\t\telse if (diam < 9){\n\t\t\tdiam++;\n\t\t\tjustnow = \"west\";\n\t\t\treturn Direction.WEST;\n\t\t}\n\t\telse if (diam < 12){\n\t\t\tdiam++;\n\t\t\tjustnow = \"north\";\n\t\t\treturn Direction.NORTH;\n\t\t}\n\t\telse {\n\t\t\tdiam = 0;\n\t\t\tdiam++;\n\t\t\tjustnow = \"east\";\n\t\t\treturn Direction.EAST;\n\t\t}\t\n\t}",
"public float getTimeToMove()\n\t{\n\t\treturn this.timeToMove;\n\t}",
"int chooseMove();",
"@Override\r\n\t// Precondition: During testing the AI is associated with the 'O', the odd number move.\r\n \tpublic Point desiredMove(TicTacToeGame theGame) {\n\t\t\r\n\t\tchar[][] board = theGame.getTicTacToeBoard();\r\n\t\tPoint dPoint;\r\n\t //check for win\r\n\t\tdPoint = winOrBlock(board,'O');\r\n\t\tif(dPoint != null) {\r\n\t\t\tSystem.out.println(\"winning\");\r\n\t\t\treturn dPoint;\r\n\t\t}\r\n\t\t//check for block\r\n\t\tdPoint = winOrBlock(board,'X');\r\n\t\tif(dPoint != null) {\r\n\t\t\tSystem.out.println(\"blocking\");\r\n\t\t\treturn dPoint;\r\n\t\t}\r\n\t\t//otherwise pick random loc\r\n\t\tRandom randy = new Random(); \r\n\t int randX = randy.nextInt(3);\r\n\t int randY = randy.nextInt(3);\r\n\t while(!theGame.available(randX, randY)) {\r\n\t \trandX = randy.nextInt(3);\r\n\t \trandY = randy.nextInt(3);\r\n\t }\r\n\t System.out.println(\"random\");\r\n\t return new Point(randX, randY);\r\n\t}",
"Square getCurrentPosition();",
"public char makeMove(Coordinate move);",
"Move getBestMove() {\n //System.out.println(\"AI chooses: \" + m.toString());\n return moves.get((int) (Math.random() * moves.size()));\n }",
"public int getMovectr() {\n\t\t\n\t\treturn moveCtr;\n\t}",
"private static Image getMovePoint()\n\t{\n\t\ttry {\n\t\t\treturn ImageIO.read(new File(guiDirectory + move));\n\t\t} catch (IOException ioe) {\n\t\t}\n\t\treturn null;\n\t}",
"Tile getPosition();",
"public void doNextMove(Player player) {\r\n int newX = xCoord;\r\n int newY = yCoord;\r\n switch (currentDirection) {\r\n case 1:\r\n newX = xCoord + 1;\r\n break;\r\n case 2:\r\n newY = yCoord + 1;\r\n break;\r\n case -1:\r\n newX = xCoord - 1;\r\n break;\r\n case -2:\r\n newY = yCoord - 1;\r\n break;\r\n }\r\n if (checkValidMove(newX, newY)) {\r\n // System.out.println(xCoord + \" \" + yCoord);\r\n // System.out.println(newX + \" \" + newY);\r\n moveTo(newX, newY);\r\n // System.out.println(xCoord + \" \" + yCoord);\r\n\r\n } else {\r\n turnAround();\r\n doNextMove(player);\r\n }\r\n }",
"public abstract Point move(Point position);",
"public SinglePieceMove getMove() {\n return move;\n }",
"public String getNextMove() {\n int randomIndex = randomizer.generateRandomInt(this.nextMoves.size() - 1);\n System.out.println(\"random = \" + randomIndex + \", max = \" + (nextMoves.size() - 1));\n this.indexSelected = randomIndex;\n return this.nextMoves.get(randomIndex);\n }",
"void move() {\r\n\t\tif (x + xa < 0){\r\n\t\t\txa = mov;\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\telse if (x + xa > game.getWidth() - diameter){\r\n\t\t\txa = -mov;\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\tif (y + ya < 0){\r\n\t\t\tya = mov;\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\telse if (y + ya > game.getHeight() - diameter){\r\n\t\t\tgame.gameOver();\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\tif (colisionPalas()){\r\n\t\t\tya = -mov;\r\n\t\t}\r\n\t\telse if(colisionEstorbos()){\r\n\t\t\tgame.puntuacion+=2;\r\n\t\t}\r\n\t\t\r\n\t\tx = x + xa;\r\n\t\ty = y + ya;\r\n\t}",
"@Override\n\tpublic Lista<Coordenada> getNextMovements() {\n\n\t\tLista<Coordenada> lista = new Lista<Coordenada>();\n\n\t\taddCoordenada(posicion.up(), lista);\n\t\taddCoordenada(posicion.right(), lista);\n\t\taddCoordenada(posicion.down(), lista);\n\t\taddCoordenada(posicion.left(), lista);\n\t\taddCoordenada(posicion.diagonalUpRight(), lista);\n\t\taddCoordenada(posicion.diagonalUpLeft(), lista);\n\t\taddCoordenada(posicion.diagonalDownRight(), lista);\n\t\taddCoordenada(posicion.diagonalDownLeft(), lista);\n\n\t\treturn lista;\n\t}",
"public abstract Position nextPosition(Position position);",
"private void nextPiece() {\n if (_c == M && _r <= M) {\n _c = 1;\n _r++;\n } else if (_r > M) {\n _move = null;\n } else {\n _c++;\n }\n }",
"public int getComputerMove()\n {\n int move;\n\n // First see if there's a move O can make to win\n for (int i = 0; i < BOARD_SIZE; i++) {\n if (mBoard[i] != HUMAN_PLAYER && mBoard[i] != COMPUTER_PLAYER) {\n char curr = mBoard[i];\n mBoard[i] = COMPUTER_PLAYER;\n if (checkForWinner() == 3) {\n mBoard[i] = curr;\n return i;\n }\n else\n mBoard[i] = curr;\n }\n }\n\n // See if there's a move O can make to block X from winning\n for (int i = 0; i < BOARD_SIZE; i++) {\n if (mBoard[i] != HUMAN_PLAYER && mBoard[i] != COMPUTER_PLAYER) {\n char curr = mBoard[i]; // Save the current number\n mBoard[i] = HUMAN_PLAYER;\n if (checkForWinner() == 2) {\n //mBoard[i] = COMPUTER_PLAYER;\n mBoard[i] = curr;\n return i;\n }\n else\n mBoard[i] = curr;\n }\n }\n\n // Generate random move\n do\n {\n move = mRand.nextInt(BOARD_SIZE);\n } while (mBoard[move] == HUMAN_PLAYER || mBoard[move] == COMPUTER_PLAYER);\n\n return move;\n }",
"public void move(int distance);",
"public int getComMove() {\n\n int move;\n\n // Checks if a computer played a move in that spot\n for (int i = 0; i < getBoardSize(); i++) {\n if (playBoard[i] != REAL_PLAYER && playBoard[i] != COM_PLAYER) {\n char currPlace = playBoard[i];\n playBoard[i] = COM_PLAYER;\n\n if (winCheck() == 3) {\n setMove(COM_PLAYER, i);\n return i;\n }\n else {\n playBoard[i] = currPlace;\n }\n }\n }\n\n // Check to block human player from winning\n for (int i = 0; i < getBoardSize(); i++) {\n if (playBoard[i] != REAL_PLAYER && playBoard[i] != COM_PLAYER) {\n char currPlace = playBoard[i];\n playBoard[i] = REAL_PLAYER;\n\n if (winCheck() == 2) {\n setMove(COM_PLAYER, i);\n return i;\n }\n else {\n playBoard[i] = currPlace;\n }\n }\n }\n\n // If play spot is empty, then make move\n do {\n move = randMove.nextInt(getBoardSize());\n } while (playBoard[move] == REAL_PLAYER || playBoard[move] == COM_PLAYER);\n setMove(COM_PLAYER, move);\n\n return move;\n }",
"public PlayerPosition getNext() {\n\n\t\tswitch (this) {\n\t\t\tcase BOTTOM:\n\t\t\t\treturn LEFT;\n\t\t\tcase LEFT:\n\t\t\t\treturn TOP;\n\t\t\tcase TOP:\n\t\t\t\treturn RIGHT;\n\t\t\tcase RIGHT:\n\t\t\t\treturn BOTTOM;\n\t\t\tdefault:\n\t\t\t\t// must not happen\n\t\t\t\treturn null;\n\t\t}\n\t}",
"int getPosition();",
"public void move() {\n if (this.nextMove.equals(\"a\")) { // move down\n this.row = row + 1;\n progress += 1;\n if (progress == steps) {\n nextMove = \"b\";\n progress = 0;\n }\n } else if (this.nextMove.equals(\"b\")) { // move right\n this.col = col + 1;\n progress += 1;\n if (progress == steps) {\n nextMove = \"c\";\n progress = 0;\n }\n } else if (this.nextMove.equals(\"c\")) { // move up\n this.row = row - 1;\n progress += 1;\n if (progress == steps) {\n nextMove = \"a\";\n progress = 0;\n }\n }\n }",
"public Position findWeed() {\n int xVec =0;\n int yVec=0;\n int sum = 0;\n Position move = new Position(0, 0);\n for (int i = 0; i < this.WORLD.getMapSize().getX(); i++) {\n for (int j = 0; j < this.WORLD.getMapSize().getY(); j++) {\n\n //hogweed\n Organism organism = this.WORLD.getOrganism(i, j);\n if(organism!=null){\n Class c = organism.getClass();\n if (c.getSimpleName().equals(\"Parnsip\")) {\n int tmpX = Math.abs(this.position.getX() - i);\n int tmpY = Math.abs(this.position.getY() - j);\n if (!(xVec == 0 && yVec == 0)) {\n int tmpSum = tmpX + tmpY;\n if (sum > tmpSum) {\n xVec=tmpX;\n yVec=tmpY;\n sum = tmpSum;\n this.setMove(move, j, i);\n }\n }\n else {\n xVec=tmpX;\n yVec=tmpY;\n sum = tmpX + tmpY;\n this.setMove(move, j, i);\n }\n }\n }\n\n }\n }\n return move;\n }",
"Move getMove() {\n try {\n boolean playing0 = _playing;\n while (_playing == playing0) {\n prompt();\n\n String line = _input.readLine();\n if (line == null) {\n quit();\n }\n line = line.trim();\n if (!processCommand(line)) {\n Move move = Move.create(line, _board);\n if (move == null) {\n error(\"invalid move: %s%n\", line);\n } else if (!_playing) {\n error(\"game not started\");\n } else if (!_board.isLegal(move)) {\n error(\"illegal move: %s%n\", line);\n } else {\n return move;\n }\n }\n }\n } catch (IOException excp) {\n error(1, \"unexpected I/O error on input\");\n }\n return null;\n }",
"@Test\n public void testMove() {\n Point Left_1_North = Day1.move(\"L\", 1, new Point(0, 0), \"NORTH\");\n assertEquals(new Point(-1, 0), Left_1_North);\n\n Point Left_1_South = Day1.move(\"L\", 1, new Point(0, 0), \"SOUTH\");\n assertEquals(new Point(1, 0), Left_1_South);\n\n Point Left_1_East = Day1.move(\"L\", 1, new Point(0, 0), \"EAST\");\n assertEquals(new Point(0, 1), Left_1_East);\n\n Point Left_1_West = Day1.move(\"L\", 1, new Point(0, 0), \"WEST\");\n assertEquals(new Point(0, -1), Left_1_West);\n\n //turn right when facing North, South, East and West\n Point Right_1_North = Day1.move(\"R\", 1, new Point(0, 0), \"NORTH\");\n assertEquals(new Point(1, 0), Right_1_North);\n\n Point Right_1_South = Day1.move(\"R\", 1, new Point(0, 0), \"SOUTH\");\n assertEquals(new Point(-1, 0), Right_1_South);\n\n Point Right_1_East = Day1.move(\"R\", 1, new Point(0, 0), \"EAST\");\n assertEquals(new Point(0, -1), Right_1_East);\n\n Point Right_1_West = Day1.move(\"R\", 1, new Point(0, 0), \"WEST\");\n assertEquals(new Point(0, 1), Right_1_West);\n\n //wrong Input, return current point\n Point wrong = Day1.move(\"A\", 1, new Point(0, 0), \"B\");\n assertEquals(new Point(0, 0), wrong);\n\n }",
"public synchronized String Move(Coordinates step) {\n // check if player won't go over the grid\n if (step.getKey() + coord.getKey() < 0 || step.getKey() + coord.getKey() > sizeSide) {\n System.out.println(\"You can't go out of x bounds, retry\");\n return null;\n }\n else if (step.getValue() + coord.getValue() < 0 || step.getValue() + coord.getValue() > sizeSide) {\n System.out.println(\"You can't go out of y bounds, retry\");\n return null;\n }\n else {\n coord = new Coordinates(coord.getKey() + step.getKey(), coord.getValue() + step.getValue());\n return \"ok\";\n }\n }",
"public static Move getMoveFromProposition(Proposition p){\r\n \treturn new Move(p.getName().get(1));\r\n }",
"Object GetMove (Object game_state);",
"Point getPosition();",
"Point getPosition();",
"private void randomMove() {\n }",
"public static int getCoords()\n\t{\n\t\treturn moveCoords;\n\t}",
"public Location computerMove()\n\t{\n\t\tArrayList<Location> possibleLocs = new ArrayList<Location>();\n\t\tfor (int row = 0; row < grid.length; row++)\n\t\t{\n\t\t\tfor (int col = 0; col < grid[0].length; col++)\n\t\t\t{\n\t\t\t\tLocation temp = new Location(row, col);\n\t\t\t\tif (!isOccupied(temp))\n\t\t\t\t\tpossibleLocs.add(temp);\n\t\t\t}\n\t\t}\n\t\tfor (int count = 0; count < possibleLocs.size(); count++)\n\t\t{\n\t\t\tif (checkWin(1, possibleLocs.get(count)))\n\t\t\t\treturn possibleLocs.get(count);\n\t\t\telse if (checkWin(0, possibleLocs.get(count)))\n\t\t\t\treturn possibleLocs.get(count);\n\t\t}\n\t\treturn possibleLocs.get((int) (Math.random() * possibleLocs.size()));\n\t}",
"private int Rand_Move() {\n\t\tRandom r = new Random();\n\t\tint move = NO_MOVE;\n\t\tdo{\n\t\t\tmove = r.nextInt(9);\n\t\t}while(square_empty[move] == false);\n\t\treturn move;\n\t}",
"Object getPosition();",
"protected Direction selectMove() {\n Map<Integer, Direction> positive, negative;\n // Add the directions that contains negative stations in a negative set\n // And every other direction in a positive set\n positive = new HashMap<Integer,Direction>(16);\n negative = new HashMap<Integer,Direction>(16);\n for (Direction d : Direction.directions) {\n int result = checkMove(d);\n if (result == 1) {\n positive.put(positive.size(), d);\n } else if (result == 0) {\n negative.put(negative.size(), d);\n } else {\n continue;\n }\n }\n // If there is no positive move, choose a RANDOM negative move\n if (positive.isEmpty()) {\n return negative.get(rand.nextInt(negative.size()));\n } else { // Otherwise choose a RANDOM positive move\n return positive.get(rand.nextInt(positive.size()));\n }\n }",
"public boolean GetMove();",
"@java.lang.Override public int getMove1Value() {\n return move1_;\n }",
"private String easyMove() {\n int randomHole = evaluate();\n while (!isValidMove(randomHole)) {\n randomHole = evaluate();\n }\n\n return super.makeAMove(randomHole);\n }",
"public int getCurrentMoveIndex() {\n return boardIterator.getPos();\n }",
"public int decideRandomMove() {\n return (int) (Math.random() * 4);\n }",
"public Point nextRoom() {\n Point nr;\n switch (direction) {\n case NORTH:\n nr = new Point(0, -1);\n break;\n case SOUTH:\n nr = new Point(0, 1);\n break;\n case EAST:\n nr = new Point(1, 0);\n break;\n case WEST:\n nr = new Point(-1, 0);\n break;\n default:\n nr = new Point(0, 0);\n break;\n }\n return nr;\n }",
"public Point getNextForecastedPos() {\n return nextPos ;\n }",
"public void makeMove() {\n\t\tif (CheckForVictory(this)) {\n\t\t\t// System.out.println(\"VICTORY\");\n\t\t\tInterface.goalReached = true;\n\t\t\tfor (int i = 0; i < tmpStrings.length; i++) {\n\t\t\t\tif (moveOrder[i] == 0)\n\t\t\t\t\ttmpStrings[i] = \"turn left\";\n\t\t\t\telse if (moveOrder[i] == 1)\n\t\t\t\t\ttmpStrings[i] = \"turn right\";\n\t\t\t\telse\n\t\t\t\t\ttmpStrings[i] = \"go forward\";\n\n\t\t\t\tInterface.info.setText(\"Generation: \" + Parallel.generationNo + 1 + \" and closest distance to goal: \" + 0);\n\t\t\t}\n\t\t} else {\n\t\t\tmoveOrder[this.movesMade] = moves.remove();\n\t\t\tswitch (moveOrder[this.movesMade]) {\n\t\t\tcase (0):\n\t\t\t\tthis.movesMade++;\n\t\t\t\tif (face == 0)\n\t\t\t\t\tface = 3;\n\t\t\t\telse\n\t\t\t\t\tface--;\n\t\t\t\tbreak;\n\t\t\tcase (1):\n\t\t\t\tthis.movesMade++;\n\t\t\t\tif (face == 3)\n\t\t\t\t\tface = 0;\n\t\t\t\telse\n\t\t\t\t\tface++;\n\t\t\t\tbreak;\n\t\t\tcase (2):\n\t\t\t\tthis.movesMade++;\n\t\t\t\tif (face == 0 && Y - 1 >= 0)\n\t\t\t\t\tY--;\n\t\t\t\telse if (face == 1 && X + 1 <= map[0].length - 1)\n\t\t\t\t\tX++;\n\t\t\t\telse if (face == 2 && Y + 1 <= map.length - 1)\n\t\t\t\t\tY++;\n\t\t\t\telse if (face == 3 && X - 1 >= 0)\n\t\t\t\t\tX--;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"Error making move :(\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"@java.lang.Override public int getMove1Value() {\n return move1_;\n }",
"public void move(Point p);",
"public void compNextMove(){\r\n int flatNextMove;\r\n\r\n /* transfer the matrix to an array */\r\n Sign[] flatBoard = flattenBoard();\r\n\r\n /* choose best next move according to difficulty */\r\n flatNextMove = CompPlayer.nextMove(flatBoard,moves,playerSign,difficulty);\r\n\r\n /* set the sign in the correct place in the matrix */\r\n for (int i=0;i<3;i++)\r\n for (int j=0;j<3;j++){\r\n flatNextMove--;\r\n if (flatNextMove == 0)\r\n setSign(i,j,compSign);\r\n }\r\n }",
"void move(int steps);",
"public ArrayList<Coordinate> getPossibleMoveCoordinate() {\n ChessBoard board = this.getChessBoard(); // get chess board\n ArrayList<Coordinate> coords = new ArrayList<Coordinate>(); // create return ArrayList\n int x, y;\n /*\n several cases\n 2 3\n 1 4\n\n 5 8\n 6 7\n\n */\n // case1\n x = this.x_coordinate - 2;\n y = this.y_coordinate + 1;\n if(x >= 0 && y < board.getHeight()){\n addToCoordinatesIfValid(coords, x, y); // add to coords if the piece can move to that coordinate\n }\n // case2\n x = this.x_coordinate - 1;\n y = this.y_coordinate + 2;\n if(x >= 0 && y < board.getHeight()){\n addToCoordinatesIfValid(coords, x, y); // add to coords if the piece can move to that coordinate\n }\n // case3\n x = this.x_coordinate + 1;\n y = this.y_coordinate + 2;\n if(x < board.getWidth() && y < board.getHeight()){\n addToCoordinatesIfValid(coords, x, y); // add to coords if the piece can move to that coordinate\n }\n // case4\n x = this.x_coordinate + 2;\n y = this.y_coordinate + 1;\n if(x < board.getWidth() && y < board.getHeight()){\n addToCoordinatesIfValid(coords, x, y); // add to coords if the piece can move to that coordinate\n }\n // case5\n x = this.x_coordinate - 2;\n y = this.y_coordinate - 1;\n if(x >= 0 && y >= 0 ){\n addToCoordinatesIfValid(coords, x, y); // add to coords if the piece can move to that coordinate\n }\n // case6\n x = this.x_coordinate - 1;\n y = this.y_coordinate - 2;\n if(x >= 0 && y >= 0){\n addToCoordinatesIfValid(coords, x, y); // add to coords if the piece can move to that coordinate\n }\n // case7\n x = this.x_coordinate + 1;\n y = this.y_coordinate - 2;\n if(x < board.getWidth() && y >= 0){\n addToCoordinatesIfValid(coords, x, y); // add to coords if the piece can move to that coordinate\n }\n // case1\n x = this.x_coordinate + 2;\n y = this.y_coordinate - 1;\n if(x < board.getWidth() && y >= 0){\n addToCoordinatesIfValid(coords, x, y); // add to coords if the piece can move to that coordinate\n }\n\n\n return coords;\n }",
"private Loc nextPoint(Loc l, String direction) {\n\t\tif (direction.equals(\"down\")) {\n\t\t\t// Is at bottom?\n\t\t\t// System.out.println(\"p.getx= \" + l.row);\n\t\t\tif (l.row >= matrixHeight - 1) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn new Loc(l.row + 1, l.col);\n\t\t} else if (direction.equals(\"left\")) {\n\t\t\tif (l.col <= 0) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn new Loc(l.row, l.col - 1);\n\t\t} else { // right\n\t\t\tif (l.col >= matrixWidth - 1) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn new Loc(l.row, l.col + 1);\n\t\t}\n\t}",
"@Override\n\tpublic Direction nextMove(State state)\n\t{\n\t\t\n\t\tthis.direction = Direction.STAY;\n\t\tthis.hero = state.hero();\n\t\tthis.position = new Point( this.hero.position.right, this.hero.position.left ); //x and y are reversed, really\n\t\t\n\t\tthis.pathMap = new PathMap( state, this.position.x, this.position.y );\n\n\t\t//find the richest hero\n\t\tHero richestHero = state.game.heroes.get(0);\n\t\tif( richestHero == this.hero ) { richestHero = state.game.heroes.get(1); } //just grab another hero if we are #0\n\t\t\n\t\tfor( Hero hero : state.game.heroes )\n\t\t{\n\t\t\tif( hero != this.hero && hero.gold > richestHero.gold )\n\t\t\t{\n\t\t\t\trichestHero = hero;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//get all interesting sites\n\t\tList<TileInfo> minesInRange = this.pathMap.getSitesInRange( TileType.FREE_MINE, 20 );\t//mines in vicinity\n\t\tList<TileInfo> takenMinesInRange = this.pathMap.getSitesInRange( TileType.TAKEN_MINE, (100-richestHero.life)/2 );\t//mines in vicinity\n\t\tList<TileInfo> pubsInRange = this.pathMap.getSitesInRange( TileType.TAVERN, (int)(Math.pow(100-this.hero.life,2)*state.game.board.size/5000) );\t\t//pubs in vicinity\n\t\t\n\t\t//first visit pubs (apparently we need it)\n\t\tif( pubsInRange.size() != 0 )\n\t\t{\n\t\t\tthis.direction = this.pathMap.getDirectionTo( pubsInRange.get(0) );\n\t\t}\n\t\t\n\t\t//then visit the mines\n\t\telse if( minesInRange.size() != 0 )\n\t\t{\n\t\t\tthis.direction = this.pathMap.getDirectionTo( minesInRange.get(0) );\n\t\t}\n\t\t\n\t\t//then visit taken mines\n\t\telse if( takenMinesInRange.size() != 0 )\n\t\t{\n\t\t\tthis.direction = this.pathMap.getDirectionTo( takenMinesInRange.get(0) );\n\t\t}\n\t\t\n\t\t//then hunt for players\n\t\telse\n\t\t{\n\t\t\t//kill the richest hero! (but first full health)\n\t\t\tif( this.hero.life > 85 )\n\t\t\t{\n\t\t\t\tthis.direction = this.pathMap.getDirectionTo( richestHero.position.right, richestHero.position.left );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//run away!!!\n\t\t\t\tthis.direction = intToDir( (int)(Math.random()*4) );\n\t\t\t}\n\t\t}\n\t\t\n\t\t//VisualPathMap.getInstance( pathMap );\n\t\t\n\t\treturn this.direction;\n\t}",
"public int TakeStep()\n\t\t{\n\t\t// the eventual movement command is placed here\n\t\tVec2\tresult = new Vec2(0,0);\n\n\t\t// get the current time for timestamps\n\t\tlong\tcurr_time = abstract_robot.getTime();\n\n\n\t\t/*--- Get some sensor data ---*/\n\t\t// get vector to the ball\n\t\tVec2 ball = abstract_robot.getBall(curr_time);\n\n\t\t// get vector to our and their goal\n\t\tVec2 ourgoal = abstract_robot.getOurGoal(curr_time);\n\t\tVec2 theirgoal = abstract_robot.getOpponentsGoal(curr_time);\n\n\t\t// get a list of the positions of our teammates\n\t\tVec2[] teammates = abstract_robot.getTeammates(curr_time);\n\n\t\t// find the closest teammate\n\t\tVec2 closestteammate = new Vec2(99999,0);\n\t\tfor (int i=0; i< teammates.length; i++)\n\t\t\t{\n\t\t\tif (teammates[i].r < closestteammate.r)\n\t\t\t\tclosestteammate = teammates[i];\n\t\t\t}\n\n\n\t\t/*--- now compute some strategic places to go ---*/\n\t\t// compute a point one robot radius\n\t\t// behind the ball.\n\t\tVec2 kickspot = new Vec2(ball.x, ball.y);\n\t\tkickspot.sub(theirgoal);\n\t\tkickspot.setr(abstract_robot.RADIUS);\n\t\tkickspot.add(ball);\n\n\t\t// compute a point three robot radii\n\t\t// behind the ball.\n\t\tVec2 backspot = new Vec2(ball.x, ball.y);\n\t\tbackspot.sub(theirgoal);\n\t\tbackspot.setr(abstract_robot.RADIUS*5);\n\t\tbackspot.add(ball);\n\n\t\t// compute a north and south spot\n\t\tVec2 northspot = new Vec2(backspot.x,backspot.y+0.7);\n\t\tVec2 southspot = new Vec2(backspot.x,backspot.y-0.7);\n\n\t\t// compute a position between the ball and defended goal\n\t\tVec2 goaliepos = new Vec2(ourgoal.x + ball.x,\n\t\t\t\tourgoal.y + ball.y);\n\t\tgoaliepos.setr(goaliepos.r*0.5);\n\n\t\t// a direction away from the closest teammate.\n\t\tVec2 awayfromclosest = new Vec2(closestteammate.x,\n\t\t\t\tclosestteammate.y);\n\t\tawayfromclosest.sett(awayfromclosest.t + Math.PI);\n\n\n\t\t/*--- go to one of the places depending on player num ---*/\n\t\tint mynum = abstract_robot.getPlayerNumber(curr_time);\n\n\t\t/*--- Goalie ---*/\n\t\tif (mynum == 0)\n\t\t\t{\n\t\t\t// go to the goalie position if far from the ball\n\t\t\tif (ball.r > 0.5) \n\t\t\t\tresult = goaliepos;\n\t\t\t// otherwise go to kick it\n\t\t\telse if (ball.r > 0.1) \n\t\t\t\tresult = kickspot;\n\t\t\telse \n\t\t\t\tresult = ball;\n\t\t\t// keep away from others\n\t\t\tif (closestteammate.r < 0.3)\n\t\t\t\t{\n\t\t\t\tresult = awayfromclosest;\n\t\t\t\t}\n\t\t\t}\n\n\t\t/*--- midback ---*/\n\t\telse if (mynum == 1)\n\t\t\t{\n\t\t\t// go to a midback position if far from the ball\n\t\t\tif (ball.r > 0.5) \n\t\t\t\tresult = backspot;\n\t\t\t// otherwise go to kick it\n\t\t\telse if (ball.r > 0.30) \n\t\t\t\tresult = kickspot;\n\t\t\telse \n\t\t\t\tresult = ball;\n\t\t\t// keep away from others\n\t\t\tif (closestteammate.r < 0.3)\n\t\t\t\t{\n\t\t\t\tresult = awayfromclosest;\n\t\t\t\t}\n\t\t\t}\n\n\t\telse if (mynum == 2)\n\t\t\t{\n\t\t\t// go to a the northspot position if far from the ball\n\t\t\tif (ball.r > 0.5) \n\t\t\t\tresult = northspot;\n\t\t\t// otherwise go to kick it\n\t\t\telse if (ball.r > 0.30) \n\t\t\t\tresult = kickspot;\n\t\t\telse \n\t\t\t\tresult = ball;\n\t\t\t// keep away from others\n\t\t\tif (closestteammate.r < 0.3)\n\t\t\t\t{\n\t\t\t\tresult = awayfromclosest;\n\t\t\t\t}\n\t\t\t}\n\n\t\telse if (mynum == 4)\n\t\t\t{\n\t\t\t// go to a the northspot position if far from the ball\n\t\t\tif (ball.r > 0.5) \n\t\t\t\tresult = southspot;\n\t\t\t// otherwise go to kick it\n\t\t\telse if (ball.r > 0.3 )\n\t\t\t\tresult = kickspot;\n\t\t\telse \n\t\t\t\tresult = ball;\n\t\t\t// keep away from others\n\t\t\tif (closestteammate.r < 0.3)\n\t\t\t\t{\n\t\t\t\tresult = awayfromclosest;\n\t\t\t\t}\n\t\t\t}\n\n\t\t/*---Lead Forward ---*/\n\t\telse if (mynum == 3)\n\t\t\t{\n\t\t\t// if we are more than 4cm away from the ball\n\t\t\tif (ball.r > .3)\n\t\t\t\t// go to a good kicking position\n\t\t\t\tresult = kickspot;\n\t\t\telse\n\t\t\t\t// go to the ball\n\t\t\t\tresult = ball;\n\t\t\t}\n\n\n\t\t/*--- Send commands to actuators ---*/\n\t\t// set the heading\n\t\tabstract_robot.setSteerHeading(curr_time, result.t);\n\n\t\t// set speed at maximum\n\t\tabstract_robot.setSpeed(curr_time, 1.0);\n\n\t\t// kick it if we can\n\t\tif (abstract_robot.canKick(curr_time))\n\t\t\tabstract_robot.kick(curr_time);\n\n\t\t/*--- Send message to other robot ---*/\n\t\t// COMMUNICATION\n\t\t// if I can kick\n\t\tif (abstract_robot.canKick(curr_time))\n\t\t\t{\n\t\t\t// and I am robot #3\n\t\t\tif ((mynum==3))\n\t\t\t\t{\n\t\t\t\t// construct a message\n\t\t\t\tStringMessage m = new StringMessage();\n\t\t\t\tm.val = (new Integer(mynum)).toString();\n\t\t\t\tm.val = m.val.concat(\" can kick\");\n\n\t\t\t\t// send the message to robot 2\n\t\t\t\t// note: broadcast and multicast are also\n\t\t\t\t// available.\n\t\t\t\ttry{abstract_robot.unicast(2,m);}\n\t\t\t\tcatch(CommunicationException e){}\n\t\t\t\t}\n\t\t\t}\n\n\t\t/*--- Look for incoming messages ---*/\n\t\t//COMMUNICATION\n\t\twhile (messagesin.hasMoreElements())\n\t\t\t{\n\t\t\tStringMessage recvd = \n\t\t\t\t(StringMessage)messagesin.nextElement();\n\t\t\tSystem.out.println(mynum + \" received:\\n\" + recvd);\n\t\t\t}\n\n\t\t// tell the parent we're OK\n\t\treturn(CSSTAT_OK);\n\t\t}",
"public synchronized String computeMove() {\n if (game == null) {\n System.err.println(\"CODE ERROR: AI is not attached to a game.\");\n return \"0,0\";\n }\n\n char[] board = (char[]) game.getStateAsObject();\n\n //Choose a smart move if that AI is set to \"Smart\" or if the random value equals 2\n if (aiType == 1) {\n if(useHeat && ((int) (Math.random() * heat)) == 2){\n return \"\" + getRandomMove(board);\n }\n else{\n return \"\" + getSmartMove(board);\n }\n } else {\n return \"\" + getRandomMove(board);\n }\n }",
"int getMove3Value();",
"@Override\n\tpublic GridCell execute() {\n\t\t//1. if there is a winning position, take it\n\t\tArrayList<GridCell> winningCell = TicTacToeBoardExaminer.getWinningPositions(board, side);\n\t\tif (winningCell.size() > 0) {\n\t\t\tGridCell move = winningCell.get(0);\n\t\t\treturn move;\n\t\t}\n\t\t\n\t\t//2. if there is a losing position, block it\n\t\tArrayList<GridCell> losingCell = TicTacToeBoardExaminer.getLosingPositions(board, side);\n\t\tif (losingCell.size() > 0) {\n\t\t\tGridCell move = losingCell.get(0);\n\t\t\treturn move;\n\t\t}\n\t\t\n\t\t//TODO: Implement checking of forks. This will get you to 100% win or tie rate\n\t\t\n\t\t//3. Otherwise get the optimal position\n\t\tGridCell optimal = TicTacToeBoardExaminer.getOptimal(board, side);\n\t\tif (optimal != null)\n\t\t\treturn optimal;\n\t\t\n\t\t//4. Otherwise just move randomly\n\t\telse \n\t\t\treturn new RandomStrategy(board, side).execute();\n\t\t\n\t}",
"public Position go(int dir) {\n\t\tPosition p = new Position(x, y);\n\t\tif (dir == TileGame.UP)\n\t\t\tp.setX(x - 1);\n\t\telse if (dir == TileGame.DOWN)\n\t\t\tp.setX(x + 1);\n\t\telse if (dir == TileGame.LEFT)\n\t\t\tp.setY(y - 1);\n\t\telse if (dir == TileGame.RIGHT)\n\t\t\tp.setY(y + 1);\n\t\treturn p;\n\t}",
"public Move chooseMove() {\n return new Move();\n }",
"public int moves() {\r\n if (!isSolvable) return -1;\r\n return goal.previousMoves;\r\n }",
"public void move(){\n x+=xDirection;\n y+=yDirection;\n }",
"@Override\n public Move makeMove() {\n Random random = new Random();\n int max = this.board.getBoardDimension()*4 - 1;\n int row = random.nextInt(max);\n int col = random.nextInt(max);\n Point point = new Point(row, col);\n\n while (!this.board.validPoint(point)) {\n row = random.nextInt(max);\n col = random.nextInt(max);\n point.setPoint(row, col);\n }\n\n Move m = new Move();\n m.P = this.player;\n m.Row = row;\n m.Col = col;\n\n this.board.update(m);\n return m;\n }",
"Move getMove(String str) {\n String line = str;\n Move move = Move.create(line, _board);\n if (move == null) {\n error(\"invalid move: %s%n\", line);\n } else if (!_playing) {\n error(\"game not started\");\n } else if (!_board.isLegal(move)) {\n error(\"illegal move: %s%n\", line);\n } else {\n return move;\n }\n System.out.println();\n prompt();\n return null;\n }",
"private int forwardPosition() {\n\t\treturn (position + 1) % (maxPosition + 1);\n\t}",
"public void move();",
"public void move();",
"public Move getLastMove() {\n return lastMove;\n }",
"public abstract void makeBestMove();",
"public Coordinate getPosition();",
"public int randomMove()\r\n {\r\n r = new Random();\r\n x = r.nextInt(7);\r\n return x;\r\n }",
"public Point movePoint(){\n\t\tSystem.out.println(\"Enter new zero point for figure\");\n\t\tthis.in = new Scanner(System.in);\n\t\tString temp = in.nextLine();\n\t\tString[] data = temp.trim().split(\" \");\n\t\tint a = Integer.parseInt(data[0]);\n\t\tint\tb = Integer.parseInt(data[1]);\n\t\tPoint p = new Point(a, b);\n\t\treturn p;\n\t}"
] | [
"0.7311436",
"0.71275705",
"0.7116755",
"0.6981374",
"0.69410133",
"0.6863821",
"0.6808249",
"0.6789127",
"0.6756809",
"0.67447156",
"0.67140996",
"0.6687386",
"0.6684431",
"0.6660633",
"0.66284245",
"0.6618953",
"0.6616886",
"0.6602614",
"0.658466",
"0.6580888",
"0.65741616",
"0.6553774",
"0.6545631",
"0.65367913",
"0.6510707",
"0.6478034",
"0.64650226",
"0.6416788",
"0.6413163",
"0.6411241",
"0.63972366",
"0.63962764",
"0.639618",
"0.63946164",
"0.63904667",
"0.63586545",
"0.6346416",
"0.63322544",
"0.6331147",
"0.63272244",
"0.63194966",
"0.63075817",
"0.6284166",
"0.6252895",
"0.6252398",
"0.6235328",
"0.62192535",
"0.6207397",
"0.6194812",
"0.61900884",
"0.61870444",
"0.61829144",
"0.6171178",
"0.61685646",
"0.6166191",
"0.61602557",
"0.6158745",
"0.61547494",
"0.61473703",
"0.61435044",
"0.61435044",
"0.61428934",
"0.6139591",
"0.61383814",
"0.61309725",
"0.61235803",
"0.61041117",
"0.60984904",
"0.6095496",
"0.60914415",
"0.60869855",
"0.60844874",
"0.6082823",
"0.60747916",
"0.6073144",
"0.6072894",
"0.6069559",
"0.60682213",
"0.6062982",
"0.60574424",
"0.60543823",
"0.60511804",
"0.6048353",
"0.60426694",
"0.60421705",
"0.603988",
"0.60350823",
"0.6032091",
"0.60301685",
"0.60268795",
"0.6026394",
"0.60255885",
"0.6021292",
"0.6013168",
"0.6013168",
"0.60034454",
"0.6002592",
"0.6002319",
"0.5997921",
"0.5994859"
] | 0.6643404 | 14 |
Gives the Move position | String getLawnPosition(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected int getMove() \t\t\t\t{\treturn move;\t\t}",
"protected int getMove(){\r\n\t\treturn this.move;\r\n\t}",
"public Coordinate getMoveTo();",
"public String getMove() {\n\t\treturn move;\n\t}",
"public void getMove(){\n\t\t\n\t}",
"public static Image movePoint()\n\t{\n\t\treturn movePoint;\n\t}",
"Position getPosition();",
"Position getPosition();",
"public int getMove(){\n return this.move;\n }",
"public double getDirectionMove();",
"public static int getCoords()\n\t{\n\t\treturn moveCoords;\n\t}",
"public abstract Point move(Point position);",
"Object getPosition();",
"public Position getResultPosition(Move move)\n {\n return new TAPosition(position-(int)move.getMove());\n }",
"public Coordinate getPosition();",
"public abstract void move(Position position);",
"public void move() {\n this.pposX = this.posX;\n this.pposY = this.posY;\n this.posX = newPosX;\n this.posY = newPosY;\n }",
"@Override\n\tpublic void move(int xPos, int yPos) {\n\t}",
"public void move(){\n\t\t\n\t}",
"@Override\n\tpublic Direction getMove() {\n if (ticks < MAX_TICKS_PER_ROUND - 100) {\n Direction[] dirs = Direction.values();\n return dirs[random.nextInt(dirs.length)];\n } else {\n // Move towards boat\n int deltaX = 0;\n int deltaY = 0;\n if (currentLocation.getX() < 0)\n deltaX = 1;\n else if (currentLocation.getX() > 0)\n deltaX = -1;\n\n if (currentLocation.getY() < 0)\n deltaY = 1;\n else if (currentLocation.getY() > 0)\n deltaY = -1;\n\n if (deltaX > 0 && deltaY == 0) {\n return Direction.E;\n } else if (deltaX > 0 && deltaY > 0) {\n return Direction.NE;\n } else if (deltaX > 0 && deltaY < 0) {\n return Direction.SE;\n } else if (deltaX == 0 && deltaY == 0) {\n return Direction.STAYPUT;\n } else if (deltaX == 0 && deltaY < 0) {\n return Direction.N;\n } else if (deltaX == 0 && deltaY > 0) {\n return Direction.S;\n } else if (deltaX < 0 && deltaY == 0) {\n return Direction.W;\n } else if (deltaX < 0 && deltaY > 0) {\n return Direction.NW;\n } else if (deltaX < 0 && deltaY < 0) {\n return Direction.NE;\n } else {\n throw new RuntimeException(\"I HAVE NO IDEA\");\n }\n }\n\t}",
"public void move() {\n if(Objects.nonNull(this.position)) {\n Position position = this.getPosition();\n Function<Position, Position> move = moveRobotInDirectionMap.get(position.getDirection());\n this.position = move.apply(position);\n }\n }",
"public Pos getPos()\r\n\t{\r\n\t\treturn position;\r\n\t}",
"Point getPosition();",
"Point getPosition();",
"public void addMove() {\n\t\tmove = \"mv \" + posX + \" \" + posY;\n\t}",
"public void move();",
"public void move();",
"public void move(){\n x+=xDirection;\n y+=yDirection;\n }",
"private Position getTestPos1() {\r\n Grid grid = GridBuilder.builder()\r\n .withMaxX(10)\r\n .withMaxY(10)\r\n .withMinY(-20)\r\n .withMinY(-20)\r\n .build();\r\n Moveable moveable = MoveableBuilder.builder()\r\n .withGrid(grid)\r\n .withShape(PositionShapeBuilder.builder()\r\n .withPosition(Positions.of(Directions.S, 0, 0, 0))\r\n .build())\r\n .withVelocity(100)\r\n .build();\r\n moveable.moveForward();\r\n moveable.turnRight();\r\n moveable = MoveableBuilder.builder()\r\n .withGrid(grid)\r\n .withShape(PositionShapeBuilder.builder()\r\n .withPosition(moveable.getPosition())\r\n .build())\r\n .withVelocity(50)\r\n .build();\r\n moveable.moveForward();\r\n PositionImpl position = (PositionImpl) moveable.getPosition();\r\n moveable.makeTurn(position.calcAbsoluteAngle() - position.getDirection().getAngle());\r\n return moveable.getPosition();\r\n }",
"public int getMovementX() {\r\n return movementX;\r\n }",
"@Override\n public double getLocationX() {\n return myMovable.getLocationX();\n }",
"private static Image getMovePoint()\n\t{\n\t\ttry {\n\t\t\treturn ImageIO.read(new File(guiDirectory + move));\n\t\t} catch (IOException ioe) {\n\t\t}\n\t\treturn null;\n\t}",
"@Override\n public double getPosition()\n {\n final String funcName = \"getPosition\";\n double pos = getMotorPosition() - zeroPosition;\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.API);\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.API, \"=%f\", pos);\n }\n\n return pos;\n }",
"public int getMovementOffset() {\n\t\treturn movementOffset;\n\t}",
"public Position toPosition() {\n\t\tPosition position = new Position();\n\t\tboolean legalPosition = position.fromMoveSequence(moveSequence);\n\t\tif (!legalPosition) {\n\t\t\tlog.severe(\"illegal position, move sequence: \" + moveSequence);\n\t\t}\n\t\treturn position;\n\t}",
"public void move() { \n\t\tSystem.out.println(\"MOVING\");\n\t\tswitch(direction) {\n\t\t\tcase NORTH: {\n\t\t\t\tyloc -= ySpeed;\n\t\t\t}\n\t\t\tcase SOUTH: {\n\t\t\t\tyloc+= xSpeed;\n\t\t\t}\n\t\t\tcase EAST: {\n\t\t\t\txloc+= xSpeed;\n\t\t\t}\n\t\t\tcase WEST: {\n\t\t\t\txloc-= xSpeed;\n\t\t\t}\n\t\t\tcase NORTHEAST: {\n\t\t\t\txloc+=xSpeed;\n\t\t\t\tyloc-=ySpeed;\n\t\t\t}\n\t\t\tcase NORTHWEST: {\n\t\t\t\txloc-=xSpeed;\n\t\t\t\tyloc-=ySpeed;\n\t\t\t}\n\t\t\tcase SOUTHEAST: {\n\t\t\t\txloc+=xSpeed;\n\t\t\t\tyloc+=ySpeed;\n\t\t\t}\n\t\t\tcase SOUTHWEST: {\n\t\t\t\txloc-=xSpeed;\n\t\t\t\tyloc+= ySpeed;\n\t\t\t}\n\t\t}\n\t}",
"Tile getPosition();",
"public String getDirectionMove() {\n\t\treturn directionMove;\n\t}",
"public void move() {\r\n posX += movementX;\r\n posY += movementY;\r\n anchorX += movementX;\r\n anchorY += movementY;\r\n }",
"public char makeMove(Coordinate move);",
"int getPosition();",
"public double getPosition()\n {\n return position * FPS;\n }",
"String getPosX();",
"public void move() {\n\r\n\t}",
"void move() {\r\n\t\tif (x + xa < 0){\r\n\t\t\txa = mov;\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\telse if (x + xa > game.getWidth() - diameter){\r\n\t\t\txa = -mov;\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\tif (y + ya < 0){\r\n\t\t\tya = mov;\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\telse if (y + ya > game.getHeight() - diameter){\r\n\t\t\tgame.gameOver();\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\tif (colisionPalas()){\r\n\t\t\tya = -mov;\r\n\t\t}\r\n\t\telse if(colisionEstorbos()){\r\n\t\t\tgame.puntuacion+=2;\r\n\t\t}\r\n\t\t\r\n\t\tx = x + xa;\r\n\t\ty = y + ya;\r\n\t}",
"public PointF getPosition()\n {\n return getMazeSprite().getPosition();\n }",
"public Position getPosition();",
"public Position getPosition();",
"public Position getPosition();",
"org.mojolang.mojo.lang.Position getStartPosition();",
"private float getPlayerMove() {\r\n\t\treturn 1.0f / 5;\r\n\t}",
"public void setMove(int move) {\n this.move = move;\n }",
"public SinglePieceMove getMove() {\n return move;\n }",
"public Direction getMove(){\n\t\tif (diam < 3){\n\t\t\tdiam++;\n\t\t\tjustnow = \"east\";\n\t\t\treturn Direction.EAST;\n\t\t}\n\t\telse if (diam < 6){\n\t\t\tdiam++;\n\t\t\tjustnow = \"south\";\n\t\t\treturn Direction.SOUTH;\n\t\t}\n\t\telse if (diam < 9){\n\t\t\tdiam++;\n\t\t\tjustnow = \"west\";\n\t\t\treturn Direction.WEST;\n\t\t}\n\t\telse if (diam < 12){\n\t\t\tdiam++;\n\t\t\tjustnow = \"north\";\n\t\t\treturn Direction.NORTH;\n\t\t}\n\t\telse {\n\t\t\tdiam = 0;\n\t\t\tdiam++;\n\t\t\tjustnow = \"east\";\n\t\t\treturn Direction.EAST;\n\t\t}\t\n\t}",
"public void move(Point p);",
"public Point getPosition();",
"public int getMoveMode();",
"public int move(int mm)\r\n\t{\n\t\taddPosition(mm);\r\n\t\t\r\n\t\t//System.out.println(\"camel pos after move\" + position);\r\n\t\treturn position;\r\n\t}",
"public void setMove(int move){\n this.move = move;\n }",
"public MowerPosition getPosition() {\n return position;\n }",
"public float getTimeToMove()\n\t{\n\t\treturn this.timeToMove;\n\t}",
"public int getMovectr() {\n\t\t\n\t\treturn moveCtr;\n\t}",
"public int getX() { return position.x; }",
"@Override\n public PosDeg getPosition() {\n return tracker.getPosition();\n }",
"double getPositionX();",
"double getPositionX();",
"double getPositionX();",
"public void move() {\n\t\tmoveX();\n\t\tmoveY();\n\t}",
"public void move() {\n\n }",
"Vector2 getPosition();",
"public WorldPixel move() {\n this.lastMoveDirection = getDirection();\n\n WorldPixel head = getTrail().peekLast();\n int oldX = head.getX();\n int oldY = head.getY();\n\n int newX = oldX + getDirection().getXDelta();\n int newY = oldY + getDirection().getYDelta();\n if (newX < getSector().getWorldXStart() || newX >= getSector().getWorldXEnd()\n || newY < getSector().getWorldYStart() || newY >= getSector().getWorldYEnd())\n return null;\n\n WorldPixel newPos = getWorld().getPixel(newX, newY);\n getTrail().addLast(newPos);\n return newPos;\n }",
"public PointF get_position() { return _position; }",
"protected void setMove(int _move)\t\t{\tmove = _move;\t\t}",
"public void move() {\n switch (dir) {\n case 1:\n this.setX(getX() + this.speed);\n moveHistory.add(new int[] {getX() - this.speed, getY()});\n moveHistory.add(new int[] {getX(), getY()});\n break;\n case 2:\n this.setY(getY() - this.speed);\n moveHistory.add(new int[] {getX(), getY() + this.speed});\n moveHistory.add(new int[] {getX(), getY()});\n break;\n case 3:\n this.setX(getX() - this.speed);\n moveHistory.add(new int[] {getX() + this.speed, getY()});\n moveHistory.add(new int[] {getX(), getY()});\n break;\n case 4:\n this.setY(getY() + this.speed);\n moveHistory.add(new int[] {getX(), getY() - this.speed});\n moveHistory.add(new int[] {getX(), getY()});\n break;\n default:\n break;\n }\n }",
"static void printMove(Position princessPos, int x, int y) {\r\n\t\tint diffX = princessPos.x - x;\r\n\t\tint diffY = princessPos.y - y;\r\n\t\t\r\n\t\tif (diffX < 0) {\r\n\t\t\tSystem.out.println(LEFT);\r\n\t\t}\r\n\t\telse if (diffX > 0) {\r\n\t\t\tSystem.out.println(RIGHT);\r\n\t\t}\r\n\t\telse if (diffY < 0) {\r\n\t\t\tSystem.out.println(UP);\r\n\t\t}\r\n\t\telse if (diffY > 0) {\r\n\t\t\tSystem.out.println(DOWN);\r\n\t\t}\r\n\t}",
"double getXPosition();",
"private void moveMower(final char movement) {\n int nextYPosition = this.getPosition().getPositionY();\n int nextXPosition = this.getPosition().getPositionX();\n switch (this.getPosition().getOrientation()) {\n case N:\n nextYPosition++;\n break;\n case S:\n nextYPosition--;\n break;\n case W:\n nextXPosition--;\n break;\n case E:\n default:\n nextXPosition++;\n break;\n }\n if (garden.isPositionAvailable(nextXPosition, nextYPosition)) {\n logger.debug(\"Moving mower : ({}, {}) -> ({}, {})\",\n this.position.getPositionX(), this.position.getPositionY(),\n nextXPosition, nextYPosition);\n this.getPosition().setPositionX(nextXPosition);\n this.getPosition().setPositionY(nextYPosition);\n } else {\n logger.debug(\"Cannot move mower : ({}, {}) -> ({}, {})\",\n this.position.getPositionX(), this.position.getPositionY(),\n this.position.getPositionX(), this.position.getPositionY());\n }\n }",
"@Override\n\tvoid move(int x, int y) {\n\n\t}",
"public void move(String direction) {\n \n }",
"Vector getPos();",
"public Coordinate getPosition() {\n return cPosition;\n }",
"public Position position();",
"public void move() {\n\t\t// Override move so we don't move, then get location set by owner.\n\t}",
"public void Move()\n {\n \n }",
"Object GetMove (Object game_state);",
"public void move()\n {\n x = x + unitVector.getValue(1)*speed;\n y = y + unitVector.getValue(2)*speed;\n }",
"private void move() {\n\n if(currentPosition.getX() == -1 && currentPosition.getY() == -1) {\n System.out.println(\"Robot is not placed, yet.\");\n return;\n }\n\n Position.Direction direction = currentPosition.getDirection();\n int newX = -1;\n int newY = -1;\n switch (direction) {\n case EAST:\n newX = currentPosition.getX() + 1;\n newY = currentPosition.getY();\n break;\n case WEST:\n newX = currentPosition.getX() - 1;\n newY = currentPosition.getY();\n break;\n case NORTH:\n newX = currentPosition.getX();\n newY = currentPosition.getY() + 1;\n break;\n case SOUTH:\n newX = currentPosition.getX();\n newY = currentPosition.getY() - 1;\n break;\n }\n\n if(newX < lowerBound.getX() || newY < lowerBound.getY()\n || newX > upperBound.getX() || newY > upperBound.getY()) {\n System.out.println(\"Cannot move to \" + direction);\n return;\n }\n\n currentPosition.setX(newX);\n currentPosition.setY(newY);\n }",
"public void move()\n {\n double angle = Math.toRadians( getRotation() );\n int x = (int) Math.round(getX() + Math.cos(angle) * WALKING_SPEED);\n int y = (int) Math.round(getY() + Math.sin(angle) * WALKING_SPEED);\n setLocation(x, y);\n }",
"public float getPosX(){return px;}",
"void move();",
"MazePoint getExpectedMovementPosition(MazePoint point, Direction dir);",
"public Point getPosition()\n\t{\n\t\treturn pos;\n\t}",
"public Point getPosition(){\r\n return new Point(this.position);\r\n }",
"public void move(String direction);",
"@Override\n\tpublic void move() {\n\t\t\n\t}",
"public float getPos() {\n return (spos - xpos) / (swidth - sheight);\n }",
"void makeMove(Location loc);",
"godot.wire.Wire.Vector3 getPosition();",
"public float getPositionX() {return this.position.getX();}",
"@Override\n\t\t\tpublic Vector getPosition() {\n\t\t\t\treturn new Vector(-2709.487, -4281.02, 3861.564); //-4409.0, 2102.0, -4651.0);\n\t\t\t}",
"Move(Move m)\n\t{\n\t\tif(m != null) {\n\t\t\tpieceRow = m.pieceRow;\n\t\t\tpieceCol = m.pieceCol;\n\t\t\tdestRow = m.destRow;\n\t\t\tdestCol = m.destCol;\n\t\t}\n\t}"
] | [
"0.78123695",
"0.76759493",
"0.7586757",
"0.7550126",
"0.7469525",
"0.7365069",
"0.72170854",
"0.72170854",
"0.7155283",
"0.7119773",
"0.70952404",
"0.7090121",
"0.7077239",
"0.70662355",
"0.702471",
"0.6997874",
"0.6986653",
"0.69830585",
"0.69753796",
"0.69527656",
"0.6947965",
"0.69450474",
"0.69393003",
"0.69393003",
"0.6924856",
"0.69243556",
"0.69243556",
"0.6916058",
"0.6912127",
"0.69009703",
"0.68966854",
"0.6868016",
"0.68677175",
"0.6864456",
"0.6862247",
"0.685985",
"0.68393743",
"0.6829321",
"0.6825277",
"0.68190056",
"0.68114674",
"0.6803928",
"0.6791815",
"0.6786263",
"0.6780012",
"0.6774547",
"0.6759125",
"0.6759125",
"0.6759125",
"0.6757577",
"0.67479783",
"0.6740485",
"0.6738068",
"0.6734914",
"0.67310864",
"0.67249763",
"0.6720524",
"0.671537",
"0.67103",
"0.6705195",
"0.6702391",
"0.67010045",
"0.66848415",
"0.6677629",
"0.66695434",
"0.66695434",
"0.66695434",
"0.6668798",
"0.66679007",
"0.6651047",
"0.6644482",
"0.6639473",
"0.6633864",
"0.66322523",
"0.6598289",
"0.6596589",
"0.6586242",
"0.6585907",
"0.65701675",
"0.65696776",
"0.655787",
"0.65565383",
"0.65529436",
"0.65528995",
"0.65518004",
"0.65512747",
"0.6549968",
"0.65474755",
"0.65441835",
"0.654369",
"0.65413964",
"0.6539998",
"0.65398204",
"0.6539385",
"0.6539331",
"0.65386623",
"0.65382385",
"0.653487",
"0.65320474",
"0.65289474",
"0.6528528"
] | 0.0 | -1 |
Log a firebase event. | @Override
public void onClick(View view) {
activityInterface.logEventSelectContent("restartButton", "restartButton", MainActivity.CONTENT_TYPE_BUTTON);
onClickRestart();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void logHappeningClick(String happeningId, String userId){\n DatabaseReference mDatabase = FirebaseDatabase.getInstance().getReference();\n mDatabase.child(\"analytics\").child(\"happenings\").child(happeningId).child(\"clicks\").child(userId).push().setValue(System.currentTimeMillis(), new DatabaseReference.CompletionListener() {\n @Override\n public void onComplete(DatabaseError databaseError, DatabaseReference databaseReference) {\n if (databaseError == null) {\n Log.i(\"AnalyticsService:\",\"logHappeningClick: success\");\n }\n }\n });\n\n }",
"public void onLogEvent(String date, String source, String level, String msg);",
"private static void logEvent(Object ev, boolean uiEvent) {\n String bus;\n if (uiEvent) {\n bus = \"UI_BUS\";\n } else {\n bus = \"BUS\";\n }\n if (verbose) {\n Log.i(LOG_TAG, \"posting \" + ev.getClass().getSimpleName() + \" of type \" + ev.getClass().getAnnotation(Event.class).type() + \" on \" + bus);\n }\n }",
"abstract protected void _log(TrackingEvent event) throws Exception;",
"public void logEvent(final LogEvent event) {\n loggerConfig.log(event);\n }",
"public void postEvent(Runnable event) {\n\t\t\tfirebaseEventHandler.post(event) ;\n\t\t}",
"public void onLogMessage(String message);",
"public static void logEvent(String eventType) {\n logEvent(eventType, null);\n }",
"public void logEvent(long timestamp, int componentTag, int eventTag, Parcelable data) {\n }",
"public void logEvent(String message) {\n System.out.println(\"PC Log.listener: \"+message);\n\n }",
"public void log (Object msg) {\n getLogEvent().addMessage (msg);\n }",
"@Override\n public void onError(FirebaseError firebaseError) {\n }",
"@Override\r\n protected void append(LoggingEvent event)\r\n {\n String category = event.getLoggerName();\r\n String logMessage = event.getRenderedMessage();\r\n String nestedDiagnosticContext = event.getNDC();\r\n String threadDescription = event.getThreadName();\r\n String level = event.getLevel().toString();\r\n long time = event.timeStamp;\r\n LocationInfo locationInfo = event.getLocationInformation();\r\n\r\n // Add the logging event information to a LogRecord\r\n Log4JLogRecord record = new Log4JLogRecord();\r\n\r\n record.setCategory(category);\r\n record.setMessage(logMessage);\r\n record.setLocation(locationInfo.fullInfo);\r\n record.setMillis(time);\r\n record.setThreadDescription(threadDescription);\r\n\r\n if (nestedDiagnosticContext != null) {\r\n record.setNDC(nestedDiagnosticContext);\r\n } else {\r\n record.setNDC(\"\");\r\n }\r\n\r\n if (event.getThrowableInformation() != null) {\r\n record.setThrownStackTrace(event.getThrowableInformation());\r\n }\r\n\r\n try {\r\n record.setLevel(LogLevel.valueOf(level));\r\n } catch (LogLevelFormatException e) {\r\n // If the priority level doesn't match one of the predefined\r\n // log levels, then set the level to warning.\r\n record.setLevel(LogLevel.WARN);\r\n }\r\n MgcLogBrokerMonitor monitor = Lf5MainWindowController.getMonitor();\r\n if (monitor != null) {\r\n monitor.addMessage(record);\r\n }\r\n }",
"@Override\n public void onEvent(String eventName, HashMap dataFromHansel) {\n if (\"hansel_nudge_event\".equals(eventName)) {\n FirebaseAnalyticsHelper.logEvent(this, \"hansel_nudge_event\", dataFromHansel);\n }\n }",
"public static void logEvent(String eventType, JSONObject eventProperties) {\n /*if(ZeTarget.robolectricTesting) {\n System.out.println(\"ZETARGET: logEvent - \" + eventType);\n }*/\n checkedLogEvent(eventType, eventProperties, null, System.currentTimeMillis(), true);\n }",
"private void logEvent(String operation, EntryEvent event) {\n}",
"public static void logCommand(GuildMessageReceivedEvent event) {\n }",
"abstract protected void _log(Snapshot snapshot) throws Exception;",
"@Override\n public void log(String message) {\n }",
"@Override\n protected void onError(FirebaseFirestoreException e) {\n Snackbar.make(findViewById(android.R.id.content),\n \"Error: check logs for info.\", Snackbar.LENGTH_LONG).show();\n }",
"@Override\n public void append( LogEvent event ) {\n long eventTimestamp;\n if (event instanceof AbstractLoggingEvent) {\n eventTimestamp = ((AbstractLoggingEvent) event).getTimestamp();\n } else {\n eventTimestamp = System.currentTimeMillis();\n }\n LogEventRequest packedEvent = new LogEventRequest(Thread.currentThread().getName(), // Remember which thread this event belongs to\n event, eventTimestamp); // Remember the event time\n\n if (event instanceof AbstractLoggingEvent) {\n AbstractLoggingEvent dbLoggingEvent = (AbstractLoggingEvent) event;\n switch (dbLoggingEvent.getEventType()) {\n\n case START_TEST_CASE: {\n\n // on Test Executor side we block until the test case start is committed in the DB\n waitForEventToBeExecuted(packedEvent, dbLoggingEvent, true);\n\n // remember the test case id, which we will later pass to ATS agent\n testCaseState.setTestcaseId(eventProcessor.getTestCaseId());\n\n // clear last testcase id\n testCaseState.clearLastExecutedTestcaseId();\n\n //this event has already been through the queue\n return;\n }\n case END_TEST_CASE: {\n\n // on Test Executor side we block until the test case start is committed in the DB\n waitForEventToBeExecuted(packedEvent, dbLoggingEvent, true);\n\n // remember the last executed test case id\n testCaseState.setLastExecutedTestcaseId(testCaseState.getTestcaseId());\n\n // clear test case id\n testCaseState.clearTestcaseId();\n // this event has already been through the queue\n return;\n }\n case GET_CURRENT_TEST_CASE_STATE: {\n // get current test case id which will be passed to ATS agent\n ((GetCurrentTestCaseEvent) event).setTestCaseState(testCaseState);\n\n //this event should not go through the queue\n return;\n }\n case START_RUN:\n\n /* We synchronize the run start:\n * Here we make sure we are able to connect to the log DB.\n * We also check the integrity of the DB schema.\n * If we fail here, it does not make sense to run tests at all\n */\n atsConsoleLogger.info(\"Waiting for \"\n + event.getClass().getSimpleName()\n + \" event completion\");\n\n /** disable root logger's logging in order to prevent deadlock **/\n Level level = LogManager.getRootLogger().getLevel();\n Configurator.setRootLevel(Level.OFF);\n\n AtsConsoleLogger.setLevel(level);\n\n // create the queue logging thread and the DbEventRequestProcessor\n if (queueLogger == null) {\n initializeDbLogging(null);\n }\n\n waitForEventToBeExecuted(packedEvent, dbLoggingEvent, false);\n //this event has already been through the queue\n\n /*Revert Logger's level*/\n Configurator.setRootLevel(level);\n AtsConsoleLogger.setLevel(level);\n\n return;\n case END_RUN: {\n /* We synchronize the run end.\n * This way if there are remaining log events in the Test Executor's queue,\n * the JVM will not be shutdown prior to committing all events in the DB, as\n * the END_RUN event is the last one in the queue\n */\n atsConsoleLogger.info(\"Waiting for \"\n + event.getClass().getSimpleName()\n + \" event completion\");\n\n /** disable root logger's logging in order to prevent deadlock **/\n level = LogManager.getRootLogger().getLevel();\n Configurator.setRootLevel(Level.OFF);\n\n AtsConsoleLogger.setLevel(level);\n\n waitForEventToBeExecuted(packedEvent, dbLoggingEvent, true);\n\n /*Revert Logger's level*/\n Configurator.setRootLevel(level);\n AtsConsoleLogger.setLevel(level);\n\n //this event has already been through the queue\n return;\n }\n case DELETE_TEST_CASE: {\n // tell the thread on the other side of the queue, that this test case is to be deleted\n // on first chance\n eventProcessor.requestTestcaseDeletion( ((DeleteTestCaseEvent) dbLoggingEvent).getTestCaseId());\n // this event is not going through the queue\n return;\n }\n default:\n // do nothing about this event\n break;\n }\n }\n\n passEventToLoggerQueue(packedEvent);\n }",
"public void log(final String s) {\n if (this.logWatcher == null) { return; }\n final Date date = Calendar.getInstance().getTime();\n final Timestamp time = new Timestamp(date.getTime());\n this.logWatcher.add(\"[\" + time.toString() + \"] \" + s);\n }",
"@Override\n public void logs() {\n \n }",
"public void errorGettingEvent() {\n hideProgressBar();\n Log.e(Tag.FIREBASE_ERROR, \"Error getting the events\");\n// Toast.makeText(this, getText(R.string.can_not_load_event), Toast.LENGTH_SHORT).show();\n launchAndClose(new Intent(this, MainActivity.class));\n }",
"@Override\n public void log()\n {\n }",
"void log(Message message);",
"public static void onEvent(String eventId) {\n\n SimpleDateFormat df = new SimpleDateFormat(\"HH:mm:ss\");\n Date curDate = new Date(System.currentTimeMillis());//获取当前时间\n String currentTime = df.format(curDate);\n\n\n try {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"time\", currentTime);\n\n FlurryAgent.onEvent(eventId, params);\n } catch (Throwable t) {\n }\n\n }",
"public void track(String eventName) {\n try {\n final JSONObject messageProps = new JSONObject();\n\n final long time = System.currentTimeMillis() / 1000;\n messageProps.put(\"time\", time);\n messageProps.put(\"randUser\", getDistinctId());\n\n final AnalyticsMessages.EventDescription eventDescription =\n new AnalyticsMessages.EventDescription(eventName, messageProps);\n mMessages.eventsMessage(eventDescription);\n } catch (final JSONException e) {\n Log.e(LOGTAG, \"Exception tracking event \" + eventName, e);\n }\n }",
"public static void log(String toLog)\n {\n System.out.println(\"Log: \" + toLog);\n SmartDashboard.putString(\"Log\", toLog);\n }",
"protected void logCustomEvent(JSONArray args, final CallbackContext callbackContext) {\n\t\tLog.d(TAG, \"LOGCUSTOMEVENT\");\n\t\ttry {\n\t\t String name = args.getString(0);\n\t\t\tJSONObject dataJSON = args.getJSONObject(1);\n\t\t\tNotificare.shared().getEventLogger().logCustomEvent(name, dataJSON);\n\t\t\tif (callbackContext == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcallbackContext.success();\n\t\t} catch (JSONException e) {\n\t\t\tif (callbackContext == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcallbackContext.error(\"JSON parse error\");\n\t\t}\n\t}",
"@Override\n public void onCancelled(FirebaseError firebaseError) {\n System.out.println(\"The read failed: \" + firebaseError.getMessage());\n }",
"@Override\n public void onCancelled(FirebaseError firebaseError) {\n System.out.println(\"The read failed: \" + firebaseError.getMessage());\n }",
"@Override\n public void onCancelled(FirebaseError firebaseError) {\n System.out.println(\"The read failed: \" + firebaseError.getMessage());\n }",
"@Override\n public void onCancelled(FirebaseError firebaseError) {\n System.out.println(\"The read failed: \" + firebaseError.getMessage());\n }",
"public void log(String message) {\n\t}",
"@Override\n\tpublic void fireEvent(DebugEvent event) {\n\t\ttry {\n\t\t\tDebugEvent threadEvent = new DebugEvent(getThreads()[0], event.getKind(), event.getDetail());\n\t\t\tif (DebugPlugin.getDefault() != null)\n\t\t\t\tDebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] {event,threadEvent});\n\t\t} catch (DebugException e) {\n\t\t}\n\t}",
"@Override\n\tpublic void publish(LogRecord record) {\n\tSystem.err.println(formatter.format(record));\n\tLogInfo info = new LogInfo(record.getTime(), \n\t\t\t\t record.getSource()+\":\"+record.getLevel(), \n\t\t\t\t formatter.format(record));\n\ttry {\n\t Telemetry.getInstance().publish(\"LOG\", info);\n\t} catch (Exception e) {\n\t System.err.println(\"Telemetry log error...\");\n\t e.printStackTrace();\n\t}\n }",
"public void log(String msg) {\n\n\t}",
"void log();",
"abstract protected void _log(TrackingActivity activity) throws Exception;",
"public void messageLogged(BuildEvent event) {\n if (isEnabled()) {\n // Only buffer error messages\n if (event.getPriority() <= logLevel) {\n events.add(event);\n }\n }\n }",
"public static void log(Context context, MessageRecord record) {\n\t\tIntent intent = new Intent(context, Logger.class);\n\t\tintent.setAction(ACTION_LOG_MESSAGE);\n\t\tintent.putExtra(EXTRA_RECORD, (Parcelable)record);\n\t\tcontext.startService(intent);\n\t}",
"@Override\n public void onError(FirebaseError firebaseError) {\n Log.d(\"LOGIN\", \"Registration error\");\n }",
"@Override\n public void onEvent(DocumentSnapshot snapshot, FirebaseFirestoreException e) {\n if (e != null) {\n Log.w(LOG_VAL, \"post:onEvent\", e);\n return;\n }\n\n onPostLoaded(snapshot.toObject(Post.class));\n }",
"@Override\n protected void append(LoggingEvent event) {\n if (event.getMessage() instanceof WrsAccessLogEvent) {\n WrsAccessLogEvent wrsLogEvent = (WrsAccessLogEvent) event.getMessage();\n\n try {\n HttpServletRequest request = wrsLogEvent.getRequest();\n if (request != null) {\n String pageHash = ((String)MDC.get(RequestLifeCycleFilter.MDC_KEY_BCD_PAGEHASH));\n String requestHash = ((String)MDC.get(RequestLifeCycleFilter.MDC_KEY_BCD_REQUESTHASH));\n String sessionId = ((String)MDC.get(RequestLifeCycleFilter.MDC_KEY_SESSION_ID));\n String requestUrl = request.getRequestURL().toString();\n String reqQuery = request.getQueryString();\n requestUrl += (reqQuery != null ? \"?\" + reqQuery : \"\");\n if (requestUrl.length()> 2000)\n requestUrl = requestUrl.substring(0, 2000);\n String bindingSetName = wrsLogEvent.getBindingSetName();\n if (bindingSetName != null && bindingSetName.length()> 255)\n bindingSetName = bindingSetName.substring(0, 255);\n String requestXML = wrsLogEvent.getRequestDoc()!=null ? Utils.serializeElement(wrsLogEvent.getRequestDoc()) : null;\n\n // log access\n if(AccessSqlLogger.getInstance().isEnabled()) {\n final AccessSqlLogger.LogRecord recordAccess = new AccessSqlLogger.LogRecord(\n sessionId\n , requestUrl\n , pageHash\n , requestHash\n , bindingSetName\n , requestXML\n , wrsLogEvent.getRowCount()\n , wrsLogEvent.getValueCount()\n , wrsLogEvent.getRsStartTime()\n , wrsLogEvent.getRsEndTime()\n , wrsLogEvent.getWriteDuration()\n , wrsLogEvent.getExecuteDuration()\n );\n AccessSqlLogger.getInstance().process(recordAccess);\n }\n }\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n }\n }",
"public void logEvent(Throwable throwable) {\n System.out.println(\"PC Log.listener - stack trace: \");\n throwable.printStackTrace();\n }",
"public void append(LoggingEvent loggingevent) {\n //System.out.println(\"TracerAppender \" + loggingevent + \" into \" + tracer);\n StringBuffer buffer = new StringBuffer(loggingevent.getLoggerName());\n buffer.append(\": \");\n buffer.append(loggingevent.getMessage());\n ThrowableInformation ti = loggingevent.getThrowableInformation();\n if (ti == null) {\n tracer.log(loggingevent.getLevel().getSyslogEquivalent(), buffer.toString());\n } else {\n tracer.log(loggingevent.getLevel().getSyslogEquivalent(), buffer.toString(), ti.getThrowable());\n }\n }",
"public static void logPurchaseAttempted() {\n /*if(ZeTarget.robolectricTesting) {\n System.out.println(\"ZETARGET: logging purchase attempted event\");\n }*/\n logEvent(Constants.Z_PURCHASE_ATTEMPTED_EVENT);\n }",
"private static void log(String msg) {\n Log.d(LOG_TAG, msg);\n }",
"@Override\n\t\t\t\t\t\t\tpublic void log(String msg, int level, Date date, StackTraceElement trace) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}",
"void log(String string);",
"protected void fireEvent(DebugEvent event) {\n\t\tDebugPlugin manager= DebugPlugin.getDefault();\n\t\tif (manager != null) {\n\t\t\tmanager.fireDebugEventSet(new DebugEvent[] { event });\n\t\t}\n\t}",
"public static void logEvent(SimulationEvent event) {\n\t\tevents.add(event);\n\t\tSystem.out.println(event);\n\t}",
"@Override\n public void onVerificationFailed(FirebaseException e) {\n // displaying error message with firebase exception.\n Toast.makeText(MainActivity.this, e.getMessage(), Toast.LENGTH_LONG).show();\n }",
"public static void log(Context context, String message){\n if(logging){\n String tag = context.getClass().getName();\n android.util.Log.d(tag, message);\n }\n }",
"private void log(String message) {\n if (this.listener != null) {\n message = \"CollabNet Tracker: \" + message;\n this.listener.getLogger().println(message);\n }\n }",
"@Override\n public void receive(CloudServiceEvent event) {\n logger.debug(\"Cloudstack event received: reference type:\" + event.getCloudServiceReferenceType() + \" reference id:\"\n + event.getCloudServiceReferenceId());\n }",
"private void testFirebase() {\n Intent launchIntent = new Intent(this, HomeActivity.class);\n launchIntent.putExtra(Constants.FIREBASE_ACTION, true);\n launchIntent.putExtra(Constants.FIREBASE_TITLE, \"Sample Title\");\n launchIntent.putExtra(Constants.FIREBASE_BODY, \"Sample Body\");\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, launchIntent,\n PendingIntent.FLAG_UPDATE_CURRENT);\n Bitmap rawBitmap = BitmapFactory.decodeResource(getResources(),\n R.mipmap.ic_launcher_round);\n NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)\n .setSmallIcon(R.drawable.ic_stat_notif_icon_firebase_om)\n .setLargeIcon(rawBitmap)\n .setContentTitle(getResources().getString(R.string.app_name))\n .setContentText(\"Sample body\")\n .setAutoCancel(true)\n .setContentIntent(pendingIntent);\n\n NotificationManager notificationManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n Notification notification = notificationBuilder.build();\n notification.flags |= Notification.FLAG_NO_CLEAR;\n\n notificationManager.notify(0 /* ID of notification */, notification);\n }",
"public static void log(Context context, AttackRecord record) {\n\t\tIntent intent = new Intent(context, Logger.class);\n\t\tintent.setAction(ACTION_LOG_ATTACK);\n\t\tintent.putExtra(EXTRA_RECORD, (Parcelable)record);\n\t\tcontext.startService(intent);\n\t}",
"public void logMessage(HistoricalMessage message) {\n if (message.getBody() != null) {\r\n logQueue.add(message);\r\n }\r\n }",
"public static void log(String msg) {\r\n Log.d(TAG, msg);\r\n }",
"public void logData(){\n }",
"public void logMessage(AsyncLoggerConfig asyncLoggerConfig, LogEvent event) {\n/* 65 */ asyncLoggerConfig.callAppendersInCurrentThread(event);\n/* */ }",
"@Override\n public void onEvent(@Nullable DocumentSnapshot documentSnapshot, @Nullable FirebaseFirestoreException e) {\n if (fAuth==null){\n return;\n }\n if(fStore==null){\n return;\n }\n\n if(documentSnapshot == null){\n Log.i(\"Error; \", e.toString());\n }else {\n //we display the information of the actual user\n welcome.setText( \"Welcome \"+documentSnapshot.getString(\"firstName\")+ \" \" + documentSnapshot.getString(\"lastname\"));\n rating.setText(\"Your rating is : \"+ documentSnapshot.getString(\"rating\")+\"/5\");\n }\n }",
"private void recordPushLog(String configName) {\n PushLog pushLog = new PushLog();\n pushLog.setAppId(client.getAppId());\n pushLog.setConfig(configName);\n pushLog.setClient(IP4s.intToIp(client.getIp()) + \":\" + client.getPid());\n pushLog.setServer(serverHost.get());\n pushLog.setCtime(new Date());\n pushLogService.add(pushLog);\n }",
"public void log(Task task, String message, int msgLevel) {\n fireMessageLogged(task, message, msgLevel);\n }",
"void notifyTrace(RecorderTraceEvent event);",
"public void log(String message) {\n logger.log(\"[\" + game.getName() + \"] \" + message);\n }",
"protected void fireEvent(DebugEvent event) {\n\t\tDebugPlugin manager = DebugPlugin.getDefault();\n\t\tif (manager != null) {\n\t\t\tmanager.fireDebugEventSet(new DebugEvent[] { event });\n\t\t}\n\t}",
"public void append(final String aEvent, long aTimestamp)\n {\n final InputLogEvent awsLogEvent = new InputLogEvent();\n\n final String message = aEvent;\n awsLogEvent.setTimestamp(Long.valueOf(aTimestamp));\n awsLogEvent.setMessage(message);\n if (!this.queue.offer(awsLogEvent) && !this.queueFull)\n {\n debug(\"Log queue is full!\");\n this.queueFull = true;\n }\n else if (this.queueFull)\n {\n this.queueFull = false;\n }\n }",
"private void log(String s) {\n Rlog.i(TAG, s);\n }",
"public final void log(String string) {\n context.getBot().log(manifest.name(), string);\n }",
"private LogEvent()\n\t{\n\t\tsuper();\n\t}",
"void onUserCreated(FirebaseUser firebaseUser);",
"private void RetrieveChildAddedEventWithURL(JSONArray data) {\n //\n \tString strURL = String.format(\"https://%s.firebaseio.com\", appName); // = \"https://%@.firebaseio.com\" + appName;\n\n if ( data.length() >= 1 )\n {\n \ttry {\n\t\t\t\tstrURL = data.getString(0);\n\t\t\t} catch (JSONException e) {\n\t\t\t\tPluginResult pluginResult = new PluginResult(Status.ERROR, e.getMessage());\n\t\t\t\tmCallbackContext.sendPluginResult(pluginResult);\n\t\t\t\te.printStackTrace();\n\t\t\t\treturn;\n\t\t\t}\n }\n else{\n \tPluginResult pluginResult = new PluginResult(Status.ERROR, \"RetrieveChildAddedEventWithURL : Parameter Error\");\n \tmCallbackContext.sendPluginResult(pluginResult);\n \treturn;\n }\n\n Firebase myChildRef = new Firebase(strURL);\n if(isUsed != true)\n isUsed = true;\n // Retrieve new posts as they are added to the database\n myChildRef.addChildEventListener(new ChildEventListener() {\n\t\t\t@Override\n\t\t\tpublic void onChildAdded(DataSnapshot arg0, String arg1) {\n\t\t //[result setKeepCallback:[NSNumber numberWithBool:YES]];\n System.out.println(arg0.getValue());\n JSONObject resultObj;\n\t\t\t\ttry {\n\t\t\t\t\tresultObj = new JSONObject(arg0.getValue().toString());\n\t PluginResult pluginResult = new PluginResult(Status.OK, resultObj);\n\t //pluginResult.setKeepCallback(true);\n\t mCallbackContext.sendPluginResult(pluginResult);\n\t\t\t\t} catch (JSONException e) {\n\t\t\t\t\tPluginResult pluginResult = new PluginResult(Status.ERROR, e.getMessage());\n\t\t\t\t\tmCallbackContext.sendPluginResult(pluginResult);\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onCancelled(FirebaseError arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onChildMoved(DataSnapshot arg0, String arg1) {\n\t\t\t\t// TODO Auto-generated method stub\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onChildRemoved(DataSnapshot arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onChildChanged(DataSnapshot arg0, String arg1) {\n\t\t\t\t// TODO Auto-generated method stub\n\n\t\t\t}\n\t\t});\n }",
"public void asyncFire(EventI event);",
"@Override\n protected void log(String tag, String msg) {\n Log.i(tag, \"[you can use your custom logger here \\\"]\" + msg);\n }",
"private void log(String s) {\n RlogEx.i(TAG, s);\n }",
"public void log(String text) {\n }",
"public EventLogMessageEntry getEventLogMessage(int index);",
"public interface FirebaseActionListenerCallback {\n public void onSuccess();\n public void onError(Exception exception);\n public void onDatabaseError(DatabaseError error);\n}",
"@Override\n\tpublic void onAuthenticationError(FirebaseError error)\n\t{\n\t\tSystem.out.println(error.getMessage());\n\t}",
"@Override\n public void onLoging() {\n }",
"private void addDatatoFirebase(String name, String phone, String address) {\n employeeInfo.setstartUpName(name);\n employeeInfo.setpotential(phone);\n employeeInfo.setbuildTime(address);\n String id = databaseReference.push().getKey();\n\n\n assert id != null;\n\n databaseReference.child(id).setValue(employeeInfo);\n\n\n\n\n\n // we are use add value event listener method\n // which is called with database reference.\n// databaseReference.addValueEventListener(new ValueEventListener() {\n// @Override\n// public void onDataChange(@NonNull DataSnapshot snapshot) {\n// // inside the method of on Data change we are setting\n// // our object class to our database reference.\n// // data base reference will sends data to firebase.\n// databaseReference.setValue(employeeInfo);\n//\n// // after adding this data we are showing toast message.\n// Toast.makeText(MainActivity.this, \"data added\", Toast.LENGTH_SHORT).show();\n// }\n//\n//\n// @Override\n// public void onCancelled(@NonNull DatabaseError error) {\n// // if the data is not added or it is cancelled then\n// // we are displaying a failure toast message.\n// Toast.makeText(MainActivity.this, \"Fail to add data \" + error, Toast.LENGTH_SHORT).show();\n// }\n// });\n }",
"public void log(String str)\n\t{\n\t\tDate date = new Date();\n\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd HH:mm\");\n\t\t\n\t\tString loggable = dateFormat.format(date) + \": \" + str;\n\t\t\n\t\t// Add it to the log\n\t\tthis.log.add(loggable);\n\t\t\n\t\t// Print it out, for now.\n\t\tSystem.out.println(loggable); \n\t}",
"public void record(Event evt) {\n record0(evt);\n }",
"public LogJobEventAttribute(TriggerJobDO job)\n {\n super(GenomeAttributeType.JobEvent, getEventString(buildEvent(job)));\n }",
"public void log(String message) {\r\n log.append(\"[\" + new SimpleDateFormat(\"HH:mm:ss\").format(new Date()) + \"] \" + message + \"\\n\");\r\n System.out.println(\"[\" + new SimpleDateFormat(\"HH:mm:ss\").format(new Date()) + \"] \" + message);\r\n }",
"void subscribe(LogListener listener);",
"void log(Log log);",
"abstract void logCustom(String tag, String message);",
"public interface OnLogReceivedListener {\n public void onLogReceived(String logMessage);\n}",
"public static void log(Class clz, String message){\n if(logging){\n String tag = clz.getName();\n android.util.Log.d(tag, message);\n }\n }",
"private void logToFile() {\n }",
"public void add_to_log(String s){\n }",
"public void logMessage(AsyncLoggerConfig asyncLoggerConfig, LogEvent event) {\n/* 46 */ asyncLoggerConfig.callAppendersInBackgroundThread(event);\n/* */ }",
"public void log(String message) {\n Log.i(tag, \"TIME: \" + message + \": \" + String.valueOf(get()) + \" ms\");\n }",
"@Override\n public void onVerificationFailed(FirebaseException e) {\n\n Toast.makeText(MainActivity.this, e.getMessage(), Toast.LENGTH_LONG).show();\n }",
"public static void recordMetricEvent(UUID eventId, String arg1) {\n\n if (eventId == null) {\n return;\n }\n String serviceName = MDC.get(MDC_SERVICE_NAME);\n MDC.put(MDC_KEY_REQUEST_ID, eventId.toString());\n metricsLogger.info(MessageCodes.RULE_AUDIT_END_INFO, serviceName, arg1);\n }",
"public void onLogFPS() {\n }",
"protected void log(final String message) {\n Log.v(BuildConfig.TAG, message);\n }"
] | [
"0.6501927",
"0.6205363",
"0.60270864",
"0.6007128",
"0.59840006",
"0.5937901",
"0.5930952",
"0.5772442",
"0.5728594",
"0.57232696",
"0.56895804",
"0.5620119",
"0.5616759",
"0.56053185",
"0.560514",
"0.5574748",
"0.5565031",
"0.5561499",
"0.5542718",
"0.5537796",
"0.55152285",
"0.5448748",
"0.5377822",
"0.53760624",
"0.53704596",
"0.534824",
"0.5334401",
"0.5333896",
"0.53137034",
"0.53015274",
"0.5294849",
"0.5294849",
"0.5294849",
"0.5294849",
"0.52724475",
"0.52227616",
"0.5195689",
"0.5185972",
"0.51830965",
"0.5181958",
"0.5180921",
"0.5167793",
"0.5165651",
"0.51547664",
"0.5154306",
"0.5145801",
"0.51402396",
"0.5130833",
"0.5130486",
"0.5127638",
"0.512338",
"0.5119796",
"0.5119745",
"0.51115716",
"0.51073915",
"0.51058066",
"0.510372",
"0.51036525",
"0.50937414",
"0.5084447",
"0.5081239",
"0.5079725",
"0.50795484",
"0.50781065",
"0.50675106",
"0.50618356",
"0.50594366",
"0.5049959",
"0.50496227",
"0.50416136",
"0.5031539",
"0.5029646",
"0.5006783",
"0.5006299",
"0.5004459",
"0.49896154",
"0.49889094",
"0.49831867",
"0.49665806",
"0.49637577",
"0.49625558",
"0.4956039",
"0.49431244",
"0.49403876",
"0.4938695",
"0.49386942",
"0.4936349",
"0.49286002",
"0.49220365",
"0.4914496",
"0.4913624",
"0.49102622",
"0.4899333",
"0.48986667",
"0.48971403",
"0.48939377",
"0.48934913",
"0.48908198",
"0.48898616",
"0.48865792",
"0.4886136"
] | 0.0 | -1 |
Check if maximum number of digits is reached: | @Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (inputET.length() >= Digits.currentDigit.getFractionalPart().length()) {
// End the game
end(inputET.length() - 1, true);
return;
}
// We can now assume that inputET.length() < fractionalPart.length(), so we can safely
// call Digits.isIncorrect.
if (Digits.isIncorrect(inputET.getText().toString(), 1)) {
end(inputET.length() - 1, true);
} else {
if (inputET.getText().length() == 1 && before == 0) {
stopWatch.start();
highScoresButton.setImageResource(R.drawable.ic_stop_36dp);
// Lock screen orientation
int orientation = getContext().getResources().getConfiguration().orientation;
getActivity().setRequestedOrientation(orientation == Configuration.ORIENTATION_LANDSCAPE ?
ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE : ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
}
updateDigitsText();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\r\n public void testMaxDigit() {\r\n int number = 472;\r\n int expResult = 7;\r\n int result = Main.maxDigit(number);\r\n \r\n assertEquals(expResult, result);\r\n }",
"public static boolean checkdigitsequal() {\n int count2=0;\n for (a = 0; a < 10; a++) {\n if (digits[a] == 0)\n {\n count2++;\n if(count2==10)return true;\n }\n else return false;\n }\n return false;\n }",
"private boolean digits() {\r\n return ALT(\r\n GO() && RANGE('1','9') && decimals() || OK() && CHAR('0') && hexes()\r\n );\r\n }",
"public int maxDigit() {\n int maxDigit = 1;\n for (int i = 0; i < theArray.length; i++) {\n int n = numberOfDigit(theArray[i]);\n if (n > maxDigit)\n maxDigit = n;\n }\n return maxDigit;\n }",
"@Override\n public boolean validate(long number) {\n List<Integer> digits = split(number);\n int multiplier = 1;\n int sum = 0;\n for (int digit : Lists.reverse(digits)) {\n int product = multiplier * digit;\n sum += product / BASE + product % BASE;\n multiplier = 3 - multiplier;\n }\n return sum % BASE == 0;\n }",
"static boolean checkNumber(int number) {\r\n\t\t\r\n\t\tint lastDigit= number%10;\r\n\t\tnumber/=10;\r\n\t\tboolean flag= false;\r\n\t\t\r\n\t\twhile(number>0) {\r\n\t\t\tif(lastDigit<=number%10) {\r\n\t\t\t\tflag=true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tlastDigit= number%10;\r\n\t\t\tnumber/=10;\r\n\t\t\t\t\r\n\t\t}\r\n\t\tif(flag) \r\n\t\t\treturn false;\r\n\t\telse {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}",
"public static void main(String[] args) {\n Numbers numbers = new Numbers(9,988,77,66);\n String maxnum = numbers.getMaxNum();\n //if (maxnum.equals(\"99989788\")) {\n if (maxnum.equals(\"99887766\")) {\n System.out.println(\"right\");\n } else {\n System.out.println(\"wrong\");\n }\n }",
"private int controll(int max){\n int nr = 0;\n boolean numberOK = true;\n \n do{\n \tSystem.out.println(\"välj alternativ 0-\" + max + \" för att fortsätta, tack:\");\n \tString in = scanna.nextLine();\n \t\n \ttry{\n \t\tnr = Integer.parseInt(in);\n \t\tnumberOK = true;\n \t\tif(0<=nr && nr<=max){\n \t\t\treturn nr;\n \t\t}else{\n \t\t\tSystem.out.println(in + \" är inget alternativ, ju!\");\n \t\t\tnumberOK = false;\n \t\t}\n \t\t}catch (NumberFormatException e){\n \t\tSystem.out.println(in + \" är i nget alternativ, ju!\");\n \t\tnumberOK = false; \n \t}\n }while(!numberOK);\n\n return nr;\n }",
"@Test\n\tpublic void testInputWithMoreNumbers() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (int i = 0; i <= 100; i++) {\n\t\t\tsb.append(i);\n\t\t\tif (i <100) {\n\t\t\t\tsb.append(\" \");\n\t\t\t}\n\t\t}\n\t\t\n\t\tassertEquals(\"Many numbers in input string\", 5050L, calculator.calculeteSum(sb.toString()).longValue());\n\t}",
"public int getMaximumNumber() {\n\t\treturn 99999;\n\t}",
"public static boolean isValidLength(String test) {\n return test.length() <= MAX_CHARACTERS;\n }",
"public static int getMaxDigits(Integer list[]) {\n\t\tint maxDigits = 0;\n\t\t// Iterate through the list.\n\t\tint digits;\n\t\tfor (int i = 0; i < list.length; i++) {\n\t\t\tdigits = getDigits(list[i]);\n\t\t\tif (digits > maxDigits) {\n\t\t\t\tmaxDigits = digits;\n\t\t\t}\n\t\t}\n\t\t// Return the max digits from the inputs.\n\t\treturn maxDigits;\n\t}",
"public static boolean onlyDigitsApi(String input) {\n if (input.length() == 0) {\n return false;\n } else {\n try {\n Long.parseLong(input);\n return true;\n } catch (NumberFormatException ex) {\n return false;\n }\n }\n }",
"public boolean isContainNumericalDigits(String password) {\n\t\treturn password.matches(\".*[0-9].*\");\n\t}",
"public boolean lastDigit(int a, int b) {\n return (a % 10 == b % 10);\n}",
"private int caculateMaxCharNumber(ElementCasePane reportPane) {\n\t\tint maxCharNumber = 5;\n\t\tmaxCharNumber = Math.max(maxCharNumber, (\"\" + (reportPane.getGrid().getVerticalValue() + reportPane.getGrid().getVerticalExtent())).length() + 1);\n\n\t\treturn maxCharNumber;\n\t}",
"public static boolean passwordDigitCheck (String password){\n int numberOfDigits = 0;\n for (int i = 0; i < password.length(); i++){\n if (Character.isDigit(password.charAt(i))){\n numberOfDigits++;\n }\n if (numberOfDigits >=3){\n return true;\n }\n }\n return false;\n }",
"int getMaxCharSize();",
"private boolean checkInt(String str) {\n\t\ttry {\n\t\t\tint integer = Integer.parseInt(str);\n\t\t\tif(integer>=0&&integer<100000){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch(Exception e) {\n\t\t\treturn false;\n\t\t}\n\t}",
"int main()\n{\n long int a;\n cin>>a;\n int count=0;\n int flag=0;\n if(a>=0){\n while(a>0)\n {\n if(a%10!=0)\n {\n flag=1;\n }\n a=a/10;\n count=count+1;\n }}\n else if(a<0)\n {\n while(a<0)\n {\n a=a/10;\n count=count+1;\n }\n }\n if(flag==0)\n {\n count++;\n }\n cout<<count;return 0;\n}",
"public void setMaximumIntegerDigits(int newValue) {\n super.setMaximumIntegerDigits(Math.min(newValue, DOUBLE_INTEGER_DIGITS));\n }",
"public int getMaxLength();",
"private void check6(){\n \n if (errorCode == 0){\n \n int firstSecond = Integer.parseInt(number.substring(0,2));\n int seventhEight = Integer.parseInt(number.substring(6,8));\n \n if (firstSecond + seventhEight != 100){\n valid = false;\n errorCode = 6;\n }\n }\n\t}",
"public int getMaxLength() {\n return maxLength;\n }",
"public static boolean exceedsMaxCount() {\n final long maxTestCount = HostConfig.getMaxTestCount();\n return (maxTestCount > 0) && (mTestCount >= maxTestCount);\n }",
"private int getNumDigits(int x) {\n int ans = 1;\n for (int digit = 9; digit >=0; digit--) {\n int power_of_ten = (int) Math.pow(10, digit);\n if (x / power_of_ten > 0) {\n ans = digit + 1;\n break;\n }\n }\n \n return ans;\n }",
"public boolean large_num(SLList pum) \n {\n // SLList for storing pum \n SLList pum_temp = new SLList(pum.first(), pum.rest());\n // For loop to iterate temporary list \n for (int i = 0; i < pum_temp.length(); i++)\n {\n // Conditional if statement to check length of string \n if(pum_temp.first.toString().length() > 3)\n {\n // Return true statement\n return true;\n }\n }\n // Set the pum_temp to the rest of pum_temp\n pum_temp = pum_temp.rest();\n // Return false statement\n return false;\n }",
"public static boolean isIncreasing(int inputNumber) \r\n{ \r\n//converts the number into string \r\nString str = Integer.toString(inputNumber); \r\nchar digit; \r\n//flag set to true \r\nboolean flag = true; \r\n//iterates over the string up to length-1 \r\nfor(int i=0;i < str.length()-1;i++) \r\n{ \r\ndigit = str.charAt(i); \r\n//if any digit is greater than check next digit, it will not check further \r\nif(digit > str.charAt(i+1)) \r\n{ \r\n//flag set to false if the condition returns true \r\nflag = false; \r\nbreak; \r\n} \r\n} \r\nreturn flag; \r\n}",
"public int getMaxLength() {\r\n return _maxLength;\r\n }",
"public boolean validateNummer() {\n\t\treturn (nummer >= 10000 && nummer <= 99999 && nummer % 2 != 0); //return true==1 oder false==0\n\t}",
"private void validateDigits(List<Integer> digits) throws DigitException {\n int validDigits = 0;\n for (int digit : digits) {\n if (digit % 2 == 0 || digit == 9) {\n validDigits = validDigits + 1;\n }\n }\n if (validDigits == 0) {\n int number = convertToNumber(digits);\n throw new DigitException(\"Invalid number: \" + number + \" that would cause division by 0\");\n }\n }",
"private boolean checkDigit(String code, int length) {\n int len = length - 1;\n int[] digits = new int[len];\n int digitSum = 0;\n int lastDigit;\n\n if (length == 13) {\n lastDigit = Integer.parseInt(String.valueOf(code.charAt(len)));\n for (int i = 0; i < len; i++) {\n int digit = Integer.parseInt(String.valueOf(code.charAt(i)));\n\n if (i % 2 == 0) {\n digits[i] = digit;\n } else {\n digits[i] = digit * 3;\n }\n }\n\n for (int i = 0; i < digits.length; i++) {\n digitSum = digitSum + digits[i];\n }\n\n if (10 - (digitSum % 10) == lastDigit) {\n return true;\n } else if ((digitSum % 10) == 0 && lastDigit == 0) {\n return true;\n } else {\n return false;\n }\n\n } else if (length == 10) {\n if (String.valueOf(code.charAt(len)).equals(\"X\") ||\n String.valueOf(code.charAt(len)).equals(\"x\")) {\n lastDigit = 10;\n } else {\n lastDigit = Integer.parseInt(String.valueOf(code.charAt(len)));\n }\n\n int weight = 11;\n for (int i = 0; i < len; i++) {\n int digit = Integer.parseInt(String.valueOf(code.charAt(i)));\n weight--;\n digits[i] = digit * weight;\n }\n\n for (int i = 0; i < digits.length; i++) {\n digitSum = digitSum + digits[i];\n }\n\n if (11 - (digitSum % 11) == lastDigit) {\n return true;\n } else {\n return false;\n }\n\n } else {\n return false;\n }\n }",
"public final boolean isValidRootLength(long rootLength) {\n return rootLength >= 0 && rootLength <= 10;\n }",
"private void checkLength(String value, int maxLength) throws WikiException {\r\n\t\tif (value != null && value.length() > maxLength) {\r\n\t\t\tthrow new WikiException(new WikiMessage(\"error.fieldlength\", value, Integer.valueOf(maxLength).toString()));\r\n\t\t}\r\n\t}",
"private boolean isValid(String input){\n return input.length() == 10 && input.matches(\"-?\\\\d+(\\\\.\\\\d+)?\");\n //check its digits\n }",
"public int getNumberOfDigits()\n\t{\n\t\t// TO DO\n\t\treturn infNumber.length;\n\t}",
"private static void displayNumbers(){\n BigInteger bigInteger = new BigInteger(create50DigitString());\n int i = 1;\n do {\n // Checking the remainder's int value == 0 since the requirement is to find the number greater than Long.MAX_VALUE and divisible by 2 or 3.\n if (bigInteger.remainder(new BigInteger(\"2\")).intValue() == 0 || bigInteger.remainder(new BigInteger(\"3\")).intValue() == 0) {\n System.out.println(bigInteger);\n i++;\n }\n// Incrementing the bigInteger\n bigInteger = bigInteger.add(new BigInteger(\"1\"));\n// Exit condition\n } while (i != 11);\n }",
"private boolean isDigit(char toCheck) {\n return toCheck >= '0' && toCheck <= '9';\n }",
"private static String largestNumber(String[] a) {\n String result = \"\";\n\n List<String> strArr = new ArrayList<>(Arrays.asList(a));\n\n// Collections.sort(strArr, Collections.reverseOrder());\n\n int longestNumberLength = 0;\n for (int i = 0; i < strArr.size(); i++) {\n if (strArr.get(i).length() > longestNumberLength) {\n longestNumberLength = strArr.get(i).length();\n }\n }\n\n int nDigit = 0;\n int maxNDigit = 0;\n int maxFirstDigit = 0;\n int maxSecondDigit = 0;\n int maxThirdDigit = 0;\n int maxFourthDigit = 0;\n int maxFifthDigit = 0;\n for (int i = 0; i < strArr.size(); i++) {\n if (strArr.get(i).length() >= nDigit + 1 && (strArr.get(i).charAt(nDigit) - '0') > maxNDigit) {\n maxNDigit = strArr.get(i).charAt(nDigit) - '0';\n }\n }\n\n List<String> maxNDigitNumbers = new ArrayList<>();\n\n for (int i = 0; i < strArr.size(); i++) {\n if (strArr.get(i).length() >= nDigit + 1 && (strArr.get(i).charAt(nDigit) - '0') == maxNDigit) {\n maxNDigitNumbers.add(strArr.get(i));\n }\n }\n\n\n// for (String s : maxNDigitNumbers) {\n// result = new StringBuilder().append(result).append(s).toString();\n// }\n\n return result;\n }",
"public static void main(String[] args) {\n\t\tString str = \"15-15-26\";\r\n\t\tSystem.out.println(str.length() + \"\");\r\n\t\tSystem.out.println(Double.MAX_VALUE);\r\n\t\tSystem.out.println(Integer.MAX_VALUE + \" \" + (Integer.MAX_VALUE+\"\").length());\r\n\t}",
"private static boolean isValidDigit(String strInput) {\n boolean isValid = true;\n if (isPrimitive(strInput)) {\n int input = Integer.parseInt(strInput);\n if (input < 1 || input > 255) {\n log.debug(\"Wrong config input value: {}\", strInput);\n isValid = false;\n } else {\n isValid = true;\n }\n\n } else {\n isValid = false;\n }\n\n return isValid;\n }",
"public static void main(String[] args) {\n\t\tint [] nums = {0,1,0,1,1,1,0,0,1,1,0,1,1,1,1,1,1,0,1,1,0,1,1,0,0,0,1,0,1,0,0,1,0,1,1,1,1,1,1,0,0,0,0,1,0,0,0,1,1,1,0,1,0,0,1,1,1,1,1,0,0,1,1,1,1,0,0,1,0,1,1,0,0,0,0,0,0,1,0,1,0,1,1,0,0,1,1,0,1,1,1,1,0,1,1,0,0,0,1,1};\r\n\t\tSystem.out.println(findMaxLength(nums));\r\n\r\n\t}",
"public boolean checkDigits(String password) {\n return password.matches(\".*\\\\d.*\");\n }",
"public int getMaxLength(){\n return this.maxLength;\n }",
"public static Boolean Digit(String arg){\n\t\tif(arg.length() == 1 && Is.Int(arg)){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"private boolean checkLengthPlateNumber(EditText text, TextInputLayout TFB, String massage) {\n if(text.getText().toString().length() > 10)\n {\n TFB.setErrorEnabled(true);\n TFB.setError(massage);\n return false;\n }\n else\n {\n TFB.setErrorEnabled(false);\n return true;\n }\n }",
"public boolean checkSizeIsMax(int[] is) {\n\t\treturn is.length == MAX_BOARD_SIZE;\r\n\t}",
"public static String getValidPhone(Scanner mIn, int maxLen, String prompt){\n String store = \"\";\n boolean valid = false;\n while(!valid){\n System.out.print(prompt +\": \");\n store = mIn.nextLine();\n if(store.length() == maxLen){\n try{\n Long.parseLong(store);\n valid = true;\n }catch (NumberFormatException nf){\n System.out.println(\"Invalid Input. Please enter a phone number with only digits.\");\n valid = false;\n }\n }else{\n System.out.println(\"Invalid Input. Please enter phone number \" + maxLen + \" digits in length.\");\n }\n }\n return store;\n }",
"public static boolean hasBetweenSixAndNineChars(String password)\r\n {\r\n return (password.length() > 5 && password.length() < 10);\r\n }",
"@Test\n\tpublic void repeatingIndexOfLastDigitTest() {\n\t\tAssert.assertTrue(ifn.repeatingIndexOfLastDigit() == 60);\n\t}",
"public static int numberOfDigits(long d) { \n\t\t\t\tString num = d + \"\"; \n\t\t\t\treturn num.length(); \n\t\t\t}",
"public void setMaxLength(int maxLength) {\r\n _maxLength = maxLength;\r\n }",
"public static int alldigits(int x) {\n count1=0;\n do {\n x = x / 10;\n count1++;\n } while (x != 0);\n return count1;\n }",
"private boolean checkOdometerNumber(EditText text, TextInputLayout TFB, String massage) {\n if(text.getText().toString().length() > 8)\n {\n TFB.setErrorEnabled(true);\n TFB.setError(massage);\n return false;\n }\n else\n {\n TFB.setErrorEnabled(false);\n return true;\n }\n }",
"public static boolean isAtLeastXCharacters(String value, int x) {\r\n\t\ttry {\r\n\t\t\treturn value.length() >= x;\r\n\t\t}\r\n\t\tcatch(Exception e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public boolean ifFieldTooBig(){\n if (SphericalUtil.computeArea(mMapInterface.getPathFrame()) > MAX_FIELD_SIZE) { //if the field is too big\n Toast.makeText(getContext(), getString(R.string.field_too_big), Toast.LENGTH_LONG).show();\n return true;\n }\n return false;\n }",
"public static int digits(int a) {\n\t\tint digits=0; // initialize to 0 first\n\t\twhile(a !=0) { // while a is not 0 do under\n\t\t\ta = a/10; // since its dividing by integer if the number is lower than 10 it will return 0;\n\t\t\tdigits++; // when a/10 != 0 add 1 to digits \n\t\t}\n\t\treturn digits; // return digits\n\t}",
"private boolean isValidOption(int choice, int maxChoice)\n {\n return choice > 0 && choice <= maxChoice;\n }",
"public void setMaxLength(int value) {\n this.maxLength = value;\n }",
"int getMaxPrecision();",
"short digits();",
"public static boolean isArmStrongNumber(int num){\n\n String number = String.valueOf(num); // converting int to String (String.valueOf)\n int multiplier = number.length(); // find the length; if length is 3 digits\n int sum =0;\n\n for(int i=0; i<multiplier; i++){ // loop the original number\n int digit = Integer.parseInt(\"\" +number.charAt(i));\n sum += Math.pow(digit,multiplier);\n }\n return sum == num;\n\n\n\n }",
"public abstract int getMaxLength();",
"public Integer getMaxLength() {\n\t\treturn maxLength;\n\t}",
"private boolean checkInteger(String str) {\n try {\n return Integer.parseInt(str) <= 30; // Check if the entered value is an Integer and <= 30;\n } catch (NumberFormatException e) {\n return false;\n }\n }",
"private static boolean verify(int value, int size) {\r\n return size > 0 && size < Integer.SIZE\r\n && Integer.SIZE - Integer.numberOfLeadingZeros(value) <= size;\r\n }",
"private boolean isValidInput(String input) \r\n {\r\n\t \r\n return input!=null&&input.length()<=10;\r\n \r\n }",
"public boolean check3sameNumbersMax(String password) {\n for (int i = 0; i < password.length() - 3; i++) {\n if (String.valueOf(password.charAt(i)).matches(\"\\\\d\")) { //next time: Character.isDigit(passtword.charAt(i))\n for (int j = i; j < i+3; j++) {\n if (password.charAt(j) != password.charAt(j + 1)) {\n break;\n } else if (j-i == 2) {\n return false;\n }\n }\n }\n }\n return true;\n }",
"public boolean setRequestedDigits(int digits_requested) {\n\n //TODO CHANGE THIS\n\n this.digitsRequested = digits_requested;\n\n if (digits_requested > MAX_DIGITS_REQUESTED) {\n System.err.println(\"Maximum digit count is \" + MAX_DIGITS_REQUESTED);\n return false;\n }\n\n if (digits_requested <= 10) {\n System.err.println(\"Digit count must be positive and > 10\");\n return false;\n }\n\n return true;\n }",
"public void MaxlengthPhoneNumber() {\n\t\tCommonFunctions.elementAttributeContainsValue(PhoneNumber, \"maxlength\", \"10\");\n\t}",
"@Test\n\tpublic void testMaximumNumber() {\n\t\tdouble tmpRndVal = 0.0;\n\t\tdouble tmpRndVal2 = 0.0;\n\t\tdouble tmpResult = 0.0;\n\t\t\n\t\t//testing with negative numbers\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\ttmpRndVal = doubleRandomNegativeNumbers();\n\t\t\ttmpRndVal2 = doubleRandomNegativeNumbers();\n\t\t\ttmpResult = Math.max(tmpRndVal, tmpRndVal2);\n\t\t\tassertTrue( (tmpResult == ac.maximumNumber(tmpRndVal, tmpRndVal2))\n\t\t\t\t\t|| (0.0 == ac.maximumNumber(tmpRndVal, tmpRndVal2)) );\n\t\t}\n\t\t\n\t\t//testing with positive numbers\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\ttmpRndVal = doubleRandomPositiveNumbers();\n\t\t\ttmpRndVal2 = doubleRandomPositiveNumbers();\n\t\t\ttmpResult = Math.max(tmpRndVal, tmpRndVal2);\n\t\t\tassertTrue((tmpResult == ac.maximumNumber(tmpRndVal, tmpRndVal2))\n\t\t\t|| (0.0 == ac.maximumNumber(tmpRndVal, tmpRndVal2)) \n\t\t\t|| (-0.123456789 == ac.maximumNumber(tmpRndVal, tmpRndVal2)));\n\t\t}\n\t\t\n\t\t//testing with zero\n\t\tdouble zero = 0.0;\n\t\tdouble inpResult = 0.0;\n\t\t\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tinpResult = Math.max(zero, zero);\n\t\t\t//System.out.println(inpResult + \" ############\");\n\t\t\tassertTrue( (inpResult == ac.maximumNumber(zero, zero)) );\n\t\t}\n\t\t\n\t}",
"public boolean hasValidLength(String field, int maxLength) {\n return field.length() <= maxLength;\n }",
"private static boolean multipleOfTen(double direction) {\r\n\t\treturn (direction % 10)==0; \r\n\t}",
"@Override\n\tpublic String toStringMaxDecimalDigits(final int afterDecimalPoint) {\n\t\treturn null;\n\t}",
"public static Boolean isValidNhsNumber(String toTest) {\n if (Strings.isNullOrEmpty(toTest)) {\n return null;\n }\n\n if (toTest.length() != 10) {\n return Boolean.FALSE;\n }\n\n int sum = 0;\n char[] chars = toTest.toCharArray();\n for (int i=0; i<9; i++) {\n char c = chars[i];\n\n if (!Character.isDigit(c)) {\n return Boolean.FALSE;\n }\n\n int val = Character.getNumericValue(c);\n int weight = 10 - i;\n int m = val * weight;\n sum += m;\n }\n\n int remainder = sum % 11;\n int check = 11 - remainder;\n if (check == 11) {\n check = 0;\n }\n if (check == 10) {\n return Boolean.FALSE;\n }\n\n char lastChar = chars[9];\n int actualCheck = Character.getNumericValue(lastChar);\n if (check != actualCheck) {\n return Boolean.FALSE;\n }\n return Boolean.TRUE;\n }",
"public boolean isLovely(int n) {\n List<String> digits = new ArrayList<>(Arrays.asList(Integer.toString(n).split(\"\")));\n Map<String,Integer> toCount = new HashMap<>();\n\n for (String dig:digits) {\n if (!toCount.containsKey(dig)) {\n toCount.put(dig,1);\n } else {\n toCount.put(dig,toCount.get(dig) + 1);\n }\n }\n for (Integer value:toCount.values()) {\n if (value > 2)\n return false;\n }\n return true;\n }",
"public static boolean minCharRequirementPassed(String toCheck, int limit) {\n if (toCheck == null) return false;\n return toCheck.length() >= limit;\n }",
"public boolean checkConNum(String temp) {\n boolean counter = true;\n char[] ch = new char[temp.length()];\n \n for (int i = 0; i < temp.length(); i++) {\n ch[i] = temp.charAt(i);\n }\n \n for(int g = 0 ;g < ch.length; g++){\n \tif(!Character.isDigit(ch[g])){\n counter = false;\n break;\n \t}\n }\n \n return counter;\n \n }",
"public void setMaxTextLength(int max) {\n/* 520 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"public boolean validate(int value) {\n return (Integer.toString(value).length() == 4) ? true : false;\n }",
"public int getMaxLength() {\r\n\t\treturn fieldMaxLength;\r\n\t}",
"static boolean overflowInParse(long current, int digit, int radix) {\n if (current >= 0) {\n if (current < maxValueDivs[radix]) {\n return false;\n }\n if (current > maxValueDivs[radix]) {\n return true;\n }\n // current == maxValueDivs[radix]\n return (digit > maxValueMods[radix]);\n }\n\n // current < 0: high bit is set\n return true;\n }",
"void overflowDigits() {\n for (int i = 0; i < preDigits.length(); i++) {\n char digit = preDigits.charAt(i);\n // This could be implemented with a modulo, but compared to the main\n // loop this code is too quick to measure.\n if (digit == '9') {\n preDigits.setCharAt(i, '0');\n } else {\n preDigits.setCharAt(i, (char)(digit + 1));\n }\n }\n }",
"public void setDigitCount(long value) {\n this.digitCount = value;\n }",
"public boolean checkLength(String password) {\n return password.matches(\"^.{8,25}$\");\n }",
"public static void main(String[] args) {\n int number = 990;\n boolean result = number > 1000 || number % 10 == 0;\n System.out.println(result);\n }",
"public static void alldigitscheck(int x, int l) {\n do {\n int y = x % 10;\n digits[y] = digits[y] + l;\n x = x / 10;\n } while (x != 0);\n }",
"public static int returnNLength(int numberLength, int decimalLength){\n\t\treturn ((decimalLength > 0) ? numberLength - 1 : numberLength);\n\t}",
"public static void main(String[] args) {\n int min=100;\n int max=999;\n int random = (int) (min + Math.random() * (max - min));\n int a=random%10;\n int a1=(random/10)%10;\n int a2=(random/100)%10;\n System.out.println(\"Число = \" +random +\" наибольшее число = \" +Math.max(a, Math.max(a1,a2)));\n}",
"private static boolean isSingleDigit(int number) {\n\t\treturn number < 10;\n\t}",
"public static int maxLength(String integerNumber, String addNum) {\n\t\tint maxL = 0;\n\t\t// Get the maxLength of two numbers\n\t\tif (integerNumber.charAt(0) == '-') {\n\t\t\tintegerNumber = integerNumber.substring(1);\n\t\t}\n\t\tif (addNum.charAt(0) == '-') {\n\t\t\taddNum = addNum.substring(1);\n\t\t}\n\t\tif (integerNumber.length() >= addNum.length()) {\n\t\t\tmaxL = integerNumber.length();\n\t\t} else {\n\t\t\tmaxL = addNum.length();\n\t\t}\n\t\treturn maxL;\n\t}",
"protected int getNbDigit() {\n return nbDigit;\n }",
"private boolean isPhoneValid(String password) {\n return password.length() == 10;\r\n }",
"public static int getValidNum() {\n int num;\n\n num = input.nextInt();\n while (num < NUM_MIN || num > NUM_MAX) {\n System.out.print(\"Please enter a valid number from \" + NUM_MIN + \" to \" + NUM_MAX + \": \");\n num = input.nextInt();\n }\n return num;\n }",
"public boolean meetsMinimumLength(){\n\n return alg.meetsMinimumLength(input.getText().toString());\n }",
"public int wiggleMaxLength3(int[] nums) {\n if(nums == null || nums.length == 0){\n return 0;\n } else if(nums.length == 1){\n \treturn 1;\n }\n \n int len = nums.length;\n int[] tempNums = new int[len - 1];\n int maxLen = 0;\n int preFlag = 0;\n \n for(int i = 0; i < len - 1; i++){\n if(nums[i] - nums[i + 1] > 0){\n tempNums[i] = 1;\n } else if(nums[i] - nums[i + 1] < 0){\n tempNums[i] = -1;\n } else {\n tempNums[i] = 0;\n }\n }\n \n for(int i = 0; i < len - 1; i++){\n \tif(tempNums[i] != 0){\n \t\tif(preFlag == 0){\n \t\t\tpreFlag = tempNums[i];\n \t\t\tmaxLen++;\n \t\t} else if(preFlag * tempNums[i] == -1){\n \t\t\tpreFlag = tempNums[i];\n \t\t\tmaxLen++;\n \t\t} \t\t\n \t}\n }\n \n return maxLen + 1;\n }",
"public static int maxRun(String str) {\n\t\tif(str.length() == 0) return 0;\n\t\tint max = 1, curLen = 1;\n\t\tchar lastChar = str.charAt(0);\n\t\tfor(int i = 1; i < str.length(); i++){\n\t\t\tif(str.charAt(i) == lastChar) {\n\t\t\t\tcurLen++;\n\t\t\t} else {\n\t\t\t\tlastChar = str.charAt(i);\n\t\t\t\tcurLen = 1;\n\t\t\t}\n\t\t\tif (curLen > max) max = curLen;\n\t\t}\n\t\treturn max;\n\t}",
"public static void nDigits(int num) {\r\n for(int x = ((int)Math.pow(10, num - 1)); x < (int)Math.pow(10, num); x++) {\r\n if(x % 2 == 0){\r\n if(conditionChecker(x)) {\r\n System.out.println(x);\r\n }\r\n }\r\n }\r\n }",
"private static boolean checkLength(String password) {\n \treturn password.length() >= minLength;\n }",
"private boolean validNum (int num) {\n if (num >= 0) return true;\n else return false;\n }",
"public LengthCheck(int maxLength) {\n this.maxLength = maxLength;\n }"
] | [
"0.71069163",
"0.66942513",
"0.62052023",
"0.6136906",
"0.6098808",
"0.60070664",
"0.5987239",
"0.5986909",
"0.598297",
"0.5950162",
"0.5894608",
"0.58900034",
"0.5858699",
"0.5847059",
"0.5822172",
"0.5812941",
"0.580123",
"0.57846093",
"0.5765961",
"0.57591647",
"0.5732146",
"0.57274055",
"0.5704063",
"0.5658359",
"0.5630889",
"0.5629099",
"0.5628734",
"0.5620053",
"0.56173015",
"0.56031",
"0.55998695",
"0.559798",
"0.5584427",
"0.5572568",
"0.5565033",
"0.5564287",
"0.556055",
"0.55545497",
"0.5553432",
"0.5553036",
"0.55504656",
"0.5542039",
"0.55322444",
"0.5525759",
"0.551975",
"0.5510924",
"0.5496488",
"0.54931176",
"0.54897344",
"0.5485872",
"0.548094",
"0.5472919",
"0.5460022",
"0.5453492",
"0.54528606",
"0.54492486",
"0.5445189",
"0.5431979",
"0.5431786",
"0.5420943",
"0.541366",
"0.5405237",
"0.5389369",
"0.5369628",
"0.5364388",
"0.53607076",
"0.53586894",
"0.53573376",
"0.5357237",
"0.53569037",
"0.53539246",
"0.5352422",
"0.53522676",
"0.5349688",
"0.53493905",
"0.5345639",
"0.5345188",
"0.5344535",
"0.5342536",
"0.53414744",
"0.53397965",
"0.5338734",
"0.53347504",
"0.5328489",
"0.53212357",
"0.5316353",
"0.5314557",
"0.531016",
"0.53089124",
"0.53065187",
"0.5293653",
"0.52885324",
"0.52820486",
"0.52816504",
"0.52776814",
"0.5270056",
"0.5265325",
"0.5262081",
"0.52606386",
"0.52603817",
"0.5251073"
] | 0.0 | -1 |
4 STEP: 1. find the mid. 2. cut the list to two list. 3. REVERSE the right side. 4. MERGE the two list. | public void reorderList(ListNode head) {
if (head == null) {
return;
} else if (head.next == null) {
return;
}
ListNode pre = findMidPre(head);
// cut the two list.
ListNode right = pre.next;
pre.next = null;
// reverse the right link.
right = reverse(right);
merge(head, right);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static void merge(ArrayList<Integer> leftList, ArrayList<Integer> rightList, ArrayList<Integer> outList) {\n\n int leftIndex = 0;\n int rightIndex = 0;\n int outIndex = 0;\n\n while (leftIndex < leftList.size() && rightIndex < rightList.size()) {\n\n if (leftList.get(leftIndex).compareTo(rightList.get(rightIndex)) <= 0) {\n outList.set(outIndex, leftList.get(leftIndex));\n leftIndex++;\n } else {\n outList.set(outIndex, rightList.get(rightIndex));\n rightIndex++;\n }\n\n outIndex++;\n\n }\n\n if (leftIndex < leftList.size()) {\n copyRemainder(leftList, leftIndex, outList, outIndex);\n } else {\n copyRemainder(rightList, rightIndex, outList, outIndex);\n }\n\n }",
"private static void merge(ArrayList<Integer> a, int left, int mid, int right) {\n\t\tint chunk1 = mid - left + 1;\r\n\t\tint chunk2 = right - mid;\r\n\t\tArrayList<Integer> tempArrLeft = new ArrayList<>();\r\n\t\tArrayList<Integer> tempArrRight = new ArrayList<>();\r\n\t\t//pipe data into temps\r\n\t\tfor (int i=0; i < chunk1; ++i) {\r\n\t\t\ttempArrLeft.add(a.get(left + i));\r\n\t\t}\r\n\t\tfor (int j=0; j < chunk2; ++j) {\r\n\t\t\ttempArrRight.add(a.get(mid + 1 + j));\r\n\t\t}\r\n\r\n\t\t//merge temp arrays\r\n\t\tint i = 0, j = 0;\r\n\t\tint k = left;\r\n\t\twhile (i < chunk1 && j < chunk2) {\r\n\t\t\tif (tempArrLeft.get(i) <= tempArrRight.get(j)) {\r\n\t\t\t\ta.set(k, tempArrLeft.get(i));\r\n\t\t\t\ti++;\r\n\t\t\t} else {\r\n\t\t\t\ta.set(k, tempArrRight.get(j));\r\n\t\t\t\tj++;\r\n\t\t\t}\r\n\t\t\tk++;\r\n\t\t}\r\n\t\twhile (i < chunk1) {\r\n\t\t\ta.set(k, tempArrLeft.get(i));\r\n\t\t\ti++;\r\n\t\t\tk++;\r\n\t\t}\r\n\t\twhile (j < chunk2) {\r\n\t\t\ta.set(k, tempArrRight.get(j));\r\n\t\t\tj++;\r\n\t\t\tk++;\r\n\t\t}\r\n\t}",
"private void merge(ArrayList<Integer> list, int low, int middle, int high) {\n\t\tArrayList<Integer> temp = new ArrayList<Integer>();\n\t\tList<Integer> s1;\n\t\tList<Integer> s2;\n\t\t\n\t\ts1 = new ArrayList<>(list.subList(low, middle + 1));\n\t\ts2 = new ArrayList<>(list.subList(middle + 1, high + 1));\n\t\t\n\t\tint i1 = 0;\n\t\tint i2 = 0;\n\t\t\n\t\twhile (i1 < s1.size() && i2 < s2.size()) {\n\t\t\tif(s1.get(i1).compareTo(s2.get(i2)) <= 0) {\n\t\t\t\ttemp.add(s1.get(i1));\n\t\t\t\ti1++;\n\t\t\t} else {\n\t\t\t\ttemp.add(s2.get(i2));\n\t\t\t\ti2++;\n\t\t\t}\n\t\t}\n\t\t\n\t\twhile (i1 < s1.size()) {\n\t\t\ttemp.add(s1.get(i1));\n\t\t\ti1++;\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < temp.size();i++) {\n\t\t\tlist.set(i + low, temp.get(i));\n\t\t}\n\t}",
"public void merge(List<Integer> a, List<Integer> l, List<Integer> r, int left, int right) \n {\n \n int i = 0, j = 0, k = 0;\n while (i < left && j < right) \n {\n if (l.get(i) < r.get(j)) \n {\n a.add(k++, l.get(i++));\n a.remove(k);\n }\n else \n {\n a.add(k++, r.get(j++));\n a.remove(k);\n }\n }\n \n while (i < left) \n {\n a.add(k++, l.get(i++));\n a.remove(k);\n }\n while (j < right) \n {\n a.add(k++, r.get(j++));\n a.remove(k);\n }\n }",
"private void merge(ArrayList <Comparable> a, int first, int mid, int last){\r\n\t\tsteps += 5;\r\n\t\tArrayList<Comparable> temp = new ArrayList<Comparable>();\r\n\t\tint firstInd = first;\r\n\t\tint middle = mid + 1;\r\n\t\tsteps += 2;\r\n\t\twhile (firstInd <= mid && (middle) <= last) {\r\n\t\t\tif (a.get(firstInd).compareTo(a.get(middle)) < 0) {\r\n\t\t\t\ttemp.add(a.get(firstInd));\r\n\t\t\t\tfirstInd ++;\r\n\t\t\t\tsteps += 7;\r\n\t\t\t}else if (a.get(middle).compareTo(a.get(firstInd)) < 0){\r\n\t\t\t\ttemp.add(a.get(middle));\r\n\t\t\t\tmiddle++;\r\n\t\t\t\tsteps += 7;\r\n\t\t }else {\r\n\t\t\t\ttemp.add(a.get(middle));\r\n\t\t\t\tmiddle++;\r\n\t\t\t\tsteps += 3;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (firstInd >= mid + 1) {\r\n\t\t\tsteps += 4;\r\n\t\t\tfor (int i = middle; i <= last; i++) {\r\n\t\t\t\ttemp.add(a.get(i));\r\n\t\t\t}\r\n\t\t\tsteps += 3;\r\n\t\t}else {\r\n\t\t\tsteps += 2;\r\n\t\t\tfor (int i = firstInd; i <= mid; i++) {\r\n\t\t\t\ttemp.add(a.get(i));\r\n\t\t\t}\r\n\t\t\tsteps += 3;\r\n\t\t}\r\n\t\tsteps += 3;\r\n\t\tint j = 0;\r\n\t\tfor (int i = first; i <= last; i++) {\r\n\t\t\ta.set(i, temp.get(j));\r\n\t\t\tj++;\r\n\t\t\tsteps += 4;\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Merge\");\r\n\t\tSystem.out.println();\r\n\r\n\t}",
"private static MyList Merge(MyList L1, MyList L2)\n\t{\n\t\t//however, one assumption is that the length of L1>L2, because of our mid algorithm\n\t\tMyList merged = new MyList(0);//its next is the resulting merged list\n\t\tMyList current = merged;//current points where we are at the time of merging\n\t\tint turn = 1;//we define a turn to know which list element to be merged per loop cycle\n\t\twhile(L1!=null && L2!=null)\n\t\t{\n\t\t\tif(turn==1)//pick from L1\n\t\t\t{\n\t\t\t\tcurrent.next = L1;\n\t\t\t\tL1 = L1.next;//update L1's index to right\n\t\t\t\tturn = 2;//next loop we pick from L2\n\t\t\t}\n\t\t\telse//pick from L2\n\t\t\t{\n\t\t\t\tcurrent.next = L2;\n\t\t\t\tL2 = L2.next;//update L1's index to right\n\t\t\t\tturn = 1;//back to L1 next cycle\n\t\t\t}\n\t\t\tcurrent = current.next;//update the current pointer\n\t\t}\n\t\t//as we said L1's length may be longer than L2 considering size of array\n\t\tif(L1!=null)//we merge the remaining L1 to our current.next\n\t\t\tcurrent.next = L1;\n\n\t\treturn merged.next;\n\t}",
"private void mergeHalves(int[] array, int[] temp, int leftStart, int rightEnd){\r\n int leftEnd = (rightEnd + leftStart)/2;\r\n int rightStart = leftEnd + 1;\r\n int size = rightEnd - leftStart + 1;\r\n\r\n int left = leftStart;\r\n int right = rightStart;\r\n int index = leftStart;\r\n\r\n while(left <= leftEnd && right <= rightEnd){\r\n if(array[left] <= array[right]){\r\n temp[index] = array[left];\r\n left++;\r\n }else {\r\n temp[index] = array[right];\r\n right++;\r\n }\r\n index++;\r\n }\r\n System.arraycopy(array, left, temp, index, leftEnd - left + 1);\r\n System.arraycopy(array, right, temp, index, rightEnd - right + 1);\r\n System.arraycopy(temp, leftStart, array, leftStart, size);\r\n }",
"public void merge(int[] inputArray, int start, int mid, int end) {\n int s1 = mid - start + 1;\n int s2 = end - mid;\n\n //Create a left and right array\n int L[] = new int [s1];\n int R[] = new int [s2];\n\n //Copy elements into two separate arrays\n for (int i=0; i<s1; ++i)\n L[i] = inputArray[start + i];\n for (int j=0; j<s2; ++j)\n R[j] = inputArray[mid + 1+ j];\n\n\n int i = 0, j = 0;\n int k = start;\n\n //Start your comparision\n while (i < s1 && j < s2)\n {\n if (L[i] <= R[j])\n {\n inputArray[k] = L[i];\n i++;\n }\n else\n {\n inputArray[k] = R[j];\n j++;\n }\n k++;\n }\n\n //Copy the remaining elements\n while (i < s1)\n {\n inputArray[k] = L[i];\n i++;\n k++;\n }\n while (j < s2)\n {\n inputArray[k] = R[j];\n j++;\n k++;\n }\n }",
"private static void merge(int[] nums, int low, int mid, int high) {\n int n1=mid-low+1;\n int n2=high-mid;\n int[] left=new int[n1];\n int[] right=new int[n2];\n for (int i = 0; i <n1 ; i++) {\n left[i]=nums[i+low];\n }\n for (int j = 0; j < n2; j++) {\n right[j]=nums[mid+1+j];\n }\n int k=low;\n int i=0,j=0;\n while (i< left.length && j< right.length){\n if(left[i]<right[j]){\n nums[k++]=left[i++];\n }\n else {\n nums[k++]=right[j++];\n }\n }\n //copy the remaining elements\n\n while (i<left.length){\n nums[k++]=left[i++];\n }\n while (j< right.length){\n nums[k++]=right[j++];\n }\n }",
"public static void mergeReverse(int[] nums, int start, int mid, int end) {\n\n if (nums[mid - 1] >= nums[mid]) {\n return;\n }\n\n int i = start; // i points to first index of left array\n int j = mid; // j points to first index of right array\n int tempIndex = 0;\n int[] tempArray = new int[end - start]; //new array to hold the sorted elements.\n while (i < mid && j < end) {\n tempArray[tempIndex++] = nums[i] >= nums[j] ? nums[i++] : nums[j++];\n }\n\n System.arraycopy(nums, i, nums, start + tempIndex, mid - i);\n // now copying complete temp array to input array.\n System.arraycopy(tempArray, 0, nums, start, tempIndex);\n\n }",
"private static void merge(ArrayList<Score> items, int start, int mid, int end) {\r\n Object[] temp = new Object[items.size()];\r\n int pos1 = start;\r\n int pos2 = mid + 1;\r\n int spot = start;\r\n\r\n while (!(pos1 > mid && pos2 > end)) {\r\n if ((pos1 > mid) || ((pos2 <= end) && (items.get(pos2).compareTo(items.get(pos1)) < 0))) {\r\n temp[spot] = items.get(pos2);\r\n pos2 += 1;\r\n } else {\r\n temp[spot] = items.get(pos1);\r\n pos1 += 1;\r\n }\r\n spot += 1;\r\n }\r\n for (int i = start; i <= end; i++) {\r\n items.set(i, (Score) temp[i]);\r\n }\r\n }",
"public static void merge(int inputArray[], int start, int mid, int end) {\n // must account for first marker being pos 0\n int tempArray[] = new int[end - start + 1];\n\n // index counter for l array\n int leftMarker = start;\n // index counter for r array\n int rightMarker = mid + 1;\n // index counter for temporary array\n int k = 0;\n\n // while L isn't past midpoint and R isn't past end\n // fill out tempArray based on which value is higher\n while (leftMarker <= mid && rightMarker <= end) {\n if (inputArray[leftMarker] < inputArray[rightMarker]) {\n tempArray[k] = inputArray[leftMarker];\n leftMarker = leftMarker + 1;\n } else {\n tempArray[k] = inputArray[rightMarker];\n rightMarker = rightMarker + 1;\n }\n k = k + 1;\n }\n\n // Only one condition must be true to break out of above loop\n // we could theoretically make it to the end of left array\n // without making it to the end of right array\n if (leftMarker <= mid) {\n while (leftMarker <= mid) {\n tempArray[k] = inputArray[leftMarker];\n leftMarker = leftMarker + 1;\n k = k + 1;\n\n }\n } else if (rightMarker <= end) {\n while (rightMarker <= end) {\n tempArray[k] = inputArray[rightMarker];\n rightMarker = rightMarker + 1;\n k = k + 1;\n }\n }\n\n // copy over the temp array into inputArray\n for (int i = 0; i < tempArray.length; i++) {\n // we add \"start\" to i so that\n // we only write to the \"window\"'s location\n // and the window frame will move from left to right and expand\n // as the recursion proceeds\n inputArray[i + start] = tempArray[i];\n }\n }",
"private void merge(int lb, int mid, int ub, int[] ar){\n\t\tint i = lb ,j = lb + mid, k = 0;\n\t\tint[] out = new int[ub - lb + 1];\n\t\twhile( (i <= lb + mid - 1) && (j <= ub)){\n\t\t if(ar[i] <= ar[j]) out[k++] = ar[i++];\n\t\t else out[k++] = ar[j++];\n\t\t}\n\t\twhile(i <= lb + mid - 1) out[k++] = ar[i++];\n\t\twhile(j <= ub) \t out[k++] = ar[j++];\n\t\tfor(int l = 0; l < k; l++) ar[lb + l] = out[l];\n\t}",
"private static void merge(int[] arr, int start, int mid, int end) {\n\t\tint length1 = mid - start + 1;\n\t\tint length2 = end - mid;\n\t\tint left[] = new int[length1];\n\t\tint right[] = new int[length2];\n\t\tfor (int index =0; index < length1; index++) {\n\t\t\tleft[index] = arr[start+index];\n\t\t}\n\t\tfor (int index =0; index < length2; index++) {\n\t\t\tright[index] = arr[mid+index+1];\n\t\t}\n\t\tint leftIndex = 0;\n\t\tint rightIndex = 0;\n\t\tint index = start;\n\t\twhile (leftIndex < length1 && rightIndex < length2) {\n\t\t\tif (left [leftIndex] < right[rightIndex]) {\n\t\t\t\tarr[index] = left[leftIndex];\n\t\t\t\tleftIndex ++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tarr[index] = right[rightIndex];\n\t\t\t\trightIndex++;\n\t\t\t\tnumberOfInversions += (mid - leftIndex)+1;\n\t\t\t}\n\t\t\tindex++;\n\t\t}\n\t\twhile (leftIndex < length1) {\n\t\t\tarr[index] = left[leftIndex];\n\t\t\tleftIndex++;\n\t\t\tindex++;\n\t\t}\n\t\twhile (rightIndex < length2) {\n\t\t\tarr[index] = right[rightIndex];\n\t\t\trightIndex++;\n\t\t\tindex++;\n\t\t}\n\t\t\t\n\t\t\n\t}",
"private void merge(ArrayList<Integer> arrayList, int p, int q, int r){\n ArrayList<Integer> lowHalf = new ArrayList<>();\r\n ArrayList<Integer> topHalf = new ArrayList<>();\r\n\r\n int k = p;\r\n int i;\r\n int j;\r\n\r\n //Values from original array entered into the new arrays\r\n for (i = 0; k <= q; i++, k++) {\r\n lowHalf.add(i, arrayList.get(k));\r\n }\r\n for (j = 0; k <= r; j++, k++) {\r\n topHalf.add(j, arrayList.get(k));\r\n }\r\n\r\n\r\n k = p;\r\n i = 0;\r\n j = 0;\r\n\r\n\r\n while (i < lowHalf.size() && j < topHalf.size()) {\r\n if (lowHalf.get(i) < topHalf.get(j)) {\r\n arrayList.set(k, lowHalf.get(i));\r\n i++;\r\n } else {\r\n arrayList.set(k, topHalf.get(j));\r\n j++;\r\n }\r\n k++;\r\n }\r\n\r\n while (i < lowHalf.size()) {\r\n arrayList.set(k, lowHalf.get(i));\r\n k++;\r\n i++;\r\n }\r\n while (j < topHalf.size()) {\r\n arrayList.set(k, topHalf.get(j));\r\n k++;\r\n j++;\r\n }\r\n }",
"private static void mergeHalves(\n\t\tint[] ints,\n\t\tint[] copyOfInts,\n\t\tint min,\n\t\tint mid,\n\t\tint max\n\t\t) {\n\n\t\tSystem.arraycopy(ints, min, copyOfInts, min, max - min);\n\n\t\tint overallPos = min;\n\t\tint firstHalfPos = min;\n\t\tint secondHalfPos = mid;\n\n\t\twhile (firstHalfPos < mid && secondHalfPos < max) {\n\t\t\tif (copyOfInts[firstHalfPos] < copyOfInts[secondHalfPos]) {\n\t\t\t\tints[overallPos] = copyOfInts[firstHalfPos];\n\t\t\t\tfirstHalfPos++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tints[overallPos] = copyOfInts[secondHalfPos];\n\t\t\t\tsecondHalfPos++;\n\t\t\t}\n\t\t\toverallPos++;\n\t\t}\n\n\t\t// if the second half has been exhausted, move the remainder\n\t\t// of the first half to the end of the sorted array\n\t\twhile (firstHalfPos < mid) {\n\t\t\tints[overallPos] = copyOfInts[firstHalfPos];\n\t\t\tfirstHalfPos++;\n\t\t\toverallPos++;\n\t\t}\n\n\t}",
"public static void merge(int[] array, int start, int mid, int end) {\n if (array[mid - 1] <= array[mid]) {\n return;\n }\n\n // Index variables\n int i = start;\n int j = mid;\n int tempIndex = 0;\n\n // Create a temp array large enough to hold all elements in the left and right partitions\n int[] temp = new int[end - start];\n\n // While there are elements left in any of the left and right partitions...\n while (i < mid && j < end) {\n /* \n temp[tempIndex++] = array[i] <= array[j] ? array[i++] : array[j++];\n */\n // If the left element is smaller than or equal to the right...\n if (array[i] <= array[j]) {\n // Assign the left element to the temp array, and increment tempIndex and i\n temp[tempIndex++] = array[i++];\n } else {\n // Else assign the right element to the temp array, and increment tempIndex and j\n temp[tempIndex++] = array[j++];\n }\n }\n\n // At this point, either left or right partition will now be empty. \n // Then we simply merge the rest from another partition into temp array \n // as elements left are all larger than the largest elements in the temp array.\n /*\n System.arraycopy(src, srcPos, dest, destPos, length)\n src => source array\n srcPos => source index\n dest => destination array\n destPos => destination index\n */\n\n // Start at unhandled index of the left partition and copy over the rest of the elements\n // to the end of the array from index we've copied over to temp array so far.\n // If there are left over elements in the right partitions, they're already in the end of the array.\n // In the next step, we will be copying over the sorted and merged array from temp array \n // back to the original array, so the the beginning of the array is now sorted in the original array.\n System.arraycopy(array, i, array, start + tempIndex, mid - i);\n\n // Copy the elements in the temp array back into the original array\n System.arraycopy(temp, 0, array, start, tempIndex);\n }",
"private static void merge(int[] nums, int[] work, int start, int mid, int end){\n\t\tboolean loop = true;\n\t\tint counter1 = start;\n\t\tint counter2 = mid+1;\n\t\tint workCounter = start;\n\t\t\n\t\twhile(loop){\n\t\t\tif(counter1 > mid){\n\t\t\t\t// Copy all elements from 2nd end to work\n\t\t\t\tfor(int i=counter2; i<=end; i++)\n\t\t\t\t\twork[workCounter++] = nums[i];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tif(counter2 > end){\n\t\t\t\t// Copy all elements from start-mid to work\n\t\t\t\tfor(int i=counter1; i<=mid; i++)\n\t\t\t\t\twork[workCounter++] = nums[i];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t// Swap the number if the numbers in are not is sorted order\n\t\t\tif(nums[counter1] < nums[counter2]){\n\t\t\t\twork[workCounter] = nums[counter1]; \n\t\t\t\tcounter1++;\n\t\t\t}else{\n\t\t\t\twork[workCounter] = nums[counter2]; \n\t\t\t\tcounter2++;\n\t\t\t}\n\t\t\t\n\t\t\tworkCounter++;\n\t\t}\n\t\t\n\t\t// Copy the sorted work array into main array\n\t\tfor(int i=start; i <= end; i++)\n\t\t\tnums[i] = work[i];\n\t}",
"public static void merge(int[] a, int[] temp, int low, int mid, int high) {\r\n // low is the low index of the part of the array to be sorted\r\n // high is the high index of the part of the array to be sorted\r\n // mid is the middle of the array – last item in low half\r\n\r\n // copy the two sets from a[] to the same locations in the temporary array\r\n for (int i = low; i <= high; i++) {\r\n temp[i] = a[i];\r\n }\r\n //set up necessary pointers\r\n int lowP = low; // pointer to current item in low half\r\n int highP = mid + 1; // pointer to current item in high half\r\n int aP = low; // pointer to where each item will be put back in a[]\r\n // while the pointers have not yet reached the end of either half\r\n while ((lowP <= mid) && (highP <= high)) {\r\n // if current item in low half <= current item in high half\r\n if (temp[lowP] <= temp[highP]) {\r\n // move item at lowP back to array a and increment low pointer\r\n a[aP] = temp[lowP];\r\n lowP++;\r\n } else {\r\n // move item at highP back to array a and increment high pointer\r\n a[aP] = temp[highP];\r\n highP++;\r\n } // end if..else\r\n\r\n // increment pointer for location in original array\r\n aP++;\r\n } // end while\r\n // if lowP is at end of low half, then low half is done, move rest of high half.\r\n if (lowP > mid) {\r\n for (int i = highP; i <= high; i++) {\r\n a[aP] = temp[i]; //\r\n aP++;\r\n } // end for\r\n } else // high half is done, move rest of low half\r\n {\r\n for (int i = lowP; i <= mid; i++) {\r\n a[aP] = temp[i];\r\n aP++;\r\n }// end for\r\n }\r\n//\r\n }",
"static void merge(double a[],int start,int mid, int end) {\r\n \tint i,j,k;\r\n \tint size1 = mid - start +1;\r\n \tint size2 = end - mid;\r\n \tif (size2 > 0 && size1 > 0) {\r\n \t\tdouble leftA[] = new double[size1]; // temp arrays\r\n \tdouble rightA[] = new double[size2];\r\n \tfor(i=0;i < size1;i++) leftA[i] = a[start+i]; //Copy data into temp arrays \r\n \tfor(j=0;j<size2;j++) rightA[j] = a[mid+1+j];\r\n \ti=0; // Merge temp arrays back into a[]\r\n \tj=0;\r\n \tk=start;\r\n \twhile (i<size1 && j < size2) {\r\n \t\tif(leftA[i]<=rightA[j]) {\r\n \t\t\ta[k]=leftA[i];\r\n \t\t\ti++;\r\n \t\t}else {\r\n \t\t\ta[k]=rightA[j];\r\n \t\t\tj++;\r\n \t\t}\r\n \t\tk++;\r\n \t}\r\n \twhile(i<size1) { //if remaining in leftA[] copy in\r\n \t\ta[k]=leftA[i];\r\n \t\ti++;\r\n \t\tk++;\r\n \t}\r\n \twhile(j<size2) { //if remaining in rightA[] copy in\r\n \t\ta[k]=rightA[j];\r\n \t\tj++;\r\n \t\tk++;\r\n \t}\r\n \t}\t\r\n }",
"private static void merge(int[] data, int left, int mid, int right) {\n\n\t\tint l = left; // 첫번째 부분 시작\n\t\tint m = mid + 1; // 두번째 부분 시작\n\t\tint k = left; // 배열 tempArr에 저장할 위치\n\n\t\tint[] tempArr = new int[data.length];\n\n\t\twhile (l <= mid && m <= right) {\n\n\t\t\tif (data[l] < data[m]) {\n\t\t\t\ttempArr[k++] = data[l++];\n\t\t\t} else {\n\t\t\t\ttempArr[k++] = data[m++];\n\t\t\t}\n\n\t\t}\n\n\t\twhile (l <= mid) {\n\t\t\ttempArr[k++] = data[l++];\n\t\t}\n\n\t\twhile (m <= right) {\n\t\t\ttempArr[k++] = data[m++];\n\t\t}\n\n\t\tfor (int index = left; index < k; index++) {\n\t\t\tdata[index] = tempArr[index];\n\t\t}\n\n\t\tprint(data);\n\t}",
"public static ArrayList<Integer> mergeSort(ArrayList <Integer> list){\n System.out.println();\n System.out.println(\"Insertion Sort\");\n System.out.println();\n if (3 > 2){\n int mid= list.size()/2;\n ArrayList<Integer> left= new ArrayList<Integer>(mid);\n ArrayList<Integer> right=new ArrayList<Integer>(list.size()-mid);\n for (int i = 0; i < mid; i++) {\n left.add(list.get(i));\n } \n\n for (int i = 0; i < list.size()-mid; i++) {\n right.add(list.get(i));\n } \n\n left = mergeSort(left); \n right = mergeSort(right);\n merge(left,right,list);\n }\n return list;\n }",
"void merge(int arr[], int left, int mid, int right) {\n\t\tint n1 = mid - left + 1;\n\t\tint n2 = right - mid;\n\n\t\t/* Create temporary arrays */\n\t\tint leftArray[] = new int[n1];\n\t\tint rightArray[] = new int[n2];\n\n\t\t/* Copy data to temporary arrays */\n\t\tfor (int i = 0; i < n1; ++i)\n\t\t\tleftArray[i] = arr[left + i];\n\t\tfor (int j = 0; j < n2; ++j)\n\t\t\trightArray[j] = arr[mid + 1 + j];\n\n\t\t/* Merge the temporary arrays */\n\n\t\t// Initial indexes of first and second sub-arrays\n\t\tint i = 0, j = 0;\n\n\t\t// Initial index of merged sub-array array\n\t\tint k = left;\n\t\twhile (i < n1 && j < n2) {\n\t\t\tif (leftArray[i] >= rightArray[j]) {\n\t\t\t\tarr[k] = leftArray[i];\n\t\t\t\ti++;\n\t\t\t} else {\n\t\t\t\tarr[k] = rightArray[j];\n\t\t\t\tj++;\n\t\t\t}\n\t\t\tk++;\n\t\t}\n\n\t\t/* Copy remaining elements of L[] if any */\n\t\twhile (i < n1) {\n\t\t\tarr[k] = leftArray[i];\n\t\t\ti++;\n\t\t\tk++;\n\t\t}\n\n\t\t/* Copy remaining elements of R[] if any */\n\t\twhile (j < n2) {\n\t\t\tarr[k] = rightArray[j];\n\t\t\tj++;\n\t\t\tk++;\n\t\t}\n\t\t\n\t}",
"private static void merge(int[] inputArray, int start, int mid, int end) {\n int tempArray [] = new int[end - start + 1]; //length of array\n\n // index counter for left side of Array\n int leftSlot = start;\n\n // index counter for right side of Array\n int rightSlot = mid + 1;\n\n // index for temp array\n int k = 0;\n\n while(leftSlot <= mid && rightSlot <= end){ //loop will run till left slot is less than mid value, and right slot is less than end index\n if(inputArray[leftSlot] < inputArray[rightSlot]){\n tempArray[k] = inputArray[leftSlot];\n leftSlot = leftSlot + 1; // incrementing the left slot\n }else {\n tempArray[k] = inputArray[rightSlot];\n rightSlot = rightSlot + 1; // incrementing the right slot\n }\n\n k = k+1; //need to increment the index of temp array so that value gets copied to correct place\n }\n\n /**\n * when it gets to here that means the above loop is completed and\n * both the left and right side of array are sorted\n */\n\n //there can be scenario that right array is sorted and left index is always less than right\n\n if(leftSlot <= mid){\n while(leftSlot <= mid){\n tempArray[k] = inputArray[leftSlot];\n leftSlot = leftSlot + 1;\n k = k + 1;\n }\n }else if(rightSlot <= end){\n while(rightSlot <= end){\n tempArray[k] = inputArray[rightSlot];\n rightSlot = rightSlot + 1;\n k = k + 1;\n }\n }\n for(int i=0;i< tempArray.length;i++){\n inputArray[start + i] = tempArray[i]; // copying back to original array\n }\n }",
"public void reorderList(ListNode head) {\n\n if(head == null||head.next == null) return;\n int len = 0;\n\n for (ListNode cur = head; cur!= null; cur = cur.next) len++;\n\n int middle = (len%2 == 1) ? len/2 + 1: len/2 ;\n\n ListNode midNode = head;\n for (int i = 0; i < middle - 1; i++)\n midNode = midNode.next;\n\n ListNode head1 = head;\n ListNode head2 = midNode.next;\n midNode.next = null;\n head2 = revertListAndReturnHead(head2);\n\n //MERGE\n ListNode cur1 = head1;\n ListNode cur2 = head2;\n while (cur1 != null && cur2 != null) {\n ListNode nextCur1 = cur1.next;\n ListNode nextCur2 = cur2.next;\n cur1.next = cur2;\n cur2.next = nextCur1;\n cur1 = nextCur1;\n cur2 = nextCur2;\n }\n\n }",
"static <T> ListNode<T> listZipping(ListNode<T> list) {\n int size = 1;\n\n ListNode<T> current = list;\n while (current.next != null) {\n size++;\n current = current.next;\n }\n\n if (size < 2) return list;\n\n current = list;\n for (int i = 0; i < (size - 1) / 2; i++) current = current.next;\n\n ListNode<T> secondHalf = current.next;\n current.next = null;\n\n // reverse the second half\n current = secondHalf;\n while (current.next != null) {\n ListNode<T> tmp = current.next;\n current.next = tmp.next;\n tmp.next = secondHalf;\n secondHalf = tmp;\n }\n\n // merge\n ListNode<T> firstHalf = list;\n for (int i = 0; i < size / 2; i++) {\n ListNode<T> firstHalfNext = firstHalf.next;\n firstHalf.next = secondHalf;\n ListNode<T> secondHalfNext = secondHalf.next;\n secondHalf.next = firstHalfNext;\n\n firstHalf = firstHalfNext;\n secondHalf = secondHalfNext;\n }\n\n\n return list;\n }",
"public void merge(int arr[], int left, int middle, int right) {\n\n int n1 = middle - left + 1;\n int n2 = right - middle;\n\n int L[] = new int[n1];\n int R[] = new int[n2];\n\n for (int i = 0; i < n1; ++i)\n L[i] = arr[left + i];\n for (int j = 0; j < n2; ++j)\n R[j] = arr[middle + 1 + j];\n\n int i = 0, j = 0;\n\n int k = left;\n while (i < n1 && j < n2) {\n if (L[i] <= R[j]) {\n arr[k] = L[i];\n i++;\n } else {\n arr[k] = R[j];\n j++;\n }\n k++;\n }\n\n while (i < n1) {\n arr[k] = L[i];\n i++;\n k++;\n }\n\n /* Copy remaining elements of R[] if any */\n while (j < n2) {\n arr[k] = R[j];\n j++;\n k++;\n }\n }",
"public ListNode mergeSortList(ListNode head) {\n \tif(head == null || head.next == null) return head;\n \t//递归的出口 空list或者 只有一个值的时候 直接返回 \n \tListNode mid=findMid(head); //找到中间值 \n \tListNode pointer=mid.next; //记录右边的开始\n \tmid.next=null; // 把list拆成两半 \n \tListNode part1=mergeSortList(head); //对前半部分mergeSort 并记录返回指针\n \tListNode part2=mergeSortList(pointer); //对后半部分mergeSort 并记录返回指针\n \treturn merge(part1, part2); //两部分再合并\n }",
"private void merge(List<Interval> list) {\n if(list == null) {\n return;\n }\n \n // first sort the list on their start time\n Collections.sort(list, new Comparator<Interval>() {\n\n @Override\n public int compare(Interval i1, Interval i2) {\n if(i1 == null && i2 == null) {\n return 0;\n } else if(i1 != null && i2 != null) {\n if(i1.start > i2.start) {\n return 1;\n } else if(i1.start == i2.start) {\n return 0;\n } else {\n return -1;\n }\n } else if(i1 != null) {\n return 1;\n } else {\n return -1;\n }\n }\n \n });\n \n int index = 0;\n \n // ensure there are at least 2 elements left\n while(index < list.size() - 1) {\n // get the next 2 consecutive elements from the list\n Interval a = list.get(index++);\n Interval b = list.get(index);\n \n\n if(a.start <= b.start && b.end <= a.end) {\n // a completely covers b then delete b\n list.remove(index--);\n } else if(a.start <= b.start && b.start < a.end) {\n // a and b overlaps some \n list.remove(index--);\n list.remove(index);\n \n // replace with the merged one\n list.add(index, new Interval(a.start, b.end));\n }\n }\n }",
"private List<Integer> merge(List<Integer> firstList, List<Integer> secondList) {\n List<Integer> resultList = new ArrayList<>();\n\n if (firstList.size() == 1 && secondList.size() == 1) {\n resultList.add(Math.min(firstList.get(0), secondList.get(0)));\n resultList.add(Math.max(firstList.get(0), secondList.get(0)));\n return resultList;\n }\n\n int firstIndex = 0;\n int secondIndex = 0;\n\n while (firstIndex < firstList.size() && secondIndex < secondList.size()) {\n if (firstList.get(firstIndex) < secondList.get(secondIndex)) {\n resultList.add(firstList.get(firstIndex));\n firstIndex++;\n } else {\n resultList.add(secondList.get(secondIndex));\n secondIndex++;\n }\n }\n\n if (firstIndex < firstList.size()) {\n for (int i = firstIndex; i < firstList.size(); i++) {\n resultList.add(firstList.get(i));\n }\n }\n\n if (secondIndex < secondList.size()) {\n for (int i = secondIndex; i < secondList.size(); i++) {\n resultList.add(secondList.get(i));\n }\n }\n\n return resultList;\n }",
"private void mergeHelp(WordList list, Comparator<String> comp, int start, int mid, int end) {\r\n\t \r\n\t \r\n\t int pos = 0;\r\n\t int a = start;\r\n\t int len = end - start + 1;\r\n\t int b = mid + 1;\r\n\t String[] sorted = new String[len];\r\n\t \r\n\t while(a <= mid && b <= end) {\r\n\t\t if(comp.compare(list.get(a), list.get(b)) == -1) { \r\n\t\t\t sorted[pos] = list.get(b);\r\n\t\t\t b++;\r\n\t\t }\r\n\t\t else {\r\n\t\t\t sorted[pos] = list.get(a);\r\n\t\t\t a++;\r\n\t\t }\r\n\t\t pos++;\r\n\t }\r\n\t \r\n\t while(a <= mid) {\r\n\t\t sorted[pos] = list.get(a);\r\n\t\t a++;\r\n\t\t pos++;\r\n\t }\r\n\t while(b <= end) {\r\n\t\t sorted[pos] = list.get(b);\r\n\t\t b++;\r\n\t\t pos++;\r\n\t }\r\n\t for(int i = 0; i < len; i++) {\r\n\t\t list.set(i + start, sorted[i]);\r\n\t }\r\n }",
"private static <T extends Comparable<? super T>> void mergeSort(List<T> list, int begin, int mid, int finish, T[] auxiliaryArray){\n if(begin + 1 == finish)\n merge(list, begin, mid, mid + 1, finish, auxiliaryArray);\n else{\n if(begin < finish){\n mergeSort(list, begin, (mid + begin)/2, mid, auxiliaryArray);\n mergeSort(list, mid + 1, (finish + mid)/2, finish, auxiliaryArray);\n merge(list, begin, mid, mid + 1, finish, auxiliaryArray);\n }\n }\n }",
"public static List<Integer> merge2(List<Integer> left, List<Integer> right) {\n ArrayList<Integer> result = new ArrayList<>();\n int leftIndex = 0;\n int rightIndex = 0;\n\n while (leftIndex < left.size() && rightIndex < right.size()) {\n if (left.get(leftIndex) < right.get(rightIndex)) {\n result.add(left.get(leftIndex));\n leftIndex++;\n } else {\n result.add(right.get(rightIndex));\n rightIndex++;\n }\n }\n List<Integer> leftRemaining = left.subList(leftIndex, left.size());\n List<Integer> rightRemaining = right.subList(rightIndex, right.size());\n\n result.addAll(leftRemaining);\n result.addAll(rightRemaining);\n\n return result;\n }",
"static void merge(int arr[], int low, int mid, int high){\n int len1 = mid-low+1;\n int len2 = high - mid;\n\n //Create temp arrays\n int left[] = new int[len1];\n int right[] = new int[len2];\n\n //Copy data into the temp arrays\n for(int i=0;i<len1;++i) left[i] = arr[low+i];\n\n for(int j=0;j<len2;++j) right[j] = arr[mid+1+j];\n\n /*Merge two arrays*/\n\n int i=0, j=0, k=low;\n\n while(i<len1 && j<len2)\n {\n if (left[i] <= right[j])\n {\n arr[k] = left[i];\n i++;\n }\n else\n {\n arr[k] = right[j];\n j++;\n }\n k++;\n\n }\n\n /* Copy remaining elements of left[] if any */\n while (i < len1)\n {\n arr[k] = left[i];\n i++;\n k++;\n }\n\n /* Copy remaining elements of right[] if any */\n while (j < len2)\n {\n arr[k] = right[j];\n j++;\n k++;\n }\n }",
"private void merge(Comparable[] a, int min, int mid, int max){\n for(int t = min; t <= max;t++){\n aux[t] = a[t];\n }\n \n int i = min; // start index for left side\n int j = mid + 1; // start index for right side\n \n for(int k = min; k <= max; k++){\n if(i > mid){\n a[k] = aux[j++];\n }\n else if(j > max){\n a[k] = aux[i++];\n }\n else if(aux[i].compareTo(aux[j]) < 0 ){\n a[k] = aux[i++];\n }\n else {\n a[k] = aux[j++];\n }\n }\n }",
"private void merge() {\n for (int i = low; i<high; i++){\n temparray[i]=nums[i];\n }\n\n int i = low;\n int j = middle;\n //index of the original array for which we are making compare\n int index = low;\n //copy the smallest from the left and right partition to temp\n while ((i<middle)&&(j<high)){\n if(temparray[i]<=temparray[j]){\n nums[index]=temparray[i];\n i++;\n }\n else {\n nums[index]=temparray[j];\n j++;\n }\n index++;\n }\n // copy the rest of the the left side\n while (i<middle){\n nums[index]= temparray[i];\n i++;\n index++;\n }\n //and the right\n while (j<high){\n nums[index]=temparray[j];\n j++;\n index++;\n }\n\n }",
"static void rvereseArray(int arr[], int start, int end)\r\n {\r\n int temp;\r\n while(start < end){\r\n \r\n temp = arr[start];\r\n arr[start] = arr[end];\r\n arr[end] = temp;\r\n //rvereseArray(arr, start+1, end-1);\r\n // move the left and right index pointers in toward the center\r\n start++;\r\n end--;\r\n }\r\n }",
"public static void merge(int []a , int low,int mid,int high) {\n int [] helper = new int[a.length] ; \n for (int i = low; i<=high; i++) {\n helper[i] = a[i]; \n }\n\n int i = low;\n int j = mid + 1;\n int k = low;\n\n // combine the low part of a and its high part \n while (i<=mid && j<=high) {\n if (helper[i] >= helper[j]){\n a[k] = helper[i];\n i++;\n } else {\n a[k] = helper[j];\n j++;\n }\n k++;\n }\n\n // copy the rest of low part of a if there is any\n while (i<=mid) {\n a[k] = helper[i];\n i++; k++;\n }\n\n\n // copy the rest of the high part of a if there is any\n while (j<=high) {\n a[k] = helper[j];\n j++;k++;\n }\n\n // out put each time we sort and let you watch the change sequence\n for (int Item:a) {\n System.out.print(Item+\" \");\n }\n System.out.println();\n\n }",
"public static void merge(List<Integer> values, int prefixStart,\r\n int suffixStart, int suffixEnd) {\r\n List<Integer> temp = new ArrayList<>();\r\n\r\n int i = prefixStart;\r\n int j = suffixStart;\r\n\r\n while (i < suffixStart && j < suffixEnd) {\r\n if (values.get(i) < values.get(j)) {\r\n temp.add(values.get(i));\r\n i++;\r\n } // if\r\n else {\r\n temp.add(values.get(j));\r\n j++;\r\n } // else\r\n } // while\r\n\r\n while (i < suffixStart) {\r\n temp.add(values.get(i));\r\n i++;\r\n } // while\r\n\r\n while (j < suffixEnd) {\r\n temp.add(values.get(j));\r\n j++;\r\n } // while\r\n\r\n i = prefixStart;\r\n for (int index = 0; index < temp.size(); index++) {\r\n values.set(i, temp.get(index));\r\n i++;\r\n } // for\r\n }",
"public static void mergeSortReverse(int[] nums, int start, int end) {\n // check for the base condition\n if (end - start < 2) {\n return;\n }\n // otherwise break the array [10, 2, 6, -12, 5,12,16] into parts\n int mid = (start + end) / 2;\n // now got the mid and array is divided\n // Left array - [10, 2, 6] & Right array - [-12, 5, 12, 16]\n mergeSortReverse(nums, start, mid); //calling mergeSort for left array\n mergeSortReverse(nums, mid, end); //calling mergeSort for right array\n // merge the sorted array\n mergeReverse(nums, start, mid, end);\n }",
"public static void merge(int[] list1, int[] list2, int[] temp){\n //Current index in three lists\n int current1 = 0;\n int current2 = 0;\n int current3 = 0;\n\n while(current1 < list1.length && current2 < list2.length){\n if(list1[current1] < list2[current2])\n temp[current3++] = list1[current1++];\n else\n temp[current3++] = list2[current2++];\n }\n //Rest of the list1 to temp\n while(current1 < list1.length)\n temp[current3++] = list1[current1++];\n //Rest of the list2 to temp\n while(current2 < list2.length)\n temp[current3++] = list2[current2++];\n }",
"public static void prefixMerge(Client [] list1, Client [] list2, Client[] result){\n int resultCount = 0;\n for (int i = 0; resultCount < result.length; i++) //goes through list1 up until the end of result\n {\n for (int j = 0; j < list2.length && resultCount < result.length; j++) //goes through list2 up until the end of list2\n {\n for (int k = 0; k < resultCount; k++) { //check if current element of list2 is already in result\n if (list2[j].compareClient(result[k]) == 0) { j++; } //without this there is an issue where the previous element of list1 is\n } //repeated in list2 but the current element of list1 is larger\n\n if (list2[j].compareClient(list1[i]) < 0) { //copies current element of list2 to result if it is smaller\n result[resultCount] = list2[j]; //than current element of list1\n resultCount++;\n }\n }\n if (resultCount < result.length) { //copies current element of list1 to result if there is room in result\n result[resultCount] = list1[i]; // needed if statement because of outOfBounds exception where all elements\n resultCount++; //in result were already filled by list2\n }\n }\n\n }",
"private static void mergeDesc(int arr[], int start,int mid, int end) {\n\r\n\t\t\t\tint subArrLen1 = mid - start + 1;\r\n\t\t\t\tint subArrLen2 = end - mid;\r\n\r\n\t\t\t\t// create the sub Arrays as temporary storage\r\n\t\t\t\tint subArray1[] = new int[subArrLen1];\r\n\t\t\t\tint subArray2[] = new int[subArrLen2];\r\n\r\n\t\t\t\t// copy data in temporary arrays\r\n\r\n\t\t\t\tfor (int i = 0; i < subArrLen1; i++) {\r\n\t\t\t\t\tsubArray1[i] = arr[start + i];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor (int i = 0; i < subArrLen2; i++) {\r\n\t\t\t\t\tsubArray2[i] = arr[mid + i + 1];\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// merging the temporary arrays\r\n\r\n\t\t\t\tint i = 0, j = 0;\r\n\t\t\t\tint k = start;\r\n\r\n\t\t\t\twhile (i < subArrLen1 && j < subArrLen2) {\r\n\t\t\t\t\tif (subArray1[i] > subArray2[j]) {\r\n\t\t\t\t\t\tarr[k] = subArray1[i];\r\n\t\t\t\t\t\ti++;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tarr[k] = subArray2[j];\r\n\t\t\t\t\t\tj++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tk++;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// copy left over elements of subArray2[]\r\n\t\t\t\twhile (i < subArrLen1) {\r\n\t\t\t\t\tarr[k] = subArray1[i];\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\tk++;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// copy left over elements of subArray2[]\r\n\t\t\t\twhile (j < subArrLen2) {\r\n\t\t\t\t\tarr[k] = subArray2[j];\r\n\t\t\t\t\tj++;\r\n\t\t\t\t\tk++;\r\n\t\t\t\t}\r\n\r\n\t}",
"protected static <T extends Comparable<? super T>> void merge(List<T> a,\n List<T> tmpArray, int low, int high){\n int leftEnd = (low + high)/2;\n int leftPos = low;\n int rightPos = leftEnd + 1;\n int rightEnd = high;\n\n // merge into beginning of tmpArray\n int tmpPos = 0;\n int numElements = high - low + 1;\n\n while(leftPos <= leftEnd && rightPos <= rightEnd){\n // if value at leftPos is less than rightPos\n // copy leftPos into tmpArray and increment leftPos\n if(a.get(leftPos).compareTo(a.get(rightPos)) <= 0){\n tmpArray.set(tmpPos, a.get(leftPos));\n leftPos++;\n \n } else { // else rightPos is less and should be copied\n tmpArray.set(tmpPos, a.get(rightPos));\n rightPos++;\n }\n\n // in either case increment tmpPos\n tmpPos++;\n }\n\n // copy rest of left array if right array finished first\n while(leftPos <= leftEnd){\n tmpArray.set(tmpPos, a.get(leftPos));\n // increment left and tmp position\n leftPos++;\n tmpPos++;\n }\n\n // copy rest of right array if left array finished first\n while(rightPos <= rightEnd){\n tmpArray.set(tmpPos, a.get(rightPos));\n // increment right and tmp position\n rightPos++;\n tmpPos++;\n }\n\n // copy tmpArray back into array a\n for(int i = 0; i < numElements; i++){\n a.set(low+i, tmpArray.get(i));\n }\n }",
"public ListNode mergeInBetween(ListNode list1, int a, int b, ListNode list2) {\n final ListNode vituralHead = new ListNode(0);\n vituralHead.next = list1;\n\n ListNode cursor = vituralHead;\n int index = 0;\n\n ListNode aNode = null;\n ListNode bNode = null;\n while (cursor != null) {\n\n if (index == a) {\n aNode = cursor;\n }\n\n if (index == b + 1) {\n bNode = cursor;\n break;\n }\n\n index++;\n cursor = cursor.next;\n }\n\n ListNode tailOfList2 = list2;\n while (tailOfList2.next != null) {\n tailOfList2 = tailOfList2.next;\n }\n\n aNode.next = list2;\n tailOfList2.next = bNode.next;\n return vituralHead.next;\n }",
"public static List<Integer> merge(List<Integer> left,List<Integer> right) {\n\t\tList<Integer> mergeArray = new ArrayList<Integer>();\n\t\tint leftLen = left.size();\n\t\tint rightLen = right.size();\n\t\tint len = leftLen+rightLen;\n\t\tint i=0;\n\t\tint j=0;\n\t\twhile(len!=0) {\n\t\t\tif(i<leftLen && j<rightLen && left.get(i)<right.get(j)) {\n\t\t\t\tmergeArray.add(left.get(i));\n\t\t\t\ti++;\n\t\t\t\tlen--;\n\t\t\t\tcontinue;\n\t\t\t}else if(i<leftLen && j<rightLen && left.get(i)>right.get(j)) {\n\t\t\t\tmergeArray.add(right.get(j));\n\t\t\t\tj++;\n\t\t\t\tlen--;\n\t\t\t\tcontinue;\n\t\t\t}else if(i<leftLen && j>= rightLen) {\n\t\t\t\tmergeArray.add(left.get(i));\n\t\t\t\ti++;\n\t\t\t\tlen--;\n\t\t\t\tcontinue;\n\t\t\t}else if(j<rightLen && i>= leftLen) {\n\t\t\t\tmergeArray.add(right.get(j));\n\t\t\t\tj++;\n\t\t\t\tlen--;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\treturn mergeArray;\n\t}",
"private static void mergeAsc(int arr[], int start, int mid, int end) {\n\r\n\t\tint subArrLen1 = mid - start + 1;\r\n\t\tint subArrLen2 = end - mid;\r\n\r\n\t\t// create the sub Arrays as temporary storage\r\n\t\tint subArray1[] = new int[subArrLen1];\r\n\t\tint subArray2[] = new int[subArrLen2];\r\n\r\n\t\t// copy data in temporary arrays\r\n\r\n\t\tfor (int i = 0; i < subArrLen1; i++) {\r\n\t\t\tsubArray1[i] = arr[start + i];\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i < subArrLen2; i++) {\r\n\t\t\tsubArray2[i] = arr[mid + i + 1];\r\n\t\t}\r\n\r\n\t\t// merging the temporary arrays\r\n\r\n\t\tint i = 0, j = 0;\r\n\t\tint k = start;\r\n\r\n\t\twhile (i < subArrLen1 && j < subArrLen2) {\r\n\t\t\tif (subArray1[i] <= subArray2[j]) {\r\n\t\t\t\tarr[k] = subArray1[i];\r\n\t\t\t\ti++;\r\n\t\t\t} else {\r\n\t\t\t\tarr[k] = subArray2[j];\r\n\t\t\t\tj++;\r\n\t\t\t}\r\n\t\t\tk++;\r\n\r\n\t\t}\r\n\r\n\t\t// copy left over elements of subArray2[]\r\n\t\twhile (i < subArrLen1) {\r\n\t\t\tarr[k] = subArray1[i];\r\n\t\t\ti++;\r\n\t\t\tk++;\r\n\t\t}\r\n\r\n\t\t// copy left over elements of subArray2[]\r\n\t\twhile (j < subArrLen2) {\r\n\t\t\tarr[k] = subArray2[j];\r\n\t\t\tj++;\r\n\t\t\tk++;\r\n\t\t}\r\n\r\n\t}",
"void merge(int []arr,int low, int mid, int high){\n int n1 = mid-low+1;\n int n2 = high-mid; //high - (mid+1)+1\n\n //create temp arrays\n int temp1[] = new int[n1];\n int temp2[] = new int[n2];\n\n //copy data to temp arrays\n for(int i=0;i<n1;i++){\n temp1[i] = arr[low+i];\n }\n for(int i=0;i<n2;i++){\n temp2[i] = arr[mid+1+i];\n }\n\n //Merge the temp arrays\n int i=0, j=0,k=low;\n while(i<n1 && j <n2){\n if(temp1[i]<temp2[j]){\n arr[k++] = temp1[i++];\n }else{\n arr[k++] = temp2[j++];\n }\n }\n\n //copy remaining elements\n while(i<n1){\n arr[k++]= temp1[i++];\n }\n while(j<n2){\n arr[k++] = temp2[j++];\n }\n }",
"private static <T extends Comparable<? super T>> void merge(List<T> list, int firstBegin, int firstFinish, int secondBegin, int secondFinish, T[] auxiliaryArray){\n int firstIndex = firstBegin;\n int secondIndex = secondBegin;\n int auxiliaryIndex = 0;\n while(firstIndex <= firstFinish && secondIndex <= secondFinish){\n if(list.get(firstIndex).compareTo(list.get(secondIndex)) <= 0){\n auxiliaryArray[auxiliaryIndex] = list.get(firstIndex);\n firstIndex++;\n }else{\n auxiliaryArray[auxiliaryIndex] = list.get(secondIndex);\n secondIndex++;\n }\n auxiliaryIndex++;\n }\n while(firstIndex <= firstFinish){\n auxiliaryArray[auxiliaryIndex] = list.get(firstIndex);\n firstIndex++;\n auxiliaryIndex++;\n }\n while(secondIndex <= secondFinish){\n auxiliaryArray[auxiliaryIndex] = list.get(secondIndex);\n secondIndex++;\n auxiliaryIndex++;\n }\n auxiliaryIndex = 0;\n for(int i = firstBegin; i <= secondFinish; i++){\n list.set(i, auxiliaryArray[auxiliaryIndex]);\n auxiliaryIndex++;\n }\n }",
"void merge(int[] array, int[] helper, int low, int middle, int high) {\n for(int i = low; i <= high; i++) {\n helper[i] = array[i];\n }\n\n int helperLeft = low;\n int helperRight = middle + 1;\n int current = low;\n\n //Iterate through helper array. Compare left and right half, copying back\n //the smaller element from the two halves into the original array\n while(helperLeft <= middle && helperRight <= high) {\n if(helper[helperLeft] <= helper[helperRight]) {\n array[current] = helper[helperLeft];\n helperLeft++;\n }\n else { //If right element is smaller than left element\n array[current] = helper[helperRight];\n helperRight++;\n }\n current++;\n }\n\n //Copy the rest of the left side of the array into the target array\n int remaining = middle - helperLeft;\n for(int i = 0; i <= remaining; i++) {\n array[current + i] = helper[helperLeft + i];\n }\n }",
"public static void merge(Integer[] gArray, int low, int mid1, int mid2, int high, Integer[] destArray) {\n\t\tint i = low, j = mid1, k = mid2, l = low;\n// escoje el más pequeño de los más pequeños en los\n//tres rangos\n\t\twhile ((i < mid1) && (j < mid2) && (k < high)) {\n\t\t\tif (gArray[i].compareTo(gArray[j]) < 0) {\n\t\t\t\tif (gArray[i].compareTo(gArray[k]) < 0) {\n\t\t\t\t\tdestArray[l++] = gArray[i++];\n\t\t\t\t} else {\n\t\t\t\t\tdestArray[l++] = gArray[k++];\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tif (gArray[j].compareTo(gArray[k]) < 0) {\n\t\t\t\t\tdestArray[l++] = gArray[j++];\n\t\t\t\t} else {\n\t\t\t\t\tdestArray[l++] = gArray[k++];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\twhile ((i < mid1) && (j < mid2)) {\n\t\t\tif (gArray[i].compareTo(gArray[j]) < 0) {\n\t\t\t\tdestArray[l++] = gArray[i++];\n\t\t\t} else {\n\t\t\t\tdestArray[l++] = gArray[j++];\n\t\t\t}\n\t\t}\n\t\twhile ((j < mid2) && (k < high)) {\n\t\t\tif (gArray[j].compareTo(gArray[k]) < 0) {\n\t\t\t\tdestArray[l++] = gArray[j++];\n\t\t\t} else {\n\t\t\t\tdestArray[l++] = gArray[k++];\n\t\t\t}\n\t\t}\n\t\twhile ((i < mid1) && (k < high)) {\n\t\t\tif (gArray[i].compareTo(gArray[k]) < 0) {\n\t\t\t\tdestArray[l++] = gArray[i++];\n\t\t\t} else {\n\t\t\t\tdestArray[l++] = gArray[k++];\n\t\t\t}\n\t\t}\n\t\twhile (i < mid1) {\n\t\t\tdestArray[l++] = gArray[i++];\n\t\t}\n\t\twhile (j < mid2) {\n\t\t\tdestArray[l++] = gArray[j++];\n\t\t}\n\t\twhile (k < high) {\n\t\t\tdestArray[l++] = gArray[k++];\n\t\t}\n\t}",
"int merge(int list1, int list2) {\n\t\t\n\t\t// Get values of the lists\n\t\t\n\t\tComparable c1 = array[list1];\n\t\tComparable c2 = array[list2];\n\n\t\t// compare values\n\t\t\n\t\tint small = list1, big = list2;\n\t\tif (c1 != c2 && c1 != null && c1.compareTo(c2) > 0) {\n\n\t\t\tsmall = list2;\n\t\t\tbig = list1;\n\t\t}\n\n\t\t/*\n\t\t * If small list has no tail - set big list to be small list tail\n\t\t * If small list has tail - merge it with the big list and set result to be small list tail\n\t\t */\n\t\t\n\t\tif (next[small] == NIL)\n\t\t\tnext[small] = big;\n\t\telse\n\t\t\tnext[small] = merge(next[small], big);\n\t\t\n\t\t// return small list with new tail\n\t\t\n\t\treturn small;\n\t}",
"public static int[] merge(int[] A, int start, int middle, int end, int[] B) {\n int i = start;\n int j = middle;\n for (int k = start; k < end; k++) {\n if (i < middle && (j >= end || A[i] <= A[j])) {\n B[k] = A[i];\n i++;\n } else {\n B[k] = A[j];\n j++;\n }\n }//end for\n return A;\n }",
"private void mergeSubArr(int lowerIndex, int middle, int higherIndex) {\n \t\n \tArrayList tempMergArr = new ArrayList();\n \t\n \t\n \tfor (int i = 0; i < lowerIndex; i++){\n \t\ttempMergArr.add(i, 0);\n \t} \t\n \t\n for (int i = lowerIndex; i <= higherIndex; i++) {\n tempMergArr.add(i, (int)unsorted.get(i));\n }\n \n int i = lowerIndex;\n int j = middle + 1;\n int l = lowerIndex;\n while (i <= middle && j <= higherIndex) {\n if ((int)tempMergArr.get(i) <= (int)tempMergArr.get(j)) {\n unsorted.set(l, tempMergArr.get(i));\n i++;\n } else {\n unsorted.set(l, tempMergArr.get(j));\n j++;\n }\n l++;\n }\n while (i <= middle) {\n unsorted.set(l, tempMergArr.get(i));\n l++;\n i++;\n }\n while (j <= middle) {\n \tunsorted.set(l, tempMergArr.get(j));\n \tl++;\n \ti++;\n }\n\n \n }",
"private void merge(int[] left, int[] right, int[] a) {\n\t\t// i - left\n\t\t// j - right\n\t\t// k - original\n\t\tint i = 0, j = 0, k = 0;\n\t\tint sL = left.length;\n\t\tint sR = right.length;\n\n\t\twhile (i < sL && j < sR) {\n\t\t\tif (left[i] < right[j]) {\n\t\t\t\ta[k] = left[i];\n\t\t\t\ti++;\n\t\t\t} else {\n\t\t\t\ta[k] = right[j];\n\t\t\t\tj++;\n\t\t\t}\n\t\t\tk++;\n\t\t}\n\n\t\twhile (i < sL) {\n\t\t\ta[k] = left[i];\n\t\t\tk++;\n\t\t\ti++;\n\t\t}\n\t\twhile (j < sR) {\n\t\t\ta[k] = right[j];\n\t\t\tk++;\n\t\t\tj++;\n\t\t}\n\t}",
"public static ListNode mergeTwoList(ListNode list1, ListNode list2){\n if (list1 == null) return list2;\n if (list2 == null) return list1;\n\n ListNode head = null;\n ListNode p = list1;\n ListNode q = list2;\n\n if (p.val <= q.val) {\n head = p;\n p = p.next;\n }\n else {\n head = q;\n q = q.next;\n }\n ListNode point = head;\n\n while (p != null && q != null){\n if (p.val <= q.val){\n point.next = p;\n p = p.next;\n\n }else {\n point.next = q;\n q = q.next;\n\n }\n point = point.next;\n }\n\n if (p == null){\n point.next = q;\n }else {\n point.next = p;\n }\n\n return head;\n }",
"private void mergeSortRec(WordList list, Comparator<String> comp, int start, int end)\r\n {\r\n // TODO\r\n\t int middle = start + (end - start)/2; \r\n\t \r\n\t if(start < end) {\r\n\t\t mergeSortRec(list, comp, start, middle);\r\n\t\t mergeSortRec(list, comp, middle+1, end);\r\n\t\t mergeHelp(list, comp, start, middle, end);\r\n\t }\r\n\t \r\n }",
"public static void merge(int start, int mid, int end, int[] numbers) {\n int[] tempArray = new int[numbers.length]; // Create a temporary array\n int tmpArrayIndex = start; // create a temporary index\n\n // initialize start index and mid index to be used as counters\n int startIndex = start;\n int midIndex = mid + 1;\n\n // Iterate until the smaller array reaches the end.\n while (startIndex <= mid && midIndex <= end) {\n if (numbers[startIndex] < numbers[midIndex]) {\n // The ++ increases the value by one after it has been used\n // to prevent the while loop from giving us an infinite loop\n tempArray[tmpArrayIndex++] = numbers[startIndex++];\n } else {\n tempArray[tmpArrayIndex++] = numbers[midIndex++];\n }\n }\n\n // copy the remaining elements into the array\n while(startIndex <= mid) {\n tempArray[tmpArrayIndex++] = numbers[startIndex++];\n }\n\n while (midIndex <= end) {\n tempArray[tmpArrayIndex++] = numbers[midIndex++];\n }\n\n // copy our temporary array to the actual array after sorting\n if (end + 1 - start >= 0) {\n\n // java method for copying arrays\n System.arraycopy(tempArray, start, numbers, start, end + 1 - start);\n }\n }",
"private static void mergeSort(int[] num, int low, int high) {\n\t\tif ((high - low) >= 1) {\n\n\t\t\t// find the middle index\n\t\t\tint middle = (low + high) / 2;\n\n\t\t\t// make recursive calls to the 'left' and 'right' sides of the sublist\n\t\t\tmergeSort(num, low, middle);\n\t\t\tmergeSort(num, middle + 1, high);\n\n\t\t\t// merge the sublists back together\n\t\t\tmerge(num, low, middle, middle + 1, high);\n\n\t\t}\n\t}",
"private static void merge(Character[] ch,int low,int mid,int high){\n int n1 = mid-low+1;\n int n2 = high - mid;\n char[] lowArr = new char[n1];\n char[] highArr = new char[n2];\n //copy\n for (int i = 0; i < n1; i++) {\n lowArr[i] = ch[low+i];\n }\n for (int i = 0; i < n2; i++) {\n highArr[i] = ch[mid+1+i];\n }\n //merge them\n //initial indexes of first and second subarrays\n int i = 0,j = 0;\n //initial index of original array\n int k = low;\n while(i < n1 && j < n2){\n if(lowArr[i]<highArr[j]){\n ch[k] = lowArr[i];\n i++;\n }else{\n ch[k] = highArr[j];\n j++;\n }\n k++;\n }\n //fill up the rest in first subarray if it's not empty\n while(i<n1){\n ch[k] = lowArr[i];\n i++;\n k++;\n }\n //fill up the rest in second subarray if it's not empty\n while(j<n2){\n ch[k] = highArr[j];\n j++;\n k++;\n }\n }",
"static void merge(int arr[], int l, int m, int r) \n { \n // Sizes of the two subarrays\n int size1 = m - l + 1; \n int size2 = r - m; \n \n // Temporary arrays\n int left[] = new int [size1]; \n int right[] = new int [size2]; \n \n // Copy over to temps\n for (int i=0; i<size1; ++i) \n left[i] = arr[l + i]; \n for (int j=0; j<size2; ++j) \n right[j] = arr[m + 1+ j]; \n \n \n // Initial indexes of first and second subarrays \n int i = 0, j = 0; \n \n // Initial index of merged subarry array \n int k = l; \n while (i < size1 && j < size2) \n { \n if (left[i] <= right[j]) \n { \n arr[k] = left[i]; \n i++; \n } \n else\n { \n arr[k] = right[j]; \n j++; \n } \n k++; \n } \n \n // Copy rest of arrays\n while (i < size1) \n { \n arr[k] = left[i]; \n i++; \n k++; \n } \n \n // For the other array\n while (j < size2) \n { \n arr[k] = right[j]; \n j++; \n k++; \n } \n }",
"private static void mergeSort(int[] data, int left, int right) {\n\n\t\tint mid;\n\n\t\tif (left < right) {\n\n\t\t\tmid = (left + right) / 2;\n\n\t\t\tmergeSort(data, left, mid);\n\t\t\tmergeSort(data, mid + 1, right);\n\t\t\tmerge(data, left, mid, right);\n\t\t}\n\n\t}",
"private void merge(int[] array, int start, int mid, int end) {\n\t\t\n\t\t// Instantiate and populate subarrays.\n\t\tint leftSize = mid - start + 1;\n\t\tint rightSize = end - mid;\n\t\tint[] leftSubarray = new int[leftSize + 1];\n\t\tint[] rightSubarray = new int[rightSize + 1];\n\t\t\n\t\tfor (int i = 0; i < leftSize; i++) {\n\t\t\tleftSubarray[i] = array[start + i];\n\t\t}\n\t\tfor (int i = 0; i < rightSize; i++) {\n\t\t\trightSubarray[i] = array[mid + i + 1];\n\t\t}\n\t\t\n\t\t// \"Sentinel\" values = approximate infinity.\n\t\tleftSubarray[leftSize] = Integer.MAX_VALUE;\n\t\trightSubarray[rightSize] = Integer.MAX_VALUE;\n\n\t\t// Merge subarrays.\n\t\tint i = 0;\n\t\tint j = 0;\n\t\tfor (int k = start; k <= end; k++) {\n\t\t\tif (leftSubarray[i] < rightSubarray[j]) {\n\t\t\t\tarray[k] = leftSubarray[i];\n\t\t\t\ti++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tarray[k] = rightSubarray[j];\n\t\t\t\tj++;\n\t\t\t}\n\t\t}\n\t}",
"public static SinglyLinkedList merge(SinglyLinkedList list1, SinglyLinkedList list2)\n\t{\n\t\tSinglyLinkedList list3 = new SinglyLinkedList();\n\t\tint i = 0;\n\t\tint j = 0;\n\t\twhile((i < list1.size()) && (j < list2.size()))\n\t\t{\n\t\t\tif(list1.getElementAt(i) < list2.getElementAt(j))\n\t\t\t{\n\t\t\t\tlist3.addLast(list1.getElementAt(i));\n\t\t\t\ti++;\n\t\t\t}\n\t\t\telse if(list1.getElementAt(i) > list2.getElementAt(j))\n\t\t\t{\n\t\t\t\tlist3.addLast(list2.getElementAt(j));\n\t\t\t\tj++;\n\t\t\t}\n\t\t\telse if(list1.getElementAt(i) == list2.getElementAt(j))\n\t\t\t{\n\t\t\t\tlist3.addLast(list2.getElementAt(j));\n\t\t\t\tj++;\n\t\t\t}\n\t\t}\n\t\tif(i == list1.size())\n\t\t{\n\t\t\tfor(int k = j; k < list2.size(); k++)\n\t\t\t{\n\t\t\t\tlist3.addLast(list2.getElementAt(k));\n\t\t\t}\n\t\t}\n\t\telse if(j == list2.size())\n\t\t{\n\t\t\tfor(int l = i; l < list1.size(); l++)\n\t\t\t{\n\t\t\t\tlist3.addLast(list1.getElementAt(l));\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn list3;\n\t}",
"private static <T extends Comparable,S> void mergeSort(T[] src, S[] src2,\n\t\t\tT[] dest,\n\t\t\tS[] dest2,\n\t\t\tint low,\n\t\t\tint high,\n\t\t\tint off) {\n\t\tint length = high - low;\n\n\t\t// Insertion sort on smallest arrays\n\t\tif (length < INSERTIONSORT_THRESHOLD) {\n\t\t\tfor (int i=low; i<high; i++)\n\t\t\t\tfor (int j=i; j>low &&\n\t\t\t\t\t\tdest[j-1].compareTo(dest[j])>0; j--)\n\t\t\t\t\tswap(dest,dest2, j, j-1);\n\t\t\treturn;\n\t\t}\n\n\t\t// Recursively sort halves of dest into src\n\t\tint destLow = low;\n\t\tint destHigh = high;\n\t\tlow += off;\n\t\thigh += off;\n\t\tint mid = (low + high) >>> 1;\n\t\tmergeSort(dest, dest2, src, src2,low, mid, -off);\n\t\tmergeSort(dest, dest2, src, src2, mid, high, -off);\n\n\t\t// If list is already sorted, just copy from src to dest. This is an\n\t\t// optimization that results in faster sorts for nearly ordered lists.\n\t\tif (src[mid-1].compareTo(src[mid]) <= 0) {\n\t\t\tSystem.arraycopy(src, low, dest, destLow, length);\n\t\t\tSystem.arraycopy(src2, low, dest2, destLow, length);\n\t\t\treturn;\n\t\t}\n\n\t\t// Merge sorted halves (now in src) into dest\n\t\tfor(int i = destLow, p = low, q = mid; i < destHigh; i++) {\n\t\t\tif (q >= high || p < mid && src[p].compareTo(src[q])<=0) {\n\t\t\t\tdest2[i] = src2[p];\n\t\t\t\tdest[i] = src[p++];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdest2[i] = src2[q];\n\t\t\t\tdest[i] = src[q++];\n\t\t\t}\n\t\t}\n\t}",
"private static void merge(Comparable[] a, int[] index, int[] aux, int lo, int mid, int hi){\n for(int k=lo;k<=hi;k++){\n aux[k]=index[k];\n }\n int i=lo,j=mid+1;\n for(int k=lo;k<=hi;k++){\n if(i>mid) index[k]=aux[j++];\n else if(j>hi) index[k]=aux[i++];\n else if(less(a[aux[j]],a[aux[i]])) index[k]=aux[j++];\n else index[k]=aux[i++];\n }\n }",
"public int[] merge(int[] arr, int[] temp, int left, int right, int mid) {\n\t\tint i = left;\r\n\t\tint j = mid;\r\n\t\tint k = left;\r\n\r\n\t\twhile (i < mid && j <= right) {\r\n\t\t\tif (arr[i] < arr[j])\r\n\t\t\t\ttemp[k++] = arr[i++];\r\n\t\t\telse\r\n\t\t\t\ttemp[k++] = arr[j++];\r\n\t\t}\r\n\r\n\t\twhile (i < mid)\r\n\t\t\ttemp[k++] = arr[i++];\r\n\r\n\t\twhile (j <= right)\r\n\t\t\ttemp[k++] = arr[j++];\r\n\r\n\t\tfor (i = left; i <= right; i++)\r\n\t\t\tarr[i] = temp[i];\r\n\r\n\t\treturn arr;\r\n\t}",
"private static void mergeLists() {\n\t\tint length = (photoList.size() / 2) - 1;\n\t\t\n\t\tif (photoList.size() % 2 == 0) {\n\t\t\tlength++;\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < length; i++) {\n\t\t\tList<String> tL = new ArrayList<String>();\n\t\t\t\n\t\t\tPhoto p1 = photoList.get(i),\n\t\t\t\t p2 = photoList.get(photoList.size() - 1 - i);\n\t\t\t\n\t\t\tfor (String tag : p1.getTagList()) {\n\t\t\t\ttL.add(tag);\n\t\t\t}\n\t\t\t\n\t\t\tfor (String tag : p2.getTagList()) {\n\t\t\t\ttL.add(tag);\n\t\t\t}\n\t\t\t\n\t\t\tfor (int j = 0; j < tL.size() - 1; j++) {\n\t\t\t\tfor (int k = j; k < tL.size(); k++) {\n\t\t\t\t\tif (tL.get(j).equals(tL.get(k))) {\n\t\t\t\t\t\ttL.remove(k);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tslideList.add(new Slide(p1.getPhotoId(), p2.getPhotoId(), tL));\n\t\t}\n\t}",
"public static ArrayList<String> mergeSort(ArrayList<String> aList) {\n ArrayList<String> left = new ArrayList<String>();\n ArrayList<String> right = new ArrayList<String>();\n int minIndex;\n \n if (aList.size() == 1) { \n return aList;\n } else {\n minIndex = aList.size()/2;\n \n for (int i= 0; i< minIndex; i++) {\n left.add(aList.get(i));\n }\n\n for (int i= minIndex; i< aList.size(); i++) {\n right.add(aList.get(i));\n }\n \n left = mergeSort(left);\n right = mergeSort(right);\n \n merge(aList, right, left);\n }\n return aList;\n }",
"public static void mergeSort(List<Integer> values) {\r\n for (int stepSize = 2; stepSize < values.size(); stepSize *= 2) {\r\n for (int i = 0; i < values.size(); i += stepSize) {\r\n int prefixStart = i;\r\n int suffixStart = i + stepSize / 2;\r\n int suffixEnd = Math.min(values.size(), i + stepSize);\r\n merge(values, prefixStart, suffixStart, suffixEnd);\r\n } // for\r\n if (stepSize > values.size() / 2) {\r\n int prefixStart = 0;\r\n int suffixStart = stepSize;\r\n int suffixEnd = values.size();\r\n merge(values, prefixStart, suffixStart, suffixEnd);\r\n } // if\r\n //printList(values);\r\n } // for\r\n }",
"public static Comparable[] merge( Comparable[] leftPart, Comparable[] rightPart ) {\n\n int cursorLeft = 0, cursorRight = 0, counter = 0;\n\n Comparable[] merged = new Comparable[leftPart.length + rightPart.length];\n\n\n\n while ( cursorLeft < leftPart.length && cursorRight < rightPart.length ) {\n\n\n if ( leftPart[cursorLeft].compareTo(rightPart[cursorRight])<0) {\n\n merged[counter] = leftPart[cursorLeft];\n\n cursorLeft++;\n\n } else {\n\n merged[counter] = rightPart[cursorRight];\n\n cursorRight++;\n\n }\n\n\n\n counter++;\n\n }\n\n\n\n if ( cursorLeft < leftPart.length ) {\n\n System.arraycopy( leftPart, cursorLeft, merged, counter, merged.length - counter );\n\n }\n\n if ( cursorRight < rightPart.length ) {\n\n System.arraycopy( rightPart, cursorRight, merged, counter, merged.length - counter );\n\n }\n\n\n\n return merged;\n\n }",
"public void merge(int l, int m, int r){\n int n1 = m-l+1;\n int n2 = r-m;\n\n // temp arrays \n int[] L = new int[n1];\n int[] R = new int[n2];\n\n // copy data of the 2 subarrays int he temp ones\n // TODO : can be reduced to one loop and another loop of length |n1-n2|\n for(int i=0; i<n1; i++) L[i] = arr[l+i];\n for(int i=0; i<n2; i++) R[i] = arr[m+1+i];\n\n\n // init indexes\n int i=0, j=0, k=l;\n while (i<n1 && j<n2){ // ordering in asc order\n if(L[i] <= R[j]){\n arr[k] = L[i];\n i++;\n } else{\n arr[k] = R[j];\n j++;\n }\n k++;\n }\n\n // insert the remaining items\n while(i<n1){\n arr[k] = L[i];\n i++;\n k++;\n }\n\n while(j<n2){\n arr[k] = R[j];\n j++;\n k++;\n }\n \n\n }",
"private static void sort(ArrayList<Integer> a, int left, int right) {\r\n\t\tif (left < right) {\r\n\t\t\tint mid = (left+right)/2;\r\n\t\t\t//sort both halves\r\n\t\t\tsort(a, left, mid);\r\n\t\t\tsort(a, mid + 1, right);\r\n\t\t\t//merge back\r\n\t\t\tmerge(a, left, mid, right);\r\n\t\t}\r\n\t}",
"static void merge(Comparable[] a, int lo, int mid, int hi) {\n int i = lo, j = mid + 1;\n\n //copy a[lo..hi] to aux[lo..hi]\n for (int k = lo; k <= hi; k++) {\n aux[k] = a[k];\n }\n\n for (int k = lo; k <= hi; k++) {\n if (i > mid) {\n a[k] = aux[j++];\n\n } else if (j > hi) {\n a[k] = aux[i++];\n\n } else if (less(aux[j], aux[i])) {\n a[k] = aux[j++];\n\n } else {\n a[k] = aux[i++];\n\n }\n }\n }",
"public void merge(int[] nums1, int m, int[] nums2, int n) {\n int p=m+n-1;\n int l=m-1;\n int r=n-1;\n while((r>=0)&&(l>=0)){\n if(nums1[l]>=nums2[r]){\n nums1[p]=nums1[l];\n l--;\n p--;\n }else{\n nums1[p]=nums2[r];\n r--;\n p--;\n }\n }\n if(r<0){\n while(l>=0){\n nums1[p]=nums1[l];\n l--;\n p--;\n }\n }\n if(l<0){\n while(r>=0){\n nums1[p]=nums2[r];\n r--;\n p--;\n }\n \n }\n \n }",
"private static void merge(int[] array, int lowIndex, int middleIndex, int highIndex) {\n int n1 = middleIndex - lowIndex + 1;\n int n2 = highIndex - middleIndex;\n\n /*Create temp arrays*/\n int L[] = new int[n1];\n int R[] = new int[n2];\n\n /*Copy data to temp arrays*/\n for (int i = 0; i < L.length; i++) {\n L[i] = array[lowIndex + i];\n }\n for (int i = 0; i < R.length; i++) {\n R[i] = array[middleIndex + 1 + i];\n }\n\n /* Merge the temp arrays */\n\n // Initial indexes of first and second subarrays\n int i = 0, j = 0;\n\n // Initial index of merged subarray\n int k = lowIndex;\n\n while (i < n1 && j < n2) {\n if (L[i] <= R[j]) {\n array[k] = L[i];\n i++;\n } else {\n array[k] = R[j];\n j++;\n }\n k++;\n }\n\n /*Copy remaining elements of L[] if any */\n while (i < n1) {\n array[k] = L[i];\n i++;\n k++;\n }\n\n /*Copy remaining elements of R[] if any */\n while (j < n2) {\n array[k] = R[j];\n j++;\n k++;\n }\n }",
"private void mergeSort(int low, int high) {\n\t\tif (low < high) {\n\t\t\tint middle = low + (high - low) / 2;\n\t\t\tmergeSort(low, middle);\n\t\t\tmergeSort(middle + 1, high);\n\t\t\tmergeParts(low, middle, high);\n\t\t}\n\t}",
"public static <T extends Comparable<? super T>> \n void union(SLL<T> list1, SLL<T> list2,\n SLL<T> result) {\n \n SLLNode<T> iterlist1 = list1.head;\n SLLNode<T> iterlist2 = list2.head;\n \n T itemlist1=null, itemlist2=null;\n \n // get first item in each list\n if ( iterlist1 != null )\n itemlist1 = iterlist1.info;\n if( iterlist2 != null )\n itemlist2 = iterlist2.info;\n \n while ( itemlist1 != null || itemlist2 != null ) {\n\n int compareResult;\n if( itemlist1 == null ) {\n compareResult = 1;\n } else if ( itemlist2 == null ) {\n compareResult = -1;\n } else {\n compareResult = itemlist1.compareTo(itemlist2);\n }\n \n if ( compareResult == 0 ) {\n result.addToTail(itemlist1); //appending to result list \n if( iterlist1.next != null ) {\n iterlist1 = iterlist1.next;\n itemlist1 = iterlist1.info;\n } else {\n itemlist1 = null;\n }\n \n if( iterlist2.next != null ) {\n iterlist2 = iterlist2.next;\n itemlist2 = iterlist2.info;\n } else {\n itemlist2 = null;\n } \n }\n else if ( compareResult < 0 ) { \n result.addToTail(itemlist1); //appending to result list\n if( iterlist1.next != null ) {\n iterlist1 = iterlist1.next;\n itemlist1 = iterlist1.info;\n } else {\n itemlist1 = null;\n }\n }\n else {\n result.addToTail(itemlist2);\n if( iterlist2.next != null ) {\n iterlist2 = iterlist2.next;\n itemlist2 = iterlist2.info;\n } else {\n itemlist2 = null;\n }\n }\n } \n }",
"private static void crossProductMerge(int[][] pointSet, int start, int mid, int end)\n {\n int[][] L = new int[2][mid-start+1];\n int[][] R = new int[2][end-mid];\n for (int i = 0; i<= L[0].length-1; i++)\n {\n L[0][i] = pointSet[0][start+i]; L[1][i] = pointSet[1][start+i];\n }\n for (int j = 0; j<= R[0].length-1; j++)\n {\n R[0][j] = pointSet[0][mid+j+1]; R[1][j] = pointSet[1][mid+j+1];\n }\n int i = 0;\n int j = 0;\n for (int k = start; k <= end; k++) \n {\n if (i == L[0].length || j == R[0].length)\n {\n if (i == L[0].length)\n {\n pointSet[0][k] = R[0][j]; pointSet[1][k] = R[1][j]; j++;\n }\n else\n {\n pointSet[0][k] = L[0][i]; pointSet[1][k] = L[1][i]; i++;\n }\n }\n else\n {\n if (((L[0][i]-pointSet[0][0])*(R[1][j]-pointSet[1][0]))-\n ((R[0][j]-pointSet[0][0])*(L[1][i]-pointSet[1][0])) > 0)\n {\n pointSet[0][k] = L[0][i]; pointSet[1][k] = L[1][i]; i++; \n }\n else\n {\n pointSet[0][k] = R[0][j]; pointSet[1][k] = R[1][j]; j++; \n }\n }\n }\n }",
"@Override\n\tpublic void moveToStart()\n\t{\n\t\twhile (!left.isEmpty())\n\t\t{\n\t\t\tright.push(left.pop());\n\t\t}\n\t}",
"void merge(int arr[], int l, int m , int r)\n {\n int n1 = m-l+1;\n int n2 = r-m;\n\n //create temp arrays\n int L[] = new int[n1];\n int R[] = new int[n2];\n\n //copy the elements to the array\n for(int i=0; i < n1 ;i++)\n L[i] = arr[l+i];\n for(int j=0; j < n2 ;j++)\n R[j] = arr[m+1+j];\n\n // Initial indexes of first and second subarrays\n int i = 0, j = 0;\n\n // Initial index of merged subarry array\n int k = l;\n\n while(i<n1 && j< n2)\n {\n if(L[i] <= R[j])\n {\n arr[k++] = L[i++];\n }\n else\n {\n arr[k++] = R[j++];\n }\n }\n\n while(i<n1)\n {\n arr[k++]=L[i++];\n }\n\n while(j<n2)\n {\n arr[k++]=R[j++];\n }\n\n }",
"private int[] merge(int[] left, int[] right) {\r\n\t\tint[] merged = new int[(left.length + right.length)];\r\n\r\n\t\t// l -> arrL index and r -> arrR index\r\n\t\tint l = 0, r = 0;\r\n\t\tfor (int i = 0; i < merged.length; i++) {\r\n\r\n\t\t\tif (l >= left.length) {\r\n\t\t\t\tmerged[i] = right[r++];\r\n\t\t\t} \r\n\t\t\telse if (r >= right.length) {\r\n\t\t\t\tmerged[i] = left[l++];\r\n\t\t\t}\r\n\t\t\telse if (left[l] >= right[r]) {\r\n\t\t\t\t// The total inversions will always be left.length - l\r\n\t\t\t\tcounter += (left.length - l);\r\n\t\t\t\tmerged[i] = right[r++];\r\n\t\t\t}\r\n\t\t\telse if (left[l] < right[r]) {\r\n\t\t\t\tmerged[i] = left[l++];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn merged;\r\n\t}",
"public void shuttlesort(int from[], int to[], int low, int high) {\n if (high - low < 2) {\n return;\n }\n int middle = (low + high) / 2;\n shuttlesort(to, from, low, middle);\n shuttlesort(to, from, middle, high);\n int p = low;\n int q = middle;\n if (high - low >= 4 && compare(from[middle - 1], from[middle]) <= 0) {\n for (int i = low; i < high; i++) {\n to[i] = from[i];\n }\n return;\n }\n for (int i = low; i < high; i++) {\n if (q >= high || (p < middle && compare(from[p], from[q]) <= 0)) {\n to[i] = from[p++];\n } else {\n to[i] = from[q++];\n }\n }\n }",
"private static List<List<Integer>> merge(List<List<Integer>> leftSkyLine, List<List<Integer>> rightSkyLine) {\n List<List<Integer>> result = new ArrayList<>();\n int i = 0, j = 0;\n int h1 = 0, h2 = 0;\n\n while (i < leftSkyLine.size() && j < rightSkyLine.size()) {\n int x = 0, h = 0;\n if (leftSkyLine.get(i).get(0) < rightSkyLine.get(j).get(0)) {\n x = leftSkyLine.get(i).get(0);\n h1 = leftSkyLine.get(i).get(1);\n h = Math.max(h1, h2);\n i++;\n } else if (leftSkyLine.get(i).get(0) > rightSkyLine.get(j).get(0)) {\n x = rightSkyLine.get(j).get(0);\n h2 = rightSkyLine.get(j).get(1);\n h = Math.max(h1, h2);\n j++;\n } else {\n x = leftSkyLine.get(i).get(0);\n h1 = leftSkyLine.get(i).get(1);\n h2 = rightSkyLine.get(j).get(1);\n h = Math.max(h1, h2);\n i++; j++;\n }\n\n if (result.isEmpty() || h != result.get(result.size() - 1).get(1)) {\n result.add(Arrays.asList(x, h));\n }\n }\n\n for (int k = i; k < leftSkyLine.size(); k++) {\n result.add(leftSkyLine.get(k));\n }\n for (int k = j; k < rightSkyLine.size(); k++) {\n result.add(rightSkyLine.get(k));\n }\n return result;\n }",
"void Divide(int[] a,int lef,int righ) // this function will\n // divide the array into halves and calls recursively\n {\n int left = lef;\n int right = righ;\n int[] b =a; // here modifying b or a will be the same as it is passed as reference\n if(left < right) {\n Divide(b, left, left + (right - left) / 2);\n Divide(b, 1 + left + (right - left) / 2, right);\n int middle = left + (right - left )/2;\n System.out.println(\"calling merge on left is \" + left +\" middle is\" +middle+ \" right is \"+ right);\n Merge(b, left,middle, right);\n }\n //System.out.println(\" left is \" + left + \" right is \"+ right);\n }",
"static void mergeSort(int array[], int start, int end) {\n if (start < end) {\n // Find the middle point\n int middle = start + (end - start)/2;\n\n // Sort first and second parts\n mergeSort(array, start, middle);\n mergeSort(array, middle + 1, end);\n\n // Merge the sorted parts\n merge(array, start, middle, end);\n\n }\n\n }",
"private ArrayList<TTC> generateSegmentsHelper(ArrayList<TTC> reference_list) {\n\n ArrayList<TTC> copy = new ArrayList<> (reference_list);\n int start = 0;\n int end = 0;\n\n while (!copy.get(start).equals(START_STATION)) {\n start += 1;\n }\n while (!copy.get(end).equals(endStation)) {\n end += 1;\n }\n if (start < end) {\n return new ArrayList<>(copy.subList(start, end + 1));\n } else if (start == end) {\n return new ArrayList<>(); // if enter and exit at the same station.\n } else {\n Collections.reverse(copy);\n return new ArrayList<>(copy.subList(end, start + 1));\n }\n }",
"public static void merge(int[] array,int left,int right,int middle){\n int i=0,j=0,k=left;\n int n1=middle-left+1; int n2=right-middle;\n int l[]=new int[n1];\n int r[]=new int[n2];\n for(int a=0;a<n1;++a){\n l[a]=array[left+a];\n }\n for(int a=0;a<n2;++a){\n r[a]=array[middle+1+a];\n }\n while(i< n1|| j<n2)\n {\n if(!(j<n2) || ((i<n1) && l[i]<r[j])) {\n array[k] = l[i];\n i++;\n k++;\n }\n else {\n array[k] = r[j];\n j++;\n k++;\n }\n }\n }",
"public void merge(int[] nums1, int m, int[] nums2, int n) {\n\n\n int i = m-1,j=n-1;\n int k=m+n-1;\n\n while(i>=0 && j>=0){\n if(nums1[i]>nums2[j]){\n nums1[k] = nums1[i];\n i--;\n } else{\n nums1[k]=nums2[j];\n j--;\n }\n k--;\n }\n while(j>=0){\n nums1[k]=nums2[j];\n k--;\n j--;\n }\n }",
"private static void sortWrapper(int list[], int leftIndex, int rightIndex) {\n if (leftIndex!=rightIndex) {\n int midIndex = (leftIndex + rightIndex)/2;\n //Sort left\n sortWrapper(list, leftIndex, midIndex);\n //Sort right\n sortWrapper(list, midIndex+1, rightIndex);\n //Merge sorted halves together\n merge(list, leftIndex, midIndex, rightIndex);\n }\n }",
"private static void merge(Comparable[] as, Comparable[] aux, int lo, int mid, int hi) {\n assert isSorted(as, lo, mid); // precondition that first sub array is ordered\n assert isSorted(as, mid + 1, hi); // precondition that second sub array is ordered\n\n for (int k = lo; k <= hi; k++) {\n aux[k] = as[k];\n }\n\n int i = lo;\n int j = mid + 1;\n for (int k = lo; k <= hi; k++) {\n // done with first sub array\n if (i > mid) as[k] = aux[j++];\n // done with second sub array\n else if (j > hi) as[k] = aux[i++];\n // second less than first\n else if (less(aux[j], aux[i])) as[k] = aux[j++];\n // first less than first\n else as[k] = aux[i++];\n }\n\n assert isSorted(as, lo, hi); // postcondition that whole as array is sorted\n }",
"void merge(ListNode curr1, ListNode curr2) {\n while (curr1 != null) {\n ListNode next1 = curr1.next, next2 = curr2.next;\n curr1.next = curr2;\n if (next1 == null)\n break;\n curr2.next = next1;\n curr1 = next1;\n curr2 = next2;\n }\n }",
"void mergeSort(int arr[], int l, int r) \n { \n if (l < r) \n { \n // Find the middle point \n int m = (l+r)/2; \n \n // Sort first and second halves \n mergeSort(arr, l, m); \n mergeSort(arr , m+1, r); \n \n // Merge the sorted halves \n sort(arr, l, m, r); \n } \n\t}",
"private int backmerge(int[] arr, int arr1, int l1, int arr2, int l2) {\n\t\tint arr0 = arr2 + l1;\n\t\tfor (;;) {\n\t\t\tif (this.reads.compare(arr[arr1], arr[arr2]) > 0) {\n\t\t\t\tthis.writes.swap(arr, arr1--, arr0--, 1, true, false);\n\t\t\t\tif (--l1 == 0) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.writes.swap(arr, arr2--, arr0--, 1, true, false);\n\t\t\t\tif (--l2 == 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\tint res = l1;\n\t\tdo {\n\t\t\tthis.writes.swap(arr, arr1--, arr0--, 1, true, false);\n\n\t\t} while (--l1 != 0);\n\t\treturn res;\n\t}",
"private static long merge(int start, int end, int mid) {\n\t\tfor(int i=start; i<=end; i++){\n\t\t\ttempArr[i] = numArr[i];\n\t\t}\n\t\t\t\n\t\tint i=start, j=mid+1, temp=start;\n\t\tlong cnt = 0L;\n\t\twhile(i <= mid && j <= end){\n\t\t\tif(tempArr[i] <= tempArr[j]){\n\t\t\t\tnumArr[temp++] = tempArr[i++];\n\t\t\t}else{\n\t\t\t\tnumArr[temp++] = tempArr[j++];\n\t\t\t\tcnt += (long)(mid+1-i);\n\t\t\t}\n\t\t}\n\t\t\n\t\twhile(i<=mid){\n\t\t\tnumArr[temp++] = tempArr[i++];\n\t\t}\n\t\twhile(j<=end){\n\t\t\tnumArr[temp++] = tempArr[j++];\n\t\t}\n\t\treturn cnt;\n\t}",
"private void mergesort(ArrayList<Integer> list, int l, int h) {\n\t\tif (l < h) {\n\t\t\tint m = (l + h) / 2;\n\t\t\tmergesort(list, l, m);\n\t\t\tmergesort(list, m + 1, h);\n\t\t\tSystem.out.println(list);\n\t\t\tmerge(list, l, m, h);\n\t\t}\n\t}",
"private static void merge(Comparable[] a, int[] index, int[] aux, int low, int mid, int high) {\n for(int k=low; k<=high; k++)\n aux[k] = index[k];\n \n // merge back to a[]\n int i=low, j=mid+1;\n for(int k=low; k<=high; k++) {\n if(i>mid) index[k] = aux[j++];\n else if(j>high) index[k] = aux[i++];\n else if(SortUtil.less(a[aux[j]], a[aux[i]])) index[k] = aux[j++];\n else index[k] = aux[i++];\n }\n }",
"static void mergesort(MappedByteBuffer A, MappedByteBuffer result, \r\n\t\t\tint start, int end) throws IOException {\r\n\r\n\t\tif (end - start < 8) { \r\n\t\t\treturn; \r\n\t\t}\r\n\r\n\t\tif (end - start == 8) {\r\n\t\t\tresult.position(start);\r\n\t\t\tint left = result.getInt();\r\n\t\t\tint right = result.getInt();\r\n\t\t\tif (left > right) {\r\n\t\t\t\tresult.position (start);\r\n\t\t\t\tresult.putInt (right);\r\n\t\t\t\tresult.putInt (left);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tint mid = (end + start)/8*4;\r\n\t\tmergesort (result, A, start, mid);\r\n\t\tmergesort (result, A, mid, end);\r\n\r\n\t\tresult.position(start);\r\n\t\tfor (int i = start, j = mid, idx=start; idx < end; idx += 4) {\r\n\t\t\tint Ai = A.getInt (i);\r\n\t\t\tint Aj = 0;\r\n\t\t\tif (j < end) { Aj = A.getInt (j); }\r\n\t\t\tif (j >= end || (i < mid && Ai < Aj)) { \r\n\t\t\t\tresult.putInt (Ai);\r\n\t\t\t\ti += 4;\r\n\t\t\t} else {\r\n\t\t\t\tresult.putInt (Aj);\r\n\t\t\t\tj += 4;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void reorderList(ListNode head) {\n if (head == null || head.next == null)\n return;\n\n // step 1. cut the list to two halves\n // prev will be the tail of 1st half\n // slow will be the head of 2nd half\n ListNode prev = null, slow = head, fast = head, l1 = head;\n while (fast != null && fast.next != null) {\n prev = slow;\n slow = slow.next;\n fast = fast.next.next;\n }\n prev.next = null;\n // step 2. reverse the 2nd half\n ListNode l2 = reverse(slow);\n // step 3. merge the two halves\n merge(l1, l2);\n }",
"public static void prefixMerge(Client [] list1, Client [] list2,\n Client[] result){\n\n int listOneIndex = 0;\n int listTwoIndex = 0;\n for (int i = 0; i < result.length; i++){\n if (list1[listOneIndex].compareClient(list2[listTwoIndex]) < 0){\n result[i] = list1[listOneIndex];\n listOneIndex++;\n } else if (list1[listOneIndex].compareClient(list2[listTwoIndex]) > 0) {\n result[i] = list2[listTwoIndex];\n listTwoIndex++;\n } else {\n result[i] = list2[listTwoIndex];\n listTwoIndex++;\n listOneIndex++;\n }\n }\n }"
] | [
"0.7089748",
"0.70605284",
"0.69283795",
"0.6725452",
"0.66624117",
"0.65185684",
"0.651719",
"0.6433174",
"0.6432978",
"0.6427405",
"0.63949597",
"0.63936615",
"0.6392688",
"0.6330468",
"0.63226146",
"0.62899274",
"0.6269533",
"0.6264302",
"0.6225878",
"0.6219423",
"0.6190766",
"0.61831033",
"0.61749053",
"0.6153977",
"0.6110072",
"0.6105916",
"0.6099002",
"0.6069123",
"0.6061062",
"0.6060744",
"0.6054072",
"0.6047231",
"0.604295",
"0.6039465",
"0.6002809",
"0.5991098",
"0.59637034",
"0.5953886",
"0.5943273",
"0.5934948",
"0.5919223",
"0.59079415",
"0.58957654",
"0.5886456",
"0.5879153",
"0.5878272",
"0.58765495",
"0.58752114",
"0.58648103",
"0.58621895",
"0.586078",
"0.58602047",
"0.58598924",
"0.5843497",
"0.5792144",
"0.5773455",
"0.57437116",
"0.5737093",
"0.57108825",
"0.5710859",
"0.5707213",
"0.5688512",
"0.568495",
"0.56691444",
"0.56480795",
"0.5647088",
"0.563103",
"0.56228226",
"0.5617754",
"0.5605568",
"0.55866194",
"0.5576034",
"0.5572071",
"0.55631214",
"0.55580664",
"0.5549054",
"0.55473804",
"0.5531204",
"0.55310893",
"0.5526064",
"0.5510143",
"0.5490476",
"0.5490164",
"0.5483245",
"0.5468304",
"0.5462181",
"0.5455002",
"0.54494685",
"0.5449037",
"0.54473585",
"0.54425484",
"0.5440467",
"0.5432312",
"0.5431908",
"0.5429295",
"0.54276747",
"0.5413041",
"0.54056364",
"0.5405262",
"0.5395708"
] | 0.5437451 | 92 |
reverse the linked list. | public ListNode reverse(ListNode head) {
if (head == null) {
return null;
}
ListNode dummy = new ListNode(0);
while (head != null) {
// store the next node.
ListNode tmp = head.next;
// insert the head into the head!
head.next = dummy.next;
dummy.next = head;
head = tmp;
}
return dummy.next;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void reverse() {\n\n\t\tif (head == null) {\n\t\t\tSystem.out.println(\"List is empty.\");\n\t\t\treturn;\n\t\t}\n\t\tint nodes = nodeCounter();\n\t\tDLNode t = tail.prev;\n\t\thead = tail;\n\t\tfor (int i = 0; i < nodes - 1; i++) {\n\n\t\t\tif (t.list == null && t.val != Integer.MIN_VALUE) {\n\t\t\t\tthis.reverseHelperVal(t.val);\n\t\t\t\tt = t.prev;\n\t\t\t} else {\n\t\t\t\tthis.reverseHelperList(t.list);\n\t\t\t\tt = t.prev;\n\t\t\t}\n\t\t}\n\t\ttail.next = null;\n\t\thead.prev = null;\n\n\t}",
"void reverseList(){\n\n Node prev = null;\n Node next = null;\n Node iter = this.head;\n\n while(iter != null)\n {\n next = iter.next;\n iter.next = prev;\n prev = iter;\n iter = next;\n\n }\n\n //prev is the link to the head of the new list\n this.head = prev;\n\n }",
"public void reverse() {\n\t\t// write you code for reverse using the specifications above\t\t\n\t\tNode nodeRef = head;\n\t\thead = null;\n\t\t\n\t\twhile(nodeRef != null) {\n\t\t\tNode tmp = nodeRef;\n\t\t\tnodeRef = nodeRef.next;\n\t\t\ttmp.next = head;\n\t\t\thead = tmp;\n\t\t}\n\t}",
"public void _reverse() {\n\n var prev = first;\n var current = first.next;\n last = first;\n last.next = null;\n while (current != null) {\n var next = current.next;\n current.next = prev;\n prev = current;\n current = next;\n\n }\n first = prev;\n\n }",
"public void reverseLinkedList(){\n\t\tNode prev = null;\n\t\tNode current = head;\n\t\twhile (current != null){\n\t\t\tNode temp = current.next;\n\t\t\tcurrent.next = prev;\n\t\t\t// move pointers be careful must move previous to current first\n\t\t\tprev = current;\n\t\t\tcurrent = temp;\n\t\t\t\n\n\t\t}\n\t\tthis.head = prev;\n\t}",
"public void reverse()\n\t{\n\t\tSinglyLinkedListNode nextNode = head;\n\t\tSinglyLinkedListNode prevNode = null;\n\t\tSinglyLinkedListNode prevPrevNode = null;\n\t\twhile(head != null)\n\t\t{\n\t\t\tprevPrevNode = prevNode;\n\t\t\tprevNode = nextNode;\n\t\t\tnextNode = prevNode.getNext();\n\t\t\tprevNode.setNext(prevPrevNode);\n\t\t\tif(nextNode == null)\n\t\t\t{\n\t\t\t\thead = prevNode;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"public void reverse() {\n var previous = first;\n var current = first.next;\n\n last = first;\n last.next = null;\n while (current != null) {\n var next = current.next;\n current.next = previous;\n previous = current;\n current = next;\n\n }\n first = previous;\n\n }",
"static void reverse(Linkedlists list){\r\n\t\tNode current=list.head;\r\n\r\n\t\tNode nextNode=null;\r\n\t\tNode previous=null;\r\n\t\twhile(current != null){\r\n\t\t\tnextNode=current.next;\r\n\t\t\t//System.out.println(\"current.next:\"+current.data);\r\n\t\t\tcurrent.next=previous;\r\n\t\t\tprevious=current;\r\n\t\t\tcurrent=nextNode;\r\n\r\n\t\t}\r\n\t\t//current.next=previous;\r\n\t\tlist.head=previous;\r\n\r\n\t}",
"private static void iterateLinkedListInReverseOrder() {\n\t\tLinkedList<Integer> list = new LinkedList<Integer>();\n\t\tlist.add(10);\n\t\tlist.add(20);\n\t\tlist.add(30);\n\t\tlist.add(40);\n\t\tlist.add(50);\n\t\tSystem.out.println(\"LinkedList is : \" + list);\n\t\tCollections.reverse(list);\n\t\tSystem.out.println(\"Reverse the LinkedList is : \" + list);\n\t}",
"public void reverse() {\n\t\tNode previous = first;\n\t\tNode current = first.next;\n\n\t\twhile (current != null) {\n\t\t\tNode next = current.next;\n\t\t\tcurrent.next = previous;\n\n\t\t\tprevious = current;\n\t\t\tcurrent = next;\n\t\t}\n\t\tlast = first;\n\t\tlast.next = null;\n\t\tfirst = previous;\n\t}",
"public void reverse(){\n\n\n SNode reverse =null;\n\n while(head != null) {\n\n SNode next= head.next;\n head.next=reverse;\n reverse = head;\n\n head=next;\n\n\n }\n head=reverse; // set head to reverse node. it mean next node was null and head should be previous node.\n\n\n }",
"LinkedListDemo reverse() {\n\t\tListNode rev = null; // rev will be the reversed list.\n\t\tListNode current = getHead(); // For running through the nodes of list.\n\t\twhile (current != null) {\n\t\t\t// construct a new node\n\t\t\tListNode newNode = new ListNode();\n\t\t\t// copy the data to new node from runner\n\t\t\tnewNode.data = current.data;\n\t\t\t// \"Push\" the next node of list onto the front of rev.\n\t\t\tnewNode.next = rev;\n\t\t\trev = newNode;\n\t\t\t// Move on to the next node in the list.\n\t\t\tcurrent = current.next;\n\t\t}\n\t\treturn new LinkedListDemo(rev);\n\t}",
"private ListNode reverseList(ListNode head) {\n if (head == null || head.next == null) {\n return head;\n }\n\n ListNode now = head;\n ListNode next = now.next;\n ListNode prev = null;\n\n while (next != null) {\n now.next = prev;\n\n // move to next node\n prev = now;\n now = next;\n next = next.next;\n }\n now.next = prev;\n return now;\n }",
"public static SinglyLinkedList reverse(SinglyLinkedList list) {\r\n\t\tNode prev=null;\r\n\t\tNode current=list.getFirst();\r\n\t\tNode next=null;\r\n\t\t\r\n\t\twhile (current != null) {\r\n\t\t\tSystem.out.println(\"current: \" + current.getData());\r\n\t\t\tnext=current.next();\r\n\t\t\tcurrent.setNext(prev);\r\n\t\t\tprev=current;\r\n\t\t\tcurrent=next;\r\n\t\t}\r\n\t\tlist.setHead(prev); //have to reset head\r\n\t\treturn list;\r\n\t}",
"private static Node reverseLinkedList(Node head) {\n\t\t \n\t\tNode prev = null;\n\t\tNode next = null;\n\t\t\n\t\t// check boundary condition\n\t\tif(head ==null)\n\t\t\t\n\t\t\t\n\t\t\treturn head;\n\t\t\n\t\tnext = head.rightSibling;\n\t\twhile(next!=null) {\n\t\t\t// point current node backwards\n\t\t\thead.rightSibling = prev;\n\t\t\t\n\t\t\t// move all three pointers ahead\n\t\t\tprev = head;\n\t\t\thead = next;\n\t\t\tnext = next.rightSibling;\n\t\t}\n\t\t\n\t\t// Point last node backwards\n\t\thead.rightSibling = prev;\n\t\treturn head;\n\t}",
"public void reverseLinkedlistRecursive(){\n\t\tif (this.head == null) return;\n\t\tNode newEnd = reverseLinkedlisthelper(this.head);\n\t\tnewEnd.next = null;\n\t}",
"public static void reverselist ( LinkedList list)\r\n\t\t{\r\n\t\t Node reversedpart = null;\r\n\t\t\tNode current = list.head;\t\r\n\t\t\tSystem.out.println(\" Reverse LinkedList: \"); \r\n\t\t \r\n\t\t while (current != null)\r\n\t\t {\r\n\t\t\t Node next = current.next;\r\n\t\t\t current.next = reversedpart;\r\n\t\t\t reversedpart = current;\r\n\t\t\t current = next; \r\n\t\t\t \r\n\t\t\t //System.out.print(reversedpart.data + \" \");\r\n\t\t\t //current = current.next;\r\n\t\t }\r\n\t\t System.out.println(\"\"); \r\n\t\t System.out.println(\" Reverse LinkedList: \"); \r\n\t\t \r\n\t\t while (reversedpart != null)\r\n\t\t {\r\n\t\t\t \t\t\t \r\n\t\t\t System.out.print(reversedpart.data + \" \");\r\n\t\t\t reversedpart = reversedpart.next;\r\n\t\t }\r\n\t\t System.out.println(\"\"); \r\n\t\t \r\n\t\t \r\n\t\t}",
"public DoubleLinkedSeq reverse(){\r\n\t DoubleLinkedSeq rev = new DoubleLinkedSeq();\r\n\t for(cursor = head; cursor != null; cursor = cursor.getLink()){\r\n\t\t rev.addBefore(this.getCurrent());\r\n\t }\r\n\t \r\n\t return rev; \r\n }",
"private ListNode reverseList(ListNode head) {\r\n\t\tif (head == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tListNode previous = null;\r\n\t\tListNode current = head;\r\n\t\twhile (current != null) {\r\n\t\t\tListNode next = current.next;\r\n\t\t\tcurrent.next = previous;\r\n\t\t\tprevious = current;\r\n\t\t\tcurrent = next;\r\n\t\t}\r\n\t\thead = previous;\r\n\t\treturn head;\r\n\t}",
"public void reverse() {\n\t\tNode<E> temp = null;\n\t\tNode<E> n = root;\n\n\t\twhile (n != null) {\n\t\t\ttemp = n.getBefore();\n\t\t\tn.setBefore(n.getNext());\n\t\t\tn.setNext(temp);\n\t\t\tn = n.getBefore();\n\t\t}\n\n\t\ttemp = root;\n\t\troot = tail;\n\t\ttail = temp;\n\t}",
"public MyLinkedList reverse() {\r\n\t\tif (this.isEmpty()) {\r\n\t\t\tSystem.out.println(\"the empty linked list leads to a failure of reversion\");\r\n\t\t\treturn this;\r\n\t\t}\r\n\t\tStack<Node> stack = new Stack<Node>();\r\n\t\tpointer = head;\r\n\t\twhile (pointer != null) {\r\n\t\t\tstack.push(pointer);\r\n\t\t\tpointer = pointer.getNext();\r\n\t\t}\r\n\t\tMyLinkedList temp = new MyLinkedList();\r\n\t\twhile (stack.size() > 0) {\r\n\t\t\tNode node = stack.pop();\r\n\t\t\t//Original mappings have to be reset \r\n\t\t\tnode.setNext(null);\r\n\t\t\ttemp.add(node);\r\n\t\t}\r\n\t\treturn temp;\r\n\t}",
"public ListNode reverseList(ListNode head) {\n\n ListNode prev = null;\n ListNode curr = head;\n while( curr!=null){\n ListNode next = curr.next;\n curr.next= prev;\n prev = curr;\n curr = next;\n }\n return prev;\n }",
"public void reverseLinkedList() {\n\t\tSystem.out.println(\" Started reverseLinkedList () \"); \n\t\tNode currentNode = headNode;\n\t//\tNode reverseHeadNode = null;\n\t\tNode previousNode = null;\n\t\t\n\t\t// Node prev = null; \n\t\t// Node current = headNode; \n\t\t\tNode next = currentNode.getNextNode();\n\t\t\t\n\t\t while(currentNode.getNextNode() != null) {\n\t\t \tcurrentNode.setNextNode(previousNode);\n\t\t \tpreviousNode = currentNode;\n\t\t currentNode = next;\n\t\t // System.out.println(\"next.data Before \"+next.getData());\n\t\t next = currentNode.getNextNode();\n\t\t // System.out.println(\"next.data After \"+next.getData());\n\t\t }\n\t\t // System.out.println(\" previousNode is \"+previousNode);\n\t\t currentNode.setNextNode(previousNode);\n\t\t headNode = currentNode;\n\t\t \n//\t\tif(headNode==null) {\n//\t\t\treturn;\n//\t\t} else {\n//\t\t\tif(currentNode.getNextNode()==null) {\n//\t\t\t\treturn;\n//\t\t\t} else {\n//\t\t\t\twhile(currentNode.getNextNode()!=null) {\n//\t\t\t\t\tpreviousNode = currentNode;\n//\t\t\t\t//\tSystem.out.println(\" previousNode Data \"+previousNode.getData());\n//\t\t\t\t\tcurrentNode = currentNode.getNextNode();\n//\n//\t\t\t\t\tSystem.out.println(\"1111 currentNode Data \"+currentNode.getData()\n//\t\t\t\t\t\t\t+\" previousNode Data \"+previousNode.getData());\n//\t\t\t\t\t\n//\t\t\t\t\t//currentNode = currentNode.getNextNode();\n//\t\t\t\t\t\n//\t\t\t\t\tcurrentNode.setNextNode(previousNode);\n//\t\t\t\t\t\n//\t\t\t\t\tcurrentNode = currentNode.getNextNode();\n//\t\t\t\t\t\n//\t\t\t\t\tSystem.out.println(\"2222 currentNode Data \"+currentNode.getData()\n//\t\t\t\t\t+\" previousNode Data \"+previousNode.getData()\n//\t\t\t\t\t+\" currentNode.getNextNode() Data \"+currentNode.getNextNode().getData());\n//\n//\t\t\t\t//\tcurrentNode = currentNode.getNextNode();\n//\t\t\t\t\t\n//\n//\t\t\t\t\tlullaby();\n//\n//\n//\t\t\t\t}\n//\t\t\t\t\n//\t\t\t\t//headNode = previousNode;\n//\t\t\t\t\n//\t\t\t}\n//\t\t}\n\t\tSystem.out.println(\" Completed reverseLinkedList () \"); \n\t}",
"public ListNode reverseList(ListNode head) {\n ListNode first = head;\n ListNode reverse = null;\n while (first != null) {\n ListNode temp = first.next;\n first.next = reverse;\n reverse = first;\n first = temp;\n }\n return reverse;\n }",
"public Node reverseMe(Node head) {\n Node current = head;\n Node prev = null;\n while (current != null) {\n Node next = current.next;\n current.next = prev;\n prev = current;\n current = next;\n }\n head = prev;\n return head;\n }",
"private static Node reverseList(Node start) {\n Node runner = start;\n // initialize the return value\n Node rev = null;\n // set the runner to the last item in the list\n while (runner != null) {\n Node next = new Node(runner.value);\n next.next = rev;\n rev = next;\n runner = runner.next;\n }\n return rev;\n }",
"public static ListNode reverse(ListNode head) {\n if (head == null || head.next == null)\n return head;\n\n ListNode prev = null, curr = head;\n while (curr != null) {\n ListNode forw = curr.next; // backup\n\n curr.next = prev; // link\n\n prev = curr; // move\n curr = forw;\n }\n\n return prev;\n }",
"public ListNode reverseList(ListNode head) {\n if(head==null || head.next==null) return head;\n \n ListNode prev=reverseList(head.next);\n head.next.next=head;\n head.next=null;\n \n return prev;\n}",
"public ListNode reverseList(ListNode head) {\n if (head == null) {\n return null;\n }\n ListNode newHead = new ListNode(1);\n ListNode p = head;\n ListNode q = null;\n while(p != null) {\n q = p.next;\n p.next = newHead.next;\n newHead.next = p;\n p = q;\n }\n\n return newHead.next;\n }",
"public ListNode reverse(ListNode head) {\n if(head == null || head.next == null){\n return head;\n }\n ListNode prev = head;\n ListNode cur = head.next;\n prev.next = null;\n while(cur.next != null){\n ListNode nextNode = cur.next;\n cur.next = prev;\n prev = cur;\n cur = nextNode;\n }\n cur.next = prev;\n return cur;\n }",
"public ListNode reverse(ListNode head) {\n if(head == null || head.next == null) {\n return head;\n }\n ListNode prev = null;\n while(head != null) {\n ListNode temp = head.next;\n head.next = prev;\n prev = head;\n head = temp;\n }\n //head.next = null;\n return prev;\n }",
"public ListNode reverse(ListNode head) {\n if(head == null || head.next == null){\n return head;\n }\n ListNode curr = head;\n ListNode newHead = reverse(curr.next);\n curr.next.next = curr;\n curr.next = null;\n return newHead;\n }",
"public ListNode reverse(ListNode head){\n if(head == null || head.next == null) return head;\n\n ListNode curr = head, prev = null;\n\n while(curr != null){\n ListNode temp = curr.next;\n curr.next = prev;\n prev = curr;\n curr = temp;\n }\n\n return prev;\n }",
"public ListNode reverseList(ListNode head) {\n ListNode current = head;\n ListNode prev = null;\n \n while(current != null){\n ListNode temp = current.next;\n current.next = prev;\n \n prev = current;\n current = temp;\n }\n return prev;\n }",
"public static void reversList(Linkedlist list)\r\n\t {\r\n\t\t Node prev = null;\r\n\t\t Node current = list.head;\r\n\t\t Node next = null;\r\n\t\t \r\n\t\t while(current!=null)\r\n\t\t {\r\n\t\t\t next = current.next;\r\n\t\t\t current.next = prev;\r\n\t\t\t prev = current;\r\n\t\t\t current = next;\r\n\t\t\t \r\n\t\t\t \r\n\t\t }\r\n\t\t \r\n\t\t list.head = prev;\r\n\t\t \r\n\t }",
"public ListNode reverse(ListNode head){\n\t\t\n\t\tif (head == NULL || head.next == NULL)\n\t\treturn; //empty or just one node in list\n\n\t\tListNode Second = head.next;\n\t\n\t\t//store third node before we change \n\t\tListNode Third = Second.next; \n\n\t\t//Second's next pointer\n\t\tSecond.next = head; //second now points to head\n\t\thead.next = NULL; //change head pointer to NULL\n\n\t\t//only two nodes, which we already reversed\n\t\tif (Third == NULL) return; \n\n\t\tListNode CurrentNode = Third;\n\n\t\tListNode PreviousNode = Second;\n\n\t\twhile (CurrentNode != NULL){\n\t\t\tListNode NextNode = CurrentNode.next;\n\n\t\t\tCurrentNode.next = PreviousNode;\n\n\t\t\t/* repeat the process, but have to reset\n\t \t\tthe PreviousNode and CurrentNode\n\t\t\t*/\n\n\t\t\tPreviousNode = CurrentNode;\n\t\t\tCurrentNode = NextNode; \n\t\t}\n\n\t\t\thead = PreviousNode; //reset the head node\n\t\t}",
"static void ReversePrint(Node head) {\n\t\t while(head.next != null){\n\t\t head.next = head;\n\t\t head.next.next= head.next;\n\t\t }\n\t\t }",
"private static LinkedList<? extends Object> reverseLinkedList(LinkedList<? extends Object> linkedList) {\n\t\tLinkedList<Object> reversedLinkedList = new LinkedList<>();\n\t\tfor (int i = linkedList.size() - 1; i >= 0; i--) {\n\t\t\treversedLinkedList.add(linkedList.get(i));\n\t\t}\n\t\treturn reversedLinkedList;\n\t}",
"void reverse()\n\t{\n\t\tint a;\n\t\tif(isEmpty())\n\t\t\treturn;\n\t\telse\n\t\t{\t\n\t\t\ta = dequeue();\n\t\t\treverse(); \n\t\t\tenqueue(a);\n\t\t}\n\t}",
"public static ListNode reverseList(ListNode head) {\n ListNode h = head;\n ListNode n = h;\n ListNode p = null;\n ListNode rev = new ListNode(0);\n ListNode cur = rev;\n \n while (n != null) {\n p = n;\n n = n.next;\n if (n == null) {\n cur.next = new ListNode(p.val);\n head = rev.next;\n } else if (n.next == null) {\n cur.next = new ListNode(n.val);\n cur = cur.next;\n p.next = null;\n n = h;\n }\n }\n return head; \n }",
"public NodeRandom reverse(NodeRandom start)\n\t{\n\t\tNodeRandom curr=start;\n\t\t\n\t\tNodeRandom temp;\n\t\tNodeRandom prev2=null;\n\t\twhile(curr!=null)\n\t\t{\t\t\t\n\t\t\ttemp=curr.next;\t\t\t\n\t\t\tcurr.next=prev2;\n\t\t\tprev2=curr;\n\t\t\tcurr=temp;\n\t\t}\t\t\n\t\tNodeRandom newstart=prev2;\t\t\t\t\n\t\tSystem.out.println(\"reverse a list\");\n\t\tdisplay(newstart);\n\t\treturn newstart;\n\t}",
"public ListNode reverseList(ListNode l) {\n ListNode prev = null;\n ListNode cur = l;\n ListNode next = null;\n while (cur != null) {\n next = cur.next;\n cur.next = prev;\n prev = cur;\n cur = next;\n }\n \n return prev;\n }",
"public void reverseHelperList(DoubleLinkedList _list) {\n\t\tDLNode n = tail;\n\t\tDLNode k = new DLNode(_list);\n\t\tn.next = k;\n\t\tk.prev = n;\n\t\ttail = k;\n\n\t}",
"Node reverseIterative(Node head) {\n\t\tNode prev = null;\n\t\tNode current = head;\n\t\tNode next = null;\n\t\twhile (current != null) {\n\t\t\tnext = current.next;\n\t\t\tcurrent.next = prev;\n\t\t\tprev = current;\n\t\t\tcurrent = next;\n\t\t}\n\t\thead = prev;\n\t\treturn head;\n\t}",
"public static ListNode reverseList2(ListNode head) {\n ListNode n = head;\n ListNode p = null;\n ListNode q = null;\n while (n != null) {\n p = q;\n q = n;\n n = n.next;\n q.next = p;\n }\n return q;\n }",
"Node Reverse(Node head) {\n Node p = null;\n Node q = head;\n Node r = null;\n while(q!=null) {\n r = q.next;\n q.next = p;\n p = q;\n q = r;\n }\n head = p;\n return head;\n}",
"public static LinkedList<Integer> Reverse2(LinkedList<Integer> list) {\n\t\tLinkedList<Integer> listReverse = new LinkedList<Integer>();\n\t\tIterator<Integer> re = list.descendingIterator();\n\t\twhile (re.hasNext()) {\n\t\t\tlistReverse.add(re.next());\n\t\t}\n\n\t\treturn listReverse;\n\t}",
"LinkedListProblems.Node reverseLinkedList(LinkedListProblems.Node head){\n if(head==null || head.next==null){\n return head;\n }\n LinkedListProblems.Node result = reverseLinkedList(head.next);\n head.next.next = head;//new link\n head.next = null;//null existing links\n return result;\n }",
"private static LinkedListNode reverseLinkedList(LinkedListNode head) {\n if (head == null) {\n return null;\n }\n LinkedListNode revHead = head, temp = null;\n while (head.next != null) {\n temp = head.next;\n head.next = temp.next;\n temp.next = revHead;\n revHead = temp;\n }\n return revHead;\n }",
"public void reverse() {\n\t\tif(isEmpty()) {\n\t\t\treturn;\n\t\t}\n\t\tNodo <T> pri_n= fin;\n\t\t\n\t\tint cont= tamanio-1;\n\t\tNodo<T> nodo_act= pri_n;\n\t\twhile(cont >0) {\n\t\t\tNodo <T> aux= getNode(cont-1);\n\t\t\tnodo_act.setSiguiente(aux);\n\t\t\tnodo_act= aux;\n\t\t\tcont--;\n\t\t}\n\t\tinicio = pri_n;\n\t\tfin= nodo_act;\n\t\tfin.setSiguiente(null);\n\t}",
"private void reverse(ListNode startNode, ListNode endNode) {\n endNode.next = null;\n ListNode pre = startNode, cur = startNode.next, newEnd = pre;\n while (cur != null) {\n ListNode nextNode = cur.next;\n cur.next = pre;\n pre = cur;\n cur = nextNode;\n }\n }",
"private static void printList() {\n\tNode n=head;\n\tint size=0;\n\twhile(n!=null)\n\t{\n\t\tSystem.out.print(n.data+\" \");\n\t\tn=n.next;\n\t\tsize++;\n\t}\n\tn=head;\n\tfor(int i=0;i<size-1;i++)\n\t\tn=n.next;\n\tSystem.out.println(\"\\nreverse direction\");\n\twhile(n!=null)\n\t{\n\t\t\n\t\tSystem.out.print(n.data+\" \");\n\t\tn=n.prev;\n\t}\n\t\n}",
"Node reversedLinkedList(Node oldList) {\n Node newList = null;\n while (oldList != null) {\n\tNode element = oldList;\n\toldList = oldList.next;\n\telement.next = newList;\n\tnewList = element;\n }\n return newList;\n}",
"@NonNull\n ConsList<E> reverse();",
"void reverse(Node<T> node) {\n\t\tif(node.next == null) { head.next = node; return; }\n\t\treverse(node.next);\n\n\t\tif(node.data == null) node.next.next = null; \n\t\telse node.next.next = node;\n\t}",
"public ListNode reverseList(ListNode head) {\n if (head == null) return null;\n ListNode prev = null;\n ListNode cur = head;\n while (cur != null) {\n ListNode temp = cur.next;\n cur.next = prev;\n prev = cur;\n cur = temp;\n }\n return prev;\n }",
"public static LinkedList<Integer> Reverse(LinkedList<Integer> list) {\n\t\tLinkedList<Integer> listReverse = new LinkedList<Integer>();\n\t\tfor (int i = 0; i < list.size(); i++) {\n\t\t\tint value = list.get(i);\n\t\t\tlistReverse.addFirst(value);\n\t\t}\n\t\treturn listReverse;\n\t}",
"Node reverse(Node head) {\n\n\t\t// Write your code here\n\t\tNode curr = head;\n\t\tNode prev = null;\n\t\twhile (curr != null) {\n\t\t\twhile (curr != null && curr.data % 2 != 0) {\n\t\t\t\tprev = curr;\n\t\t\t\tcurr = curr.next;\n\t\t\t}\n\t\t\tif (curr != null && curr.data % 2 == 0) {\n\t\t\t\tif (prev != null) {\n\t\t\t\t\tprev.next = reverseHelper(curr);\n\t\t\t\t} else {\n\t\t\t\t\thead = reverseHelper(curr);\n\t\t\t\t}\n\t\t\t\tcurr = curr.next;\n\t\t\t}\n\t\t}\n\t\treturn head;\n\t}",
"public void reverse() {\n\t\t\n\t\tif(isEmpty()==false){\n\t\t\tDoubleNode left=head, right=tail;\n\t\t\tchar temp;\n\t\t\twhile(left!=right&&right!=left.getPrev()){\n\t\t\t\ttemp=left.getC();\n\t\t\t\tleft.setC(right.getC());\n\t\t\t\tright.setC(temp);\n\t\t\t\tleft=left.getNext();\n\t\t\t\tright=right.getPrev();\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public ListNode reverseListRecv(ListNode head) {\n\t\tif (head == null || head.next == null) {\n\t\t\treturn head;\n\t\t}\n\t\t \n\t\tListNode parent = reverseListRecv(head.next);\n\t\thead.next.next = head;\n\t\thead.next = null;\n\t\treturn parent;\n\t}",
"public Node<T> reverse() {\n Node<T> reverse = null;\n if (First == null) {\n return reverse;\n }\n Node<T> firstNode = First;\n Node<T> secondNode = First.next;\n\n while (firstNode != null) {\n //basic operation\n firstNode.next = reverse;\n reverse = firstNode;\n\n if (secondNode == null) {\n //this is the last node needs to be moved\n firstNode = secondNode;\n } else {\n firstNode = secondNode;\n secondNode = secondNode.next;\n }\n }\n return reverse;\n }",
"public ListNode reverseList(ListNode head) {\n return recursionVersion2_3rdTime(head);\n }",
"public void reverse() {\n\t\tif (!this.isEmpty()) {\n\t\t\tT x = this.peek();\n\t\t\tthis.pop();\n\t\t\treverse();\n\t\t\tinsert_at_bottom(x);\n\t\t} else\n\t\t\treturn;\n\t}",
"public static void reversePrint(SinglyLinkedListNode llist) {\n SinglyLinkedListNode next=null;\n SinglyLinkedListNode current=llist;\n SinglyLinkedListNode previous=null;\n while(current!=null)\n {\n next=current.next;\n current.next=previous;\n previous=current;\n current=next;\n }\n while(previous!=null)\n {\n System.out.println(previous.data);\n previous=previous.next;\n }\n }",
"void FlipBook()\r\n\t\t{\r\n\t\t\t Collections.reverse(this);\r\n\t\t}",
"@Override\n\tpublic IDnaStrand reverse() {\n\t\tLinkStrand reversed = new LinkStrand();\n\t\tNode current = new Node(null);\n\t\tcurrent = myFirst;\n\t\t\n\t\twhile (current != null) {\n\t\t\t\n\t\t\tStringBuilder copy = new StringBuilder(current.info);\n\t\t\tcopy.reverse();\n\t\t\tNode first = new Node(copy.toString());\n\t\t\t\n\t\t\tfirst.next = reversed.myFirst;\n\t\t\tif (reversed.myLast == null) {\n\t\t\t\treversed.myLast = reversed.myFirst;\n\t\t\t\treversed.myLast.next = null;\n\t\t\t\t\n\t\t\t}\n\t\t\treversed.myFirst = first;\n\t\t\treversed.mySize += copy.length();\n\t\t\treversed.myAppends ++;\n\t\t\t\n\t\t\t\n\t\t\tcurrent = current.next;\n\t\t\t\n\t\t}\n\t\treturn reversed;\n\t}",
"void reverse();",
"void reverse();",
"public static LinkedList reverseLinkedList(LinkedList head) {\n\t\tLinkedList t1=head;\n\t\tLinkedList t2=head.next;\n\t\tLinkedList t3=null;\n\t\tif (t1.next==null){\n\t\treturn t1;\n\t\t}\n\t\twhile(t2.next!=null){\n\t\t\tt3=t2.next;\n\t\t\tt2.next=t1;\n\t\t\tt1=t2;\n\t\t\tt2=t3;\n\t\t}\n\t\tt2.next=t1;\n\t\thead.next=null;\n\t\thead=t2;\n return head;\n }",
"public ListNode reverseList1(ListNode head) {\r\n\t\tListNode curr = head, next, prev = null;\r\n\t\twhile (curr != null) {\r\n\t\t\tnext = curr.next;\r\n\t\t\tcurr.next = prev;\r\n\t\t\tprev = curr;\r\n\t\t\tcurr = next;\r\n\t\t}\r\n\t\treturn prev;\r\n\t}",
"public /*@ non_null @*/ JMLListEqualsNode<E> reverse() {\n JMLListEqualsNode<E> ptr = this;\n JMLListEqualsNode<E> ret = null;\n //@ loop_invariant ptr != this ==> ret != null;\n //@ maintaining (* ret is the reverse of items in this up to ptr *);\n while (ptr != null) {\n //@ assume ptr.val != null ==> \\typeof(ptr.val) <: elementType;\n ret = new JMLListEqualsNode<E>(ptr.val == null ? null\n : (ptr.val) ,\n ret);\n ptr = ptr.next;\n }\n //@ assert ptr == null && ret != null;\n //@ assume elementType == ret.elementType;\n //@ assume containsNull <==> ret.containsNull;\n return ret;\n }",
"public void printInReverseOrder() {\n\t\tNode currentNode = headNode;\n\t\tNode previousNode = headNode;\n\t\t\n\t\tif(currentNode==null) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tList<Node> listOfNodes = new ArrayList<Node>();\n\t\t\t//deal One element LinkedList\n\t\t\tif(currentNode.getNextNode()==null) {\n\t\t\t\tSystem.out.println(currentNode.getData());\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\twhile(currentNode.getNextNode()!=null) {\n\t\t\t\t\tpreviousNode = currentNode;\n\t\t\t\t\tcurrentNode = currentNode.getNextNode();\n\t\t\t\t\tlistOfNodes.add(previousNode);\n\t\t\t\t\tSystem.out.println(\" Adding Node value to the List as \"+currentNode.getData());\n\t\t\t\t}\n\t\t\t\tif(currentNode!=null) {\n\t\t\t\t\tSystem.out.println(\" The Last Node is \"+currentNode.getData());\n\t\t\t\t\tcurrentNode = previousNode.getNextNode();\n\t\t\t\t\tSystem.out.println(\" The Last Node's Next Node is \"+currentNode.getData());\n\n\t\t\t\t\tlistOfNodes.add(currentNode);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(listOfNodes!=null && listOfNodes.size()>0) {\n\t\t\t\t\tCollections.reverse(listOfNodes);\n\t\t\t\t\tlistOfNodes.stream().forEach(elem->System.out.print(elem.data+\" =>\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}",
"private Node reverseLinkedlisthelper(Node current){\n\t\tif (current.next == null){\n\t\t\tthis.head = current; // new head end of list\n\t\t\treturn current;\n\t\t}\n\t\tNode ptr_ahead = reverseLinkedlisthelper(current.next); // get to end of list\n\t\tptr_ahead.next = current;\n\t\treturn current;\n\n\n\t\t// TAIL RECURSION similar to for loop and iterative method i did above!! nothing is done coming back from recursive stack!\n\t}",
"public ListNode reverseListIter(ListNode head) {\n\t\tif (head == null || head.next == null) {\n\t\t\treturn head;\n\t\t}\n\n\t\tListNode start = head;\n\t\tListNode mid = head.next;\n\t\tListNode end = mid.next;\n\t\thead.next = null;\n\n\t\twhile (end != null) {\n\t\t\tmid.next = head;\n\t\t\thead = mid;\n\t\t\tmid = end;\n\t\t\tend = end.next;\n\t\t}\n\n\t\tmid.next = head;\n\t\treturn mid;\n\t}",
"public void printLinkedListInReverse(ImmutableListNode head) {\n if (head == null) return;\n printLinkedListInReverse(head.getNext());\n head.printValue();\n }",
"public static LinkedList reverseLinkedList(LinkedList head) {\n // Write your code here.\n if (head.next == null)\n return head;\n\n // Eg: 1 -> 2 -> 3 -> null;\n\n // 1 is made as currentNode\n // 2 is captured as nextNode from currentNode next, after capturing\n // make current node as tail by making its next to null\n\n var currNode = head;\n var nextNode = head.next;\n currNode.next = null;\n // iterate until nextNode becomes null.\n // before changing nextNode next pointer to currentNode, hold it in temp\n // make nextNode next pointer to currentNode\n // make currentNode as nextNode\n // make nextNode as captured temp.\n while(nextNode != null) {\n var temp = nextNode.next;\n nextNode.next = currNode;\n currNode = nextNode;\n nextNode = temp;\n }\n return currNode;\n }",
"public static ListNode reverseListIteratively(ListNode head) {\n // The reversed list node that will be returned finally\n ListNode prev = null;\n\n // Input - 1 -> 2 -> null\n // Output - 2 -> 1 -> null\n\n while(head != null) {\n // Obtain the head.next first\n ListNode next = head.next; // #1 next = 2 -> 3 -> null | #2 next = 3 -> null |\n\n // Assign the head's next to prev (that's initially null)\n head.next = prev; // #1 head = 1 -> null | #2 head = 2 -> 1 -> null\n\n // Assign the current head of linked list to the prev node\n prev = head; // #1 prev = 1 -> null | #2 | 2 -> 1 -> null | #3 |\n\n // Assign the next stored earlier to the head\n head = next; // #1 head = 2 -> 3 -> null | #2 head = 3 -> null |\n }\n return prev;\n }",
"public ListNode reverse(ListNode prev, ListNode start, ListNode end) {\n\t\tListNode current = start.next;\n\t\tListNode preCurrent = start;\n\t\twhile(current != end){\n\t\t\tListNode temp = current.next;\n\t\t\tcurrent.next = preCurrent;\n\t\t\tpreCurrent = current;\n\t\t\tcurrent = temp;\n\t\t}\n\t\tstart.next = end.next;\n\t\tend.next = preCurrent;\n\t\tprev.next = end;\n\t\treturn start;\n\t}",
"public static void reverse(java.util.List arg0)\n { return; }",
"public void recursiveReverse (Node currentNode)\n{\nif (currentNode==NULL)\nreturn;\n\n/*if we are at the tail node:\n recursive base case:\n*/\nif(currentNode.next==NULL)\n{\n//set HEAD to the current tail since we are reversing list\nhead=currentNode;\nreturn; //since this is the base case\n}\n\nrecursiveReverse(currentNode.next);\ncurrentNode.next.next=currentNode;\ncurrentNode.next=null; //set \"old\" next pointer to NULL\n}",
"public void printListRev(){\n System.out.println(\"My current doubly linked list in reverse:\");\n if (head.next != tail || tail.prev != head){\n MyDoubleNode<T> counter = tail;\n while (counter.prev != head){\n counter = counter.prev;\n if (counter.prev != head){\n System.out.print(counter.data + \", \");\n }\n else {\n System.out.print(counter.data + \"\\n\");\n }\n }\n }\n }",
"public static void main(String[] args) {\n ListNode l0 = new ListNode(1);\n ListNode l1 = new ListNode(2);\n ListNode l2 = new ListNode(3);\n ListNode l3 = new ListNode(4);\n l0.next = l1;\n l1.next = l2;\n l2.next = l3;\n\n System.out.println(l0);\n reverseList(l0);\n System.out.println(l3);\n }",
"public Node reverse(Node node)\n {\n Node prev=null;\n Node current=node;\n Node next=null;\n\n while(current!=null)\n {\n next=current.next;\n current.next=prev;\n prev=current;\n current=next;\n }\n node = prev;\n return node;\n\n }",
"public static LinkedList recursiveReverseList(LinkedList list) {\n\t\tif (list.getHead() == null) {\n\t\t\treturn list;\n\t\t} else if (list.getHead().getNext() == null) {\n\t\t\treturn list;\n\t\t} else {\n\t\t\tListNode currentHead = list.getHead();\n\t\t\tListNode newHead = list.getHead().getNext();\n\t\t\tLinkedList rest = new LinkedList();\n\t\t\trest.setHead(newHead);\n\t\t\tLinkedList reversedRest = recursiveReverseList(rest);\n\t\t\treversedRest.add(currentHead.getData());\n\t\t\treturn reversedRest;\n\t\t}\n\t}",
"static Node Reverse(Node node) {\n // If empty list, return\n if (node == null) return null;\n if (node.next == null) return null;\n\n Node newNode = Reverse(node.next);\n node.next.next = node;\n node.prev = node.next;\n node.next = null;\n\n return newNode;\n }",
"public void reverse(Node current) { \n //Checks if list is empty \n if(head == null) { \n System.out.println(\"List is empty\"); \n return; \n } \n else { \n //Checks if the next node is null, if yes then prints it. \n if(current.next == null) { \n System.out.print(current.data + \" \"); \n return; \n } \n //Recursively calls the reverse function \n reverse(current.next); \n System.out.print(current.data + \" \"); \n } \n }",
"public void reverseDi() {\n int hi = size - 1;\n int lo = 0;\n\n while (lo < hi) {\n Node left = getNodeAt(lo);\n Node right = getNodeAt(hi);\n\n Object temp = left.data;\n left.data = right.data;\n right.data = temp;\n\n lo++;\n hi--;\n }\n }",
"public void reverseList(List<Integer> list) {\n for (int i = list.size() - 1; i >= 0; i--) {\n System.out.println(list.get(i));\n }\n }",
"public static LinkedList<String> revLinkedList(LinkedList<String> lst) {\r\n\t\tStack<String> stk = new Stack<String>();\r\n\t\tLinkedList<String> ret = new LinkedList<String>();\r\n\t\tfor (String item : lst) {\r\n\t\t\tstk.push(item);\r\n\t\t}\r\n\t\twhile (!stk.isEmpty()) {\r\n\t\t\tret.add(stk.pop());\r\n\t\t}\r\n\t\treturn ret;\r\n\t}",
"@Test\n public void testReverse() {\n System.out.println(\"reverse\");\n al.add(1);\n al.add(2);\n al.add(3);\n ArrayList<Integer> rl = new ArrayList<>();\n rl.add(3);\n rl.add(2);\n rl.add(1);\n al.reverse();\n assertEquals(rl.get(0), al.get(0));\n assertEquals(rl.get(1), al.get(1));\n assertEquals(rl.get(2), al.get(2));\n }",
"public DoublyLinkedListHeader reverseList(DoublyLinkedListHeader list) {\n\t\tDoublyLinkedListHeader new_list = new DoublyLinkedListHeader();\r\n\t\tfor(int j = list.size()-1; j>=0;j--) {\r\n\t\t\tnew_list.add(list.get(j));\r\n\t\t}\r\n\t\treturn new_list;\r\n\t}",
"public static void main(String[] args) {\n\t\t\r\n\t\tLinkedListReverse l1 = new LinkedListReverse();\r\n\t\tl1.head = new ListNode(1);\r\n\t\tListNode second = new ListNode(2);\r\n\t\tl1.head.next = second;\r\n\t\tListNode third = new ListNode(3);\r\n\t\tsecond.next = third;\r\n\t\tListNode forth = new ListNode(4);\r\n\t\tthird.next = forth;\r\n\t\t\r\n\t\tprintLinkedList(l1.head);\r\n\t\tListNode newHead = reverseList(l1.head);\r\n\t\tSystem.out.println();\r\n\t\tprintLinkedList(newHead);\r\n\t\t\r\n\t}",
"public static IntNode reverse( IntNode head ) {\r\n\t\t\r\n\t\t// method should return the linked list with the new head\r\n\t\tif( head != null ) {\r\n\t\t\tIntNode prev = null;\r\n\t\t\tIntNode cursor = head;\r\n\t\t\tIntNode link = null;\r\n\t\t\twhile( cursor != null ) {\r\n\t\t\t\tlink = cursor.link;\r\n\t\t\t\tcursor.link = prev;\r\n\t\t\t\tprev = cursor;\r\n\t\t\t\tcursor = link;\r\n\t\t\t}\r\n\t\t\thead = prev;\r\n\t\t\treturn head;\r\n\t\t} // end if\r\n\t\t\r\n\t\treturn null;\t\r\n\t\t\r\n\t}",
"public static void main(String[] args) {\n List<Node<Integer>> lst = new ArrayList<Node<Integer>>();\n for (int i = 0; i < 10; i++) {\n Node<Integer> n1 = new Node<Integer>(i);\n lst.add(n1);\n }\n for (int i = 0; i < lst.size() - 1; i++) {\n lst.get(i).next = lst.get(i + 1);\n }\n Node<Integer> start = lst.get(0);\n\n LinkListLearn l = new LinkListLearn();\n\n l.printLinkList(start);\n\n start = l.reverseRecursively(start);\n System.out.println();\n l.printLinkList(start);\n }",
"public ListNode reverseIter(ListNode head) {\n if (head == null || head.next == null) return head;\n // a -> b -> c -> d\n // pre<-cur next\n //\n ListNode pre = null;\n while (head != null) {\n ListNode next = head.next;\n head.next = pre;\n pre = head;\n head = next;\n }\n return pre;\n }",
"Node Reverse(Node head) {\n\n Stack<Node> node_stack = new Stack<Node>();\n while(head.next != null){\n node_stack.push(head);\n head = head.next;\n }\n Node first = head;\n while(!node_stack.isEmpty()){\n head.next = node_stack.pop();\n head = head.next;\n }\n head.next = null;\n return first;\n}",
"public void printReverse(MovieNode head){\n if(head.next == null){\t\t\t\t\t\t//Base case\n System.out.print(head.data + \"<-\");\n return;\n }\n printReverse(head.next);\t\t\t\t\t//Recursive program\n System.out.print(head.data + \"<-\");\n }",
"public static <T> ReverseListIterator<T> reversed(List<T> original)\r\n\t{\r\n\t\treturn new ReverseListIterator<T>(original);\r\n\t}",
"public static void main(String args[]) {\n LinkedList linkedList = new LinkedList(5);\n linkedList.next = new LinkedList(4);\n linkedList.next.next = new LinkedList(3);\n linkedList.next.next.next = new LinkedList(2);\n linkedList.next.next.next.next = new LinkedList(1);\n\n System.out.println(\"Original Linked List: \" + linkedList.toString());\n\n // recursively reverse and print\n linkedList = recursiveReverse(linkedList);\n System.out.println(\"Recursively Reversed List: \" + linkedList.toString());\n\n // iteratively reverse and print\n linkedList = iterativeReverse(linkedList);\n System.out.println(\"Iteratively Recursed to Original: \" + linkedList.toString());\n }",
"public ListNode reverseRecur(ListNode head) {\n if (head == null || head.next == null) return head;\n ListNode cur = head.next;\n ListNode newhead = reverseRecur(head.next);\n cur.next = head;\n head.next = null;\n return newhead;\n }"
] | [
"0.8389753",
"0.8319704",
"0.8295057",
"0.8287281",
"0.8266125",
"0.8146159",
"0.8061732",
"0.8028145",
"0.7982692",
"0.79154587",
"0.79029214",
"0.7864058",
"0.7785455",
"0.77025133",
"0.7688793",
"0.76625514",
"0.7653209",
"0.7643598",
"0.7619647",
"0.76119375",
"0.7585907",
"0.7571762",
"0.7479254",
"0.7470004",
"0.7468835",
"0.7466797",
"0.74293274",
"0.73844546",
"0.7356969",
"0.7348965",
"0.734505",
"0.73412484",
"0.73404974",
"0.7340478",
"0.73391265",
"0.7338917",
"0.73335975",
"0.7311483",
"0.72996414",
"0.729445",
"0.7285025",
"0.7270101",
"0.7267351",
"0.7260679",
"0.7260466",
"0.72553414",
"0.7189059",
"0.71771204",
"0.7171482",
"0.7164884",
"0.7164108",
"0.71632034",
"0.7147759",
"0.7144435",
"0.71256804",
"0.7121334",
"0.7119066",
"0.7095142",
"0.7093819",
"0.7083543",
"0.70813024",
"0.7078029",
"0.7058619",
"0.7039653",
"0.70187396",
"0.70180064",
"0.70040977",
"0.70040977",
"0.69992113",
"0.69991547",
"0.69791126",
"0.69706297",
"0.6952388",
"0.69412374",
"0.6936168",
"0.6893076",
"0.6883755",
"0.6872872",
"0.68610543",
"0.68601143",
"0.6825502",
"0.68183124",
"0.6811343",
"0.6802167",
"0.67961025",
"0.6771998",
"0.6769656",
"0.6766672",
"0.6764718",
"0.6727205",
"0.67225814",
"0.67085445",
"0.6707139",
"0.6691827",
"0.668714",
"0.66766804",
"0.66662955",
"0.66444486",
"0.6641804",
"0.6618931"
] | 0.71423227 | 54 |
merge head1 and head 2 one by one. | public void merge(ListNode head1, ListNode head2) {
ListNode dummy = new ListNode(0);
ListNode cur = dummy;
while (head1 != null && head2 != null) {
// 注意这里容易出错。head1要先指向它的下一个,再处理head2,否则cur.next=head2这里会改掉
// head1的指向.
cur.next = head1;
cur = cur.next;
head1 = head1.next;
cur.next = head2;
cur = cur.next;
head2 = head2.next;
}
if (head1 != null) {
cur.next = head1;
} else {
cur.next = head2;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public ListNode merge(ListNode h1, ListNode h2){\r\n if(h1 == null){\r\n return h2;\r\n }\r\n if(h2 == null){\r\n return h1;\r\n }\r\n \r\n if(h1.val < h2.val){\r\n h1.next = merge(h1.next, h2);\r\n return h1;\r\n }\r\n else{\r\n h2.next = merge(h1, h2.next);\r\n return h2;\r\n }\r\n \r\n }",
"void merge(ListNode curr1, ListNode curr2) {\n while (curr1 != null) {\n ListNode next1 = curr1.next, next2 = curr2.next;\n curr1.next = curr2;\n if (next1 == null)\n break;\n curr2.next = next1;\n curr1 = next1;\n curr2 = next2;\n }\n }",
"public Node merge(Node h1, Node h2) {\n\t\tNode dummy = new Node();\r\n\t\tNode temp = dummy;\r\n\t\twhile(true) {\r\n\t\t\t// if it is equal to null basically it is a empty link\r\n\t\t\tif(h1 == null) {\r\n\t\t\t\ttemp.next = h2;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif(h2 == null) {\r\n\t\t\t\ttemp.next = h1;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif(h1.data <= h2.data) { // while if h1 is bigger than h2 than need to store h1 inside\r\n\t\t\t\ttemp.next = h1;\r\n\t\t\t\th1 = h1.next;\r\n\t\t\t}else {\r\n\t\t\t\ttemp.next = h2;\r\n\t\t\t\th2 = h2.next;\r\n\t\t\t}\r\n\t\t\ttemp = temp.next;\r\n\t\t}\r\n\t\treturn dummy.next;\r\n\t}",
"Node MergeLists(Node headA, Node headB) { \n \n if(headA==null && headB==null) return null;\n if(headA==null) return headB;\n if(headB==null) return headA;\n\t\n\tNode start = new Node();\n\tNode curr = start;\n \n while(headA!=null && headB!=null) {\n if(headA.data < headB.data) {\n curr.next = headA;\n headA = headA.next;\n } else {\n curr.next = headB;\n headB = headB.next;\n }\n curr = curr.next;\n }\n \n if(headB!=null) curr.next=headB;\n if(headA!=null) curr.next=headA;\n\treturn start.next;\n}",
"public ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n ListNode prehead = new ListNode(-1);\n\n ListNode prev = prehead;\n while (l1 != null && l2 != null) {\n if (l1.val <= l2.val) {\n prev.next = l1;\n l1 = l1.next;\n } else {\n prev.next = l2;\n l2 = l2.next;\n }\n prev = prev.next;\n }\n\n // exactly one of l1 and l2 can be non-null at this point, so connect\n // the non-null list to the end of the merged list.\n prev.next = l1 == null ? l2 : l1;\n\n return prehead.next;\n }",
"public Node mergeTwoSortedLinkedList(Node h1, Node h2) {\n if (h1 == null || h2 == null) {\n return h1 != null ? h1 : h2;\n }\n Node S, P, Q;\n if (h1.data > h2.data) {\n S = h2;\n P = h1;\n Q = S.next;\n } else {\n S = h1;\n P = S.next;\n Q = h2;\n }\n Node dummyNode = new Node(S.data);\n Node current = dummyNode;\n while (P != null && Q != null) {\n if (P.data > Q.data) {\n S = Q;\n Q = Q.next;\n } else {\n S = P;\n P = P.next;\n }\n current.next = S;\n current = current.next;\n }\n Node remainingNode = (P == null) ? Q : P;\n while (remainingNode != null) {\n current.next = remainingNode;\n current = current.next;\n remainingNode = remainingNode.next;\n }\n return dummyNode;\n }",
"public static ListNode mergeTwoLists2(ListNode l1, ListNode l2) {\n ListNode prehead = new ListNode(-1);\n\n ListNode prev = prehead;\n while (l1 != null && l2 != null) {\n if (l1.val <= l2.val) {\n prev.next = l1;\n l1 = l1.next;\n } else {\n prev.next = l2;\n l2 = l2.next;\n }\n prev = prev.next;\n }\n\n // exactly one of l1 and l2 can be non-null at this point, so connect\n // the non-null list to the end of the merged list.\n prev.next = l1 == null ? l2 : l1;\n\n return prehead.next;\n\n }",
"public static ListNode mergeSortedList(ListNode headOne, ListNode headTwo){\n\t\tListNode dummy = new ListNode(-1);\n\t\tListNode current = dummy;\n\t\t\n\t\twhile(headOne != null && headTwo != null){\n\t\t\tif(headOne.value < headTwo.value){\n\t\t\t\tcurrent.next = headOne;\n\t\t\t\theadOne = headOne.next;\n\t\t\t}else{\n\t\t\t\tcurrent.next = headTwo;\n\t\t\t\theadTwo = headTwo.next;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tif(headOne != null){\n\t\t\tcurrent.next = headOne;\n\t\t}else{\n\t\t\tcurrent.next = headTwo;\n\t\t}\n\t\t\n\t\treturn current.next;\n\t}",
"public static void main(String[] args) {\n\t\tListNode h1 = new ListNode(2);\n\t\tListNode h2 = new ListNode(1);\n\t\tListNode re = mergeTwoLists(h1,h2);\n\t\tSystem.out.println(re.val);\n\t\tSystem.out.println(re.next.val);\n\t}",
"public static ListNode merge2(ListNode l1,ListNode l2){\n if(l1==null) return l2;\n if(l2==null) return l1;\n if(l1.getVal()<l2.getVal()){\n l1.next=merge2(l1.next,l2);\n return l1;\n }else{\n l2.next=merge2(l1,l2.next);\n return l2;\n }\n }",
"public ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n ListNode head = new ListNode(0);\n ListNode l3 = head;\n while (l1 != null && l2 != null) {\n if (l1.val <= l2.val) {\n l3.next = l1;\n l1 = l1.next;\n } else {\n l3.next = l2;\n l2 = l2.next;\n }\n l3 = l3.next;\n }\n\n while (l1 != null) {\n l3.next = l1;\n l1 = l1.next;\n l3 = l3.next;\n }\n\n while (l2 != null) {\n l3.next = l2;\n l2 = l2.next;\n l3 = l3.next;\n }\n return head.next;\n }",
"public ListNode mergeTwoListsWithExtraLinkedList(ListNode l1, ListNode l2) {\n ListNode dummy=new ListNode();\n ListNode curr=dummy,temp;\n while(l1!=null && l2!=null){\n if(l1.val<l2.val){\n temp=new ListNode(l1.val);\n l1=l1.next;\n }\n else{\n temp=new ListNode(l2.val);\n l2=l2.next;\n }\n curr.next=temp;\n curr=curr.next;\n }\n while(l1!=null){\n curr.next=new ListNode(l1.val);\n l1=l1.next;\n curr=curr.next;\n }\n while(l2!=null){\n curr.next=new ListNode(l2.val);\n l2=l2.next;\n curr=curr.next;\n }\n return dummy.next;\n }",
"public static ListNode merge(ListNode l1, ListNode l2) {\n if (l1 == null) return l2;\n if (l2 == null) return l1;\n if (l1.val < l2.val) {\n l1.next = merge(l1.next, l2);\n return l1;\n } else {\n l2.next = merge(l1, l2.next);\n return l2;\n }\n }",
"public ListNode merge(ListNode left, ListNode right){\n ListNode head = new ListNode(0);\n ListNode p = head;\n while(left!=null&&right!=null){\n if(left.val<right.val){\n p.next = left;\n left = left.next;\n }\n else{\n p.next = right;\n right = right.next;\n }\n p = p.next;\n }\n if(left!=null){\n p.next = left;\n }\n if(right!=null){\n p.next = right;\n }\n // p.next=null;//不需要,原始节点会有next null信息\n return head.next;\n\n\n }",
"public Node mergeSort(Node head){\r\n\t\t\tif(head == null || head.next == null)\r\n\t\t\t\treturn head;\r\n\t\t\t// divide the list in 2 parts\r\n\t\t\tNode rightLow = split(head);\r\n\t\t\t\r\n\t\t\tNode leftPart = mergeSort(head);\r\n\t\t\tNode rightPart = mergeSort(rightLow);\r\n\r\n\t\t\t// call the merge sorted lists method to merge both the divided parts in sorted way\r\n\t\t\treturn mergeSortedLists(leftPart, rightPart);\r\n\t\t}",
"public static ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n ListNode dummy = new ListNode(-1), cur = dummy;\n while (l1 != null && l2 != null) {\n if (l1.val < l2.val) {\n cur.next = l1;\n l1 = l1.next;\n } else {\n cur.next = l2;\n l2 = l2.next;\n }\n cur = cur.next;\n }\n cur.next = (l1 != null) ? l1 : l2;\n return dummy.next;\n }",
"public static LinkedList.LL merge(LinkedList.LL ll1, LinkedList.LL ll2) {\n LinkedList.Node n1 = ll1.head;\n LinkedList.Node n2 = ll2.head;\n LinkedList.Node prev = null;\n System.out.println(\"-------------------------------------------------\");\n ll1.print();\n ll2.print();\n while (n1.next != null || n2 != null) {\n if (n1.data <= n2.data && n1.next != null) {\n prev = n1;\n n1 = n1.next;\n } else if (n1.data > n2.data) {\n if (prev != null) {\n prev.next = n2;\n } else {\n ll1.head = n2;\n }\n LinkedList.Node next = n2.next;\n n2.next = n1;\n prev = n2;\n n2 = next;\n } else if (n1.next == null) {\n n1.next = n2;\n break;\n }\n }\n System.out.println(\"-------------------------------------------------\");\n ll1.print();\n System.out.println(\"-------------------------------------------------\"); \n return ll1;\n }",
"int merge(int list1, int list2) {\n\t\t\n\t\t// Get values of the lists\n\t\t\n\t\tComparable c1 = array[list1];\n\t\tComparable c2 = array[list2];\n\n\t\t// compare values\n\t\t\n\t\tint small = list1, big = list2;\n\t\tif (c1 != c2 && c1 != null && c1.compareTo(c2) > 0) {\n\n\t\t\tsmall = list2;\n\t\t\tbig = list1;\n\t\t}\n\n\t\t/*\n\t\t * If small list has no tail - set big list to be small list tail\n\t\t * If small list has tail - merge it with the big list and set result to be small list tail\n\t\t */\n\t\t\n\t\tif (next[small] == NIL)\n\t\t\tnext[small] = big;\n\t\telse\n\t\t\tnext[small] = merge(next[small], big);\n\t\t\n\t\t// return small list with new tail\n\t\t\n\t\treturn small;\n\t}",
"public ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n if(l1 == null) {\n return l2;\n }\n\n if(l2 == null) {\n return l1;\n }\n\n ListNode head = null;\n ListNode current = null;\n while(l1 != null && l2 != null) {\n\n if(l1.val < l2.val) {\n if(head == null) {\n head = current = l1;\n } else {\n current.next = l1;\n current = current.next;\n }\n l1 = l1.next;\n } else {\n if(head == null) {\n head = current = l2;\n } else {\n current.next = l2;\n current = current.next;\n }\n l2 = l2.next;\n }\n }\n\n if(l1 == null) {\n current.next = l2;\n }\n\n if(l2 == null) {\n current.next = l1;\n }\n\n return head;\n }",
"public ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n ListNode dummyHead = new ListNode(0);\n ListNode endOfSortedList = dummyHead;\n\n while (l1 != null && l2 != null) {\n if (l1.val < l2.val) {\n endOfSortedList.next = l1;\n l1 = l1.next;\n } else {\n endOfSortedList.next = l2;\n l2 = l2.next;\n }\n\n endOfSortedList = endOfSortedList.next;\n }\n\n if (l1 != null) {\n endOfSortedList.next = l1;\n }\n\n if (l2 != null) {\n endOfSortedList.next = l2;\n }\n\n return dummyHead.next;\n }",
"Node merge(Node first, Node second) {\n // If first linked list is empty\n if (first == null) {\n return second;\n }\n \n // If second linked list is empty\n if (second == null) {\n return first;\n }\n \n // Pick the smaller value\n if (first.data < second.data) {\n first.next = merge(first.next, second);\n first.next.prev = first;\n first.prev = null;\n return first;\n } else {\n second.next = merge(first, second.next);\n second.next.prev = second;\n second.prev = null;\n return second;\n }\n }",
"public ListNode mergeTwoListsIterative(ListNode l1, ListNode l2) {\n ListNode dummy=new ListNode();\n ListNode curr=dummy;\n while(l1!=null && l2!=null){\n if(l1.val<l2.val){\n curr.next=l1;\n l1=l1.next;\n curr=curr.next;\n }\n else{\n curr.next=l2;\n l2=l2.next;\n curr=curr.next;\n }\n }\n while(l1!=null){\n curr.next=l1;\n l1=l1.next;\n curr=curr.next;\n }\n while(l2!=null){\n curr.next=l2;\n l2=l2.next;\n curr=curr.next;\n }\n return dummy.next;\n }",
"public static void main(String[] args) {\n List<Integer> list1 = new ArrayList<>();\n List<Integer> list2 = new ArrayList<>();\n list1.add(2);\n list1.add(3);\n list1.add(4);\n list2.add(1);\n list2.add(5);\n list2.add(6);\n merge(list1, list2).forEach(item -> System.out.print(item + \" \"));\n }",
"public static LinkedList merge(LinkedList one, LinkedList two) {\r\n\r\n Node current = one.head;\r\n Node placeHolder1 = current;\r\n Node placeholder2 = two.head;\r\n\r\n if (one.head == null) {\r\n return two;\r\n\r\n } else if (two.head == null) {\r\n return one;\r\n\r\n }\r\n\r\n while (current != null && placeholder2 != null && placeHolder1 != null) {\r\n placeHolder1 = current.next;\r\n current.next = placeholder2;\r\n current = current.next;\r\n placeholder2 = current.next;\r\n\r\n if (placeHolder1 != null) {\r\n current.next = placeHolder1;\r\n current = current.next;\r\n }\r\n }\r\n return one;\r\n\r\n }",
"public static ListNode mergeTwoList(ListNode list1, ListNode list2){\n if (list1 == null) return list2;\n if (list2 == null) return list1;\n\n ListNode head = null;\n ListNode p = list1;\n ListNode q = list2;\n\n if (p.val <= q.val) {\n head = p;\n p = p.next;\n }\n else {\n head = q;\n q = q.next;\n }\n ListNode point = head;\n\n while (p != null && q != null){\n if (p.val <= q.val){\n point.next = p;\n p = p.next;\n\n }else {\n point.next = q;\n q = q.next;\n\n }\n point = point.next;\n }\n\n if (p == null){\n point.next = q;\n }else {\n point.next = p;\n }\n\n return head;\n }",
"public static ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n if(l1 == null) {\n return l2;\n }\n\n if(l2 == null) {\n return l1;\n }\n ListNode newList;\n\n if(l1.val < l2.val) {\n newList = l1;\n\n l1 = l1.next;\n } else {\n newList = l2;\n l2 = l2.next;\n }\n\n ListNode head = newList;\n\n while (l1 != null && l2 != null) {\n if(l1.val < l2.val) {\n newList.next = l1;\n newList = newList.next;\n l1 = l1.next;\n } else {\n newList.next = l2;\n newList = newList.next;\n l2 = l2.next;\n }\n }\n\n if(l1 == null){\n newList.next = l2;\n } else {\n newList.next = l1;\n }\n\n return head;\n }",
"public static SinglyLinkedList merge(SinglyLinkedList list1, SinglyLinkedList list2)\n\t{\n\t\tSinglyLinkedList list3 = new SinglyLinkedList();\n\t\tint i = 0;\n\t\tint j = 0;\n\t\twhile((i < list1.size()) && (j < list2.size()))\n\t\t{\n\t\t\tif(list1.getElementAt(i) < list2.getElementAt(j))\n\t\t\t{\n\t\t\t\tlist3.addLast(list1.getElementAt(i));\n\t\t\t\ti++;\n\t\t\t}\n\t\t\telse if(list1.getElementAt(i) > list2.getElementAt(j))\n\t\t\t{\n\t\t\t\tlist3.addLast(list2.getElementAt(j));\n\t\t\t\tj++;\n\t\t\t}\n\t\t\telse if(list1.getElementAt(i) == list2.getElementAt(j))\n\t\t\t{\n\t\t\t\tlist3.addLast(list2.getElementAt(j));\n\t\t\t\tj++;\n\t\t\t}\n\t\t}\n\t\tif(i == list1.size())\n\t\t{\n\t\t\tfor(int k = j; k < list2.size(); k++)\n\t\t\t{\n\t\t\t\tlist3.addLast(list2.getElementAt(k));\n\t\t\t}\n\t\t}\n\t\telse if(j == list2.size())\n\t\t{\n\t\t\tfor(int l = i; l < list1.size(); l++)\n\t\t\t{\n\t\t\t\tlist3.addLast(list1.getElementAt(l));\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn list3;\n\t}",
"public ListNode mergeSortList(ListNode head) {\n \tif(head == null || head.next == null) return head;\n \t//递归的出口 空list或者 只有一个值的时候 直接返回 \n \tListNode mid=findMid(head); //找到中间值 \n \tListNode pointer=mid.next; //记录右边的开始\n \tmid.next=null; // 把list拆成两半 \n \tListNode part1=mergeSortList(head); //对前半部分mergeSort 并记录返回指针\n \tListNode part2=mergeSortList(pointer); //对后半部分mergeSort 并记录返回指针\n \treturn merge(part1, part2); //两部分再合并\n }",
"public ListNode mergeTwoLists(ListNode l1, ListNode l2) {\r\n if (l1==null) {\r\n\t\t\treturn l2;\r\n\t\t}\r\n if (l2==null) {\r\n\t\t\treturn l1;\r\n\t\t}\r\n ListNode result=new ListNode(0);\r\n ListNode head=result;\r\n while(l1!=null&&l2!=null){\r\n \tif (l1.val<=l2.val) {\r\n\t\t\t\thead.next=l1;\r\n\t\t\t\tl1=l1.next;\r\n\t\t\t}else {\r\n\t\t\t\thead.next=l2;\r\n\t\t\t\tl2=l2.next;\r\n\t\t\t}\r\n \thead=head.next;\r\n }\r\n if (l1!=null) {\r\n\t\t\thead.next=l1;\r\n\t\t}\r\n if (l2!=null) {\r\n\t\t\thead.next=l2;\r\n\t\t}\r\n \r\n return result.next;\r\n }",
"public Node mergeSort(Node head) {\n if (head == null || head.next == null) {\n return head;\n }\n\n // split head into 'a' and 'b' sublists\n Node a = head, b;\n\n Node slow = split(head);\n b = slow.next;\n slow.next = null;\n\n // recursively sort the sub-lists\n a = mergeSort(a);\n b = mergeSort(b);\n\n // merge the two sorted lists together\n head = merge(a, b);\n return head;\n }",
"Node merge(Node first, Node second) {\r\n\t\t// If first linked list is empty\r\n\t\tif (first == null) {\r\n\t\t\treturn second;\r\n\t\t}\r\n\r\n\t\t// If second linked list is empty\r\n\t\tif (second == null) {\r\n\t\t\treturn first;\r\n\t\t}\r\n\r\n\t\t// Pick the smaller value\r\n\t\tif (first.data < second.data) {\r\n\t\t\tfirst.next = merge(first.next, second);\r\n\t\t\tfirst.next.prev = first;\r\n\t\t\tfirst.prev = null;\r\n\t\t\treturn first;\r\n\t\t} else {\r\n\t\t\tsecond.next = merge(first, second.next);\r\n\t\t\tsecond.next.prev = second;\r\n\t\t\tsecond.prev = null;\r\n\t\t\treturn second;\r\n\t\t}\r\n\t}",
"void merge();",
"public static ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n if (l1 == null || l2 == null)\n return l1 != null ? l1 : l2;\n\n ListNode dummy = new ListNode(-1);\n ListNode prev = dummy, c1 = l1, c2 = l2;\n\n while (c1 != null && c2 != null) {\n if (c1.val <= c2.val) {\n prev.next = c1;\n c1 = c1.next;\n } else {\n prev.next = c2;\n c2 = c2.next;\n }\n prev = prev.next;\n }\n\n prev.next = c1 != null ? c1 : c2;\n ListNode head = dummy.next;\n dummy.next = null; // delete dummy;\n return head;\n }",
"@Override\n\tprotected void merge(Object in1, Object in2, Object out) {\n\t\t\n\t}",
"public static void merge(int[] list1, int[] list2, int[] temp){\n //Current index in three lists\n int current1 = 0;\n int current2 = 0;\n int current3 = 0;\n\n while(current1 < list1.length && current2 < list2.length){\n if(list1[current1] < list2[current2])\n temp[current3++] = list1[current1++];\n else\n temp[current3++] = list2[current2++];\n }\n //Rest of the list1 to temp\n while(current1 < list1.length)\n temp[current3++] = list1[current1++];\n //Rest of the list2 to temp\n while(current2 < list2.length)\n temp[current3++] = list2[current2++];\n }",
"private static Node binomialHeapMerge(BinomialHeap h1, BinomialHeap h2) {\n\t\t\n\t\t// checking for null values\n\t\tif(h1.head == null)\n\t\t\treturn h2.head;\n\t\tif(h2.head == null)\n\t\t\treturn h1.head;\n\t\t\n\t\t// initialize pointers\n\t\t// initialize the first pointer based on smallest node in both heaps\n\t\tNode first = null;\n\t\tNode curr = null;\n\t\tNode currh1 = h1.head;\n\t\tNode currh2 = h2.head;\n\t\tif (currh1.degree < currh2.degree) { \n first = currh1;\n currh1 = currh1.rightSibling;\n }\n else {\n \tfirst = currh2;\n currh2 = currh2.rightSibling;\n }\n\t\t\n\t\t// loop over remaining values by attaching the smallest degree element\n\t\t// one at a time until one of the pointers becomes null\n\t\tcurr = first;\n\t\twhile (currh1!=null && currh2!=null) {\n\t if (currh1.degree < currh2.degree) { \n\t curr.rightSibling = currh1;\n\t currh1 = currh1.rightSibling;\n\t }\n\t else {\n\t curr.rightSibling = currh2;\n\t currh2 = currh2.rightSibling;\n\t }\n\t \n\t curr = curr.rightSibling;\n\t }\n\t \n\t\t// attach the remaining of the other list to current list's right\n\t if (currh1!=null)\n\t curr.rightSibling = currh1;\n\t else\n\t curr.rightSibling = currh2;\n\n\t //return the head of newly formed list of heaps\n\t return first;\n\t}",
"public static ListNode mergeSorted(ListNode l1, ListNode l2){\n \n// if(l1==null){\n// return l2;\n// }\n// \n// if(l2==null)\n// return l1;\n// \n// if(l1.val<l2.val){\n// l1.next = mergeSorted(l1.next,l2);\n// return l1;\n// }else{\n// l2.next = mergeSorted(l1,l2.next);\n// return l2;\n// }\n \t\n \tListNode dummy = new ListNode(0);\n \tListNode tail = dummy;\n \t\n \twhile(l1!=null&&l2!=null){\n \t\tif(l1.val<l2.val){\n \t\t\ttail.next = l1;\n \t\t\tl1=l1.next;\n \t\t}else{\n \t\t\ttail.next = l2;\n \t\t\tl2=l2.next;\n \t\t}\n \t\ttail = tail.next;\n \t}\n \t\n \tif(l1!=null){\n \t\ttail.next=l1;\n \t}else if(l2!=null){\n \t\ttail.next=l2;\n \t}\n \t\n \treturn dummy.next;\n }",
"public static void main(String[] args) {\n\t\tNode headA = new Node();\r\n\t\tNode second1 = new Node();\r\n\t\tNode third1 = new Node();\r\n\t\theadA.data=1;\r\n\t\tsecond1.data=3;\r\n\t\tthird1.data=5;\r\n\t\theadA.next=second1;\r\n\t\tsecond1.next=third1;\r\n\t\t\r\n\t\tNode headB = new Node();\r\n\t\tNode second2 = new Node();\r\n\t\tNode third2 = new Node();\r\n\t\theadB.data=2;\r\n\t\tsecond2.data=4;\r\n\t\tthird2.data=6;\r\n\t\theadB.next=second2;\r\n\t\tsecond2.next=third2;\r\n\t\t\r\n\t\tdisplay(headA);\r\n\t\tdisplay(headB);\r\n\t\t\r\n\t\tNode head3 = MergeLists(headA, headB);\r\n\t\tdisplay(head3);\r\n\t}",
"@SuppressWarnings(\"squid:S2259\")\n private void mergeInto(RootListNode<K> head, RootListNode<K> tail) {\n // if root list empty, just copy\n if (rootList.head == null) {\n rootList.head = head;\n rootList.tail = tail;\n return;\n }\n\n // initialize\n RootListNode<K> resultHead;\n RootListNode<K> resultTail;\n RootListNode<K> resultTailPrev = null;\n RootListNode<K> cur1 = rootList.head;\n RootListNode<K> cur2 = head;\n\n // add first node\n if (cur1.root.rank <= cur2.root.rank) {\n resultHead = cur1;\n resultTail = cur1;\n RootListNode<K> cur1next = cur1.next;\n cur1.next = null;\n cur1 = cur1next;\n if (cur1next != null) {\n cur1next.prev = null;\n }\n } else {\n resultHead = cur2;\n resultTail = cur2;\n RootListNode<K> cur2next = cur2.next;\n cur2.next = null;\n cur2 = cur2next;\n if (cur2next != null) {\n cur2next.prev = null;\n }\n }\n\n // merge\n int rank1; \n int rank2;\n while (true) {\n int resultRank = resultTail.root.rank;\n\n // read rank1\n if (cur1 != null) {\n rank1 = cur1.root.rank;\n } else {\n if (cur2 != null && cur2.root.rank <= resultRank) {\n rank1 = Integer.MAX_VALUE;\n } else {\n break;\n }\n }\n\n // read rank2\n if (cur2 != null) {\n rank2 = cur2.root.rank;\n } else {\n if (cur1 != null && cur1.root.rank <= resultRank) {\n rank2 = Integer.MAX_VALUE;\n } else {\n break;\n }\n }\n\n if (rank1 <= rank2) {\n switch (Integer.compare(rank1, resultRank)) {\n case 0:\n // combine into result\n resultTail.root = combine(cur1.root, resultTail.root);\n // remove cur1\n RootListNode<K> cur1next = cur1.next;\n cur1.next = null;\n if (cur1next != null) {\n cur1next.prev = null;\n }\n cur1 = cur1next;\n break;\n case -1:\n // can happen if three same ranks\n cur1next = cur1.next;\n // add before tail into result\n cur1.next = resultTail;\n resultTail.prev = cur1;\n cur1.prev = resultTailPrev;\n if (resultTailPrev != null) {\n resultTailPrev.next = cur1;\n } else {\n resultHead = cur1;\n }\n resultTailPrev = cur1;\n // advance cur1\n if (cur1next != null) {\n cur1next.prev = null;\n }\n cur1 = cur1next;\n break;\n case 1:\n // append into result\n resultTail.next = cur1;\n cur1.prev = resultTail;\n resultTailPrev = resultTail;\n resultTail = cur1;\n // remove cur1\n cur1 = cur1.next;\n resultTail.next = null;\n if (cur1 != null) {\n cur1.prev = null;\n }\n break;\n default:\n break;\n }\n } else {\n // symmetric case rank2 < rank1\n switch (Integer.compare(rank2, resultRank)) {\n case 0:\n // combine into result\n resultTail.root = combine(cur2.root, resultTail.root);\n // remove cur2\n RootListNode<K> cur2next = cur2.next;\n cur2.next = null;\n if (cur2next != null) {\n cur2next.prev = null;\n }\n cur2 = cur2next;\n break;\n case -1:\n // can happen if three same ranks\n cur2next = cur2.next;\n // add before tail into result\n cur2.next = resultTail;\n resultTail.prev = cur2;\n cur2.prev = resultTailPrev;\n if (resultTailPrev != null) {\n resultTailPrev.next = cur2;\n } else {\n resultHead = cur2;\n }\n resultTailPrev = cur2;\n // advance cur2\n if (cur2next != null) {\n cur2next.prev = null;\n }\n cur2 = cur2next;\n break;\n case 1:\n // append into result\n resultTail.next = cur2;\n cur2.prev = resultTail;\n resultTailPrev = resultTail;\n resultTail = cur2;\n // remove cur2\n cur2 = cur2.next;\n resultTail.next = null;\n if (cur2 != null) {\n cur2.prev = null;\n }\n break;\n default: \n break;\n }\n\n }\n }\n\n // record up to which point a suffix minimum update is needed\n RootListNode<K> updateSuffixFix = resultTail;\n\n // here rank of cur1 is more than result rank\n if (cur1 != null) {\n cur1.prev = resultTail;\n resultTail.next = cur1;\n resultTail = rootList.tail;\n }\n\n // here rank of cur2 is more than result rank\n if (cur2 != null) {\n cur2.prev = resultTail;\n resultTail.next = cur2;\n resultTail = tail;\n }\n\n // update suffix minimum\n updateSuffixMin(updateSuffixFix);\n\n // store final list\n rootList.head = resultHead;\n rootList.tail = resultTail;\n }",
"private ListNode iterateMergeTwoRankedList(ListNode head5, ListNode head6) {\n\n if (head5 == null) {\n return head6;\n } else if (head6 == null) {\n return head5;\n }\n\n ListNode mergedHead = null;\n ListNode node = mergedHead;\n\n while (head5 != null && head6 != null) {\n node = head5.val <= head6.val ? head5 : head6;\n\n if (mergedHead == null) {\n mergedHead = node;\n }\n\n node = node.next;\n head5 = head5.next;\n head6 = head6.next;\n }\n\n if (head5 == null) {\n node = head6;\n }else if (head6 == null) {\n node = head5;\n }\n\n return mergedHead;\n }",
"private static Node MergeLists(Node headA, Node headB) {\n\t Node current1=headA;\r\n\t Node current2=headB;\r\n\t Node head3=null;\r\n\t Node current3 = head3;\r\n\t while(current1!=null && current2!=null){\r\n\t if(current1.data < current2.data){\r\n\t Node temp=new Node();\r\n\t temp.data = current1.data;\r\n\t\t\t\tif(head3==null){\r\n\t\t\t\t\thead3=temp;\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tcurrent3=head3;\r\n\t\t\t\t\twhile(current3.next!=null)\r\n\t\t\t\t\t\tcurrent3=current3.next;\r\n\t\t\t\t\tcurrent3.next=temp;\r\n\t\t\t\t}\r\n\t current1=current1.next;\r\n\t }\r\n\t else{\r\n\t // current3.data=current2.data;\r\n\t Node temp=new Node();\r\n\t temp.data = current2.data;\r\n\t\t\t\tif(head3==null){\r\n\t\t\t\t\thead3=temp;\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tcurrent3=head3;\r\n\t\t\t\t\twhile(current3.next!=null)\r\n\t\t\t\t\t\tcurrent3=current3.next;\r\n\t\t\t\t\tcurrent3.next=temp;\r\n\t\t\t\t}\r\n\t current2=current2.next;\r\n\t }\r\n\t \r\n\t }\r\n\t while(current1!=null){\r\n\t \tNode temp=new Node();\r\n temp.data = current1.data;\r\n\t\t\tif(head3==null){\r\n\t\t\t\thead3=temp;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tcurrent3=head3;\r\n\t\t\t\twhile(current3.next!=null)\r\n\t\t\t\t\tcurrent3=current3.next;\r\n\t\t\t\tcurrent3.next=temp;\r\n\t\t\t}\r\n current1=current1.next;\r\n\t }\r\n\t while(current2!=null){\r\n\t \tNode temp=new Node();\r\n temp.data = current2.data;\r\n\t\t\tif(head3==null){\r\n\t\t\t\thead3=temp;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tcurrent3=head3;\r\n\t\t\t\twhile(current3.next!=null)\r\n\t\t\t\t\tcurrent3=current3.next;\r\n\t\t\t\tcurrent3.next=temp;\r\n\t\t\t}\r\n current2=current2.next;\r\n\t }\r\n\t return head3;\r\n\t}",
"private void findIntersection(Node head1, Node head2) {\n if (head1 == null || head2 == null) {\n System.out.println(\"No intersection found\");\n return;\n }\n Set<Node> set = new HashSet<Node>();\n boolean flag = false;\n\n for (Node temp = head1; temp != null; temp = temp.next)\n set.add(temp);\n for (Node temp = head2; temp != null; temp = temp.next)\n if (!set.add(temp)) {\n System.out.println(\"Intersection found at \" + temp.data);\n flag = true;\n break;\n }\n if (!flag) {\n System.out.println(\"No intersection found\");\n }\n }",
"private static ListNode sortList(ListNode head) {\n if (head == null || head.next == null) {\n return head;\n }\n ListNode mid = getMid(head);\n ListNode left = sortList(head);\n ListNode right = sortList(mid);\n return merge(left, right);\n }",
"public ListNode mergeInBetween(ListNode list1, int a, int b, ListNode list2) {\n final ListNode vituralHead = new ListNode(0);\n vituralHead.next = list1;\n\n ListNode cursor = vituralHead;\n int index = 0;\n\n ListNode aNode = null;\n ListNode bNode = null;\n while (cursor != null) {\n\n if (index == a) {\n aNode = cursor;\n }\n\n if (index == b + 1) {\n bNode = cursor;\n break;\n }\n\n index++;\n cursor = cursor.next;\n }\n\n ListNode tailOfList2 = list2;\n while (tailOfList2.next != null) {\n tailOfList2 = tailOfList2.next;\n }\n\n aNode.next = list2;\n tailOfList2.next = bNode.next;\n return vituralHead.next;\n }",
"public ListNode mergeTwoListsRecursion(ListNode l1, ListNode l2) {\n if(l1==null)return l2;\n if(l2==null)return l1;\n if(l1.val<l2.val){\n l1.next=mergeTwoListsRecursion(l1.next,l2);\n return l1;\n }\n else{\n l2.next=mergeTwoLists(l1,l2.next);\n return l2;\n }\n }",
"public void reorderList(ListNode head) {\n\n if(head == null||head.next == null) return;\n int len = 0;\n\n for (ListNode cur = head; cur!= null; cur = cur.next) len++;\n\n int middle = (len%2 == 1) ? len/2 + 1: len/2 ;\n\n ListNode midNode = head;\n for (int i = 0; i < middle - 1; i++)\n midNode = midNode.next;\n\n ListNode head1 = head;\n ListNode head2 = midNode.next;\n midNode.next = null;\n head2 = revertListAndReturnHead(head2);\n\n //MERGE\n ListNode cur1 = head1;\n ListNode cur2 = head2;\n while (cur1 != null && cur2 != null) {\n ListNode nextCur1 = cur1.next;\n ListNode nextCur2 = cur2.next;\n cur1.next = cur2;\n cur2.next = nextCur1;\n cur1 = nextCur1;\n cur2 = nextCur2;\n }\n\n }",
"public ListNode mergeTwoLists(ListNode l1, ListNode l2) {\n\t\t//The base condition if one of the list is empty so then return the other list as it is.\n\t\tif (l1 == null) return l2;\n\t\tif (l2 == null) return l1;\n\t\t//Intializing the head of the ans\n\t\tListNode ans = l1;\n\t\tif (l2.val < l1.val) {\n\t\t\tans = l2;\n\t\t\tl2 = l2.next;\n\t\t} else l1 = l1.next;\n\t\t//Initializing ans in another variable so that it should'nt get lost.\n\t\tListNode ans2 = ans;\n\t\twhile (l1 != null && l2 != null) {\n\t\t\tif (l1.val <= l2.val) {\n\t\t\t\tans.next = l1;\n\t\t\t\tl1 = l1.next;\n\t\t\t\tans = ans.next;\n\t\t\t} else {\n\t\t\t\tans.next = l2;\n\t\t\t\tl2 = l2.next;\n\t\t\t\tans = ans.next;\n\t\t\t}\n\t\t}\n\t\t//if list are not same then one list will be left to traverse\n\t\tif (l1 == null && l2 != null) ans.next = l2;\n\t\tif (l2 == null && l1 != null) ans.next = l1;\n\t\treturn ans2;\n\t}",
"private ListNode recursiveMergeTwoRankedList(ListNode head5, ListNode head6) {\n\n if (head5 == null) {\n return head6;\n } else if (head6 == null) {\n return head5;\n }\n\n ListNode mergedHead = head5.val <= head6.val ? head5 : head6;\n\n if (head5.val <= head6.val) {\n mergedHead.next = recursiveMergeTwoRankedList(head5.next, head6);\n }else {\n mergedHead.next = recursiveMergeTwoRankedList(head5, head6.next);\n }\n\n return mergedHead;\n }",
"private static MyList Merge(MyList L1, MyList L2)\n\t{\n\t\t//however, one assumption is that the length of L1>L2, because of our mid algorithm\n\t\tMyList merged = new MyList(0);//its next is the resulting merged list\n\t\tMyList current = merged;//current points where we are at the time of merging\n\t\tint turn = 1;//we define a turn to know which list element to be merged per loop cycle\n\t\twhile(L1!=null && L2!=null)\n\t\t{\n\t\t\tif(turn==1)//pick from L1\n\t\t\t{\n\t\t\t\tcurrent.next = L1;\n\t\t\t\tL1 = L1.next;//update L1's index to right\n\t\t\t\tturn = 2;//next loop we pick from L2\n\t\t\t}\n\t\t\telse//pick from L2\n\t\t\t{\n\t\t\t\tcurrent.next = L2;\n\t\t\t\tL2 = L2.next;//update L1's index to right\n\t\t\t\tturn = 1;//back to L1 next cycle\n\t\t\t}\n\t\t\tcurrent = current.next;//update the current pointer\n\t\t}\n\t\t//as we said L1's length may be longer than L2 considering size of array\n\t\tif(L1!=null)//we merge the remaining L1 to our current.next\n\t\t\tcurrent.next = L1;\n\n\t\treturn merged.next;\n\t}",
"public static void main(String[] args) {\n\t\t\t\t\r\n\t\tListNode list1 =new ListNode(1, new ListNode(2, new ListNode(4, null)));\r\n\t\t\r\n\t\tListNode list2 =new ListNode(1, new ListNode(3, new ListNode(4, null)));\r\n\t\t\r\n\t\tListNode result = new MergeTwoSortedLists().mergeTwoLists(list1, list2);\r\n\t\t\r\n\t\twhile(result!=null) {\r\n\t\t\tSystem.out.print(\" \"+result.val);\r\n\t\t\tresult=result.next;\r\n\t\t}\r\n\t\t\r\n\t}",
"private static void merge(int[] num1, int[] num2) {\n\t\tint len = num1.length + num2.length;\n\n\t\tint[] temp = new int[len];\n\t\tint i = 0;\n\t\tint j = 0;\n\t\tint count = 0;\n\t\twhile (i < num1.length && j < num2.length) {\n\t\t\tif (num1[i] < num2[j]) {\n\t\t\t\ttemp[count++] = num1[i++];\n\t\t\t \n\t\t\t} else {\n\t\t\t\ttemp[count++] = num2[j++];\n\t\t\t \n\t\t\t}\n\t\t}\n\n\t\twhile (i < num1.length) {\n\t\t\ttemp[count++] = num1[i++];\n\t\t}\n\t\twhile (j < num2.length) {\n\t\t\ttemp[count++] = num2[j++];\n\t\t}\n\t\tfor (int ind = 0; ind < temp.length; ind++) {\n\t\t\tSystem.out.print(temp[ind] + \" \");\n\t\t}\n\t}",
"public void merge(SortedList<T> list2){\n while(!list2.isEmpty()){\n this.internalInsert(list2.removeFromFront());\n }\n\n this.sort();\n }",
"public static <V> ListNode<V> IntersectingNode (\n\t\tfinal ListNode<V> headNode1,\n\t\tfinal ListNode<V> headNode2)\n\t{\n\t\tListNode<V> node1 = headNode1;\n\t\tListNode<V> node2 = headNode2;\n\n\t\tjava.util.HashSet<ListNode<V>> nodeHashSet = new java.util.HashSet<ListNode<V>>();\n\n\t\twhile (null != node1) {\n\t\t\tif (nodeHashSet.contains (node1)) return node1;\n\n\t\t\tnodeHashSet.add (node1);\n\n\t\t\tnode1 = node1.next();\n\t\t}\n\n\t\twhile (null != node2) {\n\t\t\tif (nodeHashSet.contains (node2)) return node2;\n\n\t\t\tnode2 = node2.next();\n\t\t}\n\n\t\treturn null;\n\t}",
"private ListNode split2(ListNode head) {\n ListNode res = head.next;\n ListNode p1 = head;\n while (p1 != null) {\n ListNode p2 = p1.next;\n p1.next = p2.next;\n p1 = p1.next;\n if (p2.next != null) {\n p2.next = p1.next;\n }\n }\n return res;\n }",
"public static void reorder(ListNode head) {\n ListNode preHead = new ListNode(0), p1 = preHead, p2 = preHead;\n preHead.next = head;\n// head.print();\n// System.out.println(\"\");\n// System.out.println(\"--------\");\n\n while (p2 != null && p2.next != null) {\n p1 = p1.next;\n p2 = p2.next.next;\n }\n// System.out.println(\"p1: \" + p1.val);\n// p1 = p1.next;\n// head.print();\n// System.out.println();\n// System.out.println(\"secondHalfReversed\");\n ListNode secondHalfReversed = reverseList(p1.next); // even number is good\n p1.next = null;\n// head.print();\n// secondHalfReversed.print();\n\n mergeLists(head, secondHalfReversed);\n//\n// System.out.println(\"\");\n// System.out.println(\"printing head \");\n// head.print();\n\n }",
"public Node Merge(Node left, Node right) {\n// return super.Merge(left, right);\n w(\"left=\");\n Utils.PrintLinkList(left);\n Utils.PrintLinkList(right);\n Node emptyhead = new Node();\n Node cur = emptyhead;\n while (left != null || right != null) {\n if (right == null) {\n cur.next = left;\n left = left.next;\n break;\n } else if (left == null) {\n cur.next = right;\n right = right.next;\n break;\n }\n if (left.data <= right.data) {\n cur.next = left;\n left = left.next;\n } else {\n cur.next = right;\n right = right.next;\n }\n cur = cur.next;\n cur.next = null;\n }\n return emptyhead.next;\n }",
"public ListNode mergeTwoLists(ListNode a, ListNode b) {\r\n\t\tListNode merged = new ListNode(0);\r\n\r\n\t\tListNode first = a;\r\n\t\tListNode second = b;\r\n\t\tListNode third = merged;\r\n\r\n\t\twhile (first != null && second != null) {\r\n\t\t\tif (first.val <= second.val) {\r\n\t\t\t\tthird.next = first;\r\n\t\t\t\tfirst = first.next;\r\n\t\t\t} else {\r\n\t\t\t\tthird.next = second;\r\n\t\t\t\tsecond = second.next;\r\n\t\t\t}\r\n\t\t\tthird = third.next;\r\n\t\t}\r\n\r\n\t\tif (first != null) {\r\n\t\t\tthird.next = first;\r\n\t\t}\r\n\t\tif (second != null) {\r\n\t\t\tthird.next = second;\r\n\t\t}\r\n\r\n\t\treturn merged.next;\r\n\t}",
"public static void main(String[] args) {\n\t\tListNode node1 = new ListNode(5);\n node1.next = new ListNode(6);\n node1.next.next = new ListNode(7);\n\n ListNode node2 = new ListNode(5);\n node2.next = new ListNode(6);\n node2.next.next = new ListNode(7);\n\n ListNode result = new MergeTwoSortedLists().mergeTwoLists(node1, node2);\n\t}",
"public static void prefixMerge(Client [] list1, Client [] list2, Client[] result){\n int resultCount = 0;\n for (int i = 0; resultCount < result.length; i++) //goes through list1 up until the end of result\n {\n for (int j = 0; j < list2.length && resultCount < result.length; j++) //goes through list2 up until the end of list2\n {\n for (int k = 0; k < resultCount; k++) { //check if current element of list2 is already in result\n if (list2[j].compareClient(result[k]) == 0) { j++; } //without this there is an issue where the previous element of list1 is\n } //repeated in list2 but the current element of list1 is larger\n\n if (list2[j].compareClient(list1[i]) < 0) { //copies current element of list2 to result if it is smaller\n result[resultCount] = list2[j]; //than current element of list1\n resultCount++;\n }\n }\n if (resultCount < result.length) { //copies current element of list1 to result if there is room in result\n result[resultCount] = list1[i]; // needed if statement because of outOfBounds exception where all elements\n resultCount++; //in result were already filled by list2\n }\n }\n\n }",
"public static <T extends Comparable<? super T>> \n void union(SLL<T> list1, SLL<T> list2,\n SLL<T> result) {\n \n SLLNode<T> iterlist1 = list1.head;\n SLLNode<T> iterlist2 = list2.head;\n \n T itemlist1=null, itemlist2=null;\n \n // get first item in each list\n if ( iterlist1 != null )\n itemlist1 = iterlist1.info;\n if( iterlist2 != null )\n itemlist2 = iterlist2.info;\n \n while ( itemlist1 != null || itemlist2 != null ) {\n\n int compareResult;\n if( itemlist1 == null ) {\n compareResult = 1;\n } else if ( itemlist2 == null ) {\n compareResult = -1;\n } else {\n compareResult = itemlist1.compareTo(itemlist2);\n }\n \n if ( compareResult == 0 ) {\n result.addToTail(itemlist1); //appending to result list \n if( iterlist1.next != null ) {\n iterlist1 = iterlist1.next;\n itemlist1 = iterlist1.info;\n } else {\n itemlist1 = null;\n }\n \n if( iterlist2.next != null ) {\n iterlist2 = iterlist2.next;\n itemlist2 = iterlist2.info;\n } else {\n itemlist2 = null;\n } \n }\n else if ( compareResult < 0 ) { \n result.addToTail(itemlist1); //appending to result list\n if( iterlist1.next != null ) {\n iterlist1 = iterlist1.next;\n itemlist1 = iterlist1.info;\n } else {\n itemlist1 = null;\n }\n }\n else {\n result.addToTail(itemlist2);\n if( iterlist2.next != null ) {\n iterlist2 = iterlist2.next;\n itemlist2 = iterlist2.info;\n } else {\n itemlist2 = null;\n }\n }\n } \n }",
"private Entry<T> mergeSort(Entry<T> head,int n){\n if(n<2){\n head.next = null;\n return head;\n }\n Entry<T> mid = head;\n for(int i=0;i<n/2;i++)\n mid = mid.next;\n head = mergeSort(head, n/2);\n mid = mergeSort(mid, n - n/2);\n return merge(head,mid);\n }",
"public HuffmanNode merge(HuffmanNode node1, HuffmanNode node2){\n int combinedFrequency = node1.getFrequency() + node2.getFrequency();\n HuffmanNode combinedNode = new HuffmanNode(null, combinedFrequency);\n combinedNode.setLeft(node1);\n combinedNode.setRight(node2);\n return combinedNode;\n }",
"private static void mergeTables(Hashtable<? super String, Object> props1,\n Hashtable<? super String, Object> props2) {\n for (Object key : props2.keySet()) {\n String prop = (String) key;\n Object val1 = props1.get(prop);\n if (val1 == null) {\n props1.put(prop, props2.get(prop));\n } else if (isListProperty(prop)) {\n String val2 = (String) props2.get(prop);\n props1.put(prop, ((String) val1) + \":\" + val2);\n }\n }\n }",
"@Override\n protected DataSet<GraphHead> computeNewGraphHeads() {\n return firstCollection.getGraphHeads()\n .union(secondCollection.getGraphHeads())\n .groupBy(new Id<GraphHead>())\n .reduceGroup(new GroupCountEquals<GraphHead>(2));\n }",
"public static List<Integer> merge2(List<Integer> left, List<Integer> right) {\n ArrayList<Integer> result = new ArrayList<>();\n int leftIndex = 0;\n int rightIndex = 0;\n\n while (leftIndex < left.size() && rightIndex < right.size()) {\n if (left.get(leftIndex) < right.get(rightIndex)) {\n result.add(left.get(leftIndex));\n leftIndex++;\n } else {\n result.add(right.get(rightIndex));\n rightIndex++;\n }\n }\n List<Integer> leftRemaining = left.subList(leftIndex, left.size());\n List<Integer> rightRemaining = right.subList(rightIndex, right.size());\n\n result.addAll(leftRemaining);\n result.addAll(rightRemaining);\n\n return result;\n }",
"public static void main(String[] args) {\n MergeAlternateLinkedList linkedList=new MergeAlternateLinkedList();\n MergeAlternateLinkedList linkedList1=new MergeAlternateLinkedList();\n linkedList.push(2);\n linkedList.push(3);\n linkedList.push(4);\n System.out.println(\"First list-\");\n linkedList.printList();\n linkedList1.push(5);\n linkedList1.push(6);\n linkedList1.push(7);\n System.out.println(\"Second list-\");\n linkedList1.printList();\n //merge two linkedlist\n linkedList.mergeList(linkedList1);\n System.out.println(\"Print modified merge linked list 2\");\n linkedList1.printList();\n\n\n }",
"public static void prefixMerge(Client [] list1, Client [] list2,\n Client[] result){\n\n int listOneIndex = 0;\n int listTwoIndex = 0;\n for (int i = 0; i < result.length; i++){\n if (list1[listOneIndex].compareClient(list2[listTwoIndex]) < 0){\n result[i] = list1[listOneIndex];\n listOneIndex++;\n } else if (list1[listOneIndex].compareClient(list2[listTwoIndex]) > 0) {\n result[i] = list2[listTwoIndex];\n listTwoIndex++;\n } else {\n result[i] = list2[listTwoIndex];\n listTwoIndex++;\n listOneIndex++;\n }\n }\n }",
"public static void soo(Nodelink l1, Nodelink l2){\n Nodelink head = null;\n\n if (l1.data < l2.data) {\n head = l1;\n l1 = l1.next;\n }\n else {\n head = l2;\n l2 = l2.next;\n }\n Nodelink p = head;\n while (l1 != null && l2 != null){\n if (l1.data < l2.data)\n {\n p.next = l1;\n l1 = l1.next;\n }\n else\n {\n p.next = l2;\n l2 = l2.next;\n }\n\n p = p.next;\n }\n\n if (l1 == null)\n p.next = l2;\n if (l2 == null)\n p.next = l1;\n\n foo(head);\n\n\n\n }",
"private List<Integer> merge(List<Integer> firstList, List<Integer> secondList) {\n List<Integer> resultList = new ArrayList<>();\n\n if (firstList.size() == 1 && secondList.size() == 1) {\n resultList.add(Math.min(firstList.get(0), secondList.get(0)));\n resultList.add(Math.max(firstList.get(0), secondList.get(0)));\n return resultList;\n }\n\n int firstIndex = 0;\n int secondIndex = 0;\n\n while (firstIndex < firstList.size() && secondIndex < secondList.size()) {\n if (firstList.get(firstIndex) < secondList.get(secondIndex)) {\n resultList.add(firstList.get(firstIndex));\n firstIndex++;\n } else {\n resultList.add(secondList.get(secondIndex));\n secondIndex++;\n }\n }\n\n if (firstIndex < firstList.size()) {\n for (int i = firstIndex; i < firstList.size(); i++) {\n resultList.add(firstList.get(i));\n }\n }\n\n if (secondIndex < secondList.size()) {\n for (int i = secondIndex; i < secondList.size(); i++) {\n resultList.add(secondList.get(i));\n }\n }\n\n return resultList;\n }",
"Node[] merge(List<Node> nodeList1, List<Node> nodeList2, List<Node> exhaustedNodes);",
"public static void main(String[] args) {\n\t\t\t\n\t\tLinkedList<Integer> l1 = new LinkedList<Integer>();\n\t\tLinkedList<Integer> l2 = new LinkedList<Integer>();\n\t\tl1.add(34);\n\t\tl1.add(67);\n\t\tl2.add(89);\n\t\tl2.add(45);\n\t\tl1.addAll(l2);\n\t\tSystem.out.println(l1);\n\n }",
"public static MyLinkedList getUnion(MyLinkedList list1, MyLinkedList list2)\n {\n HashSet<Integer> set = new HashSet<>();\n\n Node temp = list1.getStart();\n while(temp != null)\n {\n set.add(temp.key);\n temp = temp.next;\n }\n\n temp = list2.getStart();\n while(temp != null)\n {\n set.add(temp.key);\n temp = temp.next;\n }\n\n MyLinkedList union = new MyLinkedList();\n for(int key : set)\n {\n union.addNode(new Node(key));\n }\n\n return union;\n }",
"void merge(T other);",
"public ListNode swapNodes(ListNode head, int v1, int v2) {\n ListNode start = new ListNode(0);\n start.next = head;\n ListNode preOne = null;\n ListNode preTwo = null;\n\n ListNode search = start;\n\n while (search.next != null) {\n ListNode next = search.next;\n if (next.val == v1) {\n preOne = search;\n }\n if (next.val == v2) {\n preTwo = search;\n }\n search = next;\n }\n if (preOne == null || preTwo == null) {\n return start.next;\n }\n\n\n ListNode one = preOne.next;\n ListNode two = preTwo.next;\n if (two.next == one) {\n preTwo.next = one;\n two.next = one.next;\n one.next = two;\n return start.next;\n } else if (one.next == two) {\n preOne.next = two;\n one.next = two.next;\n two.next = one;\n return start.next;\n }\n ListNode befone = preOne.next.next;\n ListNode beftwo = preTwo.next.next;\n one.next = beftwo;\n two.next = befone;\n preOne.next = two;\n preTwo.next = one;\n return start.next;\n }",
"public ListNode findMergePointIn_Time_Order_N_(ListNode list1,ListNode list2 ){\n\t\t\n\t\tif(list1==null || list2==null)\n\t\t\treturn null;\n//\t\telse if((list1!=null && list1.next==null) && (list2!=null && list2.next==null) && (list1.val==list2.val) )) {\n//\t\t return list1;\n//\t\t}\t\n//\t\n\t\telse{\n\t\t\tint length1=0,length2=0,diff = 0;\n\t\t\tListNode head1 =list1;\n\t\t\tListNode head2 = list2;\n\t\t\twhile(head1!=null){\n\t\t\t\tlength1++;\n\t\t\t\thead1=head1.getNextNode();\n\t\t\t}\n\t\t\twhile(head2!=null){\n\t\t\t\tlength1++;\n\t\t\t\thead2=head2.getNextNode();\n\t\t\t}\n\t\t\tif(length1<length2){\n\t\t\t\thead1=list2;//bigger list in h1\n\t\t\t\thead2=list1;//smaller in h2\n\t\t\t\tdiff= length2-length1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\thead1=list1;//bigger list in h1\n\t\t\t\thead2=list2;//smaller list in h2\n\t\t\t\tdiff= length2-length1;\n\t\t\t}\n\t\t\tint pos =0;\n\t\t\twhile(pos<diff){ //till we are at (diff+1) position in larger list \n\t\t\t\thead1=head1.getNextNode();\n\t\t\t\tpos++;\n\t\t\t}\n\t\t\twhile(head1!=null && head2!=null){//increase till end of link list \n\t\t\t\tif(head1==head2){\n\t\t\t\t\treturn head1;\n\t\t\t\t}\n\t\t\t\thead1=head1.getNextNode();\n\t\t\t\thead2=head2.getNextNode();\n\t\t\t}\n\t\t\treturn head1.getNextNode();\n\t\t}\n\t}",
"private static void mergingSync() {\n Observable.merge(getDataSync(1), getDataSync(2)).blockingForEach(System.out::println);\n }",
"public ListNode mergeNodesV3(ListNode head) {\n /**\n * this step is very important.\n * head point at the first non-zero node.\n */\n head = head.next;\n ListNode start = head;\n while (start != null) {\n ListNode end = start;\n int sum = 0;\n while (end.val != 0) {\n sum += end.val;\n end = end.next;\n }\n if (sum > 0) {\n start.val = sum;\n start.next = end.next;\n start = start.next;\n }\n }\n return head;\n }",
"public static Node merge(Node a, Node b)\n {\n // Base cases\n if (a == null) {\n return b;\n }\n\n if (b == null) {\n return a;\n }\n\n // Pick either a or b, and recur\n if (a.data.getEmp_No() <= b.data.getEmp_No())\n {\n a.next = merge(a.next, b);\n a.next.prev = a;\n a.prev = null;\n return a;\n }\n else\n {\n b.next = merge(a, b.next);\n b.next.prev = b;\n b.prev = null;\n return b;\n }\n }",
"public void reorderList(ListNode head) {\n if (head == null) {\n return;\n } else if (head.next == null) {\n return;\n }\n \n ListNode pre = findMidPre(head);\n \n // cut the two list.\n ListNode right = pre.next;\n pre.next = null;\n \n // reverse the right link.\n right = reverse(right);\n \n merge(head, right);\n }",
"public void merge(List<Integer> a, List<Integer> l, List<Integer> r, int left, int right) \n {\n \n int i = 0, j = 0, k = 0;\n while (i < left && j < right) \n {\n if (l.get(i) < r.get(j)) \n {\n a.add(k++, l.get(i++));\n a.remove(k);\n }\n else \n {\n a.add(k++, r.get(j++));\n a.remove(k);\n }\n }\n \n while (i < left) \n {\n a.add(k++, l.get(i++));\n a.remove(k);\n }\n while (j < right) \n {\n a.add(k++, r.get(j++));\n a.remove(k);\n }\n }",
"private void merge(int[] left, int[] right, int[] a) {\n\t\t// i - left\n\t\t// j - right\n\t\t// k - original\n\t\tint i = 0, j = 0, k = 0;\n\t\tint sL = left.length;\n\t\tint sR = right.length;\n\n\t\twhile (i < sL && j < sR) {\n\t\t\tif (left[i] < right[j]) {\n\t\t\t\ta[k] = left[i];\n\t\t\t\ti++;\n\t\t\t} else {\n\t\t\t\ta[k] = right[j];\n\t\t\t\tj++;\n\t\t\t}\n\t\t\tk++;\n\t\t}\n\n\t\twhile (i < sL) {\n\t\t\ta[k] = left[i];\n\t\t\tk++;\n\t\t\ti++;\n\t\t}\n\t\twhile (j < sR) {\n\t\t\ta[k] = right[j];\n\t\t\tk++;\n\t\t\tj++;\n\t\t}\n\t}",
"public void swapNodes(int data1, int data2) {\n\t\tif(head == null || size == 1) {\n\t\t\tSystem.out.println(\"List is empty or only one node present!!\");\n\t\t\treturn;\n\t\t}\n\t\tNode node1 = null;\n\t\tNode node1Prev = null;\n\t\tNode node2 = null;\n\t\tNode node2Prev = null;\n\t\tNode start = head;\n\t\tif(start.data == data1) {\n\t\t\tnode1Prev = null;\n\t\t\tnode1 = start;\n\t\t}\n\t\tif(start.data == data2) {\n\t\t\tnode2Prev = null;\n\t\t\tnode2 = start;\n\t\t}\n\t\twhile(start.next != null) {\n\t\t\tif(start.next.data == data1) {\n\t\t\t\tnode1Prev = start;\n\t\t\t\tnode1 = start.next;\n\t\t\t}\n\t\t\tif(start.next.data == data2) {\n\t\t\t\tnode2Prev = start;\n\t\t\t\tnode2 = start.next;\n\t\t\t}\n\t\t\tstart = start.next;\n\t\t}\n\n\t\tif(node1 != null && node2 != null) {\n\t\t\tif(node1Prev == null) {\n\t\t\t\thead = node2;\n\t\t\t}\n\t\t\tif(node2Prev == null) {\n\t\t\t\thead = node1;\n\t\t\t}\n\t\t\tNode tempNext = node2.next;\n\t\t\tif(node1Prev != null)\n\t\t\t\tnode1Prev.next = node2;\n\t\t\tnode2.next = node1.next;\n\n\t\t\tif(node2Prev != null)\n\t\t\t\tnode2Prev.next = node1;\n\t\t\tnode1.next = tempNext;\n\t\t}\n\t}",
"public ListNode mergeKLists(ListNode[] lists) {\n LinkedList<Integer> a= new LinkedList<Integer>();\n \n for(int i=0;i<lists.length;i++) {\n ListNode temp = lists[i];\n \n while(temp!=null) {\n // System.out.println(temp.val);\n a.add(temp.val);\n temp=temp.next;\n }\n }\n Collections.sort(a);\n //copy all the elements into ListNode linked list.\n if(a.size()==0) { return null; }\n ListNode head = new ListNode(a.get(0));\n ListNode res = head;\n if(head== null) {\n head = new ListNode(a.get(0));\n }\n for(int j=1;j<a.size();j++) {\n \n res.next = new ListNode(a.get(j));\n res=res.next;\n \n }\n res=head;\n \n return res;\n \n \n \n \n }",
"private static int[] merge( int[] a, int[] b )\n {\n int[] retList = new int[a.length + b.length];\n\t int aPos = 0, bPos = 0;\n\t for(int x = 0; x < retList.length; x ++) {\n\t\t if(aPos < a.length && bPos < b.length) {\n\t\t\t if(a[aPos] < b[bPos]) {\n\t\t\t\t retList[x] = a[aPos];\n\t\t\t\t aPos ++;\n\t\t\t }\n\t\t\t else {\n\t\t\t\t retList[x] = b[bPos];\n\t\t\t\t bPos ++;\n\t\t\t }\n\t\t }\n\t\t else if(aPos < a.length) {\n\t\t\t retList[x] = a[aPos];\n\t\t\t aPos ++;\n\t\t }\n\t\t else {\n\t\t\t retList[x] = b[bPos];\n\t\t\t bPos ++;\n\t\t }\n\t }\n return retList;\n }",
"public ListNode getIntersectionNode(ListNode headA, ListNode headB) {\n \n ListNode first = headA;\n ListNode second = headB;\n \n //iterate till both pointer point to null\n while(first != null || second != null){\n if(first == null)\n headB = headB.next;\n else\n first = first.next;\n \n if(second == null)\n headA= headA.next;\n else\n second = second.next;\n } \n while(headA != headB){\n headB = headB.next;\n headA= headA.next;\n }\n \n return headA;\n }",
"private SeqIter addSortedServer(final SeqIter it1, final SeqIter it2) {\r\n if(it1 == null && it2 != null) return it2;\r\n if(it2 == null && it1 != null) return it1;\r\n \r\n final SeqIter tmp = new SeqIter();\r\n Item i1 = it1.next(), i2 = it2.next();\r\n while(i1 != null && i2 != null) {\r\n if(i1.score < i2.score) {\r\n tmp.add(i2);\r\n i2 = it2.next();\r\n } else if(i1.score > i2.score) {\r\n tmp.add(i1);\r\n i1 = it1.next();\r\n } else {\r\n tmp.add(i2);\r\n i1 = it1.next();\r\n i2 = it2.next();\r\n }\r\n \r\n }\r\n while((i1 = it1.next()) != null) tmp.add(i1);\r\n while((i2 = it2.next()) != null) tmp.add(i2);\r\n return tmp;\r\n }",
"public static Iterator<Integer> mergeSortedIterators(Iterator<Integer> left, Iterator<Integer> right) {\n return\n }",
"public int[] merge(int[] ls, int[] rs) {\n\t int[] result = new int[ls.length + rs.length];\r\n\r\n\t int i, l, r;\r\n\t i = l = r = 0;\r\n\t while (i < result.length) {\r\n\t if (l < ls.length && r < rs.length) {\r\n\t if (ls[l] < rs[r]) {\r\n\t result[i] = ls[l];\r\n\t ++i;\r\n\t ++l;\r\n\t } else {\r\n\t result[i] = rs[r];\r\n\t ++i;\r\n\t ++r;\r\n\t }\r\n\t } else if (l >= ls.length) {\r\n\t while (r < rs.length) {\r\n\t result[i] = rs[r];\r\n\t ++i;\r\n\t ++r;\r\n\t }\r\n\t } else if (r >= rs.length) {\r\n\t while (l < ls.length) {\r\n\t result[i] = ls[l];\r\n\t ++i;\r\n\t ++l;\r\n\t }\r\n\t }\r\n\t }\r\n\t return result;\r\n\t }",
"public static int[] mergeSortDistinct(int[] src1, int[] src2) {\n\n int[] marged = new int[src1.length + src2.length];\n\n System.arraycopy(src1, 0, marged, 0, src1.length);\n System.arraycopy(src2, 0, marged, src1.length, src2.length);\n\n return sortDistinct(marged);\n }",
"static int[] merge(int[] a, int[] b) {\n\t\tint m = a.length, n = b.length;\n\t\tint[] res = new int[m + n];\n\t\tint i = 0, j = 0, k = 0;\n\t\twhile (i < m || j < n) {\n\t\t\tif (i == m)\n\t\t\t\tres[k++] = b[j++];\n\t\t\telse if (j == n)\n\t\t\t\tres[k++] = a[i++];\n\t\t\telse if (a[i] < b[j])\n\t\t\t\tres[k++] = a[i++];\n\t\t\telse\n\t\t\t\tres[k++] = b[j++];\n\t\t}\n\t\treturn res;\n\t}",
"@Override\n protected BackendEntry mergeEntries(BackendEntry e1, BackendEntry e2) {\n\n UltraSearchBackendEntry current = (UltraSearchBackendEntry) e1;\n UltraSearchBackendEntry next = (UltraSearchBackendEntry) e2;\n\n E.checkState(current == null || current.type().isVertex(),\n \"The current entry must be null or VERTEX\");\n E.checkState(next != null && next.type().isEdge(),\n \"The next entry must be EDGE\");\n\n if (current != null) {\n Id nextVertexId = IdGenerator.of(\n next.<String>column(HugeKeys.OWNER_VERTEX));\n if (current.id().equals(nextVertexId)) {\n current.subRow(next.row());\n return current;\n }\n }\n\n return this.wrapByVertex(next);\n }",
"public void reorderList(ListNode head) {\n if (head == null || head.next == null)\n return;\n\n // step 1. cut the list to two halves\n // prev will be the tail of 1st half\n // slow will be the head of 2nd half\n ListNode prev = null, slow = head, fast = head, l1 = head;\n while (fast != null && fast.next != null) {\n prev = slow;\n slow = slow.next;\n fast = fast.next.next;\n }\n prev.next = null;\n // step 2. reverse the 2nd half\n ListNode l2 = reverse(slow);\n // step 3. merge the two halves\n merge(l1, l2);\n }",
"public static void main(String[] args) {\n\r\n\t\tLinkedListNode n1 = new LinkedListNode(3);\r\n\t\tLinkedListNode n2 = new LinkedListNode(5);\r\n\t\tLinkedListNode n3 = new LinkedListNode(7);\r\n\t\tLinkedListNode n4 = new LinkedListNode(9);\r\n\t\tLinkedListNode n5 = new LinkedListNode(11);\r\n\t\tn1.next=n2;\r\n\t\tn2.next=n3;\r\n\t\tn3.next=n4;\r\n\t\tn4.next=n5;\r\n\t\t\r\n\t\tLinkedListNode n6 = new LinkedListNode(1);\r\n\t\tLinkedListNode n7 = new LinkedListNode(2);\r\n\t\tLinkedListNode n8 = new LinkedListNode(4);\r\n\t\tLinkedListNode n9 = new LinkedListNode(6);\r\n\t\tLinkedListNode n10 = new LinkedListNode(8);\r\n\t\tn6.next=n7;\r\n\t\tn7.next=n8;\r\n\t\tn8.next=n9;\r\n\t\tn9.next=n10;\r\n\t\tif(n1.data < n6.data){\r\n\t\tn1 = merge(n1,n6);\r\n\t\tprint(n1);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tn6 = merge(n6,n1);\r\n\t\t\tprint(n6);\r\n\t\t}\r\n\t}",
"static public Node[] createAlternateSplits(Node head, Node[] heads){ //TC: O(n), SC: O(1)\r\n if(!(head == null) || !(head.next == null)){ //we cannot create a split with one node or with an empty list\r\n heads[0] = head;\r\n heads[1] = head.next;\r\n Node p = head, temp;\r\n while(p != null){\r\n temp = p.next;\r\n p.next = (temp != null)? temp.next:temp;\r\n p = temp;\r\n }\r\n }\r\n \r\n return heads;\r\n \r\n }",
"public static Deque<Integer> merge(Deque<Integer> d1, Deque<Integer> d2) {\n int size1=d1.getSize();\n int size2=d2.getSize();\n LinkedListDeque<Integer> deque=new LinkedListDeque();\n\n int count1 =0, count2=0;\n \n int length = size1+size2;\n \n \n \n int temp1=0;\n int temp2=0;\n \n \n \n for(int i=0; i<length; i++){\n \n try {\n temp1 = d1.popFromFront();\n } catch (Exception ex) {\n System.out.println(ex.getMessage());\n }\n \n try {\n temp2 = d2.popFromFront();\n } catch (Exception ex) {\n System.out.println(ex.getMessage());\n }\n \n if(count1==size1){\n deque.pushToBack(temp2);\n count2++;\n }else if(count2 == size2){\n deque.pushToBack(temp1);\n count1++;\n }\n else if(temp1<temp2){\n deque.pushToBack(temp1);\n count1++;\n d2.pushToFront(temp2);\n } else{\n deque.pushToBack(temp2);\n d1.pushToFront(temp1);\n count2++; \n }\n \n }\n \n \n\nreturn deque;\n}",
"protected void merge(Object in1, Object in2, Object out) {\n\t\tFlowSet inSet1 = (FlowSet) in1, inSet2 = (FlowSet) in2, outSet = (FlowSet) out;\n\n\t\tinSet1.intersection(inSet2, outSet);\n\t}",
"public static LinkedQueue<Object> merge(LinkedQueue<Object> q1, LinkedQueue<Object> q2) {\n if (q1.size() == 0) {\n return q2;\n } else if (q2.size() == 0) {\n return q1;\n }\n\n LinkedQueue<Object> mergeQueue = new LinkedQueue<>();\n int i = 0;\n int j = 0;\n int size1 = q1.size();\n int size2 = q2.size();\n\n while (i < size1 && j < size2) {\n int flag = q1.peek().toString().compareTo(q2.peek().toString());\n if (flag < 0) {\n mergeQueue.enqueue(q1.dequeue());\n i++;\n } else {\n mergeQueue.enqueue(q2.dequeue());\n j++;\n }\n }\n\n while (i < size1) {\n mergeQueue.enqueue(q1.dequeue());\n i++;\n }\n while (j < size2) {\n mergeQueue.enqueue(q2.dequeue());\n j++;\n }\n\n return mergeQueue;\n }",
"private static List<WayNodeOSM> concatMetanodes(List<WayNodeOSM>metaNodes1, List<WayNodeOSM>metaNodes2, long duplicateNode) {\n \t\t// turn the lists the right way round\n \t\tif ( metaNodes1.get(0).getID() == duplicateNode){\n \t\t\tCollections.reverse(metaNodes1);\n \t\t}\n \t\tif (!( metaNodes2.get(0).getID() == duplicateNode)) {\n \t\t\tCollections.reverse(metaNodes2);\n \t\t}\n \t\t// remove the duplicate, then concat\n \t\tmetaNodes1.remove(metaNodes1.size() - 1);\n \t\tmetaNodes1.addAll(metaNodes2);\n \t\treturn metaNodes1;\n \t}",
"public static void merge (int[] result, int[] a1, int[] a2) {\r\n\t\tint len1 = a1.length;\r\n\t\tint len2 = a2.length;\r\n\t\t\r\n\t\tint i = 0;\r\n\t\tint j = 0;\r\n\t\tint k = 0;\r\n\t\t\r\n\t\twhile (i < len1 && j < len2) {\r\n\t\t\tif (a1[i] < a2[j]) {\r\n\t\t\t\tresult[k] = a1[i];\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tresult[k] = a2[j];\r\n\t\t\t\tj++;\r\n\t\t\t}\r\n\t\t\tk++;\r\n\t\t}\r\n\t\twhile (i < len1) {\r\n\t\t\tresult[k] = a1[i];\r\n\t\t\ti++;\r\n\t\t\tk++;\r\n\t\t}\r\n\t\twhile (j < len2) {\r\n\t\t\tresult[k] = a2[j];\r\n\t\t\tj++;\r\n\t\t\tk++;\r\n\t\t}\r\n\t}",
"public Object merge(Object obj) throws HibException;"
] | [
"0.7095442",
"0.674513",
"0.6496281",
"0.6494682",
"0.6434286",
"0.6382796",
"0.6354457",
"0.63539654",
"0.632957",
"0.6320961",
"0.6296411",
"0.62936336",
"0.6283213",
"0.62590283",
"0.6230766",
"0.62235135",
"0.6218477",
"0.62012184",
"0.61825794",
"0.6160689",
"0.61547244",
"0.6133929",
"0.6131943",
"0.6103965",
"0.6071663",
"0.6047896",
"0.60360646",
"0.6032972",
"0.6020974",
"0.5988019",
"0.59858334",
"0.5972168",
"0.5970217",
"0.59613127",
"0.5930124",
"0.592086",
"0.59088284",
"0.5895975",
"0.58930105",
"0.58901834",
"0.5888836",
"0.58858263",
"0.58403397",
"0.58394337",
"0.58246124",
"0.5815175",
"0.58013546",
"0.5781571",
"0.57585263",
"0.5752186",
"0.5728097",
"0.5715223",
"0.57043546",
"0.5680832",
"0.56634235",
"0.5635319",
"0.5624766",
"0.5616498",
"0.5596968",
"0.5588853",
"0.55255914",
"0.5501155",
"0.54804176",
"0.5477845",
"0.547377",
"0.5466333",
"0.54646575",
"0.54600656",
"0.54221517",
"0.54200304",
"0.5416221",
"0.5416161",
"0.5397672",
"0.53925407",
"0.53841937",
"0.53821594",
"0.5379978",
"0.5351063",
"0.5347375",
"0.53419864",
"0.53274214",
"0.53267705",
"0.5310452",
"0.53001773",
"0.5283515",
"0.52713937",
"0.5271057",
"0.5269079",
"0.5261134",
"0.52581316",
"0.5256586",
"0.52537215",
"0.52489454",
"0.52285177",
"0.5220155",
"0.52111316",
"0.5208816",
"0.5206826",
"0.51939476",
"0.51938254"
] | 0.76878285 | 0 |
Instantiation of Squad A | public static void main(String[] args) {
Wizard wizard1 = new Wizard();
Wizard wizard2 = new Wizard();
Ninja ninja1 = new Ninja();
Ninja ninja2 = new Ninja();
// Instantiation of Squad B
Ninja ninja3 = new Ninja();
Wizard wizard3 = new Wizard();
Samurai samurai1 = new Samurai();
// Attack Activity
System.out.println("---------------Attack Activity----------------------");
wizard1.attack(ninja3);
wizard3.attack(ninja1);
ninja3.steal(wizard1);
ninja3.steal(wizard1);
ninja3.runAway();
wizard2.heal(wizard1);
wizard2.heal(ninja1);
ninja3.attack(wizard2);
wizard2.fireball(ninja3);
ninja1.steal(ninja3);
samurai1.deathBlow(ninja2);
wizard1.fireball(samurai1);
samurai1.meditate();
samurai1.meditate();
samurai1.deathBlow(wizard1);
// Health Status Update
System.out.println("----------------Squad A: Health Status Update---------------------");
System.out.println("Wizard1 health is: " + wizard1.getHealth());
System.out.println("Wizard2 health is: " + wizard2.getHealth());
System.out.println("Ninja1 health is: " + ninja1.getHealth());
System.out.println("Ninja2 health is: " + ninja2.getHealth());
System.out.println("----------------Squad B: Health Status Update---------------------");
System.out.println("Wizard3 health is: " + wizard3.getHealth());
System.out.println("Ninja3 health is: " + ninja3.getHealth());
System.out.println("Samurai1 health is: " + samurai1.getHealth());
// Number of Players Left
System.out.println("----------------Number Player Update---------------------");
wizard1.getHowMany();
ninja1.getHowMany();
samurai1.getHowMany();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Aso() {\n\t\tName = \"Aso\";\n\t\ttartossag = 3;\n\t}",
"public Aliases( ) {\n\t}",
"public Ads() {\n }",
"public Aanbieder() {\r\n\t\t}",
"public Sku() {\n\t}",
"public void displaySquad(Squad squad);",
"public DsaQ()\n\t{\n\t q = new DSAlinkedL();\n\t}",
"public SbiDomains() {\n }",
"public QuadCurve () {\n }",
"public ArbolSplay() {\n super();\n }",
"public Achterbahn() {\n }",
"public Aritmetica(){ }",
"public QaStep() {\n\t}",
"protected Asignatura()\r\n\t{}",
"public GoogleApiA() {}",
"public ARecord() {\n super(A.A);\n }",
"public Student(String in_name, double in_gpa)\n {\n name = in_name;\n gpa = in_gpa;\n getQuizzes();\n }",
"public DeptAwardsTransAMImpl() {\n }",
"public Skill() {\n\t\tsuper();\n\t}",
"public A3Add(){}",
"public ParkingSpace() {}",
"public Alojamiento() {\r\n\t}",
"public SAP(Digraph G) {this.G = new Digraph(G);}",
"public void instantiate(Substitution s, List<Sensor> a) {\r\n hook = CalendarPlanner.instance().plan(\r\n time + (long) (2 * Math.random() * inaccuracy) - inaccuracy);\r\n hook.registerListener(this);\r\n }",
"public Salle() {\n\t\tsuper();\n\t\t// TODO Auto-generated constructor stub\n\t}",
"Reproducible newInstance();",
"public SgaexpedbultoImpl()\n {\n }",
"public ASLocation()\n\t{\n\t\tsuper() ;\n\t\tprepare() ;\n\t}",
"public Trade() {\n\t}",
"public TutorIndustrial() {}",
"public Equipas() {\r\n\t\t\r\n\t}",
"public aed(World paramaqu, double paramDouble1, double paramDouble2, double paramDouble3)\r\n/* 14: */ {\r\n/* 15: 28 */ super(paramaqu, paramDouble1, paramDouble2, paramDouble3);\r\n/* 16: */ }",
"public SavingsAccount() {\n\t}",
"public Webinar() {\n\t\t\n\t}",
"public AnalysisDef() {}",
"public Championship() {\n }",
"public SapFactoryImpl() {\n super();\n }",
"public Party() {\n // empty constructor\n }",
"private Instantiation(){}",
"public QLearnAgent() {\n\t\tthis(name);\t\n\t}",
"public Simulador(){\n }",
"public Gasto() {\r\n\t}",
"ASAFactory getASAFactory();",
"public QuadGramMap()\n\t{\n\t\tsuper();\n\t}",
"public SAP(Digraph G){\n if(G == null)\n throw new NullPointerException(\"null arguments\");\n this.G=G;\n }",
"public Sad() {\n }",
"public CampLease( ) {}",
"public ArrivalQuayStub() {\n\t}",
"public SIASES() {\n\t\tsuper();\n\n\t\tm_iChunkSize = 10;\n\t\tm_sLastUser = EMPTY_STR;\n\t\tm_sLastGroup = EMPTY_STR;\n\t\tm_bIsDriverLoaded = false;\n\t\tit = null;\n\n\t\tif (isDebug == true) {\n\t\t\tlog.debug(\"Construtor: <valor m_iChunkSize: \" + m_iChunkSize\n\t\t\t\t\t+ \"> <valor m_sLastUser: \" + m_sLastUser\n\t\t\t\t\t+ \"> <m_sLastGroup: \" + m_sLastGroup);\n\t\t}\n\n\t}",
"public AS2EnvelopeSettings() {\n }",
"public aqo(World paramaqu, Entity paramwv, double paramDouble1, double paramDouble2, double paramDouble3, float paramFloat, List<BlockPosition> paramList)\r\n/* 26: */ {\r\n/* 27: 44 */ this(paramaqu, paramwv, paramDouble1, paramDouble2, paramDouble3, paramFloat, false, true, paramList);\r\n/* 28: */ }",
"public Transportista() {\n }",
"private void __sep__Constructors__() {}",
"public CyanSus() {\n\n }",
"public SlanjePoruke() {\n }",
"public Asiento() {\n\t\tthis(\"asiento\", null);\n\t}",
"public Steganography() {}",
"public Stamp()\n {\n // initialise instance variables\n id = genID();\n name = defaultname();\n rarity = 'u';\n value = 0.00; \n }",
"public SQueue(){\n\n\t}",
"public Almacen(){}",
"public AirAndPollen() {\n\n\t}",
"Schulleiter createSchulleiter();",
"public Corrida(){\n\n }",
"public AntrianPasien() {\r\n\r\n }",
"public AirlineCompany() {\n\t}",
"public SysSkillConferpo()\n {\n }",
"public AdsManager()\n\t{\n\t\t\n\t}",
"public Espai(){}",
"public Lanceur() {\n\t}",
"private ATCres() {\r\n // prevent to instantiate this class\r\n }",
"public AdAmazon(com.google.appinventor.components.runtime.ComponentContainer r9) {\n /*\n r8 = this;\n r0 = r8\n r1 = r9\n r2 = r0\n r3 = r1\n r2.<init>(r3)\n r2 = r0\n r3 = 1\n r2.f542hxYOFxFjLpN1maJuWNxUV40nExCGxsxkDPOTgtzMu4zlZCQb3bPlKsXo1SYJg6ME = r3\n r2 = r0\n java.lang.String r3 = \"AdAmazon\"\n r2.TAG = r3\n r2 = r0\n java.lang.String r3 = \"AmazonPublisherId\"\n r2.KbzcIEn6WDqjdY1QBot1TMrBwhEYy4xAUKG2cbzQ22VNohlOtuBGKUJsEeMNZyEH = r3\n r2 = r0\n android.os.Handler r3 = new android.os.Handler\n r7 = r3\n r3 = r7\n r4 = r7\n r4.<init>()\n r2.androidUIHandler = r3\n r2 = r0\n r3 = 0\n r2.havePermission = r3\n r2 = r0\n r3 = 1\n r2.B8WBXPBCF2jGfUDZZU2zV5EYdqbUBu0lAZ0THCEqYyuE8VACR9dY7rDnwBIqh64T = r3\n r2 = r0\n r3 = r1\n com.google.appinventor.components.runtime.Form r3 = r3.$form()\n r2.form = r3\n r2 = r0\n com.amazon.device.ads.AdLayout r3 = new com.amazon.device.ads.AdLayout\n r7 = r3\n r3 = r7\n r4 = r7\n r5 = r1\n android.app.Activity r5 = r5.$context()\n com.amazon.device.ads.AdSize r6 = com.amazon.device.ads.AdSize.SIZE_320x50\n r4.<init>(r5, r6)\n r2.hxYOFxFjLpN1maJuWNxUV40nExCGxsxkDPOTgtzMu4zlZCQb3bPlKsXo1SYJg6ME = r3\n r2 = r0\n com.amazon.device.ads.AdLayout r2 = r2.hxYOFxFjLpN1maJuWNxUV40nExCGxsxkDPOTgtzMu4zlZCQb3bPlKsXo1SYJg6ME\n android.widget.LinearLayout$LayoutParams r3 = new android.widget.LinearLayout$LayoutParams\n r7 = r3\n r3 = r7\n r4 = r7\n r5 = -1\n r6 = -2\n r4.<init>(r5, r6)\n r2.setLayoutParams(r3)\n r2 = r1\n r3 = r0\n r2.$add(r3)\n r2 = r0\n com.amazon.device.ads.AdLayout r2 = r2.hxYOFxFjLpN1maJuWNxUV40nExCGxsxkDPOTgtzMu4zlZCQb3bPlKsXo1SYJg6ME\n r3 = r0\n r2.setListener(r3)\n r2 = r0\n r3 = 1\n r2.TestMode(r3)\n r2 = r0\n r3 = 1\n r2.RefreshAd(r3)\n r2 = r0\n com.google.appinventor.components.runtime.util.KodularContentProtection r3 = new com.google.appinventor.components.runtime.util.KodularContentProtection\n r7 = r3\n r3 = r7\n r4 = r7\n r5 = r1\n android.app.Activity r5 = r5.$context()\n r4.<init>(r5)\n r2.kodularContentProtection = r3\n r2 = r0\n com.google.appinventor.components.runtime.util.KodularContentProtection r2 = r2.kodularContentProtection\n com.google.appinventor.components.runtime.AdAmazon$1 r3 = new com.google.appinventor.components.runtime.AdAmazon$1\n r7 = r3\n r3 = r7\n r4 = r7\n r5 = r0\n r4.<init>(r5)\n r2.setOnValidationResultListener(r3)\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.appinventor.components.runtime.AdAmazon.<init>(com.google.appinventor.components.runtime.ComponentContainer):void\");\n }",
"public Clade() {}",
"public LineStroker() {\n }",
"public TTau() {}",
"public Professor()\n\t{\n\t\t//stuff\n\t}",
"public ChaCha()\n\t{\n\t\tsuper();\n\t}",
"public Apartment(char apartmentType, Room room1, Room room2, Room room3) {\n this.apartmentType = apartmentType;\n this.room1 = room1;\n this.room2 = room2;\n this.room3 = room3;\n }",
"public SalesRecord() {\n super(Sales.SALES);\n }",
"public Scania() {\n\n super(2, 600, Color.white, \"Scania\", 13000);\n truckBed = new Ramp();\n }",
"private Arena() {}",
"public Aktie() {\n }",
"public NEATTranscriberBain() {\n\t}",
"public DetArqueoRunt () {\r\n\r\n }",
"public PSRelation()\n {\n }",
"public ActiveSurveyQuestionItem() {\n }",
"public TebakNusantara()\n {\n }",
"public Tarifa() {\n ;\n }",
"public DcSquadDO loadByName(String squadName) throws DataAccessException;",
"private Aspirations() {}",
"public Sandwich()\n\t{super();\n \n\t\t\n\t}",
"public DomainKnowledge() {\r\n\t\tthis.construct(3);\r\n\t}",
"public Strawberries() {\r\n\t\tsuper(price, nutrition, name);\r\n\t}",
"public Produto() {}",
"public Army(int i,String a){\n\t\tswitch(a){\n\t\t\tcase(\"Soldier\"):\t\t\n\t\t\t\tfor(int n=0;n<i;n++)\n\t\t\t\t\tarmy.add(new Soldier());\n\t\t\t\tbreak;\n\t\t\tcase(\"Goblin\"):\n\t\t\t\tfor(int n=0;n<i;n++)\n\t\t\t\t\tarmy.add(new Goblin());\n\t\t\t\tbreak;\n\t\t\tcase(\"Orc\"):\n\t\t\t\tfor(int n=0;n<i;n++)\n\t\t\t\t\tarmy.add(new Orc());\n\t\t\t\tbreak;\n\t\t\tcase(\"Ogre\"):\n\t\t\t\tfor(int n=0;n<i;n++)\n\t\t\t\t\tarmy.add(new Ogre());\n\t\t\t\tbreak;\n\t\t\tcase(\"Greenskins\"):\n\t\t\t\tfor(int n=0;n<5;n++)\n\t\t\t\t\tarmy.add(new Ogre());\n\t\t\t\tfor(int n=0;n<20;n++)\n\t\t\t\t\tarmy.add(new Orc());\n\t\t\t\tfor(int n=0;n<75;n++)\n\t\t\t\t\tarmy.add(new Goblin());\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tfor(int n=0;n<i;n++)\n\t\t\t\t\tarmy.add(new Soldier());\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public Purp() {\n }",
"public ADSR()\n\t{\n\t\tthis(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f);\n\t}",
"public Analysis() {\n this(\"analysis\", null);\n }",
"public Surgeon() {\n }",
"public Qs(String alias) {\n this(alias, QS);\n }",
"SpaceInvaderTest_initialisation createSpaceInvaderTest_initialisation();",
"public Ship(){\n\t}"
] | [
"0.58838767",
"0.5830699",
"0.5809864",
"0.57707494",
"0.57599807",
"0.5733765",
"0.5691116",
"0.5671162",
"0.5610218",
"0.5588411",
"0.5557728",
"0.5498281",
"0.54652286",
"0.54499936",
"0.544224",
"0.5433005",
"0.54302096",
"0.5422163",
"0.54152656",
"0.54036736",
"0.54005945",
"0.5391889",
"0.5389739",
"0.53802615",
"0.5366015",
"0.5347345",
"0.5347136",
"0.5318893",
"0.5305481",
"0.52917427",
"0.52831995",
"0.52696717",
"0.5269332",
"0.5260819",
"0.5241599",
"0.5240311",
"0.52380013",
"0.5233783",
"0.522539",
"0.52049106",
"0.5201094",
"0.52008945",
"0.51749825",
"0.5170517",
"0.51699114",
"0.5169011",
"0.51680064",
"0.5162616",
"0.51602006",
"0.5159054",
"0.5159001",
"0.5149261",
"0.51487434",
"0.51468533",
"0.51444316",
"0.5144085",
"0.5138743",
"0.5133518",
"0.5133049",
"0.5115803",
"0.51149",
"0.51143837",
"0.5114271",
"0.51134676",
"0.51109135",
"0.5109669",
"0.5109056",
"0.5106651",
"0.5091515",
"0.5089202",
"0.5088416",
"0.5087689",
"0.50752974",
"0.5075041",
"0.5071337",
"0.50697404",
"0.5062861",
"0.50613946",
"0.5052206",
"0.5045902",
"0.50391704",
"0.5030728",
"0.5030267",
"0.5028594",
"0.5026699",
"0.50264573",
"0.50254506",
"0.50206697",
"0.50198114",
"0.5019179",
"0.5017341",
"0.5016637",
"0.5015295",
"0.50104845",
"0.5010423",
"0.5010044",
"0.5006006",
"0.5004992",
"0.49985245",
"0.49969378",
"0.49911264"
] | 0.0 | -1 |
Construtor da classe Retangulo. | public Retangulo(double[] pLados) {
super(pLados);
/* invoca o construtor da classe Pai passando pLados como parametros. */
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public RetanguloTest() {\n retangulo = new Retangulo();\n }",
"public Respuesta() {\n }",
"public FiltroMicrorregiao() {\r\n }",
"public Rectangulo(){}",
"public TCubico(){}",
"public Recursos() {\n }",
"public Carrera(){\n }",
"public Valvula(){}",
"public Troco() {\n }",
"public Articulo(){\r\n\t\t\r\n\t}",
"private ControleurAcceuil(){ }",
"public Vehiculo() {\r\n }",
"public Cgg_res_oficial_seguimiento_usuario(){}",
"public Reparto(){\n\t\t\n\t}",
"public TipoPrestamo() {\n\t\tsuper();\n\t}",
"public Erreur() {\n\t}",
"public Libro recupera(String nombre);",
"private Retorno( )\r\n {\r\n val = null;\r\n izq = null;\r\n der = null;\r\n\r\n }",
"public Contato() {\n }",
"public AjusteSaldoAFavorRespuesta() {\n\t}",
"public Regla2(){ /*ESTE ES EL CONSTRUCTOR POR DEFECTO */\r\n\r\n /* TODAS LAS CLASES TIENE EL CONSTRUCTOR POR DEFECTO, A VECES SE CREAN AUTOMATICAMENTE, PERO\r\n PODEMOS CREARLOS NOSOTROS TAMBIEN SI NO SE HUBIERAN CREADO AUTOMATICAMENTE\r\n */\r\n \r\n }",
"public ValorVariavel() {\r\n }",
"public Candidatura (){\n \n }",
"public Alojamiento() {\r\n\t}",
"public CorreoElectronico() {\n }",
"public prueba()\r\n {\r\n }",
"public Aritmetica(){ }",
"public MorteSubita() {\n }",
"public Pila () {\n raiz=null; //Instanciar un objeto tipo nodo;\n }",
"public Unidadmedida() {\r\n\t}",
"public EliminaRutinaResource() {\n }",
"public Corso() {\n\n }",
"public RepositorioTransacaoHBM() {\n\n\t}",
"public RptPotonganGaji() {\n }",
"@Override\n\tpublic void recreo() {\n\n\t}",
"public Rol() {}",
"public Corrida(){\n\n }",
"public Plato(){\n\t\t\n\t}",
"public ControladorPrueba() {\r\n }",
"public Cgg_jur_anticipo(){}",
"Ris(String nome) {\n this.nome = nome;\n }",
"public Prova() {}",
"public Libro() {\r\n }",
"public Exercicio(){\n \n }",
"public ReocType() \r\n {\r\n super();\r\n }",
"public Clade() {}",
"public Receta(int idReceta, String diagnostico, String medicamentos, int idPaciente) {\r\n this.idReceta = idReceta;\r\n this.diagnostico = diagnostico;\r\n this.medicamentos = medicamentos;\r\n this.idPaciente = idPaciente;\r\n }",
"public solicitudControlador() {\n }",
"public ConsultaMedica() {\n super();\n }",
"public SlanjePoruke() {\n }",
"public AntrianPasien() {\r\n\r\n }",
"public Repertoire(String nom) throws mesExceptions {\r\n super(nom);\r\n nbElem = 0;\r\n }",
"public ContaBancaria() {\n }",
"public Kullanici() {}",
"public CambioComplementariosDTO() { }",
"public Destruir() {\r\n }",
"public NavigatoreRisultati(Modulo unModulo) {\n /* rimanda al costruttore della superclasse */\n super(unModulo);\n\n try { // prova ad eseguire il codice\n /* regolazioni iniziali di riferimenti e variabili */\n this.inizia();\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n }",
"public Puntaje() {\n nombre = \"\";\n puntos = 0;\n }",
"public Carrinho() {\n\t\tsuper();\n\t}",
"public TdRuspHijo() { }",
"private QuadradoPerfeito() {\n }",
"public MPaciente() {\r\n\t}",
"public Libro() {\n\t\tsuper();\n\t\tthis.id = -1;\n\t\tthis.isbn = \"\";\n\t\tthis.titulo = \"\";\n\t\tthis.editorial = \"\";\n\t\tthis.prestado = false;\n\t}",
"public TebakNusantara()\n {\n }",
"public AvaliacaoRisco() {\n }",
"public Livro() {\n\n\t}",
"public DetArqueoRunt () {\r\n\r\n }",
"public cola_de_un_banco(){// se crea nuestro metodo costructor \r\n primero=null;//se crea el tipo de indicaciones con valor a null\r\n ultimo=null;\r\n}",
"public Veiculo() {\r\n\r\n }",
"private DittaAutonoleggio(){\n \n }",
"public Funcionario() {\r\n\t\t\r\n\t}",
"public Banco(){}",
"public ControladorUsuario() {\n }",
"protected RespostaFormularioPreenchido() {\n // for ORM\n }",
"public CampoModelo(String valor, String etiqueta, Integer longitud)\n/* 10: */ {\n/* 11:17 */ this.valor = valor;\n/* 12:18 */ this.etiqueta = etiqueta;\n/* 13:19 */ this.longitud = longitud;\n/* 14: */ }",
"public CLElenco() {\n /** rimanda al costruttore di questa classe */\n this(null);\n }",
"public TarefaResource() {\r\n }",
"public Caso_de_uso () {\n }",
"public CrearQuedadaVista() {\n }",
"Reserva Obtener();",
"public PghModulo() {\r\n }",
"public Rectangulo()\n\t{\n\t\tthis.alto = 0;\n\t\tthis.ancho = 0;\n\t\tthis.area = 0;\n\t}",
"public CarroResource() {\r\n }",
"public JogadorTradutor() {\n this.nome= \"Sem Registro\";\n this.pontuacao = pontuacao;\n id = id;\n \n geradorDesafioItaliano = new GerarPalavra(); // primeira palavra ja é gerada para o cliente\n }",
"public NuevaTablaResource() {\r\n }",
"public lo() {}",
"private TIPO_REPORTE(String nombre)\r\n/* 55: */ {\r\n/* 56: 58 */ this.nombre = nombre;\r\n/* 57: */ }",
"public ListaComuniModel() {\n\t\tsuper();\n\t}",
"public Nota() {\n }",
"public Busca(){\n }",
"public telefono(){\n this.telefono =\"00000000\";\n this.saldo = 0.0;\n this.marca= \"Sin Marca\";\n }",
"public DarAyudaAcceso() {\r\n }",
"public Propuestas() {}",
"public PostPagoResult() {\n}",
"public Lotto2(){\n\t\t\n\t}",
"public Roleta()\r\n {\r\n contadorJogadas = new LinkedHashMap<>(); \r\n //adiciona os valores ao mapa de resultados.\r\n valores = new ArrayList<>();\r\n valores.add(EnumResultados.PASSA_VEZ);\r\n valores.add(EnumResultados.PASSA_VEZ);\r\n valores.add(EnumResultados.PERDE_TUDO);\r\n valores.add(EnumResultados.PERDE_TUDO);\r\n valores.add(EnumResultados.PONTOS_100);\r\n valores.add(EnumResultados.PONTOS_100);\r\n valores.add(EnumResultados.PONTOS_100);\r\n valores.add(EnumResultados.PONTOS_100);\r\n valores.add(EnumResultados.PONTOS_200);\r\n valores.add(EnumResultados.PONTOS_200);\r\n valores.add(EnumResultados.PONTOS_200);\r\n valores.add(EnumResultados.PONTOS_200);\r\n valores.add(EnumResultados.PONTOS_400);\r\n valores.add(EnumResultados.PONTOS_400);\r\n valores.add(EnumResultados.PONTOS_400);\r\n valores.add(EnumResultados.PONTOS_400);\r\n valores.add(EnumResultados.PONTOS_500);\r\n valores.add(EnumResultados.PONTOS_500);\r\n valores.add(EnumResultados.PONTOS_1000);\r\n valores.add(EnumResultados.PONTOS_1000); \r\n \r\n }",
"protected Asignatura()\r\n\t{}",
"public Funcionaria(){\n\n }",
"public Livre() {\r\n super();\r\n }",
"public Genret() {\r\n }"
] | [
"0.67112523",
"0.6537068",
"0.6525363",
"0.6460837",
"0.6328844",
"0.6280346",
"0.62706655",
"0.62269574",
"0.61636776",
"0.6134365",
"0.6133332",
"0.6075228",
"0.6027967",
"0.602716",
"0.60113186",
"0.6009713",
"0.59963274",
"0.59917957",
"0.59678286",
"0.5963446",
"0.5960643",
"0.59584606",
"0.5934009",
"0.59218246",
"0.59048325",
"0.5892712",
"0.5885279",
"0.58759886",
"0.5874746",
"0.58681214",
"0.585181",
"0.58403397",
"0.58229077",
"0.5811949",
"0.5806932",
"0.57996005",
"0.5792579",
"0.57417345",
"0.57333505",
"0.57157964",
"0.56994975",
"0.56994927",
"0.56994474",
"0.569919",
"0.5696977",
"0.5696602",
"0.5695323",
"0.567239",
"0.56708145",
"0.56697035",
"0.5667477",
"0.566313",
"0.5654786",
"0.5643695",
"0.56403077",
"0.56333876",
"0.5625103",
"0.5624877",
"0.5624459",
"0.56241626",
"0.56212103",
"0.5615795",
"0.5612911",
"0.5612869",
"0.56102246",
"0.56099427",
"0.56053746",
"0.5602042",
"0.55998313",
"0.5590473",
"0.55849886",
"0.558071",
"0.5580082",
"0.55679584",
"0.55584633",
"0.55554813",
"0.554739",
"0.55447817",
"0.5540673",
"0.55367815",
"0.5534743",
"0.55305725",
"0.5527355",
"0.55183876",
"0.55173063",
"0.5515989",
"0.5510372",
"0.55035174",
"0.54894733",
"0.54866457",
"0.54845744",
"0.5483689",
"0.5483242",
"0.5480662",
"0.54691964",
"0.54570943",
"0.54546696",
"0.54453504",
"0.5445083",
"0.54425794"
] | 0.65362346 | 2 |
Retorna a Area do Retangulo | public double getArea() {
/*
* area = base (1o lado ou 3o lado) x altura (2o lado ou 4o lado)
*/
return this.getLado(1) * this.getLado(2);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double areaRectangulo() {\n double area = altura * ancho;\n return area;\n }",
"@Override\r\n\tpublic void getarea(int a) {\n\t\t\r\n\t}",
"@Override\n\tpublic double area() {\n\t\treturn getBase()*getAltura();\n\t}",
"double getArea(){\n return 3.14 * raggio * raggio;\n }",
"@Override\n public double obtenerArea(){\n return c.obtenerArea() * 4;\n }",
"public abstract int getArea();",
"@Override\n\tpublic double getArea() {\n\t\treturn (this.getPerimetro()*Math.sqrt(Math.pow(getLongitudLado(), 2))-(Math.pow((getLongitudLado()/2), 2)))/2;\n\t}",
"double getArea();",
"double getArea();",
"@Override\n public double obtenrArea() {\n return lado*lado;\n }",
"private double calculaArea(){\r\n double area;\r\n area= (double) (Math.pow((cir.getY()-cir.getX()), 2)*Math.PI);\r\n return area;\r\n \r\n }",
"public abstract double getArea();",
"public abstract double getArea();",
"public abstract double getArea();",
"public double getArea();",
"public double getArea();",
"public double getArea();",
"AREA createAREA();",
"public int getArea()\n {\n return area;\n }",
"public double area(){\r\n\t\treturn this.base()*this.altezza();\r\n\t}",
"public double Baricentro() {\n if (puntos.size() <= 2) {\n return 0;\n } else {\n // Inicializacion de las areas\n double areaPonderada = 0;\n double areaTotal = 0;\n double areaLocal;\n // Recorrer la lista conservando 2 puntos\n Punto2D antiguoPt = null;\n for (Punto2D pt : puntos) {\n if (antiguoPt != null) {\n // Cálculo deñ baricentro local\n if (antiguoPt.y == pt.y) {\n // Es un rectángulo, el baricentro esta en\n // centro\n areaLocal = pt.y * (pt.x - antiguoPt.x);\n areaTotal += areaLocal;\n areaPonderada += areaLocal * ((pt.x - antiguoPt.x) / 2.0 + antiguoPt.x);\n } else {\n // Es un trapecio, que podemos descomponer en\n // un reactangulo con un triangulo\n // rectangulo adicional\n // Separamos ambas formas\n // Primer tiempo: rectangulo\n areaLocal = Math.min(pt.y, antiguoPt.y) + (pt.x - antiguoPt.x);\n areaTotal += areaLocal;\n areaPonderada += areaLocal * ((pt.x - antiguoPt.x) / 2.0 + antiguoPt.x);\n //Segundo tiempo: triangulo rectangulo\n areaLocal = (pt.x - antiguoPt.x) * Math.abs(pt.y - antiguoPt.y) / 2.0;\n areaTotal += areaLocal;\n if (pt.y > antiguoPt.y) {\n // Baricentro a 1/3 del lado pt\n areaPonderada += areaLocal * (2.0 / 3.0 * (pt.x - antiguoPt.x) + antiguoPt.x);\n } else {\n // Baricentro a 1/3 dek lado antiguoPt\n areaPonderada += areaLocal * (1.0 / 3.0 * (pt.x - antiguoPt.x) + antiguoPt.x);\n }\n }\n }\n antiguoPt = pt;\n }\n // Devolvemos las coordenadas del baricentro\n return areaPonderada / areaTotal;\n }\n }",
"public void claShapeArea(){\r\n\t\tshape.calArea();\r\n\t}",
"public abstract float calArea();",
"public float area() {\n return (getBase() * getAltura() )/ 2;\n }",
"public abstract float getArea();",
"@Override\r\n\tpublic void calcArea() {\n\t\t\r\n\t}",
"public abstract String getArea();",
"@Override\n public double area() {\n return Math.pow(lado, 2);\n }",
"abstract double area();",
"abstract double area();",
"abstract double area();",
"abstract double area();",
"@Override\n\tpublic void calcularArea() {\n\t\t\n\t}",
"public double getArea(){\n return 3.14 * radius * radius;\n }",
"abstract void findArea();",
"abstract void findArea();",
"public int getCodigoArea() { return this.codigoArea; }",
"public int getCodigoArea() { return this.codigoArea; }",
"public double areaRectangulo(double base, double altura){\n\t\treturn resultado = (base * altura);\n\t}",
"@Override\n\tpublic double getArea()\n\t{\n\t\treturn isAtivado() ? calculaArea(getDiametro()) : 0.0;\n\t}",
"public void setCodigoArea(int p) { this.codigoArea = p; }",
"public void setCodigoArea(int p) { this.codigoArea = p; }",
"public double getArea()\n {\n return area;\n }",
"public String getArea() {\n return this.area;\n }",
"public int getArea() {\n\t\treturn area;\n\t}",
"public int area() {\n \tarea = width()*height();\n }",
"@Override\n\tpublic double area() {\n\t\t// TODO Auto-generated method stub\n\t\treturn 0;\n\t}",
"public Rectangle getRectangulo() {\n\t\treturn new Rectangle(\n\t\t\t\t(int)x -clanchura,\n\t\t\t\t(int)y - claltura,\n\t\t\t\tclanchura,\n\t\t\t\tclaltura\n\t\t\t);\n\t}",
"public Rectangulo()\n\t{\n\t\tthis.alto = 0;\n\t\tthis.ancho = 0;\n\t\tthis.area = 0;\n\t}",
"public double calcularArea() {\n\t\treturn base * altura;\n\t}",
"public String getArea() {\n return area;\n }",
"public String getArea() {\n return area;\n }",
"public String getArea() {\n return area;\n }",
"public float get_area() {\r\n return 0;\r\n }",
"public float getArea(){\n return area;\n\t}",
"public String getArea() {\n return area;\n }",
"private void mapAreaOne()\n\n {\n\n Area area = areaIDMap.get(Constants.FIRST_AREA_ID);\n\n area.areaMap.put(Constants.North, areaIDMap.get(Constants.SECOND_AREA_ID));\n\n area.areaMap.put(Constants.South, areaIDMap.get(Constants.FIFTH_AREA_ID));\n\n area.areaMap.put(Constants.East, areaIDMap.get(Constants.FOURTH_AREA_ID));\n\n area.areaMap.put(Constants.West, areaIDMap.get(Constants.SIXTH_AREA_ID));\n\n area.paths = Constants.NorthSouthEastAndWest;\n\n }",
"public float area() {\n return (base * haltura / 2);\r\n }",
"public int area() {\r\n\t\tint area = (getLength()) * (getBreath());\r\n\t\treturn (area);\r\n\t}",
"public Rectangle getArea() {\n return area;\n }",
"@Override\n\tpublic void computeArea() {\n\t\tthis.area = length * length;\t\t\t\t\n\t}",
"public double area();",
"public Poi ToArea()\r\n {\r\n this.lat = PoiManager.roundToHalfDown(this.lat);\r\n this.lon = PoiManager.roundToHalfDown(this.lon);\r\n return this;\r\n }",
"void calculateArea() {\n this.setArea(this.getArea()/2);\n }",
"public static double getArea() {\n return NetworkTableInstance.getDefault().getTable(\"limelight\").getEntry(\"ta\").getDouble(0);\n }",
"Double getAreaValue();",
"public double getArea(){\n return 0;\n }",
"public abstract float area();",
"@Override\r\n public double calculateArea() {\n double area = 0;\r\n return area;\r\n }",
"public void setArea(String area) {\n this.area = area;\n }",
"public String getArea() {\n\t\treturn area;\n\t}",
"public void setArea(String area) {\n this.area = area;\n }",
"public double getTargetArea() {\n return getDouble(\"ta\");\n }",
"@Override\n public double getArea() {\n return this.length*this.width; //To change body of generated methods, choose Tools | Templates.\n }",
"public double obtenerAreaCua(){\n areaCua = Math.pow(lado,2);\n return areaCua;\n }",
"@Override\n\tpublic double getArea() {\n\t\treturn Math.pow(getSide(), 2) * this.N / 4 * (Math.tan(Math.toRadians(180 / this.N)));\n\t}",
"public float getArea() {\n return area;\n }",
"public abstract double getSurfacearea();",
"public static double AreaRectangulo(double medidaBase,double medidaAltura){\r\n double area = medidaBase*medidaAltura;\r\n return area;\r\n }",
"double calculateArea();",
"public Rectangulo(int alto, int ancho) {\n\t\tthis.alto = alto;\n\t\tthis.ancho = ancho;\n\t\tthis.area = alto * ancho;\n\t\t\n\t\tthis.pos = new Punto();\n\t}",
"@Override\n\tpublic void area() {\n\t\tSystem.out.println(\"------------------------------\");\n\t\tSystem.out.println(this.name+\"的面积:\"+land1high*land1);\n\t}",
"public abstract double calculateArea();",
"public abstract double calculateArea();",
"double area();",
"@Override\n public float getArea() {\n int wart = 0;\n if (!roomList.isEmpty()){\n for (Room room : roomList){\n if (room instanceof Localization){\n wart += room.getArea();\n }\n }\n\n }\n return wart;\n }",
"public abstract Area newArea();",
"public double getArea() {\n\t\treturn this.area;\n\t}",
"@Override\n\tpublic double area() {\n\t\treturn 0;\n\t}",
"@Override\n\tpublic double area() {\n\t\treturn 0;\n\t}",
"protected double getArea()\r\n {\r\n return ( side * side ) / 2;\r\n }",
"public void Area(double apotema, double perimetro){\n this.area = (perimetro * apotema) / 2; \n }",
"double area() {\r\n\t\treturn Math.PI*r*r;\r\n\t\t//return (int)((Math.PI*r*r + 0.005) * 100) / 100.0;\r\n\t}",
"public void calArea()\n {\n //Start of the formula\n for(int i = 0; i < sides-1; i++)\n {\n area += (poly[i].getX()*poly[i+1].getY())-(poly[i].getY()*poly[i+1].getX());\n }\n\n //half the total calculation\n area = area/2;\n\n //if area is negative times by -1\n if(area <= 0)\n {\n area = area*-1;\n }\n }",
"public final int getArea()\n\t{\n\t\treturn address >>> 12;\n\t}",
"public void ALR(AreaInstrucao instrucao){\n deslocamento = instrucao.iParametro;\n for(int i = topo+1; i <= topo+deslocamento; i++ ){\n dads.push(\"0.0\");\n pilhaVerificacaoTipos.push(\"real\");\n };\n\n topo += deslocamento;\n ponteiro += 1;\n }",
"public double calculate() {\n\t\treturn area*1800;\r\n\t}",
"public static double AreaTriangulo(double medidaBase,double medidaAltura){\r\n double area = medidaBase*medidaAltura/2;\r\n return area;\r\n }",
"@Override\r\n\tpublic double getArea() {\n\t\treturn (this.base * this.height)/2;\r\n\t}",
"public void setNombreArea(String p) { this.nombreArea = p; }"
] | [
"0.7224728",
"0.6997131",
"0.69548124",
"0.69123614",
"0.6902117",
"0.6784983",
"0.6772587",
"0.67293537",
"0.67293537",
"0.6683766",
"0.6674891",
"0.65916467",
"0.65916467",
"0.65916467",
"0.658967",
"0.658967",
"0.658967",
"0.6533325",
"0.65191287",
"0.6494313",
"0.6489632",
"0.6481509",
"0.64782053",
"0.6476565",
"0.64536846",
"0.6450191",
"0.64457357",
"0.6417663",
"0.64176255",
"0.64176255",
"0.64176255",
"0.64176255",
"0.63995063",
"0.63994026",
"0.6397923",
"0.6397923",
"0.63450915",
"0.63450915",
"0.63385856",
"0.632446",
"0.6299968",
"0.6299968",
"0.6298132",
"0.6283266",
"0.62736326",
"0.6261273",
"0.6258819",
"0.62465274",
"0.6242853",
"0.6242675",
"0.62192637",
"0.62192637",
"0.62192637",
"0.62146586",
"0.6212099",
"0.6197845",
"0.61949193",
"0.61852825",
"0.617439",
"0.6158922",
"0.6158718",
"0.61481553",
"0.61479735",
"0.6140006",
"0.61301565",
"0.61276126",
"0.6124215",
"0.6123729",
"0.60828334",
"0.60768414",
"0.60705465",
"0.6070352",
"0.60660565",
"0.60564345",
"0.6054199",
"0.6048055",
"0.6039327",
"0.6039081",
"0.6038218",
"0.6037842",
"0.6031765",
"0.6029208",
"0.6028915",
"0.6028915",
"0.60288125",
"0.6026186",
"0.599207",
"0.5990148",
"0.597226",
"0.597226",
"0.5969664",
"0.59462154",
"0.59430385",
"0.5938438",
"0.5933948",
"0.5915827",
"0.5909747",
"0.59079164",
"0.58950937",
"0.5890423"
] | 0.69557744 | 2 |
Created by Gautam on 5/5/14. | public interface StoreRestoreI {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void perish() {\n \n }",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n\tprotected void interr() {\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"public final void mo51373a() {\n }",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"protected boolean func_70814_o() { return true; }",
"private void m50366E() {\n }",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"private void poetries() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tpublic void jugar() {\n\t\t\n\t}",
"public void mo38117a() {\n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"private static void cajas() {\n\t\t\n\t}",
"private void kk12() {\n\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"public void mo4359a() {\n }",
"@Override\n public void init() {\n }",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"private void init() {\n\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void init() {\n }",
"@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}",
"@Override\n public void init() {}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\r\n\tpublic void init() {}",
"@Override\n void init() {\n }",
"private void strin() {\n\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n public void init() {\n\n }",
"@Override\n public int describeContents() { return 0; }",
"public void method_4270() {}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"@Override\n\tpublic void init() {\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n public int retroceder() {\n return 0;\n }",
"@Override\n\tpublic void init()\n\t{\n\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}",
"public void m23075a() {\n }",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"private Rekenhulp()\n\t{\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}",
"@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}",
"public abstract void mo70713b();",
"private void m50367F() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"public void mo6081a() {\n }",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n public void initialize() { \n }"
] | [
"0.60443145",
"0.60040236",
"0.5937519",
"0.5834581",
"0.58225197",
"0.5799943",
"0.5797583",
"0.5797583",
"0.5791616",
"0.57578754",
"0.5752043",
"0.5736722",
"0.57192874",
"0.571005",
"0.5708724",
"0.56783766",
"0.5676016",
"0.56659174",
"0.56587225",
"0.56587225",
"0.56587225",
"0.56587225",
"0.56587225",
"0.5646486",
"0.56338626",
"0.56329125",
"0.5615605",
"0.5609345",
"0.56001854",
"0.559396",
"0.5577489",
"0.5566155",
"0.55613774",
"0.55610585",
"0.55511206",
"0.55511206",
"0.55497974",
"0.5546233",
"0.5531888",
"0.5527846",
"0.55211407",
"0.5514578",
"0.5507084",
"0.54981005",
"0.5485491",
"0.5485491",
"0.5485491",
"0.54805285",
"0.5476285",
"0.5476285",
"0.5476285",
"0.546506",
"0.5462909",
"0.5462453",
"0.5461622",
"0.5459683",
"0.54563576",
"0.5452029",
"0.5447245",
"0.5447245",
"0.54451716",
"0.54442596",
"0.5442848",
"0.5442848",
"0.5442848",
"0.5434362",
"0.5434362",
"0.5434362",
"0.5434362",
"0.5434362",
"0.5434362",
"0.5429177",
"0.54254025",
"0.5422419",
"0.5418898",
"0.5411976",
"0.5411976",
"0.5407814",
"0.5397141",
"0.53915095",
"0.53915095",
"0.53915095",
"0.53915095",
"0.53915095",
"0.53915095",
"0.53915095",
"0.5390026",
"0.5387448",
"0.5385624",
"0.53822446",
"0.5377736",
"0.5375079",
"0.537393",
"0.5360455",
"0.5359541",
"0.5350243",
"0.5336463",
"0.5331149",
"0.5318027",
"0.5316143",
"0.5313358"
] | 0.0 | -1 |
Dto sinifilari icin kullanilan donusturucu arayuzudur. | public interface DtoConverter<D extends BaseDto, E extends BaseEntity> {
/**
* Verilen {@link BaseEntity} nesne listesini {@link Set<BaseDto>}'e cevirmektedir.
*
* @param entityList {@link BaseEntity} listesi
* @return Set
*/
Set<D> convertToDtoSet(Collection<E> entityList);
/**
* Verilen {@link BaseEntity} nesne listesini {@link List<BaseDto>}'e cevirmektedir.
*
* @param entityList {@link BaseEntity} listesi
* @return List
*/
List<D> convertToDtoList(Collection<E> entityList);
/**
* Verilen {@link BaseEntity} nesnesini {@link BaseDto} nesnesine cevirme islemini
* yapmaktadir.
*
* @param entity {@link BaseEntity}
* @return D
*/
D convertToDto(E entity);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public CambioComplementariosDTO() { }",
"public AtendimentoJuridicoDTO toDTO(AtendimentoJuridicoEntity entity){\n\t\tAtendimentoJuridicoDTO dto = new AtendimentoJuridicoDTO();\n\t\tBeanUtils.copyProperties(entity, dto); \n\t\treturn dto ;\n\t}",
"public PersonaDTO(){}",
"public ProductoDTO(){\r\n\t\t\r\n\t}",
"public TcUnidadEdoDTO() {\n }",
"PersonaDTO PersonaToPersonaDTO(Persona persona);",
"public ProdutoDTO()\n {\n super();\n }",
"public Dto() {\n \t\n }",
"@Override\r\n\tpublic MainDTO toDTO() {\n\t\tFamiliaresDTO familiaresDTO = new FamiliaresDTO();\r\n\t\tDomicilioDTO domicilioDTO = null;\r\n\t\tfamiliaresDTO.setIdfamiliar(this.getIdFamiliar());\r\n\t\tfamiliaresDTO.setNombre(this.getNombre());\r\n\t\tfamiliaresDTO.setApellidoPaterno(this.getApellidoPaterno());\r\n\t\tfamiliaresDTO.setApellidoMaterno(this.getAppelidoMaterno());\r\n\t\tfamiliaresDTO.setDireccion(this.getDireccion());\r\n\t\tfamiliaresDTO.setIdpaciente(this.getIdpaciente());\r\n\t\tfamiliaresDTO.setDependencia(this.getDependencia());\r\n\t\tdomicilioDTO = (DomicilioDTO) this.getDomicilio().toDTO();\r\n\t\tfamiliaresDTO.setDomicilio(domicilioDTO);\r\n\t\treturn familiaresDTO;\r\n\t}",
"List<VoziloDto> sveVozila();",
"RealtorProductDTO getrealtorProductDTO(int sr_no);",
"RunDTO toDto(Run run) {\n RunDTO result = new RunDTO();\n result.setId(0L);\n if (null != run) {\n this.fillDto(result, run);\n }\n return result;\n }",
"private List<ArancelDTO> arancelesToDto(List<Arancel> aranceles) {\n\t\t// Lista a devolver\n\t\tList<ArancelDTO> arancelesDto = new ArrayList<ArancelDTO>();\n\t\tArancelDTO arancelDto;\n\t\t\n\t\t// Recorro cada uno de los aranceles\n\t\tfor (Arancel arancel : aranceles) {\n\t\t\t// Cargo los datos en el dto\n\t\t\tarancelDto = new ArancelDTO();\n\t\t\tarancelDto.setId(arancel.getId());\n\t\t\tarancelDto.setCodigo(arancel.getCodigo());\n\t\t\tarancelDto.setPrecioNoSocio(Formateador.formatNumero(arancel.getPrecioNoSocio()));\n\t\t\tarancelDto.setPrecioSocio(Formateador.formatNumero(arancel.getPrecioSocio()));\n\n\t\t\t// Cargo el objeto en la lista \n\t\t\tarancelesDto.add(arancelDto);\n\t\t}\n\n\t\treturn arancelesDto;\n\t}",
"@Override\r\n\tpublic AbstractDto mapToDto() {\n\t\treturn null;\r\n\t}",
"public void crearCompraComic(CompraComicDTO compraComicDTO);",
"public GrupoUsuarioDTO() {\n }",
"V toDto(E entity);",
"public ViatgesDTO() {\n \n }",
"Persona PersonaDTOToPersona(PersonaDTO personaDTO);",
"public PersonaDTO obtenerPersona(Long idPersona) throws CustomErrorException {\n\t\tPersonaDTO personaDTO = new PersonaDTO();\n\t\ttry {\n\t\t\tpersonaDTO = Converter.toDto((Persona) gPersona.getById(idPersona)); \n\t\t} catch (CustomErrorException cer) {\n\t\t\tthrow cer;\n\t\t} catch (Exception e) {\n\t\t\tthrow new CustomErrorException(CustomErrorException.ERROR_SERVICIO,this.getClass().getSimpleName(),e.getStackTrace());\n\t\t}\n\n\t\treturn personaDTO;\n\t}",
"public void crearPersona(PersonaDTO personaDTO);",
"public TransportDTO makeDTO(ResultSet RS) {\n TransportDTO output = null;\n Connection conn = Repository.getInstance().connect();\n OrderDAO OrderDAO = new OrderDAO();\n try {\n String date = RS.getString(2);\n int weight = RS.getInt(1);\n String driverID = RS.getString(5);\n String Truckplate = RS.getString(4);\n int transportID = RS.getInt(3);\n List<OrderDTO> Orders = new ArrayList<OrderDTO>();\n boolean wasDel = RS.getString(6).equals(\"true\");\n ResultSet contractsRS = getWithInt(\"TransportsOrders\", \"TransportID\", transportID,conn);\n while (contractsRS.next()) {\n int OrderID = contractsRS.getInt(1);\n Orders.add(OrderDAO.get(OrderID));\n }\n output = new TransportDTO(date, weight, driverID, Truckplate, Orders, wasDel, transportID);\n } catch (Exception e) {\n output = null;\n }\n finally{\n Repository.getInstance().closeConnection(conn);\n }\n return output;\n }",
"public CambioComplementariosDTO(java.lang.String curpEmpleado,\n java.lang.String rfcEmpleado,\n java.lang.String primerApellido,\n java.lang.String segundoApellido,\n java.lang.String nombreEmpleado,\n java.lang.String clabeEmpleado,\n java.lang.String idBancoSar,\n java.util.Date ingresoGobFed, \n java.util.Date ingresoDependencia, \n java.util.Date terminoCargoSind, \n java.lang.String imssIssste, \n java.lang.String EMailOficial, \n java.lang.String EMailPersonal,\n java.lang.Integer idRusp, \n java.lang.String sistemaReparto, \n java.lang.String idTipoPago, \n java.lang.String idEdoCivil, \n java.lang.String idNacionalidad, \n java.lang.String idProfnCarrera, \n java.lang.Integer idNivelEscolar, \n java.lang.Integer idInstEducativa, \n java.lang.Integer idEspProtCivil, \n java.lang.Integer idInstProtcivil, \n java.util.Date fecNotDecPatr, \n java.util.Date fecIniDeclPatr, \n java.util.Date fecIngSpc, \n java.lang.String casoMuestra,\n java.lang.String discapacidad,\n java.lang.String estudiaSiNo,\n java.lang.String padreMadre,\n java.lang.String compatEmpleo,\n java.lang.String usuario,\n java.lang.Integer idInmuebleP,\n java.lang.String plazaTelOfc1,\n java.lang.String plazaExt1) { \n this.curpEmpleado = curpEmpleado;\n this.rfcEmpleado = rfcEmpleado;\n this.primerApellido = primerApellido;\n this.segundoApellido = segundoApellido;\n this.nombreEmpleado = nombreEmpleado;\n this.clabeEmpleado = clabeEmpleado;\n this.idBancoSar = idBancoSar;\n this.ingresoGobFed = ingresoGobFed;\n this.ingresoDependencia = ingresoDependencia;\n this.terminoCargoSind = terminoCargoSind;\n this.imssIssste = imssIssste;\n this.EMailOficial = EMailOficial;\n this.EMailPersonal = EMailPersonal;\n this.idRusp = idRusp;\n this.sistemaReparto = sistemaReparto;\n this.idTipoPago = idTipoPago;\n this.idEdoCivil = idEdoCivil;\n this.idNacionalidad = idNacionalidad;\n this.idProfnCarrera = idProfnCarrera;\n this.idNivelEscolar = idNivelEscolar;\n this.idInstEducativa = idInstEducativa;\n this.idEspProtCivil = idEspProtCivil;\n this.idInstProtcivil = idInstProtcivil;\n this.fecNotDecPatr = fecNotDecPatr;\n this.fecIniDeclPatr = fecIniDeclPatr;\n this.fecIngSpc = fecIngSpc;\n this.casoMuestra = casoMuestra;\n this.discapacidad = discapacidad;\n this.estudiaSiNo = estudiaSiNo;\n this.padreMadre = padreMadre;\n this.compatEmpleo = compatEmpleo;\n this.usuario = usuario;\n this.idInmuebleP = idInmuebleP;\n this.plazaTelOfc1 = plazaTelOfc1;\n this.plazaExt1 = plazaExt1;\n }",
"private LecturerDto mapDto(Lecturer lecturer) {\n return new LecturerDto(lecturer.getLecturerID(), lecturer.getFirstName(), lecturer.getLastName(), lecturer.getEmail(), lecturer.getType());\n }",
"public PropertyDefDto getDto();",
"public List<UniteeDto> listerUniteeInfanterie() {\n\n\t\t// INITIALISATIONS\n\t\tList<UniteeDto> listeUniteeInfanterie = new ArrayList<>();\n\n\t\t// RECHERCHE DES UNITES (Type 2)\n\t\tfor (Unitee unitee : uniteeRepo.findByIdTypeUnitee(2)) {\n\t\t\tUniteeDto uniteeDto = new UniteeDto();\n\t\t\tuniteeDto.setId(unitee.getId());\n\t\t\tuniteeDto.setIdTypeUnitee(unitee.getIdTypeUnitee());\n\t\t\tuniteeDto.setIdBatimentProvenance(unitee.getIdBatimentProvenance());\n\t\t\tuniteeDto.setIcone(unitee.getIcone());\n\t\t\tuniteeDto.setLibelle(unitee.getLibelle());\n\t\t\tuniteeDto.setDescriptif(unitee.getDescriptif());\n\t\t\tuniteeDto.setCoutPierreFormation(unitee.getCoutPierreFormation());\n\t\t\tuniteeDto.setCoutBoisFormation(unitee.getCoutBoisFormation());\n\t\t\tuniteeDto.setCoutOrFormation(unitee.getCoutOrFormation());\n\t\t\tuniteeDto.setCoutNourritureFormation(unitee.getCoutNourritureFormation());\n\t\t\tuniteeDto.setCoutHumain(unitee.getCoutHumain());\n\t\t\tuniteeDto.setTempsFormation(unitee.getTempsFormation());\n\t\t\tuniteeDto.setVie(unitee.getVie());\n\t\t\tuniteeDto.setAttaque(unitee.getAttaque());\n\t\t\tuniteeDto.setPortee(unitee.getPortee());\n\t\t\tuniteeDto.setArmure(unitee.getArmure());\n\t\t\tuniteeDto.setVitesse(unitee.getVitesse());\n\t\t\tuniteeDto.setNiveauBatimentNecessaireFormation(unitee.getNiveauBatimentNecessaireFormation());\n\t\t\tuniteeDto.setApportRessourcePierreHeure(unitee.getApportRessourcePierreHeure());\n\t\t\tuniteeDto.setApportRessourceBoisHeure(unitee.getApportRessourceBoisHeure());\n\t\t\tuniteeDto.setApportRessourceOrHeure(unitee.getApportRessourceOrHeure());\n\t\t\tuniteeDto.setApportRessourceNourritureHeure(unitee.getApportRessourceNourritureHeure());\n\t\t\tuniteeDto.setApportExperience(unitee.getApportExperience());\n\t\t\tlisteUniteeInfanterie.add(uniteeDto);\n\t\t}\n\n\t\t// RETOUR\n\t\treturn listeUniteeInfanterie;\n\t}",
"OrderDto map(Order order);",
"private Produto passarProdutoParaDto(ProdutoDto produtoDto) {\n\t\tProduto produto = new Produto();\n\t\tproduto.setNome(produtoDto.getNome());\n\t\tproduto.setQuantidade(produtoDto.getQuantidade());\n\t\tproduto.setValor(produtoDto.getValor());\n\t\t\n\t\treturn produto;\n\t}",
"public abstract DTO toDTO(M model);",
"public GetUsuarioDTO convierteDTO(Integer id){\n Optional<Usuario> usuario = usuarioRepository.findById(id);\n return usuario.map(usuarioDTOConverter::convertToDTO).orElseThrow(()->new UsuarioNotFoundException(id));\n }",
"@Override\n public ScontrinoDtoIll trovaEan(String ean, Scontrino sc) {\n Prodotto p = anagraficaProdottiRepository.findByEan(ean);\n if (p == null) {\n //se non è stato trovato alcun prodotto recupero il dto e\n //spedisco un messaggio di errore\n return new ScontrinoDtoIll(null, null, \"prodotto non trovato\");\n }\n //se invece è stato trovato un prodotto devo associarlo alla\n //riga scontrino che è a sua volta associata ad uno scontrino\n // quindi recupero lo scontrino ...\n if (sc != null) {\n sc = scontrinoRepository.findById(sc.getId()).get();\n //return new ScontrinoDtoIll(null, null, \"prodotto trovato\");\n }\n // se non esiste lo scontrino lo creo ...\n if (sc == null) {\n sc = new Scontrino();\n sc = scontrinoRepository.save(sc);\n }\n\n // creo la riga e la salvo ...\n RigaScontrino r = new RigaScontrino();\n r = rigaRepository.save(r);\n r.setProdotto(p);\n r.setScontrino(sc);\n r = rigaRepository.save(r);\n\n // aggiungo la riga allo scontrino\n sc.getRigheScontrino().add(r);\n sc = scontrinoRepository.save(sc);\n\n // creo il DTO con i dati da ritornare al client\n ScontrinoDtoIll risp = new ScontrinoDtoIll();\n Set<RigaScontrino> righe = sc.getRigheScontrino();\n List<RigaScontrinoClientDto> righeDto = new ArrayList<>();\n // trasformo le righe originali dello scontrino in righe del DTO\n righe.forEach(rr\n -> righeDto.add(\n new RigaScontrinoClientDto(\n rr.getId(),\n rr.getScontrino().getId(),\n p.getId(),\n rr.getProdotto().getDescrizione(),\n rr.getProdotto().getPrezzo())));\n\n risp.setRigheScontrino(righeDto);\n risp.setScontrino(sc);\n risp.setMessaggio(\"scontrino pronto!\");\n\n return risp;\n }",
"public ViviendaDTO(ViviendaEntity entity, String condicion)\r\n {\r\n if (entity!=null){\r\n this.idVivienda=entity.getIdVivienda();\r\n this.ciudad=entity.getCiudad();\r\n this.descripcion=entity.getDescripcion();\r\n this.direccion=entity.getDireccion();\r\n this.capacidad=entity.getCapacidad();\r\n this.valorDiario=entity.getValorDiario();\r\n this.imagen=entity.getImagen();\r\n }\r\n }",
"public HojaDeVidaDTO getHojaDeVida() {return hojaDeVida;}",
"public static EtudiantDto toDto(Etudiant stud) {\n\t\tUserDto uDto = UserDto.toUserDto(stud.getUser());\n\t\tEtudiantDto studDto = new EtudiantDto(stud.getId(), stud.getNom(), stud.getPrenom(), stud.getEmail(), stud.getTel(), uDto);\n\t\treturn studDto;\n\t}",
"default ShopDTO entityToDto(Shop entity) {\n ShopDTO dto = ShopDTO.builder()\n .productID(entity.getProductID())\n .product(entity.getProduct())\n .image(entity.getImage())\n .content(entity.getContent())\n .price(entity.getPrice())\n .count(entity.getCount())\n .regDate(entity.getRegDate())\n .modDate(entity.getModDate())\n .build();\n return dto;\n }",
"List<PersonaDTO> PersonaListToPersonaDTOList(List<Persona> personaList);",
"D mapToDTO(E entity);",
"public abstract D convertToDto(T entity);",
"public DomicilioDTO(DomicilioEntity domicilioEntity) {\r\n if (domicilioEntity != null) {\r\n this.id = domicilioEntity.getId();\r\n this.precio = domicilioEntity.getPrecio();\r\n this.idZona = domicilioEntity.getIdZona();\r\n \r\n }\r\n }",
"public List<UniteeDto> listerUniteeCavalerie() {\n\n\t\t// INITIALISATIONS\n\t\tList<UniteeDto> listeUniteeCavalerie = new ArrayList<>();\n\n\t\t// RECHERCHE DES UNITES (Type 3)\n\t\tfor (Unitee unitee : uniteeRepo.findByIdTypeUnitee(3)) {\n\t\t\tUniteeDto uniteeDto = new UniteeDto();\n\t\t\tuniteeDto.setId(unitee.getId());\n\t\t\tuniteeDto.setIdTypeUnitee(unitee.getIdTypeUnitee());\n\t\t\tuniteeDto.setIdBatimentProvenance(unitee.getIdBatimentProvenance());\n\t\t\tuniteeDto.setIcone(unitee.getIcone());\n\t\t\tuniteeDto.setLibelle(unitee.getLibelle());\n\t\t\tuniteeDto.setDescriptif(unitee.getDescriptif());\n\t\t\tuniteeDto.setCoutPierreFormation(unitee.getCoutPierreFormation());\n\t\t\tuniteeDto.setCoutBoisFormation(unitee.getCoutBoisFormation());\n\t\t\tuniteeDto.setCoutOrFormation(unitee.getCoutOrFormation());\n\t\t\tuniteeDto.setCoutNourritureFormation(unitee.getCoutNourritureFormation());\n\t\t\tuniteeDto.setCoutHumain(unitee.getCoutHumain());\n\t\t\tuniteeDto.setTempsFormation(unitee.getTempsFormation());\n\t\t\tuniteeDto.setVie(unitee.getVie());\n\t\t\tuniteeDto.setAttaque(unitee.getAttaque());\n\t\t\tuniteeDto.setPortee(unitee.getPortee());\n\t\t\tuniteeDto.setArmure(unitee.getArmure());\n\t\t\tuniteeDto.setVitesse(unitee.getVitesse());\n\t\t\tuniteeDto.setNiveauBatimentNecessaireFormation(unitee.getNiveauBatimentNecessaireFormation());\n\t\t\tuniteeDto.setApportRessourcePierreHeure(unitee.getApportRessourcePierreHeure());\n\t\t\tuniteeDto.setApportRessourceBoisHeure(unitee.getApportRessourceBoisHeure());\n\t\t\tuniteeDto.setApportRessourceOrHeure(unitee.getApportRessourceOrHeure());\n\t\t\tuniteeDto.setApportRessourceNourritureHeure(unitee.getApportRessourceNourritureHeure());\n\t\t\tuniteeDto.setApportExperience(unitee.getApportExperience());\n\n\t\t\t// AJOUT AU TABLEAU\n\t\t\tlisteUniteeCavalerie.add(uniteeDto);\n\t\t}\n\n\t\t// RETOUR\n\t\treturn listeUniteeCavalerie;\n\t}",
"public ViviendaDTO(ViviendaEntity entity){\r\n if (entity!=null){\r\n this.idVivienda=entity.getIdVivienda();\r\n this.anfitrion=new AnfitrionBasicDTO(entity.getAnfitrion());\r\n this.ciudad=entity.getCiudad();\r\n this.descripcion=entity.getDescripcion();\r\n this.direccion=entity.getDireccion();\r\n this.capacidad=entity.getCapacidad();\r\n this.valorDiario=entity.getValorDiario();\r\n this.imagen=entity.getImagen();\r\n this.numeroHabitaciones=entity.getHabitaciones().size();\r\n }\r\n }",
"public FacturaDTO(FacturaEntity entity) \n {\n if(entity != null)\n {\n this.costo = entity.getCosto();\n this.id = entity.getId();\n }\n \n }",
"protected abstract void processDTO();",
"public DatatypeDto instantiateDto(Datatype poso) {\n\t\tDatatypeDto dto = DatatypeDto.String;\n\t\treturn dto;\n\t}",
"private Empresa converterDtoParaEmpresa(CadastroPJDto cadastroPJDto) {\n\t\tEmpresa empresa = new Empresa();\n\t\tempresa.setCnpj(cadastroPJDto.getCnpj());\n\t\tempresa.setRazaoSocial(cadastroPJDto.getRazaoSocial());\n\n\t\treturn empresa;\n\t}",
"public LayerDto() {}",
"public PosicionDTO consultarInformacionSatelite(){\n logger.debug(\"MensajeService::PosicionDTO()\");\n PosicionDTO posicionDTO = new PosicionDTO();\n CoordenadasDTO posiciones = asignarCoordenadas();\n if(posiciones != null){\n posicionDTO.setCoordenadasDTO(posiciones);\n List<String[]> mensajeSatelites = obtenerMensajes(listaNave);\n String mensaje = organizarMensaje(mensajeSatelites);\n posicionDTO.setMensaje(mensaje);\n return posicionDTO;\n }\n return posicionDTO;\n }",
"@Override\n\tpublic Izdavac convert(IzdavacDTO dto) {\n\t\tIzdavac izdavac=new Izdavac();\n\t\tif(dto.getId()!=null) {\n\t\t\tizdavac=izdavacService.findOne(dto.getId());\n\t\t\tif(izdavac==null) {\n\t\t\t\tthrow new IllegalStateException(\"greska izdavacDTO\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tizdavac.setAdresa(dto.getAdresa());\n\t\tizdavac.setId(dto.getId());\n\t\tizdavac.setNaziv(dto.getNaziv());\n\t\tizdavac.setTelefon(dto.getTelefon());\n\t\t\n\t\treturn izdavac;\n\t}",
"public PurchaseDto() {}",
"private UserDto mapFromUserToDto(User user) {\n UserDto userDto = new UserDto();\n userDto.setId(user.getId());\n userDto.setUsername(user.getUserName());\n userDto.setName(String.format(\"%s %s\", user.getFirstName(), user.getLastName()));\n userDto.setEmail(user.getEmail());\n userDto.setAvatar(user.getAvatar());\n return userDto;\n }",
"public GrupoDTO getDto() {\n\t\treturn this.dto;\n\t}",
"private LegResponse convertLegDTOtoLegResponse(LegDTO legDTO, SkyScannerDTO skyscannerDTO)\n {\n if (legDTO == null) {\n return null;\n }\n LegResponse legResponse = new LegResponse();\n // Origin and Destination are Ids in the response,\n //so get all places, find the wanted by id and get only the name.\n legResponse.setOrigin(\n skyscannerDTO.getPlaces().stream().filter(x -> x.getPlaceId().equals(legDTO.getOriginId())).findFirst().orElse(new PlacesDTO()).getName());\n\n legResponse.setDestination(\n skyscannerDTO.getPlaces().stream().filter(x -> x.getPlaceId().equals(legDTO.getDestinationId())).findFirst().orElse(new PlacesDTO()).getName());\n\n legResponse.setDepartureDate(legDTO.getDepartureDate());\n //Carriers are Ids in the response,\n //so get all carriers, find by ids and add them to list.\n legResponse.setCarriers(getCarrierNames(skyscannerDTO.getCarriers(), legDTO));\n\n return legResponse;\n }",
"@Override\n\tpublic List<PedidoDTO> toDto(List<Pedido> entityList) {\n\t\treturn null;\n\t}",
"public interface IReglaUtilDTO {\n\n\t/**\n\t * To business.\n\t * \n\t * @param reglaDTO\n\t * the regla dto\n\t * @return the regla\n\t * @throws TransferObjectException\n\t * the transfer object exception\n\t */\n\tRegla toBusiness(ReglaDTO reglaDTO) throws TransferObjectException;\n\n\t/**\n\t * To rest.\n\t * \n\t * @param regla\n\t * the regla\n\t * @return the regla dto\n\t * @throws TransferObjectException\n\t * the transfer object exception\n\t */\n\tReglaDTO toRest(Regla regla) throws TransferObjectException;\n\n\t/**\n\t * To rest info.\n\t * \n\t * @param regla\n\t * the regla\n\t * @return the regla dto\n\t * @throws TransferObjectException\n\t * the transfer object exception\n\t */\n\tReglaDTO toRestInfo(Regla regla) throws TransferObjectException;\n}",
"public AnuncioDTO ObtenerAnuncioID(int id){\n AnuncioDTO anuncioDTO=null;\n try{\n Connection conect = getConection();\n Properties sqlProp = new Properties();\n InputStream is = new FileInputStream(sqlPropertiesPath);\n sqlProp.load(is);\n PreparedStatement ps = conect.prepareStatement(sqlProp.getProperty(\"getById.Anuncio\"));\n ps.setInt(1, id);\n ResultSet rs = ps.executeQuery();\n while(rs.next()){\n \n TipoAnuncio tipoAnuncio = TipoAnuncio.valueOf(rs.getString(2));\n String titulo = rs.getString(3);\n String cuerpo = rs.getString(4);\n Date fechaPublicacion = new Date(rs.getDate(5).getTime());\n Date fechaFin=null;\n if(tipoAnuncio.equals(TipoAnuncio.Flash)){\n fechaFin = new Date(rs.getDate(6).getTime());\n }\n String emailPropietario = rs.getString(7);\n EstadoAnuncio estadoAnuncio = EstadoAnuncio.valueOf(rs.getString(8));\n \n ArrayList<String>temas = null;\n if(tipoAnuncio.equals(TipoAnuncio.Tematico))\n temas=new ArrayList<String>(Arrays.asList(rs.getString(9).split(\",\")));\n\n ArrayList<String>destinatarios = ObtenerDestinatariosAnuncio(id);\n anuncioDTO= new AnuncioDTO(id, tipoAnuncio, titulo, cuerpo, fechaPublicacion, fechaFin, emailPropietario, estadoAnuncio, temas, destinatarios);\n }\n }catch(Exception e){\n e.printStackTrace();\n }\n return anuncioDTO;\n }",
"public MarcaDTO(MarcaEntity marcaEntity) {\n if (marcaEntity != null) {\n this.id = marcaEntity.getId();\n this.nombreMarca = marcaEntity.getNombreMarca();\n this.logo = marcaEntity.getLogo();\n }\n }",
"public DTOSalida obtenerCanalesPlantillas(DTOBelcorp dto) throws MareException\n { \n UtilidadesLog.info(\"DAOGestionComisiones.obtenerCanalesPlantillas(DTOBelcorp dto): Entrada\");\n StringBuffer query = new StringBuffer();\n RecordSet rs = new RecordSet();\n DTOSalida dtos = new DTOSalida();\n BelcorpService bs = UtilidadesEJB.getBelcorpService(); \n query.append(\" SELECT DISTINCT A.CANA_OID_CANA OID, B.VAL_I18N DESCRIPCION \");\n query.append(\" FROM COM_PLANT_COMIS A, V_GEN_I18N_SICC B \"); \n query.append(\" WHERE \");\n query.append(\" A.CEST_OID_ESTA = \" + ConstantesCOM.ESTADO_ACTIVO + \" AND \"); \n query.append(\" B.ATTR_ENTI = 'SEG_CANAL' AND \"); \n query.append(\" B.ATTR_NUM_ATRI = 1 AND \"); \n query.append(\" B.IDIO_OID_IDIO = \" + dto.getOidIdioma() + \" AND \");\n query.append(\" B.VAL_OID = A.CANA_OID_CANA \");\n query.append(\" ORDER BY DESCRIPCION \"); \n UtilidadesLog.debug(query.toString()); \n try {\n rs = bs.dbService.executeStaticQuery(query.toString());\n if(rs != null)\n dtos.setResultado(rs);\n }catch (Exception e) {\n UtilidadesLog.error(e);\n throw new MareException(e, UtilidadesError.armarCodigoError(CodigosError.ERROR_DE_ACCESO_A_BASE_DE_DATOS));\n } \n UtilidadesLog.info(\"DAOGestionComisiones.obtenerCanalesPlantillas(DTOBelcorp dto): Salida\");\n return dtos;\n }",
"public AboutUsDataDTO() {\n\t\tsuper();\n\t}",
"public static LivreurDto Mapper(LivreurEntity livreur) {\n\t\t\n\t\t\tLivreurDto livDto = new LivreurDto();\n\t\t\tlivDto.setNom(livreur.getNom());\n\t\t\tlivDto.setPrenom(livreur.getPrenom());\n\t\t\tlivDto.setEmail(livreur.getEmail());\n\t\t\tlivDto.setTelephone(livreur.getTelephone());\n\t\t\tlivDto.setCodeLivreur(livreur.getCodeLivreur());\n\t\t\t\n\t\t\tList<LivraisonDto> listLivrs = new ArrayList<LivraisonDto>();\n\t\t\tlivreur.getLivraisons().forEach(livraison->{\n\t\t\t\tlistLivrs.add(LivraisonEntity.Mapper(livraison));\n\t\t\t});\n\t\t\tlivDto.setLivraisons(listLivrs);\n\t\t\t\n\t\t\treturn livDto;\n\t}",
"public DTOSalida obtenerDescripcionesPlantillas(DTOBelcorp dto) throws MareException\n { \n UtilidadesLog.info(\"DAOGestionComisiones.obtenerDescripcionesPlantillas(DTOBelcorp dto): Entrada\");\n StringBuffer query = new StringBuffer();\n RecordSet rs = new RecordSet();\n DTOSalida dtos = new DTOSalida();\n \n BelcorpService bs = UtilidadesEJB.getBelcorpService(); \n UtilidadesLog.debug(\"UtilidadesEJB.getBelcorpService() .... [OK]\");\n query.append(\" SELECT A.OID_PLAN_COMI OID, B.VAL_I18N DESCRIPCION \");\n query.append(\" FROM COM_PLANT_COMIS A, V_GEN_I18N_SICC B \"); \n query.append(\" WHERE \");\n //query.append(\" A.ESTA_OID_ESTA = \" + ConstantesCOM.ESTADO_ACTIVO + \" AND \");\n query.append(\" A.CEST_OID_ESTA = \" + ConstantesCOM.ESTADO_ACTIVO + \" AND \");\n query.append(\" B.ATTR_ENTI = 'COM_PLANT_COMIS' AND \"); \n query.append(\" B.ATTR_NUM_ATRI = 1 AND \"); \n query.append(\" B.IDIO_OID_IDIO = \" + dto.getOidIdioma() + \" AND \");\n query.append(\" B.VAL_OID = A.OID_PLAN_COMI \");\n query.append(\" ORDER BY DESCRIPCION \"); \n UtilidadesLog.debug(query.toString()); \n try {\n rs = bs.dbService.executeStaticQuery(query.toString());\n if(rs != null)\n dtos.setResultado(rs);\n }catch (Exception e) {\n UtilidadesLog.error(e);\n throw new MareException(e, UtilidadesError.armarCodigoError(CodigosError.ERROR_DE_ACCESO_A_BASE_DE_DATOS));\n } \n UtilidadesLog.info(\"DAOGestionComisiones.obtenerDescripcionesPlantillas(DTOBelcorp dto): Salida\");\n return dtos; \n }",
"@Mapper(componentModel = \"spring\", uses = {})\npublic interface TipoTelaMapper {\n\n @Mapping(source = \"direccionamientoTela.id\", target = \"direccionamientoTelaId\")\n @Mapping(source = \"direccionamientoTela.nombre\", target = \"direccionamientoTelaNombre\")\n TipoTelaDTO tipoTelaToTipoTelaDTO(TipoTela tipoTela);\n\n @Mapping(source = \"direccionamientoTelaId\", target = \"direccionamientoTela\")\n @Mapping(target = \"telaCrudas\", ignore = true)\n TipoTela tipoTelaDTOToTipoTela(TipoTelaDTO tipoTelaDTO);\n\n default DireccionamientoTela direccionamientoTelaFromId(Long id) {\n if (id == null) {\n return null;\n }\n DireccionamientoTela direccionamientoTela = new DireccionamientoTela();\n direccionamientoTela.setId(id);\n return direccionamientoTela;\n }\n}",
"DireccionDTO consultarDireccion(long idDireccion);",
"public UserDto() {\n }",
"public FloorDto floorToDto(Floor floor) {\n List<Integer> roomIdList = new ArrayList<>();\n for (Room room : floor.getRooms()) {\n roomIdList.add(room.getId());\n }\n return new FloorDto(\n floor.getId(),\n floor.getName(),\n floor.getImage(),\n roomIdList\n );\n }",
"public default D toDto(E entity) {\n\t\tif (entity == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn DtoUtilService.staticDtoFromEntity(getDtoClass(), entity);\n\t\t}\n\t}",
"public List<PersonaDTO> consultarPersonas() ;",
"@Override\n\tpublic ExamDTO toDto(Exam exam) {\n\t\treturn null;\n\t}",
"public TRPEALTADOMICEVTY wrappAltaDomicilio(DomicilioTipoBean domicilio){\n\t\tMapper mapper = dozerBeanMapper;\n return mapper.map(domicilio, TRPEALTADOMICEVTY.class,\"altaDomicilioPersona\");\t\t\n\t}",
"public PaperDTO() {\n }",
"public AlumnoDTO fromAlumnoToAlumnoDTO(Alumno alumno) {\n\t\tAlumnoDTO dto = new AlumnoDTO();\n\t\tdto.setPaymentDate(alumno.getPaymentDate());\n\t\tdto.setPagos(alumno.getPagos());\n\n\t\treturn dto;\n\t}",
"public List<UniteeDto> listerUniteeNavale() {\n\n\t\t// INITIALISATIONS\n\t\tList<UniteeDto> listeUniteeNavale = new ArrayList<>();\n\n\t\t// RECHERCHE DES UNITES (Type 5)\n\t\tfor (Unitee unitee : uniteeRepo.findByIdTypeUnitee(5)) {\n\t\t\tUniteeDto uniteeDto = new UniteeDto();\n\t\t\tuniteeDto.setId(unitee.getId());\n\t\t\tuniteeDto.setIdTypeUnitee(unitee.getIdTypeUnitee());\n\t\t\tuniteeDto.setIdBatimentProvenance(unitee.getIdBatimentProvenance());\n\t\t\tuniteeDto.setIcone(unitee.getIcone());\n\t\t\tuniteeDto.setLibelle(unitee.getLibelle());\n\t\t\tuniteeDto.setDescriptif(unitee.getDescriptif());\n\t\t\tuniteeDto.setCoutPierreFormation(unitee.getCoutPierreFormation());\n\t\t\tuniteeDto.setCoutBoisFormation(unitee.getCoutBoisFormation());\n\t\t\tuniteeDto.setCoutOrFormation(unitee.getCoutOrFormation());\n\t\t\tuniteeDto.setCoutNourritureFormation(unitee.getCoutNourritureFormation());\n\t\t\tuniteeDto.setCoutHumain(unitee.getCoutHumain());\n\t\t\tuniteeDto.setTempsFormation(unitee.getTempsFormation());\n\t\t\tuniteeDto.setVie(unitee.getVie());\n\t\t\tuniteeDto.setAttaque(unitee.getAttaque());\n\t\t\tuniteeDto.setPortee(unitee.getPortee());\n\t\t\tuniteeDto.setArmure(unitee.getArmure());\n\t\t\tuniteeDto.setVitesse(unitee.getVitesse());\n\t\t\tuniteeDto.setNiveauBatimentNecessaireFormation(unitee.getNiveauBatimentNecessaireFormation());\n\t\t\tuniteeDto.setApportRessourcePierreHeure(unitee.getApportRessourcePierreHeure());\n\t\t\tuniteeDto.setApportRessourceBoisHeure(unitee.getApportRessourceBoisHeure());\n\t\t\tuniteeDto.setApportRessourceOrHeure(unitee.getApportRessourceOrHeure());\n\t\t\tuniteeDto.setApportRessourceNourritureHeure(unitee.getApportRessourceNourritureHeure());\n\t\t\tuniteeDto.setApportExperience(unitee.getApportExperience());\n\n\t\t\t// AJOUT AU TABLEAU\n\t\t\tlisteUniteeNavale.add(uniteeDto);\n\t\t}\n\n\t\t// RETOUR\n\t\treturn listeUniteeNavale;\n\t}",
"protected void populateDto(Utente dto, ResultSet rs) throws SQLException\n\t{\n\t\tdto.setUteId( rs.getLong( COLUMN_UTE_ID ) );\n\t\tdto.setUteCognome( rs.getString( COLUMN_UTE_COGNOME ) );\n\t\tdto.setUteNome( rs.getString( COLUMN_UTE_NOME ) );\n\t\tdto.setUteEmail( rs.getString( COLUMN_UTE_EMAIL ) );\n\t\tdto.setUtePassword( rs.getString( COLUMN_UTE_PASSWORD ) );\n\t\tdto.setUteLastLogin( rs.getDate(COLUMN_UTE_LAST_LOGIN ) );\n\t\tdto.setUteCellulare( rs.getString( COLUMN_UTE_CELLULARE ) );\n\t\tdto.setUteSesso( rs.getString( COLUMN_UTE_SESSO ) );\n\t\tdto.setUteDataNascita( rs.getDate(COLUMN_UTE_DATA_NASCITA ) );\n\t\tdto.setUteTitolo( rs.getLong( COLUMN_UTE_TITOLO ) );\n\t\tdto.setFkPaesi( rs.getLong( COLUMN_FK_PAESI ) );\n\t\tdto.setUteCartaNumero( rs.getString( COLUMN_UTE_CARTA_NUMERO ) );\n\t\tdto.setUteCartaTitolare( rs.getString( COLUMN_UTE_CARTA_TITOLARE ) );\n\t\tdto.setUteCartaScadMese( rs.getString( COLUMN_UTE_CARTA_SCAD_MESE ) );\n\t\tdto.setUteCartaScadAnno( rs.getString( COLUMN_UTE_CARTA_SCAD_ANNO ) );\n\t\tdto.setUteCartaUsaPerLav( rs.getString( COLUMN_UTE_CARTA_USA_PER_LAV ) );\n\t\tdto.setUteCartaUsaPerPremio( rs.getString( COLUMN_UTE_CARTA_USA_PER_PREMIO ) );\n\t\tdto.setUteTipologia( rs.getLong( COLUMN_UTE_TIPOLOGIA ) );\n\t\tif (rs.wasNull()) {\n\t\t\tdto.setUteTipologiaNull( true );\n\t\t}\n\t\t\n\t\tdto.setUteIndirizzo( rs.getString( COLUMN_UTE_INDIRIZZO ) );\n\t\tdto.setFkComune( rs.getLong( COLUMN_FK_COMUNE ) );\n\t\tif (rs.wasNull()) {\n\t\t\tdto.setFkComuneNull( true );\n\t\t}\n\t\t\n\t\tdto.setUteAzienda( rs.getString( COLUMN_UTE_AZIENDA ) );\n\t\tdto.setFkComuneAzienda( rs.getLong( COLUMN_FK_COMUNE_AZIENDA ) );\n\t\tif (rs.wasNull()) {\n\t\t\tdto.setFkComuneAziendaNull( true );\n\t\t}\n\t\t\n\t\tdto.setUteTelefonoAzienda( rs.getString( COLUMN_UTE_TELEFONO_AZIENDA ) );\n\t\tdto.setUtePivaAzienda( rs.getString( COLUMN_UTE_PIVA_AZIENDA ) );\n\t\tdto.setUteFotoProfiloPath( rs.getString( COLUMN_UTE_FOTO_PROFILO_PATH ) );\n\t\tdto.setUtePagamentiOnline( rs.getString( COLUMN_UTE_PAGAMENTI_ONLINE ) );\n\t\tdto.setUteQuandoPagare( rs.getString( COLUMN_UTE_QUANDO_PAGARE ) );\n\t\tdto.setUteFumatore( rs.getString( COLUMN_UTE_FUMATORE ) );\n\t\tdto.setUtenteStelle( rs.getString( COLUMN_UTENTE_STELLE ) );\n\t\tdto.setUteCamereOspitiDisabili( rs.getString( COLUMN_UTE_CAMERE_OSPITI_DISABILI ) );\n\t\tdto.setUteRistorante( rs.getString( COLUMN_UTE_RISTORANTE ) );\n\t\tdto.setUteConnessioneInternet( rs.getString( COLUMN_UTE_CONNESSIONE_INTERNET ) );\n\t\tdto.setUteCameraNonfumatori( rs.getString( COLUMN_UTE_CAMERA_NONFUMATORI ) );\n\t\tdto.setUtePalestra( rs.getString( COLUMN_UTE_PALESTRA ) );\n\t\tdto.setUteCamereFamiliari( rs.getString( COLUMN_UTE_CAMERE_FAMILIARI ) );\n\t\tdto.setUteAnimali( rs.getString( COLUMN_UTE_ANIMALI ) );\n\t\tdto.setUteParcheggio( rs.getString( COLUMN_UTE_PARCHEGGIO ) );\n\t\tdto.setUteSpaBenessere( rs.getString( COLUMN_UTE_SPA_BENESSERE ) );\n\t\tdto.setUteWifi( rs.getString( COLUMN_UTE_WIFI ) );\n\t\tdto.setUtePiscinaCoperta( rs.getString( COLUMN_UTE_PISCINA_COPERTA ) );\n\t\tdto.setUteNavettaAeroportuale( rs.getString( COLUMN_UTE_NAVETTA_AEROPORTUALE ) );\n\t\tdto.setUteConnessioneWifiGratuita( rs.getString( COLUMN_UTE_CONNESSIONE_WIFI_GRATUITA ) );\n\t\tdto.setUteBar( rs.getString( COLUMN_UTE_BAR ) );\n\t\tdto.setUteDepositoBagagli( rs.getString( COLUMN_UTE_DEPOSITO_BAGAGLI ) );\n\t\tdto.setUteReception24ore( rs.getString( COLUMN_UTE_RECEPTION24ORE ) );\n\t\tdto.setUtePerChiPrenoti( rs.getString( COLUMN_UTE_PER_CHI_PRENOTI ) );\n\t\tdto.setFkPreferenzaValuta( rs.getLong( COLUMN_FK_PREFERENZA_VALUTA ) );\n\t\tif (rs.wasNull()) {\n\t\t\tdto.setFkPreferenzaValutaNull( true );\n\t\t}\n\t\t\n\t\tdto.setUteCartaTipo( rs.getInt( COLUMN_UTE_CARTA_TIPO ) );\n\t\tif (rs.wasNull()) {\n\t\t\tdto.setUteCartaTipoNull( true );\n\t\t}\n\t\t\n\t\tdto.setUteCap( rs.getString( COLUMN_UTE_CAP ) );\n\t\tdto.setUteCapAzienda( rs.getString( COLUMN_UTE_CAP_AZIENDA ) );\n\t}",
"public OrderDTO toDto( Order order ) {\n\t\treturn transform.orderToDto( order );\n\t}",
"@GetMapping\n\tpublic List<SalasDto> lista() {\n\n\t\tList<Salas> sala = salaRepository.findAll();\n\t\treturn SalasDto.converter(sala);\n\t}",
"private IngredienteDTO converteIngredienteEntityEmDTO(final IngredienteEntity ingredienteEntity) {\n\n IngredienteDTO ingredienteDTO = new IngredienteDTO();\n\n ingredienteDTO.setCodigoIngrediente(ingredienteEntity.getCodigoIngrediente());\n ingredienteDTO.setNomeIngrediente(ingredienteEntity.getNomeIngrediente());\n ingredienteDTO.setValorIngrediente(ingredienteDTO.getValorIngrediente());\n\n return ingredienteDTO;\n }",
"public BillDto(Date date,float totalCost,Long id){\n this.date=date;\n this.totalCost=totalCost;\n this.id=id;\n }",
"public interface ImportarPolizaDTO {\r\n\t\r\n\t/**\r\n\t * Execute.\r\n\t *\r\n\t * @param importDTO the import DTO\r\n\t * @param idSector the id sector\r\n\t * @param idUser the id user\r\n\t * @return the poliza import DTO\r\n\t */\r\n\tPolizaImportDTO execute(PolizaImportDTO importDTO, Integer idSector, String idUser);\r\n\t\r\n\t/**\r\n\t * Export reports.\r\n\t *\r\n\t * @param importDTO the import DTO\r\n\t * @param tipo the tipo\r\n\t * @return the poliza import DTO\r\n\t */\r\n\tPolizaImportDTO exportReports(PolizaImportDTO importDTO, String tipo);\r\n\t\r\n\t\r\n\t/**\r\n\t * Generate excel.\r\n\t *\r\n\t * @param importDTO the import DTO\r\n\t * @return the poliza import DTO\r\n\t */\r\n\tPolizaImportDTO generateExcel(PolizaImportDTO importDTO);\r\n\t\r\n\t/**\r\n\t * Generate head.\r\n\t *\r\n\t * @param importDTO the import DTO\r\n\t * @return the list\r\n\t */\r\n\tList<PolizaExcelDTO> generateHead(PolizaImportDTO importDTO);\r\n\t\r\n\t/**\r\n\t * Generate body.\r\n\t *\r\n\t * @param importDTO the import DTO\r\n\t * @return the list\r\n\t */\r\n\tList<PolizaBody> generateBody(PolizaImportDTO importDTO);\r\n\t\r\n\t/**\r\n\t * Gets the path.\r\n\t *\r\n\t * @param cvePath the cve path\r\n\t * @return the path\r\n\t */\r\n\tString getPath(String cvePath);\r\n\t\r\n\t/**\r\n\t * Gets the mes activo.\r\n\t *\r\n\t * @param idSector the id sector\r\n\t * @return the mes activo\r\n\t */\r\n\tList<String> getMesActivo(Integer idSector);\r\n\r\n}",
"public AlumnoDTO fromAlumnoToAlumnoDTO(Alumno alumno) {\n\t\tAlumnoDTO dto = new AlumnoDTO();\n\t\tdto.setMensajes(alumno.getMensajes());\n\t\treturn dto;\n\t}",
"public ViviendaDetailDTO(ViviendaEntity viviendaEntity) {\r\n super(viviendaEntity);\r\n if (viviendaEntity != null) {\r\n\r\n if (viviendaEntity.getContratos() != null) {\r\n contratos = new ArrayList<>();\r\n for (ContratoEntity entityContrato : viviendaEntity.getContratos()){\r\n contratos.add(new ContratoDTO(entityContrato));\r\n }\r\n }\r\n\r\n if (viviendaEntity.getCuartos() != null) {\r\n cuartos = new ArrayList<>();\r\n for(CuartoEntity entityCuarto : viviendaEntity.getCuartos()){\r\n cuartos.add(new CuartoDTO(entityCuarto));\r\n }\r\n }\r\n\r\n if (viviendaEntity.getSitiosDeInteres() != null){\r\n sitiosDeInteres = new ArrayList<>();\r\n for(SitioInteresEntity sitioEntity : viviendaEntity.getSitiosDeInteres()){\r\n sitiosDeInteres.add(new SitioInteresDTO(sitioEntity));\r\n }\r\n }\r\n\r\n if(viviendaEntity.getCalificaciones() != null ){\r\n calificaciones = new ArrayList<>();\r\n for(CalificacionEntity calificacionEntity : viviendaEntity.getCalificaciones()){\r\n calificaciones.add(new CalificacionDTO(calificacionEntity));\r\n }\r\n }\r\n\r\n if(viviendaEntity.getServiciosAdicionales() != null){\r\n serviciosAdicionales = new ArrayList<>();\r\n for (ServicioAdicionalEntity servicioEntity : viviendaEntity.getServiciosAdicionales()){\r\n serviciosAdicionales.add(new ServicioAdicionalDTO(servicioEntity));\r\n }\r\n }\r\n\r\n if(viviendaEntity.getServiciosIncluidos() != null){\r\n serviciosOfrecidos = new ArrayList<>();\r\n for (String servicio : viviendaEntity.getServiciosIncluidos()){\r\n serviciosOfrecidos.add(servicio);\r\n }\r\n }\r\n }\r\n }",
"List<TotalCarritoDTO> getTotalCarritoCompras(String userName,TipoMoneda tipoMoneda);",
"@Mapper(componentModel = \"spring\")\npublic interface PedidoMapper {\n\t\n\t@AfterMapping\n\tdefault void afterMapping(@MappingTarget PedidoDTO target, Pedido source) {\n\t\t\n\t\tFloat totalIVA = new Float(0);\n\t\tFloat totalDomicilio = new Float(0);\n\t\tFloat totalNeto = new Float(0);\n\t\t\n\t\tif(source.getEstado().equals(Constantes.ESTADO_PEDIDO_ACTIVO))\n\t\t{\n\t\t\ttarget.setEstadoString(Constantes.ESTADO_PEIDIDO_ACTIVO_STRING);\n\t\t\ttotalIVA = new Float(target.getSubtotal() * 0.19);\n\t\t\ttotalDomicilio = target.getSubtotal() >= Constantes.VALOR_MINIMO_PARA_COBRO_DE_DOMICILIO && target.getSubtotal() <= Constantes.VALOR_MAXIMO_PARA_COBRO_DE_DOMICILIO ? new Float(target.getSubtotal() * 0.05) : new Float(0);\n\t\t\ttotalNeto = target.getSubtotal() + totalIVA + totalDomicilio;\n\t\t}\n\t\telse if (source.getEstado().equals(Constantes.ESTADO_PEDIDO_CANCELADO))\n\t\t{\n\t\t\ttarget.setEstadoString(Constantes.ESTADO_PEDIDO_CANCELADO_STRING);\n\t\t\ttotalNeto = new Float(target.getSubtotal() * 0.10);\n\t\t}\t\t \n\t\t\n\t\t\n\t\ttarget.setTotalIVA(totalIVA);\n\t\ttarget.setTotalDomicilio(totalDomicilio);\n\t\ttarget.setTotalNeto(totalNeto);\n\t}\n\t\n\t@Mapping(source = \"entity.idUsuario.idUsuario\", target = \"idUsuario\")\n\t@Mapping(source = \"entity.idUsuario.nombre\", target = \"nombreUsuario\")\n\t@Mapping(source = \"entity.fechaCreacion\", target = \"fechaCreacion\", dateFormat = Constantes.DATE_AND_TIME_FORMAT_WITH_MINUTES)\n\t@Mapping(source = \"entity.estado\", target = \"estado\")\n\t@Mapping(target = \"idProductosConcatenados\", ignore = true)\n\t@Mapping(target = \"totalIVA\", ignore = true)\n\t@Mapping(target = \"totalDomicilio\", ignore = true)\n\t@Mapping(target = \"totalNeto\", ignore = true)\n\t@Mapping(target = \"codigoRespuesta\", ignore = true)\n\t@Mapping(target = \"mensajeRespuesta\", ignore = true)\n\t@Mapping(target = \"estadoString\", ignore = true)\n\tpublic PedidoDTO transformEntityToDTO(Pedido entity);\n\t\n\t@Mapping(source = \"DTO.idUsuario\", target = \"idUsuario.idUsuario\")\n\t@Mapping(source = \"DTO.fechaCreacion\", target = \"fechaCreacion\", dateFormat = Constantes.DATE_AND_TIME_FORMAT_WITH_MINUTES)\n\t@Mapping(source = \"DTO.estado\", target = \"estado\")\n\tpublic Pedido transformDTOToEntity(PedidoDTO DTO);\n\t\n\tpublic List<PedidoDTO> transformEntitiesToDTO(List<Pedido> listEntities);\n\t\n\tpublic List<Pedido> transformDTOToEntities(List<Pedido> listDTO);\n\n}",
"private List<RobaDto> robaDtoMapper(\n Result<Record7<Integer, String, String, BigDecimal, String, Integer, String>> robaRecords\n ) {\n return robaRecords.stream()\n .map(robaRecord -> RobaDto\n .builder()\n .robaid(robaRecord.component1().longValue())\n .katbr(robaRecord.component2())\n .naziv(robaRecord.component3())\n .stanje(robaRecord.component4() != null ? robaRecord.component4().doubleValue() : 0)\n .grupa(robaRecord.component5())\n .podGrupa(robaRecord.component6())\n .proizvodjac(Proizvodjac.builder().proid(robaRecord.component7()).build())\n .build()\n ).collect(Collectors.toList());\n }",
"public PropertySellerDetailDTO() {\n\n\t}",
"public CoordinadorDTO(CoordinadorEntity coordinadorEntity) {\n this.id_coodinador = coordinadorEntity.getId_coordinador();\n this.nombres = coordinadorEntity.getNombres();\n this.apellidos = coordinadorEntity.getApellidos();\n this.genero = coordinadorEntity.getGenero();\n this.email = coordinadorEntity.getEmail();\n this.tipo_documento_id = coordinadorEntity.getTipoDocumento();\n this.nro_documento = coordinadorEntity.getNro_documento();\n }",
"public static ActualityDTO mapActualityToDto(Actuality actuality) {\n\n if (Objects.isNull(actuality)) {\n return null;\n }\n\n ActualityDTO actualityDTO = new ActualityDTO();\n\n actualityDTO.setId(actuality.getId());\n actualityDTO.setTitle(actuality.getTitle());\n\n SimpleDateFormat format = new SimpleDateFormat(\"yyyy/MM/dd\");\n actualityDTO.setCreatedOn(format.format(actuality.getCreatedOn()));\n actualityDTO.setDescription(actuality.getDescription());\n actualityDTO.setImgPath(actuality.getImgPath());\n actualityDTO.setFullUrl(actuality.getFullUrl());\n actualityDTO.setTotalClicked(actuality.getTotalClicked());\n\n return actualityDTO;\n\n }",
"public PessoaDto toPessoaDTO(Pessoa pessoa) {\n\t\tPessoaDto pessoaDto = new PessoaDto(pessoa.getId(), pessoa.getNome(), pessoa.getEmail(),\n\t\t\t\tpessoa.getDataNascimento(), pessoa.getSituacao(), pessoa.getEnderecos(), pessoa.getPerfils());\n\t\tif (pessoa.getCaminhoImagem() != null) {\n\t\t\tString nomeImagem = getNameImage(pessoa.getCaminhoImagem());\n\t\t\tpessoaDto.setImagem(\n\t\t\t\t\tnew Imagem(nomeImagem, getTipoImage(nomeImagem), getImageBase64(pessoa.getCaminhoImagem())));\n\t\t} else\n\t\t\tpessoaDto.setImagem(new Imagem());\n\t\treturn pessoaDto;\n\n\t}",
"public NameDTO() {\r\n this.firstName = \"\";\r\n this.lastName = \"\";\r\n }",
"public TaskDetailDto() {\n\t\tsuper();\n\t\tid = 0;\n\t\tproject = \"\";\n\t\tnameTask = \"\";\n\t\tstatus = \"\";\n\t\tasign = \"\";\n\t\tpriority = \"\";\n\t\tdueDate = null;\n\t\toriginalEstimate = null;\n\t\tdecription = \"\";\n\t\tstartDate = null;\n\t\tendDate = null;\n\t\tcreateBy = \"\";\n\t\tcreateOn = null;\n\t\tmodifyBy = \"\";\n\t\tmodifyOn = null;\n\t\tmodifyById = null;\n\t\tcreateById = null;\n\t\tasignId = null;\n\t}",
"@Override\n\tpublic Medico createMedicoFromDto(MedicoDTO medicoDto) {\n\t\treturn null;\n\t}",
"public void grabarUsuario(UsuarioDto dto){\n\t\tUsuario usuario = new Usuario();\n\t\t\n\t\t// Setarle los valores que vienen del dto\n\t\tusuario.setNombre(dto.getNombre());\n\t\tusuario.setApellido(dto.getApellido());\n\t\t\n\t\t// Grabo el producto\n\t\tusuarioDao.saveOrUpdate(usuario);\n\t\t\n\t\tlog.info(\"Se grabó el producto: \" + usuario.getId());\n\t\t\n\t\t// Le seto el id en el dto\n\t\tdto.setId(usuario.getId());\n\t}",
"@Override\n\tpublic BaseFWDTOImpl toDTO() {\n\t\treturn null;\n\t}",
"public SellerDTO() {\n\t\t\n\t}",
"ConsultaDto<ProdutorVO> obterByNomeApelido(String nomeApelido, Integer idInstituicao, int pagina, int tamanhoPagina) throws BancoobException;",
"public TicketDto convertTicketDto(Ticket ticket) {\r\n\t\tTicketDto ticketDto = new TicketDto(ticket.getTicketId(),ticket.getNoOfSeats(),ticket.getSeatIds(),ticket.getScreenName());\r\n\t\treturn ticketDto;\r\n\t}",
"public FilmTypeDto convertEntityToDto(FilmType entity){\n\t\tFilmTypeDto dto = new FilmTypeDto();\n\t\tif(entity!=null){\n\t\t\tdto.setId(entity.getId());\n\t\t\tdto.setVersion(entity.getVersion());\n\t\t\tdto.setDescription(entity.getDescription());\n\t\t}\n\t\treturn dto;\n\t}",
"public CalMetasDTO leerRegistro() {\n/* */ try {\n/* 56 */ CalMetasDTO reg = new CalMetasDTO();\n/* 57 */ reg.setCodigoCiclo(this.rs.getInt(\"codigo_ciclo\"));\n/* 58 */ reg.setCodigoPlan(this.rs.getInt(\"codigo_plan\"));\n/* 59 */ reg.setCodigoMeta(this.rs.getInt(\"codigo_meta\"));\n/* 60 */ reg.setCodigoObjetivo(this.rs.getInt(\"codigo_objetivo\"));\n/* 61 */ reg.setDescripcion(this.rs.getString(\"descripcion\"));\n/* 62 */ reg.setJustificacion(this.rs.getString(\"justificacion\"));\n/* 63 */ reg.setValorMeta(this.rs.getDouble(\"valor_meta\"));\n/* 64 */ reg.setTipoMedicion(this.rs.getString(\"tipo_medicion\"));\n/* 65 */ reg.setFuenteDato(this.rs.getString(\"fuente_dato\"));\n/* 66 */ reg.setAplicaEn(this.rs.getString(\"aplica_en\"));\n/* 67 */ reg.setUnidadMedida(this.rs.getString(\"unidad_medida\"));\n/* 68 */ reg.setValorMinimo(this.rs.getDouble(\"valor_minimo\"));\n/* 69 */ reg.setValorMaximo(this.rs.getDouble(\"valor_maximo\"));\n/* 70 */ reg.setMes01(this.rs.getString(\"mes01\"));\n/* 71 */ reg.setMes02(this.rs.getString(\"mes02\"));\n/* 72 */ reg.setMes03(this.rs.getString(\"mes03\"));\n/* 73 */ reg.setMes04(this.rs.getString(\"mes04\"));\n/* 74 */ reg.setMes05(this.rs.getString(\"mes05\"));\n/* 75 */ reg.setMes06(this.rs.getString(\"mes06\"));\n/* 76 */ reg.setMes07(this.rs.getString(\"mes07\"));\n/* 77 */ reg.setMes08(this.rs.getString(\"mes08\"));\n/* 78 */ reg.setMes09(this.rs.getString(\"mes09\"));\n/* 79 */ reg.setMes10(this.rs.getString(\"mes10\"));\n/* 80 */ reg.setMes11(this.rs.getString(\"mes11\"));\n/* 81 */ reg.setMes12(this.rs.getString(\"mes12\"));\n/* 82 */ reg.setEstado(this.rs.getString(\"estado\"));\n/* 83 */ reg.setTipoGrafica(this.rs.getString(\"tipo_grafica\"));\n/* 84 */ reg.setFechaInsercion(this.rs.getString(\"fecha_insercion\"));\n/* 85 */ reg.setUsuarioInsercion(this.rs.getString(\"usuario_insercion\"));\n/* 86 */ reg.setFechaModificacion(this.rs.getString(\"fecha_modificacion\"));\n/* 87 */ reg.setUsuarioModificacion(this.rs.getString(\"usuario_modificacion\"));\n/* 88 */ reg.setNombreTipoMedicion(this.rs.getString(\"nombreTipoMedicion\"));\n/* 89 */ reg.setNombreEstado(this.rs.getString(\"nombreEstado\"));\n/* 90 */ reg.setNombreUnidadMedida(this.rs.getString(\"nombre_unidad_medida\"));\n/* */ \n/* */ try {\n/* 93 */ reg.setNumeroAcciones(this.rs.getInt(\"acciones\"));\n/* */ }\n/* 95 */ catch (Exception e) {}\n/* */ \n/* */ \n/* */ \n/* 99 */ return reg;\n/* */ }\n/* 101 */ catch (Exception e) {\n/* 102 */ e.printStackTrace();\n/* 103 */ Utilidades.writeError(\"CalPlanMetasFactory:leerRegistro \", e);\n/* */ \n/* 105 */ return null;\n/* */ } \n/* */ }",
"private CategoryDTO getCategoryDto(){\n\t\tCategoryDTO category = new CategoryDTO(Long.valueOf(1L), \"categoryName\", \"categoryDesc\");\n\t\treturn category;\n\t}",
"public ClienteDTO(String direcDirecCliente, String codubigeoDirecCliente,\r\n\t\t\tint idTipoEstablec) {\r\n\t\tsuper();\r\n\t\tthis.direcDirecCliente = direcDirecCliente;\r\n\t\tthis.codubigeoDirecCliente = codubigeoDirecCliente;\r\n\t\tthis.idTipoEstablec = idTipoEstablec;\r\n\t}",
"public ProjectDto(Project project){\n this.id = project.getId();\n this.name = project.getName();\n this.company = new CompanyDto(project.getCompany());\n this.start_date = project.getStart_date();\n this.status = project.getStatus();\n }",
"public GetAllCarsDTO() {\n }"
] | [
"0.692277",
"0.66467726",
"0.6524982",
"0.6517216",
"0.6443716",
"0.64289594",
"0.6413875",
"0.6356729",
"0.6293222",
"0.6253046",
"0.6206516",
"0.61567676",
"0.6125778",
"0.61162764",
"0.6073799",
"0.6054566",
"0.6027176",
"0.60161686",
"0.59892654",
"0.5988002",
"0.5987312",
"0.5968502",
"0.5953125",
"0.59438753",
"0.59287935",
"0.59161866",
"0.5903967",
"0.5903127",
"0.58971184",
"0.58624554",
"0.5854417",
"0.5851926",
"0.5817712",
"0.58170015",
"0.58014804",
"0.5786568",
"0.577202",
"0.57632965",
"0.5760713",
"0.57598007",
"0.57528085",
"0.5752261",
"0.5730284",
"0.568106",
"0.56800485",
"0.56745136",
"0.56610334",
"0.56594104",
"0.5632232",
"0.562676",
"0.5623258",
"0.56211525",
"0.5619025",
"0.5616514",
"0.5614808",
"0.5614102",
"0.5610779",
"0.56077486",
"0.5604827",
"0.5598878",
"0.5597415",
"0.55963534",
"0.55781084",
"0.55773807",
"0.5571955",
"0.55641556",
"0.55628175",
"0.5559877",
"0.5559815",
"0.5559086",
"0.5554435",
"0.5549951",
"0.5548519",
"0.55347794",
"0.5531279",
"0.55250335",
"0.5513349",
"0.55130285",
"0.55051017",
"0.5499406",
"0.5497748",
"0.5496962",
"0.5496697",
"0.5492254",
"0.5491855",
"0.5487638",
"0.5485378",
"0.5482215",
"0.5475938",
"0.5473415",
"0.5471847",
"0.5471267",
"0.5465947",
"0.5465711",
"0.54623413",
"0.54606944",
"0.54605275",
"0.5456935",
"0.54518706",
"0.54484683"
] | 0.5456099 | 98 |
/ returns a string of its children types (nonJavadoc) | public Object visitReturnStmt(GoIRReturnStmtNode node) {
return node.getChild().accept(this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String treeType();",
"public String getTreeType();",
"String getTypeAsString();",
"String getFullName() {\r\n StringBuffer buf = new StringBuffer(type.getName());\r\n Summary current = type.getParent();\r\n\r\n while (current != null) {\r\n if (current instanceof TypeSummary) {\r\n buf.insert(0, \".\");\r\n buf.insert(0, ((TypeSummary)current).getName());\r\n } else if (current instanceof PackageSummary) {\r\n String temp = ((PackageSummary)current).getName();\r\n\r\n if ((temp != null) && (temp.length() > 0)) {\r\n buf.insert(0, \".\");\r\n buf.insert(0, temp);\r\n }\r\n }\r\n current = current.getParent();\r\n }\r\n\r\n return buf.toString();\r\n }",
"@Override\n\tpublic String toString()\n\t{\n\t\t//Builds the html looking string.\n\t\tStringBuilder builder = new StringBuilder();\n\t\tbuilder.append(\"<\").append(type.toString().toLowerCase());\n\t\tfor(Entry<String, String> attrEntry : attributes.entrySet())\n\t\t{\n\t\t\tbuilder.append(\" \")\n\t\t\t\t.append(attrEntry.getKey())\n\t\t\t\t.append(\"=\")\n\t\t\t\t.append(attrEntry.getValue());\n\t\t}\n\t\tbuilder.append(\">\");\n\t\tif(getText() != null)\n\t\t{\n\t\t\tbuilder.append(\"\\n\").append(getText()).append(\"\\n\");\n\t\t}\n\t\t//Append each of the children.\n\t\tfor(HtmlTag child : getChildren())\n\t\t{\n\t\t\tbuilder.append(child.toString().replaceAll(\"(?m)^\", \" \"));\n\t\t}\n\t\t//Append the closing tag.\n\t\tbuilder.append(\"\\n</\").append(type.toString().toLowerCase()).append(\">\");\n\t\treturn builder.toString();\n\t}",
"@JsonIgnore\n public List<String> getAncestorTypeNames() {\n if(ancestorDefs != null && !ancestorDefs.isEmpty()) {\n return ancestorDefs.values().stream().map(type -> type.asTypeString()).collect(Collectors.toList());\n } else if (ancestors != null) {\n return ancestors;\n } else {\n return new ArrayList<>();\n }\n }",
"public interface Type {\n String getName();\n String getFullyQualifiedName();\n String getDocumentation();\n List<Option> getOptions();\n List<Type> getNestedTypes();\n}",
"List<Tag<? extends Type>> getChildren();",
"public String toString(){\n String str = \"\";\n for(int i = level; i>0; i--){\n str+=\"\\t\";\n }\n str += getClass().toString();\n if(noOfChildren != 0){\n str+=\" containing\\n\";\n for (int i = 0; i<this.noOfChildren; i++)\n str += getChild(i).toString();\n }\n else{\n str+=\"\\n\";\n }\n return str;\n }",
"java.lang.String getSubType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"@Override\r\n\tpublic String toString() {\r\n\t\treturn name + \" \" + Arrays.toString(types);\r\n\t}",
"private static String getTypeDescription(ClassNode c, boolean end) {\n StringBuffer buf = new StringBuffer();\n ClassNode d = c;\n while (true) {\n if (isPrimitiveType(d)) {\n char car;\n if (d == int_TYPE) {\n car = 'I';\n } else if (d == VOID_TYPE) {\n car = 'V';\n } else if (d == boolean_TYPE) {\n car = 'Z';\n } else if (d == byte_TYPE) {\n car = 'B';\n } else if (d == char_TYPE) {\n car = 'C';\n } else if (d == short_TYPE) {\n car = 'S';\n } else if (d == double_TYPE) {\n car = 'D';\n } else if (d == float_TYPE) {\n car = 'F';\n } else /* long */ {\n car = 'J';\n }\n buf.append(car);\n return buf.toString();\n } else if (d.isArray()) {\n buf.append('[');\n d = d.getComponentType();\n } else {\n buf.append('L');\n String name = d.getName();\n int len = name.length();\n for (int i = 0; i < len; ++i) {\n char car = name.charAt(i);\n buf.append(car == '.' ? '/' : car);\n }\n if (end) buf.append(';');\n return buf.toString();\n }\n }\n }",
"public String typesToString()\n\t{\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\tif(contents instanceof Variable<?>[])\n\t\t{\n\t\t\tfor(E c : contents)\n\t\t\t{\n\t\t\t\tsb.append(((Variable<?>) c).getType().toString() + \", \");\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor(E c : contents)\n\t\t\t{\n\t\t\t\tsb.append(c.getClass().toString() + \", \");\n\t\t\t}\n\t\t}\n\n\t\treturn \"StackTypes [\" + sb.toString() + \"]\";\n\t}",
"public abstract String getTypeName();",
"public java.lang.String getContainingParentType() {\n return containingParentType;\n }",
"DataTree getDatatypeHierarchy();",
"String typeName();",
"@Override\n public String toString() {\n return metaObject.getType().toString();\n }",
"public String getTypeName();",
"public String getTypeName();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"@Override\n\tpublic String toString() {\n\t\treturn level+\":\"+title + \":\"+refId+\"::\"+childElems;\n\t}",
"ISourceType getEnclosingType();",
"public java.lang.String getContainingParentType() {\n return containingParentType;\n }",
"public final String getTopLevelType() {\n return this.type;\n }",
"private Content getTreeForClassHelper(Type type) {\n Content li = new HtmlTree(HtmlTag.LI);\n if (type.equals(classDoc)) {\n Content typeParameters = getTypeParameterLinks(\n new LinkInfoImpl(configuration, LinkInfoImpl.Kind.TREE,\n classDoc));\n if (configuration.shouldExcludeQualifier(\n classDoc.containingPackage().name())) {\n li.addContent(type.asClassDoc().name());\n li.addContent(typeParameters);\n } else {\n li.addContent(type.asClassDoc().qualifiedName());\n li.addContent(typeParameters);\n }\n } else {\n Content link = getLink(new LinkInfoImpl(configuration,\n LinkInfoImpl.Kind.CLASS_TREE_PARENT, type)\n .label(configuration.getClassName(type.asClassDoc())));\n li.addContent(link);\n }\n return li;\n }",
"public static String getTypeDescription(ClassNode c) {\n return getTypeDescription(c, true);\n }",
"public String getTypeName() {\n if (isStatic()) {\n JavaType.FullyQualified fq = TypeUtils.asFullyQualified(qualid.getType());\n\n // the compiler doesn't type attribute static imports of classes\n if (fq == null) {\n String possibleInnerClassFqn = getTypeName(qualid);\n String possibleInnerClassName = possibleInnerClassFqn.substring(possibleInnerClassFqn.lastIndexOf('$') + 1);\n if (\"*\".equals(possibleInnerClassName)) {\n return possibleInnerClassFqn.substring(0, possibleInnerClassFqn.lastIndexOf('$'));\n }\n while (possibleInnerClassName.indexOf('$') >= 0) {\n possibleInnerClassName = possibleInnerClassName.substring(possibleInnerClassName.indexOf('$') + 1);\n }\n\n JavaType.Class owner = TypeUtils.asClass(qualid.getTarget().getType());\n if (owner != null && !(qualid.getTarget().getType() instanceof JavaType.ShallowClass)) {\n Iterator<JavaType.Method> visibleMethods = owner.getVisibleMethods();\n while (visibleMethods.hasNext()) {\n JavaType.Method method = visibleMethods.next();\n if (method.getName().equals(possibleInnerClassName)) {\n return possibleInnerClassFqn.substring(0, possibleInnerClassFqn.lastIndexOf('$'));\n }\n }\n\n Iterator<JavaType.Variable> visibleMembers = owner.getVisibleMembers();\n while (visibleMembers.hasNext()) {\n JavaType.Variable member = visibleMembers.next();\n if (member.getName().equals(possibleInnerClassName)) {\n return possibleInnerClassFqn.substring(0, possibleInnerClassFqn.lastIndexOf('$'));\n }\n }\n\n return possibleInnerClassFqn;\n }\n }\n\n return getTypeName((FieldAccess) qualid.getTarget());\n }\n\n return getTypeName(qualid);\n }",
"public String getParentType() {\n return this.parentType;\n }",
"public String getTypeFacets() {\n final List<String> typeFacets = new LinkedList<>();\n if (mItem.Folder != null) {\n typeFacets.add(mItem.Folder.getClass().getSimpleName());\n }\n if (mItem.File != null) {\n typeFacets.add(mItem.File.getClass().getSimpleName());\n }\n if (mItem.Audio != null) {\n typeFacets.add(mItem.Audio.getClass().getSimpleName());\n }\n if (mItem.Image != null) {\n typeFacets.add(mItem.Image.getClass().getSimpleName());\n }\n if (mItem.Photo != null) {\n typeFacets.add(mItem.Photo.getClass().getSimpleName());\n }\n if (mItem.SpecialFolder != null) {\n typeFacets.add(mItem.SpecialFolder.getClass().getSimpleName());\n }\n if (mItem.Video != null) {\n typeFacets.add(mItem.Video.getClass().getSimpleName());\n }\n final String joiner = \", \";\n final StringBuilder sb = new StringBuilder();\n for (final String facet : typeFacets) {\n sb.append(facet);\n sb.append(joiner);\n }\n sb.delete(sb.lastIndexOf(joiner), sb.length());\n\n return sb.toString();\n }",
"protected abstract String getType();",
"abstract public String getType();",
"private String getType( )\n\t{\n\t\treturn this.getModuleName( ) + \"$\" + this.getSimpleName( ) + \"$\" + this.getSystem( );\n\t}",
"public abstract String getType();",
"public abstract String getType();",
"public abstract String getType();",
"public abstract String getType();",
"public abstract String getType();",
"public abstract String getType();",
"public abstract String getType();",
"public abstract String getType();",
"public String getUnusedChildren();",
"public String toString() {\n return type.toString();\n }",
"public String getQualifiedName()\n {\n return name + \".\" + type;\n }",
"@NonNull\n public List<String> getParentTypes() {\n List<String> parentTypes = mBundle.getStringArrayList(AppSearchSchema.PARENT_TYPES_FIELD);\n if (parentTypes == null) {\n return Collections.emptyList();\n }\n return Collections.unmodifiableList(parentTypes);\n }",
"public String getSubType() {\n return typeString;\n }",
"@Override\n\tpublic String toString() {\n\t\treturn type;\n\t}",
"public String toString() {\r\n return \"Type: Text\";\r\n }",
"java.util.List<org.mojolang.mojo.lang.NominalType> \n getInheritsList();",
"private String getTypeName(Type node) {\n\t\tif (node.isArrayType()) {\n\t\t\tArrayType type = (ArrayType) node;\n\t\t\treturn getTypeName(type.getComponentType());\n\t\t}\n\t\t//if it's parameterized, get the argument type and continue judgment\n\t\telse if (node.isParameterizedType()) {\n\t\t\tParameterizedType type = (ParameterizedType) node;\n\t\t\tfor (Object o: type.typeArguments()) {\n\t\t\t\tType t = (Type)o;\n\t\t\t\treturn getTypeName(t);\n\t\t\t}\n\t\t}\n\t\t//if it's a simple type\n\t\telse if (node.isSimpleType()) {\n\t\t\treturn node.toString();\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"List<GWTJahiaNodeType> getContentTypes(List<String> baseTypes, boolean includeSubTypes, boolean displayStudioElement) throws GWTJahiaServiceException;"
] | [
"0.65876085",
"0.65306294",
"0.6427166",
"0.63612795",
"0.6183714",
"0.618299",
"0.6148939",
"0.6110059",
"0.60929996",
"0.608889",
"0.5996594",
"0.5996594",
"0.5996594",
"0.5996594",
"0.5996594",
"0.5996594",
"0.5996594",
"0.5996594",
"0.5996594",
"0.5996594",
"0.5996594",
"0.5996594",
"0.5996594",
"0.59932154",
"0.5987799",
"0.5981957",
"0.5978449",
"0.5911548",
"0.5897603",
"0.5870788",
"0.5858627",
"0.5839535",
"0.5839535",
"0.5838417",
"0.5838417",
"0.5838417",
"0.5838417",
"0.5838417",
"0.5838417",
"0.5838417",
"0.5838417",
"0.5838417",
"0.5838417",
"0.5838417",
"0.5838417",
"0.5838417",
"0.5838417",
"0.5838417",
"0.5838417",
"0.5838417",
"0.5838417",
"0.5838417",
"0.5838417",
"0.5838417",
"0.5838417",
"0.5838417",
"0.5838417",
"0.5838417",
"0.5807409",
"0.5807409",
"0.5807409",
"0.5807409",
"0.5807409",
"0.5807409",
"0.5807409",
"0.5807409",
"0.5807409",
"0.5807409",
"0.5807409",
"0.5807409",
"0.5807409",
"0.58038616",
"0.58007246",
"0.5790316",
"0.5784753",
"0.5768567",
"0.57552534",
"0.57536834",
"0.5750898",
"0.5741358",
"0.5739925",
"0.5739702",
"0.5736405",
"0.57356864",
"0.57356864",
"0.57356864",
"0.57356864",
"0.57356864",
"0.57356864",
"0.57356864",
"0.57356864",
"0.57271415",
"0.57213914",
"0.57066417",
"0.56914395",
"0.5691042",
"0.5675697",
"0.56709915",
"0.56687814",
"0.5651889",
"0.5650859"
] | 0.0 | -1 |
/ returns a string of its return types (nonJavadoc) | public Object visitInvoke(GoIRInvokeNode node){
String b = "";
GoIRFuncTypeNode t = GoTruffle.IRFunctions.get(node.getFunctionNode().getIdentifier());
if(t != null) {
b = (String) t.getResults().accept(this);
}
return b;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String getReturnType();",
"TypeDescription getReturnType();",
"public Type getReturnType() {\n/* 227 */ return Type.getReturnType(this.desc);\n/* */ }",
"public String getReturnType() {\n return returnType;\n }",
"@Override\n public String getReturnType() {\n Object ref = returnType_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n returnType_ = s;\n return s;\n }\n }",
"public List<String> getReturnTypes() {\n if (returnTypes.isEmpty()) {\n return Lists.newArrayList(\"void\");\n } else {\n return new ArrayList<>(returnTypes);\n }\n }",
"public String getReturnType() {\n Object ref = returnType_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n returnType_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }",
"public ITypeInfo getReturnType();",
"com.google.protobuf.ByteString\n getReturnTypeBytes();",
"String getTypeAsString();",
"public String getReturnType() {\n return returnType;\n }",
"Type getReturnType();",
"public String getReturnType() {\n\t\treturn returnType;\n\t}",
"public String returnType() {\n return this.data.returnType();\n }",
"Type getReturnType () { return return_type; }",
"@Override\n\t/**\n\t * returns a String \"no\" because a class does not have a data or return type\n\t * \n\t * @return \"no\"\n\t */\n\tpublic String getReturnType() {\n\t\treturn \"no\";\n\t}",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"public String getReturnType() {\n String type;\r\n if (this.getTypeIdentifier() != null) { //Collection<Entity> , Collection<String>\r\n type = this.getTypeIdentifier().getVariableType();\r\n } else {\r\n type = classHelper.getClassName();\r\n }\r\n\r\n if ((this.getTypeIdentifier() == null\r\n || getRelation() instanceof SingleRelationAttributeSnippet)\r\n && functionalType) {\r\n if (isArray(type)) {\r\n type = \"Optional<\" + type + '>';\r\n } else {\r\n type = \"Optional<\" + getWrapperType(type) + '>';\r\n }\r\n }\r\n return type;\r\n }",
"public abstract int[] getReturnTypes();",
"public String type();",
"public char[] getReturnTypeName() {\n return returnTypeName;\n }",
"public String returnKind(){ return kind; }",
"private static String getMethodSignature(Class[] paramTypes, Class retType) {\n StringBuffer sbuf = new StringBuffer();\n sbuf.append('(');\n for (int i = 0; i < paramTypes.length; i++) {\n sbuf.append(getClassSignature(paramTypes[i]));\n }\n sbuf.append(')');\n sbuf.append(getClassSignature(retType));\n return sbuf.toString();\n }",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"@Override\n public com.google.protobuf.ByteString\n getReturnTypeBytes() {\n Object ref = returnType_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n returnType_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public String resultTypes() {\n return \"\";//NOI18N\n }",
"public String methodReturn() {\n\t\t\n\t\treturn \"Executing a method which returns a String Text\";\n\t}",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"public String getRetType(String signature) {\n String[] tokens = (signature.split(\"\\\\s\"));\n return tokens[0];\n }",
"public com.google.protobuf.ByteString\n getReturnTypeBytes() {\n Object ref = returnType_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n returnType_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public String getTypesSummary() throws Exception {\n\t\treturn this.xqueryUtil.getTypesSummary();\n\t}",
"public Type[] getReturnTypes() {\n \t\treturn actualReturnTypes;\n \t}",
"@Override\n\t/**\n\t * does nothing for classes as they do not have return types or data types\n\t */\n\tpublic void setReturnType(String s) {\n\n\t}",
"String getResultClass();",
"public String getReturnType(String methodName) {\n\t\tif (this.isValidMethod(methodName))\n\t\t\treturn this.validMethods.get(methodName);\n\t\telse\n\t\t\treturn \"\";\n\t}",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();"
] | [
"0.7997034",
"0.69696295",
"0.6814218",
"0.6729022",
"0.66805387",
"0.6664279",
"0.66641986",
"0.6652956",
"0.6647478",
"0.6646296",
"0.66123104",
"0.6553741",
"0.6521927",
"0.6480535",
"0.64619774",
"0.64106226",
"0.6381355",
"0.6381355",
"0.6381355",
"0.6381355",
"0.6381355",
"0.6381355",
"0.6381355",
"0.6381355",
"0.6381355",
"0.6381355",
"0.6381355",
"0.6381355",
"0.6381355",
"0.6381355",
"0.6381355",
"0.6381355",
"0.6381355",
"0.6381355",
"0.6381355",
"0.6381355",
"0.63600826",
"0.6341944",
"0.6314661",
"0.6295999",
"0.62695163",
"0.62188154",
"0.61645675",
"0.61645675",
"0.61645675",
"0.61645675",
"0.61645675",
"0.61645675",
"0.61645675",
"0.61645675",
"0.61645675",
"0.61645675",
"0.61645675",
"0.61645675",
"0.61645675",
"0.6162137",
"0.6152885",
"0.61314344",
"0.6094658",
"0.6094658",
"0.6094658",
"0.6094658",
"0.6094658",
"0.6094658",
"0.6094658",
"0.6094658",
"0.6094658",
"0.6094658",
"0.6094658",
"0.6094658",
"0.6094658",
"0.6094658",
"0.6094658",
"0.6094658",
"0.6094658",
"0.6094658",
"0.6094658",
"0.6094658",
"0.6094658",
"0.6094658",
"0.6094658",
"0.6094658",
"0.6094658",
"0.6069402",
"0.6054613",
"0.60216516",
"0.5976874",
"0.5936442",
"0.593557",
"0.5864351",
"0.5860901",
"0.5860901",
"0.5860901",
"0.5860901",
"0.5860901",
"0.5860901",
"0.5860901",
"0.5860901",
"0.5860901",
"0.5860901",
"0.5860901"
] | 0.0 | -1 |
/ returns a concatenation of types by "," from its children (nonJavadoc) | public Object visitArrayListExpr(GoIRArrayListExprNode node) {
String z = "";
if(node != null) {
ArrayList<GoBaseIRNode> children = node.getChildren();
if(children != null) {
for(int i = 0 ; i < children.size(); i ++) {
z += children.get(i).accept(this);
if(i < children.size() -1) {
z += ",";
}
}
}
}
return z;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String getFullName() {\r\n StringBuffer buf = new StringBuffer(type.getName());\r\n Summary current = type.getParent();\r\n\r\n while (current != null) {\r\n if (current instanceof TypeSummary) {\r\n buf.insert(0, \".\");\r\n buf.insert(0, ((TypeSummary)current).getName());\r\n } else if (current instanceof PackageSummary) {\r\n String temp = ((PackageSummary)current).getName();\r\n\r\n if ((temp != null) && (temp.length() > 0)) {\r\n buf.insert(0, \".\");\r\n buf.insert(0, temp);\r\n }\r\n }\r\n current = current.getParent();\r\n }\r\n\r\n return buf.toString();\r\n }",
"public String getTypeFacets() {\n final List<String> typeFacets = new LinkedList<>();\n if (mItem.Folder != null) {\n typeFacets.add(mItem.Folder.getClass().getSimpleName());\n }\n if (mItem.File != null) {\n typeFacets.add(mItem.File.getClass().getSimpleName());\n }\n if (mItem.Audio != null) {\n typeFacets.add(mItem.Audio.getClass().getSimpleName());\n }\n if (mItem.Image != null) {\n typeFacets.add(mItem.Image.getClass().getSimpleName());\n }\n if (mItem.Photo != null) {\n typeFacets.add(mItem.Photo.getClass().getSimpleName());\n }\n if (mItem.SpecialFolder != null) {\n typeFacets.add(mItem.SpecialFolder.getClass().getSimpleName());\n }\n if (mItem.Video != null) {\n typeFacets.add(mItem.Video.getClass().getSimpleName());\n }\n final String joiner = \", \";\n final StringBuilder sb = new StringBuilder();\n for (final String facet : typeFacets) {\n sb.append(facet);\n sb.append(joiner);\n }\n sb.delete(sb.lastIndexOf(joiner), sb.length());\n\n return sb.toString();\n }",
"public String typesToString()\n\t{\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\tif(contents instanceof Variable<?>[])\n\t\t{\n\t\t\tfor(E c : contents)\n\t\t\t{\n\t\t\t\tsb.append(((Variable<?>) c).getType().toString() + \", \");\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor(E c : contents)\n\t\t\t{\n\t\t\t\tsb.append(c.getClass().toString() + \", \");\n\t\t\t}\n\t\t}\n\n\t\treturn \"StackTypes [\" + sb.toString() + \"]\";\n\t}",
"@Override\r\n\tpublic String getDisplayString(String[] children) {\n\t\treturn \"concatenation \" + children;\r\n\t}",
"@JsonIgnore\n public List<String> getAncestorTypeNames() {\n if(ancestorDefs != null && !ancestorDefs.isEmpty()) {\n return ancestorDefs.values().stream().map(type -> type.asTypeString()).collect(Collectors.toList());\n } else if (ancestors != null) {\n return ancestors;\n } else {\n return new ArrayList<>();\n }\n }",
"@Override\r\n\tpublic String toString() {\r\n\t\treturn name + \" \" + Arrays.toString(types);\r\n\t}",
"public String getLinkedTags (String parent) {\n StringBuilder linkedTags = new StringBuilder();\n int i = 0;\n int s = getTagStart(i);\n while (s >= 0 && s < tags.length()) {\n if (i > 0) {\n linkedTags.append(\", \");\n }\n linkedTags.append(getLinkedTag (i, parent));\n i++;\n s = getTagStart(i); \n }\n return linkedTags.toString();\n }",
"public static String getAll(){\n\t\tEntityType[] values = values();\n\t\tString readableString = \"\";\n\t\t\n\t\tfor (int i=0; i<values.length; i++){\n\t\t\treadableString += values[i].toString();\n\t\t\tif (i < values.length) {\n\t\t\t\treadableString += \", \";\n\t\t\t} else {\n\t\t\t\treadableString += \".\";\n\t\t\t}\n\t\t}\n\t\treturn readableString;\n\t}",
"public String saveTypesAsXML(TextLabels labels) {\n\t\tStringBuffer buf = new StringBuffer(\"<extractions>\\n\");\n\t\tfor (Iterator i=labels.getTypes().iterator(); i.hasNext(); ) {\n\t\t\tString type = (String)i.next();\n\t\t\tfor (Span.Looper j=labels.instanceIterator(type); j.hasNext(); ) {\n\t\t\t\tSpan s = j.nextSpan();\n\t\t\t\tint lo = s.getTextToken(0).getLo();\n\t\t\t\tint hi = s.getTextToken(s.size()-1).getHi();\n\t\t\t\tbuf.append(\" <\"+type+\" lo=\"+lo+\" hi=\"+hi+\">\"+s.asString()+\"</\"+type+\">\\n\");\n\t\t\t}\n\t\t}\n\t\tbuf.append(\"</extractions>\\n\");\n\t\treturn buf.toString();\n\t}",
"private static String getTypeDescription(ClassNode c, boolean end) {\n StringBuffer buf = new StringBuffer();\n ClassNode d = c;\n while (true) {\n if (isPrimitiveType(d)) {\n char car;\n if (d == int_TYPE) {\n car = 'I';\n } else if (d == VOID_TYPE) {\n car = 'V';\n } else if (d == boolean_TYPE) {\n car = 'Z';\n } else if (d == byte_TYPE) {\n car = 'B';\n } else if (d == char_TYPE) {\n car = 'C';\n } else if (d == short_TYPE) {\n car = 'S';\n } else if (d == double_TYPE) {\n car = 'D';\n } else if (d == float_TYPE) {\n car = 'F';\n } else /* long */ {\n car = 'J';\n }\n buf.append(car);\n return buf.toString();\n } else if (d.isArray()) {\n buf.append('[');\n d = d.getComponentType();\n } else {\n buf.append('L');\n String name = d.getName();\n int len = name.length();\n for (int i = 0; i < len; ++i) {\n char car = name.charAt(i);\n buf.append(car == '.' ? '/' : car);\n }\n if (end) buf.append(';');\n return buf.toString();\n }\n }\n }",
"@Override\n public ImmutableList<String> getTypeParts() {\n return types.toImmutable();\n }",
"public static NodeValue strConcat(List<NodeValue> args) {\n // Step 1 : Choose type.\n // One lang tag -> that lang tag\n String lang = null ;\n boolean mixedLang = false ;\n boolean xsdString = false ;\n boolean simpleLiteral = false ;\n\n StringBuilder sb = new StringBuilder() ;\n\n for (NodeValue nv : args) {\n Node n = checkAndGetStringLiteral(\"CONCAT\", nv) ;\n String lang1 = n.getLiteralLanguage() ;\n if ( !lang1.equals(\"\") ) {\n if ( lang != null && !lang1.equals(lang) )\n // throw new\n // ExprEvalException(\"CONCAT: Mixed language tags: \"+args) ;\n mixedLang = true ;\n lang = lang1 ;\n } else if ( n.getLiteralDatatype() != null )\n xsdString = true ;\n else\n simpleLiteral = true ;\n\n sb.append(n.getLiteralLexicalForm()) ;\n }\n\n if ( mixedLang )\n return NodeValue.makeString(sb.toString()) ;\n\n // Must be all one lang.\n if ( lang != null ) {\n if ( !xsdString && !simpleLiteral )\n return NodeValue.makeNode(sb.toString(), lang, (String)null) ;\n else\n // Lang and one or more of xsd:string or simpleLiteral.\n return NodeValue.makeString(sb.toString()) ;\n }\n\n if ( simpleLiteral && xsdString )\n return NodeValue.makeString(sb.toString()) ;\n // All xsdString\n if ( xsdString )\n return NodeValue.makeNode(sb.toString(), XSDDatatype.XSDstring) ;\n if ( simpleLiteral )\n return NodeValue.makeString(sb.toString()) ;\n\n // No types - i.e. no arguments\n return NodeValue.makeString(sb.toString()) ;\n }",
"private Content getTreeForClassHelper(Type type) {\n Content li = new HtmlTree(HtmlTag.LI);\n if (type.equals(classDoc)) {\n Content typeParameters = getTypeParameterLinks(\n new LinkInfoImpl(configuration, LinkInfoImpl.Kind.TREE,\n classDoc));\n if (configuration.shouldExcludeQualifier(\n classDoc.containingPackage().name())) {\n li.addContent(type.asClassDoc().name());\n li.addContent(typeParameters);\n } else {\n li.addContent(type.asClassDoc().qualifiedName());\n li.addContent(typeParameters);\n }\n } else {\n Content link = getLink(new LinkInfoImpl(configuration,\n LinkInfoImpl.Kind.CLASS_TREE_PARENT, type)\n .label(configuration.getClassName(type.asClassDoc())));\n li.addContent(link);\n }\n return li;\n }",
"@Override\n\tpublic String toString()\n\t{\n\t\t//Builds the html looking string.\n\t\tStringBuilder builder = new StringBuilder();\n\t\tbuilder.append(\"<\").append(type.toString().toLowerCase());\n\t\tfor(Entry<String, String> attrEntry : attributes.entrySet())\n\t\t{\n\t\t\tbuilder.append(\" \")\n\t\t\t\t.append(attrEntry.getKey())\n\t\t\t\t.append(\"=\")\n\t\t\t\t.append(attrEntry.getValue());\n\t\t}\n\t\tbuilder.append(\">\");\n\t\tif(getText() != null)\n\t\t{\n\t\t\tbuilder.append(\"\\n\").append(getText()).append(\"\\n\");\n\t\t}\n\t\t//Append each of the children.\n\t\tfor(HtmlTag child : getChildren())\n\t\t{\n\t\t\tbuilder.append(child.toString().replaceAll(\"(?m)^\", \" \"));\n\t\t}\n\t\t//Append the closing tag.\n\t\tbuilder.append(\"\\n</\").append(type.toString().toLowerCase()).append(\">\");\n\t\treturn builder.toString();\n\t}",
"public String treeType();",
"public String toString() {\n StringBuffer sb = new StringBuffer();\n for (int i = 0; i < numfields; i += 1) {\n String item = \"\" + types[i];\n if (attrNames == null || attrNames[i] == null) {\n sb.append(item).append(\"()\");\n } else {\n sb.append(item).append(\"(\").append(attrNames[i]).append(\")\");\n }\n if (i < numfields-1) {\n sb.append(\",\");\n }\n }\n return sb.toString();\n }",
"ImmutableList<SchemaOrgType> getTextList();",
"public String[] getTypes() {\n/* 388 */ return getStringArray(\"type\");\n/* */ }",
"public interface Type {\n String getName();\n String getFullyQualifiedName();\n String getDocumentation();\n List<Option> getOptions();\n List<Type> getNestedTypes();\n}",
"public String toString(){\n String str = \"\";\n for(int i = level; i>0; i--){\n str+=\"\\t\";\n }\n str += getClass().toString();\n if(noOfChildren != 0){\n str+=\" containing\\n\";\n for (int i = 0; i<this.noOfChildren; i++)\n str += getChild(i).toString();\n }\n else{\n str+=\"\\n\";\n }\n return str;\n }",
"UsedTypes getTypes();",
"List<GWTJahiaNodeType> getContentTypes(List<String> baseTypes, boolean includeSubTypes, boolean displayStudioElement) throws GWTJahiaServiceException;",
"public String getTreeType();",
"private Stream<Element> superTypeForInheritDoc(JavacTask task, Element type) {\n TypeElement clazz = (TypeElement) type;\n Stream<Element> result = interfaces(clazz);\n result = Stream.concat(result, interfaces(clazz).flatMap(el -> superTypeForInheritDoc(task, el)));\n\n if (clazz.getSuperclass().getKind() == TypeKind.DECLARED) {\n Element superClass = ((DeclaredType) clazz.getSuperclass()).asElement();\n result = Stream.concat(result, Stream.of(superClass));\n result = Stream.concat(result, superTypeForInheritDoc(task, superClass));\n }\n\n return result;\n }",
"public String toString()\r\n {\r\n String str = toString(root);\r\n if (str.endsWith(\", \"))\r\n str = str.substring(0, str.length() - 2);\r\n return \"[\" + str + \"]\";\r\n }",
"String getTypeAsString();",
"private String unionTypes(Set<String> types) {\n Set<String> splitTypes = new HashSet<>();\n\n for (String type : types) {\n for (String s : MentionTypeUtils.splitToMultipleTypes(type)) {\n splitTypes.add(MentionTypeUtils.canonicalize(s));\n }\n }\n return MentionTypeUtils.joinMultipleTypes(splitTypes);\n }",
"String getClassTypeVariables() {\n final StringBuilder sb = new StringBuilder();\n if (classTypes.size() > 0) {\n sb.append(\"<\");\n for (int i = 0; i < classTypes.size(); i++) {\n final Class<?> c = classTypes.get(i);\n if (c != null) {\n sb.append(getShortClassName(c));\n if (i < classTypes.size() - 1) {\n sb.append(\", \");\n }\n }\n }\n sb.append(\">\");\n }\n return sb.toString();\n }",
"private Content getClassInheritenceTree(Type type) {\n Type sup;\n HtmlTree classTreeUl = new HtmlTree(HtmlTag.UL);\n classTreeUl.addStyle(HtmlStyle.inheritance);\n Content liTree = null;\n do {\n sup = Util.getFirstVisibleSuperClass(\n type instanceof ClassDoc ? (ClassDoc) type : type.asClassDoc(),\n configuration);\n if (sup != null) {\n HtmlTree ul = new HtmlTree(HtmlTag.UL);\n ul.addStyle(HtmlStyle.inheritance);\n ul.addContent(getTreeForClassHelper(type));\n if (liTree != null)\n ul.addContent(liTree);\n Content li = HtmlTree.LI(ul);\n liTree = li;\n type = sup;\n }\n else\n classTreeUl.addContent(getTreeForClassHelper(type));\n }\n while (sup != null);\n if (liTree != null)\n classTreeUl.addContent(liTree);\n return classTreeUl;\n }",
"@Override\n\tpublic String toString() {\n\t\tswitch(type) {\n\t\tcase CLOSURE : return \"*\";\n\t\tcase CONCATENATION : return \"\";\n\t\tcase LPAREN : return \"(\";\n\t\tcase RPAREN : return \")\";\n\t\tcase UNION : return \"|\";\n\t\tdefault: return value;\n\t\t}\n\t}",
"List<Tag<? extends Type>> getChildren();",
"private ArrayList<String> getJoinedAttributeTypes(List<Table> tables) {\n\t\tArrayList<String> rtn = new ArrayList<String>(); \n\n\t\ttry {\n\t\t\tfor(int iterator = 0; iterator < tables.size(); iterator++) {\n\t\t\t\tTable table = tables.get(iterator);\n\t\t\t\tFile root = new File(\"src\");\n\t\t\t\tURLClassLoader classLoader = URLClassLoader.newInstance(new URL[] { root.toURI().toURL() });\n\t\t\t\tClass<?> cl = Class.forName(table.getName(), true, classLoader);\n\t\t\t\t\n\t\t\t\tField fields[] = cl.getDeclaredFields();\n\t\t\t\tfor(int i = 0; i < fields.length; i++) {\n\t\t\t\t\tField field = fields[i];\n\t\t\t\t\tfield.setAccessible(true);\n\t\t\t\t\trtn.add(field.getType().getName());\n\t\t\t\t\tfield.setAccessible(false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcatch (MalformedURLException e)\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn rtn;\n\t}",
"private static String getAllChildrenAsText(Node parentNode) {\n\t\tStringBuilder builder = new StringBuilder();\n\t\t\n\t\tint numberOfChildren = parentNode.numberOfChildren();\n\t\tfor (int i = 0; i < numberOfChildren; i ++) {\n\t\t\tNode child = parentNode.getChild(i);\n\t\t\tbuilder.append(child.toString());\n\t\t\t\n\t\t\tif (child instanceof ForLoopNode) {\n\t\t\t\tbuilder.append(getAllChildrenAsText(child));\n\t\t\t\tbuilder.append(\"{$ END $}\");\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn builder.toString();\n\t}",
"@Override\n public String toString() { // display subtree in order traversal\n String output = \"[\";\n LinkedList<Node<T>> q = new LinkedList<>();\n q.add(this);\n while(!q.isEmpty()) {\n Node<T> next = q.removeFirst();\n if(next.leftChild != null) q.add(next.leftChild);\n if(next.rightChild != null) q.add(next.rightChild);\n output += next.data.toString();\n if(!q.isEmpty()) output += \", \";\n }\n return output + \"]\";\n }",
"public String flatten() {\n\t\tString data;\n\t\t// We use simple name, because the fleshed out version of this class is\n\t\t// in the default package for data types: de.nec.nle.siafu.data\n\t\tString fullClassName = this.getClass().getName();\n\t\tString className = fullClassName.substring(fullClassName\n\t\t\t\t.lastIndexOf(\".\") + 1);\n\t\tdata = className + \":\";\n\t\tdata += b;\n\t\treturn data;\n\t}",
"Set<String> getBaseTypes();",
"String getExtends();",
"public String getTypesSummary() throws Exception {\n\t\treturn this.xqueryUtil.getTypesSummary();\n\t}",
"@Override\n public String toString() {\n StringBuilder outString = new StringBuilder();\n int currentTreeIndex = this.indexCorrespondingToTheFirstElement;\n if (treeSize > 0) {\n while (currentTreeIndex != -1) {\n Node<T> currentNode = getHelper(currentTreeIndex);\n outString.append(currentNode.data).append(\", \");\n currentTreeIndex = currentNode.nextIndex;\n }\n }\n\n if (outString.length() != 0) {\n outString.deleteCharAt(outString.length() - 1); // \", \"\n outString.deleteCharAt(outString.length() - 1);\n }\n return \"[\" + outString.toString() + \"]\";\n }",
"public List<URI> getType();",
"@Override\n\tpublic Object visit(ASTXQueryComma node, Object data) {\n\t\tnode.jjtGetChild(0).jjtAccept(this, data);\n\t\tSystem.out.println(\",\");\n\t\tnode.jjtGetChild(1).jjtAccept(this, data);\n\t\treturn null;\n\t}",
"InstrumentedType withNestMembers(TypeList nestMembers);",
"java.util.List<org.mojolang.mojo.lang.NominalType> \n getInheritsList();",
"private String getTypeName(Type node) {\n\t\tif (node.isArrayType()) {\n\t\t\tArrayType type = (ArrayType) node;\n\t\t\treturn getTypeName(type.getComponentType());\n\t\t}\n\t\t//if it's parameterized, get the argument type and continue judgment\n\t\telse if (node.isParameterizedType()) {\n\t\t\tParameterizedType type = (ParameterizedType) node;\n\t\t\tfor (Object o: type.typeArguments()) {\n\t\t\t\tType t = (Type)o;\n\t\t\t\treturn getTypeName(t);\n\t\t\t}\n\t\t}\n\t\t//if it's a simple type\n\t\telse if (node.isSimpleType()) {\n\t\t\treturn node.toString();\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"@SuppressWarnings(\"unchecked\")\n private static List getType(Traversable e) {\n if (!(e instanceof Expression)) {\n return null;\n }\n if (e instanceof Identifier) {\n Symbol var = ((Identifier)e).getSymbol();\n if (var == null) {\n return null;\n } else {\n return var.getTypeSpecifiers();\n }\n } else if (e instanceof AccessExpression) {\n return getType(((AccessExpression)e).getRHS());\n } else if (e instanceof ArrayAccess) {\n return getType(((ArrayAccess)e).getArrayName());\n } else if (e instanceof FunctionCall) {\n return getType(((FunctionCall)e).getName());\n } else if (e instanceof Typecast) {\n return new ArrayList(((Typecast)e).getSpecifiers());\n } else if (e instanceof ConditionalExpression) {\n ConditionalExpression ce = (ConditionalExpression)e;\n List specs = getType(ce.getTrueExpression());\n if (specs == null || specs.get(0) == Specifier.VOID) {\n return getType(ce.getFalseExpression());\n } else {\n return specs;\n }\n } else if (e instanceof CommaExpression) {\n List<Traversable> children = e.getChildren();\n return getType((Expression)children.get(children.size() - 1));\n } else { // default behavior: returns the types of the first child\n List<Traversable> children = e.getChildren();\n for (int i = 0; i < children.size(); i++) {\n Traversable child = children.get(i);\n List child_type = getType((Expression)child);\n if (child_type != null) {\n return child_type;\n }\n }\n return null;\n }\n }",
"public String toString() {\n if (subTrees.isEmpty()) return rootToString();\n StringBuilder result = new StringBuilder(rootToString() + \"(\" + subTrees.get(0).toString());\n for (int i = 1; i < subTrees.size(); i++) result.append(\",\").append(subTrees.get(i).toString());\n return result + \")\";\n }",
"@Override\r\n public String toString() {\r\n \r\n StringBuilder sb = new StringBuilder();\r\n HTreeNode listrunner = getHeadNode();\r\n while (listrunner != null) {\r\n sb.append(listrunner.getCharacter());\r\n //no comma after the final element\r\n if (listrunner.getNext() != null) {\r\n sb.append(',');\r\n sb.append(' ');\r\n }\r\n listrunner = listrunner.getNext();\r\n }\r\n return sb.toString();\r\n }",
"@NonNull\n public List<String> getParentTypes() {\n List<String> parentTypes = mBundle.getStringArrayList(AppSearchSchema.PARENT_TYPES_FIELD);\n if (parentTypes == null) {\n return Collections.emptyList();\n }\n return Collections.unmodifiableList(parentTypes);\n }",
"java.lang.String getSubType();",
"List<LightweightTypeReference> getTypeArguments();",
"public String generateNewick() \n { \n \n String newick = new String();\n\n if (type.equals(\"internal\")){\n newick = \"(\";\n }\n \n if (!name.equals(\"\")){\n newick = newick + name;\n }\n \n if (!children.isEmpty()){ //if there are children in this node's arraylist\n Iterator it = children.iterator();\n while(it.hasNext()){\n Node child = (Node) it.next();\n newick = newick + child.generateNewick();\n if(it.hasNext()){\n newick = newick + \",\";\n }\n }\n }\n if (type.equals(\"internal\")){\n newick = newick + \")\";\n }\n if (length >0){\n newick = newick + \":\" + length;\n }\n \n return newick;\n }",
"public String toString ()\n {\n return \"RefDocTypePair(\" + this.fromDocType + \",\" + this.toDocType + \")\";\n }",
"@Override\n\tpublic String toString() {\n\t\treturn level+\":\"+title + \":\"+refId+\"::\"+childElems;\n\t}",
"public String toString() {\n\t\tString output = \"[\";\n\t\t\n\t\tfor (T nodeValue: this) {\n\t\t\tif (output.length() > 1)\t// doesn't add a \", \" at the beginning\n\t\t\t\toutput += \", \";\n\t\t\t\n\t\t\toutput += nodeValue;\n\t\t}\n\t\t\n\t\treturn output += \"]\";\n\t}",
"public String getElementType()\n {\n return elementType;\n }",
"List<ITypeDescriptor> getSubTypes(String type) throws StoreException;",
"@Override\n void buildString(boolean full, StringBuilder sb)\n {\n String sn = PkgUtil.simpleName(clazz);\n if(full)\n {\n String cn = PkgUtil.canonName(clazz);\n sb.append(cn, 0, cn.length()-sn.length());\n }\n buildAnnoString(full, sb);\n sb.append(sn);\n if(typeArgs.isEmpty())\n return;\n sb.append('<');\n for(int i=0; i< typeArgs.size(); i++)\n {\n if(i>0)\n sb.append(',');\n typeArgs.get(i).asRefType().buildString(full, sb);\n }\n sb.append('>');\n }",
"boolean containsAll(String type) {\n boolean containsType = contains(type);\n if (!containsType) {\n for (ASTNode child : children) {\n containsType = child.containsAll(type);\n if (containsType) return true;\n }\n\n // should be false\n return containsType;\n } else return true;\n }",
"private String getCategoriesForDebugging() {\n StringBuilder sb = new StringBuilder();\n String sep = \"\";\n for (SuggestionsSection section : mSections.values()) {\n sb.append(sep);\n sb.append(section.getCategory());\n sep = \", \";\n }\n\n return sb.toString();\n }",
"private String getFields()\n\t{\n\t\tString fields = \"(\";\n\t\t\n\t\tfor(int spot = 0; spot < fieldList.size(); spot++)\n\t\t{\n\t\t\tfields += \"`\" + fieldList.get(spot).getName() + \"`\";\n\t\t\tif(spot == fieldList.size()-1)\n\t\t\t{\n\t\t\t\tfields += \")\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfields += \", \";\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn fields;\n\t}",
"@DerivedProperty\n\t\nSet<CtTypeReference<?>> getReferencedTypes();",
"@Override\n public Object visit(ASTJoinList node, Object data) {\n\t\tint indent = (Integer) data;\n\t\tprintIndent(indent);\n\t\t\n\t\tSystem.out.print(\"[\");\n\t\tint numOfChild = node.jjtGetNumChildren();\n\t\tboolean first = true;\n\t\tfor (int i = 0; i < numOfChild; i++) {\n\t\t\tif (first)\n\t\t\t\tfirst = false;\n\t\t\telse\n\t\t\t\tSystem.out.print(\", \");\n\t\t\tnode.jjtGetChild(i).jjtAccept(this, data);\n\t\t}\n\t\tSystem.out.print(\"]\");\n\t return null;\n }",
"List<Type> getAllTypeList();",
"@Override\n\tpublic Object visit(ASTRelComma node, Object data) {\n\t\tnode.jjtGetChild(0).jjtAccept(this, data);\n\t\tSystem.out.print(\", \");\n\t\tnode.jjtGetChild(1).jjtAccept(this, data);\n\t\treturn null;\n\t}",
"public String toString() {\n Class<? extends AST> tclass = this.getClass();\n // isolate relative name (starting after the rightmost '.')\n String absoluteClassName = tclass.toString();\n int dotIndex = absoluteClassName.lastIndexOf(\".\", absoluteClassName.length());\n String relativeClassName = absoluteClassName.substring(dotIndex+1);\n // retrieving fields (note that, unfortunately, they are not ordered)\n // TO DO : get rid of static fields (pb in case of singletons)\n Field[] fields = tclass.getDeclaredFields();\n // building string representation of the arguments of the nodes\n int arity = fields.length;\n String args = \"\";\n for(int index = 0; index < arity; index++) {\n String arg;\n try {\n arg = fields[index].get(this).toString(); // retrieve string representation of all arguments\n } catch (Exception e) {\n arg = \"?\"; // IllegalArgument or IllegalAccess Exception (this shouldn't happen)\n }\n if (index != 0) // a separator is required before each argument except the first\n args = args + \", \" + arg;\n//\t\t\t\targs = args + \" \" + arg;\n else\n args = args + arg;\n }\n return relativeClassName + \"(\" + args + \")\";\n//\t\treturn \"<\" + relativeClassName + \">\" + args + \"</\" + relativeClassName + \">\";\n }",
"ImmutableList<SchemaOrgType> getAboutList();",
"@Override\n\tpublic String toString() {\n\t\t/*\n\t\t * Just materializing the complete tag map is the simplest implementation.\n\t\t * This is not performance-critical code, so we aim for code simplicity rather than performance.\n\t\t * We are constructing a TreeMap in order to force display in sorted order.\n\t\t */\n\t\tMap<String, Object> sorted = new TreeMap<>();\n\t\tList<Namespace> namespaces = namespaces();\n\t\tfor (Namespace ns : namespaces)\n\t\t\tfor (OwnerTag tag = ns.data.tags; tag != null; tag = tag.next)\n\t\t\t\tsorted.put(ns.name + \".\" + tag.key, tag.value);\n\t\treturn namespaces.stream().map(ns -> ns.name).collect(joining(\".\")) + sorted;\n\t}",
"ImmutableList<SchemaOrgType> getGenreList();",
"@Override\n public String toString(){\n StringBuilder retorno = new StringBuilder(\" ( *\");\n for(INodo descendiente : getDescendientes()){\n retorno.append(descendiente);\n }\n retorno.append(\" )\");\n\n return String.valueOf(retorno);\n }",
"java.lang.String getNested();",
"public String toStringAST()\r\n/* 75: */ {\r\n/* 76: 94 */ StringBuilder s = new StringBuilder();\r\n/* 77: */ \r\n/* 78: 96 */ s.append('{');\r\n/* 79: 97 */ int count = getChildCount();\r\n/* 80: 98 */ for (int c = 0; c < count; c++)\r\n/* 81: */ {\r\n/* 82: 99 */ if (c > 0) {\r\n/* 83:100 */ s.append(',');\r\n/* 84: */ }\r\n/* 85:102 */ s.append(getChild(c).toStringAST());\r\n/* 86: */ }\r\n/* 87:104 */ s.append('}');\r\n/* 88:105 */ return s.toString();\r\n/* 89: */ }",
"@Override\n\tpublic String toString() {\n\t\treturn type;\n\t}",
"@Override\n public String toString() {\n return \"<\"+getType()+\",\"+getOperation()+\">\";\n }",
"public Iterator<String> listUnionClasses()\r\n\t{\r\n\t\treturn new ToStringIterator<String>(ONT_MODEL.listUnionClasses().filterDrop( new Filter() {\r\n public boolean accept( Object o ) {\r\n return ((Resource) o).isAnon();\r\n }} )\r\n );\r\n\t}",
"public String getPartString() { return \"Type\"; }",
"public String toString(){\r\n\t DoubleLinkedSeq clone = new DoubleLinkedSeq(); \r\n\t clone = this.clone();\r\n\t String elements = \"{\";\r\n\t for(clone.cursor = head; clone.cursor != null; clone.cursor = clone.cursor.getLink()){\r\n\t\t elements = elements + (clone.cursor.getData() + \",\"); \r\n\t }\r\n\t \r\n\t elements = elements + \")\";\r\n\t \r\n\t return elements; \r\n }",
"public String toString() {\n String s = \"\";\n\n if (FormEditor.compress) {\n if (domNode.getNodeName().equals(\"concept\")) {\n // s = \"ConceptName\";\n org.w3c.dom.Node name = domNode.getFirstChild();\n\n while ((name != null) && !name.getNodeName().equals(\"name\")) {\n name = name.getNextSibling();\n }\n\n if (name == null) {\n s += \"ConceptName\";\n } else {\n AdapterNode adpNode = new AdapterNode(name);\n s += adpNode.content();\n }\n } else if (domNode.getNodeName().equals(\"conceptList\")) {\n // s = \"ConceptName\";\n org.w3c.dom.Node name = domNode.getFirstChild();\n\n while ((name != null) && !name.getNodeName().equals(\"name\")) {\n name = name.getNextSibling();\n }\n\n if (name == null) {\n s += \"ConceptList\";\n } else {\n AdapterNode adpNode = new AdapterNode(name);\n s += adpNode.content();\n }\n } else if (domNode.getNodeName().equals(\"attribute\")) {\n org.w3c.dom.NamedNodeMap attributeList =\n domNode.getAttributes();\n org.w3c.dom.Node name = attributeList.getNamedItem(\"name\");\n s = name.getNodeValue();\n } else {\n String nodeName = domNode.getNodeName();\n\n if (!nodeName.startsWith(\"#\")) {\n s = nodeName;\n } else {\n s = typeName[domNode.getNodeType()];\n }\n }\n\n return s;\n }\n\n s = typeName[domNode.getNodeType()];\n\n String nodeName = domNode.getNodeName();\n\n if (!nodeName.startsWith(\"#\")) {\n s += (\": \" + nodeName);\n }\n\n if (domNode.getNodeValue() != null) {\n if (s.startsWith(\"ProcInstr\")) {\n s += \", \";\n } else {\n s += \": \";\n }\n\n // Trim the value to get rid of NL's at the front\n String t = domNode.getNodeValue().trim();\n int x = t.indexOf(\"\\n\");\n\n if (x >= 0) {\n t = t.substring(0, x);\n }\n\n s += t;\n }\n\n return s;\n }",
"public static List<String> getAggregateAndInstanceFunctionChilds(String typeChild) {\n\t\tList<String> aggregateList = new ArrayList<>();\n\t\taggregateList.add(\"FIRST\");\n\t\taggregateList.add(\"SECOND\");\n\t\taggregateList.add(\"THIRD\");\n\t\taggregateList.add(\"FOURTH\");\n\t\taggregateList.add(\"FIFTH\");\n\t\taggregateList.add(\"MOST RECENT\");\n\t\tif (\"AGGREGATE\".equals(typeChild)) {\n\t\t\taggregateList.add(\"DATETIMEDIFF\");\n\t\t}\n\t\treturn aggregateList;\n\t}",
"public String getType(String name) {\n/* 164 */ return \"CDATA\";\n/* */ }",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"public String toString() {\n return type.toString();\n }",
"java.util.List<? extends org.mojolang.mojo.lang.NominalTypeOrBuilder> \n getInheritsOrBuilderList();",
"@Override\n\t\tpublic String toString()\n\t\t{\n\t\t\treturn type;\n\t\t}",
"List<Type> getTypeList(String type);",
"public String toString() {\n StringBuilder string = new StringBuilder();\n Iterator<E> i = iterator();\n if (!this.isEmpty()) {\n while (i.hasNext()) {\n string.append(i.next());\n if (i.hasNext()) {\n string.append(\", \");\n }\n }\n }\n return string.toString();\n }",
"ImmutableList<SchemaOrgType> getPublisherList();",
"public void buildAnnotationTypeSummary(XMLNode node, Content summaryContentTree) {\n String annotationtypeTableSummary =\n configuration.getText(\"doclet.Member_Table_Summary\",\n configuration.getText(\"doclet.Annotation_Types_Summary\"),\n configuration.getText(\"doclet.annotationtypes\"));\n String[] annotationtypeTableHeader = new String[] {\n configuration.getText(\"doclet.AnnotationType\"),\n configuration.getText(\"doclet.Description\")\n };\n ClassDoc[] annotationTypes =\n packageDoc.isIncluded()\n ? packageDoc.annotationTypes()\n : configuration.classDocCatalog.annotationTypes(\n Util.getPackageName(packageDoc));\n annotationTypes = Util.filterOutPrivateClasses(annotationTypes, configuration.javafx);\n if (annotationTypes.length > 0) {\n packageWriter.addClassesSummary(\n annotationTypes,\n configuration.getText(\"doclet.Annotation_Types_Summary\"),\n annotationtypeTableSummary, annotationtypeTableHeader,\n summaryContentTree);\n }\n }",
"public static final String m12298a(Type type) {\n String str;\n Object next;\n if (!(type instanceof Class)) {\n return type.toString();\n }\n Class cls = (Class) type;\n if (cls.isArray()) {\n C7668h W0 = C5266a.m9898W0(type, C6749t.f13653p);\n StringBuilder sb = new StringBuilder();\n C6888i.m12438e(W0, \"$this$last\");\n Iterator it = W0.iterator();\n if (it.hasNext()) {\n do {\n next = it.next();\n } while (it.hasNext());\n sb.append(((Class) next).getName());\n sb.append(C7694h.m13942t(\"[]\", C7679s.m13893a(W0)));\n str = sb.toString();\n } else {\n throw new NoSuchElementException(\"Sequence is empty.\");\n }\n } else {\n str = cls.getName();\n }\n C6888i.m12437d(str, \"if (type.isArray) {\\n …\\n } else type.name\");\n return str;\n }",
"private static String classArrayToString(Class[] pts) {\n StringBuilder result = new StringBuilder();\n for (int i = 0; i < pts.length; i++) {\n result.append(getTypeName(pts[i]));\n if (i < pts.length - 1)\n result.append(\",\");\n }\n return result.toString();\n }"
] | [
"0.5857463",
"0.57063127",
"0.5641434",
"0.55275315",
"0.5430238",
"0.53835577",
"0.5379874",
"0.53712225",
"0.53491396",
"0.53076845",
"0.53051096",
"0.5284712",
"0.5270037",
"0.52650106",
"0.5212141",
"0.5196346",
"0.5185463",
"0.5182423",
"0.51142335",
"0.5107967",
"0.50956464",
"0.50833815",
"0.5051964",
"0.5048888",
"0.5045716",
"0.50392693",
"0.5024125",
"0.5020008",
"0.50030607",
"0.49877462",
"0.49874014",
"0.49860725",
"0.4966515",
"0.4964564",
"0.4960595",
"0.49529427",
"0.49516264",
"0.49502668",
"0.49422526",
"0.49226844",
"0.49176827",
"0.48980466",
"0.489245",
"0.48811308",
"0.4877544",
"0.48657125",
"0.4848133",
"0.4845304",
"0.484417",
"0.4813477",
"0.48124263",
"0.48082918",
"0.4806649",
"0.47822312",
"0.4775993",
"0.47745752",
"0.47688237",
"0.47660294",
"0.4761283",
"0.47580364",
"0.47530207",
"0.47423527",
"0.47318757",
"0.47294235",
"0.47279",
"0.47264835",
"0.47263685",
"0.47060063",
"0.47022688",
"0.46956387",
"0.46918198",
"0.46898523",
"0.46874785",
"0.46866786",
"0.4685682",
"0.4683054",
"0.46814865",
"0.46750423",
"0.467308",
"0.4671849",
"0.4671849",
"0.4671849",
"0.4671849",
"0.4671849",
"0.4671849",
"0.4671849",
"0.4671849",
"0.4671849",
"0.4671849",
"0.4671849",
"0.4671849",
"0.4671849",
"0.46700788",
"0.46697676",
"0.46426842",
"0.46412587",
"0.46391407",
"0.46354413",
"0.46287647",
"0.4627881",
"0.4618176"
] | 0.0 | -1 |
/ Returns the arraylistexpr string of types (nonJavadoc) | public Object visitFieldList(GoIRFieldListNode node){
if(node!= null) {
if(node.getFields()!= null) {
return node.getFields().accept(this);
}
}
return "";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String typesToString()\n\t{\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\tif(contents instanceof Variable<?>[])\n\t\t{\n\t\t\tfor(E c : contents)\n\t\t\t{\n\t\t\t\tsb.append(((Variable<?>) c).getType().toString() + \", \");\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor(E c : contents)\n\t\t\t{\n\t\t\t\tsb.append(c.getClass().toString() + \", \");\n\t\t\t}\n\t\t}\n\n\t\treturn \"StackTypes [\" + sb.toString() + \"]\";\n\t}",
"public String toString()\n/* */ {\n/* 210 */ return \"[array type, component type: \" + this._componentType + \"]\";\n/* */ }",
"public String[] getTypes() {\n/* 388 */ return getStringArray(\"type\");\n/* */ }",
"@Override\r\n\tpublic String toString() {\r\n\t\treturn name + \" \" + Arrays.toString(types);\r\n\t}",
"static String[] getAllTypeNames()\n\t{\n\t\treturn new String[] {\"String\", \"int\", \"double\", \"long\", \"boolean\", \"String[]\", \"int[]\", \"double[]\", \"long[]\"};\n\t}",
"public String toString() {\n StringBuffer sb = new StringBuffer();\n for (int i = 0; i < numfields; i += 1) {\n String item = \"\" + types[i];\n if (attrNames == null || attrNames[i] == null) {\n sb.append(item).append(\"()\");\n } else {\n sb.append(item).append(\"(\").append(attrNames[i]).append(\")\");\n }\n if (i < numfields-1) {\n sb.append(\",\");\n }\n }\n return sb.toString();\n }",
"String getTypeAsString();",
"private static String classArrayToString(Class[] pts) {\n StringBuilder result = new StringBuilder();\n for (int i = 0; i < pts.length; i++) {\n result.append(getTypeName(pts[i]));\n if (i < pts.length - 1)\n result.append(\",\");\n }\n return result.toString();\n }",
"private String literal(Array list) {\n StringBuffer buffer = new StringBuffer();\n \n buffer.append(\"(\");\n for (int i = 0; i < list.size(); i++) {\n if (i > 0) {\n buffer.append(\",\");\n }\n buffer.append(literal(list.get(i)));\n }\n buffer.append(\")\");\n return buffer.toString();\n }",
"String getClassTypeVariables() {\n final StringBuilder sb = new StringBuilder();\n if (classTypes.size() > 0) {\n sb.append(\"<\");\n for (int i = 0; i < classTypes.size(); i++) {\n final Class<?> c = classTypes.get(i);\n if (c != null) {\n sb.append(getShortClassName(c));\n if (i < classTypes.size() - 1) {\n sb.append(\", \");\n }\n }\n }\n sb.append(\">\");\n }\n return sb.toString();\n }",
"public String visit(ArrayType n, String argu) {\n return \"ArrayType\"; \n }",
"public static final String[] getSourceTypeList() {\n final SourceType[] types = SourceType.values();\n final String[] displayStrings = new String[types.length];\n for(int i = 0; i < types.length; i++) {\n displayStrings[i] = JMeterUtils.getResString(types[i].propertyName);\n }\n return displayStrings;\n }",
"public static final String m12298a(Type type) {\n String str;\n Object next;\n if (!(type instanceof Class)) {\n return type.toString();\n }\n Class cls = (Class) type;\n if (cls.isArray()) {\n C7668h W0 = C5266a.m9898W0(type, C6749t.f13653p);\n StringBuilder sb = new StringBuilder();\n C6888i.m12438e(W0, \"$this$last\");\n Iterator it = W0.iterator();\n if (it.hasNext()) {\n do {\n next = it.next();\n } while (it.hasNext());\n sb.append(((Class) next).getName());\n sb.append(C7694h.m13942t(\"[]\", C7679s.m13893a(W0)));\n str = sb.toString();\n } else {\n throw new NoSuchElementException(\"Sequence is empty.\");\n }\n } else {\n str = cls.getName();\n }\n C6888i.m12437d(str, \"if (type.isArray) {\\n …\\n } else type.name\");\n return str;\n }",
"private static List<Type> getExprTypes(Expr... args) {\n List<Type> argTypes = new ArrayList<Type> (args.length);\n for (Expr a : args) {\n argTypes.add(a.type());\n }\n return argTypes;\n }",
"public Type[] types();",
"public String getTypeFacets() {\n final List<String> typeFacets = new LinkedList<>();\n if (mItem.Folder != null) {\n typeFacets.add(mItem.Folder.getClass().getSimpleName());\n }\n if (mItem.File != null) {\n typeFacets.add(mItem.File.getClass().getSimpleName());\n }\n if (mItem.Audio != null) {\n typeFacets.add(mItem.Audio.getClass().getSimpleName());\n }\n if (mItem.Image != null) {\n typeFacets.add(mItem.Image.getClass().getSimpleName());\n }\n if (mItem.Photo != null) {\n typeFacets.add(mItem.Photo.getClass().getSimpleName());\n }\n if (mItem.SpecialFolder != null) {\n typeFacets.add(mItem.SpecialFolder.getClass().getSimpleName());\n }\n if (mItem.Video != null) {\n typeFacets.add(mItem.Video.getClass().getSimpleName());\n }\n final String joiner = \", \";\n final StringBuilder sb = new StringBuilder();\n for (final String facet : typeFacets) {\n sb.append(facet);\n sb.append(joiner);\n }\n sb.delete(sb.lastIndexOf(joiner), sb.length());\n\n return sb.toString();\n }",
"@Nonnull\n private static String getJavaClassName( AnyType arrayType ) {\n if( !arrayType.isRefType() ) {\n switch( (ValueType)arrayType ) {\n case bool:\n return \"[Z\";\n case i8:\n return \"[B\";\n case i16:\n return \"[S\";\n case u16:\n return \"[C\";\n case f64:\n return \"[D\";\n case f32:\n return \"[F\";\n case i32:\n return \"[I\";\n case i64:\n return \"[J\";\n case eqref:\n case externref:\n return \"[Ljava.lang.Object;\";\n default:\n throw new WasmException( \"Not supported array type: \" + arrayType, -1 );\n }\n }\n if( arrayType instanceof ArrayType ) {\n return \"[\" + getJavaClassName( ((ArrayType)arrayType).arrayType );\n }\n return \"[L\" + ((StructType)arrayType).getName() + \";\";\n }",
"public String toString() {\n return type.toString();\n }",
"private String arrayToString(TOP fsIn, int arrayType) throws SAXException {\n if (fsIn == null) {\n return null;\n }\n\n StringBuilder buf = new StringBuilder();\n CommonArrayFS fs = (CommonArrayFS) fsIn;\n String elemStr = null;\n\n // FS arrays: handle shared data items\n if (fs instanceof FSArray) {\n List<XmiArrayElement> ootsArrayElementsList = cds.sharedData == null ? null\n : cds.sharedData.getOutOfTypeSystemArrayElements((FSArray) fs);\n int ootsIndex = 0;\n\n int j = -1;\n for (TOP elemFS : ((FSArray) fs)._getTheArray()) {\n j++;\n if (elemFS == null) { // null case\n // special NULL object with xmi:id=0 is used to represent\n // a null in an FSArray\n elemStr = \"0\";\n // However, this null array element might have been a reference to an\n // out-of-typesystem FS, so check the ootsArrayElementsList\n if (ootsArrayElementsList != null) {\n\n while (ootsIndex < ootsArrayElementsList.size()) {\n XmiArrayElement arel = ootsArrayElementsList.get(ootsIndex++);\n if (arel.index == j) {\n elemStr = arel.xmiId;\n break;\n }\n }\n }\n\n } else { // not null\n String xmiId = cds.getXmiId(elemFS);\n if (cds.isFiltering) { // return as null any references to types not in target TS\n String typeName = elemFS._getTypeImpl().getName();\n if (cds.filterTypeSystem_inner.getType(typeName) == null) {\n xmiId = \"0\";\n }\n }\n elemStr = xmiId;\n }\n\n if (buf.length() > 0) {\n buf.append(' ');\n }\n buf.append(elemStr);\n } // end of loop over FS Array elements\n\n return buf.toString();\n\n } else if (fs instanceof ByteArray) {\n\n // special case for byte arrays: serialize as hex digits\n byte[] ba = ((ByteArray) fs)._getTheArray();\n\n char[] r = new char[ba.length * 2];\n\n int i = 0;\n for (byte b : ba) {\n r[i++] = INT_TO_HEX[(b & 0xF0) >>> 4];\n r[i++] = INT_TO_HEX[b & 0x0F];\n }\n return new String(r);\n } else {\n // is not FSarray, is not ByteArray, is not String Array\n // CommonArrayFS fs;\n // String[] fsvalues;\n //\n // switch (arrayType) {\n // case LowLevelCAS.TYPE_CLASS_INTARRAY:\n // fs = new IntArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_FLOATARRAY:\n // fs = new FloatArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_BOOLEANARRAY:\n // fs = new BooleanArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_SHORTARRAY:\n // fs = new ShortArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_LONGARRAY:\n // fs = new LongArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_DOUBLEARRAY:\n // fs = new DoubleArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_BYTEARRAY:\n // fs = new ByteArrayFSImpl(addr, cds.cas);\n // break;\n // default: {\n // return \"\";\n // }\n // }\n\n // if (arrayType == LowLevelCAS.TYPE_CLASS_STRINGARRAY) { // this method never called for\n // StringArrays\n // StringArrayFS strFS = new StringArrayFSImpl(addr, cds.cas);\n // fsvalues = strFS.toArray();\n // } else {\n String[] fsvalues = fs.toStringArray();\n // }\n\n for (String s : fsvalues) {\n if (buf.length() > 0) {\n buf.append(' ');\n }\n buf.append(s);\n }\n return buf.toString();\n }\n }",
"public String getElementType()\n {\n return elementType;\n }",
"static private PowerlessArray<String>\n types(final Class<?> actual) {\n final Class<?> end =\n Struct.class.isAssignableFrom(actual) ? Struct.class : Object.class;\n final PowerlessArray.Builder<String> r = PowerlessArray.builder(4);\n for (Class<?> i=actual; end!=i; i=i.getSuperclass()) { ifaces(i, r); }\n return r.snapshot();\n }",
"public int[] getTypes(){\n int[] types={TYPE_STRING,TYPE_STRING,TYPE_STRING,TYPE_INT};\n return types;\n }",
"public abstract ArrayList<String[]> toStrings();",
"public String toString(){\n\t\tStringBuffer r = new StringBuffer();\n\t\tr.append(\"{\");\n\t\tr.append(indexPatternSet+\"(\"+indexPattern+\")\"+type);\n\t\tr.append(\"}\");\n\t\treturn r.toString();\n\t}",
"char[][] getTypeParameterNames();",
"@Test public void getBaseTypeNameShouldReturnCorrectType() throws SQLException {\n\t\tList<Object> list = new ArrayList<>();\n\t\tArray array = new ListArray(list, Types.VARCHAR);\n\t\tassertEquals(\"VARCHAR\", array.getBaseTypeName());\n\t\tarray = new ListArray(list, Types.INTEGER);\n\t\tassertEquals(\"INTEGER\", array.getBaseTypeName());\n\t\tarray = new ListArray(list, Types.DOUBLE);\n\t\tassertEquals(\"DOUBLE\", array.getBaseTypeName());\n\t\tarray = new ListArray(list, Types.BOOLEAN);\n\t\tassertEquals(\"BOOLEAN\", array.getBaseTypeName());\n\t\tarray = new ListArray(list, Types.JAVA_OBJECT);\n\t\tassertEquals(\"JAVA_OBJECT\", array.getBaseTypeName());\n\t}",
"public String toString() {\n return type;\n }",
"String [] getSupportedTypes();",
"private RoomType[] getRoomTypeStrings()\r\n\t{\r\n\t\treturn bCtrl.getAllRoomTypes().stream().toArray(RoomType[]::new);\r\n\t}",
"public String getTypeStr(Type t)\n\t{\n\t\tString type;\n\t\t\n\t\tif(t instanceof IntegerType)\n\t\t{\n\t\t\ttype = \"int\";\n\t\t}\n\t\telse if(t instanceof IntArrayType)\n\t\t{\n\t\t\ttype = \"int[]\";\n\t\t}\n\t\telse if(t instanceof BooleanType)\n\t\t{\n\t\t\ttype = \"boolean\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tIdentifierType t1 = (IdentifierType)t;\n\t\t\ttype = t1.s;\n\t\t}\n\t\t\n\t\treturn type;\n\t}",
"public void genericStringArray() {\n\t\tArrayList<String> b1 = new ArrayList<String>();\n\t\tb1.add(\"ABC\");\n\t\tb1.add(\"sdfsdfs\");\n\t\tSystem.out.println(\"String generic ArrayList b1: \" + b1);\n\n\t}",
"public String toString(){\n \treturn isConstant ? \"const \" + type : \"var \" + type;\n }",
"@Override\n public String toString() {\n return \"[\" + this.statementType.toString() + \"]\";\n }",
"public native JsArrayString getTypes()/*-{\n\t\tvar jso = this.@com.ait.toolkit.core.client.JsObject::getJsObj()();\n\t\treturn jso.types;\n }-*/;",
"@Override\n\tpublic String toString() {\n\t\treturn type;\n\t}",
"@Override\n public Content visitArray(ArrayType type, LinkInfo linkInfo) {\n currentDepth++;\n linkInfo.type = type.getComponentType();\n visit(linkInfo.type, linkInfo);\n currentDepth--;\n if (utils.isAnnotated(type)) {\n linkInfo.type = type;\n link.add(\" \");\n link.add(getTypeAnnotationLinks(linkInfo));\n }\n // use vararg if required\n if (linkInfo.isVarArg && currentDepth == 0) {\n link.add(\"...\");\n } else {\n link.add(\"[]\");\n }\n return link;\n }",
"@Override\n\t\tpublic String toString()\n\t\t{\n\t\t\treturn type;\n\t\t}",
"public String toString() {\n String[] collect = new String[this.array.length];\n for (int i = 0; i < this.array.length; i++) {\n collect[i] = String.valueOf(this.array[i]);\n }\n return \"[\" + String.join(\";\", collect) + \"]\";\n }",
"private String typeUse(final ExecutableTypeUse use) {\n try {\n return StringUtils.repeat(\"[\", use.arity()) + use.logicalType() + StringUtils.repeat(\"]\", use.arity());\n }\n catch (final Exception ex) {\n ex.printStackTrace();\n return \"???\";\n }\n }",
"@Override\n public String toString() {\n String result = \"\";\n byte[] data = buffer.data;\n for (int i = 0; i < (buffer.end - buffer.start) / bytes; i++) {\n if (i > 0) result += \", \";\n result += get(i).toString();\n }\n return type + \"[\" + result + \"]\";\n }",
"@Secured({ \"IS_AUTHENTICATED_ANONYMOUSLY\", \"ACL_SECURABLE_READ\" })\n Collection<QuantitationType> getQuantitationTypes( ExpressionExperiment expressionExperiment,\n ubic.gemma.model.expression.arrayDesign.ArrayDesign arrayDesign );",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"private String prepareType(String smaliType) {\n int arrayDimensions = 0;\n \n String typeWithoutBrackets = smaliType;\n \n while (typeWithoutBrackets.startsWith(\"[\")) {\n arrayDimensions++;\n typeWithoutBrackets = typeWithoutBrackets.substring(1);\n }\n \n if(SmaliNameConverter.isPrimitiveSmaliType(typeWithoutBrackets)) {\n return (typeWithoutBrackets.equals(\"V\")) ? \"\" : smaliType ; \n }\n \n String classOfType = SmaliNameConverter.convertTypeFromSmali(typeWithoutBrackets);\n String packageOfType = SmaliNameConverter.extractPackageNameFromClassName(classOfType);\n\n StringBuilder type = new StringBuilder();\n\n for(int i = 0; i < arrayDimensions; i++) {\n type.append(\"[\");\n }\n\n boolean isCurrentClassObject = (classOfType.equals(currentClassType)); \n boolean isInternalObject = (packageOfType.equals(currentPackage)); \n \n char typeChar = isCurrentClassObject? 'T' : \n isInternalObject? 'O' : 'E' ;\n \n type.append(typeChar);\n\n return type.toString();\n }",
"private static String getTypeDescription(ClassNode c, boolean end) {\n StringBuffer buf = new StringBuffer();\n ClassNode d = c;\n while (true) {\n if (isPrimitiveType(d)) {\n char car;\n if (d == int_TYPE) {\n car = 'I';\n } else if (d == VOID_TYPE) {\n car = 'V';\n } else if (d == boolean_TYPE) {\n car = 'Z';\n } else if (d == byte_TYPE) {\n car = 'B';\n } else if (d == char_TYPE) {\n car = 'C';\n } else if (d == short_TYPE) {\n car = 'S';\n } else if (d == double_TYPE) {\n car = 'D';\n } else if (d == float_TYPE) {\n car = 'F';\n } else /* long */ {\n car = 'J';\n }\n buf.append(car);\n return buf.toString();\n } else if (d.isArray()) {\n buf.append('[');\n d = d.getComponentType();\n } else {\n buf.append('L');\n String name = d.getName();\n int len = name.length();\n for (int i = 0; i < len; ++i) {\n char car = name.charAt(i);\n buf.append(car == '.' ? '/' : car);\n }\n if (end) buf.append(';');\n return buf.toString();\n }\n }\n }",
"public String toString() {\n\t\treturn type + \" x \" + dim;\n\t}",
"List<LightweightTypeReference> getTypeArguments();",
"public String toString() {\n Iterator<AlgFieldCollation> it = fieldCollations.iterator();\n if ( !it.hasNext() ) {\n return \"[]\";\n }\n StringBuilder sb = new StringBuilder();\n sb.append( '[' );\n for ( ; ; ) {\n AlgFieldCollation e = it.next();\n sb.append( e.getFieldIndex() );\n if ( e.direction != AlgFieldCollation.Direction.ASCENDING || e.nullDirection != e.direction.defaultNullDirection() ) {\n sb.append( ' ' ).append( e.shortString() );\n }\n if ( !it.hasNext() ) {\n return sb.append( ']' ).toString();\n }\n sb.append( ',' ).append( ' ' );\n }\n }",
"List<Type> attribTypes(List<JCExpression> trees, Env<AttrContext> env) {\n \tDEBUG.P(this,\"attribTypes(2)\");\n \tDEBUG.P(\"trees=\"+trees);\n\t\t//DEBUG.P(\"env=\"+env);\n ListBuffer<Type> argtypes = new ListBuffer<Type>();\n for (List<JCExpression> l = trees; l.nonEmpty(); l = l.tail)\n argtypes.append(chk.checkRefType(l.head.pos(), attribType(l.head, env)));\n \n DEBUG.P(0,this,\"attribTypes(2)\");\n return argtypes.toList();\n }",
"public String[] toStrings();",
"public String toString() {\r\n\t\tStringBuffer buf = new StringBuffer();\r\n\t\tbuf.append(\"[ Expression \");\r\n\t\tif (text() != null) {\r\n\t\t\tbuf.append(\"[\");\r\n\t\t\tbuf.append(text().toString());\r\n\t\t\tbuf.append(\"]\");\r\n\t\t}\r\n\t\tbuf.append(\": \");\r\n\t\tfor (int n = 0; n < elements.size(); ++n) {\r\n\t\t\tbuf.append(elements.get(n));\r\n\t\t\tif (n < elements.size() - 1) {\r\n\t\t\t\tbuf.append(\",\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tbuf.append(\" ]\");\r\n\t\treturn new String(buf);\r\n\t}",
"public JType elementType() {\n throw new IllegalArgumentException(\"Not an array type\");\n }",
"@Override\n public String toString() {\n return value + symbol(this.type);\n }",
"public String toString() {\n int iMax = array.length - 1;\n if (iMax == -1)\n return \"[]\";\n\n StringBuilder b = new StringBuilder();\n b.append('[');\n for (int i = 0; ; i++) {\n b.append(getRaw(byteOffset(i)));\n if (i == iMax)\n return b.append(']').toString();\n b.append(',').append(' ');\n }\n }",
"public String getTypesSummary() throws Exception {\n\t\treturn this.xqueryUtil.getTypesSummary();\n\t}",
"List<Type> getTypeList(String type);",
"public String toString() {\r\n\t\tString elements = \"<\";\r\n\t\t\r\n\t\tfor(int i = 0; i < count; i++) {\r\n\t\t\telements += \" \" + array[i];\r\n\t\t\t}\r\n\t\t\r\n\t\t\telements += \" >\";\r\n\t\t\treturn elements;\r\n\t }",
"Collection<String> getStringListValue(int type);",
"public ArrayList<String> getTypes(){\n return this.types;\n }",
"public List<String> getResourceTypes(){\n\t\treturn jtemp.queryForList(\"SELECT resource_type_id||' '||resource_type_name FROM resource_type\", String.class);\n\t}",
"@Override\r\n public String toString() {\r\n StringBuilder buf = new StringBuilder();\r\n\r\n buf.append('[').append(getTokenName(type));\r\n if (line != -1) {\r\n buf.append('@').append(line);\r\n if (column != -1)\r\n buf.append(',').append(column);\r\n }\r\n buf.append(\"]:\");\r\n if (text != null)\r\n buf.append('\"').append(text).append('\"');\r\n else if (type > 3 && type < 256)\r\n buf.append((char) type);\r\n else\r\n buf.append('<').append(type).append('>');\r\n if (value != null)\r\n buf.append('=').append(value);\r\n return buf.toString();\r\n }",
"public boolean isArrayType()\n/* */ {\n/* 138 */ return true;\n/* */ }",
"@Test\n public void getTypeArguments() {\n List<String> target=new ArrayList<String>() {{\n add(\"thimble\");\n }};\n\n Type[] arguments= TypeDetective.sniffTypeParameters(target.getClass(), ArrayList.class);\n assertEquals(1, arguments.length);\n assertEquals(String.class,arguments[0]);\n }",
"@Override\n public String toString() {\n return \"[\" + ((name == null) ? \"\" : name) + \"] \" + type + \" \" + pred;\n }",
"private static String getTypeName(Class cls) {\n if (!cls.isArray()) {\n return cls.getName();\n } else {\n return getTypeName(cls.getComponentType()) + \"[]\";\n }\n }",
"public static <T> String arrayToString(T[] list) {\n\t\treturn arrayToString(list, o->o.toString());\n\t}",
"private static String compileArray(float[] array) {\n String arrayString = \"\\\"\";\n for (float number : array) {\n arrayString += Model.formatFloat(number) + \", \";\n }\n arrayString = arrayString.substring(0, arrayString.length() - 2);\n arrayString += \"\\\"\";\n return arrayString;\n }",
"private ArrayList<String> getJoinedAttributeTypes(List<Table> tables) {\n\t\tArrayList<String> rtn = new ArrayList<String>(); \n\n\t\ttry {\n\t\t\tfor(int iterator = 0; iterator < tables.size(); iterator++) {\n\t\t\t\tTable table = tables.get(iterator);\n\t\t\t\tFile root = new File(\"src\");\n\t\t\t\tURLClassLoader classLoader = URLClassLoader.newInstance(new URL[] { root.toURI().toURL() });\n\t\t\t\tClass<?> cl = Class.forName(table.getName(), true, classLoader);\n\t\t\t\t\n\t\t\t\tField fields[] = cl.getDeclaredFields();\n\t\t\t\tfor(int i = 0; i < fields.length; i++) {\n\t\t\t\t\tField field = fields[i];\n\t\t\t\t\tfield.setAccessible(true);\n\t\t\t\t\trtn.add(field.getType().getName());\n\t\t\t\t\tfield.setAccessible(false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcatch (MalformedURLException e)\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn rtn;\n\t}",
"@Override\n public String toString ()\n {\n return \"type = \" + type;\n }",
"@Override\n\tpublic String toString() {\n\t\tif (size() == 0) {\n\t\t\treturn \"[]\";\n\t\t} else if (size() == 1) {\n\t\t\treturn \"[\" + arr[0] + \"]\";\n\t\t} else {\n\t\t\t// size() >= 2\n\t\t\tString result = \"[\" + arr[0];\n\t\t\tfor (int i = 1; i < end; ++i) {\n\t\t\t\tresult += \", \" + arr[i];\n\t\t\t}\n\t\t\treturn result + \"]\";\n\t\t}\n\t}",
"public static final List<DataTypeDescription<?>> list(){\r\n List<DataTypeDescription<?>> list = new ArrayList<DataTypeDescription<?>>();\r\n list.add(STRING.getDescription());\r\n list.add(ORDERED_STRING.getDescription());\r\n list.add(DATE.getDescription());\r\n list.add(DECIMAL.getDescription());\r\n list.add(INTEGER.getDescription());\r\n return list;\r\n }",
"public String toString (){\n return \"tvalores[]\";\n }",
"@NonNull\n public static String createTypeParametersString(@NonNull TypeVariable<?>[] typeParameters, @NonNull Set<@NonNull Class<?>> declaredClasses) {\n StringBuilder builder = new StringBuilder();\n\n StringBuilderUtils.appendTypeParametersString(typeParameters, typeVariable -> {\n builder.append(typeVariable.getName());\n StringBuilderUtils.appendBoundsString(typeVariable.getBounds(), true, declaredClasses, builder);\n }, builder);\n\n return builder.toString();\n }",
"public String saveTypesAsXML(TextLabels labels) {\n\t\tStringBuffer buf = new StringBuffer(\"<extractions>\\n\");\n\t\tfor (Iterator i=labels.getTypes().iterator(); i.hasNext(); ) {\n\t\t\tString type = (String)i.next();\n\t\t\tfor (Span.Looper j=labels.instanceIterator(type); j.hasNext(); ) {\n\t\t\t\tSpan s = j.nextSpan();\n\t\t\t\tint lo = s.getTextToken(0).getLo();\n\t\t\t\tint hi = s.getTextToken(s.size()-1).getHi();\n\t\t\t\tbuf.append(\" <\"+type+\" lo=\"+lo+\" hi=\"+hi+\">\"+s.asString()+\"</\"+type+\">\\n\");\n\t\t\t}\n\t\t}\n\t\tbuf.append(\"</extractions>\\n\");\n\t\treturn buf.toString();\n\t}",
"public Type[] getArgumentTypes() {\n/* 236 */ return Type.getArgumentTypes(this.desc);\n/* */ }",
"@Override\n public ImmutableList<String> getTypeParts() {\n return types.toImmutable();\n }",
"public PayloadType[] getTextPayloadTypes();",
"private static String getClassNameAfterWrapperArrayOf(Class<?> clazz) {\n if(clazz.isPrimitive()) {\n String baseTypeDescriptor = DescriptorUtils.primitiveClass2BaseTypeDescriptor(clazz);\n return \"[\" + baseTypeDescriptor;\n } else if(clazz.isArray()) {\n return \"[\" + clazz.getName();\n } else {\n // normal object\n return \"[L\" + clazz.getName() + \";\";\n }\n }",
"public static String getTypeString(int types) {\n\t\tString[] typeStrings = {TYPE_TEXT, TYPE_HTML, TYPE_URI, TYPE_INTENT};\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (int i = 0; i < typeStrings.length; i++) {\n\t\t\tif (((types >>> i) & 0x01) == 1) {\n\t\t\t\tsb.append(typeStrings[i]).append(' ');\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\t}",
"@Override\n\tpublic String toString() {\n\t\treturn String.format(\"%s[%s]\", name.getValue().getSValue(), exprNode.toString());\n\t}",
"public String toString(){\r\n\t\tString str = \"|\";\r\n\t\tArrayNode<T> temp = beginMarker.next;\r\n\t\twhile (temp != endMarker){\r\n\t\t\tstr+= temp.toString() + \"|\";\r\n\t\t\ttemp = temp.next;\r\n\t\t}\r\n\t\treturn str;\r\n\t}",
"@Specialization\n\t\tString type(OzBacktrace backtrace) {\n\t\t\treturn \"tuple\";\n\t\t}",
"@SuppressWarnings(\"unchecked\")\n public static List getExpressionType(Expression e) {\n if (e instanceof Identifier) {\n Symbol var = ((Identifier)e).getSymbol();\n if (var != null) {\n return var.getTypeSpecifiers();\n }\n } else if (e instanceof ArrayAccess) {\n ArrayAccess aa = (ArrayAccess)e;\n List ret = getExpressionType(aa.getArrayName());\n if (ret != null && !ret.isEmpty()) {\n LinkedList ret0 = new LinkedList(ret);\n for (int i = 0; i < aa.getNumIndices(); ++i) {\n if (ret0.getLast() instanceof PointerSpecifier) {\n ret0.removeLast();\n }\n }\n return ret0;\n }\n } else if (e instanceof AccessExpression) {\n //Symbol var = ((AccessExpression)e).getSymbol();\n //if ( var != null )\n Symbol var = new AccessSymbol((AccessExpression)e);\n return var.getTypeSpecifiers();\n } else if (e instanceof AssignmentExpression) {\n return getExpressionType(((AssignmentExpression)e).getLHS());\n } else if (e instanceof CommaExpression) {\n List<Traversable> children = e.getChildren();\n return getExpressionType(\n (Expression)children.get(children.size() - 1));\n } else if (e instanceof ConditionalExpression) {\n return getExpressionType(\n ((ConditionalExpression)e).getTrueExpression());\n } else if (e instanceof FunctionCall) {\n Expression fc_name = ((FunctionCall)e).getName();\n if (fc_name instanceof Identifier) {\n Symbol fc_var = ((Identifier)fc_name).getSymbol();\n if (fc_var != null) {\n return fc_var.getTypeSpecifiers();\n }\n }\n } else if (e instanceof IntegerLiteral) {\n List ret = new ArrayList(1);\n ret.add(Specifier.LONG);\n return ret;\n } else if (e instanceof BooleanLiteral) {\n List ret = new ArrayList(1);\n ret.add(Specifier.BOOL);\n return ret;\n } else if (e instanceof CharLiteral) {\n List ret = new ArrayList(1);\n ret.add(Specifier.CHAR);\n return ret;\n } else if (e instanceof StringLiteral) {\n List ret = new ArrayList(1);\n ret.add(Specifier.CHAR);\n ret.add(PointerSpecifier.UNQUALIFIED);\n return ret;\n } else if (e instanceof FloatLiteral) {\n List ret = new ArrayList(1);\n ret.add(Specifier.DOUBLE);\n return ret;\n } else if (e instanceof Typecast) {\n List ret = new ArrayList();\n List specs = ((Typecast)e).getSpecifiers();\n for (int i = 0; i < specs.size(); i++) {\n Object spec = specs.get(i);\n if (spec instanceof Specifier) {\n ret.add(spec);\n } else if (spec instanceof Declarator) {\n ret.addAll(((Declarator)spec).getSpecifiers());\n }\n }\n return ret;\n } else if (e instanceof UnaryExpression) {\n UnaryExpression ue = (UnaryExpression)e;\n UnaryOperator op = ue.getOperator();\n List ret = getExpressionType(ue.getExpression());\n if (ret != null) {\n LinkedList ret0 = new LinkedList(ret);\n if (op == UnaryOperator.ADDRESS_OF) {\n ret0.addLast(PointerSpecifier.UNQUALIFIED);\n } else if (op == UnaryOperator.DEREFERENCE) {\n ret0.removeLast();\n }\n return ret0;\n }\n } else if (e instanceof BinaryExpression) {\n BinaryExpression be = (BinaryExpression)e;\n BinaryOperator op = be.getOperator();\n if (op.isCompare() || op.isLogical()) {\n List ret = new ArrayList(1);\n ret.add(Specifier.LONG);\n return ret;\n } else {\n return getExpressionType(be.getLHS());\n }\n } else if (e instanceof VaArgExpression) {\n return ((VaArgExpression)e).getSpecifiers();\n }\n PrintTools.printlnStatus(1, \"[WARNING] Unknown expression type: \", e);\n return null;\n }",
"public int[] getType() {\n return (type);\n }",
"String[] getImplementedInterfacesAsDisplayStrings();",
"public String argTypes() {\n return \"I\";//NOI18N\n }",
"public String toString() {\n return cords.toString() + type;\n }",
"public String[] getTypes() {\n return impl.getTypes();\n }",
"public String getTypeString() {\r\n return Prediction.getTypeString(type);\r\n }",
"private static String formalParametersToString(Class[] pts) {\n StringBuilder result = new StringBuilder();\n for (int i = 0; i < pts.length; i++) {\n result.append(getTypeName(pts[i])).append(\" p\").append(i);\n if (i < pts.length - 1)\n result.append(\",\");\n }\n return result.toString();\n }"
] | [
"0.6938319",
"0.6609316",
"0.646158",
"0.6460664",
"0.6355083",
"0.61726826",
"0.59832287",
"0.59297764",
"0.59125245",
"0.59054923",
"0.5860921",
"0.58051383",
"0.57916045",
"0.5786241",
"0.5778004",
"0.5734136",
"0.57265055",
"0.56141144",
"0.56007946",
"0.55928326",
"0.5572838",
"0.55269384",
"0.54975396",
"0.5495742",
"0.5495399",
"0.5482769",
"0.54800797",
"0.54654276",
"0.5453014",
"0.5435808",
"0.5429322",
"0.54264903",
"0.54238534",
"0.54162157",
"0.5410916",
"0.539393",
"0.5393603",
"0.5392262",
"0.5360927",
"0.5341508",
"0.5340251",
"0.5321041",
"0.5321041",
"0.5321041",
"0.5321041",
"0.5321041",
"0.5321041",
"0.5321041",
"0.5321041",
"0.5321041",
"0.5321041",
"0.5321041",
"0.5321041",
"0.5321041",
"0.5320074",
"0.5317253",
"0.53135556",
"0.5304002",
"0.5299002",
"0.52984136",
"0.5294523",
"0.52886724",
"0.52825624",
"0.5279849",
"0.5279604",
"0.5270909",
"0.5268468",
"0.5262067",
"0.5259211",
"0.5256981",
"0.52555454",
"0.5255055",
"0.5249018",
"0.5244986",
"0.5244637",
"0.52402675",
"0.5234591",
"0.52298564",
"0.5227284",
"0.5224388",
"0.52201957",
"0.52200615",
"0.52091676",
"0.5208237",
"0.5205271",
"0.51986694",
"0.5195112",
"0.5193263",
"0.5185552",
"0.5177578",
"0.5177529",
"0.51719815",
"0.51657623",
"0.516444",
"0.5162956",
"0.5155282",
"0.5147425",
"0.513592",
"0.513449",
"0.5124062",
"0.51205623"
] | 0.0 | -1 |
/ Returns the type in the field (nonJavadoc) | public Object visitField(GoIRFieldNode node)
{
return node.getType().getIdentifier();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Class<?> getType(){\n return field.getType();\n }",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"com.google.cloud.datacatalog.FieldType getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"public String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"type getType();",
"public Type getType();",
"public FieldType getType();",
"public String type();",
"fi.kapsi.koti.jpa.nanopb.Nanopb.FieldType getType();",
"public JavaType getType() { return _type; }",
"public com.sun.javadoc.Type type() {\n return TypeImpl.getInstance(type);\n }",
"public String getType() {return type;}",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"public String getType() { return type; }",
"public String getType()\n \t{\n \t\treturn this.type;\n \t}",
"private String getType(){\r\n return type;\r\n }",
"public String getType(){\r\n return type;\r\n }",
"public String getType() \n {\n return type;\n }",
"public String getType() \n {\n return this.type;\n }",
"public String getType(){\n \treturn this.type;\n }",
"public String getType() {\n return type;\n }",
"public final String type() {\n return type;\n }",
"public Type getType() {\n return _type;\n }",
"public String type(){\n\t\treturn type;\n\t}",
"public String getType(){\r\n\t\treturn this.type;\r\n\t}",
"public String getFieldType()\n {\n return m_strFieldType;\n }",
"public String getType(){\n return this.type;\n }",
"public String getType()\n {\n return type;\n }",
"String getType() {\n return type;\n }",
"public Type getType()\n {\n return type;\n }",
"public String getType() {\r\n return this.type;\r\n }",
"public String getType() {\n return _type;\n }",
"public String getType()\r\n {\r\n return type;\r\n }",
"public Object getType()\r\n {\r\n\treturn type;\r\n }",
"public String type() {\n return this.type;\n }",
"public String type() {\n return this.type;\n }",
"public String type() {\n return this.type;\n }",
"public String type() {\n return this.type;\n }",
"public String type() {\n return this.type;\n }",
"public String type() {\n return this.type;\n }",
"@Override\n\tpublic String getType() {\n\t\treturn this.type;\n\t}",
"String getTypeAsString();"
] | [
"0.7895865",
"0.762163",
"0.762163",
"0.762163",
"0.762163",
"0.762163",
"0.762163",
"0.762163",
"0.762163",
"0.762163",
"0.762163",
"0.762163",
"0.762163",
"0.762163",
"0.7408064",
"0.7336835",
"0.7336835",
"0.7336835",
"0.7336835",
"0.7336835",
"0.7336835",
"0.7336835",
"0.7336835",
"0.7336835",
"0.7336835",
"0.7336835",
"0.7336835",
"0.7336835",
"0.73301864",
"0.73301864",
"0.73301864",
"0.73301864",
"0.73301864",
"0.73301864",
"0.73301864",
"0.73301864",
"0.73301864",
"0.73301864",
"0.73301864",
"0.73301864",
"0.73301864",
"0.73301864",
"0.73301864",
"0.73301864",
"0.73301864",
"0.73301864",
"0.73301864",
"0.73301864",
"0.73301864",
"0.73301864",
"0.73301864",
"0.73301864",
"0.73301864",
"0.73091775",
"0.7297894",
"0.728901",
"0.72851056",
"0.72816646",
"0.72713983",
"0.7221323",
"0.719449",
"0.71828926",
"0.71828926",
"0.71828926",
"0.71828926",
"0.71828926",
"0.71828926",
"0.71828926",
"0.71828926",
"0.71828926",
"0.71828926",
"0.71828926",
"0.7168065",
"0.7160171",
"0.71426326",
"0.7133612",
"0.7124991",
"0.7124421",
"0.71118754",
"0.71064067",
"0.710504",
"0.71009016",
"0.7099772",
"0.70996773",
"0.7099494",
"0.7096426",
"0.70942783",
"0.70890874",
"0.70875156",
"0.70866543",
"0.7082277",
"0.7080495",
"0.70804375",
"0.70784795",
"0.70784795",
"0.70784795",
"0.70784795",
"0.70784795",
"0.70784795",
"0.7076991",
"0.7074529"
] | 0.0 | -1 |
/ returns type of variable (nonJavadoc) | public Object visitIdent(GoIRIdentNode node){
TypeInfo m = lexicalscope.get(node.getIdentifier());
if(m != null) {
return m.getType();
}
return "";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"type getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"public VarTypeNative getFieldVarType();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"String type();",
"int getTypeValue();",
"int getTypeValue();",
"int getTypeValue();",
"int getTypeValue();",
"int getTypeValue();",
"int getTypeValue();",
"int getTypeValue();",
"int getTypeValue();",
"int getTypeValue();",
"int getTypeValue();",
"int getTypeValue();",
"int getTypeValue();",
"int getTypeValue();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"String getType();",
"static String varType(Field field)\r\n {\r\n switch(field.type)\r\n {\r\n case Field.BYTE:\r\n return \"BYTE\";\r\n case Field.SHORT:\r\n return \"SHORT\";\r\n case Field.INT:\r\n case Field.SEQUENCE:\r\n case Field.LONG:\r\n return \"LONG\";\r\n case Field.CHAR:\r\n case Field.ANSICHAR:\r\n return \"CHAR(\"+String.valueOf(field.length)+\")\";\r\n case Field.DATE:\r\n case Field.DATETIME:\r\n case Field.TIME:\r\n case Field.TIMESTAMP:\r\n return \"DATETIME\";\r\n case Field.FLOAT:\r\n case Field.DOUBLE:\r\n if (field.scale != 0)\r\n return \"DOUBLE(\"+String.valueOf(field.precision)+\", \"+String.valueOf(field.scale)+\")\";\r\n else if (field.precision != 0)\r\n return \"DOUBLE(\"+String.valueOf(field.precision)+\")\";\r\n return \"DOUBLE\";\r\n case Field.BLOB:\r\n return \"LONGBINARY\";\r\n case Field.TLOB:\r\n return \"LONGTEXT\";\r\n case Field.MONEY:\r\n return \"DOUBLE(15,2)\";\r\n case Field.USERSTAMP:\r\n return \"VARCHAR(16)\";\r\n case Field.IDENTITY:\r\n return \"<not supported>\";\r\n }\r\n return \"unknown\";\r\n }",
"TypeRef getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type type();",
"Type type();",
"public String type();",
"public String getType(JmmNode node) {\n switch (node.getKind()) {\n case \"Add\":\n case \"Sub\":\n case \"Mul\":\n case \"Div\":\n return \"int\";\n\n case \"LessThan\":\n case \"And\":\n case \"Not\":\n return \"boolean\";\n\n case \"Var\":\n return getVariableSymbol(node.get(\"name\")).getType().getName();\n default:\n return null;\n }\n }",
"Type_use getType_use();",
"String getTypeAsString();",
"int getType();",
"int getType();",
"int getType();",
"int getType();",
"int getType();",
"int getType();",
"int getType();",
"int getType();",
"private static TypeToken<?> typeVariable() {\n\t\tParameterizedType t = (ParameterizedType)TypeToken.of(Identity.class).getSupertype(StreamElement.class).getType();\n\t\treturn TypeToken.of(t.getActualTypeArguments()[0]);\n\t}"
] | [
"0.6966697",
"0.69170845",
"0.69170845",
"0.69170845",
"0.69170845",
"0.69170845",
"0.69170845",
"0.69170845",
"0.69170845",
"0.69170845",
"0.69170845",
"0.69170845",
"0.69170845",
"0.69170845",
"0.69026375",
"0.6898564",
"0.6898564",
"0.6898564",
"0.6898564",
"0.6898564",
"0.6898564",
"0.6898564",
"0.6898564",
"0.6898564",
"0.6898564",
"0.6898564",
"0.6898564",
"0.6898564",
"0.6898564",
"0.6898564",
"0.6898564",
"0.6898564",
"0.6898564",
"0.6898564",
"0.6898564",
"0.6732025",
"0.6732025",
"0.6732025",
"0.6732025",
"0.6732025",
"0.6732025",
"0.6732025",
"0.6732025",
"0.6732025",
"0.6732025",
"0.6732025",
"0.6732025",
"0.6732025",
"0.6702086",
"0.6702086",
"0.6702086",
"0.6702086",
"0.6702086",
"0.6702086",
"0.6702086",
"0.6702086",
"0.6702086",
"0.6702086",
"0.6702086",
"0.6702086",
"0.6702086",
"0.6702086",
"0.6702086",
"0.6702086",
"0.6702086",
"0.6702086",
"0.6702086",
"0.6702086",
"0.6702086",
"0.6702086",
"0.6702086",
"0.6702086",
"0.6702086",
"0.65695226",
"0.6557373",
"0.6511775",
"0.6511775",
"0.6511775",
"0.6511775",
"0.6511775",
"0.6511775",
"0.6511775",
"0.6511775",
"0.6511775",
"0.6511775",
"0.6511775",
"0.65087694",
"0.65087694",
"0.647465",
"0.6433242",
"0.64260566",
"0.6408509",
"0.64062834",
"0.64062834",
"0.64062834",
"0.64062834",
"0.64062834",
"0.64062834",
"0.64062834",
"0.64062834",
"0.6356942"
] | 0.0 | -1 |
/ TODO idk if this doing something right I think I need to check if its a number and not a string (nonJavadoc) | public Object visitIndexNode(GoIRIndexNode node){
String type = (String) node.getIndex().accept(this);
if(!(type.equalsIgnoreCase("int"))) {
throw new GoException("non-integer slice index \""+type +"\"" );
}
return type;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static boolean validNumber(String thing) {\n\t\treturn validDouble(thing);\n\t}",
"public abstract boolean isNumeric();",
"private boolean isNumber(Object o) {\n\t\tif(o instanceof String) return isNumber((String) o);\n\t\telse if(o instanceof Double) return true;\n\t\telse return false;\n\t}",
"@Test\n void checkIsTrueForStringWithNumbers() {\n // Act, Assert\n assertTrue(IsNumeric.check(\"3\"));\n assertTrue(IsNumeric.check(\"0\"));\n assertTrue(IsNumeric.check(\"-0f\"));\n assertTrue(IsNumeric.check(\"3.8f\"));\n assertTrue(IsNumeric.check(\"-3.87F\"));\n assertTrue(IsNumeric.check(\"-3\"));\n assertTrue(IsNumeric.check(\"32f\"));\n assertTrue(IsNumeric.check(\"15D\"));\n assertTrue(IsNumeric.check(\"3.2\"));\n assertTrue(IsNumeric.check(\"0.2\"));\n assertTrue(IsNumeric.check(\"-0.28\"));\n assertTrue(IsNumeric.check(\"0.24D\"));\n assertTrue(IsNumeric.check(\"0.379d\"));\n }",
"private static boolean isPrimitive(String value) {\n boolean status = true;\n value = value.trim();\n if (value.length() < 1) {\n return false;\n }\n for (int i = 0; i < value.length(); i++) {\n char c = value.charAt(i);\n if (!Character.isDigit(c)) {\n status = false;\n break;\n }\n }\n\n return status;\n }",
"@Test\n\tpublic void testNumberType() throws Exception {\n\t\tassertThat(0, is(0));\n\t}",
"public boolean isNum() \n\t{ \n\t try \n\t { \n\t int d = Integer.parseInt(numeric); \n\t } \n\t catch(NumberFormatException nfe) \n\t { \n\t return false; \n\t } \n\t return true; \n\t}",
"private static boolean isNumber( char i ) {\n\t\tif ( Character.isDigit(i) ) return true; \n\t\tthrow new IllegalArgumentException(\"The weight of the route should be a number, now it's '\"+ i +\"'\");\n\t}",
"@Test\n public void isNumericNegetive() {\n Boolean bool = Utils.isNumeric(\"123a\");\n Assert.assertEquals(false, bool);\n }",
"private boolean isNumeric(String s) {\n return java.util.regex.Pattern.matches(\"\\\\d+\", s);\n }",
"private static boolean isNumeric(String str){\n return NumberUtils.isNumber(str);\n }",
"public void testInferNumber1a() throws Exception {\n assertType(\"10 \", 0, 2, \"java.lang.Integer\");\n }",
"protected boolean isNumber(String s)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tDouble.parseDouble(s);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tcatch(NumberFormatException ex)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"private boolean isNumber(String s) {\n\t\ttry {\n\t\t\tDouble.parseDouble(s);\n\t\t} catch (NumberFormatException nfe) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"private boolean checkForNumber(String field) {\n\n\t\tPattern p = Pattern.compile(\"[0-9].\");\n\t\tMatcher m = p.matcher(field);\n\n\t\treturn (m.find()) ? true : false;\n\t}",
"@Test\n void checkIsTrueForStringWithNumbersWithSpacesAtTheBeginningAndEnd() {\n // Act, Assert\n assertTrue(IsNumeric.check(\" 3\"));\n assertTrue(IsNumeric.check(\"32 \"));\n assertTrue(IsNumeric.check(\" 3.2 \"));\n assertTrue(IsNumeric.check(\" -0.2\"));\n assertTrue(IsNumeric.check(\" -0.2d\"));\n assertTrue(IsNumeric.check(\"0.24D \"));\n assertTrue(IsNumeric.check(\"0.28 \"));\n assertTrue(IsNumeric.check(\" 3.8f\"));\n assertTrue(IsNumeric.check(\"-3.87F \"));\n }",
"private static boolean isNumeric(String cadena)\n\t {\n\t\t try \n\t\t {\n\t\t\t Integer.parseInt(cadena);\n\t\t\t return true;\n\t\t } catch (NumberFormatException nfe)\n\t\t {\n\t\t\t return false;\n\t\t }\n\t }",
"private static boolean isNumeric(String str) { \n\t\ttry { \n\t\t\tDouble.parseDouble(str); \n\t\t} \n\t\tcatch(NumberFormatException nfe) { \n\t\t\treturn false; \n\t\t} \n\t\treturn true; \n\t}",
"private static boolean isNumeric(String str){\n return str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); //match a number with optional '-' and decimal.\n }",
"public boolean checkNumber() {\n\t\treturn true;\n\t}",
"private static boolean isNumber(String value){\r\n\t\tfor (int i = 0; i < value.length(); i++){\r\n\t\t\tif (value.charAt(i) < '0' || value.charAt(i) > '9')\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean validate(String num) {\n\t\treturn false;\r\n\t}",
"Boolean isNumeric(PrintWriter out, String strNum);",
"public void testGetNumericValue1() {\n ValueString vs = new ValueString(\"1000\");\n\n assertEquals(\"1000\", vs.getString());\n assertEquals(1000.0D, vs.getNumber(), 0.0D);\n assertNull(vs.getDate()); // will fail parsing\n assertEquals(false, vs.getBoolean());\n assertEquals(1000, vs.getInteger());\n assertEquals(BigDecimal.valueOf(1000), vs.getBigNumber());\n }",
"private static boolean isNumeric(String str)\n\t{\n\t\ttry\n\t\t{\n\t\t\tdouble d = Double.parseDouble(str);\n\t\t}\n\t\tcatch (NumberFormatException nfe)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"private boolean isNumber( String test ) {\n\treturn test.matches(\"\\\\d+\");\n }",
"@Test\n public void isNumeric() {\n Boolean bool = Utils.isNumeric(\"123\");\n Assert.assertEquals(true, bool);\n }",
"private boolean isNotNumeric(String s) {\n return s.matches(\"(.*)\\\\D(.*)\");\n }",
"private static boolean isNumeric(String str)\t{\n\n\t\treturn str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); \n\t\t\t// match a number with optional '-' and decimal.\n\t}",
"@Test\n void checkIsFalseForStringWithoutNumbers() {\n // Act, Assert\n assertFalse(IsNumeric.check(\"a\"));\n assertFalse(IsNumeric.check(\"ö\"));\n assertFalse(IsNumeric.check(\"\"));\n assertFalse(IsNumeric.check(\"´´´\"));\n assertFalse(IsNumeric.check(\"lgk\"));\n assertFalse(IsNumeric.check(\"lL y\"));\n assertFalse(IsNumeric.check(\" \"));\n assertFalse(IsNumeric.check(\"h* \"));\n assertFalse(IsNumeric.check(\"/+\"));\n assertFalse(IsNumeric.check(\"-\"));\n assertFalse(IsNumeric.check(\"+\"));\n assertFalse(IsNumeric.check(\"d\"));\n assertFalse(IsNumeric.check(\"ariel\"));\n assertFalse(IsNumeric.check(\"#€%/!\"));\n }",
"boolean isNumericPubmed(String id){\n\t\t \n\t\t try{\n\t\t\t Integer.parseInt(id);\n\t\t }catch (Exception e){\n\t\t\t return false;\n\t\t }\n\t\t return true;\n\t }",
"@Test\n void checkIsFalseForStringWithNumbersAndOtherChars() {\n // Act, Assert\n assertFalse(IsNumeric.check(\"a3\"));\n assertFalse(IsNumeric.check(\"3l\"));\n assertFalse(IsNumeric.check(\"345L\"));\n assertFalse(IsNumeric.check(\"32b\"));\n assertFalse(IsNumeric.check(\"*3.2 \"));\n assertFalse(IsNumeric.check(\"/0.2\"));\n assertFalse(IsNumeric.check(\"0.28L\"));\n assertFalse(IsNumeric.check(\"0.28.\"));\n assertFalse(IsNumeric.check(\"3.2.4\"));\n assertFalse(IsNumeric.check(\"0x400\"));\n assertFalse(IsNumeric.check(\"0.24Dd\"));\n }",
"public void testGetNumericValue2() {\n ValueString vs = new ValueString(\"2.8\");\n\n assertEquals(\"2.8\", vs.getString());\n assertEquals(2.8D, vs.getNumber(), 0.0D);\n assertNull(vs.getDate()); // will fail parsing\n assertEquals(false, vs.getBoolean());\n assertEquals(0, vs.getInteger());\n assertEquals(2.8D, vs.getBigNumber().doubleValue(), 0.1D);\n }",
"boolean hasNumber();",
"public static boolean checkIfNumeric(Object toBeChecked)\r\n\t{\r\n\t\ttry {\r\n\t\t\tDouble.parseDouble((String) toBeChecked);\r\n\t\t\treturn true;\r\n\t\t} catch (ClassCastException e) {\r\n\t\t\treturn true;\r\n\t\t} catch (NumberFormatException e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"@Test\n public void isNumeric() {\n assertTrue(Deadline.isNumeric(VALID_YEAR_2018));\n\n //contains other symbols -> false\n assertFalse(Deadline.isNumeric(INVALID_YEAR_WITH_SYMBOLS));\n\n //contains alphabets -> false\n assertFalse(Deadline.isNumeric(INVALID_YEAR_WITH_ALPHABETS));\n\n //contains space -> false\n assertFalse(Deadline.isNumeric(INVALID_YEAR_WITH_SPACE));\n }",
"private boolean isInt(String num) {\n boolean isInt;\n try {\n Integer.parseInt(num);\n isInt = true;\n } catch (Exception e) {\n isInt = false;\n }\n return isInt;\n }",
"private void ex04(){\n int number;\n number = 1;\n\n double number2;\n number2 = 1.5;\n\n String number3;\n number3 = \"3\";\n\n boolean bool = (number == 1);\n\n myWindow.clearOut();\n myWindow.writeOutLine(number);\n myWindow.writeOutLine(new String(String.valueOf(number))); //int to string\n myWindow.writeOutLine((double) number); //int to double\n myWindow.writeOutLine(bool); //int to boolean\n\n /*\n Java can perform number -> string\n method 1: numberType.toString\n method 2: String.valueOf(int/double/float) //used above in the code\n Java can also perform string -> number\n dataType.parseDatatype() // e.g.: Integer.parseInt()\n\n Java allows this only when the conversion is widening (small -> larger)\n alternatively reports a compile error if the conversion is narrowing\n */\n\n //YOUR CODE ABOVE HERE\n }",
"private static boolean checkIfIsDouble(String num) {\n try {\n Double.parseDouble(num);\n return true;\n } catch (NumberFormatException e) {\n return false;\n }\n }",
"public void handleNumbers() {\n // TODO handle \"one\", \"two\", \"three\", etc.\n }",
"public boolean testForNumber() throws IOException {\n int token = fTokenizer.nextToken();\n\tfTokenizer.pushBack();\n return (token == StreamTokenizer.TT_NUMBER);\n }",
"public boolean isNumeric() {\n return this.isInteger() || this.isDecimal() || this.isDouble();\n }",
"boolean isInt(TextField input);",
"public default boolean hasNumber() {\n\t\treturn false;\n\t}",
"public boolean isNum(String cad){\n try{\n Integer.parseInt(cad);\n return true;\n }catch(NumberFormatException nfe){\n System.out.println(\"Solo se aceptan valores numericos\");\n return false;\n }\n }",
"public boolean isNum(String x) {\n\t\tfor (int i = 0; i < x.length(); i++) {\n\t\t\tchar c = x.charAt(i);\n\t\t\tif ((c == '-' || c == '+') && x.length() > 1)\n\t\t\t\tcontinue;\n\t\t\tif ((int) c > 47 && (int) c < 58)\n\t\t\t\tcontinue;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public boolean checkNum(String n,JTextField t,int len) \n\t{\n\t\tboolean number=true;\t\t//We are assuming that name will be a String \n\t\tboolean result=false;\n\t\ttry \n\t\t{\n\t\t\tDouble num=Double.parseDouble(n); //if s contains sting then it will not be parse and it will throw exception\t\n\t\t}\n\t\tcatch(NumberFormatException e)\n\t\t{\t\tnumber=false;\t\t}\n\t\t\n\t\tif(number==true) // true\n\t\t{\n\t\t\t//it is a number\n\t\t\tif(n.length()==len)\n\t\t\t{\tresult=true;\t}\n\t\t\telse\n\t\t\t{\tresult=false;\t}\n\t\t}\n\t\telse if(number==false) //it is a String\n\t\t{\tresult=false;\t}\n\t\treturn result;\n}",
"private boolean isNumber(String str) {\r\n int ASCII_0 = 48;\r\n int ASCII_9 = 57;\r\n if (str.equals(\"\")) {\r\n return false;\r\n }\r\n for (int i = 0; i < str.length(); i++) {\r\n int chr = str.charAt(i);\r\n if (chr < ASCII_0 || chr > ASCII_9) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }",
"public static boolean IsNumber(int par_Numer) {\n return true;\n }",
"public static boolean IsNumber(double par_Number) {\n return true;\n }",
"protected boolean isNumberValid(@NotNull ConversationContext context, @NotNull Number input) {\n/* 30 */ return true;\n/* */ }",
"public boolean isParsable(String input){\n boolean parsable = true;\n try{\n Integer.parseInt(input);\n }catch(NumberFormatException e){\n parsable = false;\n }\n return parsable;\n}",
"public boolean isNumeric(String str){\n try {\n int i = Integer.parseInt(str);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }",
"private boolean isNumber(String number){\n\t\ttry{\r\n\t\t\tFloat.parseFloat(number);\r\n\t\t}catch(Exception e){\r\n\t\t\treturn false;// if the user input is not number it throws flase\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"public static boolean numeric(Type p) {\n\t\tif (p == Type.Char || p == Type.Int || p == Type.Float) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"private boolean isInteger(String str)\r\n {\r\n try\r\n {\r\n int i = Integer.parseInt(str);\r\n } catch (NumberFormatException nfe)\r\n {\r\n MyLogger.log(Level.INFO, LOG_CLASS_NAME + \"Non numeric value. Value was: {0}\", str);\r\n return false;\r\n }\r\n return true;\r\n }",
"private boolean isInteger(String s)\n{\n\t boolean isNumber = true;\n\ttry{\n\t\t\tint n = Integer.parseInt(s);\n\t }catch(NumberFormatException n)\n\t {\n\t\t isNumber = false;\n\t }\n\n\treturn isNumber;\n}",
"private boolean isNumber(final String number) {\n try {\n Integer.parseInt(number);\n return true;\n } catch (Exception e) {\n LOGGER.error(\"Not a number \" + number, e);\n return false;\n }\n }",
"public boolean isInteger();",
"public boolean isNumber(String in) \n\t{\n\t\ttry \n\t\t{\n\t\t\tInteger.parseInt(in);\n\t\t\treturn true;\n\t\t}\n\t\tcatch (Exception e) \n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"@Override\n public JsonParser.NumberType numberType() {\n // most types non-numeric, so:\n return null;\n }",
"public boolean isPrimitiveOrString(String fieldType) {\n return fieldType.equals(\"int\") || fieldType.equals(\"short\") || fieldType.equals(\"long\") ||\n fieldType.equals(\"byte\") || fieldType.equals(\"char\") || fieldType.equals(\"float\") ||\n fieldType.equals(\"double\") || fieldType.equals(\"boolean\") || fieldType.equals(\"String\");\n }",
"private String isValid(String number)\n {\n\tif(number.matches(\"\\\\d+\")) return number;\n\treturn null;\n }",
"public String validateNumberString() {\n String tempNumber = numberString;\n int start = 0;\n Pattern pattern = Pattern.compile(\"\\\\D+\");\n Matcher matcher = pattern.matcher(tempNumber);\n if (isZero()) {\n return \"0\";\n }\n if (isNegative()) {\n start++;\n }\n if (matcher.find(start)) {\n throw new IllegalArgumentException(\"Wrong number: \" + tempNumber);\n }\n pattern = Pattern.compile(\"([1-9][0-9]*)\");\n matcher.usePattern(pattern);\n if (!matcher.find(0)) {\n throw new IllegalArgumentException(\"Wrong number: \" + tempNumber);\n }\n return tempNumber.substring(matcher.start(), matcher.end());\n }",
"private boolean isInteger(String a) {\n try \n {\n Integer.parseInt(a);\n return true;\n }\n catch(Exception e) {\n return false;\n }\n }",
"@Override\n public abstract JsonParser.NumberType numberType();",
"private boolean isInteger(String element) {\r\n try {\r\n Integer.valueOf(element);\r\n } catch (NumberFormatException e) {\r\n return false;\r\n }\r\n return true;\r\n }",
"public boolean isNumber(String sIn)\r\n {\r\n int parseNumber = -1;\r\n \r\n try{\r\n parseNumber = Integer.parseInt(sIn);\r\n }catch(Exception e){\r\n return false;\r\n }\r\n \r\n return true;\r\n }",
"@Test(expectedExceptions=NumberFormatException.class)\r\n\tpublic void chkNumberFrmtExcep(){\r\n\t\tString x=\"100A\";\r\n\t\tint f=Integer.parseInt(x);//it will throw exception bcoz x=100A, if it is 100 it will not throw exception\r\n\t}",
"private void processNumericModifier() {\n\n Token token = tokens.get(currentTokenPointer);\n\n if (currentVersionComponent == 3) {\n\n raiseParseProblem(\"cannot specify a numerical +/- value for the qualifier, found '\" + string(token) + \"' at position \" + token.start,\n\n token.start);\n\n }\n\n String tokenString = string(token);\n\n try {\n\n Integer value = null;\n\n if (token.kind == TokenKind.PLUSNUMBER) {\n\n value = Integer.parseInt(tokenString.substring(1));\n\n } else {\n\n value = Integer.parseInt(tokenString);\n\n }\n\n pushIt(new SumTransformer(value));\n\n } catch (NumberFormatException nfe) {\n\n raiseParseProblem(\"cannot parse numerical value '\" + tokenString + \"' at position \" + token.start, token.start);\n\n }\n\n }",
"private static boolean stringContainsNumber( String userName ) {\n return Pattern.compile( \"[0-9]\" ).matcher( userName).find();\n }",
"public static boolean isNumeric(String value) {\n // Procedimiento para monitorear e informar sobre la excepcion\n try {\n //Se realiza asignacion de dato numerico\n Float.parseFloat(value);\n return true;\n\n }\n //Mostrar mensaje de error\n catch(NumberFormatException e){\n JOptionPane.showMessageDialog(null,Constantes.TXT_Msg_Error,\n \"Error\",\n JOptionPane.ERROR_MESSAGE);\n\n return false;\n\n }\n\n }",
"public boolean checkName(String name)\n\t{\n\t\tboolean number=true;\t\t//We are assuming that name will be a String \t\t\n\t\ttry \n\t\t{\t\t\n\t\t\tDouble num=Double.parseDouble(name); //if s contains sting then it will not be parse and it will throw exception\t\n\t\t}\n\t\tcatch(NumberFormatException e)\n\t\t{\n\t\t\tnumber=false;\n\t\t\treturn number;\n\t\t}\t\t\n\t\treturn number;\n\t}",
"@Test\n\tpublic void test_doubleANumber() {\n\t\t\n\t}",
"public boolean isNumeric(String strNum) {\n if (strNum == null) {\n return false;\n }\n try {\n double d = Double.parseDouble(strNum);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }",
"private boolean isInt (String s) {\n\t\ttry {\n\t\t\tif(Integer.parseInt(s) < 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tcatch(NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t\tcatch(NullPointerException e) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"private boolean isInt(String str) { \n\t try { \n\t int d = Integer.parseInt(str); \n\t } catch(NumberFormatException nfe) { \n\t return false; \n\t } \n\t return true; \n\t}",
"protected boolean isNumeric(final String id) {\n\t\tfinal NumberFormat formatter = NumberFormat.getInstance();\n\t\tfinal ParsePosition pos = new ParsePosition(0);\n\t\tformatter.parse(id, pos);\n\t\treturn id.length() == pos.getIndex();\n\t}",
"private boolean isInteger(String userInput){\n if (userInput.matches(\"[0-9]+\")) {\n return true;\n }\n return false;\n }",
"@Test\n public void testStringFractionImplInvalidStrings() {\n assertThrows(NumberFormatException.class, () -> {\n new FractionImpl(\"9 9 0/2\");\n });\n //Input value which is not a number\n assertThrows(NumberFormatException.class, () -> {\n new FractionImpl(\"One\");\n });\n }",
"private String literal(Number num) {\n int i = num.intValue();\n double d = num.doubleValue();\n \n if (i == d) {\n return String.valueOf(i);\n } else {\n // TODO: proper number formatting should be used\n return num.toString();\n }\n }",
"private void processNumber() {\r\n\t\tString number = extractNumber();\r\n\r\n\t\tif ((!number.equals(\"1\")) && (!number.equals(\"0\"))) {\r\n\t\t\tthrow new LexerException(String.format(\"Unexpected number: %s.\", number));\r\n\t\t}\r\n\r\n\t\ttoken = new Token(TokenType.CONSTANT, number.equals(\"1\"));\r\n\t}",
"public void testSetNumber() {\n ValueString vs = new ValueString();\n\n vs.setNumber(0);\n assertEquals(\"0.0\", vs.getString());\n vs.setNumber(1);\n assertEquals(\"1.0\", vs.getString());\n vs.setNumber(-1);\n assertEquals(\"-1.0\", vs.getString());\n vs.setNumber(2.5);\n assertEquals(\"2.5\", vs.getString());\n vs.setNumber(2.8);\n assertEquals(\"2.8\", vs.getString());\n }",
"private boolean isAllNums(String fieldVal){\r\n // Get rid of all whitespace\r\n String val = fieldVal.replaceAll(\"\\\\s\",\"\").trim();\r\n // check for presence of letters in the string, ignoring '()' and '-'\r\n for (int i=0; i < val.length(); i++){\r\n if (val.charAt(i) != '(' || val.charAt(i) != ')' || val.charAt(i) != '-'){\r\n if (Character.isLetter(val.charAt(i))){\r\n return false;\r\n }\r\n }\r\n }\r\n return true; \r\n }",
"public static Value makeAnyStrNotNumeric() {\n return theStrNotNumeric;\n }",
"java.lang.String getNumber();",
"java.lang.String getNumber();",
"java.lang.String getNumber();",
"private boolean isNumber(char c){\n if(c >= 48 && c < 58)\n return true;\n else{\n return false;\n }\n }",
"public static boolean IsNumber(String par_Number) {\n\n java.util.regex.Pattern p = java.util.regex.Pattern.compile(\"^\\\\-?\\\\d*.?\\\\d+$\");\n java.util.regex.Matcher m = p.matcher(par_Number);\n\n return m.matches() || IsInteger(par_Number);\n }",
"@Test\n\tpublic void checkNumbersFollowedByExclamationMark() {\n\t\tString input = \"Five six SEVEN eiGHt!!\";\n\n\t\tStringUtility stringUtility = new StringUtility();\n\t\tString actualCastedString = stringUtility.castWordNumberToNumber(input);\n\n\t\tString correctlyCastedString = \"5 6 7 8!!\";\n\n\t\tAssert.assertEquals(actualCastedString, correctlyCastedString);\n\t}",
"public static boolean isNumeric(String cadena){ \r\n try {\r\n Integer.parseInt(cadena);\r\n return true;\r\n } catch (NumberFormatException e){\t\r\n System.out.println(e.getMessage());\r\n return false;\r\n }\r\n }",
"private static boolean isParsable(String input) {\n try {\n Integer.parseInt(input);\n return true;\n } catch (NumberFormatException e) {\n return false;\n }\n }",
"private boolean isNumeric(String s)\n {\n for (int i = 0; i < s.length(); ++i)\n {\n if (!Character.isDigit(s.charAt(i)))\n {\n return false;\n }\n }\n return true;\n }",
"public boolean isNumber(String str) {\n\t\treturn str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\");\n\t}",
"public static Value makeAnyStrNumeric() {\n return theStrNumeric;\n }",
"@Override\n\tpublic Object visit(ASTNum node, Object data)\n\t{\n\t\tFormulaSemantics semantics = (FormulaSemantics) data;\n\t\tif (node.jjtGetNumChildren() != 0)\n\t\t{\n\t\t\tFormulaSemanticsUtilities.setInvalid(semantics,\n\t\t\t\tgetInvalidCountReport(node, 0));\n\t\t\treturn semantics;\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tDouble.parseDouble(node.getText());\n\t\t\tsemantics.setInfo(FormulaSemanticsUtilities.SEM_FORMAT,\n\t\t\t\tnew FormulaFormat(NUMBER_CLASS));\n\t\t}\n\t\tcatch (NumberFormatException e)\n\t\t{\n\t\t\tFormulaSemanticsUtilities.setInvalid(semantics, node.getClass()\n\t\t\t\t+ \" had invalid number: \" + node.getText());\n\t\t}\n\t\treturn semantics;\n\t}",
"private boolean isValidNumber(String quantity) {\n\t\ttry{\n\t\t\tint value=Integer.parseInt(quantity);\n\t\t\treturn value>0? true: false;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t}",
"private static boolean isPositiveInteger(String s){\n\t\ttry{\n\t\t\t//If the token is an integer less than 0 return false\n\t\t\tif(Integer.parseInt(s) < 0){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t//If an exception occurs return false\n\t\tcatch(NumberFormatException e){\n\t\t\treturn false;\n\t\t}\n\t\t//otherwise return true\n\t\treturn true;\n\t}",
"private boolean isDouble(String str)\r\n {\r\n try\r\n {\r\n double i = Double.parseDouble(str);\r\n } catch (NumberFormatException nfe)\r\n {\r\n MyLogger.log(Level.INFO, LOG_CLASS_NAME + \"Non numeric value. Value was: {0}\", str);\r\n return false;\r\n }\r\n return true;\r\n }",
"public static boolean isNumber(String s) \r\n{ \r\n for (int i = 0; i < s.length(); i++) \r\n if (Character.isDigit(s.charAt(i)) \r\n == false) \r\n return false; \r\n\r\n return true; \r\n}"
] | [
"0.72930956",
"0.68743765",
"0.6770963",
"0.67086136",
"0.6591574",
"0.6523042",
"0.6470754",
"0.64641446",
"0.6436091",
"0.6390883",
"0.63894737",
"0.63848937",
"0.63672286",
"0.6365718",
"0.6358729",
"0.63498276",
"0.6346392",
"0.6340304",
"0.632807",
"0.63262504",
"0.62688303",
"0.6254639",
"0.6254471",
"0.6239102",
"0.6238713",
"0.6221969",
"0.62075347",
"0.6202368",
"0.62018555",
"0.6195654",
"0.61846673",
"0.6180431",
"0.61763704",
"0.6172466",
"0.6171649",
"0.6148493",
"0.61172855",
"0.61076826",
"0.6104677",
"0.6095192",
"0.6079425",
"0.6074133",
"0.60336196",
"0.60254496",
"0.601986",
"0.5997517",
"0.5993901",
"0.5988912",
"0.5968301",
"0.59648657",
"0.59628403",
"0.5953802",
"0.5953602",
"0.59403497",
"0.5938359",
"0.59222186",
"0.59205645",
"0.5893892",
"0.58725244",
"0.5866842",
"0.58649516",
"0.5864873",
"0.58559793",
"0.58555776",
"0.58438396",
"0.58425725",
"0.58405334",
"0.5838799",
"0.58358437",
"0.58313996",
"0.5822529",
"0.5818849",
"0.57891065",
"0.5785357",
"0.57845634",
"0.57818335",
"0.57804626",
"0.57797164",
"0.57765955",
"0.57645315",
"0.57630044",
"0.57617",
"0.5760294",
"0.57595897",
"0.5757418",
"0.57547486",
"0.57547486",
"0.57547486",
"0.5742161",
"0.5739137",
"0.5739121",
"0.5736849",
"0.5735811",
"0.5731689",
"0.57153016",
"0.57097465",
"0.57092285",
"0.5707961",
"0.57064867",
"0.57045746",
"0.569943"
] | 0.0 | -1 |
/ TODO must figure out proper promotion of types and other actual typechecking, for now only check if they are of the same type (nonJavadoc) | public Object visitBinaryExpr(GoIRBinaryExprNode node){
String l = node.getType();
if(l!= null) {//already discovered type of children
return l;
}
l = (String) node.getLeft().accept(this);
String r = (String) node.getRight().accept(this);
GoException error = Compare(l,r,"visitbinary");
if(error != null) {
throw error;
}
node.setType(l);//so it doesnt have to repeatedly check
// like 3+3+3+3+3... would make a big tree and we dont need to repeatedly check
return l;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void checkTypes(Variable first, Variable second) throws OutmatchingParameterType {\n VariableVerifier.VerifiedTypes firstType = first.getType();\n VariableVerifier.VerifiedTypes secondType = second.getType();\n\n if (!firstType.equals(secondType)) {\n throw new OutmatchingParameterType();\n }\n }",
"@Override\n\tpublic boolean checkTypes() {\n\t\treturn false;\n\t}",
"@Test\n void shouldReturnPrimitiveTypeOnly() {\n assertThat(TypeVisitor.gatherAllTypes(int.class), contains(int.class));\n assertThat(TypeVisitor.gatherAllTypes(double.class), contains(double.class));\n assertThat(TypeVisitor.gatherAllTypes(char.class), contains(char.class));\n }",
"public void testType() {\n assertTrue( ((OclAny)(Ocl.getOclRepresentationFor(6))).oclIsTypeOf(tInteger).isTrue() );\n assertTrue( ((OclAny)(Ocl.getOclRepresentationFor(6))).oclIsTypeOf(tReal).not().isTrue() ); //differs\n assertTrue( ((OclAny)(Ocl.getOclRepresentationFor(p1))).oclIsTypeOf(tPersonFQ).isTrue() );\n assertTrue( ((OclAny)(Ocl.getOclRepresentationFor(\"foo\"))).oclIsTypeOf(tOclString).isTrue() );\n assertTrue( ((OclAny)(Ocl.getOclRepresentationFor(true))).oclIsTypeOf(tBoolean).isTrue() );\n assertTrue( ((OclAny)(Ocl.getOclRepresentationFor(6.0))).oclIsTypeOf(tReal).isTrue() );\n assertTrue( ((OclAny)(Ocl.getOclRepresentationFor(6.0))).oclIsTypeOf(tInteger).not().isTrue() );\n assertTrue( ((OclAny)(Ocl.getOclRepresentationFor(p2))).oclIsTypeOf(tCompany).not().isTrue() );\n assertTrue( ((OclAny)(Ocl.getOclRepresentationFor(false))).oclIsTypeOf(tAny).not().isTrue() ); //differs\n assertTrue( ((OclAny)(Ocl.getOclRepresentationFor(0.0))).oclIsTypeOf(tAny).not().isTrue() ); // differs\n assertTrue( ((OclAny)(Ocl.getOclRepresentationFor(0))).oclIsTypeOf(tAny).not().isTrue() ); // differs\n assertTrue( ((OclAny)(Ocl.getOclRepresentationFor(p1))).oclIsTypeOf(tObject).not().isTrue() ); // differs\n }",
"private boolean areSameType(String s1, String s2) {\n\t\treturn((isMatrix(s1) && isMatrix(s2)) || (isOperator(s1) && isOperator(s2)) || (isNumber(s1) && isNumber(s2)));\n\t}",
"private static void checkConvertibility(JValue val, JType typ){\r\n\t\tJType argTyp = val.getType();\n\t\tif (argTyp == null) {\n\t\t\tif (!(typ == AnyType.getInstance() || typ.isObject())) {\n\t\t\t\tthrow new TypeIncompatibleException(JObjectType.getInstance(), typ);\n\t\t\t}\n\t\t} else {\n\t\t\tConvertibility conv = argTyp.getConvertibilityTo(typ);\n\t\t\tif(conv == Convertibility.UNCONVERTIBLE){\n\t\t\t\tthrow new TypeIncompatibleException(argTyp, typ);\n\t\t\t} else if (conv == Convertibility.UNSAFE && argTyp == AnyType.getInstance()){\n\t\t\t\tUntypedValue uv = (UntypedValue) val;\n\t\t\t\tcheckConvertibility(uv.getActual(), typ);\n\t\t\t}\n\t\t}\r\n\t}",
"public abstract boolean isTypeCorrect();",
"private boolean compatibleNodeTypes(AxiomTreeNode t1, AxiomTreeNode t2) {\n if (!t1.getNodeType().equals(t2.getNodeType())) {\n return false;\n }\n \n switch (t1.getNodeType()) {\n case CARD:\n int label1 = (Integer) t1.getLabel();\n int label2 = (Integer) t2.getLabel();\n return (label1 == label2);\n \t\n case OWLOBJECT:\n OWLObject o1 = (OWLObject) t1.getLabel();\n OWLObject o2 = (OWLObject) t2.getLabel();\n //System.out.println(o1.getClass());\n //System.out.println(o2.getClass());\n //Check for datatypes - then check datatype to see match. Else, return true if compatible.\n if(o1.getClass() == o2.getClass())\n {\n \tif(!o1.getDatatypesInSignature().isEmpty())\n \t{\n \t\t//Need to check if built in first. First check is convenience, datatypes should match\n \t\t//If one is built in, so should other. If neither is built in, this is also a viable match\n \t\t//If not equal and at least one is built in, its not a match.\n \t\tOWLDatatype dt1 = (OWLDatatype) o1.getDatatypesInSignature().toArray()[0];\n \t\t\tOWLDatatype dt2 = (OWLDatatype) o2.getDatatypesInSignature().toArray()[0];\n \t\t\t//System.out.println(\"DT1: \" + dt1);\n \t\t\t//System.out.println(\"DT2: \" + dt2);\n \t\tif(dt1.equals(dt2) && dt1.isBuiltIn())\n \t\t{\t\n \t\t\t//System.out.println(\"Standard state\");\n \t\t\t//System.out.println(o1.equals(o2));\n \t\t\treturn o1.equals(o2);\n \t\t}\n \t\telse if(!dt1.isBuiltIn() && !dt2.isBuiltIn())\n \t\t{\n \t\t\t//System.out.println(\"Unique state\");\n \t\t\treturn true;\n \t\t}\n \t\telse\n \t\t{\n \t\t\t//System.out.println(\"Rejection state\");\n \t\t\treturn false;\n \t\t}\n \n \t}\n \telse\n \t{\n \t\treturn true;\n \t}\n }\n else\n {\n \treturn false;\n }\n }\n return false;\n }",
"private void checkCommon() {\n final AnnotationTypeDeclaration commonAnnoType = (AnnotationTypeDeclaration) _env.getTypeDeclaration(Common.class.getName());\n final Collection<Declaration> decls = _env.getDeclarationsAnnotatedWith(commonAnnoType);\n for (Declaration decl : decls) {\n if (decl instanceof FieldDeclaration) {\n final FieldDeclaration field = (FieldDeclaration) decl;\n final TypeMirror type = field.getType();\n if (type instanceof DeclaredType) {\n final TypeMirror collectionType = _env.getTypeUtils().getDeclaredType(_env.getTypeDeclaration(Collection.class.getName()));\n final Collection<TypeMirror> typeVars = ((DeclaredType) type).getActualTypeArguments();\n if (typeVars.size() == 1) {\n TypeMirror typeVar = typeVars.iterator().next();\n boolean assignable = _env.getTypeUtils().isAssignable(typeVar, collectionType);\n if (assignable)\n _msgr.printError(typeVar + \" is assignable to \" + collectionType);\n else\n _msgr.printError(typeVar + \" is not assignable to \" + collectionType);\n }\n }\n } else if (decl instanceof TypeDeclaration) {\n final TypeDeclaration typeDecl = (TypeDeclaration) decl;\n final Collection<TypeParameterDeclaration> typeParams = typeDecl.getFormalTypeParameters();\n for (TypeParameterDeclaration typeParam : typeParams) {\n Declaration owner = typeParam.getOwner();\n _msgr.printError(\"Type parameter '\" + typeParam + \"' belongs to \" + owner.getClass().getName() + \" \" + owner.getSimpleName());\n }\n } else if (decl instanceof MethodDeclaration) {\n final MethodDeclaration methodDecl = (MethodDeclaration) decl;\n final Collection<TypeParameterDeclaration> typeParams = methodDecl.getFormalTypeParameters();\n for (TypeParameterDeclaration typeParam : typeParams) {\n Declaration owner = typeParam.getOwner();\n _msgr.printError(\"Type parameter '\" + typeParam + \"' belongs to \" + owner.getClass().getName() + \" \" + owner.getSimpleName());\n }\n }\n }\n }",
"public boolean areSameType(Type typeone, Type typetwo){\n if(areBinaryAlias(typeone,typetwo)) return true;\n else if (typeone instanceof ArrayType && typetwo instanceof ArrayType){\n Type typel;\n Type typer;\n ArrayType lefta = (ArrayType) typeone;\n ArrayType righta = (ArrayType) typetwo;\n typel = lefta.getType();\n typer = righta.getType();\n if(!areComparable(typel,typer)) return false;\n else return true;\n }\n /* areComparable takes care of the basic types except boolean*/\n else if(areComparable(typeone,typetwo)) return true;\n else if (typeone instanceof BooleanType && typetwo instanceof BooleanType) return true;\n /* compare every field in the two structs */\n \n /* if slices, compare their underlying types */\n else if (typeone instanceof SliceType && typetwo instanceof SliceType){\n Type typel,typer;\n SliceType lefta = (SliceType) typeone;\n SliceType righta = (SliceType) typetwo;\n typel = lefta.getType();\n typer = righta.getType();\n if(areSameType(typel,typer)) return true;\n else return false;\n }\n /* function return type might be null */\n else if (typeone==null && typetwo==null) {\n return true;\n }\n /* otherwise, return false */\n else {\n return false;\n }\n }",
"private void validateTypes() {\r\n\t\tfor (int i = 0; i < types.length; i++) {\r\n\t\t\tString type = types[i];\r\n\t\t\tif (!TypedItem.isValidType(type))\r\n\t\t\t\tthrow new IllegalArgumentException(String.format(\"The monster type %s is invalid\", type));\r\n\t\t\tfor (int j = i + 1; j < types.length; j++) {\r\n\t\t\t\tif (type.equals(types[j])) {\r\n\t\t\t\t\tthrow new IllegalArgumentException(\"The monster cant have two similar types..\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}",
"public boolean areComparable(Type typeone, Type typetwo){\n /* first check the basic types */\n if((typeone instanceof IntType && typetwo instanceof IntType) || (typeone instanceof Float64Type && typetwo instanceof Float64Type) || (typeone instanceof BooleanType && typetwo instanceof BooleanType) ||(typeone instanceof RuneType && typetwo instanceof RuneType) || (typeone instanceof StringType && typetwo instanceof StringType)) return true;\n /* structs are comparable if they correspond to the same type declaration and the fields are comparable */\n\n else if(typeone instanceof StructType && typetwo instanceof StructType){\n \n String name1 = ((StructType)typeone).getStructName();\n String name2 = ((StructType)typetwo).getStructName();\n if (name1==name2 || (name1.equals(name2) && name1.equals(\"\"))) {\n StructType lefts = (StructType) typeone;\n StructType rights = (StructType) typetwo;\n List<Map.Entry<List<String>,Type>> leftlist = lefts.getFields();\n List<Map.Entry<List<String>,Type>> rightlist = rights.getFields();\n if (leftlist.size()!=rightlist.size()) {\n return false;\n }\n for(int i=0; i<leftlist.size(); i++){\n Type typel = leftlist.get(i).getValue();\n Type typer = rightlist.get(i).getValue();\n if(!areComparable(typel,typer)) {\n return false;\n }\n }\n return true;\n }\n else {\n return false;\n }\n }\n /* finally, if they are arrays, check that the underlying type is comparable */\n else if(typeone instanceof ArrayType && typetwo instanceof ArrayType){\n Type typel,typer;\n ArrayType lefta = (ArrayType) typeone;\n ArrayType righta = (ArrayType) typetwo;\n typel = lefta.getType();\n typer = righta.getType();\n if(!areComparable(typel,typer) || !(lefta.getSize().equals(righta.getSize()))) return false;\n else return true;\n }\n else if (typeone instanceof AliasType && typetwo instanceof AliasType) {\n AliasType left = (AliasType) typeone;\n AliasType right = (AliasType) typetwo;\n if (left.getAliasName()==right.getAliasName()) {\n return true;\n }\n else {\n return false;\n }\n\n }\n else return false;\n }",
"private void fixType(NameInfo name1Info, NameInfo name2Info) {\n\t\tString type1 = name1Info.getType();\n\t\tString type2 = name2Info.getType();\n//\t\tString name1 = name1Info.getName();\n//\t\tString name2 = name2Info.getName();\n\t\t\n\t\tif (!name1Info.isEnforced() && !name2Info.isEnforced()) {\n\t\t\tfixLoc(name1Info);\n\t\t\tfixLoc(name2Info);\n\t\t\tfixOrg(name1Info);\n\t\t\tfixOrg(name2Info);\n\t\t\tfixPeople(name1Info);\n\t\t\tfixPeople(name2Info);\n\t\t\tString longName = \"\";\n\t\t\tString shortName = \"\";\n\t\t\tif ((name1Info.getName()).length() >= (name2Info.getName()).length()) {\n\t\t\t\tlongName = name1Info.getName();\n\t\t\t\tshortName = name2Info.getName();\n\t\t\t} else {\n\t\t\t\tlongName = name2Info.getName();\n\t\t\t\tshortName = name1Info.getName();\n\t\t\t}\n\t\t\tif (acroMan.isAcronymFirstLetters(shortName, longName)) {\n\t\t\t\tname1Info.setType(\"ORG\");\n\t\t\t\tname2Info.setType(\"ORG\");\n\t\t\t}\n\t\t}\n\t\t\n\t\ttype1 = name1Info.getType();\n\t\ttype2 = name2Info.getType();\n\t\t\n\t\tif (!type1.equals(NameInfo.GENERIC_TYPE) && !type2.equals(NameInfo.GENERIC_TYPE) && !type1.equals(type2)){\n\t\t\tscoreShingle = 0.0f;\n\t\t\tscore = 0.0f;\n\t\t\treason = \"Types \" + type1 + \" and \" + type2 + \" cannot be compared\";\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (type1.equals(NameInfo.GENERIC_TYPE) && !type2.equals(NameInfo.GENERIC_TYPE)) {\n\t\t\ttype1 = type2;\n\t\t\tname1Info.setType(type1);\n\t\t} else if (type2.equals(NameInfo.GENERIC_TYPE) && !type1.equals(NameInfo.GENERIC_TYPE)) {\n\t\t\ttype2 = type1;\n\t\t\tname2Info.setType(type2);\n\t\t}\n\t}",
"public void testInferNumber1a() throws Exception {\n assertType(\"10 \", 0, 2, \"java.lang.Integer\");\n }",
"static void checkArgTypes(\r\n\t\tString funcName, Argument[] args, JParameter[] params) {\r\n\t\tif(args.length != params.length){\r\n\t\t\tthrow new IllegalArgumentsException(funcName, \"Wrong number of arguments\");\r\n\t\t}\r\n\t\t\r\n\t\tfor(int i=0;i<args.length;i++){\r\n\t\t\tJValue val = args[i].getValue();\r\n\t\t\tJParameter jp = params[i];\r\n\t\t\tif(jp.isUntyped()){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tJType typ = jp.getType();\r\n\t\t\tif(RefValue.isGenericNull(val)){\r\n\t\t\t\tJTypeKind kind = typ.getKind();\r\n\t\t\t\tif (kind == JTypeKind.CLASS || kind == JTypeKind.PLATFORM){\r\n\t\t\t\t\t// If it is a generic null, replace it with a typed null to comply with function declaration.\r\n\t\t\t\t\tRefValue rv = RefValue.makeNullRefValue(\r\n\t\t\t\t\t\tval.getMemoryArea(), kind == JTypeKind.CLASS ? (ICompoundType)typ : JObjectType.getInstance());\r\n\t\t\t\t\targs[i].setValue(rv);\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcheckConvertibility(val, typ);\r\n\t\t}\r\n\t}",
"@Test\n public void testIsTypeOf() throws ValueDoesNotMatchTypeException {\n testTypeKindOf(AnyType.IS_TYPE_OF);\n }",
"@Test\n void cannotInferType() {\n }",
"@Test\n public void testIsKindOf() throws ValueDoesNotMatchTypeException {\n testTypeKindOf(AnyType.IS_KIND_OF);\n }",
"void checkSameDataType(String datatype, String datatype1)\n {\n DefaultTableModel semanticerror = (DefaultTableModel)tblErrorSemantic.getModel();\n if(datatype.equals(datatype1))\n {\n\n }\n else if(datatype.equals(\"INT\") && datatype1.equals(\"FLOAT\"))\n {\n \n }\n else if(datatype.equals(\"FLOAT\") && datatype1.equals(\"INT\"))\n {\n \n }\n else if(datatype1 == null)\n {\n\n }\n else\n {\n semanticerror.addRow(new Object[] {tblLexeme.getModel().getValueAt(tokenPos-2, 0),\"Incompatible Types: \"+datatype1+\" Cannot be converted to \"+datatype, tblLexeme.getModel().getValueAt(tokenPos-2, 2)}); \n } \n datatype = null;\n }",
"@Test\n public void getTypeArguments() {\n List<String> target=new ArrayList<String>() {{\n add(\"thimble\");\n }};\n\n Type[] arguments= TypeDetective.sniffTypeParameters(target.getClass(), ArrayList.class);\n assertEquals(1, arguments.length);\n assertEquals(String.class,arguments[0]);\n }",
"public boolean areIntegral(Type typeone, Type typetwo){\n /* if they are both the same alias type, get the underlying type */\n if(areBinaryAlias(typeone,typetwo)){\n typeone = removeAlias(typeone);\n typetwo = removeAlias(typetwo);\n }\n if((typeone instanceof IntType && typetwo instanceof IntType) || (typeone instanceof RuneType && typetwo instanceof RuneType)) return true;\n else return false;\n }",
"Type1Equivalent getType1Equivalent();",
"private static boolean shouldStop(AnnotatedTypeMirror sup, AnnotatedTypeMirror sub) {\n // Check if it's the same type\n // if sup is primitive, but not sub\n if (sup.getKind().isPrimitive() && !sub.getKind().isPrimitive()) {\n /// XXX shouldn't this be \"return false\"?\n return true;\n }\n if (sup.getKind().isPrimitive() && sub.getKind().isPrimitive()) {\n return sup.getKind() == sub.getKind();\n }\n // if both are declared\n if (sup.getKind() == TypeKind.DECLARED && sub.getKind() == TypeKind.DECLARED) {\n AnnotatedDeclaredType supdt = (AnnotatedDeclaredType) sup;\n AnnotatedDeclaredType subdt = (AnnotatedDeclaredType) sub;\n\n // Check if it's the same name\n if (!supdt.getUnderlyingType().asElement().equals(\n subdt.getUnderlyingType().asElement()))\n return false;\n\n return true;\n }\n\n if (sup.getKind() == TypeKind.ARRAY && sub.getKind() == TypeKind.ARRAY) {\n AnnotatedArrayType supat = (AnnotatedArrayType) sup;\n AnnotatedArrayType subat = (AnnotatedArrayType) sub;\n return shouldStop(supat.getComponentType(), subat.getComponentType());\n }\n // horrible horrible hack\n // Types.isSameType() doesn't work for type variables or wildcards\n return sup.getUnderlyingType().toString().equals(sub.getUnderlyingType().toString());\n }",
"protected abstract boolean canConvert(Class<?> parameterType, Class<?> originalArgumentType);",
"@Override\n public abstract boolean isAssignableBy(TypeUsage other);",
"private static void assertEqualsExactType(int a, int b) {\n Assert.assertEquals(a, b);\n }",
"private static void assertEqualsExactType(int a, int b) {\n Assert.assertEquals(a, b);\n }",
"private static boolean isErased(Types types, AnnotatedTypeMirror t1, AnnotatedTypeMirror t2) {\n return types.isSameType(\n types.erasure(t1.getUnderlyingType()), t2.getUnderlyingType());\n }",
"protected static boolean checkTypeReferences() {\n Map<Class<?>, LinkedList<Class<?>>> missingTypes = new HashMap<>();\n for (Map.Entry<String, ClassProperties> entry : classToClassProperties.entrySet()) {\n String className = entry.getKey();\n Class<?> c = lookupClass(className);\n Short n = entry.getValue().typeNum;\n if (marshalledTypeNum(n)) {\n Class<?> superclass = getValidSuperclass(c);\n if (superclass != null)\n checkClassPresent(c, superclass, missingTypes);\n LinkedList<Field> fields = getValidClassFields(c);\n for (Field f : fields) {\n Class<?> fieldType = getFieldType(f);\n checkClassPresent(c, fieldType, missingTypes);\n }\n }\n }\n if (missingTypes.size() > 0) {\n for (Map.Entry<Class<?>, LinkedList<Class<?>>> entry : missingTypes.entrySet()) {\n Class<?> c = entry.getKey();\n LinkedList<Class<?>> refs = entry.getValue();\n String s = \"\";\n for (Class<?> ref : refs) {\n if (s != \"\")\n s += \", \";\n s += \"'\" + getSimpleClassName(ref) + \"'\";\n }\n Log.error(\"Missing type '\" + getSimpleClassName(c) + \"' is referred to by type(s) \" + s);\n }\n Log.error(\"Aborting code generation due to missing types\");\n return false;\n }\n else\n return true;\n }",
"abstract protected boolean checkType(String myType);",
"@Test\r\n public void testIsPrimitiveOrWrapper() {\n assertTrue(\"Boolean.class\", Classes.isPrimitiveOrWrapper(Boolean.class));\r\n assertTrue(\"Byte.class\", Classes.isPrimitiveOrWrapper(Byte.class));\r\n assertTrue(\"Character.class\", Classes.isPrimitiveOrWrapper(Character.class));\r\n assertTrue(\"Short.class\", Classes.isPrimitiveOrWrapper(Short.class));\r\n assertTrue(\"Integer.class\", Classes.isPrimitiveOrWrapper(Integer.class));\r\n assertTrue(\"Long.class\", Classes.isPrimitiveOrWrapper(Long.class));\r\n assertTrue(\"Double.class\", Classes.isPrimitiveOrWrapper(Double.class));\r\n assertTrue(\"Float.class\", Classes.isPrimitiveOrWrapper(Float.class));\r\n \r\n // test primitive classes\r\n assertTrue(\"boolean\", Classes.isPrimitiveOrWrapper(Boolean.TYPE));\r\n assertTrue(\"byte\", Classes.isPrimitiveOrWrapper(Byte.TYPE));\r\n assertTrue(\"char\", Classes.isPrimitiveOrWrapper(Character.TYPE));\r\n assertTrue(\"short\", Classes.isPrimitiveOrWrapper(Short.TYPE));\r\n assertTrue(\"int\", Classes.isPrimitiveOrWrapper(Integer.TYPE));\r\n assertTrue(\"long\", Classes.isPrimitiveOrWrapper(Long.TYPE));\r\n assertTrue(\"double\", Classes.isPrimitiveOrWrapper(Double.TYPE));\r\n assertTrue(\"float\", Classes.isPrimitiveOrWrapper(Float.TYPE));\r\n assertTrue(\"Void.TYPE\", Classes.isPrimitiveOrWrapper(Void.TYPE));\r\n \r\n // others\r\n assertFalse(\"null\", Classes.isPrimitiveOrWrapper(null));\r\n assertFalse(\"Void.class\", Classes.isPrimitiveOrWrapper(Void.class));\r\n assertFalse(\"String.class\", Classes.isPrimitiveOrWrapper(String.class));\r\n assertFalse(\"this.getClass()\", Classes.isPrimitiveOrWrapper(this.getClass()));\r\n }",
"private static boolean expectedInterfaceType(Expr e) {\n \t\treturn e.attrExpectedTyp() instanceof PscriptTypeInterface || e.attrExpectedTyp() instanceof PscriptTypeTypeParam;\n \t}",
"@Test\n public void equalsWithDifferentTypes() throws Exception {\n AttributeKey<Number> key1 = new AttributeKey<Number>(Number.class, \"keyName\");\n AttributeKey<Date> key2 = new AttributeKey<Date>(Date.class, \"keyName\");\n\n assertThat(key1.equals(key2), is(false));\n assertThat(key2.equals(key1), is(false));\n }",
"abstract public boolean isTyped();",
"@Test\n public void testRequireAtomString_GenericType_1() {\n LOGGER.info(\"requireAtomString\");\n final AtomString actual = new AtomString();\n final AtomString expected = requireAtomString(actual);\n assertEquals(expected, actual);\n }",
"static boolean test(Type t0)\r\n {\r\n String s0 = Types.stringFor(t0);\r\n TypeParser typeParser = TypeParsers.create();\r\n typeParser.addTypeVariableName(\"E\");\r\n Type t1 = null;\r\n try\r\n {\r\n t1 = typeParser.parse(s0);\r\n } \r\n catch (ClassNotFoundException e)\r\n {\r\n fail(e.getMessage());\r\n }\r\n \r\n String message = \"\";\r\n message += \"Input \" + s0 + \"\\n\";\r\n message += \"should be \" + t0 + \"\\n\";\r\n message += \"was parsed to \" + t1 + \"\\n\";\r\n \r\n boolean passed = TypesEquivalent.areEquivalent(t0, t1);\r\n if (!passed || DEBUG)\r\n {\r\n PrintStream ps = System.out;\r\n if (!passed)\r\n {\r\n ps = System.err;\r\n }\r\n String detailedMessage = \"\";\r\n detailedMessage += \"Input \" + s0 + \"\\n\";\r\n detailedMessage += \"should be \" + t0 + \" \" \r\n + \"(Detailed: \" + Types.debugStringFor(t0) + \")\" + \"\\n\";\r\n detailedMessage += \"was parsed to \" + t1 + \" \" \r\n + \"(Detailed: \" + Types.debugStringFor(t1) + \")\" + \"\\n\";\r\n ps.print(detailedMessage);\r\n }\r\n assertTrue(message, passed);\r\n return passed;\r\n }",
"public static boolean typesAreEquivalent(int sourceType, int destType) {\n boolean result = false;\n if (sourceType == destType) {\n result = true;\n }\n if (sourceType == Types.DECIMAL && destType == Types.NUMERIC) {\n result = true;\n }\n if (sourceType == Types.NUMERIC && destType == Types.DECIMAL) {\n result = true;\n }\n if (sourceType == Types.BOOLEAN && destType == Types.BIT) {\n result = true;\n }\n if (sourceType == Types.BIT && destType == Types.BOOLEAN) {\n result = true;\n }\n return result;\n }",
"@Test\n\tpublic void testInternalTypes() {\n\t\tlogger.info(\"Run testInternalTypes\");\n\t\tfinal IntrospectionResult introspection = getIntrospection();\n\n\t\t// OrderByDirectionOutputType\n\t\tfinal IntrospectionFullType orderByDirectionOutputType = getFullType(introspection,\n\t\t\t\tgetOrderByDirectionOutputTypeName());\n\t\tAssert.assertEquals(2, orderByDirectionOutputType.getEnumValues().size());\n\t\tassertEnum(orderByDirectionOutputType, GQLOrderByDirectionEnum.ASC.toString(), false);\n\t\tassertEnum(orderByDirectionOutputType, GQLOrderByDirectionEnum.DESC.toString(), false);\n\n\t\t// OrderByInputType\n\t\tfinal IntrospectionFullType orderByInputType = getFullType(introspection, getOrderByInputTypeName());\n\t\tAssert.assertEquals(2, orderByInputType.getInputFields().size());\n\t\tassertInputField(orderByInputType, \"field\", IntrospectionTypeKindEnum.NON_NULL,\n\t\t\t\tIntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLString.getName());\n\t\tassertInputField(orderByInputType, \"direction\", IntrospectionTypeKindEnum.ENUM,\n\t\t\t\tgetOrderByDirectionOutputTypeName());\n\n\t\t// OrderByOutputType\n\t\tfinal IntrospectionFullType orderByOutputType = getFullType(introspection, getOrderByOutputTypeName());\n\t\tAssert.assertEquals(2, orderByOutputType.getFields().size());\n\t\tassertField(orderByOutputType, \"field\", IntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLString.getName());\n\t\tassertField(orderByOutputType, \"direction\", IntrospectionTypeKindEnum.ENUM,\n\t\t\t\tgetOrderByDirectionOutputTypeName());\n\n\t\t// PagingInputType\n\t\tfinal IntrospectionFullType pagingInputType = getFullType(introspection, getPagingInputTypeName());\n\t\tAssert.assertEquals(2, pagingInputType.getInputFields().size());\n\t\tassertInputField(pagingInputType, \"offset\", IntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLInt.getName());\n\t\tassertInputField(pagingInputType, \"limit\", IntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLInt.getName());\n\n\t\t// PagingOutputType\n\t\tfinal IntrospectionFullType pagingOutputType = getFullType(introspection, getPagingOutputTypeName());\n\t\tAssert.assertEquals(3, pagingOutputType.getFields().size());\n\t\tassertField(pagingOutputType, \"offset\", IntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLInt.getName());\n\t\tassertField(pagingOutputType, \"limit\", IntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLInt.getName());\n\t\tassertField(pagingOutputType, \"totalLength\", IntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLLong.getName());\n\t}",
"private void checkType(V value) {\n valueClass.cast(value);\n }",
"public boolean areOrdered(Type typeone, Type typetwo){\n /* if they are both the same alias type, get the underlying type */\n if(areBinaryAlias(typeone,typetwo)){\n typeone = removeAlias(typeone);\n typetwo = removeAlias(typetwo);\n }//if exactly one is an alias, get it's underlying type \n// else if (typeone instanceof AliasType && !(typetwo instanceof AliasType) \n//\t\t\t\t|| !(typeone instanceof AliasType) && typetwo instanceof AliasType ) {\n//\t\t\ttypeone = removeAlias(typeone);\n//\t\t\ttypetwo = removeAlias(typetwo);\n//\t\t}\n if((typeone instanceof IntType && typetwo instanceof IntType) || (typeone instanceof Float64Type && typetwo instanceof Float64Type) || (typeone instanceof RuneType && typetwo instanceof RuneType) || (typeone instanceof StringType && typetwo instanceof StringType)) return true;\n else return false;\n }",
"@Override\n\tpublic boolean isPrimitiveTypeExpected() {\n\t\treturn false;\n\t}",
"@Override\n boolean doIsAssignableFromNonUnionType(SoyType srcType) {\n return false;\n }",
"@Test(expected = IllegalArgumentException.class)\n public void testAnotherInvalidMatch() throws Exception {\n ArrayList<Type> typeList = Lists.newArrayList();\n typeList.add(String.class);\n typeList.add(Object.class);\n typeList.add(Object.class);\n typeList.addAll(getBothParameters(ParamToListParam.class));\n typeList.add(getFirstTypeParameter(StringListSink.class));\n PipelineRegisterer.validateTypes(typeList);\n }",
"public boolean typeConformsTo(PBmmSchema schema, String type1, String type2) {\n List<String> typeList1, typeList2;\n typeList1 = BmmDefinitions.typeNameAsFlatList(type1);\n typeList2 = BmmDefinitions.typeNameAsFlatList(type2);\n int index = 0;\n\n while (index < typeList1.size() && index < typeList2.size() &&\n schema.hasClassOrPrimitiveDefinition(typeList1.get(index)) &&\n schema.hasClassOrPrimitiveDefinition(typeList2.get(index))) {\n String typePart1 = typeList1.get(index);\n String typePart2 = typeList2.get(index);\n if (!(type1.equalsIgnoreCase(typePart2) || isAncestor(schema, typePart1, typePart2))) {\n return false;\n }\n index++;\n\n }\n return true;\n }",
"public Node typeCheck () {\n\tif (declist!=null) \n\t for (Node dec:declist)\n\t\tdec.typeCheck();\n if ( !(FOOLlib.isSubtype(body.typeCheck(),type)) ){\n System.out.println(\"Wrong return type for function \"+id);\n System.exit(0);\n } \n return null;\n }",
"private Object getTypeObjectPair() throws MathLinkException, NumberRangeException {\n Object result = null;\n int type = this.getInteger();\n if (type % -17 == -15) {\n type = -7 + -17 * (type / -17);\n } else if (type % -17 == -16) {\n type = -8 + -17 * (type / -17);\n }\n switch (type) {\n case -5: {\n result = new Integer(this.getInteger());\n break;\n }\n case -6: {\n result = new Long(this.getLongInteger());\n break;\n }\n case -4: {\n int i = this.getInteger();\n if (i < -32768 || i > 32767) {\n throw new NumberRangeException(i, \"short\");\n }\n result = new Short((short)i);\n break;\n }\n case -2: {\n int i = this.getInteger();\n if (i < -128 || i > 127) {\n throw new NumberRangeException(i, \"byte\");\n }\n result = new Byte((byte)i);\n break;\n }\n case -3: {\n int i = this.getInteger();\n if (i < 0 || i > 65535) {\n throw new NumberRangeException(i, \"char\");\n }\n result = new Character((char)i);\n break;\n }\n case -15: \n case -7: {\n double d = this.getDouble();\n if (d < -3.4028234663852886E38 || d > 3.4028234663852886E38) {\n throw new NumberRangeException(d, \"float\");\n }\n result = new Float((float)d);\n break;\n }\n case -16: \n case -8: {\n result = new Double(this.getDouble());\n break;\n }\n case -9: {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n result = this.getString();\n if (tok != 35 || !result.equals(\"Null\")) break;\n result = null;\n break;\n }\n case -1: {\n String s = this.getSymbol();\n if (s.equals(\"True\")) {\n result = Boolean.TRUE;\n break;\n }\n result = Boolean.FALSE;\n break;\n }\n case -13: {\n long mark = this.createMark();\n try {\n int tok = this.getNext();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n this.seekMark(mark);\n result = this.getComplex();\n break;\n }\n this.seekMark(mark);\n result = this.getComplex();\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -10: {\n long mark = this.createMark();\n try {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n result = new BigInteger((String)result);\n break;\n }\n result = new BigInteger(this.getString());\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -11: {\n long mark = this.createMark();\n try {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n result = Utils.bigDecimalFromString((String)result);\n break;\n }\n result = Utils.bigDecimalFromString(this.getString());\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -12: {\n long mark = this.createMark();\n try {\n int tok = this.getNext();\n if (tok == 100000 && (result = this.getObject()) != null) break;\n this.seekMark(mark);\n result = this.getExpr();\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -14: {\n result = this.getObject();\n break;\n }\n case -10000: {\n break;\n }\n default: {\n int tok = this.getNext();\n result = tok == 100000 || tok == 35 ? this.getObject() : (type > -34 ? this.getArray(type - -17, 1) : (type > -51 ? this.getArray(type - -34, 2) : (type > -68 ? this.getArray(type - -51, 3) : (type > -85 ? this.getArray(type - -68, 4) : this.getArray(type - -85, 5)))));\n }\n }\n return result;\n }",
"@Override\r\n public boolean checkElements(SequenceConstructionExpression owner) {\r\n SequenceRange self = this.getSelf();\r\n Expression rangeLower = self.getRangeLower();\r\n Expression rangeUpper = self.getRangeUpper();\r\n ElementReference rangeLowerType = rangeLower == null? null: rangeLower.getType();\r\n ElementReference rangeUpperType = rangeUpper == null? null: rangeUpper.getType();\r\n return (rangeLowerType == null || rangeLowerType.getImpl().isInteger()) && \r\n (rangeUpperType == null || rangeUpperType.getImpl().isInteger());\r\n }",
"boolean isAnyTypeReference();",
"public static boolean areSame(AnnotatedTypeMirror t1, AnnotatedTypeMirror t2) {\n return t1.toString().equals(t2.toString());\n }",
"TypeDescription validated();",
"public boolean equal_types( TypeInterface t ) {\n\t\tif( t instanceof TyArray ) {\r\n\t\t TyArray ta = (TyArray) t ;\r\n\t\t return ta.elementCount == elementCount\r\n\t\t && getElementType().equal_types( ta.getElementType() ) ; }\r\n\t\telse return false ; }",
"private void validateType(Errors errors, MultiValueConstraints con, List<String> answers) {\n for (int i=0; i < answers.size(); i++) {\n validateMultiValueType(errors, con, answers.get(i));\n }\n if (!con.getAllowOther()) {\n for (int i=0; i < answers.size(); i++) {\n if (!isEnumeratedValue(con, answers.get(i))) {\n rejectField(errors, \"constraints\", \"%s is not an enumerated value for this question\", answers.get(i));\n }\n }\n }\n }",
"private boolean switchTypes(String colType, Object obj) throws BPlusEngineException {\n switch (colType) {\n case \"INT\":\n if (obj instanceof Integer) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n break;\n case \"VARCHAR\":\n if (obj instanceof String) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n break;\n case \"Double\":\n if (obj instanceof Double) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n break;\n case \"Boolean\":\n if (obj instanceof Boolean) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n break;\n case \"DATE\":\n if (obj instanceof Date) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n break;\n default:\n throw new BPlusEngineException(\"Either You spelled the Type incorectly or the type does not exist, \"\n + \"Supported types: Integer, String, Double, Boolean, Date\");\n }\n return false;\n }",
"private static boolean isPrimitiveType(DetailAST ast) {\n boolean result = false;\n final DetailAST parameterType = ast.findFirstToken(TokenTypes.TYPE);\n final DetailAST identToken = parameterType.getFirstChild();\n\n if (identToken != null) {\n switch (identToken.getType()) {\n case TokenTypes.LITERAL_BOOLEAN:\n case TokenTypes.LITERAL_INT:\n case TokenTypes.LITERAL_LONG:\n case TokenTypes.LITERAL_SHORT:\n case TokenTypes.LITERAL_BYTE:\n case TokenTypes.LITERAL_CHAR:\n case TokenTypes.LITERAL_VOID:\n case TokenTypes.LITERAL_DOUBLE:\n case TokenTypes.LITERAL_FLOAT:\n result = !isArrayOrElipsis(parameterType);\n break;\n default:\n }\n }\n return result;\n }",
"private void validateType(Errors errors, MultiValueConstraints con, String answer) {\n validateMultiValueType(errors, con, answer);\n if (!con.getAllowOther() && !isEnumeratedValue(con, answer)) {\n rejectField(errors, \"constraints\", \"%s is not an enumerated value for this question\", answer);\n }\n }",
"@Test\n\tvoid testCheckClass2() {\n\t\tassertTrue(DataChecker.checkClass(new Integer(1), new Integer(15)));\n\t}",
"private static boolean nullOk(Schema schema) {\n if (Schema.Type.NULL == schema.getType()) {\n return true;\n } else if (Schema.Type.UNION == schema.getType()) {\n for (Schema possible : schema.getTypes()) {\n if (nullOk(possible)) {\n return true;\n }\n }\n }\n return false;\n }",
"public void checkTypeValid(List<Object> types) {\n if(types.size() != inputs.size()) {\n throw new IllegalArgumentException(\"Not matched passed parameter count.\");\n }\n }",
"public boolean checkTypesAndScope(Model model) {\n Map scope = Collections.EMPTY_MAP;\n\n ArgSpec leftSideInScope = leftSide.getArgSpecInScope(model, scope);\n if (leftSideInScope == null) {\n return false;\n }\n leftSide = leftSideInScope;\n\n ArgSpec outputInScope = output.getArgSpecInScope(model, scope);\n if (outputInScope == null) {\n return false;\n }\n output = outputInScope;\n\n if (leftSide instanceof Term) {\n Type left = ((Term) leftSide).getType();\n if (output instanceof Term) {\n // TODO: decide whether to have ArgSpec be typed as well. we should\n // (leili)\n Type right = ((Term) output).getType();\n if ((left != null) && (right != null) && !right.isSubtypeOf(left)) {\n System.err.println(\"Term \" + leftSide + \", of type \" + left\n + \", cannot take value \" + output + \", which has type \" + right);\n return false;\n }\n } else if (output instanceof ListSpec) {\n output = ((ListSpec) output).transferToConcrete(left);\n }\n }\n\n return true;\n }",
"boolean replacementfor(Type o);",
"private boolean isType(String type, Object value) {\n boolean ret = false;\n String val = String.valueOf(value).toUpperCase();\n if (val.equals(\"NULL\")) {\n ret = true;\n } else if (val.contains(\"BASE64\")) {\n ret = true;\n } else {\n if (type.equals(\"NULL\") && value instanceof JSONObject) ret = true;\n if (type.equals(\"TEXT\") && value instanceof String) ret = true;\n if (type.equals(\"INTEGER\") && value instanceof Integer) ret = true;\n if (type.equals(\"INTEGER\") && value instanceof Long) ret = true;\n if (type.equals(\"REAL\") && value instanceof Float) ret = true;\n if (type.equals(\"BLOB\") && value instanceof Blob) ret = true;\n }\n return ret;\n }",
"public Type typeCheck(SymbolTable stable) throws TypeCheckError {\n final Type tleft = _left.typeCheck(stable);\n final Type tright = _right.typeCheck(stable);\n\n if (tleft.isSimple() && tright.isSimple()) {\n if (tleft != tright) {\n if (tleft instanceof BooleanType) {\n _right = new CastExpr(_right, Type.Boolean);\n }\n else if (tright instanceof BooleanType) {\n _left = new CastExpr(_left, Type.Boolean);\n }\n else if (tleft instanceof NumberType ||\n tright instanceof NumberType) {\n _left = new CastExpr(_left, Type.Real);\n _right = new CastExpr(_right, Type.Real);\n }\n else { // both compared as strings\n _left = new CastExpr(_left, Type.String);\n _right = new CastExpr(_right, Type.String);\n }\n }\n }\n else if (tleft instanceof ReferenceType) {\n _right = new CastExpr(_right, Type.Reference);\n }\n else if (tright instanceof ReferenceType) {\n _left = new CastExpr(_left, Type.Reference);\n }\n // the following 2 cases optimize @attr|.|.. = 'string'\n else if (tleft instanceof NodeType && tright == Type.String) {\n _left = new CastExpr(_left, Type.String);\n }\n else if (tleft == Type.String && tright instanceof NodeType) {\n _right = new CastExpr(_right, Type.String);\n }\n // optimize node/node\n else if (tleft instanceof NodeType && tright instanceof NodeType) {\n _left = new CastExpr(_left, Type.String);\n _right = new CastExpr(_right, Type.String);\n }\n else if (tleft instanceof NodeType && tright instanceof NodeSetType) {\n // compare(Node, NodeSet) will be invoked\n }\n else if (tleft instanceof NodeSetType && tright instanceof NodeType) {\n swapArguments(); // for compare(Node, NodeSet)\n }\n else {\n // At least one argument is of type node, node-set or result-tree\n\n // Promote an expression of type node to node-set\n if (tleft instanceof NodeType) {\n _left = new CastExpr(_left, Type.NodeSet);\n }\n if (tright instanceof NodeType) {\n _right = new CastExpr(_right, Type.NodeSet);\n }\n\n // If one arg is a node-set then make it the left one\n if (tleft.isSimple() ||\n tleft instanceof ResultTreeType &&\n tright instanceof NodeSetType) {\n swapArguments();\n }\n\n // Promote integers to doubles to have fewer compares\n if (_right.getType() instanceof IntType) {\n _right = new CastExpr(_right, Type.Real);\n }\n }\n return _type = Type.Boolean;\n }",
"private boolean checkColumnTypes(ArrayList<String> types, ArrayList<Object> values) {\n boolean isType = true;\n for (int i = 0; i < values.size(); i++) {\n isType = this.isType(types.get(i), values.get(i));\n if (!isType) break;\n }\n return isType;\n }",
"boolean isMoreSpecific (MethodType type) throws OverloadingAmbiguous {\r\n boolean status = false;\r\n\r\n try {\r\n for (int i = 0, size = arguments.size (); i < size; i++) {\r\n\tIdentifier this_arg = (Identifier) arguments.elementAt (i);\r\n\tIdentifier target_arg = (Identifier) type.arguments.elementAt (i);\r\n\r\n\tint type_diff = this_arg.type.compare (target_arg.type);\r\n\tif (type_diff == 0)\r\n\t continue;\r\n\telse if (type_diff > 0) {\r\n\t if (status == true) throw new OverloadingAmbiguous ();\r\n\t} else {\r\n\t if (i != 0) throw new OverloadingAmbiguous ();\r\n\t status = true;\r\n\t}\r\n }\r\n } catch (OverloadingAmbiguous ex) {\r\n throw ex;\r\n } catch (TypeMismatch ex) {\r\n throw new OverloadingAmbiguous ();\r\n }\r\n\r\n return status;\r\n }",
"void check()\n {\n checkUsedType(responseType);\n checkUsedType(requestType);\n }",
"public abstract Type typeCheck(SymbolTable stable) throws TypeCheckError;",
"public boolean uniSameAs(Type other, TypeFixer fixer) throws LookupException;",
"public boolean areNumeric(Type typeone, Type typetwo){\n /* if they are both the same alias type, get the underlying type */\n if(areBinaryAlias(typeone,typetwo)){\n typeone = removeAlias(typeone);\n typetwo = removeAlias(typetwo);\n }//if exactly one is an alias, get it's underlying type \n// else if (typeone instanceof AliasType && !(typetwo instanceof AliasType) \n//\t\t\t\t|| !(typeone instanceof AliasType) && typetwo instanceof AliasType ) {\n//\ttypeone = removeAlias(typeone);\n//\ttypetwo = removeAlias(typetwo);\n//}\n \t\n if((typeone instanceof IntType && typetwo instanceof IntType) || (typeone instanceof Float64Type && typetwo instanceof Float64Type) || (typeone instanceof RuneType && typetwo instanceof RuneType)) return true;\n else return false;\n }",
"public void testNegativeScalar() {\n\n /*\n * fixme Boolean converters not implemented at this point value = LocaleConvertUtils.convert(\"foo\", Boolean.TYPE); ...\n *\n * value = LocaleConvertUtils.convert(\"foo\", Boolean.class); ...\n */\n\n try {\n LocaleConvertUtils.convert(\"foo\", Byte.TYPE);\n fail(\"Should have thrown conversion exception (1)\");\n } catch (final ConversionException e) {\n // Expected result\n }\n\n try {\n LocaleConvertUtils.convert(\"foo\", Byte.class);\n fail(\"Should have thrown conversion exception (2)\");\n } catch (final ConversionException e) {\n // Expected result\n }\n\n /*\n * fixme - not implemented try { value = LocaleConvertUtils.convert(\"org.apache.commons.beanutils2.Undefined\", Class.class);\n * fail(\"Should have thrown conversion exception\"); } catch (ConversionException e) { ; // Expected result }\n */\n\n try {\n LocaleConvertUtils.convert(\"foo\", Double.TYPE);\n fail(\"Should have thrown conversion exception (3)\");\n } catch (final ConversionException e) {\n // Expected result\n }\n\n try {\n LocaleConvertUtils.convert(\"foo\", Double.class);\n fail(\"Should have thrown conversion exception (4)\");\n } catch (final ConversionException e) {\n // Expected result\n }\n\n try {\n LocaleConvertUtils.convert(\"foo\", Float.TYPE);\n fail(\"Should have thrown conversion exception (5)\");\n } catch (final ConversionException e) {\n // Expected result\n }\n\n try {\n LocaleConvertUtils.convert(\"foo\", Float.class);\n fail(\"Should have thrown conversion exception (6)\");\n } catch (final ConversionException e) {\n // Expected result\n }\n\n try {\n LocaleConvertUtils.convert(\"foo\", Integer.TYPE);\n fail(\"Should have thrown conversion exception (7)\");\n } catch (final ConversionException e) {\n // Expected result\n }\n\n try {\n LocaleConvertUtils.convert(\"foo\", Integer.class);\n fail(\"Should have thrown conversion exception (8)\");\n } catch (final ConversionException e) {\n // Expected result\n }\n\n try {\n LocaleConvertUtils.convert(\"foo\", Byte.TYPE);\n fail(\"Should have thrown conversion exception (9)\");\n } catch (final ConversionException e) {\n // Expected result\n }\n\n try {\n LocaleConvertUtils.convert(\"foo\", Long.class);\n fail(\"Should have thrown conversion exception (10)\");\n } catch (final ConversionException e) {\n // Expected result\n }\n\n try {\n LocaleConvertUtils.convert(\"foo\", Short.TYPE);\n fail(\"Should have thrown conversion exception (11)\");\n } catch (final ConversionException e) {\n // Expected result\n }\n\n try {\n LocaleConvertUtils.convert(\"foo\", Short.class);\n fail(\"Should have thrown conversion exception (12)\");\n } catch (final ConversionException e) {\n // Expected result\n }\n\n }",
"public void checkMetadataTypeValues() {\n for (int k = 0; k < numDataCols; k++) {\n DashDataType<?> dtype = dataTypes[k];\n if ( !dtype.hasRole(DashDataType.Role.FILE_METADATA) )\n continue;\n\n if ( dtype instanceof StringDashDataType ) {\n String singleVal = null;\n for (int j = 0; j < numSamples; j++) {\n String thisVal = (String) stdObjects[j][k];\n if ( thisVal == null )\n continue;\n if ( singleVal == null ) {\n singleVal = thisVal;\n continue;\n }\n if ( singleVal.equals(thisVal) )\n continue;\n\n ADCMessage msg = new ADCMessage();\n // Metadata in data columns is never required\n msg.setSeverity(Severity.ERROR);\n msg.setGeneralComment(dtype.getDisplayName() + \" has differing given values\");\n msg.setDetailedComment(dtype.getDisplayName() + \" has differeing given values '\" +\n singleVal + \"' and \" + thisVal + \"'\");\n msg.setRowNumber(j + 1);\n msg.setColNumber(k + 1);\n msg.setColName(userColNames[k]);\n stdMsgList.add(msg);\n }\n }\n else if ( dtype instanceof IntDashDataType ) {\n Integer singleVal = null;\n for (int j = 0; j < numSamples; j++) {\n Integer thisVal = (Integer) stdObjects[j][k];\n if ( thisVal == null )\n continue;\n if ( singleVal == null ) {\n singleVal = thisVal;\n continue;\n }\n if ( singleVal.equals(thisVal) )\n continue;\n\n ADCMessage msg = new ADCMessage();\n // Metadata in data columns is never required\n msg.setSeverity(Severity.ERROR);\n msg.setGeneralComment(dtype.getDisplayName() + \" has differing given values\");\n msg.setDetailedComment(dtype.getDisplayName() + \" has differing given values '\" +\n singleVal.toString() + \"' and '\" + thisVal.toString() + \"'\");\n msg.setRowNumber(j + 1);\n msg.setColNumber(k + 1);\n msg.setColName(userColNames[k]);\n stdMsgList.add(msg);\n }\n }\n else if ( dtype instanceof DoubleDashDataType ) {\n Double singleVal = null;\n for (int j = 0; j < numSamples; j++) {\n Double thisVal = (Double) stdObjects[j][k];\n if ( thisVal == null )\n continue;\n if ( singleVal == null ) {\n singleVal = thisVal;\n continue;\n }\n if ( singleVal.equals(thisVal) )\n continue;\n if ( Math.abs(singleVal - thisVal) < 1.0E-6 )\n continue;\n\n ADCMessage msg = new ADCMessage();\n // Metadata in data columns is never required\n msg.setSeverity(Severity.ERROR);\n msg.setGeneralComment(dtype.getDisplayName() + \" has differing given values\");\n msg.setDetailedComment(String.format(\"%s has differing given values '%g' and '%g'\",\n dtype.getDisplayName(), singleVal, thisVal));\n msg.setRowNumber(j + 1);\n msg.setColNumber(k + 1);\n msg.setColName(userColNames[k]);\n stdMsgList.add(msg);\n }\n }\n else {\n throw new IllegalArgumentException(\n \"unexpected data type encountered in metadata column checking: \" + dtype);\n }\n }\n }",
"public void checkNotPolymorphicOrUnknown() {\n if (isPolymorphic())\n throw new AnalysisException(\"Unexpected polymorphic value!\");\n if (isUnknown())\n throw new AnalysisException(\"Unexpected 'unknown' value!\");\n }",
"@Test\r\n public void testWrapperToPrimitive() {\n final Class<?>[] primitives = {\r\n Boolean.TYPE, Byte.TYPE, Character.TYPE, Short.TYPE,\r\n Integer.TYPE, Long.TYPE, Float.TYPE, Double.TYPE\r\n };\r\n for (Class<?> primitive : primitives) {\r\n Class<?> wrapperCls = Classes.primitiveToWrapper(primitive);\r\n assertFalse(\"Still primitive\", wrapperCls.isPrimitive());\r\n assertEquals(wrapperCls + \" -> \" + primitive, primitive,\r\n Classes.wrapperToPrimitive(wrapperCls));\r\n }\r\n }",
"private void assertType(String snippet, Class<? extends Object> type) {\n try {\n Lexer lexer = new Lexer(new StringReader(snippet));\n Parser parser = new Parser(lexer);\n RootNode node = parser.program();\n AssignNode assignment = (AssignNode) node.get(0);\n assertTrue(assignment.getRight().getClass() == type);\n } catch (IOException e) {\n fail(e.getMessage());\n }\n }",
"public static boolean IsA(VariableType type1, VariableType type2, SymbolTable symbolTable) {\n\t\t// TODO Auto-generated method stub\n\t\tif(type1.type==FourType.Boolean || type1.type==FourType.Integer || type1.type==FourType.IntegerArray)\n\t\t\treturn type1.type==type2.type;\n\t\tif(type1.type==FourType.Object)\n\t\t{\n\t\t\tif(type2.type!=FourType.Object)\n\t\t\t\treturn false;\n\t\t\tif(type1.name==type2.name)\n\t\t\t\treturn true;\n\t\t\tClassItem classItem=symbolTable.SearchClass(type1.name);\n\t\t\tif(classItem==null)\n\t\t\t\treturn false;\n\t\t\treturn IsA(new VariableType(FourType.Object,classItem.parentName),type2,symbolTable);\n\t\t}\n\t\treturn false;\n\t}",
"@Test\n public void testUnionOnSchemaIncompatibleTypes() throws Exception {\n String query =\n \" l1 = load '\" + INP_FILE_2NUMS + \"' as (x : long, y : chararray);\"\n + \"l2 = load '\" + INP_FILE_2NUMS + \"' as (x : long, y : float);\"\n + \"u = union onschema l1, l2;\";\n\n checkSchemaEx(query, \"Cannot cast from chararray to bytearray\");\n\n //without \"onschema\"\n query =\n \" l1 = load '\" + INP_FILE_2NUMS + \"' as (x : long, y : chararray);\"\n + \"l2 = load '\" + INP_FILE_2NUMS + \"' as (x : long, y : float);\"\n + \"u = union l1, l2;\";\n\n checkSchemaEx(query, \"Cannot cast from chararray to bytearray\");\n\n\n \n query =\n \" l1 = load '\" + INP_FILE_2NUMS + \"' as (x : long, y : chararray);\"\n + \"l2 = load '\" + INP_FILE_2NUMS + \"' as (x : map[ ], y : chararray);\"\n + \"u = union onschema l1, l2;\"\n ; \n checkSchemaEx(query, \"Cannot cast from long to bytearray\");\n \n query =\n \" l1 = load '\" + INP_FILE_2NUMS + \"' as (x : long, y : chararray);\"\n + \"l2 = load '\" + INP_FILE_2NUMS + \"' as (x : map[ ], y : chararray);\"\n + \"u = union l1, l2;\"\n ;\n checkSchemaEx(query, \"Cannot cast from long to bytearray\");\n\n // bag column with different internal column types\n query =\n \" l1 = load '\" + INP_FILE_2NUMS \n + \"' as (x : long, b : bag { t : tuple (c1 : int, c2 : chararray)} );\"\n \n + \"l2 = load '\" + INP_FILE_2NUMS \n + \"' as (x : long, b : bag { t : tuple (c1 : long, c2 : chararray)} );\"\n + \"u = union onschema l1, l2;\"\n ; \n Schema sch = new Schema();\n sch.add(new FieldSchema(\"x\", DataType.LONG));\n Schema bagInnerSchema = new Schema();\n bagInnerSchema.add(new FieldSchema(null, new Schema(), DataType.TUPLE));\n sch.add(new FieldSchema(\"b\", bagInnerSchema, DataType.BAG));\n checkSchemaEquals(query, sch);\n \n // tuple column with different internal column types\n query =\n \" l1 = load '\" + INP_FILE_2NUMS \n + \"' as (t : tuple (c1 : int, c2 : chararray) );\"\n \n + \"l2 = load '\" + INP_FILE_2NUMS \n + \"' as (t : tuple (c1 : long, c2 : chararray) );\"\n + \"u = union onschema l1, l2;\"\n ; \n sch = new Schema();\n sch.add(new FieldSchema(\"t\", new Schema(), DataType.TUPLE));\n checkSchemaEquals(query, sch);\n }",
"private void checkInstanceOf(Set<FlowAbstraction> in, Unit d, Set<FlowAbstraction> out) {\n if (d instanceof AbstractDefinitionStmt) {\n AbstractDefinitionStmt def = (AbstractDefinitionStmt) d;\n Value leftSide = def.getLeftOp();\n Value rightSide = def.getRightOp();\n if(leftSide instanceof Local && rightSide instanceof AbstractInstanceOfExpr) {\n AbstractInstanceOfExpr expr = (AbstractInstanceOfExpr) rightSide;\n FlowAbstraction taint = isInTaintedSet(expr.getOp(), in);\n if(taint != null) {\n \t\n taint(leftSide, d, out);\n \n }\n }\n }\n }",
"@Override public boolean accepts(Type other) {\n if(!(other instanceof FixArray)) return false;\n FixArray that = (FixArray) other;\n return this.length == that.length\n && this.indexType().equals(that.indexType())\n && this.elemType.accepts(that.elemType);\n }",
"@Test\n public void testRequireAtomString_GenericType() {\n LOGGER.info(\"requireAtomString\");\n Atom actual = null;\n final Atom expected = null;\n boolean caught = false;\n try {\n actual = requireAtomString(null);\n } catch (final ClassCastException ex) {\n caught = true;\n assertEquals(\"\", ex.getMessage());\n }\n assertTrue(caught);\n assertEquals(expected, actual);\n }",
"private boolean compare(ValueType first, ValueType second) {\r\n // TODO\r\n return false;\r\n }",
"public boolean typeStrictlyConformsTo(PBmmSchema schema, String type1, String type2) {\n return typeSameAs(type1,type2) || typeConformsTo(schema, type1, type2);\n }",
"@Override\n public boolean ll_isPrimitiveType(int typeCode) {\n return !ll_isRefType(typeCode);\n }",
"@Test\n\tvoid testCheckClass1() {\n\t\tassertTrue(DataChecker.checkClass(new Integer(1), new Integer(1)));\n\t}",
"private static boolean isOriginalTsType(TsType type) {\n if (type instanceof TsType.BasicType) {\n TsType.BasicType basicType = (TsType.BasicType)type;\n return !(basicType.name.equals(\"null\") || basicType.name.equals(\"undefined\"));\n }\n return true;\n }",
"public static void main(String[] args) {\n\t\tList<String> strings = new ArrayList<String>();\n\n Object[] o = new Long[1];\n o[0] = \"I am a String\";\n List<Long> l = new ArrayList<Long>();\n\n unsafeAdd(strings, new Integer(42));\n //\t\t String s = strings.get(0); // Compiler-generated cast\n \n\t\tSet<?> set1 = new HashSet();\n\t\tset1.add(null);\n\t\t// List<Object> o =new ArrayList<Long>();\n\t\tSet set2 = new HashSet();\n\t\trawNumElementsInCommon(set1, set2);\n\t\tnumElementsInCommon(set1, set2);\n\t\tif (set1 instanceof Set) {\n\t\t\tSet<?> s = set1;\n\t\t}\n }",
"protected boolean isApplicableType(Datatype type) {\n\t\treturn true;\n\t}",
"public static void main(String[] args) {\n List<Integer> data = new ArrayList();\n List<String> strList = new ArrayList<>();\n\n// data = strList; //both types are generalized via <Type> declaration: incompatibles variables\n data.add(10);\n\n String s = strList.get(0); //ClassCastException\n }",
"private static boolean\n\t\tdoParametersMatch(Class<?>[] types, Object[] parameters)\n\t{\n\t\tif (types.length != parameters.length) return false;\n\t\tfor (int i = 0; i < types.length; i++)\n\t\t\tif (parameters[i] != null) {\n\t\t\t\tClass<?> clazz = parameters[i].getClass();\n\t\t\t\tif (types[i].isPrimitive()) {\n\t\t\t\t\tif (types[i] != Long.TYPE && types[i] != Integer.TYPE &&\n\t\t\t\t\t\ttypes[i] != Boolean.TYPE) throw new RuntimeException(\n\t\t\t\t\t\t\"unsupported primitive type \" + clazz);\n\t\t\t\t\tif (types[i] == Long.TYPE && clazz != Long.class) return false;\n\t\t\t\t\telse if (types[i] == Integer.TYPE && clazz != Integer.class) return false;\n\t\t\t\t\telse if (types[i] == Boolean.TYPE && clazz != Boolean.class) return false;\n\t\t\t\t}\n\t\t\t\telse if (!types[i].isAssignableFrom(clazz)) return false;\n\t\t\t}\n\t\treturn true;\n\t}",
"@Test\n\tpublic void testInternalEntityRelatedTypes() {\n\t\tlogger.info(\"Run testInternalEntityRelatedTypes\");\n\t\tfinal IntrospectionResult introspection = getIntrospection();\n\n\t\t// Entity1InputType\n\t\tfinal IntrospectionFullType entity1InputType = getFullType(introspection,\n\t\t\t\tEntity1.class.getSimpleName() + schemaConfig.getInputTypeNameSuffix());\n\t\tAssert.assertEquals(27, entity1InputType.getInputFields().size());\n\n\t\tassertInputField(entity1InputType, \"id\", IntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLID.getName());\n\t\tassertInputField(entity1InputType, \"intAttr\", IntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLInt.getName());\n\t\tassertInputField(entity1InputType, \"longAttr\", IntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLLong.getName());\n\t\tassertInputField(entity1InputType, \"doubleAttr\", IntrospectionTypeKindEnum.SCALAR,\n\t\t\t\tScalars.GraphQLFloat.getName());\n\t\tassertInputField(entity1InputType, \"stringAttr\", IntrospectionTypeKindEnum.SCALAR,\n\t\t\t\tScalars.GraphQLString.getName());\n\t\tassertInputField(entity1InputType, \"booleanAttr\", IntrospectionTypeKindEnum.SCALAR,\n\t\t\t\tScalars.GraphQLBoolean.getName());\n\t\tassertInputField(entity1InputType, \"bigIntAttr\", IntrospectionTypeKindEnum.SCALAR,\n\t\t\t\tScalars.GraphQLBigInteger.getName());\n\t\tassertInputField(entity1InputType, \"bigDecimalAttr\", IntrospectionTypeKindEnum.SCALAR,\n\t\t\t\tScalars.GraphQLBigDecimal.getName());\n\t\tassertInputField(entity1InputType, \"bytesAttr\", IntrospectionTypeKindEnum.SCALAR,\n\t\t\t\tScalars.GraphQLByte.getName());\n\t\tassertInputField(entity1InputType, \"shortAttr\", IntrospectionTypeKindEnum.SCALAR,\n\t\t\t\tScalars.GraphQLShort.getName());\n\t\tassertInputField(entity1InputType, \"charAttr\", IntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLChar.getName());\n\t\tassertInputField(entity1InputType, \"dateAttr\", IntrospectionTypeKindEnum.SCALAR,\n\t\t\t\tGQLJavaScalars.GraphQLDate.getName());\n\t\tassertInputField(entity1InputType, \"fileAttr\", IntrospectionTypeKindEnum.SCALAR,\n\t\t\t\tGQLJavaScalars.GraphQLFile.getName());\n\t\tassertInputField(entity1InputType, \"localDateAttr\", IntrospectionTypeKindEnum.SCALAR,\n\t\t\t\tGQLJavaScalars.GraphQLLocalDate.getName());\n\t\tassertInputField(entity1InputType, \"localDateTimeAttr\", IntrospectionTypeKindEnum.SCALAR,\n\t\t\t\tGQLJavaScalars.GraphQLLocalDateTime.getName());\n\t\tassertInputField(entity1InputType, \"instantAttr\", IntrospectionTypeKindEnum.SCALAR,\n\t\t\t\tGQLJavaScalars.GraphQLInstant.getName());\n\n\t\tassertInputField(entity1InputType, \"stringList\", IntrospectionTypeKindEnum.LIST,\n\t\t\t\tIntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLString.getName());\n\t\tassertInputField(entity1InputType, \"stringSet\", IntrospectionTypeKindEnum.LIST,\n\t\t\t\tIntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLString.getName());\n\n\t\tassertInputField(entity1InputType, \"stringList\", IntrospectionTypeKindEnum.LIST,\n\t\t\t\tIntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLString.getName());\n\t\tassertInputField(entity1InputType, \"stringSet\", IntrospectionTypeKindEnum.LIST,\n\t\t\t\tIntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLString.getName());\n\n\t\tassertInputField(entity1InputType, \"enumAttr\", IntrospectionTypeKindEnum.ENUM, Enum1.class.getSimpleName());\n\n\t\tassertInputField(entity1InputType, \"enumList\", IntrospectionTypeKindEnum.LIST, IntrospectionTypeKindEnum.ENUM,\n\t\t\t\tEnum1.class);\n\t\tassertInputField(entity1InputType, \"enumSet\", IntrospectionTypeKindEnum.LIST, IntrospectionTypeKindEnum.ENUM,\n\t\t\t\tEnum1.class);\n\n\t\tassertInputField(entity1InputType, \"entity2\" + schemaConfig.getAttributeIdSuffix(),\n\t\t\t\tIntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLID.getName());\n\t\tassertInputField(entity1InputType, \"entity3\" + schemaConfig.getAttributeIdPluralSuffix(),\n\t\t\t\tIntrospectionTypeKindEnum.LIST, IntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLID.getName());\n\t\tassertInputField(entity1InputType, \"entity4\" + schemaConfig.getAttributeIdPluralSuffix(),\n\t\t\t\tIntrospectionTypeKindEnum.LIST, IntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLID.getName());\n\n\t\tassertInputField(entity1InputType, \"embeddedData1\", IntrospectionTypeKindEnum.INPUT_OBJECT,\n\t\t\t\tEmbeddedData1.class.getSimpleName() + schemaConfig.getInputTypeNameSuffix());\n\t\tassertInputField(entity1InputType, \"embeddedData1s\", IntrospectionTypeKindEnum.LIST,\n\t\t\t\tIntrospectionTypeKindEnum.INPUT_OBJECT,\n\t\t\t\tEmbeddedData1.class.getSimpleName() + schemaConfig.getInputTypeNameSuffix());\n\n\t\t// Entity1LoadResult\n\t\tfinal IntrospectionFullType entity1LoadResult = getFullType(introspection,\n\t\t\t\tEntity1.class.getSimpleName() + schemaConfig.getQueryGetListOutputTypeNameSuffix());\n\t\tAssert.assertEquals(3, entity1LoadResult.getFields().size());\n\n\t\tassertField(entity1LoadResult, \"data\", IntrospectionTypeKindEnum.LIST, IntrospectionTypeKindEnum.OBJECT,\n\t\t\t\tEntity1.class.getSimpleName());\n\t\tassertField(entity1LoadResult, \"orderBy\", IntrospectionTypeKindEnum.LIST, IntrospectionTypeKindEnum.OBJECT,\n\t\t\t\tgetOrderByOutputTypeName());\n\t\tassertField(entity1LoadResult, \"paging\", IntrospectionTypeKindEnum.OBJECT, getPagingOutputTypeName());\n\n\t\t// Entity2InputType\n\t\tfinal IntrospectionFullType entity2InputType = getFullType(introspection,\n\t\t\t\tEntity2.class.getSimpleName() + schemaConfig.getInputTypeNameSuffix());\n\t\tAssert.assertEquals(2, entity2InputType.getInputFields().size());\n\n\t\tassertInputField(entity2InputType, \"id\", IntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLID.getName());\n\t\tassertInputField(entity2InputType, \"entity1\" + schemaConfig.getAttributeIdPluralSuffix(),\n\t\t\t\tIntrospectionTypeKindEnum.LIST, IntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLID.getName());\n\n\t\t// Entity2LoadResult\n\t\tfinal IntrospectionFullType entity2LoadResult = getFullType(introspection,\n\t\t\t\tEntity2.class.getSimpleName() + schemaConfig.getQueryGetListOutputTypeNameSuffix());\n\t\tAssert.assertEquals(3, entity2LoadResult.getFields().size());\n\n\t\tassertField(entity2LoadResult, \"data\", IntrospectionTypeKindEnum.LIST, IntrospectionTypeKindEnum.OBJECT,\n\t\t\t\tEntity2.class.getSimpleName());\n\t\tassertField(entity2LoadResult, \"orderBy\", IntrospectionTypeKindEnum.LIST, IntrospectionTypeKindEnum.OBJECT,\n\t\t\t\tgetOrderByOutputTypeName());\n\t\tassertField(entity2LoadResult, \"paging\", IntrospectionTypeKindEnum.OBJECT, getPagingOutputTypeName());\n\n\t\t// Entity3InputType\n\t\tfinal IntrospectionFullType entity3InputType = getFullType(introspection,\n\t\t\t\tEntity3.class.getSimpleName() + schemaConfig.getInputTypeNameSuffix());\n\t\tAssert.assertEquals(2, entity3InputType.getInputFields().size());\n\n\t\tassertInputField(entity3InputType, \"id\", IntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLID.getName());\n\t\tassertInputField(entity3InputType, \"entity1\" + schemaConfig.getAttributeIdSuffix(),\n\t\t\t\tIntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLID.getName());\n\n\t\t// Entity4InputType\n\t\tfinal IntrospectionFullType entity4InputType = getFullType(introspection,\n\t\t\t\tEntity4.class.getSimpleName() + schemaConfig.getInputTypeNameSuffix());\n\t\tAssert.assertEquals(2, entity4InputType.getInputFields().size());\n\n\t\tassertInputField(entity4InputType, \"id\", IntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLID.getName());\n\t\tassertInputField(entity4InputType, \"entity1\" + schemaConfig.getAttributeIdPluralSuffix(),\n\t\t\t\tIntrospectionTypeKindEnum.LIST, IntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLID.getName());\n\t}",
"@Override\n public boolean isPrimitive() {\n return true;\n }",
"@Override\r\n public void setupTypeCheck() {\n ITypesCalculator derLit = new DeriveSymTypeOfCombineExpressionsWithSIUnitTypesDelegator();\r\n\r\n // other arguments not used (and therefore deliberately null)\r\n setTypeCheck(new TypeCheck(null, derLit));\r\n }",
"public interface MagicType extends Type {\n\n\t/**\n\t * Given that we are a type specified in a replacement rule (e.g. a Var or\n\t * Atom), can we consume a submatch of the given type in the match?\n\t *\n\t * Alternatively, we could have overriden .equals().\n\t */\n\tboolean replacementfor(Type o);\n}",
"@Override\n\tpublic boolean isObjectTypeExpected() {\n\t\treturn false;\n\t}",
"default boolean isPrimitive() {\n return false;\n }",
"@Test\n public void testConvertStadium() {\n Object result = converter.convert(null, stadium, Long.class, Stadium.class);\n\n assertEquals(result.getClass(), Long.class, \"Converted object is not of a Long class.\");\n assertSame(result, stadium.getId(), \"Converted object is not the one expected.\");\n }",
"@Override\n public abstract boolean isAssignableBy(ResolvedType other);",
"@Test public void getBaseTypeShouldReturnCorrectType() throws SQLException {\n\t\tList<Object> list = new ArrayList<>();\n\t\tArray array;\n\t\tfor (int type : Array.TYPES_SUPPORTED) {\n\t\t\tarray = new ListArray(list, type);\n\t\t\tassertEquals(type, array.getBaseType());\n\t\t}\n\t}",
"private static void checkRawType(RawType type,\n Object... classVersionPairs) {\n TestCase.assertNotNull(type);\n TestCase.assertNotNull(classVersionPairs);\n TestCase.assertTrue(classVersionPairs.length % 2 == 0);\n\n for (int i = 0; i < classVersionPairs.length; i += 2) {\n String clsName = (String) classVersionPairs[i];\n int clsVersion = (Integer) classVersionPairs[i + 1];\n TestCase.assertEquals(clsName, type.getClassName());\n TestCase.assertEquals(clsVersion, type.getVersion());\n type = type.getSuperType();\n }\n TestCase.assertNull(type);\n }",
"static int type_of_jc(String passed){\n\t\treturn 1;\n\t}",
"@Test\n public void testEqualsReturnsFalseOnWrongArgType() {\n boolean equals = record.equals(\"Not a record\");\n\n assertThat(equals, is(false));\n }",
"Object isMatch(Object arg, String wantedType);",
"public void checkTypes() {\n this.root.accept(this);\n }"
] | [
"0.67251503",
"0.645573",
"0.63564235",
"0.6355409",
"0.63318",
"0.6143524",
"0.60583234",
"0.6039302",
"0.59298354",
"0.5856284",
"0.5774121",
"0.57643753",
"0.57637763",
"0.5738338",
"0.571752",
"0.56992275",
"0.5661777",
"0.56502074",
"0.5634401",
"0.5632962",
"0.56217396",
"0.56180596",
"0.5615939",
"0.5606415",
"0.5600306",
"0.55999684",
"0.55999684",
"0.55781275",
"0.5573453",
"0.5559572",
"0.555074",
"0.5548603",
"0.5538711",
"0.5502695",
"0.5495248",
"0.54542935",
"0.543527",
"0.5431174",
"0.5410045",
"0.5405364",
"0.5399694",
"0.53807795",
"0.53736544",
"0.53729016",
"0.53650075",
"0.5362791",
"0.53589785",
"0.53366244",
"0.53148717",
"0.5305635",
"0.52965766",
"0.5296279",
"0.52854586",
"0.5282515",
"0.5280731",
"0.52775085",
"0.52679086",
"0.5266108",
"0.5258827",
"0.52577317",
"0.52516085",
"0.52495605",
"0.5248033",
"0.5245348",
"0.523406",
"0.5228209",
"0.52220565",
"0.52015835",
"0.51988256",
"0.5196539",
"0.5195248",
"0.5194721",
"0.51856047",
"0.51746684",
"0.5174515",
"0.5174513",
"0.51724106",
"0.5163485",
"0.5163403",
"0.51577336",
"0.5149059",
"0.5147783",
"0.513942",
"0.51363033",
"0.5130407",
"0.512877",
"0.5128",
"0.5122673",
"0.5121897",
"0.51199937",
"0.5111324",
"0.51064044",
"0.51041734",
"0.51002944",
"0.5085171",
"0.5081919",
"0.5078053",
"0.5076538",
"0.50758636",
"0.5071184",
"0.5069696"
] | 0.0 | -1 |
/ Compares 2 strings in length then .equalsIgnoreCase if not equal in length or content, return GoException Prints out message for debugging | public static GoException Compare(String a,String b, String message) {
String[] side1 = null;
String[] side2 = null;
if(a == null && b == null) {
return null;
}
if(a!=null){
side1 = a.split(",");
}
else {
side1 = new String[] {""};
}
if(b!=null){
side2 = b.split(",");
}
else {
side2 = new String[] {""};
}
if(side1.length != side2.length) {
return new GoException("Uneven assignment: (" + side1.length + "," + side2.length + ") " + message);
}
for(int i = 0; i < side2.length; i ++) {
//System.out.println(message + "-- " + side1[i] + "," + side2[i]);
if(!(side1[i].equalsIgnoreCase(side2[i]))) {
return new GoException("Unequal types: (" + side1[i] + "," + side2[i] + ") " + message);
}
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void testCompareStrings() {\n\t\tString one = \"Hello\";\n\t\tString two = \"in the house\";\n\t\t//Gro▀schreibung vor Kleinschreibung\n\t\tassertTrue(comp.compareStrings(one, two) < 0);\n\t\tassertEquals(0, comp.compareStrings(one, one));\n\t\tassertTrue(comp.compareStrings(two, one) > 0);\n\t}",
"public void testCompareIgnoreCase() {\n\t\tString one = \"hello\";\n\t\tString two = \"In the house\";\n\t\t//h vor i\n\t\tassertTrue(comp.compareStrings(one, two) > 0);\n\t\tassertEquals(0, comp.compareStrings(one, one));\n\t\tassertTrue(comp.compareStrings(two, one) < 0);\n\t}",
"@Parameters({ \"hw\", \"rhw\" })\n @Test\n public static void checkForStringLengthEquals (String hw, String rhw) {\n int expectedLength = rhw.length();\n int actualLength = task.reverse(hw).length();\n assertEquals(expectedLength, actualLength, \"Error in Task5, checkForStringLengthEquals : Expected '\" + expectedLength + \"' symbols, but found '\" +actualLength+ \"' symbols. Could you check the '\" + hw + \"' string\");\n System.out.println(\"checkForStringLengthEquals passed\");\n }",
"protected int stringCompare(String s1,String s2)\r\n\t{\r\n\t\tint shortLength=Math.min(s1.length(), s2.length());\r\n\t\tfor(int i=0;i<shortLength;i++)\r\n\t\t{\r\n\t\t\tif(s1.charAt(i)<s2.charAt(i))\r\n\t\t\t\treturn 0;\r\n\t\t\telse if(s1.charAt(i)>s2.charAt(i))\r\n\t\t\t\treturn 1;\t\r\n\t\t}\r\n\t\t//if the first shrotLenghtTH characters of s1 and s2 are same \r\n\t\tif(s1.length()<=s2.length()) //it's a close situation. \r\n\t\t\treturn 0;\r\n\t\telse \r\n\t\t\treturn 1; \r\n\t\t\r\n\t}",
"public static void main (String[] args) throws java.lang.Exception\n\t{\n\t\tScanner sc=new Scanner(System.in);\n\t\tString str1=sc.nextLine();\n\t\tString str2=sc.nextLine();\n\t\tstr1=str1.toLowerCase();\n\t\tstr2=str2.toLowerCase();\n\t\tif(str1.length()!=str2.length()){\n\t\tSystem.out.println(\"no\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tboolean flg=true;\n\t\tfor(int i=0; i<str1.length();i++){\n\t\t\tif(str1.charAt(i)!=str2.charAt(i)){\n\t\t\t\tflg=false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(flg){\n\t\t\tSystem.out.println(\"yes\");\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"no\");\n\t\t}\n\n\t}",
"private boolean checkString(){\n createString();\n char[] charsJoinedString=this.joinedTextPalindrome.toCharArray();\n int lengthString=charsJoinedString.length-1;\n for(int i=0;i<charsJoinedString.length;i++){\n if(charsJoinedString[i]!=charsJoinedString[lengthString]){\n return false;\n }\n lengthString--;\n }\n return true;\n \n }",
"@Test\n\t public void teststringAPI_fail() {\n\t\tString testData = \"Caps is not considered the same\";\n\t\tchar charData='c';\n\t\tString expected = \"aps is not onsidered the same\";\n\t\tString actualStr=stringObj.stringAPI(testData, charData);\n\t\tassertNotSame(\"Got Expected Result\", expected, actualStr);\n\t }",
"@Override\n public int compare(String o1, String o2) {\n return Integer.compare(o2.length(), o1.length());\n }",
"private static boolean equalityTest4(String a, String b)\n {\n if(a.length() == 0 && b.length() == 0)\n {\n return true;\n }\n else\n {\n if(a.length() == 0 || b.length() == 0)\n {\n return false;\n }\n if(a.charAt(0) == b.charAt(0))\n {\n return equalityTest4(a.substring(1), b.substring(1));\n }\n else\n {\n return false;\n }\n }\n }",
"public static void main (String[] args) throws java.lang.Exception\n\t{\n\t\tString s0=\"\";\n\t\tString s1=\"HELLO\";\n\t\tString s2=new String(\"how are you\");\n\t\tSystem.out.println(s1.length());\n\t\tSystem.out.println(s1.compareTo(s2));\n\t\tSystem.out.println(s1.concat(s2));\n\t\tSystem.out.println(s0.isEmpty());\n\t\tSystem.out.println(s1.toLowerCase());\n\t\tSystem.out.println(s2.toUpperCase());\n\t\tSystem.out.println(s1.replace(\"HELLO\",\"Sarava\"));\n\t\tSystem.out.println(s2.contains(\"are\"));\n\t System.out.println(s2.endsWith(\"you\"));\n\t\t\n\t\t\n\t\t\n\t}",
"@Override\n public int compare(String o1, String o2) {\n return Integer.compare(o1.length(), o2.length());\n }",
"public static void main(String[] args) {\n\t\t// LENGTH();\n//\t\tString str=\"Syntax\";-----------------------\n//\t\t int lengthOfString=str.length();\n//\t\t System.out.println(lengthOfString);\n//\t\t String name=\"Timmy\";---------------------\n//\t\t int lengthOfString=name.length();\n//\t\t System.out.println(lengthOfString);\n//\t\t String name1=\" Syntex Technolody \";------------------\n//\t\t int lengthOfString1=name1.length();\n//\t\t System.out.println(name1.length());\n//\t\t String str2=\"Welcome, students!\";-----------------------\n//\t\t System.out.println(str2.length());\n\t\t// UPPER LOWER cases;\n//\t\t String str3=\"Hello\";\n//\t\t String newString=str3.toUpperCase();\n//\t\t System.out.println(newString);\n//\t\t String lowerCaseString=newString.toLowerCase();\n//\t\t System.out.println(lowerCaseString);\n//\t\t String love=\"Peionies will bring me Love\";\n//\t\t String caseString=love.toUpperCase();\n//\t\t System.out.println(love.toUpperCase());\n//\t\t String job=\"GOOD JOB IS SECCSESS IN LIFE\";\n//\t\t String newString1=job.toLowerCase();\n//\t\t System.out.println(newString1);\n//\t\t //equality;\n//\t\t String p1=\"The Hight is 5 inches\";\n//\t\t String p2=\"The hight is 5 inches\"; //QUASTION---DOES NOT IGNORES CASE!\n//\t\t boolean equality=p1.equalsIgnoreCase(p2);\n//\t\t System.out.println(equality);\n\n\t\tString word1 = \"syntaxsolutions\";\n\t\tString word2 = \"SYNTAXSOLUTIONS\";\n\n\t\tString case1 =word1.toUpperCase();\n\t\tSystem.out.println(case1);\n\n\t\tString case2 = word2.toLowerCase();\n\t\tSystem.out.println(case2);\n\t}",
"@Override\n\t\t\tpublic int compare(String o1, String o2) {\n\t\t\t\treturn Integer.compare(o1.length(),\n\t\t o2.length());\n\t\t\t}",
"@Override\npublic int compare(String first, String second) {\n\tint ans= Integer.compare(first.length(), second.length());\n\t//\n\t\n\t\n\t\n\t\n\treturn ans;\n\t//\n\t\n\t\n}",
"static String twoStrings(String s1, String s2){\n // Complete this function\n String letters = \"abcdefghijklmnopqrstuvwxyz\";\n for(int i=0;i<letters.length();i++){\n char lettersChar = letters.charAt(i); \n if(s1.indexOf(lettersChar) > -1 && s2.indexOf(lettersChar) > -1){\n return \"YES\";\n }\n }\n \n return \"NO\";\n }",
"public boolean compare2StringsIgnoringCasses(String s1, String s2)\r\n {\r\n String a=s1.toLowerCase();\r\n String b=s2.toLowerCase();\r\n if(a.length()!= b.length())\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n for(int i=0; i<a.length(); i++)\r\n {\r\n if(!comparet2Chars(a.charAt(i),b.charAt(i)))\r\n {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n }",
"public void testCheckString() {\n Util.checkString(\"test\", \"test\");\n }",
"public void testCheckString() {\n Util.checkString(\"test\", \"test\");\n }",
"boolean sameName(String a, String b){\n\t\tif(a.length()!=b.length()){\r\n\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tfor(int i=0;i<a.length();i++){\r\n\t\t\tif(a.charAt(i)!=b.charAt(i)){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"protected void assertStringsEquals(String[] expected, String[] actual, boolean alphabetize) {\n assertEquals(\"Size mismatch.\", expected.length, actual.length);\n\n for (int i = 0; i < expected.length; i++) {\n assertStringEquals(expected[i], actual[i], alphabetize, String.format(\"String %d mismatch\", i));\n }\n }",
"private static boolean checkIfCanBreak( String s1, String s2 ) {\n\n if (s1.length() != s2.length())\n return false;\n\n Map<Character, Integer> map = new HashMap<>();\n for (Character ch : s2.toCharArray()) {\n map.put(ch, map.getOrDefault(ch, 0) + 1);\n }\n\n for (Character ch : s1.toCharArray()) {\n\n char c = ch;\n while ((int) (c) <= 122 && !map.containsKey(c)) {\n c++;\n }\n\n if (map.containsKey(c)) {\n map.put(c, map.getOrDefault(c, 0) - 1);\n\n if (map.get(c) <= 0)\n map.remove(c);\n }\n }\n\n return map.size() == 0;\n }",
"public static boolean equalsIgnoreCase(final CharSequence left, final int leftOffset, final int leftLength,\n final CharSequence right, final int rightOffset, final int rightLength) {\n if (leftLength == rightLength) {\n for (int i = 0; i < rightLength; i++) {\n if (toLowerCase(left.charAt(i + leftOffset)) != toLowerCase(right.charAt(i + rightOffset))) {\n return false;\n }\n }\n return true;\n }\n return false;\n }",
"static Boolean isOneAway(String s1, String s2) {\r\n\t\tboolean results = false;\r\n\t\tchar[] chars1 = s1.toCharArray();\r\n\t\tchar[] chars2 = s2.toCharArray();\r\n\t\tif(s1.equals(s2)) {\r\n\t\t\tresults = true;\r\n\t\t}else if(chars1.length==chars2.length) {\r\n\t\t\tint mismatches = 0;\r\n\t\t\tfor(int i = 0; i < chars1.length; i++ ) {\r\n\t\t\t\tif(chars1[i]!=chars2[i]) {\r\n\t\t\t\t\tmismatches++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(mismatches <= 1) results = true;\r\n\t\t}else if(Math.abs(s1.length() - s2.length())==1) {\r\n\t\t\tif(s1.length() > s2.length()) {\r\n\t\t\t\tchars1 = s1.toCharArray();\r\n\t\t\t\tchars2 = s2.toCharArray();\r\n\t\t\t}else {\r\n\t\t\t\tchars1 = s2.toCharArray();\r\n\t\t\t\tchars2 = s1.toCharArray();\r\n\t\t\t}\r\n\t\t\tint mismatches = 0;\r\n\t\t\tint cursor1 = 0;\r\n\t\t\tint cursor2 = 0;\r\n\t\t\twhile((cursor1 < chars1.length) && (cursor2 < chars2.length)) {\r\n\t\t\t\tif(chars1[cursor1] != chars2[cursor2]) {\r\n\t\t\t\t\tmismatches++;\r\n\t\t\t\t\tcursor1++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tcursor1++;\r\n\t\t\t\t\tcursor2++;\r\n\t\t\t\t}\t\t\t\t \r\n\t\t\t}\r\n\t\t\tif(mismatches <= 1) results = true;\r\n\t\t}else {\r\n\t\t\tresults = false;\r\n\t\t}\r\n\t\r\n\t\treturn results;\r\n\t}",
"private static boolean diffOne(String s1, String s2) {\n int count = 0;\n for (int i = 0; i < s1.length(); i++) {\n if (s1.charAt(i) != s2.charAt(i)) count++;\n if (count > 1) return false;\n }\n return count == 1;\n }",
"public static void main(String[] args) {\n\n\t\tString str = \"Syntax\";\n\n\t\tint lengthOfString = str.length();\n\t\tSystem.out.println(lengthOfString);\n\n\t\tString str1 = \"Syntax Technologies\";\n\t\tint lengthOfString2 = str1.length();\n\t\tSystem.out.println(lengthOfString2);\n\n\t\tString str2 = \"Welcome, students!\";\n\t\tSystem.out.println(str2.length());\n\t\t\n\t\t//Convert all characters to lower and upper case\n\t\tString str3 = \"Hello\";\n\t\tString newString = str3.toUpperCase();\n\t\tSystem.out.println(newString);\n\t\tSystem.out.println(newString.toLowerCase());\n\t\t\n\t\t//Comparing 2 strings if they are the same\n\t\tString str4 = \"Hello\";\n\t\tString str5 = \"hello\";\n\t\t\n\t\tboolean equality = str4.equals(str5);\n\t\tSystem.out.println(equality);\n\t\t\n\t\t\n\t\tString expectedBrowser = \"Chrome\";\n\t\tString actualBrowser = \"chrome\";\n\t\tboolean equals = expectedBrowser.equalsIgnoreCase(actualBrowser);\n\t\tSystem.out.println(equals);\n\n\t}",
"public static void main(String[] args) {\n\t\tString s = \"ssss\";\n\t\tint count = 0;\n\t\t\n\t\tfor(int i = 0; i < s.length();i++) {\n\t\t\tchar a = s.charAt(i);\n\t\t\tfor(int j = 0; j<s.length();j++) {\n\t\t\t\tif(s.charAt(j) == a && j!=i) {\n\t\t\t\t\tSystem.out.println(\"Invalid\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcount = count + 1;\n\t\t}\n\t\tif(count == s.length()) {\n\t\t\tSystem.out.println(\"Valid\");\n\t\t}\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tString str1 = \"snow\";\n\t\tString str2 = \"wons\";\n\t\tint count = 0;\t\t\n\t\tfor(int i=0; i<str1.length() && i<str2.length(); i++){\n\t\t\tif(str1.toLowerCase().charAt(i) != str2.toLowerCase().charAt(i)){\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\tif(count >1) System.out.println(\"fasle==>>\"+count);\n\t\telse System.out.println(\"true\");\n\t}",
"static String twoStrings(String s1, String s2) {\n String bigstr = s1.length() > s2.length() ? s1 : s2;\n String smallstr = s1.length() > s2.length() ? s2 : s1;\n int bigstrSize = bigstr.length();\n int smallstrSize = smallstr.length();\n\n boolean string_check[] = new boolean[1000];\n\n for (int i = 0; i < bigstrSize; i++) {\n string_check[bigstr.charAt(i) - 'A'] = true;\n }\n // if at least one char is present in boolean array\n for (int i = 0; i < smallstrSize; i++) {\n if (string_check[smallstr.charAt(i) - 'A'] == true) {\n return \"YES\";\n }\n }\n return \"NO\";\n }",
"@Override\r\n\t\t\tpublic boolean test(String t, String u) {\n\t\t\t\t return t.equalsIgnoreCase(u);\r\n\t\t\t}",
"public static boolean isEqual(String s1, String s2) {\r\tif(s1.length() != s2.length()){\r\t return false;\r\t}\r\tfor(int i = 0; i< s1.length();i++){\r\t if (s1.charAt(i) != s2.charAt(i)){\r\t\treturn false;\r\t }\r\t}\r\treturn true;\r }",
"private static String testString(String str, int minLen, int maxLen) throws Exception {\n if (str.length() > maxLen || str.length() < minLen) {\n throw new Exception(str + \" has a length not in [\" + minLen + \", \" + maxLen + \"]\");\n }\n return str;\n }",
"@Override\n\t\tpublic int compare(String string1, String string2) {\n\t\t\treturn string2.length() - string1.length();\n\t\t}",
"Boolean checkLength(String detail);",
"public static void main(String[] args) {\n\n\t\tString a = \"apples\";\n\t\tString b = \"Bucky\";\n\t\tString c = \"BUCKY\";\n\n\t\tif (a.equalsIgnoreCase(\"apples\"))\n\t\t\tSystem.out.println(a.length() + \" \" + \"apples\");\n\t\tif (b.equalsIgnoreCase(c))\n\t\t\tSystem.out.println(\"the buckies match\");\n\n\t}",
"@Override\n\t\tpublic int compare(String string1, String string2) {\n\t\t\treturn string1.length() - string2.length();\n\t\t}",
"public static void check2StringIfContains(String value1, String value2){\n System.out.println(\"Check 2 string if contains:\\n1st: '\" + value1 + \"'\\n2nd: '\" + value2 + \"'\");\n Assert.assertTrue(value1.contains(value2));\n }",
"public static boolean timingSafeEquals(String first, String second) {\n if (first == null) {\n return second == null;\n } else if (second == null) {\n return false;\n } else if (second.length() <= 0) {\n return first.length() <= 0;\n }\n char[] firstChars = first.toCharArray();\n char[] secondChars = second.toCharArray();\n char result = (char) ((firstChars.length == secondChars.length) ? 0 : 1);\n int j = 0;\n for (int i = 0; i < firstChars.length; ++i) {\n result |= firstChars[i] ^ secondChars[j];\n j = (j + 1) % secondChars.length;\n }\n return result == 0;\n }",
"private void testStringAssert(String actual, String expected) {\n if (!actual.equals(expected)) {\n if (actual.length() != expected.length()) {\n System.err.println(\"Different lengths, expected \" + expected.length() + \" but got \" + actual.length());\n }\n for (int i = 0; i < expected.length(); i++) {\n char e = expected.charAt(i);\n if (i >= actual.length()) {\n System.err.println(\"Expected character '\" + e + \"' (Code \" + (int) e + \") is at position \" + i\n + \" which is beyond the length of the actual string\");\n break;\n }\n char a = actual.charAt(i);\n if (e != a) {\n System.err.println(\"Expected character '\" + e + \"' (Code \" + (int) e + \") at position \" + i\n + \" does not match actual character '\" + a + \"' (Code \" + (int) a + \")\");\n int start = Math.max(0, i - 10);\n int end = Math.min(expected.length(), i + 10);\n System.err.println(\"Expected Context:\");\n System.err.println(expected.substring(start, end));\n System.err.println(\"Actual Context:\");\n end = Math.min(actual.length(), i + 10);\n System.err.println(actual.substring(start, end));\n break;\n }\n }\n }\n assertEquals(actual, expected);\n }",
"public static void main(String[] args) {\n\n String word1 = \"abc\";\n String word2 = \"trv\";\n int length1=word1.length();\n int length2=word2.length();\n if (length1==3&&length2==3){\n System.out.println(word1.charAt(0)+\"\"+word2.charAt(0)+\n word1.charAt(1)+\"\"+word2.charAt(1)+\n word1.charAt(2)+\"\"+word2.charAt(2)); }\n else if (length1!=3||length2!=3){\n System.out.println(\"cannot merge\");\n }\n }",
"public int stringMatch(String a, String b) {\n int result = 0;\n int end = (a.length()<=b.length()? a.length():b.length());\n for (int i = 0; i <end-1 ; i++){\n if (a.substring(i, i + 2).equals(b.substring(i, i + 2))) {\n result++;\n }\n }\n return result;\n }",
"public int String_Compare(String A, String B) {\n\t\t\n\t\tint shorter_length;\n\t\tif(A.length() >= B.length()) {\n\t\t\tshorter_length=B.length();\n\t\t}\n\t\telse {\n\t\t\tshorter_length=A.length();\n\t\t}\n\t\t\n\n\t\t\n\t\t\n\t\tint i = 0;\n\t\tint A_char;\n\t\tint B_char;\n\t\t\n\t\twhile(i < shorter_length ) {\n\t\t\tA_char = (int)A.charAt(i);\n\t\t\tB_char = (int)B.charAt(i);\n\n\t\t\tif(A_char != B_char) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\ti+=1;\n\t\t}\n\t\treturn 0;\n\t}",
"static String twoStrings(String s1, String s2) {\n Hashtable<Character, Integer> shortDict = null;\n Hashtable<Character, Integer> longDict = null;\n \n boolean isCommonSubset = false;\n \n String longerString = s1.length() >= s2.length() ? s1 : s2;\n String shorterString = s1.length() < s2.length() ? s1 : s2;\n \n longDict = prepareHashtable(longerString);\n shortDict = prepareHashtable(shorterString);\n \n for (char ch: shortDict.keySet()) {\n if (longDict.containsKey(ch)) {\n isCommonSubset = true;\n break;\n }\n }\n \n return isCommonSubset ? \"YES\" : \"NO\";\n }",
"private int compareInternal(String shorter, String longer) {\n int lengthDiff = longer.length() - shorter.length();\n\n for (int compareStartIndexInsideLonger = 0; compareStartIndexInsideLonger <= lengthDiff; compareStartIndexInsideLonger++) {\n String compariosonPartFromLonger = longer.substring(compareStartIndexInsideLonger, compareStartIndexInsideLonger + shorter.length());\n //we have found an answer if they are not equal\n int result = shorter.compareTo(compariosonPartFromLonger);\n if (result != 0) {\n return result;\n }\n }\n\n //the are equal\n return 0;\n }",
"public static void main(String[] args) {\n\t\tString Frase1 = (\"Estic fent un String\");\r\n\t\tString Frase2 = (\"Aixo es un String\");\r\n\t\t\r\n\t\tint comparacio = Frase1.compareToIgnoreCase(Frase2);\r\n\t\tif(comparacio < 0) {\r\n\t\t\tSystem.out.println(\"Fras1 es primera per ordre alfabetic \" + Frase1);\r\n\t\t}\r\n\t\telse if (comparacio > 0) {\r\n\t\tSystem.out.println(\"Frase2 es primera per ordre alfabetic: \" + Frase2);\t\r\n\t\t}else {\r\n\t\t\tSystem.out.println(\"Les dues paraules son iguals\");\r\n\t\t}\r\n\t}",
"public static void main( String[] args )\r\n {\n String s1 = new String( \"hello\" ); // s1 is a copy of \"hello\"\r\n String s2 = \"goodbye\";\r\n String s3 = \"Happy Birthday\";\r\n String s4 = \"happy birthday\";\r\n\r\n System.out.printf(\"s1 = %s\\ns2 = %s\\ns3 = %s\\ns4 = %s\\n\\n\", s1, s2, s3, s4 );\r\n\r\n // test for equality with equals() method\r\n if ( s1.equals( \"hello\" ) ) // true\r\n System.out.println( \"s1 equals \\\"hello\\\"\" );\r\n else\r\n System.out.println( \"s1 does not equal \\\"hello\\\"\" );\r\n\r\n // test for equality with ==\r\n if ( s1 == \"hello\" ) // false; they are not the same object\r\n System.out.println( \"s1 is the same object as \\\"hello\\\"\" );\r\n else\r\n System.out.println( \"s1 is not the same object as \\\"hello\\\"\" );\r\n\r\n // test for equality (ignore case)\r\n if ( s3.equalsIgnoreCase( s4 ) ) // true\r\n System.out.printf( \"%s equals %s with case ignored\\n\", s3, s4 );\r\n else\r\n System.out.println( \"s3 does not equal s4\" );\r\n\r\n // test compareTo\r\n // the compareTo() method comparison is based on the Unicode value of each character in the string\r\n // if the strings are equal, the method returns 0\r\n\r\n System.out.printf(\"\\ns1.compareTo( s2 ) is %d\", s1.compareTo( s2 ) );\r\n System.out.printf(\"\\ns2.compareTo( s1 ) is %d\", s2.compareTo( s1 ) );\r\n System.out.printf(\"\\ns1.compareTo( s1 ) is %d\", s1.compareTo( s1 ) );\r\n System.out.printf(\"\\ns3.compareTo( s4 ) is %d\", s3.compareTo( s4 ) );\r\n System.out.printf(\"\\ns4.compareTo( s3 ) is %d\\n\\n\", s4.compareTo( s3 ) );\r\n\r\n // test regionMatches (case sensitive)\r\n if ( s3.regionMatches( 0, s4, 0, 5 ) )\r\n System.out.println(\"First 5 characters of s3 and s4 match\" );\r\n else\r\n System.out.println(\"First 5 characters of s3 and s4 do not match\" );\r\n\r\n // test regionMatches (ignore case)\r\n if ( s3.regionMatches( true, 0, s4, 0, 5 ) )\r\n System.out.println(\"First 5 characters of s3 and s4 match with case ignored\" );\r\n else\r\n System.out.println(\"First 5 characters of s3 and s4 do not match\" );\r\n }",
"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 }",
"@Override\r\n\t\t\tpublic int compare(String s1, String s2) {\n\t\t\t\treturn (s1.length() - s2.length());\r\n\t\t\t}",
"public static void main(String[] args) {\n\t\tScanner s=new Scanner(System.in);\r\n\t\tString s1=s.nextLine();\r\n\t\tString s2=s.nextLine();\r\n\t\tint c=0;\r\n\t\tfor (int i=0;i<s2.length();i++) {\r\n\t\t\tchar c1=s2.charAt(i);\r\n\t\t\tfor(int j=0;j<s1.length();j++) {\r\n\t\t\t\tif (c1==s1.charAt(j) && s1.charAt(j)!=' ')\r\n\t\t\t\t\tc++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tif (c==s1.length())\r\n\t\t\tSystem.out.print(\"yes\");\r\n\r\n\t}",
"public boolean checkSam(String stringA, String stringB) {\r\n\t\tString[] s1 = stringA.split(\" \");\r\n\t\tString[] s2 = stringB.split(\" \");\r\n\t\tif(s1.length == s2.length){\r\n\t\t\tint count = 0;\r\n\t\t\tfor (String sB : s2) {\r\n\t\t\t\tfor (String sA : s1) {\r\n\t\t\t\t\tif(sA.equals(sB)){\r\n\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(count == s2.length){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n }",
"@Override\n public int compare(String o1, String o2) {\n return o1.length() - o2.length();\n }",
"private boolean m81840a(String str, String str2) {\n boolean isEmpty = TextUtils.isEmpty(str);\n boolean isEmpty2 = TextUtils.isEmpty(str2);\n if (isEmpty && isEmpty2) {\n return true;\n }\n if (!isEmpty && isEmpty2) {\n return false;\n }\n if (!isEmpty || isEmpty2) {\n return str.equals(str2);\n }\n return false;\n }",
"public static boolean timingSafeEquals(CharSequence first, CharSequence second) {\n if (first == null) {\n return second == null;\n } else if (second == null) {\n return false;\n } else if (second.length() <= 0) {\n return first.length() <= 0;\n }\n int firstLength = first.length();\n int secondLength = second.length();\n char result = (char) ((firstLength == secondLength) ? 0 : 1);\n int j = 0;\n for (int i = 0; i < firstLength; ++i) {\n result |= first.charAt(i) ^ second.charAt(j);\n j = (j + 1) % secondLength;\n }\n return result == 0;\n }",
"public static boolean endOther(String a, String b) {\n String larger, smaller;\n if (a.length() > b.length()){\n larger = a;\n smaller = b;\n }\n else{\n larger = b;\n smaller = a;\n }\n larger = larger.toLowerCase();\n smaller = smaller.toLowerCase();\n int i = larger.length() - smaller.length();\n return ((larger.substring(i, larger.length())).equals(smaller));\n }",
"public static void main(String[] args) {\r\n\t String str1 = \"Hello world\";\r\n\t String str2 = str1.toUpperCase();\r\n\t String str3 = str1.toLowerCase();\r\n\t System.out.println(str1 + \" \" +str2);\r\n\t int str1Length = str1.length();\r\n\t System.out.println(str1Length);\r\n\t}",
"@Test\n public void testEqualChar3() {\n char a = '%';\n char b = '!';\n char c = '\\t';\n char d = '\\n';\n\n boolean result1 = offByOne.equalChars(a, b);\n boolean result2 = offByOne.equalChars(c, d);\n\n assertFalse(result1);\n assertTrue(result2);\n }",
"public static void main(String[] args) {\r\n\r\n\t\tString s1 = \"Welcome to testing world\";\r\n\t\tString s2 = \"Welcome to testing world...\";\r\n\t\t//using equals\r\n\t\tif (s1.equals(s2)) {\r\n\t\t\tSystem.out.println(\"Strings are equal\");\r\n\t\t} \r\n\t\telse {\r\n\t\t\tSystem.out.println(\"Strings are not equal\");\r\n\t\t}\r\n\t\t\r\n\t}",
"static int compare(String a, String b) {\n if (a == null) a = \"\";\n if (b == null) b = \"\";\n\n int i = 0;\n while (i < a.length() && i < b.length()) {\n char x = a.charAt(i), y = b.charAt(i);\n if (x != y) return x - y;\n i++;\n }\n return a.length() - b.length();\n }",
"private void assertStringContains(final String expected, final String comparison) {\n final String cleanedExpected = expected.replaceAll(\"[\\t\\n]\", \"\")\n .replaceAll(\" {2,}\", \" \");\n final String cleanedTest = comparison.replaceAll(\"[\\t\\n]\", \"\")\n .replaceAll(\" {2,}\", \" \");\n assertTrue(cleanedTest.contains(cleanedExpected));\n }",
"static String doit(final String string1, final String string2) {\n String shorterString; // a\n String longerString; // b\n if (string1.length() > string2.length()) {\n shorterString = string2;\n longerString = string1;\n } else {\n longerString = string2;\n shorterString = string1;\n }\n String r = \"\";\n\n for (int i = 0; i < shorterString.length(); i++) {\n for (int j = shorterString.length() - i; j > 0; j--) {\n for (int k = 0; k < longerString.length() - j; k++) {\n if (shorterString.regionMatches(i, longerString, k, j) && j > r.length()) {\n r = shorterString.substring(i, i + j);\n }\n }\n } // Ah yeah\n }\n return r;\n\n }",
"private static boolean letterDifferByOne(String word1, String word2) {\n if (word1.length() != word2.length()) {\n return false;\n }\n\n int differenceCount = 0;\n for (int i = 0; i < word1.length(); i++) {\n if (word1.charAt(i) != word2.charAt(i)) {\n differenceCount++;\n }\n }\n return (differenceCount == 1);\n }",
"public static void main(String[] args){\n System.out.println(differentStrings(\"aardvark\", \"aardvark\"));\n }",
"public boolean checkPalindromeFormation(String a, String b) {\n int n = a.length();\n return findCommonSubstring(a.toCharArray(), b.toCharArray(), 0, n - 1) ||\n findCommonSubstring(b.toCharArray(), a.toCharArray(), 0, n - 1);\n }",
"private boolean compareActualAndExpectedOutputs(String string,\r\n\t\t\tString string2) {\r\n\t\treturn string.equals(string2);\r\n\t}",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n String str1 = Exercise1.getString(scanner);\n String str2 = Exercise1.getString(scanner);\n\n int[] rangeStr1 = getRange(scanner, str1);\n int[] rangeStr2 = getRange(scanner, str2);\n\n// Arrays.stream(range)\n// .forEach(System.out::println);\n\n boolean value = checkStringRangeEquality(str1, str2, rangeStr1, rangeStr2);\n System.out.println(\"Strings are equal: \" + value);\n\n\n }",
"@Override\r\n\tpublic int compare(String s1, String s2) {\n\t\treturn s1.length() - s2.length();\r\n\t}",
"public static void main(String[] args) {\n\t\t String s1=new String(\"great\");\n\t\t String s2=new String(\"rgtae\");\n\t\t if(isScrableString(s1, s2)){\n\t\t\t System.out.println(\"two string is scramble string!\");\n\t\t }else{\n\t\t\t System.out.println(\"two string is not scramble string!\");\n\t\t }\n\t}",
"private void compareString(String rs, String ts, String meaning) {\n\t\tassertNotNull(\"NULL \"+meaning, ts);\n\t\tassertEquals(\"Wrong \"+meaning, rs, ts);\t\t\n\t}",
"private static void checkBounds(byte[] bytes, int offset, int length) {\n\t\tif (length < 0)\n\t\t\tthrow new StringIndexOutOfBoundsException(length);\n\t\tif (offset < 0)\n\t\t\tthrow new StringIndexOutOfBoundsException(offset);\n\t\tif (offset > bytes.length - length)\n\t\t\tthrow new StringIndexOutOfBoundsException(offset + length);\n\t}",
"public static String longerString(String s1, String s2) {\n \tif(s1.length()>s2.length()) {\n \t\treturn s1;\n \t}else if(s1.length()<s2.length()) {\n \t\treturn s2;\n \t}\n return \"equal\";\n }",
"static void test_isPalindrome() {\n\n String pal1 = new String( \"a\" );\n String pal2 = new String( \"ab\" );\n String pal3 = new String( \"aba\" );\n String pal4 = new String( \"amanaplanacanalpanama\" );\n String pal5 = new String( \"abba\" );\n String pal6 = new String( \"Racecar\" );\n String pal7 = new String( \"RacecaR\" );\n\n\n System.out.println( \"\\nTESTS FOR isPalindrome() : \" );\n\n System.out.print( \"Test for string 'a' : \" );\n try { System.out.println( StringStuff.isPalindrome( pal1 ) ? \"true\" : \"false\" ); }\n catch( Exception e ) { System.out.println ( false ); }\n\n System.out.print( \"Test for string 'ab' : \" );\n try { System.out.println( StringStuff.isPalindrome( pal2 ) ? \"true\" : \"false\" ); }\n catch( Exception e ) { System.out.println ( false ); }\n\n System.out.print( \"Test for string 'aba' : \" );\n try { System.out.println( StringStuff.isPalindrome( pal3 ) ? \"true\" : \"false\" ); }\n catch( Exception e ) { System.out.println ( false ); }\n\n System.out.print( \"Test for string 'amanaplanacanalpanama' : \" );\n try { System.out.println( StringStuff.isPalindrome( pal4 ) ? \"true\" : \"false\" ); }\n catch( Exception e ) { System.out.println ( false ); }\n\n System.out.print( \"Test for string 'abba' : \" );\n try { System.out.println( StringStuff.isPalindrome( pal5 ) ? \"true\" : \"false\" ); }\n catch( Exception e ) { System.out.println ( false ); }\n\n System.out.print( \"Test for string 'Racecar' : \" );\n try { System.out.println( StringStuff.isPalindrome( pal6 ) ? \"true\" : \"false\" ); }\n catch( Exception e ) { System.out.println ( false ); }\n\n System.out.print( \"Test for string 'RacecaR' : \" );\n try { System.out.println( StringStuff.isPalindrome( pal7 ) ? \"true\" : \"false\" ); }\n catch( Exception e ) { System.out.println ( false ); }\n\n }",
"public static void main(String[] args) {\n\t\tScanner keyIn = new Scanner (System.in);\n\t\tString str1, str2;\n\t\t\n\t\t// 2. User prompt:\n\t\tSystem.out.println(\"Please enter the two strings: \");\n\t\tstr1 = keyIn.next();\n\t\tstr2 = keyIn.next();\n\t\t\n\t\t// 3. Core logic:\n\t\tif (str1.compareToIgnoreCase(str2) == 0)\n\t\t\tSystem.out.println(\"Content same\");\n\t\telse\n\t\t\tSystem.out.println(\"Different content\");\n\t\t\n\t\t// 4. Output:\n\t\t\n\t\t// 5. Clean up:\n\t\tkeyIn.close();\n\n\t}",
"public static boolean contentEqualsIgnoreCase(CharSequence a, CharSequence b) {\n int len = a.length();\n if (b.length() != len) {\n return false;\n }\n return biIterate(a, (index, ch, l, remaining) -> {\n boolean match = Character.toLowerCase(ch) == Character.toLowerCase(b.charAt(index));\n return !match ? BiIterateResult.NO : BiIterateResult.MAYBE;\n }).isOk();\n }",
"public static boolean stringIntersect(String a, String b, int len) {\n\t\tHashSet<String> mySet = new HashSet<String>();\n\t\tfor (int i=0; i+len <= a.length(); i++){\n\t\t\tmySet.add(a.substring(i, i+len));\n\t\t}\n\t\tfor (int i=0; i+len <= b.length(); i++){\n\t\t\tif (mySet.contains(b.substring(i, i+len))){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false; // TO DO ADD YOUR CODE HERE\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tString str1 =\"amol\";\n\t\tString str2 =\"amol\";\n\t\tString str3 =\"Amol\";\n\t\tString str4 =\"raj\";\n\t\tString str5 = new String(\"amol\");\n\t\t\n\t\tSystem.out.println(str1.equals(str2)); // true\n\t\tSystem.out.println(str1.equals(str3));\n\t\tSystem.out.println(str1.equalsIgnoreCase(str3));\n\t\tSystem.out.println(str1.equals(str4));\n\t\tSystem.out.println(str1.equals(str5)); // true\n\t\t\n\t\tSystem.out.println(str1==str2); // true\n\t\n\t\tSystem.out.println(str1==str5); // false\n\t\t\n\t\t\n\n\t}",
"public boolean typeStringsEqual(String uti1, String uti2);",
"public void strComp() {\n\t\tSystem.out.printf(\"total word: %d\", userstring.size());\n\t\tint i = 0, j = 0, k = 0;\n\t\twhile (i < userstring.size() ) {\n\t\t\tif (userstring.get(i++).equalsIgnoreCase(masterString.get(j++))) {\n\t\t\t\t// user said correct word. update the array and total number of\n\t\t\t\t// matches\n\t\t\t\tmatchValues[k] = true;\n\t\t\t\ttotalCorrectMatches++;\n\t\t\t} \n\t\t\tk++;\n\t\t}\n\n\t}",
"public static void main(String[] args) {\n\t\tString s=\"geeks\";\r\n\t\tString s1=\"egeks\";\r\n\t\tint m=s.length();\r\n\t\tint n=s1.length();\r\n\t\tfor(int i=0;i<m;i++)\r\n\t\t{\r\n\t\t\tfor(int j=0;j<n;j++)\r\n\t\t\t{\r\n\t\t\t\tif(s.charAt(i)!=s1.charAt(j))\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"no of index\"+i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}",
"public boolean checkPermutaionOfStr(String str1, String str2){\n\tArrayList<Integer> word_cnt1 = new ArrayList<Integer>();\n\tArrayList<Integer> word_cnt2 = new ArrayList<Integer>();\n\t\n\tif(str1.length() != str2.length())\n\t\treturn false;\n\tfor(int i = 0; i< 256; i++){\n\t\tword_cnt1.add(0);\n\t\tword_cnt2.add(0);\n\t}\n\t\n\tfor(int i = 0; i< str1.length(); i++){\n\t\tcntStrChar(str1, word_cnt1, i);\n\t\tcntStrChar(str2, word_cnt2, i);\n\t}\n\t\n\tfor(int i = 0; i< 256; i++){\n\t\tif (word_cnt1.get(i) != word_cnt2.get(i) )\n\t\t\treturn false;\n\t}\n\treturn true;\n}",
"private boolean translateWith2ExchangedChars(String input1, String input2) {\n if (StringUtils.isBlank(input1) || StringUtils.isBlank(input2) || input1.length() != input2.length()) {\n return false;\n }\n if (input1.equals(input2)) {\n for (int i = 0; i < input1.length(); i++) {\n char current = input1.charAt(i);\n if (input1.lastIndexOf(current) != i) {\n return true;\n }\n }\n return false;\n } else {\n int first = -1, second = -1;\n for (int i = 0; i < input1.length(); i++) {\n if (input1.charAt(i) != input2.charAt(i)) {\n if (first == -1) {\n first = i;\n } else if (second == -1) {\n second = i;\n } else {\n return false;\n }\n }\n }\n return input1.charAt(first) == input2.charAt(second)\n && input1.charAt(second) == input2.charAt(first);\n }\n }",
"public boolean showfinalresult() throws PalindromeException{\n if((checkString()==true)){\n if(this.joinedTextPalindrome.length()==0){\n throw new PalindromeException(\"This text is too short\");\n }else{\n return true;\n }\n }else{\n return false;\n }\n }",
"@Override\n\tpublic int compare(String s1, String s2) {\n\t\t// if s1 = s2 returns 0\n\t\t// if s1 > s2 returns 1\n\t\t// if s1 < s2 returns -1\n\n\t\tint len1 = s1.length();\n\t\tint len2 = s2.length();\n\n\t\tif (len1 > len2) {\n\t\t\treturn 1;\n\t\t} else if (len1 < len2) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn 0;\n\t}",
"boolean equal(String s1, String s2) {\n return compareStrings(s1, s2) == 0;\n }",
"@Test\n\tvoid testCheckString2() {\n\t\tassertFalse(DataChecker.checkString(\"\"));\n\t}",
"public static boolean isEdited(String s1, String s2)\n\t{\n\t\t\n\t\t//checks to see if the two strings' lengths are off by only one character\n\t\tif((s1.length() - s2.length() == 1) || (s1.length() - s2.length() == -1))\n\t\t{\n\t\t\tint length = 0;\t\t\t\t\t\t\t//variable to hold the length of the shorter string\n\t\t\tint edit = 0;\t\t\t\t\t\t\t//counts how many edits are occurring\n\t\t\t\n\t\t\t//determines the longer length between the two strings\n\t\t\tif(s1.length() - s2.length() == 1)\n\t\t\t{\n\t\t\t\tlength = s1.length();\n\t\t\t\tfor(int i = 0; i < length; i++)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t//compares the characters to see if they are the same or not \n\t\t\t\t\t\tif(!s1.substring(i, i+1).equals(s2.substring(i, i+1)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tedit++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//catches the expected out of bounds exception and adds to the edited total\n\t\t\t\t\tcatch(StringIndexOutOfBoundsException e)\n\t\t\t\t\t{\n\t\t\t\t\t\tedit++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlength = s2.length();\n\t\t\t\tfor(int i = 0; i < length; i++)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t//compares the characters to see if they are the same or not \n\t\t\t\t\t\tif(!s1.substring(i, i+1).equals(s2.substring(i, i+1)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tedit++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//out of bounds exception expected, add to the total\n\t\t\t\t\tcatch(StringIndexOutOfBoundsException e)\t\t\t\n\t\t\t\t\t{\n\t\t\t\t\t\tedit++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"number of edits: \" + edit);\n\t\t\t\n\t\t\t\n\t\t\tif(edit <= 1)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t//if the two strings are the same length, then compare the characters \n\t\t//to see if there is only one replaced character\n\t\t//logically, if they are the same length then, the edit must be a replace\n\t\t//on top of that, there can only be one replacement\n\t\t\n\t\tint counter = 0;\t\t\t\t\t\t\t\t\t\t\t\t//counts the edits\n\t\tfor(int i = 0; i < s1.length(); i++)\n\t\t{\n\t\t\t//compare the substrings to similarity\n\t\t\tif(!s1.substring(i, i+1).equals(s2.substring(i, i+1)))\n\t\t\t{\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(\"number of edits: \" + counter);\n\t\t\n\t\tif(counter <= 1)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}",
"public final void testAlwaysThereStrings() throws Exception\n {\n mSolo.sleep(TestValues.LET_UI_THREAD_UPDATE_DISPLAY);\n\n // working on a substring as does not work on multi-lines\n // Assert.assertTrue(mSolo.waitForText(mSolo.getString(R.string.mass_import__principle_explanation__label).substring(10)));\n Assert.assertTrue(mSolo.waitForText(mSolo.getString(R.string.mass_import__import__button)));\n\n // let human see the screen\n mSolo.sleep(Common.HUMAN_TIME_FOR_READING);\n }",
"boolean checkChar(String s1, String s2);",
"public static void main(String[] args) {\n\t\tString a=\"hi\";\n\t\tString b=\"hello\"; \n\t\tint len=a.length();\n\t\tint len1=b.length();\n\t\tif(len1>len)\n\t {\n\t\t\tSystem.out.println(a+b+a);\n\t\t}\n\t\telse\n\t\t\tSystem.out.println(b+a+b);\n }",
"public static void main(String[] args) {\n\t\t\n\t\tString str = \"Cybertek\";\n\t\t boolean R1 = str.isEmpty(); // False\n\t\t System.out.println(R1);\n\t\t \n\t\t String str2 = \"\";\n\t\t if(str2.isEmpty()) { // True\n\t\t\t System.out.println(\"it's empty String\");\n\t\t }\n\t\t else {\n\t\t\t System.out.println(\"it's not empty\");\n\t\t }\n\t\t \n\t\t \n\t /*\n\t equals(str): checks if two Strings' visible texts are equal or not.\n\t */\n\t\t \n\t\t String A1 = \"Cybertek\";\n\t\t String A2 = new String (\"Cybertek\");\n\t\t System.out.println(A1 == A2); // false\n\t\t \n\t\t boolean R2 = A1.contentEquals(A2);\n\t\t System.out.println(R2);\n\t\t \n\t\t System.out.println( \"java\".equals(\"Java\")); // false, because of case sensitivity\n\t\t \n\t\t \n\t\t /*\n\t\t equalsIgnoreCase(str): \n\t\t checks if two Strings' visible texts are equal or not,\n\t\t then returns a boolean expression.\n\t\t Case sensitivity does not matter.\n\t\t */\n\t\t \n\t\t String s1 = \"JAVA\";\n\t\t String s2 = new String(\"java\");\n\t\t System.out.println(s1 == s2); // false\n\t\t \n\t\t System.out.println(s1.equals(s2)); // false\n\t\t System.out.println(s1.equalsIgnoreCase(s2)); // true\n\t\t \n\t\t\n\t\t\n\t /*\n\t contains(str): checks if the str is contained in the String or not,\n\t then it returns a boolean expression.\n\t \n\t if it is contained ==> true\n\t if it is !contained ==> false\n\t */\n\t\t \n\t\t String name = \"Muhtar\";\n\t\t boolean Result = name.contains(\"ABC\"); // false\n\t\t System.out.println(Result);\n\t\t \n\t\t String name2 = \"Marufjon\";\n\t\t System.out.println(name2.contains(\"m\")); // false, case sensitivity\n\t\t \n\t\t \n\t\t \n\t\t /*\n\t\t startsWith(str): checks if the String is started with the str or not,\n\t\t then returns a boolean expression.\n\t\t \n\t\t startedwith ==> tru\n\t\t !startedwith ==> false\n\t\t */\n\t\t \n\t\t String today = \"Java\";\n\t\t boolean result = today.startsWith(\"J\");\n\t\t System.out.println(result); // true\n\t\t \n\t\t String names = \"Cybertek School is a great place to learn Java\";\n\t\t System.out.println(names.startsWith(\"Cybertek School\")); //true\n\t\t \n\t\t \n\t\t /*\n\t\t endsWith(str): checks if the String is ended with the given str or not, \n\t\t then returns a boolean expression.\n\t\t \n\t\t endedwith ==> true !endedwith ==> false\n\t\t \n\t\t */\n\t\t \n\t\t String B1 = \"Muhtar\";\n\t\t System.out.println(B1.endsWith(\"R\")); //false, case sensitivity\n\t\t System.out.println(B1.endsWith(\"r\")); // true\n\t\t \n\t\t \n\t\t\t\t \n\t\t \n\t\t \n\t}",
"@Test\n public void testEditDistDifferentStrings() throws Exception{\n assertEquals(1,Esercizio2.edit_distance_dyn(s1, s2));\n }",
"public static void main(String[] args) {\n\n\t\t\n\t\tString s =\"Soni Shirwani\";\n\t\t\n\t\tSystem.out.println(s.charAt(3));\n\t\t\n\t\tString s1=\"Soni\",s2=\"Soni\";\n\t\t\n\t\tSystem.out.println(s1.equals(s2));\n\t\t\n\t\tString empty=\"\";\n\t\t\n\t\tSystem.out.println(empty.isEmpty());\n\t\t\n\t\tSystem.out.println(s.length());\n\t\t\n\t\tSystem.out.println(s.replace(\"i\", \"y\"));\n\t\t\n\t\tSystem.out.println(s.substring(5));\n\t\tSystem.out.println(s.substring(3,8));\n\t\t\n\t\tSystem.out.println(s.indexOf('n'));\n\t\t\n\t\tSystem.out.println(s.lastIndexOf('n'));\n\t\t\n\t\tSystem.out.println(s.toUpperCase());\n\t\t\n\t\tSystem.out.println(s.toLowerCase());\n\t\t\n\t\tScanner ss= new Scanner(System.in);\n\t\tString input=ss.nextLine();\n\t\t\n\t\tSystem.out.println(input.trim());\n\t\t\n\t\tfinal String s1f=\"final\";\n\t\tfinal StringBuffer sb1= new StringBuffer(\"asd0\");\n\t\tsb1.append(\"tets\");\n\t\t\n\t\t\n\t\t\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tString s1 = \"Welcome\";\n\t String s2 = \"To this world\";\n\t String s3 = \"Welcome\";\n\t \n\t System.out.println(s1.length()); //length()\n\t System.out.println(s1.concat(s2)); //concat ()\n\t System.out.println(s1.equals(s2)); // equals()\n\t System.out.println(s1.equals(s3)); // equals()\n\t System.out.println(s1.equalsIgnoreCase(s2)); // equalsIgnoreCase()\n\t System.out.println(s1.contains(\"Wel\"));\n\t System.out.println(s1.replace(\"Wel\",\"Babu\"));\n\t System.out.println(s1.subSequence(2, 5));\n\t \n\n\t}",
"public static void main(String[] args) {\n\t\tMyString e = new MyString(\"Jayaseelan\");\n\n\t\t// Test #1\n\t\tint expected1 = 5;\n\t\t// theString = \"Jayaseelan\";\n\t\tint result1 = e.getVowelsCount();\n\t\tif (expected1 == result1) {\n\t\t\tSystem.out.println(\"test passes\");\n\t\t} else {\n\t\t\tSystem.out.println(\"test fails\");\n\t\t}\n\n\t\t// Test #2\n\t\tint expected2 = 5;\n\n\t\tint result2 = e.getConsonantCount();\n\t\tif (expected2 == result2) {\n\t\t\tSystem.out.println(\"test passes\");\n\t\t} else {\n\t\t\tSystem.out.println(\"test fails\");\n\t\t}\n\n\t\t// Test #3\n\t\tint expected3 = 1;\n\n\t\tint result3 = e.getNumCapitalLetters();\n\t\tif (expected3 == result3) {\n\t\t\tSystem.out.println(\"test passes\");\n\t\t} else {\n\t\t\tSystem.out.println(\"test fails\");\n\t\t}\n\n\t\t// Test #4\n\t\tint expected4 = 10;\n\n\t\tint result4 = e.getLength();\n\t\tif (expected4 == result4) {\n\t\t\tSystem.out.println(\"test passes\");\n\t\t} else {\n\t\t\tSystem.out.println(\"test fails\");\n\t\t}\n\n\t\t// Test #4\n\t\tint expected5 = 381;\n\n\t\tint result5 = e.getSumOfAllCharacters();\n\t\t// System.out.println(result5);\n\t\tif (expected4 == result4) {\n\t\t\tSystem.out.println(\"test passes\");\n\t\t} else {\n\t\t\tSystem.out.println(\"test fails\");\n\t\t}\n\n\t\t// Test #5\n\t\tString expected6 = \"naleesayaJ\";\n\n\t\tString result6 = e.reverse();\n\t\t// System.out.println(result5);\n\t\tif (expected6.equals(result6)) {\n\t\t\tSystem.out.println(\"test passes\");\n\t\t} else {\n\t\t\tSystem.out.println(\"test fails\");\n\t\t}\n\n\t}",
"@Test\n\tpublic void testareFirstAndLastTwoCharactersTheSame_BasicNegative() \n\t{\n\t\tassertFalse(helper.areFirstAndLastTwoCharactersTheSame(\"ABCD\"));\n\t}",
"private boolean equals(String str1, String str2)\n\t{\n\t\tif (str1.length() != str2.length()) // Easiest to check is if they are the same to potentially avoid running remaining code\n\t\t\treturn false;\n\t\tfor(int i = 0; i < str1.length(); i++)\n\t\t{\n\t\t\tif (str1.charAt(i) != str2.charAt(i)) // If at any point one char is not equal to the same char at a given index then they are disimilar\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true; // If no discrepancies are found then the strings must be equal\n\t}",
"static int size_of_cmp(String passed){\n\t\treturn 1;\n\t}",
"@Test\n\tvoid testCheckString1() {\n\t\tassertTrue(DataChecker.checkString(\"Test\"));\n\t}",
"public static void main(String[] args) {\n\n\t\tString str = \"What's the difference between java, javascript and python?\";\n\t\t\n\t\tint countJava = 0;\n\t\tint countPython = 0;\n\t\t\n\t\tString str1 = \"java\";\n\t\tString str2 = \"python\";\n\t\t\n\t\tfor(int i=0; i<str.length()-3; i++) {\n\t\t\tif(str.substring(i, i+4).equals(str1)) {\n\t\t\t\tcountJava++;\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<str.length()-5; i++) {\n\t\t\tif(str.substring(i, i+6).equals(str2)) {\n\t\t\t\tcountPython++;\n\t\t\t}\n\t\t}\n\t\tif(countJava == countPython) {\n\t\t\tSystem.out.println(true);\n\t\t}else {\n\t\t\tSystem.out.println(false);\n\t\t}\n\t\t\n\t}",
"static boolean equal (String s1, String s2) {\r\n if (s1==errorSignature) return true;\r\n if (s2==errorSignature) return true;\r\n if (s1==null || s1.length()==0)\r\n return s2==null || s2.length()==0;\r\n return s1.equals (s2);\r\n }",
"public static int compareCharSequences(CharSequence a, CharSequence b, boolean ignoreCase) {\n if (a == b) {\n return 0;\n }\n if (a instanceof String && b instanceof String) {\n return ((String) a).compareTo((String) b);\n }\n int aLength = a.length();\n int bLength = b.length();\n if (aLength == 0 && bLength == 0) {\n return 0;\n }\n int max = Math.min(aLength, bLength);\n for (int i = 0; i < max; i++) {\n char ac = ignoreCase ? Character.toLowerCase(a.charAt(i)) : a.charAt(i);\n char bc = ignoreCase ? Character.toLowerCase(b.charAt(i)) : b.charAt(i);\n int result = Character.compare(ac, bc);\n if (result != 0) {\n return result;\n }\n }\n if (aLength == bLength) {\n return 0;\n } else if (aLength > bLength) {\n return 1;\n } else {\n return -1;\n }\n }",
"@Test\n public void testEqualChars2() {\n char a = 'a';\n char b = 'b';\n char c = '1';\n char d = '2';\n\n boolean result1 = offByOne.equalChars(a, b);\n boolean result2 = offByOne.equalChars(c, d);\n\n assertTrue(result1);\n assertTrue(result2);\n }"
] | [
"0.6319886",
"0.60898817",
"0.6086391",
"0.60323626",
"0.6006156",
"0.59623516",
"0.59568846",
"0.5956831",
"0.5937805",
"0.5936232",
"0.5921117",
"0.5887501",
"0.5878285",
"0.58460826",
"0.5829695",
"0.5827892",
"0.57921803",
"0.57921803",
"0.5783137",
"0.57716435",
"0.57546186",
"0.5749672",
"0.57375747",
"0.57347",
"0.5733875",
"0.5709442",
"0.56865466",
"0.5681194",
"0.5671059",
"0.56613886",
"0.5643275",
"0.5628397",
"0.56108505",
"0.55948496",
"0.5587985",
"0.55779696",
"0.5574615",
"0.5571724",
"0.5571008",
"0.55706793",
"0.55616826",
"0.55559486",
"0.55554885",
"0.5551888",
"0.5523295",
"0.5508356",
"0.5505015",
"0.550159",
"0.55003506",
"0.5496144",
"0.5490209",
"0.5484716",
"0.54838306",
"0.5476173",
"0.54754126",
"0.5467123",
"0.545404",
"0.54472876",
"0.5438295",
"0.54237205",
"0.5422582",
"0.5417522",
"0.54170996",
"0.5416929",
"0.54162186",
"0.54153734",
"0.54145634",
"0.54086846",
"0.540166",
"0.5400497",
"0.53982973",
"0.5389694",
"0.5385953",
"0.5378818",
"0.5377203",
"0.53764087",
"0.53744435",
"0.53626066",
"0.5357341",
"0.53538924",
"0.53529376",
"0.53502923",
"0.5342394",
"0.5339247",
"0.53388786",
"0.5335722",
"0.5332608",
"0.53290707",
"0.532862",
"0.532737",
"0.53160346",
"0.5312637",
"0.5307978",
"0.5306511",
"0.530295",
"0.5294186",
"0.5278808",
"0.5277036",
"0.5273979",
"0.5272695"
] | 0.5379224 | 73 |
Inflate the menu; this adds items to the action bar if it is present. | @Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.shop, menu);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.actions, menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tgetMenuInflater().inflate(R.menu.actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.actions_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main_actions, menu);\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n\t\tinflater.inflate(R.menu.action_bar_menu, menu);\r\n\t\tmMenu = menu;\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.act_bar_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_actions, menu);\r\n\t\treturn true;\r\n //return super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\r\n\t inflater.inflate(R.menu.action_bar_all, menu);\r\n\t return super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\t super.onCreateOptionsMenu(menu);\n\t\tMenuInflater muu= getMenuInflater();\n\t\tmuu.inflate(R.menu.cool_menu, menu);\n\t\treturn true;\n\t\t\n\t\t\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.adventure_archive, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.archive_menu, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n \tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n \t\tinflater.inflate(R.menu.main, menu);\n \t\tsuper.onCreateOptionsMenu(menu, inflater);\n \t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.action_menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.action_menu, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater bow=getMenuInflater();\n\t\tbow.inflate(R.menu.menu, menu);\n\t\treturn true;\n\t\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\t\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\t\t\n\t\t/* Inflate the menu; this adds items to the action bar if it is present */\n\t\tgetMenuInflater().inflate(R.menu.act_main, menu);\t\t\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflate = getMenuInflater();\n inflate.inflate(R.menu.menu, ApplicationData.amvMenu.getMenu());\n return true;\n }",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.menu, menu);\n\t\t\treturn true; \n\t\t\t\t\t\n\t\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.main, menu);\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) \n {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_bar, menu);\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_item, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.menu, menu);\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t \n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\t//menu.clear();\n\t\tinflater.inflate(R.menu.soon_to_be, menu);\n\t\t//getActivity().getActionBar().show();\n\t\t//getActivity().getActionBar().setBackgroundDrawable(\n\t\t\t\t//new ColorDrawable(Color.rgb(223, 160, 23)));\n\t\t//return true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n this.getMenuInflater().inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.main, menu);\n }",
"@Override\n\tpublic void onCreateOptionsMenu( Menu menu, MenuInflater inflater )\n\t{\n\t\tsuper.onCreateOptionsMenu( menu, inflater );\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n \t// We must call through to the base implementation.\r\n \tsuper.onCreateOptionsMenu(menu);\r\n \t\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_menu, menu);\r\n\r\n return true;\r\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.inter_main, menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu (Menu menu){\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.custom_action_bar, menu);\n\t\treturn true;\n\t}",
"public void initMenubar() {\n\t\tremoveAll();\n\n\t\t// \"File\"\n\t\tfileMenu = new FileMenuD(app);\n\t\tadd(fileMenu);\n\n\t\t// \"Edit\"\n\t\teditMenu = new EditMenuD(app);\n\t\tadd(editMenu);\n\n\t\t// \"View\"\n\t\t// #3711 viewMenu = app.isApplet()? new ViewMenu(app, layout) : new\n\t\t// ViewMenuApplicationD(app, layout);\n\t\tviewMenu = new ViewMenuApplicationD(app, layout);\n\t\tadd(viewMenu);\n\n\t\t// \"Perspectives\"\n\t\t// if(!app.isApplet()) {\n\t\t// perspectivesMenu = new PerspectivesMenu(app, layout);\n\t\t// add(perspectivesMenu);\n\t\t// }\n\n\t\t// \"Options\"\n\t\toptionsMenu = new OptionsMenuD(app);\n\t\tadd(optionsMenu);\n\n\t\t// \"Tools\"\n\t\ttoolsMenu = new ToolsMenuD(app);\n\t\tadd(toolsMenu);\n\n\t\t// \"Window\"\n\t\twindowMenu = new WindowMenuD(app);\n\n\t\tadd(windowMenu);\n\n\t\t// \"Help\"\n\t\thelpMenu = new HelpMenuD(app);\n\t\tadd(helpMenu);\n\n\t\t// support for right-to-left languages\n\t\tapp.setComponentOrientation(this);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp=getMenuInflater();\n\t\tblowUp.inflate(R.menu.welcome_menu, menu);\n\t\treturn true;\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.listing, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.item, menu);\n return true;\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.resource, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu,menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.home_action_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.template, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n Log.d(\"onCreateOptionsMenu\", \"create menu\");\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.socket_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_menu, menu);//Menu Resource, Menu\n\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actionbar, menu);\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(toolbar_res, menu);\n updateMenuItemsVisibility(menu);\n return true;\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t// \n\t\tMenuInflater mi = getMenuInflater();\n\t\tmi.inflate(R.menu.thumb_actv_menu, menu);\n\t\t\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n }",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.swag_list_activity_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\n\t\treturn true;\n\t}",
"public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){\n }",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.jarvi, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n menuInflater.inflate(R.menu.main, menu);\n\n }",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.add__listing, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actmain, menu);\r\n return true;\r\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.buat_menu, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.layout.menu, menu);\n\t\treturn true;\n\t}",
"@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n\n\t\n\t\n\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\n\treturn super.onCreateOptionsMenu(menu);\n}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ichat, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater)\n\t{\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\tinflater.inflate(R.menu.expenses_menu, menu);\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.action_bar, menu);\n return true;\n }",
"@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}",
"@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}",
"@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp = getMenuInflater();\n\t\tblowUp.inflate(R.menu.status, menu);\n\t\treturn true;\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.menu, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn true;\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ui_main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_activity_actions, menu);\n return true;\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }"
] | [
"0.7246451",
"0.7201833",
"0.7195169",
"0.7176824",
"0.71071094",
"0.7039687",
"0.70379424",
"0.7011622",
"0.70095545",
"0.69799995",
"0.6945173",
"0.69389343",
"0.6933555",
"0.69172555",
"0.69172555",
"0.68906796",
"0.688355",
"0.687496",
"0.6874772",
"0.68613136",
"0.68613136",
"0.68613136",
"0.68613136",
"0.6852252",
"0.6846455",
"0.6818823",
"0.6816676",
"0.68122935",
"0.68119055",
"0.68119055",
"0.6805087",
"0.68003947",
"0.6797015",
"0.67904633",
"0.6789411",
"0.67871827",
"0.6782913",
"0.67593676",
"0.6756442",
"0.6747255",
"0.6742987",
"0.6742987",
"0.6740183",
"0.67392707",
"0.67249876",
"0.67237884",
"0.67217875",
"0.67217875",
"0.6719964",
"0.6711429",
"0.6706682",
"0.67035955",
"0.6699167",
"0.66980296",
"0.6696009",
"0.6694031",
"0.66855574",
"0.66825926",
"0.66825926",
"0.6682556",
"0.66795844",
"0.6678825",
"0.6676161",
"0.66680866",
"0.66665506",
"0.66625977",
"0.6657122",
"0.6657122",
"0.6657122",
"0.6656225",
"0.6653723",
"0.6653723",
"0.6653723",
"0.66520125",
"0.6651581",
"0.6649255",
"0.6648212",
"0.6646545",
"0.6646233",
"0.66460145",
"0.6645477",
"0.6644324",
"0.66441935",
"0.6642723",
"0.66420346",
"0.66412085",
"0.6638387",
"0.6633755",
"0.66334134",
"0.66321",
"0.663127",
"0.663127",
"0.663127",
"0.6628276",
"0.6627496",
"0.6626989",
"0.6625628",
"0.6623483",
"0.6620039",
"0.66181844",
"0.66181844"
] | 0.0 | -1 |
Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml. | @Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
Intent intent = new Intent(ShopActivity.this, InfoActivity.class);
startActivity(intent);
SharedPreferences coins_buffer = getSharedPreferences("cbuffer", 0);
SharedPreferences.Editor coins_buffer_editor = coins_buffer.edit();
coins_buffer_editor.putLong("dollars", dollars);
coins_buffer_editor.commit();
ShopActivity.this.finish();
return true;
}
return super.onOptionsItemSelected(item);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n //\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // Back button clicked\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // app icon in action bar clicked; goto parent activity.\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n switch (id) {\r\n case android.R.id.home:\r\n // app icon in action bar clicked; go home\r\n this.finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // app icon in action bar clicked; go home\n finish();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n Log.e(\"clik\", \"action bar clicked\");\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n\t public boolean onOptionsItemSelected(MenuItem item) {\n\t int id = item.getItemId();\n\t \n\t\t\tif (id == android.R.id.home) {\n\t\t\t\t// Respond to the action bar's Up/Home button\n\t\t\t\t// NavUtils.navigateUpFromSameTask(this);\n\t\t\t\tonBackPressed();\n\t\t\t\treturn true;\n\t\t\t}\n\t \n\t \n\t return super.onOptionsItemSelected(item);\n\t }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n // Respond to the action bar's Up/Home button\r\n case android.R.id.home:\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle presses on the action bar items\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n case R.id.action_clear:\n return true;\n case R.id.action_done:\n\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onActionHomePressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId())\n {\n case android.R.id.home :\n super.onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId ()) {\n case android.R.id.home:\n onBackPressed ();\n return true;\n\n default:\n break;\n }\n return super.onOptionsItemSelected ( item );\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t switch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\t// app icon in action bar clicked; go home \n\t\t\tIntent intent = new Intent(this, Kelutral.class); \n\t\t\tintent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); \n\t\t\tstartActivity(intent); \n\t\t\treturn true;\t\t\n\t case R.id.Search:\n\t \treturn onSearchRequested();\n\t\tcase R.id.AppInfo:\n\t\t\t// Place holder menu item\n\t\t\tIntent newIntent = new Intent(Intent.ACTION_VIEW,\n\t\t\t\t\tUri.parse(\"http://forum.learnnavi.org/mobile-apps/\"));\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\n\t\tcase R.id.Preferences:\n\t\t\tnewIntent = new Intent(getBaseContext(), Preferences.class);\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\t\n\t }\n\t return false;\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n onBackPressed();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // Intent homeIntent = new Intent(this, MainActivity.class);\n // homeIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // startActivity(homeIntent);\n finish();\n return true;\n default:\n return (super.onOptionsItemSelected(item));\n }\n\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // setResult and close the activity when Action Bar Up Button clicked.\n if (item.getItemId() == android.R.id.home) {\n setResult(RESULT_CANCELED);\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // This ID represents the Home or Up button. In the case of this\n // activity, the Up button is shown. Use NavUtils to allow users\n // to navigate up one level in the application structure. For\n // more details, see the Navigation pattern on Android Design:\n //\n // http://developer.android.com/design/patterns/navigation.html#up-vs-back\n //\n \tgetActionBar().setDisplayHomeAsUpEnabled(false);\n \tgetFragmentManager().popBackStack();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if(id == android.R.id.home){\n onBackPressed();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n\n }\n\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@RequiresApi(api = Build.VERSION_CODES.M)\n @Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif(item.getItemId()==android.R.id.home)\r\n\t\t{\r\n\t\t\tgetActivity().onBackPressed();\r\n\t\t}\r\n\t\treturn super.onOptionsItemSelected(item);\r\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if(item.getItemId()==android.R.id.home){\n super.onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n return false;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n //Back arrow\n case android.R.id.home:\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // android.R.id.home是Android内置home按钮的id\n finish();\n break;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n this.onBackPressed();\n return false;\n }\n return false;\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n int id = item.getItemId();\n\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n\r\n case android.R.id.home:\r\n /*Intent i= new Intent(getApplication(), MainActivity.class);\r\n i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n startActivity(i);*/\r\n onBackPressed();\r\n finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case android.R.id.home:\n this.finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Pass the event to ActionBarDrawerToggle, if it returns\n // true, then it has handled the app icon touch event\n if (mDrawerToggle.onOptionsItemSelected(item)) {\n return true;\n }\n\n // Handle your other action bar items...\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n NavUtils.navigateUpFromSameTask(getActivity());\n return true;\n case R.id.action_settings:\n Intent i = new Intent(getActivity(), SettingsActivity.class);\n startActivity(i);\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n //Fixes the Up Button\n if(id == android.R.id.home) {\n BuildRoute.this.finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()){\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return true;\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if (id == android.R.id.home) {\n NavUtils.navigateUpFromSameTask(this);\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n break;\r\n }\r\n return true;\r\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif (item.getItemId() == android.R.id.home) {\n\t\t\tfinish();\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n onBackPressed();\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if ( id == android.R.id.home ) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.home) {\r\n NavUtils.navigateUpFromSameTask(this);\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_about) {\r\n AboutDialog();\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_exit) {\r\n finish();\r\n return true;\r\n }\r\n\r\n\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n//noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n// finish the activity\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item)\n {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if( id == android.R.id.home ) // Back button of the actionbar\n {\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n\t\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\t\tswitch (item.getItemId()) {\r\n\t\t\tcase android.R.id.home:\r\n\t\t\t\tfinish();\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\treturn super.onOptionsItemSelected(item);\r\n\t\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n return true;\n }\n return false;\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if(id == android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n if (item.getItemId() == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\r\n\t\tcase android.R.id.home:\r\n\t\t\tsetResult(RESULT_OK, getIntent());\r\n\t\t\tfinish();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n\n case android.R.id.home:\n this.finish();\n return true;\n }\n return true;\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tint id = item.getItemId();\n\t\tif (id == android.R.id.home) {\n\t\t\tfinish();\n\t\t\treturn true;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if (id == android.R.id.home) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n //NavUtils.navigateUpFromSameTask(this);\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // todo: goto back activity from here\n finish();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n // Handle item selection\r\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n return true;\r\n\r\n case me.cchiang.lookforthings.R.id.action_sample:\r\n// Snackbar.make(parent_view, item.getTitle() + \" Clicked \", Snackbar.LENGTH_SHORT).show();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tcase R.id.scan_menu:\n\t\t\tonScan();\n\t\t\tbreak;\n\t\tcase R.id.opt_about:\n\t\t\t//onAbout();\n\t\t\tbreak;\n\t\tcase R.id.opt_exit:\n\t\t\tfinish();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t\treturn true;\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n super.onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(@NonNull MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n finish();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if(id==android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\r\n\t switch (item.getItemId()) {\r\n\t \t// back to previous page\r\n\t case android.R.id.home:\r\n\t finish();\r\n\t return true;\r\n\t }\r\n\t return super.onOptionsItemSelected(item);\r\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId())\n {\n case android.R.id.home:\n this.finish();\n return (true);\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case R.id.home:{\n NavUtils.navigateUpFromSameTask(this);\n return true;\n }\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n switch(item.getItemId())\n {\n case android.R.id.home:\n super.onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\treturn true;\n\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n\r\n int id = item.getItemId();\r\n if(id==android.R.id.home){\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }"
] | [
"0.79041183",
"0.7805934",
"0.77659106",
"0.7727251",
"0.7631684",
"0.7621701",
"0.75839096",
"0.75300384",
"0.74873656",
"0.7458051",
"0.7458051",
"0.7438486",
"0.742157",
"0.7403794",
"0.7391802",
"0.73870087",
"0.7379108",
"0.7370295",
"0.7362194",
"0.7355759",
"0.73454577",
"0.734109",
"0.73295504",
"0.7327726",
"0.73259085",
"0.73188347",
"0.731648",
"0.73134047",
"0.7303978",
"0.7303978",
"0.7301588",
"0.7298084",
"0.72932935",
"0.7286338",
"0.7283324",
"0.72808945",
"0.72785115",
"0.72597474",
"0.72597474",
"0.72597474",
"0.725962",
"0.7259136",
"0.7249966",
"0.7224023",
"0.721937",
"0.7216621",
"0.72045326",
"0.7200649",
"0.71991026",
"0.71923256",
"0.71851367",
"0.7176769",
"0.7168457",
"0.71675026",
"0.7153402",
"0.71533287",
"0.71352696",
"0.71350807",
"0.71350807",
"0.7129153",
"0.7128639",
"0.7124181",
"0.7123387",
"0.7122983",
"0.71220255",
"0.711715",
"0.711715",
"0.711715",
"0.711715",
"0.7117043",
"0.71169263",
"0.7116624",
"0.71149373",
"0.71123946",
"0.7109806",
"0.7108778",
"0.710536",
"0.7098968",
"0.70981944",
"0.7095771",
"0.7093572",
"0.7093572",
"0.70862055",
"0.7082207",
"0.70808214",
"0.7080366",
"0.7073644",
"0.7068183",
"0.706161",
"0.7060019",
"0.70598614",
"0.7051272",
"0.70374316",
"0.70374316",
"0.7035865",
"0.70352185",
"0.70352185",
"0.7031749",
"0.703084",
"0.7029517",
"0.7018633"
] | 0.0 | -1 |
Handle navigation view item clicks here. | @SuppressWarnings("StatementWithEmptyBody")
@Override
public boolean onNavigationItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.nav_bank) {
Intent intent = new Intent(ShopActivity.this, MainActivity.class);
startActivity(intent);
SharedPreferences coins_buffer = getSharedPreferences("cbuffer", 0);
SharedPreferences.Editor coins_buffer_editor = coins_buffer.edit();
coins_buffer_editor.putLong("dollars", dollars);
coins_buffer_editor.commit();
ShopActivity.this.finish();
} else if (id == R.id.nav_change) {
Intent intent = new Intent(ShopActivity.this, ChangeActivity.class);
startActivity(intent);
SharedPreferences coins_buffer = getSharedPreferences("cbuffer", 0);
SharedPreferences.Editor coins_buffer_editor = coins_buffer.edit();
coins_buffer_editor.putLong("dollars", dollars);
coins_buffer_editor.commit();
ShopActivity.this.finish();
} else if (id == R.id.nav_payment) {
Intent intent = new Intent(ShopActivity.this, PaymentActivity.class);
startActivity(intent);
SharedPreferences coins_buffer = getSharedPreferences("cbuffer", 0);
SharedPreferences.Editor coins_buffer_editor = coins_buffer.edit();
coins_buffer_editor.putLong("dollars", dollars);
coins_buffer_editor.commit();
ShopActivity.this.finish();
} else if (id == R.id.nav_settings) {
Intent intent = new Intent(ShopActivity.this, SettingActivity.class);
startActivity(intent);
SharedPreferences coins_buffer = getSharedPreferences("cbuffer", 0);
SharedPreferences.Editor coins_buffer_editor = coins_buffer.edit();
coins_buffer_editor.putLong("dollars", dollars);
coins_buffer_editor.commit();
ShopActivity.this.finish();
}
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void onNavigationItemClicked(Element element);",
"@Override\n public void onClick(View view) { listener.onItemClick(view, getPosition()); }",
"void onDialogNavigationItemClicked(Element element);",
"@Override\n public void onClick(View view) {\n itemInterface.OnItemClickedListener(tracks, getAdapterPosition());\n }",
"@Override\n public void onClickItem(MeowBottomNavigation.Model item) {\n }",
"@Override\n public void onClickItem(MeowBottomNavigation.Model item) {\n }",
"@Override\n public void onClick(View view) {\n listener.menuButtonClicked(view.getId());\n }",
"@Override\r\n\tpublic boolean onNavigationItemSelected(int itemPosition, long itemId) {\n\t\tLog.d(\"SomeTag\", \"Get click event at position: \" + itemPosition);\r\n\t\tswitch (itemPosition) {\r\n\t\tcase 1:\r\n\t\t\tIntent i = new Intent();\r\n\t\t\ti.setClass(getApplicationContext(), MainActivity.class);\r\n\t\t\tstartActivity(i);\r\n\t\t\t//return true;\r\n\t\t\tbreak;\r\n\t\tcase 2 :\r\n\t\t\tIntent intent = new Intent(this,WhiteListActivity.class);\r\n\t\t\tstartActivity(intent);\r\n\t\t\t//return true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n String name = navDrawerItems.get(position).getListItemName();\n // call a helper method to perform a corresponding action\n performActionOnNavDrawerItem(name);\n }",
"@Override\n\tpublic void rightNavClick() {\n\t\t\n\t}",
"@Override\n public void OnItemClick(int position) {\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif (itemClicked != null)\n\t\t\t\t\titemClicked.OnItemClicked((BusinessType)item.getTag(), item);\n\t\t\t}",
"@Override\n public void onClick(View view) {\n clickListener.onItemClicked(getBindingAdapterPosition());\n }",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long id) {\n\t\t\t\thandleClick(position);\n\t\t\t}",
"@Override\n public void onItemClicked(int itemPosition, Object dataObject) {\n }",
"@Override\n public void onItemClick(int pos) {\n }",
"@Override\n public void onClick(View v) {\n if (listener != null)\n listener.onItemClick(itemView, getPosition());\n }",
"private void handleNavClick(View view) {\n final String label = ((TextView) view).getText().toString();\n if (\"Logout\".equals(label)) {\n logout();\n }\n if (\"Profile\".equals(label)) {\n final Intent intent = new Intent(this, ViewProfileActivity.class);\n startActivity(intent);\n }\n if (\"Search\".equals(label)){\n final Intent intent = new Intent(this, SearchActivity.class);\n startActivity(intent);\n }\n if (\"Home\".equals(label)) {\n final Intent intent = new Intent(this, HomeActivity.class);\n startActivity(intent);\n }\n }",
"void onMenuItemClicked();",
"@Override\n public void onClick(View view) {\n\n switch (view.getId()) {\n case R.id.tvSomeText:\n listener.sendDataToActivity(\"MainActivity: TextView clicked\");\n break;\n\n case -1:\n listener.sendDataToActivity(\"MainActivity: ItemView clicked\");\n break;\n }\n }",
"@Override\n\t\t\t\t\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t\t\t\t\tMainActivity sct = (MainActivity) act;\n\t\t\t\t\t\t\t\t\tsct.onItemClick(posit2, 11);\n\t\t\t\t\t\t\t\t}",
"@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t}",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t\t\t}",
"@Override\n public void onClick(View v) {\n listener.onItemClick(v, position);\n }",
"@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\n\t}",
"@Override\n public void onItemClick(View view, String data) {\n }",
"abstract public void onSingleItemClick(View view);",
"@Override\n public void onClick(View v) {\n this.itemClickListener.onItemClick(v, getLayoutPosition());\n }",
"@Override\n public void itemClick(int pos) {\n }",
"@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {\n TextView textView = (TextView)view;\n switch(textView.getText().toString()){\n case \"NavBar\":\n Intent nav = new Intent(this, NavDrawerActivity.class);\n startActivity(nav);\n break;\n }\n\n //Toast.makeText(MainActivity.this,\"Go to \" + textView.getText().toString() + \" page.\",Toast.LENGTH_LONG).show();\n }",
"@Override\r\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\r\n\t}",
"@Override\n\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\tlong arg3) {\n\t\t\t\n\t\t}",
"@Override\n public void onItemClick(Nson parent, View view, int position) {\n }",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\t\t\t\t\tlong arg3) {\n\t\t\t}",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t\t\n\t\t\t}",
"@Override\n public void onClick(View view) {\n int position = getAdapterPosition();\n\n // Check if listener!=null bcz it is not guarantee that we'll call setOnItemClickListener\n // RecyclerView.NO_POSITION - Constant for -1, so that we don't click item at Invalid position (safety measure)\n if (listener != null && position != RecyclerView.NO_POSITION) {\n //listener.onItemClick(notes.get(position)); - used in RecyclerView.Adapter\n listener.onItemClick(getItem(position)); // getting data from superclass\n }\n }",
"@Override\n public void onClick(View v) {\n itemClickListener.itemClicked(movieId, v);\n }",
"@Override\n\t\tpublic void onClick(View view) {\n\t\t\tif (iOnItemClickListener != null) {\n\t\t\t\tiOnItemClickListener.onItemClick(view, null, getAdapterPosition());\n\t\t\t}\n\t\t}",
"@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t}",
"@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t}",
"public void onItemClick(View view, int position);",
"@Override\n public void onClick(View v) {\n if (mListener != null){\n mListener.onItemClick(itemView, getLayoutPosition());\n }\n }",
"@Override\n public void onItemClick(int position) {\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\titemClickListener.Callback(itemInfo);\n\t\n\t\t\t}",
"@Override\n public void onItemClick(View view, int position) {\n }",
"@Override\n public void onItemClick(View view, int position) {\n }",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t}",
"@Override\n public void onItemOfListClicked(Object o) {\n UserProfileFragmentDirections.ActionUserProfileFragmentToEventProfileFragment action = UserProfileFragmentDirections.actionUserProfileFragmentToEventProfileFragment((MyEvent) o);\n navController.navigate(action);\n }",
"@Override\n public void onClick(View view) {\n if(mFrom.equals(NetConstants.BOOKMARK_IN_TAB)) {\n IntentUtil.openDetailActivity(holder.itemView.getContext(), NetConstants.G_BOOKMARK_DEFAULT,\n bean.getArticleUrl(), position, bean.getArticleId());\n }\n else {\n IntentUtil.openDetailActivity(holder.itemView.getContext(), mFrom,\n bean.getArticleUrl(), position, bean.getArticleId());\n }\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_ds_note) {\n // Handle the camera action\n } else if (id == R.id.nav_ds_todo) {\n\n } else if (id == R.id.nav_ql_the) {\n\n } else if (id == R.id.nav_tuychinh) {\n Intent intent = new Intent(this, CustomActivity.class);\n startActivity(intent);\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n\t\t\t\t\t\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\t\t\t\t\t\tint position, long id) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}",
"@Override\n public void onItemClick(View view, ListItem obj, int position) {\n }",
"@Override\n\tpublic void onItemClick(Object o, int position) {\n\n\t}",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\n\t\t\t}",
"void onLinkClicked(@Nullable ContentId itemId);",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case R.id.home:\n Intent homeIntent = new Intent(this, MainActivity.class);\n startActivity(homeIntent);\n break;\n case R.id.send_email:\n Intent mailIntent = new Intent(this, ContactActivity.class);\n startActivity(mailIntent);\n break;\n case R.id.send_failure_ticket:\n Intent ticketIntent = new Intent(this, TicketActivity.class);\n startActivity(ticketIntent);\n break;\n case R.id.position:\n Intent positionIntent = new Intent(this, LocationActivity.class);\n startActivity(positionIntent);\n break;\n case R.id.author:\n UrlRedirect urlRed = new UrlRedirect(this.getApplicationContext(),getString(R.string.linkedinDeveloper));\n urlRed.redirect();\n break;\n default:\n break;\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout_main_activity);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"ConstantConditions\")\n public void onItemClicked(@NonNull Item item) {\n getView().openDetail(item);\n }",
"void onItemClick(View view, int position);",
"@Override\n public void onClick(View v) {\n startNavigation();\n }",
"void onItemClick(int position);",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(@NonNull MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_logs) {\n startActivity(new Intent(this, LogView.class));\n } else if (id == R.id.nav_signOut) {\n signOut();\n }\n\n DrawerLayout drawer = findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n public void onClick(View v) {\n if(listener!=null & getLayoutPosition()!=0)\n listener.onItemClick(itemView, getLayoutPosition());\n }",
"@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position,\n\t\t\tlong id) {\n\t\tpresenter.onItemClicked(position);\n\t}",
"@Override\n public void onClick(View view) {\n listener.onMenuButtonSelected(view.getId());\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n }",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t\tHashMap<String, Object> item = (HashMap<String, Object>) arg0\n\t\t\t\t\t\t.getAdapter().getItem(arg2);\n\n\t\t\t\tIntent intent = new Intent(ViewActivity.this,\n\t\t\t\t\t\tContentActivity.class);\n\t\t\t\tBundle bundle = new Bundle();\n\t\t\t\tbundle.putString(\"_id\", item.get(\"_id\").toString());\n\t\t\t\tbundle.putString(\"_CityEventID\", item.get(\"_CityEventID\")\n\t\t\t\t\t\t.toString());\n\t\t\t\tbundle.putString(\"_type\", String.valueOf(_type));\n\t\t\t\tintent.putExtras(bundle);\n\t\t\t\tstartActivity(intent);\n\t\t\t}",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onClick(View view) {\n Navigation.findNavController(view).navigate(R.id.addEventFragment);\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Log.w(TAG , \"POSITION : \" + position);\n\n itemClick(position);\n }",
"void clickItem(int uid);",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(@NonNull MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_categories) {\n Intent intent = new Intent(getApplicationContext(), CategoryActivity.class);\n startActivity(intent, compat.toBundle());\n newsHere.setSourceActivity(\"search\");\n newsHere.setTargetActivity(\"category\");\n\n } else if (id == R.id.nav_top_headlines) {\n newsHere.setSourceActivity(\"search\");\n newsHere.setTargetActivity(\"home\");\n Intent intent = new Intent(getApplicationContext(), HomeActivity.class);\n startActivity(intent, compat.toBundle());\n } else if (id == R.id.nav_search) {\n // Do nothing\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n public void onItemClick(View view, int position) {\n\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_orders) {\n\n Intent orderStatusIntent = new Intent(Home.this , OrderStatus.class);\n startActivity(orderStatusIntent);\n\n } else if (id == R.id.nav_banner) {\n\n Intent bannerIntent = new Intent(Home.this , BannerActivity.class);\n startActivity(bannerIntent);\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n }",
"public void onItemClick(View view, int position) {\n\n }",
"@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n\t}",
"@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n\t}",
"@Override\r\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\r\n\t\t\t\t\tlong arg3) {\n\r\n\t\t\t}",
"void onClick(View item, View widget, int position, int which);",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n\n\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n Intent intent;\n switch(item.getItemId()){\n case R.id.nav_home:\n finish();\n intent = new Intent(this, NavigationActivity.class);\n startActivity(intent);\n return true;\n case R.id.nav_calendar:\n finish();\n intent = new Intent(this, EventHome.class);\n startActivity(intent);\n return true;\n case R.id.nav_discussion:\n return true;\n case R.id.nav_settings:\n intent = new Intent(this, SettingsActivity.class);\n startActivity(intent);\n return true;\n case R.id.nav_app_blocker:\n intent = new Intent(this, AppBlockingActivity.class);\n startActivity(intent);\n return true;\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n public boolean onNavigationItemSelected(@NonNull MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n\n case R.id.nav_home:\n break;\n\n case R.id.nav_favourites:\n\n if (User.getInstance().getUser() == null) {\n Intent intent = new Intent(getApplicationContext(), LoginActivity.class);\n startActivity(intent);\n }\n\n Intent intent = new Intent(getApplicationContext(), PlaceItemListActivity.class);\n startActivity(intent);\n\n break;\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tonRgtRgtMenuClick(v);\n\t\t\t}",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n Toast.makeText(this, \"gallery is clicked!\", Toast.LENGTH_LONG).show();\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"public void menuClicked(MenuItem menuItemSelected);",
"@Override\n public void onItemClick(int position) {\n }",
"@Override\n public void onItemClick(int position) {\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_my_account) {\n startActivity(new Intent(this, MyAccountActivity.class));\n } else if (id == R.id.nav_message_inbox) {\n startActivity(new Intent(this, MessageInboxActivity.class));\n } else if (id == R.id.nav_view_offers) {\n //Do Nothing\n } else if (id == R.id.nav_create_listing) {\n startActivity(new Intent(this, CreateListingActivity.class));\n } else if (id == R.id.nav_view_listings) {\n startActivity(new Intent(this, ViewListingsActivity.class));\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\r\n\t\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\r\n\t\t\t\t\t\tint position, long id) {\n\t\t\t\t}"
] | [
"0.7882029",
"0.7235578",
"0.6987005",
"0.69458413",
"0.6917864",
"0.6917864",
"0.6883472",
"0.6875181",
"0.68681556",
"0.6766498",
"0.67418456",
"0.67207",
"0.6716157",
"0.6713947",
"0.6698189",
"0.66980195",
"0.66793925",
"0.66624063",
"0.66595167",
"0.6646381",
"0.6641224",
"0.66243863",
"0.6624042",
"0.66207093",
"0.6602551",
"0.6602231",
"0.6599443",
"0.65987265",
"0.65935796",
"0.6585869",
"0.658491",
"0.65811735",
"0.65765643",
"0.65751576",
"0.65694076",
"0.6561757",
"0.65582377",
"0.65581614",
"0.6552827",
"0.6552827",
"0.6549224",
"0.65389794",
"0.65345114",
"0.65337104",
"0.652419",
"0.652419",
"0.6522521",
"0.652146",
"0.6521068",
"0.6519354",
"0.65165275",
"0.65159816",
"0.65028816",
"0.6498054",
"0.6498054",
"0.64969087",
"0.64937705",
"0.6488544",
"0.64867324",
"0.64866185",
"0.64865905",
"0.6484047",
"0.6481108",
"0.6474686",
"0.64628965",
"0.64551884",
"0.6446893",
"0.64436555",
"0.64436555",
"0.64436555",
"0.64436555",
"0.64436555",
"0.64386237",
"0.643595",
"0.64356565",
"0.64329195",
"0.6432562",
"0.6429554",
"0.64255124",
"0.64255124",
"0.64121485",
"0.64102405",
"0.64095175",
"0.64095175",
"0.64094734",
"0.640727",
"0.64060104",
"0.640229",
"0.6397359",
"0.6392996",
"0.63921124",
"0.63899696",
"0.63885015",
"0.63885015",
"0.63873845",
"0.6368818",
"0.6368818",
"0.63643163",
"0.63643163",
"0.63643163",
"0.6358884"
] | 0.0 | -1 |
Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: businessservices | public ObjectFactory() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"BusinessEntityFactory getBusinessEntityFactory();",
"SchemaBuilder withFactory(String factoryClassName);",
"private ORMServiceFactory() { }",
"private ObjectFactory createObjectFactory(String objectFactoryNamespace)\r\n throws CockpitConfigurationException {\r\n try {\r\n return new ObjectFactory(new ConfigManagerSpecificationFactory(objectFactoryNamespace));\r\n } catch (IllegalReferenceException e) {\r\n throw new CockpitConfigurationException(\r\n \"IllegalReferenceException occurs while creating ObjectFactory instance using namespace \"\r\n + objectFactoryNamespace, e);\r\n } catch (SpecificationConfigurationException e) {\r\n throw new CockpitConfigurationException(\r\n \"SpecificationConfigurationException occurs while creating ObjectFactory instance using namespace \"\r\n + objectFactoryNamespace, e);\r\n }\r\n }",
"@Override\n protected ObjectFactory initObjectFactory() {\n try {\n BeanManager bm = (BeanManager) new InitialContext().lookup(\"java:comp/BeanManager\");\n Set<Bean<?>> beans = bm.getBeans(CdiObjectFactory.class);\n Bean<CdiObjectFactory> beanType = (Bean<CdiObjectFactory>) beans.iterator().next();\n CreationalContext<CdiObjectFactory> ctx = bm.createCreationalContext(beanType);\n CdiObjectFactory objFactory = (CdiObjectFactory) bm.getReference(beanType, CdiObjectFactory.class, ctx);\n objFactory.init(this);\n return objFactory;\n } catch (Exception ex) {\n throw new RuntimeException(ex);\n }\n }",
"public interface BSQL2Java2Factory extends EFactory\n{\n /**\n * The singleton instance of the factory.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @generated\n */\n BSQL2Java2Factory eINSTANCE = bsql2java.bSQL2Java2.impl.BSQL2Java2FactoryImpl.init();\n\n /**\n * Returns a new object of class '<em>BSQL2 Java2</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>BSQL2 Java2</em>'.\n * @generated\n */\n BSQL2Java2 createBSQL2Java2();\n\n /**\n * Returns a new object of class '<em>BSQL Machine</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>BSQL Machine</em>'.\n * @generated\n */\n BSQLMachine createBSQLMachine();\n\n /**\n * Returns a new object of class '<em>BOperation</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>BOperation</em>'.\n * @generated\n */\n BOperation createBOperation();\n\n /**\n * Returns a new object of class '<em>BTable</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>BTable</em>'.\n * @generated\n */\n BTable createBTable();\n\n /**\n * Returns a new object of class '<em>Attribute</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Attribute</em>'.\n * @generated\n */\n Attribute createAttribute();\n\n /**\n * Returns a new object of class '<em>BType</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>BType</em>'.\n * @generated\n */\n BType createBType();\n\n /**\n * Returns a new object of class '<em>Bool Operation</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Bool Operation</em>'.\n * @generated\n */\n BoolOperation createBoolOperation();\n\n /**\n * Returns a new object of class '<em>BSub True</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>BSub True</em>'.\n * @generated\n */\n BSubTrue createBSubTrue();\n\n /**\n * Returns a new object of class '<em>BSub False</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>BSub False</em>'.\n * @generated\n */\n BSubFalse createBSubFalse();\n\n /**\n * Returns a new object of class '<em>String Operation</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>String Operation</em>'.\n * @generated\n */\n StringOperation createStringOperation();\n\n /**\n * Returns a new object of class '<em>BAny Block</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>BAny Block</em>'.\n * @generated\n */\n BAnyBlock createBAnyBlock();\n\n /**\n * Returns a new object of class '<em>Void Operation</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Void Operation</em>'.\n * @generated\n */\n VoidOperation createVoidOperation();\n\n /**\n * Returns a new object of class '<em>BPredicate</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>BPredicate</em>'.\n * @generated\n */\n BPredicate createBPredicate();\n\n /**\n * Returns a new object of class '<em>SQL Call</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>SQL Call</em>'.\n * @generated\n */\n SQLCall createSQLCall();\n\n /**\n * Returns a new object of class '<em>Table Instance</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Table Instance</em>'.\n * @generated\n */\n TableInstance createTableInstance();\n\n /**\n * Returns a new object of class '<em>TI Assignment</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>TI Assignment</em>'.\n * @generated\n */\n TIAssignment createTIAssignment();\n\n /**\n * Returns a new object of class '<em>BParameter Typing</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>BParameter Typing</em>'.\n * @generated\n */\n BParameterTyping createBParameterTyping();\n\n /**\n * Returns a new object of class '<em>BSubstitution</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>BSubstitution</em>'.\n * @generated\n */\n BSubstitution createBSubstitution();\n\n /**\n * Returns a new object of class '<em>BUnion</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>BUnion</em>'.\n * @generated\n */\n BUnion createBUnion();\n\n /**\n * Returns a new object of class '<em>BElement Structure</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>BElement Structure</em>'.\n * @generated\n */\n BElementStructure createBElementStructure();\n\n /**\n * Returns a new object of class '<em>BElement</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>BElement</em>'.\n * @generated\n */\n BElement createBElement();\n\n /**\n * Returns a new object of class '<em>BSet</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>BSet</em>'.\n * @generated\n */\n BSet createBSet();\n\n /**\n * Returns the package supported by this factory.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return the package supported by this factory.\n * @generated\n */\n BSQL2Java2Package getBSQL2Java2Package();\n\n}",
"public OBStoreFactory getFactory();",
"public interface GraphQLFactory extends EFactory\n{\n /**\n * The singleton instance of the factory.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @generated\n */\n GraphQLFactory eINSTANCE = io.github.katmatt.graphql.graphQL.impl.GraphQLFactoryImpl.init();\n\n /**\n * Returns a new object of class '<em>Type System Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Type System Definition</em>'.\n * @generated\n */\n TypeSystemDefinition createTypeSystemDefinition();\n\n /**\n * Returns a new object of class '<em>Schema Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Schema Definition</em>'.\n * @generated\n */\n SchemaDefinition createSchemaDefinition();\n\n /**\n * Returns a new object of class '<em>Root Operation Type Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Root Operation Type Definition</em>'.\n * @generated\n */\n RootOperationTypeDefinition createRootOperationTypeDefinition();\n\n /**\n * Returns a new object of class '<em>Type Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Type Definition</em>'.\n * @generated\n */\n TypeDefinition createTypeDefinition();\n\n /**\n * Returns a new object of class '<em>Scalar Type Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Scalar Type Definition</em>'.\n * @generated\n */\n ScalarTypeDefinition createScalarTypeDefinition();\n\n /**\n * Returns a new object of class '<em>Object Type Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Object Type Definition</em>'.\n * @generated\n */\n ObjectTypeDefinition createObjectTypeDefinition();\n\n /**\n * Returns a new object of class '<em>Interface Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Interface Definition</em>'.\n * @generated\n */\n InterfaceDefinition createInterfaceDefinition();\n\n /**\n * Returns a new object of class '<em>Field Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Field Definition</em>'.\n * @generated\n */\n FieldDefinition createFieldDefinition();\n\n /**\n * Returns a new object of class '<em>Union Type Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Union Type Definition</em>'.\n * @generated\n */\n UnionTypeDefinition createUnionTypeDefinition();\n\n /**\n * Returns a new object of class '<em>Enum Type Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Enum Type Definition</em>'.\n * @generated\n */\n EnumTypeDefinition createEnumTypeDefinition();\n\n /**\n * Returns a new object of class '<em>Enum Value Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Enum Value Definition</em>'.\n * @generated\n */\n EnumValueDefinition createEnumValueDefinition();\n\n /**\n * Returns a new object of class '<em>Input Object Type Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Input Object Type Definition</em>'.\n * @generated\n */\n InputObjectTypeDefinition createInputObjectTypeDefinition();\n\n /**\n * Returns a new object of class '<em>Input Value Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Input Value Definition</em>'.\n * @generated\n */\n InputValueDefinition createInputValueDefinition();\n\n /**\n * Returns a new object of class '<em>Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Type</em>'.\n * @generated\n */\n Type createType();\n\n /**\n * Returns a new object of class '<em>Named Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Named Type</em>'.\n * @generated\n */\n NamedType createNamedType();\n\n /**\n * Returns a new object of class '<em>List Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>List Type</em>'.\n * @generated\n */\n ListType createListType();\n\n /**\n * Returns a new object of class '<em>Int Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Int Value</em>'.\n * @generated\n */\n IntValue createIntValue();\n\n /**\n * Returns a new object of class '<em>Float Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Float Value</em>'.\n * @generated\n */\n FloatValue createFloatValue();\n\n /**\n * Returns a new object of class '<em>Null Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Null Value</em>'.\n * @generated\n */\n NullValue createNullValue();\n\n /**\n * Returns a new object of class '<em>String Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>String Value</em>'.\n * @generated\n */\n StringValue createStringValue();\n\n /**\n * Returns a new object of class '<em>Boolean Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Boolean Value</em>'.\n * @generated\n */\n BooleanValue createBooleanValue();\n\n /**\n * Returns a new object of class '<em>Enum Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Enum Value</em>'.\n * @generated\n */\n EnumValue createEnumValue();\n\n /**\n * Returns a new object of class '<em>Object Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Object Value</em>'.\n * @generated\n */\n ObjectValue createObjectValue();\n\n /**\n * Returns a new object of class '<em>Object Field</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Object Field</em>'.\n * @generated\n */\n ObjectField createObjectField();\n\n /**\n * Returns a new object of class '<em>Const Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Const Value</em>'.\n * @generated\n */\n ConstValue createConstValue();\n\n /**\n * Returns a new object of class '<em>List Value</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>List Value</em>'.\n * @generated\n */\n ListValue createListValue();\n\n /**\n * Returns a new object of class '<em>Directive Definition</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Directive Definition</em>'.\n * @generated\n */\n DirectiveDefinition createDirectiveDefinition();\n\n /**\n * Returns a new object of class '<em>Directive</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Directive</em>'.\n * @generated\n */\n Directive createDirective();\n\n /**\n * Returns a new object of class '<em>Argument</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Argument</em>'.\n * @generated\n */\n Argument createArgument();\n\n /**\n * Returns the package supported by this factory.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return the package supported by this factory.\n * @generated\n */\n GraphQLPackage getGraphQLPackage();\n\n}",
"public ObjectFactory() {}",
"public ObjectFactory() {}",
"public ObjectFactory() {}",
"ObjectFactoryGenerator objectFactoryGenerator();",
"public static Factory factory() {\n return ext_dbf::new;\n }",
"private EntityFactory() {}",
"public interface ServicesFactory extends EFactory {\n\t/**\n\t * The singleton instance of the factory.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t */\n\tServicesFactory eINSTANCE = org.cylio.project.domain.editor.services.impl.ServicesFactoryImpl.init();\n\n\t/**\n\t * Returns a new object of class '<em>Provider</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Provider</em>'.\n\t * @generated\n\t */\n\tProvider createProvider();\n\n\t/**\n\t * Returns a new object of class '<em>Feature</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Feature</em>'.\n\t * @generated\n\t */\n\tFeature createFeature();\n\n\t/**\n\t * Returns a new object of class '<em>Stub</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Stub</em>'.\n\t * @generated\n\t */\n\tStub createStub();\n\n\t/**\n\t * Returns the package supported by this factory.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return the package supported by this factory.\n\t * @generated\n\t */\n\tServicesPackage getServicesPackage();\n\n}",
"public interface RelationalFactory extends EFactory {\n\t/**\n\t * The singleton instance of the factory.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t */\n\tRelationalFactory eINSTANCE = fr.obeo.training.relational.impl.RelationalFactoryImpl.init();\n\n\t/**\n\t * Returns a new object of class '<em>Data Base</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Data Base</em>'.\n\t * @generated\n\t */\n\tDataBase createDataBase();\n\n\t/**\n\t * Returns a new object of class '<em>Schema</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Schema</em>'.\n\t * @generated\n\t */\n\tSchema createSchema();\n\n\t/**\n\t * Returns a new object of class '<em>Table</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Table</em>'.\n\t * @generated\n\t */\n\tTable createTable();\n\n\t/**\n\t * Returns a new object of class '<em>Primary Key</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Primary Key</em>'.\n\t * @generated\n\t */\n\tPrimaryKey createPrimaryKey();\n\n\t/**\n\t * Returns a new object of class '<em>Foreign Key</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Foreign Key</em>'.\n\t * @generated\n\t */\n\tForeignKey createForeignKey();\n\n\t/**\n\t * Returns a new object of class '<em>Column</em>'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return a new object of class '<em>Column</em>'.\n\t * @generated\n\t */\n\tColumn createColumn();\n\n\t/**\n\t * Returns the package supported by this factory.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return the package supported by this factory.\n\t * @generated\n\t */\n\tRelationalPackage getRelationalPackage();\n\n}",
"public ObjectifyFactory factory() {\n return ofy().factory();\n }",
"protected ContaCapitalCadastroDaoFactory() {\n\t\t\n\t}",
"public ObjectFactory() {\n\t}",
"public ObjectFactory() {\r\n\t}",
"ObjectTypeDefinition createObjectTypeDefinition();",
"SchemaComponentType createSchemaComponentType();"
] | [
"0.69350386",
"0.6758255",
"0.6347879",
"0.6330494",
"0.6263585",
"0.6224187",
"0.62121385",
"0.6197325",
"0.6174912",
"0.6174912",
"0.6174912",
"0.61664516",
"0.6094129",
"0.60627246",
"0.60601914",
"0.60205895",
"0.6014669",
"0.59960806",
"0.5966453",
"0.5955594",
"0.5942062",
"0.5926241"
] | 0.0 | -1 |
write your code here | public static void main(String[] args) throws IOException {
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter hex no. to convert in Decimal : ");
String num = input.readLine();
int dec = Integer.parseInt(num,16);
System.out.println("Hexadecimal number converted to decimal number\n" +
"Decimal number is : "+dec);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void logic(){\r\n\r\n\t}",
"public static void generateCode()\n {\n \n }",
"@Override\n\tprotected void logic() {\n\n\t}",
"private static void cajas() {\n\t\t\n\t}",
"void pramitiTechTutorials() {\n\t\n}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"public void ganar() {\n // TODO implement here\n }",
"public static void main(String[] args) {\n // write your code here - this is called comment and it always starts with double slash\n // and comlier will ignore this because of the // sign.\n // I am gonna say hello\n // JAVA IS CASE SENSITIVE LANGUAGE\n // System and system are very different things in java\n //Hello AND hello are different for java\n // System.out.println(\"Hello Batch 15!\");\n // System.out.println(\"I am still here.\");\n // System.out.println(\"I love Java.\");\n\n // Write a program to display your information.\n // When you run it, it should have this outcome.\n // I am your name here\n // I am from batch 15\n // I am from your city here\n // I love Java\n\n System.out.println(\"I am Sevim.\");\n System.out.println(\"I am from Batch 15.\");\n System.out.println(\"I'm from New Jersey.\");\n System.out.println(\"I love Java.\");\n\n\n\n }",
"CD withCode();",
"private stendhal() {\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"public void gored() {\n\t\t\n\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\r\n\tpublic void runn() {\n\t\t\r\n\t}",
"public void genCode(CodeFile code) {\n\t\t\n\t}",
"public void hello(){\n\t\t\r\n \t\r\n\t\t\r\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}",
"public void baocun() {\n\t\t\n\t}",
"public void mo38117a() {\n }",
"public void furyo ()\t{\n }",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"private void strin() {\n\n\t}",
"public void themesa()\n {\n \n \n \n \n }",
"Programming(){\n\t}",
"@Override\n\tvoid output() {\n\t\t\n\t}",
"private void yy() {\n\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"void rajib () {\n\t\t \n\t\t System.out.println(\"Rajib is IT Eng\");\n\t }",
"private void kk12() {\n\n\t}",
"public void edit() {\n\t\tSystem.out.println(\"编写java笔记\");\r\n\t}",
"public static void main(String[] args) {\n\t// write your code here\n }",
"private static void ThridUmpireReview() {\n\t\tSystem.out.println(\" Umpier Reviews the Score Board\");\n\t\t \n\t\t\n\t}",
"@Override\r\n\t\tpublic void doDomething() {\r\n\t\t\tSystem.out.println(\"I am here\");\r\n\t\t\t\r\n\t\t}",
"protected void mo6255a() {\n }",
"public void gen(CodeSeq code, ICodeEnv env) {\n\r\n\t}",
"@Override\n\tpublic void function() {\n\t\t\n\t}",
"public void working()\n {\n \n \n }",
"@Override\n\tprotected void postRun() {\n\n\t}",
"public void perder() {\n // TODO implement here\n }",
"public void smell() {\n\t\t\n\t}",
"protected void execute() {\n\t\t\n\t}",
"public void mo55254a() {\n }",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tpublic void orgasm() {\n\t\t\n\t}",
"public void cocinar(){\n\n }",
"@Override\r\n\tvoid func04() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"public void run() {\n\t\t\t\t\n\t\t\t}",
"protected void execute() {\n\n\n \n }",
"@Override\n public void execute() {\n \n \n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\r\n\tpublic void crawl_data() {\n\t\t\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"public static void main(String args[]) throws Exception\n {\n \n \n \n }",
"@Override\r\n\tpublic void code() {\n\t\tus.code();\r\n\t\tSystem.out.println(\"我会java...\");\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"protected void display() {\n\r\n\t}",
"private void sout() {\n\t\t\n\t}",
"private static void oneUserExample()\t{\n\t}",
"public void nhapdltextlh(){\n\n }",
"public void miseAJour();",
"protected void additionalProcessing() {\n\t}",
"private void sub() {\n\n\t}",
"@Override\n\tpublic void view() {\n\t\t\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void engine() {\r\n\t\t// TODO Auto-generated method stub\t\t\r\n\t}",
"@Override\r\n\tpublic void code() {\n\t\tSystem.out.println(\"我会C语言....\");\r\n\t}",
"void mo67924c();",
"@Override\n\tpublic void dosomething() {\n\t\t\n\t}",
"@Override\r\n public void run() {\n basicEditor.createEdge(); // replaced Bibianas method with Moritz Roidl, Orthodoxos Kipouridis\r\n }",
"public void mo5382o() {\n }",
"@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}",
"public void mo3376r() {\n }",
"public static void main(String[] args)\r\n {\n System.out.println(\"Mehedi Hasan Nirob\");\r\n //multiple line comment\r\n /*\r\n At first printing my phone number\r\n then print my address \r\n then print my university name\r\n */\r\n System.out.println(\"01736121659\\nJamalpur\\nDhaka International University\");\r\n \r\n }",
"void kiemTraThangHopLi() {\n }",
"public void skystonePos5() {\n }",
"public final void cpp() {\n }",
"public final void mo51373a() {\n }",
"public static void main(String[] args) {\n\t\tSystem.out.println(\"This is the main class of this project\");\r\n\t\tSystem.out.println(\"how about this\");\r\n\r\n\t\t\r\n\t\tSystem.out.println(\"new push\");\r\n\r\n\t\t//how to update this line\r\n\t\t\r\n\t\tSystem.out.println(\"hello there\");\r\n\r\n\t\tSystem.out.println(\"zen me shuoXXXXXXXXXXXKKKKkKKKKKKXXXXXXXX\");\r\n\r\n\t\tSystem.out.println(\"eventually we succeeded!\");\r\n\t\t//wa!!!\r\n\t\t\r\n\r\n\r\n\t\t//hen shu fu !\r\n\t\t\r\n\t\t//it is a good day\r\n\t\t\r\n\t\t//testing\r\n\r\n\t\t\r\n\t\tSystem.out.println(\"hope it works\");\r\n\t\t\r\n\r\n\t\t\r\n\r\n\t}",
"@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}"
] | [
"0.61019534",
"0.6054925",
"0.58806974",
"0.58270746",
"0.5796887",
"0.56999695",
"0.5690986",
"0.56556827",
"0.5648637",
"0.5640487",
"0.56354505",
"0.56032085",
"0.56016207",
"0.56006724",
"0.5589654",
"0.5583692",
"0.55785793",
"0.55733466",
"0.5560209",
"0.55325305",
"0.55133164",
"0.55123806",
"0.55114794",
"0.5500045",
"0.5489272",
"0.5482718",
"0.5482718",
"0.5477585",
"0.5477585",
"0.54645246",
"0.5461012",
"0.54548836",
"0.5442613",
"0.5430592",
"0.5423748",
"0.5419415",
"0.5407118",
"0.54048806",
"0.5399331",
"0.539896",
"0.5389593",
"0.5386248",
"0.5378453",
"0.53751254",
"0.5360644",
"0.5357343",
"0.5345515",
"0.53441405",
"0.5322276",
"0.5318302",
"0.53118485",
"0.53118485",
"0.53085434",
"0.530508",
"0.53038436",
"0.5301922",
"0.5296964",
"0.52920514",
"0.52903354",
"0.5289583",
"0.5287506",
"0.52869135",
"0.5286737",
"0.5286737",
"0.5286737",
"0.5286737",
"0.5286737",
"0.5286737",
"0.5286737",
"0.52859664",
"0.52849185",
"0.52817136",
"0.52791214",
"0.5278664",
"0.5278048",
"0.5276269",
"0.52728665",
"0.5265451",
"0.526483",
"0.526005",
"0.5259683",
"0.52577406",
"0.5257731",
"0.5257731",
"0.52560073",
"0.5255759",
"0.5255707",
"0.5250705",
"0.5246863",
"0.5243053",
"0.52429926",
"0.5242727",
"0.52396125",
"0.5239378",
"0.5232576",
"0.5224529",
"0.52240705",
"0.52210563",
"0.52203166",
"0.521787",
"0.52172214"
] | 0.0 | -1 |
4Half triangle starforward opp | public static void fourthProgram() {
for (int i = 1; i <= 4; i++) {
for (int j = 4; j > i; j--) {
System.out.print(" ");
}
for (int k = 1; k <= i; k++) {
System.out.print("*");
}
System.out.println();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Squarelotron mainDiagonalFlip(int ring);",
"public Squarelotron inverseDiagonalFlip(int ring);",
"public void triangulo() {\n fill(0);\n stroke(255);\n strokeWeight(5);\n triangle(width/2, 50, height+100, 650, 350, 650);\n //(width/2, height-100, 350, 150, 900, 150);\n }",
"public Squarelotron leftRightFlip(int ring);",
"public HalfEdge(int q) { end = q; }",
"public String tri4(int h){\n\t\tString S = \"\";\n\t\tint H = h;\n\t\tint HH = H;\n\t\tint Counter = 0;\n\t\tint UsingCounter = Counter;\n\n\t\twhile (H > 0){\n\t\t\tHH = H;\n\t\t\twhile (UsingCounter > 0){\n\t\t\t\tS = S + \" \";\n\t\t\t\tUsingCounter = UsingCounter - 1;}\n\t\t\twhile (HH > 0) {\n\t\t\t\tS = S + \"*\";\n\t\t\t\tHH = HH - 1;}\n\t\t\tCounter = Counter + 1;\n\t\t\tUsingCounter = Counter;\n\t\t\tS = S + \"\\n\";\n\t\t\tH = H - 1;}\n\n\t\treturn S; }",
"public Squarelotron upsideDownFlip(int ring);",
"public static void bottomHalf() {\n\n for(int i = 1; i <= SIZE; i++) {\n for(int j = 1; j <= i - 1; j++) {\n System.out.print(\" \");\n }\n \n\t System.out.print(\"\\\\_\");\n\t for(int j = 3*SIZE-i; j >= i; j--) {\n\t System.out.print(\"/\\\\\");\n\t }\n\t System.out.println(\"_/\");\n }\n }",
"public static Vector4 forward()\n {\n return new Vector4(0,0,1,0);\n }",
"public void triangle(){\n Shape triangle = new Shape();\n triangle.addPoint(new Point(0,0));\n triangle.addPoint(new Point(6,0));\n triangle.addPoint(new Point(3,6));\n for (Point p : triangle.getPoints()){\n System.out.println(p);\n }\n double peri = getPerimeter(triangle);\n System.out.println(\"perimeter = \"+peri);\n }",
"@Override\r\n\tpublic void CalcPeri() {\n\t\tSystem.out.println(4*side);\t\r\n\t}",
"Triangle(){\n side1 = 1.0;\n side2 = 1.0;\n side3 = 1.0;\n }",
"private void doubleTriangle(Graph graph) {\n List<Node> nodes = graph.getNodes();\n\n for (Node B : nodes) {\n\n List<Node> intoBArrows = graph.getNodesInTo(B, Endpoint.ARROW);\n List<Node> intoBCircles = graph.getNodesInTo(B, Endpoint.CIRCLE);\n\n //possible A's and C's are those with arrows into B\n List<Node> possA = new LinkedList<>(intoBArrows);\n List<Node> possC = new LinkedList<>(intoBArrows);\n\n //possible D's are those with circles into B\n for (Node D : intoBCircles) {\n for (Node A : possA) {\n for (Node C : possC) {\n if (C == A) {\n continue;\n }\n\n //skip anything not a double triangle\n if (!graph.isAdjacentTo(A, D) ||\n !graph.isAdjacentTo(C, D)) {\n continue;\n }\n\n //skip if A,D,C is a collider\n if (graph.isDefCollider(A, D, C)) {\n continue;\n }\n\n //if all of the previous tests pass, orient D*-oB as D*->B\n if (!isArrowpointAllowed(graph, D, B)) {\n continue;\n }\n\n graph.setEndpoint(D, B, Endpoint.ARROW);\n changeFlag = true;\n }\n }\n }\n }\n }",
"public Squarelotron sideFlip(String side);",
"public void isItATriangle(){\n Scanner firstSide = new Scanner(System.in);\n System.out.println(\"Please put in your first side length: \");\n int side1 = firstSide.nextInt();\n\n Scanner secondSide = new Scanner(System.in);\n System.out.println(\"Please put in your second side length: \");\n int side2 = secondSide.nextInt();\n\n Scanner thirdSide = new Scanner(System.in);\n System.out.println(\"Please put in your third side length: \");\n int side3 = thirdSide.nextInt();\n\n System.out.println(\"\\nNow calculating to see if you have a Triangle...\");\n System.out.println(\"Your first side value: \" + side1 + \"\\nYour second side value: \" + side2 + \"\\nYour third side value: \" + side3 + \"\\n\");\n\n //*****************************************************************\n /*\n *This is seeing is the sides are going to be enough for a Triangle\n *using Triangle Inequality Theorem\n */\n if(side1 + side2 > side3){\n if(side1 + side3 > side2){\n if(side2 + side3 > side1){\n System.out.println(\"Yes! This is a Triangle!\");\n\n if ((side1 == side2) && (side2 == side3) && (side3 == side1)){\n System.out.println(\"Oh hey! Your Triangle is an Equilaterall Triangle!\");\n }else{\n System.out.print(\"\");\n }\n\n if (((side1 == side2) && (side2 != side3)) || ((side2 == side3) && (side3 != side1)) || ((side3 == side1) && (side3 != side2))){\n System.out.println(\"Wow! Your triangle is Isosoleces!\");\n }else{\n System.out.print(\"\");\n }\n\n }else{\n System.out.println(\"No, Not a Triangle\");\n }\n }else{\n System.out.println(\"No, Not a Triangle\");\n }\n }else{\n System.out.println(\"No, Not a Triangle.\");\n return;\n }\n\n //checking to see if equilaterall\n\n }",
"public static void main(String[] args) {\n\t\tScanner obj=new Scanner(System.in);\r\n\t\tint a=0;\r\n\t\tint count=0;\r\n System.out.println(\"enter size\");\r\n\t\ta=obj.nextInt();\r\n\t\tint m=2*a+1;\r\n\t\tint n=2*a+2;\r\n\t\tint mid=(m+1)/2;\r\n\t\tfor(int i=1;i<=m;i++)\r\n\t\t{\r\n\t\t\tcount=0;\r\n\t\t\tfor(int j=1;j<=n;j++)\r\n\t\t\t{\r\n\t\t\t\tcount++;\r\n\t\t\t\tif((i==1)||(i==m)||(j==1)||(j==n))//frame begin\r\n\t\t\t\t{\r\n\t\t\t\t\tif((i==1)||(i==m))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"+\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t {\r\n\t\t\t\t\t\t\tSystem.out.print(\"|\");//frame left and right\r\n\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//frame end\r\n\t\t\t\telse if (i<mid)//upper-half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t for(int l=1;l<=2*i-4;l++)\r\n\t\t\t\t {\r\n\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\tSystem.out.print(\"\\\\\");\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end of upper half\r\n\t\t\t\telse if(i>mid)//lower half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tfor(int k=mid;k<i;k++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t System.out.print(\"\\\\\");\r\n\t\t\t\t\t for(int l=2*m-6;l>2*i-4;l--)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t }\r\n\t\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t\t for(int k=mid;k<i;k++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t\t\t}//end of lower half\r\n\t\t\t\telse if(i==mid)//middle part\r\n\t\t\t\t{\r\n\t\t\t\t\tif(j==2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\"<\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(j==n-1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\">\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(i%2==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"=\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end\r\n\t\t\t}//end-of-j\r\n\t\t\tSystem.out.println();\r\n\t\t}//end\r\n\r\n\t}",
"static void print4(int n) {\n\t\tint blank = 0;\n\t\tint star = (n/2) + 1;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 0; j < blank; j++) {\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tfor (int j = 0; j < Math.abs(star); j++) {\n\t\t\t\tSystem.out.print(\"*\");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\tstar--;\n\t\t\tif(star == 0) {\n\t\t\t\tstar = -2;\n\t\t\t}\n\t\t\tblank++;\n\t\t\tif(blank > n/2)\n\t\t\t\tblank = n >> 1;\n\t\t}\n\t}",
"public boolean isTriangle () {\r\n\t\tif (startSide1 > 0 && startSide2 > 0 && startSide3 > 0){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse return false;\r\n\t}",
"private void four1(double data[], int nn, int isign) {\r\n int n,mmax,m,j,istep,i;\r\n double wtemp,wr,wpr,wpi,wi,theta;\r\n double tempr,tempi;\r\n double swap;\r\n\r\n n=2*nn;\r\n j=1;\r\n for (i=1;i<n;i+=2) {\r\n if (j > i) {\r\n swap=data[j];\r\n data[j]=data[i];\r\n data[i]=swap;\r\n\r\n swap=data[j+1];\r\n data[j+1]=data[i+1];\r\n data[i+1]=swap;\r\n }\r\n m=n >> 1;\r\n while (m >= 2 && j > m) {\r\n j -= m;\r\n m >>= 1;\r\n }\r\n j += m;\r\n }\r\n mmax=2;\r\n while (n > mmax) {\r\n istep=2*mmax;\r\n theta=isign*(6.28318530717959/mmax);\r\n wtemp=Math.sin(0.5*theta);\r\n wpr = -2.0*wtemp*wtemp;\r\n wpi=Math.sin(theta);\r\n wr=1.0;\r\n wi=0.0;\r\n for (m=1;m<mmax;m+=2) {\r\n for (i=m;i<=n;i+=istep) {\r\n j=i+mmax;\r\n tempr=wr*data[j]-wi*data[j+1];\r\n tempi=wr*data[j+1]+wi*data[j];\r\n data[j]=data[i]-tempr;\r\n data[j+1]=data[i+1]-tempi;\r\n data[i] += tempr;\r\n data[i+1] += tempi;\r\n }\r\n wr=(wtemp=wr)*wpr-wi*wpi+wr;\r\n wi=wi*wpr+wtemp*wpi+wi;\r\n }\r\n mmax=istep;\r\n }\r\n }",
"public static void main(String[] args) {\n\t\tint high =5;\r\n\t\tint bottom = 3;\r\n\t\tdouble equiateraltriangle= (double)high * bottom /2;\r\n\t\t\r\n\t\tSystem.out.println(\"밑변이 3이고 높이가 5인 정삼각형의 넓이는\" + equiateraltriangle);\r\n\r\n\t}",
"public void switchSides() {\n\t\tint temp = 0;\r\n\t\ttemp = leftValue;\r\n\t\tleftValue = rightValue;\r\n\t\trightValue = temp;\r\n\t}",
"public void takeHalfFromAny() {\n if (stackA.getNumChips() != 0){\n if (stackA.getNumChips() % 2 == 0){\n stackA.removeChips(stackA.getNumChips()/2);\n }else {\n stackA.removeChips((stackA.getNumChips()+1)/2);\n }\n }else if(stackB.getNumChips() != 0){\n if (stackB.getNumChips() % 2 == 0){\n stackB.removeChips(stackB.getNumChips()/2);\n }else {\n stackB.removeChips((stackB.getNumChips()+1)/2);\n }\n }else if (stackC.getNumChips() != 0){\n if (stackC.getNumChips() % 2 == 0){\n stackC.removeChips(stackC.getNumChips()/2);\n }else {\n stackC.removeChips((stackC.getNumChips()+1)/2);\n }\n }else{\n stackA = stackA;\n stackB = stackB;\n stackC = stackC;\n }\n }",
"public void computeFractal(){\n\t\tint deltaX =p5.getX()-p1.getX();\n\t\tint deltaY =p5.getY()- p1.getY();\n\t\tint x2= p1.getX()+ (deltaX/3);\n\t\tint y2= p1.getY()+ (deltaY/3);\n\t\tdouble x3=((p1.getX()+p5.getX())/2)+( Math.sqrt(3)*\n\t\t\t\t(p1.getY()-p5.getY()))/6;\n\t\tdouble y3=((p1.getY()+p5.getY())/2)+( Math.sqrt(3)*\n\t\t\t\t(p5.getX()-p1.getX()))/6;\n\t\tint x4= p1.getX()+((2*deltaX)/3);\n\t\tint y4= p1.getY()+((2*deltaY)/3);\n\t\tthis.p2= new Point(x2,y2);\n\t\tthis.p3= new Point((int)x3,(int)y3);\n\t\tthis.p4= new Point(x4,y4);\n\t}",
"private static void assignment6() {\n\n\n for (int i = 0; i < 4;i++){\n System.out.println();\n for (int j = 0; j < 4; j++){\n// System.out.print(\" * \");\n if (i <= j){\n System.out.print(\" * \");\n } else {\n System.out.print(\" \");\n }\n }\n }\n }",
"public static void main(String[] args) {\nint n, num=1;\nScanner input = new Scanner(System.in);\nSystem.out.println(\"please enter the number of rows for the triangle :\");\nn = input.nextInt();\nSystem.out.println(\"floyd's triangle:\");\nfor(int i=1;i<=n;i++)\n{\nfor(int j=1;j<=i;j++)\t\n{\nSystem.out.print(num + \" \");\t\nnum++;\n}\nSystem.out.println();\n}\n\t\t\n\t}",
"public static void main(String[] args) {\n // ***\n // *****\n // *******\n // *********\n // *******\n // *****\n // ***\n // *\n System.out.println(\"PROBLEM 1: \");\n int numOfLines = 9;\n int midLine = (numOfLines+1)/2;\n // upper part\n for (int i = 1; i <= midLine; i++){\n //space\n for (int s = 1; s<=(midLine-i); s++){\n System.out.print(\" \");\n }\n //star\n for (int j =1; j<=(i*2-1); j++){\n System.out.print(\"*\");\n }\n System.out.println();\n }\n //Lower part\n for(int i =1;i <=(midLine-1);i++) {\n\n\n //space\n for (int s = 1; s <= i; s++){\n System.out.print(\" \");\n }\n //star\n for (int j= 1; j<=(midLine-i)*2-1; j++){\n System.out.print(\"*\");\n }\n System.out.println();\n\n }\n\n\n// Problem 2\n// Given the number of rows, create a triangle with that many rows.\n// For example, if rows = 5 then\n// *\n// **\n// ***\n// ****\n// *****\n System.out.println(\"PROBLEM 2: \");\n\n System.out.println(\"Enter the number of line (odd numbers)\");\n Scanner input = new Scanner(System.in);\n int numberOfLines = input.nextInt();\n for (int i = 1; i <= numberOfLines; i++){\n //add stars\n for (int j =1; j<=i; j++){\n System.out.print(\"*\");\n }\n System.out.println();\n\n }\n\n // Problem 3\n // Using the celsius to fahrenheit conversion, product the following table\n // |Celsius|Fahrenheit|\n // | 0 | 32 |\n // | 1 | 33.8 |\n // | 2 | 35.6 |\n // | ... | ... |\n // | 30 | 86 |\n\n System.out.println(\"PROBLEM 3: \");\n\n int celsius = 0;\n double fahrenheit;\n System.out.println(\" | \"+\"celsius\"+\"|\"+\"fahrenheit\"+\"| \");\n\n while(celsius <=30 ) {\n fahrenheit = (9.0/5.0 * celsius) + 32;\n System.out.println(\" | \" + celsius + \" | \" + fahrenheit + \" | \");\n celsius++;\n }\n\n\n // Problem 4\n // Declare a variable x with any value. Determine if x is prime.\n //Dividing the number by 2 does gain us efficiency but how could we make it more efficient? Think about 25,\n // do you need to go up to 12.5? Could you stop at a lower number?\n System.out.println(\"PROBLEM 4: \");\n\n int remainder;\n boolean isPrime = true;\n int numberToCheck = 77;\n\n for (int i = 2; i <= numberToCheck /i; i++) {\n remainder = numberToCheck % i;\n\n\n if (remainder == 0) {\n\n isPrime = false;\n break;\n }\n }\n\n if (isPrime)\n System.out.println(numberToCheck + \" is a Prime numberToCheckber\");\n else\n System.out.println(numberToCheck + \" is not a Prime numberToCheckber\");\n\n\n // Problem 5\n // The Kalebnacci sequence begins with 2 and -1 as its first and second terms.\n // After these first two elements, each subsequent element is equal to twice the previous previous term minus\n // the previous term.\n // kaleb(0) = 2\n // kaleb(1) = -1\n // kaleb(n) = 2*kaleb(n-2) - kaleb(n-1)\n // Find the nth number in the sequence\n\n System.out.println(\"PROBLEM 5: \");\n\n int n = 8;\n int a = 2;\n int b = -1;\n int c;\n System.out.print(a + \" \" + b + \" \");\n for (int i =0; i<n;i++){\n c =2*a-b;\n System.out.print(c + \" \" );\n a=b;\n b=c;\n }\n\n }",
"public HalfEdge(String s, int q) { label1 = s; end = q; }",
"public static Vector4 up()\n {\n return new Vector4(0,1,0,0);\n }",
"public int stepFour(int step)\n\t{\n\t\tint rows=-1;\n\t\tint cols=-1;\n\t\tboolean over;\n\t\tover=false;\n\t\t\n\t\twhile(!over)\n\t\t{\n\t\t\tint[] a=findZeros(rows,cols);\n\t\t\trows=a[0];\n\t\t\tcols=a[1];\n\t\t\t\n\t\t\tif(rows==-1)\n\t\t\t{\n\t\t\t\tover=true;\n\t\t\t\tstep=6;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmatrix[rows][cols]=2;\n\t\t\t\tif(starRows(rows))\n\t\t\t\t{\n\t\t\t\t\tcols=getStarInRow(rows,cols);\n\t\t\t\t\trowLabelMultiple[rows]=1;\n\t\t\t\t\tcolumnLabelMultiple[cols]=0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tover=true;\n\t\t\t\t\tstep=5;\n\t\t\t\t\tpath_row_0=rows;\n\t\t\t\t\tpath_col_0=cols;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn step;\n\t}",
"public boolean moveForward(){\n \n int[] last = (int[]) this.snake.elementAt(this.snake.size() -1);\n int[] sLast = (int[]) this.snake.elementAt(this.snake.size() -2);\n int[] diff = new int[2];\n int[] diff2 = new int[2];\n \n diff[0] = last[0] - sLast[0];\n diff[1] = last[1] - sLast[1];\n \n //left\n if( direction == 1){\n diff2[0]--;\n if(diff2[0] == -1*diff[0] &&diff2[1] == -1*diff[1]){\n diff = new int[]{0,0}; \n }else{\n diff = diff2; \n }\n \n //down\n }else if(direction == 2){\n \n diff2[1]++;\n if(diff2[0] == -1*diff[0] &&diff2[1] == -1*diff[1]){\n diff = new int[]{0,0}; \n }else{\n diff=diff2; \n //System.out.println(\"first one: \" + diff[0] + \", \" + diff[1]);\n }\n \n //right\n }else if(direction == 3){\n diff2[0]++;\n if(diff2[0] == -1*diff[0] &&diff2[1] == -1*diff[1]){\n diff = new int[]{0,0}; \n }else{\n diff=diff2; \n }\n \n //up\n }else if(direction == 4){\n \n diff2[1]--;\n //System.out.println(\"\" + diff[0] + \", \" + diff[1]);\n if(diff2[0] == -1*diff[0] &&diff2[1] == -1*diff[1]){\n diff = new int[]{0,0}; \n }else{\n diff=diff2; \n }\n }else{ \n diff[0] = last[0] - sLast[0];\n diff[1] = last[1] - sLast[1];\n }\n \n int[] newPoint = new int[2];\n newPoint[0] = last[0] + diff[0];\n newPoint[1] = last[1] + diff[1];\n \n //if it hits the snake itself\n boolean hits = false;\n Enumeration enu = this.snake.elements();\n int[] temp = new int[2];\n while(enu.hasMoreElements()){\n temp = (int[]) enu.nextElement();\n if(temp[0] == newPoint[0] && temp[1] == newPoint[1]){\n hits = true; \n }\n }\n if(hits){\n return false; \n }\n //if it hits the wall\n if( newPoint[0] >50 || newPoint[0] <0 || newPoint[1] >50 || newPoint[1] <0){\n return false; \n }else{\n if(newPoint [0] == this.apple[0] && newPoint[1] == this.apple[1]){\n this.snake.add(newPoint);\n this.ateApple();\n }else{\n this.snake.add(newPoint);\n this.snake.remove(0);\n \n \n }\n return true;\n }\n }",
"public void star(float x, float y, float r, float R) {\n float angle = TWO_PI / 5;\n float halfAngle = angle/2.0f;\n beginShape();\n noStroke();\n for (float a = 0; a < TWO_PI; a += angle) {\n float sx = x + cos(a) * r;\n float sy = y + sin(a) * r;\n vertex(sx, sy);\n sx = x + cos(a+halfAngle) * R;\n sy = y + sin(a+halfAngle) * R;\n vertex(sx, sy);\n }\n endShape(CLOSE);\n}",
"private void arretes_fW(){\n\t\tthis.cube[4] = this.cube[1]; \n\t\tthis.cube[1] = this.cube[3];\n\t\tthis.cube[3] = this.cube[7];\n\t\tthis.cube[7] = this.cube[5];\n\t\tthis.cube[5] = this.cube[4];\n\t}",
"@Override\n\tpublic Squarelotron mainDiagonalFlip(int ring) {\n\t\tint[] array = numbers();\n\t\t//converts the array into a new Squarelotron\n\t\tSquarelotron copySquarelotron = makeSquarelotron(array);\n\t\tint[][] newSquarelotron = copySquarelotron.squarelotron;\n\t\t//finds length of squarelotron and takes the square root\n\t\tint length = array.length;\n\t\tdouble sqrtLength = Math.sqrt(length);\n\t\tint size =(int) sqrtLength;\n\t\t//loops through and flips along the main diagonal\n\t\tfor(int i = ring; i <= (size-ring); i++){\n\t\t\tint numberRt = newSquarelotron[ring-1][i];\n\t\t\tnewSquarelotron[ring-1][i] = newSquarelotron[i][ring-1];\n\t\t\tnewSquarelotron[i][ring-1]=numberRt;\n\t\t\tint numberLft = newSquarelotron[i][size-ring];\n\t\t\tnewSquarelotron[i][size-ring]= newSquarelotron[size-ring][i];\n\t\t\tnewSquarelotron[size-ring][i]=numberLft;\n\t\t}\n\t\tcopySquarelotron.squarelotron = newSquarelotron;\n\t\treturn copySquarelotron;\n\t}",
"public int getTriangleCount();",
"public static void main(String[] args) {\n\t\tint num=4;\r\n\t\tfor(int i=0;i<=num;i++) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor(int j=0;j<=num;j++) {\r\n\t\t\t\t\t\tif(j<=i && i+j>=num) \r\n\t\t\t\t\t\r\n\t\t\t\t\t\tSystem.out.print(\"*\");\r\n\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tSystem.out.println();\r\n\t\t\t\t\t\t}\r\n\t\t\t}",
"void forwardQuadrilateral(Interpolator source,\n\t\t\t\tfloat[] sX, float[] sY,\n\t\t\t\tImageProcessor target,\n\t\t\t\tint w, int h,\n\t\t\t\tfloat[] tX, float[] tY) {\n\t\t\tfloat minY, maxY;\n\t\t\tminY = maxY = tY[0];\n\t\t\tfor (int i = 1; i < 4; i++)\n\t\t\t\tif (minY > tY[i])\n\t\t\t\t\tminY = tY[i];\n\t\t\t\telse if (maxY < tY[i])\n\t\t\t\t\tmaxY = tY[i];\n\t\t\tint startY = minY < 0 ? 0 : (int)Math.floor(minY);\n\t\t\tint stopY = maxY > h ? h : (int)Math.ceil(maxY);\n\t\t\tfor (int y = startY; y < stopY; y++) {\n\t\t\t\t// find intersecting edges\n\t\t\t\tfloat minX = w, maxX = 0;\n\t\t\t\tfor (int i = 0; i < 4; i++) {\n\t\t\t\t\tint i1 = i == 3 ? 0 : i + 1;\n\t\t\t\t\tfloat y1 = (float)Math.round(tY[i]);\n\t\t\t\t\tfloat y2 = (float)Math.round(tY[i1]);\n\t\t\t\t\tfloat rY = (float)Math.round(y);\n\t\t\t\t\tif ((rY - y1) * (rY - y2) > 0)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (y1 != y2) {\n\t\t\t\t\t\tfloat x = tX[i] + (y - tY[i]) *\n\t\t\t\t\t\t\t(tX[i1] - tX[i]) /\n\t\t\t\t\t\t\t(tY[i1] - tY[i]);\n\t\t\t\t\t\tif (minX > x)\n\t\t\t\t\t\t\tminX = x;\n\t\t\t\t\t\tif (maxX < x)\n\t\t\t\t\t\t\tmaxX = x;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (tX[i] < tX[i1]) {\n\t\t\t\t\t\tif (minX > tX[i])\n\t\t\t\t\t\t\tminX = tX[i];\n\t\t\t\t\t\tif (maxX < tX[i1])\n\t\t\t\t\t\t\tmaxX = tX[i1];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (minX > tX[i1])\n\t\t\t\t\t\t\tminX = tX[i1];\n\t\t\t\t\t\tif (maxX < tX[i])\n\t\t\t\t\t\t\tmaxX = tX[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// now interpolate\n\t\t\t\tint startX = minX < 0 ? 0\n\t\t\t\t\t: (int)Math.floor(minX);\n\t\t\t\tint stopX = maxX > w ? w\n\t\t\t\t\t: (int)Math.ceil(maxX);\n\t\t\t\tfor (int x = startX; x < stopX; x++) {\n\t\t\t\t\tfloat a, b, c, d, e, f, g, s;\n\t\t\t\t\ta = tX[0] - x;\n\t\t\t\t\tb = tX[1] - tX[0];\n\t\t\t\t\tc = tX[3] - tX[0];\n\t\t\t\t\td = tX[2] - tX[3] - tX[1] + tX[0];\n\t\t\t\t\te = tY[0] - y;\n\t\t\t\t\tf = tY[1] - tY[0];\n\t\t\t\t\tg = tY[3] - tY[0];\n\t\t\t\t\ts = tY[2] - tY[3] - tY[1] + tY[0];\n\t\t\t\t\tfloat p, q, r, dx, dy;\n\t\t\t\t\tp = b * s - d * f;\n\t\t\t\t\tq = b * g + a * s - d * e - c * f;\n\t\t\t\t\tr = a * g - c * e;\n\t\t\t\t\tfloat D = q * q - 4 * p * r;\n\t\t\t\t\tif (p == 0 || D < 0) {\n\t\t\t\t\t\tif (b == 0) {\n\t\t\t\t\t\t\tdx = 0;\n\t\t\t\t\t\t\tdy = -e / g;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdx = -a / c;\n\t\t\t\t\t\t\tdy = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdx = (-q + (float)Math.sqrt(D))\n\t\t\t\t\t\t\t/ 2 / p;\n\t\t\t\t\t\tdy = -(a + b * dx)\n\t\t\t\t\t\t\t/ (c + d * dx);\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat x0 = (1 - dx) * (1 - dy) * sX[0]\n\t\t\t\t\t\t+ dx * (1 - dy) * sX[1]\n\t\t\t\t\t\t+ (1 - dx) * dy * sX[3]\n\t\t\t\t\t\t+ dx * dy * sX[2];\n\t\t\t\t\tfloat y0 = (1 - dx) * (1 - dy) * sY[0]\n\t\t\t\t\t\t+ dx * (1 - dy) * sY[1]\n\t\t\t\t\t\t+ (1 - dx) * dy * sY[3]\n\t\t\t\t\t\t+ dx * dy * sY[2];\n\t\t\t\t\tfloat value = source.get(x0, y0);\n\t\t\t\t\ttarget.setf(x, y, value);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public HalfAdder() {\n mAndGate = new AndGate(ZERO, ZERO);\n mXorGate = new XorGate(ZERO, ZERO);\n }",
"public static void PascalTriangle(int rowCount)\n {\n int num, r;\n\n for (int lineNumber =0; lineNumber<=rowCount; lineNumber++){\n String outputLine = \"\";\n\n num = 1;\n r = lineNumber + 1;\n for (int space = rowCount - lineNumber; space > 0; space--) {\n System.out.print(\" \");\n }\n for(int count =0; count<=lineNumber;count++)\n {\n if (count > 0) {\n num = num * (r - count) / count;\n }\n System.out.print(num + \" \");\n }\n\n System.out.println(outputLine);\n }\n }",
"public static int QTDelHeuristic1 (Graph<Integer,String> h) {\n\t\tint count = 0;\r\n\t\tboolean isQT = false;\r\n\t\t//h = Copy(g);\r\n\t\t//boolean moreToDo = true;\r\n\t\t\r\n\t\tIterator<Integer> a;\r\n\t\tIterator<Integer> b;\r\n\t\tIterator<Integer> c;\r\n\t\tIterator<Integer> d;\r\n\r\n\t\twhile (isQT == false) {\r\n\t\t\tisQT = true;\r\n\t\t\ta= h.getVertices().iterator();\r\n\t\t\twhile(a.hasNext()){\r\n\t\t\t\tInteger A = a.next();\r\n\t\t\t\t//System.out.print(\"\"+A+\" \");\r\n\t\t\t\tb = h.getNeighbors(A).iterator();\r\n\t\t\t\twhile(b.hasNext()){\r\n\t\t\t\t\tInteger B = b.next();\r\n\t\t\t\t\tc = h.getNeighbors(B).iterator();\r\n\t\t\t\t\twhile (c.hasNext()){\r\n\t\t\t\t\t\tInteger C = c.next();\r\n\t\t\t\t\t\tif (h.isNeighbor(C, A) || C==A) continue;\r\n\t\t\t\t\t\td = h.getNeighbors(C).iterator();\r\n\t\t\t\t\t\twhile (d.hasNext()){\r\n\t\t\t\t\t\t\tInteger D = d.next();\r\n\t\t\t\t\t\t\tif (D==B) continue; \r\n\t\t\t\t\t\t\tif (h.isNeighbor(D,B)) continue;\r\n\t\t\t\t\t\t\t//otherwise, we have a P4 or a C4\r\n\r\n\t\t\t\t\t\t\tisQT = false;\r\n\t\t\t\t\t\t\t//System.out.print(\"Found P4: \"+A+\"-\"+B+\"-\"+C+\"-\"+D+\"... not a cograph\\n\");\r\n\r\n\t\t\t\t\t\t\tif (h.isNeighbor(D,A)) {\r\n\t\t\t\t\t\t\t\t// we have a C4 = a-b-c-d-a\r\n\t\t\t\t\t\t\t\t// requires 2 deletions\r\n\t\t\t\t\t\t\t\tcount += 2;\r\n\t\t\t\t\t\t\t\th.removeVertex(A);\r\n\t\t\t\t\t\t\t\th.removeVertex(B);\r\n\t\t\t\t\t\t\t\th.removeVertex(C);\r\n\t\t\t\t\t\t\t\th.removeVertex(D);\r\n\t\t\t\t\t\t\t\treturn 2 + QTDelHeuristic1(h);\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t// this case says:\r\n\t\t\t\t\t\t\t\t// else D is NOT adjacent to A. Then we have P4=abcd\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tcount += 1;\r\n\t\t\t\t\t\t\t\th.removeVertex(A);\r\n\t\t\t\t\t\t\t\th.removeVertex(B);\r\n\t\t\t\t\t\t\t\th.removeVertex(C);\r\n\t\t\t\t\t\t\t\th.removeVertex(D);\r\n\t\t\t\t\t\t\t\treturn 1 + QTDelHeuristic1(h);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t} // end d.hasNext()\r\n\t\t\t\t} // end c.hasNext()\r\n\t\t\t} // end b.hasNext() \r\n\t\t} // end a.hasNext()\r\n\t\t\r\n\t\treturn count;\t\t\r\n\t}",
"boolean isStraight();",
"public abstract double getDiagonal();",
"public static ArrayList<Integer[]> compactForwardAlgorithmTriangles(ArrayList<Integer>[] graph) {\n Set<Pair<Integer, ArrayList<Integer>>> pairs = Utils.getSortedArrays(graph);\n Map<Integer, Integer> etas = Utils.getEtasMap(pairs);\n\n // sort adjacency arrays according to eta\n pairs.forEach(p -> p.getSecond().sort(Comparator.comparing(etas::get)));\n\n\n\n int triangleCount = 0;\n ArrayList<Integer[]> triangles = new ArrayList();\n\n\n // main part, in which we actually count triangles\n Iterator<Pair<Integer, ArrayList<Integer>>> iterator = pairs.iterator();\n while (iterator.hasNext()) {\n Pair<Integer, ArrayList<Integer>> pair = iterator.next();\n Integer v = pair.getFirst();\n ArrayList<Integer> v_neighbors = graph[v];\n\n for (int u : v_neighbors) {\n if (etas.get(u) > etas.get(v)) {\n ArrayList<Integer> u_neighbors = graph[u];\n\n Iterator<Integer> uIterator = u_neighbors.iterator(), vIterator = v_neighbors.iterator();\n\n if (uIterator.hasNext() && vIterator.hasNext()) {\n Integer u_ = uIterator.next(), v_ = vIterator.next();\n while (uIterator.hasNext() && vIterator.hasNext() && etas.get(u_) < etas.get(v)\n && etas.get(v_) < etas.get(v)) {\n if (etas.get(u_) < etas.get(v_))\n u_ = uIterator.next();\n else if (etas.get(u_) > etas.get(v_))\n v_ = vIterator.next();\n else {\n Integer[] triangle = new Integer[3];\n\n triangle[0] = u;\n triangle[1] = v;\n triangle[2] = u_;\n triangles.add(triangle);\n\n\n triangleCount++;\n\n u_ = uIterator.next();\n v_ = vIterator.next();\n\n }\n }\n\n }\n }\n }\n }\n return triangles;\n }",
"protected int mirrorDirection(int direction) {\n\t\tif (direction < 4) {\n\t\t\treturn (direction + 2)%4;\n\t\t} else {\n\t\t\treturn (direction + 2)%4 + 4;\n\t\t}\n\t}",
"void graph4() {\n\t\tconnect(\"8\", \"9\");\n\t\tconnect(\"3\", \"1\");\n\t\tconnect(\"3\", \"2\");\n\t\tconnect(\"3\", \"9\");\n\t\tconnect(\"4\", \"3\");\n\t\t//connect(\"4\", \"5\");\n\t\t//connect(\"4\", \"7\");\n\t\t//connect(\"5\", \"7\");\t\t\n\t}",
"@Override\n\tpublic Squarelotron sideFlip(String side) {\n\t\tint[] array = numbers();\n\t\t//converts the array into a new Squarelotron\n\t\tSquarelotron copySquarelotron = makeSquarelotron(array);\n\t\tint[][] newSquarelotron = copySquarelotron.squarelotron;\n\t\t//finds length of squarelotron and takes the square root\n\t\tint length = array.length;\n\t\tdouble sqrtLength = Math.sqrt(length);\n\t\tint size =(int) sqrtLength;\n\t\t//the following check for each input and then flip accordingly\n\t\t//top flips the top two rows\n\t\tif(side == \"top\"){\n\t\t\tfor(int i = 0; i<= (size-1); i++){\n\t\t\t\tint number= newSquarelotron[0][i];\n\t\t\t\tnewSquarelotron[0][i] = newSquarelotron[1][i];\n\t\t\t\tnewSquarelotron[1][i]=number;\n\t\t\t}\n\n\t\t}\n\t\t//bottom flips the bottom two rows\n\t\telse if(side == \"bottom\"){\n\t\t\tfor(int i = 0; i<= (size-1); i++){\n\t\t\t\tint number= newSquarelotron[size-1][i];\n\t\t\t\tnewSquarelotron[size-1][i] = newSquarelotron[size-2][i];\n\t\t\t\tnewSquarelotron[size-2][i]=number;\n\t\t\t}\t\n\n\t\t}\n\t\t//left flips the left two rows\n\t\telse if(side == \"left\"){\n\t\t\tfor(int i = 0; i<= (size-1); i++){\n\t\t\t\tint number= newSquarelotron[i][0]\t;\n\t\t\t\tnewSquarelotron[i][0] = newSquarelotron[i][1];\n\t\t\t\tnewSquarelotron[i][1]=number;\n\t\t\t}\n\n\t\t}\n\t\t//right flips the right two rows\n\t\telse if(side == \"right\"){\n\t\t\tfor(int i = 0; i<= (size-1); i++){\n\t\t\t\tint number= newSquarelotron[i][size-1];\n\t\t\t\tnewSquarelotron[i][size-1] = newSquarelotron[i][size-2];\n\t\t\t\tnewSquarelotron[i][size-2]=number;\n\t\t\t}\t\n\n\t\t}\n\n\t\tcopySquarelotron.squarelotron = newSquarelotron;\n\t\treturn copySquarelotron;\n\t}",
"@Override\r\n\tpublic int challengeFour(int[][] arr) {\n\t\treturn 0;\r\n\t}",
"private void smoothAdjacentCollapsibles(TECarpentersBlock TE, int src_quadrant)\n \t{\n \t\tTECarpentersBlock TE_XN = TE.worldObj.getBlockId(TE.xCoord - 1, TE.yCoord, TE.zCoord) == blockID ? (TECarpentersBlock)TE.worldObj.getBlockTileEntity(TE.xCoord - 1, TE.yCoord, TE.zCoord) : null;\n \t\tTECarpentersBlock TE_XP = TE.worldObj.getBlockId(TE.xCoord + 1, TE.yCoord, TE.zCoord) == blockID ? (TECarpentersBlock)TE.worldObj.getBlockTileEntity(TE.xCoord + 1, TE.yCoord, TE.zCoord) : null;\n \t\tTECarpentersBlock TE_ZN = TE.worldObj.getBlockId(TE.xCoord, TE.yCoord, TE.zCoord - 1) == blockID ? (TECarpentersBlock)TE.worldObj.getBlockTileEntity(TE.xCoord, TE.yCoord, TE.zCoord - 1) : null;\n \t\tTECarpentersBlock TE_ZP = TE.worldObj.getBlockId(TE.xCoord, TE.yCoord, TE.zCoord + 1) == blockID ? (TECarpentersBlock)TE.worldObj.getBlockTileEntity(TE.xCoord, TE.yCoord, TE.zCoord + 1) : null;\n \t\tTECarpentersBlock TE_XZNN = TE.worldObj.getBlockId(TE.xCoord - 1, TE.yCoord, TE.zCoord - 1) == blockID ? (TECarpentersBlock)TE.worldObj.getBlockTileEntity(TE.xCoord - 1, TE.yCoord, TE.zCoord - 1) : null;\n \t\tTECarpentersBlock TE_XZNP = TE.worldObj.getBlockId(TE.xCoord - 1, TE.yCoord, TE.zCoord + 1) == blockID ? (TECarpentersBlock)TE.worldObj.getBlockTileEntity(TE.xCoord - 1, TE.yCoord, TE.zCoord + 1) : null;\n \t\tTECarpentersBlock TE_XZPN = TE.worldObj.getBlockId(TE.xCoord + 1, TE.yCoord, TE.zCoord - 1) == blockID ? (TECarpentersBlock)TE.worldObj.getBlockTileEntity(TE.xCoord + 1, TE.yCoord, TE.zCoord - 1) : null;\n \t\tTECarpentersBlock TE_XZPP = TE.worldObj.getBlockId(TE.xCoord + 1, TE.yCoord, TE.zCoord + 1) == blockID ? (TECarpentersBlock)TE.worldObj.getBlockTileEntity(TE.xCoord + 1, TE.yCoord, TE.zCoord + 1) : null;\n \t\t\n \t\tint height = Collapsible.getQuadHeight(TE, src_quadrant);\n \t\t\n \t\tswitch (src_quadrant)\n \t\t{\n \t\tcase Collapsible.QUAD_XZNN:\n \t\t\tif (TE_ZN != null) {\n \t\t\t\tCollapsible.setQuadHeight(TE_ZN, Collapsible.QUAD_XZNP, height);\n \t\t\t}\n \t\t\tif (TE_XZNN != null) {\n \t\t\t\tCollapsible.setQuadHeight(TE_XZNN, Collapsible.QUAD_XZPP, height);\n \t\t\t}\n \t\t\tif (TE_XN != null) {\n \t\t\t\tCollapsible.setQuadHeight(TE_XN, Collapsible.QUAD_XZPN, height);\n \t\t\t}\n \t\t\tbreak;\n \t\tcase Collapsible.QUAD_XZNP:\n \t\t\tif (TE_XN != null) {\n \t\t\t\tCollapsible.setQuadHeight(TE_XN, Collapsible.QUAD_XZPP, height);\n \t\t\t}\n \t\t\tif (TE_XZNP != null) {\n \t\t\t\tCollapsible.setQuadHeight(TE_XZNP, Collapsible.QUAD_XZPN, height);\n \t\t\t}\n \t\t\tif (TE_ZP != null) {\n \t\t\t\tCollapsible.setQuadHeight(TE_ZP, Collapsible.QUAD_XZNN, height);\n \t\t\t}\n \t\t\tbreak;\n \t\tcase Collapsible.QUAD_XZPN:\n \t\t\tif (TE_XP != null) {\n \t\t\t\tCollapsible.setQuadHeight(TE_XP, Collapsible.QUAD_XZNN, height);\n \t\t\t}\n \t\t\tif (TE_XZPN != null) {\n \t\t\t\tCollapsible.setQuadHeight(TE_XZPN, Collapsible.QUAD_XZNP, height);\n \t\t\t}\n \t\t\tif (TE_ZN != null) {\n \t\t\t\tCollapsible.setQuadHeight(TE_ZN, Collapsible.QUAD_XZPP, height);\n \t\t\t}\n \t\t\tbreak;\n \t\tcase Collapsible.QUAD_XZPP:\n \t\t\tif (TE_ZP != null) {\n \t\t\t\tCollapsible.setQuadHeight(TE_ZP, Collapsible.QUAD_XZPN, height);\n \t\t\t}\n \t\t\tif (TE_XZPP != null) {\n \t\t\t\tCollapsible.setQuadHeight(TE_XZPP, Collapsible.QUAD_XZNN, height);\n \t\t\t}\n \t\t\tif (TE_XP != null) {\n \t\t\t\tCollapsible.setQuadHeight(TE_XP, Collapsible.QUAD_XZNP, height);\n \t\t\t}\n \t\t\tbreak;\n \t\t}\n \t}",
"public void printDiamond(){\n printIsoceles();\n //use bottom isosceles method to get bottom half of Diamond\n printBottomIsoceles();\n }",
"protected void skybox() {\n Triple pos1, pos2, pos3, pos4, pos5, pos6, pos7, pos8, col1, col2, col3, col4;\n\n pos1 = new Triple(0, 0, 0);\n pos2 = new Triple(100, 0, 0);\n pos3 = new Triple(100, 0, 100);\n pos4 = new Triple(0, 0, 100);\n pos5 = new Triple(0, 100, 0);\n pos6 = new Triple(100, 100, 0);\n pos7 = new Triple(100, 100, 100);\n pos8 = new Triple(0, 100, 100);\n\n // Front Triangles\n frozenSoups.addTri( new Triangle(new Vertex(pos1, 0, 0),\n new Vertex(pos2, .25, 0),\n new Vertex(pos3, .25, 1),\n 21 ) );\n\n frozenSoups.addTri( new Triangle(new Vertex(pos3, .25, 1),\n new Vertex(pos4, 0, 1),\n new Vertex(pos1, 0, 0),\n 21 ) );\n\n // Left Triangles\n frozenSoups.addTri( new Triangle(new Vertex(pos1, 1, 0),\n new Vertex(pos5, .75, 0),\n new Vertex(pos8, .75, 1),\n 21 ) );\n\n frozenSoups.addTri( new Triangle(new Vertex(pos8, .75, 1),\n new Vertex(pos4, 1, 1),\n new Vertex(pos1, 1, 0),\n 21 ) );\n\n // Right Triangles\n frozenSoups.addTri( new Triangle(new Vertex(pos2, .25, 0),\n new Vertex(pos6, .5, 0),\n new Vertex(pos7, .5, 1),\n 21 ) );\n\n frozenSoups.addTri( new Triangle(new Vertex(pos7, .5, 1),\n new Vertex(pos3, .25, 1),\n new Vertex(pos2, .25, 0),\n 21 ) );\n\n // Back Triangles\n frozenSoups.addTri( new Triangle(new Vertex(pos5, .75, 0),\n new Vertex(pos6, .5, 0),\n new Vertex(pos7, .5, 1),\n 21 ) );\n\n frozenSoups.addTri( new Triangle(new Vertex(pos7, .5, 1),\n new Vertex(pos8, .75, 1),\n new Vertex(pos5, .75, 0),\n 21 ) );\n\n // Top Triangles\n// frozenSoups.addTri( new Triangle(new Vertex(pos4, 0, 0),\n// new Vertex(pos3, 0, 1),\n// new Vertex(pos7, 1, 1),\n// 20 ) );\n\n// frozenSoups.addTri( new Triangle(new Vertex(pos7, 0, 0),\n// new Vertex(pos8, 1, 0),\n// new Vertex(pos4, 1, 1),\n// 20 ) );\n }",
"double passer();",
"public void stepForwad() {\n\t\t\t\n\t\t\tswitch(this.direction) {\n\t\t\t\tcase 0:\n\t\t\t\t\tthis.y += 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tthis.x += 1;\n\t\t\t\t\tthis.y += 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tthis.x += 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tthis.x += 1;\n\t\t\t\t\tthis.y -= 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tthis.y -= 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tthis.x -= 1;\n\t\t\t\t\tthis.y -= 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\tthis.x -= 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 7: \n\t\t\t\t\tthis.x -= 1;\n\t\t\t\t\tthis.y += 1;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tthis.x = (this.worldWidth + this.x)%this.worldWidth;\n\t\t\tthis.y = (this.worldHeight + this.y)%this.worldHeight;\n\t\t}",
"@Override\n\tpublic Squarelotron inverseDiagonalFlip(int ring) {\n\t\tint[] array = numbers();\n\t\t//converts the array into a new Squarelotron\n\t\tSquarelotron copySquarelotron = makeSquarelotron(array);\n\t\tint[][] newSquarelotron = copySquarelotron.squarelotron;\n\t\t//finds length of squarelotron and takes the square root\n\t\tint length = array.length;\n\t\tdouble sqrtLength = Math.sqrt(length);\n\t\tint size =(int) sqrtLength;\n\t\t//loops through and flips with the inverse diagonal\n\t\tfor(int i = ring-1; i <= (size-ring); i++){\n\t\t\tint numberRt = newSquarelotron[ring-1][i];\n\t\t\tnewSquarelotron[ring-1][i] = newSquarelotron[size-i-1][size-ring];\n\t\t\tnewSquarelotron[size-i-1][size-ring]=numberRt;\n\t\t}\n\t\tfor(int i = ring; i <= (size-ring); i++){\n\t\t\tint numberLft = newSquarelotron[i][ring-1];\n\t\t\tnewSquarelotron[i][ring-1] = newSquarelotron[size-ring][size-i-1];\n\t\t\tnewSquarelotron[size-ring][size-i-1]=numberLft;\n\t\t}\n\t\tcopySquarelotron.squarelotron = newSquarelotron;\n\t\treturn copySquarelotron;\n\t}",
"public static void ninethProgram() {\n\t\tfor(int i=1;i<=4;i++) {\n\t\t\tfor(int j=4-1;j>=i;j--) {\n\t\t\t\tSystem.out.print(\" \");\t\n\t\t\t}for(int k=1;k<=4;k++) {\n\t\t\t\tSystem.out.print(\"*\");\t\t\n\t\t\t}System.out.println();\n\t\t}\n\t}",
"public abstract Vector4fc div(float x, float y, float z, float w);",
"protected abstract Triangle makeTriangle(final Vector3d edge1, final Vector3d edge2,\n\t\t\tfinal Vector3d edge3);",
"public void symmetric() {\n\t\tint i,j,segment=0;\n\t\tint symmetry = _geneticCode.getSymmetry();\n\t\tint mirror = _geneticCode.getMirror();\n\t\tint sequence = _segments / symmetry;\n\t\tint left=0, right=0, top=0, bottom=0;\n\t\tint centerX, centerY;\n\t\tdouble cx, cy;\n\n\t\tfor (i=0; i<symmetry; i++) {\n\t\t\tfor (j=0; j<sequence; j++,segment++) {\n\t\t\t\t// Here, we take the vector that forms the segment, scale it depending on\n\t\t\t\t// the relative size of the organism and rotate it depending on the\n\t\t\t\t// symmetry and mirroring.\n\t\t\t\tv.setModulus(_geneticCode.getGene(j).getLength()/Utils.scale[_growthRatio-1]);\n\t\t\t\tif (j==0) {\n\t\t\t\t\t_startPointX[segment] = 0;\n\t\t\t\t\t_startPointY[segment] = 0;\n\t\t\t\t\tif (mirror == 0 || i%2==0)\n\t\t\t\t\t\tv.setTheta(_geneticCode.getGene(j).getTheta()+i*2*FastMath.PI/symmetry);\n\t\t\t\t\telse {\n\t\t\t\t\t\tv.setTheta(_geneticCode.getGene(j).getTheta()+(i-1)*2*FastMath.PI/symmetry);\n\t\t\t\t\t\tv.invertX();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (_geneticCode.getGene(j).getBranch() == -1) {\n\t\t\t\t\t\t_startPointX[segment] = _endPointX[segment - 1];\n\t\t\t\t\t\t_startPointY[segment] = _endPointY[segment - 1];\n\t\t\t\t\t\tif (mirror == 0 || i%2==0)\n\t\t\t\t\t\t\tv.addDegree(_geneticCode.getGene(j).getTheta());\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tv.addDegree(-_geneticCode.getGene(j).getTheta());\n\t\t\t\t\t} else {\n\t\t\t\t\tif (_geneticCode.getGene(j).getBranch() == 0) {\n\t\t\t\t\t\t_startPointX[segment] = 0;\n\t\t\t\t\t _startPointY[segment] = 0;\n\t\t\t\t\t if (mirror == 0 || i%2==0)\n\t\t\t\t\t\t\tv.addDegree(_geneticCode.getGene(j).getTheta());\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tv.addDegree(-_geneticCode.getGene(j).getTheta());\n\t\t\t\t\t} else {\n\t\t\t\t\t\t_startPointX[segment] = _endPointX[(i * sequence) + _geneticCode.getGene(j).getBranch() - 1];\n\t\t\t\t\t _startPointY[segment] = _endPointY[(i * sequence) + _geneticCode.getGene(j).getBranch() - 1];\n\t\t\t\t\t if (mirror == 0 || i%2==0)\n\t\t\t\t\t\t\tv.addDegree(_geneticCode.getGene(j).getTheta());\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tv.addDegree(-_geneticCode.getGene(j).getTheta());\n\t\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Apply the vector to the starting point to get the ending point.\n\t\t\t\t_endPointX[segment] = (int) FastMath.round(v.getX() + _startPointX[segment]);\n\t\t\t\t_endPointY[segment] = (int) FastMath.round(v.getY() + _startPointY[segment]);\n\t\t\t // Calculate the bounding rectangle of this organism\n\t\t\t left = Math.min(left, _endPointX[segment]);\n\t\t\t right = Math.max(right, _endPointX[segment]);\n\t\t\t top = Math.min(top, _endPointY[segment]);\n\t\t\t bottom = Math.max(bottom, _endPointY[segment]);\n\t\t\t}\n\t\t}\n\t\t_sizeRect.setBounds(left, top, right-left+1, bottom-top+1);\n\t\t// image center\n\t\tcenterX = (left+right)>>1;\n\t\tcenterY = (top+bottom)>>1;\n\t\t_mass = 0;\n\t\t_I = 0;\n\t\tfor (i=0; i<_segments; i++) {\n\t\t\t// express points relative to the image center\n\t\t\t_startPointX[i]-=centerX;\n\t\t\t_startPointY[i]-=centerY;\n\t\t\t_endPointX[i]-=centerX;\n\t\t\t_endPointY[i]-=centerY;\n\t\t\t// calculate points distance of the origin and modulus\n\t\t\t_m1[i] = FastMath.sqrt(_startPointX[i]*_startPointX[i]+_startPointY[i]*_startPointY[i]);\n\t\t\t_m2[i] = FastMath.sqrt(_endPointX[i]*_endPointX[i]+_endPointY[i]*_endPointY[i]);\n\t\t\t_m[i] = FastMath.sqrt(FastMath.pow(_endPointX[i]-_startPointX[i],2) +\n FastMath.pow(_endPointY[i]-_startPointY[i],2));\n\t\t\t_mass += _m[i];\n\t\t\t_mphoto[i] = (0.6 + (0.48 / (double)sequence) + (1.44 / (double)symmetry)) * _m[i];\n\t\t\t// calculate inertia moment\n\t\t\t// the mass center of a segment is its middle point\n\t\t\tcx = (_startPointX[i] + _endPointX[i]) / 2d;\n\t\t\tcy = (_startPointY[i] + _endPointY[i]) / 2d;\n\t\t\t// add the effect of this segment, following the parallel axis theorem\n\t\t\t_I += FastMath.pow(_m[i],3)/12d +\n\t\t\t\t_m[i] * cx*cx + cy*cy;// mass * length^2 (center is at 0,0)\n\t\t}\n\t}",
"private boolean twoHalfOpt(int i, int j) {\n\t\tint li = (i == 0) ? 0 : this.route.get(i - 1);\n\t\tint ri = (i == this.length() - 1) ? 0 : this.route.get(i + 1);\n\t\tint rj = (j == this.length() - 1) ? 0 : this.route.get(j + 1);\n\n\t\tint curtime = dist(li, route.get(i)) + dist(route.get(i), ri) + dist(route.get(j), rj);\n\t\tint nxttime = dist(li, ri) + dist(route.get(j), route.get(i)) + dist(route.get(i), rj);\n\n\t\tif (nxttime >= curtime)\n\t\t\treturn false;\n\n\t\tif (i < j) {\n\t\t\t// cyclicLeftRotate(i, ..., j)\n\t\t\tint t = route.get(i);\n\t\t\tdo {\n\t\t\t\troute.set(i, route.get(i + 1));\n\t\t\t} while (++i < j);\n\t\t\troute.set(j, t);\n\t\t} else {\n\t\t\t// cyclicRightRotate(j+1, ..., i)\n\t\t\tint t = route.get(i);\n\t\t\tdo {\n\t\t\t\troute.set(i, route.get(i - 1));\n\t\t\t} while (--i > j);\n\t\t\troute.set(j + 1, t);\n\t\t}\n\t\tthis.time += nxttime - curtime; // < 0.\n\t\treturn true;\n\t}",
"private void coins_fW(){\n\t\tthis.cube[4] = this.cube[0]; \n\t\tthis.cube[0] = this.cube[6];\n\t\tthis.cube[6] = this.cube[8];\n\t\tthis.cube[8] = this.cube[2];\n\t\tthis.cube[2] = this.cube[4];\n\t}",
"public void setPoints(int numOfIter) {\n\t\tint x = getX();\n\t\tint y = getY();\n\t\tint w = getW();\n\t\tint h = getH();\n\t\th = ((int) (getH() - w*0.29));\n\t\tint numOfSides = 3 * power(4, numOfIter);\n\t\n\t\t\n\t\tif(numOfIter == 0) {\n\t\t\txPointsD = new double[numOfSides];\n\t\t\tyPointsD = new double[numOfSides];\n\t\t\t\n\t\t\txPointsD[2] = x;\n\t\t\tyPointsD[2] = y + h;\n\t\t\t\n\t\t\txPointsD[1] = (double) x + ((double) w)/2;\n\t\t\tyPointsD[1] = y;\n\t\t\t\n\t\t\txPointsD[0] = x + w;\n\t\t\tyPointsD[0] = y + h;\n\t\t} else {\n\t\t\tsetPoints(numOfIter - 1);\n\t\t\tint numOfSidesBefore = xPoints.length;\n\t\t\tdouble[] xPointsDB = xPointsD;\n\t\t\tdouble[] yPointsDB = yPointsD;\n\t\t\txPointsD = new double[numOfSides];\n\t\t\tyPointsD = new double[numOfSides];\n\t\t\t\n\t\t\tfor(int i = 0; i < numOfSidesBefore; i++) {\n\t\t\t\txPointsD[4*i] = xPointsDB[i];\n\t\t\t\tyPointsD[4*i] = yPointsDB[i];\n\t\t\t\t\n\t\t\t\tdouble nextXPointsDB;\n\t\t\t\tdouble nextYPointsDB;\n\t\t\t\tif(i < numOfSidesBefore - 1) {\n\t\t\t\t\tnextXPointsDB = xPointsDB[i+1];\n\t\t\t\t\tnextYPointsDB = yPointsDB[i+1];\n\t\t\t\t} else {\n\t\t\t\t\tnextXPointsDB = xPointsDB[0];\n\t\t\t\t\tnextYPointsDB = yPointsDB[0];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//4i + 1 --> U = (2A+B)/3\n\t\t\t\txPointsD[4*i + 1] = (2 * xPointsDB[i] + nextXPointsDB)/3;\n\t\t\t\tyPointsD[4*i + 1] = (2 * yPointsDB[i] + nextYPointsDB)/3;\n\t\t\t\t\n\t\t\t\t//4i + 2 --> this one is complicated --> V = U + (AB/3)*(cos(ang(AB) + pi.3), sin(ang(AB) + pi/3))\n\t\t\t\tdouble angAB = Math.atan2(nextYPointsDB-yPointsDB[i], nextXPointsDB-xPointsDB[i]);\n\t\t\t\txPointsD[4*i + 2] = xPointsD[4*i + 1] + \n\t\t\t\t\t\t(Math.sqrt((nextXPointsDB - xPointsDB[i])*(nextXPointsDB - xPointsDB[i]) +\n\t\t\t\t\t\t\t\t(nextYPointsDB - yPointsDB[i])*(nextYPointsDB - yPointsDB[i]))/3.0) *\n\t\t\t\t\t\tMath.cos(angAB + Math.PI/3.0); \n\t\t\t\t\n\t\t\t\tyPointsD[4*i + 2] = yPointsD[4*i + 1] + \n\t\t\t\t\t\t(Math.sqrt((nextXPointsDB - xPointsDB[i])*(nextXPointsDB - xPointsDB[i]) +\n\t\t\t\t\t\t\t\t(nextYPointsDB - yPointsDB[i])*(nextYPointsDB - yPointsDB[i]))/3.0) *\n\t\t\t\t\t\tMath.sin(angAB + Math.PI/3.0);\n\t\t\t\t\n\t\t\t\t//4i + 3 --> W = (A + 2B)/3\n\t\t\t\txPointsD[4*i + 3] = (xPointsDB[i] + 2 * nextXPointsDB)/3;\n\t\t\t\tyPointsD[4*i + 3] = (yPointsDB[i] + 2 * nextYPointsDB)/3;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\txPoints = new int[numOfSides];\n\t\tyPoints = new int[numOfSides];\n\t\tfor(int i = 0; i < numOfSides; i++) {\n\t\t\txPoints[i] = (int) xPointsD[i];\n\t\t\tyPoints[i] = (int) yPointsD[i];\n\t\t}\n\t\t\n\t}",
"Triangle (double side1, double side2, double side3){\n this.side1 = side1;\n this.side2 = side2;\n this.side3 = side3;\n }",
"private static void solution() {\n for (int i = 0; i < n; i++) {\n Coord here = coords[i]; // start, end, dir, gen\n for (int j = 0; j < here.gen; j++) {\n // Rotate degree of 90.\n List<Pair> changed = rotate(here.coord, here.endPoint);\n boolean first = true;\n for(Pair p: changed){\n if(first) {\n here.endPoint = new Pair(p.x, p.y);\n first = false;\n }\n here.coord.add(new Pair(p.x, p.y));\n }\n }\n }\n // count the number of squares enclosing all angles with dragon curve\n for (int i = 0; i < n; i++) {\n for(Pair p: coords[i].coord)\n board[p.y][p.x] = true;\n }\n int cnt = 0;\n for (int i = 0; i < 100; i++)\n for (int j = 0; j < 100; j++)\n if(board[i][j] && board[i + 1][j] && board[i][j + 1] && board[i + 1][j + 1])\n cnt += 1;\n System.out.println(cnt);\n }",
"public static void main(String[] args) {\n\t\tfor(int j=0;j<8;j++){\n\t\t\tfor(int i=0;i<8;i++){\n\t\t\t\t//上下两侧\n\t\t\t\tif(j==0||j==7){\n\t\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t}else{\n\t\t\t\t\t//中间\n\t\t\t\t\tif(i>0&&i<7){\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"private double triangleBase() {\n return cellWidth() / BASE_WIDTH;\n }",
"public void step() {\n\n if (n8) {\n // Your code here\n \n \n //by here, after your code, the cellsNext array should be updated properly\n }\n\n if (!n8) { // neighbours-4\n // your code here\n\n //by here, after your code, the cellsNext array should be updated properly\n }\n\n // Flip the arrays now.\n stepCounter++;\n\ttmp = cellsNow;\n cellsNow = cellsNext;\n\tcellsNext = tmp;\n\n }",
"public int isConnectFour(){\n if(values.length < 4 && values[0].length < 4)\r\n return 0;\r\n // horizontal check\r\n for(int i = 0; i < values.length; i++){\r\n for(int j = 0; j < values[0].length - 3; j++){ // only check to 4th last column\r\n if(values[i][j] == 0)\r\n continue;\r\n else if(values[i][j] == 1 && values[i][j] == values[i][j + 1] && values[i][j] == values[i][j + 2] && values[i][j] == values[i][j + 3] ){ // check for 4 consecutive 1 matches\r\n tokenArray[i][j].setWinner(true); // set 4 tokens as winners\r\n tokenArray[i][j + 1].setWinner(true);\r\n tokenArray[i][j + 2].setWinner(true);\r\n tokenArray[i][j + 3].setWinner(true);\r\n return 1;\r\n }\r\n else if(values[i][j] == 2 && values[i][j] == values[i][j + 1] && values[i][j] == values[i][j + 2] && values[i][j] == values[i][j + 3] ){ // check for 4 consecutive 2 matches\r\n tokenArray[i][j].setWinner(true);\r\n tokenArray[i][j + 1].setWinner(true);\r\n tokenArray[i][j + 2].setWinner(true);\r\n tokenArray[i][j + 3].setWinner(true);\r\n return 2;\r\n }\r\n }\r\n }\r\n // vertical check\r\n for(int i = 0; i < values.length - 3; i++){ // only check to 4th last row\r\n for(int j = 0; j < values[0].length; j++){\r\n if(values[i][j] == 0)\r\n continue;\r\n else if(values[i][j] == 1 && values[i][j] == values[i + 1][j] && values[i][j] == values[i + 2][j] && values[i][j] == values[i + 3][j] ){ // check for 4 consecutive 1 matches\r\n tokenArray[i][j].setWinner(true);\r\n tokenArray[i + 1][j].setWinner(true);\r\n tokenArray[i + 2][j].setWinner(true);\r\n tokenArray[i + 3][j].setWinner(true);\r\n return 1;\r\n }\r\n else if(values[i][j] == 2 && values[i][j] == values[i + 1][j] && values[i][j] == values[i + 2][j] && values[i][j] == values[i + 3][j] ){ // check for 4 consecutive 2 matches\r\n tokenArray[i][j].setWinner(true);\r\n tokenArray[i + 1][j].setWinner(true);\r\n tokenArray[i + 2][j].setWinner(true);\r\n tokenArray[i + 3][j].setWinner(true);\r\n return 2;\r\n }\r\n }\r\n }\r\n // diagonal check (top-left to bottom-right)\r\n for(int i = 0; i < values.length - 3; i++){ // only check to 4th last row\r\n for(int j = 0; j < values[0].length - 3; j++){ // only check to 4th last column\r\n if(values[i][j] == 0)\r\n continue;\r\n else if(values[i][j] == 1 && values[i][j] == values[i + 1][j + 1] && values[i][j] == values[i + 2][j + 2] && values[i][j] == values[i + 3][j + 3] ){ // check for 4 consecutive 1 matches\r\n tokenArray[i][j].setWinner(true);\r\n tokenArray[i + 1][j + 1].setWinner(true);\r\n tokenArray[i + 2][j + 2].setWinner(true);\r\n tokenArray[i + 3][j + 3].setWinner(true);\r\n return 1;\r\n }\r\n else if(values[i][j] == 2 && values[i][j] == values[i + 1][j + 1] && values[i][j] == values[i + 2][j + 2] && values[i][j] == values[i + 3][j + 3] ){ // check for 4 consecutive 2 matches\r\n tokenArray[i][j].setWinner(true);\r\n tokenArray[i + 1][j + 1].setWinner(true);\r\n tokenArray[i + 2][j + 2].setWinner(true);\r\n tokenArray[i + 3][j + 3].setWinner(true);\r\n return 2;\r\n }\r\n }\r\n }\r\n // diagonal check (top-right to bottom-left)\r\n for(int i = 0; i < values.length - 3; i++){\r\n for(int j = 3; j < values[0].length; j++){\r\n if(values[i][j] == 0)\r\n continue;\r\n else if(values[i][j] == 1 && values[i][j] == values[i + 1][j - 1] && values[i][j] == values[i + 2][j - 2] && values[i][j] == values[i + 3][j - 3] ){ // check for 4 consecutive 1 matches\r\n tokenArray[i][j].setWinner(true);\r\n tokenArray[i + 1][j - 1].setWinner(true);\r\n tokenArray[i + 2][j - 2].setWinner(true);\r\n tokenArray[i + 3][j - 3].setWinner(true);\r\n return 1;\r\n }\r\n else if(values[i][j] == 2 && values[i][j] == values[i + 1][j - 1] && values[i][j] == values[i + 2][j - 2] && values[i][j] == values[i + 3][j - 3] ){ // check for 4 consecutive 2 matches\r\n tokenArray[i][j].setWinner(true);\r\n tokenArray[i + 1][j - 1].setWinner(true);\r\n tokenArray[i + 2][j - 2].setWinner(true);\r\n tokenArray[i + 3][j - 3].setWinner(true);\r\n return 2;\r\n }\r\n }\r\n }\r\n return 0;\r\n }",
"public static Long compactForwardAlgorithm(ArrayList<Integer>[] graph) {\n // define injective function eta - takes O(n log(n)) time\n Set<Pair<Integer, ArrayList<Integer>>> pairs = Utils.getSortedArrays(graph);\n Map<Integer, Integer> etas = Utils.getEtasMap(pairs);\n\n // sort adjacency arrays according to eta\n pairs.forEach(p -> Collections.sort(p.getSecond(), new Comparator<Integer>() {\n @Override\n public int compare(Integer first, Integer second) {\n if (etas.get(first) > etas.get(second))\n return 1;\n else\n return -1;\n }\n }));\n\n int triangleCount = 0;\n\n // main part, in which we actually count triangles\n Iterator<Pair<Integer, ArrayList<Integer>>> iterator = pairs.iterator();\n while (iterator.hasNext()) {\n Pair<Integer, ArrayList<Integer>> pair = iterator.next();\n Integer v = pair.getFirst();\n ArrayList<Integer> v_neighbors = graph[v];\n\n for (int u : v_neighbors) {\n if (etas.get(u) > etas.get(v)) {\n ArrayList<Integer> u_neighbors = graph[u];\n\n Iterator<Integer> uIterator = u_neighbors.iterator(), vIterator = v_neighbors.iterator();\n\n if (uIterator.hasNext() && vIterator.hasNext()) {\n Integer u_ = uIterator.next(), v_ = vIterator.next();\n while (uIterator.hasNext() && vIterator.hasNext() && etas.get(u_) < etas.get(v)\n && etas.get(v_) < etas.get(v)) {\n if (etas.get(u_) < etas.get(v_))\n u_ = uIterator.next();\n else if (etas.get(u_) > etas.get(v_))\n v_ = vIterator.next();\n else {\n triangleCount++;\n u_ = uIterator.next();\n v_ = vIterator.next();\n }\n }\n\n }\n }\n }\n }\n return new Long(triangleCount);\n }",
"public static Vector4 right()\n {\n return new Vector4(1,0,0,0);\n }",
"public static Shape getStar(float size, boolean invert)\n {\n \tGeneralPath gp = new GeneralPath();\n \tdouble c1 = Math.cos(2.0 * Math.PI / 5.0) * size;\n \tdouble c2 = Math.cos(Math.PI / 5.0) * size;\n \tdouble s1 = Math.sin(2.0 * Math.PI / 5.0) * size;\n \tdouble s2 = Math.sin(4.0 * Math.PI / 5.0) * size;\n \t\n \tdouble mult = 1;\n \tif (invert)\n \t\tmult = -1;\n \tPoint2D.Double ptA = new Point2D.Double(0, size * mult);\n \tPoint2D.Double ptB = new Point2D.Double(-s1, c1 * mult);\n \tPoint2D.Double ptC = new Point2D.Double(s1, c1 * mult);\n \tPoint2D.Double ptD = new Point2D.Double(-s2, -c2 * mult);\n \tPoint2D.Double ptE = new Point2D.Double(s2, -c2 * mult);\n \tLine2D.Double lineAD = new Line2D.Double(ptA, ptD);\n \tLine2D.Double lineAE = new Line2D.Double(ptA, ptE);\n \tLine2D.Double lineBC = new Line2D.Double(ptB, ptC);\n \tLine2D.Double lineBE = new Line2D.Double(ptB, ptE);\n \tLine2D.Double lineDC = new Line2D.Double(ptD, ptC);\n \tPoint2D i1 = getIntersection(lineAD, lineBC);\n \tPoint2D i2 = getIntersection(lineAE, lineBC);\n \tPoint2D i3 = getIntersection(lineAD, lineBE);\n \tPoint2D i4 = getIntersection(lineAE, lineDC);\n \tPoint2D i5 = getIntersection(lineDC, lineBE);\n \t\n \tgp.moveTo((float)ptA.x, (float)ptA.y);\n \tgp.lineTo((float)i2.getX(), (float)i2.getY());\n \tgp.lineTo((float)ptC.x, (float)ptC.y);\n \tgp.lineTo((float)i4.getX(), (float)i4.getY());\n \tgp.lineTo((float)ptE.x, (float)ptE.y);\n \tgp.lineTo((float)i5.getX(), (float)i5.getY());\n \tgp.lineTo((float)ptD.x, (float)ptD.y);\n \tgp.lineTo((float)i3.getX(), (float)i3.getY());\n \tgp.lineTo((float)ptB.x, (float)ptB.y);\n \tgp.lineTo((float)i1.getX(), (float)i1.getY());\n \tgp.closePath();\n \t\n \treturn gp;\n }",
"public void draw() {\n if (numSides <= 6) {\n System.out.println(\"- - - - - -\");\n \n for (int i = numSides - 2; i < numSides; i++) {\n System.out.print(\" | \");\n for (int j = 0; j < this.value ; j++) {\n if (value == 1) {\n System.out.print(\" \");\n }\n if (i % 2 == 0) {\n System.out.print(\"*\");\n } else {\n System.out.print(\" \");\n }\n if (value == 1) {\n System.out.print(\" \");\n }\n }\n }\n System.out.println(\"\");\n System.out.println(\"- - - - - -\");\n } else {\n print();\n }\n }",
"public double getAngle(int[][] tab) {\n\t\tdouble[] res= new double[4];int resi=0;\n\t\tint cmpt=0;\n\t\tint angle=0;\n\t\tfor (int i=0;i<tab.length;i++) {\n\t\t\tif (!(tab[i][0]==0) || !(tab[i][1]==0))\n\t\t\t\tcmpt++;\n\t\t}\n\t\t\n\t\tif (cmpt<=1) {\n\t\t\t return 0; //RIP CODE\n\t\t}\n\t\t\n\t\tfor (int i=1;i<tab.length && (!(tab[i][0]==0) || !(tab[i][1]==0));i++) {\n\t\t\tfor(int c=1;i<tab.length && (tab[c][0]!=0 || tab[c][1]!=0);i++)\n\t\t\t{\n\t\t\t\tint diffx=tab[i-1][0]-tab[i][0];\n\t\t\t\tint diffy=tab[i-1][1]-tab[i][1];\n\t\t\t\t\n\t\t\t\tdouble yb=tab[i][1];\n\t\t\t\tdouble xb=tab[i][0];\n\t\t\t\tdouble ya=tab[i-1][1];\n\t\t\t\tdouble xa=tab[i-1][0];\n\t\t\t\t\n\t\t\t\tdouble pointy,pointx;\n\t\t\t\tpointy=yb; \t\t\t\t\t\t\t//pointy/x = coord du 3e point de triangle rectangle\n\t\t\t\tpointx=xa;\t\t\t\t\n\t\t\t\t\n\t\t\t\tdouble dhypo=Math.sqrt(Math.pow(xb-xa,2)+Math.pow(yb-ya,2));\t//(yb-ya)/(xb-xa)\n\t\t\t\tdouble dadj=Math.sqrt(Math.pow(xb-pointx, 2)+Math.pow(yb-pointy, 2));\t//adjacent / rapport a xb,yb\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (dhypo<img.getWidth() && dhypo!=0) {\t\t//deux points selectionnees sont des diagonales\n\t\t\t\t\tdouble retour=Math.acos(dadj/dhypo)*(180/Math.PI);\n\t\t\t\t\tif (retour>90/2)\n\t\t\t\t\t\tretour=180-90-retour;\n\t\t\t\t\t\n\t\t\t\t\tif((xa<xb && ya<yb )||( xb<xa && yb<ya))\t\t\t\t//point de droite plus haut que celui de gauche\n\t\t\t\t\t\treturn -retour;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn retour;\n\t\t\t\t}\n\t\t\t\t/*else {\t\t\t//deux points sont en diagonnale\n\t\t\t\t\tdouble retour=Math.acos(dadj/dhypo)*(180/Math.PI);\t\t// ne marche pas \n\t\t\t\t\treturn (Math.abs(45-retour)/2);\n\t\t\t\t\t\n\t\t\t\t}*/\n\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\t\t\n\t\treturn 0;\n\t}",
"@NotNull\n private Coordinate flipH() {\n angle = 180 - angle;\n Coordinate nextCenterPointCoordinate = new Coordinate(\n this.centerPointCoordinate.getXCoordinate() - (Constants.BULLET_SPEED * Math.cos(Math.toRadians(90 - angle))),\n this.centerPointCoordinate.getYCoordinate());\n return nextCenterPointCoordinate;\n }",
"public static void main(String[] args) {\n\t\t\r\n\t\tfor (int i = 1; i <= 5; i++) {\r\n\t\t\tfor (int j = 1; j <= i; j++) {\r\n\t\t\t\tif (j<=1) {\r\n\t\t\t\tfor (int m = 5 - j; m >= i; m--) {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t}}\r\n\t\t\t\tSystem.out.print(\"* \");\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\r\n\t}",
"public static void main(String[] args) {\n\r\n for (int x = 1; x < 10; x++) {// x=1\r\n\r\n for (int h = 1; h < 10; h++) { // h=1+1+1...8+1\r\n\r\n System.out.println(x + \"*\" + h \"=\" +x*h);// 1-2-3....8-9\r\n\r\n if(h==2){\r\n break;\r\n }\r\n }\r\n\r\n if(x==4){\r\n continue;\r\n }\r\n\r\n }\r\n\r\n }",
"public static void main(String[] args) {\n\t\tfor(int i = 0; i<=4; i++) {\r\n\t\t\tfor(int j = 5; j>i; j--) {\r\n\t\t\t\tSystem.out.print(\"*\");\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}",
"private static int[] post4(int[] input) {\n int indexFor = 0;\n for (int i = input.length - 1; i >= 0; i--) {\n if (input[i] == 4) {\n indexFor = i;\n break;\n }\n }\n // 1. done\n int size = input.length - indexFor - 1;\n // 2. done\n int[] output = new int[size];\n // 2.5. done\n /* for (int i = size - 1; i >= 0; i--) {\n output[i] = input[input.length + i - size];\n }*/\n for (int i = 0; i < size; i++) {\n output[i] = input[i + indexFor + 1];\n }\n // 3. done\n return output;\n }",
"public Boolean estTriangleEquilateral() {\n\t\t// initialisation du retour\n\t\tBoolean retour = false;\n\n\t\t// calcul de AB la distance entre le premier et le troisieme point\n\t\tdouble AB = this.premier.calculerDistance(this.troisieme);\n\n\t\t// calcul de AC la distance entre le premier et le deuxieme point\n\t\tdouble AC = this.premier.calculerDistance(this.deuxieme);\n\n\t\t// calcul de BC la distance entre le deuxieme et le troisieme point\n\t\tdouble BC = this.deuxieme.calculerDistance(this.troisieme);\n\n\t\t//test\n\t\tif (AB == AC && AB == BC)\n\t\t\tretour = true;\n\n\t\t// retour\n\t\treturn retour;\n\t}",
"public void invert() {\n \n float[] result = new float[16];\n System.arraycopy(IDENTITY, 0, result, 0, 16);\n \n for(int i = 0; i < 4; i++){\n int i4 = i*4;\n \n // make sure[i,i] is != 0\n \n for(int j = 0; matrix[i4+i] == 0 && j < 4; j++){\n if(j != i && matrix[j*4+i] != 0){\n transform(i, 1, j, matrix, result);\n }\n }\n \n // ensure tailing 0s\n \n for(int j = 0; j < i; j++){\n if(matrix[i4+j] != 0){\n transform(i, -matrix[i4+j]/matrix[j*4+j], j, matrix, result);\n }\n }\n\n if(matrix[i4+i] == 0){\n throw new IllegalArgumentException(\"Not invertable\");\n }\n\n // dump(\"row \"+i+\" leading zeros\", matrix, result);\n }\n \n for(int i = 3; i >= 0; i--){\n int i4 = i*4;\n if(matrix[i4+i] != 1){\n float f = matrix[i4+i];\n matrix[i4+i] = 1;\n for(int j = 0; j < 4; j++){\n result[i4+j] /= f;\n if(j > i){\n matrix[i4+j] /= f;\n }\n }\n }\n\n// dump(\"row \"+i+\" leading 1\", matrix, result);\n \n for(int j = i+1; j < 4; j++){\n if(matrix[i*4+j] != 0){\n transform(i, -matrix[i*4+j], j, matrix, result);\n }\n }\n\n// dump(\"row \"+i+\" tailing 0\", matrix, result);\n\n }\n\n matrix = result;\n }",
"public void makeNeighboursOrientationConsistent(ScalarOperator sop,\n\t\t\tFlagMap flags) {\n\t\tStack<Object[]> upcoming = new Stack<Object[]>();\n\t\tTriangleElt3D current = this;\n\t\tdo {\n\t\t\t// set visited status\n\t\t\tflags.add(current);\n\n\t\t\tfor (int i = 0; i < 3; i++) {\n\t\t\t\tTriangleElt3D nb = current.getNeighbour(i);\n\t\t\t\tif (nb != null && (!flags.check(nb))) {\n\t\t\t\t\tupcoming.push(new Object[] { i, nb, current });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tObject[] nbObj = null;\n\t\t\ttry {\n\t\t\t\tnbObj = upcoming.pop();\n\t\t\t} catch (EmptyStackException ese) {\n\t\t\t\t// do nothing\n\t\t\t}\n\t\t\tint index = -1;\n\t\t\tTriangleElt3D nb = null;\n\t\t\tTriangleElt3D current2 = null;\n\t\t\tif (nbObj != null) {\n\t\t\t\tindex = (Integer) nbObj[0];\n\t\t\t\tnb = (TriangleElt3D) nbObj[1];\n\t\t\t\tcurrent2 = (TriangleElt3D) nbObj[2];\n\t\t\t}\n\n\t\t\tif ((nb != null) && (!flags.check(nb))) {\n\t\t\t\t// if not already visited\n\n\t\t\t\t// point indices of common edge (common edge has (in this)\n\t\t\t\t// direction p1->p2)\n\t\t\t\tint p1 = (index + 1) % 3;\n\t\t\t\tint p2 = (index + 2) % 3;\n\n\t\t\t\tint j = 0;\n\n\t\t\t\t// find nb's index j for opposite point of common edge\n\t\t\t\tfor (j = 0; j < 3; j++)\n\t\t\t\t\tif (!(current2.getPoint(p1).isEqual(nb.getPoint(j), sop) || current2\n\t\t\t\t\t\t\t.getPoint(p2).isEqual(nb.getPoint(j), sop)))\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t// nb's index for first point of common edge\n\t\t\t\tj = (j + 1) % 3;\n\n\t\t\t\tif (current2.getPoint(p1).isEqual(nb.getPoint(j), sop))\n\t\t\t\t\tnb.invertOrientation();\n\n\t\t\t\t// orientNeighbours for nb\n\t\t\t}\n\t\t\tcurrent = nb;\n\n\t\t} while (upcoming.size() != 0 || current != null);\n\n\t}",
"public Triangle(){\n\t\tside1=1.0;\n\t\tside2=1.0;\n\t\tside3=1.0;\n\t}",
"void reverseDirection();",
"private int fourOfaKind() {\n\t\tif (hand[1].getValueIndex() == hand[2].getValueIndex() && hand[2].getValueIndex() == hand[3].getValueIndex()) {\n\t\t\tif (hand[0].getValueIndex() == hand[1].getValueIndex()\n\t\t\t\t\t|| hand[4].getValueIndex() == hand[3].getValueIndex()) {\n\t\t\t\tresult.setPrimaryValuePos(hand[3].getValueIndex());\n\t\t\t\t\n\t\t\t\tif( result.getPrimaryValuePos() == hand[4].getValueIndex()) {\n\t\t\t\t\tresult.setSecondaryValuePos(hand[0].getValueIndex());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tresult.setSecondaryValuePos(hand[4].getValueIndex());\n\t\t\t\t}\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}",
"private void rotate() {\n byte tmp = topEdge;\n topEdge = leftEdge;\n leftEdge = botEdge;\n botEdge = rightEdge;\n rightEdge = tmp;\n tmp = reversedTopEdge;\n reversedTopEdge = reversedLeftEdge;\n reversedLeftEdge = reversedBotEdge;\n reversedBotEdge = reversedRightEdge;\n reversedRightEdge = tmp;\n tmp = ltCorner;\n ltCorner = lbCorner;\n lbCorner = rbCorner;\n rbCorner = rtCorner;\n rtCorner = tmp;\n\n }",
"public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }",
"public static void incorrect4() {\r\n\r\n System.out.println(\" *---*\");\r\n System.out.println(\" | |\");\r\n System.out.println(\" 0 |\");\r\n System.out.println(\" /|\\\\ | Incorrect - 4\");\r\n System.out.println(\" |\");\r\n System.out.println(\" |\");\r\n System.out.println(\"==========\");\r\n }",
"public static void main(String[] args) {\n int i= 1; int j=1;\r\n\t\t/*for(i=1; i<=6; i++){\r\n\t\t\tfor(j=1; j<=6-i; j++){\r\n\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t }\r\n\t\t\t for(j=1; j<=i; j++){\r\n\t\t\t\tSystem.out.print(\"*\");\r\n\t\t\t } for(j=1; j<=6; j++){\r\n\t\t} System.out.print(\"*\");\r\n\t\t System.out.println();\r\n\t\t}\r\n\t\t*/\r\n\t\r\nfor(i=1; i<=7;i++){\r\n\tfor(j=1; j<=7-i; j++){\r\n\t\tSystem.out.println(\" \");\r\n\t}\r\n\tfor(j=1; j<=i; j++){\r\n\t\tSystem.out.print(\"*\");\r\n\t\r\n\t}\r\n}\r\n\r\n\t\t\r\n\t\t/*int num = 6;\r\n\t\tfor(i=1; i<=num; i++){\r\n\t\t\tfor(j=1; j<=num+1-i; j++){\r\n\t\t\t\tSystem.out.print(\"*\");\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t\t*/\r\n\t\t\r\n\t\tint num = 6;\r\n\t\tfor(i=1; i<=num; i++){\r\n\t\t\tfor(j=1; j<=num+6-i; j++){\r\n\t\t\t\tSystem.out.print(\"*\");\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t/******* i=1 *=6\r\n\t\t***** i=2 *=5\r\n\t\t**** i=3 *=4\r\n\t\t*** i=4 *=3\r\n\t\t** i=5 *=2\r\n\t\t* i=6 *=1\r\n\t\t *=7 -i=6+1-i=num+1-i\r\n\t\t*/\r\n\t\t\r\n\t\t\r\n\t/*\t****** i=1 * =6\r\n\t\t ***** i=2 * = 5\r\n\t\t ***\r\n\t\t **\r\n\t\t *\r\n\t\t\r\n\t*/\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tfor(i=1; i<=num; i++){\r\n\t\t\tfor(j=1; j<=i-1; j++){\r\n\t\t\t\tSystem.out.println(\" \");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}",
"@Test\n\t\tpublic void orderTest () {\n\t\t\tassertTrue (Demo.isTriangle(2, 1, 4));\t\n\t\t}",
"public static void main(String[] args) {\n\n short angle1 = 0;\n short angle2 = 180;\n short angle3 = 0;\n\n int sumOfAngles = angle1 + angle2 + angle3;\n\n boolean validTriangle = sumOfAngles == 180;\n\n if (validTriangle){\n System.out.println(\"the shape is a triangle\");\n }\n if(!validTriangle){\n System.out.println(\"the shape is not valid\");\n }\n\n\n\n\n\n }",
"public String toString(){\n\t\treturn (\"this triangle has side 1 of length\"+side1+\"side 2 of length\"+side2+\"and side 3 of length\"+side3);\n\t}",
"private void backwardIteration() {\n\t\t// variables declaration\n\t\tint ortho;\n\t\tint diago;\n\t\tint diag2;\n\t\tint newVal;\n\n\t\t// Process last line: consider only the pixel just after (on the right)\n\t\tfor (int i = width - 2; i > 0; i--) {\n\t\t\tif (maskProc.getPixel(i, height - 1) != maskLabel)\n\t\t\t\tcontinue;\n\n\t\t\tnewVal = buffer.get(i + 1, height - 1) + weights[0];\n\t\t\tupdateIfNeeded(i, height - 1, newVal);\n\t\t}\n\n\t\t// last pixel of penultimate line: consider the 3 pixels below\n\t\tif (maskProc.getPixel(width - 1, height - 2) == maskLabel) {\n\t\t\tortho = buffer.get(width - 1, height - 1);\n\t\t\tdiago = buffer.get(width - 2, height - 1);\n\t\t\tdiag2 = buffer.get(width - 3, height - 1);\n\t\t\tnewVal = min3w(ortho, diago, diag2);\n\t\t\tupdateIfNeeded(width - 1, height - 2, newVal);\n\t\t}\n\n\t\t// penultimate pixel of penultimate line: consider right pixel, and the 4 pixels below\n\t\tif (maskProc.getPixel(width - 2, height - 2) == maskLabel) {\n\t\t\tortho = min(buffer.get(width - 1, height - 2), buffer.get(width - 2, height - 1));\n\t\t\tdiago = min(buffer.get(width - 1, height - 1), buffer.get(width - 3, height - 1));\n\t\t\tdiag2 = buffer.get(width - 4, height - 1);\n\t\t\tnewVal = min3w(ortho, diago, diag2);\n\t\t\tupdateIfNeeded(width - 2, height - 2, newVal);\n\t\t}\n\n\t\t// Process regular pixels of penultimate line\n\t\tfor (int i = width - 3; i > 0; i--) {\n\t\t\tif (maskProc.getPixel(i, height - 2) != maskLabel)\n\t\t\t\tcontinue;\n\n\t\t\t// minimum distance of neighbor pixels\n\t\t\tortho = min(buffer.get(i + 1, height - 2), buffer.get(i, height - 1));\n\t\t\tdiago = min(buffer.get(i - 1, height - 1), buffer.get(i + 1, height - 1));\n\t\t\tdiag2 = min(buffer.get(i - 2, height - 1), buffer.get(i + 2, height - 1));\n\t\t\t\n\t\t\t// compute new distance of current pixel\n\t\t\tnewVal = min3w(ortho, diago, diag2);\n\n\t\t\t// modify current pixel if needed\n\t\t\tupdateIfNeeded(i, height - 2, newVal);\n\t\t}\n\n\t\t// Process regular lines\n\t\tfor (int j = height - 3; j >= 0; j--) {\n\n\t\t\t// process last pixel of the current line: consider pixels\n\t\t\t// down, down-left and (-2,+1)\n\t\t\tif (maskProc.getPixel(width - 1, j) == maskLabel) {\n\t\t\t\tortho = buffer.get(width - 1, j + 1);\n\t\t\t\tdiago = buffer.get(width - 2, j + 1);\n\t\t\t\tdiag2 = buffer.get(width - 3, j + 1);\n\t\t\t\tnewVal = min3w(ortho, diago, diag2);\n\t\t\t\tupdateIfNeeded(width - 1, j, newVal);\n\t\t\t}\n\n\t\t\n\t\t\t// process penultimate pixel of current line\n\t\t\tif (maskProc.getPixel(width - 2, j) == maskLabel) {\n\n\t\t\t\t// minimum distance of neighbor pixels\n\t\t\t\tortho = min(buffer.get(width - 1, j), buffer.get(width - 2, j + 1));\n\t\t\t\tdiago = min(buffer.get(width - 3, j + 1), buffer.get(width - 1, j + 1));\n\t\t\t\tdiag2 = min3(\n\t\t\t\t\t\tbuffer.get(width - 3, j + 2), \n\t\t\t\t\t\tbuffer.get(width - 1, j + 2), \n\t\t\t\t\t\tbuffer.get(width - 4, j + 1));\n\t\t\t\t\n\t\t\t\t// compute new distance of current pixel\n\t\t\t\tnewVal = min3w(ortho, diago, diag2);\n\n\t\t\t\t// modify current pixel if needed\n\t\t\t\tupdateIfNeeded(width - 2, j, newVal);\n\t\t\t}\n\n\t\t\t// Process pixels in the middle of the current line\n\t\t\tfor (int i = width - 3; i > 1; i--) {\n\t\t\t\t// process only pixels inside structure\n\t\t\t\tif (maskProc.getPixel(i, j) != maskLabel)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// minimum distance of neighbor pixels\n\t\t\t\tortho = min(buffer.get(i + 1, j), buffer.get(i, j + 1));\n\t\t\t\tdiago = min(buffer.get(i - 1, j + 1), buffer.get(i + 1, j + 1));\n\t\t\t\tdiag2 = min(\n\t\t\t\t\t\tmin(buffer.get(i - 1, j + 2), buffer.get(i + 1, j + 2)),\n\t\t\t\t\t\tmin(buffer.get(i - 2, j + 1), buffer.get(i + 2, j + 1)));\n\t\t\t\t\n\t\t\t\t// compute new distance of current pixel\n\t\t\t\tnewVal = min3w(ortho, diago, diag2);\n\n\t\t\t\t// modify current pixel if needed\n\t\t\t\tupdateIfNeeded(i, j, newVal);\n\t\t\t}\n\n\t\t\t// process second pixel of current line: consider pixels right,\n\t\t\t// down-right and down\n\t\t\tif (maskProc.getPixel(1, j) == maskLabel) {\n\t\t\t\tortho = min(buffer.get(2, j), buffer.get(1, j + 1));\n\t\t\t\tdiago = min(buffer.get(0, j + 1), buffer.get(2, j + 1));\n\t\t\t\tdiag2 = min3(buffer.get(3, j + 2), buffer.get(2, j + 1), buffer.get(0, j + 1));\n\t\t\t\tnewVal = min3w(ortho, diago, diag2);\n\t\t\t\tupdateIfNeeded(1, j, newVal);\n\t\t\t}\n\n\t\t\t// process first pixel of current line: consider pixels right,\n\t\t\t// down-right and down\n\t\t\tif (maskProc.getPixel(0, j) == maskLabel) {\n\t\t\t\tortho = min(buffer.get(1, j), buffer.get(0, j + 1));\n\t\t\t\tdiago = buffer.get(1, j + 1);\n\t\t\t\tdiag2 = min(buffer.get(2, j + 2), buffer.get(1, j + 1));\n\t\t\t\tnewVal = min3w(ortho, diago, diag2);\n\t\t\t\tupdateIfNeeded(0, j, newVal);\n\t\t\t}\n\n\t\t} // end of processing for current line\n\t\t \n\t}",
"public void Down4()\r\n {\r\n if(By2>0 && By2<900){\r\n \r\n By2+=2.5;\r\n }\r\n }",
"public static void main(String[] args) {\n\r\n\t\t\r\n\t\tint n = 7;\r\n\t\tfor (int i = n; i >= 0; i--) {\r\n\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t for(int j=0; j<n-i; j++) {\r\n\t\t\t \r\n\t\t\t System.out.print(\" \");\r\n\t\t\t \r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t \r\n\r\n\t\t\tfor (int j = n; j >= n-i; j--) {\r\n\r\n\t\t\t\tSystem.out.print(\"*\");\r\n\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t}\r\n\r\n\t\t\r\n\t}",
"public abstract GF2nElement square();",
"public boolean isStraight() {\r\n int[] temp = getIntArr();\r\n\r\n return temp[1] == temp[0] + 1 && temp[2] == temp[1] + 1 && temp[3] == temp[2] + 1 && temp[4] == temp[3] + 1;\r\n }",
"public static void main(String[] args) {\n\t\tScanner cin = new Scanner(System.in);\n\t\tint a = cin.nextInt();\n\t\tint b = cin.nextInt();\n\t\tint c = cin.nextInt();\n\t\tint isTrigle = 0;\n\t\tif(a+b<c||a+c<b||b+c<a)System.out.println(\"Not triangle\");\n\t\telse {\n\t\t\tif(Math.pow(a,2)==Math.pow(b,2)+Math.pow(c,2)||\n\t\t\t Math.pow(b,2)==Math.pow(a,2)+Math.pow(c,2)||\n\t\t\t Math.pow(c,2)==Math.pow(b,2)+Math.pow(a,2)){\n\t\t\t isTrigle = 1;\t\n\t\t\t System.out.println(\"Right triangle\");\n\t\t\t}\n\t\t\tif(Math.pow(a,2)>Math.pow(b,2)+Math.pow(c,2)||\n\t\t\t Math.pow(b,2)>Math.pow(a,2)+Math.pow(c,2)||\n\t\t\t Math.pow(c,2)>Math.pow(b,2)+Math.pow(a,2)){\n\t\t\t\tisTrigle = 1;\n\t\t\t\tSystem.out.println(\"Obtuse triangle\");\n\t\t\t}\n\t\t\tif(isTrigle==0)System.out.println(\"Acute triangle\");\n\t\t\tif(a==b||b==c||a==c)System.out.println(\"Isosceles triangle\");\n\t\t\tif(a==b&&b==c&&a==c)System.out.println(\"Equilateral triangle\");\n\t\t\t\n\t\t}\n\t\t \n\t\t\n\t}",
"public void quadTest()\n\t{\n\t\tint index = 0, lim = 3;\n\t\tboolean quads = false;\n\t\t\n\t\twhile (index<=lim && (!quads))\n\t\t{\n\t\t\tif ((intRep[index] == intRep[index+1]) &&\n\t\t\t\t(intRep[index] == intRep[index+2]) &&\n\t\t\t\t(intRep[index] == intRep[index+3]) )\n\t\t\t{\n\t\t\t\tquads = true;\n\t\t\t\thandScore = 70000;\n\t\t\t\thandScore += 100 * intRep[index];\n\t\t\t}\n\t\t\telse index++;\n\t\t}\n\t}",
"public int[] getForward() { return _forwardDiag; }",
"@Override\n\tpublic double perimeter() {\n\t\treturn edge*4;\n\t}",
"private void arretes_fO(){\n\t\tthis.cube[40] = this.cube[37]; \n\t\tthis.cube[37] = this.cube[39];\n\t\tthis.cube[39] = this.cube[43];\n\t\tthis.cube[43] = this.cube[41];\n\t\tthis.cube[41] = this.cube[40];\n\t}",
"@Override\n\tpublic void sanjiao() {\n\t\t\tfor (int i = 1; i <5; i++) {\n\t\t\t\tfor(int j=1;j<=2*i-1;j++){\n\t\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t}",
"public static int Main()\n\t{\n\t\tint x;\n\t\tint y;\n\t\tint i;\n\t\tint j;\n\t\tx = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\ty = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\tfor (i = 1;x / i > 0;i = i * 2)\n\t\t{\n\t\t;\n\t\t}\n\t\tfor (j = 1;y / j > 0;j = j * 2)\n\t\t{\n\t\t;\n\t\t}\n\t\ti = i / 2;\n\t\tj = j / 2; //i,j????2?????\n\t\tif (i > j)\n\t\t{\n\t\t\tx = x * j / i;\n\t\t}\n\t\telse\n\t\t{\n\t\t\ty = y * i / j;\n\t\t}\n\t\twhile (x != y)\n\t\t{\n\t\t\tx = x / 2;\n\t\t\ty = y / 2;\n\t\t}\n\t\tSystem.out.print(x);\n\n\n\n\n\n\n\t}"
] | [
"0.64197826",
"0.6190301",
"0.577011",
"0.57138103",
"0.55821675",
"0.54976666",
"0.54873",
"0.5341357",
"0.5310173",
"0.5296051",
"0.5284554",
"0.52647746",
"0.5264587",
"0.52631307",
"0.52427566",
"0.5195914",
"0.5180714",
"0.51633555",
"0.51431614",
"0.5133967",
"0.5119935",
"0.5102896",
"0.50519997",
"0.5047535",
"0.50429463",
"0.5038416",
"0.503762",
"0.50202155",
"0.5015305",
"0.5007795",
"0.4999701",
"0.49989837",
"0.49943268",
"0.49942636",
"0.49822006",
"0.4961688",
"0.49613684",
"0.49610648",
"0.4955592",
"0.49411947",
"0.49332693",
"0.4928999",
"0.49254608",
"0.49244377",
"0.49053997",
"0.49024573",
"0.49001005",
"0.48657084",
"0.48577696",
"0.48471",
"0.48408285",
"0.48378173",
"0.4837722",
"0.48369262",
"0.48269472",
"0.4826743",
"0.48240334",
"0.48207238",
"0.48171112",
"0.48137805",
"0.48085523",
"0.48018768",
"0.47965255",
"0.47896963",
"0.47893664",
"0.4787168",
"0.4783021",
"0.47787005",
"0.4774544",
"0.4772361",
"0.47709185",
"0.47683305",
"0.4763626",
"0.47610056",
"0.47578672",
"0.47569662",
"0.47554678",
"0.47545525",
"0.4752499",
"0.4750847",
"0.47503075",
"0.4749869",
"0.47498232",
"0.47475272",
"0.47434688",
"0.47420868",
"0.47302955",
"0.4729969",
"0.4726003",
"0.4722706",
"0.4720305",
"0.47105515",
"0.47090155",
"0.47077456",
"0.47030413",
"0.4698039",
"0.4692796",
"0.46913078",
"0.468403",
"0.46838674"
] | 0.53510576 | 7 |
9.Side Program increse the space | public static void ninethProgram() {
for(int i=1;i<=4;i++) {
for(int j=4-1;j>=i;j--) {
System.out.print(" ");
}for(int k=1;k<=4;k++) {
System.out.print("*");
}System.out.println();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) {\n\t\t\r\n\t\tint i, x=4,w=9,q;\r\n\t\tfor(i=-1;i<20;i+=3) {\r\n\t\t\tx++;\r\n\t\t\tfor(q=4;q<11;q++) {\r\n\t\t\t\tdo {\r\n\t\t\t\t\ti=+3;\r\n\t\t\t\t\tw=sizeof(i);\r\n\t\t\t\t\ti=x+w;\r\n\t\t\t\t\tx=w+i;\r\n\t\t\t\t\t\t\r\n\t\t\t\t} while (x<15);\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"x:\"+x+\"i:\"+i);\r\n\r\n\t}",
"public void originalSpace() {\n\t\tpos.x = 65;\n\t\tpos.y = p.height/2 + 100;\n\t\t\n\t}",
"public static void tenthProgram() {\n\t\tfor(int i=1;i<=4;i++) {\n\t\t\tfor(int j=1;j<=i-1;j++) {\n\t\t\t\tSystem.out.print(\" \");\t\t\t\n\t\t\t}for(int k=1;k<=4;k++) {\n\t\t\t\tSystem.out.print(\"*\");\t\t\n\t\t\t}System.out.println();\n\t\t}\n\t}",
"public static void spaces() {\r\n // prints 13 spaces\r\n for (int space = 0; space < 15; space++) {\r\n System.out.println(\"\");\r\n }\r\n\r\n }",
"private void assignSpacePerimeter()\n {\n\n }",
"static int growing()\n\t\t{\n\t\t\t\n\t\t\n\t\t\tfor(int i=1;i<=3;i++){\n\t\t\theight=height+i;\n\t\t\t\n\t\t\tSystem.out.println(height);}\n\t\t\treturn 0;\n\t\t}",
"public void enlargeSquare()\n {\n squareSize++;\n }",
"public void Grasshopper(){\n this.hops = 2;\n this.hopLim = 3;\n }",
"private int addShift( int x ) { x += _nxx; int sz = H2O.CLOUD.size(); return x < sz ? x : x-sz; }",
"public static void main(String[] args) {\n\t\tScanner obj=new Scanner(System.in);\r\n\t\tint a=0;\r\n\t\tint count=0;\r\n System.out.println(\"enter size\");\r\n\t\ta=obj.nextInt();\r\n\t\tint m=2*a+1;\r\n\t\tint n=2*a+2;\r\n\t\tint mid=(m+1)/2;\r\n\t\tfor(int i=1;i<=m;i++)\r\n\t\t{\r\n\t\t\tcount=0;\r\n\t\t\tfor(int j=1;j<=n;j++)\r\n\t\t\t{\r\n\t\t\t\tcount++;\r\n\t\t\t\tif((i==1)||(i==m)||(j==1)||(j==n))//frame begin\r\n\t\t\t\t{\r\n\t\t\t\t\tif((i==1)||(i==m))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"+\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t {\r\n\t\t\t\t\t\t\tSystem.out.print(\"|\");//frame left and right\r\n\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//frame end\r\n\t\t\t\telse if (i<mid)//upper-half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t for(int l=1;l<=2*i-4;l++)\r\n\t\t\t\t {\r\n\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\tSystem.out.print(\"\\\\\");\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end of upper half\r\n\t\t\t\telse if(i>mid)//lower half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tfor(int k=mid;k<i;k++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t System.out.print(\"\\\\\");\r\n\t\t\t\t\t for(int l=2*m-6;l>2*i-4;l--)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t }\r\n\t\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t\t for(int k=mid;k<i;k++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t\t\t}//end of lower half\r\n\t\t\t\telse if(i==mid)//middle part\r\n\t\t\t\t{\r\n\t\t\t\t\tif(j==2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\"<\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(j==n-1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\">\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(i%2==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"=\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end\r\n\t\t\t}//end-of-j\r\n\t\t\tSystem.out.println();\r\n\t\t}//end\r\n\r\n\t}",
"public static void main(String[] args) {\n\n System.out.println(\"Tafel van 55 als variabel x:\");\n System.out.println();\n\n int x = 55;\n\n System.out.println(\"1 x \" + x + \" = \" + x);\n System.out.println(\"2 x \" + x + \" = \" + x*2);\n System.out.println(\"3 x \" + x + \" = \" + x*3);\n System.out.println(\"4 x \" + x + \" = \" + x*4);\n System.out.println(\"5 x \" + x + \" = \" + x*5);\n System.out.println(\"6 x \" + x + \" = \" + x*6);\n System.out.println(\"7 x \" + x + \" = \" + x*7);\n System.out.println(\"8 x \" + x + \" = \" + x*8);\n System.out.println(\"9 x \" + x + \" = \" + x*9);\n System.out.println(\"10 x \" + x + \" = \" + x*10);\n\n\n System.out.println();\n System.out.println(\"─────────────────────────────\");\n System.out.println();\n\n // Tafel van 13 als variabel a.\n\n System.out.println(\"Tafel van 13 als variabel a:\");\n System.out.println();\n\n int a = 13;\n int b = 1;\n int c = 1;\n\n System.out.println(b++ + \" x \" + a + \" = \" + a*c++);\n System.out.println(b++ + \" x \" + a + \" = \" + a*c++);\n System.out.println(b++ + \" x \" + a + \" = \" + a*c++);\n System.out.println(b++ + \" x \" + a + \" = \" + a*c++);\n System.out.println(b++ + \" x \" + a + \" = \" + a*c++);\n System.out.println(b++ + \" x \" + a + \" = \" + a*c++);\n System.out.println(b++ + \" x \" + a + \" = \" + a*c++);\n System.out.println(b++ + \" x \" + a + \" = \" + a*c++);\n System.out.println(b++ + \" x \" + a + \" = \" + a*c++);\n System.out.println(b + \" x \" + a + \" = \" + a*c);\n\n System.out.println();\n System.out.println(\"─────────────────────────────\");\n System.out.println();\n\n // Tafel van 22 als variabel d.\n\n System.out.println(\"Tafel van 22 als variabel d:\");\n System.out.println();\n\n int d = 22;\n int e = 1;\n\n System.out.println(e + \" x \" + d + \" = \" + d*e++);\n System.out.println(e + \" x \" + d + \" = \" + d*e++);\n System.out.println(e + \" x \" + d + \" = \" + d*e++);\n System.out.println(e + \" x \" + d + \" = \" + d*e++);\n System.out.println(e + \" x \" + d + \" = \" + d*e++);\n System.out.println(e + \" x \" + d + \" = \" + d*e++);\n System.out.println(e + \" x \" + d + \" = \" + d*e++);\n System.out.println(e + \" x \" + d + \" = \" + d*e++);\n System.out.println(e + \" x \" + d + \" = \" + d*e++);\n System.out.println(e + \" x \" + d + \" = \" + d*e);\n\n }",
"protected void newSize() {\r\n adjustSize();\r\n halt();\r\n newGame();\r\n }",
"public static void main(String[] args) {\n\n int oldCapacity = 4;\n System.out.println(oldCapacity + (oldCapacity >> 1));\n\n /*Solution solution = new Solution();\n// System.out.println(solution.numRollsToTarget(2, 6, 7));\n\n int[] ints = solution.loudAndRich(new int[][]{\n *//* {1, 0},\n {2, 1},\n {3, 1},\n {3, 7},\n {4, 3},\n {5, 3},\n {6, 3}\n }, new int[]{3, 2, 5, 4, 6, 1, 7, 0});*//*\n\n }, new int[]{0, 1});\n Printer.print(ints);*/\n }",
"private void grow(){\n\t\tberries.replaceAll((p, v) -> v + 1);\n\t\tapples.replaceAll((p, v) -> v + 1);\n\t}",
"public void sizeIncrease1() {\n\t\t _size++;\n\t}",
"private void spiral() {\n\t\t// If in top right, increase size and go down right.\n\t\tif(xtraversed == size && ytraversed == size){\n\t\t\tsize++;\n\t\t\tmemory.nextMove = GameConstants.SOUTHEAST;\n\t\t\tytraversed--;\n\t\t\txtraversed++;\n\t\t}\n\t\t\n\t\t// If in top, go right.\n\t\telse if(ytraversed == size){\n\t\t\tmemory.nextMove = GameConstants.EAST;\n\t\t\txtraversed++;\n\t\t}\n\t\t\n\t\t// If in left, go up.\n\t\telse if(xtraversed == -size){\n\t\t\tmemory.nextMove = GameConstants.NORTH;\n\t\t\tytraversed++;\n\t\t}\n\t\t\n\t\t// If in bottom, go left.\n\t\telse if(ytraversed == -size){\n\t\t\tmemory.nextMove = GameConstants.WEST;\n\t\t\txtraversed--;\n\t\t}\n\t\t\n\t\t// If in right, go down.\n\t\telse if(xtraversed == size){\n\t\t\tmemory.nextMove = GameConstants.SOUTH;\n\t\t\tytraversed--;\n\t\t}\n\t\t\n\t\t// Else go right.\n\t\telse {\n\t\t\tmemory.nextMove = GameConstants.EAST;\n\t\t\txtraversed++;\n\t\t}\n\t}",
"public static void space(int space) {\r\n\t\tfor(int i=0; i<space; i++) {\r\n\t\t\tSystem.out.print(\" \");\r\n\t\t}\r\n\t}",
"private void growSnake() { \r\n length++;\r\n snake[length-1].row = snake[length-2].row;\r\n snake[length-1].column = snake[length-2].column;\r\n if (snake[length-2].direction == UP) snake[length-1].row++;\r\n else if (snake[length-2].direction == DOWN) snake[length-1].row--;\r\n else if (snake[length-2].direction == LEFT) snake[length-1].column++;\r\n else if (snake[length-2].direction == RIGHT) snake[length-1].column--; \r\n }",
"public static void main(String[] args) {\n\t\tint height = 5;\n\t\tint value = 1;\n\t\tint a = 0;\n\t\tint num = 1;\n\t\tint numCount = 1;\n\t\tint spaceCount = height - 1;\n\t\tSystem.out.println(\"below is numeric Traiangle Program\");\n\t\tfor (int i = 0; height > i; i++) {\n\t\t\tfor (a = 0; a < spaceCount ; ++a) {\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\n\t\t\t}\n\t\t\tspaceCount = spaceCount-1 ;\n\t\t\tfor (int b = 0; b < numCount; b++) {\n\t\t\t\tSystem.out.print(num);\n\t\t\t\tnum = num + 1;\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\tnumCount = numCount + 2;\n\t\t\tnum = 1;\n\t\t\t\n\t\t}\n\t\t\n\t}",
"@Override\r\n\tpublic void CalcPeri() {\n\t\tSystem.out.println(4*side);\t\r\n\t}",
"public static void part2(){\n\t\n System.out.println(\"\\\\\"); //Outer wall\n System.out.println(\"\\\\\");\n System.out.println(\"\\\\\");\n for(int i = 0; i <= 16; i++){ //loop created to display top of the door\n\n \tSystem.out.print(\"-\");\n\n\t}\n System.out.println(\"\");\n System.out.println(\"\\\\\\t\\t| \\t(\\\")\"); //The door and the stick figure\n System.out.println(\"\\\\\\t\\t|\\t-|-\");\n System.out.println(\"\\\\\\t o | \\t |\");\n System.out.println(\"\\\\\\t\\t|\\t /\\\\\");\n System.out.println(\"\\\\\\t\\t|\\t/ \\\\\");\n\t\t\n }",
"public void increase() {\r\n\r\n\t\tincrease(1);\r\n\r\n\t}",
"public void act() {\n\t\tsuper.act();\n\t\t//Gracias www.trucoteca.com\n\t\tif(control && shift && n) {\n\t\t\tthis.x = Ventana.getInstancia().getBola().getX();\n\t\t}\n\t\t//Si quieres ser legal\n\t\telse {\n\t\tthis.x += this.vx;\n\t\t}\n\t\tif(this.x < 0)\n\t\t\tthis.x = 0;\n\t\tif(this.x > Stage.WIDTH - getWidth())\n\t\t\tx = Stage.WIDTH - getWidth();\n\t\t}",
"int incCapacity()\r\n\t{\r\n\t\tint i,j;\r\n\t\tfor (i=0; i<=state; ++i)\r\n\t\t\tfor (j=0; j<=symbol; ++j)\r\n\t\t\t\tg[i][j][state]=g[state][j][i]=false;\r\n\t\treturn (state++);\r\n\t}",
"void increaseStarsBy(final int amount);",
"public static void main(String[] args) {\n\t\tint length = 9;\n\t\tint counter = 1;\n\t\t\tfor ( int x = (length+1)/2; x<=length;x++){\n\t\t\t\tfor (int j = x-counter; j>=0; j--){\n\t\t\t\t\t//System.out.println(\"j is \"+ j);\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\tfor (int i =1;i<=counter;i++){\n\t\t\t\t\t\t\n\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tSystem.out.println();\n\t\t\t\tcounter+=2;\n\t\t\t}\n\t\t\tcounter = length-2;\n\t\t\t\n\t\t\t// length = 9, counter is 7 , j = 1, i = 7, x=8\n\t\t\tfor ( int x = (length-1); x>=(length+1)/2; x--){\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t\tfor (int j = 1; j<=x-counter; j++){\n\t\t\t\t\t//System.out.println(\"j is \"+ j);\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\tfor (int i =counter;i>=1;i--){\n\t\t\t\t\t\t\n\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t}\n\t\t\t\tcounter-=2;\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t}",
"public static void main(String[] args) {\nint n1=20;\r\nn1 =50;\r\nSystem.out.println(n1);\r\nn1+=50;\r\nSystem.out.println(n1);\r\nn1-=30;\r\nSystem.out.println(n1);\r\nn1*=2;\r\nSystem.out.println(n1);\r\n\t}",
"public static void box(){\n System.out.println(\" ********************* ********************* ********************* \");\n System.out.println(\" *** *** *** *** *** *** \");\n System.out.println(\" *** 1 *** *** 2 *** *** 3 *** \");\n System.out.println(\" *** *** *** *** *** *** \");\n System.out.println(\" ********************* ********************* ********************* \"); \n }",
"public static void main(String[] args) {\n int n;\n int i = 1;\n Scanner sc= new Scanner(System.in);\n n = sc.nextInt();\n \n while(i<=n)\n {\n int spaces = 1;\n while(spaces<=n-i)\n {\n System.out.print(' ');\n spaces = spaces + 1;\n }\n int numb = 1;\n while(numb<=i)\n {\n System.out.print('*');\n numb = numb + 1;\n }\n int dec = i - 1;\n while(dec>=1)\n {\n System.out.print('*');\n dec = dec - 1;\n }\n System.out.println();\n i = i +1;\n }\t\n\t}",
"void addSpaces() {\n\t\tSystem.out.print(\" \");\n\t\tfor (int j = 0; j < 3; j++)\n\t\t\tSystem.out.print(\"| \");\n\t\tSystem.out.println(\"|\");\n\t}",
"public static void main(String[] args) {\nint i,space,rows,k=0;\n Scanner sc=new Scanner(System.in);\nSystem.out.print(\"Enter number of rows\");\nrows=sc.nextInt();\nfor(i=1;i<=rows;i++)\n{\n\tfor(space=1;space<=(rows-i);space++)\n\t{\n\t\tSystem.out.print(\" \");\n\t}\n\twhile(k !=(2*i-1))\n\t{\n\t\tSystem.out.print(\"* \");\n\t\tk++;\n\t}\n\tk=0;\n\tSystem.out.println();\n}\n\t}",
"public static void cave() {\n System.out.println(\" ***** * * * * * * * * \");\n System.out.println(\" *** *** \");\n System.out.println(\" *** *** \");\n System.out.println(\" | *** *** \");\n System.out.println(\" | *** *** \");\n System.out.println(\" O __|__ *** *** \");\n System.out.println(\" ******l *** *** \");\n System.out.println(\" * * *** *** \");\n System.out.println(\" * * ********************* * * * * * * \");\n }",
"public static void main(String[] args) {\n\t\tint n=5;\n\t\tfor(int i=n-1;i>=0;i--)\n\t\t{\n\t\t\tfor(int space=0;space<n-1-i;space++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tfor(int j=0;j<=i*2;j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\"* \");\n\t\t\t}\n\t\t\n\t\tSystem.out.println();\n\t}\n\n}",
"public void lowerHalf() {\n\t\t// TODO: Implement\n\t\tint sumOfSlotCounts = getSumOfSlotCount()-1;\n\t\tif(sumOfSlotCounts < 0) return;\n\t\t//if(getSlotCount() == 1 && getSumOfSlotCount() == 1) return;\n\t\tint slot = getSlotCount()-1;\n\t\tint beanNumber = getSlotBeanCount(slot)-1;\n\t\tint deleted=0;\n\t\t//System.out.println(\"sumOfCounts: \" + sumOfSlotCounts);\n\t\twhile(deleted < Math.floor(sumOfSlotCounts / 2) ){\n\t\t\t/*if (slotBean.get(slot).isEmpty()) {\n\t\t\t\tslot++;\n\t\t\t\tbeanNumber = 0;\n\t\t\t\tSystem.out.println(\"slot empty: slot: \" + slot + \" beanN: \" + beanNumber);\n\t\t\t}*/\n\t\t\t\n\t\t\t//System.out.println(\"i: \" + deleted + \" count: \" + getSlotBeanCount(slot)+\" beanNumber: \" + beanNumber);\n\t\t\tif(beanNumber < getSlotBeanCount(slot) && beanNumber >= 0 && getSlotBeanCount(slot) > 0 ) {\n\t\t\t\t//System.out.println(\"slot not empty: slot: \" + slot + \" beanN: \" + beanNumber);\n\t\t\t\tslotBean.get(slot).remove(beanNumber--);\n\t\t\t\tdeleted++;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//System.out.println(\"slot empty: slot: \" + slot + \" beanN: \" + beanNumber);\n\t\t\t\tif(slot >= 0) slot--;\n\t\t\t\tif(getSlotBeanCount(slot) > 0) beanNumber = getSlotBeanCount(slot)-1;\n\t\t\t\telse beanNumber = 0;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t}",
"public static void main(String[] args) {\n\t\tfor(int j=0;j<8;j++){\n\t\t\tfor(int i=0;i<8;i++){\n\t\t\t\t//上下两侧\n\t\t\t\tif(j==0||j==7){\n\t\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t}else{\n\t\t\t\t\t//中间\n\t\t\t\t\tif(i>0&&i<7){\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"public static void fourthProgram() {\n\t\tfor (int i = 1; i <= 4; i++) {\n\t\t\tfor (int j = 4; j > i; j--) {\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tfor (int k = 1; k <= i; k++) {\n\t\t\t\tSystem.out.print(\"*\");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"int pacemodulator() {\n int buckpacedirector = ((rand.nextInt() >> rightshift) & 7);\n int rbuckpacedirector = 0;\n\n rbuckpacedirector = switch (buckpacedirector)\n {\n case 0 -> 2;\n case 1 -> 3;\n case 2 -> 4;\n case 3 -> 5;\n case 4 -> 6;\n case 5 -> 7;\n case 6 -> 8;\n default -> 1;\n };\n return rbuckpacedirector;\n }",
"public static void craft() {\r\n\t\t\r\n\t\tif (ths.page == 5) {\r\n\t\t\tths.page++;\r\n\t\t}\r\n\t}",
"public static void main(String[] args) {\n\t\tint num=4;\r\n\t\tfor(int i=0;i<=num;i++) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor(int j=0;j<=num;j++) {\r\n\t\t\t\t\t\tif(j<=i && i+j>=num) \r\n\t\t\t\t\t\r\n\t\t\t\t\t\tSystem.out.print(\"*\");\r\n\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tSystem.out.println();\r\n\t\t\t\t\t\t}\r\n\t\t\t}",
"public static void main(String[] args) {\n\t\t\r\n\t\tint k,n=10;\r\n\t\tk=n-1;\r\n\t\tfor(int i=0;i<=n;i++)\r\n\t\t{\r\n\t\t\tfor(int j=0;j<=k;j++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\tk=k-1;\r\n\t\t\tfor(int j=0;j<=i;j++)\r\n\t\t\t\tSystem.out.print(\"*\"+\" \");\r\n\t\t\tSystem.out.println(\"\\r\");\r\n\t\t}\r\n\t}",
"public static void main(String[] Args){\n Scanner n = new Scanner(System.in);\n int N = n.nextInt();\n int j = 1;\n int count = 1;\n while (j <= N){\n if ((3*count + 2) % 4 == 0){\n count++;\n }\n else {\n System.out.print(3*count + 2);\n System.out.print(\" \");\n j++;\n count++;\n }\n }\n }",
"public void calculate(){\n\t\tint temp = new Random().nextInt();\r\n\t\tint width = temp;\r\n\t\twidth++;\r\n\t\tclass Inner {\r\n\t\t\tpublic void multiply(){\r\n\t\t\t\tSystem.out.println(length* width);\r\n\t\t\t}\r\n\t\t}\r\n\t\tInner inner = new Inner();\r\n\t\tinner.multiply();\r\n\t}",
"public static void main(String[] args) {\n\r\n\t\tfor(int i = 1; i <= 6; i++) {\r\n\t\t\tSystem.out.print(\"*\");\r\n\t\t}\r\n\t\tSystem.out.println(\"\\n\");\r\n\t\t\r\n\t\t\r\n\t\tfor(int j = 1; j <= 4; j++) {\r\n\t\t\tfor(int i = 1; i <= 6; i++) {\r\n\t\t\t\tSystem.out.print('*');\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t\t/*\t\t\t\tj(行号)\t\tk(*的个数)\r\n\t\t*\t\t\t\t1\t\t\t1\r\n\t\t**\t\t\t\t2\t\t\t2\r\n\t\t***\t\t\t\t3\t\t\t3\r\n\t\t****\t\t\t4\t\t\t4\r\n\t\t*****\t\t\t5\t\t\t5\r\n\t\t*/\r\n\t\t\r\n\t\tfor (int j = 1; j <= 5;j++) {//控制行数\r\n\t\t\tfor(int k = 1; k <= j; k++) {//控制列数\r\n\t\t\t\tSystem.out.print(\"*\");\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t\t/*\t\t\t\tj(行号)\t\tk(*的个数)\t规律:j + k = 5 换句话说:k = 5 - j;\r\n\t\t****\t\t\t1\t\t\t4\r\n\t\t***\t\t\t\t2\t\t\t3\r\n\t\t**\t\t\t\t3\t\t\t2\r\n\t\t*\t\t\t\t4\t\t\t1\r\n\t\t*/\r\n\t\t\r\n\t\tfor (int j = 1; j <= 4;j++) {//控制行数\r\n\t\t\tfor(int k = 1; k <= 5 - j; k++) {//控制列数\r\n\t\t\t\tSystem.out.print(\"*\");\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\r\n\t}",
"public static void main(String[] args) {\n\t\tSystem.out.println(swapCount(20));\n\t\tswapPath(3, 'A', 'B', 'C');\n\t\n\t}",
"public void Increase()\n {\n Increase(1);\n }",
"public static void main003(String[] args) {\n\t\t/*\n\t\t * numberStart++ tra ve gia tri cua numberStart, sau đo tang number lan mot đon vi\n\t\t * numberStart-- tra ve gia tri cua numberStart, sau đo giam number xuong mot đon vi\n\t\t * ++numberStart tang numberStart len mot don vi, sau đo tra ve gia tri cua numberStart\n\t\t * --numberStart giam numberStart xuong mot don vi, sau đo tra ve gia tri cua numberStart\n\t\t */\n\t\tint numberStart\t= 20;\n\t\tint numberEnd\t= 0;\n\t\t\n//\t\tnumberEnd\t\t= ++numberStart;\n\t\tnumberEnd\t\t= --numberStart;\n\t\tSystem.out.println(\"Number Start = \" + numberStart);\n\t\tSystem.out.println(\"Number End = \" + numberEnd);\n\t}",
"public void distribute(short side, short position) {\r\n\tplay(side, position, this.territory, false);\r\n }",
"public static void main(String[] args) {\n\t\tint k =1;\n\t\twhile(k < 20){\n\t\t\tif ((k % 3)==1){\n\t\t\t\tSystem.out.print(k + \" \");\n\t\t\t}\n\t\t\tk++;\n\t\t}\n\t}",
"public void grow(int cap) {}",
"public static void main(String[] args) {\n\t\tint a = 10;\n\t\tSystem.out.println(\"the score is\" + a);\n\t\t\n\t\t\n\t\t// a = a + 2\n\t\ta+=2;\n\t\tSystem.out.println(a);\n\t\t\t\t\n\t\t\n\t\t\n\t\tint k = 10;\n\t\t\n\t\tk -= 1; // k = k - 1;\n\t\t\n\t\tSystem.out.println(k);\n\t\t\n\t\tk/= 2; // k = k/2\n\t\tSystem.out.println(k);\n\t\t\n\t\tint j = 10;\n\t\tj = j + 2;\n\t\tj += 2;\n\t\tj++; // ++j;\n\t\tSystem.out.println(j);\n\t\tint c = 10;\n\t\tc++;\n\t\tSystem.out.println(\"c++ is \" + c);\n\t\tint d = 10;\n\t\t++d;\n\t\tSystem.out.println(\"s++ is \" + d);\n\t\t\n\t}",
"void increase();",
"void increase();",
"public void shrinkSquare()\n {\n squareSize--;\n }",
"public static void main (String [] args) {\n\t\n\t//num4/=10;\n\t//System.out.println(num4);\n//\t\n\t//num4%=2; num4=4%2;\n\t//System.out.println(num4);\n\t\n\t\n\tint num=100;\n\tnum-=67;\n\tint cakePiece1=11;\n\tcakePiece1/=4;\n\tint cakePiece=25;\n\tcakePiece%=7;\n\t\t\tSystem.out.println(num);\n\t\t\tSystem.out.println(cakePiece1);\n\t\t\tSystem.out.println(cakePiece);\n\t\n\t\n\t\n\t\n\t\n\t}",
"public void moveRight() {\r\n\t\tif (x < space.getSize() - 1) x++; \r\n\t}",
"public void redimensionar() {\n\t\tthis.numCub *= 1.5;\n\t}",
"public static void main(String[] args) {\n\t\tint j=2;\n\t\twhile(j < 10){\n\t\t\tfor(int i = 1; i <10; i ++){//for(1;2;3)1放初始條件2放繼續執行條件3執行後行為\n\t\t\t\tSystem.out.print(j + \"X\" + i + \"=\" + j*i + \" \");\n\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println(); // 換行\n\t\t\tj++; // J遞增才能跳出迴圈\n\t\t}\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\tint num=5;\r\n\t\tint c=num*2-1;//5\r\n\t\tfor(int j=0 ; j< c ; j++){//j: 0, 1, 2,3 4\r\n\t\t\t\r\n\t\t\tif(j<num) {///j: 0, 1, 2\r\n\t\t\t\t// 1 ,2,3 : 0+1, 1+1, 2+1\r\n\t\t\t\tfor(int i=0; i<j+1 ; i++) {\r\n\t\t\t\t\tSystem.out.print(\"* \");\r\n\t\t\t\t}\r\n\t\t\t}else {//j: 3,4\r\n\t\t\t\t//2,1 : 5-3, 5-4\r\n\t\t\t\tfor(int i=0; i<c-j ; i++) {\r\n\t\t\t\t\tSystem.out.print(\"* \");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\r\n\t}",
"public void growSnake() {\n\t\tSnakeObj.length++;\n\t\txHead++;\n\t\tyHead++; \n\t\tSnakeArray[xHead][yHead] = 1; \n\t\tthis.repaint(); \n\t}",
"public static void main(String[] args) {\n\t\tint n1=1,n2=1;\r\n\t\tint n3;\r\n\t\tSystem.out.print(n1+\" \"+n2);\r\n\t\t\r\n\t\tfor(int i=0;i<=20;i++) {\r\n\t\t\tn3=n1+n2;\r\n\t\t\tn1=n2;\r\n\t\t\tn2=n3;\r\n\t\t\t\tSystem.out.print(\" \"+n3);\r\n\t\t}\r\n\t\t\r\n\t}",
"public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t\tchar space = ' ';\n\t\t\n\t\tfor(int i = 1; i <= 5; i++){\n\t\t\tfor(int l=5-i; l>=1; l--){\n\t\t\t\tSystem.out.print(space);\n\t\t\t}\n\t\t\tfor(int j = 1; j <= i; j++){\n\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\tSystem.out.print(space);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tfor(int i = 1; i <= 5; i++){\n\t\t\tfor(int l = 1; l<i; l++){\n\t\t\t\tSystem.out.print(space);\n\t\t\t}\n\t\t\tfor(int j = 5; j >= i; j--){\n\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\tSystem.out.print(space);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"public static void main(String[] args) {\n int height;\n Scanner scan = new Scanner(System.in);\n System.out.println(\"Nhập chiều cao hình tam giác\");\n height = scan.nextInt();\n for(int i = 1; i <= height; ++i) {\n for(int j = height; j >i; --j) \n System.out.print(\" \");\n for(int j = 1 ; j <= 2 * i - 1; ++j) \n System.out.print(\"*\");\n System.out.println(\"\");\n }\n }",
"public static void main(String[] args) {\n // ***\n // *****\n // *******\n // *********\n // *******\n // *****\n // ***\n // *\n System.out.println(\"PROBLEM 1: \");\n int numOfLines = 9;\n int midLine = (numOfLines+1)/2;\n // upper part\n for (int i = 1; i <= midLine; i++){\n //space\n for (int s = 1; s<=(midLine-i); s++){\n System.out.print(\" \");\n }\n //star\n for (int j =1; j<=(i*2-1); j++){\n System.out.print(\"*\");\n }\n System.out.println();\n }\n //Lower part\n for(int i =1;i <=(midLine-1);i++) {\n\n\n //space\n for (int s = 1; s <= i; s++){\n System.out.print(\" \");\n }\n //star\n for (int j= 1; j<=(midLine-i)*2-1; j++){\n System.out.print(\"*\");\n }\n System.out.println();\n\n }\n\n\n// Problem 2\n// Given the number of rows, create a triangle with that many rows.\n// For example, if rows = 5 then\n// *\n// **\n// ***\n// ****\n// *****\n System.out.println(\"PROBLEM 2: \");\n\n System.out.println(\"Enter the number of line (odd numbers)\");\n Scanner input = new Scanner(System.in);\n int numberOfLines = input.nextInt();\n for (int i = 1; i <= numberOfLines; i++){\n //add stars\n for (int j =1; j<=i; j++){\n System.out.print(\"*\");\n }\n System.out.println();\n\n }\n\n // Problem 3\n // Using the celsius to fahrenheit conversion, product the following table\n // |Celsius|Fahrenheit|\n // | 0 | 32 |\n // | 1 | 33.8 |\n // | 2 | 35.6 |\n // | ... | ... |\n // | 30 | 86 |\n\n System.out.println(\"PROBLEM 3: \");\n\n int celsius = 0;\n double fahrenheit;\n System.out.println(\" | \"+\"celsius\"+\"|\"+\"fahrenheit\"+\"| \");\n\n while(celsius <=30 ) {\n fahrenheit = (9.0/5.0 * celsius) + 32;\n System.out.println(\" | \" + celsius + \" | \" + fahrenheit + \" | \");\n celsius++;\n }\n\n\n // Problem 4\n // Declare a variable x with any value. Determine if x is prime.\n //Dividing the number by 2 does gain us efficiency but how could we make it more efficient? Think about 25,\n // do you need to go up to 12.5? Could you stop at a lower number?\n System.out.println(\"PROBLEM 4: \");\n\n int remainder;\n boolean isPrime = true;\n int numberToCheck = 77;\n\n for (int i = 2; i <= numberToCheck /i; i++) {\n remainder = numberToCheck % i;\n\n\n if (remainder == 0) {\n\n isPrime = false;\n break;\n }\n }\n\n if (isPrime)\n System.out.println(numberToCheck + \" is a Prime numberToCheckber\");\n else\n System.out.println(numberToCheck + \" is not a Prime numberToCheckber\");\n\n\n // Problem 5\n // The Kalebnacci sequence begins with 2 and -1 as its first and second terms.\n // After these first two elements, each subsequent element is equal to twice the previous previous term minus\n // the previous term.\n // kaleb(0) = 2\n // kaleb(1) = -1\n // kaleb(n) = 2*kaleb(n-2) - kaleb(n-1)\n // Find the nth number in the sequence\n\n System.out.println(\"PROBLEM 5: \");\n\n int n = 8;\n int a = 2;\n int b = -1;\n int c;\n System.out.print(a + \" \" + b + \" \");\n for (int i =0; i<n;i++){\n c =2*a-b;\n System.out.print(c + \" \" );\n a=b;\n b=c;\n }\n\n }",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tSystem.out.println(\"Iput the number of rows \");\n\t\tint row = sc.nextInt();\n\t\tfor (int i=1;i<=row;i++) {\n\t\t\tfor (int j=row;j>=i;j--) {\n\t\t\tSystem.out.print(\" \");\n\t\t\tfor(j=1;j<=i;j++) {\n\t\t\t\tSystem.out.print(\" *\");\n\t\t\t}\n\t\tSystem.out.println();\n\t\t\t}\n\t}\n\n}",
"public void resetPaddleWidth(){\n myRectangle.setWidth(myLength);\n }",
"public static void main002(String[] args) {\n\n\t\tint number\t= 20;\n\t\tSystem.out.println(\"Start = \" + number);\n\t\t\n\t\tnumber += 10;\t// number\t= number + 10;\n\t\tnumber -= 10;\t// number\t= number - 10\n\t\tnumber *= 10;\t// number\t= number * 10\n\t\tnumber /= 10;\t// number\t= number / 10\n\t\tnumber %= 10;\t// number\t= number % 10\n\t\tSystem.out.println(\"End = \" + number);\n\t}",
"public static void tip() {\n \t\n for(int tip = 1; tip <= SIZE; tip++) { \t\n for(int spaces = 1; spaces <= SIZE*3; spaces++) { \t\n System.out.print(\" \");\n } \n System.out.println(\"||\"); \n }\n }",
"@Override\n\tpublic void update(){\n\t\t\n\t\tx += dx;\n\t\tif(x <= 2){\n\t\t\tx = 2;\n\t\t}else if(x >= ((this.width+this.paddlewidth)-350)){\n\t\t\tx = (this.width+this.paddlewidth)-350;\n\t\t}else if(x <= Dimensions.PADDLE_LEFT){\n\t\t\tx = Dimensions.PADDLE_LEFT;\n\t\t}\n\t}",
"public static void main(String[] args) {\n\n System.out.println(\"Give me the number of the piramid's lines!\");\n Scanner scanner = new Scanner(System.in);\n int numberOfLines = scanner.nextInt();\n\n int numberOfZeros = numberOfLines-1;\n int numberOfAsterisks = 0;\n\n for (int i = 0; i < numberOfLines; i++) {\n numberOfAsterisks = i * 2 + 1;\n for (int j = 0; j < numberOfZeros; j++) {\n System.out.print(\" \");\n }\n for (int k = 0; k < numberOfAsterisks; k++) {\n System.out.print(\"*\");\n }\n numberOfZeros = numberOfZeros-1;\n System.out.println(\"\");\n }\n }",
"public void act() \r\n {\r\n super.mueve();\r\n super.tocaBala();\r\n super.creaItem();\r\n \r\n if(getMoveE()==0)\r\n {\r\n \r\n if(shut%3==0)\r\n {\r\n dispara();\r\n shut=shut%3;\r\n shut+=1;\r\n \r\n }\r\n else \r\n shut+=1;\r\n }\r\n super.vidaCero();\r\n }",
"private void coins_a1W(){\n\t\tthis.cube[4] = this.cube[15]; \n\t\tthis.cube[15] = this.cube[26];\n\t\tthis.cube[26] = this.cube[38];\n\t\tthis.cube[38] = this.cube[27];\n\t\tthis.cube[27] = this.cube[4];\n\t}",
"public static void main(String[] args) {\n\t\tint c = 7;\r\n\t\tfor(int i=1;i<=4;i++)\r\n\t\t{\r\n\t\t\tfor(int j=0;j<i;j++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.print(c+\" \");\r\n\t\t\t\tc++;\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\r\n\t}",
"public void printSpace(){\n\t\tSystem.out.println(\"Current Space: \"+number);\n\t\tSystem.out.print(\"Type: \"+type);\n\t\tSystem.out.print(\"\\nNext Space(s): \");\n\t\tfor(String n: next){\n\t\t\tSystem.out.print(n +\" \");\t\n\t\t}\n\t\tSystem.out.println(\" \");\n\t}",
"public static void main(String[] args) {\n\t\tRectangle rect = new Rectangle(200, 100);\n\t\tshouldNotChangeWidthIfHeightIsModified(rect);\n\t\tSquare square = new Square(100);\n\t\t//int beforeWidth = square.getWidth();\n\t\t//square.setWidth(square.getWidth()+100);\n\t\tshouldNotChangeWidthIfHeightIsModified(square);\n\t}",
"public void Series() {\n\t\tint n=2;\n\t\twhile (n<=10) {\n\t\t\tSystem.out.print(n+\" \");\n\t\t\tn=n+2;\n\t\t}\n\t/*\tSystem.out.println(n);\n\t\tn=n+2;\n\t\tSystem.out.println(n);\n\t\tn=n+2;\n\t\tSystem.out.println(n);\n\t\tn=n+2;\n\t\tSystem.out.println(n);\n\t\tn=n+2;\n\t\tSystem.out.println(n);\n\t\tn=n+2;*/\n\t}",
"public void draw(){\n for(int i = 1; i <= height; i++){\n for(int s = 1; s <= i; s++)\n System.out.print(\"*\");\n System.out.println();\n }\n }",
"public static int Main()\n\t\t{\n\t\t\tint n;\n\t\t\tint i;\n\t\t\tint wl;\n\t\t\tint len = 0;\n\t\t\tint line = 0;\n\t\t\tString w = new String(new char[64]);\n\t\t\tString tempVar = ConsoleInput.scanfRead();\n\t\t\tif (tempVar != null)\n\t\t\t{\n\t\t\t\tn = Integer.parseInt(tempVar);\n\t\t\t}\n\t\t\tfor (int i = 1; i <= n; i++)\n\t\t\t{\n\t\t\t\tString tempVar2 = ConsoleInput.scanfRead();\n\t\t\t\tif (tempVar2 != null)\n\t\t\t\t{\n\t\t\t\t\tw = tempVar2.charAt(0);\n\t\t\t\t}\n\t\t\t\twl = w.length();\n\t\t\t\tif (line == 0)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.printf(\"%s\",w);\n\t\t\t\t\tlen = wl;\n\t\t\t\t\tline++;\n\t\t\t\t}\n\t\t\t\telse if (len + wl + 1 <= 80)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.printf(\" %s\",w);\n\t\t\t\t\tlen += wl + 1;\n\t\t\t\t}\n\t\t\t\telse if (len + wl + 1 > 80)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.printf(\"\\n%s\",w);\n\t\t\t\t\tlen = wl;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn 0;\n\t\t}",
"public static void part1(){\n \n\t\tfor (int i = 1; i <= 15; i += 2){ \n \n \t\n \tfor (int j = 0; j < i; j++){\n \tSystem.out.print(\"*\");\n \n \t\t}\n \n \t\tSystem.out.println(\"\");\n\t\t\t\n \t}\n \n \t}",
"public static void main(String[] args) {\nint i=1;//display from 20 to 10\nSystem.out.println(\"odd even\");\nwhile(i<=10)\n{\n\tif(i%2!=0) {\n\tSystem.out.println(i+\" \"+(i+1));//for space /t is fine\n\t}\ni++;\n}\n\t}",
"public void spacePressed()\n {\n System.out.println(\"spacePressed()\");\n while (current.translate(1, 0));\n display.showBlocks();\n }",
"public void stepForwad() {\n\t\t\t\n\t\t\tswitch(this.direction) {\n\t\t\t\tcase 0:\n\t\t\t\t\tthis.y += 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tthis.x += 1;\n\t\t\t\t\tthis.y += 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tthis.x += 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tthis.x += 1;\n\t\t\t\t\tthis.y -= 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tthis.y -= 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tthis.x -= 1;\n\t\t\t\t\tthis.y -= 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\tthis.x -= 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 7: \n\t\t\t\t\tthis.x -= 1;\n\t\t\t\t\tthis.y += 1;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tthis.x = (this.worldWidth + this.x)%this.worldWidth;\n\t\t\tthis.y = (this.worldHeight + this.y)%this.worldHeight;\n\t\t}",
"public static void main(String[] args) {\n\n\t\tint number = 20;\n\n\t\twhile (number >= 2) {\n\t\t\tSystem.out.println(number);\n\t\t\tnumber -= 2;\n\n\t\t}\n\t\tSystem.out.println(\"--------01------------\");\n\n\t\tint num = 2;\n\n\t\twhile (num <= 20) {\n\t\t\tSystem.out.println(num);\n\t\t\tnum += 2;\n\t\t}\n\t}",
"public void draw() {\n if (numSides <= 6) {\n System.out.println(\"- - - - - -\");\n \n for (int i = numSides - 2; i < numSides; i++) {\n System.out.print(\" | \");\n for (int j = 0; j < this.value ; j++) {\n if (value == 1) {\n System.out.print(\" \");\n }\n if (i % 2 == 0) {\n System.out.print(\"*\");\n } else {\n System.out.print(\" \");\n }\n if (value == 1) {\n System.out.print(\" \");\n }\n }\n }\n System.out.println(\"\");\n System.out.println(\"- - - - - -\");\n } else {\n print();\n }\n }",
"int main()\n{\n int n;\n cin >>n;\n int m = 11;\n for(int i=0; i<n; i++){\n cout << m*m << \" \";\n m += 4;\n }\n}",
"public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n \n System.out.println(\"Enter value\");\n int n = sc.nextInt();\n \n for (int rowCount = 1; rowCount <= n; rowCount++){\n for (int space = 1; space <=n-rowCount; space++){\n System.out.print(\" \");\n }\n for (int star = 1; star<=rowCount; star++ ){\n System.out.print(\"*\");\n }\n System.out.println(\" \");\n }\n \n \n \n }",
"public static void main(String[] args) {\n\n\t\t\n\t\tSystem.out.println(\"父箆業\" + \"\\t\\t\" + \"鯖箆業\"\n\t\t\t\t+ \"\\t\\t\\t\\t\" + \"鯖箆業\" + \"\\t\\t\" + \"父箆業\");\n\t\tSystem.out.println(\"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\");\n\t\t\n\t\tdouble temp = 120.0;\n\t\t\n\t\tint i;\n\t\tfor (i = 40;i > 30;i--) {\n\t\t\tSystem.out.printf(\"%.1f\\t\\t%.1f\\t\\t\\t\\t\", (double)i, celsiusToFahrenheit((double)i));\n\t\t\tSystem.out.printf(\"%.1f\\t\\t%.2f\\n\", (double)temp, fahrenheitToCelsius((double)temp));\n\t\t\ttemp -= 10;\n\t\t}\n\t\t\n\t}",
"public void loopThroughEdge()\n {\n int margin = 2;\n\n if (getX() < margin) //left side\n { \n setLocation(getWorld().getWidth()+ margin, getY());\n }\n else if (getX() > getWorld().getWidth() - margin) //right side\n {\n setLocation(margin, getY());\n }\n\n if (getY() < margin) //top side\n { \n setLocation(getX(), getWorld().getHeight() - margin);\n }\n else if(getY() > getWorld().getHeight() - margin) //bottom side\n { \n setLocation(getX(), margin);\n }\n }",
"public static void main(String[] args) {\n\n int num1=0,num2=1,sum=0;\n System.out.print(num1+\" \" +num2);\n\n for (int i=1;i<13;i++){\n\n sum=num1+num2;\n\n num1=num2;\n\n num2=sum;\n\n\n System.out.print(\" \" +sum);\n\n\n }\n\n }",
"public AI_SPAC(String [] args){\n\n\t}",
"public static void main(String[] args) {\nint a=10;\nSystem.out.println(a);\na+=2;\nSystem.out.println(a);\na-=2;\nSystem.out.println(a);\na*=2;\nSystem.out.println(a);\na/=2;\nSystem.out.println(a);\na%=2;\nSystem.out.println(a);\n\t}",
"public static void main(String[] args) {\n\t\tint i = 10;\r\n\t\t// i++;\r\n\t\t i=i+1;\r\n\t\t System.out.println(i);\r\n\t\t i=i+2;\r\n\t\t System.out.println(i);\r\n\t\t \r\n\t\t i+=3;\r\n\t\t System.out.println(i);\r\n\t\t \r\n\t\t i++;\r\n\t\t System.out.println(i);\r\n\t\t \r\n\t\t/* j=j+1;\r\n\t\t System.out.println(j); because we did not declare any variable*/\r\n\r\n\t}",
"public void setMaxPaddleLength(){\n myRectangle.setWidth(myScreenWidth - SIDEBAR_WIDTH);\n }",
"void incNetSize(){\r\n\t\t\t\tif (size<500)size+=50;\r\n\t\t\t\telse System.out.println(\"Max net size reached!\");\r\n\t\t\t}",
"public static void main(String[] args) {\n\t\tint i;\n\t\n\t\tfor(i=2 ;i<=20; i=i+2)\n\t\t{\n\t\t\tSystem.out.print(i+\" \");\n\t\t}\n\t\tSystem.out.println(\"\");\n\n\t}",
"public static void main(String[] args) {\n \r\n \t\tint x = 55;\r\n\t\t++x; //1st increase x and then increments. That is pre-increment\r\n\t\tSystem.out.println(x);\r\n\t\t\t\r\n\t\tx++; //1st use x and then increments. That is post-increment\r\n\t\tSystem.out.println(x); \r\n\r\n\t\t\r\n\t\t\r\n//\t\tQUESTION 2\r\n\t\t\r\n\t\tString aa = \"Hello World.\"; //2 Add three strings using Arithmetic Operator\r\n\t\tString ab = \" Cheer me Up.\";\r\n\t\tString ac = \"-Smile Please!\";\r\n\t\t\r\n\t\tSystem.out.println(aa + ab + ac);\r\n\t\t\r\n\t\t\r\n\t\t\r\n//\t\tQUESTION 3\r\n\t\t\r\n\t\tint b = 5;\r\n\t\tSystem.out.println(\"First Number+++++++++\" +b);\r\n\t\tSystem.out.println(\"Second Number+++++++++\" +b);\r\n\t\t\r\n\t\t\r\n//\t\tQUESTION 4\r\n\t\t\r\n\t\tint a1 = 10; int a2 = 20; //3\tWrite code for all asthmatic operator ( + , - , * , / , %)\r\n\t\tint b1 = a1 + a2;\r\n\t\tint c = a1 - a2;\r\n\t\tint d = a1 * a2;\r\n\t\tint e = a2/a1;\r\n\t\tint f = a2%a1;\r\n\t\tSystem.out.println(b1);\r\n\t\tSystem.out.println(c);\r\n\t\tSystem.out.println(d);\r\n\t\tSystem.out.println(e);\r\n\t\tSystem.out.println(f);\r\n\t\t\r\n\t\t\t\t\r\n\t}",
"public void adjust()\n {\n }",
"public static void main(String[] args) {\nint a = 4;\n\na += 2;\na -= 2;\na %= 2;\n\n\nSystem.out.println(a);\n\t\t\n\t\t\n\t\t\n\t}",
"public void makeHeap() {\r\n\t\t//for (int i = (theHeap.size() >> 1) - 1; i >= 0; i--) {\r\n\t\tfor (int i = (theHeap.size() - 1) >> 1; i >= 0; i--) {\r\n\t\t\tsiftDown(i);\r\n\t\t}\r\n\t}",
"private void reclaimSpace(int space)\r\n/* 269: */ {\r\n/* 270:295 */ assert (space >= 0);\r\n/* 271:296 */ this.availableSharedCapacity.addAndGet(space);\r\n/* 272: */ }",
"public static void main(String[] args) {\nint a1=0;\r\nint a2=1;\r\nint a3=a1+a2;\r\nfor(int row=1;row<=5;row++)\r\n{\r\n\tfor(int col=1;col<row;col++)\r\n\t{\r\n\t\tSystem.out.print(a3+\" \");\r\n\t\ta3=a1+a2;\t//0+1=1\t\t1+1=2 \r\n\t\ta1=a2;\t\t//0=1 1=1\t2=2\r\n\t\ta2=a3;\t\t//1=1 1=1\t1=1\r\n\t}\r\n\tSystem.out.println();\r\n}\r\n\t\r\n}"
] | [
"0.61206484",
"0.60454303",
"0.5950857",
"0.58058864",
"0.5774334",
"0.5740659",
"0.5727975",
"0.5667688",
"0.5660359",
"0.56233966",
"0.5588974",
"0.557833",
"0.5561835",
"0.55586326",
"0.5547105",
"0.55401844",
"0.5524561",
"0.5516039",
"0.5514998",
"0.55116063",
"0.55009645",
"0.5483753",
"0.54789996",
"0.547288",
"0.5469803",
"0.5468104",
"0.5463422",
"0.54632854",
"0.5447507",
"0.54466563",
"0.5425388",
"0.5407726",
"0.54058176",
"0.5405421",
"0.54003835",
"0.5399529",
"0.53923976",
"0.53866994",
"0.5385379",
"0.5376974",
"0.5376424",
"0.53643036",
"0.53588045",
"0.53583854",
"0.5356805",
"0.53507704",
"0.53415275",
"0.5339638",
"0.5335982",
"0.53324896",
"0.53255916",
"0.53255916",
"0.53214306",
"0.53112805",
"0.5306429",
"0.5297027",
"0.52880645",
"0.5286351",
"0.5283401",
"0.5278599",
"0.52684355",
"0.5263863",
"0.52629536",
"0.52620095",
"0.5260445",
"0.52566624",
"0.525473",
"0.5254604",
"0.5252059",
"0.5251302",
"0.52471465",
"0.5246911",
"0.52457446",
"0.52429295",
"0.5240555",
"0.5233119",
"0.5223104",
"0.52141726",
"0.5213737",
"0.521359",
"0.52134615",
"0.52113944",
"0.520951",
"0.5207995",
"0.52076817",
"0.52067524",
"0.5204374",
"0.51993245",
"0.51960206",
"0.51909626",
"0.51893234",
"0.518733",
"0.5186699",
"0.51861525",
"0.51845413",
"0.5177649",
"0.5176004",
"0.5175175",
"0.5173145",
"0.51723486"
] | 0.5816078 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.