repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
sequence
docstring
stringlengths
3
16k
docstring_tokens
sequence
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/responder/responderaction.java
responderaction.get
public static responderaction get(nitro_service service, String name) throws Exception{ responderaction obj = new responderaction(); obj.set_name(name); responderaction response = (responderaction) obj.get_resource(service); return response; }
java
public static responderaction get(nitro_service service, String name) throws Exception{ responderaction obj = new responderaction(); obj.set_name(name); responderaction response = (responderaction) obj.get_resource(service); return response; }
[ "public", "static", "responderaction", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "responderaction", "obj", "=", "new", "responderaction", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", "responderaction", "response", "=", "(", "responderaction", ")", "obj", ".", "get_resource", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch responderaction resource of given name .
[ "Use", "this", "API", "to", "fetch", "responderaction", "resource", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/responder/responderaction.java#L496-L501
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnsessionpolicy_binding.java
vpnsessionpolicy_binding.get
public static vpnsessionpolicy_binding get(nitro_service service, String name) throws Exception{ vpnsessionpolicy_binding obj = new vpnsessionpolicy_binding(); obj.set_name(name); vpnsessionpolicy_binding response = (vpnsessionpolicy_binding) obj.get_resource(service); return response; }
java
public static vpnsessionpolicy_binding get(nitro_service service, String name) throws Exception{ vpnsessionpolicy_binding obj = new vpnsessionpolicy_binding(); obj.set_name(name); vpnsessionpolicy_binding response = (vpnsessionpolicy_binding) obj.get_resource(service); return response; }
[ "public", "static", "vpnsessionpolicy_binding", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "vpnsessionpolicy_binding", "obj", "=", "new", "vpnsessionpolicy_binding", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", "vpnsessionpolicy_binding", "response", "=", "(", "vpnsessionpolicy_binding", ")", "obj", ".", "get_resource", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch vpnsessionpolicy_binding resource of given name .
[ "Use", "this", "API", "to", "fetch", "vpnsessionpolicy_binding", "resource", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnsessionpolicy_binding.java#L136-L141
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/wi/wisite_translationinternalip_binding.java
wisite_translationinternalip_binding.get
public static wisite_translationinternalip_binding[] get(nitro_service service, String sitepath) throws Exception{ wisite_translationinternalip_binding obj = new wisite_translationinternalip_binding(); obj.set_sitepath(sitepath); wisite_translationinternalip_binding response[] = (wisite_translationinternalip_binding[]) obj.get_resources(service); return response; }
java
public static wisite_translationinternalip_binding[] get(nitro_service service, String sitepath) throws Exception{ wisite_translationinternalip_binding obj = new wisite_translationinternalip_binding(); obj.set_sitepath(sitepath); wisite_translationinternalip_binding response[] = (wisite_translationinternalip_binding[]) obj.get_resources(service); return response; }
[ "public", "static", "wisite_translationinternalip_binding", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "sitepath", ")", "throws", "Exception", "{", "wisite_translationinternalip_binding", "obj", "=", "new", "wisite_translationinternalip_binding", "(", ")", ";", "obj", ".", "set_sitepath", "(", "sitepath", ")", ";", "wisite_translationinternalip_binding", "response", "[", "]", "=", "(", "wisite_translationinternalip_binding", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch wisite_translationinternalip_binding resources of given name .
[ "Use", "this", "API", "to", "fetch", "wisite_translationinternalip_binding", "resources", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/wi/wisite_translationinternalip_binding.java#L270-L275
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/wi/wisite_translationinternalip_binding.java
wisite_translationinternalip_binding.count
public static long count(nitro_service service, String sitepath) throws Exception{ wisite_translationinternalip_binding obj = new wisite_translationinternalip_binding(); obj.set_sitepath(sitepath); options option = new options(); option.set_count(true); wisite_translationinternalip_binding response[] = (wisite_translationinternalip_binding[]) obj.get_resources(service,option); if (response != null) { return response[0].__count; } return 0; }
java
public static long count(nitro_service service, String sitepath) throws Exception{ wisite_translationinternalip_binding obj = new wisite_translationinternalip_binding(); obj.set_sitepath(sitepath); options option = new options(); option.set_count(true); wisite_translationinternalip_binding response[] = (wisite_translationinternalip_binding[]) obj.get_resources(service,option); if (response != null) { return response[0].__count; } return 0; }
[ "public", "static", "long", "count", "(", "nitro_service", "service", ",", "String", "sitepath", ")", "throws", "Exception", "{", "wisite_translationinternalip_binding", "obj", "=", "new", "wisite_translationinternalip_binding", "(", ")", ";", "obj", ".", "set_sitepath", "(", "sitepath", ")", ";", "options", "option", "=", "new", "options", "(", ")", ";", "option", ".", "set_count", "(", "true", ")", ";", "wisite_translationinternalip_binding", "response", "[", "]", "=", "(", "wisite_translationinternalip_binding", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ",", "option", ")", ";", "if", "(", "response", "!=", "null", ")", "{", "return", "response", "[", "0", "]", ".", "__count", ";", "}", "return", "0", ";", "}" ]
Use this API to count wisite_translationinternalip_binding resources configued on NetScaler.
[ "Use", "this", "API", "to", "count", "wisite_translationinternalip_binding", "resources", "configued", "on", "NetScaler", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/wi/wisite_translationinternalip_binding.java#L306-L316
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/authentication/authenticationlocalpolicy_systemglobal_binding.java
authenticationlocalpolicy_systemglobal_binding.get
public static authenticationlocalpolicy_systemglobal_binding[] get(nitro_service service, String name) throws Exception{ authenticationlocalpolicy_systemglobal_binding obj = new authenticationlocalpolicy_systemglobal_binding(); obj.set_name(name); authenticationlocalpolicy_systemglobal_binding response[] = (authenticationlocalpolicy_systemglobal_binding[]) obj.get_resources(service); return response; }
java
public static authenticationlocalpolicy_systemglobal_binding[] get(nitro_service service, String name) throws Exception{ authenticationlocalpolicy_systemglobal_binding obj = new authenticationlocalpolicy_systemglobal_binding(); obj.set_name(name); authenticationlocalpolicy_systemglobal_binding response[] = (authenticationlocalpolicy_systemglobal_binding[]) obj.get_resources(service); return response; }
[ "public", "static", "authenticationlocalpolicy_systemglobal_binding", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "authenticationlocalpolicy_systemglobal_binding", "obj", "=", "new", "authenticationlocalpolicy_systemglobal_binding", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", "authenticationlocalpolicy_systemglobal_binding", "response", "[", "]", "=", "(", "authenticationlocalpolicy_systemglobal_binding", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch authenticationlocalpolicy_systemglobal_binding resources of given name .
[ "Use", "this", "API", "to", "fetch", "authenticationlocalpolicy_systemglobal_binding", "resources", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/authentication/authenticationlocalpolicy_systemglobal_binding.java#L132-L137
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwprofile_xmlwsiurl_binding.java
appfwprofile_xmlwsiurl_binding.get
public static appfwprofile_xmlwsiurl_binding[] get(nitro_service service, String name) throws Exception{ appfwprofile_xmlwsiurl_binding obj = new appfwprofile_xmlwsiurl_binding(); obj.set_name(name); appfwprofile_xmlwsiurl_binding response[] = (appfwprofile_xmlwsiurl_binding[]) obj.get_resources(service); return response; }
java
public static appfwprofile_xmlwsiurl_binding[] get(nitro_service service, String name) throws Exception{ appfwprofile_xmlwsiurl_binding obj = new appfwprofile_xmlwsiurl_binding(); obj.set_name(name); appfwprofile_xmlwsiurl_binding response[] = (appfwprofile_xmlwsiurl_binding[]) obj.get_resources(service); return response; }
[ "public", "static", "appfwprofile_xmlwsiurl_binding", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "appfwprofile_xmlwsiurl_binding", "obj", "=", "new", "appfwprofile_xmlwsiurl_binding", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", "appfwprofile_xmlwsiurl_binding", "response", "[", "]", "=", "(", "appfwprofile_xmlwsiurl_binding", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch appfwprofile_xmlwsiurl_binding resources of given name .
[ "Use", "this", "API", "to", "fetch", "appfwprofile_xmlwsiurl_binding", "resources", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwprofile_xmlwsiurl_binding.java#L217-L222
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/snmp/snmpgroup.java
snmpgroup.add
public static base_response add(nitro_service client, snmpgroup resource) throws Exception { snmpgroup addresource = new snmpgroup(); addresource.name = resource.name; addresource.securitylevel = resource.securitylevel; addresource.readviewname = resource.readviewname; return addresource.add_resource(client); }
java
public static base_response add(nitro_service client, snmpgroup resource) throws Exception { snmpgroup addresource = new snmpgroup(); addresource.name = resource.name; addresource.securitylevel = resource.securitylevel; addresource.readviewname = resource.readviewname; return addresource.add_resource(client); }
[ "public", "static", "base_response", "add", "(", "nitro_service", "client", ",", "snmpgroup", "resource", ")", "throws", "Exception", "{", "snmpgroup", "addresource", "=", "new", "snmpgroup", "(", ")", ";", "addresource", ".", "name", "=", "resource", ".", "name", ";", "addresource", ".", "securitylevel", "=", "resource", ".", "securitylevel", ";", "addresource", ".", "readviewname", "=", "resource", ".", "readviewname", ";", "return", "addresource", ".", "add_resource", "(", "client", ")", ";", "}" ]
Use this API to add snmpgroup.
[ "Use", "this", "API", "to", "add", "snmpgroup", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/snmp/snmpgroup.java#L168-L174
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/snmp/snmpgroup.java
snmpgroup.add
public static base_responses add(nitro_service client, snmpgroup resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { snmpgroup addresources[] = new snmpgroup[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new snmpgroup(); addresources[i].name = resources[i].name; addresources[i].securitylevel = resources[i].securitylevel; addresources[i].readviewname = resources[i].readviewname; } result = add_bulk_request(client, addresources); } return result; }
java
public static base_responses add(nitro_service client, snmpgroup resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { snmpgroup addresources[] = new snmpgroup[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new snmpgroup(); addresources[i].name = resources[i].name; addresources[i].securitylevel = resources[i].securitylevel; addresources[i].readviewname = resources[i].readviewname; } result = add_bulk_request(client, addresources); } return result; }
[ "public", "static", "base_responses", "add", "(", "nitro_service", "client", ",", "snmpgroup", "resources", "[", "]", ")", "throws", "Exception", "{", "base_responses", "result", "=", "null", ";", "if", "(", "resources", "!=", "null", "&&", "resources", ".", "length", ">", "0", ")", "{", "snmpgroup", "addresources", "[", "]", "=", "new", "snmpgroup", "[", "resources", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "resources", ".", "length", ";", "i", "++", ")", "{", "addresources", "[", "i", "]", "=", "new", "snmpgroup", "(", ")", ";", "addresources", "[", "i", "]", ".", "name", "=", "resources", "[", "i", "]", ".", "name", ";", "addresources", "[", "i", "]", ".", "securitylevel", "=", "resources", "[", "i", "]", ".", "securitylevel", ";", "addresources", "[", "i", "]", ".", "readviewname", "=", "resources", "[", "i", "]", ".", "readviewname", ";", "}", "result", "=", "add_bulk_request", "(", "client", ",", "addresources", ")", ";", "}", "return", "result", ";", "}" ]
Use this API to add snmpgroup resources.
[ "Use", "this", "API", "to", "add", "snmpgroup", "resources", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/snmp/snmpgroup.java#L179-L192
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/snmp/snmpgroup.java
snmpgroup.delete
public static base_response delete(nitro_service client, snmpgroup resource) throws Exception { snmpgroup deleteresource = new snmpgroup(); deleteresource.name = resource.name; deleteresource.securitylevel = resource.securitylevel; return deleteresource.delete_resource(client); }
java
public static base_response delete(nitro_service client, snmpgroup resource) throws Exception { snmpgroup deleteresource = new snmpgroup(); deleteresource.name = resource.name; deleteresource.securitylevel = resource.securitylevel; return deleteresource.delete_resource(client); }
[ "public", "static", "base_response", "delete", "(", "nitro_service", "client", ",", "snmpgroup", "resource", ")", "throws", "Exception", "{", "snmpgroup", "deleteresource", "=", "new", "snmpgroup", "(", ")", ";", "deleteresource", ".", "name", "=", "resource", ".", "name", ";", "deleteresource", ".", "securitylevel", "=", "resource", ".", "securitylevel", ";", "return", "deleteresource", ".", "delete_resource", "(", "client", ")", ";", "}" ]
Use this API to delete snmpgroup.
[ "Use", "this", "API", "to", "delete", "snmpgroup", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/snmp/snmpgroup.java#L206-L211
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/snmp/snmpgroup.java
snmpgroup.update
public static base_response update(nitro_service client, snmpgroup resource) throws Exception { snmpgroup updateresource = new snmpgroup(); updateresource.name = resource.name; updateresource.securitylevel = resource.securitylevel; updateresource.readviewname = resource.readviewname; return updateresource.update_resource(client); }
java
public static base_response update(nitro_service client, snmpgroup resource) throws Exception { snmpgroup updateresource = new snmpgroup(); updateresource.name = resource.name; updateresource.securitylevel = resource.securitylevel; updateresource.readviewname = resource.readviewname; return updateresource.update_resource(client); }
[ "public", "static", "base_response", "update", "(", "nitro_service", "client", ",", "snmpgroup", "resource", ")", "throws", "Exception", "{", "snmpgroup", "updateresource", "=", "new", "snmpgroup", "(", ")", ";", "updateresource", ".", "name", "=", "resource", ".", "name", ";", "updateresource", ".", "securitylevel", "=", "resource", ".", "securitylevel", ";", "updateresource", ".", "readviewname", "=", "resource", ".", "readviewname", ";", "return", "updateresource", ".", "update_resource", "(", "client", ")", ";", "}" ]
Use this API to update snmpgroup.
[ "Use", "this", "API", "to", "update", "snmpgroup", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/snmp/snmpgroup.java#L249-L255
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/snmp/snmpgroup.java
snmpgroup.update
public static base_responses update(nitro_service client, snmpgroup resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { snmpgroup updateresources[] = new snmpgroup[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new snmpgroup(); updateresources[i].name = resources[i].name; updateresources[i].securitylevel = resources[i].securitylevel; updateresources[i].readviewname = resources[i].readviewname; } result = update_bulk_request(client, updateresources); } return result; }
java
public static base_responses update(nitro_service client, snmpgroup resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { snmpgroup updateresources[] = new snmpgroup[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new snmpgroup(); updateresources[i].name = resources[i].name; updateresources[i].securitylevel = resources[i].securitylevel; updateresources[i].readviewname = resources[i].readviewname; } result = update_bulk_request(client, updateresources); } return result; }
[ "public", "static", "base_responses", "update", "(", "nitro_service", "client", ",", "snmpgroup", "resources", "[", "]", ")", "throws", "Exception", "{", "base_responses", "result", "=", "null", ";", "if", "(", "resources", "!=", "null", "&&", "resources", ".", "length", ">", "0", ")", "{", "snmpgroup", "updateresources", "[", "]", "=", "new", "snmpgroup", "[", "resources", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "resources", ".", "length", ";", "i", "++", ")", "{", "updateresources", "[", "i", "]", "=", "new", "snmpgroup", "(", ")", ";", "updateresources", "[", "i", "]", ".", "name", "=", "resources", "[", "i", "]", ".", "name", ";", "updateresources", "[", "i", "]", ".", "securitylevel", "=", "resources", "[", "i", "]", ".", "securitylevel", ";", "updateresources", "[", "i", "]", ".", "readviewname", "=", "resources", "[", "i", "]", ".", "readviewname", ";", "}", "result", "=", "update_bulk_request", "(", "client", ",", "updateresources", ")", ";", "}", "return", "result", ";", "}" ]
Use this API to update snmpgroup resources.
[ "Use", "this", "API", "to", "update", "snmpgroup", "resources", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/snmp/snmpgroup.java#L260-L273
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/snmp/snmpgroup.java
snmpgroup.get
public static snmpgroup[] get(nitro_service service) throws Exception{ snmpgroup obj = new snmpgroup(); snmpgroup[] response = (snmpgroup[])obj.get_resources(service); return response; }
java
public static snmpgroup[] get(nitro_service service) throws Exception{ snmpgroup obj = new snmpgroup(); snmpgroup[] response = (snmpgroup[])obj.get_resources(service); return response; }
[ "public", "static", "snmpgroup", "[", "]", "get", "(", "nitro_service", "service", ")", "throws", "Exception", "{", "snmpgroup", "obj", "=", "new", "snmpgroup", "(", ")", ";", "snmpgroup", "[", "]", "response", "=", "(", "snmpgroup", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch all the snmpgroup resources that are configured on netscaler.
[ "Use", "this", "API", "to", "fetch", "all", "the", "snmpgroup", "resources", "that", "are", "configured", "on", "netscaler", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/snmp/snmpgroup.java#L278-L282
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbparameter.java
lbparameter.update
public static base_response update(nitro_service client, lbparameter resource) throws Exception { lbparameter updateresource = new lbparameter(); updateresource.httponlycookieflag = resource.httponlycookieflag; updateresource.consolidatedlconn = resource.consolidatedlconn; updateresource.useportforhashlb = resource.useportforhashlb; updateresource.preferdirectroute = resource.preferdirectroute; updateresource.startuprrfactor = resource.startuprrfactor; updateresource.monitorskipmaxclient = resource.monitorskipmaxclient; updateresource.monitorconnectionclose = resource.monitorconnectionclose; updateresource.vserverspecificmac = resource.vserverspecificmac; return updateresource.update_resource(client); }
java
public static base_response update(nitro_service client, lbparameter resource) throws Exception { lbparameter updateresource = new lbparameter(); updateresource.httponlycookieflag = resource.httponlycookieflag; updateresource.consolidatedlconn = resource.consolidatedlconn; updateresource.useportforhashlb = resource.useportforhashlb; updateresource.preferdirectroute = resource.preferdirectroute; updateresource.startuprrfactor = resource.startuprrfactor; updateresource.monitorskipmaxclient = resource.monitorskipmaxclient; updateresource.monitorconnectionclose = resource.monitorconnectionclose; updateresource.vserverspecificmac = resource.vserverspecificmac; return updateresource.update_resource(client); }
[ "public", "static", "base_response", "update", "(", "nitro_service", "client", ",", "lbparameter", "resource", ")", "throws", "Exception", "{", "lbparameter", "updateresource", "=", "new", "lbparameter", "(", ")", ";", "updateresource", ".", "httponlycookieflag", "=", "resource", ".", "httponlycookieflag", ";", "updateresource", ".", "consolidatedlconn", "=", "resource", ".", "consolidatedlconn", ";", "updateresource", ".", "useportforhashlb", "=", "resource", ".", "useportforhashlb", ";", "updateresource", ".", "preferdirectroute", "=", "resource", ".", "preferdirectroute", ";", "updateresource", ".", "startuprrfactor", "=", "resource", ".", "startuprrfactor", ";", "updateresource", ".", "monitorskipmaxclient", "=", "resource", ".", "monitorskipmaxclient", ";", "updateresource", ".", "monitorconnectionclose", "=", "resource", ".", "monitorconnectionclose", ";", "updateresource", ".", "vserverspecificmac", "=", "resource", ".", "vserverspecificmac", ";", "return", "updateresource", ".", "update_resource", "(", "client", ")", ";", "}" ]
Use this API to update lbparameter.
[ "Use", "this", "API", "to", "update", "lbparameter", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbparameter.java#L275-L286
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbparameter.java
lbparameter.unset
public static base_response unset(nitro_service client, lbparameter resource, String[] args) throws Exception{ lbparameter unsetresource = new lbparameter(); return unsetresource.unset_resource(client,args); }
java
public static base_response unset(nitro_service client, lbparameter resource, String[] args) throws Exception{ lbparameter unsetresource = new lbparameter(); return unsetresource.unset_resource(client,args); }
[ "public", "static", "base_response", "unset", "(", "nitro_service", "client", ",", "lbparameter", "resource", ",", "String", "[", "]", "args", ")", "throws", "Exception", "{", "lbparameter", "unsetresource", "=", "new", "lbparameter", "(", ")", ";", "return", "unsetresource", ".", "unset_resource", "(", "client", ",", "args", ")", ";", "}" ]
Use this API to unset the properties of lbparameter resource. Properties that need to be unset are specified in args array.
[ "Use", "this", "API", "to", "unset", "the", "properties", "of", "lbparameter", "resource", ".", "Properties", "that", "need", "to", "be", "unset", "are", "specified", "in", "args", "array", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbparameter.java#L292-L295
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbparameter.java
lbparameter.get
public static lbparameter get(nitro_service service) throws Exception{ lbparameter obj = new lbparameter(); lbparameter[] response = (lbparameter[])obj.get_resources(service); return response[0]; }
java
public static lbparameter get(nitro_service service) throws Exception{ lbparameter obj = new lbparameter(); lbparameter[] response = (lbparameter[])obj.get_resources(service); return response[0]; }
[ "public", "static", "lbparameter", "get", "(", "nitro_service", "service", ")", "throws", "Exception", "{", "lbparameter", "obj", "=", "new", "lbparameter", "(", ")", ";", "lbparameter", "[", "]", "response", "=", "(", "lbparameter", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", "[", "0", "]", ";", "}" ]
Use this API to fetch all the lbparameter resources that are configured on netscaler.
[ "Use", "this", "API", "to", "fetch", "all", "the", "lbparameter", "resources", "that", "are", "configured", "on", "netscaler", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbparameter.java#L300-L304
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/audit/auditnslogpolicy_lbvserver_binding.java
auditnslogpolicy_lbvserver_binding.get
public static auditnslogpolicy_lbvserver_binding[] get(nitro_service service, String name) throws Exception{ auditnslogpolicy_lbvserver_binding obj = new auditnslogpolicy_lbvserver_binding(); obj.set_name(name); auditnslogpolicy_lbvserver_binding response[] = (auditnslogpolicy_lbvserver_binding[]) obj.get_resources(service); return response; }
java
public static auditnslogpolicy_lbvserver_binding[] get(nitro_service service, String name) throws Exception{ auditnslogpolicy_lbvserver_binding obj = new auditnslogpolicy_lbvserver_binding(); obj.set_name(name); auditnslogpolicy_lbvserver_binding response[] = (auditnslogpolicy_lbvserver_binding[]) obj.get_resources(service); return response; }
[ "public", "static", "auditnslogpolicy_lbvserver_binding", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "auditnslogpolicy_lbvserver_binding", "obj", "=", "new", "auditnslogpolicy_lbvserver_binding", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", "auditnslogpolicy_lbvserver_binding", "response", "[", "]", "=", "(", "auditnslogpolicy_lbvserver_binding", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch auditnslogpolicy_lbvserver_binding resources of given name .
[ "Use", "this", "API", "to", "fetch", "auditnslogpolicy_lbvserver_binding", "resources", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/audit/auditnslogpolicy_lbvserver_binding.java#L132-L137
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policystringmap.java
policystringmap.add
public static base_response add(nitro_service client, policystringmap resource) throws Exception { policystringmap addresource = new policystringmap(); addresource.name = resource.name; addresource.comment = resource.comment; return addresource.add_resource(client); }
java
public static base_response add(nitro_service client, policystringmap resource) throws Exception { policystringmap addresource = new policystringmap(); addresource.name = resource.name; addresource.comment = resource.comment; return addresource.add_resource(client); }
[ "public", "static", "base_response", "add", "(", "nitro_service", "client", ",", "policystringmap", "resource", ")", "throws", "Exception", "{", "policystringmap", "addresource", "=", "new", "policystringmap", "(", ")", ";", "addresource", ".", "name", "=", "resource", ".", "name", ";", "addresource", ".", "comment", "=", "resource", ".", "comment", ";", "return", "addresource", ".", "add_resource", "(", "client", ")", ";", "}" ]
Use this API to add policystringmap.
[ "Use", "this", "API", "to", "add", "policystringmap", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policystringmap.java#L112-L117
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policystringmap.java
policystringmap.update
public static base_response update(nitro_service client, policystringmap resource) throws Exception { policystringmap updateresource = new policystringmap(); updateresource.name = resource.name; updateresource.comment = resource.comment; return updateresource.update_resource(client); }
java
public static base_response update(nitro_service client, policystringmap resource) throws Exception { policystringmap updateresource = new policystringmap(); updateresource.name = resource.name; updateresource.comment = resource.comment; return updateresource.update_resource(client); }
[ "public", "static", "base_response", "update", "(", "nitro_service", "client", ",", "policystringmap", "resource", ")", "throws", "Exception", "{", "policystringmap", "updateresource", "=", "new", "policystringmap", "(", ")", ";", "updateresource", ".", "name", "=", "resource", ".", "name", ";", "updateresource", ".", "comment", "=", "resource", ".", "comment", ";", "return", "updateresource", ".", "update_resource", "(", "client", ")", ";", "}" ]
Use this API to update policystringmap.
[ "Use", "this", "API", "to", "update", "policystringmap", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policystringmap.java#L189-L194
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policystringmap.java
policystringmap.get
public static policystringmap[] get(nitro_service service) throws Exception{ policystringmap obj = new policystringmap(); policystringmap[] response = (policystringmap[])obj.get_resources(service); return response; }
java
public static policystringmap[] get(nitro_service service) throws Exception{ policystringmap obj = new policystringmap(); policystringmap[] response = (policystringmap[])obj.get_resources(service); return response; }
[ "public", "static", "policystringmap", "[", "]", "get", "(", "nitro_service", "service", ")", "throws", "Exception", "{", "policystringmap", "obj", "=", "new", "policystringmap", "(", ")", ";", "policystringmap", "[", "]", "response", "=", "(", "policystringmap", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch all the policystringmap resources that are configured on netscaler.
[ "Use", "this", "API", "to", "fetch", "all", "the", "policystringmap", "resources", "that", "are", "configured", "on", "netscaler", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policystringmap.java#L260-L264
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policystringmap.java
policystringmap.get
public static policystringmap get(nitro_service service, String name) throws Exception{ policystringmap obj = new policystringmap(); obj.set_name(name); policystringmap response = (policystringmap) obj.get_resource(service); return response; }
java
public static policystringmap get(nitro_service service, String name) throws Exception{ policystringmap obj = new policystringmap(); obj.set_name(name); policystringmap response = (policystringmap) obj.get_resource(service); return response; }
[ "public", "static", "policystringmap", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "policystringmap", "obj", "=", "new", "policystringmap", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", "policystringmap", "response", "=", "(", "policystringmap", ")", "obj", ".", "get_resource", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch policystringmap resource of given name .
[ "Use", "this", "API", "to", "fetch", "policystringmap", "resource", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policystringmap.java#L276-L281
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/rewrite/rewritepolicylabel_policybinding_binding.java
rewritepolicylabel_policybinding_binding.get
public static rewritepolicylabel_policybinding_binding[] get(nitro_service service, String labelname) throws Exception{ rewritepolicylabel_policybinding_binding obj = new rewritepolicylabel_policybinding_binding(); obj.set_labelname(labelname); rewritepolicylabel_policybinding_binding response[] = (rewritepolicylabel_policybinding_binding[]) obj.get_resources(service); return response; }
java
public static rewritepolicylabel_policybinding_binding[] get(nitro_service service, String labelname) throws Exception{ rewritepolicylabel_policybinding_binding obj = new rewritepolicylabel_policybinding_binding(); obj.set_labelname(labelname); rewritepolicylabel_policybinding_binding response[] = (rewritepolicylabel_policybinding_binding[]) obj.get_resources(service); return response; }
[ "public", "static", "rewritepolicylabel_policybinding_binding", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "labelname", ")", "throws", "Exception", "{", "rewritepolicylabel_policybinding_binding", "obj", "=", "new", "rewritepolicylabel_policybinding_binding", "(", ")", ";", "obj", ".", "set_labelname", "(", "labelname", ")", ";", "rewritepolicylabel_policybinding_binding", "response", "[", "]", "=", "(", "rewritepolicylabel_policybinding_binding", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch rewritepolicylabel_policybinding_binding resources of given name .
[ "Use", "this", "API", "to", "fetch", "rewritepolicylabel_policybinding_binding", "resources", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/rewrite/rewritepolicylabel_policybinding_binding.java#L233-L238
train
meertensinstituut/mtas
src/main/java/mtas/codec/MtasFieldsConsumer.java
MtasFieldsConsumer.registerPrefix
private void registerPrefix(String field, String prefix, IndexOutput outPrefix) throws IOException { if (!prefixReferenceIndex.containsKey(field)) { prefixReferenceIndex.put(field, new HashMap<String, Long>()); prefixIdIndex.put(field, new HashMap<String, Integer>()); } if (!prefixReferenceIndex.get(field).containsKey(prefix)) { int id = 1 + prefixReferenceIndex.get(field).size(); prefixReferenceIndex.get(field).put(prefix, outPrefix.getFilePointer()); prefixIdIndex.get(field).put(prefix, id); outPrefix.writeString(prefix); } }
java
private void registerPrefix(String field, String prefix, IndexOutput outPrefix) throws IOException { if (!prefixReferenceIndex.containsKey(field)) { prefixReferenceIndex.put(field, new HashMap<String, Long>()); prefixIdIndex.put(field, new HashMap<String, Integer>()); } if (!prefixReferenceIndex.get(field).containsKey(prefix)) { int id = 1 + prefixReferenceIndex.get(field).size(); prefixReferenceIndex.get(field).put(prefix, outPrefix.getFilePointer()); prefixIdIndex.get(field).put(prefix, id); outPrefix.writeString(prefix); } }
[ "private", "void", "registerPrefix", "(", "String", "field", ",", "String", "prefix", ",", "IndexOutput", "outPrefix", ")", "throws", "IOException", "{", "if", "(", "!", "prefixReferenceIndex", ".", "containsKey", "(", "field", ")", ")", "{", "prefixReferenceIndex", ".", "put", "(", "field", ",", "new", "HashMap", "<", "String", ",", "Long", ">", "(", ")", ")", ";", "prefixIdIndex", ".", "put", "(", "field", ",", "new", "HashMap", "<", "String", ",", "Integer", ">", "(", ")", ")", ";", "}", "if", "(", "!", "prefixReferenceIndex", ".", "get", "(", "field", ")", ".", "containsKey", "(", "prefix", ")", ")", "{", "int", "id", "=", "1", "+", "prefixReferenceIndex", ".", "get", "(", "field", ")", ".", "size", "(", ")", ";", "prefixReferenceIndex", ".", "get", "(", "field", ")", ".", "put", "(", "prefix", ",", "outPrefix", ".", "getFilePointer", "(", ")", ")", ";", "prefixIdIndex", ".", "get", "(", "field", ")", ".", "put", "(", "prefix", ",", "id", ")", ";", "outPrefix", ".", "writeString", "(", "prefix", ")", ";", "}", "}" ]
Register prefix. @param field the field @param prefix the prefix @param outPrefix the out prefix @throws IOException Signals that an I/O exception has occurred.
[ "Register", "prefix", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/codec/MtasFieldsConsumer.java#L482-L494
train
meertensinstituut/mtas
src/main/java/mtas/codec/MtasFieldsConsumer.java
MtasFieldsConsumer.registerPrefixIntersection
private void registerPrefixIntersection(String field, String prefix, int start, int end, HashMap<String, HashSet<Integer>> docFieldAdministration) { if (!intersectingPrefixes.containsKey(field)) { intersectingPrefixes.put(field, new HashSet<String>()); } else if (intersectingPrefixes.get(field).contains(prefix)) { return; } HashSet<Integer> docFieldPrefixAdministration; if (!docFieldAdministration.containsKey(prefix)) { docFieldPrefixAdministration = new HashSet<>(); docFieldAdministration.put(prefix, docFieldPrefixAdministration); } else { docFieldPrefixAdministration = docFieldAdministration.get(prefix); // check for (int p = start; p <= end; p++) { if (docFieldPrefixAdministration.contains(p)) { intersectingPrefixes.get(field).add(prefix); docFieldAdministration.remove(prefix); return; } } } // update for (int p = start; p <= end; p++) { docFieldPrefixAdministration.add(p); } }
java
private void registerPrefixIntersection(String field, String prefix, int start, int end, HashMap<String, HashSet<Integer>> docFieldAdministration) { if (!intersectingPrefixes.containsKey(field)) { intersectingPrefixes.put(field, new HashSet<String>()); } else if (intersectingPrefixes.get(field).contains(prefix)) { return; } HashSet<Integer> docFieldPrefixAdministration; if (!docFieldAdministration.containsKey(prefix)) { docFieldPrefixAdministration = new HashSet<>(); docFieldAdministration.put(prefix, docFieldPrefixAdministration); } else { docFieldPrefixAdministration = docFieldAdministration.get(prefix); // check for (int p = start; p <= end; p++) { if (docFieldPrefixAdministration.contains(p)) { intersectingPrefixes.get(field).add(prefix); docFieldAdministration.remove(prefix); return; } } } // update for (int p = start; p <= end; p++) { docFieldPrefixAdministration.add(p); } }
[ "private", "void", "registerPrefixIntersection", "(", "String", "field", ",", "String", "prefix", ",", "int", "start", ",", "int", "end", ",", "HashMap", "<", "String", ",", "HashSet", "<", "Integer", ">", ">", "docFieldAdministration", ")", "{", "if", "(", "!", "intersectingPrefixes", ".", "containsKey", "(", "field", ")", ")", "{", "intersectingPrefixes", ".", "put", "(", "field", ",", "new", "HashSet", "<", "String", ">", "(", ")", ")", ";", "}", "else", "if", "(", "intersectingPrefixes", ".", "get", "(", "field", ")", ".", "contains", "(", "prefix", ")", ")", "{", "return", ";", "}", "HashSet", "<", "Integer", ">", "docFieldPrefixAdministration", ";", "if", "(", "!", "docFieldAdministration", ".", "containsKey", "(", "prefix", ")", ")", "{", "docFieldPrefixAdministration", "=", "new", "HashSet", "<>", "(", ")", ";", "docFieldAdministration", ".", "put", "(", "prefix", ",", "docFieldPrefixAdministration", ")", ";", "}", "else", "{", "docFieldPrefixAdministration", "=", "docFieldAdministration", ".", "get", "(", "prefix", ")", ";", "// check", "for", "(", "int", "p", "=", "start", ";", "p", "<=", "end", ";", "p", "++", ")", "{", "if", "(", "docFieldPrefixAdministration", ".", "contains", "(", "p", ")", ")", "{", "intersectingPrefixes", ".", "get", "(", "field", ")", ".", "add", "(", "prefix", ")", ";", "docFieldAdministration", ".", "remove", "(", "prefix", ")", ";", "return", ";", "}", "}", "}", "// update", "for", "(", "int", "p", "=", "start", ";", "p", "<=", "end", ";", "p", "++", ")", "{", "docFieldPrefixAdministration", ".", "add", "(", "p", ")", ";", "}", "}" ]
Register prefix intersection. @param field the field @param prefix the prefix @param start the start @param end the end @param docFieldAdministration the doc field administration
[ "Register", "prefix", "intersection", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/codec/MtasFieldsConsumer.java#L510-L537
train
meertensinstituut/mtas
src/main/java/mtas/codec/MtasFieldsConsumer.java
MtasFieldsConsumer.registerPrefixStatsSinglePositionValue
public void registerPrefixStatsSinglePositionValue(String field, String prefix, IndexOutput outPrefix) throws IOException { initPrefixStatsField(field); registerPrefix(field, prefix, outPrefix); if (!multiplePositionPrefix.get(field).contains(prefix)) { singlePositionPrefix.get(field).add(prefix); } }
java
public void registerPrefixStatsSinglePositionValue(String field, String prefix, IndexOutput outPrefix) throws IOException { initPrefixStatsField(field); registerPrefix(field, prefix, outPrefix); if (!multiplePositionPrefix.get(field).contains(prefix)) { singlePositionPrefix.get(field).add(prefix); } }
[ "public", "void", "registerPrefixStatsSinglePositionValue", "(", "String", "field", ",", "String", "prefix", ",", "IndexOutput", "outPrefix", ")", "throws", "IOException", "{", "initPrefixStatsField", "(", "field", ")", ";", "registerPrefix", "(", "field", ",", "prefix", ",", "outPrefix", ")", ";", "if", "(", "!", "multiplePositionPrefix", ".", "get", "(", "field", ")", ".", "contains", "(", "prefix", ")", ")", "{", "singlePositionPrefix", ".", "get", "(", "field", ")", ".", "add", "(", "prefix", ")", ";", "}", "}" ]
Register prefix stats single position value. @param field the field @param prefix the prefix @param outPrefix the out prefix @throws IOException Signals that an I/O exception has occurred.
[ "Register", "prefix", "stats", "single", "position", "value", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/codec/MtasFieldsConsumer.java#L551-L558
train
meertensinstituut/mtas
src/main/java/mtas/codec/MtasFieldsConsumer.java
MtasFieldsConsumer.registerPrefixStatsRangePositionValue
public void registerPrefixStatsRangePositionValue(String field, String prefix, IndexOutput outPrefix) throws IOException { initPrefixStatsField(field); registerPrefix(field, prefix, outPrefix); singlePositionPrefix.get(field).remove(prefix); multiplePositionPrefix.get(field).add(prefix); }
java
public void registerPrefixStatsRangePositionValue(String field, String prefix, IndexOutput outPrefix) throws IOException { initPrefixStatsField(field); registerPrefix(field, prefix, outPrefix); singlePositionPrefix.get(field).remove(prefix); multiplePositionPrefix.get(field).add(prefix); }
[ "public", "void", "registerPrefixStatsRangePositionValue", "(", "String", "field", ",", "String", "prefix", ",", "IndexOutput", "outPrefix", ")", "throws", "IOException", "{", "initPrefixStatsField", "(", "field", ")", ";", "registerPrefix", "(", "field", ",", "prefix", ",", "outPrefix", ")", ";", "singlePositionPrefix", ".", "get", "(", "field", ")", ".", "remove", "(", "prefix", ")", ";", "multiplePositionPrefix", ".", "get", "(", "field", ")", ".", "add", "(", "prefix", ")", ";", "}" ]
Register prefix stats range position value. @param field the field @param prefix the prefix @param outPrefix the out prefix @throws IOException Signals that an I/O exception has occurred.
[ "Register", "prefix", "stats", "range", "position", "value", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/codec/MtasFieldsConsumer.java#L572-L578
train
meertensinstituut/mtas
src/main/java/mtas/codec/MtasFieldsConsumer.java
MtasFieldsConsumer.initPrefixStatsField
private void initPrefixStatsField(String field) { if (!singlePositionPrefix.containsKey(field)) { singlePositionPrefix.put(field, new HashSet<String>()); } if (!multiplePositionPrefix.containsKey(field)) { multiplePositionPrefix.put(field, new HashSet<String>()); } if (!setPositionPrefix.containsKey(field)) { setPositionPrefix.put(field, new HashSet<String>()); } }
java
private void initPrefixStatsField(String field) { if (!singlePositionPrefix.containsKey(field)) { singlePositionPrefix.put(field, new HashSet<String>()); } if (!multiplePositionPrefix.containsKey(field)) { multiplePositionPrefix.put(field, new HashSet<String>()); } if (!setPositionPrefix.containsKey(field)) { setPositionPrefix.put(field, new HashSet<String>()); } }
[ "private", "void", "initPrefixStatsField", "(", "String", "field", ")", "{", "if", "(", "!", "singlePositionPrefix", ".", "containsKey", "(", "field", ")", ")", "{", "singlePositionPrefix", ".", "put", "(", "field", ",", "new", "HashSet", "<", "String", ">", "(", ")", ")", ";", "}", "if", "(", "!", "multiplePositionPrefix", ".", "containsKey", "(", "field", ")", ")", "{", "multiplePositionPrefix", ".", "put", "(", "field", ",", "new", "HashSet", "<", "String", ">", "(", ")", ")", ";", "}", "if", "(", "!", "setPositionPrefix", ".", "containsKey", "(", "field", ")", ")", "{", "setPositionPrefix", ".", "put", "(", "field", ",", "new", "HashSet", "<", "String", ">", "(", ")", ")", ";", "}", "}" ]
Inits the prefix stats field. @param field the field
[ "Inits", "the", "prefix", "stats", "field", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/codec/MtasFieldsConsumer.java#L607-L617
train
meertensinstituut/mtas
src/main/java/mtas/codec/MtasFieldsConsumer.java
MtasFieldsConsumer.getPrefixStatsSinglePositionPrefixAttribute
public String getPrefixStatsSinglePositionPrefixAttribute(String field) { return String.join(MtasToken.DELIMITER, singlePositionPrefix.get(field)); }
java
public String getPrefixStatsSinglePositionPrefixAttribute(String field) { return String.join(MtasToken.DELIMITER, singlePositionPrefix.get(field)); }
[ "public", "String", "getPrefixStatsSinglePositionPrefixAttribute", "(", "String", "field", ")", "{", "return", "String", ".", "join", "(", "MtasToken", ".", "DELIMITER", ",", "singlePositionPrefix", ".", "get", "(", "field", ")", ")", ";", "}" ]
Gets the prefix stats single position prefix attribute. @param field the field @return the prefix stats single position prefix attribute
[ "Gets", "the", "prefix", "stats", "single", "position", "prefix", "attribute", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/codec/MtasFieldsConsumer.java#L626-L628
train
meertensinstituut/mtas
src/main/java/mtas/codec/MtasFieldsConsumer.java
MtasFieldsConsumer.getPrefixStatsMultiplePositionPrefixAttribute
public String getPrefixStatsMultiplePositionPrefixAttribute(String field) { return String.join(MtasToken.DELIMITER, multiplePositionPrefix.get(field)); }
java
public String getPrefixStatsMultiplePositionPrefixAttribute(String field) { return String.join(MtasToken.DELIMITER, multiplePositionPrefix.get(field)); }
[ "public", "String", "getPrefixStatsMultiplePositionPrefixAttribute", "(", "String", "field", ")", "{", "return", "String", ".", "join", "(", "MtasToken", ".", "DELIMITER", ",", "multiplePositionPrefix", ".", "get", "(", "field", ")", ")", ";", "}" ]
Gets the prefix stats multiple position prefix attribute. @param field the field @return the prefix stats multiple position prefix attribute
[ "Gets", "the", "prefix", "stats", "multiple", "position", "prefix", "attribute", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/codec/MtasFieldsConsumer.java#L637-L639
train
meertensinstituut/mtas
src/main/java/mtas/codec/MtasFieldsConsumer.java
MtasFieldsConsumer.getPrefixStatsSetPositionPrefixAttribute
public String getPrefixStatsSetPositionPrefixAttribute(String field) { return String.join(MtasToken.DELIMITER, setPositionPrefix.get(field)); }
java
public String getPrefixStatsSetPositionPrefixAttribute(String field) { return String.join(MtasToken.DELIMITER, setPositionPrefix.get(field)); }
[ "public", "String", "getPrefixStatsSetPositionPrefixAttribute", "(", "String", "field", ")", "{", "return", "String", ".", "join", "(", "MtasToken", ".", "DELIMITER", ",", "setPositionPrefix", ".", "get", "(", "field", ")", ")", ";", "}" ]
Gets the prefix stats set position prefix attribute. @param field the field @return the prefix stats set position prefix attribute
[ "Gets", "the", "prefix", "stats", "set", "position", "prefix", "attribute", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/codec/MtasFieldsConsumer.java#L648-L650
train
meertensinstituut/mtas
src/main/java/mtas/codec/MtasFieldsConsumer.java
MtasFieldsConsumer.getPrefixStatsIntersectionPrefixAttribute
public String getPrefixStatsIntersectionPrefixAttribute(String field) { if (intersectingPrefixes.containsKey(field)) { return String.join(MtasToken.DELIMITER, intersectingPrefixes.get(field)); } else { return ""; } }
java
public String getPrefixStatsIntersectionPrefixAttribute(String field) { if (intersectingPrefixes.containsKey(field)) { return String.join(MtasToken.DELIMITER, intersectingPrefixes.get(field)); } else { return ""; } }
[ "public", "String", "getPrefixStatsIntersectionPrefixAttribute", "(", "String", "field", ")", "{", "if", "(", "intersectingPrefixes", ".", "containsKey", "(", "field", ")", ")", "{", "return", "String", ".", "join", "(", "MtasToken", ".", "DELIMITER", ",", "intersectingPrefixes", ".", "get", "(", "field", ")", ")", ";", "}", "else", "{", "return", "\"\"", ";", "}", "}" ]
Gets the prefix stats intersection prefix attribute. @param field the field @return the prefix stats intersection prefix attribute
[ "Gets", "the", "prefix", "stats", "intersection", "prefix", "attribute", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/codec/MtasFieldsConsumer.java#L659-L665
train
meertensinstituut/mtas
src/main/java/mtas/codec/MtasFieldsConsumer.java
MtasFieldsConsumer.tokenStatsAdd
private void tokenStatsAdd(int min, int max) { tokenStatsNumber++; if (tokenStatsMinPos == null) { tokenStatsMinPos = min; } else { tokenStatsMinPos = Math.min(tokenStatsMinPos, min); } if (tokenStatsMaxPos == null) { tokenStatsMaxPos = max; } else { tokenStatsMaxPos = Math.max(tokenStatsMaxPos, max); } }
java
private void tokenStatsAdd(int min, int max) { tokenStatsNumber++; if (tokenStatsMinPos == null) { tokenStatsMinPos = min; } else { tokenStatsMinPos = Math.min(tokenStatsMinPos, min); } if (tokenStatsMaxPos == null) { tokenStatsMaxPos = max; } else { tokenStatsMaxPos = Math.max(tokenStatsMaxPos, max); } }
[ "private", "void", "tokenStatsAdd", "(", "int", "min", ",", "int", "max", ")", "{", "tokenStatsNumber", "++", ";", "if", "(", "tokenStatsMinPos", "==", "null", ")", "{", "tokenStatsMinPos", "=", "min", ";", "}", "else", "{", "tokenStatsMinPos", "=", "Math", ".", "min", "(", "tokenStatsMinPos", ",", "min", ")", ";", "}", "if", "(", "tokenStatsMaxPos", "==", "null", ")", "{", "tokenStatsMaxPos", "=", "max", ";", "}", "else", "{", "tokenStatsMaxPos", "=", "Math", ".", "max", "(", "tokenStatsMaxPos", ",", "max", ")", ";", "}", "}" ]
Token stats add. @param min the min @param max the max
[ "Token", "stats", "add", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/codec/MtasFieldsConsumer.java#L1672-L1684
train
meertensinstituut/mtas
src/main/java/mtas/codec/MtasFieldsConsumer.java
MtasFieldsConsumer.copyObjectAndUpdateStats
private void copyObjectAndUpdateStats(int id, IndexInput in, Long inRef, IndexOutput out) throws IOException { int mtasId; int objectFlags; // read in.seek(inRef); mtasId = in.readVInt(); assert id == mtasId : "wrong id detected while copying object"; objectFlags = in.readVInt(); out.writeVInt(mtasId); out.writeVInt(objectFlags); if ((objectFlags & MtasCodecPostingsFormat.MTAS_OBJECT_HAS_PARENT) == MtasCodecPostingsFormat.MTAS_OBJECT_HAS_PARENT) { out.writeVInt(in.readVInt()); } if ((objectFlags & MtasCodecPostingsFormat.MTAS_OBJECT_HAS_POSITION_RANGE) == MtasCodecPostingsFormat.MTAS_OBJECT_HAS_POSITION_RANGE) { int minPos = in.readVInt(); int maxPos = in.readVInt(); out.writeVInt(minPos); out.writeVInt(maxPos); tokenStatsAdd(minPos, maxPos); } else if ((objectFlags & MtasCodecPostingsFormat.MTAS_OBJECT_HAS_POSITION_SET) == MtasCodecPostingsFormat.MTAS_OBJECT_HAS_POSITION_SET) { int size = in.readVInt(); out.writeVInt(size); SortedSet<Integer> list = new TreeSet<>(); int previousPosition = 0; for (int t = 0; t < size; t++) { int pos = in.readVInt(); out.writeVInt(pos); previousPosition = (pos + previousPosition); list.add(previousPosition); } assert list.size() == size : "duplicate positions in set are not allowed"; tokenStatsAdd(list.first(), list.last()); } else { int pos = in.readVInt(); out.writeVInt(pos); tokenStatsAdd(pos, pos); } if ((objectFlags & MtasCodecPostingsFormat.MTAS_OBJECT_HAS_OFFSET) == MtasCodecPostingsFormat.MTAS_OBJECT_HAS_OFFSET) { out.writeVInt(in.readVInt()); out.writeVInt(in.readVInt()); } if ((objectFlags & MtasCodecPostingsFormat.MTAS_OBJECT_HAS_REALOFFSET) == MtasCodecPostingsFormat.MTAS_OBJECT_HAS_REALOFFSET) { out.writeVInt(in.readVInt()); out.writeVInt(in.readVInt()); } if ((objectFlags & MtasCodecPostingsFormat.MTAS_OBJECT_HAS_PAYLOAD) == MtasCodecPostingsFormat.MTAS_OBJECT_HAS_PAYLOAD) { int length = in.readVInt(); out.writeVInt(length); byte[] payload = new byte[length]; in.readBytes(payload, 0, length); out.writeBytes(payload, payload.length); } out.writeVLong(in.readVLong()); }
java
private void copyObjectAndUpdateStats(int id, IndexInput in, Long inRef, IndexOutput out) throws IOException { int mtasId; int objectFlags; // read in.seek(inRef); mtasId = in.readVInt(); assert id == mtasId : "wrong id detected while copying object"; objectFlags = in.readVInt(); out.writeVInt(mtasId); out.writeVInt(objectFlags); if ((objectFlags & MtasCodecPostingsFormat.MTAS_OBJECT_HAS_PARENT) == MtasCodecPostingsFormat.MTAS_OBJECT_HAS_PARENT) { out.writeVInt(in.readVInt()); } if ((objectFlags & MtasCodecPostingsFormat.MTAS_OBJECT_HAS_POSITION_RANGE) == MtasCodecPostingsFormat.MTAS_OBJECT_HAS_POSITION_RANGE) { int minPos = in.readVInt(); int maxPos = in.readVInt(); out.writeVInt(minPos); out.writeVInt(maxPos); tokenStatsAdd(minPos, maxPos); } else if ((objectFlags & MtasCodecPostingsFormat.MTAS_OBJECT_HAS_POSITION_SET) == MtasCodecPostingsFormat.MTAS_OBJECT_HAS_POSITION_SET) { int size = in.readVInt(); out.writeVInt(size); SortedSet<Integer> list = new TreeSet<>(); int previousPosition = 0; for (int t = 0; t < size; t++) { int pos = in.readVInt(); out.writeVInt(pos); previousPosition = (pos + previousPosition); list.add(previousPosition); } assert list.size() == size : "duplicate positions in set are not allowed"; tokenStatsAdd(list.first(), list.last()); } else { int pos = in.readVInt(); out.writeVInt(pos); tokenStatsAdd(pos, pos); } if ((objectFlags & MtasCodecPostingsFormat.MTAS_OBJECT_HAS_OFFSET) == MtasCodecPostingsFormat.MTAS_OBJECT_HAS_OFFSET) { out.writeVInt(in.readVInt()); out.writeVInt(in.readVInt()); } if ((objectFlags & MtasCodecPostingsFormat.MTAS_OBJECT_HAS_REALOFFSET) == MtasCodecPostingsFormat.MTAS_OBJECT_HAS_REALOFFSET) { out.writeVInt(in.readVInt()); out.writeVInt(in.readVInt()); } if ((objectFlags & MtasCodecPostingsFormat.MTAS_OBJECT_HAS_PAYLOAD) == MtasCodecPostingsFormat.MTAS_OBJECT_HAS_PAYLOAD) { int length = in.readVInt(); out.writeVInt(length); byte[] payload = new byte[length]; in.readBytes(payload, 0, length); out.writeBytes(payload, payload.length); } out.writeVLong(in.readVLong()); }
[ "private", "void", "copyObjectAndUpdateStats", "(", "int", "id", ",", "IndexInput", "in", ",", "Long", "inRef", ",", "IndexOutput", "out", ")", "throws", "IOException", "{", "int", "mtasId", ";", "int", "objectFlags", ";", "// read", "in", ".", "seek", "(", "inRef", ")", ";", "mtasId", "=", "in", ".", "readVInt", "(", ")", ";", "assert", "id", "==", "mtasId", ":", "\"wrong id detected while copying object\"", ";", "objectFlags", "=", "in", ".", "readVInt", "(", ")", ";", "out", ".", "writeVInt", "(", "mtasId", ")", ";", "out", ".", "writeVInt", "(", "objectFlags", ")", ";", "if", "(", "(", "objectFlags", "&", "MtasCodecPostingsFormat", ".", "MTAS_OBJECT_HAS_PARENT", ")", "==", "MtasCodecPostingsFormat", ".", "MTAS_OBJECT_HAS_PARENT", ")", "{", "out", ".", "writeVInt", "(", "in", ".", "readVInt", "(", ")", ")", ";", "}", "if", "(", "(", "objectFlags", "&", "MtasCodecPostingsFormat", ".", "MTAS_OBJECT_HAS_POSITION_RANGE", ")", "==", "MtasCodecPostingsFormat", ".", "MTAS_OBJECT_HAS_POSITION_RANGE", ")", "{", "int", "minPos", "=", "in", ".", "readVInt", "(", ")", ";", "int", "maxPos", "=", "in", ".", "readVInt", "(", ")", ";", "out", ".", "writeVInt", "(", "minPos", ")", ";", "out", ".", "writeVInt", "(", "maxPos", ")", ";", "tokenStatsAdd", "(", "minPos", ",", "maxPos", ")", ";", "}", "else", "if", "(", "(", "objectFlags", "&", "MtasCodecPostingsFormat", ".", "MTAS_OBJECT_HAS_POSITION_SET", ")", "==", "MtasCodecPostingsFormat", ".", "MTAS_OBJECT_HAS_POSITION_SET", ")", "{", "int", "size", "=", "in", ".", "readVInt", "(", ")", ";", "out", ".", "writeVInt", "(", "size", ")", ";", "SortedSet", "<", "Integer", ">", "list", "=", "new", "TreeSet", "<>", "(", ")", ";", "int", "previousPosition", "=", "0", ";", "for", "(", "int", "t", "=", "0", ";", "t", "<", "size", ";", "t", "++", ")", "{", "int", "pos", "=", "in", ".", "readVInt", "(", ")", ";", "out", ".", "writeVInt", "(", "pos", ")", ";", "previousPosition", "=", "(", "pos", "+", "previousPosition", ")", ";", "list", ".", "add", "(", "previousPosition", ")", ";", "}", "assert", "list", ".", "size", "(", ")", "==", "size", ":", "\"duplicate positions in set are not allowed\"", ";", "tokenStatsAdd", "(", "list", ".", "first", "(", ")", ",", "list", ".", "last", "(", ")", ")", ";", "}", "else", "{", "int", "pos", "=", "in", ".", "readVInt", "(", ")", ";", "out", ".", "writeVInt", "(", "pos", ")", ";", "tokenStatsAdd", "(", "pos", ",", "pos", ")", ";", "}", "if", "(", "(", "objectFlags", "&", "MtasCodecPostingsFormat", ".", "MTAS_OBJECT_HAS_OFFSET", ")", "==", "MtasCodecPostingsFormat", ".", "MTAS_OBJECT_HAS_OFFSET", ")", "{", "out", ".", "writeVInt", "(", "in", ".", "readVInt", "(", ")", ")", ";", "out", ".", "writeVInt", "(", "in", ".", "readVInt", "(", ")", ")", ";", "}", "if", "(", "(", "objectFlags", "&", "MtasCodecPostingsFormat", ".", "MTAS_OBJECT_HAS_REALOFFSET", ")", "==", "MtasCodecPostingsFormat", ".", "MTAS_OBJECT_HAS_REALOFFSET", ")", "{", "out", ".", "writeVInt", "(", "in", ".", "readVInt", "(", ")", ")", ";", "out", ".", "writeVInt", "(", "in", ".", "readVInt", "(", ")", ")", ";", "}", "if", "(", "(", "objectFlags", "&", "MtasCodecPostingsFormat", ".", "MTAS_OBJECT_HAS_PAYLOAD", ")", "==", "MtasCodecPostingsFormat", ".", "MTAS_OBJECT_HAS_PAYLOAD", ")", "{", "int", "length", "=", "in", ".", "readVInt", "(", ")", ";", "out", ".", "writeVInt", "(", "length", ")", ";", "byte", "[", "]", "payload", "=", "new", "byte", "[", "length", "]", ";", "in", ".", "readBytes", "(", "payload", ",", "0", ",", "length", ")", ";", "out", ".", "writeBytes", "(", "payload", ",", "payload", ".", "length", ")", ";", "}", "out", ".", "writeVLong", "(", "in", ".", "readVLong", "(", ")", ")", ";", "}" ]
Copy object and update stats. @param id the id @param in the in @param inRef the in ref @param out the out @throws IOException Signals that an I/O exception has occurred.
[ "Copy", "object", "and", "update", "stats", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/codec/MtasFieldsConsumer.java#L1700-L1760
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/aaa/aaagroup_vpnintranetapplication_binding.java
aaagroup_vpnintranetapplication_binding.get
public static aaagroup_vpnintranetapplication_binding[] get(nitro_service service, String groupname) throws Exception{ aaagroup_vpnintranetapplication_binding obj = new aaagroup_vpnintranetapplication_binding(); obj.set_groupname(groupname); aaagroup_vpnintranetapplication_binding response[] = (aaagroup_vpnintranetapplication_binding[]) obj.get_resources(service); return response; }
java
public static aaagroup_vpnintranetapplication_binding[] get(nitro_service service, String groupname) throws Exception{ aaagroup_vpnintranetapplication_binding obj = new aaagroup_vpnintranetapplication_binding(); obj.set_groupname(groupname); aaagroup_vpnintranetapplication_binding response[] = (aaagroup_vpnintranetapplication_binding[]) obj.get_resources(service); return response; }
[ "public", "static", "aaagroup_vpnintranetapplication_binding", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "groupname", ")", "throws", "Exception", "{", "aaagroup_vpnintranetapplication_binding", "obj", "=", "new", "aaagroup_vpnintranetapplication_binding", "(", ")", ";", "obj", ".", "set_groupname", "(", "groupname", ")", ";", "aaagroup_vpnintranetapplication_binding", "response", "[", "]", "=", "(", "aaagroup_vpnintranetapplication_binding", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch aaagroup_vpnintranetapplication_binding resources of given name .
[ "Use", "this", "API", "to", "fetch", "aaagroup_vpnintranetapplication_binding", "resources", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/aaa/aaagroup_vpnintranetapplication_binding.java#L246-L251
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/trees/MemoryTreebank.java
MemoryTreebank.load
public void load(Reader r, String id) { try { // could throw an IO exception? TreeReader tr = treeReaderFactory().newTreeReader(r); int sentIndex = 0; for (Tree pt; (pt = tr.readTree()) != null; ) { if (pt.label() instanceof HasIndex) { // so we can trace where this tree came from HasIndex hi = (HasIndex) pt.label(); if (id != null) { hi.setDocID(id); } hi.setSentIndex(sentIndex); } parseTrees.add(pt); sentIndex++; } } catch (IOException e) { System.err.println("load IO Exception: " + e); } }
java
public void load(Reader r, String id) { try { // could throw an IO exception? TreeReader tr = treeReaderFactory().newTreeReader(r); int sentIndex = 0; for (Tree pt; (pt = tr.readTree()) != null; ) { if (pt.label() instanceof HasIndex) { // so we can trace where this tree came from HasIndex hi = (HasIndex) pt.label(); if (id != null) { hi.setDocID(id); } hi.setSentIndex(sentIndex); } parseTrees.add(pt); sentIndex++; } } catch (IOException e) { System.err.println("load IO Exception: " + e); } }
[ "public", "void", "load", "(", "Reader", "r", ",", "String", "id", ")", "{", "try", "{", "// could throw an IO exception?\r", "TreeReader", "tr", "=", "treeReaderFactory", "(", ")", ".", "newTreeReader", "(", "r", ")", ";", "int", "sentIndex", "=", "0", ";", "for", "(", "Tree", "pt", ";", "(", "pt", "=", "tr", ".", "readTree", "(", ")", ")", "!=", "null", ";", ")", "{", "if", "(", "pt", ".", "label", "(", ")", "instanceof", "HasIndex", ")", "{", "// so we can trace where this tree came from\r", "HasIndex", "hi", "=", "(", "HasIndex", ")", "pt", ".", "label", "(", ")", ";", "if", "(", "id", "!=", "null", ")", "{", "hi", ".", "setDocID", "(", "id", ")", ";", "}", "hi", ".", "setSentIndex", "(", "sentIndex", ")", ";", "}", "parseTrees", ".", "add", "(", "pt", ")", ";", "sentIndex", "++", ";", "}", "}", "catch", "(", "IOException", "e", ")", "{", "System", ".", "err", ".", "println", "(", "\"load IO Exception: \"", "+", "e", ")", ";", "}", "}" ]
Load a collection of parse trees from a Reader. Each tree may optionally be encased in parens to allow for Penn Treebank style trees. @param r The reader to read trees from. (If you want it buffered, you should already have buffered it!) @param id An ID for where these files come from (arbitrary, but something like a filename. Can be <code>null</code> for none.
[ "Load", "a", "collection", "of", "parse", "trees", "from", "a", "Reader", ".", "Each", "tree", "may", "optionally", "be", "encased", "in", "parens", "to", "allow", "for", "Penn", "Treebank", "style", "trees", "." ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/trees/MemoryTreebank.java#L333-L352
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/trees/MemoryTreebank.java
MemoryTreebank.apply
@Override public void apply(TreeVisitor tp) { for (int i = 0, size = parseTrees.size(); i < size; i++) { tp.visitTree(parseTrees.get(i)); } // or could do as Iterator but slower // Iterator iter = parseTrees.iterator(); // while (iter.hasNext()) { // tp.visitTree((Tree) iter.next()); // } }
java
@Override public void apply(TreeVisitor tp) { for (int i = 0, size = parseTrees.size(); i < size; i++) { tp.visitTree(parseTrees.get(i)); } // or could do as Iterator but slower // Iterator iter = parseTrees.iterator(); // while (iter.hasNext()) { // tp.visitTree((Tree) iter.next()); // } }
[ "@", "Override", "public", "void", "apply", "(", "TreeVisitor", "tp", ")", "{", "for", "(", "int", "i", "=", "0", ",", "size", "=", "parseTrees", ".", "size", "(", ")", ";", "i", "<", "size", ";", "i", "++", ")", "{", "tp", ".", "visitTree", "(", "parseTrees", ".", "get", "(", "i", ")", ")", ";", "}", "// or could do as Iterator but slower\r", "// Iterator iter = parseTrees.iterator();\r", "// while (iter.hasNext()) {\r", "// tp.visitTree((Tree) iter.next());\r", "// }\r", "}" ]
Apply the TreeVisitor tp to all trees in the Treebank. @param tp A class that implements the TreeVisitor interface
[ "Apply", "the", "TreeVisitor", "tp", "to", "all", "trees", "in", "the", "Treebank", "." ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/trees/MemoryTreebank.java#L374-L384
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/aaa/aaauser_vpnurl_binding.java
aaauser_vpnurl_binding.get
public static aaauser_vpnurl_binding[] get(nitro_service service, String username) throws Exception{ aaauser_vpnurl_binding obj = new aaauser_vpnurl_binding(); obj.set_username(username); aaauser_vpnurl_binding response[] = (aaauser_vpnurl_binding[]) obj.get_resources(service); return response; }
java
public static aaauser_vpnurl_binding[] get(nitro_service service, String username) throws Exception{ aaauser_vpnurl_binding obj = new aaauser_vpnurl_binding(); obj.set_username(username); aaauser_vpnurl_binding response[] = (aaauser_vpnurl_binding[]) obj.get_resources(service); return response; }
[ "public", "static", "aaauser_vpnurl_binding", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "username", ")", "throws", "Exception", "{", "aaauser_vpnurl_binding", "obj", "=", "new", "aaauser_vpnurl_binding", "(", ")", ";", "obj", ".", "set_username", "(", "username", ")", ";", "aaauser_vpnurl_binding", "response", "[", "]", "=", "(", "aaauser_vpnurl_binding", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch aaauser_vpnurl_binding resources of given name .
[ "Use", "this", "API", "to", "fetch", "aaauser_vpnurl_binding", "resources", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/aaa/aaauser_vpnurl_binding.java#L240-L245
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/network/iptunnel.java
iptunnel.add
public static base_response add(nitro_service client, iptunnel resource) throws Exception { iptunnel addresource = new iptunnel(); addresource.name = resource.name; addresource.remote = resource.remote; addresource.remotesubnetmask = resource.remotesubnetmask; addresource.local = resource.local; addresource.protocol = resource.protocol; addresource.ipsecprofilename = resource.ipsecprofilename; return addresource.add_resource(client); }
java
public static base_response add(nitro_service client, iptunnel resource) throws Exception { iptunnel addresource = new iptunnel(); addresource.name = resource.name; addresource.remote = resource.remote; addresource.remotesubnetmask = resource.remotesubnetmask; addresource.local = resource.local; addresource.protocol = resource.protocol; addresource.ipsecprofilename = resource.ipsecprofilename; return addresource.add_resource(client); }
[ "public", "static", "base_response", "add", "(", "nitro_service", "client", ",", "iptunnel", "resource", ")", "throws", "Exception", "{", "iptunnel", "addresource", "=", "new", "iptunnel", "(", ")", ";", "addresource", ".", "name", "=", "resource", ".", "name", ";", "addresource", ".", "remote", "=", "resource", ".", "remote", ";", "addresource", ".", "remotesubnetmask", "=", "resource", ".", "remotesubnetmask", ";", "addresource", ".", "local", "=", "resource", ".", "local", ";", "addresource", ".", "protocol", "=", "resource", ".", "protocol", ";", "addresource", ".", "ipsecprofilename", "=", "resource", ".", "ipsecprofilename", ";", "return", "addresource", ".", "add_resource", "(", "client", ")", ";", "}" ]
Use this API to add iptunnel.
[ "Use", "this", "API", "to", "add", "iptunnel", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/iptunnel.java#L261-L270
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/network/iptunnel.java
iptunnel.add
public static base_responses add(nitro_service client, iptunnel resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { iptunnel addresources[] = new iptunnel[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new iptunnel(); addresources[i].name = resources[i].name; addresources[i].remote = resources[i].remote; addresources[i].remotesubnetmask = resources[i].remotesubnetmask; addresources[i].local = resources[i].local; addresources[i].protocol = resources[i].protocol; addresources[i].ipsecprofilename = resources[i].ipsecprofilename; } result = add_bulk_request(client, addresources); } return result; }
java
public static base_responses add(nitro_service client, iptunnel resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { iptunnel addresources[] = new iptunnel[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new iptunnel(); addresources[i].name = resources[i].name; addresources[i].remote = resources[i].remote; addresources[i].remotesubnetmask = resources[i].remotesubnetmask; addresources[i].local = resources[i].local; addresources[i].protocol = resources[i].protocol; addresources[i].ipsecprofilename = resources[i].ipsecprofilename; } result = add_bulk_request(client, addresources); } return result; }
[ "public", "static", "base_responses", "add", "(", "nitro_service", "client", ",", "iptunnel", "resources", "[", "]", ")", "throws", "Exception", "{", "base_responses", "result", "=", "null", ";", "if", "(", "resources", "!=", "null", "&&", "resources", ".", "length", ">", "0", ")", "{", "iptunnel", "addresources", "[", "]", "=", "new", "iptunnel", "[", "resources", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "resources", ".", "length", ";", "i", "++", ")", "{", "addresources", "[", "i", "]", "=", "new", "iptunnel", "(", ")", ";", "addresources", "[", "i", "]", ".", "name", "=", "resources", "[", "i", "]", ".", "name", ";", "addresources", "[", "i", "]", ".", "remote", "=", "resources", "[", "i", "]", ".", "remote", ";", "addresources", "[", "i", "]", ".", "remotesubnetmask", "=", "resources", "[", "i", "]", ".", "remotesubnetmask", ";", "addresources", "[", "i", "]", ".", "local", "=", "resources", "[", "i", "]", ".", "local", ";", "addresources", "[", "i", "]", ".", "protocol", "=", "resources", "[", "i", "]", ".", "protocol", ";", "addresources", "[", "i", "]", ".", "ipsecprofilename", "=", "resources", "[", "i", "]", ".", "ipsecprofilename", ";", "}", "result", "=", "add_bulk_request", "(", "client", ",", "addresources", ")", ";", "}", "return", "result", ";", "}" ]
Use this API to add iptunnel resources.
[ "Use", "this", "API", "to", "add", "iptunnel", "resources", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/iptunnel.java#L275-L291
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/network/iptunnel.java
iptunnel.get
public static iptunnel[] get(nitro_service service) throws Exception{ iptunnel obj = new iptunnel(); iptunnel[] response = (iptunnel[])obj.get_resources(service); return response; }
java
public static iptunnel[] get(nitro_service service) throws Exception{ iptunnel obj = new iptunnel(); iptunnel[] response = (iptunnel[])obj.get_resources(service); return response; }
[ "public", "static", "iptunnel", "[", "]", "get", "(", "nitro_service", "service", ")", "throws", "Exception", "{", "iptunnel", "obj", "=", "new", "iptunnel", "(", ")", ";", "iptunnel", "[", "]", "response", "=", "(", "iptunnel", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch all the iptunnel resources that are configured on netscaler.
[ "Use", "this", "API", "to", "fetch", "all", "the", "iptunnel", "resources", "that", "are", "configured", "on", "netscaler", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/iptunnel.java#L346-L350
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/network/iptunnel.java
iptunnel.get
public static iptunnel[] get(nitro_service service, iptunnel_args args) throws Exception{ iptunnel obj = new iptunnel(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); iptunnel[] response = (iptunnel[])obj.get_resources(service, option); return response; }
java
public static iptunnel[] get(nitro_service service, iptunnel_args args) throws Exception{ iptunnel obj = new iptunnel(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); iptunnel[] response = (iptunnel[])obj.get_resources(service, option); return response; }
[ "public", "static", "iptunnel", "[", "]", "get", "(", "nitro_service", "service", ",", "iptunnel_args", "args", ")", "throws", "Exception", "{", "iptunnel", "obj", "=", "new", "iptunnel", "(", ")", ";", "options", "option", "=", "new", "options", "(", ")", ";", "option", ".", "set_args", "(", "nitro_util", ".", "object_to_string_withoutquotes", "(", "args", ")", ")", ";", "iptunnel", "[", "]", "response", "=", "(", "iptunnel", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ",", "option", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch all the iptunnel resources that are configured on netscaler. This uses iptunnel_args which is a way to provide additional arguments while fetching the resources.
[ "Use", "this", "API", "to", "fetch", "all", "the", "iptunnel", "resources", "that", "are", "configured", "on", "netscaler", ".", "This", "uses", "iptunnel_args", "which", "is", "a", "way", "to", "provide", "additional", "arguments", "while", "fetching", "the", "resources", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/iptunnel.java#L363-L369
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/network/iptunnel.java
iptunnel.get
public static iptunnel get(nitro_service service, String name) throws Exception{ iptunnel obj = new iptunnel(); obj.set_name(name); iptunnel response = (iptunnel) obj.get_resource(service); return response; }
java
public static iptunnel get(nitro_service service, String name) throws Exception{ iptunnel obj = new iptunnel(); obj.set_name(name); iptunnel response = (iptunnel) obj.get_resource(service); return response; }
[ "public", "static", "iptunnel", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "iptunnel", "obj", "=", "new", "iptunnel", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", "iptunnel", "response", "=", "(", "iptunnel", ")", "obj", ".", "get_resource", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch iptunnel resource of given name .
[ "Use", "this", "API", "to", "fetch", "iptunnel", "resource", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/iptunnel.java#L374-L379
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnscnamerec.java
dnscnamerec.add
public static base_response add(nitro_service client, dnscnamerec resource) throws Exception { dnscnamerec addresource = new dnscnamerec(); addresource.aliasname = resource.aliasname; addresource.canonicalname = resource.canonicalname; addresource.ttl = resource.ttl; return addresource.add_resource(client); }
java
public static base_response add(nitro_service client, dnscnamerec resource) throws Exception { dnscnamerec addresource = new dnscnamerec(); addresource.aliasname = resource.aliasname; addresource.canonicalname = resource.canonicalname; addresource.ttl = resource.ttl; return addresource.add_resource(client); }
[ "public", "static", "base_response", "add", "(", "nitro_service", "client", ",", "dnscnamerec", "resource", ")", "throws", "Exception", "{", "dnscnamerec", "addresource", "=", "new", "dnscnamerec", "(", ")", ";", "addresource", ".", "aliasname", "=", "resource", ".", "aliasname", ";", "addresource", ".", "canonicalname", "=", "resource", ".", "canonicalname", ";", "addresource", ".", "ttl", "=", "resource", ".", "ttl", ";", "return", "addresource", ".", "add_resource", "(", "client", ")", ";", "}" ]
Use this API to add dnscnamerec.
[ "Use", "this", "API", "to", "add", "dnscnamerec", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnscnamerec.java#L188-L194
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnscnamerec.java
dnscnamerec.add
public static base_responses add(nitro_service client, dnscnamerec resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { dnscnamerec addresources[] = new dnscnamerec[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new dnscnamerec(); addresources[i].aliasname = resources[i].aliasname; addresources[i].canonicalname = resources[i].canonicalname; addresources[i].ttl = resources[i].ttl; } result = add_bulk_request(client, addresources); } return result; }
java
public static base_responses add(nitro_service client, dnscnamerec resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { dnscnamerec addresources[] = new dnscnamerec[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new dnscnamerec(); addresources[i].aliasname = resources[i].aliasname; addresources[i].canonicalname = resources[i].canonicalname; addresources[i].ttl = resources[i].ttl; } result = add_bulk_request(client, addresources); } return result; }
[ "public", "static", "base_responses", "add", "(", "nitro_service", "client", ",", "dnscnamerec", "resources", "[", "]", ")", "throws", "Exception", "{", "base_responses", "result", "=", "null", ";", "if", "(", "resources", "!=", "null", "&&", "resources", ".", "length", ">", "0", ")", "{", "dnscnamerec", "addresources", "[", "]", "=", "new", "dnscnamerec", "[", "resources", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "resources", ".", "length", ";", "i", "++", ")", "{", "addresources", "[", "i", "]", "=", "new", "dnscnamerec", "(", ")", ";", "addresources", "[", "i", "]", ".", "aliasname", "=", "resources", "[", "i", "]", ".", "aliasname", ";", "addresources", "[", "i", "]", ".", "canonicalname", "=", "resources", "[", "i", "]", ".", "canonicalname", ";", "addresources", "[", "i", "]", ".", "ttl", "=", "resources", "[", "i", "]", ".", "ttl", ";", "}", "result", "=", "add_bulk_request", "(", "client", ",", "addresources", ")", ";", "}", "return", "result", ";", "}" ]
Use this API to add dnscnamerec resources.
[ "Use", "this", "API", "to", "add", "dnscnamerec", "resources", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnscnamerec.java#L199-L212
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnscnamerec.java
dnscnamerec.delete
public static base_response delete(nitro_service client, String aliasname) throws Exception { dnscnamerec deleteresource = new dnscnamerec(); deleteresource.aliasname = aliasname; return deleteresource.delete_resource(client); }
java
public static base_response delete(nitro_service client, String aliasname) throws Exception { dnscnamerec deleteresource = new dnscnamerec(); deleteresource.aliasname = aliasname; return deleteresource.delete_resource(client); }
[ "public", "static", "base_response", "delete", "(", "nitro_service", "client", ",", "String", "aliasname", ")", "throws", "Exception", "{", "dnscnamerec", "deleteresource", "=", "new", "dnscnamerec", "(", ")", ";", "deleteresource", ".", "aliasname", "=", "aliasname", ";", "return", "deleteresource", ".", "delete_resource", "(", "client", ")", ";", "}" ]
Use this API to delete dnscnamerec of given name.
[ "Use", "this", "API", "to", "delete", "dnscnamerec", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnscnamerec.java#L217-L221
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnscnamerec.java
dnscnamerec.delete
public static base_responses delete(nitro_service client, String aliasname[]) throws Exception { base_responses result = null; if (aliasname != null && aliasname.length > 0) { dnscnamerec deleteresources[] = new dnscnamerec[aliasname.length]; for (int i=0;i<aliasname.length;i++){ deleteresources[i] = new dnscnamerec(); deleteresources[i].aliasname = aliasname[i]; } result = delete_bulk_request(client, deleteresources); } return result; }
java
public static base_responses delete(nitro_service client, String aliasname[]) throws Exception { base_responses result = null; if (aliasname != null && aliasname.length > 0) { dnscnamerec deleteresources[] = new dnscnamerec[aliasname.length]; for (int i=0;i<aliasname.length;i++){ deleteresources[i] = new dnscnamerec(); deleteresources[i].aliasname = aliasname[i]; } result = delete_bulk_request(client, deleteresources); } return result; }
[ "public", "static", "base_responses", "delete", "(", "nitro_service", "client", ",", "String", "aliasname", "[", "]", ")", "throws", "Exception", "{", "base_responses", "result", "=", "null", ";", "if", "(", "aliasname", "!=", "null", "&&", "aliasname", ".", "length", ">", "0", ")", "{", "dnscnamerec", "deleteresources", "[", "]", "=", "new", "dnscnamerec", "[", "aliasname", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "aliasname", ".", "length", ";", "i", "++", ")", "{", "deleteresources", "[", "i", "]", "=", "new", "dnscnamerec", "(", ")", ";", "deleteresources", "[", "i", "]", ".", "aliasname", "=", "aliasname", "[", "i", "]", ";", "}", "result", "=", "delete_bulk_request", "(", "client", ",", "deleteresources", ")", ";", "}", "return", "result", ";", "}" ]
Use this API to delete dnscnamerec resources of given names.
[ "Use", "this", "API", "to", "delete", "dnscnamerec", "resources", "of", "given", "names", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnscnamerec.java#L235-L246
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnscnamerec.java
dnscnamerec.get
public static dnscnamerec[] get(nitro_service service) throws Exception{ dnscnamerec obj = new dnscnamerec(); dnscnamerec[] response = (dnscnamerec[])obj.get_resources(service); return response; }
java
public static dnscnamerec[] get(nitro_service service) throws Exception{ dnscnamerec obj = new dnscnamerec(); dnscnamerec[] response = (dnscnamerec[])obj.get_resources(service); return response; }
[ "public", "static", "dnscnamerec", "[", "]", "get", "(", "nitro_service", "service", ")", "throws", "Exception", "{", "dnscnamerec", "obj", "=", "new", "dnscnamerec", "(", ")", ";", "dnscnamerec", "[", "]", "response", "=", "(", "dnscnamerec", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch all the dnscnamerec resources that are configured on netscaler.
[ "Use", "this", "API", "to", "fetch", "all", "the", "dnscnamerec", "resources", "that", "are", "configured", "on", "netscaler", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnscnamerec.java#L267-L271
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnscnamerec.java
dnscnamerec.get
public static dnscnamerec[] get(nitro_service service, dnscnamerec_args args) throws Exception{ dnscnamerec obj = new dnscnamerec(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); dnscnamerec[] response = (dnscnamerec[])obj.get_resources(service, option); return response; }
java
public static dnscnamerec[] get(nitro_service service, dnscnamerec_args args) throws Exception{ dnscnamerec obj = new dnscnamerec(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); dnscnamerec[] response = (dnscnamerec[])obj.get_resources(service, option); return response; }
[ "public", "static", "dnscnamerec", "[", "]", "get", "(", "nitro_service", "service", ",", "dnscnamerec_args", "args", ")", "throws", "Exception", "{", "dnscnamerec", "obj", "=", "new", "dnscnamerec", "(", ")", ";", "options", "option", "=", "new", "options", "(", ")", ";", "option", ".", "set_args", "(", "nitro_util", ".", "object_to_string_withoutquotes", "(", "args", ")", ")", ";", "dnscnamerec", "[", "]", "response", "=", "(", "dnscnamerec", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ",", "option", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch all the dnscnamerec resources that are configured on netscaler. This uses dnscnamerec_args which is a way to provide additional arguments while fetching the resources.
[ "Use", "this", "API", "to", "fetch", "all", "the", "dnscnamerec", "resources", "that", "are", "configured", "on", "netscaler", ".", "This", "uses", "dnscnamerec_args", "which", "is", "a", "way", "to", "provide", "additional", "arguments", "while", "fetching", "the", "resources", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnscnamerec.java#L284-L290
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnscnamerec.java
dnscnamerec.get
public static dnscnamerec get(nitro_service service, String aliasname) throws Exception{ dnscnamerec obj = new dnscnamerec(); obj.set_aliasname(aliasname); dnscnamerec response = (dnscnamerec) obj.get_resource(service); return response; }
java
public static dnscnamerec get(nitro_service service, String aliasname) throws Exception{ dnscnamerec obj = new dnscnamerec(); obj.set_aliasname(aliasname); dnscnamerec response = (dnscnamerec) obj.get_resource(service); return response; }
[ "public", "static", "dnscnamerec", "get", "(", "nitro_service", "service", ",", "String", "aliasname", ")", "throws", "Exception", "{", "dnscnamerec", "obj", "=", "new", "dnscnamerec", "(", ")", ";", "obj", ".", "set_aliasname", "(", "aliasname", ")", ";", "dnscnamerec", "response", "=", "(", "dnscnamerec", ")", "obj", ".", "get_resource", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch dnscnamerec resource of given name .
[ "Use", "this", "API", "to", "fetch", "dnscnamerec", "resource", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnscnamerec.java#L295-L300
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnscnamerec.java
dnscnamerec.get
public static dnscnamerec[] get(nitro_service service, String aliasname[]) throws Exception{ if (aliasname !=null && aliasname.length>0) { dnscnamerec response[] = new dnscnamerec[aliasname.length]; dnscnamerec obj[] = new dnscnamerec[aliasname.length]; for (int i=0;i<aliasname.length;i++) { obj[i] = new dnscnamerec(); obj[i].set_aliasname(aliasname[i]); response[i] = (dnscnamerec) obj[i].get_resource(service); } return response; } return null; }
java
public static dnscnamerec[] get(nitro_service service, String aliasname[]) throws Exception{ if (aliasname !=null && aliasname.length>0) { dnscnamerec response[] = new dnscnamerec[aliasname.length]; dnscnamerec obj[] = new dnscnamerec[aliasname.length]; for (int i=0;i<aliasname.length;i++) { obj[i] = new dnscnamerec(); obj[i].set_aliasname(aliasname[i]); response[i] = (dnscnamerec) obj[i].get_resource(service); } return response; } return null; }
[ "public", "static", "dnscnamerec", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "aliasname", "[", "]", ")", "throws", "Exception", "{", "if", "(", "aliasname", "!=", "null", "&&", "aliasname", ".", "length", ">", "0", ")", "{", "dnscnamerec", "response", "[", "]", "=", "new", "dnscnamerec", "[", "aliasname", ".", "length", "]", ";", "dnscnamerec", "obj", "[", "]", "=", "new", "dnscnamerec", "[", "aliasname", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "aliasname", ".", "length", ";", "i", "++", ")", "{", "obj", "[", "i", "]", "=", "new", "dnscnamerec", "(", ")", ";", "obj", "[", "i", "]", ".", "set_aliasname", "(", "aliasname", "[", "i", "]", ")", ";", "response", "[", "i", "]", "=", "(", "dnscnamerec", ")", "obj", "[", "i", "]", ".", "get_resource", "(", "service", ")", ";", "}", "return", "response", ";", "}", "return", "null", ";", "}" ]
Use this API to fetch dnscnamerec resources of given names .
[ "Use", "this", "API", "to", "fetch", "dnscnamerec", "resources", "of", "given", "names", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnscnamerec.java#L305-L317
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/stat/ns/nsacl_stats.java
nsacl_stats.get
public static nsacl_stats[] get(nitro_service service) throws Exception{ nsacl_stats obj = new nsacl_stats(); nsacl_stats[] response = (nsacl_stats[])obj.stat_resources(service); return response; }
java
public static nsacl_stats[] get(nitro_service service) throws Exception{ nsacl_stats obj = new nsacl_stats(); nsacl_stats[] response = (nsacl_stats[])obj.stat_resources(service); return response; }
[ "public", "static", "nsacl_stats", "[", "]", "get", "(", "nitro_service", "service", ")", "throws", "Exception", "{", "nsacl_stats", "obj", "=", "new", "nsacl_stats", "(", ")", ";", "nsacl_stats", "[", "]", "response", "=", "(", "nsacl_stats", "[", "]", ")", "obj", ".", "stat_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch the statistics of all nsacl_stats resources that are configured on netscaler.
[ "Use", "this", "API", "to", "fetch", "the", "statistics", "of", "all", "nsacl_stats", "resources", "that", "are", "configured", "on", "netscaler", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/ns/nsacl_stats.java#L261-L265
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/stat/ns/nsacl_stats.java
nsacl_stats.get
public static nsacl_stats get(nitro_service service, String aclname) throws Exception{ nsacl_stats obj = new nsacl_stats(); obj.set_aclname(aclname); nsacl_stats response = (nsacl_stats) obj.stat_resource(service); return response; }
java
public static nsacl_stats get(nitro_service service, String aclname) throws Exception{ nsacl_stats obj = new nsacl_stats(); obj.set_aclname(aclname); nsacl_stats response = (nsacl_stats) obj.stat_resource(service); return response; }
[ "public", "static", "nsacl_stats", "get", "(", "nitro_service", "service", ",", "String", "aclname", ")", "throws", "Exception", "{", "nsacl_stats", "obj", "=", "new", "nsacl_stats", "(", ")", ";", "obj", ".", "set_aclname", "(", "aclname", ")", ";", "nsacl_stats", "response", "=", "(", "nsacl_stats", ")", "obj", ".", "stat_resource", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch statistics of nsacl_stats resource of given name .
[ "Use", "this", "API", "to", "fetch", "statistics", "of", "nsacl_stats", "resource", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/ns/nsacl_stats.java#L279-L284
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbvserver_dnspolicy64_binding.java
lbvserver_dnspolicy64_binding.get
public static lbvserver_dnspolicy64_binding[] get(nitro_service service, String name) throws Exception{ lbvserver_dnspolicy64_binding obj = new lbvserver_dnspolicy64_binding(); obj.set_name(name); lbvserver_dnspolicy64_binding response[] = (lbvserver_dnspolicy64_binding[]) obj.get_resources(service); return response; }
java
public static lbvserver_dnspolicy64_binding[] get(nitro_service service, String name) throws Exception{ lbvserver_dnspolicy64_binding obj = new lbvserver_dnspolicy64_binding(); obj.set_name(name); lbvserver_dnspolicy64_binding response[] = (lbvserver_dnspolicy64_binding[]) obj.get_resources(service); return response; }
[ "public", "static", "lbvserver_dnspolicy64_binding", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "lbvserver_dnspolicy64_binding", "obj", "=", "new", "lbvserver_dnspolicy64_binding", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", "lbvserver_dnspolicy64_binding", "response", "[", "]", "=", "(", "lbvserver_dnspolicy64_binding", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch lbvserver_dnspolicy64_binding resources of given name .
[ "Use", "this", "API", "to", "fetch", "lbvserver_dnspolicy64_binding", "resources", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbvserver_dnspolicy64_binding.java#L312-L317
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/cr/crvserver_filterpolicy_binding.java
crvserver_filterpolicy_binding.get
public static crvserver_filterpolicy_binding[] get(nitro_service service, String name) throws Exception{ crvserver_filterpolicy_binding obj = new crvserver_filterpolicy_binding(); obj.set_name(name); crvserver_filterpolicy_binding response[] = (crvserver_filterpolicy_binding[]) obj.get_resources(service); return response; }
java
public static crvserver_filterpolicy_binding[] get(nitro_service service, String name) throws Exception{ crvserver_filterpolicy_binding obj = new crvserver_filterpolicy_binding(); obj.set_name(name); crvserver_filterpolicy_binding response[] = (crvserver_filterpolicy_binding[]) obj.get_resources(service); return response; }
[ "public", "static", "crvserver_filterpolicy_binding", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "crvserver_filterpolicy_binding", "obj", "=", "new", "crvserver_filterpolicy_binding", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", "crvserver_filterpolicy_binding", "response", "[", "]", "=", "(", "crvserver_filterpolicy_binding", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch crvserver_filterpolicy_binding resources of given name .
[ "Use", "this", "API", "to", "fetch", "crvserver_filterpolicy_binding", "resources", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/cr/crvserver_filterpolicy_binding.java#L205-L210
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslpolicy_sslpolicylabel_binding.java
sslpolicy_sslpolicylabel_binding.get
public static sslpolicy_sslpolicylabel_binding[] get(nitro_service service, String name) throws Exception{ sslpolicy_sslpolicylabel_binding obj = new sslpolicy_sslpolicylabel_binding(); obj.set_name(name); sslpolicy_sslpolicylabel_binding response[] = (sslpolicy_sslpolicylabel_binding[]) obj.get_resources(service); return response; }
java
public static sslpolicy_sslpolicylabel_binding[] get(nitro_service service, String name) throws Exception{ sslpolicy_sslpolicylabel_binding obj = new sslpolicy_sslpolicylabel_binding(); obj.set_name(name); sslpolicy_sslpolicylabel_binding response[] = (sslpolicy_sslpolicylabel_binding[]) obj.get_resources(service); return response; }
[ "public", "static", "sslpolicy_sslpolicylabel_binding", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "sslpolicy_sslpolicylabel_binding", "obj", "=", "new", "sslpolicy_sslpolicylabel_binding", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", "sslpolicy_sslpolicylabel_binding", "response", "[", "]", "=", "(", "sslpolicy_sslpolicylabel_binding", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch sslpolicy_sslpolicylabel_binding resources of given name .
[ "Use", "this", "API", "to", "fetch", "sslpolicy_sslpolicylabel_binding", "resources", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslpolicy_sslpolicylabel_binding.java#L162-L167
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/util/ArrayHeap.java
ArrayHeap.extractMin
public E extractMin() { if (isEmpty()) { throw new NoSuchElementException(); } HeapEntry<E> minEntry = indexToEntry.get(0); int lastIndex = size() - 1; if (lastIndex > 0) { HeapEntry<E> lastEntry = indexToEntry.get(lastIndex); swap(lastEntry, minEntry); removeLast(minEntry); heapifyDown(lastEntry); } else { removeLast(minEntry); } return minEntry.object; }
java
public E extractMin() { if (isEmpty()) { throw new NoSuchElementException(); } HeapEntry<E> minEntry = indexToEntry.get(0); int lastIndex = size() - 1; if (lastIndex > 0) { HeapEntry<E> lastEntry = indexToEntry.get(lastIndex); swap(lastEntry, minEntry); removeLast(minEntry); heapifyDown(lastEntry); } else { removeLast(minEntry); } return minEntry.object; }
[ "public", "E", "extractMin", "(", ")", "{", "if", "(", "isEmpty", "(", ")", ")", "{", "throw", "new", "NoSuchElementException", "(", ")", ";", "}", "HeapEntry", "<", "E", ">", "minEntry", "=", "indexToEntry", ".", "get", "(", "0", ")", ";", "int", "lastIndex", "=", "size", "(", ")", "-", "1", ";", "if", "(", "lastIndex", ">", "0", ")", "{", "HeapEntry", "<", "E", ">", "lastEntry", "=", "indexToEntry", ".", "get", "(", "lastIndex", ")", ";", "swap", "(", "lastEntry", ",", "minEntry", ")", ";", "removeLast", "(", "minEntry", ")", ";", "heapifyDown", "(", "lastEntry", ")", ";", "}", "else", "{", "removeLast", "(", "minEntry", ")", ";", "}", "return", "minEntry", ".", "object", ";", "}" ]
Finds the object with the minimum key, removes it from the heap, and returns it. @return the object with minimum key
[ "Finds", "the", "object", "with", "the", "minimum", "key", "removes", "it", "from", "the", "heap", "and", "returns", "it", "." ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/ArrayHeap.java#L177-L192
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/util/ArrayHeap.java
ArrayHeap.decreaseKey
public int decreaseKey(E o) { HeapEntry<E> entry = getEntry(o); if (o != entry.object) { if (cmp.compare(o, entry.object) < 0) { entry.object = o; } } return heapifyUp(entry); }
java
public int decreaseKey(E o) { HeapEntry<E> entry = getEntry(o); if (o != entry.object) { if (cmp.compare(o, entry.object) < 0) { entry.object = o; } } return heapifyUp(entry); }
[ "public", "int", "decreaseKey", "(", "E", "o", ")", "{", "HeapEntry", "<", "E", ">", "entry", "=", "getEntry", "(", "o", ")", ";", "if", "(", "o", "!=", "entry", ".", "object", ")", "{", "if", "(", "cmp", ".", "compare", "(", "o", ",", "entry", ".", "object", ")", "<", "0", ")", "{", "entry", ".", "object", "=", "o", ";", "}", "}", "return", "heapifyUp", "(", "entry", ")", ";", "}" ]
Changes the position of an element o in the heap based on a change in the ordering of o. If o's key has actually increased, it will do nothing, particularly not an "increase key". @param o an <code>Object</code> value @return the number of swaps done on decrease.
[ "Changes", "the", "position", "of", "an", "element", "o", "in", "the", "heap", "based", "on", "a", "change", "in", "the", "ordering", "of", "o", ".", "If", "o", "s", "key", "has", "actually", "increased", "it", "will", "do", "nothing", "particularly", "not", "an", "increase", "key", "." ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/ArrayHeap.java#L227-L235
train
meertensinstituut/mtas
src/main/java/mtas/analysis/parser/MtasBasicParser.java
MtasBasicParser.createCurrentList
protected Map<String, List<MtasParserObject>> createCurrentList() { Map<String, List<MtasParserObject>> currentList = new HashMap<>(); currentList.put(MAPPING_TYPE_RELATION, new ArrayList<MtasParserObject>()); currentList.put(MAPPING_TYPE_RELATION_ANNOTATION, new ArrayList<MtasParserObject>()); currentList.put(MAPPING_TYPE_REF, new ArrayList<MtasParserObject>()); currentList.put(MAPPING_TYPE_GROUP, new ArrayList<MtasParserObject>()); currentList.put(MAPPING_TYPE_GROUP_ANNOTATION, new ArrayList<MtasParserObject>()); currentList.put(MAPPING_TYPE_WORD, new ArrayList<MtasParserObject>()); currentList.put(MAPPING_TYPE_WORD_ANNOTATION, new ArrayList<MtasParserObject>()); return currentList; }
java
protected Map<String, List<MtasParserObject>> createCurrentList() { Map<String, List<MtasParserObject>> currentList = new HashMap<>(); currentList.put(MAPPING_TYPE_RELATION, new ArrayList<MtasParserObject>()); currentList.put(MAPPING_TYPE_RELATION_ANNOTATION, new ArrayList<MtasParserObject>()); currentList.put(MAPPING_TYPE_REF, new ArrayList<MtasParserObject>()); currentList.put(MAPPING_TYPE_GROUP, new ArrayList<MtasParserObject>()); currentList.put(MAPPING_TYPE_GROUP_ANNOTATION, new ArrayList<MtasParserObject>()); currentList.put(MAPPING_TYPE_WORD, new ArrayList<MtasParserObject>()); currentList.put(MAPPING_TYPE_WORD_ANNOTATION, new ArrayList<MtasParserObject>()); return currentList; }
[ "protected", "Map", "<", "String", ",", "List", "<", "MtasParserObject", ">", ">", "createCurrentList", "(", ")", "{", "Map", "<", "String", ",", "List", "<", "MtasParserObject", ">", ">", "currentList", "=", "new", "HashMap", "<>", "(", ")", ";", "currentList", ".", "put", "(", "MAPPING_TYPE_RELATION", ",", "new", "ArrayList", "<", "MtasParserObject", ">", "(", ")", ")", ";", "currentList", ".", "put", "(", "MAPPING_TYPE_RELATION_ANNOTATION", ",", "new", "ArrayList", "<", "MtasParserObject", ">", "(", ")", ")", ";", "currentList", ".", "put", "(", "MAPPING_TYPE_REF", ",", "new", "ArrayList", "<", "MtasParserObject", ">", "(", ")", ")", ";", "currentList", ".", "put", "(", "MAPPING_TYPE_GROUP", ",", "new", "ArrayList", "<", "MtasParserObject", ">", "(", ")", ")", ";", "currentList", ".", "put", "(", "MAPPING_TYPE_GROUP_ANNOTATION", ",", "new", "ArrayList", "<", "MtasParserObject", ">", "(", ")", ")", ";", "currentList", ".", "put", "(", "MAPPING_TYPE_WORD", ",", "new", "ArrayList", "<", "MtasParserObject", ">", "(", ")", ")", ";", "currentList", ".", "put", "(", "MAPPING_TYPE_WORD_ANNOTATION", ",", "new", "ArrayList", "<", "MtasParserObject", ">", "(", ")", ")", ";", "return", "currentList", ";", "}" ]
Creates the current list. @return the map
[ "Creates", "the", "current", "list", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/parser/MtasBasicParser.java#L268-L281
train
meertensinstituut/mtas
src/main/java/mtas/analysis/parser/MtasBasicParser.java
MtasBasicParser.createUpdateList
protected Map<String, Map<Integer, Set<String>>> createUpdateList() { Map<String, Map<Integer, Set<String>>> updateList = new HashMap<>(); updateList.put(UPDATE_TYPE_OFFSET, new HashMap<>()); updateList.put(UPDATE_TYPE_POSITION, new HashMap<>()); updateList.put(UPDATE_TYPE_LOCAL_REF_POSITION_START, new HashMap<>()); updateList.put(UPDATE_TYPE_LOCAL_REF_POSITION_END, new HashMap<>()); updateList.put(UPDATE_TYPE_LOCAL_REF_OFFSET_START, new HashMap<>()); updateList.put(UPDATE_TYPE_LOCAL_REF_OFFSET_END, new HashMap<>()); updateList.put(UPDATE_TYPE_VARIABLE, new HashMap<>()); return updateList; }
java
protected Map<String, Map<Integer, Set<String>>> createUpdateList() { Map<String, Map<Integer, Set<String>>> updateList = new HashMap<>(); updateList.put(UPDATE_TYPE_OFFSET, new HashMap<>()); updateList.put(UPDATE_TYPE_POSITION, new HashMap<>()); updateList.put(UPDATE_TYPE_LOCAL_REF_POSITION_START, new HashMap<>()); updateList.put(UPDATE_TYPE_LOCAL_REF_POSITION_END, new HashMap<>()); updateList.put(UPDATE_TYPE_LOCAL_REF_OFFSET_START, new HashMap<>()); updateList.put(UPDATE_TYPE_LOCAL_REF_OFFSET_END, new HashMap<>()); updateList.put(UPDATE_TYPE_VARIABLE, new HashMap<>()); return updateList; }
[ "protected", "Map", "<", "String", ",", "Map", "<", "Integer", ",", "Set", "<", "String", ">", ">", ">", "createUpdateList", "(", ")", "{", "Map", "<", "String", ",", "Map", "<", "Integer", ",", "Set", "<", "String", ">", ">", ">", "updateList", "=", "new", "HashMap", "<>", "(", ")", ";", "updateList", ".", "put", "(", "UPDATE_TYPE_OFFSET", ",", "new", "HashMap", "<>", "(", ")", ")", ";", "updateList", ".", "put", "(", "UPDATE_TYPE_POSITION", ",", "new", "HashMap", "<>", "(", ")", ")", ";", "updateList", ".", "put", "(", "UPDATE_TYPE_LOCAL_REF_POSITION_START", ",", "new", "HashMap", "<>", "(", ")", ")", ";", "updateList", ".", "put", "(", "UPDATE_TYPE_LOCAL_REF_POSITION_END", ",", "new", "HashMap", "<>", "(", ")", ")", ";", "updateList", ".", "put", "(", "UPDATE_TYPE_LOCAL_REF_OFFSET_START", ",", "new", "HashMap", "<>", "(", ")", ")", ";", "updateList", ".", "put", "(", "UPDATE_TYPE_LOCAL_REF_OFFSET_END", ",", "new", "HashMap", "<>", "(", ")", ")", ";", "updateList", ".", "put", "(", "UPDATE_TYPE_VARIABLE", ",", "new", "HashMap", "<>", "(", ")", ")", ";", "return", "updateList", ";", "}" ]
Creates the update list. @return the map
[ "Creates", "the", "update", "list", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/parser/MtasBasicParser.java#L288-L298
train
meertensinstituut/mtas
src/main/java/mtas/analysis/parser/MtasBasicParser.java
MtasBasicParser.computeVariablesFromObject
protected void computeVariablesFromObject(MtasParserObject object, Map<String, List<MtasParserObject>> currentList, Map<String, Map<String, String>> variables) { MtasParserType<MtasParserVariable> parserType = object.getType(); String id = object.getId(); if (id != null) { for (MtasParserVariable variable : parserType.getItems()) { if (!variables.containsKey(variable.variable)) { variables.put(variable.variable, new HashMap<String, String>()); } StringBuilder builder = new StringBuilder(); for (MtasParserVariableValue variableValue : variable.values) { if (variableValue.type.equals("attribute")) { String subValue = object.getAttribute(variableValue.name); if (subValue != null) { builder.append(subValue); } } } variables.get(variable.variable).put(id, builder.toString()); } } }
java
protected void computeVariablesFromObject(MtasParserObject object, Map<String, List<MtasParserObject>> currentList, Map<String, Map<String, String>> variables) { MtasParserType<MtasParserVariable> parserType = object.getType(); String id = object.getId(); if (id != null) { for (MtasParserVariable variable : parserType.getItems()) { if (!variables.containsKey(variable.variable)) { variables.put(variable.variable, new HashMap<String, String>()); } StringBuilder builder = new StringBuilder(); for (MtasParserVariableValue variableValue : variable.values) { if (variableValue.type.equals("attribute")) { String subValue = object.getAttribute(variableValue.name); if (subValue != null) { builder.append(subValue); } } } variables.get(variable.variable).put(id, builder.toString()); } } }
[ "protected", "void", "computeVariablesFromObject", "(", "MtasParserObject", "object", ",", "Map", "<", "String", ",", "List", "<", "MtasParserObject", ">", ">", "currentList", ",", "Map", "<", "String", ",", "Map", "<", "String", ",", "String", ">", ">", "variables", ")", "{", "MtasParserType", "<", "MtasParserVariable", ">", "parserType", "=", "object", ".", "getType", "(", ")", ";", "String", "id", "=", "object", ".", "getId", "(", ")", ";", "if", "(", "id", "!=", "null", ")", "{", "for", "(", "MtasParserVariable", "variable", ":", "parserType", ".", "getItems", "(", ")", ")", "{", "if", "(", "!", "variables", ".", "containsKey", "(", "variable", ".", "variable", ")", ")", "{", "variables", ".", "put", "(", "variable", ".", "variable", ",", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", ")", ";", "}", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "MtasParserVariableValue", "variableValue", ":", "variable", ".", "values", ")", "{", "if", "(", "variableValue", ".", "type", ".", "equals", "(", "\"attribute\"", ")", ")", "{", "String", "subValue", "=", "object", ".", "getAttribute", "(", "variableValue", ".", "name", ")", ";", "if", "(", "subValue", "!=", "null", ")", "{", "builder", ".", "append", "(", "subValue", ")", ";", "}", "}", "}", "variables", ".", "get", "(", "variable", ".", "variable", ")", ".", "put", "(", "id", ",", "builder", ".", "toString", "(", ")", ")", ";", "}", "}", "}" ]
Compute variables from object. @param object the object @param currentList the current list @param variables the variables
[ "Compute", "variables", "from", "object", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/parser/MtasBasicParser.java#L625-L647
train
meertensinstituut/mtas
src/main/java/mtas/analysis/parser/MtasBasicParser.java
MtasBasicParser.checkForVariables
private boolean checkForVariables(List<Map<String, String>> values) { if (values == null || values.isEmpty()) { return false; } else { for (Map<String, String> list : values) { if (list.containsKey("type") && list.get("type") .equals(MtasParserMapping.PARSER_TYPE_VARIABLE)) { return true; } } } return false; }
java
private boolean checkForVariables(List<Map<String, String>> values) { if (values == null || values.isEmpty()) { return false; } else { for (Map<String, String> list : values) { if (list.containsKey("type") && list.get("type") .equals(MtasParserMapping.PARSER_TYPE_VARIABLE)) { return true; } } } return false; }
[ "private", "boolean", "checkForVariables", "(", "List", "<", "Map", "<", "String", ",", "String", ">", ">", "values", ")", "{", "if", "(", "values", "==", "null", "||", "values", ".", "isEmpty", "(", ")", ")", "{", "return", "false", ";", "}", "else", "{", "for", "(", "Map", "<", "String", ",", "String", ">", "list", ":", "values", ")", "{", "if", "(", "list", ".", "containsKey", "(", "\"type\"", ")", "&&", "list", ".", "get", "(", "\"type\"", ")", ".", "equals", "(", "MtasParserMapping", ".", "PARSER_TYPE_VARIABLE", ")", ")", "{", "return", "true", ";", "}", "}", "}", "return", "false", ";", "}" ]
Check for variables. @param values the values @return true, if successful
[ "Check", "for", "variables", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/parser/MtasBasicParser.java#L655-L667
train
meertensinstituut/mtas
src/main/java/mtas/analysis/parser/MtasBasicParser.java
MtasBasicParser.computeTypeFromMappingSource
private String computeTypeFromMappingSource(String source) throws MtasParserException { if (source.equals(MtasParserMapping.SOURCE_OWN)) { return null; } else if (source.equals(MtasParserMapping.SOURCE_ANCESTOR_GROUP)) { return MAPPING_TYPE_GROUP; } else if (source .equals(MtasParserMapping.SOURCE_ANCESTOR_GROUP_ANNOTATION)) { return MAPPING_TYPE_GROUP_ANNOTATION; } else if (source.equals(MtasParserMapping.SOURCE_ANCESTOR_WORD)) { return MAPPING_TYPE_WORD; } else if (source .equals(MtasParserMapping.SOURCE_ANCESTOR_WORD_ANNOTATION)) { return MAPPING_TYPE_WORD_ANNOTATION; } else if (source.equals(MtasParserMapping.SOURCE_ANCESTOR_RELATION)) { return MAPPING_TYPE_RELATION; } else if (source .equals(MtasParserMapping.SOURCE_ANCESTOR_RELATION_ANNOTATION)) { return MAPPING_TYPE_RELATION_ANNOTATION; } else { throw new MtasParserException("unknown source " + source); } }
java
private String computeTypeFromMappingSource(String source) throws MtasParserException { if (source.equals(MtasParserMapping.SOURCE_OWN)) { return null; } else if (source.equals(MtasParserMapping.SOURCE_ANCESTOR_GROUP)) { return MAPPING_TYPE_GROUP; } else if (source .equals(MtasParserMapping.SOURCE_ANCESTOR_GROUP_ANNOTATION)) { return MAPPING_TYPE_GROUP_ANNOTATION; } else if (source.equals(MtasParserMapping.SOURCE_ANCESTOR_WORD)) { return MAPPING_TYPE_WORD; } else if (source .equals(MtasParserMapping.SOURCE_ANCESTOR_WORD_ANNOTATION)) { return MAPPING_TYPE_WORD_ANNOTATION; } else if (source.equals(MtasParserMapping.SOURCE_ANCESTOR_RELATION)) { return MAPPING_TYPE_RELATION; } else if (source .equals(MtasParserMapping.SOURCE_ANCESTOR_RELATION_ANNOTATION)) { return MAPPING_TYPE_RELATION_ANNOTATION; } else { throw new MtasParserException("unknown source " + source); } }
[ "private", "String", "computeTypeFromMappingSource", "(", "String", "source", ")", "throws", "MtasParserException", "{", "if", "(", "source", ".", "equals", "(", "MtasParserMapping", ".", "SOURCE_OWN", ")", ")", "{", "return", "null", ";", "}", "else", "if", "(", "source", ".", "equals", "(", "MtasParserMapping", ".", "SOURCE_ANCESTOR_GROUP", ")", ")", "{", "return", "MAPPING_TYPE_GROUP", ";", "}", "else", "if", "(", "source", ".", "equals", "(", "MtasParserMapping", ".", "SOURCE_ANCESTOR_GROUP_ANNOTATION", ")", ")", "{", "return", "MAPPING_TYPE_GROUP_ANNOTATION", ";", "}", "else", "if", "(", "source", ".", "equals", "(", "MtasParserMapping", ".", "SOURCE_ANCESTOR_WORD", ")", ")", "{", "return", "MAPPING_TYPE_WORD", ";", "}", "else", "if", "(", "source", ".", "equals", "(", "MtasParserMapping", ".", "SOURCE_ANCESTOR_WORD_ANNOTATION", ")", ")", "{", "return", "MAPPING_TYPE_WORD_ANNOTATION", ";", "}", "else", "if", "(", "source", ".", "equals", "(", "MtasParserMapping", ".", "SOURCE_ANCESTOR_RELATION", ")", ")", "{", "return", "MAPPING_TYPE_RELATION", ";", "}", "else", "if", "(", "source", ".", "equals", "(", "MtasParserMapping", ".", "SOURCE_ANCESTOR_RELATION_ANNOTATION", ")", ")", "{", "return", "MAPPING_TYPE_RELATION_ANNOTATION", ";", "}", "else", "{", "throw", "new", "MtasParserException", "(", "\"unknown source \"", "+", "source", ")", ";", "}", "}" ]
Compute type from mapping source. @param source the source @return the string @throws MtasParserException the mtas parser exception
[ "Compute", "type", "from", "mapping", "source", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/parser/MtasBasicParser.java#L766-L788
train
meertensinstituut/mtas
src/main/java/mtas/analysis/parser/MtasBasicParser.java
MtasBasicParser.computeObjectFromMappingValue
private MtasParserObject[] computeObjectFromMappingValue( MtasParserObject object, Map<String, String> mappingValue, Map<String, List<MtasParserObject>> currentList) throws MtasParserException { MtasParserObject[] checkObjects = null; MtasParserObject checkObject; Integer ancestorNumber = null; String ancestorType = null; // try to get relevant object if (mappingValue.get(MAPPING_VALUE_SOURCE) .equals(MtasParserMapping.SOURCE_OWN)) { checkObjects = new MtasParserObject[] { object }; } else { ancestorNumber = mappingValue.get(MAPPING_VALUE_ANCESTOR) != null ? Integer.parseInt(mappingValue.get(MAPPING_VALUE_ANCESTOR)) : null; ancestorType = computeTypeFromMappingSource( mappingValue.get(MAPPING_VALUE_SOURCE)); // get ancestor object if (ancestorType != null) { int s = currentList.get(ancestorType).size(); // check existence ancestor for conditions if (ancestorNumber != null) { if ((s > 0) && (ancestorNumber < s) && (checkObject = currentList .get(ancestorType).get((s - ancestorNumber - 1))) != null) { checkObjects = new MtasParserObject[] { checkObject }; } } else { checkObjects = new MtasParserObject[s]; for (int i = s - 1; i >= 0; i--) { checkObjects[s - i - 1] = currentList.get(ancestorType).get(i); } } } } return checkObjects; }
java
private MtasParserObject[] computeObjectFromMappingValue( MtasParserObject object, Map<String, String> mappingValue, Map<String, List<MtasParserObject>> currentList) throws MtasParserException { MtasParserObject[] checkObjects = null; MtasParserObject checkObject; Integer ancestorNumber = null; String ancestorType = null; // try to get relevant object if (mappingValue.get(MAPPING_VALUE_SOURCE) .equals(MtasParserMapping.SOURCE_OWN)) { checkObjects = new MtasParserObject[] { object }; } else { ancestorNumber = mappingValue.get(MAPPING_VALUE_ANCESTOR) != null ? Integer.parseInt(mappingValue.get(MAPPING_VALUE_ANCESTOR)) : null; ancestorType = computeTypeFromMappingSource( mappingValue.get(MAPPING_VALUE_SOURCE)); // get ancestor object if (ancestorType != null) { int s = currentList.get(ancestorType).size(); // check existence ancestor for conditions if (ancestorNumber != null) { if ((s > 0) && (ancestorNumber < s) && (checkObject = currentList .get(ancestorType).get((s - ancestorNumber - 1))) != null) { checkObjects = new MtasParserObject[] { checkObject }; } } else { checkObjects = new MtasParserObject[s]; for (int i = s - 1; i >= 0; i--) { checkObjects[s - i - 1] = currentList.get(ancestorType).get(i); } } } } return checkObjects; }
[ "private", "MtasParserObject", "[", "]", "computeObjectFromMappingValue", "(", "MtasParserObject", "object", ",", "Map", "<", "String", ",", "String", ">", "mappingValue", ",", "Map", "<", "String", ",", "List", "<", "MtasParserObject", ">", ">", "currentList", ")", "throws", "MtasParserException", "{", "MtasParserObject", "[", "]", "checkObjects", "=", "null", ";", "MtasParserObject", "checkObject", ";", "Integer", "ancestorNumber", "=", "null", ";", "String", "ancestorType", "=", "null", ";", "// try to get relevant object", "if", "(", "mappingValue", ".", "get", "(", "MAPPING_VALUE_SOURCE", ")", ".", "equals", "(", "MtasParserMapping", ".", "SOURCE_OWN", ")", ")", "{", "checkObjects", "=", "new", "MtasParserObject", "[", "]", "{", "object", "}", ";", "}", "else", "{", "ancestorNumber", "=", "mappingValue", ".", "get", "(", "MAPPING_VALUE_ANCESTOR", ")", "!=", "null", "?", "Integer", ".", "parseInt", "(", "mappingValue", ".", "get", "(", "MAPPING_VALUE_ANCESTOR", ")", ")", ":", "null", ";", "ancestorType", "=", "computeTypeFromMappingSource", "(", "mappingValue", ".", "get", "(", "MAPPING_VALUE_SOURCE", ")", ")", ";", "// get ancestor object", "if", "(", "ancestorType", "!=", "null", ")", "{", "int", "s", "=", "currentList", ".", "get", "(", "ancestorType", ")", ".", "size", "(", ")", ";", "// check existence ancestor for conditions", "if", "(", "ancestorNumber", "!=", "null", ")", "{", "if", "(", "(", "s", ">", "0", ")", "&&", "(", "ancestorNumber", "<", "s", ")", "&&", "(", "checkObject", "=", "currentList", ".", "get", "(", "ancestorType", ")", ".", "get", "(", "(", "s", "-", "ancestorNumber", "-", "1", ")", ")", ")", "!=", "null", ")", "{", "checkObjects", "=", "new", "MtasParserObject", "[", "]", "{", "checkObject", "}", ";", "}", "}", "else", "{", "checkObjects", "=", "new", "MtasParserObject", "[", "s", "]", ";", "for", "(", "int", "i", "=", "s", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "checkObjects", "[", "s", "-", "i", "-", "1", "]", "=", "currentList", ".", "get", "(", "ancestorType", ")", ".", "get", "(", "i", ")", ";", "}", "}", "}", "}", "return", "checkObjects", ";", "}" ]
Compute object from mapping value. @param object the object @param mappingValue the mapping value @param currentList the current list @return the mtas parser object[] @throws MtasParserException the mtas parser exception
[ "Compute", "object", "from", "mapping", "value", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/parser/MtasBasicParser.java#L799-L834
train
meertensinstituut/mtas
src/main/java/mtas/analysis/parser/MtasBasicParser.java
MtasBasicParser.addAndEncodeVariable
private String addAndEncodeVariable(String originalValue, String newVariable, String newVariableName, boolean encode) { return addAndEncode(originalValue, newVariable, newVariableName, encode); }
java
private String addAndEncodeVariable(String originalValue, String newVariable, String newVariableName, boolean encode) { return addAndEncode(originalValue, newVariable, newVariableName, encode); }
[ "private", "String", "addAndEncodeVariable", "(", "String", "originalValue", ",", "String", "newVariable", ",", "String", "newVariableName", ",", "boolean", "encode", ")", "{", "return", "addAndEncode", "(", "originalValue", ",", "newVariable", ",", "newVariableName", ",", "encode", ")", ";", "}" ]
Adds the and encode variable. @param originalValue the original value @param newVariable the new variable @param newVariableName the new variable name @param encode the encode @return the string
[ "Adds", "the", "and", "encode", "variable", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/parser/MtasBasicParser.java#L1018-L1021
train
meertensinstituut/mtas
src/main/java/mtas/analysis/parser/MtasBasicParser.java
MtasBasicParser.addAndEncodeValue
private String addAndEncodeValue(String originalValue, String newValue, boolean encode) { return addAndEncode(originalValue, null, newValue, encode); }
java
private String addAndEncodeValue(String originalValue, String newValue, boolean encode) { return addAndEncode(originalValue, null, newValue, encode); }
[ "private", "String", "addAndEncodeValue", "(", "String", "originalValue", ",", "String", "newValue", ",", "boolean", "encode", ")", "{", "return", "addAndEncode", "(", "originalValue", ",", "null", ",", "newValue", ",", "encode", ")", ";", "}" ]
Adds the and encode value. @param originalValue the original value @param newValue the new value @param encode the encode @return the string
[ "Adds", "the", "and", "encode", "value", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/parser/MtasBasicParser.java#L1031-L1034
train
meertensinstituut/mtas
src/main/java/mtas/analysis/parser/MtasBasicParser.java
MtasBasicParser.addAndEncode
private String addAndEncode(String originalValue, String newType, String newValue, boolean encode) { if (newValue == null) { return originalValue; } else { String finalNewValue; if (encode) { if (newType == null) { finalNewValue = new String( enc.encode(newValue.getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8); } else { finalNewValue = new String( enc.encode(newType.getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8) + ":" + new String( enc.encode(newValue.getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8); } } else { finalNewValue = newValue; } if (originalValue == null || originalValue.isEmpty()) { return finalNewValue; } else { return originalValue + (encode ? " " : "") + finalNewValue; } } }
java
private String addAndEncode(String originalValue, String newType, String newValue, boolean encode) { if (newValue == null) { return originalValue; } else { String finalNewValue; if (encode) { if (newType == null) { finalNewValue = new String( enc.encode(newValue.getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8); } else { finalNewValue = new String( enc.encode(newType.getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8) + ":" + new String( enc.encode(newValue.getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8); } } else { finalNewValue = newValue; } if (originalValue == null || originalValue.isEmpty()) { return finalNewValue; } else { return originalValue + (encode ? " " : "") + finalNewValue; } } }
[ "private", "String", "addAndEncode", "(", "String", "originalValue", ",", "String", "newType", ",", "String", "newValue", ",", "boolean", "encode", ")", "{", "if", "(", "newValue", "==", "null", ")", "{", "return", "originalValue", ";", "}", "else", "{", "String", "finalNewValue", ";", "if", "(", "encode", ")", "{", "if", "(", "newType", "==", "null", ")", "{", "finalNewValue", "=", "new", "String", "(", "enc", ".", "encode", "(", "newValue", ".", "getBytes", "(", "StandardCharsets", ".", "UTF_8", ")", ")", ",", "StandardCharsets", ".", "UTF_8", ")", ";", "}", "else", "{", "finalNewValue", "=", "new", "String", "(", "enc", ".", "encode", "(", "newType", ".", "getBytes", "(", "StandardCharsets", ".", "UTF_8", ")", ")", ",", "StandardCharsets", ".", "UTF_8", ")", "+", "\":\"", "+", "new", "String", "(", "enc", ".", "encode", "(", "newValue", ".", "getBytes", "(", "StandardCharsets", ".", "UTF_8", ")", ")", ",", "StandardCharsets", ".", "UTF_8", ")", ";", "}", "}", "else", "{", "finalNewValue", "=", "newValue", ";", "}", "if", "(", "originalValue", "==", "null", "||", "originalValue", ".", "isEmpty", "(", ")", ")", "{", "return", "finalNewValue", ";", "}", "else", "{", "return", "originalValue", "+", "(", "encode", "?", "\" \"", ":", "\"\"", ")", "+", "finalNewValue", ";", "}", "}", "}" ]
Adds the and encode. @param originalValue the original value @param newType the new type @param newValue the new value @param encode the encode @return the string
[ "Adds", "the", "and", "encode", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/parser/MtasBasicParser.java#L1045-L1074
train
meertensinstituut/mtas
src/main/java/mtas/analysis/parser/MtasBasicParser.java
MtasBasicParser.computePayloadFromMappingPayload
private BytesRef computePayloadFromMappingPayload(MtasParserObject object, List<Map<String, String>> mappingPayloads, Map<String, List<MtasParserObject>> currentList) throws MtasParserException { BytesRef payload = null; for (Map<String, String> mappingPayload : mappingPayloads) { if (mappingPayload.get(MAPPING_VALUE_SOURCE) .equals(MtasParserMapping.SOURCE_STRING)) { if (mappingPayload.get(MAPPING_VALUE_TYPE) .equals(MtasParserMapping.PARSER_TYPE_STRING) && mappingPayload.get(MAPPING_VALUE_TEXT) != null) { BytesRef subpayload = computeMaximumFilteredPayload( mappingPayload.get(MAPPING_VALUE_TEXT), payload, null); payload = (subpayload != null) ? subpayload : payload; } // from objects } else { MtasParserObject[] checkObjects = computeObjectFromMappingValue(object, mappingPayload, currentList); // do checks and updates if (checkObjects != null) { // payload from attribute if (mappingPayload.get("type") .equals(MtasParserMapping.PARSER_TYPE_ATTRIBUTE)) { BytesRef subpayload = computeMaximumFilteredPayload( checkObjects[0].getAttribute(mappingPayload.get("name")), payload, mappingPayload.get(MAPPING_VALUE_FILTER)); payload = (subpayload != null) ? subpayload : payload; // payload from text } else if (mappingPayload.get("type") .equals(MtasParserMapping.PARSER_TYPE_TEXT)) { BytesRef subpayload = computeMaximumFilteredPayload( object.getText(), payload, mappingPayload.get(MAPPING_VALUE_FILTER)); payload = (subpayload != null) ? subpayload : payload; } } } } return payload; }
java
private BytesRef computePayloadFromMappingPayload(MtasParserObject object, List<Map<String, String>> mappingPayloads, Map<String, List<MtasParserObject>> currentList) throws MtasParserException { BytesRef payload = null; for (Map<String, String> mappingPayload : mappingPayloads) { if (mappingPayload.get(MAPPING_VALUE_SOURCE) .equals(MtasParserMapping.SOURCE_STRING)) { if (mappingPayload.get(MAPPING_VALUE_TYPE) .equals(MtasParserMapping.PARSER_TYPE_STRING) && mappingPayload.get(MAPPING_VALUE_TEXT) != null) { BytesRef subpayload = computeMaximumFilteredPayload( mappingPayload.get(MAPPING_VALUE_TEXT), payload, null); payload = (subpayload != null) ? subpayload : payload; } // from objects } else { MtasParserObject[] checkObjects = computeObjectFromMappingValue(object, mappingPayload, currentList); // do checks and updates if (checkObjects != null) { // payload from attribute if (mappingPayload.get("type") .equals(MtasParserMapping.PARSER_TYPE_ATTRIBUTE)) { BytesRef subpayload = computeMaximumFilteredPayload( checkObjects[0].getAttribute(mappingPayload.get("name")), payload, mappingPayload.get(MAPPING_VALUE_FILTER)); payload = (subpayload != null) ? subpayload : payload; // payload from text } else if (mappingPayload.get("type") .equals(MtasParserMapping.PARSER_TYPE_TEXT)) { BytesRef subpayload = computeMaximumFilteredPayload( object.getText(), payload, mappingPayload.get(MAPPING_VALUE_FILTER)); payload = (subpayload != null) ? subpayload : payload; } } } } return payload; }
[ "private", "BytesRef", "computePayloadFromMappingPayload", "(", "MtasParserObject", "object", ",", "List", "<", "Map", "<", "String", ",", "String", ">", ">", "mappingPayloads", ",", "Map", "<", "String", ",", "List", "<", "MtasParserObject", ">", ">", "currentList", ")", "throws", "MtasParserException", "{", "BytesRef", "payload", "=", "null", ";", "for", "(", "Map", "<", "String", ",", "String", ">", "mappingPayload", ":", "mappingPayloads", ")", "{", "if", "(", "mappingPayload", ".", "get", "(", "MAPPING_VALUE_SOURCE", ")", ".", "equals", "(", "MtasParserMapping", ".", "SOURCE_STRING", ")", ")", "{", "if", "(", "mappingPayload", ".", "get", "(", "MAPPING_VALUE_TYPE", ")", ".", "equals", "(", "MtasParserMapping", ".", "PARSER_TYPE_STRING", ")", "&&", "mappingPayload", ".", "get", "(", "MAPPING_VALUE_TEXT", ")", "!=", "null", ")", "{", "BytesRef", "subpayload", "=", "computeMaximumFilteredPayload", "(", "mappingPayload", ".", "get", "(", "MAPPING_VALUE_TEXT", ")", ",", "payload", ",", "null", ")", ";", "payload", "=", "(", "subpayload", "!=", "null", ")", "?", "subpayload", ":", "payload", ";", "}", "// from objects", "}", "else", "{", "MtasParserObject", "[", "]", "checkObjects", "=", "computeObjectFromMappingValue", "(", "object", ",", "mappingPayload", ",", "currentList", ")", ";", "// do checks and updates", "if", "(", "checkObjects", "!=", "null", ")", "{", "// payload from attribute", "if", "(", "mappingPayload", ".", "get", "(", "\"type\"", ")", ".", "equals", "(", "MtasParserMapping", ".", "PARSER_TYPE_ATTRIBUTE", ")", ")", "{", "BytesRef", "subpayload", "=", "computeMaximumFilteredPayload", "(", "checkObjects", "[", "0", "]", ".", "getAttribute", "(", "mappingPayload", ".", "get", "(", "\"name\"", ")", ")", ",", "payload", ",", "mappingPayload", ".", "get", "(", "MAPPING_VALUE_FILTER", ")", ")", ";", "payload", "=", "(", "subpayload", "!=", "null", ")", "?", "subpayload", ":", "payload", ";", "// payload from text", "}", "else", "if", "(", "mappingPayload", ".", "get", "(", "\"type\"", ")", ".", "equals", "(", "MtasParserMapping", ".", "PARSER_TYPE_TEXT", ")", ")", "{", "BytesRef", "subpayload", "=", "computeMaximumFilteredPayload", "(", "object", ".", "getText", "(", ")", ",", "payload", ",", "mappingPayload", ".", "get", "(", "MAPPING_VALUE_FILTER", ")", ")", ";", "payload", "=", "(", "subpayload", "!=", "null", ")", "?", "subpayload", ":", "payload", ";", "}", "}", "}", "}", "return", "payload", ";", "}" ]
Compute payload from mapping payload. @param object the object @param mappingPayloads the mapping payloads @param currentList the current list @return the bytes ref @throws MtasParserException the mtas parser exception
[ "Compute", "payload", "from", "mapping", "payload", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/parser/MtasBasicParser.java#L1162-L1202
train
meertensinstituut/mtas
src/main/java/mtas/analysis/parser/MtasBasicParser.java
MtasBasicParser.prevalidateObject
Boolean prevalidateObject(MtasParserObject object, Map<String, List<MtasParserObject>> currentList) { MtasParserType objectType = object.getType(); List<MtasParserMapping<?>> mappings = objectType.getItems(); if (mappings.isEmpty()) { return true; } for (MtasParserMapping<?> mapping : mappings) { try { precheckMappingConditions(object, mapping.getConditions(), currentList); return true; } catch (MtasParserException e) { log.debug(e); } } return false; }
java
Boolean prevalidateObject(MtasParserObject object, Map<String, List<MtasParserObject>> currentList) { MtasParserType objectType = object.getType(); List<MtasParserMapping<?>> mappings = objectType.getItems(); if (mappings.isEmpty()) { return true; } for (MtasParserMapping<?> mapping : mappings) { try { precheckMappingConditions(object, mapping.getConditions(), currentList); return true; } catch (MtasParserException e) { log.debug(e); } } return false; }
[ "Boolean", "prevalidateObject", "(", "MtasParserObject", "object", ",", "Map", "<", "String", ",", "List", "<", "MtasParserObject", ">", ">", "currentList", ")", "{", "MtasParserType", "objectType", "=", "object", ".", "getType", "(", ")", ";", "List", "<", "MtasParserMapping", "<", "?", ">", ">", "mappings", "=", "objectType", ".", "getItems", "(", ")", ";", "if", "(", "mappings", ".", "isEmpty", "(", ")", ")", "{", "return", "true", ";", "}", "for", "(", "MtasParserMapping", "<", "?", ">", "mapping", ":", "mappings", ")", "{", "try", "{", "precheckMappingConditions", "(", "object", ",", "mapping", ".", "getConditions", "(", ")", ",", "currentList", ")", ";", "return", "true", ";", "}", "catch", "(", "MtasParserException", "e", ")", "{", "log", ".", "debug", "(", "e", ")", ";", "}", "}", "return", "false", ";", "}" ]
Prevalidate object. @param object the object @param currentList the current list @return the boolean
[ "Prevalidate", "object", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/parser/MtasBasicParser.java#L1211-L1227
train
meertensinstituut/mtas
src/main/java/mtas/analysis/parser/MtasBasicParser.java
MtasBasicParser.postcheckMappingConditions
private void postcheckMappingConditions(MtasParserObject object, List<Map<String, String>> mappingConditions, Map<String, List<MtasParserObject>> currentList) throws MtasParserException { precheckMappingConditions(object, mappingConditions, currentList); for (Map<String, String> mappingCondition : mappingConditions) { // condition on text if (mappingCondition.get("type") .equals(MtasParserMapping.PARSER_TYPE_TEXT)) { MtasParserObject[] checkObjects = computeObjectFromMappingValue(object, mappingCondition, currentList); if (checkObjects != null) { String textCondition = mappingCondition.get(MAPPING_VALUE_CONDITION); String textValue = object.getText(); Boolean notCondition = false; if (mappingCondition.get("not") != null) { notCondition = true; } if ((textCondition == null) && ((textValue == null) || textValue.isEmpty())) { if (!notCondition) { throw new MtasParserException("no text available"); } } else if ((textCondition != null) && (textValue == null)) { if (!notCondition) { throw new MtasParserException("condition " + textCondition + " on text not matched (is null)"); } } else if (textCondition != null) { if (!notCondition && !textCondition.equals(textValue)) { throw new MtasParserException("condition " + textCondition + " on text not matched (is " + textValue + ")"); } else if (notCondition && textCondition.equals(textValue)) { throw new MtasParserException("condition NOT " + textCondition + " on text not matched (is " + textValue + ")"); } } } } } }
java
private void postcheckMappingConditions(MtasParserObject object, List<Map<String, String>> mappingConditions, Map<String, List<MtasParserObject>> currentList) throws MtasParserException { precheckMappingConditions(object, mappingConditions, currentList); for (Map<String, String> mappingCondition : mappingConditions) { // condition on text if (mappingCondition.get("type") .equals(MtasParserMapping.PARSER_TYPE_TEXT)) { MtasParserObject[] checkObjects = computeObjectFromMappingValue(object, mappingCondition, currentList); if (checkObjects != null) { String textCondition = mappingCondition.get(MAPPING_VALUE_CONDITION); String textValue = object.getText(); Boolean notCondition = false; if (mappingCondition.get("not") != null) { notCondition = true; } if ((textCondition == null) && ((textValue == null) || textValue.isEmpty())) { if (!notCondition) { throw new MtasParserException("no text available"); } } else if ((textCondition != null) && (textValue == null)) { if (!notCondition) { throw new MtasParserException("condition " + textCondition + " on text not matched (is null)"); } } else if (textCondition != null) { if (!notCondition && !textCondition.equals(textValue)) { throw new MtasParserException("condition " + textCondition + " on text not matched (is " + textValue + ")"); } else if (notCondition && textCondition.equals(textValue)) { throw new MtasParserException("condition NOT " + textCondition + " on text not matched (is " + textValue + ")"); } } } } } }
[ "private", "void", "postcheckMappingConditions", "(", "MtasParserObject", "object", ",", "List", "<", "Map", "<", "String", ",", "String", ">", ">", "mappingConditions", ",", "Map", "<", "String", ",", "List", "<", "MtasParserObject", ">", ">", "currentList", ")", "throws", "MtasParserException", "{", "precheckMappingConditions", "(", "object", ",", "mappingConditions", ",", "currentList", ")", ";", "for", "(", "Map", "<", "String", ",", "String", ">", "mappingCondition", ":", "mappingConditions", ")", "{", "// condition on text", "if", "(", "mappingCondition", ".", "get", "(", "\"type\"", ")", ".", "equals", "(", "MtasParserMapping", ".", "PARSER_TYPE_TEXT", ")", ")", "{", "MtasParserObject", "[", "]", "checkObjects", "=", "computeObjectFromMappingValue", "(", "object", ",", "mappingCondition", ",", "currentList", ")", ";", "if", "(", "checkObjects", "!=", "null", ")", "{", "String", "textCondition", "=", "mappingCondition", ".", "get", "(", "MAPPING_VALUE_CONDITION", ")", ";", "String", "textValue", "=", "object", ".", "getText", "(", ")", ";", "Boolean", "notCondition", "=", "false", ";", "if", "(", "mappingCondition", ".", "get", "(", "\"not\"", ")", "!=", "null", ")", "{", "notCondition", "=", "true", ";", "}", "if", "(", "(", "textCondition", "==", "null", ")", "&&", "(", "(", "textValue", "==", "null", ")", "||", "textValue", ".", "isEmpty", "(", ")", ")", ")", "{", "if", "(", "!", "notCondition", ")", "{", "throw", "new", "MtasParserException", "(", "\"no text available\"", ")", ";", "}", "}", "else", "if", "(", "(", "textCondition", "!=", "null", ")", "&&", "(", "textValue", "==", "null", ")", ")", "{", "if", "(", "!", "notCondition", ")", "{", "throw", "new", "MtasParserException", "(", "\"condition \"", "+", "textCondition", "+", "\" on text not matched (is null)\"", ")", ";", "}", "}", "else", "if", "(", "textCondition", "!=", "null", ")", "{", "if", "(", "!", "notCondition", "&&", "!", "textCondition", ".", "equals", "(", "textValue", ")", ")", "{", "throw", "new", "MtasParserException", "(", "\"condition \"", "+", "textCondition", "+", "\" on text not matched (is \"", "+", "textValue", "+", "\")\"", ")", ";", "}", "else", "if", "(", "notCondition", "&&", "textCondition", ".", "equals", "(", "textValue", ")", ")", "{", "throw", "new", "MtasParserException", "(", "\"condition NOT \"", "+", "textCondition", "+", "\" on text not matched (is \"", "+", "textValue", "+", "\")\"", ")", ";", "}", "}", "}", "}", "}", "}" ]
Postcheck mapping conditions. @param object the object @param mappingConditions the mapping conditions @param currentList the current list @throws MtasParserException the mtas parser exception
[ "Postcheck", "mapping", "conditions", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/parser/MtasBasicParser.java#L1387-L1427
train
meertensinstituut/mtas
src/main/java/mtas/analysis/parser/MtasBasicParser.java
MtasBasicParser.computeFilteredSplitValues
private String[] computeFilteredSplitValues(String[] values, String filter) throws MtasConfigException { if (filter != null) { String[] filters = filter.split(","); boolean[] valuesFilter = new boolean[values.length]; boolean doSplitFilter = false; for (String item : filters) { if (item.trim().matches( "^" + Pattern.quote(MAPPING_FILTER_SPLIT) + "\\([0-9\\-]+\\)$")) { doSplitFilter = true; Pattern splitContent = Pattern .compile("^" + Pattern.quote(MAPPING_FILTER_SPLIT) + "\\(([0-9]+)(-([0-9]+))?\\)$"); Matcher splitContentMatcher = splitContent.matcher(item.trim()); while (splitContentMatcher.find()) { if (splitContentMatcher.group(3) == null) { int i = Integer.parseInt(splitContentMatcher.group(1)); if (i >= 0 && i < values.length) { valuesFilter[i] = true; } } else { int i1 = Integer.parseInt(splitContentMatcher.group(1)); int i2 = Integer.parseInt(splitContentMatcher.group(3)); for (int i = Math.max(0, i1); i < Math.min(values.length, i2); i++) { valuesFilter[i] = true; } } } } } if (doSplitFilter) { int number = 0; for (int i = 0; i < valuesFilter.length; i++) { if (valuesFilter[i]) { number++; } } if (number > 0) { String[] newValues = new String[number]; number = 0; for (int i = 0; i < valuesFilter.length; i++) { if (valuesFilter[i]) { newValues[number] = values[i]; number++; } } return newValues; } else { return new String[] {}; } } } return values; }
java
private String[] computeFilteredSplitValues(String[] values, String filter) throws MtasConfigException { if (filter != null) { String[] filters = filter.split(","); boolean[] valuesFilter = new boolean[values.length]; boolean doSplitFilter = false; for (String item : filters) { if (item.trim().matches( "^" + Pattern.quote(MAPPING_FILTER_SPLIT) + "\\([0-9\\-]+\\)$")) { doSplitFilter = true; Pattern splitContent = Pattern .compile("^" + Pattern.quote(MAPPING_FILTER_SPLIT) + "\\(([0-9]+)(-([0-9]+))?\\)$"); Matcher splitContentMatcher = splitContent.matcher(item.trim()); while (splitContentMatcher.find()) { if (splitContentMatcher.group(3) == null) { int i = Integer.parseInt(splitContentMatcher.group(1)); if (i >= 0 && i < values.length) { valuesFilter[i] = true; } } else { int i1 = Integer.parseInt(splitContentMatcher.group(1)); int i2 = Integer.parseInt(splitContentMatcher.group(3)); for (int i = Math.max(0, i1); i < Math.min(values.length, i2); i++) { valuesFilter[i] = true; } } } } } if (doSplitFilter) { int number = 0; for (int i = 0; i < valuesFilter.length; i++) { if (valuesFilter[i]) { number++; } } if (number > 0) { String[] newValues = new String[number]; number = 0; for (int i = 0; i < valuesFilter.length; i++) { if (valuesFilter[i]) { newValues[number] = values[i]; number++; } } return newValues; } else { return new String[] {}; } } } return values; }
[ "private", "String", "[", "]", "computeFilteredSplitValues", "(", "String", "[", "]", "values", ",", "String", "filter", ")", "throws", "MtasConfigException", "{", "if", "(", "filter", "!=", "null", ")", "{", "String", "[", "]", "filters", "=", "filter", ".", "split", "(", "\",\"", ")", ";", "boolean", "[", "]", "valuesFilter", "=", "new", "boolean", "[", "values", ".", "length", "]", ";", "boolean", "doSplitFilter", "=", "false", ";", "for", "(", "String", "item", ":", "filters", ")", "{", "if", "(", "item", ".", "trim", "(", ")", ".", "matches", "(", "\"^\"", "+", "Pattern", ".", "quote", "(", "MAPPING_FILTER_SPLIT", ")", "+", "\"\\\\([0-9\\\\-]+\\\\)$\"", ")", ")", "{", "doSplitFilter", "=", "true", ";", "Pattern", "splitContent", "=", "Pattern", ".", "compile", "(", "\"^\"", "+", "Pattern", ".", "quote", "(", "MAPPING_FILTER_SPLIT", ")", "+", "\"\\\\(([0-9]+)(-([0-9]+))?\\\\)$\"", ")", ";", "Matcher", "splitContentMatcher", "=", "splitContent", ".", "matcher", "(", "item", ".", "trim", "(", ")", ")", ";", "while", "(", "splitContentMatcher", ".", "find", "(", ")", ")", "{", "if", "(", "splitContentMatcher", ".", "group", "(", "3", ")", "==", "null", ")", "{", "int", "i", "=", "Integer", ".", "parseInt", "(", "splitContentMatcher", ".", "group", "(", "1", ")", ")", ";", "if", "(", "i", ">=", "0", "&&", "i", "<", "values", ".", "length", ")", "{", "valuesFilter", "[", "i", "]", "=", "true", ";", "}", "}", "else", "{", "int", "i1", "=", "Integer", ".", "parseInt", "(", "splitContentMatcher", ".", "group", "(", "1", ")", ")", ";", "int", "i2", "=", "Integer", ".", "parseInt", "(", "splitContentMatcher", ".", "group", "(", "3", ")", ")", ";", "for", "(", "int", "i", "=", "Math", ".", "max", "(", "0", ",", "i1", ")", ";", "i", "<", "Math", ".", "min", "(", "values", ".", "length", ",", "i2", ")", ";", "i", "++", ")", "{", "valuesFilter", "[", "i", "]", "=", "true", ";", "}", "}", "}", "}", "}", "if", "(", "doSplitFilter", ")", "{", "int", "number", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "valuesFilter", ".", "length", ";", "i", "++", ")", "{", "if", "(", "valuesFilter", "[", "i", "]", ")", "{", "number", "++", ";", "}", "}", "if", "(", "number", ">", "0", ")", "{", "String", "[", "]", "newValues", "=", "new", "String", "[", "number", "]", ";", "number", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "valuesFilter", ".", "length", ";", "i", "++", ")", "{", "if", "(", "valuesFilter", "[", "i", "]", ")", "{", "newValues", "[", "number", "]", "=", "values", "[", "i", "]", ";", "number", "++", ";", "}", "}", "return", "newValues", ";", "}", "else", "{", "return", "new", "String", "[", "]", "{", "}", ";", "}", "}", "}", "return", "values", ";", "}" ]
Compute filtered split values. @param values the values @param filter the filter @return the string[] @throws MtasConfigException the mtas config exception
[ "Compute", "filtered", "split", "values", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/parser/MtasBasicParser.java#L1437-L1491
train
meertensinstituut/mtas
src/main/java/mtas/analysis/parser/MtasBasicParser.java
MtasBasicParser.computeFilteredPrefixedValue
private String computeFilteredPrefixedValue(String type, String value, String filter, String prefix) throws MtasConfigException { String localValue = value; // do magic with filter if (filter != null) { String[] filters = filter.split(","); for (String item : filters) { if (item.trim().equals(MAPPING_FILTER_UPPERCASE)) { localValue = localValue == null ? null : localValue.toUpperCase(); } else if (item.trim().equals(MAPPING_FILTER_LOWERCASE)) { localValue = localValue == null ? null : localValue.toLowerCase(); } else if (item.trim().equals(MAPPING_FILTER_ASCII)) { if (localValue != null) { char[] old = localValue.toCharArray(); char[] ascii = new char[4 * old.length]; ASCIIFoldingFilter.foldToASCII(old, 0, ascii, 0, localValue.length()); localValue = new String(ascii); } } else if (item.trim() .matches(Pattern.quote(MAPPING_FILTER_SPLIT) + "\\([0-9\\-]+\\)")) { if (!type.equals(MtasParserMapping.PARSER_TYPE_TEXT_SPLIT)) { throw new MtasConfigException( "split filter not allowed for " + type); } } else { throw new MtasConfigException( "unknown filter " + item + " for value " + localValue); } } } if (localValue != null && prefix != null) { localValue = prefix + localValue; } return localValue; }
java
private String computeFilteredPrefixedValue(String type, String value, String filter, String prefix) throws MtasConfigException { String localValue = value; // do magic with filter if (filter != null) { String[] filters = filter.split(","); for (String item : filters) { if (item.trim().equals(MAPPING_FILTER_UPPERCASE)) { localValue = localValue == null ? null : localValue.toUpperCase(); } else if (item.trim().equals(MAPPING_FILTER_LOWERCASE)) { localValue = localValue == null ? null : localValue.toLowerCase(); } else if (item.trim().equals(MAPPING_FILTER_ASCII)) { if (localValue != null) { char[] old = localValue.toCharArray(); char[] ascii = new char[4 * old.length]; ASCIIFoldingFilter.foldToASCII(old, 0, ascii, 0, localValue.length()); localValue = new String(ascii); } } else if (item.trim() .matches(Pattern.quote(MAPPING_FILTER_SPLIT) + "\\([0-9\\-]+\\)")) { if (!type.equals(MtasParserMapping.PARSER_TYPE_TEXT_SPLIT)) { throw new MtasConfigException( "split filter not allowed for " + type); } } else { throw new MtasConfigException( "unknown filter " + item + " for value " + localValue); } } } if (localValue != null && prefix != null) { localValue = prefix + localValue; } return localValue; }
[ "private", "String", "computeFilteredPrefixedValue", "(", "String", "type", ",", "String", "value", ",", "String", "filter", ",", "String", "prefix", ")", "throws", "MtasConfigException", "{", "String", "localValue", "=", "value", ";", "// do magic with filter", "if", "(", "filter", "!=", "null", ")", "{", "String", "[", "]", "filters", "=", "filter", ".", "split", "(", "\",\"", ")", ";", "for", "(", "String", "item", ":", "filters", ")", "{", "if", "(", "item", ".", "trim", "(", ")", ".", "equals", "(", "MAPPING_FILTER_UPPERCASE", ")", ")", "{", "localValue", "=", "localValue", "==", "null", "?", "null", ":", "localValue", ".", "toUpperCase", "(", ")", ";", "}", "else", "if", "(", "item", ".", "trim", "(", ")", ".", "equals", "(", "MAPPING_FILTER_LOWERCASE", ")", ")", "{", "localValue", "=", "localValue", "==", "null", "?", "null", ":", "localValue", ".", "toLowerCase", "(", ")", ";", "}", "else", "if", "(", "item", ".", "trim", "(", ")", ".", "equals", "(", "MAPPING_FILTER_ASCII", ")", ")", "{", "if", "(", "localValue", "!=", "null", ")", "{", "char", "[", "]", "old", "=", "localValue", ".", "toCharArray", "(", ")", ";", "char", "[", "]", "ascii", "=", "new", "char", "[", "4", "*", "old", ".", "length", "]", ";", "ASCIIFoldingFilter", ".", "foldToASCII", "(", "old", ",", "0", ",", "ascii", ",", "0", ",", "localValue", ".", "length", "(", ")", ")", ";", "localValue", "=", "new", "String", "(", "ascii", ")", ";", "}", "}", "else", "if", "(", "item", ".", "trim", "(", ")", ".", "matches", "(", "Pattern", ".", "quote", "(", "MAPPING_FILTER_SPLIT", ")", "+", "\"\\\\([0-9\\\\-]+\\\\)\"", ")", ")", "{", "if", "(", "!", "type", ".", "equals", "(", "MtasParserMapping", ".", "PARSER_TYPE_TEXT_SPLIT", ")", ")", "{", "throw", "new", "MtasConfigException", "(", "\"split filter not allowed for \"", "+", "type", ")", ";", "}", "}", "else", "{", "throw", "new", "MtasConfigException", "(", "\"unknown filter \"", "+", "item", "+", "\" for value \"", "+", "localValue", ")", ";", "}", "}", "}", "if", "(", "localValue", "!=", "null", "&&", "prefix", "!=", "null", ")", "{", "localValue", "=", "prefix", "+", "localValue", ";", "}", "return", "localValue", ";", "}" ]
Compute filtered prefixed value. @param type the type @param value the value @param filter the filter @param prefix the prefix @return the string @throws MtasConfigException the mtas config exception
[ "Compute", "filtered", "prefixed", "value", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/parser/MtasBasicParser.java#L1503-L1538
train
meertensinstituut/mtas
src/main/java/mtas/analysis/parser/MtasBasicParser.java
MtasBasicParser.computeMaximumFilteredPayload
private BytesRef computeMaximumFilteredPayload(String value, BytesRef payload, String filter) { // do magic with filter if (value != null) { if (payload != null) { Float payloadFloat = PayloadHelper.decodeFloat(payload.bytes, payload.offset); Float valueFloat = Float.parseFloat(value); return new BytesRef( PayloadHelper.encodeFloat(Math.max(payloadFloat, valueFloat))); } else { return new BytesRef(PayloadHelper.encodeFloat(Float.parseFloat(value))); } } else { return payload; } }
java
private BytesRef computeMaximumFilteredPayload(String value, BytesRef payload, String filter) { // do magic with filter if (value != null) { if (payload != null) { Float payloadFloat = PayloadHelper.decodeFloat(payload.bytes, payload.offset); Float valueFloat = Float.parseFloat(value); return new BytesRef( PayloadHelper.encodeFloat(Math.max(payloadFloat, valueFloat))); } else { return new BytesRef(PayloadHelper.encodeFloat(Float.parseFloat(value))); } } else { return payload; } }
[ "private", "BytesRef", "computeMaximumFilteredPayload", "(", "String", "value", ",", "BytesRef", "payload", ",", "String", "filter", ")", "{", "// do magic with filter", "if", "(", "value", "!=", "null", ")", "{", "if", "(", "payload", "!=", "null", ")", "{", "Float", "payloadFloat", "=", "PayloadHelper", ".", "decodeFloat", "(", "payload", ".", "bytes", ",", "payload", ".", "offset", ")", ";", "Float", "valueFloat", "=", "Float", ".", "parseFloat", "(", "value", ")", ";", "return", "new", "BytesRef", "(", "PayloadHelper", ".", "encodeFloat", "(", "Math", ".", "max", "(", "payloadFloat", ",", "valueFloat", ")", ")", ")", ";", "}", "else", "{", "return", "new", "BytesRef", "(", "PayloadHelper", ".", "encodeFloat", "(", "Float", ".", "parseFloat", "(", "value", ")", ")", ")", ";", "}", "}", "else", "{", "return", "payload", ";", "}", "}" ]
Compute maximum filtered payload. @param value the value @param payload the payload @param filter the filter @return the bytes ref
[ "Compute", "maximum", "filtered", "payload", "." ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/parser/MtasBasicParser.java#L1548-L1564
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/ie/EntityCachingAbstractSequencePrior.java
EntityCachingAbstractSequencePrior.otherOccurrences
public int[] otherOccurrences(Entity entity){ List<Integer> other = new ArrayList<Integer>(); for (int i = 0; i < doc.size(); i++) { if (i == entity.startPosition) { continue; } if (matches(entity, i)) { other.add(Integer.valueOf(i)); } } return toArray(other); }
java
public int[] otherOccurrences(Entity entity){ List<Integer> other = new ArrayList<Integer>(); for (int i = 0; i < doc.size(); i++) { if (i == entity.startPosition) { continue; } if (matches(entity, i)) { other.add(Integer.valueOf(i)); } } return toArray(other); }
[ "public", "int", "[", "]", "otherOccurrences", "(", "Entity", "entity", ")", "{", "List", "<", "Integer", ">", "other", "=", "new", "ArrayList", "<", "Integer", ">", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "doc", ".", "size", "(", ")", ";", "i", "++", ")", "{", "if", "(", "i", "==", "entity", ".", "startPosition", ")", "{", "continue", ";", "}", "if", "(", "matches", "(", "entity", ",", "i", ")", ")", "{", "other", ".", "add", "(", "Integer", ".", "valueOf", "(", "i", ")", ")", ";", "}", "}", "return", "toArray", "(", "other", ")", ";", "}" ]
finds other locations in the sequence where the sequence of words in this entity occurs.
[ "finds", "other", "locations", "in", "the", "sequence", "where", "the", "sequence", "of", "words", "in", "this", "entity", "occurs", "." ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/ie/EntityCachingAbstractSequencePrior.java#L146-L155
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/transform/transformpolicylabel_binding.java
transformpolicylabel_binding.get
public static transformpolicylabel_binding get(nitro_service service, String labelname) throws Exception{ transformpolicylabel_binding obj = new transformpolicylabel_binding(); obj.set_labelname(labelname); transformpolicylabel_binding response = (transformpolicylabel_binding) obj.get_resource(service); return response; }
java
public static transformpolicylabel_binding get(nitro_service service, String labelname) throws Exception{ transformpolicylabel_binding obj = new transformpolicylabel_binding(); obj.set_labelname(labelname); transformpolicylabel_binding response = (transformpolicylabel_binding) obj.get_resource(service); return response; }
[ "public", "static", "transformpolicylabel_binding", "get", "(", "nitro_service", "service", ",", "String", "labelname", ")", "throws", "Exception", "{", "transformpolicylabel_binding", "obj", "=", "new", "transformpolicylabel_binding", "(", ")", ";", "obj", ".", "set_labelname", "(", "labelname", ")", ";", "transformpolicylabel_binding", "response", "=", "(", "transformpolicylabel_binding", ")", "obj", ".", "get_resource", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch transformpolicylabel_binding resource of given name .
[ "Use", "this", "API", "to", "fetch", "transformpolicylabel_binding", "resource", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/transform/transformpolicylabel_binding.java#L120-L125
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nshttpparam.java
nshttpparam.update
public static base_response update(nitro_service client, nshttpparam resource) throws Exception { nshttpparam updateresource = new nshttpparam(); updateresource.dropinvalreqs = resource.dropinvalreqs; updateresource.markhttp09inval = resource.markhttp09inval; updateresource.markconnreqinval = resource.markconnreqinval; updateresource.insnssrvrhdr = resource.insnssrvrhdr; updateresource.nssrvrhdr = resource.nssrvrhdr; updateresource.logerrresp = resource.logerrresp; updateresource.conmultiplex = resource.conmultiplex; updateresource.maxreusepool = resource.maxreusepool; return updateresource.update_resource(client); }
java
public static base_response update(nitro_service client, nshttpparam resource) throws Exception { nshttpparam updateresource = new nshttpparam(); updateresource.dropinvalreqs = resource.dropinvalreqs; updateresource.markhttp09inval = resource.markhttp09inval; updateresource.markconnreqinval = resource.markconnreqinval; updateresource.insnssrvrhdr = resource.insnssrvrhdr; updateresource.nssrvrhdr = resource.nssrvrhdr; updateresource.logerrresp = resource.logerrresp; updateresource.conmultiplex = resource.conmultiplex; updateresource.maxreusepool = resource.maxreusepool; return updateresource.update_resource(client); }
[ "public", "static", "base_response", "update", "(", "nitro_service", "client", ",", "nshttpparam", "resource", ")", "throws", "Exception", "{", "nshttpparam", "updateresource", "=", "new", "nshttpparam", "(", ")", ";", "updateresource", ".", "dropinvalreqs", "=", "resource", ".", "dropinvalreqs", ";", "updateresource", ".", "markhttp09inval", "=", "resource", ".", "markhttp09inval", ";", "updateresource", ".", "markconnreqinval", "=", "resource", ".", "markconnreqinval", ";", "updateresource", ".", "insnssrvrhdr", "=", "resource", ".", "insnssrvrhdr", ";", "updateresource", ".", "nssrvrhdr", "=", "resource", ".", "nssrvrhdr", ";", "updateresource", ".", "logerrresp", "=", "resource", ".", "logerrresp", ";", "updateresource", ".", "conmultiplex", "=", "resource", ".", "conmultiplex", ";", "updateresource", ".", "maxreusepool", "=", "resource", ".", "maxreusepool", ";", "return", "updateresource", ".", "update_resource", "(", "client", ")", ";", "}" ]
Use this API to update nshttpparam.
[ "Use", "this", "API", "to", "update", "nshttpparam", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nshttpparam.java#L236-L247
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nshttpparam.java
nshttpparam.unset
public static base_response unset(nitro_service client, nshttpparam resource, String[] args) throws Exception{ nshttpparam unsetresource = new nshttpparam(); return unsetresource.unset_resource(client,args); }
java
public static base_response unset(nitro_service client, nshttpparam resource, String[] args) throws Exception{ nshttpparam unsetresource = new nshttpparam(); return unsetresource.unset_resource(client,args); }
[ "public", "static", "base_response", "unset", "(", "nitro_service", "client", ",", "nshttpparam", "resource", ",", "String", "[", "]", "args", ")", "throws", "Exception", "{", "nshttpparam", "unsetresource", "=", "new", "nshttpparam", "(", ")", ";", "return", "unsetresource", ".", "unset_resource", "(", "client", ",", "args", ")", ";", "}" ]
Use this API to unset the properties of nshttpparam resource. Properties that need to be unset are specified in args array.
[ "Use", "this", "API", "to", "unset", "the", "properties", "of", "nshttpparam", "resource", ".", "Properties", "that", "need", "to", "be", "unset", "are", "specified", "in", "args", "array", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nshttpparam.java#L253-L256
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nshttpparam.java
nshttpparam.get
public static nshttpparam get(nitro_service service) throws Exception{ nshttpparam obj = new nshttpparam(); nshttpparam[] response = (nshttpparam[])obj.get_resources(service); return response[0]; }
java
public static nshttpparam get(nitro_service service) throws Exception{ nshttpparam obj = new nshttpparam(); nshttpparam[] response = (nshttpparam[])obj.get_resources(service); return response[0]; }
[ "public", "static", "nshttpparam", "get", "(", "nitro_service", "service", ")", "throws", "Exception", "{", "nshttpparam", "obj", "=", "new", "nshttpparam", "(", ")", ";", "nshttpparam", "[", "]", "response", "=", "(", "nshttpparam", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", "[", "0", "]", ";", "}" ]
Use this API to fetch all the nshttpparam resources that are configured on netscaler.
[ "Use", "this", "API", "to", "fetch", "all", "the", "nshttpparam", "resources", "that", "are", "configured", "on", "netscaler", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nshttpparam.java#L261-L265
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/stats/IntCounter.java
IntCounter.getMapFactory
public MapFactory<E, MutableInteger> getMapFactory() { return ErasureUtils.<MapFactory<E,MutableInteger>>uncheckedCast(mapFactory); }
java
public MapFactory<E, MutableInteger> getMapFactory() { return ErasureUtils.<MapFactory<E,MutableInteger>>uncheckedCast(mapFactory); }
[ "public", "MapFactory", "<", "E", ",", "MutableInteger", ">", "getMapFactory", "(", ")", "{", "return", "ErasureUtils", ".", "<", "MapFactory", "<", "E", ",", "MutableInteger", ">", ">", "uncheckedCast", "(", "mapFactory", ")", ";", "}" ]
STANDARD ACCESS MODIFICATION METHODS
[ "STANDARD", "ACCESS", "MODIFICATION", "METHODS" ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/IntCounter.java#L86-L88
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/stats/IntCounter.java
IntCounter.remove
public double remove(E key) { totalCount -= getCount(key); // subtract removed count from total (may be 0) MutableInteger val = map.remove(key); if (val == null) { return Double.NaN; } else { return val.doubleValue(); } }
java
public double remove(E key) { totalCount -= getCount(key); // subtract removed count from total (may be 0) MutableInteger val = map.remove(key); if (val == null) { return Double.NaN; } else { return val.doubleValue(); } }
[ "public", "double", "remove", "(", "E", "key", ")", "{", "totalCount", "-=", "getCount", "(", "key", ")", ";", "// subtract removed count from total (may be 0)\r", "MutableInteger", "val", "=", "map", ".", "remove", "(", "key", ")", ";", "if", "(", "val", "==", "null", ")", "{", "return", "Double", ".", "NaN", ";", "}", "else", "{", "return", "val", ".", "doubleValue", "(", ")", ";", "}", "}" ]
Removes the given key from this Counter. Its count will now be 0 and it will no longer be considered previously seen.
[ "Removes", "the", "given", "key", "from", "this", "Counter", ".", "Its", "count", "will", "now", "be", "0", "and", "it", "will", "no", "longer", "be", "considered", "previously", "seen", "." ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/IntCounter.java#L397-L405
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/stats/IntCounter.java
IntCounter.entrySet
public Set<Map.Entry<E,Double>> entrySet() { return new AbstractSet<Map.Entry<E,Double>>() { @Override public Iterator<Entry<E, Double>> iterator() { return new Iterator<Entry<E,Double>>() { final Iterator<Entry<E,MutableInteger>> inner = map.entrySet().iterator(); public boolean hasNext() { return inner.hasNext(); } public Entry<E, Double> next() { return new Map.Entry<E,Double>() { final Entry<E,MutableInteger> e = inner.next(); public E getKey() { return e.getKey(); } public Double getValue() { return e.getValue().doubleValue(); } public Double setValue(Double value) { final double old = e.getValue().doubleValue(); e.getValue().set(value.intValue()); totalCount = totalCount - (int)old + value.intValue(); return old; } }; } public void remove() { throw new UnsupportedOperationException(); } }; } @Override public int size() { return map.size(); } }; }
java
public Set<Map.Entry<E,Double>> entrySet() { return new AbstractSet<Map.Entry<E,Double>>() { @Override public Iterator<Entry<E, Double>> iterator() { return new Iterator<Entry<E,Double>>() { final Iterator<Entry<E,MutableInteger>> inner = map.entrySet().iterator(); public boolean hasNext() { return inner.hasNext(); } public Entry<E, Double> next() { return new Map.Entry<E,Double>() { final Entry<E,MutableInteger> e = inner.next(); public E getKey() { return e.getKey(); } public Double getValue() { return e.getValue().doubleValue(); } public Double setValue(Double value) { final double old = e.getValue().doubleValue(); e.getValue().set(value.intValue()); totalCount = totalCount - (int)old + value.intValue(); return old; } }; } public void remove() { throw new UnsupportedOperationException(); } }; } @Override public int size() { return map.size(); } }; }
[ "public", "Set", "<", "Map", ".", "Entry", "<", "E", ",", "Double", ">", ">", "entrySet", "(", ")", "{", "return", "new", "AbstractSet", "<", "Map", ".", "Entry", "<", "E", ",", "Double", ">", ">", "(", ")", "{", "@", "Override", "public", "Iterator", "<", "Entry", "<", "E", ",", "Double", ">", ">", "iterator", "(", ")", "{", "return", "new", "Iterator", "<", "Entry", "<", "E", ",", "Double", ">", ">", "(", ")", "{", "final", "Iterator", "<", "Entry", "<", "E", ",", "MutableInteger", ">", ">", "inner", "=", "map", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "public", "boolean", "hasNext", "(", ")", "{", "return", "inner", ".", "hasNext", "(", ")", ";", "}", "public", "Entry", "<", "E", ",", "Double", ">", "next", "(", ")", "{", "return", "new", "Map", ".", "Entry", "<", "E", ",", "Double", ">", "(", ")", "{", "final", "Entry", "<", "E", ",", "MutableInteger", ">", "e", "=", "inner", ".", "next", "(", ")", ";", "public", "E", "getKey", "(", ")", "{", "return", "e", ".", "getKey", "(", ")", ";", "}", "public", "Double", "getValue", "(", ")", "{", "return", "e", ".", "getValue", "(", ")", ".", "doubleValue", "(", ")", ";", "}", "public", "Double", "setValue", "(", "Double", "value", ")", "{", "final", "double", "old", "=", "e", ".", "getValue", "(", ")", ".", "doubleValue", "(", ")", ";", "e", ".", "getValue", "(", ")", ".", "set", "(", "value", ".", "intValue", "(", ")", ")", ";", "totalCount", "=", "totalCount", "-", "(", "int", ")", "old", "+", "value", ".", "intValue", "(", ")", ";", "return", "old", ";", "}", "}", ";", "}", "public", "void", "remove", "(", ")", "{", "throw", "new", "UnsupportedOperationException", "(", ")", ";", "}", "}", ";", "}", "@", "Override", "public", "int", "size", "(", ")", "{", "return", "map", ".", "size", "(", ")", ";", "}", "}", ";", "}" ]
Returns a view of the doubles in this map. Can be safely modified.
[ "Returns", "a", "view", "of", "the", "doubles", "in", "this", "map", ".", "Can", "be", "safely", "modified", "." ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/IntCounter.java#L439-L482
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/stats/IntCounter.java
IntCounter.max
public int max() { int max = Integer.MIN_VALUE; for (E key : map.keySet()) { max = Math.max(max, getIntCount(key)); } return max; }
java
public int max() { int max = Integer.MIN_VALUE; for (E key : map.keySet()) { max = Math.max(max, getIntCount(key)); } return max; }
[ "public", "int", "max", "(", ")", "{", "int", "max", "=", "Integer", ".", "MIN_VALUE", ";", "for", "(", "E", "key", ":", "map", ".", "keySet", "(", ")", ")", "{", "max", "=", "Math", ".", "max", "(", "max", ",", "getIntCount", "(", "key", ")", ")", ";", "}", "return", "max", ";", "}" ]
Finds and returns the largest count in this Counter.
[ "Finds", "and", "returns", "the", "largest", "count", "in", "this", "Counter", "." ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/IntCounter.java#L586-L592
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/stats/IntCounter.java
IntCounter.min
public int min() { int min = Integer.MAX_VALUE; for (E key : map.keySet()) { min = Math.min(min, getIntCount(key)); } return min; }
java
public int min() { int min = Integer.MAX_VALUE; for (E key : map.keySet()) { min = Math.min(min, getIntCount(key)); } return min; }
[ "public", "int", "min", "(", ")", "{", "int", "min", "=", "Integer", ".", "MAX_VALUE", ";", "for", "(", "E", "key", ":", "map", ".", "keySet", "(", ")", ")", "{", "min", "=", "Math", ".", "min", "(", "min", ",", "getIntCount", "(", "key", ")", ")", ";", "}", "return", "min", ";", "}" ]
Finds and returns the smallest count in this Counter.
[ "Finds", "and", "returns", "the", "smallest", "count", "in", "this", "Counter", "." ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/IntCounter.java#L601-L607
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/stats/IntCounter.java
IntCounter.argmax
public E argmax(Comparator<E> tieBreaker) { int max = Integer.MIN_VALUE; E argmax = null; for (E key : keySet()) { int count = getIntCount(key); if (argmax == null || count > max || (count == max && tieBreaker.compare(key, argmax) < 0)) { max = count; argmax = key; } } return argmax; }
java
public E argmax(Comparator<E> tieBreaker) { int max = Integer.MIN_VALUE; E argmax = null; for (E key : keySet()) { int count = getIntCount(key); if (argmax == null || count > max || (count == max && tieBreaker.compare(key, argmax) < 0)) { max = count; argmax = key; } } return argmax; }
[ "public", "E", "argmax", "(", "Comparator", "<", "E", ">", "tieBreaker", ")", "{", "int", "max", "=", "Integer", ".", "MIN_VALUE", ";", "E", "argmax", "=", "null", ";", "for", "(", "E", "key", ":", "keySet", "(", ")", ")", "{", "int", "count", "=", "getIntCount", "(", "key", ")", ";", "if", "(", "argmax", "==", "null", "||", "count", ">", "max", "||", "(", "count", "==", "max", "&&", "tieBreaker", ".", "compare", "(", "key", ",", "argmax", ")", "<", "0", ")", ")", "{", "max", "=", "count", ";", "argmax", "=", "key", ";", "}", "}", "return", "argmax", ";", "}" ]
Finds and returns the key in this Counter with the largest count. Ties are broken by comparing the objects using the given tie breaking Comparator, favoring Objects that are sorted to the front. This is useful if the keys are numeric and there is a bias to prefer smaller or larger values, and can be useful in other circumstances where random tie-breaking is not desirable. Returns null if this Counter is empty.
[ "Finds", "and", "returns", "the", "key", "in", "this", "Counter", "with", "the", "largest", "count", ".", "Ties", "are", "broken", "by", "comparing", "the", "objects", "using", "the", "given", "tie", "breaking", "Comparator", "favoring", "Objects", "that", "are", "sorted", "to", "the", "front", ".", "This", "is", "useful", "if", "the", "keys", "are", "numeric", "and", "there", "is", "a", "bias", "to", "prefer", "smaller", "or", "larger", "values", "and", "can", "be", "useful", "in", "other", "circumstances", "where", "random", "tie", "-", "breaking", "is", "not", "desirable", ".", "Returns", "null", "if", "this", "Counter", "is", "empty", "." ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/IntCounter.java#L617-L628
train
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/stats/IntCounter.java
IntCounter.argmin
public E argmin(Comparator<E> tieBreaker) { int min = Integer.MAX_VALUE; E argmin = null; for (E key : map.keySet()) { int count = getIntCount(key); if (argmin == null || count < min || (count == min && tieBreaker.compare(key, argmin) < 0)) { min = count; argmin = key; } } return argmin; }
java
public E argmin(Comparator<E> tieBreaker) { int min = Integer.MAX_VALUE; E argmin = null; for (E key : map.keySet()) { int count = getIntCount(key); if (argmin == null || count < min || (count == min && tieBreaker.compare(key, argmin) < 0)) { min = count; argmin = key; } } return argmin; }
[ "public", "E", "argmin", "(", "Comparator", "<", "E", ">", "tieBreaker", ")", "{", "int", "min", "=", "Integer", ".", "MAX_VALUE", ";", "E", "argmin", "=", "null", ";", "for", "(", "E", "key", ":", "map", ".", "keySet", "(", ")", ")", "{", "int", "count", "=", "getIntCount", "(", "key", ")", ";", "if", "(", "argmin", "==", "null", "||", "count", "<", "min", "||", "(", "count", "==", "min", "&&", "tieBreaker", ".", "compare", "(", "key", ",", "argmin", ")", "<", "0", ")", ")", "{", "min", "=", "count", ";", "argmin", "=", "key", ";", "}", "}", "return", "argmin", ";", "}" ]
Finds and returns the key in this Counter with the smallest count. Ties are broken by comparing the objects using the given tie breaking Comparator, favoring Objects that are sorted to the front. This is useful if the keys are numeric and there is a bias to prefer smaller or larger values, and can be useful in other circumstances where random tie-breaking is not desirable. Returns null if this Counter is empty.
[ "Finds", "and", "returns", "the", "key", "in", "this", "Counter", "with", "the", "smallest", "count", ".", "Ties", "are", "broken", "by", "comparing", "the", "objects", "using", "the", "given", "tie", "breaking", "Comparator", "favoring", "Objects", "that", "are", "sorted", "to", "the", "front", ".", "This", "is", "useful", "if", "the", "keys", "are", "numeric", "and", "there", "is", "a", "bias", "to", "prefer", "smaller", "or", "larger", "values", "and", "can", "be", "useful", "in", "other", "circumstances", "where", "random", "tie", "-", "breaking", "is", "not", "desirable", ".", "Returns", "null", "if", "this", "Counter", "is", "empty", "." ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/IntCounter.java#L650-L661
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/system/systembackup.java
systembackup.create
public static base_response create(nitro_service client, systembackup resource) throws Exception { systembackup createresource = new systembackup(); createresource.filename = resource.filename; createresource.level = resource.level; createresource.comment = resource.comment; return createresource.perform_operation(client,"create"); }
java
public static base_response create(nitro_service client, systembackup resource) throws Exception { systembackup createresource = new systembackup(); createresource.filename = resource.filename; createresource.level = resource.level; createresource.comment = resource.comment; return createresource.perform_operation(client,"create"); }
[ "public", "static", "base_response", "create", "(", "nitro_service", "client", ",", "systembackup", "resource", ")", "throws", "Exception", "{", "systembackup", "createresource", "=", "new", "systembackup", "(", ")", ";", "createresource", ".", "filename", "=", "resource", ".", "filename", ";", "createresource", ".", "level", "=", "resource", ".", "level", ";", "createresource", ".", "comment", "=", "resource", ".", "comment", ";", "return", "createresource", ".", "perform_operation", "(", "client", ",", "\"create\"", ")", ";", "}" ]
Use this API to create systembackup.
[ "Use", "this", "API", "to", "create", "systembackup", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/system/systembackup.java#L184-L190
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/system/systembackup.java
systembackup.create
public static base_responses create(nitro_service client, systembackup resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { systembackup createresources[] = new systembackup[resources.length]; for (int i=0;i<resources.length;i++){ createresources[i] = new systembackup(); createresources[i].filename = resources[i].filename; createresources[i].level = resources[i].level; createresources[i].comment = resources[i].comment; } result = perform_operation_bulk_request(client, createresources,"create"); } return result; }
java
public static base_responses create(nitro_service client, systembackup resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { systembackup createresources[] = new systembackup[resources.length]; for (int i=0;i<resources.length;i++){ createresources[i] = new systembackup(); createresources[i].filename = resources[i].filename; createresources[i].level = resources[i].level; createresources[i].comment = resources[i].comment; } result = perform_operation_bulk_request(client, createresources,"create"); } return result; }
[ "public", "static", "base_responses", "create", "(", "nitro_service", "client", ",", "systembackup", "resources", "[", "]", ")", "throws", "Exception", "{", "base_responses", "result", "=", "null", ";", "if", "(", "resources", "!=", "null", "&&", "resources", ".", "length", ">", "0", ")", "{", "systembackup", "createresources", "[", "]", "=", "new", "systembackup", "[", "resources", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "resources", ".", "length", ";", "i", "++", ")", "{", "createresources", "[", "i", "]", "=", "new", "systembackup", "(", ")", ";", "createresources", "[", "i", "]", ".", "filename", "=", "resources", "[", "i", "]", ".", "filename", ";", "createresources", "[", "i", "]", ".", "level", "=", "resources", "[", "i", "]", ".", "level", ";", "createresources", "[", "i", "]", ".", "comment", "=", "resources", "[", "i", "]", ".", "comment", ";", "}", "result", "=", "perform_operation_bulk_request", "(", "client", ",", "createresources", ",", "\"create\"", ")", ";", "}", "return", "result", ";", "}" ]
Use this API to create systembackup resources.
[ "Use", "this", "API", "to", "create", "systembackup", "resources", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/system/systembackup.java#L195-L208
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/system/systembackup.java
systembackup.restore
public static base_response restore(nitro_service client, systembackup resource) throws Exception { systembackup restoreresource = new systembackup(); restoreresource.filename = resource.filename; return restoreresource.perform_operation(client,"restore"); }
java
public static base_response restore(nitro_service client, systembackup resource) throws Exception { systembackup restoreresource = new systembackup(); restoreresource.filename = resource.filename; return restoreresource.perform_operation(client,"restore"); }
[ "public", "static", "base_response", "restore", "(", "nitro_service", "client", ",", "systembackup", "resource", ")", "throws", "Exception", "{", "systembackup", "restoreresource", "=", "new", "systembackup", "(", ")", ";", "restoreresource", ".", "filename", "=", "resource", ".", "filename", ";", "return", "restoreresource", ".", "perform_operation", "(", "client", ",", "\"restore\"", ")", ";", "}" ]
Use this API to restore systembackup.
[ "Use", "this", "API", "to", "restore", "systembackup", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/system/systembackup.java#L213-L217
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/system/systembackup.java
systembackup.restore
public static base_responses restore(nitro_service client, systembackup resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { systembackup restoreresources[] = new systembackup[resources.length]; for (int i=0;i<resources.length;i++){ restoreresources[i] = new systembackup(); restoreresources[i].filename = resources[i].filename; } result = perform_operation_bulk_request(client, restoreresources,"restore"); } return result; }
java
public static base_responses restore(nitro_service client, systembackup resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { systembackup restoreresources[] = new systembackup[resources.length]; for (int i=0;i<resources.length;i++){ restoreresources[i] = new systembackup(); restoreresources[i].filename = resources[i].filename; } result = perform_operation_bulk_request(client, restoreresources,"restore"); } return result; }
[ "public", "static", "base_responses", "restore", "(", "nitro_service", "client", ",", "systembackup", "resources", "[", "]", ")", "throws", "Exception", "{", "base_responses", "result", "=", "null", ";", "if", "(", "resources", "!=", "null", "&&", "resources", ".", "length", ">", "0", ")", "{", "systembackup", "restoreresources", "[", "]", "=", "new", "systembackup", "[", "resources", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "resources", ".", "length", ";", "i", "++", ")", "{", "restoreresources", "[", "i", "]", "=", "new", "systembackup", "(", ")", ";", "restoreresources", "[", "i", "]", ".", "filename", "=", "resources", "[", "i", "]", ".", "filename", ";", "}", "result", "=", "perform_operation_bulk_request", "(", "client", ",", "restoreresources", ",", "\"restore\"", ")", ";", "}", "return", "result", ";", "}" ]
Use this API to restore systembackup resources.
[ "Use", "this", "API", "to", "restore", "systembackup", "resources", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/system/systembackup.java#L222-L233
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/system/systembackup.java
systembackup.delete
public static base_response delete(nitro_service client, String filename) throws Exception { systembackup deleteresource = new systembackup(); deleteresource.filename = filename; return deleteresource.delete_resource(client); }
java
public static base_response delete(nitro_service client, String filename) throws Exception { systembackup deleteresource = new systembackup(); deleteresource.filename = filename; return deleteresource.delete_resource(client); }
[ "public", "static", "base_response", "delete", "(", "nitro_service", "client", ",", "String", "filename", ")", "throws", "Exception", "{", "systembackup", "deleteresource", "=", "new", "systembackup", "(", ")", ";", "deleteresource", ".", "filename", "=", "filename", ";", "return", "deleteresource", ".", "delete_resource", "(", "client", ")", ";", "}" ]
Use this API to delete systembackup of given name.
[ "Use", "this", "API", "to", "delete", "systembackup", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/system/systembackup.java#L238-L242
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/system/systembackup.java
systembackup.delete
public static base_responses delete(nitro_service client, String filename[]) throws Exception { base_responses result = null; if (filename != null && filename.length > 0) { systembackup deleteresources[] = new systembackup[filename.length]; for (int i=0;i<filename.length;i++){ deleteresources[i] = new systembackup(); deleteresources[i].filename = filename[i]; } result = delete_bulk_request(client, deleteresources); } return result; }
java
public static base_responses delete(nitro_service client, String filename[]) throws Exception { base_responses result = null; if (filename != null && filename.length > 0) { systembackup deleteresources[] = new systembackup[filename.length]; for (int i=0;i<filename.length;i++){ deleteresources[i] = new systembackup(); deleteresources[i].filename = filename[i]; } result = delete_bulk_request(client, deleteresources); } return result; }
[ "public", "static", "base_responses", "delete", "(", "nitro_service", "client", ",", "String", "filename", "[", "]", ")", "throws", "Exception", "{", "base_responses", "result", "=", "null", ";", "if", "(", "filename", "!=", "null", "&&", "filename", ".", "length", ">", "0", ")", "{", "systembackup", "deleteresources", "[", "]", "=", "new", "systembackup", "[", "filename", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "filename", ".", "length", ";", "i", "++", ")", "{", "deleteresources", "[", "i", "]", "=", "new", "systembackup", "(", ")", ";", "deleteresources", "[", "i", "]", ".", "filename", "=", "filename", "[", "i", "]", ";", "}", "result", "=", "delete_bulk_request", "(", "client", ",", "deleteresources", ")", ";", "}", "return", "result", ";", "}" ]
Use this API to delete systembackup resources of given names.
[ "Use", "this", "API", "to", "delete", "systembackup", "resources", "of", "given", "names", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/system/systembackup.java#L256-L267
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/system/systembackup.java
systembackup.get
public static systembackup[] get(nitro_service service, options option) throws Exception{ systembackup obj = new systembackup(); systembackup[] response = (systembackup[])obj.get_resources(service,option); return response; }
java
public static systembackup[] get(nitro_service service, options option) throws Exception{ systembackup obj = new systembackup(); systembackup[] response = (systembackup[])obj.get_resources(service,option); return response; }
[ "public", "static", "systembackup", "[", "]", "get", "(", "nitro_service", "service", ",", "options", "option", ")", "throws", "Exception", "{", "systembackup", "obj", "=", "new", "systembackup", "(", ")", ";", "systembackup", "[", "]", "response", "=", "(", "systembackup", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ",", "option", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch all the systembackup resources that are configured on netscaler.
[ "Use", "this", "API", "to", "fetch", "all", "the", "systembackup", "resources", "that", "are", "configured", "on", "netscaler", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/system/systembackup.java#L296-L300
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/system/systembackup.java
systembackup.get
public static systembackup get(nitro_service service, String filename) throws Exception{ systembackup obj = new systembackup(); obj.set_filename(filename); systembackup response = (systembackup) obj.get_resource(service); return response; }
java
public static systembackup get(nitro_service service, String filename) throws Exception{ systembackup obj = new systembackup(); obj.set_filename(filename); systembackup response = (systembackup) obj.get_resource(service); return response; }
[ "public", "static", "systembackup", "get", "(", "nitro_service", "service", ",", "String", "filename", ")", "throws", "Exception", "{", "systembackup", "obj", "=", "new", "systembackup", "(", ")", ";", "obj", ".", "set_filename", "(", "filename", ")", ";", "systembackup", "response", "=", "(", "systembackup", ")", "obj", ".", "get_resource", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch systembackup resource of given name .
[ "Use", "this", "API", "to", "fetch", "systembackup", "resource", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/system/systembackup.java#L304-L309
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/system/systembackup.java
systembackup.get
public static systembackup[] get(nitro_service service, String filename[]) throws Exception{ if (filename !=null && filename.length>0) { systembackup response[] = new systembackup[filename.length]; systembackup obj[] = new systembackup[filename.length]; for (int i=0;i<filename.length;i++) { obj[i] = new systembackup(); obj[i].set_filename(filename[i]); response[i] = (systembackup) obj[i].get_resource(service); } return response; } return null; }
java
public static systembackup[] get(nitro_service service, String filename[]) throws Exception{ if (filename !=null && filename.length>0) { systembackup response[] = new systembackup[filename.length]; systembackup obj[] = new systembackup[filename.length]; for (int i=0;i<filename.length;i++) { obj[i] = new systembackup(); obj[i].set_filename(filename[i]); response[i] = (systembackup) obj[i].get_resource(service); } return response; } return null; }
[ "public", "static", "systembackup", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "filename", "[", "]", ")", "throws", "Exception", "{", "if", "(", "filename", "!=", "null", "&&", "filename", ".", "length", ">", "0", ")", "{", "systembackup", "response", "[", "]", "=", "new", "systembackup", "[", "filename", ".", "length", "]", ";", "systembackup", "obj", "[", "]", "=", "new", "systembackup", "[", "filename", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "filename", ".", "length", ";", "i", "++", ")", "{", "obj", "[", "i", "]", "=", "new", "systembackup", "(", ")", ";", "obj", "[", "i", "]", ".", "set_filename", "(", "filename", "[", "i", "]", ")", ";", "response", "[", "i", "]", "=", "(", "systembackup", ")", "obj", "[", "i", "]", ".", "get_resource", "(", "service", ")", ";", "}", "return", "response", ";", "}", "return", "null", ";", "}" ]
Use this API to fetch systembackup resources of given names .
[ "Use", "this", "API", "to", "fetch", "systembackup", "resources", "of", "given", "names", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/system/systembackup.java#L314-L326
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/filter/filterpolicy.java
filterpolicy.add
public static base_response add(nitro_service client, filterpolicy resource) throws Exception { filterpolicy addresource = new filterpolicy(); addresource.name = resource.name; addresource.rule = resource.rule; addresource.reqaction = resource.reqaction; addresource.resaction = resource.resaction; return addresource.add_resource(client); }
java
public static base_response add(nitro_service client, filterpolicy resource) throws Exception { filterpolicy addresource = new filterpolicy(); addresource.name = resource.name; addresource.rule = resource.rule; addresource.reqaction = resource.reqaction; addresource.resaction = resource.resaction; return addresource.add_resource(client); }
[ "public", "static", "base_response", "add", "(", "nitro_service", "client", ",", "filterpolicy", "resource", ")", "throws", "Exception", "{", "filterpolicy", "addresource", "=", "new", "filterpolicy", "(", ")", ";", "addresource", ".", "name", "=", "resource", ".", "name", ";", "addresource", ".", "rule", "=", "resource", ".", "rule", ";", "addresource", ".", "reqaction", "=", "resource", ".", "reqaction", ";", "addresource", ".", "resaction", "=", "resource", ".", "resaction", ";", "return", "addresource", ".", "add_resource", "(", "client", ")", ";", "}" ]
Use this API to add filterpolicy.
[ "Use", "this", "API", "to", "add", "filterpolicy", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/filter/filterpolicy.java#L167-L174
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/filter/filterpolicy.java
filterpolicy.update
public static base_response update(nitro_service client, filterpolicy resource) throws Exception { filterpolicy updateresource = new filterpolicy(); updateresource.name = resource.name; updateresource.rule = resource.rule; updateresource.reqaction = resource.reqaction; updateresource.resaction = resource.resaction; return updateresource.update_resource(client); }
java
public static base_response update(nitro_service client, filterpolicy resource) throws Exception { filterpolicy updateresource = new filterpolicy(); updateresource.name = resource.name; updateresource.rule = resource.rule; updateresource.reqaction = resource.reqaction; updateresource.resaction = resource.resaction; return updateresource.update_resource(client); }
[ "public", "static", "base_response", "update", "(", "nitro_service", "client", ",", "filterpolicy", "resource", ")", "throws", "Exception", "{", "filterpolicy", "updateresource", "=", "new", "filterpolicy", "(", ")", ";", "updateresource", ".", "name", "=", "resource", ".", "name", ";", "updateresource", ".", "rule", "=", "resource", ".", "rule", ";", "updateresource", ".", "reqaction", "=", "resource", ".", "reqaction", ";", "updateresource", ".", "resaction", "=", "resource", ".", "resaction", ";", "return", "updateresource", ".", "update_resource", "(", "client", ")", ";", "}" ]
Use this API to update filterpolicy.
[ "Use", "this", "API", "to", "update", "filterpolicy", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/filter/filterpolicy.java#L248-L255
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/filter/filterpolicy.java
filterpolicy.get
public static filterpolicy[] get(nitro_service service) throws Exception{ filterpolicy obj = new filterpolicy(); filterpolicy[] response = (filterpolicy[])obj.get_resources(service); return response; }
java
public static filterpolicy[] get(nitro_service service) throws Exception{ filterpolicy obj = new filterpolicy(); filterpolicy[] response = (filterpolicy[])obj.get_resources(service); return response; }
[ "public", "static", "filterpolicy", "[", "]", "get", "(", "nitro_service", "service", ")", "throws", "Exception", "{", "filterpolicy", "obj", "=", "new", "filterpolicy", "(", ")", ";", "filterpolicy", "[", "]", "response", "=", "(", "filterpolicy", "[", "]", ")", "obj", ".", "get_resources", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch all the filterpolicy resources that are configured on netscaler.
[ "Use", "this", "API", "to", "fetch", "all", "the", "filterpolicy", "resources", "that", "are", "configured", "on", "netscaler", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/filter/filterpolicy.java#L279-L283
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/filter/filterpolicy.java
filterpolicy.get
public static filterpolicy get(nitro_service service, String name) throws Exception{ filterpolicy obj = new filterpolicy(); obj.set_name(name); filterpolicy response = (filterpolicy) obj.get_resource(service); return response; }
java
public static filterpolicy get(nitro_service service, String name) throws Exception{ filterpolicy obj = new filterpolicy(); obj.set_name(name); filterpolicy response = (filterpolicy) obj.get_resource(service); return response; }
[ "public", "static", "filterpolicy", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "filterpolicy", "obj", "=", "new", "filterpolicy", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", "filterpolicy", "response", "=", "(", "filterpolicy", ")", "obj", ".", "get_resource", "(", "service", ")", ";", "return", "response", ";", "}" ]
Use this API to fetch filterpolicy resource of given name .
[ "Use", "this", "API", "to", "fetch", "filterpolicy", "resource", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/filter/filterpolicy.java#L295-L300
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/filter/filterpolicy.java
filterpolicy.get
public static filterpolicy[] get(nitro_service service, String name[]) throws Exception{ if (name !=null && name.length>0) { filterpolicy response[] = new filterpolicy[name.length]; filterpolicy obj[] = new filterpolicy[name.length]; for (int i=0;i<name.length;i++) { obj[i] = new filterpolicy(); obj[i].set_name(name[i]); response[i] = (filterpolicy) obj[i].get_resource(service); } return response; } return null; }
java
public static filterpolicy[] get(nitro_service service, String name[]) throws Exception{ if (name !=null && name.length>0) { filterpolicy response[] = new filterpolicy[name.length]; filterpolicy obj[] = new filterpolicy[name.length]; for (int i=0;i<name.length;i++) { obj[i] = new filterpolicy(); obj[i].set_name(name[i]); response[i] = (filterpolicy) obj[i].get_resource(service); } return response; } return null; }
[ "public", "static", "filterpolicy", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "name", "[", "]", ")", "throws", "Exception", "{", "if", "(", "name", "!=", "null", "&&", "name", ".", "length", ">", "0", ")", "{", "filterpolicy", "response", "[", "]", "=", "new", "filterpolicy", "[", "name", ".", "length", "]", ";", "filterpolicy", "obj", "[", "]", "=", "new", "filterpolicy", "[", "name", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "name", ".", "length", ";", "i", "++", ")", "{", "obj", "[", "i", "]", "=", "new", "filterpolicy", "(", ")", ";", "obj", "[", "i", "]", ".", "set_name", "(", "name", "[", "i", "]", ")", ";", "response", "[", "i", "]", "=", "(", "filterpolicy", ")", "obj", "[", "i", "]", ".", "get_resource", "(", "service", ")", ";", "}", "return", "response", ";", "}", "return", "null", ";", "}" ]
Use this API to fetch filterpolicy resources of given names .
[ "Use", "this", "API", "to", "fetch", "filterpolicy", "resources", "of", "given", "names", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/filter/filterpolicy.java#L305-L317
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnurl.java
vpnurl.add
public static base_response add(nitro_service client, vpnurl resource) throws Exception { vpnurl addresource = new vpnurl(); addresource.urlname = resource.urlname; addresource.linkname = resource.linkname; addresource.actualurl = resource.actualurl; addresource.clientlessaccess = resource.clientlessaccess; addresource.comment = resource.comment; return addresource.add_resource(client); }
java
public static base_response add(nitro_service client, vpnurl resource) throws Exception { vpnurl addresource = new vpnurl(); addresource.urlname = resource.urlname; addresource.linkname = resource.linkname; addresource.actualurl = resource.actualurl; addresource.clientlessaccess = resource.clientlessaccess; addresource.comment = resource.comment; return addresource.add_resource(client); }
[ "public", "static", "base_response", "add", "(", "nitro_service", "client", ",", "vpnurl", "resource", ")", "throws", "Exception", "{", "vpnurl", "addresource", "=", "new", "vpnurl", "(", ")", ";", "addresource", ".", "urlname", "=", "resource", ".", "urlname", ";", "addresource", ".", "linkname", "=", "resource", ".", "linkname", ";", "addresource", ".", "actualurl", "=", "resource", ".", "actualurl", ";", "addresource", ".", "clientlessaccess", "=", "resource", ".", "clientlessaccess", ";", "addresource", ".", "comment", "=", "resource", ".", "comment", ";", "return", "addresource", ".", "add_resource", "(", "client", ")", ";", "}" ]
Use this API to add vpnurl.
[ "Use", "this", "API", "to", "add", "vpnurl", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnurl.java#L169-L177
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnurl.java
vpnurl.add
public static base_responses add(nitro_service client, vpnurl resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { vpnurl addresources[] = new vpnurl[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new vpnurl(); addresources[i].urlname = resources[i].urlname; addresources[i].linkname = resources[i].linkname; addresources[i].actualurl = resources[i].actualurl; addresources[i].clientlessaccess = resources[i].clientlessaccess; addresources[i].comment = resources[i].comment; } result = add_bulk_request(client, addresources); } return result; }
java
public static base_responses add(nitro_service client, vpnurl resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { vpnurl addresources[] = new vpnurl[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new vpnurl(); addresources[i].urlname = resources[i].urlname; addresources[i].linkname = resources[i].linkname; addresources[i].actualurl = resources[i].actualurl; addresources[i].clientlessaccess = resources[i].clientlessaccess; addresources[i].comment = resources[i].comment; } result = add_bulk_request(client, addresources); } return result; }
[ "public", "static", "base_responses", "add", "(", "nitro_service", "client", ",", "vpnurl", "resources", "[", "]", ")", "throws", "Exception", "{", "base_responses", "result", "=", "null", ";", "if", "(", "resources", "!=", "null", "&&", "resources", ".", "length", ">", "0", ")", "{", "vpnurl", "addresources", "[", "]", "=", "new", "vpnurl", "[", "resources", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "resources", ".", "length", ";", "i", "++", ")", "{", "addresources", "[", "i", "]", "=", "new", "vpnurl", "(", ")", ";", "addresources", "[", "i", "]", ".", "urlname", "=", "resources", "[", "i", "]", ".", "urlname", ";", "addresources", "[", "i", "]", ".", "linkname", "=", "resources", "[", "i", "]", ".", "linkname", ";", "addresources", "[", "i", "]", ".", "actualurl", "=", "resources", "[", "i", "]", ".", "actualurl", ";", "addresources", "[", "i", "]", ".", "clientlessaccess", "=", "resources", "[", "i", "]", ".", "clientlessaccess", ";", "addresources", "[", "i", "]", ".", "comment", "=", "resources", "[", "i", "]", ".", "comment", ";", "}", "result", "=", "add_bulk_request", "(", "client", ",", "addresources", ")", ";", "}", "return", "result", ";", "}" ]
Use this API to add vpnurl resources.
[ "Use", "this", "API", "to", "add", "vpnurl", "resources", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnurl.java#L182-L197
train
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnurl.java
vpnurl.delete
public static base_response delete(nitro_service client, String urlname) throws Exception { vpnurl deleteresource = new vpnurl(); deleteresource.urlname = urlname; return deleteresource.delete_resource(client); }
java
public static base_response delete(nitro_service client, String urlname) throws Exception { vpnurl deleteresource = new vpnurl(); deleteresource.urlname = urlname; return deleteresource.delete_resource(client); }
[ "public", "static", "base_response", "delete", "(", "nitro_service", "client", ",", "String", "urlname", ")", "throws", "Exception", "{", "vpnurl", "deleteresource", "=", "new", "vpnurl", "(", ")", ";", "deleteresource", ".", "urlname", "=", "urlname", ";", "return", "deleteresource", ".", "delete_resource", "(", "client", ")", ";", "}" ]
Use this API to delete vpnurl of given name.
[ "Use", "this", "API", "to", "delete", "vpnurl", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnurl.java#L202-L206
train