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
Splits a text node into one, two, or three text nodes and replaces the original text node with the new ones.
public static Text splitText(Text textNode, int startIndex, int endIndex) throws DOMException { if(startIndex > 0) { //if the split text doesn't begin at the start of the text textNode = textNode.splitText(startIndex); //split off the first part of the text endIndex -= startIndex; //the ending index will now slide back because the start index is sliding back startIndex = 0; //we'll do the next split at the first of this string } if(endIndex < textNode.getLength()) { //if there will be text left after the split textNode.splitText(endIndex); //split off the text after the node } return textNode; //return the node in the middle }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract Node split();", "abstract Node split();", "private void extendNode(Node node, String newText, int position) {\n String currentText = node.getText();\n String commonPrefix = getLongestCommonPrefix(currentText, newText);\n\n if (commonPrefix != currentText) {\n String par...
[ "0.6253315", "0.6253315", "0.6108344", "0.60258734", "0.59477985", "0.5823844", "0.55857474", "0.541634", "0.5363624", "0.5327856", "0.5219664", "0.521795", "0.51982486", "0.5168503", "0.5161388", "0.51548296", "0.5127751", "0.5114628", "0.5100967", "0.5078149", "0.50294554",...
0.6084651
3
Removes the specified child node from the parent node, and promoting all the children of the child node to be children of the parent node.
public static void pruneChild(final Node parentNode, final Node childNode) { //promote all the child node's children to be children of the parent node while(childNode.hasChildNodes()) { //while the child node has children final Node node = childNode.getFirstChild(); //get the first child of the node childNode.removeChild(node); //remove the child's child parentNode.insertBefore(node, childNode); //insert the child's child before its parent (the parent node's child) } parentNode.removeChild(childNode); //remove the child, now that its children have been promoted }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void removeFromParent(TXSemanticTag child);", "public abstract void removeChild(Node node);", "void removeChild(Object child);", "public void removeChild( ChildType child );", "@DISPID(2)\n\t// = 0x2. The runtime will prefer the VTID if present\n\t@VTID(8)\n\tvoid removeChild(@MarshalAs(NativeType.V...
[ "0.7490069", "0.71156406", "0.70608455", "0.703748", "0.6956748", "0.690381", "0.6810826", "0.6720916", "0.66861", "0.6669621", "0.665161", "0.66345936", "0.65682113", "0.6561846", "0.64304495", "0.62503487", "0.623896", "0.61829984", "0.6152819", "0.61358863", "0.6101777", ...
0.639958
15
Removes the indexed nodes starting at startChildIndex up to but not including endChildIndex.
public static void removeChildren(final Node node, final int startChildIndex, final int endChildIndex) throws ArrayIndexOutOfBoundsException, DOMException { 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 || 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 > childNodeCount) //if the ending child index is out of range throw new ArrayIndexOutOfBoundsException(endChildIndex); //throw an exception indicating the illegal index for(int i = endChildIndex - 1; i >= startChildIndex; --i) //starting from the end, look at all the indexes before the ending index node.removeChild(childNodeList.item(i)); //find the item at the given index and remove it }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void deselectAllIndexes();", "public void removeChildAt(int index) {children.removeElementAt(index);}", "private void removeContentAfterIndexLink()\r\n \t{\r\n \t\tdeleteNodes(XPath.AFTER_INDEX_LINK.query);\r\n \t}", "public void unsetStartIndex()\n {\n synchronized (monitor())\n ...
[ "0.6223074", "0.596111", "0.5951177", "0.5865523", "0.58538055", "0.5835144", "0.5827024", "0.56945115", "0.56407464", "0.55990285", "0.55610955", "0.5540506", "0.5454907", "0.5452388", "0.54431725", "0.54367244", "0.5392808", "0.5352071", "0.53359896", "0.52853835", "0.52572...
0.6650499
0
Removes all named child nodes deeply.
public static void removeChildrenByName(final Node node, final Set<String> nodeNames) { removeChildrenByName(node, nodeNames, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void removeChildren() {\r\n this.children.clear();\r\n childNum = 0;\r\n }", "@Override\n public void removeChildren()\n {\n children.clear();\n }", "public void clearChildren() {\r\n this.children = null;\r\n }", "public void removeChildren(QueryNode childNode);",...
[ "0.7101697", "0.6770636", "0.6760964", "0.6610106", "0.6591649", "0.65534556", "0.64657557", "0.63223606", "0.62757313", "0.6217069", "0.61875325", "0.61214346", "0.610523", "0.6097949", "0.6085596", "0.5975375", "0.5934234", "0.59192526", "0.59018856", "0.5844343", "0.581672...
0.53942615
52
Removes all named child nodes.
public static void removeChildrenByName(final Node node, final Set<String> nodeNames, final boolean deep) { final NodeList childNodeList = node.getChildNodes(); //get the list of child nodes for(int childIndex = childNodeList.getLength() - 1; childIndex >= 0; childIndex--) { //look at each child node in reverse to prevent problems from removal final Node childNode = childNodeList.item(childIndex); //get a reference to this node if(nodeNames.contains(childNode.getNodeName())) { //if this node is to be removed node.removeChild(childNode); //remove it } else if(deep) { //if we should remove deeply removeChildrenByName(childNode, nodeNames, deep); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void removeChildren() {\r\n this.children.clear();\r\n childNum = 0;\r\n }", "public void removeChildren(QueryNode childNode);", "@Override\n public void removeChildren()\n {\n children.clear();\n }", "public static void removeChildren(Node node, String name) {\r\n ...
[ "0.7222499", "0.7101412", "0.7044585", "0.6951251", "0.6851522", "0.6789874", "0.6634076", "0.65124166", "0.639612", "0.6375836", "0.6329944", "0.63183415", "0.62726945", "0.6226682", "0.6200075", "0.6186074", "0.61457574", "0.6123234", "0.6093233", "0.6082531", "0.5935832", ...
0.64906245
8
Removes all child elements with the given name and attribute value.
public static void removeChildElementsByNameAttribute(final Node node, final String elementName, final String attributeName, final String attributeValue) { removeChildElementsByNameAttribute(node, elementName, attributeName, attributeValue, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void removeChildElementsByNameAttribute(final Node node, final String elementName, final String attributeName, final String attributeValue,\n\t\t\tfinal boolean deep) {\n\t\tfinal NodeList childNodeList = node.getChildNodes(); //get the list of child nodes\n\t\tfor(int childIndex = childNodeList.getL...
[ "0.7127727", "0.71045536", "0.6549811", "0.6492072", "0.6463625", "0.6386161", "0.63618004", "0.63141537", "0.6271409", "0.61050534", "0.6072564", "0.6037189", "0.59616894", "0.5942282", "0.5894826", "0.5868669", "0.5762732", "0.57565063", "0.5716254", "0.56925595", "0.567499...
0.7019192
2
Removes all child elements with the given name and attribute value.
public static void removeChildElementsByNameAttribute(final Node node, final String elementName, final String attributeName, final String attributeValue, final boolean deep) { final NodeList childNodeList = node.getChildNodes(); //get the list of child nodes for(int childIndex = childNodeList.getLength() - 1; childIndex >= 0; childIndex--) { //look at each child node in reverse to prevent problems from removal final Node childNode = childNodeList.item(childIndex); //get a reference to this node if(childNode.getNodeType() == Node.ELEMENT_NODE && childNode.getNodeName().equals(elementName) && ((Element)childNode).getAttribute(attributeName).equals(attributeValue)) { //if this node is to be removed node.removeChild(childNode); //remove it } else if(deep) { //if we should remove deeply removeChildElementsByNameAttribute(childNode, elementName, attributeName, attributeValue, deep); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void remove(String name)\n/* */ {\n/* 1177 */ for (int i = 0; i < this.attributes.size(); i++) {\n/* 1178 */ XMLAttribute attr = (XMLAttribute)this.attributes.elementAt(i);\n/* 1179 */ if (attr.getName().equals(name)) {\n/* 1180 */ this.attributes.removeElementAt(i);\n/* 1181 ...
[ "0.71084017", "0.7019242", "0.655262", "0.6491734", "0.6463712", "0.63899785", "0.6365959", "0.631891", "0.6275635", "0.6107126", "0.60724175", "0.6041736", "0.59641135", "0.59442675", "0.58992505", "0.5871647", "0.5764089", "0.5761298", "0.5717068", "0.5696443", "0.5679173",...
0.7128405
0
Renames an element by creating a new element with the specified name, cloning the original element's children, and replacing the original element with the new, renamed clone. While this method's purpose is renaming, because of DOM restrictions it must remove the element and replace it with a new one, which is reflected by the method's name.
public static Element replaceElementNS(@Nonnull final Element element, @Nullable final String namespaceURI, @Nonnull final String qualifiedName) { final Document document = element.getOwnerDocument(); //get the owner document final Element newElement = document.createElementNS(namespaceURI, qualifiedName); //create the new element appendClonedAttributeNodesNS(newElement, element); //clone the attributes TODO testing appendClonedChildNodes(newElement, element, true); //deep-clone the child nodes of the element and add them to the new element final Node parentNode = element.getParentNode(); //get the parent node, which we'll need for the replacement parentNode.replaceChild(newElement, element); //replace the old element with the new one return newElement; //return the element we created }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void renameTree(String oldName, String newName) throws DuplicateNameException;", "@Override\n public void rename(String name) throws SQLException, ElementExistException {\n \n }", "@Override\r\n public void renameContainer(String oldName, String newName) \r\n throws NoSuchElem...
[ "0.62676775", "0.6238181", "0.6088329", "0.599169", "0.5759755", "0.56425214", "0.5638436", "0.5633166", "0.5628035", "0.557944", "0.555591", "0.5513969", "0.55095845", "0.54591846", "0.5441045", "0.5382439", "0.5373959", "0.5353356", "0.5335498", "0.52470636", "0.5239634", ...
0.4763575
85
TODO fix to adjust automatically to tabDelta, comment Prints a tree representation of the document to the standard output.
public static void printTree(final Document document, final PrintStream printStream) { if(document != null) //if we have a root element printTree(document.getDocumentElement(), 0, printStream); //dump the contents of the root element else //if we don't have a root element printStream.println("Empty document."); //TODO fix, comment, i18n }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void tree()\n\t{\n\t\tIterable<Position<FileElement>> toPrint = fileSystem.PreOrder();\n\t\tfor (Position<FileElement> p : toPrint)\n\t\t{\n\t\t\tint depth = fileSystem.getDepth(p);\n\t\t\tfor (int i = 0; i < depth; i++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println(p.getVa...
[ "0.7384742", "0.6935732", "0.67551064", "0.67227", "0.66592294", "0.664458", "0.6582349", "0.6556061", "0.65324724", "0.6459523", "0.63974607", "0.63803184", "0.635675", "0.62988865", "0.62937266", "0.6166833", "0.61553484", "0.61535424", "0.61136335", "0.60738313", "0.607067...
0.5829116
50
Prints a tree representation of the element to the standard output.
public static void printTree(final Element element, final PrintStream printStream) { printTree(element, 0, printStream); //if we're called normally, we'll dump starting at the first tab position }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void printTree() {\n Object[] nodeArray = this.toArray();\n for (int i = 0; i < nodeArray.length; i++) {\n System.out.println(nodeArray[i]);\n }\n }", "public void printOut() {\n\t\tif(root.left != null) {\n\t\t\tprintOut(root.left);\n\t\t}\n\t\t\n\t\tSystem....
[ "0.7995151", "0.7827995", "0.7710228", "0.7695813", "0.7690944", "0.7578403", "0.74203587", "0.73731244", "0.732793", "0.7271969", "0.72080874", "0.71701634", "0.713637", "0.7133365", "0.71262646", "0.71175957", "0.71093804", "0.71093553", "0.7104066", "0.7049066", "0.7029648...
0.7456747
6
Prints a tree representation of the element to the standard output starting at the specified tab position.
protected static void printTree(final Element element, int tabPos, final PrintStream printStream) { for(int i = 0; i < tabPos; ++i) printStream.print(TAB_STRING); //TODO fix to adjust automatically to tabDelta, comment printStream.print("[Element] "); //TODO fix to adjust automatically to tabDelta, comment printStream.print("<" + element.getNodeName()); //print the element name final NamedNodeMap attributeMap = element.getAttributes(); //get the attributes for(int i = attributeMap.getLength() - 1; i >= 0; --i) { //look at each attribute final Attr attribute = (Attr)attributeMap.item(i); //get a reference to this attribute printStream.print(" " + attribute.getName() + "=\"" + attribute.getValue() + "\""); //print the attribute and its value printStream.print(" (" + attribute.getNamespaceURI() + ")"); //print the attribute namespace } if(element.getChildNodes().getLength() == 0) //if there are no child nodes printStream.print('/'); //show that this is an empty element printStream.println("> (namespace URI=\"" + element.getNamespaceURI() + "\" local name=\"" + element.getLocalName() + "\")"); if(element.getChildNodes().getLength() > 0) { //if there are child nodes for(int childIndex = 0; childIndex < element.getChildNodes().getLength(); childIndex++) { //look at each child node Node node = element.getChildNodes().item(childIndex); //look at this node printTree(node, tabPos, printStream); //print the node to the stream //TODO process the child elements } for(int i = 0; i < tabPos; ++i) printStream.print(TAB_STRING); //TODO fix to adjust automatically to tabDelta, comment printStream.print("[/Element] "); //TODO fix to adjust automatically to tabDelta, comment printStream.println("</" + element.getNodeName() + '>'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void print(int tabOrder);", "public static void printTree(final Element element, final PrintStream printStream) {\n\t\tprintTree(element, 0, printStream); //if we're called normally, we'll dump starting at the first tab position\n\t}", "protected static void printTree(final Node node, int tabPos, final ...
[ "0.7307233", "0.7287186", "0.71986556", "0.7160083", "0.67559063", "0.6606382", "0.6597479", "0.6576789", "0.64357924", "0.64150304", "0.63752925", "0.6355392", "0.63363624", "0.62868005", "0.6274323", "0.6264453", "0.62600017", "0.62242264", "0.62226576", "0.62145895", "0.61...
0.7415834
0
Prints a tree representation of the node to the given pring stream starting at the specified tab position.
public static void printTree(final Node node, final PrintStream printStream) { printTree(node, 0, printStream); //if we're called normally, we'll dump starting at the first tab position }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static void printTree(final Node node, int tabPos, final PrintStream printStream) {\n\t\tswitch(node.getNodeType()) { //see which type of object this is\n\t\t\tcase Node.ELEMENT_NODE: //if this is an element\n\n\t\t\t\t//TODO fix for empty elements\n\n\t\t\t\t//TODO del tabPos+=tabDelta;\t//TODO check th...
[ "0.7498985", "0.67613035", "0.67277044", "0.6659542", "0.64383143", "0.62910825", "0.62599814", "0.62517756", "0.62177014", "0.6207166", "0.61387956", "0.61375505", "0.61144286", "0.60169667", "0.5988474", "0.5956794", "0.59454435", "0.5927622", "0.5925874", "0.59234524", "0....
0.7049572
1
Prints a tree representation of the node to the given pring stream starting at the specified tab position.
protected static void printTree(final Node node, int tabPos, final PrintStream printStream) { switch(node.getNodeType()) { //see which type of object this is case Node.ELEMENT_NODE: //if this is an element //TODO fix for empty elements //TODO del tabPos+=tabDelta; //TODO check this; maybe static classes don't have recursive-aware functions printTree((Element)node, tabPos + 1, printStream); //comment, check to see if we need the typecast //TODO del tabPos-=tabDelta; //TODO check this; maybe static classes don't have recursive-aware functions break; case Node.TEXT_NODE: //if this is a text node for(int i = 0; i < tabPos + 1; ++i) printStream.print(TAB_STRING); //TODO fix to adjust automatically to tabDelta, comment printStream.print("[Text] "); //TODO fix to adjust automatically to tabDelta, comment printStream.println(Strings.replace(node.getNodeValue(), '\n', "\\n")); //print the text of this node break; case Node.COMMENT_NODE: //if this is a comment node for(int i = 0; i < tabPos + 1; i += ++i) printStream.print(TAB_STRING); //TODO fix to adjust automatically to tabDelta, comment printStream.print("[Comment] "); //TODO fix to adjust automatically to tabDelta, comment printStream.println(Strings.replace(node.getNodeValue(), '\n', "\\n")); //print the text of this node break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void printTree(final Node node, final PrintStream printStream) {\n\t\tprintTree(node, 0, printStream); //if we're called normally, we'll dump starting at the first tab position\n\t}", "protected static void printTree(final Element element, int tabPos, final PrintStream printStream) {\n\t\tfor(int i...
[ "0.70491374", "0.676327", "0.6728484", "0.6658794", "0.643837", "0.62943524", "0.625928", "0.6251878", "0.62188786", "0.6207042", "0.6137371", "0.61367804", "0.611399", "0.60158837", "0.59896356", "0.5955756", "0.59452045", "0.5926783", "0.5926243", "0.5924411", "0.5924411", ...
0.74998254
0
Converts an XML document to a string. If an error occurs converting the document to a string, the normal object string will be returned.
public static String toString(final Document document) { try { return new XMLSerializer(true).serialize(document); //serialize the document to a string, formatting the XML output } catch(final IOException ioException) { //if an IO exception occurs return ioException.getMessage() + ' ' + document.toString(); //ask the document to convert itself to a string } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String convertXmlToString(Document xmlDoc) {\r\n\r\n\t\tString xmlAsString = \"\";\r\n\t\ttry {\r\n\r\n\t\t\tTransformer transformer;\r\n\t\t\ttransformer = TransformerFactory.newInstance().newTransformer();\r\n\r\n\t\t\ttransformer.setOutputProperty(OutputKeys.STANDALONE, \"yes\");\r\n\t\t\ttransformer.se...
[ "0.7108916", "0.7079257", "0.7073677", "0.6773326", "0.6669446", "0.6593646", "0.6489357", "0.6477844", "0.6444471", "0.6252632", "0.6211916", "0.6187186", "0.61159295", "0.6088246", "0.60719347", "0.6043711", "0.60227954", "0.60050493", "0.60023814", "0.59577346", "0.5933595...
0.75214946
0
Converts an XML element to a string. If an error occurs converting the element to a string, the normal object string will be returned.
public static String toString(final Element element) { return new XMLSerializer(true).serialize(element); //serialize the element to a string, formatting the XML output }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String toStringValue(final Element element) throws XMLException{\n\t\ttry {\n\t\t\tfinal ByteArrayOutputStream baos = new ByteArrayOutputStream();\n\t\t\twrite(element, baos, null);\n\t\t\treturn baos.toString();\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\tthrow new XMLException(e);\...
[ "0.772614", "0.70855147", "0.697872", "0.6908144", "0.6844799", "0.6813068", "0.65868235", "0.6499688", "0.63929117", "0.6314063", "0.62831354", "0.62760264", "0.6232477", "0.6183906", "0.61628294", "0.6152631", "0.61299855", "0.6125946", "0.60865897", "0.606628", "0.6065598"...
0.75590426
1
Searches the attributes of the given node for a definition of a namespace URI for the given prefix. If the prefix is not defined for the given element, its ancestors are searched if requested. If the prefix is not defined anywhere up the hierarchy, null is returned. If the prefix is defined, it is returned logically: a blank declared namespace will return null.
public static String getNamespaceURI(final Element element, final String prefix, final boolean resolve) { //get the namespace URI declared for this prefix final String namespaceURI = getDefinedNamespaceURI(element, prefix, resolve); if(namespaceURI != null && namespaceURI.length() > 0) { //if a namespace is defined that isn't the empty string return namespaceURI; //return that namespace URI } else { //if the namespace is null or is the empty string return null; //the empty string is the same as a null namespace } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final String getNamespaceURI(String prefix) {\n if (prefix == null) {\n throw new IllegalArgumentException(\"Illegal to pass null as argument.\");\n }\n if (prefix.length() == 0) {\n if (mSize == 0) { // could signal an error too\n return null;\n ...
[ "0.6832147", "0.6792992", "0.6609056", "0.6502465", "0.5995692", "0.5995692", "0.5995692", "0.5995692", "0.5995692", "0.59546", "0.5901644", "0.58492017", "0.5749127", "0.56423914", "0.56256855", "0.5565442", "0.5465257", "0.5463384", "0.5462869", "0.5462869", "0.5462869", ...
0.541907
27
Checks to ensure that all namespaces for the element and its attributes are properly declared using the appropriate xmlns= or xmlns:prefix= attribute declaration.
public static void ensureNamespaceDeclarations(final Element element) { ensureNamespaceDeclarations(element, null, false); //ensure namespace declarations only for this element and its attributes, adding any declarations to the element itself }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void ensureNamespaceDeclaration(final Element element, final String prefix, final String namespaceURI) {\n\t\tif(!isNamespaceDefined(element, prefix, namespaceURI)) { //if this namespace isn't declared for this element\n\t\t\tdeclareNamespace(element, prefix, namespaceURI); //declare the namespace\n\...
[ "0.6736581", "0.64517236", "0.6342547", "0.614766", "0.6104131", "0.60792357", "0.601921", "0.5874815", "0.58448887", "0.57981676", "0.5788497", "0.5748992", "0.57426536", "0.57237047", "0.5711921", "0.56968385", "0.5619402", "0.5604939", "0.558376", "0.5577034", "0.5573546",...
0.6970704
0
Checks to ensure that all namespaces for the element and its attributes are properly declared using the appropriate xmlns= or xmlns:prefix= attribute declaration. The children of this element are optionally checked.
public static void ensureNamespaceDeclarations(final Element element, final Element declarationElement, final boolean deep) { final Set<Map.Entry<String, String>> prefixNamespacePairs = getUndefinedNamespaces(element); //get the undeclared namespaces for this element declareNamespaces(declarationElement != null ? declarationElement : element, prefixNamespacePairs); //declare the undeclared namespaces, using the declaration element if provided if(deep) { //if we should recursively check the children of this element final NodeList childElementList = element.getChildNodes(); //get a list of the child nodes for(int i = 0; i < childElementList.getLength(); ++i) { //look at each node final Node node = childElementList.item(i); //get a reference to this node if(node.getNodeType() == Node.ELEMENT_NODE) { //if this is an element ensureNamespaceDeclarations((Element)node, declarationElement, deep); //process the namespaces for this element and its descendants } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void ensureNamespaceDeclarations(final Element element) {\n\t\tensureNamespaceDeclarations(element, null, false); //ensure namespace declarations only for this element and its attributes, adding any declarations to the element itself\n\t}", "protected static void ensureChildNamespaceDeclarations(fi...
[ "0.6557874", "0.6263482", "0.59754324", "0.59220207", "0.586719", "0.5812733", "0.57952106", "0.5714855", "0.5629812", "0.56184036", "0.56086844", "0.55441606", "0.54855645", "0.54831547", "0.53293014", "0.53199947", "0.5312058", "0.527502", "0.52322435", "0.52267563", "0.520...
0.5511118
12
Checks to ensure that all namespaces for the child elements and their attributes are properly declared using the appropriate xmlns= or xmlns:prefix= attribute declaration. If a child element does not have a necessary namespace declaration, the declaration is added to the same parent element all the way down the hierarchy if there are no conflicts. If there is a conflict, the namespace is added to the child element itself. This method is useful for adding namespace attributes to the top level of a fragment that contains unknown content that preferably should be lef undisturbed.
public static void ensureChildNamespaceDeclarations(final Element parentElement) { ensureChildNamespaceDeclarations(parentElement, parentElement); //ensure the child namespace declarations for all children of this element, showing that this element is the parent }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Element insertNamespaces(final Element element) throws Exception {\r\n\r\n element.setAttribute(\"xmlns:prefix-container\", Constants.NS_IR_CONTAINER);\r\n //element.setAttribute(\"xmlns:prefix-content-type\", CONTENT_TYPE_NS_URI); TODO: does no longer exist?\r\n element.setAttribute(\"...
[ "0.65671253", "0.6443653", "0.62716943", "0.62010336", "0.5800134", "0.5550366", "0.5491166", "0.5472517", "0.5464175", "0.543304", "0.5317196", "0.5144412", "0.51264566", "0.5114732", "0.5108679", "0.5023276", "0.49679983", "0.4967106", "0.4956174", "0.49180403", "0.48826596...
0.56137687
5
Checks to ensure that all namespaces for the child elements and their attributes are properly declared using the appropriate xmlns= or xmlns:prefix= attribute declaration. If a child element does not have a necessary namespace declaration, the declaration is added to the same parent element all the way down the hierarchy if there are no conflicts. If there is a conflict, the namespace is added to the child element itself. This method is useful for adding namespace attributes to the top level of a fragment that contains unknown content that preferably should be lef undisturbed.
protected static void ensureChildNamespaceDeclarations(final Element rootElement, final Element parentElement) { final NodeList childElementList = parentElement.getChildNodes(); //get a list of the child nodes for(int childIndex = 0; childIndex < childElementList.getLength(); ++childIndex) { //look at each child node final Node childNode = childElementList.item(childIndex); //get a reference to this node if(childNode.getNodeType() == Node.ELEMENT_NODE) { //if this is an element final Element childElement = (Element)childNode; //cast the node to an element final Set<Map.Entry<String, String>> prefixNamespacePairs = getUndefinedNamespaces(childElement); //get the undeclared namespaces for the child element for(final Map.Entry<String, String> prefixNamespacePair : prefixNamespacePairs) { //look at each name/value pair final String prefix = prefixNamespacePair.getKey(); //get the prefix final String namespaceURI = prefixNamespacePair.getValue(); //get the namespace if(getDefinedNamespaceURI(rootElement, prefix, true) == null) { //if the root element does not have this prefix defined, it's OK to add it to the parent element declareNamespace(rootElement, prefix, namespaceURI); //declare this namespace on the root element } else { //if the parent element has already defined this namespace declareNamespace(childElement, prefix, namespaceURI); //declare the namespace on the child element } } ensureChildNamespaceDeclarations(rootElement, childElement); //check the children of the child element } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Element insertNamespaces(final Element element) throws Exception {\r\n\r\n element.setAttribute(\"xmlns:prefix-container\", Constants.NS_IR_CONTAINER);\r\n //element.setAttribute(\"xmlns:prefix-content-type\", CONTENT_TYPE_NS_URI); TODO: does no longer exist?\r\n element.setAttribute(\"...
[ "0.65672195", "0.62703085", "0.6201046", "0.5799059", "0.56135595", "0.5550763", "0.5490131", "0.5469791", "0.54644305", "0.54324025", "0.5317128", "0.5144772", "0.5125371", "0.5114779", "0.51087534", "0.50227547", "0.49665505", "0.49651635", "0.49553558", "0.49182162", "0.48...
0.64437723
1
Gets the namespace declarations this element needs so that all namespaces for the element and its attributes are properly declared using the appropriate xmlns= or xmlns:prefix= attribute declaration or are implicitly defined. The children of this element are optionally checked.
public static Set<Map.Entry<String, String>> getUndefinedNamespaces(final Element element) { final Set<Map.Entry<String, String>> prefixNamespacePairs = new HashSet<>(); //create a new set in which to store name/value pairs of prefixes and namespaces if(!isNamespaceDefined(element, element.getPrefix(), element.getNamespaceURI())) { //if the element doesn't have the needed declarations prefixNamespacePairs.add(new AbstractMap.SimpleImmutableEntry<>(element.getPrefix(), element.getNamespaceURI())); //add this prefix and namespace to the list of namespaces needing to be declared } final NamedNodeMap attributeNamedNodeMap = element.getAttributes(); //get the map of attributes final int attributeCount = attributeNamedNodeMap.getLength(); //find out how many attributes there are for(int i = 0; i < attributeCount; ++i) { //look at each attribute final Attr attribute = (Attr)attributeNamedNodeMap.item(i); //get this attribute //as attribute namespaces are not inherited, don't check namespace // declarations for attributes if they have neither prefix nor // namespace declared if(attribute.getPrefix() != null || attribute.getNamespaceURI() != null) { if(!isNamespaceDefined(element, attribute.getPrefix(), attribute.getNamespaceURI())) //if the attribute doesn't have the needed declarations prefixNamespacePairs.add(new AbstractMap.SimpleImmutableEntry<>(attribute.getPrefix(), attribute.getNamespaceURI())); //add this prefix and namespace to the set of namespaces needing to be declared } } return prefixNamespacePairs; //return the prefixes and namespaces we gathered }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void ensureNamespaceDeclarations(final Element element) {\n\t\tensureNamespaceDeclarations(element, null, false); //ensure namespace declarations only for this element and its attributes, adding any declarations to the element itself\n\t}", "public String getAllBindingNamespaceDeclarations() \t \n ...
[ "0.6149398", "0.6092089", "0.5970889", "0.593221", "0.5738717", "0.56044805", "0.5597737", "0.5588894", "0.5577322", "0.5570244", "0.55687153", "0.5556747", "0.5542913", "0.5542913", "0.5542913", "0.5542913", "0.5516257", "0.55139065", "0.5453498", "0.54411507", "0.5415986", ...
0.6608612
0
Declares a prefix for the given namespace using the appropriate xmlns= or xmlns:prefix= attribute declaration. It is assumed that the namespace is used at the level of the given element. If the namespace prefix is already declared somewhere up the tree, and that prefix is assigned to the same namespace, no action occurs.
public static void ensureNamespaceDeclaration(final Element element, final String prefix, final String namespaceURI) { if(!isNamespaceDefined(element, prefix, namespaceURI)) { //if this namespace isn't declared for this element declareNamespace(element, prefix, namespaceURI); //declare the namespace } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void declarePrefix(String prefix, String namespace);", "public static void declareNamespace(final Element declarationElement, final String prefix, String namespaceURI) {\n\t\tif(XMLNS_NAMESPACE_PREFIX.equals(prefix) && XMLNS_NAMESPACE_URI_STRING.equals(namespaceURI)) { //we don't need to define the `xmlns` prefi...
[ "0.78069776", "0.73076946", "0.69116646", "0.6777436", "0.6635818", "0.6620183", "0.66072214", "0.63829416", "0.6345333", "0.6314416", "0.63086945", "0.6286056", "0.6208409", "0.6206229", "0.60943145", "0.6093191", "0.60894185", "0.6053122", "0.60427123", "0.6038495", "0.6038...
0.6607013
7
Declares prefixes for the given namespaces using the appropriate xmlns= or xmlns:prefix= attribute declaration for the given element.
public static void declareNamespaces(final Element declarationElement, final Set<Map.Entry<String, String>> prefixNamespacePairs) { for(final Map.Entry<String, String> prefixNamespacePair : prefixNamespacePairs) { //look at each name/value pair declareNamespace(declarationElement, prefixNamespacePair.getKey(), prefixNamespacePair.getValue()); //declare this namespace } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void declarePrefix(String prefix, String namespace);", "public Element insertNamespaces(final Element element) throws Exception {\r\n\r\n element.setAttribute(\"xmlns:prefix-container\", Constants.NS_IR_CONTAINER);\r\n //element.setAttribute(\"xmlns:prefix-content-type\", CONTENT_TYPE_NS_URI); TODO...
[ "0.77392566", "0.72868", "0.6881852", "0.6740976", "0.67092335", "0.64638734", "0.64425194", "0.63879067", "0.6249681", "0.6236782", "0.62319785", "0.6231082", "0.6230421", "0.6146713", "0.61349887", "0.61260337", "0.60484195", "0.6035567", "0.60284495", "0.6026227", "0.60167...
0.74381423
1
Declares a prefix for the given namespace using the appropriate xmlns= or xmlns:prefix= attribute declaration for the given element.
public static void declareNamespace(final Element declarationElement, final String prefix, String namespaceURI) { if(XMLNS_NAMESPACE_PREFIX.equals(prefix) && XMLNS_NAMESPACE_URI_STRING.equals(namespaceURI)) { //we don't need to define the `xmlns` prefix return; } if(prefix == null && XMLNS_NAMESPACE_URI_STRING.equals(namespaceURI)) { //we don't need to define the `xmlns` name return; } if(XML_NAMESPACE_PREFIX.equals(prefix) && XML_NAMESPACE_URI_STRING.equals(namespaceURI)) { //we don't need to define the `xml` prefix return; } if(namespaceURI == null) { //if no namespace URI was given namespaceURI = ""; //we'll declare an empty namespace URI } if(prefix != null) { //if we were given a prefix //create an attribute in the form `xmlns:prefix="namespaceURI"` TODO fix for attributes that may use the same prefix for different namespace URIs declarationElement.setAttributeNS(XMLNS_NAMESPACE_URI_STRING, createQualifiedName(XMLNS_NAMESPACE_PREFIX, prefix), namespaceURI); } else { //if we weren't given a prefix //create an attribute in the form `xmlns="namespaceURI"` TODO fix for attributes that may use the same prefix for different namespace URIs declarationElement.setAttributeNS(ATTRIBUTE_XMLNS.getNamespaceString(), ATTRIBUTE_XMLNS.getLocalName(), namespaceURI); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void declarePrefix(String prefix, String namespace);", "public void setNameSpacePrefix(String nsPrefix) {\n this.nsPrefix = nsPrefix;\n }", "public void addNamespacePrefix(String namespace, String prefix) {\n namespacePrefixMap.put(namespace, prefix);\n }", "public void setPropertyPrefix(...
[ "0.8128456", "0.71615297", "0.7146027", "0.68098354", "0.6759224", "0.67012936", "0.6687462", "0.664375", "0.66116595", "0.65806407", "0.65285164", "0.65185624", "0.6452284", "0.6378226", "0.63291186", "0.6293742", "0.6293051", "0.62921244", "0.62496835", "0.6231899", "0.6213...
0.74905974
1
Parses the given text as an XML fragment using the given document builder as a parser.
public static DocumentFragment parseFragment(final String fragmentText, final DocumentBuilder documentBuilder, final String defaultNamespaceURI) throws SAXException { final StringBuilder stringBuilder = new StringBuilder("<?xml version='1.0' encoding='UTF-8'?>"); //TODO use constants if we can stringBuilder.append("<fragment"); if(defaultNamespaceURI != null) { //if a default namespace was given stringBuilder.append(" xmlns='").append(defaultNamespaceURI).append("'"); //xmlns="defaultNamespaceURI" } stringBuilder.append(">").append(fragmentText).append("</fragment>"); try { final Document document = documentBuilder.parse(new ByteArrayInputStream(stringBuilder.toString().getBytes(UTF_8))); //parse the bytes of the string return extractChildren(document.getDocumentElement()); //extract the children of the fragment document element and return them as a document fragment } catch(final IOException ioException) { //we should never get an I/O exception reading from a string throw new AssertionError(ioException); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Document getFragmentAsDocument(CharSequence value)\n/* */ {\n/* 75 */ Document fragment = Jsoup.parse(value.toString(), \"\", Parser.xmlParser());\n/* 76 */ Document document = Document.createShell(\"\");\n/* */ \n/* */ \n/* 79 */ Iterator<Element> nodes = fragment.children().ite...
[ "0.5772862", "0.57028913", "0.54548746", "0.54233587", "0.5239382", "0.51303756", "0.5092172", "0.50442654", "0.50212246", "0.49174473", "0.4913501", "0.4900112", "0.48954964", "0.48758453", "0.48734027", "0.47551218", "0.4733629", "0.47187144", "0.46758896", "0.46433848", "0...
0.65202683
0
Convenience function to create an element, replace the document element of the given document, and add optional text as a child of the given element. A heading, for instance, might be added using replaceDocumentElement(document, XHTML_NAMESPACE_URI, ELEMENT_H2, "My Heading");.
public static Element replaceDocumentElementNS(@Nonnull final Document document, @Nullable final String elementNamespaceURI, @Nonnull final String elementQualifiedName, @Nullable final String textContent) { final Element childElement = createElementNS(document, elementNamespaceURI, elementQualifiedName, textContent); //create the new element document.replaceChild(childElement, document.getDocumentElement()); //replace the document element of the document return childElement; //return the element we created }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void appendChildWithText(Document document,\n Node parent, String tagName, String textContent) {\n Element element = document.createElement(tagName);\n element.setTextContent(textContent);\n parent.appendChild(element);\n }", "priv...
[ "0.64521366", "0.61678135", "0.5875922", "0.56979847", "0.5572656", "0.55645293", "0.54746443", "0.5446605", "0.53905666", "0.5339072", "0.52827555", "0.52822185", "0.5239282", "0.522939", "0.5218911", "0.52115244", "0.5187769", "0.51762915", "0.5141743", "0.5098063", "0.5092...
0.5622625
4
Retrieves the direct children of the given node as a stream of nodes.
public static Stream<Node> childNodesOf(@Nonnull final Node node) { return streamOf(node.getChildNodes()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<Node<T>> children();", "private List<SimpleNode> getChildren(SimpleNode node) {\n Class<?> nodeType = node.getClass();\n List<SimpleNode> children = new ArrayList<>();\n for (int i = 0; i < node.jjtGetNumChildren(); i++) {\n children.addAll(flatten(node.jjtGetChild(i), nodeTy...
[ "0.7359085", "0.69936526", "0.6888095", "0.67700815", "0.66861314", "0.6662952", "0.65587395", "0.6551435", "0.65291667", "0.6524661", "0.6517773", "0.64998907", "0.6465349", "0.6430322", "0.6394716", "0.6330899", "0.6323155", "0.6299963", "0.6290258", "0.6271899", "0.6265704...
0.8039721
0
Returns a stream of direct child elements with a given name, in order.
public static Stream<Element> childElementsByName(@Nonnull final Node parentNode, @Nonnull final String name) { return collectNodesByName(parentNode, Node.ELEMENT_NODE, Element.class, name, false, new ArrayList<>(parentNode.getChildNodes().getLength())).stream(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List getChildren(String name) {\n List elements = new ArrayList();\n NodeList nodes = element.getChildNodes();\n\n for (int i = 0; i < nodes.getLength(); i++) {\n Node node = nodes.item(i);\n\n if ((node.getNodeType() == Node.ELEMENT_NODE) && node.getNodeName().equ...
[ "0.72141314", "0.64221567", "0.637162", "0.63575506", "0.6086376", "0.60540223", "0.6031138", "0.603019", "0.5749902", "0.57324827", "0.57228726", "0.5716852", "0.56779677", "0.5635913", "0.56343067", "0.5627397", "0.5598786", "0.558609", "0.55647033", "0.55552065", "0.555230...
0.72900957
0
Returns a stream of direct child elements with a given namespace URI and local name, in order.
public static Stream<Element> childElementsByNameNS(@Nonnull final Node parentNode, @Nullable final String namespaceURI, @Nonnull final String localName) { return collectNodesByNameNS(parentNode, Node.ELEMENT_NODE, Element.class, namespaceURI, localName, false, new ArrayList<>(parentNode.getChildNodes().getLength())).stream(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@DOMSupport(DomLevel.TWO)\r\n @BrowserSupport({BrowserType.FIREFOX_2P, BrowserType.OPERA_9P, BrowserType.IE_9P})\r\n @JsArray(Node.class)\r\n @FactoryFunc\r\n\t@Function NodeList getElementsByTagNameNS(String namespaceURI, String localName);", "public List<Element> getElements(String localname, String n...
[ "0.5966969", "0.57686406", "0.563164", "0.537129", "0.5342619", "0.5342619", "0.5342619", "0.5342619", "0.5342619", "0.5300147", "0.5244118", "0.52402747", "0.52367467", "0.5144815", "0.51323247", "0.5096106", "0.50942326", "0.50470054", "0.50263757", "0.5000129", "0.49926552...
0.6716715
0
Returns the first direct child element with a given namespace URI and local name.
public static Optional<Element> findFirstChildElementByNameNS(@Nonnull final Node parentNode, @Nullable final String namespaceURI, @Nonnull final String localName) { return findFirstElementByNameNS(parentNode.getChildNodes(), namespaceURI, localName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Node findChildElement(Node node, String xmlLocalName) {\n if (node != null) {\n String nsUri = node.getNamespaceURI();\n for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) {\n if (child.getNodeType() == Node.ELEMENT_NODE) {\n String nsU...
[ "0.6873673", "0.6243179", "0.6222986", "0.59885734", "0.59085613", "0.58647805", "0.5832127", "0.5771983", "0.5738879", "0.5671301", "0.56576973", "0.55823594", "0.55190325", "0.54828924", "0.52581924", "0.5185447", "0.5182459", "0.51622736", "0.5152836", "0.51435703", "0.513...
0.6151703
3
Removes all children of a node.
public static <N extends Node> N removeChildren(@Nonnull final N parentNode) throws DOMException { while(parentNode.hasChildNodes()) { parentNode.removeChild(parentNode.getFirstChild()); } return parentNode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void removeChildren() {\r\n this.children.clear();\r\n childNum = 0;\r\n }", "public void removeChildren(QueryNode childNode);", "@Override\n public void removeChildren()\n {\n children.clear();\n }", "public void clearChildren() {\r\n this.children = null;\r\n }",...
[ "0.7753883", "0.7542532", "0.7482756", "0.74686766", "0.7230705", "0.70800066", "0.7006703", "0.6869263", "0.68607444", "0.68158007", "0.67926407", "0.6664116", "0.6631962", "0.65876687", "0.6561412", "0.6538566", "0.6532004", "0.64302546", "0.6370567", "0.62477463", "0.62303...
0.5440347
67
NamedNodeMap Returns an iterable to iterate through the nodes in a named node map. The returned iterator fails fast if it detects that the named node map was modified during iteration.
public static Iterable<Node> iterableOf(@Nonnull final NamedNodeMap namedNodeMap) { return () -> new NamedNodeMapIterator(namedNodeMap); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Iterator nodeIterator() { return nodes.keySet().iterator(); }", "@Override\r\n public Iterator<NamedTreeNode<T>> iterator()\r\n {\r\n return new Iterator<NamedTreeNode<T>>()\r\n {\r\n NamedTreeNode<T> n = (NamedTreeNode<T>)getLeftNode();\r\n ...
[ "0.67308867", "0.63368016", "0.62461764", "0.62310517", "0.6156345", "0.6117033", "0.6092997", "0.6057449", "0.59335834", "0.5904149", "0.58691144", "0.5824056", "0.57260656", "0.5708208", "0.56923985", "0.5686148", "0.5662422", "0.5593011", "0.5564158", "0.5555268", "0.55484...
0.7721223
0
Returns a stream to iterate through the nodes in a named node map. The returned stream fails fast if it detects that the named node map was modified during iteration.
public static Stream<Node> streamOf(@Nonnull final NamedNodeMap namedNodeMap) { return stream(spliterator(new NamedNodeMapIterator(namedNodeMap), namedNodeMap.getLength(), Spliterator.SIZED | Spliterator.DISTINCT | Spliterator.NONNULL), false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Iterator nodeIterator() { return nodes.keySet().iterator(); }", "public static Iterable<Node> iterableOf(@Nonnull final NamedNodeMap namedNodeMap) {\n\t\treturn () -> new NamedNodeMapIterator(namedNodeMap);\n\t}", "@Override\n public Iterator<T> iterator() {\n return new UsedNodesIterator<>(th...
[ "0.60988677", "0.5858901", "0.5563288", "0.548604", "0.5410037", "0.53378916", "0.5330189", "0.529418", "0.52721053", "0.52451915", "0.5040627", "0.49951684", "0.49943355", "0.49940416", "0.49896652", "0.49725077", "0.4956321", "0.4955316", "0.4950863", "0.4937356", "0.491979...
0.6444963
0
NodeList Retrieves the optional first item of a node list.
public static Optional<Node> findFirst(@Nonnull final NodeList nodeList) { return nodeList.getLength() > 0 ? Optional.of(nodeList.item(0)) : Optional.empty(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public node getFirst() {\n\t\treturn head;\n\t\t//OR\n\t\t//getAt(0);\n\t}", "public Node<T> getFirst() \r\n {\r\n if (isEmpty()) return sentinel;\r\n return sentinel.next;\r\n }", "public Node getFirst() {\r\n\t\treturn getNode(1);\r\n\t}", "public OSMNode firstNode() {\n return nodes.get(0);...
[ "0.63557965", "0.59975684", "0.5997506", "0.59452873", "0.5889296", "0.5873309", "0.5869544", "0.586331", "0.5842724", "0.5801912", "0.57687855", "0.5744356", "0.57238126", "0.5685184", "0.56393546", "0.56279105", "0.558758", "0.55705214", "0.55565196", "0.55412084", "0.55312...
0.6845711
0
Returns the first elements with a given namespace URI and local name.
public static Optional<Element> findFirstElementByNameNS(@Nonnull final NodeList nodeList, @Nullable final String namespaceURI, @Nonnull final String localName) { final int nodeCount = nodeList.getLength(); for(int nodeIndex = 0; nodeIndex < nodeCount; nodeIndex++) { final Node node = nodeList.item(nodeIndex); if(node.getNodeType() == Node.ELEMENT_NODE) { final String nodeNamespaceURI = node.getNamespaceURI(); if(Objects.equals(namespaceURI, nodeNamespaceURI)) { final String nodeLocalName = node.getLocalName(); if(localName.equals(nodeLocalName)) { return Optional.of((Element)node); } } } } return Optional.empty(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\t\tpublic String lookupPrefix(String namespaceURI)\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}", "public List<Element> getElements(String localname, String namespace) throws Exception { \r\n \r\n // Try the SOAP Body first \r\n Element bodyElement = SecUtil.findBodyElement(doc); \r\n...
[ "0.59000444", "0.5891372", "0.5752854", "0.56670034", "0.5551031", "0.54979277", "0.54625624", "0.54582816", "0.5445621", "0.54041606", "0.54041606", "0.53998286", "0.539045", "0.53858215", "0.53858215", "0.53858215", "0.53858215", "0.53858215", "0.5382341", "0.53760064", "0....
0.63080424
0
Returns an iterable to iterate through the nodes in a node list. The returned iterator fails fast if it detects that the node list was modified during iteration.
public static Iterable<Node> iterableOf(@Nonnull final NodeList nodeList) { return () -> new NodeListIterator(nodeList); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Iterator<Node> getNodeIter() {\n\t\treturn nodes.iterator();\n\t}", "public Iterator<LayoutNode> nodeIterator() {\n\treturn nodeList.iterator();\n }", "@Override\n public Iterator<Node<E>> iterator() {\n return new ArrayList<Node<E>>(graphNodes.values()).iterator();\n }", "public Itera...
[ "0.7541471", "0.72289926", "0.7170957", "0.70778453", "0.69888467", "0.6933689", "0.68213135", "0.67299235", "0.66234803", "0.66089463", "0.6517754", "0.65172255", "0.63230836", "0.6316705", "0.6315259", "0.6299455", "0.6275811", "0.62676686", "0.62568545", "0.6249959", "0.62...
0.68362916
6
Returns a stream to iterate through the nodes in a node list. The returned stream fails fast if it detects that the node list was modified during iteration.
public static Stream<Node> streamOf(@Nonnull final NodeList nodeList) { return stream(spliterator(new NodeListIterator(nodeList), nodeList.getLength(), Spliterator.SIZED | Spliterator.ORDERED | Spliterator.NONNULL), false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Iterator<Node> getNodeIter() {\n\t\treturn nodes.iterator();\n\t}", "@Override\n public Iterator<T> iterator() {\n return new UsedNodesIterator<>(this);\n }", "public static Stream<Node> streamOf(@Nonnull final NamedNodeMap namedNodeMap) {\n\t\treturn stream(spliterator(new NamedNodeMapIter...
[ "0.6161599", "0.5996872", "0.59518796", "0.59466785", "0.58224225", "0.57899815", "0.5731943", "0.56010866", "0.55637413", "0.5552657", "0.55382395", "0.55377585", "0.55229855", "0.5461417", "0.5414692", "0.5414271", "0.53945845", "0.53793436", "0.5377925", "0.5335538", "0.52...
0.6942104
0
Retrieves the attributes of the given element as a stream of attribute nodes.
public static Stream<Attr> attributesOf(@Nonnull final Element element) { return streamOf(element.getAttributes()).map(Attr.class::cast); //the nodes should all be instances of Attr in this named node map }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Iterable<? extends XomNode> attributes();", "public List<Jattr> attributes() {\n NamedNodeMap attributes = node.getAttributes();\n if (attributes == null)\n return new ArrayList<Jattr>();\n List<Jattr> jattrs = new ArrayList<Jattr>();\n for (int i = 0; i < attributes.getLength(); i++)...
[ "0.698248", "0.6670523", "0.66283166", "0.65397376", "0.6506256", "0.64640504", "0.6461794", "0.6461794", "0.63940614", "0.63913655", "0.6355918", "0.6351093", "0.63411814", "0.633835", "0.6328104", "0.63279974", "0.63249993", "0.630644", "0.62735873", "0.627058", "0.6245067"...
0.84355056
0
Merges attributes the target element in a namespaceaware manner. Any attribute's value will replace the value, if any, in the target element. Any target element attributes not present in the other attributes will remain.
public static void mergeAttributesNS(@Nonnull final Element targetElement, @Nonnull final Stream<Attr> attributes) { attributes.forEach(attr -> targetElement.setAttributeNS(attr.getNamespaceURI(), attr.getName(), attr.getValue())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void mergeAttributes(TLAttributeOwner target, List<TLAttribute> attributesToMerge,\n RollupReferenceHandler referenceHandler) {\n ModelElementCloner cloner = getCloner( target );\n Set<String> existingAttributeNames = new HashSet<>();\n List<TLAttribute> existingAttributes = null...
[ "0.6695293", "0.62370706", "0.57692707", "0.569742", "0.5527151", "0.5461194", "0.5375219", "0.5353573", "0.5347799", "0.52239084", "0.5206191", "0.5130636", "0.51264954", "0.50291264", "0.4997459", "0.49874258", "0.49823686", "0.49823686", "0.49823686", "0.49823686", "0.4982...
0.8023532
0
Removes an attribute value by local name and namespace URI if its value matches some predicate.
public static boolean removeAttributeNSIf(@Nonnull final Element element, @Nullable final String namespaceURI, @Nonnull final String localName, @Nonnull final Predicate<? super String> valuePredicate) throws DOMException { final boolean remove = findAttributeNS(element, namespaceURI, localName).filter(valuePredicate).isPresent(); if(remove) { element.removeAttributeNS(namespaceURI, localName); } return remove; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "AdditionalAttributes removeAttribute(String name);", "@Override\r\n\t\tpublic void removeAttributeNS(String namespaceURI, String localName) throws DOMException\r\n\t\t\t{\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tpublic void removeAttribute(String arg0) {\n\t\t\n\t}", "@Override\n\tpublic void removeAttribute(Str...
[ "0.6083178", "0.6073846", "0.58255386", "0.58017766", "0.57894224", "0.5764216", "0.57606566", "0.5746014", "0.5740132", "0.572354", "0.57142353", "0.56894827", "0.56785125", "0.55799675", "0.5562671", "0.55448025", "0.5513182", "0.5485165", "0.5484518", "0.5476859", "0.54118...
0.73684883
0
The entry point to Jawk for the VM. The main method is a simple call to the invoke method. The current implementation is as follows: System.exit(invoke(args));
public static void main(String[] args) throws IOException, ClassNotFoundException { System.exit(invoke(args)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(java.\n lang.\n String[] args) {\n \tif (x10.lang.Runtime.runtime == null) {\n \t\tSystem.err.println(\"Please use the 'x10' script to invoke X10 programs, or see the generated\");\n \t\tSystem.err.println(\"Java code for alternate invocation instructions.\");\n \t\tSy...
[ "0.66170865", "0.64041775", "0.63482714", "0.63255394", "0.6203656", "0.61910504", "0.61870587", "0.6176267", "0.61427367", "0.6137011", "0.613117", "0.61253476", "0.6120028", "0.6109254", "0.6108889", "0.609326", "0.6092457", "0.6092457", "0.60859686", "0.60859686", "0.60859...
0.73524696
0
An entry point to Jawk that provides the exit code of the script if interpreted or an compiler error status if compiled. If compiled, a nonzero exit status indicates that there was a compilation problem.
public static int invoke(String[] args) throws IOException, ClassNotFoundException { AVM avm = null; try { AwkParameters parameters = new AwkParameters(Awk.class, null); // null = NO extension description ==> require awk script AwkSettings settings = parameters.parseCommandLineArguments(args); // key = Keyword, value = JawkExtension Map<String, JawkExtension> extensions; if (settings.isUserExtensions()) { extensions = getJawkExtensions(); if (VERBOSE) { System.err.println("(user extensions = " + extensions.keySet() + ")"); } } else { extensions = Collections.emptyMap(); //if (VERBOSE) System.err.println("(user extensions not enabled)"); } AwkTuples tuples = new AwkTuples(); // to be defined below List<ScriptSource> notIntermediateScriptSources = new ArrayList<ScriptSource>(settings.getScriptSources().size()); for (ScriptSource scriptSource : settings.getScriptSources()) { if (scriptSource.isIntermediate()) { // read the intermediate file, bypassing frontend processing tuples = (AwkTuples) readObjectFromInputStream(scriptSource.getInputStream()); // FIXME only the last intermediate file is used! } else { notIntermediateScriptSources.add(scriptSource);; } } if (!notIntermediateScriptSources.isEmpty()) { AwkParser parser = new AwkParser( settings.isAdditionalFunctions(), settings.isAdditionalTypeFunctions(), settings.isUseStdIn(), extensions); // parse the script AwkSyntaxTree ast = null; ast = parser.parse(notIntermediateScriptSources); if (settings.isDumpSyntaxTree()) { // dump the syntax tree of the script to a file String filename = settings.getOutputFilename("syntax_tree.lst"); System.err.println("(writing to '" + filename + "')"); PrintStream ps = new PrintStream(new FileOutputStream(filename)); if (ast != null) { ast.dump(ps); } ps.close(); return 0; } // otherwise, attempt to traverse the syntax tree and build // the intermediate code if (ast != null) { // 1st pass to tie actual parameters to back-referenced formal parameters ast.semanticAnalysis(); // 2nd pass to tie actual parameters to forward-referenced formal parameters ast.semanticAnalysis(); // build tuples int result = ast.populateTuples(tuples); // ASSERTION: NOTHING should be left on the operand stack ... assert result == 0; // Assign queue.next to the next element in the queue. // Calls touch(...) per Tuple so that addresses can be normalized/assigned/allocated tuples.postProcess(); // record global_var -> offset mapping into the tuples // so that the interpreter/compiler can assign variables // on the "file list input" command line parser.populateGlobalVariableNameToOffsetMappings(tuples); } if (settings.isWriteIntermediateFile()) { // dump the intermediate code to an intermediate code file String filename = settings.getOutputFilename("a.ai"); System.err.println("(writing to '" + filename + "')"); writeObjectToFile(tuples, filename); return 0; } } if (settings.isDumpIntermediateCode()) { // dump the intermediate code to a human-readable text file String filename = settings.getOutputFilename("avm.lst"); System.err.println("(writing to '" + filename + "')"); PrintStream ps = new PrintStream(new FileOutputStream(filename)); tuples.dump(ps); ps.close(); return 0; } if (settings.isCompileRun() || settings.isCompileRun()) { // compile! int retcode = attemptToCompile(settings, tuples); if (retcode != 0) { return retcode; } if (settings.isCompileRun()) { return attemptToExecuteCompiledResult(settings); } else { return retcode; } } else { // interpret! avm = new AVM(settings, extensions); return avm.interpret(tuples); } } catch (Error err) { if (IS_WINDOWS) { err.printStackTrace(System.out); return 1; } else { throw err; } } catch (RuntimeException re) { if (IS_WINDOWS) { re.printStackTrace(System.out); return 1; } else { throw re; } } finally { if (avm != null) { avm.waitForIO(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int run(Iterable<String> args) throws IOException {\n Path outputErrors = null;\n boolean expectFailure = false;\n boolean expectWarnings = false;\n boolean exportTestFunctions = false;\n\n // Compiler flags we want to read.\n Path jsOutputFile = null;\n Path createSourceMap = null;\n\...
[ "0.5734958", "0.55769587", "0.55263907", "0.5477413", "0.53304505", "0.5253608", "0.523085", "0.5223361", "0.52135694", "0.5143391", "0.51399755", "0.50769264", "0.50686365", "0.50516176", "0.5044787", "0.49594724", "0.49427086", "0.49427086", "0.49250793", "0.4843112", "0.48...
0.5404414
4
Class constructor to support the JSR 223 scripting interface already provided by Java SE 6.
public Awk(String[] args, InputStream is, PrintStream os, PrintStream es) throws Exception { System.setIn(is); System.setOut(os); System.setErr(es); main(args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void jsContructor() {\n }", "public StandardScriptFactory(String scriptSourceLocator)\n/* */ {\n/* 65 */ this(null, scriptSourceLocator, (Class[])null);\n/* */ }", "public Scriptable construct(Context cx, Scriptable scope, Object[] args);", "public StandardScriptFactory(String scri...
[ "0.71573645", "0.71041286", "0.6869324", "0.6801065", "0.67548794", "0.6708101", "0.6569933", "0.6541504", "0.6460629", "0.64254206", "0.64203686", "0.641768", "0.6250983", "0.6205908", "0.6169459", "0.61168075", "0.61026824", "0.6039687", "0.6027654", "0.5983446", "0.5921046...
0.0
-1
Use reflection in attempt to access the compiler.
private static int attemptToCompile(AwkSettings settings, AwkTuples tuples) { try { if (VERBOSE) { System.err.println("(locating AwkCompilerImpl...)"); } Class<?> compiler_class = Class.forName("org.jawk.backend.AwkCompilerImpl"); if (VERBOSE) { System.err.println("(found: " + compiler_class + ")"); } try { Constructor constructor = compiler_class.getConstructor(AwkSettings.class); try { if (VERBOSE) { System.err.println("(allocating new instance of the AwkCompiler class...)"); } AwkCompiler compiler = (AwkCompiler) constructor.newInstance(settings); if (VERBOSE) { System.err.println("(allocated: " + compiler + ")"); } if (VERBOSE) { System.err.println("(compiling...)"); } compiler.compile(tuples); if (VERBOSE) { System.err.println("(done)"); } return 0; } catch (InstantiationException ie) { throw new Error("Cannot instantiate the compiler: " + ie); } catch (IllegalAccessException iae) { throw new Error("Cannot instantiate the compiler: " + iae); } catch (java.lang.reflect.InvocationTargetException ite) { throw new Error("Cannot instantiate the compiler: " + ite); } } catch (NoSuchMethodException nsme) { throw new Error("Cannot find the constructor: " + nsme); } } catch (ClassNotFoundException cnfe) { throw new IllegalArgumentException("Cannot find the AwkCompiler."); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getCompiler();", "public String getCompilerClassName();", "public boolean getUsePrecompiled();", "public Compiler getCompiler() {\n\t\treturn this.compiler;\n\t}", "protected Object compileAndLoad() throws IOException {\n String generatedSource = printJCodeModel();\n return comp...
[ "0.6705762", "0.62028325", "0.5902953", "0.5810935", "0.5609595", "0.55704284", "0.5535174", "0.5469165", "0.54481226", "0.5434452", "0.54231465", "0.5412755", "0.54068816", "0.539807", "0.53905237", "0.5368844", "0.53360945", "0.53172994", "0.53135645", "0.52951527", "0.5266...
0.0
-1
Prohibit the instantiation of this class, other than the way required by JSR 223.
private Awk() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private ATCres() {\r\n // prevent to instantiate this class\r\n }", "private Example() {\n\t\tthrow new Error(\"no instantiation is permitted\");\n\t}", "private InterpreterDependencyChecks() {\r\n\t\t// Hides default constructor\r\n\t}", "@Override\n public boolean isInstantiable() {\n ...
[ "0.6870852", "0.6756068", "0.6673458", "0.66538584", "0.6618299", "0.65420043", "0.64131355", "0.6376213", "0.62829435", "0.62739986", "0.6268361", "0.62353164", "0.6234686", "0.6223486", "0.6215997", "0.6214177", "0.6213221", "0.6202143", "0.62009114", "0.62001514", "0.61262...
0.0
-1
Locate a row by specified cell value and column index
public int locateRow(String val, int col);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int findLine(int row, Cell[][] cells) {\n\t\tfor (int i = 0; i < cells.length; i++) {\n\t\t\tif (cells[i][0].getAddress().getRow() == row) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "private void searchFor(int colIndex, String value) \n {\n if(colIndex == 2)\n ...
[ "0.66996044", "0.66792333", "0.66088665", "0.66088665", "0.6563663", "0.6533664", "0.6484021", "0.64025164", "0.6389644", "0.6367826", "0.62769836", "0.6271021", "0.6204485", "0.6184396", "0.61653686", "0.6159816", "0.6144259", "0.61096054", "0.6108187", "0.61020404", "0.6065...
0.8312301
0
Judge whether a pair of item exist in table, to implement the mapping table verify.
public boolean doesMapExist(String sourceItem, String targetItem, int sourceCol, int targetCol);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static boolean exists(Reservation res, Table<Reservation> rTable){\n\t\tfor(int r = 0; r < rTable.size(); r++){\n\t\t\tif( (Transaction.sameDestination(rTable.get(r), res)) || (rTable.get(r).seatId() == res.seatId()) ){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\treturn false;\n\t}", "private static boo...
[ "0.63819367", "0.63395405", "0.6151878", "0.61352396", "0.6119827", "0.6010318", "0.5984298", "0.59745944", "0.59435457", "0.5932654", "0.59149295", "0.5888488", "0.5862737", "0.5787995", "0.5772838", "0.5741156", "0.573508", "0.5729773", "0.5729603", "0.571249", "0.57104725"...
0.6465371
0
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); txtNombre = new javax.swing.JTextField(); txtDireccion = new javax.swing.JTextField(); txtTelefono = new javax.swing.JTextField(); txtEmail = new javax.swing.JTextField(); jLabel5 = new javax.swing.JLabel(); txtApellido = new javax.swing.JTextField(); jScrollPane1 = new javax.swing.JScrollPane(); jTableAgenda = new javax.swing.JTable(); btnNuevo = new javax.swing.JButton(); btnEliminar = new javax.swing.JButton(); btnGuardar = new javax.swing.JButton(); btnActualizar = new javax.swing.JButton(); btnCancelar = new javax.swing.JButton(); jPanel3 = new javax.swing.JPanel(); jLabel6 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); jLabel9 = new javax.swing.JLabel(); txtSobrenombre = new javax.swing.JTextField(); jDcalendario = new com.toedter.calendar.JDateChooser(); txtFechaRegistro = new javax.swing.JTextField(); txtRelacion = new javax.swing.JTextField(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos Personales")); jLabel1.setText("Nombre"); jLabel2.setText("Dirección"); jLabel3.setText("Email"); jLabel4.setText("Teléfono"); txtNombre.setBackground(new java.awt.Color(255, 255, 255)); txtDireccion.setBackground(new java.awt.Color(255, 255, 255)); txtTelefono.setBackground(new java.awt.Color(255, 255, 255)); txtEmail.setBackground(new java.awt.Color(255, 255, 255)); jLabel5.setText("Apellido"); txtApellido.setBackground(new java.awt.Color(255, 255, 255)); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel1) .addComponent(jLabel2) .addComponent(jLabel4) .addComponent(jLabel3) .addComponent(jLabel5)) .addGap(64, 64, 64) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(txtApellido, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(txtTelefono, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(txtDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel5) .addComponent(txtApellido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent(txtDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4) .addComponent(txtTelefono, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jTableAgenda.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null} }, new String [] { "Nombre", "Apellido", "Direccion", "Telefono", "E-mail", "Sobrenombre", "Cumpleaños", "Relacion", "Fecha de registro" } )); jTableAgenda.setColumnSelectionAllowed(true); jTableAgenda.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jTableAgendaMouseClicked(evt); } }); jScrollPane1.setViewportView(jTableAgenda); btnNuevo.setText("Nuevo"); btnNuevo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnNuevoActionPerformed(evt); } }); btnEliminar.setText("Eliminar"); btnEliminar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnEliminarActionPerformed(evt); } }); btnGuardar.setText("Guardar"); btnGuardar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnGuardarActionPerformed(evt); } }); btnActualizar.setText("Actualizar"); btnActualizar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnActualizarActionPerformed(evt); } }); btnCancelar.setText("Cancelar"); btnCancelar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnCancelarActionPerformed(evt); } }); jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Otros")); jLabel6.setText("Sobrenombre"); jLabel7.setText("Cumpleaños"); jLabel8.setText("Relacion"); jLabel9.setText("Fecha de registro"); txtSobrenombre.setBackground(new java.awt.Color(255, 255, 255)); jDcalendario.setBackground(new java.awt.Color(255, 255, 255)); jDcalendario.setForeground(new java.awt.Color(255, 255, 255)); txtFechaRegistro.setBackground(new java.awt.Color(255, 255, 255)); txtRelacion.setBackground(new java.awt.Color(255, 255, 255)); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addComponent(jLabel9) .addGap(18, 18, 18) .addComponent(txtFechaRegistro, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)) .addGroup(jPanel3Layout.createSequentialGroup() .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel6) .addComponent(jLabel8) .addComponent(jLabel7)) .addGap(41, 41, 41) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(txtSobrenombre, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jDcalendario, javax.swing.GroupLayout.PREFERRED_SIZE, 228, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(txtRelacion)))) .addGap(142, 142, 142)) ); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(txtSobrenombre, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel6)) .addGap(14, 14, 14) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel7) .addComponent(jDcalendario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel8) .addComponent(txtRelacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel9) .addComponent(txtFechaRegistro, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(37, Short.MAX_VALUE)) ); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jScrollPane1) .addContainerGap()) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(btnNuevo) .addGap(28, 28, 28) .addComponent(btnGuardar) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btnEliminar) .addGap(46, 46, 46) .addComponent(btnActualizar) .addGap(42, 42, 42) .addComponent(btnCancelar) .addGap(32, 32, 32)))) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnNuevo) .addComponent(btnGuardar) .addComponent(btnEliminar) .addComponent(btnActualizar) .addComponent(btnCancelar)) .addContainerGap()) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n ...
[ "0.7321245", "0.7292375", "0.7292375", "0.7292375", "0.7286756", "0.7250393", "0.7215278", "0.7208825", "0.7197639", "0.71918", "0.7185626", "0.716065", "0.71489197", "0.7094757", "0.7081307", "0.7057363", "0.69892997", "0.6978972", "0.6956389", "0.69543713", "0.69465107", ...
0.0
-1
Inflate the layout for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_contacts, container, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup...
[ "0.67412704", "0.6726197", "0.672271", "0.6699313", "0.669242", "0.6689314", "0.6688617", "0.6686282", "0.66776836", "0.66766965", "0.6668088", "0.6667029", "0.66656464", "0.6662109", "0.66548616", "0.66512775", "0.66439325", "0.66397613", "0.6638282", "0.6634949", "0.6626262...
0.0
-1
TODO : Verifiy i
@Override public Action getAction(int i) { return this.actions.get(i); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "private void poetries() {\n\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n protected void getExras() {\n }", ...
[ "0.6050812", "0.60184705", "0.5965121", "0.5963516", "0.59458125", "0.59448653", "0.5944263", "0.59286356", "0.5877312", "0.5877312", "0.58516", "0.5828684", "0.58189917", "0.5817426", "0.5798828", "0.57918996", "0.5790487", "0.57715607", "0.57389414", "0.5737495", "0.5729081...
0.0
-1
Returns a map of parameters matching the given prefix.
public Map<String, String> paramap(String prefix, boolean cutPrefix, String prepend) { Map<String, String> m = null; m = new HashMap<String, String>(); if (prefix == null || StringUtils.isBlank(prefix)) { prefix = null; cutPrefix = false; } for(String k : parameters.keySet()) { if (prefix == null || StringUtils.startsWith(k, prefix)) { m.put(prepend + (cutPrefix ? k.substring(prefix.length()) : k), parameters.get(k)); } } return m; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public <T> Map<String, T> getProperties(String prefix) {\n\t\tMap<String, T> properties = new HashMap<>();\n\n\t\tfor (String key : getPropertyKeys()) {\n\t\t\tif (key.startsWith(prefix)) {\n\t\t\t\tproperties.put(key, getProperty(key));\n\t\t\t}\n\t\t}\n\t\treturn properties;\n\t}", "public Iterable<String> get...
[ "0.69851106", "0.647281", "0.6432152", "0.6353713", "0.62828165", "0.627611", "0.6250109", "0.6230385", "0.62076217", "0.6124611", "0.5944866", "0.59204704", "0.5857986", "0.5836262", "0.58035773", "0.5760158", "0.57549083", "0.5754729", "0.5753529", "0.5750644", "0.5750644",...
0.77705187
0
Return true if parameter's value matches any of the given pvalues, false otherwise.
public boolean isparam(String param, String... pvalues) { if (ArrayUtils.isEmpty(pvalues)) { return getParameter(param) != null; } for(String value : pvalues) { if (StringUtils.equalsIgnoreCase(value, getParameter(param))) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasParameterValue();", "public boolean matchesAny() {\n return value == ANY;\n }", "boolean hasOnlyProceduresInAnyValues();", "private static boolean matchesAny(String searchString, String... possibleValues) {\n\t\tfor (int i = 0; i < possibleValues.length; i++) {\n\t\t\tString attributeValue =...
[ "0.66138494", "0.6606255", "0.646455", "0.64071083", "0.6310185", "0.6157998", "0.60245854", "0.6011773", "0.58781004", "0.5854045", "0.58325785", "0.5824239", "0.58069366", "0.57797927", "0.57582736", "0.5756934", "0.57143253", "0.5711705", "0.57034606", "0.5701131", "0.5682...
0.68848646
0
read & resolve input set for given proc
protected JavaRDD<Map<String, Object>> resolve(Object rdd) { JavaRDD<Map<String, Object>> jRDD = null; if (rdd instanceof JavaPairRDD) { JavaPairRDD<String, Map<String, Object>> jpRDD = (JavaPairRDD<String, Map<String, Object>>) rdd; jRDD = jpRDD.values(); } else if (rdd instanceof JavaRDD) { jRDD = (JavaRDD<Map<String, Object>>) rdd; } return jRDD; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static Scanner determineInputSource(String[] args) throws FileNotFoundException{\n if (args.length > 0) {\n //Reading from file\n return new Scanner(new File(args[0]));\n }\n else {\n //Reading from standard Input\n return new Scanner(System.in);\n }\n }", "public ConsLis...
[ "0.5470917", "0.5437452", "0.52023184", "0.51848435", "0.51733875", "0.5136981", "0.5103892", "0.5064721", "0.49965996", "0.4928257", "0.4920908", "0.49175438", "0.49148887", "0.49115974", "0.48925233", "0.488516", "0.4854707", "0.48523995", "0.4823152", "0.48066458", "0.4796...
0.0
-1
Returns procedure settings collection all attrs set with prefix [progsets.proc..settings.]
public Map<String, String> settings(Procontext pc) { return (HashMap<String, String>)pc.appproperties().propsWithPrefix("progsets.proc." + this.getName() + ".settings.", true).clone(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic Map<String, String> settings(Procontext pc) {\n\t\tMap<String, String> settings = super.settings(pc);\n\t\tString ds = param(\"datasource\");\n\t\tsettings.putAll(pc.appproperties().propsWithPrefix(\"progsets.spark.datasource.\" + ds +\".\", true));\n\t\treturn settings;\n\t}", "public static...
[ "0.56262344", "0.5376531", "0.52118677", "0.5133186", "0.51308227", "0.51200396", "0.50462323", "0.5031674", "0.5028701", "0.50249374", "0.4989956", "0.49643353", "0.4958203", "0.49575493", "0.49477708", "0.49407473", "0.49346358", "0.4925635", "0.48844144", "0.48651487", "0....
0.66800225
0
Throws exception if any of the given key is not found or holds null value in the given map. Return true if all is good. Return false if either map or keys or both are null;
public boolean assertNotNullKeys(Map<String, String> viewparams, String...keys) { if (viewparams == null || keys == null) return false; for(String k : keys) { if (viewparams.get(k) == null) { throw new IllegalArgumentException("proc-argument-exception :key["+ k + "] is missing"); } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static boolean containsAndNotNull(final Map<String, Integer> map, final String node) {\n return map.containsKey(node) && map.get(node) != null;\n }", "boolean containsKey(Object key) throws NullPointerException;", "private static <K, V> boolean isMapEmpty(Map<K, V> aMap) {\n for (V v :...
[ "0.66386765", "0.633892", "0.63002694", "0.61326295", "0.61199754", "0.60908234", "0.6064879", "0.60632336", "0.60332674", "0.6015118", "0.60113657", "0.6004733", "0.595632", "0.59418947", "0.59372187", "0.5917957", "0.58827674", "0.583038", "0.5797522", "0.5794854", "0.57921...
0.6687609
0
Creates/Replaces temp/global view based on saveas parameter. [create/replace global view] global::myviewname = ssql?sql=..... OR [create/replace temp view] temp::myviewname = ssql?sql=..... OR [create/replace temp view] myviewname = ssql?sql=.....
public boolean createOrReplaceView(Dataset<Row> resultset) { String[] saveas = param("saveas").split("::"); if (saveas.length == 1) { resultset.createOrReplaceTempView(saveas[0]); } else if (saveas.length == 2) { if (saveas[0].trim().equalsIgnoreCase("global")) { resultset.createOrReplaceGlobalTempView(saveas[1].trim()); } else if (saveas[0].trim().equalsIgnoreCase("temp")) { resultset.createOrReplaceTempView(saveas[1].trim()); } else { return false; } } else { return false; } LOG().info("created/replaced view [" + param("saveas") + "]"); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void processCreateView() throws HsqlException {\n\n String name = tokenizer.getName();\n HsqlName schemaname =\n session.getSchemaHsqlNameForWrite(tokenizer.getLongNameFirst());\n int logposition = tokenizer.getPartMarker();\n\n database.schemaManager.checkUserViewNot...
[ "0.57645726", "0.5659718", "0.5519179", "0.5287051", "0.5242466", "0.51615685", "0.4970745", "0.49374676", "0.4827892", "0.48260227", "0.48111326", "0.48004213", "0.47980922", "0.47911507", "0.4765512", "0.46969193", "0.4684885", "0.46785414", "0.46578234", "0.4636258", "0.46...
0.7422816
0
Returns a map of key = value pair for the given list of keys
public Map<String, String> paramap(String...params) { Map<String, String> map = new HashMap<String, String>(); for(String p : params) { map.put(p, parameters.get(p)); } return map; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static <K, V> Map<K, V> createMap(List<K> keys, List<V> values) {\n if (keys == null || values == null || keys.size() != values.size()) {\n throw new IllegalArgumentException(\"Keys and Values cannot be null and must be the same size\");\n }\n Map<K, V> newMap = new HashMap<>...
[ "0.68167824", "0.6748008", "0.66732335", "0.6659184", "0.6646892", "0.64314914", "0.6418787", "0.6323621", "0.6196083", "0.6057597", "0.5988876", "0.5976264", "0.5896688", "0.58699393", "0.58124727", "0.5779253", "0.57195246", "0.5711292", "0.571051", "0.57047355", "0.5701262...
0.0
-1
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main_menu, 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.7246451", "0.7201833", "0.7195169", "0.7176824", "0.71071094", "0.7039687", "0.70379424", "0.7011622", "0.70095545", "0.69799995", "0.6945173", "0.69389343", "0.6933555", "0.69172555", "0.69172555", "0.68906796", "0.688355", "0.687496", "0.6874772", "0.68613136", "0.686131...
0.0
-1
TODO Autogenerated method stub /Fragment fragment = new Gallery(); FragmentManager fragmentManager =((FragmentActivity) c).getSupportFragmentManager(); fragmentManager.beginTransaction().replace(R.id.frame_container, fragment).commit();
@Override public void onClick(View arg0) { Toast.makeText(c, "No Current Updates", Toast.LENGTH_SHORT).show(); /* Intent i = new Intent(SingleShop.this, Gallery.class); startActivity(i); */// FragmentTransaction ft = ((ActionBarActivity)context).getSupportFragmentManager().beginTransaction().replace(R.id.frame_container, ft).commit();; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override \n public void onClick(View v) \n {\n \tShowFragmentXXH2 demoFragment = new ShowFragmentXXH2();\n FragmentManager fragmentManager = getFragmentManager();\n FragmentTransaction transaction =fragmentManager.beginTransaction();\n transaction.replace(R.i...
[ "0.71990025", "0.7154692", "0.70094615", "0.68828773", "0.68453234", "0.6841851", "0.6816031", "0.67827564", "0.67808104", "0.6737914", "0.6643703", "0.66332984", "0.66025126", "0.6584934", "0.6573284", "0.6556063", "0.655286", "0.6549923", "0.65471035", "0.6545458", "0.65299...
0.66376024
11
TODO Autogenerated method stub /Fragment fragment = new Gallery(); FragmentManager fragmentManager =((FragmentActivity) c).getSupportFragmentManager(); fragmentManager.beginTransaction().replace(R.id.frame_container, fragment).commit();
@Override public void onClick(View arg0) { Toast.makeText(c, "Correct Address not available", Toast.LENGTH_SHORT).show(); /* Intent i = new Intent(SingleShop.this, Gallery.class); startActivity(i); */// FragmentTransaction ft = ((ActionBarActivity)context).getSupportFragmentManager().beginTransaction().replace(R.id.frame_container, ft).commit();; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override \n public void onClick(View v) \n {\n \tShowFragmentXXH2 demoFragment = new ShowFragmentXXH2();\n FragmentManager fragmentManager = getFragmentManager();\n FragmentTransaction transaction =fragmentManager.beginTransaction();\n transaction.replace(R.i...
[ "0.7196978", "0.7152507", "0.7008393", "0.6881259", "0.6843558", "0.6839591", "0.6814253", "0.67810494", "0.67793614", "0.6735866", "0.66415715", "0.6637066", "0.66313416", "0.6600232", "0.6584002", "0.65708905", "0.6554369", "0.6551196", "0.654736", "0.65455055", "0.6543082"...
0.6034514
91
TODO Autogenerated method stub. rl_offers.setVisibility(1);
@Override public void onClick(View v) { Intent in = new Intent(SingleShop.this, ShopOffers.class); // Bitmap image= in.getDrawingCache(); // Bundle sending_image = new Bundle(); // sending_image.putParcelable("image", image); in.putExtra(SHOP_NAME, name); in.putExtra(MALL, mall); // in.putExtras(sending_image);//image in.putExtra(SHOP_NO, shop_no); in.putExtra(RATING, rating); in.putExtra(FLOOR, floor); /** hidden */ in.putExtra(DESC, desc); in.putExtra("url", url); in.putExtra(ID, id); in.putExtra(CONTACT, contact_no); in.putExtra(EMAIL, email); // in.putExtra(OFFERS, offers); in.putExtra(BRAND, brand); in.putExtra(FB, fb); // in.putExtra(TWITTER, shop_twitter); // in.putExtra(GPLUS, shop_gplus); in.putExtra("offer_url", offers); startActivity(in); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void setVisible(boolean b) {\n\t\t\n\t}", "public void setVisible(boolean b) {\n\t\t\n\t}", "public void setVisible(boolean v) {\n }", "public void setVisible(boolean visible);", "@SuppressWarnings(\"unused\")\n void setVisible(boolean visible);", "void setVisible(boolean vi...
[ "0.6884153", "0.6848446", "0.67787755", "0.675548", "0.67375094", "0.6713134", "0.6713134", "0.67088217", "0.6696037", "0.6647146", "0.66433144", "0.66424227", "0.6625769", "0.66217256", "0.6619828", "0.66178334", "0.6586959", "0.65779793", "0.6535253", "0.65190995", "0.65112...
0.0
-1
TODO Autogenerated method stub
@SuppressLint("NewApi") @Override public void onClick(View v) { if (contact_no.equalsIgnoreCase("null") || contact_no.length() == 0 || contact_no.isEmpty()) { Toast.makeText(SingleShop.this,"No Contact details ", Toast.LENGTH_SHORT).show(); /* toast */ } else { String phn_no = "tel:" + contact_no; Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri.parse(phn_no)); startActivity(callIntent); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.single_shop_menu, menu); return super.onCreateOptionsMenu(menu); }
{ "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
Constructor for BoardSetup gets an instance of the board
public BoardSetup() { this.theBoard = Board.getInstance(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Board() {\n initialize(3, null);\n }", "public Board()\r\n\t{\r\n\t\tsuper(8, 8);\r\n\t}", "public void boardSetUp(){\n\t}", "Board() {\n this.cardFactory = new CardFactory(this);\n }", "public Board() {\n this.board = new byte[][] { new byte[3], new byte[3], new byte[3] }...
[ "0.7724635", "0.76606464", "0.7533611", "0.75038344", "0.74023676", "0.7387131", "0.73303723", "0.7323848", "0.73202884", "0.7297463", "0.7238884", "0.7237329", "0.719384", "0.7107914", "0.71021205", "0.71007514", "0.70686793", "0.70483536", "0.7044515", "0.70322055", "0.6917...
0.8345429
0
Sets all tiles in the board grid as either sea tiles or the board game tiles using the setTile method in the Board class. The sea tiles will always be located in the same place The tile locations are all within the TileStack class which also shuffles them. setTiles() simply pops the TilesEnums from the TileStack and sets them on the board with a coordinate
public void setTiles() { TileStack names = new TileStack(); for(int x=0; x < theBoard.getCols(); x++) { for(int y=0; y < theBoard.getRows(); y++) { p = new Point(x,y); if(p.equals(new Point(0,0))) theBoard.setTile(p, TilesEnums.SEA); else if(p.equals(new Point(1,0))) theBoard.setTile(p, TilesEnums.SEA); else if(p.equals(new Point(4,0))) theBoard.setTile(p, TilesEnums.SEA); else if(p.equals(new Point(5,0))) theBoard.setTile(p, TilesEnums.SEA); else if(p.equals(new Point(0,1))) theBoard.setTile(p, TilesEnums.SEA); else if(p.equals(new Point(5,1))) theBoard.setTile(p, TilesEnums.SEA); else if(p.equals(new Point(0,4))) theBoard.setTile(p, TilesEnums.SEA); else if(p.equals(new Point(5,4))) theBoard.setTile(p, TilesEnums.SEA); else if(p.equals(new Point(0,5))) theBoard.setTile(p, TilesEnums.SEA); else if(p.equals(new Point(1,5))) theBoard.setTile(p, TilesEnums.SEA); else if(p.equals(new Point(4,5))) theBoard.setTile(p, TilesEnums.SEA); else if(p.equals(new Point(5,5))) theBoard.setTile(p, TilesEnums.SEA); else theBoard.setTile(p, names.pop()); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void moveAllTilesToStack()\n {\n for (int i = 0; i < gridColumns; i++)\n {\n for (int j = 0; j < gridRows; j++)\n {\n ArrayList<MahjongSolitaireTile> cellStack = tileGrid[i][j];\n moveTiles(cellStack, stackTiles);\n }\n }...
[ "0.705076", "0.6967139", "0.6540606", "0.6537031", "0.6528426", "0.6492376", "0.63889617", "0.6376014", "0.63600785", "0.6323498", "0.6271421", "0.622279", "0.6204782", "0.6178662", "0.61524516", "0.61441934", "0.6131804", "0.6106299", "0.60901535", "0.60798633", "0.60540676"...
0.79046106
0
Generates the item json
public static ByteArrayInputStream getItemJson(Identifier identifier) { JsonObject file = new JsonObject(); file.addProperty("forge_marker", 1); file.addProperty("parent", "item/generated"); JsonObject texture = new JsonObject(); texture.addProperty("layer0", identifier.getNamespace() + ":items/" + identifier.getPath()); file.add("textures", texture); return new ByteArrayInputStream(file.toString().getBytes()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static JsonItem toBasicJson(Item item) {\r\n\t\tJsonItem jsonItem = new JsonItem();\r\n\t\tapplyBasicJsonValues(jsonItem, item);\r\n\t\treturn jsonItem;\r\n\t}", "public void jsonPresentation () {\n System.out.println ( \"****** Json Data Module ******\" );\n ArrayList<Book> bookArrayList...
[ "0.6264361", "0.61257917", "0.60855603", "0.5993116", "0.5967912", "0.5961695", "0.5925771", "0.5869404", "0.57349944", "0.57086307", "0.5672144", "0.5664727", "0.5648594", "0.5641302", "0.5619084", "0.5617529", "0.5613106", "0.56120175", "0.5610552", "0.55990976", "0.5575057...
0.57365
8
Determines whether a block model or blockstate is needed
public static ByteArrayInputStream getBlockJson(String name, Identifier id) { switch (name.split("/")[2]) { case "blockstates": return getBlockstateJson(id); case "models": return name.split("/")[3].equals("block") ? getBlockModelJson(id) : getItemJson(id); default: Logger.getLogger("AutoJson").log(Level.WARNING, "Could not create Block JSON"); return new ByteArrayInputStream("".getBytes()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean isBlockAvailable(BlockShape shape) {\n boolean result = false;\n\n for (BlockColor color : map_color_to_id.keySet()) {\n if (objBlockFactory.IsBlocktypeAvailable(shape, color)){\n result = true;\n break;\n }\n ...
[ "0.65386134", "0.64407337", "0.64407337", "0.6251101", "0.61981463", "0.61981463", "0.61412483", "0.5939995", "0.5939995", "0.5875477", "0.57877034", "0.5641719", "0.561473", "0.5560016", "0.5552222", "0.55347073", "0.5529753", "0.5517408", "0.54938245", "0.54842544", "0.5484...
0.0
-1
Gets the block model
public static ByteArrayInputStream getBlockModelJson(Identifier id) { JsonObject file = new JsonObject(); file.addProperty("parent", "block/cube_all"); JsonObject texture = new JsonObject(); texture.addProperty("all", id.getNamespace() + ":block/" + id.getPath()); file.add("textures", texture); return new ByteArrayInputStream(file.toString().getBytes()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Model getBlockModel(BlockRenderOptions blockRenderOptions) {\n Model model = blockModelCache.get(blockRenderOptions);\n if (model == null) {\n if (blockRenderOptions.getBlockData() != null) {\n model = this.loadBlockModel(blockRenderOptions);\n }\n ...
[ "0.77480525", "0.76082927", "0.75798744", "0.72032607", "0.71880615", "0.7146991", "0.70948887", "0.7048966", "0.7036783", "0.6996539", "0.6895786", "0.6890308", "0.6609727", "0.6594653", "0.65696853", "0.6551622", "0.65412664", "0.65369296", "0.65127444", "0.64320415", "0.64...
0.0
-1
Gets the blockstate json
public static ByteArrayInputStream getBlockstateJson(Identifier id) { JsonObject file = new JsonObject(); JsonObject variants = new JsonObject(); JsonObject model = new JsonObject(); model.addProperty("model",id.getNamespace() + ":block/" + id.getPath()); variants.add("", model); file.add("variants", variants); return new ByteArrayInputStream(file.toString().getBytes()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public org.json.JSONObject viewBlockChainStatus() {\n org.json.JSONObject jsonString = new org.json.JSONObject().put(\"size\", getChainSize())\n .put(\"hashes\", hashesPerSecond())\n .put(\"difficulty\", getLatestBlock().getDifficulty())\n .put(\"nonce\", getLate...
[ "0.6830847", "0.67196083", "0.6349104", "0.631796", "0.6200836", "0.6193913", "0.615754", "0.6091674", "0.59984916", "0.5988455", "0.59476924", "0.59476924", "0.59476924", "0.59476924", "0.59476924", "0.59476924", "0.59476924", "0.59476924", "0.59476924", "0.59476924", "0.594...
0.6457062
2
Generates the sounds.json file
public static ByteArrayInputStream getSoundsJson(String name) { JsonObject file = new JsonObject(); for (SoundEvent sound : getSoundMap().get(name)) { JsonObject soundInfo = new JsonObject(); soundInfo.addProperty("category", "records"); JsonObject trackInfo = new JsonObject(); trackInfo.addProperty("name", sound.getId().getNamespace() + ":music/" + Objects.requireNonNull(sound.getId()).getPath()); trackInfo.addProperty("stream", true); JsonArray array = new JsonArray(); array.add(trackInfo); soundInfo.add("sounds", array); file.add(sound.getId().getPath(), soundInfo); } return new ByteArrayInputStream(file.toString().getBytes()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void generateAudio() {\n soundHandler.generateTone();\n }", "public static void createSoundsArrList() {\r\n\t\t//Clears the sounds array list.\r\n\t\tsounds.clear();\r\n\t\t\r\n\t\t//Adds all the sound files to the sounds array list.\r\n\t\tsounds.add(\"Start=\" + Main.soundGameStart);\r\n\t\ts...
[ "0.61876255", "0.59350777", "0.5681976", "0.5634494", "0.55896", "0.5569786", "0.55427486", "0.55288076", "0.5522582", "0.5514522", "0.5507047", "0.5500867", "0.5500867", "0.54442286", "0.5426719", "0.54256785", "0.5411431", "0.5409612", "0.5396791", "0.53739756", "0.5369887"...
0.6484831
0
Generates the lang file independent of any specific mod
public static ByteArrayInputStream getLangFile() { JsonObject file = new JsonObject(); for (Identifier id : AutoJsonApi.getMap().keySet()) { file.addProperty((AutoJsonApi.getMap().get(id).getType() == AutoConfig.AutoConfigType.ITEM ? "item." : "tile.") + id.getNamespace() + "." + id.getPath(), AutoJsonApi.getMap().get(id).getLangName()); } return new ByteArrayInputStream(file.toString().getBytes()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void OnLanguageLoaded( StringTranslate translator )\r\n\t{\n\t\t\r\n\t\tif ( m_bModsInitialized )\r\n\t\t{\r\n\t \tIterator modIterator = m_ModList.iterator();\r\n\t \t\r\n\t \twhile ( modIterator.hasNext() )\r\n\t \t{\r\n\t \t\tFCAddOn tempMod = (FCAddOn)modIterator.next();\r\n\t \...
[ "0.571733", "0.5712695", "0.56660867", "0.5657097", "0.5493334", "0.54075164", "0.5380193", "0.53545976", "0.53209215", "0.52609915", "0.5250204", "0.5099297", "0.5096591", "0.50961787", "0.5074442", "0.5068011", "0.5058256", "0.5057576", "0.5057576", "0.5057576", "0.5054085"...
0.48441315
45
Displays the menu for action selection
public void displayMenu() { System.out.println("\n1 to see vehicles in a date interval"); System.out.println("2 to see a specific reservation"); System.out.println("3 to see all reservations"); System.out.println("9 to exit\n"); try { String in = reader.readLine(); switch (in) { case "1": displayCarsInInterval(); break; case "2": displaySpecificBooking(); break; case "3": displayBookings(); break; case "9": System.out.println("Client application terminated"); System.exit(0); break; default: System.out.println("Please insert a valid number"); break; } } catch (IOException e) { System.out.println("Unexpected problem with reading your input, please try again."); } displayMenu(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static void displayMenu(){\n\t\tSystem.out.println(\"\");\n\t\tSystem.out.println(\"Select operation:\");\n\t\tSystem.out.println(\"1-List movies\");\n\t\tSystem.out.println(\"2-Show movie details\");\n\t\tSystem.out.println(\"3-Add a movie\");\n\t\tSystem.out.println(\"4-Add an example set of 5 movies\");\n\t\tSy...
[ "0.7978134", "0.75677425", "0.74935675", "0.7490154", "0.74356055", "0.7433002", "0.7349632", "0.7323936", "0.7230708", "0.7183302", "0.71424913", "0.7120573", "0.70925957", "0.7042211", "0.7019658", "0.7014265", "0.7013527", "0.7010985", "0.6994502", "0.69889987", "0.6940397...
0.0
-1
Informs the user that the data has been changed
public void update(Object updateMsg) { System.out.println("\n-----------------------Update message from server---------------------"); System.out.println(updateMsg); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void dataChanged() {\n\t\tif (wijzigInfo)\n\t\t\twijzigInfo();\n\n\t\tsetChanged();\n\t\tnotifyObservers(\"dataChanged\");\n\t}", "private void change() {\n\t\tsetChanged();\n\t\t//NotifyObservers calls on the update-method in the GUI\n\t\tnotifyObservers();\n\t}", "public void onDataChanged(){}", "pu...
[ "0.75611925", "0.72627", "0.7017303", "0.70171726", "0.7016781", "0.7014738", "0.69588506", "0.695021", "0.6888612", "0.68458825", "0.68148243", "0.6749896", "0.6742004", "0.67382884", "0.6702547", "0.66977704", "0.6692353", "0.66813946", "0.6662778", "0.66599196", "0.6658765...
0.0
-1
Extracts category id + name pairs and parent to children links.
private static void extractNamesAndLinks( final List<CategoryName> path, final Map<String, String> categoryNames, final Map<String, Set<String>> links ) { Set<String> children; String parent = null; for (final CategoryName category : path) { if (parent != null) { children = links.get(parent); if (children == null) { children = new LinkedHashSet<>(); } children.add(category.getId()); links.put(parent, children); } parent = category.getId(); categoryNames.put(category.getId(), category.getName()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void computeParents(Category category, Collection<Category> categories){\n StringBuilder fullPath = new StringBuilder();\n int n = category.getSegments().length;\n for(int i=0; i<n-1;i++){\n String pathSegment = category.getSegments()[i];\n fullPath.append(pathS...
[ "0.5793284", "0.57066196", "0.56758016", "0.55723435", "0.54697925", "0.54484934", "0.54194915", "0.5418932", "0.5400581", "0.5335716", "0.5316848", "0.5315886", "0.52932596", "0.52628016", "0.52564466", "0.52514887", "0.5243458", "0.52081573", "0.51969206", "0.51967424", "0....
0.67741007
0
Method called when the recycler item is created.
@Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.recycler_list_item, parent, false); v.setBackgroundResource(mBackgroundResourceID); return new ViewHolder(v); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onSetNewCurrentItem() {\n }", "private void setRecyclerViewData() {\n\n itemList = new ArrayList<ListItem>();\n itemList.add(new RememberCardView(\"Du musst 12€ zahlen\"));\n itemList.add(new DateCardItem(\"Mo\", \"29.07.\", \"Training\", \"20:00\", \"21:45\"));\n i...
[ "0.6447712", "0.6410312", "0.6324368", "0.610718", "0.6097037", "0.6069208", "0.60369384", "0.60224265", "0.5971589", "0.59543437", "0.59340876", "0.59250945", "0.5918586", "0.591307", "0.59099543", "0.59012", "0.59006035", "0.58955806", "0.58944476", "0.58917004", "0.5886004...
0.57789963
32
Method called as data is bound to the recycler item.
@Override public void onBindViewHolder(ViewHolder vh, final int index) { MovieRecord movie = mMovies.get(index); vh.title.setText(movie.getTitle()); vh.year.setText(movie.getYear()); vh.poster.setTag(movie.getPosterURL()); mImageManager.displayImage(movie.getPosterURL(), vh.poster, R.drawable.ic_default_image); vh.view.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { MainActivity.MovieDataTask task = new MainActivity.MovieDataTask(v.getContext()); task.execute(mMovies.get(index).getTitle()); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setRecyclerViewData() {\n }", "private void bindData(ViewHolder vh, int position) {\n\n }", "protected void onDataChanged(V item) {\n\n }", "@Override\n protected void onDataChanged() {\n }", "protected void onBindData(Context context, int position, T item, int i...
[ "0.7105899", "0.6821087", "0.67530894", "0.67227995", "0.6673291", "0.6522273", "0.65133905", "0.6513098", "0.6461717", "0.64501196", "0.6419711", "0.63922185", "0.6348755", "0.6332826", "0.63307047", "0.63307047", "0.6307132", "0.6303394", "0.6298811", "0.6268085", "0.625961...
0.0
-1
Method to get the number of items in the recyclerview.
@Override public int getItemCount() { return mMovies.size(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getItemCount() {\n checkWidget();\n return OS.SendMessage(handle, OS.TCM_GETITEMCOUNT, 0, 0);\n }", "int getItemsCount();", "int getItemsCount();", "int getItemCount();", "int getItemCount();", "int getItemCount();", "public long getItemCount() {\n\t\treturn this.getSize(dat...
[ "0.7891878", "0.781271", "0.781271", "0.7805704", "0.7805704", "0.7805704", "0.7694725", "0.7689438", "0.7613538", "0.7576405", "0.75407946", "0.74986166", "0.74986166", "0.74738836", "0.7460033", "0.7442397", "0.7434008", "0.7423907", "0.74177325", "0.7412196", "0.7380772", ...
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { new AbsoluteLayoutTest(); }
{ "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
Created by ericjohn1 on 7/27/2016.
@FunctionalInterface public interface PReturn { //functional interfaces: one abstract method, as many instance or static methods as you'd like. public int returnInt(int x); //public abstract int returnInt2(String x); //new to java 8: default methods (cannot be used with @FunctionalInterfaces //public default int returnInt(int x) { return x; } //new to java 8: static methods now in interfaces public static boolean isIReturn(Object obj) { return obj instanceof IReturn; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n public void func_104112_b() {\n \n }", "public final void mo51373a() {\n }", "private stendhal() {\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Ove...
[ "0.5816566", "0.57261646", "0.57148856", "0.5684192", "0.56689084", "0.56034154", "0.55951536", "0.55838186", "0.5562889", "0.55591595", "0.54950523", "0.54950523", "0.54911065", "0.54910314", "0.54838", "0.5481002", "0.5430959", "0.5430036", "0.54262865", "0.5415598", "0.540...
0.0
-1
functional interfaces: one abstract method, as many instance or static methods as you'd like.
public int returnInt(int x);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@FunctionalInterface\r\ninterface SingleMethod { // functional interface cant have more than one abstract method\r\n\tvoid method();\r\n\t\r\n}", "@FunctionalInterface // or we can call it SAM\r\n interface ShowMe{\r\n\t\r\n\t void showOk();\r\n\t \r\n\tpublic default void one()\r\n\t {\r\n\t System.out.pr...
[ "0.74134064", "0.71626246", "0.700798", "0.694461", "0.67997223", "0.6738837", "0.67226595", "0.66665363", "0.6652518", "0.66277355", "0.65757895", "0.654059", "0.6523962", "0.6510947", "0.6504589", "0.6488256", "0.64795667", "0.64763397", "0.6472688", "0.6465864", "0.6457616...
0.0
-1
Call to the repository for a simple select all
@Override public List<ReaderDTO> getAllReaders() { List<Reader> readers = readerRepository.findAll(); List<ReaderDTO> readersDTO = readers.stream() .map(ReaderConverter::convert) .collect(Collectors.toList()); return readersDTO; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "SelectQueryBuilder selectAll();", "List<Dormitory> selectAll();", "public List<o> selectAll();", "List<Usertype> selectAll();", "@Override\n\tpublic List<Basicunit> selectAll() {\n\t\treturn basicDAOManager.selectAll();\n\t}", "@SelectProvider(type = BaseProvider.class, method = \"findAll\")\n List<T>...
[ "0.7744296", "0.72403175", "0.7217074", "0.7155039", "0.71389306", "0.6993009", "0.69451684", "0.69274217", "0.6922253", "0.6922253", "0.6884361", "0.6868153", "0.6825701", "0.679565", "0.67324466", "0.67235655", "0.6715985", "0.669068", "0.6689948", "0.6688453", "0.66820896"...
0.0
-1
Search by id, cardNumber, name or surname calling the query by example method in the reader repository.
@Override public List<ReaderDTO> searchByIdOrCardNumberOrNameOrSurname(Integer id, Integer cardNumber, String name, String surname) { Reader readerExample = new Reader(); readerExample.setId(id); readerExample.setCardNumber(cardNumber); readerExample.setName(name); readerExample.setSurname(surname); ExampleMatcher matcher = ExampleMatcher.matching() .withMatcher("name", nome -> nome.ignoreCase().contains()) .withMatcher("surname", cognome -> cognome.ignoreCase().contains()); List<Reader> readers = readerRepository.findAll(Example.of(readerExample, matcher)); List<ReaderDTO> readerDTOs = new ArrayList<>(); readerDTOs = readers.stream() .map(ReaderConverter::convert) .collect(Collectors.toList()); return readerDTOs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<Card> search(String searchString, long userId) throws PersistenceCoreException;", "List<Card> search(String searchString) throws PersistenceCoreException;", "public static void search() {\n int userSelected = selectFromList(crudParamOptions);\n switch (userSelected){\n case 1:\n ...
[ "0.7094102", "0.6802201", "0.63848454", "0.6250171", "0.6127985", "0.6066441", "0.5975129", "0.59528005", "0.59248054", "0.58922005", "0.58754945", "0.5870839", "0.5868605", "0.581828", "0.5792406", "0.5755413", "0.5754467", "0.5742924", "0.5694122", "0.5693764", "0.5684155",...
0.7525441
0
Insert a new record in the reader database. Id must be null.
@Override public ReaderDTO insertNewReader(ReaderDTO readerDTO) throws BadRequestException { if (readerDTO.getId() != null) { throw new BadRequestException("The reader id should not be passed or must be null"); } if (readerDTO.getCardNumber() != null) { throw new BadRequestException("The card number should not be passed or must be null"); } LibraryCard libraryCard = libraryCardService.createNewValidCard(); readerDTO.setCardNumber(libraryCard.getId()); Reader savedReader = saveReader(readerDTO); return ReaderConverter.convert(savedReader); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void insertSingleRecord(int id) {\n\t\tSystem.out.println(\"insrted >> \"+id);\n\t\tString sql = \"INSERT INTO OMNICEL (ID, NAME, IMAGE_URL, CATEGORY, LABELS, PRICES, DESCRIPTION) VALUES (?, ?, ?, ?, ?, ?, ?)\";\n\t\tint val = jdbcTemplate.update(sql, id, \"sj\", \"https://stackoverflow.com/use...
[ "0.69011134", "0.64974236", "0.64888126", "0.64334166", "0.6374607", "0.6359561", "0.63387865", "0.62761617", "0.6269062", "0.62569106", "0.62556154", "0.62493396", "0.62143403", "0.6196413", "0.6180787", "0.61792445", "0.6174981", "0.61723745", "0.6170846", "0.61522776", "0....
0.0
-1
Update Reader if id is not null and the record is present in the DB. All the value will be overwrote.
@Override public ReaderDTO updateEntity(ReaderDTO readerDTO) throws BadRequestException { Optional<Reader> oldReader; if (readerDTO.getId() != null) { oldReader = readerRepository.findById(readerDTO.getId()); } else { throw new BadRequestException("The id cannot be null"); } if (oldReader.isPresent()) { Reader reader = ReaderConverter.convertWithId(readerDTO); Reader savedReader = readerRepository.save(reader); return ReaderConverter.convert(savedReader); } else { throw new BadRequestException("Reader not present in the database"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Long updateById(Store t, long id) {\n return null;\n }", "@Override\n\tpublic int update(int id) {\n\t\treturn rolDao.update(id);\n\t}", "@Override\n\tpublic void update(Serializable id) {\n\t\t\n\t\tNote n = this.findById(id);\n\t\tif(n==null){\n\t\t\tthrow new RuntimeException...
[ "0.6277737", "0.61091", "0.586425", "0.5818865", "0.5780695", "0.5775445", "0.57414407", "0.5730605", "0.57237077", "0.5718137", "0.5704742", "0.5704742", "0.56960106", "0.5689548", "0.5682526", "0.5663074", "0.5644859", "0.5644158", "0.5641179", "0.56224215", "0.5621933", ...
0.6614832
0
Helper method to save a record. If id (Loan) is present it will override the record
private Reader saveReader(ReaderDTO readerDTO) { Reader reader = ReaderConverter.convert(readerDTO); return readerRepository.save(reader); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void save(Borrowrecord borrowrecord) {\n\t\tthis.borrowrecordMapper.insert(borrowrecord);\n\t}", "public Ware save(Ware record){\n \tif(record==null)\n \t\treturn null;\n\t\tif(record.getWareid()==null||record.getWareid().intValue()==0){\n\t\t\tLong pkValue = this.insert(record);\n\t\t\...
[ "0.6521322", "0.62543434", "0.6236858", "0.6062144", "0.59168416", "0.5916297", "0.58971", "0.5876306", "0.58754313", "0.5810471", "0.57733345", "0.5730663", "0.57287383", "0.5726378", "0.5702161", "0.5694928", "0.56913847", "0.56730163", "0.5665506", "0.56572586", "0.5622939...
0.0
-1
Delete a Reader if present in the DB.
@Override public ReaderDTO deleteReaderById(Integer id) throws BadRequestException { Optional<Reader> readerOptional = readerRepository.findById(id); if (readerOptional.isPresent()) { readerRepository.delete(readerOptional.get()); } else { throw new BadRequestException("Reader not present in the DB"); } return ReaderConverter.convert(readerOptional.get()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int delete(int rb_seq) {\n\t\t\n\t\tint ret = readBookDao.delete(rb_seq);\n\t\treturn ret;\n\t}", "@Writer\n int deleteByPrimaryKey(Integer id);", "protected void deleteRecord() throws DAOException {\r\n\t\t// Elimina relaciones\r\n\t\tfor (Sedrelco relco : object.getRelcos()) {\r\n\t\t\tsedrelcoDao....
[ "0.60351896", "0.5917459", "0.5859814", "0.5817477", "0.5810262", "0.57476884", "0.5723173", "0.57198423", "0.5714904", "0.57139355", "0.570522", "0.56983954", "0.5680221", "0.56780565", "0.5666887", "0.56651855", "0.5644965", "0.5641993", "0.563429", "0.5603374", "0.55728", ...
0.6827544
0
Check if the document generator response contains the information needed to build the filing model: Description, period end on (within description values) and the ixbrl location are needed.
public boolean isDocumentGeneratorResponseValid(DocumentGeneratorResponse response) { boolean isDocGeneratorResponseValid = true; LOGGER.info("DocumentGeneratorResponseValidator: validating document generator response"); if (!isPeriodEndOnInDocGeneratorResponse(response)) { isDocGeneratorResponseValid = false; } if (!isDescriptionInDocGeneratorResponse(response)) { isDocGeneratorResponseValid = false; } if (!isIxbrlInDocGeneratorResponse(response)) { isDocGeneratorResponseValid = false; } LOGGER.info("DocumentGeneratorResponseValidator: validation has finished"); return isDocGeneratorResponseValid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean isIxbrlInDocGeneratorResponse(DocumentGeneratorResponse response) {\n\n if (StringUtils.isBlank(getIxbrlLocationFromDocGeneratorResponse(response))) {\n Map<String, Object> logMap = new HashMap<>();\n logMap.put(LOG_MESSAGE_KEY,\n \"The Ixbrl location has...
[ "0.7208274", "0.6882289", "0.6268569", "0.5742054", "0.5730109", "0.57106495", "0.56958705", "0.5556214", "0.55000967", "0.54936886", "0.5460726", "0.5443813", "0.54259634", "0.51915944", "0.51894784", "0.51861554", "0.51382315", "0.51330346", "0.51308334", "0.51169306", "0.5...
0.63968456
2
Checks if the document generator response contains the ixbrl location.
private boolean isIxbrlInDocGeneratorResponse(DocumentGeneratorResponse response) { if (StringUtils.isBlank(getIxbrlLocationFromDocGeneratorResponse(response))) { Map<String, Object> logMap = new HashMap<>(); logMap.put(LOG_MESSAGE_KEY, "The Ixbrl location has not been set in Document Generator Response"); LOGGER.error(LOG_DOC_GENERATOR_RESPONSE_INVALID_MESSAGE_KEY, logMap); return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String getIxbrlLocationFromDocGeneratorResponse(DocumentGeneratorResponse response) {\n return Optional.of(response)\n .map(DocumentGeneratorResponse::getLinks)\n .map(Links::getLocation)\n .orElse(null);\n }", "boolean hasResponseAddress();", "public boolean ...
[ "0.6755741", "0.6052594", "0.58650017", "0.58067584", "0.57020694", "0.56950015", "0.5668193", "0.5665524", "0.5665524", "0.5631256", "0.56299025", "0.56070304", "0.55932224", "0.5570236", "0.54824615", "0.5420411", "0.5389328", "0.53849244", "0.5364275", "0.5328899", "0.5328...
0.86903214
0
Checks if the document generator response contains account's description.
private boolean isDescriptionInDocGeneratorResponse(DocumentGeneratorResponse response) { if (StringUtils.isBlank(response.getDescription())) { Map<String, Object> logMap = new HashMap<>(); logMap.put(LOG_MESSAGE_KEY, "The description has not been in the Document Generator Response"); LOGGER.error(LOG_DOC_GENERATOR_RESPONSE_INVALID_MESSAGE_KEY, logMap); return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasDescription();", "boolean hasDescription();", "boolean hasDescription();", "private boolean isPeriodEndOnInDocGeneratorResponse(DocumentGeneratorResponse response) {\n\n if (response.getDescriptionValues() == null ||\n !response.getDescriptionValues().containsKey(PERIOD_END_ON) |...
[ "0.60851717", "0.60851717", "0.60851717", "0.5982131", "0.59213805", "0.5817463", "0.5816497", "0.58139104", "0.5792304", "0.5749712", "0.5749712", "0.5669964", "0.5630571", "0.5620771", "0.5601497", "0.55510825", "0.5531631", "0.5524569", "0.5513109", "0.54950887", "0.547222...
0.7827643
0
Checks the document generator response contains the period end on within the description values.
private boolean isPeriodEndOnInDocGeneratorResponse(DocumentGeneratorResponse response) { if (response.getDescriptionValues() == null || !response.getDescriptionValues().containsKey(PERIOD_END_ON) || StringUtils.isBlank(response.getDescriptionValues().get(PERIOD_END_ON))) { Map<String, Object> logMap = new HashMap<>(); logMap.put(LOG_MESSAGE_KEY, "Period end on has not been set within the description_values in the Document Generator Response"); LOGGER.error(LOG_DOC_GENERATOR_RESPONSE_INVALID_MESSAGE_KEY, logMap); return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean isDescriptionInDocGeneratorResponse(DocumentGeneratorResponse response) {\n\n if (StringUtils.isBlank(response.getDescription())) {\n Map<String, Object> logMap = new HashMap<>();\n logMap.put(LOG_MESSAGE_KEY,\n \"The description has not been in the Docum...
[ "0.6463815", "0.5862842", "0.57779044", "0.5662192", "0.5478821", "0.53416437", "0.53404367", "0.5247425", "0.5144684", "0.50997066", "0.50793284", "0.5065988", "0.5015761", "0.5011701", "0.50028753", "0.4992931", "0.4987358", "0.4958074", "0.495203", "0.49508974", "0.4930049...
0.8328001
0
Get the ixbrl location stored in the document generator response values.
private String getIxbrlLocationFromDocGeneratorResponse(DocumentGeneratorResponse response) { return Optional.of(response) .map(DocumentGeneratorResponse::getLinks) .map(Links::getLocation) .orElse(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public L getDocumentLocation();", "gov.nih.nlm.ncbi.www.CodeBreakDocument.CodeBreak.Loc getLoc();", "private boolean isIxbrlInDocGeneratorResponse(DocumentGeneratorResponse response) {\n\n if (StringUtils.isBlank(getIxbrlLocationFromDocGeneratorResponse(response))) {\n Map<String, Object> log...
[ "0.6090216", "0.5855041", "0.57802904", "0.5631025", "0.554986", "0.54557115", "0.5452253", "0.5444277", "0.5435114", "0.5434707", "0.54225254", "0.5408018", "0.54027", "0.5400116", "0.539855", "0.538463", "0.5377496", "0.5373478", "0.53729415", "0.537077", "0.53694916", "0...
0.74636304
0
Service to count points for each event.
public interface ScoresCounterService { /** * Counts points by following formula: A*(B — P)^C for track events (faster * time produces a better score). A, B and C are parameters that vary by * discipline, while P is the performance by the athlete, measured in * seconds (running), meters (throwing), or centimeters (jumping). * <p> * <b>Note:</b> for Running Events. * * @param performance performance by the athlete * @param constantA parameter that vary by discipline, stored in {@link Scores} * @param constantB parameter that vary by discipline, stored in {@link Scores} * @param constantC parameter that vary by discipline, stored in {@link Scores} * @return points, achieved for event */ public int evaluateTrackEvent(double performance, double constantA, double constantB, double constantC); /** * Counts points by following formula: A*(P — B)^C for field events (greater * distance or height produces a better score). A, B and C are parameters * that vary by discipline, while P is the performance by the athlete, * measured in seconds (running), meters (throwing), or centimeters * (jumping). * <p> * <b>Note:</b> for Field Events. * * @param performance performance by the athlete * @param constantA parameter that vary by discipline, stored in {@link Scores} * @param constantB parameter that vary by discipline, stored in {@link Scores} * @param constantC parameter that vary by discipline, stored in {@link Scores} * @return points, achieved for event */ public int evaluateFieldEvent(double performance, double constantA, double constantB, double constantC); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getPointsCount();", "@Override\n public int getPoints(final ShipEvent event) {\n return 0;\n }", "public void countAllPoints() {\n\t\tfor(ClientThread player: players) {\n\t\t\tplayer.points = PointCounter.countPoint(player.clientCards);\n\t\t\tview.writeLog(player.name+\" : \"+player.points);...
[ "0.66365004", "0.6476158", "0.63187295", "0.60753036", "0.60395914", "0.6010906", "0.5958691", "0.5945348", "0.5899152", "0.588152", "0.5856045", "0.5816355", "0.5816355", "0.5816355", "0.5816355", "0.5798217", "0.57912767", "0.5786931", "0.5786931", "0.5779979", "0.5721488",...
0.61417174
3
/ 15: / 16:
protected MessageToMessageEncoder() /* 17: */ { /* 18: 59 */ this.matcher = TypeParameterMatcher.find(this, MessageToMessageEncoder.class, "I"); /* 19: */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int method_2436() {\r\n return 16;\r\n }", "@Override\n\tpublic void challenge16() {\n\n\t}", "void mo1501h();", "void mo1506m();", "@Override\n\tpublic void challenge15() {\n\n\t}", "void mo1507n();", "C1458cs mo7613iS();", "public void mo21783H() {\n }", "static void viteza(int d...
[ "0.56809443", "0.56766284", "0.54426146", "0.54359996", "0.5421556", "0.5420095", "0.5241188", "0.5166213", "0.51513773", "0.5130428", "0.51250124", "0.5122251", "0.5117664", "0.5088014", "0.50832564", "0.50600606", "0.50480413", "0.50034904", "0.49909613", "0.49866334", "0.4...
0.0
-1
/ 20: / 21:
protected MessageToMessageEncoder(Class<? extends I> outboundMessageType) /* 22: */ { /* 23: 68 */ this.matcher = TypeParameterMatcher.get(outboundMessageType); /* 24: */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void kk12() {\n\n\t}", "public int method_2436() {\r\n return 16;\r\n }", "public void mo21877s() {\n }", "@Override\n protected long advanceH(final long k) {\n return 5 * k - 2;\n }", "public static void listing5_16() {\n }", "public void mo2470d() {\n }", "public void mo2...
[ "0.5516782", "0.54777324", "0.5330464", "0.52504843", "0.51647484", "0.5131695", "0.51090324", "0.5078759", "0.50491744", "0.50456434", "0.5038926", "0.503699", "0.50355685", "0.5033273", "0.5026825", "0.50203204", "0.5004681", "0.49945205", "0.49888018", "0.49841502", "0.498...
0.0
-1
/ 25: / 26:
public boolean acceptOutboundMessage(Object msg) /* 27: */ throws Exception /* 28: */ { /* 29: 76 */ return this.matcher.match(msg); /* 30: */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected long advanceH(final long k) {\n return 5 * k - 2;\n }", "public int method_2436() {\r\n return 16;\r\n }", "public void mo2476b() {\n Collections.reverse(mo2625k());\n }", "private void kk12() {\n\n\t}", "public static int i()\r\n/* 25: */ {\r\n/* 26: 48 *...
[ "0.5910141", "0.58280075", "0.5712075", "0.5649909", "0.5626392", "0.55814916", "0.5581042", "0.5537394", "0.55363303", "0.5520437", "0.5487419", "0.5446118", "0.542106", "0.540228", "0.539165", "0.53765297", "0.53495044", "0.53390557", "0.5320572", "0.5317091", "0.5311092", ...
0.0
-1
/ 31: / 32:
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) /* 33: */ throws Exception /* 34: */ { /* 35: 81 */ CodecOutputList out = null; /* 36: */ try /* 37: */ { /* 38: 83 */ if (acceptOutboundMessage(msg)) /* 39: */ { /* 40: 84 */ out = CodecOutputList.newInstance(); /* 41: */ /* 42: 86 */ I cast = msg; /* 43: */ try /* 44: */ { /* 45: 88 */ encode(ctx, cast, out); /* 46: */ } /* 47: */ finally /* 48: */ { /* 49: 90 */ ReferenceCountUtil.release(cast); /* 50: */ } /* 51: 93 */ if (out.isEmpty()) /* 52: */ { /* 53: 94 */ out.recycle(); /* 54: 95 */ out = null; /* 55: */ /* 56: */ /* 57: 98 */ throw new EncoderException(StringUtil.simpleClassName(this) + " must produce at least one message."); /* 58: */ } /* 59: */ } /* 60: */ else /* 61: */ { /* 62:101 */ ctx.write(msg, promise); /* 63: */ } /* 64: */ } /* 65: */ catch (EncoderException e) /* 66: */ { /* 67: */ int sizeMinusOne; /* 68: */ ChannelPromise voidPromise; /* 69: */ boolean isVoidPromise; /* 70: */ int i; /* 71: */ ChannelPromise p; /* 72: */ ChannelPromise p; /* 73:104 */ throw e; /* 74: */ } /* 75: */ catch (Throwable t) /* 76: */ { /* 77:106 */ throw new EncoderException(t); /* 78: */ } /* 79: */ finally /* 80: */ { /* 81:108 */ if (out != null) /* 82: */ { /* 83:109 */ int sizeMinusOne = out.size() - 1; /* 84:110 */ if (sizeMinusOne == 0) /* 85: */ { /* 86:111 */ ctx.write(out.get(0), promise); /* 87: */ } /* 88:112 */ else if (sizeMinusOne > 0) /* 89: */ { /* 90:115 */ ChannelPromise voidPromise = ctx.voidPromise(); /* 91:116 */ boolean isVoidPromise = promise == voidPromise; /* 92:117 */ for (int i = 0; i < sizeMinusOne; i++) /* 93: */ { /* 94: */ ChannelPromise p; /* 95: */ ChannelPromise p; /* 96:119 */ if (isVoidPromise) { /* 97:120 */ p = voidPromise; /* 98: */ } else { /* 99:122 */ p = ctx.newPromise(); /* 100: */ } /* 101:124 */ ctx.write(out.getUnsafe(i), p); /* 102: */ } /* 103:126 */ ctx.write(out.getUnsafe(sizeMinusOne), promise); /* 104: */ } /* 105:128 */ out.recycle(); /* 106: */ } /* 107: */ } /* 108: */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static int m31084a(zzss zzss) {\n int a = zzss.mo32193a(5);\n if (a == 31) {\n return zzss.mo32193a(6) + 32;\n }\n return a;\n }", "long mo25071a(long j);", "private static int m24353e(int i) {\n return i - (i >> 2);\n }", "int pacemodulator() {\n ...
[ "0.629569", "0.5943642", "0.5773581", "0.57137424", "0.57012725", "0.56995636", "0.56460124", "0.5642469", "0.56292444", "0.5625026", "0.5610465", "0.5563695", "0.5522796", "0.54890007", "0.54861486", "0.54630744", "0.54443973", "0.5444327", "0.5440145", "0.54276", "0.5415056...
0.0
-1
/ 109: / 110:
protected abstract void encode(ChannelHandlerContext paramChannelHandlerContext, I paramI, List<Object> paramList) /* 111: */ throws Exception;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int e(String paramString, int paramInt)\r\n/* 628: */ {\r\n/* 629:624 */ int i1 = paramString.length();\r\n/* 630:625 */ int i2 = 0;\r\n/* 631:626 */ int i3 = 0;\r\n/* 632:627 */ int i4 = -1;\r\n/* 633:628 */ int i5 = 0;\r\n/* 634:631 */ for (; i3 < i1; i3++)\r\n/* 635: */ ...
[ "0.6071405", "0.6025148", "0.59611875", "0.5755075", "0.56751204", "0.56313443", "0.56032664", "0.55973536", "0.55664617", "0.5543623", "0.5538157", "0.5533667", "0.55312085", "0.5528864", "0.5525631", "0.55159384", "0.55113906", "0.5503514", "0.5495816", "0.54938036", "0.549...
0.0
-1
Checks if the app has permission to write to device storage If the app does not has permission then the user will be prompted to grant permissions
public static void verifyStoragePermissions(Activity activity) { // Check if we have write permission int permission = ActivityCompat.checkSelfPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE); if (permission != PackageManager.PERMISSION_GRANTED) { // We don't have permission so prompt the user ActivityCompat.requestPermissions( activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean isWriteStorageAllowed() {\n int result = ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);\n\n //If permission is granted returning true\n if (result == PackageManager.PERMISSION_GRANTED)\n return true;\n\n //If permission is...
[ "0.80991775", "0.7869672", "0.7786941", "0.7749702", "0.7586852", "0.75065726", "0.7503322", "0.74788433", "0.74678475", "0.7441225", "0.74309736", "0.74111056", "0.7324478", "0.7324224", "0.7312294", "0.72427225", "0.72267604", "0.7208824", "0.71796334", "0.7168672", "0.7164...
0.678852
62
Implemented by WebSocketClient and WebSocketServer. The methods within are called by WebSocket.
interface WebSocketListener { /** * Called when the socket connection is first established, and the WebSocket * handshake has been recieved. */ public HandshakeBuilder onHandshakeRecievedAsServer( WebSocket conn , Draft draft , Handshakedata request ) throws IOException; public boolean onHandshakeRecievedAsClient( WebSocket conn , Handshakedata request , Handshakedata response ) throws IOException; /** * Called when an entire text frame has been recieved. Do whatever you want * here... * @param conn The <tt>WebSocket</tt> instance this event is occuring on. * @param message The UTF-8 decoded message that was recieved. */ public void onMessage(WebSocket conn, String message); public void onMessage( WebSocket conn , byte[] blob ); /** * Called after <var>onHandshakeRecieved</var> returns <var>true</var>. * Indicates that a complete WebSocket connection has been established, * and we are ready to send/recieve data. * @param conn The <tt>WebSocket</tt> instance this event is occuring on. */ public void onOpen(WebSocket conn); /** * Called after <tt>WebSocket#close</tt> is explicity called, or when the * other end of the WebSocket connection is closed. * @param conn The <tt>WebSocket</tt> instance this event is occuring on. */ public void onClose(WebSocket conn); /** * Triggered on any IOException error. This method should be overridden for custom * implementation of error handling (e.g. when network is not available). * @param ex */ public void onError( Throwable ex ); public void onPong(); public String getFlashPolicy( WebSocket conn); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onMessage(WebSocket webSocket, ByteString bytes) {\n }", "@Override\n public void socket() {\n }", "@Override\r\n\tpublic void onClose(WebSocket conn, int code, String reason, boolean remote) {\n\r\n\t}", "public void onOpen(WebSocket conn);", "public interface W...
[ "0.6975235", "0.6638756", "0.63108206", "0.63046646", "0.63002723", "0.62639606", "0.62413055", "0.6203311", "0.6157224", "0.615247", "0.61411023", "0.6127255", "0.60948324", "0.60595995", "0.6058751", "0.60521334", "0.6037767", "0.6025035", "0.5968632", "0.59545255", "0.5898...
0.6891326
1
Called when the socket connection is first established, and the WebSocket handshake has been recieved.
public HandshakeBuilder onHandshakeRecievedAsServer( WebSocket conn , Draft draft , Handshakedata request ) throws IOException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void onOpen(org.java_websocket.WebSocket conn,\n\t\t\tClientHandshake handshake) {\n\t\t System.out.println(\"有人连接Socket conn:\" + conn);\n\t // l++;\n\t\t logger.info(\"有人连接Socket conn:\" + conn.getRemoteSocketAddress());\n\t\t l++;\n\t\t\n\t}", "@Override\n\t\t\tpublic void onOpen(We...
[ "0.7397172", "0.7376435", "0.7240713", "0.69501203", "0.6888302", "0.68390983", "0.6593622", "0.6557202", "0.6519855", "0.64765215", "0.6468244", "0.6404978", "0.63980204", "0.6259317", "0.6231125", "0.62010145", "0.6146513", "0.6142303", "0.606676", "0.6044988", "0.6030449",...
0.60153717
21