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 list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/WebService.java | WebService.generateNaturalAnalogSequenceRNA | public String generateNaturalAnalogSequenceRNA(String notation)
throws org.helm.notation2.parser.exceptionparser.NotationException, HELM2HandledException,
ValidationException, MonomerLoadingException, ChemistryException {
String result = SequenceConverter.getNucleotideNaturalAnalogSequenceFromNotation(valida... | java | public String generateNaturalAnalogSequenceRNA(String notation)
throws org.helm.notation2.parser.exceptionparser.NotationException, HELM2HandledException,
ValidationException, MonomerLoadingException, ChemistryException {
String result = SequenceConverter.getNucleotideNaturalAnalogSequenceFromNotation(valida... | [
"public",
"String",
"generateNaturalAnalogSequenceRNA",
"(",
"String",
"notation",
")",
"throws",
"org",
".",
"helm",
".",
"notation2",
".",
"parser",
".",
"exceptionparser",
".",
"NotationException",
",",
"HELM2HandledException",
",",
"ValidationException",
",",
"Mon... | method to generate the natural analogue sequence for all rna-sequences
from an HELM input
@param notation
HELM input
@return natural analogue rna sequences, divided by white spaces
@throws org.helm.notation2.parser.exceptionparser.NotationException
if the input complex notation contains non-nucleid acid
polymer(s)
@th... | [
"method",
"to",
"generate",
"the",
"natural",
"analogue",
"sequence",
"for",
"all",
"rna",
"-",
"sequences",
"from",
"an",
"HELM",
"input"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/WebService.java#L610-L616 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/WebService.java | WebService.convertMolFileSMILESWithAtomMapping | public String convertMolFileSMILESWithAtomMapping(String molfile, List<Attachment> attachments) throws CTKException, ChemistryException{
return SMILES.convertMolToSMILESWithAtomMapping(molfile, attachments);
} | java | public String convertMolFileSMILESWithAtomMapping(String molfile, List<Attachment> attachments) throws CTKException, ChemistryException{
return SMILES.convertMolToSMILESWithAtomMapping(molfile, attachments);
} | [
"public",
"String",
"convertMolFileSMILESWithAtomMapping",
"(",
"String",
"molfile",
",",
"List",
"<",
"Attachment",
">",
"attachments",
")",
"throws",
"CTKException",
",",
"ChemistryException",
"{",
"return",
"SMILES",
".",
"convertMolToSMILESWithAtomMapping",
"(",
"mo... | method to generate a smiles with atom mapping for a given molfile with the given attachments
@param molfile given molfile
@param attachments given attachments
@return smiles with atom mapping
@throws CTKException general ChemToolKit exception passed to HELMToolKit
@throws ChemistryException if the chemistry engine can ... | [
"method",
"to",
"generate",
"a",
"smiles",
"with",
"atom",
"mapping",
"for",
"a",
"given",
"molfile",
"with",
"the",
"given",
"attachments"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/WebService.java#L676-L678 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/MethodsMonomerUtils.java | MethodsMonomerUtils.getListOfMonomerNotation | public static List<MonomerNotation> getListOfMonomerNotation(List<PolymerNotation> polymers) {
List<MonomerNotation> items = new ArrayList<MonomerNotation>();
for (PolymerNotation polymer : polymers) {
items.addAll(polymer.getListMonomers());
}
return items;
} | java | public static List<MonomerNotation> getListOfMonomerNotation(List<PolymerNotation> polymers) {
List<MonomerNotation> items = new ArrayList<MonomerNotation>();
for (PolymerNotation polymer : polymers) {
items.addAll(polymer.getListMonomers());
}
return items;
} | [
"public",
"static",
"List",
"<",
"MonomerNotation",
">",
"getListOfMonomerNotation",
"(",
"List",
"<",
"PolymerNotation",
">",
"polymers",
")",
"{",
"List",
"<",
"MonomerNotation",
">",
"items",
"=",
"new",
"ArrayList",
"<",
"MonomerNotation",
">",
"(",
")",
"... | method to get all MonomerNotations for all given polymers
@param polymers List of PolymerNotation
@return List of MonomerNotation | [
"method",
"to",
"get",
"all",
"MonomerNotations",
"for",
"all",
"given",
"polymers"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/MethodsMonomerUtils.java#L159-L167 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/MethodsMonomerUtils.java | MethodsMonomerUtils.getListOfMonomer | public static List<Monomer> getListOfMonomer(List<MonomerNotation> monomerNotations) throws MonomerException,
HELM2HandledException, CTKException, NotationException, ChemistryException, MonomerLoadingException {
List<Monomer> items = new ArrayList<Monomer>();
for (int i = 0; i < monomerNotations.size();... | java | public static List<Monomer> getListOfMonomer(List<MonomerNotation> monomerNotations) throws MonomerException,
HELM2HandledException, CTKException, NotationException, ChemistryException, MonomerLoadingException {
List<Monomer> items = new ArrayList<Monomer>();
for (int i = 0; i < monomerNotations.size();... | [
"public",
"static",
"List",
"<",
"Monomer",
">",
"getListOfMonomer",
"(",
"List",
"<",
"MonomerNotation",
">",
"monomerNotations",
")",
"throws",
"MonomerException",
",",
"HELM2HandledException",
",",
"CTKException",
",",
"NotationException",
",",
"ChemistryException",
... | method to get all monomers for all MonomerNotations
@param monomerNotations List of MonomerNotation
@return List of Monomer
@throws MonomerException if the Monomer is not valid
@throws HELM2HandledException if HELM2 features are there
@throws CTKException general ChemToolKit exception passed to HELMToolKit
@throws Not... | [
"method",
"to",
"get",
"all",
"monomers",
"for",
"all",
"MonomerNotations"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/MethodsMonomerUtils.java#L181-L189 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/MethodsMonomerUtils.java | MethodsMonomerUtils.getMonomer | public static Monomer getMonomer(String type, String id, String info) throws MonomerException, NotationException, ChemistryException{
try {
if (id.startsWith("[") && id.endsWith("]")) {
id = id.substring(1, id.length() - 1);
}
MonomerFactory monomerFactory = MonomerFactory.getInstance(... | java | public static Monomer getMonomer(String type, String id, String info) throws MonomerException, NotationException, ChemistryException{
try {
if (id.startsWith("[") && id.endsWith("]")) {
id = id.substring(1, id.length() - 1);
}
MonomerFactory monomerFactory = MonomerFactory.getInstance(... | [
"public",
"static",
"Monomer",
"getMonomer",
"(",
"String",
"type",
",",
"String",
"id",
",",
"String",
"info",
")",
"throws",
"MonomerException",
",",
"NotationException",
",",
"ChemistryException",
"{",
"try",
"{",
"if",
"(",
"id",
".",
"startsWith",
"(",
... | method to get the monomer from the database!
@param type Type of the Monomer
@param id Id of the Monomer
@param info natural analog of the monomer
@return Monomer
@throws MonomerException if the desired monomer is not in the database
@throws NotationException if notation is not valid
@throws ChemistryException if the ... | [
"method",
"to",
"get",
"the",
"monomer",
"from",
"the",
"database!"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/MethodsMonomerUtils.java#L202-L272 | train |
kiswanij/jk-util | src/main/java/com/jk/util/locale/JKLocale.java | JKLocale.valueOf | public static JKLocale valueOf(final String localeString) {
return localeString.equals(ARABIC.shortName) ? ARABIC : ENGLISH;
} | java | public static JKLocale valueOf(final String localeString) {
return localeString.equals(ARABIC.shortName) ? ARABIC : ENGLISH;
} | [
"public",
"static",
"JKLocale",
"valueOf",
"(",
"final",
"String",
"localeString",
")",
"{",
"return",
"localeString",
".",
"equals",
"(",
"ARABIC",
".",
"shortName",
")",
"?",
"ARABIC",
":",
"ENGLISH",
";",
"}"
] | Value of.
@param localeString the locale string
@return the JK locale | [
"Value",
"of",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/locale/JKLocale.java#L79-L81 | train |
kiswanij/jk-util | src/main/java/com/jk/util/security/JKAudit.java | JKAudit.getAuditText | public String getAuditText() {
final StringBuffer b = new StringBuffer();
b.append(getOldValue().replaceAll(",", "\n"));
b.append("-----------------------------------------\n");
b.append(getNewValue().replaceAll(",", "\n"));
b.append("-----------------------------------------\n");
return b.toString();
} | java | public String getAuditText() {
final StringBuffer b = new StringBuffer();
b.append(getOldValue().replaceAll(",", "\n"));
b.append("-----------------------------------------\n");
b.append(getNewValue().replaceAll(",", "\n"));
b.append("-----------------------------------------\n");
return b.toString();
} | [
"public",
"String",
"getAuditText",
"(",
")",
"{",
"final",
"StringBuffer",
"b",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"b",
".",
"append",
"(",
"getOldValue",
"(",
")",
".",
"replaceAll",
"(",
"\",\"",
",",
"\"\\n\"",
")",
")",
";",
"b",
".",
"a... | Gets the audit text.
@return the audit text | [
"Gets",
"the",
"audit",
"text",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/security/JKAudit.java#L75-L82 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/calculation/ExtinctionCoefficient.java | ExtinctionCoefficient.calculate | public float calculate(HELM2Notation helm2notation, int unitType) throws ExtinctionCoefficientException, ChemistryException {
LOG.debug("ExtinctionCalculation is starting with the unitType: " + unitType);
float result = 0.0f;
List<PolymerNotation> polymerNodes = helm2notation.getListOfPolymers();
fo... | java | public float calculate(HELM2Notation helm2notation, int unitType) throws ExtinctionCoefficientException, ChemistryException {
LOG.debug("ExtinctionCalculation is starting with the unitType: " + unitType);
float result = 0.0f;
List<PolymerNotation> polymerNodes = helm2notation.getListOfPolymers();
fo... | [
"public",
"float",
"calculate",
"(",
"HELM2Notation",
"helm2notation",
",",
"int",
"unitType",
")",
"throws",
"ExtinctionCoefficientException",
",",
"ChemistryException",
"{",
"LOG",
".",
"debug",
"(",
"\"ExtinctionCalculation is starting with the unitType: \"",
"+",
"unitT... | method to calculate the extinction coefficient for the whole HELM molecule
@param helm2notation input HELM2Notation
@param unitType Unit of the extinction coefficient
@return extinction coefficient
@throws ExtinctionCoefficientException if the HELM contains HELM2 features
@throws ChemistryException if the Chemistry En... | [
"method",
"to",
"calculate",
"the",
"extinction",
"coefficient",
"for",
"the",
"whole",
"HELM",
"molecule"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/calculation/ExtinctionCoefficient.java#L180-L211 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/calculation/ExtinctionCoefficient.java | ExtinctionCoefficient.calculateExtinctionFromRNA | private static float calculateExtinctionFromRNA(List<Monomer> monomers) throws CalculationException, IOException {
LOG.debug("ExtinctionCalculation of RNA");
float resultSingle = 0.0f;
float resultDi = 0.0f;
String previous = "";
if (monomers.size() == 0) {
throw new CalculationException... | java | private static float calculateExtinctionFromRNA(List<Monomer> monomers) throws CalculationException, IOException {
LOG.debug("ExtinctionCalculation of RNA");
float resultSingle = 0.0f;
float resultDi = 0.0f;
String previous = "";
if (monomers.size() == 0) {
throw new CalculationException... | [
"private",
"static",
"float",
"calculateExtinctionFromRNA",
"(",
"List",
"<",
"Monomer",
">",
"monomers",
")",
"throws",
"CalculationException",
",",
"IOException",
"{",
"LOG",
".",
"debug",
"(",
"\"ExtinctionCalculation of RNA\"",
")",
";",
"float",
"resultSingle",
... | method to calculate the extinction coefficient for rna
@param monomers all Monomers of the RNA/DNA
@return extinction coefficient
@throws CalculationException if the rna contains not valid nucleotides
@throws IOException | [
"method",
"to",
"calculate",
"the",
"extinction",
"coefficient",
"for",
"rna"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/calculation/ExtinctionCoefficient.java#L221-L259 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/calculation/ExtinctionCoefficient.java | ExtinctionCoefficient.calculateExtinctionFromPeptide | private static float calculateExtinctionFromPeptide(List<Monomer> monomers) throws IOException, HELM2HandledException {
if (null == monomers || monomers.isEmpty()) {
return 0.0f;
}
Map<String, Integer> countMap = new HashMap<String, Integer>();
for (Monomer monomer : monomers) {
if... | java | private static float calculateExtinctionFromPeptide(List<Monomer> monomers) throws IOException, HELM2HandledException {
if (null == monomers || monomers.isEmpty()) {
return 0.0f;
}
Map<String, Integer> countMap = new HashMap<String, Integer>();
for (Monomer monomer : monomers) {
if... | [
"private",
"static",
"float",
"calculateExtinctionFromPeptide",
"(",
"List",
"<",
"Monomer",
">",
"monomers",
")",
"throws",
"IOException",
",",
"HELM2HandledException",
"{",
"if",
"(",
"null",
"==",
"monomers",
"||",
"monomers",
".",
"isEmpty",
"(",
")",
")",
... | method to calculate the extinction coefficient for peptide
@param monomers all monomers of the peptide
@return extinction coefficient
@throws IOException
@throws HELM2HandledException if HELM2 features were there | [
"method",
"to",
"calculate",
"the",
"extinction",
"coefficient",
"for",
"peptide"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/calculation/ExtinctionCoefficient.java#L269-L297 | train |
kiswanij/jk-util | src/main/java/com/jk/util/activedirectory/ADAuthenticator.java | ADAuthenticator.isAuthenticed | public static boolean isAuthenticed(String host, int port, String userName, String password) throws NamingException {
log.info("isAuthenticed");
// Set up the environment for creating the initial context
Hashtable<String, String> env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "c... | java | public static boolean isAuthenticed(String host, int port, String userName, String password) throws NamingException {
log.info("isAuthenticed");
// Set up the environment for creating the initial context
Hashtable<String, String> env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "c... | [
"public",
"static",
"boolean",
"isAuthenticed",
"(",
"String",
"host",
",",
"int",
"port",
",",
"String",
"userName",
",",
"String",
"password",
")",
"throws",
"NamingException",
"{",
"log",
".",
"info",
"(",
"\"isAuthenticed\"",
")",
";",
"// Set up the environ... | Checks if is authenticed.
@param host the host
@param port the port
@param userName the user name
@param password the password
@return true, if is authenticed
@throws NamingException the naming exception | [
"Checks",
"if",
"is",
"authenticed",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/activedirectory/ADAuthenticator.java#L48-L67 | train |
kiswanij/jk-util | src/main/java/com/jk/util/UserPreferences.java | UserPreferences.fixKey | protected static String fixKey(final String key) {
if (key.startsWith(getKeyPrefix())) {
return key;
}
return getKeyPrefix() + "-" + key;
} | java | protected static String fixKey(final String key) {
if (key.startsWith(getKeyPrefix())) {
return key;
}
return getKeyPrefix() + "-" + key;
} | [
"protected",
"static",
"String",
"fixKey",
"(",
"final",
"String",
"key",
")",
"{",
"if",
"(",
"key",
".",
"startsWith",
"(",
"getKeyPrefix",
"(",
")",
")",
")",
"{",
"return",
"key",
";",
"}",
"return",
"getKeyPrefix",
"(",
")",
"+",
"\"-\"",
"+",
"... | Fix key.
@param key the key
@return the string | [
"Fix",
"key",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/UserPreferences.java#L59-L64 | train |
kiswanij/jk-util | src/main/java/com/jk/util/UserPreferences.java | UserPreferences.getFloat | public static float getFloat(final String key, final float def) {
try {
return systemRoot.getFloat(fixKey(key), def);
} catch (final Exception e) {
// just eat the exception to avoid any system
// crash on system issues
return def;
}
} | java | public static float getFloat(final String key, final float def) {
try {
return systemRoot.getFloat(fixKey(key), def);
} catch (final Exception e) {
// just eat the exception to avoid any system
// crash on system issues
return def;
}
} | [
"public",
"static",
"float",
"getFloat",
"(",
"final",
"String",
"key",
",",
"final",
"float",
"def",
")",
"{",
"try",
"{",
"return",
"systemRoot",
".",
"getFloat",
"(",
"fixKey",
"(",
"key",
")",
",",
"def",
")",
";",
"}",
"catch",
"(",
"final",
"Ex... | Gets the float.
@param key the key
@param def the def
@return the float
@see java.util.prefs.Preferences#getFloat(java.lang.String, float) | [
"Gets",
"the",
"float",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/UserPreferences.java#L108-L116 | train |
kiswanij/jk-util | src/main/java/com/jk/util/UserPreferences.java | UserPreferences.getHashtable | public static Hashtable<String, String> getHashtable(final String name) {
final Hashtable<String, String> hash = new Hashtable<String, String>();
try {
final String configStr = UserPreferences.get(fixKey(name), "");
if (!configStr.equals("")) {
final String[] rows = configStr.split(";");
for (final St... | java | public static Hashtable<String, String> getHashtable(final String name) {
final Hashtable<String, String> hash = new Hashtable<String, String>();
try {
final String configStr = UserPreferences.get(fixKey(name), "");
if (!configStr.equals("")) {
final String[] rows = configStr.split(";");
for (final St... | [
"public",
"static",
"Hashtable",
"<",
"String",
",",
"String",
">",
"getHashtable",
"(",
"final",
"String",
"name",
")",
"{",
"final",
"Hashtable",
"<",
"String",
",",
"String",
">",
"hash",
"=",
"new",
"Hashtable",
"<",
"String",
",",
"String",
">",
"("... | Gets the hashtable.
@param name the name
@return the hashtable | [
"Gets",
"the",
"hashtable",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/UserPreferences.java#L124-L143 | train |
kiswanij/jk-util | src/main/java/com/jk/util/UserPreferences.java | UserPreferences.getInt | public static int getInt(final String key, final int def) {
try {
return systemRoot.getInt(fixKey(key), def);
} catch (final Exception e) {
// just eat the exception to avoid any system crash on system issues
return def;
}
} | java | public static int getInt(final String key, final int def) {
try {
return systemRoot.getInt(fixKey(key), def);
} catch (final Exception e) {
// just eat the exception to avoid any system crash on system issues
return def;
}
} | [
"public",
"static",
"int",
"getInt",
"(",
"final",
"String",
"key",
",",
"final",
"int",
"def",
")",
"{",
"try",
"{",
"return",
"systemRoot",
".",
"getInt",
"(",
"fixKey",
"(",
"key",
")",
",",
"def",
")",
";",
"}",
"catch",
"(",
"final",
"Exception"... | Gets the int.
@param key the key
@param def the def
@return the int
@see java.util.prefs.Preferences#getInt(java.lang.String, int) | [
"Gets",
"the",
"int",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/UserPreferences.java#L153-L160 | train |
kiswanij/jk-util | src/main/java/com/jk/util/UserPreferences.java | UserPreferences.putHashTable | public static void putHashTable(final String name, final Hashtable hash) {
final Enumeration<String> keys = hash.keys();
final StringBuffer buf = new StringBuffer("");
while (keys.hasMoreElements()) {
if (!buf.toString().equals("")) {
// end the previous record
buf.append(";");
}
final String key... | java | public static void putHashTable(final String name, final Hashtable hash) {
final Enumeration<String> keys = hash.keys();
final StringBuffer buf = new StringBuffer("");
while (keys.hasMoreElements()) {
if (!buf.toString().equals("")) {
// end the previous record
buf.append(";");
}
final String key... | [
"public",
"static",
"void",
"putHashTable",
"(",
"final",
"String",
"name",
",",
"final",
"Hashtable",
"hash",
")",
"{",
"final",
"Enumeration",
"<",
"String",
">",
"keys",
"=",
"hash",
".",
"keys",
"(",
")",
";",
"final",
"StringBuffer",
"buf",
"=",
"ne... | Put hash table.
@param name the name
@param hash the hash | [
"Put",
"hash",
"table",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/UserPreferences.java#L238-L251 | train |
kiswanij/jk-util | src/main/java/com/jk/util/UserPreferences.java | UserPreferences.setKeyPrefix | public static void setKeyPrefix(final String keyPrefix) {
UserPreferences.keyPrefix = keyPrefix;
try {
systemRoot.sync();
} catch (final Exception e) {
JKExceptionUtil.handle(e);
}
} | java | public static void setKeyPrefix(final String keyPrefix) {
UserPreferences.keyPrefix = keyPrefix;
try {
systemRoot.sync();
} catch (final Exception e) {
JKExceptionUtil.handle(e);
}
} | [
"public",
"static",
"void",
"setKeyPrefix",
"(",
"final",
"String",
"keyPrefix",
")",
"{",
"UserPreferences",
".",
"keyPrefix",
"=",
"keyPrefix",
";",
"try",
"{",
"systemRoot",
".",
"sync",
"(",
")",
";",
"}",
"catch",
"(",
"final",
"Exception",
"e",
")",
... | Sets the key prefix.
@param keyPrefix the new key prefix | [
"Sets",
"the",
"key",
"prefix",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/UserPreferences.java#L273-L280 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/NucleotideFactory.java | NucleotideFactory.initializeNucleotideTemplates | private static void initializeNucleotideTemplates() throws NucleotideLoadingException {
InputStream in = null;
File localFile = new File(LOCAL_NUCLEOTIDE_TEMPLATE_FILE_PATH);
Map<String, Map<String, String>> templates = null;
if (localFile.exists()) {
try {
in = new FileInputStream(local... | java | private static void initializeNucleotideTemplates() throws NucleotideLoadingException {
InputStream in = null;
File localFile = new File(LOCAL_NUCLEOTIDE_TEMPLATE_FILE_PATH);
Map<String, Map<String, String>> templates = null;
if (localFile.exists()) {
try {
in = new FileInputStream(local... | [
"private",
"static",
"void",
"initializeNucleotideTemplates",
"(",
")",
"throws",
"NucleotideLoadingException",
"{",
"InputStream",
"in",
"=",
"null",
";",
"File",
"localFile",
"=",
"new",
"File",
"(",
"LOCAL_NUCLEOTIDE_TEMPLATE_FILE_PATH",
")",
";",
"Map",
"<",
"St... | This method is called during startup, use local version if exist, otherwise
use XML version in jar
@throws NucleotideLoadingException
@throws org.helm.notation2.exception.MonomerException
@throws java.io.IOException
@throws org.jdom.JDOMException | [
"This",
"method",
"is",
"called",
"during",
"startup",
"use",
"local",
"version",
"if",
"exist",
"otherwise",
"use",
"XML",
"version",
"in",
"jar"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/NucleotideFactory.java#L155-L192 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/NucleotideFactory.java | NucleotideFactory.saveNucleotideTemplates | public void saveNucleotideTemplates() throws IOException {
File f = new File(NOTATION_DIRECTORY);
if (!f.exists()) {
f.mkdir();
}
String nucleotideTemplatesXML = NucleotideParser.getNucleotideTemplatesXML(getNucleotideTemplates());
FileOutputStream fos = new FileOutputStream(
LOCAL_NUC... | java | public void saveNucleotideTemplates() throws IOException {
File f = new File(NOTATION_DIRECTORY);
if (!f.exists()) {
f.mkdir();
}
String nucleotideTemplatesXML = NucleotideParser.getNucleotideTemplatesXML(getNucleotideTemplates());
FileOutputStream fos = new FileOutputStream(
LOCAL_NUC... | [
"public",
"void",
"saveNucleotideTemplates",
"(",
")",
"throws",
"IOException",
"{",
"File",
"f",
"=",
"new",
"File",
"(",
"NOTATION_DIRECTORY",
")",
";",
"if",
"(",
"!",
"f",
".",
"exists",
"(",
")",
")",
"{",
"f",
".",
"mkdir",
"(",
")",
";",
"}",
... | save Nucleotide Templates to disk file
@throws java.io.IOException if it can't be saved | [
"save",
"Nucleotide",
"Templates",
"to",
"disk",
"file"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/NucleotideFactory.java#L247-L256 | train |
kiswanij/jk-util | src/main/java/com/jk/util/reflection/common/MethodCallInfo.java | MethodCallInfo.getParamtersTypes | @SuppressWarnings("rawtypes")
public Class[] getParamtersTypes() {
final Class[] types = new Class[this.paramters.length];
for (int i = 0; i < types.length; i++) {
types[i] = this.paramters[i].getClass();
}
return types;
} | java | @SuppressWarnings("rawtypes")
public Class[] getParamtersTypes() {
final Class[] types = new Class[this.paramters.length];
for (int i = 0; i < types.length; i++) {
types[i] = this.paramters[i].getClass();
}
return types;
} | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"Class",
"[",
"]",
"getParamtersTypes",
"(",
")",
"{",
"final",
"Class",
"[",
"]",
"types",
"=",
"new",
"Class",
"[",
"this",
".",
"paramters",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i"... | get the types of the parameters using java reflection.
@return the paramters types | [
"get",
"the",
"types",
"of",
"the",
"parameters",
"using",
"java",
"reflection",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/reflection/common/MethodCallInfo.java#L113-L120 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/Chemistry.java | Chemistry.readConfigFile | private void readConfigFile() {
File configFile = new File(CONFIG_FILE_PATH);
/* config file is not there -> create config file with default */
if (!configFile.exists()) {
resetConfigToDefault();
}
try {
PropertiesConfiguration conf = new PropertiesConfiguration(CONFIG_FILE_PATH... | java | private void readConfigFile() {
File configFile = new File(CONFIG_FILE_PATH);
/* config file is not there -> create config file with default */
if (!configFile.exists()) {
resetConfigToDefault();
}
try {
PropertiesConfiguration conf = new PropertiesConfiguration(CONFIG_FILE_PATH... | [
"private",
"void",
"readConfigFile",
"(",
")",
"{",
"File",
"configFile",
"=",
"new",
"File",
"(",
"CONFIG_FILE_PATH",
")",
";",
"/* config file is not there -> create config file with default */",
"if",
"(",
"!",
"configFile",
".",
"exists",
"(",
")",
")",
"{",
"... | method to read the configuration file | [
"method",
"to",
"read",
"the",
"configuration",
"file"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/Chemistry.java#L82-L96 | train |
kiswanij/jk-util | src/main/java/com/jk/util/java/JKCompileUtil.java | JKCompileUtil.compileJavaClass | public static boolean compileJavaClass(String sourceCode) {
try {
String fileName = getClassName(sourceCode).concat(".java");
logger.info("Compiling Java Class ({})", fileName);
File rootDir = JKIOUtil.createTempDirectory();
String packageDir = getPackageDir(sourceCode);
File sourceFile ;
i... | java | public static boolean compileJavaClass(String sourceCode) {
try {
String fileName = getClassName(sourceCode).concat(".java");
logger.info("Compiling Java Class ({})", fileName);
File rootDir = JKIOUtil.createTempDirectory();
String packageDir = getPackageDir(sourceCode);
File sourceFile ;
i... | [
"public",
"static",
"boolean",
"compileJavaClass",
"(",
"String",
"sourceCode",
")",
"{",
"try",
"{",
"String",
"fileName",
"=",
"getClassName",
"(",
"sourceCode",
")",
".",
"concat",
"(",
"\".java\"",
")",
";",
"logger",
".",
"info",
"(",
"\"Compiling Java Cl... | Compile java class.
@param sourceCode the source code
@throws IOException | [
"Compile",
"java",
"class",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/java/JKCompileUtil.java#L50-L91 | train |
demidenko05/beige-uml | beige-android-lib/src/main/java/org/beigesoft/android/ui/widget/FileChooserAdaptor.java | FileChooserAdaptor.showAndChoose | @Override
public void showAndChoose(IConsumer<File> consumer) {
this.consumer = consumer;
initSrvNodeFile();
Intent activityTreeIntent = new Intent(activity, ActivityTreeChooser.class);
activityTreeIntent.putExtra(FragmentNodes.ARG_ID_NODE_SRVNODES, new String[]{idFolderStart, idSrvGetNodeFile, idComm... | java | @Override
public void showAndChoose(IConsumer<File> consumer) {
this.consumer = consumer;
initSrvNodeFile();
Intent activityTreeIntent = new Intent(activity, ActivityTreeChooser.class);
activityTreeIntent.putExtra(FragmentNodes.ARG_ID_NODE_SRVNODES, new String[]{idFolderStart, idSrvGetNodeFile, idComm... | [
"@",
"Override",
"public",
"void",
"showAndChoose",
"(",
"IConsumer",
"<",
"File",
">",
"consumer",
")",
"{",
"this",
".",
"consumer",
"=",
"consumer",
";",
"initSrvNodeFile",
"(",
")",
";",
"Intent",
"activityTreeIntent",
"=",
"new",
"Intent",
"(",
"activit... | You must provide fileFilter, idFolderStart and title to invoke it! | [
"You",
"must",
"provide",
"fileFilter",
"idFolderStart",
"and",
"title",
"to",
"invoke",
"it!"
] | 65f6024fa944e10875d9a3be3e4a586bede39683 | https://github.com/demidenko05/beige-uml/blob/65f6024fa944e10875d9a3be3e4a586bede39683/beige-android-lib/src/main/java/org/beigesoft/android/ui/widget/FileChooserAdaptor.java#L56-L63 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/xHelmNotationParser.java | xHelmNotationParser.getHELMNotationString | public static String getHELMNotationString(Element rootElement) {
Element helmNotationElement = rootElement.getChild("HelmNotation");
return helmNotationElement.getText();
} | java | public static String getHELMNotationString(Element rootElement) {
Element helmNotationElement = rootElement.getChild("HelmNotation");
return helmNotationElement.getText();
} | [
"public",
"static",
"String",
"getHELMNotationString",
"(",
"Element",
"rootElement",
")",
"{",
"Element",
"helmNotationElement",
"=",
"rootElement",
".",
"getChild",
"(",
"\"HelmNotation\"",
")",
";",
"return",
"helmNotationElement",
".",
"getText",
"(",
")",
";",
... | Extracts the HELM string from the root node of the XHELM document
@param rootElement root element
@return the complex notation string | [
"Extracts",
"the",
"HELM",
"string",
"from",
"the",
"root",
"node",
"of",
"the",
"XHELM",
"document"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/xHelmNotationParser.java#L53-L56 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/xHelmNotationParser.java | xHelmNotationParser.getComplexNotationString | public static String getComplexNotationString(Element rootElement) {
Element helmNotationElement = rootElement.getChild("HelmNotation");
return helmNotationElement.getText();
} | java | public static String getComplexNotationString(Element rootElement) {
Element helmNotationElement = rootElement.getChild("HelmNotation");
return helmNotationElement.getText();
} | [
"public",
"static",
"String",
"getComplexNotationString",
"(",
"Element",
"rootElement",
")",
"{",
"Element",
"helmNotationElement",
"=",
"rootElement",
".",
"getChild",
"(",
"\"HelmNotation\"",
")",
";",
"return",
"helmNotationElement",
".",
"getText",
"(",
")",
";... | Extracts the complex notation string from the root node of the XHELM
document
@param rootElement root element
@return the complex notation string | [
"Extracts",
"the",
"complex",
"notation",
"string",
"from",
"the",
"root",
"node",
"of",
"the",
"XHELM",
"document"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/xHelmNotationParser.java#L65-L68 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/xHelmNotationParser.java | xHelmNotationParser.getMonomerStore | public static MonomerStore getMonomerStore(Element rootElement)
throws MonomerException, IOException {
MonomerStore monomerStore = new MonomerStore();
Element monomerListElement = rootElement.getChild("Monomers");
if (monomerListElement != null) {
@SuppressWarnings("unchecked")
List<... | java | public static MonomerStore getMonomerStore(Element rootElement)
throws MonomerException, IOException {
MonomerStore monomerStore = new MonomerStore();
Element monomerListElement = rootElement.getChild("Monomers");
if (monomerListElement != null) {
@SuppressWarnings("unchecked")
List<... | [
"public",
"static",
"MonomerStore",
"getMonomerStore",
"(",
"Element",
"rootElement",
")",
"throws",
"MonomerException",
",",
"IOException",
"{",
"MonomerStore",
"monomerStore",
"=",
"new",
"MonomerStore",
"(",
")",
";",
"Element",
"monomerListElement",
"=",
"rootElem... | Generates the monomer store from a given XHELM document
@param rootElement root element
@return a monomer store
@throws MonomerException if monomer is not valid
@throws IOException IO error | [
"Generates",
"the",
"monomer",
"store",
"from",
"a",
"given",
"XHELM",
"document"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/xHelmNotationParser.java#L78-L92 | train |
kiswanij/jk-util | src/main/java/com/jk/util/model/table/JKTableColumn.java | JKTableColumn.isNumeric | public boolean isNumeric() {
final Class c = getColumnClass();
return c.equals(Integer.class) || c.equals(Float.class) || c.equals(Long.class) || c.equals(BigDecimal.class);
} | java | public boolean isNumeric() {
final Class c = getColumnClass();
return c.equals(Integer.class) || c.equals(Float.class) || c.equals(Long.class) || c.equals(BigDecimal.class);
} | [
"public",
"boolean",
"isNumeric",
"(",
")",
"{",
"final",
"Class",
"c",
"=",
"getColumnClass",
"(",
")",
";",
"return",
"c",
".",
"equals",
"(",
"Integer",
".",
"class",
")",
"||",
"c",
".",
"equals",
"(",
"Float",
".",
"class",
")",
"||",
"c",
"."... | Checks if is numeric.
@return true, if is numeric | [
"Checks",
"if",
"is",
"numeric",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/model/table/JKTableColumn.java#L224-L227 | train |
kiswanij/jk-util | src/main/java/com/jk/util/model/table/JKTableColumn.java | JKTableColumn.setColumnClassName | public void setColumnClassName(final String columnClassName) throws ClassNotFoundException {
if (columnClassName.equals("byte[]")) {
setColumnClass(Object.class);
} else {
setColumnClass(Class.forName(columnClassName));
}
this.columnClassName = columnClassName;
} | java | public void setColumnClassName(final String columnClassName) throws ClassNotFoundException {
if (columnClassName.equals("byte[]")) {
setColumnClass(Object.class);
} else {
setColumnClass(Class.forName(columnClassName));
}
this.columnClassName = columnClassName;
} | [
"public",
"void",
"setColumnClassName",
"(",
"final",
"String",
"columnClassName",
")",
"throws",
"ClassNotFoundException",
"{",
"if",
"(",
"columnClassName",
".",
"equals",
"(",
"\"byte[]\"",
")",
")",
"{",
"setColumnClass",
"(",
"Object",
".",
"class",
")",
";... | Sets the column class name.
@param columnClassName the new column class name
@throws ClassNotFoundException the class not found exception | [
"Sets",
"the",
"column",
"class",
"name",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/model/table/JKTableColumn.java#L262-L269 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/MDLUtils.java | MDLUtils.generateMDL | public static String generateMDL(final HELM2Notation helm2notation) throws BuilderMoleculeException, CTKException, NotationException, ChemistryException {
LOG.debug("Generate smiles representation for the whole HELM molecule");
String smiles = SMILES.getSMILESForAll(helm2notation);
LOG.debug("Convert smi... | java | public static String generateMDL(final HELM2Notation helm2notation) throws BuilderMoleculeException, CTKException, NotationException, ChemistryException {
LOG.debug("Generate smiles representation for the whole HELM molecule");
String smiles = SMILES.getSMILESForAll(helm2notation);
LOG.debug("Convert smi... | [
"public",
"static",
"String",
"generateMDL",
"(",
"final",
"HELM2Notation",
"helm2notation",
")",
"throws",
"BuilderMoleculeException",
",",
"CTKException",
",",
"NotationException",
",",
"ChemistryException",
"{",
"LOG",
".",
"debug",
"(",
"\"Generate smiles representati... | method to generate MDL for a HELM molecule
@param helm2notation input HELM2Notation
@return MDL
@throws BuilderMoleculeException if the helm molecule can not be built
@throws CTKException general ChemToolKit exception passed to HELMToolKit
@throws NotationException if notation is not valid
@throws ChemistryException i... | [
"method",
"to",
"generate",
"MDL",
"for",
"a",
"HELM",
"molecule"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/MDLUtils.java#L63-L68 | train |
kiswanij/jk-util | src/main/java/com/jk/util/reflection/client/ReflectionClient.java | ReflectionClient.callMethod | public void callMethod(final MethodCallInfo info) {
this.logger.info("calling remote method ".concat(info.toString()));
try (Socket socket = new Socket(this.host, this.port)) {
final ObjectOutputStream out = new ObjectOutputStream(socket.getOutputStream());
out.writeObject(info);
final ObjectInputStre... | java | public void callMethod(final MethodCallInfo info) {
this.logger.info("calling remote method ".concat(info.toString()));
try (Socket socket = new Socket(this.host, this.port)) {
final ObjectOutputStream out = new ObjectOutputStream(socket.getOutputStream());
out.writeObject(info);
final ObjectInputStre... | [
"public",
"void",
"callMethod",
"(",
"final",
"MethodCallInfo",
"info",
")",
"{",
"this",
".",
"logger",
".",
"info",
"(",
"\"calling remote method \"",
".",
"concat",
"(",
"info",
".",
"toString",
"(",
")",
")",
")",
";",
"try",
"(",
"Socket",
"socket",
... | Call the remote method based on the passed MethodCallInfo parameter.
@param info specification of remote method | [
"Call",
"the",
"remote",
"method",
"based",
"on",
"the",
"passed",
"MethodCallInfo",
"parameter",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/reflection/client/ReflectionClient.java#L61-L72 | train |
kiswanij/jk-util | src/main/java/com/jk/util/model/table/JKDefaultTableModel.java | JKDefaultTableModel.convertToVector | protected static Vector convertToVector(final Object[] anArray) {
if (anArray == null) {
return null;
}
final Vector v = new Vector(anArray.length);
for (final Object element : anArray) {
v.addElement(element);
}
return v;
} | java | protected static Vector convertToVector(final Object[] anArray) {
if (anArray == null) {
return null;
}
final Vector v = new Vector(anArray.length);
for (final Object element : anArray) {
v.addElement(element);
}
return v;
} | [
"protected",
"static",
"Vector",
"convertToVector",
"(",
"final",
"Object",
"[",
"]",
"anArray",
")",
"{",
"if",
"(",
"anArray",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"Vector",
"v",
"=",
"new",
"Vector",
"(",
"anArray",
".",
"len... | Returns a vector that contains the same objects as the array.
@param anArray the array to be converted
@return the new vector; if <code>anArray</code> is <code>null</code>, returns
<code>null</code> | [
"Returns",
"a",
"vector",
"that",
"contains",
"the",
"same",
"objects",
"as",
"the",
"array",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/model/table/JKDefaultTableModel.java#L68-L77 | train |
kiswanij/jk-util | src/main/java/com/jk/util/model/table/JKDefaultTableModel.java | JKDefaultTableModel.newVector | private static Vector newVector(final int size) {
final Vector v = new Vector(size);
v.setSize(size);
return v;
} | java | private static Vector newVector(final int size) {
final Vector v = new Vector(size);
v.setSize(size);
return v;
} | [
"private",
"static",
"Vector",
"newVector",
"(",
"final",
"int",
"size",
")",
"{",
"final",
"Vector",
"v",
"=",
"new",
"Vector",
"(",
"size",
")",
";",
"v",
".",
"setSize",
"(",
"size",
")",
";",
"return",
"v",
";",
"}"
] | New vector.
@param size the size
@return the vector | [
"New",
"vector",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/model/table/JKDefaultTableModel.java#L118-L122 | train |
kiswanij/jk-util | src/main/java/com/jk/util/model/table/JKDefaultTableModel.java | JKDefaultTableModel.getColumnName | @Override
public String getColumnName(final int column) {
Object id = null;
// This test is to cover the case when
// getColumnCount has been subclassed by mistake ...
if (column < this.columnIdentifiers.size() && column >= 0) {
id = this.columnIdentifiers.elementAt(column);
}
return id == null ... | java | @Override
public String getColumnName(final int column) {
Object id = null;
// This test is to cover the case when
// getColumnCount has been subclassed by mistake ...
if (column < this.columnIdentifiers.size() && column >= 0) {
id = this.columnIdentifiers.elementAt(column);
}
return id == null ... | [
"@",
"Override",
"public",
"String",
"getColumnName",
"(",
"final",
"int",
"column",
")",
"{",
"Object",
"id",
"=",
"null",
";",
"// This test is to cover the case when\r",
"// getColumnCount has been subclassed by mistake ...\r",
"if",
"(",
"column",
"<",
"this",
".",
... | Returns the column name.
@param column the column
@return a name for this column using the string value of the appropriate
member in <code>columnIdentifiers</code>. If
<code>columnIdentifiers</code> does not have an entry for this index,
returns the default name provided by the superclass. | [
"Returns",
"the",
"column",
"name",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/model/table/JKDefaultTableModel.java#L359-L368 | train |
kiswanij/jk-util | src/main/java/com/jk/util/model/table/JKDefaultTableModel.java | JKDefaultTableModel.justifyRows | private void justifyRows(final int from, final int to) {
// Sometimes the DefaultTableModel is subclassed
// instead of the AbstractTableModel by mistake.
// Set the number of rows for the case when getRowCount
// is overridden.
this.dataVector.setSize(getRowCount());
for (int i = from; i < to; i++)... | java | private void justifyRows(final int from, final int to) {
// Sometimes the DefaultTableModel is subclassed
// instead of the AbstractTableModel by mistake.
// Set the number of rows for the case when getRowCount
// is overridden.
this.dataVector.setSize(getRowCount());
for (int i = from; i < to; i++)... | [
"private",
"void",
"justifyRows",
"(",
"final",
"int",
"from",
",",
"final",
"int",
"to",
")",
"{",
"// Sometimes the DefaultTableModel is subclassed\r",
"// instead of the AbstractTableModel by mistake.\r",
"// Set the number of rows for the case when getRowCount\r",
"// is overridd... | Justify rows.
@param from the from
@param to the to | [
"Justify",
"rows",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/model/table/JKDefaultTableModel.java#L466-L479 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKIOUtil.java | JKIOUtil.findPathJar | public static String findPathJar(final Class clas) throws IllegalStateException {
URL url;
String extURL;
try {
url = clas.getProtectionDomain().getCodeSource().getLocation();
} catch (final SecurityException ex) {
url = clas.getResource(clas.getSimpleName() + ".class");
}
extURL = url.toExter... | java | public static String findPathJar(final Class clas) throws IllegalStateException {
URL url;
String extURL;
try {
url = clas.getProtectionDomain().getCodeSource().getLocation();
} catch (final SecurityException ex) {
url = clas.getResource(clas.getSimpleName() + ".class");
}
extURL = url.toExter... | [
"public",
"static",
"String",
"findPathJar",
"(",
"final",
"Class",
"clas",
")",
"throws",
"IllegalStateException",
"{",
"URL",
"url",
";",
"String",
"extURL",
";",
"try",
"{",
"url",
"=",
"clas",
".",
"getProtectionDomain",
"(",
")",
".",
"getCodeSource",
"... | If the provided class has been loaded from a jar file that is on the local
file system, will find the absolute path to that jar file.
@param clas the clas
@return the string
@throws IllegalStateException If the specified class was loaded from a
directory or in some other way (such as via
HTTP, from a database, or some... | [
"If",
"the",
"provided",
"class",
"has",
"been",
"loaded",
"from",
"a",
"jar",
"file",
"that",
"is",
"on",
"the",
"local",
"file",
"system",
"will",
"find",
"the",
"absolute",
"path",
"to",
"that",
"jar",
"file",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKIOUtil.java#L93-L113 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKIOUtil.java | JKIOUtil.readStream | public static byte[] readStream(final InputStream inStream) {
try {
return IOUtils.toByteArray(inStream);
} catch (IOException e) {
throw new JKException(e);
}
//
// try {
// DataInputStream in = null;
// try {
// in = new DataInputStream(inStream);
// int ch;
//
// List<Byte> b... | java | public static byte[] readStream(final InputStream inStream) {
try {
return IOUtils.toByteArray(inStream);
} catch (IOException e) {
throw new JKException(e);
}
//
// try {
// DataInputStream in = null;
// try {
// in = new DataInputStream(inStream);
// int ch;
//
// List<Byte> b... | [
"public",
"static",
"byte",
"[",
"]",
"readStream",
"(",
"final",
"InputStream",
"inStream",
")",
"{",
"try",
"{",
"return",
"IOUtils",
".",
"toByteArray",
"(",
"inStream",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
"new",
"JKExc... | Read stream.
@param inStream the in stream
@return the byte[] | [
"Read",
"stream",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKIOUtil.java#L170-L196 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKIOUtil.java | JKIOUtil.convertToString | public static String convertToString(InputStream input) throws IOException {
try {
if (input == null) {
throw new IOException("Input Stream Cannot be NULL");
}
StringBuilder sb1 = new StringBuilder();
String line;
try {
BufferedReader r1 = new BufferedReader(new InputStreamReader(input,... | java | public static String convertToString(InputStream input) throws IOException {
try {
if (input == null) {
throw new IOException("Input Stream Cannot be NULL");
}
StringBuilder sb1 = new StringBuilder();
String line;
try {
BufferedReader r1 = new BufferedReader(new InputStreamReader(input,... | [
"public",
"static",
"String",
"convertToString",
"(",
"InputStream",
"input",
")",
"throws",
"IOException",
"{",
"try",
"{",
"if",
"(",
"input",
"==",
"null",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Input Stream Cannot be NULL\"",
")",
";",
"}",
"Stri... | Convert to string.
@param input the input
@return the string
@throws IOException Signals that an I/O exception has occurred. | [
"Convert",
"to",
"string",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKIOUtil.java#L205-L224 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKIOUtil.java | JKIOUtil.getReader | public static Reader getReader(String name) {
InputStream inputStream = getInputStream(name);
if (inputStream != null) {
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
return reader;
}
return null;
} | java | public static Reader getReader(String name) {
InputStream inputStream = getInputStream(name);
if (inputStream != null) {
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
return reader;
}
return null;
} | [
"public",
"static",
"Reader",
"getReader",
"(",
"String",
"name",
")",
"{",
"InputStream",
"inputStream",
"=",
"getInputStream",
"(",
"name",
")",
";",
"if",
"(",
"inputStream",
"!=",
"null",
")",
"{",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
... | Gets the reader.
@param name the name
@return the reader | [
"Gets",
"the",
"reader",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKIOUtil.java#L267-L274 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKIOUtil.java | JKIOUtil.getExtension | public static String getExtension(final String fileName, final boolean withPoint) {
final int lastIndexOf = fileName.lastIndexOf(".");
if (!withPoint) {
return fileName.substring(lastIndexOf + 1);
}
return fileName.substring(lastIndexOf);
} | java | public static String getExtension(final String fileName, final boolean withPoint) {
final int lastIndexOf = fileName.lastIndexOf(".");
if (!withPoint) {
return fileName.substring(lastIndexOf + 1);
}
return fileName.substring(lastIndexOf);
} | [
"public",
"static",
"String",
"getExtension",
"(",
"final",
"String",
"fileName",
",",
"final",
"boolean",
"withPoint",
")",
"{",
"final",
"int",
"lastIndexOf",
"=",
"fileName",
".",
"lastIndexOf",
"(",
"\".\"",
")",
";",
"if",
"(",
"!",
"withPoint",
")",
... | Gets the extension.
@param fileName the file name
@param withPoint the with point
@return the extension | [
"Gets",
"the",
"extension",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKIOUtil.java#L297-L303 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKIOUtil.java | JKIOUtil.removeExtension | public static String removeExtension(String fileName) {
final String separator = FILE_SEPARATOR;
String filename;
// Remove the path upto the filename.
final int lastSeparatorIndex = fileName.lastIndexOf(separator);
if (lastSeparatorIndex == -1) {
filename = fileName;
} else {
filename = fileN... | java | public static String removeExtension(String fileName) {
final String separator = FILE_SEPARATOR;
String filename;
// Remove the path upto the filename.
final int lastSeparatorIndex = fileName.lastIndexOf(separator);
if (lastSeparatorIndex == -1) {
filename = fileName;
} else {
filename = fileN... | [
"public",
"static",
"String",
"removeExtension",
"(",
"String",
"fileName",
")",
"{",
"final",
"String",
"separator",
"=",
"FILE_SEPARATOR",
";",
"String",
"filename",
";",
"// Remove the path upto the filename.\r",
"final",
"int",
"lastSeparatorIndex",
"=",
"fileName",... | Removes the extension.
@param fileName the file name
@return the string | [
"Removes",
"the",
"extension",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKIOUtil.java#L311-L329 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKIOUtil.java | JKIOUtil.writeDataToFile | public static File writeDataToFile(final byte[] data, final File file, final boolean append) {
try (FileOutputStream out = new FileOutputStream(file, append)) {
out.write(data);
out.flush();
out.close();
return file;
} catch (Exception e) {
JKExceptionUtil.handle(e);
return null;
}
} | java | public static File writeDataToFile(final byte[] data, final File file, final boolean append) {
try (FileOutputStream out = new FileOutputStream(file, append)) {
out.write(data);
out.flush();
out.close();
return file;
} catch (Exception e) {
JKExceptionUtil.handle(e);
return null;
}
} | [
"public",
"static",
"File",
"writeDataToFile",
"(",
"final",
"byte",
"[",
"]",
"data",
",",
"final",
"File",
"file",
",",
"final",
"boolean",
"append",
")",
"{",
"try",
"(",
"FileOutputStream",
"out",
"=",
"new",
"FileOutputStream",
"(",
"file",
",",
"appe... | Write data to file.
@param data the data
@param file the file
@param append the append
@return the file | [
"Write",
"data",
"to",
"file",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKIOUtil.java#L350-L360 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKIOUtil.java | JKIOUtil.readPropertiesStream | public static Properties readPropertiesStream(InputStream inputStream) {
try {
final Properties prop = new Properties();
// try to read in utf 8
prop.load(new InputStreamReader(inputStream, Charset.forName("utf-8")));
JKCollectionUtil.fixPropertiesKeys(prop);
return prop;
} catch (IOException ... | java | public static Properties readPropertiesStream(InputStream inputStream) {
try {
final Properties prop = new Properties();
// try to read in utf 8
prop.load(new InputStreamReader(inputStream, Charset.forName("utf-8")));
JKCollectionUtil.fixPropertiesKeys(prop);
return prop;
} catch (IOException ... | [
"public",
"static",
"Properties",
"readPropertiesStream",
"(",
"InputStream",
"inputStream",
")",
"{",
"try",
"{",
"final",
"Properties",
"prop",
"=",
"new",
"Properties",
"(",
")",
";",
"// try to read in utf 8\r",
"prop",
".",
"load",
"(",
"new",
"InputStreamRea... | Read properties stream.
@param inputStream the input stream
@return the properties | [
"Read",
"properties",
"stream",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKIOUtil.java#L368-L381 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKIOUtil.java | JKIOUtil.writeFileToTempDirectory | public static File writeFileToTempDirectory(final byte[] data, final String fileName) {
try {
File file = createTempDirectory();
File out = new File(file, fileName);
out.deleteOnExit();
file.deleteOnExit();
return writeDataToFile(data, out);
} catch (IOException e) {
JKExceptionUtil.handle... | java | public static File writeFileToTempDirectory(final byte[] data, final String fileName) {
try {
File file = createTempDirectory();
File out = new File(file, fileName);
out.deleteOnExit();
file.deleteOnExit();
return writeDataToFile(data, out);
} catch (IOException e) {
JKExceptionUtil.handle... | [
"public",
"static",
"File",
"writeFileToTempDirectory",
"(",
"final",
"byte",
"[",
"]",
"data",
",",
"final",
"String",
"fileName",
")",
"{",
"try",
"{",
"File",
"file",
"=",
"createTempDirectory",
"(",
")",
";",
"File",
"out",
"=",
"new",
"File",
"(",
"... | Write file to temp directory.
@param data the data
@param fileName the file name
@return the file | [
"Write",
"file",
"to",
"temp",
"directory",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKIOUtil.java#L422-L433 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKIOUtil.java | JKIOUtil.createTempFile | public static File createTempFile(final String ext) {
try {
File file;
file = File.createTempFile("jk-", "." + ext);
return file;
} catch (IOException e) {
JK.throww(e);
return null;
}
} | java | public static File createTempFile(final String ext) {
try {
File file;
file = File.createTempFile("jk-", "." + ext);
return file;
} catch (IOException e) {
JK.throww(e);
return null;
}
} | [
"public",
"static",
"File",
"createTempFile",
"(",
"final",
"String",
"ext",
")",
"{",
"try",
"{",
"File",
"file",
";",
"file",
"=",
"File",
".",
"createTempFile",
"(",
"\"jk-\"",
",",
"\".\"",
"+",
"ext",
")",
";",
"return",
"file",
";",
"}",
"catch",... | Creates the temp file.
@param ext the ext
@return the file | [
"Creates",
"the",
"temp",
"file",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKIOUtil.java#L485-L494 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKIOUtil.java | JKIOUtil.executeFile | public static Process executeFile(final String fileName) {
try {
final String command = "cmd /c \"" + fileName + "\"";
logger.info(command);
return Runtime.getRuntime().exec(command);
} catch (IOException e) {
throw new RuntimeException(e);
}
} | java | public static Process executeFile(final String fileName) {
try {
final String command = "cmd /c \"" + fileName + "\"";
logger.info(command);
return Runtime.getRuntime().exec(command);
} catch (IOException e) {
throw new RuntimeException(e);
}
} | [
"public",
"static",
"Process",
"executeFile",
"(",
"final",
"String",
"fileName",
")",
"{",
"try",
"{",
"final",
"String",
"command",
"=",
"\"cmd /c \\\"\"",
"+",
"fileName",
"+",
"\"\\\"\"",
";",
"logger",
".",
"info",
"(",
"command",
")",
";",
"return",
... | Execute file.
@param fileName String
@return the process | [
"Execute",
"file",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKIOUtil.java#L537-L545 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKIOUtil.java | JKIOUtil.getSqlFile | public static String getSqlFile(String fileName) {
String file = "/jk/sql/".concat(fileName);
logger.debug("Loading sql file: ", file);
return readFile(file);
} | java | public static String getSqlFile(String fileName) {
String file = "/jk/sql/".concat(fileName);
logger.debug("Loading sql file: ", file);
return readFile(file);
} | [
"public",
"static",
"String",
"getSqlFile",
"(",
"String",
"fileName",
")",
"{",
"String",
"file",
"=",
"\"/jk/sql/\"",
".",
"concat",
"(",
"fileName",
")",
";",
"logger",
".",
"debug",
"(",
"\"Loading sql file: \"",
",",
"file",
")",
";",
"return",
"readFil... | Gets the sql file.
@param fileName the file name
@return the sql file | [
"Gets",
"the",
"sql",
"file",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKIOUtil.java#L553-L557 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKIOUtil.java | JKIOUtil.clearTempFiles | public static void clearTempFiles() {
String userFolderPath = getUserFolderPath(false);
File file = new File(userFolderPath);
deleteDir(file);
} | java | public static void clearTempFiles() {
String userFolderPath = getUserFolderPath(false);
File file = new File(userFolderPath);
deleteDir(file);
} | [
"public",
"static",
"void",
"clearTempFiles",
"(",
")",
"{",
"String",
"userFolderPath",
"=",
"getUserFolderPath",
"(",
"false",
")",
";",
"File",
"file",
"=",
"new",
"File",
"(",
"userFolderPath",
")",
";",
"deleteDir",
"(",
"file",
")",
";",
"}"
] | Clear temp files. | [
"Clear",
"temp",
"files",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKIOUtil.java#L652-L656 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKIOUtil.java | JKIOUtil.startFakeThread | public static void startFakeThread(ServerSocket server) {
Thread thread = new Thread(new FakeRunnable(server));
thread.start();
} | java | public static void startFakeThread(ServerSocket server) {
Thread thread = new Thread(new FakeRunnable(server));
thread.start();
} | [
"public",
"static",
"void",
"startFakeThread",
"(",
"ServerSocket",
"server",
")",
"{",
"Thread",
"thread",
"=",
"new",
"Thread",
"(",
"new",
"FakeRunnable",
"(",
"server",
")",
")",
";",
"thread",
".",
"start",
"(",
")",
";",
"}"
] | Start fake thread.
@param server the server | [
"Start",
"fake",
"thread",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKIOUtil.java#L687-L690 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKIOUtil.java | JKIOUtil.getReportsOutPath | public static String getReportsOutPath(boolean appendFileSeprator) {
String userLocalPath = getUserFolderPath(true);
String reportPath = userLocalPath + REPORTS_OUT_PATH;
checkFolderPath(reportPath, true);// to create the folder if not exist
if (appendFileSeprator) {
reportPath += FILE_SEPARATOR;
}
... | java | public static String getReportsOutPath(boolean appendFileSeprator) {
String userLocalPath = getUserFolderPath(true);
String reportPath = userLocalPath + REPORTS_OUT_PATH;
checkFolderPath(reportPath, true);// to create the folder if not exist
if (appendFileSeprator) {
reportPath += FILE_SEPARATOR;
}
... | [
"public",
"static",
"String",
"getReportsOutPath",
"(",
"boolean",
"appendFileSeprator",
")",
"{",
"String",
"userLocalPath",
"=",
"getUserFolderPath",
"(",
"true",
")",
";",
"String",
"reportPath",
"=",
"userLocalPath",
"+",
"REPORTS_OUT_PATH",
";",
"checkFolderPath"... | Gets the reports out path.
@param appendFileSeprator the append file seprator
@return the reports out path | [
"Gets",
"the",
"reports",
"out",
"path",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKIOUtil.java#L698-L706 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKIOUtil.java | JKIOUtil.getFilesInFolder | public static List<String> getFilesInFolder(String folder, String ext) {
// tryto find using normal file system lookup
List<String> files = new Vector<>();
File dir = new File(folder);
if (dir.exists() && dir.isDirectory()) {
String[] list = dir.list();
for (String file : list) {
if (file.endsW... | java | public static List<String> getFilesInFolder(String folder, String ext) {
// tryto find using normal file system lookup
List<String> files = new Vector<>();
File dir = new File(folder);
if (dir.exists() && dir.isDirectory()) {
String[] list = dir.list();
for (String file : list) {
if (file.endsW... | [
"public",
"static",
"List",
"<",
"String",
">",
"getFilesInFolder",
"(",
"String",
"folder",
",",
"String",
"ext",
")",
"{",
"// tryto find using normal file system lookup\r",
"List",
"<",
"String",
">",
"files",
"=",
"new",
"Vector",
"<>",
"(",
")",
";",
"Fil... | Gets the files in folder.
@param folder the folder
@param ext the ext
@return the files in folder | [
"Gets",
"the",
"files",
"in",
"folder",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKIOUtil.java#L724-L737 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKIOUtil.java | JKIOUtil.copResourcesFromJarToDir | public static void copResourcesFromJarToDir(String sourceClassPath, File dest) {
try {
List<File> resourcesInnPackage = getResourcesInnPackage(sourceClassPath);
for (File file : resourcesInnPackage) {
JK.printBlock("Copying file: " + file.getName() + " to folder " + dest.getAbsolutePath());
FileUti... | java | public static void copResourcesFromJarToDir(String sourceClassPath, File dest) {
try {
List<File> resourcesInnPackage = getResourcesInnPackage(sourceClassPath);
for (File file : resourcesInnPackage) {
JK.printBlock("Copying file: " + file.getName() + " to folder " + dest.getAbsolutePath());
FileUti... | [
"public",
"static",
"void",
"copResourcesFromJarToDir",
"(",
"String",
"sourceClassPath",
",",
"File",
"dest",
")",
"{",
"try",
"{",
"List",
"<",
"File",
">",
"resourcesInnPackage",
"=",
"getResourcesInnPackage",
"(",
"sourceClassPath",
")",
";",
"for",
"(",
"Fi... | Cop resources from jar to dir.
@param sourceClassPath the source class path
@param dest the dest | [
"Cop",
"resources",
"from",
"jar",
"to",
"dir",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKIOUtil.java#L745-L756 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKIOUtil.java | JKIOUtil.getResourcesInnPackage | public static List<File> getResourcesInnPackage(String root) {
try {
logger.debug("getResourcesInnPackage for package: " + root);
ClassLoader loader = Thread.currentThread().getContextClassLoader();
URL url = loader.getResource(root);
if (url != null) {
logger.debug(" URL :" + url.toURI());
... | java | public static List<File> getResourcesInnPackage(String root) {
try {
logger.debug("getResourcesInnPackage for package: " + root);
ClassLoader loader = Thread.currentThread().getContextClassLoader();
URL url = loader.getResource(root);
if (url != null) {
logger.debug(" URL :" + url.toURI());
... | [
"public",
"static",
"List",
"<",
"File",
">",
"getResourcesInnPackage",
"(",
"String",
"root",
")",
"{",
"try",
"{",
"logger",
".",
"debug",
"(",
"\"getResourcesInnPackage for package: \"",
"+",
"root",
")",
";",
"ClassLoader",
"loader",
"=",
"Thread",
".",
"c... | Gets the resources inn package.
@param root the root
@return the resources inn package | [
"Gets",
"the",
"resources",
"inn",
"package",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKIOUtil.java#L764-L798 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKIOUtil.java | JKIOUtil.readConfigFile | public static JKConfig readConfigFile(String configFileName) {
URL url = getURL(configFileName);
logger.debug(configFileName + " Url is ", url.toString());
JKConfig config = new JKConfig(url);
return config;
} | java | public static JKConfig readConfigFile(String configFileName) {
URL url = getURL(configFileName);
logger.debug(configFileName + " Url is ", url.toString());
JKConfig config = new JKConfig(url);
return config;
} | [
"public",
"static",
"JKConfig",
"readConfigFile",
"(",
"String",
"configFileName",
")",
"{",
"URL",
"url",
"=",
"getURL",
"(",
"configFileName",
")",
";",
"logger",
".",
"debug",
"(",
"configFileName",
"+",
"\" Url is \"",
",",
"url",
".",
"toString",
"(",
"... | Read config file.
@param configFileName the config file name
@return the JK config | [
"Read",
"config",
"file",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKIOUtil.java#L806-L811 | train |
kiswanij/jk-util | src/main/java/com/jk/util/NumbersToWords.java | NumbersToWords.convertLessThanOneThousand | private static String convertLessThanOneThousand(int number) {
String soFar;
if (number % 100 < 20) {
soFar = numNames[number % 100];
number /= 100;
} else {
soFar = numNames[number % 10];
number /= 10;
soFar = tensNames[number % 10] + soFar;
number /= 10;
}
if (number == 0) {... | java | private static String convertLessThanOneThousand(int number) {
String soFar;
if (number % 100 < 20) {
soFar = numNames[number % 100];
number /= 100;
} else {
soFar = numNames[number % 10];
number /= 10;
soFar = tensNames[number % 10] + soFar;
number /= 10;
}
if (number == 0) {... | [
"private",
"static",
"String",
"convertLessThanOneThousand",
"(",
"int",
"number",
")",
"{",
"String",
"soFar",
";",
"if",
"(",
"number",
"%",
"100",
"<",
"20",
")",
"{",
"soFar",
"=",
"numNames",
"[",
"number",
"%",
"100",
"]",
";",
"number",
"/=",
"1... | Convert less than one thousand.
@param number the number
@return the string | [
"Convert",
"less",
"than",
"one",
"thousand",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/NumbersToWords.java#L119-L136 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKNumbersUtil.java | JKNumbersUtil.addAmounts | public static double addAmounts(final double num1, final double num2) {
final BigDecimal b1 = new BigDecimal(num1);
final BigDecimal b2 = new BigDecimal(num2);
BigDecimal b3 = b1.add(b2);
b3 = b3.setScale(3, BigDecimal.ROUND_HALF_UP);
final double result = b3.doubleValue();
return result;
} | java | public static double addAmounts(final double num1, final double num2) {
final BigDecimal b1 = new BigDecimal(num1);
final BigDecimal b2 = new BigDecimal(num2);
BigDecimal b3 = b1.add(b2);
b3 = b3.setScale(3, BigDecimal.ROUND_HALF_UP);
final double result = b3.doubleValue();
return result;
} | [
"public",
"static",
"double",
"addAmounts",
"(",
"final",
"double",
"num1",
",",
"final",
"double",
"num2",
")",
"{",
"final",
"BigDecimal",
"b1",
"=",
"new",
"BigDecimal",
"(",
"num1",
")",
";",
"final",
"BigDecimal",
"b2",
"=",
"new",
"BigDecimal",
"(",
... | Adds the amounts.
@param num1 the num 1
@param num2 the num 2
@return the double | [
"Adds",
"the",
"amounts",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKNumbersUtil.java#L36-L43 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKNumbersUtil.java | JKNumbersUtil.fixAmount | public static double fixAmount(final double value) {
final BigDecimal b1 = new BigDecimal(value);
final BigDecimal b2 = b1.setScale(3, BigDecimal.ROUND_HALF_UP);
return b2.doubleValue();
} | java | public static double fixAmount(final double value) {
final BigDecimal b1 = new BigDecimal(value);
final BigDecimal b2 = b1.setScale(3, BigDecimal.ROUND_HALF_UP);
return b2.doubleValue();
} | [
"public",
"static",
"double",
"fixAmount",
"(",
"final",
"double",
"value",
")",
"{",
"final",
"BigDecimal",
"b1",
"=",
"new",
"BigDecimal",
"(",
"value",
")",
";",
"final",
"BigDecimal",
"b2",
"=",
"b1",
".",
"setScale",
"(",
"3",
",",
"BigDecimal",
"."... | Fix amount.
@param value the value
@return the double | [
"Fix",
"amount",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKNumbersUtil.java#L67-L71 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKNumbersUtil.java | JKNumbersUtil.subAmounts | public static double subAmounts(final double n1, final double n2) {
final BigDecimal b1 = new BigDecimal(n1);
final BigDecimal b2 = new BigDecimal(n2);
BigDecimal b3 = b1.subtract(b2);
b3 = b3.setScale(3, BigDecimal.ROUND_HALF_UP);
final double result = b3.doubleValue();
return result;
} | java | public static double subAmounts(final double n1, final double n2) {
final BigDecimal b1 = new BigDecimal(n1);
final BigDecimal b2 = new BigDecimal(n2);
BigDecimal b3 = b1.subtract(b2);
b3 = b3.setScale(3, BigDecimal.ROUND_HALF_UP);
final double result = b3.doubleValue();
return result;
} | [
"public",
"static",
"double",
"subAmounts",
"(",
"final",
"double",
"n1",
",",
"final",
"double",
"n2",
")",
"{",
"final",
"BigDecimal",
"b1",
"=",
"new",
"BigDecimal",
"(",
"n1",
")",
";",
"final",
"BigDecimal",
"b2",
"=",
"new",
"BigDecimal",
"(",
"n2"... | Sub amounts.
@param n1 the n 1
@param n2 the n 2
@return the double | [
"Sub",
"amounts",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKNumbersUtil.java#L105-L112 | train |
kiswanij/jk-util | src/main/java/com/jk/util/mail/MailInfo.java | MailInfo.fillEmail | public void fillEmail(final MultiPartEmail email) throws EmailException, IOException {
email.setHostName(getHost());
email.setSmtpPort(getSmtpPort());
email.addTo(getTo());
email.setFrom(getFrom());
email.setSubject(getSubject());
email.setMsg(getMsg());
email.setSSLOnConnect(isSecured());
if(this.bcc!... | java | public void fillEmail(final MultiPartEmail email) throws EmailException, IOException {
email.setHostName(getHost());
email.setSmtpPort(getSmtpPort());
email.addTo(getTo());
email.setFrom(getFrom());
email.setSubject(getSubject());
email.setMsg(getMsg());
email.setSSLOnConnect(isSecured());
if(this.bcc!... | [
"public",
"void",
"fillEmail",
"(",
"final",
"MultiPartEmail",
"email",
")",
"throws",
"EmailException",
",",
"IOException",
"{",
"email",
".",
"setHostName",
"(",
"getHost",
"(",
")",
")",
";",
"email",
".",
"setSmtpPort",
"(",
"getSmtpPort",
"(",
")",
")",... | Fill email.
@param email the email
@throws EmailException the email exception
@throws IOException Signals that an I/O exception has occurred. | [
"Fill",
"email",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/mail/MailInfo.java#L88-L118 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKConversionUtil.java | JKConversionUtil.toDate | public static Date toDate(final Object value) {
if (value instanceof Date) {
return (Date) value;
}
if (value == null || value.equals("null")) {
return null;
}
if (value instanceof String) {
throw new IllegalStateException("fix me");
}
return null;
} | java | public static Date toDate(final Object value) {
if (value instanceof Date) {
return (Date) value;
}
if (value == null || value.equals("null")) {
return null;
}
if (value instanceof String) {
throw new IllegalStateException("fix me");
}
return null;
} | [
"public",
"static",
"Date",
"toDate",
"(",
"final",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"instanceof",
"Date",
")",
"{",
"return",
"(",
"Date",
")",
"value",
";",
"}",
"if",
"(",
"value",
"==",
"null",
"||",
"value",
".",
"equals",
"(",
... | To date.
@param value the value
@return the date | [
"To",
"date",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKConversionUtil.java#L45-L57 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKConversionUtil.java | JKConversionUtil.toFloat | public static float toFloat(final Object value) {
if (value instanceof Float) {
return (float) value;
}
if (value == null) {
return 0;
}
return new Float(value.toString());
} | java | public static float toFloat(final Object value) {
if (value instanceof Float) {
return (float) value;
}
if (value == null) {
return 0;
}
return new Float(value.toString());
} | [
"public",
"static",
"float",
"toFloat",
"(",
"final",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"instanceof",
"Float",
")",
"{",
"return",
"(",
"float",
")",
"value",
";",
"}",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"0",
";",
... | To float.
@param value the value
@return the float | [
"To",
"float",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKConversionUtil.java#L75-L83 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKConversionUtil.java | JKConversionUtil.toTime | public static java.sql.Time toTime(final Object value) {
if (value == null) {
return null;
}
if (value instanceof java.sql.Time) {
return (java.sql.Time) value;
}
if (value instanceof java.util.Date) {
final Date date = (java.util.Date) value;
return new java.sql.Time(date.getTime());
... | java | public static java.sql.Time toTime(final Object value) {
if (value == null) {
return null;
}
if (value instanceof java.sql.Time) {
return (java.sql.Time) value;
}
if (value instanceof java.util.Date) {
final Date date = (java.util.Date) value;
return new java.sql.Time(date.getTime());
... | [
"public",
"static",
"java",
".",
"sql",
".",
"Time",
"toTime",
"(",
"final",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"value",
"instanceof",
"java",
".",
"sql",
".",
"Time",
")"... | To time.
@param value the value
@return the java.sql. time | [
"To",
"time",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKConversionUtil.java#L111-L123 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKConversionUtil.java | JKConversionUtil.toBoolean | public static boolean toBoolean(Object value, boolean defaultValue) {
boolean result;// = defaultValue;
if (value != null) {
if (value instanceof Boolean) {
return ((Boolean) value).booleanValue();
}
if (value.toString().trim().equals("1") || value.toString().trim().toLowerCase().equals("true")... | java | public static boolean toBoolean(Object value, boolean defaultValue) {
boolean result;// = defaultValue;
if (value != null) {
if (value instanceof Boolean) {
return ((Boolean) value).booleanValue();
}
if (value.toString().trim().equals("1") || value.toString().trim().toLowerCase().equals("true")... | [
"public",
"static",
"boolean",
"toBoolean",
"(",
"Object",
"value",
",",
"boolean",
"defaultValue",
")",
"{",
"boolean",
"result",
";",
"// = defaultValue;\r",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"if",
"(",
"value",
"instanceof",
"Boolean",
")",
"{",... | To boolean.
@param value the value
@param defaultValue the default value
@return true, if successful | [
"To",
"boolean",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKConversionUtil.java#L132-L149 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKConversionUtil.java | JKConversionUtil.toDouble | public static double toDouble(Object value, double defaultValue) {
if (value == null || value.toString().trim().equals("")) {
return defaultValue;
}
if (value instanceof Double) {
return (double) value;
}
if (value instanceof Date) {
final Date date = (Date) value;
return date.getTime();
... | java | public static double toDouble(Object value, double defaultValue) {
if (value == null || value.toString().trim().equals("")) {
return defaultValue;
}
if (value instanceof Double) {
return (double) value;
}
if (value instanceof Date) {
final Date date = (Date) value;
return date.getTime();
... | [
"public",
"static",
"double",
"toDouble",
"(",
"Object",
"value",
",",
"double",
"defaultValue",
")",
"{",
"if",
"(",
"value",
"==",
"null",
"||",
"value",
".",
"toString",
"(",
")",
".",
"trim",
"(",
")",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",
... | To double.
@param value the value
@param defaultValue the default value
@return the double | [
"To",
"double",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKConversionUtil.java#L158-L170 | train |
kiswanij/jk-util | src/main/java/com/jk/util/JKConversionUtil.java | JKConversionUtil.toInteger | public static int toInteger(Object value, int defaultValue) {
if (value == null || value.toString().trim().equals("")) {
return defaultValue;
}
if (value instanceof Integer) {
return (Integer) value;
}
return (int) JKConversionUtil.toDouble(value);
} | java | public static int toInteger(Object value, int defaultValue) {
if (value == null || value.toString().trim().equals("")) {
return defaultValue;
}
if (value instanceof Integer) {
return (Integer) value;
}
return (int) JKConversionUtil.toDouble(value);
} | [
"public",
"static",
"int",
"toInteger",
"(",
"Object",
"value",
",",
"int",
"defaultValue",
")",
"{",
"if",
"(",
"value",
"==",
"null",
"||",
"value",
".",
"toString",
"(",
")",
".",
"trim",
"(",
")",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",
"ret... | To integer.
@param value the value
@param defaultValue the default value
@return the int | [
"To",
"integer",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKConversionUtil.java#L179-L187 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/Validation.java | Validation.validateNotationObjects | public static void validateNotationObjects(HELM2Notation helm2notation) throws PolymerIDsException,
MonomerException, GroupingNotationException, ConnectionNotationException, NotationException,
ChemistryException, MonomerLoadingException, org.helm.notation2.parser.exceptionparser.NotationException {
LOG.info(... | java | public static void validateNotationObjects(HELM2Notation helm2notation) throws PolymerIDsException,
MonomerException, GroupingNotationException, ConnectionNotationException, NotationException,
ChemistryException, MonomerLoadingException, org.helm.notation2.parser.exceptionparser.NotationException {
LOG.info(... | [
"public",
"static",
"void",
"validateNotationObjects",
"(",
"HELM2Notation",
"helm2notation",
")",
"throws",
"PolymerIDsException",
",",
"MonomerException",
",",
"GroupingNotationException",
",",
"ConnectionNotationException",
",",
"NotationException",
",",
"ChemistryException"... | method to check if the generated notation objects by the parser are
correct the polymer ids have to be unique; all monomers have to be valid;
all used polymer ids in the grouping section have to be there; all
connections have to be valid
@param helm2notation
HELM2Notation object
@throws PolymerIDsException
if the poly... | [
"method",
"to",
"check",
"if",
"the",
"generated",
"notation",
"objects",
"by",
"the",
"parser",
"are",
"correct",
"the",
"polymer",
"ids",
"have",
"to",
"be",
"unique",
";",
"all",
"monomers",
"have",
"to",
"be",
"valid",
";",
"all",
"used",
"polymer",
... | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/Validation.java#L108-L132 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/Validation.java | Validation.validateMonomers | protected static boolean validateMonomers(List<MonomerNotation> mon) throws ChemistryException,
MonomerLoadingException, org.helm.notation2.parser.exceptionparser.NotationException {
for (MonomerNotation monomerNotation : mon) {
if (!(isMonomerValid(monomerNotation.getUnit(), monomerNotation.getType()))) {
... | java | protected static boolean validateMonomers(List<MonomerNotation> mon) throws ChemistryException,
MonomerLoadingException, org.helm.notation2.parser.exceptionparser.NotationException {
for (MonomerNotation monomerNotation : mon) {
if (!(isMonomerValid(monomerNotation.getUnit(), monomerNotation.getType()))) {
... | [
"protected",
"static",
"boolean",
"validateMonomers",
"(",
"List",
"<",
"MonomerNotation",
">",
"mon",
")",
"throws",
"ChemistryException",
",",
"MonomerLoadingException",
",",
"org",
".",
"helm",
".",
"notation2",
".",
"parser",
".",
"exceptionparser",
".",
"Nota... | method to validate a list of MonomerNotation objects
@param mon
List of MonomerNotation objects
@return true if all monomers are valid, false otherwise
@throws ChemistryException
if the Chemistry Engine can not be initialized
@throws MonomerLoadingException
if monomer loading was not successfull
@throws org.helm.notat... | [
"method",
"to",
"validate",
"a",
"list",
"of",
"MonomerNotation",
"objects"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/Validation.java#L147-L155 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/Validation.java | Validation.isConnectionSpecific | private static boolean isConnectionSpecific(ConnectionNotation connectionNotation) {
String connection = connectionNotation.getSourceUnit() + ":" + connectionNotation.getrGroupSource() + "-"
+ connectionNotation.getTargetUnit() + ":" + connectionNotation.getrGroupTarget();
/* check for specific interaction *... | java | private static boolean isConnectionSpecific(ConnectionNotation connectionNotation) {
String connection = connectionNotation.getSourceUnit() + ":" + connectionNotation.getrGroupSource() + "-"
+ connectionNotation.getTargetUnit() + ":" + connectionNotation.getrGroupTarget();
/* check for specific interaction *... | [
"private",
"static",
"boolean",
"isConnectionSpecific",
"(",
"ConnectionNotation",
"connectionNotation",
")",
"{",
"String",
"connection",
"=",
"connectionNotation",
".",
"getSourceUnit",
"(",
")",
"+",
"\":\"",
"+",
"connectionNotation",
".",
"getrGroupSource",
"(",
... | method to check if the given connection is specific
@param connectionNotation
input ConnectionNotation
@return true if the described connection is specific, false otherwise | [
"method",
"to",
"check",
"if",
"the",
"given",
"connection",
"is",
"specific"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/Validation.java#L274-L282 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/Validation.java | Validation.getOccurencesOfMonomerNotation | private static List<Integer> getOccurencesOfMonomerNotation(String sourceUnit, HELMEntity e,
HELM2Notation helm2notation)
throws org.helm.notation2.parser.exceptionparser.NotationException, AttachmentException {
List<Integer> occurences = new ArrayList<Integer>();
/* The monomer's position in the poly... | java | private static List<Integer> getOccurencesOfMonomerNotation(String sourceUnit, HELMEntity e,
HELM2Notation helm2notation)
throws org.helm.notation2.parser.exceptionparser.NotationException, AttachmentException {
List<Integer> occurences = new ArrayList<Integer>();
/* The monomer's position in the poly... | [
"private",
"static",
"List",
"<",
"Integer",
">",
"getOccurencesOfMonomerNotation",
"(",
"String",
"sourceUnit",
",",
"HELMEntity",
"e",
",",
"HELM2Notation",
"helm2notation",
")",
"throws",
"org",
".",
"helm",
".",
"notation2",
".",
"parser",
".",
"exceptionparse... | method to get all occurences of the MonomerNotation
@param sourceUnit
given monomernotation to look for
@param e
HELMEntity of the sourceUnit
@param helm2notation
HELM2Notation object
@return occurences of the MonomerNotation
@throws org.helm.notation2.parser.exceptionparser.NotationException
@throws AttachmentExcepti... | [
"method",
"to",
"get",
"all",
"occurences",
"of",
"the",
"MonomerNotation"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/Validation.java#L298-L352 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/Validation.java | Validation.validateGrouping | public static boolean validateGrouping(HELM2Notation helm2notation) {
List<GroupingNotation> listGroupings = helm2notation.getListOfGroupings();
List<String> listPolymerIDs = helm2notation.getPolymerAndGroupingIDs();
/* validate each group */
for (GroupingNotation grouping : listGroupings) {
/* check ... | java | public static boolean validateGrouping(HELM2Notation helm2notation) {
List<GroupingNotation> listGroupings = helm2notation.getListOfGroupings();
List<String> listPolymerIDs = helm2notation.getPolymerAndGroupingIDs();
/* validate each group */
for (GroupingNotation grouping : listGroupings) {
/* check ... | [
"public",
"static",
"boolean",
"validateGrouping",
"(",
"HELM2Notation",
"helm2notation",
")",
"{",
"List",
"<",
"GroupingNotation",
">",
"listGroupings",
"=",
"helm2notation",
".",
"getListOfGroupings",
"(",
")",
";",
"List",
"<",
"String",
">",
"listPolymerIDs",
... | method to validate every GroupNotation of the Notation objects
@param helm2notation
HELM2Notation object
@return true if the grouping is valid, false otherwise | [
"method",
"to",
"validate",
"every",
"GroupNotation",
"of",
"the",
"Notation",
"objects"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/Validation.java#L385-L400 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/Validation.java | Validation.validateUniquePolymerIDs | public static boolean validateUniquePolymerIDs(HELM2Notation helm2notation) {
List<String> listPolymerIDs = helm2notation.getPolymerAndGroupingIDs();
Map<String, String> uniqueId = new HashMap<String, String>();
for (String polymerID : listPolymerIDs) {
uniqueId.put(polymerID, "");
}
if (listPolymerI... | java | public static boolean validateUniquePolymerIDs(HELM2Notation helm2notation) {
List<String> listPolymerIDs = helm2notation.getPolymerAndGroupingIDs();
Map<String, String> uniqueId = new HashMap<String, String>();
for (String polymerID : listPolymerIDs) {
uniqueId.put(polymerID, "");
}
if (listPolymerI... | [
"public",
"static",
"boolean",
"validateUniquePolymerIDs",
"(",
"HELM2Notation",
"helm2notation",
")",
"{",
"List",
"<",
"String",
">",
"listPolymerIDs",
"=",
"helm2notation",
".",
"getPolymerAndGroupingIDs",
"(",
")",
";",
"Map",
"<",
"String",
",",
"String",
">"... | method to check if all existent polymer ids are unique
@param helm2notation
HELM2Notation object
@return true if all polymers are unique, false otherwise | [
"method",
"to",
"check",
"if",
"all",
"existent",
"polymer",
"ids",
"are",
"unique"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/Validation.java#L409-L421 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/Validation.java | Validation.checkExistenceOfPolymerID | private static void checkExistenceOfPolymerID(String str, List<String> listPolymerIDs) throws PolymerIDsException {
if (!(listPolymerIDs.contains(str))) {
LOG.info("Polymer Id does not exist");
throw new PolymerIDsException("Polymer ID does not exist");
}
} | java | private static void checkExistenceOfPolymerID(String str, List<String> listPolymerIDs) throws PolymerIDsException {
if (!(listPolymerIDs.contains(str))) {
LOG.info("Polymer Id does not exist");
throw new PolymerIDsException("Polymer ID does not exist");
}
} | [
"private",
"static",
"void",
"checkExistenceOfPolymerID",
"(",
"String",
"str",
",",
"List",
"<",
"String",
">",
"listPolymerIDs",
")",
"throws",
"PolymerIDsException",
"{",
"if",
"(",
"!",
"(",
"listPolymerIDs",
".",
"contains",
"(",
"str",
")",
")",
")",
"... | method to check if the given polymer id exists in the given list of
polymer ids
@param str
polymer id
@param listPolymerIDs
List of polymer ids
@return true if the polymer id exists, false otherwise
@throws PolymerIDsException
if the polymer id does not exist | [
"method",
"to",
"check",
"if",
"the",
"given",
"polymer",
"id",
"exists",
"in",
"the",
"given",
"list",
"of",
"polymer",
"ids"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/Validation.java#L435-L440 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/Validation.java | Validation.isMonomerValid | private static boolean isMonomerValid(String str, String type) throws ChemistryException, MonomerLoadingException,
org.helm.notation2.parser.exceptionparser.NotationException {
LOG.info("Is Monomer valid: " + str);
MonomerFactory monomerFactory = null;
monomerFactory = MonomerFactory.getInstance();
/*... | java | private static boolean isMonomerValid(String str, String type) throws ChemistryException, MonomerLoadingException,
org.helm.notation2.parser.exceptionparser.NotationException {
LOG.info("Is Monomer valid: " + str);
MonomerFactory monomerFactory = null;
monomerFactory = MonomerFactory.getInstance();
/*... | [
"private",
"static",
"boolean",
"isMonomerValid",
"(",
"String",
"str",
",",
"String",
"type",
")",
"throws",
"ChemistryException",
",",
"MonomerLoadingException",
",",
"org",
".",
"helm",
".",
"notation2",
".",
"parser",
".",
"exceptionparser",
".",
"NotationExce... | method to check the monomer's validation
@param str
monomer id
@param type
type of monomer
@return true if the monomer is valid, false otherwise
@throws ChemistryException
if the Chemistry Engine can not be initialized
@throws MonomerLoadingException
if momomers can not be loaded
@throws org.helm.notation2.parser.exce... | [
"method",
"to",
"check",
"the",
"monomer",
"s",
"validation"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/Validation.java#L456-L509 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/Validation.java | Validation.checkPolymerIDSConnection | private static void checkPolymerIDSConnection(ConnectionNotation not, List<String> listPolymerIDs)
throws PolymerIDsException {
/* the polymer ids have to be there */
checkExistenceOfPolymerID(not.getSourceId().getId(), listPolymerIDs);
checkExistenceOfPolymerID(not.getTargetId().getId(), listPolymerIDs);
... | java | private static void checkPolymerIDSConnection(ConnectionNotation not, List<String> listPolymerIDs)
throws PolymerIDsException {
/* the polymer ids have to be there */
checkExistenceOfPolymerID(not.getSourceId().getId(), listPolymerIDs);
checkExistenceOfPolymerID(not.getTargetId().getId(), listPolymerIDs);
... | [
"private",
"static",
"void",
"checkPolymerIDSConnection",
"(",
"ConnectionNotation",
"not",
",",
"List",
"<",
"String",
">",
"listPolymerIDs",
")",
"throws",
"PolymerIDsException",
"{",
"/* the polymer ids have to be there */",
"checkExistenceOfPolymerID",
"(",
"not",
".",
... | method to check for one connection if the two polymer ids exist
@param not
ConnectionNotation
@param listPolymerIDs
List of polymer ids
@throws PolymerIDsException
if the polymer ids do not exist | [
"method",
"to",
"check",
"for",
"one",
"connection",
"if",
"the",
"two",
"polymer",
"ids",
"exist"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/Validation.java#L521-L526 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/Validation.java | Validation.getAllMonomers | public static List<Monomer> getAllMonomers(MonomerNotation not, int position) throws HELM2HandledException,
MonomerException, NotationException, ChemistryException, CTKException, MonomerLoadingException {
List<Monomer> monomers = new ArrayList<Monomer>();
MonomerFactory monomerFactory = MonomerFactory.getIn... | java | public static List<Monomer> getAllMonomers(MonomerNotation not, int position) throws HELM2HandledException,
MonomerException, NotationException, ChemistryException, CTKException, MonomerLoadingException {
List<Monomer> monomers = new ArrayList<Monomer>();
MonomerFactory monomerFactory = MonomerFactory.getIn... | [
"public",
"static",
"List",
"<",
"Monomer",
">",
"getAllMonomers",
"(",
"MonomerNotation",
"not",
",",
"int",
"position",
")",
"throws",
"HELM2HandledException",
",",
"MonomerException",
",",
"NotationException",
",",
"ChemistryException",
",",
"CTKException",
",",
... | method to get for one MonomerNotation all valid contained monomers
@param not
MonomerNotation
@param position
position of monomer notation
@return List of Monomer
@throws HELM2HandledException
if HELM2 features were there
@throws MonomerException
if monomer is not valid
@throws NotationException
if notation is not va... | [
"method",
"to",
"get",
"for",
"one",
"MonomerNotation",
"all",
"valid",
"contained",
"monomers"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/Validation.java#L550-L591 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/Validation.java | Validation.getAllMonomersOnlyBase | public static List<Monomer> getAllMonomersOnlyBase(MonomerNotation not) throws HELM2HandledException,
MonomerException, NotationException, ChemistryException, CTKException, MonomerLoadingException {
LOG.debug("Get base for " + not);
List<Monomer> monomers = new ArrayList<Monomer>();
MonomerFactory monome... | java | public static List<Monomer> getAllMonomersOnlyBase(MonomerNotation not) throws HELM2HandledException,
MonomerException, NotationException, ChemistryException, CTKException, MonomerLoadingException {
LOG.debug("Get base for " + not);
List<Monomer> monomers = new ArrayList<Monomer>();
MonomerFactory monome... | [
"public",
"static",
"List",
"<",
"Monomer",
">",
"getAllMonomersOnlyBase",
"(",
"MonomerNotation",
"not",
")",
"throws",
"HELM2HandledException",
",",
"MonomerException",
",",
"NotationException",
",",
"ChemistryException",
",",
"CTKException",
",",
"MonomerLoadingExcepti... | method to get for one MonomerNotation all valid contained monomers. But
only the Base
@param not
MonomerNotation
@return List of all base monomers
@throws HELM2HandledException
if HELM2 features were there
@throws MonomerException
if monomer is not valid
@throws NotationException
if notation is not valid
@throws Chem... | [
"method",
"to",
"get",
"for",
"one",
"MonomerNotation",
"all",
"valid",
"contained",
"monomers",
".",
"But",
"only",
"the",
"Base"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/Validation.java#L614-L658 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/Validation.java | Validation.checkAttachmentPoint | private static void checkAttachmentPoint(Monomer mon, String str) throws AttachmentException {
if (!(mon.getAttachmentListString().contains(str))) {
if (!(str.equals("?") || str.equals("pair")) && !mon.getAlternateId().equals("?")) {
LOG.info("Attachment point for source is not there");
throw new Attac... | java | private static void checkAttachmentPoint(Monomer mon, String str) throws AttachmentException {
if (!(mon.getAttachmentListString().contains(str))) {
if (!(str.equals("?") || str.equals("pair")) && !mon.getAlternateId().equals("?")) {
LOG.info("Attachment point for source is not there");
throw new Attac... | [
"private",
"static",
"void",
"checkAttachmentPoint",
"(",
"Monomer",
"mon",
",",
"String",
"str",
")",
"throws",
"AttachmentException",
"{",
"if",
"(",
"!",
"(",
"mon",
".",
"getAttachmentListString",
"(",
")",
".",
"contains",
"(",
"str",
")",
")",
")",
"... | method to check the attachment point's existence
@param mon
Monomer
@param str
Attachment point
@throws AttachmentException
if the Attachment point is not there | [
"method",
"to",
"check",
"the",
"attachment",
"point",
"s",
"existence"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/Validation.java#L670-L677 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/Validation.java | Validation.checkSingleAttachment | private static boolean checkSingleAttachment(List<Monomer> monomers, String rGroup, HELM2Notation helm2notation,
ConnectionNotation not, InterConnections interconnection, String id) throws AttachmentException {
for (Monomer monomer : monomers) {
/* Are the attachment points there */
checkAttachmentPoin... | java | private static boolean checkSingleAttachment(List<Monomer> monomers, String rGroup, HELM2Notation helm2notation,
ConnectionNotation not, InterConnections interconnection, String id) throws AttachmentException {
for (Monomer monomer : monomers) {
/* Are the attachment points there */
checkAttachmentPoin... | [
"private",
"static",
"boolean",
"checkSingleAttachment",
"(",
"List",
"<",
"Monomer",
">",
"monomers",
",",
"String",
"rGroup",
",",
"HELM2Notation",
"helm2notation",
",",
"ConnectionNotation",
"not",
",",
"InterConnections",
"interconnection",
",",
"String",
"id",
... | method to check for one attachment point the validation
@param monomers
List of monomers
@param rGroup
rGroup of the connection
@param helm2notation
HELM2Notation object
@param not
ConnectionNotation
@param interconnection
InterConnections
@param id
@return true if it is valid, false otherwise
@throws AttachmentExcept... | [
"method",
"to",
"check",
"for",
"one",
"attachment",
"point",
"the",
"validation"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/Validation.java#L794-L820 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/Validation.java | Validation.getMonomersRNA | private static List<Monomer> getMonomersRNA(MonomerNotationUnitRNA rna, MonomerStore monomerStore, int position)
throws HELM2HandledException {
try {
List<Monomer> monomers = new ArrayList<Monomer>();
for (int index = 0; index < rna.getContents().size(); index++) {
String id = rna.getContents().get(... | java | private static List<Monomer> getMonomersRNA(MonomerNotationUnitRNA rna, MonomerStore monomerStore, int position)
throws HELM2HandledException {
try {
List<Monomer> monomers = new ArrayList<Monomer>();
for (int index = 0; index < rna.getContents().size(); index++) {
String id = rna.getContents().get(... | [
"private",
"static",
"List",
"<",
"Monomer",
">",
"getMonomersRNA",
"(",
"MonomerNotationUnitRNA",
"rna",
",",
"MonomerStore",
"monomerStore",
",",
"int",
"position",
")",
"throws",
"HELM2HandledException",
"{",
"try",
"{",
"List",
"<",
"Monomer",
">",
"monomers",... | method to get all monomers for MonomerNotationUnitRNA
@param rna
MonomerNotationUnitRNA
@param monomerStore
MonomerStore
@return List of monomers of the MonomerNotationUnitRNA
@throws HELM2HandledException
if HELM2 features were there | [
"method",
"to",
"get",
"all",
"monomers",
"for",
"MonomerNotationUnitRNA"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/Validation.java#L833-L858 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/Validation.java | Validation.getMonomersRNAOnlyBase | private static List<Monomer> getMonomersRNAOnlyBase(MonomerNotationUnitRNA rna, MonomerStore monomerStore)
throws HELM2HandledException {
try {
List<Monomer> monomers = new ArrayList<Monomer>();
for (MonomerNotationUnit unit : rna.getContents()) {
String id = unit.getUnit().replace("[", "");
id... | java | private static List<Monomer> getMonomersRNAOnlyBase(MonomerNotationUnitRNA rna, MonomerStore monomerStore)
throws HELM2HandledException {
try {
List<Monomer> monomers = new ArrayList<Monomer>();
for (MonomerNotationUnit unit : rna.getContents()) {
String id = unit.getUnit().replace("[", "");
id... | [
"private",
"static",
"List",
"<",
"Monomer",
">",
"getMonomersRNAOnlyBase",
"(",
"MonomerNotationUnitRNA",
"rna",
",",
"MonomerStore",
"monomerStore",
")",
"throws",
"HELM2HandledException",
"{",
"try",
"{",
"List",
"<",
"Monomer",
">",
"monomers",
"=",
"new",
"Ar... | method to get only the nucleotide base for one MonomerNotationUnitRNA
@param rna
MonomerNotationUnitRNA
@param monomerStore
MonomerStore
@return List of Monomers
@throws HELM2HandledException
if HELM2 features were there | [
"method",
"to",
"get",
"only",
"the",
"nucleotide",
"base",
"for",
"one",
"MonomerNotationUnitRNA"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/Validation.java#L871-L890 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/RNAUtils.java | RNAUtils.initComplementMap | private static void initComplementMap() {
complementMap = new HashMap<String, String>();
complementMap.put("A", "U");
complementMap.put("G", "C");
complementMap.put("C", "G");
complementMap.put("U", "A");
complementMap.put("T", "A");
complementMap.put("X", "X");
} | java | private static void initComplementMap() {
complementMap = new HashMap<String, String>();
complementMap.put("A", "U");
complementMap.put("G", "C");
complementMap.put("C", "G");
complementMap.put("U", "A");
complementMap.put("T", "A");
complementMap.put("X", "X");
} | [
"private",
"static",
"void",
"initComplementMap",
"(",
")",
"{",
"complementMap",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"complementMap",
".",
"put",
"(",
"\"A\"",
",",
"\"U\"",
")",
";",
"complementMap",
".",
"put",
"("... | initialize Map to get the complement of each nucleotide | [
"initialize",
"Map",
"to",
"get",
"the",
"complement",
"of",
"each",
"nucleotide"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/RNAUtils.java#L79-L87 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/RNAUtils.java | RNAUtils.areAntiparallel | public static boolean areAntiparallel(PolymerNotation polymerOne, PolymerNotation polymerTwo)
throws RNAUtilsException, HELM2HandledException, ChemistryException, NucleotideLoadingException {
checkRNA(polymerOne);
checkRNA(polymerTwo);
PolymerNotation antiparallel = getAntiparallel(polymerOne);
String s... | java | public static boolean areAntiparallel(PolymerNotation polymerOne, PolymerNotation polymerTwo)
throws RNAUtilsException, HELM2HandledException, ChemistryException, NucleotideLoadingException {
checkRNA(polymerOne);
checkRNA(polymerTwo);
PolymerNotation antiparallel = getAntiparallel(polymerOne);
String s... | [
"public",
"static",
"boolean",
"areAntiparallel",
"(",
"PolymerNotation",
"polymerOne",
",",
"PolymerNotation",
"polymerTwo",
")",
"throws",
"RNAUtilsException",
",",
"HELM2HandledException",
",",
"ChemistryException",
",",
"NucleotideLoadingException",
"{",
"checkRNA",
"("... | method to check if two given polymers are complement to each other
@param polymerOne
PolymerNotation of the first polymer
@param polymerTwo
PolymerNotation of the second polymer
@return true, if they are opposite to each other, false otherwise
@throws RNAUtilsException
if the polymers are not rna/dna or the antiparall... | [
"method",
"to",
"check",
"if",
"two",
"given",
"polymers",
"are",
"complement",
"to",
"each",
"other"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/RNAUtils.java#L147-L157 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/RNAUtils.java | RNAUtils.getMaxMatchFragment | public static String getMaxMatchFragment(String seq1, String seq2) throws NotationException {
return getMaxMatchFragment(seq1, seq2, MINUMUM_MATCH_FRAGMENT_LENGTH);
} | java | public static String getMaxMatchFragment(String seq1, String seq2) throws NotationException {
return getMaxMatchFragment(seq1, seq2, MINUMUM_MATCH_FRAGMENT_LENGTH);
} | [
"public",
"static",
"String",
"getMaxMatchFragment",
"(",
"String",
"seq1",
",",
"String",
"seq2",
")",
"throws",
"NotationException",
"{",
"return",
"getMaxMatchFragment",
"(",
"seq1",
",",
"seq2",
",",
"MINUMUM_MATCH_FRAGMENT_LENGTH",
")",
";",
"}"
] | method to get the largest matched fragment between two sequences, replace
T with U before Match
@param seq1
single letter, all upper case nucleotide sequence
@param seq2
single letter, all upper case nucleotide sequence
@return maximal match fragment of seq1 and seq2
@throws NotationException
if the notation is not va... | [
"method",
"to",
"get",
"the",
"largest",
"matched",
"fragment",
"between",
"two",
"sequences",
"replace",
"T",
"with",
"U",
"before",
"Match"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/RNAUtils.java#L171-L173 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/RNAUtils.java | RNAUtils.getMaxMatchFragment | public static String getMaxMatchFragment(String seq1, String seq2, int minLength) throws NotationException {
if (null == seq1 || null == seq2) {
throw new NotationException("Both sequences must not be null ");
}
if (!seq1.equals(seq1.toUpperCase()) || !seq2.equals(seq2.toUpperCase())) {
throw new Not... | java | public static String getMaxMatchFragment(String seq1, String seq2, int minLength) throws NotationException {
if (null == seq1 || null == seq2) {
throw new NotationException("Both sequences must not be null ");
}
if (!seq1.equals(seq1.toUpperCase()) || !seq2.equals(seq2.toUpperCase())) {
throw new Not... | [
"public",
"static",
"String",
"getMaxMatchFragment",
"(",
"String",
"seq1",
",",
"String",
"seq2",
",",
"int",
"minLength",
")",
"throws",
"NotationException",
"{",
"if",
"(",
"null",
"==",
"seq1",
"||",
"null",
"==",
"seq2",
")",
"{",
"throw",
"new",
"Not... | This method returns the largest matched fragment between two sequences,
replace T with U before match
@param seq1
single letter, all upper case nucleotide sequence
@param seq2
single letter, all upper case nucleotide sequence
@param minLength
- minimum fragment length
@return largest match fragment
@throws org.helm.no... | [
"This",
"method",
"returns",
"the",
"largest",
"matched",
"fragment",
"between",
"two",
"sequences",
"replace",
"T",
"with",
"U",
"before",
"match"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/RNAUtils.java#L189-L227 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/RNAUtils.java | RNAUtils.removeLastP | public static void removeLastP(PolymerNotation polymer)
throws RNAUtilsException, NotationException, HELM2HandledException {
checkRNA(polymer);
/* Get last monomerNotation */
MonomerNotation lastObject = polymer.getPolymerElements().getListOfElements()
.get(polymer.getPolymerElements().getListOfElemen... | java | public static void removeLastP(PolymerNotation polymer)
throws RNAUtilsException, NotationException, HELM2HandledException {
checkRNA(polymer);
/* Get last monomerNotation */
MonomerNotation lastObject = polymer.getPolymerElements().getListOfElements()
.get(polymer.getPolymerElements().getListOfElemen... | [
"public",
"static",
"void",
"removeLastP",
"(",
"PolymerNotation",
"polymer",
")",
"throws",
"RNAUtilsException",
",",
"NotationException",
",",
"HELM2HandledException",
"{",
"checkRNA",
"(",
"polymer",
")",
";",
"/* Get last monomerNotation */",
"MonomerNotation",
"lastO... | method to remove the phosphate of the last nucleotide
@param polymer
PolymerNotation
@throws RNAUtilsException
if the PolmyerNotation is not a rna or dna
@throws NotationException
if the changed notation object can not be generated
@throws HELM2HandledException
if HELM2 features are involved | [
"method",
"to",
"remove",
"the",
"phosphate",
"of",
"the",
"last",
"nucleotide"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/RNAUtils.java#L241-L260 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/RNAUtils.java | RNAUtils.addLastP | public static void addLastP(PolymerNotation polymer)
throws RNAUtilsException, NotationException, HELM2HandledException {
checkRNA(polymer);
/* Get last monomerNotation */
MonomerNotation lastObject = polymer.getPolymerElements().getListOfElements()
.get(polymer.getPolymerElements().getListOfElements... | java | public static void addLastP(PolymerNotation polymer)
throws RNAUtilsException, NotationException, HELM2HandledException {
checkRNA(polymer);
/* Get last monomerNotation */
MonomerNotation lastObject = polymer.getPolymerElements().getListOfElements()
.get(polymer.getPolymerElements().getListOfElements... | [
"public",
"static",
"void",
"addLastP",
"(",
"PolymerNotation",
"polymer",
")",
"throws",
"RNAUtilsException",
",",
"NotationException",
",",
"HELM2HandledException",
"{",
"checkRNA",
"(",
"polymer",
")",
";",
"/* Get last monomerNotation */",
"MonomerNotation",
"lastObje... | method to add a phosphate to the last polymer's nucleotide
@param polymer
PolymerNotation
@throws RNAUtilsException
if the polymer is no rna or dna
@throws NotationException
if the changed notation object can not be generated
@throws HELM2HandledException
if HELM2 features are involved | [
"method",
"to",
"add",
"a",
"phosphate",
"to",
"the",
"last",
"polymer",
"s",
"nucleotide"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/RNAUtils.java#L292-L311 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/RNAUtils.java | RNAUtils.getInverse | public static PolymerNotation getInverse(PolymerNotation polymer) throws RNAUtilsException, org.helm.notation2.exception.NotationException, ChemistryException, NucleotideLoadingException {
checkRNA(polymer);
PolymerNotation inverse;
try {
inverse = SequenceConverter.readRNA(generateInverse(polymer).toStrin... | java | public static PolymerNotation getInverse(PolymerNotation polymer) throws RNAUtilsException, org.helm.notation2.exception.NotationException, ChemistryException, NucleotideLoadingException {
checkRNA(polymer);
PolymerNotation inverse;
try {
inverse = SequenceConverter.readRNA(generateInverse(polymer).toStrin... | [
"public",
"static",
"PolymerNotation",
"getInverse",
"(",
"PolymerNotation",
"polymer",
")",
"throws",
"RNAUtilsException",
",",
"org",
".",
"helm",
".",
"notation2",
".",
"exception",
".",
"NotationException",
",",
"ChemistryException",
",",
"NucleotideLoadingException... | method to get the polymer with the inverse sequence of the current
polymer
@param polymer
PolymerNotation
@return inverse sequence
@throws RNAUtilsException
if the polymer is not rna or dna or the inverse strand can
not be built
@throws org.helm.notation2.exception.NotationException if notation is not valid
@throws Ch... | [
"method",
"to",
"get",
"the",
"polymer",
"with",
"the",
"inverse",
"sequence",
"of",
"the",
"current",
"polymer"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/RNAUtils.java#L375-L388 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/RNAUtils.java | RNAUtils.getReverseComplement | public static PolymerNotation getReverseComplement(PolymerNotation polymer) throws RNAUtilsException, org.helm.notation2.exception.NotationException, ChemistryException, NucleotideLoadingException {
checkRNA(polymer);
PolymerNotation complementReversePolymer;
try {
complementReversePolymer = SequenceConver... | java | public static PolymerNotation getReverseComplement(PolymerNotation polymer) throws RNAUtilsException, org.helm.notation2.exception.NotationException, ChemistryException, NucleotideLoadingException {
checkRNA(polymer);
PolymerNotation complementReversePolymer;
try {
complementReversePolymer = SequenceConver... | [
"public",
"static",
"PolymerNotation",
"getReverseComplement",
"(",
"PolymerNotation",
"polymer",
")",
"throws",
"RNAUtilsException",
",",
"org",
".",
"helm",
".",
"notation2",
".",
"exception",
".",
"NotationException",
",",
"ChemistryException",
",",
"NucleotideLoadin... | method to get the polymer with the reverse complement sequence of the
current polymer
@param polymer
PolymerNotation
@return PolymerNotation with the reverse complement
@throws RNAUtilsException
if the polymer is not rna or dna or the inverse strand can
not be built
@throws org.helm.notation2.exception.NotationExcept... | [
"method",
"to",
"get",
"the",
"polymer",
"with",
"the",
"reverse",
"complement",
"sequence",
"of",
"the",
"current",
"polymer"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/RNAUtils.java#L406-L421 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/RNAUtils.java | RNAUtils.generateInverse | private static StringBuilder generateInverse(PolymerNotation polymer) throws HELM2HandledException,
RNAUtilsException, org.helm.notation2.exception.NotationException, ChemistryException {
initComplementMap();
String sequence = getNaturalAnalogSequence(polymer);
StringBuilder sb = new StringBuilder(sequence... | java | private static StringBuilder generateInverse(PolymerNotation polymer) throws HELM2HandledException,
RNAUtilsException, org.helm.notation2.exception.NotationException, ChemistryException {
initComplementMap();
String sequence = getNaturalAnalogSequence(polymer);
StringBuilder sb = new StringBuilder(sequence... | [
"private",
"static",
"StringBuilder",
"generateInverse",
"(",
"PolymerNotation",
"polymer",
")",
"throws",
"HELM2HandledException",
",",
"RNAUtilsException",
",",
"org",
".",
"helm",
".",
"notation2",
".",
"exception",
".",
"NotationException",
",",
"ChemistryException"... | method to generate the inverse sequence of the given polymer
@param polymer
PolymerNotation
@return inverse sequence of the PolymerNotation
@throws HELM2HandledException
if the polymer contains HELM2 features
@throws RNAUtilsException
if the polymer is not rna or dna
@throws org.helm.notation2.exception.NotationExcept... | [
"method",
"to",
"generate",
"the",
"inverse",
"sequence",
"of",
"the",
"given",
"polymer"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/RNAUtils.java#L456-L462 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/RNAUtils.java | RNAUtils.hasNucleotideModification | public static boolean hasNucleotideModification(PolymerNotation polymer) throws NotationException {
for (MonomerNotation current : polymer.getPolymerElements().getListOfElements()) {
if (hasModification(current)) {
return true;
}
}
return false;
} | java | public static boolean hasNucleotideModification(PolymerNotation polymer) throws NotationException {
for (MonomerNotation current : polymer.getPolymerElements().getListOfElements()) {
if (hasModification(current)) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"hasNucleotideModification",
"(",
"PolymerNotation",
"polymer",
")",
"throws",
"NotationException",
"{",
"for",
"(",
"MonomerNotation",
"current",
":",
"polymer",
".",
"getPolymerElements",
"(",
")",
".",
"getListOfElements",
"(",
")",
... | method to check if the given PolymerNotation has a nucleotide
Modification
@param polymer
PolymerNotation
@return true if the polymer contains at least one modifcation, false
otherwise
@throws NotationException if notation is not valid | [
"method",
"to",
"check",
"if",
"the",
"given",
"PolymerNotation",
"has",
"a",
"nucleotide",
"Modification"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/RNAUtils.java#L527-L534 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/RNAUtils.java | RNAUtils.hasModification | private static boolean hasModification(MonomerNotation monomerNotation) throws NotationException {
if (monomerNotation instanceof MonomerNotationUnitRNA) {
if (hasModification((MonomerNotationUnitRNA) monomerNotation)) {
return true;
}
} else if (monomerNotation instanceof MonomerNotationGroup) {
... | java | private static boolean hasModification(MonomerNotation monomerNotation) throws NotationException {
if (monomerNotation instanceof MonomerNotationUnitRNA) {
if (hasModification((MonomerNotationUnitRNA) monomerNotation)) {
return true;
}
} else if (monomerNotation instanceof MonomerNotationGroup) {
... | [
"private",
"static",
"boolean",
"hasModification",
"(",
"MonomerNotation",
"monomerNotation",
")",
"throws",
"NotationException",
"{",
"if",
"(",
"monomerNotation",
"instanceof",
"MonomerNotationUnitRNA",
")",
"{",
"if",
"(",
"hasModification",
"(",
"(",
"MonomerNotatio... | method to check if the MonomerNotation contains a modification
@param monomerNotation
@return true, if the MonomerNotation contains a modification, false
otherwise
@throws NotationException
if the MonomerNotation is unknown | [
"method",
"to",
"check",
"if",
"the",
"MonomerNotation",
"contains",
"a",
"modification"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/RNAUtils.java#L545-L567 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/RNAUtils.java | RNAUtils.hasModification | private static boolean hasModification(MonomerNotationUnitRNA monomerNotation) {
if (monomerNotation.getUnit().contains("[") || monomerNotation.getUnit().contains("(X)")
|| monomerNotation.getUnit().endsWith(")")) {
return true;
}
return false;
} | java | private static boolean hasModification(MonomerNotationUnitRNA monomerNotation) {
if (monomerNotation.getUnit().contains("[") || monomerNotation.getUnit().contains("(X)")
|| monomerNotation.getUnit().endsWith(")")) {
return true;
}
return false;
} | [
"private",
"static",
"boolean",
"hasModification",
"(",
"MonomerNotationUnitRNA",
"monomerNotation",
")",
"{",
"if",
"(",
"monomerNotation",
".",
"getUnit",
"(",
")",
".",
"contains",
"(",
"\"[\"",
")",
"||",
"monomerNotation",
".",
"getUnit",
"(",
")",
".",
"... | method to check if the MonomerNotationUnitRNA contains modification
@param monomerNotation
MonomerNotationUnitRNA
@return true, if the MonomerNotationUnitRNA contains modification, false
otherwise | [
"method",
"to",
"check",
"if",
"the",
"MonomerNotationUnitRNA",
"contains",
"modification"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/RNAUtils.java#L577-L583 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/RNAUtils.java | RNAUtils.hybridizeAntiparallel | public static List<ConnectionNotation> hybridizeAntiparallel(PolymerNotation one, PolymerNotation two)
throws RNAUtilsException, NotationException, HELM2HandledException,
ChemistryException, NucleotideLoadingException {
checkRNA(one);
checkRNA(two);
List<ConnectionNotation> connections = new ArrayLis... | java | public static List<ConnectionNotation> hybridizeAntiparallel(PolymerNotation one, PolymerNotation two)
throws RNAUtilsException, NotationException, HELM2HandledException,
ChemistryException, NucleotideLoadingException {
checkRNA(one);
checkRNA(two);
List<ConnectionNotation> connections = new ArrayLis... | [
"public",
"static",
"List",
"<",
"ConnectionNotation",
">",
"hybridizeAntiparallel",
"(",
"PolymerNotation",
"one",
",",
"PolymerNotation",
"two",
")",
"throws",
"RNAUtilsException",
",",
"NotationException",
",",
"HELM2HandledException",
",",
"ChemistryException",
",",
... | method to hybridize two PolymerNotations together if they are
antiparallel
@param one
PolymerNotation first
@param two
PolymerNotation second
@return List of ConnectionNotations
@throws RNAUtilsException if the polymer is not a RNA/DNA
@throws NotationException if notation is not valid
@throws HELM2HandledException if... | [
"method",
"to",
"hybridize",
"two",
"PolymerNotations",
"together",
"if",
"they",
"are",
"antiparallel"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/RNAUtils.java#L601-L624 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/RNAUtils.java | RNAUtils.getSequence | public static String getSequence(PolymerNotation one)
throws RNAUtilsException, HELM2HandledException, ChemistryException {
checkRNA(one);
List<Nucleotide> nucleotideList = getNucleotideList(one);
StringBuffer sb = new StringBuffer();
for (int i = 0; i < nucleotideList.size(); i++) {
sb.append(nuc... | java | public static String getSequence(PolymerNotation one)
throws RNAUtilsException, HELM2HandledException, ChemistryException {
checkRNA(one);
List<Nucleotide> nucleotideList = getNucleotideList(one);
StringBuffer sb = new StringBuffer();
for (int i = 0; i < nucleotideList.size(); i++) {
sb.append(nuc... | [
"public",
"static",
"String",
"getSequence",
"(",
"PolymerNotation",
"one",
")",
"throws",
"RNAUtilsException",
",",
"HELM2HandledException",
",",
"ChemistryException",
"{",
"checkRNA",
"(",
"one",
")",
";",
"List",
"<",
"Nucleotide",
">",
"nucleotideList",
"=",
"... | method to get the rna sequence of the given PolymerNotation
@param one
PolymerNotation
@return sequence
@throws RNAUtilsException if the polymer is not a RNA/DNA
@throws HELM2HandledException if it contains helm2 specific features can not be casted to HELM1 Format
@throws ChemistryException if chemistry engine can not... | [
"method",
"to",
"get",
"the",
"rna",
"sequence",
"of",
"the",
"given",
"PolymerNotation"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/RNAUtils.java#L636-L647 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/RNAUtils.java | RNAUtils.getModifiedNucleotideSequence | public static String getModifiedNucleotideSequence(PolymerNotation polymer)
throws RNAUtilsException, HELM2HandledException, ChemistryException {
checkRNA(polymer);
List<Nucleotide> nucleotides = getNucleotideList(polymer);
StringBuilder sb = new StringBuilder();
for (Nucleotide nucleotide : nucleotides... | java | public static String getModifiedNucleotideSequence(PolymerNotation polymer)
throws RNAUtilsException, HELM2HandledException, ChemistryException {
checkRNA(polymer);
List<Nucleotide> nucleotides = getNucleotideList(polymer);
StringBuilder sb = new StringBuilder();
for (Nucleotide nucleotide : nucleotides... | [
"public",
"static",
"String",
"getModifiedNucleotideSequence",
"(",
"PolymerNotation",
"polymer",
")",
"throws",
"RNAUtilsException",
",",
"HELM2HandledException",
",",
"ChemistryException",
"{",
"checkRNA",
"(",
"polymer",
")",
";",
"List",
"<",
"Nucleotide",
">",
"n... | method to get the modifiedNucleotideSequence of the given PolymerNotation
@param polymer
PolymerNotation
@return modified nucleotide sequence
@throws RNAUtilsException if the polymer is not a RNA/DNA
@throws HELM2HandledException if it contains HELM2 specific features, it can not be casted to HELM1Format
@throws Chemi... | [
"method",
"to",
"get",
"the",
"modifiedNucleotideSequence",
"of",
"the",
"given",
"PolymerNotation"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/RNAUtils.java#L659-L669 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/RNAUtils.java | RNAUtils.getNucleotideSequence | public static String getNucleotideSequence(PolymerNotation polymer) throws NotationException, RNAUtilsException,
HELM2HandledException, NucleotideLoadingException, ChemistryException {
List<Nucleotide> nucleotides = getNucleotideList(polymer);
StringBuffer sb = new StringBuffer();
int count = 0;
Map<S... | java | public static String getNucleotideSequence(PolymerNotation polymer) throws NotationException, RNAUtilsException,
HELM2HandledException, NucleotideLoadingException, ChemistryException {
List<Nucleotide> nucleotides = getNucleotideList(polymer);
StringBuffer sb = new StringBuffer();
int count = 0;
Map<S... | [
"public",
"static",
"String",
"getNucleotideSequence",
"(",
"PolymerNotation",
"polymer",
")",
"throws",
"NotationException",
",",
"RNAUtilsException",
",",
"HELM2HandledException",
",",
"NucleotideLoadingException",
",",
"ChemistryException",
"{",
"List",
"<",
"Nucleotide"... | method to get the nucleotide sequence for the polymer
@param polymer
PolymerNotation
@return nucleotide sequence
@throws NotationException if notation is not valid
@throws RNAUtilsException if the polymer is not a RNA/DNA
@throws HELM2HandledException if it contains HELM2 specific features, so that it can not be caste... | [
"method",
"to",
"get",
"the",
"nucleotide",
"sequence",
"for",
"the",
"polymer"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/RNAUtils.java#L799-L835 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/RNAUtils.java | RNAUtils.getNucleotideList | public static List<Nucleotide> getNucleotideList(PolymerNotation polymer)
throws RNAUtilsException, HELM2HandledException, ChemistryException {
checkRNA(polymer);
List<Nucleotide> nucleotides = new ArrayList<Nucleotide>();
/* check for HELM2Elements */
List<MonomerNotation> monomerNotations = polymer.ge... | java | public static List<Nucleotide> getNucleotideList(PolymerNotation polymer)
throws RNAUtilsException, HELM2HandledException, ChemistryException {
checkRNA(polymer);
List<Nucleotide> nucleotides = new ArrayList<Nucleotide>();
/* check for HELM2Elements */
List<MonomerNotation> monomerNotations = polymer.ge... | [
"public",
"static",
"List",
"<",
"Nucleotide",
">",
"getNucleotideList",
"(",
"PolymerNotation",
"polymer",
")",
"throws",
"RNAUtilsException",
",",
"HELM2HandledException",
",",
"ChemistryException",
"{",
"checkRNA",
"(",
"polymer",
")",
";",
"List",
"<",
"Nucleoti... | method to get all nucleotides for one polymer
@param polymer
PolymerNotation
@return List of nucleotides of the polmyer
@throws RNAUtilsException
if the polymer is not rna or dna or the nucleotide can not be
read
@throws HELM2HandledException
if the polymer contains HELM2 features
@throws ChemistryException if chemist... | [
"method",
"to",
"get",
"all",
"nucleotides",
"for",
"one",
"polymer"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/RNAUtils.java#L851-L877 | train |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/RNAUtils.java | RNAUtils.getTrimmedNucleotideSequence | public static String getTrimmedNucleotideSequence(PolymerNotation polymer)
throws RNAUtilsException, HELM2HandledException, ChemistryException {
checkRNA(polymer);
List<Nucleotide> list = getNucleotideList(polymer);
int start = 0;
Nucleotide na = list.get(start);
while (null == na.getBaseMonomer())... | java | public static String getTrimmedNucleotideSequence(PolymerNotation polymer)
throws RNAUtilsException, HELM2HandledException, ChemistryException {
checkRNA(polymer);
List<Nucleotide> list = getNucleotideList(polymer);
int start = 0;
Nucleotide na = list.get(start);
while (null == na.getBaseMonomer())... | [
"public",
"static",
"String",
"getTrimmedNucleotideSequence",
"(",
"PolymerNotation",
"polymer",
")",
"throws",
"RNAUtilsException",
",",
"HELM2HandledException",
",",
"ChemistryException",
"{",
"checkRNA",
"(",
"polymer",
")",
";",
"List",
"<",
"Nucleotide",
">",
"li... | method to get the trimmed nucleotide sequence
@param polymer given rna/dna polymer
@return trimmed nucleotide sequence
@throws RNAUtilsException if the polymer is not a RNA/DNA
@throws HELM2HandledException if it contains HELM2 specific features, so that it can not be casted to HELM1 Format
@throws ChemistryException ... | [
"method",
"to",
"get",
"the",
"trimmed",
"nucleotide",
"sequence"
] | ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38 | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/RNAUtils.java#L888-L912 | train |
kiswanij/jk-util | src/main/java/com/jk/util/exceptions/handler/JKExceptionHandlerFactory.java | JKExceptionHandlerFactory.getInstance | public static JKExceptionHandlerFactory getInstance() {
if (JKExceptionHandlerFactory.instance == null) {
JKExceptionHandlerFactory.instance = new JKExceptionHandlerFactory();
}
return JKExceptionHandlerFactory.instance;
} | java | public static JKExceptionHandlerFactory getInstance() {
if (JKExceptionHandlerFactory.instance == null) {
JKExceptionHandlerFactory.instance = new JKExceptionHandlerFactory();
}
return JKExceptionHandlerFactory.instance;
} | [
"public",
"static",
"JKExceptionHandlerFactory",
"getInstance",
"(",
")",
"{",
"if",
"(",
"JKExceptionHandlerFactory",
".",
"instance",
"==",
"null",
")",
"{",
"JKExceptionHandlerFactory",
".",
"instance",
"=",
"new",
"JKExceptionHandlerFactory",
"(",
")",
";",
"}",... | Gets the single instance of ExceptionHandlerFactory.
@return single instance of ExceptionHandlerFactory | [
"Gets",
"the",
"single",
"instance",
"of",
"ExceptionHandlerFactory",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/exceptions/handler/JKExceptionHandlerFactory.java#L43-L48 | train |
kiswanij/jk-util | src/main/java/com/jk/util/exceptions/handler/JKExceptionHandlerFactory.java | JKExceptionHandlerFactory.setHandler | public void setHandler(final Class<? extends Throwable> clas, final JKExceptionHandler handler) {
this.handlers.put(clas, handler);
} | java | public void setHandler(final Class<? extends Throwable> clas, final JKExceptionHandler handler) {
this.handlers.put(clas, handler);
} | [
"public",
"void",
"setHandler",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Throwable",
">",
"clas",
",",
"final",
"JKExceptionHandler",
"handler",
")",
"{",
"this",
".",
"handlers",
".",
"put",
"(",
"clas",
",",
"handler",
")",
";",
"}"
] | Sets the handler.
@param clas the clas
@param handler the handler | [
"Sets",
"the",
"handler",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/exceptions/handler/JKExceptionHandlerFactory.java#L113-L115 | train |
kiswanij/jk-util | src/main/java/com/jk/util/exceptions/handler/JKExceptionHandlerFactory.java | JKExceptionHandlerFactory.registerHanders | public void registerHanders(String packageString) {
List<String> list = AnnotationDetector.scanAsList(ExceptionHandler.class, packageString);
for (String handler : list) {
// System.out.println(handler);
JKExceptionHandler<? extends Throwable> newInstance = JKObjectUtil.newInstance(handler);
Class<? e... | java | public void registerHanders(String packageString) {
List<String> list = AnnotationDetector.scanAsList(ExceptionHandler.class, packageString);
for (String handler : list) {
// System.out.println(handler);
JKExceptionHandler<? extends Throwable> newInstance = JKObjectUtil.newInstance(handler);
Class<? e... | [
"public",
"void",
"registerHanders",
"(",
"String",
"packageString",
")",
"{",
"List",
"<",
"String",
">",
"list",
"=",
"AnnotationDetector",
".",
"scanAsList",
"(",
"ExceptionHandler",
".",
"class",
",",
"packageString",
")",
";",
"for",
"(",
"String",
"handl... | Register handers.
@param packageString the package string | [
"Register",
"handers",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/exceptions/handler/JKExceptionHandlerFactory.java#L122-L130 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.