code
stringlengths
73
34.1k
label
stringclasses
1 value
public DocumentReaderAndWriter<IN> makeReaderAndWriter() { DocumentReaderAndWriter<IN> readerAndWriter; try { readerAndWriter = ((DocumentReaderAndWriter<IN>) Class.forName(flags.readerAndWriter).newInstance()); } catch (Exception e) { throw new RuntimeException(String.format("Error loading flags.readerAndWriter: '%s'", flags.readerAndWriter), e); } readerAndWriter.init(flags); return readerAndWriter; }
java
public DocumentReaderAndWriter<IN> makePlainTextReaderAndWriter() { String readerClassName = flags.plainTextDocumentReaderAndWriter; // We set this default here if needed because there may be models // which don't have the reader flag set if (readerClassName == null) { readerClassName = SeqClassifierFlags.DEFAULT_PLAIN_TEXT_READER; } DocumentReaderAndWriter<IN> readerAndWriter; try { readerAndWriter = ((DocumentReaderAndWriter<IN>) Class.forName(readerClassName).newInstance()); } catch (Exception e) { throw new RuntimeException(String.format("Error loading flags.plainTextDocumentReaderAndWriter: '%s'", flags.plainTextDocumentReaderAndWriter), e); } readerAndWriter.init(flags); return readerAndWriter; }
java
public List<List<IN>> classify(String str) { ObjectBank<List<IN>> documents = makeObjectBankFromString(str, plainTextReaderAndWriter); List<List<IN>> result = new ArrayList<List<IN>>(); for (List<IN> document : documents) { classify(document); List<IN> sentence = new ArrayList<IN>(); for (IN wi : document) { // TaggedWord word = new TaggedWord(wi.word(), wi.answer()); // sentence.add(word); sentence.add(wi); } result.add(sentence); } return result; }
java
public List<List<IN>> classifyRaw(String str, DocumentReaderAndWriter<IN> readerAndWriter) { ObjectBank<List<IN>> documents = makeObjectBankFromString(str, readerAndWriter); List<List<IN>> result = new ArrayList<List<IN>>(); for (List<IN> document : documents) { classify(document); List<IN> sentence = new ArrayList<IN>(); for (IN wi : document) { // TaggedWord word = new TaggedWord(wi.word(), wi.answer()); // sentence.add(word); sentence.add(wi); } result.add(sentence); } return result; }
java
public List<List<IN>> classifyFile(String filename) { ObjectBank<List<IN>> documents = makeObjectBankFromFile(filename, plainTextReaderAndWriter); List<List<IN>> result = new ArrayList<List<IN>>(); for (List<IN> document : documents) { // System.err.println(document); classify(document); List<IN> sentence = new ArrayList<IN>(); for (IN wi : document) { sentence.add(wi); // System.err.println(wi); } result.add(sentence); } return result; }
java
public void printProbs(String filename, DocumentReaderAndWriter<IN> readerAndWriter) { // only for the OCR data does this matter flags.ocrTrain = false; ObjectBank<List<IN>> docs = makeObjectBankFromFile(filename, readerAndWriter); printProbsDocuments(docs); }
java
public boolean classifyDocumentStdin(DocumentReaderAndWriter<IN> readerWriter) throws IOException { BufferedReader is = new BufferedReader(new InputStreamReader(System.in, flags.inputEncoding)); String line; String text = ""; String eol = "\n"; String sentence = "<s>"; int blankLines = 0; while ((line = is.readLine()) != null) { if (line.trim().equals("")) { ++blankLines; if (blankLines > 3) { return false; } else if (blankLines > 2) { ObjectBank<List<IN>> documents = makeObjectBankFromString(text, readerWriter); classifyAndWriteAnswers(documents, readerWriter); text = ""; } else { text += sentence + eol; } } else { text += line + eol; blankLines = 0; } } // Classify last document before input stream end if (text.trim() != "") { ObjectBank<List<IN>> documents = makeObjectBankFromString(text, readerWriter); classifyAndWriteAnswers(documents, readerWriter); } return (line == null); // reached eol }
java
public boolean classifySentenceStdin(DocumentReaderAndWriter<IN> readerWriter) throws IOException { BufferedReader is = new BufferedReader(new InputStreamReader(System.in, flags.inputEncoding)); String line; String text = ""; String eol = "\n"; String sentence = "<s>"; while ((line = is.readLine()) != null) { if (line.trim().equals("")) { text += sentence + eol; ObjectBank<List<IN>> documents = makeObjectBankFromString(text, readerWriter); classifyAndWriteAnswers(documents, readerWriter); text = ""; } else { text += line + eol; } } if (text.trim().equals("")) { return false; } return true; }
java
public void classifyAndWriteViterbiSearchGraph(String testFile, String searchGraphPrefix, DocumentReaderAndWriter<IN> readerAndWriter) throws IOException { Timing timer = new Timing(); ObjectBank<List<IN>> documents = makeObjectBankFromFile(testFile, readerAndWriter); int numWords = 0; int numSentences = 0; for (List<IN> doc : documents) { DFSA<String, Integer> tagLattice = getViterbiSearchGraph(doc, AnswerAnnotation.class); numWords += doc.size(); PrintWriter latticeWriter = new PrintWriter(new FileOutputStream(searchGraphPrefix + '.' + numSentences + ".wlattice")); PrintWriter vsgWriter = new PrintWriter(new FileOutputStream(searchGraphPrefix + '.' + numSentences + ".lattice")); if (readerAndWriter instanceof LatticeWriter) ((LatticeWriter) readerAndWriter).printLattice(tagLattice, doc, latticeWriter); tagLattice.printAttFsmFormat(vsgWriter); latticeWriter.close(); vsgWriter.close(); numSentences++; } long millis = timer.stop(); double wordspersec = numWords / (((double) millis) / 1000); NumberFormat nf = new DecimalFormat("0.00"); // easier way! System.err.println(this.getClass().getName() + " tagged " + numWords + " words in " + numSentences + " documents at " + nf.format(wordspersec) + " words per second."); }
java
public void writeAnswers(List<IN> doc, PrintWriter printWriter, DocumentReaderAndWriter<IN> readerAndWriter) throws IOException { if (flags.lowerNewgeneThreshold) { return; } if (flags.numRuns <= 1) { readerAndWriter.printAnswers(doc, printWriter); // out.println(); printWriter.flush(); } }
java
public static void printResults(Counter<String> entityTP, Counter<String> entityFP, Counter<String> entityFN) { Set<String> entities = new TreeSet<String>(); entities.addAll(entityTP.keySet()); entities.addAll(entityFP.keySet()); entities.addAll(entityFN.keySet()); boolean printedHeader = false; for (String entity : entities) { double tp = entityTP.getCount(entity); double fp = entityFP.getCount(entity); double fn = entityFN.getCount(entity); printedHeader = printPRLine(entity, tp, fp, fn, printedHeader); } double tp = entityTP.totalCount(); double fp = entityFP.totalCount(); double fn = entityFN.totalCount(); printedHeader = printPRLine("Totals", tp, fp, fn, printedHeader); }
java
public void loadClassifier(InputStream in, Properties props) throws IOException, ClassCastException, ClassNotFoundException { loadClassifier(new ObjectInputStream(in), props); }
java
public void loadClassifier(String loadPath, Properties props) throws ClassCastException, IOException, ClassNotFoundException { InputStream is; // ms, 10-04-2010: check first is this path exists in our CLASSPATH. This // takes priority over the file system. if ((is = loadStreamFromClasspath(loadPath)) != null) { Timing.startDoing("Loading classifier from " + loadPath); loadClassifier(is); is.close(); Timing.endDoing(); } else { loadClassifier(new File(loadPath), props); } }
java
public void loadClassifier(File file, Properties props) throws ClassCastException, IOException, ClassNotFoundException { Timing.startDoing("Loading classifier from " + file.getAbsolutePath()); BufferedInputStream bis; if (file.getName().endsWith(".gz")) { bis = new BufferedInputStream(new GZIPInputStream(new FileInputStream(file))); } else { bis = new BufferedInputStream(new FileInputStream(file)); } loadClassifier(bis, props); bis.close(); Timing.endDoing(); }
java
protected void printFeatures(IN wi, Collection<String> features) { if (flags.printFeatures == null || writtenNum > flags.printFeaturesUpto) { return; } try { if (cliqueWriter == null) { cliqueWriter = new PrintWriter(new FileOutputStream("feats" + flags.printFeatures + ".txt"), true); writtenNum = 0; } } catch (Exception ioe) { throw new RuntimeException(ioe); } if (writtenNum >= flags.printFeaturesUpto) { return; } if (wi instanceof CoreLabel) { cliqueWriter.print(wi.get(TextAnnotation.class) + ' ' + wi.get(PartOfSpeechAnnotation.class) + ' ' + wi.get(CoreAnnotations.GoldAnswerAnnotation.class) + '\t'); } else { cliqueWriter.print(wi.get(CoreAnnotations.TextAnnotation.class) + wi.get(CoreAnnotations.GoldAnswerAnnotation.class) + '\t'); } boolean first = true; for (Object feat : features) { if (first) { first = false; } else { cliqueWriter.print(" "); } cliqueWriter.print(feat); } cliqueWriter.println(); writtenNum++; }
java
public static aaauser_intranetip_binding[] get(nitro_service service, String username) throws Exception{ aaauser_intranetip_binding obj = new aaauser_intranetip_binding(); obj.set_username(username); aaauser_intranetip_binding response[] = (aaauser_intranetip_binding[]) obj.get_resources(service); return response; }
java
public boolean find() { if (findIterator == null) { findIterator = root.iterator(); } if (findCurrent != null && matches()) { return true; } while (findIterator.hasNext()) { findCurrent = findIterator.next(); resetChildIter(findCurrent); if (matches()) { return true; } } return false; }
java
public static sslciphersuite[] get(nitro_service service, options option) throws Exception{ sslciphersuite obj = new sslciphersuite(); sslciphersuite[] response = (sslciphersuite[])obj.get_resources(service,option); return response; }
java
public static sslciphersuite get(nitro_service service, String ciphername) throws Exception{ sslciphersuite obj = new sslciphersuite(); obj.set_ciphername(ciphername); sslciphersuite response = (sslciphersuite) obj.get_resource(service); return response; }
java
public static sslciphersuite[] get(nitro_service service, String ciphername[]) throws Exception{ if (ciphername !=null && ciphername.length>0) { sslciphersuite response[] = new sslciphersuite[ciphername.length]; sslciphersuite obj[] = new sslciphersuite[ciphername.length]; for (int i=0;i<ciphername.length;i++) { obj[i] = new sslciphersuite(); obj[i].set_ciphername(ciphername[i]); response[i] = (sslciphersuite) obj[i].get_resource(service); } return response; } return null; }
java
public static sslcipher_individualcipher_binding[] get(nitro_service service, String ciphergroupname) throws Exception{ sslcipher_individualcipher_binding obj = new sslcipher_individualcipher_binding(); obj.set_ciphergroupname(ciphergroupname); sslcipher_individualcipher_binding response[] = (sslcipher_individualcipher_binding[]) obj.get_resources(service); return response; }
java
public static sslcipher_individualcipher_binding[] get_filtered(nitro_service service, String ciphergroupname, filtervalue[] filter) throws Exception{ sslcipher_individualcipher_binding obj = new sslcipher_individualcipher_binding(); obj.set_ciphergroupname(ciphergroupname); options option = new options(); option.set_filter(filter); sslcipher_individualcipher_binding[] response = (sslcipher_individualcipher_binding[]) obj.getfiltered(service, option); return response; }
java
public static long count(nitro_service service, String ciphergroupname) throws Exception{ sslcipher_individualcipher_binding obj = new sslcipher_individualcipher_binding(); obj.set_ciphergroupname(ciphergroupname); options option = new options(); option.set_count(true); sslcipher_individualcipher_binding response[] = (sslcipher_individualcipher_binding[]) obj.get_resources(service,option); if (response != null) { return response[0].__count; } return 0; }
java
public static base_response add(nitro_service client, inat resource) throws Exception { inat addresource = new inat(); addresource.name = resource.name; addresource.publicip = resource.publicip; addresource.privateip = resource.privateip; addresource.tcpproxy = resource.tcpproxy; addresource.ftp = resource.ftp; addresource.tftp = resource.tftp; addresource.usip = resource.usip; addresource.usnip = resource.usnip; addresource.proxyip = resource.proxyip; addresource.mode = resource.mode; addresource.td = resource.td; return addresource.add_resource(client); }
java
public static base_responses add(nitro_service client, inat resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { inat addresources[] = new inat[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new inat(); addresources[i].name = resources[i].name; addresources[i].publicip = resources[i].publicip; addresources[i].privateip = resources[i].privateip; addresources[i].tcpproxy = resources[i].tcpproxy; addresources[i].ftp = resources[i].ftp; addresources[i].tftp = resources[i].tftp; addresources[i].usip = resources[i].usip; addresources[i].usnip = resources[i].usnip; addresources[i].proxyip = resources[i].proxyip; addresources[i].mode = resources[i].mode; addresources[i].td = resources[i].td; } result = add_bulk_request(client, addresources); } return result; }
java
public static base_response update(nitro_service client, inat resource) throws Exception { inat updateresource = new inat(); updateresource.name = resource.name; updateresource.privateip = resource.privateip; updateresource.tcpproxy = resource.tcpproxy; updateresource.ftp = resource.ftp; updateresource.tftp = resource.tftp; updateresource.usip = resource.usip; updateresource.usnip = resource.usnip; updateresource.proxyip = resource.proxyip; updateresource.mode = resource.mode; return updateresource.update_resource(client); }
java
public static base_responses update(nitro_service client, inat resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { inat updateresources[] = new inat[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new inat(); updateresources[i].name = resources[i].name; updateresources[i].privateip = resources[i].privateip; updateresources[i].tcpproxy = resources[i].tcpproxy; updateresources[i].ftp = resources[i].ftp; updateresources[i].tftp = resources[i].tftp; updateresources[i].usip = resources[i].usip; updateresources[i].usnip = resources[i].usnip; updateresources[i].proxyip = resources[i].proxyip; updateresources[i].mode = resources[i].mode; } result = update_bulk_request(client, updateresources); } return result; }
java
public static inat[] get(nitro_service service) throws Exception{ inat obj = new inat(); inat[] response = (inat[])obj.get_resources(service); return response; }
java
public static inat get(nitro_service service, String name) throws Exception{ inat obj = new inat(); obj.set_name(name); inat response = (inat) obj.get_resource(service); return response; }
java
public static base_response add(nitro_service client, vpnclientlessaccesspolicy resource) throws Exception { vpnclientlessaccesspolicy addresource = new vpnclientlessaccesspolicy(); addresource.name = resource.name; addresource.rule = resource.rule; addresource.profilename = resource.profilename; return addresource.add_resource(client); }
java
public static base_response update(nitro_service client, vpnclientlessaccesspolicy resource) throws Exception { vpnclientlessaccesspolicy updateresource = new vpnclientlessaccesspolicy(); updateresource.name = resource.name; updateresource.rule = resource.rule; updateresource.profilename = resource.profilename; return updateresource.update_resource(client); }
java
public static vpnclientlessaccesspolicy[] get(nitro_service service) throws Exception{ vpnclientlessaccesspolicy obj = new vpnclientlessaccesspolicy(); vpnclientlessaccesspolicy[] response = (vpnclientlessaccesspolicy[])obj.get_resources(service); return response; }
java
public static vpnclientlessaccesspolicy get(nitro_service service, String name) throws Exception{ vpnclientlessaccesspolicy obj = new vpnclientlessaccesspolicy(); obj.set_name(name); vpnclientlessaccesspolicy response = (vpnclientlessaccesspolicy) obj.get_resource(service); return response; }
java
public static vpnclientlessaccesspolicy[] get_filtered(nitro_service service, filtervalue[] filter) throws Exception{ vpnclientlessaccesspolicy obj = new vpnclientlessaccesspolicy(); options option = new options(); option.set_filter(filter); vpnclientlessaccesspolicy[] response = (vpnclientlessaccesspolicy[]) obj.getfiltered(service, option); return response; }
java
public static aaagroup_vpnsessionpolicy_binding[] get(nitro_service service, String groupname) throws Exception{ aaagroup_vpnsessionpolicy_binding obj = new aaagroup_vpnsessionpolicy_binding(); obj.set_groupname(groupname); aaagroup_vpnsessionpolicy_binding response[] = (aaagroup_vpnsessionpolicy_binding[]) obj.get_resources(service); return response; }
java
public static void main(String[] args) { TreebankLanguagePack tlp = new PennTreebankLanguagePack(); System.out.println("Start symbol: " + tlp.startSymbol()); String start = tlp.startSymbol(); System.out.println("Should be true: " + (tlp.isStartSymbol(start))); String[] strs = {"-", "-LLB-", "NP-2", "NP=3", "NP-LGS", "NP-TMP=3"}; for (String str : strs) { System.out.println("String: " + str + " basic: " + tlp.basicCategory(str) + " basicAndFunc: " + tlp.categoryAndFunction(str)); } }
java
public static auditsyslogpolicy_lbvserver_binding[] get(nitro_service service, String name) throws Exception{ auditsyslogpolicy_lbvserver_binding obj = new auditsyslogpolicy_lbvserver_binding(); obj.set_name(name); auditsyslogpolicy_lbvserver_binding response[] = (auditsyslogpolicy_lbvserver_binding[]) obj.get_resources(service); return response; }
java
public static appfwpolicylabel_policybinding_binding[] get(nitro_service service, String labelname) throws Exception{ appfwpolicylabel_policybinding_binding obj = new appfwpolicylabel_policybinding_binding(); obj.set_labelname(labelname); appfwpolicylabel_policybinding_binding response[] = (appfwpolicylabel_policybinding_binding[]) obj.get_resources(service); return response; }
java
public static nsacl6_stats[] get(nitro_service service) throws Exception{ nsacl6_stats obj = new nsacl6_stats(); nsacl6_stats[] response = (nsacl6_stats[])obj.stat_resources(service); return response; }
java
public static nsacl6_stats get(nitro_service service, String acl6name) throws Exception{ nsacl6_stats obj = new nsacl6_stats(); obj.set_acl6name(acl6name); nsacl6_stats response = (nsacl6_stats) obj.stat_resource(service); return response; }
java
public static vpnglobal_vpntrafficpolicy_binding[] get(nitro_service service) throws Exception{ vpnglobal_vpntrafficpolicy_binding obj = new vpnglobal_vpntrafficpolicy_binding(); vpnglobal_vpntrafficpolicy_binding response[] = (vpnglobal_vpntrafficpolicy_binding[]) obj.get_resources(service); return response; }
java
public static authenticationnegotiatepolicy_binding get(nitro_service service, String name) throws Exception{ authenticationnegotiatepolicy_binding obj = new authenticationnegotiatepolicy_binding(); obj.set_name(name); authenticationnegotiatepolicy_binding response = (authenticationnegotiatepolicy_binding) obj.get_resource(service); return response; }
java
public static void main(String[] args) { Treebank treebank = new DiskTreebank(); treebank.loadPath(args[0]); WordStemmer ls = new WordStemmer(); for (Tree tree : treebank) { ls.visitTree(tree); System.out.println(tree); } }
java
public static base_response clear(nitro_service client) throws Exception { gslbldnsentries clearresource = new gslbldnsentries(); return clearresource.perform_operation(client,"clear"); }
java
public static base_responses clear(nitro_service client, gslbldnsentries resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { gslbldnsentries clearresources[] = new gslbldnsentries[resources.length]; for (int i=0;i<resources.length;i++){ clearresources[i] = new gslbldnsentries(); } result = perform_operation_bulk_request(client, clearresources,"clear"); } return result; }
java
public static gslbldnsentries[] get(nitro_service service) throws Exception{ gslbldnsentries obj = new gslbldnsentries(); gslbldnsentries[] response = (gslbldnsentries[])obj.get_resources(service); return response; }
java
public AutomatonInstance doClone() { AutomatonInstance clone = new AutomatonInstance(this.automatonEng, this.current, this.instanceId, this.safeGuard); clone.failed = this.failed; clone.transitionCount = this.transitionCount; clone.failCount = this.failCount; clone.iterateCount = this.iterateCount; clone.backtrackCount = this.backtrackCount; clone.trace = new LinkedList<>(); for(StateExploration se:this.trace) { clone.trace.add(se.doClone()); } return clone; }
java
public static base_response add(nitro_service client, clusternodegroup resource) throws Exception { clusternodegroup addresource = new clusternodegroup(); addresource.name = resource.name; addresource.strict = resource.strict; return addresource.add_resource(client); }
java
public static base_responses add(nitro_service client, clusternodegroup resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { clusternodegroup addresources[] = new clusternodegroup[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new clusternodegroup(); addresources[i].name = resources[i].name; addresources[i].strict = resources[i].strict; } result = add_bulk_request(client, addresources); } return result; }
java
public static base_response update(nitro_service client, clusternodegroup resource) throws Exception { clusternodegroup updateresource = new clusternodegroup(); updateresource.name = resource.name; updateresource.strict = resource.strict; return updateresource.update_resource(client); }
java
public static base_responses update(nitro_service client, clusternodegroup resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { clusternodegroup updateresources[] = new clusternodegroup[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new clusternodegroup(); updateresources[i].name = resources[i].name; updateresources[i].strict = resources[i].strict; } result = update_bulk_request(client, updateresources); } return result; }
java
public static base_responses unset(nitro_service client, String name[], String args[]) throws Exception { base_responses result = null; if (name != null && name.length > 0) { clusternodegroup unsetresources[] = new clusternodegroup[name.length]; for (int i=0;i<name.length;i++){ unsetresources[i] = new clusternodegroup(); unsetresources[i].name = name[i]; } result = unset_bulk_request(client, unsetresources,args); } return result; }
java
public static clusternodegroup[] get(nitro_service service) throws Exception{ clusternodegroup obj = new clusternodegroup(); clusternodegroup[] response = (clusternodegroup[])obj.get_resources(service); return response; }
java
public static clusternodegroup get(nitro_service service, String name) throws Exception{ clusternodegroup obj = new clusternodegroup(); obj.set_name(name); clusternodegroup response = (clusternodegroup) obj.get_resource(service); return response; }
java
public String haikunate() { if (tokenHex) { tokenChars = "0123456789abcdef"; } String adjective = randomString(adjectives); String noun = randomString(nouns); StringBuilder token = new StringBuilder(); if (tokenChars != null && tokenChars.length() > 0) { for (int i = 0; i < tokenLength; i++) { token.append(tokenChars.charAt(random.nextInt(tokenChars.length()))); } } return Stream.of(adjective, noun, token.toString()) .filter(s -> s != null && !s.isEmpty()) .collect(joining(delimiter)); }
java
private String randomString(String[] s) { if (s == null || s.length <= 0) return ""; return s[this.random.nextInt(s.length)]; }
java
public static systemeventhistory[] get(nitro_service service, systemeventhistory_args args) throws Exception{ systemeventhistory obj = new systemeventhistory(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); systemeventhistory[] response = (systemeventhistory[])obj.get_resources(service, option); return response; }
java
public static String getPunctClass(String punc) { if(punc.equals("%") || punc.equals("-PLUS-"))//-PLUS- is an escape for "+" in the ATB return "perc"; else if(punc.startsWith("*")) return "bullet"; else if(sfClass.contains(punc)) return "sf"; else if(colonClass.contains(punc) || pEllipsis.matcher(punc).matches()) return "colon"; else if(commaClass.contains(punc)) return "comma"; else if(currencyClass.contains(punc)) return "curr"; else if(slashClass.contains(punc)) return "slash"; else if(lBracketClass.contains(punc)) return "lrb"; else if(rBracketClass.contains(punc)) return "rrb"; else if(quoteClass.contains(punc)) return "quote"; return ""; }
java
public static vpnclientlessaccesspolicy_binding get(nitro_service service, String name) throws Exception{ vpnclientlessaccesspolicy_binding obj = new vpnclientlessaccesspolicy_binding(); obj.set_name(name); vpnclientlessaccesspolicy_binding response = (vpnclientlessaccesspolicy_binding) obj.get_resource(service); return response; }
java
public static crvserver_policymap_binding[] get(nitro_service service, String name) throws Exception{ crvserver_policymap_binding obj = new crvserver_policymap_binding(); obj.set_name(name); crvserver_policymap_binding response[] = (crvserver_policymap_binding[]) obj.get_resources(service); return response; }
java
public static dnsnsecrec[] get(nitro_service service) throws Exception{ dnsnsecrec obj = new dnsnsecrec(); dnsnsecrec[] response = (dnsnsecrec[])obj.get_resources(service); return response; }
java
public static dnsnsecrec[] get(nitro_service service, dnsnsecrec_args args) throws Exception{ dnsnsecrec obj = new dnsnsecrec(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); dnsnsecrec[] response = (dnsnsecrec[])obj.get_resources(service, option); return response; }
java
public static dnsnsecrec get(nitro_service service, String hostname) throws Exception{ dnsnsecrec obj = new dnsnsecrec(); obj.set_hostname(hostname); dnsnsecrec response = (dnsnsecrec) obj.get_resource(service); return response; }
java
public static dnsnsecrec[] get(nitro_service service, String hostname[]) throws Exception{ if (hostname !=null && hostname.length>0) { dnsnsecrec response[] = new dnsnsecrec[hostname.length]; dnsnsecrec obj[] = new dnsnsecrec[hostname.length]; for (int i=0;i<hostname.length;i++) { obj[i] = new dnsnsecrec(); obj[i].set_hostname(hostname[i]); response[i] = (dnsnsecrec) obj[i].get_resource(service); } return response; } return null; }
java
public static <E> Set<E> diff(Set<E> s1, Set<E> s2) { Set<E> s = new HashSet<E>(); for (E o : s1) { if (!s2.contains(o)) { s.add(o); } } return s; }
java
public static <E> Set<E> union(Set<E> s1, Set<E> s2) { Set<E> s = new HashSet<E>(); s.addAll(s1); s.addAll(s2); return s; }
java
public static <E> Set<E> intersection(Set<E> s1, Set<E> s2) { Set<E> s = new HashSet<E>(); s.addAll(s1); s.retainAll(s2); return s; }
java
private void updateMaxMin(IntervalRBTreeNode<T> n, IntervalRBTreeNode<T> c) { if (c != null) { if (n.max < c.max) { n.max = c.max; } if (n.min > c.min) { n.min = c.min; } } }
java
private void setMaxMin(IntervalRBTreeNode<T> n) { n.min = n.left; n.max = n.right; if (n.leftChild != null) { n.min = Math.min(n.min, n.leftChild.min); n.max = Math.max(n.max, n.leftChild.max); } if (n.rightChild != null) { n.min = Math.min(n.min, n.rightChild.min); n.max = Math.max(n.max, n.rightChild.max); } }
java
public static appflowglobal_binding get(nitro_service service) throws Exception{ appflowglobal_binding obj = new appflowglobal_binding(); appflowglobal_binding response = (appflowglobal_binding) obj.get_resource(service); return response; }
java
public static authenticationvserver_authenticationcertpolicy_binding[] get(nitro_service service, String name) throws Exception{ authenticationvserver_authenticationcertpolicy_binding obj = new authenticationvserver_authenticationcertpolicy_binding(); obj.set_name(name); authenticationvserver_authenticationcertpolicy_binding response[] = (authenticationvserver_authenticationcertpolicy_binding[]) obj.get_resources(service); return response; }
java
public static base_response Reboot(nitro_service client, reboot resource) throws Exception { reboot Rebootresource = new reboot(); Rebootresource.warm = resource.warm; return Rebootresource.perform_operation(client); }
java
public static policydataset_value_binding[] get(nitro_service service, String name) throws Exception{ policydataset_value_binding obj = new policydataset_value_binding(); obj.set_name(name); policydataset_value_binding response[] = (policydataset_value_binding[]) obj.get_resources(service); return response; }
java
public static authenticationvserver_binding get(nitro_service service, String name) throws Exception{ authenticationvserver_binding obj = new authenticationvserver_binding(); obj.set_name(name); authenticationvserver_binding response = (authenticationvserver_binding) obj.get_resource(service); return response; }
java
public static appqoepolicy[] get(nitro_service service) throws Exception{ appqoepolicy obj = new appqoepolicy(); appqoepolicy[] response = (appqoepolicy[])obj.get_resources(service); return response; }
java
public static appqoepolicy get(nitro_service service, String name) throws Exception{ appqoepolicy obj = new appqoepolicy(); obj.set_name(name); appqoepolicy response = (appqoepolicy) obj.get_resource(service); return response; }
java
public static appqoepolicy[] get_filtered(nitro_service service, filtervalue[] filter) throws Exception{ appqoepolicy obj = new appqoepolicy(); options option = new options(); option.set_filter(filter); appqoepolicy[] response = (appqoepolicy[]) obj.getfiltered(service, option); return response; }
java
public static bridgegroup_nsip_binding[] get(nitro_service service, Long id) throws Exception{ bridgegroup_nsip_binding obj = new bridgegroup_nsip_binding(); obj.set_id(id); bridgegroup_nsip_binding response[] = (bridgegroup_nsip_binding[]) obj.get_resources(service); return response; }
java
public static gslbservice_stats[] get(nitro_service service) throws Exception{ gslbservice_stats obj = new gslbservice_stats(); gslbservice_stats[] response = (gslbservice_stats[])obj.stat_resources(service); return response; }
java
public static gslbservice_stats get(nitro_service service, String servicename) throws Exception{ gslbservice_stats obj = new gslbservice_stats(); obj.set_servicename(servicename); gslbservice_stats response = (gslbservice_stats) obj.stat_resource(service); return response; }
java
public static sslpolicylabel[] get(nitro_service service) throws Exception{ sslpolicylabel obj = new sslpolicylabel(); sslpolicylabel[] response = (sslpolicylabel[])obj.get_resources(service); return response; }
java
public static sslpolicylabel get(nitro_service service, String labelname) throws Exception{ sslpolicylabel obj = new sslpolicylabel(); obj.set_labelname(labelname); sslpolicylabel response = (sslpolicylabel) obj.get_resource(service); return response; }
java
public static sslcertlink[] get(nitro_service service) throws Exception{ sslcertlink obj = new sslcertlink(); sslcertlink[] response = (sslcertlink[])obj.get_resources(service); return response; }
java
private void computeCosts() { cost = Long.MAX_VALUE; for (QueueItem item : queueSpans) { cost = Math.min(cost, item.sequenceSpans.spans.cost()); } }
java
private void fillQueue(QueueItem item, Integer minStartPosition, Integer maxStartPosition, Integer minEndPosition) throws IOException { int newStartPosition; int newEndPosition; Integer firstRetrievedPosition = null; // remove everything below minStartPosition if ((minStartPosition != null) && (item.lowestPosition != null) && (item.lowestPosition < minStartPosition)) { item.del((minStartPosition - 1)); } // fill queue while (!item.noMorePositions) { boolean doNotCollectAnotherPosition; doNotCollectAnotherPosition = item.filledPosition && (minStartPosition == null) && (maxStartPosition == null); doNotCollectAnotherPosition |= item.filledPosition && (maxStartPosition != null) && (item.lastRetrievedPosition != null) && (maxStartPosition < item.lastRetrievedPosition); if (doNotCollectAnotherPosition) { return; } else { // collect another full position firstRetrievedPosition = null; while (!item.noMorePositions) { newStartPosition = item.sequenceSpans.spans.nextStartPosition(); if (newStartPosition == NO_MORE_POSITIONS) { if (!item.queue.isEmpty()) { item.filledPosition = true; item.lastFilledPosition = item.lastRetrievedPosition; } item.noMorePositions = true; return; } else if ((minStartPosition != null) && (newStartPosition < minStartPosition)) { // do nothing } else { newEndPosition = item.sequenceSpans.spans.endPosition(); if ((minEndPosition == null) || (newEndPosition >= minEndPosition - ignoreItem.getMinStartPosition(docId, newEndPosition))) { item.add(newStartPosition, newEndPosition); if (firstRetrievedPosition == null) { firstRetrievedPosition = newStartPosition; } else if (!firstRetrievedPosition.equals(newStartPosition)) { break; } } } } } } }
java
public static appfwprofile_stats[] get(nitro_service service) throws Exception{ appfwprofile_stats obj = new appfwprofile_stats(); appfwprofile_stats[] response = (appfwprofile_stats[])obj.stat_resources(service); return response; }
java
public static appfwprofile_stats get(nitro_service service, String name) throws Exception{ appfwprofile_stats obj = new appfwprofile_stats(); obj.set_name(name); appfwprofile_stats response = (appfwprofile_stats) obj.stat_resource(service); return response; }
java
private static LogPriorType intToType(int intPrior) { LogPriorType[] values = LogPriorType.values(); for (LogPriorType val : values) { if (val.ordinal() == intPrior) { return val; } } throw new IllegalArgumentException(intPrior + " is not a legal LogPrior."); }
java
public static base_response convert(nitro_service client, sslpkcs12 resource) throws Exception { sslpkcs12 convertresource = new sslpkcs12(); convertresource.outfile = resource.outfile; convertresource.Import = resource.Import; convertresource.pkcs12file = resource.pkcs12file; convertresource.des = resource.des; convertresource.des3 = resource.des3; convertresource.export = resource.export; convertresource.certfile = resource.certfile; convertresource.keyfile = resource.keyfile; convertresource.password = resource.password; convertresource.pempassphrase = resource.pempassphrase; return convertresource.perform_operation(client,"convert"); }
java
public static base_response update(nitro_service client, protocolhttpband resource) throws Exception { protocolhttpband updateresource = new protocolhttpband(); updateresource.reqbandsize = resource.reqbandsize; updateresource.respbandsize = resource.respbandsize; return updateresource.update_resource(client); }
java
public static base_response unset(nitro_service client, protocolhttpband resource, String[] args) throws Exception{ protocolhttpband unsetresource = new protocolhttpband(); return unsetresource.unset_resource(client,args); }
java
public static protocolhttpband[] get(nitro_service service, protocolhttpband_args args) throws Exception{ protocolhttpband obj = new protocolhttpband(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); protocolhttpband[] response = (protocolhttpband[])obj.get_resources(service, option); return response; }
java
public static authenticationldappolicy_vpnglobal_binding[] get(nitro_service service, String name) throws Exception{ authenticationldappolicy_vpnglobal_binding obj = new authenticationldappolicy_vpnglobal_binding(); obj.set_name(name); authenticationldappolicy_vpnglobal_binding response[] = (authenticationldappolicy_vpnglobal_binding[]) obj.get_resources(service); return response; }
java
public static base_response Force(nitro_service client, hafailover resource) throws Exception { hafailover Forceresource = new hafailover(); Forceresource.force = resource.force; return Forceresource.perform_operation(client,"Force"); }
java
public static aaapreauthenticationpolicy_binding get(nitro_service service, String name) throws Exception{ aaapreauthenticationpolicy_binding obj = new aaapreauthenticationpolicy_binding(); obj.set_name(name); aaapreauthenticationpolicy_binding response = (aaapreauthenticationpolicy_binding) obj.get_resource(service); return response; }
java
protected static boolean numericEquals(Field vector1, Field vector2) { if (vector1.size() != vector2.size()) return false; if (vector1.isEmpty()) return true; Iterator<Object> it1 = vector1.iterator(); Iterator<Object> it2 = vector2.iterator(); while (it1.hasNext()) { Object obj1 = it1.next(); Object obj2 = it2.next(); if (!(obj1 instanceof Number && obj2 instanceof Number)) return false; if (((Number) obj1).doubleValue() != ((Number) obj2).doubleValue()) return false; } return true; }
java
protected boolean setFieldIfNecessary(String field, Object value) { if (!isOpen()) throw new ClosedObjectException("The Document object is closed."); if (!compareFieldValue(field, value)) { _doc.setField(field, value); return true; } return false; }
java
public static appflowpolicy_appflowglobal_binding[] get(nitro_service service, String name) throws Exception{ appflowpolicy_appflowglobal_binding obj = new appflowpolicy_appflowglobal_binding(); obj.set_name(name); appflowpolicy_appflowglobal_binding response[] = (appflowpolicy_appflowglobal_binding[]) obj.get_resources(service); return response; }
java
public static base_response add(nitro_service client, lbroute resource) throws Exception { lbroute addresource = new lbroute(); addresource.network = resource.network; addresource.netmask = resource.netmask; addresource.gatewayname = resource.gatewayname; return addresource.add_resource(client); }
java
public static base_response delete(nitro_service client, lbroute resource) throws Exception { lbroute deleteresource = new lbroute(); deleteresource.network = resource.network; deleteresource.netmask = resource.netmask; return deleteresource.delete_resource(client); }
java