code
stringlengths
73
34.1k
label
stringclasses
1 value
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 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 List validateSLD(InputSource xml) { URL schemaURL = SLDValidator.class.getResource("/schemas/sld/StyledLayerDescriptor.xsd"); return ResponseUtils.validate(xml, schemaURL, false, entityResolver); }
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...
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(); ...
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...
java
public static ValidationMessage<Origin> message( LineReader lineReader, Severity severity, String messageKey, Object... params) { return message(lineReader.getCurrentLineNumber(), severity, messageKey, params); }
java
public static void setCDSTranslationReport(ExtendedResult<CdsFeatureTranslationCheck.TranslationReportInfo> cdsCheckResult) { try { CdsFeatureTranslationCheck.TranslationReportInfo translationInfo = cdsCheckResult.getExtension(); StringWriter translationReportWriter = new StringWriter()...
java
public void writeTemplateSpreadsheetDownloadFile(List<TemplateTokenInfo> tokenNames, TemplateVariablesSet variablesSet, String filePath) throws TemplateException { prepareWriter(filePath); writeDow...
java
public void writeLargeTemplateSpreadsheetDownloadFile(List<TemplateTokenInfo> tokenNames, int entryCount, TemplateVariables constants, String file...
java
public void writeDownloadSpreadsheetHeader(List<TemplateTokenInfo> variableTokenNames) { StringBuilder headerBuilder = new StringBuilder(); headerBuilder.append(UPLOAD_COMMENTS); headerBuilder.append("\n"); for (TemplateTokenInfo tokenInfo : variableTokenNames) { if (tokenInf...
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...
java
public void readDwgSeqendV15(int[] data, int offset) throws Exception { int bitPos = offset; bitPos = readObjectHeaderV15(data, bitPos); bitPos = readObjectTailV15(data, bitPos); }
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...
java
public synchronized static boolean areConnectedUpstream(PfafstetterNumber p1, PfafstetterNumber p2) { List<Integer> p1OrdersList = p1.getOrdersList(); List<Integer> p2OrdersList = p2.getOrdersList(); int levelDiff = p1OrdersList.size(...
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); ...
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...
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...
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...
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 */ ...
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...
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...
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() + "," +...
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...
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); ...
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; }
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; ...
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()...
java
public void println(String value) { print(value); 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; }
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++) { ...
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' ...
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': ...
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...
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...
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 && ...
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 ...
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 ...
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); }
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; }
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; ...
java
private static boolean isunixtimeleap( double unixTime ) { double gpsTime = unixTime - 315964800; gpsTime += countleaps(gpsTime, true) - 1; return isleap(gpsTime); }
java
public static EGpsWeekDays gpsWeekTime2WeekDay( double gpsWeekTime ) { int seconds = (int) gpsWeekTime; // week starts with Sunday EGpsWeekDays day4Seconds = EGpsWeekDays.getDay4Seconds(seconds); return day4Seconds; }
java
public static String gpsWeekTime2ISO8601( double gpsWeekTime ) { DateTime gps2unix = gpsWeekTime2DateTime(gpsWeekTime); return gps2unix.toString(ISO8601Formatter); }
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()); ...
java
public void setSelectionModel(FontSelectionModel newModel ) { FontSelectionModel oldModel = selectionModel; selectionModel = newModel; oldModel.removeChangeListener(labelUpdater); newModel.addChangeListener(labelUpdater); firePropertyChange("selectionModel", oldModel, newModel); ...
java
protected void fireChangeListeners() { ChangeEvent ev = new ChangeEvent(this); Object[] l = listeners.getListeners(ChangeListener.class); for (Object listener : l) { ((ChangeListener) listener).stateChanged(ev); } }
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...
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...
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 =...
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...
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 */ ...
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...
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...
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) { ...
java
private boolean nodeOk( GridNode node ) { return node != null && !assignedFlowsMap.isMarked(node.col, node.row); }
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...
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; }
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()) { ...
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; } ...
java
private static Class getArrayBaseType(Class array) { while (array.isArray()) { array = array.getComponentType(); } return array; }
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...
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; }
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); ...
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()); }
java
public static void writeActiveWindowToMapset( String mapsetPath, Window window ) throws IOException { writeWindowFile(mapsetPath + File.separator + GrassLegacyConstans.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); }
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...
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...
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 (!...
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); ...
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...
java
public static boolean hasLevel( ASpatialDb db, int levelNum ) throws Exception { String tablename = TABLENAME + levelNum; return db.hasTable(tablename); }
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...
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...
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(...
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...
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....
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...
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()) { ...
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...
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...
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)) ...
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...
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...
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...
java
public static ValidationMessage<Origin> error(String messageKey,Object... params) { return ValidationMessage.message(Severity.ERROR, messageKey, params); }
java
public static ValidationMessage<Origin> warning(String messageKey, Object... params) { return ValidationMessage.message(Severity.WARNING, messageKey, params); }
java
public static ValidationMessage<Origin> info(String messageKey, Object... params) { return ValidationMessage.message(Severity.INFO, messageKey, params); }
java
public void writeMessage( Writer writer, String targetOrigin ) throws IOException { writeMessage( writer, messageFormatter, targetOrigin ); }
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]; } }
java
public List<String> getAttributesNames() { SimpleFeatureType featureType = feature.getFeatureType(); List<AttributeDescriptor> attributeDescriptors = featureType.getAttributeDescriptors(); List<String> attributeNames = new ArrayList<String>(); for( AttributeDescriptor attributeDescripto...
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); ...
java
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 covers( Geometry geometry, boolean usePrepared ) { if (!getEnvelope().covers(geometry.getEnvelopeInternal())) { return false; } if (usePrepared) { if (preparedGeometry == null) { preparedGeometry = PreparedGeometryFactory.prepare(getGeometry...
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...
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...
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...
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; }
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); ...
java