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 |
|---|---|---|---|---|---|---|
TODO Autogenerated method stub | private void atualizarUsuario(HttpServletRequest request, HttpServletResponse response) throws SQLException, IOException {
int id = Integer.parseInt(request.getParameter("id"));
String nome = request.getParameter("nome");
String email = request.getParameter("email");
int telefone = Integer.parseInt (request.getParameter("telefone"));
String nacionalidade = request.getParameter("nacionalidade");
Usuario book = new Usuario(id, nome, email, telefone, nacionalidade);
dao.atualizarUsuario(book);
response.sendRedirect("lista");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub | private void listarUsuario(HttpServletRequest request, HttpServletResponse response) throws SQLException, ServletException, IOException {
List<Usuario> listarUsuario = dao.selecionarTodosUsuarios();
request.setAttribute("listarUsuario", listarUsuario);
RequestDispatcher dispatcher = request.getRequestDispatcher("usuario-lista.jsp");
dispatcher.forward(request, response);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
Creates an SMS message containing the information from this location. | synchronized String getLocString() {
String MSG_TERMINATOR = ";";
String DATA_SEPARATOR = ",";
if (loc == null) {
return System.currentTimeMillis() + DATA_SEPARATOR + "No Location!" + MSG_TERMINATOR;
}
return String.valueOf(System.currentTimeMillis()) +
DATA_SEPARATOR +
loc.getLongitude() +
DATA_SEPARATOR +
loc.getLatitude() +
DATA_SEPARATOR +
loc.getAltitude() +
DATA_SEPARATOR +
loc.getSpeed() +
DATA_SEPARATOR +
loc.getBearing() +
DATA_SEPARATOR +
loc.getAccuracy() +
DATA_SEPARATOR +
loc.getTime() +
DATA_SEPARATOR +
providerEnabled.toString() +
DATA_SEPARATOR +
lastTemp +
DATA_SEPARATOR +
lastGravity +
DATA_SEPARATOR +
lastPressure +
MSG_TERMINATOR;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void onClick(View view) {\n String sms = \"FINDME location is \";\n if (LOCATION != null) {\n sms = sms + \"coordinates\" + \"*\" + LOCATION.latitude + \"*\" + LOCATION.longitude;\n }\n sendSms(\"0473848248... | [
"0.61790216",
"0.59347343",
"0.5862111",
"0.5855395",
"0.5851768",
"0.5765709",
"0.5724191",
"0.57040024",
"0.569884",
"0.56954527",
"0.56106174",
"0.5608109",
"0.5574789",
"0.5563685",
"0.55284184",
"0.55240417",
"0.55216116",
"0.5504171",
"0.5497809",
"0.5429685",
"0.542943... | 0.0 | -1 |
Called periodically to send an SMS. | private void sendSMS(String msg) {
SmsManager smsManager = SmsManager.getDefault();
for (String destinationAddress : destinationAddresses) {
smsManager.sendTextMessage(
destinationAddress,
null,
msg,
null,
null
);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Scheduled(fixedRate = 1000)\n private void send(){\n jmsTemplate.send(\"test.messages\", session -> {\n TextMessage message = session.createTextMessage(Instant.now().toString());\n return message;\n });\n }",
"@Override\n public void send() {\n System.out.prin... | [
"0.6631868",
"0.662647",
"0.6350639",
"0.63187265",
"0.6223565",
"0.6223565",
"0.6223565",
"0.6223565",
"0.6222185",
"0.61420655",
"0.61182916",
"0.61172384",
"0.6057683",
"0.6027638",
"0.6014165",
"0.60116917",
"0.59880745",
"0.5983656",
"0.59732276",
"0.5960761",
"0.5949037... | 0.62435484 | 4 |
Inflate the menu; this adds items to the action bar if it is present. | @Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.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) {... | [
"0.72474515",
"0.72030497",
"0.7196155",
"0.7178126",
"0.7107996",
"0.7041309",
"0.70395386",
"0.7012691",
"0.7010885",
"0.69815445",
"0.69462097",
"0.6940046",
"0.69345695",
"0.69183254",
"0.69183254",
"0.6892358",
"0.6885014",
"0.6876514",
"0.6876359",
"0.68626404",
"0.6862... | 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) {
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 ... | [
"0.7904451",
"0.78051436",
"0.7766031",
"0.77275425",
"0.76321447",
"0.7622237",
"0.7584132",
"0.7530231",
"0.74875915",
"0.7457484",
"0.7457484",
"0.7438372",
"0.74221927",
"0.7403421",
"0.73915446",
"0.738672",
"0.7378976",
"0.73701847",
"0.7362139",
"0.73556066",
"0.734531... | 0.0 | -1 |
Gets the current coordinates of the phone. | private String getCords() {
return current.getLocString();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double[] getCoordinates() {\n \tdouble []coords = this.position.getCoordinates();\n \tthis.currentX = coords[0];\n \tthis.currentY = coords[1];\n \treturn coords;\n }",
"public void getCoordinates(){\n\t\t\n\t\t // check if GPS enabled\n GPSTracker gpsTracker = new GPSTracker(this);\... | [
"0.6936775",
"0.6891876",
"0.68612605",
"0.68417346",
"0.67938215",
"0.67400473",
"0.67400473",
"0.6642583",
"0.66152066",
"0.6610698",
"0.6576313",
"0.656981",
"0.65529615",
"0.6536661",
"0.65319777",
"0.6527488",
"0.650148",
"0.64577264",
"0.64508456",
"0.6433748",
"0.64108... | 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.menu_enter, 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) {... | [
"0.724751",
"0.72030395",
"0.71962166",
"0.71781456",
"0.71080285",
"0.70414597",
"0.7039569",
"0.70127094",
"0.7010955",
"0.69814765",
"0.69462436",
"0.6940127",
"0.69346195",
"0.6918375",
"0.6918375",
"0.6892324",
"0.688513",
"0.687655",
"0.68764484",
"0.68626994",
"0.68626... | 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) {
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 ... | [
"0.79041415",
"0.7806607",
"0.7766601",
"0.7726997",
"0.76317257",
"0.7621966",
"0.75851256",
"0.753119",
"0.74884796",
"0.7458151",
"0.7458151",
"0.74387676",
"0.74214053",
"0.74029565",
"0.73919135",
"0.73871326",
"0.73794",
"0.7370643",
"0.73621583",
"0.7356208",
"0.734578... | 0.0 | -1 |
System.out.println("HERE at doGet"); String city = req.getParameter("city"); System.out.println(city); ObjectMapper mapper = new ObjectMapper(); String json = mapper.writeValueAsString(value); PrintWriter out = resp.getWriter(); resp.setContentType("application/json"); out.write(json); | @Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t Map<String, Object> map = doService(req,resp);\n\t Gson gson = new Gson();\n\t\tString json = gson.toJson(map);\n\t\tSystem.out.println(\"返回的json数据--------------------->\"+json);\n\... | [
"0.7246046",
"0.6940121",
"0.68945014",
"0.68039423",
"0.67603976",
"0.66820985",
"0.66659284",
"0.655758",
"0.6455034",
"0.6376511",
"0.6346824",
"0.6340445",
"0.63189954",
"0.6313026",
"0.6279733",
"0.62773865",
"0.6231286",
"0.6223001",
"0.6193463",
"0.618977",
"0.618736",... | 0.55516 | 86 |
Called when the user initiates the search. | protected abstract void onSearch(AjaxRequestTarget target, String searchString); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void onSearchStarted();",
"@Override\n\tpublic boolean onSearchRequested()\n\t{\n \tstartSearch(getCurSearch(), true, null, false);\n \treturn true;\n\t}",
"public void firstSearch() {\n\n\t\tif ((workspaceSearchField.getText() == null) || \"\".equals(workspaceSearchField.getText())) {\n\t\t\twork... | [
"0.74092686",
"0.71761125",
"0.7098402",
"0.7065729",
"0.7065729",
"0.7065729",
"0.6965856",
"0.6950614",
"0.6910403",
"0.6901066",
"0.69009775",
"0.6888685",
"0.6847598",
"0.67994624",
"0.6789785",
"0.67849666",
"0.675383",
"0.6740503",
"0.67362964",
"0.6701402",
"0.6681838"... | 0.0 | -1 |
Construct from one row | public ProcessListEntry(ResultSet rs)
throws java.sql.SQLException
{
this.setId(rs.getString("ID"));
this.setUser(rs.getString("USER"));
this.setHost(rs.getString("HOST"));
this.setDb(rs.getString("DB"));
this.setCommand(rs.getString("COMMAND"));
this.setState(rs.getString("STATE"));
this.setTime(rs.getInt("TIME"));
this.setInfo(rs.getString("INFO"));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"RowValues createRowValues();",
"RowValue createRowValue();",
"Row createRow();",
"FromValuesColumns createFromValuesColumns();",
"default Object convert(GenericRowData row) {\n return convert(row, -1);\n }",
"public static Row createRow() {\n\t\treturn new Row(fsco,criteria,columns);\n\... | [
"0.6096162",
"0.5972752",
"0.59727514",
"0.5899001",
"0.58859587",
"0.58600825",
"0.5736329",
"0.5731205",
"0.5730599",
"0.56209135",
"0.5597067",
"0.5550583",
"0.54583013",
"0.54201645",
"0.53773725",
"0.53151435",
"0.53098726",
"0.5296603",
"0.5291281",
"0.5282038",
"0.5261... | 0.0 | -1 |
constructs a plain surfacemesh | public TriangleStripGenerator2d(final int rowLength, final boolean reverseOrder) {
triangs = new LinkedList<Triangle>();
this.reverseOrder = reverseOrder;
lastRow = null;
currentRow = new Vector3d[rowLength];
rowIndex = 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static DeformableMesh3D createTestBlock(double w, double h, double depth){\n ArrayList<double[]> pts = new ArrayList<double[]>();\n ArrayList<int[]> connections = new ArrayList<int[]>();\n ArrayList<int[]> triangles = new ArrayList<int[]>();\n\n pts.add(new double[]{-w/2, -h/2, d... | [
"0.67178464",
"0.66170955",
"0.65161085",
"0.6371521",
"0.6348652",
"0.62964445",
"0.622386",
"0.6196818",
"0.6071131",
"0.5988057",
"0.59822243",
"0.5979624",
"0.5908886",
"0.5895843",
"0.58800304",
"0.58766115",
"0.58483577",
"0.5835445",
"0.58308375",
"0.5818697",
"0.58032... | 0.0 | -1 |
constructs a plain surfacemesh | public TriangleStripGenerator2d(final int rowLength) {
this(rowLength, true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static DeformableMesh3D createTestBlock(double w, double h, double depth){\n ArrayList<double[]> pts = new ArrayList<double[]>();\n ArrayList<int[]> connections = new ArrayList<int[]>();\n ArrayList<int[]> triangles = new ArrayList<int[]>();\n\n pts.add(new double[]{-w/2, -h/2, d... | [
"0.6716121",
"0.66159546",
"0.65146315",
"0.6370222",
"0.6346902",
"0.62955207",
"0.62226856",
"0.61947304",
"0.60689545",
"0.59866095",
"0.5981231",
"0.5979004",
"0.59078145",
"0.5894099",
"0.587846",
"0.58747506",
"0.58464617",
"0.5833116",
"0.5829723",
"0.5818122",
"0.5801... | 0.0 | -1 |
from the third vertex call on, for every call one triangle is generated with the vertices from the previous and preprevious call | public void add(final Vector3d vertex) {
currentRow[rowIndex] = vertex;
if (rowIndex > 0 && lastRow != null) {
final Vector3d edge1 = lastRow[rowIndex - 1];
final Vector3d edge2 = lastRow[rowIndex];
final Vector3d edge3 = currentRow[rowIndex];
final Vector3d edge4 = currentRow[rowIndex - 1];
final Triangle t1 = reverseOrder ? makeTriangle(edge1, edge3, edge2)
: makeTriangle(edge1, edge2, edge3);
final Triangle t2 = reverseOrder ? makeTriangle(edge1, edge4, edge3)
: makeTriangle(edge1, edge3, edge4);
triangs.add(t1);
triangs.add(t2);
}
rowIndex++;
if (rowIndex >= currentRow.length) {
lastRow = currentRow;
currentRow = new Vector3d[currentRow.length];
rowIndex = 0;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void addTriangle(int vertexIndex1, int vertexIndex2, int vertexIndex3);",
"private static Vector3f nextVertex(Vector3f normal, Vector3f vertex) {\n Vector3f next = new Vector3f();\n Vector3f.cross(normal, vertex, next);\n Vector3f.add(normal, next, next);\n return next;\n }",
"public Triangle(\n ... | [
"0.69757366",
"0.63051635",
"0.6293043",
"0.61017966",
"0.60558826",
"0.60543776",
"0.605039",
"0.5972092",
"0.5928294",
"0.58778524",
"0.5844021",
"0.5841674",
"0.5830843",
"0.5824916",
"0.5821204",
"0.5804785",
"0.5779883",
"0.57481325",
"0.5746916",
"0.5737684",
"0.5706453... | 0.58775026 | 10 |
adds the internal storage given by getTriangles to the given universe | public void addToUniverse(final Universe uni) {
for (Triangle t : getTriangles())
uni.add(t);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addUniverse(Universe uni){\n this.universe = uni;\n }",
"void addTriangle(int vertexIndex1, int vertexIndex2, int vertexIndex3);",
"public void setupTriangles(VrState state);",
"void addTriangle(AbstractTriangle t);",
"public void addTriangle(Triangle triangle){\n triangles.add... | [
"0.60460037",
"0.5919344",
"0.55313736",
"0.5352127",
"0.52839506",
"0.52034044",
"0.5091116",
"0.50010693",
"0.49944004",
"0.4866925",
"0.486617",
"0.48557433",
"0.48442766",
"0.48231196",
"0.48201823",
"0.4818016",
"0.48066175",
"0.47550482",
"0.47492802",
"0.4724971",
"0.4... | 0.7073714 | 0 |
this method should generate a triangle based on the given vertices organized by the generator the passinorder of the arguments is managed by the generator and should not be reorganized normally | protected abstract Triangle makeTriangle(final Vector3d edge1, final Vector3d edge2,
final Vector3d edge3); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void addTriangle(int vertexIndex1, int vertexIndex2, int vertexIndex3);",
"private void generateVertexSignatures() {\n \t this.create(0);\n \t this.vertexSignatures = new ArrayList<String>();\n \t this.vertexSignatures.add(this.toCanonicalVertexString());\n \t int count = this.getVertexCount();\n \t ... | [
"0.6313155",
"0.59541196",
"0.58769065",
"0.58278686",
"0.5800975",
"0.57828516",
"0.56414896",
"0.56086665",
"0.55851173",
"0.55756027",
"0.5535821",
"0.55062973",
"0.5446829",
"0.54428077",
"0.5431046",
"0.5423594",
"0.5411624",
"0.54025006",
"0.54020804",
"0.53717226",
"0.... | 0.5868502 | 3 |
ProxyInterface zum Abruf von Informationen vom AMSBackend. | @FeignClient(name="amsapi", url="localhost:9090")
@RequestMapping("/api")
public interface AmsApiProxy {
@GetMapping("/serieses/{id}")
public SeriesDTO getSeries(@PathVariable("id") long id);
@GetMapping("/episodes/{id}")
public EpisodeDTO getEpisode(@PathVariable("id") long id);
@GetMapping("/episodes/{id}/series")
public SeriesDTO getEpisodeSeries(@PathVariable("id") long id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface AppProxy {\n /**\n * 获取用户的token\n * @return\n */\n String getUserToken();\n\n /**\n * 获取保存设备信息时的url,可以不用写全,但是需要有一些特征信息;\n * 如果返回null,则会在Analysis.init方法中保存设备的信息\n * @return\n */\n String[] getStoreDeviceInfoJudgeUrl();\n\n /**\n * 获取网络调用的一下url,参数必须一致\n... | [
"0.6136226",
"0.57937557",
"0.573728",
"0.5698456",
"0.559351",
"0.5548108",
"0.5539648",
"0.55376464",
"0.5504499",
"0.5491829",
"0.5480061",
"0.54749787",
"0.54712105",
"0.5470121",
"0.5469503",
"0.5460949",
"0.54548866",
"0.5444203",
"0.5440922",
"0.5412422",
"0.54113615",... | 0.0 | -1 |
Returns a string describing classifier | public String globalInfo() {
return "Class for building and using a PRISM rule set for classification. "
+ "Can only deal with nominal attributes. Can't deal with missing values. "
+ "Doesn't do any pruning.\n\n"
+ "For more information, see \n\n"
+ getTechnicalInformation().toString();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getClassifier() {\n return _classifier;\n }",
"Classifier getClassifier();",
"public String getClassification() {\n return classification;\n }",
"public String getClassification() {\n return classification;\n }",
"public String getClassification() {\n return classification;... | [
"0.766324",
"0.76449287",
"0.75008434",
"0.75008434",
"0.7471482",
"0.72459733",
"0.70950687",
"0.7035167",
"0.67809045",
"0.67768276",
"0.67354065",
"0.6676779",
"0.6606707",
"0.6594198",
"0.653541",
"0.65164304",
"0.63931996",
"0.6328792",
"0.632241",
"0.62963384",
"0.62780... | 0.5592811 | 43 |
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on. | public TechnicalInformation getTechnicalInformation() {
TechnicalInformation result;
result = new TechnicalInformation(Type.ARTICLE);
result.setValue(Field.AUTHOR, "J. Cendrowska");
result.setValue(Field.YEAR, "1987");
result.setValue(Field.TITLE, "PRISM: An algorithm for inducing modular rules");
result.setValue(Field.JOURNAL, "International Journal of Man-Machine Studies");
result.setValue(Field.VOLUME, "27");
result.setValue(Field.NUMBER, "4");
result.setValue(Field.PAGES, "349-370");
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public TechnicalInformation getTechnicalInformation() {\n TechnicalInformation \tresult;\n TechnicalInformation \tadditional;\n \n result = new TechnicalInformation(Type.MASTERSTHESIS);\n result.setValue(Field.AUTHOR, \"Brent Martin\");\n result.setValue(Field.YEAR, \"1995\");\n result.setValu... | [
"0.723323",
"0.69827765",
"0.6763847",
"0.67057854",
"0.63967186",
"0.6056486",
"0.5663536",
"0.5637501",
"0.5629532",
"0.55874014",
"0.5418929",
"0.53901106",
"0.53398407",
"0.5316777",
"0.528736",
"0.521313",
"0.5178734",
"0.5165396",
"0.51559037",
"0.51479477",
"0.51266545... | 0.75514627 | 0 |
Constructor that takes instances and the classification. | public PrismRule(Instances data, int cl) throws Exception {
m_instances = data;
m_classification = cl;
m_test = null;
m_next = null;
m_errors = 0;
Enumeration enu = data.enumerateInstances();
while (enu.hasMoreElements()) {
if ((int) ((Instance) enu.nextElement()).classValue() != cl) {
m_errors++;
}
}
m_instances = new Instances(m_instances, 0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n public void buildClassifier(Instances instances) throws Exception {\n getCapabilities().testWithFail(instances);\r\n\r\n // remove instances with missing class\r\n instances = new Instances(instances);\r\n instances.deleteWithMissingClass();\r\n\r\n // ensure we ... | [
"0.7035254",
"0.6581341",
"0.6528761",
"0.64481145",
"0.63970083",
"0.63322",
"0.6317266",
"0.62748903",
"0.61132294",
"0.6066234",
"0.5890496",
"0.5853491",
"0.5834092",
"0.58040255",
"0.5799946",
"0.5792342",
"0.57906723",
"0.5777586",
"0.57487285",
"0.57295114",
"0.571369"... | 0.6023915 | 10 |
Returns the result assigned by this rule to a given instance. | public int resultRule(Instance inst) {
if (m_test == null || m_test.satisfies(inst)) {
return m_classification;
} else {
return -1;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public MatchResult getResult() {\n return result;\n }",
"public Object getResult() {\n if (result == null) {\n return defaultResult();\n } else {\n return result;\n }\n }",
"@Override\n\tpublic Result getResult() {\n\t\treturn m_Result;\n\t}",
"synchron... | [
"0.6427989",
"0.6264306",
"0.6183707",
"0.6151882",
"0.61468184",
"0.60911113",
"0.60584784",
"0.60555685",
"0.6035492",
"0.60106546",
"0.5987358",
"0.59034574",
"0.58809996",
"0.5833445",
"0.5821782",
"0.5807041",
"0.57655966",
"0.57655966",
"0.57268596",
"0.5681014",
"0.564... | 0.66007286 | 0 |
Returns the result assigned by these rules to a given instance. | public int resultRules(Instance inst) {
if (resultRule(inst) != -1) {
return m_classification;
} else if (m_next != null) {
return m_next.resultRules(inst);
} else {
return -1;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int resultRule(Instance inst) {\n\n if (m_test == null || m_test.satisfies(inst)) {\n\treturn m_classification;\n } else {\n\treturn -1;\n }\n }",
"Rule getRule();",
"public MatchResult getResult() {\n return result;\n }",
"public R getRule() {\n return this.rule... | [
"0.65874636",
"0.5993038",
"0.59856164",
"0.57469875",
"0.56787896",
"0.5643322",
"0.55107",
"0.5471857",
"0.54483604",
"0.5438967",
"0.5425365",
"0.5420191",
"0.5418781",
"0.54064727",
"0.5403969",
"0.5396504",
"0.53951955",
"0.53864706",
"0.53740185",
"0.53717095",
"0.53627... | 0.67903596 | 0 |
Returns the set of instances that are covered by this rule. | public Instances coveredBy(Instances data) {
Instances r = new Instances(data, data.numInstances());
Enumeration enu = data.enumerateInstances();
while (enu.hasMoreElements()) {
Instance i = (Instance) enu.nextElement();
if (resultRule(i) != -1) {
r.add(i);
}
}
r.compactify();
return r;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public final ArrayList<Instance> coveredInstances(final Instances data) {\n //TODO ELM: this fucks a lot, since it changes the reference to the dataset. actually, it should make a copy or something. ok, I put, that instances are added directly. this is a problem\n final ArrayList<Instance> covd = new... | [
"0.6517598",
"0.5761299",
"0.5637277",
"0.5625269",
"0.5617147",
"0.5546115",
"0.55313116",
"0.5527453",
"0.5519051",
"0.5496942",
"0.54750973",
"0.54744184",
"0.5450184",
"0.53831273",
"0.5366362",
"0.532052",
"0.5271718",
"0.5259319",
"0.5255857",
"0.52557653",
"0.5250501",... | 0.6936599 | 0 |
Returns the set of instances that are not covered by this rule. | public Instances notCoveredBy(Instances data) {
Instances r = new Instances(data, data.numInstances());
Enumeration enu = data.enumerateInstances();
while (enu.hasMoreElements()) {
Instance i = (Instance) enu.nextElement();
if (resultRule(i) == -1) {
r.add(i);
}
}
r.compactify();
return r;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Instances coveredBy(Instances data) {\n\n Instances r = new Instances(data, data.numInstances());\n Enumeration enu = data.enumerateInstances();\n while (enu.hasMoreElements()) {\n\tInstance i = (Instance) enu.nextElement();\n\tif (resultRule(i) != -1) {\n\t r.add(i);\n\t}\n }\n r.... | [
"0.637957",
"0.6264154",
"0.60462165",
"0.60006493",
"0.5980912",
"0.5974551",
"0.5929307",
"0.5908378",
"0.5836092",
"0.58109915",
"0.57871693",
"0.5782703",
"0.5782123",
"0.56618875",
"0.56232727",
"0.5616388",
"0.56047785",
"0.5595048",
"0.55688167",
"0.5568669",
"0.553171... | 0.73363084 | 0 |
Prints the set of rules. | public String toString() {
try {
StringBuffer text = new StringBuffer();
if (m_test != null) {
text.append("If ");
for (Test t = m_test; t != null; t = t.m_next) {
if (t.m_attr == -1) {
text.append("?");
} else {
text.append(m_instances.attribute(t.m_attr).name() + " = " +
m_instances.attribute(t.m_attr).value(t.m_val));
}
if (t.m_next != null) {
text.append("\n and ");
}
}
text.append(" then ");
}
text.append(m_instances.classAttribute().value(m_classification) + "\n");
if (m_next != null) {
text.append(m_next.toString());
}
return text.toString();
} catch (Exception e) {
return "Can't print Prism classifier!";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void printRules () {\n \n System.out.println(\"PRINTING RULESET ID : \" + this.id + \" (\" + this.size() + \") entries.\");\n for (int i = 0; i < this.size(); i++) {\n \n System.out.println(\"Rule \" + (i+1) + \" (ID \" + references.get(i) + \") : \" + this.rulelis... | [
"0.8367224",
"0.7561677",
"0.7554898",
"0.75255626",
"0.72960794",
"0.6554542",
"0.6363596",
"0.63294685",
"0.62379104",
"0.6184244",
"0.60812175",
"0.6054878",
"0.60459936",
"0.5981534",
"0.5958058",
"0.59400463",
"0.5931968",
"0.5915664",
"0.5912387",
"0.5911065",
"0.591079... | 0.0 | -1 |
Returns whether a given instance satisfies this test. | private boolean satisfies(Instance inst) {
if ((int) inst.value(m_attr) == m_val) {
if (m_next == null) {
return true;
} else {
return m_next.satisfies(inst);
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isValid() {\n return instance != null;\n }",
"boolean containsInstance(Instance instance);",
"boolean hasInstance();",
"public abstract boolean isSatisfied();",
"boolean isTestEligible();",
"public boolean matches(IFrame query, IFrame instance) {\n\n\t\tif (coreMatcher.matches(preProce... | [
"0.6549768",
"0.6541795",
"0.6430788",
"0.62958044",
"0.60289335",
"0.6001406",
"0.5948539",
"0.59364927",
"0.57942784",
"0.57942784",
"0.57942784",
"0.57942784",
"0.57942784",
"0.578932",
"0.5780245",
"0.5772025",
"0.5741163",
"0.5736381",
"0.573172",
"0.5728292",
"0.5719206... | 0.66377497 | 0 |
Classifies a given instance. | public double classifyInstance(Instance inst) {
int result = m_rules.resultRules(inst);
if (result == -1) {
return Instance.missingValue();
} else {
return (double)result;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract String classify(Instance inst);",
"public void classify() {\n\t\ttry {\n\t\t\tdouble pred = classifier.classifyInstance(instances.instance(0));\n\t\t\tSystem.out.println(\"===== Classified instance =====\");\n\t\t\tSystem.out.println(\"Class predicted: \" + instances.classAttribute().value((int) pred));... | [
"0.6907763",
"0.68524367",
"0.6622919",
"0.657192",
"0.6325673",
"0.6008015",
"0.59849834",
"0.58690524",
"0.57482016",
"0.5628985",
"0.556",
"0.53740764",
"0.5359699",
"0.5337512",
"0.5300519",
"0.52680695",
"0.51907307",
"0.5184561",
"0.51593894",
"0.51392794",
"0.5060435",... | 0.503102 | 24 |
Returns default capabilities of the classifier. | public Capabilities getCapabilities() {
Capabilities result = super.getCapabilities();
// attributes
result.enable(Capability.NOMINAL_ATTRIBUTES);
// class
result.enable(Capability.NOMINAL_CLASS);
result.enable(Capability.MISSING_CLASS_VALUES);
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Capabilities getCapabilities() {\n Capabilities result = super.getCapabilities();\n\n // attributes\n result.enable(Capability.NOMINAL_ATTRIBUTES);\n result.enable(Capability.NUMERIC_ATTRIBUTES);\n result.enable(Capability.DATE_ATTRIBUTES);\n result.enable(Capability.MISSING_VALUES);\n\n ... | [
"0.7218925",
"0.6979932",
"0.6904847",
"0.67509174",
"0.6744981",
"0.67158365",
"0.6598442",
"0.65822077",
"0.65732133",
"0.6559086",
"0.6478186",
"0.64492685",
"0.6124587",
"0.6051281",
"0.60491353",
"0.60463446",
"0.6007231",
"0.6001894",
"0.5987407",
"0.59492445",
"0.58565... | 0.72196776 | 0 |
Add a rule to the ruleset. | private PrismRule addRule(PrismRule lastRule, PrismRule newRule) {
if (lastRule == null) {
m_rules = newRule;
} else {
lastRule.m_next = newRule;
}
return newRule;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"IRuleset add(IRuleset rule);",
"public void add_rule(Rule rule) throws Exception;",
"public void addRule(final Rule rule)\n {\n if (rule == null)\n {\n throw new NullPointerException(\"rule MUST NOT be null\");\n }\n\n this.rules.add(rule);\n }",
"public boolean a... | [
"0.8512961",
"0.84185106",
"0.76535106",
"0.7322258",
"0.7237175",
"0.7046026",
"0.6980609",
"0.6954069",
"0.69281995",
"0.68562216",
"0.66420645",
"0.64806324",
"0.6458373",
"0.6426396",
"0.640894",
"0.63950914",
"0.635296",
"0.63190746",
"0.63135463",
"0.6289229",
"0.627853... | 0.7023501 | 6 |
Add a test to this rule. | private Test addTest(PrismRule rule, Test lastTest, Test newTest) {
if (rule.m_test == null) {
rule.m_test = newTest;
} else {
lastTest.m_next = newTest;
}
return newTest;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addTest(String name, ITimed test) {\n\t\ttests.add(new Test(name, test));\n\t}",
"public ExplanationPipeline<I, F> addWithTest(Postprocessor toAdd) {\n return addWithTest(toAdd, false);\n }",
"public void add_rule(Rule rule) throws Exception;",
"@Override\n\tpublic MedicalTest addTest(M... | [
"0.6817057",
"0.6628036",
"0.6415258",
"0.63818955",
"0.6335875",
"0.6257312",
"0.6219294",
"0.6122721",
"0.60334337",
"0.5978819",
"0.5966276",
"0.59496456",
"0.5918322",
"0.58777934",
"0.58620876",
"0.5837418",
"0.58327174",
"0.58193326",
"0.579873",
"0.57967997",
"0.574049... | 0.7410167 | 0 |
Does E contain any examples in the class C? | private static boolean contains(Instances E, int C) throws Exception {
Enumeration enu = E.enumerateInstances();
while (enu.hasMoreElements()) {
if ((int) ((Instance) enu.nextElement()).classValue() == C) {
return true;
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private E() {}",
"public int E() {\n \treturn E;\n }",
"public int E() {\r\n return E;\r\n }",
"public int E() {\n return E;\n }",
"public int E() {\n return E;\n }",
"void mo83706a(C32459e<T> eVar);",
"public float e()\r\n/* 20: */ {\r\n/* 21:167 */ retur... | [
"0.69292766",
"0.6350963",
"0.63341564",
"0.6276274",
"0.6276274",
"0.6140262",
"0.6084067",
"0.6031232",
"0.58690584",
"0.5815105",
"0.5779954",
"0.5777312",
"0.57574207",
"0.5703644",
"0.56671643",
"0.5655032",
"0.56458944",
"0.5595324",
"0.5594991",
"0.5562378",
"0.5562378... | 0.57447356 | 13 |
Is this attribute mentioned in the rule? | private static boolean isMentionedIn(Attribute attr, Test t) {
if (t == null) {
return false;
}
if (t.m_attr == attr.index()) {
return true;
}
return isMentionedIn(attr, t.m_next);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean isAttribute();",
"boolean hasAttribute(String name);",
"public boolean containAttribute(String name);",
"boolean hasAttributes();",
"boolean hasAttributes();",
"public final boolean hasAttribute ()\r\n {\r\n return _value.hasAttribute();\r\n }",
"public boolean hasAttribute(String na... | [
"0.7846742",
"0.7203737",
"0.7122417",
"0.7084825",
"0.7084825",
"0.70298004",
"0.69291496",
"0.68864846",
"0.68370086",
"0.6774643",
"0.67338926",
"0.66659373",
"0.65991896",
"0.65830505",
"0.657723",
"0.65764374",
"0.64321",
"0.64223534",
"0.6389711",
"0.6374958",
"0.635438... | 0.5789217 | 43 |
Prints a description of the classifier. | public String toString() {
if (m_rules == null) {
return "Prism: No model built yet.";
}
return "Prism rules\n----------\n" + m_rules.toString();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract void printClassifier();",
"@Override\n\tpublic void printDescription() {\n\t\tfor(IComponent obj:components) {\n\t\t\tobj.printDescription();\n\t\t}\n\t\t\n\t}",
"public String toString() {\n \n String str = m_Classifier.getClass().getName();\n \n str += \" \"\n + Utils\n ... | [
"0.7356896",
"0.6338364",
"0.61592704",
"0.6158282",
"0.61329085",
"0.61291695",
"0.61291695",
"0.61291695",
"0.61291695",
"0.61291695",
"0.61291695",
"0.61291695",
"0.61291695",
"0.61291695",
"0.61291695",
"0.61291695",
"0.61291695",
"0.61291695",
"0.61291695",
"0.61291695",
... | 0.0 | -1 |
Main method for testing this class | public static void main(String[] args) {
runClassifier(new Prism(), args);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args){\n new Testing().runTests();\r\n \r\n }",
"public static void main(String[] args) {\n // PUT YOUR TEST CODE HERE\n }",
"@Test\n public void main() {\n MainApp.main(new String[] {});\n }",
"public static void main(String[] args) {\... | [
"0.74873865",
"0.7459512",
"0.73800415",
"0.732069",
"0.7265512",
"0.7250709",
"0.7238296",
"0.7196187",
"0.71874183",
"0.71621084",
"0.7070611",
"0.70650405",
"0.7028873",
"0.7027808",
"0.7005915",
"0.69687474",
"0.69566447",
"0.695383",
"0.6915414",
"0.69133365",
"0.6889435... | 0.0 | -1 |
Valid values are "rent", "purchase", "package" or "subscription". If nothing is specified, then the media is free. | public Type getType() {
return type;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setMedia(String m) {\n\t\tmedia = m;\n\t}",
"public void setMediaEncryptionMandatory(boolean m);",
"public String manageSocialmedia() {\n\t\treturn \"Social media available\";\r\n\t}",
"String getMedia();",
"public boolean isMediaEncryptionMandatory();",
"@java.lang.Override\n public boolean... | [
"0.5432378",
"0.5414633",
"0.5398622",
"0.52869666",
"0.52362233",
"0.52104217",
"0.52073723",
"0.5198084",
"0.5184599",
"0.5181486",
"0.51682353",
"0.514117",
"0.5138532",
"0.5136927",
"0.512351",
"0.50415736",
"0.50084317",
"0.50056314",
"0.49102443",
"0.48970452",
"0.48792... | 0.0 | -1 |
Valid values are "rent", "purchase", "package" or "subscription". If nothing is specified, then the media is free. | public void setType(final Type type) {
this.type = type;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setMedia(String m) {\n\t\tmedia = m;\n\t}",
"public void setMediaEncryptionMandatory(boolean m);",
"public String manageSocialmedia() {\n\t\treturn \"Social media available\";\r\n\t}",
"String getMedia();",
"public boolean isMediaEncryptionMandatory();",
"@java.lang.Override\n public boolean... | [
"0.54338247",
"0.5415558",
"0.54013246",
"0.528972",
"0.52378374",
"0.5212866",
"0.52088696",
"0.5200321",
"0.5187009",
"0.5183091",
"0.5170064",
"0.5143197",
"0.5140692",
"0.5137795",
"0.5124753",
"0.50427485",
"0.50111395",
"0.5006494",
"0.4911541",
"0.48984236",
"0.4880323... | 0.0 | -1 |
price is the price of the media object. This is an optional attribute. | public BigDecimal getPrice() {
return price;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setPrice(double price) {\n this.price = price;\n }",
"public void setPrice(double price) {\n this.price = price;\n }",
"public void setPrice(double price) {\n this.price = price;\n }",
"public void setPrice(double price) {\n this.price = price;\n }",
"pub... | [
"0.70902175",
"0.70902175",
"0.70902175",
"0.70902175",
"0.70902175",
"0.70902175",
"0.70902175",
"0.70811826",
"0.707884",
"0.707884",
"0.707884",
"0.70466954",
"0.70315856",
"0.70315856",
"0.69977957",
"0.6985533",
"0.6985533",
"0.6953465",
"0.6919444",
"0.6916289",
"0.6916... | 0.0 | -1 |
price is the price of the media object. This is an optional attribute. | public void setPrice(final BigDecimal price) {
this.price = price;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setPrice(double price) {\n this.price = price;\n }",
"public void setPrice(double price) {\n this.price = price;\n }",
"public void setPrice(double price) {\n this.price = price;\n }",
"public void setPrice(double price) {\n this.price = price;\n }",
"pub... | [
"0.70926243",
"0.70926243",
"0.70926243",
"0.70926243",
"0.70926243",
"0.70926243",
"0.70926243",
"0.7083493",
"0.70811903",
"0.70811903",
"0.70811903",
"0.70488995",
"0.70341605",
"0.70341605",
"0.70001537",
"0.6987909",
"0.6987909",
"0.6955827",
"0.6920697",
"0.6919066",
"0... | 0.0 | -1 |
if the type is "package" or "subscription", then info is a URL pointing to package or subscription information. This is an optional attribute. | public URL getInfo() {
return info;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setInfo(String info) {\n this.info = info;\n }",
"public void setInfo(final URL info) {\n this.info = info;\n }",
"private static String getInfoLink(JSONObject volumeInfo) throws JSONException {\n return volumeInfo.getString(\"infoLink\");\n }",
"@Override\n publi... | [
"0.64617294",
"0.6268315",
"0.58116823",
"0.5786593",
"0.57783216",
"0.57309616",
"0.5717695",
"0.56905437",
"0.5684267",
"0.56763643",
"0.56442064",
"0.5629067",
"0.5629067",
"0.5585693",
"0.55840033",
"0.55531055",
"0.5521344",
"0.55153304",
"0.5475988",
"0.5461549",
"0.546... | 0.64377636 | 1 |
if the type is "package" or "subscription", then info is a URL pointing to package or subscription information. This is an optional attribute. | public void setInfo(final URL info) {
this.info = info;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setInfo(String info) {\n this.info = info;\n }",
"public URL getInfo() {\n return info;\n }",
"private static String getInfoLink(JSONObject volumeInfo) throws JSONException {\n return volumeInfo.getString(\"infoLink\");\n }",
"@Override\n public String getInfo(){\... | [
"0.6459027",
"0.6436598",
"0.58107024",
"0.578395",
"0.5774898",
"0.57274526",
"0.5714336",
"0.5687428",
"0.568387",
"0.5673803",
"0.5641041",
"0.56264615",
"0.56264615",
"0.55832076",
"0.55809706",
"0.55526954",
"0.5518582",
"0.55127186",
"0.5473414",
"0.54590255",
"0.545902... | 0.6267855 | 2 |
Instantiates a new DelayMessage with the specified millisecond delay, receiver, and DataBead message. | public DelayData(AudioContext context, double delay,
DataBeadReceiver receiver, DataBead db) {
super(context, delay);
this.receiver = receiver;
this.dataBead = db;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Delay(float delay)\n\t{\n\t\tthis(delay,0);\n\t}",
"public MessageTimer(String channel, String id, String message, long delay) {\n\t\tthis(channel, id, message, delay, \"REQUIRES_LIVE+\");\n\t}",
"public void setDelay(int delay, String message){\r\n\t\tcal.add(Calendar.MINUTE, delay);\r\n\t\tdelayTime =... | [
"0.6292266",
"0.6289083",
"0.6038268",
"0.6020789",
"0.58930284",
"0.5878089",
"0.56675106",
"0.5574358",
"0.55617213",
"0.55138385",
"0.55086637",
"0.55000955",
"0.54813594",
"0.5455613",
"0.5405878",
"0.5388629",
"0.5348624",
"0.5337706",
"0.53139436",
"0.52850276",
"0.5276... | 0.6398609 | 0 |
Gets this DelayTrigger's receiver. | public DataBeadReceiver getReceiver() {
return receiver;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public TriggerRecipient getRecipient () {\n return this.recipient;\n }",
"public static Receiver getReceiver() {\n return receiver;\n }",
"public Trigger getTrigger() {\n \t\treturn trigger;\n \t}",
"public Receiver getReceiver() {\n return new Receiver(this);\n }",
"public PlayerMo... | [
"0.66263986",
"0.65555334",
"0.60459405",
"0.6043825",
"0.6005717",
"0.57892424",
"0.5727802",
"0.57180405",
"0.56889576",
"0.5640071",
"0.5589128",
"0.5571185",
"0.5537506",
"0.5525248",
"0.5502212",
"0.5466068",
"0.5456152",
"0.5421572",
"0.5404992",
"0.5403299",
"0.5395745... | 0.60655856 | 2 |
Sets this DelayData's receiver. | public DelayData setReceiver(DataBeadReceiver receiver) {
this.receiver = receiver;
return this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setReceiver(Receiver receiver) {\n\t this.receiver = receiver;\n\t }",
"public void setReceiver (Receiver receiver) {\n\t\t_receiver = receiver;\n\t}",
"public void setReceiver(String receiver) {\n Receiver = receiver;\n }",
"public void setDelay(long d){delay = d;}",
"public vo... | [
"0.6343882",
"0.62857884",
"0.56916213",
"0.5662196",
"0.5584666",
"0.555779",
"0.555304",
"0.5413172",
"0.53712744",
"0.5327102",
"0.5321999",
"0.5271042",
"0.5259791",
"0.52418035",
"0.5222212",
"0.52108306",
"0.52024263",
"0.5176335",
"0.51609266",
"0.51479065",
"0.5011086... | 0.7727818 | 0 |
Gets the DataBead that will be sent when the DelayData fires. | public DataBead getData() {
return dataBead;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public long getDelay()\n {\n return delay;\n }",
"public int getDelay()\n {\n return delay;\n }",
"public int getDelay()\r\n {\r\n return this.delay;\r\n }",
"public int getDelay() {\n return delay;\n }",
"public long getDelay() {\n ret... | [
"0.674261",
"0.66483516",
"0.6606571",
"0.6595041",
"0.6585745",
"0.65780914",
"0.6551375",
"0.65180284",
"0.65031254",
"0.63842344",
"0.63834065",
"0.6378225",
"0.6326562",
"0.62448806",
"0.61648256",
"0.61568755",
"0.6152275",
"0.6136363",
"0.6108051",
"0.60962206",
"0.6076... | 0.68286073 | 0 |
Sets the message to send when the DelayData fires. | public DelayData setData(DataBead db) {
this.dataBead = db;
return this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setDelay(int delay, String message){\r\n\t\tcal.add(Calendar.MINUTE, delay);\r\n\t\tdelayTime = new AlarmTime(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), \r\n\t\t\t\tcal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), message);\r\n\r\n\t\tSystem.out.println(del... | [
"0.6945148",
"0.6314786",
"0.6208593",
"0.6169291",
"0.61524713",
"0.5940711",
"0.5934133",
"0.58032537",
"0.5788391",
"0.578281",
"0.57802427",
"0.57349086",
"0.57277954",
"0.56864834",
"0.56744206",
"0.56685823",
"0.5665972",
"0.5656347",
"0.5613406",
"0.5558252",
"0.553175... | 0.0 | -1 |
TODO Autogenerated method stub | public static void main(String[] args) {
DefaultuserDAO dud = new DefaultuserDAO();
//UserData user= dud.getUserbyID(2);
UserData user = new UserData();
user = dud.getUserbyID(2);
System.out.println(user);
DefaulttourDAO dtd = new DefaulttourDAO();
TourData tour = new TourData();
tour = dtd.getTourbyID(1);
System.out.println(tour);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
Returns the given String with all words capitalized. | public static String getCapitalized(String str) {
if (str != null && !str.equals("")) {
str = str.substring(0, 1).toUpperCase() + str.substring(1);
for (int i = 1; i < str.length(); i++) {
if (str.charAt(i) == ' ') {
str = str.substring(0, i + 1) + str.substring(i + 1, i + 2).toUpperCase() + str.substring(i + 2);
}
}
}
return str;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static String capitalize(String string) {\n String[] strArray = string.split(\" \");\n StringBuilder builder = new StringBuilder();\n for (String s : strArray) {\n String cap;\n if (s.length() > 1) cap = s.substring(0, 1).toUpperCase() + s.substring(1);\n ... | [
"0.75008905",
"0.7490968",
"0.74264276",
"0.7404604",
"0.73348737",
"0.7303534",
"0.72967196",
"0.7166269",
"0.7103931",
"0.7060192",
"0.7039786",
"0.69668376",
"0.6962856",
"0.6935032",
"0.69195235",
"0.6916612",
"0.6907977",
"0.68869984",
"0.6873191",
"0.6857043",
"0.683201... | 0.73663664 | 4 |
Calculates the time difference (in days) between now and the given date. | public static int getTimeDelta(int year, int month, int day) {
LocalDate then = LocalDate.of(year, month, day);
LocalDate now = LocalDateTime.now().toLocalDate();
Period period = Period.between(then, now);
return period.getDays() + (period.getMonths() * 30);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static long daysTillNow(Date from) { \n \tDateFormat df = new SimpleDateFormat(\"dd/MM/yyyy\");\n \tDateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"dd/MM/yyyy\");\n \tLocalDate dateBefore = LocalDate.parse(df.format(from), formatter);\n \treturn ChronoUnit.DAYS.between( dateBefore , ... | [
"0.6305299",
"0.6053872",
"0.5993442",
"0.5990254",
"0.5959336",
"0.5889358",
"0.5831228",
"0.581274",
"0.5788559",
"0.5778249",
"0.57212776",
"0.5613913",
"0.55679804",
"0.55584043",
"0.5461555",
"0.5425113",
"0.5407909",
"0.540239",
"0.53981483",
"0.5397058",
"0.5393852",
... | 0.0 | -1 |
Returns the correct geographic location given the shortened URL string. | public static String getProperLocation(String location) {
switch (location) {
case "newjersey":
return "New Jersey";
case "cnj":
return "Central Jersey";
case "southjersey":
return "South Jersey";
case "longisland":
return "Long Island";
default:
return location;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"URI getLocation();",
"public URI getLocation()\r\n/* 293: */ {\r\n/* 294:441 */ String value = getFirst(\"Location\");\r\n/* 295:442 */ return value != null ? URI.create(value) : null;\r\n/* 296: */ }",
"Location getLocation();",
"Location getLocation();",
"Location getLocation();",
"Lo... | [
"0.6656143",
"0.63404876",
"0.62583554",
"0.62583554",
"0.62583554",
"0.62583554",
"0.6164044",
"0.6164044",
"0.6164044",
"0.61426467",
"0.5976397",
"0.5915801",
"0.5915801",
"0.5915801",
"0.5915801",
"0.5915801",
"0.5915801",
"0.5915801",
"0.5915801",
"0.5762876",
"0.5720755... | 0.5667565 | 21 |
TITLE: Create Job test PRECONDITION: The user is already logged in STEPS TO REPRODUCE: 1. Click on Job section from menu 2. Click on 'Add' button for creating new job 3. Enter job title 4. Enter job location 5. Enter some note 6. Click on 'Next' button 7. Choose CVOption(the data can be changed by dataProvider) 8 Click on 'Next' button 9.Invite team member 10.Click on 'Next' button 11.Add some evaluation skills 12 Click on 'Next' button 13.Enter some pipeline stage 14.Click on 'Next' button 15.Enter internal job information 16.Enter salary information 17.Click on 'Next' button 18.Choose visibility of job(the data can be changed by dataProvider) 19.Click on 'Save' button EXPECTED RESULT: Created job should have the same internal job title which we have provided on step 16 Created job should not have the job info 'Remote' Created job should have the provided visibility which we have provided on step 19") | @Test(dataProvider = "testData")
public void createVacancyTest(String CVOption, String jobVisibility) throws InterruptedException {
//STEP 1
homePage.getSideBar().clickOnJobsMenu();
Assert.assertTrue(jobsPage.isDisplayed());
//STEP 2
jobsPage.addNewJob();
Assert.assertTrue(newJobPage.isDisplayed());
Assert.assertTrue(newJobPage.getDetails().isDisplayed());
//STEP 3
newJobPage.getDetails().enterJobTitle(jobTitle);
//STEP 4
newJobPage.getDetails().enterJobLocation(randomCountry());
Assert.assertTrue(newJobPage.getSearchSuggestion().isDisplayed());
newJobPage.getSearchSuggestion().clickSuggestionByIndex();
//STEP 5
newJobPage.getDetails().enterSomeNote(randomText());
//STEP 6
newJobPage.getDetails().clickOnNextButton();
Assert.assertTrue(newJobPage.getApplication().isDisplayed());
//STEP 7
newJobPage.getApplication().clickOnCVOption();
Assert.assertTrue(newJobPage.getOptions().isDisplayed());
newJobPage.getOptions().clickOnOption(CVOption);
Assert.assertTrue(newJobPage.getApplication().isUpdateMessageDisplayed());
//STEP 8
newJobPage.getApplication().clickOnNextButton();
Assert.assertTrue(newJobPage.getTeam().isDisplayed());
//STEP 9
newJobPage.getTeam().inviteTeamMember(email);
Assert.assertTrue(newJobPage.getInvitedEmail().isDisplayed());
Assert.assertEquals(newJobPage.getInvitedEmail().invitedEmailAddress(), email, "the emails are not matching");
//STEP 10
newJobPage.getTeam().clickOnNextButton();
Assert.assertTrue(newJobPage.getEvaluation().isDisplayed());
//STEP 11
int skillCount = newJobPage.getEvaluation().getSkillCount();
newJobPage.getEvaluation().addSomeSkill(randomSkill());
int newSkillCount = newJobPage.getEvaluation().getSkillCount();
Assert.assertTrue(newSkillCount > skillCount);
//STEP 12
newJobPage.getEvaluation().clickOnNextButton();
Assert.assertTrue(newJobPage.getWorkflow().isDisplayed());
//STEP 13
newJobPage.getWorkflow().enterPipelineStage(stage);
//STEP 14
newJobPage.getWorkflow().clickOnNextButton();
Assert.assertTrue(newJobPage.getOptional().isDisplayed());
Assert.assertTrue(newJobPage.getInternalJobInformation().isDisplayed());
Assert.assertTrue(newJobPage.getSalaryInfromation().isDisplayed());
//STEP 15
newJobPage.getInternalJobInformation().enterInternalJobInformation(internalJobTitle, id + "");
//STEP 16
newJobPage.getSalaryInfromation().enterSalaryInformation(minSalary + "", maxSalary + "", currency, minHour + "", maxHour + "");
//STEP 17
newJobPage.getOptional().clickOnNextButton();
Assert.assertTrue(newJobPage.getPublish().isDisplayed());
//STEP 18
newJobPage.getPublish().chooseVisibility(jobVisibility);
Assert.assertTrue(newJobPage.getPublish().updateMessageDisplayed());
//STEP 19
newJobPage.getPublish().clickOnSaveButton();
Assert.assertTrue(newJobPage.getCreatedJobPage().isDisplayed());
//EXPECTED RESULT
Assert.assertEquals(newJobPage.getCreatedJobPage().getJobTitle(), internalJobTitle);
Assert.assertEquals(newJobPage.getCreatedJobPage().getCreatedJobStatus(), jobVisibility);
Assert.assertNotEquals(newJobPage.getCreatedJobPage().getJobInfo(), "Remote");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@When (\"^job information details is filled \\\"(.*)\\\" \\\"(.*)\\\" \\\"(.*)\\\" \\\"(.*)\\\" \\\"(.*)\\\"$\")\r\n\tpublic void whenJobInfo(String email,String title, String appemail, String website, String company) throws InterruptedException\r\n\t{\n\t\tdriver.findElement(By.xpath(\"//input[@name='create_accou... | [
"0.72540134",
"0.6288571",
"0.6181865",
"0.6170343",
"0.5942165",
"0.5801874",
"0.58005077",
"0.57962906",
"0.5780068",
"0.57497454",
"0.5710789",
"0.570799",
"0.5612622",
"0.56054175",
"0.5592476",
"0.5579127",
"0.55762076",
"0.5569842",
"0.55597514",
"0.5543402",
"0.5540709... | 0.6554441 | 1 |
The tests will run with provided Data, for checking the behaviour of app, this options. The first option is for choosing CVOption The second option for visibility of created vacancy. | @DataProvider
public Object[][] testData() {
return new Object[][]{
{"Hidden", "Archived"},
{"Required", "Draft"},
{"Hidden", "Public"}
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test(dataProvider = \"testData\")\r\n\r\n public void createVacancyTest(String CVOption, String jobVisibility) throws InterruptedException {\r\n //STEP 1\r\n homePage.getSideBar().clickOnJobsMenu();\r\n Assert.assertTrue(jobsPage.isDisplayed());\r\n\r\n //STEP 2\r\n jobsPage.... | [
"0.62239856",
"0.6062691",
"0.58600897",
"0.5737086",
"0.56990707",
"0.56497097",
"0.548883",
"0.5475058",
"0.5463412",
"0.5405636",
"0.53008926",
"0.5281213",
"0.5278738",
"0.5195027",
"0.5172283",
"0.51700604",
"0.5160312",
"0.5149088",
"0.514818",
"0.51192576",
"0.5115643"... | 0.487232 | 55 |
find the unlabeled example with the highest level of disagreement | private Object keyOfBestUnlabeledInstance(Classifier[] committee){
double worstAgreement=2.0;
Object queryKey=null;
for(Iterator<Double> i=unlabeled.keySet().iterator();i.hasNext();){
Object key=i.next();
Instance instance=unlabeled.get(key);
TObjectDoubleHashMap counts=new TObjectDoubleHashMap();
double biggestCount=0;
for(int j=0;j<committee.length;j++){
String best=committee[j].classification(instance).bestClassName();
double c=counts.get(best)+1;
counts.put(best,c);
if(c>biggestCount)
biggestCount=c;
}
double agreement=biggestCount/committee.length;
log.info("instance: "+instance+" committee: "+counts+" agreement: "+
agreement);
if(agreement<worstAgreement){
worstAgreement=agreement;
queryKey=key;
log.debug(" ==> best");
}
}
log.info("queryInstance is: "+unlabeled.get(queryKey));
return queryKey;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public Optional<Excuse<MultiLabel>> getExcuse(Example<MultiLabel> example) {\n return Optional.empty();\n }",
"int getMax_depth();",
"public TestSetDiscrepancyErrors getTestSetDiscrepancyTopErrors() {\n return this.testSetDiscrepancyTopErrors;\n }",
"abstract int getMaxLeve... | [
"0.53663576",
"0.52325463",
"0.51785487",
"0.51517195",
"0.5111343",
"0.5084733",
"0.5053298",
"0.5006774",
"0.49224055",
"0.49118587",
"0.49019203",
"0.48732352",
"0.48613644",
"0.48374397",
"0.4815959",
"0.47919562",
"0.47700557",
"0.47570804",
"0.4736056",
"0.4725794",
"0.... | 0.5979071 | 0 |
Transfers content from one stream to another. | public static void transfer(InputStream in, OutputStream out, int offset, int size) throws IOException
{
// Read bytes and write to destination until eof
byte[] buf = new byte[size];
System.out.println("What is it here?\n"+buf);
int lengthBuff = in.read(buf);
System.out.println("The length is: "+lengthBuff);
while (lengthBuff != 0)
{
out.write(buf, 0, lengthBuff);
}
System.out.println("End!");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void streamCopy(InputStream from, OutputStream to) {\r\n\t\ttry {\r\n\t\t\tint count = 0;\r\n\t\t\tbyte[] buffer = new byte[16*1024];\r\n\t\t\twhile ((count = from.read(buffer)) > 0) {\r\n\t\t\t\tto.write(buffer, 0, count);\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\tEventLogger.logConnectionExcep... | [
"0.6644305",
"0.65898114",
"0.6409259",
"0.6341466",
"0.6241349",
"0.61597425",
"0.591415",
"0.58311933",
"0.58226323",
"0.57256997",
"0.5703201",
"0.56637895",
"0.564118",
"0.5625",
"0.5523519",
"0.55048734",
"0.5442047",
"0.5388121",
"0.5381964",
"0.53807527",
"0.53762907",... | 0.5972686 | 6 |
This method creates a popupwindow with all the exercises in the training clicked | public void popup(String s, String id){
// call to a db function -> what kind if exercises was carried out during this training?
ExerciseForTrainingFetch eftf = new ExerciseForTrainingFetch();
try {
eftf.readDataBase(id);
} catch (Exception e) {
e.printStackTrace();
}
ArrayList<ArrayList> allOvelser = eftf.getExForTraining();
StringBuilder bStr = new StringBuilder();
for (int i=0;i<allOvelser.get(0).size();i++){
bStr.append("Ovelse: " + allOvelser.get(0).get(i) + " Belastning: " +allOvelser.get(1).get(i) +
" Sett: " + allOvelser.get(2).get(i) + " Repetisjoner: " + allOvelser.get(3).get(i) + " Beskrivelse: " + allOvelser.get(4).get(i) +
" Kategori: " + allOvelser.get(5).get(i) + "\n" + "-----------------\n");
}
Group root = new Group();
Scene dialogScene = new Scene(root, 400, 300);
Label label3 = new Label(bStr.toString());
label3.setWrapText(true);
label3.setFont(new Font("Arial", 12));
label3.setMaxSize(380, 300);
final Stage dialog = new Stage();
dialog.initModality(Modality.APPLICATION_MODAL);
dialog.initOwner(UserApplication.primaryStage);
Button cancel = new Button("Cancel");
cancel.setCancelButton(true);
cancel.setOnAction((actionEvent) -> dialog.close());
GridPane gridpane = new GridPane();
gridpane.setMaxSize(400, 300);
gridpane.setHgap(10); //horizontal gap in pixels => that's what you are asking for
gridpane.setVgap(10); //vertical gap in pixels
gridpane.setPadding(new Insets(10, 10, 10, 10)); //margins around the whole grid
//(top/right/bottom/left)
ScrollPane s1 = new ScrollPane();
s1.setPrefSize(380, 300);
s1.setHbarPolicy(ScrollBarPolicy.NEVER);
s1.setContent(label3);
gridpane.add(cancel, 0, 3); // column=0 row=3
gridpane.add(s1, 0, 1); // column=0 row=1
gridpane.setMaxSize(400, 300);
root.getChildren().addAll(gridpane);
dialog.setScene(dialogScene);
dialog.show();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void createPopupWindow() {\r\n \t//\r\n }",
"public void showGenPopup() {\n\t\ttv_popupTitle.setText(R.string.title3);\n\t\ttv_popupInfo.setText(R.string.description3);\n\t\t\n\t\t// The code below assumes that the root container has an id called 'main'\n\t\t popup.showAtLocation(findViewById(R.id.a... | [
"0.6623705",
"0.58762854",
"0.5861125",
"0.5810201",
"0.5789556",
"0.5788791",
"0.5787666",
"0.5779934",
"0.57793516",
"0.5769843",
"0.57579684",
"0.57239527",
"0.5714926",
"0.57045287",
"0.56861526",
"0.5684845",
"0.56695956",
"0.5666748",
"0.56344163",
"0.5625091",
"0.56147... | 0.70653164 | 0 |
Creates the new client instance configured with specific features. | public static Client create() {
ClientConfig clientConfig = new ClientConfig(JacksonFeature.class,
JacksonJaxbJsonProvider.class,
JacksonJsonProvider.class);
return ClientBuilder.newClient(clientConfig);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void createClient() {\n\t\t\n\t}",
"public static Client createClient() {\n JacksonJaxbJsonProvider provider = new JacksonJaxbJsonProvider();\n provider.setAnnotationsToUse(new Annotations[]{Annotations.JACKSON});\n\n ClientConfig config = new ClientConfig(provider);\n ... | [
"0.6819215",
"0.6721082",
"0.66593003",
"0.66329926",
"0.65710956",
"0.6459874",
"0.640922",
"0.59028983",
"0.58750075",
"0.5874647",
"0.5874153",
"0.58319616",
"0.5822012",
"0.58177364",
"0.5810526",
"0.57286674",
"0.5727011",
"0.571567",
"0.56603223",
"0.5653101",
"0.558289... | 0.66667485 | 2 |
The problem is that even though we called doSomething() on the wrapper, the callback of the wrapped object got called, not the callback of the wrapper. This is what Joshua Bloch refers to when he says that "callbacks elude the wrapper". | interface _3SomethingWithCallback {
void doSomething();
void call();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void callback(Object o) {}",
"protected interface InvocationCallback {\n\n\t\tObject proceedWithInvocation() throws Throwable;\n\t}",
"private Callback<Boolean> wrapCallback(final TaskFinishedCallback callback) {\n return new Callback<Boolean>() {\n @Override\n ... | [
"0.569327",
"0.5680777",
"0.5565688",
"0.5451834",
"0.52132887",
"0.5071811",
"0.5044318",
"0.5009232",
"0.50026023",
"0.49877107",
"0.4978031",
"0.4962475",
"0.49608904",
"0.49327657",
"0.4929209",
"0.4923069",
"0.4917174",
"0.48774734",
"0.48521608",
"0.4851917",
"0.4842414... | 0.5038055 | 7 |
TODO construct a new 'PWPSolution' using RANDOM initialisation | @SuppressWarnings("null")
@Override
public PWPSolution createSolution(InitialisationMode mode) {
if (mode == InitialisationMode.RANDOM) {
int[] solutions = new int[getNumberOfLocations()];//array of solutions
for (int i = 0 ; i <= getNumberOfLocations() -1 ; i++) { //enumerate the array, giving each location an integer value
solutions[i]= i;
}
Collections.shuffle(Arrays.asList(solutions)); //shuffle the array
SolutionRepresentation solution = new SolutionRepresentation(solutions); //create a new solution representation using the array of ints
ObjectiveFunctionInterface objfunc = getPWPObjectiveFunction(); //get the objective function to be used
PWPSolution sol = new PWPSolution(solution, objfunc.getObjectiveFunctionValue(solution)); //create the new PWPSolution using the solution representation and the value of the objective function applied to the solution
return sol;
}
else {
return null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public final KeyPair generateKeyPair() {\n\t\tif (SECURE_RANDOM == null) {\n\t\t\tSECURE_RANDOM = new SecureRandom();\n\t\t}\n\t\t// for p and q we divide the bits length by 2 , as they create n, \n\t\t// which is the modulus and actual key size is depend on it\n\t\tBigInteger p = new BigInteger(STRENGTH / 2, 64, ... | [
"0.5894567",
"0.5746287",
"0.5584173",
"0.5503284",
"0.5503284",
"0.54830754",
"0.536497",
"0.53201145",
"0.5291038",
"0.52890486",
"0.5259941",
"0.52570105",
"0.5248028",
"0.52278566",
"0.5211769",
"0.52033675",
"0.5194141",
"0.5186942",
"0.51718616",
"0.5141742",
"0.510655"... | 0.6705191 | 0 |
TODO return an 'ArrayList' of ALL LOCATIONS in the solution. | @Override
public ArrayList<Location> getSolutionAsListOfLocations(PWPSolutionInterface oSolution) {
ArrayList<Location> locationsList = new ArrayList<Location>();//create an arraylist of locations
int[] solutions = oSolution.getSolutionRepresentation().getSolutionRepresentation(); //get the solutions as an array of integers, first from the PWPSolutionInterface and then from the SolutionRepresentationInterface
for (int i= 0 ; i < solutions.length ; i++) { //go through the array of integers and add each one to the arraylist using the getLocationforDelivery method from the PWPInstanceInterface class
locationsList.add(getLocationForDelivery(solutions[i]));
}
return locationsList;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"List<String> locations();",
"Collection<L> getLocations ();",
"public String[] getAllLocations() {\n // STUB: Return the list of source names\n return null;\n }",
"public ArrayList getLocations()\r\n\t\t{\r\n\t\t\treturn locations;\r\n\t\t}",
"public ArrayList<Location> getLocations()\n {\n ... | [
"0.75886005",
"0.7229272",
"0.70942044",
"0.7073698",
"0.70568985",
"0.7014124",
"0.70055413",
"0.68394065",
"0.6799835",
"0.6793129",
"0.6751323",
"0.67067164",
"0.67010903",
"0.6666075",
"0.66097975",
"0.6598264",
"0.6559495",
"0.6556894",
"0.6493602",
"0.6457868",
"0.64532... | 0.644965 | 22 |
Determines the default system ID for the given public ID. | public static String getDefaultSystemID(final String publicID) {
return getSystemIDMap().get(publicID); //return the system ID corresponding to the given public ID, if we have one
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getSystemId();",
"public static Serializable getSystemId() {\n Serializable ret = null;\n if (getSystemStatic() != null) {\n ret = getSystemStatic().getDistributionManager().getId();\n }\n return ret;\n }",
"int getSysID();",
"public Number getSystemId() {\n return (Num... | [
"0.66824436",
"0.6639774",
"0.65770584",
"0.6330637",
"0.6290999",
"0.6273387",
"0.62000686",
"0.6180655",
"0.6151669",
"0.61339855",
"0.60942304",
"0.60674185",
"0.60468733",
"0.60468733",
"0.60126626",
"0.5934891",
"0.59346145",
"0.5931723",
"0.5924225",
"0.5904109",
"0.589... | 0.8632851 | 0 |
Determines the content type for the given public ID. | public static MediaType getMediaTypeForPublicID(final String publicID) {
return getMediaTypesByPublicId().get(publicID); //return the content type corresponding to the given public ID, if we have one
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String getContentType();",
"String getContentType();",
"String getContentType();",
"int getContentTypeValue();",
"public String getContentType();",
"public String getContentType();",
"public int getTypeId()\n {\n return (int) getKeyPartLong(KEY_CONTENTTYPEID, -1);\n }",
"public MimeType getM... | [
"0.586539",
"0.586539",
"0.586539",
"0.57620305",
"0.57255197",
"0.57255197",
"0.5710837",
"0.5709677",
"0.5709677",
"0.55569726",
"0.546614",
"0.5417209",
"0.53564703",
"0.53564703",
"0.5271823",
"0.5271823",
"0.5238188",
"0.52016443",
"0.5176696",
"0.51311153",
"0.5111018",... | 0.7112477 | 0 |
Determines the default root element local name for the given content type | public static String getDefaultRootElementLocalName(final MediaType mediaType) {
return getRootElementLocalNameMap().get(mediaType.toBaseTypeString()); //return the root element corresponding to the given content type base type, if we have one
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getXMLBaseNodeName();",
"@Override\n\t\tpublic String getLocalName() {\n\t\t\treturn null;\n\t\t}",
"@Override\r\n\t\tpublic String getLocalName()\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}",
"@Override\n\tpublic String getLocalName() {\n\t\treturn null;\n\t}",
"@Override\n\tpublic String ge... | [
"0.6389651",
"0.6270812",
"0.62254894",
"0.6186961",
"0.6186961",
"0.59818876",
"0.58166915",
"0.57347614",
"0.56433773",
"0.5623226",
"0.5571687",
"0.5504276",
"0.54904884",
"0.5473131",
"0.54329085",
"0.54215026",
"0.5359213",
"0.5324563",
"0.53198236",
"0.5313565",
"0.5267... | 0.7447293 | 0 |
Creates and returns a document builder without namespace awareness with no validation. An entity resolver is installed to load requested resources from local resources if possible. This allows quick local lookup of the XHTML DTDs, for example. The Sun JDK 1.5 document builder handles the BOM correctly. | public static DocumentBuilder createDocumentBuilder() {
return createDocumentBuilder(DefaultEntityResolver.getInstance());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static DocumentBuilder createDocumentBuilder(final EntityResolver entityResolver) {\n\t\treturn createDocumentBuilder(false, entityResolver); //create a document builder with no namespace awareness\n\t}",
"public static DocumentBuilder createDocumentBuilder(final boolean namespaceAware, final EntityResolv... | [
"0.6266587",
"0.61080784",
"0.61059076",
"0.5795982",
"0.5790104",
"0.5651959",
"0.5508039",
"0.54571706",
"0.54549223",
"0.54038566",
"0.5397363",
"0.5371621",
"0.53616446",
"0.53536963",
"0.53536963",
"0.53536963",
"0.53536963",
"0.5330609",
"0.532883",
"0.5319973",
"0.5291... | 0.6381855 | 0 |
Creates and returns a document builder without namespace awareness with no validation. The Sun JDK 1.5 document builder handles the BOM correctly. | public static DocumentBuilder createDocumentBuilder(final EntityResolver entityResolver) {
return createDocumentBuilder(false, entityResolver); //create a document builder with no namespace awareness
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public DocumentBuilder newDocumentBuilder()\n throws ParserConfigurationException {\n return(new DocumentBuilderImpl(this.isNamespaceAware(),\n this.isValidating()));\n }",
"public static DocumentBuilder createDocumentBuilder() {\n\t\treturn createDocumentBuilde... | [
"0.64383775",
"0.60409486",
"0.60142446",
"0.5950571",
"0.5888506",
"0.58568335",
"0.5838131",
"0.56444716",
"0.5580727",
"0.5580727",
"0.5580727",
"0.5580727",
"0.5520282",
"0.55165386",
"0.54531056",
"0.54350686",
"0.5418055",
"0.541336",
"0.5410153",
"0.5359697",
"0.535247... | 0.5462826 | 14 |
Creates and returns a document builder, specifying namespace awareness with no validation. An entity resolver is installed to load requested resources from local resources if possible. This allows quick local lookup of the XHTML DTDs, for example. The Sun JDK 1.5 document builder handles the BOM correctly. | public static DocumentBuilder createDocumentBuilder(final boolean namespaceAware) {
return createDocumentBuilder(namespaceAware, DefaultEntityResolver.getInstance());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static DocumentBuilder createDocumentBuilder(final boolean namespaceAware, final boolean validating, final EntityResolver entityResolver) {\n\t\ttry {\n\t\t\tfinal DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); //create a document builder factory\t\t\t\n\t\t\tdocumentB... | [
"0.6571287",
"0.65328306",
"0.6421984",
"0.6407403",
"0.60560924",
"0.58157885",
"0.5668398",
"0.56668484",
"0.56542027",
"0.5545254",
"0.5491412",
"0.548051",
"0.54756767",
"0.54756767",
"0.54756767",
"0.54756767",
"0.5374165",
"0.53520954",
"0.5342362",
"0.5291259",
"0.5278... | 0.58317316 | 5 |
Creates and returns a document builder, specifying namespace awareness with no validation. The Sun JDK 1.5 document builder handles the BOM correctly. | public static DocumentBuilder createDocumentBuilder(final boolean namespaceAware, final EntityResolver entityResolver) {
return createDocumentBuilder(namespaceAware, false, entityResolver); //create a document builder with no validation
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public DocumentBuilder newDocumentBuilder()\n throws ParserConfigurationException {\n return(new DocumentBuilderImpl(this.isNamespaceAware(),\n this.isValidating()));\n }",
"public static DocumentBuilder createDocumentBuilder() {\n\t\treturn createDocumentBuilde... | [
"0.6744478",
"0.6206407",
"0.59965396",
"0.5960604",
"0.59396905",
"0.5923905",
"0.5914778",
"0.5870181",
"0.5715555",
"0.5715555",
"0.5715555",
"0.5715555",
"0.57043123",
"0.56458145",
"0.55561566",
"0.55210817",
"0.55155957",
"0.54915637",
"0.54875696",
"0.531219",
"0.53069... | 0.56724393 | 13 |
Creates and returns a document builder, specifying namespace awareness and validation. An entity resolver is installed to load requested resources from local resources if possible. This allows quick local lookup of the XHTML DTDs, for example. The Sun JDK 1.5 document builder handles the BOM correctly. | public static DocumentBuilder createDocumentBuilder(final boolean namespaceAware, final boolean validating) {
return createDocumentBuilder(namespaceAware, validating, DefaultEntityResolver.getInstance());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static DocumentBuilder createDocumentBuilder(final boolean namespaceAware, final boolean validating, final EntityResolver entityResolver) {\n\t\ttry {\n\t\t\tfinal DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); //create a document builder factory\t\t\t\n\t\t\tdocumentB... | [
"0.68714255",
"0.6586943",
"0.6336364",
"0.63241494",
"0.6075058",
"0.5902205",
"0.5681493",
"0.5675158",
"0.5623389",
"0.559091",
"0.55157685",
"0.5506301",
"0.55042464",
"0.5482273",
"0.5433276",
"0.5417494",
"0.5416828",
"0.5413278",
"0.5352233",
"0.5352233",
"0.5352233",
... | 0.6095944 | 4 |
Creates and returns a document builder, specifying namespace awareness and validation. The Sun JDK 1.5 document builder handles the BOM correctly. | public static DocumentBuilder createDocumentBuilder(final boolean namespaceAware, final boolean validating, final EntityResolver entityResolver) {
try {
final DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); //create a document builder factory
documentBuilderFactory.setNamespaceAware(namespaceAware); //set namespace awareness appropriately
documentBuilderFactory.setValidating(validating); //set validating appropriately
//prevent a NullPointerException in some cases when using the com.sun.org.apache.xerces.internal parser
//see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6181020
//see http://issues.apache.org/jira/browse/XERCESJ-977
//http://forums.sun.com/thread.jspa?threadID=5390848
try {
documentBuilderFactory.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", false);
} catch(final Throwable throwable) {
} //if the parser doesn't support this feature, it's probably not the buggy Xerces parser, so we're in an even better situation; normally we'd expect a ParserConfigurationException, but sometimes a java.lang.AbstractMethodError is thrown by javax.xml.parsers.DocumentBuilderFactory.setFeature(Ljava/lang/String;Z)V
final DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); //create a new document builder
if(entityResolver != null) { //if an entity resolver was given
documentBuilder.setEntityResolver(entityResolver); //install the given entity resolver
}
return documentBuilder; //return the configured document builder
} catch(final ParserConfigurationException parserConfigurationException) { //if the requested parser is not supported
throw new ConfiguredStateException(parserConfigurationException);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public DocumentBuilder newDocumentBuilder()\n throws ParserConfigurationException {\n return(new DocumentBuilderImpl(this.isNamespaceAware(),\n this.isValidating()));\n }",
"public static DocumentBuilder createDocumentBuilder() {\n\t\treturn createDocumentBuilde... | [
"0.6835705",
"0.6301062",
"0.62038094",
"0.6146414",
"0.60288364",
"0.5839507",
"0.58239436",
"0.57501227",
"0.5735056",
"0.5696623",
"0.56846225",
"0.56846225",
"0.56846225",
"0.56846225",
"0.5666294",
"0.5659666",
"0.56413084",
"0.5629912",
"0.5626581",
"0.5600351",
"0.5566... | 0.5907825 | 5 |
Returns a list of all elements from the given list of nodes. | public static List<Element> getElements(final List<Node> nodes) {
return getElementsAsType(nodes, Node.ELEMENT_NODE, Element.class);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Iterable<? extends XomNode> elements();",
"private static List<String> getElementsAsStrings(\r\n Collection<? extends JsonNode> nodes)\r\n {\r\n List<String> result = new ArrayList<String>();\r\n for (JsonNode n : nodes)\r\n {\r\n result.add(n.toString());\r\n }\r... | [
"0.6887565",
"0.6687382",
"0.6543986",
"0.6531959",
"0.647995",
"0.64453703",
"0.63379055",
"0.62938946",
"0.62474865",
"0.6234656",
"0.62208945",
"0.6124673",
"0.6032189",
"0.599786",
"0.59941334",
"0.59840256",
"0.5911925",
"0.5906847",
"0.58039534",
"0.5760412",
"0.5759974... | 0.6820061 | 1 |
Returns a list of all nodes of a given type from the given list of nodes. | protected static <N extends Node> List<N> getElementsAsType(final List<Node> nodes, final short nodeType, final Class<N> nodeClass) {
final List<N> nodesAsType = new ArrayList<N>();
for(final Node node : nodes) { //look at all the nodes
if(node.getNodeType() == nodeType) { //if this node is of the correct type
nodesAsType.add(nodeClass.cast(node)); //cast and add the node to the list
}
}
return nodesAsType;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Node[] getNodes(String type)\r\n {\r\n\treturn getNodes(type, new NodeFilter()\r\n\t { public final boolean accept(Node n) { return true; }});\r\n }",
"<T> Collection<T> get(Class<T> type, Iterable<Node> nodes);",
"private List<T> transform(List<T> nodes) {\n List<T> transformed = new Ar... | [
"0.69517106",
"0.6595317",
"0.6469385",
"0.6429424",
"0.635437",
"0.62068874",
"0.6078052",
"0.6064219",
"0.60491955",
"0.6006696",
"0.60029244",
"0.59809685",
"0.5974095",
"0.59438026",
"0.5753209",
"0.57027996",
"0.5661298",
"0.56587666",
"0.5619972",
"0.56083804",
"0.55866... | 0.6787339 | 1 |
Returns the owner document of the given node or, if the node is a document, returns the node itself. | public static Document getDocument(final Node node) {
return node.getNodeType() == Node.DOCUMENT_NODE ? (Document)node : node.getOwnerDocument(); //return the node if it is a document, otherwise return the node's owner document
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\t\tpublic Document getOwnerDocument()\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}",
"User getOwner();",
"public final String getOwnerName() {\n return ElementUtils.getDeclaringClassName(node);\n }",
"java.lang.String getOwner();",
"java.lang.String getOwner();",
"public T getOwner... | [
"0.664407",
"0.62547106",
"0.6083105",
"0.598638",
"0.598638",
"0.5951494",
"0.5919848",
"0.5878809",
"0.58631545",
"0.5849175",
"0.5716765",
"0.5714579",
"0.5714579",
"0.5666387",
"0.56315935",
"0.5615617",
"0.56103206",
"0.5600375",
"0.5600375",
"0.5600375",
"0.5600375",
... | 0.67020625 | 0 |
Returns the first node in the hierarchy, beginning with the specified node and continuing with a depthfirst search, that has a particular node type. | public static Node getFirstNode(final Node node, final int whatToShow) {
//create a node iterator that will only return the types of nodes we want
final NodeIterator nodeIterator = ((DocumentTraversal)node.getOwnerDocument()).createNodeIterator(node, whatToShow, null, false); //TODO should we set expandEntityReferences to true or false? true?
return nodeIterator.nextNode(); //get the next node (which will be the first node) and return it
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Node<TokenAttributes> findFirst(Node<TokenAttributes> current_node) {\n if (current_node.getParent() != null && current_node.getParent().getChildren().size() == 1) {\n return findFirst(current_node.getParent());\n }\n if (current_node.getParent() == null) {\n retu... | [
"0.628297",
"0.613768",
"0.5987904",
"0.59660935",
"0.5965902",
"0.593079",
"0.5920346",
"0.58829767",
"0.5802119",
"0.57967854",
"0.5783783",
"0.5778813",
"0.5735832",
"0.57345027",
"0.57139283",
"0.5699923",
"0.5697586",
"0.56779444",
"0.56765646",
"0.5676067",
"0.56749874"... | 0.6092053 | 2 |
Returns the index of a given node in a node list. | public static int indexOf(final NodeList nodeList, final Node node) {
final int nodeCount = nodeList.getLength(); //see how many nodes there are
for(int i = 0; i < nodeCount; ++i) { //look at each node
if(nodeList.item(i) == node) //if the node at this index matches our node
return i; //show the index as which the node occurs
}
return -1; //show that we were not able to find a matching node
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getIndex(TreeNode node) { \n for (int i=0; i<data.length; i++) \n if (data[i].equals(node)) return i; \n return -1; \n }",
"private int findNodeInList(List<Node> nodelist, Node n) throws Exception {\r\n for (int i=0; i<nodelist.size(); i++) {\r\n ... | [
"0.7407805",
"0.7206739",
"0.7198801",
"0.7095806",
"0.6975307",
"0.68944955",
"0.687878",
"0.68213385",
"0.6795384",
"0.6743404",
"0.66951287",
"0.66726625",
"0.65940976",
"0.653392",
"0.6527736",
"0.6505971",
"0.6453443",
"0.6433832",
"0.6410302",
"0.63117826",
"0.6302357",... | 0.7018165 | 4 |
Determines if the given media type is one representing XML in some form. XML media types include: text/xml application/xml application/+xml | public static boolean isXML(final MediaType mediaType) {
if(mediaType != null) { //if a content type is given
if(mediaType.hasBaseType(XML.MEDIA_TYPE)) { //if this is "text/xml"
return true; //text/xml is an XML content type
}
if(MediaType.APPLICATION_PRIMARY_TYPE.equals(mediaType.getPrimaryType())) { //if this is "application/*"
return ASCII.equalsIgnoreCase(mediaType.getSubType(), XML.MEDIA_TYPE.getSubType()) //see if the subtype is "xml"
|| mediaType.hasSubTypeSuffix(XML_SUBTYPE_SUFFIX); //see if the subtype has an XML suffix
}
}
return false; //this is not a media type we recognize as being XML
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static boolean isXmlMimeType(String mimeType)\n {\n return mimeType != null &&\n (\n \"text/xml\".equals(mimeType) ||\n \"application/xml\".equals(mimeType) ||\n mimeType.endsWith(\"+xml\")\n );\n }",
"public static boolean is... | [
"0.7114341",
"0.6457293",
"0.62131965",
"0.6200523",
"0.5955007",
"0.5887819",
"0.584405",
"0.5837282",
"0.5634233",
"0.5539727",
"0.5533192",
"0.54747415",
"0.54507643",
"0.5412428",
"0.5347216",
"0.5174522",
"0.5156621",
"0.51150167",
"0.51141787",
"0.51076037",
"0.5099325"... | 0.8107403 | 0 |
Determines if the given media type is one representing an XML external parsed entity in some form. XML external parsed entities include: text/xmlexternalparsedentity application/xmlexternalparsedentity text/+xmlexternalparsedentity (not formally defined) application/+xmlexternalparsedentity (not formally defined) | public static boolean isXMLExternalParsedEntity(final MediaType mediaType) {
if(mediaType != null) { //if a content type is given
final String primaryType = mediaType.getPrimaryType(); //get the primary type
if(ASCII.equalsIgnoreCase(primaryType, MediaType.TEXT_PRIMARY_TYPE) || ASCII.equalsIgnoreCase(primaryType, MediaType.APPLICATION_PRIMARY_TYPE)) { //if this is "text/*" or "application/*"
final String subType = mediaType.getSubType(); //get the subtype
return ASCII.equalsIgnoreCase(subType, XML.EXTERNAL_PARSED_ENTITY_MEDIA_TYPE.getSubType()) //if the subtype is /xml-external-parsed-entity
|| mediaType.hasSubTypeSuffix(XML_EXTERNAL_PARSED_ENTITY_SUBTYPE_SUFFIX); //or if the subtype has an XML external parsed entity suffix
}
}
return false; //this is not a media type we recognize as being an XML external parsed entity
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static boolean isXML(final MediaType mediaType) {\n\t\tif(mediaType != null) { //if a content type is given\n\t\t\tif(mediaType.hasBaseType(XML.MEDIA_TYPE)) { //if this is \"text/xml\"\n\t\t\t\treturn true; //text/xml is an XML content type\n\t\t\t}\n\t\t\tif(MediaType.APPLICATION_PRIMARY_TYPE.equals(mediaT... | [
"0.6321521",
"0.56443745",
"0.54583484",
"0.51393133",
"0.5066191",
"0.50479823",
"0.503887",
"0.50168",
"0.50145984",
"0.4972858",
"0.49279642",
"0.49214002",
"0.49006128",
"0.48927847",
"0.48319337",
"0.47966382",
"0.4778674",
"0.47782817",
"0.47713938",
"0.47633374",
"0.47... | 0.836472 | 0 |
Replaces special XML symbols with their escaped versions, (e.g. replaces '<' with "<") so that the string is valid XML content. | public static String createValidContent(final String string) {
return Strings.replace(string, XML_ENTITY_CHARS, XML_ENTITY_REPLACMENTS); //do the replacements for the special XML symbols and return the results
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private String escapeXML(String string) {\n StringBuffer sb = new StringBuffer();\n int length = string.length();\n for (int i = 0; i < length; ++i) {\n char c = string.charAt(i);\n switch (c) {\n case '&':\n sb.append(\"&\");\n ... | [
"0.7423155",
"0.7283145",
"0.6901273",
"0.68441767",
"0.6793052",
"0.6708967",
"0.6513637",
"0.6500759",
"0.64626366",
"0.62192327",
"0.6045293",
"0.6024207",
"0.59924746",
"0.5990379",
"0.59050804",
"0.58959407",
"0.58760697",
"0.5865257",
"0.5855758",
"0.5850005",
"0.583009... | 0.67251897 | 5 |
Creates a string in which all illegal XML characters are replaced with the space character. | public static String createValidString(final String string) {
StringBuilder stringBuilder = null; //we'll only create a string buffer if there are invalid characters
for(int i = string.length() - 1; i >= 0; --i) { //look at all the characters in the string
if(!isChar(string.charAt(i))) { //if this is not a valid character
if(stringBuilder == null) //if we haven't create a string buffer, yet
stringBuilder = new StringBuilder(string); //create a string buffer to hold our replacements
stringBuilder.setCharAt(i, SPACE_CHAR); //replace this character with a space
}
}
return stringBuilder != null ? stringBuilder.toString() : string; //return the original string unless we've actually modified something
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private String removeNonValidXMLCharacters(String description) {\r\n StringBuilder output = new StringBuilder();\r\n char current;\r\n\r\n if (description == null || description.compareTo(\"\") == 0) {\r\n return \"\";\r\n }\r\n \r\n for (int i = 0; i < descript... | [
"0.6637022",
"0.65660936",
"0.6254375",
"0.6014581",
"0.60027266",
"0.59574735",
"0.5855567",
"0.5841952",
"0.58217233",
"0.579019",
"0.57322705",
"0.5693664",
"0.56885904",
"0.56874937",
"0.5538461",
"0.5530947",
"0.54318184",
"0.5423731",
"0.5370376",
"0.53552514",
"0.53472... | 0.0 | -1 |
Creates a namespace URI from the given namespace string. This method attempts to compensate for XML documents that include a namespace string that is not a true URI, notably the DAV: namespace "URI" used by WebDAV. In such a case as DAV:, the URI DAV:/ would be returned. | public static URI toNamespaceURI(String namespace) {
if(namespace == null) {
return null;
}
final int schemeSeparatorIndex = namespace.indexOf(URIs.SCHEME_SEPARATOR); //find out where the scheme ends
if(schemeSeparatorIndex == namespace.length() - 1) { //if the scheme separator is at the end of the string (i.e. there is no scheme-specific part, e.g. "DAV:")
namespace += URIs.PATH_SEPARATOR; //append a path separator (e.g. "DAV:/")
}
return URI.create(namespace); //create a URI from the namespace
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getURIInternal(String str) {\n String namespaceURI = this.context.getNamespaceURI(str);\n return namespaceURI == null ? \"\" : namespaceURI;\n }",
"public void setNameSpaceURI(String nsURI) {\n this.nsURI = nsURI;\n }",
"@Test\n\tpublic void test_TCM__String_getNamespac... | [
"0.6372402",
"0.58607113",
"0.5846145",
"0.58439887",
"0.5732919",
"0.57083786",
"0.5698038",
"0.5681272",
"0.5452934",
"0.53583366",
"0.5326203",
"0.5316355",
"0.5316355",
"0.5316355",
"0.52627087",
"0.52427566",
"0.5232249",
"0.52111214",
"0.5205637",
"0.5120673",
"0.509822... | 0.766401 | 0 |
Adds a stylesheet to the XML document using the standard <?xmlstylesheet...> processing instruction notation. | public static void addStyleSheetReference(final Document document, final String href, final MediaType mediaType) {
final String target = XML_STYLESHEET_PROCESSING_INSTRUCTION; //the PI target will be the name of the stylesheet processing instruction
final StringBuilder dataStringBuilder = new StringBuilder(); //create a string buffer to construct the data parameter (with its pseudo attributes)
//add: href="href"
dataStringBuilder.append(HREF_ATTRIBUTE).append(EQUAL_CHAR).append(DOUBLE_QUOTE_CHAR).append(href).append(DOUBLE_QUOTE_CHAR);
dataStringBuilder.append(SPACE_CHAR); //add a space between the pseudo attributes
//add: type="type"
dataStringBuilder.append(TYPE_ATTRIBUTE).append(EQUAL_CHAR).append(DOUBLE_QUOTE_CHAR).append(mediaType).append(DOUBLE_QUOTE_CHAR);
final String data = dataStringBuilder.toString(); //convert the data string buffer to a string
final ProcessingInstruction processingInstruction = document.createProcessingInstruction(target, data); //create a processing instruction with the correct information
document.appendChild(processingInstruction); //append the processing instruction to the document
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public XMLDocument addStylesheet (String href)\r\n\t{\r\n\t\treturn addStylesheet (href, \"text/xsl\");\r\n\t}",
"public XMLDocument addStylesheet (String href, String type)\r\n\t{\r\n\t\tPI pi = new PI ();\r\n\t\tpi.setTarget (\"xml-stylesheet\").addInstruction (\"href\", href)\r\n\t\t\t.addInstruction (\"type\... | [
"0.7901633",
"0.7189024",
"0.6169377",
"0.6010428",
"0.5613644",
"0.55823237",
"0.5563533",
"0.5473443",
"0.51517934",
"0.5150531",
"0.5101548",
"0.5071949",
"0.48439696",
"0.47195613",
"0.46846378",
"0.46772754",
"0.46086088",
"0.45837134",
"0.45788395",
"0.45123073",
"0.448... | 0.5803679 | 4 |
Performs a clone on the children of the source node and adds them to the destination node. | public static void appendClonedChildNodes(final Node destinationNode, final Node sourceNode, final boolean deep) {
final NodeList sourceNodeList = sourceNode.getChildNodes(); //get the list of child nodes
final int sourceNodeCount = sourceNodeList.getLength(); //find out how many nodes there are
for(int i = 0; i < sourceNodeCount; ++i) { //look at each of the source nodes
final Node sourceChildNode = sourceNodeList.item(i); //get a reference to this child node
destinationNode.appendChild(sourceChildNode.cloneNode(deep)); //clone the node and add it to the destination node
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void clone(Node<T> sourceNode, Node<T> cloneNode) {\n Node<T> tmp;\n Collection<Node<T>> collection = sourceNode.getChildren();\n for (Node<T> child : collection) {\n tmp = child.clone();\n if (sourceNode.getParent() != null) tmp.setParent(cloneNode);\n ... | [
"0.7672977",
"0.65599555",
"0.65018475",
"0.64505863",
"0.6181544",
"0.5980662",
"0.5954176",
"0.5941503",
"0.58623487",
"0.58385235",
"0.57959056",
"0.5674605",
"0.5657538",
"0.56209844",
"0.56080806",
"0.55951196",
"0.5588342",
"0.55350155",
"0.5533956",
"0.55331814",
"0.54... | 0.76435345 | 1 |
Performs a deep import on the children of the source node and adds them to the destination node. | public static void appendImportedChildNodes(final Node destinationNode, final Node sourceNode) {
appendImportedChildNodes(destinationNode, sourceNode, true); //import and append all descendant nodes
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void appendImportedChildNodes(final Node destinationNode, final Node sourceNode, final boolean deep) {\n\t\tfinal Document destinationDocument = destinationNode.getOwnerDocument(); //get the owner document of the destination node\n\t\tfinal NodeList sourceNodeList = sourceNode.getChildNodes(); //get ... | [
"0.78235465",
"0.66442937",
"0.5944528",
"0.57039815",
"0.5543956",
"0.5282269",
"0.52220726",
"0.5188777",
"0.5172321",
"0.5026835",
"0.4942138",
"0.48674038",
"0.48489597",
"0.4827713",
"0.4795873",
"0.4772733",
"0.47673544",
"0.47341183",
"0.47101265",
"0.46428752",
"0.464... | 0.70113844 | 1 |
Performs an import on the children of the source node and adds them to the destination node. | public static void appendImportedChildNodes(final Node destinationNode, final Node sourceNode, final boolean deep) {
final Document destinationDocument = destinationNode.getOwnerDocument(); //get the owner document of the destination node
final NodeList sourceNodeList = sourceNode.getChildNodes(); //get the list of child nodes
final int sourceNodeCount = sourceNodeList.getLength(); //find out how many nodes there are
for(int i = 0; i < sourceNodeCount; ++i) { //look at each of the source nodes
final Node sourceChildNode = sourceNodeList.item(i); //get a reference to this child node
destinationNode.appendChild(destinationDocument.importNode(sourceChildNode, deep)); //import the node and add it to the destination node
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void appendImportedChildNodes(final Node destinationNode, final Node sourceNode) {\n\t\tappendImportedChildNodes(destinationNode, sourceNode, true); //import and append all descendant nodes\n\t}",
"public void convertAll() {\n Document dom = null;\n long beginTime = System.currentTimeMill... | [
"0.7118162",
"0.6051792",
"0.5799889",
"0.5751899",
"0.56776166",
"0.5674889",
"0.55491763",
"0.52736014",
"0.5125997",
"0.49673638",
"0.4950876",
"0.49399543",
"0.49242783",
"0.4881006",
"0.48732314",
"0.48169377",
"0.48002866",
"0.477369",
"0.47624356",
"0.47281757",
"0.469... | 0.7320547 | 0 |
Performs a clone on the attributes of the source node and adds them to the destination node. It is assumed that all attributes have been added using namespace aware methods. | public static void appendClonedAttributeNodesNS(final Element destinationElement, final Element sourceElement) {
final NamedNodeMap attributeNodeMap = sourceElement.getAttributes(); //get the source element's attributes
final int sourceNodeCount = attributeNodeMap.getLength(); //find out how many nodes there are
for(int i = 0; i < sourceNodeCount; ++i) { //look at each of the source nodes
final Node sourceAttributeNode = attributeNodeMap.item(i); //get a reference to this attribute node
destinationElement.setAttributeNodeNS((Attr)sourceAttributeNode.cloneNode(true)); //clone the attribute and add it to the destination element
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void copyAttributes(StyleContext.NamedStyle fromNode, StyleContext.NamedStyle toNode)\n\t{\n\n\t\tNamedStyle copy = new NamedStyle();\n\t\tcopy.addAttributes(fromNode);\n\t\tcopy.removeAttribute(StyleConstants.ResolveAttribute);\n\t\tcopy.removeAttribute(\"children\");\n\n\t\ttoNode.addAttributes(copy);\n\... | [
"0.74843764",
"0.6441136",
"0.6331673",
"0.6315059",
"0.6149927",
"0.6145945",
"0.6039326",
"0.6023636",
"0.59994924",
"0.5995247",
"0.59847873",
"0.59655637",
"0.5891865",
"0.5862986",
"0.58065367",
"0.57751215",
"0.57498306",
"0.5706793",
"0.56225044",
"0.5612367",
"0.56034... | 0.7758714 | 0 |
Creates a text node with the specified character and appends it to the specified element. | public static Text appendText(final Element element, final char textCharacter) throws DOMException {
return appendText(element, String.valueOf(textCharacter)); //convert the character to a string and append it to the element
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Element addTextNode(Element parent, String tag, String content) {\r\n\t\tElement child = mDocument.createElement(tag);\r\n\t\tchild.setTextContent(content);\r\n\t\tparent.appendChild(child);\r\n\t\treturn child;\r\n\t}",
"@Override\n public void characters(char[] ch, int start, int length) {\n Node c... | [
"0.6917145",
"0.6749671",
"0.6731486",
"0.6653752",
"0.6588812",
"0.6379174",
"0.6115181",
"0.61083084",
"0.5966182",
"0.5955189",
"0.5940912",
"0.5928827",
"0.5839947",
"0.58230764",
"0.5756008",
"0.5734709",
"0.568804",
"0.567582",
"0.56568104",
"0.56520855",
"0.5641855",
... | 0.78207976 | 0 |
Creates a text node with the specified text and appends it to the specified element. | public static Text appendText(final Element element, final String textString) throws DOMException {
final Text textNode = element.getOwnerDocument().createTextNode(textString); //create a new text node with the specified text
element.appendChild(textNode); //append the text node to our paragraph
return textNode; //return the text node we created
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Element addText(String text) {\n Assert.isTrue(text != null, \"Text is null\");\n element.appendChild(element.getOwnerDocument().createTextNode(text));\n\n return this;\n }",
"ElementText createElementText();",
"public XmlProtoElementBuilder addChildText(String text) {\n eleme... | [
"0.793173",
"0.76244104",
"0.7539421",
"0.74562633",
"0.7339987",
"0.7237903",
"0.7198381",
"0.7093983",
"0.6888588",
"0.68154263",
"0.67900676",
"0.67641026",
"0.6741093",
"0.6647426",
"0.66229135",
"0.66134",
"0.6586631",
"0.6433303",
"0.64196175",
"0.6385477",
"0.6382246",... | 0.7376156 | 4 |
Sets the a text node with the specified text as the child of the specified element, removing all other children. | public static Text setText(final Element element, final String textString) throws DOMException {
return appendText(removeChildren(element), textString);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void xsetText(org.apache.xmlbeans.XmlString text)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(TEXT$0, 0);\n if (targe... | [
"0.65148795",
"0.64308596",
"0.6401916",
"0.6394209",
"0.6353761",
"0.63151777",
"0.62541205",
"0.62441164",
"0.61518633",
"0.61427265",
"0.6132312",
"0.609373",
"0.6042932",
"0.6037003",
"0.6000809",
"0.5978641",
"0.59366876",
"0.591586",
"0.5912719",
"0.5897618",
"0.5885681... | 0.68036705 | 0 |
Convenience function to create an element and add it as a child of the given parent element. | public static Element appendElementNS(@Nonnull final Element parentElement, @Nullable final String elementNamespaceURI, @Nonnull final String elementName) {
return appendElementNS(parentElement, elementNamespaceURI, elementName, null); //append the element with no text
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static native ExtElement append(Element parent, Element child)/*-{\r\n\t\tvar obj = $wnd.Ext.DomHelper.append(parent, child, true);\r\n\t\treturn @com.ait.toolkit.sencha.shared.client.dom.ExtElement::new(Lcom/google/gwt/core/client/JavaScriptObject;)(obj);\r\n\t}-*/;",
"public static native ExtElement app... | [
"0.73550403",
"0.6979968",
"0.6412656",
"0.63451153",
"0.63451153",
"0.63451153",
"0.63451153",
"0.63451153",
"0.63451153",
"0.63451153",
"0.61664295",
"0.6151597",
"0.6085832",
"0.60464436",
"0.6036905",
"0.5991629",
"0.5961524",
"0.5939609",
"0.58729064",
"0.5869573",
"0.58... | 0.51919216 | 59 |
Convenience function to create an element, add it as a child of the given parent element, and add optional text as a child of the given element. A heading, for instance, might be added using appendElementNS(bodyElement, XHTML_NAMESPACE_URI, ELEMENT_H2, "My Heading");. | public static Element appendElementNS(@Nonnull Element parentElement, @Nullable final String elementNamespaceURI, @Nonnull final String elementQualifiedName,
@Nullable String textContent) {
final Element childElement = createElementNS(parentElement.getOwnerDocument(), elementNamespaceURI, elementQualifiedName, textContent); //create the new element
parentElement.appendChild(childElement); //add the child element to the parent element
return childElement; //return the element we created
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Element addTextNode(Element parent, String tag, String content) {\r\n\t\tElement child = mDocument.createElement(tag);\r\n\t\tchild.setTextContent(content);\r\n\t\tparent.appendChild(child);\r\n\t\treturn child;\r\n\t}",
"public static native ExtElement append(Element parent, Element child)/*-{\r\n\t\tva... | [
"0.65765584",
"0.6576331",
"0.6484843",
"0.6457788",
"0.60967296",
"0.6003735",
"0.6000154",
"0.5878604",
"0.5830362",
"0.58156353",
"0.5698491",
"0.5684429",
"0.5677199",
"0.5616058",
"0.547474",
"0.54500484",
"0.54441416",
"0.54441416",
"0.54441416",
"0.54441416",
"0.544414... | 0.644084 | 4 |
Creates a document wrapped around a copy of the given element. | public static Document createDocument(final Element element) {
final DOMImplementation domImplementation = element.getOwnerDocument().getImplementation(); //get the DOM implementation used to create the document
//create a new document corresponding to the element
//TODO bring over the doctype, if needed
final Document document = domImplementation.createDocument(element.getNamespaceURI(), element.getNodeName(), null);
final Node importedNode = document.importNode(element, true); //import the element into our new document
document.replaceChild(importedNode, document.getDocumentElement()); //set the element clone as the document element of the new document
return document; //return the document we created
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static Document createCopiedDocument(Document originalDocument) {\n DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\n DocumentBuilder db;\n Document copiedDocument = null;\n try {\n db = dbf.newDocumentBuilder();\n Node originalRoot = ori... | [
"0.6865383",
"0.6069923",
"0.6026034",
"0.591569",
"0.57010406",
"0.56653434",
"0.5643853",
"0.5632833",
"0.56217736",
"0.56005293",
"0.5597957",
"0.5586847",
"0.5551397",
"0.5449396",
"0.5438672",
"0.542902",
"0.540336",
"0.53678083",
"0.53667706",
"0.5358976",
"0.5327168",
... | 0.7245595 | 0 |
Extracts a single node from its parent and places it in a document fragment. The node is removed from its parent. | public static DocumentFragment extractNode(final Node node) throws DOMException {
return extractNode(node, true); //extract the node by removing it
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static DocumentFragment extractNode(final Node node, final boolean remove) throws DOMException {\n\t\tfinal Document ownerDocument = node.getOwnerDocument(); //get the node owner document\n\t\tif(ownerDocument == null) { //if there is no owner document\n\t\t\tthrow new IllegalArgumentException(\"Node \" + n... | [
"0.5834212",
"0.5816168",
"0.57155603",
"0.56264555",
"0.5551231",
"0.5420808",
"0.54164404",
"0.54157114",
"0.53338027",
"0.532796",
"0.5310119",
"0.52993685",
"0.52860844",
"0.52501106",
"0.52355283",
"0.52307934",
"0.5206866",
"0.5201882",
"0.5194363",
"0.5153542",
"0.5151... | 0.56741095 | 3 |
Extracts a single node from its parent and places it in a document fragment. | public static DocumentFragment extractNode(final Node node, final boolean remove) throws DOMException {
final Document ownerDocument = node.getOwnerDocument(); //get the node owner document
if(ownerDocument == null) { //if there is no owner document
throw new IllegalArgumentException("Node " + node + " has no owner document.");
}
final Node parentNode = node.getParentNode(); //get the node's parent
if(parentNode == null) { //if there is no parent node
throw new IllegalArgumentException("Node " + node + " has no parent node.");
}
final DocumentFragment documentFragment = ownerDocument.createDocumentFragment(); //create a document fragment to hold the nodes
if(remove) { //if we should remove the node
parentNode.removeChild(node); //remove the node from its parent
}
documentFragment.appendChild(node); //append the removed child to the document fragment
return documentFragment; //return the document fragment
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Node<T> parent();",
"public void extractFromParent() {\n this.parent.extractChild(this);\n }",
"VersionedDocument getParentDocument();",
"public RMDocument getDocument() { return _parent!=null? _parent.getDocument() : null; }",
"public Node getParent();",
"private Document getFragmentAsDocumen... | [
"0.5931304",
"0.5745999",
"0.565443",
"0.56143206",
"0.55849135",
"0.5555631",
"0.548631",
"0.54461646",
"0.5350497",
"0.5322741",
"0.5279586",
"0.52714646",
"0.5262673",
"0.52614135",
"0.52280766",
"0.52154887",
"0.52109814",
"0.52109814",
"0.51960117",
"0.51855034",
"0.5181... | 0.5296092 | 10 |
Extracts all the child nodes from the given node and places them in a document fragment. The children are removed from their parents. | public static DocumentFragment extractChildren(final Node node) throws DOMException {
return extractChildren(node, true); //extract the childen by removing them
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static DocumentFragment extractChildren(final Node node, final boolean remove) throws DOMException {\n\t\treturn extractChildren(node, 0, node.getChildNodes().getLength(), remove); //extract all the children and return the new document fragment \n\t}",
"public static DocumentFragment extractChildren(final... | [
"0.7228452",
"0.6977291",
"0.63163656",
"0.6096405",
"0.58795935",
"0.55907834",
"0.553928",
"0.53565556",
"0.52195024",
"0.5218623",
"0.5176648",
"0.5089574",
"0.5047775",
"0.4897295",
"0.48737043",
"0.47649997",
"0.47497573",
"0.47388923",
"0.46738678",
"0.46366578",
"0.461... | 0.7516749 | 0 |
Extracts all the child nodes from the given node and places them in a document fragment. | public static DocumentFragment extractChildren(final Node node, final boolean remove) throws DOMException {
return extractChildren(node, 0, node.getChildNodes().getLength(), remove); //extract all the children and return the new document fragment
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static DocumentFragment extractChildren(final Node node) throws DOMException {\n\t\treturn extractChildren(node, true); //extract the childen by removing them\n\t}",
"public static DocumentFragment extractChildren(final Node node, final int startChildIndex, final int endChildIndex)\n\t\t\tthrows ArrayInde... | [
"0.7362439",
"0.6875167",
"0.6096325",
"0.6080635",
"0.59872925",
"0.5438161",
"0.5311883",
"0.5278721",
"0.516226",
"0.5073917",
"0.50432235",
"0.48988378",
"0.48910317",
"0.48712665",
"0.48689923",
"0.48626214",
"0.47600913",
"0.46785334",
"0.46456727",
"0.46047196",
"0.457... | 0.70046663 | 1 |
Extracts the indexed nodes starting at startChildIndex up to but not including endChildIndex. The children are removed from their parents. | public static DocumentFragment extractChildren(final Node node, final int startChildIndex, final int endChildIndex)
throws ArrayIndexOutOfBoundsException, DOMException {
return extractChildren(node, startChildIndex, endChildIndex, true); //extract the childen by removing them
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static DocumentFragment extractChildren(final Node node, final int startChildIndex, final int endChildIndex, final boolean remove)\n\t\t\tthrows ArrayIndexOutOfBoundsException, DOMException {\n\t\tfinal Document ownerDocument = node.getOwnerDocument(); //get the node owner document\n\t\tif(ownerDocument == ... | [
"0.61878735",
"0.6053022",
"0.6000327",
"0.527544",
"0.5251666",
"0.5189212",
"0.5187719",
"0.5175895",
"0.51097697",
"0.5094075",
"0.5074103",
"0.50663716",
"0.5029691",
"0.5022244",
"0.5014797",
"0.50108206",
"0.50096303",
"0.50072175",
"0.49543682",
"0.4949224",
"0.4946732... | 0.67234933 | 0 |
Extracts the indexed nodes starting at startChildIndex up to but not including endChildIndex. | public static DocumentFragment extractChildren(final Node node, final int startChildIndex, final int endChildIndex, final boolean remove)
throws ArrayIndexOutOfBoundsException, DOMException {
final Document ownerDocument = node.getOwnerDocument(); //get the node owner document
if(ownerDocument == null) { //if there is no owner document
throw new IllegalArgumentException("Node " + node + " has no owner document.");
}
final NodeList childNodeList = node.getChildNodes(); //get a reference to the child nodes
final int childNodeCount = childNodeList.getLength(); //find out how many child nodes there are
if(startChildIndex < 0 || (endChildIndex > startChildIndex && startChildIndex >= childNodeCount)) //if the start child index is out of range
throw new ArrayIndexOutOfBoundsException(startChildIndex); //throw an exception indicating the illegal index
if(endChildIndex < 0 || (endChildIndex > startChildIndex && endChildIndex > childNodeCount)) //if the ending child index is out of range
throw new ArrayIndexOutOfBoundsException(endChildIndex); //throw an exception indicating the illegal index
final DocumentFragment documentFragment = ownerDocument.createDocumentFragment(); //create a document fragment to hold the nodes
Node lastAddedNode = null; //show that we haven't added any nodes, yet
for(int i = endChildIndex - 1; i >= startChildIndex; --i) { //starting from the end, look at all the indexes before the ending index
final Node childNode = childNodeList.item(i); //find the item at the given index
if(remove) { //if we should remove the node
node.removeChild(childNode); //remove the child node
}
if(lastAddedNode == null) //for the first node we add
documentFragment.appendChild(childNode); //append the removed child to the document fragment
else
//for all other nodes
documentFragment.insertBefore(childNode, lastAddedNode); //insert this child before the last one
lastAddedNode = childNode; //show that we just added another node
}
return documentFragment; //return the document fragment we created
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static DocumentFragment extractChildren(final Node node, final int startChildIndex, final int endChildIndex)\n\t\t\tthrows ArrayIndexOutOfBoundsException, DOMException {\n\t\treturn extractChildren(node, startChildIndex, endChildIndex, true); //extract the childen by removing them\n\t}",
"public List<ICon... | [
"0.63664937",
"0.59669596",
"0.5335443",
"0.53119993",
"0.5300613",
"0.52152956",
"0.51988673",
"0.51975656",
"0.5145602",
"0.5134002",
"0.5118406",
"0.5107079",
"0.50952893",
"0.5089469",
"0.5071731",
"0.5045741",
"0.5037183",
"0.49954376",
"0.49948546",
"0.49371833",
"0.493... | 0.57565635 | 2 |
Retrieves the first child node of the specified type. | public static Node getChildNode(final Node node, final int nodeType) {
final NodeList childNodeList = node.getChildNodes(); //get a reference to the child nodes
final int childCount = childNodeList.getLength(); //find out how many children there are
for(int i = 0; i < childCount; ++i) { //look at each of the children
final Node childNode = childNodeList.item(i); //get a reference to this node
if(childNode.getNodeType() == nodeType) { //if this node is of the correct type
return childNode; //return this child node
}
}
return null; //indicate that no matching nodes were found
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Node getChild();",
"public ChildType getChildAt( int index );",
"HNode getFirstChild();",
"public <T extends AbstractSceneElement> T getChildOfClass(Class<T> childClass) {\n for(AbstractSceneElement element : children) {\n if(element.getClass() == childClass) {\n retur... | [
"0.6310839",
"0.628313",
"0.59135896",
"0.56944394",
"0.5688749",
"0.56801176",
"0.56497717",
"0.5636237",
"0.56361926",
"0.5624372",
"0.5612218",
"0.5611978",
"0.5610221",
"0.558354",
"0.5578829",
"0.55771023",
"0.5556099",
"0.55455333",
"0.5537706",
"0.55173934",
"0.5515031... | 0.6153684 | 2 |
Retrieves the first child node not of the specified type. | public static Node getChildNodeNot(final Node node, final int nodeType) {
final NodeList childNodeList = node.getChildNodes(); //get a reference to the child nodes
final int childCount = childNodeList.getLength(); //find out how many children there are
for(int i = 0; i < childCount; ++i) { //look at each of the children
final Node childNode = childNodeList.item(i); //get a reference to this node
if(childNode.getNodeType() != nodeType) { //if this node is not of the specified type
return childNode; //return this child node
}
}
return null; //indicate that no non-matching nodes were found
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private TreeNode getOnlyChild() {\n return templateRoot.getChildren().get(0);\n }",
"@Override\r\n\t\tpublic Node getFirstChild()\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}",
"public Node getChild();",
"public ChildType getChildAt( int index );",
"@Override\r\n\t\tpublic Node getLastChild()\r\n\... | [
"0.64641714",
"0.613415",
"0.59484005",
"0.581883",
"0.57841563",
"0.5735501",
"0.5733877",
"0.5733328",
"0.565491",
"0.56527275",
"0.558957",
"0.5589386",
"0.5566831",
"0.55419105",
"0.55142236",
"0.5503022",
"0.5502998",
"0.54920566",
"0.5460585",
"0.54041195",
"0.53804797"... | 0.6547253 | 0 |
Retrieves the text of the node contained in child nodes of type Node.Text. If deep is set to true the text of all descendant nodes in document (depthfirst) order; otherwise, only text of direct children will be returned. | public static StringBuilder getText(final Node node, final Set<String> blockElementNames, final boolean deep, final StringBuilder stringBuilder) {
final NodeList childNodeList = node.getChildNodes(); //get a reference to the child nodes
final int childCount = childNodeList.getLength(); //find out how many children there are
for(int i = 0; i < childCount; ++i) { //look at each of the children
final Node childNode = childNodeList.item(i); //get a reference to this node
switch(childNode.getNodeType()) { //see which type of node this is
case Node.TEXT_NODE: //if this is a text node
stringBuilder.append(((Text)childNode).getData()); //append this text node data to the string buffer
break;
case Node.CDATA_SECTION_NODE: //if this is a CDATA node
stringBuilder.append(((Text)childNode).getData()); //append this text node data to the string buffer
break;
case Node.ELEMENT_NODE: //if this is an element
if(deep) { //if we should get deep text
final boolean isBlockElement = !blockElementNames.isEmpty() && blockElementNames.contains(node.getNodeName()); //separate block elements
if(isBlockElement) {
stringBuilder.append(' ');
}
getText((Element)childNode, blockElementNames, deep, stringBuilder); //append the text of this element
if(isBlockElement) {
stringBuilder.append(' ');
}
}
break;
}
}
return stringBuilder;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getText() {\n StringBuilder sb = new StringBuilder();\n for (Node node : getRootNode().getChildren()) {\n if (node instanceof Text) {\n sb.append(((Text) node).getText());\n }\n }\n return sb.toString();\n }",
"public List<MarkedUp... | [
"0.6858284",
"0.6458883",
"0.62957424",
"0.5670315",
"0.56588197",
"0.5596056",
"0.54079473",
"0.53851223",
"0.5371816",
"0.5367495",
"0.5360365",
"0.53426737",
"0.53300893",
"0.5283917",
"0.52790844",
"0.5277013",
"0.52536327",
"0.52488065",
"0.5247976",
"0.52472144",
"0.524... | 0.6340175 | 2 |
Determines whether the given element has an ancestor with the given namespace and name. | public static boolean hasAncestorElementNS(@Nonnull Element element, @Nullable final String ancestorElementNamespaceURI,
@Nonnull final String ancestorElementLocalName) {
while((element = asInstance(element.getParentNode(), Element.class).orElse(null)) != null) { //keep looking at parents until we run out of elements and hit the document
if(Objects.equals(element.getNamespaceURI(), ancestorElementNamespaceURI) && element.getNodeName().equals(ancestorElementLocalName)) {
return true;
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static boolean isElement(Element elem, String namespaceURI, String name) {\n if (elem.getNamespaceURI().equals(namespaceURI) && elem.getLocalName().equals(name)) {\n return true;\n }\n return false;\n }",
"public boolean exists(String namespace, String id);",
"protecte... | [
"0.6031052",
"0.5836797",
"0.58139634",
"0.57683986",
"0.5680963",
"0.54466975",
"0.5441517",
"0.5439578",
"0.5431176",
"0.5418763",
"0.5370294",
"0.5332464",
"0.5328525",
"0.5327298",
"0.5302234",
"0.52799106",
"0.5230036",
"0.52251136",
"0.5183176",
"0.51824474",
"0.5085572... | 0.7618479 | 0 |
Creates and inserts a new element encompassing the text of a given text node. | public static Element insertElement(final Text textNode, final Element element, final int startIndex, final int endIndex) throws DOMException {
final Text splitTextNode = splitText(textNode, startIndex, endIndex); //split the text node into pieces
final Element parentElement = (Element)splitTextNode.getParentNode(); //get the text node's parent
parentElement.replaceChild(element, splitTextNode); //replace the split text node with the element that will enclose it
element.appendChild(splitTextNode); //add the split text node to the given element
return element; //return the inserted enclosing element
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Element addText(String text) {\n Assert.isTrue(text != null, \"Text is null\");\n element.appendChild(element.getOwnerDocument().createTextNode(text));\n\n return this;\n }",
"ElementText createElementText();",
"public Text createTextNode(String data, Element parent);",
"privat... | [
"0.7385765",
"0.7371818",
"0.7358103",
"0.7349448",
"0.7263181",
"0.7209468",
"0.7127507",
"0.702615",
"0.6940704",
"0.6702575",
"0.66995996",
"0.66625184",
"0.6600111",
"0.65971446",
"0.6559153",
"0.6538323",
"0.6497588",
"0.64175534",
"0.6394265",
"0.6362991",
"0.6327278",
... | 0.662373 | 12 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.