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
TheHortonMachine/hortonmachine
dbs/src/main/java/org/hortonmachine/ssh/SshUtilities.java
SshUtilities.uploadFile
public static void uploadFile( Session session, String localFile, String remoteFile ) throws Exception { boolean ptimestamp = true; // exec 'scp -t rfile' remotely String command = "scp " + (ptimestamp ? "-p" : "") + " -t " + remoteFile; Channel channel = session.openChannel("exec"); ...
java
public static void uploadFile( Session session, String localFile, String remoteFile ) throws Exception { boolean ptimestamp = true; // exec 'scp -t rfile' remotely String command = "scp " + (ptimestamp ? "-p" : "") + " -t " + remoteFile; Channel channel = session.openChannel("exec"); ...
[ "public", "static", "void", "uploadFile", "(", "Session", "session", ",", "String", "localFile", ",", "String", "remoteFile", ")", "throws", "Exception", "{", "boolean", "ptimestamp", "=", "true", ";", "// exec 'scp -t rfile' remotely", "String", "command", "=", "...
Upload a file to the remote host via scp. @param session the session to use. @param localFile the local file path. @param remoteFile the remote file path to copy into. @throws Exception
[ "Upload", "a", "file", "to", "the", "remote", "host", "via", "scp", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/ssh/SshUtilities.java#L402-L469
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/DwgObject.java
DwgObject.readObjectHeaderV15
public int readObjectHeaderV15(int[] data, int offset) throws Exception { int bitPos = offset; Integer mode = (Integer)DwgUtil.getBits(data, 2, bitPos); bitPos = bitPos + 2; setMode(mode.intValue()); Vector v = DwgUtil.getBitLong(data, bitPos); bitPos = ((Integer)v.get(0)).intValue(); int r...
java
public int readObjectHeaderV15(int[] data, int offset) throws Exception { int bitPos = offset; Integer mode = (Integer)DwgUtil.getBits(data, 2, bitPos); bitPos = bitPos + 2; setMode(mode.intValue()); Vector v = DwgUtil.getBitLong(data, bitPos); bitPos = ((Integer)v.get(0)).intValue(); int r...
[ "public", "int", "readObjectHeaderV15", "(", "int", "[", "]", "data", ",", "int", "offset", ")", "throws", "Exception", "{", "int", "bitPos", "=", "offset", ";", "Integer", "mode", "=", "(", "Integer", ")", "DwgUtil", ".", "getBits", "(", "data", ",", ...
Reads the header of an object in a DWG file Version 15 @param data Array of unsigned bytes obtained from the DWG binary file @param offset The current bit offset where the value begins @return int New offset @throws Exception If an unexpected bit value is found in the DWG file. Occurs when we are looking for LwPolylin...
[ "Reads", "the", "header", "of", "an", "object", "in", "a", "DWG", "file", "Version", "15" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/DwgObject.java#L56-L87
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/style/sld/SLDValidator.java
SLDValidator.validateSLD
public List validateSLD(InputSource xml) { URL schemaURL = SLDValidator.class.getResource("/schemas/sld/StyledLayerDescriptor.xsd"); return ResponseUtils.validate(xml, schemaURL, false, entityResolver); }
java
public List validateSLD(InputSource xml) { URL schemaURL = SLDValidator.class.getResource("/schemas/sld/StyledLayerDescriptor.xsd"); return ResponseUtils.validate(xml, schemaURL, false, entityResolver); }
[ "public", "List", "validateSLD", "(", "InputSource", "xml", ")", "{", "URL", "schemaURL", "=", "SLDValidator", ".", "class", ".", "getResource", "(", "\"/schemas/sld/StyledLayerDescriptor.xsd\"", ")", ";", "return", "ResponseUtils", ".", "validate", "(", "xml", ",...
validate a .sld against the schema @param xml input stream representing the .sld file @return list of SAXExceptions (0 if the file's okay)
[ "validate", "a", ".", "sld", "against", "the", "schema" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/style/sld/SLDValidator.java#L199-L202
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/utils/Utility.java
Utility.pipeMagnitude
public static void pipeMagnitude( double[] magnitude, double[] whereDrain, IHMProgressMonitor pm ) { int count = 0; /* whereDrain Contiene gli indici degli stati riceventi. */ /* magnitude Contiene la magnitude dei vari stati. */ int length = magnitude.length; /* Per ogni stat...
java
public static void pipeMagnitude( double[] magnitude, double[] whereDrain, IHMProgressMonitor pm ) { int count = 0; /* whereDrain Contiene gli indici degli stati riceventi. */ /* magnitude Contiene la magnitude dei vari stati. */ int length = magnitude.length; /* Per ogni stat...
[ "public", "static", "void", "pipeMagnitude", "(", "double", "[", "]", "magnitude", ",", "double", "[", "]", "whereDrain", ",", "IHMProgressMonitor", "pm", ")", "{", "int", "count", "=", "0", ";", "/* whereDrain Contiene gli indici degli stati riceventi. */", "/* mag...
Calculate the magnitudo of the several drainage area. <p> It begin from the first state, where the magnitudo is setted to 1, and then it follow the path of the water until the outlet. </p> <p> During this process the magnitudo of each through areas is incremented of 1 units. This operation is done for every state, so ...
[ "Calculate", "the", "magnitudo", "of", "the", "several", "drainage", "area", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/utils/Utility.java#L265-L294
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/utils/Utility.java
Utility.verifyProjectType
public static boolean verifyProjectType( SimpleFeatureType schema, IHMProgressMonitor pm ) { String searchedField = PipesTrentoP.ID.getAttributeName(); verifyFeatureKey(findAttributeName(schema, searchedField), searchedField, pm); searchedField = PipesTrentoP.DRAIN_AREA.getAttributeName(); ...
java
public static boolean verifyProjectType( SimpleFeatureType schema, IHMProgressMonitor pm ) { String searchedField = PipesTrentoP.ID.getAttributeName(); verifyFeatureKey(findAttributeName(schema, searchedField), searchedField, pm); searchedField = PipesTrentoP.DRAIN_AREA.getAttributeName(); ...
[ "public", "static", "boolean", "verifyProjectType", "(", "SimpleFeatureType", "schema", ",", "IHMProgressMonitor", "pm", ")", "{", "String", "searchedField", "=", "PipesTrentoP", ".", "ID", ".", "getAttributeName", "(", ")", ";", "verifyFeatureKey", "(", "findAttrib...
Verify the schema. <p> Verify if the FeatureCollection contains all the needed fields. </p> @param schema is yhe type for the project mode. @param pm @return true if there is the percentage of the area.
[ "Verify", "the", "schema", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/utils/Utility.java#L357-L386
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/utils/Utility.java
Utility.verifyFeatureKey
private static void verifyFeatureKey( String key, String searchedField, IHMProgressMonitor pm ) { if (key == null) { if (pm != null) { pm.errorMessage(msg.message("trentoP.error.featureKey") + searchedField); } throw new IllegalArgumentException(msg.message("t...
java
private static void verifyFeatureKey( String key, String searchedField, IHMProgressMonitor pm ) { if (key == null) { if (pm != null) { pm.errorMessage(msg.message("trentoP.error.featureKey") + searchedField); } throw new IllegalArgumentException(msg.message("t...
[ "private", "static", "void", "verifyFeatureKey", "(", "String", "key", ",", "String", "searchedField", ",", "IHMProgressMonitor", "pm", ")", "{", "if", "(", "key", "==", "null", ")", "{", "if", "(", "pm", "!=", "null", ")", "{", "pm", ".", "errorMessage"...
Verify if there is a key of a FeatureCollections. @param key @throws IllegalArgumentException if the key is null.
[ "Verify", "if", "there", "is", "a", "key", "of", "a", "FeatureCollections", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/utils/Utility.java#L395-L403
train
enasequence/sequencetools
src/main/java/uk/ac/ebi/embl/flatfile/validation/FlatFileValidations.java
FlatFileValidations.message
public static ValidationMessage<Origin> message( LineReader lineReader, Severity severity, String messageKey, Object... params) { return message(lineReader.getCurrentLineNumber(), severity, messageKey, params); }
java
public static ValidationMessage<Origin> message( LineReader lineReader, Severity severity, String messageKey, Object... params) { return message(lineReader.getCurrentLineNumber(), severity, messageKey, params); }
[ "public", "static", "ValidationMessage", "<", "Origin", ">", "message", "(", "LineReader", "lineReader", ",", "Severity", "severity", ",", "String", "messageKey", ",", "Object", "...", "params", ")", "{", "return", "message", "(", "lineReader", ".", "getCurrentL...
Creates a validation message. @param lineReader the flat file line reader. @param severity severity of the message @param messageKey a key of the message @param params parameters of the message @return a validation message
[ "Creates", "a", "validation", "message", "." ]
4127f5e1a17540239f5810136153fbd6737fa262
https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/flatfile/validation/FlatFileValidations.java#L54-L58
train
enasequence/sequencetools
src/main/java/uk/ac/ebi/embl/flatfile/validation/FlatFileValidations.java
FlatFileValidations.setCDSTranslationReport
public static void setCDSTranslationReport(ExtendedResult<CdsFeatureTranslationCheck.TranslationReportInfo> cdsCheckResult) { try { CdsFeatureTranslationCheck.TranslationReportInfo translationInfo = cdsCheckResult.getExtension(); StringWriter translationReportWriter = new StringWriter()...
java
public static void setCDSTranslationReport(ExtendedResult<CdsFeatureTranslationCheck.TranslationReportInfo> cdsCheckResult) { try { CdsFeatureTranslationCheck.TranslationReportInfo translationInfo = cdsCheckResult.getExtension(); StringWriter translationReportWriter = new StringWriter()...
[ "public", "static", "void", "setCDSTranslationReport", "(", "ExtendedResult", "<", "CdsFeatureTranslationCheck", ".", "TranslationReportInfo", ">", "cdsCheckResult", ")", "{", "try", "{", "CdsFeatureTranslationCheck", ".", "TranslationReportInfo", "translationInfo", "=", "c...
Takes all the messages in a CdsFeatureTranslationCheck ExtendedResult ValidationResult object and writes a report for the CDS translation. Uses extra information from the ExtendedResult. Have put this here as it uses Writers from the FF package and the embl-api-core package does not have access to these. @param cdsChe...
[ "Takes", "all", "the", "messages", "in", "a", "CdsFeatureTranslationCheck", "ExtendedResult", "ValidationResult", "object", "and", "writes", "a", "report", "for", "the", "CDS", "translation", ".", "Uses", "extra", "information", "from", "the", "ExtendedResult", ".",...
4127f5e1a17540239f5810136153fbd6737fa262
https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/flatfile/validation/FlatFileValidations.java#L116-L183
train
enasequence/sequencetools
src/main/java/uk/ac/ebi/embl/template/CSVWriter.java
CSVWriter.writeTemplateSpreadsheetDownloadFile
public void writeTemplateSpreadsheetDownloadFile(List<TemplateTokenInfo> tokenNames, TemplateVariablesSet variablesSet, String filePath) throws TemplateException { prepareWriter(filePath); writeDow...
java
public void writeTemplateSpreadsheetDownloadFile(List<TemplateTokenInfo> tokenNames, TemplateVariablesSet variablesSet, String filePath) throws TemplateException { prepareWriter(filePath); writeDow...
[ "public", "void", "writeTemplateSpreadsheetDownloadFile", "(", "List", "<", "TemplateTokenInfo", ">", "tokenNames", ",", "TemplateVariablesSet", "variablesSet", ",", "String", "filePath", ")", "throws", "TemplateException", "{", "prepareWriter", "(", "filePath", ")", ";...
Writes the download file for variables for spreadsheet import
[ "Writes", "the", "download", "file", "for", "variables", "for", "spreadsheet", "import" ]
4127f5e1a17540239f5810136153fbd6737fa262
https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/template/CSVWriter.java#L25-L38
train
enasequence/sequencetools
src/main/java/uk/ac/ebi/embl/template/CSVWriter.java
CSVWriter.writeLargeTemplateSpreadsheetDownloadFile
public void writeLargeTemplateSpreadsheetDownloadFile(List<TemplateTokenInfo> tokenNames, int entryCount, TemplateVariables constants, String file...
java
public void writeLargeTemplateSpreadsheetDownloadFile(List<TemplateTokenInfo> tokenNames, int entryCount, TemplateVariables constants, String file...
[ "public", "void", "writeLargeTemplateSpreadsheetDownloadFile", "(", "List", "<", "TemplateTokenInfo", ">", "tokenNames", ",", "int", "entryCount", ",", "TemplateVariables", "constants", ",", "String", "filePath", ")", "throws", "TemplateException", "{", "prepareWriter", ...
Used to write spreadsheets where entry number exceeds the MEGABULK size. Does not use the variables map stored in the database, just writes constants.
[ "Used", "to", "write", "spreadsheets", "where", "entry", "number", "exceeds", "the", "MEGABULK", "size", ".", "Does", "not", "use", "the", "variables", "map", "stored", "in", "the", "database", "just", "writes", "constants", "." ]
4127f5e1a17540239f5810136153fbd6737fa262
https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/template/CSVWriter.java#L44-L57
train
enasequence/sequencetools
src/main/java/uk/ac/ebi/embl/template/CSVWriter.java
CSVWriter.writeDownloadSpreadsheetHeader
public void writeDownloadSpreadsheetHeader(List<TemplateTokenInfo> variableTokenNames) { StringBuilder headerBuilder = new StringBuilder(); headerBuilder.append(UPLOAD_COMMENTS); headerBuilder.append("\n"); for (TemplateTokenInfo tokenInfo : variableTokenNames) { if (tokenInf...
java
public void writeDownloadSpreadsheetHeader(List<TemplateTokenInfo> variableTokenNames) { StringBuilder headerBuilder = new StringBuilder(); headerBuilder.append(UPLOAD_COMMENTS); headerBuilder.append("\n"); for (TemplateTokenInfo tokenInfo : variableTokenNames) { if (tokenInf...
[ "public", "void", "writeDownloadSpreadsheetHeader", "(", "List", "<", "TemplateTokenInfo", ">", "variableTokenNames", ")", "{", "StringBuilder", "headerBuilder", "=", "new", "StringBuilder", "(", ")", ";", "headerBuilder", ".", "append", "(", "UPLOAD_COMMENTS", ")", ...
writes the header for the example download spreadsheet @param variableTokenNames
[ "writes", "the", "header", "for", "the", "example", "download", "spreadsheet" ]
4127f5e1a17540239f5810136153fbd6737fa262
https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/template/CSVWriter.java#L95-L118
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/geomorphology/tca3d/OmsTca3d.java
OmsTca3d.process
@Execute public void process() throws Exception { if (!concatOr(outTca == null, doReset)) { return; } checkNull(inPit, inFlow); HashMap<String, Double> regionMap = CoverageUtilities.getRegionParamsFromGridCoverage(inPit); cols = regionMap.get(CoverageUtilities.COL...
java
@Execute public void process() throws Exception { if (!concatOr(outTca == null, doReset)) { return; } checkNull(inPit, inFlow); HashMap<String, Double> regionMap = CoverageUtilities.getRegionParamsFromGridCoverage(inPit); cols = regionMap.get(CoverageUtilities.COL...
[ "@", "Execute", "public", "void", "process", "(", ")", "throws", "Exception", "{", "if", "(", "!", "concatOr", "(", "outTca", "==", "null", ",", "doReset", ")", ")", "{", "return", ";", "}", "checkNull", "(", "inPit", ",", "inFlow", ")", ";", "HashMa...
Calculates total contributing areas @throws Exception
[ "Calculates", "total", "contributing", "areas" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/geomorphology/tca3d/OmsTca3d.java#L97-L121
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/objects/DwgSeqend.java
DwgSeqend.readDwgSeqendV15
public void readDwgSeqendV15(int[] data, int offset) throws Exception { int bitPos = offset; bitPos = readObjectHeaderV15(data, bitPos); bitPos = readObjectTailV15(data, bitPos); }
java
public void readDwgSeqendV15(int[] data, int offset) throws Exception { int bitPos = offset; bitPos = readObjectHeaderV15(data, bitPos); bitPos = readObjectTailV15(data, bitPos); }
[ "public", "void", "readDwgSeqendV15", "(", "int", "[", "]", "data", ",", "int", "offset", ")", "throws", "Exception", "{", "int", "bitPos", "=", "offset", ";", "bitPos", "=", "readObjectHeaderV15", "(", "data", ",", "bitPos", ")", ";", "bitPos", "=", "re...
Read a Seqend in the DWG format Version 15 @param data Array of unsigned bytes obtained from the DWG binary file @param offset The current bit offset where the value begins @throws Exception If an unexpected bit value is found in the DWG file. Occurs when we are looking for LwPolylines.
[ "Read", "a", "Seqend", "in", "the", "DWG", "format", "Version", "15" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/objects/DwgSeqend.java#L38-L42
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/network/PfafstetterNumber.java
PfafstetterNumber.isDownStreamOf
public boolean isDownStreamOf(PfafstetterNumber pfafstetterNumber) { /* * all the upstreams will have same numbers until the last dot */ int lastDot = pfafstetterNumberString.lastIndexOf('.'); String pre = pfafstetterNumberString.substring(0, lastDot + 1); String lastNu...
java
public boolean isDownStreamOf(PfafstetterNumber pfafstetterNumber) { /* * all the upstreams will have same numbers until the last dot */ int lastDot = pfafstetterNumberString.lastIndexOf('.'); String pre = pfafstetterNumberString.substring(0, lastDot + 1); String lastNu...
[ "public", "boolean", "isDownStreamOf", "(", "PfafstetterNumber", "pfafstetterNumber", ")", "{", "/*\n * all the upstreams will have same numbers until the last dot\n */", "int", "lastDot", "=", "pfafstetterNumberString", ".", "lastIndexOf", "(", "'", "'", ")", "...
Checks if the actual pfafstetter object is downstream or not of the passed argument @param pfafstetterNumber the pfafstetterNumber to check against. @return true if the actual obj is downstream of the passed one.
[ "Checks", "if", "the", "actual", "pfafstetter", "object", "is", "downstream", "or", "not", "of", "the", "passed", "argument" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/network/PfafstetterNumber.java#L99-L127
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/network/PfafstetterNumber.java
PfafstetterNumber.areConnectedUpstream
public synchronized static boolean areConnectedUpstream(PfafstetterNumber p1, PfafstetterNumber p2) { List<Integer> p1OrdersList = p1.getOrdersList(); List<Integer> p2OrdersList = p2.getOrdersList(); int levelDiff = p1OrdersList.size(...
java
public synchronized static boolean areConnectedUpstream(PfafstetterNumber p1, PfafstetterNumber p2) { List<Integer> p1OrdersList = p1.getOrdersList(); List<Integer> p2OrdersList = p2.getOrdersList(); int levelDiff = p1OrdersList.size(...
[ "public", "synchronized", "static", "boolean", "areConnectedUpstream", "(", "PfafstetterNumber", "p1", ",", "PfafstetterNumber", "p2", ")", "{", "List", "<", "Integer", ">", "p1OrdersList", "=", "p1", ".", "getOrdersList", "(", ")", ";", "List", "<", "Integer", ...
Checks if two pfafstetter are connected upstream, i.e. p1 is more downstream than p2 @param p1 the first pfafstetter. @param p2 the second pfafstetter. @return <code>true</code> if the first is more upstream than the second.
[ "Checks", "if", "two", "pfafstetter", "are", "connected", "upstream", "i", ".", "e", ".", "p1", "is", "more", "downstream", "than", "p2" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/network/PfafstetterNumber.java#L174-L203
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/net/Pipe.java
Pipe.setFeatureField
private Number setFeatureField( SimpleFeature pipe, String key ) { Number field = ((Number) pipe.getAttribute(key)); if (field == null) { pm.errorMessage(msg.message("trentoP.error.number") + key); throw new IllegalArgumentException(msg.message("trentoP.error.number") + key); ...
java
private Number setFeatureField( SimpleFeature pipe, String key ) { Number field = ((Number) pipe.getAttribute(key)); if (field == null) { pm.errorMessage(msg.message("trentoP.error.number") + key); throw new IllegalArgumentException(msg.message("trentoP.error.number") + key); ...
[ "private", "Number", "setFeatureField", "(", "SimpleFeature", "pipe", ",", "String", "key", ")", "{", "Number", "field", "=", "(", "(", "Number", ")", "pipe", ".", "getAttribute", "(", "key", ")", ")", ";", "if", "(", "field", "==", "null", ")", "{", ...
Check if there is the field in a SimpleFeature and if it's a Number. @param pipe the feature. @param key the key string of the field. @return the Number associated at this key.
[ "Check", "if", "there", "is", "the", "field", "in", "a", "SimpleFeature", "and", "if", "it", "s", "a", "Number", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/net/Pipe.java#L576-L585
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/net/Pipe.java
Pipe.designPipe
public void designPipe( double[][] diameters, double tau, double g, double maxd, double c, StringBuilder strWarnings ) { switch( this.pipeSectionType ) { case 1: designCircularPipe(diameters, tau, g, maxd, strWarnings); break; case 2: designRectangularPipe(ta...
java
public void designPipe( double[][] diameters, double tau, double g, double maxd, double c, StringBuilder strWarnings ) { switch( this.pipeSectionType ) { case 1: designCircularPipe(diameters, tau, g, maxd, strWarnings); break; case 2: designRectangularPipe(ta...
[ "public", "void", "designPipe", "(", "double", "[", "]", "[", "]", "diameters", ",", "double", "tau", ",", "double", "g", ",", "double", "maxd", ",", "double", "c", ",", "StringBuilder", "strWarnings", ")", "{", "switch", "(", "this", ".", "pipeSectionTy...
Calculate the dimension of the pipes. <p> It switch between several section geometry. </p> @param diameters matrix with the commercial diameters. @param tau tangential stress at the bottom of the pipe.. @param g fill degree. @param maxd maximum diameter. @param c is a geometric expression b/h where h is the height a...
[ "Calculate", "the", "dimension", "of", "the", "pipes", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/net/Pipe.java#L608-L624
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/net/Pipe.java
Pipe.designCircularPipe
private void designCircularPipe( double[][] diameters, double tau, double g, double maxd, StringBuilder strWarnings ) { /* Angolo di riempimento */ double newtheta; /* * [%] Pendenza naturale, calcolata in funzione dei dati geometrici * della rete */ doubl...
java
private void designCircularPipe( double[][] diameters, double tau, double g, double maxd, StringBuilder strWarnings ) { /* Angolo di riempimento */ double newtheta; /* * [%] Pendenza naturale, calcolata in funzione dei dati geometrici * della rete */ doubl...
[ "private", "void", "designCircularPipe", "(", "double", "[", "]", "[", "]", "diameters", ",", "double", "tau", ",", "double", "g", ",", "double", "maxd", ",", "StringBuilder", "strWarnings", ")", "{", "/* Angolo di riempimento */", "double", "newtheta", ";", "...
Dimensiona la tubazione. <p> Chiama altre subroutine per il dimensionamento del diametro del tubo circolare e calcola alcune grandezze correlate. <ol> <li> Inanzittuto dimensiona il tubo chiamando la diameters. Quest'ultimasi basa sul criterio di autopulizia della rete, e determina, mediante chiamatead ulteriori funuz...
[ "Dimensiona", "la", "tubazione", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/net/Pipe.java#L659-L729
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/net/Pipe.java
Pipe.getDiameter
private double getDiameter( double[][] diameters, double tau, double g, double[] dD, double maxd, StringBuilder strWarnings ) { /* Pari a A * ( Rh ^1/6 ) */ double B; /* Anglo formato dalla sezione bagnata */ double thta; /* Diametro calcolato imponendo il criterio di autopulizia...
java
private double getDiameter( double[][] diameters, double tau, double g, double[] dD, double maxd, StringBuilder strWarnings ) { /* Pari a A * ( Rh ^1/6 ) */ double B; /* Anglo formato dalla sezione bagnata */ double thta; /* Diametro calcolato imponendo il criterio di autopulizia...
[ "private", "double", "getDiameter", "(", "double", "[", "]", "[", "]", "diameters", ",", "double", "tau", ",", "double", "g", ",", "double", "[", "]", "dD", ",", "double", "maxd", ",", "StringBuilder", "strWarnings", ")", "{", "/* Pari a A * ( Rh ^1/6 ) */",...
Dimensiona il tubo, imponendo uno sforzo tangenziale al fondo. <p> <ol> <li>Calcola l'angolo theta in funzione di g. <li>Nota la portata di progetto del tratto considerato, determina il diametro oldD (adottando una pendenza che garantisca l'autopulizia). <li>Successivamente oldD viene approssimato al diametro commerci...
[ "Dimensiona", "il", "tubo", "imponendo", "uno", "sforzo", "tangenziale", "al", "fondo", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/net/Pipe.java#L770-L861
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/net/Pipe.java
Pipe.designTrapeziumPipe
private void designTrapeziumPipe( double tau, double g, double maxd, double c, StringBuilder strWarnings ) { /* [cm] Base della sezione effettivamente adottata. */ double base; /* * [%] Pendenza naturale, calcolata in funzione dei dati geometrici * della rete */ ...
java
private void designTrapeziumPipe( double tau, double g, double maxd, double c, StringBuilder strWarnings ) { /* [cm] Base della sezione effettivamente adottata. */ double base; /* * [%] Pendenza naturale, calcolata in funzione dei dati geometrici * della rete */ ...
[ "private", "void", "designTrapeziumPipe", "(", "double", "tau", ",", "double", "g", ",", "double", "maxd", ",", "double", "c", ",", "StringBuilder", "strWarnings", ")", "{", "/* [cm] Base della sezione effettivamente adottata. */", "double", "base", ";", "/*\n ...
Chiama altre subroutine per dimensionare una sezione di tipo 3, ossia trapezioidale. <p> Oltre al dimensionamento vero e proprio, calcola anche tutte le altre grandezze correlate. <ol> <li>Inizialmente dimensiona il tubo chiamando la get_height_2() la quale adotta il criterio dell'autopulizia e determina, mediante chi...
[ "Chiama", "altre", "subroutine", "per", "dimensionare", "una", "sezione", "di", "tipo", "3", "ossia", "trapezioidale", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/net/Pipe.java#L1235-L1308
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/net/Pipe.java
Pipe.verifyEmptyDegree
public double verifyEmptyDegree( StringBuilder strWarnings, double q ) { /* Pari a A * ( Rh ^1/6 ) */ double B; /* Anglo formato dalla sezione bagnata */ double thta; /* Costante */ double known; /* * [rad]Angolo formato dalla sezione bagnata, adottando u...
java
public double verifyEmptyDegree( StringBuilder strWarnings, double q ) { /* Pari a A * ( Rh ^1/6 ) */ double B; /* Anglo formato dalla sezione bagnata */ double thta; /* Costante */ double known; /* * [rad]Angolo formato dalla sezione bagnata, adottando u...
[ "public", "double", "verifyEmptyDegree", "(", "StringBuilder", "strWarnings", ",", "double", "q", ")", "{", "/* Pari a A * ( Rh ^1/6 ) */", "double", "B", ";", "/* Anglo formato dalla sezione bagnata */", "double", "thta", ";", "/* Costante */", "double", "known", ";", ...
Verify if the empty degree is greather than the 0.8. @param strWarnings a string which collect all the warning messages. @param q discharge in this pipe.
[ "Verify", "if", "the", "empty", "degree", "is", "greather", "than", "the", "0", ".", "8", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/net/Pipe.java#L1445-L1473
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/geopap4/DaoGpsLog.java
DaoGpsLog.addGpsLogDataPoint
public static void addGpsLogDataPoint( Connection connection, OmsGeopaparazziProject3To4Converter.GpsPoint point, long gpslogId ) throws Exception { Date timestamp = ETimeUtilities.INSTANCE.TIME_FORMATTER_LOCAL.parse(point.utctime); String insertSQL = "INSERT INTO " + TableDescriptions.TABL...
java
public static void addGpsLogDataPoint( Connection connection, OmsGeopaparazziProject3To4Converter.GpsPoint point, long gpslogId ) throws Exception { Date timestamp = ETimeUtilities.INSTANCE.TIME_FORMATTER_LOCAL.parse(point.utctime); String insertSQL = "INSERT INTO " + TableDescriptions.TABL...
[ "public", "static", "void", "addGpsLogDataPoint", "(", "Connection", "connection", ",", "OmsGeopaparazziProject3To4Converter", ".", "GpsPoint", "point", ",", "long", "gpslogId", ")", "throws", "Exception", "{", "Date", "timestamp", "=", "ETimeUtilities", ".", "INSTANC...
Adds a new XY entry to the gps table. @param connection the db connection. @param point the point to add. @param gpslogId the id of the log the point is part of. @throws IOException if something goes wrong
[ "Adds", "a", "new", "XY", "entry", "to", "the", "gps", "table", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/geopap4/DaoGpsLog.java#L234-L256
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/geopap4/DaoGpsLog.java
DaoGpsLog.getLogsList
public static List<GpsLog> getLogsList( IHMConnection connection ) throws Exception { List<GpsLog> logsList = new ArrayList<>(); String sql = "select " + // GpsLogsTableFields.COLUMN_ID.getFieldName() + "," + // GpsLogsTableFields.COLUMN_LOG_STARTTS.getFieldName() + "," +...
java
public static List<GpsLog> getLogsList( IHMConnection connection ) throws Exception { List<GpsLog> logsList = new ArrayList<>(); String sql = "select " + // GpsLogsTableFields.COLUMN_ID.getFieldName() + "," + // GpsLogsTableFields.COLUMN_LOG_STARTTS.getFieldName() + "," +...
[ "public", "static", "List", "<", "GpsLog", ">", "getLogsList", "(", "IHMConnection", "connection", ")", "throws", "Exception", "{", "List", "<", "GpsLog", ">", "logsList", "=", "new", "ArrayList", "<>", "(", ")", ";", "String", "sql", "=", "\"select \"", "...
Get the list of available logs. @param connection the connection to use. @return the list of logs. @throws SQLException
[ "Get", "the", "list", "of", "available", "logs", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/geopap4/DaoGpsLog.java#L265-L294
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/geopap4/DaoGpsLog.java
DaoGpsLog.collectDataForLog
public static void collectDataForLog( IHMConnection connection, GpsLog log ) throws Exception { long logId = log.id; String query = "select " + // GpsLogsDataTableFields.COLUMN_DATA_LAT.getFieldName() + "," + // GpsLogsDataTableFields.COLU...
java
public static void collectDataForLog( IHMConnection connection, GpsLog log ) throws Exception { long logId = log.id; String query = "select " + // GpsLogsDataTableFields.COLUMN_DATA_LAT.getFieldName() + "," + // GpsLogsDataTableFields.COLU...
[ "public", "static", "void", "collectDataForLog", "(", "IHMConnection", "connection", ",", "GpsLog", "log", ")", "throws", "Exception", "{", "long", "logId", "=", "log", ".", "id", ";", "String", "query", "=", "\"select \"", "+", "//", "GpsLogsDataTableFields", ...
Gather gps points data for a supplied log. @param connection the connection to use. @param log the log. @throws Exception
[ "Gather", "gps", "points", "data", "for", "a", "supplied", "log", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/geopap4/DaoGpsLog.java#L303-L338
train
TheHortonMachine/hortonmachine
dbs/src/main/java/org/hortonmachine/ssh/SshTunnelHandler.java
SshTunnelHandler.openTunnel
public static SshTunnelHandler openTunnel( String remoteHost, String remoteSshUser, String remoteSshPwd, int localPort, int remotePort ) throws JSchException { int port = 22; JSch jsch = new JSch(); Session tunnelingSession = jsch.getSession(remoteSshUser, remoteHost, port); ...
java
public static SshTunnelHandler openTunnel( String remoteHost, String remoteSshUser, String remoteSshPwd, int localPort, int remotePort ) throws JSchException { int port = 22; JSch jsch = new JSch(); Session tunnelingSession = jsch.getSession(remoteSshUser, remoteHost, port); ...
[ "public", "static", "SshTunnelHandler", "openTunnel", "(", "String", "remoteHost", ",", "String", "remoteSshUser", ",", "String", "remoteSshPwd", ",", "int", "localPort", ",", "int", "remotePort", ")", "throws", "JSchException", "{", "int", "port", "=", "22", ";...
Open a tunnel to the remote host. @param remoteHost the host to connect to (where ssh will login). @param remoteSshUser the ssh user. @param remoteSshPwd the ssh password. @param localPort the local port to use for the port forwarding (usually the same as the remote). @param remotePort the remote port to use. @return ...
[ "Open", "a", "tunnel", "to", "the", "remote", "host", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/ssh/SshTunnelHandler.java#L48-L61
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/DwgUtil.java
DwgUtil.getRawLong
public static Vector getRawLong(int[] data, int offset) { Vector v = new Vector(); // TODO: Incorrecto. Repasar ... // _val = struct.unpack('<l', _long)[0] int val = 0; v.add(new Integer(offset+32)); v.add(new Integer(val)); return v; }
java
public static Vector getRawLong(int[] data, int offset) { Vector v = new Vector(); // TODO: Incorrecto. Repasar ... // _val = struct.unpack('<l', _long)[0] int val = 0; v.add(new Integer(offset+32)); v.add(new Integer(val)); return v; }
[ "public", "static", "Vector", "getRawLong", "(", "int", "[", "]", "data", ",", "int", "offset", ")", "{", "Vector", "v", "=", "new", "Vector", "(", ")", ";", "// TODO: Incorrecto. Repasar ...", "// _val = struct.unpack('<l', _long)[0]", "int", "val", "=", "0", ...
Read a long value from a group of unsigned bytes @param data Array of unsigned bytes obtained from the DWG binary file @param offset The current bit offset where the value begins @throws Exception If an unexpected bit value is found in the DWG file. Occurs when we are looking for LwPolylines. @return Vector This vecto...
[ "Read", "a", "long", "value", "from", "a", "group", "of", "unsigned", "bytes" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/DwgUtil.java#L388-L396
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/DwgUtil.java
DwgUtil.getTextString
public static Vector getTextString(int[] data, int offset) throws Exception { int bitPos = offset; int newBitPos = ((Integer)DwgUtil.getBitShort(data, bitPos).get(0)).intValue(); int len = ((Integer)DwgUtil.getBitShort(data, bitPos).get(1)).intValue(); bitPos = newBitPos; int bitLen = len * 8; ...
java
public static Vector getTextString(int[] data, int offset) throws Exception { int bitPos = offset; int newBitPos = ((Integer)DwgUtil.getBitShort(data, bitPos).get(0)).intValue(); int len = ((Integer)DwgUtil.getBitShort(data, bitPos).get(1)).intValue(); bitPos = newBitPos; int bitLen = len * 8; ...
[ "public", "static", "Vector", "getTextString", "(", "int", "[", "]", "data", ",", "int", "offset", ")", "throws", "Exception", "{", "int", "bitPos", "=", "offset", ";", "int", "newBitPos", "=", "(", "(", "Integer", ")", "DwgUtil", ".", "getBitShort", "("...
Read a String from a group of unsigned bytes @param data Array of unsigned bytes obtained from the DWG binary file @param offset The current bit offset where the value begins @throws Exception If an unexpected bit value is found in the DWG file. Occurs when we are looking for LwPolylines. @return Vector This vector ha...
[ "Read", "a", "String", "from", "a", "group", "of", "unsigned", "bytes" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/DwgUtil.java#L462-L472
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/ds/Tree.java
Tree.toRootOrder
public Iterator<Compound> toRootOrder(final Compound c) { return new Iterator<Compound>() { Compound curr; TreeNode n = node(c); Compound parent = c; public boolean hasNext() { return !n.isRoot(); } public Compound next()...
java
public Iterator<Compound> toRootOrder(final Compound c) { return new Iterator<Compound>() { Compound curr; TreeNode n = node(c); Compound parent = c; public boolean hasNext() { return !n.isRoot(); } public Compound next()...
[ "public", "Iterator", "<", "Compound", ">", "toRootOrder", "(", "final", "Compound", "c", ")", "{", "return", "new", "Iterator", "<", "Compound", ">", "(", ")", "{", "Compound", "curr", ";", "TreeNode", "n", "=", "node", "(", "c", ")", ";", "Compound",...
Returns all compounds from the Compound argument to the root of the tree following the path. @param c the Compound to start with. @return the set of Compounds in the given order.
[ "Returns", "all", "compounds", "from", "the", "Compound", "argument", "to", "the", "root", "of", "the", "tree", "following", "the", "path", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/ds/Tree.java#L77-L103
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/CSVPrinter.java
CSVPrinter.println
public void println(String value) { print(value); out.println(); out.flush(); newLine = true; }
java
public void println(String value) { print(value); out.println(); out.flush(); newLine = true; }
[ "public", "void", "println", "(", "String", "value", ")", "{", "print", "(", "value", ")", ";", "out", ".", "println", "(", ")", ";", "out", ".", "flush", "(", ")", ";", "newLine", "=", "true", ";", "}" ]
Print the string as the last value on the line. The value will be quoted if needed. @param value value to be outputted.
[ "Print", "the", "string", "as", "the", "last", "value", "on", "the", "line", ".", "The", "value", "will", "be", "quoted", "if", "needed", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/CSVPrinter.java#L98-L103
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/CSVPrinter.java
CSVPrinter.println
public void println(String[] values) { for (int i = 0; i < values.length; i++) { print(values[i]); } out.println(); out.flush(); newLine = true; }
java
public void println(String[] values) { for (int i = 0; i < values.length; i++) { print(values[i]); } out.println(); out.flush(); newLine = true; }
[ "public", "void", "println", "(", "String", "[", "]", "values", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "values", ".", "length", ";", "i", "++", ")", "{", "print", "(", "values", "[", "i", "]", ")", ";", "}", "out", ".", ...
Print a single line of comma separated values. The values will be quoted if needed. Quotes and newLine characters will be escaped. @param values values to be outputted.
[ "Print", "a", "single", "line", "of", "comma", "separated", "values", ".", "The", "values", "will", "be", "quoted", "if", "needed", ".", "Quotes", "and", "newLine", "characters", "will", "be", "escaped", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/CSVPrinter.java#L121-L128
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/CSVPrinter.java
CSVPrinter.printlnComment
public void printlnComment(String comment) { if (this.strategy.isCommentingDisabled()) { return; } if (!newLine) { out.println(); } out.print(this.strategy.getCommentStart()); out.print(' '); for (int i = 0; i < comment.length(); i++) { ...
java
public void printlnComment(String comment) { if (this.strategy.isCommentingDisabled()) { return; } if (!newLine) { out.println(); } out.print(this.strategy.getCommentStart()); out.print(' '); for (int i = 0; i < comment.length(); i++) { ...
[ "public", "void", "printlnComment", "(", "String", "comment", ")", "{", "if", "(", "this", ".", "strategy", ".", "isCommentingDisabled", "(", ")", ")", "{", "return", ";", "}", "if", "(", "!", "newLine", ")", "{", "out", ".", "println", "(", ")", ";"...
Put a comment among the comma separated values. Comments will always begin on a new line and occupy a least one full line. The character specified to star comments and a space will be inserted at the beginning of each new line in the comment. @param comment the comment to output
[ "Put", "a", "comment", "among", "the", "comma", "separated", "values", ".", "Comments", "will", "always", "begin", "on", "a", "new", "line", "and", "occupy", "a", "least", "one", "full", "line", ".", "The", "character", "specified", "to", "star", "comments...
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/CSVPrinter.java#L157-L187
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/CSVPrinter.java
CSVPrinter.print
public void print(String value) { boolean quote = false; if (value.length() > 0) { char c = value.charAt(0); if (newLine && (c < '0' || (c > '9' && c < 'A') || (c > 'Z' && c < 'a') || (c > 'z'))) { quote = true; } if (c == ' ' || c == '\f' ...
java
public void print(String value) { boolean quote = false; if (value.length() > 0) { char c = value.charAt(0); if (newLine && (c < '0' || (c > '9' && c < 'A') || (c > 'Z' && c < 'a') || (c > 'z'))) { quote = true; } if (c == ' ' || c == '\f' ...
[ "public", "void", "print", "(", "String", "value", ")", "{", "boolean", "quote", "=", "false", ";", "if", "(", "value", ".", "length", "(", ")", ">", "0", ")", "{", "char", "c", "=", "value", ".", "charAt", "(", "0", ")", ";", "if", "(", "newLi...
Print the string as the next value on the line. The value will be quoted if needed. @param value value to be outputted.
[ "Print", "the", "string", "as", "the", "next", "value", "on", "the", "line", ".", "The", "value", "will", "be", "quoted", "if", "needed", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/CSVPrinter.java#L195-L234
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/CSVPrinter.java
CSVPrinter.escapeAndQuote
private String escapeAndQuote(String value) { // the initial count is for the preceding and trailing quotes int count = 2; for (int i = 0; i < value.length(); i++) { switch (value.charAt(i)) { case '\"': case '\n': case '\r': ...
java
private String escapeAndQuote(String value) { // the initial count is for the preceding and trailing quotes int count = 2; for (int i = 0; i < value.length(); i++) { switch (value.charAt(i)) { case '\"': case '\n': case '\r': ...
[ "private", "String", "escapeAndQuote", "(", "String", "value", ")", "{", "// the initial count is for the preceding and trailing quotes", "int", "count", "=", "2", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "value", ".", "length", "(", ")", ";", "...
Enclose the value in quotes and escape the quote and comma characters that are inside. @param value needs to be escaped and quoted @return the value, escaped and quoted
[ "Enclose", "the", "value", "in", "quotes", "and", "escape", "the", "quote", "and", "comma", "characters", "that", "are", "inside", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/CSVPrinter.java#L243-L283
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/geomorphology/slope/OmsSlope.java
OmsSlope.calculateSlope
public static double calculateSlope( GridNode node, double flowValue ) { double value = doubleNovalue; if (!isNovalue(flowValue)) { int flowDir = (int) flowValue; if (flowDir != 10) { Direction direction = Direction.forFlow(flowDir); double distanc...
java
public static double calculateSlope( GridNode node, double flowValue ) { double value = doubleNovalue; if (!isNovalue(flowValue)) { int flowDir = (int) flowValue; if (flowDir != 10) { Direction direction = Direction.forFlow(flowDir); double distanc...
[ "public", "static", "double", "calculateSlope", "(", "GridNode", "node", ",", "double", "flowValue", ")", "{", "double", "value", "=", "doubleNovalue", ";", "if", "(", "!", "isNovalue", "(", "flowValue", ")", ")", "{", "int", "flowDir", "=", "(", "int", ...
Calculates the slope of a given flowdirection value in currentCol and currentRow. @param node the current {@link GridNode}. @param flowValue the value of the flowdirection. @return
[ "Calculates", "the", "slope", "of", "a", "given", "flowdirection", "value", "in", "currentCol", "and", "currentRow", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/geomorphology/slope/OmsSlope.java#L135-L148
train
TheHortonMachine/hortonmachine
extras/sideprojects/gps/src/main/java/org/hortonmachine/gps/nmea/SerialNmeaGps.java
SerialNmeaGps.getAvailablePortNames
public static String[] getAvailablePortNames() { SerialPort[] ports = SerialPort.getCommPorts(); String[] portNames = new String[ports.length]; for( int i = 0; i < portNames.length; i++ ) { String systemPortName = ports[i].getSystemPortName(); portNames[i] = systemPortNam...
java
public static String[] getAvailablePortNames() { SerialPort[] ports = SerialPort.getCommPorts(); String[] portNames = new String[ports.length]; for( int i = 0; i < portNames.length; i++ ) { String systemPortName = ports[i].getSystemPortName(); portNames[i] = systemPortNam...
[ "public", "static", "String", "[", "]", "getAvailablePortNames", "(", ")", "{", "SerialPort", "[", "]", "ports", "=", "SerialPort", ".", "getCommPorts", "(", ")", ";", "String", "[", "]", "portNames", "=", "new", "String", "[", "ports", ".", "length", "]...
Getter for the available serial ports. @return the available serial ports system names.
[ "Getter", "for", "the", "available", "serial", "ports", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/extras/sideprojects/gps/src/main/java/org/hortonmachine/gps/nmea/SerialNmeaGps.java#L102-L110
train
TheHortonMachine/hortonmachine
extras/sideprojects/gps/src/main/java/org/hortonmachine/gps/nmea/SerialNmeaGps.java
SerialNmeaGps.isThisAGpsPort
public static boolean isThisAGpsPort( String port ) throws Exception { SerialPort comPort = SerialPort.getCommPort(port); comPort.openPort(); comPort.setComPortTimeouts(SerialPort.TIMEOUT_READ_SEMI_BLOCKING, 100, 0); int waitTries = 0; int parseTries = 0; while( true && ...
java
public static boolean isThisAGpsPort( String port ) throws Exception { SerialPort comPort = SerialPort.getCommPort(port); comPort.openPort(); comPort.setComPortTimeouts(SerialPort.TIMEOUT_READ_SEMI_BLOCKING, 100, 0); int waitTries = 0; int parseTries = 0; while( true && ...
[ "public", "static", "boolean", "isThisAGpsPort", "(", "String", "port", ")", "throws", "Exception", "{", "SerialPort", "comPort", "=", "SerialPort", ".", "getCommPort", "(", "port", ")", ";", "comPort", ".", "openPort", "(", ")", ";", "comPort", ".", "setCom...
Makes a blocking check to find out if the given port supplies GPS data. @param port the port ti check. @return <code>true</code> if the port supplies NMEA GPS data. @throws Exception
[ "Makes", "a", "blocking", "check", "to", "find", "out", "if", "the", "given", "port", "supplies", "GPS", "data", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/extras/sideprojects/gps/src/main/java/org/hortonmachine/gps/nmea/SerialNmeaGps.java#L124-L150
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/InvertibleMatrix.java
InvertibleMatrix.inverse
public InvertibleMatrix inverse() throws MatrixException { InvertibleMatrix inverse = new InvertibleMatrix(nRows); IdentityMatrix identity = new IdentityMatrix(nRows); // Compute each column of the inverse matrix // using columns of the identity matrix. for (int c = 0; c ...
java
public InvertibleMatrix inverse() throws MatrixException { InvertibleMatrix inverse = new InvertibleMatrix(nRows); IdentityMatrix identity = new IdentityMatrix(nRows); // Compute each column of the inverse matrix // using columns of the identity matrix. for (int c = 0; c ...
[ "public", "InvertibleMatrix", "inverse", "(", ")", "throws", "MatrixException", "{", "InvertibleMatrix", "inverse", "=", "new", "InvertibleMatrix", "(", "nRows", ")", ";", "IdentityMatrix", "identity", "=", "new", "IdentityMatrix", "(", "nRows", ")", ";", "// Comp...
Compute the inverse of this matrix. @return the inverse matrix @throws matrix.MatrixException if an error occurred
[ "Compute", "the", "inverse", "of", "this", "matrix", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/InvertibleMatrix.java#L31-L44
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/InvertibleMatrix.java
InvertibleMatrix.determinant
public double determinant() throws MatrixException { decompose(); // Each row exchange during forward elimination flips the sign // of the determinant, so check for an odd number of exchanges. double determinant = ((exchangeCount & 1) == 0) ? 1 : -1; // Form the product of ...
java
public double determinant() throws MatrixException { decompose(); // Each row exchange during forward elimination flips the sign // of the determinant, so check for an odd number of exchanges. double determinant = ((exchangeCount & 1) == 0) ? 1 : -1; // Form the product of ...
[ "public", "double", "determinant", "(", ")", "throws", "MatrixException", "{", "decompose", "(", ")", ";", "// Each row exchange during forward elimination flips the sign", "// of the determinant, so check for an odd number of exchanges.", "double", "determinant", "=", "(", "(", ...
Compute the determinant. @return the determinant @throws matrix.MatrixException if an error occurred
[ "Compute", "the", "determinant", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/InvertibleMatrix.java#L51-L66
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/InvertibleMatrix.java
InvertibleMatrix.norm
public double norm() { double sum = 0; for (int r = 0; r < nRows; ++r) { for (int c = 0; c < nCols; ++c) { double v = values[r][c]; sum += v*v; } } return (double) Math.sqrt(sum); }
java
public double norm() { double sum = 0; for (int r = 0; r < nRows; ++r) { for (int c = 0; c < nCols; ++c) { double v = values[r][c]; sum += v*v; } } return (double) Math.sqrt(sum); }
[ "public", "double", "norm", "(", ")", "{", "double", "sum", "=", "0", ";", "for", "(", "int", "r", "=", "0", ";", "r", "<", "nRows", ";", "++", "r", ")", "{", "for", "(", "int", "c", "=", "0", ";", "c", "<", "nCols", ";", "++", "c", ")", ...
Compute the Euclidean norm of this matrix. @return the norm
[ "Compute", "the", "Euclidean", "norm", "of", "this", "matrix", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/InvertibleMatrix.java#L72-L84
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/las/utils/GpsTimeConverter.java
GpsTimeConverter.isleap
private static boolean isleap( double gpsTime ) { boolean isLeap = false; double[] leaps = getleaps(); for( int i = 0; i < leaps.length; i += 1 ) { if (gpsTime == leaps[i]) { isLeap = true; break; } } return isLeap; }
java
private static boolean isleap( double gpsTime ) { boolean isLeap = false; double[] leaps = getleaps(); for( int i = 0; i < leaps.length; i += 1 ) { if (gpsTime == leaps[i]) { isLeap = true; break; } } return isLeap; }
[ "private", "static", "boolean", "isleap", "(", "double", "gpsTime", ")", "{", "boolean", "isLeap", "=", "false", ";", "double", "[", "]", "leaps", "=", "getleaps", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "leaps", ".", "lengt...
Test to see if a GPS second is a leap second
[ "Test", "to", "see", "if", "a", "GPS", "second", "is", "a", "leap", "second" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/las/utils/GpsTimeConverter.java#L57-L67
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/las/utils/GpsTimeConverter.java
GpsTimeConverter.countleaps
private static int countleaps( double gpsTime, boolean accum_leaps ) { int i, nleaps; double[] leaps = getleaps(); nleaps = 0; if (accum_leaps) { for( i = 0; i < leaps.length; i += 1 ) { if (gpsTime + i >= leaps[i]) { nleaps += 1; ...
java
private static int countleaps( double gpsTime, boolean accum_leaps ) { int i, nleaps; double[] leaps = getleaps(); nleaps = 0; if (accum_leaps) { for( i = 0; i < leaps.length; i += 1 ) { if (gpsTime + i >= leaps[i]) { nleaps += 1; ...
[ "private", "static", "int", "countleaps", "(", "double", "gpsTime", ",", "boolean", "accum_leaps", ")", "{", "int", "i", ",", "nleaps", ";", "double", "[", "]", "leaps", "=", "getleaps", "(", ")", ";", "nleaps", "=", "0", ";", "if", "(", "accum_leaps",...
Count number of leap seconds that have passed
[ "Count", "number", "of", "leap", "seconds", "that", "have", "passed" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/las/utils/GpsTimeConverter.java#L70-L89
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/las/utils/GpsTimeConverter.java
GpsTimeConverter.isunixtimeleap
private static boolean isunixtimeleap( double unixTime ) { double gpsTime = unixTime - 315964800; gpsTime += countleaps(gpsTime, true) - 1; return isleap(gpsTime); }
java
private static boolean isunixtimeleap( double unixTime ) { double gpsTime = unixTime - 315964800; gpsTime += countleaps(gpsTime, true) - 1; return isleap(gpsTime); }
[ "private", "static", "boolean", "isunixtimeleap", "(", "double", "unixTime", ")", "{", "double", "gpsTime", "=", "unixTime", "-", "315964800", ";", "gpsTime", "+=", "countleaps", "(", "gpsTime", ",", "true", ")", "-", "1", ";", "return", "isleap", "(", "gp...
Test to see if a unixtime second is a leap second
[ "Test", "to", "see", "if", "a", "unixtime", "second", "is", "a", "leap", "second" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/las/utils/GpsTimeConverter.java#L92-L97
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/las/utils/GpsTimeConverter.java
GpsTimeConverter.gpsWeekTime2WeekDay
public static EGpsWeekDays gpsWeekTime2WeekDay( double gpsWeekTime ) { int seconds = (int) gpsWeekTime; // week starts with Sunday EGpsWeekDays day4Seconds = EGpsWeekDays.getDay4Seconds(seconds); return day4Seconds; }
java
public static EGpsWeekDays gpsWeekTime2WeekDay( double gpsWeekTime ) { int seconds = (int) gpsWeekTime; // week starts with Sunday EGpsWeekDays day4Seconds = EGpsWeekDays.getDay4Seconds(seconds); return day4Seconds; }
[ "public", "static", "EGpsWeekDays", "gpsWeekTime2WeekDay", "(", "double", "gpsWeekTime", ")", "{", "int", "seconds", "=", "(", "int", ")", "gpsWeekTime", ";", "// week starts with Sunday", "EGpsWeekDays", "day4Seconds", "=", "EGpsWeekDays", ".", "getDay4Seconds", "(",...
Convert GPS Week Time to the day of the week. @param gpsWeekTime the gps time. @return the day of the week.
[ "Convert", "GPS", "Week", "Time", "to", "the", "day", "of", "the", "week", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/las/utils/GpsTimeConverter.java#L145-L150
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/las/utils/GpsTimeConverter.java
GpsTimeConverter.gpsWeekTime2ISO8601
public static String gpsWeekTime2ISO8601( double gpsWeekTime ) { DateTime gps2unix = gpsWeekTime2DateTime(gpsWeekTime); return gps2unix.toString(ISO8601Formatter); }
java
public static String gpsWeekTime2ISO8601( double gpsWeekTime ) { DateTime gps2unix = gpsWeekTime2DateTime(gpsWeekTime); return gps2unix.toString(ISO8601Formatter); }
[ "public", "static", "String", "gpsWeekTime2ISO8601", "(", "double", "gpsWeekTime", ")", "{", "DateTime", "gps2unix", "=", "gpsWeekTime2DateTime", "(", "gpsWeekTime", ")", ";", "return", "gps2unix", ".", "toString", "(", "ISO8601Formatter", ")", ";", "}" ]
Convert GPS Time to ISO8601 time string. @param gpsWeekTime the gps time. @return the ISO8601 string of the gps time.
[ "Convert", "GPS", "Time", "to", "ISO8601", "time", "string", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/las/utils/GpsTimeConverter.java#L158-L161
train
TheHortonMachine/hortonmachine
apps/src/main/java/org/hortonmachine/style/JFontChooser.java
JFontChooser.updateComponents
private void updateComponents() { updatingComponents = true; Font font = getFont(); fontList.setSelectedValue(font.getName(), true); sizeList.setSelectedValue(font.getSize(), true); boldCheckBox.setSelected(font.isBold()); italicCheckBox.setSelected(font.isItalic()); ...
java
private void updateComponents() { updatingComponents = true; Font font = getFont(); fontList.setSelectedValue(font.getName(), true); sizeList.setSelectedValue(font.getSize(), true); boldCheckBox.setSelected(font.isBold()); italicCheckBox.setSelected(font.isItalic()); ...
[ "private", "void", "updateComponents", "(", ")", "{", "updatingComponents", "=", "true", ";", "Font", "font", "=", "getFont", "(", ")", ";", "fontList", ".", "setSelectedValue", "(", "font", ".", "getName", "(", ")", ",", "true", ")", ";", "sizeList", "....
Updates the font in the preview component according to the selected values.
[ "Updates", "the", "font", "in", "the", "preview", "component", "according", "to", "the", "selected", "values", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/apps/src/main/java/org/hortonmachine/style/JFontChooser.java#L293-L313
train
TheHortonMachine/hortonmachine
apps/src/main/java/org/hortonmachine/style/JFontChooser.java
JFontChooser.setSelectionModel
public void setSelectionModel(FontSelectionModel newModel ) { FontSelectionModel oldModel = selectionModel; selectionModel = newModel; oldModel.removeChangeListener(labelUpdater); newModel.addChangeListener(labelUpdater); firePropertyChange("selectionModel", oldModel, newModel); ...
java
public void setSelectionModel(FontSelectionModel newModel ) { FontSelectionModel oldModel = selectionModel; selectionModel = newModel; oldModel.removeChangeListener(labelUpdater); newModel.addChangeListener(labelUpdater); firePropertyChange("selectionModel", oldModel, newModel); ...
[ "public", "void", "setSelectionModel", "(", "FontSelectionModel", "newModel", ")", "{", "FontSelectionModel", "oldModel", "=", "selectionModel", ";", "selectionModel", "=", "newModel", ";", "oldModel", ".", "removeChangeListener", "(", "labelUpdater", ")", ";", "newMo...
Set the model containing the selected font. @param newModel the new FontSelectionModel object
[ "Set", "the", "model", "containing", "the", "selected", "font", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/apps/src/main/java/org/hortonmachine/style/JFontChooser.java#L330-L336
train
TheHortonMachine/hortonmachine
apps/src/main/java/org/hortonmachine/style/JFontChooser.java
DefaultFontSelectionModel.fireChangeListeners
protected void fireChangeListeners() { ChangeEvent ev = new ChangeEvent(this); Object[] l = listeners.getListeners(ChangeListener.class); for (Object listener : l) { ((ChangeListener) listener).stateChanged(ev); } }
java
protected void fireChangeListeners() { ChangeEvent ev = new ChangeEvent(this); Object[] l = listeners.getListeners(ChangeListener.class); for (Object listener : l) { ((ChangeListener) listener).stateChanged(ev); } }
[ "protected", "void", "fireChangeListeners", "(", ")", "{", "ChangeEvent", "ev", "=", "new", "ChangeEvent", "(", "this", ")", ";", "Object", "[", "]", "l", "=", "listeners", ".", "getListeners", "(", "ChangeListener", ".", "class", ")", ";", "for", "(", "...
Fires the listeners registered with this model.
[ "Fires", "the", "listeners", "registered", "with", "this", "model", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/apps/src/main/java/org/hortonmachine/style/JFontChooser.java#L579-L585
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/demmanipulation/pitfiller/OmsPitfiller.java
OmsPitfiller.process
@Execute public void process() throws Exception { if (!concatOr(outPit == null, doReset)) { return; } checkNull(inElev); HashMap<String, Double> regionMap = CoverageUtilities.getRegionParamsFromGridCoverage(inElev); nCols = regionMap.get(CoverageUtilities.COLS).in...
java
@Execute public void process() throws Exception { if (!concatOr(outPit == null, doReset)) { return; } checkNull(inElev); HashMap<String, Double> regionMap = CoverageUtilities.getRegionParamsFromGridCoverage(inElev); nCols = regionMap.get(CoverageUtilities.COLS).in...
[ "@", "Execute", "public", "void", "process", "(", ")", "throws", "Exception", "{", "if", "(", "!", "concatOr", "(", "outPit", "==", "null", ",", "doReset", ")", ")", "{", "return", ";", "}", "checkNull", "(", "inElev", ")", ";", "HashMap", "<", "Stri...
The pitfiller algorithm. @throws Exception
[ "The", "pitfiller", "algorithm", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/demmanipulation/pitfiller/OmsPitfiller.java#L145-L199
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/demmanipulation/pitfiller/OmsPitfiller.java
OmsPitfiller.flood
private void flood() throws Exception { /* define directions */ // Initialise the vector to a supposed dimension, if the number of // unresolved pixel overload the vector there are a method which resized // the vectors. pitsStackSize = (int) (nCols * nRows * 0.1); pstack...
java
private void flood() throws Exception { /* define directions */ // Initialise the vector to a supposed dimension, if the number of // unresolved pixel overload the vector there are a method which resized // the vectors. pitsStackSize = (int) (nCols * nRows * 0.1); pstack...
[ "private", "void", "flood", "(", ")", "throws", "Exception", "{", "/* define directions */", "// Initialise the vector to a supposed dimension, if the number of", "// unresolved pixel overload the vector there are a method which resized", "// the vectors.", "pitsStackSize", "=", "(", "...
Takes the elevation matrix and calculate a matrix with pits filled, using the flooding algorithm. @throws Exception
[ "Takes", "the", "elevation", "matrix", "and", "calculate", "a", "matrix", "with", "pits", "filled", "using", "the", "flooding", "algorithm", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/demmanipulation/pitfiller/OmsPitfiller.java#L207-L227
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/demmanipulation/pitfiller/OmsPitfiller.java
OmsPitfiller.addPitToStack
private void addPitToStack( int row, int col ) { currentPitsCount = currentPitsCount + 1; if (currentPitsCount >= pitsStackSize) { pitsStackSize = (int) (pitsStackSize + nCols * nRows * .1) + 2; currentPitRows = realloc(currentPitRows, pitsStackSize); currentPitCols =...
java
private void addPitToStack( int row, int col ) { currentPitsCount = currentPitsCount + 1; if (currentPitsCount >= pitsStackSize) { pitsStackSize = (int) (pitsStackSize + nCols * nRows * .1) + 2; currentPitRows = realloc(currentPitRows, pitsStackSize); currentPitCols =...
[ "private", "void", "addPitToStack", "(", "int", "row", ",", "int", "col", ")", "{", "currentPitsCount", "=", "currentPitsCount", "+", "1", ";", "if", "(", "currentPitsCount", ">=", "pitsStackSize", ")", "{", "pitsStackSize", "=", "(", "int", ")", "(", "pit...
Adds a pit position to the stack. @param row the row of the pit. @param col the col of the pit.
[ "Adds", "a", "pit", "position", "to", "the", "stack", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/demmanipulation/pitfiller/OmsPitfiller.java#L457-L468
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/demmanipulation/pitfiller/OmsPitfiller.java
OmsPitfiller.resolveFlats
private int resolveFlats( int pitsCount ) { int stillPitsCount; currentPitsCount = pitsCount; do { if (pm.isCanceled()) { return -1; } pitsCount = currentPitsCount; currentPitsCount = 0; for( int ip = 1; ip <= pitsCount...
java
private int resolveFlats( int pitsCount ) { int stillPitsCount; currentPitsCount = pitsCount; do { if (pm.isCanceled()) { return -1; } pitsCount = currentPitsCount; currentPitsCount = 0; for( int ip = 1; ip <= pitsCount...
[ "private", "int", "resolveFlats", "(", "int", "pitsCount", ")", "{", "int", "stillPitsCount", ";", "currentPitsCount", "=", "pitsCount", ";", "do", "{", "if", "(", "pm", ".", "isCanceled", "(", ")", ")", "{", "return", "-", "1", ";", "}", "pitsCount", ...
Try to find a drainage direction for undefinite cell. <p> If the drainage direction is found then puts it in the dir matrix else keeps its index in is and js. </p> <p>N.B. in the {@link #setDirection(double, int, int, int[][], double[])} method the drainage directions is set only if the slope between two pixel is posi...
[ "Try", "to", "find", "a", "drainage", "direction", "for", "undefinite", "cell", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/demmanipulation/pitfiller/OmsPitfiller.java#L489-L531
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/demmanipulation/pitfiller/OmsPitfiller.java
OmsPitfiller.pool
private int pool( int row, int col, int prevNPool ) { int in; int jn; int npool = prevNPool; if (apool[col][row] <= 0) { /* not already part of a pool */ if (dir[col][row] != -1) {/* check only dir since dir was initialized */ /* not on boundary */ ...
java
private int pool( int row, int col, int prevNPool ) { int in; int jn; int npool = prevNPool; if (apool[col][row] <= 0) { /* not already part of a pool */ if (dir[col][row] != -1) {/* check only dir since dir was initialized */ /* not on boundary */ ...
[ "private", "int", "pool", "(", "int", "row", ",", "int", "col", ",", "int", "prevNPool", ")", "{", "int", "in", ";", "int", "jn", ";", "int", "npool", "=", "prevNPool", ";", "if", "(", "apool", "[", "col", "]", "[", "row", "]", "<=", "0", ")", ...
function to compute pool recursively and at the same time determine the minimum elevation of the edge.
[ "function", "to", "compute", "pool", "recursively", "and", "at", "the", "same", "time", "determine", "the", "minimum", "elevation", "of", "the", "edge", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/demmanipulation/pitfiller/OmsPitfiller.java#L537-L576
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/demmanipulation/pitfiller/OmsPitfiller.java
OmsPitfiller.setDirection
private void setDirection( double pitValue, int row, int col, int[][] dir, double[] fact ) { dir[col][row] = 0; /* This necessary to repeat passes after level raised */ double smax = 0.0; // examine adjacent cells first for( int k = 1; k <= 8; k++ ) { int cn = col + DIR_WITH...
java
private void setDirection( double pitValue, int row, int col, int[][] dir, double[] fact ) { dir[col][row] = 0; /* This necessary to repeat passes after level raised */ double smax = 0.0; // examine adjacent cells first for( int k = 1; k <= 8; k++ ) { int cn = col + DIR_WITH...
[ "private", "void", "setDirection", "(", "double", "pitValue", ",", "int", "row", ",", "int", "col", ",", "int", "[", "]", "[", "]", "dir", ",", "double", "[", "]", "fact", ")", "{", "dir", "[", "col", "]", "[", "row", "]", "=", "0", ";", "/* Th...
Calculate the drainage direction with the D8 method. <p>Find the direction that has the maximum slope and set it as the drainage direction the in the cell (r,c) in the dir matrix. @param pitValue the value of pit in row/col. @param row row of the cell in the matrix. @param col col of the cell in the matrix. @param di...
[ "Calculate", "the", "drainage", "direction", "with", "the", "D8", "method", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/demmanipulation/pitfiller/OmsPitfiller.java#L600-L623
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/demmanipulation/pitfiller/OmsPitfiller.java
OmsPitfiller.calculateDirectionFactor
private double[] calculateDirectionFactor( double dx, double dy ) { // direction factor, where the components are 1/length double[] fact = new double[9]; for( int k = 1; k <= 8; k++ ) { fact[k] = 1.0 / (Math.sqrt(DIR_WITHFLOW_EXITING_INVERTED[k][0] * dy * DIR_WITHFLOW_EXITING_INVERTE...
java
private double[] calculateDirectionFactor( double dx, double dy ) { // direction factor, where the components are 1/length double[] fact = new double[9]; for( int k = 1; k <= 8; k++ ) { fact[k] = 1.0 / (Math.sqrt(DIR_WITHFLOW_EXITING_INVERTED[k][0] * dy * DIR_WITHFLOW_EXITING_INVERTE...
[ "private", "double", "[", "]", "calculateDirectionFactor", "(", "double", "dx", ",", "double", "dy", ")", "{", "// direction factor, where the components are 1/length", "double", "[", "]", "fact", "=", "new", "double", "[", "9", "]", ";", "for", "(", "int", "k...
Calculate the drainage direction factor. @param dx is the resolution of the raster map in the x direction. @param dy is the resolution of the raster map in the y direction. @return <b>fact</b> the direction factor (or 1/length) where length is the distance of the pixel from the central pixel.
[ "Calculate", "the", "drainage", "direction", "factor", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/demmanipulation/pitfiller/OmsPitfiller.java#L633-L641
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/geomorphology/flow/OmsLeastCostFlowDirections.java
OmsLeastCostFlowDirections.assignFlowDirection
private boolean assignFlowDirection( GridNode current, GridNode diagonal, GridNode node1, GridNode node2 ) { double diagonalSlope = abs(current.getSlopeTo(diagonal)); if (node1 != null) { double tmpSlope = abs(diagonal.getSlopeTo(node1)); if (diagonalSlope < tmpSlope) { ...
java
private boolean assignFlowDirection( GridNode current, GridNode diagonal, GridNode node1, GridNode node2 ) { double diagonalSlope = abs(current.getSlopeTo(diagonal)); if (node1 != null) { double tmpSlope = abs(diagonal.getSlopeTo(node1)); if (diagonalSlope < tmpSlope) { ...
[ "private", "boolean", "assignFlowDirection", "(", "GridNode", "current", ",", "GridNode", "diagonal", ",", "GridNode", "node1", ",", "GridNode", "node2", ")", "{", "double", "diagonalSlope", "=", "abs", "(", "current", ".", "getSlopeTo", "(", "diagonal", ")", ...
Checks if the path from the current to the first node is steeper than to the others. @param current the current node. @param diagonal the diagonal node to check. @param node1 the first other node to check. @param node2 the second other node to check. @return <code>true</code> if the path to the first node is steeper i...
[ "Checks", "if", "the", "path", "from", "the", "current", "to", "the", "first", "node", "is", "steeper", "than", "to", "the", "others", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/geomorphology/flow/OmsLeastCostFlowDirections.java#L339-L354
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/geomorphology/flow/OmsLeastCostFlowDirections.java
OmsLeastCostFlowDirections.nodeOk
private boolean nodeOk( GridNode node ) { return node != null && !assignedFlowsMap.isMarked(node.col, node.row); }
java
private boolean nodeOk( GridNode node ) { return node != null && !assignedFlowsMap.isMarked(node.col, node.row); }
[ "private", "boolean", "nodeOk", "(", "GridNode", "node", ")", "{", "return", "node", "!=", "null", "&&", "!", "assignedFlowsMap", ".", "isMarked", "(", "node", ".", "col", ",", "node", ".", "row", ")", ";", "}" ]
Checks if the node is ok. <p>A node is ok if:</p> <ul> <li>if the node is valid (!= null in surrounding)</li> <li>if the node has not been processed already (!.isMarked)</li> </ul>
[ "Checks", "if", "the", "node", "is", "ok", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/geomorphology/flow/OmsLeastCostFlowDirections.java#L365-L367
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/optimizers/particleswarm/PSEngine.java
PSEngine.run
public void run() throws Exception { if (ranges == null) { throw new ModelsIllegalargumentException("No ranges have been defined for the parameter space.", this); } createSwarm(); double[] previous = null; while( iterationStep <= maxIterations ) { updateS...
java
public void run() throws Exception { if (ranges == null) { throw new ModelsIllegalargumentException("No ranges have been defined for the parameter space.", this); } createSwarm(); double[] previous = null; while( iterationStep <= maxIterations ) { updateS...
[ "public", "void", "run", "(", ")", "throws", "Exception", "{", "if", "(", "ranges", "==", "null", ")", "{", "throw", "new", "ModelsIllegalargumentException", "(", "\"No ranges have been defined for the parameter space.\"", ",", "this", ")", ";", "}", "createSwarm", ...
Run the particle swarm engine. @throws Exception
[ "Run", "the", "particle", "swarm", "engine", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/optimizers/particleswarm/PSEngine.java#L91-L111
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/optimizers/particleswarm/PSEngine.java
PSEngine.parametersInRange
public static boolean parametersInRange( double[] parameters, double[]... ranges ) { for( int i = 0; i < ranges.length; i++ ) { if (!NumericsUtilities.isBetween(parameters[i], ranges[i])) { return false; } } return true; }
java
public static boolean parametersInRange( double[] parameters, double[]... ranges ) { for( int i = 0; i < ranges.length; i++ ) { if (!NumericsUtilities.isBetween(parameters[i], ranges[i])) { return false; } } return true; }
[ "public", "static", "boolean", "parametersInRange", "(", "double", "[", "]", "parameters", ",", "double", "[", "]", "...", "ranges", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "ranges", ".", "length", ";", "i", "++", ")", "{", "if",...
Checks if the parameters are in the ranges. @param parameters the params. @param ranges the ranges. @return <code>true</code>, if they are inside the given ranges.
[ "Checks", "if", "the", "parameters", "are", "in", "the", "ranges", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/optimizers/particleswarm/PSEngine.java#L211-L218
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/Conversions.java
Conversions.convert
public static <T> T convert(Object from, Class<? extends T> to, Params arg) { if (from == null) { throw new NullPointerException("from"); } if (to == null) { throw new NullPointerException("to"); } if (from.getClass() == String.class && to.isArray()) { ...
java
public static <T> T convert(Object from, Class<? extends T> to, Params arg) { if (from == null) { throw new NullPointerException("from"); } if (to == null) { throw new NullPointerException("to"); } if (from.getClass() == String.class && to.isArray()) { ...
[ "public", "static", "<", "T", ">", "T", "convert", "(", "Object", "from", ",", "Class", "<", "?", "extends", "T", ">", "to", ",", "Params", "arg", ")", "{", "if", "(", "from", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"...
Convert a String value into an object of a certain type @param to the type to convert to @param from the value to convert @param arg conversion argument (e.g. Date format) @return the object of a certain type.
[ "Convert", "a", "String", "value", "into", "an", "object", "of", "a", "certain", "type" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/Conversions.java#L110-L136
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/Conversions.java
Conversions.lookupConversionService
@SuppressWarnings("unchecked") private static <T> Converter<Object, T> lookupConversionService(Class from, Class to) { for (ConversionProvider converter : convServices) { Converter c = converter.getConverter(from, to); if (c != null) { return c; } ...
java
@SuppressWarnings("unchecked") private static <T> Converter<Object, T> lookupConversionService(Class from, Class to) { for (ConversionProvider converter : convServices) { Converter c = converter.getConverter(from, to); if (c != null) { return c; } ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "static", "<", "T", ">", "Converter", "<", "Object", ",", "T", ">", "lookupConversionService", "(", "Class", "from", ",", "Class", "to", ")", "{", "for", "(", "ConversionProvider", "converter", "...
Lookup a conversion service @param from @param to @return
[ "Lookup", "a", "conversion", "service" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/Conversions.java#L150-L159
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/Conversions.java
Conversions.getArrayBaseType
private static Class getArrayBaseType(Class array) { while (array.isArray()) { array = array.getComponentType(); } return array; }
java
private static Class getArrayBaseType(Class array) { while (array.isArray()) { array = array.getComponentType(); } return array; }
[ "private", "static", "Class", "getArrayBaseType", "(", "Class", "array", ")", "{", "while", "(", "array", ".", "isArray", "(", ")", ")", "{", "array", "=", "array", ".", "getComponentType", "(", ")", ";", "}", "return", "array", ";", "}" ]
Get the array base type @param array @return
[ "Get", "the", "array", "base", "type" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/Conversions.java#L180-L185
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/Conversions.java
Conversions.parse
private static Date parse(String date) { for (int i = 0; i < fmt.length; i++) { try { SimpleDateFormat df = new SimpleDateFormat(fmt[i]); return df.parse(date); } catch (ParseException E) { // keep trying } } thr...
java
private static Date parse(String date) { for (int i = 0; i < fmt.length; i++) { try { SimpleDateFormat df = new SimpleDateFormat(fmt[i]); return df.parse(date); } catch (ParseException E) { // keep trying } } thr...
[ "private", "static", "Date", "parse", "(", "String", "date", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "fmt", ".", "length", ";", "i", "++", ")", "{", "try", "{", "SimpleDateFormat", "df", "=", "new", "SimpleDateFormat", "(", "fmt"...
parse the date using the formats above. This is thread safe. @param date @return
[ "parse", "the", "date", "using", "the", "formats", "above", ".", "This", "is", "thread", "safe", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/Conversions.java#L389-L399
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/Window.java
Window.fixRowsAndCols
public void fixRowsAndCols() { rows = (int) Math.round((n - s) / ns_res); if (rows < 1) rows = 1; cols = (int) Math.round((e - w) / we_res); if (cols < 1) cols = 1; }
java
public void fixRowsAndCols() { rows = (int) Math.round((n - s) / ns_res); if (rows < 1) rows = 1; cols = (int) Math.round((e - w) / we_res); if (cols < 1) cols = 1; }
[ "public", "void", "fixRowsAndCols", "(", ")", "{", "rows", "=", "(", "int", ")", "Math", ".", "round", "(", "(", "n", "-", "s", ")", "/", "ns_res", ")", ";", "if", "(", "rows", "<", "1", ")", "rows", "=", "1", ";", "cols", "=", "(", "int", ...
calculate rows and cols from the region and its resolution. Round if required.
[ "calculate", "rows", "and", "cols", "from", "the", "region", "and", "its", "resolution", ".", "Round", "if", "required", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/Window.java#L327-L334
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/Window.java
Window.snapToNextHigherInActiveRegionResolution
public static Point2D.Double snapToNextHigherInActiveRegionResolution( double x, double y, Window activeWindow ) { double minx = activeWindow.getRectangle().getBounds2D().getMinX(); double ewres = activeWindow.getWEResolution(); double xsnap = minx + (Math.ceil((x - minx) / ewres) * ewres); ...
java
public static Point2D.Double snapToNextHigherInActiveRegionResolution( double x, double y, Window activeWindow ) { double minx = activeWindow.getRectangle().getBounds2D().getMinX(); double ewres = activeWindow.getWEResolution(); double xsnap = minx + (Math.ceil((x - minx) / ewres) * ewres); ...
[ "public", "static", "Point2D", ".", "Double", "snapToNextHigherInActiveRegionResolution", "(", "double", "x", ",", "double", "y", ",", "Window", "activeWindow", ")", "{", "double", "minx", "=", "activeWindow", ".", "getRectangle", "(", ")", ".", "getBounds2D", "...
Moves the point given by X and Y to be on the grid of the active region. @param x the easting of the arbitrary point @param y the northing of the arbitrary point @param activeWindow the active window from which to take the grid @return the snapped point
[ "Moves", "the", "point", "given", "by", "X", "and", "Y", "to", "be", "on", "the", "grid", "of", "the", "active", "region", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/Window.java#L444-L456
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/Window.java
Window.getActiveWindowFromMapset
public static Window getActiveWindowFromMapset( String mapsetPath ) { File windFile = new File(mapsetPath + File.separator + GrassLegacyConstans.WIND); if (!windFile.exists()) { return null; } return new Window(windFile.getAbsolutePath()); }
java
public static Window getActiveWindowFromMapset( String mapsetPath ) { File windFile = new File(mapsetPath + File.separator + GrassLegacyConstans.WIND); if (!windFile.exists()) { return null; } return new Window(windFile.getAbsolutePath()); }
[ "public", "static", "Window", "getActiveWindowFromMapset", "(", "String", "mapsetPath", ")", "{", "File", "windFile", "=", "new", "File", "(", "mapsetPath", "+", "File", ".", "separator", "+", "GrassLegacyConstans", ".", "WIND", ")", ";", "if", "(", "!", "wi...
Get the active region window from the mapset @param mapsetPath the path to the mapset folder @return the active Window object of that mapset
[ "Get", "the", "active", "region", "window", "from", "the", "mapset" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/Window.java#L464-L471
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/Window.java
Window.writeActiveWindowToMapset
public static void writeActiveWindowToMapset( String mapsetPath, Window window ) throws IOException { writeWindowFile(mapsetPath + File.separator + GrassLegacyConstans.WIND, window); }
java
public static void writeActiveWindowToMapset( String mapsetPath, Window window ) throws IOException { writeWindowFile(mapsetPath + File.separator + GrassLegacyConstans.WIND, window); }
[ "public", "static", "void", "writeActiveWindowToMapset", "(", "String", "mapsetPath", ",", "Window", "window", ")", "throws", "IOException", "{", "writeWindowFile", "(", "mapsetPath", "+", "File", ".", "separator", "+", "GrassLegacyConstans", ".", "WIND", ",", "wi...
Write active region window to the mapset @param mapsetPath the path to the mapset folder @param the active Window object @throws IOException
[ "Write", "active", "region", "window", "to", "the", "mapset" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/Window.java#L480-L482
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/Window.java
Window.writeDefaultWindowToLocation
public static void writeDefaultWindowToLocation( String locationPath, Window window ) throws IOException { writeWindowFile(locationPath + File.separator + GrassLegacyConstans.PERMANENT_MAPSET + File.separator + GrassLegacyConstans.DEFAULT_WIND, window); }
java
public static void writeDefaultWindowToLocation( String locationPath, Window window ) throws IOException { writeWindowFile(locationPath + File.separator + GrassLegacyConstans.PERMANENT_MAPSET + File.separator + GrassLegacyConstans.DEFAULT_WIND, window); }
[ "public", "static", "void", "writeDefaultWindowToLocation", "(", "String", "locationPath", ",", "Window", "window", ")", "throws", "IOException", "{", "writeWindowFile", "(", "locationPath", "+", "File", ".", "separator", "+", "GrassLegacyConstans", ".", "PERMANENT_MA...
Write default region window to the PERMANENT mapset @param locationPath the path to the location folder @param the active Window object @throws IOException
[ "Write", "default", "region", "window", "to", "the", "PERMANENT", "mapset" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/Window.java#L491-L494
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/Window.java
Window.adaptActiveRegionToEnvelope
public static Window adaptActiveRegionToEnvelope( Envelope bounds, Window activeRegion ) { Point2D eastNorth = Window.snapToNextHigherInActiveRegionResolution(bounds.getMaxX(), bounds.getMaxY(), activeRegion); Point2D westsouth = Window.snapToNextHigherInActiveRegionResolution(bounds.getMinX() - activeR...
java
public static Window adaptActiveRegionToEnvelope( Envelope bounds, Window activeRegion ) { Point2D eastNorth = Window.snapToNextHigherInActiveRegionResolution(bounds.getMaxX(), bounds.getMaxY(), activeRegion); Point2D westsouth = Window.snapToNextHigherInActiveRegionResolution(bounds.getMinX() - activeR...
[ "public", "static", "Window", "adaptActiveRegionToEnvelope", "(", "Envelope", "bounds", ",", "Window", "activeRegion", ")", "{", "Point2D", "eastNorth", "=", "Window", ".", "snapToNextHigherInActiveRegionResolution", "(", "bounds", ".", "getMaxX", "(", ")", ",", "bo...
Takes an envelope and an active region and creates a new region to match the bounds of the envelope, but the resolutions of the active region. This is important if the region has to match some feature layer. The bounds are assured to contain completely the envelope. @param bounds @param activeRegion
[ "Takes", "an", "envelope", "and", "an", "active", "region", "and", "creates", "a", "new", "region", "to", "match", "the", "bounds", "of", "the", "envelope", "but", "the", "resolutions", "of", "the", "active", "region", ".", "This", "is", "important", "if",...
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/Window.java#L504-L512
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/ngmf/util/cosu/SCE.java
SCE.cceua
public double[] cceua(double s[][], double sf[], double bl[], double bu[]) { int nps = s.length; int nopt = s[0].length; int n = nps; int m = nopt; double alpha = 1.0; double beta = 0.5; // Assign the best and worst points: double sb[] = new double[nopt...
java
public double[] cceua(double s[][], double sf[], double bl[], double bu[]) { int nps = s.length; int nopt = s[0].length; int n = nps; int m = nopt; double alpha = 1.0; double beta = 0.5; // Assign the best and worst points: double sb[] = new double[nopt...
[ "public", "double", "[", "]", "cceua", "(", "double", "s", "[", "]", "[", "]", ",", "double", "sf", "[", "]", ",", "double", "bl", "[", "]", ",", "double", "bu", "[", "]", ")", "{", "int", "nps", "=", "s", ".", "length", ";", "int", "nopt", ...
bu upper bound
[ "bu", "upper", "bound" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/ngmf/util/cosu/SCE.java#L241-L314
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/FileUtilities.java
FileUtilities.deleteFileOrDirOnExit
public static boolean deleteFileOrDirOnExit( File filehandle ) { if (filehandle.isDirectory()) { String[] children = filehandle.list(); for( int i = 0; i < children.length; i++ ) { boolean success = deleteFileOrDir(new File(filehandle, children[i])); if (!...
java
public static boolean deleteFileOrDirOnExit( File filehandle ) { if (filehandle.isDirectory()) { String[] children = filehandle.list(); for( int i = 0; i < children.length; i++ ) { boolean success = deleteFileOrDir(new File(filehandle, children[i])); if (!...
[ "public", "static", "boolean", "deleteFileOrDirOnExit", "(", "File", "filehandle", ")", "{", "if", "(", "filehandle", ".", "isDirectory", "(", ")", ")", "{", "String", "[", "]", "children", "=", "filehandle", ".", "list", "(", ")", ";", "for", "(", "int"...
Delete file or folder recursively on exit of the program @param filehandle @return true if all went well
[ "Delete", "file", "or", "folder", "recursively", "on", "exit", "of", "the", "program" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/FileUtilities.java#L212-L224
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/FileUtilities.java
FileUtilities.readInputStreamToString
public static String readInputStreamToString( InputStream inputStream ) { try { // Create the byte list to hold the data List<Byte> bytesList = new ArrayList<Byte>(); byte b = 0; while( (b = (byte) inputStream.read()) != -1 ) { bytesList.add(b); ...
java
public static String readInputStreamToString( InputStream inputStream ) { try { // Create the byte list to hold the data List<Byte> bytesList = new ArrayList<Byte>(); byte b = 0; while( (b = (byte) inputStream.read()) != -1 ) { bytesList.add(b); ...
[ "public", "static", "String", "readInputStreamToString", "(", "InputStream", "inputStream", ")", "{", "try", "{", "// Create the byte list to hold the data", "List", "<", "Byte", ">", "bytesList", "=", "new", "ArrayList", "<", "Byte", ">", "(", ")", ";", "byte", ...
Read from an inoutstream and convert the readed stuff to a String. Usefull for text files that are available as streams. @param inputStream @return the read string
[ "Read", "from", "an", "inoutstream", "and", "convert", "the", "readed", "stuff", "to", "a", "String", ".", "Usefull", "for", "text", "files", "that", "are", "available", "as", "streams", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/FileUtilities.java#L233-L257
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/ngmf/util/Validation.java
Validation.hexDigest
public static String hexDigest(String algorithm, File[] files) { try { MessageDigest md = MessageDigest.getInstance(algorithm); byte[] buf = new byte[4096]; for (File f : files) { FileInputStream in = new FileInputStream(f); int nread = in.read...
java
public static String hexDigest(String algorithm, File[] files) { try { MessageDigest md = MessageDigest.getInstance(algorithm); byte[] buf = new byte[4096]; for (File f : files) { FileInputStream in = new FileInputStream(f); int nread = in.read...
[ "public", "static", "String", "hexDigest", "(", "String", "algorithm", ",", "File", "[", "]", "files", ")", "{", "try", "{", "MessageDigest", "md", "=", "MessageDigest", ".", "getInstance", "(", "algorithm", ")", ";", "byte", "[", "]", "buf", "=", "new",...
Creates a hex encoded sha-256 hash of all files. @param algorithm the algorithm to be used. @param files the files to include for this hash. @return the hexadecimal digest (length 64byte for sha-256).
[ "Creates", "a", "hex", "encoded", "sha", "-", "256", "hash", "of", "all", "files", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/ngmf/util/Validation.java#L24-L42
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/las/databases/LasLevelsTable.java
LasLevelsTable.hasLevel
public static boolean hasLevel( ASpatialDb db, int levelNum ) throws Exception { String tablename = TABLENAME + levelNum; return db.hasTable(tablename); }
java
public static boolean hasLevel( ASpatialDb db, int levelNum ) throws Exception { String tablename = TABLENAME + levelNum; return db.hasTable(tablename); }
[ "public", "static", "boolean", "hasLevel", "(", "ASpatialDb", "db", ",", "int", "levelNum", ")", "throws", "Exception", "{", "String", "tablename", "=", "TABLENAME", "+", "levelNum", ";", "return", "db", ".", "hasTable", "(", "tablename", ")", ";", "}" ]
Checks if the given level table exists. @param db the database. @param levelNum the level number to check. @return <code>true</code> if the level table exists. @throws Exception
[ "Checks", "if", "the", "given", "level", "table", "exists", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/las/databases/LasLevelsTable.java#L61-L64
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/las/databases/LasLevelsTable.java
LasLevelsTable.getLasLevels
public static List<LasLevel> getLasLevels( ASpatialDb db, int levelNum, Envelope envelope ) throws Exception { String tableName = TABLENAME + levelNum; List<LasLevel> lasLevels = new ArrayList<>(); String sql = "SELECT " + COLUMN_GEOM + "," + // COLUMN_ID + "," + COLUMN_SOURCE_ID...
java
public static List<LasLevel> getLasLevels( ASpatialDb db, int levelNum, Envelope envelope ) throws Exception { String tableName = TABLENAME + levelNum; List<LasLevel> lasLevels = new ArrayList<>(); String sql = "SELECT " + COLUMN_GEOM + "," + // COLUMN_ID + "," + COLUMN_SOURCE_ID...
[ "public", "static", "List", "<", "LasLevel", ">", "getLasLevels", "(", "ASpatialDb", "db", ",", "int", "levelNum", ",", "Envelope", "envelope", ")", "throws", "Exception", "{", "String", "tableName", "=", "TABLENAME", "+", "levelNum", ";", "List", "<", "LasL...
Query the las level table. @param db the db to use. @param levelNum the level to query. @param envelope an optional {@link Envelope} to query spatially. @return the list of extracted level cells. @throws Exception
[ "Query", "the", "las", "level", "table", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/las/databases/LasLevelsTable.java#L180-L228
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/nap/AnnotationParser.java
AnnotationParser.handle
public static void handle(File srcFile, AnnotationHandler ah) throws Exception { FileInputStream fis = new FileInputStream(srcFile); FileChannel fc = fis.getChannel(); // Get a CharBuffer from the source file ByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size()); C...
java
public static void handle(File srcFile, AnnotationHandler ah) throws Exception { FileInputStream fis = new FileInputStream(srcFile); FileChannel fc = fis.getChannel(); // Get a CharBuffer from the source file ByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size()); C...
[ "public", "static", "void", "handle", "(", "File", "srcFile", ",", "AnnotationHandler", "ah", ")", "throws", "Exception", "{", "FileInputStream", "fis", "=", "new", "FileInputStream", "(", "srcFile", ")", ";", "FileChannel", "fc", "=", "fis", ".", "getChannel"...
Handle a file with an annotation handler. @param file @param ah @throws java.lang.Exception
[ "Handle", "a", "file", "with", "an", "annotation", "handler", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/nap/AnnotationParser.java#L44-L59
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/nap/AnnotationParser.java
AnnotationParser.handle
public static void handle(String s, AnnotationHandler ah) { Map<String, Map<String, String>> l = new LinkedHashMap<String, Map<String, String>>(); Matcher m = annPattern.matcher(s); while (m.find()) { // for (int i = 1; i <= m.groupCount(); i++) { // System.out.println(...
java
public static void handle(String s, AnnotationHandler ah) { Map<String, Map<String, String>> l = new LinkedHashMap<String, Map<String, String>>(); Matcher m = annPattern.matcher(s); while (m.find()) { // for (int i = 1; i <= m.groupCount(); i++) { // System.out.println(...
[ "public", "static", "void", "handle", "(", "String", "s", ",", "AnnotationHandler", "ah", ")", "{", "Map", "<", "String", ",", "Map", "<", "String", ",", "String", ">", ">", "l", "=", "new", "LinkedHashMap", "<", "String", ",", "Map", "<", "String", ...
Handle a string with an annotation handler @param s the String to process @param ah the annotation handler to use.
[ "Handle", "a", "string", "with", "an", "annotation", "handler" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/nap/AnnotationParser.java#L66-L114
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/styles/GeopaparazziDatabaseProperties.java
GeopaparazziDatabaseProperties.createPropertiesTable
public static void createPropertiesTable( ASpatialDb database ) throws Exception { StringBuilder sb = new StringBuilder(); sb.append("CREATE TABLE "); sb.append(PROPERTIESTABLE); sb.append(" ("); sb.append(ID); sb.append(" INTEGER PRIMARY KEY AUTOINCREMENT, "); sb...
java
public static void createPropertiesTable( ASpatialDb database ) throws Exception { StringBuilder sb = new StringBuilder(); sb.append("CREATE TABLE "); sb.append(PROPERTIESTABLE); sb.append(" ("); sb.append(ID); sb.append(" INTEGER PRIMARY KEY AUTOINCREMENT, "); sb...
[ "public", "static", "void", "createPropertiesTable", "(", "ASpatialDb", "database", ")", "throws", "Exception", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "sb", ".", "append", "(", "\"CREATE TABLE \"", ")", ";", "sb", ".", "append"...
Create the properties table. @param database the db to use. @throws Exception
[ "Create", "the", "properties", "table", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/styles/GeopaparazziDatabaseProperties.java#L69-L97
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/styles/GeopaparazziDatabaseProperties.java
GeopaparazziDatabaseProperties.createDefaultPropertiesForTable
public static Style createDefaultPropertiesForTable( ASpatialDb database, String spatialTableUniqueName, String spatialTableLabelField ) throws Exception { StringBuilder sbIn = new StringBuilder(); sbIn.append("insert into ").append(PROPERTIESTABLE); sbIn.append(" ( "); sbIn....
java
public static Style createDefaultPropertiesForTable( ASpatialDb database, String spatialTableUniqueName, String spatialTableLabelField ) throws Exception { StringBuilder sbIn = new StringBuilder(); sbIn.append("insert into ").append(PROPERTIESTABLE); sbIn.append(" ( "); sbIn....
[ "public", "static", "Style", "createDefaultPropertiesForTable", "(", "ASpatialDb", "database", ",", "String", "spatialTableUniqueName", ",", "String", "spatialTableLabelField", ")", "throws", "Exception", "{", "StringBuilder", "sbIn", "=", "new", "StringBuilder", "(", "...
Create a default properties table for a spatial table. @param database the db to use. If <code>null</code>, the style is not inserted in the db. @param spatialTableUniqueName the spatial table's unique name to create the property record for. @return @return the created style object. @throws Exception if something goes...
[ "Create", "a", "default", "properties", "table", "for", "a", "spatial", "table", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/styles/GeopaparazziDatabaseProperties.java#L108-L147
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/styles/GeopaparazziDatabaseProperties.java
GeopaparazziDatabaseProperties.updateStyle
public static void updateStyle( ASpatialDb database, Style style ) throws Exception { StringBuilder sbIn = new StringBuilder(); sbIn.append("update ").append(PROPERTIESTABLE); sbIn.append(" set "); // sbIn.append(NAME).append("='").append(style.name).append("' , "); sbIn.append(S...
java
public static void updateStyle( ASpatialDb database, Style style ) throws Exception { StringBuilder sbIn = new StringBuilder(); sbIn.append("update ").append(PROPERTIESTABLE); sbIn.append(" set "); // sbIn.append(NAME).append("='").append(style.name).append("' , "); sbIn.append(S...
[ "public", "static", "void", "updateStyle", "(", "ASpatialDb", "database", ",", "Style", "style", ")", "throws", "Exception", "{", "StringBuilder", "sbIn", "=", "new", "StringBuilder", "(", ")", ";", "sbIn", ".", "append", "(", "\"update \"", ")", ".", "appen...
Update a style definition. @param database the db to use. @param style the {@link Style} to set. @throws Exception if something goes wrong.
[ "Update", "a", "style", "definition", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/styles/GeopaparazziDatabaseProperties.java#L156-L190
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/ngmf/ui/TableListener.java
TableListener.parseString
private ArrayList<ArrayList<String>> parseString(String text) { ArrayList<ArrayList<String>> result = new ArrayList<ArrayList<String>>(); StringTokenizer linetoken = new StringTokenizer(text, "\n"); StringTokenizer token; String current; while (linetoken.hasMoreTokens()) { ...
java
private ArrayList<ArrayList<String>> parseString(String text) { ArrayList<ArrayList<String>> result = new ArrayList<ArrayList<String>>(); StringTokenizer linetoken = new StringTokenizer(text, "\n"); StringTokenizer token; String current; while (linetoken.hasMoreTokens()) { ...
[ "private", "ArrayList", "<", "ArrayList", "<", "String", ">", ">", "parseString", "(", "String", "text", ")", "{", "ArrayList", "<", "ArrayList", "<", "String", ">>", "result", "=", "new", "ArrayList", "<", "ArrayList", "<", "String", ">", ">", "(", ")",...
turns the clipboard into a list of tokens each array list is a line, each string in the list is a token in the line @param text @return
[ "turns", "the", "clipboard", "into", "a", "list", "of", "tokens", "each", "array", "list", "is", "a", "line", "each", "string", "in", "the", "list", "is", "a", "token", "in", "the", "line" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/ngmf/ui/TableListener.java#L41-L61
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/ngmf/ui/TableListener.java
TableListener.addContents
private void addContents(String text) { int firstColSelected = table.getSelectedColumn(); int firstRowSelected = table.getSelectedRow(); int temp = firstColSelected; if (firstColSelected == -1 || firstRowSelected == -1) { return; } ArrayList<ArrayList<String...
java
private void addContents(String text) { int firstColSelected = table.getSelectedColumn(); int firstRowSelected = table.getSelectedRow(); int temp = firstColSelected; if (firstColSelected == -1 || firstRowSelected == -1) { return; } ArrayList<ArrayList<String...
[ "private", "void", "addContents", "(", "String", "text", ")", "{", "int", "firstColSelected", "=", "table", ".", "getSelectedColumn", "(", ")", ";", "int", "firstRowSelected", "=", "table", ".", "getSelectedRow", "(", ")", ";", "int", "temp", "=", "firstColS...
this adds the text to the jtable @param text
[ "this", "adds", "the", "text", "to", "the", "jtable" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/ngmf/ui/TableListener.java#L67-L87
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/ngmf/ui/TableListener.java
TableListener.pasteClipboard
public void pasteClipboard() { Transferable t = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null); try { if (t != null && t.isDataFlavorSupported(DataFlavor.stringFlavor)) { addContents((String) t.getTransferData(DataFlavor.stringFlavor)); tab...
java
public void pasteClipboard() { Transferable t = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null); try { if (t != null && t.isDataFlavorSupported(DataFlavor.stringFlavor)) { addContents((String) t.getTransferData(DataFlavor.stringFlavor)); tab...
[ "public", "void", "pasteClipboard", "(", ")", "{", "Transferable", "t", "=", "Toolkit", ".", "getDefaultToolkit", "(", ")", ".", "getSystemClipboard", "(", ")", ".", "getContents", "(", "null", ")", ";", "try", "{", "if", "(", "t", "!=", "null", "&&", ...
this is the function that adds the clipboard contents to the table
[ "this", "is", "the", "function", "that", "adds", "the", "clipboard", "contents", "to", "the", "table" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/ngmf/ui/TableListener.java#L90-L100
train
TheHortonMachine/hortonmachine
apps/src/main/java/org/hortonmachine/nww/gui/ViewControlsLayer.java
ViewControlsLayer.getControlType
public String getControlType(Object control) { if (control == null || !(control instanceof ScreenAnnotation)) return null; if (showPanControls && controlPan.equals(control)) return AVKey.VIEW_PAN; else if (showLookControls && controlLook.equals(control)) ...
java
public String getControlType(Object control) { if (control == null || !(control instanceof ScreenAnnotation)) return null; if (showPanControls && controlPan.equals(control)) return AVKey.VIEW_PAN; else if (showLookControls && controlLook.equals(control)) ...
[ "public", "String", "getControlType", "(", "Object", "control", ")", "{", "if", "(", "control", "==", "null", "||", "!", "(", "control", "instanceof", "ScreenAnnotation", ")", ")", "return", "null", ";", "if", "(", "showPanControls", "&&", "controlPan", ".",...
Get the control type associated with the given object or null if unknown. @param control the control object @return the control type. Can be one of {@link AVKey#VIEW_PAN}, {@link AVKey#VIEW_LOOK}, {@link AVKey#VIEW_HEADING_LEFT}, {@link AVKey#VIEW_HEADING_RIGHT}, {@link AVKey#VIEW_ZOOM_IN}, {@link AVKey#VIEW_ZOOM_OUT...
[ "Get", "the", "control", "type", "associated", "with", "the", "given", "object", "or", "null", "if", "unknown", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/apps/src/main/java/org/hortonmachine/nww/gui/ViewControlsLayer.java#L393-L424
train
TheHortonMachine/hortonmachine
apps/src/main/java/org/hortonmachine/nww/gui/ViewControlsLayer.java
ViewControlsLayer.highlight
public void highlight(Object control) { // Manage highlighting of controls. if (this.currentControl == control) return; // same thing selected // Turn off highlight if on. if (this.currentControl != null) { this.currentControl.getAttributes().setImage...
java
public void highlight(Object control) { // Manage highlighting of controls. if (this.currentControl == control) return; // same thing selected // Turn off highlight if on. if (this.currentControl != null) { this.currentControl.getAttributes().setImage...
[ "public", "void", "highlight", "(", "Object", "control", ")", "{", "// Manage highlighting of controls.", "if", "(", "this", ".", "currentControl", "==", "control", ")", "return", ";", "// same thing selected", "// Turn off highlight if on.", "if", "(", "this", ".", ...
Specifies the control to highlight. Any currently highlighted control is un-highlighted. @param control the control to highlight.
[ "Specifies", "the", "control", "to", "highlight", ".", "Any", "currently", "highlighted", "control", "is", "un", "-", "highlighted", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/apps/src/main/java/org/hortonmachine/nww/gui/ViewControlsLayer.java#L441-L460
train
TheHortonMachine/hortonmachine
apps/src/main/java/org/hortonmachine/nww/gui/ViewControlsLayer.java
ViewControlsLayer.getImageSource
protected Object getImageSource(String control) { if (control.equals(AVKey.VIEW_PAN)) return IMAGE_PAN; else if (control.equals(AVKey.VIEW_LOOK)) return IMAGE_LOOK; else if (control.equals(AVKey.VIEW_HEADING_LEFT)) return IMAGE_HEADING_LEFT; else i...
java
protected Object getImageSource(String control) { if (control.equals(AVKey.VIEW_PAN)) return IMAGE_PAN; else if (control.equals(AVKey.VIEW_LOOK)) return IMAGE_LOOK; else if (control.equals(AVKey.VIEW_HEADING_LEFT)) return IMAGE_HEADING_LEFT; else i...
[ "protected", "Object", "getImageSource", "(", "String", "control", ")", "{", "if", "(", "control", ".", "equals", "(", "AVKey", ".", "VIEW_PAN", ")", ")", "return", "IMAGE_PAN", ";", "else", "if", "(", "control", ".", "equals", "(", "AVKey", ".", "VIEW_L...
Get a control image source. @param control the control type. Can be one of {@link AVKey#VIEW_PAN}, {@link AVKey#VIEW_LOOK}, {@link AVKey#VIEW_HEADING_LEFT}, {@link AVKey#VIEW_HEADING_RIGHT}, {@link AVKey#VIEW_ZOOM_IN}, {@link AVKey#VIEW_ZOOM_OUT}, {@link AVKey#VIEW_PITCH_UP}, {@link AVKey#VIEW_PITCH_DOWN}, {@link AVKe...
[ "Get", "a", "control", "image", "source", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/apps/src/main/java/org/hortonmachine/nww/gui/ViewControlsLayer.java#L592-L620
train
TheHortonMachine/hortonmachine
apps/src/main/java/org/hortonmachine/nww/gui/ViewControlsLayer.java
ViewControlsLayer.computeLocation
protected Point computeLocation(Rectangle viewport, Rectangle controls) { double x; double y; if (this.locationCenter != null) { x = this.locationCenter.x - controls.width / 2; y = this.locationCenter.y - controls.height / 2; } else if (this.p...
java
protected Point computeLocation(Rectangle viewport, Rectangle controls) { double x; double y; if (this.locationCenter != null) { x = this.locationCenter.x - controls.width / 2; y = this.locationCenter.y - controls.height / 2; } else if (this.p...
[ "protected", "Point", "computeLocation", "(", "Rectangle", "viewport", ",", "Rectangle", "controls", ")", "{", "double", "x", ";", "double", "y", ";", "if", "(", "this", ".", "locationCenter", "!=", "null", ")", "{", "x", "=", "this", ".", "locationCenter"...
Compute the screen location of the controls overall rectangle bottom right corner according to either the location center if not null, or the screen position. @param viewport the current viewport rectangle. @param controls the overall controls rectangle @return the screen location of the bottom left corner - south we...
[ "Compute", "the", "screen", "location", "of", "the", "controls", "overall", "rectangle", "bottom", "right", "corner", "according", "to", "either", "the", "location", "center", "if", "not", "null", "or", "the", "screen", "position", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/apps/src/main/java/org/hortonmachine/nww/gui/ViewControlsLayer.java#L736-L779
train
enasequence/sequencetools
src/main/java/uk/ac/ebi/embl/api/validation/ValidationMessage.java
ValidationMessage.error
public static ValidationMessage<Origin> error(String messageKey,Object... params) { return ValidationMessage.message(Severity.ERROR, messageKey, params); }
java
public static ValidationMessage<Origin> error(String messageKey,Object... params) { return ValidationMessage.message(Severity.ERROR, messageKey, params); }
[ "public", "static", "ValidationMessage", "<", "Origin", ">", "error", "(", "String", "messageKey", ",", "Object", "...", "params", ")", "{", "return", "ValidationMessage", ".", "message", "(", "Severity", ".", "ERROR", ",", "messageKey", ",", "params", ")", ...
Creates a ValidationMessage - severity ERROR @param messageKey message key @param params message parameters @return a validation message - severity ERROR
[ "Creates", "a", "ValidationMessage", "-", "severity", "ERROR" ]
4127f5e1a17540239f5810136153fbd6737fa262
https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/ValidationMessage.java#L255-L257
train
enasequence/sequencetools
src/main/java/uk/ac/ebi/embl/api/validation/ValidationMessage.java
ValidationMessage.warning
public static ValidationMessage<Origin> warning(String messageKey, Object... params) { return ValidationMessage.message(Severity.WARNING, messageKey, params); }
java
public static ValidationMessage<Origin> warning(String messageKey, Object... params) { return ValidationMessage.message(Severity.WARNING, messageKey, params); }
[ "public", "static", "ValidationMessage", "<", "Origin", ">", "warning", "(", "String", "messageKey", ",", "Object", "...", "params", ")", "{", "return", "ValidationMessage", ".", "message", "(", "Severity", ".", "WARNING", ",", "messageKey", ",", "params", ")"...
Creates a ValidationMessage - severity WARNING @param messageKey message key @param params message parameters @return a validation message - severity WARNING
[ "Creates", "a", "ValidationMessage", "-", "severity", "WARNING" ]
4127f5e1a17540239f5810136153fbd6737fa262
https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/ValidationMessage.java#L266-L268
train
enasequence/sequencetools
src/main/java/uk/ac/ebi/embl/api/validation/ValidationMessage.java
ValidationMessage.info
public static ValidationMessage<Origin> info(String messageKey, Object... params) { return ValidationMessage.message(Severity.INFO, messageKey, params); }
java
public static ValidationMessage<Origin> info(String messageKey, Object... params) { return ValidationMessage.message(Severity.INFO, messageKey, params); }
[ "public", "static", "ValidationMessage", "<", "Origin", ">", "info", "(", "String", "messageKey", ",", "Object", "...", "params", ")", "{", "return", "ValidationMessage", ".", "message", "(", "Severity", ".", "INFO", ",", "messageKey", ",", "params", ")", ";...
Creates a ValidationMessage - severity INFO @param messageKey message key @param params message parameters @return a validation message - severity INFO
[ "Creates", "a", "ValidationMessage", "-", "severity", "INFO" ]
4127f5e1a17540239f5810136153fbd6737fa262
https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/ValidationMessage.java#L277-L279
train
enasequence/sequencetools
src/main/java/uk/ac/ebi/embl/api/validation/ValidationMessage.java
ValidationMessage.writeMessage
public void writeMessage( Writer writer, String targetOrigin ) throws IOException { writeMessage( writer, messageFormatter, targetOrigin ); }
java
public void writeMessage( Writer writer, String targetOrigin ) throws IOException { writeMessage( writer, messageFormatter, targetOrigin ); }
[ "public", "void", "writeMessage", "(", "Writer", "writer", ",", "String", "targetOrigin", ")", "throws", "IOException", "{", "writeMessage", "(", "writer", ",", "messageFormatter", ",", "targetOrigin", ")", ";", "}" ]
Writes the message with an additional target origin.
[ "Writes", "the", "message", "with", "an", "additional", "target", "origin", "." ]
4127f5e1a17540239f5810136153fbd6737fa262
https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/ValidationMessage.java#L377-L380
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/ColumnVector.java
ColumnVector.set
protected void set(double values[]) { this.nRows = values.length; this.nCols = 1; this.values = new double[nRows][1]; for (int r = 0; r < nRows; ++r) { this.values[r][0] = values[r]; } }
java
protected void set(double values[]) { this.nRows = values.length; this.nCols = 1; this.values = new double[nRows][1]; for (int r = 0; r < nRows; ++r) { this.values[r][0] = values[r]; } }
[ "protected", "void", "set", "(", "double", "values", "[", "]", ")", "{", "this", ".", "nRows", "=", "values", ".", "length", ";", "this", ".", "nCols", "=", "1", ";", "this", ".", "values", "=", "new", "double", "[", "nRows", "]", "[", "1", "]", ...
Set this column vector from an array of values. @param values the array of values
[ "Set", "this", "column", "vector", "from", "an", "array", "of", "values", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/math/matrixes/ColumnVector.java#L85-L94
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/features/FeatureMate.java
FeatureMate.getAttributesNames
public List<String> getAttributesNames() { SimpleFeatureType featureType = feature.getFeatureType(); List<AttributeDescriptor> attributeDescriptors = featureType.getAttributeDescriptors(); List<String> attributeNames = new ArrayList<String>(); for( AttributeDescriptor attributeDescripto...
java
public List<String> getAttributesNames() { SimpleFeatureType featureType = feature.getFeatureType(); List<AttributeDescriptor> attributeDescriptors = featureType.getAttributeDescriptors(); List<String> attributeNames = new ArrayList<String>(); for( AttributeDescriptor attributeDescripto...
[ "public", "List", "<", "String", ">", "getAttributesNames", "(", ")", "{", "SimpleFeatureType", "featureType", "=", "feature", ".", "getFeatureType", "(", ")", ";", "List", "<", "AttributeDescriptor", ">", "attributeDescriptors", "=", "featureType", ".", "getAttri...
Getter for the list of attribute names. @return the list of attribute names.
[ "Getter", "for", "the", "list", "of", "attribute", "names", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/features/FeatureMate.java#L98-L108
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/features/FeatureMate.java
FeatureMate.getAttribute
@SuppressWarnings("unchecked") public <T> T getAttribute( String attrName, Class<T> adaptee ) { if (attrName == null) { return null; } if (adaptee == null) { adaptee = (Class<T>) String.class; } Object attribute = feature.getAttribute(attrName); ...
java
@SuppressWarnings("unchecked") public <T> T getAttribute( String attrName, Class<T> adaptee ) { if (attrName == null) { return null; } if (adaptee == null) { adaptee = (Class<T>) String.class; } Object attribute = feature.getAttribute(attrName); ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", ">", "T", "getAttribute", "(", "String", "attrName", ",", "Class", "<", "T", ">", "adaptee", ")", "{", "if", "(", "attrName", "==", "null", ")", "{", "return", "null", ";", "}", ...
Gets an attribute from the feature table, adapting to the supplied class. @param attrName the attribute name to pick. @param adaptee the class to adapt to. @return the adapted value if possible.
[ "Gets", "an", "attribute", "from", "the", "feature", "table", "adapting", "to", "the", "supplied", "class", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/features/FeatureMate.java#L117-L177
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/features/FeatureMate.java
FeatureMate.intersects
public boolean intersects( Geometry geometry, boolean usePrepared ) { if (!getEnvelope().intersects(geometry.getEnvelopeInternal())) { return false; } if (usePrepared) { if (preparedGeometry == null) { preparedGeometry = PreparedGeometryFactory.prepare(get...
java
public boolean intersects( Geometry geometry, boolean usePrepared ) { if (!getEnvelope().intersects(geometry.getEnvelopeInternal())) { return false; } if (usePrepared) { if (preparedGeometry == null) { preparedGeometry = PreparedGeometryFactory.prepare(get...
[ "public", "boolean", "intersects", "(", "Geometry", "geometry", ",", "boolean", "usePrepared", ")", "{", "if", "(", "!", "getEnvelope", "(", ")", ".", "intersects", "(", "geometry", ".", "getEnvelopeInternal", "(", ")", ")", ")", "{", "return", "false", ";...
Check for intersection. @param geometry the geometry to check against. @param usePrepared use prepared geometry. @return true if the geometries intersect.
[ "Check", "for", "intersection", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/features/FeatureMate.java#L186-L198
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/features/FeatureMate.java
FeatureMate.covers
public boolean covers( Geometry geometry, boolean usePrepared ) { if (!getEnvelope().covers(geometry.getEnvelopeInternal())) { return false; } if (usePrepared) { if (preparedGeometry == null) { preparedGeometry = PreparedGeometryFactory.prepare(getGeometry...
java
public boolean covers( Geometry geometry, boolean usePrepared ) { if (!getEnvelope().covers(geometry.getEnvelopeInternal())) { return false; } if (usePrepared) { if (preparedGeometry == null) { preparedGeometry = PreparedGeometryFactory.prepare(getGeometry...
[ "public", "boolean", "covers", "(", "Geometry", "geometry", ",", "boolean", "usePrepared", ")", "{", "if", "(", "!", "getEnvelope", "(", ")", ".", "covers", "(", "geometry", ".", "getEnvelopeInternal", "(", ")", ")", ")", "{", "return", "false", ";", "}"...
Check for cover. @param geometry the geometry to check against. @param usePrepared use prepared geometry. @return true if the current geometries covers the supplied one.
[ "Check", "for", "cover", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/features/FeatureMate.java#L207-L219
train
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/etp/OmsPenmanEtp.java
OmsPenmanEtp.calcAerodynamic
private double calcAerodynamic( double displacement, double roughness, double Zref, double windSpeed, double snowWaterEquivalent ) { double ra = 0.0; double d_Lower; double K2; double Z0_Lower; double tmp_wind; // only a value of these quantities are input o...
java
private double calcAerodynamic( double displacement, double roughness, double Zref, double windSpeed, double snowWaterEquivalent ) { double ra = 0.0; double d_Lower; double K2; double Z0_Lower; double tmp_wind; // only a value of these quantities are input o...
[ "private", "double", "calcAerodynamic", "(", "double", "displacement", ",", "double", "roughness", ",", "double", "Zref", ",", "double", "windSpeed", ",", "double", "snowWaterEquivalent", ")", "{", "double", "ra", "=", "0.0", ";", "double", "d_Lower", ";", "do...
Calculates the aerodynamic resistance for the vegetation layer. <p>Calculates the aerodynamic resistance for the vegetation layer, and the wind 2m above the layer boundary.</p> <p>The values are normalized based on a reference height wind speed, Uref, of 1 m/s. To get wind speeds and aerodynamic resistances for other ...
[ "Calculates", "the", "aerodynamic", "resistance", "for", "the", "vegetation", "layer", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/etp/OmsPenmanEtp.java#L307-L360
train
TheHortonMachine/hortonmachine
dbs/src/main/java/org/hortonmachine/dbs/spatialite/SpatialiteTableNames.java
SpatialiteTableNames.getTablesSorted
public static LinkedHashMap<String, List<String>> getTablesSorted( List<String> allTableNames, boolean doSort ) { LinkedHashMap<String, List<String>> tablesMap = new LinkedHashMap<>(); tablesMap.put(USERDATA, new ArrayList<String>()); tablesMap.put(STYLE, new ArrayList<String>()); tables...
java
public static LinkedHashMap<String, List<String>> getTablesSorted( List<String> allTableNames, boolean doSort ) { LinkedHashMap<String, List<String>> tablesMap = new LinkedHashMap<>(); tablesMap.put(USERDATA, new ArrayList<String>()); tablesMap.put(STYLE, new ArrayList<String>()); tables...
[ "public", "static", "LinkedHashMap", "<", "String", ",", "List", "<", "String", ">", ">", "getTablesSorted", "(", "List", "<", "String", ">", "allTableNames", ",", "boolean", "doSort", ")", "{", "LinkedHashMap", "<", "String", ",", "List", "<", "String", "...
Sorts all supplied table names by type. <p> Supported types are: <ul> <li>{@value ISpatialTableNames#INTERNALDATA} </li> <li>{@value ISpatialTableNames#METADATA} </li> <li>{@value ISpatialTableNames#SPATIALINDEX} </li> <li>{@value ISpatialTableNames#STYLE} </li> <li>{@value ISpatialTableNames#USERDATA} </li> </ul> @p...
[ "Sorts", "all", "supplied", "table", "names", "by", "type", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/spatialite/SpatialiteTableNames.java#L102-L143
train
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/geopap4/DaoBookmarks.java
DaoBookmarks.createTables
public static void createTables(Connection connection) throws IOException, SQLException { StringBuilder sB = new StringBuilder(); sB.append("CREATE TABLE "); sB.append(TABLE_BOOKMARKS); sB.append(" ("); sB.append(COLUMN_ID); sB.append(" INTEGER PRIMARY KEY, "); sB...
java
public static void createTables(Connection connection) throws IOException, SQLException { StringBuilder sB = new StringBuilder(); sB.append("CREATE TABLE "); sB.append(TABLE_BOOKMARKS); sB.append(" ("); sB.append(COLUMN_ID); sB.append(" INTEGER PRIMARY KEY, "); sB...
[ "public", "static", "void", "createTables", "(", "Connection", "connection", ")", "throws", "IOException", ",", "SQLException", "{", "StringBuilder", "sB", "=", "new", "StringBuilder", "(", ")", ";", "sB", ".", "append", "(", "\"CREATE TABLE \"", ")", ";", "sB...
Create bookmarks tables. @throws IOException if something goes wrong.
[ "Create", "bookmarks", "tables", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/geopap4/DaoBookmarks.java#L55-L91
train
TheHortonMachine/hortonmachine
dbs/src/main/java/org/hortonmachine/dbs/spatialite/SpatialiteCommonMethods.java
SpatialiteCommonMethods.checkCompatibilityIssues
public static String checkCompatibilityIssues( String sql ) { sql = sql.replaceAll("LONG PRIMARY KEY AUTOINCREMENT", "INTEGER PRIMARY KEY AUTOINCREMENT"); sql = sql.replaceAll("AUTO_INCREMENT", "AUTOINCREMENT"); return sql; }
java
public static String checkCompatibilityIssues( String sql ) { sql = sql.replaceAll("LONG PRIMARY KEY AUTOINCREMENT", "INTEGER PRIMARY KEY AUTOINCREMENT"); sql = sql.replaceAll("AUTO_INCREMENT", "AUTOINCREMENT"); return sql; }
[ "public", "static", "String", "checkCompatibilityIssues", "(", "String", "sql", ")", "{", "sql", "=", "sql", ".", "replaceAll", "(", "\"LONG PRIMARY KEY AUTOINCREMENT\"", ",", "\"INTEGER PRIMARY KEY AUTOINCREMENT\"", ")", ";", "sql", "=", "sql", ".", "replaceAll", "...
Check for compatibility issues with other databases. @param sql the original sql. @return the fixed sql.
[ "Check", "for", "compatibility", "issues", "with", "other", "databases", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/spatialite/SpatialiteCommonMethods.java#L76-L80
train
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/Controller.java
Controller.mapOut
void mapOut(String out, Object comp, String comp_out) { if (comp == ca.getComponent()) { throw new ComponentException("cannot connect 'Out' with itself for " + out); } ComponentAccess ac_dest = lookup(comp); FieldAccess destAccess = (FieldAccess) ac_dest.output(comp_out); ...
java
void mapOut(String out, Object comp, String comp_out) { if (comp == ca.getComponent()) { throw new ComponentException("cannot connect 'Out' with itself for " + out); } ComponentAccess ac_dest = lookup(comp); FieldAccess destAccess = (FieldAccess) ac_dest.output(comp_out); ...
[ "void", "mapOut", "(", "String", "out", ",", "Object", "comp", ",", "String", "comp_out", ")", "{", "if", "(", "comp", "==", "ca", ".", "getComponent", "(", ")", ")", "{", "throw", "new", "ComponentException", "(", "\"cannot connect 'Out' with itself for \"", ...
Map two output fields. @param out the output field name of this component @param comp the component @param comp_out the component output name;
[ "Map", "two", "output", "fields", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/Controller.java#L85-L106
train