query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Set columns that will be swapped
public void setColumns(int a, int b) { this.a = a; this.b = b; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void swapColumns() {\r\n\t\tboolean moved = false;\r\n\t\tfor(int i = 0; i < columnLocations.size() && !moved; i++) {\r\n if(!(table.getColumnName(i).equals(columnLocations.get(i)))) {\r\n int properIndex = columnLocations.indexOf(table.getColumnName(i));\r\n if ( properIndex != -1 ) {\r\n \t\ttable.moveColumn(i, properIndex);\r\n \t\tmoved = true;\r\n }\r\n }\r\n }\r\n\t\tif ( moved ) {\r\n\t\t\tswapColumns();\r\n\t\t}\r\n\t}", "public void swapColumns(int pos1, int pos2) {\n Column temp = columns[pos1];\n setColumn(columns[pos2], pos1);\n setColumn(temp, pos2);\n }", "public void swapColumns( int c1, int c2 ) {\n\tfor (int r = 0; r < this.size(); r++){\n\t Object c1Val = matrix[r][c1];\n\t matrix[r][c1] = matrix[r][c2];\n\t matrix[r][c2] = c1Val;\n\t}\n }", "public void setColumns(Column[] newColumns) { columns = newColumns; }", "private void swapCol(int col1, int col2) {\r\n List<Integer> columnTmp = new ArrayList<Integer>();\r\n for (int row = 0; row < 9; row++)\r\n columnTmp.add(solution[row][col1]);\r\n for(int row = 0; row<9; row++)\r\n solution[row][col1] = solution[row][col2];\r\n for(int row = 0; row<9; row++)\r\n solution[row][col2] = columnTmp.get(row);\r\n }", "public void setColumns(ArrayList tmp) {\n this.columns = tmp;\n }", "public void swapColumns(int i, int j) {\n swap(columnPivot, columnUnpivot, i, j);\n }", "protected AbstractMatrix3D vColumnFlip() {\n\tif (columns>0) {\n\t\tcolumnZero += (columns-1)*columnStride;\n\t\tcolumnStride = -columnStride;\n\t\tthis.isNoView = false;\n\t}\n\treturn this;\n}", "public abstract void toggleSortOrder(int column);", "public void setColumns(int columns)\n {\n this.columns = columns;\n }", "void setColumn(Column newColumn, int pos) { columns[pos] = newColumn; }", "public void setCols(int cols) {\n this.cols = cols;\n }", "void setColumns(List<String> columns);", "@Test\n public void testSetMatrixColumn() {\n final Matrix33d mBase = getMatrix();\n final Matrix33d m = getMatrix();\n final Vector3d v = new Vector3d(D10, D11, D12);\n\n m.setMatrixColumn(v, 1);\n for (int i = 0; i < m.getA().length; i++) {\n if (i > 2 && i < 6) {\n // compare the row set to the vector values\n int vectorIndex = i - 3;\n assertEquals(m.getA()[i], v.a[vectorIndex]);\n } else {\n assertEquals(m.getA()[i], mBase.getA()[i]);\n }\n }\n }", "public void setPositionColumn(int value){this.positionColumn = value;}", "public void resizeColumns() {\n }", "public void setColumns(int columns) {\n\t\tthis.columns = columns;\n\t}", "public void setColumns(int columns) {\n int oldVal = this.columns;\n if (columns < 0) {\n throw new IllegalArgumentException(\"columns less than zero.\");\n }\n if (columns != oldVal) {\n this.columns = columns;\n invalidate();\n }\n }", "public void flipVertical() {\n\t\t\tthis.data = flipGridVertical(data);\n\t\t\tcomputeHashes();\n\t\t}", "private void renameColumns()\r\n {\r\n \tfor (int i=0;i<this.tempTableAColumnsShortName.size();i++)\r\n \t{\r\n \t\tthis.requete.append(\"\\n ALTER TABLE \"+this.tempTableA+\" RENAME \"+this.tempTableAColumnsShortName.get(i)+\" TO \"+this.tempTableAColumnsLongName.get(i)+\";\");\r\n \t}\r\n \t\r\n \tfor (int i=0;i<this.allCols.size();i++)\r\n \t{\r\n \t\tthis.requete.append(\"\\n ALTER TABLE \"+this.tempTableA+\" RENAME i\"+i+\" TO i_\" + this.allCols.get(i)+\";\");\r\n \t\tif (colData.get(this.allCols.get(i))!=null)\r\n \t\t{\r\n \t\t\tthis.requete.append(\"\\n ALTER TABLE \"+this.tempTableA+\" RENAME v\"+i+\" TO v_\" + this.allCols.get(i)+\";\");\r\n \t\t}\r\n \t}\r\n \t\t\r\n }", "private void transpose() {\n Utils.transpose(this._board);\n }", "public void cols(String...columns) {\n\t\tthis.columnList = columns;\n\t}", "public void normalizeTable() {\r\n for (int i = 0; i < this.getLogicalColumnCount(); i++) {\r\n normalizeColumn(i);\r\n }\r\n }", "public void setColumnSizes() {\n Set<JTable> tables = columnSizes.keySet();\n\n for (JTable current : tables) {\n TableColumnModel tcm = current.getColumnModel();\n\n if (tcm != null) {\n int columnCount = tcm.getColumnCount();\n int[] tableColumnSizes = columnSizes.get(current);\n\n for (int i = 0; i < tableColumnSizes.length; i++) {\n if (i >= columnCount) {\n break;\n }\n\n TableColumn column = tcm.getColumn(i);\n\n if (column != null) {\n column.setPreferredWidth(tableColumnSizes[i]);\n }\n }\n\n current.setColumnModel(tcm);\n }\n }\n }", "public void setCol(int newCol) {\n this.col = newCol;\n }", "public void decrementColumn() {\n setRowAndColumn(row, Math.max(column - 1, 0));\n }", "public void setColumns(List<String> columnNames);", "void swapTiles(int row1, int col1, int row2, int col2) {\n Tile temp = tiles[row1][col1];\n tiles[row1][col1] = tiles[row2][col2];\n tiles[row2][col2] = temp;\n\n setChanged();\n notifyObservers();\n }", "private void upgradeMapViewsToColumns()\r\n {\r\n String sql =\r\n \"insert into mapview_columns(mapviewid, sort_order, dimension) \" +\r\n \"select mapviewid, 0, 'dx' \" +\r\n \"from mapview mv \" +\r\n \"where not exists (\" +\r\n \"select mc.mapviewid \" +\r\n \"from mapview_columns mc \" +\r\n \"where mv.mapviewid = mc.mapviewid)\";\r\n\r\n executeSql( sql );\r\n }", "public void swapRows( int r1, int r2 ) {\n\tfor (int c = 0; c < this.size(); c++){\n\t Object r1Val = matrix[r1][c];\n\t matrix[r1][c] = matrix[r2][c];\n\t matrix[r2][c] = r1Val;\n\t}\n }", "public void setCol(int c) {\n\t\tthis.col = c;\n\t}", "private static void exch(Alumno[] a, int i, int j) {\n\t Alumno swap = a[i];\n\t a[i] = a[j];\n\t a[j] = swap;\n\t }", "public void setColumns(int arg1) {\r\n\t\tgetJTextField().setColumns(arg1);\r\n\t}", "public void update() {\n // If no previous columns, use new columns and return\n if(this.columns == null || this.columns.size() == 0) {\n if(this.newColumns.size() > 0){\n finish(newColumns);\n }\n return;\n }\n \n // If no new columns, retain previous columns and return\n if(this.newColumns.size() == 0) {\n this.index = 0;\n this.column = this.columns.get(index);\n return;\n }\n \n // Merge previous columns with new columns\n // There will be no overlapping\n List<ColumnCount> mergeColumns = new ArrayList<ColumnCount>(\n columns.size() + newColumns.size());\n index = 0;\n newIndex = 0;\n column = columns.get(0);\n newColumn = newColumns.get(0);\n while(true) {\n int ret = Bytes.compareTo(\n column.getBuffer(), column.getOffset(),column.getLength(), \n newColumn.getBuffer(), newColumn.getOffset(), newColumn.getLength());\n \n // Existing is smaller than new, add existing and iterate it\n if(ret <= -1) {\n mergeColumns.add(column);\n if(++index == columns.size()) {\n // No more existing left, merge down rest of new and return \n mergeDown(mergeColumns, newColumns, newIndex);\n finish(mergeColumns);\n return;\n }\n column = columns.get(index);\n continue;\n }\n \n // New is smaller than existing, add new and iterate it\n mergeColumns.add(newColumn);\n if(++newIndex == newColumns.size()) {\n // No more new left, merge down rest of existing and return\n mergeDown(mergeColumns, columns, index);\n finish(mergeColumns);\n return;\n }\n newColumn = newColumns.get(newIndex);\n continue;\n }\n }", "@Override\n\tpublic void setColumn(int x) {\n\t\tdelegate.setColumn(x);\n\t}", "protected void setColumns(String[] columns)\n\t{\n\t\t_searchKeyList = new Vector(columns.length) ;\n\t\tfor (int i = 0; i < columns.length; i++)\n\t\t{\n\t\t\t//#CM708979\n\t\t\t// Key column set\n\t\t\t_searchKeyList.addElement(new Key(columns[i])) ;\n\t\t}\n\t}", "public void setColumns(int columns)\n {\n field.setColumns(columns);\n }", "public void updateColumnSizes() {\n Set<JTable> tables = columnSizes.keySet();\n\n for (JTable current : tables) {\n int[] tableColumnSizes = columnSizes.get(current);\n TableColumnModel tcm = current.getColumnModel();\n tableColumnSizes = new int[current.getColumnCount()];\n columnSizes.put(current, tableColumnSizes);\n\n for (int i = 0; i < current.getModel().getColumnCount(); i++) {\n int width = tcm.getColumn(i).getWidth();\n tableColumnSizes[i] = width;\n }\n }\n }", "public void autoSizeColumns() {\n\t\tfor (TableColumn column : tableViewer.getTable().getColumns()) {\n\t\t\tcolumn.pack();\n\t\t}\n\t}", "public void swapRows(int pos1, int pos2) {\n\n for (int i = 0; i < columns.length; i++) {\n Object Obj1 = columns[i].getRow(pos1);\n columns[i].setRow(columns[i].getRow(pos2), pos1);\n columns[i].setRow(Obj1, pos2);\n\n // swap missing values.\n boolean missing1 = columns[i].isValueMissing(pos1);\n boolean missing2 = columns[i].isValueMissing(pos2);\n columns[i].setValueToMissing(missing2, pos1);\n columns[i].setValueToMissing(missing1, pos2);\n\n }\n }", "private void resetHiddenCols() {\n\t\tpopup.removeAll();\n\t\tidMap.clear();\n\t\titemMap.clear();\n\t\thiddenCols.clear();\n\t}", "public void flipBoard() {\r\n\t\tfor (int i = 0; i < this.SIZE/2; i++) {\r\n\t\t\tfor (int j = 0; j < this.SIZE; j++) {\r\n\t\t\t\tswap(j, this.SIZE - 1 - i, j, i);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void rotateColumn(int a, int b) {\n for (int i = 0; i < b; i++) {\n char last = screen[screen.length - 1][a];\n for (int j = screen.length - 2; j >= 0; j--) {\n screen[j + 1][a] = screen[j][a];\n }\n screen[0][a] = last;\n }\n }", "void setColumnIndex(int index);", "public void setColumns(List<String> columns){\r\n\t\tthis.columns=columns;\r\n\t}", "public void setCol(int value) {\n this.col = value;\n }", "void setColumnIndex(int newIndex);", "private void setNumColumns(int cols) {\n\t\tnumColumns = cols; \n\t}", "public final void setColumn(int column, float x, float y, float z) {\n\tif (column == 0) {\n\t m00 = x;\n\t m10 = y;\n\t m20 = z;\n\t} else if (column == 1) {\n\t m01 = x;\n\t m11 = y;\n\t m21 = z;\n\t} else if (column == 2) {\n\t m02 = x;\n\t m12 = y;\n\t m22 = z;\n\t} else {\n\t throw new ArrayIndexOutOfBoundsException(\"column must be 0 to 2 and is \" + column);\n\t}\n }", "void setupNewColumns( final int newColumnCount, final PdfData pdd )\r\n {\r\n PdfOutfile outfile = pdd.getOutfile();\r\n float currYposition = outfile.getYposition();\r\n float verticalSkip = computeVerticalSkip( currYposition, pdd );\r\n\r\n // going from 1 column to many\r\n if( pdd.getColumnCount() == 1 ) {\r\n pdd.setColumns( new Columns( newColumnCount, verticalSkip, pdd ));\r\n }\r\n else\r\n // going from many to 1, so then we can close off where we are on the\r\n // page and go back to a single column. If we are in the leftmost column,\r\n // then we make the conversion right there on the page. If we are not in the\r\n // leftmost column, then we presume that the leftmost column has been filled\r\n // to the bottom of the page, so we need to do a page eject and start on the\r\n // next page.\r\n\r\n // adjustCurrentColumn(); //-----from v. 0.1.16. Needed?\r\n if( newColumnCount == 1 ) {\r\n // are we in the leftmost column?\r\n if( pdd.getCurrColumn() == 0 ) {\r\n pdd.setColumns( new Columns( 1, verticalSkip, pdd ));\r\n }\r\n else\r\n // if we're not in the first column, we have to assume\r\n // that the leftmost column is full to the bottom of the\r\n // page, so we push out a new page and start in the left\r\n // column of that page (column 0)\r\n {\r\n outfile.newPageLowLevel();\r\n pdd.setColumns( new Columns( 1, 0f, pdd ));\r\n pdd.setCurrColumn( 0 );\r\n }\r\n }\r\n else\r\n // we are going form many columns to another number of many columns\r\n // so start a new page and resume in column 0\r\n {\r\n outfile.newPageLowLevel();\r\n pdd.setColumns( new Columns( newColumnCount, 0f, pdd ));\r\n pdd.setCurrColumn( 0 );\r\n }\r\n }", "public void toggleSort(@NonNull final List<Column> allColumns) {\r\n ColumnSort local = getSort();\r\n boolean clearOthers = false;\r\n // Toggle sort\r\n switch (local) {\r\n case SORT_DOWN:\r\n local = ColumnSort.UNSORTED;\r\n break;\r\n case SORT_UP:\r\n local = ColumnSort.SORT_DOWN;\r\n clearOthers = true;\r\n break;\r\n case UNSORTED:\r\n local = ColumnSort.SORT_UP;\r\n clearOthers = true;\r\n break;\r\n }\r\n setSort(local);\r\n // don't hold lock -- could deadlock\r\n if (clearOthers) {\r\n for (Column c : allColumns) {\r\n if (c != this) {\r\n c.setSort(ColumnSort.UNSORTED);\r\n }\r\n }\r\n }\r\n }", "public void setmCols(int mCols) {\n this.mCols = mCols;\n }", "protected void setColumnState(ColumnState colState) {\n\t\tObject colId = colState.getColId();\n\t\ttry {\n\t\t\tint index = getColumnIndex(colId);\n\t\t\tcolState.resetState(getColumn(index));\n\t\t\tif (colState.isHidden()) {\n\t\t\t\thideColumn(colId);\n\t\t\t} else {\n\t\t\t\tint stateIndex = colState.getIndex();\n\t\t\t\tif (index != stateIndex && stateIndex < getColumnCount())\n\t\t\t\t\tmoveColumn(index, stateIndex);\n\t\t\t}\n\n\t\t\t// Maybe it is a hidden column\n\t\t} catch (IllegalArgumentException e) {\n\t\t\tif (hiddenCols.containsKey(colId)) {\n\t\t\t\tHiddenColumn col = (HiddenColumn) hiddenCols.get(colId);\n\t\t\t\tcolState.resetState(col.column);\n\t\t\t\tcol.lastIndex = colState.getIndex();\n\t\t\t\tif (!colState.isHidden()) {\n\t\t\t\t\tshowColumn(colId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private static String[] flipGridVertical(String[] grid) {\n\t\tString[] tmp = new String[grid.length];\n\t\tfor(int row = 0; row < grid.length; row++) {\n\t\t\ttmp[grid.length - (row+1)] = grid[row];\n\t\t}\n\t\treturn tmp;\n\t}", "public void setColumnWidths(int[] widthes){\n\t\tif (widthes.length > tableViewer.getTable().getColumnCount()) {\n\t\t\tsetColumnsCount(widthes.length);\n\t\t}\n\t\tfor (int i = 0; i < widthes.length; i++) {\n\t\t\ttableViewer.getTable().getColumn(i).setWidth(widthes[i]);\n\t\t}\n\t}", "public void setColumnName(String newVal) {\n if ((newVal != null && this.columnName != null && (newVal.compareTo(this.columnName) == 0)) || \n (newVal == null && this.columnName == null && columnName_is_initialized)) {\n return; \n } \n this.columnName = newVal; \n\n columnName_is_modified = true; \n columnName_is_initialized = true; \n }", "@Override\n public void toggleSortOrder(int column) {\n if (column == TablesTableModel.COLUMN_CREATED || column == TablesTableModel.COLUMN_SEATS) {\n List<? extends SortKey> sortKeys = getSortKeys();\n if (sortKeys.size() == 2) {\n // clear sort on second click\n setSortKeys(null);\n } else {\n // setup sort on first click\n List<SortKey> list = new ArrayList<>();\n list.add(new RowSorter.SortKey(TablesTableModel.COLUMN_SEATS, SortOrder.ASCENDING));\n list.add(new RowSorter.SortKey(TablesTableModel.COLUMN_CREATED, SortOrder.DESCENDING));\n setSortKeys(list);\n }\n } else {\n super.toggleSortOrder(column);\n }\n }", "public void flipIndexes() {\n int temp = index1;\n index1 = index2;\n index2 = temp;\n }", "public void incremetColumn() {\n setRowAndColumn(row, column + 1);\n }", "public void setCol(int column) {\n\t\tthis.column = column; \n\t}", "@Override\n\tpublic void setColumnForMove(int col) {\n\t\tthis.dropCol = col;\n\t}", "public synchronized final void reset() {\r\n f_index = getDefaultIndex();\r\n f_userSetWidth = -1;\r\n // by default the first column is sorted the others unsorted\r\n f_sort = getDefaultSort();\r\n }", "public void swapRows (int pos1, int pos2) {\n\t \tint swap = this.subset[pos1];\n\t \tthis.subset[pos1] = this.subset[pos2];\n\t \tthis.subset[pos2] = swap;\n\t }", "private void setThePieces(){\n for(int i = 0; i<HEIGHT;i++){\n for(int j = 0; j<WIDTH;j++){\n if(piecesToSwap[i][j]==null){\n \n }else{\n m_Pieces[i][j]=piecesToSwap[i][j];\n \n }\n }\n }\n }", "public void setColumns(ArrayList<Object> columns){\n\t\tif(columns == null) return;\n\t\t\n\t\tMethod setter = null;\n\t\tint count = 1;\n\t\tString columnValueAsString = null;\n\t\tfor(Object columnValue : columns) {\n\t\t\tcolumnValueAsString = (columnValue!=null)?columnValue.toString():null;\n\t\t\ttry {\n\t\t\t\tsetter = this.getClass().getMethod(\"setColumn\" + count, java.lang.String.class);\n\t\t\t\tsetter.invoke(this, columnValueAsString);\n\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IllegalAccessException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (InvocationTargetException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (SecurityException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (NoSuchMethodException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} finally{\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tif(count > MAX_NUMBER_OF_COLUMNS) break;\n\t\t}\n\t}", "@Override\n public List<PmTableCol> getColumns() {\n if (this.sortOrderSelection == null) {\n List<PmTableCol> cols = PmUtil.getPmChildrenOfType(this, PmTableCol.class);\n for (int i=0; i<cols.size(); ++i) {\n cols.get(i).getColPosAttr().setValue(i);\n }\n this.sortOrderSelection = new SortOrderSelection(cols);\n return cols;\n }\n else {\n return PmUtil.getPmChildrenOfType(this, PmTableCol.class);\n }\n }", "public void setRowCol(int row1, int col1){\n row = row1;\n col = col1;\n }", "@Override\n public Matrix assignColumn(int column, Vector other) {\n // note the reversed pivoting for other\n return base.assignColumn(columnPivot[column], new PermutedVectorView(other, rowUnpivot, rowPivot));\n }", "private void initTableColumns() {\r\n\r\n Column<Player, String> nameColumn = new Column<Player, String>(new TextCell()) {\r\n @Override\r\n public String getValue(Player object) {\r\n return object.getName();\r\n }\r\n };\r\n this.addColumn(nameColumn, ApplicationResources.getMessages().cell_player_name());\r\n\r\n Column<Player, Number> atpPointColumn = new Column<Player, Number>(new NumberCell()) {\r\n @Override\r\n public Integer getValue(Player object) {\r\n return object.getAtpPoint();\r\n }\r\n };\r\n atpPointColumn.setDefaultSortAscending(false);\r\n sortHandler.setComparator(atpPointColumn, new Comparator<Player>() {\r\n @Override\r\n public int compare(Player o1, Player o2) {\r\n return o1.getAtpPoint().compareTo(o2.getAtpPoint());\r\n }\r\n });\r\n this.addColumn(atpPointColumn, ApplicationResources.getMessages().cell_player_atpPoint());\r\n // sort column\r\n this.getColumnSortList().push(atpPointColumn);\r\n }", "public void mixColumns(int[][] arr) {//method for mixColumns\n int[][] tarr = new int[4][4];\n for (int i = 0; i < 4; i++) {\n System.arraycopy(arr[i], 0, tarr[i], 0, 4);\n }\n for (int i = 0; i < 4; i++) {\n for (int j = 0; j < 4; j++) {\n arr[i][j] = mcHelper(tarr, galois, i, j);\n }\n }\n }", "public void setDisplayColumns(String displayColumns) {\n String oldDisplayColumns = getDisplayColumns();\n query.setDisplayColumns(displayColumns);\n// reformat display here\n propertyChangeSupport.firePropertyChange(\"displayColumns\", oldDisplayColumns, displayColumns);\n }", "@Override\r\n public int getColumnCount() {\n return fixColumNames.length;\r\n }", "private void swapFirstTwoTiles() {\n ((Board) boardManager.getBoard()).swapTiles(0, 0, 0, 1);\n }", "public void flipHorizontal() {\n\t\t\tfor(int row = 0; row < TILE_DIM; row++) {\n\t\t\t\tString tmp = \"\";\n\t\t\t\tfor(int col = TILE_DIM-1; col >= 0; col--) {\n\t\t\t\t\ttmp += this.data[row].charAt(col);\n\t\t\t\t}\n\t\t\t\tthis.data[row] = tmp;\n\t\t\t}\n\t\t\tcomputeHashes();\n\t\t}", "public void setColumns(LIST<IfcTableColumn> Columns)\n\t{\n\t\tthis.Columns = Columns;\n\t\tfireChangeEvent();\n\t}", "private void swapPosition(int curRow, int curCol, int newRow, int newCol){\n gameBoard[newRow][newCol] = gameBoard[curRow][curCol];\n gameBoard[curRow][curCol] = new EmptyPiece();\n }", "public void setCol(int col)\n\t{\n\t\tthis.col = col;\n\t}", "public void setCol(int col)\n\t{\n\t\tthis.col = col;\n\t}", "public void setColumnName(String columnName);", "protected void sortAndAddColumns( List<ColumnMeta<T>> columnMetas ) {\n for ( ColumnMeta meta : columnMetas ) {\n checkColumnMeta( meta );\n }\n // Sort based on preferences applied\n Collections.sort( columnMetas );\n //Add the columns based on the preferences\n for ( ColumnMeta meta : columnMetas ) {\n addColumn( meta );\n }\n }", "public static void swapPosts(int[][] view, int i, int j) {\n int[] temp = view[i];\n view[i] = view[j];\n view[j] = temp;\n }", "public void swap(int i, int j) {\n swapRows(i, j);\n swapColumns(i, j);\n }", "void incrementColumnIndex();", "void incrementColumnIndex();", "public int[] getColumnsOfSpecialComparatorForSorting() {\n return new int[]{0, 1, 2};\n }", "void incrementColumnIndex(int size);", "void incrementColumnIndex(int size);", "public final void transpose() {\n\tfloat tmp = m01;\n\tm01 = m10;\n\tm10 = tmp;\n\n\ttmp = m02;\n\tm02 = m20;\n\tm20 = tmp;\n\n\ttmp = m12;\n\tm12 = m21;\n\tm21 = tmp;\n\n }", "public void swapPieceValues(int x, int y, int row, int col) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.row = row;\n\t\tthis.col = col;\n\t}", "Table setColumn(int index, String name);", "private void setLayout(ColumnInfo[] layout)\n\t{\n\t\tthis.m_layout = layout;\n\t\tgetModel().setNoColumns(m_layout.length);\n\n\t\treturn;\n\t}", "public void storeColumnLocations() {\r\n\t\tcolumnLocations.removeAllElements();\r\n\t\tfor (int i = 0; i < table.getColumnCount(); i++) {\r\n\t\t\tcolumnLocations.add(table.getColumnName(i));\r\n\t\t}\r\n\t}", "private void generateColumns() {\n\t\tSquare[] squareArr=new Square[squares.length];\n\t\tfor (int i=0; i<squares.length; i++) {\n\t\t\tfor (int j=0; j<squares.length; j++) {\n\t\t\t\tsquareArr[j]=squares[j][i];\n\t\t\t}\n\t\t\tcolumns[i]=new Column(squareArr);\n\t\t}\n\t}", "protected void setTreeColumns(Tree tree) {\n \t\tTreeColumn tc = new TreeColumn(tree, SWT.LEFT, 0);\n \t\ttc.setResizable(true);\n \t\ttc.setWidth(400);\n \t\ttc = new TreeColumn(tree, SWT.LEFT, 1);\n \t\ttc.setWidth(600);\n \t\ttc.setResizable(true);\n \t}", "public static void flipHorizontalAxis(int[][] matrix) {\n for(int i = matrix.length - 1; i >= matrix.length/2; i-- ){\n for(int j = 0; j < matrix[i].length; j++){\n int temp = matrix[i][j];\n matrix[i][j] = matrix[(matrix.length - 1) - i][j];\n matrix[(matrix.length - 1) - i][j] = temp;\n }\n }\n}", "public void initFromColSets(IntSet[] inputCols) {\n // Initialize resizable rows\n IntList[] dynamicRows = new IntList[this.numRows];\n for (int i = 0; i < this.numRows; i++) {\n dynamicRows[i] = new IntArrayList();\n }\n\n this.cols = inputCols;\n for (int i = 0; i < this.numCols; i++) {\n for (int c : this.cols[i]) {\n dynamicRows[c].add(i);\n }\n }\n\n // Sort each row and copy to myself\n for (int i = 0; i < this.numRows; i++) {\n int[] row = dynamicRows[i].toIntArray();\n Arrays.sort(row);\n this.rows[i] = row;\n }\n }", "final private void toggelSortColumn( final int columnIndex )\r\n {\r\n if( columnIndex != Util.INVALID_INDEX )\r\n {\r\n final RowSorter rowSorter = jTable.getRowSorter();\r\n if( rowSorter != null )\r\n { // avoid exception\r\n rowSorter.toggleSortOrder( columnIndex );\r\n }\r\n // else no row sorter available\r\n }\r\n }", "private void adjustColumnOffsetsForColumnsPreviouslyCalculated(int index) {\n for (int j = 0; j <= index; j++) {\n columnDataPosition_[j] -= currentRowPosition_;\n }\n }", "public static void setPlayerColumn(int buttonNumber){\n\n int playerColumn; // global in python\n boolean moveFlag; // global in python\n\n if (gameBoard[0][buttonNumber].equals(\"-\")) { // Check if .equals() needs to be implemented\n playerColumn = buttonNumber;\n moveFlag = true;\n System.out.println(\"Player selected column: \" + (playerColumn + 1));\n }\n\n else{\n // Show dialgoue box that column is already full\n System.out.println(\"Column is full\");\n }\n }", "private TableColumn<Object, ?> fillColumns() {\n\t\t\n\t\treturn null;\n\t}" ]
[ "0.7306465", "0.69012946", "0.68348837", "0.66141087", "0.6386971", "0.6304403", "0.6253096", "0.61445504", "0.60904276", "0.6070494", "0.6015774", "0.59866863", "0.5967694", "0.595154", "0.5916202", "0.59027606", "0.589314", "0.58706534", "0.58666015", "0.58600014", "0.5824429", "0.5772474", "0.5704566", "0.5700297", "0.56709546", "0.5661161", "0.5651635", "0.56390345", "0.5618824", "0.5612001", "0.5597791", "0.559461", "0.55912846", "0.55879533", "0.55714464", "0.55577475", "0.5546714", "0.55391085", "0.55292565", "0.5525831", "0.5511326", "0.55088305", "0.5506232", "0.55035406", "0.55025417", "0.54710484", "0.5466975", "0.5435693", "0.5428239", "0.5420672", "0.5413225", "0.5411534", "0.5405756", "0.5399583", "0.5396724", "0.537771", "0.537254", "0.5371416", "0.5366866", "0.5361585", "0.53596973", "0.535488", "0.53436685", "0.5338299", "0.5324559", "0.5298734", "0.5296055", "0.5280159", "0.5277297", "0.52758396", "0.52754325", "0.5253671", "0.5253066", "0.52478904", "0.5243339", "0.5239723", "0.5236452", "0.5236452", "0.52345073", "0.52301794", "0.5228202", "0.5226205", "0.522226", "0.522226", "0.52171713", "0.5209586", "0.5209586", "0.5208899", "0.5204614", "0.51944023", "0.5189787", "0.5184349", "0.51794183", "0.51763296", "0.5173467", "0.51722", "0.51714766", "0.5167612", "0.5160835", "0.5137432" ]
0.6198328
7
Execute column swap (go through equations and swap columns)
@Override public void execute() { for (LinearEquation e : m) { ComplexNumber temp = new ComplexNumber(e.getCoefficient(a)); e.setCoefficient(a, e.getCoefficient(b)); e.setCoefficient(b, temp); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void swapColumns( int c1, int c2 ) {\n\tfor (int r = 0; r < this.size(); r++){\n\t Object c1Val = matrix[r][c1];\n\t matrix[r][c1] = matrix[r][c2];\n\t matrix[r][c2] = c1Val;\n\t}\n }", "private void swapCol(int col1, int col2) {\r\n List<Integer> columnTmp = new ArrayList<Integer>();\r\n for (int row = 0; row < 9; row++)\r\n columnTmp.add(solution[row][col1]);\r\n for(int row = 0; row<9; row++)\r\n solution[row][col1] = solution[row][col2];\r\n for(int row = 0; row<9; row++)\r\n solution[row][col2] = columnTmp.get(row);\r\n }", "public void swapColumns() {\r\n\t\tboolean moved = false;\r\n\t\tfor(int i = 0; i < columnLocations.size() && !moved; i++) {\r\n if(!(table.getColumnName(i).equals(columnLocations.get(i)))) {\r\n int properIndex = columnLocations.indexOf(table.getColumnName(i));\r\n if ( properIndex != -1 ) {\r\n \t\ttable.moveColumn(i, properIndex);\r\n \t\tmoved = true;\r\n }\r\n }\r\n }\r\n\t\tif ( moved ) {\r\n\t\t\tswapColumns();\r\n\t\t}\r\n\t}", "public void swapColumns(int pos1, int pos2) {\n Column temp = columns[pos1];\n setColumn(columns[pos2], pos1);\n setColumn(temp, pos2);\n }", "public void flipVertical() {\n\t\t\tthis.data = flipGridVertical(data);\n\t\t\tcomputeHashes();\n\t\t}", "public void swapColumns(int i, int j) {\n swap(columnPivot, columnUnpivot, i, j);\n }", "protected AbstractMatrix3D vColumnFlip() {\n\tif (columns>0) {\n\t\tcolumnZero += (columns-1)*columnStride;\n\t\tcolumnStride = -columnStride;\n\t\tthis.isNoView = false;\n\t}\n\treturn this;\n}", "public final void transpose() {\n\tfloat tmp = m01;\n\tm01 = m10;\n\tm10 = tmp;\n\n\ttmp = m02;\n\tm02 = m20;\n\tm20 = tmp;\n\n\ttmp = m12;\n\tm12 = m21;\n\tm21 = tmp;\n\n }", "private void swapRow(int row1, int row2){\r\n\t\tfor(int j=0; j<KolEff; j++){\r\n\t\t\tdouble temp = this.Elmt[row1][j];\r\n\t\t\tthis.Elmt[row1][j] = this.Elmt[row2][j];\r\n\t\t\tthis.Elmt[row2][j] = temp;\r\n\t\t}\r\n\t}", "protected void swapTilesInPlace(int row1, int col1, int row2, int col2) {\r\n int temp = getTile(row1, col1);\r\n state.setTile(row1, col1, getTile(row2, col2));\r\n state.setTile(row2, col2, temp);\r\n }", "private static void vecswap(double x[], int[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x,a2, a, b);\n\t}", "private static void vecswap(double x[], double[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x,a2, a, b);\n\t}", "public void decrementColumn() {\n setRowAndColumn(row, Math.max(column - 1, 0));\n }", "public abstract void toggleSortOrder(int column);", "public static void flipHorizontalAxis(int[][] matrix) {\n for(int i = matrix.length - 1; i >= matrix.length/2; i-- ){\n for(int j = 0; j < matrix[i].length; j++){\n int temp = matrix[i][j];\n matrix[i][j] = matrix[(matrix.length - 1) - i][j];\n matrix[(matrix.length - 1) - i][j] = temp;\n }\n }\n}", "public void flipBoard() {\r\n\t\tfor (int i = 0; i < this.SIZE/2; i++) {\r\n\t\t\tfor (int j = 0; j < this.SIZE; j++) {\r\n\t\t\t\tswap(j, this.SIZE - 1 - i, j, i);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void swapRows( int r1, int r2 ) {\n\tfor (int c = 0; c < this.size(); c++){\n\t Object r1Val = matrix[r1][c];\n\t matrix[r1][c] = matrix[r2][c];\n\t matrix[r2][c] = r1Val;\n\t}\n }", "private static <T> void vecswap(float x[],T[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a2, a, b);\n\t}", "protected Matrix symmetrize(Matrix lower) {\r\n Matrix upper = lower;\r\n for(int i = 0; i < upper.getRowCount(); i++) {\r\n int index = i;\r\n upper.getAndSet(i, r -> {\r\n for(int j = index + 1; j < r.length; j++) {\r\n r[j] = lower.get(j, index);\r\n }\r\n });\r\n }\r\n return upper;\r\n }", "private void transpose() {\n Utils.transpose(this._board);\n }", "private static <T> void vecswap(int x[], double[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a2, a, b);\n\t}", "public void flipV() {\r\n int tmp, sym;\r\n for (int col = 0; col < pixels.length; ++col) {\r\n for (int row = 0; row < pixels[col].length / 2; ++row) {\r\n // find the column index of the vertically symmetric pixel\r\n sym = pixels[col].length - 1 - row;\r\n // swap the pixel value between the two\r\n tmp = pixels[col][row];\r\n pixels[col][row] = pixels[col][sym];\r\n pixels[col][sym] = tmp;\r\n }\r\n }\r\n this.pix2img();\r\n }", "void swapTiles(int row1, int col1, int row2, int col2) {\n Tile temp = tiles[row1][col1];\n tiles[row1][col1] = tiles[row2][col2];\n tiles[row2][col2] = temp;\n\n setChanged();\n notifyObservers();\n }", "public void swap(int i, int j) {\n swapRows(i, j);\n swapColumns(i, j);\n }", "private static void vecswap(char x[], char[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a2, a, b);\n\t}", "private void vecswap(double x[], int a, int b, int n) {\r\n for (int i = 0; i < n; i++, a++, b++) {\r\n swap(x, a, b);\r\n }\r\n }", "private static <T> void vecswap(double x[], T[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x,a2, a, b);\n\t}", "private static void swapMatrix(int[][] matrix, int i1, int j1, int i2, int j2) {\n int temp = matrix[i1][j1];\n matrix[i1][j1] = matrix[i2][j2];\n matrix[i2][j2] = temp;\n }", "private static void vecswap(int x[], int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a, b);\n\t}", "public void swapPieceValues(int x, int y, int row, int col) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.row = row;\n\t\tthis.col = col;\n\t}", "@Override\n public INDArray swap(INDArray x, INDArray y) {\n //NativeBlas.dswap(x.length(), x.data(), 0, 1, y.data(), 0, 1);\n JavaBlas.rswap(x.length(), x.data(), x.offset(), 1, y.data(), y.offset(), 1);\n return y;\n }", "private void swap(int firstIdx, int secondIdx) {\r\n // TODO\r\n }", "private static void vecswap(int x[], int[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a2, a, b);\n\t}", "public void swap() {\n\t\tCode.put(Code.dup_x1);\n\t\tCode.put(Code.pop);\n\t}", "private static <T> void vecswap(byte x[], T[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a2, a, b);\n\t}", "public void rotateColumn(int a, int b) {\n for (int i = 0; i < b; i++) {\n char last = screen[screen.length - 1][a];\n for (int j = screen.length - 2; j >= 0; j--) {\n screen[j + 1][a] = screen[j][a];\n }\n screen[0][a] = last;\n }\n }", "private void swapRow(int row1, int row2){\r\n int[] rowTmp = solution[row1].clone();\r\n for(int i = 0; i<9; i++)\r\n solution[row1][i] = solution[row2][i];\r\n for(int i = 0; i<9; i++)\r\n solution[row2][i] = rowTmp[i];\r\n }", "private static void swapTwoLines(int rowOne, int rowTwo, double[][] matrix,\r\n double[] vector) {\r\n\r\n double[] tmpLine;\r\n double tmpVar;\r\n\r\n tmpLine = matrix[rowOne];\r\n tmpVar = vector[rowOne];\r\n\r\n matrix[rowOne] = matrix[rowTwo];\r\n vector[rowOne] = vector[rowTwo];\r\n\r\n matrix[rowTwo] = tmpLine;\r\n vector[rowTwo] = tmpVar;\r\n }", "public void flipIndexes() {\n int temp = index1;\n index1 = index2;\n index2 = temp;\n }", "public static void swap(int a1, int b1) {\t\t\n\t\tint temp = algorithmThree[a1];\n\t\talgorithmThree[a1] = algorithmThree[b1];\n\t\talgorithmThree[b1] = temp;\n\t}", "private static <T> void vecswap(char x[], T[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a2, a, b);\n\t}", "void swapRow(Matrix m, int i1, int i2) {\r\n double[] temp = m.M[i1];\r\n m.M[i1] = m.M[i2];\r\n m.M[i2] = temp;\r\n }", "private void renameColumns()\r\n {\r\n \tfor (int i=0;i<this.tempTableAColumnsShortName.size();i++)\r\n \t{\r\n \t\tthis.requete.append(\"\\n ALTER TABLE \"+this.tempTableA+\" RENAME \"+this.tempTableAColumnsShortName.get(i)+\" TO \"+this.tempTableAColumnsLongName.get(i)+\";\");\r\n \t}\r\n \t\r\n \tfor (int i=0;i<this.allCols.size();i++)\r\n \t{\r\n \t\tthis.requete.append(\"\\n ALTER TABLE \"+this.tempTableA+\" RENAME i\"+i+\" TO i_\" + this.allCols.get(i)+\";\");\r\n \t\tif (colData.get(this.allCols.get(i))!=null)\r\n \t\t{\r\n \t\t\tthis.requete.append(\"\\n ALTER TABLE \"+this.tempTableA+\" RENAME v\"+i+\" TO v_\" + this.allCols.get(i)+\";\");\r\n \t\t}\r\n \t}\r\n \t\t\r\n }", "public void vreflect() {\n int rows= currentIm.getRows();\n int cols= currentIm.getCols();\n int h= 0;\n int k= cols-1;\n //invariant: columns 0..h-1 and k+1.. have been inverted\n while (h < k) {\n // Swap column h with column k\n // invariant: pixels 0..c-1 of columns h and k have been swapped\n for (int c= 0; c != rows; c= c+1) {\n currentIm.swapPixels(c, h, c, k);\n }\n \n h= h+1; k= k-1;\n }\n \n }", "private void swapFirstTwoTiles() {\n ((Board) boardManager.getBoard()).swapTiles(0, 0, 0, 1);\n }", "private void transpose() {\n\n // Make a copy of current orientation of rgb and energy arrays.\n int[][] rgbCopy = new int[width][height];\n for (int col = 0; col < width; col++) {\n rgbCopy[col] = rgb[col].clone();\n }\n double[][] energyCopy = new double[width][height];\n for (int col = 0; col < width; col++) {\n energyCopy[col] = energy[col].clone();\n }\n\n // Swap axes.\n int temp = width;\n width = height;\n height = temp;\n\n // Re-init arrays with swapped dimensions.\n rgb = new int[width][height];\n energy = new double[width][height];\n\n // Swap individual pixels in rgb and energy arrays.\n for (int col = 0; col < width; col++) {\n for (int row = 0; row < height; row++) {\n rgb[col][row] = rgbCopy[row][col];\n energy[col][row] = energyCopy[row][col];\n }\n }\n }", "private static void exch(Alumno[] a, int i, int j) {\n\t Alumno swap = a[i];\n\t a[i] = a[j];\n\t a[j] = swap;\n\t }", "public void update() {\n // If no previous columns, use new columns and return\n if(this.columns == null || this.columns.size() == 0) {\n if(this.newColumns.size() > 0){\n finish(newColumns);\n }\n return;\n }\n \n // If no new columns, retain previous columns and return\n if(this.newColumns.size() == 0) {\n this.index = 0;\n this.column = this.columns.get(index);\n return;\n }\n \n // Merge previous columns with new columns\n // There will be no overlapping\n List<ColumnCount> mergeColumns = new ArrayList<ColumnCount>(\n columns.size() + newColumns.size());\n index = 0;\n newIndex = 0;\n column = columns.get(0);\n newColumn = newColumns.get(0);\n while(true) {\n int ret = Bytes.compareTo(\n column.getBuffer(), column.getOffset(),column.getLength(), \n newColumn.getBuffer(), newColumn.getOffset(), newColumn.getLength());\n \n // Existing is smaller than new, add existing and iterate it\n if(ret <= -1) {\n mergeColumns.add(column);\n if(++index == columns.size()) {\n // No more existing left, merge down rest of new and return \n mergeDown(mergeColumns, newColumns, newIndex);\n finish(mergeColumns);\n return;\n }\n column = columns.get(index);\n continue;\n }\n \n // New is smaller than existing, add new and iterate it\n mergeColumns.add(newColumn);\n if(++newIndex == newColumns.size()) {\n // No more new left, merge down rest of existing and return\n mergeDown(mergeColumns, columns, index);\n finish(mergeColumns);\n return;\n }\n newColumn = newColumns.get(newIndex);\n continue;\n }\n }", "private void swapAt(int i, int j) {\n\t\tfloat tmp = sequence[i];\n\t\tsequence[i] = sequence[j];\n\t\tsequence[j] = tmp;\n\t}", "private static <T,P> void vecswap(T x[], P[] a2,int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x,a2, a, b);\n\t}", "public void hreflect() {\n int rows= currentIm.getRows();\n int cols= currentIm.getCols();\n int h= 0;\n int k= rows-1;\n //invariant: rows 0..h-1 and k+1.. have been inverted\n while (h < k) {\n // Swap row h with row k\n // invariant: pixels 0..c-1 of rows h and k have been swapped\n for (int c= 0; c != cols; c= c+1) {\n currentIm.swapPixels(h, c, k, c);\n }\n \n h= h+1; k= k-1;\n }\n }", "private static <T,P> void vecswap(T x[], int[] a2,int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x,a2, a, b);\n\t}", "private static <T> void vecswap(int x[], T[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a2, a, b);\n\t}", "public final void mSWAP() throws RecognitionException\n\t{\n\t\ttry\n\t\t{\n\t\t\tfinal int _type = AshvmLexer.SWAP;\n\t\t\tfinal int _channel = BaseRecognizer.DEFAULT_TOKEN_CHANNEL;\n\t\t\t// D:\\\\Programmieren\\\\projects\\\\ashvm\\\\Ashvm.g:753:6: ( 'swap' )\n\t\t\t// D:\\\\Programmieren\\\\projects\\\\ashvm\\\\Ashvm.g:753:8: 'swap'\n\t\t\t{\n\t\t\t\tthis.match(\"swap\");\n\n\t\t\t}\n\n\t\t\tthis.state.type = _type;\n\t\t\tthis.state.channel = _channel;\n\t\t}\n\t\tfinally\n\t\t{\n\t\t}\n\t}", "@Test\n public void testSetMatrixColumn() {\n final Matrix33d mBase = getMatrix();\n final Matrix33d m = getMatrix();\n final Vector3d v = new Vector3d(D10, D11, D12);\n\n m.setMatrixColumn(v, 1);\n for (int i = 0; i < m.getA().length; i++) {\n if (i > 2 && i < 6) {\n // compare the row set to the vector values\n int vectorIndex = i - 3;\n assertEquals(m.getA()[i], v.a[vectorIndex]);\n } else {\n assertEquals(m.getA()[i], mBase.getA()[i]);\n }\n }\n }", "public void flipHorizontal() {\n\t\t\tfor(int row = 0; row < TILE_DIM; row++) {\n\t\t\t\tString tmp = \"\";\n\t\t\t\tfor(int col = TILE_DIM-1; col >= 0; col--) {\n\t\t\t\t\ttmp += this.data[row].charAt(col);\n\t\t\t\t}\n\t\t\t\tthis.data[row] = tmp;\n\t\t\t}\n\t\t\tcomputeHashes();\n\t\t}", "private static void swap(double x[], double[] a2, int a, int b) {\n\t\tdouble t = x[a];\n\t\tx[a] = x[b];\n\t\tx[b] = t;\n\t\tdouble t2 = a2[a];\n\t\ta2[a] = a2[b];\n\t\ta2[b] = t2;\n\t}", "public void flip() {\n float tx = x1;\n float ty = y1;\n x1 = x2;\n y1 = y2;\n x2 = tx;\n y2 = ty;\n nx = -nx;\n ny = -ny;\n }", "private void swapPosition(int curRow, int curCol, int newRow, int newCol){\n gameBoard[newRow][newCol] = gameBoard[curRow][curCol];\n gameBoard[curRow][curCol] = new EmptyPiece();\n }", "private static void swap(double x[], int[] a2, int a, int b) {\n\t\tdouble t = x[a];\n\t\tx[a] = x[b];\n\t\tx[b] = t;\n\t\tint t2 = a2[a];\n\t\ta2[a] = a2[b];\n\t\ta2[b] = t2;\n\t}", "private Board swap(int row1, int col1, int row2, int col2) {\n int[][] copy = new int[N][N]; // Instantiate a new N x N tile grid to avoid mutating the instance tile grid\n for (int row = 0; row < N; row++)\n copy[row] = tiles[row].clone(); // Copy each row of the instance grid to the copy grid\n\n // Swap tiles at the row/column indeces passed to the method\n int temp = copy[row1][col1];\n copy[row1][col1] = copy[row2][col2];\n copy[row2][col2] = temp;\n\n return new Board(copy); // Return new board containing swapped tiles\n }", "private void rearrangeSolution() {\r\n List<Integer> trinity = new ArrayList<Integer>();\r\n trinity.add(0); trinity.add(1); trinity.add(2);\r\n permutateDigits();\r\n for (int i = 0; i<9; i+=3) {\r\n Collections.shuffle(trinity);\r\n swapRow(trinity.get(0)+i, trinity.get(1)+i);\r\n }\r\n for (int i = 0; i<9; i+=3) {\r\n Collections.shuffle(trinity);\r\n swapCol(trinity.get(0)+i, trinity.get(1)+i);\r\n }\r\n }", "public static double evalSwap(ArrayList<City> routine, int index1, int index2) {\n double oldDistance = evaluateRoutine(routine,index1,index2);\n swapCity(routine, index1, index2);\n double newDistance = evaluateRoutine(routine,index1,index2);\n return oldDistance - newDistance;\n }", "private static <T> void vecswap(long x[], T[] a2,int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x,a2, a, b);\n\t}", "@Override\n protected void runAlgorithm() {\n for (int i = 0; i < getArray().length; i++) {\n for (int j = i + 1; j < getArray().length; j++) {\n if (applySortingOperator(getValue(j), getValue(i))) {\n swap(i, j);\n }\n }\n }\n }", "public void swapBlocks(int row0, int col0, int row1, int col1, int nr, int nc) {\n int rows= currentIm.getRows();\n int cols= currentIm.getCols();\n int ht= rows/nr;\n int wd= cols/nc;\n for (int r= 0; r < ht; r= r+1) {\n for (int c= 0; c < wd; c= c+1) {\n currentIm.swapPixels(row0*ht+r, col0*wd+c, row1*ht+r, col1*wd+c);\n }\n }\n }", "private void swapMethod(int f1, int f2)\n\t {\n\t\tSystem.out.println(\"BEFORE SWAPPING F1 Value :\"+f1+\"F2 VALUE IS:\"+f2);\n\t\tint f3=f1;\n\t\tf1=f2;\n\t\tf2=f3;\n\t\tSystem.out.println(\"AFTER SWAPPING F1 Value :\"+f1+\"F2 VALUE IS:\"+f2);\n\t }", "@Override\n public Matrix assignColumn(int column, Vector other) {\n // note the reversed pivoting for other\n return base.assignColumn(columnPivot[column], new PermutedVectorView(other, rowUnpivot, rowPivot));\n }", "private static <T,P> void vecswap(List<T> x, List<P> a2,int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x,a2, a, b);\n\t}", "private static <T> void vecswap(List<T> x, int a, int b, int n) {\n for (int i = 0; i < n; i++, a++, b++) {\n swapElements(x, a, b);\n }\n }", "private void swapTransforms() {\n Transform tmp = workTransform;\n workTransform = userTransform;\n userTransform = tmp;\n }", "public void undo() {\n\t\tif(committed){\n\t\t\treturn;\n\t\t}\n\t\tboolean [][] tempGrid = grid;\n\t\tgrid = backupGrid;\n\t\tbackupGrid = tempGrid;\n\n\t\tint [] tempWidths = widths;\n\t\twidths = backupWidths;\n\t\tbackupWidths = tempWidths;\n\n\t\tint [] tempHeights = heights;\n\t\theights = backupHeights;\n\t\tbackupHeights = tempHeights;\n\n\t\tint tempMaxColumnHeight = maxColumnHeight;\n\t\tmaxColumnHeight = backupMaxColumnHeight;\n\t\tbackupMaxColumnHeight = tempMaxColumnHeight;\n\n\t\tcommit();\n\t}", "private void swap(double x[], int a, int b) {\r\n double t = x[a];\r\n x[a] = x[b];\r\n x[b] = t;\r\n }", "private static void swap(int[] arr, int i, int j) {\n arr[i] = arr[j]^arr[i]^(arr[j] = arr[i]);\n }", "private void swapElement ( int p1, int p2 )\n\t{\n\t}", "public final void swap() {\n\t\tif (size > 1) {\n\t\t\tdouble topMostValue = pop();\n\t\t\tdouble secondTopMostValue = pop();\n\t\t\tpush(topMostValue);\n\t\t\tpush(secondTopMostValue);\n\t\t}\n\t}", "private void compactVertically (List<List<NodeRealizer>> cellColumns)\n {\n for (List<NodeRealizer> cellColumn : cellColumns)\n {\n int centerIndex = (cellColumn.size () - 1) / 2;\n NodeRealizer centerRealizer = cellColumn.get (centerIndex);\n double minY = centerRealizer.getY () - GAP;\n double maxY = centerRealizer.getY () + centerRealizer.getHeight () + GAP;\n for (int i = 1; i <= centerIndex; i++)\n {\n NodeRealizer topRealizer = cellColumn.get (centerIndex - i);\n topRealizer.setY (minY - topRealizer.getHeight ());\n minY -= topRealizer.getHeight () + GAP;\n NodeRealizer bottomRealizer = cellColumn.get (centerIndex + i);\n bottomRealizer.setY (maxY);\n maxY += bottomRealizer.getHeight () + GAP;\n }\n if (cellColumn.size () % 2 == 0)\n {\n NodeRealizer bottomRealizer = cellColumn.get (cellColumn.size () - 1);\n bottomRealizer.setY (maxY);\n }\n }\n }", "public void swapButtons(int i1, int j1, int i2, int j2) {\n\n\t// Swap locations of two elements in the state array.\n int temp = stateArray[i1][j1];\n stateArray[i1][j1] = stateArray[i2][j2];\n stateArray[i2][j2] = temp;\n\n // Update state if there is collapsed row or column after swapping.\n if(!isGoodState()) {\n updateState();\n\n // Else - swap back the positions of the elements.\n }else {\n \ttemp = stateArray[i2][j2];\n \tstateArray[i2][j2] = stateArray[i1][j1];\n stateArray[i1][j1] = temp;\n }\n }", "public void flipH() {\r\n int tmp, sym;\r\n for (int row = 0; row < pixels.length; ++row) {\r\n for (int col = 0; col < pixels[row].length / 2; ++col) {\r\n // find the column index of the horizontally symmetric pixel\r\n sym = pixels[row].length - 1 - col;\r\n // swap the pixel value between the two\r\n tmp = pixels[row][col];\r\n pixels[row][col] = pixels[row][sym];\r\n pixels[row][sym] = tmp;\r\n }\r\n }\r\n this.pix2img();\r\n }", "public static void flipHorizontalAxis(int[][] matrix){\n\n int beginIndex = 0;\n int endIndex = (matrix.length - 1);\n int[] begin = matrix[beginIndex];\n int[] end = matrix[endIndex];\n int[] temp;\n\n\n while(endIndex > beginIndex){\n //swap the arrays with a temp variable\n temp = Arrays.copyOf(begin, begin.length);\n begin = Arrays.copyOf(end, end.length);\n end = Arrays.copyOf(temp, temp.length);\n\n //update the new arrays in the matrix\n matrix[beginIndex] = begin;\n matrix[endIndex] = end;\n\n //update the new indexes\n beginIndex++;\n endIndex--;\n\n //move begin and end to the next set to be swapped\n begin = matrix[beginIndex];\n end = matrix[endIndex];\n }\n\n }", "private void rotateColumn(Integer column) {\n \t\t\n \t\tArrayList<Block> blocks = game.getSlot().getBlocks();\n \t\t\n \t\tArrayList<String> last = new ArrayList<String>();\n \t\tlast.add(blocks.get(column+6).getTypeId() + \":\" + blocks.get(column+6).getData());\n \t\tlast.add(blocks.get(column+3).getTypeId() + \":\" + blocks.get(column+3).getData());\n \t\t\n \t\t//Get the id and split it\n \t\tint s1 = 1;\n \t\tbyte s2 = 0;\n \t\tString id = getNext();\n \t\t\n \t\t// Prevent silly-looking duplicate blocks\n \t\twhile(id.equalsIgnoreCase(last.get(0))) {\n \t\t\tid = getNext();\n \t\t}\n \t\t\n \t\t//Since the id is not the same (see above) we can go ahead and split it up\n \t\tString[] mSplit = id.split(\"\\\\:\");\n \t\t\tif (mSplit.length == 2) {\n \t\t\t\ts1 = Integer.parseInt(mSplit[0]);\n \t\t\t\ts2 = Byte.parseByte(mSplit[1]);\n \t\t\t}else {\n \t\t\t\ts1 = Integer.parseInt(mSplit[0]);\n \t\t\t}\n \t\t\n \t\t// First column\n \t\tblocks.get(column+6).setTypeIdAndData(s1, s2, false);\n \t\t\n \t\t// Second Column\n \t\tint c2ID = 1;\n \t\tbyte c2Byte = 0;\n \t\tString[] column2 = last.get(0).split(\"\\\\:\");\n \t\t\tif (column2.length == 2) {\n \t\t\t\tc2ID = Integer.parseInt(column2[0]);\n \t\t\t\tc2Byte = Byte.parseByte(column2[1]);\n \t\t\t}else {\n \t\t\t\tc2ID = Integer.parseInt(column2[0]);\n \t\t\t}\n \t\tblocks.get(column+3).setTypeIdAndData(c2ID, c2Byte, false);\n \t\t\n \t\t// Third Column\n \t\tint c3ID = 1;\n \t\tbyte c3Byte = 0;\n \t\tString[] column3 = last.get(1).split(\"\\\\:\");\n \t\t\tif (column3.length == 2) {\n \t\t\t\tc3ID = Integer.parseInt(column3[0]);\n \t\t\t\tc3Byte = Byte.parseByte(column3[1]);\n \t\t\t}else {\n \t\t\t\tc3ID = Integer.parseInt(column3[0]);\n \t\t\t}\n \t\tblocks.get(column).setTypeIdAndData(c3ID, c3Byte, false);\n \t\t\n \t}", "public org.apache.spark.mllib.linalg.distributed.BlockMatrix transpose () { throw new RuntimeException(); }", "private void swap(int i, int j) {\n\t\tint tmp = data.get(i);\n\t\tdata.set(i, data.get(j));\n\t\tdata.set(j, tmp);\n\t}", "public void switchSides() {\n\t\tint temp = 0;\r\n\t\ttemp = leftValue;\r\n\t\tleftValue = rightValue;\r\n\t\trightValue = temp;\r\n\t}", "private static String[] flipGridVertical(String[] grid) {\n\t\tString[] tmp = new String[grid.length];\n\t\tfor(int row = 0; row < grid.length; row++) {\n\t\t\ttmp[grid.length - (row+1)] = grid[row];\n\t\t}\n\t\treturn tmp;\n\t}", "private void swap(int one, int two)\r\n {\r\n//*** one->two\r\n long temp = a[two];\r\n a[one] = a[two];\r\n a[two] = temp;\r\n }", "public static void rowSwap(float[][] matrix, int row1, int row2, int dimension){\n\t\tfloat temp;\n\t\tfor (int i = 0; i <= dimension; i++){\n\t\t temp = matrix[row1][i];\n\t\t matrix[row1][i] = matrix[row2][i];\n\t\t matrix[row2][i] = temp;}\n\t}", "@Override\n\tpublic void swap(int pos1, int pos2) {\n\t}", "public void doStep() {\n\t\ttry {\n\t\t\tLifeMatrix newMatrix = new LifeMatrix(_numRows, _numColumns);\n\t\t\tfor (int row=0; row<_numRows; ++row) {\n\t\t\t\tfor (int column=0; column<_numColumns; ++column) {\n\t\t\t\t\tupdateCell(_matrix, newMatrix, row, column);\n\t\t\t\t}\n\t\t\t}\n\t\t\t_matrix = newMatrix; // update to the new matrix (the old one is discarded)\n\t\t} catch (Exception e) {\n\t\t\t// This is not supposed to happend because we use only legal row and column numbers\n\t\t\tSystem.out.println(\"Unexpected Error in doStep()\");\n\t\t}\n\t}", "private static <T> void vecswap(short x[], T[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a2, a, b);\n\t}", "private static void doCase4(final double[] s, final int k, final NegateColumn q2NegCol, final ExchangeColumns q1XchgCols,\n final ExchangeColumns q2XchgCols) {\n if (s[k] <= ZERO) {\n s[k] = s[k] < ZERO ? -s[k] : ZERO;\n q2NegCol.negateColumn(k);\n }\n\n final int size = s.length;\n double tmp;\n\n // Order the singular values.\n for (int iter = k, next = iter + 1; next < size && s[iter] < s[next]; iter++, next++) {\n\n tmp = s[iter];\n s[iter] = s[next];\n s[next] = tmp;\n\n q1XchgCols.exchangeColumns(iter, next);\n q2XchgCols.exchangeColumns(iter, next);\n }\n }", "void incrementColumnIndex();", "void incrementColumnIndex();", "public static void swapPosts(int[][] view, int i, int j) {\n int[] temp = view[i];\n view[i] = view[j];\n view[j] = temp;\n }", "private void swapTwoTroopPositions(int row1, int col1, int row2, int col2) {\n BaseSingle temp = aliveTroopsFormation[row1][col1];\n aliveTroopsFormation[row1][col1] = aliveTroopsFormation[row2][col2];\n aliveTroopsFormation[row2][col2] = temp;\n if (aliveTroopsFormation[row1][col1] != null) {\n aliveTroopsMap.put(aliveTroopsFormation[row1][col1], row1 * width + col1);\n }\n if (aliveTroopsFormation[row2][col2] != null) {\n aliveTroopsMap.put(aliveTroopsFormation[row2][col2], row2 * width + col2);\n }\n }", "private static void swap(int[] nums, int i, int j) {\n nums[i] += nums[j];\n nums[j] = nums[i] - nums[j];\n nums[i] = nums[i] - nums[j];\n }", "private void compactHorizontally (List<List<NodeRealizer>> cellColumns)\n {\n int centerIndex = (cellColumns.size () - 1) / 2;\n List<NodeRealizer> minXList = cellColumns.get (centerIndex);\n List<NodeRealizer> maxXList = cellColumns.get (centerIndex);\n for (int i = 1; i <= centerIndex; i++)\n {\n List<NodeRealizer> leftList = cellColumns.get (centerIndex - i);\n moveToRight (leftList, minXList);\n minXList = leftList;\n List<NodeRealizer> rightList = cellColumns.get (centerIndex + i);\n moveToLeft (rightList, maxXList);\n maxXList = rightList;\n }\n if (cellColumns.size () % 2 == 0)\n {\n List<NodeRealizer> rightList = cellColumns.get (cellColumns.size () - 1);\n moveToLeft (rightList, maxXList);\n }\n }", "public void movB(){\r\n\t\tint aux1[][]= new int [3][1];\r\n\t\tint aux2[][]= new int [3][1];\r\n\t\tint aux3[][]= new int [3][1];\r\n\t\tint aux4[][]= new int [3][1];\r\n\t\t\r\n\t\taux1=this.cloneF(5, 2);//copiamos el del bloque 5 la fila 3\r\n\t\taux2=this.cloneC(2, 2);\r\n\t\taux3=this.cloneF(4, 0);\r\n\t\taux4=this.cloneC(0, 0);\r\n\t\t\r\n\t\tthis.copiaEnFilaUnaColumna(aux4, 5, 2);\r\n\t\tthis.copiaEnColumnaUnaFila(aux1, 2, 2);\r\n\t\tthis.copiaEnFilaUnaColumna(aux2, 4, 0);\r\n\t\tthis.copiaEnColumnaUnaFila(aux3, 0, 0);\r\n\t\t\r\n\t\t\r\n\t}", "public void swap(int index1, int index2) {\n \n }", "private static <T> void swap(int x[], double[] a2, int a, int b) {\n\t\tint t = x[a];\n\t\tx[a] = x[b];\n\t\tx[b] = t;\n\t\tdouble t2 = a2[a];\n\t\ta2[a] = a2[b];\n\t\ta2[b] = t2;\n\t}", "public void moveLeft()\n\t{\n\t\tcol--;\n\t}" ]
[ "0.66304976", "0.6243721", "0.6229078", "0.59938097", "0.5908347", "0.58548623", "0.58172214", "0.5748496", "0.5659411", "0.5575218", "0.55705374", "0.5568521", "0.55454326", "0.5506562", "0.54743636", "0.5472506", "0.5470831", "0.54361016", "0.54026335", "0.53936434", "0.5389829", "0.5376109", "0.5367157", "0.5365437", "0.5358662", "0.53240526", "0.53177655", "0.52994764", "0.5274448", "0.5272757", "0.52715373", "0.5265898", "0.52411646", "0.52364916", "0.5236036", "0.5211516", "0.51873803", "0.51856196", "0.5178893", "0.516727", "0.51665777", "0.51588494", "0.51555854", "0.5153744", "0.5151159", "0.51484674", "0.5138346", "0.5128517", "0.5127915", "0.5117698", "0.51115125", "0.51064575", "0.5087423", "0.5084006", "0.5079577", "0.5071343", "0.50705665", "0.5065736", "0.5041388", "0.5036102", "0.5035091", "0.5025676", "0.5018292", "0.50066113", "0.5003809", "0.5000961", "0.49958405", "0.499554", "0.49939466", "0.49933687", "0.49887967", "0.49885455", "0.49872702", "0.49734333", "0.49721897", "0.49699545", "0.49658528", "0.49530807", "0.49481148", "0.49377024", "0.49376702", "0.49322265", "0.49232963", "0.4919414", "0.49169865", "0.49026015", "0.48888797", "0.48866633", "0.48855457", "0.48840934", "0.48778826", "0.48704714", "0.48704714", "0.4863317", "0.48627546", "0.48593524", "0.48562917", "0.48457336", "0.48444667", "0.4835408", "0.48350835" ]
0.0
-1
/ When sorting all characters we should obtain the same sequence for both strings. Additionally, if length is different they can't be permutations of each other.
boolean isPermutationSorting(String s1, String s2) { if(s1.length() != s2.length()) return false; char[] s1Arr = s1.toCharArray(); char[] s2Arr = s2.toCharArray(); java.util.Arrays.sort(s1Arr); java.util.Arrays.sort(s2Arr); String newS1 = new String(s1Arr); String newS2 = new String(s2Arr); if(newS1.equals(newS2)) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static boolean checkPermutationSorting(String s1, String s2) {\n // Strings are of unequal length. Cannot be permutations.\n if (s1.length() != s2.length()) {\n return false;\n }\n\n // Since strings are immutable, we wrote a simple sort function that returns the sorted string.\n String sortedS1 = sort(s1);\n String sortedS2 = sort(s2);\n\n return sortedS1.equals(sortedS2);\n }", "public static boolean checkPermutaionSort(String s1, String s2) {\n if (s1.length() != s2.length()) return false;\n\n char c1[] = s1.toCharArray();\n char c2[] = s2.toCharArray();\n Arrays.sort(c1);\n Arrays.sort(c2);\n for (int i = 0; i < s1.length(); ++i) {\n if (c1[i] != c2[i]) return false;\n }\n\n return true;\n }", "public static void main(String[] args) {\n\n\t\tString a = \"aabbbc\", b =\"cbad\";\n\t\t// a=abc\t\t\t\tb=cab\n\t\t\n\t\t\n\t\tString a1 =\"\" , b1 = \"\"; // to store all the non duplicated values from a\n\t\t\n\t\tfor(int i=0; i<a.length();i++) {\n\t\t\tif(!a1.contains(a.substring(i,i+1)))\n\t\t\t\ta1 += a.substring(i,i+1);\n\t\t}\n\t\t\n\t\tfor(int i=0; i<b.length();i++) {\n\t\t\tif(!b1.contains(b.substring(i,i+1)))\n\t\t\t\tb1 += b.substring(i,i+1);\n\t\t}\n\t\t\t\t\n\t\tchar[] ch1 = a1.toCharArray();\n\t\tSystem.out.println(Arrays.toString(ch1));\n\t\t\n\t\tchar[] ch2 = b1.toCharArray();\n\t\tSystem.out.println(Arrays.toString(ch2));\n\t\t\n\t\tArrays.sort(ch1);\n\t\tArrays.sort(ch2);\n\t\t\n\t\tSystem.out.println(\"=====================================================\");\n\t\t\n\t\tSystem.out.println(Arrays.toString(ch1));\n\t\tSystem.out.println(Arrays.toString(ch2));\n\t\t\n\t\tString str1 = Arrays.toString(ch1);\n\t\tString str2 = Arrays.toString(ch2);\n\t\t\n\t\tif(str1.contentEquals(str2)) {\n\t\t\tSystem.out.println(\"true, they build out of same letters\");\n\t\t}else { \n\t\t\tSystem.out.println(\"fasle, there is something different\");\n\t\t}\n\t\t\n\n\t\t\n\t\t// SHORTER SOLUTION !!!!!!!!!!!!!!!!!!!!\n\t\t\n//\t\tString Str1 = \"aaaabbbcc\", Str2 = \"cccaabbb\";\n//\t\t\n//\t\tStr1 = new TreeSet<String>( Arrays.asList(Str1.split(\"\"))).toString();\n//\t\tStr2 = new TreeSet<String>( Arrays.asList(Str2.split(\"\"))).toString();\n//\t\tSystem.out.println(Str1.equals(Str2));\n//\t\t\n//\t\t\n\t\t\n}", "public boolean isPermutationSorted(String str1, String str2) {\n\n\t\tif (str1.length() != str2.length()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tchar[] str1Chars = str1.toCharArray();\n\t\tchar[] str2Chars = str2.toCharArray();\n\n\t\tArrays.sort(str1Chars);\n\t\tArrays.sort(str2Chars);\n\t\tif (String.valueOf(str1Chars).equals(String.valueOf(str2Chars)))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn true;\n\t}", "public static void isPermutation(String s1, String s2){\r\n\t\t\t\r\n\t\t\t// Can also do by sorting both string and comparing each character by character\r\n\t\t\t\r\n\t\t\tboolean flag = true;\r\n\t\t\t\r\n\t\t\tArrayList hm = new ArrayList();\r\n\t\t\t\r\n\t\t\tfor(int i = 0 ; i < s1.length(); i++){\r\n\t\t\t\t\r\n\t\t\t\t\thm.add(s1.charAt(i));\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tfor(int i = 0 ; i < s2.length(); i++){\r\n\t\t\t\tif(hm.contains(s2.charAt(i))){\r\n\t\t\t\t\thm.remove((Character)s2.charAt(i));\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tSystem.out.println(\"Not A permutation\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n//\t\t\tHashMap hm = new HashMap();\r\n//\t\t\t\r\n//\t\t\tfor(int i = 0 ; i < s1.length(); i++){\r\n//\t\t\t\tif(hm.containsKey(s1.charAt(i))){\r\n//\t\t\t\t\thm.put(s1.charAt(i),hm.get(s1.charAt(i) + 1 ));\r\n//\t\t\t\t}\r\n//\t\t\t\telse{\r\n//\t\t\t\t\thm.put(s1.charAt(i), 1);\r\n//\t\t\t\t}\r\n//\t\t\t}\r\n//\t\t\tfor(int i = 0 ; i < s2.length(); i++){\r\n//\t\t\t\tif(hm.containsKey(s2.charAt(i))){\r\n//\t\t\t\t\thm.put(s2.charAt(i),hm.get(s2.charAt(i) - 1 ));\r\n//\t\t\t\t}\r\n//\t\t\t\telse{\r\n//\t\t\t\t\tflag = false;\r\n//\t\t\t\t}\r\n//\t\t\t}\r\n\t\t\t\r\n\t\t\tif (hm.size()==0)\r\n\t\t\t\tSystem.out.println(\"Permutations\");\r\n\t\t\telse\r\n\t\t\t\tSystem.out.println(\"Not Permutations\");\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// Checking by creating ascii character array\r\n\t\t\tif (s1.length() != s2.length()) {\r\n\t\t\t\tSystem.out.println(\"Second Solution Not Permutation\");\r\n\t\t\t\t}\r\n\t\t\t\tint[] letters = new int[256]; // Assumption\r\n\t\t\t\t\tchar[] s_array = s1.toCharArray();\r\n\t\t\t\tfor (char c : s_array) { // count number of each char in s.\r\n\t\t\t\t letters[c]++;\r\n\t\t\t\t }\r\n\t\t\t\t\r\n\t\t\t\t for (int i = 0; i < s2.length(); i++) {\r\n\t\t\t\t int c = (int) s2.charAt(i);\r\n\t\t\t\t if (--letters[c] < 0) {\r\n\t\t\t\t System.out.println(\" Second Solution Not Permutation\");\r\n\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\t \r\n\t\t\t\t \r\n\t\t\t\r\n\t\t}", "private static boolean permutation(String string, String string2) {\n\t\tif (string.length() != string2.length()) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn sort(string).equals(sort(string2));\r\n\t}", "public static boolean checkPermutation(String input1, String input2) {\n\n\t\tchar[] inputArray1 = input1.toCharArray();\n\t\tchar[] inputArray2 = input2.toCharArray();\n\n\t\tArrays.sort(inputArray1);\n\t\tArrays.sort(inputArray2);\n\n\t\tSystem.out.println(inputArray1);\n\t\tSystem.out.println(inputArray2);\n\n\t\treturn new String(inputArray1).equals(new String(inputArray2));\n\t}", "public static void main(String[] args) {\n\t\n\tString a = \"aabbbc\", b= \"cabbbac\";\n\t// a = abc, b=cab\n\t//we will remove all dublicated values from \"a\"\n\tString a1 = \"\"; //store all the non duplicated values from \"a\"\n\t\n\tfor (int j=0; j<a.length();j++) //this method is with nested loop\n\tfor (int i=0; i<a.length();i++) {\n\t\tif (!a1.contains(a.substring(j, j+1))) {\n\t\t\ta1 += a.substring(j, j+1);\n\t\t}\n\t\t\t\n\t}\n\tSystem.out.println(a1);\n\t//we will remove all duplicated values from \"b\"\n\tString b1 = \"\"; //store all the non duplicated values from \"b\"\n\tfor(int i=0; i<b.length();i++) { //this is with simple loop\n\t\tif(!b1.contains(b.substring(i, i+1))) {\n\t\t\t // \"\"+b.charAt(i)\n\t\t\tb1 += b.substring(i, i+1);\n\t\t\t// \"\"+b.charAt(i);\n\t\t}\n\t}\n\tSystem.out.println(b1);\n\t\n\t\n\t//a1 = \"acb\", b1 = \"cab\"\n\tchar[] ch1 = a1.toCharArray();\n\tSystem.out.println(Arrays.toString(ch1));\n\t\n\tchar[] ch2 = b1.toCharArray();\n\tSystem.out.println(Arrays.toString(ch2));\n\t\n\tArrays.sort(ch1);\n\tArrays.sort(ch2);\n\t\n\tSystem.out.println(\"========================\");\n\tSystem.out.println(Arrays.toString(ch1));\n\tSystem.out.println(Arrays.toString(ch2));\n\t\n\t\n\tString str1 = Arrays.toString(ch1);\n\tString str2 = Arrays.toString(ch2);\n\t\n\tif(str1.equals(str2)) {\n\t\tSystem.out.println(\"true, they are same letters\");\n\t}else {\n\t\tSystem.out.println(\"false, they are contain different letters\");\n\t}\n\t\n\t\n\t// solution 2:\n\t\t\t String Str1 = \"cccccaaaabbbbccc\" , Str2 = \"cccaaabbb\";\n\t\t\t \n\t\t\t Str1 = new TreeSet<String>( Arrays.asList( Str1.split(\"\"))).toString();\n\t\t\t Str2 = new TreeSet<String>( Arrays.asList( Str2.split(\"\"))).toString();\n\t\t\t \n\t\t\t System.out.println(Str1.equals(Str2));\n\t\t\t\t \n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n}", "static boolean isPermutation_1(String a, String b){\n //get the sorted format of a string\n String sorted_A = sortString(a);\n String sorted_B = sortString(b);\n return sorted_A.equals(sorted_B);\n }", "public static boolean checkPermutation(String str1, String str2) {\n if (str1.length() != str2.length()) // imediate check if string is not the same length, obviously false\n return false;\n // null check as well\n int[] arr = new int[256]; // ascii\n for (int i = 0; i < str1.length(); i++) { // for all chars in the first list\n char temp = str1.charAt(i); // get the char at the index\n int index = temp; // get the int val for the char\n arr[index] = arr[index] + 1; // increase an array at that index by 1\n }\n for (int i = 0 ; i < str1.length(); i++) { // for all values in the second string\n char temp = str2.charAt(i); // get the char at the index\n int index = temp; // get the val for that char\n arr[index] = arr[index] - 1; // decrement the array at the index by 1\n if (arr[index] < 0) // if the string has incorrect amount of letters,\n return false; // the array should have -1, which will return false\n }\n return true; // else return true\n }", "public static boolean checkIfPermutations(String str1, String str2) {\n\n if(str1.length() != str2.length())\n return false;\n\n char chars1[] = str1.toCharArray();\n char chars2[] = str2.toCharArray();\n\n Arrays.sort(chars1);\n Arrays.sort(chars2);\n\n for(int i=0; i<str1.length(); i++) {\n if(chars1[i] != chars2[i])\n return false;\n }\n\n return true;\n }", "static String morganAndString(String a, String b) {\n\n\t\tString result = \"\";\n\n\t\tint pointerA = 0, pointerB = 0;\n\n\t\touter:\n\t\t\twhile ( pointerA < a.length() || pointerB < b.length()){\n\t\t\t\tif ( pointerA == a.length()) {\n\t\t\t\t\tresult = result + b.charAt(pointerB++);\n\t\t\t\t}\n\t\t\t\telse if ( pointerB == b.length()) {\n\t\t\t\t\tresult = result + a.charAt(pointerA++);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tchar ca = a.charAt ( pointerA );\n\t\t\t\t\tchar cb = b.charAt ( pointerB );\n\n\t\t\t\t\tif ( ca < cb ) {\n\t\t\t\t\t\tresult = result + ca;\n\t\t\t\t\t\tpointerA++;\n\t\t\t\t\t}\n\t\t\t\t\telse if ( cb < ca ){\n\t\t\t\t\t\tresult = result + cb;\n\t\t\t\t\t\tpointerB++;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// Find the smallest successor.\n\t\t\t\t\t\tint extraPointer = 1;\n\t\t\t\t\t\twhile ( pointerA + extraPointer < a.length() && pointerB + extraPointer < b.length()){\n\t\t\t\t\t\t\tchar cEa = a.charAt ( pointerA + extraPointer);\n\t\t\t\t\t\t\tchar cEb = b.charAt ( pointerB + extraPointer);\n\n\t\t\t\t\t\t\tif ( cEa < cEb ){\n\t\t\t\t\t\t\t\tresult = result + cEa;\n\t\t\t\t\t\t\t\tpointerA++;\n\t\t\t\t\t\t\t\tcontinue outer;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if ( cEb < cEa ){\n\t\t\t\t\t\t\t\tresult = result + cEb;\n\n\n\t\t\t\t\t\t\t\tpointerB++;\n\t\t\t\t\t\t\t\tcontinue outer;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\textraPointer++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// We got to the point in which both are the same.\n\t\t\t\t\t\tif ( pointerA + extraPointer == a.length() && pointerB + extraPointer == b.length()){\n\t\t\t\t\t\t\t// Both are equal. It doesn't matter which one I take it from.\n\t\t\t\t\t\t\tresult = result + ca;\n\t\t\t\t\t\t\tpointerA++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tif ( pointerA + extraPointer == a.length() ){\n\t\t\t\t\t\t\t\t// Compare the current one of B with the next letter.\n\t\t\t\t\t\t\t\t// If next letter is smaller than current one, cut from here.\n\t\t\t\t\t\t\t\t// else, cut from A.\n\t\t\t\t\t\t\t\tif ( b.charAt ( pointerB + extraPointer ) > b.charAt ( pointerB + extraPointer + 1)){\n\t\t\t\t\t\t\t\t\tresult = result + cb;\n\t\t\t\t\t\t\t\t\tpointerB++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tresult = result + ca;\n\t\t\t\t\t\t\t\t\tpointerA++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// The opposite.\n\t\t\t\t\t\t\t\t// Compare the current one of B with the next letter.\n\t\t\t\t\t\t\t\t// If next letter is smaller than current one, cut from here.\n\t\t\t\t\t\t\t\t// else, cut from A.\n\t\t\t\t\t\t\t\tif ( a.charAt ( pointerA + extraPointer ) > a.charAt ( pointerA + extraPointer + 1)){\n\t\t\t\t\t\t\t\t\tresult = result + ca;\n\t\t\t\t\t\t\t\t\tpointerA++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tresult = result + cb;\n\t\t\t\t\t\t\t\t\tpointerB++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\treturn result;\n\n\n\t}", "public boolean permutation(String s1, String s2) {\n if(s1.length()>s2.length()) return false;\n int s1_sum[] = new int[26];\n int s2_sum[] = new int[26];\n // initiate the sliding window\n for(int i =0; i< s1.length(); i++){\n s1_sum[s1.charAt(i)-'a']++;\n s2_sum[s2.charAt(i) - 'a']++;\n }\n int count = 0;\n for(int i = 0; i< 26; i++){\n if(s1_sum[i] == s2_sum[i]){\n count++;\n }\n }\n for(int j = 0; j<s2.length()-s1.length();j++) {\n int left = s2.charAt(j)-'a';\n int right = s2.charAt(j+s1.length()) - 'a';\n if(count == 26) return true;\n\n s2_sum[right]++;\n if(s2_sum[right] == s1_sum[right]){\n count++;\n } else if(s2_sum[right] = s1_sum[right]+1 ) {\n count--;\n }\n s2_sum[left]--;\n if(s2_sum[left]==s1_sum[left]) {\n count++;\n } else if(s2_sum[left] = s1_sum[left]-1){\n count--;\n }\n\n\n\n }\n return count==26;\n }", "public boolean isScramble(String s1, String s2) {\n int lena = s1.length();\n int lenb = s2.length();\n if(lena != lenb) return false;\n if(lena == 0||s1.equals(s2)) return true;\n char[] crr1 = s1.toCharArray();\n char[] crr2 = s2.toCharArray();\n Arrays.sort(crr1);\n Arrays.sort(crr2);\n if(!Arrays.equals(crr1,crr2)) return false;\n \n int i = 1; \n while(i< lena){\n String a1 = s1.substring(0,i);\n String b1 = s1.substring(i);\n String a2 = s2.substring(0,i);\n String b2 = s2.substring(i);\n if(isScramble(a1,a2) && isScramble(b1,b2)) return true;\n String a3 = s2.substring(lenb - i);\n String b3 = s2.substring(0, lenb-i);\n if(isScramble(a1,a3) && isScramble(b1,b3)) return true;\n i++;\n }\n return false;\n }", "public static boolean isPermutation(String str1, String str2)\r\n\t{\r\n\t\t if(str1.length() != str2.length()) return false;\r\n\t\t char[] charset1 = str1.toCharArray();\r\n\t\t char[] charset2 = str2.toCharArray();\r\n\t\t HashMap<Character, Integer> hashmap = new HashMap<Character, Integer>();\r\n\t\t \r\n\t\t for(char c : charset1)\r\n\t\t {\r\n\t\t\t if(!hashmap.containsKey(c)) hashmap.put(c, 1);\r\n\t\t\t else hashmap.put(c, hashmap.get(c) + 1);\r\n\t\t }\r\n\t\t \r\n\t\t for(char c : charset2)\r\n\t\t {\r\n\t\t\t if(!hashmap.containsKey(c) || hashmap.get(c) == 0) return false; \r\n\t\t\t hashmap.put(c, hashmap.get(c) - 1);\r\n\t\t }\r\n\t\t \r\n\t\t return true;\r\n\t}", "public static boolean isStringPermutation(String s1, String s2)\n\t{\n\t\tif(s1.length()==s2.length())\n\t\t{\n\t\t\t//convert string to character array\n\t\t\tchar [] name1 = s1.toCharArray();\n\t\t\tchar [] name2 = s2.toCharArray();\n\t\t\t\n\t\t\t//sort new character arrays from smallest to greatest\n\t\t\tArrays.sort(name1);\n\t\t\tArrays.sort(name2);\n\t\t\t\n\t\t\t//compare if it's the same\n\t\t\tboolean checker = Arrays.equals(name1,name2);\n\t\t\tSystem.out.println(\"Is \" + s2 + \" a permutation of \" + s1 + \"?\");\n\t\t\t\tif (checker)\n\t\t\t\t\t\n\t\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"True\");\n\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"False\");\n\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t}\n\t\t\n\t\t//string lengths are not the same\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"Sorry, Strings are not equal\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}", "private static boolean isPermutation(String str1, String str2) {\r\n if (!validate(str1, str2)) {\r\n return false;\r\n }\r\n if (str1.isEmpty() && str2.isEmpty()) { // simple case\r\n return true; // empty strings are permutation of each other\r\n }\r\n\r\n return fillCounter(str1).equals(fillCounter(str2));\r\n }", "public static void main(String[] args) {\n\tint num=4321;\r\n\tString numString=Integer.toString(num);\r\n\tchar[] toBeSorted=numString.toCharArray();\r\n\tchar[] numArray=numString.toCharArray();\r\n\tint maxIndex=0;\r\n\t//check if the given number has no next permutation\r\n\tboolean nextPermu=false;\r\n\tfor(int i=0;i<numArray.length-1;i++){\r\n\t\tif(numArray[i]<numArray[i+1]){\r\n\t\t\tnextPermu=true;\r\n\t\t}\r\n\t}\r\n\tif(!nextPermu){\r\n\t\tSystem.out.println(\"not next permutation possible\");\r\n\t\treturn;\r\n\t}\r\n\r\n\t\r\n\tfor(int i=0;i<numArray.length;i++){\r\n\t\tif(numArray[i]>numArray[maxIndex]){\r\n\t\t\tmaxIndex=i;\r\n\t\t}\r\n\t}\r\n\tjava.util.Arrays.sort(toBeSorted);\r\n\tif(String.copyValueOf(toBeSorted).equals(numString)){\r\n\t\t//swap last 2 indexes\r\n\t\tchar temp=numArray[numArray.length-1];\r\n\t\tnumArray[numArray.length-1]=numArray[numArray.length-2];\r\n\t\tnumArray[numArray.length-2]=temp;\r\n\t\tSystem.out.println(String.copyValueOf(numArray));\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tjava.util.Arrays.sort(numArray, maxIndex, numArray.length);\r\n\tSystem.out.println(String.copyValueOf(numArray));\r\n\t//swap maxIndex and maxIndex-1;\r\n\tchar temp=numArray[maxIndex];\r\n\tnumArray[maxIndex]=numArray[maxIndex-1];\r\n\tnumArray[maxIndex-1]=temp;\r\n\t}", "public static boolean isPermutation(String sIn1, String sIn2){\n if (sIn1.length()!= sIn2.length()) return false;\n\n char[] string1 = sIn1.toCharArray();\n char[] string2 = sIn2.toCharArray();\n\n Arrays.sort(string1);\n Arrays.sort(string2);\n\n return Arrays.equals(string1, string2);\n\n }", "static int makeAnagram(String a, String b) {\n \n \tchar arr[] = a.toCharArray();\n char brr[] = b.toCharArray();\n Arrays.sort(arr);\n Arrays.sort(brr);\n Map<Character, Integer> aMap = new HashMap<>();\n Map<Character, Integer> bMap = new HashMap<>();\n for(int i =0 ;i <arr.length;i++){\n \tif(!aMap.containsKey(arr[i])){\n \t\taMap.put(arr[i], 1);\n \t}else{\n \t\taMap.put(arr[i], aMap.get(arr[i])+1);\n \t}\n }\n for(int i =0 ;i <brr.length;i++){\n \tif(!bMap.containsKey(brr[i])){\n \t\tbMap.put(brr[i], 1);\n \t}else{\n \t\tbMap.put(brr[i], bMap.get(brr[i])+1);\n \t}\n }\n int removeCharCount = 0;\n \n for(char ch = 'a'; ch<='z';ch++){\n \tif(aMap.containsKey(ch) && bMap.containsKey(ch)){\n \t\tif(aMap.get(ch) > bMap.get(ch)){\n \t\t\tint count = aMap.get(ch) - bMap.get(ch);\n \t\t\tremoveCharCount+=count;\n \t\t\taMap.put(ch, aMap.get(ch) - count);\n \t\t}else if(aMap.get(ch) < bMap.get(ch)){\n \t\t\tint count = bMap.get(ch) - aMap.get(ch);\n \t\t\tremoveCharCount+=count;\n \t\t\taMap.put(ch, bMap.get(ch) - count);\n \t\t}\n \t}else if(aMap.containsKey(ch) && !bMap.containsKey(ch)){\n \t\tint count = aMap.get(ch);\n \t\tremoveCharCount+=count;\n \t\taMap.remove(ch);\n \t}else if(!aMap.containsKey(ch) && bMap.containsKey(ch)){\n \t\tint count = bMap.get(ch);\n \t\tremoveCharCount+=count;\n \t\tbMap.remove(ch);\n \t}\n }\n /* if(removeCharCount == Math.min(arr.length, brr.length)){\n \treturn 0;\n }*/\n return removeCharCount;\n }", "public boolean isIsomorphic(String str1, String str2) {\r\n if(str1.length() != str2.length()) return false;\r\n \r\n int[] arr1 = new int[256];\r\n int[] arr2 = new int[256];\r\n \r\n Arrays.fill(arr1, -1);\r\n Arrays.fill(arr2, -1);\r\n \r\n for(int i=0;i<str1.length();i++){\r\n int value1 = str1.charAt(i);\r\n int value2 = str2.charAt(i);\r\n if(arr1[value1]== -1){\r\n arr1[value1] = value2;\r\n } else {\r\n if(arr1[value1] != value2) return false;\r\n }\r\n \r\n if(arr2[value2]== -1){\r\n arr2[value2] = value1;\r\n } else {\r\n if(arr2[value2] != value1) return false;\r\n }\r\n \r\n }\r\n return true;\r\n \r\n}", "private boolean isAnagrams(String s1, String s2) {\n char[] ss1 = s1.toCharArray();\n \n char[] ss2 = s2.toCharArray();\n \n Arrays.sort(ss1);\n Arrays.sort(ss2);\n return ss1.equals(ss2);\n\n }", "public static boolean checkPermutation2(String input1, String input2) {\n\n\t\tMap<Character, Integer> charMap = new HashMap<Character, Integer>();\n\n\t\tfor (int i = 0; i < input1.length(); i++) {\n\t\t\tif (charMap.containsKey(input1.charAt(i)))\n\t\t\t\tcharMap.put(input1.charAt(i), charMap.get(input1.charAt(i)) + 1);\n\t\t\telse\n\t\t\t\tcharMap.put(input1.charAt(i), 1);\n\t\t}\n\n\t\tfor (int i = 0; i < input2.length(); i++) {\n\t\t\tif (!charMap.containsKey(input2.charAt(i)) || charMap.get(input2.charAt(i)) <= 0) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\tcharMap.put(input2.charAt(i), charMap.get(input1.charAt(i)) - 1);\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "static int longestSubsequence(String x, String y) {\n char[] strX = x.toCharArray();\n char[] strY = y.toCharArray();\n\n Map<Character, Integer> xMap = new HashMap<>();\n Map<Character, Integer> yMap = new HashMap<>();\n\n for (int i = 0; i < strX.length; i++) {\n char c = strX[i];\n if (xMap.containsKey(c)) {\n xMap.put(c, xMap.get(c) + 1);\n } else {\n xMap.put(c, 1);\n }\n }\n\n for (int i = 0; i < strY.length; i++) {\n char c = strY[i];\n if (yMap.containsKey(c)) {\n yMap.put(c, yMap.get(c) + 1);\n } else {\n yMap.put(c, 1);\n }\n }\n\n System.out.println(xMap);\n System.out.println(yMap);\n\n ArrayList<Character> subsequence = new ArrayList<>();\n\n // first find match subsequence\n for (Character c : yMap.keySet()) {\n if (!xMap.containsKey(c)) {\n continue;\n }\n\n int xCount = xMap.get(c);\n int yCount = yMap.get(c);\n int charCount = xCount < yCount ? xCount : yCount;\n\n for (int i = 0; i < charCount; i++) {\n subsequence.add(c);\n }\n }\n\n System.out.println(\"may be seq\" + subsequence);\n\n int max = 0;\n for (int i = 0; i < subsequence.size(); i++) {\n char c = subsequence.get(i);\n ArrayList<Character> remains = new ArrayList<>(subsequence);\n remains.remove(i);\n StringBuilder curr = new StringBuilder();\n curr.append(c);\n// System.out.println(\"max\" + max);\n int result = findPermutation(y, curr, remains, max);\n if (result > max) {\n max = result;\n }\n }\n\n // find matching permutation\n\n System.out.println(\"result\" + max);\n // then find sub string\n return max;\n }", "public static void main(String[] args) {\n String str1 = \"listen\";\n String str2 = \"silent\";\n for (int i = 0; i < str1.length(); i++) {\n str2 = str2.replaceFirst(\"\" + str1.charAt(i), \"\");\n }\n System.out.println(str2.isEmpty() ? \"Anagram\" : \"NOT Anagram\");\n\n/*\n //Approach Two:\n String str1 = \"listen\";\n String str2 = \"silent\";\n String str11 = \"\";\n String str22 = \"\";\n char[] ch1 = str1.toCharArray();\n char[] ch2 = str2.toCharArray();\n Arrays.sort(ch1);\n Arrays.sort(ch2);\n for (char each:ch1) {\n str11+=each;\n }\n for (char each:ch2) {\n str22+=each;\n }\n System.out.println(str11.equalsTo(str22)? \"Anagram\" : \"NOT Anagram\");\n\n */\n/*\n\n //Approach Three:\n public static boolean Same(String str12, String str2) {\n str1 = new TreeSet<String>(Arrays.asList( str1.split(\"\") ) ).toString( );\n str2 = new TreeSet<String>(Arrays.asList( str2.split(\"\") ) ).toString( );\n return str1.equals(str2); }\n*/\n }", "static String reverseShuffleMerge(String s) {\r\n resultString = new char[s.length()/2];\r\n inputString = s;\r\n \r\n for (int i = 0; i < s.length(); i++) {\r\n charCounts.put(s.charAt(i), charCounts.getOrDefault(s.charAt(i),0)+1);\r\n initialCharCounts.put(s.charAt(i), initialCharCounts.getOrDefault(s.charAt(i),0)+1);\r\n }\r\n \r\n for (int i = s.length()-1; i >= 0; i--) {\r\n if(resultStringIndex >= s.length()/2) {\r\n break;\r\n }\r\n \r\n if(minCharacter > s.charAt(i) && usedCharCounts.getOrDefault(s.charAt(i),0) < initialCharCounts.get(s.charAt(i))/2) {\r\n minCharacter = s.charAt(i);\r\n }\r\n \r\n if(initialCharCounts.get(s.charAt(i))/2 < charCounts.get(s.charAt(i)) + usedCharCounts.getOrDefault(s.charAt(i), 0) ) {\r\n possibleCharsList.add(s.charAt(i));\r\n }\r\n else {\r\n if(minCharacter >= s.charAt(i)) {\r\n addResultString(s.charAt(i));\r\n if(resultStringIndex >= s.length()/2) {\r\n break;\r\n }\r\n else {\r\n if(minCharacter != Character.MAX_VALUE && minCharacter != s.charAt(i)) {\r\n addResultString(minCharacter);\r\n }\r\n }\r\n }\r\n else {\r\n if(possibleCharsList.size()>0) {\r\n checkandAddPossibleChars(s,i);\r\n }\r\n \r\n if(resultStringIndex >= s.length()/2) {\r\n break;\r\n }\r\n else {\r\n addResultString(s.charAt(i));\r\n }\r\n }\r\n minCharacter = Character.MAX_VALUE;\r\n possibleCharsList.clear();\r\n }\r\n \r\n charCounts.put(s.charAt(i), charCounts.get(s.charAt(i))-1);\r\n }\r\n \r\n System.out.println(String.valueOf(resultString));\r\n return String.valueOf(resultString);\r\n\r\n\r\n }", "@Override\npublic int compare(String first, String second) {\n\tint ans= Integer.compare(first.length(), second.length());\n\t//\n\t\n\t\n\t\n\t\n\treturn ans;\n\t//\n\t\n\t\n}", "static boolean isPermutation_2(String a, String b){\n boolean isPermutation = true;\n //lets store every char in an array of boolean\n int[] charCount = new int[256];\n for(char c:a.toCharArray()){\n charCount[c]++;\n }\n //now verify the count in another string and subtract the count\n for(char c:b.toCharArray()){\n charCount[c]--;\n }\n //now check if any count is non-zero then the two string have unequal count of that char\n for(int i=0;i<charCount.length;i++)\n if(charCount[i]!=0)\n return false;\n \n return isPermutation;\n }", "boolean checkPermutation(String a, String b) {\r\n\r\n if (a == null || b == null) {\r\n throw new NullPointerException();\r\n }\r\n\r\n if (a.length() != b.length()) {\r\n return false;\r\n }\r\n\r\n Map<Character, Integer> frequencies = getFrequency(a);\r\n\r\n for (int i = 0; i < b.length(); i++) {\r\n char c = b.charAt(i);\r\n\r\n if (frequencies.containsKey(c)) {\r\n int count = frequencies.get(c);\r\n if (count == 0) {\r\n return false;\r\n }\r\n\r\n frequencies.replace(c, count - 1);\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }", "public static boolean checkPermutaionMap(String s1, String s2) {\n if (s1.length() != s2.length()) return false;\n\n int[] charMap = new int[128];\n for (int i = 0; i < s1.length(); ++i) {\n charMap[s1.charAt(i)]++;\n }\n\n for (int i = 0; i < s2.length(); ++i) {\n if (--charMap[s2.charAt(i)] < 0) return false;\n }\n\n return true;\n }", "protected int stringCompare(String s1,String s2)\r\n\t{\r\n\t\tint shortLength=Math.min(s1.length(), s2.length());\r\n\t\tfor(int i=0;i<shortLength;i++)\r\n\t\t{\r\n\t\t\tif(s1.charAt(i)<s2.charAt(i))\r\n\t\t\t\treturn 0;\r\n\t\t\telse if(s1.charAt(i)>s2.charAt(i))\r\n\t\t\t\treturn 1;\t\r\n\t\t}\r\n\t\t//if the first shrotLenghtTH characters of s1 and s2 are same \r\n\t\tif(s1.length()<=s2.length()) //it's a close situation. \r\n\t\t\treturn 0;\r\n\t\telse \r\n\t\t\treturn 1; \r\n\t\t\r\n\t}", "public static boolean isPermutation(String s1, String s2) {\n if (s1 == null || s2 == null) {\n return false;\n }\n\n if (s1.length() != s2.length()) {\n return false;\n }\n\n int[] charCounterArr = new int[256];\n\n char[] s1CharArr = s1.toCharArray();\n char[] s2CharArr = s2.toCharArray();\n\n // counting the characters in s1;\n for (int i = 0; i < s1CharArr.length; i++) {\n int index = s1CharArr[i];\n charCounterArr[index] = charCounterArr[index] + 1;\n }\n\n // now check whether characters in s2 are in s1\n // pay attention to characters that appear more than once\n for (int i = 0; i < s2CharArr.length; i++) {\n int index = s2CharArr[i];\n // expecting the value to be 1 or more.\n // if see 0, means that there was a mismatch\n int value = charCounterArr[index];\n if (value == 0) {\n return false;\n }\n value--;\n // now update the value\n charCounterArr[index] = value;\n }\n return true;\n\n }", "public static void main(String[] args) {\n\t\tString string1 = \"acbdfbdfacb\";\n\t\tint length = string1.length();\n\t\tString[] sub = new String[length*(length+1)/2];\n\t\tint temp = 0;\n\t\tfor(int i =0;i<length;i++) {\n\t\t\tfor(int j = i;j<length;j++) {\n\t\t\t\tString parts = string1.substring(i,j+1);\n\t\t\t\tsub[temp] = parts;\n\t\t\t\ttemp++;\n\t\t\t}\n\t\t}\n\t\tfor(int j =0;j<sub.length;j++) {\n\t\t\tSystem.out.println(sub[j]);\n\t\t}\n\t\tArrayList<String> rep = new ArrayList<String>();\n\t\tfor(int i=0;i<sub.length;i++) {\n\t\t\tfor(int j =i+1;j<sub.length;j++) {\n\t\t\t\tif(sub[i].equals(sub[j])) {\n\t\t\t\t\trep.add(sub[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint largestString = 0;\n\t\tSystem.out.println(rep);\n\t\tfor(int k =0;k<rep.size();k++) {\n\t\t\tif(rep.get(k).length()>largestString) {\n\t\t\t\tlargestString = rep.get(k).length();\n\t\t\t}\t\t\n\t\t}\n\t\tfor(int k =0;k<rep.size();k++) {\n\t\tif(rep.get(k).length()==largestString) {\n\t\t\tSystem.out.println(\"the longest repeating sequence in a string : \"+rep.get(k));\n\t\t}\n\t\t}\n\t}", "public static boolean isAnagram(char[]s1, char[]s2)\r\n{\n\t if(s1.length!=s2.length)\r\n\t\t return false; \r\n\t \r\n\t //sort both strings using Arrays sort method\r\n\t Arrays.sort(s1); \r\n\t Arrays.sort(s2);\r\n\t \r\n\t for(int i=0; i<s1.length;i++)\r\n\t if(s1[i]!=s2[i])\r\n\t\t return false; \r\n\t\r\n\treturn true; \r\n\t \r\n}", "private static boolean checkPermutationCountingArray(String s1, String s2) {\n // Strings are of unequal length. Cannot be permutations.\n if (s1.length() != s2.length()) {\n return false;\n }\n\n int[] characterCount = new int[128];\n for (int i = 0; i < s1.length(); i++) {\n characterCount[s1.charAt(i)]++;\n characterCount[s2.charAt(i)]--;\n }\n for (int i = 0; i < characterCount.length; i++) {\n if (characterCount[i] != 0) return false;\n }\n return true;\n }", "private static int cmp( String str1, String str2 )\n \t\t{\n \t\t\tif ( str1==null && str2==null )\n \t\t\t\treturn 0;\n \t\t\tif ( str1==null )\n \t\t\t\treturn -1;\n \t\t\tif ( str2==null )\n \t\t\t\treturn 1;\n \t\t\t\n \t\t\tint p1 = 0;\n \t\t\tint p2 = 0;\n \t\t\tfor ( ;; ) {\n \t\t\t\tif ( p1>=str1.length() ) {\n \t\t\t\t\tif ( p2>=str2.length() )\n \t\t\t\t\t\treturn 0;\n \t\t\t\t\treturn 1;\n \t\t\t\t}\n \t\t\t\tif ( p2>=str2.length() )\n \t\t\t\t\treturn -1;\n \t\t\t\tchar ch1 = str1.charAt(p1);\n \t\t\t\tchar ch2 = str2.charAt(p2);\n \t\t\t\tif ( ch1>='0' && ch1<='9' && ch2>='0' && ch2<='9' ) {\n \t\t\t\t\tint n1 = 0;\n \t\t\t\t\tint n2 = 0;\n \t\t\t\t\twhile ( ch1>='0' && ch1<='9' ) {\n \t\t\t\t\t\tp1++;\n \t\t\t\t\t\tn1 = n1 * 10 + (ch1-'0');\n \t\t\t\t\t\tif ( p1>=str1.length() )\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\tch1 = str1.charAt(p1);\n \t\t\t\t\t}\n \t\t\t\t\twhile ( ch2>='0' && ch2<='9' ) {\n \t\t\t\t\t\tp2++;\n \t\t\t\t\t\tn2 = n2 * 10 + (ch2-'0');\n \t\t\t\t\t\tif ( p2>=str2.length() )\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\tch2 = str2.charAt(p2);\n \t\t\t\t\t}\n \t\t\t\t\tint c = cmp(n1, n2);\n \t\t\t\t\tif ( c!=0 )\n \t\t\t\t\t\treturn c;\n \t\t\t\t} else {\n \t\t\t\t\tif ( ch1<ch2 )\n \t\t\t\t\t\treturn -1;\n \t\t\t\t\tif ( ch1>ch2 )\n \t\t\t\t\t\treturn 1;\n \t\t\t\t\tp1++;\n \t\t\t\t\tp2++;\n \t\t\t\t}\n \t\t\t}\n \t\t}", "public static boolean isPermuted(String str1, String str2) {\n if (str1.length() != str2.length())\n return false;\n\n Map<Character, Integer> str1CountMap = new HashMap<>();\n for (char c : str1.toCharArray()) {\n str1CountMap.put(c, str1CountMap.getOrDefault(c, 0) + 1);\n }\n\n for (char c : str2.toCharArray()) {\n if (!str1CountMap.containsKey(c) || str1CountMap.get(c) <= 0)\n return false;\n str1CountMap.put(c, str1CountMap.get(c) - 1);\n }\n\n return true;\n }", "static int makingAnagrams(String s1, String s2){\n // Complete this function\n StringBuilder b = new StringBuilder(s2);\n int delCount =0;\n for(int i=0;i<s1.length();i++){\n int index = b.indexOf(String.valueOf(s1.charAt(i)));\n if(index == -1){\n delCount++;\n }else{\n b.deleteCharAt(index);\n } \n }\n return delCount + b.length();\n }", "public static boolean permuteCompare(String strA, String strB) {\n\t\tif(strA == null || strB == null)\n\t\t\treturn false;\n\t\t\n\t\t/*\n\t\t * Step 2: Check if the length of both strings is not equal, then they will not match\n\t\t */\n\t\tif(strA.length() != strB.length()) \n\t\t\treturn false;\n\t\t\n\t\t/*\n\t\t * Step 3: Convert both strings to ArrayList (split method looks like not a elegant way, but works)\n\t\t */\n\t\tList<String> strAList = new ArrayList<String>(Arrays.asList(strA.split(\"\")));\n\t\tList<String> strBList = new ArrayList<String>(Arrays.asList(strB.split(\"\")));\n\t\t\n\t\t/*\n\t\t * Step 4: Sort both ArrayList using Collections\n\t\t */\n\t\tCollections.sort(strAList);\n\t\tCollections.sort(strBList);\n\t\t\n\t\t/*\n\t\t * Step 5: Compare them using equals that will compare size and each element value (Ref: https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#equals-java.lang.Object-)\n\t\t */\n\t\tif(!strAList.equals(strBList))\n\t\t\treturn false;\n\n\t\treturn true;\n\t}", "int stringsConstruction(String a, String b){\n a=\" \"+a+\" \";\n b=\" \"+b+\" \";\n int output = b.split(\"\"+a.charAt(1)).length - 1;\n for(char i = 'a'; i <= 'z'; i++) {\n if (a.split(\"\"+i).length > 1) {\n int tempOut = (b.split(\"\"+i).length - 1) / (a.split(\"\"+i).length - 1);\n if (output > tempOut) {\n output = tempOut;\n }//if (output > tempOut) {\n }//if (a.split(\"\"+i).length > 1) {\n }//for(char i = 'a'; i <= 'z'; i++) {\n return output;\n }", "private static boolean checkPermutationCountingHashMap(String s1, String s2) {\n // Strings are of unequal length. Cannot be permutations.\n if (s1.length() != s2.length()) return false;\n\n // Keep a track of the characters using a HashMap.\n Map<Character, Integer> map = new HashMap<Character, Integer>();\n for (int i = 0; i < s1.length(); i++) {\n // Increment count for characters in s1\n if (map.containsKey(s1.charAt(i))) {\n map.put(s1.charAt(i), map.get(s1.charAt(i)) + 1);\n } else {\n map.put(s1.charAt(i), 1);\n }\n\n // Decrement count for characters in s2\n if (map.containsKey(s2.charAt(i))) {\n map.put(s2.charAt(i), map.get(s2.charAt(i)) - 1);\n } else {\n map.put(s2.charAt(i), -1);\n }\n }\n\n // If there are any characters not present in both, some value would be -1 or 1.\n // This case would imply that the strings are not permutations.\n for (char c : map.keySet()) {\n if (map.get(c) != 0) return false;\n }\n return true;\n }", "public static boolean checkPermutation3 (String input1, String input2) {\n\t\t\n\t\tint[] asciiVal = new int[256];\n\t\t\n\t\tfor (int i = 0; i < input1.length(); i++) {\n\t\t\tasciiVal[(int) input1.charAt(i)] += 1;\n\t\t}\n\t\t\n\t\tfor (int j = 0; j < input2.length(); j++) {\n\t\t\tif (asciiVal[(int) input2.charAt(j)] <= 0) return false;\n\t\t\tasciiVal[(int) input2.charAt(j)] -= 1;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "@Test\n public void testLetterCasePermutation() {\n System.out.println(\"testLetterCasePermutation\");\n LetterCasePermutation instance = new LetterCasePermutation();\n\n List<String> result1 = instance.letterCasePermutation(\"a1b2\");\n List<String> expect1 = ListUtil.buildList(new String[]{\"a1b2\", \"a1B2\", \"A1b2\", \"A1B2\"});\n assertTrue(ListUtil.equalsIgnoreOrder(expect1, result1));\n\n List<String> result2 = instance.letterCasePermutation(\"3z4\");\n List<String> expect2 = ListUtil.buildList(new String[]{\"3z4\", \"3Z4\"});\n assertTrue(ListUtil.equalsIgnoreOrder(expect2, result2));\n\n List<String> result3 = instance.letterCasePermutation(\"12345\");\n List<String> expect3 = ListUtil.buildList(new String[]{\"12345\"});\n assertTrue(ListUtil.equalsIgnoreOrder(expect3, result3));\n }", "public boolean isPermutation(String str1, String str2) {\n\n\t\tif (str1.length() != str2.length()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tboolean isCharacterPresent = false;\n\n\t\tfor (int i = 0; i < str1.length(); i++) {\n\t\t\tfor (int j = 0; j < str2.length(); j++) {\n\t\t\t\tif (str1.charAt(i) == str2.charAt(j)) {\n\t\t\t\t\tisCharacterPresent = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!isCharacterPresent) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tisCharacterPresent = false;\n\t\t}\n\n\t\treturn true;\n\t}", "private static boolean isEnglishAlphabetPermutation(String str1, String str2) {\r\n if (!validate(str1, str2)) {\r\n return false;\r\n }\r\n if (str1.isEmpty() && str2.isEmpty()) { // simple case\r\n return true;\r\n }\r\n str1 = str1.toLowerCase();\r\n str2 = str2.toLowerCase();\r\n\r\n // we can use array instead of hash map\r\n // because we definitely know amount of characters\r\n int[] counter = new int[CHARS_AMOUNT];\r\n int startCode = Character.codePointAt(\"a\", 0);\r\n for (int i = 0; i < str1.length(); i++) {\r\n int idx = str1.codePointAt(i) - startCode;\r\n if (idx < 0 || idx >= CHARS_AMOUNT) {\r\n throw new IllegalArgumentException(\"Unsupported character.\");\r\n }\r\n counter[idx]++;\r\n }\r\n // no need to create another array for checking\r\n for (int i = 0; i < str2.length(); i++) {\r\n int idx = str2.codePointAt(i) - startCode;\r\n if (idx < 0 || idx >= CHARS_AMOUNT) {\r\n throw new IllegalArgumentException(\"Unsupported character.\");\r\n }\r\n int checkValue = --counter[idx];\r\n if (checkValue < 0) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "@Override\n public int compare(String o1, String o2) {\n return Integer.compare(o2.length(), o1.length());\n }", "public static boolean permCheck2(String s1, String s2) {\n if (s1.length() != s2.length()) return false;\n\n int letters[] = new int[256];\n char charArray[] = s1.toCharArray();\n for (char c : charArray) {\n letters[c]++;\n }\n\n for (int i = 0; i < s2.length(); i++) {\n int charVal = (int) s2.charAt(i);\n if (--letters[charVal] < 0) {\n return false;\n }\n }\n\n return true;\n }", "int main() \n{\n string s1,s2;\n cin>>s1>>s2;\n int freq[128]={0},i;\n for(i=0;i<s1.length();i++)\n freq[s1[i]]++;\n for(i=0;i<s2.length();i++)\n freq[s2[i]]--;\n for(i=0;i<128;i++)\n {\n if(freq[i]!=0)\n {\n cout<<\"Not anagrams\";\n return 0;\n }\n }\n cout<<\"Anagram\";\n}", "public boolean checkAnagram(char[] str1, char[] str2)\n {\n// Finding lengths of strings\n int len1 = str1.length;\n int len2 = str2.length;\n// If lengths do not match then they cannot be anagrams\n if (len1 != len2)\n return false;\n// Sort both strings\n Arrays.sort(str1);\n Arrays.sort(str2);\n// Comparing the strings which are sorted earlier\n for (int i = 0; i < len1; i++)\n if (str1[i] != str2[i])\n return false;\n return true;\n }", "private boolean areCorrectlyOrdered( int i0, int i1 )\n {\n int n = commonLength( i0, i1 );\n \tif( text[i0+n] == STOP ){\n \t // The sortest string is first, this is as it should be.\n \t return true;\n \t}\n \tif( text[i1+n] == STOP ){\n \t // The sortest string is last, this is not good.\n \t return false;\n \t}\n \treturn (text[i0+n]<text[i1+n]);\n }", "public static void main(String[] args) {\nScanner sc=new Scanner(System.in);\r\nString s1=sc.nextLine();\r\nString s2=sc.nextLine();\r\ns1=s1.replaceAll(\"\\\\s\",\"\");\r\ns2=s2.replaceAll(\"\\\\s\",\"\");\r\ns1=s1.toLowerCase();\r\ns2=s2.toLowerCase();\r\nchar str1[]=s1.toCharArray();\r\nchar str2[]=s2.toCharArray();\r\nArrays.sort(str1);\r\nArrays.sort(str2);\r\nboolean k=true;\r\nif(s1.length()!=s2.length())\r\n\tk=false;\r\nelse\r\n{\r\nk=Arrays.equals(str1,str2);\t\r\n}\r\nif(k==false)\r\n\tSystem.out.print(\"not annagram\");\r\nelse\r\n\tSystem.out.print(\"annagram\");\r\n\t}", "public boolean checkAnagram(String s1, String s2) {\n if (s1.length() != s2.length()) {\n return false;\n }\n char[] stringArr1 = s1.toCharArray();\n char[] stringArr2 = s2.toCharArray();\n Arrays.sort(stringArr1);\n Arrays.sort(stringArr2);\n\n for (int i = 0; i < stringArr1.length; i++) {\n if (stringArr1[i] != stringArr1[i]) {\n return false;\n }\n }\n return true;\n }", "public static boolean isPermutedWithArray(String str1, String str2) {\n if (str1.length() != str2.length())\n return false;\n int[] counts = new int[128];\n for (char c : str1.toCharArray()) {\n counts[c]++;\n }\n\n for (char c : str2.toCharArray()) {\n if (counts[c] <= 0)\n return false;\n counts[c]--;\n }\n\n return true;\n }", "public boolean isScramble(String s1, String s2) {\n if (s1.equals(s2)) return true;\n\n int[] letters = new int[26];\n for (int i = 0; i < s1.length(); i++) {\n letters[s1.charAt(i) - 'a']++;\n letters[s2.charAt(i) - 'a']--;\n }\n for (int i = 0; i < 26; i++) if (letters[i] != 0) return false;\n\n for (int i = 1; i < s1.length(); i++) {\n if (isScramble(s1.substring(0, i), s2.substring(0, i))\n && isScramble(s1.substring(i), s2.substring(i))) return true;\n if (isScramble(s1.substring(0, i), s2.substring(s2.length() - i))\n && isScramble(s1.substring(i), s2.substring(0, s2.length() - i))) return true;\n }\n return false;\n }", "@Test\r\n public void PermutationTest() {\r\n System.out.println(\"permutation\");\r\n String prefix = \"\";\r\n String in = \"123\";\r\n Input input = new Input(in);\r\n List<String> expResult = Arrays.asList(\"123\",\"132\",\"213\",\"231\",\"312\",\"321\");\r\n List<String> result = instance.permutation(prefix, input);\r\n instance.sort(result);\r\n assertEquals(expResult, result);\r\n }", "private boolean translateWith2ExchangedChars(String input1, String input2) {\n if (StringUtils.isBlank(input1) || StringUtils.isBlank(input2) || input1.length() != input2.length()) {\n return false;\n }\n if (input1.equals(input2)) {\n for (int i = 0; i < input1.length(); i++) {\n char current = input1.charAt(i);\n if (input1.lastIndexOf(current) != i) {\n return true;\n }\n }\n return false;\n } else {\n int first = -1, second = -1;\n for (int i = 0; i < input1.length(); i++) {\n if (input1.charAt(i) != input2.charAt(i)) {\n if (first == -1) {\n first = i;\n } else if (second == -1) {\n second = i;\n } else {\n return false;\n }\n }\n }\n return input1.charAt(first) == input2.charAt(second)\n && input1.charAt(second) == input2.charAt(first);\n }\n }", "public boolean checkPermutaionOfStr(String str1, String str2){\n\tArrayList<Integer> word_cnt1 = new ArrayList<Integer>();\n\tArrayList<Integer> word_cnt2 = new ArrayList<Integer>();\n\t\n\tif(str1.length() != str2.length())\n\t\treturn false;\n\tfor(int i = 0; i< 256; i++){\n\t\tword_cnt1.add(0);\n\t\tword_cnt2.add(0);\n\t}\n\t\n\tfor(int i = 0; i< str1.length(); i++){\n\t\tcntStrChar(str1, word_cnt1, i);\n\t\tcntStrChar(str2, word_cnt2, i);\n\t}\n\t\n\tfor(int i = 0; i< 256; i++){\n\t\tif (word_cnt1.get(i) != word_cnt2.get(i) )\n\t\t\treturn false;\n\t}\n\treturn true;\n}", "public void BruteForceSimilarity(String s1, String s2, int sLength) {\n\n s1_Array = splitStringIntoArray(s1, sLength);\n s2_Array = splitStringIntoArray(s2, sLength);\n\n// for (int i = 0; i < s1_Array.size(); i++) {\n//// System.out.println(s1_Array.get(i));\n// }\n// System.out.println(\"**************************\");\n//\n// for (int i = 0; i < s2_Array.size(); i++) {\n// System.out.println(s2_Array.get(i));\n// }\n\n }", "public boolean Permutation(String A, String B) {\n int[] res = new int[256];\n if(A.length()!=B.length()) return false;\n for(int i=0;i<A.length();i++){\n res[A.charAt(i)]++;\n res[B.charAt(i)]--;\n }\n for(int i=0;i<res.length;i++){\n if(res[i]!=0) return false;\n }\n return true;\n }", "public static boolean isAnagramImperApproach(char[] str1, char[] str2) {\n int n1 = str1.length;\n int n2 = str2.length;\n\n if (n1 != n2) return false;\n\n Arrays.sort(str1);\n Arrays.sort(str2);\n\n for (int i = 0; i < n1; i++) {\n if (str1[i] != str2[i]) {\n return false;\n }\n }\n return true;\n }", "@Override\n public int compare(String left, String right) {\n int result = 0;\n int length = left.length() > right.length()\n ? right.length() : left.length();\n for (int i = 0; i < length; i++) {\n result = Character.compare(left.charAt(i), right.charAt(i));\n if (result != 0) {\n break;\n }\n }\n if (result == 0) {\n result = left.length() - right.length();\n }\n return result;\n\n }", "@Test\r\n public void test8() {\r\n String s1 = \"Abc\";\r\n String s2 = \"abc\";\r\n String s3 = \"Abcd\";\r\n System.out.println(s1.compareTo(s2));\r\n System.out.println(s1.compareTo(s3));\r\n }", "@Override\n\t\tpublic int compare(String string1, String string2) {\n\t\t\treturn string2.length() - string1.length();\n\t\t}", "boolean permutationOpt(String s, String t) {\n if (s.length() != t.length() ) { return false;}\r\n\r\n int[] charCnt = new int[128];\r\n for (int i = 0; i < s.length(); i ++) {\r\n int val = s.charAt(i);\r\n charCnt[val] ++;\r\n }\r\n\r\n for (int i = 0; i < t.length(); i ++) {\r\n int val = t.charAt(i);\r\n charCnt[val] --;\r\n if (charCnt[val] < 0) {\r\n return false;\r\n }\r\n }\r\n\r\n return true; // If the length of two strings are equal, then when there is no negative counts there should not be positive counts either.\r\n }", "static int compare(String a, String b) {\n if (a == null) a = \"\";\n if (b == null) b = \"\";\n\n int i = 0;\n while (i < a.length() && i < b.length()) {\n char x = a.charAt(i), y = b.charAt(i);\n if (x != y) return x - y;\n i++;\n }\n return a.length() - b.length();\n }", "public static boolean anagram() {\n\t\tboolean isAnagram = false;\n\t\tScanner scanner = new Scanner(System.in);\n\n\t\tSystem.out.println(\"enter first string\");\n\t\tString string1 = scanner.nextLine();\n\t\tSystem.out.println(\"enter second string\");\n\t\tString string2 = scanner.nextLine();\n\t\tString space1 = string1.replaceAll(\" \",\"\");\n\t\tString space2 = string2.replaceAll(\" \",\"\");\n\t\tString lower1 = string1.toLowerCase();\n\t\tString lower2 = string2.toLowerCase();\n\t\tchar[] array1 = space1.toCharArray();\n\t\tchar[] array2 = space2.toCharArray();\n\t\t\n\t\t\n\t\tif (array1.length == array2.length) \n\t\t{\n\t\t\tfor (int i = 0; i < array1.length; i++) {\n\t\t\t\tfor (int j = i+1; j < array1.length; j++) {\n\t\t\t\t\tif (array1[i] > array1[j]) {\n\t\t\t\t\t\tchar temp = array1[i];\n\t\t\t\t\t\tarray1[i] = array1[j];\n\t\t\t\t\t\tarray1[j] = temp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < array1.length; i++) {\n\t\t\t\tfor (int j = i+1; j < array1.length; j++) {\n\t\t\t\t\tif (array2[i] > array2[j]) {\n\t\t\t\t\t\tchar temp = array2[i];\n\t\t\t\t\t\tarray2[i] = array2[j];\n\t\t\t\t\t\tarray2[j] = temp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < array1.length; i++) {\n\t\t\t\tfor (int j = i; j <=i; j++) {\n\t\t\t\t\tif (array1[i] == array2[j]) {\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (count == array1.length) {\n\t\t\t\tisAnagram=true;\n\n\t\t\t} \n\t\t\telse {\n\t\t\t\tisAnagram = false;\n\n\t\t\t}\n\t\t} \n\t\telse \n\t\t{\n\t\t\tisAnagram = false;\n\t\t}\n\t\treturn isAnagram;\n\t}", "public boolean isAPermutation(String st1, String st2) {\n\t\tif(st1.length() != st2.length() || st1.length() == 0 || st2.length() == 0) return false;\n\t\t\n\t\tHashMap<Character, Integer> cc1 = charactersCount(st1);\n\t\tHashMap<Character, Integer> cc2 = charactersCount(st2);\n\t\t\n\t\treturn sameCharactersCount(cc1, cc2);\n\t}", "@Override\r\n\t\t\tpublic int compare(String s1, String s2) {\n\t\t\t\treturn (s1.length() - s2.length());\r\n\t\t\t}", "public int minSwaps(String s, int[] L, int[] R) {\n if(s.length() <= 1) {\n return -1;\n }\n\n Arrays.sort(L);\n Arrays.sort(R);\n StringBuilder sb = new StringBuilder(s);\n\n int moves = 0;\n List<String> parts = new ArrayList<String>();\n List<List<Integer>> corrections = new ArrayList<List<Integer>>();\n for(int i = L.length - 1; i >= 0; i--) {\n String curr = s.substring(L[i], R[i] + 1);\n List<Integer> currCorrection = correct(curr);\n if(curr.length() % 2 == 1) {\n return -1;\n }\n if(currCorrection.size() > 0) {\n parts.add(curr);\n corrections.add(currCorrection);\n }\n sb.delete(L[i], R[i] + 1);\n }\n\n List<String> processed = new ArrayList<String>();\n for(int p = parts.size() - 1; p >= 0; p--) {\n List<Integer> currCorrection = corrections.remove(p);\n StringBuilder currPart = new StringBuilder(parts.remove(p));\n for(int c = 0; c < currCorrection.size(); c++) {\n boolean swapped = false;\n char neededChar = currPart.charAt(currCorrection.get(c)) == '(' ? ')' : '(';\n // Check if any of the other corrections in this list are the exact opposite:\n for(int oc = c + 1; oc < currCorrection.size(); oc++) {\n if(currPart.charAt(currCorrection.get(oc)) == neededChar) {\n swapped = true;\n currPart.setCharAt(currCorrection.get(oc), currPart.charAt(currCorrection.get(c)));\n currPart.setCharAt(currCorrection.get(c), neededChar);\n currCorrection.remove(oc);\n moves++;\n break;\n }\n }\n\n if(swapped) continue;\n\n for(int op = p - 1; op >= 0; op--) {\n List<Integer> otherCorrection = corrections.get(op);\n StringBuilder otherPart = new StringBuilder(parts.get(op));\n\n for(int oc = otherCorrection.size() - 1; oc >= 0; oc--) {\n if(otherPart.charAt(otherCorrection.get(oc)) == neededChar) {\n otherPart.setCharAt(otherCorrection.get(oc), currPart.charAt(currCorrection.get(c)));\n currPart.setCharAt(currCorrection.get(c), neededChar);\n otherCorrection.remove(oc);\n moves++;\n swapped = true;\n break;\n }\n }\n\n if(swapped) break;\n }\n\n if(swapped) continue;\n\n for(int baseIdx = 0; baseIdx < sb.length(); baseIdx++) {\n if(sb.charAt(baseIdx) == neededChar) {\n sb.setCharAt(baseIdx, currPart.charAt(currCorrection.get(c)));\n currPart.setCharAt(currCorrection.get(c), neededChar);\n moves++;\n swapped = true;\n break;\n }\n }\n\n if(!swapped) {\n return -1;\n }\n }\n\n processed.add(0, currPart.toString());\n }\n\n return moves;\n }", "private void longestCommonSubsequence(String str1, String str2) {\n\tdp\t= new int[str1.length()+1][str2.length()+1];\t\r\n\tString lcs = \"\";\r\n\tint i=0,j=0;\r\n\tfor(i=0;i<str1.length();i++){\r\n\t\tfor(j=0;j<str2.length();j++){\r\n\t\t\r\n\t\t\tif(str1.charAt(i)==str2.charAt(j)){\r\n\t\t\t\tdp[i+1][j+1] = dp[i][j] + 1; \r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tdp[i+1][j+1] =\r\n Math.max(dp[i+1][j], dp[i][j+1]);\r\n\t\t\t}\r\n\t\t}\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}\r\n\t\tSystem.out.println(dp[dp.length-1][dp[0].length-1]);\r\n\t\t\r\n\t}", "public static List<String> sortDNA(List<String> unsortedSequences) {\n\t\tfor (int i = 0; i < unsortedSequences.size()-1; i++) {\n\t\t\tif (unsortedSequences.get(i).length()>unsortedSequences.get(i+1).length()) {\n\t\t\t\t\n\t\t\t\tString temp = unsortedSequences.get(i);\n\t\t\t\t\n\t\t\t\tunsortedSequences.set(i, unsortedSequences.get(i+1));\n\t\t\t\t\n\t\t\t\tunsortedSequences.set(i+1, temp);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\treturn unsortedSequences;\n\t\t//return 0;\n\t}", "static int makeAnagram(String a, String b) {\r\n int[] charCount = new int[26];\r\n int deletions = 0;\r\n\r\n for(char c : a.toCharArray()) {\r\n charCount[c-'a'] += 1;\r\n }\r\n for(char c : b.toCharArray()) {\r\n charCount[c-'a'] -= 1;\r\n }\r\n for(int count : charCount) {\r\n deletions += Math.abs(count);\r\n }\r\n return deletions;\r\n }", "public static void main(String[] args) {\n\t\t\n\t\tString first = \"first string\";\n\t\tString second = \"second string\";\n\t\tString[] arr = new String[3];\n\t\t\n\t\tComparator<String> comp = new LengthCompare();\n\t\tSystem.out.println(comp.compare(first, second));\n\t\tSystem.out.println(comp.compare(first.toCharArray()[1], second.toCharArray()[1]));\n\t\t\n\t\t\n\t\tarr[0] = \"123\";\n\t\tarr[1] = \"abc444\";\n\t\tarr[2] = \"00\";\n\t}", "public int longestCommonSubsequence(String text1, String text2) {\n int[][] dp = new int[text1.length()][text2.length()];\n\n // init the first column\n for (int i = 0; i < text1.length(); i++) {\n // if they match characters\n if (text1.charAt(i) == text2.charAt(0)) {\n dp[i][0] = 1;\n }\n // check if the the subseq length is larger from the substring at 0...i-1\n if (i > 0 && dp[i - 1][0] > dp[i][0]) {\n dp[i][0] = dp[i - 1][0];\n }\n }\n // init the first row\n for (int i = 0; i < text2.length(); i++) {\n // if they match characters\n if (text1.charAt(0) == text2.charAt(i)) {\n dp[0][i] = 1;\n }\n // check if the the subseq length is larger from the substring at 0...i-1\n if (i > 0 && dp[0][i - 1] > dp[0][i]) {\n dp[0][i] = dp[0][i - 1];\n }\n }\n\n // use the results from the previous DP indexes for the text 1 and 2 subsequences\n // to compare which subsequence we should use\n for (int i = 1; i < dp.length; i++) {\n boolean characterMatch = false;\n for (int j = 1; j < dp[i].length; j++) {\n // leverage the previous result to determine what the\n // starting number will be, since we are using that\n // to enable comparing the characters at i and j and\n // appending that to what the previous longest subsequence\n // was.\n\n if (dp[i - 1][j] > dp[i][j - 1]) {\n dp[i][j] = dp[i - 1][j];\n } else {\n dp[i][j] = dp[i][j - 1];\n // ONLY update the length IF the choice was if the subseq length came from\n // the same index for i, because it \n if (!characterMatch && text1.charAt(i) == text2.charAt(j)) {\n dp[i][j]++;\n characterMatch = true;\n }\n }\n }\n }\n // return the result from dp[text1.length()-1][text2.length()-1]\n // as it holds the longest subseqence\n return dp[text1.length()-1][text2.length()-1];\n }", "@Override\n public int compare(String o1, String o2) {\n return Integer.compare(o1.length(), o2.length());\n }", "public static void main(String[] args) {\n\t\tString s1 = \"java\";\n\t\tString s2 = \"Java\";\n\t\t\n\t\tSystem.out.println(s1.compareTo(s2));\n\t\tSystem.out.println(s2.compareTo(s1));\n\t\t\n\t\tString[] sArr = {\"grape\", \"melon\", \"apple\", \"orange\"};\n\t\tfor (String s : sArr){\n\t\t\tSystem.out.print(s+\"\\t\");\n\t\t}System.out.println();\n\t\t\n\t\tString[] copyArr = new String[sArr.length];\n\t\tSystem.arraycopy(sArr, 0, copyArr, 0, sArr.length);\n\t\t\n\t\tfor(int i=0; i<copyArr.length;i++){\n\t\t\tfor(int j=i+1; j<copyArr.length;j++){\n\t\t\t\tif (copyArr[i].compareTo(copyArr[j])>0) {\n\t\t\t\t\tString tmp = copyArr[i];\n\t\t\t\t\tcopyArr[i] = copyArr[j];\n\t\t\t\t\tcopyArr[j] = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (String s : copyArr){\n\t\t\tSystem.out.print(s+\"\\t\");\n\t\t}System.out.println();\n\t}", "@Override\n\t\tpublic int compare(String string1, String string2) {\n\t\t\treturn string1.length() - string2.length();\n\t\t}", "@Test\n public void subSequencesTest3() {\n String text = \"wnylazlzeqntfpwtsmabjqinaweaocfewgpsrmyluadlybfgaltgljrlzaaxvjehhygggdsrygvnjmpyklvyilykdrphepbfgdspjtaap\"\n + \"sxrpayholutqfxstptffbcrkxvvjhorawfwaejxlgafilmzrywpfxjgaltdhjvjgtyguretajegpyirpxfpagodmzrhstrxjrpirlbfgkhhce\"\n + \"wgpsrvtuvlvepmwkpaeqlstaqolmsvjwnegmzafoslaaohalvwfkttfxdrphepqobqzdqnytagtrhspnmprtfnhmsrmznplrcijrosnrlwgds\"\n + \"bylapqgemyxeaeucgulwbajrkvowsrhxvngtahmaphhcyjrmielvqbbqinawepsxrewgpsrqtfqpveltkfkqiymwtqssqxvchoilmwkpzermw\"\n + \"eokiraluaammkwkownrawpedhcklrthtftfnjmtfbftazsclmtcssrlluwhxahjeagpmgvfpceggluadlybfgaltznlgdwsglfbpqepmsvjha\"\n + \"lwsnnsajlgiafyahezkbilxfthwsflgkiwgfmtrawtfxjbbhhcfsyocirbkhjziixdlpcbcthywwnrxpgvcropzvyvapxdrogcmfebjhhsllu\"\n + \"aqrwilnjolwllzwmncxvgkhrwlwiafajvgzxwnymabjgodfsclwneltrpkecguvlvepmwkponbidnebtcqlyahtckk\";\n\n String[] expected = new String[6];\n expected[0] = \"wlfaafrdarvgypipgaputcjflmftgepfmrrhpvwllnfofdqqtmhnjlyeewvxhceqpgftysopelkrhhjtmlapcagllpasazflfthohdtrrvobliwnhazafeevpnlk\";\n expected[1] = \"nzpbwemllljggylhdaatprhwgzxdttypzxlhslksmeohkronrpmprwlmubovmylispqkmqizouwactmatlhmedagfmlafktgmfhcjlhxoagjullcrfxbslceoeyk\";\n expected[2] = \"yewjewyytzegvkyespyqtkoaarjhyaiarjbcrvptsgsatpbyhrslogaycawnajvnxspfwxlekakwkftzcujgglldbswjybhktxcizpypppchanlxwawjctgpnba\";\n expected[3] = \"lqtqaglbgahdnlkppshffxrefygjgjrghrfeveaavmllthqtstrrsdpxgjsgprqarrvktvmriaopltfsswevgytwpvslaiwirjfricwgzxmhqjzvljnglrumbth\";\n expected[4] = \"ansiopuflahsjvdbjxoxfvajiwavuepospgwtpeqjzavfezapfmcnsqeurrthmbweqeqqcwmrmwerfbcshaflbzsqjnghlswabsbibwvvdfsrowgwvyowpvwict\";\n expected[5] = \"ztmncsagjxyrmyrftrlsbvwxlpljrgxdtikgumqowaawxpdgnnzirbgalkhahibewtlishkwamndtnflrxgpufngehniexfgwbykxcncyrelwlmkigmdnklkdqc\";\n int keyLen = 6;\n String[] owns = this.ic.subSequences(text, keyLen);\n for (int i = 0; i < expected.length; i++) {\n assertEquals(expected[i], owns[i]);\n }\n }", "public static boolean isAnagram1(String s1, String s2) {\r\n int[] arr = new int[256]; //Number of Ascii Values\r\n\r\n for (int i = 0; i < s1.length(); i++) {\r\n arr[s1.charAt(i)]++;\r\n arr[s2.charAt(i)]--;\r\n }\r\n\r\n for (int i = 0; i < arr.length; i++) {\r\n if (arr[i] != 0) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }", "public static void main(String[] args) {\r\n\t\tString s1 = \"ababab\";\r\n\t\tString s2 = \"bababa\";\r\n\t\tif(s1.length()!= s2.length()){\r\n\t\t\tSystem.out.println(\"not a anagram\");\r\n\t\t}else{\r\n\t\t\tchar[] c1 = s1.toCharArray();\r\n\t\t\tchar[] c2 = s2.toCharArray();\r\n\t\t//\tusingHashMap(c1, c2);\r\n\t\t\tusingArrays(c1,c2);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public static int longestCommonSubsequence(String text1, String text2) {\n Map<Character, List<Integer>> characterListMap = new HashMap<>();\n char[] cA = text1.toCharArray();\n for (int i = 0; i < cA.length; i++) {\n if (characterListMap.get(cA[i]) == null) {\n List<Integer> list = new ArrayList<>();\n list.add(i);\n characterListMap.put(cA[i], list);\n } else {\n characterListMap.get(cA[i]).add(i);\n }\n }\n char[] cA2 = text2.toCharArray();\n int i = 0;\n int prevBiggest = 0;\n int previndex = 0;\n int currBiggest = 0;\n while (i < cA2.length && characterListMap.get(cA2[i]) == null) {\n i++;\n }\n if (i < cA2.length && characterListMap.get(cA2[i]) != null) {\n previndex = characterListMap.get(cA2[i]).get(characterListMap.get(cA2[i]).size() - 1);\n i++;\n currBiggest++;\n }\n\n\n for (; i < cA2.length; i++) {\n if (characterListMap.containsKey(cA2[i])) {\n if (characterListMap.get(cA2[i]).get(characterListMap.get(cA2[i]).size() - 1) > previndex) {\n previndex = characterListMap.get(cA2[i]).get(characterListMap.get(cA2[i]).size() - 1);\n currBiggest++;\n } else {\n previndex = characterListMap.get(cA2[i]).get(characterListMap.get(cA2[i]).size() - 1);\n if (currBiggest > prevBiggest) {\n prevBiggest = currBiggest;\n }\n currBiggest = 1;\n }\n }\n }\n\n return prevBiggest > currBiggest ? prevBiggest : currBiggest;\n }", "public static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\t\tint k = input.nextInt();\n\t\tString s = input.next();\n\t\tString smallest = \" \";\n\t\tString largest = \" \";\n\t\tList<String> SubStringsOf_k_Length = new ArrayList<String>();\n\t\tfor(int i=0;(i+k)<=s.length();i++) {\n\t\t\tSubStringsOf_k_Length.add(s.substring(i,i+k));\n\t\t}\n//\t\tSystem.out.println(\"Before Sorting\");\n\t\tSystem.out.println(SubStringsOf_k_Length);\n\t\tSystem.out.println(SubStringsOf_k_Length.size());\n//\t\tCollections.sort(SubStringsOf_k_Length);\n//\t\tSystem.out.println(\"After Sorting\");\n//\t\tSystem.out.println(SubStringsOf_k_Length);\n\t\t\n//\t\tIterator itr = SubStringsOf_k_Length.iterator();\n//\t\t\n//\t\twhile(itr.hasNext()) {\n//\t\t\t\n//\t\t}\n\t\tString temp_largest = SubStringsOf_k_Length.get(0);\n\t\tString temp_smallest = SubStringsOf_k_Length.get(0);\n\t\tfor(int i=0;i<SubStringsOf_k_Length.size();i++) {\n\t\t\tif(temp_largest.compareTo(SubStringsOf_k_Length.get(i))>0 || temp_smallest.compareTo(SubStringsOf_k_Length.get(i))<0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfor(int j=i+1;j<SubStringsOf_k_Length.size();j++) {\n\t\t\t\t\tif(SubStringsOf_k_Length.get(i).compareTo(SubStringsOf_k_Length.get(j))>0) {\n\t\t\t\t\t\tlargest = SubStringsOf_k_Length.get(i);\n\t\t\t\t\t\tsmallest=SubStringsOf_k_Length.get(j);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t//smallest = SubStringsOf_k_Length.get(i);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp_largest = largest;\n\t\t\t\ttemp_smallest = smallest;\n\t\t\t\t\n\t\t\t}\t\n\t\t}\n\t\tSystem.out.println(largest);\n\t\tSystem.out.println(smallest);\n//\t\tfor(int i=1;i<subStrings_Of_k_Length.length;i++) {\n//\t\t\tSystem.out.println(subStrings_Of_k_Length[i-1]);\n//\t\t\tsmallest = subStrings_Of_k_Length[i-1];\n//\t\t\tif((subStrings_Of_k_Length[i].compareTo(smallest))<0) {\n//\t\t\t\tlargest = subStrings_Of_k_Length[i-1];\n//\t\t\t\tsmallest = subStrings_Of_k_Length[i];\n//\t\t\t}\n//\t\t}\n//\t\tSystem.out.println(\"Smallest:\" +smallest);\n//\t\tSystem.out.println(\"Largest:\" +largest);\n\t}", "private boolean isRotation(String s1, String s2) {\n\t\treturn (s1.length() == s2.length()) && isSubstring(s1 + s1, s2);\n\t}", "public boolean isScramble(String s1, String s2) {\n if (s1.length() != s2.length())\n return false;\n \n if (hash.containsKey(s1 + \"#\" + s2))\n return hash.get(s1 + \"#\" + s2);\n \n int n = s1.length();\n if (n == 1) {\n return s1.charAt(0) == s2.charAt(0);\n }\n for (int k = 1; k < n; ++k) {\n if (isScramble(s1.substring(0, k), s2.substring(0, k)) &&\n isScramble(s1.substring(k, n), s2.substring(k, n)) ||\n isScramble(s1.substring(0, k), s2.substring(n - k, n)) &&\n isScramble(s1.substring(k, n), s2.substring(0, n - k))\n ) {\n hash.put(s1 + \"#\" + s2, true);\n return true;\n }\n }\n hash.put(s1 + \"#\" + s2, false);\n return false;\n }", "private int compareInternal(String shorter, String longer) {\n int lengthDiff = longer.length() - shorter.length();\n\n for (int compareStartIndexInsideLonger = 0; compareStartIndexInsideLonger <= lengthDiff; compareStartIndexInsideLonger++) {\n String compariosonPartFromLonger = longer.substring(compareStartIndexInsideLonger, compareStartIndexInsideLonger + shorter.length());\n //we have found an answer if they are not equal\n int result = shorter.compareTo(compariosonPartFromLonger);\n if (result != 0) {\n return result;\n }\n }\n\n //the are equal\n return 0;\n }", "public int minCharacters(String a, String b) {\n int[] c1 = new int[26];\n int[] c2 = new int[26];\n for (char c: a.toCharArray()) {\n c1[c-'a']++;\n }\n for (char c: b.toCharArray()) {\n c2[c-'a']++;\n }\n\n // initialize res\n int m = a.length();\n int n = b.length();\n int res = m + n;\n\n // 1. make string a and b only consist of distinct character\n for (int i = 0; i < 26; ++i) {\n // means operations to change all characters(m+n) to character i (c1[i] and c2[i])\n res = Math.min(res, m + n - c1[i] - c2[i]);\n }\n\n // cal prefix sum\n // this prefix sum represents the frequency of all characters less than i;\n for (int i = 1; i < 26; ++i) {\n c1[i] += c1[i - 1];\n c2[i] += c2[i - 1];\n }\n\n // 2,3 a less than b or b less than a\n // why the up-limit is 25? cos, the character 'z' can not be the base character. there is no one\n for (int i = 0; i < 25; ++i) {\n // c1[i] for freq of characters less than or equal to i in a\n // c2[i] for freq of characters less than or equal to i in b\n\n // 2. make a < b\n // replace all characters less or equal to i in `b` to larger ones and all characters grater than i in `a` to less ones\n res = Math.min(res, c2[i] + m - c1[i]);\n // 3. make a > b\n // replace all characters less or equal to i in `a` to larger ones and all characters grater than i in `b` to less ones\n res = Math.min(res, c1[i] + n - c2[i]);\n }\n return res;\n }", "public static void main(String[] args) {\n\t\tStringBuilder sb=new StringBuilder();\n\t\tString str=\"xheixhixhi\";\n\t\tint x=0;\n\t\tfor(int i=0;i<str.length();i++)\n\t\t{\n\t\t\tif(str.charAt(i)=='x')\n\t\t\t\tx++;\n\t\t\n\t\t\telse\n\t\t\t\tsb.append(str.charAt(i));\n\t\t}\n\t\tfor(int i=0;i<x;i++)\n\t\t\tsb.append('x');\n\t\tSystem.out.println(sb);\n\t\t\n\t\tString str1=\"xxxyyy\";\n\t\tStringBuffer sb1=new StringBuffer(str1);\n\t\tSystem.out.println(sb1.toString());\n\t\tfor(int i=0;i<(str1.length());i++)\n\t\t{\n\t\t\tif(sb1.charAt(i)==sb1.charAt(i+1))\n\t\t\t{\n\t\t\t\tSystem.out.println(i);\n\t\t\t\tsb1.insert(++i,'*');\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\tSystem.out.println(sb1.toString());\n\t\t\n\t\t//anagram\n\t\tString s1=\"niveda\";\n\t\tString s2=\"Nivedas\";\n\t\tString s4=s2.toLowerCase();\n\t\tchar[] s3=s1.toCharArray();\n\t\tchar[] s5=s4.toCharArray();\n\t\tArrays.sort(s3);\n\t\tArrays.sort(s5);\n\t\tboolean result=Arrays.equals(s3, s5);\n\t\tSystem.out.println(\"result is \"+result);\n\t\t\n\t\t//check all digits\n\t\tString s=\"09779\";\n\t\tif (s.isEmpty())\n\t\t\tSystem.out.println(\"empty\");;\n\n\t\tfor (int i = 0; i < s.length(); i++) {\n\t\tint temp = s.charAt(i) - (int)'0';\n\t\tSystem.out.println(temp);\n\t\tif (temp < 0 || temp > 9)\n\t\t\tSystem.out.println(\"false\");\n\t\t\n\t\t}\n\n\t\tSystem.out.println(\"true\");\n\n\t\t//reverse a string\n\t\tString s6=\"niveda is\";\n\t\tString sb4=new StringBuffer(s6).reverse().toString();\n\t\tSystem.out.println(sb4);\n\t\t\n\t\tStringBuilder s7=new StringBuilder();\n\t\tchar[] c1=s6.toCharArray();\n\t\tfor(int i=c1.length-1;i>=0;i--)\n\t\t{\n\t\t\ts7.append(c1[i]);\n\t\t}\n\t\tSystem.out.println(s7);\n\t\t\n\t\t//replace with space\n\t\tString str5=\"xxx yyy\";\n\t\tStringBuilder sb6=new StringBuilder(str5);\n\t\tSystem.out.println(sb6.toString());\n\t\tfor(int i=0;i<(str5.length());i++)\n\t\t{\n\t\t\tif(sb6.charAt(i)==32)\n\t\t\t{\n\t\t\t\tSystem.out.println(i);\n\t\t\t\tsb6.replace(i,i+1,\"%20\");\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\tSystem.out.println(sb6.toString());\n\t\t\n\t\tString sentence=\"my name is niveda\";\n\t\tList< String> words = Arrays.asList(sentence.split(\"\\\\s\")); \n\t\tCollections.reverse(words); \n\t\t\n\t\tSystem.out.println(words);\n\t\tStringBuilder sb8 = new StringBuilder(sentence.length()); \n\t\t\n\t\tfor (int i = 0; i <=words.size() - 1; i++)\n\t\t{ \n\t\t\tsb8.append(words.get(i)); \n\t\t\t\n\t\tsb8.append(' ');\n\t\t}\n\t\tSystem.out.println(sb8.toString().trim());\n\t\t\n\t\tStringBuffer sb9=new StringBuffer(sentence);\n\t\tString sb10=sb9.reverse().toString();\n\t\tSystem.out.println(\"old \"+sb10.toString().trim());\n\t\t\n\t\tStringBuilder reverse = new StringBuilder(); \n\t\tString[] sa = sentence.trim().split(\"\\\\s\"); \n\t\tString newest=\"\";\n\t\tfor (int i = sa.length - 1; i >= 0; i--) \n\t\t{ \n\t\t\tString newword=sa[i]; \n\t\t\t//reverse.append(' '); \n\t\t\tString newstring=\"\";\n\t\t\tfor(int n=newword.length()-1;n>=0;n--)\n\t\t\t{\n\t\t\t\tnewstring=newstring+newword.charAt(n);\n\t\t\n\t\t\t}\n\t\t\tnewest=newest+newstring+\" \";\n\t\t} \n\t\tSystem.out.println( reverse.toString().trim());\n\t\tSystem.out.println(\"newest \"+newest);\n\t\tSystem.out.println(\"number of words in the string \"+sa.length);\n\n\t\t\n\t\t//reverse chars in the word in place\n\t\tString s11=\"my name is niveda\";\n\t\tString reversestring=\"\";\n\t\tString[] c11=s11.trim().split(\"\\\\s\");\n\t\tfor(int k=0;k<c11.length;k++)\n\t\t{\n\t\t\tString word=c11[k];\n\t\t\tString reverseword=\"\";\n\t\t\tfor(int m=word.length()-1;m>=0;m--)\n\t\t\t{\n\t\t\t\t\n\t\t\treverseword=reverseword+word.charAt(m);\n\t\t\t}\n\t\t\treversestring=reversestring+reverseword+\" \";\n\t\t}\n\t\t\n\t\tSystem.out.println( reversestring);\n\t}", "public static void isInAlphabeticalOrder(String...a) {\n\t\t\r\n\t\tSystem.out.println(\"In which alphabetical order?\");\r\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tString order = scan.nextLine();\r\n\t\t\r\n\t\tboolean isFinished = false; //detects an early exit from inner loop\r\n\t\t\r\n\t\t// FIXME: compare characters in same position, but in subsequent strings.\r\n\t\t// may input strings with different lengths.\r\n\t\t// It will most likely throw an out of index exception, need to catch it / handle it\r\n\t\t// or make a custom exception\r\n\t\t// will probably need to check for a null value early.\r\n\t\t// might apply this fix by changing the outer loop to a regular loop, since it will only \r\n\t\t// iterate length() - 1 times.\r\n\t\t\r\n\t\tSystem.out.println(a.length);\r\n\t\t\r\n\t\t//check order\r\n\t\tswitch (order) {\r\n\t\t\tcase \"forward\":\t\t\t// the length method in the next line is for an array.\r\n\t\t\t\tfor (int i = 0; i < a.length -1; i++) { //iterates through all the string pairs provided\r\n\t\t\t\t\tfor (int j = 0; j < a[i].length(); j++) { //iterates through characters in the current string\r\n\t\t\t\t\t\t// if the 2 strings differ in length\r\n\t\t\t\t\t\t// i.e. if the next string is shorter than the current one\r\n\t\t\t\t\t\t// might throw an exception\r\n\t\t\t\t\t\t// NOTE: continue moves to the next iteration of a loop.\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// the inner loop breaks if it doesn't find anything out of order.\r\n\t\t\t\t\t\t// it should only iterate through the entire string if the \r\n\t\t\t\t\t\t// characters are identical.\r\n\r\n\t\t\t\t\t\tif (a[i].charAt(j) < a[i + 1].charAt(j)) {\r\n\t\t\t\t\t\t\tbreak; // in order; moves on to next pair of strings\r\n\t\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\t\tif (a[i].charAt(j) > a[i + 1].charAt(j)) { // out of order\r\n\t\t\t\t\t\t\tisFinished = true;\r\n\t\t\t\t\t\t\tSystem.out.println(false);\r\n\t\t\t\t\t\t\tbreak; // exit the loop\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (j + 1 == a[i+1].length()) { // check for the end of next string\r\n\t\t\t\t\t\t\t// to avoid an out of bounds exception\r\n\t\t\t\t\t\t\tbreak; // move to the next iteration of the outer loop.\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (isFinished) { //checks for an early exit in the inner loop\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (!isFinished) {\r\n\t\t\t\t\tSystem.out.println(true); //will only occur if an early exit does not occur\r\n\t\t\t\t}\r\n\t\t\t\tscan.close();\r\n\t\t\t\tbreak; //close scanner and exit the loop\r\n\t\t\t\r\n\t\t\tcase \"reverse\":\r\n\t\t\t\tfor (int i = 0; i < a.length -1; i++) { //iterates through all the string pairs provided\r\n\t\t\t\t\tfor (int j = 0; j < a[i].length(); j++) { //iterates through characters in the current string\r\n\t\t\t\t\t\t// if the 2 strings differ in length\r\n\t\t\t\t\t\t// i.e. if the next string is shorter than the current one\r\n\t\t\t\t\t\t// might throw an exception\r\n\t\t\t\t\t\t// NOTE: continue moves to the next iteration of a loop.\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// the inner breaks if it doesn't find anything out of order.\r\n\t\t\t\t\t\t// it should only iterate through the entire string if the \r\n\t\t\t\t\t\t// characters are identical.\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//FIXME: hitting a[2] when it should not be happening.\r\n\t\t\t\t\t\tif (a[i].charAt(j) > a[i + 1].charAt(j)) {\r\n\t\t\t\t\t\t\tbreak; // in order; moves on to next pair of strings\r\n\t\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\t\tif (a[i].charAt(j) < a[i + 1].charAt(j)) { // out of order\r\n\t\t\t\t\t\t\tisFinished = true;\r\n\t\t\t\t\t\t\tSystem.out.println(false);\r\n\t\t\t\t\t\t\tbreak; // exit the loop\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (j + 1 == a[i+1].length()) { // check for the end of next string\r\n\t\t\t\t\t\t\t// to avoid an out of bounds exception\r\n\t\t\t\t\t\t\tbreak; // move to the next iteration of the outer loop.\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (isFinished) { //checks for an early exit in the inner loop\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (!isFinished) {\r\n\t\t\t\t\tSystem.out.println(true); //will only occur if an early exit does not occur\r\n\t\t\t\t}\r\n\t\t\t\tscan.close();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tSystem.out.println(\"That's not a good input.\");\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t}", "public static void displayPermutation(String s1, String s2) {\n if (s1.length() == 0) {\n System.out.println(s2 + \" \");\n }\n\n for (int i = 0; i < s1.length(); i++) {\n\n // current character at index (i) of s1\n char ch = s1.charAt(i);\n\n // Rest of the string after excluding the character at current index\n String ros = s1.substring(0, i) + s1.substring(i + 1);\n\n // recursive call\n displayPermutation(ros, s2 + ch);\n }\n }", "@Override\n public int compare(Character char1, Character char2) {\n if(char1.charValue() == char2.charValue()){\n return 0;\n }\n int char1Index = findIndex(char1);\n int char2Index = findIndex(char2);\n if(char1Index >= 0 && char2Index >= 0){\n return char1Index < char2Index ? -1: 1;\n }\n // char1 exists in S and char2 doesn't,then char1 should come first.\n if(char1Index >=0 && char2Index == -1){\n return -1;\n }\n else if(char1Index == -1 && char2Index >=0){\n return 1;\n }\n else{\n return 0;\n }\n }", "@Override\r\n\tpublic int compare(String s1, String s2) {\n\t\treturn s1.length() - s2.length();\r\n\t}", "public static void main(String[] args) {\n Scanner sc=new Scanner(System.in);\n String s1,s2;\n s1=sc.nextLine();\n s2=sc.nextLine();\n s1=s1.toLowerCase();\n s2=s2.toLowerCase();\n if(s1.length()!=s2.length()) \n System.out.println(\"Not an anagram\");\n char[] c1=s1.toCharArray();\n char[] c2=s2.toCharArray();\n Arrays.sort(c1);\n Arrays.sort(c2);\n \tif(Arrays.equals(c1, c2))\n System.out.println(\"anagram\");\n \telse\n System.out.println(\"Not an anagram\");\n }", "static int alternate(String s) {\n HashMap<Character,Integer>mapCharacter = new HashMap<>();\n LinkedList<String>twoChar=new LinkedList<>();\n LinkedList<Character>arr=new LinkedList<>();\n Stack<String>stack=new Stack<>();\n int largest=0;\n int counter=0;\n if (s.length()==1){\n return 0;\n }\n\n for (int i =0; i<s.length();i++){\n if (mapCharacter.get(s.charAt(i))==null)\n {\n mapCharacter.put(s.charAt(i),1);\n }\n }\n\n Iterator iterator=mapCharacter.entrySet().iterator();\n while (iterator.hasNext()){\n counter++;\n Map.Entry entry=(Map.Entry)iterator.next();\n arr.addFirst((Character) entry.getKey());\n }\n\n for (int i=0;i<arr.size();i++){\n for (int j=i;j<arr.size();j++){\n StringBuilder sb =new StringBuilder();\n for (int k=0;k<s.length();k++){\n if (s.charAt(k)==arr.get(i)||s.charAt(k)==arr.get(j)){\n sb.append(s.charAt(k));\n }\n }\n twoChar.addFirst(sb.toString());\n }\n }\n\n\n for (int b=0;b<twoChar.size();b++){\n String elementIn=twoChar.get(b);\n stack.push(elementIn);\n\n for (int i=0;i<elementIn.length()-1;i++){\n\n if (elementIn.charAt(i)==elementIn.charAt(i+1)){\n stack.pop();\n break;\n }\n }\n }\n\n int stackSize=stack.size();\n\n for (int j=0;j<stackSize;j++){\n String s1=stack.pop();\n int length=s1.length();\n if (length>largest){\n largest=length;\n\n }\n }\n return largest;\n\n\n\n\n }", "static void isAnagram(String s1, String s2) {\n\n String copyOfs1 = s1.replaceAll(\"s\", \"\");\n\n String copyOfs2 = s2.replaceAll(\"s\", \"\");\n\n //Initially setting status as true\n\n boolean status = true;\n\n if (copyOfs1.length() != copyOfs2.length()) {\n //Setting status as false if copyOfs1 and copyOfs2 doesn't have same length\n\n status = false;\n } else {\n //Changing the case of characters of both copyOfs1 and copyOfs2 and converting them to char array\n\n char[] s1Array = copyOfs1.toLowerCase().toCharArray();\n\n char[] s2Array = copyOfs2.toLowerCase().toCharArray();\n\n //Sorting both s1Array and s2Array\n\n Arrays.sort(s1Array);\n\n Arrays.sort(s2Array);\n\n //Checking whether s1Array and s2Array are equal\n\n status = Arrays.equals(s1Array, s2Array);\n }\n\n //Output\n\n if (status) {\n System.out.println(s1 + \" and \" + s2 + \" are anagrams\");\n } else {\n System.out.println(s1 + \" and \" + s2 + \" are not anagrams\");\n }\n }", "public static boolean isPermutation(String s1, String s2) {\n // TODO\n /** using set, and add a compare method in the set interface */\n return false;\n }", "@Test\n public void compressTest() {\n char[] chars1 = new char[]{'a', 'a', 'b', 'b', 'c', 'c', 'c'};\n assertEquals(6, compress(chars1));\n char[] expected1 = new char[]{'a', '2', 'b', '2', 'c', '3'};\n for(int i = 0; i < expected1.length; i++) {\n assertEquals(expected1[i], chars1[i]);\n }\n /**\n * Input:\n * [\"a\"]\n *\n * Output:\n * Return 1, and the first 1 characters of the input array should be: [\"a\"]\n *\n * Explanation:\n * Nothing is replaced.\n */\n char[] chars2 = new char[]{'a'};\n assertEquals(1, compress(chars2));\n char[] expected2 = new char[]{'a'};\n for(int i = 0; i < expected2.length; i++) {\n assertEquals(expected2[i], chars2[i]);\n }\n /**\n * Input:\n * [\"a\",\"b\",\"b\",\"b\",\"b\",\"b\",\"b\",\"b\",\"b\",\"b\",\"b\",\"b\",\"b\"]\n *\n * Output:\n * Return 4, and the first 4 characters of the input array should be: [\"a\",\"b\",\"1\",\"2\"].\n *\n * Explanation:\n * Since the character \"a\" does not repeat, it is not compressed. \"bbbbbbbbbbbb\" is replaced by \"b12\".\n * Notice each digit has it's own entry in the array.\n */\n char[] chars3 = new char[]{'a', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b'};\n assertEquals(4, compress(chars3));\n char[] expected3 = new char[]{'a', 'b', '1', '2'};\n for(int i = 0; i < expected3.length; i++) {\n assertEquals(expected3[i], chars3[i]);\n }\n\n }", "@Override\n public int compare(String o1, String o2) {\n return o1.length() - o2.length();\n }", "static int makeAnagram(String a, String b) {\n int[] arr1 = new int[26];\n int[] arr2 = new int[26];\n\n for (int i = 0; i < a.length() ; i++) {\n arr1[a.charAt(i) - 'a']++;\n }\n\n for (int i = 0; i < b.length(); i++)\n arr2[b.charAt(i) - 'a']++;\n\n int times = 0;\n for (int i = 0; i < 26; i++)\n times += Math.abs(arr1[i] - arr2[i]);\n\n\n return times;\n }", "boolean isPermutationBuckets(String s1, String s2) {\n\t\tint[] countsS1 = new int[256];\n\t\tint[] countsS2 = new int[256];\n\t\t\n\t\tif(s1.length() != s2.length()) return false;\n\t\tfor(int i = 0; i < s1.length(); ++i) {\n\t\t\tchar c1 = s1.charAt(i);\n\t\t\tchar c2 = s2.charAt(i);\n\t\t\t++countsS1[c1];\n\t\t\t++countsS2[c2];\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < countsS1.length; ++i) {\n\t\t\tif(countsS1[i] != countsS2[i]) return false;\n\t\t}\n\t\treturn true;\n\t}", "static String doit(final String string1, final String string2) {\n String shorterString; // a\n String longerString; // b\n if (string1.length() > string2.length()) {\n shorterString = string2;\n longerString = string1;\n } else {\n longerString = string2;\n shorterString = string1;\n }\n String r = \"\";\n\n for (int i = 0; i < shorterString.length(); i++) {\n for (int j = shorterString.length() - i; j > 0; j--) {\n for (int k = 0; k < longerString.length() - j; k++) {\n if (shorterString.regionMatches(i, longerString, k, j) && j > r.length()) {\n r = shorterString.substring(i, i + j);\n }\n }\n } // Ah yeah\n }\n return r;\n\n }" ]
[ "0.7359729", "0.7095896", "0.7018291", "0.68908334", "0.6886527", "0.6785759", "0.6757418", "0.66857284", "0.66622174", "0.664966", "0.6597815", "0.6558567", "0.6487758", "0.64636874", "0.6418799", "0.6402717", "0.6383491", "0.6380529", "0.6365698", "0.63502115", "0.6344417", "0.6324471", "0.6320603", "0.6320134", "0.62971103", "0.6266011", "0.62322116", "0.62241983", "0.6209966", "0.6205783", "0.62008107", "0.6200569", "0.6187155", "0.6183472", "0.6124245", "0.6070343", "0.60602546", "0.6058843", "0.6019612", "0.6011092", "0.6008366", "0.6004013", "0.5986311", "0.5977963", "0.5976947", "0.59682935", "0.59527117", "0.59390646", "0.5932435", "0.59204865", "0.59117234", "0.5905797", "0.59041023", "0.59023243", "0.5887041", "0.58854747", "0.5885408", "0.58702683", "0.5861192", "0.58590806", "0.5845395", "0.5824217", "0.58217937", "0.581617", "0.58070827", "0.5797759", "0.5796915", "0.57827246", "0.5775466", "0.57754457", "0.57750297", "0.5770131", "0.5769567", "0.57678956", "0.5754469", "0.5754029", "0.5747467", "0.5744488", "0.5742913", "0.5740382", "0.5734246", "0.5733454", "0.57328737", "0.57308155", "0.573064", "0.57116354", "0.5711128", "0.5709685", "0.57090133", "0.5706824", "0.57010645", "0.5699978", "0.56910026", "0.5688781", "0.56857365", "0.56823444", "0.5680314", "0.56753945", "0.56720716", "0.5670509" ]
0.7125982
1
/ O(n) approach "Bucket sort" similarity.
boolean isPermutationBuckets(String s1, String s2) { int[] countsS1 = new int[256]; int[] countsS2 = new int[256]; if(s1.length() != s2.length()) return false; for(int i = 0; i < s1.length(); ++i) { char c1 = s1.charAt(i); char c2 = s2.charAt(i); ++countsS1[c1]; ++countsS2[c2]; } for(int i = 0; i < countsS1.length; ++i) { if(countsS1[i] != countsS2[i]) return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void bucketSort() {\n MyArray ten = new MyArray();\n MyArray hundred = new MyArray();\n MyArray thousand = new MyArray();\n MyArray tenThousand = new MyArray();\n MyArray hundredThousand = new MyArray();\n MyArray million = new MyArray();\n MyArray tenMillion = new MyArray();\n MyArray hundredMillion = new MyArray();\n MyArray billion = new MyArray();\n\n for (int i = 0; i < array.length; i++) {\n if ((int) array[i] / 10 < 0) {\n ten.add(array[i]);\n } else if ((int) array[i] / 100 < 0) {\n hundred.add(array[i]);\n } else if ((int) array[i] / 1000 < 0) {\n thousand.add(array[i]);\n } else if ((int) array[i] / 10000 < 0) {\n tenThousand.add(array[i]);\n } else if ((int) array[i] / 100000 < 0) {\n hundredThousand.add(array[i]);\n } else if ((int) array[i] / 1000000 < 0) {\n million.add(array[i]);\n } else if ((int) array[i] / 10000000 < 0) {\n tenMillion.add(array[i]);\n } else if ((int) array[i] / 100000000 < 0) {\n hundredMillion.add(array[i]);\n } else {\n billion.add(array[i]);\n }\n }\n\n ten = ten.radixSort(ten);\n hundred = hundred.radixSort(hundred);\n thousand = thousand.radixSort(thousand);\n tenThousand = tenThousand.radixSort(tenThousand);\n hundredThousand = hundredThousand.radixSort(hundredThousand);\n million = million.radixSort(million);\n tenMillion = tenMillion.radixSort(tenMillion);\n hundredMillion = hundredMillion.radixSort(hundredMillion);\n billion = billion.radixSort(billion);\n\n int j = 0;\n for (int i = 0; i < ten.getSize(); i++) {\n array[i] = (T) ten.get(i);\n j++;\n }\n for (int i = 0; i < hundred.getSize(); i++) {\n array[i] = (T) hundred.get(i);\n j++;\n }\n for (int i = 0; i < thousand.getSize(); i++) {\n array[i] = (T) thousand.get(i);\n j++;\n }\n for (int i = 0; i < tenThousand.getSize(); i++) {\n array[i] = (T) tenThousand.get(i);\n j++;\n }\n for (int i = 0; i < hundredThousand.getSize(); i++) {\n array[i] = (T) hundredThousand.get(i);\n j++;\n }\n for (int i = 0; i < million.getSize(); i++) {\n array[i] = (T) million.get(i);\n j++;\n }\n for (int i = 0; i < tenMillion.getSize(); i++) {\n array[i] = (T) tenMillion.get(i);\n j++;\n }\n for (int i = 0; i < hundredMillion.getSize(); i++) {\n array[j] = (T) hundredMillion.get(i);\n j++;\n }\n for (int i = 0; i < billion.getSize(); i++) {\n array[j] = (T) billion.get(i);\n j++;\n }\n\n }", "private static void BucketSort(int[] A){\n\t\tSystem.out.println(\"BucketSort\\n\");\n\t\t\n\t\tSystem.out.print(\"Before bucket sort: \");\n\t\tfor(int i = 0 ; i < A.length ; i++){\n\t\t\tSystem.out.print(A[i] + \" \");\n\t\t}\n\t\tSystem.out.println();\n\t\t\n\t\t\n\t\t\n\t\t//Gets the highest number in the array\n\t\tint MaxNum = 0;\n\t\tfor(int i = 0 ; i < A.length ; i++){\n\t\t\tif(A[i] > MaxNum)\n\t\t\t\tMaxNum = A[i];\n\t\t}\n\t\t\n\t\tint[] B = new int [MaxNum + 1];\n\t\t\n\t\tfor(int i = 0 ; i < B.length ; i++){\n\t\t\tB[i] = 0;\n\t\t}\n\t\t\n\t\tfor(int i = 0 ; i < A.length; i++){\n\t\t\t B[A[i]]++;\n\t\t}\n\t\t\n\t\t//implementing insertion sort with bucket\n\t\tint BucketPosition = 0;\n\t\t\n\t\tfor(int i = 0 ; i < B.length ; i++){\n\t\t\tfor(int j = 0 ; j < B[i] ; j++){\n\t\t\t\tA[BucketPosition] = i;\n\t\t\t\tBucketPosition++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t/* \t\t\tPrints out the after sorting algorithm\t\t*/\n\t\tSystem.out.print(\"\\nAfter bucket sort: \");\n\t\tfor(int i = 0 ; i < A.length; i++)\n\t\t\tSystem.out.print(A[i] + \" \");\n\t\t\n\t}", "void bucketSort(float arr[], int k) {\r\n \tif(k<=0)\r\n \t\treturn;\r\n \t\r\n \tLinkedList<Float> buckets[] = new LinkedList[k];\r\n \tfor(int i=0; i<k; i++) {\r\n \t\tbuckets[i]= new LinkedList<Float>();\r\n \t}\r\n \tfor(int i=0; i<arr.length; i++) {\r\n \t\tfloat index=arr[i]*k;\r\n \t\tbuckets[(int)index].add(arr[i]);\r\n \t}\r\n \tfor(int i=0; i<k; i++) {\r\n \t\tCollections.sort(buckets[i]);\r\n \t}\r\n \tint index=0;\r\n \tfor(int i=0;i<k; i++) {\r\n \t\tfor(int j=0; j<buckets[i].size(); j++) {\r\n \t\t\tarr[index++]=buckets[i].get(j);\r\n \t\t}\r\n \t}\r\n }", "static void bucket_partition2(int b_size, LikenessBuckets bk){\n\t\tint parts = b_size/partition_size; //#partitions per bucket\n\t\tfloat ratio; int offsetB; int offsetB2; int offsetP;\n\t\tint chunk_size; int partSA; int partSA2;\n\t\tshort[][] tmpBucket;\n\n\t\tif(parts == 0){\n\t\t\tparts = 1;\n\t\t\tchunk_sizes.add(b_size);\n\t\t}else{\n\t\t\tfor(int i=0; i<parts-1; i++){\n\t\t\t\tchunk_sizes.add(partition_size);\n\t\t\t}\n\t\t\tif ((b_size % partition_size) <= (partition_size/2)){\n\t\t\t\tchunk_sizes.addFirst(partition_size + (b_size % partition_size));\n\t\t\t}else{\n\t\t\t\tparts++;\n\t\t\t\tchunk_sizes.add(partition_size);\n\t\t\t\tchunk_sizes.addLast(b_size % partition_size);\n\t\t\t}\n\t\t}\n\n\t\tfor(int b=0; b<buckNum; b++){//for every bucket\n\t\t\ttmpBucket = new short[bucket_size][dims];\n\t\t\t//tuples of most freq SA:\n\t\t\tArrayList<Integer> chg = bk.changeSA.get(b);\n\t\t\tint first = 0; int last = chg.get(0);\n\t\t\tif((last-first) > 0){ // (last-first+1) > 1.\n\t\t\t\t//System.out.println(\"sorting bucket[\"+b+\"][\"\n\t\t\t\t//\t\t\t\t +first+\"--\"+last+\"]\");\n\t\t\t\tquickSortBucket(first, last, b);\n\t\t\t}\n\t\t\t//remaining tuples:\n\t\t\tif((bucket_size - last) > 3){ // (bucket_size-1 -last-1) > 1.\n\t\t\t\t//System.out.println(\"sorting bucket[\"+b+\"][\"\n\t\t\t\t//\t\t\t\t +(last+1)+\"--\"+(bucket_size-1)+\"]\");\n\t\t\t\tquickSortBucket(last+1, bucket_size-1, b);\n\t\t\t}\n\t\t\toffsetB = 0;\n\t\t\toffsetP = 0;\n\t\t\toffsetB2 = last+1;\n\t\t\tfor(int jj=0; jj<parts; jj++){//for every partition\n\t\t\t\tchunk_size = chunk_sizes.get(jj);\n\t\t\t\t//ratio = ((float)chunk_size) / ((float)bucket_size);\n\t\t\t\t//partSA = Math.round(ratio * ((float)(last-first+1))); //freq SA\n\t\t\t\tpartSA = (int)Math.ceil(((double)(last-offsetB+1)) / ((double)(parts-jj)));\n\t\t\t\tpartSA2 = chunk_size - partSA; //remaining SAs\n\t\t\t\tfor(int j=0; j<partSA; j++){\n\t\t\t\t\ttmpBucket[offsetP + j] = buckets[b][offsetB + j];\n\t\t\t\t}\n\t\t\t\toffsetB += partSA;\n\t\t\t\tfor(int j=0; j<partSA2; j++){\n\t\t\t\t\ttmpBucket[offsetP + partSA + j] = buckets[b][offsetB2 + j];\n\t\t\t\t}\n\t\t\t\toffsetB2 += partSA2;\n\t\t\t\toffsetP += chunk_size;\n\t\t\t}\n\t\t\tbuckets[b] = tmpBucket;\n\t\t}\n\t}", "public BucketSort()\n {\n for(int i = 0; i < 30; i++)\n {\n a[i] = generator.nextInt(50)+1;\n b[i] = a[i];\n }\n }", "void sort (int [] items) {\r\n\tint length = items.length;\r\n\tfor (int gap=length/2; gap>0; gap/=2) {\r\n\t\tfor (int i=gap; i<length; i++) {\r\n\t\t\tfor (int j=i-gap; j>=0; j-=gap) {\r\n\t\t \t\tif (items [j] <= items [j + gap]) {\r\n\t\t\t\t\tint swap = items [j];\r\n\t\t\t\t\titems [j] = items [j + gap];\r\n\t\t\t\t\titems [j + gap] = swap;\r\n\t\t \t\t}\r\n\t \t}\r\n\t }\r\n\t}\r\n}", "public void sortGivenArray_popularity() { \n int i, j, k; \n for(i = movieList.size()/2; i > 0; i /= 2) {\n for(j = i; j < movieList.size(); j++) {\n Movie key = movieList.get(j);\n for(k = j; k >= i; k -= i) {\n if(key.rents > movieList.get(k-i).rents) {\n movieList.set(k, movieList.get(k-i));\n } else {\n break; \n }\n }\n movieList.set(k, key);\n }\n } \n }", "public boolean containsNearbyAlmostDuplicate(int[] nums, int k, int t) {\n if (t < 0) return false;\n long sz = (long)t + 1;\n Map<Long, Long> map = new HashMap<>();\n for (int i = 0; i < nums.length; ++i) {\n long bucket = getBucket(nums[i], sz);\n if (map.containsKey(bucket)) return true;\n if (map.containsKey(bucket + 1) && Math.abs(nums[i] - map.get(bucket + 1)) < sz) return true;\n if (map.containsKey(bucket - 1) && Math.abs(nums[i] - map.get(bucket - 1)) < sz) return true;\n map.put(bucket, (long)nums[i]);\n if (i >= k) map.remove(getBucket(nums[i - k], sz));\n }\n return false;\n}", "public static int[] bucketSort( int[] num, int maxValue) {\n\t\tint numBuckets = (int)Math.sqrt(maxValue)+1; //could use different amounts\n\n\t\tArrayList<Integer>[] bucket = new ArrayList[numBuckets];\n\n\t\tfor( int i = 0; i < bucket.length; i++ )\n\t\t\tbucket[i] = new ArrayList<Integer>();\n\n\t\t//'scatter' the numbers into the appropriate buckets\n\t\tfor( int i = 0; i < num.length; i++ ) {\n\t\t\tint bucketNum = num[i]/numBuckets; //determine the appropriate bucket\n\t\t\tbucket[bucketNum].add(num[i]); //add the item to the corresponding bucket\n\t\t}\n\n\t\tint index = 0;\n\n\t\t//sort the individual buckets and 'gather' the numbers back into the num array\n\t\tfor (int i = 0; i < bucket.length; i++) {\n\n\t\t\tif (bucket[i].size()>0){\n\n\t\t\t\t//copy each bucket to an integer array for sorting\n\t\t\t\tint[] bucketArray = new int[bucket[i].size()];\n\n\t\t\t\tfor(int j = 0; j < bucket[i].size(); j++) {\n\t\t\t\t\tbucketArray[j] = bucket[i].get(j);\n\t\t\t\t}\n\n\t\t\t\t//sort the bucket\n\t\t\t\tbucketArray = insertionSort(bucketArray);\n\n\t\t\t\t//copy the bucket back into the num array\n\t\t\t\tfor( int j = 0; j < bucketArray.length; j++ ) {\n\t\t\t\t\tnum[index] = bucketArray[j];\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn num;\n\t}", "private static void sort1(int[] x, IntComparator comp, int off, int len) {\n\t\tif (len < 7) {\n\t\t\tfor (int i=off; i<len+off; i++)\n\t\t\t\tfor (int j=i; j>off && comp.compare(x[j-1],x[j])>0; j--)\n\t\t\t\t\tswap(x, j, j-1);\n\t\t}\n\t\n\t\t// Choose a partition element, v\n\t\tint m = off + (len >> 1); // Small arrays, middle element\n\t\tif (len > 7) {\n\t\t\tint l = off;\n\t\t\tint n = off + len - 1;\n\t\t\tif (len > 40) { // Big arrays, pseudomedian of 9\n\t\t\t\tint s = len/8;\n\t\t\t\tl = med3(x,comp, l, l+s, l+2*s);\n\t\t\t\tm = med3(x,comp, m-s, m, m+s);\n\t\t\t\tn = med3(x,comp, n-2*s, n-s, n);\n\t\t\t}\n\t\t\tm = med3(x,comp, l, m, n); // Mid-size, med of 3\n\t\t}\n\t\tint v = x[m];\n\t\n\t\t// Establish Invariant: v* (<v)* (>v)* v*\n\t\tint a = off, b = a, c = off + len - 1, d = c;\n\t\twhile(true) {\n\t\t\twhile (b <= c && comp.compare(x[b],v)<=0) {\n\t\t\t\tif (x[b] == v)\n\t\t\t\t\tswap(x, a++, b);\n\t\t\t\tb++;\n\t\t\t}\n\t\t\twhile (c >= b && comp.compare(x[c],v)>=0) {\n\t\t\t\tif (x[c] == v)\n\t\t\t\t\tswap(x, c, d--);\n\t\t\t\tc--;\n\t\t\t}\n\t\t\tif (b > c)\n\t\t\t\tbreak;\n\t\t\tswap(x, b++, c--);\n\t\t}\n\t\n\t\t// Swap partition elements back to middle\n\t\tint s, n = off + len;\n\t\ts = Math.min(a-off, b-a ); vecswap(x,off, b-s, s);\n\t\ts = Math.min(d-c, n-d-1); vecswap(x,b, n-s, s);\n\t\n\t\t// Recursively sort non-partition-elements\n\t\tif ((s = b-a) > 1)\n\t\t\tsort1(x,comp, off, s);\n\t\tif ((s = d-c) > 1)\n\t\t\tsort1(x,comp, n-s, s);\n\t}", "public static void quickSortBucket(int left, int right, int b) {\n\t\tint i = left, j = right;\n\t\tint ref = left + (right-left)/2; //i.e., (right+left)/2\n\t\tshort[] pivot = buckets[b][ref];\n\t\tshort[] temp2 = new short[dims];\n\t\twhile (i <= j) { \n\t\t\twhile (compare_data(pivot, buckets[b][i]))\n\t\t\t\ti++;\n\t\t\twhile (compare_data(buckets[b][j], pivot))\n\t\t\t\tj--;\n\t\t\tif (i <= j) {\n\t\t\t\ttemp2=buckets[b][i];\n\t\t\t\tbuckets[b][i]=buckets[b][j];\n\t\t\t\tbuckets[b][j]=temp2;\n\n\t\t\t\ti++;\n\t\t\t\tj--;\n\t\t\t}\n\t\t}; \n\t\t// recursion\n\t\tif (left < j)\n\t\t\tquickSortBucket(left, j, b);\n\t\tif (i < right) {\n\t\t\tquickSortBucket(i, right, b);\n\t\t}\n\t}", "private static void sort1(double x[], int[] a2, int off, int len) {\n\t\t// Insertion sort on smallest arrays\n\t\tif (len < 7) {\n\t\t\tfor (int i=off; i<len+off; i++)\n\t\t\t\tfor (int j=i; j>off && x[j-1]>x[j]; j--)\n\t\t\t\t\tswap(x,a2, j, j-1);\n\t\t\treturn;\n\t\t}\n\n\t\t// Choose a partition element, v\n\t\tint m = off + (len >> 1); // Small arrays, middle element\n\t\tif (len > 7) {\n\t\t\tint l = off;\n\t\t\tint n = off + len - 1;\n\t\t\tif (len > 40) { // Big arrays, pseudomedian of 9\n\t\t\t\tint s = len/8;\n\t\t\t\tl = med3(x, l, l+s, l+2*s);\n\t\t\t\tm = med3(x, m-s, m, m+s);\n\t\t\t\tn = med3(x, n-2*s, n-s, n);\n\t\t\t}\n\t\t\tm = med3(x, l, m, n); // Mid-size, med of 3\n\t\t}\n\t\tdouble v = x[m];\n\n\t\t// Establish Invariant: v* (<v)* (>v)* v*\n\t\tint a = off, b = a, c = off + len - 1, d = c;\n\t\twhile(true) {\n\t\t\twhile (b <= c && x[b] <= v) {\n\t\t\t\tif (x[b] == v)\n\t\t\t\t\tswap(x,a2, a++, b);\n\t\t\t\tb++;\n\t\t\t}\n\t\t\twhile (c >= b && x[c] >= v) {\n\t\t\t\tif (x[c] == v)\n\t\t\t\t\tswap(x,a2, c, d--);\n\t\t\t\tc--;\n\t\t\t}\n\t\t\tif (b > c)\n\t\t\t\tbreak;\n\t\t\tswap(x,a2, b++, c--);\n\t\t}\n\n\t\t// Swap partition elements back to middle\n\t\tint s, n = off + len;\n\t\ts = Math.min(a-off, b-a ); vecswap(x, a2,off, b-s, s);\n\t\ts = Math.min(d-c, n-d-1); vecswap(x, a2,b, n-s, s);\n\n\t\t// Recursively sort non-partition-elements\n\t\tif ((s = b-a) > 1)\n\t\t\tsort1(x,a2, off, s);\n\t\tif ((s = d-c) > 1)\n\t\t\tsort1(x,a2, n-s, s);\n\t}", "private static void sort1(double x[], double[] a2, int off, int len) {\n\t\t// Insertion sort on smallest arrays\n\t\tif (len < 7) {\n\t\t\tfor (int i=off; i<len+off; i++)\n\t\t\t\tfor (int j=i; j>off && x[j-1]>x[j]; j--)\n\t\t\t\t\tswap(x,a2, j, j-1);\n\t\t\treturn;\n\t\t}\n\n\t\t// Choose a partition element, v\n\t\tint m = off + (len >> 1); // Small arrays, middle element\n\t\tif (len > 7) {\n\t\t\tint l = off;\n\t\t\tint n = off + len - 1;\n\t\t\tif (len > 40) { // Big arrays, pseudomedian of 9\n\t\t\t\tint s = len/8;\n\t\t\t\tl = med3(x, l, l+s, l+2*s);\n\t\t\t\tm = med3(x, m-s, m, m+s);\n\t\t\t\tn = med3(x, n-2*s, n-s, n);\n\t\t\t}\n\t\t\tm = med3(x, l, m, n); // Mid-size, med of 3\n\t\t}\n\t\tdouble v = x[m];\n\n\t\t// Establish Invariant: v* (<v)* (>v)* v*\n\t\tint a = off, b = a, c = off + len - 1, d = c;\n\t\twhile(true) {\n\t\t\twhile (b <= c && x[b] <= v) {\n\t\t\t\tif (x[b] == v)\n\t\t\t\t\tswap(x,a2, a++, b);\n\t\t\t\tb++;\n\t\t\t}\n\t\t\twhile (c >= b && x[c] >= v) {\n\t\t\t\tif (x[c] == v)\n\t\t\t\t\tswap(x,a2, c, d--);\n\t\t\t\tc--;\n\t\t\t}\n\t\t\tif (b > c)\n\t\t\t\tbreak;\n\t\t\tswap(x,a2, b++, c--);\n\t\t}\n\n\t\t// Swap partition elements back to middle\n\t\tint s, n = off + len;\n\t\ts = Math.min(a-off, b-a ); vecswap(x, a2,off, b-s, s);\n\t\ts = Math.min(d-c, n-d-1); vecswap(x, a2,b, n-s, s);\n\n\t\t// Recursively sort non-partition-elements\n\t\tif ((s = b-a) > 1)\n\t\t\tsort1(x,a2, off, s);\n\t\tif ((s = d-c) > 1)\n\t\t\tsort1(x,a2, n-s, s);\n\t}", "private static void sort1(int x[], double[] a2, int off, int len) {\n\t\t// Insertion sort on smallest arrays\n\t\tif (len < 7) {\n\t\t\tfor (int i=off; i<len+off; i++)\n\t\t\t\tfor (int j=i; j>off && x[j-1]>x[j]; j--)\n\t\t\t\t\tswap(x, a2, j, j-1);\n\t\t\treturn;\n\t\t}\n\n\t\t// Choose a partition element, v\n\t\tint m = off + (len >> 1); // Small arrays, middle element\n\t\tif (len > 7) {\n\t\t\tint l = off;\n\t\t\tint n = off + len - 1;\n\t\t\tif (len > 40) { // Big arrays, pseudomedian of 9\n\t\t\t\tint s = len/8;\n\t\t\t\tl = med3(x, l, l+s, l+2*s);\n\t\t\t\tm = med3(x, m-s, m, m+s);\n\t\t\t\tn = med3(x, n-2*s, n-s, n);\n\t\t\t}\n\t\t\tm = med3(x, l, m, n); // Mid-size, med of 3\n\t\t}\n\t\tint v = x[m];\n\n\t\t// Establish Invariant: v* (<v)* (>v)* v*\n\t\tint a = off, b = a, c = off + len - 1, d = c;\n\t\twhile(true) {\n\t\t\twhile (b <= c && x[b] <= v) {\n\t\t\t\tif (x[b] == v)\n\t\t\t\t\tswap(x,a2,a++, b);\n\t\t\t\tb++;\n\t\t\t}\n\t\t\twhile (c >= b && x[c] >= v) {\n\t\t\t\tif (x[c] == v)\n\t\t\t\t\tswap(x, a2,c, d--);\n\t\t\t\tc--;\n\t\t\t}\n\t\t\tif (b > c)\n\t\t\t\tbreak;\n\t\t\tswap(x,a2, b++, c--);\n\t\t}\n\n\t\t// Swap partition elements back to middle\n\t\tint s, n = off + len;\n\t\ts = Math.min(a-off, b-a ); vecswap(x,a2, off, b-s, s);\n\t\ts = Math.min(d-c, n-d-1); vecswap(x,a2, b, n-s, s);\n\n\t\t// Recursively sort non-partition-elements\n\t\tif ((s = b-a) > 1)\n\t\t\tsort1(x, a2,off, s);\n\t\tif ((s = d-c) > 1)\n\t\t\tsort1(x, a2,n-s, s);\n\t}", "public void sort(int[] a) {\n\t\tint n = a.length;\n\t\tint temp;\n\t\tfor (int gap = n / 2; gap > 0; gap /= 2) {\n\t\t\tfor (int i = gap; i < n; i++) {\n\t\t\t\tfor (int j = i - gap; j >= 0; j -= gap) {\n\t\t\t\t ++totalValCmp;\n\t\t\t\t if (a[j] > a[j + gap]) {\n\t\t\t\t\t temp = a[j];\n\t\t\t\t\t a[j] = a[j + gap];\n\t\t\t\t\t a[j + gap] = temp;\n\t\t\t\t\t ++totalswaps;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int noOfElements = sc.nextInt();\n int[] arr = new int[noOfElements];\n int[] arr1 = new int[noOfElements];\n int diff = Integer.MAX_VALUE;\n int sIndex = 0;\n int j = 0;\n for (int i = 0; i < noOfElements; i++) {\n arr[i] = sc.nextInt();\n }\n for (int j1 = 1; j1 < noOfElements; j1++) {\n int i = j1 - 1;\n int key = arr[j1];\n while (i >= 0 && key < arr[i]) { // 1 2 3\n arr[i + 1] = arr[i];\n i--;\n }\n arr[i + 1] = key;\n }\n //Arrays.sort(arr);\n for (int i = 0; i < noOfElements - 1; i++) {\n int temp = Math.abs(arr[i] - arr[i + 1]);\n if (temp <= diff) {\n diff=temp;\n }\n\n }\n\n for (int i = 0; i < noOfElements - 1; i++) {\n if (Math.abs(arr[i] - arr[i+1]) == diff) {\n System.out.print(arr[i] + \" \" + arr[i+1] + \" \");\n }\n }\n// for (int a = 0; a < j; a++) {\n//\n// System.out.print(arr[arr1[a]] + \" \" + arr[arr1[a]+1] + \" \");\n// }\n\n }", "k value.\nFor 2nd tallest group (and the rest), insert each one of them into (S) by k value. So on and so forth.\n\npublic class Solution {\n public int[][] reconstructQueue(int[][] people) {\n Arrays.sort(people,new Comparator<int[]>() {\n @Override\n public int compare(int[] o1, int[] o2){\n return o1[0] != o2[0]? -o1[0] + o2[0]: o1[1] - o2[1];\n }\n });\n\n List<int[]> res = new ArrayList<>();\n for (int[] cur : people) {\n res.add(cur[1], cur); \n }\n return res.toArray(new int[people.length][]);\n }", "void sort() {\n\t\tint n = array.length;\n\t\tint temp = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 1; j < (n - i); j++) {\n\t\t\t\tif (array[j - 1] > array[j]) { // if the first term is larger\n\t\t\t\t\t\t\t\t\t\t\t\t// than the last term, then the\n\t\t\t\t\t\t\t\t\t\t\t\t// temp holds the previous term\n\t\t\t\t\ttemp = array[j - 1];\n\t\t\t\t\tarray[j - 1] = array[j];// swaps places within the array\n\t\t\t\t\tarray[j] = temp;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}", "public RadixSorting()\n\t{\n\t\tbuckets.add(zero);\n\t\tbuckets.add(one);\n\t\tbuckets.add(two);\n\t\tbuckets.add(three);\n\t\tbuckets.add(four);\n\t\tbuckets.add(five);\n\t\tbuckets.add(six);\n\t\tbuckets.add(seven);\n\t\tbuckets.add(eight);\n\t\tbuckets.add(nine);\n\t\tbuckets.add(ten);\n\t\tbuckets.add(eleven);\n\t\tbuckets.add(twelve);\n\t\tbuckets.add(thirteen);\n\t\tbuckets.add(fourteen);\n\t\tbuckets.add(fifteen);\n\t\tbuckets.add(sixteen);\n\t\tbuckets.add(seventeen);\n\t\tbuckets.add(eighteen);\n\t\tbuckets.add(nineteen);\n\t}", "public static void main(String[] args) {\n int l1=1000, l2=1000;\n int[] a1=new int[l1];\n int[] a2=new int[l2];\n int[] combine = new int[l1+l2];\n\n Random r = new Random();\n for (int i=0; i<a1.length; ++i){\n a1[i]=r.nextInt(a1.length*3);\n combine[i]=a1[i];\n }\n\n for (int i=0; i<a2.length; ++i){\n a2[i]=r.nextInt(a2.length*3);\n combine[l1+i]=a2[i];\n }\n\n Arrays.sort(a1);\n Arrays.sort(a2);\n Arrays.sort(combine);\n\n cnt=0;\n int m = findByRank(a1, 0, a1.length, a2, 0, a2.length, (a1.length+a2.length)/2);\n int m2 = combine[combine.length/2-1];\n\n System.out.printf(\"m=%d, m2=%d, cnt=%d\", m, m2, cnt);\n\n\n\n }", "void sort();", "void sort();", "public void sort() {\r\n int k = start;\r\n for (int i = 0; i < size - 1; i++) {\r\n int p = (k + 1) % cir.length;\r\n for (int j = i + 1; j < size; j++) {\r\n if ((int) cir[p] < (int) cir[k % cir.length]) {\r\n Object temp = cir[k];\r\n cir[k] = cir[p];\r\n cir[p] = temp;\r\n }\r\n p = (p + 1) % cir.length;\r\n }\r\n k = (k + 1) % cir.length;\r\n }\r\n }", "static void bucket_partition(int b_size, LikenessBuckets bk){\n\t\tint parts = b_size/partition_size; //#partitions per bucket\n\t\tdouble ratio; int offsetB; int offsetP;\n\t\tint chunk_size; int partSA;\n\t\tshort[][] tmpBucket;\n\t\tint[] loaded;\n\n\t\tif(parts == 0){\n\t\t\tparts = 1;\n\t\t\tchunk_sizes.add(b_size);\n\t\t}else{\n\t\t\tfor(int i=0; i<parts-1; i++){\n\t\t\t\tchunk_sizes.add(partition_size);\n\t\t\t}\n\t\t\tif ((b_size % partition_size) <= (partition_size/2)){\n\t\t\t\tchunk_sizes.addFirst(partition_size + (b_size % partition_size));\n\t\t\t}else{\n\t\t\t\tparts++;\n\t\t\t\tchunk_sizes.add(partition_size);\n\t\t\t\tchunk_sizes.addLast(b_size % partition_size);\n\t\t\t}\n\t\t}\n\t\tloaded = new int[parts];\n\n\t\tfor(int b=0; b<buckNum; b++){//for every bucket\n\t\t\ttmpBucket = new short[bucket_size][dims];\n\t\t\tArrayList<Integer> chg = bk.changeSA.get(b);\n\t\t\tint first = 0; int last;\n\t\t\tfor(int i=0; i<parts; i++){\n\t\t\t\tloaded[i] = 0;\n\t\t\t}\n\t\t\tfor(int i=0; i<chg.size(); i++){//for every SA\n\t\t\t\tlast = chg.get(i);\n\t\t\t\tif((last-first) > 1){\n\t\t\t\t\t//System.out.println(\"sorting bucket[\"+b+\"][\"\n\t\t\t\t\t//\t\t\t\t +first+\"--\"+last+\"]\");\n\t\t\t\t\tquickSortBucket(first, last, b);\n\t\t\t\t}\n\t\t\t\toffsetB = first;\n\t\t\t\toffsetP = 0;\n\t\t\t\tfor(int jj=0; jj<parts; jj++){//for every partition\n\t\t\t\t\tchunk_size = chunk_sizes.get(jj);\n\t\t\t\t\t//ratio = ((double)chunk_size) / ((double)bucket_size);\n\t\t\t\t\t//partSA = (int)(Math.ceil(ratio * ((float)(last-offsetB+1))));\n\t\t\t\t\tpartSA = (int)Math.ceil(((double)(last-offsetB+1)) / ((double)(parts-jj)));\n\t\t\t\t\tif (partSA > (chunk_size - loaded[jj]))\n\t\t\t\t\t\tpartSA = chunk_size - loaded[jj];\n\t\t\t\t\tfor(int j=0; j<partSA; j++){\n\t\t\t\t\t\ttmpBucket[offsetP + loaded[jj] + j] = buckets[b][offsetB + j];\n\t\t\t\t\t}\n\t\t\t\t\tloaded[jj] += partSA;\n\t\t\t\t\toffsetB += partSA;\n\t\t\t\t\toffsetP += chunk_size;\n\t\t\t\t}\n\t\t\t\tfirst = last+1;\n\t\t\t}\n\t\t\tbuckets[b] = tmpBucket;\n\t\t}\n\t}", "static void minimumBribes(int[] q) {\n \t\n \tfor(int i=0;i<q.length;i++){\n if((q[i] - (i+1)) > 2){\n System.out.println(\"Too chaotic\");\n return; \n }\n }\n \n int swaps=0;\n for(int i=0;i< q.length;i++){\n for(int j=i+1;j<q.length;j++){\n if(q[i] > q[j]){ \n int tmp=q[j];\n q[j]=q[i];\n q[i]=tmp;\n swaps++;\n }\n }\n }\n \n System.out.println(swaps);\n \n }", "private static <T> void sort1(byte x[], T[] a2, int off, int len) {\n\t\t// Insertion sort on smallest arrays\n\t\tif (len < 7) {\n\t\t\tfor (int i=off; i<len+off; i++)\n\t\t\t\tfor (int j=i; j>off && x[j-1]>x[j]; j--)\n\t\t\t\t\tswap(x, a2, j, j-1);\n\t\t\treturn;\n\t\t}\n\n\t\t// Choose a partition element, v\n\t\tint m = off + (len >> 1); // Small arrays, middle element\n\t\tif (len > 7) {\n\t\t\tint l = off;\n\t\t\tint n = off + len - 1;\n\t\t\tif (len > 40) { // Big arrays, pseudomedian of 9\n\t\t\t\tint s = len/8;\n\t\t\t\tl = med3(x, l, l+s, l+2*s);\n\t\t\t\tm = med3(x, m-s, m, m+s);\n\t\t\t\tn = med3(x, n-2*s, n-s, n);\n\t\t\t}\n\t\t\tm = med3(x, l, m, n); // Mid-size, med of 3\n\t\t}\n\t\tbyte v = x[m];\n\n\t\t// Establish Invariant: v* (<v)* (>v)* v*\n\t\tint a = off, b = a, c = off + len - 1, d = c;\n\t\twhile(true) {\n\t\t\twhile (b <= c && x[b] <= v) {\n\t\t\t\tif (x[b] == v)\n\t\t\t\t\tswap(x,a2, a++, b);\n\t\t\t\tb++;\n\t\t\t}\n\t\t\twhile (c >= b && x[c] >= v) {\n\t\t\t\tif (x[c] == v)\n\t\t\t\t\tswap(x,a2, c, d--);\n\t\t\t\tc--;\n\t\t\t}\n\t\t\tif (b > c)\n\t\t\t\tbreak;\n\t\t\tswap(x,a2, b++, c--);\n\t\t}\n\n\t\t// Swap partition elements back to middle\n\t\tint s, n = off + len;\n\t\ts = Math.min(a-off, b-a ); vecswap(x,a2, off, b-s, s);\n\t\ts = Math.min(d-c, n-d-1); vecswap(x,a2, b, n-s, s);\n\n\t\t// Recursively sort non-partition-elements\n\t\tif ((s = b-a) > 1)\n\t\t\tsort1(x,a2, off, s);\n\t\tif ((s = d-c) > 1)\n\t\t\tsort1(x,a2, n-s, s);\n\t}", "static void combineBuckets(Buckets buckets, int r){\r\n int j = 0;\r\n Bucket bkt = buckets.bucket;\r\n while ((buckets.bucketSizeFrequency[j]) > r) {\r\n //combine last two buckets of size 2^j\r\n for(int i = 0; i < r - 1; i++){\r\n bkt = bkt.next;\r\n }\r\n bkt.size *= 2;\r\n\r\n //check if it is not the last bucket in the linked list\r\n if(bkt.next != null){\r\n bkt.endTimestamp = bkt.next.endTimestamp;\r\n bkt.next = bkt.next.next;\r\n }\r\n buckets.bucketSizeFrequency[j] -= 2;\r\n buckets.bucketSizeFrequency[j+1]++;\r\n j++;\r\n }\r\n }", "public static void sort(Comparable[] a) {\n for (int i = 0 ; i < a.length ; i++) { // each position scan\n int min = i;\n for (int j = i+1; j < a.length; j++) { // each time we have to scan through remaining entry\n if (HelperFunctions.less(a[j], a[min])) {\n min = j ;\n }\n HelperFunctions.exch(a, i, min);\n }\n }\n }", "private static void sort1(int x[], int[] a2, int off, int len) {\n\t\t// Insertion sort on smallest arrays\n\t\tif (len < 7) {\n\t\t\tfor (int i=off; i<len+off; i++)\n\t\t\t\tfor (int j=i; j>off && x[j-1]>x[j]; j--)\n\t\t\t\t\tswap(x, a2, j, j-1);\n\t\t\treturn;\n\t\t}\n\n\t\t// Choose a partition element, v\n\t\tint m = off + (len >> 1); // Small arrays, middle element\n\t\tif (len > 7) {\n\t\t\tint l = off;\n\t\t\tint n = off + len - 1;\n\t\t\tif (len > 40) { // Big arrays, pseudomedian of 9\n\t\t\t\tint s = len/8;\n\t\t\t\tl = med3(x, l, l+s, l+2*s);\n\t\t\t\tm = med3(x, m-s, m, m+s);\n\t\t\t\tn = med3(x, n-2*s, n-s, n);\n\t\t\t}\n\t\t\tm = med3(x, l, m, n); // Mid-size, med of 3\n\t\t}\n\t\tint v = x[m];\n\n\t\t// Establish Invariant: v* (<v)* (>v)* v*\n\t\tint a = off, b = a, c = off + len - 1, d = c;\n\t\twhile(true) {\n\t\t\twhile (b <= c && x[b] <= v) {\n\t\t\t\tif (x[b] == v)\n\t\t\t\t\tswap(x,a2,a++, b);\n\t\t\t\tb++;\n\t\t\t}\n\t\t\twhile (c >= b && x[c] >= v) {\n\t\t\t\tif (x[c] == v)\n\t\t\t\t\tswap(x, a2,c, d--);\n\t\t\t\tc--;\n\t\t\t}\n\t\t\tif (b > c)\n\t\t\t\tbreak;\n\t\t\tswap(x,a2, b++, c--);\n\t\t}\n\n\t\t// Swap partition elements back to middle\n\t\tint s, n = off + len;\n\t\ts = Math.min(a-off, b-a ); vecswap(x,a2, off, b-s, s);\n\t\ts = Math.min(d-c, n-d-1); vecswap(x,a2, b, n-s, s);\n\n\t\t// Recursively sort non-partition-elements\n\t\tif ((s = b-a) > 1)\n\t\t\tsort1(x, a2,off, s);\n\t\tif ((s = d-c) > 1)\n\t\t\tsort1(x, a2,n-s, s);\n\t}", "private static <T,P> void sort1(List<T> x, List<P> a2, Comparator<T> comp, int off, int len) {\n\t\t// Insertion sort on smallest arrays\n\t\tif (len < 7) {\n\t\t\tfor (int i=off; i<len+off; i++)\n\t\t\t\tfor (int j=i; j>off && comp.compare(x.get(j-1),x.get(j))>0; j--)\n\t\t\t\t\tswap(x, a2, j, j-1);\n\t\t\treturn;\n\t\t}\n\n\t\t// Choose a partition element, v\n\t\tint m = off + (len >> 1); // Small arrays, middle element\n\t\tif (len > 7) {\n\t\t\tint l = off;\n\t\t\tint n = off + len - 1;\n\t\t\tif (len > 40) { // Big arrays, pseudomedian of 9\n\t\t\t\tint s = len/8;\n\t\t\t\tl = med3(x,comp, l, l+s, l+2*s);\n\t\t\t\tm = med3(x,comp, m-s, m, m+s);\n\t\t\t\tn = med3(x,comp, n-2*s, n-s, n);\n\t\t\t}\n\t\t\tm = med3(x,comp, l, m, n); // Mid-size, med of 3\n\t\t}\n\t\tT v = x.get(m);\n\n\t\t// Establish Invariant: v* (<v)* (>v)* v*\n\t\tint a = off, b = a, c = off + len - 1, d = c;\n\t\twhile(true) {\n\t\t\twhile (b <= c && comp.compare(x.get(b),v)<=0) {\n\t\t\t\tif (x.get(b) == v)\n\t\t\t\t\tswap(x,a2, a++, b);\n\t\t\t\tb++;\n\t\t\t}\n\t\t\twhile (c >= b && comp.compare(x.get(c),v)>=0) {\n\t\t\t\tif (x.get(c) == v)\n\t\t\t\t\tswap(x,a2, c, d--);\n\t\t\t\tc--;\n\t\t\t}\n\t\t\tif (b > c)\n\t\t\t\tbreak;\n\t\t\tswap(x,a2, b++, c--);\n\t\t}\n\n\t\t// Swap partition elements back to middle\n\t\tint s, n = off + len;\n\t\ts = Math.min(a-off, b-a ); vecswap(x,a2, off, b-s, s);\n\t\ts = Math.min(d-c, n-d-1); vecswap(x,a2, b, n-s, s);\n\n\t\t// Recursively sort non-partition-elements\n\t\tif ((s = b-a) > 1)\n\t\t\tsort1(x,a2,comp, off, s);\n\t\tif ((s = d-c) > 1)\n\t\t\tsort1(x,a2,comp, n-s, s);\n\t}", "public static void sort(int[] a)\r\n\t {\r\n\t int[] b = new int[10];\r\n\t int max = getMax(a);\r\n\t int place = 1;\r\n\t System.out.println(max);\r\n\t while (max / place > 0)\r\n\t {\r\n\t \tint[] bucket = new int[10];\r\n\t for (int i = 0; i < a.length; i++)\r\n\t {\r\n\t \tbucket[(a[i]/place) % 10]++;\r\n\t }\t \r\n\t for (int i = 1; i < 10; i++)\r\n\t {\r\n\t \tbucket[i] += bucket[i - 1];\r\n\t } \r\n\t for (int i = a.length - 1; i >= 0; i--)\r\n\t {\r\n\t \tb[--bucket[(a[i]/place)%10]] = a[i];\r\n\t } \r\n\t for (int i=0; i<a.length; i++)\r\n\t {\r\n\t \ta[i] = b[i];\r\n\t }\t \r\n\t place *= 10; \r\n\t }\r\n\t }", "@Override\n protected void runAlgorithm() {\n for (int i = 0; i < getArray().length; i++) {\n for (int j = i + 1; j < getArray().length; j++) {\n if (applySortingOperator(getValue(j), getValue(i))) {\n swap(i, j);\n }\n }\n }\n }", "public static WordFrq[] sort(WordFrq b[]){\n WordFrq temp;\n int i=0;\n while (i < 3) {\n for (i = 1; i < 3; i++) {\n if (b[i-1].count > b[i].count) {\n temp = b[i];\n b[i] = b[i-1];\n b[i-1] = temp;\n break;\n }\n }\n }\n\n\n return b;\n\n\n\n\n\n }", "private static <T,P> void sort1(T x[], int[] a2, Comparator<T> comp, int off, int len) {\n\t\t// Insertion sort on smallest arrays\n\t\tif (len < 7) {\n\t\t\tfor (int i=off; i<len+off; i++)\n\t\t\t\tfor (int j=i; j>off && comp.compare(x[j-1],x[j])>0; j--)\n\t\t\t\t\tswap(x, a2, j, j-1);\n\t\t\treturn;\n\t\t}\n\n\t\t// Choose a partition element, v\n\t\tint m = off + (len >> 1); // Small arrays, middle element\n\t\tif (len > 7) {\n\t\t\tint l = off;\n\t\t\tint n = off + len - 1;\n\t\t\tif (len > 40) { // Big arrays, pseudomedian of 9\n\t\t\t\tint s = len/8;\n\t\t\t\tl = med3(x,comp, l, l+s, l+2*s);\n\t\t\t\tm = med3(x,comp, m-s, m, m+s);\n\t\t\t\tn = med3(x,comp, n-2*s, n-s, n);\n\t\t\t}\n\t\t\tm = med3(x,comp, l, m, n); // Mid-size, med of 3\n\t\t}\n\t\tT v = x[m];\n\n\t\t// Establish Invariant: v* (<v)* (>v)* v*\n\t\tint a = off, b = a, c = off + len - 1, d = c;\n\t\twhile(true) {\n\t\t\twhile (b <= c && comp.compare(x[b],v)<=0) {\n\t\t\t\tif (x[b] == v)\n\t\t\t\t\tswap(x,a2, a++, b);\n\t\t\t\tb++;\n\t\t\t}\n\t\t\twhile (c >= b && comp.compare(x[c],v)>=0) {\n\t\t\t\tif (x[c] == v)\n\t\t\t\t\tswap(x,a2, c, d--);\n\t\t\t\tc--;\n\t\t\t}\n\t\t\tif (b > c)\n\t\t\t\tbreak;\n\t\t\tswap(x,a2, b++, c--);\n\t\t}\n\n\t\t// Swap partition elements back to middle\n\t\tint s, n = off + len;\n\t\ts = Math.min(a-off, b-a ); vecswap(x,a2, off, b-s, s);\n\t\ts = Math.min(d-c, n-d-1); vecswap(x,a2, b, n-s, s);\n\n\t\t// Recursively sort non-partition-elements\n\t\tif ((s = b-a) > 1)\n\t\t\tsort1(x,a2,comp, off, s);\n\t\tif ((s = d-c) > 1)\n\t\t\tsort1(x,a2,comp, n-s, s);\n\t}", "private static ArrayList<Integer> mergKsort(int[][] arr) {\n\t\tArrayList<Integer> rv = new ArrayList<>();\r\n\t\tPriorityQueue<Pair> pq= new PriorityQueue<>();\r\n\t\t\t\t\r\n\t\tfor (int i=0;i<arr.length;i++) {\r\n\t\tPair p = new Pair(i,0,arr[i][0]);\r\n\t\t\tpq.add(p);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\twhile(pq.size()>0) {\r\n\t\t\tPair p=pq.remove();\r\n\t\t\trv.add(p.val);\r\n\t\t\tp.di++;\r\n\t\t\tif(p.di<arr[p.li].length) {\r\n\t\t\t\tp.val=arr[p.li][p.di];\r\n\t\t\t\tpq.add(p);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn rv;\r\n\r\n\t}", "static void minimumBribes(int[] q) {\n int swaps = 0;\n for (int i = 0; i < q.length; i++) {\n if ((q[i] - (i+1)) > 2) {\n System.out.println(\"Too chaotic\");\n return;\n }\n for (int j = i + 1; j < q.length; j++) {\n if (q[i] > q[j]) {\n int t = q[j];\n q[j] = q[i];\n q[i] = t;\n swaps++;\n }\n }\n }\n\n System.out.println(swaps);\n }", "private static <T,P> void sort1(T x[], P[] a2, Comparator<T> comp, int off, int len) {\n\t\t// Insertion sort on smallest arrays\n\t\tif (len < 7) {\n\t\t\tfor (int i=off; i<len+off; i++)\n\t\t\t\tfor (int j=i; j>off && comp.compare(x[j-1],x[j])>0; j--)\n\t\t\t\t\tswap(x, a2, j, j-1);\n\t\t\treturn;\n\t\t}\n\n\t\t// Choose a partition element, v\n\t\tint m = off + (len >> 1); // Small arrays, middle element\n\t\tif (len > 7) {\n\t\t\tint l = off;\n\t\t\tint n = off + len - 1;\n\t\t\tif (len > 40) { // Big arrays, pseudomedian of 9\n\t\t\t\tint s = len/8;\n\t\t\t\tl = med3(x,comp, l, l+s, l+2*s);\n\t\t\t\tm = med3(x,comp, m-s, m, m+s);\n\t\t\t\tn = med3(x,comp, n-2*s, n-s, n);\n\t\t\t}\n\t\t\tm = med3(x,comp, l, m, n); // Mid-size, med of 3\n\t\t}\n\t\tT v = x[m];\n\n\t\t// Establish Invariant: v* (<v)* (>v)* v*\n\t\tint a = off, b = a, c = off + len - 1, d = c;\n\t\twhile(true) {\n\t\t\twhile (b <= c && comp.compare(x[b],v)<=0) {\n\t\t\t\tif (x[b] == v)\n\t\t\t\t\tswap(x,a2, a++, b);\n\t\t\t\tb++;\n\t\t\t}\n\t\t\twhile (c >= b && comp.compare(x[c],v)>=0) {\n\t\t\t\tif (x[c] == v)\n\t\t\t\t\tswap(x,a2, c, d--);\n\t\t\t\tc--;\n\t\t\t}\n\t\t\tif (b > c)\n\t\t\t\tbreak;\n\t\t\tswap(x,a2, b++, c--);\n\t\t}\n\n\t\t// Swap partition elements back to middle\n\t\tint s, n = off + len;\n\t\ts = Math.min(a-off, b-a ); vecswap(x,a2, off, b-s, s);\n\t\ts = Math.min(d-c, n-d-1); vecswap(x,a2, b, n-s, s);\n\n\t\t// Recursively sort non-partition-elements\n\t\tif ((s = b-a) > 1)\n\t\t\tsort1(x,a2,comp, off, s);\n\t\tif ((s = d-c) > 1)\n\t\t\tsort1(x,a2,comp, n-s, s);\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Counting Sort\\n\");\n\t\t\n\t\tint [] A = {14, 10, 13, 4, 7, 9, 3, 5, 3, 5};\n\t\tint [] B = new int [A.length + 1];\n\t\t\n\t\t//Gets the highest number in the array\n\t\tint k = 0;\n\t\tfor(int i = 0 ; i < A.length ; i++){\n\t\t\tif(A[i] > k)\n\t\t\t\tk = A[i];\n\t\t}\n\t\t\n\t\tCountingSort(A, B, k);\n\t\t/*\t\t\t\tCounting Sort Algorithm Starts Here\t\t\t*/\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"\\n\");\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t/*\t\t\t\tBucket Sort Algorithm Starts Here\t\t\t*/\n\t\tint [] NewA = {14, 10, 13, 4, 7, 9, 3, 5};\n\t\t\n\t\t\n\t\t\n\t\tBucketSort(NewA);\n\t\t\n\t\t/*\t\t\t\tBucket Sort Algorithm Ends Here\t\t\t\t*/\n\t}", "private static int[] computeBucketSizes(int size) {\n\t\tint numBuckets = 2;\n\t\tint bucketSize = 3 * BASE_SIZE / 4;\n\t\tint sizeInBuckets = 2 * bucketSize;\n\t\twhile (sizeInBuckets < size) {\n\t\t\tbucketSize *= FACTOR;\n\t\t\tsizeInBuckets += 2 * bucketSize;\n\t\t\tnumBuckets += 2;\n\t\t}\n\t\tnumBuckets--;\n\t\tint[] bucketSizes = new int[numBuckets];\n\t\tbucketSize = BASE_SIZE;\n\t\tint rest = size;\n\t\tint i = 0, j = numBuckets - 1;\n\t\twhile (i < j) {\n\t\t\tbucketSizes[i] = bucketSize / 2;\n\t\t\tbucketSizes[j] = bucketSize / 2;\n\t\t\trest -= bucketSizes[i] + bucketSizes[j];\n\t\t\tbucketSize *= FACTOR;\n\t\t\ti++;\n\t\t\tj--;\n\t\t}\n\t\tbucketSizes[i] = rest;\n\n\t\treturn bucketSizes;\n\t}", "public void sortMatches();", "public static Integer[] bucketize(Integer[] V, RadixSorting z, int place)\n\t{int getDigit; //Instance variable getDigit of type int to be used\n\t Integer num; //Instance variable num of type Integer to be used\n\t for(int i = 0; i < V.length; i++)\n\t {//Inv: elements in V[0..V[i]] are bucketized && i = V.length \n\t\t num = V[i]; //num is assigned to index of V\n\t\t getDigit = getDigit(num, place); //getDigit is assigned to getDigit function\n\t //Inv: elements in V[0..V[i]-1] are bucketized && i < V.length\t \n\t\tz.addTo(num, getDigit + 9);\n\t\t//Inv: elements in V[0..V[i]] are bucketized && i = V.length\n\t }\n\t return (V);\n\t //Termination: the loop begins at 0 and increments every time by 1 until if finally reaches \n\t //the length of the array and it finally terminates. \n\t }", "public void wiggleSortSubOptimal(int[] nums) {\n Arrays.sort(nums);\n \n for (int i = 1; i < nums.length - 1; i += 2)\n swap(nums, i, i + 1);\n }", "public boolean makePair(int [] a, int [] b, int k) {\n\t\t\n\t\tif(a==null||b==null||a.length==0||b.length==0) return true;\n\t\t\n\t\tfor(int i=0; i<a.length; i++) {\n\t\t\ta[i] = k-a[i];\t\n\t\t}\n\t\tArrays.sort(a);\n\t\tArrays.sort(b);\n\t\tboolean res = true;\n\t\t\n\t\t//add optimization\n\t\tif(a[a.length-1]<=b[0]) return res;\n\t\t\n\t\tfor(int j=0; j<a.length; j++) {\n\t\t\tif(a[j]>b[j]) {\n\t\t\t\tres = false;\n\t\t\t\tbreak; \n\t\t\t}\n\t\t}\n\t\treturn(res);\n\n\t}", "public void radixSorting() {\n\t\t\n\t}", "private PerfectMergeSort() {}", "private void sort()\n {\n // This implements Shell sort.\n // Unfortunately we cannot use the sorting functions from the library\n // (e.g. java.util.Arrays.sort), since the ones that work on int\n // arrays do not accept a comparison function, but only allow\n // sorting into natural order.\n int jump = length;\n boolean done;\n \n while( jump>1 ){\n jump /= 2;\n \n do {\n done = true;\n \n for( int j = 0; j<(length-jump); j++ ){\n int i = j + jump;\n \n if( !areCorrectlyOrdered( indices[j], indices[i] ) ){\n // Things are in the wrong order, swap them and step back.\n int tmp = indices[i];\n indices[i] = indices[j];\n indices[j] = tmp;\n done = false;\n }\n }\n } while( !done );\n }\n \n // TODO: integrate this with the stuff above.\n for( int i=1; i<length; i++ ){\n commonality[i] = commonLength( indices[i-1], indices[i] );\n }\n commonality[0] = -1;\n }", "public static Integer[] sort(Integer[] X)\n\t{RadixSorting z = new RadixSorting(); //Where elements will be stored from array \n\t int place = 0;\n\t//maxIndex is assigned to numberLength function\n\t int maxIndex = numberLength(findMax(X ,0, X.length-1), 1); \n while (!(place > maxIndex))\n { //Inv: elements in X[0..X.length-1] are sorted && place<maxIndex \n \tbucketize(X, z, place);\n \t//Inv: elements in X[0..length-1]-1 are sorted and place>maxIndex\n debucketize(X);\n //Inv:elements in X[0..length-1] are sorted and place>maxIndex\n place = place + 1; \n //Inv: elements in X[0..X.length-1] are sorted && place<maxIndex \n } \n return (X); \n //Termination: place starts at 0. It is looped every time until finally place will be smaller\n //than maxIndex in which it will then terminate. \n\t}", "private static void sort2(int[] a) {\n for(int i=0; i<a.length; i++){\n //find smallest from i to end \n int minIndex=i;\n for(int j=i ; j<a.length; j++)\n if(a[j]<a[minIndex])\n minIndex=j;\n //swap\n int t = a[i];\n a[i] = a[minIndex];\n a[minIndex] = t;\n }\n }", "private static <T> void sort1(double x[], T[] a2, int off, int len) {\n\t\t// Insertion sort on smallest arrays\n\t\tif (len < 7) {\n\t\t\tfor (int i=off; i<len+off; i++)\n\t\t\t\tfor (int j=i; j>off && x[j-1]>x[j]; j--)\n\t\t\t\t\tswap(x,a2, j, j-1);\n\t\t\treturn;\n\t\t}\n\n\t\t// Choose a partition element, v\n\t\tint m = off + (len >> 1); // Small arrays, middle element\n\t\tif (len > 7) {\n\t\t\tint l = off;\n\t\t\tint n = off + len - 1;\n\t\t\tif (len > 40) { // Big arrays, pseudomedian of 9\n\t\t\t\tint s = len/8;\n\t\t\t\tl = med3(x, l, l+s, l+2*s);\n\t\t\t\tm = med3(x, m-s, m, m+s);\n\t\t\t\tn = med3(x, n-2*s, n-s, n);\n\t\t\t}\n\t\t\tm = med3(x, l, m, n); // Mid-size, med of 3\n\t\t}\n\t\tdouble v = x[m];\n\n\t\t// Establish Invariant: v* (<v)* (>v)* v*\n\t\tint a = off, b = a, c = off + len - 1, d = c;\n\t\twhile(true) {\n\t\t\twhile (b <= c && x[b] <= v) {\n\t\t\t\tif (x[b] == v)\n\t\t\t\t\tswap(x,a2, a++, b);\n\t\t\t\tb++;\n\t\t\t}\n\t\t\twhile (c >= b && x[c] >= v) {\n\t\t\t\tif (x[c] == v)\n\t\t\t\t\tswap(x,a2, c, d--);\n\t\t\t\tc--;\n\t\t\t}\n\t\t\tif (b > c)\n\t\t\t\tbreak;\n\t\t\tswap(x,a2, b++, c--);\n\t\t}\n\n\t\t// Swap partition elements back to middle\n\t\tint s, n = off + len;\n\t\ts = Math.min(a-off, b-a ); vecswap(x, a2,off, b-s, s);\n\t\ts = Math.min(d-c, n-d-1); vecswap(x, a2,b, n-s, s);\n\n\t\t// Recursively sort non-partition-elements\n\t\tif ((s = b-a) > 1)\n\t\t\tsort1(x,a2, off, s);\n\t\tif ((s = d-c) > 1)\n\t\t\tsort1(x,a2, n-s, s);\n\t}", "@Override\n public void sort(T[] array, int beginIndex, int endIndex)\n {\n for (int i=beginIndex; i<endIndex; i++)\n buckets.get(getBucketIndex(array[i])).add(array[i]);\n\n // spit out all bucket elements and reassign array elements\n for (List<T> bucket : buckets)\n {\n // sort each bucket if b_sort == true\n if (sort_bucket) bucket.sort(comparator);\n for (T key : bucket) array[beginIndex++] = key;\n bucket.clear();\n }\n }", "private int getIndex2(int val){\n return val/bucket;\n }", "private static <T> void sort1(float x[], T[] a2, int off, int len) {\n\t\t// Insertion sort on smallest arrays\n\t\tif (len < 7) {\n\t\t\tfor (int i=off; i<len+off; i++)\n\t\t\t\tfor (int j=i; j>off && x[j-1]>x[j]; j--)\n\t\t\t\t\tswap(x, a2,j, j-1);\n\t\t\treturn;\n\t\t}\n\n\t\t// Choose a partition element, v\n\t\tint m = off + (len >> 1); // Small arrays, middle element\n\t\tif (len > 7) {\n\t\t\tint l = off;\n\t\t\tint n = off + len - 1;\n\t\t\tif (len > 40) { // Big arrays, pseudomedian of 9\n\t\t\t\tint s = len/8;\n\t\t\t\tl = med3(x, l, l+s, l+2*s);\n\t\t\t\tm = med3(x, m-s, m, m+s);\n\t\t\t\tn = med3(x, n-2*s, n-s, n);\n\t\t\t}\n\t\t\tm = med3(x, l, m, n); // Mid-size, med of 3\n\t\t}\n\t\tfloat v = x[m];\n\n\t\t// Establish Invariant: v* (<v)* (>v)* v*\n\t\tint a = off, b = a, c = off + len - 1, d = c;\n\t\twhile(true) {\n\t\t\twhile (b <= c && x[b] <= v) {\n\t\t\t\tif (x[b] == v)\n\t\t\t\t\tswap(x,a2, a++, b);\n\t\t\t\tb++;\n\t\t\t}\n\t\t\twhile (c >= b && x[c] >= v) {\n\t\t\t\tif (x[c] == v)\n\t\t\t\t\tswap(x,a2, c, d--);\n\t\t\t\tc--;\n\t\t\t}\n\t\t\tif (b > c)\n\t\t\t\tbreak;\n\t\t\tswap(x, a2,b++, c--);\n\t\t}\n\n\t\t// Swap partition elements back to middle\n\t\tint s, n = off + len;\n\t\ts = Math.min(a-off, b-a ); vecswap(x,a2, off, b-s, s);\n\t\ts = Math.min(d-c, n-d-1); vecswap(x,a2, b, n-s, s);\n\n\t\t// Recursively sort non-partition-elements\n\t\tif ((s = b-a) > 1)\n\t\t\tsort1(x,a2, off, s);\n\t\tif ((s = d-c) > 1)\n\t\t\tsort1(x,a2, n-s, s);\n\t}", "private static <T> void quickSort(@Nonnull List<T> x, @Nonnull Comparator<? super T> comparator, int off, int len) {\n if (len < 7) {\n for (int i = off; i < len + off; i++) {\n for (int j = i; j > off && comparator.compare(x.get(j), x.get(j - 1)) < 0; j--) {\n swapElements(x, j, j - 1);\n }\n }\n return;\n }\n\n // Choose a partition element, v\n int m = off + (len >> 1); // Small arrays, middle element\n if (len > 7) {\n int l = off;\n int n = off + len - 1;\n if (len > 40) { // Big arrays, pseudomedian of 9\n int s = len / 8;\n l = med3(x, comparator, l, l + s, l + 2 * s);\n m = med3(x, comparator, m - s, m, m + s);\n n = med3(x, comparator, n - 2 * s, n - s, n);\n }\n m = med3(x, comparator, l, m, n); // Mid-size, med of 3\n }\n T v = x.get(m);\n\n // Establish Invariant: v* (<v)* (>v)* v*\n int a = off;\n int b = a;\n int c = off + len - 1;\n int d = c;\n while (true) {\n while (b <= c && comparator.compare(x.get(b), v) <= 0) {\n if (comparator.compare(x.get(b), v) == 0) {\n swapElements(x, a++, b);\n }\n b++;\n }\n while (c >= b && comparator.compare(v, x.get(c)) <= 0) {\n if (comparator.compare(x.get(c), v) == 0) {\n swapElements(x, c, d--);\n }\n c--;\n }\n if (b > c) break;\n swapElements(x, b++, c--);\n }\n\n // Swap partition elements back to middle\n int n = off + len;\n int s = Math.min(a - off, b - a);\n vecswap(x, off, b - s, s);\n s = Math.min(d - c, n - d - 1);\n vecswap(x, b, n - s, s);\n\n // Recursively sort non-partition-elements\n if ((s = b - a) > 1) quickSort(x, comparator, off, s);\n if ((s = d - c) > 1) quickSort(x, comparator, n - s, s);\n }", "public ArrayList<URL> insertionSort(ArrayList<URL> bucket) {\n\t\tfor(int j=1;j<bucket.size();j++) {\n\t\t\tURL key = bucket.get(j);\n\t\t\tint i = j-1;\n\t\t\twhile(i>=0 && bucket.get(i).getUrl().compareTo(key.getUrl())>0) {\n\t\t\t\tbucket.set(i+1, bucket.get(i));\n\t\t\t\ti --;\n\t\t\t}\n\t\t\tbucket.set(i+1, key);\n\t\t}\n\t\treturn bucket;\n\t}", "public void sort() {\n ListNode start = head;\n ListNode position1;\n ListNode position2;\n\n // Going through each element of the array from the second element to the end\n while (start.next != null) {\n start = start.next;\n position1 = start;\n position2 = position1.previous;\n // Checks if previous is null and keeps swapping elements backwards till there\n // is an element that is bigger than the original element\n while (position2 != null && (position1.data < position2.data)) {\n swap(position1, position2);\n numberComparisons++;\n position1 = position2;\n position2 = position1.previous;\n }\n }\n }", "private static <T> void sort1(char x[], char[] a2, int off, int len) {\n\t\t// Insertion sort on smallest arrays\n\t\tif (len < 7) {\n\t\t\tfor (int i=off; i<len+off; i++)\n\t\t\t\tfor (int j=i; j>off && x[j-1]>x[j]; j--)\n\t\t\t\t\tswap(x,a2, j, j-1);\n\t\t\treturn;\n\t\t}\n\n\t\t// Choose a partition element, v\n\t\tint m = off + (len >> 1); // Small arrays, middle element\n\t\tif (len > 7) {\n\t\t\tint l = off;\n\t\t\tint n = off + len - 1;\n\t\t\tif (len > 40) { // Big arrays, pseudomedian of 9\n\t\t\t\tint s = len/8;\n\t\t\t\tl = med3(x, l, l+s, l+2*s);\n\t\t\t\tm = med3(x, m-s, m, m+s);\n\t\t\t\tn = med3(x, n-2*s, n-s, n);\n\t\t\t}\n\t\t\tm = med3(x, l, m, n); // Mid-size, med of 3\n\t\t}\n\t\tchar v = x[m];\n\n\t\t// Establish Invariant: v* (<v)* (>v)* v*\n\t\tint a = off, b = a, c = off + len - 1, d = c;\n\t\twhile(true) {\n\t\t\twhile (b <= c && x[b] <= v) {\n\t\t\t\tif (x[b] == v)\n\t\t\t\t\tswap(x,a2, a++, b);\n\t\t\t\tb++;\n\t\t\t}\n\t\t\twhile (c >= b && x[c] >= v) {\n\t\t\t\tif (x[c] == v)\n\t\t\t\t\tswap(x,a2, c, d--);\n\t\t\t\tc--;\n\t\t\t}\n\t\t\tif (b > c)\n\t\t\t\tbreak;\n\t\t\tswap(x,a2, b++, c--);\n\t\t}\n\n\t\t// Swap partition elements back to middle\n\t\tint s, n = off + len;\n\t\ts = Math.min(a-off, b-a ); vecswap(x, a2,off, b-s, s);\n\t\ts = Math.min(d-c, n-d-1); vecswap(x, a2,b, n-s, s);\n\n\t\t// Recursively sort non-partition-elements\n\t\tif ((s = b-a) > 1)\n\t\t\tsort1(x,a2, off, s);\n\t\tif ((s = d-c) > 1)\n\t\t\tsort1(x,a2, n-s, s);\n\t}", "private static <T> void sort1(int x[], T[] a2, int off, int len) {\n\t\t// Insertion sort on smallest arrays\n\t\tif (len < 7) {\n\t\t\tfor (int i=off; i<len+off; i++)\n\t\t\t\tfor (int j=i; j>off && x[j-1]>x[j]; j--)\n\t\t\t\t\tswap(x, a2, j, j-1);\n\t\t\treturn;\n\t\t}\n\n\t\t// Choose a partition element, v\n\t\tint m = off + (len >> 1); // Small arrays, middle element\n\t\tif (len > 7) {\n\t\t\tint l = off;\n\t\t\tint n = off + len - 1;\n\t\t\tif (len > 40) { // Big arrays, pseudomedian of 9\n\t\t\t\tint s = len/8;\n\t\t\t\tl = med3(x, l, l+s, l+2*s);\n\t\t\t\tm = med3(x, m-s, m, m+s);\n\t\t\t\tn = med3(x, n-2*s, n-s, n);\n\t\t\t}\n\t\t\tm = med3(x, l, m, n); // Mid-size, med of 3\n\t\t}\n\t\tint v = x[m];\n\n\t\t// Establish Invariant: v* (<v)* (>v)* v*\n\t\tint a = off, b = a, c = off + len - 1, d = c;\n\t\twhile(true) {\n\t\t\twhile (b <= c && x[b] <= v) {\n\t\t\t\tif (x[b] == v)\n\t\t\t\t\tswap(x,a2,a++, b);\n\t\t\t\tb++;\n\t\t\t}\n\t\t\twhile (c >= b && x[c] >= v) {\n\t\t\t\tif (x[c] == v)\n\t\t\t\t\tswap(x, a2,c, d--);\n\t\t\t\tc--;\n\t\t\t}\n\t\t\tif (b > c)\n\t\t\t\tbreak;\n\t\t\tswap(x,a2, b++, c--);\n\t\t}\n\n\t\t// Swap partition elements back to middle\n\t\tint s, n = off + len;\n\t\ts = Math.min(a-off, b-a ); vecswap(x,a2, off, b-s, s);\n\t\ts = Math.min(d-c, n-d-1); vecswap(x,a2, b, n-s, s);\n\n\t\t// Recursively sort non-partition-elements\n\t\tif ((s = b-a) > 1)\n\t\t\tsort1(x, a2,off, s);\n\t\tif ((s = d-c) > 1)\n\t\t\tsort1(x, a2,n-s, s);\n\t}", "private int[] sort(int arr[]) {\r\n\t\tint n = arr.length;\r\n\r\n\t\tif (n == 1) { // base case\r\n\t\t\treturn arr;\r\n\t\t}\r\n\t\t// divide\r\n\t\tint[] arrL = Arrays.copyOfRange(arr, 0, (n / 2));\r\n\t\tint[] arrR = Arrays.copyOfRange(arr, (n / 2), (n));\r\n\t\t// and conquer\r\n\t\treturn merge(sort(arrL), sort(arrR));\r\n\t}", "public static void main(String[] args) throws FileNotFoundException{\n int[] quicktimes1 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes1[i] = (int)endTime;\n }\n \n int[] mergetimes1 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes1[i] = (int)endTime;\n }\n \n int[] heaptimes1 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes1[i] = (int)endTime;\n }\n \n int[] quicktimes2 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[i] = j;\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes2[i] = (int)endTime;\n }\n \n int[] mergetimes2 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes2[i] = (int)endTime;\n }\n \n int[] heaptimes2 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes2[i] = (int)endTime;\n }\n \n int[] quicktimes3 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes3[i] = (int)endTime;\n }\n \n int[] mergetimes3 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes3[i] = (int)endTime;\n }\n \n int[] heaptimes3 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes3[i] = (int)endTime;\n }\n \n int[] quicktimes4 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes4[i] = (int)endTime;\n }\n \n int[] mergetimes4 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes4[i] = (int)endTime;\n }\n \n int[] heaptimes4 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes4[i] = (int)endTime;\n }\n \n \n //THESE WILL GENERATE THE MERGE/HEAP/QUICK SORT FOR THE REVERSE SORTED ARRAYS OF VARIOUS LENGTHS\n int[] quicktimes5 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes5[i] = (int)endTime;\n }\n \n int[] mergetimes5 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes5[i] = (int)endTime;\n }\n \n int[] heaptimes5 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes5[i] = (int)endTime;\n }\n \n int[] quicktimes6 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes6[i] = (int)endTime;\n }\n \n int[] mergetimes6 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes6[i] = (int)endTime;\n }\n \n int[] heaptimes6 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes6[i] = (int)endTime;\n }\n \n int[] quicktimes7 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes7[i] = (int)endTime;\n }\n \n int[] mergetimes7 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes7[i] = (int)endTime;\n }\n \n int[] heaptimes7 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes7[i] = (int)endTime;\n }\n \n int[] quicktimes8 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes8[i] = (int)endTime;\n }\n \n int[] mergetimes8 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes8[i] = (int)endTime;\n }\n \n int[] heaptimes8 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes8[i] = (int)endTime;\n }\n \n //THESE WILL GENERATE THE MERGE/HEAP/QUICK SORT FOR THE RANDOM ARRAYS OF VARIOUS LENGTHS\n int[] quicktimes9 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999);\n long startTime = System.nanoTime();\n Sorting.quickSort(rarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes9[i] = (int)endTime;\n }\n \n int[] mergetimes9 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999);\n long startTime = System.nanoTime();\n Sorting.mergeSort(rarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes9[i] = (int)endTime;\n }\n \n int[] heaptimes9 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999);\n long startTime = System.nanoTime();\n Sorting.heapSort(rarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes9[i] = (int)endTime;\n }\n \n int[] quicktimes10 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[10000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(9999);\n long startTime = System.nanoTime();\n Sorting.quickSort(rarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes10[i] = (int)endTime;\n }\n \n int[] mergetimes10 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[10000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(9999);\n long startTime = System.nanoTime();\n Sorting.mergeSort(rarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes10[i] = (int)endTime;\n }\n \n int[] heaptimes10 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[10000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(9999);\n long startTime = System.nanoTime();\n Sorting.heapSort(rarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes10[i] = (int)endTime;\n }\n \n int[] quicktimes11 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[100000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(99999);\n long startTime = System.nanoTime();\n Sorting.quickSort(rarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes11[i] = (int)endTime;\n }\n \n int[] mergetimes11 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[100000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(99999);\n long startTime = System.nanoTime();\n Sorting.mergeSort(rarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes11[i] = (int)endTime;\n }\n \n int[] heaptimes11 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[100000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(99999);;\n long startTime = System.nanoTime();\n Sorting.heapSort(rarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes11[i] = (int)endTime;\n }\n \n int[] quicktimes12 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999999);\n long startTime = System.nanoTime();\n Sorting.quickSort(rarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes12[i] = (int)endTime;\n }\n \n int[] mergetimes12 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999999);\n long startTime = System.nanoTime();\n Sorting.mergeSort(rarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes12[i] = (int)endTime;\n }\n \n int[] heaptimes12 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999999);\n long startTime = System.nanoTime();\n Sorting.heapSort(rarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes12[i] = (int)endTime;\n }\n \n //PRINTING THE RESULTS OUT INTO FILE\n File f = new File(\"Results.txt\");\n FileOutputStream fos = new FileOutputStream(f);\n PrintWriter pw = new PrintWriter(fos);\n pw.println(\"SORTED ARRAYS TIMES:\");\n pw.printf(\"1000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes1), medVal(quicktimes1), varVal(quicktimes1, meanVal(quicktimes1)));\n pw.printf(\"10000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes2), medVal(quicktimes2), varVal(quicktimes2, meanVal(quicktimes2)));\n pw.printf(\"100000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes3), medVal(quicktimes3), varVal(quicktimes3, meanVal(quicktimes3)));\n pw.printf(\"1000000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes4), medVal(quicktimes4), varVal(quicktimes4, meanVal(quicktimes4)));\n pw.printf(\"1000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes1), medVal(mergetimes1), varVal(mergetimes1, meanVal(mergetimes1)));\n pw.printf(\"10000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes2), medVal(mergetimes2), varVal(mergetimes2, meanVal(mergetimes2)));\n pw.printf(\"100000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes3), medVal(mergetimes3), varVal(mergetimes3, meanVal(mergetimes3)));\n pw.printf(\"1000000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes4), medVal(mergetimes4), varVal(mergetimes4, meanVal(mergetimes4)));\n pw.printf(\"1000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes1), medVal(heaptimes1), varVal(heaptimes1, meanVal(heaptimes1)));\n pw.printf(\"10000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes2), medVal(heaptimes2), varVal(heaptimes2, meanVal(heaptimes2)));\n pw.printf(\"100000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes3), medVal(heaptimes3), varVal(heaptimes3, meanVal(heaptimes3)));\n pw.printf(\"1000000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes4), medVal(heaptimes4), varVal(heaptimes4, meanVal(heaptimes4)));\n pw.println(\"REVERSE SORTED ARRAYS TIMES:\");\n pw.printf(\"1000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes5), medVal(quicktimes5), varVal(quicktimes5, meanVal(quicktimes5)));\n pw.printf(\"10000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes6), medVal(quicktimes6), varVal(quicktimes6, meanVal(quicktimes6)));\n pw.printf(\"100000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes7), medVal(quicktimes7), varVal(quicktimes7, meanVal(quicktimes7)));\n pw.printf(\"1000000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes8), medVal(quicktimes8), varVal(quicktimes8, meanVal(quicktimes8)));\n pw.printf(\"1000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes5), medVal(mergetimes5), varVal(mergetimes5, meanVal(mergetimes5)));\n pw.printf(\"10000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes6), medVal(mergetimes6), varVal(mergetimes6, meanVal(mergetimes6)));\n pw.printf(\"100000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes7), medVal(mergetimes7), varVal(mergetimes7, meanVal(mergetimes7)));\n pw.printf(\"1000000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes8), medVal(mergetimes8), varVal(mergetimes8, meanVal(mergetimes8)));\n pw.printf(\"1000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes5), medVal(heaptimes5), varVal(heaptimes5, meanVal(heaptimes5)));\n pw.printf(\"10000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes6), medVal(heaptimes6), varVal(heaptimes6, meanVal(heaptimes6)));\n pw.printf(\"100000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes7), medVal(heaptimes7), varVal(heaptimes7, meanVal(heaptimes7)));\n pw.printf(\"1000000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes8), medVal(heaptimes8), varVal(heaptimes8, meanVal(heaptimes8)));\n pw.println(\"RANDOM ARRAYS TIMES:\");\n pw.printf(\"1000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes9), medVal(quicktimes9), varVal(quicktimes9, meanVal(quicktimes9)));\n pw.printf(\"10000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes10), medVal(quicktimes10), varVal(quicktimes10, meanVal(quicktimes10)));\n pw.printf(\"100000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes11), medVal(quicktimes11), varVal(quicktimes11, meanVal(quicktimes11)));\n pw.printf(\"1000000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes12), medVal(quicktimes12), varVal(quicktimes12, meanVal(quicktimes12)));\n pw.printf(\"1000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes9), medVal(mergetimes9), varVal(mergetimes9, meanVal(mergetimes9)));\n pw.printf(\"10000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes10), medVal(mergetimes10), varVal(mergetimes10, meanVal(mergetimes10)));\n pw.printf(\"100000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes11), medVal(mergetimes11), varVal(mergetimes11, meanVal(mergetimes11)));\n pw.printf(\"1000000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes12), medVal(mergetimes12), varVal(mergetimes12, meanVal(mergetimes12)));\n pw.printf(\"1000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes9), medVal(heaptimes9), varVal(heaptimes9, meanVal(heaptimes9)));\n pw.printf(\"10000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes10), medVal(heaptimes10), varVal(heaptimes10, meanVal(heaptimes10)));\n pw.printf(\"100000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes11), medVal(heaptimes11), varVal(heaptimes11, meanVal(heaptimes11)));\n pw.printf(\"1000000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes12), medVal(heaptimes12), varVal(heaptimes12, meanVal(heaptimes12)));\n pw.close();\n }", "@Override\r\n\tpublic void sort() {\r\n\t\tint minpos;\r\n\t\tfor (int i = 0; i < elements.length-1; i++) {\r\n\t\t\tminpos=AuxMethods.minPos(elements, i);\r\n\t\t\telements=AuxMethods.swapElements(elements, i, minpos);\r\n\t\t\t\r\n\t\t}\r\n\t}", "private void sort(Metric metr, DoubleData dObj, DoubleData[] dObjects, int left, int right)\n {\n int p = left + RANDOM_GENERATOR.nextInt(right-left+1);\n DoubleData tmpObj = dObjects[right];\n dObjects[right] = dObjects[p];\n dObjects[p] = tmpObj;\n int l = left, r = right - 1;\n double dist = metr.dist(dObjects[right], dObj);\n while (l < r)\n if (dist >= metr.dist(dObjects[l], dObj)) l++;\n else if (dist < metr.dist(dObjects[r], dObj)) r--;\n else\n {\n tmpObj = dObjects[l];\n dObjects[l] = dObjects[r];\n dObjects[r] = tmpObj;\n l++;\n if (l < r) r--;\n }\n if (dist < metr.dist(dObjects[l], dObj))\n {\n tmpObj = dObjects[l];\n dObjects[l] = dObjects[right];\n dObjects[right] = tmpObj;\n }\n if (left < l) sort(metr, dObj, dObjects, left, l);\n if (l + 1 < right) sort(metr, dObj, dObjects, l + 1, right);\n }", "private static <T> void sort1(short x[], T[] a2, int off, int len) {\n\t\t// Insertion sort on smallest arrays\n\t\tif (len < 7) {\n\t\t\tfor (int i=off; i<len+off; i++)\n\t\t\t\tfor (int j=i; j>off && x[j-1]>x[j]; j--)\n\t\t\t\t\tswap(x, a2,j, j-1);\n\t\t\treturn;\n\t\t}\n\n\t\t// Choose a partition element, v\n\t\tint m = off + (len >> 1); // Small arrays, middle element\n\t\tif (len > 7) {\n\t\t\tint l = off;\n\t\t\tint n = off + len - 1;\n\t\t\tif (len > 40) { // Big arrays, pseudomedian of 9\n\t\t\t\tint s = len/8;\n\t\t\t\tl = med3(x, l, l+s, l+2*s);\n\t\t\t\tm = med3(x, m-s, m, m+s);\n\t\t\t\tn = med3(x, n-2*s, n-s, n);\n\t\t\t}\n\t\t\tm = med3(x, l, m, n); // Mid-size, med of 3\n\t\t}\n\t\tshort v = x[m];\n\n\t\t// Establish Invariant: v* (<v)* (>v)* v*\n\t\tint a = off, b = a, c = off + len - 1, d = c;\n\t\twhile(true) {\n\t\t\twhile (b <= c && x[b] <= v) {\n\t\t\t\tif (x[b] == v)\n\t\t\t\t\tswap(x,a2, a++, b);\n\t\t\t\tb++;\n\t\t\t}\n\t\t\twhile (c >= b && x[c] >= v) {\n\t\t\t\tif (x[c] == v)\n\t\t\t\t\tswap(x, a2,c, d--);\n\t\t\t\tc--;\n\t\t\t}\n\t\t\tif (b > c)\n\t\t\t\tbreak;\n\t\t\tswap(x,a2, b++, c--);\n\t\t}\n\n\t\t// Swap partition elements back to middle\n\t\tint s, n = off + len;\n\t\ts = Math.min(a-off, b-a ); vecswap(x,a2, off, b-s, s);\n\t\ts = Math.min(d-c, n-d-1); vecswap(x,a2, b, n-s, s);\n\n\t\t// Recursively sort non-partition-elements\n\t\tif ((s = b-a) > 1)\n\t\t\tsort1(x, a2,off, s);\n\t\tif ((s = d-c) > 1)\n\t\t\tsort1(x, a2,n-s, s);\n\t}", "public static void Insertionsort(int a[]) \n\t { \n\t int n = a.length; \n\t for (int i=1; i<n; ++i) \n\t { \n\t int key = a[i]; \n\t int j = i-1;\n\t while (j>=0 && a[j] > key) \n\t { \n\t a[j+1] = a[j]; \n\t j = j-1; \n\t } \n\t a[j+1] = key; \n\t } \n\t }", "private static String testSorts(int[] arr) {\n\t\tint[] initial = arr.clone();\n\t\tdouble start;\n\t\tdouble[] heapTime = new double[10];\n\t\tdouble[] quickTime = new double[10];\n\t\tdouble[] mergeTime = new double[10];\n\t\t\n\t\tfor (int i=0; i < 10; i++){ //runs 10 times\n\t arr = initial.clone();\n\t\t\tstart = System.nanoTime();\n\t Sorting.heapSort(arr);\n\t heapTime[i] = System.nanoTime()-start;\n\t \n\t arr = initial.clone();\n\t\t\tstart = System.nanoTime();\n\t\t\tSorting.quickSort(arr); \n\t quickTime[i] = System.nanoTime()-start;\n\t \n\t arr = initial.clone();\n\t\t\tstart = System.nanoTime();\n\t\t\tSorting.mergeSort(arr); \n\t mergeTime[i] = System.nanoTime()-start;\n\t\t}\n\t\t\n\t double heapMean= meanVal(heapTime) ;\n\t double quickMean= meanVal(quickTime);\n\t double mergeMean= meanVal(mergeTime);\n\t \n\t String result = \"Means | HeapSort: \" +heapMean + \" QuickSort: \" + quickMean + \" MergeSort: \" + mergeMean + \"\\n\" + \n\t \"Variance| HeapSort: \"+ varianceVal(heapTime, heapMean)+ \" QuickSort: \" + varianceVal(quickTime, quickMean)+\n\t \" MergeSort: \" +varianceVal(mergeTime, mergeMean);\n\t \n\t return result;\n\t\t\n\t}", "public void radixSort() {\n int digits = String.valueOf(array[0]).length();\n for (int i = 1; i < array.length; i++) {\n if (String.valueOf(array[i]).length() > digits) {\n digits = String.valueOf(array[i]).length();\n }\n }\n int i = 1;\n while (i <= digits) {\n T[] bucket = (T[]) new Object[array.length];\n int j = 0;\n int k = 0;\n while (j < 10) {\n for (int l = 0; l < array.length; l++) {\n if ((int) array[l] % (int) (Math.pow(10, i)) / (int) (Math.pow(10, i - 1)) == j) {\n bucket[k] = array[l];\n k++;\n }\n }\n j++;\n }\n array = bucket;\n i++;\n }\n\n }", "public static int[] partialSort(int[] a) {\n for (int i = 0; i < 2; i++) {\n for (int j = 0; j < 2 - i; j++) {\n if (a[j] > a[j+1]) {\n int temp = a[j+1];\n a[j+1] = a[j];\n a[j] = temp;\n }\n }\n }\n return a;\n}", "public static int bccomp (String _left_operand , String _right_operand, int _scale) {\n//\t\treturn _left_operand.compareTo(_right_operand);\n\t\treturn ZendUtils.natsort(_left_operand, _right_operand);\n\t}", "private static void SortHash(HashMap<String,ArrayList<input>> hashMap,Distribution list)\n\t{\n\t\tCollections.sort(list.First, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Second, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Third, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Fourth, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Fifth, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.reverse(list.First);\n\t\tCollections.reverse(list.Second);\n\t\tCollections.reverse(list.Third);\n\t\tCollections.reverse(list.Fourth);\n\t\tCollections.reverse(list.Fifth);\n\t\tputInHashMap(hashMap,list);\n\t}", "private static <T> void sort1(char x[], T[] a2, int off, int len) {\n\t\t// Insertion sort on smallest arrays\n\t\tif (len < 7) {\n\t\t\tfor (int i=off; i<len+off; i++)\n\t\t\t\tfor (int j=i; j>off && x[j-1]>x[j]; j--)\n\t\t\t\t\tswap(x,a2, j, j-1);\n\t\t\treturn;\n\t\t}\n\n\t\t// Choose a partition element, v\n\t\tint m = off + (len >> 1); // Small arrays, middle element\n\t\tif (len > 7) {\n\t\t\tint l = off;\n\t\t\tint n = off + len - 1;\n\t\t\tif (len > 40) { // Big arrays, pseudomedian of 9\n\t\t\t\tint s = len/8;\n\t\t\t\tl = med3(x, l, l+s, l+2*s);\n\t\t\t\tm = med3(x, m-s, m, m+s);\n\t\t\t\tn = med3(x, n-2*s, n-s, n);\n\t\t\t}\n\t\t\tm = med3(x, l, m, n); // Mid-size, med of 3\n\t\t}\n\t\tchar v = x[m];\n\n\t\t// Establish Invariant: v* (<v)* (>v)* v*\n\t\tint a = off, b = a, c = off + len - 1, d = c;\n\t\twhile(true) {\n\t\t\twhile (b <= c && x[b] <= v) {\n\t\t\t\tif (x[b] == v)\n\t\t\t\t\tswap(x,a2, a++, b);\n\t\t\t\tb++;\n\t\t\t}\n\t\t\twhile (c >= b && x[c] >= v) {\n\t\t\t\tif (x[c] == v)\n\t\t\t\t\tswap(x,a2, c, d--);\n\t\t\t\tc--;\n\t\t\t}\n\t\t\tif (b > c)\n\t\t\t\tbreak;\n\t\t\tswap(x,a2, b++, c--);\n\t\t}\n\n\t\t// Swap partition elements back to middle\n\t\tint s, n = off + len;\n\t\ts = Math.min(a-off, b-a ); vecswap(x, a2,off, b-s, s);\n\t\ts = Math.min(d-c, n-d-1); vecswap(x, a2,b, n-s, s);\n\n\t\t// Recursively sort non-partition-elements\n\t\tif ((s = b-a) > 1)\n\t\t\tsort1(x,a2, off, s);\n\t\tif ((s = d-c) > 1)\n\t\t\tsort1(x,a2, n-s, s);\n\t}", "private void sortByWeight()\n\t{\n\t\tfor(int i=1; i<circles.size(); i++)\n\t\t{\n\t\t\tPVCircle temp = circles.get(i);\n\t\t\tint thisWeight = circles.get(i).getWeight();\n\t\t\tint j;\n\t\t\tfor(j=i-1; j>=0; j--)\n\t\t\t{\n\t\t\t\tint compWeight = circles.get(j).getWeight();\n\t\t\t\tif(thisWeight < compWeight)\n\t\t\t\t\tbreak;\n\t\t\t\telse\n\t\t\t\t\tcircles.set(j+1, circles.get(j));\n\t\t\t}\n\t\t\tcircles.set(j+1, temp);\n\t\t}\n\t\t\n\t}", "void sortV();", "private static void sort(Object[] a, Object[] tmp,\n int from, int to, Fun isLess) {\n int split = (from + to) / 2;\n if (split - from > 1)\n sort(tmp, a, from, split, isLess);\n if (to - split > 1)\n sort(tmp, a, split, to, isLess);\n int i = from, j = split;\n while (i < split && j < to) {\n if (isLess.apply(tmp[i], tmp[j]) == Boolean.TRUE)\n a[from] = tmp[i++];\n else\n a[from] = tmp[j++];\n ++from;\n }\n if (i < split)\n System.arraycopy(tmp, i, a, from, split - i);\n else if (j < to)\n System.arraycopy(tmp, j, a, from, to - j);\n }", "public void SortByPrice() {\n for (int i = 1; i < LastIndex; i++) {\n int x = i;\n while (x >= 1) {\n if (ForChild[x - 1].getPrice() > ForChild[x].getPrice()) {\n Confectionery sweets = ForChild[x - 1];\n ForChild[x - 1] = ForChild[x];\n ForChild[x] = sweets;\n\n }\n x -= 1;\n }\n }\n }", "static void minimumBribes(int[] q) {\r\n int bribes = 0;\r\n boolean valid = true;\r\n int index = 1;\r\n \r\n // We get the length of the input array\r\n int size = q.length; \r\n \r\n // We cycle through the input array\r\n for (int i = 0; i < size; i++) {\r\n int actual = q[i];\r\n \r\n // We check if the current person has surely swapped position more than two times since it appears before they are supposed to\r\n if (actual > index) {\r\n int difference = actual - index;\r\n if (difference > 2) {\r\n valid = false;\r\n break;\r\n }\r\n }\r\n \r\n // We check the number of bribes by counting how many persons with bigger IDs have already swapped place with the current one\r\n // NOTE: We can safely begin to check from position (actual-2) since higher numbers of swaps would have been caught by the previous if condition\r\n for (int j = actual-2; j < index; j++) {\r\n if (j < 0) {\r\n continue;\r\n }\r\n if (actual < q[j]) {\r\n bribes += 1;\r\n }\r\n }\r\n \r\n index += 1;\r\n }\r\n \r\n // Checks if the result is valid, and if so, it prints it\r\n if (valid == false) {\r\n System.out.println(\"Too chaotic\");\r\n }\r\n else {\r\n System.out.println(bribes);\r\n }\r\n}", "public static void shellSort(Comparable[] a) {\n int n = a.length;\n int h = 1;\n // Iteratively increase the stride h until the stride will at most sort 2 elements.\n while (h < n/3) h = 3*h + 1;\n while (h >= 1) {\n for (int i = 1; i < n; i += h) {\n for (int j = i; j > 0; j--) {\n if (less(a[j], a[j-1])) exch(a, j, j-1);\n else break;\n }\n }\n h /= 3;\n }\n\n }", "private static void sortAccording(int A1[], int A2[], int m, int n)\n {\n // The temp array is used to store a copy \n // of A1[] and visited[] is used to mark the \n // visited elements in temp[].\n int temp[] = new int[m], visited[] = new int[m];\n for (int i = 0; i < m; i++)\n {\n temp[i] = A1[i];\n visited[i] = 0;\n }\n \n // Sort elements in temp\n Arrays.sort(temp);\n \n // for index of output which is sorted A1[]\n int ind = 0; \n \n // Consider all elements of A2[], find them\n // in temp[] and copy to A1[] in order.\n for (int i = 0; i < n; i++){\n\n // Find index of the first occurrence\n // of A2[i] in temp\n int f = first(temp, 0, m-1, A2[i], m);\n \n // If not present, no need to proceed\n if (f == -1) \n continue;\n \n // Copy all occurrences of A2[i] to A1[]\n for (int j = f; (j < m && temp[j] == A2[i]); j++){\n \n A1[ind++] = temp[j];\n visited[j] = 1;\n }\n }\n \n // Now copy all items of temp[] which are \n // not present in A2[]\n for (int i = 0; i < m; i++)\n if (visited[i] == 0)\n A1[ind++] = temp[i];\n }", "private static <T> void sort1(long x[], T[] a2, int off, int len) {\n\t\t// Insertion sort on smallest arrays\n\t\tif (len < 7) {\n\t\t\tfor (int i=off; i<len+off; i++)\n\t\t\t\tfor (int j=i; j>off && x[j-1]>x[j]; j--)\n\t\t\t\t\tswap(x, a2, j, j-1);\n\t\t\treturn;\n\t\t}\n\n\t\t// Choose a partition element, v\n\t\tint m = off + (len >> 1); // Small arrays, middle element\n\t\tif (len > 7) {\n\t\t\tint l = off;\n\t\t\tint n = off + len - 1;\n\t\t\tif (len > 40) { // Big arrays, pseudomedian of 9\n\t\t\t\tint s = len/8;\n\t\t\t\tl = med3(x, l, l+s, l+2*s);\n\t\t\t\tm = med3(x, m-s, m, m+s);\n\t\t\t\tn = med3(x, n-2*s, n-s, n);\n\t\t\t}\n\t\t\tm = med3(x, l, m, n); // Mid-size, med of 3\n\t\t}\n\t\tlong v = x[m];\n\n\t\t// Establish Invariant: v* (<v)* (>v)* v*\n\t\tint a = off, b = a, c = off + len - 1, d = c;\n\t\twhile(true) {\n\t\t\twhile (b <= c && x[b] <= v) {\n\t\t\t\tif (x[b] == v)\n\t\t\t\t\tswap(x,a2, a++, b);\n\t\t\t\tb++;\n\t\t\t}\n\t\t\twhile (c >= b && x[c] >= v) {\n\t\t\t\tif (x[c] == v)\n\t\t\t\t\tswap(x,a2, c, d--);\n\t\t\t\tc--;\n\t\t\t}\n\t\t\tif (b > c)\n\t\t\t\tbreak;\n\t\t\tswap(x,a2, b++, c--);\n\t\t}\n\n\t\t// Swap partition elements back to middle\n\t\tint s, n = off + len;\n\t\ts = Math.min(a-off, b-a ); vecswap(x,a2, off, b-s, s);\n\t\ts = Math.min(d-c, n-d-1); vecswap(x,a2, b, n-s, s);\n\n\t\t// Recursively sort non-partition-elements\n\t\tif ((s = b-a) > 1)\n\t\t\tsort1(x,a2, off, s);\n\t\tif ((s = d-c) > 1)\n\t\t\tsort1(x,a2, n-s, s);\n\t}", "public static void sort(Comparable[] a)\n {\n // Do lg N passes of pairwise merges.\n int N = a.length;\n aux = new Comparable[N];\n for (int sz = 1; sz < N; sz = sz+sz) // sz: subarray size\n for (int lo = 0; lo < N - sz; lo += sz + sz) // lo: subarray index\n merge(a, lo, lo + sz - 1, Math.min(lo + sz + sz - 1, N - 1));\n }", "public static double findMedianSortedArraysBrutalForce(int[] nums1, int[] nums2) {\n int m = nums1.length;\n int n = nums2.length;\n if (n == 0) {\n return getMedian(nums1);\n }\n if (m == 0) {\n return getMedian(nums2);\n }\n\n int[] nums = new int[m + n];\n\n int count = 0;\n int i = 0, j = 0;\n while (count != (m + n)) {\n // if nums1 reach the end first\n if (i == m) {\n // push all the rest of the nums2 into result array\n while (j != n) {\n nums[count++] = nums2[j++];\n }\n // then get rid of the while loop\n break;\n }\n // if nums2 reach the end of the while loop\n if (j == n) {\n while (i != m) {\n nums[count++] = nums1[i++];\n }\n break;\n }\n\n // compare current value then only push the small one into result array\n if (nums1[i] < nums2[j]) {\n nums[count++] = nums1[i++];\n } else {\n nums[count++] = nums2[j++];\n }\n }\n\n return getMedian(nums);\n }", "@Test(timeout = SHORT_TIMEOUT)\n public void testAdaptiveInsertionSort() {\n //Test adaptiveness of completely ordered sort\n\n //Generate sorted array\n toSort = randArrDuplicates(MAX_ARR_SIZE, new Random(2110));\n Arrays.parallelSort(toSort, comp);\n sortedInts = cloneArr(toSort);\n\n comp.resetCount();\n Sorting.insertionSort(sortedInts, comp);\n int numComparisons = comp.getCount();\n\n assertSorted(sortedInts, comp);\n\n //Should require only 1 pass through array, for n-1 comparisons\n assertTrue(\"Too many comparisons: \" + numComparisons,\n numComparisons <= MAX_ARR_SIZE - 1);\n\n //Check adaptiveness with 1 item out-of-order\n\n //Set up list\n toSort = new IntPlus[6];\n for (int i = 0; i < toSort.length; i++) {\n toSort[i] = new IntPlus(2 * i);\n }\n toSort[3] = new IntPlus(-1);\n\n sortedInts = cloneArr(toSort);\n\n /*\n Initial Array: [0, 2, 4, -1, 8, 10]\n Should require 7 comparisons to sort\n */\n comp.resetCount();\n Sorting.insertionSort(sortedInts, comp);\n numComparisons = comp.getCount();\n\n assertSorted(sortedInts, comp);\n\n assertTrue(\"Too many comparisons: \" + numComparisons,\n numComparisons <= 7);\n }", "private int[] fader(int[] a, int[] b) {\n\t\tfor(int i = 0; i < 3; i++) {\n\t\t\tif(a[i] > b[i]) {\n\t\t\t\ta[i] = a[i]-1;\n\t\t\t} else if(a[i] < b[i]) {\n\t\t\t\ta[i] = a[i]+1;\n\t\t\t}\n\t\t}\n\n\t\treturn a;\n\t}", "public static <Key extends Comparable<Key> > void sort (Key [] a){\n int n=a.length;\n //rearrange the array to a max heap\n for (int k=n/2;k>=1;k--) sink(a,k,n);\n for ( int i=0;i<a.length;i++){\n exch(a,1,n--);\n sink(a,1,n);\n }\n\n }", "public abstract int Compare(Slice a, Slice b);", "int compFunction(int code) {\r\n if (code % num_buckets < 0) {\r\n return (code % num_buckets) + num_buckets;\r\n } else {\r\n return code % num_buckets;\r\n } \r\n /*int a = 13;\r\n int b = 23;\r\n int p = 1000000 * num_buckets;\r\n while (isPrime(p) == false) { \r\n p += 1; \r\n }\r\n return ((a * code + b) % p) % num_buckets; */\r\n }", "public static void main(String[] args) {\n List<Integer> li = new ArrayList<>();\n li.add(4);\n li.add(4);\n li.add(2);\n li.add(2);\n li.add(2);\n li.add(2);\n li.add(3);\n li.add(3);\n li.add(1);\n li.add(1);\n li.add(6);\n li.add(7);\n li.add(5);\n li.add(5);\n li.add(3);\n li.add(1);\n li.add(2);\n li.add(2);\n li.add(4);\n\n List<Integer> li1 = new ArrayList<>();\n li1.add(5);\n li1.add(1);\n li1.add(2);\n li1.add(3);\n li1.add(4);\n li1.add(1);\n System.out.println(li1);\n int[] array = { 4, 4, 2, 2, 2, 2, 3, 3, 1, 1, 6, 7, 5 };\n\n customSort(li1);\n//\n// missingWords(\"I am using hackerrank to improve programming\",\"am hackerrank to improve\");\n//\n// System.out.println(fourthBit(32));\n////nums\n// System.out.println(kSub(3,li1));\n\n Float f = 0.1F;\n\n System.out.println(f);;\n\n System.out.println(new BigDecimal(f.toString()));\n\n System.out.println(twoSum(new int[]{2,7,1,4}, 9));\n }", "public static void dimension_sort() { // sort the dimensions according to their effect to GCP\n\t\tfor (int i = 0;i < dims-1;i++) {\n\t\t\tdimension[i] = (byte) i;\n\t\t}\n\t\tboolean swapped = true;\n\t\tint i=0;\n\t\tbyte temp;\n\t\twhile (swapped) {\n\t\t\tswapped = false;\n\t\t\ti++;\n\t\t\tfor (int j = 0; j < dimension.length-i;j++) { // smaller range, put it the front\n\t\t\t\tif (cardinalities[dimension[j]] > cardinalities[dimension[j+1]]) {\n\t\t\t\t\ttemp = dimension[j];\n\t\t\t\t\tdimension[j] = dimension[j+1];\n\t\t\t\t\tdimension[j+1] = temp;\n\t\t\t\t\tswapped = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "static double binarySearchForBuckets (double[] splits, double feature, boolean keepInvalid) { throw new RuntimeException(); }", "protected void sort1(double x[], int off, int len) {\r\n // Insertion sort on smallest arrays\r\n if (len < 7) {\r\n for (int i = off; i < len + off; i++) {\r\n for (int j = i; j > off && x[j - 1] > x[j]; j--) {\r\n swap(x, j, j - 1);\r\n }\r\n }\r\n return;\r\n }\r\n\r\n // Choose a partition element, v\r\n int m = off + (len >> 1); // Small arrays, middle element\r\n if (len > 7) {\r\n int l = off;\r\n int n = off + len - 1;\r\n if (len > 40) { // Big arrays, pseudomedian of 9\r\n int s = len / 8;\r\n l = med3(x, l, l + s, l + 2 * s);\r\n m = med3(x, m - s, m, m + s);\r\n n = med3(x, n - 2 * s, n - s, n);\r\n }\r\n m = med3(x, l, m, n); // Mid-size, med of 3\r\n }\r\n double v = x[m];\r\n\r\n // Establish Invariant: v* (<v)* (>v)* v*\r\n int a = off, b = a, c = off + len - 1, d = c;\r\n while (true) {\r\n while (b <= c && x[b] <= v) {\r\n if (x[b] == v) {\r\n swap(x, a++, b);\r\n }\r\n b++;\r\n }\r\n while (c >= b && x[c] >= v) {\r\n if (x[c] == v) {\r\n swap(x, c, d--);\r\n }\r\n c--;\r\n }\r\n if (b > c) {\r\n break;\r\n }\r\n swap(x, b++, c--);\r\n }\r\n\r\n // Swap partition elements back to middle\r\n int s, n = off + len;\r\n s = Math.min(a - off, b - a);\r\n vecswap(x, off, b - s, s);\r\n s = Math.min(d - c, n - d - 1);\r\n vecswap(x, b, n - s, s);\r\n\r\n // Recursively sort non-partition-elements\r\n if ((s = b - a) > 1) {\r\n sort1(x, off, s);\r\n }\r\n if ((s = d - c) > 1) {\r\n sort1(x, n - s, s);\r\n }\r\n }", "@Override\n\t\tpublic void run() {\n\t\t\tfor (int i = 0; i < 1000000; i++) {\n\t\t\t\tint[] a = Util.generateRandomArray(500, 200000);\n\t\t\t\tint[] b = a.clone();\n\t\t\t\t\n\t\t\t\ta = sort(a);\n\t\t\t\tArrays.sort(b);\n\t\t\t\t\n\t\t\t\tfor (int j = 0; j < b.length; j++) {\n\t\t\t\t\tUtil.Assert(a[j] == b[j], \"shit\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Heap sort ok\");\n\t\t}", "@Override\n public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) {\n int c = -1 * WritableComparator.compareBytes(b1, s1 + LENGTH_BYTES, l1 - LENGTH_BYTES, b2,\n s2 + LENGTH_BYTES, l2 - LENGTH_BYTES);\n return c;\n }", "private static int sortAndCount(Comparable[] a, Comparable[] aux, int lo, int hi) {\n if (hi <= lo) return 0;\n\n int mid = (lo + hi) / 2;\n // sort and count left inversions\n int left = sortAndCount(a, aux, lo, mid);\n // sort and count right inversions\n int right = sortAndCount(a, aux, mid+1, hi);\n // merge and count split inversions\n if (debug) {\n System.out.println(\"Merging ( \" + lo + \" \" + hi + \" ): \");\n for (int i = 0; i < a.length; i++)\n System.out.print(a[i] + \"\\t\");\n System.out.println();\n }\n int split = mergeAndCountSplit(a, aux, lo, mid, hi);\n // return all inversions\n if (debug) {\n System.out.println(\"Returning ( \" + lo + \" \" + hi + \" ): \");\n for (int i = 0; i < a.length; i++)\n System.out.print(a[i] + \"\\t\");\n System.out.println();\n }\n return (left + right + split);\n }", "public static void debucketize(Integer[] A)\n\t{int i = 0;//Index of next element in A\n\t //Inv: elements in buckets[0..bucket[ctr]] are debucketized && ctr = bucket.size() \n\t //&& A[i] = elements in vector \n\t for(int ctr = 0; ctr < buckets.size(); ctr++)\n\t\t{//Inv: elements in buckets[0..bucket[ctr]-1] are debucketized && ctr < bucket.size() \n\t\t //&& A[i]-1 = elements in vector\n\t\t i += buckets.get(ctr).toArray(A, i);\n\t\t//Inv: elements in buckets[0..bucket[ctr]] are debucketized && ctr = bucket.size() \n\t\t//&& A[i] = elements in vector\t \n\t\t}\n\t //Termination: the counter begins at 0 and increments every time by 1 until it finally reaches \n\t //the size of the buckets and it finally terminates. \n\t}", "private static Map<Double, List<Integer>> bucketizeListForTF(List<Integer> input, double bucketRange, int queryId)\r\n\t\t\tthrows ClassNotFoundException, SQLException, IOException {\r\n\t\tMap<Integer, Double> tfMap = new LinkedHashMap<Integer, Double>();\r\n\t\tList<Integer> resultsToIgnore = PersistenceController2.fetchAllResultsToIgnore(queryId, true);\r\n\t\tRankUtils.fillResultTFMap(queryId, tfMap, input, resultsToIgnore);\r\n\t\tboolean isRatioAccepted = RankUtils.foundNotFoundRatioAccepted(queryId, ACCEPTANCE_THRESHOLD);\r\n\t\tMap<Double, List<Integer>> sortedMap = RankUtils.bucketizeAndSortForTF2(isRatioAccepted, input, tfMap,\r\n\t\t\t\tbucketRange, resultsToIgnore);\r\n\t\treturn sortedMap;\r\n\t}", "public void sort()\n\t{\n\t\tfor(int i=0;i<bowlers.size()-1;i++)\n\t\t{\n\t\t\tfor(int j=i+1;j<bowlers.size();j++)\n\t\t\t{\n\t\t\t\tif(bowlers.get(i).getBall()<bowlers.get(j).getBall())\n\t\t\t\t{\n\t\t\t\t\tBowler bowler=bowlers.get(i);\n\t\t\t\t\tbowlers.set(i,bowlers.get(j));\n\t\t\t\t\tbowlers.set(j,bowler);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<bowlers.size();i++)\n\t\t{\n\t\tSystem.out.println(bowlers.get(i).getBall());\n\t\t}\n\t}", "protected abstract int getBucketIndex(int freeSpace);", "public void insertionSort() {\n\t\tfor (int i = 1; i < numberOfElements; i++) {\n\t\t\tint temp = arr[i];\n\t\t\tint j = i;\n\t\t\t\n\t\t\twhile (j > 0) {\n\t\t\t\tif (arr[j - 1] <= temp) {\n\t\t\t\t\tnumberOfComparisons++;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tnumberOfComparisons++;\n\t\t\t\tarr[j] = arr[j - 1];\n\t\t\t\tnumberOfCopies++;\n\t\t\t\tj--;\n\t\t\t}\n\t\t\tarr[j] = temp;\n\t\t}\n\t}", "private void sort() {\n ScoreComparator comparator = new ScoreComparator();\n Collections.sort(scores, comparator);\n }", "private void doSort (Column A, int [] i, int p, int r, int begin) {//double[] A, int p, int r, MutableTable t) {\n\t\tif (p < r) {\n\t\t\tint q = partition(A, i, p, r, begin);\n\t\t\tdoSort(A, i, p, q, begin);\n\t\t\tdoSort(A, i, q + 1, r, begin);\n\t\t}\n\t}", "private static <Item extends Comparable> void partitionBear(\n List<Item> unsorted, Bed pivot,\n List<Item> less, List<Item> equal, List<Item> greater) {\n for (Item s : unsorted) {\n if (s.compareTo(pivot) < 0) {\n less.add(s);\n } else if (s.compareTo(pivot) == 0) {\n equal.add(s);\n } else {\n greater.add(s);\n }\n }\n }", "private static void quicksort(Object a[], int lo0, int hi0) {\n int lo = lo0;\n int hi = hi0;\n int mid;\n\n if (hi0 > lo0) {\n swapReferences(a, lo0, (lo0 + hi0)/2);\n Object[] midObject = (Object[]) a[(lo0 + hi0) / 2];\n mid = (int)midObject[2];\n while (lo <= hi) {\n Object[] loObject = (Object[])a[lo];\n int loWeight = (int)loObject[2];\n while((lo < hi0) && (loWeight < mid)) {\n loObject = (Object[])a[lo];\n loWeight = (int)loObject[2];\n if (loWeight < mid) {\n lo++;\n }\n }\n\n Object[] hiObject = (Object[])a[hi];\n int hiWeight = (int)hiObject[2];\n while((hi > lo0) && (hiWeight > mid)) {\n hiObject = (Object[])a[hi];\n hiWeight = (int)hiObject[2];\n if (hiWeight > mid) {\n hi--;\n }\n }\n\n if (lo <= hi) {\n swapReferences(a, lo, hi);\n lo++;\n hi--;\n }\n }\n\n if (lo0 < hi) {\n quicksort(a, lo0, hi);\n }\n\n if (lo < hi0) {\n quicksort(a, lo, hi0);\n }\n }\n }", "public int compare(Key<Double, Double> a, Key<Double, Double> b){\n\t\t\tif (a.getFirst() < b.getFirst()){\n\t\t\t\treturn -1;\n\t\t\t} else if (a.getFirst() == b.getFirst()){\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}" ]
[ "0.67488664", "0.63544196", "0.62501895", "0.61235464", "0.61028194", "0.58932674", "0.586097", "0.58454704", "0.58367604", "0.58085865", "0.580634", "0.5773575", "0.57437426", "0.57425076", "0.57411504", "0.572016", "0.57145536", "0.5708266", "0.5695191", "0.56914014", "0.56871", "0.56871", "0.5670631", "0.56695527", "0.5656869", "0.5649668", "0.56493396", "0.5638822", "0.5638354", "0.5637325", "0.56136394", "0.5613533", "0.5613224", "0.5563741", "0.5548244", "0.55463535", "0.5535822", "0.5526834", "0.5517317", "0.5514139", "0.55123204", "0.5505895", "0.55055743", "0.5497652", "0.5497117", "0.54805696", "0.54725134", "0.54677206", "0.54478514", "0.5446974", "0.5433641", "0.54331386", "0.5424693", "0.5421204", "0.5419588", "0.5415018", "0.5393402", "0.5384118", "0.5381087", "0.5367897", "0.53641397", "0.5363799", "0.5359706", "0.53580815", "0.5356253", "0.5356154", "0.5348215", "0.5341179", "0.5333561", "0.53289545", "0.53254646", "0.53241426", "0.53220105", "0.5321184", "0.5312635", "0.5308034", "0.53057534", "0.5304691", "0.5303627", "0.5300251", "0.5296804", "0.5295908", "0.52958626", "0.5295764", "0.52924997", "0.5289749", "0.52840203", "0.527327", "0.52732486", "0.52644753", "0.5257244", "0.52505827", "0.52483785", "0.5242732", "0.5241672", "0.52358407", "0.5235063", "0.5234469", "0.52315676", "0.5225321", "0.52192307" ]
0.0
-1
Method, which stops measuring the time, if Log.measureTime() was called before
public static void done(String id) { if(measurements.containsKey(id)) { String timeDifference = ""; for(int i = 0; i < logPatterns.get(0).getLength() + logPatterns.get(1).getLength() + 1; i++) { timeDifference = timeDifference.concat(" "); } timeDifference = timeDifference + logPointer + " Done '" + measurements.get(id).getMessage() + "' in '" + (System.currentTimeMillis() - measurements.get(id).getTimestamp()) + "ms'"; System.out.println(timeDifference); measurements.remove(id); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void stopMeasuring() {\n\tsuper.stopMeasuring();\n}", "public void stop() {\n stopTime = Calendar.getInstance().getTime();\n long diff = stopTime.getTime() - startTime.getTime();\n\n writeln();\n writeln(\"# --------------------------------------------------------------------\");\n writeln(\"# << END OF LOGFILE >> \");\n writeln(\"# --------------------------------------------------------------------\");\n writeln(\"# STOP TIME : \" + stopTime);\n writeln(\"# ELAPSED TIME : \" + (diff / (1000L)) + \" seconds.\");\n writeln(\"# --------------------------------------------------------------------\");\n pw.close();\n }", "public long stop() {\n long t = System.currentTimeMillis() - lastStart;\n if(count == 0)\n firstTime = t;\n totalTime += t;\n count++;\n updateHist(t);\n if(printIterval > 0 && count % printIterval == 0)\n System.out.println(this);\n return t;\n }", "private void stopTime()\n {\n timer.stop();\n }", "public void stop() {\n assert (timeEnd == null);\n timeEnd = System.currentTimeMillis();\n if (recordAt != null) {\n recordAt.record(this);\n }\n }", "public void stopStopwatch() {\n timeCount = currentNanoTime.getAsLong();\n currentNanoTime = () -> timeCount;\n }", "public void stop() {\n endTime = System.currentTimeMillis();\n }", "public static void startTimeMeasure() {\n \tstartTime = System.nanoTime();\n }", "TimeInstrument stop();", "public static void stopTimer() {\n timerIsWorking = false;\r\n elapsedTime = 0;\r\n }", "public long stop() {\r\n \tendTime = System.currentTimeMillis();\r\n \tif (timer != null) {\r\n \t\ttimer.cancel();\r\n \t}\r\n \tif (doOutput) System.out.println(\".\");\r\n \treturn (endTime - startTime)/1000;\r\n }", "protected void internalStop() {\n super.internalStop();\n\n // Do the logging here\n log(this);\n }", "@Override\n\tprotected void doStop() {\n\t\tSystem.out.println(\"Stopping after \" + getNumberOfLoggedEntries() + \" entries\");\n\t}", "private void stopCountTime() {\n\t\tendTimer();\n\t\tif(this.gameTimeThread != null) {\n try {\n this.gameTimeThread.join();\n } catch (InterruptedException ignored) {\n }\n }\n\t}", "public void stop()\n\t{\n\t\t//get the time information as first part for better precision\n\t\tlong systemMs = SystemClock.elapsedRealtime();\n\n\t\t//if it was already stopped or did not even run, do nothing\n\t\tif (!m_running)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tm_elapsedMs += (systemMs - m_lastMs);\n\n\t\tm_running = false;\n\t}", "public void timeToRunDec()\n\t{\n\t\tthis.time_to_run -- ;\n\t}", "private void clearTime() {\n \n time_ = 0L;\n }", "private void clearTime() {\n \n time_ = 0L;\n }", "private void clearTime() {\n \n time_ = 0L;\n }", "public void stopTime() {\n if (isRunning) {\n timer.cancel();\n timer.purge();\n }\n isRunning = false;\n }", "private void clearTime() {\n \n time_ = 0L;\n }", "private void clearTime() {\n \n time_ = 0L;\n }", "private void clearTime() {\n \n time_ = 0L;\n }", "private void clearTime() {\n \n time_ = 0L;\n }", "public void stop(){\n\t\tthis.timer.stop();\n\t\t//whenever we stop the entire game, also calculate the endTime\n\t\tthis.endTime = System.nanoTime();\n\t\tthis.time = this.startTime - this.endTime;\t//calculate the time difference\n\t\t\n\t\tthis.stop = true;\n\t}", "private void stop_meter() {\n\t\t\t mEngin.stop_engine();\n\t\t\t\n\t\t}", "public static void stopTiming(CheckType theCheck, UUID identifier) {\n if (!ENABLED) return;\n purge(theCheck);\n\n final long start = STARTED_TIMINGS.get(theCheck).getOrDefault(identifier, -1L);\n if (start == -1) return;\n\n final long diff = System.nanoTime() - start;\n TIMINGS.get(theCheck).add(diff);\n }", "public void resetTime() {\n\t\ttime_passed = 0l;\n\t}", "public synchronized static void resetTime() {\n\t\ttime = 0;\n\t}", "public boolean isMeasureTime() ;", "@Override\n public synchronized void stop() {\n final double temp = get();\n m_accumulatedTime = temp;\n m_running = false;\n }", "public void stop() {\n\t\tthis.stopTime = System.nanoTime();\n\t\tthis.running = false;\n\t}", "public void testStoppedTimeWithoutGcEvents() {\n\n // TODO: Create File in platform independent way.\n File testFile = new File(\"src/test/data/dataset108.txt\");\n GcManager gcManager = new GcManager();\n File preprocessedFile = gcManager.preprocess(testFile, null);\n gcManager.store(preprocessedFile, false);\n gcManager.store(testFile, false);\n JvmRun jvmRun = gcManager.getJvmRun(new Jvm(null, null), Constants.DEFAULT_BOTTLENECK_THROUGHPUT_THRESHOLD);\n Assert.assertEquals(\"Stopped time throughput not correct.\", 0, jvmRun.getStoppedTimeThroughput());\n }", "static void setTiming(){\n killTime=(Pars.txType!=0) ? Pars.txSt+Pars.txDur+60 : Pars.collectTimesB[2]+Pars.dataTime[1]+60;//time to kill simulation\n tracksTime=(Pars.tracks && Pars.txType==0) ? Pars.collectTimesI[1]:(Pars.tracks)? Pars.collectTimesBTx[1]:100*24*60;//time to record tracks\n }", "private static void stopCleanUp() {\n\n if (isEventTrackerRunning && timer != null) {\n timer.cancel();\n timer.purge();\n debugLogger.info(\"Timer stopped: {}\", new Date());\n } else {\n debugLogger.info(\"Timer was already stopped : {}\", new Date());\n\n }\n isEventTrackerRunning = false;\n\n }", "void stopStatisticsMonitor();", "private void scheduleLogStop() {\n exec.schedule(new Runnable() {\n @Override\n public void run() {\n mSensorManager.unregisterListener(PhoneSensorLogService.this, mAccelerometer);\n mSensorManager.unregisterListener(PhoneSensorLogService.this, mGyroscope);\n Log.d(TAG, \"End: \" + System.currentTimeMillis());\n writeFiles();\n Log.d(TAG, \"About to stop service...\");\n stopSelf();\n }\n }, minutes, TimeUnit.MINUTES);\n }", "public static void resetTime() {\n\t\ttime = TimeUtils.millis();\n\t}", "public abstract void logTraceTime();", "public static void traceOff() {\r\n\t\ttraceOn = false;\r\n\r\n\t}", "public final synchronized void resetTime() {\n this.last = System.nanoTime();\n }", "synchronized void stop() {\n\t\tif (DEBUG) Log.v(TAG, \"stop:mStatredCount=\" + mStatredCount);\n\t\tmStatredCount--;\n\t\tif ((mEncoderCount > 0) && (mStatredCount <= 0)) {\n\t\t\tmMediaMuxer.stop();\n\t\t\tmMediaMuxer.release();\n\t\t\tmIsStarted = false;\n\t\t\tif (DEBUG) Log.v(TAG, \"MediaMuxer stopped:\");\n\t\t}\n\t}", "public void stop() {timer.stop();}", "protected void printExecutionTime(){\n //Do nothing\n }", "private void resetTime()\n {\n timer.stop();\n timeDisplay.setText(ZERO_TIME);\n time = 0.0;\n }", "private void StopTime() {\n timer.stop();\n currentHora = 0;\n currentMinuto = 0;\n currentSegundo = 0;\n lbcronometro.setText(\"00:00:00\");\n }", "public void unsetStopTime()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_attribute(STOPTIME$24);\r\n }\r\n }", "@Override\n public synchronized void reset() {\n m_accumulatedTime = 0;\n m_startTime = getMsClock();\n }", "public void stop() {\n intake(0.0);\n }", "private void countTime()\n {\n time--;\n showTime();\n if (time == 0)\n {\n showEndMessage();\n Greenfoot.stop();\n }\n }", "public void logElapsedTime() {\r\n\r\n NumberFormat nf = NumberFormat.getInstance();\r\n\r\n nf.setMaximumFractionDigits(2);\r\n nf.setMinimumFractionDigits(2);\r\n\r\n historyString = new String(\"Elapsed Time = \" + nf.format(getElapsedTime()) + \" sec.\\n\");\r\n writeLog();\r\n }", "public void reset() {\n\t\tstartTime = System.nanoTime();\n\t\tpreviousTime = getTime();\n\t}", "protected synchronized void stopped(ITrace trace) {\n\t\tTrace.unregisterTrace(trace);\n\t\tif (getCollectAll() > 0) {\n\t\t\tgetBasicTraces().add(trace);\n\t\t\ttracePerThread.set(createMonitorTrace());\n\n\t\t\tif (getCollectAll() < getBasicTraces().size()) {\n\t\t\t\tgetBasicTraces().removeFirst();\n\t\t\t}\n\t\t}\n\t\ttraceCount++;\n\t\tif (getLogCycle() != -1 && traceCount >= getLogCycle()) {\n\t\t\treset();\n\t\t}\n\t}", "public static void pauseTiming() {\n SimulatorJNI.pauseTiming();\n }", "public void\nstopTimer() {\n\t\n\tSystemDesign.logInfo(\"MetroParams.stopTimer: Killing annealing timer.\");\n\t\n\tif (metroTimer_ != null) {\n metroTimer_.stopPlease();\n\t metroTimer_ = null;\n }\n\tmetroThread_ = null;\n}", "public void measure(){\n \tend = System.nanoTime(); \n \tlong elapsedTime = end - start;\n\n \t//convert to seconds \n \tseconds = (double)elapsedTime / 1000000000.0f;\n \tend =0; //歸零\n \tstart =0;\n }", "int checkElapsedTime(){\r\n\t\treturn gc.getElapsedTime();\r\n\t}", "public void clearCallLogs();", "public void startTiming() {\n elapsedTime = 0;\n startTime = System.currentTimeMillis();\n }", "public void reset() {\n/* 54 */ this.count = 0;\n/* 55 */ this.totalTime = 0L;\n/* */ }", "public synchronized void resetTime() {\n }", "public boolean printExecutionTime(){\r\n return false;\r\n }", "public static void resumeTiming() {\n SimulatorJNI.resumeTiming();\n }", "@Override\n\t\tpublic final double time() throws Throwable {\n\t\t\tinit();\n\t\t\ttimer.lap();\n\t\t\ttimed();\n\t\t\tdouble time = timer.lap();\n\t\t\tcleanup();\n\t\t\treturn time;\n\t\t}", "public void stopRideTime(){\r\n\t\trideTime.stop();\r\n\t}", "@Override\n\tpublic void stopCounter() {\n\n\t\tstop = true;\n\t}", "public void stop() {\n clockThread = null;\n }", "public synchronized void reset()\n\t{\n\t\tm_elapsed = 0;\n\t}", "public static void performanceCountDisable() { }", "int stopSamples() {\n if (debugFlag)\n debugPrint(\"JSChannel: stopSample must be overridden\");\n// reloadSample\n\n startTime = 0;\n return 0;\n }", "public synchronized void stop()\n {\n try\n {\n logger.info(\"Deactivation of full query log requested.\");\n if (binLog != null)\n {\n logger.info(\"Stopping full query log\");\n binLog.stop();\n binLog = null;\n }\n }\n catch (Exception e)\n {\n throw new RuntimeException(e);\n }\n }", "public void report(){\n outTime = ElevatorControl.getTick();\n Report.addToReport(this);\n }", "public static void performanceCountReset() { }", "public void doafter() {\r\n\t\t\r\n\t\tendTme = System.currentTimeMillis();\r\n\t\tString ended = \"MethodEnded: \" + endTme;\r\n\t\tString duration = \"Duration: \" + (endTme - startTime)\r\n\t\t\t\t+ \" Milliseconds\";\r\n\t\tmethodlog += ended + duration + tendency;\r\n\t\tfinallog += methodlog;\r\n\t\t\r\n\t\tmyAnalysis.writeLogtoFile(finallog);// calls method to write to file the log of all methods.\r\n\t}", "public void stop() {\r\n\t\tisRecording = false;\r\n\t}", "public void endBatch() {\n\trunTimer.stop();\n\n\tif (metrics) {\n\t runTimer.show(getRunTitle() + \" run\");\n\t threadTimer.show(getRunTitle() + \" thread\");\n\t getAudioPlayer().showMetrics();\n\t long totalMemory = Runtime.getRuntime().totalMemory();\n\t System.out.println\n\t\t(\"Memory Use : \"\n\t\t + (totalMemory - Runtime.getRuntime().freeMemory()) / 1024\n\t\t + \"k of \" + totalMemory / 1024 + \"k\");\n\t}\n }", "public void silence() {\r\n\t\tif (debugLevel > 1)\r\n\t\t\tSystem.out.println(\" ... silence\");\r\n\t\tif (clip != null && clip.isRunning()) {\r\n\t\t\tclip.stop();\r\n\t\t\tclip = null;\r\n\t\t}\r\n\t}", "@Override\r\n public void timePassed(double dt) {\r\n return;\r\n }", "@Test\n\t\tpublic void woeIsMeUnreachabletest() {\n\t\t\tassertTrue(System.currentTimeMillis() > 0);\n\t\t}", "public static void reset() {\n start = new Date().getTime();\n killed = 0;\n time = 0;\n }", "public void stopTimer() {\n maxAccelOutput.setText(String.valueOf(maxAccel));\n timeHandler.removeCallbacks(startTimer);\n startButton.setText(R.string.go_button);\n isRunning = false;\n }", "public void stop() {\n timer.stop();\n }", "public double getStopTime();", "public void resetTimer() {\n\t\tsetStartingTime(System.currentTimeMillis());\t\n\t\tthis.progressBar.setForeground(Color.black);\n\t\tlogger.fine(\"Set normal timer with data: \" + this.toString());\n\n\t}", "void unsetTimeInterval();", "public void stopRecording() {\n BLog.d(TAG, \"stopRecording()\");\n stopLastRunnable();\n mRecordingRunnable.stopRun();\n try {\n mRecordingThread.interrupt();\n } catch (Exception e) {}\n mRecordingThread = null;\n }", "@Override\r\n\tpublic void onStop() {\n\t\tsuper.onStop();\r\n\t\tendloading();\r\n\t\t// getnewtime();\r\n\t\tLog.e(TAG, \"onStop\");\r\n\t}", "public void stop() {\n\t\t_timer.cancel();\n\t}", "void beforeStop();", "@Override\n public void start() {\n runTime.reset();\n telemetry.addData(\"Run Time\", \"reset\");\n }", "private void stop() {\n timer.cancel();\n timer = null;\n }", "public void testSummaryStatsStoppedTime() {\n File testFile = new File(\"src/test/data/dataset41.txt\");\n GcManager gcManager = new GcManager();\n File preprocessedFile = gcManager.preprocess(testFile, null);\n gcManager.store(preprocessedFile, false);\n JvmRun jvmRun = gcManager.getJvmRun(new Jvm(null, null), Constants.DEFAULT_BOTTLENECK_THROUGHPUT_THRESHOLD);\n Assert.assertTrue(JdkUtil.LogEventType.G1_YOUNG_PAUSE.toString() + \" collector not identified.\",\n jvmRun.getEventTypes().contains(LogEventType.G1_YOUNG_PAUSE));\n Assert.assertTrue(JdkUtil.LogEventType.APPLICATION_STOPPED_TIME.toString() + \" not identified.\",\n jvmRun.getEventTypes().contains(LogEventType.APPLICATION_STOPPED_TIME));\n Assert.assertEquals(\"GC Event count not correct.\", 2, jvmRun.getEventTypes().size());\n Assert.assertEquals(\"GC pause total not correct.\", 61, jvmRun.getTotalGcPause());\n Assert.assertEquals(\"GC first timestamp not correct.\", 2192, jvmRun.getFirstGcEvent().getTimestamp());\n Assert.assertEquals(\"GC last timestamp not correct.\", 2847, jvmRun.getLastGcEvent().getTimestamp());\n Assert.assertEquals(\"GC last duration not correct.\", 41, jvmRun.getLastGcEvent().getDuration());\n Assert.assertEquals(\"Stopped Time event count not correct.\", 6, jvmRun.getStoppedTimeEventCount());\n Assert.assertEquals(\"Stopped time total not correct.\", 1064, jvmRun.getTotalStoppedTime());\n Assert.assertEquals(\"Stopped first timestamp not correct.\", 964, jvmRun.getFirstStoppedEvent().getTimestamp());\n Assert.assertEquals(\"Stopped last timestamp not correct.\", 3884, jvmRun.getLastStoppedEvent().getTimestamp());\n Assert.assertEquals(\"Stopped last duration not correct.\", 1000688, jvmRun.getLastStoppedEvent().getDuration());\n Assert.assertEquals(\"JVM first event timestamp not correct.\", 964, jvmRun.getFirstEvent().getTimestamp());\n Assert.assertEquals(\"JVM last event timestamp not correct.\", 3884, jvmRun.getLastEvent().getTimestamp());\n Assert.assertEquals(\"JVM run duration not correct.\", 4884, jvmRun.getJvmRunDuration());\n Assert.assertEquals(\"GC throughput not correct.\", 99, jvmRun.getGcThroughput());\n Assert.assertEquals(\"Stopped time throughput not correct.\", 78, jvmRun.getStoppedTimeThroughput());\n Assert.assertTrue(Analysis.WARN_GC_STOPPED_RATIO + \" analysis not identified.\",\n jvmRun.getAnalysis().contains(Analysis.WARN_GC_STOPPED_RATIO));\n }", "public void testCombinedCmsConcurrentApplicationStoppedTimeLogging() {\n // TODO: Create File in platform independent way.\n File testFile = new File(\"src/test/data/dataset27.txt\");\n GcManager gcManager = new GcManager();\n File preprocessedFile = gcManager.preprocess(testFile, null);\n gcManager.store(preprocessedFile, false);\n JvmRun jvmRun = gcManager.getJvmRun(new Jvm(null, null), Constants.DEFAULT_BOTTLENECK_THROUGHPUT_THRESHOLD);\n Assert.assertEquals(\"Event type count not correct.\", 2, jvmRun.getEventTypes().size());\n Assert.assertTrue(\"Log line not recognized as \" + JdkUtil.LogEventType.CMS_CONCURRENT.toString() + \".\",\n jvmRun.getEventTypes().contains(JdkUtil.LogEventType.CMS_CONCURRENT));\n Assert.assertTrue(\n \"Log line not recognized as \" + JdkUtil.LogEventType.APPLICATION_STOPPED_TIME.toString() + \".\",\n jvmRun.getEventTypes().contains(JdkUtil.LogEventType.APPLICATION_STOPPED_TIME));\n }", "public void blackout(TimePeriod t) {\n\t\t\n\t}", "public void startMeasuring() {\n\tsuper.startMeasuring();\n}", "public void suppress() {\n\t\tstop = true;\n\t}", "public void endProfiling(){\r\n\t\tworld.profiler.endSection();\r\n\t}", "public void stop()\r\n\t{\r\n\t\tdoStop = true;\r\n\t}", "public void testTime()\n {\n SudokuTimer test = new SudokuTimer();\n\n mTimer.start();\n test.start();\n\n for (int i = 0; i < 1000000000; i++)\n {\n }\n\n assertTrue(mTimer.toString().equals(test.toString()));\n\n mTimer.stop();\n\n for (int i = 0; i < 1000000000; i++)\n {\n }\n\n assertFalse(mTimer.toString().equals(test.toString()));\n\n test.stop();\n mTimer.start();\n\n for (int i = 0; i < 1000000000; i++)\n {\n }\n\n mTimer.stop();\n\n //checks to the nearest second\n assertEquals(mTimer.getElapsedTime() / 1000,\n test.getElapsedTime() / 1000);\n }", "private void stopRecording() {\n recoTransaction.stopRecording();\n }", "public void reset() {\n\t\tthis.startTime = 0;\n\t\tthis.stopTime = 0;\n\t\tthis.running = false;\n\t}" ]
[ "0.7328091", "0.6638046", "0.63713276", "0.63711447", "0.6369008", "0.6342493", "0.63360596", "0.63147306", "0.62351274", "0.62107503", "0.61614406", "0.6138817", "0.60820115", "0.601782", "0.5961633", "0.5954007", "0.5942131", "0.5942131", "0.5942131", "0.59269816", "0.59230536", "0.59230536", "0.59230536", "0.59230536", "0.5905722", "0.59030133", "0.5897057", "0.58857524", "0.5853506", "0.58457017", "0.58380294", "0.58364004", "0.58305687", "0.5784158", "0.5762005", "0.57601744", "0.5734735", "0.5730403", "0.5729651", "0.5720381", "0.5713703", "0.5707286", "0.56863326", "0.56698734", "0.5661792", "0.56591076", "0.56359327", "0.56323653", "0.56280786", "0.5620312", "0.5613507", "0.5598336", "0.5594474", "0.5584649", "0.5581156", "0.55776805", "0.5571192", "0.5560374", "0.5556497", "0.55508035", "0.55497044", "0.5546896", "0.5539381", "0.5537605", "0.5534021", "0.55282646", "0.5504637", "0.5500381", "0.54801226", "0.54717594", "0.5469629", "0.5460872", "0.54112613", "0.54108536", "0.54070145", "0.54002774", "0.5393682", "0.5390897", "0.53805643", "0.53636646", "0.53611404", "0.5359821", "0.5358683", "0.53533953", "0.5351555", "0.5339961", "0.5336685", "0.53360784", "0.533079", "0.5328812", "0.532664", "0.532223", "0.5319356", "0.53187656", "0.53186405", "0.53167814", "0.53137267", "0.53114665", "0.5311067", "0.5311021", "0.53089195" ]
0.0
-1
Prints a given prefix and message to a given logLevel
public static void print(LogLevel level, String prefix, Object message) { print(level, prefix, String.valueOf(message)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void print(LogLevel level, String prefix, String message)\n {\n Map<String, String> sections = defaultSections();\n sections.replace(\"prefix\", prefix);\n sections.replace(\"message\", message);\n\n print(level, sections);\n }", "public abstract void print(Level level, Object logMessage);", "public static void print(LogLevel level, String message)\n {\n Map<String, String> sections = defaultSections();\n sections.replace(\"message\", message);\n\n print(level, sections);\n }", "void log(Level level, String message);", "public void print(Level level, String format, Object... args) {\n if (bach.debug() || level.getSeverity() >= Level.INFO.getSeverity()) {\n var writer = level.getSeverity() <= Level.INFO.getSeverity() ? out : err;\n writer.write(String.format(format, args));\n writer.write(System.lineSeparator());\n }\n }", "protected String getMessageWithPrefix(int level, String message) {\n MessageFormat messageFormat = new MessageFormat(\n getMessages().getString(\"logging_prefix\"));\t// NOI18N\n\n return messageFormat.format(new String[]{toString(level), message});\n }", "private void printLog(String str, int level)\n { if (log!=null) log.println(\"AudioApp: \"+str, LoopbackMediaApp.LOG_OFFSET+level);\n if (level<=Log.LEVEL_HIGH) System.out.println(\"AudioApp: \"+str);\n }", "public static void print(LogLevel level, Object message)\n {\n print(level, String.valueOf(message));\n }", "public void log(Marker level, String... message);", "public void log( Level level, String msg ) {\r\n\t\tlogger.log( level, logPrefix + \" \" + msg );\r\n\t}", "public static String getLoggerPrefix(String level) {\n return getTimestamp() +\n SPACE +\n level +\n SPACE +\n LBRACE + getThreadName() + RBRACE +\n SPACE + \n getClassName() + \n COLUMN +\n getLineNumber() + \n SPACE + \n DASH + \n SPACE;\n }", "public void LOG(int logNumber, String logMessage) {\r\n if(logNumber <= logLevel) {\r\n System.out.print(newline_prefix + logMessage);\r\n System.out.flush();\r\n }\r\n }", "@Override\n\tpublic void log(Level level, String message) {\n\n\t}", "public void logIfLevel(Marker ifLevel, String... messages);", "public static void Log(String Message, int Level)\n {\n if(Level == 0)\n {\n System.out.println(\"[\" + Reference.MOD_ID + \"]\" + \" \" + Message);\n }\n \n if(Level == 1)\n {\n System.out.println(\"[\" + Reference.MOD_ID + \"]\" + \" \" + Message);\n }\n \n if(Level == 2)\n {\n System.out.println(\"[\" + Reference.MOD_ID + \"]\" + \" \" + Message);\n }\n }", "void printLog(String str, int level)\n { if (log!=null) log.println(\"CommandLineUA: \"+str, UserAgent.LOG_OFFSET+level);\n }", "public void set_log_prefixes(String file, int line, int stmtLogLevel,\r\n int lgLevel) {\r\n if(GlobalOptions.showLogOrigin) {\r\n String adjFile = file;\r\n newline_prefix = \"[\"+stmtLogLevel+\"<=\"+logLevel+ \"] \"+adjFile+\"::\"+line+\": \";\r\n }\r\n else\r\n newline_prefix = \"\";\r\n wrap_prefix = newline_prefix + WRAP_INDENT;\r\n }", "protected abstract void log(T level, Object message);", "public void log(String message, int loglevel) {\n if (managingPc != null) {\n managingPc.log(message, loglevel);\n } else {\n (loglevel > Project.MSG_WARN ? System.out : System.err).println(message);\n }\n }", "@Override\n\tpublic void log(Level level, Message msg) {\n\n\t}", "private static void log(Level level, Object message) {\n logger.info(LogUtil.class.getName(),level, message,null);\n }", "protected abstract void onPrintBorderedMessage(int logLevel, String tag, String msg);", "@Override\n\tpublic void writeToLog(String log, LogLevelEnum logLevel, String className) {\n\t\tSystem.out.println(className + \" : \" + logLevel.toString() + \" : \" + log);\n\t}", "private void log(String entry, Log.Level logLevel) {\n\t\tif (logObject != null) {\n\t\t\tlogObject.makeEntry(entry, logLevel);\n\t\t} else {\n\t\t\tSystem.out.println(entry);\n\t\t}\n\t}", "public void LOG(int logNumber, char logChar) {\r\n if(logNumber <= logLevel){\r\n System.out.print(newline_prefix + logChar);\r\n System.out.flush();\r\n }\r\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3) {\n\n\t}", "@Override\n\tpublic void log(Level level, CharSequence message) {\n\n\t}", "public static void print(LogLevel level, Map<String, String> logSections)\n {\n levels.get(level.getLevel()).log(FormatUtil.formatLog(logPatterns, logSections));\n }", "@Override\n\tpublic void log(Level level, Object message) {\n\n\t}", "public void log(int level, String message)\r\n {\r\n if (!isLevelEnabled(level))\r\n {\r\n return;\r\n }\r\n\r\n switch (level)\r\n {\r\n case WARN_ID:\r\n servletContext.log(PREFIX + WARN_PREFIX + message);\r\n break;\r\n case INFO_ID:\r\n servletContext.log(PREFIX + INFO_PREFIX + message);\r\n break;\r\n case DEBUG_ID:\r\n servletContext.log(PREFIX + DEBUG_PREFIX + message);\r\n break;\r\n case TRACE_ID:\r\n servletContext.log(PREFIX + TRACE_PREFIX + message);\r\n break;\r\n case ERROR_ID:\r\n servletContext.log(PREFIX + ERROR_PREFIX + message);\r\n break;\r\n default:\r\n servletContext.log(PREFIX + \" : \" + message);\r\n break;\r\n }\r\n }", "public static void print(LogLevel level, LogSection... logSections)\n {\n Map<String, String> sections = defaultSections();\n Arrays.asList(logSections).forEach((logSection) -> sections.replace(logSection.getKey(), logSection.getValue()));\n\n print(level, sections);\n }", "static public void GLOBLOG(int logNumber, String logMessage) {\r\n if(logNumber <= GlobalOptions.logLevel){\r\n System.out.print(newline_prefix + logMessage);\r\n System.out.flush();\r\n }\r\n }", "protected void simpleLog(Level level, String message) {\n if (getClassLogger().isLoggable(level)) {\n TestBench.out().println(message);\n }\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4) {\n\n\t}", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6) {\n\n\t}", "public final void logTestCase(final int level, final String message)\n {\n String tempM = \"<\" + getObjectName() + \"::\" + getObjectType() + \"> \"\n + message;\n fLog.logTestCase(level, tempM);\n\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1) {\n\n\t}", "Update withLogLevel(String logLevel);", "public static void log(Object caller, Level level, String message){ \n\t\tlogger.log(level, message);\n }", "@Override\n\tpublic void printf(Level level, String format, Object... params) {\n\n\t}", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2) {\n\n\t}", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6, Object p7) {\n\n\t}", "public final void logBoth(final int level, final String message)\n {\n String tempM = \"<\" + getObjectName() + \"::\" + getObjectType() + \"> \"\n + message;\n fLog.logBoth(level, tempM);\n\n }", "public void log(String level,String message) {\n this.level = level;\n this.message = message;\n execute();\n }", "public static void log (int logLevel, String tag, String message, Class<?> loggingClass) {\n\n\t\tif (!isLoggingEnabledInConfigurationManager ())\n\t\t\treturn;\n\t\t\n\t\tlogByLevel (logLevel, tag, message, loggingClass);\n\t}", "public final void logTestSuite(final int level, final String message)\n {\n String tempM = \"<\" + getObjectName() + \"::\" + getObjectType() + \"> \"\n + message;\n fLog.logTestSuite(level, tempM);\n\n }", "@Override\n\tpublic void log(Level level, Marker marker, Message msg) {\n\n\t}", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6, Object p7, Object p8, Object p9) {\n\n\t}", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6, Object p7, Object p8) {\n\n\t}", "public void print_error( String text, int level ) {\n\t\tif ( get_debug_level() >= level ) {\n\t\t\t_platform_io.print_error( text );\n\t\t}\n\t}", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5) {\n\n\t}", "@Override\n\tpublic void log(Level level, String message, Object... params) {\n\n\t}", "@Override\n\tpublic void printf(Level level, Marker marker, String format, Object... params) {\n\n\t}", "public static void log(Level level, Object message) {\n plugin.getLogger().log(level, message.toString());\n }", "void printLog(String str)\n { printLog(str,Log.LEVEL_HIGH);\n }", "@Override\n\tpublic void log(Level level, String message, Object p0) {\n\n\t}", "@Override\n\tpublic void log(Level level, Marker marker, String message) {\n\n\t}", "public void log(String message, int msgLevel) {\n fireMessageLogged(this, message, msgLevel);\n }", "public void logIfLevel(Marker min, Marker max, String... messages);", "public static void writeMessage(String message, DebugLevel levelIn) {\n\t\tif (levelIn == DEBUG_VALUE)//&& DEBUG_VALUE != DebugLevel.NOOUTPUT)\n\t\t\tSystem.out.println(message);\n\t}", "private void printMessage(final PrintWriter errout, final Level level, final String message, final Object... params) {\n try {\n \terrout.println(getMessageLexer(-1, null, level, message, params));\n } catch (final MissingResourceException e) {\n \terrout.println(\"Can't find message string for \\\"\" + message + \"\\\"!\");\n }\n }", "public static void recordLog(String logLevel, String logInfo, Object... args)\n {\n Recorder.FunctionRecord(getRecordMetadata(), String.format(logInfo, args), logLevel);\n }", "private void printLog(String str)\n { printLog(str,Log.LEVEL_HIGH);\n }", "private void log(String pMessage) {\n\t\tif (logging)\n\t\t\tSystem.out.println(pMessage);\n\t}", "public void print(int offset, java.io.PrintStream log)\r\n\t{\r\n\t\tString sp = GrammarFactoryImpl.spaces(offset);\r\n\t\tlog.println(sp + \"(rolePlayed \" + local_id + \" \" +\r\n\t\t\t\t(rolePlayed == null ? \"___\" : rolePlayed.external()));\r\n\t\tlog.println(sp + \" (PropertyNoun \" + \r\n\t\t\t\t(property == null ? \"___\" : property.external()));\r\n\t\tif (referent != null) {\r\n\t\t\tlog.println(sp + \" (referent \" + \r\n\t\t\t\t\t((RolePhraseImpl)referent).local_id + \")\");\r\n\t\t} else if (expansion != null) {\r\n\t\t\tlog.println(sp + \" (expansion\");\r\n\t\t\texpansion.print(offset + 6, log);\r\n\t\t\tlog.println(sp + \" )\");\r\n\t\t} else {\r\n\t\t\tif (quantifier == null) log.println(sp + \" (Quantifier )\");\r\n\t\t\telse quantifier.print(offset + 4, log);\r\n\t\t\tlog.print(sp + \" (modifiers \");\r\n\t\t\tif (modifiers != null) {\r\n\t\t\t\tIterator<Modifier> it = modifiers.iterator();\r\n\t\t\t\twhile (it.hasNext()) it.next().print(offset + 6, log);\r\n\t\t\t}\r\n\t\t\tlog.println(')');\r\n\t\t\tif (domain == null) log.println(sp + \" ___\");\r\n\t\t\telse domain.print(offset + 4, log);\r\n\t\t}\r\n\t\tlog.println(sp + \"))\");\r\n\t}", "void printGivenLevel (Node root, int level)\n {\n if (root == null) {\n System.out.print(\"_ \");\n return;\n }\n if (level == 1)\n System.out.print(root.symbol + \" \");\n else if (level > 1)\n {\n printGivenLevel(root.left, level-1);\n printGivenLevel(root.right, level-1);\n }\n }", "protected void log(String msg, PrintStream printStream) {\n printStream.print(\"Continuum \" + getCommandName() + \" - \");\n printStream.println(msg);\n }", "@Override\n\tpublic void log(Level level, MessageSupplier msgSupplier) {\n\n\t}", "static public void setLogLevel(final Logger.LEVEL desiredLevel) {\n ThreadPoolWorkQueue.execute(new Runnable() {\n @Override\n public void run() {\n setLevelSync(desiredLevel);\n // we do this mostly to enable unit tests to logger.wait(100) instead of\n // Thread.sleep(100) -- it's faster, more stable, and more deterministic that way\n synchronized (WAIT_LOCK) {\n WAIT_LOCK.notifyAll();\n }\n }\n });\n }", "public final void log(Level level, String string) {\n context.getBot().log(manifest.name(), level, string);\n }", "private void changeLogLevel(String level){\n\n }", "abstract protected void logInternal(int level, String message);", "public static void log(Level level, String message)\r\n\t{\r\n\t\tLOGGER.log(level, message);\r\n\t}", "public PrintStream printf(String format, Object... args) {\n if (args[0] == \"Severity\") {\n choiceLevel((String) args[1]);\n }\n if (args[0] == \"Message\") {\n logger.log(mLevelLogger, (String) args[1]);\n }\n return this;\n }", "@Override\n\tpublic void log(Level level, Marker marker, CharSequence message) {\n\n\t}", "@Override\n\tpublic void log(Level level, Supplier<?> msgSupplier) {\n\n\t}", "public void println(int priority, String tag, String msg, Throwable tr);", "void log(Level level, String message, Throwable throwable);", "@Override\n\tpublic void log(Level level, Marker marker, MessageSupplier msgSupplier) {\n\n\t}", "void printHellow() {\n logger.debug(\"hellow world begin....\");\n logger.info(\"it's a info message\");\n logger.warn(\"it's a warning message\");\n loggerTest.warn(\"from test1 :....\");\n loggerTest.info(\"info from test1 :....\");\n\n // print internal state\n LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();\n StatusPrinter.print(lc);\n }", "public void log(int level, String msg, Object[] o) {\n if (isLoggable(level)) {\n int count = ((o == null) ? 0 : o.length);\n String formattedMessage = msg;\n\n if (count > 0) {\n MessageFormat messageFormat = new MessageFormat(\n getBundle().getString(msg));\n\n if (messageFormat != null) {\n formattedMessage = messageFormat.format(o);\n }\n } else {\n formattedMessage = getMessage(msg);\n }\n\n logInternal(level, formattedMessage);\n }\n }", "public void log(int level, String msg, Object o1) {\n if (isLoggable(level)) {\n log(level, msg, new Object[]{o1});\n }\n }", "public void log(Target target, String message, int msgLevel) {\n fireMessageLogged(target, message, msgLevel);\n }", "@Override\n\tpublic void log(Level level, Marker marker, String message, Object p0, Object p1, Object p2,\n\t\t\tObject p3, Object p4, Object p5, Object p6) {\n\n\t}", "static public void GLOBLOG(int logNumber, char logChar) {\r\n if(logNumber <= GlobalOptions.logLevel){\r\n // System.out.print(\"LOG-->\"+logChar);\r\n System.out.print(newline_prefix + logChar);\r\n System.out.flush();\r\n }\r\n }", "public static void log (int logLevel, String tag, String message) {\n\n\t\tif (!isLoggingEnabledInConfigurationManager ())\n\t\t\treturn;\n\n\t\tlogByLevel (logLevel, tag, message, null);\n\t}", "@Override\n\tpublic void log(Level level, Marker marker, String message, Object p0, Object p1, Object p2,\n\t\t\tObject p3, Object p4) {\n\n\t}", "public void log(int level, String msg, Object o1, Object o2, Object o3) {\n if (isLoggable(level)) {\n log(level, msg, new Object[]{o1, o2, o3});\n }\n }", "public static String selectMessagePrefix(String prefix) {\r\n\t\tif (prefix == \"debug\") {\r\n\t\t\treturn ChatColor.RED + \"\" + ChatColor.BOLD + \"MP-RPG: \" + ChatColor.RESET;\r\n\t\t} else {\r\n\t\t\treturn ChatColor.BOLD + \"MP-RPG: \" + ChatColor.RESET;\r\n\t\t}\r\n\t}", "@Override\n\tpublic void log(Level level, Marker marker, String message, Object p0, Object p1, Object p2,\n\t\t\tObject p3, Object p4, Object p5, Object p6, Object p7) {\n\n\t}", "public void print(Object msg, int modelevel)\n {\n int debug = 0;\n Properties prop = new Properties();\n InputStream input = null;\n\n /*Liest aus Datei den ModeLevel\n * Level: \n * 0) None\n * 1) Information (Default)\n * 2) Warning\n * 3) Error\n */\n try\n {\n\n try\n {\n // load a properties file\n prop.load(new FileReader(substructure.PathHelper.getFile(\"debug.properties\")));\n } catch (fileSystemException ex)\n {\n Logger.getLogger(Output.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n // get the property value and print it out\n try\n {\n debug = Integer.parseInt(prop.getProperty(\"MODE\"));\n } catch (Exception e)\n {\n new GuiPromptHelper(GuiPromptHelper.showWarning, \"Output: Modelevel konnte nicht gelesen werden \" + e);\n }\n\n } catch (FileNotFoundException e)\n {\n new GuiPromptHelper(GuiPromptHelper.showWarning, \"Output: Debug File konnte nicht geladen werden \" + e);\n } catch (IOException ex)\n {\n ex.printStackTrace();\n }\n\n out(msg, modelevel, debug);\n\n }", "public void log(int level, String msg) {\n if (isLoggable(level)) {\n logInternal(level, getMessage(msg));\n }\n }", "Logger loggerArrangement(String logName, String filePath, LogeLevel logLevel);", "@Override\n\tpublic void log(Level level, Marker marker, Object message) {\n\n\t}", "T generateLogMessage(String msg, PriorityLevel priorityLevel);", "@Override\n\tpublic void log(Level level, Marker marker, String message, Object... params) {\n\n\t}", "@Override\n\tpublic void log(Level level, Marker marker, Supplier<?> msgSupplier) {\n\n\t}", "@Override\n\tpublic void log(Level level, Marker marker, String message, Object p0, Object p1, Object p2,\n\t\t\tObject p3) {\n\n\t}", "static void log(\r\n Level level, String message, Iterable<? extends Module> modules)\r\n {\r\n logger.log(level, message);\r\n for (Module module : modules)\r\n {\r\n logger.log(level, \" \" + module);\r\n }\r\n }", "@Override\n\tpublic void log(Level level, Marker marker, String message, Object p0, Object p1) {\n\n\t}" ]
[ "0.74903136", "0.7098266", "0.6662336", "0.66259974", "0.6548749", "0.65091044", "0.6492052", "0.6487799", "0.6478582", "0.6443933", "0.6277463", "0.62381554", "0.6172858", "0.6148967", "0.60746944", "0.60729074", "0.5978489", "0.59694034", "0.5957585", "0.5953603", "0.593995", "0.5915806", "0.590598", "0.58189857", "0.581265", "0.5806015", "0.5804781", "0.57970107", "0.57953274", "0.5785378", "0.57782567", "0.57370335", "0.57294977", "0.5694091", "0.56933105", "0.56840366", "0.56387967", "0.5609075", "0.5602867", "0.5581801", "0.55739474", "0.55545765", "0.5554194", "0.55466783", "0.55448586", "0.55405754", "0.5523478", "0.55225366", "0.55210316", "0.5518288", "0.5501609", "0.54998845", "0.5495956", "0.5482488", "0.5476388", "0.54710436", "0.5463308", "0.5459534", "0.5451496", "0.544947", "0.54423434", "0.54383194", "0.54366", "0.54313046", "0.5425337", "0.5419478", "0.5413707", "0.54084104", "0.5407042", "0.5406555", "0.5405252", "0.5405049", "0.5402308", "0.5390832", "0.53541297", "0.53540444", "0.53391373", "0.53345114", "0.53259355", "0.5322084", "0.53204846", "0.5319702", "0.53187144", "0.53149974", "0.5312299", "0.53034836", "0.5302071", "0.52994347", "0.5295985", "0.5287298", "0.5273298", "0.5262389", "0.5260973", "0.525289", "0.5239091", "0.5237079", "0.52342", "0.5230065", "0.5226701", "0.5218223" ]
0.72330624
1
Prints a given message to a given logLevel
public static void print(LogLevel level, Object message) { print(level, String.valueOf(message)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void print(Level level, Object logMessage);", "void log(Level level, String message);", "public static void print(LogLevel level, String message)\n {\n Map<String, String> sections = defaultSections();\n sections.replace(\"message\", message);\n\n print(level, sections);\n }", "public void log(String message, int loglevel) {\n if (managingPc != null) {\n managingPc.log(message, loglevel);\n } else {\n (loglevel > Project.MSG_WARN ? System.out : System.err).println(message);\n }\n }", "@Override\n\tpublic void log(Level level, String message) {\n\n\t}", "private static void log(Level level, Object message) {\n logger.info(LogUtil.class.getName(),level, message,null);\n }", "public void LOG(int logNumber, String logMessage) {\r\n if(logNumber <= logLevel) {\r\n System.out.print(newline_prefix + logMessage);\r\n System.out.flush();\r\n }\r\n }", "protected void simpleLog(Level level, String message) {\n if (getClassLogger().isLoggable(level)) {\n TestBench.out().println(message);\n }\n }", "public static void Log(String Message, int Level)\n {\n if(Level == 0)\n {\n System.out.println(\"[\" + Reference.MOD_ID + \"]\" + \" \" + Message);\n }\n \n if(Level == 1)\n {\n System.out.println(\"[\" + Reference.MOD_ID + \"]\" + \" \" + Message);\n }\n \n if(Level == 2)\n {\n System.out.println(\"[\" + Reference.MOD_ID + \"]\" + \" \" + Message);\n }\n }", "public void log(Marker level, String... message);", "protected abstract void log(T level, Object message);", "public void log(int level, String message)\r\n {\r\n if (!isLevelEnabled(level))\r\n {\r\n return;\r\n }\r\n\r\n switch (level)\r\n {\r\n case WARN_ID:\r\n servletContext.log(PREFIX + WARN_PREFIX + message);\r\n break;\r\n case INFO_ID:\r\n servletContext.log(PREFIX + INFO_PREFIX + message);\r\n break;\r\n case DEBUG_ID:\r\n servletContext.log(PREFIX + DEBUG_PREFIX + message);\r\n break;\r\n case TRACE_ID:\r\n servletContext.log(PREFIX + TRACE_PREFIX + message);\r\n break;\r\n case ERROR_ID:\r\n servletContext.log(PREFIX + ERROR_PREFIX + message);\r\n break;\r\n default:\r\n servletContext.log(PREFIX + \" : \" + message);\r\n break;\r\n }\r\n }", "@Override\n\tpublic void log(Level level, Message msg) {\n\n\t}", "public void log(String level,String message) {\n this.level = level;\n this.message = message;\n execute();\n }", "private void printLog(String str, int level)\n { if (log!=null) log.println(\"AudioApp: \"+str, LoopbackMediaApp.LOG_OFFSET+level);\n if (level<=Log.LEVEL_HIGH) System.out.println(\"AudioApp: \"+str);\n }", "@Override\n\tpublic void writeToLog(String log, LogLevelEnum logLevel, String className) {\n\t\tSystem.out.println(className + \" : \" + logLevel.toString() + \" : \" + log);\n\t}", "public void log(String message, int msgLevel) {\n fireMessageLogged(this, message, msgLevel);\n }", "@Override\n\tpublic void log(Level level, Object message) {\n\n\t}", "public static void log(Level level, Object message) {\n plugin.getLogger().log(level, message.toString());\n }", "public static void writeMessage(String message, DebugLevel levelIn) {\n\t\tif (levelIn == DEBUG_VALUE)//&& DEBUG_VALUE != DebugLevel.NOOUTPUT)\n\t\t\tSystem.out.println(message);\n\t}", "public void log( Level level, String msg ) {\r\n\t\tlogger.log( level, logPrefix + \" \" + msg );\r\n\t}", "public void print(Level level, String format, Object... args) {\n if (bach.debug() || level.getSeverity() >= Level.INFO.getSeverity()) {\n var writer = level.getSeverity() <= Level.INFO.getSeverity() ? out : err;\n writer.write(String.format(format, args));\n writer.write(System.lineSeparator());\n }\n }", "@Override\n\tpublic void log(Level level, CharSequence message) {\n\n\t}", "public static void log(Level level, String message)\r\n\t{\r\n\t\tLOGGER.log(level, message);\r\n\t}", "public void logIfLevel(Marker ifLevel, String... messages);", "public void print_error( String text, int level ) {\n\t\tif ( get_debug_level() >= level ) {\n\t\t\t_platform_io.print_error( text );\n\t\t}\n\t}", "void printLog(String str, int level)\n { if (log!=null) log.println(\"CommandLineUA: \"+str, UserAgent.LOG_OFFSET+level);\n }", "private void log(String pMessage) {\n\t\tif (logging)\n\t\t\tSystem.out.println(pMessage);\n\t}", "public static void log (int logLevel, String tag, String message, Class<?> loggingClass) {\n\n\t\tif (!isLoggingEnabledInConfigurationManager ())\n\t\t\treturn;\n\t\t\n\t\tlogByLevel (logLevel, tag, message, loggingClass);\n\t}", "void log(Level level, String message, Throwable throwable);", "public final void logTestCase(final int level, final String message)\n {\n String tempM = \"<\" + getObjectName() + \"::\" + getObjectType() + \"> \"\n + message;\n fLog.logTestCase(level, tempM);\n\n }", "public void log(Target target, String message, int msgLevel) {\n fireMessageLogged(target, message, msgLevel);\n }", "static public void GLOBLOG(int logNumber, String logMessage) {\r\n if(logNumber <= GlobalOptions.logLevel){\r\n System.out.print(newline_prefix + logMessage);\r\n System.out.flush();\r\n }\r\n }", "public final void logTestSuite(final int level, final String message)\n {\n String tempM = \"<\" + getObjectName() + \"::\" + getObjectType() + \"> \"\n + message;\n fLog.logTestSuite(level, tempM);\n\n }", "protected void report(String msg, Level level) {\n\t\tif (verbosity!=null && verbosity.intValue() > level.intValue()) return;\n\t\tLog.report(LOGTAG, msg, level);\n\t}", "public static void log(Object caller, Level level, String message){ \n\t\tlogger.log(level, message);\n }", "public static void print(LogLevel level, Map<String, String> logSections)\n {\n levels.get(level.getLevel()).log(FormatUtil.formatLog(logPatterns, logSections));\n }", "public static void print(LogLevel level, String prefix, Object message)\n {\n print(level, prefix, String.valueOf(message));\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6) {\n\n\t}", "public static void writeLog(LOG_LEVEL logLevel, String logMsg) {\n if (!JAVA_LOG_ENABLED) {\n JAVA_LOG_ENABLED = true;\n }\n writeLog(logLevel, logMsg, JAVA_LOG_ENABLED);\n }", "public final void log(Level level, String string) {\n context.getBot().log(manifest.name(), level, string);\n }", "public static void log (int logLevel, String tag, String message) {\n\n\t\tif (!isLoggingEnabledInConfigurationManager ())\n\t\t\treturn;\n\n\t\tlogByLevel (logLevel, tag, message, null);\n\t}", "public static void print(LogLevel level, String prefix, String message)\n {\n Map<String, String> sections = defaultSections();\n sections.replace(\"prefix\", prefix);\n sections.replace(\"message\", message);\n\n print(level, sections);\n }", "private void log(String entry, Log.Level logLevel) {\n\t\tif (logObject != null) {\n\t\t\tlogObject.makeEntry(entry, logLevel);\n\t\t} else {\n\t\t\tSystem.out.println(entry);\n\t\t}\n\t}", "public void LOG(int logNumber, char logChar) {\r\n if(logNumber <= logLevel){\r\n System.out.print(newline_prefix + logChar);\r\n System.out.flush();\r\n }\r\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6, Object p7, Object p8, Object p9) {\n\n\t}", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3) {\n\n\t}", "static public void setLogLevel(final Logger.LEVEL desiredLevel) {\n ThreadPoolWorkQueue.execute(new Runnable() {\n @Override\n public void run() {\n setLevelSync(desiredLevel);\n // we do this mostly to enable unit tests to logger.wait(100) instead of\n // Thread.sleep(100) -- it's faster, more stable, and more deterministic that way\n synchronized (WAIT_LOCK) {\n WAIT_LOCK.notifyAll();\n }\n }\n });\n }", "Update withLogLevel(String logLevel);", "public void print(Object msg, int modelevel)\n {\n int debug = 0;\n Properties prop = new Properties();\n InputStream input = null;\n\n /*Liest aus Datei den ModeLevel\n * Level: \n * 0) None\n * 1) Information (Default)\n * 2) Warning\n * 3) Error\n */\n try\n {\n\n try\n {\n // load a properties file\n prop.load(new FileReader(substructure.PathHelper.getFile(\"debug.properties\")));\n } catch (fileSystemException ex)\n {\n Logger.getLogger(Output.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n // get the property value and print it out\n try\n {\n debug = Integer.parseInt(prop.getProperty(\"MODE\"));\n } catch (Exception e)\n {\n new GuiPromptHelper(GuiPromptHelper.showWarning, \"Output: Modelevel konnte nicht gelesen werden \" + e);\n }\n\n } catch (FileNotFoundException e)\n {\n new GuiPromptHelper(GuiPromptHelper.showWarning, \"Output: Debug File konnte nicht geladen werden \" + e);\n } catch (IOException ex)\n {\n ex.printStackTrace();\n }\n\n out(msg, modelevel, debug);\n\n }", "public void logVelocityMessage(int level, String message)\n {\n }", "static void log(\r\n Level level, String message, Iterable<? extends Module> modules)\r\n {\r\n logger.log(level, message);\r\n for (Module module : modules)\r\n {\r\n logger.log(level, \" \" + module);\r\n }\r\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2) {\n\n\t}", "abstract protected void logInternal(int level, String message);", "public final void logBoth(final int level, final String message)\n {\n String tempM = \"<\" + getObjectName() + \"::\" + getObjectType() + \"> \"\n + message;\n fLog.logBoth(level, tempM);\n\n }", "@Override\n\tpublic void log(Level level, String message, Object... params) {\n\n\t}", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4) {\n\n\t}", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1) {\n\n\t}", "@Override\n\tpublic void log(Level level, String message, Object p0) {\n\n\t}", "public void log(int level, String msg) {\n if (isLoggable(level)) {\n logInternal(level, getMessage(msg));\n }\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6, Object p7) {\n\n\t}", "private void printMessage(final PrintWriter errout, final Level level, final String message, final Object... params) {\n try {\n \terrout.println(getMessageLexer(-1, null, level, message, params));\n } catch (final MissingResourceException e) {\n \terrout.println(\"Can't find message string for \\\"\" + message + \"\\\"!\");\n }\n }", "private void changeLogLevel(String level){\n\n }", "public static void print(LogLevel level, LogSection... logSections)\n {\n Map<String, String> sections = defaultSections();\n Arrays.asList(logSections).forEach((logSection) -> sections.replace(logSection.getKey(), logSection.getValue()));\n\n print(level, sections);\n }", "public void setLogLevel(int level) {\n logLevel = level;\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5) {\n\n\t}", "public static void logMessage(Object message, Priority p) {\n\t\t\n\t\tmessage = message.toString();\n\t\tswitch (p) {\n\t\tcase WARN:\n\t\t\tif (enableWarn)\n\t\t\t\tlogWarning(getPrefix() + \"[WARNING] \" + message);\n\t\t\tbreak;\n\t\tcase ERROR:\n\t\t\tif (enableError)\n\t\t\t\tlogError(getPrefix() + \"[ERROR] \" + message);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tif (p.intValue >= minPriority.intValue) {\n\t\t\t\tlogMessage(getPrefix() + message);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}", "public static void setLevel(int level){\n\tlogLevel = level;\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6, Object p7, Object p8) {\n\n\t}", "private void println(String message) {\n Log.println(level, tag, message);\n }", "public static void log(int severity, String message)\n {\n log(severity, message, null);\n }", "private void log(String message) {\r\n\t\tif (ChartFrameSelectParametersMenuActionListener.printLog && Main.isLoggingEnabled()) {\r\n\t\t\tSystem.out.println(this.getClass().getName() + \".\" + message);\r\n\t\t}\r\n\t}", "void printLog(String str)\n { printLog(str,Log.LEVEL_HIGH);\n }", "private void log(String message) {\r\n\t\tif (AxisDisplaySettingsPanel.printLog && Main.isLoggingEnabled()) {\r\n\t\t\tSystem.out.println(this.getClass().getName() + \".\" + message);\r\n\t\t}\r\n\t}", "public void log(Task task, String message, int msgLevel) {\n fireMessageLogged(task, message, msgLevel);\n }", "public void setLogLevel(Level logLevel) {\n\t\tthis.logLevel = logLevel;\n\t}", "public void setLoggingLevel(String loggingLevel) {\n this.loggingLevel = loggingLevel;\n }", "private void printLog(String str)\n { printLog(str,Log.LEVEL_HIGH);\n }", "public void writeToLog(Level level, Object msg) {\n\t\tif(this.loggingFlag)\n\t\t\tthis.logger.log(level, \"MonitoringAgent\" + \": \" + msg);\n\t}", "@Override\n\tpublic void log(Level level, Marker marker, Message msg) {\n\n\t}", "@Override\n public void info(String message) {\n if (Level.INFO.getPriority() <= level.getPriority()) {\n print(\"INFO: \" + message);\n }\n }", "public static void logEvent(String loggerName, LevelProxy level, String message) {\t\r\n\t\tLoggerProxy logger = getLogger(loggerName, true);\r\n\t\tlogger.log(Level.toLevel(level.getIntValue()), message);\t\r\n\t}", "protected abstract void onPrintBorderedMessage(int logLevel, String tag, String msg);", "public static void setLogLevel(int level) {\n mLogLevel = level;\n }", "private void log(String message) {\n System.out.println(message);\n }", "private void log(String message) {\n System.out.println(message);\n }", "public static void logMessage(Object message, int p) {\n\t\t// Priority to be converted into\n\t\tPriority enumValue;\n\n\t\tswitch (p) {\n\t\tcase 0:\n\t\t\tenumValue = Priority.LOW;\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tenumValue = Priority.MID;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tenumValue = Priority.HIGH;\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tenumValue = Priority.WARN;\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tenumValue = Priority.ERROR;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tenumValue = Priority.LOW;\n\t\t\tlogMessage(\"Priority value out of range: \" + p, Priority.ERROR);\n\t\t\tlogMessage(\"(The message was \\\"\" + message.toString() + \"\\\")\", Priority.ERROR);\n\t\t\tbreak;\n\t\t}\n\n\t\tlogMessage(message, enumValue);\n\t}", "protected void setLogLevel(int logLevel) \n\t{\n\t\tthis.logLevel = logLevel;\n\t}", "private static void log(String message) {\n System.out.println(message);\n }", "public void log(int level, String msg, Object[] o) {\n if (isLoggable(level)) {\n int count = ((o == null) ? 0 : o.length);\n String formattedMessage = msg;\n\n if (count > 0) {\n MessageFormat messageFormat = new MessageFormat(\n getBundle().getString(msg));\n\n if (messageFormat != null) {\n formattedMessage = messageFormat.format(o);\n }\n } else {\n formattedMessage = getMessage(msg);\n }\n\n logInternal(level, formattedMessage);\n }\n }", "public void logs(Object message) {\n System.out.println(message.toString());\n }", "@Override\n\tpublic void log(Level level, MessageSupplier msgSupplier) {\n\n\t}", "public void notifyProgramMessage(Level level, String message, Object ... arguments) {\n message = MessageFormat.format(SixDOFArmResources.getString(message), arguments);\n if (level == Level.SEVERE) {\n outputTextArea.append(\"<html color=\\\"red\\\">\"+message+\"</html>\");\n } else if (level == Level.SEVERE) {\n outputTextArea.append(\"<html color=\\\"red\\\">\"+message+\"</html>\");\n } else {\n outputTextArea.append(message);\n }\n }", "public void log(int level, String msg, Object o1) {\n if (isLoggable(level)) {\n log(level, msg, new Object[]{o1});\n }\n }", "private static void log(String msg) {\n System.out.println(msg);\n }", "@Override\n\tpublic void log(Level level, Marker marker, String message) {\n\n\t}", "public void logIfLevel(Marker min, Marker max, String... messages);", "@Override\n public void debug(String message) {\n if (Level.DEBUG.getPriority() <= level.getPriority()) {\n print(\"DEBUG: \" + message);\n }\n\n }", "T generateLogMessage(String msg, PriorityLevel priorityLevel);", "public void log(String msg)\n {\n Bukkit.getServer().getConsoleSender().sendMessage(color(\"&c&l[LOG]&f \" + msg));\n }" ]
[ "0.77753884", "0.7556108", "0.73950046", "0.71487033", "0.69705963", "0.6903231", "0.68158746", "0.68043494", "0.68038815", "0.67665595", "0.67625743", "0.6753949", "0.6751106", "0.6727194", "0.669622", "0.66760945", "0.6660076", "0.6646529", "0.659491", "0.6583174", "0.65631235", "0.6549717", "0.6537612", "0.65122586", "0.63779277", "0.6328302", "0.6284546", "0.62802726", "0.627725", "0.62597746", "0.62199557", "0.62163687", "0.62051374", "0.61893475", "0.6177316", "0.6170112", "0.615628", "0.61559683", "0.61428994", "0.61405706", "0.61309403", "0.6122534", "0.6121682", "0.6120862", "0.61195207", "0.6115241", "0.6107814", "0.60971224", "0.60915667", "0.6087057", "0.60812956", "0.60780984", "0.60695505", "0.6068856", "0.6059643", "0.6051652", "0.60443544", "0.6034484", "0.60202646", "0.6009445", "0.59936684", "0.5990093", "0.59885395", "0.5985508", "0.598416", "0.5974486", "0.5970245", "0.59613925", "0.5960594", "0.5953144", "0.5927527", "0.59065604", "0.5889526", "0.58881444", "0.5884569", "0.5881399", "0.58769816", "0.58420175", "0.5838708", "0.5821027", "0.5806868", "0.5797135", "0.57893646", "0.57860696", "0.57840604", "0.5778762", "0.5764576", "0.5764364", "0.576121", "0.5742448", "0.57229525", "0.572276", "0.5721723", "0.57001954", "0.5698452", "0.5698071", "0.5697421", "0.568989", "0.56855154", "0.56846154" ]
0.7446293
2
Prints a given message to a given logLevel
public static void print(LogLevel level, String message) { Map<String, String> sections = defaultSections(); sections.replace("message", message); print(level, sections); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void print(Level level, Object logMessage);", "void log(Level level, String message);", "public static void print(LogLevel level, Object message)\n {\n print(level, String.valueOf(message));\n }", "public void log(String message, int loglevel) {\n if (managingPc != null) {\n managingPc.log(message, loglevel);\n } else {\n (loglevel > Project.MSG_WARN ? System.out : System.err).println(message);\n }\n }", "@Override\n\tpublic void log(Level level, String message) {\n\n\t}", "private static void log(Level level, Object message) {\n logger.info(LogUtil.class.getName(),level, message,null);\n }", "public void LOG(int logNumber, String logMessage) {\r\n if(logNumber <= logLevel) {\r\n System.out.print(newline_prefix + logMessage);\r\n System.out.flush();\r\n }\r\n }", "protected void simpleLog(Level level, String message) {\n if (getClassLogger().isLoggable(level)) {\n TestBench.out().println(message);\n }\n }", "public static void Log(String Message, int Level)\n {\n if(Level == 0)\n {\n System.out.println(\"[\" + Reference.MOD_ID + \"]\" + \" \" + Message);\n }\n \n if(Level == 1)\n {\n System.out.println(\"[\" + Reference.MOD_ID + \"]\" + \" \" + Message);\n }\n \n if(Level == 2)\n {\n System.out.println(\"[\" + Reference.MOD_ID + \"]\" + \" \" + Message);\n }\n }", "public void log(Marker level, String... message);", "protected abstract void log(T level, Object message);", "public void log(int level, String message)\r\n {\r\n if (!isLevelEnabled(level))\r\n {\r\n return;\r\n }\r\n\r\n switch (level)\r\n {\r\n case WARN_ID:\r\n servletContext.log(PREFIX + WARN_PREFIX + message);\r\n break;\r\n case INFO_ID:\r\n servletContext.log(PREFIX + INFO_PREFIX + message);\r\n break;\r\n case DEBUG_ID:\r\n servletContext.log(PREFIX + DEBUG_PREFIX + message);\r\n break;\r\n case TRACE_ID:\r\n servletContext.log(PREFIX + TRACE_PREFIX + message);\r\n break;\r\n case ERROR_ID:\r\n servletContext.log(PREFIX + ERROR_PREFIX + message);\r\n break;\r\n default:\r\n servletContext.log(PREFIX + \" : \" + message);\r\n break;\r\n }\r\n }", "@Override\n\tpublic void log(Level level, Message msg) {\n\n\t}", "public void log(String level,String message) {\n this.level = level;\n this.message = message;\n execute();\n }", "private void printLog(String str, int level)\n { if (log!=null) log.println(\"AudioApp: \"+str, LoopbackMediaApp.LOG_OFFSET+level);\n if (level<=Log.LEVEL_HIGH) System.out.println(\"AudioApp: \"+str);\n }", "@Override\n\tpublic void writeToLog(String log, LogLevelEnum logLevel, String className) {\n\t\tSystem.out.println(className + \" : \" + logLevel.toString() + \" : \" + log);\n\t}", "public void log(String message, int msgLevel) {\n fireMessageLogged(this, message, msgLevel);\n }", "@Override\n\tpublic void log(Level level, Object message) {\n\n\t}", "public static void log(Level level, Object message) {\n plugin.getLogger().log(level, message.toString());\n }", "public static void writeMessage(String message, DebugLevel levelIn) {\n\t\tif (levelIn == DEBUG_VALUE)//&& DEBUG_VALUE != DebugLevel.NOOUTPUT)\n\t\t\tSystem.out.println(message);\n\t}", "public void log( Level level, String msg ) {\r\n\t\tlogger.log( level, logPrefix + \" \" + msg );\r\n\t}", "public void print(Level level, String format, Object... args) {\n if (bach.debug() || level.getSeverity() >= Level.INFO.getSeverity()) {\n var writer = level.getSeverity() <= Level.INFO.getSeverity() ? out : err;\n writer.write(String.format(format, args));\n writer.write(System.lineSeparator());\n }\n }", "@Override\n\tpublic void log(Level level, CharSequence message) {\n\n\t}", "public static void log(Level level, String message)\r\n\t{\r\n\t\tLOGGER.log(level, message);\r\n\t}", "public void logIfLevel(Marker ifLevel, String... messages);", "public void print_error( String text, int level ) {\n\t\tif ( get_debug_level() >= level ) {\n\t\t\t_platform_io.print_error( text );\n\t\t}\n\t}", "void printLog(String str, int level)\n { if (log!=null) log.println(\"CommandLineUA: \"+str, UserAgent.LOG_OFFSET+level);\n }", "private void log(String pMessage) {\n\t\tif (logging)\n\t\t\tSystem.out.println(pMessage);\n\t}", "public static void log (int logLevel, String tag, String message, Class<?> loggingClass) {\n\n\t\tif (!isLoggingEnabledInConfigurationManager ())\n\t\t\treturn;\n\t\t\n\t\tlogByLevel (logLevel, tag, message, loggingClass);\n\t}", "void log(Level level, String message, Throwable throwable);", "public final void logTestCase(final int level, final String message)\n {\n String tempM = \"<\" + getObjectName() + \"::\" + getObjectType() + \"> \"\n + message;\n fLog.logTestCase(level, tempM);\n\n }", "public void log(Target target, String message, int msgLevel) {\n fireMessageLogged(target, message, msgLevel);\n }", "static public void GLOBLOG(int logNumber, String logMessage) {\r\n if(logNumber <= GlobalOptions.logLevel){\r\n System.out.print(newline_prefix + logMessage);\r\n System.out.flush();\r\n }\r\n }", "public final void logTestSuite(final int level, final String message)\n {\n String tempM = \"<\" + getObjectName() + \"::\" + getObjectType() + \"> \"\n + message;\n fLog.logTestSuite(level, tempM);\n\n }", "protected void report(String msg, Level level) {\n\t\tif (verbosity!=null && verbosity.intValue() > level.intValue()) return;\n\t\tLog.report(LOGTAG, msg, level);\n\t}", "public static void log(Object caller, Level level, String message){ \n\t\tlogger.log(level, message);\n }", "public static void print(LogLevel level, String prefix, Object message)\n {\n print(level, prefix, String.valueOf(message));\n }", "public static void print(LogLevel level, Map<String, String> logSections)\n {\n levels.get(level.getLevel()).log(FormatUtil.formatLog(logPatterns, logSections));\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6) {\n\n\t}", "public static void writeLog(LOG_LEVEL logLevel, String logMsg) {\n if (!JAVA_LOG_ENABLED) {\n JAVA_LOG_ENABLED = true;\n }\n writeLog(logLevel, logMsg, JAVA_LOG_ENABLED);\n }", "public final void log(Level level, String string) {\n context.getBot().log(manifest.name(), level, string);\n }", "public static void print(LogLevel level, String prefix, String message)\n {\n Map<String, String> sections = defaultSections();\n sections.replace(\"prefix\", prefix);\n sections.replace(\"message\", message);\n\n print(level, sections);\n }", "public static void log (int logLevel, String tag, String message) {\n\n\t\tif (!isLoggingEnabledInConfigurationManager ())\n\t\t\treturn;\n\n\t\tlogByLevel (logLevel, tag, message, null);\n\t}", "private void log(String entry, Log.Level logLevel) {\n\t\tif (logObject != null) {\n\t\t\tlogObject.makeEntry(entry, logLevel);\n\t\t} else {\n\t\t\tSystem.out.println(entry);\n\t\t}\n\t}", "public void LOG(int logNumber, char logChar) {\r\n if(logNumber <= logLevel){\r\n System.out.print(newline_prefix + logChar);\r\n System.out.flush();\r\n }\r\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6, Object p7, Object p8, Object p9) {\n\n\t}", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3) {\n\n\t}", "static public void setLogLevel(final Logger.LEVEL desiredLevel) {\n ThreadPoolWorkQueue.execute(new Runnable() {\n @Override\n public void run() {\n setLevelSync(desiredLevel);\n // we do this mostly to enable unit tests to logger.wait(100) instead of\n // Thread.sleep(100) -- it's faster, more stable, and more deterministic that way\n synchronized (WAIT_LOCK) {\n WAIT_LOCK.notifyAll();\n }\n }\n });\n }", "Update withLogLevel(String logLevel);", "public void print(Object msg, int modelevel)\n {\n int debug = 0;\n Properties prop = new Properties();\n InputStream input = null;\n\n /*Liest aus Datei den ModeLevel\n * Level: \n * 0) None\n * 1) Information (Default)\n * 2) Warning\n * 3) Error\n */\n try\n {\n\n try\n {\n // load a properties file\n prop.load(new FileReader(substructure.PathHelper.getFile(\"debug.properties\")));\n } catch (fileSystemException ex)\n {\n Logger.getLogger(Output.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n // get the property value and print it out\n try\n {\n debug = Integer.parseInt(prop.getProperty(\"MODE\"));\n } catch (Exception e)\n {\n new GuiPromptHelper(GuiPromptHelper.showWarning, \"Output: Modelevel konnte nicht gelesen werden \" + e);\n }\n\n } catch (FileNotFoundException e)\n {\n new GuiPromptHelper(GuiPromptHelper.showWarning, \"Output: Debug File konnte nicht geladen werden \" + e);\n } catch (IOException ex)\n {\n ex.printStackTrace();\n }\n\n out(msg, modelevel, debug);\n\n }", "public void logVelocityMessage(int level, String message)\n {\n }", "static void log(\r\n Level level, String message, Iterable<? extends Module> modules)\r\n {\r\n logger.log(level, message);\r\n for (Module module : modules)\r\n {\r\n logger.log(level, \" \" + module);\r\n }\r\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2) {\n\n\t}", "abstract protected void logInternal(int level, String message);", "public final void logBoth(final int level, final String message)\n {\n String tempM = \"<\" + getObjectName() + \"::\" + getObjectType() + \"> \"\n + message;\n fLog.logBoth(level, tempM);\n\n }", "@Override\n\tpublic void log(Level level, String message, Object... params) {\n\n\t}", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4) {\n\n\t}", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1) {\n\n\t}", "@Override\n\tpublic void log(Level level, String message, Object p0) {\n\n\t}", "public void log(int level, String msg) {\n if (isLoggable(level)) {\n logInternal(level, getMessage(msg));\n }\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6, Object p7) {\n\n\t}", "private void printMessage(final PrintWriter errout, final Level level, final String message, final Object... params) {\n try {\n \terrout.println(getMessageLexer(-1, null, level, message, params));\n } catch (final MissingResourceException e) {\n \terrout.println(\"Can't find message string for \\\"\" + message + \"\\\"!\");\n }\n }", "private void changeLogLevel(String level){\n\n }", "public void setLogLevel(int level) {\n logLevel = level;\n }", "public static void print(LogLevel level, LogSection... logSections)\n {\n Map<String, String> sections = defaultSections();\n Arrays.asList(logSections).forEach((logSection) -> sections.replace(logSection.getKey(), logSection.getValue()));\n\n print(level, sections);\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5) {\n\n\t}", "public static void logMessage(Object message, Priority p) {\n\t\t\n\t\tmessage = message.toString();\n\t\tswitch (p) {\n\t\tcase WARN:\n\t\t\tif (enableWarn)\n\t\t\t\tlogWarning(getPrefix() + \"[WARNING] \" + message);\n\t\t\tbreak;\n\t\tcase ERROR:\n\t\t\tif (enableError)\n\t\t\t\tlogError(getPrefix() + \"[ERROR] \" + message);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tif (p.intValue >= minPriority.intValue) {\n\t\t\t\tlogMessage(getPrefix() + message);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}", "public static void setLevel(int level){\n\tlogLevel = level;\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6, Object p7, Object p8) {\n\n\t}", "private void println(String message) {\n Log.println(level, tag, message);\n }", "public static void log(int severity, String message)\n {\n log(severity, message, null);\n }", "private void log(String message) {\r\n\t\tif (ChartFrameSelectParametersMenuActionListener.printLog && Main.isLoggingEnabled()) {\r\n\t\t\tSystem.out.println(this.getClass().getName() + \".\" + message);\r\n\t\t}\r\n\t}", "void printLog(String str)\n { printLog(str,Log.LEVEL_HIGH);\n }", "private void log(String message) {\r\n\t\tif (AxisDisplaySettingsPanel.printLog && Main.isLoggingEnabled()) {\r\n\t\t\tSystem.out.println(this.getClass().getName() + \".\" + message);\r\n\t\t}\r\n\t}", "public void log(Task task, String message, int msgLevel) {\n fireMessageLogged(task, message, msgLevel);\n }", "public void setLogLevel(Level logLevel) {\n\t\tthis.logLevel = logLevel;\n\t}", "public void setLoggingLevel(String loggingLevel) {\n this.loggingLevel = loggingLevel;\n }", "public void writeToLog(Level level, Object msg) {\n\t\tif(this.loggingFlag)\n\t\t\tthis.logger.log(level, \"MonitoringAgent\" + \": \" + msg);\n\t}", "private void printLog(String str)\n { printLog(str,Log.LEVEL_HIGH);\n }", "@Override\n\tpublic void log(Level level, Marker marker, Message msg) {\n\n\t}", "@Override\n public void info(String message) {\n if (Level.INFO.getPriority() <= level.getPriority()) {\n print(\"INFO: \" + message);\n }\n }", "public static void logEvent(String loggerName, LevelProxy level, String message) {\t\r\n\t\tLoggerProxy logger = getLogger(loggerName, true);\r\n\t\tlogger.log(Level.toLevel(level.getIntValue()), message);\t\r\n\t}", "protected abstract void onPrintBorderedMessage(int logLevel, String tag, String msg);", "public static void setLogLevel(int level) {\n mLogLevel = level;\n }", "private void log(String message) {\n System.out.println(message);\n }", "private void log(String message) {\n System.out.println(message);\n }", "protected void setLogLevel(int logLevel) \n\t{\n\t\tthis.logLevel = logLevel;\n\t}", "public static void logMessage(Object message, int p) {\n\t\t// Priority to be converted into\n\t\tPriority enumValue;\n\n\t\tswitch (p) {\n\t\tcase 0:\n\t\t\tenumValue = Priority.LOW;\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tenumValue = Priority.MID;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tenumValue = Priority.HIGH;\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tenumValue = Priority.WARN;\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tenumValue = Priority.ERROR;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tenumValue = Priority.LOW;\n\t\t\tlogMessage(\"Priority value out of range: \" + p, Priority.ERROR);\n\t\t\tlogMessage(\"(The message was \\\"\" + message.toString() + \"\\\")\", Priority.ERROR);\n\t\t\tbreak;\n\t\t}\n\n\t\tlogMessage(message, enumValue);\n\t}", "private static void log(String message) {\n System.out.println(message);\n }", "public void log(int level, String msg, Object[] o) {\n if (isLoggable(level)) {\n int count = ((o == null) ? 0 : o.length);\n String formattedMessage = msg;\n\n if (count > 0) {\n MessageFormat messageFormat = new MessageFormat(\n getBundle().getString(msg));\n\n if (messageFormat != null) {\n formattedMessage = messageFormat.format(o);\n }\n } else {\n formattedMessage = getMessage(msg);\n }\n\n logInternal(level, formattedMessage);\n }\n }", "public void notifyProgramMessage(Level level, String message, Object ... arguments) {\n message = MessageFormat.format(SixDOFArmResources.getString(message), arguments);\n if (level == Level.SEVERE) {\n outputTextArea.append(\"<html color=\\\"red\\\">\"+message+\"</html>\");\n } else if (level == Level.SEVERE) {\n outputTextArea.append(\"<html color=\\\"red\\\">\"+message+\"</html>\");\n } else {\n outputTextArea.append(message);\n }\n }", "@Override\n\tpublic void log(Level level, MessageSupplier msgSupplier) {\n\n\t}", "public void logs(Object message) {\n System.out.println(message.toString());\n }", "public void log(int level, String msg, Object o1) {\n if (isLoggable(level)) {\n log(level, msg, new Object[]{o1});\n }\n }", "@Override\n\tpublic void log(Level level, Marker marker, String message) {\n\n\t}", "public void logIfLevel(Marker min, Marker max, String... messages);", "private static void log(String msg) {\n System.out.println(msg);\n }", "@Override\n public void debug(String message) {\n if (Level.DEBUG.getPriority() <= level.getPriority()) {\n print(\"DEBUG: \" + message);\n }\n\n }", "T generateLogMessage(String msg, PriorityLevel priorityLevel);", "public void log(String msg)\n {\n Bukkit.getServer().getConsoleSender().sendMessage(color(\"&c&l[LOG]&f \" + msg));\n }" ]
[ "0.777361", "0.7555203", "0.7446264", "0.7147347", "0.69695306", "0.6903131", "0.6812683", "0.68046635", "0.68038195", "0.6766391", "0.6760556", "0.67529094", "0.6749466", "0.6726444", "0.6694191", "0.6674459", "0.66596127", "0.6645467", "0.65946156", "0.6586125", "0.656093", "0.6550017", "0.6537327", "0.6511966", "0.637899", "0.63290274", "0.62831175", "0.6277742", "0.62739897", "0.6258425", "0.6219555", "0.62146276", "0.6203548", "0.61896044", "0.6177674", "0.61684704", "0.6155443", "0.61543787", "0.61404437", "0.6138729", "0.61305493", "0.6121138", "0.61192673", "0.61190736", "0.6117805", "0.6112866", "0.61054987", "0.60971344", "0.6091817", "0.6088897", "0.6082494", "0.60763496", "0.6067356", "0.6066785", "0.6059361", "0.60489774", "0.6042058", "0.6032534", "0.60185695", "0.6007493", "0.59904486", "0.59902287", "0.59897506", "0.59840363", "0.5983009", "0.5972715", "0.59684783", "0.596206", "0.5958854", "0.59525275", "0.5926704", "0.59040445", "0.5886282", "0.5885384", "0.58833516", "0.5880246", "0.5876951", "0.58389455", "0.58387095", "0.58198607", "0.5807478", "0.5795637", "0.578716", "0.57871443", "0.578189", "0.57765657", "0.57639354", "0.5763422", "0.57591033", "0.5740998", "0.57243335", "0.5721659", "0.5721524", "0.5698471", "0.5697421", "0.56971073", "0.5695962", "0.5690218", "0.5684363", "0.5682568" ]
0.7394987
3
Prints a given prefix and message to a given logLevel
public static void print(LogLevel level, String prefix, String message) { Map<String, String> sections = defaultSections(); sections.replace("prefix", prefix); sections.replace("message", message); print(level, sections); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void print(LogLevel level, String prefix, Object message)\n {\n print(level, prefix, String.valueOf(message));\n }", "public abstract void print(Level level, Object logMessage);", "public static void print(LogLevel level, String message)\n {\n Map<String, String> sections = defaultSections();\n sections.replace(\"message\", message);\n\n print(level, sections);\n }", "void log(Level level, String message);", "public void print(Level level, String format, Object... args) {\n if (bach.debug() || level.getSeverity() >= Level.INFO.getSeverity()) {\n var writer = level.getSeverity() <= Level.INFO.getSeverity() ? out : err;\n writer.write(String.format(format, args));\n writer.write(System.lineSeparator());\n }\n }", "protected String getMessageWithPrefix(int level, String message) {\n MessageFormat messageFormat = new MessageFormat(\n getMessages().getString(\"logging_prefix\"));\t// NOI18N\n\n return messageFormat.format(new String[]{toString(level), message});\n }", "private void printLog(String str, int level)\n { if (log!=null) log.println(\"AudioApp: \"+str, LoopbackMediaApp.LOG_OFFSET+level);\n if (level<=Log.LEVEL_HIGH) System.out.println(\"AudioApp: \"+str);\n }", "public static void print(LogLevel level, Object message)\n {\n print(level, String.valueOf(message));\n }", "public void log(Marker level, String... message);", "public void log( Level level, String msg ) {\r\n\t\tlogger.log( level, logPrefix + \" \" + msg );\r\n\t}", "public static String getLoggerPrefix(String level) {\n return getTimestamp() +\n SPACE +\n level +\n SPACE +\n LBRACE + getThreadName() + RBRACE +\n SPACE + \n getClassName() + \n COLUMN +\n getLineNumber() + \n SPACE + \n DASH + \n SPACE;\n }", "public void LOG(int logNumber, String logMessage) {\r\n if(logNumber <= logLevel) {\r\n System.out.print(newline_prefix + logMessage);\r\n System.out.flush();\r\n }\r\n }", "@Override\n\tpublic void log(Level level, String message) {\n\n\t}", "public void logIfLevel(Marker ifLevel, String... messages);", "public static void Log(String Message, int Level)\n {\n if(Level == 0)\n {\n System.out.println(\"[\" + Reference.MOD_ID + \"]\" + \" \" + Message);\n }\n \n if(Level == 1)\n {\n System.out.println(\"[\" + Reference.MOD_ID + \"]\" + \" \" + Message);\n }\n \n if(Level == 2)\n {\n System.out.println(\"[\" + Reference.MOD_ID + \"]\" + \" \" + Message);\n }\n }", "void printLog(String str, int level)\n { if (log!=null) log.println(\"CommandLineUA: \"+str, UserAgent.LOG_OFFSET+level);\n }", "public void set_log_prefixes(String file, int line, int stmtLogLevel,\r\n int lgLevel) {\r\n if(GlobalOptions.showLogOrigin) {\r\n String adjFile = file;\r\n newline_prefix = \"[\"+stmtLogLevel+\"<=\"+logLevel+ \"] \"+adjFile+\"::\"+line+\": \";\r\n }\r\n else\r\n newline_prefix = \"\";\r\n wrap_prefix = newline_prefix + WRAP_INDENT;\r\n }", "protected abstract void log(T level, Object message);", "public void log(String message, int loglevel) {\n if (managingPc != null) {\n managingPc.log(message, loglevel);\n } else {\n (loglevel > Project.MSG_WARN ? System.out : System.err).println(message);\n }\n }", "@Override\n\tpublic void log(Level level, Message msg) {\n\n\t}", "private static void log(Level level, Object message) {\n logger.info(LogUtil.class.getName(),level, message,null);\n }", "protected abstract void onPrintBorderedMessage(int logLevel, String tag, String msg);", "@Override\n\tpublic void writeToLog(String log, LogLevelEnum logLevel, String className) {\n\t\tSystem.out.println(className + \" : \" + logLevel.toString() + \" : \" + log);\n\t}", "private void log(String entry, Log.Level logLevel) {\n\t\tif (logObject != null) {\n\t\t\tlogObject.makeEntry(entry, logLevel);\n\t\t} else {\n\t\t\tSystem.out.println(entry);\n\t\t}\n\t}", "public void LOG(int logNumber, char logChar) {\r\n if(logNumber <= logLevel){\r\n System.out.print(newline_prefix + logChar);\r\n System.out.flush();\r\n }\r\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3) {\n\n\t}", "@Override\n\tpublic void log(Level level, CharSequence message) {\n\n\t}", "public static void print(LogLevel level, Map<String, String> logSections)\n {\n levels.get(level.getLevel()).log(FormatUtil.formatLog(logPatterns, logSections));\n }", "@Override\n\tpublic void log(Level level, Object message) {\n\n\t}", "public void log(int level, String message)\r\n {\r\n if (!isLevelEnabled(level))\r\n {\r\n return;\r\n }\r\n\r\n switch (level)\r\n {\r\n case WARN_ID:\r\n servletContext.log(PREFIX + WARN_PREFIX + message);\r\n break;\r\n case INFO_ID:\r\n servletContext.log(PREFIX + INFO_PREFIX + message);\r\n break;\r\n case DEBUG_ID:\r\n servletContext.log(PREFIX + DEBUG_PREFIX + message);\r\n break;\r\n case TRACE_ID:\r\n servletContext.log(PREFIX + TRACE_PREFIX + message);\r\n break;\r\n case ERROR_ID:\r\n servletContext.log(PREFIX + ERROR_PREFIX + message);\r\n break;\r\n default:\r\n servletContext.log(PREFIX + \" : \" + message);\r\n break;\r\n }\r\n }", "public static void print(LogLevel level, LogSection... logSections)\n {\n Map<String, String> sections = defaultSections();\n Arrays.asList(logSections).forEach((logSection) -> sections.replace(logSection.getKey(), logSection.getValue()));\n\n print(level, sections);\n }", "static public void GLOBLOG(int logNumber, String logMessage) {\r\n if(logNumber <= GlobalOptions.logLevel){\r\n System.out.print(newline_prefix + logMessage);\r\n System.out.flush();\r\n }\r\n }", "protected void simpleLog(Level level, String message) {\n if (getClassLogger().isLoggable(level)) {\n TestBench.out().println(message);\n }\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4) {\n\n\t}", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6) {\n\n\t}", "public final void logTestCase(final int level, final String message)\n {\n String tempM = \"<\" + getObjectName() + \"::\" + getObjectType() + \"> \"\n + message;\n fLog.logTestCase(level, tempM);\n\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1) {\n\n\t}", "Update withLogLevel(String logLevel);", "public static void log(Object caller, Level level, String message){ \n\t\tlogger.log(level, message);\n }", "@Override\n\tpublic void printf(Level level, String format, Object... params) {\n\n\t}", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2) {\n\n\t}", "public final void logBoth(final int level, final String message)\n {\n String tempM = \"<\" + getObjectName() + \"::\" + getObjectType() + \"> \"\n + message;\n fLog.logBoth(level, tempM);\n\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6, Object p7) {\n\n\t}", "public void log(String level,String message) {\n this.level = level;\n this.message = message;\n execute();\n }", "public static void log (int logLevel, String tag, String message, Class<?> loggingClass) {\n\n\t\tif (!isLoggingEnabledInConfigurationManager ())\n\t\t\treturn;\n\t\t\n\t\tlogByLevel (logLevel, tag, message, loggingClass);\n\t}", "public final void logTestSuite(final int level, final String message)\n {\n String tempM = \"<\" + getObjectName() + \"::\" + getObjectType() + \"> \"\n + message;\n fLog.logTestSuite(level, tempM);\n\n }", "@Override\n\tpublic void log(Level level, Marker marker, Message msg) {\n\n\t}", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6, Object p7, Object p8, Object p9) {\n\n\t}", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6, Object p7, Object p8) {\n\n\t}", "public void print_error( String text, int level ) {\n\t\tif ( get_debug_level() >= level ) {\n\t\t\t_platform_io.print_error( text );\n\t\t}\n\t}", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5) {\n\n\t}", "@Override\n\tpublic void log(Level level, String message, Object... params) {\n\n\t}", "@Override\n\tpublic void printf(Level level, Marker marker, String format, Object... params) {\n\n\t}", "public static void log(Level level, Object message) {\n plugin.getLogger().log(level, message.toString());\n }", "void printLog(String str)\n { printLog(str,Log.LEVEL_HIGH);\n }", "@Override\n\tpublic void log(Level level, String message, Object p0) {\n\n\t}", "@Override\n\tpublic void log(Level level, Marker marker, String message) {\n\n\t}", "public void log(String message, int msgLevel) {\n fireMessageLogged(this, message, msgLevel);\n }", "public void logIfLevel(Marker min, Marker max, String... messages);", "public static void writeMessage(String message, DebugLevel levelIn) {\n\t\tif (levelIn == DEBUG_VALUE)//&& DEBUG_VALUE != DebugLevel.NOOUTPUT)\n\t\t\tSystem.out.println(message);\n\t}", "private void printMessage(final PrintWriter errout, final Level level, final String message, final Object... params) {\n try {\n \terrout.println(getMessageLexer(-1, null, level, message, params));\n } catch (final MissingResourceException e) {\n \terrout.println(\"Can't find message string for \\\"\" + message + \"\\\"!\");\n }\n }", "public static void recordLog(String logLevel, String logInfo, Object... args)\n {\n Recorder.FunctionRecord(getRecordMetadata(), String.format(logInfo, args), logLevel);\n }", "private void printLog(String str)\n { printLog(str,Log.LEVEL_HIGH);\n }", "private void log(String pMessage) {\n\t\tif (logging)\n\t\t\tSystem.out.println(pMessage);\n\t}", "public void print(int offset, java.io.PrintStream log)\r\n\t{\r\n\t\tString sp = GrammarFactoryImpl.spaces(offset);\r\n\t\tlog.println(sp + \"(rolePlayed \" + local_id + \" \" +\r\n\t\t\t\t(rolePlayed == null ? \"___\" : rolePlayed.external()));\r\n\t\tlog.println(sp + \" (PropertyNoun \" + \r\n\t\t\t\t(property == null ? \"___\" : property.external()));\r\n\t\tif (referent != null) {\r\n\t\t\tlog.println(sp + \" (referent \" + \r\n\t\t\t\t\t((RolePhraseImpl)referent).local_id + \")\");\r\n\t\t} else if (expansion != null) {\r\n\t\t\tlog.println(sp + \" (expansion\");\r\n\t\t\texpansion.print(offset + 6, log);\r\n\t\t\tlog.println(sp + \" )\");\r\n\t\t} else {\r\n\t\t\tif (quantifier == null) log.println(sp + \" (Quantifier )\");\r\n\t\t\telse quantifier.print(offset + 4, log);\r\n\t\t\tlog.print(sp + \" (modifiers \");\r\n\t\t\tif (modifiers != null) {\r\n\t\t\t\tIterator<Modifier> it = modifiers.iterator();\r\n\t\t\t\twhile (it.hasNext()) it.next().print(offset + 6, log);\r\n\t\t\t}\r\n\t\t\tlog.println(')');\r\n\t\t\tif (domain == null) log.println(sp + \" ___\");\r\n\t\t\telse domain.print(offset + 4, log);\r\n\t\t}\r\n\t\tlog.println(sp + \"))\");\r\n\t}", "void printGivenLevel (Node root, int level)\n {\n if (root == null) {\n System.out.print(\"_ \");\n return;\n }\n if (level == 1)\n System.out.print(root.symbol + \" \");\n else if (level > 1)\n {\n printGivenLevel(root.left, level-1);\n printGivenLevel(root.right, level-1);\n }\n }", "protected void log(String msg, PrintStream printStream) {\n printStream.print(\"Continuum \" + getCommandName() + \" - \");\n printStream.println(msg);\n }", "@Override\n\tpublic void log(Level level, MessageSupplier msgSupplier) {\n\n\t}", "static public void setLogLevel(final Logger.LEVEL desiredLevel) {\n ThreadPoolWorkQueue.execute(new Runnable() {\n @Override\n public void run() {\n setLevelSync(desiredLevel);\n // we do this mostly to enable unit tests to logger.wait(100) instead of\n // Thread.sleep(100) -- it's faster, more stable, and more deterministic that way\n synchronized (WAIT_LOCK) {\n WAIT_LOCK.notifyAll();\n }\n }\n });\n }", "public final void log(Level level, String string) {\n context.getBot().log(manifest.name(), level, string);\n }", "private void changeLogLevel(String level){\n\n }", "abstract protected void logInternal(int level, String message);", "public static void log(Level level, String message)\r\n\t{\r\n\t\tLOGGER.log(level, message);\r\n\t}", "public PrintStream printf(String format, Object... args) {\n if (args[0] == \"Severity\") {\n choiceLevel((String) args[1]);\n }\n if (args[0] == \"Message\") {\n logger.log(mLevelLogger, (String) args[1]);\n }\n return this;\n }", "@Override\n\tpublic void log(Level level, Marker marker, CharSequence message) {\n\n\t}", "@Override\n\tpublic void log(Level level, Supplier<?> msgSupplier) {\n\n\t}", "public void println(int priority, String tag, String msg, Throwable tr);", "void log(Level level, String message, Throwable throwable);", "@Override\n\tpublic void log(Level level, Marker marker, MessageSupplier msgSupplier) {\n\n\t}", "void printHellow() {\n logger.debug(\"hellow world begin....\");\n logger.info(\"it's a info message\");\n logger.warn(\"it's a warning message\");\n loggerTest.warn(\"from test1 :....\");\n loggerTest.info(\"info from test1 :....\");\n\n // print internal state\n LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();\n StatusPrinter.print(lc);\n }", "public void log(int level, String msg, Object[] o) {\n if (isLoggable(level)) {\n int count = ((o == null) ? 0 : o.length);\n String formattedMessage = msg;\n\n if (count > 0) {\n MessageFormat messageFormat = new MessageFormat(\n getBundle().getString(msg));\n\n if (messageFormat != null) {\n formattedMessage = messageFormat.format(o);\n }\n } else {\n formattedMessage = getMessage(msg);\n }\n\n logInternal(level, formattedMessage);\n }\n }", "public void log(int level, String msg, Object o1) {\n if (isLoggable(level)) {\n log(level, msg, new Object[]{o1});\n }\n }", "public void log(Target target, String message, int msgLevel) {\n fireMessageLogged(target, message, msgLevel);\n }", "@Override\n\tpublic void log(Level level, Marker marker, String message, Object p0, Object p1, Object p2,\n\t\t\tObject p3, Object p4, Object p5, Object p6) {\n\n\t}", "static public void GLOBLOG(int logNumber, char logChar) {\r\n if(logNumber <= GlobalOptions.logLevel){\r\n // System.out.print(\"LOG-->\"+logChar);\r\n System.out.print(newline_prefix + logChar);\r\n System.out.flush();\r\n }\r\n }", "public static void log (int logLevel, String tag, String message) {\n\n\t\tif (!isLoggingEnabledInConfigurationManager ())\n\t\t\treturn;\n\n\t\tlogByLevel (logLevel, tag, message, null);\n\t}", "@Override\n\tpublic void log(Level level, Marker marker, String message, Object p0, Object p1, Object p2,\n\t\t\tObject p3, Object p4) {\n\n\t}", "public void log(int level, String msg, Object o1, Object o2, Object o3) {\n if (isLoggable(level)) {\n log(level, msg, new Object[]{o1, o2, o3});\n }\n }", "public static String selectMessagePrefix(String prefix) {\r\n\t\tif (prefix == \"debug\") {\r\n\t\t\treturn ChatColor.RED + \"\" + ChatColor.BOLD + \"MP-RPG: \" + ChatColor.RESET;\r\n\t\t} else {\r\n\t\t\treturn ChatColor.BOLD + \"MP-RPG: \" + ChatColor.RESET;\r\n\t\t}\r\n\t}", "@Override\n\tpublic void log(Level level, Marker marker, String message, Object p0, Object p1, Object p2,\n\t\t\tObject p3, Object p4, Object p5, Object p6, Object p7) {\n\n\t}", "public void print(Object msg, int modelevel)\n {\n int debug = 0;\n Properties prop = new Properties();\n InputStream input = null;\n\n /*Liest aus Datei den ModeLevel\n * Level: \n * 0) None\n * 1) Information (Default)\n * 2) Warning\n * 3) Error\n */\n try\n {\n\n try\n {\n // load a properties file\n prop.load(new FileReader(substructure.PathHelper.getFile(\"debug.properties\")));\n } catch (fileSystemException ex)\n {\n Logger.getLogger(Output.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n // get the property value and print it out\n try\n {\n debug = Integer.parseInt(prop.getProperty(\"MODE\"));\n } catch (Exception e)\n {\n new GuiPromptHelper(GuiPromptHelper.showWarning, \"Output: Modelevel konnte nicht gelesen werden \" + e);\n }\n\n } catch (FileNotFoundException e)\n {\n new GuiPromptHelper(GuiPromptHelper.showWarning, \"Output: Debug File konnte nicht geladen werden \" + e);\n } catch (IOException ex)\n {\n ex.printStackTrace();\n }\n\n out(msg, modelevel, debug);\n\n }", "public void log(int level, String msg) {\n if (isLoggable(level)) {\n logInternal(level, getMessage(msg));\n }\n }", "Logger loggerArrangement(String logName, String filePath, LogeLevel logLevel);", "@Override\n\tpublic void log(Level level, Marker marker, Object message) {\n\n\t}", "T generateLogMessage(String msg, PriorityLevel priorityLevel);", "@Override\n\tpublic void log(Level level, Marker marker, String message, Object... params) {\n\n\t}", "@Override\n\tpublic void log(Level level, Marker marker, Supplier<?> msgSupplier) {\n\n\t}", "@Override\n\tpublic void log(Level level, Marker marker, String message, Object p0, Object p1, Object p2,\n\t\t\tObject p3) {\n\n\t}", "static void log(\r\n Level level, String message, Iterable<? extends Module> modules)\r\n {\r\n logger.log(level, message);\r\n for (Module module : modules)\r\n {\r\n logger.log(level, \" \" + module);\r\n }\r\n }", "@Override\n\tpublic void log(Level level, Marker marker, String message, Object p0, Object p1) {\n\n\t}" ]
[ "0.72326916", "0.7097158", "0.6662536", "0.6626793", "0.6548316", "0.6511098", "0.6491826", "0.64879626", "0.64791864", "0.644415", "0.62792", "0.62371397", "0.6174097", "0.6150387", "0.60763747", "0.60728043", "0.59798515", "0.59695876", "0.59563375", "0.5954437", "0.5941488", "0.59148055", "0.5905559", "0.58201265", "0.5811519", "0.5806284", "0.58060575", "0.5797842", "0.5796532", "0.5786477", "0.57786614", "0.5736825", "0.57316345", "0.56945026", "0.5693755", "0.56854093", "0.5639525", "0.56110346", "0.5602609", "0.5582542", "0.557433", "0.5554964", "0.55548084", "0.55476826", "0.5545305", "0.5541749", "0.5523568", "0.55229664", "0.55213964", "0.55172986", "0.5502143", "0.5500763", "0.54963195", "0.5483746", "0.54753023", "0.5471825", "0.54636735", "0.5460747", "0.5451578", "0.54513407", "0.54418814", "0.5438954", "0.5435358", "0.54310596", "0.5423748", "0.5420472", "0.541261", "0.5408587", "0.54078484", "0.5406652", "0.5406494", "0.5404763", "0.5403802", "0.539063", "0.53545403", "0.5354145", "0.53370845", "0.5334706", "0.53257245", "0.5322815", "0.53213805", "0.53207767", "0.53196514", "0.53149927", "0.53117865", "0.53041357", "0.5301947", "0.5299517", "0.5296472", "0.52872133", "0.52734596", "0.5262874", "0.5261319", "0.52532274", "0.52380645", "0.5237285", "0.5233935", "0.5229739", "0.5226583", "0.5218266" ]
0.7490126
0
Prints a list of given logSections to a given logLevel, while overriding default sections
public static void print(LogLevel level, LogSection... logSections) { Map<String, String> sections = defaultSections(); Arrays.asList(logSections).forEach((logSection) -> sections.replace(logSection.getKey(), logSection.getValue())); print(level, sections); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void print(LogLevel level, Map<String, String> logSections)\n {\n levels.get(level.getLevel()).log(FormatUtil.formatLog(logPatterns, logSections));\n }", "public abstract void print(Level level, Object logMessage);", "public void logIfLevel(Marker ifLevel, String... messages);", "private void configureLogLevels()\r\n { \r\n String level = properties.getProperty(\"LogLevel\");\r\n \r\n switch(level)\r\n {\r\n case \"INFO\": INFO = Level.INFO; \r\n DEBUG = Level.FINE; \r\n WARNING = Level.FINE;\r\n break;\r\n case \"DEBUG\": INFO = Level.INFO;\r\n DEBUG = Level.INFO; \r\n WARNING = Level.INFO;\r\n break;\r\n case \"WARNING\": INFO = Level.FINE; \r\n DEBUG = Level.FINE; \r\n WARNING = Level.INFO; \r\n break;\r\n default: INFO = Level.INFO; \r\n DEBUG = Level.FINE; \r\n WARNING = Level.WARNING;\r\n break;\r\n }\r\n }", "@Test\n public void testCustomLoggingLevels() {\n LogTestLogger customLogger = new LogTestLogger();\n Database.log.setCustom(customLogger);\n\n for(int i = 5; i >= 1; i--) {\n customLogger.getLines().clear();\n customLogger.setLevel(LogLevel.values()[i]);\n Log.v(LogDomain.DATABASE, \"TEST VERBOSE\");\n Log.i(LogDomain.DATABASE, \"TEST INFO\");\n Log.w(LogDomain.DATABASE, \"TEST WARNING\");\n Log.e(LogDomain.DATABASE, \"TEST ERROR\");\n assertEquals(5 - i, customLogger.getLines().size());\n }\n }", "protected void setSectionLevel(int newLevel) {\n this.headingLevel = newLevel;\n }", "Logger loggerArrangement(String logName, String filePath, LogeLevel logLevel);", "private void printLog(String str, int level)\n { if (log!=null) log.println(\"AudioApp: \"+str, LoopbackMediaApp.LOG_OFFSET+level);\n if (level<=Log.LEVEL_HIGH) System.out.println(\"AudioApp: \"+str);\n }", "@Override\n\tpublic void writeToLog(String log, LogLevelEnum logLevel, String className) {\n\t\tSystem.out.println(className + \" : \" + logLevel.toString() + \" : \" + log);\n\t}", "void printLog(String str, int level)\n { if (log!=null) log.println(\"CommandLineUA: \"+str, UserAgent.LOG_OFFSET+level);\n }", "public void logIfLevel(Marker min, Marker max, String... messages);", "public static void setLogLevel(int level){\n\t\tswitch(level){\n\t\t\tcase ONE: \n\t\t\t\tLogger.getRootLogger().setLevel(Level.ALL); \n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.ALL\"); \n\t\t\t\tbreak;\n\t\t\tcase TWO: \n\t\t\t\tLogger.getRootLogger().setLevel(Level.DEBUG); \n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.DEBUG\"); \n\t\t\t\tbreak;\n\t\t\tcase THREE:\n\t\t\t\tLogger.getRootLogger().setLevel(Level.ERROR);\n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.ERROR\");\n\t\t\t\tbreak;\n\t\t\tcase FOUR:\n\t\t\t\tLogger.getRootLogger().setLevel(Level.FATAL);\n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.FATAL\");\n\t\t\t\tbreak;\n\t\t\tcase FIVE:\n\t\t\t\tLogger.getRootLogger().setLevel(Level.INFO);\n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.INFO\");\n\t\t\t\tbreak;\n\t\t\tcase SIX:\n\t\t\t\tLogger.getRootLogger().setLevel(Level.OFF); \n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.OFF\");\n\t\t\t\tbreak;\n\t\t\tcase SEVEN:\n\t\t\t\tLogger.getRootLogger().setLevel(Level.WARN);\n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.WARN\");\n\t\t\t\tbreak;\n\t\t\tcase EIGHT:\n\t\t\t\tLogger.getRootLogger().setLevel(Level.TRACE);\n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.WARN\");\n\t\t\t\tbreak;\n\t\t\tdefault: \n\t\t\t\tLogger.getRootLogger().setLevel(Level.ALL);\n\t\t\t\tLOGGER.info(\"Logging Level defaulted to LEVEL.ALL Please add parameter to properties file for custom logging.\");\n\t\t\t\tbreak;\n\t\t}\n\t}", "public void set_log_prefixes(String file, int line, int stmtLogLevel,\r\n int lgLevel) {\r\n if(GlobalOptions.showLogOrigin) {\r\n String adjFile = file;\r\n newline_prefix = \"[\"+stmtLogLevel+\"<=\"+logLevel+ \"] \"+adjFile+\"::\"+line+\": \";\r\n }\r\n else\r\n newline_prefix = \"\";\r\n wrap_prefix = newline_prefix + WRAP_INDENT;\r\n }", "static void log(\r\n Level level, String message, Iterable<? extends Module> modules)\r\n {\r\n logger.log(level, message);\r\n for (Module module : modules)\r\n {\r\n logger.log(level, \" \" + module);\r\n }\r\n }", "public void LOG(int logNumber, String logMessage) {\r\n if(logNumber <= logLevel) {\r\n System.out.print(newline_prefix + logMessage);\r\n System.out.flush();\r\n }\r\n }", "static public void GLOBLOG(int logNumber, String logMessage) {\r\n if(logNumber <= GlobalOptions.logLevel){\r\n System.out.print(newline_prefix + logMessage);\r\n System.out.flush();\r\n }\r\n }", "public static void print(LogLevel level, String message)\n {\n Map<String, String> sections = defaultSections();\n sections.replace(\"message\", message);\n\n print(level, sections);\n }", "public static void setSingleLineLoggingFormat() {\n Logger rootLogger = Logger.getLogger(\"\");\n for (Handler handler : rootLogger.getHandlers()) {\n handler.setFormatter(new SingleLineFormater());\n }\n }", "public interface Loggable\n{\n\n /**\n * Logs the message(s) with the given importance. Message will be\n * prefixed with [TerrainControl], so don't do that yourself.\n * <p/>\n * @param level The severity of the message\n * @param message The messages to log\n */\n public void log(Marker level, String... message);\n\n /**\n * Logs a format string message with the given importance. Message will\n * be prefixed with [TerrainControl], so don't do that yourself.\n * <p/>\n * @param level The severity of the message\n * @param message The messages to log formatted similar to Logger.log()\n * with the same args.\n * @param params The parameters belonging to {0...} in the message\n * string\n */\n public void log(Marker level, String message, Object... params);\n\n /**\n * Logs the message(s) with the given importance <b>ONLY IF</b> logger\n * level matches the level provided. Message will be prefixed with\n * [TerrainControl], so don't do that yourself.\n * <p/>\n * @param ifLevel the Log level to test for\n * @param messages The messages to log.\n */\n public void logIfLevel(Marker ifLevel, String... messages);\n\n /**\n * Logs the message(s) with the given importance <b>ONLY IF</b> logger\n * level matches the level provided. Message will be prefixed with\n * [TerrainControl], so don't do that yourself.\n * <p/>\n * @param ifLevel the Log level to test for\n * @param message The messages to log formatted similar to\n * Logger.log() with the same args.\n * @param params The parameters belonging to {0...} in the message\n * string\n */\n public void logIfLevel(Marker ifLevel, String message, Object... params);\n\n /**\n * Logs the message(s) with the given importance <b>ONLY IF</b> logger\n * level is between the min/max provided. Message will be prefixed with\n * [TerrainControl], so don't do that yourself.\n * <p/>\n * @param min The minimum Log level to test for\n * @param max The maximum Log level to test for\n * @param messages The messages to log.\n */\n public void logIfLevel(Marker min, Marker max, String... messages);\n\n /**\n * Logs the message(s) with the given importance <b>ONLY IF</b> logger\n * level is between the min/max provided. Message will be prefixed with\n * [TerrainControl], so don't do that yourself.\n * <p/>\n * @param min The minimum Log level to test for\n * @param max The maximum Log level to test for\n * @param message The messages to log formatted similar to\n * Logger.log() with the same args.\n * @param params The parameters belonging to {0...} in the message\n * string\n */\n public void logIfLevel(Marker min, Marker max, String message, Object... params);\n\n}", "public void setLoggingLevel(String loggingLevel) {\n this.loggingLevel = loggingLevel;\n }", "static public void setLogLevel(final Logger.LEVEL desiredLevel) {\n ThreadPoolWorkQueue.execute(new Runnable() {\n @Override\n public void run() {\n setLevelSync(desiredLevel);\n // we do this mostly to enable unit tests to logger.wait(100) instead of\n // Thread.sleep(100) -- it's faster, more stable, and more deterministic that way\n synchronized (WAIT_LOCK) {\n WAIT_LOCK.notifyAll();\n }\n }\n });\n }", "public final void logTestSuite(final int level, final String message)\n {\n String tempM = \"<\" + getObjectName() + \"::\" + getObjectType() + \"> \"\n + message;\n fLog.logTestSuite(level, tempM);\n\n }", "private void divertLog() {\n wr = new StringWriter(1000);\n LogTarget[] lt = { new WriterTarget(wr, fmt) };\n SampleResult.log.setLogTargets(lt);\n }", "Update withLogLevel(String logLevel);", "public void print(Level level, String format, Object... args) {\n if (bach.debug() || level.getSeverity() >= Level.INFO.getSeverity()) {\n var writer = level.getSeverity() <= Level.INFO.getSeverity() ? out : err;\n writer.write(String.format(format, args));\n writer.write(System.lineSeparator());\n }\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6) {\n\n\t}", "public void setLogLevel(int level) {\n logLevel = level;\n }", "private static void normal(List<Logger> loggers)\n {\n for ( Logger logger : loggers ) {\n logger.setLevel(Level.INFO);\n }\n }", "private static void verbose(List<Logger> loggers)\n {\n for ( Logger logger : loggers ) {\n logger.setLevel(Level.DEBUG);\n }\n }", "public static void loggingExample() {\n\t\tSystem.out.println(\"This is running with the default logger!\");\n\t\tnewLogger.fatal(\"This is fatal\");\n\t\tnewLogger.warn(\"This is the warn level\");\n\t\tnewLogger.info(\"This is the info level\");\n\t\t\n\t}", "protected String formatSectionNumber(SectionNumber numbers) {\n\t\treturn numbers.toString(getSectionNumberFormat());\n\t}", "void printGivenLevel(Node root, int level) {\n\t\tif (root == null)\n\t\t\treturn;\n\t\tif (level == 1)\n\t\t\tSystem.out.print(root.data + \" \");\n\t\telse if (level > 1) {\n\t\t\tprintGivenLevel(root.left, level - 1);\n\t\t\tprintGivenLevel(root.right, level - 1);\n\t\t}\n\t}", "void printGivenLevel(Node root, int level) {\n\t\tif (root == null)\n\t\t\treturn;\n\t\tif (level == 1)\n\t\t\tSystem.out.print(root.value + \" \");\n\t\telse if (level > 1) {\n\t\t\tprintGivenLevel(root.left, level - 1);\n\t\t\tprintGivenLevel(root.right, level - 1);\n\t\t}\n\t}", "private void setLevel(final org.apache.log4j.Level level) {\r\n if (log.isWarnEnabled()) {\r\n log.warn(\"LogUtil : level changed to : \" + level.toString());\r\n }\r\n\r\n for (final Log l : this.logs.values()) {\r\n setLevel(l, level);\r\n }\r\n }", "public static void log (int logLevel, String tag, String message, Class<?> loggingClass) {\n\n\t\tif (!isLoggingEnabledInConfigurationManager ())\n\t\t\treturn;\n\t\t\n\t\tlogByLevel (logLevel, tag, message, loggingClass);\n\t}", "private void loggerEinrichten() {\n\t\tlogger.setLevel(Level.INFO);\n//\t\tHandler handler = new FileHandler(\"/home/programmieren/TestFiles/iCalender/temp.log\");\n\t\tHandler handler = new ConsoleHandler();\n\t\thandler.setLevel(Level.FINEST);\n\t\thandler.setFormatter(new Formatter() {\n\t\t\t@Override\n\t\t\tpublic String format(LogRecord record) {\n\t\t\t\treturn record.getSourceClassName() + \".\" + record.getSourceMethodName() + \": \" + record.getMessage()\n\t\t\t\t\t\t+ \"\\n\";\n\t\t\t}\n\t\t});\n\t\tlogger.addHandler(handler);\n\t\tlogger.setUseParentHandlers(false);\n\t\tlogger.finest(\"begonnen\");\n\t}", "public static void printGivenLevel(Node<Integer> root, int level)\n\t\t{\n\t\t if (root == null)\n\t\t return;\n\t\t if (level == 1)\n\t\t System.out.print(root.value + \",\");\n\t\t else if (level > 1)\n\t\t {\n\t\t printGivenLevel(root.left, level-1);\n\t\t printGivenLevel(root.right, level-1);\n\t\t }\n\t\t}", "void initializeLogging(String loggingProperties);", "public static void setLevel(int level){\n\tlogLevel = level;\n }", "public void set_log_level(int level) {\r\n logLevel = Math.max(0,level);\r\n }", "void log(Level level, String message);", "public void setLevel(int level)\n {\n _level = level;\n if(_level < 0)\n _level = 0;\n\n calculateIndentationString();\n }", "private void populateOutputFile(List<String> sectionIds, Map<String, DocumentSection> sections) {\n\t\tfor (String sectionId : sectionIds) {\n\t\t\tString id = sections.get(sectionId).getId();\n\t\t\tString description = sections.get(sectionId).getDescription();\n\t\t\tUtils.println(id + \" \" + description);\n\t\t mOutputBuilder.addDocumentSection(id, description);\n\t\t}\n\n\t\t// Then the RTM content.\n\t\tmRTMSectionExtractor.populateOutputFile();\n\t}", "private void setupLogging() {\n\t\t// Ensure all JDK log messages are deferred until a target is registered\n\t\tLogger rootLogger = Logger.getLogger(\"\");\n\t\tHandlerUtils.wrapWithDeferredLogHandler(rootLogger, Level.SEVERE);\n\n\t\t// Set a suitable priority level on Spring Framework log messages\n\t\tLogger sfwLogger = Logger.getLogger(\"org.springframework\");\n\t\tsfwLogger.setLevel(Level.WARNING);\n\n\t\t// Set a suitable priority level on Roo log messages\n\t\t// (see ROO-539 and HandlerUtils.getLogger(Class))\n\t\tLogger rooLogger = Logger.getLogger(\"org.springframework.shell\");\n\t\trooLogger.setLevel(Level.FINE);\n\t}", "void setIndentLevel(int level);", "protected void setLogLevel(int logLevel) \n\t{\n\t\tthis.logLevel = logLevel;\n\t}", "protected void indent(Writer out, int level) throws IOException {\r\n if (currentFormat.newlines) {\r\n if (currentFormat.indent == null ||\r\n currentFormat.indent.equals(\"\")) {\r\n return;\r\n }\r\n\r\n for (int i = 0; i < level; i++) {\r\n out.write(currentFormat.indent);\r\n }\r\n }\r\n }", "public void LOG(int logNumber, char logChar) {\r\n if(logNumber <= logLevel){\r\n System.out.print(newline_prefix + logChar);\r\n System.out.flush();\r\n }\r\n }", "public void print() {\n \n for (int i=0 ; i< getNumberOfCases() ; i++) {\n Configuration conf = get(i);\n conf.print();\n System.out.print(\"\\n\");\n }\n}", "public void log(Marker level, String... message);", "void initializeLogging();", "private void printLevel(Node root, int level, int currentLevel){\n if(root == null){\n return;\n }\n if(level == currentLevel){\n System.out.print( root.getData() + \" \");\n return;\n }\n printLevel(root.getLeft(), level, currentLevel+1);\n printLevel(root.getRight(), level, currentLevel+1);\n\n }", "@Override\n\tpublic void printf(Level level, String format, Object... params) {\n\n\t}", "@Override\n public MultiInvokerConfigurationBuilder withLogLevel(LogLevel logLevel) {\n if (logLevel == null) {\n return this;\n }\n this.log = logFactory.create(logLevel);\n return this;\n }", "private void changeLogLevel(String level){\n\n }", "@Test\n\tpublic void logFormattedMessageWithMultipleArguments() {\n\t\tlogger.logv(org.jboss.logging.Logger.Level.DEBUG, \"{0}, {1}, {2} or {3}\", 1, 2, 3, 4);\n\n\t\tif (debugEnabled) {\n\t\t\tverify(provider).log(eq(2), isNull(), eq(Level.DEBUG), same(null), any(JavaTextMessageFormatFormatter.class),\n\t\t\t\t\teq(\"{0}, {1}, {2} or {3}\"), eq(1), eq(2), eq(3), eq(4));\n\t\t} else {\n\t\t\tverify(provider, never()).log(anyInt(), anyString(), any(), any(), any(), any(), any());\n\t\t}\n\n\t\tlogger.logv(org.jboss.logging.Logger.Level.WARN, \"{0}, {1}, {2} or {3}\", 1, 2, 3, 4);\n\n\t\tif (warnEnabled) {\n\t\t\tverify(provider).log(eq(2), isNull(), eq(Level.WARN), same(null), any(JavaTextMessageFormatFormatter.class),\n\t\t\t\t\teq(\"{0}, {1}, {2} or {3}\"), eq(1), eq(2), eq(3), eq(4));\n\t\t} else {\n\t\t\tverify(provider, never()).log(anyInt(), anyString(), any(), any(), any(), any(), any());\n\t\t}\n\t}", "public void setLogLevel(Level logLevel) {\n\t\tthis.logLevel = logLevel;\n\t}", "public static void Log(String Message, int Level)\n {\n if(Level == 0)\n {\n System.out.println(\"[\" + Reference.MOD_ID + \"]\" + \" \" + Message);\n }\n \n if(Level == 1)\n {\n System.out.println(\"[\" + Reference.MOD_ID + \"]\" + \" \" + Message);\n }\n \n if(Level == 2)\n {\n System.out.println(\"[\" + Reference.MOD_ID + \"]\" + \" \" + Message);\n }\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6, Object p7) {\n\n\t}", "public void sub() {\n\t\tlog.severe(\"severe level\");// <= (1)\n\t\tlog.warning(\"warning level\");// <= (2)\n\t\tlog.info(\"info level\");// <= (3)\n\t\tlog.config(\"config level\");// <= (4)\n\t\tlog.fine(\"fine level\");// <= (5)\n\t\tlog.finer(\"finer level\");// <= (6)\n\t\tlog.finest(\"finest level\");// <= (7)\n\n\t}", "public static String getContent(LEVEL level) {\n StringBuilder sb = new StringBuilder(log.size() / 2);\n\n for (Item item : log) {\n if (item.level >= level.value) {\n sb.append(item.content);\n sb.append(\"\\n\");\n }\n }\n\n return sb.toString();\n }", "public void setupLogging() {\n\t\ttry {\n\t\t\t_logger = Logger.getLogger(QoSModel.class);\n\t\t\tSimpleLayout layout = new SimpleLayout();\n\t\t\t_appender = new FileAppender(layout,_logFileName+\".txt\",false);\n\t\t\t_logger.addAppender(_appender);\n\t\t\t_logger.setLevel(Level.ALL);\n\t\t\tSystem.setOut(createLoggingProxy(System.out));\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5) {\n\n\t}", "private void log(String entry, Log.Level logLevel) {\n\t\tif (logObject != null) {\n\t\t\tlogObject.makeEntry(entry, logLevel);\n\t\t} else {\n\t\t\tSystem.out.println(entry);\n\t\t}\n\t}", "@Test\n public void testValidLogMappings() {\n Level log4JLevelFiner = classUnderTest.convertJdkLevelToLog4jLevel(java.util.logging.Level.FINER.toString());\n Level log4JLevelFine = classUnderTest.convertJdkLevelToLog4jLevel(java.util.logging.Level.FINE.toString());\n assertEquals(log4JLevelFine, Level.DEBUG);\n assertEquals(\"Log4j mapping for jdk.Fine should be equivalent to Finer\", log4JLevelFine, log4JLevelFiner);\n\n //Log 4j has no concept of CONFIG, so maps to INFO\n Level log4JLevelConfig = classUnderTest.convertJdkLevelToLog4jLevel(java.util.logging.Level.CONFIG.toString());\n Level log4JLevelInfo = classUnderTest.convertJdkLevelToLog4jLevel(java.util.logging.Level.INFO.toString());\n assertEquals(log4JLevelInfo, Level.INFO);\n assertEquals(\"Log4j mapping for jdk.Config should be equivalent to jdk.Info\", log4JLevelConfig, log4JLevelInfo);\n\n //Test one other\n assertEquals(\"JDK.WARNING should be equivalent to log4j.WARN\", Level.WARN,\n classUnderTest.convertJdkLevelToLog4jLevel(java.util.logging.Level.WARNING.toString()));\n\n }", "private static void writeSection(PrintWriter out, Hashtable section,\n String sectionName) throws IOException {\n for (Enumeration e = section.keys(); e.hasMoreElements(); ) {\n CaseFoldString key = (CaseFoldString)e.nextElement();\n String value = getValue(section, key);\n if (value!=DELETED) {\n if (sectionName!=null) {\n out.println();\n out.println(\"[\" + sectionName + \"]\");\n sectionName = null;\n }\n out.println(key + \"=\" + value);\n }\n }\n }", "static public void GLOBLOG(int logNumber, char logChar) {\r\n if(logNumber <= GlobalOptions.logLevel){\r\n // System.out.print(\"LOG-->\"+logChar);\r\n System.out.print(newline_prefix + logChar);\r\n System.out.flush();\r\n }\r\n }", "void printGivenLevel (Node root, int level)\n {\n if (root == null) {\n System.out.print(\"_ \");\n return;\n }\n if (level == 1)\n System.out.print(root.symbol + \" \");\n else if (level > 1)\n {\n printGivenLevel(root.left, level-1);\n printGivenLevel(root.right, level-1);\n }\n }", "@Test\n\tpublic void logFormattedMessageWithThreeArguments() {\n\t\tlogger.logv(org.jboss.logging.Logger.Level.DEBUG, \"{0}, {1} or {2}\", 1, 2, 3);\n\n\t\tif (debugEnabled) {\n\t\t\tverify(provider).log(eq(2), isNull(), eq(Level.DEBUG), same(null), any(JavaTextMessageFormatFormatter.class),\n\t\t\t\t\teq(\"{0}, {1} or {2}\"), eq(1), eq(2), eq(3));\n\t\t} else {\n\t\t\tverify(provider, never()).log(anyInt(), anyString(), any(), any(), any(), any(), any());\n\t\t}\n\n\t\tlogger.logv(org.jboss.logging.Logger.Level.WARN, \"{0}, {1} or {2}\", 1, 2, 3);\n\n\t\tif (warnEnabled) {\n\t\t\tverify(provider).log(eq(2), isNull(), eq(Level.WARN), same(null), any(JavaTextMessageFormatFormatter.class),\n\t\t\t\t\teq(\"{0}, {1} or {2}\"), eq(1), eq(2), eq(3));\n\t\t} else {\n\t\t\tverify(provider, never()).log(anyInt(), anyString(), any(), any(), any(), any(), any());\n\t\t}\n\t}", "public static void print(LogLevel level, String prefix, String message)\n {\n Map<String, String> sections = defaultSections();\n sections.replace(\"prefix\", prefix);\n sections.replace(\"message\", message);\n\n print(level, sections);\n }", "void printHellow() {\n logger.debug(\"hellow world begin....\");\n logger.info(\"it's a info message\");\n logger.warn(\"it's a warning message\");\n loggerTest.warn(\"from test1 :....\");\n loggerTest.info(\"info from test1 :....\");\n\n // print internal state\n LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();\n StatusPrinter.print(lc);\n }", "public void setLogLevel(eKVLogLevel outputlevel, eKVLogLevel logLevel){\n kv_out.changeOutputLevel(outputlevel);\n kv_out.changeLogLevel(logLevel);\n for (KVServerInstance instance: aliveInstances\n ) {\n instance.changeLogLevel(outputlevel,logLevel);\n }\n }", "void printLevelOrder() \n { \n int h = height(this); \n int i; \n for (i=1; i<=h; i++) \n printGivenLevel(this, i); \n }", "public void printGivenLevel(Node tree, int level){\n\t\tif(tree == null){\n\t\t\treturn;\n\t\t}\n\t\telse if(level == 1){\n\t\t\tSystem.out.print(tree.data+ \" \");\n\t\t}\n\t\telse if(level >1){\n\t\t\tprintGivenLevel(tree.getLeft(), (level-1));\n\t\t\tprintGivenLevel(tree.getRight(), (level-1));\n\t\t}\n\t}", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4) {\n\n\t}", "private static void setLoggingLevel(Level level) {\n ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) org.slf4j.LoggerFactory.getLogger(ch.qos.logback.classic.Logger.ROOT_LOGGER_NAME);\n root.setLevel(level);\n }", "@Override\n\tpublic void log(Level level, String message, Object... params) {\n\n\t}", "public static void setJXTALogger(JXTA_LOG_LEVEL logLevel) {\n\t\tswitch (logLevel) {\n\t\tcase FINEST:\n\t\t\tremoveJavaStdLoggerHandlers();\n\t\t\tSystem.setProperty(\"net.jxta.logging.Logging\",\n\t\t\t\t\tJXTA_LOG_LEVEL.FINEST.name());\n\t\t\tSystem.setProperty(\"net.jxta.level\", JXTA_LOG_LEVEL.FINEST.name());\n\t\t\tbreak;\n\t\tcase FINER:\n\t\t\tremoveJavaStdLoggerHandlers();\n\t\t\tSystem.setProperty(\"net.jxta.logging.Logging\",\n\t\t\t\t\tJXTA_LOG_LEVEL.FINER.name());\n\t\t\tSystem.setProperty(\"net.jxta.level\", JXTA_LOG_LEVEL.FINER.name());\n\t\t\tbreak;\n\t\tcase FINE:\n\t\t\tremoveJavaStdLoggerHandlers();\n\t\t\tSystem.setProperty(\"net.jxta.logging.Logging\",\n\t\t\t\t\tJXTA_LOG_LEVEL.FINE.name());\n\t\t\tSystem.setProperty(\"net.jxta.level\", JXTA_LOG_LEVEL.FINE.name());\n\t\t\tbreak;\n\t\tcase INFO:\n\t\t\tremoveJavaStdLoggerHandlers();\n\t\t\tSystem.setProperty(\"net.jxta.logging.Logging\",\n\t\t\t\t\tJXTA_LOG_LEVEL.INFO.name());\n\t\t\tSystem.setProperty(\"net.jxta.level\", JXTA_LOG_LEVEL.INFO.name());\n\t\t\tbreak;\n\t\tcase WARNING:\n\t\t\tremoveJavaStdLoggerHandlers();\n\t\t\tSystem.setProperty(\"net.jxta.logging.Logging\",\n\t\t\t\t\tJXTA_LOG_LEVEL.WARNING.name());\n\t\t\tSystem.setProperty(\"net.jxta.level\", JXTA_LOG_LEVEL.WARNING.name());\n\t\t\tbreak;\n\t\tcase SEVERE:\n\t\t\tremoveJavaStdLoggerHandlers();\n\t\t\tSystem.setProperty(\"net.jxta.logging.Logging\",\n\t\t\t\t\tJXTA_LOG_LEVEL.SEVERE.name());\n\t\t\tSystem.setProperty(\"net.jxta.level\", JXTA_LOG_LEVEL.SEVERE.name());\n\t\t\tbreak;\n\t\tcase OFF:\n\t\t\tremoveJavaStdLoggerHandlers();\n\t\t\tSystem.setProperty(\"net.jxta.logging.Logging\",\n\t\t\t\t\tJXTA_LOG_LEVEL.OFF.name());\n\t\t\tSystem.setProperty(\"net.jxta.level\", JXTA_LOG_LEVEL.OFF.name());\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}", "@Override\n\tpublic void log(Level level, String message) {\n\n\t}", "void setLogLevelsFromSharedPreferences() {\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);\n\n // Set root log level\n String logLevelRoot =\n sharedPreferences.getString(getString(R.string.preferences_key_log_level),\n getString(R.string.preferences_default_log_level));\n Logs.setRootLogLevel(logLevelRoot);\n\n // Set log level for file appender\n String logLevelFile =\n sharedPreferences.getString(getString(R.string.preferences_key_log_level_file),\n getString(R.string.preferences_default_log_level_file));\n Logs.setThresholdFilterLevel(logLevelFile, Constants.FILE_APPENDER_NAME, this);\n\n // Set log level for logcat appender\n String logLevelLogCat =\n sharedPreferences.getString(getString(R.string.preferences_key_log_level_logcat),\n getString(R.string.preferences_default_log_level_logcat));\n Logs.setLogCatLevel(logLevelLogCat, this);\n }", "void printLog(String str)\n { printLog(str,Log.LEVEL_HIGH);\n }", "@Override\n\tvoid prettyPrint() {\n\t\tMain.log.prettyPrint(name );\n\t}", "protected void simpleLog(Level level, String message) {\n if (getClassLogger().isLoggable(level)) {\n TestBench.out().println(message);\n }\n }", "public void setLogLevel(int logLevel) {\n\t\tif(logLevel > 5 || logLevel < 0) \n\t\t\tthrow new IllegalArgumentException(\"invalid parameter logLevel, please use Logger's static level constant.\");\n\t\tmLogLevel = logLevel;\n\t}", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6, Object p7, Object p8) {\n\n\t}", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6, Object p7, Object p8, Object p9) {\n\n\t}", "public void setLogLevel(int level) {\n\t\t// only change if a valid level\n\t\tif (isValidLogLevel(level)) this.logLevel = level;\n\t}", "private void printLog(String str)\n { printLog(str,Log.LEVEL_HIGH);\n }", "private static void print(final String format, final Object...params) {\n // we prefix all our messages with \">>> \" so as to distinguish them from the driver, node and client messages\n final String msg = String.format(\">>> \" + format, params);\n log.info(msg);\n System.out.println(msg);\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3) {\n\n\t}", "@Test\n\tpublic void logFormattedStringWithMultipleObjects() {\n\t\tlogger.logf(org.jboss.logging.Logger.Level.DEBUG, \"%s, %s, %s or %s\", \"one\", \"two\", \"three\", \"four\");\n\n\t\tif (debugEnabled) {\n\t\t\tverify(provider).log(eq(2), isNull(), eq(Level.DEBUG), same(null), any(PrintfStyleFormatter.class), eq(\"%s, %s, %s or %s\"),\n\t\t\t\t\teq(\"one\"), eq(\"two\"), eq(\"three\"), eq(\"four\"));\n\t\t} else {\n\t\t\tverify(provider, never()).log(anyInt(), anyString(), any(), any(), any(), any(), any());\n\t\t}\n\n\t\tlogger.logf(org.jboss.logging.Logger.Level.WARN, \"%s, %s, %s or %s\", \"one\", \"two\", \"three\", \"four\");\n\n\t\tif (warnEnabled) {\n\t\t\tverify(provider).log(eq(2), isNull(), eq(Level.WARN), same(null), any(PrintfStyleFormatter.class), eq(\"%s, %s, %s or %s\"),\n\t\t\t\t\teq(\"one\"), eq(\"two\"), eq(\"three\"), eq(\"four\"));\n\t\t} else {\n\t\t\tverify(provider, never()).log(anyInt(), anyString(), any(), any(), any(), any(), any());\n\t\t}\n\t}", "public void setLogLevel(String logLevel) {\n agentConfig.setLogLevel(logLevel);\n logConfigChanged();\n }", "public static void printMenu(String menuChoice, String... params) {\n switch (menuChoice) {\n case \"main\":\n mainMenuLines();\n break;\n case \"help\":\n helpMenuLines();\n break;\n case \"exit\":\n saveBeforeQuit();\n break;\n case \"lead\":\n newLeadLines(params);\n break;\n case \"convert\":\n convertLeadLines(params);\n break;\n }\n clearCommandLine();\n printProgramTitle();\n for (String line : menuLine) {\n print(line);\n }\n printFull();\n }", "public void setLoggerLevel(TraceLevel level) {\n\t\t//Topology.STREAMS_LOGGER.setLevel(level);\t\t\n\t\t//Topology.TOPOLOGY_LOGGER.setLevel(level); \n\t\tgetConfig().put(ContextProperties.TRACING_LEVEL, java.util.logging.Level.FINE);\t\t\n\t\tSystem.out.println(\"Streams topology logger level: \" + Topology.TOPOLOGY_LOGGER.getLevel());\n\t\t\n\t}", "public final void logTestCase(final int level, final String message)\n {\n String tempM = \"<\" + getObjectName() + \"::\" + getObjectType() + \"> \"\n + message;\n fLog.logTestCase(level, tempM);\n\n }", "private void log(String l) {\n if (LOG) {\n System.out.println(\"RotationMatrixTest.\" + l);\n }\n }", "public void disabled_log4j_testDefaultLevel() throws Exception {\n assertEquals(\"Default Level is INFO\", LOGGER.getLevel(), Level.INFO);\n }", "@Override\n\tpublic void log(Level level, Message msg) {\n\n\t}", "protected void printDebugLogMessage(final String[] lines) {\n\t\tif (AbstractTraceAnalysisFilter.LOGGER.isDebugEnabled()) {\n\t\t\tAbstractTraceAnalysisFilter.LOGGER.debug(\"\");\n\t\t\tAbstractTraceAnalysisFilter.LOGGER.debug(\"#\");\n\t\t\tAbstractTraceAnalysisFilter.LOGGER.debug(\"# Plugin: \" + this.getClass().getName());\n\t\t\tfor (final String l : lines) {\n\t\t\t\tAbstractTraceAnalysisFilter.LOGGER.debug(l);\n\t\t\t}\n\t\t}\n\t}", "private void initLoggers()\n {\n Logger.getSharedInstance();\n\n for (Logger logger : Logger.getAllLoggers())\n {\n String key = \"Loggers/\" + logger.getNamespace();\n Level desired;\n\n if (!SmartDashboard.containsKey(key))\n {\n // First time this logger has been sent to SmartDashboard\n SmartDashboard.putString(key, logger.getLogLevel().name());\n desired = Level.DEBUG;\n }\n else\n {\n String choice = SmartDashboard.getString(key, \"DEBUG\");\n Level parsed = Level.valueOf(choice);\n if (parsed == null)\n {\n m_logger.error(\"The choice '\" + choice + \"' for logger \" + logger.getNamespace() + \" isn't a valid value.\");\n desired = Level.DEBUG;\n }\n else\n {\n desired = parsed;\n }\n }\n logger.setLogLevel(desired);\n }\n }" ]
[ "0.72441524", "0.56666553", "0.5608939", "0.5492605", "0.5447053", "0.53220147", "0.5225373", "0.51233965", "0.51061285", "0.5101222", "0.5099392", "0.50882334", "0.50878894", "0.5062303", "0.5030716", "0.49982592", "0.49615973", "0.49528906", "0.48753908", "0.48469064", "0.48444492", "0.4834892", "0.48141855", "0.48139045", "0.48076767", "0.47915393", "0.47750598", "0.47561985", "0.47501805", "0.47438625", "0.47257644", "0.47236395", "0.47179705", "0.4716825", "0.471555", "0.47071004", "0.47028077", "0.46897712", "0.46801904", "0.46779445", "0.46777818", "0.4673729", "0.4669156", "0.46597868", "0.46466514", "0.46454126", "0.4642901", "0.46333113", "0.46320057", "0.46180522", "0.46168676", "0.4609782", "0.45862666", "0.45816314", "0.45780173", "0.45749113", "0.45601413", "0.45401347", "0.45369342", "0.45348012", "0.45346692", "0.4533073", "0.4523619", "0.4505402", "0.45028943", "0.44978264", "0.44971728", "0.44956002", "0.4492822", "0.44891307", "0.44883412", "0.4485543", "0.44605044", "0.44439602", "0.44424605", "0.44424486", "0.4438956", "0.44357133", "0.4430164", "0.44269666", "0.4422587", "0.44170144", "0.44150728", "0.44145283", "0.44065902", "0.44064036", "0.44019893", "0.43954703", "0.43858442", "0.43794385", "0.43751046", "0.4375066", "0.43710858", "0.4369622", "0.4368205", "0.43676838", "0.43654326", "0.4351205", "0.4351068", "0.4344813" ]
0.7596054
0
Prints a map of given logSections to a given logLevel, while overriding default sections
public static void print(LogLevel level, Map<String, String> logSections) { levels.get(level.getLevel()).log(FormatUtil.formatLog(logPatterns, logSections)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void print(LogLevel level, LogSection... logSections)\n {\n Map<String, String> sections = defaultSections();\n Arrays.asList(logSections).forEach((logSection) -> sections.replace(logSection.getKey(), logSection.getValue()));\n\n print(level, sections);\n }", "public void logIfLevel(Marker ifLevel, String... messages);", "public abstract void print(Level level, Object logMessage);", "private void configureLogLevels()\r\n { \r\n String level = properties.getProperty(\"LogLevel\");\r\n \r\n switch(level)\r\n {\r\n case \"INFO\": INFO = Level.INFO; \r\n DEBUG = Level.FINE; \r\n WARNING = Level.FINE;\r\n break;\r\n case \"DEBUG\": INFO = Level.INFO;\r\n DEBUG = Level.INFO; \r\n WARNING = Level.INFO;\r\n break;\r\n case \"WARNING\": INFO = Level.FINE; \r\n DEBUG = Level.FINE; \r\n WARNING = Level.INFO; \r\n break;\r\n default: INFO = Level.INFO; \r\n DEBUG = Level.FINE; \r\n WARNING = Level.WARNING;\r\n break;\r\n }\r\n }", "public void logIfLevel(Marker min, Marker max, String... messages);", "protected void setSectionLevel(int newLevel) {\n this.headingLevel = newLevel;\n }", "@Test\n public void testCustomLoggingLevels() {\n LogTestLogger customLogger = new LogTestLogger();\n Database.log.setCustom(customLogger);\n\n for(int i = 5; i >= 1; i--) {\n customLogger.getLines().clear();\n customLogger.setLevel(LogLevel.values()[i]);\n Log.v(LogDomain.DATABASE, \"TEST VERBOSE\");\n Log.i(LogDomain.DATABASE, \"TEST INFO\");\n Log.w(LogDomain.DATABASE, \"TEST WARNING\");\n Log.e(LogDomain.DATABASE, \"TEST ERROR\");\n assertEquals(5 - i, customLogger.getLines().size());\n }\n }", "@Test\n public void testValidLogMappings() {\n Level log4JLevelFiner = classUnderTest.convertJdkLevelToLog4jLevel(java.util.logging.Level.FINER.toString());\n Level log4JLevelFine = classUnderTest.convertJdkLevelToLog4jLevel(java.util.logging.Level.FINE.toString());\n assertEquals(log4JLevelFine, Level.DEBUG);\n assertEquals(\"Log4j mapping for jdk.Fine should be equivalent to Finer\", log4JLevelFine, log4JLevelFiner);\n\n //Log 4j has no concept of CONFIG, so maps to INFO\n Level log4JLevelConfig = classUnderTest.convertJdkLevelToLog4jLevel(java.util.logging.Level.CONFIG.toString());\n Level log4JLevelInfo = classUnderTest.convertJdkLevelToLog4jLevel(java.util.logging.Level.INFO.toString());\n assertEquals(log4JLevelInfo, Level.INFO);\n assertEquals(\"Log4j mapping for jdk.Config should be equivalent to jdk.Info\", log4JLevelConfig, log4JLevelInfo);\n\n //Test one other\n assertEquals(\"JDK.WARNING should be equivalent to log4j.WARN\", Level.WARN,\n classUnderTest.convertJdkLevelToLog4jLevel(java.util.logging.Level.WARNING.toString()));\n\n }", "public static void print(LogLevel level, String message)\n {\n Map<String, String> sections = defaultSections();\n sections.replace(\"message\", message);\n\n print(level, sections);\n }", "private void printLog(String str, int level)\n { if (log!=null) log.println(\"AudioApp: \"+str, LoopbackMediaApp.LOG_OFFSET+level);\n if (level<=Log.LEVEL_HIGH) System.out.println(\"AudioApp: \"+str);\n }", "@Override\n\tpublic void writeToLog(String log, LogLevelEnum logLevel, String className) {\n\t\tSystem.out.println(className + \" : \" + logLevel.toString() + \" : \" + log);\n\t}", "public void set_log_prefixes(String file, int line, int stmtLogLevel,\r\n int lgLevel) {\r\n if(GlobalOptions.showLogOrigin) {\r\n String adjFile = file;\r\n newline_prefix = \"[\"+stmtLogLevel+\"<=\"+logLevel+ \"] \"+adjFile+\"::\"+line+\": \";\r\n }\r\n else\r\n newline_prefix = \"\";\r\n wrap_prefix = newline_prefix + WRAP_INDENT;\r\n }", "void printLog(String str, int level)\n { if (log!=null) log.println(\"CommandLineUA: \"+str, UserAgent.LOG_OFFSET+level);\n }", "public void printMapping() {\n LogDumper.out(sourceOutputMap);\n }", "Logger loggerArrangement(String logName, String filePath, LogeLevel logLevel);", "private void dumpMap(PrintStream stream, Map<String, String> map) {\n for (String key : map.keySet()) {\n stream.println(\" \" + key + \" -> \" + map.get(key));\n }\n }", "static public void GLOBLOG(int logNumber, String logMessage) {\r\n if(logNumber <= GlobalOptions.logLevel){\r\n System.out.print(newline_prefix + logMessage);\r\n System.out.flush();\r\n }\r\n }", "private static void writeSection(PrintWriter out, Hashtable section,\n String sectionName) throws IOException {\n for (Enumeration e = section.keys(); e.hasMoreElements(); ) {\n CaseFoldString key = (CaseFoldString)e.nextElement();\n String value = getValue(section, key);\n if (value!=DELETED) {\n if (sectionName!=null) {\n out.println();\n out.println(\"[\" + sectionName + \"]\");\n sectionName = null;\n }\n out.println(key + \"=\" + value);\n }\n }\n }", "void printGivenLevel(Node root, int level) {\n\t\tif (root == null)\n\t\t\treturn;\n\t\tif (level == 1)\n\t\t\tSystem.out.print(root.value + \" \");\n\t\telse if (level > 1) {\n\t\t\tprintGivenLevel(root.left, level - 1);\n\t\t\tprintGivenLevel(root.right, level - 1);\n\t\t}\n\t}", "Update withLogLevel(String logLevel);", "public void print(Level level, String format, Object... args) {\n if (bach.debug() || level.getSeverity() >= Level.INFO.getSeverity()) {\n var writer = level.getSeverity() <= Level.INFO.getSeverity() ? out : err;\n writer.write(String.format(format, args));\n writer.write(System.lineSeparator());\n }\n }", "void printGivenLevel(Node root, int level) {\n\t\tif (root == null)\n\t\t\treturn;\n\t\tif (level == 1)\n\t\t\tSystem.out.print(root.data + \" \");\n\t\telse if (level > 1) {\n\t\t\tprintGivenLevel(root.left, level - 1);\n\t\t\tprintGivenLevel(root.right, level - 1);\n\t\t}\n\t}", "public interface Loggable\n{\n\n /**\n * Logs the message(s) with the given importance. Message will be\n * prefixed with [TerrainControl], so don't do that yourself.\n * <p/>\n * @param level The severity of the message\n * @param message The messages to log\n */\n public void log(Marker level, String... message);\n\n /**\n * Logs a format string message with the given importance. Message will\n * be prefixed with [TerrainControl], so don't do that yourself.\n * <p/>\n * @param level The severity of the message\n * @param message The messages to log formatted similar to Logger.log()\n * with the same args.\n * @param params The parameters belonging to {0...} in the message\n * string\n */\n public void log(Marker level, String message, Object... params);\n\n /**\n * Logs the message(s) with the given importance <b>ONLY IF</b> logger\n * level matches the level provided. Message will be prefixed with\n * [TerrainControl], so don't do that yourself.\n * <p/>\n * @param ifLevel the Log level to test for\n * @param messages The messages to log.\n */\n public void logIfLevel(Marker ifLevel, String... messages);\n\n /**\n * Logs the message(s) with the given importance <b>ONLY IF</b> logger\n * level matches the level provided. Message will be prefixed with\n * [TerrainControl], so don't do that yourself.\n * <p/>\n * @param ifLevel the Log level to test for\n * @param message The messages to log formatted similar to\n * Logger.log() with the same args.\n * @param params The parameters belonging to {0...} in the message\n * string\n */\n public void logIfLevel(Marker ifLevel, String message, Object... params);\n\n /**\n * Logs the message(s) with the given importance <b>ONLY IF</b> logger\n * level is between the min/max provided. Message will be prefixed with\n * [TerrainControl], so don't do that yourself.\n * <p/>\n * @param min The minimum Log level to test for\n * @param max The maximum Log level to test for\n * @param messages The messages to log.\n */\n public void logIfLevel(Marker min, Marker max, String... messages);\n\n /**\n * Logs the message(s) with the given importance <b>ONLY IF</b> logger\n * level is between the min/max provided. Message will be prefixed with\n * [TerrainControl], so don't do that yourself.\n * <p/>\n * @param min The minimum Log level to test for\n * @param max The maximum Log level to test for\n * @param message The messages to log formatted similar to\n * Logger.log() with the same args.\n * @param params The parameters belonging to {0...} in the message\n * string\n */\n public void logIfLevel(Marker min, Marker max, String message, Object... params);\n\n}", "public static void setLogLevel(int level){\n\t\tswitch(level){\n\t\t\tcase ONE: \n\t\t\t\tLogger.getRootLogger().setLevel(Level.ALL); \n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.ALL\"); \n\t\t\t\tbreak;\n\t\t\tcase TWO: \n\t\t\t\tLogger.getRootLogger().setLevel(Level.DEBUG); \n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.DEBUG\"); \n\t\t\t\tbreak;\n\t\t\tcase THREE:\n\t\t\t\tLogger.getRootLogger().setLevel(Level.ERROR);\n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.ERROR\");\n\t\t\t\tbreak;\n\t\t\tcase FOUR:\n\t\t\t\tLogger.getRootLogger().setLevel(Level.FATAL);\n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.FATAL\");\n\t\t\t\tbreak;\n\t\t\tcase FIVE:\n\t\t\t\tLogger.getRootLogger().setLevel(Level.INFO);\n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.INFO\");\n\t\t\t\tbreak;\n\t\t\tcase SIX:\n\t\t\t\tLogger.getRootLogger().setLevel(Level.OFF); \n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.OFF\");\n\t\t\t\tbreak;\n\t\t\tcase SEVEN:\n\t\t\t\tLogger.getRootLogger().setLevel(Level.WARN);\n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.WARN\");\n\t\t\t\tbreak;\n\t\t\tcase EIGHT:\n\t\t\t\tLogger.getRootLogger().setLevel(Level.TRACE);\n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.WARN\");\n\t\t\t\tbreak;\n\t\t\tdefault: \n\t\t\t\tLogger.getRootLogger().setLevel(Level.ALL);\n\t\t\t\tLOGGER.info(\"Logging Level defaulted to LEVEL.ALL Please add parameter to properties file for custom logging.\");\n\t\t\t\tbreak;\n\t\t}\n\t}", "static void log(\r\n Level level, String message, Iterable<? extends Module> modules)\r\n {\r\n logger.log(level, message);\r\n for (Module module : modules)\r\n {\r\n logger.log(level, \" \" + module);\r\n }\r\n }", "static void printTheSpecifiedMap(MapLM mapToPrint){\n List<List<List<Ansi>>> mapAnsi = mapLMToAnsi(mapToPrint.getMap());\n for(int mapRow = 0; mapRow < GeneralInfo.ROWS_MAP; mapRow++){\n /*mapAnsi.get(mapRow).get(0) is the first square of the current mapRow,\n assuming the other squares on the same mapRow have the same\n number of rows (in other words, the same .size())\n */\n for(int squareRow=0; squareRow < mapAnsi.get(mapRow).get(0).size() ; squareRow++){\n //for each square on the specified mapRow(mapRow is a list of squares)\n for(List<Ansi> square: mapAnsi.get(mapRow)){\n AnsiConsole.out.print(square.get(squareRow));\n /*after the last character of the second line of the last square of\n each row of the map, print the corresponding vertical coordinate\n */\n if((/*last square of the foreach*/ square.equals(mapAnsi.get(mapRow).get(mapAnsi.get(mapRow).size()-1)))\n && squareRow == 1){\n //print vertical coordinate coordinate\n System.out.print(\" \" + verticalCoordinateForUser(mapRow));\n }\n }\n /*after printing the whole specified line of the map (the specified line of all\n the squares on the specified row of squares of the map), start a new line\n */\n System.out.print(\"\\n\");\n }\n }\n //print horizontal coordinates\n System.out.print(\"\\n\");\n for(int i=0; i < GeneralInfo.COLUMNS_MAP; i++){\n System.out.print(\" \" + horizontalCoordinateForUser(i) + \" \");\n }\n }", "public void LOG(int logNumber, String logMessage) {\r\n if(logNumber <= logLevel) {\r\n System.out.print(newline_prefix + logMessage);\r\n System.out.flush();\r\n }\r\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6) {\n\n\t}", "public void printMap(int[][] map) {\n \tfor(int i = 7; i >= 0; i--) {\n \t\tfor(int j = 0; j < 8; j++) {\n \t\t\tSystem.out.print(\"\"+map[i][j]+\"\\t\");\n \t\t}\n \t\tSystem.out.println();\n \t}\n }", "public void log(Marker level, String... message);", "private void populateOutputFile(List<String> sectionIds, Map<String, DocumentSection> sections) {\n\t\tfor (String sectionId : sectionIds) {\n\t\t\tString id = sections.get(sectionId).getId();\n\t\t\tString description = sections.get(sectionId).getDescription();\n\t\t\tUtils.println(id + \" \" + description);\n\t\t mOutputBuilder.addDocumentSection(id, description);\n\t\t}\n\n\t\t// Then the RTM content.\n\t\tmRTMSectionExtractor.populateOutputFile();\n\t}", "private void divertLog() {\n wr = new StringWriter(1000);\n LogTarget[] lt = { new WriterTarget(wr, fmt) };\n SampleResult.log.setLogTargets(lt);\n }", "private void printLevel(Node root, int level, int currentLevel){\n if(root == null){\n return;\n }\n if(level == currentLevel){\n System.out.print( root.getData() + \" \");\n return;\n }\n printLevel(root.getLeft(), level, currentLevel+1);\n printLevel(root.getRight(), level, currentLevel+1);\n\n }", "public static void printGivenLevel(Node<Integer> root, int level)\n\t\t{\n\t\t if (root == null)\n\t\t return;\n\t\t if (level == 1)\n\t\t System.out.print(root.value + \",\");\n\t\t else if (level > 1)\n\t\t {\n\t\t printGivenLevel(root.left, level-1);\n\t\t printGivenLevel(root.right, level-1);\n\t\t }\n\t\t}", "@Override\n\tpublic void printf(Level level, String format, Object... params) {\n\n\t}", "private void log(String entry, Log.Level logLevel) {\n\t\tif (logObject != null) {\n\t\t\tlogObject.makeEntry(entry, logLevel);\n\t\t} else {\n\t\t\tSystem.out.println(entry);\n\t\t}\n\t}", "public void globalLog() {\n\t\tIterator iter = myCommit.entrySet().iterator();\n\t\twhile (iter.hasNext()) {\n\t\t\tMap.Entry entry = (Map.Entry) iter.next();\n\t\t\tVersion currVersion = (Version) entry.getValue();\n\t\t\tcurrVersion.log();\n\t\t}\n\t}", "@Override\n\tvoid prettyPrint() {\n\t\tMain.log.prettyPrint(name );\n\t}", "public static void print(LogLevel level, String prefix, String message)\n {\n Map<String, String> sections = defaultSections();\n sections.replace(\"prefix\", prefix);\n sections.replace(\"message\", message);\n\n print(level, sections);\n }", "void printGivenLevel (Node root, int level)\n {\n if (root == null) {\n System.out.print(\"_ \");\n return;\n }\n if (level == 1)\n System.out.print(root.symbol + \" \");\n else if (level > 1)\n {\n printGivenLevel(root.left, level-1);\n printGivenLevel(root.right, level-1);\n }\n }", "void initializeLogging(String loggingProperties);", "protected String formatSectionNumber(SectionNumber numbers) {\n\t\treturn numbers.toString(getSectionNumberFormat());\n\t}", "private void setLevel(final org.apache.log4j.Level level) {\r\n if (log.isWarnEnabled()) {\r\n log.warn(\"LogUtil : level changed to : \" + level.toString());\r\n }\r\n\r\n for (final Log l : this.logs.values()) {\r\n setLevel(l, level);\r\n }\r\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6, Object p7) {\n\n\t}", "private void printMap() {\n\t\tfor(Integer key: location.keySet()){\n\t\t\tString val= location.get(key).toString();\n\t\t\tSystem.out.println(\"(\" + key.toString() + \", \" + val+ \")\");\n\t\t}\n\t}", "public void setLevel(int level)\n {\n _level = level;\n if(_level < 0)\n _level = 0;\n\n calculateIndentationString();\n }", "public final void logTestSuite(final int level, final String message)\n {\n String tempM = \"<\" + getObjectName() + \"::\" + getObjectType() + \"> \"\n + message;\n fLog.logTestSuite(level, tempM);\n\n }", "private void loggerEinrichten() {\n\t\tlogger.setLevel(Level.INFO);\n//\t\tHandler handler = new FileHandler(\"/home/programmieren/TestFiles/iCalender/temp.log\");\n\t\tHandler handler = new ConsoleHandler();\n\t\thandler.setLevel(Level.FINEST);\n\t\thandler.setFormatter(new Formatter() {\n\t\t\t@Override\n\t\t\tpublic String format(LogRecord record) {\n\t\t\t\treturn record.getSourceClassName() + \".\" + record.getSourceMethodName() + \": \" + record.getMessage()\n\t\t\t\t\t\t+ \"\\n\";\n\t\t\t}\n\t\t});\n\t\tlogger.addHandler(handler);\n\t\tlogger.setUseParentHandlers(false);\n\t\tlogger.finest(\"begonnen\");\n\t}", "public static void setLevel(int level){\n\tlogLevel = level;\n }", "void printHellow() {\n logger.debug(\"hellow world begin....\");\n logger.info(\"it's a info message\");\n logger.warn(\"it's a warning message\");\n loggerTest.warn(\"from test1 :....\");\n loggerTest.info(\"info from test1 :....\");\n\n // print internal state\n LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();\n StatusPrinter.print(lc);\n }", "public static String formatMaps(Map<?, ?>... maps) {\n return (formatMaps(\":\", false, false, false, false, true, true, maps));\n }", "public void printMap()\r\n {\r\n\t\tint x = 0;\r\n for(Room[] row : rooms)\r\n {\r\n \tStringBuilder top = new StringBuilder(); // top row of room\r\n \tStringBuilder mid = new StringBuilder(); // mid row of room\r\n \tStringBuilder bot = null;\r\n \tif (x == row.length - 1) { // if the last row\r\n \t\tbot = new StringBuilder(); // bot row of room\r\n \t}\r\n \t\r\n for (Room room : row)\r\n {\r\n \tString roomStr = room.toString();\r\n top.append(roomStr.substring(0, 3)); // 0-3 top, 3-6, mid, 6-9 bot\r\n mid.append(roomStr.substring(3, 6)); \r\n if (x == row.length - 1) { //if the last row\r\n \tbot.append(roomStr.substring(6, 9)); //append the bot row\r\n }\r\n }\r\n // add new lines\r\n top.append('\\n');\r\n mid.append('\\n');\r\n \r\n System.out.print(top);\r\n System.out.print(mid);\r\n \r\n if (x == row.length - 1) {\r\n \tbot.append('\\n');\r\n \tSystem.out.print(bot);\r\n }\r\n x++;\r\n }\r\n }", "public void printMap() {\n String s = \"\";\n Stack st = new Stack();\n st.addAll(map.entrySet());\n while (!st.isEmpty()) {\n s += st.pop().toString() + \"\\n\";\n }\n window.getDHTText().setText(s);\n }", "public void print(Object msg, int modelevel)\n {\n int debug = 0;\n Properties prop = new Properties();\n InputStream input = null;\n\n /*Liest aus Datei den ModeLevel\n * Level: \n * 0) None\n * 1) Information (Default)\n * 2) Warning\n * 3) Error\n */\n try\n {\n\n try\n {\n // load a properties file\n prop.load(new FileReader(substructure.PathHelper.getFile(\"debug.properties\")));\n } catch (fileSystemException ex)\n {\n Logger.getLogger(Output.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n // get the property value and print it out\n try\n {\n debug = Integer.parseInt(prop.getProperty(\"MODE\"));\n } catch (Exception e)\n {\n new GuiPromptHelper(GuiPromptHelper.showWarning, \"Output: Modelevel konnte nicht gelesen werden \" + e);\n }\n\n } catch (FileNotFoundException e)\n {\n new GuiPromptHelper(GuiPromptHelper.showWarning, \"Output: Debug File konnte nicht geladen werden \" + e);\n } catch (IOException ex)\n {\n ex.printStackTrace();\n }\n\n out(msg, modelevel, debug);\n\n }", "public static void loggingExample() {\n\t\tSystem.out.println(\"This is running with the default logger!\");\n\t\tnewLogger.fatal(\"This is fatal\");\n\t\tnewLogger.warn(\"This is the warn level\");\n\t\tnewLogger.info(\"This is the info level\");\n\t\t\n\t}", "void log(Level level, String message);", "void k2h_set_debug_level_message();", "private void changeLogLevel(String level){\n\n }", "private void printLog(String str)\n { printLog(str,Log.LEVEL_HIGH);\n }", "public void LOG(int logNumber, char logChar) {\r\n if(logNumber <= logLevel){\r\n System.out.print(newline_prefix + logChar);\r\n System.out.flush();\r\n }\r\n }", "public void print() {\n \n for (int i=0 ; i< getNumberOfCases() ; i++) {\n Configuration conf = get(i);\n conf.print();\n System.out.print(\"\\n\");\n }\n}", "void printLog(String str)\n { printLog(str,Log.LEVEL_HIGH);\n }", "public void setLoggingLevel(String loggingLevel) {\n this.loggingLevel = loggingLevel;\n }", "static public void setLogLevel(final Logger.LEVEL desiredLevel) {\n ThreadPoolWorkQueue.execute(new Runnable() {\n @Override\n public void run() {\n setLevelSync(desiredLevel);\n // we do this mostly to enable unit tests to logger.wait(100) instead of\n // Thread.sleep(100) -- it's faster, more stable, and more deterministic that way\n synchronized (WAIT_LOCK) {\n WAIT_LOCK.notifyAll();\n }\n }\n });\n }", "public static void log (int logLevel, String tag, String message, Class<?> loggingClass) {\n\n\t\tif (!isLoggingEnabledInConfigurationManager ())\n\t\t\treturn;\n\t\t\n\t\tlogByLevel (logLevel, tag, message, loggingClass);\n\t}", "public void setLogLevel(int level) {\n logLevel = level;\n }", "private void printIndexMap(HashMap<String, HashSet<String>> hmap, boolean printToScreen, boolean printToFile){\n\t\t\n\t\ttry{\n\t\t\t//False overwrites old data\n\t\t\tFileWriter writer = new FileWriter(HUMAN_READABLE_INDEX, false); \n\t\t\n\t\t\t//creating output string\n\t\t\tString output = new String();\n\t for(String key: hmap.keySet()){\n\t\t \toutput = key + \" -> \" + String.join(\", \", hmap.get(key));\n\t\t \t\n\t\t //Printing to screen\n\t\t if(printToScreen)\n\t\t \tSystem.out.println(output);\n\t\t \n\t\t if(printToFile){\n\t\t\t\t\ttry {\n\t\t\t\t\t\twriter.write(output + \"\\n\");\n\t\t\t\t\t} catch (IOException e){}\t\n\t\t } \t\n\t }\n\t \n\t writer.close();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "protected void indent(Writer out, int level) throws IOException {\r\n if (currentFormat.newlines) {\r\n if (currentFormat.indent == null ||\r\n currentFormat.indent.equals(\"\")) {\r\n return;\r\n }\r\n\r\n for (int i = 0; i < level; i++) {\r\n out.write(currentFormat.indent);\r\n }\r\n }\r\n }", "public void printGivenLevel(Node tree, int level){\n\t\tif(tree == null){\n\t\t\treturn;\n\t\t}\n\t\telse if(level == 1){\n\t\t\tSystem.out.print(tree.data+ \" \");\n\t\t}\n\t\telse if(level >1){\n\t\t\tprintGivenLevel(tree.getLeft(), (level-1));\n\t\t\tprintGivenLevel(tree.getRight(), (level-1));\n\t\t}\n\t}", "void printLevelOrder() \n { \n int h = height(this); \n int i; \n for (i=1; i<=h; i++) \n printGivenLevel(this, i); \n }", "@Override\n\tpublic void printf(Level level, Marker marker, String format, Object... params) {\n\n\t}", "public void set_log_level(int level) {\r\n logLevel = Math.max(0,level);\r\n }", "private static void normal(List<Logger> loggers)\n {\n for ( Logger logger : loggers ) {\n logger.setLevel(Level.INFO);\n }\n }", "void initializeLogging();", "static public void GLOBLOG(int logNumber, char logChar) {\r\n if(logNumber <= GlobalOptions.logLevel){\r\n // System.out.print(\"LOG-->\"+logChar);\r\n System.out.print(newline_prefix + logChar);\r\n System.out.flush();\r\n }\r\n }", "public static void setSingleLineLoggingFormat() {\n Logger rootLogger = Logger.getLogger(\"\");\n for (Handler handler : rootLogger.getHandlers()) {\n handler.setFormatter(new SingleLineFormater());\n }\n }", "protected void printDebugLogMessage(final String[] lines) {\n\t\tif (AbstractTraceAnalysisFilter.LOGGER.isDebugEnabled()) {\n\t\t\tAbstractTraceAnalysisFilter.LOGGER.debug(\"\");\n\t\t\tAbstractTraceAnalysisFilter.LOGGER.debug(\"#\");\n\t\t\tAbstractTraceAnalysisFilter.LOGGER.debug(\"# Plugin: \" + this.getClass().getName());\n\t\t\tfor (final String l : lines) {\n\t\t\t\tAbstractTraceAnalysisFilter.LOGGER.debug(l);\n\t\t\t}\n\t\t}\n\t}", "void setIndentLevel(int level);", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4) {\n\n\t}", "private void setupLogging() {\n\t\t// Ensure all JDK log messages are deferred until a target is registered\n\t\tLogger rootLogger = Logger.getLogger(\"\");\n\t\tHandlerUtils.wrapWithDeferredLogHandler(rootLogger, Level.SEVERE);\n\n\t\t// Set a suitable priority level on Spring Framework log messages\n\t\tLogger sfwLogger = Logger.getLogger(\"org.springframework\");\n\t\tsfwLogger.setLevel(Level.WARNING);\n\n\t\t// Set a suitable priority level on Roo log messages\n\t\t// (see ROO-539 and HandlerUtils.getLogger(Class))\n\t\tLogger rooLogger = Logger.getLogger(\"org.springframework.shell\");\n\t\trooLogger.setLevel(Level.FINE);\n\t}", "private static void print(final String format, final Object...params) {\n // we prefix all our messages with \">>> \" so as to distinguish them from the driver, node and client messages\n final String msg = String.format(\">>> \" + format, params);\n log.info(msg);\n System.out.println(msg);\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6, Object p7, Object p8) {\n\n\t}", "private void initSections() {\n sections = new HashMap<>();\n addSection(JsonFailuresInput.class, new JsonFailuresInput(inputProgram, jsonObject));\n addSection(JsonTransformationCollectionInput.class,\n new JsonTransformationCollectionInput(inputProgram, jsonObject));\n addSection(JsonHeaderInput.class, new JsonHeaderInput(inputProgram, jsonObject, verifyProject));\n }", "@Override\n\tpublic void log(Level level, String message, Object... params) {\n\n\t}", "void printLevelOrder() {\n\t\tint h = height(root);\n\t\tint i;\n\t\tfor (i = h; i >= 1; i--)\n\t\t\tprintGivenLevel(root, i);\n\t}", "public void setLogLevel(eKVLogLevel outputlevel, eKVLogLevel logLevel){\n kv_out.changeOutputLevel(outputlevel);\n kv_out.changeLogLevel(logLevel);\n for (KVServerInstance instance: aliveInstances\n ) {\n instance.changeLogLevel(outputlevel,logLevel);\n }\n }", "protected void simpleLog(Level level, String message) {\n if (getClassLogger().isLoggable(level)) {\n TestBench.out().println(message);\n }\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6, Object p7, Object p8, Object p9) {\n\n\t}", "public void logAllPossibleKeysWithValue() {\n log.info(\"Log all possible keys with value:\");\n log.info(mapToString(context));\n }", "public static void Log(String Message, int Level)\n {\n if(Level == 0)\n {\n System.out.println(\"[\" + Reference.MOD_ID + \"]\" + \" \" + Message);\n }\n \n if(Level == 1)\n {\n System.out.println(\"[\" + Reference.MOD_ID + \"]\" + \" \" + Message);\n }\n \n if(Level == 2)\n {\n System.out.println(\"[\" + Reference.MOD_ID + \"]\" + \" \" + Message);\n }\n }", "public void printMappings() {\t\n\t\tSystem.out.println(\"Printing rowsMap. \");\n\t\tfor (Map.Entry<String, String> entry : rowMap.entrySet()) {\n\t\t System.out.println(entry);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Printing columnMap. \");\n\t\tfor (Map.Entry<String, String> entry : columnMap.entrySet()) {\n\t\t System.out.println(entry);\n\t\t}\n\t}", "protected void setLogLevel(int logLevel) \n\t{\n\t\tthis.logLevel = logLevel;\n\t}", "@Override\n\tpublic void log(Level level, String message) {\n\n\t}", "public static void printMap(mapNode[][] nodes){\n\t\tint sizeOfMap = nodes.length;\r\n\t\tfor (int i = 0; i < sizeOfMap; i++) {\r\n\t\t\tfor (int j = 0; j < sizeOfMap; j++) {\r\n\t\t\t\tif (j == 9) {\r\n\t\t\t\t\tif(nodes[j][i].getOwnElevation() == 999999999){\r\n\t\t\t\t\t\tSystem.out.println(\"X\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(nodes[j][i].getOwnElevation() == -1){\r\n\t\t\t\t\t\tSystem.out.println(\"*\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tSystem.out.println(nodes[j][i].getOwnElevation());\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif(nodes[j][i].getOwnElevation() == 999999999){\r\n\t\t\t\t\t\tSystem.out.print(\"X \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(nodes[j][i].getOwnElevation() == -1){\r\n\t\t\t\t\t\tSystem.out.print(\"* \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tSystem.out.print(nodes[j][i].getOwnElevation()+\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void print(LogLevel level, Object message)\n {\n print(level, String.valueOf(message));\n }", "@Test\n public void testLevelToString() {\n for (PdfaFlavour.Level level : PdfaFlavour.Level.values()) {\n System.out.println(level.toString());\n }\n }", "private static void verbose(List<Logger> loggers)\n {\n for ( Logger logger : loggers ) {\n logger.setLevel(Level.DEBUG);\n }\n }", "public void print() {\n System.out.println();\n for (int level = 0; level < 4; level++) {\n System.out.print(\" Z = \" + level + \" \");\n }\n System.out.println();\n for (int row = 3; row >= 0; row--) {\n for (int level = 0; level < 4; level++) {\n for (int column = 0; column < 4; column++) {\n System.out.print(get(column, row, level));\n System.out.print(\" \");\n }\n System.out.print(\" \");\n }\n System.out.println();\n }\n System.out.println();\n }", "public void customLogger() {\n KOOM.getInstance().setLogger(new KLog.KLogger() {\n @Override\n public void i(String TAG, String msg) {\n //get the log of info level\n }\n\n @Override\n public void d(String TAG, String msg) {\n //get the log of debug level\n }\n\n @Override\n public void e(String TAG, String msg) {\n //get the log of error level\n }\n });\n }", "public void setLoggerLevel(TraceLevel level) {\n\t\t//Topology.STREAMS_LOGGER.setLevel(level);\t\t\n\t\t//Topology.TOPOLOGY_LOGGER.setLevel(level); \n\t\tgetConfig().put(ContextProperties.TRACING_LEVEL, java.util.logging.Level.FINE);\t\t\n\t\tSystem.out.println(\"Streams topology logger level: \" + Topology.TOPOLOGY_LOGGER.getLevel());\n\t\t\n\t}" ]
[ "0.7321075", "0.56924146", "0.565313", "0.5572319", "0.5334922", "0.5234374", "0.5194292", "0.51460916", "0.5111304", "0.50987303", "0.5094277", "0.50837743", "0.5071933", "0.5025583", "0.49372277", "0.48806646", "0.48799333", "0.48756778", "0.48608184", "0.48398703", "0.4831996", "0.48282093", "0.48251033", "0.48189485", "0.47882926", "0.47825018", "0.47808337", "0.47804242", "0.4773822", "0.47463748", "0.47197166", "0.47077695", "0.4703618", "0.4693745", "0.4688487", "0.46859968", "0.46846148", "0.46753046", "0.46716523", "0.4666165", "0.46598113", "0.46511433", "0.4637189", "0.4623018", "0.4617318", "0.4617214", "0.46110973", "0.46101207", "0.46058252", "0.4597219", "0.45924616", "0.45854983", "0.45842594", "0.45726982", "0.4564728", "0.45628995", "0.45625564", "0.45578957", "0.4552452", "0.45519504", "0.45472103", "0.45304948", "0.45191497", "0.4516853", "0.4515448", "0.4509842", "0.4505697", "0.4492853", "0.44925553", "0.44917697", "0.44909608", "0.44909307", "0.449093", "0.44835457", "0.44818237", "0.44684452", "0.4455839", "0.4455742", "0.44325104", "0.44309875", "0.44262236", "0.44222394", "0.4416113", "0.44104624", "0.44038275", "0.4401092", "0.43958846", "0.4395041", "0.43914923", "0.43905967", "0.43830228", "0.43827474", "0.43812257", "0.43793908", "0.43730992", "0.4372929", "0.43681163", "0.43677932", "0.43672645", "0.43660417" ]
0.7274078
1
Overrides a registered logLevel or adds a new one
public static void registerLevel(LogLevel level, LevelImplementation implementation) { CollectionUtil.replaceOrPut(levels, level.getLevel().toLowerCase(), implementation); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Update withLogLevel(String logLevel);", "private void changeLogLevel(String level){\n\n }", "public static void setLoggingLevel(Level newLevel)\n {\n ErrorLogger.setLevel(newLevel);\n }", "public static void setLevel(int level){\n\tlogLevel = level;\n }", "final public static void setLogLevel(String logLevel) {\n\t\tlogger.setLogLevelImpl(logLevel);\n\t}", "public void setLogLevel(int level) {\n logLevel = level;\n }", "protected void setLogLevel(int logLevel) \n\t{\n\t\tthis.logLevel = logLevel;\n\t}", "public void setLogLevel(Level logLevel) {\n\t\tthis.logLevel = logLevel;\n\t}", "public void setLogLevel(String logLevel) {\n agentConfig.setLogLevel(logLevel);\n logConfigChanged();\n }", "public void setLogLevel(int logLevel) {\n\t\tif(logLevel > 5 || logLevel < 0) \n\t\t\tthrow new IllegalArgumentException(\"invalid parameter logLevel, please use Logger's static level constant.\");\n\t\tmLogLevel = logLevel;\n\t}", "public void setLogLevel(int level) {\n\t\t// only change if a valid level\n\t\tif (isValidLogLevel(level)) this.logLevel = level;\n\t}", "protected static void updateLevel(LogLevel lvl){\n //System.out.println(\"updateLevel: \"+lvl);\n Level level;\n \n EZLoggerManager.lvl = lvl;\n //adapted from http://blog.cag.se/?p=835\n Logger logger = Logger.getLogger(\"\");\n \n switch(lvl){\n case error:\n level = Level.SEVERE;\n break;\n case warn:\n level = Level.WARNING;\n break;\n case info:\n level = Level.INFO;\n break;\n case debug:\n default:\n level = Level.CONFIG;\n break;\n }\n logger.setLevel(level);\n Handler[] handlers = logger.getHandlers();\n for(Handler h : handlers){\n h.setLevel(level);\n }\n }", "private void setLevel(final org.apache.log4j.Level level) {\r\n if (log.isWarnEnabled()) {\r\n log.warn(\"LogUtil : level changed to : \" + level.toString());\r\n }\r\n\r\n for (final Log l : this.logs.values()) {\r\n setLevel(l, level);\r\n }\r\n }", "public void overrideLogLevel(String level) {\n Logger rootLogger = LoggerFactory.getLogger(\"org.mockserver\");\n if (rootLogger instanceof ch.qos.logback.classic.Logger) {\n ((ch.qos.logback.classic.Logger) rootLogger).setLevel(Level.toLevel(level));\n }\n }", "public static void setJXTALogger(JXTA_LOG_LEVEL logLevel) {\n\t\tswitch (logLevel) {\n\t\tcase FINEST:\n\t\t\tremoveJavaStdLoggerHandlers();\n\t\t\tSystem.setProperty(\"net.jxta.logging.Logging\",\n\t\t\t\t\tJXTA_LOG_LEVEL.FINEST.name());\n\t\t\tSystem.setProperty(\"net.jxta.level\", JXTA_LOG_LEVEL.FINEST.name());\n\t\t\tbreak;\n\t\tcase FINER:\n\t\t\tremoveJavaStdLoggerHandlers();\n\t\t\tSystem.setProperty(\"net.jxta.logging.Logging\",\n\t\t\t\t\tJXTA_LOG_LEVEL.FINER.name());\n\t\t\tSystem.setProperty(\"net.jxta.level\", JXTA_LOG_LEVEL.FINER.name());\n\t\t\tbreak;\n\t\tcase FINE:\n\t\t\tremoveJavaStdLoggerHandlers();\n\t\t\tSystem.setProperty(\"net.jxta.logging.Logging\",\n\t\t\t\t\tJXTA_LOG_LEVEL.FINE.name());\n\t\t\tSystem.setProperty(\"net.jxta.level\", JXTA_LOG_LEVEL.FINE.name());\n\t\t\tbreak;\n\t\tcase INFO:\n\t\t\tremoveJavaStdLoggerHandlers();\n\t\t\tSystem.setProperty(\"net.jxta.logging.Logging\",\n\t\t\t\t\tJXTA_LOG_LEVEL.INFO.name());\n\t\t\tSystem.setProperty(\"net.jxta.level\", JXTA_LOG_LEVEL.INFO.name());\n\t\t\tbreak;\n\t\tcase WARNING:\n\t\t\tremoveJavaStdLoggerHandlers();\n\t\t\tSystem.setProperty(\"net.jxta.logging.Logging\",\n\t\t\t\t\tJXTA_LOG_LEVEL.WARNING.name());\n\t\t\tSystem.setProperty(\"net.jxta.level\", JXTA_LOG_LEVEL.WARNING.name());\n\t\t\tbreak;\n\t\tcase SEVERE:\n\t\t\tremoveJavaStdLoggerHandlers();\n\t\t\tSystem.setProperty(\"net.jxta.logging.Logging\",\n\t\t\t\t\tJXTA_LOG_LEVEL.SEVERE.name());\n\t\t\tSystem.setProperty(\"net.jxta.level\", JXTA_LOG_LEVEL.SEVERE.name());\n\t\t\tbreak;\n\t\tcase OFF:\n\t\t\tremoveJavaStdLoggerHandlers();\n\t\t\tSystem.setProperty(\"net.jxta.logging.Logging\",\n\t\t\t\t\tJXTA_LOG_LEVEL.OFF.name());\n\t\t\tSystem.setProperty(\"net.jxta.level\", JXTA_LOG_LEVEL.OFF.name());\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}", "public static void setLogLevel(int level) {\n mLogLevel = level;\n }", "static public void setLogLevel(final Logger.LEVEL desiredLevel) {\n ThreadPoolWorkQueue.execute(new Runnable() {\n @Override\n public void run() {\n setLevelSync(desiredLevel);\n // we do this mostly to enable unit tests to logger.wait(100) instead of\n // Thread.sleep(100) -- it's faster, more stable, and more deterministic that way\n synchronized (WAIT_LOCK) {\n WAIT_LOCK.notifyAll();\n }\n }\n });\n }", "private void configureLogLevels()\r\n { \r\n String level = properties.getProperty(\"LogLevel\");\r\n \r\n switch(level)\r\n {\r\n case \"INFO\": INFO = Level.INFO; \r\n DEBUG = Level.FINE; \r\n WARNING = Level.FINE;\r\n break;\r\n case \"DEBUG\": INFO = Level.INFO;\r\n DEBUG = Level.INFO; \r\n WARNING = Level.INFO;\r\n break;\r\n case \"WARNING\": INFO = Level.FINE; \r\n DEBUG = Level.FINE; \r\n WARNING = Level.INFO; \r\n break;\r\n default: INFO = Level.INFO; \r\n DEBUG = Level.FINE; \r\n WARNING = Level.WARNING;\r\n break;\r\n }\r\n }", "public static void setLogLevel(int level){\n\t\tswitch(level){\n\t\t\tcase ONE: \n\t\t\t\tLogger.getRootLogger().setLevel(Level.ALL); \n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.ALL\"); \n\t\t\t\tbreak;\n\t\t\tcase TWO: \n\t\t\t\tLogger.getRootLogger().setLevel(Level.DEBUG); \n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.DEBUG\"); \n\t\t\t\tbreak;\n\t\t\tcase THREE:\n\t\t\t\tLogger.getRootLogger().setLevel(Level.ERROR);\n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.ERROR\");\n\t\t\t\tbreak;\n\t\t\tcase FOUR:\n\t\t\t\tLogger.getRootLogger().setLevel(Level.FATAL);\n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.FATAL\");\n\t\t\t\tbreak;\n\t\t\tcase FIVE:\n\t\t\t\tLogger.getRootLogger().setLevel(Level.INFO);\n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.INFO\");\n\t\t\t\tbreak;\n\t\t\tcase SIX:\n\t\t\t\tLogger.getRootLogger().setLevel(Level.OFF); \n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.OFF\");\n\t\t\t\tbreak;\n\t\t\tcase SEVEN:\n\t\t\t\tLogger.getRootLogger().setLevel(Level.WARN);\n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.WARN\");\n\t\t\t\tbreak;\n\t\t\tcase EIGHT:\n\t\t\t\tLogger.getRootLogger().setLevel(Level.TRACE);\n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.WARN\");\n\t\t\t\tbreak;\n\t\t\tdefault: \n\t\t\t\tLogger.getRootLogger().setLevel(Level.ALL);\n\t\t\t\tLOGGER.info(\"Logging Level defaulted to LEVEL.ALL Please add parameter to properties file for custom logging.\");\n\t\t\t\tbreak;\n\t\t}\n\t}", "public String changeLogLevel(ChangeLogLevelRequest logLevel){return \"\";}", "public void setLoggingLevel(String loggingLevel) {\n this.loggingLevel = loggingLevel;\n }", "private native void Df1_Set_Log_Filter_Level(int level);", "@GET\n @Path(\"/loglevel/{level}\")\n public Response setLogLevel(@Context HttpServletRequest request,@Context HttpServletResponse response,@Context ServletContext servletContext, @PathParam(\"level\") String level) throws JsonGenerationException, JsonMappingException, IOException{\n LogManager.getRootLogger().setLevel(org.apache.log4j.Level.toLevel(level));\n return Response.status(200).entity(\"{\\\"status\\\":\\\"DONE\\\", \\\"Message\\\":\\\"Changed Log level to: \"+LogManager.getRootLogger().getLevel().toString()+\"\\\"}\").build();\n }", "public void setLevel(String newLevel) {\n level = newLevel;\n }", "public static synchronized void setMetricsLevel(String newMetricsLevel) {\n\n if (overrideLogbackLevel) {\n if (\"OFF\".equalsIgnoreCase(newMetricsLevel)) {\n PolicyLogger.metricsLevel = Level.OFF;\n metricsLogger.setLevel(metricsLevel);\n } else {\n // --- set default value\n metricsLogger.setLevel(Level.INFO);\n PolicyLogger.metricsLevel = Level.INFO;\n }\n }\n\n }", "public void setClassLogLevel(String classPath, Level logLevel) {\n\t\tLogger logger = LogManager.getLogger(classPath);\n\t\tlogger.setLevel(logLevel);\t\n\t}", "@Override\n public MultiInvokerConfigurationBuilder withLogLevel(LogLevel logLevel) {\n if (logLevel == null) {\n return this;\n }\n this.log = logFactory.create(logLevel);\n return this;\n }", "private static void setLoggingLevel(Level level) {\n ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) org.slf4j.LoggerFactory.getLogger(ch.qos.logback.classic.Logger.ROOT_LOGGER_NAME);\n root.setLevel(level);\n }", "@Test\n public void testCustomLoggingLevels() {\n LogTestLogger customLogger = new LogTestLogger();\n Database.log.setCustom(customLogger);\n\n for(int i = 5; i >= 1; i--) {\n customLogger.getLines().clear();\n customLogger.setLevel(LogLevel.values()[i]);\n Log.v(LogDomain.DATABASE, \"TEST VERBOSE\");\n Log.i(LogDomain.DATABASE, \"TEST INFO\");\n Log.w(LogDomain.DATABASE, \"TEST WARNING\");\n Log.e(LogDomain.DATABASE, \"TEST ERROR\");\n assertEquals(5 - i, customLogger.getLines().size());\n }\n }", "public static int getLevel(){\n\treturn logLevel;\n }", "public static void setLevel(final String logLevel) {\r\n\t\tif (logLevel.equalsIgnoreCase(\"FATAL\")) {\r\n\t\t\tServletLoggingOutput.setLevel(LoggingOutput.LEVEL_FATAL);\r\n\t\t} else if (logLevel.equalsIgnoreCase(\"ERROR\")) {\r\n\t\t\tServletLoggingOutput.setLevel(LoggingOutput.LEVEL_ERROR);\r\n\t\t} else if (logLevel.equalsIgnoreCase(\"WARN\")) {\r\n\t\t\tServletLoggingOutput.setLevel(LoggingOutput.LEVEL_WARN);\r\n\t\t} else if (logLevel.equalsIgnoreCase(\"INFO\")) {\r\n\t\t\tServletLoggingOutput.setLevel(LoggingOutput.LEVEL_INFO);\r\n\t\t} else if (logLevel.equalsIgnoreCase(\"DEBUG\")) {\r\n\t\t\tServletLoggingOutput.setLevel(LoggingOutput.LEVEL_DEBUG);\r\n\t\t} else {\r\n\t\t\tthrow new IllegalArgumentException(\"Unknown log level: \" + logLevel);\r\n\t\t}\r\n\t}", "public void set_log_level(int level) {\r\n logLevel = Math.max(0,level);\r\n }", "Log set(Level level) {\n\tthis.logging = level.compareTo(this.level) >= 0;\n\treturn this;\n }", "private synchronized static void setLevelSync(final Logger.LEVEL desiredLevel) {\n if (null == desiredLevel) {\n return;\n }\n level = desiredLevel;\n if (null != context) {\n SharedPreferences prefs = context.getSharedPreferences (SHARED_PREF_KEY, Context.MODE_PRIVATE);\n prefs.edit ().putString (SHARED_PREF_KEY_level, level.toString ()).commit();\n // we still processed the setCapture call, but when SHARED_PREF_KEY_level_from_server is present, it is used for the level field value (it's an override)\n level = Logger.LEVEL.fromString(prefs.getString(SHARED_PREF_KEY_level_from_server, level.toString()));\n }\n }", "public void setLoggerLevel(TraceLevel level) {\n\t\t//Topology.STREAMS_LOGGER.setLevel(level);\t\t\n\t\t//Topology.TOPOLOGY_LOGGER.setLevel(level); \n\t\tgetConfig().put(ContextProperties.TRACING_LEVEL, java.util.logging.Level.FINE);\t\t\n\t\tSystem.out.println(\"Streams topology logger level: \" + Topology.TOPOLOGY_LOGGER.getLevel());\n\t\t\n\t}", "protected abstract void log(T level, Object message);", "protected void initLogger(String logLevel) {\n Logger.setLevel(logLevel);\n }", "void log(Level level, String message);", "@Override\n public Level getLevel() {\n return privateConfig.loggerConfigLevel;\n }", "public static synchronized void setAuditLevel(String newAuditLevel) {\n\n if (overrideLogbackLevel) {\n if (\"OFF\".equalsIgnoreCase(newAuditLevel)) {\n PolicyLogger.auditLevel = Level.OFF;\n auditLogger.setLevel(auditLevel);\n } else {\n // --- set default value\n auditLogger.setLevel(Level.INFO);\n PolicyLogger.auditLevel = Level.INFO;\n }\n }\n }", "@Override\n\tpublic void log(Level level, String message) {\n\n\t}", "public void setLevel(String level);", "public static final void setLevel(final Log log, final org.apache.log4j.Level level) {\r\n setLevel(getLog4JLogger(log), level);\r\n }", "public void setLogFilterLevel(int level)\n\t{\n\t\tDf1_Set_Log_Filter_Level(level);\n\t}", "public int get_log_level() {\r\n return logLevel;\r\n }", "public static LogLevel getLevel(){\n return EZLoggerManager.lvl;\n }", "public synchronized void setLevel(final Level level) {\n if (level == getLevel()) {\n return;\n }\n Level actualLevel;\n if (level != null) {\n actualLevel = level;\n } else {\n final Logger parent = getParent();\n actualLevel = parent != null ? parent.getLevel() : privateConfig.loggerConfigLevel;\n }\n privateConfig = new PrivateConfig(privateConfig, actualLevel);\n }", "TreeLogger.Type getLogLevel() {\n return logLevel;\n }", "@Override\n\tpublic void log(Level level, Object message) {\n\n\t}", "interface WithLogLevel {\n /**\n * Specifies the logLevel property: Indicates whether error logging or verbose logging is enabled..\n *\n * @param logLevel Indicates whether error logging or verbose logging is enabled.\n * @return the next definition stage.\n */\n Update withLogLevel(String logLevel);\n }", "public void logIfLevel(Marker ifLevel, String... messages);", "public void customLogger() {\n KOOM.getInstance().setLogger(new KLog.KLogger() {\n @Override\n public void i(String TAG, String msg) {\n //get the log of info level\n }\n\n @Override\n public void d(String TAG, String msg) {\n //get the log of debug level\n }\n\n @Override\n public void e(String TAG, String msg) {\n //get the log of error level\n }\n });\n }", "public static final void setLevel(final Logger logger, final org.apache.log4j.Level level) {\r\n logger.setLevel(level);\r\n\r\n // Reset the cachedLevel for the log hierarchy :\r\n CommonsLoggingSessionLog.resetCachedLevels();\r\n }", "public int getLogLevel() {\n return logLevel;\n }", "abstract protected void logInternal(int level, String message);", "public void setLevel(int newlevel)\n {\n level = newlevel; \n }", "@Override\n\tpublic void log(Level level, Message msg) {\n\n\t}", "public static void log (int logLevel, String tag, String message, Class<?> loggingClass) {\n\n\t\tif (!isLoggingEnabledInConfigurationManager ())\n\t\t\treturn;\n\t\t\n\t\tlogByLevel (logLevel, tag, message, loggingClass);\n\t}", "public void setLogLevel(eKVLogLevel outputlevel, eKVLogLevel logLevel){\n kv_out.changeOutputLevel(outputlevel);\n kv_out.changeLogLevel(logLevel);\n for (KVServerInstance instance: aliveInstances\n ) {\n instance.changeLogLevel(outputlevel,logLevel);\n }\n }", "@Override\n public void rowWrittenEvent(IRowMeta rowMeta, Object[] row)\n throws HopTransformException { Set the log level back to the original value.\n //\n transformCopy.getLogChannel().setLogLevel(baseLogLevel);\n }", "public void setAppenderLogLevel(Level value) {\n\t\tfor(Enumeration<?> aen = LogManager.getRootLogger().getAllAppenders(); aen.hasMoreElements(); ) {\n Appender appender = (Appender) aen.nextElement();\n logger.debug(\"log4j appender: {}\", appender.getName());\n\t\t}\n\t\t\n\t\tConsoleAppender consoleAppender = (ConsoleAppender)LogManager.getRootLogger().getAppender(\"STDOUT\");\n\t\tconsoleAppender.setThreshold(value);\n\t\tconsoleAppender.activateOptions();\n\n\t\tRollingFileAppender appender = (RollingFileAppender)LogManager.getRootLogger().getAppender(\"RollingFileAppender\");\n\t\tappender.setThreshold(value);\n\t\tappender.activateOptions();\n\t}", "public Level getLogLevel() {\n\t\treturn logLevel;\n\t}", "@Override\n\tpublic void writeToLog(String log, LogLevelEnum logLevel, String className) {\n\t\tSystem.out.println(className + \" : \" + logLevel.toString() + \" : \" + log);\n\t}", "public static void setLevel(LogLevel lvl){\n updateLevel(lvl);\n if (txtAreaHandler!=null){\n txtAreaHandler.changeLevel(lvl);\n }\n }", "public void setLevel(int aLevel, Context context){\n this.level = aLevel;\n writeFile(context);\n }", "public abstract void print(Level level, Object logMessage);", "public void choiceLevel(String lev) {\n switch (lev) {\n\n case \"ALL\":\n mLevelLogger = Level.ALL;\n break;\n case \"NOTIFICATION\":\n mLevelLogger = Level.INFO;\n break;\n case \"HIGH\":\n mLevelLogger = Level.SEVERE;\n break;\n case \"MEDIUM\":\n mLevelLogger = Level.WARNING;\n break;\n case \"LOW\":\n mLevelLogger = Level.INFO;\n break;\n case \"SEVERE\":\n mLevelLogger = Level.SEVERE;\n break;\n case \"WARNING\":\n mLevelLogger = Level.WARNING;\n break;\n case \"INFO\":\n mLevelLogger = Level.INFO;\n break;\n case \"CONFIG\":\n mLevelLogger = Level.CONFIG;\n break;\n case \"FINE\":\n mLevelLogger = Level.FINE;\n break;\n case \"FINER\":\n mLevelLogger = Level.FINER;\n break;\n case \"FINEST\":\n mLevelLogger = Level.FINEST;\n break;\n case \"OFF\":\n mLevelLogger = Level.OFF;\n break;\n default:\n logger.warning(\"Unknow Level:\" + lev);\n }\n }", "Logger loggerArrangement(String logName, String filePath, LogeLevel logLevel);", "public void log(Marker level, String... message);", "private void setLevel(int level) {\n setStat(level, currentLevel);\n }", "public static void setPackageLoggingLevel(String packageRoot, Level level) {\n Logger appLogger = Logger.getLogger(packageRoot);\n appLogger.setLevel(level);\n Logger rootLogger = Logger.getLogger(\"\");\n for (Handler handler : rootLogger.getHandlers()) {\n handler.setLevel(level);\n }\n\n }", "public void fireOnLevelChange(Logger logger, Level level) {\n for (LoggerContextListener onLevelChange : this.loggerContextListenerList) {\n// onLevelChange.onLevelChange(logger, level);\n }\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1) {\n\n\t}", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2) {\n\n\t}", "protected void setLevel(int level){\r\n this.level = level;\r\n }", "public void disabled_og4j_testSetLogLevel() throws Exception {\n assertEquals(\"Default Level is ERROR\", LOGGER.getLevel(), Level.ERROR);\n Helper.setLog4JLogLevel(Level.DEBUG);\n assertEquals(\"Default Level is DEBUG\", LOGGER.getLevel(), Level.DEBUG);\n }", "private LogLevel(int level, String name) {\n\t\tthis.level = level;\n\t\tthis.name = name;\n\t}", "public static void setLevelDebug(Level filtreLev) {\n logger.setLevel(filtreLev);\n }", "LogLevel getLogLevel();", "protected void setLevel(int level)\n {\n this.level = level;\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3) {\n\n\t}", "@SuppressWarnings({ \"unchecked\" })\n public Void run() {\n if (Jvm.isModular()) {\n return null;\n }\n /* This mysterious-looking hack is designed to trick JDK logging into not leaking classloaders and\n so forth when adding levels, by simply shutting down the craptastic level name \"registry\" that it keeps.\n */\n final Class<java.util.logging.Level> lc = java.util.logging.Level.class;\n try {\n synchronized (lc) {\n final Field knownField = lc.getDeclaredField(\"known\");\n knownField.setAccessible(true);\n final List<java.util.logging.Level> old = (List<java.util.logging.Level>) knownField.get(null);\n if (! (old instanceof ReadOnlyArrayList)) {\n knownField.set(null, new ReadOnlyArrayList<java.util.logging.Level>(Arrays.asList(\n Level.TRACE,\n Level.DEBUG,\n Level.INFO,\n Level.WARN,\n Level.ERROR,\n Level.FATAL,\n java.util.logging.Level.ALL,\n java.util.logging.Level.FINEST,\n java.util.logging.Level.FINER,\n java.util.logging.Level.FINE,\n java.util.logging.Level.INFO,\n java.util.logging.Level.CONFIG,\n java.util.logging.Level.WARNING,\n java.util.logging.Level.SEVERE,\n java.util.logging.Level.OFF\n )));\n }\n }\n } catch (Throwable e) {\n // ignore; just don't install\n }\n\n // OpenJDK uses a KnownLevel inner class with two static maps\n try {\n final Class<?> knownLevelClass = Class.forName(\"java.util.logging.Level$KnownLevel\");\n synchronized (knownLevelClass) {\n final Constructor<?> constructor = knownLevelClass.getDeclaredConstructor(java.util.logging.Level.class);\n constructor.setAccessible(true);\n boolean doBuild = false;\n boolean setNameToLevel = false;\n boolean setIntToLevel = false;\n // namesToLevels\n final Field nameToLevels = knownLevelClass.getDeclaredField(\"nameToLevels\");\n nameToLevels.setAccessible(true);\n // Current\n final Map oldNameToLevels = (Map) nameToLevels.get(null);\n if (! (oldNameToLevels instanceof ReadOnlyHashMap)) {\n doBuild = true;\n setNameToLevel = true;\n }\n\n final Field intToLevels = knownLevelClass.getDeclaredField(\"intToLevels\");\n intToLevels.setAccessible(true);\n final Map oldIntToLevels = (Map) intToLevels.get(null);\n if (! (oldIntToLevels instanceof ReadOnlyHashMap)) {\n doBuild = true;\n setIntToLevel = true;\n }\n\n if (doBuild) {\n final KnownLevelBuilder builder = new KnownLevelBuilder(constructor)\n .add(Level.TRACE)\n .add(Level.DEBUG)\n .add(Level.INFO)\n .add(Level.WARN)\n .add(Level.ERROR)\n .add(Level.FATAL)\n .add(java.util.logging.Level.ALL)\n .add(java.util.logging.Level.FINEST)\n .add(java.util.logging.Level.FINER)\n .add(java.util.logging.Level.FINE)\n .add(java.util.logging.Level.INFO)\n .add(java.util.logging.Level.CONFIG)\n .add(java.util.logging.Level.WARNING)\n .add(java.util.logging.Level.SEVERE)\n .add(java.util.logging.Level.OFF);\n\n if (setNameToLevel) {\n nameToLevels.set(null, builder.toNameMap());\n }\n if (setIntToLevel) {\n intToLevels.set(null, builder.toIntMap());\n }\n }\n }\n } catch (Throwable e) {\n // ignore\n }\n\n /* Next hack: the default Sun JMX implementation has a horribly inefficient log implementation which\n kills performance if a custom logmanager is used. We'll just blot that out.\n */\n try {\n final Class<?> traceManagerClass = Class.forName(\"com.sun.jmx.trace.Trace\");\n final Field outField = traceManagerClass.getDeclaredField(\"out\");\n outField.setAccessible(true);\n outField.set(null, null);\n } catch (Throwable e) {\n // ignore; just skip it\n }\n /* Next hack: Replace the crappy MXBean on the system logmanager, if it's there.\n */\n final Class<java.util.logging.LogManager> lmc = java.util.logging.LogManager.class;\n try {\n synchronized (lmc) {\n final Field loggingMXBean = lmc.getDeclaredField(\"loggingMXBean\");\n loggingMXBean.setAccessible(true);\n loggingMXBean.set(null, LogContext.getSystemLogContext().getLoggingMXBean());\n }\n } catch (Throwable e) {\n // ignore; just skip it\n }\n return null;\n }", "public int addLogger(int minLevel, int maxLevel) {\n return NetworkTablesJNI.addLogger(m_handle, minLevel, maxLevel);\n }", "@Override\n\tpublic void log(Level level, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6) {\n\n\t}", "public static void log (int logLevel, String tag, String message) {\n\n\t\tif (!isLoggingEnabledInConfigurationManager ())\n\t\t\treturn;\n\n\t\tlogByLevel (logLevel, tag, message, null);\n\t}", "public Level getLogLevel()\n\t{\n\t\treturn this.logLevel;\n\t}", "public void setLevel(String level){\n\t\tthis.level = level;\n\t}", "@Test\n @EnabledIfSystemProperty( named = \"integrationTest\", matches = \"true\" )\n @Order(1)\n public void testChangeLogLevel() {\n try{\n logModule.changeLogLevel(new URI(integrationHost), Logger.Level.FATAL);\n }\n catch ( Exception e)\n {\n assertTrue( false, String.format(\"Got error: %s\", e.getMessage()) );\n }\n }", "private void checkLogLevel() {\n config.getString(\"log_level\");\n }", "public void setLOG(Logger newLog)\r\n\t{\r\n\t\tlog = newLog;\r\n\t}", "public void setLevel(String level) {\n this.level = level;\n }", "public void setLevel(String level) {\n this.level = level;\n }", "void setLogLevelsFromSharedPreferences() {\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);\n\n // Set root log level\n String logLevelRoot =\n sharedPreferences.getString(getString(R.string.preferences_key_log_level),\n getString(R.string.preferences_default_log_level));\n Logs.setRootLogLevel(logLevelRoot);\n\n // Set log level for file appender\n String logLevelFile =\n sharedPreferences.getString(getString(R.string.preferences_key_log_level_file),\n getString(R.string.preferences_default_log_level_file));\n Logs.setThresholdFilterLevel(logLevelFile, Constants.FILE_APPENDER_NAME, this);\n\n // Set log level for logcat appender\n String logLevelLogCat =\n sharedPreferences.getString(getString(R.string.preferences_key_log_level_logcat),\n getString(R.string.preferences_default_log_level_logcat));\n Logs.setLogCatLevel(logLevelLogCat, this);\n }", "@Override\n public PutResourceLogLevelResult putResourceLogLevel(PutResourceLogLevelRequest request) {\n request = beforeClientExecution(request);\n return executePutResourceLogLevel(request);\n }", "@Override\n\tpublic JsonElement changeLogLevel(ChangeLogLevelRequest cllr) {\n\t\treturn null;\n\t}", "public int getLogLevel() {\n\t\treturn this.logLevel;\n\t}", "public static void add(int level, String resourceID) {\n\tif (logLevel >= level) {\n\t addInfo(I18N.loadString(resourceID));\n\t}\n }", "@Override\n\tpublic void log(Level level, String message, Object... params) {\n\n\t}", "protected String getDefaultLogLevel()\n {\n return DEFAULT_LOGLEVEL;\n }", "public void setLevel(int level) { \r\n\t\tthis.level = level; \r\n\t}" ]
[ "0.7531613", "0.7183811", "0.71008736", "0.70030546", "0.6947914", "0.6866942", "0.6838704", "0.68341106", "0.6800788", "0.66188425", "0.66029096", "0.6556868", "0.6526309", "0.6522609", "0.65126425", "0.6508076", "0.6465626", "0.64622384", "0.6445315", "0.64399743", "0.6366803", "0.6343787", "0.6316824", "0.6286782", "0.6260606", "0.625427", "0.6241553", "0.62370306", "0.62089896", "0.6198312", "0.6185198", "0.6181911", "0.61730444", "0.6166446", "0.61212337", "0.6115948", "0.60702044", "0.60370773", "0.59991443", "0.5969983", "0.59655607", "0.5935299", "0.59351444", "0.5930608", "0.589381", "0.58845586", "0.58293176", "0.5824872", "0.5819287", "0.5817184", "0.5795855", "0.57727677", "0.5762812", "0.5743104", "0.5717771", "0.5710392", "0.57099926", "0.5697185", "0.5665686", "0.56473655", "0.5644293", "0.56428003", "0.55899596", "0.55705994", "0.5569284", "0.5566391", "0.5558668", "0.55577236", "0.55522484", "0.55267036", "0.5526274", "0.5512947", "0.5506417", "0.5501856", "0.54944354", "0.5493312", "0.54866445", "0.5481783", "0.5480961", "0.54720986", "0.547197", "0.54674935", "0.5465538", "0.5460238", "0.5450537", "0.54423463", "0.5418645", "0.5391969", "0.538487", "0.5378172", "0.5375011", "0.5375011", "0.53493357", "0.53456765", "0.53453207", "0.5335834", "0.53282917", "0.53251064", "0.53129035", "0.5307802" ]
0.56454206
60
Creates a DirectReference element.
public DirectReference() throws XWSSecurityException { try { setSOAPElement( soapFactory.createElement( "Reference", "wsse", MessageConstants.WSSE_NS)); } catch (SOAPException e) { log.log(Level.SEVERE, "WSS0750.soap.exception", new Object[] {"wsse:Reference", e.getMessage()}); throw new XWSSecurityException(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "CollectionReferenceElement createCollectionReferenceElement();", "ReferenceEmbed createReferenceEmbed();", "ReferenceLink createReferenceLink();", "ReferenceProperty createReferenceProperty();", "ElementDefinition createElementDefinition();", "ReferenceTreatment createReferenceTreatment();", "HxType createReference(final String className);", "PropertyReference createPropertyReference();", "public DirectReference(SOAPElement element, boolean isBSP) throws XWSSecurityException {\n setSOAPElement(element);\n if (!(element.getLocalName().equals(\"Reference\") &&\n XMLUtil.inWsseNS(element))) {\n log.log(Level.SEVERE,\n \"WSS0751.invalid.direct.reference\",\n \"{\"+element.getNamespaceURI()+\"}\"+element.getLocalName());\n throw new XWSSecurityException(\"Invalid DirectReference passed\");\n }\n\n if (isBSP && (getURI()==null)) {\n throw new XWSSecurityException(\"Violation of BSP R3062\" +\n \": A wsse:Reference element in a SECURITY_TOKEN_REFERENCE MUST specify a URI attribute\");\n }\n }", "EReference createEReference();", "@DOMSupport(DomLevel.ONE)\r\n @BrowserSupport({BrowserType.FIREFOX_2P})\r\n\t@Function EntityReference createEntityReference(String name);", "public abstract W3CEndpointReference createW3CEndpointReference(String address, QName serviceName,\n QName portName, List<Element> metadata, String wsdlDocumentLocation,\n List<Element> referenceParameters);", "UdtRef createUdtRef();", "DomainElement createDomainElement();", "public Reference() {\n super();\n }", "DataNameReference createDataNameReference();", "Element createElement();", "public Element createReferencingElementNode(\r\n final Document doc, final String namespaceUri, final String prefix, final String tagName,\r\n final String xlinkPrefix, final String title, final String href) throws Exception {\r\n\r\n Element newElement = createElementNodeWithXlink(doc, namespaceUri, prefix, tagName, xlinkPrefix, title, href);\r\n\r\n Attr objidAttr = createAttributeNode(doc, null, null, NAME_OBJID, getObjidFromHref(href));\r\n newElement.getAttributes().setNamedItemNS(objidAttr);\r\n\r\n return newElement;\r\n }", "VariableRef createVariableRef();", "ReferenceRealization createReferenceRealization();", "void createProjectReference(java.lang.String referenceName, org.apache.ant.common.model.Project model) throws org.apache.ant.common.util.ExecutionException;", "public ASTNode createReference() {\n return new ASTFunctionReference(getName(), getNumParams());\n }", "public ResourceReferenceDt getAttachmentElement() { \n\t\tif (myAttachment == null) {\n\t\t\tmyAttachment = new ResourceReferenceDt();\n\t\t}\n\t\treturn myAttachment;\n\t}", "ExternalReference createExternalReference();", "public void addReference(Reference ref) {\n references.addElement(ref);\n }", "public abstract R createReference(T type, Object value);", "DataElement createDataElement();", "public Dependency(final Reference reference) {\r\n\tthis(reference.getGroupId(), reference.getArtifactId(), reference.getVersion());\r\n }", "public org.purl.dc.elements.x11.SimpleLiteral addNewReferences()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.purl.dc.elements.x11.SimpleLiteral target = null;\r\n target = (org.purl.dc.elements.x11.SimpleLiteral)get_store().add_element_user(REFERENCES$0);\r\n return target;\r\n }\r\n }", "public W3CEndpointReference createW3CEndpointReference(String address, QName interfaceName,\n QName serviceName, QName portName, List<Element> metadata, String wsdlDocumentLocation,\n List<Element> referenceParameters, List<Element> elements, Map<QName, String> attributes) {\n throw new UnsupportedOperationException(\n \"JAX-WS 2.2 implementation must override this default behaviour.\");\n }", "HxType createReference(final HxType resolvedType);", "ObjectElement createObjectElement();", "<T extends Binding> PhysicalWireDefinition generateBoundReference(LogicalBinding<T> binding) throws Fabric3Exception;", "Definition createDefinition();", "public void addReference() {\r\n mReferenced = true;\r\n }", "ReferenceData add(ReferenceData instance) throws DataException;", "public Binding setReference(IDatatype theValue) {\n\t\tmyReference = theValue;\n\t\treturn this;\n\t}", "public Element referenceElement(final String nom) {\n return(cacheDefElement.get(nom));\n }", "@View( VIEW_CREATE_REFERENCE )\r\n public String getCreateReference( HttpServletRequest request )\r\n {\r\n _reference = ( _reference != null ) ? _reference : new Reference( );\r\n Map<String, Object> model = getModel( );\r\n model.put( MARK_REFERENCE, _reference );\r\n return getPage( PROPERTY_PAGE_TITLE_CREATE_REFERENCE, TEMPLATE_CREATE_REFERENCE, model );\r\n }", "DirectiveDefinition createDirectiveDefinition();", "private Node generateCritRefElementRef(Node outboundRelElem, Node elementRefNode, XmlProcessor hqmfXmlProcessor)\n\t\t\tthrows XPathExpressionException {\n\t\tString ext = getElementRefExt(elementRefNode, measureExport.getSimpleXMLProcessor());\n\t\tString root = elementRefNode.getAttributes().getNamedItem(ID).getNodeValue();\n\t\tNode idNodeQDM = hqmfXmlProcessor.findNode(hqmfXmlProcessor.getOriginalDoc(),\n\t\t\t\t\"//entry/*/id[@root=\\\"\" + root + \"\\\"][@extension=\\\"\" + ext + \"\\\"]\");\n\t\tif (idNodeQDM != null) {\n\t\t\tNode parent = idNodeQDM.getParentNode();\n\t\t\tif (parent != null) {\n\t\t\t\tNamedNodeMap attribMap = parent.getAttributes();\n\t\t\t\tString classCode = attribMap.getNamedItem(CLASS_CODE).getNodeValue();\n\t\t\t\tString moodCode = attribMap.getNamedItem(MOOD_CODE).getNodeValue();\n\n\t\t\t\t// create criteriaRef\n\t\t\t\tElement criteriaReference = hqmfXmlProcessor.getOriginalDoc().createElement(CRITERIA_REFERENCE);\n\t\t\t\tcriteriaReference.setAttribute(CLASS_CODE, classCode);\n\t\t\t\tcriteriaReference.setAttribute(MOOD_CODE, moodCode);\n\n\t\t\t\tElement id = hqmfXmlProcessor.getOriginalDoc().createElement(ID);\n\t\t\t\tid.setAttribute(ROOT, root);\n\t\t\t\tid.setAttribute(EXTENSION, ext);\n\n\t\t\t\tcriteriaReference.appendChild(id);\n\t\t\t\toutboundRelElem.appendChild(criteriaReference);\n\t\t\t\t// return <entry> element\n\t\t\t\treturn parent.getParentNode();\n\t\t\t}\n\t\t} else {\n\t\t\t// check if this is a measurement period\n\t\t\tString displayName = elementRefNode.getAttributes().getNamedItem(DISPLAY_NAME).getNodeValue();\n\t\t\tif (\"Measurement Period : Timing Element\".equals(displayName)) {\n\t\t\t\t// create criteriaRef\n\t\t\t\tElement criteriaReference = hqmfXmlProcessor.getOriginalDoc().createElement(CRITERIA_REFERENCE);\n\t\t\t\tcriteriaReference.setAttribute(CLASS_CODE, \"OBS\");\n\t\t\t\tcriteriaReference.setAttribute(MOOD_CODE, \"EVN\");\n\n\t\t\t\tElement id = hqmfXmlProcessor.getOriginalDoc().createElement(ID);\n\t\t\t\tid.setAttribute(ROOT, elementRefNode.getAttributes().getNamedItem(ID).getNodeValue());\n\t\t\t\tid.setAttribute(EXTENSION, \"measureperiod\");\n\n\t\t\t\tcriteriaReference.appendChild(id);\n\t\t\t\toutboundRelElem.appendChild(criteriaReference);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "FieldRefType createFieldRefType();", "BElement createBElement();", "public static Reference create(IFile file) {\n return new Reference(file.getProject(), getMapKey(file));\n }", "Link createLink();", "public Surface(String ref){\r\n\t\tthis();\r\n\t\taddAttribute(new PointingElement(\"ref\",ref));\r\n\t}", "public LinkElement() { }", "B documentReference(String documentReference);", "Element createXmlDeepSkyTargetElement(Element element, String xsiType) {\n\n if (element == null) {\n return null;\n }\n\n Document ownerDoc = element.getOwnerDocument();\n\n // Get or create the container element\n Element e_Targets = null;\n boolean created = false;\n NodeList nodeList = ownerDoc.getElementsByTagName(RootElement.XML_TARGET_CONTAINER);\n if (nodeList.getLength() == 0) { // we're the first element. Create container element\n e_Targets = ownerDoc.createElement(RootElement.XML_TARGET_CONTAINER);\n created = true;\n } else {\n e_Targets = (Element) nodeList.item(0); // there should be only one container element\n }\n\n // Check if this element doesn't exist so far\n nodeList = e_Targets.getElementsByTagName(ITarget.XML_ELEMENT_TARGET);\n if (nodeList.getLength() > 0) {\n Node currentNode = null;\n NamedNodeMap attributes = null;\n for (int i = 0; i < nodeList.getLength(); i++) { // iterate over all found nodes\n currentNode = nodeList.item(i);\n attributes = currentNode.getAttributes();\n Node idAttribute = attributes.getNamedItem(ISchemaElement.XML_ELEMENT_ATTRIBUTE_ID);\n if ((idAttribute != null) // if ID attribute is set and equals this objects ID, return existing element\n && (idAttribute.getNodeValue().trim().equals(this.getID().trim()))) {\n // Not sure if this is good!? Maybe we should return currentNode and make\n // doublicity check in caller\n // class!?\n return null;\n }\n }\n }\n\n // Create the new target element\n Element e_Target = this.createXmlTargetElement(e_Targets);\n e_Targets.appendChild(e_Target);\n\n // Set XSI:Type\n e_Target.setAttribute(ITarget.XML_XSI_TYPE, xsiType);\n\n if (smallDiameter != null) {\n Element e_SmallDiameter = ownerDoc.createElement(XML_ELEMENT_SMALLDIAMETER);\n e_SmallDiameter = smallDiameter.setToXmlElement(e_SmallDiameter);\n\n e_Target.appendChild(e_SmallDiameter);\n }\n\n if (largeDiameter != null) {\n Element e_LargeDiameter = ownerDoc.createElement(XML_ELEMENT_LARGEDIAMETER);\n e_LargeDiameter = largeDiameter.setToXmlElement(e_LargeDiameter);\n\n e_Target.appendChild(e_LargeDiameter);\n }\n\n if (!Float.isNaN(visibleMagnitude)) {\n Element e_VisMag = ownerDoc.createElement(XML_ELEMENT_VISIBLEMAGNITUDE);\n Node n_VisMagText = ownerDoc.createTextNode(Float.toString(this.getVisibleMagnitude()));\n e_VisMag.appendChild(n_VisMagText);\n\n e_Target.appendChild(e_VisMag);\n }\n\n if (surfaceBrightness != null) {\n Element e_SurfBr = ownerDoc.createElement(XML_ELEMENT_SURFACEBRIGHTNESS);\n e_SurfBr = surfaceBrightness.setToXmlElement(e_SurfBr);\n\n e_Target.appendChild(e_SurfBr);\n }\n\n // If container element was created, add container here so that XML sequence\n // fits forward references\n // Calling the appendChild in the if avbe would cause the session container to\n // be located before\n // observers and sites container\n if (created) {\n ownerDoc.getDocumentElement().appendChild(e_Targets);\n }\n\n return e_Target;\n\n }", "LinkRelation createLinkRelation();", "@Test\n public void noteRef() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n builder.write(\"CrossReference: \");\n\n FieldNoteRef field = (FieldNoteRef)builder.insertField(FieldType.FIELD_NOTE_REF, false); // <--- don't update field\n field.setBookmarkName(\"CrossRefBookmark\");\n field.setInsertHyperlink(true);\n field.setInsertReferenceMark(true);\n field.setInsertRelativePosition(false);\n builder.writeln();\n\n builder.startBookmark(\"CrossRefBookmark\");\n builder.write(\"Hello world!\");\n builder.insertFootnote(FootnoteType.FOOTNOTE, \"Cross referenced footnote.\");\n builder.endBookmark(\"CrossRefBookmark\");\n builder.writeln();\n\n doc.updateFields();\n\n // This field works only in older versions of Microsoft Word.\n doc.save(getArtifactsDir() + \"Field.NOTEREF.doc\");\n //ExEnd\n\n doc = new Document(getArtifactsDir() + \"Field.NOTEREF.doc\");\n field = (FieldNoteRef)doc.getRange().getFields().get(0);\n\n TestUtil.verifyField(FieldType.FIELD_NOTE_REF, \" NOTEREF CrossRefBookmark \\\\h \\\\f\", \"1\", field);\n TestUtil.verifyFootnote(FootnoteType.FOOTNOTE, true, null, \"Cross referenced footnote.\",\n (Footnote)doc.getChild(NodeType.FOOTNOTE, 0, true));\n }", "public ReferenceHelper getReferenceHelper();", "public StringDt getNameReferenceElement() { \n\t\tif (myNameReference == null) {\n\t\t\tmyNameReference = new StringDt();\n\t\t}\n\t\treturn myNameReference;\n\t}", "public org.hl7.fhir.ResourceReference addNewDevice()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.ResourceReference target = null;\n target = (org.hl7.fhir.ResourceReference)get_store().add_element_user(DEVICE$12);\n return target;\n }\n }", "public PathElementIF createElement(String name);", "ComponentRefType createComponentRefType();", "private Doc(String documentElementName) {\n e = d.createElement(documentElementName);\n d.appendChild(e);\n }", "LINK createLINK();", "public void testCreateComponentReference() {\n System.out.println(\"createComponentReference\"); // NOI18N\n \n final DesignDocument document = ModelTestUtil.createTestDesignDocument(\"TEST_PROJECT\"); // NOI18N\n \n document.getTransactionManager().writeAccess(new Runnable() {\n public void run() {\n DesignComponent expResult = document.createComponent(FirstCD.TYPEID_CLASS);\n DesignComponent result = PropertyValue.createComponentReference(expResult).getComponent();\n assertEquals(expResult,result);\n }\n });\n }", "RESTElement createRESTElement();", "public DPropertyElement() {\n super(null, null);\n }", "public ReferenceType(Name name) {\n super(name.line, name.byteOffset);\n this.name = name;\n }", "@Override\r\n\tpublic ElectricityElement createElement() {\r\n\t\treturn new DefaultElectricityElement(\r\n\t\t\t\tgetTemplateName(), \r\n\t\t\t\tgetName(), \r\n\t\t\t\tgetOrigin(),\r\n\t\t\t\tgetDestination(),\r\n\t\t\t\tgetLifecycleModel().createLifecycleModel(), \r\n\t\t\t\tgetMaxElectricityProduction(), \r\n\t\t\t\tgetInitialElectricityProduction(), \r\n\t\t\t\tgetPetroleumIntensityOfElectricityProduction(),\r\n\t\t\t\tgetWaterIntensityOfElectricityProduction(), \r\n\t\t\t\tgetVariableOperationsCostOfElectricityProduction(),\r\n\t\t\t\tgetDistributionEfficiency(), \r\n\t\t\t\tgetMaxElectricityInput(), \r\n\t\t\t\tgetInitialElectricityInput(),\r\n\t\t\t\tgetVariableOperationsCostOfElectricityDistribution()\r\n\t\t\t);\r\n\t}", "LocalReference createLocalReference();", "protected abstract M createNewElement();", "HTMLElement createHTMLElement();", "public void addDTD(ResourceLocation dtd) throws BuildException {\n if (isReference()) {\n throw noChildrenAllowed();\n }\n\n getElements().addElement(dtd);\n setChecked(false);\n }", "OurIfcElement createOurIfcElement();", "public void addReference(Ant.Reference r) {\r\n references.addElement(r);\r\n }", "public SoftReference getReference ()\r\n {\r\n return _reference;\r\n }", "public RelationshipElement ()\n\t{\n\t\tthis(null, null);\n\t}", "protected TypeNode insertForwardedReferenceNode (TypeNode parent, String typeName) \n {\n TypeNode node = null;\n \n\t\tif ( typeName == null || typeName.trim().length() == 0 ) return null;\n\n // Same type may be forwarded ref MULTIPLE TIMES\n node = (TypeNode) _nodesHashtable.get(typeName);\n if (node != null) {\n // BUG !!! This FORWARD reference is already in tree since the caller\n // of this method ALREADY checked that this forward ref IS NOT in tree.\n \n TypeDescription meta = (TypeDescription) ((TypeNode)_nodesHashtable.get(typeName)).getObject();\n if ( meta != null ) {\n // Already defined\n node.setLabel(TypeSystemUtils2.getMyShortName(typeName)); // Use short name\n node.setObject(meta);\n _nodesHashtable.put (((TypeDescription)node.getObject()).getName(), node);\n Trace.err(\"??? BUG -- Already defined for \" + typeName);\n }\n } else {\n // NEW forwarded ref\n node = new TypeNode(parent, UimaToolsUtil.getMyShortName(typeName));\n node.setObjectType(IItemTypeConstants.ITEM_TYPE_TYPE); \n // Not yet defined (Forward reference)\n // Cannot use short name if no TypeDescription object (see TreeBaseNode.compare)\n // Trace.trace(\"Forward reference to \" + typeName);\n // _nodesHashtable.put (node.getLabel(), node);\n _nodesHashtable.put (typeName, node);\n \n // Add to undefined type hashtable\n // _undefinedTypesHashtable.put (node.getLabel(), node);\n _undefinedTypesHashtable.put (typeName, node);\n }\n \t\t\n\t\t// Insert \"node\" as child of \"parent\"\n\t\tTypeNode tempNode;\n\t\tif (parent == null) {\n\t\t if (_rootSuper == null) {\n\t\t _rootSuper = node;\n\t\t } else {\n\t\t\t\tif ( (tempNode = _rootSuper.insertChild(node)) != null ) {\n\t\t\t\t\tif (tempNode != node) {\t\t\t\t \n\t\t\t\t\t\t// Duplicate Label\n // Use full name as label\n\t\t\t\t\t\tTrace.trace(\" 1 Duplicate (short name) Label:\" + node.getLabel());\n//\t\t\t\t\t\tnode.setShowFullName(true);\n\t\t\t\t\t\tif (node.getObject() != null) {\n // Use full name as label\n\t\t\t\t\t\t\tnode.setLabel(((TypeDescription)node.getObject()).getName());\n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\t_rootSuper.insertChild(node);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t }\n\t\t} else {\n\t\t\t// parent.insertChild (node);\n\t\t\tif ( (tempNode = parent.insertChild(node)) != null && tempNode != node) {\n\t\t\t\t// Duplicate Label. Use full name as label.\n Trace.trace(\" 2 Duplicate (short name) Label:\" + node.getLabel());\n//\t\t\t\tnode.setShowFullName(true);\n\t\t\t\tif (node.getObject() != null) {\n // Use full name as label\n\t\t\t\t\tnode.setLabel(((TypeDescription)node.getObject()).getName());\n\t\t\t\t}\t\t\t\t\n\t\t\t\tparent.insertChild(node);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn node;\n\t}", "public ItemReference alloc();", "public Node getNode(Reference ref, Presentation presentation);", "public abstract Object create(ElementMapping elementMapping, ReadContext context);", "GroupRefType createGroupRefType();", "private static FieldNoteRef insertFieldNoteRef(DocumentBuilder builder, String bookmarkName, boolean insertHyperlink, boolean insertRelativePosition, boolean insertReferenceMark, String textBefore) throws Exception {\n builder.write(textBefore);\n\n FieldNoteRef field = (FieldNoteRef) builder.insertField(FieldType.FIELD_NOTE_REF, true);\n field.setBookmarkName(bookmarkName);\n field.setInsertHyperlink(insertHyperlink);\n field.setInsertRelativePosition(insertRelativePosition);\n field.setInsertReferenceMark(insertReferenceMark);\n builder.writeln();\n\n return field;\n }", "public Element buildDependencyDom4j(String domain, Long id,\n\t\tString href, String title)\n\t{\n\t\tElement dependency = DocumentHelper.createElement(\n\t\t\tqNameCache.get(\"dependency\", \n\t\t\tCatalogXmlBuilder.get().getNgNamespace())\n\t\t);\n\t\t\n\t\tdependency.addAttribute(\"category\", domain);\n\t\tdependency.addAttribute(\"id\", id.toString());\n\t\tdependency.addAttribute(\"href\", href);\n\t\tdependency.addAttribute(\"title\", title);\n\n\t\treturn dependency;\n\t}", "VarReference createVarReference();", "public Element createElement(String namespaceURI, String qualifiedName,\n Attributes attributes, Element parent);", "DsmlComponent createDsmlComponent();", "public void setReference(Reference ref)\n {\n this.ref = ref;\n }", "public org.hl7.fhir.ResourceReference addNewMember()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.ResourceReference target = null;\n target = (org.hl7.fhir.ResourceReference)get_store().add_element_user(MEMBER$14);\n return target;\n }\n }", "VarRef createVarRef();", "@Action( ACTION_CREATE_REFERENCE )\r\n public String doCreateReference( HttpServletRequest request )\r\n {\r\n populate( _reference, request, request.getLocale( ) );\r\n\r\n // Check form constraints\r\n if ( !validateBean( _reference, VALIDATION_ATTRIBUTES_PREFIX ) )\r\n {\r\n return redirectView( request, VIEW_CREATE_REFERENCE );\r\n }\r\n\r\n // Create Reference.\r\n ReferenceHome.create( _reference );\r\n\r\n // redirect to manage & add import result for users\r\n addInfo( I18nService.getLocalizedString( INFO_REFERENCE_CREATED, getLocale( ) ) );\r\n return redirectView( request, VIEW_MANAGE_REFERENCES );\r\n }", "private FieldRef insertFieldRef(final DocumentBuilder builder, final String bookmarkName,\n final String textBefore, final String textAfter) throws Exception {\n builder.write(textBefore);\n FieldRef field = (FieldRef) builder.insertField(FieldType.FIELD_REF, true);\n field.setBookmarkName(bookmarkName);\n builder.write(textAfter);\n return field;\n }", "public ReferenceType getTargetElement();", "<T extends ResourceReference> PhysicalWireDefinition generateResource(LogicalResourceReference<T> resourceReference) throws Fabric3Exception;", "E createDefaultElement();", "@Test\n public void sourceTextInReferenceTest() {\n final String transcription = \"This is a test moo\";\n final String expected = \"This is a test <a class=\\\"internal-ref\\\" href=\\\"javascript:;\\\" \" +\n \"data-targetid=\\\"https://example.com/col/book/page/canvas\\\" \" +\n \"data-label=\\\"test\\\" \" +\n \"data-manifestid=\\\"https://example.com/col/book/manifest\\\">moo</a>\";\n\n String result = adapter.addInternalRefs(fakeCollection, transcription, Collections.singletonList(weirdRef()));\n assertEquals(expected, result);\n }", "Object create(Element element) throws IOException, SAXException, ParserConfigurationException;", "public void entityReference(String name);", "public void setReference(String reference);", "public Content createPointReferenceContent(int timestart, ArrayList<Point3f> ref){\r\n\t\tList<Point3f> referencepoint = Mesh_Maker.createSphere(ref.get(0).x, ref.get(0).y, ref.get(0).z, 2, 12, 12);\r\n\t\tCustomTriangleMesh refmesh = new CustomTriangleMesh(referencepoint, new Color3f(1,0,0), 0.0f);\r\n\t\tContent refcont = ContentCreator.createContent(refmesh, \"referencePoint\", 0);\r\n\t\treturn refcont;\r\n\t}", "public static CdeDetails buildTestRecord()\n {\n CdeDetails cdeDetails = new CdeDetails();\n DataElement dataElement = new DataElement();\n cdeDetails.setDataElement( dataElement );\n\n DataElementDetails dataElementDetails = new DataElementDetails();\n dataElement.setDataElementDetails( dataElementDetails );\n\n dataElementDetails.setPublicId( 912345 );\n dataElementDetails.setVersion( 4.1F );\n dataElementDetails.setLongName( \"The Long Name\" );\n dataElementDetails.setShortName( \"The Short Name\" );\n dataElementDetails.setPreferredQuestionText( \"The preferred Question Text\" );\n dataElementDetails.setDefinition( \"The Definition\" );\n dataElementDetails.setValueDomain( \"The Value Domain\" );\n dataElementDetails.setDataElementConcept( \"The Data Element Concept\" );\n dataElementDetails.setContext( \"The Context\" );\n dataElementDetails.setWorkflowStatus( \"The Workflow Status\" );\n dataElementDetails.setOrigin( \"The Origin\" );\n dataElementDetails.setRegistrationStatus( \"The Registration Status\" );\n dataElementDetails.setDirectLink( \"The Direct Link\" );\n\n\n List<ReferenceDocument> referenceDocuments = new ArrayList<>();\n dataElement.setReferenceDocuments( referenceDocuments );\n // Add two sample referenceDocuments\n ReferenceDocument referenceDocument1 = new ReferenceDocument();\n referenceDocument1.setDocumentName( \"The Document Name 1\" );\n referenceDocument1.setDocumentType( \"The Document Type 1\" );\n referenceDocument1.setDocumentText( \"The Document Text 1\" );\n referenceDocument1.setContext( \"The Context 1\" );\n referenceDocument1.setUrl( \"The URL 1\" );\n referenceDocuments.add( referenceDocument1 );\n\n ReferenceDocument referenceDocument2 = new ReferenceDocument();\n referenceDocument2.setDocumentName( \"The Document Name 2\" );\n referenceDocument2.setDocumentType( \"The Document Type 2\" );\n referenceDocument2.setDocumentText( \"The Document Text 2\" );\n referenceDocument2.setContext( \"The Context 2\" );\n referenceDocument2.setUrl( \"The URL 2\" );\n referenceDocuments.add( referenceDocument2 );\n\n ReferenceDocument referenceDocument3 = new ReferenceDocument();\n referenceDocument3.setDocumentName( \"The Document Name 3\" );\n referenceDocument3.setDocumentType( \"The Document Type 3\" );\n referenceDocument3.setDocumentText( \"The Document Text 3\" );\n referenceDocument3.setContext( \"The Context 3\" );\n referenceDocument3.setUrl( \"The URL 3\" );\n referenceDocuments.add( referenceDocument3 );\n\n return cdeDetails;\n }", "public ClassReference(String descriptor) {\n\t\tthis(CharBuffer.wrap(descriptor));\n\t}", "@FactoryFunc\r\n\t@Function Element createElement(String tagName);", "Directive createDirective();", "void writeReference(Object obj);", "protected URIReferenceImpl makeRefImpl(URIReference ref) {\n return (ref instanceof URIReferenceImpl) ? (URIReferenceImpl)ref : new URIReferenceImpl(ref.getURI());\n }" ]
[ "0.6263534", "0.623306", "0.61893606", "0.6100221", "0.5878075", "0.5611229", "0.5593273", "0.5581461", "0.55532104", "0.55404025", "0.5534254", "0.5508568", "0.54117423", "0.53762126", "0.5370679", "0.53652287", "0.5362642", "0.5320613", "0.5315288", "0.53005785", "0.5283284", "0.5271972", "0.52609587", "0.5250239", "0.52457756", "0.5202103", "0.51519257", "0.5147504", "0.512433", "0.51234114", "0.5120607", "0.5089275", "0.5060967", "0.50386", "0.5025582", "0.50208163", "0.50191665", "0.5012433", "0.5011401", "0.5002012", "0.49953613", "0.49800733", "0.49644637", "0.49415916", "0.49314103", "0.49232876", "0.49178398", "0.49141148", "0.48979086", "0.48976958", "0.48915693", "0.48865557", "0.48760712", "0.48634186", "0.484893", "0.48339337", "0.48208228", "0.48137662", "0.4795746", "0.47625622", "0.4761368", "0.4756131", "0.47527248", "0.4741617", "0.47399884", "0.4733951", "0.47326228", "0.47318467", "0.47260454", "0.4723117", "0.4719222", "0.4711767", "0.4711608", "0.4706283", "0.47061855", "0.47014284", "0.46959886", "0.46950632", "0.46913594", "0.46879345", "0.4686384", "0.46649364", "0.46620014", "0.46550912", "0.46538964", "0.46469134", "0.46425617", "0.46424595", "0.46270093", "0.46266443", "0.4625174", "0.46188974", "0.4611517", "0.46089983", "0.46031705", "0.46020126", "0.45888177", "0.45869756", "0.45857018", "0.45850852" ]
0.58304965
5
Takes a SOAPElement and checks if it has the right name.
public DirectReference(SOAPElement element, boolean isBSP) throws XWSSecurityException { setSOAPElement(element); if (!(element.getLocalName().equals("Reference") && XMLUtil.inWsseNS(element))) { log.log(Level.SEVERE, "WSS0751.invalid.direct.reference", "{"+element.getNamespaceURI()+"}"+element.getLocalName()); throw new XWSSecurityException("Invalid DirectReference passed"); } if (isBSP && (getURI()==null)) { throw new XWSSecurityException("Violation of BSP R3062" + ": A wsse:Reference element in a SECURITY_TOKEN_REFERENCE MUST specify a URI attribute"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void checkElementNameUnique(Element element)\n {\n }", "private boolean checkStartElement(XMLEvent event, String elementName) {\n\t\tif (event.isStartElement()\n\t\t\t\t&& event.asStartElement().getName().getLocalPart()\n\t\t\t\t\t\t.toLowerCase().equals(elementName)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "String getElementName(Object element);", "public boolean containsElement(String elementName) {\r\n for (int i = 0; i < eventFields.size(); i++) {\r\n EventDataEntry currentEntry = eventFields.get(i);\r\n if (currentEntry.getColumnName().equalsIgnoreCase(elementName)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "public boolean filter(Element e) {\n\t\t\t\tif(e.getRepresentedBy() instanceof AttributeElement) {\r\n\t\t\t\t\treturn ((AttributeElement) e.getRepresentedBy())\r\n\t\t\t\t\t\t.getRepresents().getName().equals(\"name\"); \r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}", "String getNameElement();", "@Override\n\tpublic boolean estaElemento(String elemento) {\n\t\treturn false;\n\t}", "public static boolean isElement(String qName, String expectedElement) {\n return qName.equals(expectedElement);\n }", "abstract boolean hasXMLProperty(XMLName name);", "public boolean hasElement(String name) {\n return elements.has(name);\n }", "public static boolean isValidXmlElementName(String name) {\n return REGEX_VALID_XML_ELEMENT_NAME.matcher(name).matches();\n }", "String getElementQName(Object element);", "private static final void assertName(final WadlElementName name, final XMLStreamReader reader) {\n if (!match(name, reader)) {\n throw new AssertionError(reader.getLocalName());\n }\n }", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "public static boolean isElement(Element elem, String namespaceURI, String name) {\n if (elem.getNamespaceURI().equals(namespaceURI) && elem.getLocalName().equals(name)) {\n return true;\n }\n return false;\n }", "private boolean checkEndElement(XMLEvent event, String elementName) {\n\t\tif (event.isEndElement()\n\t\t\t\t&& event.asEndElement().getName().getLocalPart().toLowerCase()\n\t\t\t\t\t\t.equals(elementName)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "boolean hasElement();", "boolean isElement(Object object);", "public abstract boolean doesElementExist(final String key, final String element);", "public SC getElementName() { return _elementName; }", "public boolean find(String sElement){\n\t\tboolean bReturn = false;\n\t\ttry{\n\t\t\tbReturn = findElement(sElement).isDisplayed();\n\t\t}catch(Exception e){\n\t\t\tlogger.error(\"Exception occured in finding the WebElement: \"+e.getMessage());\n\t\t}\n\t\t\n\t\treturn bReturn;\n\t}", "public boolean isElementPresent(final String elementLocator);", "public static void checkNoSuchElementExceptionByName(String name, String element) {\r\n\t\ttry {\r\n\t\t\tdriver.findElement(By.name(name));\r\n\t\t}\r\n\t\tcatch (NoSuchElementException e) {\r\n\t\t\tSystem.out.println(\"No Such Element Exception: \");\r\n\t\t\tSystem.out.println(\"Web element \" + element + \" \\\"name: \" + name + \"\\\" doesn't exist\");\r\n\t\t}\r\n\t}", "WebElement getNameField();", "Object getElementID(String elementName) throws Exception;", "public void setElementalName(String name) {\n\t\telementalName = name;\n \t}", "public static boolean canBeSelfClosedElement(String name)\n {\n return !ELEMENTS_NO_SELF_CLOSE_LIST.contains(name.toLowerCase());\n }", "public boolean isNamed(String n) {\n return name.equals(n);\n }", "@Override\n\tpublic String getElementName() {\n\t\treturn null;\n\t}", "Boolean symbolValication( String nameCamel , String symbolCamel ) {\t\n\t\tif ( symbolCamel.length( ) != 2 ) return false;\t\t\t\t// invalid length of the symbol, avoids exception\n\t\tint l = nameCamel.length( );\n\t\tString name = nameCamel.toLowerCase( );\t\t\t\t\t\t// all letters to lower case\n\t\tString symbol = symbolCamel.toLowerCase( );\t\t\t\t\t// all letters to lower case\n\t\tint positionOfTheFirstEqual;\n\t\t// if the first character of the symbol is equal to one of the first (length-1) characters of the element name\n\t\treturn ( positionOfTheFirstEqual = name.substring( 0 , l - 1 ).indexOf( symbol.charAt( 0 ) ) ) >= 0 &&\n\t\t// and the second character of the symbol is equal to one of remaining characters of the element name\n\t\t\t\tname.substring( positionOfTheFirstEqual + 1 , l ).contains( Character.toString( symbol.charAt( 1 ) ) );\n\t}", "public boolean hasAttribute(String name)\n/* */ {\n/* 1234 */ return findAttribute(name) != null;\n/* */ }", "public boolean containAttribute(String name);", "public boolean isSetName()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().find_attribute_user(NAME$2) != null;\r\n }\r\n }", "public boolean isElementPresent(WebElement elementName, int timeout){\n //https://github.com/appium/java-client/issues/617\n\t/*try{\n\t WebDriverWait wait = new WebDriverWait(getDriver(), timeout);\n\t wait.until(ExpectedConditions.visibilityOf(elementName));\n\t return true;\n\t}catch(Exception e){\n\t return false;\n\t}*/\n try{\n int counter = 0;\n while(counter < timeout){\n Thread.sleep(1000);\n counter++;\n try{\n if(elementName.isDisplayed()){\n //if(ExpectedConditions.visibilityOf(elementName) !=null ){\n return true;\n }else{\n continue;\n }\n }catch(Exception e){\n continue;\n }\n }\n System.out.println(\"ELEMENT NOT FOUND - \" + elementName + \" AFTER \" + timeout );\n return false;\n }catch(Exception e){\n return false;\n }\n }", "public boolean elementDirect(Element elem) {\r\n\r\n boolean test = false;\r\n\r\n for (int i = 0; i < element.size(); i++) {\r\n if (element.get(i).getNom().equals(elem.getNom())) {\r\n test = true;\r\n }\r\n }\r\n return test;\r\n }", "private void expectName(String namespace, String name)\n\t\t\tthrows XmpUnexpectedElementQualifiedNameException {\n\t\tif (!reader.get().getNamespaceURI().equals(namespace)) {\n\t\t\tthrow new XmpUnexpectedElementQualifiedNameException(\"Expected '\"\n\t\t\t\t\t+ namespace + \"' and found '\"\n\t\t\t\t\t+ reader.get().getNamespaceURI() + \"'\");\n\t\t}\n\t\tif (!reader.get().getLocalName().equals(name)) {\n\t\t\tthrow new XmpUnexpectedElementQualifiedNameException(\"Expected '\"\n\t\t\t\t\t+ name + \"' and found '\" + reader.get().getLocalName()\n\t\t\t\t\t+ \"'\");\n\t\t}\n\t}", "public static Element exists( String name, SerializationPosition state) {\n NodeList elementsByTagName = SiteMapGenerator.doc.getElementsByTagName(\"directory\");\n for(int i=0;i<elementsByTagName.getLength();i++){\n \n org.w3c.dom.Node item = elementsByTagName.item(i);\n String toString = item.toString();\n \n NamedNodeMap attributes = item.getAttributes();\n org.w3c.dom.Node namedItem = attributes.getNamedItem(\"name\");\n String nodeValue = namedItem.getNodeValue();\n ////System.out.println(\"nname: \"+nodeValue);\n if(nodeValue.equalsIgnoreCase(state.currPos.toString())){\n return serialize(state);\n //return (Element)item;\n }\n }\n return null;\n \n }", "private boolean isElementPresent(By cssSelector) {\n\treturn false;\n}", "public void setElementName(String elementName) {\r\n this.elementName = elementName;\r\n }", "public boolean equals(Element t)\r\n\t{\r\n\t\tif (name.equals(t.getName()))\r\n\t\t{\r\n\t\t\tif (type.equals(t.getType()))\r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "boolean isNameRequired();", "public static boolean checkElement(Element element) \n\t{\n\t\treturn LIST_OF_ELEMENT.containsValue(element);\n\t}", "public void setElementNameForHibernate(SC elementName) {\n _elementName = elementName;\n }", "public void validate_table_names(WebElement element , String class_name , String table_element)\n\t{\n\t\t//XLS data.\n\t\tString ui_col_names = element.getText();\n\t\tlogger.info(\"Actual table columns from UI: \"+ui_col_names);\n\t\t//UI Element data.\n\t\tString xls_table_name = ExcelCache.getExpectedData(class_name , table_element);\n\t\tlogger.info(\"Expected table columns from excel: \"+xls_table_name);\n\t\t//Comparing String.\n\t\tVerify.verifyEquals(ui_col_names, xls_table_name , \"Table Names are different\");\n\t}", "public static void isPupupPreasent(WebElement ele ,String objectName) {\n if (ele.isDisplayed())\n\t{System.out.println(ele +\"Is displayed in he screen\");}\n else \n\t{System.out.println(ele+\"not found in the Screen\");}\n\n\n}", "@Override\r\n\tpublic boolean getElemento(T elemento) {\n\t\treturn false;\r\n\t}", "org.apache.xmlbeans.XmlString xgetName();", "org.apache.xmlbeans.XmlString xgetName();", "public void setElementName(String elementName) {\n this.elementName = elementName;\n }", "private static boolean isSuitableElement(Element element) {\n \n \t\tif (element instanceof ElementCSSInlineStyle\n \t\t\t\t&& isAttributeAvailable(element, STYLE_TAG_NAME)) {\n \t\t\treturn true;\n \t\t}\n \n \t\treturn false;\n \t}", "@Test\n\tpublic void testGuardRenaming() throws Exception {\n\t\ttestRenaming(IGuard.ELEMENT_TYPE);\n\t}", "public void testGetName()\n\t{\t\n\t\t((TypeDefinitionImpl)fTypeDefinition).setName(new QName(\"tdName\"));\n\t\tassertEquals(\"The TypeDefinition name QName differs from that set-\", \"tdName\", fTypeDefinition.getName().toString());\n\t}", "public boolean isSetName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(NAME$8) != 0;\n }\n }", "boolean isSetName();", "public void setElementName(String elementName) {\r\n\t\tthis.elementName = elementName;\r\n\t}", "public void setElementName(String elementName) {\r\n\t\tthis.elementName = elementName;\r\n\t}", "public static boolean hasName(FrameAbstract pRF, String pName)\n\t{\n\t\treturn pRF.getNameList().contains(pName);\n\t}", "public boolean isSetName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(NAME$0) != 0;\n }\n }", "public boolean isSetName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(NAME$0) != 0;\n }\n }", "protected boolean isValidElement(Object element) {\r\n\t\treturn element instanceof IRubyProject || element instanceof ISourceFolderRoot;\r\n\t}", "static boolean EQName(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"EQName\")) return false;\n if (!nextTokenIs(b, \"\", NCNAME, URIQUALIFIEDNAME)) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = QName(b, l + 1);\n if (!r) r = consumeToken(b, URIQUALIFIEDNAME);\n exit_section_(b, m, null, r);\n return r;\n }", "public static boolean ElementNameOrWildcard(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"ElementNameOrWildcard\")) return false;\n boolean r;\n Marker m = enter_section_(b, l, _NONE_, ELEMENT_NAME_OR_WILDCARD, \"<element name or wildcard>\");\n r = ElementName(b, l + 1);\n if (!r) r = consumeToken(b, STAR_SIGN);\n exit_section_(b, l, m, r, false, null);\n return r;\n }", "private boolean checkShippingElementExist(WebElement article) {\n\t\ttry {\n\t\t\tarticle.findElement(By.xpath(\"ul/li[@class='lvshipping']//span[@class='fee']\"));\n\t\t\treturn true;\n\t\t} catch (Exception e) {\n\t\t\treturn false;\n\t\t}\n\t}", "public boolean isSetName()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().count_elements(NAME$0) != 0;\r\n }\r\n }", "String getElementNameById(Integer elementId);", "public static boolean elementAvailiable(String s) { // Check if page contains\n\t\tboolean available=false; \n\t\ttry {\n\t\t\tif(driver.getPageSource().contains(s)){\n\t\t\t\tavailable=true;\n\t\t\t}\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t\treturn available; \n\t}", "public boolean checkName(String name)\n {\n return true;\n }", "private boolean isNameValid(String name) {\n\n }", "boolean hasSetAttribute();", "@org.junit.Test\n public void compElemBadName1() {\n final XQuery query = new XQuery(\n \"element {\\\"xmlns:error\\\"} {}\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n error(\"XQDY0096\")\n );\n }", "public boolean filter(Element e) {\n\t\t\t\tif(e.getRepresentedBy() instanceof ClassElement) {\r\n\t\t\t\t\treturn ((ClassElement) e.getRepresentedBy())\r\n\t\t\t\t\t\t.getRepresents().getName().equals(\"Person\"); \r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}", "IFMLNamedElement createIFMLNamedElement();", "public void assertElementPresent(final String elementLocator);", "public static Element contains(final Element root, final String name){\n return contains(root, name, -1);\n }", "String getElementStringValue(Object element);", "protected boolean isElementPresent(By element) {\n\t\t \n if (driver.findElements(element).isEmpty()) {\n \treturn false;\n } else {\n \treturn true;\n }\n }", "public static boolean libraryNameElement(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"libraryNameElement\")) return false;\n boolean r;\n Marker m = enter_section_(b, l, _NONE_, LIBRARY_NAME_ELEMENT, \"<library name element>\");\n r = nonStrictID(b, l + 1);\n r = r && libraryNameElement_1(b, l + 1);\n exit_section_(b, l, m, r, false, null);\n return r;\n }", "public static boolean isWithinElement(String qName,\n String expectedElement, Stack<String> parentStack, String expectedParent) {\n return qName.equals(expectedElement) && \n (expectedParent==null || !parentStack.isEmpty() && expectedParent.equals(parentStack.peek()));\n }", "boolean hasDataName();" ]
[ "0.72180104", "0.6450968", "0.63667864", "0.6303566", "0.6249269", "0.6245537", "0.61869454", "0.6156056", "0.6126633", "0.60117674", "0.59277976", "0.59131503", "0.5894746", "0.58231795", "0.58231795", "0.58231795", "0.58231795", "0.58231795", "0.58231795", "0.58231795", "0.58231795", "0.58231795", "0.58231795", "0.58231795", "0.58231795", "0.58231795", "0.58231795", "0.58231795", "0.58231795", "0.58231795", "0.58231795", "0.58231795", "0.58231795", "0.58231795", "0.58231795", "0.58231795", "0.5817261", "0.57693535", "0.5711995", "0.5691744", "0.567489", "0.56192255", "0.56059134", "0.55873156", "0.5575602", "0.55716044", "0.556783", "0.55570424", "0.5554621", "0.5550899", "0.55340266", "0.5527054", "0.5516763", "0.5486982", "0.54744583", "0.54557043", "0.54388535", "0.5430441", "0.54184484", "0.5417696", "0.54174405", "0.54073775", "0.54014903", "0.5398265", "0.5396948", "0.5393163", "0.5393096", "0.5390961", "0.53762776", "0.53762776", "0.53734607", "0.5344203", "0.5331322", "0.53300524", "0.53176033", "0.53173167", "0.530509", "0.530509", "0.5294562", "0.528974", "0.528974", "0.52830845", "0.5281382", "0.5278677", "0.5271209", "0.52590173", "0.5258623", "0.5255047", "0.5252839", "0.5244871", "0.52415234", "0.52408665", "0.5234881", "0.5232938", "0.52210855", "0.5220024", "0.5219636", "0.52118695", "0.5202434", "0.5198294", "0.5189258" ]
0.0
-1
If this attr is not present, returns null.
public String getValueType() { String valueType = getAttribute("ValueType"); if (valueType.equals("")) return null; return valueType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic Object getAttrVal(String attrName) {\n\t\treturn null;\n\t}", "public String getNullAttribute();", "@Override\r\n\tpublic String getAttribute() {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic Object getAttribute(String arg0, int arg1) {\n\t\treturn null;\n\t}", "@Override\n\t\tpublic Object getAttribute(String name) {\n\t\t\treturn null;\n\t\t}", "@Override\n\t\tpublic Object getAttribute(String name) {\n\t\t\treturn null;\n\t\t}", "@Override\n\tpublic Object getAttribute(String name) {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic Object getAttribute(String name) {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic <E> Attr<E> find(String attrName) {\n\t\treturn null;\n\t}", "@NonNull\n String getNecessaryAttribute();", "private static String getAttribute(Node node, String attr) {\r\n if( node != null )\r\n if( node.getAttributes() != null )\r\n if( node.getAttributes().getNamedItem(attr) != null )\r\n return node.getAttributes().getNamedItem(attr).getNodeValue();\r\n \r\n return null;\r\n }", "java.lang.String getAttribute();", "@Override\r\n\t\tpublic Attr getAttributeNode(String name)\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}", "private boolean isAttributeDefined(String attrName)\n {\n return getAttributes().get(attrName) != null;\n }", "protected String getAttribute(String chave) throws AtributosException {\r\n\t\tif (tag == null) {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\r\n\t\tString attributeValue = tag.getAttributeValue(chave);\r\n\r\n\t\tif (attributeValue == null || attributeValue.trim().equals(\"\")) {\r\n\t\t\tattributeValue = getDefaultValue(chave);\r\n\t\t}\r\n\r\n\t\treturn attributeValue;\r\n\t}", "Attribute getAttribute();", "final private com.org.multigear.mginterface.engine.Configuration.Attr getAttr(final String name) {\r\n\t\tfor(final Attr attr : mAttributes) {\r\n\t\t\tif(attr.Name.equals(name))\r\n\t\t\t\treturn attr;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public String getAttr() {\n return attr;\n }", "@Override\n\tpublic String stringValue(final Attribute att) {\n\t\treturn null;\n\t}", "protected String getAttributeStr(String attr)\n {\n Object res = getAttributes().get(attr);\n return (res != null) ? res.toString() : null;\n }", "@Override\n\tpublic Instances relationalValue(final Attribute att) {\n\t\treturn null;\n\t}", "String getAttribute();", "@Override\r\n\t\tpublic NamedNodeMap getAttributes()\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}", "@Override\n\tpublic Attribute getIdAttribute() {\n\t\treturn null;\n\t}", "@Override\n\tpublic <E> Attr<E> remove(String attrName) {\n\t\treturn null;\n\t}", "@Override\r\n\t\tpublic boolean hasAttribute(String name)\r\n\t\t\t{\n\t\t\t\treturn false;\r\n\t\t\t}", "@Override\n\tpublic Object readAttribute(URI resource, String attrName)\n\t\t\tthrows StorageSecuirtyException, ResourceAccessException {\n\t\treturn null;\n\t}", "@Override\n\tpublic boolean isMissing(final Attribute att) {\n\t\treturn false;\n\t}", "Attribute processAttribute( final Attribute attribute )\r\n {\r\n final String name = attribute.getName();\r\n final int length = name.length();\r\n final int index = name.indexOf( \".\" );\r\n if( -1 == index || 0 == index || length - 1 == index )\r\n {\r\n return null;\r\n }\r\n else\r\n {\r\n return attribute;\r\n }\r\n }", "private XMLAttribute findAttribute(String fullName)\n/* */ {\n/* 685 */ Enumeration<XMLAttribute> en = this.attributes.elements();\n/* 686 */ while (en.hasMoreElements()) {\n/* 687 */ XMLAttribute attr = (XMLAttribute)en.nextElement();\n/* 688 */ if (attr.getName().equals(fullName)) {\n/* 689 */ return attr;\n/* */ }\n/* */ }\n/* 692 */ return null;\n/* */ }", "public org.omg.uml.foundation.core.Attribute getAttribute();", "public final boolean hasAttribute ()\r\n {\r\n return _value.hasAttribute();\r\n }", "public boolean hasAttribute(String name)\n/* */ {\n/* 1234 */ return findAttribute(name) != null;\n/* */ }", "public tudresden.ocl20.core.jmi.ocl.commonmodel.Attribute lookupAttribute(java.lang.String attName) {\n Iterator featuresIt = getFeature().iterator();\n while(featuresIt.hasNext()){\n Feature feature = (Feature) featuresIt.next();\n if(feature instanceof Attribute && feature.getNameA().equals(attName)){\n return (Attribute) feature;\n }\n }\n Iterator parentsIt = this.getParents().iterator();//getGeneralization().iterator();\n while(parentsIt.hasNext()){\n Classifier parent = (Classifier) parentsIt.next();//((GeneralizationImpl) parentsIt.next()).getParent();\n Attribute a = (Attribute) parent.lookupAttribute(attName);\n if(a != null){\n return a;\n }\n }\n \n return null;\n }", "@Override\n\tpublic String toString(final Attribute att) {\n\t\treturn null;\n\t}", "@Override\n\t\tprotected String getValueAsString() {\n\t\t\tAttr attr = element.getAttributeNodeNS(namespaceURI, localName);\n\t\t\tif (attr == null) {\n\t\t\t\treturn defaultValue;\n\t\t\t}\n\t\t\treturn attr.getValue();\n\t\t}", "@Nullable\r\n public Object get(String key) {\r\n if (attributeMap.containsKey(key)) {\r\n return attributeMap.get(key);\r\n } else if (parent.isPresent()) {\r\n return parent.get().get(key);\r\n } else {\r\n return null;\r\n }\r\n }", "public Attributes getAttributes() {\n\t\treturn null;\r\n\t}", "public java.lang.String getAttributeValue() {\r\n return localAttributeValue;\r\n }", "public String espaceAttribut(final Element refAttribut) {\n return(null);\n }", "public java.lang.Object getCachedAttributeValue(Symbol attrName, java.lang.Object defaultValue);", "@Override\r\n\t\tpublic Attr removeAttributeNode(Attr oldAttr) throws DOMException\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}", "public AttrObject(){\t\r\n\tvalue = null;\r\n }", "public Object getAttribute(Object key) {\n\t\treturn getAttribute(key, null);\n\t}", "public <T> T get(Object key) {\n if(attributes == null)\n return null;\n Object value = attributes.get(key);\n return value == null ? null : (T) value;\n }", "@Override\n \tpublic EStructuralFeature getAttribute(EClass eClass, String namespace, String name) {\n \t\treturn null;\n \t}", "@Override\n\t\tpublic Object removeAttribute(String name) {\n\t\t\treturn null;\n\t\t}", "protected ProbeValue getAttribute(String name) {\n if (values != null) {\n return values.get(name);\n } else {\n return null;\n }\n }", "java.lang.String getAttributesOrDefault(java.lang.String key, java.lang.String defaultValue);", "default Attribute getAttribute(AttributeName attributeName) {return (Attribute) attributeName;}", "private String getAttribute(IConfigurationElement elem, String tag) {\n\t\tString res= elem.getAttribute(tag);\n\t\tif (res == null) {\n\t\t\treturn '!' + tag + '!';\n\t\t}\n\t\treturn res;\n\t}", "String getAttributeStringValue(Object attr);", "@Override\r\n\t\tpublic boolean hasAttributes()\r\n\t\t\t{\n\t\t\t\treturn false;\r\n\t\t\t}", "Object getAttribute(String name);", "Object getAttribute(String name);", "Object getAttribute(String name);", "private Object expect(String attribute) {\n\t\treturn null;\n\t}", "public Attr() {\n\t\t\tsuper();\n\t\t}", "@NonNull\n String getOptionalAttribute(final int field);", "Object getAttribute(String key);", "Object getAttribute(String key);", "private void checkAttributes() throws JellyTagException\n {\n if (getField() == null)\n {\n throw new MissingAttributeException(\"field\");\n }\n if (getVar() == null)\n {\n if (!(getParent() instanceof ValueSupport))\n {\n throw new JellyTagException(\n \"No target for the resolved value: \"\n + \"Specify the var attribute or place the tag \"\n + \"in the body of a ValueSupport tag.\");\n }\n }\n }", "Object getAttribute( String attrName ) throws FileSystemException;", "private String getNamedAttributeFromMap( NamedNodeMap map, String attrName ) {\n String s = map.getNamedItem( attrName ) == null ? null : map.getNamedItem( attrName ).getNodeValue();\n return s;\n }", "public AttributeSet getAttributes() {\n return null;\n }", "@Override\n\tpublic void setMissing(final Attribute att) {\n\n\t}", "@Override\r\n\tpublic Map<String, Object> getAttributes() {\n\t\treturn null;\r\n\t}", "public synchronized Object getAttribute(String key, Object defaultObject) {\n Object value = attributes.get(key);\n if (value == null) value = defaultObject;\n return value;\n }", "Pair<String, String> getAdditionalAttribute();", "public final String attributeNameRef ()\r\n {\r\n return _value.xmlTreePath().attribute();\r\n }", "@Override\n\tpublic byte[] getValue() throws AttributeValueException {\n\t\treturn null;\n\t}", "public <T> T get(Object key, T nullValue) {\n T attribute = get(key);\n return attribute == null ? nullValue : attribute;\n }", "public String getAttrVal() {\n return attrVal;\n }", "@java.lang.Override\n public boolean hasAttributes() {\n return attributes_ != null;\n }", "boolean isAttribute();", "@Override\r\n\t\tpublic Attr getAttributeNodeNS(String namespaceURI, String localName) throws DOMException\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}", "public String getModelXMLAttribute(String attrib_name) {\n\t\tassert attrib_name != null;\n\n\t\tif (modelnode != null) {\n\t\t\treturn getNodeAttributeValue(modelnode, attrib_name);\n\t\t}\n\t\treturn null;\n\t}", "@Override\n\tpublic AttributeSet getAttributes() {\n\t\treturn null;\n\t}", "@Override\n protected void onNullNonKeyAttribute(String attributeName) {\n /* When doing a force put, we can safely ignore the null-valued attributes. */\n return;\n }", "public VAttribute getNonmutableAttribute(String name) throws VlException\n {\n // by prefix values with \"\", a NULL value will be convert to \"NULL\".\n if (name.compareTo(ATTR_TYPE) == 0)\n return new VAttribute(name, \"\"+getType());\n else if (name.compareTo(ATTR_LOCATION) == 0)\n return new VAttribute(name, getVRL()); \n else if (name.compareTo(ATTR_NAME) == 0)\n return new VAttribute(name, \"\"+getName());\n else if (name.compareTo(ATTR_HOSTNAME) == 0)\n return new VAttribute(name, getHostname());\n // only return port attribute if it has a meaningful value \n else if (name.compareTo(ATTR_PORT) == 0)\n return new VAttribute(name,getPort());\n else if (name.compareTo(ATTR_ICONURL) == 0)\n return new VAttribute(name, getIconURL());\n else if (name.compareTo(ATTR_SCHEME) == 0)\n return new VAttribute(name, getScheme());\n else if (name.compareTo(ATTR_PATH) == 0)\n return new VAttribute(name, getPath());\n else if ( (name.compareTo(ATTR_URI_QUERY) == 0) && getLocation().hasQuery() )\n return new VAttribute(name, getQuery());\n else if ( (name.compareTo(ATTR_URI_FRAGMENT) == 0) && getLocation().hasFragment() )\n return new VAttribute(name, getLocation().getFragment());\n else if (name.compareTo(ATTR_NAME) == 0) \n return new VAttribute(name, getName());\n else if (name.compareTo(ATTR_LOCATION) == 0)\n return new VAttribute(name, getLocation().toString());\n else if (name.compareTo(ATTR_MIMETYPE) == 0)\n return new VAttribute(name, getMimeType());\n else if (name.compareTo(ATTR_ISVLINK) == 0)\n return new VAttribute(name, getLocation().isVLink());\n else if (name.compareTo(ATTR_CHARSET) == 0)\n return new VAttribute(name, getCharSet());\n \n return null; \n }", "@Override\n\tpublic Map<String, Object> getAttributeMap() {\n\t\treturn null;\n\t}", "@Override\n\tpublic String[] getAttrNames() {\n\t\treturn null;\n\t}", "public String getAttribute(String name)\n\tthrows SdpParseException {\n\tif (name != null) {\n\t for (int i = 0; i < this.attributeFields.size(); i++) {\n\t\tAttributeField af = (AttributeField)\n\t\t this.attributeFields.elementAt(i);\n\t\tif (name.equals(af.getAttribute().getName())) \n\t\t return (String) af.getAttribute().getValue();\n\t }\n\t return null; \n\t} else throw new NullPointerException(\"null arg!\");\n }", "public boolean hasAttribute(String name) {\n // if attribute() returns a value, then this jode has that attribute\n return attribute(name, true) != null;\n }", "public boolean isAttribute() {\n\t\treturn false;\n\t}", "public String getATTR_ID() {\n return ATTR_ID;\n }", "protected static final String m2869c(XmlPullParser xmlPullParser, String str) {\n String attributeValue = xmlPullParser.getAttributeValue(null, str);\n if (attributeValue != null) {\n return attributeValue;\n }\n throw new bdc(str);\n }", "@Kroll.getProperty @Kroll.method\n\tpublic boolean getSpecified() {\n\t\tif (attr.getOwnerElement() == null) {\n\t\t\treturn true;\n\t\t}\n\t\treturn attr.getSpecified();\n\t}", "public static String getAttribute(Element elem, String key, String dft, boolean resolveRT)\n {\n String rtn = dft;\n if ((elem != null) && !StringTools.isBlank(key) && elem.hasAttribute(key)) {\n String val = elem.getAttribute(key); // never returns null\n if (val != null) { // but check anyway\n rtn = val;\n }\n }\n if (resolveRT) {\n // resolve runtime property variables\n return RTConfig.insertKeyValues(rtn);\n } else {\n // as-is\n return rtn;\n }\n }", "public Integer getAttrId() {\n return attrId;\n }", "@Override\n\tpublic Instances relationalValue(final int attIndex) {\n\t\treturn null;\n\t}", "public String getAttributeName() {\n/* 85 */ return this.attributeName;\n/* */ }", "private String getStringAttr(String attrName)\n {\n return String.valueOf(getAttributes().get(attrName));\n }", "private String getAttributeValue() {\n\t\tString attributes = \"\";\r\n\t\tfor(int i=0;i< JTable1.getRowCount();i++ ) {\r\n\t\t\tString attributename = ((String) JTable1.getValueAt(i, 0)).trim();\r\n\t\t\tString attributeValue = ((String) JTable1.getValueAt(i, 1)).trim();\r\n\t\t\t//attributeValue.trim();\r\n\t\t\tif(attributeValue != null && attributeValue.length() > 0)\r\n\t\t\tattributes = attributes.trim() + attributename+ \"=\" + attributeValue + \";\";\r\n\t\t\t\r\n\t\t}\r\n\t\tif(attributes.trim().length() > 0)\r\n\t\treturn attributes.substring(0, attributes.length()-1);\r\n\t\treturn attributes;\r\n\t}", "@Override\r\n\t\tpublic String getAttributeNS(String namespaceURI, String localName) throws DOMException\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}", "public String getAttributeValueByName(String name) {\n\t\tif(attributes!=null) {\n\t\t\treturn attributes.get(name);\n\t\t}\n\t\treturn null;\n\t}", "@Override\n public boolean isAttribute()\n {\n return attribute;\n }", "boolean hasAttribute(String name);", "private static boolean isAttributeAvailable(Element element, String attrName) {\n \t\tModelQuery modelQuery = ModelQueryUtil.getModelQuery(element\n \t\t\t\t.getOwnerDocument());\n \t\tif (modelQuery != null) {\n \t\t\tCMElementDeclaration decl = modelQuery\n \t\t\t\t\t.getCMElementDeclaration(element);\n \t\t\tif (decl != null) {\n \t\t\t\tCMNamedNodeMap map = decl.getAttributes();\n \t\t\t\tif ((CMAttributeDeclaration) map.getNamedItem(attrName) != null) {\n \t\t\t\t\treturn true;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \n \t\treturn false;\n \t}", "Object getAttribute(int attribute);", "public static String getAttribute( HttpServletRequest request, String attribName, boolean emptyStringsOK ) {\n String temp = (String)request.getAttribute(attribName);\n if( temp != null ) {\n if( temp.equals(\"\") && !emptyStringsOK ) {\n return null;\n }\n else {\n return temp;\n }\n }\n else {\n return null;\n }\n }" ]
[ "0.7389904", "0.72553945", "0.72295153", "0.71118677", "0.68567216", "0.68567216", "0.6792535", "0.6785769", "0.6729764", "0.656864", "0.65611", "0.6445195", "0.6443354", "0.64113796", "0.6270208", "0.6189598", "0.6178563", "0.6083287", "0.6068588", "0.606431", "0.60518885", "0.6035536", "0.60087746", "0.6005656", "0.5959525", "0.59379125", "0.591748", "0.5899539", "0.5897251", "0.5892071", "0.5890752", "0.5873276", "0.58341193", "0.58128464", "0.58027196", "0.576735", "0.575408", "0.5742335", "0.57362", "0.57234323", "0.57203245", "0.5717803", "0.5692943", "0.56918615", "0.5676895", "0.56762797", "0.56703544", "0.5667768", "0.5661562", "0.5660164", "0.5652774", "0.56366265", "0.5625896", "0.561928", "0.561928", "0.561928", "0.5598198", "0.55933475", "0.5591204", "0.5590907", "0.5590907", "0.55739534", "0.55720806", "0.55717677", "0.5543109", "0.55353796", "0.55345607", "0.55342966", "0.55274725", "0.5524291", "0.55223197", "0.55193824", "0.55085343", "0.5502709", "0.54835063", "0.5482332", "0.54809636", "0.54806197", "0.5479205", "0.547484", "0.5474338", "0.5470176", "0.546681", "0.54590523", "0.5451831", "0.5451709", "0.54409164", "0.54391", "0.5437855", "0.54324466", "0.54324347", "0.5432006", "0.54242", "0.5421851", "0.5416262", "0.54121315", "0.54111016", "0.54086125", "0.540515", "0.54013175", "0.53979903" ]
0.0
-1
Created by Mayokun on 4/9/2017.
public interface MovieListener { void onMovieClicked(int position); void onFinished(List<Movie> movieList); void onFailed(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "public final void mo51373a() {\n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "private void m50366E() {\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "public void mo38117a() {\n }", "public void mo4359a() {\n }", "protected boolean func_70814_o() { return true; }", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "private static void cajas() {\n\t\t\n\t}", "private void poetries() {\n\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "private void kk12() {\n\n\t}", "private void init() {\n\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n public void init() {\n }", "public void m23075a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "public void mo21779D() {\n }", "@Override\n protected void initialize() {\n\n \n }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n public int describeContents() { return 0; }", "public void mo21877s() {\n }", "@Override\n void init() {\n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "public void mo6081a() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "private Rekenhulp()\n\t{\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "public void mo12628c() {\n }", "@Override\n public void init() {}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "public void mo12930a() {\n }", "private void m50367F() {\n }", "private void strin() {\n\n\t}", "@Override\n protected void init() {\n }", "@Override\r\n\tpublic void init() {}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "public final void mo91715d() {\n }", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n\tpublic void init() {\n\t}", "public void mo21878t() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "public abstract void mo70713b();", "@Override\n\tpublic void one() {\n\t\t\n\t}", "public void mo21785J() {\n }", "public void method_4270() {}", "@Override\n\tpublic void init()\n\t{\n\n\t}", "public void mo21825b() {\n }", "public void mo55254a() {\n }", "public void mo115190b() {\n }" ]
[ "0.60195446", "0.60018814", "0.5883369", "0.5828324", "0.581049", "0.57977515", "0.5780912", "0.5740692", "0.569805", "0.56941473", "0.5689854", "0.5689854", "0.56747395", "0.5651587", "0.5641033", "0.5639478", "0.5637943", "0.5623777", "0.56218845", "0.56218845", "0.56218845", "0.56218845", "0.56218845", "0.5621176", "0.56202465", "0.56129485", "0.55921406", "0.55882245", "0.55870146", "0.5583527", "0.55527765", "0.5548017", "0.5544057", "0.55290294", "0.55290294", "0.55267435", "0.5522978", "0.55105954", "0.55105954", "0.55105954", "0.55105954", "0.55105954", "0.55105954", "0.55105954", "0.5507702", "0.55059576", "0.5505956", "0.55001736", "0.54888105", "0.54864985", "0.5482879", "0.54758036", "0.54752403", "0.5472841", "0.5472841", "0.5472841", "0.5472841", "0.5472841", "0.5472841", "0.54727787", "0.54676867", "0.546712", "0.5463725", "0.5463725", "0.5463725", "0.5461341", "0.5458669", "0.54536873", "0.54534787", "0.54534787", "0.54534787", "0.54531884", "0.54531884", "0.5448367", "0.5444433", "0.54434323", "0.54308987", "0.5430147", "0.5429995", "0.542795", "0.5425085", "0.54144156", "0.5407058", "0.54063827", "0.5406191", "0.5406191", "0.5406121", "0.5406121", "0.5406121", "0.54040384", "0.540343", "0.54030406", "0.5399095", "0.539061", "0.5388697", "0.5388468", "0.5385948", "0.5385192", "0.5379787", "0.5373893", "0.5371616" ]
0.0
-1
Creates new form AdminLog
public AdminLog() { initComponents(); setSize(1450,853); setLocation (250,130); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createAdminLog(TadminLog adminlog) {\n\t\tadminLogDao.create(adminlog);\n\t}", "public LogForm(String title) {\r\n\t\tsuper(title);\r\n\t\tthis.addCommand(clearLogCommand);\r\n\t\tthis.addCommand(previuosScreenCommand);\r\n\t\tthis.setCommandListener(new CommandHandler());\r\n\t}", "public Logs() {\n initComponents();\n }", "public void Salvar(logModel logModel){\n\n ContentValues contentValues = new ContentValues();\n /*MONTANDO OS PARAMETROS PARA SEREM SALVOS*/\n contentValues.put(\"log_evento\", logModel.getEvento());\n contentValues.put(\"log_date\", logModel.getDate());\n\n /*EXECUTANDO INSERT DE UM NOVO REGISTRO*/\n databaseUtil.GetConexaoDataBase().insert(\"tb_log\",null,contentValues);\n\n }", "@Override\r\n\tpublic Admin savelog(Admin log) {\n\t\treturn user.savelog(log);\r\n\t}", "public CommandNew(LogsPanel logsWindow) {\n super(logsWindow);\n }", "private TicketLog createLog() throws SQLException {\n\t\t\t\t\treturn new TicketLog(rs.getLong(1), rs.getString(2),\n\t\t\t\t\t\t\trs.getLong(3),\n\t\t\t\t\t\t\tTicketLog.Action.valueOf(rs.getString(4)),\n\t\t\t\t\t\t\trs.getInt(5));\n\t\t\t\t}", "public static void create(Formulario form){\n daoFormulario.create(form);\n }", "public void add(SignLog log) {\n ContentValues values = new ContentValues();\n values.put(DatabaseSQLiteHelper.LOGS_NAME, log.getName());\n values.put(DatabaseSQLiteHelper.LOGS_PASSWORD, log.getPassword());\n values.put(DatabaseSQLiteHelper.LOGS_USER_ID, log.getUserId());\n values.put(DatabaseSQLiteHelper.LOGS_DAY, log.getDay());\n values.put(DatabaseSQLiteHelper.LOGS_TIME, log.getTime());\n values.put(DatabaseSQLiteHelper.LOGS_TYPE, log.getType());\n\n database.insert(DatabaseSQLiteHelper.TABLE_SIGN_LOGS, null, values);\n }", "public ChangeLog() {\n initComponents();\n }", "LogAction createLogAction();", "@Command\n\tpublic void nuevoAnalista(){\n\t\tMap<String, Object> parametros = new HashMap<String, Object>();\n\n\t\t//parametros.put(\"recordMode\", \"NEW\");\n\t\tllamarFormulario(\"formularioAnalistas.zul\", null);\n\t}", "public MyLogs() {\n }", "@RequestMapping(value = \"/report.create\", method = RequestMethod.GET)\n @ResponseBody public ModelAndView newreportForm(HttpSession session) throws Exception {\n ModelAndView mav = new ModelAndView();\n mav.setViewName(\"/sysAdmin/reports/details\");\n\n //Create a new blank provider.\n reports report = new reports();\n \n mav.addObject(\"btnValue\", \"Create\");\n mav.addObject(\"reportdetails\", report);\n\n return mav;\n }", "public void saveLogEntry(LogEntry log){\n\t\tlog.creationTime = new Date();\n\t\tgetSession().save(log);\n\t}", "public Log() {\n cadenas = new Vector<String>();\n }", "public AcideLogTab() {\r\n\r\n\t\t// Gets the file content\r\n\t\t_logFileContent = AcideFileManager.getInstance().load(LOG_FILE_PATH);\r\n\r\n\t\tif (_logFileContent != null) {\r\n\r\n\t\t\t// Creates the lexicon configuration\r\n\t\t\tAcideLexiconConfiguration lexiconConfiguration = new AcideLexiconConfiguration();\r\n\r\n\t\t\t// Loads the lexicon configuration by default\r\n\t\t\tlexiconConfiguration.load(AcideLexiconConfiguration.DEFAULT_PATH\r\n\t\t\t\t\t+ AcideLexiconConfiguration.DEFAULT_NAME);\r\n\r\n\t\t\t// Creates the current grammar configuration\r\n\t\t\tAcideGrammarConfiguration currentGrammarConfiguration = new AcideGrammarConfiguration();\r\n\r\n\t\t\t// Sets the current grammar configuration path\r\n\t\t\tcurrentGrammarConfiguration\r\n\t\t\t\t\t.setPath(AcideGrammarConfiguration.DEFAULT_FILE);\r\n\r\n\t\t\t// Creates the previous grammar configuration\r\n\t\t\tAcideGrammarConfiguration previousGrammarConfiguration = new AcideGrammarConfiguration();\r\n\r\n\t\t\t// Sets the previous grammar configuration path\r\n\t\t\tpreviousGrammarConfiguration\r\n\t\t\t\t\t.setPath(AcideGrammarConfiguration.DEFAULT_FILE);\r\n\r\n\t\t\t// Updates the tabbed pane in the file editor manager\r\n\t\t\tAcideMainWindow\r\n\t\t\t\t\t.getInstance()\r\n\t\t\t\t\t.getFileEditorManager()\r\n\t\t\t\t\t.updateTabbedPane(\"Log\", _logFileContent, false,\r\n\t\t\t\t\t\t\tAcideProjectFileType.NORMAL, 0, 0, 1,\r\n\t\t\t\t\t\t\tlexiconConfiguration, currentGrammarConfiguration,\r\n\t\t\t\t\t\t\tpreviousGrammarConfiguration);\r\n\t\t}\r\n\t}", "@Override\n public ResultMessage createNewAdmin(NewAdminCommand command) {\n String currentAdmin = command.getCurrentAdmin();\n if (!adminDao.hasHighestAuthority(currentAdmin))\n return ResultMessage.failure(\"Permission denied\");\n\n // Permission passed\n if (adminDao.addAdmin(command.getNewAdminName(),\n encryptor.encrypt(command.getPassword(), command.getNewAdminName()))) {\n log.info(\"New administrator is created successfully\");\n return ResultMessage.success();\n }\n\n return ResultMessage.failure();\n }", "@Override\n\tpublic void createForm(ERForm form) {\n\t\t\tString sql = \"insert into project1.reimbursementInfo (userName, fullName, thedate, eventstartdate, thelocation, description, thecost, gradingformat, passingpercentage, eventtype, filename,status,reason) values (?,?,?,?,?,?,?,?,?,?,?,?,?);\";\n\t\t\ttry {PreparedStatement stmt = conn.prepareCall(sql);\n\t\t\t//RID should auto increment, so this isnt necessary\n\t\t\t\n\t\t\tstmt.setString(1, form.getUserName());\n\t\t\tstmt.setString(2, form.getFullName());\n\t\t\tstmt.setDate(3, Date.valueOf(form.getTheDate()));\n\t\t\tstmt.setDate(4, Date.valueOf(form.getEventStartDate()));\n\t\t\tstmt.setString(5, form.getTheLocation());\n\t\t\tstmt.setString(6, form.getDescription());\n\t\t\tstmt.setDouble(7, form.getTheCost());\n\t\t\tstmt.setString(8, form.getGradingFormat());\n\t\t\tstmt.setString(9, form.getPassingPercentage());\n\t\t\tstmt.setString(10, form.getEventType());\n\t\t\tstmt.setString(11, form.getFileName());\n\t\t\tstmt.setString(12, \"pending\");\n\t\t\tstmt.setString(13, \"\");\n\t\t\tstmt.executeUpdate();\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\r\n\tpublic Log add(Log log) {\n\t\tConnection con = MysqlDatabase.getInstance().getConnection();\r\n\t\tLog l = null;\r\n\t\ttry {\r\n\t\t\tPreparedStatement ps = con.prepareStatement(Add, PreparedStatement.RETURN_GENERATED_KEYS);\r\n\t\t\tps.setTimestamp(1, log.getTime());\r\n\t\t\tps.setInt(2, log.getEmpId());\r\n\t\t\tps.setString(3, log.getEmpName());\r\n\t\t\tps.setString(4, log.getTopName());\r\n\t\t\tps.setString(5, log.getTopUsername());\r\n\t\t\tps.setString(6, log.getBottomName());\r\n\t\t\tps.setString(7, log.getBottomUsername());\r\n\t\t\tps.setString(8, log.getOperation());\r\n\t\t\tps.setString(9, log.getType());\r\n\t\t\tint cnt = ps.executeUpdate();\r\n\t\t\tif (cnt > 0) {\r\n\t\t\t\tResultSet rs = ps.getGeneratedKeys();\r\n\t\t\t\tif (rs.next()) {\r\n\t\t\t\t\tl = get(rs.getInt(1));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcon.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn l;\r\n\t}", "public FormInserir() {\n initComponents();\n }", "@Override\r\n\tpublic void save(SyLoginLog log) {\n\t\tsyLoginLogDao.insert(log);\r\n\t}", "public String formCreated()\r\n {\r\n return formError(\"201 Created\",\"Object was created\");\r\n }", "public EditLogRecordDialog(java.awt.Frame parent, boolean modal, RecoveryLog log)\n {\n super(parent, modal);\n \n this.log = log;\n //this.transactions = log.getTransactions();\n this.items = log.getItems();\n this.parent = parent;\n\n initComponents();\n\n }", "public Log() { //Null constructor is adequate as all values start at zero\n\t}", "@RequestMapping(params = \"new\", method = RequestMethod.GET)\n\t@PreAuthorize(\"hasRole('ADMIN')\")\n\tpublic String createProductForm(Model model) { \t\n \t\n\t\t//Security information\n\t\tmodel.addAttribute(\"admin\",security.isAdmin()); \n\t\tmodel.addAttribute(\"loggedUser\", security.getLoggedInUser());\n\t\t\n\t model.addAttribute(\"product\", new Product());\n\t return \"products/newProduct\";\n\t}", "@RequestMapping(value = \"/api/logs/create\", method = RequestMethod.POST)\n public String logs(@RequestBody String body) throws IOException\n {\n String[] parts = body.split(\"router - \");\n String log = parts[0] + \"router - [] \" + (parts.length > 1 ? parts[1] : \"\");\n\n // Knows how to speak the language of syslog => turn syslog => into a map => into a json => into a string\n RFC6587SyslogDeserializer parser = new RFC6587SyslogDeserializer();\n InputStream is = new ByteArrayInputStream(log.getBytes());\n Map<String, ?> messages = parser.deserialize(is);\n\n // Parse json to string\n ObjectMapper mapper = new ObjectMapper();\n String json = mapper.writeValueAsString(messages);\n\n // Get Producer through dependency injection\n MessageChannel toKafka = context.getBean(\"toKafka\", MessageChannel.class);\n\n // Sends message through kafka producer\n // Send is not async, kafka producer in a background thread will queue up each message and send into the broker in batches\n // Send them in batches of the type of message that is sent\n toKafka.send(new GenericMessage<>(json));\n\n return \"ok\";\n }", "@Override\n\tpublic int addLog(Log l) {\n\t\tString sql = \"INSERT INTO t_log(fTime,fTel,fType,fDocld,fResult)values(?,?,?,?,?)\";\n\t\tint result = 0;\n\t\tObject[] params = {l.getfTime(),l.getfTel(),l.getfType(),l.getfDocld(),l.getfResult()};\n\t\ttry {\n\t\t\tresult = qr.update(sql,params);\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn result;\n\t}", "public LogPoster() {\n\t\t\n\t}", "private Log() {\n }", "public HtShowDetailedLog() {\n\t}", "@Override\n\tprotected BaseProcesoForm devuelveFormProceso() throws Exception {\n\t\tProcesoBASLoggerForm objForm = new ProcesoBASLoggerForm();\n\t\treturn objForm;\n\t}", "public LogEntry () {\n }", "private void addEntranceLog(String logType) {\n if(ticketTrans == null || checkedItems.size() == 0) return;\n\n Entrance entrance = new Entrance(EntranceStep2Activity.this);\n\n Log.d(EntranceStep2Activity.class.toString(), logType);\n\n try {\n entrance.add(encryptRefNo, checkedItems, logType);\n } catch (Exception e) {\n String reason = e.getMessage();\n Toast.makeText(getApplicationContext(), reason, Toast.LENGTH_SHORT).show();\n } finally {\n loading.dismiss();\n }\n }", "private Log() {\r\n\t}", "public void insertLog (int logId,\r\n String clientName,\r\n String initialCallDate,\r\n String letterMailDate,\r\n String firstCallDate,\r\n String secCallDate,\r\n boolean madeContact,\r\n String numOfAttempt,\r\n String notes )\r\n {\n\r\n Connection con = null;\r\n PreparedStatement pstmt = null;\r\n try{\r\n con = ds.getConnection();\r\n pstmt = con.prepareStatement(QueryString.insertLog);\r\n setInt(pstmt, 1, logId);\r\n setString(pstmt, 2, clientName);\r\n setString(pstmt, 3, initialCallDate);\r\n setString(pstmt, 4, letterMailDate);\r\n setString(pstmt, 5, firstCallDate);\r\n setString(pstmt, 6, secCallDate);\r\n setBoolean(pstmt, 7, madeContact);\r\n setString(pstmt, 8, numOfAttempt);\r\n setString(pstmt, 9, notes);\r\n executeUpdate(pstmt);\r\n\r\n }catch(SQLException e){\r\n logger.log(Level.ERROR, \"Error: Problem executing query\", e); \t\r\n throw new RuntimeException(e.getMessage(), e);\r\n }finally{\r\n close(pstmt);\r\n releaseConnection(con);\r\n }\r\n }", "@Override\n\tpublic Employee create(Employee emp) {\n\t\tlog.debug(\"Welcome to logging\");\n\t\tSystem.out.println(\"Server logs \");\n\t\temployeeDAO.create(emp);\n\t\treturn null;\n\t}", "public TOpLogs() {\n this(DSL.name(\"t_op_logs\"), null);\n }", "LogRecord saveLog(LogRecord logRecord);", "public void createEditLog(long startingTransactionId) throws IOException {\n mEditLog = new EditLog(mEditLogPath, false, startingTransactionId);\n }", "@Override\r\n\tpublic ItemLog createItemLog() {\n\t\treturn new HpLog();\r\n\t}", "int insertProductTaskLog(ProductTaskLog productTaskLog);", "public void addLog(int type)\n {\n m_Log.addFirst(new SecurityLog(type));\n //truncate log list to 6 entries\n if(m_Log.size() > 6)\n m_Log.removeLast();\n }", "@GetMapping(value = \"/create\") // https://localhost:8080/etiquetasTipoDisenio/create\n\tpublic String create(Model model) {\n\t\tetiquetasTipoDisenio etiquetasTipoDisenio = new etiquetasTipoDisenio();\n\t\tmodel.addAttribute(\"title\", \"Registro de una nuev entrega\");\n\t\tmodel.addAttribute(\"etiquetasTipoDisenio\", etiquetasTipoDisenio); // similar al ViewBag\n\t\treturn \"etiquetasTipoDisenio/form\"; // la ubicacion de la vista\n\t}", "public SystemLog () {\r\n\t\tsuper();\r\n\t}", "public void onNew() {\t\t\n\t\tdesignWidget.addNewForm();\n\t}", "public LoggingPanel() {\n initComponents();\n\n }", "@Override\n\tpublic int insert(SysActionLog vo) {\n\t\tSequenceGenerator oid = new SequenceGenerator();\n\t\tString [] ids = oid.generate(1);\n\t\tvo.setSal_id(ids[0]);\n\t\t//todo\n\t\t//增加版本号和新增时间\n\t\treturn sysActionLogDao.insert(vo);\n\t}", "public C_AdminForm() {\n initComponents();\n }", "@RequestMapping(value={\"/projects/add\"}, method= RequestMethod.GET)\r\n\tpublic String createProjectForm(Model model) {\r\n\t\tUser loggedUser= sessionData.getLoggedUser();\r\n\t\tmodel.addAttribute(\"loggedUser\", loggedUser);\r\n\t\tmodel.addAttribute(\"projectForm\", new Project());\r\n\t\treturn \"addProject\";\r\n\t}", "public Result addNewRoomType() {\n\n DynamicForm dynamicform = Form.form().bindFromRequest();\n if (dynamicform.get(\"AdminAddRoom\") != null) {\n\n return ok(views.html.AddRoomType.render());\n }\n\n\n return ok(\"Something went wrong\");\n }", "public void saveLogger(Logger log) {\n this.getHibernateTemplate().save(log);\n \n\t}", "public void uploadLogCollection();", "@PrePersist\n public void startLog(){\n logger.info(\"creation du place en cours \" + this.name);\n }", "public Catelog() {\n super();\n }", "public Log()\n {\n filePath = String.format(\"log-%d.sl\", System.currentTimeMillis());\n\n open();\n }", "public static PatientDetailLogsFragment newInstance() {\n PatientDetailLogsFragment fragment = new PatientDetailLogsFragment();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }", "public synchronized long addLog(final Log log) {\n if (log == null\n || TextUtils.isEmpty(log.getUrl())\n || TextUtils.isEmpty(log.getToken())\n || log.getJSON() == null) {\n Logger.e(\"Cannot add log without args.\");\n return getCount();\n }\n\n queryExecutor(new QueryExecCallback<Void>() {\n @Override\n public Void execute(SQLiteDatabase db) {\n ContentValues values = new ContentValues();\n values.put(Columns.URL, log.getUrl());\n values.put(Columns.TOKEN, log.getToken());\n values.put(Columns.LOG, log.getJSON().toString());\n values.put(Columns.CREATED_AT, System.currentTimeMillis());\n\n db.insert(TABLE_NAME, null, values);\n return null;\n }\n });\n\n return getCount();\n }", "@Override\n\tpublic void onFormCreate(AbstractForm arg0, DataMsgBus arg1) {\n\t}", "public void viewLogs() {\n\t}", "private void buildTransactionLogPane() // buildTransactionLogPane method start\n\t{\n\t\t// creating object\n\t\tlogOutput = new JTextArea();\n\t\t\n\t\t// object settings\n\t\tlogOutput.setText(log.logReport());\n\t\tlogOutput.setEditable(false);\n\t\tlogOutput.setFont(font);\n\t\tlogOutput.setRows(20);\n\t\t\n\t\t// adding object and scroll bar to panel\n\t\ttransactionLogPane.add(logOutput);\n\t\ttransactionLogPane.add(new JScrollPane(logOutput));\n\t}", "public String nuevo() {\n\n\t\tLOG.info(\"Submitado formulario, accion nuevo\");\n\t\tString view = \"/alumno/form\";\n\n\t\t// las validaciones son correctas, por lo cual los datos del formulario estan en\n\t\t// el atributo alumno\n\n\t\t// TODO simular index de la bbdd\n\t\tint id = this.alumnos.size();\n\t\tthis.alumno.setId(id);\n\n\t\tLOG.debug(\"alumno: \" + this.alumno);\n\n\t\t// TODO comprobar edad y fecha\n\n\t\talumnos.add(alumno);\n\t\tview = VIEW_LISTADO;\n\t\tmockAlumno();\n\n\t\t// mensaje flash\n\t\tFacesContext facesContext = FacesContext.getCurrentInstance();\n\t\tExternalContext externalContext = facesContext.getExternalContext();\n\t\texternalContext.getFlash().put(\"alertTipo\", \"success\");\n\t\texternalContext.getFlash().put(\"alertMensaje\", \"Alumno \" + this.alumno.getNombre() + \" creado con exito\");\n\n\t\treturn view + \"?faces-redirect=true\";\n\t}", "@Override\r\n\t\tpublic void create() {\n\t\t\tsuper.create();\r\n\t\t\tsuper.getOKButton().setEnabled(false);\r\n\t\t\tsuper.setTitle(Messages.MoveUnitsWizardPage1_Topolog__2);\r\n\t\t\tsuper.setMessage(Messages.MoveUnitsWizardPage1_Select_a_name_source_folder_and_a_);\r\n\t\t\tsuper.getShell().setText(Messages.MoveUnitsWizardPage1_Topolog__2);\r\n\t\t}", "public ActionForward addChangeLog(ActionMapping mapping, ActionForm form,\n\t\t\tHttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows Exception {\n\t\tString devId = request.getParameter(\"chid\");\n\t\tAssetChangeLogForm forms = (AssetChangeLogForm) form; \n\t\tAssetChangeLogBO bean = new AssetChangeLogBO();\n\t\tbean.setCreateTime(new Timestamp(System.currentTimeMillis()));\n\t\tbean.setStatusAfter(forms.getStatusAfter());\n\t\tbean.setStatusBefore(forms.getStatusBefore());\n\t\tInteger deviceId = null;\n\t\tif(devId != null && !\"\".equals(devId.trim()))\n\t\t\tdeviceId = Integer.valueOf(devId);\n\t\tbean.setDeviceId(deviceId);\n\t\tassetChangeLogService.saveAssetChangeLog(bean);\n\t\tAssetDeviceBO device = assetDeviceService.findById(deviceId);\n\t\tDomain department = new Domain();\n\t\tif(device.getLocationId()!= null){\n\t\t\tdepartment.setId(device.getLocationId());\n\t\t}\n\t\tif(device != null && device.getName() != null && !\"\".equals(device.getName().trim()))\n//\t\t\tsendAlertService.sendAlertService(1, \"资产管理\", \"资产信息变动\", null, device.getName()+\"有新的资产变动信息!\" + \"变更后:\" + bean.getStatusAfter(), null, null, \"事件报告\", WebConfigContent.mailAddress, WebConfigContent.mailFrom, WebConfigContent.mailPassword, WebConfigContent.mmsIp,WebConfigContent.mmsPort,department);\n\t\trequest.setAttribute(\"locid\", request.getParameter(\"locid\"));\n\t\trequest.setAttribute(\"typid\", request.getParameter(\"typeid\"));\n\t\trequest.setAttribute(\"chid\", request.getParameter(\"chid\"));\n\t\trequest.setAttribute(\"curpage\", request.getParameter(\"curpage\"));\n\t\treturn searchChangeLog(mapping, form, request, response);\n\t}", "public void addLog(Log p) {\n logs.add(p);\n }", "@Override\r\n\t\tpublic void onClick(ClickEvent event) {\n\t\t\tRootPanel.get(\"details\").clear();\r\n\t\t\thome = new AdminDashboardForm();\r\n\t\t\tRootPanel.get(\"details\").add(home);\r\n\t\t}", "public String actionCreateNew() {\r\n \t\tsetBook(new Book());\r\n \t\treturn \"new\";\r\n \t}", "public NewCommand(ApplicationData data) {\n super(\"NewCommand\");\n this.data = data;\n // configure log4j using resource URL APF-548\n DOMConfigurator.configure(getClass().getResource(\"/META-INF/log4j.xml\"));\n log = getLogger(NewCommand.class);\n\n }", "public Log(String name) {\n this.name = name;\n this.entries = new ArrayList<>();\n }", "public void insert(TbAdminMenu record) {\n getSqlMapClientTemplate().insert(\"tb_admin_menu.ibatorgenerated_insert\", record);\n }", "private void azzeraInsertForm() {\n\t\tviewInserimento.getCmbbxTipologia().setSelectedIndex(-1);\n\t\tviewInserimento.getTxtFieldDataI().setText(\"\");\n\t\tviewInserimento.getTxtFieldValore().setText(\"\");\n\t\tviewInserimento.getTxtFieldDataI().setBackground(Color.white);\n\t\tviewInserimento.getTxtFieldValore().setBackground(Color.white);\n\t}", "public FormMenuUser() {\n super(\"Form Menu User\");\n initComponents();\n }", "@RequestMapping(value = \"/prep_log_form.htm\",method = RequestMethod.GET)\r\n\tpublic String prepLogForm(ModelMap map,HttpSession session,HttpServletResponse response) throws IOException {\r\n\t\t\r\n\t\tmap.put(\"user\", new User());\r\n\t\treturn \"login_form\";\r\n\t}", "void saveLog(LogInfo logText);", "public PanelPayload_cmd( Log log ) {\r\n initComponents();\r\n this.log = log; \r\n if( this.log == null ) this.log = new Log();\r\n }", "public OperateLog(User admin, BasicModel basicModel, String className, String methodName, String argList,\n\t\t\tString action, String target, String status, String retrunDat) {\n\t\tsuper();\n\t\tDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss SSS\");\n\t\tthis.dateTime = df.format(new Date());\n\t\tif (admin != null) {\n\t\t\tthis.adminId = admin.getId();\n\t\t\tthis.adminName = admin.getRealname();\n\t\t} else {\n\t\t\tthis.adminId = -1;\n\t\t\tthis.adminName = \"\";\n\t\t}\n\t\tif (basicModel != null) {\n\t\t\tthis.basicId = basicModel.getId();\n\t\t\tthis.basicRemark = basicModel.getRemark();\n\t\t} else {\n\t\t\tthis.basicId = -1;\n\t\t\tthis.basicRemark = \"\";\n\t\t}\n\t\tthis.className = className;\n\t\tthis.methodName = methodName;\n\t\tthis.argList = argList;\n\t\tthis.action = action;\n\t\tthis.target = target;\n\t\tthis.status = status;\n\t\tthis.retrunDat = retrunDat;\n\t}", "@Override\r\n protected void createDbContentCreateEdit() {\n DbContentCreateEdit dbContentCreateEdit = new DbContentCreateEdit();\r\n dbContentCreateEdit.init(null);\r\n form.getModelObject().setDbContentCreateEdit(dbContentCreateEdit);\r\n dbContentCreateEdit.setParent(form.getModelObject());\r\n ruServiceHelper.updateDbEntity(form.getModelObject()); \r\n }", "public DefaultListModel getLog()\r\n\t{\r\n\t\treturn log;\r\n\t}", "public LogEntry generateLogEntry() {\n long time = getTime();\n int bloodGlucose = getBloodGlucose();\n double bolus = getBolus();\n int carbohydrate = getCarbohydrate();\n return new LogEntry(time, bloodGlucose, bolus, carbohydrate);\n }", "public void saveLog(Log log) {\n\t\tsession.beginTransaction();\n\t\tsession.persist(log);\n\t\tsession.getTransaction().commit();\n\t}", "private LogEvent()\n\t{\n\t\tsuper();\n\t}", "public ServletLogChute()\r\n {\r\n }", "public void createAdmin()\r\n\t{\r\n\t\tSystem.out.println(\"Administrator account not exist, please create the administrator account by setting up a password for it.\");\r\n\t\tString password=\"\",repassword=\"\";\r\n\t\tboolean flag=false;\r\n\t\twhile(!flag)\r\n\t\t{\r\n\t\t\tboolean validpassword=false;\r\n\t\t\twhile(!validpassword)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.print(\"Please enter the password: \");\r\n\t\t\t\tpassword=sc.nextLine();\r\n\t\t\t\tvalidpassword=a.validitycheck(password);\r\n\t\t\t\tif(!validpassword)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"Your password has to fulfil: at least 1 small letter, 1 capital letter, 1 digit!\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.print(\"Please re-enter the password: \");\r\n\t\t\trepassword=sc.nextLine();\r\n\t\t\tflag=a.matchingpasswords(password,repassword);\r\n\t\t\tif(!flag)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.print(\"Password not match! \");\r\n\t\t\t}\r\n\t\t}\r\n\t\tString hash_password=hashfunction(password); \r\n\t\tString last_login=java.time.LocalDate.now().toString();\r\n\t\tuser_records.add(new User(\"administrator\",hash_password,\"administrator\",\"\",0,0,last_login,false));\r\n\t\tSystem.out.println(\"Administrator account created successfully!\");\r\n\t}", "public frmAdministracion() {\n initComponents();\n skin();\n DaoAdministracion da = new DaoAdministracion();\n da.setAdministracion(txtMedioAdministracion.getText());\n tblAdministracion.setModel(da.listar());\n\n }", "public Result createRoom() {\n\n DynamicForm dynamicForm = Form.form().bindFromRequest();\n String roomType = dynamicForm.get(\"roomType\");\n Double price = Double.parseDouble(dynamicForm.get(\"price\"));\n int bedCount = Integer.parseInt(dynamicForm.get(\"beds\"));\n String wifi = dynamicForm.get(\"wifi\");\n String smoking = dynamicForm.get(\"smoking\");\n\n RoomType roomTypeObj = new RoomType(roomType, price, bedCount, wifi, smoking);\n\n if (dynamicForm.get(\"AddRoomType\") != null) {\n\n Ebean.save(roomTypeObj);\n String message = \"New Room type is created Successfully\";\n\n return ok(views.html.RoomTypeUpdateSuccess.render(message));\n } else{\n\n String message = \"Failed to create a new Room type\";\n\n return ok(views.html.RoomTypeUpdateSuccess.render(message));\n\n }\n\n\n\n }", "@Override\n public void onClick(View view) {\n insertLogEntry();\n\n Toast toast = Toast.makeText(getActivity(), \"Sighting logged\", Toast.LENGTH_SHORT);\n toast.show();\n\n // go to the log book activity\n Intent intent = new Intent(getActivity(), LogBookActivity.class);\n startActivity(intent);\n }", "protected Log getLog()\n/* */ {\n/* 59 */ return log;\n/* */ }", "protected void logEventCreation(final GossipEvent event) {\n logger.debug(CREATE_EVENT.getMarker(), \"Creating {}\", event::toString);\n }", "protected MessageView createStatusLog(String initialMessage) {\n statusLog = new MessageView(initialMessage);\n\n return statusLog;\n }", "public File newLogFile() {\n File flog = null;\n try {\n this.logFileName = getTimestamp() + \".xml\";\n this.pathToLogFile = logFileFolder + logFileName;\n URL logURL = new URL(this.pathToLogFile);\n flog = new File(logURL.toURI());\n if (!flog.exists()) {\n flog.createNewFile();\n }\n } catch (Exception ex) {\n log.error(\"newLogFile :\"+ ex.getMessage());\n } finally{\n this.fLogFile = flog;\n return flog;\n }\n }", "@Override\npublic int addSysLog(EhrUser user, LogOperateType operation, Module module ,String operationInfo)\n\t\tthrows Exception {\n\tEhrSysLog log = new EhrSysLog();\n\tlog.setUserId(user.getUserId());\n\tlog.setUserName(user.getUserName());\n\tlog.setOperateType(operation.getValue());\n\tlog.setModule(module.getModuleName());\n\t\n\tif (user.getCompany() != null) {\n\t\tlog.setCompanyId(user.getCompany().getCompanyId());\n\t\tlog.setCompanyCode(user.getCompany().getCompanyCode());\n\t\tlog.setCompanyName(user.getCompany().getCompanyName());\n\t} else {\n\t\tEhrCompany company = companyMapper.selectByPrimaryKey(user.getCompanyId());\n\t\tlog.setCompanyId(company.getCompanyId());\n\t\tlog.setCompanyCode(company.getCompanyCode());\n\t\tlog.setCompanyName(company.getCompanyName());\n\t}\n\tlog.setOperateInfo(operationInfo);\n\tlog.setOperateDate(new Date());\n\treturn logMapper.insertSelective(log);\n\n}", "private TypicalLogEntries() {}", "public void add_admin(String admin_id, String admin_name, String admin_address, String admin_designation,\n\t\t\t double salary, String contact, boolean status_vacancy, String password,String admin_project_key)\n {\n\t\t\n \tadm_list.insert(new Admin(admin_id,admin_name,admin_address,admin_designation, salary,contact,status_vacancy,password,admin_project_key));\n \twrite_adm_file();\n }", "@Override\n\tpublic void saveConsoleLog(EbConsoleLog consoleLog) {\n this.getSqlSession().insert(ns+\"insert\", consoleLog);\n\t}", "public LogarSistema(FormListaContatos form) {\n initComponents();\n this.formContatos = form;\n tfLogin.requestFocus();\n }", "private void createBtnActionPerformed(java.awt.event.ActionEvent evt) {\n\n staff.setName(regName.getText());\n staff.setID(regID.getText());\n staff.setPassword(regPwd.getText());\n staff.setPosition(regPos.getSelectedItem().toString());\n staff.setGender(regGender.getSelectedItem().toString());\n staff.setEmail(regEmail.getText());\n staff.setPhoneNo(regPhone.getText());\n staff.addStaff();\n if (staff.getPosition().equals(\"Vet\")) {\n Vet vet = new Vet();\n vet.setExpertise(regExp.getSelectedItem().toString());\n vet.setExpertise_2(regExp2.getSelectedItem().toString());\n vet.addExpertise(staff.getID());\n }\n JOptionPane.showMessageDialog(null, \"User added to database\");\n updateJTable();\n }", "private void submitForm(){\n String toast_message;\n\n int time = getValueOfField(R.id.at_editTextNumberSigned_timeValue);\n int easyNumber = getValueOfField(R.id.at_editTextNumberSigned_levelEasyValue);\n int mediumNumber = getValueOfField(R.id.at_editTextNumberSigned_levelMiddleValue);\n int highNumber = getValueOfField(R.id.at_editTextNumberSigned_levelHighValue);\n int hardcoreNumber = getValueOfField(R.id.at_editTextNumberSigned_levelExpertValue);\n\n // if time is between 0 and 1440 min\n if (time > 0){\n if(time < 24*60){\n // if numbers are positives\n if (easyNumber >= 0 && mediumNumber >= 0 && highNumber >= 0 && hardcoreNumber >= 0){\n\n // save data\n int id = this.controller.getLastIdTraining() + 1;\n\n ArrayList<Level> listLevel = new ArrayList<>();\n listLevel.add(new Level(\"EASY\", easyNumber));\n listLevel.add(new Level(\"MEDIUM\", mediumNumber));\n listLevel.add(new Level(\"HIGHT\", highNumber));\n listLevel.add(new Level(\"HARDCORE\", hardcoreNumber));\n\n Training training = new Training(id, inputCalendar.getTime(), time, listLevel);\n\n this.controller.AddTraining(training);\n\n // init values of Form\n initForm(null);\n\n // redirection to stats page\n Navigation.findNavController(getActivity(),\n R.id.nav_host_fragment).navigate(R.id.navigation_list_training);\n\n toast_message = \"L'entrainement a bien été ajouté !\";\n }else toast_message = \"Erreur:\\nToutes les valeurs de voies ne sont pas positive !\";\n }else toast_message = \"La durée ne doit pas exceder 1440 min.\";\n }else toast_message = \"La durée doit être supérieur à 0 min.\\n\";\n\n // Send alert\n Toast.makeText(getContext(), toast_message, Toast.LENGTH_LONG).show();\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tADMLE.Admin_DDL_Create();\n\t\t\t\tADML.setVisible(false);\n\t\t\t}", "@Override\r\n public void add() {\n String ID =id.getText();\r\n String Name =name.getText();\r\n String form_date =date_start.getText();\r\n String to_date =date_finish.getText();\r\n String Status =status.getText();\r\n String MemberID = MemberId.getText();\r\n ArrayList<String> arr = new ArrayList<String>();\r\n arr.add(ID);\r\n arr.add(Name);\r\n arr.add(form_date);\r\n arr.add(to_date);\r\n arr.add(Status);\r\n arr.add(MemberID);\r\n String PathFile = \"/home/yara/Documents/4year/OODP/Task.txt\";\r\n FileFacade facade = new FileFacade();\r\n facade.Add(PathFile, arr);\r\n }", "@RequestMapping(value = \"/blog/newpost\", method = RequestMethod.POST)\n\tpublic String newPost(HttpServletRequest request, Model model) {\n\t\tString title=request.getParameter(\"title\");\n\t\tString body=request.getParameter(\"body\");\n\t\t\n\t\t//Validate parameters if not valid send back to form w/ error message\n\t\tif (title==\"\" || body==\"\"){\n\t\t\tif (title!=\"\"){\n\t\t\t\tmodel.addAttribute(\"title\",title);\n\t\t\t}\n\t\t\tif(body!=\"\"){\n\t\t\t\tmodel.addAttribute(\"body\",body);\n\t\t\t}\n\t\t\tmodel.addAttribute(\"error\",\"Post must have a Title and Body!\");\n\t\t\treturn \"newpost\";\n\t\t}\n\t\t\n\t\t//if they validate, create a new post\n\t\tInteger userId = (Integer) request.getSession().getAttribute(AbstractController.userSessionKey);\n\t\tUser author= userDao.findByUid(userId);\n\t\tPost post = new Post(title,body,author);\n\t\tpostDao.save(post);\n\t\tmodel.addAttribute(\"post\", post);\n\t\treturn \"redirect:\"+ post.getAuthor().getUsername()+\"/\"+ post.getUid(); \t\t\n\t}" ]
[ "0.6964615", "0.61176413", "0.5924941", "0.5829489", "0.581523", "0.5685269", "0.56362295", "0.56263536", "0.5596411", "0.55664635", "0.5517848", "0.5394547", "0.53262335", "0.53100544", "0.5302022", "0.5293137", "0.52807164", "0.52779293", "0.5275191", "0.5274838", "0.527053", "0.5263284", "0.5261136", "0.52445674", "0.52204335", "0.5220336", "0.51890564", "0.5189006", "0.5171949", "0.517072", "0.51697665", "0.51625377", "0.51532227", "0.51436114", "0.5119842", "0.5117744", "0.5116668", "0.5109939", "0.5108331", "0.50985765", "0.50970083", "0.5092089", "0.5085872", "0.5083486", "0.5075296", "0.5070374", "0.5069349", "0.50660366", "0.50583714", "0.50582945", "0.5057662", "0.50559884", "0.5053288", "0.5034826", "0.5032491", "0.503228", "0.5022506", "0.5014405", "0.5010548", "0.5006092", "0.49964732", "0.49958125", "0.49941337", "0.49940237", "0.49909586", "0.4979247", "0.4974346", "0.49621087", "0.49547178", "0.49519363", "0.49452063", "0.49451363", "0.49396354", "0.49352235", "0.4924744", "0.49179593", "0.49159095", "0.49143785", "0.49110782", "0.4904561", "0.4900881", "0.4898506", "0.48978817", "0.48973098", "0.48960692", "0.48930636", "0.48831826", "0.48830858", "0.48813578", "0.48620358", "0.48574284", "0.4855803", "0.48476064", "0.48470557", "0.48467028", "0.48403043", "0.48365894", "0.48265442", "0.4824606", "0.48229834" ]
0.59649944
2
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); textField1 = new java.awt.TextField(); jPasswordField1 = new javax.swing.JPasswordField(); button1 = new java.awt.Button(); jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); getContentPane().setLayout(null); jLabel2.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N jLabel2.setForeground(new java.awt.Color(0, 102, 102)); jLabel2.setText("Admin ID"); getContentPane().add(jLabel2); jLabel2.setBounds(990, 360, 200, 50); jLabel3.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N jLabel3.setForeground(new java.awt.Color(0, 102, 102)); jLabel3.setText("Password"); getContentPane().add(jLabel3); jLabel3.setBounds(990, 500, 190, 50); textField1.setBackground(new java.awt.Color(153, 153, 153)); textField1.setFont(new java.awt.Font("Dialog", 1, 24)); // NOI18N textField1.setForeground(new java.awt.Color(255, 255, 0)); getContentPane().add(textField1); textField1.setBounds(990, 430, 300, 50); jPasswordField1.setBackground(new java.awt.Color(153, 153, 153)); jPasswordField1.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N jPasswordField1.setForeground(new java.awt.Color(255, 255, 0)); jPasswordField1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jPasswordField1ActionPerformed(evt); } }); getContentPane().add(jPasswordField1); jPasswordField1.setBounds(990, 550, 300, 50); button1.setBackground(new java.awt.Color(0, 153, 51)); button1.setFont(new java.awt.Font("Dialog", 1, 24)); // NOI18N button1.setLabel("I 'm in"); button1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { button1ActionPerformed(evt); } }); getContentPane().add(button1); button1.setBounds(990, 740, 370, 50); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/adminbank/image/7M5QGITIEQI6RIZVYRID2BA6V4.jpg"))); // NOI18N getContentPane().add(jLabel1); jLabel1.setBounds(0, 0, 1484, 854); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n initComponents();\n }", "public AdjointForm() {\n initComponents();\n setDefaultCloseOperation(HIDE_ON_CLOSE);\n }", "public FormListRemarking() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n \n }", "public FormPemilihan() {\n initComponents();\n }", "public GUIForm() { \n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "public TorneoForm() {\n initComponents();\n }", "public FormCompra() {\n initComponents();\n }", "public muveletek() {\n initComponents();\n }", "public Interfax_D() {\n initComponents();\n }", "public quanlixe_form() {\n initComponents();\n }", "public SettingsForm() {\n initComponents();\n }", "public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public Soru1() {\n initComponents();\n }", "public FMainForm() {\n initComponents();\n this.setResizable(false);\n setLocationRelativeTo(null);\n }", "public soal2GUI() {\n initComponents();\n }", "public EindopdrachtGUI() {\n initComponents();\n }", "public MechanicForm() {\n initComponents();\n }", "public AddDocumentLineForm(java.awt.Frame parent) {\n super(parent);\n initComponents();\n myInit();\n }", "public BloodDonationGUI() {\n initComponents();\n }", "public quotaGUI() {\n initComponents();\n }", "public Customer_Form() {\n initComponents();\n setSize(890,740);\n \n \n }", "public PatientUI() {\n initComponents();\n }", "public myForm() {\n\t\t\tinitComponents();\n\t\t}", "public Oddeven() {\n initComponents();\n }", "public intrebarea() {\n initComponents();\n }", "public Magasin() {\n initComponents();\n }", "public RadioUI()\n {\n initComponents();\n }", "public NewCustomerGUI() {\n initComponents();\n }", "public ZobrazUdalost() {\n initComponents();\n }", "public FormUtama() {\n initComponents();\n }", "public p0() {\n initComponents();\n }", "public INFORMACION() {\n initComponents();\n this.setLocationRelativeTo(null); \n }", "public ProgramForm() {\n setLookAndFeel();\n initComponents();\n }", "public AmountReleasedCommentsForm() {\r\n initComponents();\r\n }", "public form2() {\n initComponents();\n }", "public MainForm() {\n\t\tsuper(\"Hospital\", List.IMPLICIT);\n\n\t\tstartComponents();\n\t}", "public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }", "public kunde() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n setRequestFocusEnabled(false);\n setVerifyInputWhenFocusTarget(false);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 465, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 357, Short.MAX_VALUE)\n );\n }", "public MusteriEkle() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public DESHBORDPANAL() {\n initComponents();\n }", "public GUIForm() {\n initComponents();\n inputField.setText(NO_FILE_SELECTED);\n outputField.setText(NO_FILE_SELECTED);\n progressLabel.setBackground(INFO);\n progressLabel.setText(SELECT_FILE);\n }", "public frmVenda() {\n initComponents();\n }", "public Botonera() {\n initComponents();\n }", "public FrmMenu() {\n initComponents();\n }", "public OffertoryGUI() {\n initComponents();\n setTypes();\n }", "public JFFornecedores() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(255, 255, 255));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 983, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 769, Short.MAX_VALUE)\n );\n\n pack();\n }", "public EnterDetailsGUI() {\n initComponents();\n }", "public vpemesanan1() {\n initComponents();\n }", "public Kost() {\n initComponents();\n }", "public FormHorarioSSE() {\n initComponents();\n }", "public UploadForm() {\n initComponents();\n }", "public frmacceso() {\n initComponents();\n }", "public HW3() {\n initComponents();\n }", "public Managing_Staff_Main_Form() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "public sinavlar2() {\n initComponents();\n }", "public P0405() {\n initComponents();\n }", "public IssueBookForm() {\n initComponents();\n }", "public MiFrame2() {\n initComponents();\n }", "public Choose1() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n\n String oldAuthor = prefs.get(\"AUTHOR\", \"\");\n if(oldAuthor != null) {\n this.authorTextField.setText(oldAuthor);\n }\n String oldBook = prefs.get(\"BOOK\", \"\");\n if(oldBook != null) {\n this.bookTextField.setText(oldBook);\n }\n String oldDisc = prefs.get(\"DISC\", \"\");\n if(oldDisc != null) {\n try {\n int oldDiscNum = Integer.parseInt(oldDisc);\n oldDiscNum++;\n this.discNumberTextField.setText(Integer.toString(oldDiscNum));\n } catch (Exception ex) {\n this.discNumberTextField.setText(oldDisc);\n }\n this.bookTextField.setText(oldBook);\n }\n\n\n }", "public GUI_StudentInfo() {\n initComponents();\n }", "public Lihat_Dokter_Keseluruhan() {\n initComponents();\n }", "public JFrmPrincipal() {\n initComponents();\n }", "public bt526() {\n initComponents();\n }", "public Pemilihan_Dokter() {\n initComponents();\n }", "public Ablak() {\n initComponents();\n }", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n\t// <editor-fold defaultstate=\"collapsed\" desc=\"Generated\n\t// Code\">//GEN-BEGIN:initComponents\n\tprivate void initComponents() {\n\n\t\tlabel1 = new java.awt.Label();\n\t\tlabel2 = new java.awt.Label();\n\t\tlabel3 = new java.awt.Label();\n\t\tlabel4 = new java.awt.Label();\n\t\tlabel5 = new java.awt.Label();\n\t\tlabel6 = new java.awt.Label();\n\t\tlabel7 = new java.awt.Label();\n\t\tlabel8 = new java.awt.Label();\n\t\tlabel9 = new java.awt.Label();\n\t\tlabel10 = new java.awt.Label();\n\t\ttextField1 = new java.awt.TextField();\n\t\ttextField2 = new java.awt.TextField();\n\t\tlabel14 = new java.awt.Label();\n\t\tlabel15 = new java.awt.Label();\n\t\tlabel16 = new java.awt.Label();\n\t\ttextField3 = new java.awt.TextField();\n\t\ttextField4 = new java.awt.TextField();\n\t\ttextField5 = new java.awt.TextField();\n\t\tlabel17 = new java.awt.Label();\n\t\tlabel18 = new java.awt.Label();\n\t\tlabel19 = new java.awt.Label();\n\t\tlabel20 = new java.awt.Label();\n\t\tlabel21 = new java.awt.Label();\n\t\tlabel22 = new java.awt.Label();\n\t\ttextField6 = new java.awt.TextField();\n\t\ttextField7 = new java.awt.TextField();\n\t\ttextField8 = new java.awt.TextField();\n\t\tlabel23 = new java.awt.Label();\n\t\ttextField9 = new java.awt.TextField();\n\t\ttextField10 = new java.awt.TextField();\n\t\ttextField11 = new java.awt.TextField();\n\t\ttextField12 = new java.awt.TextField();\n\t\tlabel24 = new java.awt.Label();\n\t\tlabel25 = new java.awt.Label();\n\t\tlabel26 = new java.awt.Label();\n\t\tlabel27 = new java.awt.Label();\n\t\tlabel28 = new java.awt.Label();\n\t\tlabel30 = new java.awt.Label();\n\t\tlabel31 = new java.awt.Label();\n\t\tlabel32 = new java.awt.Label();\n\t\tjButton1 = new javax.swing.JButton();\n\n\t\tlabel1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel1.setText(\"It seems that some of the buttons on the ATM machine are not working!\");\n\n\t\tlabel2.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel2.setText(\"Unfortunately these numbers are exactly what Professor has to use to type in his password.\");\n\n\t\tlabel3.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel3.setText(\n\t\t\t\t\"If you want to eat tonight, you have to help him out and construct the numbers of the password with the working buttons and math operators.\");\n\n\t\tlabel4.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tlabel4.setText(\"Denver's Password: 2792\");\n\n\t\tlabel5.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel5.setText(\"import java.util.Scanner;\\n\");\n\n\t\tlabel6.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel6.setText(\"public class ATM{\");\n\n\t\tlabel7.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel7.setText(\"public static void main(String[] args){\");\n\n\t\tlabel8.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel8.setText(\"System.out.print(\");\n\n\t\tlabel9.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel9.setText(\" -\");\n\n\t\tlabel10.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel10.setText(\");\");\n\n\t\ttextField1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttextField1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tlabel14.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel14.setText(\"System.out.print( (\");\n\n\t\tlabel15.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel15.setText(\"System.out.print(\");\n\n\t\tlabel16.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel16.setText(\"System.out.print( ( (\");\n\n\t\tlabel17.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel17.setText(\")\");\n\n\t\tlabel18.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel18.setText(\" +\");\n\n\t\tlabel19.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel19.setText(\");\");\n\n\t\tlabel20.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel20.setText(\" /\");\n\n\t\tlabel21.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel21.setText(\" %\");\n\n\t\tlabel22.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel22.setText(\" +\");\n\n\t\tlabel23.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel23.setText(\");\");\n\n\t\tlabel24.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel24.setText(\" +\");\n\n\t\tlabel25.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel25.setText(\" /\");\n\n\t\tlabel26.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel26.setText(\" *\");\n\n\t\tlabel27.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\t\tlabel27.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel27.setText(\")\");\n\n\t\tlabel28.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel28.setText(\")\");\n\n\t\tlabel30.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel30.setText(\"}\");\n\n\t\tlabel31.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel31.setText(\"}\");\n\n\t\tlabel32.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel32.setText(\");\");\n\n\t\tjButton1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tjButton1.setText(\"Check\");\n\t\tjButton1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\tjButton1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n\t\tlayout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(28).addGroup(layout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING).addComponent(getDoneButton()).addComponent(jButton1)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, 774, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addGap(92).addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15, GroupLayout.PREFERRED_SIZE, 145,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(37))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(174)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(7)))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label23, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20).addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(23).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16, GroupLayout.PREFERRED_SIZE, 177,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createParallelGroup(Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap()\n\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup().addGroup(layout.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(19)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(78)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(76)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(75)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(27))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel23,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(29)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))))\n\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t.addGap(30)\n\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(25)\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(26).addComponent(jButton1).addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(getDoneButton()).addContainerGap(23, Short.MAX_VALUE)));\n\t\tthis.setLayout(layout);\n\n\t\tlabel16.getAccessibleContext().setAccessibleName(\"System.out.print( ( (\");\n\t\tlabel17.getAccessibleContext().setAccessibleName(\"\");\n\t\tlabel18.getAccessibleContext().setAccessibleName(\" +\");\n\t}", "public Pregunta23() {\n initComponents();\n }", "public FormMenuUser() {\n super(\"Form Menu User\");\n initComponents();\n }", "public AvtekOkno() {\n initComponents();\n }", "public busdet() {\n initComponents();\n }", "public ViewPrescriptionForm() {\n initComponents();\n }", "public Ventaform() {\n initComponents();\n }", "public Kuis2() {\n initComponents();\n }", "public CreateAccount_GUI() {\n initComponents();\n }", "public POS1() {\n initComponents();\n }", "public Carrera() {\n initComponents();\n }", "public EqGUI() {\n initComponents();\n }", "public JFriau() {\n initComponents();\n this.setLocationRelativeTo(null);\n this.setTitle(\"BuNus - Budaya Nusantara\");\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setBackground(new java.awt.Color(204, 204, 204));\n setMinimumSize(new java.awt.Dimension(1, 1));\n setPreferredSize(new java.awt.Dimension(760, 402));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 750, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n }", "public nokno() {\n initComponents();\n }", "public dokter() {\n initComponents();\n }", "public ConverterGUI() {\n initComponents();\n }", "public hitungan() {\n initComponents();\n }", "public Modify() {\n initComponents();\n }", "public frmAddIncidencias() {\n initComponents();\n }", "public FP_Calculator_GUI() {\n initComponents();\n \n setVisible(true);\n }" ]
[ "0.73191476", "0.72906625", "0.72906625", "0.72906625", "0.72860986", "0.7248112", "0.7213479", "0.72078276", "0.7195841", "0.71899796", "0.71840525", "0.7158498", "0.71477973", "0.7092748", "0.70800966", "0.70558053", "0.69871384", "0.69773406", "0.69548076", "0.69533914", "0.6944929", "0.6942576", "0.69355655", "0.6931378", "0.6927896", "0.69248974", "0.6924723", "0.69116884", "0.6910487", "0.6892381", "0.68921053", "0.6890637", "0.68896896", "0.68881863", "0.68826133", "0.68815064", "0.6881078", "0.68771756", "0.6875212", "0.68744373", "0.68711984", "0.6858978", "0.68558776", "0.6855172", "0.6854685", "0.685434", "0.68525875", "0.6851834", "0.6851834", "0.684266", "0.6836586", "0.6836431", "0.6828333", "0.68276715", "0.68262815", "0.6823921", "0.682295", "0.68167603", "0.68164384", "0.6809564", "0.68086857", "0.6807804", "0.6807734", "0.68067646", "0.6802192", "0.67943805", "0.67934304", "0.6791657", "0.6789546", "0.6789006", "0.67878324", "0.67877173", "0.6781847", "0.6765398", "0.6765197", "0.6764246", "0.6756036", "0.6755023", "0.6751404", "0.67508715", "0.6743043", "0.67387456", "0.6736752", "0.67356426", "0.6732893", "0.6726715", "0.6726464", "0.67196447", "0.67157453", "0.6714399", "0.67140275", "0.6708251", "0.6707117", "0.670393", "0.6700697", "0.66995865", "0.66989213", "0.6697588", "0.66939527", "0.66908985", "0.668935" ]
0.0
-1
Translates code to Condition type
public static Condition meaningOfCode(Integer code) {return BY_LABEL.get(code);}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "LogicCondition createLogicCondition();", "cn.infinivision.dataforce.busybee.pb.meta.Expr getCondition();", "java.lang.String getCondition();", "private void parseCondition() {\n Struct type1 = parseExpr().type;\n\n int op;\n if (RELATIONAL_OPERATORS.contains(nextToken.kind)) {\n scan();\n op = token.kind;\n } else {\n error(\"Relational operator expected\");\n op = Token.NONE;\n }\n\n int opcode;\n switch (token.kind) {\n case Token.GTR:\n opcode = Code.OP_JGT;\n break;\n case Token.GEQ:\n opcode = Code.OP_JGE;\n break;\n case Token.LESS:\n opcode = Code.OP_JLT;\n break;\n case Token.LEQ:\n opcode = Code.OP_JLE;\n break;\n case Token.EQL:\n opcode = Code.OP_JEQ;\n break;\n case Token.NEQ:\n opcode = Code.OP_JNE;\n break;\n default:\n opcode = Code.OP_TRAP;\n error(\"Illegal comparison operator\");\n break;\n }\n\n Struct type2 = parseExpr().type;\n\n if (!type1.compatibleWith(type2)) {\n error(\"Incompatible types in comparison\");\n }\n if (type1.isRefType() && type2.isRefType()) {\n if (op != Token.EQL && op != Token.NEQ) {\n error(\"Reference types can only be compared \"\n + \"for equality and inequality\");\n }\n }\n\n code.putFalseJump(opcode, 42); // Will be fixed later\n }", "public Object getCondition();", "String getCondition();", "Condition createCondition();", "com.google.protobuf.ByteString getConditionBytes();", "@Override\n\tpublic Condition convertToCondition() {\n\t\tRelation r = (type == EffectType.DISCARD)? Relation.UNEQUAL : Relation.EQUAL;\n\t\treturn new TemplateCondition(labelTemplate, valueTemplate, r);\n\t}", "@Override\n public Expression translateSyntacticSugar() {\n return new Condition(this.e1, BooleanConstant.TRUE, this.e2);\n }", "private QueryCondition buildConditionForQueryFromCondition(ParameterContext context, \r\n\t\t\tSet<String> includedTables, IConditionalQuery query, Condition condition, Object params[])\r\n\t{\r\n\t\tObject value = null;\r\n\t\t\t\t\r\n\t\t// fetch the value for current condition\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//for non-method level conditions fetch the value\r\n\t\t\tif(condition.index >= 0)\r\n\t\t\t{\r\n\t\t\t\tvalue = PropertyUtils.getProperty(context, condition.getConditionExpression());\r\n\t\t\t\t\r\n\t\t\t\tif(condition.fieldDetails != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tvalue = context.queryExecutionContext.getConversionService().convertToDBType(value, condition.fieldDetails);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//for method level conditions like null-checks and others use default value from condition\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tString strValue = condition.defaultValue;\r\n\t\t\t\t\r\n\t\t\t\t//if no repo context is specified assume empty object\r\n\t\t\t\tObject repoContext = context.queryExecutionContext.getRepositoryExecutionContext();\r\n\t\t\t\trepoContext = (repoContext != null) ? repoContext : Collections.emptyMap(); \r\n\t\t\t\t\r\n\t\t\t\t//if value is present check for expressions and replace them\r\n\t\t\t\tif(strValue != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValue = CommonUtils.replaceExpressions(repoContext, condition.defaultValue, null);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tvalue = ConvertUtils.convert(strValue, condition.fieldDetails.getField().getType());\r\n\t\t\t}\r\n\t\t} catch(Exception ex)\r\n\t\t{\r\n\t\t\tthrow new IllegalStateException(\"An error occurred while fetching condition value for expression -\" + condition.getConditionExpression(), ex);\r\n\t\t}\r\n\t\t\r\n\t\tif(value instanceof Enum)\r\n\t\t{\r\n\t\t\tvalue = \"\" + value;\r\n\t\t}\r\n\t\t\r\n\t\tQueryCondition groupHead = null;\r\n\r\n\t\t// if value is not provided, ignore current condition\r\n\t\tif(value != null || (condition.operator.isNullable() && condition.nullable))\r\n\t\t{\r\n\t\t\t// add tables and conditions to specifies query\r\n\t\t\taddTables(query, condition.table.tableCode, includedTables);\r\n\t\t\t\r\n\t\t\tgroupHead = new QueryCondition(condition.table.tableCode, condition.fieldDetails.getDbColumnName(), condition.operator, value, condition.joinOperator, condition.ignoreCase);\r\n\t\t\tgroupHead.setDataType(condition.fieldDetails.getDbDataType());\r\n\t\t}\r\n\r\n\t\t//if no group conditions are present on this query\r\n\t\tif(condition.getGroupedConditions() == null)\r\n\t\t{\r\n\t\t\treturn groupHead;\r\n\t\t}\r\n\t\t\r\n\t\taddGroupConditions(groupHead, condition.getGroupedConditions(), context, includedTables, query, params);\r\n\t\treturn groupHead;\r\n\t}", "@Override\n public ConditionType getConditionType() {\n return typeLookup.get(_cfRule.getType());\n }", "OclExpression getCondition();", "public RequestCondition<?> getCustomCondition()\n/* */ {\n/* 164 */ return this.customConditionHolder.getCondition();\n/* */ }", "public String getCondition() {\n return condition;\n }", "public String getCondition() {\n\treturn condition;\n}", "com.google.container.v1.StatusCondition.Code getCode();", "cn.infinivision.dataforce.busybee.pb.meta.ExprOrBuilder getConditionOrBuilder();", "public Condition getCondition(){\n\t\treturn this.cond;\n\t}", "Expression getCond();", "public int getConditionCode() {\n\t\t\treturn conditionCode;\n\t\t}", "public interface Conditioned {\n @Nullable\n ROSCondition getCondition();\n }", "public ExpressionNode getCondition();", "@Override\n\tpublic String getcond() {\n\t\treturn null;\n\t}", "public native boolean loadConditioner(String baseName, String name, ConditionerWrapper cw );", "private Object processCondition(SearchFieldType fieldType, SearchCondition condition) {\n String searchFieldName = Beans.toInitialLower(condition.getFieldName());\n String searchOperator = condition.getOperatorName();\n List<String> searchValue = condition.getValues();\n SearchFieldAdapter<?> fieldAdapter = metaDataSource.getBasicMetaData().getSearchFieldAdapter(fieldType);\n return fieldAdapter.populate(searchFieldName, searchOperator, searchValue);\n }", "public Condition getCondition() {\n return condition;\n }", "protected Condition parseSequenceFlowCondition(XmlElement seqFlowElement) {\n\n XmlElement conditionExprElement = seqFlowElement.getElement(\"conditionExpression\");\n\n if (conditionExprElement == null) {\n return null;\n }\n\n String expression = conditionExprElement.getText().trim();\n // Condition expressionCondition = new CheckVariableTrueCondition(expression);\n Condition expressionCondition = new JuelExpressionCondition(expression);\n return expressionCondition;\n }", "ConditionFactory getConditionFactory();", "public String getCondition() {\n\t\treturn condition;\n\t}", "@Override\n\tpublic void setcond(String cond) {\n\t\n\t}", "BaseCondition createBaseCondition();", "protected Expression analyzeCondition() throws AnalysisException {\n final var condition = analyzeExpression();\n assertKeyWord(ScriptBasicKeyWords.KEYWORD_THEN);\n return condition;\n }", "public void setCondition(String condition) {\n\tthis.condition = condition;\n}", "public void setConditionCode(int conditionCode) {\n\t\t\tthis.conditionCode = conditionCode;\n\t\t}", "public Conditional(){\n\t\tint m,n;\n\t\tLexer.lex();//skip over \"if\"\n\t\tLexer.lex();//skip over '('\n\t\tcpr=new ComparisonExpr();\n\t\tLexer.lex();//skip over ')'\n\t\tswitch(cpr.op){\n\t\tcase '<':\n\t\t\tCode.gen(\"if_icmpge \");\n\t\t\tbreak;\n\t\tcase '>':\n\t\t\tCode.gen(\"if_icmple \");\n\t\t\tbreak;\n\t\tcase '=':\n\t\t\tCode.gen(\"if_icmpne \");\n\t\t\tbreak;\n\t\tcase '!':\n\t\t\tCode.gen(\"if_icmpeq \");\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\tn=Code.getPtr();\n\t\tCode.gen(\"\");\n\t\tCode.gen(\"\");\n\t\tstmt=new Statement();\n\t\tif(Lexer.nextToken==Token.KEY_ELSE){//have an else part\n\t\t\tCode.gen(\"goto \");\n\t\t\tm=Code.getPtr();\n\t\t\tCode.gen(\"\");\n\t\t\tCode.gen(\"\");\n\t\t\tCode.backpatch(n, Integer.toString(Code.getPtr()));\n\t\t\tLexer.lex();\n\t\t\tstmtr=new Statement();\n\t\t\tCode.backpatch(m, Integer.toString(Code.getPtr()));\n\t\t}else{\n\t\t\tCode.backpatch(n, Integer.toString(Code.getPtr()));\n\t\t}\n\t\t\n\t}", "public static Condition createCondition(Patient patient, Encounter encounter, String conditionTypeCode,\n String conditionTypeDisplay, String date){\n // Create a condition object\n Condition condition = new Condition();\n\n // Set Identifier of the condition object\n condition.addIdentifier()\n .setSystem(\"http://www.kh-uzl.de/fhir/condition\")\n .setValue(UUID.randomUUID().toString());\n\n // Set clinical status of the condition\n condition.setClinicalStatus(new CodeableConcept()\n .addCoding(new Coding()\n .setCode(\"active\")\n .setSystem(\"http://terminology.hl7.org/CodeSystem/condition-clinical\")\n .setDisplay(\"Active\")));\n\n // Set verification status of the condition\n condition.setVerificationStatus(new CodeableConcept()\n .addCoding(new Coding()\n .setCode(\"confirmed\")\n .setSystem(\"http://terminology.hl7.org/CodeSystem/condition-ver-status\")\n .setDisplay(\"Confirmed\")));\n\n // Set Identification of the condition, problem or diagnosis\n condition.setCode(new CodeableConcept()\n .addCoding(new Coding()\n .setCode(conditionTypeCode)\n .setSystem(\"http://snomed.info/sct\")\n .setDisplay(conditionTypeDisplay)));\n\n // Set reference to a patient, that the condition belongs to\n condition.setSubject(new Reference()\n .setIdentifier(patient.getIdentifierFirstRep())\n .setReference(patient.fhirType() + \"/\" + patient.getId()));\n\n // Set reference to an encounter, the condition was part of\n condition.setEncounter(new Reference()\n .setIdentifier(encounter.getIdentifierFirstRep())\n .setReference(encounter.fhirType() + \"/\" + encounter.getId()));\n\n // Set date when the condition was first recorded\n condition.setRecordedDateElement(new DateTimeType(date));\n\n return condition;\n }", "int getConditionValue();", "Expr getCond();", "public Expression getCondition()\n {\n return this.condition;\n }", "public native ConditionerTemplate getConditioner(int idx);", "OverallCondition(String condition) {\n this.condition = condition;\n }", "public SimpleCondition() {\n\n\t}", "public Cond cond() {\n Cond c = new Cond();\n c.setExpr1(expr());\n c.setOp(compop());\n c.setExpr2(expr());\n \n String type1 = c.getExpr1().getType(symbolTable);\n String type2 = c.getExpr2().getType(symbolTable);\n \n if(type1 != null && type2 != null){\n if(!type1.equals(type2)){\n error.warning(\"Trying to compare a \"+type1+\" with a \"+type2);\n }\n } else\n error.show(\"Trying to make comparison with a variable(s) that hasn't been declared\");\n \n return c;\n }", "public Condition loadCondition( ObjectId id_condition ) throws KettleException {\n Condition condition = new Condition();\n\n try {\n RowMetaAndData r = getCondition( id_condition );\n if ( r != null ) {\n condition.setNegated( r.getBoolean( \"NEGATED\", false ) );\n condition.setOperator( Condition.getOperator( r.getString( \"OPERATOR\", null ) ) );\n\n long conditionId = r.getInteger( \"ID_CONDITION\", -1L );\n if ( conditionId > 0 ) {\n condition.setObjectId( new LongObjectId( conditionId ) );\n } else {\n condition.setObjectId( null );\n }\n\n ObjectId[] subids = repository.getSubConditionIDs( condition.getObjectId() );\n if ( subids.length == 0 ) {\n condition.setLeftValuename( r.getString( \"LEFT_NAME\", null ) );\n condition.setFunction( Condition.getFunction( r.getString( \"CONDITION_FUNCTION\", null ) ) );\n condition.setRightValuename( r.getString( \"RIGHT_NAME\", null ) );\n\n long id_value = r.getInteger( \"ID_VALUE_RIGHT\", -1L );\n if ( id_value > 0 ) {\n ValueMetaAndData v = repository.loadValueMetaAndData( new LongObjectId( id_value ) );\n condition.setRightExact( v );\n }\n } else {\n for ( int i = 0; i < subids.length; i++ ) {\n condition.addCondition( loadCondition( subids[i] ) );\n }\n }\n\n return condition;\n } else {\n throw new KettleException( \"Condition with id_condition=\"\n + id_condition + \" could not be found in the repository\" );\n }\n } catch ( KettleException dbe ) {\n throw new KettleException(\n \"Error loading condition from the repository (id_condition=\" + id_condition + \")\", dbe );\n }\n }", "public interface Condition {\n /** Return the condition state. */\n boolean test();\n /** Return a description of what the condition is testing. */\n String toString();\n}", "public IfCondition() {\r\n super();\r\n }", "@Override\n\tpublic String getCondition() {\n\t\treturn \"\";\n\t}", "Conditional createConditional();", "private int addCondition(Question q)\n\t{\n\t\tString condition = \"NOT(\";\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tList<Element> cond_elements = doc.selectNodes(\"//document/conditions/rows/row[qid=\" + q.getQid() + \"]\");\n\t\tint i = 0;\n\t\tfor (Element c : cond_elements) {\n\t\t\ti++;\n\t\t\tPattern ans_p = Pattern.compile(\"^\\\\d+X(\\\\d+)X(.+?)$\");\n\t\t\tMatcher match = ans_p.matcher(c.elementText(\"cfieldname\"));\n\t\t\tmatch.find();\n\t\t\tString cond_str = \"(\";\n\t\t\tString path = \"$(SE-\" + prop.getProperty(\"dummy.study_event_oid\") + \"/F-\" + survey.getId() + \"/IG-\" + match.group(1) + \"/I-\" + match.group(2) + \")\";\n\n\t\t\tif (c.elementText(\"method\").equals(\"RX\")) {\n\t\t\t\tcond_str += \"MATCH(\";\n\n\t\t\t\tString regex = c.elementText(\"value\");\n\t\t\t\tint regex_length = regex.length();\n\t\t\t\t// Remove beginning whitespace\n\t\t\t\tregex = regex.substring(1, regex_length);\n\n\t\t\t\tcond_str += (regex + \", \" + path + \")\");\n\t\t\t} else {\n\t\t\t\tcond_str += path;\n\t\t\t\tString val = c.elementText(\"value\");\n\t\t\t\tcond_str += (c.elementText(\"method\") + (val.equals(\"\") ? \"NULL\" : val));\n\t\t\t}\n\n\t\t\tcond_str += \")\";\n\t\t\tcondition = condition.concat(cond_str);\n\t\t\tcondition = condition.concat(i < cond_elements.size()? \" AND \" : \")\");\n\t\t}\n\n\t\tif (cond_elements.size() != 0) {\n\t\t\tsurvey.addCondition(new Condition(prop.getProperty(\"imi.syntax_name\"), q.getQid().concat(prop.getProperty(\"ext.cond\")), condition));\n\t\t\tq.setCond(q.getQid().concat(prop.getProperty(\"ext.cond\")));\n\t\t\treturn 0;\n\t\t}\n\t\treturn -1;\n\t}", "public Condition(ConditionManager condition)\r\n\t{\r\n\t\tthis.condition = condition;\r\n\t\tinit();\r\n\t}", "public abstract Builder customCondition(RequestCondition<?> paramRequestCondition);", "public T caseCondition(Condition object) {\n\t\treturn null;\n\t}", "protected void sequence_Condition(ISerializationContext context, Condition semanticObject) {\r\n\t\tif (errorAcceptor != null) {\r\n\t\t\tif (transientValues.isValueTransient(semanticObject, GoPackage.Literals.CONDITION__EXP) == ValueTransient.YES)\r\n\t\t\t\terrorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, GoPackage.Literals.CONDITION__EXP));\r\n\t\t}\r\n\t\tSequenceFeeder feeder = createSequencerFeeder(context, semanticObject);\r\n\t\tfeeder.accept(grammarAccess.getConditionAccess().getExpExpressionParserRuleCall_1_0(), semanticObject.getExp());\r\n\t\tfeeder.finish();\r\n\t}", "private Object processConditionForSearchRecord(Object searchRecord, SearchCondition condition) {\n String fieldName = Beans.toInitialLower(condition.getFieldName());\n BeanInfo beanInfo = Beans.getBeanInfo(searchRecord.getClass());\n Class<?> searchFieldClass = beanInfo.getProperty(fieldName).getWriteType();\n SearchFieldType fieldType = SearchFieldType.getByFieldTypeName(searchFieldClass.getSimpleName());\n return processCondition(fieldType, condition);\n }", "public String getCondition(int nodeStatus) {\n\n String condition = null;\n /* if relation node then need to check only the conditions that are associated with only one relation */\n if (nodeStatus == RELATION_NODE_STATUS) {\n for (Map.Entry<String, LinkedList<String>> entry : optimizedWhere.entrySet())\n //If relation node then condition will be associated with only one node.\n if (entry.getValue().size() == 1)\n if (associatedRelations.get(0).equalsIgnoreCase(entry.getValue().get(0))) {\n condition = entry.getKey();\n optimizedWhere.remove(entry.getKey());\n return condition;\n }\n }\n //if it's a cartesian node then for evert condition with 2 relations associated-> check if there is a match in the associatedRelations list\n else if (nodeStatus == CARTESIAN_NODE_STATUS)\n for(Map.Entry<String, LinkedList<String>> entry: optimizedWhere.entrySet())\n\n //If two relations are associated then only then do the check if both relations are elements of the list if yes then return condition\n if (entry.getValue() != null && entry.getValue().size() == 2)\n for (int i = 0; i < associatedRelations.size(); i++) {\n //if we have a match with the association list we get the index of the second element in the entry list\n if (entry.getValue() != null && entry.getValue().contains(associatedRelations.get(i))) {\n\n int indexOfCurrent = entry.getValue().indexOf(associatedRelations.get(i));\n int otherIndex;\n if (indexOfCurrent == 1) otherIndex = 0;\n else otherIndex = 1;\n /*check if the second element of the entry list is a relation included in the associatedRelation list if yes then there is a condition\n * if there is already a condition in that node then add AND Also set the entry value to null so that it won't be checked again*/ //-> cannot delete because get exception !!\n\n if (associatedRelations.contains(entry.getValue().get(otherIndex))) {\n if(condition == null) condition = entry.getKey();\n else\n condition = condition + \" AND \" + entry.getKey();\n entry.setValue(null);\n }\n }\n }\n return condition;\n }", "public SCondition(Node node) {\n super(node);\n }", "VariantConditionModel createInstanceOfVariantConditionModel();", "@Override\r\n\tpublic void visit(ConditionExpression conditionExpression) {\n\r\n\t}", "public void visit(ConditionElement1 conditionElement1) {\n\t\t\n\t\t// if a != 0, jmp true1\n\t\tCode.loadConst(0);\n\t\tCode.put(Code.jcc+Code.ne);\n\t\tCode.put2(11);\n\t\t\n\t\t// if b != 0, jmp true2\n\t\tCode.loadConst(0);\n\t\tCode.put(Code.jcc + Code.ne);\n\t\tCode.put2(8);\n\t\t\n\t\t// false: put 0,jmp next \n\t\tCode.loadConst(0);\n\t\tCode.put(Code.jmp);\n\t\tCode.put2(5);\n\t\t\n\t\t// true1\n\t\tCode.put(Code.pop);\n\t\t\n\t\t// true2\n\t\tCode.loadConst(1);\n\t\t\n\t\t// next\n\t}", "io.grpc.user.task.PriceCondition getCondition();", "condition getConditionAllocution();", "public interface ICondition\n{\n\n /**\n * called when we are sure we are done with this condition\n */\n public void dispose();\n\n /**\n * attempt to clone this condition before it will be bound in the\n * instantiation phase. We pass the current bindings so that the condition can\n * do an early rejection if possible.\n * \n * @param model\n * @param variableBindings\n * @return a writable copy of the condition that will be bound\n * @throws CannotMatchException\n * if there is no way this condition can be matched\n */\n public ICondition clone(IModel model, Map<String, Object> variableBindings)\n throws CannotMatchException;\n\n /**\n * Iteratively perform the resolution and binding for this condition. If this\n * condition defines any variables, they are placed into the bindings map for\n * other conditions to exploit. Similarly, it will resolve any bindings that\n * it needs in order to be matched. If at any point the condition determines\n * that it cannot be matched, the exception is to be thrown. Similarly, if\n * isIterative is false, and there are unresolved bindings, the exception\n * should be thrown. <br>\n * Otherwise, the number of unresolved bindings is returned which allows the\n * instantiation calculation determine if another resolution round is\n * required.\n * \n * @return number of unresolved variables\n */\n public int bind(IModel model, Map<String, Object> variableBindings,\n boolean isIterative) throws CannotMatchException;\n}", "public int getCondition() {\r\n\t\tif(this.condition == null){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn this.condition.ordinal();\r\n\t}", "BooleanComponentDTO retrieveCouponCodeCondition(final List<RuleCondition> conditions) {\n\t\tfor (RuleCondition condition : conditions) {\n\t\t\tif (RuleElementType.LIMITED_USE_COUPON_CODE_CONDITION.equals(condition.getElementType())) {\n\t\t\t\tfinal ConditionDTO conditionDto = new ConditionDTO();\n\t\t\t\tconditionAdapter.populateDTO(condition, conditionDto);\n\t\t\t\tconditions.remove(condition);\n\t\t\t\treturn conditionDto;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "FilterCondition createFilterCondition(int clueNum);", "public static RegisterModuleType codeOf(Object code) {\n if (code == null) { return null; }\n if (code instanceof RegisterModuleType) { return (RegisterModuleType)code; }\n return _codeValueMap.get(code.toString().toLowerCase());\n }", "public String getConditionFromState(String state) {\n if (state2conditionMapping.containsKey(state)) {\n return state2conditionMapping.get(state);\n }\n return null;\n }", "Condition(Column col1, String relation, Column col2) {\n // YOUR CODE HERE\n }", "public Classification codeOf(Object code) {\n throw new IllegalStateException(\"Unknown definition: \" + this); // basically unreachable\n }", "public interface Condition {\n boolean isSatisfied();\n}", "public void setCondition(Expression condition)\n {\n this.condition = condition;\n }", "private void ensureConditionContinuity( )\n {\n /* If the operators are not valid, then do not move the conditions */\n if ( checkOperators() )\n {\n /*\n * When Left Hand Side, Operator and Right Hand Side for a Condition\n * are empty then infer the default value, i.e., set Operator to\n * CVL_WF_OPRSImpl.EQUAL. Left Hand Side and Right Hand Side will continue\n * to remain empty.\n */\n defaultForEmptyConditions();\n\n int liCount = 0;\n int liNumber = 0 ;\n int liCurrentRow = 0;\n Data loNewData = null ;\n Data loOldData = null ;\n\n /* Cycle through the conditions. Make sure the conditions in front */\n /* of current condition are not blank, if so, move current condition up */\n\n for (liCount = 2; liCount < 6; liCount++ )\n {\n liNumber = liCount ;\n while (liNumber > 1)\n {\n liCurrentRow = liCount - ( liNumber - 1 );\n if (getAND_COND_LHS(liCurrentRow) == null)\n {\n /*\n * copy old condition to new condition, or condition 2 to 1 ...\n * first get data from new left hand side, and get data from\n * old left hand side, and copy new to old. Repeat for right\n * hand side , operator and Condition Type.\n */\n\n loNewData = getData(\"AND_COND_LHS_\" + liCount ) ;\n loOldData = getData(\"AND_COND_LHS_\" + liCurrentRow ) ;\n loOldData.setString(loNewData.getString() );\n loNewData = getData(\"AND_COND_RHS_\" + liCount ) ;\n loOldData = getData(\"AND_COND_RHS_\" + liCurrentRow ) ;\n loOldData.setString(loNewData.getString() );\n loNewData = getData(\"AND_COND_RHS_FLD_\" + liCount ) ;\n loOldData = getData(\"AND_COND_RHS_FLD_\" + liCurrentRow ) ;\n loOldData.setString(loNewData.getString() );\n loNewData = getData(\"AND_COND_OPR_\" + liCount ) ;\n loOldData = getData(\"AND_COND_OPR_\" + liCurrentRow ) ;\n loOldData.setbyte(loNewData.getbyte() );\n loNewData = getData(\"AND_COND_TYP_\" + liCount ) ;\n loOldData = getData(\"AND_COND_TYP_\" + liCurrentRow ) ;\n loOldData.setint(loNewData.getint() );\n /*\n * reset the old condition back to null ,operator to default 3\n * and Condition type to 1 (i.e. Actual Value)\n */\n loNewData = getData(\"AND_COND_LHS_\" + liCount ) ;\n loNewData.setString(null);\n loNewData = getData(\"AND_COND_RHS_\" + liCount ) ;\n loNewData.setString(null);\n loNewData = getData(\"AND_COND_RHS_FLD_\" + liCount ) ;\n loNewData.setString(null);\n loNewData = getData(\"AND_COND_OPR_\" + liCount ) ;\n loNewData.setbyte((byte)3);\n loNewData = getData(\"AND_COND_TYP_\" + liCount ) ;\n loNewData.setint(CVL_WF_COND_TYPImpl.ACTUAL_VAL);\n\n } /* end if (getAND_COND_LHS(liCurrentRow) == null) */\n\n liNumber-- ;\n\n } /* end while (liNumber > 1) */\n } /* end for (liCount = 2; liCount < 6; liCount++ ) */\n } /* end if ( checkOperators() ) */\n }", "public interface IConditionBuilder {\n \n public <T> ICondition<T> list( ICondition<T>... list );\n \n public <T> ICondition<T> not( ICondition<T> condition );\n \n public <T> ICondition<T> and( ICondition<T> left, ICondition<T> right );\n \n public <T> ICondition<T> or( ICondition<T> left, ICondition<T> right );\n \n public <T> ICondition<T> keywordMatch( String keyword );\n \n public <T> ICondition<T> numberMatch( String number );\n \n}", "public static UpdateModuleType codeOf(Object code) {\n if (code == null) { return null; }\n if (code instanceof UpdateModuleType) { return (UpdateModuleType)code; }\n return _codeValueMap.get(code.toString().toLowerCase());\n }", "@Override UpodCondition getConditionTest(UpodProgram pgm) {\n return null;\n }", "public ArrayList<Byte> generateConditionBlockCode(ConditionBlock cb) {\n if ((cb.getActions().getChildren().size() == 0) || (cb.getCondition().getChildren().size() == 0)) {\n return null;\n }\n\n Block acBlock = (Block) cb.getActions().getChildren().get(0);\n Block conBlock = (Block) cb.getCondition().getChildren().get(0);\n\n ArrayList<Byte> cmdArr1 = new ArrayList<>();\n ArrayList<Byte> cmdArr2 = new ArrayList<>();\n ArrayList<Byte> cmdArr3 = new ArrayList<>();\n\n //starting action\n char instruction = 'b';\n int address = acBlock.getCapability().getDevice().getAddress();\n char cmdChar = acBlock.getCapability().getExeCommand().charAt(0);\n char cmdChar1 = acBlock.getCapability().getExeCommand().charAt(1);\n\n cmdArr1.add((byte) instruction);\n cmdArr1.add((byte) address);\n cmdArr1.add((byte) cmdChar);\n cmdArr1.add((byte) cmdChar1);\n //prepending command length parameter\n cmdArr1.add(0, (byte) (cmdArr1.size() + 1));\n\n //checking condition or sense\n instruction = 'c';\n address = conBlock.getCapability().getDevice().getAddress();\n cmdChar = conBlock.getCapability().getExeCommand().charAt(0);\n cmdChar1 = conBlock.getCapability().getExeCommand().charAt(1);\n char compType = conBlock.getCapability().getCompType().charAt(0);\n\n cmdArr2.add((byte) instruction);\n cmdArr2.add((byte) address);\n cmdArr2.add((byte) compType);\n short jumpAdd = 0;\n byte[] jumpArr = shortToByteArray(jumpAdd);\n for (byte b : jumpArr) {\n cmdArr2.add(b);\n }\n short respSize = Short.parseShort(conBlock.getCapability().getRespSize());\n byte[] respArr = shortToByteArray(respSize);\n cmdArr2.add(respArr[0]);\n// for(byte b:respArr){\n// cmdArr2.add(b);\n// }\n int refVal = Integer.parseInt(conBlock.getCapability().getRefValue());\n if (conBlock.getCapability().getType().equals(Capability.CAP_CONDITION)) {\n refVal = Integer.parseInt(conBlock.getTextField().getText());\n }\n byte[] refArr = intToByteArray(refVal);\n for (int i = 0; i < respSize; i++) {\n cmdArr2.add(refArr[i]);\n }\n cmdArr2.add((byte) cmdChar);\n cmdArr2.add((byte) cmdChar1);\n //prepending command length parameter\n cmdArr2.add(0, (byte) (cmdArr2.size() + 1));\n\n //terminating action\n instruction = 'b';\n address = acBlock.getCapability().getDevice().getAddress();\n cmdChar = acBlock.getCapability().getStopCommand().charAt(0);\n cmdChar1 = acBlock.getCapability().getStopCommand().charAt(1);\n cmdArr3.add((byte) instruction);\n cmdArr3.add((byte) address);\n cmdArr3.add((byte) cmdChar);\n cmdArr3.add((byte) cmdChar1);\n //prepending command length parameter\n cmdArr3.add(0, (byte) (cmdArr3.size() + 1));\n\n //merging lists together\n cmdArr1.addAll(cmdArr2);\n cmdArr1.addAll(cmdArr3);\n return cmdArr1;\n }", "private interface CheckedConditionRunnable {\n void run(Condition c) throws Exception;\n }", "private void setConditionalCode(BitString word){\n\t\tif(word.getValue2sComp() > 0){\n\t\t\tmCC.setBits(new char[] {'0', '0', '1'});\n\t\t} else if(word.getValue2sComp() < 0){\n\t\t\tmCC.setBits(new char[] {'1', '0', '0'});\n\t\t} else {\n\t\t\tmCC.setBits(new char[] {'0', '1', '0'});\n\t\t}\n\t}", "private boolean executionCondition(String condition) {\r\n\r\n\t\tboolean result = false;\r\n\t\tif (condition != null) {\r\n\t\t\ttry {\r\n\t\t\t\tresult = Boolean.parseBoolean(ExecutScript(getScriptOfParameters(), getScriptOfValuesAsObjects(),\r\n\t\t\t\t\t\t\"return (\" + condition + \")\").toString());\r\n\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tsetResultstype(resultstype.Failure);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public Filter condition();", "public static Condition makeCondition(TreeNode root) {\n return new Condition(root);\n }", "Event getCondition();", "ConditionNameReference createConditionNameReference();", "public static MatHang_DTO selectCondition(String string) throws ClassNotFoundException, SQLException {\n\t\treturn dal.selectCondition(string);\n\t}", "public ContractValue getCondition(int argumentIndex) {\n ContractValue left;\n if (this == NULL_VALUE || this == NOT_NULL_VALUE) {\n left = ContractValue.nullValue();\n }\n else if (this == TRUE_VALUE || this == FALSE_VALUE) {\n left = ContractValue.booleanValue(true);\n }\n else {\n return ContractValue.booleanValue(true);\n }\n return ContractValue.condition(left, RelationType.equivalence(!shouldUseNonEqComparison()), ContractValue.argument(argumentIndex));\n }", "@Override\n\tpublic Condition newCondition() {\n\t\treturn null;\n\t}", "@Override\n\tpublic Condition newCondition() {\n\t\treturn null;\n\t}", "private EndConditionTypes(int value, String name, String literal)\n {\n this.value = value;\n this.name = name;\n this.literal = literal;\n }", "Boolean conditionResult();", "public Cond newCond() {\n return new Cond();\n }", "public Condition(Node n) {\n\t// get the page item properties\n\tsuper(n);\n\ttry {\n\t // assign various attributes\n\t NodeList subnodes = n.getChildNodes();\n\t Node node1 = subnodes.item(1);\n\t Node node2 = subnodes.item(3);\n\t Node node3 = subnodes.item(5);\n\t String node1_name = node1 != null ? node1.getNodeName() : \"\";\n\t String node2_name = node2 != null ? node2.getNodeName() : \"\";\n\t String node3_name = node3 != null ? node3.getNodeName() : \"\";\n\n\t // option 1: if the Condition is a leaf node, first node is a\n\t // \"field\"\n\t if (node1_name.equalsIgnoreCase(\"field\")) {\n\t\t// parse the leaf node\n\t\t// note XML Schema enforces order of: field, operator, (constant\n\t\t// OR field)\n\t\tpre_field = node1.getFirstChild().getNodeValue();\n\t\tjs_expression.append(\"(a['\" + pre_field + \"']\");\n\t\tif (pre_field.equals(\"\"))\n\t\t throw new Exception(\n\t\t\t \"Invalid Precondition: Empty field name before \"\n\t\t\t\t + node2_name);\n\t\t// represent comparison operator as integer, since eval needs\n\t\t// 'switch,' which can't take strings\n\t\tif (node2_name.equalsIgnoreCase(\"gt\")) {\n\t\t operatr_int = 11;\n\t\t js_expression.append(\" > \");\n\t\t} else if (node2_name.equalsIgnoreCase(\"lt\")) {\n\t\t operatr_int = 12;\n\t\t js_expression.append(\" < \");\n\t\t} else if (node2_name.equalsIgnoreCase(\"geq\")) {\n\t\t operatr_int = 13;\n\t\t js_expression.append(\" >= \");\n\t\t} else if (node2_name.equalsIgnoreCase(\"leq\")) {\n\t\t operatr_int = 14;\n\t\t js_expression.append(\" <= \");\n\t\t} else if (node2_name.equalsIgnoreCase(\"eq\")) {\n\t\t operatr_int = 15;\n\t\t js_expression.append(\" = \");\n\t\t} else if (node2_name.equalsIgnoreCase(\"neq\")) {\n\t\t operatr_int = 16;\n\t\t js_expression.append(\" != \");\n\t\t} else\n\t\t throw new Exception(\"Invalid operator in Precondition: \"\n\t\t\t + node2_name);\n\t\t// obtain the value for comparison\n\t\tif (node3_name.equalsIgnoreCase(\"cn\")) {\n\t\t String const_str = node3.getFirstChild().getNodeValue();\n\t\t if (const_str != null) {\n\t\t\tint_constant = new Integer(const_str);\n\t\t\tjs_expression.append(const_str);\n\t\t\tjs_expression.append(\")\");\n\t\t }\n\t\t} else if (node3_name.equalsIgnoreCase(\"field\")) {\n\t\t pre_field_second = node3.getFirstChild().getNodeValue();\n\t\t js_expression.append(pre_field_second);\n\t\t js_expression.append(\")\");\n\t\t if (pre_field_second.equals(\"\"))\n\t\t\tthrow new Exception(\n\t\t\t\t\"Invalid Precondition: Empty field name after \"\n\t\t\t\t\t+ node1_name);\n\t\t} else\n\t\t throw new Exception(\"Invalid comparator in Precondition: \"\n\t\t\t + node3_name);\n\t }\n\t // option 2, syntax: apply, and|or, apply\n\t else if (node1_name.equalsIgnoreCase(\"apply\")) {\n\t\t// recursively parse the nested preconditions\n\t\tcond = new Condition(node1); // the apply node is itself a\n\t\t\t\t\t // predicate\n\t\tjs_expression.append(cond.getJs_expression());\n\t\tif (node2_name.equalsIgnoreCase(\"and\")) {\n\t\t operatr_int = 1;\n\t\t js_expression.append(\" && \");\n\t\t} else if (node2_name.equalsIgnoreCase(\"or\")) {\n\t\t operatr_int = 2;\n\t\t js_expression.append(\" || \");\n\t\t} else\n\t\t throw new Exception(\n\t\t\t \"Invalid boolean operator in Precondition: \"\n\t\t\t\t + node2_name);\n\t\t// recursively parse the 2nd apply node - another nested\n\t\t// precondition\n\t\tif (node3_name.equalsIgnoreCase(\"apply\")) {\n\t\t cond2 = new Condition(node3);\n\t\t js_expression.append(cond2.getJs_expression());\n\t\t}\n\n\t\telse\n\t\t throw new Exception(\n\t\t\t \"Invalid righthand predicate in Precondition: \"\n\t\t\t\t + node3_name);\n\t } else\n\t\tthrow new Exception(\"Invalid Precondition node starting at: \"\n\t\t\t+ node1_name);\n\n\t}// end of try\n\tcatch (Exception e) {\n\t WISE_Application.log_error(\n\t\t \"WISE - CONDITION parse: \" + e.toString(), null);\n\t return;\n\t}\n }", "@Override\n public void codeGenBoolExpr(DecacCompiler compiler, boolean condToranch, Label label) {\n }", "public int getAND_COND_TYP(int fiIndex)\n {\n switch (fiIndex)\n {\n case 1 :\n return getAND_COND_TYP_1();\n case 2 :\n return getAND_COND_TYP_2();\n case 3 :\n return getAND_COND_TYP_3();\n case 4 :\n return getAND_COND_TYP_4();\n case 5 :\n return getAND_COND_TYP_5();\n default :\n return -1 ;\n } /* end switch ( fiIndex ) */\n }", "public String conToString(Condition condition) {\n if (condition instanceof LaxCondition) {\n return conToString((LaxCondition) condition);\n } else if (condition instanceof AndCondition) {\n return conToString((AndCondition) condition);\n } else if (condition instanceof OrCondition) {\n return conToString((OrCondition) condition);\n } else if (condition instanceof ImpliesCondition) {\n return conToString((ImpliesCondition) condition);\n }\n //shouldn't happen\n assert false;\n return null;\n }", "public final void mT__33() throws RecognitionException {\n try {\n int _type = T__33;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // ../org.xtext.example.mydslsample/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDslSample.g:33:7: ( 'Condition' )\n // ../org.xtext.example.mydslsample/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDslSample.g:33:9: 'Condition'\n {\n match(\"Condition\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public String getConditiondescription() {\r\n return conditiondescription;\r\n }", "public Condition newCondition() {\r\n throw new java.lang.UnsupportedOperationException();\r\n }", "private static void convertBinaryConditionsToZ3(Map<QuerySolution, ProgramConditionTruthValue> resultList, Context ctx, Solver solver, ProgInfo pi, QueryAndProgram qap) {\n\n IntExpr val = null;\n int intValue;\n\n for (QuerySolution qs : resultList.keySet()) {\n String expNode = qs.get(\"exp\").toString();\n RDFNode varNode = qs.get(\"var\");\n RDFNode opNode = qs.get(\"op\");\n RDFNode valNode = qs.get(\"val\");\n RDFNode dataTypeNode = qs.get(\"dataType\");\n /* String psAtCondition = qs.get(\"ps\").toString();//ps of the variable at the condition\n //In a particular path\n //If the program state of a variable at qp \n // is different from the ps of the variable at the condition\n // then the condition is no longer valid for that qp in that path\n Boolean diff = pi.variableValues.stream().anyMatch(p -> \n !p.get(\"ps\").toString().equals(psAtCondition)\n && p.get(\"qp\").toString().equals(qap.queryPoint)\n && p.get(\"var\").toString().equals(varNode.toString()));\n if(diff)\n continue;\n */\n if (pi.invalidCondtions != null && pi.invalidCondtions.stream().anyMatch(p\n -> p.get(\"qp\").toString().equals(qap.queryPoint)\n && p.get(\"invalidCond\").toString().equals(expNode)\n && qap.getPaths().stream().anyMatch(q -> q.pathId.equals(p.get(\"pathId\").toString()))\n && p.get(\"queryLoc\").toString().equals(qap.qtp.queryLoc)\n )) {\n continue;\n }\n\n intValue = Utils.extractIntFromRdfLiteral(valNode.toString());\n if (intValue != -999) {\n val = ctx.mkInt(intValue);\n\n }\n\n Utils.addEntitiesToSolver(ctx, varNode, val, opNode, solver, resultList.get(qs));\n }\n }", "public abstract String\n conditional();" ]
[ "0.66068965", "0.645871", "0.6372806", "0.62830335", "0.62265587", "0.62232363", "0.6214752", "0.6125407", "0.6118612", "0.6076429", "0.5961965", "0.5908548", "0.58945113", "0.5873867", "0.585431", "0.57928354", "0.5782552", "0.5770629", "0.57616055", "0.5747374", "0.5713602", "0.5661921", "0.56599104", "0.5620264", "0.5620049", "0.56142646", "0.55805063", "0.5577712", "0.5571125", "0.55606586", "0.5560419", "0.5553119", "0.55178875", "0.55173695", "0.5512826", "0.5478039", "0.54771566", "0.5476828", "0.5462859", "0.54477215", "0.54269713", "0.540665", "0.5404304", "0.5381193", "0.5371516", "0.5340674", "0.5325065", "0.5320235", "0.53184664", "0.53178847", "0.53169644", "0.5309488", "0.52998286", "0.5282904", "0.5254313", "0.525357", "0.5250388", "0.52282494", "0.52224094", "0.5202246", "0.52002066", "0.5189496", "0.51872313", "0.51858354", "0.5182536", "0.5170802", "0.51706463", "0.516262", "0.51499915", "0.5147347", "0.51472616", "0.5134526", "0.5128086", "0.5118482", "0.51059073", "0.5102002", "0.5093566", "0.5075626", "0.5071851", "0.50689715", "0.505496", "0.50391", "0.50288486", "0.5025624", "0.5021449", "0.50210416", "0.5000071", "0.5000071", "0.4998377", "0.4996898", "0.49904278", "0.49901584", "0.49892667", "0.49826524", "0.49816683", "0.4978255", "0.49749374", "0.4971943", "0.49666178", "0.49459046" ]
0.63443244
3
pDialog = new ProgressDialog(this); pDialog.setCancelable(false); pDialog.setMessage("Loading ..."); pDialog.show();
private void getData(){ UserAPIService api = Config.getRetrofit().create(UserAPIService.class); Call<Value> call = api.getJSON(); call.enqueue(new Callback<Value>() { @Override public void onResponse(Call<Value> call, Response<Value> response) { // pDialog.dismiss(); String value1 = response.body().getStatus(); if (value1.equals("1")) { Value value = response.body(); resultAlls = new ArrayList<>(Arrays.asList(value.getResult())); adapter = new RecyclerAdapterListAll(resultAlls, getApplicationContext()); recyclerView.setAdapter(adapter); }else{ Toast.makeText(ListPonpesActivity.this,"Maaf Data Tidak Ada",Toast.LENGTH_SHORT).show(); } } @Override public void onFailure(Call<Value> call, Throwable t) { // pDialog.dismiss(); Toast.makeText(ListPonpesActivity.this,"Respon gagal",Toast.LENGTH_SHORT).show(); Log.d("Hasil internet",t.toString()); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void showProgressDialog(){\n progressDialog=ProgressDialog.show(context,\"\",\"Loading...Please wait...\");\n\n\n }", "private Dialog buildLoadingDialog() {\n ProgressDialog dialog = new ProgressDialog(this);\n dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n dialog.setMessage(getText(R.string.dialog_loading));\n dialog.setIndeterminate(true);\n dialog.setCancelable(false);\n return dialog;\n }", "protected void showLoading()\n {\n progressBar = new ProgressDialog(this);\n progressBar.setTitle(\"Loading\");\n progressBar.setMessage(\"Wait while loading...\");\n progressBar.setCancelable(false); // disable dismiss by tapping outside of the dialog\n progressBar.show();\n }", "private void creatDialog() {\n \t mDialog=new ProgressDialog(this);\n \t mDialog.setTitle(\"\");\n \t mDialog.setMessage(\"正在加载请稍后\");\n \t mDialog.setIndeterminate(true);\n \t mDialog.setCancelable(true);\n \t mDialog.show();\n \n\t}", "@Override\n protected void onPreExecute() {\n\n dialog = new ProgressDialog(context);\n dialog.setTitle(\"Loading Contents\");\n dialog.setMessage(\"Doing something interesting ...\");\n dialog.setIndeterminate(true);\n dialog.setCancelable(false);\n dialog.show();\n }", "public void showProgressDialog() {\r\n progressDialog.setMessage(getResources().getString(R.string.text_loading));\r\n progressDialog.setCancelable(false);\r\n progressDialog.show();\r\n }", "@Override\n\t\tprotected void onPreExecute()\n\t\t{\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog = new ProgressDialog(MainActivity.this);\n\t\t\tpDialog.setMessage(\"Loading....\");\n\t\t\tpDialog.setCancelable(true);\n\t\t\tpDialog.show();\n\t\t}", "protected void onPreExecute() {\r\n \tdialog = new ProgressDialog(context);\r\n \t\tdialog.setMessage(\"Loading...\");\r\n \t\tdialog.show();\r\n }", "@Override\n protected void onPreExecute() {\n progressDialog= new ProgressDialog(getActivity());\n progressDialog.setMessage(\"loading..\");\n progressDialog.setIndeterminate(false);\n progressDialog.show();\n }", "private void displayLoader() {\n pDialog = new ProgressDialog(DangKyActivity.this);\n pDialog.setMessage(\"Vui lòng đợi trong giây lát...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\t \tprotected void onPreExecute() {\n\t\t try {\n\t\t\t \tpd=new ProgressDialog(Styles_Dialog.this);\n\t\t\t \tpd.setMessage(\"Loading\");\n\t\t\t \tpd.show();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t}\n\t\t \t\n\t\t \t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tpdia = new ProgressDialog(mContext);\n\t\t\tpdia.setMessage(\"Loading...\");\n\t\t\tpdia.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "private void displayLoader() {\n pDialog = new ProgressDialog(AddReviewActivity.this);\n pDialog.setMessage(\"Adding Review...Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog = new ProgressDialog(activity);\n\t\t\tpDialog.setMessage(\"Loading...\");\n\t\t\tpDialog.setIndeterminate(false);\n\t\t\tpDialog.setCancelable(true);\n\t\t\tpDialog.show();\n\t\t}", "@Override\n protected void onPreExecute() {\n\n\n dialog = new ProgressDialog(MainArea.this);\n dialog.setTitle(\"Loading Results\");\n dialog.setMessage(\"Please Wait Results Are Loading For You....\");\n dialog.setCanceledOnTouchOutside(false);\n dialog.show();\n super.onPreExecute();\n }", "private void progressStuff() {\n cd = new ConnectionDetector(getActivity());\n parser = new JSONParser();\n progress = new ProgressDialog(getActivity());\n progress.setMessage(getResources().getString(R.string.loading));\n progress.setIndeterminate(false);\n progress.setCancelable(true);\n // progress.show();\n }", "@Override\r\n\t\tprotected void onPreExecute() {\r\n\t\t\tsuper.onPreExecute();\r\n\t\t\tpDialog = new ProgressDialog(getActivity());\r\n\t\t\tpDialog.setMessage(\"Loading...\");\r\n\t\t\tpDialog.setIndeterminate(false);\r\n\t\t\tpDialog.setCancelable(false);\r\n\t\t\tpDialog.show();\r\n\t\t}", "void showProgressLoading(Context context, boolean isCancelable) {\n\n progressDialog = new ProgressDialog(context);\n progressDialog.setIndeterminate(true);\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progressDialog.setMessage(\"Loading...\");\n progressDialog.setCancelable(isCancelable);\n progressDialog.setCanceledOnTouchOutside(false);\n\n progressDialog.show();\n\n }", "protected final void showLoadingDialog() {\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pd = new ProgressDialog(activity);\n pd.setMessage(\"Loading, Please Wait.....\");\n pd.setCancelable(false);\n pd.show();\n }", "public void showProgressDialog() {\n if (mProgressDialog == null) {\n mProgressDialog = new ProgressDialog(this);\n mProgressDialog.setCancelable(false);\n mProgressDialog.setCanceledOnTouchOutside(false);\n mProgressDialog.setMessage(getString(R.string.msg_loading));\n mProgressDialog.setIndeterminate(true);\n }\n mProgressDialog.show();\n }", "private void showSpinerProgress() {\n dialog.setMessage(\"Loading\");\n//\n// dialog.setButton(ProgressDialog.BUTTON_POSITIVE, \"YES\", new DialogInterface.OnClickListener() {\n// @Override\n// public void onClick(DialogInterface dialog, int which) {\n//\n// }\n// });\n\n //thiet lap k the huy - co the huy\n dialog.setCancelable(false);\n\n //show dialog\n dialog.show();\n Timer timer = new Timer();\n timer.schedule(new TimerTask() {\n @Override\n public void run() {\n dialog.dismiss();\n }\n }, 20000000);\n }", "private void showDialog(){\n progress = new ProgressDialog(this);\n progress.setTitle(getString(R.string.progress_dialog_loading));\n progress.setMessage(getString(R.string.progress_dialog_authenticating_with_firebase));\n progress.setCancelable(false);\n progress.show();\n }", "public void initProgressLoader() {\n progressDialog = new ProgressDialog(this);\n progressDialog.setIndeterminate(true);\n progressDialog.setCancelable(false);\n }", "private void displayLoader() {\n pDialog = new ProgressDialog(RegisterActivity.this);\n pDialog.setMessage(\"Signing Up.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tprogressDialog = ProgressDialog.show(MainActivity.this, \"\",\n\t\t\t\t\t\"Loading...\");\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tmyDialog = ProgressDialog.show\n\t\t\t\t\t(\n\t\t\t\t\t\t\tgetActivity(),\n\t\t\t\t\t\t\t\"Loading...\",\n\t\t\t\t\t\t\t\"Please Wait\",\n\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t);\n\t\t}", "@Override\n\tprotected void onPreExecute() {\n\t\t\n\t\t pDialog = new ProgressDialog(context);\n\t\t\ttry{\n\t\t\t\tthis.pDialog.setMessage(\"Please wait ...\");\n\t\t this.pDialog.setIndeterminateDrawable(context.getResources().getDrawable(R.drawable.red_progress));\n\t\t this.pDialog.setIndeterminate(false);\n\t\t this.pDialog.setCancelable(false);\n\t\t this.pDialog.show();\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\te.getMessage();\n\t\t\t}\n\t}", "private void showProgressDialog()\n {\n if (showProgressDialog && !getStatus().equals(AsyncTask.Status.FINISHED)) {\n //show the dialog if valid activity. If the OS is lollipop or higher then set the theme.\n //dialog = ProgressDialog.show(activity, \"In progress..\", message, true);\n if (Build.VERSION.SDK_INT >= 21) {\n dialog = new ProgressDialog(activity, R.style.progressoAlertDialogStyle);\n dialog.setTitle(\"In progress..\");\n dialog.setMessage(message);\n dialog.setIndeterminate(true);\n dialog.show();\n }\n else {\n dialog = ProgressDialog.show(activity, \"In progress..\", message, true);\n }\n\n dialog.setCancelable(false);\n } \n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(TalkActivity.this);\n pDialog.setMessage(getResources().getString(R.string.loading));\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n public void showloading(String message) {\n progressDialog = new ProgressDialog(getActivity());\n progressDialog.setMessage(message);\n progressDialog.setIndeterminate(true);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(Integrationforkhalti.this);\n pDialog.setMessage(\"Loading Please wait...\");\n pDialog.setIndeterminate(true);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n mProgressDialog = new ProgressDialog(getActivity());\n mProgressDialog.setMessage(getString(R.string.loading_text));\n mProgressDialog.setCancelable(false);\n }", "private void showProgressDialog() {\n if (progressDialog == null) {\n progressDialog = new ProgressDialog(getContext());\n }\n\n progressDialog.setTitle(R.string.dialog_title);\n progressDialog.setMessage(getResources().getString(R.string.dialog_message));\n progressDialog.setCancelable(false);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n /* mProgress.setMessage(\"Please Wait\");\n mProgress.setCancelable(false);\n mProgress.show();*/\n String msg = \"Please Wait....\";\n cd.showProgressDialog(msg);\n }", "private void showLoadingDialogue(final String loadingMessage) {\n progressDialog.setMessage(loadingMessage);\n progressDialog.setCancelable(false);\n progressDialog.setIndeterminate(false);\n progressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() \n\t\t{\n\t\t\t\n\t\t\tdialog = new ProgressDialog(AddFoodAdvActivity.this);\n\t\t\tdialog.setMessage(\"Loading...\");\n\t\t\tdialog.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "private void showDialog() {\n try {\n pDialog.setMessage(getString(R.string.please_wait));\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.setCanceledOnTouchOutside(false);\n pDialog.show();\n } catch (Exception e) {\n // TODO: handle exception\n }\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tdl = ProgressDialog.show(getActivity(), \"Thông báo\", \"Loading...\",\n\t\t\t\t\ttrue, false);\n\t\t\tdl.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n protected void onPreExecute()\n {\n // Create a new progress dialog\n progressDialog = new ProgressDialog(MainActivity.this);\n // Set the progress dialog spinner progress bar\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n // Set the dialog title to 'Loading...'\n progressDialog.setTitle(\"Loading...\");\n // Set the dialog message to 'Loading application View, please wait...'\n progressDialog.setMessage(\"Loading application, please wait...\");\n // This dialog can't be canceled by pressing the back key\n progressDialog.setCancelable(false);\n // This dialog isn't indeterminate\n progressDialog.setIndeterminate(false);\n // The maximum number of items is 100\n progressDialog.setMax(100);\n // Set the current progress to zero\n progressDialog.setProgress(0);\n // Display the progress dialog\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progressDialog.setMessage(\"Please wait. Loading...\");\n progressDialog.setCanceledOnTouchOutside(false);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n pDialog = new ProgressDialog(getActivity());\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(false);\n pDialog.setIndeterminate(false);\n pDialog.setMax(100);\n pDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n pDialog.show();\n// progressBar.setVisibility(View.VISIBLE);\n// progressBar.setProgress(0);\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n\n dialog = new ProgressDialog(AddFoodAdvActivity.this);\n dialog.setMessage(\"Please Wait...!\");\n dialog.show();\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n showProgressDialog(R.string.please_wait);\n //showDialog(progress_bar_type);\n }", "@Override\r\n\tprotected void onPreExecute()\r\n\t{\r\n\t\tprogress = new ProgressDialog(ctx);\r\n\t\tprogress.setTitle(\"Retrieving Parking Information\");\r\n\t\tprogress.setMessage(\"Please wait.\");\r\n\t\tprogress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\r\n\t\tprogress.show();\r\n\t\tsuper.onPreExecute();\r\n\t}", "@Override\n protected void onPreExecute() {\n progressDialog = new ProgressDialog(getActivity());\n progressDialog.setTitle(getResources().getString(R.string.please_wait));\n progressDialog.setMessage(getResources().getString(R.string.fetching_data));\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n // Showing progress dialog\n pDialog = new ProgressDialog(thisContext);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(true);\n pDialog.show();\n\n }", "private void displayProgressDialog() {\n pDialog.setMessage(\"Logging in.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\r\n \tprotected void onPreExecute() {\n \t\tsuper.onPreExecute();\r\n \t\tpdia = new ProgressDialog(Regmember.this);\r\n \t\tpdia.setCanceledOnTouchOutside(false);\r\n pdia.setMessage(\"Dhiraj rakh..........\");\r\n pdia.show(); \r\n \t}", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n this.dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n this.dialog.setCancelable(false);\n this.dialog.show();\n }", "@Override\n protected void onPreExecute() {\n pDialog = new ProgressDialog(homeActivity);\n pDialog.setMessage(\"Retrieving Details... \");\n // pDialog.setMax(16);\n pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\n pDialog.setCancelable(false);\n pDialog.show();\n\n\n }", "public void onPreExecute() {\n progressDialog.show();\n }", "@Override\r\n\t protected void onPreExecute() {\n\t super.onPreExecute();\r\n\t progressDialog = new ProgressDialog(UDMap.this);\r\n\t progressDialog.setMessage(\"Loading the best way...\");\r\n\t progressDialog.setIndeterminate(true);\r\n\t progressDialog.show();\r\n\t }", "void showProgressDialog();", "void showProgressDialog();", "protected void onPreExecute() {\n try {\n this.dialog.setMessage(getContext().getResources().getString(R.string.loading));\n this.dialog.show();\n } catch (Exception ex) {\n Log.e(null, ex);\n }\n }", "public void showProgressDialog() {\n pd = new ProgressDialog(this);\n pd.setMessage(\"Renting film...\");\n pd.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog1 = new ProgressDialog(Doctorslist.this);\n\t\t\tpDialog1.setMessage(\"Loading ...\");\n\t\t\tpDialog1.setIndeterminate(false);\n\t\t\tpDialog1.setCancelable(false);\n\t\t\tpDialog1.show();\n\t\t}", "public void showProgressDialog() {\n try {\n if (progressDialog == null) {\n try {\n progressDialog = new ProgressDialog(self);\n progressDialog.show();\n progressDialog.setCancelable(false);\n } catch (Exception e) {\n progressDialog = new ProgressDialog(self.getParent());\n progressDialog.show();\n progressDialog.setCancelable(false);\n e.printStackTrace();\n }\n } else {\n if (!progressDialog.isShowing())\n progressDialog.show();\n }\n } catch (Exception e) {\n progressDialog = new ProgressDialog(self);\n progressDialog.show();\n progressDialog.setCancelable(false);\n e.printStackTrace();\n }\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n loading = ProgressDialog.show(this.context, \"Fetching Data\",\"Please Wait...\",true,true);\n }", "private void showProgressDialog() {\n mProgressDialog = AppDialog.showProgressDialog(this);\n mProgressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n asyncDialog.setMessage(\"Loading...\");\n //show dialog\n asyncDialog.show();\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n progress = new ProgressDialog(hostContext);\n progress.setMessage(\"Wait while books are being downloaded...\");\n progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progress.show();\n }", "public void showProgress2(){\n// if (mHandler==null){\n// mHandler = new Handler(Looper.getMainLooper());\n// }\n new Handler(Looper.getMainLooper()).post(new Runnable() {\n @Override\n public void run() {\n loadingDialog = new Dialog(BaseActivity.this);\n loadingDialog.setTitle(\"Loading data..\");\n loadingDialog.setContentView(R.layout.loading);\n loadingDialog.show();\n\n }\n });\n// mHandler.post(new Runnable() {\n// @Override\n// public void run() {\n// loadingDialog = new Dialog(BaseActivity.this);\n// loadingDialog.setTitle(\"Loading data..\");\n// loadingDialog.setContentView(R.layout.loading);\n// loadingDialog.show();\n//\n// }\n// });\n }", "private void displayProgressDialog() {\n pDialog.setMessage(\"Logging In.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\t// TODO Auto-generated method stub\n\t\t\tsuper.onPreExecute();\n\t\t\tpd = ProgressDialogUtil.createDialogNoTitle(context, \"loading...\");\n\t\t\tpd.show();\n\t\t}", "protected void createProgressDialog() {\r\t\tif (pd == null) {\r\t\t\tpd = new ProgressDialog(this);\r\t\t\tpd.setCanceledOnTouchOutside(false);\r\t\t\tpd.getWindow().setGravity(Gravity.CENTER);\r\t\t\tpd.setOnCancelListener(new DialogInterface.OnCancelListener() {\r\t\t\t\t@Override\r\t\t\t\tpublic void onCancel(DialogInterface dialogInterface) {\r\t\t\t\t\tonPdCancel();\r\t\t\t\t}\r\t\t\t});\r\t\t}\r\t}", "private void showLoadingDialog() {\n mDefaultLoadingDialogFragment = new DefaultLoadingDialogFragment();\n mDefaultLoadingDialogFragment.show(getChildFragmentManager(), \"loadingDialog\");\n }", "@Override\n\t protected void onPreExecute() {\n\t super.onPreExecute();\n\t \n\t progressDialog= new Dialog(ListKotaActivity.this);\n\t progressDialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);\n\t progressDialog.setContentView(R.layout.progress);\n\t progressDialog.setCancelable(false);\n\t progressDialog.show();\t \n\t }", "@Override\n \t\tprotected void onPreExecute() \n \t\t{\n \t\t\t//Create a new progress dialog\n \t\t\tprogressDialog = new ProgressDialog(MainActivity.this);\n \t\t\t//Set the progress dialog to display a horizontal progress bar \n \t\t\tprogressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n \t\t\t//Set the dialog title to 'Loading...'\n \t\t\tprogressDialog.setTitle(\"Loading Game...\");\n \t\t\t//Set the dialog message to 'Loading application View, please wait...'\n \t\t\tprogressDialog.setMessage(\"Please wait...\");\n \t\t\t//This dialog can't be canceled by pressing the back key\n \t\t\tprogressDialog.setCancelable(false);\n \t\t\t//This dialog isn't indeterminate\n \t\t\tprogressDialog.setIndeterminate(false);\n \t\t\t//The maximum number of items is 100\n \t\t\tprogressDialog.setMax(100);\n \t\t\t//Set the current progress to zero\n \t\t\tprogressDialog.setProgress(0);\n \t\t\t//Display the progress dialog\n \t\t\tprogressDialog.show();\n \t\t}", "@Override\n protected void onPreExecute() {\n String msg = \"Please Wait....\";\n cd.showProgressDialog(msg);\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tshowLoadingProgressDialog();\n\t\t}", "@Override\n protected void onPreExecute() {\n showLoadingProgressDialog();\n }", "@Override\n protected void onPreExecute() {\n showLoadingProgressDialog();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n pDialog = new ProgressDialog(Resume_create_employee.this);\n pDialog.setMessage(\"Loading...\");\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(MainActivity.this);\n pDialog.setMessage(\"Processing Request...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(DetailActivity.this);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(true);\n pDialog.show();\n }", "@Override\r\n protected void onPreExecute() {\n if( progressDialog == null ) {\r\n progressDialog = ProgressDialog.show( context, context.getString(R.string.pref_sync_callings_now_title),\"\");\r\n }\r\n }", "@Override\r\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\r\n\t\t\tpDialog = new ProgressDialog(SingleRecord.this);\r\n\t\t\tpDialog.setMessage(\"downloading...\");\r\n\t\t\tpDialog.setIndeterminate(false);\r\n\t\t\tpDialog.setCancelable(true);\r\n\t\t\r\n\t\t\tpDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\r\n\t\t\tpDialog.show();\r\n\t\t\tpDialog.getWindow().setGravity(Gravity.BOTTOM);\r\n\t\t}", "@Override\n protected void onPreExecute() {\n\n this.dialog.setMessage(\"Please wait ...\");\n this.dialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\taProgressDialog = new ProgressDialog(TargetProducts.this);\n\t\t\taProgressDialog.setMessage(\"Loading Report...\");\n\t\t\taProgressDialog.setIndeterminate(true);\n\t\t\taProgressDialog.setCanceledOnTouchOutside(true);\n\t\t\taProgressDialog.show();\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\taProgressDialog = new ProgressDialog(TargetProducts.this);\n\t\t\taProgressDialog.setMessage(\"Loading Report...\");\n\t\t\taProgressDialog.setIndeterminate(true);\n\t\t\taProgressDialog.setCanceledOnTouchOutside(true);\n\t\t\taProgressDialog.show();\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\t\n\t\t\tdialog = new ProgressDialog(BookingConfirmationScreen.this);\n\t\t\tdialog.setIndeterminate(false);\n\t\t\tdialog.setCancelable(true);\n\t\t\tdialog.show();\n\t\t\t\n\t\t\t\n\t\t}", "@Override\n protected void onProgressUpdate(Integer... values) {\n super.onProgressUpdate(values);\n progress = new ProgressDialog(activity);\n progress.setMessage(\"please wait.. \");\n progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progress.setIndeterminate(true);\n progress.setCancelable(false);\n progress.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tpdia = new ProgressDialog(mContext);\n\t\t\tpdia.setMessage(\"Loading Circles...\");\n\t\t\tpdia.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n // // pDialog = new ProgressDialog(getContext());\n pDialog = new ProgressDialog(context);\n pDialog.setMessage(\"Cargando Información\");\n pDialog.setCancelable(true);\n pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n pDialog.show();\n\n }", "public void showCustomLoadingDialog() {\n\n //..show gif\n viewDialog.showDialog();\n final Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n //...here i'm waiting 5 seconds before hiding the custom dialog\n //...you can do whenever you want or whenever your work is done\n viewDialog.hideDialog();\n }\n }, 1000);\n }", "public void showProgressDialog() {\n showProgressDialog(null);\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n // Show the progress in load\n pDialog = new ProgressDialog(UpdateTimeTable.this);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(false);\n pDialog.show();\n \n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n progressDialog = new ProgressDialog(AiutaGliAltri.this);\n progressDialog.setMessage(\"Sto Cercando!\");\n progressDialog.setIndeterminate(true);\n progressDialog.setCanceledOnTouchOutside(false);\n progressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tprogressDialog = new ProgressDialog(ListActivity.this);\n\t\t\tprogressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\n\t\t\tprogressDialog.setMessage(\"Loading Programs. .\");\n\t\t\tprogressDialog.setCancelable(false);\n\n\t\t\tprogressDialog.show();\n\t\t}", "private void showProgress(String message) {\n \tif(mProgress==null){\n \t\tmProgress = new ProgressDialog(stActivity);\n\t mProgress.setMessage(message);\n\t mProgress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\t mProgress.setIndeterminate(true);\n\t mProgress.setCancelable(false); \n\t mProgress.show();\n \t}\n }", "@Override\n\tprotected void onPreExecute() {\n\t\tsuper.onPreExecute();\n\n\t\tprogress = ProgressDialog.show(act, \"\", \"Please wait ...\", true);\n\t\talert = new AlertDialog.Builder(act);\n\n\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tdialog = new ProgressDialog(BookingConfirmationScreen.this);\n\t\t\tdialog.setIndeterminate(false);\n\t\t\tdialog.setCancelable(true);\n\t\t\tdialog.show();\n\n\t\t}", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(context);\n pDialog.setMessage(\"Fetching videolists..\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(true);\n pDialog.show();\n }", "@Override\r\n\t\t protected void onPreExecute() {\n \t\tprogress= ProgressDialog.show(\r\n \t\t\t\tDetailProgramActivity.this, \r\n \t\t\t\t\"\", \r\n \t\t\t\tgetString(R.string.loading_data), \r\n \t\t\t\ttrue);\r\n \t}", "private void showProgressIndication() {\n Log.i(TAG, \"loading contacts... \");\n // TODO: make this be a no-op if the progress indication is\n // already visible with the exact same title and message.\n\n dismissProgressIndication(); // Clean up any prior progress indication\n\n mProgressDialog = new ProgressDialog(this);\n mProgressDialog.setMessage(this.getResources().getString(R.string.contact_list_loading));\t\n mProgressDialog.setIndeterminate(true);\n mProgressDialog.setCancelable(false);\n mProgressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\ttry {\n\t\t\t\tdialog.setIndeterminate(false);\n\t\t\t\tdialog.setMax(100);\n\t\t\t\tdialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n\t\t\t\tdialog.setCancelable(false);\n\t\t\t\tdialog.show();\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "public void initLoadingPage(Context c) {\n\n LayoutInflater inflater = (LayoutInflater) c.getSystemService( c.LAYOUT_INFLATER_SERVICE);\n final AlertDialog.Builder nameBuilder = new AlertDialog.Builder(c);\n View alertDiaView = inflater.inflate(R.layout.activity_loading_page,null);\n nameBuilder.setView(alertDiaView);\n\n avi = (AVLoadingIndicatorView) alertDiaView.findViewById(R.id.avi);\n avi.smoothToShow();\n\n\n int val= (int) (130 * Resources.getSystem().getDisplayMetrics().density);//dp to px\n alertDialog= nameBuilder.show();\n alertDialog.getWindow().setLayout(val ,val);\n\n\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n pDialog = new ProgressDialog(Activity_List.this);\n pDialog.setMessage(\"Loading spots. Please wait...\");\n\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "void dismissProgressLoading() {\n if (progressDialog != null) {\n progressDialog.dismiss();\n }\n }" ]
[ "0.85567886", "0.8352688", "0.8278885", "0.82205284", "0.81206936", "0.81118655", "0.8108865", "0.8074827", "0.8038312", "0.80098265", "0.7998259", "0.79511577", "0.7948703", "0.7930043", "0.7912505", "0.7867033", "0.7850678", "0.7844706", "0.78353035", "0.78156286", "0.7797823", "0.7784651", "0.7760526", "0.77600116", "0.77501494", "0.7749045", "0.77386063", "0.7731478", "0.7701042", "0.7697044", "0.7681732", "0.7670093", "0.7669092", "0.76626396", "0.7644567", "0.763723", "0.7630021", "0.76271856", "0.762467", "0.7620349", "0.7596412", "0.7592744", "0.75579137", "0.75574803", "0.7552131", "0.75407976", "0.75382984", "0.75317204", "0.7519727", "0.7451678", "0.7442118", "0.744127", "0.74322087", "0.7425351", "0.7425351", "0.74189377", "0.7418416", "0.741551", "0.741213", "0.7402807", "0.7388917", "0.7383496", "0.73604465", "0.7360063", "0.7359984", "0.73590505", "0.7351788", "0.7332166", "0.7327484", "0.73171186", "0.7314973", "0.7314076", "0.7309344", "0.7309344", "0.7290827", "0.72897744", "0.7282288", "0.728221", "0.727934", "0.72763354", "0.7273137", "0.7273137", "0.7271518", "0.7258088", "0.72444123", "0.72317374", "0.72295463", "0.72278434", "0.72062516", "0.7200889", "0.71870035", "0.7169838", "0.71688443", "0.71682143", "0.7167863", "0.7165924", "0.71653086", "0.7158772", "0.715525", "0.7151423", "0.7145757" ]
0.0
-1
pDialog = new ProgressDialog(this); pDialog.setCancelable(false); pDialog.setMessage("Loading ..."); pDialog.show();
private void getDataSalaf(){ UserAPIService api = Config.getRetrofit().create(UserAPIService.class); Call<Value> call = api.lihat_jenis("Salaf"); call.enqueue(new Callback<Value>() { @Override public void onResponse(Call<Value> call, Response<Value> response) { // pDialog.dismiss(); String value1 = response.body().getStatus(); if (value1.equals("1")){ Value value = response.body(); resultAlls = new ArrayList<>(Arrays.asList(value.getResult())); adapter = new RecyclerAdapterListAll(resultAlls,getApplicationContext()); recyclerView.setAdapter(adapter); }else { Toast.makeText(ListPonpesActivity.this,"Maaf Data Tidak Ada",Toast.LENGTH_SHORT).show(); } } @Override public void onFailure(Call<Value> call, Throwable t) { // pDialog.dismiss(); Toast.makeText(ListPonpesActivity.this,"Respon gagal",Toast.LENGTH_SHORT).show(); Log.d("Hasil internet",t.toString()); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void showProgressDialog(){\n progressDialog=ProgressDialog.show(context,\"\",\"Loading...Please wait...\");\n\n\n }", "private Dialog buildLoadingDialog() {\n ProgressDialog dialog = new ProgressDialog(this);\n dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n dialog.setMessage(getText(R.string.dialog_loading));\n dialog.setIndeterminate(true);\n dialog.setCancelable(false);\n return dialog;\n }", "protected void showLoading()\n {\n progressBar = new ProgressDialog(this);\n progressBar.setTitle(\"Loading\");\n progressBar.setMessage(\"Wait while loading...\");\n progressBar.setCancelable(false); // disable dismiss by tapping outside of the dialog\n progressBar.show();\n }", "private void creatDialog() {\n \t mDialog=new ProgressDialog(this);\n \t mDialog.setTitle(\"\");\n \t mDialog.setMessage(\"正在加载请稍后\");\n \t mDialog.setIndeterminate(true);\n \t mDialog.setCancelable(true);\n \t mDialog.show();\n \n\t}", "@Override\n protected void onPreExecute() {\n\n dialog = new ProgressDialog(context);\n dialog.setTitle(\"Loading Contents\");\n dialog.setMessage(\"Doing something interesting ...\");\n dialog.setIndeterminate(true);\n dialog.setCancelable(false);\n dialog.show();\n }", "public void showProgressDialog() {\r\n progressDialog.setMessage(getResources().getString(R.string.text_loading));\r\n progressDialog.setCancelable(false);\r\n progressDialog.show();\r\n }", "@Override\n\t\tprotected void onPreExecute()\n\t\t{\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog = new ProgressDialog(MainActivity.this);\n\t\t\tpDialog.setMessage(\"Loading....\");\n\t\t\tpDialog.setCancelable(true);\n\t\t\tpDialog.show();\n\t\t}", "protected void onPreExecute() {\r\n \tdialog = new ProgressDialog(context);\r\n \t\tdialog.setMessage(\"Loading...\");\r\n \t\tdialog.show();\r\n }", "@Override\n protected void onPreExecute() {\n progressDialog= new ProgressDialog(getActivity());\n progressDialog.setMessage(\"loading..\");\n progressDialog.setIndeterminate(false);\n progressDialog.show();\n }", "private void displayLoader() {\n pDialog = new ProgressDialog(DangKyActivity.this);\n pDialog.setMessage(\"Vui lòng đợi trong giây lát...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\t \tprotected void onPreExecute() {\n\t\t try {\n\t\t\t \tpd=new ProgressDialog(Styles_Dialog.this);\n\t\t\t \tpd.setMessage(\"Loading\");\n\t\t\t \tpd.show();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t}\n\t\t \t\n\t\t \t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tpdia = new ProgressDialog(mContext);\n\t\t\tpdia.setMessage(\"Loading...\");\n\t\t\tpdia.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "private void displayLoader() {\n pDialog = new ProgressDialog(AddReviewActivity.this);\n pDialog.setMessage(\"Adding Review...Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog = new ProgressDialog(activity);\n\t\t\tpDialog.setMessage(\"Loading...\");\n\t\t\tpDialog.setIndeterminate(false);\n\t\t\tpDialog.setCancelable(true);\n\t\t\tpDialog.show();\n\t\t}", "@Override\n protected void onPreExecute() {\n\n\n dialog = new ProgressDialog(MainArea.this);\n dialog.setTitle(\"Loading Results\");\n dialog.setMessage(\"Please Wait Results Are Loading For You....\");\n dialog.setCanceledOnTouchOutside(false);\n dialog.show();\n super.onPreExecute();\n }", "private void progressStuff() {\n cd = new ConnectionDetector(getActivity());\n parser = new JSONParser();\n progress = new ProgressDialog(getActivity());\n progress.setMessage(getResources().getString(R.string.loading));\n progress.setIndeterminate(false);\n progress.setCancelable(true);\n // progress.show();\n }", "@Override\r\n\t\tprotected void onPreExecute() {\r\n\t\t\tsuper.onPreExecute();\r\n\t\t\tpDialog = new ProgressDialog(getActivity());\r\n\t\t\tpDialog.setMessage(\"Loading...\");\r\n\t\t\tpDialog.setIndeterminate(false);\r\n\t\t\tpDialog.setCancelable(false);\r\n\t\t\tpDialog.show();\r\n\t\t}", "void showProgressLoading(Context context, boolean isCancelable) {\n\n progressDialog = new ProgressDialog(context);\n progressDialog.setIndeterminate(true);\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progressDialog.setMessage(\"Loading...\");\n progressDialog.setCancelable(isCancelable);\n progressDialog.setCanceledOnTouchOutside(false);\n\n progressDialog.show();\n\n }", "protected final void showLoadingDialog() {\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pd = new ProgressDialog(activity);\n pd.setMessage(\"Loading, Please Wait.....\");\n pd.setCancelable(false);\n pd.show();\n }", "public void showProgressDialog() {\n if (mProgressDialog == null) {\n mProgressDialog = new ProgressDialog(this);\n mProgressDialog.setCancelable(false);\n mProgressDialog.setCanceledOnTouchOutside(false);\n mProgressDialog.setMessage(getString(R.string.msg_loading));\n mProgressDialog.setIndeterminate(true);\n }\n mProgressDialog.show();\n }", "private void showSpinerProgress() {\n dialog.setMessage(\"Loading\");\n//\n// dialog.setButton(ProgressDialog.BUTTON_POSITIVE, \"YES\", new DialogInterface.OnClickListener() {\n// @Override\n// public void onClick(DialogInterface dialog, int which) {\n//\n// }\n// });\n\n //thiet lap k the huy - co the huy\n dialog.setCancelable(false);\n\n //show dialog\n dialog.show();\n Timer timer = new Timer();\n timer.schedule(new TimerTask() {\n @Override\n public void run() {\n dialog.dismiss();\n }\n }, 20000000);\n }", "private void showDialog(){\n progress = new ProgressDialog(this);\n progress.setTitle(getString(R.string.progress_dialog_loading));\n progress.setMessage(getString(R.string.progress_dialog_authenticating_with_firebase));\n progress.setCancelable(false);\n progress.show();\n }", "public void initProgressLoader() {\n progressDialog = new ProgressDialog(this);\n progressDialog.setIndeterminate(true);\n progressDialog.setCancelable(false);\n }", "private void displayLoader() {\n pDialog = new ProgressDialog(RegisterActivity.this);\n pDialog.setMessage(\"Signing Up.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tprogressDialog = ProgressDialog.show(MainActivity.this, \"\",\n\t\t\t\t\t\"Loading...\");\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tmyDialog = ProgressDialog.show\n\t\t\t\t\t(\n\t\t\t\t\t\t\tgetActivity(),\n\t\t\t\t\t\t\t\"Loading...\",\n\t\t\t\t\t\t\t\"Please Wait\",\n\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t);\n\t\t}", "@Override\n\tprotected void onPreExecute() {\n\t\t\n\t\t pDialog = new ProgressDialog(context);\n\t\t\ttry{\n\t\t\t\tthis.pDialog.setMessage(\"Please wait ...\");\n\t\t this.pDialog.setIndeterminateDrawable(context.getResources().getDrawable(R.drawable.red_progress));\n\t\t this.pDialog.setIndeterminate(false);\n\t\t this.pDialog.setCancelable(false);\n\t\t this.pDialog.show();\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\te.getMessage();\n\t\t\t}\n\t}", "private void showProgressDialog()\n {\n if (showProgressDialog && !getStatus().equals(AsyncTask.Status.FINISHED)) {\n //show the dialog if valid activity. If the OS is lollipop or higher then set the theme.\n //dialog = ProgressDialog.show(activity, \"In progress..\", message, true);\n if (Build.VERSION.SDK_INT >= 21) {\n dialog = new ProgressDialog(activity, R.style.progressoAlertDialogStyle);\n dialog.setTitle(\"In progress..\");\n dialog.setMessage(message);\n dialog.setIndeterminate(true);\n dialog.show();\n }\n else {\n dialog = ProgressDialog.show(activity, \"In progress..\", message, true);\n }\n\n dialog.setCancelable(false);\n } \n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(TalkActivity.this);\n pDialog.setMessage(getResources().getString(R.string.loading));\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n public void showloading(String message) {\n progressDialog = new ProgressDialog(getActivity());\n progressDialog.setMessage(message);\n progressDialog.setIndeterminate(true);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(Integrationforkhalti.this);\n pDialog.setMessage(\"Loading Please wait...\");\n pDialog.setIndeterminate(true);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n mProgressDialog = new ProgressDialog(getActivity());\n mProgressDialog.setMessage(getString(R.string.loading_text));\n mProgressDialog.setCancelable(false);\n }", "private void showProgressDialog() {\n if (progressDialog == null) {\n progressDialog = new ProgressDialog(getContext());\n }\n\n progressDialog.setTitle(R.string.dialog_title);\n progressDialog.setMessage(getResources().getString(R.string.dialog_message));\n progressDialog.setCancelable(false);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n /* mProgress.setMessage(\"Please Wait\");\n mProgress.setCancelable(false);\n mProgress.show();*/\n String msg = \"Please Wait....\";\n cd.showProgressDialog(msg);\n }", "private void showLoadingDialogue(final String loadingMessage) {\n progressDialog.setMessage(loadingMessage);\n progressDialog.setCancelable(false);\n progressDialog.setIndeterminate(false);\n progressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() \n\t\t{\n\t\t\t\n\t\t\tdialog = new ProgressDialog(AddFoodAdvActivity.this);\n\t\t\tdialog.setMessage(\"Loading...\");\n\t\t\tdialog.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "private void showDialog() {\n try {\n pDialog.setMessage(getString(R.string.please_wait));\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.setCanceledOnTouchOutside(false);\n pDialog.show();\n } catch (Exception e) {\n // TODO: handle exception\n }\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tdl = ProgressDialog.show(getActivity(), \"Thông báo\", \"Loading...\",\n\t\t\t\t\ttrue, false);\n\t\t\tdl.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n protected void onPreExecute()\n {\n // Create a new progress dialog\n progressDialog = new ProgressDialog(MainActivity.this);\n // Set the progress dialog spinner progress bar\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n // Set the dialog title to 'Loading...'\n progressDialog.setTitle(\"Loading...\");\n // Set the dialog message to 'Loading application View, please wait...'\n progressDialog.setMessage(\"Loading application, please wait...\");\n // This dialog can't be canceled by pressing the back key\n progressDialog.setCancelable(false);\n // This dialog isn't indeterminate\n progressDialog.setIndeterminate(false);\n // The maximum number of items is 100\n progressDialog.setMax(100);\n // Set the current progress to zero\n progressDialog.setProgress(0);\n // Display the progress dialog\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progressDialog.setMessage(\"Please wait. Loading...\");\n progressDialog.setCanceledOnTouchOutside(false);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n pDialog = new ProgressDialog(getActivity());\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(false);\n pDialog.setIndeterminate(false);\n pDialog.setMax(100);\n pDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n pDialog.show();\n// progressBar.setVisibility(View.VISIBLE);\n// progressBar.setProgress(0);\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n\n dialog = new ProgressDialog(AddFoodAdvActivity.this);\n dialog.setMessage(\"Please Wait...!\");\n dialog.show();\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n showProgressDialog(R.string.please_wait);\n //showDialog(progress_bar_type);\n }", "@Override\r\n\tprotected void onPreExecute()\r\n\t{\r\n\t\tprogress = new ProgressDialog(ctx);\r\n\t\tprogress.setTitle(\"Retrieving Parking Information\");\r\n\t\tprogress.setMessage(\"Please wait.\");\r\n\t\tprogress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\r\n\t\tprogress.show();\r\n\t\tsuper.onPreExecute();\r\n\t}", "@Override\n protected void onPreExecute() {\n progressDialog = new ProgressDialog(getActivity());\n progressDialog.setTitle(getResources().getString(R.string.please_wait));\n progressDialog.setMessage(getResources().getString(R.string.fetching_data));\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n // Showing progress dialog\n pDialog = new ProgressDialog(thisContext);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(true);\n pDialog.show();\n\n }", "private void displayProgressDialog() {\n pDialog.setMessage(\"Logging in.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\r\n \tprotected void onPreExecute() {\n \t\tsuper.onPreExecute();\r\n \t\tpdia = new ProgressDialog(Regmember.this);\r\n \t\tpdia.setCanceledOnTouchOutside(false);\r\n pdia.setMessage(\"Dhiraj rakh..........\");\r\n pdia.show(); \r\n \t}", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n this.dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n this.dialog.setCancelable(false);\n this.dialog.show();\n }", "@Override\n protected void onPreExecute() {\n pDialog = new ProgressDialog(homeActivity);\n pDialog.setMessage(\"Retrieving Details... \");\n // pDialog.setMax(16);\n pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\n pDialog.setCancelable(false);\n pDialog.show();\n\n\n }", "public void onPreExecute() {\n progressDialog.show();\n }", "@Override\r\n\t protected void onPreExecute() {\n\t super.onPreExecute();\r\n\t progressDialog = new ProgressDialog(UDMap.this);\r\n\t progressDialog.setMessage(\"Loading the best way...\");\r\n\t progressDialog.setIndeterminate(true);\r\n\t progressDialog.show();\r\n\t }", "void showProgressDialog();", "void showProgressDialog();", "public void showProgressDialog() {\n pd = new ProgressDialog(this);\n pd.setMessage(\"Renting film...\");\n pd.show();\n }", "protected void onPreExecute() {\n try {\n this.dialog.setMessage(getContext().getResources().getString(R.string.loading));\n this.dialog.show();\n } catch (Exception ex) {\n Log.e(null, ex);\n }\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog1 = new ProgressDialog(Doctorslist.this);\n\t\t\tpDialog1.setMessage(\"Loading ...\");\n\t\t\tpDialog1.setIndeterminate(false);\n\t\t\tpDialog1.setCancelable(false);\n\t\t\tpDialog1.show();\n\t\t}", "public void showProgressDialog() {\n try {\n if (progressDialog == null) {\n try {\n progressDialog = new ProgressDialog(self);\n progressDialog.show();\n progressDialog.setCancelable(false);\n } catch (Exception e) {\n progressDialog = new ProgressDialog(self.getParent());\n progressDialog.show();\n progressDialog.setCancelable(false);\n e.printStackTrace();\n }\n } else {\n if (!progressDialog.isShowing())\n progressDialog.show();\n }\n } catch (Exception e) {\n progressDialog = new ProgressDialog(self);\n progressDialog.show();\n progressDialog.setCancelable(false);\n e.printStackTrace();\n }\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n loading = ProgressDialog.show(this.context, \"Fetching Data\",\"Please Wait...\",true,true);\n }", "private void showProgressDialog() {\n mProgressDialog = AppDialog.showProgressDialog(this);\n mProgressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n asyncDialog.setMessage(\"Loading...\");\n //show dialog\n asyncDialog.show();\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n progress = new ProgressDialog(hostContext);\n progress.setMessage(\"Wait while books are being downloaded...\");\n progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progress.show();\n }", "public void showProgress2(){\n// if (mHandler==null){\n// mHandler = new Handler(Looper.getMainLooper());\n// }\n new Handler(Looper.getMainLooper()).post(new Runnable() {\n @Override\n public void run() {\n loadingDialog = new Dialog(BaseActivity.this);\n loadingDialog.setTitle(\"Loading data..\");\n loadingDialog.setContentView(R.layout.loading);\n loadingDialog.show();\n\n }\n });\n// mHandler.post(new Runnable() {\n// @Override\n// public void run() {\n// loadingDialog = new Dialog(BaseActivity.this);\n// loadingDialog.setTitle(\"Loading data..\");\n// loadingDialog.setContentView(R.layout.loading);\n// loadingDialog.show();\n//\n// }\n// });\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\t// TODO Auto-generated method stub\n\t\t\tsuper.onPreExecute();\n\t\t\tpd = ProgressDialogUtil.createDialogNoTitle(context, \"loading...\");\n\t\t\tpd.show();\n\t\t}", "private void displayProgressDialog() {\n pDialog.setMessage(\"Logging In.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "protected void createProgressDialog() {\r\t\tif (pd == null) {\r\t\t\tpd = new ProgressDialog(this);\r\t\t\tpd.setCanceledOnTouchOutside(false);\r\t\t\tpd.getWindow().setGravity(Gravity.CENTER);\r\t\t\tpd.setOnCancelListener(new DialogInterface.OnCancelListener() {\r\t\t\t\t@Override\r\t\t\t\tpublic void onCancel(DialogInterface dialogInterface) {\r\t\t\t\t\tonPdCancel();\r\t\t\t\t}\r\t\t\t});\r\t\t}\r\t}", "private void showLoadingDialog() {\n mDefaultLoadingDialogFragment = new DefaultLoadingDialogFragment();\n mDefaultLoadingDialogFragment.show(getChildFragmentManager(), \"loadingDialog\");\n }", "@Override\n\t protected void onPreExecute() {\n\t super.onPreExecute();\n\t \n\t progressDialog= new Dialog(ListKotaActivity.this);\n\t progressDialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);\n\t progressDialog.setContentView(R.layout.progress);\n\t progressDialog.setCancelable(false);\n\t progressDialog.show();\t \n\t }", "@Override\n \t\tprotected void onPreExecute() \n \t\t{\n \t\t\t//Create a new progress dialog\n \t\t\tprogressDialog = new ProgressDialog(MainActivity.this);\n \t\t\t//Set the progress dialog to display a horizontal progress bar \n \t\t\tprogressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n \t\t\t//Set the dialog title to 'Loading...'\n \t\t\tprogressDialog.setTitle(\"Loading Game...\");\n \t\t\t//Set the dialog message to 'Loading application View, please wait...'\n \t\t\tprogressDialog.setMessage(\"Please wait...\");\n \t\t\t//This dialog can't be canceled by pressing the back key\n \t\t\tprogressDialog.setCancelable(false);\n \t\t\t//This dialog isn't indeterminate\n \t\t\tprogressDialog.setIndeterminate(false);\n \t\t\t//The maximum number of items is 100\n \t\t\tprogressDialog.setMax(100);\n \t\t\t//Set the current progress to zero\n \t\t\tprogressDialog.setProgress(0);\n \t\t\t//Display the progress dialog\n \t\t\tprogressDialog.show();\n \t\t}", "@Override\n protected void onPreExecute() {\n String msg = \"Please Wait....\";\n cd.showProgressDialog(msg);\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tshowLoadingProgressDialog();\n\t\t}", "@Override\n protected void onPreExecute() {\n showLoadingProgressDialog();\n }", "@Override\n protected void onPreExecute() {\n showLoadingProgressDialog();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n pDialog = new ProgressDialog(Resume_create_employee.this);\n pDialog.setMessage(\"Loading...\");\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(MainActivity.this);\n pDialog.setMessage(\"Processing Request...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(DetailActivity.this);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(true);\n pDialog.show();\n }", "@Override\r\n protected void onPreExecute() {\n if( progressDialog == null ) {\r\n progressDialog = ProgressDialog.show( context, context.getString(R.string.pref_sync_callings_now_title),\"\");\r\n }\r\n }", "@Override\r\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\r\n\t\t\tpDialog = new ProgressDialog(SingleRecord.this);\r\n\t\t\tpDialog.setMessage(\"downloading...\");\r\n\t\t\tpDialog.setIndeterminate(false);\r\n\t\t\tpDialog.setCancelable(true);\r\n\t\t\r\n\t\t\tpDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\r\n\t\t\tpDialog.show();\r\n\t\t\tpDialog.getWindow().setGravity(Gravity.BOTTOM);\r\n\t\t}", "@Override\n protected void onPreExecute() {\n\n this.dialog.setMessage(\"Please wait ...\");\n this.dialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\taProgressDialog = new ProgressDialog(TargetProducts.this);\n\t\t\taProgressDialog.setMessage(\"Loading Report...\");\n\t\t\taProgressDialog.setIndeterminate(true);\n\t\t\taProgressDialog.setCanceledOnTouchOutside(true);\n\t\t\taProgressDialog.show();\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\taProgressDialog = new ProgressDialog(TargetProducts.this);\n\t\t\taProgressDialog.setMessage(\"Loading Report...\");\n\t\t\taProgressDialog.setIndeterminate(true);\n\t\t\taProgressDialog.setCanceledOnTouchOutside(true);\n\t\t\taProgressDialog.show();\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\t\n\t\t\tdialog = new ProgressDialog(BookingConfirmationScreen.this);\n\t\t\tdialog.setIndeterminate(false);\n\t\t\tdialog.setCancelable(true);\n\t\t\tdialog.show();\n\t\t\t\n\t\t\t\n\t\t}", "@Override\n protected void onProgressUpdate(Integer... values) {\n super.onProgressUpdate(values);\n progress = new ProgressDialog(activity);\n progress.setMessage(\"please wait.. \");\n progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progress.setIndeterminate(true);\n progress.setCancelable(false);\n progress.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tpdia = new ProgressDialog(mContext);\n\t\t\tpdia.setMessage(\"Loading Circles...\");\n\t\t\tpdia.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n // // pDialog = new ProgressDialog(getContext());\n pDialog = new ProgressDialog(context);\n pDialog.setMessage(\"Cargando Información\");\n pDialog.setCancelable(true);\n pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n pDialog.show();\n\n }", "public void showCustomLoadingDialog() {\n\n //..show gif\n viewDialog.showDialog();\n final Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n //...here i'm waiting 5 seconds before hiding the custom dialog\n //...you can do whenever you want or whenever your work is done\n viewDialog.hideDialog();\n }\n }, 1000);\n }", "public void showProgressDialog() {\n showProgressDialog(null);\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n // Show the progress in load\n pDialog = new ProgressDialog(UpdateTimeTable.this);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(false);\n pDialog.show();\n \n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n progressDialog = new ProgressDialog(AiutaGliAltri.this);\n progressDialog.setMessage(\"Sto Cercando!\");\n progressDialog.setIndeterminate(true);\n progressDialog.setCanceledOnTouchOutside(false);\n progressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tprogressDialog = new ProgressDialog(ListActivity.this);\n\t\t\tprogressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\n\t\t\tprogressDialog.setMessage(\"Loading Programs. .\");\n\t\t\tprogressDialog.setCancelable(false);\n\n\t\t\tprogressDialog.show();\n\t\t}", "private void showProgress(String message) {\n \tif(mProgress==null){\n \t\tmProgress = new ProgressDialog(stActivity);\n\t mProgress.setMessage(message);\n\t mProgress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\t mProgress.setIndeterminate(true);\n\t mProgress.setCancelable(false); \n\t mProgress.show();\n \t}\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(context);\n pDialog.setMessage(\"Fetching videolists..\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(true);\n pDialog.show();\n }", "@Override\n\tprotected void onPreExecute() {\n\t\tsuper.onPreExecute();\n\n\t\tprogress = ProgressDialog.show(act, \"\", \"Please wait ...\", true);\n\t\talert = new AlertDialog.Builder(act);\n\n\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tdialog = new ProgressDialog(BookingConfirmationScreen.this);\n\t\t\tdialog.setIndeterminate(false);\n\t\t\tdialog.setCancelable(true);\n\t\t\tdialog.show();\n\n\t\t}", "@Override\r\n\t\t protected void onPreExecute() {\n \t\tprogress= ProgressDialog.show(\r\n \t\t\t\tDetailProgramActivity.this, \r\n \t\t\t\t\"\", \r\n \t\t\t\tgetString(R.string.loading_data), \r\n \t\t\t\ttrue);\r\n \t}", "private void showProgressIndication() {\n Log.i(TAG, \"loading contacts... \");\n // TODO: make this be a no-op if the progress indication is\n // already visible with the exact same title and message.\n\n dismissProgressIndication(); // Clean up any prior progress indication\n\n mProgressDialog = new ProgressDialog(this);\n mProgressDialog.setMessage(this.getResources().getString(R.string.contact_list_loading));\t\n mProgressDialog.setIndeterminate(true);\n mProgressDialog.setCancelable(false);\n mProgressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\ttry {\n\t\t\t\tdialog.setIndeterminate(false);\n\t\t\t\tdialog.setMax(100);\n\t\t\t\tdialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n\t\t\t\tdialog.setCancelable(false);\n\t\t\t\tdialog.show();\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "public void initLoadingPage(Context c) {\n\n LayoutInflater inflater = (LayoutInflater) c.getSystemService( c.LAYOUT_INFLATER_SERVICE);\n final AlertDialog.Builder nameBuilder = new AlertDialog.Builder(c);\n View alertDiaView = inflater.inflate(R.layout.activity_loading_page,null);\n nameBuilder.setView(alertDiaView);\n\n avi = (AVLoadingIndicatorView) alertDiaView.findViewById(R.id.avi);\n avi.smoothToShow();\n\n\n int val= (int) (130 * Resources.getSystem().getDisplayMetrics().density);//dp to px\n alertDialog= nameBuilder.show();\n alertDialog.getWindow().setLayout(val ,val);\n\n\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n pDialog = new ProgressDialog(Activity_List.this);\n pDialog.setMessage(\"Loading spots. Please wait...\");\n\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "void dismissProgressLoading() {\n if (progressDialog != null) {\n progressDialog.dismiss();\n }\n }" ]
[ "0.8557397", "0.8352308", "0.82789254", "0.822031", "0.81208867", "0.81119037", "0.8109187", "0.8075028", "0.8038799", "0.8010011", "0.7997998", "0.7951318", "0.79485315", "0.7929994", "0.7912588", "0.78673536", "0.78506404", "0.78455085", "0.7834386", "0.78159356", "0.7798382", "0.7783928", "0.77606034", "0.776037", "0.77493894", "0.7749244", "0.7738311", "0.77311546", "0.7700916", "0.76972014", "0.76817316", "0.7670399", "0.766943", "0.76627254", "0.76446176", "0.76366425", "0.7630347", "0.762616", "0.7624932", "0.7620938", "0.7596425", "0.75929266", "0.7557972", "0.7557277", "0.75520486", "0.75413543", "0.7538379", "0.7530844", "0.7519652", "0.7451313", "0.74426204", "0.7441246", "0.7432651", "0.7425224", "0.7425224", "0.74187386", "0.74184424", "0.7416521", "0.741279", "0.74040735", "0.73892313", "0.7383382", "0.7360728", "0.7360464", "0.73591536", "0.73590803", "0.7352029", "0.7331429", "0.73278165", "0.7317555", "0.7315141", "0.73144925", "0.73100406", "0.73100406", "0.729128", "0.72901034", "0.7282718", "0.7282481", "0.72801375", "0.7275317", "0.7273378", "0.7273378", "0.7271452", "0.725862", "0.7244717", "0.7231727", "0.7228533", "0.72280747", "0.72067726", "0.72014236", "0.7187425", "0.716973", "0.716876", "0.7168217", "0.7168039", "0.71662796", "0.71654224", "0.7158605", "0.71551263", "0.7152313", "0.71458834" ]
0.0
-1
pDialog = new ProgressDialog(this); pDialog.setCancelable(false); pDialog.setMessage("Loading ..."); pDialog.show();
private void getDataModern(){ UserAPIService api = Config.getRetrofit().create(UserAPIService.class); Call<Value> call = api.lihat_jenis("Modern"); call.enqueue(new Callback<Value>() { @Override public void onResponse(Call<Value> call, Response<Value> response) { // pDialog.dismiss(); String value1 = response.body().getStatus(); if (value1.equals("1")){ Value value = response.body(); resultAlls = new ArrayList<>(Arrays.asList(value.getResult())); adapter = new RecyclerAdapterListAll(resultAlls,getApplicationContext()); recyclerView.setAdapter(adapter); }else { Toast.makeText(ListPonpesActivity.this,"Maaf Data Tidak Ada",Toast.LENGTH_SHORT).show(); } } @Override public void onFailure(Call<Value> call, Throwable t) { // pDialog.dismiss(); Toast.makeText(ListPonpesActivity.this,"Respon gagal",Toast.LENGTH_SHORT).show(); Log.d("Hasil internet",t.toString()); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void showProgressDialog(){\n progressDialog=ProgressDialog.show(context,\"\",\"Loading...Please wait...\");\n\n\n }", "private Dialog buildLoadingDialog() {\n ProgressDialog dialog = new ProgressDialog(this);\n dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n dialog.setMessage(getText(R.string.dialog_loading));\n dialog.setIndeterminate(true);\n dialog.setCancelable(false);\n return dialog;\n }", "protected void showLoading()\n {\n progressBar = new ProgressDialog(this);\n progressBar.setTitle(\"Loading\");\n progressBar.setMessage(\"Wait while loading...\");\n progressBar.setCancelable(false); // disable dismiss by tapping outside of the dialog\n progressBar.show();\n }", "private void creatDialog() {\n \t mDialog=new ProgressDialog(this);\n \t mDialog.setTitle(\"\");\n \t mDialog.setMessage(\"正在加载请稍后\");\n \t mDialog.setIndeterminate(true);\n \t mDialog.setCancelable(true);\n \t mDialog.show();\n \n\t}", "@Override\n protected void onPreExecute() {\n\n dialog = new ProgressDialog(context);\n dialog.setTitle(\"Loading Contents\");\n dialog.setMessage(\"Doing something interesting ...\");\n dialog.setIndeterminate(true);\n dialog.setCancelable(false);\n dialog.show();\n }", "public void showProgressDialog() {\r\n progressDialog.setMessage(getResources().getString(R.string.text_loading));\r\n progressDialog.setCancelable(false);\r\n progressDialog.show();\r\n }", "@Override\n\t\tprotected void onPreExecute()\n\t\t{\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog = new ProgressDialog(MainActivity.this);\n\t\t\tpDialog.setMessage(\"Loading....\");\n\t\t\tpDialog.setCancelable(true);\n\t\t\tpDialog.show();\n\t\t}", "protected void onPreExecute() {\r\n \tdialog = new ProgressDialog(context);\r\n \t\tdialog.setMessage(\"Loading...\");\r\n \t\tdialog.show();\r\n }", "@Override\n protected void onPreExecute() {\n progressDialog= new ProgressDialog(getActivity());\n progressDialog.setMessage(\"loading..\");\n progressDialog.setIndeterminate(false);\n progressDialog.show();\n }", "private void displayLoader() {\n pDialog = new ProgressDialog(DangKyActivity.this);\n pDialog.setMessage(\"Vui lòng đợi trong giây lát...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\t \tprotected void onPreExecute() {\n\t\t try {\n\t\t\t \tpd=new ProgressDialog(Styles_Dialog.this);\n\t\t\t \tpd.setMessage(\"Loading\");\n\t\t\t \tpd.show();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t}\n\t\t \t\n\t\t \t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tpdia = new ProgressDialog(mContext);\n\t\t\tpdia.setMessage(\"Loading...\");\n\t\t\tpdia.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "private void displayLoader() {\n pDialog = new ProgressDialog(AddReviewActivity.this);\n pDialog.setMessage(\"Adding Review...Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog = new ProgressDialog(activity);\n\t\t\tpDialog.setMessage(\"Loading...\");\n\t\t\tpDialog.setIndeterminate(false);\n\t\t\tpDialog.setCancelable(true);\n\t\t\tpDialog.show();\n\t\t}", "@Override\n protected void onPreExecute() {\n\n\n dialog = new ProgressDialog(MainArea.this);\n dialog.setTitle(\"Loading Results\");\n dialog.setMessage(\"Please Wait Results Are Loading For You....\");\n dialog.setCanceledOnTouchOutside(false);\n dialog.show();\n super.onPreExecute();\n }", "private void progressStuff() {\n cd = new ConnectionDetector(getActivity());\n parser = new JSONParser();\n progress = new ProgressDialog(getActivity());\n progress.setMessage(getResources().getString(R.string.loading));\n progress.setIndeterminate(false);\n progress.setCancelable(true);\n // progress.show();\n }", "@Override\r\n\t\tprotected void onPreExecute() {\r\n\t\t\tsuper.onPreExecute();\r\n\t\t\tpDialog = new ProgressDialog(getActivity());\r\n\t\t\tpDialog.setMessage(\"Loading...\");\r\n\t\t\tpDialog.setIndeterminate(false);\r\n\t\t\tpDialog.setCancelable(false);\r\n\t\t\tpDialog.show();\r\n\t\t}", "void showProgressLoading(Context context, boolean isCancelable) {\n\n progressDialog = new ProgressDialog(context);\n progressDialog.setIndeterminate(true);\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progressDialog.setMessage(\"Loading...\");\n progressDialog.setCancelable(isCancelable);\n progressDialog.setCanceledOnTouchOutside(false);\n\n progressDialog.show();\n\n }", "protected final void showLoadingDialog() {\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pd = new ProgressDialog(activity);\n pd.setMessage(\"Loading, Please Wait.....\");\n pd.setCancelable(false);\n pd.show();\n }", "public void showProgressDialog() {\n if (mProgressDialog == null) {\n mProgressDialog = new ProgressDialog(this);\n mProgressDialog.setCancelable(false);\n mProgressDialog.setCanceledOnTouchOutside(false);\n mProgressDialog.setMessage(getString(R.string.msg_loading));\n mProgressDialog.setIndeterminate(true);\n }\n mProgressDialog.show();\n }", "private void showSpinerProgress() {\n dialog.setMessage(\"Loading\");\n//\n// dialog.setButton(ProgressDialog.BUTTON_POSITIVE, \"YES\", new DialogInterface.OnClickListener() {\n// @Override\n// public void onClick(DialogInterface dialog, int which) {\n//\n// }\n// });\n\n //thiet lap k the huy - co the huy\n dialog.setCancelable(false);\n\n //show dialog\n dialog.show();\n Timer timer = new Timer();\n timer.schedule(new TimerTask() {\n @Override\n public void run() {\n dialog.dismiss();\n }\n }, 20000000);\n }", "public void initProgressLoader() {\n progressDialog = new ProgressDialog(this);\n progressDialog.setIndeterminate(true);\n progressDialog.setCancelable(false);\n }", "private void showDialog(){\n progress = new ProgressDialog(this);\n progress.setTitle(getString(R.string.progress_dialog_loading));\n progress.setMessage(getString(R.string.progress_dialog_authenticating_with_firebase));\n progress.setCancelable(false);\n progress.show();\n }", "private void displayLoader() {\n pDialog = new ProgressDialog(RegisterActivity.this);\n pDialog.setMessage(\"Signing Up.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tprogressDialog = ProgressDialog.show(MainActivity.this, \"\",\n\t\t\t\t\t\"Loading...\");\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tmyDialog = ProgressDialog.show\n\t\t\t\t\t(\n\t\t\t\t\t\t\tgetActivity(),\n\t\t\t\t\t\t\t\"Loading...\",\n\t\t\t\t\t\t\t\"Please Wait\",\n\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t);\n\t\t}", "@Override\n\tprotected void onPreExecute() {\n\t\t\n\t\t pDialog = new ProgressDialog(context);\n\t\t\ttry{\n\t\t\t\tthis.pDialog.setMessage(\"Please wait ...\");\n\t\t this.pDialog.setIndeterminateDrawable(context.getResources().getDrawable(R.drawable.red_progress));\n\t\t this.pDialog.setIndeterminate(false);\n\t\t this.pDialog.setCancelable(false);\n\t\t this.pDialog.show();\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\te.getMessage();\n\t\t\t}\n\t}", "private void showProgressDialog()\n {\n if (showProgressDialog && !getStatus().equals(AsyncTask.Status.FINISHED)) {\n //show the dialog if valid activity. If the OS is lollipop or higher then set the theme.\n //dialog = ProgressDialog.show(activity, \"In progress..\", message, true);\n if (Build.VERSION.SDK_INT >= 21) {\n dialog = new ProgressDialog(activity, R.style.progressoAlertDialogStyle);\n dialog.setTitle(\"In progress..\");\n dialog.setMessage(message);\n dialog.setIndeterminate(true);\n dialog.show();\n }\n else {\n dialog = ProgressDialog.show(activity, \"In progress..\", message, true);\n }\n\n dialog.setCancelable(false);\n } \n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(TalkActivity.this);\n pDialog.setMessage(getResources().getString(R.string.loading));\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n public void showloading(String message) {\n progressDialog = new ProgressDialog(getActivity());\n progressDialog.setMessage(message);\n progressDialog.setIndeterminate(true);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(Integrationforkhalti.this);\n pDialog.setMessage(\"Loading Please wait...\");\n pDialog.setIndeterminate(true);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n mProgressDialog = new ProgressDialog(getActivity());\n mProgressDialog.setMessage(getString(R.string.loading_text));\n mProgressDialog.setCancelable(false);\n }", "private void showProgressDialog() {\n if (progressDialog == null) {\n progressDialog = new ProgressDialog(getContext());\n }\n\n progressDialog.setTitle(R.string.dialog_title);\n progressDialog.setMessage(getResources().getString(R.string.dialog_message));\n progressDialog.setCancelable(false);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n /* mProgress.setMessage(\"Please Wait\");\n mProgress.setCancelable(false);\n mProgress.show();*/\n String msg = \"Please Wait....\";\n cd.showProgressDialog(msg);\n }", "private void showLoadingDialogue(final String loadingMessage) {\n progressDialog.setMessage(loadingMessage);\n progressDialog.setCancelable(false);\n progressDialog.setIndeterminate(false);\n progressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() \n\t\t{\n\t\t\t\n\t\t\tdialog = new ProgressDialog(AddFoodAdvActivity.this);\n\t\t\tdialog.setMessage(\"Loading...\");\n\t\t\tdialog.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "private void showDialog() {\n try {\n pDialog.setMessage(getString(R.string.please_wait));\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.setCanceledOnTouchOutside(false);\n pDialog.show();\n } catch (Exception e) {\n // TODO: handle exception\n }\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tdl = ProgressDialog.show(getActivity(), \"Thông báo\", \"Loading...\",\n\t\t\t\t\ttrue, false);\n\t\t\tdl.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n protected void onPreExecute()\n {\n // Create a new progress dialog\n progressDialog = new ProgressDialog(MainActivity.this);\n // Set the progress dialog spinner progress bar\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n // Set the dialog title to 'Loading...'\n progressDialog.setTitle(\"Loading...\");\n // Set the dialog message to 'Loading application View, please wait...'\n progressDialog.setMessage(\"Loading application, please wait...\");\n // This dialog can't be canceled by pressing the back key\n progressDialog.setCancelable(false);\n // This dialog isn't indeterminate\n progressDialog.setIndeterminate(false);\n // The maximum number of items is 100\n progressDialog.setMax(100);\n // Set the current progress to zero\n progressDialog.setProgress(0);\n // Display the progress dialog\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progressDialog.setMessage(\"Please wait. Loading...\");\n progressDialog.setCanceledOnTouchOutside(false);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n pDialog = new ProgressDialog(getActivity());\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(false);\n pDialog.setIndeterminate(false);\n pDialog.setMax(100);\n pDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n pDialog.show();\n// progressBar.setVisibility(View.VISIBLE);\n// progressBar.setProgress(0);\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n\n dialog = new ProgressDialog(AddFoodAdvActivity.this);\n dialog.setMessage(\"Please Wait...!\");\n dialog.show();\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n showProgressDialog(R.string.please_wait);\n //showDialog(progress_bar_type);\n }", "@Override\r\n\tprotected void onPreExecute()\r\n\t{\r\n\t\tprogress = new ProgressDialog(ctx);\r\n\t\tprogress.setTitle(\"Retrieving Parking Information\");\r\n\t\tprogress.setMessage(\"Please wait.\");\r\n\t\tprogress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\r\n\t\tprogress.show();\r\n\t\tsuper.onPreExecute();\r\n\t}", "@Override\n protected void onPreExecute() {\n progressDialog = new ProgressDialog(getActivity());\n progressDialog.setTitle(getResources().getString(R.string.please_wait));\n progressDialog.setMessage(getResources().getString(R.string.fetching_data));\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n // Showing progress dialog\n pDialog = new ProgressDialog(thisContext);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(true);\n pDialog.show();\n\n }", "private void displayProgressDialog() {\n pDialog.setMessage(\"Logging in.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\r\n \tprotected void onPreExecute() {\n \t\tsuper.onPreExecute();\r\n \t\tpdia = new ProgressDialog(Regmember.this);\r\n \t\tpdia.setCanceledOnTouchOutside(false);\r\n pdia.setMessage(\"Dhiraj rakh..........\");\r\n pdia.show(); \r\n \t}", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n this.dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n this.dialog.setCancelable(false);\n this.dialog.show();\n }", "@Override\n protected void onPreExecute() {\n pDialog = new ProgressDialog(homeActivity);\n pDialog.setMessage(\"Retrieving Details... \");\n // pDialog.setMax(16);\n pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\n pDialog.setCancelable(false);\n pDialog.show();\n\n\n }", "public void onPreExecute() {\n progressDialog.show();\n }", "@Override\r\n\t protected void onPreExecute() {\n\t super.onPreExecute();\r\n\t progressDialog = new ProgressDialog(UDMap.this);\r\n\t progressDialog.setMessage(\"Loading the best way...\");\r\n\t progressDialog.setIndeterminate(true);\r\n\t progressDialog.show();\r\n\t }", "void showProgressDialog();", "void showProgressDialog();", "protected void onPreExecute() {\n try {\n this.dialog.setMessage(getContext().getResources().getString(R.string.loading));\n this.dialog.show();\n } catch (Exception ex) {\n Log.e(null, ex);\n }\n }", "public void showProgressDialog() {\n pd = new ProgressDialog(this);\n pd.setMessage(\"Renting film...\");\n pd.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog1 = new ProgressDialog(Doctorslist.this);\n\t\t\tpDialog1.setMessage(\"Loading ...\");\n\t\t\tpDialog1.setIndeterminate(false);\n\t\t\tpDialog1.setCancelable(false);\n\t\t\tpDialog1.show();\n\t\t}", "public void showProgressDialog() {\n try {\n if (progressDialog == null) {\n try {\n progressDialog = new ProgressDialog(self);\n progressDialog.show();\n progressDialog.setCancelable(false);\n } catch (Exception e) {\n progressDialog = new ProgressDialog(self.getParent());\n progressDialog.show();\n progressDialog.setCancelable(false);\n e.printStackTrace();\n }\n } else {\n if (!progressDialog.isShowing())\n progressDialog.show();\n }\n } catch (Exception e) {\n progressDialog = new ProgressDialog(self);\n progressDialog.show();\n progressDialog.setCancelable(false);\n e.printStackTrace();\n }\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n loading = ProgressDialog.show(this.context, \"Fetching Data\",\"Please Wait...\",true,true);\n }", "private void showProgressDialog() {\n mProgressDialog = AppDialog.showProgressDialog(this);\n mProgressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n asyncDialog.setMessage(\"Loading...\");\n //show dialog\n asyncDialog.show();\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n progress = new ProgressDialog(hostContext);\n progress.setMessage(\"Wait while books are being downloaded...\");\n progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progress.show();\n }", "public void showProgress2(){\n// if (mHandler==null){\n// mHandler = new Handler(Looper.getMainLooper());\n// }\n new Handler(Looper.getMainLooper()).post(new Runnable() {\n @Override\n public void run() {\n loadingDialog = new Dialog(BaseActivity.this);\n loadingDialog.setTitle(\"Loading data..\");\n loadingDialog.setContentView(R.layout.loading);\n loadingDialog.show();\n\n }\n });\n// mHandler.post(new Runnable() {\n// @Override\n// public void run() {\n// loadingDialog = new Dialog(BaseActivity.this);\n// loadingDialog.setTitle(\"Loading data..\");\n// loadingDialog.setContentView(R.layout.loading);\n// loadingDialog.show();\n//\n// }\n// });\n }", "private void displayProgressDialog() {\n pDialog.setMessage(\"Logging In.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\t// TODO Auto-generated method stub\n\t\t\tsuper.onPreExecute();\n\t\t\tpd = ProgressDialogUtil.createDialogNoTitle(context, \"loading...\");\n\t\t\tpd.show();\n\t\t}", "protected void createProgressDialog() {\r\t\tif (pd == null) {\r\t\t\tpd = new ProgressDialog(this);\r\t\t\tpd.setCanceledOnTouchOutside(false);\r\t\t\tpd.getWindow().setGravity(Gravity.CENTER);\r\t\t\tpd.setOnCancelListener(new DialogInterface.OnCancelListener() {\r\t\t\t\t@Override\r\t\t\t\tpublic void onCancel(DialogInterface dialogInterface) {\r\t\t\t\t\tonPdCancel();\r\t\t\t\t}\r\t\t\t});\r\t\t}\r\t}", "private void showLoadingDialog() {\n mDefaultLoadingDialogFragment = new DefaultLoadingDialogFragment();\n mDefaultLoadingDialogFragment.show(getChildFragmentManager(), \"loadingDialog\");\n }", "@Override\n\t protected void onPreExecute() {\n\t super.onPreExecute();\n\t \n\t progressDialog= new Dialog(ListKotaActivity.this);\n\t progressDialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);\n\t progressDialog.setContentView(R.layout.progress);\n\t progressDialog.setCancelable(false);\n\t progressDialog.show();\t \n\t }", "@Override\n \t\tprotected void onPreExecute() \n \t\t{\n \t\t\t//Create a new progress dialog\n \t\t\tprogressDialog = new ProgressDialog(MainActivity.this);\n \t\t\t//Set the progress dialog to display a horizontal progress bar \n \t\t\tprogressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n \t\t\t//Set the dialog title to 'Loading...'\n \t\t\tprogressDialog.setTitle(\"Loading Game...\");\n \t\t\t//Set the dialog message to 'Loading application View, please wait...'\n \t\t\tprogressDialog.setMessage(\"Please wait...\");\n \t\t\t//This dialog can't be canceled by pressing the back key\n \t\t\tprogressDialog.setCancelable(false);\n \t\t\t//This dialog isn't indeterminate\n \t\t\tprogressDialog.setIndeterminate(false);\n \t\t\t//The maximum number of items is 100\n \t\t\tprogressDialog.setMax(100);\n \t\t\t//Set the current progress to zero\n \t\t\tprogressDialog.setProgress(0);\n \t\t\t//Display the progress dialog\n \t\t\tprogressDialog.show();\n \t\t}", "@Override\n protected void onPreExecute() {\n String msg = \"Please Wait....\";\n cd.showProgressDialog(msg);\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tshowLoadingProgressDialog();\n\t\t}", "@Override\n protected void onPreExecute() {\n showLoadingProgressDialog();\n }", "@Override\n protected void onPreExecute() {\n showLoadingProgressDialog();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n pDialog = new ProgressDialog(Resume_create_employee.this);\n pDialog.setMessage(\"Loading...\");\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(MainActivity.this);\n pDialog.setMessage(\"Processing Request...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\r\n protected void onPreExecute() {\n if( progressDialog == null ) {\r\n progressDialog = ProgressDialog.show( context, context.getString(R.string.pref_sync_callings_now_title),\"\");\r\n }\r\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(DetailActivity.this);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(true);\n pDialog.show();\n }", "@Override\r\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\r\n\t\t\tpDialog = new ProgressDialog(SingleRecord.this);\r\n\t\t\tpDialog.setMessage(\"downloading...\");\r\n\t\t\tpDialog.setIndeterminate(false);\r\n\t\t\tpDialog.setCancelable(true);\r\n\t\t\r\n\t\t\tpDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\r\n\t\t\tpDialog.show();\r\n\t\t\tpDialog.getWindow().setGravity(Gravity.BOTTOM);\r\n\t\t}", "@Override\n protected void onPreExecute() {\n\n this.dialog.setMessage(\"Please wait ...\");\n this.dialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\taProgressDialog = new ProgressDialog(TargetProducts.this);\n\t\t\taProgressDialog.setMessage(\"Loading Report...\");\n\t\t\taProgressDialog.setIndeterminate(true);\n\t\t\taProgressDialog.setCanceledOnTouchOutside(true);\n\t\t\taProgressDialog.show();\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\taProgressDialog = new ProgressDialog(TargetProducts.this);\n\t\t\taProgressDialog.setMessage(\"Loading Report...\");\n\t\t\taProgressDialog.setIndeterminate(true);\n\t\t\taProgressDialog.setCanceledOnTouchOutside(true);\n\t\t\taProgressDialog.show();\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\t\n\t\t\tdialog = new ProgressDialog(BookingConfirmationScreen.this);\n\t\t\tdialog.setIndeterminate(false);\n\t\t\tdialog.setCancelable(true);\n\t\t\tdialog.show();\n\t\t\t\n\t\t\t\n\t\t}", "@Override\n protected void onProgressUpdate(Integer... values) {\n super.onProgressUpdate(values);\n progress = new ProgressDialog(activity);\n progress.setMessage(\"please wait.. \");\n progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progress.setIndeterminate(true);\n progress.setCancelable(false);\n progress.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tpdia = new ProgressDialog(mContext);\n\t\t\tpdia.setMessage(\"Loading Circles...\");\n\t\t\tpdia.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n // // pDialog = new ProgressDialog(getContext());\n pDialog = new ProgressDialog(context);\n pDialog.setMessage(\"Cargando Información\");\n pDialog.setCancelable(true);\n pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n pDialog.show();\n\n }", "public void showCustomLoadingDialog() {\n\n //..show gif\n viewDialog.showDialog();\n final Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n //...here i'm waiting 5 seconds before hiding the custom dialog\n //...you can do whenever you want or whenever your work is done\n viewDialog.hideDialog();\n }\n }, 1000);\n }", "public void showProgressDialog() {\n showProgressDialog(null);\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n // Show the progress in load\n pDialog = new ProgressDialog(UpdateTimeTable.this);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(false);\n pDialog.show();\n \n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n progressDialog = new ProgressDialog(AiutaGliAltri.this);\n progressDialog.setMessage(\"Sto Cercando!\");\n progressDialog.setIndeterminate(true);\n progressDialog.setCanceledOnTouchOutside(false);\n progressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tprogressDialog = new ProgressDialog(ListActivity.this);\n\t\t\tprogressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\n\t\t\tprogressDialog.setMessage(\"Loading Programs. .\");\n\t\t\tprogressDialog.setCancelable(false);\n\n\t\t\tprogressDialog.show();\n\t\t}", "private void showProgress(String message) {\n \tif(mProgress==null){\n \t\tmProgress = new ProgressDialog(stActivity);\n\t mProgress.setMessage(message);\n\t mProgress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\t mProgress.setIndeterminate(true);\n\t mProgress.setCancelable(false); \n\t mProgress.show();\n \t}\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(context);\n pDialog.setMessage(\"Fetching videolists..\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(true);\n pDialog.show();\n }", "@Override\n\tprotected void onPreExecute() {\n\t\tsuper.onPreExecute();\n\n\t\tprogress = ProgressDialog.show(act, \"\", \"Please wait ...\", true);\n\t\talert = new AlertDialog.Builder(act);\n\n\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tdialog = new ProgressDialog(BookingConfirmationScreen.this);\n\t\t\tdialog.setIndeterminate(false);\n\t\t\tdialog.setCancelable(true);\n\t\t\tdialog.show();\n\n\t\t}", "@Override\r\n\t\t protected void onPreExecute() {\n \t\tprogress= ProgressDialog.show(\r\n \t\t\t\tDetailProgramActivity.this, \r\n \t\t\t\t\"\", \r\n \t\t\t\tgetString(R.string.loading_data), \r\n \t\t\t\ttrue);\r\n \t}", "private void showProgressIndication() {\n Log.i(TAG, \"loading contacts... \");\n // TODO: make this be a no-op if the progress indication is\n // already visible with the exact same title and message.\n\n dismissProgressIndication(); // Clean up any prior progress indication\n\n mProgressDialog = new ProgressDialog(this);\n mProgressDialog.setMessage(this.getResources().getString(R.string.contact_list_loading));\t\n mProgressDialog.setIndeterminate(true);\n mProgressDialog.setCancelable(false);\n mProgressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\ttry {\n\t\t\t\tdialog.setIndeterminate(false);\n\t\t\t\tdialog.setMax(100);\n\t\t\t\tdialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n\t\t\t\tdialog.setCancelable(false);\n\t\t\t\tdialog.show();\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "public void initLoadingPage(Context c) {\n\n LayoutInflater inflater = (LayoutInflater) c.getSystemService( c.LAYOUT_INFLATER_SERVICE);\n final AlertDialog.Builder nameBuilder = new AlertDialog.Builder(c);\n View alertDiaView = inflater.inflate(R.layout.activity_loading_page,null);\n nameBuilder.setView(alertDiaView);\n\n avi = (AVLoadingIndicatorView) alertDiaView.findViewById(R.id.avi);\n avi.smoothToShow();\n\n\n int val= (int) (130 * Resources.getSystem().getDisplayMetrics().density);//dp to px\n alertDialog= nameBuilder.show();\n alertDialog.getWindow().setLayout(val ,val);\n\n\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n pDialog = new ProgressDialog(Activity_List.this);\n pDialog.setMessage(\"Loading spots. Please wait...\");\n\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "void dismissProgressLoading() {\n if (progressDialog != null) {\n progressDialog.dismiss();\n }\n }" ]
[ "0.8557045", "0.8352073", "0.82782894", "0.8220604", "0.81204444", "0.81114143", "0.81088936", "0.8075008", "0.80385983", "0.80099565", "0.7998021", "0.7951042", "0.7948951", "0.79297745", "0.79125816", "0.7867626", "0.78503615", "0.7844461", "0.783419", "0.78155154", "0.7797405", "0.77843785", "0.77607805", "0.77604836", "0.77496994", "0.774902", "0.7738241", "0.77314544", "0.77007455", "0.7697283", "0.7681435", "0.7670188", "0.76689005", "0.7662171", "0.76446056", "0.76371026", "0.76303965", "0.7626374", "0.7624843", "0.7620683", "0.7596071", "0.75929445", "0.75580853", "0.75576144", "0.75520533", "0.7541554", "0.7538303", "0.7531022", "0.7519704", "0.74514204", "0.7442647", "0.74413776", "0.7432885", "0.74249965", "0.74249965", "0.7418813", "0.7418208", "0.7415767", "0.7411552", "0.74035907", "0.73882425", "0.7383069", "0.73605984", "0.7360434", "0.7359214", "0.7358813", "0.7352035", "0.7331254", "0.7327694", "0.73176116", "0.7315045", "0.73140264", "0.7309725", "0.7309725", "0.7290968", "0.72906554", "0.7282565", "0.7282205", "0.72795296", "0.72756755", "0.72727454", "0.72727454", "0.72711354", "0.72585666", "0.7244673", "0.72320485", "0.722821", "0.7227202", "0.72064906", "0.72013676", "0.71868914", "0.7170065", "0.7168721", "0.71682936", "0.7167675", "0.7166334", "0.7164909", "0.71586955", "0.71556073", "0.71518874", "0.71462655" ]
0.0
-1
pDialog = new ProgressDialog(this); pDialog.setCancelable(false); pDialog.setMessage("Loading ..."); pDialog.show();
private void getDataLainya(){ UserAPIService api = Config.getRetrofit().create(UserAPIService.class); Call<Value> call = api.lihat_jenis("Komprehensif"); call.enqueue(new Callback<Value>() { @Override public void onResponse(Call<Value> call, Response<Value> response) { // pDialog.dismiss(); String value1= response.body().getStatus(); if (value1.equals("1")){ Value value = response.body(); resultAlls = new ArrayList<>(Arrays.asList(value.getResult())); adapter = new RecyclerAdapterListAll(resultAlls,getApplicationContext()); recyclerView.setAdapter(adapter); }else { Toast.makeText(ListPonpesActivity.this,"Maaf Data Tidak Ada",Toast.LENGTH_SHORT).show(); } } @Override public void onFailure(Call<Value> call, Throwable t) { // pDialog.dismiss(); Toast.makeText(ListPonpesActivity.this,"Respon gagal",Toast.LENGTH_SHORT).show(); Log.d("Hasil internet",t.toString()); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void showProgressDialog(){\n progressDialog=ProgressDialog.show(context,\"\",\"Loading...Please wait...\");\n\n\n }", "private Dialog buildLoadingDialog() {\n ProgressDialog dialog = new ProgressDialog(this);\n dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n dialog.setMessage(getText(R.string.dialog_loading));\n dialog.setIndeterminate(true);\n dialog.setCancelable(false);\n return dialog;\n }", "protected void showLoading()\n {\n progressBar = new ProgressDialog(this);\n progressBar.setTitle(\"Loading\");\n progressBar.setMessage(\"Wait while loading...\");\n progressBar.setCancelable(false); // disable dismiss by tapping outside of the dialog\n progressBar.show();\n }", "private void creatDialog() {\n \t mDialog=new ProgressDialog(this);\n \t mDialog.setTitle(\"\");\n \t mDialog.setMessage(\"正在加载请稍后\");\n \t mDialog.setIndeterminate(true);\n \t mDialog.setCancelable(true);\n \t mDialog.show();\n \n\t}", "@Override\n protected void onPreExecute() {\n\n dialog = new ProgressDialog(context);\n dialog.setTitle(\"Loading Contents\");\n dialog.setMessage(\"Doing something interesting ...\");\n dialog.setIndeterminate(true);\n dialog.setCancelable(false);\n dialog.show();\n }", "public void showProgressDialog() {\r\n progressDialog.setMessage(getResources().getString(R.string.text_loading));\r\n progressDialog.setCancelable(false);\r\n progressDialog.show();\r\n }", "@Override\n\t\tprotected void onPreExecute()\n\t\t{\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog = new ProgressDialog(MainActivity.this);\n\t\t\tpDialog.setMessage(\"Loading....\");\n\t\t\tpDialog.setCancelable(true);\n\t\t\tpDialog.show();\n\t\t}", "protected void onPreExecute() {\r\n \tdialog = new ProgressDialog(context);\r\n \t\tdialog.setMessage(\"Loading...\");\r\n \t\tdialog.show();\r\n }", "@Override\n protected void onPreExecute() {\n progressDialog= new ProgressDialog(getActivity());\n progressDialog.setMessage(\"loading..\");\n progressDialog.setIndeterminate(false);\n progressDialog.show();\n }", "private void displayLoader() {\n pDialog = new ProgressDialog(DangKyActivity.this);\n pDialog.setMessage(\"Vui lòng đợi trong giây lát...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\t \tprotected void onPreExecute() {\n\t\t try {\n\t\t\t \tpd=new ProgressDialog(Styles_Dialog.this);\n\t\t\t \tpd.setMessage(\"Loading\");\n\t\t\t \tpd.show();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t}\n\t\t \t\n\t\t \t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tpdia = new ProgressDialog(mContext);\n\t\t\tpdia.setMessage(\"Loading...\");\n\t\t\tpdia.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "private void displayLoader() {\n pDialog = new ProgressDialog(AddReviewActivity.this);\n pDialog.setMessage(\"Adding Review...Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog = new ProgressDialog(activity);\n\t\t\tpDialog.setMessage(\"Loading...\");\n\t\t\tpDialog.setIndeterminate(false);\n\t\t\tpDialog.setCancelable(true);\n\t\t\tpDialog.show();\n\t\t}", "@Override\n protected void onPreExecute() {\n\n\n dialog = new ProgressDialog(MainArea.this);\n dialog.setTitle(\"Loading Results\");\n dialog.setMessage(\"Please Wait Results Are Loading For You....\");\n dialog.setCanceledOnTouchOutside(false);\n dialog.show();\n super.onPreExecute();\n }", "private void progressStuff() {\n cd = new ConnectionDetector(getActivity());\n parser = new JSONParser();\n progress = new ProgressDialog(getActivity());\n progress.setMessage(getResources().getString(R.string.loading));\n progress.setIndeterminate(false);\n progress.setCancelable(true);\n // progress.show();\n }", "@Override\r\n\t\tprotected void onPreExecute() {\r\n\t\t\tsuper.onPreExecute();\r\n\t\t\tpDialog = new ProgressDialog(getActivity());\r\n\t\t\tpDialog.setMessage(\"Loading...\");\r\n\t\t\tpDialog.setIndeterminate(false);\r\n\t\t\tpDialog.setCancelable(false);\r\n\t\t\tpDialog.show();\r\n\t\t}", "void showProgressLoading(Context context, boolean isCancelable) {\n\n progressDialog = new ProgressDialog(context);\n progressDialog.setIndeterminate(true);\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progressDialog.setMessage(\"Loading...\");\n progressDialog.setCancelable(isCancelable);\n progressDialog.setCanceledOnTouchOutside(false);\n\n progressDialog.show();\n\n }", "protected final void showLoadingDialog() {\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pd = new ProgressDialog(activity);\n pd.setMessage(\"Loading, Please Wait.....\");\n pd.setCancelable(false);\n pd.show();\n }", "public void showProgressDialog() {\n if (mProgressDialog == null) {\n mProgressDialog = new ProgressDialog(this);\n mProgressDialog.setCancelable(false);\n mProgressDialog.setCanceledOnTouchOutside(false);\n mProgressDialog.setMessage(getString(R.string.msg_loading));\n mProgressDialog.setIndeterminate(true);\n }\n mProgressDialog.show();\n }", "private void showSpinerProgress() {\n dialog.setMessage(\"Loading\");\n//\n// dialog.setButton(ProgressDialog.BUTTON_POSITIVE, \"YES\", new DialogInterface.OnClickListener() {\n// @Override\n// public void onClick(DialogInterface dialog, int which) {\n//\n// }\n// });\n\n //thiet lap k the huy - co the huy\n dialog.setCancelable(false);\n\n //show dialog\n dialog.show();\n Timer timer = new Timer();\n timer.schedule(new TimerTask() {\n @Override\n public void run() {\n dialog.dismiss();\n }\n }, 20000000);\n }", "public void initProgressLoader() {\n progressDialog = new ProgressDialog(this);\n progressDialog.setIndeterminate(true);\n progressDialog.setCancelable(false);\n }", "private void showDialog(){\n progress = new ProgressDialog(this);\n progress.setTitle(getString(R.string.progress_dialog_loading));\n progress.setMessage(getString(R.string.progress_dialog_authenticating_with_firebase));\n progress.setCancelable(false);\n progress.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tprogressDialog = ProgressDialog.show(MainActivity.this, \"\",\n\t\t\t\t\t\"Loading...\");\n\t\t}", "private void displayLoader() {\n pDialog = new ProgressDialog(RegisterActivity.this);\n pDialog.setMessage(\"Signing Up.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tmyDialog = ProgressDialog.show\n\t\t\t\t\t(\n\t\t\t\t\t\t\tgetActivity(),\n\t\t\t\t\t\t\t\"Loading...\",\n\t\t\t\t\t\t\t\"Please Wait\",\n\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t);\n\t\t}", "@Override\n\tprotected void onPreExecute() {\n\t\t\n\t\t pDialog = new ProgressDialog(context);\n\t\t\ttry{\n\t\t\t\tthis.pDialog.setMessage(\"Please wait ...\");\n\t\t this.pDialog.setIndeterminateDrawable(context.getResources().getDrawable(R.drawable.red_progress));\n\t\t this.pDialog.setIndeterminate(false);\n\t\t this.pDialog.setCancelable(false);\n\t\t this.pDialog.show();\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\te.getMessage();\n\t\t\t}\n\t}", "private void showProgressDialog()\n {\n if (showProgressDialog && !getStatus().equals(AsyncTask.Status.FINISHED)) {\n //show the dialog if valid activity. If the OS is lollipop or higher then set the theme.\n //dialog = ProgressDialog.show(activity, \"In progress..\", message, true);\n if (Build.VERSION.SDK_INT >= 21) {\n dialog = new ProgressDialog(activity, R.style.progressoAlertDialogStyle);\n dialog.setTitle(\"In progress..\");\n dialog.setMessage(message);\n dialog.setIndeterminate(true);\n dialog.show();\n }\n else {\n dialog = ProgressDialog.show(activity, \"In progress..\", message, true);\n }\n\n dialog.setCancelable(false);\n } \n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(TalkActivity.this);\n pDialog.setMessage(getResources().getString(R.string.loading));\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n public void showloading(String message) {\n progressDialog = new ProgressDialog(getActivity());\n progressDialog.setMessage(message);\n progressDialog.setIndeterminate(true);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(Integrationforkhalti.this);\n pDialog.setMessage(\"Loading Please wait...\");\n pDialog.setIndeterminate(true);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n mProgressDialog = new ProgressDialog(getActivity());\n mProgressDialog.setMessage(getString(R.string.loading_text));\n mProgressDialog.setCancelable(false);\n }", "private void showProgressDialog() {\n if (progressDialog == null) {\n progressDialog = new ProgressDialog(getContext());\n }\n\n progressDialog.setTitle(R.string.dialog_title);\n progressDialog.setMessage(getResources().getString(R.string.dialog_message));\n progressDialog.setCancelable(false);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n /* mProgress.setMessage(\"Please Wait\");\n mProgress.setCancelable(false);\n mProgress.show();*/\n String msg = \"Please Wait....\";\n cd.showProgressDialog(msg);\n }", "private void showLoadingDialogue(final String loadingMessage) {\n progressDialog.setMessage(loadingMessage);\n progressDialog.setCancelable(false);\n progressDialog.setIndeterminate(false);\n progressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() \n\t\t{\n\t\t\t\n\t\t\tdialog = new ProgressDialog(AddFoodAdvActivity.this);\n\t\t\tdialog.setMessage(\"Loading...\");\n\t\t\tdialog.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "private void showDialog() {\n try {\n pDialog.setMessage(getString(R.string.please_wait));\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.setCanceledOnTouchOutside(false);\n pDialog.show();\n } catch (Exception e) {\n // TODO: handle exception\n }\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tdl = ProgressDialog.show(getActivity(), \"Thông báo\", \"Loading...\",\n\t\t\t\t\ttrue, false);\n\t\t\tdl.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n protected void onPreExecute()\n {\n // Create a new progress dialog\n progressDialog = new ProgressDialog(MainActivity.this);\n // Set the progress dialog spinner progress bar\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n // Set the dialog title to 'Loading...'\n progressDialog.setTitle(\"Loading...\");\n // Set the dialog message to 'Loading application View, please wait...'\n progressDialog.setMessage(\"Loading application, please wait...\");\n // This dialog can't be canceled by pressing the back key\n progressDialog.setCancelable(false);\n // This dialog isn't indeterminate\n progressDialog.setIndeterminate(false);\n // The maximum number of items is 100\n progressDialog.setMax(100);\n // Set the current progress to zero\n progressDialog.setProgress(0);\n // Display the progress dialog\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progressDialog.setMessage(\"Please wait. Loading...\");\n progressDialog.setCanceledOnTouchOutside(false);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n pDialog = new ProgressDialog(getActivity());\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(false);\n pDialog.setIndeterminate(false);\n pDialog.setMax(100);\n pDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n pDialog.show();\n// progressBar.setVisibility(View.VISIBLE);\n// progressBar.setProgress(0);\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n\n dialog = new ProgressDialog(AddFoodAdvActivity.this);\n dialog.setMessage(\"Please Wait...!\");\n dialog.show();\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n showProgressDialog(R.string.please_wait);\n //showDialog(progress_bar_type);\n }", "@Override\r\n\tprotected void onPreExecute()\r\n\t{\r\n\t\tprogress = new ProgressDialog(ctx);\r\n\t\tprogress.setTitle(\"Retrieving Parking Information\");\r\n\t\tprogress.setMessage(\"Please wait.\");\r\n\t\tprogress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\r\n\t\tprogress.show();\r\n\t\tsuper.onPreExecute();\r\n\t}", "@Override\n protected void onPreExecute() {\n progressDialog = new ProgressDialog(getActivity());\n progressDialog.setTitle(getResources().getString(R.string.please_wait));\n progressDialog.setMessage(getResources().getString(R.string.fetching_data));\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n // Showing progress dialog\n pDialog = new ProgressDialog(thisContext);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(true);\n pDialog.show();\n\n }", "private void displayProgressDialog() {\n pDialog.setMessage(\"Logging in.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\r\n \tprotected void onPreExecute() {\n \t\tsuper.onPreExecute();\r\n \t\tpdia = new ProgressDialog(Regmember.this);\r\n \t\tpdia.setCanceledOnTouchOutside(false);\r\n pdia.setMessage(\"Dhiraj rakh..........\");\r\n pdia.show(); \r\n \t}", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n this.dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n this.dialog.setCancelable(false);\n this.dialog.show();\n }", "@Override\n protected void onPreExecute() {\n pDialog = new ProgressDialog(homeActivity);\n pDialog.setMessage(\"Retrieving Details... \");\n // pDialog.setMax(16);\n pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\n pDialog.setCancelable(false);\n pDialog.show();\n\n\n }", "public void onPreExecute() {\n progressDialog.show();\n }", "@Override\r\n\t protected void onPreExecute() {\n\t super.onPreExecute();\r\n\t progressDialog = new ProgressDialog(UDMap.this);\r\n\t progressDialog.setMessage(\"Loading the best way...\");\r\n\t progressDialog.setIndeterminate(true);\r\n\t progressDialog.show();\r\n\t }", "void showProgressDialog();", "void showProgressDialog();", "public void showProgressDialog() {\n pd = new ProgressDialog(this);\n pd.setMessage(\"Renting film...\");\n pd.show();\n }", "protected void onPreExecute() {\n try {\n this.dialog.setMessage(getContext().getResources().getString(R.string.loading));\n this.dialog.show();\n } catch (Exception ex) {\n Log.e(null, ex);\n }\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog1 = new ProgressDialog(Doctorslist.this);\n\t\t\tpDialog1.setMessage(\"Loading ...\");\n\t\t\tpDialog1.setIndeterminate(false);\n\t\t\tpDialog1.setCancelable(false);\n\t\t\tpDialog1.show();\n\t\t}", "public void showProgressDialog() {\n try {\n if (progressDialog == null) {\n try {\n progressDialog = new ProgressDialog(self);\n progressDialog.show();\n progressDialog.setCancelable(false);\n } catch (Exception e) {\n progressDialog = new ProgressDialog(self.getParent());\n progressDialog.show();\n progressDialog.setCancelable(false);\n e.printStackTrace();\n }\n } else {\n if (!progressDialog.isShowing())\n progressDialog.show();\n }\n } catch (Exception e) {\n progressDialog = new ProgressDialog(self);\n progressDialog.show();\n progressDialog.setCancelable(false);\n e.printStackTrace();\n }\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n loading = ProgressDialog.show(this.context, \"Fetching Data\",\"Please Wait...\",true,true);\n }", "private void showProgressDialog() {\n mProgressDialog = AppDialog.showProgressDialog(this);\n mProgressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n asyncDialog.setMessage(\"Loading...\");\n //show dialog\n asyncDialog.show();\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n progress = new ProgressDialog(hostContext);\n progress.setMessage(\"Wait while books are being downloaded...\");\n progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progress.show();\n }", "public void showProgress2(){\n// if (mHandler==null){\n// mHandler = new Handler(Looper.getMainLooper());\n// }\n new Handler(Looper.getMainLooper()).post(new Runnable() {\n @Override\n public void run() {\n loadingDialog = new Dialog(BaseActivity.this);\n loadingDialog.setTitle(\"Loading data..\");\n loadingDialog.setContentView(R.layout.loading);\n loadingDialog.show();\n\n }\n });\n// mHandler.post(new Runnable() {\n// @Override\n// public void run() {\n// loadingDialog = new Dialog(BaseActivity.this);\n// loadingDialog.setTitle(\"Loading data..\");\n// loadingDialog.setContentView(R.layout.loading);\n// loadingDialog.show();\n//\n// }\n// });\n }", "private void displayProgressDialog() {\n pDialog.setMessage(\"Logging In.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\t// TODO Auto-generated method stub\n\t\t\tsuper.onPreExecute();\n\t\t\tpd = ProgressDialogUtil.createDialogNoTitle(context, \"loading...\");\n\t\t\tpd.show();\n\t\t}", "protected void createProgressDialog() {\r\t\tif (pd == null) {\r\t\t\tpd = new ProgressDialog(this);\r\t\t\tpd.setCanceledOnTouchOutside(false);\r\t\t\tpd.getWindow().setGravity(Gravity.CENTER);\r\t\t\tpd.setOnCancelListener(new DialogInterface.OnCancelListener() {\r\t\t\t\t@Override\r\t\t\t\tpublic void onCancel(DialogInterface dialogInterface) {\r\t\t\t\t\tonPdCancel();\r\t\t\t\t}\r\t\t\t});\r\t\t}\r\t}", "private void showLoadingDialog() {\n mDefaultLoadingDialogFragment = new DefaultLoadingDialogFragment();\n mDefaultLoadingDialogFragment.show(getChildFragmentManager(), \"loadingDialog\");\n }", "@Override\n\t protected void onPreExecute() {\n\t super.onPreExecute();\n\t \n\t progressDialog= new Dialog(ListKotaActivity.this);\n\t progressDialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);\n\t progressDialog.setContentView(R.layout.progress);\n\t progressDialog.setCancelable(false);\n\t progressDialog.show();\t \n\t }", "@Override\n \t\tprotected void onPreExecute() \n \t\t{\n \t\t\t//Create a new progress dialog\n \t\t\tprogressDialog = new ProgressDialog(MainActivity.this);\n \t\t\t//Set the progress dialog to display a horizontal progress bar \n \t\t\tprogressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n \t\t\t//Set the dialog title to 'Loading...'\n \t\t\tprogressDialog.setTitle(\"Loading Game...\");\n \t\t\t//Set the dialog message to 'Loading application View, please wait...'\n \t\t\tprogressDialog.setMessage(\"Please wait...\");\n \t\t\t//This dialog can't be canceled by pressing the back key\n \t\t\tprogressDialog.setCancelable(false);\n \t\t\t//This dialog isn't indeterminate\n \t\t\tprogressDialog.setIndeterminate(false);\n \t\t\t//The maximum number of items is 100\n \t\t\tprogressDialog.setMax(100);\n \t\t\t//Set the current progress to zero\n \t\t\tprogressDialog.setProgress(0);\n \t\t\t//Display the progress dialog\n \t\t\tprogressDialog.show();\n \t\t}", "@Override\n protected void onPreExecute() {\n String msg = \"Please Wait....\";\n cd.showProgressDialog(msg);\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tshowLoadingProgressDialog();\n\t\t}", "@Override\n protected void onPreExecute() {\n showLoadingProgressDialog();\n }", "@Override\n protected void onPreExecute() {\n showLoadingProgressDialog();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n pDialog = new ProgressDialog(Resume_create_employee.this);\n pDialog.setMessage(\"Loading...\");\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(MainActivity.this);\n pDialog.setMessage(\"Processing Request...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\r\n protected void onPreExecute() {\n if( progressDialog == null ) {\r\n progressDialog = ProgressDialog.show( context, context.getString(R.string.pref_sync_callings_now_title),\"\");\r\n }\r\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(DetailActivity.this);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(true);\n pDialog.show();\n }", "@Override\r\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\r\n\t\t\tpDialog = new ProgressDialog(SingleRecord.this);\r\n\t\t\tpDialog.setMessage(\"downloading...\");\r\n\t\t\tpDialog.setIndeterminate(false);\r\n\t\t\tpDialog.setCancelable(true);\r\n\t\t\r\n\t\t\tpDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\r\n\t\t\tpDialog.show();\r\n\t\t\tpDialog.getWindow().setGravity(Gravity.BOTTOM);\r\n\t\t}", "@Override\n protected void onPreExecute() {\n\n this.dialog.setMessage(\"Please wait ...\");\n this.dialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\taProgressDialog = new ProgressDialog(TargetProducts.this);\n\t\t\taProgressDialog.setMessage(\"Loading Report...\");\n\t\t\taProgressDialog.setIndeterminate(true);\n\t\t\taProgressDialog.setCanceledOnTouchOutside(true);\n\t\t\taProgressDialog.show();\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\taProgressDialog = new ProgressDialog(TargetProducts.this);\n\t\t\taProgressDialog.setMessage(\"Loading Report...\");\n\t\t\taProgressDialog.setIndeterminate(true);\n\t\t\taProgressDialog.setCanceledOnTouchOutside(true);\n\t\t\taProgressDialog.show();\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\t\n\t\t\tdialog = new ProgressDialog(BookingConfirmationScreen.this);\n\t\t\tdialog.setIndeterminate(false);\n\t\t\tdialog.setCancelable(true);\n\t\t\tdialog.show();\n\t\t\t\n\t\t\t\n\t\t}", "@Override\n protected void onProgressUpdate(Integer... values) {\n super.onProgressUpdate(values);\n progress = new ProgressDialog(activity);\n progress.setMessage(\"please wait.. \");\n progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progress.setIndeterminate(true);\n progress.setCancelable(false);\n progress.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tpdia = new ProgressDialog(mContext);\n\t\t\tpdia.setMessage(\"Loading Circles...\");\n\t\t\tpdia.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n // // pDialog = new ProgressDialog(getContext());\n pDialog = new ProgressDialog(context);\n pDialog.setMessage(\"Cargando Información\");\n pDialog.setCancelable(true);\n pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n pDialog.show();\n\n }", "public void showCustomLoadingDialog() {\n\n //..show gif\n viewDialog.showDialog();\n final Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n //...here i'm waiting 5 seconds before hiding the custom dialog\n //...you can do whenever you want or whenever your work is done\n viewDialog.hideDialog();\n }\n }, 1000);\n }", "public void showProgressDialog() {\n showProgressDialog(null);\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n // Show the progress in load\n pDialog = new ProgressDialog(UpdateTimeTable.this);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(false);\n pDialog.show();\n \n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n progressDialog = new ProgressDialog(AiutaGliAltri.this);\n progressDialog.setMessage(\"Sto Cercando!\");\n progressDialog.setIndeterminate(true);\n progressDialog.setCanceledOnTouchOutside(false);\n progressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tprogressDialog = new ProgressDialog(ListActivity.this);\n\t\t\tprogressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\n\t\t\tprogressDialog.setMessage(\"Loading Programs. .\");\n\t\t\tprogressDialog.setCancelable(false);\n\n\t\t\tprogressDialog.show();\n\t\t}", "private void showProgress(String message) {\n \tif(mProgress==null){\n \t\tmProgress = new ProgressDialog(stActivity);\n\t mProgress.setMessage(message);\n\t mProgress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\t mProgress.setIndeterminate(true);\n\t mProgress.setCancelable(false); \n\t mProgress.show();\n \t}\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(context);\n pDialog.setMessage(\"Fetching videolists..\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(true);\n pDialog.show();\n }", "@Override\n\tprotected void onPreExecute() {\n\t\tsuper.onPreExecute();\n\n\t\tprogress = ProgressDialog.show(act, \"\", \"Please wait ...\", true);\n\t\talert = new AlertDialog.Builder(act);\n\n\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tdialog = new ProgressDialog(BookingConfirmationScreen.this);\n\t\t\tdialog.setIndeterminate(false);\n\t\t\tdialog.setCancelable(true);\n\t\t\tdialog.show();\n\n\t\t}", "@Override\r\n\t\t protected void onPreExecute() {\n \t\tprogress= ProgressDialog.show(\r\n \t\t\t\tDetailProgramActivity.this, \r\n \t\t\t\t\"\", \r\n \t\t\t\tgetString(R.string.loading_data), \r\n \t\t\t\ttrue);\r\n \t}", "private void showProgressIndication() {\n Log.i(TAG, \"loading contacts... \");\n // TODO: make this be a no-op if the progress indication is\n // already visible with the exact same title and message.\n\n dismissProgressIndication(); // Clean up any prior progress indication\n\n mProgressDialog = new ProgressDialog(this);\n mProgressDialog.setMessage(this.getResources().getString(R.string.contact_list_loading));\t\n mProgressDialog.setIndeterminate(true);\n mProgressDialog.setCancelable(false);\n mProgressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\ttry {\n\t\t\t\tdialog.setIndeterminate(false);\n\t\t\t\tdialog.setMax(100);\n\t\t\t\tdialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n\t\t\t\tdialog.setCancelable(false);\n\t\t\t\tdialog.show();\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "public void initLoadingPage(Context c) {\n\n LayoutInflater inflater = (LayoutInflater) c.getSystemService( c.LAYOUT_INFLATER_SERVICE);\n final AlertDialog.Builder nameBuilder = new AlertDialog.Builder(c);\n View alertDiaView = inflater.inflate(R.layout.activity_loading_page,null);\n nameBuilder.setView(alertDiaView);\n\n avi = (AVLoadingIndicatorView) alertDiaView.findViewById(R.id.avi);\n avi.smoothToShow();\n\n\n int val= (int) (130 * Resources.getSystem().getDisplayMetrics().density);//dp to px\n alertDialog= nameBuilder.show();\n alertDialog.getWindow().setLayout(val ,val);\n\n\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n pDialog = new ProgressDialog(Activity_List.this);\n pDialog.setMessage(\"Loading spots. Please wait...\");\n\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "void dismissProgressLoading() {\n if (progressDialog != null) {\n progressDialog.dismiss();\n }\n }" ]
[ "0.8556975", "0.8352341", "0.8278571", "0.82200515", "0.81206495", "0.81117713", "0.81087923", "0.80747885", "0.80385137", "0.8009662", "0.79978704", "0.79510033", "0.7948115", "0.79299206", "0.79119074", "0.78677505", "0.78505844", "0.7845455", "0.783418", "0.7815574", "0.7798009", "0.77841055", "0.7760531", "0.7760491", "0.77491975", "0.77491885", "0.77381206", "0.7731128", "0.77016157", "0.7696864", "0.76813716", "0.7669966", "0.76690793", "0.76625514", "0.7644284", "0.7636105", "0.76298606", "0.7625296", "0.7624954", "0.7620896", "0.75963306", "0.7593019", "0.7557326", "0.7557191", "0.7552094", "0.7540964", "0.75380236", "0.7530816", "0.75187314", "0.7451498", "0.7442405", "0.744088", "0.74325657", "0.74260175", "0.74260175", "0.74182814", "0.7417898", "0.74154776", "0.74125224", "0.74027455", "0.7388856", "0.7382874", "0.73605436", "0.73600066", "0.7359012", "0.7358709", "0.73522854", "0.7331206", "0.7327646", "0.7317502", "0.7314785", "0.7314203", "0.73096377", "0.73096377", "0.7290608", "0.7290201", "0.72820896", "0.7281728", "0.72797364", "0.727472", "0.72728115", "0.72728115", "0.72708094", "0.7258939", "0.7244289", "0.7231637", "0.7228092", "0.7227812", "0.7206384", "0.72011316", "0.71872085", "0.71697205", "0.7168169", "0.7167897", "0.71674246", "0.7165712", "0.7164942", "0.715898", "0.7155309", "0.7151671", "0.71457183" ]
0.0
-1
pDialog = new ProgressDialog(this); pDialog.setCancelable(false); pDialog.setMessage("Loading ..."); pDialog.show();
private void getDataTakfidul(){ UserAPIService api = Config.getRetrofit().create(UserAPIService.class); Call<Value> call = api.lihat_program_like("Takhfidul Qur'an"); call.enqueue(new Callback<Value>() { @Override public void onResponse(Call<Value> call, Response<Value> response) { // pDialog.dismiss(); String value1 = response.body().getStatus(); if (value1.equals("1")){ Value value = response.body(); resultAlls = new ArrayList<>(Arrays.asList(value.getResult())); adapter = new RecyclerAdapterListAll(resultAlls,getApplicationContext()); recyclerView.setAdapter(adapter); }else { Toast.makeText(ListPonpesActivity.this,"Maaf Data Tidak Ada",Toast.LENGTH_SHORT).show(); } } @Override public void onFailure(Call<Value> call, Throwable t) { // pDialog.dismiss(); Toast.makeText(ListPonpesActivity.this,"Respon gagal",Toast.LENGTH_SHORT).show(); Log.d("Hasil internet",t.toString()); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void showProgressDialog(){\n progressDialog=ProgressDialog.show(context,\"\",\"Loading...Please wait...\");\n\n\n }", "private Dialog buildLoadingDialog() {\n ProgressDialog dialog = new ProgressDialog(this);\n dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n dialog.setMessage(getText(R.string.dialog_loading));\n dialog.setIndeterminate(true);\n dialog.setCancelable(false);\n return dialog;\n }", "protected void showLoading()\n {\n progressBar = new ProgressDialog(this);\n progressBar.setTitle(\"Loading\");\n progressBar.setMessage(\"Wait while loading...\");\n progressBar.setCancelable(false); // disable dismiss by tapping outside of the dialog\n progressBar.show();\n }", "private void creatDialog() {\n \t mDialog=new ProgressDialog(this);\n \t mDialog.setTitle(\"\");\n \t mDialog.setMessage(\"正在加载请稍后\");\n \t mDialog.setIndeterminate(true);\n \t mDialog.setCancelable(true);\n \t mDialog.show();\n \n\t}", "@Override\n protected void onPreExecute() {\n\n dialog = new ProgressDialog(context);\n dialog.setTitle(\"Loading Contents\");\n dialog.setMessage(\"Doing something interesting ...\");\n dialog.setIndeterminate(true);\n dialog.setCancelable(false);\n dialog.show();\n }", "public void showProgressDialog() {\r\n progressDialog.setMessage(getResources().getString(R.string.text_loading));\r\n progressDialog.setCancelable(false);\r\n progressDialog.show();\r\n }", "@Override\n\t\tprotected void onPreExecute()\n\t\t{\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog = new ProgressDialog(MainActivity.this);\n\t\t\tpDialog.setMessage(\"Loading....\");\n\t\t\tpDialog.setCancelable(true);\n\t\t\tpDialog.show();\n\t\t}", "protected void onPreExecute() {\r\n \tdialog = new ProgressDialog(context);\r\n \t\tdialog.setMessage(\"Loading...\");\r\n \t\tdialog.show();\r\n }", "@Override\n protected void onPreExecute() {\n progressDialog= new ProgressDialog(getActivity());\n progressDialog.setMessage(\"loading..\");\n progressDialog.setIndeterminate(false);\n progressDialog.show();\n }", "private void displayLoader() {\n pDialog = new ProgressDialog(DangKyActivity.this);\n pDialog.setMessage(\"Vui lòng đợi trong giây lát...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\t \tprotected void onPreExecute() {\n\t\t try {\n\t\t\t \tpd=new ProgressDialog(Styles_Dialog.this);\n\t\t\t \tpd.setMessage(\"Loading\");\n\t\t\t \tpd.show();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t}\n\t\t \t\n\t\t \t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tpdia = new ProgressDialog(mContext);\n\t\t\tpdia.setMessage(\"Loading...\");\n\t\t\tpdia.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "private void displayLoader() {\n pDialog = new ProgressDialog(AddReviewActivity.this);\n pDialog.setMessage(\"Adding Review...Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog = new ProgressDialog(activity);\n\t\t\tpDialog.setMessage(\"Loading...\");\n\t\t\tpDialog.setIndeterminate(false);\n\t\t\tpDialog.setCancelable(true);\n\t\t\tpDialog.show();\n\t\t}", "@Override\n protected void onPreExecute() {\n\n\n dialog = new ProgressDialog(MainArea.this);\n dialog.setTitle(\"Loading Results\");\n dialog.setMessage(\"Please Wait Results Are Loading For You....\");\n dialog.setCanceledOnTouchOutside(false);\n dialog.show();\n super.onPreExecute();\n }", "private void progressStuff() {\n cd = new ConnectionDetector(getActivity());\n parser = new JSONParser();\n progress = new ProgressDialog(getActivity());\n progress.setMessage(getResources().getString(R.string.loading));\n progress.setIndeterminate(false);\n progress.setCancelable(true);\n // progress.show();\n }", "@Override\r\n\t\tprotected void onPreExecute() {\r\n\t\t\tsuper.onPreExecute();\r\n\t\t\tpDialog = new ProgressDialog(getActivity());\r\n\t\t\tpDialog.setMessage(\"Loading...\");\r\n\t\t\tpDialog.setIndeterminate(false);\r\n\t\t\tpDialog.setCancelable(false);\r\n\t\t\tpDialog.show();\r\n\t\t}", "void showProgressLoading(Context context, boolean isCancelable) {\n\n progressDialog = new ProgressDialog(context);\n progressDialog.setIndeterminate(true);\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progressDialog.setMessage(\"Loading...\");\n progressDialog.setCancelable(isCancelable);\n progressDialog.setCanceledOnTouchOutside(false);\n\n progressDialog.show();\n\n }", "protected final void showLoadingDialog() {\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pd = new ProgressDialog(activity);\n pd.setMessage(\"Loading, Please Wait.....\");\n pd.setCancelable(false);\n pd.show();\n }", "public void showProgressDialog() {\n if (mProgressDialog == null) {\n mProgressDialog = new ProgressDialog(this);\n mProgressDialog.setCancelable(false);\n mProgressDialog.setCanceledOnTouchOutside(false);\n mProgressDialog.setMessage(getString(R.string.msg_loading));\n mProgressDialog.setIndeterminate(true);\n }\n mProgressDialog.show();\n }", "private void showSpinerProgress() {\n dialog.setMessage(\"Loading\");\n//\n// dialog.setButton(ProgressDialog.BUTTON_POSITIVE, \"YES\", new DialogInterface.OnClickListener() {\n// @Override\n// public void onClick(DialogInterface dialog, int which) {\n//\n// }\n// });\n\n //thiet lap k the huy - co the huy\n dialog.setCancelable(false);\n\n //show dialog\n dialog.show();\n Timer timer = new Timer();\n timer.schedule(new TimerTask() {\n @Override\n public void run() {\n dialog.dismiss();\n }\n }, 20000000);\n }", "private void showDialog(){\n progress = new ProgressDialog(this);\n progress.setTitle(getString(R.string.progress_dialog_loading));\n progress.setMessage(getString(R.string.progress_dialog_authenticating_with_firebase));\n progress.setCancelable(false);\n progress.show();\n }", "public void initProgressLoader() {\n progressDialog = new ProgressDialog(this);\n progressDialog.setIndeterminate(true);\n progressDialog.setCancelable(false);\n }", "private void displayLoader() {\n pDialog = new ProgressDialog(RegisterActivity.this);\n pDialog.setMessage(\"Signing Up.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tprogressDialog = ProgressDialog.show(MainActivity.this, \"\",\n\t\t\t\t\t\"Loading...\");\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tmyDialog = ProgressDialog.show\n\t\t\t\t\t(\n\t\t\t\t\t\t\tgetActivity(),\n\t\t\t\t\t\t\t\"Loading...\",\n\t\t\t\t\t\t\t\"Please Wait\",\n\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t);\n\t\t}", "@Override\n\tprotected void onPreExecute() {\n\t\t\n\t\t pDialog = new ProgressDialog(context);\n\t\t\ttry{\n\t\t\t\tthis.pDialog.setMessage(\"Please wait ...\");\n\t\t this.pDialog.setIndeterminateDrawable(context.getResources().getDrawable(R.drawable.red_progress));\n\t\t this.pDialog.setIndeterminate(false);\n\t\t this.pDialog.setCancelable(false);\n\t\t this.pDialog.show();\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\te.getMessage();\n\t\t\t}\n\t}", "private void showProgressDialog()\n {\n if (showProgressDialog && !getStatus().equals(AsyncTask.Status.FINISHED)) {\n //show the dialog if valid activity. If the OS is lollipop or higher then set the theme.\n //dialog = ProgressDialog.show(activity, \"In progress..\", message, true);\n if (Build.VERSION.SDK_INT >= 21) {\n dialog = new ProgressDialog(activity, R.style.progressoAlertDialogStyle);\n dialog.setTitle(\"In progress..\");\n dialog.setMessage(message);\n dialog.setIndeterminate(true);\n dialog.show();\n }\n else {\n dialog = ProgressDialog.show(activity, \"In progress..\", message, true);\n }\n\n dialog.setCancelable(false);\n } \n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(TalkActivity.this);\n pDialog.setMessage(getResources().getString(R.string.loading));\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n public void showloading(String message) {\n progressDialog = new ProgressDialog(getActivity());\n progressDialog.setMessage(message);\n progressDialog.setIndeterminate(true);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(Integrationforkhalti.this);\n pDialog.setMessage(\"Loading Please wait...\");\n pDialog.setIndeterminate(true);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n mProgressDialog = new ProgressDialog(getActivity());\n mProgressDialog.setMessage(getString(R.string.loading_text));\n mProgressDialog.setCancelable(false);\n }", "private void showProgressDialog() {\n if (progressDialog == null) {\n progressDialog = new ProgressDialog(getContext());\n }\n\n progressDialog.setTitle(R.string.dialog_title);\n progressDialog.setMessage(getResources().getString(R.string.dialog_message));\n progressDialog.setCancelable(false);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n /* mProgress.setMessage(\"Please Wait\");\n mProgress.setCancelable(false);\n mProgress.show();*/\n String msg = \"Please Wait....\";\n cd.showProgressDialog(msg);\n }", "private void showLoadingDialogue(final String loadingMessage) {\n progressDialog.setMessage(loadingMessage);\n progressDialog.setCancelable(false);\n progressDialog.setIndeterminate(false);\n progressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() \n\t\t{\n\t\t\t\n\t\t\tdialog = new ProgressDialog(AddFoodAdvActivity.this);\n\t\t\tdialog.setMessage(\"Loading...\");\n\t\t\tdialog.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "private void showDialog() {\n try {\n pDialog.setMessage(getString(R.string.please_wait));\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.setCanceledOnTouchOutside(false);\n pDialog.show();\n } catch (Exception e) {\n // TODO: handle exception\n }\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tdl = ProgressDialog.show(getActivity(), \"Thông báo\", \"Loading...\",\n\t\t\t\t\ttrue, false);\n\t\t\tdl.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n protected void onPreExecute()\n {\n // Create a new progress dialog\n progressDialog = new ProgressDialog(MainActivity.this);\n // Set the progress dialog spinner progress bar\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n // Set the dialog title to 'Loading...'\n progressDialog.setTitle(\"Loading...\");\n // Set the dialog message to 'Loading application View, please wait...'\n progressDialog.setMessage(\"Loading application, please wait...\");\n // This dialog can't be canceled by pressing the back key\n progressDialog.setCancelable(false);\n // This dialog isn't indeterminate\n progressDialog.setIndeterminate(false);\n // The maximum number of items is 100\n progressDialog.setMax(100);\n // Set the current progress to zero\n progressDialog.setProgress(0);\n // Display the progress dialog\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progressDialog.setMessage(\"Please wait. Loading...\");\n progressDialog.setCanceledOnTouchOutside(false);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n pDialog = new ProgressDialog(getActivity());\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(false);\n pDialog.setIndeterminate(false);\n pDialog.setMax(100);\n pDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n pDialog.show();\n// progressBar.setVisibility(View.VISIBLE);\n// progressBar.setProgress(0);\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n\n dialog = new ProgressDialog(AddFoodAdvActivity.this);\n dialog.setMessage(\"Please Wait...!\");\n dialog.show();\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n showProgressDialog(R.string.please_wait);\n //showDialog(progress_bar_type);\n }", "@Override\r\n\tprotected void onPreExecute()\r\n\t{\r\n\t\tprogress = new ProgressDialog(ctx);\r\n\t\tprogress.setTitle(\"Retrieving Parking Information\");\r\n\t\tprogress.setMessage(\"Please wait.\");\r\n\t\tprogress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\r\n\t\tprogress.show();\r\n\t\tsuper.onPreExecute();\r\n\t}", "@Override\n protected void onPreExecute() {\n progressDialog = new ProgressDialog(getActivity());\n progressDialog.setTitle(getResources().getString(R.string.please_wait));\n progressDialog.setMessage(getResources().getString(R.string.fetching_data));\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n // Showing progress dialog\n pDialog = new ProgressDialog(thisContext);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(true);\n pDialog.show();\n\n }", "private void displayProgressDialog() {\n pDialog.setMessage(\"Logging in.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\r\n \tprotected void onPreExecute() {\n \t\tsuper.onPreExecute();\r\n \t\tpdia = new ProgressDialog(Regmember.this);\r\n \t\tpdia.setCanceledOnTouchOutside(false);\r\n pdia.setMessage(\"Dhiraj rakh..........\");\r\n pdia.show(); \r\n \t}", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n this.dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n this.dialog.setCancelable(false);\n this.dialog.show();\n }", "@Override\n protected void onPreExecute() {\n pDialog = new ProgressDialog(homeActivity);\n pDialog.setMessage(\"Retrieving Details... \");\n // pDialog.setMax(16);\n pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\n pDialog.setCancelable(false);\n pDialog.show();\n\n\n }", "public void onPreExecute() {\n progressDialog.show();\n }", "@Override\r\n\t protected void onPreExecute() {\n\t super.onPreExecute();\r\n\t progressDialog = new ProgressDialog(UDMap.this);\r\n\t progressDialog.setMessage(\"Loading the best way...\");\r\n\t progressDialog.setIndeterminate(true);\r\n\t progressDialog.show();\r\n\t }", "void showProgressDialog();", "void showProgressDialog();", "protected void onPreExecute() {\n try {\n this.dialog.setMessage(getContext().getResources().getString(R.string.loading));\n this.dialog.show();\n } catch (Exception ex) {\n Log.e(null, ex);\n }\n }", "public void showProgressDialog() {\n pd = new ProgressDialog(this);\n pd.setMessage(\"Renting film...\");\n pd.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog1 = new ProgressDialog(Doctorslist.this);\n\t\t\tpDialog1.setMessage(\"Loading ...\");\n\t\t\tpDialog1.setIndeterminate(false);\n\t\t\tpDialog1.setCancelable(false);\n\t\t\tpDialog1.show();\n\t\t}", "public void showProgressDialog() {\n try {\n if (progressDialog == null) {\n try {\n progressDialog = new ProgressDialog(self);\n progressDialog.show();\n progressDialog.setCancelable(false);\n } catch (Exception e) {\n progressDialog = new ProgressDialog(self.getParent());\n progressDialog.show();\n progressDialog.setCancelable(false);\n e.printStackTrace();\n }\n } else {\n if (!progressDialog.isShowing())\n progressDialog.show();\n }\n } catch (Exception e) {\n progressDialog = new ProgressDialog(self);\n progressDialog.show();\n progressDialog.setCancelable(false);\n e.printStackTrace();\n }\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n loading = ProgressDialog.show(this.context, \"Fetching Data\",\"Please Wait...\",true,true);\n }", "private void showProgressDialog() {\n mProgressDialog = AppDialog.showProgressDialog(this);\n mProgressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n asyncDialog.setMessage(\"Loading...\");\n //show dialog\n asyncDialog.show();\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n progress = new ProgressDialog(hostContext);\n progress.setMessage(\"Wait while books are being downloaded...\");\n progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progress.show();\n }", "public void showProgress2(){\n// if (mHandler==null){\n// mHandler = new Handler(Looper.getMainLooper());\n// }\n new Handler(Looper.getMainLooper()).post(new Runnable() {\n @Override\n public void run() {\n loadingDialog = new Dialog(BaseActivity.this);\n loadingDialog.setTitle(\"Loading data..\");\n loadingDialog.setContentView(R.layout.loading);\n loadingDialog.show();\n\n }\n });\n// mHandler.post(new Runnable() {\n// @Override\n// public void run() {\n// loadingDialog = new Dialog(BaseActivity.this);\n// loadingDialog.setTitle(\"Loading data..\");\n// loadingDialog.setContentView(R.layout.loading);\n// loadingDialog.show();\n//\n// }\n// });\n }", "private void displayProgressDialog() {\n pDialog.setMessage(\"Logging In.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\t// TODO Auto-generated method stub\n\t\t\tsuper.onPreExecute();\n\t\t\tpd = ProgressDialogUtil.createDialogNoTitle(context, \"loading...\");\n\t\t\tpd.show();\n\t\t}", "protected void createProgressDialog() {\r\t\tif (pd == null) {\r\t\t\tpd = new ProgressDialog(this);\r\t\t\tpd.setCanceledOnTouchOutside(false);\r\t\t\tpd.getWindow().setGravity(Gravity.CENTER);\r\t\t\tpd.setOnCancelListener(new DialogInterface.OnCancelListener() {\r\t\t\t\t@Override\r\t\t\t\tpublic void onCancel(DialogInterface dialogInterface) {\r\t\t\t\t\tonPdCancel();\r\t\t\t\t}\r\t\t\t});\r\t\t}\r\t}", "private void showLoadingDialog() {\n mDefaultLoadingDialogFragment = new DefaultLoadingDialogFragment();\n mDefaultLoadingDialogFragment.show(getChildFragmentManager(), \"loadingDialog\");\n }", "@Override\n\t protected void onPreExecute() {\n\t super.onPreExecute();\n\t \n\t progressDialog= new Dialog(ListKotaActivity.this);\n\t progressDialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);\n\t progressDialog.setContentView(R.layout.progress);\n\t progressDialog.setCancelable(false);\n\t progressDialog.show();\t \n\t }", "@Override\n \t\tprotected void onPreExecute() \n \t\t{\n \t\t\t//Create a new progress dialog\n \t\t\tprogressDialog = new ProgressDialog(MainActivity.this);\n \t\t\t//Set the progress dialog to display a horizontal progress bar \n \t\t\tprogressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n \t\t\t//Set the dialog title to 'Loading...'\n \t\t\tprogressDialog.setTitle(\"Loading Game...\");\n \t\t\t//Set the dialog message to 'Loading application View, please wait...'\n \t\t\tprogressDialog.setMessage(\"Please wait...\");\n \t\t\t//This dialog can't be canceled by pressing the back key\n \t\t\tprogressDialog.setCancelable(false);\n \t\t\t//This dialog isn't indeterminate\n \t\t\tprogressDialog.setIndeterminate(false);\n \t\t\t//The maximum number of items is 100\n \t\t\tprogressDialog.setMax(100);\n \t\t\t//Set the current progress to zero\n \t\t\tprogressDialog.setProgress(0);\n \t\t\t//Display the progress dialog\n \t\t\tprogressDialog.show();\n \t\t}", "@Override\n protected void onPreExecute() {\n String msg = \"Please Wait....\";\n cd.showProgressDialog(msg);\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tshowLoadingProgressDialog();\n\t\t}", "@Override\n protected void onPreExecute() {\n showLoadingProgressDialog();\n }", "@Override\n protected void onPreExecute() {\n showLoadingProgressDialog();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n pDialog = new ProgressDialog(Resume_create_employee.this);\n pDialog.setMessage(\"Loading...\");\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(MainActivity.this);\n pDialog.setMessage(\"Processing Request...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(DetailActivity.this);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(true);\n pDialog.show();\n }", "@Override\r\n protected void onPreExecute() {\n if( progressDialog == null ) {\r\n progressDialog = ProgressDialog.show( context, context.getString(R.string.pref_sync_callings_now_title),\"\");\r\n }\r\n }", "@Override\r\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\r\n\t\t\tpDialog = new ProgressDialog(SingleRecord.this);\r\n\t\t\tpDialog.setMessage(\"downloading...\");\r\n\t\t\tpDialog.setIndeterminate(false);\r\n\t\t\tpDialog.setCancelable(true);\r\n\t\t\r\n\t\t\tpDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\r\n\t\t\tpDialog.show();\r\n\t\t\tpDialog.getWindow().setGravity(Gravity.BOTTOM);\r\n\t\t}", "@Override\n protected void onPreExecute() {\n\n this.dialog.setMessage(\"Please wait ...\");\n this.dialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\taProgressDialog = new ProgressDialog(TargetProducts.this);\n\t\t\taProgressDialog.setMessage(\"Loading Report...\");\n\t\t\taProgressDialog.setIndeterminate(true);\n\t\t\taProgressDialog.setCanceledOnTouchOutside(true);\n\t\t\taProgressDialog.show();\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\taProgressDialog = new ProgressDialog(TargetProducts.this);\n\t\t\taProgressDialog.setMessage(\"Loading Report...\");\n\t\t\taProgressDialog.setIndeterminate(true);\n\t\t\taProgressDialog.setCanceledOnTouchOutside(true);\n\t\t\taProgressDialog.show();\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\t\n\t\t\tdialog = new ProgressDialog(BookingConfirmationScreen.this);\n\t\t\tdialog.setIndeterminate(false);\n\t\t\tdialog.setCancelable(true);\n\t\t\tdialog.show();\n\t\t\t\n\t\t\t\n\t\t}", "@Override\n protected void onProgressUpdate(Integer... values) {\n super.onProgressUpdate(values);\n progress = new ProgressDialog(activity);\n progress.setMessage(\"please wait.. \");\n progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progress.setIndeterminate(true);\n progress.setCancelable(false);\n progress.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tpdia = new ProgressDialog(mContext);\n\t\t\tpdia.setMessage(\"Loading Circles...\");\n\t\t\tpdia.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n // // pDialog = new ProgressDialog(getContext());\n pDialog = new ProgressDialog(context);\n pDialog.setMessage(\"Cargando Información\");\n pDialog.setCancelable(true);\n pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n pDialog.show();\n\n }", "public void showCustomLoadingDialog() {\n\n //..show gif\n viewDialog.showDialog();\n final Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n //...here i'm waiting 5 seconds before hiding the custom dialog\n //...you can do whenever you want or whenever your work is done\n viewDialog.hideDialog();\n }\n }, 1000);\n }", "public void showProgressDialog() {\n showProgressDialog(null);\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n // Show the progress in load\n pDialog = new ProgressDialog(UpdateTimeTable.this);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(false);\n pDialog.show();\n \n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n progressDialog = new ProgressDialog(AiutaGliAltri.this);\n progressDialog.setMessage(\"Sto Cercando!\");\n progressDialog.setIndeterminate(true);\n progressDialog.setCanceledOnTouchOutside(false);\n progressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tprogressDialog = new ProgressDialog(ListActivity.this);\n\t\t\tprogressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\n\t\t\tprogressDialog.setMessage(\"Loading Programs. .\");\n\t\t\tprogressDialog.setCancelable(false);\n\n\t\t\tprogressDialog.show();\n\t\t}", "private void showProgress(String message) {\n \tif(mProgress==null){\n \t\tmProgress = new ProgressDialog(stActivity);\n\t mProgress.setMessage(message);\n\t mProgress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\t mProgress.setIndeterminate(true);\n\t mProgress.setCancelable(false); \n\t mProgress.show();\n \t}\n }", "@Override\n\tprotected void onPreExecute() {\n\t\tsuper.onPreExecute();\n\n\t\tprogress = ProgressDialog.show(act, \"\", \"Please wait ...\", true);\n\t\talert = new AlertDialog.Builder(act);\n\n\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tdialog = new ProgressDialog(BookingConfirmationScreen.this);\n\t\t\tdialog.setIndeterminate(false);\n\t\t\tdialog.setCancelable(true);\n\t\t\tdialog.show();\n\n\t\t}", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(context);\n pDialog.setMessage(\"Fetching videolists..\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(true);\n pDialog.show();\n }", "@Override\r\n\t\t protected void onPreExecute() {\n \t\tprogress= ProgressDialog.show(\r\n \t\t\t\tDetailProgramActivity.this, \r\n \t\t\t\t\"\", \r\n \t\t\t\tgetString(R.string.loading_data), \r\n \t\t\t\ttrue);\r\n \t}", "private void showProgressIndication() {\n Log.i(TAG, \"loading contacts... \");\n // TODO: make this be a no-op if the progress indication is\n // already visible with the exact same title and message.\n\n dismissProgressIndication(); // Clean up any prior progress indication\n\n mProgressDialog = new ProgressDialog(this);\n mProgressDialog.setMessage(this.getResources().getString(R.string.contact_list_loading));\t\n mProgressDialog.setIndeterminate(true);\n mProgressDialog.setCancelable(false);\n mProgressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\ttry {\n\t\t\t\tdialog.setIndeterminate(false);\n\t\t\t\tdialog.setMax(100);\n\t\t\t\tdialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n\t\t\t\tdialog.setCancelable(false);\n\t\t\t\tdialog.show();\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "public void initLoadingPage(Context c) {\n\n LayoutInflater inflater = (LayoutInflater) c.getSystemService( c.LAYOUT_INFLATER_SERVICE);\n final AlertDialog.Builder nameBuilder = new AlertDialog.Builder(c);\n View alertDiaView = inflater.inflate(R.layout.activity_loading_page,null);\n nameBuilder.setView(alertDiaView);\n\n avi = (AVLoadingIndicatorView) alertDiaView.findViewById(R.id.avi);\n avi.smoothToShow();\n\n\n int val= (int) (130 * Resources.getSystem().getDisplayMetrics().density);//dp to px\n alertDialog= nameBuilder.show();\n alertDialog.getWindow().setLayout(val ,val);\n\n\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n pDialog = new ProgressDialog(Activity_List.this);\n pDialog.setMessage(\"Loading spots. Please wait...\");\n\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "void dismissProgressLoading() {\n if (progressDialog != null) {\n progressDialog.dismiss();\n }\n }" ]
[ "0.85567886", "0.8352688", "0.8278885", "0.82205284", "0.81206936", "0.81118655", "0.8108865", "0.8074827", "0.8038312", "0.80098265", "0.7998259", "0.79511577", "0.7948703", "0.7930043", "0.7912505", "0.7867033", "0.7850678", "0.7844706", "0.78353035", "0.78156286", "0.7797823", "0.7784651", "0.7760526", "0.77600116", "0.77501494", "0.7749045", "0.77386063", "0.7731478", "0.7701042", "0.7697044", "0.7681732", "0.7670093", "0.7669092", "0.76626396", "0.7644567", "0.763723", "0.7630021", "0.76271856", "0.762467", "0.7620349", "0.7596412", "0.7592744", "0.75579137", "0.75574803", "0.7552131", "0.75407976", "0.75382984", "0.75317204", "0.7519727", "0.7451678", "0.7442118", "0.744127", "0.74322087", "0.7425351", "0.7425351", "0.74189377", "0.7418416", "0.741551", "0.741213", "0.7402807", "0.7388917", "0.7383496", "0.73604465", "0.7360063", "0.7359984", "0.73590505", "0.7351788", "0.7332166", "0.7327484", "0.73171186", "0.7314973", "0.7314076", "0.7309344", "0.7309344", "0.7290827", "0.72897744", "0.7282288", "0.728221", "0.727934", "0.72763354", "0.7273137", "0.7273137", "0.7271518", "0.7258088", "0.72444123", "0.72317374", "0.72295463", "0.72278434", "0.72062516", "0.7200889", "0.71870035", "0.7169838", "0.71688443", "0.71682143", "0.7167863", "0.7165924", "0.71653086", "0.7158772", "0.715525", "0.7151423", "0.7145757" ]
0.0
-1
pDialog = new ProgressDialog(this); pDialog.setCancelable(false); pDialog.setMessage("Loading ..."); pDialog.show();
private void getDataKitabKuning(){ UserAPIService api = Config.getRetrofit().create(UserAPIService.class); Call<Value> call = api.lihat_program_like("Kitab Kuning"); call.enqueue(new Callback<Value>() { @Override public void onResponse(Call<Value> call, Response<Value> response) { // pDialog.dismiss(); String value1 = response.body().getStatus(); if (value1.equals("1")){ Value value = response.body(); resultAlls = new ArrayList<>(Arrays.asList(value.getResult())); adapter = new RecyclerAdapterListAll(resultAlls,getApplicationContext()); recyclerView.setAdapter(adapter); }else { Toast.makeText(ListPonpesActivity.this,"Maaf Data Tidak Ada",Toast.LENGTH_SHORT).show(); } } @Override public void onFailure(Call<Value> call, Throwable t) { // pDialog.dismiss(); Toast.makeText(ListPonpesActivity.this,"Respon gagal",Toast.LENGTH_SHORT).show(); Log.d("Hasil internet",t.toString()); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void showProgressDialog(){\n progressDialog=ProgressDialog.show(context,\"\",\"Loading...Please wait...\");\n\n\n }", "private Dialog buildLoadingDialog() {\n ProgressDialog dialog = new ProgressDialog(this);\n dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n dialog.setMessage(getText(R.string.dialog_loading));\n dialog.setIndeterminate(true);\n dialog.setCancelable(false);\n return dialog;\n }", "protected void showLoading()\n {\n progressBar = new ProgressDialog(this);\n progressBar.setTitle(\"Loading\");\n progressBar.setMessage(\"Wait while loading...\");\n progressBar.setCancelable(false); // disable dismiss by tapping outside of the dialog\n progressBar.show();\n }", "private void creatDialog() {\n \t mDialog=new ProgressDialog(this);\n \t mDialog.setTitle(\"\");\n \t mDialog.setMessage(\"正在加载请稍后\");\n \t mDialog.setIndeterminate(true);\n \t mDialog.setCancelable(true);\n \t mDialog.show();\n \n\t}", "@Override\n protected void onPreExecute() {\n\n dialog = new ProgressDialog(context);\n dialog.setTitle(\"Loading Contents\");\n dialog.setMessage(\"Doing something interesting ...\");\n dialog.setIndeterminate(true);\n dialog.setCancelable(false);\n dialog.show();\n }", "public void showProgressDialog() {\r\n progressDialog.setMessage(getResources().getString(R.string.text_loading));\r\n progressDialog.setCancelable(false);\r\n progressDialog.show();\r\n }", "@Override\n\t\tprotected void onPreExecute()\n\t\t{\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog = new ProgressDialog(MainActivity.this);\n\t\t\tpDialog.setMessage(\"Loading....\");\n\t\t\tpDialog.setCancelable(true);\n\t\t\tpDialog.show();\n\t\t}", "protected void onPreExecute() {\r\n \tdialog = new ProgressDialog(context);\r\n \t\tdialog.setMessage(\"Loading...\");\r\n \t\tdialog.show();\r\n }", "@Override\n protected void onPreExecute() {\n progressDialog= new ProgressDialog(getActivity());\n progressDialog.setMessage(\"loading..\");\n progressDialog.setIndeterminate(false);\n progressDialog.show();\n }", "private void displayLoader() {\n pDialog = new ProgressDialog(DangKyActivity.this);\n pDialog.setMessage(\"Vui lòng đợi trong giây lát...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\t \tprotected void onPreExecute() {\n\t\t try {\n\t\t\t \tpd=new ProgressDialog(Styles_Dialog.this);\n\t\t\t \tpd.setMessage(\"Loading\");\n\t\t\t \tpd.show();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t}\n\t\t \t\n\t\t \t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tpdia = new ProgressDialog(mContext);\n\t\t\tpdia.setMessage(\"Loading...\");\n\t\t\tpdia.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "private void displayLoader() {\n pDialog = new ProgressDialog(AddReviewActivity.this);\n pDialog.setMessage(\"Adding Review...Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog = new ProgressDialog(activity);\n\t\t\tpDialog.setMessage(\"Loading...\");\n\t\t\tpDialog.setIndeterminate(false);\n\t\t\tpDialog.setCancelable(true);\n\t\t\tpDialog.show();\n\t\t}", "@Override\n protected void onPreExecute() {\n\n\n dialog = new ProgressDialog(MainArea.this);\n dialog.setTitle(\"Loading Results\");\n dialog.setMessage(\"Please Wait Results Are Loading For You....\");\n dialog.setCanceledOnTouchOutside(false);\n dialog.show();\n super.onPreExecute();\n }", "private void progressStuff() {\n cd = new ConnectionDetector(getActivity());\n parser = new JSONParser();\n progress = new ProgressDialog(getActivity());\n progress.setMessage(getResources().getString(R.string.loading));\n progress.setIndeterminate(false);\n progress.setCancelable(true);\n // progress.show();\n }", "@Override\r\n\t\tprotected void onPreExecute() {\r\n\t\t\tsuper.onPreExecute();\r\n\t\t\tpDialog = new ProgressDialog(getActivity());\r\n\t\t\tpDialog.setMessage(\"Loading...\");\r\n\t\t\tpDialog.setIndeterminate(false);\r\n\t\t\tpDialog.setCancelable(false);\r\n\t\t\tpDialog.show();\r\n\t\t}", "void showProgressLoading(Context context, boolean isCancelable) {\n\n progressDialog = new ProgressDialog(context);\n progressDialog.setIndeterminate(true);\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progressDialog.setMessage(\"Loading...\");\n progressDialog.setCancelable(isCancelable);\n progressDialog.setCanceledOnTouchOutside(false);\n\n progressDialog.show();\n\n }", "protected final void showLoadingDialog() {\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pd = new ProgressDialog(activity);\n pd.setMessage(\"Loading, Please Wait.....\");\n pd.setCancelable(false);\n pd.show();\n }", "public void showProgressDialog() {\n if (mProgressDialog == null) {\n mProgressDialog = new ProgressDialog(this);\n mProgressDialog.setCancelable(false);\n mProgressDialog.setCanceledOnTouchOutside(false);\n mProgressDialog.setMessage(getString(R.string.msg_loading));\n mProgressDialog.setIndeterminate(true);\n }\n mProgressDialog.show();\n }", "private void showSpinerProgress() {\n dialog.setMessage(\"Loading\");\n//\n// dialog.setButton(ProgressDialog.BUTTON_POSITIVE, \"YES\", new DialogInterface.OnClickListener() {\n// @Override\n// public void onClick(DialogInterface dialog, int which) {\n//\n// }\n// });\n\n //thiet lap k the huy - co the huy\n dialog.setCancelable(false);\n\n //show dialog\n dialog.show();\n Timer timer = new Timer();\n timer.schedule(new TimerTask() {\n @Override\n public void run() {\n dialog.dismiss();\n }\n }, 20000000);\n }", "private void showDialog(){\n progress = new ProgressDialog(this);\n progress.setTitle(getString(R.string.progress_dialog_loading));\n progress.setMessage(getString(R.string.progress_dialog_authenticating_with_firebase));\n progress.setCancelable(false);\n progress.show();\n }", "public void initProgressLoader() {\n progressDialog = new ProgressDialog(this);\n progressDialog.setIndeterminate(true);\n progressDialog.setCancelable(false);\n }", "private void displayLoader() {\n pDialog = new ProgressDialog(RegisterActivity.this);\n pDialog.setMessage(\"Signing Up.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tprogressDialog = ProgressDialog.show(MainActivity.this, \"\",\n\t\t\t\t\t\"Loading...\");\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tmyDialog = ProgressDialog.show\n\t\t\t\t\t(\n\t\t\t\t\t\t\tgetActivity(),\n\t\t\t\t\t\t\t\"Loading...\",\n\t\t\t\t\t\t\t\"Please Wait\",\n\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t);\n\t\t}", "@Override\n\tprotected void onPreExecute() {\n\t\t\n\t\t pDialog = new ProgressDialog(context);\n\t\t\ttry{\n\t\t\t\tthis.pDialog.setMessage(\"Please wait ...\");\n\t\t this.pDialog.setIndeterminateDrawable(context.getResources().getDrawable(R.drawable.red_progress));\n\t\t this.pDialog.setIndeterminate(false);\n\t\t this.pDialog.setCancelable(false);\n\t\t this.pDialog.show();\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\te.getMessage();\n\t\t\t}\n\t}", "private void showProgressDialog()\n {\n if (showProgressDialog && !getStatus().equals(AsyncTask.Status.FINISHED)) {\n //show the dialog if valid activity. If the OS is lollipop or higher then set the theme.\n //dialog = ProgressDialog.show(activity, \"In progress..\", message, true);\n if (Build.VERSION.SDK_INT >= 21) {\n dialog = new ProgressDialog(activity, R.style.progressoAlertDialogStyle);\n dialog.setTitle(\"In progress..\");\n dialog.setMessage(message);\n dialog.setIndeterminate(true);\n dialog.show();\n }\n else {\n dialog = ProgressDialog.show(activity, \"In progress..\", message, true);\n }\n\n dialog.setCancelable(false);\n } \n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(TalkActivity.this);\n pDialog.setMessage(getResources().getString(R.string.loading));\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n public void showloading(String message) {\n progressDialog = new ProgressDialog(getActivity());\n progressDialog.setMessage(message);\n progressDialog.setIndeterminate(true);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(Integrationforkhalti.this);\n pDialog.setMessage(\"Loading Please wait...\");\n pDialog.setIndeterminate(true);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n mProgressDialog = new ProgressDialog(getActivity());\n mProgressDialog.setMessage(getString(R.string.loading_text));\n mProgressDialog.setCancelable(false);\n }", "private void showProgressDialog() {\n if (progressDialog == null) {\n progressDialog = new ProgressDialog(getContext());\n }\n\n progressDialog.setTitle(R.string.dialog_title);\n progressDialog.setMessage(getResources().getString(R.string.dialog_message));\n progressDialog.setCancelable(false);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n /* mProgress.setMessage(\"Please Wait\");\n mProgress.setCancelable(false);\n mProgress.show();*/\n String msg = \"Please Wait....\";\n cd.showProgressDialog(msg);\n }", "private void showLoadingDialogue(final String loadingMessage) {\n progressDialog.setMessage(loadingMessage);\n progressDialog.setCancelable(false);\n progressDialog.setIndeterminate(false);\n progressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() \n\t\t{\n\t\t\t\n\t\t\tdialog = new ProgressDialog(AddFoodAdvActivity.this);\n\t\t\tdialog.setMessage(\"Loading...\");\n\t\t\tdialog.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "private void showDialog() {\n try {\n pDialog.setMessage(getString(R.string.please_wait));\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.setCanceledOnTouchOutside(false);\n pDialog.show();\n } catch (Exception e) {\n // TODO: handle exception\n }\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tdl = ProgressDialog.show(getActivity(), \"Thông báo\", \"Loading...\",\n\t\t\t\t\ttrue, false);\n\t\t\tdl.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n protected void onPreExecute()\n {\n // Create a new progress dialog\n progressDialog = new ProgressDialog(MainActivity.this);\n // Set the progress dialog spinner progress bar\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n // Set the dialog title to 'Loading...'\n progressDialog.setTitle(\"Loading...\");\n // Set the dialog message to 'Loading application View, please wait...'\n progressDialog.setMessage(\"Loading application, please wait...\");\n // This dialog can't be canceled by pressing the back key\n progressDialog.setCancelable(false);\n // This dialog isn't indeterminate\n progressDialog.setIndeterminate(false);\n // The maximum number of items is 100\n progressDialog.setMax(100);\n // Set the current progress to zero\n progressDialog.setProgress(0);\n // Display the progress dialog\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progressDialog.setMessage(\"Please wait. Loading...\");\n progressDialog.setCanceledOnTouchOutside(false);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n pDialog = new ProgressDialog(getActivity());\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(false);\n pDialog.setIndeterminate(false);\n pDialog.setMax(100);\n pDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n pDialog.show();\n// progressBar.setVisibility(View.VISIBLE);\n// progressBar.setProgress(0);\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n\n dialog = new ProgressDialog(AddFoodAdvActivity.this);\n dialog.setMessage(\"Please Wait...!\");\n dialog.show();\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n showProgressDialog(R.string.please_wait);\n //showDialog(progress_bar_type);\n }", "@Override\r\n\tprotected void onPreExecute()\r\n\t{\r\n\t\tprogress = new ProgressDialog(ctx);\r\n\t\tprogress.setTitle(\"Retrieving Parking Information\");\r\n\t\tprogress.setMessage(\"Please wait.\");\r\n\t\tprogress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\r\n\t\tprogress.show();\r\n\t\tsuper.onPreExecute();\r\n\t}", "@Override\n protected void onPreExecute() {\n progressDialog = new ProgressDialog(getActivity());\n progressDialog.setTitle(getResources().getString(R.string.please_wait));\n progressDialog.setMessage(getResources().getString(R.string.fetching_data));\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n // Showing progress dialog\n pDialog = new ProgressDialog(thisContext);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(true);\n pDialog.show();\n\n }", "private void displayProgressDialog() {\n pDialog.setMessage(\"Logging in.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\r\n \tprotected void onPreExecute() {\n \t\tsuper.onPreExecute();\r\n \t\tpdia = new ProgressDialog(Regmember.this);\r\n \t\tpdia.setCanceledOnTouchOutside(false);\r\n pdia.setMessage(\"Dhiraj rakh..........\");\r\n pdia.show(); \r\n \t}", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n this.dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n this.dialog.setCancelable(false);\n this.dialog.show();\n }", "@Override\n protected void onPreExecute() {\n pDialog = new ProgressDialog(homeActivity);\n pDialog.setMessage(\"Retrieving Details... \");\n // pDialog.setMax(16);\n pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\n pDialog.setCancelable(false);\n pDialog.show();\n\n\n }", "public void onPreExecute() {\n progressDialog.show();\n }", "@Override\r\n\t protected void onPreExecute() {\n\t super.onPreExecute();\r\n\t progressDialog = new ProgressDialog(UDMap.this);\r\n\t progressDialog.setMessage(\"Loading the best way...\");\r\n\t progressDialog.setIndeterminate(true);\r\n\t progressDialog.show();\r\n\t }", "void showProgressDialog();", "void showProgressDialog();", "public void showProgressDialog() {\n pd = new ProgressDialog(this);\n pd.setMessage(\"Renting film...\");\n pd.show();\n }", "protected void onPreExecute() {\n try {\n this.dialog.setMessage(getContext().getResources().getString(R.string.loading));\n this.dialog.show();\n } catch (Exception ex) {\n Log.e(null, ex);\n }\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog1 = new ProgressDialog(Doctorslist.this);\n\t\t\tpDialog1.setMessage(\"Loading ...\");\n\t\t\tpDialog1.setIndeterminate(false);\n\t\t\tpDialog1.setCancelable(false);\n\t\t\tpDialog1.show();\n\t\t}", "public void showProgressDialog() {\n try {\n if (progressDialog == null) {\n try {\n progressDialog = new ProgressDialog(self);\n progressDialog.show();\n progressDialog.setCancelable(false);\n } catch (Exception e) {\n progressDialog = new ProgressDialog(self.getParent());\n progressDialog.show();\n progressDialog.setCancelable(false);\n e.printStackTrace();\n }\n } else {\n if (!progressDialog.isShowing())\n progressDialog.show();\n }\n } catch (Exception e) {\n progressDialog = new ProgressDialog(self);\n progressDialog.show();\n progressDialog.setCancelable(false);\n e.printStackTrace();\n }\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n loading = ProgressDialog.show(this.context, \"Fetching Data\",\"Please Wait...\",true,true);\n }", "private void showProgressDialog() {\n mProgressDialog = AppDialog.showProgressDialog(this);\n mProgressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n asyncDialog.setMessage(\"Loading...\");\n //show dialog\n asyncDialog.show();\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n progress = new ProgressDialog(hostContext);\n progress.setMessage(\"Wait while books are being downloaded...\");\n progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progress.show();\n }", "public void showProgress2(){\n// if (mHandler==null){\n// mHandler = new Handler(Looper.getMainLooper());\n// }\n new Handler(Looper.getMainLooper()).post(new Runnable() {\n @Override\n public void run() {\n loadingDialog = new Dialog(BaseActivity.this);\n loadingDialog.setTitle(\"Loading data..\");\n loadingDialog.setContentView(R.layout.loading);\n loadingDialog.show();\n\n }\n });\n// mHandler.post(new Runnable() {\n// @Override\n// public void run() {\n// loadingDialog = new Dialog(BaseActivity.this);\n// loadingDialog.setTitle(\"Loading data..\");\n// loadingDialog.setContentView(R.layout.loading);\n// loadingDialog.show();\n//\n// }\n// });\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\t// TODO Auto-generated method stub\n\t\t\tsuper.onPreExecute();\n\t\t\tpd = ProgressDialogUtil.createDialogNoTitle(context, \"loading...\");\n\t\t\tpd.show();\n\t\t}", "private void displayProgressDialog() {\n pDialog.setMessage(\"Logging In.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "protected void createProgressDialog() {\r\t\tif (pd == null) {\r\t\t\tpd = new ProgressDialog(this);\r\t\t\tpd.setCanceledOnTouchOutside(false);\r\t\t\tpd.getWindow().setGravity(Gravity.CENTER);\r\t\t\tpd.setOnCancelListener(new DialogInterface.OnCancelListener() {\r\t\t\t\t@Override\r\t\t\t\tpublic void onCancel(DialogInterface dialogInterface) {\r\t\t\t\t\tonPdCancel();\r\t\t\t\t}\r\t\t\t});\r\t\t}\r\t}", "private void showLoadingDialog() {\n mDefaultLoadingDialogFragment = new DefaultLoadingDialogFragment();\n mDefaultLoadingDialogFragment.show(getChildFragmentManager(), \"loadingDialog\");\n }", "@Override\n\t protected void onPreExecute() {\n\t super.onPreExecute();\n\t \n\t progressDialog= new Dialog(ListKotaActivity.this);\n\t progressDialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);\n\t progressDialog.setContentView(R.layout.progress);\n\t progressDialog.setCancelable(false);\n\t progressDialog.show();\t \n\t }", "@Override\n \t\tprotected void onPreExecute() \n \t\t{\n \t\t\t//Create a new progress dialog\n \t\t\tprogressDialog = new ProgressDialog(MainActivity.this);\n \t\t\t//Set the progress dialog to display a horizontal progress bar \n \t\t\tprogressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n \t\t\t//Set the dialog title to 'Loading...'\n \t\t\tprogressDialog.setTitle(\"Loading Game...\");\n \t\t\t//Set the dialog message to 'Loading application View, please wait...'\n \t\t\tprogressDialog.setMessage(\"Please wait...\");\n \t\t\t//This dialog can't be canceled by pressing the back key\n \t\t\tprogressDialog.setCancelable(false);\n \t\t\t//This dialog isn't indeterminate\n \t\t\tprogressDialog.setIndeterminate(false);\n \t\t\t//The maximum number of items is 100\n \t\t\tprogressDialog.setMax(100);\n \t\t\t//Set the current progress to zero\n \t\t\tprogressDialog.setProgress(0);\n \t\t\t//Display the progress dialog\n \t\t\tprogressDialog.show();\n \t\t}", "@Override\n protected void onPreExecute() {\n String msg = \"Please Wait....\";\n cd.showProgressDialog(msg);\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tshowLoadingProgressDialog();\n\t\t}", "@Override\n protected void onPreExecute() {\n showLoadingProgressDialog();\n }", "@Override\n protected void onPreExecute() {\n showLoadingProgressDialog();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n pDialog = new ProgressDialog(Resume_create_employee.this);\n pDialog.setMessage(\"Loading...\");\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(MainActivity.this);\n pDialog.setMessage(\"Processing Request...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(DetailActivity.this);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(true);\n pDialog.show();\n }", "@Override\r\n protected void onPreExecute() {\n if( progressDialog == null ) {\r\n progressDialog = ProgressDialog.show( context, context.getString(R.string.pref_sync_callings_now_title),\"\");\r\n }\r\n }", "@Override\r\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\r\n\t\t\tpDialog = new ProgressDialog(SingleRecord.this);\r\n\t\t\tpDialog.setMessage(\"downloading...\");\r\n\t\t\tpDialog.setIndeterminate(false);\r\n\t\t\tpDialog.setCancelable(true);\r\n\t\t\r\n\t\t\tpDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\r\n\t\t\tpDialog.show();\r\n\t\t\tpDialog.getWindow().setGravity(Gravity.BOTTOM);\r\n\t\t}", "@Override\n protected void onPreExecute() {\n\n this.dialog.setMessage(\"Please wait ...\");\n this.dialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\taProgressDialog = new ProgressDialog(TargetProducts.this);\n\t\t\taProgressDialog.setMessage(\"Loading Report...\");\n\t\t\taProgressDialog.setIndeterminate(true);\n\t\t\taProgressDialog.setCanceledOnTouchOutside(true);\n\t\t\taProgressDialog.show();\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\taProgressDialog = new ProgressDialog(TargetProducts.this);\n\t\t\taProgressDialog.setMessage(\"Loading Report...\");\n\t\t\taProgressDialog.setIndeterminate(true);\n\t\t\taProgressDialog.setCanceledOnTouchOutside(true);\n\t\t\taProgressDialog.show();\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\t\n\t\t\tdialog = new ProgressDialog(BookingConfirmationScreen.this);\n\t\t\tdialog.setIndeterminate(false);\n\t\t\tdialog.setCancelable(true);\n\t\t\tdialog.show();\n\t\t\t\n\t\t\t\n\t\t}", "@Override\n protected void onProgressUpdate(Integer... values) {\n super.onProgressUpdate(values);\n progress = new ProgressDialog(activity);\n progress.setMessage(\"please wait.. \");\n progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progress.setIndeterminate(true);\n progress.setCancelable(false);\n progress.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tpdia = new ProgressDialog(mContext);\n\t\t\tpdia.setMessage(\"Loading Circles...\");\n\t\t\tpdia.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n // // pDialog = new ProgressDialog(getContext());\n pDialog = new ProgressDialog(context);\n pDialog.setMessage(\"Cargando Información\");\n pDialog.setCancelable(true);\n pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n pDialog.show();\n\n }", "public void showCustomLoadingDialog() {\n\n //..show gif\n viewDialog.showDialog();\n final Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n //...here i'm waiting 5 seconds before hiding the custom dialog\n //...you can do whenever you want or whenever your work is done\n viewDialog.hideDialog();\n }\n }, 1000);\n }", "public void showProgressDialog() {\n showProgressDialog(null);\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n // Show the progress in load\n pDialog = new ProgressDialog(UpdateTimeTable.this);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(false);\n pDialog.show();\n \n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n progressDialog = new ProgressDialog(AiutaGliAltri.this);\n progressDialog.setMessage(\"Sto Cercando!\");\n progressDialog.setIndeterminate(true);\n progressDialog.setCanceledOnTouchOutside(false);\n progressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tprogressDialog = new ProgressDialog(ListActivity.this);\n\t\t\tprogressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\n\t\t\tprogressDialog.setMessage(\"Loading Programs. .\");\n\t\t\tprogressDialog.setCancelable(false);\n\n\t\t\tprogressDialog.show();\n\t\t}", "private void showProgress(String message) {\n \tif(mProgress==null){\n \t\tmProgress = new ProgressDialog(stActivity);\n\t mProgress.setMessage(message);\n\t mProgress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\t mProgress.setIndeterminate(true);\n\t mProgress.setCancelable(false); \n\t mProgress.show();\n \t}\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(context);\n pDialog.setMessage(\"Fetching videolists..\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(true);\n pDialog.show();\n }", "@Override\n\tprotected void onPreExecute() {\n\t\tsuper.onPreExecute();\n\n\t\tprogress = ProgressDialog.show(act, \"\", \"Please wait ...\", true);\n\t\talert = new AlertDialog.Builder(act);\n\n\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tdialog = new ProgressDialog(BookingConfirmationScreen.this);\n\t\t\tdialog.setIndeterminate(false);\n\t\t\tdialog.setCancelable(true);\n\t\t\tdialog.show();\n\n\t\t}", "@Override\r\n\t\t protected void onPreExecute() {\n \t\tprogress= ProgressDialog.show(\r\n \t\t\t\tDetailProgramActivity.this, \r\n \t\t\t\t\"\", \r\n \t\t\t\tgetString(R.string.loading_data), \r\n \t\t\t\ttrue);\r\n \t}", "private void showProgressIndication() {\n Log.i(TAG, \"loading contacts... \");\n // TODO: make this be a no-op if the progress indication is\n // already visible with the exact same title and message.\n\n dismissProgressIndication(); // Clean up any prior progress indication\n\n mProgressDialog = new ProgressDialog(this);\n mProgressDialog.setMessage(this.getResources().getString(R.string.contact_list_loading));\t\n mProgressDialog.setIndeterminate(true);\n mProgressDialog.setCancelable(false);\n mProgressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\ttry {\n\t\t\t\tdialog.setIndeterminate(false);\n\t\t\t\tdialog.setMax(100);\n\t\t\t\tdialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n\t\t\t\tdialog.setCancelable(false);\n\t\t\t\tdialog.show();\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "public void initLoadingPage(Context c) {\n\n LayoutInflater inflater = (LayoutInflater) c.getSystemService( c.LAYOUT_INFLATER_SERVICE);\n final AlertDialog.Builder nameBuilder = new AlertDialog.Builder(c);\n View alertDiaView = inflater.inflate(R.layout.activity_loading_page,null);\n nameBuilder.setView(alertDiaView);\n\n avi = (AVLoadingIndicatorView) alertDiaView.findViewById(R.id.avi);\n avi.smoothToShow();\n\n\n int val= (int) (130 * Resources.getSystem().getDisplayMetrics().density);//dp to px\n alertDialog= nameBuilder.show();\n alertDialog.getWindow().setLayout(val ,val);\n\n\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n pDialog = new ProgressDialog(Activity_List.this);\n pDialog.setMessage(\"Loading spots. Please wait...\");\n\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "void dismissProgressLoading() {\n if (progressDialog != null) {\n progressDialog.dismiss();\n }\n }" ]
[ "0.8557397", "0.8352308", "0.82789254", "0.822031", "0.81208867", "0.81119037", "0.8109187", "0.8075028", "0.8038799", "0.8010011", "0.7997998", "0.7951318", "0.79485315", "0.7929994", "0.7912588", "0.78673536", "0.78506404", "0.78455085", "0.7834386", "0.78159356", "0.7798382", "0.7783928", "0.77606034", "0.776037", "0.77493894", "0.7749244", "0.7738311", "0.77311546", "0.7700916", "0.76972014", "0.76817316", "0.7670399", "0.766943", "0.76627254", "0.76446176", "0.76366425", "0.7630347", "0.762616", "0.7624932", "0.7620938", "0.7596425", "0.75929266", "0.7557972", "0.7557277", "0.75520486", "0.75413543", "0.7538379", "0.7530844", "0.7519652", "0.7451313", "0.74426204", "0.7441246", "0.7432651", "0.7425224", "0.7425224", "0.74187386", "0.74184424", "0.7416521", "0.741279", "0.74040735", "0.73892313", "0.7383382", "0.7360728", "0.7360464", "0.73591536", "0.73590803", "0.7352029", "0.7331429", "0.73278165", "0.7317555", "0.7315141", "0.73144925", "0.73100406", "0.73100406", "0.729128", "0.72901034", "0.7282718", "0.7282481", "0.72801375", "0.7275317", "0.7273378", "0.7273378", "0.7271452", "0.725862", "0.7244717", "0.7231727", "0.7228533", "0.72280747", "0.72067726", "0.72014236", "0.7187425", "0.716973", "0.716876", "0.7168217", "0.7168039", "0.71662796", "0.71654224", "0.7158605", "0.71551263", "0.7152313", "0.71458834" ]
0.0
-1
pDialog = new ProgressDialog(this); pDialog.setCancelable(false); pDialog.setMessage("Loading ..."); pDialog.show();
private void getDataBahasa(){ UserAPIService api = Config.getRetrofit().create(UserAPIService.class); Call<Value> call = api.lihat_program_like("Bahasa"); call.enqueue(new Callback<Value>() { @Override public void onResponse(Call<Value> call, Response<Value> response) { // pDialog.dismiss(); String value1= response.body().getStatus(); if (value1.equals("1")){ Value value = response.body(); resultAlls = new ArrayList<>(Arrays.asList(value.getResult())); adapter = new RecyclerAdapterListAll(resultAlls,getApplicationContext()); recyclerView.setAdapter(adapter); }else { Toast.makeText(ListPonpesActivity.this,"Maaf Data Tidak Ada",Toast.LENGTH_SHORT).show(); } } @Override public void onFailure(Call<Value> call, Throwable t) { // pDialog.dismiss(); Toast.makeText(ListPonpesActivity.this,"Respon gagal",Toast.LENGTH_SHORT).show(); Log.d("Hasil internet",t.toString()); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void showProgressDialog(){\n progressDialog=ProgressDialog.show(context,\"\",\"Loading...Please wait...\");\n\n\n }", "private Dialog buildLoadingDialog() {\n ProgressDialog dialog = new ProgressDialog(this);\n dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n dialog.setMessage(getText(R.string.dialog_loading));\n dialog.setIndeterminate(true);\n dialog.setCancelable(false);\n return dialog;\n }", "protected void showLoading()\n {\n progressBar = new ProgressDialog(this);\n progressBar.setTitle(\"Loading\");\n progressBar.setMessage(\"Wait while loading...\");\n progressBar.setCancelable(false); // disable dismiss by tapping outside of the dialog\n progressBar.show();\n }", "private void creatDialog() {\n \t mDialog=new ProgressDialog(this);\n \t mDialog.setTitle(\"\");\n \t mDialog.setMessage(\"正在加载请稍后\");\n \t mDialog.setIndeterminate(true);\n \t mDialog.setCancelable(true);\n \t mDialog.show();\n \n\t}", "@Override\n protected void onPreExecute() {\n\n dialog = new ProgressDialog(context);\n dialog.setTitle(\"Loading Contents\");\n dialog.setMessage(\"Doing something interesting ...\");\n dialog.setIndeterminate(true);\n dialog.setCancelable(false);\n dialog.show();\n }", "public void showProgressDialog() {\r\n progressDialog.setMessage(getResources().getString(R.string.text_loading));\r\n progressDialog.setCancelable(false);\r\n progressDialog.show();\r\n }", "@Override\n\t\tprotected void onPreExecute()\n\t\t{\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog = new ProgressDialog(MainActivity.this);\n\t\t\tpDialog.setMessage(\"Loading....\");\n\t\t\tpDialog.setCancelable(true);\n\t\t\tpDialog.show();\n\t\t}", "protected void onPreExecute() {\r\n \tdialog = new ProgressDialog(context);\r\n \t\tdialog.setMessage(\"Loading...\");\r\n \t\tdialog.show();\r\n }", "@Override\n protected void onPreExecute() {\n progressDialog= new ProgressDialog(getActivity());\n progressDialog.setMessage(\"loading..\");\n progressDialog.setIndeterminate(false);\n progressDialog.show();\n }", "private void displayLoader() {\n pDialog = new ProgressDialog(DangKyActivity.this);\n pDialog.setMessage(\"Vui lòng đợi trong giây lát...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\t \tprotected void onPreExecute() {\n\t\t try {\n\t\t\t \tpd=new ProgressDialog(Styles_Dialog.this);\n\t\t\t \tpd.setMessage(\"Loading\");\n\t\t\t \tpd.show();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t}\n\t\t \t\n\t\t \t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tpdia = new ProgressDialog(mContext);\n\t\t\tpdia.setMessage(\"Loading...\");\n\t\t\tpdia.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "private void displayLoader() {\n pDialog = new ProgressDialog(AddReviewActivity.this);\n pDialog.setMessage(\"Adding Review...Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog = new ProgressDialog(activity);\n\t\t\tpDialog.setMessage(\"Loading...\");\n\t\t\tpDialog.setIndeterminate(false);\n\t\t\tpDialog.setCancelable(true);\n\t\t\tpDialog.show();\n\t\t}", "@Override\n protected void onPreExecute() {\n\n\n dialog = new ProgressDialog(MainArea.this);\n dialog.setTitle(\"Loading Results\");\n dialog.setMessage(\"Please Wait Results Are Loading For You....\");\n dialog.setCanceledOnTouchOutside(false);\n dialog.show();\n super.onPreExecute();\n }", "private void progressStuff() {\n cd = new ConnectionDetector(getActivity());\n parser = new JSONParser();\n progress = new ProgressDialog(getActivity());\n progress.setMessage(getResources().getString(R.string.loading));\n progress.setIndeterminate(false);\n progress.setCancelable(true);\n // progress.show();\n }", "@Override\r\n\t\tprotected void onPreExecute() {\r\n\t\t\tsuper.onPreExecute();\r\n\t\t\tpDialog = new ProgressDialog(getActivity());\r\n\t\t\tpDialog.setMessage(\"Loading...\");\r\n\t\t\tpDialog.setIndeterminate(false);\r\n\t\t\tpDialog.setCancelable(false);\r\n\t\t\tpDialog.show();\r\n\t\t}", "void showProgressLoading(Context context, boolean isCancelable) {\n\n progressDialog = new ProgressDialog(context);\n progressDialog.setIndeterminate(true);\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progressDialog.setMessage(\"Loading...\");\n progressDialog.setCancelable(isCancelable);\n progressDialog.setCanceledOnTouchOutside(false);\n\n progressDialog.show();\n\n }", "protected final void showLoadingDialog() {\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pd = new ProgressDialog(activity);\n pd.setMessage(\"Loading, Please Wait.....\");\n pd.setCancelable(false);\n pd.show();\n }", "public void showProgressDialog() {\n if (mProgressDialog == null) {\n mProgressDialog = new ProgressDialog(this);\n mProgressDialog.setCancelable(false);\n mProgressDialog.setCanceledOnTouchOutside(false);\n mProgressDialog.setMessage(getString(R.string.msg_loading));\n mProgressDialog.setIndeterminate(true);\n }\n mProgressDialog.show();\n }", "private void showSpinerProgress() {\n dialog.setMessage(\"Loading\");\n//\n// dialog.setButton(ProgressDialog.BUTTON_POSITIVE, \"YES\", new DialogInterface.OnClickListener() {\n// @Override\n// public void onClick(DialogInterface dialog, int which) {\n//\n// }\n// });\n\n //thiet lap k the huy - co the huy\n dialog.setCancelable(false);\n\n //show dialog\n dialog.show();\n Timer timer = new Timer();\n timer.schedule(new TimerTask() {\n @Override\n public void run() {\n dialog.dismiss();\n }\n }, 20000000);\n }", "public void initProgressLoader() {\n progressDialog = new ProgressDialog(this);\n progressDialog.setIndeterminate(true);\n progressDialog.setCancelable(false);\n }", "private void showDialog(){\n progress = new ProgressDialog(this);\n progress.setTitle(getString(R.string.progress_dialog_loading));\n progress.setMessage(getString(R.string.progress_dialog_authenticating_with_firebase));\n progress.setCancelable(false);\n progress.show();\n }", "private void displayLoader() {\n pDialog = new ProgressDialog(RegisterActivity.this);\n pDialog.setMessage(\"Signing Up.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tprogressDialog = ProgressDialog.show(MainActivity.this, \"\",\n\t\t\t\t\t\"Loading...\");\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tmyDialog = ProgressDialog.show\n\t\t\t\t\t(\n\t\t\t\t\t\t\tgetActivity(),\n\t\t\t\t\t\t\t\"Loading...\",\n\t\t\t\t\t\t\t\"Please Wait\",\n\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t);\n\t\t}", "@Override\n\tprotected void onPreExecute() {\n\t\t\n\t\t pDialog = new ProgressDialog(context);\n\t\t\ttry{\n\t\t\t\tthis.pDialog.setMessage(\"Please wait ...\");\n\t\t this.pDialog.setIndeterminateDrawable(context.getResources().getDrawable(R.drawable.red_progress));\n\t\t this.pDialog.setIndeterminate(false);\n\t\t this.pDialog.setCancelable(false);\n\t\t this.pDialog.show();\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\te.getMessage();\n\t\t\t}\n\t}", "private void showProgressDialog()\n {\n if (showProgressDialog && !getStatus().equals(AsyncTask.Status.FINISHED)) {\n //show the dialog if valid activity. If the OS is lollipop or higher then set the theme.\n //dialog = ProgressDialog.show(activity, \"In progress..\", message, true);\n if (Build.VERSION.SDK_INT >= 21) {\n dialog = new ProgressDialog(activity, R.style.progressoAlertDialogStyle);\n dialog.setTitle(\"In progress..\");\n dialog.setMessage(message);\n dialog.setIndeterminate(true);\n dialog.show();\n }\n else {\n dialog = ProgressDialog.show(activity, \"In progress..\", message, true);\n }\n\n dialog.setCancelable(false);\n } \n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(TalkActivity.this);\n pDialog.setMessage(getResources().getString(R.string.loading));\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n public void showloading(String message) {\n progressDialog = new ProgressDialog(getActivity());\n progressDialog.setMessage(message);\n progressDialog.setIndeterminate(true);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(Integrationforkhalti.this);\n pDialog.setMessage(\"Loading Please wait...\");\n pDialog.setIndeterminate(true);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n mProgressDialog = new ProgressDialog(getActivity());\n mProgressDialog.setMessage(getString(R.string.loading_text));\n mProgressDialog.setCancelable(false);\n }", "private void showProgressDialog() {\n if (progressDialog == null) {\n progressDialog = new ProgressDialog(getContext());\n }\n\n progressDialog.setTitle(R.string.dialog_title);\n progressDialog.setMessage(getResources().getString(R.string.dialog_message));\n progressDialog.setCancelable(false);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n /* mProgress.setMessage(\"Please Wait\");\n mProgress.setCancelable(false);\n mProgress.show();*/\n String msg = \"Please Wait....\";\n cd.showProgressDialog(msg);\n }", "private void showLoadingDialogue(final String loadingMessage) {\n progressDialog.setMessage(loadingMessage);\n progressDialog.setCancelable(false);\n progressDialog.setIndeterminate(false);\n progressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() \n\t\t{\n\t\t\t\n\t\t\tdialog = new ProgressDialog(AddFoodAdvActivity.this);\n\t\t\tdialog.setMessage(\"Loading...\");\n\t\t\tdialog.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "private void showDialog() {\n try {\n pDialog.setMessage(getString(R.string.please_wait));\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.setCanceledOnTouchOutside(false);\n pDialog.show();\n } catch (Exception e) {\n // TODO: handle exception\n }\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tdl = ProgressDialog.show(getActivity(), \"Thông báo\", \"Loading...\",\n\t\t\t\t\ttrue, false);\n\t\t\tdl.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n protected void onPreExecute()\n {\n // Create a new progress dialog\n progressDialog = new ProgressDialog(MainActivity.this);\n // Set the progress dialog spinner progress bar\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n // Set the dialog title to 'Loading...'\n progressDialog.setTitle(\"Loading...\");\n // Set the dialog message to 'Loading application View, please wait...'\n progressDialog.setMessage(\"Loading application, please wait...\");\n // This dialog can't be canceled by pressing the back key\n progressDialog.setCancelable(false);\n // This dialog isn't indeterminate\n progressDialog.setIndeterminate(false);\n // The maximum number of items is 100\n progressDialog.setMax(100);\n // Set the current progress to zero\n progressDialog.setProgress(0);\n // Display the progress dialog\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progressDialog.setMessage(\"Please wait. Loading...\");\n progressDialog.setCanceledOnTouchOutside(false);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n pDialog = new ProgressDialog(getActivity());\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(false);\n pDialog.setIndeterminate(false);\n pDialog.setMax(100);\n pDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n pDialog.show();\n// progressBar.setVisibility(View.VISIBLE);\n// progressBar.setProgress(0);\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n\n dialog = new ProgressDialog(AddFoodAdvActivity.this);\n dialog.setMessage(\"Please Wait...!\");\n dialog.show();\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n showProgressDialog(R.string.please_wait);\n //showDialog(progress_bar_type);\n }", "@Override\r\n\tprotected void onPreExecute()\r\n\t{\r\n\t\tprogress = new ProgressDialog(ctx);\r\n\t\tprogress.setTitle(\"Retrieving Parking Information\");\r\n\t\tprogress.setMessage(\"Please wait.\");\r\n\t\tprogress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\r\n\t\tprogress.show();\r\n\t\tsuper.onPreExecute();\r\n\t}", "@Override\n protected void onPreExecute() {\n progressDialog = new ProgressDialog(getActivity());\n progressDialog.setTitle(getResources().getString(R.string.please_wait));\n progressDialog.setMessage(getResources().getString(R.string.fetching_data));\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n // Showing progress dialog\n pDialog = new ProgressDialog(thisContext);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(true);\n pDialog.show();\n\n }", "private void displayProgressDialog() {\n pDialog.setMessage(\"Logging in.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\r\n \tprotected void onPreExecute() {\n \t\tsuper.onPreExecute();\r\n \t\tpdia = new ProgressDialog(Regmember.this);\r\n \t\tpdia.setCanceledOnTouchOutside(false);\r\n pdia.setMessage(\"Dhiraj rakh..........\");\r\n pdia.show(); \r\n \t}", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n this.dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n this.dialog.setCancelable(false);\n this.dialog.show();\n }", "@Override\n protected void onPreExecute() {\n pDialog = new ProgressDialog(homeActivity);\n pDialog.setMessage(\"Retrieving Details... \");\n // pDialog.setMax(16);\n pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\n pDialog.setCancelable(false);\n pDialog.show();\n\n\n }", "public void onPreExecute() {\n progressDialog.show();\n }", "@Override\r\n\t protected void onPreExecute() {\n\t super.onPreExecute();\r\n\t progressDialog = new ProgressDialog(UDMap.this);\r\n\t progressDialog.setMessage(\"Loading the best way...\");\r\n\t progressDialog.setIndeterminate(true);\r\n\t progressDialog.show();\r\n\t }", "void showProgressDialog();", "void showProgressDialog();", "protected void onPreExecute() {\n try {\n this.dialog.setMessage(getContext().getResources().getString(R.string.loading));\n this.dialog.show();\n } catch (Exception ex) {\n Log.e(null, ex);\n }\n }", "public void showProgressDialog() {\n pd = new ProgressDialog(this);\n pd.setMessage(\"Renting film...\");\n pd.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog1 = new ProgressDialog(Doctorslist.this);\n\t\t\tpDialog1.setMessage(\"Loading ...\");\n\t\t\tpDialog1.setIndeterminate(false);\n\t\t\tpDialog1.setCancelable(false);\n\t\t\tpDialog1.show();\n\t\t}", "public void showProgressDialog() {\n try {\n if (progressDialog == null) {\n try {\n progressDialog = new ProgressDialog(self);\n progressDialog.show();\n progressDialog.setCancelable(false);\n } catch (Exception e) {\n progressDialog = new ProgressDialog(self.getParent());\n progressDialog.show();\n progressDialog.setCancelable(false);\n e.printStackTrace();\n }\n } else {\n if (!progressDialog.isShowing())\n progressDialog.show();\n }\n } catch (Exception e) {\n progressDialog = new ProgressDialog(self);\n progressDialog.show();\n progressDialog.setCancelable(false);\n e.printStackTrace();\n }\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n loading = ProgressDialog.show(this.context, \"Fetching Data\",\"Please Wait...\",true,true);\n }", "private void showProgressDialog() {\n mProgressDialog = AppDialog.showProgressDialog(this);\n mProgressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n asyncDialog.setMessage(\"Loading...\");\n //show dialog\n asyncDialog.show();\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n progress = new ProgressDialog(hostContext);\n progress.setMessage(\"Wait while books are being downloaded...\");\n progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progress.show();\n }", "public void showProgress2(){\n// if (mHandler==null){\n// mHandler = new Handler(Looper.getMainLooper());\n// }\n new Handler(Looper.getMainLooper()).post(new Runnable() {\n @Override\n public void run() {\n loadingDialog = new Dialog(BaseActivity.this);\n loadingDialog.setTitle(\"Loading data..\");\n loadingDialog.setContentView(R.layout.loading);\n loadingDialog.show();\n\n }\n });\n// mHandler.post(new Runnable() {\n// @Override\n// public void run() {\n// loadingDialog = new Dialog(BaseActivity.this);\n// loadingDialog.setTitle(\"Loading data..\");\n// loadingDialog.setContentView(R.layout.loading);\n// loadingDialog.show();\n//\n// }\n// });\n }", "private void displayProgressDialog() {\n pDialog.setMessage(\"Logging In.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\t// TODO Auto-generated method stub\n\t\t\tsuper.onPreExecute();\n\t\t\tpd = ProgressDialogUtil.createDialogNoTitle(context, \"loading...\");\n\t\t\tpd.show();\n\t\t}", "protected void createProgressDialog() {\r\t\tif (pd == null) {\r\t\t\tpd = new ProgressDialog(this);\r\t\t\tpd.setCanceledOnTouchOutside(false);\r\t\t\tpd.getWindow().setGravity(Gravity.CENTER);\r\t\t\tpd.setOnCancelListener(new DialogInterface.OnCancelListener() {\r\t\t\t\t@Override\r\t\t\t\tpublic void onCancel(DialogInterface dialogInterface) {\r\t\t\t\t\tonPdCancel();\r\t\t\t\t}\r\t\t\t});\r\t\t}\r\t}", "private void showLoadingDialog() {\n mDefaultLoadingDialogFragment = new DefaultLoadingDialogFragment();\n mDefaultLoadingDialogFragment.show(getChildFragmentManager(), \"loadingDialog\");\n }", "@Override\n\t protected void onPreExecute() {\n\t super.onPreExecute();\n\t \n\t progressDialog= new Dialog(ListKotaActivity.this);\n\t progressDialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);\n\t progressDialog.setContentView(R.layout.progress);\n\t progressDialog.setCancelable(false);\n\t progressDialog.show();\t \n\t }", "@Override\n \t\tprotected void onPreExecute() \n \t\t{\n \t\t\t//Create a new progress dialog\n \t\t\tprogressDialog = new ProgressDialog(MainActivity.this);\n \t\t\t//Set the progress dialog to display a horizontal progress bar \n \t\t\tprogressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n \t\t\t//Set the dialog title to 'Loading...'\n \t\t\tprogressDialog.setTitle(\"Loading Game...\");\n \t\t\t//Set the dialog message to 'Loading application View, please wait...'\n \t\t\tprogressDialog.setMessage(\"Please wait...\");\n \t\t\t//This dialog can't be canceled by pressing the back key\n \t\t\tprogressDialog.setCancelable(false);\n \t\t\t//This dialog isn't indeterminate\n \t\t\tprogressDialog.setIndeterminate(false);\n \t\t\t//The maximum number of items is 100\n \t\t\tprogressDialog.setMax(100);\n \t\t\t//Set the current progress to zero\n \t\t\tprogressDialog.setProgress(0);\n \t\t\t//Display the progress dialog\n \t\t\tprogressDialog.show();\n \t\t}", "@Override\n protected void onPreExecute() {\n String msg = \"Please Wait....\";\n cd.showProgressDialog(msg);\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tshowLoadingProgressDialog();\n\t\t}", "@Override\n protected void onPreExecute() {\n showLoadingProgressDialog();\n }", "@Override\n protected void onPreExecute() {\n showLoadingProgressDialog();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n pDialog = new ProgressDialog(Resume_create_employee.this);\n pDialog.setMessage(\"Loading...\");\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(MainActivity.this);\n pDialog.setMessage(\"Processing Request...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\r\n protected void onPreExecute() {\n if( progressDialog == null ) {\r\n progressDialog = ProgressDialog.show( context, context.getString(R.string.pref_sync_callings_now_title),\"\");\r\n }\r\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(DetailActivity.this);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(true);\n pDialog.show();\n }", "@Override\r\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\r\n\t\t\tpDialog = new ProgressDialog(SingleRecord.this);\r\n\t\t\tpDialog.setMessage(\"downloading...\");\r\n\t\t\tpDialog.setIndeterminate(false);\r\n\t\t\tpDialog.setCancelable(true);\r\n\t\t\r\n\t\t\tpDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\r\n\t\t\tpDialog.show();\r\n\t\t\tpDialog.getWindow().setGravity(Gravity.BOTTOM);\r\n\t\t}", "@Override\n protected void onPreExecute() {\n\n this.dialog.setMessage(\"Please wait ...\");\n this.dialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\taProgressDialog = new ProgressDialog(TargetProducts.this);\n\t\t\taProgressDialog.setMessage(\"Loading Report...\");\n\t\t\taProgressDialog.setIndeterminate(true);\n\t\t\taProgressDialog.setCanceledOnTouchOutside(true);\n\t\t\taProgressDialog.show();\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\taProgressDialog = new ProgressDialog(TargetProducts.this);\n\t\t\taProgressDialog.setMessage(\"Loading Report...\");\n\t\t\taProgressDialog.setIndeterminate(true);\n\t\t\taProgressDialog.setCanceledOnTouchOutside(true);\n\t\t\taProgressDialog.show();\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\t\n\t\t\tdialog = new ProgressDialog(BookingConfirmationScreen.this);\n\t\t\tdialog.setIndeterminate(false);\n\t\t\tdialog.setCancelable(true);\n\t\t\tdialog.show();\n\t\t\t\n\t\t\t\n\t\t}", "@Override\n protected void onProgressUpdate(Integer... values) {\n super.onProgressUpdate(values);\n progress = new ProgressDialog(activity);\n progress.setMessage(\"please wait.. \");\n progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progress.setIndeterminate(true);\n progress.setCancelable(false);\n progress.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tpdia = new ProgressDialog(mContext);\n\t\t\tpdia.setMessage(\"Loading Circles...\");\n\t\t\tpdia.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n // // pDialog = new ProgressDialog(getContext());\n pDialog = new ProgressDialog(context);\n pDialog.setMessage(\"Cargando Información\");\n pDialog.setCancelable(true);\n pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n pDialog.show();\n\n }", "public void showCustomLoadingDialog() {\n\n //..show gif\n viewDialog.showDialog();\n final Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n //...here i'm waiting 5 seconds before hiding the custom dialog\n //...you can do whenever you want or whenever your work is done\n viewDialog.hideDialog();\n }\n }, 1000);\n }", "public void showProgressDialog() {\n showProgressDialog(null);\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n // Show the progress in load\n pDialog = new ProgressDialog(UpdateTimeTable.this);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(false);\n pDialog.show();\n \n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n progressDialog = new ProgressDialog(AiutaGliAltri.this);\n progressDialog.setMessage(\"Sto Cercando!\");\n progressDialog.setIndeterminate(true);\n progressDialog.setCanceledOnTouchOutside(false);\n progressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tprogressDialog = new ProgressDialog(ListActivity.this);\n\t\t\tprogressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\n\t\t\tprogressDialog.setMessage(\"Loading Programs. .\");\n\t\t\tprogressDialog.setCancelable(false);\n\n\t\t\tprogressDialog.show();\n\t\t}", "private void showProgress(String message) {\n \tif(mProgress==null){\n \t\tmProgress = new ProgressDialog(stActivity);\n\t mProgress.setMessage(message);\n\t mProgress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\t mProgress.setIndeterminate(true);\n\t mProgress.setCancelable(false); \n\t mProgress.show();\n \t}\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(context);\n pDialog.setMessage(\"Fetching videolists..\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(true);\n pDialog.show();\n }", "@Override\n\tprotected void onPreExecute() {\n\t\tsuper.onPreExecute();\n\n\t\tprogress = ProgressDialog.show(act, \"\", \"Please wait ...\", true);\n\t\talert = new AlertDialog.Builder(act);\n\n\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tdialog = new ProgressDialog(BookingConfirmationScreen.this);\n\t\t\tdialog.setIndeterminate(false);\n\t\t\tdialog.setCancelable(true);\n\t\t\tdialog.show();\n\n\t\t}", "@Override\r\n\t\t protected void onPreExecute() {\n \t\tprogress= ProgressDialog.show(\r\n \t\t\t\tDetailProgramActivity.this, \r\n \t\t\t\t\"\", \r\n \t\t\t\tgetString(R.string.loading_data), \r\n \t\t\t\ttrue);\r\n \t}", "private void showProgressIndication() {\n Log.i(TAG, \"loading contacts... \");\n // TODO: make this be a no-op if the progress indication is\n // already visible with the exact same title and message.\n\n dismissProgressIndication(); // Clean up any prior progress indication\n\n mProgressDialog = new ProgressDialog(this);\n mProgressDialog.setMessage(this.getResources().getString(R.string.contact_list_loading));\t\n mProgressDialog.setIndeterminate(true);\n mProgressDialog.setCancelable(false);\n mProgressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\ttry {\n\t\t\t\tdialog.setIndeterminate(false);\n\t\t\t\tdialog.setMax(100);\n\t\t\t\tdialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n\t\t\t\tdialog.setCancelable(false);\n\t\t\t\tdialog.show();\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "public void initLoadingPage(Context c) {\n\n LayoutInflater inflater = (LayoutInflater) c.getSystemService( c.LAYOUT_INFLATER_SERVICE);\n final AlertDialog.Builder nameBuilder = new AlertDialog.Builder(c);\n View alertDiaView = inflater.inflate(R.layout.activity_loading_page,null);\n nameBuilder.setView(alertDiaView);\n\n avi = (AVLoadingIndicatorView) alertDiaView.findViewById(R.id.avi);\n avi.smoothToShow();\n\n\n int val= (int) (130 * Resources.getSystem().getDisplayMetrics().density);//dp to px\n alertDialog= nameBuilder.show();\n alertDialog.getWindow().setLayout(val ,val);\n\n\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n pDialog = new ProgressDialog(Activity_List.this);\n pDialog.setMessage(\"Loading spots. Please wait...\");\n\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "void dismissProgressLoading() {\n if (progressDialog != null) {\n progressDialog.dismiss();\n }\n }" ]
[ "0.8557045", "0.8352073", "0.82782894", "0.8220604", "0.81204444", "0.81114143", "0.81088936", "0.8075008", "0.80385983", "0.80099565", "0.7998021", "0.7951042", "0.7948951", "0.79297745", "0.79125816", "0.7867626", "0.78503615", "0.7844461", "0.783419", "0.78155154", "0.7797405", "0.77843785", "0.77607805", "0.77604836", "0.77496994", "0.774902", "0.7738241", "0.77314544", "0.77007455", "0.7697283", "0.7681435", "0.7670188", "0.76689005", "0.7662171", "0.76446056", "0.76371026", "0.76303965", "0.7626374", "0.7624843", "0.7620683", "0.7596071", "0.75929445", "0.75580853", "0.75576144", "0.75520533", "0.7541554", "0.7538303", "0.7531022", "0.7519704", "0.74514204", "0.7442647", "0.74413776", "0.7432885", "0.74249965", "0.74249965", "0.7418813", "0.7418208", "0.7415767", "0.7411552", "0.74035907", "0.73882425", "0.7383069", "0.73605984", "0.7360434", "0.7359214", "0.7358813", "0.7352035", "0.7331254", "0.7327694", "0.73176116", "0.7315045", "0.73140264", "0.7309725", "0.7309725", "0.7290968", "0.72906554", "0.7282565", "0.7282205", "0.72795296", "0.72756755", "0.72727454", "0.72727454", "0.72711354", "0.72585666", "0.7244673", "0.72320485", "0.722821", "0.7227202", "0.72064906", "0.72013676", "0.71868914", "0.7170065", "0.7168721", "0.71682936", "0.7167675", "0.7166334", "0.7164909", "0.71586955", "0.71556073", "0.71518874", "0.71462655" ]
0.0
-1
pDialog = new ProgressDialog(this); pDialog.setCancelable(false); pDialog.setMessage("Loading ..."); pDialog.show();
private void getDataDai(){ UserAPIService api = Config.getRetrofit().create(UserAPIService.class); Call<Value> call = api.lihat_program_like("Dai"); call.enqueue(new Callback<Value>() { @Override public void onResponse(Call<Value> call, Response<Value> response) { // pDialog.dismiss(); String value1= response.body().getStatus(); if (value1.equals("1")){ Value value = response.body(); resultAlls = new ArrayList<>(Arrays.asList(value.getResult())); adapter = new RecyclerAdapterListAll(resultAlls,getApplicationContext()); recyclerView.setAdapter(adapter); }else { Toast.makeText(ListPonpesActivity.this,"Maaf Data Tidak Ada",Toast.LENGTH_SHORT).show(); } } @Override public void onFailure(Call<Value> call, Throwable t) { // pDialog.dismiss(); Toast.makeText(ListPonpesActivity.this,"Respon gagal",Toast.LENGTH_SHORT).show(); Log.d("Hasil internet",t.toString()); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void showProgressDialog(){\n progressDialog=ProgressDialog.show(context,\"\",\"Loading...Please wait...\");\n\n\n }", "private Dialog buildLoadingDialog() {\n ProgressDialog dialog = new ProgressDialog(this);\n dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n dialog.setMessage(getText(R.string.dialog_loading));\n dialog.setIndeterminate(true);\n dialog.setCancelable(false);\n return dialog;\n }", "protected void showLoading()\n {\n progressBar = new ProgressDialog(this);\n progressBar.setTitle(\"Loading\");\n progressBar.setMessage(\"Wait while loading...\");\n progressBar.setCancelable(false); // disable dismiss by tapping outside of the dialog\n progressBar.show();\n }", "private void creatDialog() {\n \t mDialog=new ProgressDialog(this);\n \t mDialog.setTitle(\"\");\n \t mDialog.setMessage(\"正在加载请稍后\");\n \t mDialog.setIndeterminate(true);\n \t mDialog.setCancelable(true);\n \t mDialog.show();\n \n\t}", "@Override\n protected void onPreExecute() {\n\n dialog = new ProgressDialog(context);\n dialog.setTitle(\"Loading Contents\");\n dialog.setMessage(\"Doing something interesting ...\");\n dialog.setIndeterminate(true);\n dialog.setCancelable(false);\n dialog.show();\n }", "public void showProgressDialog() {\r\n progressDialog.setMessage(getResources().getString(R.string.text_loading));\r\n progressDialog.setCancelable(false);\r\n progressDialog.show();\r\n }", "@Override\n\t\tprotected void onPreExecute()\n\t\t{\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog = new ProgressDialog(MainActivity.this);\n\t\t\tpDialog.setMessage(\"Loading....\");\n\t\t\tpDialog.setCancelable(true);\n\t\t\tpDialog.show();\n\t\t}", "protected void onPreExecute() {\r\n \tdialog = new ProgressDialog(context);\r\n \t\tdialog.setMessage(\"Loading...\");\r\n \t\tdialog.show();\r\n }", "@Override\n protected void onPreExecute() {\n progressDialog= new ProgressDialog(getActivity());\n progressDialog.setMessage(\"loading..\");\n progressDialog.setIndeterminate(false);\n progressDialog.show();\n }", "private void displayLoader() {\n pDialog = new ProgressDialog(DangKyActivity.this);\n pDialog.setMessage(\"Vui lòng đợi trong giây lát...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\t \tprotected void onPreExecute() {\n\t\t try {\n\t\t\t \tpd=new ProgressDialog(Styles_Dialog.this);\n\t\t\t \tpd.setMessage(\"Loading\");\n\t\t\t \tpd.show();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t}\n\t\t \t\n\t\t \t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tpdia = new ProgressDialog(mContext);\n\t\t\tpdia.setMessage(\"Loading...\");\n\t\t\tpdia.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "private void displayLoader() {\n pDialog = new ProgressDialog(AddReviewActivity.this);\n pDialog.setMessage(\"Adding Review...Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog = new ProgressDialog(activity);\n\t\t\tpDialog.setMessage(\"Loading...\");\n\t\t\tpDialog.setIndeterminate(false);\n\t\t\tpDialog.setCancelable(true);\n\t\t\tpDialog.show();\n\t\t}", "@Override\n protected void onPreExecute() {\n\n\n dialog = new ProgressDialog(MainArea.this);\n dialog.setTitle(\"Loading Results\");\n dialog.setMessage(\"Please Wait Results Are Loading For You....\");\n dialog.setCanceledOnTouchOutside(false);\n dialog.show();\n super.onPreExecute();\n }", "private void progressStuff() {\n cd = new ConnectionDetector(getActivity());\n parser = new JSONParser();\n progress = new ProgressDialog(getActivity());\n progress.setMessage(getResources().getString(R.string.loading));\n progress.setIndeterminate(false);\n progress.setCancelable(true);\n // progress.show();\n }", "@Override\r\n\t\tprotected void onPreExecute() {\r\n\t\t\tsuper.onPreExecute();\r\n\t\t\tpDialog = new ProgressDialog(getActivity());\r\n\t\t\tpDialog.setMessage(\"Loading...\");\r\n\t\t\tpDialog.setIndeterminate(false);\r\n\t\t\tpDialog.setCancelable(false);\r\n\t\t\tpDialog.show();\r\n\t\t}", "void showProgressLoading(Context context, boolean isCancelable) {\n\n progressDialog = new ProgressDialog(context);\n progressDialog.setIndeterminate(true);\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progressDialog.setMessage(\"Loading...\");\n progressDialog.setCancelable(isCancelable);\n progressDialog.setCanceledOnTouchOutside(false);\n\n progressDialog.show();\n\n }", "protected final void showLoadingDialog() {\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pd = new ProgressDialog(activity);\n pd.setMessage(\"Loading, Please Wait.....\");\n pd.setCancelable(false);\n pd.show();\n }", "public void showProgressDialog() {\n if (mProgressDialog == null) {\n mProgressDialog = new ProgressDialog(this);\n mProgressDialog.setCancelable(false);\n mProgressDialog.setCanceledOnTouchOutside(false);\n mProgressDialog.setMessage(getString(R.string.msg_loading));\n mProgressDialog.setIndeterminate(true);\n }\n mProgressDialog.show();\n }", "private void showSpinerProgress() {\n dialog.setMessage(\"Loading\");\n//\n// dialog.setButton(ProgressDialog.BUTTON_POSITIVE, \"YES\", new DialogInterface.OnClickListener() {\n// @Override\n// public void onClick(DialogInterface dialog, int which) {\n//\n// }\n// });\n\n //thiet lap k the huy - co the huy\n dialog.setCancelable(false);\n\n //show dialog\n dialog.show();\n Timer timer = new Timer();\n timer.schedule(new TimerTask() {\n @Override\n public void run() {\n dialog.dismiss();\n }\n }, 20000000);\n }", "public void initProgressLoader() {\n progressDialog = new ProgressDialog(this);\n progressDialog.setIndeterminate(true);\n progressDialog.setCancelable(false);\n }", "private void showDialog(){\n progress = new ProgressDialog(this);\n progress.setTitle(getString(R.string.progress_dialog_loading));\n progress.setMessage(getString(R.string.progress_dialog_authenticating_with_firebase));\n progress.setCancelable(false);\n progress.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tprogressDialog = ProgressDialog.show(MainActivity.this, \"\",\n\t\t\t\t\t\"Loading...\");\n\t\t}", "private void displayLoader() {\n pDialog = new ProgressDialog(RegisterActivity.this);\n pDialog.setMessage(\"Signing Up.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tmyDialog = ProgressDialog.show\n\t\t\t\t\t(\n\t\t\t\t\t\t\tgetActivity(),\n\t\t\t\t\t\t\t\"Loading...\",\n\t\t\t\t\t\t\t\"Please Wait\",\n\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t);\n\t\t}", "@Override\n\tprotected void onPreExecute() {\n\t\t\n\t\t pDialog = new ProgressDialog(context);\n\t\t\ttry{\n\t\t\t\tthis.pDialog.setMessage(\"Please wait ...\");\n\t\t this.pDialog.setIndeterminateDrawable(context.getResources().getDrawable(R.drawable.red_progress));\n\t\t this.pDialog.setIndeterminate(false);\n\t\t this.pDialog.setCancelable(false);\n\t\t this.pDialog.show();\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\te.getMessage();\n\t\t\t}\n\t}", "private void showProgressDialog()\n {\n if (showProgressDialog && !getStatus().equals(AsyncTask.Status.FINISHED)) {\n //show the dialog if valid activity. If the OS is lollipop or higher then set the theme.\n //dialog = ProgressDialog.show(activity, \"In progress..\", message, true);\n if (Build.VERSION.SDK_INT >= 21) {\n dialog = new ProgressDialog(activity, R.style.progressoAlertDialogStyle);\n dialog.setTitle(\"In progress..\");\n dialog.setMessage(message);\n dialog.setIndeterminate(true);\n dialog.show();\n }\n else {\n dialog = ProgressDialog.show(activity, \"In progress..\", message, true);\n }\n\n dialog.setCancelable(false);\n } \n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(TalkActivity.this);\n pDialog.setMessage(getResources().getString(R.string.loading));\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n public void showloading(String message) {\n progressDialog = new ProgressDialog(getActivity());\n progressDialog.setMessage(message);\n progressDialog.setIndeterminate(true);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(Integrationforkhalti.this);\n pDialog.setMessage(\"Loading Please wait...\");\n pDialog.setIndeterminate(true);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n mProgressDialog = new ProgressDialog(getActivity());\n mProgressDialog.setMessage(getString(R.string.loading_text));\n mProgressDialog.setCancelable(false);\n }", "private void showProgressDialog() {\n if (progressDialog == null) {\n progressDialog = new ProgressDialog(getContext());\n }\n\n progressDialog.setTitle(R.string.dialog_title);\n progressDialog.setMessage(getResources().getString(R.string.dialog_message));\n progressDialog.setCancelable(false);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n /* mProgress.setMessage(\"Please Wait\");\n mProgress.setCancelable(false);\n mProgress.show();*/\n String msg = \"Please Wait....\";\n cd.showProgressDialog(msg);\n }", "private void showLoadingDialogue(final String loadingMessage) {\n progressDialog.setMessage(loadingMessage);\n progressDialog.setCancelable(false);\n progressDialog.setIndeterminate(false);\n progressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() \n\t\t{\n\t\t\t\n\t\t\tdialog = new ProgressDialog(AddFoodAdvActivity.this);\n\t\t\tdialog.setMessage(\"Loading...\");\n\t\t\tdialog.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "private void showDialog() {\n try {\n pDialog.setMessage(getString(R.string.please_wait));\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.setCanceledOnTouchOutside(false);\n pDialog.show();\n } catch (Exception e) {\n // TODO: handle exception\n }\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tdl = ProgressDialog.show(getActivity(), \"Thông báo\", \"Loading...\",\n\t\t\t\t\ttrue, false);\n\t\t\tdl.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n protected void onPreExecute()\n {\n // Create a new progress dialog\n progressDialog = new ProgressDialog(MainActivity.this);\n // Set the progress dialog spinner progress bar\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n // Set the dialog title to 'Loading...'\n progressDialog.setTitle(\"Loading...\");\n // Set the dialog message to 'Loading application View, please wait...'\n progressDialog.setMessage(\"Loading application, please wait...\");\n // This dialog can't be canceled by pressing the back key\n progressDialog.setCancelable(false);\n // This dialog isn't indeterminate\n progressDialog.setIndeterminate(false);\n // The maximum number of items is 100\n progressDialog.setMax(100);\n // Set the current progress to zero\n progressDialog.setProgress(0);\n // Display the progress dialog\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progressDialog.setMessage(\"Please wait. Loading...\");\n progressDialog.setCanceledOnTouchOutside(false);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n pDialog = new ProgressDialog(getActivity());\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(false);\n pDialog.setIndeterminate(false);\n pDialog.setMax(100);\n pDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n pDialog.show();\n// progressBar.setVisibility(View.VISIBLE);\n// progressBar.setProgress(0);\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n\n dialog = new ProgressDialog(AddFoodAdvActivity.this);\n dialog.setMessage(\"Please Wait...!\");\n dialog.show();\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n showProgressDialog(R.string.please_wait);\n //showDialog(progress_bar_type);\n }", "@Override\r\n\tprotected void onPreExecute()\r\n\t{\r\n\t\tprogress = new ProgressDialog(ctx);\r\n\t\tprogress.setTitle(\"Retrieving Parking Information\");\r\n\t\tprogress.setMessage(\"Please wait.\");\r\n\t\tprogress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\r\n\t\tprogress.show();\r\n\t\tsuper.onPreExecute();\r\n\t}", "@Override\n protected void onPreExecute() {\n progressDialog = new ProgressDialog(getActivity());\n progressDialog.setTitle(getResources().getString(R.string.please_wait));\n progressDialog.setMessage(getResources().getString(R.string.fetching_data));\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n // Showing progress dialog\n pDialog = new ProgressDialog(thisContext);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(true);\n pDialog.show();\n\n }", "private void displayProgressDialog() {\n pDialog.setMessage(\"Logging in.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\r\n \tprotected void onPreExecute() {\n \t\tsuper.onPreExecute();\r\n \t\tpdia = new ProgressDialog(Regmember.this);\r\n \t\tpdia.setCanceledOnTouchOutside(false);\r\n pdia.setMessage(\"Dhiraj rakh..........\");\r\n pdia.show(); \r\n \t}", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n this.dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n this.dialog.setCancelable(false);\n this.dialog.show();\n }", "@Override\n protected void onPreExecute() {\n pDialog = new ProgressDialog(homeActivity);\n pDialog.setMessage(\"Retrieving Details... \");\n // pDialog.setMax(16);\n pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\n pDialog.setCancelable(false);\n pDialog.show();\n\n\n }", "public void onPreExecute() {\n progressDialog.show();\n }", "@Override\r\n\t protected void onPreExecute() {\n\t super.onPreExecute();\r\n\t progressDialog = new ProgressDialog(UDMap.this);\r\n\t progressDialog.setMessage(\"Loading the best way...\");\r\n\t progressDialog.setIndeterminate(true);\r\n\t progressDialog.show();\r\n\t }", "void showProgressDialog();", "void showProgressDialog();", "public void showProgressDialog() {\n pd = new ProgressDialog(this);\n pd.setMessage(\"Renting film...\");\n pd.show();\n }", "protected void onPreExecute() {\n try {\n this.dialog.setMessage(getContext().getResources().getString(R.string.loading));\n this.dialog.show();\n } catch (Exception ex) {\n Log.e(null, ex);\n }\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog1 = new ProgressDialog(Doctorslist.this);\n\t\t\tpDialog1.setMessage(\"Loading ...\");\n\t\t\tpDialog1.setIndeterminate(false);\n\t\t\tpDialog1.setCancelable(false);\n\t\t\tpDialog1.show();\n\t\t}", "public void showProgressDialog() {\n try {\n if (progressDialog == null) {\n try {\n progressDialog = new ProgressDialog(self);\n progressDialog.show();\n progressDialog.setCancelable(false);\n } catch (Exception e) {\n progressDialog = new ProgressDialog(self.getParent());\n progressDialog.show();\n progressDialog.setCancelable(false);\n e.printStackTrace();\n }\n } else {\n if (!progressDialog.isShowing())\n progressDialog.show();\n }\n } catch (Exception e) {\n progressDialog = new ProgressDialog(self);\n progressDialog.show();\n progressDialog.setCancelable(false);\n e.printStackTrace();\n }\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n loading = ProgressDialog.show(this.context, \"Fetching Data\",\"Please Wait...\",true,true);\n }", "private void showProgressDialog() {\n mProgressDialog = AppDialog.showProgressDialog(this);\n mProgressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n asyncDialog.setMessage(\"Loading...\");\n //show dialog\n asyncDialog.show();\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n progress = new ProgressDialog(hostContext);\n progress.setMessage(\"Wait while books are being downloaded...\");\n progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progress.show();\n }", "public void showProgress2(){\n// if (mHandler==null){\n// mHandler = new Handler(Looper.getMainLooper());\n// }\n new Handler(Looper.getMainLooper()).post(new Runnable() {\n @Override\n public void run() {\n loadingDialog = new Dialog(BaseActivity.this);\n loadingDialog.setTitle(\"Loading data..\");\n loadingDialog.setContentView(R.layout.loading);\n loadingDialog.show();\n\n }\n });\n// mHandler.post(new Runnable() {\n// @Override\n// public void run() {\n// loadingDialog = new Dialog(BaseActivity.this);\n// loadingDialog.setTitle(\"Loading data..\");\n// loadingDialog.setContentView(R.layout.loading);\n// loadingDialog.show();\n//\n// }\n// });\n }", "private void displayProgressDialog() {\n pDialog.setMessage(\"Logging In.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\t// TODO Auto-generated method stub\n\t\t\tsuper.onPreExecute();\n\t\t\tpd = ProgressDialogUtil.createDialogNoTitle(context, \"loading...\");\n\t\t\tpd.show();\n\t\t}", "protected void createProgressDialog() {\r\t\tif (pd == null) {\r\t\t\tpd = new ProgressDialog(this);\r\t\t\tpd.setCanceledOnTouchOutside(false);\r\t\t\tpd.getWindow().setGravity(Gravity.CENTER);\r\t\t\tpd.setOnCancelListener(new DialogInterface.OnCancelListener() {\r\t\t\t\t@Override\r\t\t\t\tpublic void onCancel(DialogInterface dialogInterface) {\r\t\t\t\t\tonPdCancel();\r\t\t\t\t}\r\t\t\t});\r\t\t}\r\t}", "private void showLoadingDialog() {\n mDefaultLoadingDialogFragment = new DefaultLoadingDialogFragment();\n mDefaultLoadingDialogFragment.show(getChildFragmentManager(), \"loadingDialog\");\n }", "@Override\n\t protected void onPreExecute() {\n\t super.onPreExecute();\n\t \n\t progressDialog= new Dialog(ListKotaActivity.this);\n\t progressDialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);\n\t progressDialog.setContentView(R.layout.progress);\n\t progressDialog.setCancelable(false);\n\t progressDialog.show();\t \n\t }", "@Override\n \t\tprotected void onPreExecute() \n \t\t{\n \t\t\t//Create a new progress dialog\n \t\t\tprogressDialog = new ProgressDialog(MainActivity.this);\n \t\t\t//Set the progress dialog to display a horizontal progress bar \n \t\t\tprogressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n \t\t\t//Set the dialog title to 'Loading...'\n \t\t\tprogressDialog.setTitle(\"Loading Game...\");\n \t\t\t//Set the dialog message to 'Loading application View, please wait...'\n \t\t\tprogressDialog.setMessage(\"Please wait...\");\n \t\t\t//This dialog can't be canceled by pressing the back key\n \t\t\tprogressDialog.setCancelable(false);\n \t\t\t//This dialog isn't indeterminate\n \t\t\tprogressDialog.setIndeterminate(false);\n \t\t\t//The maximum number of items is 100\n \t\t\tprogressDialog.setMax(100);\n \t\t\t//Set the current progress to zero\n \t\t\tprogressDialog.setProgress(0);\n \t\t\t//Display the progress dialog\n \t\t\tprogressDialog.show();\n \t\t}", "@Override\n protected void onPreExecute() {\n String msg = \"Please Wait....\";\n cd.showProgressDialog(msg);\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tshowLoadingProgressDialog();\n\t\t}", "@Override\n protected void onPreExecute() {\n showLoadingProgressDialog();\n }", "@Override\n protected void onPreExecute() {\n showLoadingProgressDialog();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n pDialog = new ProgressDialog(Resume_create_employee.this);\n pDialog.setMessage(\"Loading...\");\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(MainActivity.this);\n pDialog.setMessage(\"Processing Request...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\r\n protected void onPreExecute() {\n if( progressDialog == null ) {\r\n progressDialog = ProgressDialog.show( context, context.getString(R.string.pref_sync_callings_now_title),\"\");\r\n }\r\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(DetailActivity.this);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(true);\n pDialog.show();\n }", "@Override\r\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\r\n\t\t\tpDialog = new ProgressDialog(SingleRecord.this);\r\n\t\t\tpDialog.setMessage(\"downloading...\");\r\n\t\t\tpDialog.setIndeterminate(false);\r\n\t\t\tpDialog.setCancelable(true);\r\n\t\t\r\n\t\t\tpDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\r\n\t\t\tpDialog.show();\r\n\t\t\tpDialog.getWindow().setGravity(Gravity.BOTTOM);\r\n\t\t}", "@Override\n protected void onPreExecute() {\n\n this.dialog.setMessage(\"Please wait ...\");\n this.dialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\taProgressDialog = new ProgressDialog(TargetProducts.this);\n\t\t\taProgressDialog.setMessage(\"Loading Report...\");\n\t\t\taProgressDialog.setIndeterminate(true);\n\t\t\taProgressDialog.setCanceledOnTouchOutside(true);\n\t\t\taProgressDialog.show();\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\taProgressDialog = new ProgressDialog(TargetProducts.this);\n\t\t\taProgressDialog.setMessage(\"Loading Report...\");\n\t\t\taProgressDialog.setIndeterminate(true);\n\t\t\taProgressDialog.setCanceledOnTouchOutside(true);\n\t\t\taProgressDialog.show();\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\t\n\t\t\tdialog = new ProgressDialog(BookingConfirmationScreen.this);\n\t\t\tdialog.setIndeterminate(false);\n\t\t\tdialog.setCancelable(true);\n\t\t\tdialog.show();\n\t\t\t\n\t\t\t\n\t\t}", "@Override\n protected void onProgressUpdate(Integer... values) {\n super.onProgressUpdate(values);\n progress = new ProgressDialog(activity);\n progress.setMessage(\"please wait.. \");\n progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progress.setIndeterminate(true);\n progress.setCancelable(false);\n progress.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tpdia = new ProgressDialog(mContext);\n\t\t\tpdia.setMessage(\"Loading Circles...\");\n\t\t\tpdia.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n // // pDialog = new ProgressDialog(getContext());\n pDialog = new ProgressDialog(context);\n pDialog.setMessage(\"Cargando Información\");\n pDialog.setCancelable(true);\n pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n pDialog.show();\n\n }", "public void showCustomLoadingDialog() {\n\n //..show gif\n viewDialog.showDialog();\n final Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n //...here i'm waiting 5 seconds before hiding the custom dialog\n //...you can do whenever you want or whenever your work is done\n viewDialog.hideDialog();\n }\n }, 1000);\n }", "public void showProgressDialog() {\n showProgressDialog(null);\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n // Show the progress in load\n pDialog = new ProgressDialog(UpdateTimeTable.this);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(false);\n pDialog.show();\n \n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n progressDialog = new ProgressDialog(AiutaGliAltri.this);\n progressDialog.setMessage(\"Sto Cercando!\");\n progressDialog.setIndeterminate(true);\n progressDialog.setCanceledOnTouchOutside(false);\n progressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tprogressDialog = new ProgressDialog(ListActivity.this);\n\t\t\tprogressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\n\t\t\tprogressDialog.setMessage(\"Loading Programs. .\");\n\t\t\tprogressDialog.setCancelable(false);\n\n\t\t\tprogressDialog.show();\n\t\t}", "private void showProgress(String message) {\n \tif(mProgress==null){\n \t\tmProgress = new ProgressDialog(stActivity);\n\t mProgress.setMessage(message);\n\t mProgress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\t mProgress.setIndeterminate(true);\n\t mProgress.setCancelable(false); \n\t mProgress.show();\n \t}\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(context);\n pDialog.setMessage(\"Fetching videolists..\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(true);\n pDialog.show();\n }", "@Override\n\tprotected void onPreExecute() {\n\t\tsuper.onPreExecute();\n\n\t\tprogress = ProgressDialog.show(act, \"\", \"Please wait ...\", true);\n\t\talert = new AlertDialog.Builder(act);\n\n\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tdialog = new ProgressDialog(BookingConfirmationScreen.this);\n\t\t\tdialog.setIndeterminate(false);\n\t\t\tdialog.setCancelable(true);\n\t\t\tdialog.show();\n\n\t\t}", "@Override\r\n\t\t protected void onPreExecute() {\n \t\tprogress= ProgressDialog.show(\r\n \t\t\t\tDetailProgramActivity.this, \r\n \t\t\t\t\"\", \r\n \t\t\t\tgetString(R.string.loading_data), \r\n \t\t\t\ttrue);\r\n \t}", "private void showProgressIndication() {\n Log.i(TAG, \"loading contacts... \");\n // TODO: make this be a no-op if the progress indication is\n // already visible with the exact same title and message.\n\n dismissProgressIndication(); // Clean up any prior progress indication\n\n mProgressDialog = new ProgressDialog(this);\n mProgressDialog.setMessage(this.getResources().getString(R.string.contact_list_loading));\t\n mProgressDialog.setIndeterminate(true);\n mProgressDialog.setCancelable(false);\n mProgressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\ttry {\n\t\t\t\tdialog.setIndeterminate(false);\n\t\t\t\tdialog.setMax(100);\n\t\t\t\tdialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n\t\t\t\tdialog.setCancelable(false);\n\t\t\t\tdialog.show();\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "public void initLoadingPage(Context c) {\n\n LayoutInflater inflater = (LayoutInflater) c.getSystemService( c.LAYOUT_INFLATER_SERVICE);\n final AlertDialog.Builder nameBuilder = new AlertDialog.Builder(c);\n View alertDiaView = inflater.inflate(R.layout.activity_loading_page,null);\n nameBuilder.setView(alertDiaView);\n\n avi = (AVLoadingIndicatorView) alertDiaView.findViewById(R.id.avi);\n avi.smoothToShow();\n\n\n int val= (int) (130 * Resources.getSystem().getDisplayMetrics().density);//dp to px\n alertDialog= nameBuilder.show();\n alertDialog.getWindow().setLayout(val ,val);\n\n\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n pDialog = new ProgressDialog(Activity_List.this);\n pDialog.setMessage(\"Loading spots. Please wait...\");\n\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "void dismissProgressLoading() {\n if (progressDialog != null) {\n progressDialog.dismiss();\n }\n }" ]
[ "0.8556975", "0.8352341", "0.8278571", "0.82200515", "0.81206495", "0.81117713", "0.81087923", "0.80747885", "0.80385137", "0.8009662", "0.79978704", "0.79510033", "0.7948115", "0.79299206", "0.79119074", "0.78677505", "0.78505844", "0.7845455", "0.783418", "0.7815574", "0.7798009", "0.77841055", "0.7760531", "0.7760491", "0.77491975", "0.77491885", "0.77381206", "0.7731128", "0.77016157", "0.7696864", "0.76813716", "0.7669966", "0.76690793", "0.76625514", "0.7644284", "0.7636105", "0.76298606", "0.7625296", "0.7624954", "0.7620896", "0.75963306", "0.7593019", "0.7557326", "0.7557191", "0.7552094", "0.7540964", "0.75380236", "0.7530816", "0.75187314", "0.7451498", "0.7442405", "0.744088", "0.74325657", "0.74260175", "0.74260175", "0.74182814", "0.7417898", "0.74154776", "0.74125224", "0.74027455", "0.7388856", "0.7382874", "0.73605436", "0.73600066", "0.7359012", "0.7358709", "0.73522854", "0.7331206", "0.7327646", "0.7317502", "0.7314785", "0.7314203", "0.73096377", "0.73096377", "0.7290608", "0.7290201", "0.72820896", "0.7281728", "0.72797364", "0.727472", "0.72728115", "0.72728115", "0.72708094", "0.7258939", "0.7244289", "0.7231637", "0.7228092", "0.7227812", "0.7206384", "0.72011316", "0.71872085", "0.71697205", "0.7168169", "0.7167897", "0.71674246", "0.7165712", "0.7164942", "0.715898", "0.7155309", "0.7151671", "0.71457183" ]
0.0
-1
Do something when collapsed
@Override public boolean onMenuItemActionCollapse(MenuItem item) { adapter.setFilter(resultAlls); return true; // Return true to collapse action view }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isCollapsed();", "public boolean isCollapsed();", "public void collapse() {\n if(contentLayout.isVisible()) {\n toggle(false);\n }\n }", "abstract void setCollapsed(boolean isCollapsed);", "@JDIAction(\"Collapse '{name}'\")\n public void collapse() {\n if (isExpanded()) {\n expandButton.click();\n }\n }", "public void collapse() {\n if (DEBUG) logf(\"collapse: \" + this);\n if (!isFullyCollapsed()) {\n mTimeAnimator.cancel();\n mClosing = true;\n // collapse() should never be a rubberband, even if an animation is already running\n mRubberbanding = false;\n fling(-mSelfCollapseVelocityPx, /*always=*/ true);\n }\n }", "public void collapse() {\n if (getVisibility() == View.GONE) {\n return;\n }\n mAnimatorCollapse.setDuration(mDuration);\n mAnimatorCollapse.start();\n }", "public void collapse() {\n getSection().setExpanded(false);\n }", "@Override\n\tpublic void onBannerCollapsed(MoPubView arg0) {\n\t\t\n\t}", "public boolean isCollapsed() {\n return !expanded;\n }", "private boolean getCollapse() {\n return false;\n }", "public void toggle() {\n if (isExpanded()) {\n collapse();\n } else {\n expand();\n }\n }", "@Override\n public void onGroupCollapse(int groupPosition) {\n }", "void onGroupCollapsed(int groupPosition);", "public void treeCollapsed(TreeExpansionEvent e) {\n saySomething(\"Tree-collapsed event detected\", e);\n }", "public void collapseNoAnim() {\n if (getVisibility() == View.GONE) {\n return;\n }\n mAnimatorCollapse.setDuration(0);\n mAnimatorCollapse.start();\n }", "public void treeWillCollapse(TreeExpansionEvent e) {\n saySomething(\"Tree-will-collapse event detected\", e);\n }", "@Override\n public void onGroupCollapse(int groupPosition) {\n }", "@Override\n public void onGroupCollapse(int groupPosition) {\n\n }", "@Override\n public void onGroupCollapse(int groupPosition) {\n\n }", "@Override\n public void onGroupCollapse(int groupPosition) {\n\n }", "@Override\n public void onGroupCollapse(int groupPosition) {\n\n }", "@Override\n\t\t\t\tpublic void treeCollapsed(TreeExpansionEvent arg0) {\n\t\t\t\t}", "public void setCollapsed(boolean collapsed) {\n super.setCollapsed(collapsed);\n\n if (_spItem != null) {\n _spItem.getTable().set(GUI_COLLAPSED, collapsed);\n }\n }", "public boolean collapse(final boolean animated);", "@Override\r\n public void onGroupCollapse(int groupPosition) {\n\r\n }", "protected void change() {\r\n\r\n // consume?\r\n if(isLoop()) return;\r\n \r\n // prevent re-entry\r\n setLoop(true);\r\n\r\n // initialize\r\n int dx = 0;\r\n int dy = 0;\r\n\r\n // set flag\r\n boolean isSelected = getToggleButton().isSelected();\r\n\r\n // any change?\r\n if(isExpanded!=isSelected) {\r\n\r\n // set flag\r\n isExpanded = isSelected;\r\n\r\n // translate selection to view\r\n if(isExpanded) {\r\n\r\n \t// get preferred size\r\n \tint max = (preferredExpandedHeight==0 ? (isPreferredSizeSet() ? super.getPreferredSize().height : 0) : preferredExpandedHeight);\r\n\r\n // get height\r\n int h = (isTmpSet(0) ? tmpSize[0].height : max);\r\n\r\n // calculate change\r\n dy = h - minimumCollapsedHeight;\r\n\r\n // apply temporary stored sizes?\r\n if(isTmpSet(1)) super.setMinimumSize(getTmpSize(1));\r\n if(isTmpSet(2)) super.setPreferredSize(getTmpSize(2));\r\n if(isTmpSet(3)) super.setMaximumSize(getTmpSize(3));\r\n\r\n // reset temporary sets\r\n resetTmpSizes();\r\n\r\n }\r\n else {\r\n\r\n // get collapsed height\r\n int h = minimumCollapsedHeight;\r\n\r\n // update temporary sizes\r\n setTmpSize(0,isDisplayable() ? super.getSize() : getPreferredSize(),true);\r\n\r\n // update temporary insets\r\n tmpInsets = super.getInsets();\r\n\r\n // calculate change\r\n dy = h - getTmpSize(0).height;\r\n\r\n // set collapsed size\r\n minimumCollapsedHeight = h;\r\n\r\n // set new insets\r\n if(headerPlacement==SwingUtilities.BOTTOM) {\r\n \tcollapsedInsets = new Insets(0, tmpInsets.left, tmpInsets.bottom, tmpInsets.right);\r\n } else {\r\n \tcollapsedInsets = new Insets(tmpInsets.top, tmpInsets.left, 0, tmpInsets.right);\r\n }\r\n \r\n\r\n }\r\n\r\n // apply change\r\n super.setBorder(createBorder());\r\n\r\n // update tool tip text\r\n getToggleButton().setToolTipText(isExpanded() ? \"Lukk\" : \"┼pne\");\r\n\r\n // notify\r\n fireToggleEvent(dx,dy);\r\n\r\n // notify manager hierarchy\r\n super.requestResize(dx, dy, true);\r\n\r\n }\r\n\r\n // resume\r\n setLoop(false);\r\n\r\n }", "public void toggleNoAnim() {\n if(isExpanded()) {\n collapseNoAnim();\n }\n else {\n expandNoAnim();\n }\n }", "public void collapse() {\n searchView.setQuery(\"\", true);\n if (!searchView.isIconified()) {\n searchView.setIconified(true);\n }\n }", "protected void collapseAll() {\n Activity a = getCurrentActivity();\n if (a instanceof SessionsExpandableListActivity) {\n SessionsExpandableListActivity sela = (SessionsExpandableListActivity) a;\n \n sela.collapseAll();\n Log.i(\"collapseAll()\", \"collapsed!\");\n }\n }", "public void setIsAlwaysCollapsed(final boolean alwaysCollapsed);", "public void expand() {\n if(!contentLayout.isVisible()) {\n toggle(false);\n }\n }", "@JDIAction(\"Expand '{name}'\")\n public void expand() {\n if (isCollapsed()) {\n expandButton.click();\n }\n }", "@Override\n\tpublic PanelCollapse getDefineCollapse() {\n\t\treturn defineCollapse;\n\t}", "void collapse(Segment seg, Animation anim);", "@Override\n public void onHide() {\n// buttom.animate()\n// .translationY(height - buttom.getHeight())\n// .setInterpolator(new AccelerateInterpolator(2))\n// .setDuration(800)\n// .start();\n// top.animate()\n// .translationY(-height)\n// .setDuration(800)\n// .setInterpolator(new AccelerateInterpolator(2))\n// .start();\n mExpandableLinearLayout.collapse();\n }", "@Override\n public void onGroupCollapsed(int groupPosition) {\n\n }", "public boolean getCollapsed() {\n return mCollapsed;\n }", "public void collapseItemClicked(ActionEvent e) {\n String value = e.getActionCommand();\n double level = Double.parseDouble(((String)JOptionPane.showInputDialog(\n frame,\n \"Enter percent threshold to collapse by:\\n\"+\n \"Use 100(%) for completely homogeneous\\n\"+\n \"collapsing\",\n \"Collapse by \"+value,\n JOptionPane.PLAIN_MESSAGE,\n null,\n null,\n \"90\")))/100;\n if(level > 0 && level <= 1)\n {\n frame.collapseByValue(value,level);\n }\n else\n JOptionPane.showMessageDialog(frame,\n \"Invalid threshold percentage.\",\n \"Error\",\n JOptionPane.ERROR_MESSAGE);\n }", "@Test\n public void keepCollapsedOnRotate() {\n rotateDevice(getActivity());\n\n waitForPanelState(BottomSheetBehavior.STATE_COLLAPSED;\n }", "private boolean isCollapsed() {\n\t\treturn mTabSpinner != null && mTabSpinner.getParent() == this;\n\t}", "public interface MyExpandingListener {\n void onExpanded();\n void onCollapsed();\n}", "@Override\n public void onClick(View view) {\n Intent collapseIntent = new Intent(MainActivity.this, CollapseActivity.class);\n startActivity(collapseIntent);\n }", "public void treeWillCollapse(TreeExpansionEvent e) throws ExpandVetoException {\n }", "public Sequence toggleCollapsed() {\n mCollapsed = !mCollapsed;\n return this;\n }", "@Override\n\tpublic PanelCollapse getFunctionCollapse() {\n\t\treturn functionCollapse;\n\t}", "public void onExpandingFinished() {\n super.onExpandingFinished();\n this.mNotificationStackScroller.onExpansionStopped();\n this.mHeadsUpManager.onExpandingFinished();\n this.mIsExpanding = false;\n if (isFullyCollapsed()) {\n DejankUtils.postAfterTraversal(new Runnable() {\n public void run() {\n NotificationPanelViewController.this.setListening(false);\n }\n });\n this.mView.postOnAnimation(new Runnable() {\n public void run() {\n NotificationPanelViewController.this.mView.getParent().invalidateChild(NotificationPanelViewController.this.mView, NotificationPanelViewController.M_DUMMY_DIRTY_RECT);\n }\n });\n } else {\n setListening(true);\n }\n this.mQsExpandImmediate = false;\n this.mNotificationStackScroller.setShouldShowShelfOnly(false);\n this.mTwoFingerQsExpandPossible = false;\n notifyListenersTrackingHeadsUp(null);\n this.mExpandingFromHeadsUp = false;\n setPanelScrimMinFraction(0.0f);\n }", "public static void setCollapsed(View view) {\n view.setVisibility(8);\n }", "public boolean isExpanded();", "public boolean isSectionCollapsed() {\n String clazz = getWrappedElement().getAttribute(\"class\");\n return !clazz.contains(\"active\") & !clazz.contains(\"expanded\");\n }", "private void collapseAll()\r\n\t{\r\n\t\tint count = listAdapter.getGroupCount();\r\n\t\tfor (int i = 0; i < count; i++)\r\n\t\t{\r\n\t\t\tmyList.collapseGroup(i);\r\n\t\t}\r\n\t}", "@Override\n public boolean isExpanded() {\n return isExpanded;\n }", "@Override\n public void onShow() {\n mExpandableLinearLayout.expand();\n }", "public void run() {\n\t\t\t\tviewer.collapseToLevel(root, 2); // TODO: does not, it always collapse to level 1\n//\t\t\t\tshowSelection(par, sel);\n//\t\t\t\tif (actionCollapsAll.isChecked()) {\n//\t\t\t\t\t\n//\t\t\t\t}\n\t\t\t}", "@Override\n public boolean onMenuItemActionCollapse(MenuItem item) {\n return true; // Return true to collapse action view\n }", "@Override\n public boolean onMenuItemActionCollapse(MenuItem item) {\n return true; // Return true to collapse action view\n }", "public void resetCollapseByMenu() {\n //NOTE: can only collapse on OTU metadata\n collapseByMenu.removeAll();\n JMenuItem item = new JMenuItem(\"Uncollapse All\");\n item.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n frame.uncollapseTree();\n }\n });\n collapseByMenu.add(item);\n item = new JMenuItem(\"Collapse All\");\n item.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n frame.collapseTree();\n }\n });\n collapseByMenu.add(item);\n item = new JMenuItem(\"Node Labels\");\n item.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n String value = e.getActionCommand();\n double level = Double.parseDouble(((String)JOptionPane.showInputDialog(\n frame,\n \"Enter percent threshold to collapse by:\\n\"+\n \"Use 100(%) for completely homogeneous\\n\"+\n \"collapsing\",\n \"Collapse by \"+value,\n JOptionPane.PLAIN_MESSAGE,\n null,\n null,\n \"90\")))/100;\n if(level > 0 && level <= 1)\n {\n frame.collapseTreeByNodeLabels(level);\n }\n else\n JOptionPane.showMessageDialog(frame,\n \"Invalid threshold percentage.\",\n \"Error\",\n JOptionPane.ERROR_MESSAGE);\n \n }\n });\n collapseByMenu.add(item);\n item = new JMenuItem(\"Consensus Lineage\");\n item.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n String value = e.getActionCommand();\n double level = Double.parseDouble(((String)JOptionPane.showInputDialog(\n frame,\n \"Enter percent threshold to collapse by:\\n\"+\n \"Use 100(%) for completely homogeneous\\n\"+\n \"collapsing\",\n \"Collapse by \"+value,\n JOptionPane.PLAIN_MESSAGE,\n null,\n null,\n \"90\")))/100;\n if(level > 0 && level <= 1)\n {\n frame.collapseTreeByConsensusLineage(level);\n }\n else\n JOptionPane.showMessageDialog(frame,\n \"Invalid threshold percentage.\",\n \"Error\",\n JOptionPane.ERROR_MESSAGE);\n \n }\n });\n item.setEnabled(false);\n collapseByMenu.add(item);\n collapseByMenu.add(new JSeparator());\n // \n // item = new JMenuItem(\"External Node Labels\");\n // item.addActionListener(new ActionListener() {\n // public void actionPerformed(ActionEvent e) {\n // collapseItemClicked(e);\n // }\n // });\n // collapseByMenu.add(item);\n\n if (frame.frame.otuMetadata != null) { \n ArrayList<String> data = frame.frame.otuMetadata.getColumnNames();\n //start at 1 to skip ID column\n for (int i = 1; i < data.size(); i++) {\n String value = data.get(i);\n item = new JMenuItem(value);\n item.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n collapseItemClicked(e);\n }\n });\n collapseByMenu.add(item);\n }\n }\n }", "public Sequence setCollapsed(boolean collapsed) {\n mCollapsed = collapsed;\n return this;\n }", "@Override\n public boolean onMenuItemActionCollapse(MenuItem item) {\n finish();\n return true; // Return true to collapse action view\n }", "public void collapse(boolean z) {\n if (!this.animating && this.expanded) {\n this.animating = true;\n this.touchDelegateGroup.setEnabled(false);\n toggleOverlay(false, z);\n this.collapseAnimation.setDuration(z ? 0 : (long) this.animationDuration);\n this.collapseAnimation.removeListener(this.collapseListener);\n this.collapseAnimation.addListener(this.collapseListener);\n this.collapseAnimation.start();\n this.expandAnimation.cancel();\n FABsMenuListener fABsMenuListener = this.menuListener;\n if (fABsMenuListener != null) {\n fABsMenuListener.onMenuCollapsed(this);\n }\n }\n }", "public void expandNoAnim() {\n if (getVisibility() == View.VISIBLE) {\n return;\n }\n setVisibility(View.VISIBLE);\n mAnimatorExpand.setDuration(0);\n mAnimatorExpand.start();\n }", "@Override\n\tpublic void onBannerExpanded(MoPubView arg0) {\n\t\t\n\t}", "@Override\n public void onActionViewCollapsed() {\n setQuery(\"\", false);\n super.onActionViewCollapsed();\n }", "public void setDefineCollapse(PanelCollapse defineCollapse) {\n\t\tthis.defineCollapse = defineCollapse;\n\t}", "@Override\n public boolean onMenuItemActionCollapse(MenuItem item) {\n adapter.setFilter(lista1);\n return true; // Return true to collapse action view\n }", "public void expand() {\n getSection().setExpanded(true);\n }", "@Override\n public void onClick(View v) {\n if (((ToggleButton) v).isChecked()) {\n ExpandAnimation animation = new ExpandAnimation(mailbox_setting_detail_layout, 250);\n mailbox_setting_detail_layout.startAnimation(animation);\n } else {\n ExpandAnimation animation = new ExpandAnimation(mailbox_setting_detail_layout, 250);\n mailbox_setting_detail_layout.startAnimation(animation);\n }\n }", "@Override\n public void onAnimationEnd(Animator animator) {\n setVisibility(View.GONE);\n if (mEsListener != null) {\n mEsListener.OnExpansionStateChanged(false);\n }\n }", "public ServiceLevelAction getCollapseAction();", "@Override\n public void onClick(View v) {\n if (((ToggleButton) v).isChecked()) {\n ExpandAnimation animation = new ExpandAnimation(ll_setmail, 250);\n ll_setmail.startAnimation(animation);\n } else {\n ExpandAnimation animation = new ExpandAnimation(ll_setmail, 250);\n ll_setmail.startAnimation(animation);\n }\n }", "private void setExpandableLayoutVisiblity(){\n if(mExpandToggleBtn.isChecked()){\n mExpandableLayout.setVisibility(View.VISIBLE);\n }\n // if expand is set to false, then hide the expandable layout\n else{\n mExpandableLayout.setVisibility(View.GONE);\n }\n }", "@Override\n public void onItemExpandCollapse(View view, int position, int type) {\n final int itemType = expandableListAdapter.getItemViewType(position);\n if (itemType == RoomDetailAdapter.TYPE_EXPANDABLE_BACKAUDIO) {\n initViewBackground(view, type);\n view.findViewById(R.id.rl_close_title).setVisibility(type == ExpandableListAdapter.ExpandCollapseAnimation.COLLAPSE ? View.VISIBLE : View.GONE);\n view.findViewById(R.id.tv_music_name_secondary).setVisibility(type == ExpandableListAdapter.ExpandCollapseAnimation.COLLAPSE ? View.GONE : View.VISIBLE);\n } else if (itemType == RoomDetailAdapter.TYPE_EXPANDABLE_CURTAIN || itemType == RoomDetailAdapter.TYPE_EXPANDABLE_Light) {\n initViewBackground(view, type);\n } else {\n initViewBackground(view, ExpandableListAdapter.ExpandCollapseAnimation.COLLAPSE);\n }\n }", "public void expand() {\n if (getVisibility() == View.VISIBLE) {\n return;\n }\n setVisibility(View.VISIBLE);\n mAnimatorExpand.setDuration(mDuration);\n mAnimatorExpand.start();\n }", "@Override\n\t\t\tpublic void onOff() {\n\t\t\t\t((ExpandableListView) parent).collapseGroup(groupPosition);\n\t\t\t\ttextMode.setText(\"OFF\");\n\t\t\t\tgroupLayLeft.setBackgroundResource(R.drawable.list_item_corner);\n\t\t\t\tgroupLayRight.setBackgroundResource(R.drawable.list_item_corner);\n\t\t\t}", "@Override\n public void toggle(final long duration, @Nullable final TimeInterpolator interpolator) {\n if (closePosition < getCurrentPosition()) {\n collapse(duration, interpolator);\n } else {\n expand(duration, interpolator);\n }\n }", "public void expand() {\n openItems();\n }", "public void toggle()\n\t{\n\t\tsetVisible(!this.isShowing());\n\t}", "@Override\n public boolean onMenuItemActionCollapse(MenuItem item) {\n loadNewBeerData(new ArrayList<BeerDetails>());\n // loading new data\n presenter.getBeers(1);\n searchString = null;\n return true;\n }", "public boolean isExpanded(){\n\t\treturn syncExec(new BoolResult() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic Boolean run() {\n\t\t\t\treturn widget.isExpanded();\n\t\t\t}\n\t\t});\n\t}", "private void collapseExtraViews() {\n mSearchItem.collapseActionView();\n\n // collapse the soft keyboard\n View v = getActivity().getCurrentFocus();\n if (v!=null) {\n InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromWindow(v.getWindowToken(),0);\n }\n }", "void onGroupExpanded(int groupPosition);", "@Test\r\n public void testSetCollapsedChildAtExpanded() {\r\n getView().setShowRoot(true);\r\n TreeItem child = createBranch(\"single-replaced-child\", true);\r\n int index = 3;\r\n setItem(index -1, child);\r\n getSelectionModel().select(index);\r\n TreeItem collapsedChild = createBranch(\"another-single-replaced\");\r\n setItem(index -1, collapsedChild);\r\n assertEquals(index, getSelectedIndex());\r\n assertEquals(collapsedChild, getSelectedItem());\r\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tfinal ProjectionAnnotationModel model = viewwer.getProjectionAnnotationModel();\n\t\t\t\tfinal Iterator<?> iterator = model.getAnnotationIterator();\n\t\t\t\tfinal List<Annotation> toCollapse = new ArrayList<Annotation>();\n\t\t\t\twhile (iterator.hasNext()) {\n\t\t\t\t\tfinal Object next = iterator.next();\n\t\t\t\t\tif (next instanceof ProjectionAnnotation) {\n\t\t\t\t\t\tfinal ProjectionAnnotation pa = (ProjectionAnnotation) next;\n\t\t\t\t\t\tfinal Position position = model.getPosition(pa);\n\t\t\t\t\t\tif (position instanceof TypedFoldedPosition)\n\t\t\t\t\t\t\tif (((TypedFoldedPosition) position).getType().equals(\"__comment\")) {\n\t\t\t\t\t\t\t\tpa.markCollapsed();\n\t\t\t\t\t\t\t\ttoCollapse.add(pa);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmodel.modifyAnnotations(null, null, toCollapse.toArray(new Annotation[0]));\n\t\t\t}", "public boolean isExpanded() {\n return getVisibility() == View.VISIBLE;\n }", "public boolean toggle() {\r\n // forward\r\n getToggleButton().doClick();\r\n // return toggle state\r\n return isExpanded();\r\n }", "public boolean fullyExpandedClearAllVisible() {\n return this.mNotificationStackScroller.isFooterViewNotGone() && this.mNotificationStackScroller.isScrolledToBottom() && !this.mQsExpandImmediate;\n }", "@Override\n public void Toggle() {\n\t \n }", "@Override\n public boolean onMenuItemActionCollapse(MenuItem item) {\n adapter.setFilter(mData);\n return true; // Return true to collapse action view\n }", "private void setHeightInCollapse()\n {\n ViewGroup.LayoutParams icom=incompleteRv.getLayoutParams();\n icom.height=0;\n incompleteRv.setLayoutParams(icom);\n\n ViewGroup.LayoutParams actual=movieRecyclerView.getLayoutParams();\n actual.height = actual.MATCH_PARENT;\n movieRecyclerView.setLayoutParams(actual);\n }", "@Override\n public void onGroupExpand(int groupPosition) {\n }", "private void initCollapsingToolbar() {\n final CollapsingToolbarLayout collapsingToolbar =\n findViewById(R.id.collapsing_toolbar);\n\n// collapsingToolbar.setTitle(pindah.getStringExtra(\"judul\"));\n\n AppBarLayout appBarLayout = findViewById(R.id.appbar);\n appBarLayout.setExpanded(true);\n\n // hiding & showing the title when toolbar expanded & collapsed\n appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {\n boolean isShow = false;\n int scrollRange = -1;\n\n @Override\n public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {\n if (scrollRange == -1) {\n scrollRange = appBarLayout.getTotalScrollRange();\n }\n if (scrollRange + verticalOffset == 0) {\n collapsingToolbar.setTitle(pindah.getStringExtra(\"judul\"));\n isShow = true;\n } else if (isShow) {\n collapsingToolbar.setTitle(\" \");\n isShow = false;\n }\n }\n });\n }", "public void setCollapsedAnswerCount(Integer collapsedAnswerCount) {\n this.collapsedAnswerCount = collapsedAnswerCount;\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif (gridView.getVisibility() == View.VISIBLE) {\n\t\t\t\t\t\n\t\t\t\t\tgridView.setVisibility(View.GONE);\n\t\t\t\t\tdialPad_collapse_iv.setImageResource(R.drawable.ic_action_collapse);\n\t\t\t\t\t\n }else{\n \t\n \t \tgridView.setVisibility(View.VISIBLE);\n \t \tdialPad_collapse_iv.setImageResource(R.drawable.ic_action_expand);\n }\n\t\t\t\t\n\t\t\t}", "@Override\r\n public void onGroupExpand(int groupPosition) {\n }", "public void collapseAll() {\n\t\tint row = 0;\n\t\twhile (row < super.getRowCount()) {\n\t\t\tsuper.collapseRow(row);\n\t\t\trow++;\n\t\t}\n\t}", "void setModalExpansionOn() {\n this.modalExpansion = true;\n }", "@Override\n public void onGroupExpanded(int groupPosition) {\n\n }", "@Override\n public void onGroupExpand(int groupPosition) {\n }", "private void initCollapsingToolbar() {\n final CollapsingToolbarLayout collapsingToolbar =\n (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);\n collapsingToolbar.setTitle(\" \");\n AppBarLayout appBarLayout = (AppBarLayout) findViewById(R.id.appbar);\n appBarLayout.setExpanded(true);\n\n // hiding & showing the title when toolbar expanded & collapsed\n appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {\n boolean isShow = false;\n int scrollRange = -1;\n\n @Override\n public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {\n if (scrollRange == -1) {\n scrollRange = appBarLayout.getTotalScrollRange();\n }\n if (scrollRange + verticalOffset == 0) {\n collapsingToolbar.setTitle(getString(R.string.app_name));\n isShow = true;\n } else if (isShow) {\n collapsingToolbar.setTitle(\" \");\n isShow = false;\n }\n }\n });\n }", "private void initCollapsingToolbar() {\n final CollapsingToolbarLayout collapsingToolbar =\n (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);\n collapsingToolbar.setTitle(\" \");\n AppBarLayout appBarLayout = (AppBarLayout) findViewById(R.id.appbar);\n appBarLayout.setExpanded(true);\n\n // hiding & showing the title when toolbar expanded & collapsed\n appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {\n boolean isShow = false;\n int scrollRange = -1;\n\n @Override\n public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {\n if (scrollRange == -1) {\n scrollRange = appBarLayout.getTotalScrollRange();\n }\n if (scrollRange + verticalOffset == 0) {\n collapsingToolbar.setTitle(getString(R.string.app_name));\n isShow = true;\n } else if (isShow) {\n collapsingToolbar.setTitle(\" \");\n isShow = false;\n }\n }\n });\n }", "private void initCollapsingToolbar() {\n final CollapsingToolbarLayout collapsingToolbar =\n (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);\n collapsingToolbar.setTitle(\" \");\n AppBarLayout appBarLayout = (AppBarLayout) findViewById(R.id.appbar);\n appBarLayout.setExpanded(true);\n\n // hiding & showing the title when toolbar expanded & collapsed\n appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {\n boolean isShow = false;\n int scrollRange = -1;\n\n @Override\n public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {\n if (scrollRange == -1) {\n scrollRange = appBarLayout.getTotalScrollRange();\n }\n if (scrollRange + verticalOffset == 0) {\n collapsingToolbar.setTitle(getString(R.string.app_name));\n isShow = true;\n } else if (isShow) {\n collapsingToolbar.setTitle(\" \");\n isShow = false;\n }\n }\n });\n }" ]
[ "0.7407031", "0.73513275", "0.7154493", "0.70649666", "0.7028113", "0.6943541", "0.69423556", "0.68898535", "0.68674463", "0.6793058", "0.67643225", "0.67340475", "0.6631765", "0.65772974", "0.65293956", "0.6516395", "0.6513237", "0.6496207", "0.64900905", "0.64900905", "0.64900905", "0.64875835", "0.64666426", "0.64442664", "0.64124215", "0.6397382", "0.6380524", "0.6359762", "0.6318807", "0.62312543", "0.6179497", "0.61742264", "0.61398613", "0.61248946", "0.61016154", "0.6089487", "0.6069403", "0.60542285", "0.6054114", "0.60465366", "0.60452735", "0.59537387", "0.5946266", "0.5923546", "0.5906334", "0.5861938", "0.58481497", "0.5840355", "0.58348423", "0.58254564", "0.57609534", "0.5719904", "0.5716054", "0.5712978", "0.57054436", "0.57054436", "0.5690682", "0.5647716", "0.56349415", "0.5608743", "0.56082493", "0.56071395", "0.5602271", "0.5601362", "0.55993783", "0.5592935", "0.559269", "0.5589069", "0.557563", "0.5565868", "0.55293757", "0.5510697", "0.5471884", "0.5470078", "0.5469852", "0.5469699", "0.5445251", "0.54374146", "0.54331076", "0.5424414", "0.5424413", "0.54144824", "0.5409064", "0.538874", "0.5371439", "0.5362883", "0.5358824", "0.53543764", "0.53401583", "0.5331279", "0.5330186", "0.5325877", "0.532321", "0.5320153", "0.53136575", "0.5303295", "0.53003246", "0.52986443", "0.52978855", "0.52978855", "0.52978855" ]
0.0
-1
Do something when expanded
@Override public boolean onMenuItemActionExpand(MenuItem item) { return true; // Return true to expand action view }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void expand() {\n openItems();\n }", "@JDIAction(\"Expand '{name}'\")\n public void expand() {\n if (isCollapsed()) {\n expandButton.click();\n }\n }", "public boolean isExpanded();", "public boolean isExpand(){\n return this == EXPAND;\n }", "@Override\n public boolean isExpanded() {\n return isExpanded;\n }", "public void expand() {\n getSection().setExpanded(true);\n }", "int expand();", "private void expand( Change change ) {\n if ( getPlan().isDevelopment() && change.isForInstanceOf( ModelObject.class )\n && getCommander().isLockable( change.getClassName() ) ) {\n getCommander().requestLockOn( change.getId() );\n }\n if ( change.isForInstanceOf( ModelEntity.class ) ) {\n // ModelObject entity = (ModelObject) identifiable;\n ModelObject previous = findExpandedEntity();\n if ( previous != null ) {\n /*String previousAspect = getAspectShown( previous );\n viewAspect( entity, previousAspect );*/\n collapse( new Change( Change.Type.None, previous ) );\n }\n }\n expansions.add( change.getId() );\n }", "private void expandTree() {\n tree.expand();\n }", "public void setExpanded(boolean expanded){\n\t\tthis.expanded = expanded;\n\t}", "public void setExpanded(String expanded)\r\n {\r\n this.expanded = expanded;\r\n }", "public void expand() {\n if(!contentLayout.isVisible()) {\n toggle(false);\n }\n }", "public void expand(){\n\t\texpanded = true;\n\t\tstartRow = 0;\n\t\tslider.setLimits(0, 0, optGroup.size() - maxRows);\n\t\ttakeFocus();\n\t}", "@Override\n public boolean onMenuItemActionExpand(MenuItem item) {\n return true;\n }", "public boolean isExpanded(){\n\t\treturn expanded;\n\t}", "@Override\n public void setExpanded(final boolean expanded) {\n final int currentPosition = getCurrentPosition();\n if ((expanded && (currentPosition == layoutSize))\n || (!expanded && currentPosition == closePosition)) {\n return;\n }\n\n isExpanded = expanded;\n move(expanded ? layoutSize : closePosition, 0);\n }", "public void treeExpanded(TreeExpansionEvent e) {\n saySomething(\"Tree-expanded event detected\", e);\n }", "@Override\n\t\t\tpublic void expansionStateChanged(ExpansionEvent arg0) {\n\n\t\t\t}", "public void expand() {\n if (getVisibility() == View.VISIBLE) {\n return;\n }\n setVisibility(View.VISIBLE);\n mAnimatorExpand.setDuration(mDuration);\n mAnimatorExpand.start();\n }", "public boolean isExpandable();", "private void updateActionText() {\n getTemplatePresentation().setText(myIsExpanded ? myToCollapseText : myToExpandText);\n }", "public boolean isExpanded() {\n return expanded;\n }", "@Override\r\n public void onGroupExpand(int groupPosition) {\n }", "public void expand() {\n\t\tconvertHeadToTailComponent();\n\t\taddNewHead();\n\t}", "@Override\n\t\t\t\tpublic void treeCollapsed(TreeExpansionEvent arg0) {\n\t\t\t\t}", "@JDIAction(\"Collapse '{name}'\")\n public void collapse() {\n if (isExpanded()) {\n expandButton.click();\n }\n }", "@Override\n public void onGroupExpand(int groupPosition) {\n }", "@Override\n public boolean onMenuItemActionExpand(MenuItem item) {\n return true; // Return true to expand action view\n }", "@Override\n public boolean onMenuItemActionExpand(MenuItem item) {\n return true; // Return true to expand action view\n }", "void setExpanded(boolean expanded)\n {\n this.expanded = expanded;\n\n invalidate();\n }", "public boolean isExpanded(){\n\t\treturn syncExec(new BoolResult() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic Boolean run() {\n\t\t\t\treturn widget.isExpanded();\n\t\t\t}\n\t\t});\n\t}", "@Override\n public boolean onMenuItemActionExpand(MenuItem item) {\n return true; // Return true to expand action view\n }", "@Override\n public boolean onMenuItemActionExpand(MenuItem item) {\n return true; // Return true to expand action view\n }", "@Override\n public boolean onMenuItemActionExpand(MenuItem item) {\n return true; // Return true to expand action view\n }", "public void expandDescription(final View v){\n if(!descriptionExpanded) {\n //Set line number to unlimited\n mDescription.setMaxLines(Integer.MAX_VALUE);\n\n //Animate expansion\n mAdditionalDetailsLayout.setVisibility(View.VISIBLE);\n\n mFAB.setImageDrawable(getResources().getDrawable(R.drawable.ic_minimize_white));\n descriptionExpanded = true;\n }else{\n //Set line limit\n mDescription.setMaxLines(getApplicationContext().getResources().getInteger(R.integer.lines));\n\n mFAB.setImageDrawable(getResources().getDrawable(R.drawable.ic_add_white));\n\n\n //Animate collapse\n mAdditionalDetailsLayout.setVisibility(View.GONE);\n\n descriptionExpanded = false;\n }\n }", "public boolean isExpanded() {\n return this.isExpanded;\n }", "@Override\n public void onGroupExpand(int groupPosition) {\n }", "@Override\n public void onGroupExpand(int groupPosition) {\n }", "@Override\n public void onGroupExpand(int groupPosition) {\n }", "protected void change() {\r\n\r\n // consume?\r\n if(isLoop()) return;\r\n \r\n // prevent re-entry\r\n setLoop(true);\r\n\r\n // initialize\r\n int dx = 0;\r\n int dy = 0;\r\n\r\n // set flag\r\n boolean isSelected = getToggleButton().isSelected();\r\n\r\n // any change?\r\n if(isExpanded!=isSelected) {\r\n\r\n // set flag\r\n isExpanded = isSelected;\r\n\r\n // translate selection to view\r\n if(isExpanded) {\r\n\r\n \t// get preferred size\r\n \tint max = (preferredExpandedHeight==0 ? (isPreferredSizeSet() ? super.getPreferredSize().height : 0) : preferredExpandedHeight);\r\n\r\n // get height\r\n int h = (isTmpSet(0) ? tmpSize[0].height : max);\r\n\r\n // calculate change\r\n dy = h - minimumCollapsedHeight;\r\n\r\n // apply temporary stored sizes?\r\n if(isTmpSet(1)) super.setMinimumSize(getTmpSize(1));\r\n if(isTmpSet(2)) super.setPreferredSize(getTmpSize(2));\r\n if(isTmpSet(3)) super.setMaximumSize(getTmpSize(3));\r\n\r\n // reset temporary sets\r\n resetTmpSizes();\r\n\r\n }\r\n else {\r\n\r\n // get collapsed height\r\n int h = minimumCollapsedHeight;\r\n\r\n // update temporary sizes\r\n setTmpSize(0,isDisplayable() ? super.getSize() : getPreferredSize(),true);\r\n\r\n // update temporary insets\r\n tmpInsets = super.getInsets();\r\n\r\n // calculate change\r\n dy = h - getTmpSize(0).height;\r\n\r\n // set collapsed size\r\n minimumCollapsedHeight = h;\r\n\r\n // set new insets\r\n if(headerPlacement==SwingUtilities.BOTTOM) {\r\n \tcollapsedInsets = new Insets(0, tmpInsets.left, tmpInsets.bottom, tmpInsets.right);\r\n } else {\r\n \tcollapsedInsets = new Insets(tmpInsets.top, tmpInsets.left, 0, tmpInsets.right);\r\n }\r\n \r\n\r\n }\r\n\r\n // apply change\r\n super.setBorder(createBorder());\r\n\r\n // update tool tip text\r\n getToggleButton().setToolTipText(isExpanded() ? \"Lukk\" : \"┼pne\");\r\n\r\n // notify\r\n fireToggleEvent(dx,dy);\r\n\r\n // notify manager hierarchy\r\n super.requestResize(dx, dy, true);\r\n\r\n }\r\n\r\n // resume\r\n setLoop(false);\r\n\r\n }", "@Override\n public void onShow() {\n mExpandableLinearLayout.expand();\n }", "public void treeWillExpand(TreeExpansionEvent e) throws ExpandVetoException {\n TreePath path = e.getPath();\n if (!tree.hasBeenExpanded(path)) {\n DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();\n if (sheet.isMBeanNode(node) && !tree.hasMetadataNodes(node)) {\n tree.addMetadataNodes(node);\n }\n }\n }", "@Override\n public void onGroupExpand(int groupPosition) {\n\n }", "public void toggle() {\n if (isExpanded()) {\n collapse();\n } else {\n expand();\n }\n }", "@Override\n\t\t\tpublic void expansionStateChanging(ExpansionEvent arg0) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void expansionStateChanging(ExpansionEvent arg0) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void expansionStateChanging(ExpansionEvent arg0) {\n\n\t\t\t}", "public void expand() {\n\t\tSpaceship sp = getTheSpaceship();\n\t\tsp.expandDoor();\n\t}", "@Override\n\tpublic void insertExpand(Expand expand) {\n\t\texpandMapper.insertExpand(expand);\n\t}", "@Override\n public void setExpanded(boolean isExpanded) {\n mIsExpanded = isExpanded;\n }", "public void treeWillCollapse(TreeExpansionEvent e) {\n saySomething(\"Tree-will-collapse event detected\", e);\n }", "public void expandCallTemplates(String header){\r\n\t\tString xpath = \"(//span[contains(text(),'\"+header+\"')]/../..)//div[contains(@class,'x-tool-plus')]\";\r\n\t\tif(McsElement.isElementDisplayed(driver,xpath)){\r\n\t\t\twaitForExtJSAjaxComplete(20);\r\n\t\t\tdriver.findElement(By.xpath(xpath)).click();\r\n\t\t\tReporter.log(\"Call Templates are expanded\",true);\r\n\t\t}\r\n\t\telse\r\n\t\t\tReporter.log(\"Call Template is already expanded\",true);\r\n\r\n\t}", "public boolean shouldExpandWhenNotFlinging() {\n boolean z = true;\n if (super.shouldExpandWhenNotFlinging()) {\n return true;\n }\n if (!this.mAllowExpandForSmallExpansion) {\n return false;\n }\n if (SystemClock.uptimeMillis() - this.mDownTime > 300) {\n z = false;\n }\n return z;\n }", "public void onExpandingStarted() {\n super.onExpandingStarted();\n this.mNotificationStackScroller.onExpansionStarted();\n this.mIsExpanding = true;\n this.mQsExpandedWhenExpandingStarted = this.mQsFullyExpanded;\n if (this.mQsExpanded) {\n onQsExpansionStarted();\n }\n C0940QS qs = this.mQs;\n if (qs != null) {\n qs.setHeaderListening(true);\n }\n }", "@Override\n\tpublic void onBannerExpanded(MoPubView arg0) {\n\t\t\n\t}", "void expandChilds() {\n\t\t\tenumAndExpand(this.parentItem);\n\t\t}", "public boolean isExpandable() {\n return term.isExpandable();\n }", "public void updateExpandButton() {\n // Remove features that can no longer be collapsed\n featureDiagramView.checkCollapseValidity();\n menu.enableAction(featureDiagramView.hasCollapsedElements(true), ACTION_EXPAND_FEATURES);\n }", "public interface MyExpandingListener {\n void onExpanded();\n void onCollapsed();\n}", "private void performDirectEdit() {\n\t}", "boolean isFeedExpanded();", "static public void doExpandall ( RunData data)\n\t{\n\t\t// get the state object\n\t\tSessionState state = ((JetspeedRunData)data).getPortletSessionState (((JetspeedRunData)data).getJs_peid ());\n\n\t\t//get the ParameterParser from RunData\n\t\tParameterParser params = data.getParameters ();\n\n\t\t// save the current selections\n\t\tSet selectedSet = new TreeSet();\n\t\tString[] selectedItems = params.getStrings(\"selectedMembers\");\n\t\tif(selectedItems != null)\n\t\t{\n\t\t\tselectedSet.addAll(Arrays.asList(selectedItems));\n\t\t}\n\t\tstate.setAttribute(STATE_LIST_SELECTIONS, selectedSet);\n\n\t\t// expansion actually occurs in getBrowseItems method.\n\t\tstate.setAttribute(STATE_EXPAND_ALL_FLAG, Boolean.TRUE.toString());\n\t\tstate.setAttribute(STATE_NEED_TO_EXPAND_ALL, Boolean.TRUE.toString());\n\n\t}", "@Override\n\t\t\tpublic void treeExpanded(TreeExpansionEvent event) {\n\t\t\t\t// fireTableDataChanged();\n\t\t\t}", "public void onExpandingFinished() {\n super.onExpandingFinished();\n this.mNotificationStackScroller.onExpansionStopped();\n this.mHeadsUpManager.onExpandingFinished();\n this.mIsExpanding = false;\n if (isFullyCollapsed()) {\n DejankUtils.postAfterTraversal(new Runnable() {\n public void run() {\n NotificationPanelViewController.this.setListening(false);\n }\n });\n this.mView.postOnAnimation(new Runnable() {\n public void run() {\n NotificationPanelViewController.this.mView.getParent().invalidateChild(NotificationPanelViewController.this.mView, NotificationPanelViewController.M_DUMMY_DIRTY_RECT);\n }\n });\n } else {\n setListening(true);\n }\n this.mQsExpandImmediate = false;\n this.mNotificationStackScroller.setShouldShowShelfOnly(false);\n this.mTwoFingerQsExpandPossible = false;\n notifyListenersTrackingHeadsUp(null);\n this.mExpandingFromHeadsUp = false;\n setPanelScrimMinFraction(0.0f);\n }", "@Override\n public void onGroupExpanded(int groupPosition) {\n\n }", "protected void expandAll() {\n Activity a = getCurrentActivity();\n if (a instanceof SessionsExpandableListActivity) {\n SessionsExpandableListActivity sela = (SessionsExpandableListActivity) a;\n \n sela.expandAll();\n Log.i(\"expandAll()\", \"expanded!\");\n }\n \n \n // View view = mTabHost.getCurrentTabView();\n // Log.i(\"INFO: \", view.getClass().getName());\n \n \n }", "public void treeWillExpand(TreeExpansionEvent e)\n throws ExpandVetoException {\n saySomething(\"Tree-will-expand event detected\", e);\n int n = JOptionPane.showOptionDialog(this, willExpandText,\n willExpandTitle, JOptionPane.YES_NO_OPTION,\n JOptionPane.QUESTION_MESSAGE, null, willExpandOptions,\n willExpandOptions[1]);\n if (n == 0) {\n //User said cancel expansion.\n saySomething(\"Tree expansion cancelled\", e);\n throw new ExpandVetoException(e);\n }\n }", "public void expandTaskView(Object object) {\n\n if (object instanceof Task) {\n Task task = (Task) object;\n Intent intent = new Intent(getActivity(), expand_task.class);\n intent.putExtra(\"taskName\", task.getName());\n startActivity(intent);\n }\n }", "public String expand(String param);", "public void expand(boolean inclChildren) {\n isExtended = true;\n if (inclChildren)\n for (BudgetAccountTableRow child : children)\n child.reduce(true);\n updateUItoExtState();\n }", "public static void expandEntry( final SWTWorkbenchBot bot, final SWTBotTreeItem entry, final String nextName )\n {\n UIThreadRunnable.asyncExec( bot.getDisplay(), new VoidResult()\n {\n public void run()\n {\n entry.expand();\n }\n } );\n\n bot.waitUntil( new DefaultCondition()\n {\n public boolean test() throws Exception\n {\n if ( nextName != null )\n {\n String adjustedNodeName = nextName != null ? adjustNodeName( entry, nextName ) : null;\n SWTBotTreeItem node = entry.getNode( adjustedNodeName );\n if ( node == null )\n {\n return false;\n }\n }\n return !entry.getNodes().contains( \"Fetching Entries...\" );\n }\n\n\n public String getFailureMessage()\n {\n return \"Could not find entry \" + entry.getText() + \" -> \" + nextName;\n }\n } );\n }", "public void expandNoAnim() {\n if (getVisibility() == View.VISIBLE) {\n return;\n }\n setVisibility(View.VISIBLE);\n mAnimatorExpand.setDuration(0);\n mAnimatorExpand.start();\n }", "public void treeWillCollapse(TreeExpansionEvent e) throws ExpandVetoException {\n }", "public void expandAll() {\n\t\tint row = 0;\n\t\twhile (row < super.getRowCount()) {\n\t\t\tsuper.expandRow(row);\n\t\t\trow++;\n\t\t}\n\t}", "@Test\n public void testExpandTree() {\n // TODO: test ExpandTree\n }", "protected void expand() {\n matrix = matrix.power(e);\n }", "public void treeCollapsed(TreeExpansionEvent e) {\n saySomething(\"Tree-collapsed event detected\", e);\n }", "void onGroupExpanded(int groupPosition);", "public void doSomething(){\n\t\t// now in here calling doMore();\n\t\tdoMore();\n\t\tSystem.out.println(\"-----------\");\n\t\t\n\t\t\t\n\t\t}", "private void expandAll()\r\n\t{\r\n\t\tint count = listAdapter.getGroupCount();\r\n\t\tfor (int i = 0; i < count; i++)\r\n\t\t{\r\n\t\t\tmyList.expandGroup(i);\r\n\t\t}\r\n\t}", "public static void logSelectionExpanded(boolean fromTapGesture) {\n RecordHistogram.recordBooleanHistogram(\n \"Search.ContextualSearch.SelectionExpanded\", fromTapGesture);\n }", "protected String expand(String str, Object action, boolean encode) {\n if (action != null) {\n return expressionEvaluator.expand(str, action, encode);\n }\n\n return str;\n }", "@Override\n\tpublic void queuingFunc(TreeNode[] expandedNodes) {\n\n\t}", "private void expandTree() {\n for (int i=0; i<tree.getRowCount(); i++) {\n tree.expandRow(i);\n }\n }", "public abstract boolean setNodeExpanded(int nodeIndex,boolean true_is_yes);", "public void expandedItem(int index) {\n if (index < 0 || index >= getChildCount() || hasItemExpanded()) {\n return;\n }\n final View releasedChild = getChildAt(index);\n final LayoutParams lp = (LayoutParams) releasedChild.getLayoutParams();\n lp.isOpen = true;\n mDragHelper.smoothSlideViewTo(releasedChild, releasedChild.getLeft(), lp.expandTop);\n int length = getChildCount();\n for (int i = 0; i < length; i++) {\n if (i != index) {\n View child = getChildAt(i);\n playShrinkItemAnimation(child);\n }\n }\n invalidate();\n }", "public void run() {\n\t\t\t\tviewer.collapseToLevel(root, 2); // TODO: does not, it always collapse to level 1\n//\t\t\t\tshowSelection(par, sel);\n//\t\t\t\tif (actionCollapsAll.isChecked()) {\n//\t\t\t\t\t\n//\t\t\t\t}\n\t\t\t}", "public void expandOtherAmenities(boolean expanded, boolean fromUser) {\n this.categorizedAmenitiesSeeMoreModel.expanded(expanded);\n updateOtherAmenitiesModels();\n ExploreHomesFiltersFragment.this.amenitiesExpanded = expanded;\n if (fromUser) {\n if (!this.categorizedAmenitiesSeeMoreModel.expanded()) {\n scrollToHeaderWithExtraPadding(this.categorizedAmenitiesHeaderModel);\n }\n ExploreHomesFiltersFragment.this.exploreJitneyLogger.filtersPaneClickSeeAllAmenities(C2141FilterSection.Amenities, this.categorizedAmenitiesSeeMoreModel.expanded());\n }\n }", "@Override\n public void onExpandingClick(View v) {\n View view = v.findViewById(R.id.image);\n Travel travel = generateTravelList().get(viewPager.getCurrentItem());\n startInfoActivity(view,travel);\n }", "public boolean isExpanded() {\n return getVisibility() == View.VISIBLE;\n }", "@Override\n public boolean onMenuItemActionExpand(MenuItem item) {\n reloadMenuItem.setVisible(false);\n listToggleMenuItem.setVisible(false);\n mIsSearchMode = true;\n return true;\n }", "public void setIsAlwaysExpanded(final boolean alwaysExpanded);", "public void setExpandPalette(boolean expandPalette) {\n/* 130 */ this.expandPalette = expandPalette;\n/* */ }", "public void step(Node<T, V> nodeToExpand) {\r\n\t\tlogger.debug(\"Step starts. Size of OPEN now {}\", open.size());\r\n\t\tif (Thread.interrupted()) {\r\n\t\t\tlogger.debug(\"Received interrupt signal before step.\");\r\n\t\t\tinterrupted = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tlastExpansion.clear();\r\n\t\tassert nodeToExpand == null || !expanded.contains(nodeToExpand.getPoint()) : \"Node selected for expansion already has been expanded: \" + nodeToExpand;\r\n\t\topen.remove(nodeToExpand);\r\n\t\tassert !open.contains(nodeToExpand) : \"The selected node \" + nodeToExpand + \" was not really removed from OPEN!\";\r\n\t\tlogger.debug(\"Removed {} from OPEN for expansion. OPEN size now {}\", nodeToExpand, open.size());\r\n\t\tassert ext2int.containsKey(nodeToExpand.getPoint()) : \"Trying to expand a node whose point is not available in the ext2int map\";\r\n\t\tbeforeExpansion(nodeToExpand);\r\n\t\texpandNode(nodeToExpand);\r\n\t\tafterExpansion(nodeToExpand);\r\n\t\tif (Thread.interrupted()) {\r\n\t\t\tlogger.debug(\"Received interrupt signal during step.\");\r\n\t\t\tinterrupted = true;\r\n\t\t}\r\n\t\tlogger.debug(\"Step ends. Size of OPEN now {}\", open.size());\r\n\t}", "public void setQsExpansion(float f) {\n float min = Math.min(Math.max(f, (float) this.mQsMinExpansionHeight), (float) this.mQsMaxExpansionHeight);\n int i = this.mQsMaxExpansionHeight;\n this.mQsFullyExpanded = min == ((float) i) && i != 0;\n if (min > ((float) this.mQsMinExpansionHeight) && !this.mQsExpanded && !this.mStackScrollerOverscrolling && !this.mDozing) {\n setQsExpanded(true);\n } else if (min <= ((float) this.mQsMinExpansionHeight) && this.mQsExpanded) {\n setQsExpanded(false);\n }\n this.mQsExpansionHeight = min;\n updateQsExpansion();\n requestScrollerTopPaddingUpdate(false);\n updateHeaderKeyguardAlpha();\n int i2 = this.mBarState;\n if (i2 == 2 || i2 == 1) {\n updateKeyguardBottomAreaAlpha();\n updateBigClockAlpha();\n }\n if (this.mBarState == 0 && this.mQsExpanded && !this.mStackScrollerOverscrolling && this.mQsScrimEnabled) {\n this.mQsNavbarScrim.setAlpha(getQsExpansionFraction());\n }\n if (this.mAccessibilityManager.isEnabled()) {\n this.mView.setAccessibilityPaneTitle(determineAccessibilityPaneTitle());\n }\n if (!this.mFalsingManager.isUnlockingDisabled() && this.mQsFullyExpanded && this.mFalsingManager.shouldEnforceBouncer()) {\n this.mStatusBar.executeRunnableDismissingKeyguard(null, null, false, true, false);\n }\n for (int i3 = 0; i3 < this.mExpansionListeners.size(); i3++) {\n PanelExpansionListener panelExpansionListener = (PanelExpansionListener) this.mExpansionListeners.get(i3);\n int i4 = this.mQsMaxExpansionHeight;\n panelExpansionListener.onQsExpansionChanged(i4 != 0 ? this.mQsExpansionHeight / ((float) i4) : 0.0f);\n }\n }", "private void edit() {\n\n\t}", "public /* synthetic */ void m125708d(View view) {\n if (mo69219k() != null) {\n for (TabContract.AbstractC25311a aVar : mo69219k()) {\n aVar.aE_();\n }\n }\n this.f88311i.setExpanded(true);\n }", "private void a(ExpandableListView paramExpandableListView, int paramInt) {\n }", "public void expandFacilitiesAmenities(boolean expanded, boolean fromUser) {\n this.categorizedFacilitiesAmenitiesSeeMoreModel.expanded(expanded);\n updateFacilitiesAmenitiesModels();\n ExploreHomesFiltersFragment.this.facilitiesExpanded = expanded;\n if (fromUser) {\n if (!this.categorizedFacilitiesAmenitiesSeeMoreModel.expanded()) {\n scrollToHeaderWithExtraPadding(this.categorizedFacilitiesAmenitiesHeaderModel);\n }\n ExploreHomesFiltersFragment.this.exploreJitneyLogger.filtersPaneClickSeeAllAmenities(C2141FilterSection.Facilities, this.categorizedFacilitiesAmenitiesSeeMoreModel.expanded());\n }\n }", "public abstract List<Node> expand();" ]
[ "0.71771663", "0.70189625", "0.6719292", "0.66357934", "0.65212643", "0.650959", "0.6505571", "0.6486085", "0.6410624", "0.6404927", "0.63578546", "0.6167241", "0.6154914", "0.6132328", "0.61117554", "0.60912764", "0.6089671", "0.6077273", "0.5989702", "0.59834945", "0.5967345", "0.5949439", "0.5942654", "0.59420574", "0.59411967", "0.5928649", "0.59167033", "0.5909678", "0.5909678", "0.58978796", "0.5883007", "0.58747965", "0.58747965", "0.58747965", "0.5862683", "0.58475864", "0.58404154", "0.58404154", "0.58390623", "0.58336866", "0.5809553", "0.58055437", "0.57949615", "0.579197", "0.5790711", "0.5790711", "0.5790711", "0.5777317", "0.574399", "0.5740713", "0.57353365", "0.5729135", "0.5677924", "0.5669862", "0.5659305", "0.56254286", "0.55826974", "0.55723464", "0.5561669", "0.5557548", "0.5551047", "0.55412495", "0.5527035", "0.5509072", "0.55021775", "0.54907346", "0.54813194", "0.54739374", "0.5470322", "0.5425622", "0.5421667", "0.53984314", "0.5392711", "0.5365058", "0.5359044", "0.535799", "0.5348505", "0.5340719", "0.53256184", "0.53185225", "0.5316953", "0.5309875", "0.5308335", "0.52886975", "0.5280487", "0.5273777", "0.52710825", "0.52480453", "0.5246716", "0.52345484", "0.52159864", "0.5215911", "0.51978534", "0.51850927", "0.5174199", "0.51621985", "0.51462376", "0.5144323", "0.51196474", "0.5119645" ]
0.5852184
35
kodeMK = txt_kodeMK.getSelectedItem().toString(); kelas = txt_kelas.getSelectedItem().toString(); Toast.makeText(ListPonpesActivity.this,"Cari Semuanya ",Toast.LENGTH_SHORT).show();
@Override public void onClick(DialogInterface dialog, int which) { getCariSemua(); // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position,\n long id) {\n nama_dokter2 = parent.getItemAtPosition(position).toString();\n\n // Showing selected spinner item\n Toast.makeText(parent.getContext(), \"You selected: \" + nama_dokter2,\n Toast.LENGTH_LONG).show();\n\n }", "public void tampilharga(){\n try{\n Statement statement = (Statement)conek.GetConnection().createStatement();\n ResultSet res = statement.executeQuery(\"select * from tblaktivitas where compart='\"+ txtcompart.getSelectedItem() +\"' AND nama_grup= '\"+txtgrup.getSelectedItem()+\"'\"); \n \n while(res.next()){\n String price = res.getString(\"harga\");\n String aktivitas = res.getString(\"pekerjaan\");\n String hektar = res.getString(\"ha\");\n txtharga.setText(price);\n txtaktivitas.setText(aktivitas); \n txtha.setText(hektar);\n }\n res.close();\n }catch (Exception e){\n System.out.println(e.getMessage());\n }\n jmlharga = Integer.valueOf(txtharga.getText());\n jmlha = Integer.valueOf(txtha.getText());\n }", "public void tampilcompart(){\n txtcompart.removeAllItems();\n try{\n java.sql.Statement statement = (java.sql.Statement)conek.GetConnection().createStatement();\n ResultSet res = statement.executeQuery(\"select * from tblaktivitas where nama_grup='\"+txtgrup.getSelectedItem()+\"'\");\n \n while(res.next()){\n String lokasi = res.getString(\"compart\"); \n txtcompart.addItem(lokasi);\n \n }\n res.last();\n }catch (Exception e){\n } \n jmlha = Integer.valueOf(txtha.getText()); \n }", "@Override\n public void onClick(View arg0) {\n\n Cursor c = db.rawQuery(\"select * from ureq where email= '\"+uid.getText()+\"' and bank='\"+sp.getSelectedItem()+\"' \", null);\n if(c.getCount()==0)\n {\n Toast.makeText(getApplicationContext(), \"No Records Found!\", Toast.LENGTH_SHORT).show();\n return;\n }\n while(c.moveToNext())\n {\n acno.setText(c.getString(2));\n bal.setText(c.getString(3));\n }\n }", "void dailod_dab() {\n AlertDialog.Builder alertdialogbuilder = new AlertDialog.Builder(MainActivity.this);\n\n\n alertdialogbuilder.setTitle(\"Select A slot \");\n\n\n alertdialogbuilder.setItems(value1, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n String slt = Arrays.asList(value1).get(which);\n //slot=lis.get(which);\n\n db.opendb();\n String mnoo = db.get_Mobileno();\n String passs = db.get_PASS();\n if (mnoo != null && mnoo.length() > 0 && passs != null && passs.length() > 0) {\n sendSMS(mnoo, \"DB\" + slt + \" \" + passs);\n Toast.makeText(getApplicationContext(), slt, Toast.LENGTH_LONG).show();\n }\n // textview.setText(selectedText);\n\n }\n });\n\n AlertDialog dialog = alertdialogbuilder.create();\n\n dialog.show();\n }", "@Override\n public void onClick(View v) {\n\n if (!isInternetPresent) {\n // Internet connection is not present\n // Ask user to connect to Internet\n showAlertDialog(MainActivity.this, \"You don't have internet connection.\",\n \"Data Not Loaded\", false);\n\n }\n\nelse if(sp1.getSelectedItem().toString().equals(\"Select Type\") || sp2.getSelectedItem().toString().equals(\"Select Size\")) {\n Toast.makeText(getApplicationContext(), \"Select value\", Toast.LENGTH_SHORT).show();\n\n }\n\nelse if (TextViewKGFEET.getText().toString().equals(\"Select Meter\")){\n Toast.makeText(getApplicationContext(), \"Select value\", Toast.LENGTH_SHORT).show();\n }\n//sp1.getSelectedItem().toString();\n else {\n Intent intent = new Intent(MainActivity.this, FinalAmount.class);\n String tp = intent.putExtra(\"type\", t).toString();\n\n\n intent.putExtra(\"size\", s);\n intent.putExtra(\"kg_mtr\", arrayListmtr.get(sp2.getSelectedItemPosition()).toString());\n intent.putExtra(\"kg_feet\", arrayListfeet.get(sp2.getSelectedItemPosition()).toString());\n intent.putExtra(\"guage\", arrayListguage.get(sp2.getSelectedItemPosition()).toString());\n\n intent.putExtra(\"type\", t);\n Log.e(\"weightpermtr ::::::\", \"\" + arrayListmtr.get(sp2.getSelectedItemPosition()).toString());\n Log.e(\"weightperfeet ::::::\", \"\" + arrayListfeet.get(sp2.getSelectedItemPosition()).toString());\n Log.e(\"guage ::::::\", \"\" + arrayListguage.get(sp2.getSelectedItemPosition()).toString());\n startActivity(intent);\n }\n if (iad.isLoaded()) {\n iad.show();\n }\n\n }", "public void onItemSelected(AdapterView<?> parent, View view, int position,\n long id) {\n nama_pasien2 = parent.getItemAtPosition(position).toString();\n\n // Showing selected spinner item\n Toast.makeText(parent.getContext(), \"You selected: \" + nama_pasien2,\n Toast.LENGTH_LONG).show();\n\n }", "@Override\n public void onClick(DialogInterface dialog, int which) {\n getThayDoiThongTin getThayDoiThongTin = new getThayDoiThongTin();\n getThayDoiThongTin.execute();\n ChangeHinh();\n\n\n\n\n TextView txtHoTen = ((Activity) ThongTinContext.context).findViewById(R.id.txtHoVaTenTT);\n TextView txtNgaySinh = ((Activity) ThongTinContext.context).findViewById(R.id.txtNgaySinhTT);\n TextView txtDiaChi = ((Activity) ThongTinContext.context).findViewById(R.id.txtDiaChiTT);\n txtHoTen.setText(editTextHoVaTen.getText().toString());\n txtNgaySinh.setText(editTextNgaySinh.getText().toString());\n txtDiaChi.setText(spnXaPhuong.getSelectedItem().toString() + \", \" + spnHuyenQuan.getSelectedItem().toString() + \", \" + spnTinhTp.getSelectedItem().toString());\n\n Toast.makeText(ThayDoiThongTin.this, \"Thay đổi thành công !\", Toast.LENGTH_SHORT).show();\n finish();\n\n }", "@Override\n public void onClick(DialogInterface dialog, int which) {\n input_prac_type.setText(renewal[which]);\n Currentitem = mParam1.get(which);\n Log.e(\"equipment select\",Currentitem.name);\n input_prac_price.setText(\"RM\"+String.valueOf(mParam1.get(which).price));\n\n\n }", "@Override\n public void onClick(DialogInterface dialog, int which) {\n input_prac_type.setText(renewal[which]);\n Currentitem = mParam1.get(which);\n input_prac_price.setText(\"RM\"+String.valueOf(mParam1.get(which).price));\n Log.e(\"equipment select\",Currentitem.name);\n }", "@Override\r\n\t\t\tpublic void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {\n\t\t\t\thasilSpinJurusan = parent.getItemAtPosition(pos).toString();\r\n\t\t\t\tString[] parts = hasilSpinJurusan.split(\"--\");\r\n\t\t\t\tString kode = parts[0];\r\n\t\t\t\tkodeJurusan=kode;\r\n\t\t\t}", "public void addListenerOnButton() {\n\n isempleado = (Spinner) findViewById(R.id.spinnerWifi);\n spinner2 = (Spinner) findViewById(R.id.spinner2);\n\n\n Toast.makeText(getApplicationContext(), \"Spinner 1 \"+String.valueOf(isempleado.getSelectedItem()) +\n \"Spinner 2 : \"+ String.valueOf(spinner2.getSelectedItem()), Toast.LENGTH_LONG).show();\n\n\n }", "@Override\n public void onClick(View view) {\n\n if (material_type.getSelectedItem().equals(\"--Select Material Type--\")) {\n Toast.makeText(Activity_Sell.this, \"Select Material Type to continue\", Toast.LENGTH_SHORT).show();\n } else {\n\n// LoadMaterialTypeSpinner();\n alertDialog.dismiss();\n getMaterial();\n /* getMaterialClasses();\n getMaterialDetails();\n getMaterialUnits();*/\n\n }\n }", "public void loadDataProduk(){\n kode_barang = txtKodeBarang.getText();\n nama_barang = txtNamaBarang.getText();\n merk_barang = txtMerkBarang.getText();\n jumlah_stok = Integer.parseInt(txtJumlahStok.getText());\n harga = Integer.parseInt(txtHarga.getText());\n \n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n et_country = CountryNameSpinner.getSelectedItem().toString();\n et_mcode.setText(\"+\"+CountriesCode.get(position));\n }", "public void onItemSelected(AdapterView<?> parent, android.view.View v, int position, long id) {\n // Log.d(TAGLOG, \"----------------------- pasando7---------------\" + datosCorreos.size());\n correo = parent.getItemAtPosition(position).toString();\n txtEmail3.setText(miTab + \" de \" + correo);\n // Log.d(TAGLOG, \"----------------------- pasando8---------------\" + datosCorreos.size());\n switch (spCorreo.getSelectedItemPosition()) {\n case 0:\n //si se selecciona todos, oculta el boton enviar\n enviar3.setVisibility(View.GONE);\n // Toast.makeText(getApplicationContext(), \"todos seleccionados \"+spCorreo.getSelectedItemPosition(), Toast.LENGTH_LONG).show();\n break;\n default:\n //por defecto muestra el boton enviar\n enviar3.setVisibility(View.VISIBLE);\n // Toast.makeText(getApplicationContext(), \"otros seleccionados \"+spCorreo.getSelectedItemPosition(), Toast.LENGTH_LONG).show();\n break;\n }\n Log.d(TAGLOG, \"----------------------- pasando9---------------\" + datosCorreos.size());\n //llama a muestra mensaje con el correo seleccionado a mostrar o con \"todos\" si no se ha seleccionado ninguno\n //muestraMensajes(correo, miTab);\n DBmensajes conn = new DBmensajes(miTab);\n conn.listaMensajes(correo, miTab);\n\n }", "public void onClick(View v) {\n showSchedule(v);\n league_selected = leagues_sp.getSelectedItemPosition();\n Log.d(\"MainActivity\", \"Selected league is \" +league_selected);\n team_selected = teams_sp.getSelectedItem().toString();\n Log.d(\"MainActivity\", \"Selected team is \" +team_selected);\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent intent) {\n // TODO Auto-generated method stub\n if ((requestCode == request_code) && (resultCode == RESULT_OK)) {\n\n // Toast.makeText(this, intent.getStringExtra(\"resultado\"), Toast.LENGTH_LONG).show();\n inEquipo.setText(intent.getStringExtra(\"resultado\"));\n }\n }", "public void onItemSelected(AdapterView<?> arg0, View arg1,\n int arg2, long arg3) {\n\n \t hometown=spinner1.getSelectedItem().toString();\n \t\n }", "public void dataSelect(){\n //deklarasi variabel\n int i = tblKembali.getSelectedRow();\n \n //uji adakah data di tabel?\n if(i == -1){\n //tidak ada yang terpilih atau dipilih.\n return;\n }\n txtNama.setText(\"\"+model.getValueAt(i,0));\n txtAlamat.setText(\"\"+model.getValueAt(i,1));\n txtNo.setText(\"\"+model.getValueAt(i,2));\n txtKamera.setText(\"\"+model.getValueAt(i,3));\n txtKode.setText(\"\"+model.getValueAt(i,4));\n txtdisewa.setText(\"\"+model.getValueAt(i,5));\n txtLama.setText(\"\"+model.getValueAt(i,6));\n txtLambat.setText(\"\"+model.getValueAt(i,7));\n \n }", "@Override\n public void onClick(View v) {\n name = editName.getText().toString();\n num = editNum.getText().toString();\n //if all sectors are not written, show message\n if(name.equalsIgnoreCase(\"\") || num.equals(\"\")) {\n Toast.makeText(getApplicationContext(), \"모든 항목을 입력해주세요.\", Toast.LENGTH_LONG).show();\n } else { //if all sectors are filled, store data in DB, and show list by using list view\n //reset editText\n editName.setText(\"\");\n editNum.setText(\"\");\n //insert data in DB\n insert(name, num);\n //show data list by using list view\n showList();\n }\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n\n //prendo il valore dell'elemento selezionato\n String item = parent.getItemAtPosition(position).toString();\n\n if(item.equals(\"Colosseo\")){\n Intent openTreasurePage2 = new Intent(TreasurePortalPag1.this,TreasurePortalPag2.class);\n startActivity(openTreasurePage2);\n }\n //visualizzo l'elemento selezionato\n if(!(item.equals(\"\"))&& (!item.equals(\"Colosseo\")))\n Toast.makeText(parent.getContext(),item,Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode,resultCode,data);\n\n // menangkap hasil balikan dari Place Picker, dan menampilkannya pada TextView\n if (requestCode == 5 && resultCode == RESULT_OK) {\n\n place_Picker = PlacePicker.getPlace(TambahWarkopActivity.this,data);\n\n stxtaddresplace = String.format(\"%s\", place_Picker.getAddress().toString());\n latLng = place_Picker.getLatLng();\n latitude = (float) latLng.latitude;\n longitude = (float) latLng.longitude;\n alamat_warkopText.setText(\"\"+ stxtaddresplace);\n\n }\n }", "@Override\n public void onClick(View view) {\n String nPensil = etPensil.getText().toString();\n String nPena = etPena.getText().toString();\n String nBuku = etBuku.getText().toString();\n\n //mengecek apakah editText kosong\n //kondisi ketika panjangnya kosong\n if(nPensil.isEmpty()){\n //memberi warning berupa error\n etPensil.setError(\"Nilai Tidak Boleh Kosong\");\n }else if (nPena.isEmpty()){\n etPena.setError(\"Nilai tidak boleh kosong\");\n }else if (nBuku.isEmpty()){\n etBuku.setError(\"Nilai tidak boleh kosong\");\n }else{\n //mengubah nilai dari string k integer\n int aPensil = Integer.parseInt(nPensil);\n int aPena = Integer.parseInt(nPena);\n int aBuku = Integer.parseInt(nBuku);\n\n int hasilTotal = (aBuku * 7000) + (aPena * 3500) + (aPensil * 2500);\n\n //menampilkan hasil hitung ke widget textView\n lblTotal.setText(\"Total Belanjaan = Rp\" + hasilTotal);\n }\n }", "@Override\n public void onItemSelected(AdapterView<?> arg0, View arg1, int position, long id) {\n Toast.makeText(getApplicationContext(),country[position] , Toast.LENGTH_LONG).show();\n }", "public void actionPerformed(ActionEvent e) {\n\t\t\t\t\trutaseleccionada = (String) rodadura.getSelectedItem();\r\n\r\n\t\t\t\t}", "public void Iniciar(View view){\n String auditoria = txt_NomAuditoria.getText().toString().trim();\n String sucursal = spinner.getSelectedItem().toString(); //obteniendo los valores del Spinner\n\n if (auditoria.isEmpty()){\n Toast.makeText(this, \"El Nombre de la Auditoria es Requerido\", Toast.LENGTH_SHORT).show();\n }\n else{\n if (sucursal.equals(\"Selecciona una opción\")){\n Toast.makeText(this, \"Selecciona una opción\", Toast.LENGTH_SHORT).show();\n }\n else {\n Intent colectar = new Intent(this, Colectar.class);\n colectar.putExtra(\"auditoria\", auditoria);\n colectar.putExtra(\"sucursal\", sucursal);\n startActivity(colectar);\n finish();\n }\n }\n }", "public String extraerCombo(){\n String consulta=null,combo;\n \n combo=comboBuscar.getSelectedItem().toString();\n \n if(combo.equals(\"Buscar por No.Control:\")){\n consulta=\"noControl\";\n } \n if(combo.equals(\"Buscar por Nombre:\")){\n consulta=\"nombreCompleto\"; \n }\n if(combo.equals(\"Buscar por Carrera:\")){\n consulta=\"nombreCarrera\";\n }\n return consulta;\n }", "public void tipoendereco(View view){\n final ArrayAdapter adapter = new ArrayAdapter(this, R.layout.novo_cliente_endereco_tipoendereco, itens);\n\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"Selecione o Tipo do Endereço:\");\n //define o diálogo como uma lista, passa o adapter.\n builder.setSingleChoiceItems(adapter, 0, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface arg0, int arg1) {\n //Toast.makeText(Novo_Cliente_Endereco.this, \"posição selecionada=\" + arg1, Toast.LENGTH_SHORT).show();\n tipo.setText(adapter.getItem(arg1).toString());\n try {\n endereco.setTipoendereco(daoTipoEndereco.queryBuilder().where().eq(\"nome\",tipo.getText().toString()).queryForFirst());\n } catch (SQLException e) {\n e.printStackTrace();\n }\n //tipo.setEnabled(false);\n alertaEndereco.dismiss();\n }\n });\n\n alertaEndereco = builder.create();\n alertaEndereco.show();\n }", "@Override\n public void onItemSelected(AdapterView<?> arg0, View arg1,\n int pos, long arg3) {\n societyName = String.valueOf(societyNameSpinner\n .getSelectedItem());\n\n }", "@Override\n public void changed(ObservableValue observableValue, Object oldValue, Object newValue) {\n if(verTabla.getSelectionModel().getSelectedItem() != null) { \n //System.out.println(newValue);\n String []values = newValue.toString().replace(\"[\", \"\").replace(\"]\", \"\") .split(\",\");\n editarIDProv.setText(values[0]);\n editarNombrePro.setText(values[1]);\n editarDescripcionPro.setText(values[2]);\n editarCantidadPro.setText(values[3]);\n editarIVAProv.setText(values[4]);\n editarPrecioPro.setText(values[5]);\n editarIDProvePro.setText(values[6]);\n }\n }", "@Override\n public void onItemSelected(AdapterView<?> adapterView, View view,\n int position, long id) {\n Matter matter = adapter.getItem(position);\n // Here you can do the action you want to...\n Toast.makeText(FilterActivity.this, \"ID: \" + matter.get_projeadi() + \"\\nName: \" + matter.get_projekodu(),\n Toast.LENGTH_SHORT).show();\n }", "void hienThi() {\n LoaiVT.Open();\n ArrayList<LoaiVT> DSSP = LoaiVT.DSLOAIVT;\n VatTu PX = VatTu.getPX();\n \n try {\n txtMaVT.setText(PX.getMaVT());\n txtTenVT.setText(PX.getTenVT());\n txtDonVi.setText(PX.getDVT());\n DefaultComboBoxModel cb = new DefaultComboBoxModel();\n for(LoaiVT SP: DSSP){ \n cb.addElement(SP.getMaLoai());\n if(SP.getMaLoai().equals(PX.getMaLoai())){\n cb.setSelectedItem(SP.getMaLoai());\n }\n }\n cbMaloai.setModel(cb);\n } catch (Exception ex) {\n txtMaVT.setText(\"\");\n txtTenVT.setText(\"\");\n txtDonVi.setText(\"\");\n DefaultComboBoxModel cb = new DefaultComboBoxModel();\n cb.setSelectedItem(\"\");\n cbMaloai.setModel(cb);\n }\n \n \n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n nama = new javax.swing.JTextField();\n jconadokt = new javax.swing.JComboBox<>();\n jLabel8 = new javax.swing.JLabel();\n alamat = new javax.swing.JTextField();\n usia = new javax.swing.JTextField();\n jk = new javax.swing.JTextField();\n jLabel9 = new javax.swing.JLabel();\n goldar = new javax.swing.JTextField();\n jLabel10 = new javax.swing.JLabel();\n status = new javax.swing.JTextField();\n jLabel11 = new javax.swing.JLabel();\n negara = new javax.swing.JTextField();\n jLabel12 = new javax.swing.JLabel();\n praktik = new javax.swing.JTextField();\n jLabel2 = new javax.swing.JLabel();\n spesialis = new javax.swing.JTextField();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n jLabel1.setText(\"Pemilihan Dokter\");\n getContentPane().add(jLabel1);\n jLabel1.setBounds(170, 10, 170, 30);\n\n jLabel3.setText(\"Pilih Dokter\");\n getContentPane().add(jLabel3);\n jLabel3.setBounds(30, 50, 90, 20);\n\n jLabel4.setText(\"Identitas\");\n getContentPane().add(jLabel4);\n jLabel4.setBounds(30, 70, 80, 20);\n\n jLabel5.setText(\"Nama\");\n getContentPane().add(jLabel5);\n jLabel5.setBounds(60, 100, 80, 20);\n\n jLabel6.setText(\"Alamat\");\n getContentPane().add(jLabel6);\n jLabel6.setBounds(60, 140, 90, 20);\n\n jLabel7.setText(\"Usia\");\n getContentPane().add(jLabel7);\n jLabel7.setBounds(60, 180, 70, 14);\n\n nama.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n namaActionPerformed(evt);\n }\n });\n getContentPane().add(nama);\n nama.setBounds(220, 100, 180, 30);\n\n jconadokt.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"-- Pilih Salah Satu --\", \"DR. Farras Yassar\", \"DR. Anisa Putri\", \"DR. Harun Fajar\" }));\n jconadokt.setName(\"\"); // NOI18N\n jconadokt.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jconadoktActionPerformed(evt);\n }\n });\n getContentPane().add(jconadokt);\n jconadokt.setBounds(150, 50, 170, 30);\n\n jLabel8.setText(\"Jenis Kelamin\");\n getContentPane().add(jLabel8);\n jLabel8.setBounds(60, 220, 100, 20);\n getContentPane().add(alamat);\n alamat.setBounds(220, 140, 180, 30);\n getContentPane().add(usia);\n usia.setBounds(220, 180, 180, 30);\n getContentPane().add(jk);\n jk.setBounds(220, 220, 180, 30);\n\n jLabel9.setText(\"Golongan Darah\");\n getContentPane().add(jLabel9);\n jLabel9.setBounds(60, 270, 120, 14);\n getContentPane().add(goldar);\n goldar.setBounds(220, 260, 180, 30);\n\n jLabel10.setText(\"Status\");\n getContentPane().add(jLabel10);\n jLabel10.setBounds(60, 310, 120, 14);\n\n status.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n statusActionPerformed(evt);\n }\n });\n getContentPane().add(status);\n status.setBounds(220, 310, 180, 30);\n\n jLabel11.setText(\"Kewarganegaraan\");\n getContentPane().add(jLabel11);\n jLabel11.setBounds(60, 360, 120, 14);\n getContentPane().add(negara);\n negara.setBounds(220, 350, 180, 30);\n\n jLabel12.setText(\"Waktu Praktik\");\n getContentPane().add(jLabel12);\n jLabel12.setBounds(60, 400, 120, 14);\n getContentPane().add(praktik);\n praktik.setBounds(220, 390, 180, 30);\n\n jLabel2.setText(\"Dokter Spesialis\");\n getContentPane().add(jLabel2);\n jLabel2.setBounds(60, 440, 120, 14);\n getContentPane().add(spesialis);\n spesialis.setBounds(220, 440, 180, 30);\n\n setBounds(0, 0, 447, 551);\n }", "private void tbnthemActionPerformed(java.awt.event.ActionEvent evt) {\n \n if(PrimaryKeyMa()== true)\n \n { \n if(cboloai.getSelectedIndex() == 0 ) \n {\n \n try {\n danhsach.themGV( new GVCoHuu( ChuyenStringSangDate(tfngayvao.getText()) , Double.parseDouble(tfluongcb.getText()) , tfma.getText().trim(),tften.getText().trim(), Integer.parseInt(tfsogio.getText()), gt) );\n } catch (ParseException ex) {\n Logger.getLogger(GiaoDien.class.getName()).log(Level.SEVERE, null, ex);\n }\n } \n else {\n danhsach.themGV( new GVThinhGiang( tfmahopdong.getText().trim() , tfma.getText().trim(),tften.getText().trim() , Integer.parseInt(tfsogio.getText()), gt));\n } \n lberrorma.setText(null);\n RemoveAllTable();\n napDulieu();\n Refresh();\n EnabledXoa();\n }else {\n tfma.setText(null);\n lberrorma.setText(\"Mã đã tồn tại !\");\n }\n \n }", "@Override\n\tpublic void onItemSelected(AdapterView<?> parent, View view, int position,\n\t\t\tlong id) {\n\t\tString text = spnner_city.getSelectedItem().toString();\n\t\tToast.makeText(getApplicationContext(), text, Toast.LENGTH_LONG)\n\t\t.show();\n\n\t}", "@Override\n public void onItemSelected(AdapterView<?> arg0, View arg1, int pos,\n long arg3) {\n financialYr = String.valueOf(chooseyrSpiner.getSelectedItem());\n\n }", "@Override\n public void changed(ObservableValue observableValue, Object oldValue, Object newValue) {\n if(verTabla.getSelectionModel().getSelectedItem() != null) { \n //System.out.println(newValue);\n String []values = newValue.toString().replace(\"[\", \"\").replace(\"]\", \"\") .split(\",\");\n editarIDProv.setText(values[0]);\n editarNombrePro.setText(values[1]);\n editarDescripcionPro.setText(values[2]);\n editarCantidadPro.setText(values[3]);\n editarIVAProv.setText(values[4]);\n editarPrecioPro.setText(values[5]);\n editarIDProvePro.setText(values[6]);\n }\n }", "public void tampilgrup(){\n txtgrup.removeAllItems();\n try{\n java.sql.Statement statement = (java.sql.Statement)conek.GetConnection().createStatement();\n ResultSet res = statement.executeQuery(\"SELECT DISTINCT nama_grup FROM tblaktivitas\");\n \n while(res.next()){\n String name = res.getString(\"nama_grup\");\n txtgrup.addItem(name);\n }\n res.last();\n }catch (Exception e){\n }\n \n }", "public void send(View v)\n {\n if(staticSpinner.getSelectedItemPosition() == 0) {\n TextView errorText = (TextView)staticSpinner.getSelectedView();\n errorText.setError(\"\");\n errorText.setTextColor(Color.RED);//just to highlight that this is an error\n errorText.setText(\"Harap Pilih Kategori\");\n }\n else if(msgTextField.getText().toString().equals(\"\") ){\n msgTextField.setError(\"required\");\n msgTextField.setHintTextColor(Color.RED);//just to highlight that this is an error\n msgTextField.setHint(\"Harap Diisi\");\n }\n else {\n if (staticSpinner.getSelectedItem().equals(\"Nama Produk\")) {\n spinK = \"nama_produk\";\n } else if (staticSpinner.getSelectedItem().equals(\"Nama Produsen\")) {\n spinK = \"nama_produsen\";\n } else {\n spinK = \"nomor_sertifikat\";\n }\n String msgSearch = msgTextField.getText().toString();\n Intent searchIntent = new Intent(MainActivity.this, HasilCari.class);\n Bundle extras = new Bundle();\n extras.putString(\"spinKat\", spinK);\n extras.putString(\"msgSearch\", msgSearch);\n searchIntent.putExtras(extras);\n startActivity(searchIntent);\n Log.v(TAG, spinK);\n }\n }", "public void carregaCidadeSelecionada(String nome) throws SQLException{\n String sql = \"SELECT nome FROM tb_cidades where uf='\"+cbUfEditar.getSelectedItem()+\"'\"; \n PreparedStatement preparador = Conexao.conectar().prepareStatement(sql);\n ResultSet rs = preparador.executeQuery();\n //passando valores do banco para o objeto result; \n \n try{ \n while(rs.next()){ \n \n String list = rs.getString(\"nome\"); //resgatando estado \n \n //popula combo_estadof com as informações colhidas \n cbCidadeEditar.addItem(list);\n \n \n \n \n } \n } catch (Exception e){ \n JOptionPane.showMessageDialog(null, \"Impossivel carregar Estados!\", \n \"ERROR - \", JOptionPane.ERROR_MESSAGE); \n } \n cbCidadeEditar.setSelectedItem(nome);\n \n \n \n \n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_deporte_actualizar);\n helper = new ControlBD(this);\n idNombre = (EditText) findViewById(R.id.nombreDeporte);\n sDeporte = (Spinner) findViewById(R.id.selectDeporte);\n\n lista1 =new ArrayList<>();\n lista1=helper.consultaDeporte();\n ArrayAdapter<String> adaptador1 =new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,lista1);\n adaptador1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n sDeporte.setAdapter(adaptador1);\n }", "@Override\n\t\t\tpublic void onItemSelected(AdapterView<?> arg0, View arg1,\n\t\t\t\t\tint arg2, long arg3) {\n\t\t\t\tToast.makeText(Yupdateplan.this, list.get(arg2), Toast.LENGTH_SHORT).show();\n\t\t\t\texcelname=list.get(arg2);\n\t\t\t}", "@Override\n public void onItemSelected(AdapterView<?> parentView, View selectedItemView, int position, long id) {\n spnDistrict.setAdapter(C.getArrayAdapter(\"select ZIlLAID||'-'||ZILLANAMEENG DistName from Zilla where DIVID='\" + Global.Left(spnDiv.getSelectedItem().toString(), 2) + \"'\"));// Global.Left(spnDiv.getSelectedItem().toString(),2)\n spnDistrict.setSelection(DivzillaSelect(\"zilla\"));\n\n\n }", "@Override\n public void onItemSelected(AdapterView<?> arg0, View arg1,\n int arg2, long arg3) {\n String mselection = mSpinner.getSelectedItem().toString();\n Toast.makeText(getApplicationContext(), \"selected \" + mselection, 30).show();\n /**** do your code*****/\n\n if (mselection.equals(\"New Location\")){\n Intent i = new Intent(getApplicationContext(), NewLocation.class);\n startActivity(i);\n }\n }", "@Override\n public void onClick(View v){\n EditText ec_local = (EditText)findViewById(R.id.pm_data_txt);\n EditText dd = (EditText)findViewById(R.id.dd);\n EditText mm = (EditText)findViewById(R.id.mm);\n EditText yyyy = (EditText)findViewById(R.id.yyyy);\n EditText qtde = (EditText)findViewById(R.id.qtde);\n Spinner dma = (Spinner)findViewById(R.id.dma);\n Spinner ec_eqp_id = (Spinner)findViewById(R.id.pm_eqp_tx);\n\n //Método de como transformar um String em Int: Integer.parseInt(myEditText.getText().toString())\n String id = ec_eqp_id.getSelectedItem().toString();\n String local = ec_local.getText().toString();\n String dia = dd.getText().toString();\n String mes = mm.getText().toString();\n String ano = yyyy.getText().toString();\n String qtd = qtde.getText().toString();\n String adm = dma.getSelectedItem().toString();\n\n \n if(TextUtils.isEmpty(local) || TextUtils.isEmpty(dia) || TextUtils.isEmpty(mes) || TextUtils.isEmpty(ano) || TextUtils.isEmpty(qtd)){\n Toast.makeText(getApplicationContext(),\"Insira as Informações Corretamente\",Toast.LENGTH_LONG).show();\n }else if (Integer.parseInt(mes)>12){\n Toast.makeText(getApplicationContext(), \"Mês Inválido\", Toast.LENGTH_LONG).show();\n }else if(Integer.parseInt(mes)==2 && Integer.parseInt(dia)>28){\n Toast.makeText(getApplicationContext(),\"Dia Inválido\",Toast.LENGTH_LONG).show();\n }else if((Integer.parseInt(mes)==1 || Integer.parseInt(mes)==3 || Integer.parseInt(mes)==5 || Integer.parseInt(mes)==7 || Integer.parseInt(mes)==8 || Integer.parseInt(mes)==10 || Integer.parseInt(mes)==12) && Integer.parseInt(dia)>31){\n Toast.makeText(getApplicationContext(),\"Dia Inválido\",Toast.LENGTH_LONG).show();\n }else if((Integer.parseInt(mes)==4 || Integer.parseInt(mes)==6 || Integer.parseInt(mes)==9 || Integer.parseInt(mes)==11) && Integer.parseInt(dia)>30){\n Toast.makeText(getApplicationContext(),\"Dia Inválido\",Toast.LENGTH_LONG).show();\n }else {\n BDController crud = new BDController(getBaseContext());\n int qt = Integer.parseInt(qtde.getText().toString());\n String resultado;\n //Realizando a inserção dos dados no banco de dados.\n String pei = \"\";\n if (adm.equals(\"Dia(s)\")) {\n pei = \"day\";\n } else if (adm.equals(\"Mes(es)\")) {\n pei = \"month\";\n } else if (adm.equals(\"Ano(s)\")) {\n pei = \"year\";\n }\n resultado = crud.insereDado(id, local, ano + \"-\" + mes + \"-\" + dia, qt, adm);\n\n Toast.makeText(getApplicationContext(), resultado, Toast.LENGTH_LONG).show();\n if (!resultado.equals(\"-1\")) {\n crud.updateEcDpm(qt,pei);\n Toast.makeText(getApplicationContext(), resultado, Toast.LENGTH_LONG).show();\n Intent it = new Intent(getApplicationContext(), Equips.class);\n startActivity(it);\n finish();\n }else{\n Toast.makeText(getApplicationContext(),\"Erro de BD\", Toast.LENGTH_LONG).show();\n }\n }\n\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tif (clsUtility.isNetworkAvailable(getApplicationContext()) == false) {\n\t\t\t\t\tToast.makeText(getApplicationContext(), \"No Network Connection \" + \"Internet is not available right now.\", Toast.LENGTH_LONG).show();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif(spArea1.getSelectedItem().equals(\".\") || spArea1.getSelectedItem().equals(\"\")) {\n\t\t\t\t\tclsUtility.msgBox(Outlet.this,\"Info\",\"Please Select Area !\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(spTown1.getSelectedItem().equals(\".\") || spTown1.getSelectedItem().equals(\"\")) {\n\t\t\t\t\tclsUtility.msgBox(Outlet.this,\"Info\",\"Please Select Town !\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(sp_PartyName1.getSelectedItem().equals(\".\") || sp_PartyName1.getSelectedItem().equals(\"\")) {\n\t\t\t\t\tclsUtility.msgBox(Outlet.this,\"Info\",\"Please Select Party !\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tdb = openOrCreateDatabase(\"CBAS.db\", MODE_PRIVATE, null);\n\t\t\t\tdb.execSQL(\"delete from Outletmst\");\n\t\t\t\tdb.execSQL(\"insert into Outletmst(ArCode,Town,Party,Address,PinCode,Owner,ContactNo,FilePath)values('\"+hmap_Area.get(spArea.getSelectedItem())+\"',\"+\n\t\t\t\t\t\t\" '\"+ hmap_Town.get(spTown.getSelectedItem()) +\"','\"+hmap_Party.get(sp_PartyName.getSelectedItem())+\"',\"+\n\t\t\t\t\" '\"+et_Address2.getText()+\"','\"+et_Pincode2.getText()+\"','\"+et_Owner2.getText()+\"','\"+et_Contact2.getText()+\"','\"+UrlData+\"');\");\n\t\t\t\t//Toast.makeText(getApplicationContext(), \"Saved\", Toast.LENGTH_LONG).show();\n\t\t\t\tdb.close();\n\n\t\t\t\timage1.setImageResource(R.drawable.white);\n\t\t\t\tspArea.setSelection(0);\n\t\t\t\tspArea1.setSelection(0);\n\t\t\t\tspTown.setSelection(0);\n\t\t\t\tspTown1.setSelection(0);\n\t\t\t\tsp_PartyName.setSelection(0);\n\t\t\t\tsp_PartyName1.setSelection(0);\n\n\t\t\t\tet_Address2.setText(\"\");\n\t\t\t\tet_Address.setText(\"\");\n\t\t\t\tet_Pincode.setText(\"\");\n\t\t\t\tet_Pincode2.setText(\"\");\n\t\t\t\tet_Owner.setText(\"\");\n\t\t\t\tet_Owner2.setText(\"\");\n\t\t\t\tet_Contact.setText(\"\");\n\t\t\t\tet_Contact2.setText(\"\");\n\n\t\t\t\tIntent i = new Intent(getApplicationContext(), Assets.class);\n\t\t\t\tstartActivity(i);\n\t\t\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jComboBox1 = new javax.swing.JComboBox<>();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n nama_kost = new javax.swing.JTextField();\n alamat_kost = new javax.swing.JTextField();\n jum_kamar = new javax.swing.JTextField();\n nama_pemilik = new javax.swing.JTextField();\n no_pemilik = new javax.swing.JTextField();\n jLabel7 = new javax.swing.JLabel();\n jLabel8 = new javax.swing.JLabel();\n jLabel9 = new javax.swing.JLabel();\n jLabel10 = new javax.swing.JLabel();\n nama_penyewa = new javax.swing.JTextField();\n no_penyewa = new javax.swing.JTextField();\n kode_sewa = new javax.swing.JComboBox<>();\n\n jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jLabel1.setText(\"Kost\");\n\n jLabel2.setText(\"Nama Kost : \");\n\n jLabel3.setText(\"Alamat Kost : \");\n\n jLabel4.setText(\"Jumlah Kamar: \");\n\n jLabel5.setText(\"Pemilik Kost :\");\n\n jLabel6.setText(\"No HP : \");\n\n nama_kost.setToolTipText(\"\");\n nama_kost.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n nama_kostActionPerformed(evt);\n }\n });\n\n alamat_kost.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n alamat_kostActionPerformed(evt);\n }\n });\n\n no_pemilik.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n no_pemilikActionPerformed(evt);\n }\n });\n\n jLabel7.setText(\"Sewa Kost\");\n\n jLabel8.setText(\"Nama :\");\n\n jLabel9.setText(\"Kode Kos : \");\n\n jLabel10.setText(\"Kode Kos : \");\n\n kode_sewa.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(27, 27, 27)\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabel7)\n .addGap(100, 100, 100))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(nama_kost, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel5)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(nama_pemilik))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel6)\n .addGap(18, 18, 18)\n .addComponent(no_pemilik, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(jLabel4))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(alamat_kost)\n .addComponent(jum_kamar))))\n .addGap(59, 59, 59)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel8)\n .addComponent(jLabel9))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(nama_penyewa)\n .addComponent(no_penyewa)))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel10)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(kode_sewa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(0, 77, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel7)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(nama_kost, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel8)\n .addComponent(nama_penyewa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(alamat_kost, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel9)\n .addComponent(no_penyewa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel4)\n .addComponent(jum_kamar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel10)\n .addComponent(kode_sewa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel5)\n .addComponent(nama_pemilik, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel6)\n .addComponent(no_pemilik, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(0, 145, Short.MAX_VALUE))\n );\n\n pack();\n }", "public void onItemSelected(AdapterView<?> parent, View view,\n int pos, long id) {\n final SharedPreferences.Editor fooddetail = clothdata.edit();\n int position1=spinner1.getSelectedItemPosition();\n int position2=spinner2.getSelectedItemPosition();\n int position3=spinner3.getSelectedItemPosition();\n\n switch(position1){\n case 1:\n fooddetail.putString(\"type\", \"Male\");\n break;\n case 2:fooddetail.putString(\"type\",\"Female\");\n break;\n case 3:fooddetail.putString(\"type\",\"Both\");\n break;\n }\n fooddetail.commit();\n switch(position2){\n case 1:\n fooddetail.putString(\"number\", \"less then 10\");\n break;\n case 2:fooddetail.putString(\"number\",\"10 to 20\");\n break;\n case 3:fooddetail.putString(\"number\",\"20 to 30\");\n break;\n case 4:fooddetail.putString(\"number\",\"more then 30\");\n break;\n }\n fooddetail.commit();\n switch(position3) {\n case 1:\n fooddetail.putString(\"area\", \"jayanagar\");\n break;\n case 2:\n fooddetail.putString(\"area\", \"WhiteField\");\n break;\n case 3:\n fooddetail.putString(\"area\", \"Malleshwaram\");\n break;\n case 4: fooddetail.putString(\"area\", \"Koramangala\");\n break;\n\n }\n fooddetail.commit();\n }", "private void tblaktivitasMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblaktivitasMouseClicked\n //txttanggal.setText(tblaktivitas.getValueAt(tblaktivitas.getSelectedRow(),0).toString());\n txtgrup.setSelectedItem(tblaktivitas.getValueAt(tblaktivitas.getSelectedRow(),0).toString());\n txtcompart.setSelectedItem(tblaktivitas.getValueAt(tblaktivitas.getSelectedRow(),1).toString());\n txtaktivitas.setText(tblaktivitas.getValueAt(tblaktivitas.getSelectedRow(),2).toString());\n txtha.setText(tblaktivitas.getValueAt(tblaktivitas.getSelectedRow(),3).toString());\n txtharga.setText(tblaktivitas.getValueAt(tblaktivitas.getSelectedRow(),4).toString());\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n String SlectedCountry = countryNameTwo[+position];\n Toast.makeText(getApplicationContext(), SlectedCountry, Toast.LENGTH_SHORT).show();\n\n }", "@Override\n\t\t\tpublic void onItemSelected(AdapterView<?> arg0, View arg1,\n\t\t\t\t\tint arg2, long arg3) {\n\t\t\t\tToast.makeText(getApplicationContext(), \"Selected Text Is...\"+names[arg2]+\":\"+phones[arg2], 5000).show();\n\t\t\t}", "@Override\n public void onClick(View view) {\n ShowDialog(\"El Resultado es:\",BuildNumber(SpnC1.getSelectedItemPosition(),SpnC2.getSelectedItemPosition(),\n SpnC3.getSelectedItemPosition())+\" \"+GetTolerance(SpnC4.getSelectedItemPosition()));\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view,\n int position, long id) {\n\n if (syrupA2.getSelectedItemPosition() < 1 || syrupE3.getSelectedItemPosition() < 1 || syrupN4.getSelectedItemPosition() < 1) {\n syrupA2.setSelection(syrupM1.getSelectedItemPosition());\n syrupE3.setSelection(syrupM1.getSelectedItemPosition());\n syrupN4.setSelection(syrupM1.getSelectedItemPosition());\n }\n\n }", "@Override\n public void onClick(View v) {\n String vehicleNo=et_vehicleNo.getText().toString().trim();\n if(vehicleNo.equals(\"\"))\n {\n Toast.makeText(AdminHomeActivity.this, \"Please Enter a Vehicle No\", Toast.LENGTH_SHORT).show();\n }\n else\n {\n String msg=repo.CheckVehhicleAlreadyExist(vehicleNo);\n if(!msg.equals(\"exist\"))\n {\n repo.addVehicleNo(vehicleNo);\n List<Student> l=repo.getAllVehhicle();\n dialog.dismiss();\n // Student barcode = l.get(0);\n // Toast.makeText(AdminHomeActivity.this, \"\"+barcode.getVehicleNo(), Toast.LENGTH_SHORT).show();\n }\n else\n {\n Toast.makeText(AdminHomeActivity.this, \"Vehicle No Alreay Exist\", Toast.LENGTH_SHORT).show();\n }\n\n }\n\n\n\n }", "public void isiPilihanDokter() {\n String[] list = new String[]{\"\"};\n pilihNamaDokter.setModel(new javax.swing.DefaultComboBoxModel(list));\n\n /*Mengambil data pilihan spesialis*/\n String nama = (String) pilihPoliTujuan.getSelectedItem();\n String kodeSpesialis = ss.serviceGetIDSpesialis(nama);\n\n /* Mencari dokter where id_spesialis = pilihSpesialis */\n tmd.setData(ds.serviceGetAllDokterByIdSpesialis(kodeSpesialis));\n int b = tmd.getRowCount();\n\n /* Menampilkan semua nama berdasrkan pilihan sebelumnya */\n pilihNamaDokter.setModel(new javax.swing.DefaultComboBoxModel(ds.serviceTampilNamaDokter(kodeSpesialis, b)));\n }", "@Override\n public void onItemSelected(AdapterView<?> adapter, View v,\n int position, long id) {\n mappos = position;\n findmapinfo(position , adapter.getItemAtPosition(position).toString());\n \n // Showing selected spinner item\n \n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n compaCategory = parent.getItemAtPosition(position).toString();\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view,\n int position, long id) {\n\n\n try{\n String s = \"\";\n Log.e(\"mytag\",\"(String) parent.getItemAtPosition(position):\"+(String) parent.getItemAtPosition(position).toString().trim());\n if (parent.getItemAtPosition(position).toString().trim().equals(\"בחר\")){\n s = \"-1\";\n }else{\n s = String.valueOf(ctype_map.get(parent.getItemAtPosition(position).toString().trim()).getCtypeID());\n }\n setCcustomerSpinner(s);\n }catch(Exception e){\n helper.LogPrintExStackTrace(e);\n }\n Log.e(\"mytag\", (String) parent.getItemAtPosition(position));\n //statusID = db.getCallStatusByCallStatusName((String) parent.getItemAtPosition(position)).getCallStatusID();\n //statusName = db.getCallStatusByCallStatusName((String) parent.getItemAtPosition(position)).getCallStatusName();\n //Toast.makeText(getApplication(), \"status: \" + s, Toast.LENGTH_LONG).show();\n //Log.v(\"item\", (String) parent.getItemAtPosition(position));\n }", "@Override\n public void onSelected(BaseSearchDialogCompat dialog,\n SearchModelForPostcode item, int position) {\n\n\n Toast.makeText(RegisterActivity.this, \"postcode selected:\"+item.getTitle(),\n Toast.LENGTH_SHORT).show();\n pc.setText(item.getTitle());\n dialog.dismiss();\n }", "@Override\n public void onItemSelected(AdapterView<?> arg0, View arg1,\n int arg2, long arg3) {\n str_loc = Arraylist_location.get(arg2);\n str_loc_id = Arraylist_location_id.get(arg2);\n\n System.out.println(\"### ID : \" + str_loc + \" : \" + str_loc_id);\n\n\n\n }", "public void onClick(View view) {\n String gender = spGender.getSelectedItem().toString();\r\n String ageRange = spAgeRage.getSelectedItem().toString();\r\n String shelterName = etShelterName.getText().toString();\r\n\r\n myAdapter.setmValues(model.searchShelterList(gender, ageRange, shelterName));\r\n myAdapter.notifyDataSetChanged();\r\n }", "@Override\n\t\t\tpublic void onItemSelected(AdapterView<?> arg0, View arg1,\n\t\t\t\t\tint position, long id) {\n\t\t\t\t\n\t\t\t\tnameoffriend = sp.getItemAtPosition(position).toString();\n\t\t\t\tToast.makeText(getApplicationContext(), nameoffriend, Toast.LENGTH_SHORT).show();\n\t\t\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_calcular);\n\n Peso = (EditText) findViewById(R.id.et1);\n BotonG = (Button) findViewById(R.id.btnGestion);\n Continente = (Spinner) findViewById(R.id.spinner);\n Continente.setOnItemSelectedListener(this);\n Pais = (Spinner) findViewById(R.id.spinner2);\n //Pais.setOnItemSelectedListener(this);\n\n adapterC = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_dropdown_item, OpcionesC);\n Continente.setAdapter(adapterC);\n\n BotonG.setOnClickListener(new OnClickListener() {\n @Override\n public void onClick(View v) {\n Intent i = new Intent(Calcular.this, Gestionar.class);\n i.putExtra(\"continente\", Continente.getSelectedItemPosition()+\"\");\n i.putExtra(\"pais\", Pais.getSelectedItemPosition()+\"\");\n i.putExtra(\"peso\", Peso.getText()+\"\");\n i.putExtra(\"precio\", P);\n startActivity(i);\n }\n });\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n\n quanHuyens = sqLite_quanHuyen.getDSQH(arrTinhTP.get(position).getId());\n adapterRecyclerViewChonQuan = new AdapterRecyclerViewChonQuan(quanHuyens, getApplicationContext());\n recycleQH.setAdapter(adapterRecyclerViewChonQuan);\n\n //spinnerQuanHuyen_adapter = new SpinnerQuanHuyen_Adapter(getApplicationContext(), arrQuanHuyen);\n //spinnerQuanHuyen_adapter.notifyDataSetChanged();\n //spinnerQuanHuyen.setAdapter(spinnerQuanHuyen_adapter);\n\n }", "@SuppressLint(\"SetTextI18n\")\r\n @Override\r\n public void onClick(View view) {\n\r\n s1 = spinner[0].getSelectedItem().toString();\r\n s2 = spinner2[0].getSelectedItem().toString();\r\n Toast.makeText(dashboard.this, s1 + \" to \" + s2, Toast.LENGTH_SHORT).show();\r\n\r\n\r\n if (\"Mumbai\".equals(s1) && \"Mumbai\".equals(s2)) {\r\n tokens.setText(\"0 Tokens\");\r\n amount.setText(\"0\");\r\n }\r\n if (\"Mumbai\".equals(s1) && \"Panvel\".equals(s2)) {\r\n tokens.setText(\"3 Tokens\");\r\n amount.setText(\"100\");\r\n\r\n\r\n }\r\n if (\"Mumbai\".equals(s1) && \"Thane\".equals(s2)) {\r\n tokens.setText(\"1 Tokens\");\r\n amount.setText(\"40\");\r\n\r\n\r\n }\r\n if (\"Mumbai\".equals(s1) && \"Pune\".equals(s2)) {\r\n tokens.setText(\"3 Tokens\");\r\n amount.setText(\"120\");\r\n\r\n\r\n }\r\n if (\"Mumbai\".equals(s1) && \"Ratnagiri\".equals(s2)) {\r\n tokens.setText(\"5 Tokens\");\r\n amount.setText(\"150\");\r\n\r\n }\r\n if (\"Panvel\".equals(s1) && \"Panvel\".equals(s2)) {\r\n tokens.setText(\"0 Tokens\");\r\n amount.setText(\"0\");\r\n }\r\n if (\"Panvel\".equals(s1) && \"Thane\".equals(s2)) {\r\n tokens.setText(\"2 Tokens\");\r\n amount.setText(\"80\");\r\n }\r\n if (\"Panvel\".equals(s1) && \"Pune\".equals(s2)) {\r\n tokens.setText(\"3 Tokens\");\r\n amount.setText(\"120\");\r\n }\r\n if (\"Panvel\".equals(s1) && \"Ratnagiri\".equals(s2)) {\r\n tokens.setText(\"4 Tokens\");\r\n amount.setText(\"140\");\r\n\r\n }\r\n if (\"Panvel\".equals(s1) && \"Mumbai\".equals(s2)) {\r\n tokens.setText(\"3 Tokens\");\r\n amount.setText(\"100\");\r\n\r\n\r\n }\r\n if (\"Thane\".equals(s1) && \"Thane\".equals(s2)) {\r\n tokens.setText(\"0 Tokens\");\r\n }\r\n if (\"Thane\".equals(s1) && \"Pune\".equals(s2)) {\r\n tokens.setText(\"4 Tokens\");\r\n amount.setText(\"150\");\r\n\r\n\r\n }\r\n if (\"Thane\".equals(s1) && \"Ratnagiri\".equals(s2)) {\r\n tokens.setText(\"6 Tokens\");\r\n amount.setText(\"180\");\r\n\r\n }\r\n if (\"Thane\".equals(s1) && \"Mumbai\".equals(s2)) {\r\n tokens.setText(\"1 Tokens\");\r\n amount.setText(\"40\");\r\n\r\n\r\n }\r\n if (\"Thane\".equals(s1) && \"Panvel\".equals(s2)) {\r\n tokens.setText(\"2 Tokens\");\r\n amount.setText(\"80\");\r\n\r\n }\r\n if (\"Pune\".equals(s1) && \"Thane\".equals(s2)) {\r\n tokens.setText(\"4 Tokens\");\r\n amount.setText(\"160\");\r\n\r\n }\r\n if (\"Pune\".equals(s1) && \"Pune\".equals(s2)) {\r\n tokens.setText(\"0 Tokens\");\r\n amount.setText(\"0\");\r\n\r\n }\r\n if (\"Pune\".equals(s1) && \"Ratnagiri\".equals(s2)) {\r\n tokens.setText(\"3 Tokens\");\r\n amount.setText(\"120\");\r\n\r\n }\r\n if (\"Pune\".equals(s1) && \"Mumbai\".equals(s2)) {\r\n tokens.setText(\"4 Tokens\");\r\n amount.setText(\"150\");\r\n\r\n }\r\n if (\"Pune\".equals(s1) && \"Panvel\".equals(s2)) {\r\n tokens.setText(\"4 Tokens\");\r\n amount.setText(\"160\");\r\n\r\n }\r\n if (\"Ratnagiri\".equals(s1) && \"Thane\".equals(s2)) {\r\n tokens.setText(\"6 Tokens\");\r\n amount.setText(\"180\");\r\n\r\n\r\n }\r\n if (\"Ratnagiri\".equals(s1) && \"Pune\".equals(s2)) {\r\n tokens.setText(\"4 Tokens\");\r\n amount.setText(\"160\");\r\n\r\n }\r\n if (\"Ratnagiri\".equals(s1) && \"Ratnagiri\".equals(s2)) {\r\n tokens.setText(\"0 Tokens\");\r\n amount.setText(\"0\");\r\n }\r\n if (\"Ratnagiri\".equals(s1) && \"Mumbai\".equals(s2)) {\r\n tokens.setText(\"6 Tokens\");\r\n amount.setText(\"180\");\r\n\r\n }\r\n if (\"Ratnagiri\".equals(s1) && \"Panvel\".equals(s2)) {\r\n tokens.setText(\"5 Tokens\");\r\n amount.setText(\"150\");\r\n\r\n }\r\n if (\"Select Source Location\".equals(s1) || \"Select Destination Location\".equals(s2)) {\r\n Toast.makeText(dashboard.this, \" Please Choose both Source and Destination \", Toast.LENGTH_SHORT).show();\r\n\r\n }\r\n\r\n\r\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n item = parent.getItemAtPosition(position).toString();\n\n // Showing selected spinner item\n //Toast.makeText(parent.getContext(), \"Selected: \" + item, Toast.LENGTH_LONG).show();\n /*Intent people_intent= new Intent();\n people_intent.putExtra(\"people\",item);\n setResult(RESULT_OK,people_intent);\n finish();*/\n }", "private void tampil_kereta() {\n kereta_combo.addItem (\"Argo Parahyangan\");\n kereta_combo.addItem (\"Argo Jati\");\n kereta_combo.addItem (\"Bangun Karta\");\n kereta_combo.addItem (\"Bima\");\n kereta_combo.addItem (\"Kahuripan\");\n kereta_combo.addItem (\"Lodaya\"); \n kereta_combo.addItem (\"Sembari\");\n kereta_combo.addItem (\"Turangga\");\n \n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view,\n int position, long id) {\n if (syrupM1.getSelectedItemPosition() < 1 && syrupA2.getSelectedItemPosition() < 1 && syrupE3.getSelectedItemPosition() < 1) {\n syrupM1.setSelection(syrupN4.getSelectedItemPosition());\n syrupA2.setSelection(syrupN4.getSelectedItemPosition());\n syrupE3.setSelection(syrupN4.getSelectedItemPosition());\n }\n }", "@Override\n public void onItemSelected(AdapterView<?> arg1, View arg2, int position1, long id1) {\n\n crechCity = getResources().getStringArray(R.array.city_list)[position1];\n\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view,\n int position, long id) {\n if (syrupM1.getSelectedItemPosition() < 1 || syrupA2.getSelectedItemPosition() < 1 || syrupN4.getSelectedItemPosition() < 1) {\n syrupM1.setSelection(syrupE3.getSelectedItemPosition());\n syrupA2.setSelection(syrupE3.getSelectedItemPosition());\n syrupN4.setSelection(syrupE3.getSelectedItemPosition());\n }\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.transaksi_first);\n final TextView txtTitle = (TextView) findViewById(R.id.title);\n Intent i = getIntent();\n // Receiving the Data\n final String name = i.getStringExtra(\"name\");\n \n txtTitle.setText(name);\n \n final String pemb = \"Pembelian\";\n final String pemb2 = \"Pembelian2\";\n final String pemb3 = \"Pembelian3\";\n \n final String pemb4 = \"Pembayaran\";\n \n final String cekh = \"Cek Harga\";\n final String cekh_2 = \"CH\";\n final String ceks = \"Cek Saldo\";\n final String ceks_2 = \"S\";\n final String cekr = \"Cek Rekap harian\";\n final String cekr_2 = \"R\";\n \n final String gpin = \"Ganti Pin\";\n final String gpin_2 = \"GP\";\n final String trfd = \"Transfer Deposit\";\n final String trfd_2 = \"TD\";\n final String reg = \"Registrasi Agen\";\n final String reg_2 = \"R\";\n \n final ImageView btn_home = (ImageView) findViewById(R.id.home);\n btn_home.setOnClickListener(new View.OnClickListener() {\n\t\t\t\n\t\t\tpublic void onClick(View view) {\n\t\t\t\t// Launching News Feed Screen\n\t\t\t\tIntent i = new Intent(getApplicationContext(), TransaksiPulsaActivity.class);\n\t\t\t\ti.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n\t\t\t\ti.putExtra(\"EXIT\", true); // just value to indicate i want to exit the application\n\t\t\t\tstartActivity(i);\n\t\t\t\t\n\t\t\t}\n\t\t});\n \n \n if(name.equalsIgnoreCase(pemb)){ \n \tString[] menu = new String[] { \"Token PLN\", \"Telkomsel\", \"Indosat\", \n \t\t\t\t\"XL\", \"Three\", \"Axis\",\"Esia\",\"Flexi\",\"Smart\",\"Fren\",\"Hepi\",\"Ceria\",\"Starone\"};\n \t\n \t\t//this.setListAdapter(new ArrayAdapter<String>(this,\n \t\t\t\t//R.layout.main,R.id.item_title, menu));\n \tsetListAdapter(new MyPerformanceArrayAdapter(this, menu));\n \t\t \n \t\t \n final ListView lv = getListView();\n lv.setTextFilterEnabled(true);\t\n lv.setOnItemClickListener(new OnItemClickListener() {\n \tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) { \n \t\t Intent i = new Intent(getApplicationContext(), KodeSmsCenter.class);\n \t\t i.putExtra(\"title\", pemb + \"|\" + lv.getItemAtPosition(position).toString());\n \t\t i.putExtra(\"name\", lv.getItemAtPosition(position).toString());\n \t\t \n \t\t String data = lv.getItemAtPosition(position).toString();\n \t\t \n \t\t if(data == \"Token PLN\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Token PLN\", \"PLNKU\"));\n \t\t }\n \t\t if(data == \"Telkomsel\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Telkomsel\", \"TSEL\"));\n \t\t }\n \t\t if(data == \"Indosat\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Indosat\", \"ISAT\"));\n \t\t }\n \t\t if(data == \"XL\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"XL\", \"XL\"));\n \t\t }\n \t\t if(data == \"Three\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Three\", \"TRI\"));\n \t\t }\n \t\t if(data == \"Axis\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Axis\", \"AXIS\"));\n \t }\n \t\t if(data == \"Esia\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Esia\", \"ESIA\"));\n \t }\n \t\t if(data == \"Flexi\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Flexi\", \"FLEXI\"));\n \t }\n \t\t if(data == \"Smart\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Smart\", \"SMART\"));\n \t }\n \t\t \n \t\t if(data == \"Fren\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Fren\", \"FREN\"));\n \t }\n \t\t if(data == \"Hepi\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Hepi\", \"HEPI\"));\n \t }\n \t\t \n \t\t if(data == \"Ceria\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Ceria\", \"CR\"));\n \t }\n \t\t \n \t\t if(data == \"Starone\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Starone\", \"STR\"));\n \t }\n \t\t \n \t\t i.putExtra(\"pemb\", pemb.toString());\n \t\t i.putExtra(\"cekh\", cekh.toString());\n \t\t startActivity(i);\n \t\t \n \t\t\t}\n \t\t});\n }\n \n \n if(name.equalsIgnoreCase(pemb2)){ \n \tString[] menu = new String[] { \"Token PLN\", \"Telkomsel\", \"Indosat\", \n \t\t\t\t\"XL\", \"Three\", \"Axis\",\"Esia\",\"Flexi\",\"Smart\",\"Fren\",\"Hepi\",\"Ceria\",\"Starone\"};\n \tsetListAdapter(new MyPerformanceArrayAdapter(this, menu));\n \t\t//this.setListAdapter(new ArrayAdapter<String>(this,\n \t\t\t\t//R.layout.main,R.id.item_title, menu));\n \t\t \n \t\t \n final ListView lv = getListView();\n lv.setTextFilterEnabled(true);\t\n lv.setOnItemClickListener(new OnItemClickListener() {\n \tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) { \n \t\t Intent i = new Intent(getApplicationContext(), KodeSmsCenter.class);\n \t\t i.putExtra(\"title\", pemb2 + \"|\" + lv.getItemAtPosition(position).toString());\n \t\t i.putExtra(\"name\", lv.getItemAtPosition(position).toString());\n \t\t \n \t\t String data = lv.getItemAtPosition(position).toString();\n \t\t \n \t\t if(data == \"Token PLN\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Token PLN\", \"PLNKU\"));\n \t\t }\n \t\t if(data == \"Telkomsel\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Telkomsel\", \"TSEL\"));\n \t\t }\n \t\t if(data == \"Indosat\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Indosat\", \"ISAT\"));\n \t\t }\n \t\t if(data == \"XL\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"XL\", \"XL\"));\n \t\t }\n \t\t if(data == \"Three\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Three\", \"TRI\"));\n \t\t }\n \t\t if(data == \"Axis\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Axis\", \"AXIS\"));\n \t }\n \t\t if(data == \"Esia\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Esia\", \"ESIA\"));\n \t }\n \t\t if(data == \"Flexi\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Flexi\", \"FLEXI\"));\n \t }\n \t\t if(data == \"Smart\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Smart\", \"SMART\"));\n \t }\n \t\t \n \t\t \n \t\t if(data == \"Fren\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Fren\", \"FREN\"));\n \t }\n \t\t if(data == \"Hepi\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Hepi\", \"HEPI\"));\n \t }\n \t\t \n \t\t if(data == \"Ceria\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Ceria\", \"CR\"));\n \t }\n \t\t \n \t\t \n \t\t if(data == \"Starone\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Starone\", \"STR\"));\n \t }\n \t\t \n \t\t i.putExtra(\"pemb\", pemb2.toString());\n \t\t i.putExtra(\"cekh\", cekh.toString());\n \t\t startActivity(i);\n \t\t \n \t\t\t}\n \t\t});\n }\n \n \n if(name.equalsIgnoreCase(pemb3)){ \n \tString[] menu = new String[] { \"Token PLN\", \"Telkomsel\", \"Indosat\", \n \t\t\t\t\"XL\", \"Three\", \"Axis\",\"Esia\",\"Flexi\",\"Smart\",\"Fren\",\"Hepi\",\"Ceria\",\"Starone\"};\n \tsetListAdapter(new MyPerformanceArrayAdapter(this, menu));\n \t\t//this.setListAdapter(new ArrayAdapter<String>(this,\n \t\t\t\t//R.layout.main,R.id.item_title, menu));\n \t\t \n \t\t \n final ListView lv = getListView();\n lv.setTextFilterEnabled(true);\t\n lv.setOnItemClickListener(new OnItemClickListener() {\n \tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) { \n \t\t Intent i = new Intent(getApplicationContext(), KodeSmsCenter.class);\n \t\t i.putExtra(\"title\", pemb3 + \"|\" + lv.getItemAtPosition(position).toString());\n \t\t i.putExtra(\"name\", lv.getItemAtPosition(position).toString());\n \t\t \n \t\t String data = lv.getItemAtPosition(position).toString();\n \t\t \n \t\t if(data == \"Token PLN\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Token PLN\", \"PLNKU\"));\n \t\t }\n \t\t if(data == \"Telkomsel\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Telkomsel\", \"TSEL\"));\n \t\t }\n \t\t if(data == \"Indosat\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Indosat\", \"ISAT\"));\n \t\t }\n \t\t if(data == \"XL\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"XL\", \"XL\"));\n \t\t }\n \t\t if(data == \"Three\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Three\", \"TRI\"));\n \t\t }\n \t\t if(data == \"Axis\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Axis\", \"AXIS\"));\n \t }\n \t\t if(data == \"Esia\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Esia\", \"ESIA\"));\n \t }\n \t\t if(data == \"Flexi\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Flexi\", \"Flexi\"));\n \t }\n \t\t if(data == \"Smart\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Smart\", \"SMART\"));\n \t }\n \t\t \n \t\t if(data == \"Fren\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Fren\", \"FREN\"));\n \t }\n \t\t if(data == \"Hepi\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Hepi\", \"HEPI\"));\n \t }\n \t\t \n \t\t if(data == \"Ceria\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Ceria\", \"CR\"));\n \t }\n \t\t \n \t\t \n \t\t if(data == \"Starone\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Starone\", \"STR\"));\n \t }\n \t\t \n \t\t i.putExtra(\"pemb\", pemb3.toString());\n \t\t i.putExtra(\"cekh\", cekh.toString());\n \t\t startActivity(i);\n \t\t \n \t\t\t}\n \t\t});\n }\n if(name.equalsIgnoreCase(cekh)){ \n \tString[] menu = new String[] { \"Token PLN\", \"Telkomsel\", \"Indosat\", \n \t\t\t\t\"XL\", \"Three\", \"Axis\",\"Esia\",\"Flexi\",\"Smart\",\"Fren\",\"Hepi\",\"Ceria\",\"Starone\"};\n \t\t//this.setListAdapter(new ArrayAdapter<String>(this,\n \t\t\t\t//R.layout.main,R.id.item_title, menu));\n \tsetListAdapter(new MyPerformanceArrayAdapter(this, menu));\n \t\t\n \t\tfinal ListView lv = getListView();\n lv.setTextFilterEnabled(true);\t\n lv.setOnItemClickListener(new OnItemClickListener() {\n \tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) { \n \t\t Intent i = new Intent(getApplicationContext(), Cek_Harga.class);\n \t\t i.putExtra(\"title\", cekh + \"|\" + lv.getItemAtPosition(position).toString());\n \t\t i.putExtra(\"name\", lv.getItemAtPosition(position).toString());\n \t\t \n \t\t String data = lv.getItemAtPosition(position).toString();\n \t\t if(data == \"Token PLN\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Token PLN\", \"PLNKU\"));\n \t\t }\n \t\t if(data == \"Telkomsel\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Telkomsel\", \"TSEL\"));\n \t\t }\n \t\t if(data == \"Indosat\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Indosat\", \"ISAT\"));\n \t\t }\n \t\t if(data == \"XL\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"XL\", \"XL\"));\n \t\t }\n \t\t if(data == \"Three\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Three\", \"TRI\"));\n \t\t }\n \t\t if(data == \"Axis\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Axis\", \"AXIS\"));\n \t }\n \t\t if(data == \"Esia\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Esia\", \"ESIA\"));\n \t }\n \t\t if(data == \"Flexi\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Flexi\", \"Flexi\"));\n \t }\n \t\t if(data == \"Smart\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Smart\", \"SMART\"));\n \t }\n \t\t \n \t\t if(data == \"Fren\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Fren\", \"FREN\"));\n \t }\n \t\t if(data == \"Hepi\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Hepi\", \"HEPI\"));\n \t }\n \t\t \n \t\t if(data == \"Ceria\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Ceria\", \"CR\"));\n \t }\n \t\t \n \t\t \n \t\t if(data == \"Starone\"){\n \t\t i.putExtra(\"alias\", data.toString().replace(\"Starone\", \"STR\"));\n \t }\n \t\t \n \t\t i.putExtra(\"cekh\", cekh.toString());\n \t\t i.putExtra(\"ceks\", ceks.toString());\n \t\t startActivity(i);\n \t\t \n \t\t\t}\n \t\t});\n }\n \n if(name.equalsIgnoreCase(ceks)){ \n //langsung ke cek_harga = cek saldo\n }\n \n \n if(name.equalsIgnoreCase(pemb4)){ \n \t txtTitle.setText(\"Untuk sementara layanan ini tidak tersedia\");\n }\n \n \n }", "public String getText_txt_Pick_Up_Text(){\r\n\t\treturn txt_Pick_Up_Text.getText();\r\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jButton1 = new javax.swing.JButton();\n txtUrunSeriNo = new javax.swing.JTextField();\n txtSatisFiyati = new javax.swing.JTextField();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n txtUrunModel = new javax.swing.JTextField();\n txtUrunIsmi = new javax.swing.JTextField();\n txtAlisFiyati = new javax.swing.JTextField();\n txtAdet = new javax.swing.JTextField();\n jPanel2 = new javax.swing.JPanel();\n jLabel9 = new javax.swing.JLabel();\n jLabel8 = new javax.swing.JLabel();\n comboDepo = new javax.swing.JComboBox<>();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"Stok Ekle | Stok Otomasyonu |\");\n setFocusTraversalPolicyProvider(true);\n setLocation(new java.awt.Point(0, 0));\n setResizable(false);\n setType(java.awt.Window.Type.UTILITY);\n\n jButton1.setText(\"EKLE\");\n jButton1.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jButton1MouseClicked(evt);\n }\n });\n\n txtSatisFiyati.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));\n txtSatisFiyati.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyTyped(java.awt.event.KeyEvent evt) {\n txtSatisFiyatiKeyTyped(evt);\n }\n });\n\n jLabel2.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n jLabel2.setText(\"Ürün Seri No : \");\n\n jLabel3.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n jLabel3.setText(\"Ürün İsmi :\");\n\n jLabel4.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n jLabel4.setText(\"Ürün Model :\");\n\n jLabel5.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n jLabel5.setText(\"Adet :\");\n\n jLabel6.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n jLabel6.setText(\"Alış Fiyatı :\");\n\n jLabel7.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n jLabel7.setText(\"Satış Fiyatı :\");\n\n txtAlisFiyati.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyTyped(java.awt.event.KeyEvent evt) {\n txtAlisFiyatiKeyTyped(evt);\n }\n });\n\n txtAdet.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyTyped(java.awt.event.KeyEvent evt) {\n txtAdetKeyTyped(evt);\n }\n });\n\n jPanel2.setBackground(new java.awt.Color(48, 66, 105));\n\n jLabel9.setFont(new java.awt.Font(\"Tahoma\", 1, 24)); // NOI18N\n jLabel9.setForeground(new java.awt.Color(255, 255, 255));\n jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel9.setText(\"# Ürün Ekle #\");\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGap(40, 40, 40)\n .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, 234, Short.MAX_VALUE)\n .addGap(32, 32, 32))\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel9)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n jLabel8.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n jLabel8.setText(\"Depo :\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel8)\n .addComponent(jLabel7)\n .addComponent(jLabel6)\n .addComponent(jLabel5)\n .addComponent(jLabel4)\n .addComponent(jLabel3)\n .addComponent(jLabel2))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(comboDepo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(txtAlisFiyati, javax.swing.GroupLayout.DEFAULT_SIZE, 190, Short.MAX_VALUE)\n .addComponent(txtAdet)\n .addComponent(txtUrunModel)\n .addComponent(txtUrunIsmi)\n .addComponent(txtUrunSeriNo)\n .addComponent(txtSatisFiyati, javax.swing.GroupLayout.Alignment.TRAILING))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 276, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtUrunSeriNo, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel2))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtUrunIsmi, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel3))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtUrunModel, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel4))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtAdet, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel5))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtAlisFiyati, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel6))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtSatisFiyati, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(comboDepo, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel8))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n pack();\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view,\n int position, long id) {\n if (syrupM1.getSelectedItemPosition() < 1 || syrupE3.getSelectedItemPosition() < 1 || syrupN4.getSelectedItemPosition() < 1) {\n syrupM1.setSelection(syrupA2.getSelectedItemPosition());\n syrupE3.setSelection(syrupA2.getSelectedItemPosition());\n syrupN4.setSelection(syrupA2.getSelectedItemPosition());\n }\n }", "private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {\n String product_idee = pro_id.getText();\n try {\n \n //Data fetch from database\n String sql = \"Select * From add_new_product where Product_id = ? \";\n Connection con=DATABASE_CONNECTION.getConnection();\n PreparedStatement ps=con.prepareStatement(sql);\n ps.setString(1,product_idee);\n ResultSet rs=ps.executeQuery();\n \n if(rs.next()){\n String pnn= rs.getString(\"Product_name\");\n String desc= rs.getString(\"Description\");\n String cat=rs.getString(\"Category\");\n String bra= rs.getString(\"Brand\");\n pnn2.setText(pnn);\n pc1.setText(cat);\n pba.setText(bra);\n pds.setText(desc);\n \n \n // JOptionPane.showMessageDialog(this, \"Product Found\");\n \n }else{\n JOptionPane.showMessageDialog(this, \"Product Not Found\");\n }\n \n }catch(Exception e){\n System.out.println(\"error\"+e);\n }\n }", "@Override\n\t\t\t\t\t\tpublic void onItemSelected(AdapterView<?> parent,\n\t\t\t\t\t\t\t\tView view, int position, long id) {\n\t\t\t\t\t\t\tif(position!=0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tMyspinner sp = (Myspinner)mandilist.getSelectedItem();\n\t\t\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t\t\tencryptedgeoid = new Webservicerequest().Encrypt(sp.getValue());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\t\t\t\te.getMessage();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcategory3.addAll(get.getretailersList(encryptedgeoid));\t\n\t\t\t\t\t\t\t\tMyspinner[] redemo3 = new Myspinner[category3.size()];\n\t\t\t\t \t\t\t\tfor(int i=0; i<category3.size(); i++){\n\t\t\t\t \t\t\t\t\tredemo3[i] = new Myspinner(category3.get(i).get(\"2\"), category3.get(i).get(\"1\"), \"\");\n\t\t\t\t \t\t\t\t}\n\t\t\t\t \t\t\t\tArrayAdapter<Myspinner> adapter3 = new ArrayAdapter<Myspinner>(context, android.R.layout.simple_spinner_dropdown_item, redemo3);\n\t\t\t\t \t\t\t\tretailerslist.setAdapter(adapter3);\n\t\t\t\t\t\t\t\tArrayAdapter<String> adaptervillages = new ArrayAdapter<String>(context, android.R.layout.simple_spinner_dropdown_item, get.getVillageNames(encryptedgeoid));\n\t\t\t\t\t\t\t\tvillages.setAdapter(adaptervillages);\n\t\t\t\t\t\t\t\tvillages.setThreshold(3);\n\t\t\t\t\t\t\t\tvillages.setOnItemClickListener(new OnItemClickListener() {\n\n\t\t\t\t\t\t\t\t\t @Override\n\t\t\t\t\t\t\t\t\t public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\t\t\t\t\t\t\t InputMethodManager in = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);\n\t\t\t\t\t\t\t\t\t in.hideSoftInputFromWindow(villages.getWindowToken(), 0);\n\n\t\t\t\t\t\t\t\t\t }\n\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\tvillages.setAdapter(null);\n\t\t\t\t\t\t\t\tArrayList<HashMap<String, String>> category3=new ArrayList<HashMap<String,String>>();\n\t\t\t\t\t\t\t\tHashMap<String, String> map3=new HashMap<String, String>();\n\t\t\t\t \t\t\t\tmap3.put(\"1\",\"\");\n\t\t\t\t \t\t\t\tmap3.put(\"2\",\"Select Retailer\");\n\t\t\t\t \t\t\t\tcategory3.add(map3);\n\t\t\t\t \t\t\t\tMyspinner[] redemo3 = new Myspinner[category3.size()];\n\t\t\t\t \t\t\t\tfor(int i=0; i<category3.size(); i++){\n\t\t\t\t \t\t\t\t\tredemo3[i] = new Myspinner(category3.get(i).get(\"2\"), category3.get(i).get(\"1\"), \"\");\n\t\t\t\t \t\t\t\t}\n\t\t\t\t \t\t\t\tArrayAdapter<Myspinner> adapter3 = new ArrayAdapter<Myspinner>(context, android.R.layout.simple_spinner_dropdown_item, redemo3);\n\t\t\t\t \t\t\t\tretailerslist.setAdapter(adapter3); \t\t\t\t \t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "private void Proses() {\n ti = Double.valueOf(ktinggi.getText());\n bt = Double.valueOf(kberat.getText());\n \n if(jRadioButton1.isSelected()){\n h1 = (ti - 100) * 1;\n } else if (jRadioButton2.isSelected()){\n h1 = (ti - 104) * 1;\n }\n temp = Double.toString(h1.intValue());\n \n if (h1 < bt) {\n kideal.setText(temp);\n hasil.setText(\"Maaf \" + knama.getText() + \" , Sepertinya anda Overweight :( \");\n saran.setText(\"Banyaklah berolahraga dan hindari makanan berkolesterol\");\n } else if (h1 > bt) {\n kideal.setText(temp);\n hasil.setText(\"Maaf \" + knama.getText() + \" , Sepertinya anda Underweight :(\");\n saran.setText(\"Banyaklah mengkonsumsi makanan yang berkarbohidrat\");\n } else {\n kideal.setText(temp);\n hasil.setText(\"Hallo \" + knama.getText() + \" , Berat badan anda sudah ideal :)\");\n saran.setText(\"Lanjutkan pola makan teratur dan gaya hidup sehat :)\");\n }\n \n }", "private void save() {\n if (String.valueOf(tgl_pengobatanField.getText()).equals(null)\n || String.valueOf(waktu_pengobatanField.getText()).equals(null) ) {\n Toast.makeText(getApplicationContext(),\n \"Ada Yang Belum Terisi\", Toast.LENGTH_SHORT).show();\n } else {\n SQLite.insert(nama_pasien2,\n nama_dokter2,\n tgl_pengobatanField.getText().toString().trim(),\n waktu_pengobatanField.getText().toString(),\n keluhan_pasienField.getText().toString().trim(),\n hasil_diagnosaField.getText().toString().trim(),\n biayaField.getText().toString().trim());\n blank();\n finish();\n }\n }", "@Override\n public void onClick(DialogInterface dialog, int which) {\n etQualification.setText(qualificationList[which]);\n //dismissing the dialog when the user makes a selection.\n dialog.dismiss();\n }", "public void tampil_siswa(){\n try {\n Connection con = conek.GetConnection();\n Statement stt = con.createStatement();\n String sql = \"select id from nilai order by id asc\"; // disini saya menampilkan NIM, anda dapat menampilkan\n ResultSet res = stt.executeQuery(sql); // yang anda ingin kan\n \n while(res.next()){\n Object[] ob = new Object[6];\n ob[0] = res.getString(1);\n \n comboId.addItem(ob[0]); // fungsi ini bertugas menampung isi dari database\n }\n res.close(); stt.close();\n \n } catch (Exception e) {\n System.out.println(e.getMessage());\n }\n }", "@Override\n //nhan ket qua man hinh khac tra ve Main\n protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n if (requestCode == REQUEST_CODE_EDIT && resultCode == RESULT_OK && data != null){\n String name = data.getStringExtra(\"New\");\n txtName.setText(name);\n }\n super.onActivityResult(requestCode, resultCode, data);\n }", "@Override\n\tpublic void onItemSelected(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\tlong arg3) {\n\t\tsearchText = spinner1.getSelectedItem().toString();\n\t\tSystem.out.println(\"Selected option = \"+searchText);\n\t\t\n\t}", "@Override\n\t\t\t\t\t\tpublic void onItemSelected(AdapterView<?> parent,\n\t\t\t\t\t\t\t\tView view, int position, long id) {\n\t\t\t\t\t\t\tif(position!=0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tMyspinner sp = (Myspinner)districtlist.getSelectedItem();\n\t\t\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t\t\tencryptedgeoid = new Webservicerequest().Encrypt(sp.getValue());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\t\t\t\te.getMessage();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcategory2.addAll(get.getMandi(encryptedgeoid));\t\n\t\t\t\t\t\t\t\tMyspinner[] redemo2 = new Myspinner[category2.size()];\n\t\t\t\t \t\t\t\tfor(int i=0; i<category2.size(); i++){\n\t\t\t\t \t\t\t\t\tredemo2[i] = new Myspinner(category2.get(i).get(\"2\"), category2.get(i).get(\"1\"), \"\");\n\t\t\t\t \t\t\t\t}\n\t\t\t\t \t\t\t\tArrayAdapter<Myspinner> adapter2 = new ArrayAdapter<Myspinner>(context, android.R.layout.simple_spinner_dropdown_item, redemo2);\n\t\t\t\t \t\t\t\tmandilist.setAdapter(adapter2);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\tArrayList<HashMap<String,String>> category2=new ArrayList<HashMap<String,String>>();\n\t\t\t\t\t\t\t\tHashMap<String, String> map2=new HashMap<String, String>();\n\t\t\t\t \t\t\t\tmap2.put(\"1\",\"\");\n\t\t\t\t \t\t\t\tmap2.put(\"2\",\"Select Mandi\");\n\t\t\t\t \t\t\t\tcategory2.add(map2);\n\t\t\t\t\t\t\t\tMyspinner[] redemo2 = new Myspinner[category2.size()];\n\t\t\t\t \t\t\t\tfor(int i=0; i<category2.size(); i++){\n\t\t\t\t \t\t\t\t\tredemo2[i] = new Myspinner(category2.get(i).get(\"2\"), category2.get(i).get(\"1\"), \"\");\n\t\t\t\t \t\t\t\t}\n\t\t\t\t \t\t\t\tArrayAdapter<Myspinner> adapter2 = new ArrayAdapter<Myspinner>(context, android.R.layout.simple_spinner_dropdown_item, redemo2);\n\t\t\t\t \t\t\t\tmandilist.setAdapter(adapter2);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "@Override\n public void onClick(DialogInterface dialog, int which) {\n registerProgramme.setText(programme_level[which]);\n\n if(which==0) {\n session = new CharSequence[] {\"December 2016 - April 2017\"};\n registerSession.setText(session[0]); //set text first then let user pick\n }\n\n else\n {\n session = new CharSequence[]{\"September 2016 - January 2017\"};\n registerSession.setText(session[0]); //set text first then let user pick\n }\n }", "@Override\r\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n switch (position) {\r\n case 0:\r\n mode = 1;\r\n //mode = spinner.getSelectedItem().toString();\r\n break;\r\n case 1:\r\n mode = 2;\r\n //mode = spinner.getSelectedItem().toString();\r\n break;\r\n case 2:\r\n mode = 3;\r\n //mode = spinner.getSelectedItem().toString();\r\n break;\r\n }\r\n }", "private void save() {\r\n if (String.valueOf(txt_name.getText()).equals(\"\") || String.valueOf(txt_bagian.getText()).equals(\"\")|| String.valueOf(txt_address.getText()).equals(\"\")|| String.valueOf(txt_telp.getText()).equals(\"\")) {\r\n Toast.makeText(getApplicationContext(),\r\n \"Anda belum memasukan Nama atau ALamat ...\", Toast.LENGTH_SHORT).show();\r\n } else {\r\n SQLite.insert(txt_name.getText().toString().trim(),txt_bagian.getText().toString().trim(), txt_address.getText().toString().trim(), txt_telp.getText().toString().trim());\r\n Toast.makeText(getApplicationContext(),\"Berhasil Menambahkan Data\",Toast.LENGTH_SHORT).show();\r\n blank();\r\n finish();\r\n }\r\n }", "@Override\r\n public void onItemClick(AdapterView<?> parent, View view,\r\n int position, long id) {\n String Slecteditem = itemname[+position];\r\n Toast.makeText(getApplicationContext(), Slecteditem, Toast.LENGTH_SHORT).show();\r\n startActivity(new Intent(unlogin.this, product.class));\r\n }", "public void carrega_cidade() throws SQLException{\n String sql = \"SELECT nome FROM tb_cidades where uf='\"+cbUF.getSelectedItem()+\"'\"; \n PreparedStatement preparador = Conexao.conectar().prepareStatement(sql);\n \n ResultSet rs = preparador.executeQuery();\n cbCidade.removeAllItems();\n //passando valores do banco para o objeto result; \n try{ \n \n while(rs.next()){ \n \n String list = rs.getString(\"nome\"); //resgatando estado \n \n //popula combo_estadof com as informações colhidas \n cbCidade.addItem(list); \n \n } \n } catch (Exception e){ \n JOptionPane.showMessageDialog(null, \"Impossivel carregar Estados!\", \n \"ERROR - \", JOptionPane.ERROR_MESSAGE); \n } \n Conexao.desConectar();\n \n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n huruf = dataSandiItem.get(position).getHuruf();\n drajatX = dataSandiItem.get(position).getDerajat_lengan_x();\n drajatY = dataSandiItem.get(position).getDerajat_lengan_y();\n gambar = dataSandiItem.get(position).getGambar();\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n String SlectedCountry = countryNameThree[+position];\n Toast.makeText(getApplicationContext(), SlectedCountry, Toast.LENGTH_SHORT).show();\n\n }", "@Override\n public void onClick(View v) {\n\n userN =firstname.getText().toString();\n userL =lastName.getText().toString();\n gender = spin.getSelectedItem().toString();\n problem = reason.getText().toString();\n\n Intent intentsend = new Intent(getApplication(),profile.class);\n intentsend.putExtra(\"userN\",firstname.getText().toString());\n intentsend.putExtra(\"userL\", lastName.getText().toString());\n intentsend.putExtra(\"gender\",spin.getSelectedItem().toString());\n intentsend.putExtra(\"problem\",reason.getText().toString());\n startActivity(intentsend);\n }", "@Override\n public void onClick(View view) {\n\n new MaterialDialog.Builder(UserRegister.this)\n .title(R.string.choosegender)\n .items(R.array.gender)\n .itemsCallback(new MaterialDialog.ListCallback() {\n @Override\n public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) {\n et_gender.setText(text);\n }\n })\n .show();\n\n\n }", "@Override\n protected void onPostExecute(final String[] medica) {\n ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(getApplicationContext(),R.layout.spinner_item, medica);\n spinnerArrayAdapter.setDropDownViewResource(R.layout.spinner_item); // The drop down view\n spinner.setAdapter(spinnerArrayAdapter);\n\n spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {\n medicamento = spinner.getSelectedItem().toString();\n Toast.makeText(getApplicationContext(), medicamento,\n Toast.LENGTH_LONG).show();\n }\n\n public void onNothingSelected(AdapterView<?> parent) {\n }\n });\n\n }", "public HoyNoCirculaGraf() {\n initComponents();\n cbplaca.removeAllItems();\n cbdia.removeAllItems();\n cbcolor.removeAllItems();\n cbplaca.addItem(\"0\");\n cbplaca.addItem(\"1\");\n cbplaca.addItem(\"2\");\n cbplaca.addItem(\"3\");\n cbplaca.addItem(\"4\");\n cbplaca.addItem(\"5\");\n cbplaca.addItem(\"6\");\n cbplaca.addItem(\"7\");\n cbplaca.addItem(\"8\");\n cbplaca.addItem(\"9\");\n cbcolor.addItem(\"amarillo\");\n cbcolor.addItem(\"rosa\");\n cbcolor.addItem(\"rojo\");\n cbcolor.addItem(\"verde\");\n cbcolor.addItem(\"azul\");\n cbdia.addItem(\"lunes\");\n cbdia.addItem(\"martes\");\n cbdia.addItem(\"miercoles\");\n cbdia.addItem(\"jueves\");\n cbdia.addItem(\"viernes\");\n cbdia.addItem(\" \");\n cbcolor.addItem(\" \");\n cbplaca.addItem(\" \");\n \n revisar.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n String u1 =(String) cbplaca.getSelectedItem();\n String u2 =(String) cbcolor.getSelectedItem();\n String u3 =(String) cbdia.getSelectedItem();\n NoCircula NC = new NoCircula();\n if(u1== \" \" && u2== \" \" && u3!= \" \")\n {\n String imp = NC.getTerminacion(u3);\n imprimirtxt.setText(imp);\n \n }\n if(u1== \" \" && u2!= \" \" && u3== \" \"){\n String imp = NC.getColor(u2);\n imprimirtxt.setText(imp);\n \n }\n if(u1!= \" \" && u2== \" \" && u3== \" \"){\n String imp = NC.getByPlaca(u1);\n imprimirtxt.setText(imp);\n }\n \n \n }\n });\n \n }", "private void show_input() {\n clear();\n\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"ادخل رقم البطاقة\");\n\n// Set up the input\n final EditText input = new EditText(this);\n// Specify the type of input expected; this, for example, sets the input as a password, and will mask the text\n input.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_TEXT_VARIATION_PASSWORD);\n builder.setView(input);\n\n// Set up the buttons\n builder.setPositiveButton(\"تم\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n\n String Customer_id = input.getText().toString();\n getMenuID_Card(getCardURL, Customer_id);\n Log.d(\"karrar\", \"getMenuID_Card func \" + Customer_id);\n session.setScanfor(\"0\");\n\n }\n });\n// builder.setNegativeButton(\"الغاء\", new DialogInterface.OnClickListener() {\n// @Override\n// public void onClick(DialogInterface dialog, int which) {\n// dialog.cancel();\n// }\n// });\n\n builder.show();\n }", "@Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n\n select_nation = String.valueOf(nationarryList.get(i));\n Log.v(\"알림\", \"select_nation\" + select_nation);\n Log.i(TAG, \"Spinner selected item = \"+ select_nation);\n Intent nationintent = new Intent(Register2Activity.this,Story_Activity.class);\n /*nationintent.putExtra(\"it_nation\", select_nation);*/ // 쉐어드 사용 //\n\n\n spinnertext_naion.setText(select_nation);\n\n if(select_nation.equals(\"미국\")){\n nations = \"미국\";\n Log.v(\"알림\", \"nations\" + nations);\n nationi = 1;\n img_nation = (BitmapDrawable)getResources().getDrawable(R.drawable.usaflag);\n\n\n // 미국 국기 사진 가져와서\n // mnation.setImageDrawable(img_nation);// 미국 국기 사진 출력\n } else if(select_nation.equals(\"중국\")){\n nations = \"중국\";\n nationi = 2;\n img_nation = (BitmapDrawable)getResources().getDrawable(R.drawable.chineseflag);\n\n\n\n //중국 국기 사진 가져와서\n // mnation.setImageDrawable(img_nation);// 중국 사진 출력\n } else if(select_nation.equals(\"한국\")){\n nations = \"한국\";\n nationi = 3;\n img_nation = (BitmapDrawable)getResources().getDrawable(R.drawable.koreaflag);\n\n\n\n //한국 국기 사진 가져와서\n // mnation.setImageDrawable(img_nation);// 한국 사진 출력\n } else if(select_nation.equals(\"일본\")){\n nations = \"일본\";\n nationi = 4;\n img_nation = (BitmapDrawable)getResources().getDrawable(R.drawable.japanflag);\n\n\n //일본 국기 사진 가져와서\n // mnation.setImageDrawable(img_nation);// 일본 사진 출력\n\n }\n\n\n\n\n }", "private void ComboUserActionPerformed(java.awt.event.ActionEvent evt) {\n if(ComboUser.getSelectedItem().equals(\"title\")){\n \n selected=1;\n }\n else if(ComboUser.getSelectedItem().equals(\"author\"))\n {\n selected=2;\n }\n else if(ComboUser.getSelectedItem().equals(\"subject\"))\n {\n selected=3;\n }\n }", "@Override\n public void onItemSelected(MaterialSpinner view, int position, long id, Object item) {\n\n if(item.equals(\"Other\")){\n othereditText.setVisibility(View.VISIBLE);\n serviceSelected = othereditText.getText().toString().trim();\n }else{\n serviceSelected = item+\"\";\n }\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n String item = parent.getItemAtPosition(position).toString();\n\n // Showing selected spinner item\n Toast.makeText(parent.getContext(), \"Selected: \" + item, Toast.LENGTH_LONG).show();\n\n }", "@Override\n public void onClick(DialogInterface dialogInterface, int i) {\n nearest_city = input_add_new_nearest_city.getText().toString();\n\n db_table_result_rows_list.remove(0);\n db_table_result_rows_list.add(nearest_city);\n\n ArrayAdapter<String> spinnerArrayAdapterNearestCity = new ArrayAdapter<String>(AddNewLocation.this.getApplicationContext(), android.R.layout.simple_spinner_item, db_table_result_rows_list);\n spinnerArrayAdapterNearestCity.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); // The drop down view\n spinnerNearestCities.setAdapter(spinnerArrayAdapterNearestCity);\n\n spinnerNearestCities.setSelection(((ArrayAdapter<String>)spinnerNearestCities.getAdapter()).getPosition(nearest_city));\n }" ]
[ "0.71610695", "0.7119756", "0.70564026", "0.68392617", "0.68239486", "0.67560506", "0.671376", "0.6694796", "0.6665385", "0.6636487", "0.6635822", "0.66355854", "0.6536804", "0.6526287", "0.64639354", "0.6405869", "0.6376017", "0.6360446", "0.63550043", "0.63185644", "0.6264785", "0.62581205", "0.62537503", "0.62456685", "0.61943495", "0.6162656", "0.6152914", "0.6138878", "0.61312324", "0.61293864", "0.61262023", "0.6103965", "0.60965437", "0.60819787", "0.60626864", "0.6047679", "0.60426927", "0.6037708", "0.6032231", "0.6031842", "0.60273224", "0.6023649", "0.60147476", "0.60095215", "0.6006217", "0.6005013", "0.59947354", "0.5979173", "0.59658617", "0.5963096", "0.59515285", "0.5950742", "0.5939607", "0.59351206", "0.5920348", "0.59127694", "0.59061384", "0.5902084", "0.5898448", "0.5895968", "0.58918905", "0.588025", "0.58749336", "0.58741266", "0.5873649", "0.5873086", "0.5870993", "0.5867844", "0.5865899", "0.586261", "0.58435965", "0.5838998", "0.58371633", "0.5836581", "0.58356893", "0.58271927", "0.58262974", "0.58178127", "0.58123326", "0.5810343", "0.5809864", "0.58019966", "0.5798364", "0.5798292", "0.57905686", "0.5788429", "0.57803106", "0.57790804", "0.57788444", "0.57740587", "0.5770205", "0.577001", "0.5754021", "0.57523507", "0.5752195", "0.5751491", "0.574992", "0.5746334", "0.57458985", "0.5745626", "0.5743427" ]
0.0
-1
pDialog = new ProgressDialog(this); pDialog.setCancelable(false); pDialog.setMessage("Loading ..."); pDialog.show();
private void getCariSemua(){ UserAPIService api = Config.getRetrofit().create(UserAPIService.class); Call<Value> call = api.cari_semua_like(txt_kodeMK.getSelectedItem().toString(),txt_kelas.getSelectedItem().toString()); call.enqueue(new Callback<Value>() { @Override public void onResponse(Call<Value> call, Response<Value> response) { // pDialog.dismiss(); String value1 = response.body().getStatus(); if (value1.equals("1")) { Value value = response.body(); resultAlls = new ArrayList<>(Arrays.asList(value.getResult())); adapter = new RecyclerAdapterListAll(resultAlls, getApplicationContext()); recyclerView.setAdapter(adapter); }else{ Toast.makeText(ListPonpesActivity.this,"Maaf Data Tidak Ada",Toast.LENGTH_SHORT).show(); } } @Override public void onFailure(Call<Value> call, Throwable t) { // pDialog.dismiss(); Toast.makeText(ListPonpesActivity.this,"Respon gagal",Toast.LENGTH_SHORT).show(); Log.d("Hasil internet",t.toString()); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void showProgressDialog(){\n progressDialog=ProgressDialog.show(context,\"\",\"Loading...Please wait...\");\n\n\n }", "private Dialog buildLoadingDialog() {\n ProgressDialog dialog = new ProgressDialog(this);\n dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n dialog.setMessage(getText(R.string.dialog_loading));\n dialog.setIndeterminate(true);\n dialog.setCancelable(false);\n return dialog;\n }", "protected void showLoading()\n {\n progressBar = new ProgressDialog(this);\n progressBar.setTitle(\"Loading\");\n progressBar.setMessage(\"Wait while loading...\");\n progressBar.setCancelable(false); // disable dismiss by tapping outside of the dialog\n progressBar.show();\n }", "private void creatDialog() {\n \t mDialog=new ProgressDialog(this);\n \t mDialog.setTitle(\"\");\n \t mDialog.setMessage(\"正在加载请稍后\");\n \t mDialog.setIndeterminate(true);\n \t mDialog.setCancelable(true);\n \t mDialog.show();\n \n\t}", "@Override\n protected void onPreExecute() {\n\n dialog = new ProgressDialog(context);\n dialog.setTitle(\"Loading Contents\");\n dialog.setMessage(\"Doing something interesting ...\");\n dialog.setIndeterminate(true);\n dialog.setCancelable(false);\n dialog.show();\n }", "public void showProgressDialog() {\r\n progressDialog.setMessage(getResources().getString(R.string.text_loading));\r\n progressDialog.setCancelable(false);\r\n progressDialog.show();\r\n }", "@Override\n\t\tprotected void onPreExecute()\n\t\t{\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog = new ProgressDialog(MainActivity.this);\n\t\t\tpDialog.setMessage(\"Loading....\");\n\t\t\tpDialog.setCancelable(true);\n\t\t\tpDialog.show();\n\t\t}", "protected void onPreExecute() {\r\n \tdialog = new ProgressDialog(context);\r\n \t\tdialog.setMessage(\"Loading...\");\r\n \t\tdialog.show();\r\n }", "@Override\n protected void onPreExecute() {\n progressDialog= new ProgressDialog(getActivity());\n progressDialog.setMessage(\"loading..\");\n progressDialog.setIndeterminate(false);\n progressDialog.show();\n }", "private void displayLoader() {\n pDialog = new ProgressDialog(DangKyActivity.this);\n pDialog.setMessage(\"Vui lòng đợi trong giây lát...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\t \tprotected void onPreExecute() {\n\t\t try {\n\t\t\t \tpd=new ProgressDialog(Styles_Dialog.this);\n\t\t\t \tpd.setMessage(\"Loading\");\n\t\t\t \tpd.show();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t}\n\t\t \t\n\t\t \t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tpdia = new ProgressDialog(mContext);\n\t\t\tpdia.setMessage(\"Loading...\");\n\t\t\tpdia.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "private void displayLoader() {\n pDialog = new ProgressDialog(AddReviewActivity.this);\n pDialog.setMessage(\"Adding Review...Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog = new ProgressDialog(activity);\n\t\t\tpDialog.setMessage(\"Loading...\");\n\t\t\tpDialog.setIndeterminate(false);\n\t\t\tpDialog.setCancelable(true);\n\t\t\tpDialog.show();\n\t\t}", "@Override\n protected void onPreExecute() {\n\n\n dialog = new ProgressDialog(MainArea.this);\n dialog.setTitle(\"Loading Results\");\n dialog.setMessage(\"Please Wait Results Are Loading For You....\");\n dialog.setCanceledOnTouchOutside(false);\n dialog.show();\n super.onPreExecute();\n }", "private void progressStuff() {\n cd = new ConnectionDetector(getActivity());\n parser = new JSONParser();\n progress = new ProgressDialog(getActivity());\n progress.setMessage(getResources().getString(R.string.loading));\n progress.setIndeterminate(false);\n progress.setCancelable(true);\n // progress.show();\n }", "@Override\r\n\t\tprotected void onPreExecute() {\r\n\t\t\tsuper.onPreExecute();\r\n\t\t\tpDialog = new ProgressDialog(getActivity());\r\n\t\t\tpDialog.setMessage(\"Loading...\");\r\n\t\t\tpDialog.setIndeterminate(false);\r\n\t\t\tpDialog.setCancelable(false);\r\n\t\t\tpDialog.show();\r\n\t\t}", "void showProgressLoading(Context context, boolean isCancelable) {\n\n progressDialog = new ProgressDialog(context);\n progressDialog.setIndeterminate(true);\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progressDialog.setMessage(\"Loading...\");\n progressDialog.setCancelable(isCancelable);\n progressDialog.setCanceledOnTouchOutside(false);\n\n progressDialog.show();\n\n }", "protected final void showLoadingDialog() {\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pd = new ProgressDialog(activity);\n pd.setMessage(\"Loading, Please Wait.....\");\n pd.setCancelable(false);\n pd.show();\n }", "public void showProgressDialog() {\n if (mProgressDialog == null) {\n mProgressDialog = new ProgressDialog(this);\n mProgressDialog.setCancelable(false);\n mProgressDialog.setCanceledOnTouchOutside(false);\n mProgressDialog.setMessage(getString(R.string.msg_loading));\n mProgressDialog.setIndeterminate(true);\n }\n mProgressDialog.show();\n }", "private void showSpinerProgress() {\n dialog.setMessage(\"Loading\");\n//\n// dialog.setButton(ProgressDialog.BUTTON_POSITIVE, \"YES\", new DialogInterface.OnClickListener() {\n// @Override\n// public void onClick(DialogInterface dialog, int which) {\n//\n// }\n// });\n\n //thiet lap k the huy - co the huy\n dialog.setCancelable(false);\n\n //show dialog\n dialog.show();\n Timer timer = new Timer();\n timer.schedule(new TimerTask() {\n @Override\n public void run() {\n dialog.dismiss();\n }\n }, 20000000);\n }", "public void initProgressLoader() {\n progressDialog = new ProgressDialog(this);\n progressDialog.setIndeterminate(true);\n progressDialog.setCancelable(false);\n }", "private void showDialog(){\n progress = new ProgressDialog(this);\n progress.setTitle(getString(R.string.progress_dialog_loading));\n progress.setMessage(getString(R.string.progress_dialog_authenticating_with_firebase));\n progress.setCancelable(false);\n progress.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tprogressDialog = ProgressDialog.show(MainActivity.this, \"\",\n\t\t\t\t\t\"Loading...\");\n\t\t}", "private void displayLoader() {\n pDialog = new ProgressDialog(RegisterActivity.this);\n pDialog.setMessage(\"Signing Up.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tmyDialog = ProgressDialog.show\n\t\t\t\t\t(\n\t\t\t\t\t\t\tgetActivity(),\n\t\t\t\t\t\t\t\"Loading...\",\n\t\t\t\t\t\t\t\"Please Wait\",\n\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t);\n\t\t}", "@Override\n\tprotected void onPreExecute() {\n\t\t\n\t\t pDialog = new ProgressDialog(context);\n\t\t\ttry{\n\t\t\t\tthis.pDialog.setMessage(\"Please wait ...\");\n\t\t this.pDialog.setIndeterminateDrawable(context.getResources().getDrawable(R.drawable.red_progress));\n\t\t this.pDialog.setIndeterminate(false);\n\t\t this.pDialog.setCancelable(false);\n\t\t this.pDialog.show();\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\te.getMessage();\n\t\t\t}\n\t}", "private void showProgressDialog()\n {\n if (showProgressDialog && !getStatus().equals(AsyncTask.Status.FINISHED)) {\n //show the dialog if valid activity. If the OS is lollipop or higher then set the theme.\n //dialog = ProgressDialog.show(activity, \"In progress..\", message, true);\n if (Build.VERSION.SDK_INT >= 21) {\n dialog = new ProgressDialog(activity, R.style.progressoAlertDialogStyle);\n dialog.setTitle(\"In progress..\");\n dialog.setMessage(message);\n dialog.setIndeterminate(true);\n dialog.show();\n }\n else {\n dialog = ProgressDialog.show(activity, \"In progress..\", message, true);\n }\n\n dialog.setCancelable(false);\n } \n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(TalkActivity.this);\n pDialog.setMessage(getResources().getString(R.string.loading));\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n public void showloading(String message) {\n progressDialog = new ProgressDialog(getActivity());\n progressDialog.setMessage(message);\n progressDialog.setIndeterminate(true);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(Integrationforkhalti.this);\n pDialog.setMessage(\"Loading Please wait...\");\n pDialog.setIndeterminate(true);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n mProgressDialog = new ProgressDialog(getActivity());\n mProgressDialog.setMessage(getString(R.string.loading_text));\n mProgressDialog.setCancelable(false);\n }", "private void showProgressDialog() {\n if (progressDialog == null) {\n progressDialog = new ProgressDialog(getContext());\n }\n\n progressDialog.setTitle(R.string.dialog_title);\n progressDialog.setMessage(getResources().getString(R.string.dialog_message));\n progressDialog.setCancelable(false);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n /* mProgress.setMessage(\"Please Wait\");\n mProgress.setCancelable(false);\n mProgress.show();*/\n String msg = \"Please Wait....\";\n cd.showProgressDialog(msg);\n }", "private void showLoadingDialogue(final String loadingMessage) {\n progressDialog.setMessage(loadingMessage);\n progressDialog.setCancelable(false);\n progressDialog.setIndeterminate(false);\n progressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() \n\t\t{\n\t\t\t\n\t\t\tdialog = new ProgressDialog(AddFoodAdvActivity.this);\n\t\t\tdialog.setMessage(\"Loading...\");\n\t\t\tdialog.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "private void showDialog() {\n try {\n pDialog.setMessage(getString(R.string.please_wait));\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.setCanceledOnTouchOutside(false);\n pDialog.show();\n } catch (Exception e) {\n // TODO: handle exception\n }\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tdl = ProgressDialog.show(getActivity(), \"Thông báo\", \"Loading...\",\n\t\t\t\t\ttrue, false);\n\t\t\tdl.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n protected void onPreExecute()\n {\n // Create a new progress dialog\n progressDialog = new ProgressDialog(MainActivity.this);\n // Set the progress dialog spinner progress bar\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n // Set the dialog title to 'Loading...'\n progressDialog.setTitle(\"Loading...\");\n // Set the dialog message to 'Loading application View, please wait...'\n progressDialog.setMessage(\"Loading application, please wait...\");\n // This dialog can't be canceled by pressing the back key\n progressDialog.setCancelable(false);\n // This dialog isn't indeterminate\n progressDialog.setIndeterminate(false);\n // The maximum number of items is 100\n progressDialog.setMax(100);\n // Set the current progress to zero\n progressDialog.setProgress(0);\n // Display the progress dialog\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progressDialog.setMessage(\"Please wait. Loading...\");\n progressDialog.setCanceledOnTouchOutside(false);\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n pDialog = new ProgressDialog(getActivity());\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(false);\n pDialog.setIndeterminate(false);\n pDialog.setMax(100);\n pDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n pDialog.show();\n// progressBar.setVisibility(View.VISIBLE);\n// progressBar.setProgress(0);\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n\n dialog = new ProgressDialog(AddFoodAdvActivity.this);\n dialog.setMessage(\"Please Wait...!\");\n dialog.show();\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n showProgressDialog(R.string.please_wait);\n //showDialog(progress_bar_type);\n }", "@Override\r\n\tprotected void onPreExecute()\r\n\t{\r\n\t\tprogress = new ProgressDialog(ctx);\r\n\t\tprogress.setTitle(\"Retrieving Parking Information\");\r\n\t\tprogress.setMessage(\"Please wait.\");\r\n\t\tprogress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\r\n\t\tprogress.show();\r\n\t\tsuper.onPreExecute();\r\n\t}", "@Override\n protected void onPreExecute() {\n progressDialog = new ProgressDialog(getActivity());\n progressDialog.setTitle(getResources().getString(R.string.please_wait));\n progressDialog.setMessage(getResources().getString(R.string.fetching_data));\n progressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n // Showing progress dialog\n pDialog = new ProgressDialog(thisContext);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(true);\n pDialog.show();\n\n }", "private void displayProgressDialog() {\n pDialog.setMessage(\"Logging in.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\r\n \tprotected void onPreExecute() {\n \t\tsuper.onPreExecute();\r\n \t\tpdia = new ProgressDialog(Regmember.this);\r\n \t\tpdia.setCanceledOnTouchOutside(false);\r\n pdia.setMessage(\"Dhiraj rakh..........\");\r\n pdia.show(); \r\n \t}", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n this.dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n this.dialog.setCancelable(false);\n this.dialog.show();\n }", "@Override\n protected void onPreExecute() {\n pDialog = new ProgressDialog(homeActivity);\n pDialog.setMessage(\"Retrieving Details... \");\n // pDialog.setMax(16);\n pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\n pDialog.setCancelable(false);\n pDialog.show();\n\n\n }", "public void onPreExecute() {\n progressDialog.show();\n }", "@Override\r\n\t protected void onPreExecute() {\n\t super.onPreExecute();\r\n\t progressDialog = new ProgressDialog(UDMap.this);\r\n\t progressDialog.setMessage(\"Loading the best way...\");\r\n\t progressDialog.setIndeterminate(true);\r\n\t progressDialog.show();\r\n\t }", "void showProgressDialog();", "void showProgressDialog();", "public void showProgressDialog() {\n pd = new ProgressDialog(this);\n pd.setMessage(\"Renting film...\");\n pd.show();\n }", "protected void onPreExecute() {\n try {\n this.dialog.setMessage(getContext().getResources().getString(R.string.loading));\n this.dialog.show();\n } catch (Exception ex) {\n Log.e(null, ex);\n }\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog1 = new ProgressDialog(Doctorslist.this);\n\t\t\tpDialog1.setMessage(\"Loading ...\");\n\t\t\tpDialog1.setIndeterminate(false);\n\t\t\tpDialog1.setCancelable(false);\n\t\t\tpDialog1.show();\n\t\t}", "public void showProgressDialog() {\n try {\n if (progressDialog == null) {\n try {\n progressDialog = new ProgressDialog(self);\n progressDialog.show();\n progressDialog.setCancelable(false);\n } catch (Exception e) {\n progressDialog = new ProgressDialog(self.getParent());\n progressDialog.show();\n progressDialog.setCancelable(false);\n e.printStackTrace();\n }\n } else {\n if (!progressDialog.isShowing())\n progressDialog.show();\n }\n } catch (Exception e) {\n progressDialog = new ProgressDialog(self);\n progressDialog.show();\n progressDialog.setCancelable(false);\n e.printStackTrace();\n }\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n loading = ProgressDialog.show(this.context, \"Fetching Data\",\"Please Wait...\",true,true);\n }", "private void showProgressDialog() {\n mProgressDialog = AppDialog.showProgressDialog(this);\n mProgressDialog.show();\n }", "@Override\n protected void onPreExecute() {\n asyncDialog.setMessage(\"Loading...\");\n //show dialog\n asyncDialog.show();\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n progress = new ProgressDialog(hostContext);\n progress.setMessage(\"Wait while books are being downloaded...\");\n progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progress.show();\n }", "public void showProgress2(){\n// if (mHandler==null){\n// mHandler = new Handler(Looper.getMainLooper());\n// }\n new Handler(Looper.getMainLooper()).post(new Runnable() {\n @Override\n public void run() {\n loadingDialog = new Dialog(BaseActivity.this);\n loadingDialog.setTitle(\"Loading data..\");\n loadingDialog.setContentView(R.layout.loading);\n loadingDialog.show();\n\n }\n });\n// mHandler.post(new Runnable() {\n// @Override\n// public void run() {\n// loadingDialog = new Dialog(BaseActivity.this);\n// loadingDialog.setTitle(\"Loading data..\");\n// loadingDialog.setContentView(R.layout.loading);\n// loadingDialog.show();\n//\n// }\n// });\n }", "private void displayProgressDialog() {\n pDialog.setMessage(\"Logging In.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\t// TODO Auto-generated method stub\n\t\t\tsuper.onPreExecute();\n\t\t\tpd = ProgressDialogUtil.createDialogNoTitle(context, \"loading...\");\n\t\t\tpd.show();\n\t\t}", "protected void createProgressDialog() {\r\t\tif (pd == null) {\r\t\t\tpd = new ProgressDialog(this);\r\t\t\tpd.setCanceledOnTouchOutside(false);\r\t\t\tpd.getWindow().setGravity(Gravity.CENTER);\r\t\t\tpd.setOnCancelListener(new DialogInterface.OnCancelListener() {\r\t\t\t\t@Override\r\t\t\t\tpublic void onCancel(DialogInterface dialogInterface) {\r\t\t\t\t\tonPdCancel();\r\t\t\t\t}\r\t\t\t});\r\t\t}\r\t}", "private void showLoadingDialog() {\n mDefaultLoadingDialogFragment = new DefaultLoadingDialogFragment();\n mDefaultLoadingDialogFragment.show(getChildFragmentManager(), \"loadingDialog\");\n }", "@Override\n\t protected void onPreExecute() {\n\t super.onPreExecute();\n\t \n\t progressDialog= new Dialog(ListKotaActivity.this);\n\t progressDialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);\n\t progressDialog.setContentView(R.layout.progress);\n\t progressDialog.setCancelable(false);\n\t progressDialog.show();\t \n\t }", "@Override\n \t\tprotected void onPreExecute() \n \t\t{\n \t\t\t//Create a new progress dialog\n \t\t\tprogressDialog = new ProgressDialog(MainActivity.this);\n \t\t\t//Set the progress dialog to display a horizontal progress bar \n \t\t\tprogressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n \t\t\t//Set the dialog title to 'Loading...'\n \t\t\tprogressDialog.setTitle(\"Loading Game...\");\n \t\t\t//Set the dialog message to 'Loading application View, please wait...'\n \t\t\tprogressDialog.setMessage(\"Please wait...\");\n \t\t\t//This dialog can't be canceled by pressing the back key\n \t\t\tprogressDialog.setCancelable(false);\n \t\t\t//This dialog isn't indeterminate\n \t\t\tprogressDialog.setIndeterminate(false);\n \t\t\t//The maximum number of items is 100\n \t\t\tprogressDialog.setMax(100);\n \t\t\t//Set the current progress to zero\n \t\t\tprogressDialog.setProgress(0);\n \t\t\t//Display the progress dialog\n \t\t\tprogressDialog.show();\n \t\t}", "@Override\n protected void onPreExecute() {\n String msg = \"Please Wait....\";\n cd.showProgressDialog(msg);\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tshowLoadingProgressDialog();\n\t\t}", "@Override\n protected void onPreExecute() {\n showLoadingProgressDialog();\n }", "@Override\n protected void onPreExecute() {\n showLoadingProgressDialog();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n pDialog = new ProgressDialog(Resume_create_employee.this);\n pDialog.setMessage(\"Loading...\");\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(MainActivity.this);\n pDialog.setMessage(\"Processing Request...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "@Override\r\n protected void onPreExecute() {\n if( progressDialog == null ) {\r\n progressDialog = ProgressDialog.show( context, context.getString(R.string.pref_sync_callings_now_title),\"\");\r\n }\r\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(DetailActivity.this);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(true);\n pDialog.show();\n }", "@Override\r\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\r\n\t\t\tpDialog = new ProgressDialog(SingleRecord.this);\r\n\t\t\tpDialog.setMessage(\"downloading...\");\r\n\t\t\tpDialog.setIndeterminate(false);\r\n\t\t\tpDialog.setCancelable(true);\r\n\t\t\r\n\t\t\tpDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\r\n\t\t\tpDialog.show();\r\n\t\t\tpDialog.getWindow().setGravity(Gravity.BOTTOM);\r\n\t\t}", "@Override\n protected void onPreExecute() {\n\n this.dialog.setMessage(\"Please wait ...\");\n this.dialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\taProgressDialog = new ProgressDialog(TargetProducts.this);\n\t\t\taProgressDialog.setMessage(\"Loading Report...\");\n\t\t\taProgressDialog.setIndeterminate(true);\n\t\t\taProgressDialog.setCanceledOnTouchOutside(true);\n\t\t\taProgressDialog.show();\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\taProgressDialog = new ProgressDialog(TargetProducts.this);\n\t\t\taProgressDialog.setMessage(\"Loading Report...\");\n\t\t\taProgressDialog.setIndeterminate(true);\n\t\t\taProgressDialog.setCanceledOnTouchOutside(true);\n\t\t\taProgressDialog.show();\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\t\n\t\t\tdialog = new ProgressDialog(BookingConfirmationScreen.this);\n\t\t\tdialog.setIndeterminate(false);\n\t\t\tdialog.setCancelable(true);\n\t\t\tdialog.show();\n\t\t\t\n\t\t\t\n\t\t}", "@Override\n protected void onProgressUpdate(Integer... values) {\n super.onProgressUpdate(values);\n progress = new ProgressDialog(activity);\n progress.setMessage(\"please wait.. \");\n progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progress.setIndeterminate(true);\n progress.setCancelable(false);\n progress.show();\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tpdia = new ProgressDialog(mContext);\n\t\t\tpdia.setMessage(\"Loading Circles...\");\n\t\t\tpdia.show();\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n // // pDialog = new ProgressDialog(getContext());\n pDialog = new ProgressDialog(context);\n pDialog.setMessage(\"Cargando Información\");\n pDialog.setCancelable(true);\n pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n pDialog.show();\n\n }", "public void showCustomLoadingDialog() {\n\n //..show gif\n viewDialog.showDialog();\n final Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n //...here i'm waiting 5 seconds before hiding the custom dialog\n //...you can do whenever you want or whenever your work is done\n viewDialog.hideDialog();\n }\n }, 1000);\n }", "public void showProgressDialog() {\n showProgressDialog(null);\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n // Show the progress in load\n pDialog = new ProgressDialog(UpdateTimeTable.this);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(false);\n pDialog.show();\n \n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n progressDialog = new ProgressDialog(AiutaGliAltri.this);\n progressDialog.setMessage(\"Sto Cercando!\");\n progressDialog.setIndeterminate(true);\n progressDialog.setCanceledOnTouchOutside(false);\n progressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tprogressDialog = new ProgressDialog(ListActivity.this);\n\t\t\tprogressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\n\t\t\tprogressDialog.setMessage(\"Loading Programs. .\");\n\t\t\tprogressDialog.setCancelable(false);\n\n\t\t\tprogressDialog.show();\n\t\t}", "private void showProgress(String message) {\n \tif(mProgress==null){\n \t\tmProgress = new ProgressDialog(stActivity);\n\t mProgress.setMessage(message);\n\t mProgress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\t mProgress.setIndeterminate(true);\n\t mProgress.setCancelable(false); \n\t mProgress.show();\n \t}\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(context);\n pDialog.setMessage(\"Fetching videolists..\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(true);\n pDialog.show();\n }", "@Override\n\tprotected void onPreExecute() {\n\t\tsuper.onPreExecute();\n\n\t\tprogress = ProgressDialog.show(act, \"\", \"Please wait ...\", true);\n\t\talert = new AlertDialog.Builder(act);\n\n\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tdialog = new ProgressDialog(BookingConfirmationScreen.this);\n\t\t\tdialog.setIndeterminate(false);\n\t\t\tdialog.setCancelable(true);\n\t\t\tdialog.show();\n\n\t\t}", "@Override\r\n\t\t protected void onPreExecute() {\n \t\tprogress= ProgressDialog.show(\r\n \t\t\t\tDetailProgramActivity.this, \r\n \t\t\t\t\"\", \r\n \t\t\t\tgetString(R.string.loading_data), \r\n \t\t\t\ttrue);\r\n \t}", "private void showProgressIndication() {\n Log.i(TAG, \"loading contacts... \");\n // TODO: make this be a no-op if the progress indication is\n // already visible with the exact same title and message.\n\n dismissProgressIndication(); // Clean up any prior progress indication\n\n mProgressDialog = new ProgressDialog(this);\n mProgressDialog.setMessage(this.getResources().getString(R.string.contact_list_loading));\t\n mProgressDialog.setIndeterminate(true);\n mProgressDialog.setCancelable(false);\n mProgressDialog.show();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\ttry {\n\t\t\t\tdialog.setIndeterminate(false);\n\t\t\t\tdialog.setMax(100);\n\t\t\t\tdialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n\t\t\t\tdialog.setCancelable(false);\n\t\t\t\tdialog.show();\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "public void initLoadingPage(Context c) {\n\n LayoutInflater inflater = (LayoutInflater) c.getSystemService( c.LAYOUT_INFLATER_SERVICE);\n final AlertDialog.Builder nameBuilder = new AlertDialog.Builder(c);\n View alertDiaView = inflater.inflate(R.layout.activity_loading_page,null);\n nameBuilder.setView(alertDiaView);\n\n avi = (AVLoadingIndicatorView) alertDiaView.findViewById(R.id.avi);\n avi.smoothToShow();\n\n\n int val= (int) (130 * Resources.getSystem().getDisplayMetrics().density);//dp to px\n alertDialog= nameBuilder.show();\n alertDialog.getWindow().setLayout(val ,val);\n\n\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n pDialog = new ProgressDialog(Activity_List.this);\n pDialog.setMessage(\"Loading spots. Please wait...\");\n\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }", "void dismissProgressLoading() {\n if (progressDialog != null) {\n progressDialog.dismiss();\n }\n }" ]
[ "0.8556975", "0.8352341", "0.8278571", "0.82200515", "0.81206495", "0.81117713", "0.81087923", "0.80747885", "0.80385137", "0.8009662", "0.79978704", "0.79510033", "0.7948115", "0.79299206", "0.79119074", "0.78677505", "0.78505844", "0.7845455", "0.783418", "0.7815574", "0.7798009", "0.77841055", "0.7760531", "0.7760491", "0.77491975", "0.77491885", "0.77381206", "0.7731128", "0.77016157", "0.7696864", "0.76813716", "0.7669966", "0.76690793", "0.76625514", "0.7644284", "0.7636105", "0.76298606", "0.7625296", "0.7624954", "0.7620896", "0.75963306", "0.7593019", "0.7557326", "0.7557191", "0.7552094", "0.7540964", "0.75380236", "0.7530816", "0.75187314", "0.7451498", "0.7442405", "0.744088", "0.74325657", "0.74260175", "0.74260175", "0.74182814", "0.7417898", "0.74154776", "0.74125224", "0.74027455", "0.7388856", "0.7382874", "0.73605436", "0.73600066", "0.7359012", "0.7358709", "0.73522854", "0.7331206", "0.7327646", "0.7317502", "0.7314785", "0.7314203", "0.73096377", "0.73096377", "0.7290608", "0.7290201", "0.72820896", "0.7281728", "0.72797364", "0.727472", "0.72728115", "0.72728115", "0.72708094", "0.7258939", "0.7244289", "0.7231637", "0.7228092", "0.7227812", "0.7206384", "0.72011316", "0.71872085", "0.71697205", "0.7168169", "0.7167897", "0.71674246", "0.7165712", "0.7164942", "0.715898", "0.7155309", "0.7151671", "0.71457183" ]
0.0
-1
This method returns current edge count.
public long getEdgeCount() { return edgeCount; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getEdgeCount()\n\t{\n\t\treturn edgeCount;\n\t}", "public int getEdgeCount() {\n return edge_.size();\n }", "public int getEdgeCount() {\n if (edgeBuilder_ == null) {\n return edge_.size();\n } else {\n return edgeBuilder_.getCount();\n }\n }", "public int edgeCount() {\n\treturn edgeList.size();\n }", "int getEdgeCount();", "public int edgeNum() {\r\n return edges.size();\r\n }", "public int numEdges() {\r\n\t\treturn edges;\r\n\t}", "public int getNumEdges() {\n\t\treturn this.actualTotalEdges;\n\t}", "@Override\n\tpublic long numEdges() {\n\t\treturn numEdges;\n\t}", "int getNumberOfEdges();", "public int getNumEdges() {\n\t\treturn edges.size();\n\t}", "public int getNumEdges()\n\t{\n\t\t//TODO: Implement this method in WEEK 3\n\t\treturn numEdges;\n\t}", "public int getNumberOfEdges();", "@Override\n public int edgeSize() {\n return this.numOfEdges;\n }", "int numEdges() {\n\t\treturn num_edges;\n\t}", "public int getOriginalEdgeCount() {\r\n return originalEdgeCount;\r\n }", "@Override\n\tpublic int edgeSize() {\n\t\treturn numOfEdges;\n\t}", "public int getEdgeCount(){\r\n HashSet<FlowGraphNode> visited = new HashSet<>();\r\n LinkedList<FlowGraphNode> queue = new LinkedList<>();\r\n queue.add(start);\r\n visited.add(start);\r\n int counter = 0;\r\n while(!queue.isEmpty()){\r\n FlowGraphNode node = queue.pop();\r\n counter += node.outDeg();\r\n for(FlowGraphNode child : node.to){\r\n if(visited.add(child)){\r\n queue.add(child);\r\n }\r\n }\r\n }\r\n return counter;\r\n }", "public int getNumEdges() {\n return num_edges;\n }", "private int numEdges()\r\n\t{\r\n\t return eSet.size();\r\n\t}", "public int getNumEdges(){\n return numEdges;\n }", "public int getEdges() {\n return edgesNumber;\n }", "public int numEdges();", "public int getEdgeCount() \n {\n return 3;\n }", "public int localEdgeNum() {\r\n return localEdgeCount;\r\n }", "@Override\n public int edgeCount() {\n int count = 0;\n\n for(MyNode n : graphNodes.values()){\n count += n.inDegree();\n }\n\n return count;\n }", "public int getNumEdges();", "public int numEdges()\r\n {\r\n\tint s = 0;\r\n\tfor (final EdgeTypeHolder eth : ethMap.values())\r\n\t s += eth.numEdges();\r\n\treturn s;\r\n }", "public int size()\n {\n return numEdges;\n }", "public int numEdges() {\n int tot = 0;\n\n ListIterator<EdgeList> curEdge = edgeListVector.listIterator();\n while (curEdge.hasNext()) {\n tot += curEdge.next().size();\n }\n\n return tot;\n }", "public int getEdgeSixe() {\n\t\treturn graph.edgeSet().size();\r\n\t}", "private static int getNumTotalEdges(){\r\n\t\t//return getMutMap().keySet().size();\r\n\t\treturn numCols+1;\r\n\t}", "public int getLayerCount(int edge) throws EdgeOutOfRangeException\n {\n if (edge==DataDirector.PAGE_EDGE)\n return 0;\n else\n return 1;\n }", "private int nonDirectionalEdgesNumber() {\n return selectedNonDirectionalEdges.size();\n }", "public long getEdgesArrayLength() {\n\t\treturn edgesLength;\n\t}", "public Object getNumberOfConnectedComponents() {\r\n\t\tConnectivityInspector<Country, DefaultEdge> inspector=new ConnectivityInspector<Country, DefaultEdge>(graph);\r\n\t\treturn inspector.connectedSets().size();\r\n\t}", "public Integer numUnknownEdges()\n\t{\n\t\tif (total_edges == null) return null;\n\n\t\tint edges = 0;\n\t\tfor (Node n : nodes.values())\n\t\t{\n\t\t\tedges += n.neighbors.size();\n\t\t}\n\t\t// double-counts edges, so divide\n\t\treturn total_edges - edges / 2;\n\t}", "@Override\n\tpublic int graphSize() {\n\t\treturn edges.size();\n\t}", "private int size() {\n assert _vertices.size() == _edges.size();\n return _edges.size();\n }", "int nbNode() {\n switch (type) {\n\n case EDGE:\n case PATH:\n case EVAL:\n if (edge.getEdgeVariable() == null) {\n return edge.nbNode();\n } else {\n return edge.nbNode() + 1;\n }\n\n case OPT_BIND:\n return size();\n }\n\n return 0;\n }", "public int getVertexCount()\n\t{\n\t\tint count = 0;\n\t\tIterator<DSAGraphVertex> itr = vertices.iterator();\n\t\twhile(itr.hasNext())\n\t\t{\n\t\t\tcount++;\n\t\t\titr.next();\n\t\t}\n\t\treturn count;\n\t}", "public int getVertexCount() {\n return vertexCount;\n }", "public int getVertexCount();", "public int getWeight()\r\n\t{\r\n\t\treturn edgeWeight;\t\t\r\n\t}", "public int countPrimaryEdges() {\n\t\t\tint count = 0;\n\t\t\tArrayNode node = this;\n\t\t\twhile (node.mPrimaryEdge != null) {\n\t\t\t\tnode = node.mPrimaryEdge;\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\treturn count;\n\t\t}", "@Override\n public int nodeCount() {\n return graphNodes.size();\n }", "public int getNodeCount() {\n return nodeCount;\n }", "public int getWeight(){\n\t\treturn this.edgeWeight;\n\t}", "public long getVertexCount(){\n return vertexCount;\n }", "public int numEdges(String edgeTypeName)\r\n {\r\n\tfinal EdgeTypeHolder eth = ethMap.get(edgeTypeName);\r\n\treturn (eth == null) ? 0 : eth.numEdges();\r\n }", "public int getVertexCount() {\n\t\treturn vertexCount;\n\t}", "public int getRiversAlongEdges() {\n return riversAlongEdges;\n }", "private long nodesLength(Edge[] E) {\n\t\tlong nodesLength = 0;\n\t\tfor (Edge e:E ) {\n\t\t\tif (e.getTo() > nodesLength) nodesLength = e.getTo();\n\t\t\tif (e.getFrom() > nodesLength) nodesLength = e.getFrom();\n\t\t}\n\t\tnodesLength++;\t\n\t\treturn nodesLength;\t\t\n\t}", "int getNumberOfVertexes();", "public double getEdgeCapacity() {\r\n\t\treturn this.capacity;\r\n\t}", "public int getVertexSize() {\n\t\treturn graph.vertexSet().size();\r\n\t}", "public abstract int getVertexCount();", "double getEdgeWeight();", "public int getNodeCount() {\n return node_.size();\n }", "public int getVertexCount() {\n\t\treturn this._vertices.size();\n\t}", "public int nodeCount(){\r\n\t\treturn size;\r\n\t}", "public double getEdge()\n {\n return this.edge;\n }", "public int getEdgeCount(boolean biDirectional) {\n int count=0;\n for(T v: map.keySet()) {\n count += map.get(v).size();\n }\n\n if(biDirectional) count = count/2;\n\n return count;\n }", "int getTotalNumOfNodes() {\n\t\treturn adjList.size();\n\t}", "private int visitedNetworksCount() {\n final HashSet<String> visitedNetworksSet = new HashSet<>(mVisitedNetworks);\n return visitedNetworksSet.size();\n }", "int getNodesCount();", "int getNodesCount();", "public int getNodeCount(){\r\n HashSet<FlowGraphNode> visited = new HashSet<>();\r\n LinkedList<FlowGraphNode> queue = new LinkedList<>();\r\n queue.add(start);\r\n visited.add(start);\r\n while(!queue.isEmpty()){\r\n FlowGraphNode node = queue.pop();\r\n for(FlowGraphNode child : node.to){\r\n if(visited.add(child)){\r\n queue.add(child);\r\n }\r\n }\r\n }\r\n return visited.size();\r\n }", "int getNodeCount();", "int getNodeCount();", "public int getNodeCount() {\n resetAllTouched();\n return recurseNodeCount();\n }", "public int getVertexCount() {\n return map.keySet().size();\n }", "public int getNetSize() {\n return graph.size();\n }", "public int getFlowSize()\n\t{\n\t\tint result = 0;\n\t\t\n\t\tfor(Edge e : this.source.getOutgoingEdges())\n\t\t{\n\t\t\tresult += e.getFlow();\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "@Override\n public double getEdgeWeight() {\n return edgeWeight;\n }", "int getNrNodes() {\n\t\treturn adjList.size();\n\t}", "@Override\r\n\tpublic int getConnectionsCount() {\r\n\t\treturn currentConnections.get();\r\n\t}", "public int getEdgeExtent(int edge) throws EdgeOutOfRangeException {\n switch (edge) {\n case DataDirector.COLUMN_EDGE:\n return columnCount;\n case DataDirector.ROW_EDGE:\n return rowCount;\n default:\n return pageCount;\n }\n }", "public java.lang.Integer getEdgeType() {\n return edgeType;\n }", "public int getFaceCount() {\n\t\tint count = 0;\n\n\t\tfor (int i = 0; i < getSegmentCount(); i++) {\n\t\t\tcount += getIndexCountInSegment(i);\n\t\t}\n\n\t\treturn count;\n\t}", "public int countNeighbours() {\n\t\tint count = 0;\n\t\tif (this.hasNeighbour(0))\n\t\t\tcount++;\n\t\tif (this.hasNeighbour(1))\n\t\t\tcount++;\n\t\tif (this.hasNeighbour(2))\n\t\t\tcount++;\n\t\treturn count;\n\t}", "public java.lang.Integer getEdgeType() {\n return edgeType;\n }", "public Integer getInlinkCount() {\r\n\t\treturn inlinks.size();\r\n\t}", "private static int numEdges(Graph g) {\n\tint sum = 0;\n\t\n\tfor(int i =0;i<g.vertices;i++)\n\t{\n\t LinkedList<Integer> temp = null;\n\t if(g.adjacencyList[i]!=null) {\n\t\ttemp = g.adjacencyList[i];\n\t\tfor(int tmp:temp) {\n\t\t sum++;\n\t\t}\n\t\t\n\t }\n\t}\n\treturn sum/2;\n }", "public int getNumOfNodes() {\n\t\treturn getNumOfNodes(this);\n\t}", "public int getNumNodesSeenByMessage() {\r\n return numNodesSeenByMessage;\r\n }", "protected int getGraphWidth() {\r\n\t\treturn pv.graphWidth;\r\n\t\t/*\r\n\t\t * if (canPaintGraph()) return getWidth()-leftEdge-rightEdge; else\r\n\t\t * return 0;\r\n\t\t */\r\n\t}", "int getPeerCount();", "public int capacity(Edge e) {\n\t\tif(mcg!=null)\n\t\t{\n\t\t\treturn mcg.capacity(e);\n\t\t}\n\t\treturn 0;\n\t}", "public Integer endpointHitsCount() {\n return this.endpointHitsCount;\n }", "public int size(){\n\t\tNode<E> current = top;\n\t\tint size = 0;\n\t\t\n\t\twhile(current != null){\n\t\t\tcurrent = current.next;\n\t\t\tsize++;\n\t\t}\n\t\t\n\t\treturn size;\n\t}", "public int getMaximumVertexCount()\r\n {\r\n return theMaximumVertexCount;\r\n }", "@Override\n\tpublic int size() {\n\t\tif(top == null) {\n\t\t\treturn 0;\n\t\t}\n\t\tNode<T> tempNode = top;\n\t\tint counter = 1;\n\t\twhile(tempNode.getLink() != null) {\n\t\t\tcounter++;\n\t\t\ttempNode = tempNode.getLink();\n\t\t}\n\t\treturn counter;\n\t}", "public Integer count() {\n return this.bst.count();\n }", "public int getVertexCount() {\n if (hasIndices())\n return indices.length;\n if (hasVertices())\n return vertices.length / 3;\n logger.warn(\"No indices or vertices set, vertex count returning 0!\");\n return 0;\n }", "public int currentCount () {\n return count;\n }", "public int getSize() {\n\t\treturn currConnections;\n\t}", "public int nodesCount() {\n return nodes.size();\n }", "public int getNodeCount() {\n return dataTree.getNodeCount();\n }", "public int nodeSize()\n{\n\treturn getNodes().size();\n}" ]
[ "0.8820045", "0.8782085", "0.8770004", "0.8680601", "0.86689156", "0.8417299", "0.82731277", "0.8137598", "0.81324977", "0.8117856", "0.80911267", "0.8078136", "0.80769074", "0.80431414", "0.80162114", "0.8011638", "0.7996021", "0.7991614", "0.7970485", "0.7936098", "0.7935327", "0.7897998", "0.7891464", "0.784385", "0.7826177", "0.7812056", "0.77921873", "0.77809024", "0.77003384", "0.7642", "0.76116127", "0.73227745", "0.729997", "0.7271127", "0.72702277", "0.72691387", "0.7216382", "0.7152371", "0.7147073", "0.68778604", "0.68244493", "0.68009746", "0.67841715", "0.67482096", "0.6690633", "0.6672965", "0.6667266", "0.6657005", "0.6652853", "0.66503316", "0.66434664", "0.663342", "0.6632573", "0.66269046", "0.66264594", "0.6623146", "0.66053975", "0.66000944", "0.6581583", "0.6574428", "0.65513915", "0.6549204", "0.65284735", "0.6526965", "0.6509643", "0.64967614", "0.64967614", "0.64954096", "0.64781684", "0.64781684", "0.6456225", "0.64508593", "0.6445605", "0.6438377", "0.64303195", "0.6417077", "0.64129627", "0.6401162", "0.638686", "0.6348586", "0.6343494", "0.63417476", "0.63412464", "0.6338636", "0.6302321", "0.62891465", "0.6288342", "0.62835586", "0.62829167", "0.62799186", "0.62589294", "0.62455094", "0.6237553", "0.6223958", "0.62118757", "0.6208636", "0.6208465", "0.62060094", "0.62019986", "0.620156" ]
0.8867268
0
This method returns current vertex count.
public long getVertexCount(){ return vertexCount; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getVertexCount() {\n return vertexCount;\n }", "public int getVertexCount() {\n\t\treturn vertexCount;\n\t}", "public int getVertexCount();", "public int getVertexCount() {\n\t\treturn this._vertices.size();\n\t}", "public abstract int getVertexCount();", "public int getVertexCount()\n\t{\n\t\tint count = 0;\n\t\tIterator<DSAGraphVertex> itr = vertices.iterator();\n\t\twhile(itr.hasNext())\n\t\t{\n\t\t\tcount++;\n\t\t\titr.next();\n\t\t}\n\t\treturn count;\n\t}", "public int getVertexCount() {\n if (hasIndices())\n return indices.length;\n if (hasVertices())\n return vertices.length / 3;\n logger.warn(\"No indices or vertices set, vertex count returning 0!\");\n return 0;\n }", "public int getNumVertices() {\n return num_vertices;\n }", "public int getNumVertices() {\n\t\treturn vertices.size();\n\t}", "int getNumberOfVertexes();", "public int getNumberOfVertices();", "public String getVerticesCount() {\n long res = 0;\n Iterator<Vertex> itty = g.vertices();\n Vertex v;\n while (itty.hasNext()) {\n v = itty.next();\n res++;\n }\n return Long.toString(res);\n }", "public int getVertexCount() {\n return map.keySet().size();\n }", "public int getNumVertices()\n\t{\n\t\t//TODO: Implement this method in WEEK 3\n\t\treturn numVertices;\n\t}", "public int getVertexCount() {\n \tif (vertBuf == null)\n \t\treturn 0;\n \treturn vertBuf.asFloatBuffer().limit()/3;\n }", "public int getNumVertices(){\n return numVertices;\n }", "public int getNumVertices();", "public int numVertices();", "public int numVertices();", "public int getVertexSize() {\n\t\treturn graph.vertexSet().size();\r\n\t}", "public native int getVertexCount(GPolyline self)/*-{\r\n\t\treturn self.getVertexCount();\r\n\t}-*/;", "public int getVertices() {\n return verticesNumber;\n }", "public int getNumberOfVertices() {\n\t\treturn n;\n\t}", "public int numVertices() { return numV; }", "public abstract int getNumberOfVertices();", "public int size() {\n\t\treturn vertices.size();\n\t}", "public int getMinimumVertexCount()\r\n {\r\n return theMinimumVertexCount;\r\n }", "@Override\n\t\tpublic int getRowCount() {\n\t\t\treturn app.graph.verticesCount;\n\t\t}", "public int getNrVertices(){\n return nrVertices;\n }", "public int getMaximumVertexCount()\r\n {\r\n return theMaximumVertexCount;\r\n }", "public int getNumberOfVerticesFound(){\n\t\t\treturn searchOrder.size();\n\t\t}", "@Override\r\n public int size() {\r\n return vertices.size();\r\n }", "int getVertices();", "public int getChildCount(V vertex);", "public int getvertex() {\n\t\treturn this.v;\n\t}", "public int getVertices() {\n return mPolygonShapeSpec.getNumVertex();\n }", "public int getVertexNumber() {\n\t\treturn _vertexId;\n\t}", "int getEdgeCount();", "private int getAgentsVertexNumber(Vertex vertex){\n if (vertexAgentsNumber.get(vertex) == null)\n return 0;\n else\n return vertexAgentsNumber.get(vertex).size();\n }", "public long getEdgeCount() { return edgeCount; }", "public int getNormalVerticesCount() {\n\t\treturn this.normalVertices.size();\n\t}", "public Integer numUnknownVerts()\n\t{\n\t\tif (total_verts == null) return null;\n\t\treturn total_verts - nodes.size();\n\t}", "private int size() {\n assert _vertices.size() == _edges.size();\n return _edges.size();\n }", "public int getVertexVal()\r\n\t{\r\n\t\treturn this.value;\r\n\t}", "public int getEdgeCount()\n\t{\n\t\treturn edgeCount;\n\t}", "public int currentCount () {\n return count;\n }", "public int localEdgeNum() {\r\n return localEdgeCount;\r\n }", "public int getBaseVertex() {\n return baseVertex;\n }", "public Object getNumberOfConnectedComponents() {\r\n\t\tConnectivityInspector<Country, DefaultEdge> inspector=new ConnectivityInspector<Country, DefaultEdge>(graph);\r\n\t\treturn inspector.connectedSets().size();\r\n\t}", "public int getNumTriangles() {\n return numTriangles;\n }", "public int inDegree() {\r\n\t\treturn currentVertex.inList.size();\r\n\t}", "@Test\r\n public void testNumVertices() {\r\n System.out.println(\"numVertices\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n int expResult = 0;\r\n int result = instance.numVertices();\r\n assertEquals(expResult, result);\r\n\r\n Object v1Element = 1;\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n\r\n expResult = 1;\r\n result = instance.numVertices();\r\n assertEquals(expResult, result);\r\n }", "public int getNeighborCount(final LazyNode2 vertex) {\n return getNeighborCount(neo.getNodeById(vertex.getId()));\n }", "@Override\n public int nodeCount() {\n return graphNodes.size();\n }", "public int order()\n {\n return numVertices;\n }", "public int numPartitions() {\n\t\treturn vertex_sets.size();\n\t}", "int getNodesCount();", "int getNodesCount();", "public int getEdgeCount() {\n if (edgeBuilder_ == null) {\n return edge_.size();\n } else {\n return edgeBuilder_.getCount();\n }\n }", "public int getStartVertex() {\n\t\treturn startVertex;\n\t}", "public int getNodeCount() {\n return nodeCount;\n }", "@Override\n public int degree(V vertex)\n {\n if (contains(vertex)){\n Iterator graphIterator = graph.entrySet().iterator();\n Map.Entry graphElement = (Map.Entry) graphIterator.next();\n V vert = (V)graphElement.getKey();\n while (graphIterator.hasNext() && vert != vertex){\n graphElement = (Map.Entry) graphIterator.next();\n vert = (V)graphElement.getKey();\n }\n ArrayList<V> edges = graph.get(vert);\n return edges.size();\n }\n else{\n throw new RuntimeException();\n }\n\n }", "public int getFaceCount() {\n\t\tint count = 0;\n\n\t\tfor (int i = 0; i < getSegmentCount(); i++) {\n\t\t\tcount += getIndexCountInSegment(i);\n\t\t}\n\n\t\treturn count;\n\t}", "public int getEdgeCount() {\n return edge_.size();\n }", "public Integer getVisitCount() {\n return visitCount;\n }", "public Integer getVisitCount() {\n return visitCount;\n }", "public int edgeCount() {\n\treturn edgeList.size();\n }", "public HashMap<Integer, Vertex> getVertices() {\n\t\treturn vertices;\n\t}", "int getPointsCount();", "int getNumberOfEdges();", "public int getTriangleCount();", "public int getPredecessorCount(final LazyNode2 vertex) {\n Set<Node> vertices = new HashSet<Node>();\n \n Node n = neo.getNodeById(vertex.getId());\n \n for(Relationship r : n.getRelationships(relType.DEFAULT, Direction.INCOMING)){\n if(isActive(r))\n vertices.add(r.getStartNode());\n }\n n = null; \n \n return vertices.size();\n }", "public int getFaceCount() {\r\n return faceCount;\r\n\t}", "public int numEdges();", "public int getNumberOfEdges();", "public int getTextureVerticeCount() {\n\t\treturn this.textureVertices.size();\n\t}", "public int getNumEdges(){\n return numEdges;\n }", "public static int getVertexNumber(Graph grafo) {\r\n\t\treturn grafo.getVertexNumber();\r\n\t}", "int getNodeCount();", "int getNodeCount();", "int getIndexesCount();", "public Integer count() {\n return this.bst.count();\n }", "public int getNumEdges();", "protected int degree(int vertex) {\n\t\treturn getNeighbors(vertex).size()\n\t\t\t\t+ getNeighboursIndegree(vertex).size();\n\t}", "@Override\n\tpublic long numEdges() {\n\t\treturn numEdges;\n\t}", "public ExecutionVertexID getVertexID() {\n \n \t\treturn this.vertexID;\n \t}", "public int getEdgeCount() \n {\n return 3;\n }", "public int count() {\n\t\treturn sizeC;\n\t}", "public int getNumEdges() {\n\t\treturn this.actualTotalEdges;\n\t}", "public int count() {\n\t\treturn count;\n\t}", "public static int count() {\n return segmentList.size();\n }", "public int getPointCount() {\n return(_pts.length);\n }", "public int size()\n {\n return numEdges;\n }", "public int getNodeCount() {\n return node_.size();\n }", "public int getTotalCount() {\r\n return root.getTotalCount();\r\n }", "public Vertex getVertex() {\n return curr;\n }", "@Override\n\tpublic int graphOrder() {\n\t\treturn vertices.size();\n\t}", "public int getNumOfNodes() {\n\t\treturn getNumOfNodes(this);\n\t}", "public int getCount()\r\n {\r\n int answer=0;\r\n answer+=recCount(root);\r\n return answer;\r\n }", "public int nodesCount() {\n return nodes.size();\n }" ]
[ "0.88061905", "0.8741917", "0.8621868", "0.8592589", "0.83510494", "0.8337106", "0.81252503", "0.81042564", "0.8100267", "0.8088632", "0.808148", "0.80730873", "0.80484205", "0.80267286", "0.8024897", "0.80141234", "0.7982151", "0.79600626", "0.79600626", "0.7915447", "0.7863698", "0.7811686", "0.7805393", "0.7793015", "0.7675348", "0.76265144", "0.7622359", "0.744921", "0.74304765", "0.7400561", "0.7345302", "0.7294724", "0.7261698", "0.71093416", "0.7097902", "0.7039927", "0.69702756", "0.689577", "0.6838834", "0.67345077", "0.6704107", "0.6695598", "0.6664528", "0.6657229", "0.6655879", "0.6641187", "0.66236544", "0.6620697", "0.6562374", "0.65615714", "0.6547552", "0.6543207", "0.65075904", "0.6493452", "0.6490254", "0.6459273", "0.6453116", "0.6453116", "0.64502937", "0.6413916", "0.64134", "0.64013845", "0.6390231", "0.6383029", "0.6382365", "0.6382365", "0.6374835", "0.63618356", "0.6358852", "0.63523424", "0.633925", "0.6335769", "0.6326538", "0.63125736", "0.63009405", "0.6300381", "0.62929744", "0.62835306", "0.62664163", "0.62664163", "0.6266044", "0.6258314", "0.62519443", "0.6243998", "0.6237694", "0.62355334", "0.62349045", "0.6232181", "0.62304276", "0.62243634", "0.62239194", "0.6221025", "0.6218626", "0.6216952", "0.6214071", "0.6212291", "0.62078226", "0.6202842", "0.6194401", "0.6186505" ]
0.86566114
2
This method is triggered by the Kernel to flush transactions.
public boolean flushTransactions() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void flushAll() {\n\t\t\r\n\t}", "@Override\n\tpublic void flush() {\n\t}", "@Override\n public void flush()\n {\n }", "@Override\r\n\tpublic void flush() {\n\t}", "public void flush() {\n entityManager.flush();\n }", "@Override\r\n\tpublic void flush() {\n\t\t\r\n\t}", "@Override\n public void flush() throws IOException{\n HBasePlatformUtils.flush(region);\n }", "@Override\n public void flush() {\n }", "@Override\n public void flush() {\n }", "@Override\n public void flush() {\n }", "public void flushData (){\n\t\tTransaction tx = this.pm.currentTransaction();\n\t\ttry {\n\t\t\tif (this.pm.currentTransaction().isActive ()){\n\t\t\t\tthis.pm.currentTransaction().commit();\n\t\t\t}\n\t\t} catch (Exception e){\n\t\t\tApplication.getLogger ().error (\"Error flushing data for persistence. \", e);\n\t\t\te.printStackTrace();\n\t\t\ttx.rollback();\n\t\t}\n//\t\ttx.begin();\n\t}", "public void forceCommitTx()\n{\n}", "@Override\n\tpublic void flush() {\n\t\t\n\t}", "@Override\n\tpublic void flush() {\n\t\t\n\t}", "@Override\n\tpublic void flush() {\n\t\t\n\t}", "@Override\n\tpublic void flush() {\n\t\t\n\t}", "@Override\r\n public void flush ()\r\n {\r\n }", "public void flush() {\n\t\t\n\t}", "public void flush() {\n flushed = true;\n }", "public void flush() {\n hibernateTemplate.flush();\n }", "public void flush() {\n\t\tthis.getCurrentSession().flush();\r\n\t}", "public void flush() {\n wasFlushed = true;\n }", "@Override\n public void flush() {\n if (loggingEnabled) {\n changeLogger.logChange(changelogKey, state);\n }\n }", "@Override\n public void commitTx() {\n \n }", "public void flushAndSubmit() {\n nFlushAndSubmit(mNativeInstance);\n }", "@Override\r\n public void flush() {\n\r\n }", "@Override\r\n public void flush() {\n\r\n }", "public void flush() {\n mMessages.postToServer();\n }", "public void commitTransaction() {\n\r\n\t}", "private void commitAll(){\n if(isDiskBufferEnabled && persistenceService != null){\n persistenceService.commit(WIKIDATA_SYNONYMY_BUFFER);\n persistenceService.commit(WIKIDATA_HYPERNYMY_BUFFER);\n persistenceService.commit(WIKIDATA_ASK_BUFFER);\n }\n }", "public void flush();", "public void flush();", "public void flush();", "public void flush();", "public abstract void flush();", "void flushAll() {\n dirtyS = true;\n dirtyD = true;\n modelRoot.incrementNumberOfDirtySNodes();\n modelRoot.incrementNumberOfDirtyDNodes();\n }", "@Override\n public void beginDatabaseBatchWrite() throws BlockStoreException {\n if (!autoCommit) {\n return;\n }\n if (instrument)\n beginMethod(\"beginDatabaseBatchWrite\");\n\n batch = db.createWriteBatch();\n uncommited = new HashMap<ByteBuffer, byte[]>();\n uncommitedDeletes = new HashSet<ByteBuffer>();\n utxoUncommittedCache = new HashMap<ByteBuffer, UTXO>();\n utxoUncommittedDeletedCache = new HashSet<ByteBuffer>();\n autoCommit = false;\n if (instrument)\n endMethod(\"beginDatabaseBatchWrite\");\n }", "public void flushAllTables() {\n\t}", "public void flush()\n{\n\t// no such operation required for mock persistence provider\n}", "public void flushAndClose() throws TxnBatchFailure, TxnFailure, CommitFailure,\n IOException, InterruptedException {\n flush(false);\n close();\n }", "void commit() {\r\n tx.commit();\r\n tx = new Transaction();\r\n }", "public void flush() {\n trans.set(kernel.get().asArray());\n actions.forEach(Runnable::run);\n actions.clear();\n kernel.free();\n kernel = Matrix4F.ident();\n }", "void flushDB();", "public void commit() {\n doCommit();\n }", "private void flushData()\n {\n try\n {\n while(state.get().ordinal() < SimulationState.TEARING_DOWN.ordinal() || !flushing.isEmpty())\n {\n ICardinality cardinality = flushing.poll(1, TimeUnit.MILLISECONDS);\n if (cardinality == null)\n continue;\n\n long numToFlush = cardinality.cardinality();\n counters.numFlushed.addAndGet(numToFlush);\n generateSSTables(cardinality, numToFlush, partitioner.getMinimumToken(), partitioner.getMaximumToken(), \"flushing\", true);\n }\n }\n catch (InterruptedException e)\n {\n logger.error(\"Exception happen during flushing\", e);\n }\n }", "public void flushSession() throws RepositoryException{\n\t\tDatanucleusCRUDUtils.flushSession();\n\t}", "private void flushOutbound0() {\n/* 454 */ runPendingTasks();\n/* */ \n/* 456 */ flush();\n/* */ }", "void flush() throws Exception;", "boolean flush_all();", "void flushKeys() {\n getKeyStates();\n }", "@Override\n public void rollbackTx() {\n \n }", "synchronized private void flushPendingUpdates() throws SailException {\n\t\tif (!isActiveOperation()\n\t\t\t\t|| isActive() && !getTransactionIsolation().isCompatibleWith(IsolationLevels.SNAPSHOT_READ)) {\n\t\t\tflush();\n\t\t\tpendingAdds = false;\n\t\t\tpendingRemovals = false;\n\t\t}\n\t}", "public void flush() {\n\t\tgetSession().flush();\n\t}", "@Override\n public void startTx() {\n \n }", "public void flush () {\n\t\ttracker.flush();\n\t}", "public void commit() {\n tryCommit(true);\n }", "protected void deferFlush()\n {\n // push next flush out to avoid attempts at multiple simultaneous\n // flushes\n m_lNextFlush = Long.MAX_VALUE;\n }", "public void commitTransaction() {\n final EntityTransaction entityTransaction = em.getTransaction();\n if (!entityTransaction.isActive()) {\n entityTransaction.begin();\n }\n entityTransaction.commit();\n }", "@Override\n public void flush() {\n new QueueConsumer().run();\n }", "@Override\n\tpublic void flush(Map<TopicPartition, OffsetAndMetadata> offsets) throws ConnectException {\n\n\t\tSystem.out.print(\"Flush start at \"+System.currentTimeMillis());\n\t\tif (fuelList != null) {\n\t\t\tSystem.out.print(fuelList.size());\n\t\t\tfor(int fuelListIndex=0; fuelListIndex < fuelList.size(); fuelListIndex++){\n\t\t\t\ttry {\n\t\t\t\t\tnewConnection.insertFuelDB(fuelList.get(fuelListIndex));\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t\t// Clear the Arraylist and the updateDeviceTimeObject\n\t\t\tfuelList.clear() ;\n\t\t\tSystem.out.print(\"Flush stop at \" + System.currentTimeMillis());\n\t\t} \n\t }", "public int flush()\n/* */ {\n/* 145 */ return 0;\n/* */ }", "public void flushEntityCache() {\n super.flushEntityCache();\n }", "@Override\n public void shutdown() {\n\n // Since we have nothing to do, override base shutdown so don't\n // get extraneous UserTransactions.\n }", "public void flush(){\r\n\t\tSystem.out.println(\"\\nCreating a customer by flush:\");\r\n\t\tEntityManager em = emf.createEntityManager();\r\n\t\tEntityTransaction tx = em.getTransaction();\r\n\t\tCustomer2 c1 = new Customer2(\"Selim\", \"Aslan\");\r\n\t\ttx.begin();\r\n\t\tem.persist(c1);\r\n\t\tlong id = c1.getCustId();\r\n\t\tSystem.out.println(\"Its id is : \" + id);\r\n\t\tem.flush();\r\n\t\tSystem.out.println(\"Flushed to the db.\");\r\n\t\tCustomer2 retrievedCustomer1 = em.find(Customer2.class, id);\r\n\t\tSystem.out.println(retrievedCustomer1);\r\n\t\t\r\n\t\t// Eger commit yerine rollback yapilirsa daha asagida retrievedCustomer2 null gelir.\r\n\t\ttx.commit();\r\n//\t\ttx.rollback();\r\n\t\t\r\n\t\tCustomer2 retrievedCustomer2 = em.find(Customer2.class, id);\r\n\t\tSystem.out.println(retrievedCustomer2);\r\n\t\tem.close();\r\n\t}", "public void commitChanges()\n {\n }", "void commitTransaction();", "void endTransaction();", "public void executePendingTransactions()\n\t{\n\t\twhile(!transactionQueue.isEmpty())\n\t\t\ttransactionQueue.poll().doTransaction();\n\t}", "public void flush() {\n\t\tupdateCounter++;\n//\t\trules.update();\n\t}", "@Override\n\tpublic int commit() {\n\t\treturn 0;\n\t}", "@Override\n public void flush() throws IOException {\n checkStreamState();\n flushIOBuffers();\n }", "@Override\n public void flush() throws IOException {\n }", "void commit() {\n }", "@Override\r\n\tpublic void flushAll(Date date) {\n\t\t\r\n\t}", "public void commit() {\n }", "public void flush(final byte [] tableNameOrRegionName) throws IOException {\n modifyTable(tableNameOrRegionName, DBConstants.Modify.TABLE_FLUSH);\n }", "@Override\n public void commit() {\n }", "public void storeAndCommit() {\n \tsynchronized(mDB.lock()) {\n \t\ttry {\n \t \t\tstoreWithoutCommit();\n \t \t\tcheckedCommit(this);\n \t\t}\n \t\tcatch(RuntimeException e) {\n \t\t\tcheckedRollbackAndThrow(e);\n \t\t}\n \t}\n }", "@Override\n public void commit() throws SQLException {\n if (isTransActionAlive() && !getTransaction().getStatus().isOneOf(TransactionStatus.MARKED_ROLLBACK,\n TransactionStatus.ROLLING_BACK)) {\n // Flush synchronizes the database with in-memory objects in Session (and frees up that memory)\n getSession().flush();\n // Commit those results to the database & ends the Transaction\n getTransaction().commit();\n }\n }", "public void rollbackTx()\n\n{\n\n}", "protected void scheduleFlush()\n {\n // int cDelayMillis = m_cFlushDelay;\n m_lNextFlush = Long.MAX_VALUE ;\n }", "void flush();", "void flush();", "void flush();", "void flush();", "void flush();", "void flush();", "void flush();", "void flush();", "void flush() {\r\n synchronized (sync) {\r\n updatedFiles.clear();\r\n }\r\n }", "public void commit(){\n \n }", "public void fireAfterTransaction(final TransactionContext context){\r\n\t\tnotify(new ListenerCaller(){\r\n\t\t\tpublic void call(DBListener listener){\r\n\t\t\t\tlistener.afterTransaction(context);\r\n\t\t\t}\r\n\t\t});\r\n\t}", "private boolean flush()\n {\n List<Protos.SchedulerTask> tasks = this.app.getTasks();\n\n //write all tasks to db\n for(Protos.SchedulerTask task : tasks)\n {\n if( !this.dbClient.updateTask(task) )\n {\n LOGGER.error(\"Failed to flush task to persistent storage\");\n return false;\n }\n }\n\n if( !this.dbClient.updateApp(this.getAppId().getValue(), this.app.getData()) )\n {\n LOGGER.error(\"Failed to flush app to persistent storage\");\n return false;\n }\n\n return true;\n }", "synchronized void flushAll(int txnum) {\n for (Buffer buff : bufferpool)\n if (buff.isModifiedBy(txnum))\n buff.flush();\n }", "public void beforeCompletion()\n {\n \n boolean success = false;\n try\n {\n flush();\n // internalPreCommit() can lead to new updates performed by usercode \n // in the Synchronization.beforeCompletion() callback\n internalPreCommit();\n flush();\n success = true;\n }\n finally\n {\n if (!success) \n {\n // TODO Localise these messages\n NucleusLogger.TRANSACTION.error(\"Exception flushing work in JTA transaction. Mark for rollback\");\n try\n {\n jtaTx.setRollbackOnly();\n }\n catch (Exception e)\n {\n NucleusLogger.TRANSACTION.fatal(\n \"Cannot mark transaction for rollback after exception in beforeCompletion. PersistenceManager might be in inconsistent state\", e);\n }\n }\n }\n }", "public void beginTransaction() {\n\r\n\t}", "public void postFlush(Iterator iterator) {\r\n\t\t//System.out.println(\"postFlush\");\r\n\r\n\t\ttry {\r\n\r\n\t\t\tif(inserts.size() > 0){\r\n\t\t\t\tevaluate(inserts.iterator().next(), \"evt:batchinsert\");\r\n\t\t\t}\r\n\t\t\tfor (Iterator it = inserts.iterator(); it.hasNext();) {\r\n\t\t\t\tFile entity = (File) it.next();\r\n\t\t\t\t//System.out.println(\"postFlush - insert\");\r\n\t\t\t\tLogIt(\"Saved\", entity);\r\n\t\t\t\t\r\n\t\t\t\tevaluate(entity, \"evt:insert\");\r\n\t\t\t\t//if(entity.getParent().getProperty(\"cst:event\"))\r\n\t\t\t}\r\n\r\n\t\t\tif(updates.size() > 0){\r\n\t\t\t\tevaluate(updates.iterator().next(), \"evt:batchupdate\");\r\n\t\t\t}\r\n\t\t\tfor (Iterator it = updates.iterator(); it.hasNext();) {\r\n\t\t\t\tFile entity = (File) it.next();\r\n\t\t\t\t//System.out.println(\"postFlush - update\");\r\n\t\t\t\tLogIt(\"Updated\", entity);\r\n\t\t\t\tevaluate(entity, \"evt:update\");\r\n\t\t\t}\r\n\r\n\t\t\tif(deletes.size() > 0){\r\n\t\t\t\tevaluate(deletes.iterator().next(), \"evt:batchdelete\");\r\n\t\t\t}\r\n\t\t\tfor (Iterator it = deletes.iterator(); it.hasNext();) {\r\n\t\t\t\tFile entity = (File) it.next();\r\n\t\t\t\t//System.out.println(\"postFlush - delete\");\r\n\t\t\t\tLogIt(\"Deleted\", entity);\r\n\t\t\t\tevaluate(entity, \"evt:delete\");\r\n\t\t\t}\r\n\r\n\t\t} finally {\r\n\t\t\tinserts.clear();\r\n\t\t\tupdates.clear();\r\n\t\t\tdeletes.clear();\r\n\t\t}\r\n\t}", "void flushBatch();", "@Override\n public void hflush() throws IOException {\n hsync();\n }", "void commit() throws SoarException\n {\n // if lazy, commit\n if(db != null && params.lazy_commit.get() == LazyCommitChoices.on)\n {\n // Commit and then start next lazy-commit transaction\n try\n {\n db.commitExecuteUpdate( /* soar_module::op_reinit */);\n db.beginExecuteUpdate( /* soar_module::op_reinit */);\n }\n catch(SQLException e)\n {\n throw new SoarException(\"Error while forcing commit: \" + e.getMessage(), e);\n }\n }\n \n }" ]
[ "0.6957896", "0.6917399", "0.6887985", "0.68778586", "0.6868034", "0.68642706", "0.6839699", "0.683926", "0.683926", "0.683926", "0.68234175", "0.6815813", "0.68053836", "0.68053836", "0.68053836", "0.68053836", "0.6798851", "0.67846507", "0.6696921", "0.6672816", "0.65869063", "0.658153", "0.6569176", "0.6538048", "0.65050465", "0.64692324", "0.64248693", "0.6416501", "0.6404683", "0.6386695", "0.636166", "0.636166", "0.636166", "0.636166", "0.6341061", "0.63031745", "0.6270996", "0.6268885", "0.6233767", "0.62297827", "0.6208088", "0.6198445", "0.61794525", "0.6174983", "0.61456645", "0.61399966", "0.61385757", "0.61319655", "0.6124387", "0.60812974", "0.6060798", "0.606024", "0.60582805", "0.6052823", "0.6042331", "0.6040656", "0.60296965", "0.60184383", "0.6008247", "0.60065615", "0.6001971", "0.59905285", "0.5981894", "0.5970908", "0.5950578", "0.59256977", "0.5915493", "0.5906901", "0.5904699", "0.58931756", "0.5892541", "0.589142", "0.58704233", "0.5851122", "0.58437246", "0.5831897", "0.5827652", "0.5822498", "0.58107483", "0.58097017", "0.5798964", "0.57486033", "0.57486033", "0.57486033", "0.57486033", "0.57486033", "0.57486033", "0.57486033", "0.57486033", "0.5748313", "0.5702118", "0.57020736", "0.5698569", "0.56983376", "0.56883556", "0.5685794", "0.5685296", "0.5682426", "0.56816804", "0.5674168" ]
0.7157576
0
This function queries the underlying storage and retrieves the edge matching the given criteria.
@Deprecated public abstract Edge getEdge(String childVertexHash, String parentVertexHash);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "E getEdge(int id);", "Edge getEdge();", "public Edge getEdge(Node k){\n for(int i = 0; i<edges.size(); i++){\n Edge edge = edges.get(i);\n if(edge.end() == k){\n return edge;\n }\n }\n return null;\n }", "public Edge returnEdgeById(Id id){\n\t\tif(id.indice >= listOfEdges.size()) return null;\n\t\tEdge e = listOfEdges.elementAt(id.indice);\n\t\tif(e == null) return null;\n\t\tId eid = e.getId();\n\t\tif(eid.indice != id.indice || eid.unique != id.unique) return null; \n\t\treturn e;\n\t}", "public edge_data getEdge(int nodeKey) {\n return this.neighborEdges.get(nodeKey);\n }", "public Edge<E, V> getUnderlyingEdge();", "uk.ac.cam.acr31.features.javac.proto.GraphProtos.FeatureEdge getEdge(int index);", "private SumoEdge getEdge(String id) {\n\t\treturn idToEdge.get(id);\n\t}", "private RoutingEdge extractRoutingEdgeFromRS(ResultSet resultSet) {\n\n\t\tRoutingEdge routingEdge = new RoutingEdge();\n\n\t\ttry {\n\n\t\t\troutingEdge.setId(resultSet.getInt(\"id\"));\n\t\t\t\n\t\t\troutingEdge.setFloorID(resultSet.getInt(\"FloorId\"));\n\t\t\troutingEdge.setSource(resultSet.getInt(\"Source\"));\n\t\t\troutingEdge.setTarget(resultSet.getInt(\"Target\"));\n\t\t\troutingEdge.setWeight(resultSet.getInt(\"Weight\"));\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn routingEdge;\n\t}", "Optional<ServiceEdge> getEdge(T dependant, T dependency);", "public Edge findEdgeById(int id) throws SQLException {\n\t\treturn rDb.findEdgeById(id);\n\t}", "@Override\n public StorageCapacity find(StorageCapacity storageCapacity) {\n Session session = Hibernate.createSession();\n\n if (session != null) {\n try {\n session.beginTransaction();\n\n CriteriaBuilder criteriaBuilder = session.getCriteriaBuilder();\n CriteriaQuery<StorageCapacity> criteriaQuery = criteriaBuilder.createQuery(StorageCapacity.class);\n Root<StorageCapacity> root = criteriaQuery.from(StorageCapacity.class);\n\n Predicate[] predicates = new Predicate[]{\n criteriaBuilder.equal(root.get(\"size\"), storageCapacity.getSize())\n };\n\n criteriaQuery.select(root).where(predicates);\n\n Query<StorageCapacity> query = session.createQuery(criteriaQuery);\n StorageCapacity result = query.getSingleResult();\n\n session.getTransaction().commit();\n\n return result;\n }\n catch (Exception exception) {\n session.getTransaction().rollback();\n\n System.out.println(\"Unable to find storage capacity.\");\n exception.printStackTrace();\n }\n }\n\n return storageCapacity;\n }", "protected Edge getEdge() {\r\n\t\treturn (Edge)getModel();\r\n\t}", "private mxCell getEdge(Microtuble m){\n\t\tmxCell edge = null;\n\t\tfor (mxCell cell : graph.getEdgeToCellMap().values()){\n\t\t\tMicrotuble mt = (Microtuble) cell.getValue();\n\t\t\tif (mt.equals(m)){\n\t\t\t\tedge = cell;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn edge;\n\t}", "public edge_type getEdge(int from, int to) {\n assert (from < nodeVector.size())\n && (from >= 0)\n && nodeVector.get(from).getIndex() != invalid_node_index :\n \"<SparseGraph::GetEdge>: invalid 'from' index\";\n\n assert (to < nodeVector.size())\n && (to >= 0)\n && nodeVector.get(to).getIndex() != invalid_node_index :\n \"<SparseGraph::GetEdge>: invalid 'to' index\";\n\n ListIterator<edge_type> it = edgeListVector.get(from).listIterator();\n while (it.hasNext()) {\n edge_type curEdge = it.next();\n if (curEdge.getTo() == to) {\n return curEdge;\n }\n }\n\n assert false : \"<SparseGraph::GetEdge>: edge does not exist\";\n return null;\n }", "@Override\n\tpublic edge_data getEdge(int src, int dest) {\n\t\tif(Nodes.containsKey(src) && Nodes.containsKey(dest) && Edges.get(src).containsKey(dest)) {\n\t\t\treturn Edges.get(src).get(dest);\n\t\t}\n\t\treturn null;\n\t}", "@Override\n public E getEdgeIfExists(int pintSourceVertexID, int pintDestinationVertexID) {\n V vertexFrom = getVertex(pintSourceVertexID);\n V vertexTo = getVertex(pintDestinationVertexID);\n for(TimeFrame tf : darrGlobalAdjList.get(pintSourceVertexID).keySet()) {\n for (E e : darrGlobalAdjList.get(pintSourceVertexID).get(tf)) { \n if (e.getOtherEndPoint(vertexFrom).equals(vertexTo)) {\n return e;\n }\n } \n }\n return null;\n }", "protected abstract Graph fetchGraph() throws IdNotFoundException;", "public IEdge<?> getEdge() {\n\t\treturn this.edge;\n\t}", "public Edge<V> getEdge(V source, V target);", "<O> E getEdge(Function<E, O> map, O value);", "public HdfsLeDescriptors findEndpoint() {\n try {\n// return em.createNamedQuery(\"HdfsLeDescriptors.findEndpoint\", HdfsLeDescriptors.class).getSingleResult();\n List<HdfsLeDescriptors> res = em.createNamedQuery(\n \"HdfsLeDescriptors.findEndpoint\", HdfsLeDescriptors.class).\n getResultList();\n if (res.isEmpty()) {\n return null;\n } else {\n return res.get(0);\n }\n } catch (NoResultException e) {\n return null;\n }\n }", "public E getEdge(N startNode, N endNode)\r\n/* 90: */ {\r\n/* 91:166 */ assert (checkRep());\r\n/* 92:167 */ if ((contains(startNode)) && (((Map)this.map.get(startNode)).containsKey(endNode))) {\r\n/* 93:168 */ return ((Map)this.map.get(startNode)).get(endNode);\r\n/* 94: */ }\r\n/* 95:170 */ return null;\r\n/* 96: */ }", "public SimpleEdge getEdge() {\n return edge;\n }", "private void checkEdgesToSearch() {\n if (edgesToSearch == null || edgesToSearch.length == 0) {\n Graph hg;\n if (Lookup.getDefault().lookup(DataTablesController.class).isShowOnlyVisible()) {\n hg = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getGraphVisible();\n } else {\n hg = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getGraph();\n }\n edgesToSearch = hg.getEdges().toArray();\n }\n }", "@Override\r\n public Collection<edge_data> getE(int node_id) {\r\n return this.neighbors.get(node_id).values(); //o(k)\r\n }", "public static Edge getEdgeFromID(int id){\n\t\tfor(Edge x : edgeList)\n\t\t{\n\t\t\tif(x.getID() == id)\n\t\t\t{\n\t\t\t\treturn x;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public Edge getEdge(Integer idVertex1, Integer idVertex2) throws Exception {\r\n\t\treturn matrix.getEdges(idVertex1, idVertex2);\r\n\t}", "default Optional<E> getEdge(N leftNode, N rightNode) {\n return this.getOutgoingEdges(leftNode).stream()\n .filter(a -> a.getRightNode().equals(rightNode) || (!a.isDirected()&& a.getLeftNode().equals(rightNode)))\n .findAny();\n }", "private Edge getKernelEdge(Edge edge){\n\t\tif (edge.getGraph() != null && (edge.getGraph().isLhs() || edge.getGraph().isRhs())) {\n\t\t\tRule rule = edge.getGraph().getRule();\n\t\t\treturn rule.getMultiMappings().getOrigin(edge);\n\t\t}\n\t\treturn null;\n\t}", "public EdgeType getEdgeType(String edgeType)\n {\n final EdgeTypeHolder eth = ethMap.get(edgeType);\n return (eth == null) ? null : eth.getEdgeType();\n }", "@Override\n public edge_data getEdge(int src, int dest) {\n if (!nodes.containsKey(src)) return null;\n node_data sourceNode = nodes.get(src);\n return ((NodeData) sourceNode).getEdge(dest);\n }", "public Collection<LazyRelationship2> getEdges() {\n long relCount=0;\n ArrayList l = new ArrayList();\n \n for(Path e : getActiveTraverser()){\n for(Path p : getFlushTraverser(e.endNode())){\n if((relCount++%NEO_CACHE_LIMIT)==0){\n l.add(p.lastRelationship());\n clearNeoCache();\n }\n }\n }\n return l; \n }", "VertexType getOtherVertexFromEdge( EdgeType r, VertexType oneVertex );", "public List<Edge> findAllEdge() throws SQLException {\n\t\treturn rDb.findAllEdges();\n\t}", "public Collection< EDataT > edgeData();", "@Override\n\tpublic Path getEdgeIfExists(Location src, Location dest) {\n\t\tfor (Path p : paths.get(locations.indexOf(src))) \n\t\t\tif (p.getDestination().equals(dest))\n\t\t\t\treturn p;\n\n\t\treturn null;\n\n\t}", "public double getEdge()\n {\n return this.edge;\n }", "@Override\n\tpublic Collection<edge_data> getE(int node_id) {\n\t\t// TODO Auto-generated method stub\n\t\treturn Edges.get(node_id).values();\n\t}", "public int get_edge(int from, int to){\n int temp=0;\n try{\n temp=adj_matrix[from][to];\n }\n catch(ArrayIndexOutOfBoundsException index){ // If invalid index\n System.out.println(\" Invalid Vertex!\");\n }\n return temp;\n }", "private IEdge<E> getEdge(int src, int dest){\n\t\tassert src > 0 || src < graph.numberOfNodes();\n\t\tassert dest > 0 || dest < graph.numberOfNodes();\n\n\t\tIterator<IEdge<E>> edgesIterator = graph.edgeIterator();\n\t\twhile(edgesIterator.hasNext()){\n\t\t\tIEdge<E> edge = edgesIterator.next();\n\t\t\tif(edge.getSource() == src && edge.getDestination() == dest){\n\t\t\t\treturn edge;\n\t\t\t}\n\t\t\t}\n\t\treturn null;\n\t\t}", "public interface Edge\n extends Comparable\n{\n Vertex getV0 ();\n Vertex getV1 ();\n Object getWeight ();\n boolean isDirected ();\n Vertex getMate (Vertex vertex);\n}", "public Relation select(Condition c) throws RelationException;", "public Edge edgeAt( int index ) {\r\n return (Edge)edges.elementAt(index);\r\n }", "@Override\n public StorageCapacity find(String key, String value) {\n Session session = Hibernate.createSession();\n\n if (session != null) {\n try {\n session.beginTransaction();\n\n CriteriaBuilder criteriaBuilder = session.getCriteriaBuilder();\n CriteriaQuery<StorageCapacity> criteriaQuery = criteriaBuilder.createQuery(StorageCapacity.class);\n Root<StorageCapacity> root = criteriaQuery.from(StorageCapacity.class);\n\n criteriaQuery.select(root).where(criteriaBuilder.equal(root.get(key), value));\n\n Query<StorageCapacity> query = session.createQuery(criteriaQuery);\n StorageCapacity result = query.getSingleResult();\n\n session.getTransaction().commit();\n\n return result;\n }\n catch (Exception exception) {\n session.getTransaction().rollback();\n\n System.out.println(\"Unable to find storage capacity.\");\n exception.printStackTrace();\n }\n }\n\n return null;\n }", "public int getEdge(int v1, int v2) {\n\n\t\treturn edges[v1][v2];\n\t}", "private EdgeType getEdgeType()\r\n\t{\r\n\t return edgeType;\r\n\t}", "public Edge getAnyEdge()\n {\n for (GraphElement element : elements) {\n if(element instanceof Edge) {\n return (Edge) element;\n }\n }\n return null;\n }", "public Map<String, String> getEdge() {\n\t\tif (edge == null) {\n\t\t\tsetEdge(new HashMap<String, String>());\n\t\t}\n\t\treturn edge;\n\t}", "uk.ac.cam.acr31.features.javac.proto.GraphProtos.FeatureEdgeOrBuilder getEdgeOrBuilder(\n int index);", "@Override\n public Collection<edge_data> getE(int node_id) {\n return ((NodeData) this.nodes.get(node_id)).getNeighborEdges().values();\n }", "public List<IEdge> getAllEdges();", "public static void orderGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) {\n manager.orders().getWithResponse(\"testedgedevice\", \"GroupForEdgeAutomation\", com.azure.core.util.Context.NONE);\n }", "public EDataT getEdgeData( VKeyT fromKey, VKeyT toKey )\n throws NoSuchVertexException;", "public HashMap<String, Edge> getEdgeList () {return edgeList;}", "public Edge getEdge(int source, int dest) {\r\n Edge target =\r\n new Edge(source, dest, Double.POSITIVE_INFINITY);\r\n for (Edge edge : edges[source]) {\r\n if (edge.equals(target))\r\n return edge; // Desired edge found, return it.\r\n }\r\n return target; // Desired edge not found.\r\n }", "List<IEdge> getAllEdges();", "@NotNull\n List<ExpLineageEdge> getEdges(ExpLineageEdge.FilterOptions options);", "public edge_data edgeOfFruit(int fruit_id){\n Fruit f = getFruitbyID(fruit_id);\n Iterator<node_data> nodesIter = this.Graph.getV().iterator();\n\n while(nodesIter.hasNext()){\n node_data node = nodesIter.next();\n Iterator<edge_data> edges = Graph.getE(node.getKey()).iterator();\n\n while(edges.hasNext()){\n edge_data e = edges.next();\n\n node_data src_node = Graph.getNode(e.getSrc());\n node_data dst_node = Graph.getNode(e.getDest());\n\n double sum = (src_node.getLocation().x() + dst_node.getLocation().x());\n\n double sideA = f.getLocation().distance2D(dst_node.getLocation());\n double sideB = src_node.getLocation().distance2D( f.getLocation());\n\n double sumSides = sideA + sideB;\n double totalDistance = src_node.getLocation().distance2D(dst_node.getLocation());\n\n if (Math.abs(sumSides - totalDistance) <= 0.00001){\n return e;\n }\n\n }\n }\n System.out.println(\"Problem with getting the edge for fruits\");\n return null;\n }", "public Edge[] getEdges(String edgeTypeName)\r\n {\n final EdgeTypeHolder eth = ethMap.get(edgeTypeName);\n if(eth==null)\n return new Edge[0];\n final Collection<Edge> col = eth.getEdges();\r\n return col.toArray(new Edge[col.size()]);\r\n }", "@Override\n\tpublic List<Edge> getAllEdges() {\n\n\t\tList<Edge> res = new ArrayList<Edge>();\n\t\tResultSet resultSet = null;\n\n\t\ttry {\n\t\t\tString getAllEdges = \"SELECT node_from, node_to, distance FROM routefinder.relations\";\n\t\t\tresultSet = null;\n\t\t\tpstmt = conn.prepareStatement(getAllEdges);\n\t\t\tresultSet = pstmt.executeQuery();\n\t\t\twhile (resultSet.next()) {\n\t\t\t\tEdge edge = new Edge();\n\t\t\t\tedge.setNode1(Database.getNodeFromId(resultSet.getInt(\"node_from\")));\n\t\t\t\tedge.setNode2(Database.getNodeFromId(resultSet.getInt(\"node_to\")));\n\t\t\t\tedge.setDist(resultSet.getDouble(\"distance\"));\n\t\t\t\tres.add(edge);\n\t\t\t}\n\n\t\t\treturn res;\n\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tJdbcConnect.resultClose(resultSet, pstmt);\n\t\t}\n\n\t\treturn null;\n\t}", "private Edge derive(Edge edge, RelationGraph[] operands) {\n int time = edge.getTime();\n int length = edge.getDerivationLength();\n for (RelationGraph g : operands) {\n Edge e = g.get(edge);\n if (e == null) {\n return null;\n }\n time = Math.max(time, e.getTime());\n length = Math.max(length, e.getDerivationLength());\n }\n return edge.with(time, length);\n }", "protected EdgeFigure getEdgeFigure() {\r\n\t\treturn (EdgeFigure)getFigure();\r\n\t}", "public Collection<Edge> getE(int node_id) {\n\tCollection<Edge> list=new ArrayList<Edge>();\n\t\n\tif(getNodes().containsKey(node_id))\n\t{\n\t\tNode n=(Node) getNodes().get(node_id);\n\t\tlist.addAll(n.getEdgesOf().values());\n\t}\n\treturn list;\n}", "public BufferedImage getEdge() {\n\t\treturn edge;\n\t}", "String getIdEdge();", "public abstract boolean getEdge(Point a, Point b);", "public Edge findEdge(Node n1, Node n2){\r\n for(Edge e: getListEdges()){\r\n if(e.getNode1().getId() == n1.getId() && e.getNode2().getId() == n2.getId())\r\n return e;\r\n if(e.getNode1().getId() == n2.getId() && e.getNode2().getId() == n1.getId())\r\n return e;\r\n }\r\n return null;\r\n }", "public Id GetNearestEdge(Coordinate coord) {\n\t\tfloat distsq = Float.MAX_VALUE;\n\t\tId nearest = null;\n\t\tfor (Edge e : listOfEdges) {\n\t\t\tif (e == null) continue;\n\t\t\tfloat mydistsq = e.getDistanceSq(coord, this);\n\t\t\tif (mydistsq < distsq && mydistsq >= 0.0f) {\n\t\t\t\tdistsq = mydistsq;\n\t\t\t\tnearest = e.getId();\n\t\t\t}\n\t\t}\n\t\treturn nearest;\n\t}", "public EdgeFilter getEdgeFilter() {\n return edgeFilter;\n }", "public DCEL_Edge getConnectingEdge(Cell c) {\n\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tIterator<DCEL_Edge> it = (Iterator<DCEL_Edge>) face.edges().iterator();\n\n\t\twhile (it.hasNext()) {\n\n\t\t\tDCEL_Edge e = it.next();\n\n\t\t\tif ((e.getLeftFace().equals(this.face) && e.getRightFace().equals(\n\t\t\t\t\tc.face))\n\t\t\t\t\t|| (e.getLeftFace().equals(c.face) && e.getRightFace()\n\t\t\t\t\t\t\t.equals(this.face))) {\n\n\t\t\t\treturn e;\n\t\t\t}\n\n\t\t}\n\n\t\tSystem.err\n\t\t\t\t.println(\"Edge Not Found-Error: This should not have happened\");\n\t\treturn null;\n\t}", "public List<AdjacentVertexWithEdge> getNeighbourhood(SubGraph subGraph) {\n if (disable) {\n return null;\n }\n \n CacheKey cacheKey = new CacheKey(subGraph);\n List<AdjacentVertexWithEdge> neighbourhood = cachedNeighborhoods.get(cacheKey);\n if (neighbourhood != null) {\n // moved cached key to the end of the queue\n lruQueue.remove(cacheKey);\n lruQueue.add(cacheKey);\n }\n \n return neighbourhood;\n }", "public double getEdgeCapacity() {\r\n\t\treturn this.capacity;\r\n\t}", "public Edge[] getEdges()\r\n {\r\n if(edges == null)\r\n\t{\r\n\t edges = new Edge[numEdges()];\r\n\t int i = 0;\r\n\t for (final EdgeTypeHolder eth : ethMap.values())\r\n\t\tfor (final Edge e : eth.getEdges())\r\n\t\t edges[i++] = e;\r\n\t}\r\n return edges.clone();\r\n }", "public Edge getEdge(String edgeTypeName, Node source, Node dest)\r\n {\r\n\treturn source.getEdge(edgeTypeName, dest);\r\n }", "public double getEdge(int node1, int node2)\n{\n\tif(getNodes().containsKey(node1) && getNodes().containsKey(node2))\n\t{\n\t\tNode s=(Node) getNodes().get(node1);\n\t\tif(s.getEdgesOf().containsKey(node2))\n\t\t{\n \t\t\t\t\n\t\treturn s.getEdgesOf().get(node2).get_weight();\n\t\t\t\t\t\t\n\t\t}\n\t}\n\t \n\t return -1;\n\n}", "public Set<E> getEdges();", "Collection<E> edges();", "public uk.ac.cam.acr31.features.javac.proto.GraphProtos.FeatureEdge getEdge(int index) {\n return edge_.get(index);\n }", "E getBestIncoming();", "private List<Graph.Edge> getEdge(PathMap map) {\n // record the visited coordinates\n List<Coordinate> visited = new ArrayList<>();\n // get all coordinates from the map\n List<Coordinate> allCoordinates = map.getCoordinates();\n // for record all generated edges\n List<Graph.Edge> edges = new ArrayList<>();\n\n\n while (visited.size() <= allCoordinates.size() - 1) {\n for (Coordinate temp : allCoordinates) {\n\n if (visited.contains(temp)) {\n continue;\n }\n visited.add(temp);\n List<Coordinate> neighbors = map.neighbours(temp);\n for (Coordinate tempNeighbour : neighbors) {\n edges.add(new Graph.Edge(temp, tempNeighbour, tempNeighbour.getTerrainCost()));\n }\n }\n }\n // trim impassable coordinates\n List<Graph.Edge> fEdges = new ArrayList<>();\n for (Graph.Edge dd : edges) {\n if (dd.startNode.getImpassable() || dd.endNode.getImpassable()) {\n continue;\n }\n fEdges.add(dd);\n }\n return fEdges;\n }", "List<Edge> getPath() throws NoPathFoundException;", "public Edge[] getEdges(EdgeType et)\r\n {\r\n\treturn getEdges(et.getName());\r\n }", "public abstract void map(Edge queryEdge, Edge graphEdge);", "@Override\n Device retrieveImpl(ExecutionDAG.DAGVertex vertex, List<Device> devices) {\n long[] alreadyPresentDataSize = new long[devicesManager.getNumberOfGPUsToUse()];\n // Compute the amount of data on each device, and if any device has any data at all;\n computeDataSizeOnDevices(vertex, alreadyPresentDataSize);\n // If not device has at least X% of data available, it's not worth optimizing data locality (exploration preferred to exploitation);\n if (findIfAnyDeviceHasEnoughData(alreadyPresentDataSize, vertex, devices)) {\n // Find device with maximum available data;\n return selectDeviceWithMostData(devices, alreadyPresentDataSize);\n } else {\n // No data is present on any GPU: select the device with round-robin;\n return roundRobin.retrieve(vertex, devices);\n }\n }", "private Collection<Edge> getEdges()\r\n\t{\r\n\t return eSet;\r\n\t}", "static private Edge LocateEdge(ArrayList<Integer> v,ArrayList<Edge> edgesList)\n\t{\n\t\tfor (Iterator<Edge> iterator = edgesList.iterator(); iterator.hasNext();)\n\t\t{\n\t Edge e = iterator.next();\n\t int x = e.nodeI;\n\t int y = e.nodeJ;\n\t\t\tint xv = v.indexOf(x);\n\t\t\tint yv = v.indexOf(y);\n\t\t\tif (xv > -1 && yv == -1)\n\t\t\t{\n\t\t\t\treturn(e);\n\t\t\t}\n\t\t\tif (xv == -1 && yv > -1)\n\t\t\t{\n\t\t\t\treturn(e);\n\t\t\t}\n\t\t}\n\t\t//Error condition\n\t\treturn(new Edge(-1,-1,0.0));\n\t}", "public uk.ac.cam.acr31.features.javac.proto.GraphProtos.FeatureEdge getEdge(int index) {\n if (edgeBuilder_ == null) {\n return edge_.get(index);\n } else {\n return edgeBuilder_.getMessage(index);\n }\n }", "Storage selectByPrimaryKey(StorageKey key);", "public uk.ac.cam.acr31.features.javac.proto.GraphProtos.FeatureEdgeOrBuilder getEdgeOrBuilder(\n int index) {\n return edge_.get(index);\n }", "ErpOaLicKey selectByPrimaryKey(String licFlow);", "public uk.ac.cam.acr31.features.javac.proto.GraphProtos.FeatureEdgeOrBuilder getEdgeOrBuilder(\n int index) {\n if (edgeBuilder_ == null) {\n return edge_.get(index); } else {\n return edgeBuilder_.getMessageOrBuilder(index);\n }\n }", "public abstract boolean hasMapped(Edge queryEdge);", "public interface GraphSearchAlgorythm<T> {\n List<GraphEdge<T>> getPath(GraphVerticesStore<T> Vertices, T from, T to);\n}", "public static ArrayList<Edge> getAllEdges(){\n\t\treturn edgeList;\n\t}", "public Node<E> get(E e){\n Node<E> current = head.getNext();\n while (current != tail) {\n if (current.getValue() == e) {\n return current;\n }\n current = current.getNext();\n }\n return null;\n }", "java.util.List<uk.ac.cam.acr31.features.javac.proto.GraphProtos.FeatureEdge> \n getEdgeList();", "int getReverseEdgeKey();", "private Optional<Vertex> getVertexByIndex(GraphTraversalSource source, UUID id, String collectionName) {\n Optional<Vertex> vertexOpt = indexHandler.findById(id);\n\n // Return if the neo4j Node ID matches no vertex (extreme edge case)\n if (!vertexOpt.isPresent()) {\n LOG.error(Logmarkers.databaseInvariant,\n \"Vertex with tim_id {} is found in index with id {}L but not in graph database\", id);\n return Optional.empty();\n }\n\n // Get the latest version of the found Vertex\n Vertex foundVertex = vertexOpt.get();\n int infinityGuard = 0;\n while (foundVertex.vertices(Direction.OUT, \"VERSION_OF\").hasNext()) {\n // The neo4j index Node is one version_of behind the actual node\n foundVertex = foundVertex.vertices(Direction.OUT, \"VERSION_OF\").next();\n if (++infinityGuard >= MAX_VERSION_OF_DEPTH) {\n LOG.error(Logmarkers.databaseInvariant, \"Vertices with tim_id {} might have circular VERSION_OF\", id);\n return Optional.empty();\n }\n }\n\n // Only if this latest version is truly registered as latest return this as a successful hit\n if (foundVertex.value(\"isLatest\")) {\n return Optional.of(foundVertex);\n } else {\n LOG.error(Logmarkers.databaseInvariant,\n \"Last version of vertex with tim_id {} is not marked as isLatest=true\", id);\n }\n\n // Failed to find vertex in lucene index, so return\n return Optional.empty();\n }", "public Enumeration edges();" ]
[ "0.65518", "0.58268064", "0.55952567", "0.5539852", "0.54549474", "0.5447354", "0.5419852", "0.5411835", "0.5392296", "0.53913015", "0.5379459", "0.5307664", "0.5278309", "0.5268833", "0.5267464", "0.5193911", "0.5125481", "0.50923896", "0.50898045", "0.508638", "0.5002056", "0.49996608", "0.49798116", "0.49653086", "0.49641913", "0.49573785", "0.49224976", "0.48997778", "0.4895132", "0.48905158", "0.4887189", "0.48748666", "0.48726305", "0.48596662", "0.48425338", "0.48326966", "0.48326463", "0.4807027", "0.48007068", "0.479511", "0.47903636", "0.4789165", "0.47816345", "0.47783077", "0.47636983", "0.47567368", "0.47561422", "0.4750143", "0.47313833", "0.4731259", "0.4712705", "0.4680286", "0.46788242", "0.46781135", "0.467661", "0.4659915", "0.4648247", "0.46305394", "0.46275312", "0.46192086", "0.46150744", "0.46068597", "0.46067092", "0.4601883", "0.46006936", "0.4596608", "0.4589807", "0.45897028", "0.45893538", "0.45750034", "0.45478082", "0.45465302", "0.45424768", "0.45387998", "0.4538584", "0.4535163", "0.4531765", "0.45286328", "0.4518798", "0.45162228", "0.45149758", "0.4498368", "0.44926757", "0.44849402", "0.44666755", "0.44641587", "0.44558626", "0.44550228", "0.4450411", "0.44411075", "0.44304687", "0.4429891", "0.4429312", "0.44229802", "0.4418202", "0.4415728", "0.44149986", "0.4414602", "0.44141594", "0.44123527" ]
0.46090746
61
This function queries the underlying storage and retrieves the vertex matching the given criteria.
@Deprecated public abstract Vertex getVertex(String vertexHash);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Vertex getVertex(int index);", "private Optional<Vertex> getVertexByIndex(GraphTraversalSource source, UUID id, String collectionName) {\n Optional<Vertex> vertexOpt = indexHandler.findById(id);\n\n // Return if the neo4j Node ID matches no vertex (extreme edge case)\n if (!vertexOpt.isPresent()) {\n LOG.error(Logmarkers.databaseInvariant,\n \"Vertex with tim_id {} is found in index with id {}L but not in graph database\", id);\n return Optional.empty();\n }\n\n // Get the latest version of the found Vertex\n Vertex foundVertex = vertexOpt.get();\n int infinityGuard = 0;\n while (foundVertex.vertices(Direction.OUT, \"VERSION_OF\").hasNext()) {\n // The neo4j index Node is one version_of behind the actual node\n foundVertex = foundVertex.vertices(Direction.OUT, \"VERSION_OF\").next();\n if (++infinityGuard >= MAX_VERSION_OF_DEPTH) {\n LOG.error(Logmarkers.databaseInvariant, \"Vertices with tim_id {} might have circular VERSION_OF\", id);\n return Optional.empty();\n }\n }\n\n // Only if this latest version is truly registered as latest return this as a successful hit\n if (foundVertex.value(\"isLatest\")) {\n return Optional.of(foundVertex);\n } else {\n LOG.error(Logmarkers.databaseInvariant,\n \"Last version of vertex with tim_id {} is not marked as isLatest=true\", id);\n }\n\n // Failed to find vertex in lucene index, so return\n return Optional.empty();\n }", "Vertex getVertex();", "public V getVertex(int index);", "private Vertex getVertexFor(Agent ag) {\n return getDataFor(ag).vertex;\n }", "abstract public Vertex getReadIn();", "public Vertex getVertex(String name) {\n return mVertices.get(name);\n }", "private Vertex getVertex( String vertexName )\n {\n Vertex v = vertexMap.get( vertexName );\n if( v == null )\n {\n v = new Vertex( vertexName );\n vertexMap.put( vertexName, v );\n }\n return v;\n }", "public Vertex getVertex(String place)\n\t{\n\t\treturn vertices.get(place);\n\t}", "private Vertice getVertex(String name) {\r\n Vertice v = (Vertice) vertices.get(name);\r\n if (v == null) {\r\n v = new Vertice(name);\r\n vertices.put(name, v);\r\n }\r\n return v;\r\n }", "boolean contains(int vertex);", "public Vertex getVertex(int name) {\n\t\treturn vertices.get(name);\n\t}", "public VDataT getVertexData( VKeyT key ) throws NoSuchVertexException;", "private List<E> get(V vertex) {\n return this.data.getOrDefault(vertex, new BinarySearchTree<>()).getTreeByInOrder_depthFirst();\n }", "Storage selectByPrimaryKey(StorageKey key);", "Storage selectByPrimaryKey(Integer recordId);", "public Object getVertex(){\r\n return this.vertex;\r\n }", "private Optional<Vertex> getAsset(Vertex asset) {\n GraphTraversalSource g = graphFactory.getGraphTraversalSource();\n Object vertexGuid = g.V(asset.id()).elementMap(PROPERTY_KEY_ENTITY_GUID).toList().get(0).get(PROPERTY_KEY_ENTITY_GUID);\n Vertex graphVertex = g.V().has(PROPERTY_KEY_ENTITY_GUID, vertexGuid).next();\n Object vertexId = graphVertex.id();\n Iterator<Vertex> result = null;\n if (RELATIONAL_COLUMN.equalsIgnoreCase(asset.label())) {\n result = g.V(vertexId).emit().repeat(bothE().otherV().simplePath()).times(1).or(hasLabel(RELATIONAL_TABLE));\n }\n if (TABULAR_COLUMN.equalsIgnoreCase(asset.label()) || TABULAR_FILE_COLUMN.equalsIgnoreCase(asset.label())) {\n result = g.V(vertexId).emit().repeat(bothE().otherV().simplePath()).times(2).\n or(hasLabel(P.within(DATA_FILE_AND_SUBTYPES)));\n }\n if (EVENT_SCHEMA_ATTRIBUTE.equalsIgnoreCase(asset.label())) {\n result = g.V(vertexId).emit().repeat(bothE().otherV().simplePath()).times(3).or(hasLabel(TOPIC));\n }\n commitTransaction(g);\n if (result == null) {\n return Optional.empty();\n } else {\n return Optional.of(result.next());\n }\n\n }", "@Override\n public StorageCapacity find(StorageCapacity storageCapacity) {\n Session session = Hibernate.createSession();\n\n if (session != null) {\n try {\n session.beginTransaction();\n\n CriteriaBuilder criteriaBuilder = session.getCriteriaBuilder();\n CriteriaQuery<StorageCapacity> criteriaQuery = criteriaBuilder.createQuery(StorageCapacity.class);\n Root<StorageCapacity> root = criteriaQuery.from(StorageCapacity.class);\n\n Predicate[] predicates = new Predicate[]{\n criteriaBuilder.equal(root.get(\"size\"), storageCapacity.getSize())\n };\n\n criteriaQuery.select(root).where(predicates);\n\n Query<StorageCapacity> query = session.createQuery(criteriaQuery);\n StorageCapacity result = query.getSingleResult();\n\n session.getTransaction().commit();\n\n return result;\n }\n catch (Exception exception) {\n session.getTransaction().rollback();\n\n System.out.println(\"Unable to find storage capacity.\");\n exception.printStackTrace();\n }\n }\n\n return storageCapacity;\n }", "public E3DTexturedVertex getVertex(int index){\r\n if(index >= 0 && index < 3)\r\n return vertices[index];\r\n else\r\n return null;\r\n }", "@Override\n\tpublic Vertex getElement() {\n\t\tFramedGraph fg = Tx.getActive().getGraph();\n\t\tif (fg == null) {\n\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\"Could not find thread local graph. The code is most likely not being executed in the scope of a transaction.\");\n\t\t}\n\n\t\tVertex vertexForId = fg.getVertex(id);\n\t\tif (vertexForId == null) {\n\t\t\tthrow new RuntimeException(\"No vertex for Id {\" + id + \"} could be found within the graph\");\n\t\t}\n\t\tElement vertex = ((WrappedVertex) vertexForId).getBaseElement();\n\n\t\t// Unwrap wrapped vertex\n\t\tif (vertex instanceof WrappedElement) {\n\t\t\tvertex = (Vertex) ((WrappedElement) vertex).getBaseElement();\n\t\t}\n\t\treturn (Vertex) vertex;\n\t}", "public V getVertex()\r\n/* */ {\r\n/* 198 */ return (V)this.vertex;\r\n/* */ }", "Vertex findVertex(char v) {\r\n\t\tfor (int i = 0; i < vertices.size(); i++) {\r\n\t\t\tif (vertices.get(i).label == v)\r\n\t\t\t\treturn vertices.get(i);\r\n\t\t}\r\n\t\treturn null; // return null if not found.\r\n\t}", "boolean contains(Vertex vertex);", "public HitVertex getVertex(String id) {\n\t\treturn hitVertices.get(id);\n\t}", "Engine selectByPrimaryKey(String num);", "synchronized Vertex<V, E, M> getOrCreateVertex(long id) {\n Vertex<V, E, M> vertex = vertices.get(id);\n if (vertex == null) {\n vertex = new Vertex<>(id, this);\n this.vertices.put(id, vertex);\n }\n\n return vertex;\n }", "public String depthFirstSearch( AnyType start_vertex ) throws VertexException {\n \n StringBuffer buffer = new StringBuffer();\n \n // ----------------------------\n // TODO: Add your code here\n // ----------------------------\n ConstantTimeStack<Vertex<AnyType>> stack = new ConstantTimeStack<Vertex<AnyType>>();\n boolean exists = false;\n Vertex<AnyType> S = new Vertex<AnyType>(start_vertex);\n int counter = 0;\n //loop through to set each vertex to not visited\n for( int i = 0; i < vertex_adjacency_list.size(); i++){\n vertex_adjacency_list.get(i).setVisited(-1);\n //if find the start vertex then set index position to counter\n if(vertex_adjacency_list.get(i).compareTo(S) == 0){\n exists = true;\n vertex_adjacency_list.get(i).setVisited(counter);\n counter = i;\n }\n }\n //if doesn't exist then through exception\n if(exists == false){\n throw new VertexException(\"Start Vertex does not exist\");\n }\n //if it does exist then push start node onto stack, set visited \n else if(exists){\n stack.push(vertex_adjacency_list.get(counter));\n vertex_adjacency_list.get(counter).setVisited(1);\n Vertex <AnyType> e = vertex_adjacency_list.get(counter);\n counter = 2;\n int n = e.numberOfAdjacentVertices();\n try{\n \n while(true){\n //loop through e's adjacent vertices \n for (n = e.numberOfAdjacentVertices()-1; n >=0 ; n--){\n //if the adacent vertex has not been visited\n if(e.getAdjacentVertex(n).hasBeenVisited()==false){\n //change e to adjacent vertex and push onto stack\n e = e.getAdjacentVertex(n);\n stack.push(e);\n //set e as visited at counter\n e.setVisited(counter);\n counter++;\n //reset n to e's num of vertices\n n = e.numberOfAdjacentVertices();\n }\n //if it has been visited and it's the first node in list\n //then pop it off the stack and then set e to new top\n //set n to new num of vertices\n else if(e.getAdjacentVertex(n).hasBeenVisited() && n == 0){\n stack.pop();\n e = stack.peek();\n n = e.numberOfAdjacentVertices();\n }\n }\n }\n }catch(EmptyStackException m){\n }\n }\n //loop through the list and print each with when it was visited\n for(int k = 0; k< vertex_adjacency_list.size(); k++){\n buffer.append(vertex_adjacency_list.get(k) + \":\" + vertex_adjacency_list.get(k).getVisited()+ \"\\n\");\n }\n \n return buffer.toString();\n \n }", "public native VertexNode first();", "public Vertex findVertById(int id) throws SQLException {\n\t\treturn rDb.findVertById(id);\n\t}", "@Override\n public StorageCapacity find(String key, String value) {\n Session session = Hibernate.createSession();\n\n if (session != null) {\n try {\n session.beginTransaction();\n\n CriteriaBuilder criteriaBuilder = session.getCriteriaBuilder();\n CriteriaQuery<StorageCapacity> criteriaQuery = criteriaBuilder.createQuery(StorageCapacity.class);\n Root<StorageCapacity> root = criteriaQuery.from(StorageCapacity.class);\n\n criteriaQuery.select(root).where(criteriaBuilder.equal(root.get(key), value));\n\n Query<StorageCapacity> query = session.createQuery(criteriaQuery);\n StorageCapacity result = query.getSingleResult();\n\n session.getTransaction().commit();\n\n return result;\n }\n catch (Exception exception) {\n session.getTransaction().rollback();\n\n System.out.println(\"Unable to find storage capacity.\");\n exception.printStackTrace();\n }\n }\n\n return null;\n }", "GeometricalObject getObject(int index);", "public String vertexName();", "public native GLatLng getVertex(GPolyline self, int index)/*-{\r\n\t\treturn self.getVertex(index);\r\n\t}-*/;", "public String getVertex() {\n\t\treturn vertices.get(0);\n\t}", "public TransactionBuilder checkInternalVertexExistence();", "public List<Vertex> findAllVertices() throws SQLException {\n\t\treturn rDb.findAllVertices();\n\t}", "Online selectByPrimaryKey(String hash);", "Vertex createVertex();", "public abstract Proximity2DResult getNearestVertex(Geometry geom,\n\t\t\tPoint inputPoint);", "abstract public Vertex getEvaluationResult();", "Future<Option<SelectedSnapshot>> doLoadAsync(String persistenceId, SnapshotSelectionCriteria criteria);", "@Override\n Device retrieveImpl(ExecutionDAG.DAGVertex vertex, List<Device> devices) {\n long[] alreadyPresentDataSize = new long[devicesManager.getNumberOfGPUsToUse()];\n // Compute the amount of data on each device, and if any device has any data at all;\n computeDataSizeOnDevices(vertex, alreadyPresentDataSize);\n // If not device has at least X% of data available, it's not worth optimizing data locality (exploration preferred to exploitation);\n if (findIfAnyDeviceHasEnoughData(alreadyPresentDataSize, vertex, devices)) {\n // Find device with maximum available data;\n return selectDeviceWithMostData(devices, alreadyPresentDataSize);\n } else {\n // No data is present on any GPU: select the device with round-robin;\n return roundRobin.retrieve(vertex, devices);\n }\n }", "public Collection< VDataT > vertexData();", "List<V> getVertexList();", "@Override\n public int fetchNextComplementaryVertexId(int smallest) {\n if (vertexId >= smallest) {\n return ++vertexId;\n } else {\n return fetchNextComplementaryVertexIdCoach(smallest);\n }\n }", "public GeometricalObject getObject(int index);", "public static HashMap<String, VertexSchema> getVertexLookupForVersion(String version)\n throws SchemaProviderException {\n if (vertexLookup == null || vertexLookup.isEmpty()) {\n loadModels();\n } else if (!vertexLookup.containsKey(version)) {\n throw new SchemaProviderException(\"Error loading oxm model: \" + version);\n }\n return vertexLookup.get(version);\n }", "protected abstract Graph fetchGraph() throws IdNotFoundException;", "public String breadthFirstSearch( AnyType start_vertex ) throws VertexException {\n \n StringBuffer buffer = new StringBuffer();\n \n // ----------------------------\n // TODO: Add your code here\n // ----------------------------\n boolean exists = false;\n Vertex<AnyType> S = new Vertex<AnyType>(start_vertex);\n int counter = 1;\n //make new vertex to check if its in list\n //make queue to hold vertices\n SemiConstantTimeQueue<Vertex<AnyType>> queue = new SemiConstantTimeQueue<Vertex<AnyType>>();\n //loop through and set not visited\n for( int i = 0; i < vertex_adjacency_list.size(); i++){\n vertex_adjacency_list.get(i).setVisited(-1);\n //if it's in list then set exists to true\n //and set visited \n if(vertex_adjacency_list.get(i).compareTo(S) == 0){\n exists = true;\n vertex_adjacency_list.get(i).setVisited(counter);\n counter = i;\n }\n } \n //if doesn't exist then throw the exception\n if(exists == false){\n throw new VertexException(\"Start Vertex does not exist\");\n }\n //make new queue\n queue.add(vertex_adjacency_list.get(counter));\n vertex_adjacency_list.get(counter).setVisited(1);\n counter = 1;\n int k=0;\n Vertex<AnyType>e;\n //while the queue isn't empty\n while(queue.peek() !=null){\n //make e the top of the queue \n e = queue.peek(); \n //go through the list and if you reach the begining it exits loop\n for( k = 0; k < vertex_adjacency_list.size()-1; k++){\n if(vertex_adjacency_list.get(k).compareTo(e)==0){\n break;\n }\n } \n //go through loop and check if visited, if not then add it to queue, set visited\n for( int j = 0; j< vertex_adjacency_list.get(k).numberOfAdjacentVertices(); j++){\n if(vertex_adjacency_list.get(k).getAdjacentVertex(j).hasBeenVisited()==false){\n counter++;\n queue.add(vertex_adjacency_list.get(k).getAdjacentVertex(j));\n vertex_adjacency_list.get(k).getAdjacentVertex(j).setVisited(counter);\n }\n }\n //remove from queue when through loop once\n k++;\n queue.remove();\n }\n //loop through list and print vertex and when it was visited\n for(int o = 0; o< vertex_adjacency_list.size(); o++){\n buffer.append(vertex_adjacency_list.get(o) + \":\" + vertex_adjacency_list.get(o).getVisited()+ \"\\n\");\n }\n return buffer.toString();\n }", "public V getParent(V vertex);", "public E getData(String vertex)\r\n\t{\r\n\t\tif(!this.dataMap.containsKey(vertex))\r\n\t\t{\r\n\t\t\tthrow new IllegalArgumentException(\"Vertex does not exist in the graph!\");\r\n\t\t}\r\n\t\t\r\n\t\treturn this.dataMap.get(vertex);\r\n\t}", "public Tuple get(Key k) throws RelationException;", "public boolean containsVertex(V vertex);", "public boolean containsVertex(V vertex);", "Set<Vertex> getVertices();", "ErpOaLicKey selectByPrimaryKey(String licFlow);", "private int vertexIndex(T obj){\n for (int i = 0; i < n; i++){\n if (obj.equals(vertices[i])){\n return i;\n }\n }\n return NOT_FOUND;\n }", "protected abstract NativeSQLStatement createNativeContainsStatement(Geometry geom);", "void getVertices() {\r\n\t\tSystem.out.println(\"Enter your vertices:\");\r\n\t\tarrIndexToVertexMap = new HashMap<>();\r\n\t\ttry {\r\n\t\t\tfor (int i = 0; i < numberOfVertices; i++) {\r\n\t\t\t\tarrIndexToVertexMap.put(i, sc.next());\r\n\t\t\t}\r\n\t\t\tsc.close();\r\n\t\t} catch (RuntimeException re) {\r\n\t\t\tSystem.out.println(\"Error at method:: getVertices || Description:\" + re);\r\n\t\t}\r\n\t}", "public DSAGraphVertex getVertex(String label)\n\t{\n\t\tDSAGraphVertex temp, target = null;\n\t\tIterator<DSAGraphVertex> itr = vertices.iterator();\n\t\tif(vertices.isEmpty()) // case: list is empty\n\t\t{\n\t\t\tthrow new NoSuchElementException(\"Vertices list is empty.\");\n\t\t}\n\t\telse //searches for target\n\t\t{\n\t\t\twhile(itr.hasNext()) //iterates until target is found\n\t\t\t{\n\t\t\t\ttemp = itr.next();\n\t\t\t\tif(temp.getLabel().equals(label))\n\t\t\t\t{\n\t\t\t\t\ttarget = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(target == null) // case: not found\n\t\t{\n\t\t\tthrow new NoSuchElementException(\"Label |\" + label + \"| not found\");\n\t\t}\n\n\t\treturn target;\n\t}", "public boolean hasVertex(T vert);", "@NativeType(\"uint32_t\")\n public static int bgfx_get_avail_transient_vertex_buffer(@NativeType(\"uint32_t\") int _num, @NativeType(\"bgfx_vertex_layout_t const *\") BGFXVertexLayout _layout) {\n return nbgfx_get_avail_transient_vertex_buffer(_num, _layout.address());\n }", "public interface GraphSearchAlgorythm<T> {\n List<GraphEdge<T>> getPath(GraphVerticesStore<T> Vertices, T from, T to);\n}", "public Vertex getAnyVertex()\n {\n for (GraphElement element : elements) {\n if(element instanceof Vertex) {\n return (Vertex) element;\n }\n }\n return null;\n }", "public Agent getVertexPropertiesOwner(Vertex v) {\n\treturn lockedVertices.get(v);\n }", "@Override\n public Iterable<E> getNeighbors(E vertex) {\n if (vertex != null && dictionary.containsKey(vertex)) {\n return dictionary.get(vertex);\n } else {\n return null;\n }\n }", "boolean containsVertex(V v);", "@Override\n public boolean contains(V vertex)\n {\n if (vertex.equals(null)){\n throw new IllegalArgumentException();\n }\n return graph.containsKey(vertex);\n }", "public boolean isVertex( VKeyT key );", "@Test\r\n public void testVertices() {\r\n System.out.println(\"vertices\");\r\n MyDigraph instance = new MyDigraph();\r\n\r\n Object v1Element = 1;\r\n Vertex v1 = instance.insertVertex(v1Element);\r\n\r\n Collection colection = instance.vertices();\r\n boolean result = colection.contains(v1);\r\n boolean expectedResult = true;\r\n assertEquals(expectedResult, result);\r\n\r\n instance.removeVertex(v1);\r\n result = colection.contains(v1);\r\n expectedResult = false;\r\n assertEquals(expectedResult, result);\r\n }", "public int getvertex() {\n\t\treturn this.v;\n\t}", "CptDataStore selectByPrimaryKey(String id);", "public java.util.List<V> getVertices();", "public Vertex getVertex() {\n return curr;\n }", "List<V> getShortestPath(V vertex);", "@Override\r\n\tpublic StoragePrimary query(StoragePrimary storagePrimary) {\n\t\treturn storagePrimaryDao.query(storagePrimary);\r\n\t}", "public boolean pathExists(int startVertex, int stopVertex) {\n// your code here\n ArrayList<Integer> fetch_result = visitAll(startVertex);\n if(fetch_result.contains(stopVertex)){\n return true;\n }\n return false;\n }", "private Vertex getLastVertexSeen(Agent ag) {\n return getDataFor(ag).lastVertexSeen;\n }", "public Town getVertex(String name) {\n\t\tfor (Town t : towns) {\n\t\t\tif (t.getName().equals(name)) {\n\t\t\t\treturn t;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "@Test\r\n void test_insert_1_vertex_check() {\r\n graph.addVertex(\"1\");\r\n vertices = graph.getAllVertices();\r\n if (!vertices.contains(\"1\"))\r\n fail(\"Insert not working!!\");\r\n }", "public Vertice getModelVertice(Vector3f _pos){\n\t\tint shortestIndex = -1;\n\t\tfloat shortestDistance = Float.MAX_VALUE;\n\t\tfloat dist = Float.MAX_VALUE;\n\t\tVertice pickVertice;\n\t\tfor(int i = 0; i < getModelVerticesCount(); i++){\n\t\t\tpickVertice = getModelVertice(i);\n\t\t\tdist = _pos.distance(pickVertice);\n\t\t\tif(dist < shortestDistance){\n\t\t\t\tshortestDistance = dist;\n\t\t\t\tshortestIndex = i;\n\t\t\t}\n\t\t}\n\t\treturn modelVertices.get(shortestIndex);\n\t}", "Vertex addVertex(String name){\n\t\t//if graph doesn't already have the key\n\t\tif (!adjlist.containsKey(name)) {\n\t\t\tkeys.add(name); //places keys in list in order they're added\n\t\t\tvertices++; //increases vertex count variable\n\t\t\treturn adjlist.put(name, new Vertex(name)); //adds to hashmap\n\t\t//if graph does already have the key\n\t\t} else {\n\t\t\treturn adjlist.get(name);\n\t\t}\n\t}", "public void depthFirstSearch(Node vertex){\n vertex.visited = true;\n if(vertex.row == row_size-1 && vertex.col == col_size-1){\n while(!dfs_stack.isEmpty()){\n exitPath +=dfs_stack.peek(); \n dfs_stack.pop();\n } \n }\n if(vertex.north!=null && vertex.north.visited==false){\n dfs_stack.push(\"N\");\n vertex.depthFirstSearch(vertex.north);\n }\n if(vertex.south!=null && vertex.south.visited==false){\n dfs_stack.push(\"S\");\n vertex.depthFirstSearch(vertex.south);\n }\n if(vertex.west !=null && vertex.west.visited ==false){\n dfs_stack.push(\"W\");\n vertex.depthFirstSearch(vertex.west);\n }\n if(vertex.east !=null && vertex.east.visited==false){\n dfs_stack.push(\"E\");\n vertex.depthFirstSearch(vertex.east);\n }\n if (!dfs_stack.isEmpty()){\n dfs_stack.pop();\n }\n return;\n }", "protected int indexOf (E vertex)\n {\n int indexOfVertex = -1;\n for (int index = 0; index <= lastIndex; index++)\n {\n if (vertex.equals(vertices[index]))\n {\n indexOfVertex = index;\n break;\n }\n }\n\n return indexOfVertex;\n }", "public Collection< VKeyT > vertexKeys();", "public Object getVertexProperty(Agent ag, Object key) {\n\tVertex vertex = getVertexFor(ag);\n\n\tsynchronized(vertex) {\n\t while(vertexPropertiesLocked(vertex) \n\t\t && (getVertexPropertiesOwner(vertex) != ag)) {\n\t\ttry {\n\t\t vertex.wait();\n\t\t} catch(InterruptedException e) {\n\t\t throw new SimulationAbortError(e);\n\t\t}\n\t }\n stats.add(new VertexWBAccessStat(ag.getClass()));\n\n\n\t return vertex.getProperty(key);\n\t}\n }", "public Collection<V> getVertices();", "public Vertex getVertexFromList(int rank) {\r\n\t\treturn listVertex.get(rank);\r\n\t}", "Computer selectByPrimaryKey(Long id);", "public KeyedItem retrieve(Comparable searchKey);", "public Set<V> getNeighbours(V vertex);", "public short getVertexType() {\n return REQUIRED_VERTEX;\n }", "@Override\r\n\tpublic E getVertexAtGivenDistance(E src, int distance) {\r\n\t\treturn graphForWarshall.getVertexAtGivenDistance(src, distance);\r\n\t}", "VarRatio selectByPrimaryKey(String stockCode);", "private void queryIndex() {\n if (predicate == TruePredicate.INSTANCE) {\n return;\n }\n\n // get indexes\n MapService mapService = nodeEngine.getService(SERVICE_NAME);\n MapServiceContext mapServiceContext = mapService.getMapServiceContext();\n Indexes indexes = mapServiceContext.getMapContainer(name).getIndexes();\n // optimize predicate\n QueryOptimizer queryOptimizer = mapServiceContext.getQueryOptimizer();\n predicate = queryOptimizer.optimize(predicate, indexes);\n\n Set<QueryableEntry> querySet = indexes.query(predicate);\n if (querySet == null) {\n return;\n }\n\n List<Data> keys = null;\n for (QueryableEntry e : querySet) {\n if (keys == null) {\n keys = new ArrayList<Data>(querySet.size());\n }\n keys.add(e.getKeyData());\n }\n\n hasIndex = true;\n keySet = keys == null ? Collections.<Data>emptySet() : InflatableSet.newBuilder(keys).build();\n }", "CommunityInform selectByPrimaryKey(String id);", "protected abstract List<Integer> getNeighbors(int vertex);", "@Override\n protected void load() {\n //recordId can be null when in batchMode\n if (this.recordId != null && this.properties.isEmpty()) {\n this.sqlgGraph.tx().readWrite();\n if (this.sqlgGraph.getSqlDialect().supportsBatchMode() && this.sqlgGraph.tx().getBatchManager().isStreaming()) {\n throw new IllegalStateException(\"streaming is in progress, first flush or commit before querying.\");\n }\n\n //Generate the columns to prevent 'ERROR: cached plan must not change result type\" error'\n //This happens when the schema changes after the statement is prepared.\n @SuppressWarnings(\"OptionalGetWithoutIsPresent\")\n EdgeLabel edgeLabel = this.sqlgGraph.getTopology().getSchema(this.schema).orElseThrow(() -> new IllegalStateException(String.format(\"Schema %s not found\", this.schema))).getEdgeLabel(this.table).orElseThrow(() -> new IllegalStateException(String.format(\"EdgeLabel %s not found\", this.table)));\n StringBuilder sql = new StringBuilder(\"SELECT\\n\\t\");\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(\"ID\"));\n appendProperties(edgeLabel, sql);\n List<VertexLabel> outForeignKeys = new ArrayList<>();\n for (VertexLabel vertexLabel : edgeLabel.getOutVertexLabels()) {\n outForeignKeys.add(vertexLabel);\n sql.append(\", \");\n if (vertexLabel.hasIDPrimaryKey()) {\n String foreignKey = vertexLabel.getSchema().getName() + \".\" + vertexLabel.getName() + Topology.OUT_VERTEX_COLUMN_END;\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(foreignKey));\n } else {\n int countIdentifier = 1;\n for (String identifier : vertexLabel.getIdentifiers()) {\n PropertyColumn propertyColumn = vertexLabel.getProperty(identifier).orElseThrow(\n () -> new IllegalStateException(String.format(\"identifier %s column must be a property\", identifier))\n );\n PropertyType propertyType = propertyColumn.getPropertyType();\n String[] propertyTypeToSqlDefinition = this.sqlgGraph.getSqlDialect().propertyTypeToSqlDefinition(propertyType);\n int count = 1;\n for (String ignored : propertyTypeToSqlDefinition) {\n if (count > 1) {\n sql.append(sqlgGraph.getSqlDialect().maybeWrapInQoutes(vertexLabel.getFullName() + \".\" + identifier + propertyType.getPostFixes()[count - 2] + Topology.OUT_VERTEX_COLUMN_END));\n } else {\n //The first column existVertexLabel no postfix\n sql.append(sqlgGraph.getSqlDialect().maybeWrapInQoutes(vertexLabel.getFullName() + \".\" + identifier + Topology.OUT_VERTEX_COLUMN_END));\n }\n if (count++ < propertyTypeToSqlDefinition.length) {\n sql.append(\", \");\n }\n }\n if (countIdentifier++ < vertexLabel.getIdentifiers().size()) {\n sql.append(\", \");\n }\n }\n }\n }\n List<VertexLabel> inForeignKeys = new ArrayList<>();\n for (VertexLabel vertexLabel : edgeLabel.getInVertexLabels()) {\n sql.append(\", \");\n inForeignKeys.add(vertexLabel);\n if (vertexLabel.hasIDPrimaryKey()) {\n String foreignKey = vertexLabel.getSchema().getName() + \".\" + vertexLabel.getName() + Topology.IN_VERTEX_COLUMN_END;\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(foreignKey));\n } else {\n int countIdentifier = 1;\n for (String identifier : vertexLabel.getIdentifiers()) {\n PropertyColumn propertyColumn = vertexLabel.getProperty(identifier).orElseThrow(\n () -> new IllegalStateException(String.format(\"identifier %s column must be a property\", identifier))\n );\n PropertyType propertyType = propertyColumn.getPropertyType();\n String[] propertyTypeToSqlDefinition = this.sqlgGraph.getSqlDialect().propertyTypeToSqlDefinition(propertyType);\n int count = 1;\n for (String ignored : propertyTypeToSqlDefinition) {\n if (count > 1) {\n sql.append(sqlgGraph.getSqlDialect().maybeWrapInQoutes(vertexLabel.getFullName() + \".\" + identifier + propertyType.getPostFixes()[count - 2] + Topology.IN_VERTEX_COLUMN_END));\n } else {\n //The first column existVertexLabel no postfix\n sql.append(sqlgGraph.getSqlDialect().maybeWrapInQoutes(vertexLabel.getFullName() + \".\" + identifier + Topology.IN_VERTEX_COLUMN_END));\n }\n if (count++ < propertyTypeToSqlDefinition.length) {\n sql.append(\", \");\n }\n }\n if (countIdentifier++ < vertexLabel.getIdentifiers().size()) {\n sql.append(\", \");\n }\n }\n }\n }\n sql.append(\"\\nFROM\\n\\t\");\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(this.schema));\n sql.append(\".\");\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(EDGE_PREFIX + this.table));\n sql.append(\" WHERE \");\n //noinspection Duplicates\n if (edgeLabel.hasIDPrimaryKey()) {\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(\"ID\"));\n sql.append(\" = ?\");\n } else {\n int count = 1;\n for (String identifier : edgeLabel.getIdentifiers()) {\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(identifier));\n sql.append(\" = ?\");\n if (count++ < edgeLabel.getIdentifiers().size()) {\n sql.append(\" AND \");\n }\n\n }\n }\n if (this.sqlgGraph.getSqlDialect().needsSemicolon()) {\n sql.append(\";\");\n }\n Connection conn = this.sqlgGraph.tx().getConnection();\n if (logger.isDebugEnabled()) {\n logger.debug(sql.toString());\n }\n try (PreparedStatement preparedStatement = conn.prepareStatement(sql.toString())) {\n if (edgeLabel.hasIDPrimaryKey()) {\n preparedStatement.setLong(1, this.recordId.sequenceId());\n } else {\n int count = 1;\n for (Comparable identifierValue : this.recordId.getIdentifiers()) {\n preparedStatement.setObject(count++, identifierValue);\n }\n }\n ResultSet resultSet = preparedStatement.executeQuery();\n if (resultSet.next()) {\n loadResultSet(resultSet, inForeignKeys, outForeignKeys);\n }\n } catch (SQLException e) {\n throw new RuntimeException(e);\n }\n }\n }", "public Set<V> getVertices();" ]
[ "0.6157496", "0.605255", "0.60100377", "0.5845049", "0.5653417", "0.56245166", "0.55748713", "0.5495925", "0.5427153", "0.54173297", "0.5409614", "0.54088825", "0.5401454", "0.53634113", "0.53570396", "0.5278046", "0.52416253", "0.5220134", "0.5177164", "0.517314", "0.5171268", "0.5163634", "0.5095904", "0.50713986", "0.50474125", "0.50440764", "0.5036593", "0.5024262", "0.49937546", "0.49829304", "0.49702618", "0.4961051", "0.49560058", "0.4938033", "0.4935697", "0.49147165", "0.48992938", "0.4888885", "0.48820007", "0.48776975", "0.48771653", "0.4861105", "0.48541155", "0.48506454", "0.4845933", "0.4837818", "0.4835225", "0.4835217", "0.48232073", "0.4798449", "0.4793866", "0.47816807", "0.4774654", "0.47733223", "0.47733223", "0.4768696", "0.47314435", "0.47082436", "0.470386", "0.46889937", "0.46734273", "0.46695155", "0.46688786", "0.46640462", "0.4649087", "0.46482703", "0.46432304", "0.4643111", "0.46385062", "0.4638023", "0.46255606", "0.46227455", "0.46099374", "0.46053874", "0.46038187", "0.45973125", "0.45935497", "0.45935318", "0.45911887", "0.45864338", "0.45842466", "0.45836225", "0.45793274", "0.45765862", "0.45738256", "0.45736194", "0.45612592", "0.45544595", "0.45478818", "0.45463777", "0.4538111", "0.45348454", "0.4526262", "0.45234823", "0.4523317", "0.45211732", "0.45200562", "0.45095915", "0.45032027", "0.44956604" ]
0.51703686
21
This function finds the children of a given vertex. A child is defined as a vertex which is the source of a direct edge between itself and the given vertex.
public abstract Graph getChildren(String parentHash);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Collection<V> getChildren(V vertex);", "public Collection<E> getChildEdges(V vertex);", "public int getChildCount(V vertex);", "public Set<V> getNeighbours(V vertex);", "public Vector<GraphicalLatticeElement> getChildren() {\n\t\tVector<GraphicalLatticeElement> children = new Vector<GraphicalLatticeElement>();\n\t\tif (childrenEdges != null)\n\t\t\tfor (int i = 0; i < childrenEdges.size(); i++) {\n\t\t\t\tEdge edge = childrenEdges.elementAt(i);\n\t\t\t\tchildren.add(edge);\n\t\t\t\tchildren.add(edge.getDestination());\n\t\t\t}\n\t\t\n\t\treturn children;\n\t}", "private List<View> getAllChildrenBFS(View v) {\n List<View> visited = new ArrayList<View>();\n List<View> unvisited = new ArrayList<View>();\n unvisited.add(v);\n\n while (!unvisited.isEmpty()) {\n View child = unvisited.remove(0);\n visited.add(child);\n if (!(child instanceof ViewGroup)) continue;\n ViewGroup group = (ViewGroup) child;\n final int childCount = group.getChildCount();\n for (int i=0; i<childCount; i++) unvisited.add(group.getChildAt(i));\n }\n return visited;\n }", "protected abstract List<Integer> getNeighbors(int vertex);", "public abstract Graph getParents(String childVertexHash);", "public List<Integer> neighbors(int vertex) {\r\n \tArrayList<Integer> vertices = new ArrayList<Integer>();\r\n \tLinkedList<Edge> testList = myAdjLists[vertex];\r\n int counter = 0;\r\n while (counter < testList.size()) {\r\n \tvertices.add(testList.get(counter).myTo);\r\n \tcounter++;\r\n }\r\n return vertices;\r\n }", "List<WeightedEdge<Vertex>> neighbors(Vertex v);", "Iterable<Position<E>> children(Position<E> p) throws IllegalArgumentException;", "@TimeComplexity(\"o(1)\") @TimeComplexityAmortized(\"o(1)\") @TimeComplexityExpected(\"o(1)\")\n public Iterable<Position<E>> children(Position<E> v)\n throws InvalidPositionException {\n PNode<E> p = validate(v);\n LinkedSequence<E> ans = new LinkedSequence<>();\n ans.addLast(p.left.element());\n ans.addLast(p.right.element());\n\n return ans.positions(); // O(n) @@@ OPTIMIZE ME!\n }", "public Iterable<DirectedEdge> pathTo(int v){\n\t\tvalidateVertex(v);\n\t\tif(!hasPathTo(v)) return null;\n\n\t\tLinkedStack<DirectedEdge> stack=new LinkedStack<>();\n\t\twhile(edgeTo[v]!=null){\n\t\t\tstack.push(edgeTo[v]);\n\t\t\tv=edgeTo[v].from();\n\t\t}\n\t\treturn stack;\n\t}", "Collection<DendrogramNode<T>> getChildren();", "public java.util.List<Node> getChildren(String... args) throws ChildNotFoundException {\n\t\tjava.util.List<Node> children = new ArrayList<Node>();\n\t\tfor(Node node : selected_nodes) {\n\t\t\ttry {\n\t\t\t\tchildren.addAll(node.getChildren(args));\n\t\t\t} catch (ChildNotFoundException e) {}\n\t\t}\n\t\tif(children.isEmpty()) {\n\t\t\tthrow new ChildNotFoundException(\"No children found with that path\");\n\t\t}\n\t\treturn children;\n\t}", "List<V> getAdjacentVertexList(V v);", "@DISPID(4)\n\t// = 0x4. The runtime will prefer the VTID if present\n\t@VTID(10)\n\tcom.gc.IList children();", "public V getParent(V vertex);", "private int[] getChildren(int index) {\r\n int[] children = new int[] {\r\n 2 * index + 1,\r\n 2 * index + 2\r\n };\r\n return children;\r\n }", "@Override\n\tpublic List<Location> getNeighbors(Location vertex) {\n\n\t\tArrayList<Location> neighbors = new ArrayList<Location>();\n\n\t\tfor (Path p : getOutEdges(vertex))\n\t\t\tneighbors.add(p.getDestination());\n\n\t\treturn neighbors;\n\n\n\t}", "List<HNode> getChildren(Long id);", "public List neighbors(int vertex) {\n // your code here\n \tList toReturn = new ArrayList<Integer>();\n \tfor (Edge e : myAdjLists[vertex]) {\n \t\ttoReturn.add(e.to());\n \t}\n return toReturn;\n }", "public Set<Edge<V>> getEdges(V vertex);", "public List<IContentNode> getChilds(int start, int limit);", "public Vector getChildren()\r\n\t{\r\n\t\treturn m_children;\r\n\t}", "public Vector<Node> getChildren(){\n\t\t Vector<Node> children = new Vector<>(0);\n\t\t Iterator<Link> l= myLinks.iterator();\n\t\t\twhile(l.hasNext()){\n\t\t\t\tLink temp=l.next();\n\t\t\t\tif(temp.getM().equals(currNode))\n\t\t\t\t children.add(temp.getN());\n\t\t\t\tif(temp.getN().equals(currNode))\n\t\t\t\t children.add(temp.getM());\n\t\t\t}\n\t\treturn children;\n\t}", "public E[] getNeighbours (E vertex) throws IllegalArgumentException\n {\n int index = this.indexOf (vertex);\n\n // Check if the vertex exists in the graph\n if (index < 0)\n throw new IllegalArgumentException (vertex + \" was not found!\");\n\n\n Node node = this.adjacencySequences[index];\n int countNeighbours = 0;\n while(node != null)\n {\n countNeighbours++;\n node = node.nextNode;\n }\n\n E[] neighbours = (E[]) new Object[countNeighbours];\n node = this.adjacencySequences[index];\n int neighbourIndex = 0;\n \n while(node != null)\n {\n neighbours[neighbourIndex++] = vertices[node.neighbourIndex];\n node = node.nextNode;\n }\n\n return neighbours;\n }", "public Collection<V> getOtherVertices(V v);", "public Collection<Vertex> adjacentVertices(Vertex v) {\n Vertex parameterVertex = new Vertex(v.getLabel());\n if(!myGraph.containsKey(parameterVertex)){\n throw new IllegalArgumentException(\"Vertex is not valid\");\n }\n\n //create a copy of the passed in vertex to restrict any reference\n //to interals of this class\n Collection<Vertex> adjVertices = new ArrayList<Vertex>();\n\n Iterator<Edge> edges = myGraph.get(parameterVertex).iterator();\n while(edges.hasNext()) {\n adjVertices.add(edges.next().getDestination());\n }\n return adjVertices;\n }", "Iterable<DirectedEdge> pathTo(int v)\n\t{\n\t\tStack<DirectedEdge> path=new Stack<>();\n\t\tfor(DirectedEdge e=edgeTo[v]; e!=null; e=edgeTo[e.from()])\n\t\t{\n\t\t\tpath.push(e);\n\t\t}\n\t\treturn path;\n\t}", "public static ArrayList<Node> findChildrenOfNode(Node parent, Label label) {\n\t\tArrayList<Node> result = new ArrayList<Node>();\n\t\tfor (Relationship rel : parent.getRelationships(Direction.OUTGOING)) {\n\t\t\tNode child = rel.getOtherNode(parent);\n\t\t\tif (child.hasLabel(label)) {\n\t\t\t\tresult.add(child);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}", "public Vector getChildren() {\n return this.children;\n }", "Node[] getChildren(Node node);", "public Node visitChildren(NodeVisitor v) {\n\tExpr left = (Expr) visitChild(this.left, v);\n\tExpr right = (Expr) visitChild(this.right, v);\n\treturn reconstruct(left, right);\n }", "public List<PafDimMember> getChildren() {\r\n\t\t\r\n\t\tList<PafDimMember> childList = null;\r\n\t\t\r\n\t\t// If no children are found, return empty array list\r\n\t\tif (children == null) {\r\n\t\t\tchildList = new ArrayList<PafDimMember>();\r\n\t\t} else {\r\n\t\t\t// Else, return pointer to children\r\n\t\t\tchildList = children;\r\n\t\t}\r\n\t\treturn childList;\r\n\t}", "public Iterator<String> listChildren(T node){\n\t\tT target = node;\n\t\tSet<Edge<T,E>> alledges = this.graph.getEdges(target);\n\t\tList<String> children = new ArrayList<String>();\n\t\tfor(Edge<T, E> e : alledges) {\n\t\t\tchildren.add(e.getChild()+\"(\"+e.getName()+\")\");\n\t\t}\n\t\tCollections.sort(children);\n\t\tIterator<String> itr = children.iterator();\n\t\treturn itr;\n\t}", "public List<Edge> breadthFirstTraverse(String v) {\n int start = indexOf(v);\n if (start == -1) return new LinkedList<>();\n\n List<Edge> path = new LinkedList<>();\n Queue<Integer> queue = new Queue<>();\n boolean[] visited = new boolean[vertexes.length];\n\n queue.enQueue(start);\n while(!queue.isEmpty()) {\n start = queue.deQueue();\n visited[start] = true;\n\n for (int i: this.heads[start]) {\n if (!visited[i]) { // not visited yet\n visited[i] = true;\n path.add(new Edge(start, i));\n\n queue.enQueue(i); // add to the queue for the next loop\n }\n }\n }\n\n return path;\n }", "public E getParentEdge(V vertex);", "public abstract Set<? extends EE> edgesOf(VV vertex);", "public List neighbors(int vertex) {\n// your code here\n LinkedList<Integer> result = new LinkedList<>();\n LinkedList<Edge> list = adjLists[vertex];\n for (Edge a : list) {\n result.add(a.to());\n }\n//List<Integer> list = new List<Integer>();\n return result;\n }", "List<Node<T>> children();", "public static List<Node> getChildren(Node parent, int player){\n //System.out.println(\"Parent Board: \");\n //printBoard(parent.board);\n \tList<Node> children = new ArrayList<Node>();\n int[][] parent_matrix = parent.board;\n int[][] copy_matrix = new int[ROW][COLUMN];\n //deep copy\n for(int i=0;i<ROW;i++){\n for(int j=0;j<COLUMN;j++){\n copy_matrix[i][j]=parent_matrix[i][j];\n }\n }\n \n int[][] child_matrix = new int[ROW][COLUMN];\n int column = 0;\n for(column=0; column< COLUMN; column++){\n //if a column is already full, then no need to generate it as a child.\n if(isValid(parent_matrix, column)){\n child_matrix = generateChildMatrix(copy_matrix, column, player);\n Node child_node = new Node(parent, child_matrix);\n children.add(child_node);\n }\n }\n int counter =1; \n for(Node child : children){\n //System.out.println(\"Child: \"+counter++);\n //printBoard(child.board);\n }\n return children;\n }", "private void doDFSRecursive(int vertex) {\n markVisited(vertex);\n\n for (Integer adjacentVertex : graph.getAdjacentVertices(vertex)) {\n if (!isVisitedNode(adjacentVertex)) {\n System.out.print(adjacentVertex + \" \");\n doDFSRecursive(adjacentVertex);\n }\n }\n }", "private void traversal (\n TreeNodeVisitor visitor\n ) {\n\n visitor.visit (this);\n if (children != null) {\n for (SceneOctTree child : children) child.traversal (visitor);\n } // if\n\n }", "public abstract List<Node> getChildNodes();", "@DisplayName(\"Test if the childs are assigned correctly over a path 4 -> 0 -> 1 -> 2 -> 3\")\n @Test\n public void testGetChilds() {\n boolean directed1 = true;\n Graph instance = new Graph(new Edge[0], directed1, 4, 5, GraphType.RANDOM);\n instance.addEdges(edges);\n List<Integer> l0 = new ArrayList<>();\n List<Integer> l1 = new ArrayList<>();\n List<Integer> l2 = new ArrayList<>();\n List<Integer> l3 = new ArrayList<>();\n List<Integer> l4 = new ArrayList<>();\n l0.add(4);\n l1.add(0);\n l2.add(1);\n l3.add(2);\n List[] foo = {l0, l1, l2, l3, l4};\n for (int i = 0; i < 5; i++) {\n Assertions.assertArrayEquals(foo[i].toArray(), instance.getChilds(i).toArray());\n }\n }", "@Override\r\n public List<Vertex> getNeighbors(Vertex v) {\r\n ArrayList<Vertex> neighborsList = new ArrayList<>();\r\n neighborsList = adjacencyList.get(v);\r\n Collections.sort(neighborsList, Comparator.comparing(Vertex::getLabel));\r\n return neighborsList; //getting the list of all adjacent vertices of vertex v\r\n }", "@Nonnull\r\n List<DataSet> children(@Nonnull DataSet parent) throws IllegalArgumentException, IOException;", "public Set<Pair<V,V>> neighbourEdgesOf(V vertex);", "public Node[] getChildren(){return children;}", "Iterable<Long> adjacent(long v) {\n List<Node> adjNodes = adj.get(v);\n List<Long> adjVertices = new ArrayList<>();\n for (int i = 1; i < adjNodes.size(); i++) {\n adjVertices.add(adjNodes.get(i).getID());\n }\n return adjVertices;\n }", "@Nonnull\n Iterable<? extends T> getChildren();", "public static void computeChildren() {\n\t\tArrayList<BNNode> children = new ArrayList<BNNode>();\n\t\t// For each node, build an array of children by checking which nodes have it as a parent.\n\t\tfor (BNNode node : nodes) {\n\t\t\tchildren.clear();\n\t\t\tfor (BNNode node2 : nodes) {\n\t\t\t\tif (node == node2)\n\t\t\t\t\tcontinue;\n\t\t\t\tfor (BNNode node3 : node2.parents)\n\t\t\t\t\tif (node3 == node)\n\t\t\t\t\t\tchildren.add(node2);\n\t\t\t}\n\t\t\tnode.children = new BNNode[children.size()];\n\t\t\tnode.children = (BNNode[]) children.toArray(node.children);\n\t\t}\n\t}", "List<V> getShortestPath(V vertex);", "public List<V> getPath(int index){\n\t\t\tArrayList<V> path = new ArrayList<V>();\n\t\t\n\t\t\tdo{\n\t\t\t\tpath.add(vertices.get(index));\n\t\t\t\tindex=parent[index];\n\t\t\t}\n\t\t\twhile(index!= -1);\n\t\t\treturn path;\n\t\t}", "public List<SaveGameNode> getAllChilden(String name) {\r\n List<SaveGameNode> list = new ArrayList();\r\n list.addAll(this.children.stream().filter(child -> child.equals(name)).collect(Collectors.toList()));\r\n return list;\r\n }", "public ArrayList<V> getEdges(V vertex){\n return (ArrayList<V>) graph.get(vertex);\n }", "private List<Node<E>> getChildrenForNode(Node<E> node) {\n ArrayList<Node<E>> list = new ArrayList<>();\n for (Node<E> child : node.getChilden()) {\n list.add(child);\n }\n return list;\n }", "public Set<JmiClassVertex> getAllSubclassVertices(JmiClassVertex vertex)\n {\n return getClassAttributes(vertex).allSubclassVertices;\n }", "public Iterable<K> neighbors(K v)\n {\n \tList<K> list=new ArrayList<K>();\n \tList<HashMap<K, Integer>> adj = adjLists.get(v);\n \tfor (HashMap<K,Integer> A:adj){\n \t\tfor (K vertex:A.keySet()){\n \t\t\tlist.add(vertex);\n \t\t}\n \t}\n\treturn new ArrayList<K>(list);\n }", "public Collection<ChildType> getChildren();", "private List<E> get(V vertex) {\n return this.data.getOrDefault(vertex, new BinarySearchTree<>()).getTreeByInOrder_depthFirst();\n }", "public ArrayList<Vertex> getNeighbours(Vertex vertex) {\r\n\t\tArrayList<Vertex> neighbours = new ArrayList<Vertex>();\r\n\t\tfor (Vertex vertexOfList : listVertex) {\r\n\r\n\t\t\tif (matrix.getEdges(vertex.getIdVertex(), vertexOfList.getIdVertex()) != null) {\r\n\t\t\t\tneighbours.add(vertexOfList);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn neighbours;\r\n\t}", "void dfs(){\n // start from the index 0\n for (int vertex=0; vertex<v; vertex++){\n // check visited or not\n if (visited[vertex]==false){\n Explore(vertex);\n }\n }\n }", "public static Expression VisitChildren(ExpressionVisitor visitor) { throw Extensions.todo(); }", "public java.util.List<BinomialTree<KEY, ITEM>> children()\n\t{\n\t\treturn _children;\n\t}", "@Override\r\n\tpublic List<Integer> getReachableVertices(GraphStructure graph,int vertex) {\r\n\t\tadjacencyList=graph.getAdjacencyList();\r\n\t\tpathList=new ArrayList<Integer>();\r\n\t\tisVisited=new boolean [graph.getNumberOfVertices()];\r\n\t\ttraverseRecursively(graph, vertex);\r\n\t\treturn pathList;\r\n\t}", "public ResultMap<BaseNode> listChildren();", "Enumeration getChildIds(String nodeId) throws PortalException;", "public String[] listChildren()\n/* */ {\n/* 519 */ int childCount = getChildCount();\n/* 520 */ String[] outgoing = new String[childCount];\n/* 521 */ for (int i = 0; i < childCount; i++) {\n/* 522 */ outgoing[i] = getChild(i).getName();\n/* */ }\n/* 524 */ return outgoing;\n/* */ }", "public static List<Node> getChildren(Element sourceElement) {\r\n return getChildren(sourceElement, false);\r\n }", "public void enumerateChildren(AbstractVisitor visitor)\n // -end- 3D4FA2190371 head358A5F2B0354 \"enumerateChildren\"\n // declare any checked exceptions\n // please fill in/modify the following section\n // -beg- preserve=no 3D4FA2190371 throws358A5F2B0354 \"enumerateChildren\"\n\n // -end- 3D4FA2190371 throws358A5F2B0354 \"enumerateChildren\"\n {\n // please fill in/modify the following section\n // -beg- preserve=no 3D4FA2190371 body358A5F2B0354 \"enumerateChildren\"\n java.util.Iterator it=null;\n super.enumerateChildren(visitor);\n // -end- 3D4FA2190371 body358A5F2B0354 \"enumerateChildren\"\n }", "@Override\n\tpublic List<Node> chilren() {\n\t\treturn children;\n\t}", "public Iterable<DirectedEdge> adj(int v) \n {\n return adj[v];\n }", "public abstract int[] getConnected(int vertexIndex);", "DFS(int vertices) {\n\t\tlist = new ArrayList<ArrayList<Integer>>(vertices);\n\t\tvis = new boolean[vertices];\n\n\t\tfor (int i = 0; i < vertices; i++) {\n\t\t\tlist.add(new ArrayList<Integer>());\n\t\t}\n\t}", "protected abstract List<T> getChildren();", "public List<RealObject> getChildren();", "@NotNull\n public abstract JBIterable<T> children(@NotNull T root);", "ArrayList<Expression> getChildren();", "@Override\n public Set<T> getNeighbors(T v) {\n int index = getVInfoIndex(v);\n\n // check for an error and throw exception\n // if vertices not in graph\n if (index == -1) {\n throw new IllegalArgumentException(\"DiGraph getNeighbors(): vertex not in graph\");\n }\n HashSet<T> edgeSet = new HashSet<T>();\n VertexInfo<T> vtxInfo = vInfo.get(index);\n Iterator<Edge> iter = vtxInfo.edgeList.iterator();\n Edge e = null;\n\n while (iter.hasNext()) {\n e = iter.next();\n edgeSet.add(vInfo.get(e.dest).vertex);\n }\n\n return edgeSet;\n\n }", "public Iterable<Integer> pathTo(int v)\n {\n if (!hasPathTo(v)) return null;\n Stack<Integer> path = new Stack<Integer>();\n for (int x = v; x != s; x = edgeTo[x])\n path.push(x);\n path.push(s);\n return path;\n }", "public List<TreeNode> getChildrenNodes();", "public Node[] getChildren(){\n return children.values().toArray(new Node[0]);\n }", "public Collection< VKeyT > neighborKeys( VKeyT key )\n throws NoSuchVertexException;", "public ArrayList<LexiNode> getChilds(){\n\t\treturn childs;\n\t}", "private List<SimpleNode> getChildren(SimpleNode node) {\n Class<?> nodeType = node.getClass();\n List<SimpleNode> children = new ArrayList<>();\n for (int i = 0; i < node.jjtGetNumChildren(); i++) {\n children.addAll(flatten(node.jjtGetChild(i), nodeType));\n }\n return children;\n }", "@Override\r\n\tpublic Iterable<Integer> pathTo(int v) {\r\n\t\tif (!hasPathTo(v)) return null;\r\n\r\n\t\tArrayList<Integer> list = new ArrayList<Integer>();\r\n\t\twhile(v != -1) {\r\n\t\t\tlist.add(v);\r\n\t\t\tv = edgeTo[v];\r\n\t\t}\r\n\r\n\t\treturn list;\r\n\t}", "public Set<V> findCyclesContainingVertex(V v)\n {\n Set<V> set = new LinkedHashSet<>();\n execute(set, v);\n\n return set;\n }", "public ArrayList<String> getChildrenNodes(MasterMgrClient mclient, String start)\n\tthrows PipelineException\n\t{\n\t\tArrayList<String> toReturn = new ArrayList<String>();\n\t\tTreeMap<String, Boolean> comps = new TreeMap<String, Boolean>();\n\t\tcomps.put(start, false);\n\t\tNodeTreeComp treeComps = mclient.updatePaths(pUser, pView, comps);\n\t\tPath p = new Path(start);\n\t\tArrayList<String> parts = p.getComponents();\n\t\tfor (String comp : parts)\n\t\t{\n\t\t\tif(treeComps!=null)\n\t\t\t\ttreeComps = treeComps.get(comp);\n\t\t}\n\t\tfor (String s : treeComps.keySet())\n\t\t{\n\t\t\ttoReturn.add(s);\n\t\t}\n\t\treturn toReturn;\n\t}", "public Set<VfsFile> getChildren()\n {\n return children;\n }", "public ArrayList<Node> getChildren() { return this.children; }", "public Collection<V> getOtherVertices(Collection<V> vs);", "private Queue<Integer> findChildren(int node, int[] parents) {\n Queue<Integer> children = new LinkedList<>();\n for (int i = 0; i < parents.length; i++) {\n if (node != i && node == parents[i]) {\n children.add(i);\n }\n }\n return children;\n }", "public VNode[] getParents() throws VlException // for Graph\n {\n VNode parent=getParent();\n \n if (parent==null)\n return null; \n \n VNode nodes[]=new VNode[1]; \n nodes[0]=parent; \n return nodes;\n }", "List<GraphEdge> getNeighbors(NodeKey key);", "public String[] getChildList() {\n if (this.children == null) {\n return this.pointsByChild.keySet().toArray(new String[this.pointsByChild.size()]);\n } else {\n return this.children.clone();\n }\n }", "public Node[] getChildren() {\n\t\treturn children.toArray(new Node[0]);\n\t}", "private ArrayList<String> makeChildren(Node current) {\n\n ArrayList<String> current_children = new ArrayList<>();\n\n if (current != null && current.getDigit().last_changed != 0) {\n //-1 child first digit\n if ((Integer.parseInt(current.getDigit().getFirst_digit()) - 1 >= 0)) {\n String child_node = current.getDigit().decreaseFirstDigit();\n current_children.add(child_node);\n }\n\n //+1 child first digit\n if ((Integer.parseInt(current.getDigit().getFirst_digit()) + 1 <= 9)) {\n String child_node = current.getDigit().increaseFirstDigit();\n current_children.add(child_node);\n }\n }\n\n if (current != null && current.getDigit().last_changed != 1) {\n //-1 child\n if ((Integer.parseInt(current.getDigit().getSecond_digit()) - 1 >= 0)) {\n String child_node = current.getDigit().decreaseSecondDigit();\n current_children.add(child_node);\n }\n\n //+1 child\n if ((Integer.parseInt(current.getDigit().getSecond_digit()) + 1 <= 9)) {\n String child_node = current.getDigit().increaseSecondDigit();\n current_children.add(child_node);\n }\n }\n\n if (current != null && current.getDigit().last_changed != 2) {\n //-1 child\n if ((Integer.parseInt(current.getDigit().getThird_digit()) - 1 >= 0)) {\n String child_node = current.getDigit().decreaseThirdDigit();\n current_children.add(child_node);\n }\n //+1 child\n if ((Integer.parseInt(current.getDigit().getThird_digit()) + 1 <= 9)) {\n String child_node = current.getDigit().increaseThirdDigit();\n current_children.add(child_node);\n }\n }\n return current_children;\n }", "public Path dfs(Graph G, int v) {\r\n Path result = new Path();\r\n \tcount++;\r\n marked[v] = true;\r\n Iterator<Integer> it = G.getAdjList(v).iterator();\r\n while(it.hasNext()){\r\n \tint w = it.next();\r\n if (!marked[w]) {\r\n \t\t result.addPath(new Edge(v,w));\r\n result.append(dfs(G, w));\r\n \t}\r\n \t//System.out.print(v + \" \"+ w + \"\\n\");\r\n }\r\n return result;\r\n }" ]
[ "0.778766", "0.7544633", "0.6463057", "0.6179662", "0.6053796", "0.5852151", "0.58402216", "0.5824237", "0.5810833", "0.58024335", "0.578797", "0.57427204", "0.5690481", "0.5674055", "0.5670885", "0.56664985", "0.5647735", "0.5646786", "0.5614514", "0.5613962", "0.5613562", "0.56108826", "0.5600825", "0.55551577", "0.55437815", "0.5528796", "0.5522402", "0.5521446", "0.5519396", "0.54732007", "0.5466285", "0.54607993", "0.5452079", "0.5441466", "0.5418812", "0.5402836", "0.5388961", "0.53594524", "0.53563046", "0.53375816", "0.53367996", "0.533258", "0.53267795", "0.5326111", "0.53229773", "0.5307234", "0.53063583", "0.5293383", "0.52877784", "0.527593", "0.5252727", "0.5247842", "0.5238734", "0.52277803", "0.5214841", "0.52118945", "0.5202897", "0.5171135", "0.5170253", "0.5166024", "0.51656", "0.51536775", "0.51337016", "0.51270926", "0.5126321", "0.5124304", "0.5112607", "0.5098803", "0.5094977", "0.50889164", "0.5066523", "0.5063735", "0.5056368", "0.5056074", "0.5044456", "0.50415415", "0.5032203", "0.50277996", "0.5019924", "0.50024307", "0.50018936", "0.5001556", "0.4990324", "0.49857542", "0.49847615", "0.4978575", "0.49660805", "0.49603394", "0.49551567", "0.49519092", "0.49494717", "0.49443832", "0.49423847", "0.4937212", "0.493242", "0.49266827", "0.49197367", "0.49102458", "0.49084473", "0.4899669" ]
0.6004425
5
This function finds the parents of a given vertex. A parent is defined as a vertex which is the destination of a direct edge between itself and the given vertex.
public abstract Graph getParents(String childVertexHash);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public V getParent(V vertex);", "public E getParentEdge(V vertex);", "public VNode[] getParents() throws VlException // for Graph\n {\n VNode parent=getParent();\n \n if (parent==null)\n return null; \n \n VNode nodes[]=new VNode[1]; \n nodes[0]=parent; \n return nodes;\n }", "@Override\r\n\tpublic List<Integer> getReachableVertices(GraphStructure graph,int vertex) {\r\n\t\tadjacencyList=graph.getAdjacencyList();\r\n\t\tpathList=new ArrayList<Integer>();\r\n\t\tisVisited=new boolean [graph.getNumberOfVertices()];\r\n\t\ttraverseRecursively(graph, vertex);\r\n\t\treturn pathList;\r\n\t}", "public int getPredecessorCount(final LazyNode2 vertex) {\n Set<Node> vertices = new HashSet<Node>();\n \n Node n = neo.getNodeById(vertex.getId());\n \n for(Relationship r : n.getRelationships(relType.DEFAULT, Direction.INCOMING)){\n if(isActive(r))\n vertices.add(r.getStartNode());\n }\n n = null; \n \n return vertices.size();\n }", "public int getParent(int v){\n\t\t\treturn parent[v];\n\t\t}", "Graph.Vertex getParent(Graph.Vertex u) {\n\t\treturn getVertex(u).parent;\n\t}", "public void selectParents() {\n // Create a new parent list for this reproductive cycle. Let the garbage\n // handler dispose of the old list, if there was one.\n switch (Defines.parentAlgo) {\n case Defines.PA_RANDOM:\n this.parents = this.selectParentsRandom();\n break;\n\n case Defines.PA_ROULETTE:\n this.parents = this.selectParentsRoulette();\n break;\n\n case Defines.PA_TOURNAMENT:\n this.parents = this.selectParentsTournament();\n break;\n }\n// this.howGoodAreParents();\n }", "List<V> getAdjacentVertexList(V v);", "private int parent(int index) {\n // Formula to calculate the index of the parent node\n return Math.floorDiv(index - 1, d);\n }", "public SearchTreeNode getParent() { return parent; }", "private void howGoodAreParents() {\n String msg = \"From chromo with GH scores: \";\n for (int i = 0; i < this.chromosomes.size(); i++) {\n msg += this.chromosomes.get(i).getTotalGH() + \"-\" + this.chromosomes.get(i).getNumValidGroup() + \" \";\n }\n\n msg += \"\\n\\tChose parents (\";\n switch (Defines.parentAlgo) {\n case Defines.PA_RANDOM:\n msg += \"random\";\n break;\n\n case Defines.PA_ROULETTE:\n msg += \"roulette\";\n break;\n\n case Defines.PA_TOURNAMENT:\n msg += \"tournament\";\n msg += String.format(\" (size %d)\", Defines.tournamentSize);\n break;\n }\n msg += \") \";\n for (int i = 0; i < Defines.crossoverParentCt; i++) {\n msg += this.parents.get(i).getTotalGH() + \" \";\n }\n Log.debugMsg(msg);\n }", "public Set<JmiClassVertex> getAllSuperclassVertices(JmiClassVertex vertex)\n {\n return getClassAttributes(vertex).allSuperclassVertices;\n }", "public Iterable<Integer> pathTo(int v)\n {\n if (!hasPathTo(v)) return null;\n Stack<Integer> path = new Stack<Integer>();\n for (int x = v; x != s; x = edgeTo[x])\n path.push(x);\n path.push(s);\n return path;\n }", "public int find(int [] parent, int vertex)\n\t\t{\n\t\t\tif(parent[vertex] != vertex)\n\t\t\t\treturn find(parent, parent[vertex]);\n\t\t\treturn vertex;\n\t\t}", "List<V> getShortestPath(V vertex);", "private ArrayList<Chromosome> selectParentsTournament() {\n ArrayList<Chromosome> parents = new ArrayList<Chromosome>(Defines.crossoverParentCt);\n ArrayList<Chromosome> matingPool = new ArrayList<Chromosome>(Defines.crossoverParentCt);\n\n // Run tournaments to select parents - for each parent\n for (int parentIdx = 0; parentIdx < Defines.crossoverParentCt; parentIdx++) {\n\n // Run tournaments - get random contestants (run.getPaTournamentSize())\n for (int tournIdx = 0; tournIdx < Defines.tournamentSize; tournIdx++) {\n int contestantID = Defines.randNum(0, this.chromosomes.size() - 1);\n matingPool.add(this.chromosomes.get(contestantID));\n }\n Collections.sort(matingPool);\n parents.add(matingPool.get(0));\n }\n\n return parents;\n }", "private List<Long> createParents(List<Chromosome> parents) {\n IgniteCache<Long, Chromosome> cache = ignite.cache(GAGridConstants.POPULATION_CACHE);\n cache.clear();\n\n List<Long> keys = new ArrayList();\n\n parents.stream().forEach((x) -> {\n long[] genes = x.getGenes();\n Chromosome newparent = new Chromosome(genes);\n cache.put(newparent.id(), newparent);\n keys.add(newparent.id());\n });\n\n return keys;\n }", "public int getParentNode(){\n\t\treturn parentNode;\n\t}", "public Collection<Vertex> adjacentVertices(Vertex v) {\n Vertex parameterVertex = new Vertex(v.getLabel());\n if(!myGraph.containsKey(parameterVertex)){\n throw new IllegalArgumentException(\"Vertex is not valid\");\n }\n\n //create a copy of the passed in vertex to restrict any reference\n //to interals of this class\n Collection<Vertex> adjVertices = new ArrayList<Vertex>();\n\n Iterator<Edge> edges = myGraph.get(parameterVertex).iterator();\n while(edges.hasNext()) {\n adjVertices.add(edges.next().getDestination());\n }\n return adjVertices;\n }", "public int findParent(int[] parent, int u) {\n\t\tif (parent[u] == -1) { // matlab u khud ka parent hai/godfather/leader/founder\n\t\t\treturn u;\n\t\t}\n\t\treturn findParent(parent, parent[u]);\n\t}", "public Set<Long> getParents() {\n String key = parentName + parentGenus;\n if (!parentNameToParentBlocks.containsKey(key)) {\n return null;\n }\n return parentNameToParentBlocks.get(key);\n }", "public void selectParents1() {\n // Create a new parent list for this reproductive cycle. Let the garbage\n // handler dispose of the old list, if there was one.\n switch (Defines.parentAlgo) {\n case Defines.PA_RANDOM:\n this.parents = this.selectParentsRandom();\n break;\n\n case Defines.PA_ROULETTE:\n this.parents = this.selectParentsRoulette();\n break;\n\n case Defines.PA_TOURNAMENT:\n this.parents = this.selectParentsTournament();\n break;\n }\n// this.howGoodAreParents();\n }", "public ArrayList<DagNode> getAllParentNodes(DagNode node){\n node.setDiscovered(true);\n ArrayList<DagNode> allParentNodes = new ArrayList<>();\n allParentNodes.add(node);\n for(DagNode parentNode : node.getParentTaskIds()){\n if(!parentNode.isDiscovered()){\n //if it has not been discoverd yet, add it to the list to return\n allParentNodes.addAll(getAllParentNodes(parentNode));\n }\n }\n return allParentNodes;\n }", "@Override\n\tpublic WhereNode getParent() {\n\t\treturn parent;\n\t}", "public int ancestor(Iterable<Integer> v, Iterable<Integer> w) {\n\t\tif (v == null || w == null)\n\t\t\tthrow new IllegalArgumentException();\n\t\tBreadthFirstDirectedPaths bfsv = new BreadthFirstDirectedPaths(G, v);\n\t\tBreadthFirstDirectedPaths bfsw = new BreadthFirstDirectedPaths(G, w);\n\t\tint dv, dw, ancestor = -1, dsap = INFINITY;\n\t\tfor(int vertex = 0; vertex < G.V(); vertex++) {\n\t\t\tdv = bfsv.distTo(vertex);\n\t\t\tdw = bfsw.distTo(vertex);\n\t\t\tif (dv != INFINITY && dw != INFINITY && (dv + dw < dsap)) {\n\t\t\t\tancestor = vertex;\n\t\t\t\tdsap = dv + dw;\n\t\t\t} \n\t\t}\n\t\treturn (dsap == INFINITY) ? -1 : ancestor;\n\t}", "public SearchNode<S, A> getParent() {\r\n\t\treturn parent;\r\n\t}", "private ArrayList<Chromosome> selectParentsRandom() {\n ArrayList<Chromosome> parents = new ArrayList<Chromosome>(Defines.crossoverParentCt);\n\n for (int i = 0; i < Defines.crossoverParentCt; i++) {\n // Generate random index into chromosomes in range [0..size-1]\n int randomParent = Defines.randNum(0, chromosomes.size() - 1);\n // Remember the new parent\n parents.add(chromosomes.get(randomParent));\n }\n return parents;\n }", "public Iterable<DirectedEdge> pathTo(int v){\n\t\tvalidateVertex(v);\n\t\tif(!hasPathTo(v)) return null;\n\n\t\tLinkedStack<DirectedEdge> stack=new LinkedStack<>();\n\t\twhile(edgeTo[v]!=null){\n\t\t\tstack.push(edgeTo[v]);\n\t\t\tv=edgeTo[v].from();\n\t\t}\n\t\treturn stack;\n\t}", "public List<AbstractFamixEntity> getParentEntities(AbstractFamixEntity entity) {\n List<AbstractFamixEntity> parentEntities = new ArrayList<AbstractFamixEntity>();\n if (entity.getParent() != null) {\n parentEntities.add(entity.getParent());\n parentEntities.addAll(getParentEntities(entity.getParent()));\n }\n\n return parentEntities;\n }", "Iterable<DirectedEdge> pathTo(int v)\n\t{\n\t\tStack<DirectedEdge> path=new Stack<>();\n\t\tfor(DirectedEdge e=edgeTo[v]; e!=null; e=edgeTo[e.from()])\n\t\t{\n\t\t\tpath.push(e);\n\t\t}\n\t\treturn path;\n\t}", "public TaskGroup[] getSelectedTaskParents()\n {\n int selectedItemCount = getSelectedTaskCount();\n TaskGroup[] parents = new TaskGroup[selectedItemCount];\n\n Iterator<AUndertaking> selectedTasks = getSelectedTaskIterator();\n int i = 0;\n\n while (selectedTasks.hasNext()) {\n AUndertaking task = selectedTasks.next();\n\n parents[i++] = task.getTaskGroup();\n }\n\n return parents;\n }", "public Set<V> getNeighbours(V vertex);", "public Node getParent();", "public IRNode getParent(IRNode node);", "public int ancestor(int v, int w) {\n\t\tBreadthFirstDirectedPaths bfsv = new BreadthFirstDirectedPaths(G, v);\n\t\tBreadthFirstDirectedPaths bfsw = new BreadthFirstDirectedPaths(G, w);\n\t\tint dv, dw, ancestor = -1, dsap = INFINITY;\n\t\tfor(int vertex = 0; vertex < G.V(); vertex++) {\n\t\t\tdv = bfsv.distTo(vertex);\n\t\t\tdw = bfsw.distTo(vertex);\n\t\t\tif (dv != INFINITY && dw != INFINITY && (dv + dw < dsap)) {\n\t\t\t\tancestor = vertex;\n\t\t\t\tdsap = dv + dw;\n\t\t\t} \n\t\t}\n\t\t\n\t\treturn (dsap == INFINITY) ? -1 : ancestor;\n\t}", "@Override\r\n\tpublic Iterable<Integer> pathTo(int v) {\r\n\t\tif (!hasPathTo(v)) return null;\r\n\r\n\t\tArrayList<Integer> list = new ArrayList<Integer>();\r\n\t\twhile(v != -1) {\r\n\t\t\tlist.add(v);\r\n\t\t\tv = edgeTo[v];\r\n\t\t}\r\n\r\n\t\treturn list;\r\n\t}", "public TreeNode getParent() { return par; }", "public List<TempTableHeader> getParents() {\r\n\t\t\treturn parents;\r\n\t\t}", "public int findParent(int node) {\n if(parent[node] == node) return node;\r\n \r\n //if a node is not itself's parent then \r\n //find parent of its parent\r\n if(parent[node] != node) parent[node] = findParent(parent[node]);\r\n return parent[node];\r\n }", "@Override\n\tpublic List<Location> getNeighbors(Location vertex) {\n\n\t\tArrayList<Location> neighbors = new ArrayList<Location>();\n\n\t\tfor (Path p : getOutEdges(vertex))\n\t\t\tneighbors.add(p.getDestination());\n\n\t\treturn neighbors;\n\n\n\t}", "public int ancestor(Iterable<Integer> v, Iterable<Integer> w){\n if(v == null || w == null)\n throw new NullPointerException(\"null arguments\");\n shortestPath(v,w);\n return ca;\n }", "public List<AlfClass> getParents() {\t\r\n\t\tList<AlfClass> parents = new ArrayList<AlfClass>(this.strongParents);\r\n\t\tparents.addAll(this.weakParents);\r\n\t\treturn Collections.unmodifiableList(parents);\r\n\t}", "private void printPath(int currentVertex, int[] parents) {\n // Base case : Source node has been processed \n if (currentVertex == NO_PARENT) {\n return;\n }\n printPath(parents[currentVertex], parents);\n System.out.print(currentVertex + \" \");\n }", "public ParseTreeNode getParent() {\r\n return _parent;\r\n }", "private Path safeGetParentsParent(Path path) {\n if (path.getParent() != null && path.getParent().getParent() != null\n && path.getParent().getParent().getParent() != null) {\n return path.getParent().getParent().getParent();\n }\n return null;\n }", "public int [] breadthFirstSearch (int start){\r\n int [] visited = new int[getNumV()];\r\n int[] order = new int[getNumV()];\r\n int index = 0;\r\n int[] parent = new int[getNumV()];\r\n\r\n // parent arrayi, visited arrayi ve order arrayi set edildi\r\n for(int i = start; i<getNumV(); i++){\r\n parent[i] = -1;\r\n visited[i] = -1;\r\n order[index] = i;\r\n index++;\r\n }\r\n //eger baslanilan vertex sifirdan farkli bir vertex ise bu vertex'e kadar ki vertexler de order arrayine eklendi.\r\n if(index<getNumV()-1)\r\n for(int i=0; i<start; i++){\r\n order[index] = i;\r\n index++;\r\n }\r\n\r\n // her vertex uzerinden breadthFirsSearch yapildi.\r\n for(int i = 0; i<getNumV(); i++) {\r\n if(visited[i] == -1)\r\n breadthFirstSearch(order[i], visited, parent);\r\n }\r\n return parent;\r\n }", "public int ancestor(Iterable<Integer> v, Iterable<Integer> w) {\n if (!isValid(v, w)) {\n throw new IndexOutOfBoundsException();\n }\n\n int shortestPath = Integer.MAX_VALUE;\n Deque<Integer> ancestors = new ArrayDeque<>();\n int ancestor = -1;\n\n BreadthFirstDirectedPaths bfsV = new BreadthFirstDirectedPaths(digraph, v);\n BreadthFirstDirectedPaths bfsW = new BreadthFirstDirectedPaths(digraph, w);\n\n for (int i = 0; i < this.digraph.V(); i++) {\n if (bfsV.hasPathTo(i) && bfsW.hasPathTo(i)) {\n ancestors.push(i);\n }\n }\n\n for (Integer a : ancestors) {\n if ((bfsV.distTo(a) + bfsW.distTo(a)) < shortestPath) {\n shortestPath = (bfsV.distTo(a) + bfsW.distTo(a));\n ancestor = a;\n }\n }\n return ancestor;\n }", "public List<V> getPath(int index){\n\t\t\tArrayList<V> path = new ArrayList<V>();\n\t\t\n\t\t\tdo{\n\t\t\t\tpath.add(vertices.get(index));\n\t\t\t\tindex=parent[index];\n\t\t\t}\n\t\t\twhile(index!= -1);\n\t\t\treturn path;\n\t\t}", "public int ancestor(Iterable<Integer> v, Iterable<Integer> w) {\n\n\n validateIterableVertices(v);\n validateIterableVertices(w);\n\n BreadthFirstDirectedPaths bfs1 = new BreadthFirstDirectedPaths(dg, v);\n BreadthFirstDirectedPaths bfs2 = new BreadthFirstDirectedPaths(dg, w);\n\n Stack<Integer> candidates = new Stack<>();\n\n for (int p = 0; p < dg.V(); p++) {\n if (bfs1.hasPathTo(p) && bfs2.hasPathTo(p)) {\n candidates.push(p);\n }\n }\n\n int shortesAncestor = -1;\n int shortesPath = Integer.MAX_VALUE;\n\n while (!candidates.isEmpty()) {\n int c = candidates.pop();\n if (shortesPath > bfs1.distTo(c) + bfs2.distTo(c)) {\n shortesPath = bfs1.distTo(c) + bfs2.distTo(c);\n shortesAncestor = c;\n }\n }\n\n return shortesAncestor;\n }", "public List<Integer> getPredecessors(int v);", "private void dfs(int vertex, int parent, int currentE) {\n System.out.println(\"Going from \" + parent + \" to \" + vertex);\n currentE++;\n assert g.isDirected();\n if (!lowLink.containsKey(vertex)) {\n lowLink.put(vertex, currentE);\n } else {\n if (parent >= 0) {\n if (lowLink.get(vertex) < lowLink.get(parent)) { //We've been there\n lowLink.put(parent, lowLink.get(vertex));\n }\n }\n return;\n }\n\n //Remove backward edge\n g.removeEdge(vertex, parent);\n\n for (var head : g.getHeads(vertex)) {\n dfs(head, vertex, currentE);\n if (lowLink.get(head) < lowLink.get(vertex)) {\n lowLink.put(vertex, lowLink.get(head));\n }\n // Apply bridge criteria:\n // lowlink(head) > e(tail)\n if (lowLink.get(head) > currentE) {\n bridges.add(new Graph.Edge(vertex, head));\n }\n }\n }", "public int ancestor(int v, int w) {\n\n if (v < 0 || v >= dg.V() || w < 0 || w >= dg.V())\n throw new IllegalArgumentException(\"vertex is not between 0 and \" + (dg.V() - 1));\n\n BreadthFirstDirectedPaths bfs1 = new BreadthFirstDirectedPaths(dg, v);\n BreadthFirstDirectedPaths bfs2 = new BreadthFirstDirectedPaths(dg, w);\n\n Stack<Integer> candidates = new Stack<>();\n\n for (int p = 0; p < dg.V(); p++) {\n if (bfs1.hasPathTo(p) && bfs2.hasPathTo(p)) {\n candidates.push(p);\n }\n }\n\n int shortesAncestor = -1;\n int shortesPath = Integer.MAX_VALUE;\n\n while (!candidates.isEmpty()) {\n int c = candidates.pop();\n if (shortesPath > bfs1.distTo(c) + bfs2.distTo(c)) {\n shortesPath = bfs1.distTo(c) + bfs2.distTo(c);\n shortesAncestor = c;\n }\n }\n\n return shortesAncestor;\n\n }", "public void shortestPathList() {\n Cell cell = maze.getGrid()[r - 1][r - 1];\n\n parents.add(cell);\n\n while (cell.getParent() != null) {\n parents.add(cell.getParent());\n cell = cell.getParent();\n }\n\n Collections.reverse(parents);\n }", "public int ancestor(Iterable<Integer> v, Iterable<Integer> w) {\n if (v == null || w == null) {\n throw new NullPointerException();\n }\n BreadthFirstDirectedPaths bfdpv = new BreadthFirstDirectedPaths(g, v);\n BreadthFirstDirectedPaths bfdpw = new BreadthFirstDirectedPaths(g, w);\n int anc = -1;\n int minLen = Integer.MAX_VALUE;\n for (int x = 0; x < g.V(); x++) {\n if (bfdpv.hasPathTo(x) && bfdpw.hasPathTo(x)) {\n int len = bfdpv.distTo(x) + bfdpw.distTo(x);\n if (len < minLen) {\n minLen = len;\n anc = x;\n }\n }\n }\n return anc;\n }", "TreeNode<T> getParent();", "CoreParentNode coreGetParent();", "private PathwayVertexRep getSelectableVertexRepForPath(PathwayVertexRep vertexRep) {\n\t\tPathwayVertexRep parent = null;\n\t\tSet<DefaultEdge> edges = pathway.edgesOf(vertexRep);\n\t\twhile (edges.isEmpty()) {\n\t\t\tparent = vertexRep.getParent();\n\t\t\tif (parent == null)\n\t\t\t\tbreak;\n\t\t\tedges = pathway.edgesOf(parent);\n\t\t}\n\t\tif (parent != null)\n\t\t\tvertexRep = parent;\n\t\treturn vertexRep;\n\t}", "public Collection<V> getChildren(V vertex);", "public Node getParentNode() {\n return parentNode;\n }", "public int ancestor(Iterable<Integer> v, Iterable<Integer> w) {\r\n for (Integer vTmp : v) {\r\n if (vTmp < 0 || vTmp >= G.V())\r\n throw new IndexOutOfBoundsException();\r\n }\r\n for (Integer wTmp : w) {\r\n if (wTmp < 0 || wTmp >= G.V())\r\n throw new IndexOutOfBoundsException();\r\n }\r\n BreadthFirstDirectedPaths bfdp1 = new BreadthFirstDirectedPaths(G, v);\r\n BreadthFirstDirectedPaths bfdp2 = new BreadthFirstDirectedPaths(G, w);\r\n int shortestDist = Integer.MAX_VALUE;\r\n int shortestDistIndex = -1;\r\n for (int i = 0; i < G.V(); i++) {\r\n if (bfdp1.hasPathTo(i) && bfdp2.hasPathTo(i)) {\r\n if (shortestDist > bfdp1.distTo(i) + bfdp2.distTo(i)) {\r\n shortestDist = bfdp1.distTo(i) + bfdp2.distTo(i);\r\n shortestDistIndex = i;\r\n }\r\n }\r\n }\r\n return shortestDistIndex;\r\n }", "public ParentVertex(int keyIn, double xIn, double yIn){\n this.key = keyIn;\n this.xPos = xIn;\n this.yPos = yIn;\n connectedKeys = new ArrayList<>();\n degree = 0;\n fitness = 0;\n }", "public int ancestor(int v, int w){\n\t BreadthFirstDirectedPaths BFSv =new BreadthFirstDirectedPaths(D,v);\n\t BreadthFirstDirectedPaths BFSw =new BreadthFirstDirectedPaths(D,w);\n\t \n\t int distance = Integer.MAX_VALUE;\n\t int ancestor = -1;\n\t for (int vertex = 0 ; vertex < D.V();vertex++)\n\t\t if ((BFSv.hasPathTo(vertex))\n\t\t\t\t &&(BFSw.hasPathTo(vertex))\n\t\t\t\t &&(BFSv.distTo(vertex)+BFSw.distTo(vertex))<distance)\n\t\t {\n\t\t\t ancestor = vertex;\n\t\t\t distance = BFSv.distTo(vertex)+BFSw.distTo(vertex);\n\t\t }\n\n\t\t return ancestor;\n }", "Node<T> parent();", "public int ancestor(Iterable<Integer> v, Iterable<Integer> w) {\n BreadthFirstDirectedPaths bfdV = new BreadthFirstDirectedPaths(G, v);\n BreadthFirstDirectedPaths bfdW = new BreadthFirstDirectedPaths(G, w);\n int distance = Integer.MAX_VALUE;\n int commonAncestor = -1;\n for (int i = 0; i < G.V(); i++) {\n if (bfdV.hasPathTo(i) && bfdW.hasPathTo(i)) {\n int local = bfdV.distTo(i) + bfdW.distTo(i);\n if (local < distance) {\n distance = local;\n commonAncestor = i;\n }\n }\n }\n return commonAncestor;\n }", "public List<Category> getParents() {\n\t\treturn parents;\n\t}", "public TreeNode getParent ()\r\n {\r\n return parent;\r\n }", "private void traverseRecursively(GraphStructure graph,Integer vertex) {\r\n\t\tList<GraphStructure.Edge> list = adjacencyList[vertex];\r\n\t\tpathList.add(vertex);\r\n\t\tisVisited[vertex]=true;\r\n\t\tfor(GraphStructure.Edge adjacentVertex : list) {\r\n\t\t\tif(! isVisited[adjacentVertex.getVertex()]) {\r\n\t\t\t\ttraverseRecursively(graph, adjacentVertex.getVertex());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public ParentVertex(){\n Random rand = new Random();\n key = rand.nextInt(Integer.MAX_VALUE);\n xPos = rand.nextDouble();\n yPos = rand.nextDouble();\n connectedKeys = new ArrayList<>();\n degree = 0;\n fitness = 0;\n }", "public VNode getParent() throws VlException\n {\n VRL pvrl=getParentLocation(); \n \n if (pvrl==null)\n \treturn null; \n \n return vrsContext.openLocation(getParentLocation());\n }", "public int ancestor(int v, int w){\n shortestPath(v,w);\n return ca;\n }", "public BSTNode getParentNode() {\n\t\treturn parentNode;\n\t}", "public int getParentId() {\r\n\t\treturn parentId;\r\n\t}", "Set<Vertex> getVertices();", "private int findParent(int e, int[] parents) {\n if (parents[e] != e) {\n return findParent(parents[e], parents);\n }\n\n return parents[e];\n }", "private PMCGenotype[] selectParents()\n\t{\n\t\tPMCGenotype[] bestGenes = new PMCGenotype[parentsToSelect];\n\n\t\tint lowestFitnessOfSelectedIndex = 0;\n\t\tdouble lowestFitnessOfSelected = -1;\n\n\t\t// Select initial set of parents.\n\t\tbestGenes[0] = population[0];\n\t\tlowestFitnessOfSelectedIndex = 0;\n\t\tlowestFitnessOfSelected = bestGenes[0].getFitness();\n\t\tfor (int i = 1; i < this.parentsToSelect; i++)\n\t\t{\n\t\t\tbestGenes[i] = population[i];\n\n\t\t\tif (bestGenes[i].getFitness() < lowestFitnessOfSelected)\n\t\t\t{\n\t\t\t\tlowestFitnessOfSelectedIndex = i;\n\t\t\t\tlowestFitnessOfSelected = bestGenes[i].getFitness();\n\t\t\t}\n\t\t}\n\n\t\t// Select candidates with the highest fitness, replacing those with lowest fitness.\n\t\tfor (int i = parentsToSelect; i < population.length; i++)\n\t\t{\n\t\t\tPMCGenotype pmcg = population[i];\n\t\t\tif (pmcg.getFitness() > lowestFitnessOfSelected)\n\t\t\t{\n\t\t\t\tbestGenes[lowestFitnessOfSelectedIndex] = pmcg;\n\n\t\t\t\tlowestFitnessOfSelectedIndex = 0;\n\t\t\t\tlowestFitnessOfSelected = bestGenes[0].getFitness();\n\n\t\t\t\tfor (int j = 1; j < parentsToSelect; j++)\n\t\t\t\t{\n\t\t\t\t\tif (bestGenes[j].getFitness() < lowestFitnessOfSelected)\n\t\t\t\t\t{\n\t\t\t\t\t\tlowestFitnessOfSelectedIndex = j;\n\t\t\t\t\t\tlowestFitnessOfSelected = bestGenes[j].getFitness();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn bestGenes;\n\t}", "public PlanNode getParent() {\n return parent;\n }", "public TreeNode getParentNode();", "public PageTreeNode getParent() {\n return parent;\n }", "public static void findClosestSharedParentBST() {\n \n // initialize graph (adjacency list) as a BST\n int[][] bst = {\n {1,2}, // vertex 0 ....\n {3,4},\n {5,6},\n {7,8},\n {},\n {},\n {},\n {9},\n {},\n {} // vertex 9\n }; \n // Given 2 Nodes in a BST, find their closest shared parent\n Graph g = new Graph(bst);\n g.dijsktra(g.getVertices().get(0));\n List<Vertex> path1 = g.getShortestPath(g.getVertices().get(1));\n List<Vertex> path2 = g.getShortestPath(g.getVertices().get(9));\n\n // parent will be the last item in each path before the diverge\n // EX: [1,2,3], [1,2,4,5]. - searched for 3 and 5. parent is 2.\n // EX: [1,2], [1,2,4,5]. - searched for 2 and 5. parent is 2.\n int min = Math.min(path1.size(), path2.size()) -1;\n int parentidx = 0;\n for (int i = 0; i <= min; i++) {\n if (path1.get(i) == path2.get(i)) {\n parentidx = i;\n } else {\n break;\n }\n }\n System.out.println(\"shared parent: \" + path1.get(parentidx));\n }", "DendrogramNode<T> getParent();", "private void printPathPara(int currentVertex, int[] parents, ListaEnlazada lista) {\n if (currentVertex == NO_PARENT) {\n return;\n }\n \n printPathPara(parents[currentVertex], parents, lista);\n NodoTemp temp = new NodoTemp(currentVertex);\n lista.add(temp);\n\n System.out.print(currentVertex + \" \");\n }", "private static Parent[] makeParents() {\n\t\treturn null;\n\t}", "public Iterator<DocTokenInf> getPrev(int vertex) {\n\t\tDocTokenLinkedList ll = list[vertex];\n\t\tif(ll == null)\n\t\t\treturn null;\n\t\treturn ll.iterator();\n\t}", "@Override\r\n\tpublic ArrayList<Edge<E>> primMinimumSpanningTree(E src) {\r\n\t\tArrayList<Edge<E>> prim = new ArrayList<Edge<E>>();\r\n\t\tif(containsVertex(src)) {\r\n\t\t\tlastSrc = vertices.get(src);\r\n\t\t\tPriorityQueue<Vertex<E>> pq = new PriorityQueue<Vertex<E>>();\r\n\t\t\tvertices.forEach((E t, Vertex<E> u) -> {\r\n\t\t\t\tu.setDistance(Integer.MAX_VALUE);\r\n\t\t\t\tu.setColor(Color.WHITE);\r\n\t\t\t\tu.setPredecessor(null);\r\n\t\t\t\tpq.offer(u);\r\n\t\t\t});\r\n\t\t\tpq.remove(lastSrc);\r\n\t\t\tlastSrc.setDistance(0);\r\n\t\t\tpq.offer(lastSrc);\r\n\r\n\t\t\twhile(!pq.isEmpty()) {\r\n\t\t\t\tVertex<E> u = pq.poll();\r\n\t\t\t\tfor(Edge<E> ale : adjacencyLists.get(u.getElement())) {\r\n\t\t\t\t\tVertex<E> s = vertices.get(ale.getSrc());\r\n\t\t\t\t\tVertex<E> d = vertices.get(ale.getDst());\r\n\t\t\t\t\tif(d.getColor() == Color.WHITE && d.getDistance() > ale.getWeight()) {\r\n\t\t\t\t\t\tpq.remove(d);\r\n\t\t\t\t\t\tVertex<E> pred = d.getPredecessor();\r\n\t\t\t\t\t\tif(pred != null) { //remove the edge that has ale.dst as dst vertex\r\n\t\t\t\t\t\t\tEdge<E> edgeToRemove = new Edge<>(pred.getElement(), ale.getDst(), 1);\r\n\t\t\t\t\t\t\tprim.remove(edgeToRemove);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\td.setDistance(ale.getWeight());\r\n\t\t\t\t\t\td.setPredecessor(s);\r\n\t\t\t\t\t\tpq.offer(d);\r\n\t\t\t\t\t\tprim.add(ale);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tu.setColor(Color.BLACK);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn prim;\r\n\t}", "public Node getParent(){\n return parent;\n }", "public Integer getParentid() {\n\t\treturn parentid;\n\t}", "Vertex getVertex();", "public void findPath(Vertex v, Graph g)\n {\n \tQueue<Vertex> q = new LinkedList<Vertex>();\n \tSet<String> visited= new HashSet<String>();\n \tSet<String> edges= new TreeSet<String>();\n \t\n \t \tq.add(v);\n \t \tvisited.add(v.name);\n \t \t\n \t \twhile(!q.isEmpty()){\n \t \t\tVertex vertex = q.poll();\n \t \t\t \n \t for(Edge adjEdge: vertex.adjEdge.values()){\n \t\t if(!visited.contains(adjEdge.adjVertex.name) && !adjEdge.adjVertex.isDown && !adjEdge.isDown){\n \t\t\t q.offer(adjEdge.adjVertex);\n \t\t\t visited.add(adjEdge.adjVertex.name);\n \t\t\t \n \t\t\t edges.add(adjEdge.adjVertex.name);\n \t\t\t \n \t\t }\n \t }\n \t \n \t }\n \t \tfor(String str: edges){\n \t\t System.out.print('\\t');\n \t\t System.out.println(str);\n \t }\n \t \t\n }", "public List<Integer> neighbors(int vertex) {\r\n \tArrayList<Integer> vertices = new ArrayList<Integer>();\r\n \tLinkedList<Edge> testList = myAdjLists[vertex];\r\n int counter = 0;\r\n while (counter < testList.size()) {\r\n \tvertices.add(testList.get(counter).myTo);\r\n \tcounter++;\r\n }\r\n return vertices;\r\n }", "public String getParentId() {\n return parentId;\n }", "public String getParentId() {\n return parentId;\n }", "public String getParentId() {\n return parentId;\n }", "public String getParentId() {\n return parentId;\n }", "public String getParentId() {\n return parentId;\n }", "public String getParentId() {\n return parentId;\n }", "public String getParentId() {\n return parentId;\n }", "public String getParentId() {\n return parentId;\n }", "public String getParentId() {\n return parentId;\n }", "public Collection<E> getChildEdges(V vertex);" ]
[ "0.7248563", "0.67274433", "0.65516335", "0.62949085", "0.6104543", "0.6090317", "0.6014881", "0.59131175", "0.5807201", "0.5763187", "0.5691163", "0.5643846", "0.56271714", "0.5574078", "0.5552402", "0.5551944", "0.5542986", "0.5502067", "0.55020005", "0.5483116", "0.5476316", "0.5447865", "0.5436792", "0.5416621", "0.5412505", "0.5406981", "0.54008764", "0.54006076", "0.5385564", "0.5340812", "0.53123844", "0.5305162", "0.5301195", "0.5300007", "0.52938", "0.52931654", "0.52905506", "0.5286302", "0.52725345", "0.52468765", "0.52341145", "0.5228332", "0.5213951", "0.52107584", "0.52090514", "0.5208297", "0.5189659", "0.5176133", "0.5154324", "0.51541567", "0.5141302", "0.5137924", "0.5120129", "0.5119385", "0.511682", "0.51136905", "0.5110427", "0.5105321", "0.5083306", "0.50822675", "0.50775284", "0.50727916", "0.50667983", "0.5065751", "0.50645876", "0.50629944", "0.5061794", "0.5060583", "0.5058528", "0.505685", "0.50548106", "0.50493675", "0.50493", "0.5047096", "0.50433403", "0.50408155", "0.5037305", "0.50257146", "0.5018286", "0.50165874", "0.5011477", "0.50063926", "0.5005309", "0.50044566", "0.50016296", "0.49954373", "0.49907407", "0.49820256", "0.4980722", "0.49779654", "0.49778786", "0.49778786", "0.49778786", "0.49778786", "0.49778786", "0.49778786", "0.49778786", "0.49778786", "0.49778786", "0.49720633" ]
0.6902453
1
This function inserts the given edge into the underlying storage(s) and updates the cache(s) accordingly.
public abstract boolean putEdge(Edge incomingEdge);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void insert(Edge edge){\n edges[edge.getSource()].add(edge);\n if (isDirected()){\n edges[edge.getDest()].add(new Edge(edge.getDest(), edge.getSource(),edge.getWeight()));\n }\n }", "protected void addEdge(IEdge edge) {\n\n if (edge != null) {\n\n this.ids.add(edge.getID());\n this.edgeMap.put(edge.getID(), edge);\n }\n }", "void addEdge(Edge e) {\n\t\t\tif(!_edges.containsKey(e.makeKey())) {\n\t\t\t\t_edges.put(e.makeKey(),e);\n\t\t\t\te._one.addNeighborEdge(e);\n\t\t\t\te._two.addNeighborEdge(e);\n\t\t\t}\n\t\t}", "public void insert(Edge edge) {\r\n edges[edge.getSource()].add(edge);\r\n if (!isDirected()) {\r\n edges[edge.getDest()].add(new Edge(edge.getDest(),\r\n edge.getSource(),\r\n edge.getWeight()));\r\n }\r\n }", "void add(Edge edge);", "public void addEdge(Edge e){\n\t\tedges.put(e.hashCode(), e);\n\t\te.getHead().addConnection(e);\n\t\te.getTail().addConnection(e);\n\t}", "public static void insertEdge(Edge edge,Context context) {\n DatabaseContext dbContext = new DatabaseContext(context);\n SQLiteHelper helper = new SQLiteHelper(dbContext,\"BLEdevice.db\");\n helper.insertEdge(edge);\n // Log.e(\"insertEdge\", \"edge cout = \" +coutEdge(context));\n }", "boolean addEdge(E edge);", "void addNeighborEdge(Edge e) {\n\t\t\t_neighborEdges.put(e,false);\n\t\t}", "public void addEdge(Edge edge){\n \n synchronized(vertexes){\n Long start = edge.getStart();\n Vertex sVertex = vertexes.get(start);\n if(sVertex != null){\n sVertex.addEdge(edge, true);\n }\n// if undirected graph then adds edge to the finish vertex too \n if(!edge.isDirected()){\n Long finish = edge.getFinish();\n Vertex fVertex = vertexes.get(finish);\n if(fVertex != null){\n fVertex.addEdge(edge, false);\n }\n }\n }\n \n }", "@Override\n public void storeToGraph(Set<GraphContext> graphContext) {\n\n graphContext.forEach(entry -> {\n try {\n LineageEntity fromEntity = entry.getFromVertex();\n LineageEntity toEntity = entry.getToVertex();\n\n upsertToGraph(fromEntity, toEntity, entry.getRelationshipType(), entry.getRelationshipGuid());\n } catch (Exception e) {\n log.error(VERTICES_AND_RELATIONSHIP_CREATION_EXCEPTION, e);\n }\n });\n }", "void updateEdgeData(EdgeGraph edge) {\n\t\tedge = PedSimCity.edgesMap.get(edge.getID()); //in case it was a subgraph edge\n\t\tif (UserParameters.empiricalABM) edge.densities.replace(agp.groupName, edge.densities.get(agp.groupName)+1);\n\t\telse edge.densities.replace(ap.routeChoice, edge.densities.get(ap.routeChoice)+1);\n\t}", "void addEdge(Edge e) {\n if (e.getTail().equals(this)) {\n outEdges.put(e.getHead(), e);\n\n return;\n } else if (e.getHead().equals(this)) {\n indegree++;\n inEdges.put(e.getTail(), e);\n\n return;\n }\n\n throw new RuntimeException(\"Cannot add edge that is unrelated to current node.\");\n }", "protected void addHyperEdge(IHyperEdge hyperedge) {\n\n if (hyperedge != null) {\n\n this.ids.add(hyperedge.getID());\n this.hyperEdgeMap.put(hyperedge.getID(), hyperedge);\n }\n }", "public void addEdge(E e){\n\t\tedges.add(e);\n\t}", "@Override\n\tpublic boolean addEdge(ET edge)\n\t{\n\t\tif (edge == null)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (edgeList.contains(edge))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tList<N> graphNodes = edge.getAdjacentNodes();\n\t\tfor (N node : graphNodes)\n\t\t{\n\t\t\taddNode(node);\n\t\t\tnodeEdgeMap.get(node).add(edge);\n\t\t}\n\t\tedgeList.add(edge);\n\t\tgcs.fireGraphEdgeChangeEvent(edge, EdgeChangeEvent.EDGE_ADDED);\n\t\treturn true;\n\t}", "public void addEdge(Edge e) {\n incident.add(e);\n }", "protected boolean addEdge(Long key, byte[] edge, byte[] data) {\n\t\ttry {\n\t\t\tComposite columnName = new Composite();\n\t\t\tcolumnName.add(0, \"edges\");\n\t\t\tcolumnName.add(1, edge);\n\n\t\t\tColumnFamilyUpdater<Long, Composite> updater = template\n\t\t\t\t\t.createUpdater(key);\n\t\t\tupdater.setByteArray(columnName, data);\n\t\t\ttemplate.update(updater);\n\n\t\t\treturn true;\n\t\t} catch (HectorException e) {\n\t\t\treturn false;\n\t\t}\n\t}", "protected void addEdge(CyEdge edge) {\n\tLayoutEdge newEdge = new LayoutEdge(edge);\n\tupdateWeights(newEdge);\n\tedgeList.add(newEdge);\n }", "public void addEdge(Edge e){\n edgeList.add(e);\n }", "public void interestCacheInsert(InterestCacheEntry e)\n\t{\n\t\tif ( interestCache_purgeTimer == null ){\n\t\t\tinterestCache_purgeTimer = new DiffTimer(DiffTimer.TIMEOUT_INTEREST_CACHE_PURGE, null) ;\n\t\t\tif ( interestCache_purgeTimer != null ){\n\t\t\t\tinterestCache_purgeTimer.handle = setTimeout(interestCache_purgeTimer, INTEREST_CACHE_PURGE_INTERVAL) ;\n\t\t\t}\n\t\t}\n\t\tinterestCache.put(e.getInterest().getTaskId(),e) ;\n\t}", "@Override\n public void addEdge(E pEdge, TimeFrame tf) {\n \n // If The Edge ID is not initialized yet, initalialize it\n if (pEdge.getId() < 0) {\n int id = edgeIdGen.getNextAvailableID();\n pEdge.setId(id);\n mapAllEdges.add(id, pEdge);\n //System.out.println(\"\\t\\t\\t\\t\\t\\t====***************** DynamicGraph.addEdge() edge (id, mapAllEdges.size) = \" + id + \", \" + mapAllEdges.size());\n }\n // Adding to the adjacent list\n if (!darrGlobalAdjList.get(pEdge.getSource().getId()).get(tf).contains(pEdge)) {\n darrGlobalAdjList.get(pEdge.getSource().getId()).get(tf).add(pEdge);\n //System.out.println(\"\\t\\t\\t\\t\\t\\t====***************** DynamicGraph.addEdge() ading to darrGlobalAdjList \");\n if(!pEdge.isDirected() &&\n !darrGlobalAdjList.get(pEdge.getDestination().getId()).get(tf).contains(pEdge)) {\n darrGlobalAdjList.get(pEdge.getDestination().getId()).get(tf).add(pEdge);\n }\n }\n \n hmpGraphsAtTimeframes.get(tf).addEdge(pEdge);\n \n }", "@Override\r\n protected void processUpdate(final ICacheElement<K, V> ce)\r\n {\r\n if (!isAlive())\r\n {\r\n log.error(\"{0}: No longer alive; aborting put of key = {1}\",\r\n () -> logCacheName, ce::getKey);\r\n return;\r\n }\r\n\r\n log.debug(\"{0}: Storing element on disk, key: {1}\",\r\n () -> logCacheName, ce::getKey);\r\n\r\n // old element with same key\r\n IndexedDiskElementDescriptor old = null;\r\n\r\n try\r\n {\r\n IndexedDiskElementDescriptor ded = null;\r\n final byte[] data = getElementSerializer().serialize(ce);\r\n\r\n // make sure this only locks for one particular cache region\r\n storageLock.writeLock().lock();\r\n try\r\n {\r\n old = keyHash.get(ce.getKey());\r\n\r\n // Item with the same key already exists in file.\r\n // Try to reuse the location if possible.\r\n if (old != null && data.length <= old.len)\r\n {\r\n // Reuse the old ded. The defrag relies on ded updates by reference, not\r\n // replacement.\r\n ded = old;\r\n ded.len = data.length;\r\n }\r\n else\r\n {\r\n // we need this to compare in the recycle bin\r\n ded = new IndexedDiskElementDescriptor(dataFile.length(), data.length);\r\n\r\n if (doRecycle)\r\n {\r\n final IndexedDiskElementDescriptor rep = recycle.ceiling(ded);\r\n if (rep != null)\r\n {\r\n // remove element from recycle bin\r\n recycle.remove(rep);\r\n ded = rep;\r\n ded.len = data.length;\r\n recycleCnt++;\r\n this.adjustBytesFree(ded, false);\r\n log.debug(\"{0}: using recycled ded {1} rep.len = {2} ded.len = {3}\",\r\n logCacheName, ded.pos, rep.len, ded.len);\r\n }\r\n }\r\n\r\n // Put it in the map\r\n keyHash.put(ce.getKey(), ded);\r\n\r\n if (queueInput)\r\n {\r\n queuedPutList.add(ded);\r\n log.debug(\"{0}: added to queued put list. {1}\",\r\n () -> logCacheName, queuedPutList::size);\r\n }\r\n\r\n // add the old slot to the recycle bin\r\n if (old != null)\r\n {\r\n addToRecycleBin(old);\r\n }\r\n }\r\n\r\n dataFile.write(ded, data);\r\n }\r\n finally\r\n {\r\n storageLock.writeLock().unlock();\r\n }\r\n\r\n log.debug(\"{0}: Put to file: {1}, key: {2}, position: {3}, size: {4}\",\r\n logCacheName, fileName, ce.getKey(), ded.pos, ded.len);\r\n }\r\n catch (final IOException e)\r\n {\r\n log.error(\"{0}: Failure updating element, key: {1} old: {2}\",\r\n logCacheName, ce.getKey(), old, e);\r\n }\r\n }", "private void addEdge(int from, int to, Edge e) {\n _edges.get(from).set(to, e);\n _edgeMap.put(e, new int [] {from, to});\n }", "void addEdge(JNode edge) {\n List<JNode> newEdges = this.getEdges();\n newEdges.add(edge);\n this.setEdges(newEdges);\n }", "public void addEdge(Edge e){\n\t\tadjacentEdges.add(e);\n\t}", "@Override\n\tpublic void addEdge(Location src, Location dest, Path edge) {\n\t\tint i = locations.indexOf(src);\n\t\tpaths.get(locations.indexOf(src)).add(edge);\n\t}", "public boolean addEdge(Edge edge) {\r\n\t\treturn true;\r\n\t}", "void addEdge(int source, int destination, int weight);", "public void addEdge(DirectedEdge edge){\r\n\t\tmEdgeList.offer(edge);\r\n\t\t\r\n\t\tint src=edge.from();\r\n\t\tint dest = edge.to();\r\n\t\t\r\n\t\tmVisitStatus.put(src,false);\r\n\t\tmVisitStatus.put(dest,false);\r\n\t\t\r\n\t\tmVertexList.add(src);\r\n\t\tmVertexList.add(dest);\r\n\t\t\r\n\t\t/* Forward Edge */\r\n\t\tList<DirectedEdge> edgeList = adjList.get(src);\r\n\t\tif(edgeList==null)\r\n\t\t\tedgeList = new ArrayList<DirectedEdge>();\r\n\t\t\r\n\t\tedgeList.add(edge);\r\n\t\tadjList.put(src, edgeList);\r\n\t}", "public void insertTripleDistributedByObject(Triple triple) {\n\r\n }", "public void addEdge(String node1, String node2) {\n\r\n LinkedHashSet<String> adjacent = map.get(node1);\r\n// checking to see if adjacent node exist or otherwise is null \r\n if (adjacent == null) {\r\n adjacent = new LinkedHashSet<String>();\r\n map.put(node1, adjacent);\r\n }\r\n adjacent.add(node2); // if exist we add the instance node to adjacency list\r\n }", "public void addEdge(edge_type edge) {\n //first make sure the from and to nodes exist within the graph\n assert (edge.getFrom() < nextNodeIndex) && (edge.getTo() < nextNodeIndex) :\n \"<SparseGraph::AddEdge>: invalid node index\";\n\n //make sure both nodes are active before adding the edge\n if ((nodeVector.get(edge.getTo()).getIndex() != invalid_node_index)\n && (nodeVector.get(edge.getFrom()).getIndex() != invalid_node_index)) {\n //add the edge, first making sure it is unique\n if (isEdgeNew(edge.getFrom(), edge.getTo())) {\n edgeListVector.get(edge.getFrom()).add(edge);\n }\n\n //if the graph is undirected we must add another connection in the opposite\n //direction\n if (!isDirectedGraph) {\n //check to make sure the edge is unique before adding\n if (isEdgeNew(edge.getTo(), edge.getFrom())) {\n GraphEdge reversedEdge = new GraphEdge(edge.getTo(),edge.getFrom(),edge.getCost());\n edgeListVector.get(edge.getTo()).add(reversedEdge);\n }\n }\n }\n }", "void enqueue(E newEntry);", "public void addEdge(Edge edgeToAdd){\n for(int i = 0; i<edges.size(); i++){\n Edge edge = edges.get(i);\n if(edge.end() == edgeToAdd.end()){\n edge.setWeight(edgeToAdd.weight()); // Change weight and return if edge is present\n return;\n }\n }\n this.edges.add(edgeToAdd); // Add edge normally\n }", "protected void heapStore(Node base, Set src, jq_Field f) {\n base.addEdges(f, NodeSet.FACTORY.makeSet(src));\n }", "public void addEdge(Edge e)\r\n\t{\n\t\tint v = e.either(), w = e.other(v);\r\n\t\tadj[v].add(e);\r\n\t\tadj[w].add(e);\r\n\t}", "void addEdge(Edge e) {\n edges.add(e);\n addVerticle(e.v1);\n addVerticle(e.v2);\n }", "public static Multigraph smartAddEdge(Multigraph graph, Edge edge, boolean stopIfMissing) {\n\n if (!graph.containsVertex(edge.getSource())) {\n if(stopIfMissing){\n throw new IllegalStateException(\"Missing source node for edge \"+ edge);\n }\n graph.addVertex(edge.getSource());\n }\n if (!graph.containsVertex(edge.getDestination())) {\n if(stopIfMissing){\n throw new IllegalStateException(\"Missing destination node for edge \"+ edge);\n }\n graph.addVertex(edge.getDestination());\n }\n //That a good mapping edge, add to the related query\n graph.addEdge(edge.getSource(), edge.getDestination(), edge.getLabel());\n return graph;\n }", "@Override\n public void appendEdge(Integer first, Integer second) {\n if (col.containsKey(first) && col.containsKey(second)) {\n col.get(first).add(second);\n col.get(second).add(first); \n }\n }", "protected void heapStore(Node base, Node src, jq_Field f) {\n base.addEdge(f, src);\n }", "public void addEdge(Edge e) {\n int v = e.either();\n int w = e.other(v);\n adj[v].add(e);\n adj[w].add(e);\n E++;\n }", "public Edge addEdge(Id nodeAIn, Id nodeBIn){//adds an edge to the list\n\t\tint i;\n\t\tEdge e = null;\n\t\tfor(i = 0; i < listOfEdges.size(); i++){\n\t\t\te = listOfEdges.get(i);\n\t\t\tif(e==null) continue;\n\t\t\tif((nodeAIn.compare(e.getNodeA()) && nodeBIn.compare(e.getNodeB())) || (nodeBIn.compare(e.getNodeA()) && nodeAIn.compare(e.getNodeB()))) break;\n\t\t}\n\t\tif(i < listOfEdges.size()){ // found duplicate\n\t\t\t//System.out.println(\"found dupe\");\n\t\t\treturn e;\n\t\t}\n\t\tNode A = returnNodeById(nodeAIn);\n\t\tNode B = returnNodeById(nodeBIn);\n\t\tif(A == null || B == null) return null;\n\t\tedge_count++;\n\t\tfor(; edge_arrayfirstopen < edge_arraysize && listOfEdges.get(edge_arrayfirstopen) != null; edge_arrayfirstopen++);\n\t\tif(edge_arrayfirstopen >= edge_arraysize){\t//resize\n\t\t\tedge_arraysize = edge_arrayfirstopen+1;\n\t\t\tlistOfEdges.ensureCapacity(edge_arraysize);\n\t\t\tlistOfEdges.setSize(edge_arraysize);\n\t\t}\n\t\tId eid = new Id(edge_arrayfirstopen, edge_count);\n\t\te = new Edge(nodeAIn, nodeBIn, eid);\n\t\tlistOfEdges.set(edge_arrayfirstopen, e);\n\t\t\n\t\tif(edge_arraylasttaken < edge_arrayfirstopen) edge_arraylasttaken = edge_arrayfirstopen; //todo redo\n\n\t\tA.addEdgeId(eid);\n\t\tB.addEdgeId(eid);\n\t\te.updateLength(this);\n\t\treturn e;\n\t}", "public void addEdge(Edge edge) {\n\t\tthis.edges.add(edge);\n\t\tnrOfEdges++;\n\t}", "@Override\r\n\tpublic boolean insertVertex(E e) {\r\n\t\tif(!containsVertex(e)) {\r\n\t\t\tvertices.put(e, new Vertex<E>(e));\r\n\t\t\tadjacencyLists.put(e, new ArrayList<>());\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "void addEdges(Collection<ExpLineageEdge> edges);", "protected boolean addEdge(Edge<N, E> edge)\n throws GraphLogicException {\n return edge.attach();\n }", "void setBestIncoming(E edge);", "public void addEdge(){\n Node[] newAdjacent = new Node[adjacent.length + 1];\n for (int i = 0; i < adjacent.length; i++) {\n newAdjacent[i] = adjacent[i];\n }\n adjacent = newAdjacent;\n }", "@Override\n public boolean addEdge(E vertex1, E vertex2) {\n if (vertex1 != null\n && vertex2 != null\n && vertex1 != vertex2\n && dictionary.containsKey(vertex1)\n && dictionary.containsKey(vertex2)) {\n dictionary.get(vertex1).add(vertex2);\n dictionary.get(vertex2).add(vertex1);\n return true;\n } else {\n return false;\n }\n }", "public IEdge addEdge(String from, String to, Double cost);", "public void addEdge(StubEdge e) {\n }", "public void add(E e){\n int target = e.hashCode() % this.buckets;\n if(!data[target].contains(e)){\n data[target].add(e);\n }\n }", "protected void addEdge(CyEdge edge, LayoutNode v1, LayoutNode v2) {\n\tLayoutEdge newEdge = new LayoutEdge(edge, v1, v2);\n\tupdateWeights(newEdge);\n\tedgeList.add(newEdge);\n }", "protected Edge<T> addEdge(final T object, final LineString line,\n final Point from, final Point to) {\n if (this.inMemory && getEdgeCount() >= this.maxEdgesInMemory) {\n this.edgeAttributesById = BPlusTreeMap.createIntSeralizableTempDisk(this.edgeAttributesById);\n // TODO edgIds\n // TODO edgeIndex\n this.edgeLinesById = BPlusTreeMap.createIntSeralizableTempDisk(this.edgeLinesById);\n this.edgeObjectsById = BPlusTreeMap.createIntSeralizableTempDisk(this.edgeObjectsById);\n this.edgesById = BPlusTreeMap.createIntSeralizableTempDisk(this.edgesById);\n\n // TODO nodeIndex\n this.nodeAttributesById = BPlusTreeMap.createIntSeralizableTempDisk(this.nodeAttributesById);\n this.nodesById = BPlusTreeMap.createIntSeralizableTempDisk(this.nodesById);\n this.nodesIdsByCoordinates = BPlusTreeMap.createTempDisk(\n this.nodesIdsByCoordinates, new SerializablePageValueManager<Point>(),\n PageValueManager.INT);\n this.inMemory = false;\n }\n final Node<T> fromNode = getNode(from);\n final Node<T> toNode = getNode(to);\n final int edgeId = ++this.nextEdgeId;\n final Edge<T> edge = new Edge<T>(edgeId, this, fromNode, toNode);\n if (this.edgeLinesById != null) {\n this.edgeLinesById.put(edgeId, line);\n }\n this.edgeObjectsById.put(edgeId, object);\n this.edgesById.put(edgeId, edge);\n this.edgeIds.put(edge, edgeId);\n if (this.edgeIndex != null) {\n this.edgeIndex.add(edge);\n }\n this.edgeListeners.edgeEvent(edge, null, EdgeEvent.EDGE_ADDED, null);\n return edge;\n }", "public void addEdgeType(EdgeType et)\r\n {\r\n\tfinal String edgeTypeName = et.getName();\r\n\tif (ethMap.containsKey(edgeTypeName))\r\n\t throw new RuntimeException(\"Duplicate EdgeType <\" + edgeTypeName + \"> added!\");\r\n\tif (!ntMap.containsKey(et.getSourceType()))\r\n\t throw new RuntimeException(\"Invalid EdgeType source <\" +et.getSourceType());\r\n\tif (!ntMap.containsKey(et.getDestType()))\r\n\t throw new RuntimeException(\"Invalid EdgeType destination <\" +et.getDestType());\r\n\tethMap.put(edgeTypeName, new EdgeTypeHolder(et));\r\n }", "void addEdge(String origin, String destination, double weight){\n\t\tadjlist.get(origin).addEdge(adjlist.get(destination), weight);\n\t\tedges++;\n\t}", "@Override\r\n public void insertTripleDistributedBySubject(Triple triple) {\n\r\n }", "public void add(DefaultEdge edge) {\n edges.add(edge);\n groupObject.add(edge);\n }", "public void addEdge(DrawView edge){\n drawnEdges.add(edge);\n }", "public void addedge(String fro, String to, int wt) {\r\n Edge e = new Edge(fro, to, wt);\r\n\r\n\r\n Set<String> keys = graph.keySet();\r\n// Object[] arr = keys.toArray();\r\n int f = 0;\r\n if(graph.containsKey(fro)&&graph.containsKey(to))\r\n {\r\n\r\n int[] bb2 = new int[2000];\r\n for(int zz=0;zz<5000;zz++){\r\n\r\n\r\n ArrayList<Integer> abcd = new ArrayList<>();\r\n abcd.add(zz);\r\n\r\n if(zz<2500)\r\n zz++;\r\n else\r\n zz++;\r\n\r\n bb2[zz%500]=zz;\r\n\r\n\r\n int qq= 5000;\r\n\r\n qq--;\r\n\r\n String nnn = \"aaa aa\";\r\n nnn+=\"df\";\r\n\r\n\r\n }\r\n\r\n }\r\n else\r\n {\r\n\r\n\r\n System.out.println(\"some vertices are not present\");\r\n return;\r\n }\r\n for ( String y : keys) {\r\n if (fro.compareTo(y) == 0) {\r\n f = 1;\r\n ArrayList<Edge> ee =graph.get(y);\r\n\r\n\r\n ee.add(e);\r\n }\r\n\r\n\r\n }\r\n if (f == 0) {}\r\n }", "public interface GraphStorage {\r\n\r\n /**\r\n * All nodes in the graph. It can be used to iterate all at once,\r\n * too costly something like depth-first search or breadth first search.\r\n * Graph representations normally do not provide this functionality\r\n * directly, here this can be a beneficial feature because of storage\r\n * abstraction.\r\n *\r\n * @return List of {@link org.test.gserver.GraphNode}\r\n */\r\n List<GraphNode> nodes();\r\n\r\n /**\r\n * Only nodes with no incoming edges. It can be traversed\r\n * all graph through neighbors.\r\n *\r\n * @return List of {@link org.test.gserver.GraphNode}\r\n */\r\n List<GraphNode> roots();\r\n\r\n /**\r\n * Removes a node from storage.\r\n * Implementer must delete all incoming edges to this node too.\r\n */\r\n void removeNode(NodeKey key);\r\n\r\n /**\r\n * Creates a node for given id and type in storage.\r\n */\r\n void createNode(NodeKey key);\r\n\r\n /**\r\n * As default adds neighbors directed from given source to given\r\n * target.\r\n *\r\n * @param target target graph node\r\n */\r\n void addNeighbor(NodeKey key, GraphNode target, Map<String, String> attr);\r\n\r\n /**\r\n * Return list of outgoing nodes from given source node.\r\n *\r\n * @return\r\n */\r\n List<GraphEdge> getNeighbors(NodeKey key);\r\n\r\n /**\r\n * Adds attributes to given node.\r\n *\r\n * @param attr attribute list as key-value pairs {@link java.util.Map}\r\n */\r\n void putAttr(NodeKey key, Map<String, String> attr);\r\n\r\n /**\r\n * Returns attributes of given node.\r\n *\r\n * @return list of key-value pairs\r\n */\r\n Map<String, String> getAttr(NodeKey key);\r\n\r\n int nodesSize();\r\n\r\n boolean atomicLock(String owner, NodeKey key, long maxLockTime);\r\n\r\n void releaseLock(String owner, NodeKey key);\r\n\r\n List<GraphEdge> edges();\r\n\r\n List<GraphEdge> getEdges(NodeKey source, NodeKey target);\r\n\r\n void markCheckPoint();\r\n\r\n void undo();\r\n\r\n void redo();\r\n\r\n boolean nodeExist(NodeKey key);\r\n}", "@Test\r\n void test_insert_same_edge_twice() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"B\");\r\n if (graph.size() != 1) {\r\n fail();\r\n }\r\n if (!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")) {\r\n fail();\r\n }\r\n\r\n }", "public void addEdge(int v1, int v2, Object edgeInfo) {\n//your code here\n Edge edge = new Edge(v1, v2, edgeInfo);\n if(adjLists[v1].contains(edge)){\n return;\n }\n adjLists[v1].addLast(edge);\n }", "public void addEdge(DirectedEdge e) \n {\n int v = e.from();\n adj[v].add(e);\n E++;\n }", "public void addEdge( Edge edge ) {\r\n if ( edge == null ) return;\r\n edges.addElement(edge);\r\n }", "void upsert(@NotNull final ByteBuffer key, @NotNull final ByteBuffer value) {\n final ClusterValue prev = storage.put(key, ClusterValue.of(value));\n if (prev == null) {\n tableSize = tableSize + key.remaining() + value.remaining();\n } else if (prev.isTombstone()) {\n tableSize = tableSize + value.remaining();\n } else {\n tableSize = tableSize + value.remaining() - prev.getData().remaining();\n }\n }", "public void insertEdges(Edge[] E){\n\t\tthis.edges = E;\n\t\tthis.nodesLength = nodesLength(E);\n\t\tthis.nodes = new Node[(int)this.nodesLength];\n\t\tfor (long n = 0; n < this.nodesLength; n++) {\n\t\t\tthis.nodes[(int)n] = new Node(n);\n\t\t}\n\t\tthis.edgesLength = E.length;\n\t\t\n\t\t\n\t\tfor (long edgeToAdd = 0; edgeToAdd < this.edgesLength; edgeToAdd++) {\n\t\t\tthis.nodes[(int)E[(int)edgeToAdd].getFrom()].getEdges().add(E[(int)edgeToAdd]);\n\t\t\tthis.nodes[(int)E[(int)edgeToAdd].getTo()].getEdges().add(E[(int)edgeToAdd]);\n\t\t}\n\t\t\n\t}", "public void addEdge(FlowEdge e){\n int v = e.getFrom();\n int w = e.getTo();\n adj[v].add(e); //add forward edge\n adj[w].add(e); //add backward edge\n }", "void addEdge(int x, int y);", "private void addEdge() {\n childMatrix[randomParent][childMatrix[randomParent][0]] = randomChild;\n childMatrix[randomParent][0]++;\n parentMatrix[randomChild][parentMatrix[randomChild][0]] = randomParent;\n parentMatrix[randomChild][0]++;\n }", "public void addSize(double edgeSize)\r\n\t{\r\n\t\tsize= size + edgeSize;\r\n\t}", "private Edge addEdge(Node source, Node dest, double weight)\r\n\t{\r\n\t final Edge newEdge = new Edge(edgeType, source, dest, weight);\r\n\t if (!eSet.add(newEdge))\r\n\t\tthrow new RuntimeException(\"Edge already exists!\");\r\n\t source.addEdge(newEdge);\n\t return newEdge;\r\n\t}", "public void addEdge(Edge e) {\r\n int v = e.from();\r\n int w = e.to();\r\n validateVertex(v);\r\n validateVertex(w);\r\n adj[v].add(e);\r\n indegree[w]++;\r\n E++;\r\n }", "public void addEdge( EdgeIntf edge ) throws Exception {\r\n DirectedEdge dEdge = ( DirectedEdge ) edge;\r\n Vertex fromVertex = dEdge.getSource();\r\n Vertex toVertex = dEdge.getSink();\r\n\r\n if( !isPath( toVertex, fromVertex ))\r\n super.addEdge( dEdge );\r\n else\r\n throw new CycleException();\r\n }", "public Position insertEdge(Position vp,Position wp, Object o) throws InvalidPositionException;", "@Test\r\n void add_remove_add() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\",\"D\");\r\n graph.addEdge(\"C\",\"D\");\r\n graph.addEdge(\"D\", \"E\"); \r\n // Check that E is in graph with correct edges\r\n List<String> adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n vertices = graph.getAllVertices(); \r\n if(!vertices.contains(\"E\") | !adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n //Remove E\r\n graph.removeVertex(\"E\");\r\n if(vertices.contains(\"E\") | adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n \r\n //Add E back into graph with different edge\r\n graph.addEdge(\"B\", \"E\");\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if(!vertices.contains(\"E\") | !adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n }", "private void addEdge(int from, int to, int cost) {\r\n\t\tif (edges[from] == null)\r\n\t\t\tedges[from] = new HashMap<Integer, Integer>(INITIAL_MAP_SIZE);\r\n\t\tif (edges[from].put(to, cost) == null)\r\n\t\t\tnumEdges++;\r\n\t}", "public void addEdge(int start, int end, double weight);", "public abstract void map(Edge queryEdge, Edge graphEdge);", "private void replaceCache(Entry<V> e) {\n if (sizeT1 + sizeT2 < sizeCache) {\n return;\n }\n\n if (sizeT1 > 0 && (sizeT1 > p || (sizeT1 == p && e.posType == Entry.IN_B2))) {\n Entry<V> m = mid1;\n m.value = null;\n mid1 = mid1.prev;\n\n sizeAdjust(m.posType, Entry.IN_B1);\n m.posType = Entry.IN_B1;\n } else {\n Entry<V> m = mid2;\n m.value = null;\n mid2.value = null;\n mid2 = mid2.prev;\n\n sizeAdjust(m.posType, Entry.IN_B2);\n m.posType = Entry.IN_B2;\n }\n }", "public void addEdge(DocTokenInf newEdge) {\n\t\tlist[newEdge.end].put(newEdge);\n\t}", "@Override\n public <T> void storeInItemCache(String key, CacheElement<T> cacheElement) {\n\n if (!isEnabled()) {\n return;\n }\n\n if (!cacheExists()) {\n LOG.error(\"Cache configuration is invalid! NOT Caching. Check EH Cache configuration.\");\n return;\n }\n\n // detect undeclared nulls, complain, and set to null\n if (!cacheElement.isNull() && cacheElement.getPayload() == null) {\n Exception exToLogToHaveStacktraceWhoCausedIt = new Exception();\n LOG.error(\"Detected undeclared null payload on element with key \" + key + \" at insert time!\",\n exToLogToHaveStacktraceWhoCausedIt);\n cacheElement.setNull(true);\n }\n cacheElement.setExpired(false);\n storeElement(key, cacheElement);\n }", "@Override\r\n\tpublic void link(E src, E dst, int weight) {\r\n\t\tinsertVertex(src); //Inserts src if not currently in the graph\r\n\t\tinsertVertex(dst); //Inserts dst if not currently in the graph\r\n\t\tEdge<E> newedge1 = new Edge<>(src, dst, weight);\r\n\r\n\t\tArrayList<Edge<E>> sEdges = adjacencyLists.get(src);\r\n\t\tsEdges.remove(newedge1); //if the edge already exists remove it\r\n\t\tsEdges.add(newedge1);\r\n\t\tif(!isDirected) { //Add the additional edge if this graph is undirected\r\n\t\t\tEdge<E> newedge2 = new Edge<>(dst, src, weight);\r\n\r\n\t\t\tArrayList<Edge<E>> dEdges = adjacencyLists.get(dst);\r\n\t\t\tdEdges.remove(newedge2); //if the edge already exists remove it\r\n\t\t\tdEdges.add(newedge2); \r\n\t\t}\r\n\t}", "StoreResponse add(CACHE_ELEMENT e);", "@Override\r\n\tpublic void add(CourseDBElement element) {\r\n\t\tint key = element.hashCode()%getTableSize();\r\n\t\t\r\n\t\tif(hashTable[key] == null) {\r\n\t\t\tLinkedList<CourseDBElement> newList = new LinkedList<CourseDBElement>();\r\n\t\t\tnewList.add(element);\r\n\t\t\thashTable[key] = newList;\r\n\t\t}\r\n\t\telse hashTable[key].add(element);\r\n\t}", "protected void saveForwardEdge(Long eID, long vj, long vi) {\n\t\tInteger restCap_vi = getMarkedTuple(vi).getRestCap();\n\t\tint restCap = Math.min(c(eID) - f(eID), restCap_vi);\n\t\tmarkVertice(vj, new Tuple4(\"+\", vi, restCap, false));\n\t}", "@Override\n\tpublic void edge() {\n\t\tsuper.edge();\n\t\t\n\t\tIterator<Instruction> iterator = instructions_n.iterator();\n\t\twhile (iterator.hasNext()) {\n\t\t\tInstruction instruction = iterator.next();\n\t\t\tinstructionRegister.add(instruction);\n\t\t}\n\t\t\n\t\tinstructions_n.clear();\n\t}", "public Id addEdgeRint(Id nodeAIn, Id nodeBIn){//adds an edge to the list, returns ID instead of edge\n\n\t\tint i;\n\t\tEdge e = null;\n\t\tfor(i = 0; i < listOfEdges.size(); i++){\n\t\t\te = listOfEdges.get(i);\n\t\t\tif(e==null) continue;\n\t\t\tif((nodeAIn.compare(e.getNodeA()) && nodeBIn.compare(e.getNodeB())) || (nodeBIn.compare(e.getNodeA()) && nodeAIn.compare(e.getNodeB())))break;\n\t\t}\n\t\tif(i < listOfEdges.size()){ // found duplicate\n\t\t\t//System.out.println(\"found dupe\");\n\t\t\treturn e.getId();\n\t\t}\n\n\t\tNode A = returnNodeById(nodeAIn);\n\t\tNode B = returnNodeById(nodeBIn);\n\t\tif(A == null || B == null) return null;\n\t\tedge_count++;\n\t\tfor(; edge_arrayfirstopen < edge_arraysize && listOfEdges.get(edge_arrayfirstopen) != null; edge_arrayfirstopen++);\n\t\tif(edge_arrayfirstopen >= edge_arraysize){\t//resize\n\t\t\tedge_arraysize = edge_arrayfirstopen +1;\n\t\t\tlistOfEdges.ensureCapacity(edge_arraysize);\n\t\t\tlistOfEdges.setSize(edge_arraysize);\n\t\t}\n\t\tId eid = new Id(edge_arrayfirstopen, edge_count);\n\t\te = new Edge(nodeAIn, nodeBIn, eid);\n\t\tlistOfEdges.set(edge_arrayfirstopen, e);\n\t\t\n\t\tif(edge_arraylasttaken < edge_arrayfirstopen) edge_arraylasttaken = edge_arrayfirstopen; //todo redo\n\n\t\tA.addEdgeId(eid);\n\t\tB.addEdgeId(eid);\n\t\te.updateLength(this);\n\t\treturn eid;\n\t}", "@Test\n public void testAddExistingEdge() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n graph = graph.addEdge(new Vertex<>(1L, 1L), new Vertex<>(2L, 2L), 12L);\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult =\n \"1,2,12\\n\"\n + \"1,2,12\\n\"\n + \"1,3,13\\n\"\n + \"2,3,23\\n\"\n + \"3,4,34\\n\"\n + \"3,5,35\\n\"\n + \"4,5,45\\n\"\n + \"5,1,51\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "public void add(T e) {\n Entry<T> newNode = new Entry<T>(e, null, null);\n newNode.next = cursor.next;\n newNode.prev = ((Entry<T>) cursor);\n if(cursor != tail) {\n ((Entry<T>) cursor.next).prev = newNode;\n }\n else {\n tail = newNode;\n }\n cursor.next = newNode;\n prev = cursor;\n cursor = cursor.next;\n size++;\n ready = false;\n }", "@Override\n protected void encounterVertex(V vertex, E edge) {\n // calculate hops\n calculateHops(vertex, edge);\n\n // call parent iterator\n super.encounterVertex(vertex, edge);\n }", "private void put(PrimitiveEntry entry) {\n int hashIndex = findHashIndex(entry.getKey());\n entries[hashIndex] = entry;\n }", "void insert(){\n \tFIR fir = new FIR();\r\n \tfir_id++;\r\n \tfir = fir.accept(fir_id);\r\n \thashaddress = hash(fir.category);\r\n \tFIR ptr;\r\n\t if(hashtable[hashaddress]==null){\r\n\t hashtable[hashaddress]=fir;\r\n\t }\r\n\t else{\r\n\t ptr=hashtable[hashaddress];\r\n\t while(ptr.next!=null){\r\n\t ptr=ptr.next;\r\n\t }\r\n\t ptr.next=fir;\r\n\t }\r\n\t //Time Complexity: O(n)\r\n }", "public void storeInCache() {\r\n lockValueStored = IN_CACHE;\r\n }", "public void edgeMake(int vertex1, int vertex2) {\n addVertex(vertex1); // both vertices added to the set\n addVertex(vertex2);\n adjacencyMap.get(vertex1).add(vertex2); // both vertices receive the edge\n adjacencyMap.get(vertex2).add(vertex1);\n }", "@Override\n public <T> void storeInItemCache(String key, CacheElement<T> cacheElement, int dependingPublicationId, int\n dependingItemId) {\n\n if (!isEnabled()) {\n return;\n }\n\n CacheDependency dependency = new CacheDependencyImpl(dependingPublicationId, dependingItemId);\n List<CacheDependency> dependencies = new ArrayList<>();\n dependencies.add(dependency);\n storeInItemCache(key, cacheElement, dependencies);\n\n }", "public void addEdge(int start, int end);", "void insert(int ele){\n if(heapLen>=A.length)\n {\n System.out.println(\"Heap is full\");\n }\n else\n {\n A[heapLen] = 1<< 31;\n heapLen++;\n increaseKey(heapLen, ele);\n \n \n }\n }", "@Override\n\tpublic boolean insertOneEdge(NodeRelation nodeRelation) {\n\t\treturn false;\n\t}" ]
[ "0.61952525", "0.61597", "0.6108583", "0.6086996", "0.60521114", "0.5959758", "0.5837672", "0.5733984", "0.5677607", "0.5661254", "0.5612266", "0.5609292", "0.5587255", "0.5586042", "0.5562577", "0.5555409", "0.55524", "0.55449253", "0.5522204", "0.55167454", "0.5499263", "0.5494808", "0.5409952", "0.5340276", "0.53350866", "0.5322379", "0.53018135", "0.5290412", "0.52647585", "0.52585816", "0.52357864", "0.52339286", "0.5233631", "0.522782", "0.5220843", "0.5218697", "0.5216955", "0.52055544", "0.51960516", "0.51886946", "0.51804906", "0.51594603", "0.5132191", "0.51271", "0.5107645", "0.5103707", "0.5077415", "0.5067018", "0.50662804", "0.5059035", "0.50537956", "0.5047909", "0.50147057", "0.4997994", "0.49964854", "0.4967062", "0.49658096", "0.4962311", "0.49493614", "0.49466327", "0.49434206", "0.49325332", "0.4930956", "0.4925263", "0.49185222", "0.49096453", "0.49089244", "0.49078584", "0.4903195", "0.49006557", "0.48891726", "0.48856762", "0.4878717", "0.4855714", "0.48467866", "0.48448598", "0.48415726", "0.48306853", "0.48236665", "0.4820056", "0.4809639", "0.4802357", "0.4789536", "0.47871855", "0.4782338", "0.47728634", "0.4770935", "0.4762552", "0.47608516", "0.47592324", "0.47571158", "0.4751536", "0.47431704", "0.4738444", "0.47364396", "0.4729893", "0.47263506", "0.4717496", "0.4709038", "0.47075236" ]
0.6426393
0
This function inserts the given vertex into the underlying storage(s) and updates the cache(s) accordingly.
public abstract boolean putVertex(Vertex incomingVertex);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addVertex(Vertex vertex){\n \n synchronized(vertexes){\n \n vertexes.put(vertex.getID(),vertex);\n }\n }", "@Override\n public E addVertex(E vertex) {\n if (vertex == null || dictionary.containsKey(vertex)) {\n return null;\n } else {\n dictionary.put(vertex, new ArrayList<>());\n return vertex;\n }\n }", "void add(Vertex vertex);", "@Override\r\n public void add(V vertexName) {\r\n if(!contains(vertexName))\r\n map.put(vertexName, new Vertex(vertexName));\r\n }", "public boolean addVertex(V vertex);", "public boolean addVertex(V vertex);", "public void addVertex (E vertex)\n {\n if (!this.containsVertex (vertex))\n {\n // Enlargen the graph if needed\n if (lastIndex == vertices.length - 1)\n this.enlarge ();\n\n lastIndex = lastIndex + 1;\n vertices[lastIndex] = vertex;\n }\n }", "void addVertex(Vertex v);", "public void addVertex( VKeyT key, VDataT data );", "private void addVertex(Vertex vertex) {\n if (!this.verticesAndTheirEdges.containsKey(vertex)) {\n this.verticesAndTheirEdges.put(vertex, new LinkedList<>());\n } else {\n System.out.println(\"Vertex already exists in map.\");\n }\n }", "private void maybeInsertVertex(VerifiedVertex verifiedVertex) {\n\t\ttry {\n\t\t\tthis.vertexStore.insertVertex(verifiedVertex);\n\t\t} catch (MissingParentException e) {\n\t\t\tlog.debug(\"Could not insert timeout vertex: {}\", e.getMessage());\n\t\t}\n\t}", "@Override\n public void addVertex(V vertex)\n {\n if (vertex.equals(null)){\n throw new IllegalArgumentException();\n }\n ArrayList <V> edges = new ArrayList<>();\n\t graph.put(vertex, edges);\n\n }", "public native VertexList append(VertexNode vertex);", "public void insert(T vertex, Point2D pos);", "@Override\r\n\tpublic boolean insertVertex(E e) {\r\n\t\tif(!containsVertex(e)) {\r\n\t\t\tvertices.put(e, new Vertex<E>(e));\r\n\t\t\tadjacencyLists.put(e, new ArrayList<>());\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public Position insertVertex(Object o);", "public void addVertex (T vertex){\n if (vertexIndex(vertex) > 0) return; // vertex already in graph, return.\n if (n == vertices.length){ // need to expand capacity of arrays\n expandCapacity();\n }\n \n vertices[n] = vertex;\n for (int i = 0; i < n; i++){ // populating new edges with -1\n edges[n][i] = -1;\n edges[i][n] = -1;\n }\n n++;\n }", "public void addVertex(int vertex) {\n if (!adjacencyMap.containsKey(vertex)) {\n adjacencyMap.put(vertex, new HashSet<>());\n }\n }", "public V addVertex(V v);", "void add(int vertex);", "public void add (V vertex) {\n if (dag.containsKey(vertex)) return;\n dag.put(vertex, new ArrayList<V>());\n }", "@Override\r\n public void addVertex(Vertex v) {\r\n adjacencyList.put(v, new ArrayList<>()); //putting v into key, a new LinkedList into value for later use\r\n }", "public boolean addVertex(T vert);", "@Override\n public void addVertex(V pVertex, TimeFrame tf) {\n if (pVertex.getId() < 0) {\n int id = vertexIdGen.getNextAvailableID();\n //System.out.println(\" :: vertex new id = \" + id);\n pVertex.setId(id);\n mapAllVertices.add(id, pVertex);\n if (darrGlobalAdjList.get(id) == null) {\n darrGlobalAdjList.add(id, new HashMap<>());\n }\n }\n //System.out.println(\" darrGlobalAdjList.get(pVertex.getId()) : \" + darrGlobalAdjList.get(pVertex.getId()));\n if (!darrGlobalAdjList.get(pVertex.getId()).containsKey(tf)) {\n darrGlobalAdjList.get((pVertex.getId())).put(tf, new LinkedList<>());\n }\n hmpGraphsAtTimeframes.get(tf).addVertex(pVertex);\n //System.out.println(\" \\t\\t\\t\\t\\t DynamicGraph.addVertex tf = \" + tf.getTimeFrameName() + \" :: \" +this.getGraphTitle());\n //System.out.println(\" \\t\\t\\t\\t\\t DynamicGraph.addVertex mapAllVertices = \" + mapAllVertices.getIds());\n //System.out.println(\" \\t\\t\\t\\t\\t DynamicGraph.addVertex tf = \" + hmpGraphsAtTimeframes.get(tf));\n //System.out.println(\" \\t\\t\\t\\t\\t DynamicGraph.addVertex hmpGraphsAtTimeframes.get(tf) all vertexIds = \" + hmpGraphsAtTimeframes.get(tf).getAllVertexIds());\n }", "public void addVertex(T v) {\n map.put(v, new LinkedList<>());\n }", "boolean addVertex(V v);", "Vertex addVertex(String name){\n\t\t//if graph doesn't already have the key\n\t\tif (!adjlist.containsKey(name)) {\n\t\t\tkeys.add(name); //places keys in list in order they're added\n\t\t\tvertices++; //increases vertex count variable\n\t\t\treturn adjlist.put(name, new Vertex(name)); //adds to hashmap\n\t\t//if graph does already have the key\n\t\t} else {\n\t\t\treturn adjlist.get(name);\n\t\t}\n\t}", "public void add(Vertex vertex) {\n\t\tvertices.add(vertex);\n\t}", "private Vertex getVertex( String vertexName )\n {\n Vertex v = vertexMap.get( vertexName );\n if( v == null )\n {\n v = new Vertex( vertexName );\n vertexMap.put( vertexName, v );\n }\n return v;\n }", "@Override\n public void storeToGraph(Set<GraphContext> graphContext) {\n\n graphContext.forEach(entry -> {\n try {\n LineageEntity fromEntity = entry.getFromVertex();\n LineageEntity toEntity = entry.getToVertex();\n\n upsertToGraph(fromEntity, toEntity, entry.getRelationshipType(), entry.getRelationshipGuid());\n } catch (Exception e) {\n log.error(VERTICES_AND_RELATIONSHIP_CREATION_EXCEPTION, e);\n }\n });\n }", "public void addVertex();", "public void insertTripleDistributedByObject(Triple triple) {\n\r\n }", "public void add(final Vector3d vertex) {\n\t\tcurrentRow[rowIndex] = vertex;\n\t\tif (rowIndex > 0 && lastRow != null) {\n\t\t\tfinal Vector3d edge1 = lastRow[rowIndex - 1];\n\t\t\tfinal Vector3d edge2 = lastRow[rowIndex];\n\t\t\tfinal Vector3d edge3 = currentRow[rowIndex];\n\t\t\tfinal Vector3d edge4 = currentRow[rowIndex - 1];\n\t\t\tfinal Triangle t1 = reverseOrder ? makeTriangle(edge1, edge3, edge2)\n\t\t\t\t\t: makeTriangle(edge1, edge2, edge3);\n\t\t\tfinal Triangle t2 = reverseOrder ? makeTriangle(edge1, edge4, edge3)\n\t\t\t\t\t: makeTriangle(edge1, edge3, edge4);\n\t\t\ttriangs.add(t1);\n\t\t\ttriangs.add(t2);\n\t\t}\n\t\trowIndex++;\n\t\tif (rowIndex >= currentRow.length) {\n\t\t\tlastRow = currentRow;\n\t\t\tcurrentRow = new Vector3d[currentRow.length];\n\t\t\trowIndex = 0;\n\t\t}\n\t}", "@Override public boolean add(L vertex) {\r\n \r\n \tif(vertices.contains(vertex)==false)\r\n \t{\r\n \tvertices.add(vertex);\r\n \tcheckRep();\r\n \treturn true;\r\n }\r\n else {\r\n \t\r\n \treturn false;\r\n }\r\n \t\r\n }", "@Override\n public boolean appendVertex(Integer vertex) {\n if (col.containsKey(vertex))\n return false;\n col.put(vertex, new ArrayList<Integer>());\n return true;\n }", "@Override\n\tpublic boolean add(E vertex) {\n\t\treturn vertices.add(vertex);\n\t}", "public void addVertex (){\t\t \n\t\tthis.graph.insert( new MyList<Integer>() );\n\t}", "int addVertex(Vector position);", "public void insert(VertexRecord key) {\n throw new UnsupportedOperationException();\n }", "private void vertexUp(String vertex) {\r\n\t\tIterator it = vertexMap.entrySet().iterator();\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tMap.Entry pair = (Map.Entry) it.next();\r\n\t\t\tif (pair.getKey().equals(vertex)) {\r\n\t\t\t\tVertex v = (Vertex) pair.getValue();\r\n\t\t\t\tv.setStatus(true);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\tpublic void implementAddVertex() {\n\t\t\n\t}", "public void addVertex(String vertLabel) {\n\n // Implement me!\n if (indexOf(vertLabel, vertices) != -1) {\n return;\n }\n vertices.put(vertLabel, vertices.size());\n if (weights.length == 0) {\n weights = new int[1][0];\n } else {\n weights = addOneRow(weights);\n }\n\n\n }", "public void addVertex(Vertex v) {\n\t \tif (!this.vertexes.contains(v)) {\r\n\t \t\tthis.vertexes.add(v);\r\n\t \t}\r\n\t \t//otherwise just ignore, the Graph already has this vertex\r\n\t }", "synchronized Vertex<V, E, M> getOrCreateVertex(long id) {\n Vertex<V, E, M> vertex = vertices.get(id);\n if (vertex == null) {\n vertex = new Vertex<>(id, this);\n this.vertices.put(id, vertex);\n }\n\n return vertex;\n }", "private void addOrUpdatePropertiesVertex(GraphTraversalSource g, Vertex vertex, LineageEntity lineageEntity) {\n Map<String, Object> properties = getProperties(lineageEntity);\n g.inject(properties)\n .unfold()\n .as(PROPERTIES)\n .V(vertex.id())\n .as(V)\n .sideEffect(__.select(PROPERTIES)\n .unfold()\n .as(KV)\n .select(V)\n .property(__.select(KV).by(Column.keys), __.select(KV).by(Column.values))).iterate();\n }", "private Vertex<String> addLocation(String name) {\n if (!vertices.containsKey(name)) {\n Vertex<String> v = graph.insert(name);\n vertices.put(name, v);\n return v;\n }\n return vertices.get(name);\n }", "public Vertex(final Vertex vertex){\n\t\tID = vertex.getID();\n\t}", "Vertex createVertex();", "public String storeVertex(VertexInfo vdata, EdgeCollectionWritable edata);", "public boolean addVertex(T vertexLabel);", "@Override\r\n\tpublic void addVertex(Integer vertexID) {\r\n\t\tif (vertexIDs.size() > 0) {\r\n\t\t\tvertexIDs.set(0, vertexID);\r\n\t\t} else {\r\n\t\t\tvertexIDs.add(vertexID);\r\n\t\t}\r\n\t}", "void addVertex(Vertex v, ArrayList<Vertex> neighbors, ArrayList<Double> weights) throws VertexNotInGraphException;", "@Override\n public boolean contains(V vertex)\n {\n if (vertex.equals(null)){\n throw new IllegalArgumentException();\n }\n return graph.containsKey(vertex);\n }", "Vertex getVertex(int index);", "private void insert(ByteBuffer rowKey,\n Clustering<?> clustering,\n Cell<?> cell,\n LivenessInfo info,\n WriteContext ctx)\n {\n DecoratedKey valueKey = getIndexKeyFor(getIndexedValue(rowKey,\n clustering,\n cell));\n Row row = BTreeRow.noCellLiveRow(buildIndexClustering(rowKey, clustering, cell), info);\n PartitionUpdate upd = partitionUpdate(valueKey, row);\n indexCfs.getWriteHandler().write(upd, ctx, false);\n logger.debug(\"Inserted entry into index for value {}\", valueKey);\n }", "@Test\r\n void test_insert_1_vertex_check() {\r\n graph.addVertex(\"1\");\r\n vertices = graph.getAllVertices();\r\n if (!vertices.contains(\"1\"))\r\n fail(\"Insert not working!!\");\r\n }", "public abstract CacheKey put(Vector primaryKey, Object object, Object writeLockValue, long readTime);", "private int addAgentToVertex(Vertex vertex, Agent ag){\n synchronized (vertexAgentsNumber) {\n if( vertexAgentsNumber.get(vertex) != null)\n vertexAgentsNumber.get(vertex).add(ag);\n else{\n Collection<Agent> colOfAgents = new HashSet();\n colOfAgents.add(ag);\n vertexAgentsNumber.put(vertex,colOfAgents);\n }\n return vertexAgentsNumber.get(vertex).size();\n }\n }", "public void addVertex(Vertex vertexToAdd) {\r\n\t\tlistVertex.add(vertexToAdd);\r\n\t}", "@Override\n\tpublic boolean add(L vertex) {\n\t\tIterator<Vertex<L>> vertexiter = verticelist.iterator();\n\t\twhile (vertexiter.hasNext()) {\n\t\t\tVertex<L> v = vertexiter.next();\n\t\t\tL lab = v.getlabel();\n\t\t\tif (lab.equals(vertex))\n\t\t\t\treturn false;\n\t\t}\n\t\tVertex<L> v = new Vertex<L>(vertex);\n\t\tverticelist.add(v);\n\t\treturn true;\n\t}", "public void addVertex(String vertexName, E data)\r\n\t{\r\n\t\tif(this.adjacencyMap.containsKey(vertexName))\r\n\t\t{\r\n\t\t\tthrow new IllegalArgumentException(\"Vertex already exists in the graph!\");\r\n\t\t}\r\n\t\t\r\n\t\tthis.dataMap.put(vertexName, data);\r\n\t\tthis.adjacencyMap.put(vertexName, new HashMap<String,Integer>());\r\n\t}", "public Vertex addVertex(String name) {\n Vertex v;\n v = mVertices.get(name);\n if (v == null) {\n v = new Vertex(name);\n mVertices.put(name, v);\n mAdjList.put(v, new TreeSet<Vertex>());\n mNumVertices += 1;\n }\n return v;\n }", "@Override\r\n public void insertTripleDistributedBySubject(Triple triple) {\n\r\n }", "public native VertexList insertBefore(VertexNode target, VertexNode vertex);", "@Test\r\n void test_insert_50_vertex_check() {\r\n String str;\r\n for(int i = 0; i < 50; i++) {\r\n str = \"\" + i;\r\n graph.addVertex(str);\r\n }\r\n vertices = graph.getAllVertices();\r\n for(int j = 0; j < 50; j++) {\r\n str = \"\" + j;\r\n if (!vertices.contains(str))\r\n fail(\"Insert not working!!\");\r\n }\r\n }", "public void placePiece(Piece newPiece){pieceAtVertex = newPiece;}", "public void addVertex(Vertex v) {\n\t\tvertices.put(v.name(), v);\n\t}", "@Override\n\tpublic void vertexCreated(DAG dag, Vertex<?> vertex) {\n\t\tMap<Vertex<?>, RunningVertex> runningVertexKVs = runningVertexes.get(dag);\n\t\tif(runningVertexKVs == null) {\n\t\t\trunningVertexKVs = Collections.synchronizedMap(new LinkedHashMap<Vertex<?>, RunningVertex>());\n\t\t\trunningVertexes.put(dag, runningVertexKVs);\n\t\t}\n\t\tsynchronized(runningVertexKVs) {\n\t\t\trunningVertexKVs.put(vertex, new RunningVertex(vertex));\n\t\t}\n\t\tRunningVertex runningVertex = runningVertexKVs.get(vertex);\n\t\tif(runningVertex != null) {\n\t\t\tsynchronized(runningVertex) {\n\t\t\t\t// collect running vertexes belonging to the running DAG\n\t\t\t\trunningDAGs.get(dag).getRunningVertexes().add(runningVertex);\n\t\t\t}\n\t\t\tLOG.info(\"Vertex created: dag=\" + dag.getName() + \", vertex=\" + vertex.getName());\t\t\n\t\t} else {\n\t\t\tthrowVertexIllegalStateError(dag, vertex);\n\t\t}\n\t}", "@Override\r\n public void add(T value) {\r\n Vertex<T> vertex = new Vertex<>(value);\r\n vertices.put(value, vertex);\r\n }", "public void addEdge(V vertex) {\n this.vertices.put(vertex, new HashSet<>());\n }", "public void putVertexInfoToIndex(String vid, String targetIP);", "public void addVertex(T vertLabel) {\n\t\tvertCount++;\n\t\tLinkedList[] tempList = new LinkedList[vertCount];\n\t\tLinkedList newVert = new LinkedList((String)vertLabel);\n\t\t\n\t\tif(verts.length==0){\n\t\t\ttempList[0] = newVert;\n\t\t}\n\t\t\n\t\telse{\n\t\t\tfor(int x=0; x<verts.length; x++){\n\t\t\t\t\ttempList[x] = verts[x];\n\t\t\t}\n\t\t\ttempList[verts.length] = newVert;\n\t\t}\n\tverts = tempList;\n }", "public void addVertex(Vertex v) {\r\n if (vertexNum >= maxNum) {\r\n System.out.println(\"Error\");\r\n return;\r\n }\r\n vertexNum += 1;\r\n vertexList.add(v);\r\n }", "private void put(PrimitiveEntry entry) {\n int hashIndex = findHashIndex(entry.getKey());\n entries[hashIndex] = entry;\n }", "void upsert(@NotNull final ByteBuffer key, @NotNull final ByteBuffer value) {\n final ClusterValue prev = storage.put(key, ClusterValue.of(value));\n if (prev == null) {\n tableSize = tableSize + key.remaining() + value.remaining();\n } else if (prev.isTombstone()) {\n tableSize = tableSize + value.remaining();\n } else {\n tableSize = tableSize + value.remaining() - prev.getData().remaining();\n }\n }", "public Key insert(Transaction tx,Tuple t) throws RelationException;", "public void addAdjVertex(String currentVertex, String connection)\r\n\t{\r\n\t\tAdjVertex newAdjVertex = newAdjVertex(connection);\r\n\t\t// insert this new node to the linked list\r\n\t\tnewAdjVertex.next = myGraph[getId(currentVertex)].adjVertexHead;\r\n\t\tmyGraph[getId(currentVertex)].adjVertexHead = newAdjVertex;\r\n\t}", "public void insert(K k, V v) {\n int i = h(k);\r\n int z = i;\r\n int j = 0;\r\n if (htable[i] != null) {\r\n if (find(k) != null) {\r\n return;\r\n }\r\n }\r\n while (htable[i] != null && htable[i] != TOMBSTONE) {\r\n i = (z + p(k, ++j)) % htable.length;\r\n if (j == htable.length) {\r\n throw new IllegalStateException();\r\n }\r\n }\r\n htable[i] = new KVPair(k, v);\r\n size++;\r\n //resize table\r\n if (loadFactor() > 0.5) {\r\n KVPair[] temp = new KVPair[htable.length * 2];\r\n for (int y = 0; y < htable.length; y++) {\r\n if (htable[y] == null || htable[y] == TOMBSTONE) {\r\n continue;\r\n }\r\n i = (htable[y].key().hashCode() + temp.length) % temp.length;\r\n z = i;\r\n j = 0;\r\n while (temp[i] != null && temp[i] != TOMBSTONE) {\r\n i = (z + p(k, ++j)) % temp.length;\r\n if (j == temp.length) {\r\n throw new IllegalStateException();\r\n }\r\n }\r\n temp[i] = htable[y];\r\n }\r\n htable = temp.clone();\r\n }\r\n }", "protected BSTVertexOfBabyNames insert(BSTVertexOfBabyNames T,String v)\r\n\t{\r\n\t\t//for null pointer, the height of T has been pre-allocated as 0;\r\n\t\t\r\n\t\tif(T==null)\r\n\t\t\treturn new BSTVertexOfBabyNames(v);\r\n\t\telse if(stringCompare(v,T.key)==0)//v< T.key\r\n\t\t{\r\n\t\t\t\r\n\t\t\tT.left=insert(T.left,v);\r\n\t\t\tT.left.parent=T;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tT.height=calHeight(T);\r\n\t\t\t\r\n\t\t\tif(Math.abs(balanceFactor(T))>1) //unbalanced BST\r\n\t\t\t\tT=rotation(T);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tT.right=insert(T.right,v);\r\n\t\t\tT.right.parent=T;\r\n\t\t\t\r\n\t\t\tT.height=calHeight(T);\r\n\t\t\t\r\n\t\t\tif(Math.abs(balanceFactor(T))>1) //unbalanced BST\r\n\t\t\t\tT=rotation(T);\r\n\t\t}\r\n\t\t\t\r\n\t\treturn T;// return updated BST;\r\n\t}", "abstract Vertex apply(Vertex v);", "private Vertice getVertex(String name) {\r\n Vertice v = (Vertice) vertices.get(name);\r\n if (v == null) {\r\n v = new Vertice(name);\r\n vertices.put(name, v);\r\n }\r\n return v;\r\n }", "public boolean addVertex(Vertex vertex)\n\t{\n\t\tVertex current = this.vertices.get(vertex.getLabel());\n\t\tif (current != null)\n\t\t{\n\t\t\tcurrent.visit();//if vertex exists, increment visits\n\t\t\t\n\t\t\t//add edge between vertices\n\t\t\taddEdge(last,current);\n\t\t\t//overwrite last vertex\n\t\t\tlast = current;\n\t\t\t\n\t\t\treturn false;//vertex not added\n\t\t\t\n\t\t}\n\t\tvertices.put(vertex.getLabel(), vertex);\n\t\t//track last vertex to add edge\n\t\tif(last == null)//first vertex?\n\t\t{\n\t\t\tlast = vertex;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//add edge between vertices\n\t\t\taddEdge(last,vertex);\n\t\t\t//overwrite last vertex\n\t\t\tlast = vertex;\n\t\t}\n\t\treturn true;//vertex was added\n\t\t\n\t}", "@Test\n\tpublic void addVertexTest() {\n\t\tgraph.addVertex(A);\n\t\tgraph.addVertex(B);\n\t\tgraph.addVertex(C);\n\t\tgraph.addVertex(D);\n\t\tassertEquals(4, graph.vertices().size());\n\t\tassertTrue(graph.vertices().contains(A));\n\t\tassertTrue(graph.vertices().contains(B));\n\t\tassertTrue(graph.vertices().contains(D));\n\t\tassertFalse(graph.addVertex(B)); // the graph has already have the vertex B, so assert false here.\n\t}", "public boolean addVertex(Object value) \n\t{\n\t\tthis.map.put(value, new SinglyLinkedList());\n\t\treturn true;\n\t}", "public native VertexList appendChain(VertexNode vertex);", "Vertex getVertex();", "public boolean containsVertex(V vertex);", "public boolean containsVertex(V vertex);", "@Override\n public void addValue(T value) {\n Vertex<T> vertex = new Vertex<>(value);\n vertices.put(value,vertex);\n }", "abstract void insert(K key, V value);", "abstract void insert(K key, V value);", "public interface Vertex <E> extends DecorablePosition<E>{}", "public void addVertex(Vertex v)\n {\n this.vertices.add(v);\n connections.put(v, new ArrayList<>());\n }", "public int addVertex(Model src, int vertexId) {\n\t\tint x = src.vertexX[vertexId];\n\t\tint y = src.vertexY[vertexId];\n\t\tint z = src.vertexZ[vertexId];\n\n\t\tint identical = -1;\n\t\tfor (int v = 0; v < vertexCount; v++) {\n\t\t\tif ((x == vertexX[v]) && (y == vertexY[v]) && (z == vertexZ[v])) {\n\t\t\t\tidentical = v;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// append new one if no matches were found\n\t\tif (identical == -1) {\n\t\t\tvertexX[vertexCount] = x;\n\t\t\tvertexY[vertexCount] = y;\n\t\t\tvertexZ[vertexCount] = z;\n\t\t\tif (src.vertexLabel != null) {\n\t\t\t\tvertexLabel[vertexCount] = src.vertexLabel[vertexId];\n\t\t\t}\n\t\t\tidentical = vertexCount++;\n\t\t}\n\n\t\treturn identical;\n\t}", "@Override\n\tpublic int insert(Entrust entrust) {\n\t\treturn entrustServiceImpl.insert(entrust);\n\t}", "protected void processVertex(Vertex w){\n\t}", "void addVertex(SimpleVertex simpleVertex) {\n\t\tallvertices.add(simpleVertex);\n\t}", "@Test\r\n void test_insert_null_vertex() {\r\n graph.addVertex(null);\r\n vertices = graph.getAllVertices();\r\n \r\n if(vertices.contains(null))\r\n fail();\r\n if(vertices.size() != 0 ||graph.order() != 0) {\r\n fail();\r\n }\r\n\r\n }", "private void createHeap(double vertex, double weight){\r\n if (heap == null){\r\n heap = new TreeMap<>();\r\n }\r\n heap.put((double)vertex, weight);\r\n }", "@Test\n public void testAddVertexExisting() throws Exception {\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n\n graph = graph.addVertex(new Vertex<>(1L, 1L));\n\n DataSet<Vertex<Long, Long>> data = graph.getVertices();\n List<Vertex<Long, Long>> result = data.collect();\n\n expectedResult = \"1,1\\n\" + \"2,2\\n\" + \"3,3\\n\" + \"4,4\\n\" + \"5,5\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }" ]
[ "0.641776", "0.6356567", "0.6337263", "0.6243977", "0.6216678", "0.6216678", "0.6140106", "0.61143047", "0.607523", "0.60598177", "0.60586953", "0.60484356", "0.60215443", "0.601589", "0.5987106", "0.59836656", "0.5978122", "0.5911169", "0.58591825", "0.58578134", "0.58136016", "0.577762", "0.577558", "0.57201856", "0.5696418", "0.56903946", "0.56792194", "0.56711614", "0.56527436", "0.5634468", "0.5628945", "0.5614722", "0.5611918", "0.56093454", "0.55003726", "0.5476129", "0.54438967", "0.53949296", "0.5375394", "0.5367086", "0.535936", "0.5355877", "0.5349718", "0.5343046", "0.5342804", "0.53421825", "0.5341058", "0.53405726", "0.533822", "0.53256834", "0.5323468", "0.53121895", "0.52909243", "0.52903646", "0.5276655", "0.5267272", "0.52505064", "0.5230104", "0.5229787", "0.5217563", "0.52149993", "0.5213853", "0.52114165", "0.520422", "0.518875", "0.5187798", "0.5178858", "0.5140363", "0.5132791", "0.5123771", "0.5112273", "0.51016587", "0.5083921", "0.50762916", "0.5076117", "0.50718933", "0.50636613", "0.5063496", "0.5013457", "0.5003598", "0.50012326", "0.4997872", "0.49759716", "0.49699453", "0.4967779", "0.49548888", "0.4950979", "0.4950979", "0.49509227", "0.49318257", "0.49318257", "0.49292415", "0.49281466", "0.49184754", "0.49163753", "0.49161428", "0.49077967", "0.4903897", "0.48945296", "0.48873842" ]
0.67361844
0
This function finds the lineage of the graph starting from a source vertex.
@Deprecated public Graph getLineage(String hash, String direction, int maxDepth) { Graph result = new Graph(); Vertex previousVertex = null; Vertex currentVertex = null; int depth = 0; Queue<Vertex> queue = new LinkedList<>(); queue.add(getVertex(hash)); while(!queue.isEmpty() && depth < maxDepth) { currentVertex = queue.remove(); String currentHash = currentVertex.getAnnotation("hash"); if(DIRECTION_ANCESTORS.startsWith(direction.toLowerCase())) queue.addAll(getParents(currentHash).vertexSet()); else if(DIRECTION_DESCENDANTS.startsWith(direction.toLowerCase())) queue.addAll(getChildren(currentHash).vertexSet()); result.putVertex(currentVertex); if(previousVertex != null) result.putEdge(getEdge(previousVertex.getAnnotation("hash"), currentHash)); previousVertex = currentVertex; depth++; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void computePaths(Vertex source){\n\t\tsource.minDistance=0;\n\t\t//visit each vertex u, always visiting vertex with smallest minDistance first\n\t\tPriorityQueue<Vertex> vertexQueue=new PriorityQueue<Vertex>();\n\t\tvertexQueue.add(source);\n\t\twhile(!vertexQueue.isEmpty()){\n\t\t\tVertex u = vertexQueue.poll();\n\t\t\tSystem.out.println(\"For: \"+u);\n\t\t\tfor (Edge e: u.adjacencies){\n\t\t\t\tVertex v = e.target;\n\t\t\t\tSystem.out.println(\"Checking: \"+u+\" -> \"+v);\n\t\t\t\tdouble weight=e.weight;\n\t\t\t\t//relax the edge (u,v)\n\t\t\t\tdouble distanceThroughU=u.minDistance+weight;\n\t\t\t\tif(distanceThroughU<v.minDistance){\n\t\t\t\t\tSystem.out.println(\"Updating minDistance to \"+distanceThroughU);\n\t\t\t\t\tv.minDistance=distanceThroughU;\n\t\t\t\t\tv.previous=u;\n\t\t\t\t\t//move the vertex v to the top of the queue\n\t\t\t\t\tvertexQueue.remove(v);\n\t\t\t\t\tvertexQueue.add(v);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public String getSourceLine (int line);", "public int getPredecessorCount(final LazyNode2 vertex) {\n Set<Node> vertices = new HashSet<Node>();\n \n Node n = neo.getNodeById(vertex.getId());\n \n for(Relationship r : n.getRelationships(relType.DEFAULT, Direction.INCOMING)){\n if(isActive(r))\n vertices.add(r.getStartNode());\n }\n n = null; \n \n return vertices.size();\n }", "private static void computePaths(Vertex source) {\n source.minDistance = 0;\n // retrieves with log(n) time\n PriorityQueue<Vertex> vertexPriorityQueue = new PriorityQueue<>();\n\n //BFS traversal\n vertexPriorityQueue.add(source);\n\n // O((v + e) * log(v))\n while (!vertexPriorityQueue.isEmpty()) {\n // this poll always returns the shortest distance vertex at log(v) time\n Vertex vertex = vertexPriorityQueue.poll();\n\n //visit each edge exiting vertex (adjacencies)\n for (Edge edgeInVertex : vertex.adjacencies) {\n // calculate new distance between edgeInVertex and target\n Vertex targetVertex = edgeInVertex.target;\n double edgeWeightForThisVertex = edgeInVertex.weight;\n double distanceThruVertex = vertex.minDistance + edgeWeightForThisVertex;\n if (distanceThruVertex < targetVertex.minDistance) {\n // modify the targetVertex with new calculated minDistance and previous vertex\n // by removing the old vertex and add new vertex with updates\n vertexPriorityQueue.remove(targetVertex);\n targetVertex.minDistance = distanceThruVertex;\n // update previous with the shortest distance vertex\n targetVertex.previous = vertex;\n vertexPriorityQueue.add(targetVertex);// adding takes log(v) time because needs to heapify\n }\n }\n }\n }", "private List<Edge> getPath(Vertex source) {\n\t\tint [] predecessors = new ShortestPath().findShortestPath(this.residualNetwork, source);\n\t\tList<Edge> path = retrieveEdgesFromPredecessorArray(predecessors);\n\t\treturn path;\n\t}", "public int selectForwardLine() {\n int bestLine = 0;\n for (int i = 0; i < forwardLines.length; i++) {\n double averageStamina = getForwardAverageStamina(i);\n System.out.println(forwardLines[i][1] + \" avg line Stamina (Line:\" + (i+1) + \") :\" + averageStamina);\n if (averageStamina > getForwardAverageStamina(bestLine)) {\n bestLine = i;\n }\n }\n return bestLine;\n }", "@Override\n public Vertex getSource() {\n return sourceVertex;\n }", "int getStartLineNumber();", "@Override\r\n\tpublic ArrayList<Edge<E>> primMinimumSpanningTree(E src) {\r\n\t\tArrayList<Edge<E>> prim = new ArrayList<Edge<E>>();\r\n\t\tif(containsVertex(src)) {\r\n\t\t\tlastSrc = vertices.get(src);\r\n\t\t\tPriorityQueue<Vertex<E>> pq = new PriorityQueue<Vertex<E>>();\r\n\t\t\tvertices.forEach((E t, Vertex<E> u) -> {\r\n\t\t\t\tu.setDistance(Integer.MAX_VALUE);\r\n\t\t\t\tu.setColor(Color.WHITE);\r\n\t\t\t\tu.setPredecessor(null);\r\n\t\t\t\tpq.offer(u);\r\n\t\t\t});\r\n\t\t\tpq.remove(lastSrc);\r\n\t\t\tlastSrc.setDistance(0);\r\n\t\t\tpq.offer(lastSrc);\r\n\r\n\t\t\twhile(!pq.isEmpty()) {\r\n\t\t\t\tVertex<E> u = pq.poll();\r\n\t\t\t\tfor(Edge<E> ale : adjacencyLists.get(u.getElement())) {\r\n\t\t\t\t\tVertex<E> s = vertices.get(ale.getSrc());\r\n\t\t\t\t\tVertex<E> d = vertices.get(ale.getDst());\r\n\t\t\t\t\tif(d.getColor() == Color.WHITE && d.getDistance() > ale.getWeight()) {\r\n\t\t\t\t\t\tpq.remove(d);\r\n\t\t\t\t\t\tVertex<E> pred = d.getPredecessor();\r\n\t\t\t\t\t\tif(pred != null) { //remove the edge that has ale.dst as dst vertex\r\n\t\t\t\t\t\t\tEdge<E> edgeToRemove = new Edge<>(pred.getElement(), ale.getDst(), 1);\r\n\t\t\t\t\t\t\tprim.remove(edgeToRemove);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\td.setDistance(ale.getWeight());\r\n\t\t\t\t\t\td.setPredecessor(s);\r\n\t\t\t\t\t\tpq.offer(d);\r\n\t\t\t\t\t\tprim.add(ale);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tu.setColor(Color.BLACK);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn prim;\r\n\t}", "public Vertex getSource() {\n return source;\n }", "private int getClientToLineInclusive() {\n return pageRequest.getStart() + pageRequest.getLimit();\n }", "private List<Vertex> findPathForOutputAsset(Vertex endingVertex, GraphTraversalSource g, Vertex startingVertex) {\n //add null check for endingVertex\n if (endingVertex == null) {\n return null;\n }\n\n List<Vertex> endVertices = new ArrayList<>();\n try {\n if (isEndColumn(g, endingVertex)) {\n endVertices.add(endingVertex);\n } else {\n List<Vertex> nextVertices = g.V(endingVertex.id()).out(LINEAGE_MAPPING).toList();\n\n for (Vertex vertex : nextVertices) {\n if (vertex.equals(startingVertex)) {\n continue;\n }\n Optional.ofNullable(findPathForOutputAsset(vertex, g, endingVertex)).ifPresent(endVertices::addAll);\n }\n\n }\n return endVertices;\n } catch (Exception e) {\n if (log.isDebugEnabled()) {\n log.debug(VERTEX_NOT_FOUND, startingVertex.id(),\n startingVertex.property(PROPERTY_KEY_DISPLAY_NAME).value());\n }\n return null;\n }\n }", "public int shortestPath(Village startVillage, Village targetVillage) {\n// setting the initial point 's minimum distance to zera\n startVillage.setMinDistance(0);\n// accourting to bellman ford if there are n number of dots then n-1 iterations to be done to find the minimum distances of every dot from one initial dot\n int length = this.villageList.size();\n// looping n-1 times\n for (int i = 0; i < length - 1; i++) {\n// looping through all the roads and mark the minimum distances of all the possible points\n for (Road road : roadList) {\n\n\n// if the road is a main road then skip the path\n if (road.getWeight() == 900)\n continue; //why 900 ? : just a random hightest number as a minimum distance and same 900 is used as a mix number\n Village v = road.getStartVertex();\n Village u = road.getTargetVertex();\n// if the newly went path is less than the path it used to be the update the min distance of the reached vertex\n int newLengtha = v.getMinDistance() + road.getWeight();\n if (newLengtha < u.getMinDistance()) {\n u.setMinDistance(newLengtha);\n u.setPreviousVertex(v);\n }\n int newLengthb = u.getMinDistance() + road.getWeight();\n if (newLengthb < v.getMinDistance()) {\n v.setMinDistance(newLengthb);\n v.setPreviousVertex(v);\n }\n }\n }\n// finally return the minimum distance\n return targetVillage.getMinDistance();\n }", "int[] neighborPointsFromLine(int sourceLineId) {\n\t\t// http://i.imgur.com/3nWXfwA.jpg\n\t\tint neighborLeft;\n\t\tif (sourceLineId == amount - 1)\n\t\t\tneighborLeft = 0; // amount - 1 in quad means line[3] aka the last\n\t\t\t\t\t\t\t\t// line in quad/polygon\n\t\telse\n\t\t\tneighborLeft = sourceLineId + 1; // otherwise left neigbor is always\n\t\t\t\t\t\t\t\t\t\t\t\t// id+1; i.e. if line[2] then\n\t\t\t\t\t\t\t\t\t\t\t\t// left neigbor is point[3], see\n\t\t\t\t\t\t\t\t\t\t\t\t// drawing:\n\t\t\t\t\t\t\t\t\t\t\t\t// http://i.imgur.com/iyZVj78.jpg\n\n\t\tint neighborRight = sourceLineId; // right neighbor id is alwas the same\n\t\t\t\t\t\t\t\t\t\t\t// as line id, check drawing:\n\t\t\t\t\t\t\t\t\t\t\t// http://i.imgur.com/iyZVj78.jpg\n\t\tint[] neighbors = { neighborLeft, neighborRight };\n\t\treturn neighbors;\n\t}", "public int getDecoratedLine (Node node);", "public static void computePaths(Point source) {\n\n\t\tsource.setMinimumDistance(0.0);\n\t\tPriorityQueue<Point> pointQueue = new PriorityQueue<Point>();\n\t\tpointQueue.add(source);\n\t\twhile (!pointQueue.isEmpty()) {\n\t\t\tPoint u = pointQueue.poll();\n\t\t\tif (u.getAdjacencies() != null) {\n\t\t\t\tfor (Edge e : u.getAdjacencies()) {\n\n\t\t\t\t\tPoint target = e.getTarget();\n\t\t\t\t\tdouble weight = e.getWeight();\n\t\t\t\t\tdouble distanceThroughP = weight + u.getMinimumDistance();\n\n\t\t\t\t\tif (distanceThroughP < target.getMinimumDistance()) {\n\t\t\t\t\t\tpointQueue.remove(target);\n\n\t\t\t\t\t\ttarget.setMinimumDistance(distanceThroughP);\n\t\t\t\t\t\ttarget.setPrevious(u);\n\t\t\t\t\t\tpointQueue.add(target);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void generatePath(List<Coordinate> source, List<Coordinate> path) {\n for (int i = 0; i < source.size() - 1; i++) {\n Graph graph = new Graph(getEdge(map));\n Coordinate start = source.get(i);\n Coordinate end = source.get(i + 1);\n graph.dijkstra(start);\n graph.printPath(end);\n for (Graph.Node node : graph.getPathReference()) {\n path.add(node.coordinate);\n }\n }\n }", "@Override\r\n\tpublic List<Integer> getReachableVertices(GraphStructure graph,int vertex) {\r\n\t\tadjacencyList=graph.getAdjacencyList();\r\n\t\tpathList=new ArrayList<Integer>();\r\n\t\tisVisited=new boolean [graph.getNumberOfVertices()];\r\n\t\ttraverseRecursively(graph, vertex);\r\n\t\treturn pathList;\r\n\t}", "@Override\r\n\tpublic void getMinimumSpanningTree(GraphStructure graph) {\r\n\t\tdistanceArray = new int [graph.getNumberOfVertices()];\r\n\t\tint numberOfVertices=graph.getNumberOfVertices();\r\n\t\tSet<Integer> spanningTreeSet = new HashSet<Integer>();\r\n\t\tArrays.fill(distanceArray,Integer.MAX_VALUE);\r\n\t\tdistanceArray[0]=0;\r\n\t\tadjacencyList = graph.getAdjacencyList();\r\n\t\tList<Edge> list;\r\n\t\twhile(spanningTreeSet.size()!=numberOfVertices) {\r\n\t\t\tfor (int vertex=0; vertex<numberOfVertices;vertex++) {\r\n\t\t\t\tif(! spanningTreeSet.contains(vertex)) {\r\n\t\t\t\t\tspanningTreeSet.add(vertex);\r\n\t\t\t\t\tlist = adjacencyList[vertex];\r\n\t\t\t\t\tfor(Edge value : list) {\r\n\t\t\t\t\t\tint sumOfWeightAndSourceVertexDistanceValue = distanceArray[vertex] + value.getWeight();\r\n\t\t\t\t\t\tint distanceValueOfDestinationVertex = distanceArray[value.getVertex()];\r\n\t\t\t\t\t\tif( sumOfWeightAndSourceVertexDistanceValue < distanceValueOfDestinationVertex ) {\r\n\t\t\t\t\t\t\tdistanceArray[value.getVertex()] = sumOfWeightAndSourceVertexDistanceValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"\\nvertex\\tdistance from source\");\r\n\t\tfor (int i=0;i<numberOfVertices;i++) {\r\n\t\t\tSystem.out.println(i+\"\\t\"+distanceArray[i]);\r\n\t\t}\r\n\t}", "public int getLineToStart() {\r\n\t\treturn this.lineToStart;\r\n\t}", "private void computeShortestPathsFromSource(V source) {\n\t\tBFSDistanceLabeler<V, E> labeler = new BFSDistanceLabeler<V, E>();\n\t\tlabeler.labelDistances(mGraph, source);\n\t\tdistances = labeler.getDistanceDecorator();\n\t\tMap<V, Number> currentSourceSPMap = new HashMap<V, Number>();\n\t\tMap<V, E> currentSourceEdgeMap = new HashMap<V, E>();\n\n\t\tfor (V vertex : mGraph.getVertices()) {\n\n\t\t\tNumber distanceVal = distances.get(vertex);\n\t\t\t// BFSDistanceLabeler uses -1 to indicate unreachable vertices;\n\t\t\t// don't bother to store unreachable vertices\n\t\t\tif (distanceVal != null && distanceVal.intValue() >= 0) {\n\t\t\t\tcurrentSourceSPMap.put(vertex, distanceVal);\n\t\t\t\tint minDistance = distanceVal.intValue();\n\t\t\t\tfor (E incomingEdge : mGraph.getInEdges(vertex)) {\n\t\t\t\t\tfor (V neighbor : mGraph\n\t\t\t\t\t\t\t.getIncidentVertices(incomingEdge)) {\n\t\t\t\t\t\tif (neighbor.equals(vertex))\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t// V neighbor = mGraph.getOpposite(vertex,\n\t\t\t\t\t\t// incomingEdge);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tNumber predDistanceVal = distances.get(neighbor);\n\n\t\t\t\t\t\tint pred_distance = predDistanceVal.intValue();\n\t\t\t\t\t\tif (pred_distance < minDistance && pred_distance >= 0) {\n\t\t\t\t\t\t\tminDistance = predDistanceVal.intValue();\n\t\t\t\t\t\t\tcurrentSourceEdgeMap.put(vertex, incomingEdge);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tmDistanceMap.put(source, currentSourceSPMap);\n\t\tmIncomingEdgeMap.put(source, currentSourceEdgeMap);\n\t}", "public static int[] bellf_access(Graph graph, Vertex start, Vertex destination) {\n\t\tint[] readWriteAccess = {0,0,0};\n\t\t\n\t\t//initialize\n\t\tArrayList<Integer> distance = new ArrayList<Integer>(); \n\t\tArrayList<Vertex> predecessor = new ArrayList<Vertex>();\n\t\t\t\n\t\tfor(Vertex v : graph.getVertexes()) {\n\t\t\treadWriteAccess[0]++;\n\t\t\treadWriteAccess[1]++;\n\t\t\tif(v == start) {\n\t\t\t\tdistance.add(0);\n\t\t\t\treadWriteAccess[2]++;\n\t\t\t\tpredecessor.add(v);\n\t\t\t\treadWriteAccess[2]++;\n\t\t\t} else {\n\t\t\t\tdistance.add(Integer.MAX_VALUE);\n\t\t\t\treadWriteAccess[2]++;\n\t\t\t\tpredecessor.add(null);\n\t\t\t\treadWriteAccess[2]++;\n\t\t\t}\n\t\t\treadWriteAccess[1]++;\n\t\t}\n\t\t\t\t\n\t\t//iterate\n\t\t//number of iterations\n\t\tfor(int i = 0; i < graph.getVertexes().size(); i++) {\n\t\t\treadWriteAccess[0]++;\n\t\t\treadWriteAccess[1]++;\n\t\t\tfor(Vertex s : graph.getVertexes()) {\n\t\t\t\treadWriteAccess[0]++;\n\t\t\t\treadWriteAccess[1]++;\n\t\t\t\tint indexS = graph.getVertexes().indexOf(s);\n\t\t\t\treadWriteAccess[2]++;\n\t\t\t\treadWriteAccess[0]++;\n\t\t\t\treadWriteAccess[1]++;\n\t\t\t\tfor(Vertex t : graph.getTarget(s)) {\n\t\t\t\t\treadWriteAccess[0]++;\n\t\t\t\t\treadWriteAccess[1]++;\n\t\t\t\t\tint indexT = graph.getVertexes().indexOf(t);\n\t\t\t\t\treadWriteAccess[2]++;\n\t\t\t\t\treadWriteAccess[0]++;\n\t\t\t\t\treadWriteAccess[1]++;\n\t\t\t\t\tint cost = add(distance.get(indexS), graph.getValE(s, t, \"cost\")); //evaluate new costs\n\t\t\t\t\treadWriteAccess[2]++;\n\t\t\t\t\treadWriteAccess[0]++;\n\t\t\t\t\treadWriteAccess[1]++;\n\t\t\t\t\tif(distance.get(indexT) > cost) { //if new costs are lower, replace old costs and change predecessor\n\t\t\t\t\t\tdistance.set(indexT, cost);\n\t\t\t\t\t\treadWriteAccess[2]++;\n\t\t\t\t\t\tpredecessor.set(indexT, s);\n\t\t\t\t\t\treadWriteAccess[2]++;\n\t\t\t\t\t}\n\t\t\t\t\treadWriteAccess[1]++;\n\t\t\t\t}\n\t\t\t}\n\t\t} //check for negative circle\n\t\tfor(int i = 0; i < graph.getVertexes().size(); i++) {\n\t\t\tfor(Vertex s : graph.getVertexes()) {\n\t\t\t\treadWriteAccess[0]++;\n\t\t\t\treadWriteAccess[1]++;\n\t\t\t\tint indexS = graph.getVertexes().indexOf(s);\n\t\t\t\treadWriteAccess[2]++;\n\t\t\t\treadWriteAccess[0]++;\n\t\t\t\treadWriteAccess[1]++;\n\t\t\t\tfor(Vertex t : graph.getTarget(s)) {\n\t\t\t\t\treadWriteAccess[0]++;\n\t\t\t\t\treadWriteAccess[1]++;\n\t\t\t\t\tint indexT = graph.getVertexes().indexOf(t);\n\t\t\t\t\treadWriteAccess[2]++;\n\t\t\t\t\treadWriteAccess[0]++;\n\t\t\t\t\treadWriteAccess[1]++;\n\t\t\t\t\tint cost = add(distance.get(indexS), graph.getValE(s, t, \"cost\"));\n\t\t\t\t\treadWriteAccess[2]++;\n\t\t\t\t\treadWriteAccess[0]++;\n\t\t\t\t\treadWriteAccess[1]++;\n\t\t\t\t\tif(distance.get(indexT) > cost) {\n\t\t\t\t\t\tSystem.out.println(\"negativer Kreis gefunden\");\n\t\t\t\t\t\treturn readWriteAccess; //if there are lower costs again, return null and an errormessage.\n\t\t\t\t\t}\n\t\t\t\t\treadWriteAccess[1]++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//get vertices for shortest way\n\t\tArrayList<Vertex> path = new ArrayList<Vertex>();\n\t\tVertex tmp = destination; //from destination\n\t\treadWriteAccess[2]++;\n\t\tpath.add(tmp);\n\t\treadWriteAccess[2]++;\n\t\twhile(tmp != start) {\n\t\t\treadWriteAccess[1]++;\n\t\t\tif(tmp == null) {//to start\n\t\t\t\treturn readWriteAccess;\n\t\t\t}\n\t\t\treadWriteAccess[1]++;\n\t\t\ttmp = predecessor.get(graph.getVertexes().indexOf(tmp));\n\t\t\treadWriteAccess[2]++;\n\t\t\treadWriteAccess[0]++;\n\t\t\treadWriteAccess[1]++;\n\t\t\tpath.add(tmp);\n\t\t\treadWriteAccess[2]++;\n\t\t}\n\t\tCollections.reverse(path); //reverse, so it has right order\n\t\treadWriteAccess[1]++;\n\t\treadWriteAccess[2]++;\n\t\treturn readWriteAccess; //and return it.\n\t}", "public int getStartVertex() {\n\t\treturn startVertex;\n\t}", "public Vertex getFrom() {\r\n\r\n return from;\r\n }", "public Vertex<VV> getFrom()\r\n { return from; }", "private void computePaths(Vertex source, Vertex target, ArrayList<Vertex> vs)\n {\n \tfor (Vertex v : vs)\n \t{\n \t\tv.minDistance = Double.POSITIVE_INFINITY;\n \t\tv.previous = null;\n \t}\n source.minDistance = 0.;\t\t// distance to self is zero\n IndexMinPQ<Vertex> vertexQueue = new IndexMinPQ<Vertex>(vs.size());\n \n for (Vertex v : vs) vertexQueue.insert(Integer.parseInt(v.id), v);\n\n\t\twhile (!vertexQueue.isEmpty()) \n\t\t{\n\t \t// retrieve vertex with shortest distance to source\n\t \tVertex u = vertexQueue.minKey();\n\t \tvertexQueue.delMin();\n\t\t\tif (u == target)\n\t\t\t{\n\t\t\t\t// trace back\n\t\t\t\twhile (u.previous != null)\n\t\t\t\t{;\n\t\t\t\t\tu = u.previous;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n \t// Visit each edge exiting u\n \tfor (Edge e : u.adjacencies)\n \t\t{\n \t\tVertex v = e.target;\n\t\t\t\tdouble weight = e.weight;\n \tdouble distanceThroughU = u.minDistance + weight;\n\t\t\t\tif (distanceThroughU < v.minDistance) \n\t\t\t\t{\n\t\t\t\t\tint vid = Integer.parseInt(v.id);\n\t\t \t\tvertexQueue.delete(vid);\n\t\t \t\tv.minDistance = distanceThroughU;\n\t\t \t\tv.previous = u;\n\t\t \t\tvertexQueue.insert(vid,v);\n\t\t\t\t}\n\t\t\t}\n }\n }", "private int getMinCostVertexFromTheGraph(int[] minCostComputedForVertices, boolean[] verticesAlreadyVisited) {\n\t\tint minVertex = -1;\n\t\tint minCost = Integer.MAX_VALUE;\n\t\t\n\t\tfor(int i=0;i<minCostComputedForVertices.length;i++) {\n\t\t\tif(verticesAlreadyVisited[i]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif(minCost > minCostComputedForVertices[i]) {\n\t\t\t\tminCost = minCostComputedForVertices[i];\n\t\t\t\tminVertex = i;\n\t\t\t}\n\t\t}\n\t\treturn minVertex;\n\t}", "@Override\n\tpublic List<node_data> shortestPath(int src, int dest) {\n\t\tfor(node_data vertex : dwg.getV()) {\n\t\t\tvertex.setInfo(\"\"+Double.MAX_VALUE);\n\t\t}\n\t\tint[] prev = new int[dwg.nodeSize()];\n\t\tnode_data start = dwg.getNode(src);\n\t\tstart.setInfo(\"0.0\");\n\t\tQueue<node_data> q = new LinkedBlockingQueue<node_data>();\n\t\tq.add(start);\n\t\tprev[src%dwg.nodeSize()] = -1;\n\t\twhile(!q.isEmpty()) {\n\t\t\tnode_data v = q.poll();\n\t\t\tCollection<edge_data> edgesV = dwg.getE(v.getKey());\n\t\t\tfor(edge_data edgeV : edgesV) {\n\t\t\t\tdouble newSumPath = Double.parseDouble(v.getInfo()) +edgeV.getWeight();\n\t\t\t\tint keyU = edgeV.getDest();\n\t\t\t\tnode_data u = dwg.getNode(keyU);\n\t\t\t\tif(newSumPath < Double.parseDouble(u.getInfo())) {\n\t\t\t\t\tu.setInfo(\"\"+newSumPath);\n\t\t\t\t\tq.remove(u);\n\t\t\t\t\tq.add(u);\n\t\t\t\t\tprev[u.getKey()%dwg.nodeSize()] = v.getKey();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tList<node_data> ans = new ArrayList<node_data>();\n\t\tint run = dest;\n\t\twhile(run != src) {\n\t\t\tans.add(0,dwg.getNode(run));\n\t\t\trun = prev[run%dwg.nodeSize()];\n\t\t}\n\t\tans.add(0, dwg.getNode(src));\n\n\t\treturn ans;\n\t}", "public ArrayList<Vertex> getPath(Vertex target) {\n\t\tArrayList<Vertex> path = new ArrayList<Vertex>();\n\t\tVertex step = target;\n\t\t// check if a path exists\n\t\tif (predecessors.get(step) == null) {\n\t\t\treturn null;\n\t\t}\n\t\tpath.add(step);\n\t\twhile (predecessors.get(step) != null) {\n\t\t\tstep = predecessors.get(step);\n\t\t\tpath.add(step);\n\t\t}\n\t\t// Put it into the correct order\n\t\tCollections.reverse(path);\n\n\n\t\tVertex current=null;\n\t\tVertex next=null;\n\t\tint length = path.size();\n\t\tfor(int i=0;i<length-1;i++){\n current = path.get(i);\n\t\t\t next = path.get(i+1);\n\t\t\tif(!rapid && (nodeColor_map.get(current.getName()).equalsIgnoreCase(\"dB\")||\n\t\t\t\t\tnodeColor_map.get(next.getName()).equalsIgnoreCase(\"dB\")))\n\t\t\t\trapid = true;\n\t\t\troute_length+= edge_length_map.get(new Pair(current,next));\n\t\t}\n\n\t\treturn path;\n\t}", "public void calcSP(Graph g, Vertex source){\n // Algorithm:\n // 1. Take the unvisited node with minimum weight.\n // 2. Visit all its neighbours.\n // 3. Update the distances for all the neighbours (In the Priority Queue).\n // Repeat the process till all the connected nodes are visited.\n\n // clear existing info\n// System.out.println(\"Calc SP from vertex:\" + source.name);\n g.resetMinDistance();\n source.minDistance = 0;\n PriorityQueue<Vertex> queue = new PriorityQueue<Vertex>();\n queue.add(source);\n\n while(!queue.isEmpty()){\n Vertex u = queue.poll();\n for(Edge neighbour:u.neighbours){\n// System.out.println(\"Scanning vector: \"+neighbour.target.name);\n Double newDist = u.minDistance+neighbour.weight;\n\n // get new shortest path, empty existing path info\n if(neighbour.target.minDistance>newDist){\n // Remove the node from the queue to update the distance value.\n queue.remove(neighbour.target);\n neighbour.target.minDistance = newDist;\n\n // Take the path visited till now and add the new node.s\n neighbour.target.path = new ArrayList<>(u.path);\n neighbour.target.path.add(u);\n// System.out.println(\"Path\");\n// for (Vertex vv: neighbour.target.path) {\n// System.out.print(vv.name);\n// }\n// System.out.print(\"\\n\");\n\n// System.out.println(\"Paths\");\n neighbour.target.pathCnt = 0;\n neighbour.target.paths = new ArrayList<ArrayList<Vertex>>();\n if (u.paths.size() == 0) {\n ArrayList<Vertex> p = new ArrayList<Vertex>();\n p.add(u);\n neighbour.target.paths.add(p);\n neighbour.target.pathCnt++;\n } else {\n for (ArrayList<Vertex> p : u.paths) {\n ArrayList<Vertex> p1 = new ArrayList<>(p);\n p1.add(u);\n// for (Vertex vv : p1) {\n// System.out.print(vv.name);\n// }\n// System.out.print(\"\\n\");\n neighbour.target.paths.add(p1);\n neighbour.target.pathCnt++;\n }\n }\n\n //Reenter the node with new distance.\n queue.add(neighbour.target);\n }\n // get equal cost path, add into path list\n else if (neighbour.target.minDistance == newDist) {\n queue.remove(neighbour.target);\n for(ArrayList<Vertex> p: u.paths) {\n ArrayList<Vertex> p1 = new ArrayList<>(p);\n p1.add(u);\n neighbour.target.paths.add(p1);\n neighbour.target.pathCnt++;\n }\n queue.add(neighbour.target);\n }\n }\n }\n }", "public Vertex getStart()\n\t{\n\t\treturn start.copy();\n\t}", "private int[] runDijkstra(int graph[][], int source) {\r\n\r\n // Stores the best estimate of the shortest distance from\r\n // the source to each node \r\n int d[] = new int[graph.length];\r\n \r\n // Initialized with infinite value.\r\n // Value of -1 means the node has been settled \r\n int dC[] = new int[graph.length];\r\n \r\n // Stores the predecessor of each node on the shortest path \r\n // from the source\r\n int p[] = new int[graph.length];\r\n\r\n // Initialize\r\n for (int i = 0; i < graph.length; i++ ) {\r\n d[i] = this.INFINITE;\r\n dC[i] = this.INFINITE;\r\n p[i] = -1;\r\n }\r\n \r\n // We start knowning the distance of the source from itself (zero)\r\n d[source] = 0;\r\n dC[source] = 0;\r\n\r\n int i = 0;\r\n int min = this.INFINITE;\r\n int pos = 0;\r\n\r\n while (i < graph.length) {\r\n //extract minimum distance\r\n for (int j = 0; j < dC.length; j++ ){\r\n if( min > d[j] && dC[j] != -1 ){\r\n min = d[j];\r\n pos = j;\r\n }\r\n }\r\n // This node is settled\r\n dC[pos] = -1;\r\n\r\n // relax its neighbours\r\n for (int j = 0; j < graph.length; j++ ) {\r\n if ( (graph[pos][j] != -1) && (d[j] > graph[pos][j] + d[pos]) ) {\r\n d[j] = graph[pos][j] + d[pos];\r\n p[j] = pos;\r\n }\r\n }\r\n i++;\r\n min = this.INFINITE;\r\n }\r\n\r\n return p;\r\n }", "org.tensorflow.proto.profiler.XLine getLines(int index);", "public List<Vertex> getPathTo(int targetVertexPortnum){\n LinkedList<Vertex> path = new LinkedList<Vertex>();\n path.add(graph.getVertex(convertToString(targetVertexPortnum))); // use string version of the port num.\n \n while(targetVertexPortnum != this.initialVertexPortNum)\n {\n Vertex predecessor = graph.getVertex(this.predecessors.get(convertToString(targetVertexPortnum))); // use string version of the portnum.\n targetVertexPortnum = predecessor.getVertexPortNum(); // get the int representation of the vertex portnum.\n path.add(0, predecessor); // add the vertex to our shortest path.\n }\n \n return path; // return the shortest path to the target vertex.\n }", "void shortestPath( final VertexType fromNode, Integer node );", "public Line getLine(String targetLine);", "public void shortestPaths(int source) {\n\n\t\tlong start = 0;\n\t\tlong stop;\n\t\tfor (int v = 0; v < vertexList.length; v++) {\n\t\t\tedgeList[v] = new Edge(vertexList[v].id, rand, 5000);\n\t\t}\n\t\t// creating object of fibonacci\n\t\tFHeap pq = new FHeap();\n\t\t// creating a map for checking\n\t\tMap<Integer, FHeap.Node> check = new HashMap<Integer, FHeap.Node>();\n\t\t// storing the mst costs\n\n\t\tfor (int v = 0; v < vertexList.length; v++) {\n\t\t\tcheck.put(vertexList[v].id,\n\t\t\t\t\tpq.enqueue(vertexList[v].id, Double.POSITIVE_INFINITY));\n\t\t}\n\t\tstart = System.currentTimeMillis();\n\t\t// allot cost 0 to initial node\n\t\tpq.decreaseKey(check.get(vertexList[source].id), 0.0);\n\n\t\twhile (!pq.isEmpty()) {\n\t\t\t// take the current node and get its minimum cost\n\t\t\tFHeap.Node current = pq.dequeueMin();\n\n\t\t\t// store the values in the table\n\t\t\tresult.put(current.getValue(), current.getCost());\n\n\t\t\t// update the costs\n\t\t\tfor (Neighbor nbr = vertexList[current.getValue()].adjList; nbr != null; nbr = nbr.next) {\n\n\t\t\t\t// edge is not added if shortest cost is known\n\t\t\t\tif (result.containsKey(vertexList[nbr.vertexNumber].id))\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// update cost to shortest\n\t\t\t\tFHeap.Node finalCost = check\n\t\t\t\t\t\t.get(vertexList[nbr.vertexNumber].id);\n\t\t\t\tif (nbr.weight < finalCost.getCost())\n\t\t\t\t\tpq.decreaseKey(finalCost, nbr.weight);\n\t\t\t}\n\t\t}\n\t\tstop = System.currentTimeMillis();\n\t\t// computing the time\n\t\ttime = stop - start;\n\n\t\t// calculate the MST cost\n\t\tfor (int i = 0; i < vertexList.length; i++) {\n\t\t\tsumHeapCost = (int) (sumHeapCost + result.get(i));\n\t\t}\n\t\t// for printing in case of input from file in fibonacci mode\n\t\n\t\t// System.out.println(sumHeapCost);\n\t}", "private List<Point> getPath(int index) {\n\t\t \n\t \n\t\t Node fromNode = oEdge.fromNode;\n\t\t Node toNode = oEdge.toNode;\n\t\t float x1 = fromNode.longitude;\n\t\t float x2 = toNode.longitude;\n\t\t float y1 = fromNode.latitude;\n\t\t float y2 = toNode.latitude;\n\t\t double slope, angle;\n\t\t if(x1!=x2) {\n\t\t\t slope = (y2-y1)/(x2-x1);\n\t\t\t \tangle = Math.atan(slope);\n\t\t\t \t} else {\n\t\t\t \t\tangle = Math.PI/2;\n\t\t\t \t}\n\t\t Double L = Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));\n\t\t float offsetPixels=0;\n\t\t if(Math.toDegrees(angle)>Math.toDegrees(90)) {\n\t\t\t if (index==0){\n\t\t\t\t offsetPixels=roadWidth*6/10;\n\t\t\t }\n\t\t\t else if(index==1){\n\t\t\t\t offsetPixels=roadWidth*11/10;\n\t\t\t }\n\t\t\t else if(index==-1){\n\t\t\t\t offsetPixels=roadWidth*1/10;\n\t\t\t }\n\t\t\t \n\t\t } else {\n\t\t\t \n\t\t\t if (index==0){\n\t\t\t\t offsetPixels=-roadWidth*6/10;\n\t\t\t }\n\t\t\t else if(index==1){\n\t\t\t\t offsetPixels=-roadWidth*11/10;\n\t\t\t }\n\t\t\t else if(index==-1){\n\t\t\t\t offsetPixels=-roadWidth*1/10;\n\t\t\t }\n\t\t }\n\t\t \n\t\t // This is the first parallel line\n\t\t float x1p1 = x1 + offsetPixels * (y2-y1) / L.floatValue();\n\t\t float x2p1 = x2 + offsetPixels * (y2-y1) / L.floatValue();\n\t\t float y1p1 = y1 + offsetPixels * (x1-x2) / L.floatValue();\n\t\t float y2p1 = y2 + offsetPixels * (x1-x2) / L.floatValue();\n//\t\t if(oEdge.edgeID==16) {\n//\t\t\t System.out.println(\"testing\");\n//\t\t }\n\t\t \n\t\t Point P1 = new Point(x1p1,y1p1);\n\t\t Point P2 = new Point(x2p1,y2p1);\n\t\t List<Point> gP = GetPoints(P1, P2);\n\t\t return gP;\n\t \n\t}", "public void setFrom(Vertex<VV> vertex)\r\n { this.from = vertex; }", "Iterable<Vertex> computePathToGraph(Loc start, Vertex end) throws GraphException;", "int getLineNumber();", "public void setStartVertex(int s) {\n\t\tstartVertex = s;\n\t}", "public int getStartLine() {\r\n \r\n return startLine;\r\n }", "public int getSourceLine(int pos) {\n unpack();\n int l = 0, r = line_number_table_length - 1;\n if (// array is empty\n r < 0)\n return -1;\n int min_index = -1, min = -1;\n /* Do a binary search since the array is ordered.\n */\n do {\n int i = (l + r) / 2;\n int j = line_number_table[i].getStartPC();\n if (j == pos)\n return line_number_table[i].getLineNumber();\n else if (// else constrain search area\n pos < j)\n r = i - 1;\n else\n // pos > j\n l = i + 1;\n /* If exact match can't be found (which is the most common case)\n * return the line number that corresponds to the greatest index less\n * than pos.\n */\n if (j < pos && j > min) {\n min = j;\n min_index = i;\n }\n } while (l <= r);\n /* It's possible that we did not find any valid entry for the bytecode\n * offset we were looking for.\n */\n if (min_index < 0)\n return -1;\n return line_number_table[min_index].getLineNumber();\n }", "public PixelPoint getStartPoint ()\r\n {\r\n Point start = glyph.getLag()\r\n .switchRef(\r\n new Point(getStart(), line.yAt(getStart())),\r\n null);\r\n\r\n return new PixelPoint(start.x, start.y);\r\n }", "List<V> getShortestPath(V vertex);", "public V getParent(V vertex);", "@Override\r\n\tpublic E getSingleSourcePredecessor(E key) {\r\n\t\tif(containsVertex(key) && vertices.get(key).getPredecessor() != null) {\r\n\t\t\treturn vertices.get(key).getPredecessor().getElement();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public void Djkstra(int source) {\n\t\tfor (int i = 0; i < vertices; i++) {\n\t\t\tdist[i] = Integer.MAX_VALUE; // added infinity to all ,\n\t\t}\n\t\t\n\t\tdist[source] = 0;\n\n\t\t// add source vertex to priority queue\n\t\tq.add(new Node(source, 0));\n\n\n\t\t// while my all vertices are not selected as a min among smallest one time\n\t\t// refracted in visited\n\t\twhile (visited.size() != vertices) {\n\n\t\t\t// pick from priority queue the smallest/min distance\n\t\t\tint i = q.remove().node;\n\n\t\t\t// once node is removed from queue add to set\n\t\t\tvisited.add(i);\n\n\t\t\t// relax adjacent vertex of this node;\n\t\t\t// And add the new node to queue bcoz distance has got updated so add new node as i dont have any method to update \n\t\t\t// already present node and its distance\n\t\t\t\n\n\t\t\tfor (Node v : graph[i]) {\n\t\t\t\tif (!visited.contains(v.node)) {\n\t\t\t\t\tif (dist[i] + v.cost < dist[v.node]) {\n\t\t\t\t\t\tdist[v.node] = dist[i] + v.cost;\n\t\t\t\t\t\tq.add(new Node(v.node, dist[v.node]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}", "public Line drawLine(double startx, double starty, double endx, double endy, int[][] vertices) throws IOException {\n int ind = 0;\n int[] coord = new int[4];\n while (ind < 36) {\n if (vertices[ind][0] <= startx && startx <= vertices[ind][1] && vertices[ind][2] >= starty && starty >= vertices[ind][3]) {\n coord[0] = vertices[ind][4];\n coord[1] = vertices[ind][5];\n return endVali(coord[0],coord[1],endx,endy,vertices);\n }\n ind++;\n }\n return null;\n }", "public void shortestPathsNodes() {\n for (int sourceNode = 0; sourceNode < wordGraph.V(); sourceNode++) {\n BreadthFirstDirectedPaths bfs = new BreadthFirstDirectedPaths(wordGraph, sourceNode);\n\n for (int goalNode = 0; goalNode < wordGraph.V(); goalNode++) {\n Iterable<Integer> shortestPath = bfs.pathTo(goalNode);\n int pathLength = -1;\n if (shortestPath != null) {\n for (int edge : shortestPath) {\n pathLength++;\n }\n }\n if (pathLength != -1) {\n }\n System.out.println(pathLength);\n }\n }\n }", "private List<routerNode> getPathVertexList(routerNode beginNode, routerNode endNode) {\r\n\t\tTransformer<routerLink, Integer> wtTransformer; // transformer for getting edge weight\r\n\t\twtTransformer = new Transformer<routerLink, Integer>() {\r\n public Integer transform(routerLink link) {\r\n return link.getWeight();\r\n \t}\r\n };\t\t\r\n\r\n\t\t\r\n\t\tList<routerNode> vlist;\r\n\t\tDijkstraShortestPath<routerNode, routerLink> DSPath = \r\n\t \t new DijkstraShortestPath<routerNode, routerLink>(gGraph, wtTransformer);\r\n \t// get the shortest path in the form of edge list \r\n List<routerLink> elist = DSPath.getPath(beginNode, endNode);\r\n\t\t\r\n \t\t// get the node list form the shortest path\r\n\t Iterator<routerLink> ebIter = elist.iterator();\r\n\t vlist = new ArrayList<routerNode>(elist.size() + 1);\r\n \tvlist.add(0, beginNode);\r\n\t for(int i=0; i<elist.size(); i++){\r\n\t\t routerLink aLink = ebIter.next();\r\n\t \t \t// get the nodes corresponding to the edge\r\n \t\tPair<routerNode> endpoints = gGraph.getEndpoints(aLink);\r\n\t routerNode V1 = endpoints.getFirst();\r\n\t routerNode V2 = endpoints.getSecond();\r\n\t \tif(vlist.get(i) == V1)\r\n\t \t vlist.add(i+1, V2);\r\n\t else\r\n\t \tvlist.add(i+1, V1);\r\n\t }\r\n\t return vlist;\r\n\t}", "public Pair<Integer, Map<Vertex, Vertex>> ShortestDistance(Vertex source, Vertex zink) {\n Map<Vertex, Vertex> PredecessorMap = new HashMap<>();\n Map<Vertex, Integer> DistanceMap = new HashMap<>();\n Vertex a;\n // initialize arrays\n for (Vertex v : Vertices) {\n DistanceMap.put(v, 1000); //We initialize the array in infinite\n PredecessorMap.put(v, null);\n }\n DistanceMap.put(source, 0); //We put the source in 0\n for (Vertex v : Vertices) {\n while (!DistanceMap.isEmpty()) { //And we iterate until the distance map is empty\n a = getmin(DistanceMap); //we get the minimum vertex\n if(a==null) {\n return (new Pair<Integer, Map<Vertex, Vertex>>(DistanceMap.get(zink), PredecessorMap));\n }\n\n ArrayList<Edge> edges = a.getOutEdges(); //we get de edges connected to this vertex\n for (Edge e : edges) { //we iterate getting the vertex of each edge\n if (DistanceMap.containsKey(e.tovertex)) { //if the vertex is in the distance map:\n Integer alt = DistanceMap.get(a) + e.distance; //we get it value and plus the distance of the edge\n\n System.out.println(\"This is the distance going out from that Vertex: \" + alt + \", with previous distance: \" + DistanceMap.get(e.tovertex));\n if (alt < DistanceMap.get(e.tovertex)) { //if it is less, we put it in the arrays\n DistanceMap.put(e.tovertex, alt);\n PredecessorMap.put(e.tovertex, a);\n\n }\n }\n }\n DistanceMap.remove(a); //and we remove it of the array\n }\n }\n return (new Pair<Integer, Map<Vertex, Vertex>>(DistanceMap.get(zink), PredecessorMap));\n }", "public int getStartLine() {\r\n return this.startLine;\r\n }", "private void dfs(String source) {\n visited.add(source);\n\n System.out.println(source);\n\n for (Object vertex : graph.get(source)) {\n if (!visited.contains(vertex))\n dfs((String) vertex);\n }\n }", "public int getLineNumber();", "public int[] getDijkstraSP(int source) {\n\t\tint[] distance = new int[this.v];\n\t\tArrays.fill(distance, Integer.MAX_VALUE);\n\t\tdistance[source] = 0;\n\t\tQueue<Distance> q = new LinkedList<>();//new PriorityQueue<>();\n\t\tq.add(new Distance(source, 0));\n\t\t\n\t\tboolean[] visited = new boolean[this.v];\n\t\t\t\t\n\t\twhile(!q.isEmpty()) {\n\t\t\tDistance e = q.poll();\n\t\t\tif(visited[e.vertex]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvisited[e.vertex] = true;\n\t\t\t\n\t\t\tList<Edge> list = this.edges.get(e.vertex);\n\t\t\tfor(Edge adjEdge : list) {\n\t\t\t\tif((long)distance[adjEdge.from] + adjEdge.weight < distance[adjEdge.to]) {\n\t\t\t\t\tdistance[adjEdge.to] = distance[adjEdge.from] + adjEdge.weight;\n\t\t\t\t\tq.add(new Distance(adjEdge.to, distance[adjEdge.to]));\n\t\t\t\t\t//System.out.println(Arrays.toString(distance));\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn distance;\n\t}", "public ArrayList<PathXNode> generatePath(PathXNode destination)throws VertexNotFoundException{\r\n \r\n String destState = destination.getState();\r\n if (destState.indexOf(\"MOUSE_OVER\") >= 0)\r\n destState = destState.substring(0, destState.indexOf(\"_MOUSE_OVER\"));\r\n \r\n if (path != null && !path.isEmpty())\r\n return null;\r\n \r\n Graph graph = getLevel().getGraph();\r\n \r\n //The shortest path from the current intersection/vertex to the destination\r\n //intersection/vertex as an ArrayList of vertices.\r\n ArrayList<Vertex> shortestPath = graph.findPath(getIntersection().getVertex(), destination.getVertex());\r\n \r\n ArrayList<PathXNode> newPath = new ArrayList();\r\n \r\n //Convert the shortestPath ArrayList of Vertices to PathXNodes.\r\n ArrayList<PathXNode> nodes = getLevel().getDataModel().getNodes();\r\n for (Vertex v : shortestPath){\r\n for (PathXNode node : nodes)\r\n if (node.getVertex() == v){\r\n newPath.add(node);\r\n break;\r\n }\r\n }\r\n \r\n \r\n newPath.remove(0);\r\n \r\n //Highlight the nodes.\r\n for (PathXNode node : newPath)\r\n node.setState(node.getState() + \"_HIGHLIGHTED\");\r\n \r\n destination.setState(destState + \"_HIGHLIGHTED\");\r\n if (newPath != null && !newPath.isEmpty()) {\r\n targetX = newPath.get(0).getConstantXPos();\r\n targetY = newPath.get(0).getConstantYPos();\r\n }\r\n return newPath; \r\n }", "void prim(AdjacencyLists g, int start)\r\n\t{\r\n\t\t// whether the node is in the tree or not.\r\n\t\tboolean[] intree = new boolean[g.nvertices];\r\n\t\t\r\n\t\t// the cost of adding the edge to the tree\r\n\t\tint[] distance = new int[g.nvertices];\r\n\t\t\r\n\t\tint[] parent = new int[g.nvertices]; \r\n\t\t\r\n\t\tfor (int i = 0; i < g.nvertices; ++i) {\r\n\t\t\tintree[i] = false;\r\n\t\t\tdistance[i] = Integer.MAX_VALUE;\r\n\t\t\tparent[i] = -1;\r\n\t\t}\r\n\t\t\r\n\t\tdistance[start] = 0;\r\n\t\t\r\n\t\t// current vertex to process\r\n\t\tint v = start;\r\n\t\t// candidate next vertex\r\n\t\tint w; \r\n\t\t// edge weight\r\n\t\tint weight;\r\n\t\t// best current distance from start\r\n\t\tint dist;\r\n\t\t\r\n\t\twhile (!intree[v]) {\r\n\t\t\tintree[v] = true;\r\n\t\t\t\r\n\t\t\tEdgeNode p = g.edges[v];\r\n\t\t\t\r\n\t\t\t// for each node w that is not in the tree\r\n\t\t\t// identify the lowest cost\r\n\t\t\twhile (p != null) {\r\n\t\t\t\tw = p.y;\r\n\t\t\t\tweight = p.weight;\r\n\t\t\t\tif (!intree[w] && distance[w] > weight) {\r\n\t\t\t\t\t// pick the edge that is lowest cost from v.\r\n\t\t\t\t\tdistance[w] = weight;\r\n\t\t\t\t\tparent[w] = v;\r\n\t\t\t\t}\r\n\t\t\t\tp = p.next;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// find the node that is not in the list, \r\n\t\t\t// and has the smallest distance value.\r\n\t\t\tv = 0;\r\n\t\t\tdist = Integer.MAX_VALUE;\r\n\t\t\tfor (int i = 0; i < g.nvertices; ++i) {\r\n\t\t\t\tif (!intree[i] && dist > distance[i]) {\r\n\t\t\t\t\tdist = distance[i];\r\n\t\t\t\t\tv = i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public PointRelation pointLineRelation(Coordinates point, Coordinates linePointA, Coordinates linePointB);", "@Override\n\tpublic List<node_data> shortestPath(int src, int dest) {\n\t\tList<node_data> ans = new ArrayList<>();\n\t\tthis.shortestPathDist(src, dest);\n\t\tif(this.GA.getNode(src).getWeight() == Integer.MAX_VALUE || this.GA.getNode(dest).getWeight() == Integer.MAX_VALUE){\n\t\t\tSystem.out.print(\"There is not a path between the nodes.\");\n\t\t\treturn null;\n\t\t}\n\t\tgraph copied = this.copy();\n\t\ttransPose(copied);\n\t\tnode_data first = copied.getNode(dest);\n\t\tans.add(first);\n\t\twhile (first.getKey() != src) {\n\t\t\tCollection<edge_data> temp = copied.getE(first.getKey());\n\t\t\tdouble check= first.getWeight();\n\t\t\tif(temp!=null) {\n\t\t\t\tfor (edge_data edge : temp) {\n\t\t\t\t\tif (copied.getNode(edge.getDest()).getWeight() + edge.getWeight() == check) {\n\t\t\t\t\t\tfirst = copied.getNode(edge.getDest());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tans.add(first);\n\t\t}\n\t\tList<node_data> ans2 = new ArrayList<>();\n\t\tfor (int i = ans.size()-1;i>=0;i--){\n\t\t\tans2.add(ans.get(i));\n\t\t}\n\t\treturn ans2;\n\t}", "public void computeAllPaths(String source)\r\n {\r\n Vertex sourceVertex = network_topology.get(source);\r\n Vertex u,v;\r\n double distuv;\r\n\r\n Queue<Vertex> vertexQueue = new PriorityQueue<Vertex>();\r\n \r\n \r\n // Switch between methods and decide what to do\r\n if(routing_method.equals(\"SHP\"))\r\n {\r\n // SHP, weight of each edge is 1\r\n sourceVertex.minDistance = 0;\r\n vertexQueue.add(sourceVertex);\r\n while(!vertexQueue.isEmpty())\r\n {\r\n u = vertexQueue.remove();\r\n for (String key : u.adjacentVertices.keySet())\r\n {\r\n v = network_topology.get(key);\r\n distuv = u.minDistance + 1;\r\n if(distuv < v.minDistance)\r\n {\r\n v.minDistance = distuv;\r\n v.previous = u;\r\n vertexQueue.add(v);\r\n }\r\n }\r\n \r\n }\r\n \r\n }\r\n \r\n else if (routing_method.equals(\"SDP\"))\r\n {\r\n // SDP, weight of each edge is it's propagation delay\r\n sourceVertex.minDistance = 0;\r\n vertexQueue.add(sourceVertex);\r\n while(!vertexQueue.isEmpty())\r\n {\r\n u = vertexQueue.remove();\r\n for (String key : u.adjacentVertices.keySet())\r\n {\r\n v = network_topology.get(key);\r\n distuv = u.minDistance + u.adjacentVertices.get(key).propDelay;\r\n if(distuv < v.minDistance)\r\n {\r\n v.minDistance = distuv;\r\n v.previous = u;\r\n vertexQueue.add(v);\r\n }\r\n } \r\n }\r\n }\r\n else if (routing_method.equals(\"LLP\"))\r\n {\r\n // LLP, weight each edge is activeCircuits/AvailableCircuits\r\n sourceVertex.minDistance = 0;\r\n vertexQueue.add(sourceVertex);\r\n while(!vertexQueue.isEmpty())\r\n {\r\n u = vertexQueue.remove();\r\n for (String key : u.adjacentVertices.keySet())\r\n {\r\n v = network_topology.get(key);\r\n distuv = Math.max(u.minDistance,u.adjacentGet(key).load());\r\n //System.out.println(u.adjacentGet(key).load());\r\n if(distuv < v.minDistance)\r\n {\r\n v.minDistance = distuv;\r\n v.previous = u;\r\n vertexQueue.add(v);\r\n }\r\n }\r\n }\r\n }\r\n }", "public Set<Vertex> pre(Vertex start){\n\t\tSet<Vertex> reach = new HashSet<Vertex>();\n\t\tif(this.edgesByEnd.get(start) == null)\n\t\t\treturn reach;\n\t\tfor(LabeledEdge trans : this.edgesByEnd.get(start)){\n\t\t\treach.add(trans.getStart());\n\t\t}\n\t\treturn reach;\n\t}", "public void depthFirstTraversal(final int startPoint) {\n\t\tfinal boolean[] isVerticesVisited = new boolean[adjacencyList.length];\n\n\t\tfinal Stack<Integer> stack = new Stack<>();\n\n\t\tstack.push(startPoint);\n\n\t\tint selectedVertice;\n\t\tint vertice;\n\t\twhile (!stack.isEmpty()) {\n\t\t\tselectedVertice = stack.peek();\n\t\t\tstack.pop();\n\n\t\t\tif (!isVerticesVisited[selectedVertice]) {\n\t\t\t\tSystem.out.print(selectedVertice + \" \");\n\t\t\t\tisVerticesVisited[selectedVertice] = true;\n\t\t\t}\n\n\t\t\tIterator<Integer> edgeIterator = adjacencyList[selectedVertice].listIterator();\n\n\t\t\twhile (edgeIterator.hasNext()) {\n\t\t\t\tvertice = edgeIterator.next();\n\t\t\t\tif (!isVerticesVisited[vertice]) {\n\t\t\t\t\tstack.push(vertice);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public List<node_info> shortestPath(int src, int dest);", "public static int p413ComputeShortestPathNumber(Vertex start, Vertex end){\n\t Queue<Vertex> queue=new LinkedList<Vertex>();\n\t Map<Vertex, Status> statusMap=new HashMap<Vertex, Status>();\n\t Map<Vertex, Integer> levelMap=new HashMap<Vertex, Integer>();\n\t List<List<Vertex>> allLevelList=new LinkedList<List<Vertex>>();\n\t \n\t queue.offer(start);\n\t statusMap.put(start, Status.Queued);\n\t levelMap.put(start, 0);\n\t \n\t Vertex vertex;\n\t int lastLevel=-1;\n\t List<Vertex> levelList = null;\n\t\twhile ((vertex = queue.poll()) != null) {\n\t\t\tint currentLevel = levelMap.get(vertex);\n\n\t\t\tif (currentLevel != lastLevel) {\n\t\t\t\tlastLevel = currentLevel;\n\t\t\t\tlevelList = new LinkedList<Vertex>();\n\n\t\t\t\tallLevelList.add(levelList);\n\t\t\t}\n\n\t\t\tlevelList.add(vertex);\n\n\t\t\tif (vertex.equals(end)) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tSet<Vertex> adjacentVertexes = vertex.getAdjacentVertexes();\n\t\t\tfor (Iterator iterator = adjacentVertexes.iterator(); iterator.hasNext();) {\n\t\t\t\tVertex adjacent = (Vertex) iterator.next();\n\n\t\t\t\tif (statusMap.get(adjacent) == null) {\n\t\t\t\t\tqueue.offer(adjacent);\n\t\t\t\t\tstatusMap.put(adjacent, Status.Queued);\n\t\t\t\t\tlevelMap.put(adjacent, currentLevel + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t \n\t int max=Integer.MIN_VALUE;\n\t List<Vertex> targetList=new LinkedList<Vertex>();\n\t targetList.add(end);\n\t for(int index=lastLevel-1;index>0;index--){\n\t\t List<Vertex> lastLevelList = allLevelList.get(index);\n\t\t List<Vertex> tmpList=new LinkedList<Vertex>();\n\n\t\t int count=0;\n\t\t for (Iterator iterator = lastLevelList.iterator(); iterator.hasNext();) {\n\t\t\t\tVertex lastLevelVertex = (Vertex) iterator.next();\n\t\t\t\tfor (Iterator iterator2 = targetList.iterator(); iterator2.hasNext();) {\n\t\t\t\t\tVertex vertex2 = (Vertex) iterator2.next();\n\t\t\t\t\tif(lastLevelVertex.getAdjacentVertexes().contains(vertex2)){\n\t\t\t\t\t count++;\n\t\t\t\t\t tmpList.add(lastLevelVertex);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t }\n\t\t \n\t\t targetList=tmpList;\n\t\t \n\t\t if(count>max){\n\t\t \tmax=count;\n\t\t }\n\t }\n\t \n\t return max;\n\t}", "private ArrayList<Integer> getAugmentingPath(){\n Queue<Integer> queue = new LinkedList<Integer>();\n int[] pre = new int[network.V()];\n Arrays.fill(pre, -1);\n\n queue.add(source);\n pre[source] = source;\n while(!queue.isEmpty()){\n int cur = queue.poll();\n if(cur == sink) break; // find one augmentation\n for(int nei : residualGraph.adj(cur)){\n if(pre[nei] == -1 && residualGraph.getWeight(cur, nei) > 0){\n pre[nei] = cur;\n queue.add(nei);\n }\n }\n }\n ArrayList<Integer> res = new ArrayList<>();\n if(pre[sink] == -1) return res; // no augmentation path\n\n int cur = sink;\n while(cur != source){\n res.add(cur);\n cur = pre[cur];\n }\n res.add(source);\n Collections.reverse(res);\n return res;\n }", "public void iterativeDfs(Graph graph, int sourceVertex) {\n\n stack.addLast(sourceVertex);\n\n while (!stack.isEmpty()) {\n int vertex = stack.removeLast();\n\n if (!marked[vertex]) {\n sourceVertexCount++;\n marked[vertex] = true;\n\n for (int adjacentVertex : graph.adj(vertex)) {\n if (!marked[adjacentVertex]) {\n stack.addLast(adjacentVertex);\n }\n }\n }\n }\n }", "@Pure\n public int getStartLine() {\n return this.startLine;\n }", "public static void calculateMinimumDistance(Node evaluationNode, Integer edgeWeigh, Node sourceNode) {\n Integer sourceDistance = sourceNode.distance;\n if (sourceDistance + edgeWeigh < evaluationNode.distance) {\n evaluationNode.distance = sourceDistance + edgeWeigh;\n LinkedList<Node> shortestPath = new LinkedList<>(sourceNode.shortestPath);\n shortestPath.add(sourceNode);\n evaluationNode.shortestPath = shortestPath;\n }\n }", "public int line_of(int index) throws Exception {\r\n\t\tif (index < 0 || index >= text.length()) {\r\n\t\t\tthrow new IndexOutOfBoundsException(\"Invalid index: \" + index);\r\n\t\t} else {\r\n\t\t\t// binary-search\r\n\t\t\tint s = 0, e = line_index.size();\r\n\t\t\twhile (s < e) {\r\n\t\t\t\tint m = (s + e) / 2;\r\n\t\t\t\tint head = line_index.get(m);\r\n\t\t\t\tint tail;\r\n\t\t\t\ttail = line_index.get(m + 1);\r\n\r\n\t\t\t\tif (index >= tail)\r\n\t\t\t\t\ts = m + 1;\r\n\t\t\t\telse if (index < head)\r\n\t\t\t\t\te = m;\r\n\t\t\t\telse\r\n\t\t\t\t\treturn m + 1;\r\n\t\t\t}\r\n\r\n\t\t\t// No target is found, this is impossible.\r\n\t\t\tthrow new RuntimeException(\"Internal error: no line is found for \" + index);\r\n\t\t}\r\n\t}", "Iterable<Vertex> computePath(Vertex start, Vertex end) throws GraphException;", "public int getPointLineOnScreen(float y){\n return Math.min(getPointLine(y + getOffsetY()),getLineCount() - 1);\n }", "public VertexIterator(Iterator<PointF> source)\n {\n this.source = source;\n }", "public ArrayList<Vertex> gpsrPath(int sourceIndex, int sinkIndex) {\r\n ArrayList<Vertex> locationcopy;\r\n \tlocationcopy=new ArrayList<Vertex>(location);\r\n \tint currentIndex, nearestIndex;\r\n \tdouble bestdist,dist;\r\n \tArrayList<Vertex> GPSRpath;\r\n \tGPSRpath= new ArrayList<Vertex>(0);\r\n \tcurrentIndex=sourceIndex;\r\n \tVertex sourcenode, sinknode, currentnode, nearestnode;\r\n \tsourcenode=locationcopy.get(sourceIndex);\r\n \tsinknode=locationcopy.get(sinkIndex);\r\n \tdist=bestdist=sourcenode.distance(sinknode);\r\n \tGPSRpath.add(sourcenode);\r\n \tint i;\r\n\t\t\r\n \twhile(true)\r\n \t{\r\n \t\tcurrentnode=locationcopy.get(currentIndex);\r\n \t\tnearestIndex=currentIndex;\r\n \tfor(i=0;i<locationcopy.size();i++)\r\n \t{\r\n \t\tif(locationcopy.get(i).distance(currentnode)<=transmissionRange)\r\n \t\t{\r\n \t\t\tif(bestdist>(dist=locationcopy.get(i).distance(sinknode))) \r\n \t\t\t\t{\r\n \t\t\t\tbestdist=dist;\r\n \t\t\t\tnearestIndex=i;\r\n \t\t\t\t}\t\r\n \t\t\tif(dist==0) break;\r\n \t\t}\t\t\r\n \t}\r\n \tif(nearestIndex!=currentIndex)\r\n \t{\r\n \t\tnearestnode=locationcopy.get(nearestIndex);\r\n \t\tGPSRpath.add(nearestnode);\r\n \t\tif(dist==0) return GPSRpath;\r\n \t\tlocationcopy.remove(currentIndex);\r\n \t\tif(sinkIndex>currentIndex) sinkIndex-=1;\r\n \t\tif(nearestIndex>currentIndex) currentIndex=nearestIndex-1; else currentIndex=nearestIndex;\r\n \t\t//currentIndex=locationcopy.indexOf(nearestnode);\r\n \t\t//sinkIndex=locationcopy.indexOf(sinknode);\r\n \t}\r\n \telse return new ArrayList<Vertex>(0);\r\n \t}\r\n }", "public int getLineNumber (\n Object annotation,\n Object timeStamp\n ) {\n if (annotation instanceof LineBreakpoint) {\n // A sort of hack to be able to retrieve the original line.\n LineBreakpoint lb = (LineBreakpoint) annotation;\n return LineTranslations.getTranslations().getOriginalLineNumber(lb, timeStamp);\n }\n /*if (annotation instanceof Object[]) {\n // A sort of hack to be able to retrieve the original line.\n Object[] urlLine = (Object[]) annotation;\n String url = (String) urlLine[0];\n int line = ((Integer) urlLine[1]).intValue();\n return LineTranslations.getTranslations().getOriginalLineNumber(url, line, timeStamp);\n }*/\n DebuggerAnnotation a = (DebuggerAnnotation) annotation;\n if (timeStamp == null) \n return a.getLine ().getLineNumber () + 1;\n String url = (String) annotationToURL.get (a);\n Line.Set lineSet = LineTranslations.getTranslations().getLineSet (url, timeStamp);\n return lineSet.getOriginalLineNumber (a.getLine ()) + 1;\n }", "private int[] prim(int startNode) {\n int[] attachmentCost = new int[numNodes]; // The minimum distance from each node to MST set\n int[] visitedNodes = new int[numNodes]; // The order of visited node\n int[] parents = new int[numNodes]; // The closest node from MST set to each node\n\n // Keep track of the order of attaching nodes.\n int attachingSequence = 0;\n\n Arrays.fill(parents, startNode);\n\n for (int i = 0; i < numNodes; i++) {\n // MST set only has startNode\n attachmentCost[i] = matrix[startNode][i];\n\n // Set all nodes unvisited\n visitedNodes[i] = -1;\n }\n\n // Put startNode into MST set as the root of the tree\n visitedNodes[startNode] = attachingSequence;\n\n for (int i = 0; i < numNodes - 1; i++) {\n int minCost = Integer.MAX_VALUE;\n int attachingNode = -1;\n\n // Find the minimum cost edge and corresponding node connected to MST set\n for (int j = 0; j < numNodes; j++) {\n if (visitedNodes[j] == -1 && attachmentCost[j] < minCost) {\n minCost = attachmentCost[j];\n attachingNode = j;\n }\n }\n\n if (attachingNode != -1) {\n visitedNodes[attachingNode] = ++attachingSequence;\n\n // Update attachmentCost for each node\n for (int j = 0; j < numNodes; j++) {\n if (visitedNodes[j] == -1 && matrix[attachingNode][j] >= 0 && matrix[attachingNode][j] < attachmentCost[j]) {\n attachmentCost[j] = matrix[attachingNode][j];\n parents[j] = attachingNode;\n }\n }\n }\n }\n return parents;\n }", "public E getParentEdge(V vertex);", "public int getStartLineNumber() {\n return startLineNumber_;\n }", "private void printPath(int currentVertex, int[] parents) {\n // Base case : Source node has been processed \n if (currentVertex == NO_PARENT) {\n return;\n }\n printPath(parents[currentVertex], parents);\n System.out.print(currentVertex + \" \");\n }", "@Override\r\n\tpublic VertexInterface<T> getPredecessor() {\n\t\treturn null;\r\n\t}", "public int[] shortestReach(int startId) {\n System.out.println(\"Graph with startId: \"+startId);\n for(int i=0 ; i<size ; i++){\n for(int j=0 ; j<size ; j++){\n System.out.print(graph[i][j]);\n }\n System.out.println(\"\");\n }\n\n int[] dist = new int[size];\n boolean[] srg = new boolean[size];\n\n //intialize dist and srg\n for(int i=0 ; i<size ; i++){\n dist[i] = Integer.MAX_VALUE;\n srg[i] = false;\n }\n\n //Start node\n dist[startId] = 0;\n\n for(int i=0 ; i<size ; i++){\n int u = minDist(dist, srg);\n\n srg[u] = true;\n\n for( int v=0; v<size ; v++){\n if(!srg[v] && graph[u][v]!=0 && dist[u]!=Integer.MAX_VALUE && dist[u] + graph[u][v] < dist[v]){\n dist[v] = dist[u] + graph[u][v];\n }\n }\n }\n\n int[] result = new int[size-1];\n int indx = 0;\n for(int i=0 ; i<size ; i++){\n if(i != startId){\n if(dist[i] == Integer.MAX_VALUE)\n result[indx] = -1;\n else{\n result[indx] = dist[i];\n }\n indx++;\n }\n\n }\n\n return result;\n }", "@Override\n public List<node_data> shortestPath(int src, int dest) {\n reset();\n for (node_data node : G.getV()) {\n node.setWeight(Double.POSITIVE_INFINITY);\n }\n\n DWGraph_DS.Node currentNode = (DWGraph_DS.Node) G.getNode(src);\n currentNode.setWeight(0);\n PriorityQueue<node_data> unvisitedNodes = new PriorityQueue(G.nodeSize(), weightComperator);\n unvisitedNodes.addAll(G.getV());\n HashMap<Integer, node_data> parent = new HashMap<>();\n parent.put(src, null);\n\n while (currentNode.getWeight() != Double.POSITIVE_INFINITY) {\n if (G.getNode(dest).getTag() == 1) {\n break;\n }\n for (edge_data edge : G.getE(currentNode.getKey())) {\n DWGraph_DS.Node neighbor = (DWGraph_DS.Node) G.getNode(edge.getDest());\n double tmpWeight = currentNode.getWeight() + edge.getWeight();\n if (tmpWeight < neighbor.getWeight()) {\n neighbor.setWeight(tmpWeight);\n unvisitedNodes.remove(neighbor);\n unvisitedNodes.add(neighbor);\n parent.put(neighbor.getKey(), currentNode);\n }\n }\n currentNode.setTag(1);\n if(currentNode.getKey()==dest) break;\n unvisitedNodes.remove(currentNode);\n currentNode = (DWGraph_DS.Node) unvisitedNodes.poll();\n }\n /*\n Rebuild the path list\n */\n if (!parent.keySet().contains(dest)) return null;\n List<node_data> pathList = new ArrayList<>();\n currentNode = (DWGraph_DS.Node) G.getNode(dest);\n while (parent.get(currentNode.getKey()) != null) {\n pathList.add(currentNode);\n currentNode = (DWGraph_DS.Node) parent.get(currentNode.getKey());\n }\n Collections.reverse(pathList);\n return pathList;\n }", "protected static GraphTraversalSource g() {\n return VertexCacheProvider.get().getFullGraph();\n }", "private int getLineNumber() {\n int line = 0;\n if (_locator != null)\n line = _locator.getLineNumber();\n return line;\n }", "private int getInclusiveTopIndexStartOffset() {\n \n \t\tif (fTextWidget != null && !fTextWidget.isDisposed()) {\n \t\t\tint top= -1;\n \t\t\tif (fSourceViewer instanceof ITextViewerExtension5) {\n \t\t\t\ttop= fTextWidget.getTopIndex();\n \t\t\t\tif ((fTextWidget.getTopPixel() % fTextWidget.getLineHeight()) != 0)\n \t\t\t\t\ttop--;\n \t\t\t\tITextViewerExtension5 extension= (ITextViewerExtension5) fSourceViewer;\n \t\t\t\ttop= extension.widgetLine2ModelLine(top);\n \t\t\t} else {\n \t\t\t\ttop= fSourceViewer.getTopIndex();\n \t\t\t\tif ((fTextWidget.getTopPixel() % fTextWidget.getLineHeight()) != 0)\n \t\t\t\t\ttop--;\n \t\t\t}\n \n \t\t\ttry {\n \t\t\t\tIDocument document= fSourceViewer.getDocument();\n \t\t\t\treturn document.getLineOffset(top);\n \t\t\t} catch (BadLocationException x) {\n \t\t\t}\n \t\t}\n \n \t\treturn -1;\n \t}", "public abstract void lineTo(double x, double y);", "@Override\n public int findLowerCostPath(City src, City dest) {\n List<City> cityList = new ArrayList<>(cityManager.getAll());\n int[] travelCosts = new int[cityList.size()]; // accumulate minimum travel costs through each city\n boolean[] exploredCity = new boolean[cityList.size()];\n int currCityId = src.getId();\n Arrays.fill(travelCosts, INF); //All travel costs are INF\n travelCosts[currCityId - 1] = 0; //except src\n\n //Iterate\n for (int i = 0; i < cityList.size(); i++) {\n int minCost = INF;\n // if we get destination, ignore, it will be last explored city\n if (currCityId != dest.getId())\n exploredCity[currCityId - 1] = true;\n //find all paths of city to iterate\n Set<Path> paths = findAllPaths(cityList.get(currCityId - 1));\n for (Path path : paths) {\n if (exploredCity[path.getDestId() - 1])\n continue;\n //if from city cost + path cost < to city cost, then assign new value\n if (path.getCost() + travelCosts[path.getSrcId() - 1] < travelCosts[path.getDestId() - 1]) {\n travelCosts[path.getDestId() - 1] = travelCosts[path.getSrcId() - 1] + path.getCost();\n }\n //find minimum path cost of cur city\n if (path.getCost() < minCost) {\n minCost = path.getCost();\n currCityId = path.getDestId();\n }\n }\n //to find remaining not explored cities\n if (minCost == INF) {\n for (int j = 0; j < exploredCity.length; j++) {\n if (!exploredCity[j] && dest.getId() != (j + 1) && travelCosts[j] != INF) {\n currCityId = j + 1;\n }\n }\n }\n }\n //last explored city is destination\n exploredCity[dest.getId() - 1] = true;\n\n return travelCosts[dest.getId() - 1];\n }", "public void findStrongestPathsFromFile(String filename){\n\n try {\n\n finputStream = new FileInputStream(filename);\n\n fileScanner = new Scanner(finputStream);\n\n String sourceVertex = fileScanner.nextLine();\n\n IVertex<String> source = this.weightedGraph.getVertex(sourceVertex);\n\n if(source == null){\n throw new Exception(\"Invalid Source Vertex found\");\n }\n\n this.findAllPahtsInGraphWithSource(source);\n\n fileScanner.nextLine(); // Empty line read out.. and ignore\n\n foutStream = new FileOutputStream(this.outputFileName); // open the file for writing\n\n while(fileScanner.hasNextLine()){\n\n try {\n\n String nodeNext = fileScanner.nextLine();\n\n IVertex<String> targetNode = this.weightedGraph.getVertex(nodeNext);\n\n if(targetNode!=null && distance.get(targetNode)!=null) {\n\n String lineout = sourceVertex + \"\\t\" + nodeNext + \" \\t \" + Double.toString(\n distance.get(targetNode)) + \" : \";\n\n lineout += printablePath(targetNode);\n\n lineout += \"\\r\\n\";\n\n foutStream.write(lineout.getBytes());\n }\n\n }catch(Exception ex){\n ex.printStackTrace();\n }\n }\n\n foutStream.close();\n\n finputStream.close();\n\n }catch(Exception ex){\n ex.printStackTrace();\n }\n }", "public static <G extends BaseWeightedGraph<V,E,W>,V,E extends WeightedEdge<V,W>, W extends Number & Comparable<W>> List<E> findShortestPathInt(G graph, V source, V sink){\r\n\t\t// check graph contains source and sink\r\n\t\tSet<V> vertecies = graph.getVertices();\r\n\t\tif( !(vertecies.contains(source) && vertecies.contains(sink)) ){\r\n\t\t\tthrow new IllegalArgumentException(\"BaseGraph must contain both source and sink\");\r\n\t\t}\r\n\t\t\r\n\t\tPriorityQueue<WeightedPathChain<V,E,W,Integer>> pq = new PriorityQueue<WeightedPathChain<V,E,W,Integer>>(); \r\n\t\tHashSet<V> checked = new HashSet<V>();\r\n\t\tHashMap<V,WeightedPathChain<V,E,W,Integer>> map = new HashMap<V,WeightedPathChain<V,E,W,Integer>>();\r\n\t\taddOrUpdate(map,pq,source,Integer.valueOf(0));\r\n\t\twhile(!pq.isEmpty()&&!sink.equals(pq.peek().vertex)){\r\n\t\t\tWeightedPathChain<V,E,W,Integer> current = pq.poll(); // poll lowest level vertex\r\n\t\t\tchecked.add(current.vertex); // add vertex to checked set\r\n\t\t\tfor (E edge :graph.getOutgoingEdges(current.vertex)){\t// for each outgoing edge \r\n\t\t\t\tif(!checked.contains(edge.getOpposingVertex(current.vertex))){\t\t// if opposing vertex has not been checked \r\n\t\t\t\t\taddOrUpdate(map,\r\n\t\t\t\t\t\t\t\tpq,\r\n\t\t\t\t\t\t\t\tedge.getOpposingVertex(current.vertex),\r\n\t\t\t\t\t\t\t\tInteger.valueOf(map.get(current.vertex).val+edge.getWeight().intValue() ) ,\r\n\t\t\t\t\t\t\t\tedge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tArrayList<V> path = new ArrayList<V>(); // vertex path \r\n\t\tArrayList<E> edgePath = new ArrayList<E>(); // edge path\r\n\t\tboolean run = true; \r\n\t\tif(!pq.isEmpty()&&pq.peek().vertex.equals(sink)) { // \r\n\t\t\tWeightedPathChain<V,E,W,Integer> vv = pq.poll();\r\n\t\t\tpath.add(vv.vertex);\r\n\t\t\tedgePath.add(vv.edge);\r\n\t\t\twhile(run) {\r\n\t\t\t\tvv = map.get(vv.edge.getOpposingVertex(vv.vertex));\r\n\t\t\t\tif(vv.vertex.equals(source)) {\r\n\t\t\t\t\trun=false;\r\n\t\t\t\t\tpath.add(vv.vertex);\r\n\t\t\t\t}\r\n\t\t\t\telse {\t\r\n\t\t\t\t\tedgePath.add(vv.edge);\r\n\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//return path;\r\n\t\t\r\n\t\tCollections.reverse(edgePath);\r\n\t\treturn edgePath;\r\n\t}", "public int getFirstVisibleLine(){\n int j = Math.min(getOffsetY() / getLineHeight(), getLineCount() - 1);\n if(j < 0){\n return 0;\n }else{\n return j;\n }\n }", "@Override\n public abstract SourcePoint getSourcePoint();", "List<Integer> lineOffsets();", "private PathCostFlow findCheapestPath(int start, int end, double max_flow) throws Exception {\n if (getNode(start) == null || getNode(end) == null\n || !getNode(start).isSource() || getNode(end).isSource()) {\n throw new IllegalArgumentException(\"start must be the index of a source and end must be the index of a sink\");\n }\n double amount = Math.min(Math.min(getNode(start).getResidualCapacity(),\n getNode(end).getResidualCapacity()), max_flow);\n\n boolean[] visited = new boolean[n];\n int[] parent = new int[n];\n for (int i = 0; i < n; i++) {\n parent[i] = -1;\n }\n double[] cost = new double[n];\n for (int i = 0; i < n; i++) {\n cost[i] = Integer.MAX_VALUE;\n }\n cost[start] = 0;\n\n PriorityQueue<IndexCostTuple> queue = new PriorityQueue<IndexCostTuple>();\n queue.add(new IndexCostTuple(start, 0));\n\n while (!queue.isEmpty()) {\n IndexCostTuple current = queue.poll();\n\n // we found the target node\n if (current.getIndex() == end) {\n ArrayList<Integer> path = new ArrayList<Integer>();\n path.add(new Integer(end));\n while (path.get(path.size() - 1) != start) {\n path.add(parent[path.get(path.size() - 1)]);\n }\n Collections.reverse(path);\n if ((path.get(0) != start) || (path.get(path.size() - 1) != end)) {\n throw new Exception(\"I fucked up coding Dijkstra's\");\n }\n return new PathCostFlow(path, cost[end], amount);\n }\n\n // iterate through all possible neighbors of the current node\n for (int i = 0; i < n; i++) {\n SingleEdge e = matrix[current.getIndex()][i];\n if ((!visited[i]) && (e != null)\n && (current.getCost() + e.getCost(amount) < cost[i])) {\n cost[i] = current.getCost() + e.getCost(amount);\n parent[i] = current.getIndex();\n\n // update the entry for this node in the queue\n IndexCostTuple newCost = new IndexCostTuple(i, cost[i]);\n queue.remove(newCost);\n queue.add(newCost);\n }\n }\n visited[current.getIndex()] = true;\n }\n\n return null; //the target node was unreachable\n }", "double estimatedDistanceToGoal(Vertex s, Vertex goal);", "public int getLine() {\n return lineNum;\n }", "public Path shortestPath(Vertex a, Vertex b) {\n // If a or b aren't present in the set of vertices throw an exception\n if (!myGraph.containsKey(b) || !myGraph.containsKey(a)) {\n throw new IllegalArgumentException(\"One of the vertices isn't valid\");\n }\n /* Create a map of Vertices to VertexInfos. Fill it with VertexInfos for all\n vertices that each have no previous vertex and and a cost of INFINITY */\n Map<Vertex, VertexInfo> vertInfos = new HashMap<Vertex, VertexInfo>();\n for (Vertex v : vertices()) {\n vertInfos.put(v, new VertexInfo(v, null, INFINITY));\n }\n /* Create a PriorityQueue for VertexInfos */\n PriorityQueue<VertexInfo> viQueue = new PriorityQueue<VertexInfo>();\n /* Create a VertexInfo for the start Vertex 'a' with a cost of 0. This uses a copy of Vertex a&b for immutability */\n Vertex copyA = new Vertex(a.getLabel());\n Vertex copyB = new Vertex(b.getLabel());\n\n VertexInfo vi_a = new VertexInfo(copyA, null, 0);\n /* Add VerxtexInfo for a to PQ and map it to it's VertexInfo */\n viQueue.add(vi_a);\n vertInfos.put(a, vi_a);\n while(!viQueue.isEmpty()) {\n /* Remove the VertexInfo with lowest cost */\n Vertex curr = viQueue.poll().getVertex();\n /* Check all adjacent Vertices of curr Vertex */\n for (Vertex v : adjacentVertices(curr)) {\n /* Calculate cost to get to v through curr */\n int cost = vertInfos.get(curr).getCost() + edgeCost(curr, v);\n /* If cost through curr is lower than previous */\n if (cost < vertInfos.get(v).getCost()) {\n /* Remove v's VertexInfo from PQ */\n viQueue.remove(vertInfos.get(v));\n /* Overwrite previous value of v in map\n Add updated VerexInfo to PQ */\n VertexInfo vi = new VertexInfo(v, curr, cost);\n vertInfos.put(v,vi);\n viQueue.add(vi);\n }\n }\n }\n /* Create ArrayList for path */\n List<Vertex> path = new ArrayList<Vertex>();\n \n /* Add each vertex and it's previous vertex to path until a null vertex is reached */\n for (Vertex vert = copyB; vert != null; vert = vertInfos.get(vert).getPrev()) {\n path.add(vert);\n }\n\n /* Reverse order of path */ \n Collections.reverse(path);\n /* Create new Path object with corresponding parameters */\n if(path.contains(copyA)){\n Path pathToB = new Path(path, vertInfos.get(copyB).getCost());\n return pathToB;\n } else {\n return null;\n }\n }", "private Point getF(Point x) throws OptimizerException, Exception\n {\n Point r = opt.getF(x);\n r.setComment(\"Linesearch.\");\n opt.report(r, Optimizer.SUBITERATION);\n return r;\n }", "private CityByDegrees getStartingVertexCity() {\r\n\t\treturn this.startingVertexCity;\r\n\t}", "public Ndimensional getStartPoint();" ]
[ "0.61635774", "0.615771", "0.6154456", "0.61078686", "0.60744464", "0.60181445", "0.59949225", "0.59106696", "0.58454394", "0.5784703", "0.5758772", "0.5752373", "0.57374746", "0.5699677", "0.564916", "0.56400394", "0.56164885", "0.5593685", "0.556302", "0.55611265", "0.55600876", "0.55596113", "0.5556266", "0.55328965", "0.55271006", "0.55242926", "0.5505947", "0.54951406", "0.54825836", "0.5468067", "0.5434428", "0.54318845", "0.542284", "0.5410156", "0.5400448", "0.53911656", "0.53832006", "0.5371194", "0.5368076", "0.53617096", "0.53601813", "0.535733", "0.5351683", "0.5347441", "0.5332159", "0.5326335", "0.5318726", "0.53168315", "0.53166574", "0.5305656", "0.53000754", "0.5299625", "0.52961975", "0.5270819", "0.52703834", "0.526835", "0.5255149", "0.52542406", "0.5253058", "0.52523786", "0.5251071", "0.52489984", "0.5244899", "0.524326", "0.5208175", "0.52081674", "0.5198796", "0.5197964", "0.51975834", "0.5197527", "0.51922816", "0.5190309", "0.5189769", "0.5180304", "0.516749", "0.5164583", "0.5151817", "0.5148324", "0.5136756", "0.5123352", "0.51192033", "0.51191115", "0.51182616", "0.5117418", "0.51163644", "0.5112681", "0.5106738", "0.51038915", "0.5103358", "0.5101135", "0.5099416", "0.50936157", "0.5092245", "0.5091066", "0.5082372", "0.5081598", "0.50778735", "0.5072978", "0.5070636", "0.50696707" ]
0.5136646
79
This function finds all possible paths between source and destination vertices.
@Deprecated public Graph getPaths(String childVertexHash, String parentVertexHash, int maxPathLength) { Set<Graph> allPaths = new HashSet<>(); Stack<Vertex>currentPath = new Stack<>(); Vertex previousVertex = null; Vertex currentVertex = null; int pathLength = 0; Queue<Vertex> queue = new LinkedList<>(); queue.add(getVertex(childVertexHash)); Graph children = null; while(!queue.isEmpty()) { pathLength++; if(pathLength > maxPathLength) children = null; currentVertex = queue.remove(); String currentHash = currentVertex.getAnnotation("hash"); currentPath.push(currentVertex); if(currentHash.equals(parentVertexHash)) { allPaths.add(convertStackToGraph(currentPath)); } else { children = getChildren(currentHash); } if(children != null) { queue.addAll(children.vertexSet()); continue; } currentPath.pop(); } // merge graphs for each path Graph resultGraph = new Graph(); for (Graph path: allPaths) { resultGraph = Graph.union(resultGraph, path); } return resultGraph; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Iterable<Vertex> computePath(Vertex start, Vertex end) throws GraphException;", "@Override\r\n public Set<List<String>> findAllPaths(int sourceId, int targetId, int reachability) {\r\n //all paths found\r\n Set<List<String>> allPaths = new HashSet<List<String>>();\r\n //collects path in one iteration\r\n Set<List<String>> newPathsCollector = new HashSet<List<String>>();\r\n //same as the solution but with inverted edges\r\n Set<List<String>> tmpPathsToTarget = new HashSet<List<String>>();\r\n //final solution\r\n Set<List<String>> pathsToTarget = new HashSet<List<String>>();\r\n \r\n String[] statementTokens = null; \r\n Set<Integer> allProcessedNodes = new HashSet<Integer>(); //to avoid duplicates\r\n List<String> statementsFound = new ArrayList<String>();\r\n \r\n for (int i = 0; i < reachability; i++) {\r\n if (i == 0) { \r\n Collection<String> inEdges = jungCompleteGraph.getInEdges(sourceId);\r\n for (String inEdge: inEdges) {\r\n \r\n statementsFound = new ArrayList<String>();\r\n statementTokens = inEdge.split(\"->\");\r\n int inNodeId = Integer.parseInt(statementTokens[0]);\r\n //allProcessedNodes.add(inNodeId); \r\n //Incoming nodes are reversed\r\n statementsFound.add(new StringBuilder(inEdge).reverse().toString());\r\n allPaths.add(statementsFound);\r\n if (inNodeId == targetId) tmpPathsToTarget.add(statementsFound);\r\n }\r\n \r\n Collection<String> outEdges = jungCompleteGraph.getOutEdges(sourceId);\r\n \r\n for (String outEdge: outEdges) {\r\n \r\n statementsFound = new ArrayList<String>();\r\n statementTokens = outEdge.split(\"->\");\r\n int outNodeId = Integer.parseInt(statementTokens[2]);\r\n statementsFound.add(outEdge);\r\n allPaths.add(statementsFound);\r\n if (outNodeId == targetId) tmpPathsToTarget.add(statementsFound);\r\n \r\n }\r\n \r\n } else {\r\n newPathsCollector = new HashSet<List<String>>();\r\n\r\n for (List<String> statements: allPaths) {\r\n allProcessedNodes = new HashSet<Integer>(); //to avoid duplicates\r\n int lastNodeInPath = 0;\r\n \r\n for (String predicate: statements) {\r\n if (predicate.contains(\">-\")) {\r\n statementTokens = predicate.split(\">-\");\r\n allProcessedNodes.add(Integer.parseInt(\r\n new StringBuilder(statementTokens[0]).reverse().toString()));\r\n allProcessedNodes.add(Integer.parseInt(\r\n new StringBuilder(statementTokens[2]).reverse().toString()));\r\n lastNodeInPath = Integer.parseInt(\r\n new StringBuilder(statementTokens[2]).reverse().toString());\r\n } else {\r\n statementTokens = predicate.split(\"->\"); \r\n allProcessedNodes.add(Integer.parseInt(statementTokens[0]));\r\n allProcessedNodes.add(Integer.parseInt(statementTokens[2]));\r\n lastNodeInPath = Integer.parseInt(statementTokens[2]);\r\n }\r\n }\r\n \r\n Collection<String> inEdges = jungCompleteGraph.getInEdges(lastNodeInPath);\r\n for (String inEdge: inEdges) {\r\n \r\n statementsFound = new ArrayList<String>();\r\n statementsFound.addAll(statements);\r\n statementTokens = inEdge.split(\"->\");\r\n int inNodeId = Integer.parseInt(statementTokens[0]);\r\n if (allProcessedNodes.contains(inNodeId)) continue;\r\n \r\n //Incoming nodes are reversed \r\n statementsFound.add(new StringBuilder(inEdge).reverse().toString());\r\n newPathsCollector.add(statementsFound);\r\n if (inNodeId == targetId) tmpPathsToTarget.add(statementsFound);\r\n \r\n }\r\n \r\n Collection<String> outEdges = jungCompleteGraph.getOutEdges(lastNodeInPath);\r\n for (String outEdge: outEdges) {\r\n \r\n statementsFound = new ArrayList<String>();\r\n statementsFound.addAll(statements);\r\n statementTokens = outEdge.split(\"->\");\r\n int outNodeId = Integer.parseInt(statementTokens[2]);\r\n if (allProcessedNodes.contains(outNodeId)) continue;\r\n \r\n //Incoming nodes are reversed \r\n statementsFound.add(outEdge);\r\n newPathsCollector.add(statementsFound);\r\n if (outNodeId == targetId) tmpPathsToTarget.add(statementsFound);\r\n }\r\n }\r\n allPaths.addAll(newPathsCollector);\r\n }\r\n \r\n //System.out.println(\"*****End of iteration \" + i);\r\n //System.out.println(\"#SIZE OF allPaths: \" + allPaths.size());\r\n int numItems = 0;\r\n for (List<String> currList: allPaths) {\r\n numItems = numItems + currList.size();\r\n }\r\n //System.out.println(\"#NUMBER OF ELEMS OF ALL LISTS: \" + numItems);\r\n //System.out.println(\"#SIZE OF tmpPathsToTarget : \" + tmpPathsToTarget.size());\r\n }\r\n \r\n //We need to reverse back all the predicates\r\n for (List<String> statements: tmpPathsToTarget) { \r\n List<String> fixedStatements = new ArrayList<String>(); \r\n for (int i = 0; i < statements.size(); i++) { \r\n String statement = statements.get(i); \r\n if (statement.contains(\">-\")) {\r\n fixedStatements.add(new StringBuilder(statement).reverse().toString());\r\n } else {\r\n fixedStatements.add(statement);\r\n } \r\n }\r\n pathsToTarget.add(fixedStatements);\r\n }\r\n return pathsToTarget;\r\n }", "private void computePaths(Vertex source, Vertex target, ArrayList<Vertex> vs)\n {\n \tfor (Vertex v : vs)\n \t{\n \t\tv.minDistance = Double.POSITIVE_INFINITY;\n \t\tv.previous = null;\n \t}\n source.minDistance = 0.;\t\t// distance to self is zero\n IndexMinPQ<Vertex> vertexQueue = new IndexMinPQ<Vertex>(vs.size());\n \n for (Vertex v : vs) vertexQueue.insert(Integer.parseInt(v.id), v);\n\n\t\twhile (!vertexQueue.isEmpty()) \n\t\t{\n\t \t// retrieve vertex with shortest distance to source\n\t \tVertex u = vertexQueue.minKey();\n\t \tvertexQueue.delMin();\n\t\t\tif (u == target)\n\t\t\t{\n\t\t\t\t// trace back\n\t\t\t\twhile (u.previous != null)\n\t\t\t\t{;\n\t\t\t\t\tu = u.previous;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n \t// Visit each edge exiting u\n \tfor (Edge e : u.adjacencies)\n \t\t{\n \t\tVertex v = e.target;\n\t\t\t\tdouble weight = e.weight;\n \tdouble distanceThroughU = u.minDistance + weight;\n\t\t\t\tif (distanceThroughU < v.minDistance) \n\t\t\t\t{\n\t\t\t\t\tint vid = Integer.parseInt(v.id);\n\t\t \t\tvertexQueue.delete(vid);\n\t\t \t\tv.minDistance = distanceThroughU;\n\t\t \t\tv.previous = u;\n\t\t \t\tvertexQueue.insert(vid,v);\n\t\t\t\t}\n\t\t\t}\n }\n }", "public void computeAllPaths(String source)\r\n {\r\n Vertex sourceVertex = network_topology.get(source);\r\n Vertex u,v;\r\n double distuv;\r\n\r\n Queue<Vertex> vertexQueue = new PriorityQueue<Vertex>();\r\n \r\n \r\n // Switch between methods and decide what to do\r\n if(routing_method.equals(\"SHP\"))\r\n {\r\n // SHP, weight of each edge is 1\r\n sourceVertex.minDistance = 0;\r\n vertexQueue.add(sourceVertex);\r\n while(!vertexQueue.isEmpty())\r\n {\r\n u = vertexQueue.remove();\r\n for (String key : u.adjacentVertices.keySet())\r\n {\r\n v = network_topology.get(key);\r\n distuv = u.minDistance + 1;\r\n if(distuv < v.minDistance)\r\n {\r\n v.minDistance = distuv;\r\n v.previous = u;\r\n vertexQueue.add(v);\r\n }\r\n }\r\n \r\n }\r\n \r\n }\r\n \r\n else if (routing_method.equals(\"SDP\"))\r\n {\r\n // SDP, weight of each edge is it's propagation delay\r\n sourceVertex.minDistance = 0;\r\n vertexQueue.add(sourceVertex);\r\n while(!vertexQueue.isEmpty())\r\n {\r\n u = vertexQueue.remove();\r\n for (String key : u.adjacentVertices.keySet())\r\n {\r\n v = network_topology.get(key);\r\n distuv = u.minDistance + u.adjacentVertices.get(key).propDelay;\r\n if(distuv < v.minDistance)\r\n {\r\n v.minDistance = distuv;\r\n v.previous = u;\r\n vertexQueue.add(v);\r\n }\r\n } \r\n }\r\n }\r\n else if (routing_method.equals(\"LLP\"))\r\n {\r\n // LLP, weight each edge is activeCircuits/AvailableCircuits\r\n sourceVertex.minDistance = 0;\r\n vertexQueue.add(sourceVertex);\r\n while(!vertexQueue.isEmpty())\r\n {\r\n u = vertexQueue.remove();\r\n for (String key : u.adjacentVertices.keySet())\r\n {\r\n v = network_topology.get(key);\r\n distuv = Math.max(u.minDistance,u.adjacentGet(key).load());\r\n //System.out.println(u.adjacentGet(key).load());\r\n if(distuv < v.minDistance)\r\n {\r\n v.minDistance = distuv;\r\n v.previous = u;\r\n vertexQueue.add(v);\r\n }\r\n }\r\n }\r\n }\r\n }", "private void generatePath(List<Coordinate> source, List<Coordinate> path) {\n for (int i = 0; i < source.size() - 1; i++) {\n Graph graph = new Graph(getEdge(map));\n Coordinate start = source.get(i);\n Coordinate end = source.get(i + 1);\n graph.dijkstra(start);\n graph.printPath(end);\n for (Graph.Node node : graph.getPathReference()) {\n path.add(node.coordinate);\n }\n }\n }", "public static List<CampusGraph.Edges<String, String>> findPath(CampusGraph<String, String> cg, String start, String destination) {\n if (cg == null || start == null || destination == null) {\n throw new IllegalArgumentException();\n }\n Queue<String> visitedNodes = new LinkedList<>();\n Map<String, List<CampusGraph.Edges<String, String>>> paths = new HashMap<>();\n visitedNodes.add(start); // Add start to Q\n paths.put(start, new LinkedList<>()); // Add start->[] to M (start mapped to an empty list)\n\n while (!visitedNodes.isEmpty()) {\n String currentNode = visitedNodes.remove();\n if (currentNode.equals(destination)) { // found the path\n return paths.get(currentNode);\n } else {\n List<CampusGraph.Edges<String, String>> neighbors = cg.getAllChildren(currentNode);\n neighbors.sort(new Comparator<CampusGraph.Edges<String, String>>() {\n @Override\n public int compare(CampusGraph.Edges<String, String> o1, CampusGraph.Edges<String, String> o2) {\n int cmpEndNode = o1.getEndTag().compareTo(o2.getEndTag());\n if (cmpEndNode == 0) {\n return o1.getEdgeLabel().compareTo(o2.getEdgeLabel());\n }\n return cmpEndNode;\n }\n }); // ascending list. Sort characters and books names all at once??\n\n for (CampusGraph.Edges<String, String> e: neighbors) {\n String neighbor = e.getEndTag();\n if (!paths.containsKey(neighbor)) { // i.e. if the neighbor is unvisited\n List<CampusGraph.Edges<String, String>> pathCopy = new LinkedList<>(paths.get(currentNode));\n pathCopy.add(e);\n paths.put(neighbor, pathCopy); // add the path exclusive to this neighbor\n visitedNodes.add(neighbor); // then, mark the neighbor as visited\n }\n }\n }\n }\n return null; // No destination found\n }", "Iterable<Vertex> computePathToGraph(Loc start, Vertex end) throws GraphException;", "public static void computePaths(Vertex source){\n\t\tsource.minDistance=0;\n\t\t//visit each vertex u, always visiting vertex with smallest minDistance first\n\t\tPriorityQueue<Vertex> vertexQueue=new PriorityQueue<Vertex>();\n\t\tvertexQueue.add(source);\n\t\twhile(!vertexQueue.isEmpty()){\n\t\t\tVertex u = vertexQueue.poll();\n\t\t\tSystem.out.println(\"For: \"+u);\n\t\t\tfor (Edge e: u.adjacencies){\n\t\t\t\tVertex v = e.target;\n\t\t\t\tSystem.out.println(\"Checking: \"+u+\" -> \"+v);\n\t\t\t\tdouble weight=e.weight;\n\t\t\t\t//relax the edge (u,v)\n\t\t\t\tdouble distanceThroughU=u.minDistance+weight;\n\t\t\t\tif(distanceThroughU<v.minDistance){\n\t\t\t\t\tSystem.out.println(\"Updating minDistance to \"+distanceThroughU);\n\t\t\t\t\tv.minDistance=distanceThroughU;\n\t\t\t\t\tv.previous=u;\n\t\t\t\t\t//move the vertex v to the top of the queue\n\t\t\t\t\tvertexQueue.remove(v);\n\t\t\t\t\tvertexQueue.add(v);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void getAllPaths(Graph<Integer> graph) {\n\t\tTopologicalSort obj = new TopologicalSort();\r\n\t\tStack<Vertex<Integer>> result = obj.sort(graph);\r\n\t\t\r\n\t\t// source (one or multiple) must lie at the top\r\n\t\twhile(!result.isEmpty()) {\r\n\t\t\tVertex<Integer> currentVertex = result.pop();\r\n\t\t\t\r\n\t\t\tif(visited.contains(currentVertex.getId())) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tstack = new Stack<Vertex<Integer>>();\r\n\t\t\tSystem.out.println(\"Paths: \");\r\n\t\t\tvisited = new ArrayList<Long>();\r\n\t\t\tdfs(currentVertex);\r\n\t\t\t//System.out.println(stack);\r\n\t\t\t//GraphUtil.print(stack);\t\t\t\r\n\t\t}\r\n\r\n\t}", "public List<List<Integer>> allPathsSourceTarget(int[][] graph) {\n \n boolean[] visited = new boolean[graph.length];\n \n List<Integer> paths = new ArrayList();\n paths.add(0);\n \n List<List<Integer>> allPaths = new ArrayList();\n \n dfs(0,graph.length-1, paths,allPaths,visited,graph);\n \n return allPaths;\n }", "private void computeAllPaths()\n {\n for (Station src : this.graph.stations)\n {\n List<Station> visited = new ArrayList<Station>();\n computePathsForNode(src, null, null, visited);\n }\n Print.printTripList(this.tripList);\n }", "public List<node_info> shortestPath(int src, int dest);", "List<Point> getPath(int grid[][], Point src, Point dest);", "@Override\r\n\tpublic ArrayList<E> getPath(E src, E dst) {\r\n\t\treturn graphForWarshall.getPath(src, dst);\r\n\t}", "private List<List<Edge>> walker(String sourceNode, String destNode, List<Edge> currentPath, List<List<Edge>> paths) {\n if (currentPath == null) {\n currentPath = new ArrayList<>();\n }\n if (paths == null) {\n paths = new ArrayList<>();\n }\n\n if (sourceNode.equals(destNode)) {\n return paths;\n }\n\n\n// List<Edge> edges = findByNodeA(sourceNode);\n List<Edge> edges = allEdges.stream().filter(edge -> edge.nodeA.equals(sourceNode)).collect(Collectors.toList());\n\n\n for (Edge edge : edges) {\n if (!currentPath.contains(edge)&&!containsBidirectionalRef(currentPath,edge)) {\n List<Edge> forkPath = (List<Edge>) ((ArrayList<Edge>) currentPath).clone();\n\n forkPath.add(edge);\n\n if (edge.getNodeB().equals(destNode)) {\n paths.add(forkPath);\n } else {\n walker(edge.getNodeB(), destNode,forkPath,paths);\n }\n }\n }\n\n return paths;\n }", "public ArrayList<String> depthFirstSearch(Character sourceId, Character destinationId) {\n // Safety check first if the hashmap contains the key\n if(!graph.containsKey(sourceId) || !graph.containsKey(destinationId)) {\n throw new NullPointerException(\"The graph does not contain the source or the destination node ID\");\n }\n\n // Initialize empty array list of paths\n paths = new ArrayList<>();\n\n // Get the node from the graph\n Node sourceNode = getNode(sourceId);\n Node destinationNode = getNode(destinationId);\n // Mark the visited nodes in a HashSet so that it will not re-visit\n HashSet<Character> visited = new HashSet<>();\n\n depthFirstSearch(sourceNode, destinationNode, \"\", visited);\n\n // Call the private recursive function\n return paths;\n }", "private static void computePaths(Vertex source) {\n source.minDistance = 0;\n // retrieves with log(n) time\n PriorityQueue<Vertex> vertexPriorityQueue = new PriorityQueue<>();\n\n //BFS traversal\n vertexPriorityQueue.add(source);\n\n // O((v + e) * log(v))\n while (!vertexPriorityQueue.isEmpty()) {\n // this poll always returns the shortest distance vertex at log(v) time\n Vertex vertex = vertexPriorityQueue.poll();\n\n //visit each edge exiting vertex (adjacencies)\n for (Edge edgeInVertex : vertex.adjacencies) {\n // calculate new distance between edgeInVertex and target\n Vertex targetVertex = edgeInVertex.target;\n double edgeWeightForThisVertex = edgeInVertex.weight;\n double distanceThruVertex = vertex.minDistance + edgeWeightForThisVertex;\n if (distanceThruVertex < targetVertex.minDistance) {\n // modify the targetVertex with new calculated minDistance and previous vertex\n // by removing the old vertex and add new vertex with updates\n vertexPriorityQueue.remove(targetVertex);\n targetVertex.minDistance = distanceThruVertex;\n // update previous with the shortest distance vertex\n targetVertex.previous = vertex;\n vertexPriorityQueue.add(targetVertex);// adding takes log(v) time because needs to heapify\n }\n }\n }\n }", "public ShortestPathMatrix<V,E> allPairsShortestPaths();", "private List<Edge> getPath(Vertex source) {\n\t\tint [] predecessors = new ShortestPath().findShortestPath(this.residualNetwork, source);\n\t\tList<Edge> path = retrieveEdgesFromPredecessorArray(predecessors);\n\t\treturn path;\n\t}", "public static List<List<Index>> allPaths(int[][] twoDArray, Index sourceIndex, Index destIndex){\n // Auxiliary functions to check validation of indices\n isValidIndex(twoDArray, sourceIndex);\n isValidIndex(twoDArray, destIndex);\n Matrix matrix = new Matrix(twoDArray);\n Queue<List<Index>> queue = new LinkedList<>();\n List<List<Index>> allPaths = new ArrayList<>();\n Index currentIndex;\n List<Index> visited = new ArrayList<>();\n\n List<Index> pathToNode = new ArrayList<>();\n // first check if the indices are in the same connected component\n if(inTheSameComponent(twoDArray, sourceIndex, destIndex)){\n visited.add(sourceIndex);\n pathToNode.add(sourceIndex);\n queue.add(pathToNode);\n }\n\n while(!queue.isEmpty()) {\n pathToNode = queue.poll();\n currentIndex = pathToNode.get(pathToNode.size() - 1);\n // found new path - add to list of all paths\n if (currentIndex.equals(destIndex)) {\n allPaths.add(pathToNode);\n }\n else {\n for (Index index : matrix.getReachables(currentIndex)) {\n // notRelevant -> all visited indices minus the last visited\n if (!visited.subList(0, visited.size() - queue.size()).contains(index) || index.equals(destIndex) || !pathToNode.contains(index) ) {\n visited.add(index);\n List<Index> pathToNextNode = new ArrayList<>(pathToNode);\n pathToNextNode.add(index);\n queue.add(pathToNextNode);\n }\n }\n }\n }\n return allPaths.stream().sorted(Comparator.comparing(List::size))\n .collect(Collectors.toList());\n }", "public List<String> computeBestPath(String source, String dest)\r\n {\r\n Vertex v;\r\n List<String>shortestPath = new LinkedList<String>();\r\n \r\n // First, relax all nodes\r\n computeAllPaths(source);\r\n \r\n // Then go through each one and return the path as a list of strings\r\n for (v= network_topology.get(dest); v != null; v = v.previous)\r\n { \r\n shortestPath.add(v.name);\r\n }\r\n \r\n Collections.reverse(shortestPath);\r\n \r\n // Clear the relaxed values so that they can be recalculated with each term\r\n clearPathData();\r\n \r\n return shortestPath;\r\n }", "public ArrayList<PathXNode> generatePath(PathXNode destination)throws VertexNotFoundException{\r\n \r\n String destState = destination.getState();\r\n if (destState.indexOf(\"MOUSE_OVER\") >= 0)\r\n destState = destState.substring(0, destState.indexOf(\"_MOUSE_OVER\"));\r\n \r\n if (path != null && !path.isEmpty())\r\n return null;\r\n \r\n Graph graph = getLevel().getGraph();\r\n \r\n //The shortest path from the current intersection/vertex to the destination\r\n //intersection/vertex as an ArrayList of vertices.\r\n ArrayList<Vertex> shortestPath = graph.findPath(getIntersection().getVertex(), destination.getVertex());\r\n \r\n ArrayList<PathXNode> newPath = new ArrayList();\r\n \r\n //Convert the shortestPath ArrayList of Vertices to PathXNodes.\r\n ArrayList<PathXNode> nodes = getLevel().getDataModel().getNodes();\r\n for (Vertex v : shortestPath){\r\n for (PathXNode node : nodes)\r\n if (node.getVertex() == v){\r\n newPath.add(node);\r\n break;\r\n }\r\n }\r\n \r\n \r\n newPath.remove(0);\r\n \r\n //Highlight the nodes.\r\n for (PathXNode node : newPath)\r\n node.setState(node.getState() + \"_HIGHLIGHTED\");\r\n \r\n destination.setState(destState + \"_HIGHLIGHTED\");\r\n if (newPath != null && !newPath.isEmpty()) {\r\n targetX = newPath.get(0).getConstantXPos();\r\n targetY = newPath.get(0).getConstantYPos();\r\n }\r\n return newPath; \r\n }", "public void allPaths(int v1, int v2, int x)\n {\n \tboolean[] visited = new boolean[V];\n \tArrayList<DirectedEdge> paths = new ArrayList<>(V);\n \td = 0;\n \tif(online[v1] == false || online[v2] == false)\n \t{\n \t\tSystem.out.println(\"One or more vertices are down\");\n \t\treturn;\n \t}\n \trecursivePaths(v1,v2,x,visited,paths, 0);\n \tSystem.out.println(\"\\n\\n\");\n }", "private List<Edge<T>> getPath(T target) {\n List<Edge<T>> path = new LinkedList<>();\n T step = target;\n // check if a path exists\n if (predecessors.get(step) == null) {\n return path;\n }\n while (predecessors.get(step) != null) {\n T endVertex = step;\n step = predecessors.get(step);\n T startVertex = step;\n path.add(getEdge(startVertex, endVertex));\n }\n // Put it into the correct order\n Collections.reverse(path);\n return path;\n }", "public static void connectNetwork(int src, int dest, boolean printPath)\r\n\t{\r\n\t\tint v = routers;\r\n\t\t\r\n\t\tint parent[] = new int[v];//parent node array\r\n\t\tint dist[] = new int[v];// distance array\r\n\t\tboolean visited[] = new boolean[v];// visited will be either true or false\r\n\t\t\r\n\t\t// initialize parent, distance arrays\r\n\t\tfor (int i = 0; i < v; i++ ) { \r\n\t\t\tvisited[i] = false;\r\n\t\t\tparent[i] = -1;\r\n\t\t\tdist[i] = Integer.MAX_VALUE;\r\n\t\t}\r\n\t\t\r\n\t\t// initialize the source distance as zero\r\n\t\tdist[src] = 0;\r\n\t\t\r\n\t\t// get minimum edge from the unvisited nodes\r\n\t\tfor (int count = 0; count < v-1; count++) { // loop for all v nodes\r\n\t\t\t\r\n\t\t\tint start = -1;\r\n\t\t\tint min = Integer.MAX_VALUE;\r\n\t\t\t\r\n\t\t\tfor (int i = 0; i < v; i++) {\r\n\t\t\t\tif (visited[i] == false && dist[i] < min) {\r\n\t\t\t\t\tmin = dist[i];\r\n\t\t\t\t\tstart = i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// minimum distance is computed for all connected edges\r\n\t\t\tif (start == -1) \r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\t// update the current node as visited\r\n\t\t\tvisited[start] = true;\r\n\t\t\t\r\n\t\t\t// update all adjacent nodes' distance array\r\n\t\t\tfor (int end = 0; end < v; end++) {\r\n\t\t\t\tif ((visited[end] != true) && (graph[start][end] != -1) &&\r\n\t\t\t\t\t\t(dist[start] != Integer.MAX_VALUE) &&\r\n\t\t\t\t\t\t(dist[start] + graph[start][end] < dist[end])) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tdist[end] = dist[start] + graph[start][end];\r\n\t\t\t\t\t\r\n\t\t\t\t\t// start node is the parent node in BFS tree\r\n\t\t\t\t\tparent[end] = start;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println();\r\n\t\t\r\n\t\tif (dest != -1) {\r\n\t\t\t\r\n\t\t\t// Case#4: shortest path between source and destination nodes \r\n\t\t\tif (parent[dest] == -1) {\r\n\t\t\t\tSystem.out.println(\"There is no path from \" + (src+1) + \" to \" + (dest+1) + \" exists.\");\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out.println(\"Shortest distance from \" + (src+1) + \" to \" + (dest+1) + \" is: \" + dist[dest]);\r\n\t\t\t\tSystem.out.print(\"Corresponding Shortest Path is: \");\r\n\t\t\t\tprintNodes(parent, parent[dest], src);\r\n\t\t\t\tSystem.out.println(dest+1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\t\r\n System.out.println(\"The Shortest Distance from node you entered, \"+ (src+1) + \" are\\n\");\r\n //Printing shortest path length\r\n\t\t\tSystem.out.println(\"Destination\\tDistance\\n========================\");\r\n for (int i = 0; i < v; i++) {\r\n System.out.println(\"\\t\"+ (i+1) + \"\\t \"+ dist[i]); // Printing the node number and distance\r\n }\r\n \r\n\t\t\tif (printPath == true) {\r\n\t\t\t\t\r\n\t\t\t\t// case#2: Print all shortest paths from source node\r\n\t\t\t\tfor (int i = 0; i < v; i++) {\r\n\t\t\t\t\tif (i == src)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\telse if (parent[i] == -1) {\r\n\t\t\t\t\t\tSystem.out.println(\"Shortest path from \" + (src+1) + \" to \" + (i+1) + \" doesn't exist.\");\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tSystem.out.print(\"Shortest Path from \" + (src+1) + \" to \" + (i+1) + \" is: \");\r\n\t\t\t\t\tprintNodes(parent, parent[i], src);\r\n\t\t\t\t\tSystem.out.println(i+1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "private List<routerNode> getPathVertexList(routerNode beginNode, routerNode endNode) {\r\n\t\tTransformer<routerLink, Integer> wtTransformer; // transformer for getting edge weight\r\n\t\twtTransformer = new Transformer<routerLink, Integer>() {\r\n public Integer transform(routerLink link) {\r\n return link.getWeight();\r\n \t}\r\n };\t\t\r\n\r\n\t\t\r\n\t\tList<routerNode> vlist;\r\n\t\tDijkstraShortestPath<routerNode, routerLink> DSPath = \r\n\t \t new DijkstraShortestPath<routerNode, routerLink>(gGraph, wtTransformer);\r\n \t// get the shortest path in the form of edge list \r\n List<routerLink> elist = DSPath.getPath(beginNode, endNode);\r\n\t\t\r\n \t\t// get the node list form the shortest path\r\n\t Iterator<routerLink> ebIter = elist.iterator();\r\n\t vlist = new ArrayList<routerNode>(elist.size() + 1);\r\n \tvlist.add(0, beginNode);\r\n\t for(int i=0; i<elist.size(); i++){\r\n\t\t routerLink aLink = ebIter.next();\r\n\t \t \t// get the nodes corresponding to the edge\r\n \t\tPair<routerNode> endpoints = gGraph.getEndpoints(aLink);\r\n\t routerNode V1 = endpoints.getFirst();\r\n\t routerNode V2 = endpoints.getSecond();\r\n\t \tif(vlist.get(i) == V1)\r\n\t \t vlist.add(i+1, V2);\r\n\t else\r\n\t \tvlist.add(i+1, V1);\r\n\t }\r\n\t return vlist;\r\n\t}", "@Override\r\n public List<V> shortestPath(V start, V destination) {\r\n Vertex a = null, b = null;\r\n try {\r\n Iterator<Vertex> vertexIterator = map.values().iterator();\r\n\r\n while (vertexIterator.hasNext()) {\r\n Vertex v = vertexIterator.next();\r\n if (start.compareTo(v.vertexName) == 0)\r\n a = v;\r\n if (destination.compareTo(v.vertexName) == 0)\r\n b = v;\r\n }\r\n if (a == null || b == null) {\r\n vertexIterator.next();\r\n }\r\n\r\n } catch (NoSuchElementException e) {\r\n throw e;\r\n }\r\n\r\n computePaths(map.get(start), destination);\r\n return getShortestPathTo(destination, start);\r\n }", "@Override\n public List<node_data> shortestPath(int src, int dest) {\n reset();\n for (node_data node : G.getV()) {\n node.setWeight(Double.POSITIVE_INFINITY);\n }\n\n DWGraph_DS.Node currentNode = (DWGraph_DS.Node) G.getNode(src);\n currentNode.setWeight(0);\n PriorityQueue<node_data> unvisitedNodes = new PriorityQueue(G.nodeSize(), weightComperator);\n unvisitedNodes.addAll(G.getV());\n HashMap<Integer, node_data> parent = new HashMap<>();\n parent.put(src, null);\n\n while (currentNode.getWeight() != Double.POSITIVE_INFINITY) {\n if (G.getNode(dest).getTag() == 1) {\n break;\n }\n for (edge_data edge : G.getE(currentNode.getKey())) {\n DWGraph_DS.Node neighbor = (DWGraph_DS.Node) G.getNode(edge.getDest());\n double tmpWeight = currentNode.getWeight() + edge.getWeight();\n if (tmpWeight < neighbor.getWeight()) {\n neighbor.setWeight(tmpWeight);\n unvisitedNodes.remove(neighbor);\n unvisitedNodes.add(neighbor);\n parent.put(neighbor.getKey(), currentNode);\n }\n }\n currentNode.setTag(1);\n if(currentNode.getKey()==dest) break;\n unvisitedNodes.remove(currentNode);\n currentNode = (DWGraph_DS.Node) unvisitedNodes.poll();\n }\n /*\n Rebuild the path list\n */\n if (!parent.keySet().contains(dest)) return null;\n List<node_data> pathList = new ArrayList<>();\n currentNode = (DWGraph_DS.Node) G.getNode(dest);\n while (parent.get(currentNode.getKey()) != null) {\n pathList.add(currentNode);\n currentNode = (DWGraph_DS.Node) parent.get(currentNode.getKey());\n }\n Collections.reverse(pathList);\n return pathList;\n }", "private List<Node> getIntermediatePath(final Node source, final Node target) {\n if (P[source.id][target.id] == null) {\n return new ArrayList<Node>();\n }\n final List<Node> path = new ArrayList<Node>();\n path.addAll(getIntermediatePath(source, P[source.id][target.id]));\n path.add(P[source.id][target.id]);\n path.addAll(getIntermediatePath(P[source.id][target.id], target));\n return path;\n }", "private List<Vertex> generateTempRouteList(Vertex source, Vertex target) throws SQLException {\n\n\t\tList<Vertex> verts = bgCtr.getVertList();\n\t\tList<LinkedList<Edge>> adjas = bgCtr.getAdjaList();\n\t\tList<Vertex> routeList;\n\n\t\tDijkstra dijkstra = new Dijkstra(verts, adjas);\n\n\t\tdijkstra.setupRoutePlanning(source);\n\n\t\trouteList = dijkstra.getPath(target);\n\n\t\treturn routeList;\n\t}", "public static void computePaths(Point source) {\n\n\t\tsource.setMinimumDistance(0.0);\n\t\tPriorityQueue<Point> pointQueue = new PriorityQueue<Point>();\n\t\tpointQueue.add(source);\n\t\twhile (!pointQueue.isEmpty()) {\n\t\t\tPoint u = pointQueue.poll();\n\t\t\tif (u.getAdjacencies() != null) {\n\t\t\t\tfor (Edge e : u.getAdjacencies()) {\n\n\t\t\t\t\tPoint target = e.getTarget();\n\t\t\t\t\tdouble weight = e.getWeight();\n\t\t\t\t\tdouble distanceThroughP = weight + u.getMinimumDistance();\n\n\t\t\t\t\tif (distanceThroughP < target.getMinimumDistance()) {\n\t\t\t\t\t\tpointQueue.remove(target);\n\n\t\t\t\t\t\ttarget.setMinimumDistance(distanceThroughP);\n\t\t\t\t\t\ttarget.setPrevious(u);\n\t\t\t\t\t\tpointQueue.add(target);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public ArrayList<Vertex> dijkstraPath(int sourceIndex, int sinkIndex) {\r\n \tArrayList<Vertex> locationcopy;\r\n \tlocationcopy=new ArrayList<Vertex>(location);\r\n \tArrayList<Vertex> dijpath;\r\n \tdijpath= new ArrayList<Vertex>(0);\r\n \t//dijpath.add(locationcopy.get(sourceIndex));\r\n \tint i,j,maxdist=locationcopy.size()+1;\r\n \tint[] DistArray=new int[locationcopy.size()], PreArray=new int[locationcopy.size()]; \r\n \tint[][] AdjArray=new int[locationcopy.size()][locationcopy.size()];\r\n \t\r\n \r\n \t\r\n \tfor(i=0;i<locationcopy.size();i++)\r\n \t\tfor(j=i;j<locationcopy.size();j++)\r\n \t\t\tif(locationcopy.get(i).distance(locationcopy.get(j))<=transmissionRange)\r\n \t\t\t{\r\n \t\t\t\tAdjArray[i][j]=1;\r\n \t\t\t\tAdjArray[j][i]=1;\r\n \t\t\t}\r\n \t\t\telse\r\n \t\t\t{\r\n \t\t\t\tAdjArray[i][j]=maxdist;\r\n \t\t\t\tAdjArray[j][i]=maxdist;\r\n \t\t\t}\r\n \t\r\n \tfor(i=0;i<locationcopy.size();i++)\r\n \t\tAdjArray[i][i]=0;\r\n \t\t\r\n\t\t\r\n \tint mdistindex,mindist;\r\n\r\n \t for(i=0;i<locationcopy.size();i++)\r\n \t { \r\n \t\t DistArray[i]=AdjArray[sourceIndex][i];\r\n \t if(DistArray[i]<maxdist) PreArray[i]=sourceIndex;\r\n \t else PreArray[i]=-1;\r\n \t }\r\n \t PreArray[sourceIndex]=-1; AdjArray[sourceIndex][sourceIndex]=1;\r\n \t for(j=0;j<(locationcopy.size()-1);j++)\r\n \t { \r\n \t\t mindist=maxdist; \r\n \t\t mdistindex=-1;\r\n \t for(i=0;i<locationcopy.size();i++)\r\n \t if((AdjArray[i][i]==0)&&(DistArray[i]<mindist))\r\n \t { \r\n \t \t mdistindex=i;\r\n \t \t mindist=DistArray[i];\r\n \t }\r\n \t if(mdistindex==-1) return new ArrayList<Vertex>(0);\r\n \t else\r\n \t { \r\n \t \t AdjArray[mdistindex][mdistindex]=1;\r\n \t for(i=0;i<locationcopy.size();i++)\r\n \t {\r\n \t if(AdjArray[i][i]==0)\r\n \t {\r\n \t if(DistArray[mdistindex]+AdjArray[mdistindex][i]<DistArray[i])\r\n \t { \r\n \t \t DistArray[i]=DistArray[mdistindex]+AdjArray[mdistindex][i];\r\n \t PreArray[i]=mdistindex;\r\n \t }\r\n \t }\r\n \t }\r\n \t }\r\n \t if(AdjArray[sinkIndex][sinkIndex]==1) break;\r\n \t }\r\n \t Stack<Integer> s=new Stack<Integer>();\r\n \t i=sinkIndex;\r\n \t s.push(i);\r\n \t while(PreArray[i]!=-1)\r\n \t {\r\n \t\t s.push(PreArray[i]);\r\n \t\t i=PreArray[i];\r\n \t }\r\n \t while(!s.isEmpty())\r\n \t {\r\n \t\t dijpath.add(locationcopy.get(s.pop()));\r\n \t }\r\n \treturn dijpath;\r\n }", "public List<Long> getPath(Long start, Long finish){\n \n \n List<Long> res = new ArrayList<>();\n // auxiliary list\n List<DeixtraObj> serving = new ArrayList<>();\n// nearest vertexes map \n Map<Long,DeixtraObj> optimMap = new HashMap<>();\n// thread save reading \n synchronized (vertexes){ \n // preparation\n for (Map.Entry<Long, Vertex> entry : vertexes.entrySet()) {\n Vertex userVertex = entry.getValue();\n // If it`s start vertex weight = 0 and the nereast vertex is itself \n if(userVertex.getID().equals(start)){\n serving.add(new DeixtraObj(start, 0.0, start));\n }else{\n // For other vertex weight = infinity and the nereast vertex is unknown \n serving.add(new DeixtraObj(userVertex.getID(), Double.MAX_VALUE, null));\n }\n\n } \n // why auxiliary is not empty \n while(serving.size()>0 ){\n // sort auxiliary by weight \n Collections.sort(serving);\n\n \n // remove shortes fom auxiliary and put in to answer \n DeixtraObj minObj = serving.remove(0);\n optimMap.put(minObj.getID(), minObj);\n\n Vertex minVertex = vertexes.get(minObj.getID());\n\n // get all edges from nearest \n for (Map.Entry<Long, Edge> entry : minVertex.allEdges().entrySet()) {\n Long dest = entry.getKey();\n Double wieght = entry.getValue().getWeight();\n // by all remain vertexes \n for(DeixtraObj dx : serving){\n if(dx.getID().equals(dest)){\n // if in checking vertex weight more then nearest vertex weight plus path to cheking \n // then change in checking weight and nearest\n if( (minObj.getWeight()+wieght) < dx.getWeight()){\n dx.setNearest(minVertex.getID());\n dx.setWeight((minObj.getWeight()+wieght));\n }\n }\n }\n }\n\n }\n }\n \n // create output list\n res.add(finish);\n Long point = finish;\n while(!point.equals(start)){\n \n point = ((DeixtraObj)optimMap.get(point)).getNearest();\n res.add(point);\n }\n \n Collections.reverse(res);\n \n \n return res;\n \n }", "public ArrayList<Vertex> getPath(Vertex target) {\n\t\tArrayList<Vertex> path = new ArrayList<Vertex>();\n\t\tVertex step = target;\n\t\t// check if a path exists\n\t\tif (predecessors.get(step) == null) {\n\t\t\treturn null;\n\t\t}\n\t\tpath.add(step);\n\t\twhile (predecessors.get(step) != null) {\n\t\t\tstep = predecessors.get(step);\n\t\t\tpath.add(step);\n\t\t}\n\t\t// Put it into the correct order\n\t\tCollections.reverse(path);\n\n\n\t\tVertex current=null;\n\t\tVertex next=null;\n\t\tint length = path.size();\n\t\tfor(int i=0;i<length-1;i++){\n current = path.get(i);\n\t\t\t next = path.get(i+1);\n\t\t\tif(!rapid && (nodeColor_map.get(current.getName()).equalsIgnoreCase(\"dB\")||\n\t\t\t\t\tnodeColor_map.get(next.getName()).equalsIgnoreCase(\"dB\")))\n\t\t\t\trapid = true;\n\t\t\troute_length+= edge_length_map.get(new Pair(current,next));\n\t\t}\n\n\t\treturn path;\n\t}", "public ArrayList<Integer> getPath(int destination){\n\t\tif(parent[destination] == NOPARENT || hasNegativeCycle[destination] == true){ //will crash if out of bounds!\n\t\t\treturn null; //Never visited or is part of negative cycle, path is undefined!\n\t\t}\n\t\tint curr = destination; \n\t\t//Actually build the path\n\t\tArrayList<Integer> nodesInPath = new ArrayList<Integer>();\n\t\twhile(parent[curr] != curr){ //has itself as parent\n\t\t\tnodesInPath.add(curr);\n\t\t\tcurr = parent[curr];\n\t\t}\n\t\tnodesInPath.add(curr); //add start node too!\n\t\treturn nodesInPath;\n\t}", "@Override\n\tpublic List<Path> getShortestRoute(Location src, Location dest, String edgePropertyName) {\n\t\t//array to keep track of visited vertexes\n\t\tboolean[] visited = new boolean[locations.size()];\n\t\t//array to store weights\n\t\tdouble[] weight = new double[locations.size()];\n\t\t//array to store predecessors\n\t\tLocation[] pre = new Location[locations.size()];\n\t\t//creates priority queue\n\t\tPriorityQueue<LocWeight> pq = new PriorityQueue<LocWeight>();\n\t\t// initializes every vertex misted mark to false\n\t\tfor (int i = 0; i < visited.length; i++)\n\t\t\tvisited[i] = false;\n\t\t// initializes every vertex's total weight to infinity\n\t\tfor (int i = 0; i < weight.length; i++)\n\t\t\tweight[i] = Double.POSITIVE_INFINITY;\n\t\t// initializes every vertex's predecessor to null\n\t\tfor (int i = 0; i < pre.length; i++)\n\t\t\tpre[i] = null;\n\t\t//sets start vertex's total weight to 0\n\t\tweight[locations.indexOf(src)] = 0;\n\t\t//insert start vertex in priroty queue\n\t\tpq.add(new LocWeight(src, 0.0));\n\t\t\n\t\tString[] edgeNames = getEdgePropertyNames();\n\t\tint indexProp = 0;\n\t\tfor (int i = 0; i < edgeNames.length; i++) {\n\t\t\tif (edgeNames[i].equalsIgnoreCase(edgePropertyName))\n\t\t\t\tindexProp = i;\n\t\t}\n\t\twhile (!pq.isEmpty()) {\n\t\t\tLocWeight c = pq.remove();\n\t\t\t//set C's visited mark to true\n\t\t\tvisited[locations.indexOf(c)] = true;\n\n\t\t\tList<Location> neighbors = getNeighbors(c.getLocation());\n\t\t\t//for each unvisited successor adjacent to C\n\t\t\tfor (int i = 0; i < neighbors.size(); i++) {\n\t\t\t\tif (visited[locations.indexOf(neighbors.get(i))] == false) {\n\t\t\t\t\t//change successor's total weight to equal C's weight + edge weight from C to successor\n\t\t\t\t\tweight[locations.indexOf(neighbors.get(i))] = c.getWeight() + getEdgeIfExists(c.getLocation(), neighbors.get(i)).getProperties().get(indexProp);\n\t\t\t\t\tpre[locations.indexOf(neighbors.get(i))] = c.getLocation();\n\t\t\t\t\tLocWeight succ = new LocWeight(neighbors.get(i), weight[locations.indexOf(neighbors.get(i))]);\n\t\t\t\t\t//if successor is already in pq, update its total weight\n\t\t\t\t\tif (pq.contains(succ)) {\n\t\t\t\t\t\tpq.remove(succ);\n\t\t\t\t\t}\n\t\t\t\t\t//if not already there, add\n\t\t\t\t\tpq.add(succ);\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t\t\n\n\n\t\t}\n\t\t\n\t\tArrayList<Path> path = new ArrayList<Path>();\n\t\t//find predecessor of each vertex and construct shortest path then return it\n\t\tLocation curr1 = dest;\n\t\twhile (pre[locations.indexOf(curr1)] != null) {\n\t\t\tpath.add(getEdgeIfExists(pre[locations.indexOf(curr1)], curr1));\n\t\t\tcurr1 = pre[locations.indexOf(curr1)];\n\t\t}\n\t\t//to show path from the start\n\t\tfor (int i = path.size() - 1; i >= 0; i--)\n\t\t\tpath.add(path.remove(i));\n\n\n\t\treturn path;\n\t}", "public void shortestPathsNodes() {\n for (int sourceNode = 0; sourceNode < wordGraph.V(); sourceNode++) {\n BreadthFirstDirectedPaths bfs = new BreadthFirstDirectedPaths(wordGraph, sourceNode);\n\n for (int goalNode = 0; goalNode < wordGraph.V(); goalNode++) {\n Iterable<Integer> shortestPath = bfs.pathTo(goalNode);\n int pathLength = -1;\n if (shortestPath != null) {\n for (int edge : shortestPath) {\n pathLength++;\n }\n }\n if (pathLength != -1) {\n }\n System.out.println(pathLength);\n }\n }\n }", "public Square[] buildPath(GameBoard board, Player player) {\n\n // flag to check if we hit a goal location\n boolean goalVertex = false;\n\n // Queue of vertices to be checked\n Queue<Vertex> q = new LinkedList<Vertex>();\n\n // set each vertex to have a distance of -1\n for ( int i = 0; i < graph.length; i++ )\n graph[i] = new Vertex(i,-1);\n\n // get the start location, i.e. the player's location\n Vertex start = \n squareToVertex(board.getPlayerLoc(player.getPlayerNo()));\n start.dist = 0;\n q.add(start);\n\n // while there are still vertices to check\n while ( !goalVertex ) {\n\n // get the vertex and remove it;\n // we don't want to look at it again\n Vertex v = q.remove();\n\n // check if this vertex is at a goal row\n switch ( player.getPlayerNo() ) {\n case 0: if ( v.graphLoc >= 72 ) \n goalVertex = true; break;\n case 1: if ( v.graphLoc <= 8 ) \n goalVertex = true; break;\n case 2: if ( (v.graphLoc+1) % GameBoard.COLUMNS == 0 )\n goalVertex = true; break;\n case 3: if ( v.graphLoc % GameBoard.COLUMNS == 0 )\n goalVertex = true; break;\n }\n\n // if we're at a goal vertex, we don't need to calculate\n // its neighboors\n if ( !goalVertex ) {\n\n // retrieve all reachable ajacencies\n Square[] adjacencies = reachableAdjacentSquares\n (board, vertexToSquare(v, board), player.getPlayerNo());\n\n // for each adjacency...\n for ( Square s : adjacencies ) {\n\n // convert to graph location\n Vertex adjacent = squareToVertex(s); \n\n // modify the vertex if it hasn't been modified\n if ( adjacent.dist < 0 ) {\n adjacent.dist = v.dist+1;\n adjacent.path = v;\n q.add(adjacent);\n }\n }\n\n }\n else\n return returnPath(v,board);\n \n }\n // should never get here\n return null;\n }", "public ArrayList<Vertex> gpsrPath(int sourceIndex, int sinkIndex) {\r\n ArrayList<Vertex> locationcopy;\r\n \tlocationcopy=new ArrayList<Vertex>(location);\r\n \tint currentIndex, nearestIndex;\r\n \tdouble bestdist,dist;\r\n \tArrayList<Vertex> GPSRpath;\r\n \tGPSRpath= new ArrayList<Vertex>(0);\r\n \tcurrentIndex=sourceIndex;\r\n \tVertex sourcenode, sinknode, currentnode, nearestnode;\r\n \tsourcenode=locationcopy.get(sourceIndex);\r\n \tsinknode=locationcopy.get(sinkIndex);\r\n \tdist=bestdist=sourcenode.distance(sinknode);\r\n \tGPSRpath.add(sourcenode);\r\n \tint i;\r\n\t\t\r\n \twhile(true)\r\n \t{\r\n \t\tcurrentnode=locationcopy.get(currentIndex);\r\n \t\tnearestIndex=currentIndex;\r\n \tfor(i=0;i<locationcopy.size();i++)\r\n \t{\r\n \t\tif(locationcopy.get(i).distance(currentnode)<=transmissionRange)\r\n \t\t{\r\n \t\t\tif(bestdist>(dist=locationcopy.get(i).distance(sinknode))) \r\n \t\t\t\t{\r\n \t\t\t\tbestdist=dist;\r\n \t\t\t\tnearestIndex=i;\r\n \t\t\t\t}\t\r\n \t\t\tif(dist==0) break;\r\n \t\t}\t\t\r\n \t}\r\n \tif(nearestIndex!=currentIndex)\r\n \t{\r\n \t\tnearestnode=locationcopy.get(nearestIndex);\r\n \t\tGPSRpath.add(nearestnode);\r\n \t\tif(dist==0) return GPSRpath;\r\n \t\tlocationcopy.remove(currentIndex);\r\n \t\tif(sinkIndex>currentIndex) sinkIndex-=1;\r\n \t\tif(nearestIndex>currentIndex) currentIndex=nearestIndex-1; else currentIndex=nearestIndex;\r\n \t\t//currentIndex=locationcopy.indexOf(nearestnode);\r\n \t\t//sinkIndex=locationcopy.indexOf(sinknode);\r\n \t}\r\n \telse return new ArrayList<Vertex>(0);\r\n \t}\r\n }", "private void getPath(HashMap<Slot, Slot> parents, ArrayList<Pair<Slot, Slot>> moves, ArrayList<MoveNode> movePaths) {\n ArrayList<ArrayList<Slot>> path = new ArrayList<>();\n\n for (int i = 0; i < moves.size(); i++) {\n ArrayList<Slot> possiblePath = new ArrayList<>();\n Slot slot = moves.get(i).second;\n\n while (parents.containsKey(slot)) {\n Slot parent = parents.get(slot);\n possiblePath.add(slot);\n slot = parent;\n }\n\n possiblePath.add(slot);\n Collections.reverse(possiblePath);\n path.add(possiblePath);\n }\n\n for (int i = 0; i < path.size(); i++) {\n ArrayList<Slot> possiblePath = path.get(i);\n Slot source = possiblePath.get(0);\n Slot dest = possiblePath.get(possiblePath.size() - 1);\n\n MoveNode moveNode = new MoveNode(source, dest);\n moveNode.setMovePath(possiblePath);\n movePaths.add(moveNode);\n }\n }", "List<List<Node>> findUndirectedPaths(Node s, Node d) {\n\t\tList<List<Node>> paths = new ArrayList<>();\n\t\tpath(s, d, new HashSet<>(), new ArrayList<>(), paths);\n System.out.println(\"Computed paths: \" + paths);\n return paths;\n\t}", "@Override\n\tpublic List<node_data> shortestPath(int src, int dest) {\n\t\tfor(node_data vertex : dwg.getV()) {\n\t\t\tvertex.setInfo(\"\"+Double.MAX_VALUE);\n\t\t}\n\t\tint[] prev = new int[dwg.nodeSize()];\n\t\tnode_data start = dwg.getNode(src);\n\t\tstart.setInfo(\"0.0\");\n\t\tQueue<node_data> q = new LinkedBlockingQueue<node_data>();\n\t\tq.add(start);\n\t\tprev[src%dwg.nodeSize()] = -1;\n\t\twhile(!q.isEmpty()) {\n\t\t\tnode_data v = q.poll();\n\t\t\tCollection<edge_data> edgesV = dwg.getE(v.getKey());\n\t\t\tfor(edge_data edgeV : edgesV) {\n\t\t\t\tdouble newSumPath = Double.parseDouble(v.getInfo()) +edgeV.getWeight();\n\t\t\t\tint keyU = edgeV.getDest();\n\t\t\t\tnode_data u = dwg.getNode(keyU);\n\t\t\t\tif(newSumPath < Double.parseDouble(u.getInfo())) {\n\t\t\t\t\tu.setInfo(\"\"+newSumPath);\n\t\t\t\t\tq.remove(u);\n\t\t\t\t\tq.add(u);\n\t\t\t\t\tprev[u.getKey()%dwg.nodeSize()] = v.getKey();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tList<node_data> ans = new ArrayList<node_data>();\n\t\tint run = dest;\n\t\twhile(run != src) {\n\t\t\tans.add(0,dwg.getNode(run));\n\t\t\trun = prev[run%dwg.nodeSize()];\n\t\t}\n\t\tans.add(0, dwg.getNode(src));\n\n\t\treturn ans;\n\t}", "void shortestPaths( Set<Integer> nodes );", "public void findPath(Vertex v, Graph g)\n {\n \tQueue<Vertex> q = new LinkedList<Vertex>();\n \tSet<String> visited= new HashSet<String>();\n \tSet<String> edges= new TreeSet<String>();\n \t\n \t \tq.add(v);\n \t \tvisited.add(v.name);\n \t \t\n \t \twhile(!q.isEmpty()){\n \t \t\tVertex vertex = q.poll();\n \t \t\t \n \t for(Edge adjEdge: vertex.adjEdge.values()){\n \t\t if(!visited.contains(adjEdge.adjVertex.name) && !adjEdge.adjVertex.isDown && !adjEdge.isDown){\n \t\t\t q.offer(adjEdge.adjVertex);\n \t\t\t visited.add(adjEdge.adjVertex.name);\n \t\t\t \n \t\t\t edges.add(adjEdge.adjVertex.name);\n \t\t\t \n \t\t }\n \t }\n \t \n \t }\n \t \tfor(String str: edges){\n \t\t System.out.print('\\t');\n \t\t System.out.println(str);\n \t }\n \t \t\n }", "@Override\n public List dijkstrasShortestPath(T start, T end) {\n Vertex<T> origin = new Vertex<>(start);\n Vertex<T> destination = new Vertex<>(end);\n List<Vertex<T>> path;\n\n settledNodes = new HashSet<>();\n unSettledNodes = new HashSet<>();\n distancesBetweenNodes = new HashMap<>();\n predecessors = new HashMap<>();\n\n distancesBetweenNodes.put(origin,0);\n unSettledNodes.add(origin);\n\n while(unSettledNodes.size() > 0){\n Vertex<T> minimumWeightedVertex = getMinimum(unSettledNodes);\n settledNodes.add(minimumWeightedVertex);\n unSettledNodes.remove(minimumWeightedVertex);\n findMinimumDistance(minimumWeightedVertex);\n }\n path = getPath(destination);\n return path;\n\n }", "private void depthFirstSearch(Node sourceNode, Node destinationNode, String path, HashSet<Character> visited) {\n // Base condition is that if the node is looping then return\n if(visited.contains(sourceNode.charId)) {\n return;\n }\n\n // Mark the sourceNode as visited\n visited.add(sourceNode.charId);\n String newPath = sourceNode.charId.toString();\n path += \"->\" + newPath;\n\n // If the source node reached destination or the node has no children\n if(sourceNode == destinationNode || sourceNode.adjacent.isEmpty()) {\n paths.add(path);\n return;\n }\n\n // Search all of it's children's children until reach destination\n for(Node children : sourceNode.adjacent) {\n depthFirstSearch(children, destinationNode, path, visited);\n }\n }", "Iterable<DirectedEdge> pathTo(int v)\n\t{\n\t\tStack<DirectedEdge> path=new Stack<>();\n\t\tfor(DirectedEdge e=edgeTo[v]; e!=null; e=edgeTo[e.from()])\n\t\t{\n\t\t\tpath.push(e);\n\t\t}\n\t\treturn path;\n\t}", "private NodePath<T> collectPathNodes( WeightedGraph<T> graph, Object startNodeId, Object endNodeId ) {\n\t\tArrayDeque<Node<T>> deque = new ArrayDeque<>( searchNodes.size() );\n\t\tNode<T> startNode = graph.getNode( startNodeId );\n\t\tNode<T> endNode = graph.getNode( endNodeId );\n\t\tSearchNode<T> node = getSearchNode( endNode );\n\n\t\t//\tkeep this before we flush the maps\n\t\tfinal int finalDistance = node.getDistance();\n\n\t\t//\twalk backwards through the \"previous\" links\n\t\tdo {\n\t\t\tdeque.push( node.getNode() );\n\t\t}\n\t\twhile ( (node = getSearchNode( node.getPrevious() )) != null && ! node.equals( startNode ) );\n\t\tdeque.push( startNode );\n\n\t\tclearSearchNodes();\n\t\treturn new NodePath<>( new ArrayList<>( deque ), finalDistance );\n\t}", "@Override\n\tpublic List<node_data> shortestPath(int src, int dest) {\n\t\tList<node_data> ans = new ArrayList<>();\n\t\tthis.shortestPathDist(src, dest);\n\t\tif(this.GA.getNode(src).getWeight() == Integer.MAX_VALUE || this.GA.getNode(dest).getWeight() == Integer.MAX_VALUE){\n\t\t\tSystem.out.print(\"There is not a path between the nodes.\");\n\t\t\treturn null;\n\t\t}\n\t\tgraph copied = this.copy();\n\t\ttransPose(copied);\n\t\tnode_data first = copied.getNode(dest);\n\t\tans.add(first);\n\t\twhile (first.getKey() != src) {\n\t\t\tCollection<edge_data> temp = copied.getE(first.getKey());\n\t\t\tdouble check= first.getWeight();\n\t\t\tif(temp!=null) {\n\t\t\t\tfor (edge_data edge : temp) {\n\t\t\t\t\tif (copied.getNode(edge.getDest()).getWeight() + edge.getWeight() == check) {\n\t\t\t\t\t\tfirst = copied.getNode(edge.getDest());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tans.add(first);\n\t\t}\n\t\tList<node_data> ans2 = new ArrayList<>();\n\t\tfor (int i = ans.size()-1;i>=0;i--){\n\t\t\tans2.add(ans.get(i));\n\t\t}\n\t\treturn ans2;\n\t}", "private List<Edge<String>> getPath(Vertex<String> end,\n Vertex<String> start) {\n if (graph.label(end) != null) {\n List<Edge<String>> path = new ArrayList<>();\n\n Vertex<String> cur = end;\n Edge<String> road;\n while (cur != start) {\n road = (Edge<String>) graph.label(cur); // unchecked cast ok\n path.add(road);\n cur = graph.from(road);\n }\n return path;\n }\n return null;\n }", "public static <G extends BaseWeightedGraph<V,E,W>,V,E extends WeightedEdge<V,W>, W extends Number & Comparable<W>> List<E> findShortestPathInt(G graph, V source, V sink){\r\n\t\t// check graph contains source and sink\r\n\t\tSet<V> vertecies = graph.getVertices();\r\n\t\tif( !(vertecies.contains(source) && vertecies.contains(sink)) ){\r\n\t\t\tthrow new IllegalArgumentException(\"BaseGraph must contain both source and sink\");\r\n\t\t}\r\n\t\t\r\n\t\tPriorityQueue<WeightedPathChain<V,E,W,Integer>> pq = new PriorityQueue<WeightedPathChain<V,E,W,Integer>>(); \r\n\t\tHashSet<V> checked = new HashSet<V>();\r\n\t\tHashMap<V,WeightedPathChain<V,E,W,Integer>> map = new HashMap<V,WeightedPathChain<V,E,W,Integer>>();\r\n\t\taddOrUpdate(map,pq,source,Integer.valueOf(0));\r\n\t\twhile(!pq.isEmpty()&&!sink.equals(pq.peek().vertex)){\r\n\t\t\tWeightedPathChain<V,E,W,Integer> current = pq.poll(); // poll lowest level vertex\r\n\t\t\tchecked.add(current.vertex); // add vertex to checked set\r\n\t\t\tfor (E edge :graph.getOutgoingEdges(current.vertex)){\t// for each outgoing edge \r\n\t\t\t\tif(!checked.contains(edge.getOpposingVertex(current.vertex))){\t\t// if opposing vertex has not been checked \r\n\t\t\t\t\taddOrUpdate(map,\r\n\t\t\t\t\t\t\t\tpq,\r\n\t\t\t\t\t\t\t\tedge.getOpposingVertex(current.vertex),\r\n\t\t\t\t\t\t\t\tInteger.valueOf(map.get(current.vertex).val+edge.getWeight().intValue() ) ,\r\n\t\t\t\t\t\t\t\tedge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tArrayList<V> path = new ArrayList<V>(); // vertex path \r\n\t\tArrayList<E> edgePath = new ArrayList<E>(); // edge path\r\n\t\tboolean run = true; \r\n\t\tif(!pq.isEmpty()&&pq.peek().vertex.equals(sink)) { // \r\n\t\t\tWeightedPathChain<V,E,W,Integer> vv = pq.poll();\r\n\t\t\tpath.add(vv.vertex);\r\n\t\t\tedgePath.add(vv.edge);\r\n\t\t\twhile(run) {\r\n\t\t\t\tvv = map.get(vv.edge.getOpposingVertex(vv.vertex));\r\n\t\t\t\tif(vv.vertex.equals(source)) {\r\n\t\t\t\t\trun=false;\r\n\t\t\t\t\tpath.add(vv.vertex);\r\n\t\t\t\t}\r\n\t\t\t\telse {\t\r\n\t\t\t\t\tedgePath.add(vv.edge);\r\n\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//return path;\r\n\t\t\r\n\t\tCollections.reverse(edgePath);\r\n\t\treturn edgePath;\r\n\t}", "private void calculateShortestDistances (GraphStructure graph,int startVertex,int destinationVertex) {\r\n\t\t//traverseRecursively(graph, startVertex);\r\n\t\tif(pathList.contains(destinationVertex)) {\r\n\t\t\tdistanceArray = new int [graph.getNumberOfVertices()];\r\n\t\t\tint numberOfVertices=graph.getNumberOfVertices();\r\n\t\t\tSet<Integer> spanningTreeSet = new HashSet<Integer>();\r\n\t\t\tArrays.fill(distanceArray,Integer.MAX_VALUE);\r\n\t\t\tdistanceArray[startVertex]=0;\r\n\t\t\tadjacencyList = graph.getAdjacencyList();\r\n\t\t\tList<Edge> list;\r\n\t\t\tlist = graph.getAdjacencyList()[startVertex];\r\n\t\t\tif(startVertex==destinationVertex) {\r\n\t\t\t\treturn;\r\n\t\t\t} else {\r\n\t\t\t\tfor(Edge value : list) {\r\n\t\t\t\t\tif(! isVisited[value.getVertex()]) {\r\n\t\t\t\t\t\tint sumOfWeightAndSourceVertexDistanceValue = distanceArray[startVertex] + value.getWeight();\r\n\t\t\t\t\t\tint distanceValueOfDestinationVertex = distanceArray[value.getVertex()];\r\n\t\t\t\t\t\tif( sumOfWeightAndSourceVertexDistanceValue < distanceValueOfDestinationVertex ) {\r\n\t\t\t\t\t\t\tdistanceArray[value.getVertex()] = sumOfWeightAndSourceVertexDistanceValue;\r\n\t\t\t\t\t\t\tshortestPathList.add(value.getVertex());\r\n\t\t\t\t\t\t\tcalculateShortestDistances(graph,value.getVertex(), distanceValueOfDestinationVertex);\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t} \r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/*for(Integer value : spanningTreeSet) {\r\n\t\t\t\tSystem.out.print(value+\" \");\r\n\t\t\t}*/\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"No route is present between given vertices !\");\r\n\t\t}\r\n\t}", "public Iterable<Integer> pathTo(int v)\n {\n if (!hasPathTo(v)) return null;\n Stack<Integer> path = new Stack<Integer>();\n for (int x = v; x != s; x = edgeTo[x])\n path.push(x);\n path.push(s);\n return path;\n }", "public List<Node> getShortestPathToDestination(Node destination) {\n List<Node> path = new ArrayList<Node>();\n\n\n\n for (Node node = destination; node != null; node = node.previous){\n Log.i(\"bbb\", \"get path \"+node._waypointName);\n path.add(node);\n }\n\n // reverse path to get correct order\n Collections.reverse(path);\n return path;\n }", "public ArrayList<Integer> path2Dest(int s, int t, int k, int method){\n double INFINITY = Double.MAX_VALUE;\n boolean[] SPT = new boolean[intersection];\n double[] d = new double[intersection];\n int[] parent = new int[intersection];\n\n for (int i = 0; i <intersection ; i++) {\n d[i] = INFINITY;\n parent[i] = -1;\n }\n d[s] = 0;\n\n MinHeap minHeap = new MinHeap(k);\n for (int i = 0; i <intersection ; i++) {\n minHeap.add(i,d[i]);\n }\n while(!minHeap.isEmpty()){\n int extractedVertex = minHeap.extractMin();\n\n if(extractedVertex==t) {\n break;\n }\n SPT[extractedVertex] = true;\n\n LinkedList<Edge> list = g.adjacencylist[extractedVertex];\n for (int i = 0; i <list.size() ; i++) {\n Edge edge = list.get(i);\n int destination = edge.destination;\n if(SPT[destination]==false ) {\n double newKey =0;\n double currentKey=0;\n if(method==1) { //method 1\n newKey = d[extractedVertex] + edge.weight;\n currentKey = d[destination];\n }\n else{ //method 2\n newKey = d[extractedVertex] + edge.weight + coor[destination].distTo(coor[t])-coor[extractedVertex].distTo(coor[t]);\n currentKey = d[destination];\n }\n if(currentKey>=newKey){\n if(currentKey==newKey){ //if equal need to compare the value of key\n if(extractedVertex<parent[destination]){\n minHeap.updateKey(newKey, destination, d[destination]);\n parent[destination] = extractedVertex;\n d[destination] = newKey;\n }\n }\n else {\n minHeap.updateKey(newKey, destination, d[destination]);\n parent[destination] = extractedVertex;\n d[destination] = newKey;\n }\n }\n }\n }\n }\n //trace back the path using parent properties\n ArrayList<Integer> path = new ArrayList<>();\n if(parent[t]!=-1){\n path.add(t);\n while(parent[t]!= s) {\n path.add(0,parent[t]);\n t = parent[t];\n }\n path.add(0,s);\n }\n else\n path = null;\n return path;\n }", "private Square[] returnPath(Vertex v, GameBoard b) {\n // because we're starting at the end point,\n // we need build the path in 'reverse'\n Stack<Square> path = new Stack<Square>();\n\n // while we're not at the start point\n while ( v.dist != 0 ) {\n path.push(vertexToSquare(v,b));\n v = v.path;\n }\n\n // place the locations in the proper order\n Square[] road = new Square[path.size()];\n for ( int i = 0; i < path.size(); i++ )\n road[i] = path.pop();\n\n return road;\n }", "@Override\n public List<node_info> shortestPath(int src, int dest) {\n int counter=0;//counter for index of listPath\n List<node_info> listPath=new ArrayList<node_info>();//The reverse list that is returned\n List<node_info> listResult=new ArrayList<node_info>();//the returned list\n if(!DijkstraHelp(src,dest)) return null;//if there is no path from src to dest\n if(src==dest) {\n listPath.add(this.ga.getNode(src));\n return listPath;\n }\n //the other case:\n node_info d=this.ga.getNode(dest);\n listPath.add(counter,d);//insert the dest in order to go from destination to source\n //counter++;\n weighted_graph gCopy=copy();\n Iterator<node_info> it=gCopy.getV().iterator();//run on the whole graph\n while(it.hasNext()){\n if(listPath.get(counter).getKey()==src) break;//if we finished\n if(gCopy.getV(listPath.get(counter).getKey()).contains(it.next())) {//remove the nodes that we were already checked if\n //they need to be insert to listPath\n continue;\n }\n Iterator<node_info> currentIt=gCopy.getV(listPath.get(counter).getKey()).iterator();//iterator on the ni-list of the\n //last node were insert to the listPath\n if(currentIt!=null) {\n node_info min=null;\n while (currentIt.hasNext()){\n node_info currentLoop=currentIt.next();\n if(currentLoop.getTag()+gCopy.getEdge(listPath.get(counter).getKey(),currentLoop.getKey())==\n listPath.get(counter).getTag()){//check if this is the node that appropriate to the shortest path\n min=currentLoop;\n }\n }\n listPath.add(min);//insert to listPath\n counter++;\n }\n }\n for(int i=listPath.size()-1;i>=0;i--){\n listResult.add(listPath.size()-i-1,listPath.get(i));//reverse the list\n }\n return listResult;\n }", "private void source_to_dest_path(int source, int dest, int[] forward_dist_tab, int[] list_Prevoius_Node, ArrayList<Integer> del_router)\n\t{\n\t\tif(del_router != null && del_router.contains(dest))\n\t\t\tSystem.out.println(\"Router \"+ (dest+1) +\" is deleted\");\n\t\telse if(del_router != null && del_router.contains(source))\n\t\t\tSystem.out.println(\"Router \"+ (source+1) +\" is deleted\");\n\t\telse\n\t\t{\n\t\t\tint[] prevNodes_List = list_Prevoius_Node;\n\t\t\tint k = dest;\n\t\t\tString path = \"\" + (dest+1);\n\t\t\t\n\t\t\t//Check if node is reachable that if it is connected in the graph then only proceed further\n\t\t\tif(forward_dist_tab[dest] != INFINITE_DIST)\n\t\t\t{\n\t\t\t\twhile(prevNodes_List[k] != source)\n\t\t\t\t{\n\t\t\t\t\tpath += \" >- \" + (prevNodes_List[k] + 1);\n\t\t\t\t\tk = prevNodes_List[k];\n\t\t\t\t}\n\t\t\t\t//for source node\n\t\t\t\tpath += \" >- \" + (source+1);\n\t\t\t\t\n\t\t\t\t//Back traversal is done using the previous node list\n\t\t\t\tString disp_path= new StringBuilder(path).reverse().toString();\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"\\nShortest distance from \"+ (source+1) +\" to \"+ (dest+1) +\":\");\n\t\t\t\tSystem.out.println(\"PATH: \"+ disp_path);\n\t\t\t\tSystem.out.println(\"COST: \" + forward_dist_tab[dest]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"\\nRouter \"+ (dest+1) +\" is dead or unreachable.\");\n\t\t\t}\n\t\t}\n\t}", "private void computePath(){\n LinkedStack<T> reversePath = new LinkedStack<T>();\n // adding end vertex to reversePath\n T current = end; // first node is the end one\n while (!current.equals(start)){\n reversePath.push(current); // adding current to path\n current = closestPredecessor[vertexIndex(current)]; // changing to closest predecessor to current\n }\n reversePath.push(current); // adding the start vertex\n \n while (!reversePath.isEmpty()){\n path.enqueue(reversePath.pop());\n }\n }", "private void findPath2(List<Coordinate> path) {\n List<Integer> cost = new ArrayList<>(); // store the total cost of each path\n // store all possible sequences of way points\n ArrayList<List<Coordinate>> allSorts = new ArrayList<>();\n int[] index = new int[waypointCells.size()];\n for (int i = 0; i < index.length; i++) {// generate the index reference list\n index[i] = i;\n }\n permutation(index, 0, index.length - 1);\n for (Coordinate o1 : originCells) {\n for (Coordinate d1 : destCells) {\n for (int[] ints1 : allOrderSorts) {\n List<Coordinate> temp = getOneSort(ints1, waypointCells);\n temp.add(0, o1);\n temp.add(d1);\n int tempCost = 0;\n for (int i = 0; i < temp.size() - 1; i++) {\n Graph graph = new Graph(getEdge(map));\n Coordinate start = temp.get(i);\n graph.dijkstra(start);\n Coordinate end = temp.get(i + 1);\n graph.printPath(end);\n tempCost = tempCost + graph.getPathCost(end);\n if (graph.getPathCost(end) == Integer.MAX_VALUE) {\n tempCost = Integer.MAX_VALUE;\n break;\n }\n }\n cost.add(tempCost);\n allSorts.add(temp);\n }\n }\n }\n System.out.println(\"All sorts now have <\" + allSorts.size() + \"> items.\");\n List<Coordinate> best = allSorts.get(getMinIndex(cost));\n generatePath(best, path);\n setSuccess(path);\n }", "private void computePathsForNode(Station curr, Route route, Trip trip, List<Station> visited)\n {\n if (visited.contains(curr)) return; // cycle detected\n\n visited.add(curr); // add current station to visited list\n\n if (route != null) // this is not the source node\n {\n if (trip == null)\n {\n trip = new Trip();\n trip.addHop(route);\n this.tripList.add(trip);\n }\n else\n {\n if (trip.getHopCount() > 0)\n {\n // Intermediate paths within a larger traversal path.\n // Add all the routes from the original traversal and add the current route at the end.\n // This generates all the sub-paths in a traversal.\n Trip newTrip = new Trip();\n for (Route hop : trip.getHops())\n newTrip.addHop(hop);\n\n tripList.add(newTrip);\n }\n\n // original traversal path\n trip.addHop(route);\n }\n }\n\n // if any outbound routes exist, proceed with the next set of nodes in a depth-first manner\n List<Route> outbound = this.graph.getOutboundRoutes(curr);\n if (outbound != null)\n {\n while (!outbound.isEmpty())\n {\n Route outRoute = outbound.remove(0);\n computePathsForNode(outRoute.destination, outRoute, trip, new ArrayList<Station>(visited));\n }\n }\n if (trip != null)\n {\n trip.removeLastHop(); // remove the hop from the trip list\n }\n\n }", "public ArrayList<Integer> path(int startVertex, int stopVertex) {\n// you supply the body of this method\n int start = startVertex;\n int stop = stopVertex;\n int previous;\n ArrayList<Integer> list = new ArrayList<>();\n HashMap<Integer, Integer> route = new HashMap<>();\n Stack<Integer> visited = new Stack<>();\n Stack<Integer> reverse = new Stack<>();\n int parent;\n if(!pathExists(startVertex,stopVertex)){\n return new ArrayList<Integer>();\n }\n else if(startVertex == stopVertex){\n list.add(startVertex);\n return list;\n }\n else{\n while(!neighbors(start).contains(stopVertex)){\n List neighbor = neighbors(start);\n for (Object a: neighbor) {\n if(!pathExists((int)a,stopVertex)){\n continue;\n }\n if(visited.contains(a)){\n continue;\n }\n else {\n route.put((int) a, start);\n visited.push(start);\n start = (int) a;\n break;\n }\n }\n }\n route.put(stopVertex,start);\n list.add(stopVertex);\n previous = route.get(stopVertex);\n list.add(previous);\n while(previous!=startVertex){\n int temp = route.get(previous);\n list.add(temp);\n previous = temp;\n }\n for(int i=0; i<list.size(); i++){\n reverse.push(list.get(i));\n }\n int i=0;\n while(!reverse.empty()){\n int temp = reverse.pop();\n list.set(i,temp);\n i++;\n }\n//list.add(startVertex);\n return list;\n }\n }", "public boolean dfs(String source, String destination) {\n if (source.equals(destination)) { \n return true;\n }\n\n boolean pathExists = false;\n visited.add(source);\n List<String> nextList = map.get(source);\n if (nextList == null || nextList.isEmpty()) {\n return false;\n }\n for (String next : nextList) {\n if (!visited.contains(next)) {\n pathExists = dfs(next, destination);\n if (pathExists) {\n break;\n }\n }\n }\n\n return false || pathExists;\n }", "public Iterable<DirectedEdge> pathTo(int v){\n\t\tvalidateVertex(v);\n\t\tif(!hasPathTo(v)) return null;\n\n\t\tLinkedStack<DirectedEdge> stack=new LinkedStack<>();\n\t\twhile(edgeTo[v]!=null){\n\t\t\tstack.push(edgeTo[v]);\n\t\t\tv=edgeTo[v].from();\n\t\t}\n\t\treturn stack;\n\t}", "private void dfs(String source) {\n visited.add(source);\n\n System.out.println(source);\n\n for (Object vertex : graph.get(source)) {\n if (!visited.contains(vertex))\n dfs((String) vertex);\n }\n }", "public static void main(String args[]) {\n int V = 4;\n Graph g = new Graph(V);\n g.addEdge(0, 1);\n g.addEdge(0, 2);\n g.addEdge(1, 2);\n g.addEdge(2, 0);\n g.addEdge(2, 3);\n g.addEdge(3, 3);\n\n int src = 1;\n int dest = 3;\n boolean[] visited = new boolean[V];\n\n // To store the complete path between source and destination\n Stack<Integer> path1 = new Stack<>();\n\n if (hasPathDFS(g, src, dest, visited, path1)) {\n System.out.println(\"There is a path from \" + src + \" to \" + dest);\n System.out.println(\"The complete path is \" + path1);\n } else System.out.println(\"There is no path from \" + src + \" to \" + dest);\n\n src = 3;\n dest = 1;\n // To store the complete path between source and destination\n Stack<Integer> path2 = new Stack<>();\n\n if (hasPathDFS(g, src, dest, visited, path2)) System.out.println(\"There is a path from \" + src + \" to \" + dest);\n else System.out.println(\"There is no path from \" + src + \" to \" + dest);\n\n // total number of nodes in the graph (labeled from 0 to 7)\n int n = 8;\n\n // List of graph edges as per the above diagram\n Graph g2 = new Graph(n);\n /**\n * There is a path from 1 to 3\n * The complete path is [1, 2, 3]\n * There is no path from 3 to 1\n * There is a path from 0 to 7\n * The complete path is [0, 3, 4, 6, 7]\n */\n\n g2.addEdge(0, 3);\n g2.addEdge(1, 0);\n g2.addEdge(1, 2);\n g2.addEdge(1, 4);\n g2.addEdge(2, 7);\n g2.addEdge(3, 4);\n g2.addEdge(3, 5);\n g2.addEdge(4, 3);\n g2.addEdge(4, 6);\n g2.addEdge(5, 6);\n g2.addEdge(6, 7);\n\n // source and destination vertex\n src = 0;\n dest = 7;\n\n // To store the complete path between source and destination\n Stack<Integer> path = new Stack<>();\n boolean[] visited2 = new boolean[n];\n\n if (hasPathDFS(g2, src, dest, visited2, path)) {\n System.out.println(\"There is a path from \" + src + \" to \" + dest);\n System.out.println(\"The complete path is \" + path);\n } else System.out.println(\"There is no path from \" + src + \" to \" + dest);\n\n\n }", "@Override\r\n public List<node_info> shortestPath(int src, int dest) {\r\n double i = shortestPathDist(src, dest);\r\n double j, k, s, mark = 1;\r\n ArrayList<node_info> Rlist = new ArrayList<>();\r\n ArrayList<node_info> Llist = new ArrayList<>();\r\n Rlist.clear();\r\n Llist.clear();\r\n j = i;\r\n for (node_info curr : this.Graph.getV()) {\r\n curr.setInfo(\"clear\");\r\n }\r\n this.Graph.getNode(src).setInfo(\"tmp\");\r\n Rlist.add(this.Graph.getNode(dest));\r\n node_info nd = this.Graph.getNode(dest);\r\n node_info temp = this.Graph.getNode(dest);\r\n while (j != 0 && j > 0) {\r\n for (node_info curr0 : this.Graph.getV(nd.getKey())) {\r\n if (curr0.getInfo() != null) {\r\n temp = curr0;\r\n k = this.Graph.getEdge(nd.getKey(), curr0.getKey());\r\n s = j - k;\r\n if ((s - curr0.getTag() < 0.001 && s - curr0.getTag() > -0.001) && nd.getInfo() != null) {\r\n Rlist.add(curr0);\r\n j = curr0.getTag();\r\n curr0.setInfo(\"tmp\");\r\n mark = 1;\r\n nd = curr0;\r\n }\r\n }\r\n }\r\n if (mark == 0) {\r\n i = j;\r\n temp.setInfo(null);\r\n Rlist.clear();\r\n Rlist.add(this.Graph.getNode(dest));\r\n mark = 1;\r\n }\r\n mark = 0;\r\n }\r\n for (int t = (Rlist.size() - 1); t >= 0; t--) {\r\n Llist.add(Rlist.get(t));\r\n }\r\n return Llist;\r\n }", "public ArrayList<Integer> path(int startVertex, int stopVertex) {\r\n ArrayList<Integer> paths = new ArrayList<Integer>();\r\n Iterator<Integer> iter = new DFSIterator(startVertex);\r\n while (!paths.contains(stopVertex) && pathExists(startVertex, stopVertex)) {\r\n Integer thisVertex = iter.next();\r\n if (pathExists(thisVertex, stopVertex)) {\r\n \tpaths.add(thisVertex);\r\n }\r\n } \r\n return paths;\r\n }", "@Override\r\n\tpublic List<Integer> getShortestPath(int source, int destination, GraphStructure graph) {\r\n\t\tshortestPathList = new ArrayList<Integer>();\r\n\t\tisVisited = new boolean[graph.getNumberOfVertices()];\r\n\t\tdistanceArray = new int [graph.getNumberOfVertices()];\r\n\t\tArrays.fill(distanceArray,Integer.MAX_VALUE);\r\n\t\tdistanceArray[source]=0;\r\n\t\tcalculateShortestDistances(graph, source, destination);\r\n\t\tfor(Integer value : shortestPathList) {\r\n\t\t\tSystem.out.println(value+\" \");\r\n\t\t}\r\n\t\treturn shortestPathList;\r\n\t}", "public ArrayList<String> breadthFirstSearch(Character sourceId, Character destinationId) {\n if(!graph.containsKey(sourceId) || !graph.containsKey(destinationId)) {\n throw new NullPointerException(\"The graph does not contain the source or the destination node ID\");\n }\n // Initialize the list of paths & visited set\n paths = new ArrayList<>();\n HashSet<Character> visited = new HashSet<>();\n // Get the nodes from the map\n Node sourceNode = getNode(sourceId);\n Node destinationNode = getNode(destinationId);\n // Call the private method\n breadthFirstSearch(sourceNode, destinationNode, \"\", visited);\n // Return the paths found\n return paths;\n }", "private ArrayList<Vertex> dfs(boolean[] visited, Vertex start, Vertex target) {\n \n //TEST VALUES: if start/end are out of bounds of array of vertices\n if (start.getID() < 0) {\n return null;\n }\n \n if (target.getID() > arrayOfVertices.length) {\n return null;\n }\n \n \n //base case: if start = target, return start vertex right there.\n if (start == target) {\n solution.add(0, start);\n return solution;\n }\n \n //has this vertex been visited before? yes? then just return. if no, \n if (visited[start.getID()]) {\n return null;\n }\n \n //since it hasn't been visited before, mark it as visited\n visited[start.getID()] = true;\n \n //does it have kids? no? return.\n if (start.getDegree() == 0) {\n return null;\n }\n \n //create ArrayList of adjacent vertices to the given start\n ArrayList<Vertex> adjacents = start.getAdjacent();\n \n //go through its edges, for loop. to go through edges\n for (int i = 0; i < start.getDegree(); i++) {\n \n //(from testing)\n NavigateMaze.advance(start.getID(), adjacents.get(i).getID());\n \n //do the dfs; if it's not equal to null \n //(i.e. we found the target, then add it to path\n if (dfs(visited, adjacents.get(i), target) != null) {\n //then add to path\n solution.add(0, start); \n return solution;\n }\n \n //(from testing)\n else {\n NavigateMaze.backtrack(adjacents.get(i).getID(), start.getID());\n }\n \n } \n \n //return null\n return null;\n }", "private static ArrayList<Connection> pathFindDijkstra(Graph graph, int start, int goal) {\n\t\tNodeRecord startRecord = new NodeRecord();\r\n\t\tstartRecord.setNode(start);\r\n\t\tstartRecord.setConnection(null);\r\n\t\tstartRecord.setCostSoFar(0);\r\n\t\tstartRecord.setCategory(OPEN);\r\n\t\t\r\n\t\tArrayList<NodeRecord> open = new ArrayList<NodeRecord>();\r\n\t\tArrayList<NodeRecord> close = new ArrayList<NodeRecord>();\r\n\t\topen.add(startRecord);\r\n\t\tNodeRecord current = null;\r\n\t\tdouble endNodeCost = 0;\r\n\t\twhile(open.size() > 0){\r\n\t\t\tcurrent = getSmallestCSFElementFromList(open);\r\n\t\t\tif(current.getNode() == goal){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tGraphNode node = graph.getNodeById(current.getNode());\r\n\t\t\tArrayList<Connection> connections = node.getConnection();\r\n\t\t\tfor( Connection connection :connections){\r\n\t\t\t\t// get the cost estimate for end node\r\n\t\t\t\tint endNode = connection.getToNode();\r\n\t\t\t\tendNodeCost = current.getCostSoFar() + connection.getCost();\r\n\t\t\t\tNodeRecord endNodeRecord = new NodeRecord();\r\n\t\t\t\t// if node is closed skip it\r\n\t\t\t\tif(listContains(close, endNode))\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t// or if the node is in open list\r\n\t\t\t\telse if (listContains(open,endNode)){\r\n\t\t\t\t\tendNodeRecord = findInList(open, endNode);\r\n\t\t\t\t\t// print\r\n\t\t\t\t\t// if we didn't get shorter route then skip\r\n\t\t\t\t\tif(endNodeRecord.getCostSoFar() <= endNodeCost) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// else node is not visited yet\r\n\t\t\t\telse {\r\n\t\t\t\t\tendNodeRecord = new NodeRecord();\r\n\t\t\t\t\tendNodeRecord.setNode(endNode);\r\n\t\t\t\t}\r\n\t\t\t\t//update the node\r\n\t\t\t\tendNodeRecord.setCostSoFar(endNodeCost);\r\n\t\t\t\tendNodeRecord.setConnection(connection);\r\n\t\t\t\t// add it to open list\r\n\t\t\t\tif(!listContains(open, endNode)){\r\n\t\t\t\t\topen.add(endNodeRecord);\r\n\t\t\t\t}\r\n\t\t\t}// end of for loop for connection\r\n\t\t\topen.remove(current);\r\n\t\t\tclose.add(current);\r\n\t\t}// end of while loop for open list\r\n\t\tif(current.getNode() != goal)\r\n\t\t\treturn null;\r\n\t\telse { //get the path\r\n\t\t\tArrayList<Connection> path = new ArrayList<>();\r\n\t\t\twhile(current.getNode() != start){\r\n\t\t\t\tpath.add(current.getConnection());\r\n\t\t\t\tint newNode = current.getConnection().getFromNode();\r\n\t\t\t\tcurrent = findInList(close, newNode);\r\n\t\t\t}\r\n\t\t\tCollections.reverse(path);\r\n\t\t\treturn path;\r\n\t\t}\r\n\t}", "@SuppressWarnings(\"unchecked\")\n\tprivate void findSimplePaths(Integer currentVertex, Integer destinationVertex, double totalWeight, LinkedList<Integer> path, Set<Integer> allVertices, Set<Integer> visitedNodes, HashMap<LinkedList<Integer>, Double> allSimplePaths) {\n\t\tSet<DefaultEdge> connectedEdges = layout.edgesOf(currentVertex);\n\t\t// remove all of the edges that have been visited\n\t\tif (destinationVertex.equals(currentVertex)){\n\t\t\t// Completed the loop\n\t\t\tallSimplePaths.put(path, totalWeight);\n\t\t\treturn;\n\t\t}\n\t\tfor (DefaultEdge e : connectedEdges) {\n\t\t\tInteger v = layout.getEdgeTarget(e);\n\t\t\tif (!currentVertex.equals(layout.getEdgeSource(e))) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (visitedNodes.contains(v)){\n\t\t\t\tcontinue; //already visited the edge, so skip it\n\t\t\t}\n\t\t\tDefaultBlock b = (DefaultBlock)blockData.get((int)currentVertex);\n\t\t\t// if it is a switch make sure the next block is a valid move\n\t\t\t/*\n\t\t\tif (b.getClass().equals(SwitchBlock.class)){\n\t\t\t\tint [] possibleNextBlocks = ((SwitchBlock) b).getPossibleNextBlocks();\n\t\t\t\tfor (Integer i : allVertices) {\n\t\t\t\t\tif (i.equals(possibleNextBlocks[0])) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (i.equals(possibleNextBlocks[1])) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t*/\n\t\t\t// If the block is closed, it is not a path\n\t\t\tif (b.broken) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// it is part of a path\n\t\t\ttotalWeight += b.blockLength;\n\t\t\tLinkedList<Integer> pathCopy = (LinkedList<Integer>)path.clone();\n\t\t\tSet<Integer> visitedNodesCopy = new HashSet<Integer>(visitedNodes.size());\n\t\t\tvisitedNodesCopy.addAll(visitedNodes);\n\t\t\tvisitedNodesCopy.add(v);\n\t\t\tpathCopy.add(pathCopy.size(), v);\n\t\t\tfindSimplePaths(v, destinationVertex, totalWeight, pathCopy, allVertices, visitedNodesCopy, allSimplePaths);\n\t\t}\n\t}", "public Collection<BGPPath> getAllPathsTo(int dest) {\n if (!this.inRib.containsKey(dest)) {\n return new LinkedList<BGPPath>();\n }\n return this.inRib.get(dest);\n }", "public static Set<ARGState> getOnePathToARGStateForSimpleProperty(ARGState source, ARGState destination) {\n Set<Integer> seenElements = new HashSet<Integer>();\n ARGState currentARGState = source;\n seenElements.add(source.getStateId());\n List<ARGState> path = new ArrayList<ARGState>();\n path.add(currentARGState);\n // Set<ARGState> result = new HashSet<ARGState>();\n while (currentARGState.getStateId() != destination.getStateId()) {\n boolean end = true;\n if (!currentARGState.getChildren().isEmpty()) {\n Iterator<ARGState> children = currentARGState.getChildren().iterator();\n ARGState childrenElement ;\n do {\n childrenElement = children.next();\n if (!seenElements.contains(childrenElement.getStateId())) {\n path.add(childrenElement);\n currentARGState=childrenElement;\n seenElements.add(childrenElement.getStateId());\n end = false;\n break;\n }\n } while(children.hasNext());\n if(end){\n path.remove(path.size()-1);\n if(path.size()!=0){\n currentARGState=path.get(path.size()-1);\n seenElements.add(currentARGState.getStateId());\n }\n else\n break;\n }\n\n }\n else{\n path.remove(path.size()-1);\n if(path.size()!=0){\n currentARGState=path.get(path.size()-1);\n seenElements.add(currentARGState.getStateId());\n }\n else\n break;\n }\n }\n if(currentARGState.getStateId() != destination.getStateId())\n return null;\n if(!destination.getChildren().contains(source))\n return null;\n System.out.println(\"path.size=\"+path.size());\n Iterator<ARGState> it=path.iterator();\n for(int i=0;i<path.size()-1;i++){\n ARGState pre=path.get(i);\n ARGState suc=path.get(i+1);\n CFAEdge edge=pre.getEdgeToChild(suc);\n if(edge.getRawStatement().equals(\"BLANKEDGE\")){\n pre.getChildren().remove(suc);\n suc.getParents().remove(pre);\n AbstractStates.extractLocation(pre).getLeavingEdge().remove(edge);\n AbstractStates.extractLocation(suc).getEnteringEdges().remove(edge);\n }\n }\n return new HashSet<ARGState>(path);\n }", "private List<Vertex> findPathForOutputAsset(Vertex endingVertex, GraphTraversalSource g, Vertex startingVertex) {\n //add null check for endingVertex\n if (endingVertex == null) {\n return null;\n }\n\n List<Vertex> endVertices = new ArrayList<>();\n try {\n if (isEndColumn(g, endingVertex)) {\n endVertices.add(endingVertex);\n } else {\n List<Vertex> nextVertices = g.V(endingVertex.id()).out(LINEAGE_MAPPING).toList();\n\n for (Vertex vertex : nextVertices) {\n if (vertex.equals(startingVertex)) {\n continue;\n }\n Optional.ofNullable(findPathForOutputAsset(vertex, g, endingVertex)).ifPresent(endVertices::addAll);\n }\n\n }\n return endVertices;\n } catch (Exception e) {\n if (log.isDebugEnabled()) {\n log.debug(VERTEX_NOT_FOUND, startingVertex.id(),\n startingVertex.property(PROPERTY_KEY_DISPLAY_NAME).value());\n }\n return null;\n }\n }", "@Nonnull\n public VertexPath<V> buildAnyVertexPath(@Nonnull DirectedGraph<V, A> graph, @Nonnull Collection<V> waypoints) throws PathBuilderException {\n Iterator<V> i = waypoints.iterator();\n List<V> pathElements = new ArrayList<>(16);\n if (!i.hasNext()) {\n throw new PathBuilderException(\"No waypoints provided\");\n }\n V start = i.next();\n pathElements.add(start);\n while (i.hasNext()) {\n V goal = i.next();\n BackLinkWithArrow<V, A> back = breadthFirstSearch(graph, start, goal);\n if (back == null) {\n throw new PathBuilderException(\"Breadh first search stalled at vertex: \" + goal\n + \" waypoints: \" + waypoints.stream().map(Object::toString).collect(Collectors.joining(\", \")) + \".\");\n } else {\n for (BackLinkWithArrow<V, A> b = back; b.vertex != start; b = b.parent) {\n pathElements.add(null);\n }\n int index = pathElements.size();\n for (BackLinkWithArrow<V, A> b = back; b.vertex != start; b = b.parent) {\n pathElements.set(--index, b.vertex);\n }\n }\n\n start = goal;\n }\n return new VertexPath<>(pathElements);\n }", "ShortestPath(UndirectedWeightedGraph graph, String startNodeId, String endNodeId) throws NotFoundNodeException {\r\n\t\t\r\n\t\tif (!graph.containsNode(startNodeId)) {\r\n\t\t\tthrow new NotFoundNodeException(graph, startNodeId);\r\n\t\t}\t\t\r\n\t\tif (!graph.containsNode(endNodeId)) {\r\n\t\t\tthrow new NotFoundNodeException(graph, endNodeId);\r\n\t\t}\t\r\n\r\n\t\tsrc = startNodeId;\r\n\t\tdst = endNodeId;\r\n\t\t\r\n\t\tif (endNodeId.equals(startNodeId)) {\r\n\t\t\tlength = 0;\r\n\t\t\tnumOfPath = 1;\r\n\t\t\tArrayList<String> path = new ArrayList<String>();\r\n\t\t\tpath.add(startNodeId);\r\n\t\t\tpathList.add(path);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// create a HashMap of updated distance from the starting node to every node\r\n\t\t\t// initially it is 0, inf, inf, inf, ...\r\n\t\t\tHashMap<String, Double> distance = new HashMap<String, Double>();\t\r\n\t\t\tfor (String nodeId : graph.getNodeList().keySet()) {\r\n\t\t\t\tif (nodeId.equals(startNodeId)) {\r\n\t\t\t\t\t// the starting node will always have 0 distance from itself\r\n\t\t\t\t\tdistance.put(nodeId, 0.0);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// the others have initial distance is infinity\r\n\t\t\t\t\tdistance.put(nodeId, Double.MAX_VALUE);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// a HashMap of preceding node of each node\r\n\t\t\tHashMap<String, HashSet<String>> precedence = new HashMap<String, HashSet<String>>();\r\n\t\t\tfor (String nodeId : graph.getNodeList().keySet()) {\r\n\t\t\t\tif ( nodeId.equals(startNodeId) ) {\r\n\t\t\t\t\tprecedence.put(nodeId, null);\t// the start node will have no preceding node\r\n\t\t\t\t}\r\n\t\t\t\telse { \r\n\t\t\t\t\tprecedence.put(nodeId, new HashSet<String>());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//\r\n\t\t\tSet<String> unvisitedNode = new HashSet<String>();\r\n\t\t\tfor (String nodeId : graph.getNodeList().keySet()) {\r\n\t\t\t\tunvisitedNode.add(nodeId);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdouble minUnvisitedLength;\r\n\t\t\tString minUnvisitedNode;\r\n\t\t\t// run loop while not all node is visited\r\n\t\t\twhile ( unvisitedNode.size() != 0 ) {\r\n\t\t\t\t// find the unvisited node with minimum current distance in distance list\r\n\t\t\t\tminUnvisitedLength = Double.MAX_VALUE;\r\n\t\t\t\tminUnvisitedNode = \"\";\r\n\t\t\t\tfor (String nodeId : unvisitedNode) {\r\n\t\t\t\t\tif (distance.get(nodeId) < minUnvisitedLength) {\r\n\t\t\t\t\t\tminUnvisitedNode = nodeId;\r\n\t\t\t\t\t\tminUnvisitedLength = distance.get(nodeId); \r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// if there are no node that can be visited from the unvisitedNode, break the loop \r\n\t\t\t\tif (minUnvisitedLength == Double.MAX_VALUE) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// remove the node from unvisitedNode\r\n\t\t\t\tunvisitedNode.remove(minUnvisitedNode);\r\n\t\t\t\t\r\n\t\t\t\t// update the distance of its neighbors\r\n\t\t\t\tfor (Node neighborNode : graph.getNodeList().get(minUnvisitedNode).getNeighbors().keySet()) {\r\n\t\t\t\t\tdouble distanceFromTheMinNode = distance.get(minUnvisitedNode) + graph.getNodeList().get(minUnvisitedNode).getNeighbors().get(neighborNode).getWeight();\r\n\t\t\t\t\t// if the distance of the neighbor can be shorter from the current node, change \r\n\t\t\t\t\t// its details in distance and precedence\r\n\t\t\t\t\tif ( distanceFromTheMinNode < distance.get(neighborNode.getId()) ) {\r\n\t\t\t\t\t\tdistance.replace(neighborNode.getId(), distanceFromTheMinNode);\r\n\t\t\t\t\t\t// renew the precedence of the neighbor node\r\n\t\t\t\t\t\tprecedence.put(neighborNode.getId(), new HashSet<String>());\r\n\t\t\t\t\t\tprecedence.get(neighborNode.getId()).add(minUnvisitedNode);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (distanceFromTheMinNode == distance.get(neighborNode.getId())) {\r\n\t\t\t\t\t\t// unlike dijkstra's algorithm, multiple path should be update into the precedence\r\n\t\t\t\t\t\t// if from another node the distance is the same, add it to the precedence\r\n\t\t\t\t\t\tprecedence.get(neighborNode.getId()).add(minUnvisitedNode);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// if the current node in the process is the end node, we can stop the while loop here\r\n\t\t\t\tif (minUnvisitedNode == endNodeId) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif (distance.get(endNodeId) == Double.MAX_VALUE) {\r\n\t\t\t\t// in case there is no shortest path between the 2 nodes\r\n\t\t\t\tlength = 0;\r\n\t\t\t\tnumOfPath = 0;\r\n\t\t\t\tpathList = null;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// other wise we have these information\r\n\t\t\t\tlength = distance.get(endNodeId);\r\n\t\t\t\t//numOfPath = this.getNumPath(precedence, startNodeId, endNodeId);\r\n\t\t\t\tpathList = this.findPathList(precedence, startNodeId, endNodeId);\r\n\t\t\t\tnumOfPath = pathList.size();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\t// END ELSE\t\t\r\n\t}", "private void calculate() {\n\t\tList<Edge> path = new ArrayList<>();\n\t\tPriorityQueue<Vert> qv = new PriorityQueue<>();\n\t\tverts[s].dist = 0;\n\t\tqv.add(verts[s]);\n\t\twhile (!qv.isEmpty()) {\n\t\t\tVert v = qv.poll();\n\t\t\tint vidx = v.idx;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tif (e.w==0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tVert vo = verts[e.other(vidx)];\n\t\t\t\tif (vo.dist > v.dist + e.w) {\n\t\t\t\t\tvo.dist = v.dist + e.w;\n\t\t\t\t\tqv.add(vo);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (verts[t].dist < L) {\n\t\t\tok = false;\n\t\t\treturn;\n\t\t} else if (verts[t].dist == L) {\n\t\t\tok = true;\n\t\t\tfor (int i=0; i<m; i++) {\n\t\t\t\tif (edges[i].w == 0) {\n\t\t\t\t\tedges[i].w = MAX_DIST;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// replace 0 with 1, adding to za list\n\t\tfor (int i=0; i<m; i++) {\n\t\t\tif (edges[i].w == 0) {\n\t\t\t\tza[i] = true;\n\t\t\t\tedges[i].w = 1;\n\t\t\t} else {\n\t\t\t\tza[i] = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// looking for shortest path from s to t with 0\n\t\tfor (int i=0; i<n; i++) {\n\t\t\tif (i != s) {\n\t\t\t\tverts[i].dist = MAX_DIST;\n\t\t\t}\n\t\t}\n\t\tqv.clear();\n\t\tqv.add(verts[s]);\n\t\twhile (!qv.isEmpty()) {\n\t\t\tVert v = qv.poll();\n\t\t\tint vidx = v.idx;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tVert vo = verts[e.other(vidx)];\n\t\t\t\tif (vo.dist > v.dist + e.w) {\n\t\t\t\t\tvo.dist = v.dist + e.w;\n\t\t\t\t\tqv.add(vo);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (verts[t].dist > L) {\n\t\t\tok = false;\n\t\t\treturn;\n\t\t}\n\t\tVert v = verts[t];\n\t\twhile (v.dist > 0) {\n\t\t\tlong minDist = MAX_DIST;\n\t\t\tVert vMin = null;\n\t\t\tEdge eMin = null;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tVert vo = verts[e.other(v.idx)];\n\t\t\t\tif (vo.dist+e.w < minDist) {\n\t\t\t\t\tvMin = vo;\n\t\t\t\t\teMin = e;\n\t\t\t\t\tminDist = vMin.dist+e.w;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\tv = vMin;\t\n\t\t\tpath.add(eMin);\n\t\t}\n\t\tCollections.reverse(path);\n\t\tfor (int i=0; i<m; i++) {\n\t\t\tif (za[i]) {\n\t\t\t\tedges[i].w = MAX_DIST;\n\t\t\t}\n\t\t}\n\t\tlong totLen=0;\n\t\tboolean wFixed = false;\n\t\tfor (Edge e : path) {\n\t\t\ttotLen += (za[e.idx] ? 1 : e.w);\n\t\t}\n\t\tfor (Edge e : path) {\n\t\t\tif (za[e.idx]) {\n\t\t\t\tif (!wFixed) {\n\t\t\t\t\te.w = L - totLen + 1;\n\t\t\t\t\twFixed = true;\n\t\t\t\t} else {\n\t\t\t\t\te.w = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tok = true;\n\t}", "public ArrayList<String> shortestPath(String u, String v)\n {\n ArrayList<String> path = new ArrayList<>();\n HashMap<String, Boolean> flag = new HashMap<>();\n HashMap<String, String> prev = new HashMap<>();\n\n Queue<GraphVertex> queue = new LinkedList<>();\n HashMap<String, Boolean> visited = new HashMap<>();\n\n GraphVertex src = graphVertexHashMap.get(u);\n flag.put(src.getVertexName(), true);\n queue.add(src);\n visited.put(src.getVertexName(), true);\n\n while(!queue.isEmpty()){\n GraphVertex node = queue.poll();\n\n HashMap<String, GraphVertex> edges = node.getOutDegrees();\n Iterator it = edges.entrySet().iterator();\n while(it.hasNext()){\n Map.Entry pair = (Map.Entry)it.next();\n if(flag.get(pair.getKey()) == null || flag.get(pair.getKey()) == false){\n String vertex = (String)pair.getKey();\n flag.put(vertex, true);\n prev.put(vertex, node.getVertexName());\n queue.add(edges.get(pair.getKey()));\n }\n }\n\n }\n path = backTrackPath(prev, u, v);\n return path;\n }", "List<V> getShortestPath(V vertex);", "public static <V> void printAllShortestPaths(Graph<V> graph) {\n double[][] matrizPesos = graph.getGraphStructureAsMatrix();\n double[][] pesos = new double[matrizPesos.length][matrizPesos.length];\n V[] vertices = graph.getValuesAsArray();\n V[][] caminos = (V[][]) new Object[matrizPesos.length][matrizPesos.length];\n for (int x = 0; x < matrizPesos.length; x++) {\n for (int y = 0; y < matrizPesos.length; y++) {\n if (x == y) {\n pesos[x][y] = -1;\n } else {\n if (matrizPesos[x][y] == -1) {\n pesos[x][y] = Integer.MAX_VALUE; //Si no existe arista se pone infinito\n } else {\n pesos[x][y] = matrizPesos[x][y];\n }\n }\n caminos[x][y] = vertices[y];\n }\n }\n for (int x = 0; x < vertices.length; x++) { // Para cada uno de los vertices del grafo\n for (int y = 0; y < vertices.length; y++) { // Recorre la fila correspondiente al vertice\n for (int z = 0; z < vertices.length; z++) { //Recorre la columna correspondiente al vertice\n if (y != x && z != x) {\n double tam2 = pesos[y][x];\n double tam1 = pesos[x][z];\n if (pesos[x][z] != -1 && pesos[y][x] != -1) {\n double suma = pesos[x][z] + pesos[y][x];\n if (suma < pesos[y][z]) {\n pesos[y][z] = suma;\n caminos[y][z] = vertices[x];\n }\n }\n }\n }\n }\n }\n\n //Cuando se termina el algoritmo, se imprimen los caminos\n for (int x = 0; x < vertices.length; x++) {\n for (int y = 0; y < vertices.length; y++) {\n boolean seguir = true;\n int it1 = y;\n String hilera = \"\";\n while (seguir) {\n if (it1 != y) {\n hilera = vertices[it1] + \"-\" + hilera;\n } else {\n hilera += vertices[it1];\n }\n if (caminos[x][it1] != vertices[it1]) {\n int m = 0;\n boolean continuar = true;\n while (continuar) {\n if (vertices[m].equals(caminos[x][it1])) {\n it1 = m;\n continuar = false;\n } else {\n m++;\n }\n }\n } else {\n if (x == y) {\n System.out.println(\"El camino entre \" + vertices[x] + \" y \" + vertices[y] + \" es: \" + hilera);\n } else {\n hilera = vertices[x] + \"-\" + hilera;\n if (pesos[x][y] == Integer.MAX_VALUE) {\n System.out.println(\"El camino mas corto entre \" + vertices[x] + \" y \" + vertices[y] + \" es: infinito (no hay camino)\");\n } else {\n System.out.println(\"El camino mas corto entre \" + vertices[x] + \" y \" + vertices[y] + \" es: \" + hilera + \" con distancia de: \" + (pesos[x][y]));\n }\n }\n seguir = false;\n }\n }\n }\n System.out.println();\n }\n }", "public List<Pair<Integer, Integer>> preparePath(Pair<Integer, Integer> goal) {\n var path = new LinkedList<Pair<Integer, Integer>>();\n path.add(goal);\n var parent = goal.getParent();\n while(parent != null) {\n path.addFirst(parent);\n parent = parent.getParent();\n }\n path.removeLast();\n return path;\n }", "private List<String> searchByDijkstra(Vertex starting, String end ,Map<String, Vertex> verticesWithDistance) {\n\t\tSet<Vertex> visited = new HashSet<Vertex>();\n\t\tPriorityQueue<Vertex> pq = new PriorityQueue<Vertex>();\n\t\tpq.offer(starting);\n\t\twhile (!pq.isEmpty()) {\n\t\t\tVertex v = pq.poll();\n\t\t\tif (v.name.equals(end))\n\t\t\t\treturn v.route;\n\t\t\tif (!visited.contains(v))\n\t\t\t\tvisited.add(v);\n\t\t\telse\n\t\t\t\tcontinue;\n\t\t\tfor (String n : neighbors.get(v.name)) {\n\t\t\t\tint newDistance = v.distance + edges.get(v.name + \" \" + n);\n\t\t\t\tVertex nextVertex = verticesWithDistance.get(n);\n\t\t\t\tif (nextVertex.distance == -1 || newDistance < nextVertex.distance) {\n\t\t\t\t\tnextVertex.distance = newDistance;\n\t\t\t\t\tnextVertex.route = new LinkedList<String>(v.route);\n\t\t\t\t\tnextVertex.route.add(nextVertex.name);\n\t\t\t\t}\n\t\t\t\tpq.offer(nextVertex);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "@Override\n\tpublic boolean findPath(PathfindingNode start, PathfindingNode end, ArrayList<PathfindingNode> path) \n\t{\n\t\tpath.clear();\n\t\t\n\t\t_visited.clear();\n\t\t_toVisit.clear();\n\t\t_parents.clear();\n\t\t_costsFromStart.clear();\n\t\t_totalCosts.clear();\n\n\t\t_costsFromStart.put(start, 0);\n\t\t_toVisit.add(start);\n\t\t_parents.put(start, null);\n\t\t\n\t\twhile (!_toVisit.isEmpty() && !_toVisit.contains(end))\n\t\t{\n\t\t\tPathfindingNode m = _toVisit.remove();\n\t\t\t\n\t\t\tint mCost = _costsFromStart.get(m);\n\t\t\t\n\t\t\tfor (int i = 0; i < m.getNeighbors().size(); ++i)\n\t\t\t{\n\t\t\t\tPathfindingNodeEdge n = m.getNeighbors().get(i);\n\t\t\t\tif (n.getNeighbor() != null && !_visited.contains(n.getNeighbor()))\n\t\t\t\t{\n\t\t\t\t\tint costFromSource = mCost + n.getCost();\n\t\t\t\t\tint totalCost = costFromSource + _estimator.estimate(n.getNeighbor(), end);\n\t\t\t\t\tif (!_toVisit.contains(n.getNeighbor()) || totalCost < _totalCosts.get(n.getNeighbor()))\n\t\t\t\t\t{\n\t\t\t\t\t\t_parents.put(n.getNeighbor(), m);\n\t\t\t\t\t\t_costsFromStart.put(n.getNeighbor(), costFromSource);\n\t\t\t\t\t\t_totalCosts.put(n.getNeighbor(), totalCost);\n\t\t\t\t\t\tif (_toVisit.contains(n.getNeighbor()))\n\t\t\t\t\t\t\t_toVisit.remove(n.getNeighbor());\n\t\t\t\t\t\t_toVisit.add(n.getNeighbor());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t_visited.add(m);\n\t\t}\n\t\t\n\t\tif (_toVisit.contains(end))\n\t\t{\n\t\t\t_reversePath.clear();\n\t\t\t\n\t\t\tPathfindingNode current = end;\n\t\t\twhile (current != null)\n\t\t\t{\n\t\t\t\t_reversePath.push(current);\n\t\t\t\tcurrent = _parents.get(current);\n\t\t\t}\n\t\t\t\n\t\t\twhile (!_reversePath.isEmpty())\n\t\t\t\tpath.add(_reversePath.pop());\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tpath.add(start);\n\t\t\treturn false;\n\t\t}\n\t}", "private List<Point> getPath(int index) {\n\t\t \n\t \n\t\t Node fromNode = oEdge.fromNode;\n\t\t Node toNode = oEdge.toNode;\n\t\t float x1 = fromNode.longitude;\n\t\t float x2 = toNode.longitude;\n\t\t float y1 = fromNode.latitude;\n\t\t float y2 = toNode.latitude;\n\t\t double slope, angle;\n\t\t if(x1!=x2) {\n\t\t\t slope = (y2-y1)/(x2-x1);\n\t\t\t \tangle = Math.atan(slope);\n\t\t\t \t} else {\n\t\t\t \t\tangle = Math.PI/2;\n\t\t\t \t}\n\t\t Double L = Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));\n\t\t float offsetPixels=0;\n\t\t if(Math.toDegrees(angle)>Math.toDegrees(90)) {\n\t\t\t if (index==0){\n\t\t\t\t offsetPixels=roadWidth*6/10;\n\t\t\t }\n\t\t\t else if(index==1){\n\t\t\t\t offsetPixels=roadWidth*11/10;\n\t\t\t }\n\t\t\t else if(index==-1){\n\t\t\t\t offsetPixels=roadWidth*1/10;\n\t\t\t }\n\t\t\t \n\t\t } else {\n\t\t\t \n\t\t\t if (index==0){\n\t\t\t\t offsetPixels=-roadWidth*6/10;\n\t\t\t }\n\t\t\t else if(index==1){\n\t\t\t\t offsetPixels=-roadWidth*11/10;\n\t\t\t }\n\t\t\t else if(index==-1){\n\t\t\t\t offsetPixels=-roadWidth*1/10;\n\t\t\t }\n\t\t }\n\t\t \n\t\t // This is the first parallel line\n\t\t float x1p1 = x1 + offsetPixels * (y2-y1) / L.floatValue();\n\t\t float x2p1 = x2 + offsetPixels * (y2-y1) / L.floatValue();\n\t\t float y1p1 = y1 + offsetPixels * (x1-x2) / L.floatValue();\n\t\t float y2p1 = y2 + offsetPixels * (x1-x2) / L.floatValue();\n//\t\t if(oEdge.edgeID==16) {\n//\t\t\t System.out.println(\"testing\");\n//\t\t }\n\t\t \n\t\t Point P1 = new Point(x1p1,y1p1);\n\t\t Point P2 = new Point(x2p1,y2p1);\n\t\t List<Point> gP = GetPoints(P1, P2);\n\t\t return gP;\n\t \n\t}", "private Path buildPath(int p[], int source, int target, List<Node> nodes, List<Link> links) throws Exception{\r\n \r\n // A list of nodes forming the path\r\n List<Node> graphpath = new ArrayList<Node>();\r\n\r\n if (p[target] == -1) { // No path exists\r\n return null;\r\n }\r\n\r\n // Start by adding the target node\r\n graphpath.add(nodes.get(target));\r\n // Go from the target backwards following the predecessors array\r\n int currentnode = p[target];\r\n // Stop when predecessor value is -1\r\n // (i.e. there is no predecessor, i.e. we reached the source)\r\n while (currentnode!=-1) {\r\n // Insert next node at the beginning and shift all previous nodes\r\n graphpath.add(0, nodes.get(currentnode));\r\n // Go to the predecessor of the current node\r\n currentnode = p[currentnode];\r\n }\r\n \r\n // Build a Path object from the graphpath nodes list\r\n Path path = new Path();\r\n List<Link> linkpath = new ArrayList<Link>(graphpath.size()-1);\r\n for (int i=0; i<graphpath.size()-1; i++) {\r\n Link lnk = findLink(graphpath.get(i), graphpath.get(i+1), links);\r\n linkpath.add(i, lnk);\r\n }\r\n path.setLinks(linkpath);\r\n \r\n return path;\r\n }", "private void findPath1(List<Coordinate> path) {\n\n // records the start coordinate in a specific sequence.\n ArrayList<Coordinate> starts = new ArrayList<>();\n // records the end coordinate in a specific sequence.\n ArrayList<Coordinate> ends = new ArrayList<>();\n // records the total cost of the path in a specific sequence.\n ArrayList<Integer> cost = new ArrayList<>();\n\n for (Coordinate o1 : originCells) {\n for (Coordinate d1 : destCells) {\n Graph graph = new Graph(getEdge(map));\n graph.dijkstra(o1);\n graph.printPath(d1);\n starts.add(o1);\n ends.add(d1);\n cost.add(graph.getPathCost(d1));\n }\n }\n int index = getMinIndex(cost);\n\n Graph graph = new Graph(getEdge(map));\n graph.dijkstra(starts.get(index));\n graph.printPath(ends.get(index));\n for (Graph.Node node : graph.getPathReference()) {\n path.add(node.coordinate);\n }\n setSuccess(path);\n }", "List<Edge> getPath() throws NoPathFoundException;", "public ArrayList<Vertex> findPath() {\n \n //if we've already been through findPath, then just return it\n if (solutionCalculated) {\n return solution;\n }\n \n //instantiate path\n solution = new ArrayList<Vertex>();\n \n //create boolean array of visited nodes (default: false)\n boolean[] visited = new boolean[arrayOfVertices.length];\n \n //(for testing)\n NavigateMaze.drawMaze(getVertices());\n \n //call dfs\n dfs(visited, arrayOfVertices[0], \n arrayOfVertices[arrayOfVertices.length - 1]);\n \n //update solutionCalculated to true\n solutionCalculated = true;\n \n //return solution\n return solution;\n \n }", "private void printAllPaths(String userFrom, String userTo, boolean[] isVisited, List<String> localPathList) {\r\n User start = null;\r\n for (int i = 0; i < users.size(); i++) {\r\n if (users.get(i).getUserName().equalsIgnoreCase(userFrom))\r\n start = users.get(i);\r\n }\r\n isVisited[start.getIndexPos()] = true;\r\n if (userFrom.equalsIgnoreCase(userTo)) {\r\n for (String c : localPathList)\r\n path += c + \" -> \";\r\n path += \"###\";\r\n isVisited[start.getIndexPos()] = false;\r\n return;\r\n }\r\n for (int i = 0; i < connections[start.getIndexPos()].length; i++) {\r\n if (connections[start.getIndexPos()][i] == true) {\r\n if (!isVisited[users.get(i).getIndexPos()]) {\r\n localPathList.add(users.get(i).getUserName());\r\n printAllPaths(users.get(i).getUserName(), userTo, isVisited, localPathList);\r\n localPathList.remove(users.get(i).getUserName());\r\n }\r\n isVisited[start.getIndexPos()] = false;\r\n }\r\n }\r\n }", "public List<Node> computeDijkstraShortestPath(Node source, Node destination) {\n\n source.minDistance = 0.;\n PriorityQueue<Node> nodeQueue = new PriorityQueue<Node>();\n nodeQueue.add(source);\n\n int destinationGroup = destination._groupID;\n\n while (!nodeQueue.isEmpty()) {\n Node v = nodeQueue.poll();\n\n Log.i(\"bbb\", \"In dijsk node name \"+ v._waypointName);\n //Stop searching when reach the destination node\n\n\n if(destinationGroup!=0){\n\n if(v._groupID==destinationGroup){\n destination = navigationGraph.get(navigationGraph.size()-1).nodesInSubgraph.get(v._waypointID);\n Log.i(\"bbb\", \"destination is: \"+destination._waypointName);\n\n break;\n }\n\n }\n\n if (v._waypointID.equals(destination._waypointID))\n break;\n\n\n // Visit each edge that is adjacent to v\n for (Edge e : v._edges) {\n Node a = e.target;\n Log.i(\"bbb\", \"node a \"+a._waypointName);\n double weight = e.weight;\n double distanceThroughU = v.minDistance + weight;\n if (distanceThroughU < a.minDistance) {\n nodeQueue.remove(a);\n a.minDistance = distanceThroughU;\n a.previous = v;\n Log.i(\"bbb\", \"set previous\");\n nodeQueue.add(a);\n }\n }\n }\n\n Log.i(\"bbb\", \"destination is: \"+destination._waypointName);\n\n return getShortestPathToDestination(destination);\n }", "ArrayList<Node> DFSIter( Graph graph, final Node start, final Node end)\n {\n boolean visited[] = new boolean[graph.numNodes];\n Stack<Node> stack = new Stack<Node>();\n Map< Node,Node> parentPath = new HashMap< Node,Node>(); \n stack.push(start);\n\n while ( !stack.isEmpty() )\n {\n Node currNode = stack.pop();\n // end loop when goal node is found\n if ( currNode == end )\n break;\n // If node has already been visited, skip it\n if ( visited[currNode.id] )\n continue;\n else\n {\n visited[currNode.id] = true;\n int numEdges = currNode.connectedNodes.size();\n\n for ( int i = 0; i < numEdges; i++ )\n {\n Node edgeNode = currNode.connectedNodes.get(i);\n if ( !visited[edgeNode.id] )\n {\n stack.push( edgeNode );\n parentPath.put( edgeNode, currNode);\n }\n }\n \n }\n }\n\n ArrayList<Node> path = new ArrayList<Node>();\n Node currNode = end;\n while ( currNode != null )\n {\n path.add(0, currNode);\n currNode = parentPath.get(currNode);\n }\n\n return path;\n }", "@Override\r\n\tpublic List<Integer> getReachableVertices(GraphStructure graph,int vertex) {\r\n\t\tadjacencyList=graph.getAdjacencyList();\r\n\t\tpathList=new ArrayList<Integer>();\r\n\t\tisVisited=new boolean [graph.getNumberOfVertices()];\r\n\t\ttraverseRecursively(graph, vertex);\r\n\t\treturn pathList;\r\n\t}", "@Nullable\n public VertexPath<V> findAnyVertexPath(@Nonnull DirectedGraph<V, A> graph, @Nonnull Collection<V> waypoints) {\n Iterator<V> i = waypoints.iterator();\n List<V> pathElements = new ArrayList<>(16);\n if (!i.hasNext()) {\n return null;\n }\n V start = i.next();\n pathElements.add(start); // root element\n while (i.hasNext()) {\n V goal = i.next();\n BackLinkWithArrow<V, A> back = breadthFirstSearch(graph, start, goal);\n if (back == null) {\n return null;\n } else {\n int index = pathElements.size();\n for (; back != null; back = back.parent) {\n pathElements.add(index, back.vertex);\n }\n }\n start = goal;\n }\n return new VertexPath<>(pathElements);\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic Map<V, Point2D> execute(Path<V,E> S){\n\n\t\tMap<V, Point2D> ret = new HashMap<V, Point2D>();\n\n\t\t//determine position of S* vertices\n\t\t//TODO center as algorithm parameter\n\t\tPoint2D center = new Point(0,0);\n\n\t\t//convex testing returns S which is equal to S* (there are no vertices \n\t\t//in S which are not in S\n\n\t\tList<V> Svertices = S.pathVertices();\n\t\tSvertices.remove(Svertices.size() - 1);\n\t\tlog.info(\"Face vertices \" + Svertices);\n\t\tCircleLayoutCalc<V> circleCalc = new CircleLayoutCalc<V>();\n\t\tdouble radius = circleCalc.calculateRadius(Svertices, treshold);\n\t\tMap<V,Point2D> positions = circleCalc.calculatePosition(Svertices, radius, center);\n\t\tlog.info(\"Calculating positions of the outer cycle\");\n\t\tlog.info(positions);\n\t\tret.putAll(positions);\n\n\n\t\t//step one - for each vertex v of degree two not on S\n\t\t//replace v together with two edges incident to v with a \n\t\t//single edge joining the vertices adjacent to v\n\n\t\t//leave the original graph intact - make a copy to start with\n\t\tGraph<V,E> gPrim = Util.copyGraph(graph);\n\t\t//store deleted vertices in order to position them later\n\t\tMap<V, E> deletedAdjacentMap = new HashMap<V,E>();\n\n\n\t\t//once a vertex is deleted and its two edges are deleted\n\t\t//and a new one is created\n\t\t//there might be a vertex with degree 2 connected to the deleted vertex\n\t\t//we don't want to create an edge containing the deleted vertex\n\t\t//the newly created edge should be taken into account\n\n\t\tIterator<V> iter = gPrim.getVertices().iterator();\n\t\twhile (iter.hasNext()){\n\t\t\tV v = iter.next();\n\t\t\tif (!Svertices.contains(v) && gPrim.vertexDegree(v) == 2){\n\t\t\t\tlog.info(\"Deleting \" + v);\n\t\t\t\tList<E> edges = gPrim.adjacentEdges(v);\n\t\t\t\tE e1 = edges.get(0);\n\t\t\t\tE e2 = edges.get(1);\n\t\t\t\tlog.info(\"removing \" + e1);\n\t\t\t\tlog.info(\"removing \" + e2);\n\t\t\t\tgPrim.removeEdge(e1);\n\t\t\t\tgPrim.removeEdge(e2);\n\t\t\t\tV adjV1 = e1.getOrigin() == v ? e1.getDestination() : e1.getOrigin();\n\t\t\t\tV adjV2 = e2.getOrigin() == v ? e2.getDestination() : e2.getOrigin();\n\t\t\t\tE newEdge = Util.createEdge(adjV1, adjV2, edgeClass);\n\t\t\t\tlog.info(\"Creating \" + newEdge);\n\t\t\t\tgPrim.addEdge(newEdge);\n\t\t\t\tdeletedAdjacentMap.put(v,newEdge);\n\t\t\t}\n\t\t}\n\n\t\tfor (V v : deletedAdjacentMap.keySet()){\n\t\t\tgPrim.removeVertex(v);\n\t\t}\n\n\n\t\tlog.info(\"G': \" + gPrim);\n\t\t//step 2 - call Draw on (G', S, S*) to extend S* into a convex drawing of G'\n\t\tdraw(gPrim, S.getPath(), Svertices, ret);\n\n\t\t//step 3 For each deleted vertex of degree 2 determine its position on the straight \n\t\t//line segment joining the two vertices adjacent to the vertex\n\n\t\tSet<V> deletedVertices = deletedAdjacentMap.keySet();\n\t\tList<V> coveredVertices = new ArrayList<V>();\n\n\t\tlog.info(\"deleted vertices: \" + deletedVertices);\n\n\t\tfor (V v : deletedVertices){\n\n\t\t\tif (coveredVertices.contains(v))\n\t\t\t\tcontinue;\n\n\t\t\tE addedEdge = deletedAdjacentMap.get(v);\n\t\t\tV firstAdjacent = addedEdge.getOrigin();\n\t\t\tV secondAdjacent = addedEdge.getDestination();\n\t\t\tPoint2D pos1 = ret.get(firstAdjacent);\n\t\t\tPoint2D pos2 = ret.get(secondAdjacent);\n\t\t\tif (pos1 != null && pos2 != null){\n\t\t\t\t//find deleted vertices on this line\n\n\t\t\t\tList<E> adjacentEdges = graph.adjacentEdges(v);\n\t\t\t\tE e1 = adjacentEdges.get(0);\n\t\t\t\tE e2 = adjacentEdges.get(1);\n\t\t\t\tV e1Next = e1.getOrigin() == v ? e1.getDestination() : e1.getOrigin();\n\t\t\t\tV e2Next = e2.getOrigin() == v ? e2.getDestination() : e2.getOrigin();\n\n\t\t\t\tif ((e1Next == firstAdjacent && e2Next == secondAdjacent) ||\n\t\t\t\t\t\t(e2Next == firstAdjacent && e1Next == secondAdjacent)){\n\n\t\t\t\t\t//just one vertex between two known\n\n\t\t\t\t\tdouble xPos = ret.get(e1Next).getX() + ((ret.get(e2Next).getX() - ret.get(e1Next).getX()) / 2);\n\t\t\t\t\tdouble yPos = ret.get(e1Next).getY() + ((ret.get(e2Next).getY() - ret.get(e1Next).getY()) / 2);\n\t\t\t\t\tret.put(v, new Point2D.Double(xPos, yPos));\n\t\t\t\t}\n\t\t\t\telse{\n\n\t\t\t\t\tList<V> verticesOnLine = new ArrayList<V>();\n\t\t\t\t\tverticesOnLine.add(v);\n\n\t\t\t\t\t//in all probability, traversing e1 is enough as the\n\t\t\t\t\t//vertex won't be somewhere in the middle, but directly \n\t\t\t\t\t//connected to one of the vertices whose positions are known\n\t\t\t\t\t//keep both for now\n\t\t\t\t\t//traverse e1\n\t\t\t\t\tE currentE = e1;\n\t\t\t\t\tint numberThroughE1 = 0;\n\t\t\t\t\twhile (e1Next != firstAdjacent && e1Next != secondAdjacent){\n\t\t\t\t\t\tif (!verticesOnLine.contains(e1Next)){\n\t\t\t\t\t\t\tverticesOnLine.add(e1Next);\n\t\t\t\t\t\t\tnumberThroughE1++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tList<E> currentAdjacent = graph.adjacentEdges(e1Next);\n\t\t\t\t\t\tif (currentAdjacent.get(0) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(1);\n\t\t\t\t\t\telse if (currentAdjacent.get(1) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(0);\n\n\t\t\t\t\t\te1Next = currentE.getOrigin() == e1Next ? currentE.getDestination() : currentE.getOrigin();\n\t\t\t\t\t}\n\n\n\t\t\t\t\t//traverse e2\n\t\t\t\t\tcurrentE = e2;\n\t\t\t\t\twhile (e2Next != firstAdjacent && e2Next != secondAdjacent){\n\t\t\t\t\t\tif (!verticesOnLine.contains(e2Next))\n\t\t\t\t\t\t\tverticesOnLine.add(e2Next);\n\n\t\t\t\t\t\tList<E> currentAdjacent = graph.adjacentEdges(e2Next);\n\t\t\t\t\t\tif (currentAdjacent.get(0) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(1);\n\t\t\t\t\t\telse if (currentAdjacent.get(1) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(0);\n\n\t\t\t\t\t\te2Next = currentE.getOrigin() == e2Next ? currentE.getDestination() : currentE.getOrigin();\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.info(\"vertices on line: \" + verticesOnLine);\n\t\t\t\t\tcoveredVertices.addAll(verticesOnLine);\n\n\t\t\t\t\tint numberOfVerticesOnLine = verticesOnLine.size();\n\t\t\t\t\tdouble incrementX = (ret.get(e2Next).getX() - ret.get(e1Next).getX()) / (numberOfVerticesOnLine + 1);\n\t\t\t\t\tdouble incrementY = (ret.get(e2Next).getY() - ret.get(e1Next).getY()) / (numberOfVerticesOnLine + 1);\n\n\t\t\t\t\tPoint2D currentPosition = ret.get(e1Next); //e1Next holds a vertex whose position is known\n\n\t\t\t\t\tfor (int i = numberThroughE1; i >= 0; i--){\n\t\t\t\t\t\tV currentV = verticesOnLine.get(i);\n\t\t\t\t\t\tPoint2D position = new Point2D.Double(currentPosition.getX() + incrementX, currentPosition.getY() + incrementY);\n\t\t\t\t\t\tret.put(currentV, position);\n\t\t\t\t\t\tcurrentPosition = position;\n\t\t\t\t\t}\n\n\n\t\t\t\t\tfor (int i = numberThroughE1 + 1; i< numberOfVerticesOnLine; i++){\n\t\t\t\t\t\tV currentV = verticesOnLine.get(i);\n\t\t\t\t\t\tPoint2D position = new Point2D.Double(currentPosition.getX() + incrementX, currentPosition.getY() + incrementY);\n\t\t\t\t\t\tret.put(currentV, position);\n\t\t\t\t\t\tcurrentPosition = position;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t}\n\n\t\t}\n\n\n\t\treturn ret;\n\t}", "public ArrayList<Integer> path(int startVertex, int stopVertex) {\n \tArrayList<Integer> toReturn = new ArrayList<Integer>();\n \tArrayList<Integer> temporary = new ArrayList<Integer>();\n \tif (!pathExists(startVertex, stopVertex)) {\n \t\treturn toReturn;\n \t}\n \tif (startVertex == stopVertex) {\n \t\ttoReturn.add(startVertex);\n \t\treturn toReturn;\n \t}\n \tIterator<Integer> iter = new DFSIterator(startVertex);\n \twhile (iter.hasNext()) {\n \t\tInteger toAdd = iter.next();\n \t\ttemporary.add(toAdd);\n \t\tif (toAdd.equals(stopVertex)) {\n \t\t\tbreak;\n \t\t}\n \t}\n \ttoReturn.add(0, stopVertex);\n \treturn pathHelper(temporary, toReturn);\n }", "@Override\n public Set<Coords> generateTrace(Coords source, Coords destination) throws GenerateTraceException{\n coordsSet.clear();\n coordsSet.add(source.clone());\n coordsSet.add(destination.clone());\n iterationLimit = Math.abs(source.getX()) + Math.abs(destination.getX()) + Math.abs(source.getY()) + Math.abs(destination.getY());\n\n if (!source.getX().equals(destination.getX()) && !source.getY().equals(destination.getY())) {\n return generateDiagonally();\n }\n return generateInLine();\n }", "private void transferLocal(Graph graph) {\n Set<NodePair> nonadjacencies = nonadjacencies(graph);\n for (Graph pag : input) {\n for (Edge edge : pag.getEdges()) {\n NodePair graphNodePair = new NodePair(graph.getNode(edge.getNode1().getName()), graph.getNode(edge.getNode2().getName()));\n if (nonadjacencies.contains(graphNodePair)) {\n continue;\n }\n if (!graph.isAdjacentTo(graphNodePair.getFirst(), graphNodePair.getSecond())) {\n graph.addEdge(new Edge(graphNodePair.getFirst(), graphNodePair.getSecond(), edge.getEndpoint1(), edge.getEndpoint2()));\n continue;\n }\n Endpoint first = edge.getEndpoint1();\n Endpoint firstCurrent = graph.getEndpoint(graphNodePair.getSecond(), graphNodePair.getFirst());\n if (!first.equals(Endpoint.CIRCLE)) {\n if ((first.equals(Endpoint.ARROW) && firstCurrent.equals(Endpoint.TAIL)) ||\n (first.equals(Endpoint.TAIL) && firstCurrent.equals(Endpoint.ARROW))) {\n graph.setEndpoint(graphNodePair.getSecond(), graphNodePair.getFirst(), Endpoint.CIRCLE);\n } else {\n graph.setEndpoint(graphNodePair.getSecond(), graphNodePair.getFirst(), edge.getEndpoint1());\n }\n }\n Endpoint second = edge.getEndpoint2();\n Endpoint secondCurrent = graph.getEndpoint(graphNodePair.getFirst(), graphNodePair.getSecond());\n if (!second.equals(Endpoint.CIRCLE)) {\n if ((second.equals(Endpoint.ARROW) && secondCurrent.equals(Endpoint.TAIL)) ||\n (second.equals(Endpoint.TAIL) && secondCurrent.equals(Endpoint.ARROW))) {\n graph.setEndpoint(graphNodePair.getFirst(), graphNodePair.getSecond(), Endpoint.CIRCLE);\n } else {\n graph.setEndpoint(graphNodePair.getFirst(), graphNodePair.getSecond(), edge.getEndpoint2());\n }\n }\n }\n for (Triple triple : pag.getUnderLines()) {\n Triple graphTriple = new Triple(graph.getNode(triple.getX().getName()), graph.getNode(triple.getY().getName()), graph.getNode(triple.getZ().getName()));\n if (graphTriple.alongPathIn(graph)) {\n graph.addUnderlineTriple(graphTriple.getX(), graphTriple.getY(), graphTriple.getZ());\n definiteNoncolliders.add(graphTriple);\n }\n }\n }\n }", "@Nullable\n public VertexPath<V> findAnyVertexPath(@Nonnull DirectedGraph<V, A> graph,\n V start, V goal) {\n Deque<V> vertices = new ArrayDeque<>();\n BackLinkWithArrow<V, A> current = breadthFirstSearch(graph, start, goal);\n if (current == null) {\n return null;\n }\n for (BackLinkWithArrow<V, A> i = current; i != null; i = i.parent) {\n vertices.addFirst(i.vertex);\n }\n return new VertexPath<>(vertices);\n }", "public int doDijkstras(String startVertex, String endVertex, ArrayList<String> shortestPath)\r\n\t{\r\n\t\tif(!this.dataMap.containsKey(startVertex) || !this.dataMap.containsKey(endVertex))\r\n\t\t{\r\n\t\t\tthrow new IllegalArgumentException(\"Vertex does not exist in the graph!\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tSet<String> visited = new HashSet<String>();\r\n\t\t\r\n\t\tPriorityQueue<Vertex> minDist = new PriorityQueue<Vertex>();\r\n\t\t\r\n\t\tVertex firstV = new Vertex(startVertex,startVertex,0);\r\n\t\tminDist.add(firstV);\r\n\t\t\r\n\t\tfor(String V : this.adjacencyMap.get(startVertex).keySet())\r\n\t\t{\r\n\t\t\tminDist.add(new Vertex(V,startVertex,this.getCost(startVertex, V)));\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//map of vertexName --> VertexObject\r\n\t\tHashMap<String, Vertex> mapV = new HashMap<String,Vertex>();\r\n\t\tmapV.put(startVertex, firstV);\t\r\n\t\t\r\n\t\t/*\r\n\t\t * Init keys-->costs\r\n\t\t */\r\n\t\tfor(String key : this.getVertices())\r\n\t\t{\r\n\t\t\tif(key.equals(startVertex))\r\n\t\t\t{\r\n\t\t\t\tmapV.put(key, new Vertex(key,null,0));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tmapV.put(key, new Vertex(key,null,Integer.MAX_VALUE));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\r\n\t\t/*\r\n\t\t * Init List for shortest path\r\n\t\t */\r\n\t\tLinkedList<String> list = new LinkedList<String>();\r\n\t\tlist.add(startVertex);\r\n\r\n\t\tHashMap<String,List<String>> path = new HashMap<String,List<String>>();\r\n\t\tpath.put(startVertex, list);\r\n\t\t\r\n\t\twhile(!minDist.isEmpty())\r\n\t\t{\r\n\t\t\tVertex node = minDist.poll();\r\n\t\t\tString V = node.current;\r\n\t\t\tint minimum = node.cost;\r\n\t\t\tSystem.out.println(minDist.toString());\r\n\t\t\t\r\n\t\t\t\tvisited.add(V);\r\n\t\t\t\t\r\n\t\t\t\tTreeSet<String> adj = new TreeSet<String>(this.adjacencyMap.get(V).keySet());\r\n\t\t\t\t\r\n\t\t\t\tfor(String successor : adj)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(!visited.contains(successor) && !V.equals(successor))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\tint newCost = this.getCost(V, successor)+minimum;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(newCost < mapV.get(successor).cost)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tminDist.remove(mapV.get(successor));\r\n\t\t\t\t\t\t\t\tminDist.add(new Vertex(successor,V,newCost));\r\n\t\t\t\t\t\t\t\tmapV.put(successor, new Vertex(successor,V,newCost));\r\n\r\n\t\t\t\t\t\t\t\tLinkedList<String> newList = new LinkedList<String>(path.get(V));\r\n\t\t\t\t\t\t\t\tnewList.add(successor);\r\n\t\t\t\t\t\t\t\tpath.put(successor, newList);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tint smallestPath = mapV.get(endVertex).cost == Integer.MAX_VALUE ? -1 : mapV.get(endVertex).cost;\r\n\t\t\r\n\t\tif(smallestPath == -1)\r\n\t\t{\r\n\t\t\tshortestPath.add(\"None\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tfor(String node : path.get(endVertex))\r\n\t\t\t{\r\n\t\t\t\tshortestPath.add(node);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn smallestPath;\r\n\t}" ]
[ "0.7129166", "0.70499766", "0.68662", "0.67834175", "0.6776748", "0.6706605", "0.66688627", "0.65719706", "0.65149254", "0.648122", "0.6469439", "0.6404605", "0.6375499", "0.6361938", "0.6346237", "0.6310533", "0.62919825", "0.62916595", "0.6286229", "0.62842476", "0.62779343", "0.6258166", "0.62419367", "0.6181749", "0.6171946", "0.6163696", "0.61592346", "0.6148185", "0.61372256", "0.61372036", "0.6133048", "0.61293215", "0.6120266", "0.60994065", "0.60908484", "0.60876113", "0.6080277", "0.60784113", "0.60626096", "0.60311574", "0.5999875", "0.59868467", "0.5981501", "0.59735787", "0.5970606", "0.5966792", "0.596107", "0.5955937", "0.59410745", "0.5932384", "0.5921093", "0.5920655", "0.5909512", "0.5896764", "0.58769256", "0.58764637", "0.58687294", "0.5866579", "0.5860698", "0.58557504", "0.58535355", "0.58532375", "0.58520246", "0.5848312", "0.58478945", "0.5839908", "0.5827465", "0.5827398", "0.5791638", "0.5791512", "0.57861656", "0.5782911", "0.57803404", "0.57739383", "0.5773783", "0.5772457", "0.5772364", "0.5747214", "0.57402307", "0.5729584", "0.5718304", "0.5686419", "0.56861204", "0.5684406", "0.56836694", "0.5682024", "0.56609106", "0.5656037", "0.5652418", "0.56461066", "0.5633753", "0.5625117", "0.56225544", "0.5622104", "0.5616139", "0.56107706", "0.56097406", "0.55998224", "0.559684", "0.5591699", "0.559127" ]
0.0
-1
This helper function converts a stack of vertices into a corresponding graph of vertices. It also finds and adds the edges between those vertices.
@Deprecated protected Graph convertStackToGraph(Stack<Vertex> stack) { Graph graph = new Graph(); Iterator<Vertex> iter = stack.iterator(); Vertex previous = iter.next(); graph.putVertex(previous); while(iter.hasNext()) { Vertex curr = iter.next(); graph.putVertex(curr); graph.putEdge(getEdge(previous.getAnnotation("hash"), curr.getAnnotation("hash"))); previous = curr; } return graph; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Graph createGraph() {\n String fileName;\n// fileName =\"./428333.edges\";\n String line;\n Graph g = new Graph();\n// List<String> vertexNames = new ArrayList<>();\n// try\n// {\n// BufferedReader in=new BufferedReader(new FileReader(fileName));\n// line=in.readLine();\n// while (line!=null) {\n////\t\t\t\tSystem.out.println(line);\n// String src = line.split(\" \")[0];\n// String dst = line.split(\" \")[1];\n//// vertexNames.add(src);\n//// vertexNames.add(dst);\n//// System.out.println(src+\" \"+dst);\n// g.addEdge(src, dst, 1);\n// line=in.readLine();\n// }\n// in.close();\n// } catch (Exception e) {\n//\t\t\te.printStackTrace();\n// }\n\n fileName=\"./788813.edges\";\n// List<String> vertexNames = new ArrayList<>();\n try\n {\n BufferedReader in=new BufferedReader(new FileReader(fileName));\n line=in.readLine();\n while (line!=null) {\n//\t\t\t\tSystem.out.println(line);\n String src = line.split(\" \")[0];\n String dst = line.split(\" \")[1];\n g.addEdge(src, dst, 1);\n line=in.readLine();\n }\n in.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n// Graph g = new Graph(new String[]{\"v0\", \"v1\", \"v2\", \"v3\", \"v4\", \"v5\", \"v6\", \"v7\", \"v8\"});\n// // Add the required edges.\n// g.addEdge(\"v0\", \"v1\", 4); g.addEdge(\"v0\", \"v7\", 8);\n// g.addEdge(\"v1\", \"v2\", 8); g.addEdge(\"v1\", \"v7\", 11); g.addEdge(\"v2\", \"v1\", 8);\n// g.addEdge(\"v2\", \"v8\", 2); g.addEdge(\"v2\", \"v5\", 4); g.addEdge(\"v2\", \"v3\", 7);\n// g.addEdge(\"v3\", \"v2\", 7); g.addEdge(\"v3\", \"v5\", 14); g.addEdge(\"v3\", \"v4\", 9);\n// g.addEdge(\"v4\", \"v3\", 9); g.addEdge(\"v4\", \"v5\", 10);\n// g.addEdge(\"v5\", \"v4\", 10); g.addEdge(\"v5\", \"v3\", 9); g.addEdge(\"v5\", \"v2\", 4);\n// g.addEdge(\"v5\", \"v6\", 2);\n// g.addEdge(\"v6\", \"v7\", 1); g.addEdge(\"v6\", \"v8\", 6); g.addEdge(\"v6\", \"v5\", 2);\n// g.addEdge(\"v7\", \"v0\", 8); g.addEdge(\"v7\", \"v8\", 7); g.addEdge(\"v7\", \"v1\", 11);\n// g.addEdge(\"v7\", \"v6\", 1);\n// g.addEdge(\"v8\", \"v2\", 2); g.addEdge(\"v8\", \"v7\", 7); g.addEdge(\"v8\", \"v6\", 6);\n\n//\n return g;\n }", "private List<Vertex> prepareGraphAdjacencyList() {\n\n\t\tList<Vertex> graph = new ArrayList<Vertex>();\n\t\tVertex vertexA = new Vertex(\"A\");\n\t\tVertex vertexB = new Vertex(\"B\");\n\t\tVertex vertexC = new Vertex(\"C\");\n\t\tVertex vertexD = new Vertex(\"D\");\n\t\tVertex vertexE = new Vertex(\"E\");\n\t\tVertex vertexF = new Vertex(\"F\");\n\t\tVertex vertexG = new Vertex(\"G\");\n\n\t\tList<Edge> edges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexB, 2));\n\t\tedges.add(new Edge(vertexD, 6));\n\t\tedges.add(new Edge(vertexF, 5));\n\t\tvertexA.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexA, 2));\n\t\tedges.add(new Edge(vertexC, 7));\n\t\tvertexB.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexB, 7));\n\t\tedges.add(new Edge(vertexD, 9));\n\t\tedges.add(new Edge(vertexF, 1));\n\t\tvertexC.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexA, 6));\n\t\tedges.add(new Edge(vertexC, 9));\n\t\tedges.add(new Edge(vertexE, 4));\n\t\tedges.add(new Edge(vertexG, 8));\n\t\tvertexD.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexD, 4));\n\t\tedges.add(new Edge(vertexF, 3));\n\t\tvertexE.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexA, 5));\n\t\tedges.add(new Edge(vertexC, 1));\n\t\tedges.add(new Edge(vertexE, 3));\n\t\tvertexF.incidentEdges = edges;\n\n\t\tedges = new ArrayList<Edge>();\n\t\tedges.add(new Edge(vertexD, 8));\n\t\tvertexG.incidentEdges = edges;\n\n\t\tgraph.add(vertexA);\n\t\tgraph.add(vertexB);\n\t\tgraph.add(vertexC);\n\t\tgraph.add(vertexD);\n\t\tgraph.add(vertexE);\n\t\tgraph.add(vertexF);\n\t\tgraph.add(vertexG);\n\n\t\treturn graph;\n\t}", "public String depthFirstSearch( AnyType start_vertex ) throws VertexException {\n \n StringBuffer buffer = new StringBuffer();\n \n // ----------------------------\n // TODO: Add your code here\n // ----------------------------\n ConstantTimeStack<Vertex<AnyType>> stack = new ConstantTimeStack<Vertex<AnyType>>();\n boolean exists = false;\n Vertex<AnyType> S = new Vertex<AnyType>(start_vertex);\n int counter = 0;\n //loop through to set each vertex to not visited\n for( int i = 0; i < vertex_adjacency_list.size(); i++){\n vertex_adjacency_list.get(i).setVisited(-1);\n //if find the start vertex then set index position to counter\n if(vertex_adjacency_list.get(i).compareTo(S) == 0){\n exists = true;\n vertex_adjacency_list.get(i).setVisited(counter);\n counter = i;\n }\n }\n //if doesn't exist then through exception\n if(exists == false){\n throw new VertexException(\"Start Vertex does not exist\");\n }\n //if it does exist then push start node onto stack, set visited \n else if(exists){\n stack.push(vertex_adjacency_list.get(counter));\n vertex_adjacency_list.get(counter).setVisited(1);\n Vertex <AnyType> e = vertex_adjacency_list.get(counter);\n counter = 2;\n int n = e.numberOfAdjacentVertices();\n try{\n \n while(true){\n //loop through e's adjacent vertices \n for (n = e.numberOfAdjacentVertices()-1; n >=0 ; n--){\n //if the adacent vertex has not been visited\n if(e.getAdjacentVertex(n).hasBeenVisited()==false){\n //change e to adjacent vertex and push onto stack\n e = e.getAdjacentVertex(n);\n stack.push(e);\n //set e as visited at counter\n e.setVisited(counter);\n counter++;\n //reset n to e's num of vertices\n n = e.numberOfAdjacentVertices();\n }\n //if it has been visited and it's the first node in list\n //then pop it off the stack and then set e to new top\n //set n to new num of vertices\n else if(e.getAdjacentVertex(n).hasBeenVisited() && n == 0){\n stack.pop();\n e = stack.peek();\n n = e.numberOfAdjacentVertices();\n }\n }\n }\n }catch(EmptyStackException m){\n }\n }\n //loop through the list and print each with when it was visited\n for(int k = 0; k< vertex_adjacency_list.size(); k++){\n buffer.append(vertex_adjacency_list.get(k) + \":\" + vertex_adjacency_list.get(k).getVisited()+ \"\\n\");\n }\n \n return buffer.toString();\n \n }", "public abstract Set<? extends EE> edgesOf(VV vertex);", "public static void main(String args[]) {\n int V = 4;\n Graph g = new Graph(V);\n g.addEdge(0, 1);\n g.addEdge(0, 2);\n g.addEdge(1, 2);\n g.addEdge(2, 0);\n g.addEdge(2, 3);\n g.addEdge(3, 3);\n\n int src = 1;\n int dest = 3;\n boolean[] visited = new boolean[V];\n\n // To store the complete path between source and destination\n Stack<Integer> path1 = new Stack<>();\n\n if (hasPathDFS(g, src, dest, visited, path1)) {\n System.out.println(\"There is a path from \" + src + \" to \" + dest);\n System.out.println(\"The complete path is \" + path1);\n } else System.out.println(\"There is no path from \" + src + \" to \" + dest);\n\n src = 3;\n dest = 1;\n // To store the complete path between source and destination\n Stack<Integer> path2 = new Stack<>();\n\n if (hasPathDFS(g, src, dest, visited, path2)) System.out.println(\"There is a path from \" + src + \" to \" + dest);\n else System.out.println(\"There is no path from \" + src + \" to \" + dest);\n\n // total number of nodes in the graph (labeled from 0 to 7)\n int n = 8;\n\n // List of graph edges as per the above diagram\n Graph g2 = new Graph(n);\n /**\n * There is a path from 1 to 3\n * The complete path is [1, 2, 3]\n * There is no path from 3 to 1\n * There is a path from 0 to 7\n * The complete path is [0, 3, 4, 6, 7]\n */\n\n g2.addEdge(0, 3);\n g2.addEdge(1, 0);\n g2.addEdge(1, 2);\n g2.addEdge(1, 4);\n g2.addEdge(2, 7);\n g2.addEdge(3, 4);\n g2.addEdge(3, 5);\n g2.addEdge(4, 3);\n g2.addEdge(4, 6);\n g2.addEdge(5, 6);\n g2.addEdge(6, 7);\n\n // source and destination vertex\n src = 0;\n dest = 7;\n\n // To store the complete path between source and destination\n Stack<Integer> path = new Stack<>();\n boolean[] visited2 = new boolean[n];\n\n if (hasPathDFS(g2, src, dest, visited2, path)) {\n System.out.println(\"There is a path from \" + src + \" to \" + dest);\n System.out.println(\"The complete path is \" + path);\n } else System.out.println(\"There is no path from \" + src + \" to \" + dest);\n\n\n }", "public void setVertices(){\n\t\tvertices = new ArrayList<V>();\n\t\tfor (E e : edges){\n\t\t\tV v1 = e.getOrigin();\n\t\t\tV v2 = e.getDestination();\n\t\t\tif (!vertices.contains(v1))\n\t\t\t\tvertices.add(v1);\n\t\t\tif (!vertices.contains(v2))\n\t\t\t\tvertices.add(v2);\n\t\t}\n\t}", "private void DFS(Vertex start, Set<Vertex> visited, Stack<Vertex> stack) {\r\n\t\t// if(visited.contains(start)) return;\r\n\r\n\t\t// Mark the current node as visited and push it\r\n\t\tvisited.add(start);\r\n\t\tstack.push(start);\r\n\r\n\t\tVertex currentNode;\r\n\t\tSet<Vertex> neighbors;\r\n\r\n\t\twhile (stack.size() > 0) {\r\n\t\t\t// Pop a vertex from stack and print it\r\n\t\t\tcurrentNode = stack.pop();\r\n\r\n\t\t\tSystem.out.print(currentNode + \" \");\r\n\r\n\t\t\t// Get all adjacent vertices of the dequeued vertex s\r\n\t\t\t// If a adjacent has not been visited, then mark it\r\n\t\t\t// visited and enqueue it\r\n\t\t\tneighbors = currentNode.getNeighbors();\r\n\r\n\t\t\tfor (Vertex n : neighbors) {\r\n\t\t\t\tif (!visited.contains(n)) {\r\n\t\t\t\t\tvisited.add(n);\r\n\t\t\t\t\tstack.push(n);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@SuppressWarnings({\"rawtypes\", \"unchecked\", \"SuspiciousMethodCalls\"})\n private List getDepthFirstTraversal_iterative_usingStack_BigO_VPlusE() throws Exception {\n Map<Object, Boolean> visited = new LinkedHashMap<>();\n Stack watchStack = new Stack();\n\n V root = data.keySet().stream().findFirst().orElseThrow(() -> new Exception(\"Graph is Empty\"));\n watchStack.push(root);\n visited.put(root, true);\n\n while(!watchStack.isEmpty()) {\n Object currentVertex = watchStack.top();\n\n BinarySearchTree<E> edgeTree = data.getOrDefault(currentVertex, new BinarySearchTree<>());\n List<E> edges = edgeTree.getTreeByInOrder_depthFirst();\n\n //Remove an item from the stack when there are no edges or all the edges are visited for that vertex\n if(edgeTree.isEmpty() || visited.keySet().containsAll(edges)) {\n watchStack.pop();\n } else {\n for(E edge : edges) {\n if(!visited.containsKey(edge)) {\n watchStack.push(edge);\n visited.put(edge, true);\n break;\n }\n }\n }\n }\n return new ArrayList<>(visited.keySet());\n }", "public Graph(Collection<LabeledEdge> edges, Collection<Vertex> vertices) {\n\t\tthis.edges = new HashSet<>(edges);\n\t\tthis.vertices = new HashSet<>(vertices);\n\t\tthis.edgesByStart = new HashMap<>();\n\t\tthis.edgesByEnd = new HashMap<>();\n\t\tthis.edgesByAction = new HashMap<>();\n\t\tthis.searcher = null;\n\t\tfor(Vertex vertex : vertices){\n\t\t\tthis.edgesByStart.put(vertex, new HashSet<LabeledEdge>());\n\t\t\tthis.edgesByEnd.put(vertex, new HashSet<LabeledEdge>());\n\t\t}\n\t\tfor(LabeledEdge trans : edges){\n\t\t\tassert(edgesByStart.keySet().contains(trans.getStart()));\n\t\t\tassert(edgesByEnd.keySet().contains(trans.getEnd()));\n\t\t\tthis.edgesByStart.get(trans.getStart()).add(trans);\n\t\t\tthis.edgesByEnd.get(trans.getEnd()).add(trans);\n\t\t\tif(edgesByAction.get(trans.getLabel()) == null)\n\t\t\t\tedgesByAction.put(trans.getLabel(), new HashSet<LabeledEdge>());\n\t\t\tthis.edgesByAction.get(trans.getLabel()).add(trans);\n\t\t}\n\t}", "public static strictfp void main(String... args) {\n\t\tArrayList<Vertex> graph = new ArrayList<>();\r\n\t\tHashMap<Character, Vertex> map = new HashMap<>();\r\n\t\t// add vertices\r\n\t\tfor (char c = 'a'; c <= 'i'; c++) {\r\n\t\t\tVertex v = new Vertex(c);\r\n\t\t\tgraph.add(v);\r\n\t\t\tmap.put(c, v);\r\n\t\t}\r\n\t\t// add edges\r\n\t\tfor (Vertex v: graph) {\r\n\t\t\tif (v.getNodeId() == 'a') {\r\n\t\t\t\tv.getAdjacents().add(map.get('b'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t} else if (v.getNodeId() == 'b') {\r\n\t\t\t\tv.getAdjacents().add(map.get('a'));\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t} else if (v.getNodeId() == 'c') {\r\n\t\t\t\tv.getAdjacents().add(map.get('b'));\r\n\t\t\t\tv.getAdjacents().add(map.get('d'));\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t\tv.getAdjacents().add(map.get('i'));\r\n\t\t\t} else if (v.getNodeId() == 'd') {\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('e'));\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t} else if (v.getNodeId() == 'e') {\r\n\t\t\t\tv.getAdjacents().add(map.get('d'));\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t} else if (v.getNodeId() == 'f') {\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('d'));\r\n\t\t\t\tv.getAdjacents().add(map.get('e'));\r\n\t\t\t\tv.getAdjacents().add(map.get('g'));\r\n\t\t\t} else if (v.getNodeId() == 'g') {\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t\tv.getAdjacents().add(map.get('i'));\r\n\t\t\t} else if (v.getNodeId() == 'h') {\r\n\t\t\t\tv.getAdjacents().add(map.get('a'));\r\n\t\t\t\tv.getAdjacents().add(map.get('b'));\r\n\t\t\t\tv.getAdjacents().add(map.get('g'));\r\n\t\t\t\tv.getAdjacents().add(map.get('i'));\r\n\t\t\t} else if (v.getNodeId() == 'i') {\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('g'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t// graph created\r\n\t\t// create disjoint sets\r\n\t\tDisjointSet S = null, V_S = null;\r\n\t\tfor (Vertex v: graph) {\r\n\t\t\tchar c = v.getNodeId();\r\n\t\t\tif (c == 'a' || c == 'b' || c == 'd' || c == 'e') {\r\n\t\t\t\tif (S == null) {\r\n\t\t\t\t\tS = v.getDisjointSet();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tDisjointSet set = DisjointSet.union(S, v.getDisjointSet());\r\n\t\t\t\t\tv.setDisjointSet(set);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (V_S == null) {\r\n\t\t\t\t\tV_S = v.getDisjointSet();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tDisjointSet set = DisjointSet.union(V_S, v.getDisjointSet());\r\n\t\t\t\t\tv.setDisjointSet(set);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Disjoint sets created\r\n\t\tfor (Vertex u: graph) {\r\n\t\t\tfor (Vertex v: u.getAdjacents()) {\r\n\t\t\t\tif (DisjointSet.findSet((DisjointSet) u.getDisjointSet()) == \r\n\t\t\t\t DisjointSet.findSet((DisjointSet) v.getDisjointSet())) {\r\n\t\t\t\t\tSystem.out.println(\"The cut respects (\" + u.getNodeId() + \", \" + v.getNodeId() + \").\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public Stack<Vertex> next() {\n Vertex u = lov.pop();\n for (Edge e : u.outEdges) {\n if (!e.to.visited) {\n cameFromEdge.put(e.to.toIdentifier(), e.from);\n if (e.to.x == MazeWorld.width - 1 && e.to.y == MazeWorld.height - 1) {\n reconstruct(cameFromEdge, e.to);\n lov = new Stack<Vertex>();\n }\n else {\n lov.push(u);\n e.to.visited = true;\n lov.push(e.to);\n break;\n }\n }\n }\n return lov;\n }", "public void testEdgesSet_ofVertices() {\n System.out.println(\"edgesSet\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n Set<Edge<Integer>> set = graph.edgesSet(new Integer(i), new Integer(j));\n\n if ((i + j) % 2 == 0) {\n Assert.assertEquals(set.size(), 1);\n } else {\n Assert.assertEquals(set.size(), 0);\n }\n }\n }\n }", "Graph(List<Edge> edges) {\n\n //one pass to find all vertices\n // this step avoid add isolated coordinates to the graph\n for (Edge e : edges) {\n if (!graph.containsKey(e.startNode)) {\n graph.put(e.startNode, new Node(e.startNode));\n }\n if (!graph.containsKey(e.endNode)) {\n graph.put(e.endNode, new Node(e.endNode));\n }\n }\n\n //another pass to set neighbouring vertices\n for (Edge e : edges) {\n graph.get(e.startNode).neighbours.put(graph.get(e.endNode), e.weight);\n //graph.get(e.v2).neighbours.put(graph.get(e.v1), e.dist); // also do this for an undirected graph\n }\n }", "protected AbstractGraph(List<Edges> edges,List<V> vertices){\n\t\t\n\t\tfor(int i=0;i<vertices.size();i++)\n\t\t\tthis.vertices.add(vertices.get(i));\n\t\t\n\t\tcreateAdjacencyLists(edges,vertices.size());\t\t\n\t}", "public static void main(String[] args) {\n\t\tVertex v1, v2, v3, v4, v5, v6, v7;\n\t\tv1 = new Vertex(\"v1\");\n\t\tv2 = new Vertex(\"v2\");\n\t\tv3 = new Vertex(\"v3\");\n\t\tv4 = new Vertex(\"v4\");\n\t\tv5 = new Vertex(\"v5\");\n\t\tv6 = new Vertex(\"v6\");\n\t\tv7 = new Vertex(\"v7\");\n\n\t\tv1.addAdjacency(v2, 2);\n\t\tv1.addAdjacency(v3, 4);\n\t\tv1.addAdjacency(v4, 1);\n\n\t\tv2.addAdjacency(v1, 2);\n\t\tv2.addAdjacency(v4, 3);\n\t\tv2.addAdjacency(v5, 10);\n\n\t\tv3.addAdjacency(v1, 4);\n\t\tv3.addAdjacency(v4, 2);\n\t\tv3.addAdjacency(v6, 5);\n\n\t\tv4.addAdjacency(v1, 1);\n\t\tv4.addAdjacency(v2, 3);\n\t\tv4.addAdjacency(v3, 2);\n\t\tv4.addAdjacency(v5, 2);\n\t\tv4.addAdjacency(v6, 8);\n\t\tv4.addAdjacency(v7, 4);\n\n\t\tv5.addAdjacency(v2, 10);\n\t\tv5.addAdjacency(v4, 2);\n\t\tv5.addAdjacency(v7, 6);\n\n\t\tv6.addAdjacency(v3, 5);\n\t\tv6.addAdjacency(v4, 8);\n\t\tv6.addAdjacency(v7, 1);\n\n\t\tv7.addAdjacency(v4, 4);\n\t\tv7.addAdjacency(v5, 6);\n\t\tv7.addAdjacency(v6, 1);\n\n\t\tArrayList<Vertex> weightedGraph = new ArrayList<Vertex>();\n\t\tweightedGraph.add(v1);\n\t\tweightedGraph.add(v2);\n\t\tweightedGraph.add(v3);\n\t\tweightedGraph.add(v4);\n\t\tweightedGraph.add(v5);\n\t\tweightedGraph.add(v6);\n\t\tweightedGraph.add(v7);\n\t\t\n\t\tdijkstra( weightedGraph, v7 );\n\t\tprintPath( v1 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v2 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v3 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v4 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v5 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v6 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v7 );\n\t\tSystem.out.println(\"\");\n\t}", "private void topologicalSort(Vertex start, Set<Vertex> visited, Stack<Vertex> stack) {\n\t\tvisited.add(start);\r\n\r\n\t\tSet<Vertex> neighbors = start.getNeighbors();\r\n\r\n\t\t// Get all adjacent vertices of the vertex s and recurse\r\n\t\tneighbors.forEach(n -> {\r\n\t\t\tif (!visited.contains(n))\r\n\t\t\t\ttopologicalSort(n, visited, stack);\r\n\t\t});\r\n\r\n\t\tstack.push(start);\r\n\t}", "@Test\n void test03_addEdgeBetweenVerticesWhichDontExist() {\n graph.addEdge(\"a\", \"b\");\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\"); // creates mock up vertex list\n if (!graph.getAllVertices().equals(vertices)) { // compares vertices list\n fail(\"Graph didn't add the vertices correctly\");\n }\n List<String> adjOfA = new ArrayList<>();\n adjOfA.add(\"b\"); // creates mock up adjacent list\n if (!graph.getAdjacentVerticesOf(\"a\").equals(adjOfA)) { // compares adjacent lists\n fail(\"Graph didn't correctly place adjacent vertices\");\n }\n }", "public Set<Edge<V>> getEdges(V vertex);", "public static void main(String[] args) throws IOException {\n File file = new File(\"tinyGex2.txt\");\n Scanner sc = new Scanner(file);\n Graph graph = new Graph(sc.nextInt());\n int temp = sc.nextInt();\n\n for(int i = 0; i < temp; i++){\n graph.addEdge(sc.nextInt(), sc.nextInt());\n }\n\n sc.close();\n\n //here is my test client for this portion of the homework. The implementation is super simple. I did have to add a 'contains' method to Sedgwick's Bag class. Found that a bit odd, but oh well.\n System.out.println(graph.hasEdge(10, 3));\n System.out.println(graph.hasEdge(11, 1));\n System.out.println(graph.hasEdge(9, 11));\n System.out.println();\n\n /*\n * HW6\n * 4.2.4\n *\n */\n\n file = new File(\"tinyDGex2.txt\");\n sc = new Scanner(file);\n Digraph digraph = new Digraph(sc.nextInt());\n temp = sc.nextInt();\n\n for(int i = 0; i < temp; i++){\n digraph.addEdge(sc.nextInt(), sc.nextInt());\n }\n\n sc.close();\n\n //Really nothing different here. Modded the test client to make sure it was seeing that the paths only went one way. 10 and 3 are connected in both directions; 11 and 8 are not.\n System.out.println(digraph.hasEdge(10, 3));\n System.out.println(digraph.hasEdge(3, 10));\n System.out.println(digraph.hasEdge(11, 8));\n System.out.println(digraph.hasEdge(8, 11));\n System.out.println();\n\n\n /*\n * HW6\n * 4.4.3\n * Note: Since you didn't specify which graph we should use for input, I used the edge-weighted DAG on page 658 as input\n */\n\n file = new File(\"tinyEWDAG.txt\");\n sc = new Scanner(file);\n EdgeWeightedDigraph ewd = new EdgeWeightedDigraph(sc);\n sc.close();\n\n //I wanted to output the list back into the input form. It's not in the same order, but it has the same values\n //saves to 'output.txt' in the root folder if you want to look at the output\n FileWriter fw = new FileWriter(\"output.txt\");\n fw.write(ewd.toString());\n fw.close();\n\n System.out.println(ewd.edgeWeight(4, 0));\n System.out.println(ewd.edgeWeight(2, 3));\n System.out.println(ewd.edgeWeight(6, 2));\n System.out.println(ewd.edgeWeight(5, 4));\n }", "@Test\n void test08_getAllAdjacentVertices() {\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"a\", \"c\"); // add two edges\n\n List<String> check = new ArrayList<>();\n check.add(\"b\");\n check.add(\"c\"); // create mock up adjacent list\n\n if (!check.equals(graph.getAdjacentVerticesOf(\"a\"))) { // checks if both are same\n fail(\"graph didn't record adjacent vertices correctly\");\n }\n }", "private List<routerNode> getPathVertexList(routerNode beginNode, routerNode endNode) {\r\n\t\tTransformer<routerLink, Integer> wtTransformer; // transformer for getting edge weight\r\n\t\twtTransformer = new Transformer<routerLink, Integer>() {\r\n public Integer transform(routerLink link) {\r\n return link.getWeight();\r\n \t}\r\n };\t\t\r\n\r\n\t\t\r\n\t\tList<routerNode> vlist;\r\n\t\tDijkstraShortestPath<routerNode, routerLink> DSPath = \r\n\t \t new DijkstraShortestPath<routerNode, routerLink>(gGraph, wtTransformer);\r\n \t// get the shortest path in the form of edge list \r\n List<routerLink> elist = DSPath.getPath(beginNode, endNode);\r\n\t\t\r\n \t\t// get the node list form the shortest path\r\n\t Iterator<routerLink> ebIter = elist.iterator();\r\n\t vlist = new ArrayList<routerNode>(elist.size() + 1);\r\n \tvlist.add(0, beginNode);\r\n\t for(int i=0; i<elist.size(); i++){\r\n\t\t routerLink aLink = ebIter.next();\r\n\t \t \t// get the nodes corresponding to the edge\r\n \t\tPair<routerNode> endpoints = gGraph.getEndpoints(aLink);\r\n\t routerNode V1 = endpoints.getFirst();\r\n\t routerNode V2 = endpoints.getSecond();\r\n\t \tif(vlist.get(i) == V1)\r\n\t \t vlist.add(i+1, V2);\r\n\t else\r\n\t \tvlist.add(i+1, V1);\r\n\t }\r\n\t return vlist;\r\n\t}", "List<V> getAdjacentVertexList(V v);", "public interface VertexCoverAlgorithm {\n\n\t/**\n\t * Finds a <code>Collection</code> of vertices such that for every \n\t * {@link org._3pq.jgrapht.Edge} in the {@link org._3pq.jgrapht.UnirectedGraph},\n\t * at least one of its two vertices is in the<code>Collection</code>}.\n\t * \n\t * @return a <code>Collection</code> representing the Vertex Cover \n\t * of the <code>UnirectedGraph</code>.\n\t */\n\tpublic Collection vertexCover();\n}", "public interface GraphInterface {\n\n\t/**\n\t * Finds the shortest path between the start and end vertices.\n\t * @param start -- The starting node\n\t * @param end -- The target node\n\t * @return A list representing the desired path, or NULL if the vertices are not connected.\n\t * @throws GraphException if start and end are not in the graph\n\t */\n\tIterable<Vertex> computePath(Vertex start, Vertex end) throws GraphException;\n\t\n\t/**\n\t * Finds the shortest path between the start and end vertices, given that start is not in the graph\n\t * @param start -- The starting node\n\t * @param end -- The target node\n\t * @return A list representing the desired path, or NULL if the vertices are not connected.\n\t * @throws GraphException if end is not in the graph\n\t */\n\tIterable<Vertex> computePathToGraph(Loc start, Vertex end) throws GraphException;\n\t\n\t/**\n\t * Finds the closest vertex to pos in the graph\n\t * @param pos -- The position not on the graph.\n\t * @return closest vertex to pos in the graph.\n\t */\n\tPair<Vertex, Double> closestVertexToPath(Loc pos);\n\t\n\t/**\n\t * adds a single unconnected vertex v \n\t * @param v -- The vertex to be added\n\t */\n\tvoid addVertex(Vertex v);\n\t\n\t/**\n\t * Adds a single vertex with edges (v, neighbor) for each neighbor\n\t * @param v -- The vertex to be added\n\t * @param neighbors -- The neighbors of v\n\t * @param weights -- The corresponding weights of each (v, neighbor)\n\t * @throws VertexNotInGraphException if neighbors are not in the graph\n\t */\n\tvoid addVertex(Vertex v, ArrayList<Vertex> neighbors, ArrayList<Double> weights) throws VertexNotInGraphException;\n\t\n\t/**\n\t * Removes v from the Graph\n\t * @param v -- The vertex to be removed\n\t * @throws VertexNotInGraphException if v is not in the graph\n\t */\n\tvoid removeVertex(Vertex v) throws GraphException;\n\t\n\t/**\n\t * Adds an edge between v1 and v2 in the graph\n\t * @param v1 -- The first vertex the edge is incident to\n\t * @param v2 -- The second vertex the edge is incident to\n\t * @param w -- The weight of the edge\n\t * @throws VertexNotInGraphException if v1 or v2 are not in the graph\n\t */\n\tvoid addEdge(Vertex v1, Vertex v2, Double w) throws VertexNotInGraphException;\n\t\n\t/**\n\t * Removes the edge (v1, v2) in the graph\n\t * @param v1 -- The first vertex the edge is incident to\n\t * @param v2 -- The second vertex the edge is incident to\n\t * @throws VertexNotInGraphException if v1 or v2 are not in the graph\n\t */\n\tvoid removeEdge(Vertex v1, Vertex v2) throws GraphException;\n}", "private void transferLocal(Graph graph) {\n Set<NodePair> nonadjacencies = nonadjacencies(graph);\n for (Graph pag : input) {\n for (Edge edge : pag.getEdges()) {\n NodePair graphNodePair = new NodePair(graph.getNode(edge.getNode1().getName()), graph.getNode(edge.getNode2().getName()));\n if (nonadjacencies.contains(graphNodePair)) {\n continue;\n }\n if (!graph.isAdjacentTo(graphNodePair.getFirst(), graphNodePair.getSecond())) {\n graph.addEdge(new Edge(graphNodePair.getFirst(), graphNodePair.getSecond(), edge.getEndpoint1(), edge.getEndpoint2()));\n continue;\n }\n Endpoint first = edge.getEndpoint1();\n Endpoint firstCurrent = graph.getEndpoint(graphNodePair.getSecond(), graphNodePair.getFirst());\n if (!first.equals(Endpoint.CIRCLE)) {\n if ((first.equals(Endpoint.ARROW) && firstCurrent.equals(Endpoint.TAIL)) ||\n (first.equals(Endpoint.TAIL) && firstCurrent.equals(Endpoint.ARROW))) {\n graph.setEndpoint(graphNodePair.getSecond(), graphNodePair.getFirst(), Endpoint.CIRCLE);\n } else {\n graph.setEndpoint(graphNodePair.getSecond(), graphNodePair.getFirst(), edge.getEndpoint1());\n }\n }\n Endpoint second = edge.getEndpoint2();\n Endpoint secondCurrent = graph.getEndpoint(graphNodePair.getFirst(), graphNodePair.getSecond());\n if (!second.equals(Endpoint.CIRCLE)) {\n if ((second.equals(Endpoint.ARROW) && secondCurrent.equals(Endpoint.TAIL)) ||\n (second.equals(Endpoint.TAIL) && secondCurrent.equals(Endpoint.ARROW))) {\n graph.setEndpoint(graphNodePair.getFirst(), graphNodePair.getSecond(), Endpoint.CIRCLE);\n } else {\n graph.setEndpoint(graphNodePair.getFirst(), graphNodePair.getSecond(), edge.getEndpoint2());\n }\n }\n }\n for (Triple triple : pag.getUnderLines()) {\n Triple graphTriple = new Triple(graph.getNode(triple.getX().getName()), graph.getNode(triple.getY().getName()), graph.getNode(triple.getZ().getName()));\n if (graphTriple.alongPathIn(graph)) {\n graph.addUnderlineTriple(graphTriple.getX(), graphTriple.getY(), graphTriple.getZ());\n definiteNoncolliders.add(graphTriple);\n }\n }\n }\n }", "void topologicalSort(){ \n Stack<Integer> stack = new Stack<Integer>(); \n \n // Mark all the vertices as not visited \n boolean visited[] = new boolean[V]; \n for (int i = 0; i < V; i++) \n visited[i] = false; \n \n // Call the recursive helper function to store Topological Sort starting from all vertices one by one \n for (int i = 0; i < V; i++) \n if (visited[i] == false) \n topologicalSortUtil(i, visited, stack); \n \n // Print contents of stack \n while (stack.empty()==false) \n System.out.print(stack.pop() + \" \"); \n }", "void topologicalSort(Vertex vertex) {\n if (vertex.visited == false) {\n vertex.visited = true;\n for (Vertex neighbor : vertex.neighbors) {\n topologicalSort(neighbor);\n }\n stack.add(vertex);\n }\n }", "public List<List<Integer>> topologicalSort(int vertices, int[][] edges) {\n List<List<Integer>> result = new LinkedList<>();\n // corner case\n if (vertices == 0 || edges == null || edges.length == 0) {\n return result;\n }\n\n // 0 - define two hashmaps, one stores the vertices and its adjacent nodes;\n // the other stores the vertices and the times that vertex is an adjacent node of others\n Map<Integer, List<Integer>> adjacency = new HashMap<>();\n Map<Integer, Integer> freq = new HashMap<>();\n\n // 1 - initialize two hashMaps\n for (int vertex = 0; vertex < vertices; vertex++) {\n adjacency.put(vertex, new LinkedList<Integer>());\n freq.put(vertex, 0);\n }\n\n // 2 - build two hashmaps using the given input data\n for (int[] edge : edges) {\n // edge[0] - source vertex\n // edge[1] - destination vertex\n adjacency.get(edge[0]).add(edge[1]);\n freq.put(edge[1], freq.get(edge[1]) + 1);\n }\n\n // 3 - find all source vertices (vertices that have no incoming edges and have only outgoing edges)\n Queue<Integer> sources = new LinkedList<>();\n for (int vertex : freq.keySet()) {\n if (freq.get(vertex) == 0) {\n sources.offer(vertex);\n }\n }\n\n // 4 - find the next sources recursively\n findSources(result, new LinkedList<Integer>(), adjacency, freq, sources);\n\n return result;\n }", "Iterable<Vertex> computePathToGraph(Loc start, Vertex end) throws GraphException;", "public interface Graph extends Container {\n\n /**\n * returns how many elements are in the container.\n *\n * @return int = number of elements in the container.\n */\n public int size();\n\n /**\n * returns true if the container is empty, false otherwise.\n *\n * @return boolean true if container is empty\n */\n public boolean isEmpty();\n\n /**\n * return the number of vertices in the graph\n * \n * @return number of vertices in the graph\n */\n public int numVertices();\n\n /**\n * returns the number for edges in the graph\n * \n * @return number of edges in the graph\n */\n public int numEdges();\n\n /**\n * returns an Enumeration of the vertices in the graph\n * \n * @return vertices in the graph\n */\n public Enumeration vertices();\n\n \n /**\n * returns an Enumeration of the edges in the graph\n * \n * @return edges in the graph\n */\n public Enumeration edges();\n\n\n /**\n * Returns an enumeration of the directed edges in the Graph\n * \n * @return an enumeration of the directed edges in the Graph\n */\n public Enumeration directedEdges();\n\n /**\n * Returns an enumeration of the directed edges in the Graph\n * \n * @return an enumeration of the directed edges in the Graph\n */\n public Enumeration undirectedEdges();\n\n /**\n * returns the degree of the passed in Vertex vp\n * \n * @param vp Vertex to return the degree of\n * @return degree of Vertex vp\n * @exception InvalidPositionException\n * thrown when vp is invalid for Vertex container V\n */\n public int degree(Position vp) throws InvalidPositionException;\n\n /**\n * returns the in degree of the passed in Vertex vp\n * \n * @param vp Vertex to return the in degree of\n * @return in degree of Vertex vp\n * @exception InvalidPositionException\n * thrown when vp is invalid for Vertex container V\n */\n public int inDegree(Position vp) throws InvalidPositionException;\n\n /**\n * returns the out degree of the passed in Vertex vp\n * \n * @param vp Vertex to return the out degree of\n * @return out degree of Vertex vp\n * @exception InvalidPositionException\n * thrown when vp is invalid for Vertex container V\n */\n public int outDegree(Position vp) throws InvalidPositionException;\n\n /**\n * Returns an enumeration of vertices adjacent to Vertex vp\n * \n * @param vp Position of Vertex to return the adjacent vertices of\n * @return enumeration of vertices adjacent to Vertex vp\n * @exception InvalidPositionException\n * thrown if vp is not a valid Vertex for this Graph\n */\n public Enumeration adjacentVertices(Position vp) throws InvalidPositionException;\n\n /**\n * Returns an enumeration of vertices in adjacent to Vertex vp\n * \n * @param vp Position of Vertex to return the in adjacent vertices of\n * @return enumeration of vertices in adjacent to Vertex vp\n * @exception InvalidPositionException\n * thrown if vp is not a valid Vertex for this Graph\n */\n public Enumeration inAdjacentVertice(Position vp) throws InvalidPositionException;\n\n /**\n * Returns an enumeration of vertices out adjacent to Vertex vp\n * \n * @param vp Position of Vertex to return the out adjacent vertices of\n * @return enumeration of vertices out adjacent to Vertex vp\n * @exception InvalidPositionException\n * thrown if vp is not a valid Vertex for this Graph\n */\n public Enumeration outAdjacentVertices(Position vp) throws InvalidPositionException;\n\n /**\n * Returns an Enumeration of the edges incident upon the\n * Vertex in Position vp\n * \n * @param vp the Position to holding the Vertex to return the\n * Enumeration of\n * @return the Enumeration of edges incident upon vp\n * @exception InvalidPositionException\n */\n public Enumeration incidentEdges(Position vp) throws InvalidPositionException;\n\n /**\n * Returns an Enumeration of the edges in incident upon the\n * Vertex in Position vp\n * \n * @param vp the Position to holding the Vertex to return the\n * Enumeration of\n * @return the Enumeration of edges in incident upon vp\n * @exception InvalidPositionException\n */\n public Enumeration inIncidentEdges(Position vp) throws InvalidPositionException;\n\n /**\n * Returns an Enumeration of the edges out incident upon the\n * Vertex in Position vp\n * \n * @param vp the Position to holding the Vertex to return the\n * Enumeration of\n * @return the Enumeration of edges out incident upon vp\n * @exception InvalidPositionException\n */\n public Enumeration outIncidentEdges(Position vp) throws InvalidPositionException;\n\n public Position[] endVertices(Position ep) throws InvalidPositionException;\n\n /**\n * Returns the Vertex on Edge ep opposite from Vertex vp\n * \n * @param vp Vertex to find opposite of\n * @param ep Edge containing the vertices\n * @return \n * @exception InvalidPositionException\n */\n public Position opposite(Position vp, Position ep) throws InvalidPositionException;\n\n /**\n * Determine whether or not two vertices are adjacent\n * \n * @param vp Position of one Vertex to check\n * @param wp Position of other Vertex to check\n * @return true if they are adjacent, false otherwise\n * @exception InvalidPositionException\n * thrown if either Position is invalid for this container\n */\n public boolean areAdjacent(Position vp, Position wp) throws InvalidPositionException;\n\n /**\n * Returns the destination Vertex of the given Edge Position\n * \n * @param ep Edge Position to return the destination Vertex of\n * @return the destination Vertex of the given Edge Position\n * @exception InvalidPositionException\n * thrown if the Edge Position is invalid\n */\n public Position destination(Position ep) throws InvalidPositionException;\n\n /**\n * Returns the origin Vertex of the given Edge Position\n * \n * @param ep Edge Position to return the origin Vertex of\n * @return the origin Vertex of the given Edge Position\n * @exception InvalidPositionException\n * thrown if the Edge Position is invalid\n */\n public Position origin(Position ep) throws InvalidPositionException;\n\n /**\n * Returns true if the given Edge Position is directed,\n * otherwise false\n * \n * @param ep Edge Position to check directed on\n * @return true if directed, otherwise false\n * @exception InvalidPositionException\n */\n public boolean isDirected(Position ep) throws InvalidPositionException;\n\n /**\n * Inserts a new undirected Edge into the graph with end\n * Vertices given by Positions vp and wp storing Object o,\n * returns a Position object for the new Edge\n * \n * @param vp Position holding one Vertex endpoint\n * @param wp Position holding the other Vertex endpoint\n * @param o Object to store at the new Edge\n * @return Position containing the new Edge object\n * @exception InvalidPositionException\n * thrown if either of the given vertices are invalid for\n * this container\n */\n public Position insertEdge(Position vp,Position wp, Object o) throws InvalidPositionException;\n\n /**\n * Inserts a new directed Edge into the graph with end\n * Vertices given by Positions vp, the origin, and wp,\n * the destination, storing Object o,\n * returns a Position object for the new Edge\n * \n * @param vp Position holding the origin Vertex\n * @param wp Position holding the destination Vertex\n * @param o Object to store at the new Edge\n * @return Position containing the new Edge object\n * @exception InvalidPositionException\n * thrown if either of the given vertices are invalid for\n * this container\n */\n public Position insertDirectedEdge(Position vp, Position wp, Object o) throws InvalidPositionException;\n\n /**\n * Inserts a new Vertex into the graph holding Object o\n * and returns a Position holding the new Vertex\n * \n * @param o the Object to hold in this Vertex\n * @return the Position holding the Vertex\n */\n public Position insertVertex(Object o);\n\n /**\n * This method removes the Vertex held in the passed in\n * Position from the Graph\n * \n * @param vp the Position holding the Vertex to remove\n * @exception InvalidPositionException\n * thrown if the given Position is invalid for this container\n */\n public void removeVertex(Position vp) throws InvalidPositionException;\n\n /**\n * Used to remove the Edge held in Position ep from the Graph\n * \n * @param ep the Position holding the Edge to remove\n * @exception InvalidPositionException\n * thrown if Position ep is invalid for this container\n */\n public void removeEdge(Position ep) throws InvalidPositionException;\n\n /**\n * This routine is used to change a directed Edge into an\n * undirected Edge\n * \n * @param ep a Position holding the Edge to change from directed to\n * undirected\n * @exception InvalidPositionException\n */\n public void makeUndirected(Position ep) throws InvalidPositionException;\n\n /**\n * This routine can be used to reverse the diretion of a \n * directed Edge\n * \n * @param ep a Position holding the Edge to reverse\n * @exception InvalidPositionException\n * thrown if the given Position is invalid for this container\n */\n public void reverseDirection(Position ep) throws InvalidPositionException;\n\n /**\n * Changes the direction of the given Edge to be out incident\n * upone the Vertex held in the given Position\n * \n * @param ep the Edge to change the direction of\n * @param vp the Position holding the Vertex that the Edge is going\n * to be out incident upon\n * @exception InvalidPositionException\n * thrown if either of the given positions are invalid for this container\n */\n public void setDirectionFrom(Position ep, Position vp) throws InvalidPositionException;\n\n\n /**\n * Changes the direction of the given Edge to be in incident\n * upone the Vertex held in the given Position\n * \n * @param ep the Edge to change the direction of\n * @param vp the Position holding the Vertex that the Edge is going\n * to be in incident upon\n * @exception InvalidPositionException\n * thrown if either of the given positions are invalid for this container\n */\n public void setDirectionTo(Position ep, Position vp) throws InvalidPositionException;\n\n}", "public Collection<V> getOtherVertices(Collection<V> vs);", "public static void main(String[] args) {\n Graph graph = new Graph();\n graph.addEdge(0, 1);\n graph.addEdge(0, 4);\n\n graph.addEdge(1,0);\n graph.addEdge(1,5);\n graph.addEdge(1,2);\n graph.addEdge(2,1);\n graph.addEdge(2,6);\n graph.addEdge(2,3);\n\n graph.addEdge(3,2);\n graph.addEdge(3,7);\n\n graph.addEdge(7,3);\n graph.addEdge(7,6);\n graph.addEdge(7,11);\n\n graph.addEdge(5,1);\n graph.addEdge(5,9);\n graph.addEdge(5,6);\n graph.addEdge(5,4);\n\n graph.addEdge(9,8);\n graph.addEdge(9,5);\n graph.addEdge(9,13);\n graph.addEdge(9,10);\n\n graph.addEdge(13,17);\n graph.addEdge(13,14);\n graph.addEdge(13,9);\n graph.addEdge(13,12);\n\n graph.addEdge(4,0);\n graph.addEdge(4,5);\n graph.addEdge(4,8);\n graph.addEdge(8,4);\n graph.addEdge(8,12);\n graph.addEdge(8,9);\n graph.addEdge(12,8);\n graph.addEdge(12,16);\n graph.addEdge(12,13);\n graph.addEdge(16,12);\n graph.addEdge(16,17);\n graph.addEdge(17,13);\n graph.addEdge(17,16);\n graph.addEdge(17,18);\n\n graph.addEdge(18,17);\n graph.addEdge(18,14);\n graph.addEdge(18,19);\n\n graph.addEdge(19,18);\n graph.addEdge(19,15);\n LinkedList<Integer> visited = new LinkedList();\n List<ArrayList<Integer>> paths = new ArrayList<ArrayList<Integer>>();\n int currentNode = START;\n visited.add(START);\n new searchEasy().findAllPaths(graph, visited, paths, currentNode);\n for(ArrayList<Integer> path : paths){\n for (Integer node : path) {\n System.out.print(node);\n System.out.print(\" \");\n }\n System.out.println();\n }\n }", "public Set<Edge<V>> edgeSet();", "private String edgesLeavingVertexToString() {\n \n //make empty string\n String s = \"\";\n \n //for loop to go through all vertices; \n for (int j = 0; j < arrayOfVertices.length; j++) {\n \n //if it has any edges...\n if (arrayOfVertices[j].getDegree() > 0) {\n \n //go through its edges\n for (int k = 0; k < arrayOfVertices[j].getDegree(); k++) {\n \n //declare an array list\n ArrayList<Vertex> newArrayList = \n arrayOfVertices[j].getAdjacent();\n \n //add to string: the vertex itself + space + edge + line break\n s += j + \" \" + newArrayList.get(k).getID() + \"\\n\"; \n \n } \n } \n }\n \n //add -1, -1 after all the edges\n s += \"-1 -1\";\n \n return s; \n }", "public Collection<V> addVertices(Collection<V> vs);", "@Test \r\n void insert_two_vertexs_then_create_edge(){\r\n graph.addVertex(\"A\");\r\n graph.addVertex(\"B\");\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }", "public void testEdgesSet_ofVertex() {\n System.out.println(\"edgesSet\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n Set<Edge<Integer>> set = graph.edgesSet(new Integer(i));\n\n Assert.assertEquals(set.size(), i % 2 == 0 ? 25 : 23);\n for (Edge<Integer> edge : set) {\n Assert.assertTrue((edge.getTargetVertex() + i) % 2 == 0);\n }\n }\n }", "public Set<Pair<V,V>> neighbourEdgesOf(V vertex);", "public static void PrimsAlgorithm(WeightedGraph graph) {\n System.out.println(\"______________________________Prim's Algorithm(Priority Queue)_____________________________\\n\");\n ArrayList<Edge> mst = new ArrayList<>();\n // initialize an array that will keep track of which vertices have been visited\n boolean[] visited = new boolean[graph.getVertices()];\n // initialize a PriorityQueue \n PriorityQueue<Edge> priorityQueue = new PriorityQueue<>();\n // mark the initial vertex as visited\n visited[0] = true;\n\n // for every edge connected to the source, add it to the PriorityQueue \n for (int i = 0; i < graph.getAdjacencylist(0).size(); i++) {\n priorityQueue.add(graph.getAdjacencylist(0).get(i));\n }\n\n // keep adding edges until the PriorityQueue is empty\n while (!priorityQueue.isEmpty()) {\n Edge e = priorityQueue.remove();\n\n // if we have already visited the opposite vertex, go to the next edge\n if (visited[e.getDestination()]) {\n continue;\n }\n\n //mark the opposite vertex as visited\n visited[e.getDestination()] = true;\n //Add an edge to the minimum spanning tree\n mst.add(e);\n\n // for every edge connected to the opposite vertex, add it to the PriorityQueue\n for (int i = 0; i < graph.getAdjacencylist(e.getDestination()).size(); i++) {\n priorityQueue.add(graph.getAdjacencylist(e.getDestination()).get(i));\n }\n\n }\n\n // if we haven't visited all of the vertices, return \n for (int i = 1; i < graph.getVertices(); i++) {\n if (!visited[i]) {\n System.out.println(\"Error! the graph is not connected.\");\n return;\n }\n }\n\n }", "static void bridge()\n {\n // Mark all the vertices as not visited\n boolean visited[] = new boolean[V];\n int disc[] = new int[V];\n int low[] = new int[V];\n int parent[] = new int[V];\n \n \n // Initialize parent and visited, and ap(articulation point)\n // arrays\n for (int i = 0; i < V; i++)\n {\n parent[i] = NIL;\n }\n \n // Call the recursive helper function to find Bridges\n // in DFS tree rooted with vertex 'i'\n for (int i = 0; i < V; i++)\n if (!visited[i])\n bridgeUtil(i, visited, disc, low, parent);\n }", "public Set<E> getEdges(V tail, V head);", "@Test\n public void testVertices() {\n Vertex v1 = new Vertex(1, \"A\");\n Vertex v2 = new Vertex(2, \"B\");\n Vertex v3 = new Vertex(3, \"C\");\n Vertex v4 = new Vertex(4, \"D\");\n Vertex v4id = new Vertex (4, \"E\");\n\n Edge<Vertex> e1 = new Edge<>(v1, v2, 5);\n Edge<Vertex> e2 = new Edge<>(v2, v3, 7);\n Edge<Vertex> e3 = new Edge<>(v1, v4, 9);\n\n Graph<Vertex, Edge<Vertex>> g = new Graph<>();\n g.addVertex(v1);\n g.addVertex(v2);\n g.addVertex(v3);\n g.addVertex(v4);\n g.addEdge(e1);\n g.addEdge(e2);\n g.addEdge(e3);\n\n assertFalse(g.addVertex(v4id));\n\n Set<Vertex> expectedVertices = new HashSet<>();\n expectedVertices.add(v1);\n expectedVertices.add(v2);\n expectedVertices.add(v3);\n expectedVertices.add(v4);\n\n assertEquals(expectedVertices, g.allVertices());\n\n Assert.assertTrue(g.remove(v1));\n\n }", "private void generateVertexSignatures() {\n \t this.create(0);\n \t this.vertexSignatures = new ArrayList<String>();\n \t this.vertexSignatures.add(this.toCanonicalVertexString());\n \t int count = this.getVertexCount();\n \t for (int vertexIndex = 1; vertexIndex < count; vertexIndex++) {\n \t this.resetDAG(vertexIndex);\n \t this.vertexSignatures.add(this.toCanonicalVertexString());\n \t }\n \t}", "Set<Vertex> getVertices();", "@Test\r\n void insert_multiple_vertexes_and_edges_remove_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\", \"D\");\r\n \r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n int numberOfEdges = graph.size();\r\n int numberOfVertices = graph.order();\r\n if(numberOfEdges != 4) {\r\n fail();\r\n }\r\n if(numberOfVertices != 4) {\r\n fail();\r\n }\r\n \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")|!vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n \r\n // Check that A's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // Check that B's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\") | !adjacent.contains(\"D\"))\r\n fail(); \r\n // C and D have no out going edges \r\n adjacent = graph.getAdjacentVerticesOf(\"C\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Remove B from the graph \r\n graph.removeVertex(\"B\");\r\n // Check that A's outgoing edges are correct\r\n // An edge to B should no exist any more \r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // There should be no elements in the list of successors\r\n // of B since its deleted form the graph\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Check that graph has still has all vertexes not removed\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"C\")|\r\n !vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n //Check that vertex B was removed from graph \r\n if(vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n numberOfEdges = graph.size();\r\n numberOfVertices = graph.order();\r\n if(numberOfEdges != 1) {\r\n fail();\r\n }\r\n if(numberOfVertices != 3) {\r\n fail();\r\n }\r\n }", "private void addVerticesToGraph()\n\t{\n\t\tString vertexName;\n\n\t\tMap<Long, IOFSwitch> switches = this.floodlightProvider.getSwitches();\n\t\tfor(IOFSwitch s :switches.values())\n\t\t{\n\t\t\tvertexName =Long.toString(s.getId());\n\t\t\tm_graph.addVertex(vertexName);\t\t\t \t\t\t \n\t\t}\n\t\tSystem.out.println(m_graph);\n\t}", "public static Set<List<Vertex>> depthFirstSearch(Graph graph) {\n Set<List<Vertex>> arrayListHashSet=new HashSet<>();\n\n for(int i=0;i<graph.getVertices().size();i++){\n ArrayList<Vertex> visitedArrayList=new ArrayList<>();\n for(int j=0;j<graph.getVertices().size();j++){\n if(visitedArrayList.size()==0){\n if(!visitedArrayList.contains(graph.getVertices().get(i))){\n depthFirstSearch(graph.getVertices().get(i),visitedArrayList,graph);\n }\n }\n else{\n if(!visitedArrayList.contains(graph.getVertices().get(j))){\n depthFirstSearch(graph.getVertices().get(j),visitedArrayList,graph);\n }\n }\n }\n arrayListHashSet.add(visitedArrayList);\n }\n return arrayListHashSet; // this should be changed\n }", "public boolean connectsVertices(Collection<V> vs);", "Iterable<DirectedEdge> pathTo(int v)\n\t{\n\t\tStack<DirectedEdge> path=new Stack<>();\n\t\tfor(DirectedEdge e=edgeTo[v]; e!=null; e=edgeTo[e.from()])\n\t\t{\n\t\t\tpath.push(e);\n\t\t}\n\t\treturn path;\n\t}", "ArrayList<Node> DFSIter( Graph graph, final Node start, final Node end)\n {\n boolean visited[] = new boolean[graph.numNodes];\n Stack<Node> stack = new Stack<Node>();\n Map< Node,Node> parentPath = new HashMap< Node,Node>(); \n stack.push(start);\n\n while ( !stack.isEmpty() )\n {\n Node currNode = stack.pop();\n // end loop when goal node is found\n if ( currNode == end )\n break;\n // If node has already been visited, skip it\n if ( visited[currNode.id] )\n continue;\n else\n {\n visited[currNode.id] = true;\n int numEdges = currNode.connectedNodes.size();\n\n for ( int i = 0; i < numEdges; i++ )\n {\n Node edgeNode = currNode.connectedNodes.get(i);\n if ( !visited[edgeNode.id] )\n {\n stack.push( edgeNode );\n parentPath.put( edgeNode, currNode);\n }\n }\n \n }\n }\n\n ArrayList<Node> path = new ArrayList<Node>();\n Node currNode = end;\n while ( currNode != null )\n {\n path.add(0, currNode);\n currNode = parentPath.get(currNode);\n }\n\n return path;\n }", "private Stack path(Graph graph, GraphNode start, GraphNode end) throws GraphException {\n\t\tGraph g = graph;\n\t\tGraphNode b = start;\n\t\tGraphNode e = end;\n\t\tGraphNode temp;\n\t\tStack p;\n\n\t\t// mark the beginning point and push it to the stack.\n\t\tb.setMark(true);\n\t\tedgeStack.push(b);\n\n\t\t// check if the starting and end point are equal.\n\t\tif (b == e) {\n\t\t\treturn edgeStack;\n\t\t}\n\t\t// iterates until it reaches the end point\n\t\telse {\n\t\t\t// initializes edges to the edges incident on node b\n\t\t\tIterator<GraphEdge> edges = graph.incidentEdges(b);\n\n\t\t\t// iterates until it reaches the end of nodes\n\t\t\twhile (edges.hasNext()) {\n\t\t\t\ttemp = edges.next().secondEndpoint();\n\n\t\t\t\t// checks if the second point of the edge has been discovered\n\t\t\t\tif (temp.getMark() == false ) {\n\t\t\t\t\tp = path(g, temp, e);\n\n\t\t\t\t\t// if the path ends return null\n\t\t\t\t\tif (p != null) {\n\t\t\t\t\t\treturn p;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tedgeStack.pop();\n\t\t}\n\t\treturn null;\n\t}", "@Override\n\tpublic int graphOrder() {\n\t\treturn vertices.size();\n\t}", "public void depthFirstOrder(Graph graph) {\n\t\tQueue<Vertex> zeroDegreeVertex = findZeroIndegrees(graph);\n\t\tint index = 1;\n\n\t\twhile (!zeroDegreeVertex.isEmpty()) {\n\t\t\tVertex vertex = zeroDegreeVertex.remove();\n\n\t\t\tfor (Edge edge : vertex.Adj) {\n\t\t\t\tVertex adjacentVertex = edge.otherEnd(vertex);\n\t\t\t\tadjacentVertex.indegree -= 1;\n\n\t\t\t\tif (adjacentVertex.indegree == 0) {\n\t\t\t\t\tzeroDegreeVertex.add(adjacentVertex);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvertices[index++] = vertex;\n\t\t}\n\n\t\t// We need make sure all the verrtices are in the toplogical sorted\n\t\t// graph\n\t\t\n\t\tif(isAllVertciesInTopologicalOrder(index, graph.V.length)) {\n\t\t\tvertices = null;\n\t\t}\n\t}", "public interface GraphInterface<V, E extends EdgeInterface<V>> {\n\n\t/**\n\t * Adds a vertex to the graph\n\t * \n\t * @param vertex\n\t * to add to the graph\n\t * \n\t * @return true is vertex was successfully added.\n\t */\n\tpublic boolean addVertex(V vertex);\n\n\t/**\n\t * Adds all vertices in the collection\n\t * \n\t * @param vertices vertices to add\n\t * \n\t * @return true is all vertices were successfully added.\n\t */\n\tpublic boolean addVertices(Collection<? extends V> vertices);\n\n\t/**\n\t * adds all vertices in the array.\n\t * \n\t * @param vs\n\t * Vertices to add\n\t * @return true is all vertices were successfully added.\n\t */\n\t@SuppressWarnings(\"unchecked\")\n\tpublic boolean addVertices(V... vs);\n\n\t/**\n\t * Removes a vertex from the graph\n\t * \n\t * @param vertex\n\t * to remove from the graph\n\t * @return true if the vertex was successfully removed from the graph\n\t */\n\tpublic boolean removeVertex(V vertex);\n\n\t/**\n\t * Remove a set of vertices\n\t * \n\t * @param vertices\n\t * Set of vertices to remove\n\t * \n\t * @return true if all vertices were successfully removed\n\t */\n\tpublic boolean removeVertices(Collection<? extends V> vertices);\n\n\t/**\n\t * Gets the set of vertices of the graph\n\t * \n\t * @return set of vertices in the graph\n\t */\n\tpublic Set<V> getVertices();\n\n\t/**\n\t * Adds an edge to the graph\n\t * \n\t * @param tail\n\t * Tail of the edge\n\t * @param head\n\t * Head of the edge\n\t * @return the new edge\n\t */\n\tpublic E addEdge(V tail, V head);\n\n\t/**\n\t * Gets all edge incident to a given vertex\n\t * \n\t * @param tail\n\t * tail of the edge\n\t * @return Set of all edge incident to a given vertex\n\t */\n\tpublic Set<E> getEdges(V tail);\n\n\t/**\n\t * Gets all edges from the tail to the head\n\t * \n\t * @param tail\n\t * tail of the edge\n\t * @param head\n\t * head of the edge\n\t * @return Set of all edge between tail and head.\n\t */\n\tpublic Set<E> getEdges(V tail, V head);\n\n\t/**\n\t * Get the Edges of the graph\n\t * \n\t * @return Set of edges\n\t */\n\tpublic Set<E> getEdges();\n\t\n\t/**\n\t * Performs the given action for each element of\n\t * the Iterable until all elements have been\n\t * processed or the action throws an exception. \n\t * \n\t * @param comsumer \n\t */\n\tpublic void forEachVertex(Consumer<V> comsumer);\n\t\n\t/**\n\t * Performs the given action for each element of \n\t * the Iterable until all elements have been \n\t * processed or the action throws an exception. \n\t * \n\t * @param consumer\n\t */\n\tpublic void forEachEdge(Consumer<E> consumer);\n\n\t/**\n\t * Removes a set of edges\n\t * \n\t * @param edges\n\t * Set of edges to remove\n\t * @return true if all edges were removed successfully\n\t */\n\tpublic boolean removeEdges(Collection<? extends E> edges);\n\n\t/**\n\t * Removes an edge from the graph\n\t * \n\t * @param edge\n\t * to remove\n\t * @return true if the edge was successfully removed.\n\t */\n\tpublic boolean removeEdge(E edge);\n\n\t/**\n\t * Removes all edge from the graph between tail and head\n\t * \n\t * @param tail\n\t * tail of the edge to remove\n\t * @param head\n\t * head of the edge to remove\n\t * \n\t * @return true if the edge was successfully removed.\n\t */\n\tpublic boolean removeEdge(V tail, V head);\n\n\t/**\n\t * Removes all edge incident with a vertex\n\t * \n\t * @param tail\n\t * tail of the edge\n\t * \n\t * @return true if all edges were deleted incident to a vertex\n\t */\n\tpublic boolean removeEdge(V tail);\n\n\t/**\n\t * Removes all edges from the graph\n\t * \n\t * @return true if all edges were removed\n\t */\n\tpublic boolean resetEdges();\n\n\t/**\n\t * Gets the {@link org.gt4j.annas.graph.EdgeFactory} used by the graph\n\t * \n\t * @return EdgeFactory used by the graph\n\t */\n\tpublic EdgeFactory<V, E> getEdgeFactory();\n\n\t/**\n\t * Checks if the graph contains an edge between two vertices\n\t * \n\t * @param head head of edge\n\t * @param tail tail of edge\n\t * @return true if the edge is in the graph\n\t */\n\tpublic boolean containsEdge(V head, V tail);\n\n\t/**\n\t * Checks if a vertex is in the graph\n\t * \n\t * @param edge edge \n\t * @return true if the edge is in the graph\n\t */\n\tpublic boolean containsEdge(E edge);\n\n\t/**\n\t * Checks if a vertex is in the graph\n\t * \n\t * @param vertex vertex to check\n\t * @return true if the vertex is in the graph\n\t */\n\tpublic boolean containsVertex(V vertex);\n\n\t/**\n\t * Number of edges contained within the graph\n\t * \n\t * @return number of edges in the graph\n\t */\n\tpublic int getSize();\n\n\t/**\n\t * Number of vertices contained within the graph\n\t * \n\t * @return number of vertices in the graph\n\t */\n\tpublic int getOrder();\n\n\t/**\n\t * Degree of vertex (Out degree for directed graphs)\n\t * \n\t * @param vertex vertex to get degree of\n\t * @return degree of the given vertex\n\t */\n\tpublic int getDegree(V vertex);\n\n\t/**\n\t * Get current {@link org.gt4j.annas.graph.GraphObserver}\n\t * \n\t * @return GraphObserver\n\t */\n\tpublic GraphObserver<V, E> getObserver();\n\n\t/**\n\t * Set the {@link org.gt4j.annas.graph.GraphObserver}\n\t * \n\t * @param GO graph observer\n\t */\n\tpublic void setObserver(GraphObserver<V, E> GO);\n\n\t/**\n\t * Gets edge class\n\t * \n\t * @return edge class\n\t */\n\tpublic Class<?> getEdgeClass();\n\n\t/**\n\t * Returns if the graph is directed\n\t * \n\t * @return true if the graph is directed\n\t */\n\tpublic boolean isDirected();\n}", "void graph2() {\n\t\tconnect(\"1\", \"7\");\n\t\tconnect(\"1\", \"8\");\n\t\tconnect(\"1\", \"9\");\n\t\tconnect(\"9\", \"1\");\n\t\tconnect(\"9\", \"0\");\n\t\tconnect(\"9\", \"4\");\n\t\tconnect(\"4\", \"8\");\n\t\tconnect(\"4\", \"3\");\n\t\tconnect(\"3\", \"4\");\n\t}", "@Override\n public void addVertex(V vertex)\n {\n if (vertex.equals(null)){\n throw new IllegalArgumentException();\n }\n ArrayList <V> edges = new ArrayList<>();\n\t graph.put(vertex, edges);\n\n }", "private void createEdges() throws IOException {\r\n\t\tString line;\r\n\t\tString fromVertex=null;\r\n\t\tString toVertex=null;\r\n\t\twhile((line=next(1))!=null) {\r\n\t\t\tif(line.startsWith(\"[\"))\r\n\t\t\t\t{\r\n\t\t\t\tthis.buffer=line;\r\n\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\tint colon=line.indexOf(':');\r\n\t\t\tif(colon==-1) continue;\r\n\t\t\tif(line.startsWith(\"id:\"))\r\n\t\t\t\t{\r\n\t\t\t\ttoVertex= line.substring(colon+1).trim();\r\n\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\tif(line.startsWith(\"is_a:\"))\r\n\t\t\t\t{\r\n\t\t\t\tfromVertex = nocomment(line.substring(colon+1));\r\n\t\t\t\t//System.out.println(fromVertex+\" to be connected to: \"+toVertex);\r\n\t\t\t\tTerm fromNode = terms.get(fromVertex);\r\n\t\t\t\tTerm toNode = terms.get(toVertex);\r\n\t\t\t\tif (fromNode.namespace.equals(\"molecular_function\") && toNode.namespace.equals(\"molecular_function\")){\r\n\t\t\t\t\tdagMF.addEdge(fromNode, toNode);\r\n\t\t\t\t}\r\n\t\t\t\telse if (fromNode.namespace.equals(\"biological_process\") && toNode.namespace.equals(\"biological_process\")){\r\n\t\t\t\t\tdagBP.addEdge(fromNode, toNode);\r\n\t\t\t\t} \r\n\t\t\t\telse if (fromNode.namespace.equals(\"cellular_component\") && toNode.namespace.equals(\"cellular_component\")){\r\n\t\t\t\t\tdagCC.addEdge(fromNode, toNode);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tSystem.out.println(\"FAILED TO ADD TO DAG, not belonging to the same NAMESPACE\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t}\r\n\t}", "public Set<E> getEdges(V tail);", "int[] getEdgesIncidentTo(int... nodes);", "public static void mergeVertices(Graph<Vertex, String> g, List<Vertex> vertices) {\n\t Vertex newVertex = Vertex.merge(vertices);\n\n\t // find all predecessors and successors of the new vertex\n\t // TODO: what to do with self edges? right now we're deleting them\n\t HashSet<Vertex> preds = new HashSet<Vertex>();\n\t HashSet<Vertex> succs = new HashSet<Vertex>();\n\t for (Vertex v : vertices) {\n\t List<Edge<Vertex, String>> edges = g.getEdges(v);\n\t for (Edge<Vertex, String> e : edges) {\n\t if (e.from.equals(v) && !vertices.contains(e.to)) {\n\t // outgoing\n\t succs.add(e.to);\n\t } else if (e.to.equals(v) && !vertices.contains(e.from)) {\n\t // incoming\n\t preds.add(e.from);\n\t } \n\t }\n\t g.removeVertex(v);\n\t }\n\n\t // add new vertex and edges to graph\n\t g.addVertex(newVertex);\n\t for (Vertex pred : preds) {\n\t try {\n\t g.addEdge(pred, newVertex, null);\n\t } catch (DuplicateEdgeException e) {\n\t System.err.println(\"Tried to add a duplicate edge from \" + pred + \" to \" + newVertex);\n\t }\n\t }\n\t for (Vertex succ : succs) {\n\t try {\n\t g.addEdge(newVertex, succ, null);\n\t } catch (DuplicateEdgeException e) {\n\t System.err.println(\"Tried to add a duplicate edge from \" + newVertex + \" to \" + succ);\n\t }\n\t }\n\n\t }", "int[] getInEdges(int... nodes);", "private void computePath(){\n LinkedStack<T> reversePath = new LinkedStack<T>();\n // adding end vertex to reversePath\n T current = end; // first node is the end one\n while (!current.equals(start)){\n reversePath.push(current); // adding current to path\n current = closestPredecessor[vertexIndex(current)]; // changing to closest predecessor to current\n }\n reversePath.push(current); // adding the start vertex\n \n while (!reversePath.isEmpty()){\n path.enqueue(reversePath.pop());\n }\n }", "@Test\r\n void create_edge_between_null_vertexes() {\r\n graph.addEdge(null, \"B\");\r\n graph.addEdge(\"A\", null);\r\n graph.addEdge(null, null);\r\n vertices = graph.getAllVertices();\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!vertices.isEmpty() | !adjacentA.isEmpty() | !adjacentB.isEmpty()) {\r\n fail();\r\n } \r\n }", "@Test\n\tpublic void edgesTest() {\n\t\tList<Vertex> vertices = new ArrayList<>();\n\t\tvertices.add(C);\n\t\tvertices.add(D);\n\t\tedge_0.addVertices(vertices);\n\t\tList<Vertex> vertices1 = new ArrayList<>();\n\t\tvertices.add(A);\n\t\tvertices.add(B);\n\t\tedge_1.addVertices(vertices1);\n\t\tgraph.addEdge(edge_0);\n\t\tgraph.addEdge(edge_1);\n\t\tassertEquals(2, graph.edges().size());\n\t\tassertTrue(graph.edges().contains(edge_0));\n\t\tassertTrue(graph.edges().contains(edge_1));\n\t}", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_non_existent_edge() {\r\n // Add three vertices with two edges\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n // Try are remove edge from A to C\r\n graph.removeEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"D\");\r\n graph.removeEdge(\"E\", \"F\");\r\n graph.removeEdge(null, \"A\");\r\n graph.removeEdge(\"A\", null);\r\n //Graph should maintain its original shape\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n }", "@Test\r\n void add_remove_add() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\",\"D\");\r\n graph.addEdge(\"C\",\"D\");\r\n graph.addEdge(\"D\", \"E\"); \r\n // Check that E is in graph with correct edges\r\n List<String> adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n vertices = graph.getAllVertices(); \r\n if(!vertices.contains(\"E\") | !adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n //Remove E\r\n graph.removeVertex(\"E\");\r\n if(vertices.contains(\"E\") | adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n \r\n //Add E back into graph with different edge\r\n graph.addEdge(\"B\", \"E\");\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if(!vertices.contains(\"E\") | !adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n }", "@Test\n void test01_addVertex() {\n graph.addVertex(\"a\");\n graph.addVertex(\"b\"); // adds two vertices\n\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\"); // creates a check list to compare with\n\n if (!graph.getAllVertices().equals(vertices)) {\n fail(\"Graph didn't add the vertices correctly\");\n }\n }", "public Vertex[] createGraph(){\n\t\t /* constructing a graph using matrices\n\t\t * If there is a connection between two adjacent LETTERS, the \n\t * cell will contain a num > 1, otherwise a 0. A value of -1 in the\n\t * cell denotes that the cities are not neighbors.\n\t * \n\t * GRAPH (with weights b/w nodes):\n\t * E+---12-------+B--------18-----+F----2---+C\n\t * +\t\t\t\t+\t\t\t\t +\t\t +\n\t * |\t\t\t\t|\t\t\t\t/\t\t |\n\t * |\t\t\t\t|\t\t\t |\t\t |\n\t * |\t\t\t\t|\t\t\t |\t\t 10\n\t * 24\t\t\t\t8\t\t\t 8\t |\n\t * |\t\t\t\t|\t\t\t |\t\t +\n\t * |\t\t\t\t|\t\t\t | H <+---11---I\n\t * |\t\t\t\t|\t\t\t /\n\t * +\t\t\t\t+\t\t\t +\n\t * G+---12----+A(start)+---10--+D\n\t * \n\t * NOTE: I is the only unidirectional node\n\t */\n\t\t\n\t\tint cols = 9;\n\t\tint rows = 9;\n\t\t//adjacency matrix\n\t\t\t\t //A B C D E F G H I\n\t int graph[][] = { {0,8,0,10,0,0,12,0,0}, //A\n\t {8,0,0,0,12,18,0,0,0}, //B\n\t {0,0,0,0,0,2,0,10,0}, //C\n\t {10,0,0,0,0,8,0,0,0}, //D\n\t {0,12,0,0,0,0,24,0,0}, //E\n\t {0,18,2,8,0,0,0,0,0}, //F\n\t {12,0,0,0,0,0,24,0,0}, //G\n\t {0,0,10,0,0,0,0,0,11}, //H\n\t {0,0,0,0,0,0,0,11,0}}; //I\n\t \n\t //initialize stores vertices\n\t Vertex[] vertices = new Vertex[rows]; \n\n\t //Go through each row and collect all [i,col] >= 1 (neighbors)\n\t int weight = 0; //weight of the neighbor\n\t for (int i = 0; i < rows; i++) {\n\t \tVector<Integer> vec = new Vector<Integer>(rows);\n\t\t\tfor (int j = 0; j < cols; j++) {\n\t\t\t\tif (graph[i][j] >= 1) {\n\t\t\t\t\tvec.add(j);\n\t\t\t\t\tweight = j;\n\t\t\t\t}//is a neighbor\n\t\t\t}\n\t\t\tvertices[i] = new Vertex(Vertex.getVertexName(i), vec);\n\t\t\tvertices[i].state = weight;\n\t\t\tvec = null; // Allow garbage collection\n\t\t}\n\t return vertices;\n\t}", "@Test\n public void testGraphElements(){\n Vertex v1 = new Vertex(1, \"A\");\n Vertex v2 = new Vertex(2, \"B\");\n Vertex v3 = new Vertex(3, \"C\");\n Vertex v4 = new Vertex(4, \"D\");\n Vertex v5 = new Vertex(5, \"E\");\n Vertex v6 = new Vertex(6, \"F\");\n Vertex v7 = new Vertex(7, \"G\");\n Vertex v8 = new Vertex(8, \"H\");\n\n Vertex fakeVertex = new Vertex(100, \"fake vertex\");\n\n Edge<Vertex> e1 = new Edge<>(v1, v2, 1);\n Edge<Vertex> e2 = new Edge<>(v2, v3, 1);\n Edge<Vertex> e3 = new Edge<>(v3, v4, 1);\n Edge<Vertex> e4 = new Edge<>(v2, v4, 1);\n Edge<Vertex> e5 = new Edge<>(v2, v6, 1);\n Edge<Vertex> e6 = new Edge<>(v2, v5, 10);\n Edge<Vertex> e7 = new Edge<>(v5, v6, 10);\n Edge<Vertex> e8 = new Edge<>(v4, v6, 10);\n Edge<Vertex> e9 = new Edge<>(v6, v7, 10);\n Edge<Vertex> e10 = new Edge<>(v7, v8, 10);\n\n Edge<Vertex> fakeEdge = new Edge<>(fakeVertex, v1);\n Edge<Vertex> edgeToRemove = new Edge<>(v2, v7, 200);\n\n Graph<Vertex, Edge<Vertex>> g = new Graph<>();\n g.addVertex(v1);\n g.addVertex(v2);\n g.addVertex(v3);\n g.addVertex(v4);\n g.addVertex(v5);\n g.addVertex(v6);\n g.addVertex(v7);\n g.addVertex(v8);\n g.addEdge(e1);\n g.addEdge(e2);\n g.addEdge(e3);\n g.addEdge(e4);\n g.addEdge(e5);\n g.addEdge(e6);\n g.addEdge(e7);\n g.addEdge(e8);\n g.addEdge(e9);\n g.addEdge(edgeToRemove);\n\n Assert.assertTrue(g.addEdge(e10));\n\n //adding null edge or vertex to graph returns false\n Assert.assertFalse(g.addEdge(null));\n Assert.assertFalse(g.addVertex(null));\n\n //adding edge with a vertex that does not exist in graph g returns false\n Assert.assertFalse(g.addEdge(fakeEdge));\n\n //get an edge that does not exit in graph returns false\n Assert.assertFalse(g.edge(v1, fakeVertex));\n\n //getting length of edge from vertex not in graph g returns false\n Assert.assertEquals(0, g.edgeLength(fakeVertex, v2));\n\n //Remove an edge in graph g returns true\n Assert.assertTrue(g.remove(edgeToRemove));\n\n //Removing edge not in graph g returns false\n Assert.assertFalse(g.remove(fakeEdge));\n\n //Removing vertex not in graph g returns false\n Assert.assertFalse(g.remove(fakeVertex));\n\n //Finding an edge with an endpoint not in graph g returns null\n assertNull(g.getEdge(v1, fakeVertex));\n }", "public E getParentEdge(V vertex);", "public void dfs() {\n int currentVertexIndex = 0;\r\n dfsStack.push(0);\r\n vertexList[0].wasVisited = true;\r\n System.out.println(vertexList[dfsStack.peek()]);\r\n while (dfsStack.top != -1) {\r\n\r\n\r\n currentVertexIndex = this.getAdjUnvisitedVert(dfsStack.peek());\r\n if (currentVertexIndex != -1) {\r\n dfsStack.push(currentVertexIndex);\r\n vertexList[currentVertexIndex].wasVisited = true;\r\n System.out.println(vertexList[dfsStack.peek()]);\r\n\r\n\r\n } else {\r\n currentVertexIndex = dfsStack.pop();\r\n\r\n }\r\n }\r\n// reset wasVisted\r\n for (Vertex x : vertexList) {\r\n x.wasVisited = false;\r\n }\r\n }", "void graph4() {\n\t\tconnect(\"8\", \"9\");\n\t\tconnect(\"3\", \"1\");\n\t\tconnect(\"3\", \"2\");\n\t\tconnect(\"3\", \"9\");\n\t\tconnect(\"4\", \"3\");\n\t\t//connect(\"4\", \"5\");\n\t\t//connect(\"4\", \"7\");\n\t\t//connect(\"5\", \"7\");\t\t\n\t}", "public List<Integer> topologicalOrder(int vertices, int[][] edges) {\n\t\tList<Integer> result = new ArrayList<>();\n\n\t\tMap<Integer, List<Integer>> graph = new HashMap<>();\n\t\tMap<Integer, Integer> freqMap = new HashMap<>();\n\n\t\t// Initialize\n\t\tfor (int i = 0; i < vertices; ++i) {\n\t\t\tgraph.put(i, new ArrayList<>());\n\t\t\tfreqMap.put(i, 0);\n\t\t}\n\n\t\tfor (int i = 0; i < edges.length; ++i) {\n\t\t\tgraph.get(edges[i][0]).add(edges[i][1]);\n\t\t\tfreqMap.put(edges[i][1], freqMap.get(edges[i][1]) + 1);\n\t\t}\n\n\t\tList<Integer> sources = freqMap.entrySet().stream().filter(x -> x.getValue() == 0).map(y -> y.getKey())\n\t\t\t\t.collect(Collectors.toList());\n\n\t\tQueue<Integer> sourceQueue = new LinkedList<>(sources);\n\n\t\twhile (!sourceQueue.isEmpty()) {\n\t\t\tint source = sourceQueue.poll();\n\t\t\tresult.add(source);\n\t\t\tfor (int elem : graph.get(source)) {\n\t\t\t\tif (freqMap.get(elem) == 1) {\n\t\t\t\t\tsourceQueue.offer(elem);\n\t\t\t\t\tfreqMap.remove(elem);\n\t\t\t\t} else {\n\t\t\t\t\tfreqMap.put(elem, freqMap.get(elem) - 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If length is not same, then there is a cycle\n\t\treturn result.size() == vertices ? result : new ArrayList<>();\n\t}", "@Test\n public void testEdges() {\n Vertex v1 = new Vertex(1, \"A\");\n Vertex v2 = new Vertex(2, \"B\");\n Vertex v3 = new Vertex(3, \"C\");\n Vertex v4 = new Vertex(4, \"D\");\n\n Edge<Vertex> e1 = new Edge<>(v1, v2, 5);\n Edge<Vertex> e2 = new Edge<>(v2, v3, 7);\n Edge<Vertex> e3 = new Edge<>(v1, v4, 9);\n\n Graph<Vertex, Edge<Vertex>> g = new Graph<>();\n g.addVertex(v1);\n g.addVertex(v2);\n g.addVertex(v3);\n g.addVertex(v4);\n g.addEdge(e1);\n g.addEdge(e2);\n g.addEdge(e3);\n\n Set<Edge> expectedEdges = new HashSet<>();\n expectedEdges.add(e1);\n expectedEdges.add(e2);\n expectedEdges.add(e3);\n\n assertEquals(expectedEdges, g.allEdges());\n\n expectedEdges.remove(e2);\n assertEquals(expectedEdges, g.allEdges(v1));\n\n assertEquals(e3, g.getEdge(v1, v4));\n }", "public Boolean addEdge( AnyType vertex_value_A, AnyType vertex_value_B ) throws VertexException {\n \n // ------------------------------------\n // Basic steps:\n // ------------------------------------\n // 1) For Vertex A and B, check to see if the vertex exits in the \n // vertex_adjacency_list. If not, then add new vertex (with given \n // value) to the vertex_adjacency_list.\n // 2) In Vertex class, check if Vertex B is in Vertex A's \n // adjacent_vertex_list and vice versa (i.e. an edge exists). If \n // edge already exists, then return false, otherwise goto step 3.\n // 3) Add Vertex B to Vertex A's adjacent_vertex_list and vice versa.\n // Lastly, return true indicating the edge was successfully added.\n \n // ----------------------------\n // TODO: Add your code here\n // ----------------------------\n boolean a_in_list = false;\n boolean b_in_list = false;\n boolean edge = false;\n int size = vertex_adjacency_list.size();\n int a = -1;\n int b = -1;\n \n //make new vertices with values passed in\n Vertex<AnyType> A = new Vertex<AnyType>(vertex_value_A);\n Vertex<AnyType> B = new Vertex<AnyType>(vertex_value_B);\n //check if they are in the list\n for(int i = 0; i<= size-1; i++){\n if( vertex_adjacency_list.get(i).compareTo( A) == 0){\n a_in_list = true;\n a = i;\n \n }\n if( vertex_adjacency_list.get(i).compareTo(B) == 0){\n b_in_list = true;\n b = i;\n \n }\n }\n //if not in list, add\n if( a_in_list == false){\n vertex_adjacency_list.add(A);\n a_in_list = true;\n a = vertex_adjacency_list.size()-1;\n }\n if( b_in_list == false){\n vertex_adjacency_list.add(B);\n b_in_list =true;\n b = vertex_adjacency_list.size()-1;\n }\n //check if edge\n edge = vertex_adjacency_list.get(a).hasAdjacentVertex(vertex_adjacency_list.get(b));\n //if edge then add to list \n if( a_in_list == true && b_in_list == true){\n if(edge){\n return edge;\n }\n else{\n vertex_adjacency_list.get(a).addAdjacentVertex(vertex_adjacency_list.get(b));\n vertex_adjacency_list.get(b).addAdjacentVertex(vertex_adjacency_list.get(a));\n edge = true;\n }\n }\n return edge;\n \n }", "@Test \r\n void create_edge_between_to_nonexisted_vertexes() {\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }", "Iterable<Vertex> computePath(Vertex start, Vertex end) throws GraphException;", "public static void main(String args[])\n\t{\n\t\tList<Vertex> v = new LinkedList<Vertex>();\n\t\tVertex v1 = new Vertex(1);\n\t\tVertex v2 = new Vertex(2);\n\t\tVertex v3 = new Vertex(3);\n \t\tVertex v4 = new Vertex(4);\n\t\t\n \t\t//Setting adjList for each vertex\n \t\tList<Vertex> adjList = new LinkedList<Vertex>();\n\t\tadjList.add(v2);\n\t\tadjList.add(v3);\n\t\tv1.setAdjList(adjList);\n\t\t\n\t\tadjList = new LinkedList<Vertex>();\n\t\tadjList.add(v4);\n\t\tv2.setAdjList(adjList);\n\t\t\n\t\tadjList = new LinkedList<Vertex>();\n\t\tadjList.add(v2);\n\t\tv3.setAdjList(adjList);\n\t\t\n\t\tadjList = new LinkedList<Vertex>();\n\t\tadjList.add(v3);\n\t\tv4.setAdjList(adjList);\n\t\t\n\t\tv.add(v1);\n\t\tv.add(v2);\n \t\tv.add(v3);\n\t\tv.add(v4);\n\n\t\tEdge e1 = new Edge(1, 2);\n\t\tList<Edge> e = new LinkedList<Edge>();\n\t\te.add(e1);\n\t\te1 = new Edge(1, 3);\n\t\te.add(e1);\n\t\te1 = new Edge(2, 4);\n\t\te.add(e1);\n\t\te1 = new Edge(4, 3);\n\t\te.add(e1);\n\t\te1 = new Edge(3, 2);\n\t\te.add(e1);\n\t\t\n\t\t\n\t\tGraph g = new Graph(v, e);\n\t\tg.bfs(v4);\n\t\t\n\t\t//v has all vertices\n\t\tg.unconnected(v2, v);\n\t}", "public void drawEdges(IEdgeDrawerGraph graph);", "public Graph(ArrayList<Vertex> vertices){\r\n this.vertices = new HashMap<String, Vertex>();\r\n this.edges = new HashMap<Integer, Edge>();\r\n \r\n for(Vertex v: vertices){\r\n this.vertices.put(v.getLabel(), v);\r\n }\r\n \r\n }", "public static void main(String[] args) throws IOException {\n File file = new File(args[0]);\r\n //FileOutputStream f = new FileOutputStream(\"prat_dfs_data2.txt\");\r\n //System.setOut(new PrintStream(f));\r\n BufferedReader reader = new BufferedReader(new FileReader(file));\r\n String line;\r\n line = reader.readLine();\r\n int nodecount = 0;\r\n HashMap <String , Integer> nodeMap = new HashMap <String , Integer>(); \r\n while ((line = reader.readLine()) != null ) {\r\n String data[] = line.split(\",(?=(?:[^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)\");\r\n if (!nodeMap.containsKey(data[0].replaceAll(\"^\\\"|\\\"$\", \"\"))){\r\n nodeMap.put(data[0].replaceAll(\"^\\\"|\\\"$\", \"\"), nodecount);\r\n nodecount++;\r\n }\r\n }\r\n reader.close();\r\n Vertex adjList[] = new Vertex[nodecount];\r\n Vertex sortVer[] = new Vertex[nodecount];\r\n for(int it = 0; it < nodecount; it++){\r\n adjList[it] = new Vertex(it);\r\n }\r\n nodeMap.forEach((k, v) -> adjList[v].val = k);\r\n File file2 = new File(args[1]);\r\n BufferedReader reader2 = new BufferedReader(new FileReader(file2));\r\n line = reader2.readLine();\r\n while ((line = reader2.readLine()) !=null) {\r\n String data[] = line.split(\",(?=(?:[^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)\");\r\n String source = data[0].replaceAll(\"^\\\"|\\\"$\", \"\");\r\n String target = data[1].replaceAll(\"^\\\"|\\\"$\", \"\");\r\n\r\n int weight = Integer.parseInt(data[2]);\r\n Vertex current = adjList[nodeMap.get(source)];\r\n Vertex newbie = new Vertex(nodeMap.get(target));\r\n current.countN++;\r\n current.co_occur += weight;\r\n if (adjList[nodeMap.get(source)].next == null){\r\n current.next = newbie;\r\n newbie.prev = current;\r\n }\r\n else{\r\n current.next.prev = newbie;\r\n newbie.next = current.next;\r\n current.next = newbie;\r\n newbie.prev = current;\r\n }\r\n Vertex current1 = adjList[nodeMap.get(target)];\r\n Vertex newbie1 = new Vertex(nodeMap.get(source));\r\n current1.co_occur += weight;\r\n current1.countN++;\r\n if (current1.next == null){\r\n current1.next = newbie1;\r\n newbie1.prev = current1;\r\n }\r\n else{\r\n current1.next.prev = newbie1;\r\n newbie1.next = current1.next;\r\n current1.next = newbie1;\r\n newbie1.prev = current1;\r\n }\r\n }\r\n reader2.close();\r\n \r\n for(int it = 0; it < nodecount; it++){\r\n sortVer[it] = new Vertex(adjList[it].id);\r\n sortVer[it].val = adjList[it].val;\r\n sortVer[it].co_occur = adjList[it].co_occur;\r\n }\r\n if (args[2].equals(\"average\")){\r\n double countdeg = 0;\r\n for(int it = 0; it<nodecount; it++){\r\n countdeg+= (double) adjList[it].countN;\r\n }\r\n countdeg = countdeg / (double) (nodecount);\r\n System.out.printf(\"%.2f\", countdeg);\r\n System.out.println();\r\n //long toc= System.nanoTime();\r\n //System.out.println((toc- startTime)/1000000000.0);\r\n }\r\n \r\n if(args[2].equals(\"rank\")){\r\n Graph.mergesort(sortVer, 0, nodecount-1);\r\n // long toc= System.nanoTime();\r\n // System.out.println((toc- startTime)/1000000000.0);\r\n System.out.print(sortVer[0].val);\r\n for(int kk=1; kk<nodecount; kk++){\r\n System.out.print(\",\" + sortVer[kk].val.toString());\r\n }\r\n System.out.println();\r\n }\r\n if(args[2].equals(\"independent_storylines_dfs\")){\r\n boolean visited[] = new boolean[nodecount];\r\n int ind = 0;\r\n ArrayList<ArrayList<Vertex>> comps = new ArrayList<ArrayList<Vertex>>();\r\n for(int it1 = 0; it1<nodecount; it1++){\r\n visited[it1] = false;\r\n }\r\n for(int it1 = 0; it1<nodecount; it1++){\r\n if (visited[it1] == false){\r\n ArrayList<Vertex> temp = new ArrayList<Vertex>();\r\n Graph.dfs(it1, visited, ind, adjList, temp);\r\n ind++;\r\n Graph.mergesort2(temp, 0, temp.size()-1);\r\n comps.add(temp);\r\n }\r\n }\r\n Graph.mergesort3(comps, 0, comps.size()-1);\r\n // long toc= System.nanoTime();\r\n // System.out.println((toc- startTime)/1000000000.0);\r\n for(int a1 = 0; a1 < ind; a1++){\r\n System.out.print(comps.get(a1).get(0).val);\r\n for(int j1 = 1; j1<comps.get(a1).size(); j1++){\r\n System.out.print(\",\" + comps.get(a1).get(j1).val);\r\n }\r\n System.out.println();\r\n }\r\n }\r\n }", "private void prepareAdjacencyLists(V v1, V v2, Graph<V, E> block, Graph<V,E> graph, List<V> sVertices,\n\t\t\tList<E> blockEdgesOnS) {\n\n\t\t//organize adjacency list so that edges between a vertex and vertices on S (not on block) \n\t\t//are given priority\n\n\t\t//log.info(\"ordering adjacency lists\");\n\t\tList<V> blockVertices = block.getVertices();\n\n\t\tList<E> vertexAdj = new ArrayList<E>();\n\t\tfor (V v : block.getVertices()){\n\t\t\t//log.info(\"V: \" + v);\n\t\t\tvertexAdj.clear();\n\t\t\tfor (E e : block.adjacentEdges(v)){\n\t\t\t\tif (blockEdgesOnS.contains(e))\n\t\t\t\t\tvertexAdj.add(e);\n\t\t\t\telse{\n\t\t\t\t\tV w = e.getOrigin() == v ? e.getDestination() : e.getOrigin();\n\t\t\t\t\t//see if this vertex is connected to some vertex of the facial cycle\n\t\t\t\t\t//which isn't in the block\n\t\t\t\t\tboolean connectedToFacialvertex = false;\n\t\t\t\t\tfor (E e1 : graph.adjacentEdges(w)){\n\t\t\t\t\t\tV other = e1.getOrigin() == w ? e1.getDestination() : e1.getOrigin();\n\t\t\t\t\t\tif (sVertices.contains(other) && !blockVertices.contains(other)){\n\t\t\t\t\t\t\tconnectedToFacialvertex = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (connectedToFacialvertex)\n\t\t\t\t\t\tvertexAdj.add(0, e);\n\t\t\t\t\telse\n\t\t\t\t\t\tvertexAdj.add(e);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//log.info(vertexAdj);\n\t\t\tblock.adjacentEdges(v).clear();\n\t\t\tblock.adjacentEdges(v).addAll(vertexAdj);\n\t\t}\n\n\t}", "public Iterable<DirectedEdge> pathTo(int v){\n\t\tvalidateVertex(v);\n\t\tif(!hasPathTo(v)) return null;\n\n\t\tLinkedStack<DirectedEdge> stack=new LinkedStack<>();\n\t\twhile(edgeTo[v]!=null){\n\t\t\tstack.push(edgeTo[v]);\n\t\t\tv=edgeTo[v].from();\n\t\t}\n\t\treturn stack;\n\t}", "public static Graph CreateInducedSubgraph(int eindex, Set<Integer> V) throws IOException {\n\n\t\t// System.out.println(\"Inside CreateInducedSubgraph\");\n\t\t// G.print();\n\n\t\tGraph H = new Graph();\n\n\t\tfor (int u : V) {\n\t\t\t// Set<Integer> N = G.AdjList.get(u);\n\t\t\tfor (int v : V) {\n\t\t\t\tif (G.containsEdge(u, v)) {\n\t\t\t\t\tH.addEdge(u, v);\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn H;\n\n\t}", "private static void criaListaDeVertices(Graph graph) {\r\n\t\tfor (int i = 0; i < graph.getArestas().size(); i++) {\r\n\t\t\tif (!graph.getArestas().get(i).getV1().statusVertice()) {\r\n\t\t\t\tgraph.getVerticesGraph().add( graph.getArestas().get(i).getV1() );\r\n\t\t\t\tgraph.getArestas().get(i).getV1().alteraStatusVertice(true);\r\n\t\t\t}\r\n\r\n\t\t\tif (!graph.getArestas().get(i).getV2().statusVertice()) {\r\n\t\t\t\tgraph.getVerticesGraph().add( graph.getArestas().get(i).getV2() );\r\n\t\t\t\tgraph.getArestas().get(i).getV2().alteraStatusVertice(true);\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}", "Collection<E> edges();", "@SuppressWarnings(\"unchecked\")\n\tpublic Map<V, Point2D> execute(Path<V,E> S){\n\n\t\tMap<V, Point2D> ret = new HashMap<V, Point2D>();\n\n\t\t//determine position of S* vertices\n\t\t//TODO center as algorithm parameter\n\t\tPoint2D center = new Point(0,0);\n\n\t\t//convex testing returns S which is equal to S* (there are no vertices \n\t\t//in S which are not in S\n\n\t\tList<V> Svertices = S.pathVertices();\n\t\tSvertices.remove(Svertices.size() - 1);\n\t\tlog.info(\"Face vertices \" + Svertices);\n\t\tCircleLayoutCalc<V> circleCalc = new CircleLayoutCalc<V>();\n\t\tdouble radius = circleCalc.calculateRadius(Svertices, treshold);\n\t\tMap<V,Point2D> positions = circleCalc.calculatePosition(Svertices, radius, center);\n\t\tlog.info(\"Calculating positions of the outer cycle\");\n\t\tlog.info(positions);\n\t\tret.putAll(positions);\n\n\n\t\t//step one - for each vertex v of degree two not on S\n\t\t//replace v together with two edges incident to v with a \n\t\t//single edge joining the vertices adjacent to v\n\n\t\t//leave the original graph intact - make a copy to start with\n\t\tGraph<V,E> gPrim = Util.copyGraph(graph);\n\t\t//store deleted vertices in order to position them later\n\t\tMap<V, E> deletedAdjacentMap = new HashMap<V,E>();\n\n\n\t\t//once a vertex is deleted and its two edges are deleted\n\t\t//and a new one is created\n\t\t//there might be a vertex with degree 2 connected to the deleted vertex\n\t\t//we don't want to create an edge containing the deleted vertex\n\t\t//the newly created edge should be taken into account\n\n\t\tIterator<V> iter = gPrim.getVertices().iterator();\n\t\twhile (iter.hasNext()){\n\t\t\tV v = iter.next();\n\t\t\tif (!Svertices.contains(v) && gPrim.vertexDegree(v) == 2){\n\t\t\t\tlog.info(\"Deleting \" + v);\n\t\t\t\tList<E> edges = gPrim.adjacentEdges(v);\n\t\t\t\tE e1 = edges.get(0);\n\t\t\t\tE e2 = edges.get(1);\n\t\t\t\tlog.info(\"removing \" + e1);\n\t\t\t\tlog.info(\"removing \" + e2);\n\t\t\t\tgPrim.removeEdge(e1);\n\t\t\t\tgPrim.removeEdge(e2);\n\t\t\t\tV adjV1 = e1.getOrigin() == v ? e1.getDestination() : e1.getOrigin();\n\t\t\t\tV adjV2 = e2.getOrigin() == v ? e2.getDestination() : e2.getOrigin();\n\t\t\t\tE newEdge = Util.createEdge(adjV1, adjV2, edgeClass);\n\t\t\t\tlog.info(\"Creating \" + newEdge);\n\t\t\t\tgPrim.addEdge(newEdge);\n\t\t\t\tdeletedAdjacentMap.put(v,newEdge);\n\t\t\t}\n\t\t}\n\n\t\tfor (V v : deletedAdjacentMap.keySet()){\n\t\t\tgPrim.removeVertex(v);\n\t\t}\n\n\n\t\tlog.info(\"G': \" + gPrim);\n\t\t//step 2 - call Draw on (G', S, S*) to extend S* into a convex drawing of G'\n\t\tdraw(gPrim, S.getPath(), Svertices, ret);\n\n\t\t//step 3 For each deleted vertex of degree 2 determine its position on the straight \n\t\t//line segment joining the two vertices adjacent to the vertex\n\n\t\tSet<V> deletedVertices = deletedAdjacentMap.keySet();\n\t\tList<V> coveredVertices = new ArrayList<V>();\n\n\t\tlog.info(\"deleted vertices: \" + deletedVertices);\n\n\t\tfor (V v : deletedVertices){\n\n\t\t\tif (coveredVertices.contains(v))\n\t\t\t\tcontinue;\n\n\t\t\tE addedEdge = deletedAdjacentMap.get(v);\n\t\t\tV firstAdjacent = addedEdge.getOrigin();\n\t\t\tV secondAdjacent = addedEdge.getDestination();\n\t\t\tPoint2D pos1 = ret.get(firstAdjacent);\n\t\t\tPoint2D pos2 = ret.get(secondAdjacent);\n\t\t\tif (pos1 != null && pos2 != null){\n\t\t\t\t//find deleted vertices on this line\n\n\t\t\t\tList<E> adjacentEdges = graph.adjacentEdges(v);\n\t\t\t\tE e1 = adjacentEdges.get(0);\n\t\t\t\tE e2 = adjacentEdges.get(1);\n\t\t\t\tV e1Next = e1.getOrigin() == v ? e1.getDestination() : e1.getOrigin();\n\t\t\t\tV e2Next = e2.getOrigin() == v ? e2.getDestination() : e2.getOrigin();\n\n\t\t\t\tif ((e1Next == firstAdjacent && e2Next == secondAdjacent) ||\n\t\t\t\t\t\t(e2Next == firstAdjacent && e1Next == secondAdjacent)){\n\n\t\t\t\t\t//just one vertex between two known\n\n\t\t\t\t\tdouble xPos = ret.get(e1Next).getX() + ((ret.get(e2Next).getX() - ret.get(e1Next).getX()) / 2);\n\t\t\t\t\tdouble yPos = ret.get(e1Next).getY() + ((ret.get(e2Next).getY() - ret.get(e1Next).getY()) / 2);\n\t\t\t\t\tret.put(v, new Point2D.Double(xPos, yPos));\n\t\t\t\t}\n\t\t\t\telse{\n\n\t\t\t\t\tList<V> verticesOnLine = new ArrayList<V>();\n\t\t\t\t\tverticesOnLine.add(v);\n\n\t\t\t\t\t//in all probability, traversing e1 is enough as the\n\t\t\t\t\t//vertex won't be somewhere in the middle, but directly \n\t\t\t\t\t//connected to one of the vertices whose positions are known\n\t\t\t\t\t//keep both for now\n\t\t\t\t\t//traverse e1\n\t\t\t\t\tE currentE = e1;\n\t\t\t\t\tint numberThroughE1 = 0;\n\t\t\t\t\twhile (e1Next != firstAdjacent && e1Next != secondAdjacent){\n\t\t\t\t\t\tif (!verticesOnLine.contains(e1Next)){\n\t\t\t\t\t\t\tverticesOnLine.add(e1Next);\n\t\t\t\t\t\t\tnumberThroughE1++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tList<E> currentAdjacent = graph.adjacentEdges(e1Next);\n\t\t\t\t\t\tif (currentAdjacent.get(0) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(1);\n\t\t\t\t\t\telse if (currentAdjacent.get(1) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(0);\n\n\t\t\t\t\t\te1Next = currentE.getOrigin() == e1Next ? currentE.getDestination() : currentE.getOrigin();\n\t\t\t\t\t}\n\n\n\t\t\t\t\t//traverse e2\n\t\t\t\t\tcurrentE = e2;\n\t\t\t\t\twhile (e2Next != firstAdjacent && e2Next != secondAdjacent){\n\t\t\t\t\t\tif (!verticesOnLine.contains(e2Next))\n\t\t\t\t\t\t\tverticesOnLine.add(e2Next);\n\n\t\t\t\t\t\tList<E> currentAdjacent = graph.adjacentEdges(e2Next);\n\t\t\t\t\t\tif (currentAdjacent.get(0) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(1);\n\t\t\t\t\t\telse if (currentAdjacent.get(1) == currentE)\n\t\t\t\t\t\t\tcurrentE = currentAdjacent.get(0);\n\n\t\t\t\t\t\te2Next = currentE.getOrigin() == e2Next ? currentE.getDestination() : currentE.getOrigin();\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.info(\"vertices on line: \" + verticesOnLine);\n\t\t\t\t\tcoveredVertices.addAll(verticesOnLine);\n\n\t\t\t\t\tint numberOfVerticesOnLine = verticesOnLine.size();\n\t\t\t\t\tdouble incrementX = (ret.get(e2Next).getX() - ret.get(e1Next).getX()) / (numberOfVerticesOnLine + 1);\n\t\t\t\t\tdouble incrementY = (ret.get(e2Next).getY() - ret.get(e1Next).getY()) / (numberOfVerticesOnLine + 1);\n\n\t\t\t\t\tPoint2D currentPosition = ret.get(e1Next); //e1Next holds a vertex whose position is known\n\n\t\t\t\t\tfor (int i = numberThroughE1; i >= 0; i--){\n\t\t\t\t\t\tV currentV = verticesOnLine.get(i);\n\t\t\t\t\t\tPoint2D position = new Point2D.Double(currentPosition.getX() + incrementX, currentPosition.getY() + incrementY);\n\t\t\t\t\t\tret.put(currentV, position);\n\t\t\t\t\t\tcurrentPosition = position;\n\t\t\t\t\t}\n\n\n\t\t\t\t\tfor (int i = numberThroughE1 + 1; i< numberOfVerticesOnLine; i++){\n\t\t\t\t\t\tV currentV = verticesOnLine.get(i);\n\t\t\t\t\t\tPoint2D position = new Point2D.Double(currentPosition.getX() + incrementX, currentPosition.getY() + incrementY);\n\t\t\t\t\t\tret.put(currentV, position);\n\t\t\t\t\t\tcurrentPosition = position;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t}\n\n\t\t}\n\n\n\t\treturn ret;\n\t}", "private static Set<Integer> approxVertexCover(Set<Pair<Integer>> edges, Set<Integer> nodes, Set<Integer> currCover){\r\n\t\t/*\r\n\t\t * 1. Sort mutation groups by size.\r\n\t\t * 2. Find largest mutation (that hasn't been removed).\r\n\t\t * -> Find all edges with this group.\r\n\t\t * -> Store connecting nodes in currCover\r\n\t\t * -> Remove the node's connecting edges and corresponding nodes\r\n\t\t * 3. Repeat 2 until no edges left \r\n\t\t */\r\n\t\t//Initialize edges and nodes\r\n\t\tSet<Pair<Integer>> allEdges = new HashSet<Pair<Integer>>(edges);\r\n\t\tSet<Integer> allNodes = new HashSet<Integer>(nodes);\r\n\t\t\r\n\t\tint numEdgesInTree = getNumTotalEdges();\r\n\t\tint totalMut = (int) getTotalMutations();\r\n\t\t/**\r\n\t\t * Taken out for time testing\r\n\t\t */\r\n//\t\tSystem.out.println(\"Total Mutations: \" + totalMut);\r\n\t\tint conflictThreshold = getConflictThreshold(totalMut, numEdgesInTree);\r\n\t\t//System.out.println(\"Conflict Threshold: \" + conflictThreshold);\r\n\t\t//while there are still conflicting edges\r\n\t\twhile (!allEdges.isEmpty()){\r\n\t\t\t//find largest node\r\n\t\t\tint maxNode = -1;\r\n\t\t\tdouble maxMutRate = 0.0;\r\n\t\t\tfor (Integer node: allNodes){\r\n\t\t\t\tdouble currMutRate = rowToMutRateMap.get(node+1);\r\n\t\t\t\tif (currMutRate > maxMutRate){\r\n\t\t\t\t\tmaxMutRate = currMutRate;\r\n\t\t\t\t\tmaxNode = node;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t/* recalculate threshold */\r\n\t\t\tif (maxNode == 113){\r\n\t\t\t}\r\n\t\t\tconflictThreshold = getConflictThreshold(totalMut, numEdgesInTree);\r\n\t\t\t/**\r\n\t\t\t * Taken out for time testing\r\n\t\t\t */\r\n//\t\t\tSystem.out.println(\"Conflict Threshold: \" + conflictThreshold);\r\n\t\t\t/*\r\n\t\t\t * if the highest mut rate is less than\r\n\t\t\t * conflictThreshold, no more nodes\r\n\t\t\t * can be added to maximal independent set,\r\n\t\t\t * meaning remaining nodes should be put\r\n\t\t\t * in vertex cover\r\n\t\t\t */\r\n\t\t\tif (maxMutRate < conflictThreshold) {\r\n\t\t\t\tcurrCover.addAll(allNodes);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t//remove largest node\r\n\t\t\tallNodes.remove(maxNode);\r\n\t\t\tnumEdgesInTree++;\r\n\t\t\t//find all nodes which conflict with largest\r\n\t\t\tfor (Pair<Integer> edge: allEdges){\r\n\t\t\t\tif (edge.getFirst().equals(maxNode)){\r\n\t\t\t\t\tint conflictNode = edge.getSecond().intValue();\r\n\t\t\t\t\tcurrCover.add(conflictNode);\r\n\t\t\t\t\t//allEdges.remove(edge);\r\n\t\t\t\t} else if (edge.getSecond().equals(maxNode)){\r\n\t\t\t\t\tint conflictNode = edge.getFirst().intValue();\r\n\t\t\t\t\tcurrCover.add(conflictNode);\r\n\t\t\t\t\t//allEdges.remove(edge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//System.out.println(\"Edges left after initial trimming: \" + allEdges.toString());\r\n\t\t\t//Remove these nodes\r\n\t\t\tallNodes.removeAll(currCover);\r\n\t\t\t//System.out.println(\"Remaining Nodes: \" + allNodes.toString());\r\n\t\t\t//Remove any edges \r\n\t\t\tSet<Pair<Integer>> edgesToRemove = new HashSet<Pair<Integer>>();\r\n\t\t\tfor (Pair<Integer> edge: allEdges){\r\n\t\t\t\tint first = edge.getFirst().intValue();\r\n\t\t\t\tint second = edge.getSecond().intValue();\r\n\t\t\t\tif (currCover.contains(first) || currCover.contains(second)){\r\n\t\t\t\t\t//allEdges.remove(edge);\r\n\t\t\t\t\tedgesToRemove.add(edge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tallEdges.removeAll(edgesToRemove);\r\n\t\t\t//System.out.println(\"Edges left after final cuts: \" + allEdges.toString());\r\n\t\t}\r\n\t\treturn currCover;\r\n\t}", "static int[] topoSortDFS(int V, ArrayList<ArrayList<Integer>> adj)\n {\n System.out.println(adj);\n // add your code here\n Stack<Integer> explored = new Stack<Integer>();\n Set<Integer> visited = new HashSet<Integer>();\n for(int i=0;i<adj.size();i++){\n if(!visited.contains(i))\n dfs(V,adj,visited,explored);\n }\n //Once the DFS is complete, convert the 'explored' stack to array\n int ans[] = new int[explored.size()];\n int ind = 0;\n for(int x : explored){\n ans[ind++] = x;\n }\n return ans;\n }", "@Override\n public Iterable<V> adjacentTo(V from)\n {\n if (from.equals(null)){\n throw new IllegalArgumentException();\n }\n Iterator graphIterator = graph.entrySet().iterator();\n \t Map.Entry graphElement = (Map.Entry) graphIterator.next();\n \t V vert = (V)graphElement.getKey();\n \t while (graphIterator.hasNext() && vert != from){\n \t\tgraphElement = (Map.Entry) graphIterator.next();\n \t\tvert = (V)graphElement.getKey();\n \t }\n \t ArrayList <V> edges = graph.get(vert);\n \t //Iterable <V> e = edges;\n \t return edges;\n }", "public AdjacentListGraph(String[] vertexes) {\n this.vertexes = Arrays.copyOf(vertexes, vertexes.length);\n this.heads = new LinkedList[vertexes.length];\n\n // init the heads to save code: if(heads != null)\n for (int i = 0; i < heads.length; i++) {\n this.heads[i] = new LinkedList<>();\n }\n }", "ArrayList<ArrayList<Vertex>> kruskalVertice(ArrayList<ArrayList<Vertex>> v) {\n ArrayList<Edge> allEdges = getEdges(v);\n for (ArrayList<Vertex> i : v) {\n for (Vertex j : i) {\n j.outEdges = new ArrayList<Edge>();\n }\n }\n int totalCells = height * width;\n IList<Edge> loe = new Empty<Edge>();\n //getting naming error, not sure why\n ArrayList<Edge> allEdgesSorted = mergeHelp(allEdges);\n HashMap<Integer, Integer> hash = new HashMap<Integer, Integer>();\n for (int i = 0; i <= (1000 * height) + width; i++) {\n hash.put(i, i);\n }\n ArrayList<Edge> l = allEdgesSorted;\n while (loe.len() < totalCells - 1) {\n Edge e = l.get(0);\n if (this.find(hash, e.to.toIdentifier()) != this.find(hash, e.from.toIdentifier())) {\n loe = loe.add(e);\n e.from.outEdges.add(e);\n e.to.outEdges.add(new Edge(e.to, e.from, e.weight));\n int temp = (find(hash, e.to.toIdentifier()));\n hash.remove(find(hash, e.to.toIdentifier()));\n hash.put(temp, find(hash, e.from.toIdentifier()));\n }\n l.remove(0);\n }\n return v;\n }", "public abstract Multigraph buildMatchedGraph();", "public HashMap<Integer, Integer> findAugumentPath() {\n if (debug == 1) printFree();\n HashMap<Integer, Integer> Path = new HashMap<>();\n if (V1.isEmpty() || V2.isEmpty()) {\n if (debug == 1) System.out.println(\"V1||V2 is empty\");\n return Path;\n }\n\n GM.clearAllEdge();\n for (int i = 0; i < x.length; i++) {\n for (int j : x[i].getDomain()) {\n GM.addEdge(i, Map.get(j));\n }\n }\n GM.adjList[X].clear();\n for (int i : V1) {\n GM.addEdge(X, i);\n }\n for (int i = 0; i < x.length; i++) {\n if (MaxMatch[i] != 0) GM.addEdge(MaxMatch[i], i);\n }\n if (debug == 1) System.out.println(GM);\n\n // DFS từ X. Gặp 1 đỉnh thuộc V2 thì break\n boolean[] visited = new boolean[nbOfVertex + 10];\n int[] prev = new int[nbOfVertex + 10];\n prev[X] = -1;\n int last = -1;\n\n Stack<Integer> S = new Stack<>();\n S.push(X);\n while (!S.isEmpty() && last == -1) {\n int top = S.pop();\n //System.out.println(\"Popped \" + top);\n if (!visited[top]) {\n visited[top] = true;\n for (int next : GM.adjList[top])\n if (!visited[next]) {\n prev[next] = top;\n if (V2.contains(next)) {\n last = next;\n //System.out.println(\"Here \" + next);\n break;\n }\n S.push(next);\n //System.out.println(\"Pushed \" + next);\n }\n }\n }\n if (last == -1) {\n //System.out.println(\"Cant find any augument path\\n\");\n } else {\n //System.out.println(\"Constructing augument path\");\n //int step = 0;\n while (last != -1) {\n int from = prev[last];\n if (from == X) break;\n Path.put(from, last);\n ////System.out.println(Math.min(from, last) + \" --> \" + Math.max(from, last));\n last = from;\n //step++;\n //if(step>10) break;\n }\n if (debug == 1) System.out.println(\"Construct augument path completed \" + Path.size());\n if (debug == 1) printCurrentAugumentPath(Path);\n }\n //System.out.println(Path.size());\n return Path;\n }", "private void initializeEdges() {\n for (NasmInst inst : nasm.listeInst) {\n if (inst.source == null || inst.destination == null)\n return;\n Node from = inst2Node.get(label2Inst.get(inst.source.toString()));\n Node to = inst2Node.get(label2Inst.get(inst.destination.toString()));\n if (from == null || to == null)\n return;\n graph.addEdge(from, to);\n }\n }", "public abstract Graph getParents(String childVertexHash);", "@Test \r\n void add_mutiple_edges_check_size(){\r\n for(int i = 0; i < 20; i++) {\r\n graph.addEdge(\"\" + i, \"\" + (i + 1));\r\n } \r\n List<String> adjacent;\r\n for(int i = 0; i < 20; i++) {\r\n adjacent = graph.getAdjacentVerticesOf(\"\"+i);\r\n if(!adjacent.contains(\"\" + (i+1))) {\r\n fail();\r\n }\r\n }\r\n if(graph.size() != 20 | graph.order() != 21) {\r\n fail();\r\n }\r\n \r\n }", "public void addVertex (T vertex){\n if (vertexIndex(vertex) > 0) return; // vertex already in graph, return.\n if (n == vertices.length){ // need to expand capacity of arrays\n expandCapacity();\n }\n \n vertices[n] = vertex;\n for (int i = 0; i < n; i++){ // populating new edges with -1\n edges[n][i] = -1;\n edges[i][n] = -1;\n }\n n++;\n }", "public void testContainsVertex() {\n System.out.println(\"containsVertex\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n Assert.assertTrue(graph.containsVertex(new Integer(i)));\n }\n }", "public Set<V> getNeighbours(V vertex);" ]
[ "0.5959954", "0.59106827", "0.58962923", "0.58578384", "0.5764308", "0.570903", "0.55628824", "0.55119574", "0.54777765", "0.5464851", "0.5410033", "0.54074556", "0.5388436", "0.53869593", "0.53747773", "0.53078455", "0.5297588", "0.5289977", "0.52877057", "0.5276022", "0.52656215", "0.5261486", "0.52546287", "0.52423507", "0.52423054", "0.5241726", "0.5225339", "0.52191556", "0.52143425", "0.5213558", "0.5213533", "0.5211873", "0.52097887", "0.52036434", "0.51938534", "0.51934814", "0.5190932", "0.5178286", "0.5155757", "0.51554555", "0.51382273", "0.51381594", "0.513087", "0.5115618", "0.51109946", "0.51005954", "0.5100202", "0.5098361", "0.50966454", "0.5095815", "0.5094134", "0.5092098", "0.50815487", "0.5081237", "0.50776863", "0.5067073", "0.5058352", "0.5055231", "0.5052149", "0.5042689", "0.5039551", "0.5037226", "0.50331223", "0.50232285", "0.50222725", "0.5015234", "0.5011116", "0.5007906", "0.5004162", "0.5001286", "0.4987659", "0.4986537", "0.49842846", "0.4979476", "0.4969764", "0.49619618", "0.49561068", "0.49551374", "0.49519977", "0.4947711", "0.49331844", "0.49238", "0.49233696", "0.49215603", "0.4919994", "0.49196678", "0.4918706", "0.49069816", "0.49014354", "0.48997092", "0.48903388", "0.48790216", "0.48780623", "0.48761082", "0.487086", "0.48698893", "0.48656306", "0.48571125", "0.48565218", "0.4855285" ]
0.61914754
0
Initialize the contents of the frame.
private void initialize() { frame = new JFrame(); frame.setBounds(100, 100, 600, 600); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); card = new CardLayout(0, 0); frame.getContentPane().setLayout(card); JPanel panel = new JPanel(); panel.setBackground(Color.WHITE); frame.getContentPane().add(panel, "name_6126640247321"); panel.add(cdFilmePanel); JPanel panel_1 = new JPanel(); panel_1.setBackground(Color.WHITE); frame.getContentPane().add(panel_1, "name_6128366176959"); panel_1.add(fdFilmePanel); JMenuBar menuBar = new JMenuBar(); frame.setJMenuBar(menuBar); JMenu mnNewMenu = new JMenu("Filmes"); menuBar.add(mnNewMenu); JMenuItem mntmNewMenuItem_1 = new JMenuItem("New menu item"); mntmNewMenuItem_1.setAction(action); mnNewMenu.add(mntmNewMenuItem_1); JMenuItem mntmNewMenuItem = new JMenuItem("New menu item"); mntmNewMenuItem.setAction(action_1); mnNewMenu.add(mntmNewMenuItem); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public BreukFrame() {\n super();\n initialize();\n }", "public MainFrame() {\n\t\tsuper();\n\t\tinitialize();\n\t}", "private void initialize() {\n\t\tthis.setSize(211, 449);\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setTitle(\"JFrame\");\n\t}", "public SiscobanFrame() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(0, 0, 1100, 800);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\tsetUIComponents();\n\t\tsetControllers();\n\n\t}", "private void initialize() {\r\n\t\tthis.setSize(530, 329);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JFrame\");\r\n\t}", "private void initialize() {\r\n\t\tthis.setSize(300, 200);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JFrame\");\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\taddSampleData();\n\t\tsetDefaultSettings();\n\t\topenHomePage();\n\t\tframe.setVisible(true);\n\t}", "private void initialize() {\n\t\tframe = new JFrame(\"Media Inventory\");\r\n\t\tframe.setBounds(100, 100, 450, 300);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(0, 0, 1000, 700);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tframeContent = new JPanel();\n\t\tframe.getContentPane().add(frameContent);\n\t\tframeContent.setBounds(10, 10, 700, 640);\n\t\tframeContent.setLayout(null);\n\t\t\n\t\tinfoPane = new JPanel();\n\t\tframe.getContentPane().add(infoPane);\n\t\tinfoPane.setBounds(710, 10, 300, 640);\n\t\tinfoPane.setLayout(null);\n\t}", "private void initialize() {\n\t\tframe = new JFrame(\"BirdSong\");\n\t\tframe.pack();\n\t\tframe.setVisible(true);\n\t\tframe.setBounds(100, 100, 400, 200);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\tabc = new BirdPanel();\n\t\ttime = new TimePanel();\n\t\tgetContentPane().setLayout(new BoxLayout(frame, BoxLayout.Y_AXIS));\n\n\t\tframe.getContentPane().add(abc, BorderLayout.NORTH);\n\t\tframe.getContentPane().add(time, BorderLayout.CENTER);\n\t}", "private void initialize() {\r\n\t\tthis.setSize(311, 153);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JFrame\");\r\n\t\tsetCancelButton( btnCancel );\r\n\t}", "public Frame() {\n initComponents();\n }", "public Frame() {\n initComponents();\n }", "private void initialize() {\r\n\t\tthis.setSize(497, 316);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JFrame\");\r\n\t\tthis.setExtendedState(JFrame.MAXIMIZED_BOTH);\r\n\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t}", "protected HFrame(){\n\t\tinit();\n\t}", "private void initializeFields() {\r\n myFrame = new JFrame();\r\n myFrame.setSize(DEFAULT_SIZE);\r\n }", "private void initialize() {\r\n\t\t//setFrame\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(125,175, 720, 512);\r\n\t\tframe.setTitle(\"Periodic Table\");\r\n\t\tframe.setResizable(false);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t}", "private void initialize() {\n\t\tthis.setSize(329, 270);\n\t\tthis.setContentPane(getJContentPane());\n\t}", "private void initFrame() {\n setLayout(new BorderLayout());\n }", "private void initialize() {\n\t\tthis.setSize(300, 300);\n\t\tthis.setIconifiable(true);\n\t\tthis.setClosable(true);\n\t\tthis.setTitle(\"Sobre\");\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setFrameIcon(new ImageIcon(\"images/16x16/info16x16.gif\"));\n\t}", "public FrameControl() {\n initComponents();\n }", "private void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(100, 100, 450, 300);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t}", "public MainFrame() {\n initComponents();\n \n }", "private void init(Element frame) {\n\t\tthis.frameWidth = Integer.parseInt(frame.attributeValue(\"width\"));\n\t\tthis.frameHeight = Integer.parseInt(frame.attributeValue(\"height\"));\n\t\tthis.paddle = Integer.parseInt(frame.attributeValue(\"paddle\"));\n\t\tthis.size = Integer.parseInt(frame.attributeValue(\"size\"));\n\t}", "public MainFrame() {\n \n initComponents();\n \n this.initNetwork();\n \n this.render();\n \n }", "public internalFrame() {\r\n initComponents();\r\n }", "private void initialize() {\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setSize(810, 600);\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setBackground(new java.awt.Color(226,226,222));\n\t\tthis.setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);\n\t\tthis.setModal(true);\n\t\tthis.setResizable(false);\n\t\tthis.setName(\"FramePrincipalLR\");\n\t\tthis.setTitle(\"CR - Lista de Regalos\");\n\t\tthis.setLocale(new java.util.Locale(\"es\", \"VE\", \"\"));\n\t\tthis.setUndecorated(false);\n\t}", "public Mainframe() {\n initComponents();\n }", "private void initialize() {\r\n\t\tthis.setSize(392, 496);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"Informações\");\r\n\t}", "private void initialize() {\n this.setSize(253, 175);\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n this.setContentPane(getJContentPane());\n this.setTitle(\"Breuken vereenvoudigen\");\n }", "private void initialize() {\r\n\t\t// Initialize main frame\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(Constants.C_MAIN_PREFERED_POSITION_X_AT_START, Constants.C_MAIN_PREFERED_POSITION_Y_AT_START, \r\n\t\t\t\tConstants.C_MAIN_PREFERED_SIZE_X, Constants.C_MAIN_PREFERED_SIZE_Y);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.setTitle(Constants.C_MAIN_WINDOW_TITLE);\r\n\t\t\r\n\t\t// Tab panel and their panels\r\n\t\tmainTabbedPane = new JTabbedPane(JTabbedPane.TOP);\r\n\t\tframe.getContentPane().add(mainTabbedPane, BorderLayout.CENTER);\r\n\t\t\r\n\t\tpanelDecision = new DecisionPanel();\r\n\t\tmainTabbedPane.addTab(Constants.C_TAB_DECISION_TITLE, null, panelDecision, null);\r\n\t\t\r\n\t\tpanelCalculation = new CalculationPanel();\r\n\t\tmainTabbedPane.addTab(Constants.C_TAB_CALCULATION_TITLE, null, panelCalculation, null);\r\n\t\t\r\n\t\tpanelLibrary = new LibraryPanel();\r\n\t\tmainTabbedPane.addTab(Constants.C_TAB_LIBRARY_TITLE, null, panelLibrary, null);\r\n\t\t\r\n\t\t// Menu bar\r\n\t\tmenuBar = new JMenuBar();\r\n\t\tframe.setJMenuBar(menuBar);\r\n\t\tcreateMenus();\r\n\t}", "public void initializeFrame() {\n frame.getContentPane().removeAll();\n createComponents(frame.getContentPane());\n// frame.setSize(new Dimension(1000, 600));\n }", "private void initialize() {\r\n\t\t// this.setSize(271, 295);\r\n\t\tthis.setSize(495, 392);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(ResourceBundle.getBundle(\"Etiquetas\").getString(\"MainTitle\"));\r\n\t}", "private void initializeFrame() {\n add(container);\n setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);\n pack();\n }", "private void initialize() {\n this.setSize(300, 200);\n this.setContentPane(getJContentPane());\n this.pack();\n }", "private void initialize() {\n\t\tframe = new JFrame(\"DB Filler\");\n\t\tframe.setBounds(100, 100, 700, 500);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\tdbc = new DataBaseConnector();\n\t\tcreateFileChooser();\n\n\t\taddTabbedPane();\n\t\tsl_panel = new SpringLayout();\n\t\taddAddFilePanel();\n\t}", "public mainframe() {\n initComponents();\n }", "public FrameDesign() {\n initComponents();\n }", "public Jframe() {\n initComponents();\n setIndice();\n loadTextBoxs();\n }", "public JGSFrame() {\n\tsuper();\n\tinitialize();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n try {\n initComponents();\n initElements();\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"Error \" + e.getMessage());\n }\n }", "private void initialize() {\n this.setSize(495, 276);\n this.setTitle(\"Translate Frost\");\n this.setContentPane(getJContentPane());\n }", "private void initialize() {\r\n\t\t// set specific properties and add inner components.\r\n\t\tthis.setBorder(BorderFactory.createEtchedBorder());\r\n\t\tthis.setSize(300, 400);\r\n\t\tthis.setLayout(new BorderLayout());\r\n\t\taddComponents();\r\n\t}", "private void initialize() {\r\n\t\tthis.setBounds(new Rectangle(0, 0, 670, 576));\r\n\t\tthis.setResizable(false);\r\n\t\tthis.setTitle(\"数据入库 \");\r\n\t\tthis.setLocationRelativeTo(getOwner());\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t}", "public void initializePanelToFrame() {\n\t\tnew ColorResources();\n\t\tnew TextResources().changeLanguage();\n\t\tpanel = new JPanel();\n\t\tpanel.setLayout(null);\n\t\tpanel.setPreferredSize(new Dimension(375, 812));\n\n\t\tconfigureLabels();\n\t\tconfigureButtons();\n\t\taddListeners();\n\t\taddComponentsToPanel();\n\n\t\tthis.setContentPane(panel);\n\t\tthis.pack();\n\t}", "private void initialize() {\n this.setLayout(new BorderLayout());\n this.setSize(new java.awt.Dimension(564, 229));\n this.add(getMessagePanel(), java.awt.BorderLayout.NORTH);\n this.add(getBalloonSettingsListBox(), java.awt.BorderLayout.CENTER);\n this.add(getBalloonSettingsButtonPane(), java.awt.BorderLayout.SOUTH);\n\n editBalloonSettingsFrame = new EditBalloonSettingsFrame();\n\n }", "public SMFrame() {\n initComponents();\n updateComponents();\n }", "private void initialize() {\n m_frame = new JFrame(\"Video Recorder\");\n m_frame.setResizable(false);\n m_frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n m_frame.setLayout(new BorderLayout());\n m_frame.add(buildContentPanel(), BorderLayout.CENTER);\n\n JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 5, 5));\n JButton startButton = new JButton(\"Start\");\n startButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent ae) {\n listen();\n }\n });\n buttonPanel.add(startButton);\n\n m_connectionLabel = new JLabel(\"Disconnected\");\n m_connectionLabel.setOpaque(true);\n m_connectionLabel.setBackground(Color.RED);\n m_connectionLabel.setBorder(BorderFactory.createLineBorder(Color.BLACK, 3));\n m_connectionLabel.setPreferredSize(new Dimension(100, 26));\n m_connectionLabel.setHorizontalAlignment(SwingConstants.CENTER);\n buttonPanel.add(m_connectionLabel);\n\n m_frame.add(buttonPanel, BorderLayout.PAGE_END);\n }", "public FirstNewFrame() {\n\t\tjbInit();\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.getContentPane().setBackground(Color.BLACK);\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tJButton btnNewButton = new JButton(\"Play\");\n\t\tbtnNewButton.setFont(new Font(\"Bodoni 72\", Font.BOLD, 13));\n\t\tbtnNewButton.setBounds(frame.getWidth() / 2 - 60, 195, 120, 30);\n\t\tframe.getContentPane().add(btnNewButton);\n\t\t\n\t\tJLabel lblNewLabel = new JLabel(\"Space Escape\");\n\t\tlblNewLabel.setForeground(Color.WHITE);\n\t\tlblNewLabel.setFont(new Font(\"Bodoni 72\", Font.BOLD, 24));\n\t\tlblNewLabel.setBounds(frame.getWidth() / 2 - 60, 30, 135, 25);\n\t\tframe.getContentPane().add(lblNewLabel);\n\t\t\n\t\tJLabel lblNewLabel_1 = new JLabel(\"New label\");\n\t\tlblNewLabel_1.setBounds(0, 0, frame.getWidth(), frame.getHeight());\n\t\tframe.getContentPane().add(lblNewLabel_1);\n\t}", "private void initializeFrame()\r\n\t{\r\n\t\tthis.setResizable(false);\r\n\r\n\t\tsetSize(DIMENSIONS); // set the correct dimensions\r\n\t\tsetDefaultCloseOperation(EXIT_ON_CLOSE);\r\n\t\tsetLayout( new GridLayout(1,1) );\r\n\t}", "private void setupFrame()\n\t{\n\t\tthis.setContentPane(botPanel);\n\t\tthis.setSize(800,700);\n\t\tthis.setTitle(\"- Chatbot v.2.1 -\");\n\t\tthis.setResizable(true);\n\t\tthis.setVisible(true);\n\t}", "public MainFrame() {\n initComponents();\n setLocationRelativeTo(null);\n }", "public EmulatorFrame() {\r\n\t\tsuper(\"Troyboy Chip8 Emulator\");\r\n\t\t\r\n\t\tsetNativeLAndF();\r\n\t\tinitComponents();\r\n\t\tinitMenubar();\r\n\t\tsetupLayout();\r\n\t\tinitFrame();\r\n\t\t//frame is now ready to run a game\r\n\t\t//running of any games must be started by loading a ROM\r\n\t}", "public void init()\n {\n buildUI(getContentPane());\n }", "private void initialize()\n {\n this.setTitle( \"SerialComm\" ); // Generated\n this.setSize( 500, 300 );\n this.setContentPane( getJContentPane() );\n }", "public launchFrame() {\n \n initComponents();\n \n }", "private void initialize() {\r\n\t\tthis.setSize(378, 283);\r\n\t\tthis.setJMenuBar(getMenubar());\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JAVIER\");\r\n\t}", "private void initialize() {\n\t\tthis.setSize(430, 280);\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setUndecorated(true);\n\t\tthis.setModal(true);\n\t\tthis.setBackground(new java.awt.Color(226,226,222));\n\t\tthis.setTitle(\"Datos del Invitado\");\n\t\tthis.addComponentListener(this);\n\t}", "public PilaFrame() {\n initComponents();\n }", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, 900, 900);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\n\t\tgame = new Game();\n\t\t\n\t\tGameTable puzzle = new GameTable(game.getPuzzle());\n\t\tpuzzle.setBounds(100, 100, 700, 700);\n\t\t\n\t\tframe.add(puzzle);\n\t\t\n\t\tSystem.out.println(\"SAD\");\n\t\t\n\t}", "private void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.setResizable(false);\r\n\t\tframe.setBounds(100, 100, 450, 300);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\t\r\n\t\tPanel mainFramePanel = new Panel();\r\n\t\tmainFramePanel.setBounds(10, 10, 412, 235);\r\n\t\tframe.getContentPane().add(mainFramePanel);\r\n\t\tmainFramePanel.setLayout(null);\r\n\t\t\r\n\t\tfinal TextField textField = new TextField();\r\n\t\ttextField.setBounds(165, 62, 79, 24);\r\n\t\tmainFramePanel.add(textField);\r\n\t\t\r\n\t\tButton changeTextButt = new Button(\"Change Text\");\r\n\t\tchangeTextButt.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\ttextField.setText(\"Domograf\");\r\n\t\t\t}\r\n\t\t});\r\n\t\tchangeTextButt.setBounds(165, 103, 79, 24);\r\n\t\tmainFramePanel.add(changeTextButt);\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setResizable(false);\n\t\tframe.setAlwaysOnTop(true);\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t}", "StudentFrame() {\n \tgetContentPane().setFont(new Font(\"Times New Roman\", Font.PLAIN, 11));\n s1 = null; // setting to null\n initializeComponents(); // causes frame components to be initialized\n }", "public NewFrame() {\n initComponents();\n }", "private void initialize() {\r\n\t\tthis.setSize(300, 200);\r\n\t\tthis.setTitle(\"Error\");\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t}", "public SerialCommFrame()\n {\n super();\n initialize();\n }", "public LoginFrame() {\n\t\tsuper();\n\t\tinitialize();\n\t}", "public BaseFrame() {\n initComponents();\n }", "private void initialize() {\r\n\t\tthis.setSize(733, 427);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"jProxyChecker\");\r\n\t}", "public frame() {\r\n\t\tadd(createMainPanel());\r\n\t\tsetTitle(\"Lunch Date\");\r\n\t\tsetSize(FRAME_WIDTH, FRAME_HEIGHT);\r\n\r\n\t}", "public MercadoFrame() {\n initComponents();\n }", "private void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(X_FRAME, Y_FRAME, WIDTH_FRAME, HEIGHT_FRAME);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\t\r\n\t\tJButton btnAddSong = new JButton(\"Add song\");\r\n\t\tbtnAddSong.setBounds(X_BTN, Y_ADDSONG, WIDTH_BTN, HEIGHT_BTN);\r\n\t\tframe.getContentPane().add(btnAddSong);\r\n\t\t\r\n\t\tJTextPane txtpnBlancoYNegro = new JTextPane();\r\n\t\ttxtpnBlancoYNegro.setText(\"Blanco y negro\\r\\nThe Spectre\\r\\nGirasoles\\r\\nFaded\\r\\nTu Foto\\r\\nEsencial\");\r\n\t\ttxtpnBlancoYNegro.setBounds(X_TXT, Y_TXT, WIDTH_TXT, HEIGHT_TXT);\r\n\t\tframe.getContentPane().add(txtpnBlancoYNegro);\r\n\t\t\r\n\t\tJLabel lblSongs = new JLabel(\"Songs\");\r\n\t\tlblSongs.setBounds(X_LBL, Y_LBL, WIDTH_LBL, HEIGHT_LBL);\r\n\t\tframe.getContentPane().add(lblSongs);\r\n\t\t\r\n\t\tJButton btnAddAlbum = new JButton(\"Add album\");\r\n\t\tbtnAddAlbum.setBounds(X_BTN, Y_ADDALBUM, WIDTH_BTN, HEIGHT_BTN);\r\n\t\tframe.getContentPane().add(btnAddAlbum);\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, 800, 800);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\n\t\tJPanel browserPanel = new JPanel();\n\t\tframe.getContentPane().add(browserPanel, BorderLayout.CENTER);\n\t\t\n\t\t// create javafx panel for browser\n browserFxPanel = new JFXPanel();\n browserPanel.add(browserFxPanel);\n \n // create JavaFX scene\n Platform.runLater(new Runnable() {\n public void run() {\n createScene();\n }\n });\n\t}", "public holdersframe() {\n initComponents();\n }", "public void init() {\n\t\tsetSize(500,300);\n\t}", "private void setupFrame()\n\t\t{\n\t\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\tthis.setResizable(false);\n\t\t\tthis.setSize(800, 600);\n\t\t\tthis.setTitle(\"SEKA Client\");\n\t\t\tthis.setContentPane(panel);\n\t\t\tthis.setVisible(true);\n\t\t}", "public addStFrame() {\n initComponents();\n }", "public JFrame() {\n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "private void initialize() {\n\t\tframe = new JFrame(\"View Report\");\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\n\t\tJButton backButton = new JButton(\"Back\");\n\t\tbackButton.setBounds(176, 227, 89, 23);\n\t\tframe.getContentPane().add(backButton);\n\t\tbackButton.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tframe.setVisible(false);\n\t\t\t}\n\t\t});\n\t\t\n\t\tJTextArea textArea = new JTextArea();\n\t\ttextArea.setBounds(50, 30, 298, 173);\n\t\tframe.getContentPane().add(textArea);\n\t\ttextArea.append(control.seeReport());\n\t\tframe.setVisible(true);\n\t}", "private void initialize() {\r\n this.setSize(new Dimension(666, 723));\r\n this.setContentPane(getJPanel());\r\n\t\t\t\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.getContentPane().setBackground(Color.BLACK);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tJLabel lblSubmission = new JLabel(\"Submission\");\n\t\tlblSubmission.setForeground(Color.WHITE);\n\t\tlblSubmission.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 16));\n\t\tlblSubmission.setBounds(164, 40, 83, 14);\n\t\tframe.getContentPane().add(lblSubmission);\n\t\t\n\t\tJLabel lblTitle = new JLabel(\"Title:\");\n\t\tlblTitle.setForeground(Color.WHITE);\n\t\tlblTitle.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 14));\n\t\tlblTitle.setBounds(77, 117, 41, 14);\n\t\tframe.getContentPane().add(lblTitle);\n\t\t\n\t\tJLabel lblPath = new JLabel(\"Path:\");\n\t\tlblPath.setForeground(Color.WHITE);\n\t\tlblPath.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 14));\n\t\tlblPath.setBounds(85, 155, 33, 14);\n\t\tframe.getContentPane().add(lblPath);\n\t\t\n\t\ttitle = new JTextField();\n\t\ttitle.setBounds(128, 116, 197, 20);\n\t\tframe.getContentPane().add(title);\n\t\ttitle.setColumns(10);\n\t\t\n\t\tpath = new JTextField();\n\t\tpath.setBounds(128, 154, 197, 20);\n\t\tframe.getContentPane().add(path);\n\t\tpath.setColumns(10);\n\t\t\n\t\tbtnSubmit = new JButton(\"Submit\");\n\t\tbtnSubmit.setBackground(Color.BLACK);\n\t\tbtnSubmit.setForeground(Color.WHITE);\n\t\tbtnSubmit.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 14));\n\t\tbtnSubmit.setBounds(158, 210, 89, 23);\n\t\tframe.getContentPane().add(btnSubmit);\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n\t\tframe.setVisible(true);\n\t}", "public void init() {\r\n\t\t\r\n\t\tsetSize(WIDTH, HEIGHT);\r\n\t\tColor backgroundColor = new Color(60, 0, 60);\r\n\t\tsetBackground(backgroundColor);\r\n\t\tintro = new GImage(\"EvilMehranIntroGraphic.png\");\r\n\t\tintro.setLocation(0,0);\r\n\t\tadd(intro);\r\n\t\tplayMusic(new File(\"EvilMehransLairThemeMusic.wav\"));\r\n\t\tinitAnimationArray();\r\n\t\taddKeyListeners();\r\n\t\taddMouseListeners();\r\n\t\twaitForClick();\r\n\t\tbuildWorld();\r\n\t}", "private void initialize() {\n\t\tthis.setBounds(100, 100, 950, 740);\n\t\tthis.setLayout(null);\n\n\t\n\t}", "public FrameIntroGUI() {\n\t\ttry {\n\t\t\tjbInit();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tJLabel lblCoisa = new JLabel(\"Coisa\");\n\t\tlblCoisa.setBounds(10, 11, 46, 14);\n\t\tframe.getContentPane().add(lblCoisa);\n\t\t\n\t\ttextField = new JTextField();\n\t\ttextField.setBounds(39, 8, 86, 20);\n\t\tframe.getContentPane().add(textField);\n\t\ttextField.setColumns(10);\n\t}", "private void initialize() {\n\t\tthis.setExtendedState(Frame.MAXIMIZED_BOTH);\n\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tthis.setResizable(true);\n\t\tthis.screenDimensions = Toolkit.getDefaultToolkit().getScreenSize();\n\t\tthis.getContentPane().setLayout(new BorderLayout());\n\t\t// Initialize SubComponents and GUI Commands\n\t\tthis.initializeSplitPane();\n\t\tthis.initializeExplorer();\n\t\tthis.initializeConsole();\n\t\tthis.initializeMenuBar();\n\t\tthis.pack();\n\t\tthis.hydraExplorer.refreshExplorer();\n\t}" ]
[ "0.77689224", "0.7563363", "0.74401903", "0.7367074", "0.7364635", "0.735602", "0.7312278", "0.73067313", "0.72965485", "0.72960347", "0.72767437", "0.72702324", "0.7268066", "0.7268066", "0.7213252", "0.7179349", "0.7167731", "0.71392417", "0.71390206", "0.7125134", "0.71056336", "0.7098898", "0.7090837", "0.7080042", "0.70660937", "0.70616704", "0.7060148", "0.7057521", "0.7049849", "0.7041699", "0.69938177", "0.6976438", "0.6970237", "0.6954226", "0.6936128", "0.69279087", "0.69273293", "0.69229984", "0.692056", "0.69185024", "0.69125146", "0.69091016", "0.69091016", "0.69091016", "0.69091016", "0.69091016", "0.69091016", "0.69091016", "0.69091016", "0.69091016", "0.69091016", "0.69091016", "0.69091016", "0.6900125", "0.6889054", "0.68847406", "0.6870888", "0.6869549", "0.68665034", "0.6865098", "0.6861564", "0.6857707", "0.68540686", "0.68524164", "0.68138856", "0.6811983", "0.6807585", "0.6797143", "0.6790382", "0.6778759", "0.6762788", "0.6745444", "0.67295516", "0.6715479", "0.67103535", "0.6703755", "0.66966504", "0.6691236", "0.66911477", "0.6687926", "0.6669808", "0.6658789", "0.66468906", "0.6640404", "0.66386443", "0.66370463", "0.6636052", "0.6634309", "0.6625131", "0.662326", "0.6609507", "0.6606183", "0.65991277", "0.6598085", "0.65891504", "0.6585913", "0.6584402", "0.65739477", "0.6572622", "0.6568476", "0.65580744" ]
0.0
-1
A PerceptronClassifier uses the perceptron learning rule (AIMA Eq. 18.7): w_i \leftarrow w_i+\alpha(yh_w(x)) \times x_i
public void update(double[] x, double y, double alpha) { // This must be implemented by you double h = threshold(VectorOps.dot(this.weights, x)); for (int i=0; i<this.weights.length; i++) { this.weights[i] += alpha * (y - h) * x[i]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void trainPerceptrons(){\n double activationValues[] = new double[4];\n for(Image image:asciiReader.getTrainingImages()){\n for (int j = 0 ; j < activationValues.length; j++){\n activationValues[j] = activationFunction\n .apply(sumWeights(j,image));\n }\n adjustWeights(activationValues,image);\n }\n }", "private void trainPerceptron() {\n\t\t// Creates a log of that contains the percentage each epoch got correct\n\t\tint numWrong = images.size();\n\t\tint numReps = 0;\n\n\t\t// Repeat the training process TIMES_TO_REPEAT number of times or until\n\t\t// there are none wrong\n\t\tfor (int repetition = 0; repetition < TIMES_TO_REPEAT && numWrong != 0; repetition++) {\n\t\t\tint numCorrect = 0;\n\n\t\t\t// Iterate through each image in the set of image\n\t\t\tfor (PerceptronImage image : images) {\n\t\t\t\tdouble netInput = 0;\n\n\t\t\t\t// Work out the net input by evaluating each feature on the\n\t\t\t\t// image\n\t\t\t\tfor (Feature feature : features) {\n\t\t\t\t\tnetInput += feature.evaluate(image) * feature.getWeight();\n\t\t\t\t}\n\n\t\t\t\t// If the image is evaluated to be an X\n\t\t\t\tif (netInput <= 0) {\n\t\t\t\t\t// If it actually is an X then record it\n\t\t\t\t\tif (image.isX()) {\n\t\t\t\t\t\tnumCorrect++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If it is not then re-weight features\n\t\t\t\t\t\tfor (Feature feature : features) {\n\t\t\t\t\t\t\tdouble newWeight = feature.getWeight()\n\t\t\t\t\t\t\t\t\t+ feature.evaluate(image) * learningRate;\n\t\t\t\t\t\t\tfeature.setWeight(newWeight);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// If the image is evaluated to be not an X\n\t\t\t\t\t// If it actually not an X then record it\n\t\t\t\t\tif (!image.isX()) {\n\t\t\t\t\t\tnumCorrect++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If it is not then re-weight features\n\t\t\t\t\t\tfor (Feature feature : features) {\n\t\t\t\t\t\t\tdouble newWeight = feature.getWeight()\n\t\t\t\t\t\t\t\t\t- feature.evaluate(image) * learningRate;\n\t\t\t\t\t\t\tfeature.setWeight(newWeight);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Update the number of images wrong for this epoch\n\t\t\tnumWrong = images.size() - numCorrect;\n\n\t\t\t// Modify the learning rate\n\t\t\tif (learningRate > LEARNING_RATE_MINIMUM) {\n\t\t\t\tlearningRate *= LEARNING_RATE_MODIFIER;\n\t\t\t}\n\n\t\t\tnumReps++;\n\t\t}\n\n\t\ttry {\n\t\t\tPrintWriter writer = new PrintWriter(\"output.txt\");\n\t\t\t\n\t\t\t// Print out the number of repetitions if the perceptron converged,\n\t\t\t// otherwise print out the number of images that are still classified\n\t\t\t// incorrectly\n\t\t\tif (numWrong == 0) {\n\t\t\t\twriter.println(\"Perceptron converged\");\n\t\t\t\twriter.println(\"Number of repetitions: \" + numReps);\n\t\t\t\tSystem.out.println(\"Perceptron converged\");\n\t\t\t\tSystem.out.println(\"Number of repetitions: \" + numReps);\n\t\t\t} else {\n\t\t\t\twriter.println(\"Perceptron did not converge\");\n\t\t\t\twriter.println(\"Number of images still incorrect: \" + numWrong);\n\t\t\t\tSystem.out.println(\"Perceptron did not converge\");\n\t\t\t\tSystem.out.println(\"Number of images still incorrect: \" + numWrong);\n\t\t\t}\n\n\t\t\twriter.println(\"\\nEnding learning Rate: \" + learningRate + \"\\n\");\n\t\t\tSystem.out.println(\"\\nEnding learning Rate: \" + learningRate + \"\\n\");\n\t\t\t\n\t\t\tfor (Feature feature : features){\n\t\t\t\tSystem.out.println(feature.toString());\n\t\t\t\twriter.println(feature.toString());\n\t\t\t}\n\t\t\twriter.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static Double[] learnSimplePerceptron(Data data1[],int index,double LearningRate,Double w[],HashMap<Integer, Integer> words)\r\n \t{\r\n \t\t\r\n \t\tData data[] = Arrays.copyOf(data1,index);\r\n \t\t\r\n \t\t//shuffle the data..\r\n \t \tArrayList<Data> arrayList = new ArrayList<Data>(Arrays.asList(Arrays.copyOf(data,index))); \r\n \t\tCollections.shuffle(arrayList,new Random(10));\r\n \t\tdata = arrayList.toArray(new Data[arrayList.size()]);\r\n \t\tfor(int i=0;i<index;i++)\r\n \t\t{\r\n \t\t\tdouble trueLabel;\r\n \t\t\tdouble predictedLabel;\r\n \t\t\tdouble dotProduct_wT_x = 0.0f;\r\n \t\t\tHashMap<Integer, Double> x = new HashMap<Integer, Double>();\r\n \t\t \r\n \t\t\ttrueLabel = data[i].getY();\r\n \t\t\tx= data[i].getX();\r\n \t\t\t \r\n \t\t\t\r\n \t\t \r\n \t\t\t//wT*x (contains bias)\r\n \t\t\tfor (Map.Entry<Integer, Double> entry : x.entrySet()) {\r\n \t\t\t\tdotProduct_wT_x = dotProduct_wT_x + w[entry.getKey()] * entry.getValue();\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t//predict the label\r\n \t\t\tif(dotProduct_wT_x < 0)\r\n \t\t\t\tpredictedLabel = -1;\r\n \t\t\telse\t\r\n \t\t\t\tpredictedLabel = +1;\r\n \t\t\t\r\n \t\t\t//check if prediction is correct, if not update the weight vector and bias.\r\n \t\t\tif(predictedLabel != trueLabel)\r\n \t\t//\tif(dotProduct_wT_x<0)\r\n \t\t\t{\r\n \t\t\t\t//update bias\r\n \t\t\t\tw[0]=w[0]+trueLabel*LearningRate;\r\n \t\t\t\t\r\n \t\t\t\t\r\n \t\t\t\t//update all other weights only if those words are worthy tracking\r\n \t\t\t\r\n \t\t\t\tfor(int j=1;j<w.length;j++)\r\n \t\t\t\t{\r\n \t\t\t\t\t// if(x.containsKey(j))\r\n \t\t\t\t if(x.containsKey(j))\r\n \t\t\t \t//\t if(words.containsKey(j)) //give more weightage to words that matter\r\n \t\t \t\t\t \tw[j]=w[j]+LearningRate*trueLabel*x.get(j);\r\n\r\n \t\t\t\t//\telse\r\n \t\t\t//\t\t\tw[j]=(double)0;\r\n \t\t\t\t \r\n \t\t\t\r\n \t\t\t\t \r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t \r\n \t\t}\r\n \t\treturn w;\r\n \t}", "public static Double[] learnSimplePerceptronWords(Data data1[],int index,double LearningRate,Double w[],HashMap<Integer, Integer> words)\r\n \t{\r\n \t\t\r\n \t\tData data[] = Arrays.copyOf(data1,index);\r\n \t\t\r\n \t\t//shuffle the data..\r\n \t \tArrayList<Data> arrayList = new ArrayList<Data>(Arrays.asList(Arrays.copyOf(data,index))); \r\n \t\tCollections.shuffle(arrayList,new Random(10));\r\n \t\tdata = arrayList.toArray(new Data[arrayList.size()]);\r\n \t\tfor(int i=0;i<index;i++)\r\n \t\t{\r\n \t\t\tdouble trueLabel;\r\n \t\t\tdouble predictedLabel;\r\n \t\t\tdouble dotProduct_wT_x = 0.0f;\r\n \t\t\tHashMap<Integer, Double> x = new HashMap<Integer, Double>();\r\n \t\t \r\n \t\t\ttrueLabel = data[i].getY();\r\n \t\t\tx= data[i].getX();\r\n \t\t\t \r\n \t\t\t\r\n \t\t \r\n \t\t\t//wT*x (contains bias)\r\n \t\t\tfor (Map.Entry<Integer, Double> entry : x.entrySet()) {\r\n \t\t\t\tdotProduct_wT_x = dotProduct_wT_x + w[entry.getKey()] * entry.getValue();\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t//predict the label\r\n \t\t\tif(dotProduct_wT_x < 0)\r\n \t\t\t\tpredictedLabel = -1;\r\n \t\t\telse\t\r\n \t\t\t\tpredictedLabel = +1;\r\n \t\t\t\r\n \t\t\t//check if prediction is correct, if not update the weight vector and bias.\r\n \t\t\tif(predictedLabel != trueLabel)\r\n \t\t//\tif(dotProduct_wT_x<0)\r\n \t\t\t{\r\n \t\t\t\t//update bias\r\n \t\t\t\tw[0]=w[0]+trueLabel*LearningRate;\r\n\r\n \t\t\t\t\r\n \t\t\t\t//update all other weights only if those words are worthy tracking\r\n \t\t\t\r\n \t\t\t\tfor(int j=1;j<w.length;j++)\r\n \t\t\t\t{\r\n \t\t\t\t\t// if(x.containsKey(j))\r\n \t\t\t\t if(x.containsKey(j))\r\n \t\t\t \t if(words.containsKey(j)) //give more weightage to words that matter updates only when keyword found\r\n \t\t \t\t\t \tw[j]=w[j]+LearningRate*trueLabel*x.get(j);\r\n\r\n \t\t\t\t//\telse\r\n \t\t\t//\t\t\tw[j]=(double)0;\r\n \t\t\t\t \r\n \t\t\t\t\r\n \t\t\t\t \r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t \r\n \t\t}\r\n \t\treturn w;\r\n \t}", "public static Double[] learnSimplePerceptronRound2(Data data1[],int index,double LearningRate,Double w[],HashMap<Integer, Integer> words)\r\n \t{\r\n \t\t//Double w[] = new Double[20]; \r\n \t/*\tDouble min =-0.01; // Set To Your Desired Min Value\r\n\t Double max = 0.01;\r\n \t\tdouble smallRandNumber = min + new Random().nextDouble() * (max - min); \r\n \t\tArrays.fill(w, smallRandNumber);*/\r\n \t\t\r\n \t\tData data[] = Arrays.copyOf(data1,index);\r\n \t\t\r\n \t\t//shuffle the data..\r\n \t \tArrayList<Data> arrayList = new ArrayList<Data>(Arrays.asList(Arrays.copyOf(data,index))); \r\n \t\tCollections.shuffle(arrayList,new Random(10));\r\n \t\tdata = arrayList.toArray(new Data[arrayList.size()]);\r\n \t\tfor(int i=0;i<index;i++)\r\n \t\t{\r\n \t\t\tdouble trueLabel;\r\n \t\t\tdouble predictedLabel;\r\n \t\t\tdouble dotProduct_wT_x = 0.0f;\r\n \t\t\tHashMap<Integer, Double> x = new HashMap<Integer, Double>();\r\n \t\t \r\n \t\t\ttrueLabel = data[i].getY();\r\n \t\t\tx= data[i].getX();\r\n \t\t\tboolean correct=false;\r\n \t\t\t// loop till its corrects..\r\n \t\t\t\r\n \t\t\twhile(correct==false)\r\n \t\t\t{\r\n \t\t\t//wT*x (contains bias)\r\n \t\t\tfor (Map.Entry<Integer, Double> entry : x.entrySet()) {\r\n \t\t\t\tdotProduct_wT_x = dotProduct_wT_x + w[entry.getKey()] * entry.getValue();\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t//predict the label\r\n \t\t\tif(dotProduct_wT_x < 0)\r\n \t\t\t\tpredictedLabel = -1;\r\n \t\t\telse\t\r\n \t\t\t\tpredictedLabel = +1;\r\n \t\t\t\r\n \t\t\t//check if prediction is correct, if not update the weight vector and bias.\r\n \t\t\tif(predictedLabel != trueLabel)\r\n \t\t//\tif(dotProduct_wT_x<0)\r\n \t\t\t{\r\n \t\t\t\t//update bias\r\n \t\t\t\tw[0]=w[0]+trueLabel*LearningRate;\r\n \t\t\t\t\r\n \t\t\t\t//update all other weights only if those words are worthy tracking\r\n \t\t\t\r\n \t\t\t\tfor(int j=1;j<w.length;j++)\r\n \t\t\t\t{\r\n \t\t\t\t\t// if(x.containsKey(j))\r\n \t\t\t\t if(x.containsKey(j))\r\n \t\t\t\t//\t if(words.containsKey(j)) //give more weightage to words that matter\r\n \t\t\t//\t\t\t\tw[j]=w[j]+LearningRate*trueLabel*(x.get(j));\r\n \t\t\t\t//\t else\r\n\t\t\t\t\t\t\tw[j]=w[j]+LearningRate*trueLabel*x.get(j);\r\n\r\n \t\t\t\t//\telse\r\n \t\t\t//\t\t\tw[j]=(double)0;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\telse\r\n \t\t\t\tcorrect=true;\r\n \t\t }\r\n \t\t}\r\n \t\treturn w;\r\n \t}", "public Perceptron(String filename) {\n\t\twidth = DEFAULT_WIDTH;\n\t\theight = DEFAULT_HEIGHT;\n\t\tlearningRate = INITIAL_LEARNING_RATE;\n\t\tFile file = new File(filename);\n\t\tloadImages(file);\n\t\tcreateFeatures();\n\t\ttrainPerceptron();\n\t}", "public static void perceptronB(List<double[]> wektoryTrenujace,\n double[] w, double[] d, double c){\n\n double[] result = new double[4];\n double[] sumOfWec = new double[4];\n boolean repeat;\n\n //y1\n int iteracje = 0;\n do {\n Arrays.fill(sumOfWec, 0.0);\n repeat = false;\n iteracje++;\n System.out.println(\"Iteracja: \" + iteracje);\n for (int i=0; i< wektoryTrenujace.size();i++){\n result[i] = vectorSign(sigmFunc(matrixMult(wektoryTrenujace.get(i),w)),d[i]);\n sumOfWec = matrixAdd(sumOfWec, matrixMult(result[i],wektoryTrenujace.get(i)));\n if (result[i] != 0){\n System.out.println(\"Wektor trenujacy x\" + (i+1) + \" zostal zle rozpoznany przez wage \" + Print(w));\n repeat = true;\n }\n\n }\n w = matrixAdd(w,matrixMult(c,sumOfWec));\n System.out.println(\"Nowa waga: \" + Print(w) + \"\\n\");\n if (iteracje> 40)\n {\n System.out.println(\"Wagi nie stabilizują się po 40 iteracjach.\");\n return;\n }\n } while (repeat);\n\n System.out.println(\"Wagi ustabilizowaly sie po \" + iteracje + \" iteracji/ach.\\nWaga wynosi \" + Print(w));\n\n\n\n }", "public static void test(ArrayList<Image> img){\n\t\t\n\t\tdouble avCutoff = 0;\n\t\tdouble avAcc = 0 ;\n\t\tdouble adjCut = 0;\n\t\tint n = 100;\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tPerceptron p = new Perceptron(img);\n\t\t\tp.start();\n\t\t\tavCutoff = avCutoff + p.cuttoff;\n\t\t\tavAcc = avAcc + p.Acc;\n\t\t\tif(p.cuttoff < 1000){adjCut = adjCut + p.cuttoff;}\n\t\t}\n\t\tSystem.out.println(\"Average cut-off of all runs: \" + (avCutoff/n));\n\t\tSystem.out.println(\"Average accuracy: \" + (avAcc/n));\n\t\tSystem.out.println(\"Average accuracy of successful runs: \" + (adjCut/n));\n\t}", "public List<Double> trainPerceptronClassifier(int noOfIterations, double eenta, List<Double> tempWeights) throws FileNotFoundException {\n populateVocabularyList();\n System.out.println(\"The size of vocabulary is: \" + vocabularyList.size());\n //Populate the wordCount for Spam and Ham files\n populateWordCount();\n\n if(tempWeights == null)\n {\n tempWeights = new ArrayList<>();\n for(int i=0; i<weights.size(); i++)\n {\n tempWeights.add(weights.get(i)); \n }\n }\n else\n {\n weights = new ArrayList<>(tempWeights);\n }\n\n int iterationsSoFar;\n for(double ecount = 0.3 ; ecount < eenta; ecount = ecount+0.03)\n {\n iterationsSoFar = 5;\n trainFromExamples(iterationsSoFar, ecount);\n for(int count = 1; iterationsSoFar <= noOfIterations; count=count+1)\n {\n iterationsSoFar = iterationsSoFar + 1;\n //Train the weights on the ham record\n trainFromExamples(1, ecount);\n double[] value = returnAccuracy();\n System.out.println(\"Iterations:\"+ iterationsSoFar +\" Eenta:\" + ecount + \" Stop Words removed:\" + stopListEnable);\n System.out.println(\"SPAM ACCURACY:\" + value[0]);\n System.out.println(\"HAM ACCURACY:\" + value[1]);\n }\n weights = new ArrayList<>(tempWeights);\n }\n return tempWeights;\n }", "public static void runDecayingRatePerceptron(Data[] data, int index,String testFileName,HashMap<Integer,Integer> words)\r\n{\r\nint t=0;\r\ndouble LearningRates[] = {1, 0.1, 0.01};\r\n\tint minInt =0; // Set To Your Desired Min Value\r\n int maxInt =2;\r\n\tRandom rand = new Random();\r\n\t\r\n\tint randomNum = rand.nextInt((maxInt - minInt) + 1) + minInt;\r\n\r\n\tdouble LearningRate = LearningRates[randomNum];\r\n\t\r\n\t\r\nfor(int i=0;i<LearningRates.length;i++)\r\n{\r\nLearningRate = LearningRates[i];\r\ndouble devAccuracyTotal = (double)0;\r\nint noOfEpochs= 20;\r\nint decreaseRate = 0;\r\n\r\n\tDouble w[] = new Double[74500];\r\n\tDouble min =-0.01; // Set To Your Desired Min Value\r\nDouble max = 0.01;\r\n\t\tdouble smallRandNumber = min + new Random().nextDouble() * (max - min); \r\n\t\tArrays.fill(w, smallRandNumber);\r\n\t\t\r\nfor(int epoch=0;epoch<noOfEpochs;epoch++)\r\n{\r\n\t \tw = learnDecayingPerceptron(data,index,LearningRate,decreaseRate,w);\r\n\t \tdecreaseRate = decreaseRate + index;\r\n\r\n}\r\n// \tfor(int i=0;i<w.length;i++)\r\n// \t\t\tSystem.out.println(w[i]);\r\n//print data \t\r\n// \tfor (Map.Entry<Integer, Double> entry : x.entrySet()) {\r\n// System.out.println(\"\"+entry.getKey() + \" \" + entry.getValue());\r\n//\t \t}\r\n \t \t\r\n\t//keep decreaseRate increasing across epochs, by increasing 1 for each example.\r\n\tdouble cvAccuracy = testTestFile(w,testFileName,words);\r\n\t\r\n//\tSystem.out.println(\"Epoch\" + epoch +\" Dev Accuracy for Decaying Learning Rate \" + LearningRate + \" is \" + cvAccuracy);\r\n\r\n\r\nSystem.out.println(\" ** Cv Accuracy for Decaying Learning Rate \" + LearningRate + \" is \" + cvAccuracy);\r\nSystem.out.println(\" \");\r\n}\r\n\r\n//double testAccuracy = testTestFile(w,testFileName);\r\n\t//System.out.println(\"test Accuracy\" + testAccuracy);\r\n}", "public static void runMarginPerceptron(Data[] data, int index,String testFileName,HashMap<Integer,Integer> words)\r\n{\r\n int t=0;\r\n double LearningRates[] = {1, 0.1, 0.01};\r\n double Margins[] = {1, 0.1, 0.01};\r\n\r\n\tint minInt =0; // Set To Your Desired Min Value\r\n int maxInt =2;\r\n\tRandom rand = new Random();\r\n\t\r\n \tint randomNum = rand.nextInt((maxInt - minInt) + 1) + minInt;\r\n\r\n \tdouble LearningRate = LearningRates[randomNum];\r\n \t\r\nfor(int m=0;m<LearningRates.length;m++)\r\n{\r\n for(int i=0;i<LearningRates.length;i++)\r\n {\r\n\t LearningRate = LearningRates[i];\r\n\t\t double devAccuracyTotal = (double)0;\r\n\t\t int noOfEpochs= 20;\r\n\t\t int decreaseRate = 0;\r\n\t\t \r\n \t\t Double w[] = new Double[74500];\r\n\t\t Double min =-0.01; // Set To Your Desired Min Value\r\n\t Double max = 0.01;\r\n\t \t\tdouble smallRandNumber = min + new Random().nextDouble() * (max - min); \r\n\t\t\tArrays.fill(w, smallRandNumber);\r\n\t\t\t\r\n\t\t for(int epoch=0;epoch<noOfEpochs;epoch++)\r\n\t\t {\r\n\t\t\t \tw = learnMarginPerceptron(data,index,LearningRate,decreaseRate,w,Margins[m]);\r\n\t\t\t \tdecreaseRate = decreaseRate + index;\r\n\t\t\r\n\t\t }\r\n\t\t//CVSplit test\r\n \tdouble cvAccuracy = testTestFile(w,testFileName,words);\r\n \t\r\n// \tSystem.out.println(\"Epoch\" + epoch +\" Dev Accuracy for Decaying Learning Rate \" + LearningRate + \" is \" + cvAccuracy);\r\n \r\n \r\n \tSystem.out.println(\" ** Cv Accuracy for Margin Rate\" + Margins[m] + \" Learning Rate \" + LearningRate + \" is \" + cvAccuracy);\r\n \tSystem.out.println(\" \");\r\n }\r\n}\r\n//double testAccuracy = testTestFile(w,testFileName);\r\n\t//System.out.println(\"test Accuracy\" + testAccuracy);\r\n}", "public static void train(MultiLayerPerceptron mlp, int epochs){\n for(int i = 0; i < epochs; i++){\n /**\n * Randomize the order of the samples.\n */\n trainingSet.shuffle();\n for(int j = 0; j < trainingSet.getTests().size(); j++){\n ArrayList<Float> actualOutput = mlp.calculateOutput(trainingSet.getInput(j));\n ArrayList<Float> expectedOutput = trainingSet.getOutput(j);\n\n mlp.modifyWeights(actualOutput,expectedOutput);\n }\n }\n }", "private void adjustWeights(double activationValues[],Image image){\n\n for(int i=0;i<perceptrons.size();i++){\n for(int j=0;j<4;j++) {\n if ((j + 1) == image.getEmotion()) {\n perceptrons.get(i).adjustWeight(j, learningValue\n , 1, activationValues[j]\n ,normalizeImageValue(image.getImage()[i]));\n } else {\n perceptrons.get(i).adjustWeight(j, learningValue\n , 0, activationValues[j]\n ,normalizeImageValue(image.getImage()[i]));\n }\n }\n }\n\n }", "public void train()\r\n\t{\r\n\t\tfor(int i=0; i < this.maxEpoch; i++)\r\n\t\t{\r\n\t\t\tfor(Instance temp_example: this.trainingSet)\r\n\t\t\t{\r\n\t\t\t\tdouble O = calculateOutputForInstance(temp_example);\r\n\t\t\t\tdouble T = temp_example.output;\r\n\t\t\t\tdouble err = T - O;\r\n\r\n\t\t\t\t//w_jk (hidden to output)\r\n\t\t\t\tdouble g_p_out = (outputNode.getSum() <= 0) ? 0 : 1;\r\n\t\t\t\tfor(NodeWeightPair hiddenNode: outputNode.parents)\r\n\t\t\t\t{\r\n\t\t\t\t\thiddenNode.set_deltaw_pq(this.learningRate*\r\n\t\t\t\t\t\t\thiddenNode.node.getOutput()*err*g_p_out);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//w_ij (input to hidden)\r\n\t\t\t\tint hid_count =0;\r\n\t\t\t\tfor(Node hiddenNode: hiddenNodes){\r\n\t\t\t\t\tdouble g_p_hid = (hiddenNode.getSum() <= 0) ? 0 : 1;\r\n\t\t\t\t\tif(hiddenNode.getType()==2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfor(NodeWeightPair inputNode: hiddenNode.parents){\r\n\t\t\t\t\t\t\tdouble a_i = inputNode.node.getOutput();\r\n\t\t\t\t\t\t\tinputNode.set_deltaw_pq\r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\tthis.learningRate*\r\n\t\t\t\t\t\t\t\t\ta_i*g_p_hid*(err*\r\n\t\t\t\t\t\t\t\t\toutputNode.parents.get(hid_count).weight*\r\n\t\t\t\t\t\t\t\t\tg_p_out)\r\n\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\thid_count++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// for all w_pq, update weights\r\n\t\t\t\tfor(Node hiddenNode: hiddenNodes){\r\n\t\t\t\t\tif(hiddenNode.getType()==2){\r\n\t\t\t\t\t\tfor(NodeWeightPair inputNode: hiddenNode.parents){\r\n\t\t\t\t\t\t\tinputNode.weight += inputNode.get_deltaw_pq();\r\n\t\t\t\t\t\t\tinputNode.set_deltaw_pq(new Double (0.00));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfor(NodeWeightPair hiddenNode: outputNode.parents)\r\n\t\t\t\t{\r\n\t\t\t\t\thiddenNode.weight += hiddenNode.get_deltaw_pq();\r\n\t\t\t\t\thiddenNode.set_deltaw_pq(new Double (0.00));\r\n\t\t\t\t}\r\n\r\n\t\t\t} // end of an instance \r\n\t\t} // end of an epoch\r\n\t}", "public double Predict(int i, int c)\n\t{\n\t\tdouble Y_hat_ic = biasW[c];\n\n\t\tfor(int k = 0; k < K; k++)\n\t\t\tY_hat_ic += M[i][k] * W[c][k];\n\t\t\n\t\treturn Y_hat_ic;\n\t}", "private double[][] forwardPropogate(double[][] inputs, double[][] weights) {\n\t\tdouble[][] resultLayer = m.dot(inputs, weights);\n\t\tsigmoid(resultLayer);\n\t\treturn resultLayer;\n\t}", "public double activation(double z);", "public void applyBackpropagation( float expectedOutput[] ) {\n\t\t// The code for updating weights goes here \n\t\t// NOTE: if using a single perceptron, this is not technically back-propagation, despite the function name \n }", "public PerceptronImage load(Scanner f) {\n\t\tboolean[][] newImage = null;\n\t\tboolean isX = false;\n\t\tjava.util.regex.Pattern bit = java.util.regex.Pattern.compile(\"[01]\");\n\t\tif (!f.next().equals(\"P1\"))\n\t\t\tSystem.out.println(\"Not a P1 PBM file\");\n\t\tString category = f.next().substring(1);\n\t\tif (!category.equals(\"other\"))\n\t\t\tisX = true;\n\t\tint rows = f.nextInt();\n\t\tint cols = f.nextInt();\n\n\t\tnewImage = new boolean[rows][cols];\n\t\tfor (int r = 0; r < rows; r++) {\n\t\t\tfor (int c = 0; c < cols; c++) {\n\t\t\t\tnewImage[r][c] = (f.findWithinHorizon(bit, 0).equals(\"1\"));\n\t\t\t}\n\t\t}\n\n\t\treturn new PerceptronImage(newImage, isX);\n\t}", "public static void main( String[] args) {\n\t\t// A NOTE ON INPUT OUTPUT PAIRS\n\t\t// This class template uses 4 different sample sets of inputs and outputs.\n\t\t// 2 of them are for use with the single Perceptron tutorial (1 with a single input and 1 with two inputs)\n\t\t// the other 2 are for use with the Multilayer Network tutorial (1 with a single input and 1 with two inputs)\n\t\t// Simply uncomment the data set you want to work with\n\t\t// CAUTION: using the data sets intended for Multilayer Networks with a single Perceptron will not converge!\n\n// **** DATA SET 1: For use with a single Perceptron (single input: height)\n\t\tfloat inputs[][] = { {170}, {190}, {165}, {180}, {210} };\n\t\tfloat expectedOutputs[][] = { {0}, {1}, {0}, {0}, {1} }; \n// **** DATA SET 2: For use with a single Perceptron (two inputs: height/weight)\n//\t\tfloat inputs[][] = { {170,60}, {190,70}, {175,105}, {180,90}, {210,100} };\n//\t\tfloat expectedOutputs[][] = { {1}, {1}, {0}, {0}, {1} }; \n// **** DATA SET 3: For use with a Multilayer network (single input: height)\n//\t\tfloat inputs[][] = { {170}, {190}, {165}, {180}, {210} };\n//\t\tfloat expectedOutputs[][] = { {1}, {0}, {1}, {0}, {1} }; \n// **** DATA SET 4: For use with a Multilayer network (two inputs: height/weight)\n//\t\tfloat inputs[][] = { {170,60}, {190,70}, {175,105}, {180,90}, {210,100} };\n//\t\tfloat expectedOutputs[][] = { {1}, {1}, {1}, {0}, {0} }; \n\t\t\n\t\t// the above input/output pairs are intended with the Petra matchmaking tutorials in-class\n\t\t// if you want to try something simpler, try the following data sets approximating boolean operators\n// **** AND gate: can be used with a single Perceptron\n//\t\tfloat inputs[][] = { { 1, 1}, {1,0}, {0,1}, {0,0} };\n//\t\tfloat expectedOutputs[][] = { {1}, {0}, {0}, {0} }; \n// **** XOR gate: must be used with a Multilayer Network\n//\t\tfloat inputs[][] = { { 1, 1}, {1,0}, {0,1}, {0,0} };\n//\t\tfloat expectedOutputs[][] = { {0}, {1}, {1}, {0} }; \n\t\t\n\t\t\n\t\tfloat output[];\n\t\t\n\t\t// Create neural network: CHANGE the network structure depending on the input/output and hidden layers\n\t\t// Don't forget that the first integer in the layers array designates the number of inputs, \n\t\t// while the second and following integers designate the number of neurons in that layer (hidden or output layers).\n\t\tint layers[]={1,1};\n\t\tNeuralNetwork neuralNet = new NeuralNetwork(layers);\n\t\t\n\t\t//Train neural network and print out to screen as we go along\n\t\tfor(int i=0; i<1000; i++ ) {\n\t\t System.out.println(\"##### EPOCH \" + Integer.toString( i ) );\n\t\t for(int p=0; p<4; p++ ) {\n\t\t\t\tSystem.out.print(\"INPUTS: \" );\n\t\t\t\tfor( int x=0; x< layers[0]; x++ ) { System.out.print( Float.toString( inputs[p][x] ) + \" \" ); }\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t\tneuralNet.setInput( inputs[p] );\n\t\t\t\t\n\t\t\t\tneuralNet.activate();\n\t\t\t\t\n\t\t\t\toutput = neuralNet.getOutput();\n\t\t\t\tSystem.out.print(\"OUTPUTS: \" );\n\t\t\t\tfor( int x=0; x< layers[1]; x++ ) { System.out.print( Float.toString( output[x] ) + \" \" ); }\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t\n\t\t\t\tneuralNet.applyBackpropagation( expectedOutputs[p] );\n\t\t\t\tSystem.out.print(\"EXPECTED OUTPUTS: \" );\n\t\t\t\tfor( int x=0; x< layers[1]; x++ ) { System.out.print( Float.toString( expectedOutputs[p][x] ) + \" \" ); }\n\t\t\t\tSystem.out.println(\"\");\n\t\t }\n\t\t}\n }", "public static Map<String, Object> twoLayerModel(double[][] X, double[][] Y,\r\n\t\t\tint[] layerDimensions, double learningRate, int numOfIterations,\r\n\t\t\tboolean iprintCost) throws Exception {\r\n\t\tMap<String, Object> learnedParameters = null;\r\n\t\tX = MatrixUtil.T(X);\r\n\t\tY = MatrixUtil.T(Y);\r\n\t\tMatrixUtil.setSeed(IPredictionModelConstants.RANDOM_SEED_FOR_REPRODUCIBILITY);\r\n\t\tint m = X[0].length;\r\n\r\n\t\tint n_y = layerDimensions[2];\r\n\r\n\t\tdouble[][] W1 = MatrixUtil.random(layerDimensions[1], layerDimensions[0]);\r\n\t\tdouble[][] b1 = new double[layerDimensions[1]][m];\r\n\r\n\t\tdouble[][] W2 = MatrixUtil.random(n_y, layerDimensions[1]);\r\n\t\tdouble[][] b2 = new double[n_y][m];\r\n\r\n\t\tfor (int i = 0; i < numOfIterations; i++) {\r\n\t\t\t// Foward Prop\r\n\t\t\t// LAYER 1\r\n\t\t\tdouble[][] Z1 = MatrixUtil.add(MatrixUtil.dot(W1, X), b1);\r\n\t\t\tdouble[][] A1 = MatrixUtil.sigmoid(Z1);\r\n\t\t\t// double[][] A1 = Np.relu(Z1);\r\n\t\t\t// LAYER 2\r\n\t\t\tdouble[][] Z2 = MatrixUtil.add(MatrixUtil.dot(W2, A1), b2);\r\n\t\t\tdouble[][] A2 = MatrixUtil.sigmoid(Z2);\r\n\r\n\t\t\tdouble cost = DNNUtils.cross_entropy(m, Y, A2);\r\n\t\t\t// costs.getData().add(new XYChart.Data(i, cost));\r\n\t\t\t// Back Prop\r\n\t\t\t// LAYER 2\r\n\t\t\tdouble[][] dZ2 = MatrixUtil.subtract(A2, Y);\r\n\t\t\tdouble[][] dW2 = MatrixUtil.divide(MatrixUtil.dot(dZ2, MatrixUtil.T(A1)), m);\r\n\t\t\tdouble[][] db2 = MatrixUtil.divide(dZ2, m);\r\n\r\n\t\t\t// LAYER 1\r\n\t\t\tdouble[][] dZ1 = MatrixUtil.multiply(MatrixUtil.dot(MatrixUtil.T(W2), dZ2),\r\n\t\t\t\t\tMatrixUtil.subtract(1.0, MatrixUtil.power(A1, 2)));\r\n\t\t\tdouble[][] dW1 = MatrixUtil.divide(MatrixUtil.dot(dZ1, MatrixUtil.T(X)), m);\r\n\t\t\tdouble[][] db1 = MatrixUtil.divide(dZ1, m);\r\n\r\n\t\t\t// G.D\r\n\t\t\tW1 = MatrixUtil.subtract(W1, MatrixUtil.multiply(learningRate, dW1));\r\n\t\t\tb1 = MatrixUtil.subtract(b1, MatrixUtil.multiply(learningRate, db1));\r\n\r\n\t\t\tW2 = MatrixUtil.subtract(W2, MatrixUtil.multiply(learningRate, dW2));\r\n\t\t\tb2 = MatrixUtil.subtract(b2, MatrixUtil.multiply(learningRate, db2));\r\n\r\n\t\t\tif (i % 400 == 0 && iprintCost) {\r\n\t\t\t\tMatrixUtil.print(\"==============\");\r\n\t\t\t\tMatrixUtil.print(\"Cost = \" + cost);\r\n\t\t\t\tMatrixUtil.print(\"Predictions = \" + Arrays.deepToString(A2));\r\n\t\t\t\tMatrixUtil.print(\"Real = \" + Arrays.deepToString(Y));\r\n\t\t\t\tMatrixUtil.print(\"Predicted precision= \"\r\n\t\t\t\t\t\t+ DNNUtils.accuracyForClassification(A2, Y));\r\n\t\t\t}\r\n\t\t}\r\n\t\tlearnedParameters = new HashMap<>();\r\n\t\tlearnedParameters.put(String.valueOf(\"W_1\"), W1);\r\n\t\tlearnedParameters.put(String.valueOf(\"b_1\"), b1);\r\n\t\tlearnedParameters.put(String.valueOf(\"W_2\"), W2);\r\n\t\tlearnedParameters.put(String.valueOf(\"b_2\"), b2);\r\n\t\treturn learnedParameters;\r\n\t}", "@Override\r\n\tpublic int predict(double[] x, double[] posteriori) {\n\t\treturn 0;\r\n\t}", "@Override\n\tpublic void updateStatistics(Instance inst) {\n\t\t// Update the statistics for this node\n\t\t// number of instances passing through the node\n\t\tnodeStatistics.addToValue(0, 1);\n\t\t// sum of y values\n\t\tnodeStatistics.addToValue(1, inst.classValue());\n\t\t// sum of squared y values\n\t\tnodeStatistics.addToValue(2, inst.classValue()*inst.classValue());\n\t\t\t\t\n\t\tthis.perceptron.trainOnInstance(inst);\n\t\tif (this.predictionFunction != 1) { //Train target mean if prediction function is not Perceptron\n\t\t\tthis.targetMean.trainOnInstance(inst);\n\t\t}\n\t}", "private static void setPlane(){\n // your code goes there\n LinearRegression linG;\n linG = new LinearRegression(2,2000);\n\n for(double i = 0; i < 1000; i+=1)\n {\n double[] pt1, pt2;\n pt1 = new double[2];\n pt2 = new double[2];\n\n pt1[0] = i;\n pt2[0] = 2.0*i;\n\n pt1[1] = 2.0*i;\n pt2[1] = i;\n\n linG.addSample(pt1,5.0*i);\n linG.addSample(pt2,4.0*i);\n }\n \n\n System.out.println(\"Current hypothesis :\" + linG.currentHypothesis());\n System.out.println(\"Current cost :\" + linG.currentCost());\n\n for(int i = 1; i <= 10; i++)\n {\n linG.gradientDescent(0.000000003,1000);\n\n System.out.println(\"Current hypothesis :\" + linG.currentHypothesis());\n System.out.println(\"Current cost :\" + linG.currentCost());\n }\n\t}", "public void Prediction() {\n System.out.println(\"\\nInput an x value: \");\n double x = inputs.nextDouble();\n double y = this.B0 + (this.B1 * x);\n System.out.println(\"The prediction made with \" + x + \" as the x value is: \" + y);\n System.out.println(\"\\nWhere y = B0 + (B1*xi) is substituted by:\\n y = \" + B0 + \" + (\" + B1 + \" * \" + x + \" )\\n\");\n }", "private void gradientDecent(double[][] X, double[] y){\n double[] h = matrix.sigmoid(matrix.multiply(X,Theta));\n double[] cp = costPrime(X,h,y);\n\n double scp = 0;\n for(double i: cp){\n scp = scp + i;\n }\n System.out.println(+ cost(h,y));\n // Average Cost\n scp = round(scp/h.length,5);\n System.out.println(scp);\n int j = 0;\n\n // while Average Cost is not 0\n while(scp > 0.00001){\n Theta = matrix.subtract(Theta,matrix.multiply(alpha,cp));\n h = matrix.sigmoid(matrix.multiply(X,Theta));\n cp = costPrime(X,h,y);\n double sum = 0;\n for(double i: cp){\n sum = sum + i;\n }\n scp = round(sum/h.length,5);\n System.out.println(scp);\n }\n }", "public void trainWeights(int numEpochs, int player, int winner) {\n // Will be using the boardStates member which has already encoded the\n // boards on the path to the endgame.\n // The board states must now be fit to a reinforcement learning curve.\n double[][] trainingOutput = new double[stateCount][1]; // this is the total output (useful if using an ANN).\n double nn_i_succ = 0.0;\n double nn_i = 0.0;\n\n //REALLY IMPORTANT: Training is from the perspective of the black player, so if black lost, training will\n //use negative values. If black won, it will be trained with positive values. This must be kept in mind\n //when querying the features for values!\n\n //every other value depends on this one.\n for (int i=stateCount-1; i>=0; i--) {\n //for convenience get the value of the nn at boardStates[i] and boardStates[i+1]\n if (i == stateCount-1) {\n if (winner == LOABoard.PLAYER_BLACK)\n nn_i_succ = 1;\n else if (winner == LOABoard.PLAYER_WHITE)\n nn_i_succ = -1;\n else // Draw\n nn_i_succ = 0;\n } else {\n nn_i_succ = DISCOUNT_FACTOR * nn_i;\n }\n\n nn_i = 0;\n for ( int j = 0; j < numberOfWeights; j++ )\n nn_i += boardStates[i][j] * weights[j];\n\n trainingOutput[i][0] = nn_i + LEARNING_RATE*(nn_i_succ-nn_i);\n\n for (int j=0; j< numberOfWeights; j++) {//each epoch involves training on every board state in the game\n weights[j] = weights[j] + LEARNING_RATE*(nn_i_succ-nn_i)*boardStates[i][j];\n }//for j\n }//for i\n\n ////begin debug\n//\t System.out.println(\"Debug Message: Displaying array trainingOutput (after fit to TD learning curve) \" + stateCount);\n//\t for (int debug =0; debug < trainingOutput.length; debug++) {\n//\t\tSystem.out.println(trainingOutput[debug][0]);\n// }\n ////done debug\n\n System.out.println(\"Debug Message: Displaying weights array after update.\");\n for (int i = 0; i < numberOfWeights; i++) {\n System.out.println(weights[i]);\n }\n\n System.out.println(\"Info Message: Done training weights on results from game.\");\n }", "public static void main(String[] args) {\n\t\tPerceptron p = new Perceptron(new TaruTrainingWrapper(args[0],null));\n\t\t\n\t\t// Training data\n//\t\tString srcTrainFile = \"train.src\"; // contains parses\n//\t\tString refTrainFile = \"train.ref\"; // contains plain text\n\t\tString srcTrainFile = \"test.src\"; // contains parses\n\t\tString refTrainFile = \"test.ref\"; // contains plain text\n\t\t\n\t\t// Read in the training data\n\t\tArrayList<String> srcData = new ArrayList<String>(5000);\n\t\tArrayList<String> refData = new ArrayList<String>(5000);\n\t\t\n\t\ttry{\n\t\t\tBufferedReader sbr = new BufferedReader(new FileReader(srcTrainFile));\n\t\t\tBufferedReader rbr = new BufferedReader(new FileReader(refTrainFile));\n\t\t\tString ref = \"\";\n\t\t\twhile((ref = rbr.readLine()) != null){\n\t\t\t\tString src = sbr.readLine();\n\t\t\t\tif(ref.split(\" +\").length < 31){\n\t\t\t\t\tsrcData.add(src);\n\t\t\t\t\trefData.add(ref.toLowerCase());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tsbr.close();\n\t\t\trbr.close();\n\t\t}catch(FileNotFoundException e){e.printStackTrace();} catch (IOException e) { e.printStackTrace();}\n\t\tSystem.out.println(\"Training on \" + srcData.size() + \" sentences.\");\n\t\t// run the training\n\t\tp.trainAverage(srcData, refData, 5);\n\t}", "public double regressionPrediction(Instance instance) {\n\n Instance[] instanceNeighbor;\n // Find the nearest neighbor\n if (!efficient)\n instanceNeighbor = findNearestNeighbors(instance);\n else\n instanceNeighbor = findEfficientNearestNeighbors(instance);\n\n if (!weighting) {\n return regressionPredictionNormal(instanceNeighbor);\n } else {\n return regressionPredictionWeighted(instance, instanceNeighbor);\n }\n }", "private double sumWeights(int index, Image image){\n double sum = 0;\n for(int i= 0; i<400 ; i++){\n sum+=perceptrons.get(i).getWeight(index)\n *normalizeImageValue(image.getImage()[i]);\n }\n return sum;\n }", "public void fit(double[][] data) {\n double n = data.length;\n\n double sum1 = 0;\n double sum2 = 0;\n\n // gradient descent\n for (int i = 0; i < epochs; i++) {\n\n for (double[] d : data) {\n double x = d[0];\n double y = d[1];\n double yPredicted = sigmoid((m * x) + b);\n\n sum1 += x * (y - yPredicted);\n sum2 += y - yPredicted;\n }\n\n // calculate the derivative\n double dm = (-2/n) * sum1;\n double db = (-2/n) * sum2;\n\n // update m and b\n m = m - (learningRate * dm);\n b = b - (learningRate * db);\n }\n\n }", "public void train(){\r\n\t\tdouble output = 0.0;\r\n\t\tList<Integer> teacher = null;\r\n\t\tdouble adjustedWeight = 0.0;\r\n\t\tdouble error = 0.0;\r\n\t\tdouble deltaK = 0.0;\r\n\r\n\t\tfor(int counter = 0; counter < maxEpoch; counter++){\r\n\t\t\tfor(Instance inst : trainingSet){\r\n\t\t\t\tcalculateOutputForInstance(inst);\r\n\t\t\t\tteacher = inst.classValues;\r\n\t\t\t\t//jk weight\r\n\t\t\t\tfor(int i = 0; i < outputNodes.size(); i++){\r\n\t\t\t\t\tNode kNode = outputNodes.get(i);\r\n\t\t\t\t\toutput = kNode.getOutput();\r\n\t\t\t\t\terror = teacher.get(i) - output;\r\n\t\t\t\t\tdeltaK = error*getReLU(kNode.getSum());\r\n\t\t\t\t\tfor(int j = 0; j < kNode.parents.size(); j++){\r\n\t\t\t\t\t\tNodeWeightPair jkWeight = kNode.parents.get(j);\r\n\t\t\t\t\t\tNode jNode = jkWeight.node;\r\n\t\t\t\t\t\tadjustedWeight = getJK(jNode, deltaK);\r\n\t\t\t\t\t\tjkWeight.weight += adjustedWeight;\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//ij weight\r\n\t\t\t\tfor(int i = 0; i < hiddenNodes.size(); i++){\r\n\t\t\t\t\tNode jNode = hiddenNodes.get(i);\r\n\t\t\t\t\tif(jNode.parents == null) continue;\r\n\t\t\t\t\tfor(int j = 0; j < jNode.parents.size(); j++){\r\n\t\t\t\t\t\tNodeWeightPair ijWeight = jNode.parents.get(j);\r\n\t\t\t\t\t\tNode iNode = ijWeight.node;\r\n\t\t\t\t\t\tadjustedWeight = getIJ(iNode, jNode, teacher, i);\r\n\t\t\t\t\t\tijWeight.weight += adjustedWeight;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void performTraining() {\n\tint counter = 0;\n\tint success = 0;\n\n\tdo {\n\t success = 0;\n\n\t for (int ii = 0; ii < pl.size(); ii++) {\n\t\tPattern pn = pl.get(ii);\n\t\tbp.runNetwork(pn);\n\t\tbp.trainNetwork(pn);\n\n\t\tdouble truth[] = pn.getOutput();\t\t\n\t\tdouble results[] = bp.getOutputPattern();\n\n\t\tboolean failed = false;\n\n// \t\tSystem.out.print(\"patt \" + ii + \" \");\n// \t\tdouble[] input = pn.getInput();\n// for (int jj = 0; jj < input.length; jj++) {\n// \t\t System.out.print(round2(input[jj]) + \" \");\n// \t\t}\n// \t\tSystem.out.print(\"// \");\n// for (int jj = 0; jj < truth.length; jj++) {\n// \t\t System.out.print(round2(truth[jj]) + \" \");\n// \t\t}\n// \t\tSystem.out.println();\n\n// for (int jj = 0; jj < results.length; jj++) {\n// \t\t System.out.print(results[jj] + \" \");\n// \t\t // System.out.print(round2(results[jj]) + \" \");\n// \t\t}\n// \t\tSystem.out.println();\n\t\t\n\t\tfor (int jj = 0; jj < results.length; jj++) {\n if (round1(results[jj]) != round2(truth[jj])) {\n failed = true;\n }\n\t\t}\n \n if (!failed) {\n ++success;\n } \n }\n\n\t if ((++counter % 100) == 0) {\n System.out.println(counter + \" success:\" + success + \" needed:\" + pl.size());\n }\n } while (success < pl.size());\n\t\n\tSystem.out.println(\"Training complete in \" + counter + \" cycles\");\n }", "public int computePredatorsPreyDistanceSum() {\r\n int sum=0;\r\n for(Predator p:predators){\r\n sum+=p.calculatePredatorPreyDistance(prey, false);\r\n sum+=p.calculatePredatorPreyDistance(prey, true);\r\n }\r\n return sum;\r\n }", "public void update(double[] x, double y, double alpha){ \n\t\tfor (int i = 0; i < x.length; i++) {\n\t\t\tdouble wi = weights[i]; \n\t\t\tdouble xi = x[i];\t\t\t\t\t\t\t// Follow the update rule\n\t\t\tweights[i] = wi + alpha*(y - eval(x)) * eval(x)*(1.0 - eval(x)) * xi;\t\n\t\t\t//System.out.printf(\"%.5f\\n\", weights[i]);\n\t\t\t\n\t\t}\n\t}", "public void trainNet() {\t\t\n\t\t// Synapses contain the weights for each layer, these are randomised to begin with\n\t\tsynapse0 = new double[X[0].length][hiddenNeurons];\n\t\tpopulateRandom(synapse0, minRandomWeight, maxRandomWeight);\n\t\t\n\t\tsynapse1 = new double[hiddenNeurons][y[0].length];\n\t\tpopulateRandom(synapse1, minRandomWeight, maxRandomWeight);\n\t\t\n\t\t// The layers are the output values of each layer.\n\t\t// They are initialised to nothing to begin with, created properly in the training loop\n\t\tlayer1 = new double[0][0];\n\t\tlayer2 = new double[0][0];\n\t\t\n\t\t// Printing the initial state of the system\n\t\tm.printMatrix(\"X:\", X);\n\t\tm.printMatrix(\"y:\", y);\n\t\t\n\t\t// The training loop\n\t\tfor (int i = 0; i < trainingCycles; i++) {\n\t\t\t// calculate the values of each layer given the inputs and the weights\n\t\t\tlayer1 = forwardPropogate(X, synapse0);\n\t\t\tlayer2 = forwardPropogate(layer1, synapse1);\n\t\t\t\n\t\t\t// Calculate the delta error for each output layer, starting\n\t\t\t// with the bottom working up.\n\t\t\t// This is the difference between the expected values and actual values\n\t\t\t// times the derivative (gradient) of the sigmoid activation function\n\t\t\t// The 1st error comes from y - output\n\t\t\tdouble[][] layer2Delta = m.subtract(y, layer2);\n\t\t\tlayer2Delta = delta(layer2Delta, layer2);\n\t\t\t// subsequent layers come from the delta of the lower layer divided by the weights\n\t\t\tdouble[][] layer1Delta = m.dot(layer2Delta, m.t(synapse1));\n\t\t\tlayer1Delta = delta(layer1Delta, layer1);\n\t\t\t\n\t\t\t// Apply the error gradients to each weight, this moves the value closer to the expected\n\t\t\t// or reduces the error\n\t\t\tsynapse1 = m.add(synapse1, m.scale(m.dot(m.t(layer1), layer2Delta), trainingRate));\n\t\t\tsynapse0 = m.add(synapse0, m.scale(m.dot(m.t(X), layer1Delta), trainingRate));\n\t\t}\n\t\t// Run the input matrix through the net to get outputs for each training value on layer 2\n\t\tdouble[][] testNet = runData(X);\n\t\t// Show the results\n\t\tm.printMatrix(\"Output for X after training:\", testNet);\n\t\tm.printMatrixInts(\"Output for X after training (out of 100:\", testNet);\n\t}", "public static double make_predictionFromViolaJonesAdaBoost(double [][] new_x) {\r\n\t\t\r\n\t\tif(classifierInfos == null) {\r\n\t\t\tSystem.out.println(\"AdaBoost not trained yet. Canīt make prediction from new input.\");\r\n\t\t}\r\n\t\t\r\n\t\tdouble prediction = 0.0;\r\n\t\tint nIterations = alphas.size();\r\n\t\t\r\n\t\tfor(int i=0; i<nIterations; i++) {\r\n\t\t\t\r\n\t\t\tString splitFeat = get_splittingFeature4Iteration(i);\r\n\t\t\tdouble threshold = get_threshold4Iteration(i);\r\n\t\t\tdouble polarity = get_polarity4Iteration(i);\r\n\t\t\tdouble p = 1.0;\r\n\r\n\t\t\tif(polarity != 0.0) {\r\n\t\t\t\tp = polarity;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tint idx = Utilities.get_idx(names_of_explaining_variables, splitFeat)[0];\r\n\t\t\tdouble inputValue4Feature = new_x[0][idx];\r\n\t\t\t\r\n\t\t\tinputValue4Feature *=p;\r\n\t\t\tthreshold *=p;\r\n\t\t\t\r\n\t\t\tif(inputValue4Feature <= threshold) {\r\n\t\t\t\tprediction += classes[0]*alphas.get(i);\r\n\t\t\t}else {\r\n\t\t\t\tprediction += classes[1]*alphas.get(i);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn prediction;\r\n\t\t\r\n\t}", "public NeuralNetworkForwardPropagation() {\n super(\"Neural-network forward-propagation\");\n }", "private double activationFunction(double input){\n double temp = 1 + Math.exp(-1 * input * this.sigmoidFactor);\n double result = (double)1/temp;\n return result;\n }", "public Polynomial(int n, double[] x, double[] y) {\n\t int np1 = n + 1;\n\t // double[] parameters = new double[np1];\n\t // setParameters(parameters);\n\t double X[][] = new double[x.length][np1];\n\t for (int i = 0; i < x.length; i++) {\n\t\tdouble xi = x[i];\n\t\tdouble prod = 1.0;\n\t\tfor (int j = 0; j < np1; j++) {\n\t\t X[i][j] = prod;\n\t\t prod *= xi;\n\t\t}\n\t }\n\t double[] tmp = new double[np1];\n\t double[][] H = new double[np1][np1];\n\t Adder.Kahan adder = new Adder.Kahan();\n\t Adder.Kahan.State state = adder.getState();\n\t for (int j = 0; j < np1; j++) {\n\t\tfor (int i = 0; i < x.length; i++) {\n\t\t tmp[j] += X[i][j]*y[i];\n\t\t}\n\t\tfor (int i = 0; i < np1; i++) {\n\t\t state.c = 0.0;\n\t\t state.total = 0.0;\n\t\t for (int k = 0; k < x.length; k++) {\n\t\t\tdouble yy = (X[k][i]*X[k][j]) - state.c;\n\t\t\tdouble t = state.total + yy;\n\t\t\tstate.c = (t - state.total) - yy;\n\t\t\tstate.total = t;\n\t\t }\n\t\t H[i][j] = state.total;\n\t\t}\n\t }\n\n\t /*\n\t TriangularDecomp decomp = new CholeskyDecomp(H, H);\n\t setDecomp(decomp);\n\t decomp.solve(parameters, tmp);\n\t */\n\t setDecomp(H);\n\t QRDecomp qr = new QRDecomp(X);\n\t setParameters(qr.solve(y));\n\t if (x.length == np1) {\n\t\tsetChiSquare(0.0);\n\t\tsetDegreesOfFreedom(0);\n\t\tsetReducedChiSquare(Double.POSITIVE_INFINITY);\n\t\tsetVariance(0.0);\n\t\t/*\n\t\tdouble[][] cv = getCovarianceArray();\n\t\tfor (int i = 0; i < np1; i++) {\n\t\t for (int j = 0; j < np1; j++) {\n\t\t\tcv[i][j] = 0.0;\n\t\t }\n\t\t}\n\t\t*/\n\t } else {\n\t\tdouble sumsq = LeastSquaresFit.sumOfSquares(this, x, y);\n\t\tdouble variance = sumsq / (x.length - np1);\n\t\t// Chi-square is sumsq divided by the variance because\n\t\t// the sigmas all have the same value, but that just\n\t\t// gives x.length - np1. This happens because we don't have\n\t\t// an independent estimate of the variance, so we are\n\t\t// implicitly assuming we have the right fit.\n\t\tsetChiSquare(x.length - np1);\n\t\tsetDegreesOfFreedom(x.length - np1);\n\t\t// reducedChiSquare = ChiSquare divided by the degrees \n\t\t// of freedom.\n\t\tsetReducedChiSquare(1.0);\n\t\t// the H matrix used sigma=1, so we should have divided it by\n\t\t// the variance, which we didn't know. The covariance is the\n\t\t// inverse of H, so we should multiply it by the variance to\n\t\t// get the right value.\n\t\tsetVariance(variance);\n\t\t/*\n\t\tdouble[][] cv = getCovarianceArray();\n\t\tfor (int i = 0; i < np1; i++) {\n\t\t for (int j = 0; j < np1; j++) {\n\t\t\tcv[i][j] *= variance;\n\t\t }\n\t\t}\n\t\t*/\n\t }\n\t}", "public void activate() {\n double dotProduct = 0;\n for (Synapse s : super.getSynapsesIn()) {\n dotProduct += s.getNeuronFrom().getOutput() * s.getWeight();\n }\n super.setOutput(sigmoidFunction(dotProduct));\n }", "public int getNumberOfPredictors()\n {\n return 1;\n }", "public void train(double[] inputs, double[] outputsTarget) {\n assert(outputsTarget.length == weights.get(weights.size() - 1).length);\n \n ArrayList<double[]> layersOutputs = new ArrayList<double[]>(); \n classify(inputs, layersOutputs);\n\n // Calculate sensitivities for the output nodes\n int outputNeuronCount = this.weights.get(this.weights.size() - 1).length;\n double[] nextLayerSensitivities = new double[outputNeuronCount];\n assert(layersOutputs.get(layersOutputs.size() - 1).length == outputNeuronCount);\n for (int i = 0; i < outputNeuronCount; i++) {\n nextLayerSensitivities[i] = calculateErrorPartialDerivitive(\n layersOutputs.get(layersOutputs.size() - 1)[i],\n outputsTarget[i]\n ) * calculateActivationDerivitive(layersOutputs.get(layersOutputs.size() - 1)[i]);\n assert(!Double.isNaN(nextLayerSensitivities[i]));\n }\n\n for (int weightsIndex = this.weights.size() - 1; weightsIndex >= 0; weightsIndex--) {\n int previousLayerNeuronCount = this.weights.get(weightsIndex)[0].length;\n int nextLayerNeuronCount = this.weights.get(weightsIndex).length;\n assert(nextLayerSensitivities.length == nextLayerNeuronCount);\n\n double[] previousLayerOutputs = layersOutputs.get(weightsIndex);\n double[] previousLayerSensitivities = new double[previousLayerNeuronCount];\n\n // Iterate over neurons in the previous layer\n for (int j = 0; j < previousLayerNeuronCount; j++) {\n\n // Calculate the sensitivity of this node\n double sensitivity = 0;\n for (int i = 0; i < nextLayerNeuronCount; i++) {\n sensitivity += nextLayerSensitivities[i] * this.weights.get(weightsIndex)[i][j];\n }\n sensitivity *= calculateActivationDerivitive(previousLayerOutputs[j]);\n assert(!Double.isNaN(sensitivity));\n previousLayerSensitivities[j] = sensitivity;\n\n for (int i = 0; i < nextLayerNeuronCount; i++) {\n double weightDelta = learningRate * nextLayerSensitivities[i] * calculateActivation(previousLayerOutputs[j]);\n this.weights.get(weightsIndex)[i][j] += weightDelta;\n assert(!Double.isNaN(this.weights.get(weightsIndex)[i][j]) && !Double.isInfinite(this.weights.get(weightsIndex)[i][j]));\n }\n }\n\n nextLayerSensitivities = previousLayerSensitivities;\n }\n }", "double predict(Vector w);", "@Override\n public void calculate(double[] x) {\n\n double prob = 0.0; // the log prob of the sequence given the model, which is the negation of value at this point\n Triple<double[][], double[][], double[][]> allParams = separateWeights(x);\n double[][] linearWeights = allParams.first();\n double[][] W = allParams.second(); // inputLayerWeights \n double[][] U = allParams.third(); // outputLayerWeights \n\n double[][] Y = null;\n if (flags.softmaxOutputLayer) {\n Y = new double[U.length][];\n for (int i = 0; i < U.length; i++) {\n Y[i] = ArrayMath.softmax(U[i]);\n }\n }\n\n double[][] What = emptyW();\n double[][] Uhat = emptyU();\n\n // the expectations over counts\n // first index is feature index, second index is of possible labeling\n double[][] E = empty2D();\n double[][] eW = emptyW();\n double[][] eU = emptyU();\n\n // iterate over all the documents\n for (int m = 0; m < data.length; m++) {\n int[][][] docData = data[m];\n int[] docLabels = labels[m];\n\n // make a clique tree for this document\n CRFCliqueTree cliqueTree = CRFCliqueTree.getCalibratedCliqueTree(docData, labelIndices, numClasses, classIndex,\n backgroundSymbol, new NonLinearCliquePotentialFunction(linearWeights, W, U, flags));\n\n // compute the log probability of the document given the model with the parameters x\n int[] given = new int[window - 1];\n Arrays.fill(given, classIndex.indexOf(backgroundSymbol));\n int[] windowLabels = new int[window];\n Arrays.fill(windowLabels, classIndex.indexOf(backgroundSymbol));\n\n if (docLabels.length>docData.length) { // only true for self-training\n // fill the given array with the extra docLabels\n System.arraycopy(docLabels, 0, given, 0, given.length);\n System.arraycopy(docLabels, 0, windowLabels, 0, windowLabels.length);\n // shift the docLabels array left\n int[] newDocLabels = new int[docData.length];\n System.arraycopy(docLabels, docLabels.length-newDocLabels.length, newDocLabels, 0, newDocLabels.length);\n docLabels = newDocLabels;\n }\n // iterate over the positions in this document\n for (int i = 0; i < docData.length; i++) {\n int label = docLabels[i];\n double p = cliqueTree.condLogProbGivenPrevious(i, label, given);\n if (VERBOSE) {\n System.err.println(\"P(\" + label + \"|\" + ArrayMath.toString(given) + \")=\" + p);\n }\n prob += p;\n System.arraycopy(given, 1, given, 0, given.length - 1);\n given[given.length - 1] = label;\n }\n\n // compute the expected counts for this document, which we will need to compute the derivative\n // iterate over the positions in this document\n for (int i = 0; i < docData.length; i++) {\n // for each possible clique at this position\n System.arraycopy(windowLabels, 1, windowLabels, 0, window - 1);\n windowLabels[window - 1] = docLabels[i];\n for (int j = 0; j < docData[i].length; j++) {\n Index<CRFLabel> labelIndex = labelIndices[j];\n // for each possible labeling for that clique\n int[] cliqueFeatures = docData[i][j];\n double[] As = null;\n double[] fDeriv = null;\n double[][] yTimesA = null;\n double[] sumOfYTimesA = null;\n\n if (j == 0) {\n As = NonLinearCliquePotentialFunction.hiddenLayerOutput(W, cliqueFeatures, flags);\n fDeriv = new double[inputLayerSize];\n double fD = 0;\n for (int q = 0; q < inputLayerSize; q++) {\n if (useSigmoid) {\n fD = As[q] * (1 - As[q]); \n } else {\n fD = 1 - As[q] * As[q]; \n }\n fDeriv[q] = fD;\n }\n\n // calculating yTimesA for softmax\n if (flags.softmaxOutputLayer) {\n double val = 0;\n\n yTimesA = new double[outputLayerSize][numHiddenUnits];\n for (int ii = 0; ii < outputLayerSize; ii++) {\n yTimesA[ii] = new double[numHiddenUnits];\n }\n sumOfYTimesA = new double[outputLayerSize];\n\n for (int k = 0; k < outputLayerSize; k++) {\n double[] Yk = null;\n if (flags.tieOutputLayer) {\n Yk = Y[0];\n } else {\n Yk = Y[k];\n }\n double sum = 0;\n for (int q = 0; q < inputLayerSize; q++) {\n if (q % outputLayerSize == k) {\n int hiddenUnitNo = q / outputLayerSize;\n val = As[q] * Yk[hiddenUnitNo];\n yTimesA[k][hiddenUnitNo] = val;\n sum += val;\n }\n }\n sumOfYTimesA[k] = sum;\n }\n }\n\n // calculating Uhat What\n int[] cliqueLabel = new int[j + 1];\n System.arraycopy(windowLabels, window - 1 - j, cliqueLabel, 0, j + 1);\n\n CRFLabel crfLabel = new CRFLabel(cliqueLabel);\n int givenLabelIndex = labelIndex.indexOf(crfLabel);\n double[] Uk = null;\n double[] UhatK = null;\n double[] Yk = null;\n double[] yTimesAK = null;\n double sumOfYTimesAK = 0;\n if (flags.tieOutputLayer) {\n Uk = U[0];\n UhatK = Uhat[0];\n if (flags.softmaxOutputLayer) {\n Yk = Y[0];\n }\n } else {\n Uk = U[givenLabelIndex];\n UhatK = Uhat[givenLabelIndex];\n if (flags.softmaxOutputLayer) {\n Yk = Y[givenLabelIndex];\n }\n }\n\n if (flags.softmaxOutputLayer) {\n yTimesAK = yTimesA[givenLabelIndex];\n sumOfYTimesAK = sumOfYTimesA[givenLabelIndex];\n }\n\n for (int k = 0; k < inputLayerSize; k++) {\n double deltaK = 1;\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (k % outputLayerSize == givenLabelIndex) {\n int hiddenUnitNo = k / outputLayerSize;\n if (flags.softmaxOutputLayer) {\n UhatK[hiddenUnitNo] += (yTimesAK[hiddenUnitNo] - Yk[hiddenUnitNo] * sumOfYTimesAK);\n deltaK *= Yk[hiddenUnitNo];\n } else {\n UhatK[hiddenUnitNo] += As[k];\n deltaK *= Uk[hiddenUnitNo];\n }\n }\n } else {\n UhatK[k] += As[k];\n if (useOutputLayer) {\n deltaK *= Uk[k];\n }\n }\n if (useHiddenLayer)\n deltaK *= fDeriv[k];\n if (useOutputLayer) {\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (k % outputLayerSize == givenLabelIndex) {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n } else {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n } else {\n if (k == givenLabelIndex) {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n }\n }\n }\n\n for (int k = 0; k < labelIndex.size(); k++) { // labelIndex.size() == numClasses\n int[] label = labelIndex.get(k).getLabel();\n double p = cliqueTree.prob(i, label); // probability of these labels occurring in this clique with these features\n if (j == 0) { // for node features\n double[] Uk = null;\n double[] eUK = null;\n double[] Yk = null;\n if (flags.tieOutputLayer) {\n Uk = U[0];\n eUK = eU[0];\n if (flags.softmaxOutputLayer) {\n Yk = Y[0];\n }\n } else {\n Uk = U[k];\n eUK = eU[k];\n if (flags.softmaxOutputLayer) {\n Yk = Y[k];\n }\n }\n if (useOutputLayer) {\n for (int q = 0; q < inputLayerSize; q++) {\n double deltaQ = 1;\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (q % outputLayerSize == k) {\n int hiddenUnitNo = q / outputLayerSize;\n if (flags.softmaxOutputLayer) {\n eUK[hiddenUnitNo] += (yTimesA[k][hiddenUnitNo] - Yk[hiddenUnitNo] * sumOfYTimesA[k]) * p;\n deltaQ = Yk[hiddenUnitNo];\n } else {\n eUK[hiddenUnitNo] += As[q] * p;\n deltaQ = Uk[hiddenUnitNo];\n }\n }\n } else {\n eUK[q] += As[q] * p;\n deltaQ = Uk[q];\n }\n if (useHiddenLayer)\n deltaQ *= fDeriv[q];\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (q % outputLayerSize == k) {\n double[] eWq = eW[q];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWq[cliqueFeatures[n]] += deltaQ * p;\n }\n }\n } else {\n double[] eWq = eW[q];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWq[cliqueFeatures[n]] += deltaQ * p;\n }\n }\n }\n } else {\n double deltaK = 1;\n if (useHiddenLayer)\n deltaK *= fDeriv[k];\n double[] eWK = eW[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWK[cliqueFeatures[n]] += deltaK * p;\n }\n }\n } else { // for edge features\n for (int n = 0; n < cliqueFeatures.length; n++) {\n E[cliqueFeatures[n]][k] += p;\n }\n }\n }\n }\n }\n }\n\n if (Double.isNaN(prob)) { // shouldn't be the case\n throw new RuntimeException(\"Got NaN for prob in CRFNonLinearLogConditionalObjectiveFunction.calculate()\");\n }\n\n value = -prob;\n if(VERBOSE){\n System.err.println(\"value is \" + value);\n }\n\n // compute the partial derivative for each feature by comparing expected counts to empirical counts\n int index = 0;\n for (int i = 0; i < E.length; i++) {\n int originalIndex = edgeFeatureIndicesMap.get(i);\n\n for (int j = 0; j < E[i].length; j++) {\n derivative[index++] = (E[i][j] - Ehat[i][j]);\n if (VERBOSE) {\n System.err.println(\"linearWeights deriv(\" + i + \",\" + j + \") = \" + E[i][j] + \" - \" + Ehat[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n if (index != edgeParamCount)\n throw new RuntimeException(\"after edge derivative, index(\"+index+\") != edgeParamCount(\"+edgeParamCount+\")\");\n\n for (int i = 0; i < eW.length; i++) {\n for (int j = 0; j < eW[i].length; j++) {\n derivative[index++] = (eW[i][j] - What[i][j]);\n if (VERBOSE) {\n System.err.println(\"inputLayerWeights deriv(\" + i + \",\" + j + \") = \" + eW[i][j] + \" - \" + What[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n\n\n if (index != beforeOutputWeights)\n throw new RuntimeException(\"after W derivative, index(\"+index+\") != beforeOutputWeights(\"+beforeOutputWeights+\")\");\n\n if (useOutputLayer) {\n for (int i = 0; i < eU.length; i++) {\n for (int j = 0; j < eU[i].length; j++) {\n derivative[index++] = (eU[i][j] - Uhat[i][j]);\n if (VERBOSE) {\n System.err.println(\"outputLayerWeights deriv(\" + i + \",\" + j + \") = \" + eU[i][j] + \" - \" + Uhat[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n }\n\n if (index != x.length)\n throw new RuntimeException(\"after W derivative, index(\"+index+\") != x.length(\"+x.length+\")\");\n\n int regSize = x.length;\n if (flags.skipOutputRegularization || flags.softmaxOutputLayer) {\n regSize = beforeOutputWeights;\n }\n\n // incorporate priors\n if (prior == QUADRATIC_PRIOR) {\n double sigmaSq = sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double k = 1.0;\n double w = x[i];\n value += k * w * w / 2.0 / sigmaSq;\n derivative[i] += k * w / sigmaSq;\n }\n } else if (prior == HUBER_PRIOR) {\n double sigmaSq = sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double w = x[i];\n double wabs = Math.abs(w);\n if (wabs < epsilon) {\n value += w * w / 2.0 / epsilon / sigmaSq;\n derivative[i] += w / epsilon / sigmaSq;\n } else {\n value += (wabs - epsilon / 2) / sigmaSq;\n derivative[i] += ((w < 0.0) ? -1.0 : 1.0) / sigmaSq;\n }\n }\n } else if (prior == QUARTIC_PRIOR) {\n double sigmaQu = sigma * sigma * sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double k = 1.0;\n double w = x[i];\n value += k * w * w * w * w / 2.0 / sigmaQu;\n derivative[i] += k * w / sigmaQu;\n }\n }\n }", "@Override\n public double predict(double[] explanatory) {\n if (explanatory == null || explanatory.length == 0) {\n throw new IllegalArgumentException(\"explanatory features must not be null or empty\");\n }\n return Activation.SIGMOID.apply(bias + Vector.dotProduct(explanatory, theta));\n }", "public void train(int iterations) {\n\t\tNeuron n = new NeuronSigmoid();\n\t\t\n\t\tfor (int i = 0; i < iterations; i++) {\n\t\t\tSystem.out.print(\"Epoch: \" +(i+1));\n\t\t\tdouble[][] localOutput = n.think(this.input,this.weights);\n\n\t\t\tdouble[][] error = Matrix2d.subtract(output, localOutput);\n\t\t\tSystem.out.print(\" Error: \"+calcOverallError(error));\n\t\t\tdouble[][] sigDeriv = Matrix2d.sigmoidDerivative(localOutput);\n\t\t\tdouble[][] prod = Matrix2d.multiply(error, sigDeriv);\n\t\t\tdouble[][] transInput = Matrix2d.transposeMatrix(input);\n\t\t\tdouble[][] adjustment = Matrix2d.dot(transInput, prod);\n\n\t\t\tweights = Matrix2d.add(adjustment, weights);\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}", "public WeightedInstances(Instances paraInstances) {\n\t\tsuper(paraInstances);\n\t\tsetClassIndex(numAttributes() - 1);\n\n\t\t// Initialize weights\n\t\tweights = new double[numInstances()];\n\t\tdouble tempAverage = 1.0 / numInstances();\n\t\tfor (int i = 0; i < weights.length; i++) {\n\t\t\tCommon.runSteps ++;\n\t\t\tweights[i] = tempAverage;\n\t\t} // Of for i\n\t\tSimpleTools.variableTrackingOutput(\"Instances weights are: \" + Arrays.toString(weights));\n\t}", "private void learnStep(){\n Connection[][][] temp = this.connections;\r\n for(int trialIndex = 0; trialIndex< inputList.length; trialIndex++) {\r\n for (int layerIndex = 0; layerIndex < connections.length; layerIndex++) {\r\n for (int startIndex = 0; startIndex < connections[layerIndex].length; startIndex++) {\r\n for (int endIndex = 0; endIndex < connections[layerIndex][startIndex].length; endIndex++) {\r\n double weightDerivative = 0.0;\r\n double biasDerivative = 0.0;\r\n weightDerivative += learningRate* derivativeWeight(layerIndex, startIndex, endIndex, trialIndex);\r\n biasDerivative += learningRate * derivativeBias(layerIndex, startIndex, endIndex, trialIndex);\r\n double currentWeight = temp[layerIndex][startIndex][endIndex].getWeight();\r\n double currentBias = temp[layerIndex][startIndex][endIndex].getBias();\r\n temp[layerIndex][startIndex][endIndex] = new Connection(currentWeight - weightDerivative, currentBias - biasDerivative);\r\n\r\n }\r\n }\r\n }\r\n this.run();\r\n }\r\n this.connections = temp;\r\n }", "public FFANNAdaptiveBackPropagationJSP()\n\t{\n\t\t//run(network, numberInputNeurons, numberHiddenNeurons, numberOutputNeurons, trainingSet);\n\t}", "public double getObjective() {\n return multiClassClassifierObj() + binaryObj();\n// +(1-temperature)*getEntropy();\n }", "public static Map<String, Object> l_LAYER_MODEL_MultiClassClassifications_SoftMax(\r\n\t\t\tdouble[][] X, double[][] Y, int[] layerDimenstions,\r\n\t\t\tdouble learningRate, int numOfIterations,\r\n\t\t\tDeepNNOptimizers optimizer, DeepNNRegularizor regulizer,\r\n\t\t\tdouble dropOutThreshold, boolean iprintCost) throws Exception {\r\n\r\n\t\tMatrixUtil.setSeed(IPredictionModelConstants.RANDOM_SEED_FOR_REPRODUCIBILITY);\r\n\r\n\t\t\r\n\t\tint m = X[0].length;\r\n\t\tMap<String, Object> parameters = null;\r\n\t\tMap<Enum<DeepNNKeysForMaps>, Object> AdamParameters = null;\r\n\t\tMap<String, Object> grads = null;\r\n\t\tMap<String, Object> actCaches = null;\r\n\t\tMap<String, Object> feedForwardResult = null;\r\n\t\tdouble[][] AL = null;\r\n\t\tMap<DeepNNKeysForMaps, Object> oneHotMatrixresult = null;\r\n\t\tdouble cost = 0.0, costDifference = 0.0, previousCost = Double.MIN_VALUE;\r\n\t\tdouble finalPrecision = 0.0, beta1 = 0.9, beta2 = 0.99, adamt = 2;\r\n\r\n\t\toneHotMatrixresult = MatrixUtil.createOneHotVectorMatrix(Y);\r\n\t\tdouble[][] Y_OneHot = (double[][]) oneHotMatrixresult\r\n\t\t\t\t.get(DeepNNKeysForMaps.KEY_FOR_ONE_HOT_MATRIX);\r\n\t\tMap<Double, double[]> labeltoOnhotVectorMap = (Map<Double, double[]>) oneHotMatrixresult\r\n\t\t\t\t.get(DeepNNKeysForMaps.KEY_FOR_LABEL_TO_ONE_HOT);\r\n\r\n\t\tX = MatrixUtil.T(X);\r\n\t\t// np.printshapes(X,Y_OneHot);\r\n\t\tY_OneHot = MatrixUtil.T(Y_OneHot);\r\n\t\tlayerDimenstions[layerDimenstions.length - 1] = labeltoOnhotVectorMap\r\n\t\t\t\t.size();\r\n\t\tparameters = DNNUtils.initializeParameterDeep(layerDimenstions, m,\r\n\t\t\t\tParameterInitializationType.BENGIO);\r\n\t\tint L = parameters.size() / 2;\r\n\r\n\t\tif (optimizer == DeepNNOptimizers.ADAM) {\r\n\t\t\tAdamParameters = DNNUtils.initializeAdamParameters(parameters);\r\n\t\t\tbeta1 = 0.9;\r\n\t\t\tbeta2 = 0.999;\r\n\t\t\tadamt = 2;\r\n\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; ((i < numOfIterations)); i++) {\r\n\r\n\t\t\tfeedForwardResult = DNNUtils\r\n\t\t\t\t\t.L_model_forward_multiClass_classification(X, parameters);\r\n\t\t\tactCaches = (Map<String, Object>) feedForwardResult.get(String\r\n\t\t\t\t\t.valueOf(\"actCache_\" + (L)));\r\n\t\t\tAL = (double[][]) actCaches.get(String.valueOf(\"A\"));\r\n\t\t\tcost = DNNUtils.sparse_categorial_crossentropy(m, Y_OneHot, AL);\r\n\t\t\tcostDifference = cost - previousCost;\r\n\t\t\tpreviousCost = cost;\r\n\t\t\t// cost = RnnUtils.cross_entropy(m, Y_OneHot, AL);\r\n\t\t\t//seriesData.add((i + 1), cost);\r\n\t\t\t//\r\n\t\t\tgrads = DNNUtils.L_model_backward_MultiClass_Classification(AL,\r\n\t\t\t\t\tY_OneHot, feedForwardResult); // here i\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// should\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// pass both\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// cashes;\r\n\t\t\tif (optimizer == DeepNNOptimizers.ADAM) {\r\n\t\t\t\tAdamParameters = DNNUtils.updateParametersWithAdams(parameters,\r\n\t\t\t\t\t\tgrads, AdamParameters, adamt, learningRate, beta1,\r\n\t\t\t\t\t\tbeta2, IPredictionModelConstants.EPSILON);\r\n\t\t\t\tparameters = (Map<String, Object>) AdamParameters\r\n\t\t\t\t\t\t.get(DeepNNKeysForMaps.KEY_FOR_NN_PARAMETERS);\r\n\t\t\t} else {\r\n\t\t\t\tparameters = DNNUtils.updateParametersWithGD(parameters, grads,\r\n\t\t\t\t\t\tlearningRate);\r\n\t\t\t}\r\n\r\n\t\t\tif (i % 400 == 0 && iprintCost) {\r\n\t\t\t\tlearningRate = learningRate / 2;\r\n\t\t\t\tMatrixUtil.print(\"==============\");\r\n\t\t\t\tMatrixUtil.print(\"Cost = \" + cost);\r\n\t\t\t\t\r\n\t\t\t\tfinalPrecision = DNNUtils.accuracyForMultiClassClassification(\r\n\t\t\t\t\t\tAL, Y_OneHot);\r\n\t\t\t\t// np.printshapes(AL, Y_OneHot);\r\n\t\t\t\tMatrixUtil.print(\"Predicted multiclass classification precision= \"\r\n\t\t\t\t\t\t+ finalPrecision);\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\tif (Math.abs(costDifference) < IPredictionModelConstants.EPSILON) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\r\n\t\treturn parameters;\r\n\t}", "double calculateSomaAndAxon(List<Double> weights, ActivationFunction activationFunction);", "protected void findWeights( double learning_rate, int iterations )\n\t{\n\t\tdouble sum, error, o, delta;\n\t\tint n = this.class_data.attribute_data.size();\n\t\tAttribute temp;\n\n\t\tfor ( int i = 0; i < iterations; i++ )\n\t\t{\n\t\t\tsum = 0;\n\t\t\tfor ( int j = 0; j < this.attribute_list.size(); j++ )\n\t\t\t{\n\t\t\t\ttemp = this.attribute_list.get( j );\n\t\t\t\tsum += temp.attribute_data.get( i % n ) * temp.getWeigth();\t\t//Sum of wi * xi\n\t\t\t}\n\n\t\t\to = getSigmoidValue( sum );\t\t\t\t\t\t\t\t\t\t//Get the value from sigmoid function\n\t\t\terror = this.class_data.attribute_data.get( i % n ) - o;\t\t//Find out the error\n\t\t\tdelta = learning_rate * error * o * (1.0 - o);\t\t\t\t\t//Delta w\n\n\t\t\tfor ( int j = 0; j < this.attribute_list.size(); j++ )\n\t\t\t\tthis.attribute_list.get( j ).incrementWeigth( delta, i % n );\t\t//Update weights\n\t\t}\n\t}", "double getLearningRate();", "private static void randomPlane(){\n\n\t\t// your code goes there\n LinearRegression linG;\n linG = new LinearRegression(2,5000);\n double la,lb,lc;\n la = generator.nextDouble();\n lb = generator.nextDouble();\n lc = generator.nextDouble();\n double a,b,c;\n a = (200.0*(la)) + -100.0;\n b = (200.0*(lb)) + -100.0;\n c = (200.0*(lc)) + -100.0;\n\n for (int i = 0; i < 5000; i++)\n {\n double lx,ly,lnoise;\n double x,y,noise;\n lx = generator.nextDouble();\n ly = generator.nextDouble();\n lnoise = generator.nextDouble();\n\n x = (3950.0*(lx)) + 50.0;\n y = (3950.0*(ly)) + 50.0;\n noise = (40.0*(lnoise)) + -20.0;\n\n double[] tmp;\n tmp = new double[2];\n tmp[0] = x;\n tmp[1] = y;\n\n linG.addSample(tmp,a*x + b*y + c + noise);\n\n }\n\n System.out.println(\"Current hypothesis :\" + linG.currentHypothesis());\n System.out.println(\"Current cost :\" + linG.currentCost());\n System.out.println(\"Aiming for : x_3 = \"+ a+\"x_1 + \"+b+\"x_2 + \"+c+\"\\n\");\n\n for(int i = 0; i < 10; i++)\n {\n linG.gradientDescent(0.00000004,666);\n\n System.out.println(\"Current hypothesis :\" + linG.currentHypothesis());\n System.out.println(\"Current cost :\" + linG.currentCost());\n System.out.println(\"Aiming for : x_3 = \"+ a+\"x_1 + \"+b+\"x_2 + \"+c+\"\\n\");\n }\n\n\t}", "public void FeedForward() {\r\n\t\tfor (int i = 0; i < Node.length; i++) {\r\n\t\t\tNet = Node[i].Threshold;\r\n\r\n\t\t\tfor (int j = 0; j < Node[i].Weight.length; j++)\r\n\t\t\t\tNet = Net + Input[j] * Node[i].Weight[j];\r\n\r\n\t\t\tNode[i].Output = Sigmoid(Net);\r\n\t\t}\r\n\t}", "public ProbNet parametricLearning() \n throws NormalizeNullVectorException{\n int[][] cases = caseDatabase.getCases ();\n TablePotential absoluteFrequencies;\n \n for (ProbNode node : probNet.getProbNodes()) {\n if(!node.getPotentials ().isEmpty ())\n {\n probNet.removePotential (node.getPotentials ().get (0));\n }\n absoluteFrequencies = calculateAbsoluteFrequencies(probNet, cases, node);\n for (int j = 0; j < absoluteFrequencies.getTableSize(); j++)\n absoluteFrequencies.values[j] += alpha;\n probNet.addPotential (DiscretePotentialOperations.normalize(absoluteFrequencies));\n }\n \n return probNet;\n }", "public static void testMultimensionalOutput() {\n\t\tint vectSize = 8;\n\t\tint outputsPerInput = 10;\n\t\tdouble repeatProb = 0.8;\n\t\tdouble inpRemovalPct = 0.8;\n\t\tCollection<DataPoint> data = createMultidimensionalCorrSamples(vectSize, outputsPerInput, inpRemovalPct);\n//\t\tCollection<DataPoint> data = createMultidimensionalSamples(vectSize, outputsPerInput, repeatProb);\n\n\t\tModelLearner modeler = createModelLearner(vectSize, data);\n\t\tint numRuns = 100;\n\t\tint jointAdjustments = 18;\n\t\tdouble skewFactor = 0;\n\t\tdouble cutoffProb = 0.1;\n\t\tDecisionProcess decisioner = new DecisionProcess(modeler, null, 1, numRuns,\n\t\t\t\t0, skewFactor, 0, cutoffProb);\n\t\tDecisionProcess decisionerJ = new DecisionProcess(modeler, null, 1, numRuns,\n\t\t\t\tjointAdjustments, skewFactor, 0, cutoffProb);\n\t\t\n\t\tSet<DiscreteState> inputs = getInputSetFromSamples(data);\n\t\tArrayList<Double> realV = new ArrayList<Double>();\n\t\tArrayList<Double> predV = new ArrayList<Double>();\n\t\tArrayList<Double> predJV = new ArrayList<Double>();\n\t\tfor (DiscreteState input : inputs) {\n\t\t\tSystem.out.println(\"S\" + input);\n\t\t\tMap<DiscreteState, Double> outProbs = getRealOutputProbsForInput(input, data);\n\t\t\tMap<DiscreteState,Double> preds = countToFreqMap(decisioner\n\t\t\t\t\t.getImmediateStateGraphForActionGibbs(input.getRawState(), new double[] {}));\n\t\t\tMap<DiscreteState,Double> predsJ = countToFreqMap(decisionerJ\n\t\t\t\t\t.getImmediateStateGraphForActionGibbs(input.getRawState(), new double[] {}));\n\t\t\tSet<DiscreteState> outputs = new HashSet<DiscreteState>();\n\t\t\toutputs.addAll(outProbs.keySet());\n\t\t\toutputs.addAll(preds.keySet());\n\t\t\toutputs.addAll(predsJ.keySet());\n\t\t\tfor (DiscreteState output : outputs) {\n\t\t\t\tDouble realD = outProbs.get(output);\n\t\t\t\tDouble predD = preds.get(output);\n\t\t\t\tDouble predJD = predsJ.get(output);\n\t\t\t\tdouble real = (realD != null ? realD : 0);\n\t\t\t\tdouble pred = (predD != null ? predD : 0);\n\t\t\t\tdouble predJ = (predJD != null ? predJD : 0);\n\t\t\t\trealV.add(real);\n\t\t\t\tpredV.add(pred);\n\t\t\t\tpredJV.add(predJ);\n\t\t\t\tSystem.out.println(\"\tS'\" + output + \"\t\" + real + \"\t\" + pred + \"\t\" + predJ);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"CORR:\t\" + Utils.correlation(realV, predV)\n\t\t\t\t+ \"\t\" + Utils.correlation(realV, predJV));\n\t}", "public void SetLearnRate (double alpha) { this.alpha = alpha; }", "public void setPredatorsWeights(double[] weights) {\r\n int k = 0;\r\n for (Predator predator : predators) {\r\n predator.setWeights(weights, k);\r\n if(controller == ControllerType.HETEROGENEO){\r\n k += (weights.length/predators.size());\r\n }\r\n }\r\n }", "public void update(double[] x, double y, double alpha) {\n\t\tdouble h=eval(x);\n\t\tfor(int i=0; i<x.length; i++) {\n\t\t\tweights[i]= weights[i]+ alpha*(y-h)*x[i];\n\t\t}\n\t}", "private void forwardPropagation(int[] trainingData, double[] activationsOfHiddenLayer, double[] outputActivations) {\n\t\tdouble[] hiddenActivations = new double[SIZE_HIDDEN_LAYER];\n\n\t\tfor(int indexHidden = 0; indexHidden < SIZE_HIDDEN_LAYER; indexHidden++) {\n\t\t\thiddenActivations[indexHidden] = 0;\n\t\t\tfor(int indexInput = 0; indexInput < SIZE_INPUT_LAYER; indexInput++) {\n\t\t\t\thiddenActivations[indexHidden] += weightsOfHiddenLayer[indexHidden][indexInput] * trainingData[indexInput];\n\t\t\t}\t\n\t\t\thiddenActivations[indexHidden] += biasOfHiddenLayer[indexHidden];\n//\t\t\t// We then call the activation function \n\t\t\thiddenActivations[indexHidden] = tanh(hiddenActivations[indexHidden]);\n\t\t\tactivationsOfHiddenLayer[indexHidden] = hiddenActivations[indexHidden];\n\n\t\t}\n\t\t\t\t\n\t\tfor(int indexOuput = 0; indexOuput < SIZE_OUTPUT_LAYER; indexOuput++) {\n\t\t\toutputActivations[indexOuput] = 0;\n\t\t\tfor(int indexHidden = 0; indexHidden < SIZE_HIDDEN_LAYER; indexHidden ++) {\n\t\t\t\toutputActivations[indexOuput] += weightsOfOutputLayer[indexOuput][indexHidden] * hiddenActivations[indexHidden];\n\t\t\t}\t\n\t\t\toutputActivations[indexOuput] += biasOfOutputLayer[indexOuput];\n\t\t}\n\t\tsoftmax(outputActivations);\t\n\t}", "public void trainingPreprocessing() {\n neuralNetAndDataSet = new NeuralNetAndDataSet(neuralNetwork, trainingSet);\n trainingController = new TrainingController(neuralNetAndDataSet);\n neuralNetwork.getLearningRule().addListener(this);\n trainingController.setLmsParams(0.7, 0.01, 0);\n LMS learningRule = (LMS) this.neuralNetAndDataSet.getNetwork().getLearningRule();\n if (learningRule instanceof MomentumBackpropagation) {\n ((MomentumBackpropagation) learningRule).setMomentum(0.2);\n }\n }", "public double[] predictSoft(double[] testingData) {\n\n\t\tdouble[] hiddenActivations = new double[SIZE_HIDDEN_LAYER];\n\t\tdouble[] hiddenActivations2 = new double[SIZE_HIDDEN_LAYER];\n\t\tfor(int indexHidden = 0; indexHidden < SIZE_HIDDEN_LAYER; indexHidden++) {\n\t\t\thiddenActivations[indexHidden] = 0;\n\t\t\tfor(int indexInput = 0; indexInput < SIZE_INPUT_LAYER; indexInput++) {\n\t\t\t\thiddenActivations[indexHidden] += weightsOfHiddenLayer[indexHidden][indexInput] * testingData[indexInput];\n\t\t\t}\t\n\t\t\thiddenActivations[indexHidden] += biasOfHiddenLayer[indexHidden];\n\t\t\thiddenActivations2[indexHidden] = tanh(hiddenActivations[indexHidden]);\n\t\t}\n\t\tdouble[] outputActivations = new double[SIZE_OUTPUT_LAYER];\n\t\tfor(int indexOuput = 0; indexOuput < SIZE_OUTPUT_LAYER; indexOuput++) {\n\t\t\toutputActivations[indexOuput] = 0;\n\t\t\tfor(int indexHidden = 0; indexHidden < SIZE_HIDDEN_LAYER; indexHidden ++) {\n\t\t\t\toutputActivations[indexOuput] += weightsOfOutputLayer[indexOuput][indexHidden] * hiddenActivations2[indexHidden];\n\t\t\t}\t\n\t\t\toutputActivations[indexOuput] += biasOfOutputLayer[indexOuput];\n\t\t}\n\t\tsoftmax(outputActivations);\t\n\t\treturn outputActivations;\n\t}", "public void backprop(double[] inputs, FeedForwardNeuralNetwork net, boolean verbose)\n {\n //create variables that will be used later\n int[] sizes = net.getSizes();\n int biggestSize = 0;\n for(int k = 0; k < sizes.length; k++)\n {\n if(sizes[k] > biggestSize)\n {\n biggestSize = sizes[k];\n }\n }\n int hiddenLayers = sizes.length - 2;\n //if input or output wrong size, return\n if(inputs.length != sizes[0])\n {\n System.out.println(\"Invalid number of inputs\");\n return;\n }\n\n double[][] allOutputs = new double[sizes.length][biggestSize];\n double[][] allErrors = new double[sizes.length][biggestSize];\n\n //fill out first layer to temp output\n int lastLayer = sizes[0];\n for(int k = 0; k < lastLayer; k++)\n {\n allOutputs[0][k] = inputs[k];\n }\n\n //for each layer after the input\n for(int k = 1; k < hiddenLayers + 2; k++)\n {\n //for each node in that layer\n for(int a = 0; a < sizes[k]; a++)\n {\n //get sum and get activation function result and its derivative\n double sum = 0;\n for(int t = 0; t < lastLayer; t++)\n {\n sum += allOutputs[k - 1][t] * net.getWeight(k - 1, t, k, a);\n }\n sum += net.getBiasNum() * net.getWeight(-1, 0, k, a);\n if(k != hiddenLayers + 1)\n {\n allOutputs[k][a] = net.applyActivationFunction(sum, net.getHiddenActivationFunction());\n allErrors[k][a] = net.applyActivationFunctionDerivative(sum, net.getHiddenActivationFunction());\n }\n else\n {\n allOutputs[k][a] = net.applyActivationFunction(sum, net.getOutputActivationFunction());\n allErrors[k][a] = net.applyActivationFunctionDerivative(sum, net.getOutputActivationFunction());\n }\n }\n lastLayer = sizes[k];\n }\n\n if(verbose)\n {\n System.out.println(\"Outputs\");\n for(int k = 0; k < maxClusters; k++)\n {\n System.out.print(allOutputs[hiddenLayers + 1][k] + \", \");\n }\n System.out.println();\n }\n double[] expectedOutputs = new double[maxClusters];\n int cluster = 0;\n double max = 0;\n for(int k = 0; k < maxClusters; k++)\n {\n expectedOutputs[k] = allOutputs[hiddenLayers + 1][k];\n if(allOutputs[hiddenLayers + 1][k] > max)\n {\n cluster = k;\n max = allOutputs[hiddenLayers + 1][k];\n }\n }\n if(verbose)\n {\n System.out.println(\"Output \" + cluster + \" will be set to max value\");\n System.out.println();\n }\n\n expectedOutputs[cluster] = 4;\n\n\n //go backward from output to first hidden layer\n for(int k = hiddenLayers + 1; k > 0; k--)\n {\n //for each node in that layer\n for(int a = 0; a < sizes[k]; a++)\n {\n //compute error for not output layer\n if(k != hiddenLayers + 1)\n {\n double temp = allErrors[k][a];\n allErrors[k][a] = 0;\n for(int t = 0; t < sizes[k + 1]; t++)\n {\n allErrors[k][a] += net.getWeight(k, t, k + 1, a) * allErrors[k + 1][t];\n }\n allErrors[k][a] *= temp;\n }\n //compute error for output layer\n else\n {\n allErrors[k][a] *= (expectedOutputs[a] - allOutputs[k][a]);\n }\n\n //for each weight node takes as input\n for(int t = 0; t < sizes[k - 1]; t++)\n {\n //find the delta for the weight and apply\n int index = net.getIndex(k - 1, t, k, a);\n double delta = learningRate * allOutputs[k - 1][t] * allErrors[k][a]\n + momentum * lastDeltas[index];\n\n net.setWeight(k - 1, t, k, a, net.getWeight(k - 1, t, k, a) + delta);\n lastDeltas[index] = delta;\n }\n }\n }\n }", "public SVMPolynomialClassifier() {\r\n\t\tsuper();\r\n\r\n\t\tsetKernelType(new SelectedTag(kernelType, LibSVM.TAGS_KERNELTYPE));\r\n\t}", "NeuralNetwork mutate(float rate);", "public NeuralNetwork(double learningRate, int[] topology) {\n this.learningRate = learningRate;\n int layerCount = topology.length;\n this.weights = new ArrayList<double[][]>();\n\n // Iterating over layers, skipping the input layer\n for (int i = 0; i < layerCount - 1; i++) {\n int previousLayerNeuronCount = topology[i];\n int layerNeuronCount = topology[i + 1];\n\n // This effectively sets index i\n double[][] layerWeights = new double[layerNeuronCount][previousLayerNeuronCount];\n\n // Iterating over nodes in this layer\n for (int j = 0; j < layerNeuronCount; j++) {\n for (int k = 0; k < previousLayerNeuronCount; k++) {\n layerWeights[j][k] = Math.random() * 2 - 1;\n }\n }\n\n this.weights.add(layerWeights);\n }\n }", "private double performPKLStep(ArrayList<Kernel<T>> kernels, ArrayList<Double> weights, List<TrainingSample<T>> l)\n\t{\n\n\t\t//store new as old for the loop\n\t\tdouble objective = oldObjective;\n\t\t\n\t\teprintln(3, \"+++ old weights : \"+weights);\n\t\teprintln(3, \"+++ oldObjective : \"+oldObjective+\" sumAlpha : \"+computeSumAlpha());\n\t\t\n\t\t\n\t\t//compute grad\n\t\tdouble [] grad = gradBeta(kernels, weights, l);\n\t\tdouble [] sgrad = secondGradBeta(kernels, weights, l);\n\t\t\n\t\t\n\t\tdouble newBeta[] = new double[grad.length];\n\n\t\t//update weights in this direction until objective decreases\n\t\td_lambda = 1.0; //reset learning rate\n\t\tdo\n\t\t{\n\t\t\tfor(int i = 0 ; i < grad.length; i++)\n\t\t\t{\n\t\t\t\t//second order update\n\t\t\t\tif(sgrad[i] != 0.)\n\t\t\t\t\tnewBeta[i] = weights.get(i) * (1 - d_lambda*grad[i]/sgrad[i]);\n\t\t\t\tif(newBeta[i] < num_cleaning)\n\t\t\t\t\tnewBeta[i] = 0;\n\n\t\t\t}\n\n\t\t\t//normalize\n\t\t\tdouble norm = 0;\n\t\t\tif(p_norm == 1) // L1-norm\n\t\t\t{\n\t\t\t\tfor(int i = 0 ; i < newBeta.length; i++)\n\t\t\t\t\tnorm += Math.abs(newBeta[i]);\n\t\t\t}\n\t\t\telse //Lp-norm\n\t\t\t{\n\t\t\t\tfor(int i = 0 ; i < newBeta.length; i++)\n\t\t\t\t\tnorm += Math.pow(newBeta[i], p_norm);\n\t\t\t\tnorm = Math.pow(norm, -1/(double)p_norm);\n\t\t\t}\n\t\t\tif(norm < 0)\n\t\t\t{\n\t\t\t\teprintln(1, \"Error normalization, norm < 0\");\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\teprintln(3, \"+++ norm : \"+norm);\n\t\t\t//normalize\n\t\t\tfor(int i = 0 ; i < newBeta.length; i++)\n\t\t\t\tnewBeta[i] /= (double)(norm);\n\t\t\t\n\n\n\t\t\t//compute new objective function\n\t\t\tThreadedProductKernel<T> pk = new ThreadedProductKernel<T>();\n\t\t\tfor( int i = 0 ; i < kernels.size(); i++)\n\t\t\t\tpk.addKernel(kernels.get(i), newBeta[i]);\n\t\t\t//train svm\n\t\t\tsvm.setKernel(pk);\n\t\t\teprintln(3, \"+ retraining svm\");\n\t\t\tsvm.retrain();\n\t\t\tdouble[] a = svm.getAlphas();\n\t\t\t//update lambda\n\t\t\tupdateLambdaMatrix(a, pk, l);\n\t\t\t//new objective\n\t\t\tobjective = computeObj(a, pk, l);\n\n\t\t\tif(objective < oldObjective + num_cleaning) // did the objective at least stay similar\n\t\t\t{\n\t\t\t\t//store new weights\n\t\t\t\tfor(int i = 0 ; i < weights.size(); i++)\n\t\t\t\t\tweights.set(i, newBeta[i]);\n\t\t\t\teprintln(3, \"+++ new weights : \"+weights);\n\t\t\t}\n\t\t\telse //if not, reduce learning rate exponentially\n\t\t\t{\n\t\t\t\tif(d_lambda > num_cleaning)\n\t\t\t\t\td_lambda /= 8.;\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\td_lambda = 0.;\n\t\t\t\t\teprint(3, \"+++ d_lambda is zero, stopping.\");\n\t\t\t\t\teprintln(2, \"\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\teprint(2, \"+\");\n\t\t\t\teprintln(3, \"++ new objective (\"+(float)objective+\") did not decrease (\"+(float)oldObjective+\"), reducing step : \"+d_lambda);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\twhile(oldObjective + num_cleaning < objective);\n\t\t\n\t\teprintln(2, \"+ objective : \"+(float)objective+\"\\t+\\t sumAlpha : \"+(float)computeSumAlpha());\n\n\t\tdouble gap = objective/oldObjective;\n\t\t\n\t\t//store objective as oldObjective\n\t\toldObjective = objective;\n\n\t\t//return objective evolution\n\t\treturn gap;\n\t}", "@Override\n\tpublic void train(DataSet data) {\n\t\tArrayList<Example> examples = data.getCopyWithBias().getData();\n\t\t// initialize both weight vectors with random values between -0.1 ad 0.1\n\t\tinitWeights(examples.size());\n\n\t\t// store outputs from forward calculation for each example\n\t\t// array will have size # examples.\n\t\tArrayList<Double> nodeOutputs = calculateForward(examples);\n\n\t\t// now take error and back-propagate from output to hidden nodes\n\n\t\tfor (int j = 0; j < examples.size(); j++) {\n\t\t\tExample ex = examples.get(j);\n\n\t\t\t// get hidden node outputs for single example\n\t\t\tfor (int num = 0; num < numHidden; num++) {\n\t\t\t\tArrayList<Double> h_outputs = hiddenOutputs.get(num);\n\t\t\t\tdouble vDotH = dotProduct(h_outputs, layerTwoWeights); // calculate\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// v dot\n\t\t\t\t// h for\n\t\t\t\t// this node\n\n\t\t\t\tfor (int i = 0; i < numHidden - 1; i++) {\n\t\t\t\t\tdouble oldV = layerTwoWeights.get(i);\n\t\t\t\t\tdouble hk = h_outputs.get(i);\n\t\t\t\t\t// Equation describing line below:\n\t\t\t\t\t// v_k = v_k + eta*h_k(y-f(v dot h)) f'(v dot h)\n\t\t\t\t\tlayerTwoWeights.set(i, oldV + eta * hk * (ex.getLabel() - Math.tanh(vDotH)) * derivative(vDotH));\n\t\t\t\t}\n\n\t\t\t\tSet<Integer> features = ex.getFeatureSet();\n\t\t\t\tIterator<Integer> iter = features.iterator();\n\t\t\t\tArrayList<Double> featureVals = new ArrayList<Double>();\n\t\t\t\tfor (int f : features) {\n\t\t\t\t\tfeatureVals.add((double) f);\n\t\t\t\t}\n\n\t\t\t\t// take that error and back-propagate one more time\n\t\t\t\tfor (int x = 0; x < numHidden; x++) {\n\t\t\t\t\tArrayList<Double> initWeights = hiddenWeights.get(x);\n\t\t\t\t\t// List<Object> features =\n\t\t\t\t\t// Arrays.asList(ex.getFeatureSet().toArray());\n\n\t\t\t\t\t// for (int i = 0; i < featureVals.size()-1; i++) {\n\t\t\t\t\tdouble oldWeight = initWeights.get(j);\n\t\t\t\t\tdouble thisInput = ex.getFeature(featureVals.get(x).intValue());\n\t\t\t\t\t// w_kj = w_kj + eta*xj(input)*f'(w_k dot x)*v_k*f'(v dot\n\t\t\t\t\t// h)(y-f(v dot h))\n\t\t\t\t\tdouble updateWeight = oldWeight + eta * thisInput * derivative(dotProduct(featureVals, initWeights))\n\t\t\t\t\t\t\t* layerTwoWeights.get(x) * derivative(vDotH) * (ex.getLabel() - Math.tanh(vDotH));\n\t\t\t\t\tinitWeights.set(j, updateWeight);\n\t\t\t\t\t// }\n\t\t\t\t\thiddenWeights.set(x, initWeights); // update weights for\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// current\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// example\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "private float predictPrueba(float features) {\n float n_epochs = num_epoch;\n float num1 = (float) Math.random();\n float output = 0; //y\n\n //First, create an input tensor:\n /*\n\n */\n\n\n //**** TEORIA *******\n //First, create an input tensor:\n //Tensor input = Tensor.create(features);\n // float[][] output = new float[1][1];\n //Then perform inference by:\n //Tensor op_tensor = sess.runner().feed(\"input\", input).fetch(\"output\").run().get(0).expect(Float.class);\n //Copy this output to a float array using:\n //op_tensor.copyTo(output);\n // values.copyTo(output);\n Tensor input = Tensor.create(features);\n Tensor op_tensor = sess.runner().feed(\"input\",input).fetch(\"output\").run().get(0).expect(Float.class);\n //para escribir en la app en W y B test\n ArrayList<Tensor<?>> values = (ArrayList<Tensor<?>>) sess.runner().fetch(\"W/read\").fetch(\"b/read\").run();\n // NO VA ESTA PRUEBA ArrayList<Tensor<?>> values = (ArrayList<Tensor<?>>) sess.runner().fetch(\"W/read\").fetch(\"b/read\").fetch(\"y/output\").run();\n\n Wtest.setText(\"W_inicial: \"+(Float.toString(values.get(0).floatValue())));\n Btest.setText(\"b_inicial: \"+Float.toString(values.get(1).floatValue()));\n y_mejoras_w.add(((values.get(0).floatValue())));\n x_mejoras_w.add( \"\"+(0+ num_epoch*num));\n\n y_mejoras_b.add(((values.get(1).floatValue())));\n x_mejoras_b.add( \"\"+(0+ num_epoch*num));\n\n ///\n\n // Y.setText(Float.toString(values.get(1).floatValue()));\n\n return output; ///mal\n }", "public double loss() {\n double L,l;\n if (weightStrategy != 2) {\n\n L = reg * (U.squaredSum() + V.squaredSum());\n for (int u = 0; u < userCount; u++) {\n l = 0;\n for (int i : trainMatrix.getRowRef(u).indexList()) {\n double pred = predict(u, i);\n l += W.getValue(u, i) * Math.pow(trainMatrix.getValue(u, i) - pred, 2);\n l -= getNegWeight(i) * Math.pow(pred, 2);\n }\n l += SV.mult(U.row(u, false)).inner(U.row(u, false));\n L += l;\n }\n\n return L;\n }\n else {\n L = reg * (U.squaredSum() + V.squaredSum());\n for (int i = 0; i < itemCount; i++) {\n l = 0;\n for (int u : trainMatrix.getColRef(i).indexList()) {\n double pred = predict(u, i);\n l += W.getValue(u, i) * Math.pow(trainMatrix.getValue(u, i) - pred, 2);\n l -= getNegWeight(u) * Math.pow(pred, 2);\n }\n l += SU.mult(V.row(i, false)).inner(V.row(i, false));\n L += l;\n }\n\n return L;\n }\n }", "@Override\r\n\tpublic int predict(double[] x) {\n\t\tdouble[][] inputArray = new double[1][x.length];\r\n\t\tfor (int i = 0; i < x.length; i++) {\r\n\t\t\tinputArray[0][i] = x[i]-0.5*this.means[0][0][i]-0.5*this.means[1][0][i];\r\n\t\t}\r\n\t\tMatrix input = new Matrix(inputArray);\r\n\t\tdouble result = this.delta;\r\n\t\t// System.out.println(input.times(this.beta.get(label)).getRowDimension());\r\n\t\tresult += input.times(this.beta).get(0, 0);\r\n\t\t// System.out.println(result);\r\n\t\treturn result > 0 ? 1 : -1;\r\n\t}", "public double[] predict(double[] input_array) {\n\t\tMatrix_instance input = new Matrix_instance(input_array);\n\t\tMatrix_instance hidden = Matrix.Product(this.weights_ih, input);\n\t\thidden.adder(this.bias_h);\n\n\t\t// activation function\n\t\thidden.applyFunction(i -> sigmoid(i));\n\t\tMatrix_instance output = Matrix.Product(this.weights_ho, hidden);\n\t\toutput.adder(this.bias_o);\n\t\toutput.applyFunction(i -> sigmoid(i));\n\t\treturn output.toArray();\n\t}", "private void train(float[] inputs, int desired) {\r\n int guess = feedforward(inputs);\r\n float error = desired - guess;\r\n for (int i = 0; i < weights.length; i++) {\r\n weights[i] += c * error * inputs[i];\r\n }\r\n }", "public void train() {\n\n\t\tint D = Os.length;\n\t\tint T_n = 0;\n\t\tdouble log_likelihood = 0;\n\t\tdouble log_likelihood_new = 0;\n\t\tdouble epsilon = this.epsilon;\n\t\tint maxIter = this.maxIter;\n\n\t\t// Initialization\n\n\t\tclearVector(pi);\n\t\tclearMatrix(A);\n\t\tclearMatrix(B);\n\n\t\tdouble[] a = allocateVector(N);\n\t\tdouble[] b = allocateVector(N);\n\n\t\tint[] Q_n = null;\n\t\tint[] O_n = null;\n\t\t\n\t\tif (Qs == null) {\n\t\t\t\n\t\t\tpi = initializePi();\n\t\t\tA = initializeA();\n\t\t\tB = initializeB();\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tfor (int n = 0; n < D; n++) {\n\t\t\t\tQ_n = Qs[n];\n\t\t\t\tO_n = Os[n];\n\t\t\t\tT_n = Os[n].length;\n\t\t\t\tfor (int t = 0; t < T_n; t++) {\n\t\t\t\t\tif (t < T_n - 1) {\n\t\t\t\t\t\tA[Q_n[t]][Q_n[t + 1]] += 1;\n\t\t\t\t\t\ta[Q_n[t]] += 1;\n\t\t\t\t\t\tif (t == 0) {\n\t\t\t\t\t\t\tpi[Q_n[0]] += 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tB[Q_n[t]][O_n[t]] += 1;\n\t\t\t\t\tb[Q_n[t]] += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tdivideAssign(pi, D);\n\t\t\tfor (int i = 0; i < N; i++) {\n\t\t\t\tdivideAssign(A[i], a[i]);\n\t\t\t\tdivideAssign(B[i], b[i]);\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\tint s = 0;\n\t\tdouble[] pi_new = allocateVector(N);\n\t\tdouble[][] A_new = allocateMatrix(N, N);\n\t\tdouble[][] B_new = allocateMatrix(N, M);\n\t\tdouble[] temp_pi = null;\n\t\tdouble[][] temp_A = null;\n\t\tdouble[][] temp_B = null;\n\t\tdouble[][] alpha_hat = null;\n\t\tdouble[][] beta_hat = null;\n\t\tdouble[] c_n = null;\n\t\tdouble[][] xi = allocateMatrix(N, N);\n\t\tdouble[] gamma = allocateVector(N);\n\t\tdo {\n\n\t\t\t// Clearance\n\t\t\tclearVector(pi_new);\n\t\t\tclearMatrix(A_new);\n\t\t\tclearMatrix(B_new);\n\t\t\tclearVector(a);\n\t\t\tclearVector(b);\n\t\t\t/*clearMatrix(xi);\n\t\t\tclearVector(gamma);*/\n\t\t\tlog_likelihood_new = 0;\n\n\t\t\tfor (int n = 0; n < D; n++) {\n\n\t\t\t\t// Q_n = Qs[n];\n\t\t\t\tO_n = Os[n];\n\t\t\t\tT_n = Os[n].length;\n\t\t\t\tc_n = allocateVector(T_n);\n\t\t\t\talpha_hat = allocateMatrix(T_n, N);\n\t\t\t\tbeta_hat = allocateMatrix(T_n, N);\n\n\t\t\t\t// Forward Recursion with Scaling\t\t\t\n\n\t\t\t\tfor (int t = 0; t <= T_n - 1; t++) {\n\t\t\t\t\tif (t == 0) {\n\t\t\t\t\t\tfor (int i = 0; i < N; i++) {\n\t\t\t\t\t\t\talpha_hat[0][i] = pi[i] * B[i][O_n[0]];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfor (int j = 0; j < N; j++) {\n\t\t\t\t\t\t\tfor (int i = 0; i < N; i++) {\n\t\t\t\t\t\t\t\talpha_hat[t][j] += alpha_hat[t - 1][i] * A[i][j] * B[j][O_n[t]];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tc_n[t] = 1.0 / sum(alpha_hat[t]);\n\t\t\t\t\ttimesAssign(alpha_hat[t], c_n[t]);\n\t\t\t\t}\n\n\t\t\t\t// Backward Recursion with Scaling\n\n\t\t\t\tfor (int t = T_n + 1; t >= 2; t--) {\n\t\t\t\t\tif (t == T_n + 1) {\n\t\t\t\t\t\tfor (int i = 0; i < N; i++) {\n\t\t\t\t\t\t\tbeta_hat[t - 2][i] = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (t <= T_n) {\n\t\t\t\t\t\tfor (int i = 0; i < N; i++) {\n\t\t\t\t\t\t\tfor (int j = 0; j < N; j++) {\n\t\t\t\t\t\t\t\tbeta_hat[t - 2][i] += A[i][j] * B[j][O_n[t - 1]] * beta_hat[t - 1][j];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\ttimesAssign(beta_hat[t - 2], c_n[t - 2]);\n\t\t\t\t}\n\n\t\t\t\t// Expectation Variables and Updating Model Parameters\n\n\t\t\t\tfor (int t = 0; t <= T_n - 1; t++) {\n\t\t\t\t\tif (t < T_n - 1) {\n\t\t\t\t\t\tfor (int i = 0; i < N; i++) {\n\t\t\t\t\t\t\tfor (int j = 0; j < N; j++) {\n\t\t\t\t\t\t\t\txi[i][j] = alpha_hat[t][i] * A[i][j] * B[j][O_n[t + 1]] * beta_hat[t + 1][j];\n\t\t\t\t\t\t\t\t// A_new[i][j] += xi[i][j];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tplusAssign(A_new[i], xi[i]);\n\t\t\t\t\t\t\tgamma[i] = sum(xi[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (t == 0) {\n\t\t\t\t\t\t\tplusAssign(pi_new, gamma);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tplusAssign(a, gamma);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tassignVector(gamma, alpha_hat[t]);\n\t\t\t\t\t}\n\t\t\t\t\tfor (int j = 0; j < N; j++) {\n\t\t\t\t\t\tB_new[j][O_n[t]] += gamma[j];\n\t\t\t\t\t}\n\t\t\t\t\tplusAssign(b, gamma);\n\t\t\t\t\tlog_likelihood_new += -Math.log(c_n[t]);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Normalization (Sum to One)\n\n\t\t\tsum2one(pi_new);\n\n\t\t\tfor (int i = 0; i < N; i++) {\n\t\t\t\tdivideAssign(A_new[i], a[i]);\n\t\t\t}\n\n\t\t\tfor (int j = 0; j < N; j++) {\n\t\t\t\tdivideAssign(B_new[j], b[j]);\n\t\t\t}\n\n\t\t\ttemp_pi = pi;\n\t\t\tpi = pi_new;\n\t\t\tpi_new = temp_pi;\n\n\t\t\ttemp_A = A;\n\t\t\tA = A_new;\n\t\t\tA_new = temp_A;\n\n\t\t\ttemp_B = B;\n\t\t\tB = B_new;\n\t\t\tB_new = temp_B;\n\t\t\t// display(B);\n\n\t\t\ts = s + 1;\n\n\t\t\tif (s > 1) {\n\t\t\t\tif (Math.abs((log_likelihood_new - log_likelihood) / log_likelihood) < epsilon) {\n\t\t\t\t\tfprintf(\"log[P(O|Theta)] does not increase.\\n\\n\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlog_likelihood = log_likelihood_new;\n\t\t\tfprintf(\"Iter: %d, log[P(O|Theta)]: %f\\n\", s, log_likelihood);\n\n\t\t} while (s < maxIter);\n\n\t}", "public Trainer(double[][] data, double[] attribute, int hiddenLayerNodeCount, int outputLayerNodeCount){\r\n this.data = data;\r\n this.attribute = attribute;\r\n hiddenLayer = new Node[hiddenLayerNodeCount];\r\n outputLayer = new Node[outputLayerNodeCount];\r\n activation = new double[hiddenLayerNodeCount];\r\n desireHiddenLayerActivation = new double[hiddenLayerNodeCount];\r\n for (int i = 0; i < hiddenLayerNodeCount; i++) {\r\n hiddenLayer[i] = new Node(0.5, data[0].length - 1);\r\n }\r\n for (int i = 0; i < outputLayerNodeCount; i++) {\r\n outputLayer[i] = new Node(0.5, activation.length);\r\n }\r\n }", "FeatureWeightPair(FeatureFunction f, float w, boolean increasesHappiness) {\n\t\tfeature = f;\n\t\tweight = w;\n\t\tthis.increasesHappiness = increasesHappiness;\n\t}", "public double train(ExampleInput input, ExampleOutput output,\n\t\t\tExampleOutput predicted);", "public static void main(String[] args) {\n\t\tfinal int input1 = 1;\r\n\t\tfinal int input2 = 1;\r\n\t\t\r\n\t\t// One output in layer 3\r\n\t\tdouble targetOutput = 0;\r\n\t\t\r\n\t\t// Input to Hidden (IH) weights\r\n\t\tdouble IH1 = 0.8;\r\n\t\tdouble IH2 = 0.4;\r\n\t\tdouble IH3 = 0.3;\r\n\t\tdouble IH4 = 0.2;\r\n\t\tdouble IH5 = 0.9;\r\n\t\tdouble IH6 = 0.5;\r\n\t\t\r\n\t\t// second iteration of weights: Hidden to Output (HO) weights\r\n\t\tdouble HO1 = 0.3;\r\n\t\tdouble HO2 = 0.5;\r\n\t\tdouble HO3 = 0.9;\r\n\t\t\r\n\t\t// initialization\r\n\t\tdouble weightedSum1;\r\n\t\tdouble weightedSum2;\r\n\t\tdouble weightedSum3;\r\n\t\t\r\n\t\tdouble hiddenOutput1;\r\n\t\tdouble hiddenOutput2;\r\n\t\tdouble hiddenOutput3;\r\n\t\t\r\n\t\tdouble calculatedOutput;\r\n\t\t\r\n\t\tdouble secondWeightedSum;\r\n\t\t\r\n\t\tdouble outputSumError;\r\n\t\t\r\n\t\tdouble deltaSum;\r\n\t\t\r\n\t\tdouble deltaHO1;\r\n\t\tdouble deltaHO2;\r\n\t\tdouble deltaHO3;\r\n\t\t\r\n\t\tdouble deltaIH1;\r\n\t\tdouble deltaIH2;\r\n\t\tdouble deltaIH3;\r\n\t\tdouble deltaIH4;\r\n\t\tdouble deltaIH5;\r\n\t\tdouble deltaIH6;\r\n\t\t\r\n\t\tfor (int i=0;i<10000;i++){\r\n\t\t\t// Three inputs in layer 2 (hidden layer)\r\n\t\t\tweightedSum1 = input1*IH1+input2*IH4;\r\n\t\t\tweightedSum2 = input1*IH2+input2*IH5;\r\n\t\t\tweightedSum3 = input1*IH3+input2*IH6;\r\n\t\t\t\r\n\t\t\t// weighted sums converted into probabilities by sigmoid\r\n\t\t\thiddenOutput1 = sigmoid(weightedSum1);\r\n\t\t\thiddenOutput2 = sigmoid(weightedSum2);\r\n\t\t\thiddenOutput3 = sigmoid(weightedSum3);\r\n\t\t\t// second iteration of weighted sum\r\n\t\t\tsecondWeightedSum = hiddenOutput1*HO1+hiddenOutput2*HO2+hiddenOutput3*HO3;\r\n\t\t\t\r\n\t\t\t// applying sigmoid on secondWeightedSum to get calculatedOutput\r\n\t\t\tcalculatedOutput = sigmoid(secondWeightedSum);\r\n\t\t\tSystem.out.println(calculatedOutput);\r\n\t\t\t// Back Propagation \r\n\t\t\t\r\n\t\t\t//output sum error = target output - calculated output\r\n\t\t\toutputSumError = targetOutput - calculatedOutput;\r\n\t\t\t\r\n\t\t\t// delta sum = S'(sum)*outputSumError \r\n\t\t\tdeltaSum = sigmoidPrime(secondWeightedSum)*outputSumError;\r\n\t\t\t\t\r\n\t\t/* deltaIHWeights (1,2,3 are equal to 4,5,6 respectively \r\n\t\t because input1 and input2 are both 1) */\r\n\t\tdeltaIH1 = deltaSum / HO1 * sigmoidPrime(weightedSum1);\r\n\t\tdeltaIH2 = deltaSum / HO2 * sigmoidPrime(weightedSum2);\r\n\t\tdeltaIH3 = deltaSum / HO3 * sigmoidPrime(weightedSum3);\r\n\t\tdeltaIH4 = deltaSum / HO1 * sigmoidPrime(weightedSum1);\r\n\t\tdeltaIH5 = deltaSum / HO2 * sigmoidPrime(weightedSum2);\r\n\t\tdeltaIH6 = deltaSum / HO3 * sigmoidPrime(weightedSum3);\r\n\t\t\r\n\t\t// deltaHOWeights\r\n\t\tdeltaHO1 = deltaSum / hiddenOutput1;\r\n\t\tdeltaHO2 = deltaSum / hiddenOutput2;\r\n\t\tdeltaHO3 = deltaSum / hiddenOutput3;\r\n\t\t\r\n\t\t// Modifying Old Weights \r\n\t\t\r\n\t\t// modifying IH weights\r\n\t\tIH1 += deltaIH1;\r\n\t\tIH2 += deltaIH2;\r\n\t\tIH3 += deltaIH3;\r\n\t\tIH4 += deltaIH4;\r\n\t\tIH5 += deltaIH5;\r\n\t\tIH6 += deltaIH6;\r\n\t\t\r\n\t\t// modifying HO weights\r\n\t\tHO1 += deltaHO1;\r\n\t\tHO2 += deltaHO2;\r\n\t\tHO3 += deltaHO3;\r\n\t\t\r\n\t\t}\r\n\t}", "private double calculateMinkowski(kNNNode oNode, int p){\n double sum = 0.0;\n // Using the center of mass, perform the summation of (Xk - Yk) where k\n // is a given attribute index.\n double[] temp = oNode.getData();\n for( int i = 0; i < NUM_ATTRIBUTES; i++) {\n sum += Math.pow(this.data[i] - temp[i], p);\n }\n // raise the summation to the power of 1/p to finish the euclidean\n // calculation.\n return (Math.pow(sum, 1/(double) p));\n }", "public double activationDerivative(double z);", "public static Map<String, Object> l_LAYER_MODEL_MultiClassClassifications_SoftMax_withdropout(\r\n\t\t\tdouble[][] X, double[][] Y, int[] layerDimenstions,\r\n\t\t\tdouble learningRate, int numOfIterations,\r\n\t\t\tDeepNNOptimizers optimizer, DeepNNRegularizor regulizer,\r\n\t\t\tdouble dropOutKeepThreshould, boolean iprintCost) throws Exception {\r\n\r\n\t\tMatrixUtil.setSeed(IPredictionModelConstants.RANDOM_SEED_FOR_REPRODUCIBILITY);\r\n\r\n\t\t//XYSeries //seriesData = new XYSeries(\"Cost\");\r\n\r\n\t\t\r\n\t\tint m = X[0].length;\r\n\t\tMap<String, Object> parameters = null;\r\n\t\tMap<Enum<DeepNNKeysForMaps>, Object> AdamParameters = null;\r\n\t\tMap<String, Object> grads = null;\r\n\t\tMap<String, Object> actCaches = null;\r\n\t\tMap<String, Object> feedForwardResult = null;\r\n\t\tdouble[][] AL = null;\r\n\t\tMap<DeepNNKeysForMaps, Object> oneHotMatrixresult = null;\r\n\t\tdouble cost = 0.0, previousCost = Double.MIN_VALUE, costDifference = 0.0;\r\n\t\tdouble finalPrecision = 0.0, beta1 = 0.9, beta2 = 0.99, adamt = 2;\r\n\t\tMap<String, Object> dropOutMap = new HashMap<>();\r\n\t\toneHotMatrixresult = MatrixUtil.createOneHotVectorMatrix(Y);\r\n\t\tdouble[][] Y_OneHot = (double[][]) oneHotMatrixresult\r\n\t\t\t\t.get(DeepNNKeysForMaps.KEY_FOR_ONE_HOT_MATRIX);\r\n\t\tMap<Double, double[]> labeltoOnhotVectorMap = (Map<Double, double[]>) oneHotMatrixresult\r\n\t\t\t\t.get(DeepNNKeysForMaps.KEY_FOR_LABEL_TO_ONE_HOT);\r\n\t\tX = MatrixUtil.T(X);\r\n\t\t// np.printshapes(X,Y_OneHot);\r\n\t\tY_OneHot = MatrixUtil.T(Y_OneHot);\r\n\t\tlayerDimenstions[layerDimenstions.length - 1] = labeltoOnhotVectorMap\r\n\t\t\t\t.size();\r\n\t\tparameters = DNNUtils.initializeParameterDeep(layerDimenstions, m,\r\n\t\t\t\tParameterInitializationType.BENGIO);\r\n\t\tint L = parameters.size() / 2;\r\n\r\n\t\tif (optimizer == DeepNNOptimizers.ADAM) {\r\n\t\t\tAdamParameters = DNNUtils.initializeAdamParameters(parameters);\r\n\t\t\tbeta1 = 0.9;\r\n\t\t\tbeta2 = 0.999;\r\n\t\t\tadamt = 2;\r\n\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; (i < numOfIterations); i++) {\r\n\r\n\t\t\tfeedForwardResult = DNNUtils\r\n\t\t\t\t\t.L_model_forward_multiClass_classification_withdropout(X,\r\n\t\t\t\t\t\t\tparameters, dropOutKeepThreshould, dropOutMap);\r\n\t\t\tactCaches = (Map<String, Object>) feedForwardResult.get(String\r\n\t\t\t\t\t.valueOf(\"actCache_\" + (L)));\r\n\t\t\tAL = (double[][]) actCaches.get(String.valueOf(\"A\"));\r\n\t\t\tcost = DNNUtils.sparse_categorial_crossentropy(m, Y_OneHot, AL);\r\n\t\t\tcostDifference = cost - previousCost;\r\n\t\t\tpreviousCost = cost;\r\n\t\t\t\r\n\t\t\tgrads = DNNUtils\r\n\t\t\t\t\t.L_model_backward_MultiClass_Classification_with_dropout(\r\n\t\t\t\t\t\t\tAL, Y_OneHot, feedForwardResult,\r\n\t\t\t\t\t\t\tdropOutKeepThreshould, dropOutMap); // here i should\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// pass both\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// cashes;\r\n\r\n\t\t\tif (optimizer == DeepNNOptimizers.ADAM) {\r\n\t\t\t\tAdamParameters = DNNUtils.updateParametersWithAdams(parameters,\r\n\t\t\t\t\t\tgrads, AdamParameters, adamt, learningRate, beta1,\r\n\t\t\t\t\t\tbeta2, IPredictionModelConstants.EPSILON);\r\n\t\t\t\tparameters = (Map<String, Object>) AdamParameters\r\n\t\t\t\t\t\t.get(DeepNNKeysForMaps.KEY_FOR_NN_PARAMETERS);\r\n\t\t\t} else {\r\n\t\t\t\tparameters = DNNUtils.updateParametersWithGD(parameters, grads,\r\n\t\t\t\t\t\tlearningRate);\r\n\t\t\t}\r\n\r\n\t\t\tif (i % 400 == 0 && iprintCost) {\r\n\t\t\t\tMatrixUtil.print(\"==============\");\r\n\t\t\t\tMatrixUtil.print(\"Cost = \" + cost);\r\n\t\t\t\t\r\n\t\t\t\tfinalPrecision = DNNUtils.accuracyForMultiClassClassification(\r\n\t\t\t\t\t\tAL, Y_OneHot);\r\n\t\t\t\t\r\n\t\t\t\tMatrixUtil.print(\"Predicted multiclass classification precision= \"\r\n\t\t\t\t\t\t+ finalPrecision);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tif (Math.abs(costDifference) < IPredictionModelConstants.EPSILON) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t\r\n\t\treturn parameters;\r\n\t}", "@Override\n\tpublic double classify(Example example) {\n\t\t// run forwards part of training algorithm on specific example\n\t\t// input to calculateForward method is ArrayList of examples, so\n\t\t// arbitrarily creating one in order to avoid duplicating code\n\t\tArrayList<Example> ex = new ArrayList<Example>();\n\t\tex.add(example);\n\t\tSystem.out.println(\"calculated: \" + calculateForward(ex).get(0) + \" label: \" + example.getLabel());\n\t\treturn (calculateForward(ex).get(0) > 0) ? 1.0 : -1.0;\n\t}", "public Polynomial(int n, double[] x, double[] y, double[] sigma) {\n\t int np1 = n + 1;\n\t // double[] parameters = new double[np1];\n\t // setParameters(parameters);\n\t double X[][] = new double[x.length][np1];\n\t for (int i = 0; i < x.length; i++) {\n\t\tdouble xi = x[i];\n\t\tdouble prod = 1.0;\n\t\tfor (int j = 0; j < np1; j++) {\n\t\t X[i][j] = prod;\n\t\t prod *= xi;\n\t\t}\n\t }\n\t double[] tmp = new double[np1];\n\t double[] tmp2 = new double[y.length];\n\t double[][] H = new double[np1][np1];\n\t Adder.Kahan adder = new Adder.Kahan();\n\t Adder.Kahan.State state = adder.getState();\n\t for (int j = 0; j < np1; j++) {\n\t\tfor (int i = 0; i < x.length; i++) {\n\t\t double si = sigma[i];\n\t\t tmp[j] += X[i][j]*y[i] / (si*si);\n\t\t}\n\t\t// tmp[j] /= sigma2;\n\t\tfor (int i = 0; i < np1; i++) {\n\t\t state.c = 0.0;\n\t\t state.total = 0.0;\n\t\t for (int k = 0; k < x.length; k++) {\n\t\t\tdouble sk = sigma[k];\n\t\t\tdouble term = (X[k][i]*X[k][j]) / (sk*sk);\n\t\t\tdouble yy = term - state.c;\n\t\t\tdouble t = state.total + yy;\n\t\t\tstate.c = (t - state.total) - yy;\n\t\t\tstate.total = t;\n\t\t }\n\t\t H[i][j] = state.total; /* / sigma2;*/\n\t\t}\n\t }\n\t for (int i = 0; i < x.length; i++) {\n\t\tdouble si = sigma[i];\n\t\ttmp2[i] = y[i]/si;\n\t\tfor (int j = 0; j < np1; j++) {\n\t\t X[i][j] /= sigma[i];\n\t\t}\n\t }\n\n\t /*\n\t TriangularDecomp decomp = new CholeskyDecomp(H, H);\n\t setDecomp(decomp);\n\t decomp.solve(parameters, tmp);\n\t */\n\t setDecomp(H);\n\t QRDecomp qr = new QRDecomp(X);\n\t setParameters(qr.solve(tmp2));\n\n\t if (x.length == np1) {\n\t\tsetChiSquare(0.0);\n\t\tsetDegreesOfFreedom(0);\n\t\tsetReducedChiSquare(Double.POSITIVE_INFINITY);\n\t\tsetVariance(0.0);\n\t\t/*\n\t\tdouble[][] cv = getCovarianceArray();\n\t\tfor (int i = 0; i < np1; i++) {\n\t\t for (int j = 0; j < np1; j++) {\n\t\t\tcv[i][j] = 0.0;\n\t\t }\n\t\t}\n\t\t*/\n\t } else {\n\t\tdouble chiSq = LeastSquaresFit.chiSquare(this, x, y, sigma);\n\t\tsetChiSquare(chiSq);\n\t\tsetDegreesOfFreedom(x.length-np1);\n\t\tsetReducedChiSquare(chiSq/(x.length-np1));\n\t }\n\t}", "double calculateAxon(ActivationFunction activationFunction);", "public void train(double learningR, int index, int i){\n\t\t \n\t\tdouble output = outputL.getIntermediateData(i)[index];\n\t\terrorGradient = output *(1-output) * outputL.getErrorGradient() * outputL.getWeights()[index];\n\t\t\t\t \n\t\t\t\t\n\t\tfor (int j = 0; j < inputs; j++) {\n\t\t\tweights[j] += delta(learningR, data[i][j], errorGradient);\n\t\t}\n\t\t\t\n\t\tthreshold += delta(learningR, -1, errorGradient);\n\t\t\t\n\t\t\t\t\n\t}", "public NeuralNet(int numLayers, int numNodesPerLayer, List<Double> input,\n\t\t\tMap<Integer, List<Double>> expectedOutput) {\n\t\tmomentum = 0.01;\n\t\tlearningRate = 0.2;\n\t\tepoch = 0;\n\t\tlayers = new ArrayList<Layer>();\n\t\tthis.expectedOutput = expectedOutput;\n\t\twhile (numLayers > 0) {\n\t\t\tlayers.add(new Layer(numNodesPerLayer));\n\t\t\tnumLayers--;\n\t\t}\n\t\taddData(input);\n\t}", "@Override\n\tpublic void learnPrior(Object[] data, double[] prob) {\n\t\tint[][] learningData = new int[data.length][];\n\t\tfor(int i = 0; i < data.length; i++) {\n\t\t\ttry {\n\t\t\t\tlearningData[i] = (int[])data[i];\n\t\t\t} catch (ClassCastException e) {\n\t\t\t\tthrow new ClassCastException(\"only accept int[][] data type\");\n\t\t\t}\n\t\t}\n\t\tthis.learnParameters(learningData);\n\t\tfor(int i = 0; i < this.getMixtureSize(); i++) {\n DirichletDistrib dirichlet = (DirichletDistrib)this.getDistrib(i); \n System.arraycopy(dirichlet.getAlpha(), 0, alpha[i], 0, this.getDomain().size());\n m[i] = this.getWeights(i);\n\t\t}\n\t}", "private void trainOnSamples() {\n for (Sample sample : samples) {\n double sum = 0;\n \n for (int i = 0; i < weights.length; i++) { //calculating w1.x1 + w2.x2 + ... \n sum += weights[i] * sample.getP()[i];\n }\n sum += bias; //adding bias to the sum\n\n if (!compareOutput(sum, sample)) { //compare network & target output\n //updating the weights\n for (int i = 0; i < weights.length; i++) {\n weights[i] += sample.getTarget() * sample.getP()[i];\n }\n //updating the bias\n bias += sample.getTarget();\n sample.setValidation(false);\n } else {\n sample.setValidation(true);\n }\n }\n }", "public int predict(int[] testingData) {\n\t\t// HIDDEN LAYER\n\t\tdouble[] hiddenActivations = new double[SIZE_HIDDEN_LAYER];\n\t\t\n\t\tfor(int indexHidden = 0; indexHidden < SIZE_HIDDEN_LAYER; indexHidden++) {\n\t\t\thiddenActivations[indexHidden] = 0;\n\t\t\tfor(int indexInput = 0; indexInput < SIZE_INPUT_LAYER; indexInput++) {\n\t\t\t\thiddenActivations[indexHidden] += weightsOfHiddenLayer[indexHidden][indexInput] * testingData[indexInput];\n\t\t\t}\t\n\t\t\thiddenActivations[indexHidden] += biasOfHiddenLayer[indexHidden];\n\t\t\thiddenActivations[indexHidden] = tanh(hiddenActivations[indexHidden]);\n\t\t}\n\t\t// OUTPUT LAYER \n\t\tdouble[] predictedLabel = new double[testingData.length];\n\n\t\tfor(int i = 0; i < SIZE_OUTPUT_LAYER; i++) {\n\t\t\tpredictedLabel[i] = 0;\n\n\t\t\tfor(int j = 0; j < SIZE_HIDDEN_LAYER; j++) {\n\t\t\t\tpredictedLabel[i] += weightsOfOutputLayer[i][j] * hiddenActivations[j];\n\t\t\t}\n\t\t\tpredictedLabel[i] += biasOfOutputLayer[i]; \n\t\t}\n\t\tsoftmax(predictedLabel);\n\t\tint solution = argmax(predictedLabel);\n\t\treturn solution;\n\t}", "void BP(Double learningRate){ //call BP() on each neuron except Bias Neuron\n for (int i = 0; i < neurons.size() -1; i++){\n neurons.get(i).BP(learningRate);\n }\n }", "Classifier getClassifier();", "public void calculateGradients(int dataIndex, double learningRate){\r\n for (int i = 0; i < outputLayer.length; i++) {\r\n for (int j = 0; j < outputLayer[i].weights.length; j++) {\r\n outputLayer[i].dw[j] = -2*((attribute[dataIndex] == i ? 1 : 0) - sigmoid(outputLayer[i].z))*sigmoidDeri(outputLayer[i].z)*outputLayer[i].data[j];\r\n }\r\n outputLayer[i].db = -2*((attribute[dataIndex] == i ? 1 : 0) - sigmoid(outputLayer[i].z))*sigmoidDeri(outputLayer[i].z);\r\n }\r\n\r\n adjust(learningRate, true);\r\n calculateDesireHiddenLayerActivation(dataIndex);\r\n\r\n for (int i = 0; i < hiddenLayer.length; i++) {\r\n for (int j = 0; j < hiddenLayer[i].weights.length; j++) {\r\n hiddenLayer[i].dw[j] = -2*(desireHiddenLayerActivation[i] - hiddenLayer[i].a)*sigmoidDeri(hiddenLayer[i].z)*hiddenLayer[i].data[j];\r\n }\r\n hiddenLayer[i].db = -2*(desireHiddenLayerActivation[i] - hiddenLayer[i].a)*sigmoidDeri(hiddenLayer[i].z);\r\n }\r\n\r\n adjust(learningRate, false);\r\n }", "public int objective() {\n\t\tint value = 0;\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tvalue += v[i] * x[i];\n\t\treturn value;\n\t}", "@Override\r\n\tpublic DataContainer forwardProp(DataContainer forwardPropData, boolean training) {\n\t\tMat input = forwardPropData.getVec(); \r\n\t\t\r\n\t\tif (!set) {\r\n\t\t\tinputWeight = Mat.randomMatrix(input.size[1] + 1, fout, - 0.3, 0.3); \r\n\t\t\tset = true; \r\n\t\t}\r\n\t\t\r\n\t\tMat inputBiased = (input).appendRight(new Mat(1,1,1)); \r\n\t\tMat output = inputBiased.mul(inputWeight); \r\n\t\tif (training) {\r\n\t\t\tlastInputBiased = inputBiased; \r\n\t\t}\r\n\t\telse {\r\n\t\t\tlastInputBiased = null; \r\n\t\t}\r\n\t\t\r\n\t\treturn new DataContainer(output); \r\n\t}", "public double[][] activateFunction(){\n\t\n\t\tboolean run = true;\n\t\tint count = 0;\n\t\tdouble[][] output = null;\n\t\twhile(run){\n\t\t\toutput = sign(subtract(multiply(weights, entryCoord), thresholds));\n\t\t\t\tfor(int i = 0; i < trainingList.size(); i++){\n\t\t\t\t\tfor(int j = 0; j < (XDIMENSION * YDIMENSION); j++){\n\t\t\t\t\t\tif(trainingList.get(i)[j][0] == output[j][0]){\n\t\t\t\t\t\t\tcount++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(count == (XDIMENSION * YDIMENSION)){\n\t\t\t\t\t\t\trun = false;\n\t\t\t\t\t\t\tfor(int k = 0; k < output.length; k++){\n\t\t\t\t\t\t\t\tSystem.out.print(output[k][0] + \" \");\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcount = 0;\n\t\t\t\t}\t\n\t\n\t\t}\n\t\treturn makeGrid(output);\n\t}", "protected void createWeightMatrix(Folksonomy trainingData) throws Exception\n\t{\n\t\tint i, j, k;\n\t\tint num_tag = trainingData.numTags();\n\t\tint num_user = trainingData.numUsers();\n\t\tint num_item = trainingData.numItems();\n\t\tint num_temp, itemIndex, tagIndex;\n\t\tUserTagProfile utp;\n\t\tAnnotatedItem ai;\n\t\tArrayList<Integer> tags;\n\t\tweight_ti = new SparseMatrix(num_tag, num_item);\n\t\tweight_ut = new SparseMatrix(num_user, num_tag);\n\t\tint[] t_sum = new int[num_tag];\n\t\tint[] u_sum = new int[num_user];\n\t\tfor (i = 0; i < num_user; i++)\n\t\t{\n\t\t\tutp = trainingData.getUserProfile(trainingData.getUserByIndex(i));\n\t\t\tnum_temp = utp.numItems();\n\t\t\tfor (j = 0; j < num_temp; j++)\n\t\t\t{\n\t\t\t\tai = utp.getAnnotatedItem(j);\n\t\t\t\ttags = ai.getTags();\n\t\t\t\titemIndex = trainingData.getItemIndex(ai.getItemId());\n\t\t\t\tfor (k = 0; k < tags.size(); k++)\n\t\t\t\t{\n\t\t\t\t\ttagIndex = trainingData.getTagIndex(tags.get(k));\n\t\t\t\t\tt_sum[tagIndex] += 1;\n\t\t\t\t\tweight_ti.set(tagIndex, itemIndex,\n\t\t\t\t\t\t\tweight_ti.at(tagIndex, itemIndex) + 1);\n\t\t\t\t\tweight_ut.set(i, tagIndex, weight_ut.at(i, tagIndex) + 1);\n\t\t\t\t}\n\t\t\t\tu_sum[i] += ai.numTags();\n\t\t\t}\n\t\t}\n\t\tfor (i = 0; i < num_tag; i++)\n\t\t{\n\t\t\tfor (j = 0; j < num_item; j++)\n\t\t\t{\n\t\t\t\tif (weight_ti.containRowCol(i, j))\n\t\t\t\t\tweight_ti.set(i, j, weight_ti.at(i, j) / t_sum[i]);\n\t\t\t}\n\t\t\tfor (k = 0; k < num_user; k++)\n\t\t\t{\n\t\t\t\tif (weight_ut.containRowCol(k, i))\n\t\t\t\t\tweight_ut.set(k, i, weight_ut.at(k, i) / u_sum[k]);\n\t\t\t}\n\t\t}\n\t\t\n\t}", "void add(Vector x, double pcxi) {\n A.ensure(pcxi >= 0 && pcxi <= 1., \"pcxi >= 0 && pcxi <= 1.\");\n\n Vector weightedVector = x.times(pcxi);\n if (weightedXsSum == null)\n weightedXsSum = weightedVector;\n else\n weightedXsSum = weightedXsSum.plus(weightedVector);\n\n pcxiSum += pcxi;\n rowCount += 1;\n }" ]
[ "0.74658084", "0.7153421", "0.71528596", "0.6784588", "0.67029476", "0.6308507", "0.6227396", "0.618563", "0.6175156", "0.61550665", "0.60143244", "0.58034253", "0.56324476", "0.53418416", "0.53201884", "0.52975976", "0.5163601", "0.51106817", "0.50849354", "0.50377923", "0.50154185", "0.49964052", "0.49948984", "0.49674502", "0.49170464", "0.48972803", "0.4852247", "0.48482874", "0.48402926", "0.4820023", "0.48136628", "0.48076287", "0.4798391", "0.47906452", "0.47730696", "0.4751096", "0.47363362", "0.47339067", "0.47327176", "0.47212887", "0.4720856", "0.46911544", "0.46697184", "0.46564174", "0.46529788", "0.4651709", "0.46497", "0.4644964", "0.4635485", "0.46351916", "0.46347466", "0.4633583", "0.46304715", "0.46219537", "0.46083143", "0.46010432", "0.45897993", "0.45784816", "0.45676807", "0.45521906", "0.4539393", "0.45203888", "0.45179445", "0.45152918", "0.45110247", "0.45048052", "0.44901896", "0.44852865", "0.4474722", "0.44706786", "0.44676265", "0.44540864", "0.445088", "0.44417134", "0.44407654", "0.44363293", "0.44309312", "0.44252852", "0.44215268", "0.4413876", "0.44061312", "0.4395971", "0.43927088", "0.4391948", "0.43610668", "0.43542898", "0.4352779", "0.43485913", "0.43402362", "0.43369332", "0.43278557", "0.43256894", "0.43237028", "0.43232456", "0.4317548", "0.43156624", "0.43138495", "0.43080297", "0.43029562", "0.42864913" ]
0.45157638
63
A PerceptronClassifier uses a hard 0/1 threshold.
public double threshold(double z) { // This must be implemented by you if(z>=0) { return 1; }else { return 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void trainPerceptron() {\n\t\t// Creates a log of that contains the percentage each epoch got correct\n\t\tint numWrong = images.size();\n\t\tint numReps = 0;\n\n\t\t// Repeat the training process TIMES_TO_REPEAT number of times or until\n\t\t// there are none wrong\n\t\tfor (int repetition = 0; repetition < TIMES_TO_REPEAT && numWrong != 0; repetition++) {\n\t\t\tint numCorrect = 0;\n\n\t\t\t// Iterate through each image in the set of image\n\t\t\tfor (PerceptronImage image : images) {\n\t\t\t\tdouble netInput = 0;\n\n\t\t\t\t// Work out the net input by evaluating each feature on the\n\t\t\t\t// image\n\t\t\t\tfor (Feature feature : features) {\n\t\t\t\t\tnetInput += feature.evaluate(image) * feature.getWeight();\n\t\t\t\t}\n\n\t\t\t\t// If the image is evaluated to be an X\n\t\t\t\tif (netInput <= 0) {\n\t\t\t\t\t// If it actually is an X then record it\n\t\t\t\t\tif (image.isX()) {\n\t\t\t\t\t\tnumCorrect++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If it is not then re-weight features\n\t\t\t\t\t\tfor (Feature feature : features) {\n\t\t\t\t\t\t\tdouble newWeight = feature.getWeight()\n\t\t\t\t\t\t\t\t\t+ feature.evaluate(image) * learningRate;\n\t\t\t\t\t\t\tfeature.setWeight(newWeight);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// If the image is evaluated to be not an X\n\t\t\t\t\t// If it actually not an X then record it\n\t\t\t\t\tif (!image.isX()) {\n\t\t\t\t\t\tnumCorrect++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If it is not then re-weight features\n\t\t\t\t\t\tfor (Feature feature : features) {\n\t\t\t\t\t\t\tdouble newWeight = feature.getWeight()\n\t\t\t\t\t\t\t\t\t- feature.evaluate(image) * learningRate;\n\t\t\t\t\t\t\tfeature.setWeight(newWeight);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Update the number of images wrong for this epoch\n\t\t\tnumWrong = images.size() - numCorrect;\n\n\t\t\t// Modify the learning rate\n\t\t\tif (learningRate > LEARNING_RATE_MINIMUM) {\n\t\t\t\tlearningRate *= LEARNING_RATE_MODIFIER;\n\t\t\t}\n\n\t\t\tnumReps++;\n\t\t}\n\n\t\ttry {\n\t\t\tPrintWriter writer = new PrintWriter(\"output.txt\");\n\t\t\t\n\t\t\t// Print out the number of repetitions if the perceptron converged,\n\t\t\t// otherwise print out the number of images that are still classified\n\t\t\t// incorrectly\n\t\t\tif (numWrong == 0) {\n\t\t\t\twriter.println(\"Perceptron converged\");\n\t\t\t\twriter.println(\"Number of repetitions: \" + numReps);\n\t\t\t\tSystem.out.println(\"Perceptron converged\");\n\t\t\t\tSystem.out.println(\"Number of repetitions: \" + numReps);\n\t\t\t} else {\n\t\t\t\twriter.println(\"Perceptron did not converge\");\n\t\t\t\twriter.println(\"Number of images still incorrect: \" + numWrong);\n\t\t\t\tSystem.out.println(\"Perceptron did not converge\");\n\t\t\t\tSystem.out.println(\"Number of images still incorrect: \" + numWrong);\n\t\t\t}\n\n\t\t\twriter.println(\"\\nEnding learning Rate: \" + learningRate + \"\\n\");\n\t\t\tSystem.out.println(\"\\nEnding learning Rate: \" + learningRate + \"\\n\");\n\t\t\t\n\t\t\tfor (Feature feature : features){\n\t\t\t\tSystem.out.println(feature.toString());\n\t\t\t\twriter.println(feature.toString());\n\t\t\t}\n\t\t\twriter.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void trainPerceptrons(){\n double activationValues[] = new double[4];\n for(Image image:asciiReader.getTrainingImages()){\n for (int j = 0 ; j < activationValues.length; j++){\n activationValues[j] = activationFunction\n .apply(sumWeights(j,image));\n }\n adjustWeights(activationValues,image);\n }\n }", "public Perceptron(String filename) {\n\t\twidth = DEFAULT_WIDTH;\n\t\theight = DEFAULT_HEIGHT;\n\t\tlearningRate = INITIAL_LEARNING_RATE;\n\t\tFile file = new File(filename);\n\t\tloadImages(file);\n\t\tcreateFeatures();\n\t\ttrainPerceptron();\n\t}", "public static Double[] learnSimplePerceptronRound2(Data data1[],int index,double LearningRate,Double w[],HashMap<Integer, Integer> words)\r\n \t{\r\n \t\t//Double w[] = new Double[20]; \r\n \t/*\tDouble min =-0.01; // Set To Your Desired Min Value\r\n\t Double max = 0.01;\r\n \t\tdouble smallRandNumber = min + new Random().nextDouble() * (max - min); \r\n \t\tArrays.fill(w, smallRandNumber);*/\r\n \t\t\r\n \t\tData data[] = Arrays.copyOf(data1,index);\r\n \t\t\r\n \t\t//shuffle the data..\r\n \t \tArrayList<Data> arrayList = new ArrayList<Data>(Arrays.asList(Arrays.copyOf(data,index))); \r\n \t\tCollections.shuffle(arrayList,new Random(10));\r\n \t\tdata = arrayList.toArray(new Data[arrayList.size()]);\r\n \t\tfor(int i=0;i<index;i++)\r\n \t\t{\r\n \t\t\tdouble trueLabel;\r\n \t\t\tdouble predictedLabel;\r\n \t\t\tdouble dotProduct_wT_x = 0.0f;\r\n \t\t\tHashMap<Integer, Double> x = new HashMap<Integer, Double>();\r\n \t\t \r\n \t\t\ttrueLabel = data[i].getY();\r\n \t\t\tx= data[i].getX();\r\n \t\t\tboolean correct=false;\r\n \t\t\t// loop till its corrects..\r\n \t\t\t\r\n \t\t\twhile(correct==false)\r\n \t\t\t{\r\n \t\t\t//wT*x (contains bias)\r\n \t\t\tfor (Map.Entry<Integer, Double> entry : x.entrySet()) {\r\n \t\t\t\tdotProduct_wT_x = dotProduct_wT_x + w[entry.getKey()] * entry.getValue();\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t//predict the label\r\n \t\t\tif(dotProduct_wT_x < 0)\r\n \t\t\t\tpredictedLabel = -1;\r\n \t\t\telse\t\r\n \t\t\t\tpredictedLabel = +1;\r\n \t\t\t\r\n \t\t\t//check if prediction is correct, if not update the weight vector and bias.\r\n \t\t\tif(predictedLabel != trueLabel)\r\n \t\t//\tif(dotProduct_wT_x<0)\r\n \t\t\t{\r\n \t\t\t\t//update bias\r\n \t\t\t\tw[0]=w[0]+trueLabel*LearningRate;\r\n \t\t\t\t\r\n \t\t\t\t//update all other weights only if those words are worthy tracking\r\n \t\t\t\r\n \t\t\t\tfor(int j=1;j<w.length;j++)\r\n \t\t\t\t{\r\n \t\t\t\t\t// if(x.containsKey(j))\r\n \t\t\t\t if(x.containsKey(j))\r\n \t\t\t\t//\t if(words.containsKey(j)) //give more weightage to words that matter\r\n \t\t\t//\t\t\t\tw[j]=w[j]+LearningRate*trueLabel*(x.get(j));\r\n \t\t\t\t//\t else\r\n\t\t\t\t\t\t\tw[j]=w[j]+LearningRate*trueLabel*x.get(j);\r\n\r\n \t\t\t\t//\telse\r\n \t\t\t//\t\t\tw[j]=(double)0;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\telse\r\n \t\t\t\tcorrect=true;\r\n \t\t }\r\n \t\t}\r\n \t\treturn w;\r\n \t}", "public static void test(ArrayList<Image> img){\n\t\t\n\t\tdouble avCutoff = 0;\n\t\tdouble avAcc = 0 ;\n\t\tdouble adjCut = 0;\n\t\tint n = 100;\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tPerceptron p = new Perceptron(img);\n\t\t\tp.start();\n\t\t\tavCutoff = avCutoff + p.cuttoff;\n\t\t\tavAcc = avAcc + p.Acc;\n\t\t\tif(p.cuttoff < 1000){adjCut = adjCut + p.cuttoff;}\n\t\t}\n\t\tSystem.out.println(\"Average cut-off of all runs: \" + (avCutoff/n));\n\t\tSystem.out.println(\"Average accuracy: \" + (avAcc/n));\n\t\tSystem.out.println(\"Average accuracy of successful runs: \" + (adjCut/n));\n\t}", "public static void runMarginPerceptron(Data[] data, int index,String testFileName,HashMap<Integer,Integer> words)\r\n{\r\n int t=0;\r\n double LearningRates[] = {1, 0.1, 0.01};\r\n double Margins[] = {1, 0.1, 0.01};\r\n\r\n\tint minInt =0; // Set To Your Desired Min Value\r\n int maxInt =2;\r\n\tRandom rand = new Random();\r\n\t\r\n \tint randomNum = rand.nextInt((maxInt - minInt) + 1) + minInt;\r\n\r\n \tdouble LearningRate = LearningRates[randomNum];\r\n \t\r\nfor(int m=0;m<LearningRates.length;m++)\r\n{\r\n for(int i=0;i<LearningRates.length;i++)\r\n {\r\n\t LearningRate = LearningRates[i];\r\n\t\t double devAccuracyTotal = (double)0;\r\n\t\t int noOfEpochs= 20;\r\n\t\t int decreaseRate = 0;\r\n\t\t \r\n \t\t Double w[] = new Double[74500];\r\n\t\t Double min =-0.01; // Set To Your Desired Min Value\r\n\t Double max = 0.01;\r\n\t \t\tdouble smallRandNumber = min + new Random().nextDouble() * (max - min); \r\n\t\t\tArrays.fill(w, smallRandNumber);\r\n\t\t\t\r\n\t\t for(int epoch=0;epoch<noOfEpochs;epoch++)\r\n\t\t {\r\n\t\t\t \tw = learnMarginPerceptron(data,index,LearningRate,decreaseRate,w,Margins[m]);\r\n\t\t\t \tdecreaseRate = decreaseRate + index;\r\n\t\t\r\n\t\t }\r\n\t\t//CVSplit test\r\n \tdouble cvAccuracy = testTestFile(w,testFileName,words);\r\n \t\r\n// \tSystem.out.println(\"Epoch\" + epoch +\" Dev Accuracy for Decaying Learning Rate \" + LearningRate + \" is \" + cvAccuracy);\r\n \r\n \r\n \tSystem.out.println(\" ** Cv Accuracy for Margin Rate\" + Margins[m] + \" Learning Rate \" + LearningRate + \" is \" + cvAccuracy);\r\n \tSystem.out.println(\" \");\r\n }\r\n}\r\n//double testAccuracy = testTestFile(w,testFileName);\r\n\t//System.out.println(\"test Accuracy\" + testAccuracy);\r\n}", "public static Double[] learnSimplePerceptron(Data data1[],int index,double LearningRate,Double w[],HashMap<Integer, Integer> words)\r\n \t{\r\n \t\t\r\n \t\tData data[] = Arrays.copyOf(data1,index);\r\n \t\t\r\n \t\t//shuffle the data..\r\n \t \tArrayList<Data> arrayList = new ArrayList<Data>(Arrays.asList(Arrays.copyOf(data,index))); \r\n \t\tCollections.shuffle(arrayList,new Random(10));\r\n \t\tdata = arrayList.toArray(new Data[arrayList.size()]);\r\n \t\tfor(int i=0;i<index;i++)\r\n \t\t{\r\n \t\t\tdouble trueLabel;\r\n \t\t\tdouble predictedLabel;\r\n \t\t\tdouble dotProduct_wT_x = 0.0f;\r\n \t\t\tHashMap<Integer, Double> x = new HashMap<Integer, Double>();\r\n \t\t \r\n \t\t\ttrueLabel = data[i].getY();\r\n \t\t\tx= data[i].getX();\r\n \t\t\t \r\n \t\t\t\r\n \t\t \r\n \t\t\t//wT*x (contains bias)\r\n \t\t\tfor (Map.Entry<Integer, Double> entry : x.entrySet()) {\r\n \t\t\t\tdotProduct_wT_x = dotProduct_wT_x + w[entry.getKey()] * entry.getValue();\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t//predict the label\r\n \t\t\tif(dotProduct_wT_x < 0)\r\n \t\t\t\tpredictedLabel = -1;\r\n \t\t\telse\t\r\n \t\t\t\tpredictedLabel = +1;\r\n \t\t\t\r\n \t\t\t//check if prediction is correct, if not update the weight vector and bias.\r\n \t\t\tif(predictedLabel != trueLabel)\r\n \t\t//\tif(dotProduct_wT_x<0)\r\n \t\t\t{\r\n \t\t\t\t//update bias\r\n \t\t\t\tw[0]=w[0]+trueLabel*LearningRate;\r\n \t\t\t\t\r\n \t\t\t\t\r\n \t\t\t\t//update all other weights only if those words are worthy tracking\r\n \t\t\t\r\n \t\t\t\tfor(int j=1;j<w.length;j++)\r\n \t\t\t\t{\r\n \t\t\t\t\t// if(x.containsKey(j))\r\n \t\t\t\t if(x.containsKey(j))\r\n \t\t\t \t//\t if(words.containsKey(j)) //give more weightage to words that matter\r\n \t\t \t\t\t \tw[j]=w[j]+LearningRate*trueLabel*x.get(j);\r\n\r\n \t\t\t\t//\telse\r\n \t\t\t//\t\t\tw[j]=(double)0;\r\n \t\t\t\t \r\n \t\t\t\r\n \t\t\t\t \r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t \r\n \t\t}\r\n \t\treturn w;\r\n \t}", "public Precision() {\n\t\tthis.threshold = 1.0;\n\t}", "public static void runDecayingRatePerceptron(Data[] data, int index,String testFileName,HashMap<Integer,Integer> words)\r\n{\r\nint t=0;\r\ndouble LearningRates[] = {1, 0.1, 0.01};\r\n\tint minInt =0; // Set To Your Desired Min Value\r\n int maxInt =2;\r\n\tRandom rand = new Random();\r\n\t\r\n\tint randomNum = rand.nextInt((maxInt - minInt) + 1) + minInt;\r\n\r\n\tdouble LearningRate = LearningRates[randomNum];\r\n\t\r\n\t\r\nfor(int i=0;i<LearningRates.length;i++)\r\n{\r\nLearningRate = LearningRates[i];\r\ndouble devAccuracyTotal = (double)0;\r\nint noOfEpochs= 20;\r\nint decreaseRate = 0;\r\n\r\n\tDouble w[] = new Double[74500];\r\n\tDouble min =-0.01; // Set To Your Desired Min Value\r\nDouble max = 0.01;\r\n\t\tdouble smallRandNumber = min + new Random().nextDouble() * (max - min); \r\n\t\tArrays.fill(w, smallRandNumber);\r\n\t\t\r\nfor(int epoch=0;epoch<noOfEpochs;epoch++)\r\n{\r\n\t \tw = learnDecayingPerceptron(data,index,LearningRate,decreaseRate,w);\r\n\t \tdecreaseRate = decreaseRate + index;\r\n\r\n}\r\n// \tfor(int i=0;i<w.length;i++)\r\n// \t\t\tSystem.out.println(w[i]);\r\n//print data \t\r\n// \tfor (Map.Entry<Integer, Double> entry : x.entrySet()) {\r\n// System.out.println(\"\"+entry.getKey() + \" \" + entry.getValue());\r\n//\t \t}\r\n \t \t\r\n\t//keep decreaseRate increasing across epochs, by increasing 1 for each example.\r\n\tdouble cvAccuracy = testTestFile(w,testFileName,words);\r\n\t\r\n//\tSystem.out.println(\"Epoch\" + epoch +\" Dev Accuracy for Decaying Learning Rate \" + LearningRate + \" is \" + cvAccuracy);\r\n\r\n\r\nSystem.out.println(\" ** Cv Accuracy for Decaying Learning Rate \" + LearningRate + \" is \" + cvAccuracy);\r\nSystem.out.println(\" \");\r\n}\r\n\r\n//double testAccuracy = testTestFile(w,testFileName);\r\n\t//System.out.println(\"test Accuracy\" + testAccuracy);\r\n}", "public List<Double> trainPerceptronClassifier(int noOfIterations, double eenta, List<Double> tempWeights) throws FileNotFoundException {\n populateVocabularyList();\n System.out.println(\"The size of vocabulary is: \" + vocabularyList.size());\n //Populate the wordCount for Spam and Ham files\n populateWordCount();\n\n if(tempWeights == null)\n {\n tempWeights = new ArrayList<>();\n for(int i=0; i<weights.size(); i++)\n {\n tempWeights.add(weights.get(i)); \n }\n }\n else\n {\n weights = new ArrayList<>(tempWeights);\n }\n\n int iterationsSoFar;\n for(double ecount = 0.3 ; ecount < eenta; ecount = ecount+0.03)\n {\n iterationsSoFar = 5;\n trainFromExamples(iterationsSoFar, ecount);\n for(int count = 1; iterationsSoFar <= noOfIterations; count=count+1)\n {\n iterationsSoFar = iterationsSoFar + 1;\n //Train the weights on the ham record\n trainFromExamples(1, ecount);\n double[] value = returnAccuracy();\n System.out.println(\"Iterations:\"+ iterationsSoFar +\" Eenta:\" + ecount + \" Stop Words removed:\" + stopListEnable);\n System.out.println(\"SPAM ACCURACY:\" + value[0]);\n System.out.println(\"HAM ACCURACY:\" + value[1]);\n }\n weights = new ArrayList<>(tempWeights);\n }\n return tempWeights;\n }", "public static Double[] learnSimplePerceptronWords(Data data1[],int index,double LearningRate,Double w[],HashMap<Integer, Integer> words)\r\n \t{\r\n \t\t\r\n \t\tData data[] = Arrays.copyOf(data1,index);\r\n \t\t\r\n \t\t//shuffle the data..\r\n \t \tArrayList<Data> arrayList = new ArrayList<Data>(Arrays.asList(Arrays.copyOf(data,index))); \r\n \t\tCollections.shuffle(arrayList,new Random(10));\r\n \t\tdata = arrayList.toArray(new Data[arrayList.size()]);\r\n \t\tfor(int i=0;i<index;i++)\r\n \t\t{\r\n \t\t\tdouble trueLabel;\r\n \t\t\tdouble predictedLabel;\r\n \t\t\tdouble dotProduct_wT_x = 0.0f;\r\n \t\t\tHashMap<Integer, Double> x = new HashMap<Integer, Double>();\r\n \t\t \r\n \t\t\ttrueLabel = data[i].getY();\r\n \t\t\tx= data[i].getX();\r\n \t\t\t \r\n \t\t\t\r\n \t\t \r\n \t\t\t//wT*x (contains bias)\r\n \t\t\tfor (Map.Entry<Integer, Double> entry : x.entrySet()) {\r\n \t\t\t\tdotProduct_wT_x = dotProduct_wT_x + w[entry.getKey()] * entry.getValue();\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t//predict the label\r\n \t\t\tif(dotProduct_wT_x < 0)\r\n \t\t\t\tpredictedLabel = -1;\r\n \t\t\telse\t\r\n \t\t\t\tpredictedLabel = +1;\r\n \t\t\t\r\n \t\t\t//check if prediction is correct, if not update the weight vector and bias.\r\n \t\t\tif(predictedLabel != trueLabel)\r\n \t\t//\tif(dotProduct_wT_x<0)\r\n \t\t\t{\r\n \t\t\t\t//update bias\r\n \t\t\t\tw[0]=w[0]+trueLabel*LearningRate;\r\n\r\n \t\t\t\t\r\n \t\t\t\t//update all other weights only if those words are worthy tracking\r\n \t\t\t\r\n \t\t\t\tfor(int j=1;j<w.length;j++)\r\n \t\t\t\t{\r\n \t\t\t\t\t// if(x.containsKey(j))\r\n \t\t\t\t if(x.containsKey(j))\r\n \t\t\t \t if(words.containsKey(j)) //give more weightage to words that matter updates only when keyword found\r\n \t\t \t\t\t \tw[j]=w[j]+LearningRate*trueLabel*x.get(j);\r\n\r\n \t\t\t\t//\telse\r\n \t\t\t//\t\t\tw[j]=(double)0;\r\n \t\t\t\t \r\n \t\t\t\t\r\n \t\t\t\t \r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t \r\n \t\t}\r\n \t\treturn w;\r\n \t}", "private double getMinInitProb(){\r\n\t\treturn probThreshold;\r\n\t}", "@Override\r\n\tpublic int predict(double[] x, double[] posteriori) {\n\t\treturn 0;\r\n\t}", "Classifier getClassifier();", "public double compute(ClassifierSetPoint point) {\n return point.getThreshold();\n }", "public void FeedForward() {\r\n\t\tfor (int i = 0; i < Node.length; i++) {\r\n\t\t\tNet = Node[i].Threshold;\r\n\r\n\t\t\tfor (int j = 0; j < Node[i].Weight.length; j++)\r\n\t\t\t\tNet = Net + Input[j] * Node[i].Weight[j];\r\n\r\n\t\t\tNode[i].Output = Sigmoid(Net);\r\n\t\t}\r\n\t}", "public ThresholdActivationFunction(double threshold) {\n this.threshold = threshold;\n }", "public static void train(MultiLayerPerceptron mlp, int epochs){\n for(int i = 0; i < epochs; i++){\n /**\n * Randomize the order of the samples.\n */\n trainingSet.shuffle();\n for(int j = 0; j < trainingSet.getTests().size(); j++){\n ArrayList<Float> actualOutput = mlp.calculateOutput(trainingSet.getInput(j));\n ArrayList<Float> expectedOutput = trainingSet.getOutput(j);\n\n mlp.modifyWeights(actualOutput,expectedOutput);\n }\n }\n }", "Builder extremeSpikeProbability(double p);", "@Test(timeout = 4000)\n public void test63() throws Throwable {\n NaiveBayesMultinomialText naiveBayesMultinomialText0 = new NaiveBayesMultinomialText();\n naiveBayesMultinomialText0.setPeriodicPruning(4);\n StringKernel stringKernel0 = new StringKernel();\n naiveBayesMultinomialText0.m_minWordP = (double) 0;\n Capabilities capabilities0 = stringKernel0.getCapabilities();\n TestInstances testInstances0 = TestInstances.forCapabilities(capabilities0);\n Instances instances0 = testInstances0.generate();\n naiveBayesMultinomialText0.buildClassifier(instances0);\n assertEquals(4, naiveBayesMultinomialText0.getPeriodicPruning());\n }", "@Override\n\tpublic double classify(Example example) {\n\t\t// run forwards part of training algorithm on specific example\n\t\t// input to calculateForward method is ArrayList of examples, so\n\t\t// arbitrarily creating one in order to avoid duplicating code\n\t\tArrayList<Example> ex = new ArrayList<Example>();\n\t\tex.add(example);\n\t\tSystem.out.println(\"calculated: \" + calculateForward(ex).get(0) + \" label: \" + example.getLabel());\n\t\treturn (calculateForward(ex).get(0) > 0) ? 1.0 : -1.0;\n\t}", "public PerceptronImage load(Scanner f) {\n\t\tboolean[][] newImage = null;\n\t\tboolean isX = false;\n\t\tjava.util.regex.Pattern bit = java.util.regex.Pattern.compile(\"[01]\");\n\t\tif (!f.next().equals(\"P1\"))\n\t\t\tSystem.out.println(\"Not a P1 PBM file\");\n\t\tString category = f.next().substring(1);\n\t\tif (!category.equals(\"other\"))\n\t\t\tisX = true;\n\t\tint rows = f.nextInt();\n\t\tint cols = f.nextInt();\n\n\t\tnewImage = new boolean[rows][cols];\n\t\tfor (int r = 0; r < rows; r++) {\n\t\t\tfor (int c = 0; c < cols; c++) {\n\t\t\t\tnewImage[r][c] = (f.findWithinHorizon(bit, 0).equals(\"1\"));\n\t\t\t}\n\t\t}\n\n\t\treturn new PerceptronImage(newImage, isX);\n\t}", "@Override\n\tpublic float getZeroLinearSpeedThreshold() {\n\t\treturn 0;\n\t}", "public FFANNAdaptiveBackPropagationJSP()\n\t{\n\t\t//run(network, numberInputNeurons, numberHiddenNeurons, numberOutputNeurons, trainingSet);\n\t}", "public int getNumberOfPredictors()\n {\n return 1;\n }", "@Test(timeout = 4000)\n public void test00() throws Throwable {\n NaiveBayesMultinomialText naiveBayesMultinomialText0 = new NaiveBayesMultinomialText();\n naiveBayesMultinomialText0.setPeriodicPruning((-1));\n naiveBayesMultinomialText0.pruneDictionary();\n assertEquals((-1), naiveBayesMultinomialText0.getPeriodicPruning());\n }", "void setThreshold(float value);", "float getThreshold();", "@Override\n\tpublic double probability() {\n\t\treturn 0;\n\n\t}", "@Override\n\tpublic double classifyInstance(Instance arg0) throws Exception {\n\t\treturn 0;\n\t}", "private RegressionPrior() { \n /* empty constructor */\n }", "void setExtremeSpikeProbability(double p);", "public SVMPolynomialClassifier() {\r\n\t\tsuper();\r\n\r\n\t\tsetKernelType(new SelectedTag(kernelType, LibSVM.TAGS_KERNELTYPE));\r\n\t}", "public void setThreshold(double t)\n {\n this.threshold = t;\n }", "private void evaluationLogic() {\n // setup for logic:\n // if distToClosestEstimate[i][0] is smaller than threshold, we have a Tp\n // if distToClosestEstimate[i][0] is larger than threshold, we have a Fn\n // all estimatedFeatures that are not assigned Tp are therefore Fp\n for (int i = 0; i < groundTruthInstant.size(); ++i) {\n if (distToClosestEstimate[i][0] < truePositiveThreshold) {\n ++truePositiveCount;\n int assignedEstimatedFeature = (int) distToClosestEstimate[i][1];\n assignedEstimatedFeatures[assignedEstimatedFeature] = true;\n } else\n ++falseNegativeCount;\n }\n for (int i = 0; i < estimatedInstant.size(); ++i)\n if (!assignedEstimatedFeatures[i])\n ++falsePositiveCount;\n }", "public double getObjective() {\n return multiClassClassifierObj() + binaryObj();\n// +(1-temperature)*getEntropy();\n }", "@Override\n\tpublic void setZeroLinearSpeedThreshold(float value) {\n\t\t\n\t}", "public RandomSubVectorThresholdLearnerTest(\n String testName)\n {\n super(testName);\n\n this.random = new Random();\n }", "private void adjustWeights(double activationValues[],Image image){\n\n for(int i=0;i<perceptrons.size();i++){\n for(int j=0;j<4;j++) {\n if ((j + 1) == image.getEmotion()) {\n perceptrons.get(i).adjustWeight(j, learningValue\n , 1, activationValues[j]\n ,normalizeImageValue(image.getImage()[i]));\n } else {\n perceptrons.get(i).adjustWeight(j, learningValue\n , 0, activationValues[j]\n ,normalizeImageValue(image.getImage()[i]));\n }\n }\n }\n\n }", "private Classifier createDummyClassifier(String action, String con, Classifier[] parent_classifier ){\n String cName = \"DUMMY\";\n Classifier father = parent_classifier[0];\n Classifier mother = parent_classifier[1];\n double newPred = (father.getPrediction() + mother.getPrediction()) / 2;\n double newPreErr = (father.getPredictionError() + mother.getPredictionError()) / 2;\n double newFit = (father.getFitness() + mother.getFitness()) / 2;\n Classifier classifier_Child = new Classifier(\n cName,\n newPred,\n newPreErr,\n newFit,\n con,\n action);\n return classifier_Child;\n }", "@Test(timeout = 4000)\n public void test081() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate((String) null);\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.weightedTrueNegativeRate();\n assertEquals(Double.NaN, double0, 0.01);\n }", "boolean hasDecisionPointParams();", "@Override\n public void train() {\n actual = observations.toArray();\n min_val_error = Double.MAX_VALUE;\n if (findDecayConstant)\n for (float alpha = 0f; alpha <= 1f; alpha += 0.01f)\n initializeAndTrainModel(alpha);\n else\n initializeAndTrainModel(optAlpha);\n }", "public KNN() {\r\n\t\tallowRun = true;\r\n\t}", "@Test\n\tpublic void constructorTest() {\n\t\tCTRNN testCtrnn = new CTRNN(layout1, phenotype1, false);\n\t\tAssert.assertEquals(1.0, testCtrnn.inputWeights[0], 0.001);\n\t\tAssert.assertEquals(2.0, testCtrnn.hiddenWeights[0][0], 0.001);\n\t\tAssert.assertArrayEquals(new double[] {3.0, 4.0}, testCtrnn.biasWeights, 0.001);\n\t\tAssert.assertArrayEquals(new double[] {5.0, 6.0}, testCtrnn.gains, 0.001);\n\t\tAssert.assertArrayEquals(new double[] {7.0, 8.0}, testCtrnn.timeConstants, 0.001);\n\t\t\n\t}", "private float applyThreshold(float input) {\n return abs(input) > THRESHOLD_MOTION ? input : 0;\n }", "private void SGDForPositiveInstance(Instance instance) {\n\t\tint lengthOfDocument = 0; // |d|.\r\n\t\tfor (int frequency : instance.mpFeatureToFrequency.values()) {\r\n\t\t\tlengthOfDocument += frequency;\r\n\t\t}\r\n\t\t// double gValue = getGFunctionValue(lengthOfDocument);\r\n\t\t// double gGradientWithPositiveClass =\r\n\t\t// getGFunctionGradientWithPositiveClass(lengthOfDocument);\r\n\t\t// double gGradientWithNegativeClass =\r\n\t\t// getGFunctionGradientWithNegativeClass(lengthOfDocument);\r\n\r\n\t\tdouble positiveClassSum = (param.smoothingPriorForFeatureInNaiveBayes\r\n\t\t\t\t* V + sum_x[0]);\r\n\t\tdouble negativeClassSum = (param.smoothingPriorForFeatureInNaiveBayes\r\n\t\t\t\t* V + sum_x[1]);\r\n\t\tdouble ratioOfClasses = positiveClassSum / negativeClassSum;\r\n\r\n\t\t// Compute R.\r\n\t\tBigDecimal R = BigDecimal.ONE;\r\n\t\t// Pr(-) / Pr(+).\r\n\t\tR = R.multiply(BigDecimal\r\n\t\t\t\t.valueOf(getProbOfClass(1) / getProbOfClass(0)));\r\n\t\t// ratioOfClasses ^ |d|.\r\n\t\tR = R.multiply(BigDecimal.valueOf(ratioOfClasses).pow(lengthOfDocument));\r\n\t\tfor (Map.Entry<Integer, Integer> entry : instance.mpFeatureToFrequency\r\n\t\t\t\t.entrySet()) {\r\n\t\t\tint featureId = entry.getKey();\r\n\t\t\tint frequency = entry.getValue();\r\n\t\t\tdouble ratio = (param.smoothingPriorForFeatureInNaiveBayes + x[featureId][1])\r\n\t\t\t\t\t/ (param.smoothingPriorForFeatureInNaiveBayes + x[featureId][0]);\r\n\t\t\tR = R.multiply(BigDecimal.valueOf(ratio).pow(frequency));\r\n\t\t}\r\n\r\n\t\t// Compute the gradient of each feature for the positive class.\r\n\t\tMap<Integer, Double> gradientOfFeatureWithPositiveClass = new HashMap<Integer, Double>();\r\n\t\tfor (Map.Entry<Integer, Integer> entry : instance.mpFeatureToFrequency\r\n\t\t\t\t.entrySet()) {\r\n\t\t\tint featureId = entry.getKey();\r\n\t\t\tint frequency = entry.getValue();\r\n\r\n\t\t\tBigDecimal numerator1 = BigDecimal\r\n\t\t\t\t\t.valueOf(frequency\r\n\t\t\t\t\t\t\t/ (param.smoothingPriorForFeatureInNaiveBayes + x[featureId][0]));\r\n\t\t\tBigDecimal numerator2 = R.multiply(BigDecimal\r\n\t\t\t\t\t.valueOf(lengthOfDocument / positiveClassSum));\r\n\t\t\tBigDecimal numerator = numerator1.add(numerator2);\r\n\t\t\tBigDecimal denominator = R.add(BigDecimal.ONE);\r\n\t\t\tdouble gradient = numerator.divide(denominator, 30,\r\n\t\t\t\t\tRoundingMode.HALF_UP).doubleValue()\r\n\t\t\t\t\t- frequency\r\n\t\t\t\t\t/ (param.smoothingPriorForFeatureInNaiveBayes + x[featureId][0]);\r\n\t\t\tif (Double.isNaN(gradient)) {\r\n\t\t\t\tSystem.out.println(\"Nan\");\r\n\t\t\t}\r\n\t\t\tgradientOfFeatureWithPositiveClass.put(featureId, gradient);\r\n\t\t}\r\n\r\n\t\t// Compute the gradient of each feature for the negative class.\r\n\t\tMap<Integer, Double> gradientOfFeatureWithNegativeClass = new HashMap<Integer, Double>();\r\n\t\tfor (Map.Entry<Integer, Integer> entry : instance.mpFeatureToFrequency\r\n\t\t\t\t.entrySet()) {\r\n\t\t\tint featureId = entry.getKey();\r\n\t\t\tint frequency = entry.getValue();\r\n\r\n\t\t\tBigDecimal numerator = BigDecimal\r\n\t\t\t\t\t.valueOf(frequency\r\n\t\t\t\t\t\t\t/ (param.smoothingPriorForFeatureInNaiveBayes + x[featureId][1])\r\n\t\t\t\t\t\t\t- lengthOfDocument / negativeClassSum);\r\n\t\t\tBigDecimal denominator = BigDecimal.ONE.divide(R, 30,\r\n\t\t\t\t\tRoundingMode.HALF_UP).add(BigDecimal.ONE);\r\n\t\t\tdouble gradient = numerator.divide(denominator, 30,\r\n\t\t\t\t\tRoundingMode.HALF_UP).doubleValue();\r\n\t\t\tif (Double.isNaN(gradient)) {\r\n\t\t\t\tSystem.out.println(\"Nan\");\r\n\t\t\t}\r\n\t\t\tgradientOfFeatureWithNegativeClass.put(featureId, gradient);\r\n\t\t}\r\n\r\n\t\t// Note that we need to compute all of the gradients first and then\r\n\t\t// update\r\n\t\t// the counts.\r\n\t\t// Update the count of each feature in this document for positive class.\r\n\t\tupdateXs(instance, gradientOfFeatureWithPositiveClass,\r\n\t\t\t\tgradientOfFeatureWithNegativeClass);\r\n\t}", "@Test(timeout = 4000)\n public void test64() throws Throwable {\n NaiveBayesMultinomialText naiveBayesMultinomialText0 = new NaiveBayesMultinomialText();\n naiveBayesMultinomialText0.setPeriodicPruning(4);\n StringKernel stringKernel0 = new StringKernel();\n Capabilities capabilities0 = stringKernel0.getCapabilities();\n TestInstances testInstances0 = TestInstances.forCapabilities(capabilities0);\n Instances instances0 = testInstances0.generate();\n naiveBayesMultinomialText0.buildClassifier(instances0);\n assertEquals(4, naiveBayesMultinomialText0.getPeriodicPruning());\n }", "public double getThreshold() {\r\n return threshold;\r\n }", "public void setThreshold(float threshold){\n this.threshold = threshold;\n }", "@Test\n public void testThresholdEqualsZero() {\n final ThresholdCircuitBreaker circuit = new ThresholdCircuitBreaker(zeroThreshold);\n assertTrue(\"When the threshold is zero, the circuit is supposed to be always open\", circuit.incrementAndCheckState(0L));\n }", "boolean isBiasNeuron();", "public double threshold(double z) {\n\t\tif(z>=0) {\n\t\t\treturn 1;\n\t\t}else {\n\t\t\treturn 0;\n\t\t}\n\t}", "public double getThreshold() {\n return threshold;\n }", "private void checkLeakyEpsilon() {\r\n if (cbUseLeakyLearning.isSelected()) {\r\n tfLeakyEpsilon.setEnabled(true);\r\n } else {\r\n tfLeakyEpsilon.setEnabled(false);\r\n }\r\n }", "@Test\n public void testThreshold() {\n final ThresholdCircuitBreaker circuit = new ThresholdCircuitBreaker(threshold);\n circuit.incrementAndCheckState(9L);\n assertFalse(\"Circuit opened before reaching the threshold\", circuit.incrementAndCheckState(1L));\n }", "public void trainingPreprocessing() {\n neuralNetAndDataSet = new NeuralNetAndDataSet(neuralNetwork, trainingSet);\n trainingController = new TrainingController(neuralNetAndDataSet);\n neuralNetwork.getLearningRule().addListener(this);\n trainingController.setLmsParams(0.7, 0.01, 0);\n LMS learningRule = (LMS) this.neuralNetAndDataSet.getNetwork().getLearningRule();\n if (learningRule instanceof MomentumBackpropagation) {\n ((MomentumBackpropagation) learningRule).setMomentum(0.2);\n }\n }", "public NeuralNetworkForwardPropagation() {\n super(\"Neural-network forward-propagation\");\n }", "public HyperbolicTangentThresholdModel(double p_k){\n\t\tsuper(p_k);\n\t}", "@Test\n public void test00() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate((String) null);\n Evaluation evaluation0 = new Evaluation(instances0);\n evaluation0.addNumericTrainClass('u', 4.9E-324);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01D);\n }", "public AbstractConjugatePriorBayesianEstimator(\n BayesianParameter<ParameterType,ConditionalType,BeliefType> parameter )\n {\n super();\n this.setParameter(parameter);\n }", "public double getThresholdMultiplier() {\n\t\treturn m_thresholdMultiplier;\n\t}", "public void setThreshold(int threshold) {\n lastNeuron().setThreshold(threshold);\n }", "@Test(timeout = 4000)\n public void test040() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate((String) null);\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.falseNegativeRate((-2));\n assertEquals(0.0, double0, 0.01);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "public double getPercentThreshold()\n {\n return percentThreshold;\n }", "public void SetLearnRate (double alpha) { this.alpha = alpha; }", "public boolean isOverThreshold(){return isOverThreshold;}", "public double classifyInstance(int test) {\r\n\t\tdouble bestDist = Double.MAX_VALUE;\r\n\t\tdouble nn = -1.0;\r\n\r\n\t\tInstance testInst = matrix.get(test);\r\n\r\n\t\tfor (int i = 0; i < matrix.numInstances(); ++i) {\r\n\t\t\tif (i == test) // skip 'this' one, leave-one-out\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tdouble dist = knn.distance(testInst, matrix.get(i));\r\n\r\n\t\t\tif (dist < bestDist) {\r\n\t\t\t\tbestDist = dist;\r\n\t\t\t\tnn = matrix.get(i).classValue();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn nn;\r\n\t}", "@Test(timeout = 4000)\n public void test050() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate(\"\");\n Evaluation evaluation0 = new Evaluation(instances0);\n evaluation0.areaUnderPRC((-1));\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test08() throws Throwable {\n NaiveBayesMultinomialText naiveBayesMultinomialText0 = new NaiveBayesMultinomialText();\n naiveBayesMultinomialText0.setPeriodicPruning((-1));\n int int0 = naiveBayesMultinomialText0.getPeriodicPruning();\n assertEquals((-1), int0);\n }", "public static void main(String[] args) {\n\t\tPerceptron p = new Perceptron(new TaruTrainingWrapper(args[0],null));\n\t\t\n\t\t// Training data\n//\t\tString srcTrainFile = \"train.src\"; // contains parses\n//\t\tString refTrainFile = \"train.ref\"; // contains plain text\n\t\tString srcTrainFile = \"test.src\"; // contains parses\n\t\tString refTrainFile = \"test.ref\"; // contains plain text\n\t\t\n\t\t// Read in the training data\n\t\tArrayList<String> srcData = new ArrayList<String>(5000);\n\t\tArrayList<String> refData = new ArrayList<String>(5000);\n\t\t\n\t\ttry{\n\t\t\tBufferedReader sbr = new BufferedReader(new FileReader(srcTrainFile));\n\t\t\tBufferedReader rbr = new BufferedReader(new FileReader(refTrainFile));\n\t\t\tString ref = \"\";\n\t\t\twhile((ref = rbr.readLine()) != null){\n\t\t\t\tString src = sbr.readLine();\n\t\t\t\tif(ref.split(\" +\").length < 31){\n\t\t\t\t\tsrcData.add(src);\n\t\t\t\t\trefData.add(ref.toLowerCase());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tsbr.close();\n\t\t\trbr.close();\n\t\t}catch(FileNotFoundException e){e.printStackTrace();} catch (IOException e) { e.printStackTrace();}\n\t\tSystem.out.println(\"Training on \" + srcData.size() + \" sentences.\");\n\t\t// run the training\n\t\tp.trainAverage(srcData, refData, 5);\n\t}", "float getSpecialProb();", "@Test(timeout = 4000)\n public void test001() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate((String) null);\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.weightedTruePositiveRate();\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n assertEquals(Double.NaN, double0, 0.01);\n }", "@Override\n public double classifyInstance(Instance instance) throws Exception {\n\n\n\n int numAttributes = instance.numAttributes();\n int clsIndex = instance.classIndex();\n boolean hasClassAttribute = true;\n int numTestAtt = numAttributes -1;\n if (numAttributes == m_numOfInputNeutrons) {\n hasClassAttribute = false; // it means the test data doesn't has class attribute\n numTestAtt = numTestAtt+1;\n }\n\n for (int i = 0; i< numAttributes; i++){\n if (instance.attribute(i).isNumeric()){\n\n double max = m_normalization[0][i];\n double min = m_normalization[1][i];\n double normValue = 0 ;\n if (instance.value(i)<min) {\n normValue = 0;\n m_normalization[1][i] = instance.value(i); // reset the smallest value\n }else if(instance.value(i)> max){\n normValue = 1;\n m_normalization[0][i] = instance.value(i); // reset the biggest value\n }else {\n if (max == min ){\n if (max == 0){\n normValue = 0;\n }else {\n normValue = max/Math.abs(max);\n }\n }else {\n normValue = (instance.value(i) - min) / (max - min);\n }\n }\n instance.setValue(i, normValue);\n }\n }\n\n double[] testData = new double[numTestAtt];\n\n\n\n\n\n int index = 0 ;\n\n if (!hasClassAttribute){\n\n for (int i =0; i<numAttributes; i++) {\n testData[i] = instance.value(i);\n }\n }else {\n for (int i = 0; i < numAttributes; i++) {\n\n if (i != clsIndex) {\n\n testData[index] = instance.value(i);\n\n index++;\n }\n }\n }\n\n\n\n DenseMatrix prediction = new DenseMatrix(numTestAtt,1);\n for (int i = 0; i<numTestAtt; i++){\n prediction.set(i, 0, testData[i]);\n }\n\n DenseMatrix H_test = generateH(prediction,weightsOfInput,biases, 1);\n\n DenseMatrix H_test_T = new DenseMatrix(1, m_numHiddenNeurons);\n\n H_test.transpose(H_test_T);\n\n DenseMatrix output = new DenseMatrix(1, m_numOfOutputNeutrons);\n\n H_test_T.mult(weightsOfOutput, output);\n\n double result = 0;\n\n if (m_typeOfELM == 0) {\n double value = output.get(0,0);\n result = value*(m_normalization[0][classIndex]-m_normalization[1][classIndex])+m_normalization[1][classIndex];\n //result = value;\n if (m_debug == 1){\n System.out.print(result + \" \");\n }\n }else if (m_typeOfELM == 1){\n int indexMax = 0;\n double labelValue = output.get(0,0);\n\n if (m_debug == 1){\n System.out.println(\"Each instance output neuron result (after activation)\");\n }\n for (int i =0; i< m_numOfOutputNeutrons; i++){\n if (m_debug == 1){\n System.out.print(output.get(0,i) + \" \");\n }\n if (output.get(0,i) > labelValue){\n labelValue = output.get(0,i);\n indexMax = i;\n }\n }\n if (m_debug == 1){\n\n System.out.println(\"//\");\n System.out.println(indexMax);\n }\n result = indexMax;\n }\n\n\n\n return result;\n\n\n }", "public float getThreshold() {\n return threshold;\n }", "public static double make_predictionFromViolaJonesAdaBoost(double [][] new_x) {\r\n\t\t\r\n\t\tif(classifierInfos == null) {\r\n\t\t\tSystem.out.println(\"AdaBoost not trained yet. Canīt make prediction from new input.\");\r\n\t\t}\r\n\t\t\r\n\t\tdouble prediction = 0.0;\r\n\t\tint nIterations = alphas.size();\r\n\t\t\r\n\t\tfor(int i=0; i<nIterations; i++) {\r\n\t\t\t\r\n\t\t\tString splitFeat = get_splittingFeature4Iteration(i);\r\n\t\t\tdouble threshold = get_threshold4Iteration(i);\r\n\t\t\tdouble polarity = get_polarity4Iteration(i);\r\n\t\t\tdouble p = 1.0;\r\n\r\n\t\t\tif(polarity != 0.0) {\r\n\t\t\t\tp = polarity;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tint idx = Utilities.get_idx(names_of_explaining_variables, splitFeat)[0];\r\n\t\t\tdouble inputValue4Feature = new_x[0][idx];\r\n\t\t\t\r\n\t\t\tinputValue4Feature *=p;\r\n\t\t\tthreshold *=p;\r\n\t\t\t\r\n\t\t\tif(inputValue4Feature <= threshold) {\r\n\t\t\t\tprediction += classes[0]*alphas.get(i);\r\n\t\t\t}else {\r\n\t\t\t\tprediction += classes[1]*alphas.get(i);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn prediction;\r\n\t\t\r\n\t}", "private double activationFunction(double input){\n double temp = 1 + Math.exp(-1 * input * this.sigmoidFactor);\n double result = (double)1/temp;\n return result;\n }", "boolean hasFixedHotwordGain();", "private double efficientLpDistance(Instance one, Instance two, int p_value, double threshold) {\n\n double distanceSum = 0;\n double currentThreshold = Math.pow(threshold, p_value);\n\n for (int i = 0; i < one.numAttributes() - 1; i++) {\n distanceSum += Math.pow(Math.abs(one.value(i) - two.value(i)), p_value);\n if (distanceSum > currentThreshold) {\n return Double.MAX_VALUE;\n }\n }\n\n distanceSum = Math.pow(distanceSum, 1.0 / p_value); // Root in base P\n\n return distanceSum;\n }", "double getLearningRate();", "@Test(timeout = 4000)\n public void test080() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate((String) null);\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.weightedFalseNegativeRate();\n assertEquals(Double.NaN, double0, 0.01);\n }", "public void setLearningRate(double rate);", "public PrecisePoint() {\n }", "public static void perceptronB(List<double[]> wektoryTrenujace,\n double[] w, double[] d, double c){\n\n double[] result = new double[4];\n double[] sumOfWec = new double[4];\n boolean repeat;\n\n //y1\n int iteracje = 0;\n do {\n Arrays.fill(sumOfWec, 0.0);\n repeat = false;\n iteracje++;\n System.out.println(\"Iteracja: \" + iteracje);\n for (int i=0; i< wektoryTrenujace.size();i++){\n result[i] = vectorSign(sigmFunc(matrixMult(wektoryTrenujace.get(i),w)),d[i]);\n sumOfWec = matrixAdd(sumOfWec, matrixMult(result[i],wektoryTrenujace.get(i)));\n if (result[i] != 0){\n System.out.println(\"Wektor trenujacy x\" + (i+1) + \" zostal zle rozpoznany przez wage \" + Print(w));\n repeat = true;\n }\n\n }\n w = matrixAdd(w,matrixMult(c,sumOfWec));\n System.out.println(\"Nowa waga: \" + Print(w) + \"\\n\");\n if (iteracje> 40)\n {\n System.out.println(\"Wagi nie stabilizują się po 40 iteracjach.\");\n return;\n }\n } while (repeat);\n\n System.out.println(\"Wagi ustabilizowaly sie po \" + iteracje + \" iteracji/ach.\\nWaga wynosi \" + Print(w));\n\n\n\n }", "private void train(float[] inputs, int desired) {\r\n int guess = feedforward(inputs);\r\n float error = desired - guess;\r\n for (int i = 0; i < weights.length; i++) {\r\n weights[i] += c * error * inputs[i];\r\n }\r\n }", "public int activationFunction(double output) {\n if (output < 0) return 0;\n else return 1;\n }", "@Override\n\tprotected void initClassifierParameters() {\n\t\tlinearKernel = new SelectedParameterItem(\"Linear kernel\", \"-K 0\");\n\t\tpolynomialKernel = new SelectedParameterItem(\"Polynomial kernel\", \"-K 1\");\n\t\tradialBasisKernel = new SelectedParameterItem(\"Radial basis kernel\", \"-K 2\");\n\t\tsigmoidKernel = new SelectedParameterItem(\"Sigmoid kernel\", \"-K 3\");\n\t\tcSVC = new SelectedParameterItem(\"C-SVC\", \"-S 0\");\n\t\tnuSVC = new SelectedParameterItem(\"&nu;-SVC\", \"-S 1\");\n\t\tsvmType = ParameterUtilities.createSelectedParameter(\"SVM type\", cSVC, nuSVC);\n\t\tkernelType = ParameterUtilities.createSelectedParameter(\"Kernel type\", linearKernel, polynomialKernel, radialBasisKernel,\n\t\t\t\tsigmoidKernel);\n\t\tkernelDegree = new Parameter(3, \"Degree in kernel function\", Parameter.TYPE.INTEGER, \"-D\", \"classifier.degree\");\n\t\tkernelGamma = new Parameter(0.5, \"&gamma; in kernel function\", Parameter.TYPE.DOUBLE, \"-G\", \"classifier.gamma\");\n\t\tkernelCoefficient = new Parameter(0.0, \"Coefficient in kernel function\", Parameter.TYPE.DOUBLE, \"-R\", \"classifier.coef0\");\n\t\tparameterC = new Parameter(1.0, \"Parameter C\", Parameter.TYPE.DOUBLE, \"-C\", \"classifier.cost\");\n\t\tparameterNu = new Parameter(0.5, \"Parameter &nu;\", Parameter.TYPE.DOUBLE, \"-N\", \"classifier.nu\");\n\t\ttolerance = new Parameter(0.001, \"Tolerance of termination criterion\", Parameter.TYPE.DOUBLE, \"-E\");\n\t\tweight = new Parameter(null, \"Weight, set C of class i to (weight &times; C)\", Parameter.TYPE.STRING, \"-W\");\n\t}", "private double sigmoidPrime(double x) {\n return x * (1 - x);\n }", "public CVParam getNeutralLoss() {\n return neutralLoss;\n }", "public BernoulliDistribution(double p){\n\t\tsuper(1, p);\n\t}", "public WekaLogitLearner() { super(new Logistic2()); }", "double getExtremeSpikeProbability();", "public WekaLearner(Classifier classifier) {\n super(Type.MODEL, Type.TRIV);\n this.classifier = classifier;\n }", "public double activation(double z);", "Classifier getBase_Classifier();", "@Override\n\tpublic double getBestTargetValue() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic void updateStatistics(Instance inst) {\n\t\t// Update the statistics for this node\n\t\t// number of instances passing through the node\n\t\tnodeStatistics.addToValue(0, 1);\n\t\t// sum of y values\n\t\tnodeStatistics.addToValue(1, inst.classValue());\n\t\t// sum of squared y values\n\t\tnodeStatistics.addToValue(2, inst.classValue()*inst.classValue());\n\t\t\t\t\n\t\tthis.perceptron.trainOnInstance(inst);\n\t\tif (this.predictionFunction != 1) { //Train target mean if prediction function is not Perceptron\n\t\t\tthis.targetMean.trainOnInstance(inst);\n\t\t}\n\t}", "private static void fakePole() {\n\t\tint turns = 1000;\n\t\tModelLearnerHeavy modeler = new ModelLearnerHeavy(100, new int[] {30},\n\t\t\t\tnew int[] {30}, new int[] {30}, ActivationFunction.SIGMOID0p5, turns);\n\n\t\tfinal boolean NN_FORM = false;\n\t\tdouble[] mins = Pole.stateMins;\n\t\tdouble[] maxes = Pole.stateMaxes;\n\t\tEnvTranslator stateTranslator = EnvTranslator.rbfEnvTranslator(mins, maxes, new int[] {12,12}, .5);\n\t\tEnvTranslator actTranslator = Pole.actionTranslator;\n\t\tList<double[]> actions = Pole.actionChoices;\n\t\tactions.add(new double[] {1,0});\n//\t\tactions.add(new double[] {0,0});\n\t\tactions.add(new double[] {0,1});\n\t\tfinal Collection<double[]> tmpCorrel = new ArrayList<double[]>();\n\t\tfor (int t = 0; t < turns; t++) {\n\t\t\tdouble[] preState = new double[mins.length];\n\t\t\tfor (int i = 0; i < preState.length; i++) {\n\t\t\t\tfinal double spread = (maxes[i] - mins[i]) / 10;\n\t\t\t\tpreState[i] = RandomUtils.randBetween(mins[i] - spread, maxes[i] + spread);\t\n\t\t\t}\n\t\t\tdouble[] inNN = stateTranslator.toNN(preState);\n\t\t\tdouble[] action = RandomUtils.randomOf(actions);\n\t\t\tmodeler.observePreState(inNN);\n\t\t\tmodeler.observeAction(action);\n\t\t\t\n\t\t\tdouble[] postState = new double[mins.length];\n\t\t\tdouble act = Math.random() < 0.99 ? action[0] - action[1] : (2*Math.round(Math.random())-1);\n\t\t\tdouble r = act/100;\n\t\t\tfor (int i = 0; i < postState.length; i++) {\n\t\t\t\tpostState[i] = preState[i] * Math.exp(Math.signum(preState[i]) * (i == 0 ? r : -r));\n\t\t\t} // act0 moves state[0] up and state[1] down, act1 moves state[0] down and state[1] up\n\t\t\ttmpCorrel.add(new double[] {act, postState[0] - preState[0]});\n\t\t\tmodeler.observePostState(stateTranslator.toNN(postState));\n\t\t\tmodeler.saveMemory();\n\t\t}\n\t\tmodeler.learnFromMemory(1.5, 0.5, 0, false, 1000, 0.0003); // IT SEEMS CONFIDENCE IS NOT RELIABLE INDICATOR\n//\t\tfor (double[] dd : tmpCorrel) {\n//\t\t\tString s = \"\"; for (double d : dd) s += d + \"\t\";\n//\t\t\tSystem.out.println(s);\n//\t\t}\n\t\tfor (int i = 0; i < 10; i++) System.out.println(\"*********\");\n\t\tSystem.out.println(modeler.getModelVTA().getConfidenceEstimate());\n//\t\tmodeler.testit(1000, mins, maxes, stateTranslator, actTranslator, actions, NN_FORM);\n\t\t\n\t\tfor (int t = 0; t < 500; t++) {\n\t\t\tfinal double[] state = new double[mins.length];\n\t\t\tfor (int i = 0; i < state.length; i++) state[i] = RandomUtils.randBetween(mins[i], maxes[i]);\n\t\t\tString s = \"\";\n\t\t\tfor (double d : state) s += d + \"\t\";\n\t\t\tfor (double[] act : actions) {\n\t\t\t\tdouble[] foresight = Foresight.montecarlo(modeler, stateTranslator.toNN(state), act, 1, 100, 30);\n\t\t\t\tdouble[] postV = stateTranslator.fromNN(foresight);\n\t\t\t\ts += \"act:\" + actTranslator.fromNN(act) + \":\t\";\n\t\t\t\tfor (double d : postV) s += Utils.round(d * 100, 2) + \"\t\";\n\t\t\t}\n\t\t\tSystem.out.println(s);\n\t\t}\n\t}", "public void train()\r\n\t{\r\n\t\tfor(int i=0; i < this.maxEpoch; i++)\r\n\t\t{\r\n\t\t\tfor(Instance temp_example: this.trainingSet)\r\n\t\t\t{\r\n\t\t\t\tdouble O = calculateOutputForInstance(temp_example);\r\n\t\t\t\tdouble T = temp_example.output;\r\n\t\t\t\tdouble err = T - O;\r\n\r\n\t\t\t\t//w_jk (hidden to output)\r\n\t\t\t\tdouble g_p_out = (outputNode.getSum() <= 0) ? 0 : 1;\r\n\t\t\t\tfor(NodeWeightPair hiddenNode: outputNode.parents)\r\n\t\t\t\t{\r\n\t\t\t\t\thiddenNode.set_deltaw_pq(this.learningRate*\r\n\t\t\t\t\t\t\thiddenNode.node.getOutput()*err*g_p_out);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//w_ij (input to hidden)\r\n\t\t\t\tint hid_count =0;\r\n\t\t\t\tfor(Node hiddenNode: hiddenNodes){\r\n\t\t\t\t\tdouble g_p_hid = (hiddenNode.getSum() <= 0) ? 0 : 1;\r\n\t\t\t\t\tif(hiddenNode.getType()==2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfor(NodeWeightPair inputNode: hiddenNode.parents){\r\n\t\t\t\t\t\t\tdouble a_i = inputNode.node.getOutput();\r\n\t\t\t\t\t\t\tinputNode.set_deltaw_pq\r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\tthis.learningRate*\r\n\t\t\t\t\t\t\t\t\ta_i*g_p_hid*(err*\r\n\t\t\t\t\t\t\t\t\toutputNode.parents.get(hid_count).weight*\r\n\t\t\t\t\t\t\t\t\tg_p_out)\r\n\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\thid_count++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// for all w_pq, update weights\r\n\t\t\t\tfor(Node hiddenNode: hiddenNodes){\r\n\t\t\t\t\tif(hiddenNode.getType()==2){\r\n\t\t\t\t\t\tfor(NodeWeightPair inputNode: hiddenNode.parents){\r\n\t\t\t\t\t\t\tinputNode.weight += inputNode.get_deltaw_pq();\r\n\t\t\t\t\t\t\tinputNode.set_deltaw_pq(new Double (0.00));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfor(NodeWeightPair hiddenNode: outputNode.parents)\r\n\t\t\t\t{\r\n\t\t\t\t\thiddenNode.weight += hiddenNode.get_deltaw_pq();\r\n\t\t\t\t\thiddenNode.set_deltaw_pq(new Double (0.00));\r\n\t\t\t\t}\r\n\r\n\t\t\t} // end of an instance \r\n\t\t} // end of an epoch\r\n\t}", "public int getThreshold()\n {\n return threshold;\n }" ]
[ "0.63867027", "0.62319285", "0.6045955", "0.6042826", "0.60101885", "0.5971131", "0.59281874", "0.591782", "0.5880612", "0.55601805", "0.5513482", "0.52939224", "0.52925515", "0.5272057", "0.5240243", "0.52320755", "0.5145216", "0.51449823", "0.5110173", "0.5055128", "0.50446326", "0.50337106", "0.50214446", "0.5020505", "0.49982202", "0.4983695", "0.49668378", "0.49612948", "0.49512073", "0.4937585", "0.49347484", "0.49325332", "0.49186993", "0.49065566", "0.4903971", "0.48992157", "0.48979568", "0.48817456", "0.48685148", "0.4866363", "0.48584598", "0.485167", "0.48353964", "0.48336738", "0.482953", "0.4818576", "0.48158625", "0.48072165", "0.479101", "0.47765294", "0.4765506", "0.47632954", "0.47596303", "0.47590175", "0.4749538", "0.47402605", "0.4734271", "0.4730042", "0.47297573", "0.47278908", "0.47250858", "0.47143316", "0.46994436", "0.4692014", "0.46894774", "0.46877602", "0.46860546", "0.46834984", "0.46780258", "0.46772018", "0.46729636", "0.46712843", "0.46605384", "0.4657422", "0.464588", "0.46371144", "0.4633413", "0.46304724", "0.4626161", "0.46236748", "0.46224856", "0.46181273", "0.4617515", "0.46099246", "0.46006945", "0.45984003", "0.4595825", "0.45951533", "0.45941493", "0.45926818", "0.4592017", "0.45904663", "0.45861465", "0.45854232", "0.4585302", "0.45850956", "0.458023", "0.45786873", "0.4576006", "0.45735377" ]
0.47205046
61
The function checks if the username exist, in case of positive answer HttpStatus in HttpServletResponse should be set to HttpStatus.CONFLICT, else insert the user to the system and set to HttpStatus in HttpServletResponse HttpStatus.OK
@RequestMapping(value = "register_new_customer", method = { RequestMethod.POST }) public void registerNewUser(@RequestParam("username") String username, @RequestParam("password") String password, @RequestParam("firstName") String firstName, @RequestParam("lastName") String lastName, HttpServletResponse response) { System.out.println(username + " " + password + " " + lastName + " " + firstName); try { // In case the user already exist, show error to the user if (isExistUser(username)) { HttpStatus status = HttpStatus.CONFLICT; response.setStatus(status.value()); } else { // Create Mongo client MongoClient mongoClient = new MongoClient("localhost", 27017); MongoDatabase db = mongoClient.getDatabase("projectDB"); // Create Users collection MongoCollection<Document> collection = db.getCollection("USERS"); // Create user document and add to users collection Document document = new Document("username", username).append("password", password) .append("firstName", firstName).append("lastName", lastName) .append("RegistrationDate", new Date()); collection.insertOne(document); System.out.println("Document inserted successfully"); //Close DB connection and send OK message to the user mongoClient.close(); HttpStatus status = HttpStatus.OK; response.setStatus(status.value()); } } catch (Exception e) { System.out.println(e); HttpStatus status = HttpStatus.CONFLICT; response.setStatus(status.value()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void whenFetchingExistingUserReturn200() throws Exception {\n UserRegistrationRequestDTO request = getSampleRegistrationRequest();\n long userId = api.registerUser(request).execute().body();\n\n // when fetching user details\n Response<UserDTO> response = api.getUserDetails(userId).execute();\n\n // then http status code should be ok\n assertThat(response.code(), is(200));\n\n // and user should have a matching name\n assertThat(response.body().fullName, is(request.fullName));\n }", "public void checkUsernameExist() {\n\n try {\n BLUser bluser = new BLUser();\n User user = new User();\n\n ResultSet rs = bluser.selectUserIdFromUsername(txt_username.getText());\n\n user.setUsername(txt_username.getText());\n bluser.setUser(user);\n\n if (bluser.checkUsernameExist()) {\n \n populateDataOnTable();\n }// end if\n else {\n JOptionPane.showMessageDialog(rootPane, \"Invalid username!\");\n }// end else \n\n }// end try\n catch (Exception ex) {\n JOptionPane.showMessageDialog(null, ex.getMessage(), \"Exception\", JOptionPane.INFORMATION_MESSAGE);\n }//end catch\n }", "public ResponseEntity<User> createUser(User user) {\n List<User> users=getAllUsers();\n boolean usernameIsUsed=false;\n\n\n for(User myUser : users){\n\n\n String username= myUser.getUsername();\n\n if(username.equals(user.getUsername())){\n usernameIsUsed=true;\n return ResponseEntity.badRequest().build();\n }\n\n\n }\n if(!usernameIsUsed){\n myUserDetailsService.addUser(user);\n return ResponseEntity.ok(user);\n }\n\n return null;\n }", "Boolean checkUserExists(String userName) throws AppException;", "private void userNameErrorMessage(boolean exists, String userName){\n if(exists){\n System.out.println(\"\\nUserName: \" + userName + \" Already Exists In Database!\\n\");\n }\n }", "@Test\n public void testCreateUserWithExistingUsername() {\n final String username = \"[email protected]\";\n final CreateUserRequest request1 = new CreateUserRequest(username, \"Michael\", \"Pickelbauer\");\n final CreateUserRequest request2 = new CreateUserRequest(username, \"Hugo\", \"Mayer\");\n\n // Now let's create the two user accounts\n final CreateUserResponse response1 = administration.createUser(token, request1);\n final CreateUserResponse response2 = administration.createUser(token, request2);\n\n // The first request should work like a charm\n assertThat(response1, is(not(nullValue())));\n assertThat(response1.isOk(), is(true));\n\n // The second request should fail, as we already have a user with this\n // username in the system\n assertThat(response2, is(not(nullValue())));\n assertThat(response2.isOk(), is(false));\n assertThat(response2.getError(), is(IWSErrors.USER_ACCOUNT_EXISTS));\n assertThat(response2.getMessage(), is(\"An account for the user with username \" + username + \" already exists.\"));\n }", "@RequestMapping(value=\"/signup/{username}/{password}\")\n @ResponseBody\n public boolean signup(@PathVariable String username, @PathVariable String password){\n\n User user = new User(username, password);\n try{\n customUserDetailsService.save(user);\n return true;\n }catch (Exception e) {\n System.out.println(e);\n //ef return false tha er username fratekid...\n return false;\n }\n }", "@Override\r\n\tpublic Boolean userExist(String username) {\n\t\treturn null;\r\n\t}", "private boolean validateUser(HttpServletResponse resp, HttpServletRequest req, String username) throws IOException {\n\n SessionHandler session = (SessionHandler) req.getSession().getAttribute(\"authorized\");\n\n String sessionUsername = session.getUsername();\n\n if((!sessionUsername.equalsIgnoreCase(\"admin\")\n && !username.equalsIgnoreCase(sessionUsername))\n || !session.isAuthorized()\n ){\n page.redirectTo(\"/account\", resp, req,\n \"errorMessage\", \"Action not permitted!\");\n return false;\n }\n return true;\n }", "@Test\n public void registerUsernameTaken() throws Exception {\n user.setUsername(\"sabina\");\n // when:\n MockHttpServletResponse response\n = this.mockMvc.perform(post(\"/user\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(jacksonTester.write(user).getJson()))\n .andReturn().getResponse();\n\n // then:\n assertThat(response.getStatus()).as(\"Checking HTTP status\")\n .isEqualTo(HttpStatus.CONFLICT.value());\n\n // checking links:\n JSONObject responseJson = new JSONObject(response.getContentAsString());\n Assert.assertTrue(\"Checking _links is there\", responseJson.has(\"_links\"));\n JSONObject linksJson = responseJson.getJSONObject(\"_links\");\n Assert.assertTrue(\"Checking home is there\", linksJson.has(\"home\"));\n }", "@RequestMapping(value=\"/available/user\", method=RequestMethod.POST)\n\tpublic @ResponseBody Object checkUserNameAvailable(@RequestParam String userName) {\n\t\ttry {\n\t\t\treturn userService.checkUserNameAvailable(userName);\n\t\t} catch(Exception e) {\n\t\t\tSystem.out.println(\"Thats an error. \" + e.toString());\n\t\t\treturn Collections.singletonMap(\"status\", \"error\");\n\t\t}\n\t}", "private boolean checkExistingUsername(String username) {\n boolean existingUsername = false;\n User user = userFacade.getUserByUsername(username);\n if (user != null) {\n existingUsername = true;\n }\n return existingUsername;\n }", "private boolean checkNameExistAdd(String userName) {\n\n\t\tUser user = this.userDAO.getUserByName(userName);\n\t\tif (null != user) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "@PostMapping(\"/signup\")\n public ResponseEntity<User> create(HttpServletRequest request, HttpServletResponse response) {\n // check that another session doesn't already exist for this request, and if there is, send a 403 response\n HttpSession session = request.getSession(false);\n if (session != null) {\n return ResponseEntity.status(HttpStatus.FORBIDDEN).body(null);\n }\n\n // get the sign-up parameters from the post request\n String user = request.getParameter(\"user\");\n String first = request.getParameter(\"first\");\n String last = request.getParameter(\"last\");\n String email = request.getParameter(\"email\");\n String pass = request.getParameter(\"pass\");\n\n String pattern = \"^[a-zA-Z0-9]*$\";\n\n // send an HTTP 422 response if any parameter is missing, empty, does not match the pattern (except email)\n if (user == null || user.isEmpty() || !user.matches(pattern)) {\n return ResponseEntity.unprocessableEntity().body(null);\n } else if (first == null || first.isEmpty() || !first.matches(pattern)) {\n return ResponseEntity.unprocessableEntity().body(null);\n } else if (last == null || last.isEmpty() || !last.matches(pattern)) {\n return ResponseEntity.unprocessableEntity().body(null);\n } else if (email == null || email.isEmpty()) {\n return ResponseEntity.unprocessableEntity().body(null);\n } else if (pass == null || pass.isEmpty() || !pass.matches(pattern)) {\n return ResponseEntity.unprocessableEntity().body(null);\n }\n\n // check to see if the userName or email are already taken\n List<User> uniqueAttributeCheck = userRepo.findByUserNameOrEmail(user, email);\n\n // send an HTTP 409 response if either already exists\n if (uniqueAttributeCheck.size() > 0) {\n return ResponseEntity.status(HttpStatus.CONFLICT).body(null);\n }\n\n User newUser;\n\n // create the new User and save it in the user repository\n try {\n newUser = userRepo.save(new User(user, first, last, email, pass));\n } catch (TransactionSystemException e) { // this exception will be thrown if the email does not validate\n return ResponseEntity.unprocessableEntity().body(null);\n }\n\n // create a new session for the new User\n session = request.getSession();\n session.setAttribute(\"user\", user);\n\n // add the user cookie to the response\n response.addCookie(CookieManager.getUserCookie(user));\n\n // send an HTTP 201 response with the new session User\n return ResponseEntity.status(HttpStatus.CREATED).body(newUser.asSessionUser());\n }", "public boolean userNameExist(String username);", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tString username = request.getParameter(\"username\");\n\t\tUserDao userDao = new UserDaoImpl();\n\t\tboolean flag = userDao.checkUsername(username);\n\t\t\n\t\tresponse.setContentType(\"text/html;charset=UTF-8\");\n//\t\tSystem.out.println(flag);\n\t\tif(flag) {\n\t\t\tresponse.getWriter().write(\"<font color ='red'><b>用户名已存在</b></font>\");\n\t\t}else {\n\t\t\tresponse.getWriter().write(\"<font color ='green'>用户名可用! </font>\");\n\t\t}\n\t\t\n\t}", "@RequestMapping(value = \"is_exist_user\", method = { RequestMethod.GET })\n\tpublic boolean isExistUser(@RequestParam(\"username\") String username) throws IOException {\n\t\tSystem.out.println(username);\n\t\tboolean result = true;\n\t\tMongoClient mongoClient = null;\n\t\ttry {\n\t\t\t// Create Mongo client\n\t\t\tmongoClient = new MongoClient(\"localhost\", 27017);\n\t\t\tMongoDatabase db = mongoClient.getDatabase(\"projectDB\");\n\n\t\t\t// Create Users collection and user document\n\t\t\tMongoCollection<Document> collection = db.getCollection(\"USERS\");\n\t\t\tDocument myDoc = collection.find(eq(\"username\", username)).first();\n\n\t\t\t//In case no document in the collection match the condition, the user not exist in the DB\n\t\t\tif (myDoc == null) {\n\t\t\t\tmongoClient.close();\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t//Close DB connection\n\t\t\tmongoClient.close();\n\n\t\t} catch (Exception e) {\n\t\t\tmongoClient.close();\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\treturn result;\n\t}", "private boolean checkNameExistModify(String userName, Integer id) {\n\n\t\tUser user = this.userDAO.getUserByName(userName);\n\t\tif (null != user && id != user.getUserId()) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public Boolean isUsernameExist(String username);", "public boolean validateUsernameExist(String username) {\n return userRepository.findUsername(username);\n }", "boolean userExists(HttpServletRequest request, String userId);", "private static ErrorType handleAddUser(String username) {\n\t\tif (VersionControlDb.addUser(username) != null) {\n\t\t\treturn ErrorType.SUCCESS;\n\t\t}\n\t\telse {\n\t\t\treturn ErrorType.USERNAME_ALREADY_EXISTS;\n\t\t}\n\t}", "boolean isUsernameExist(String username);", "void ensureUserCreationAllowed(String email, String userName) throws BadRequestException, ConflictException, ServerException;", "@Test\n\tvoid repeatedUsernameTest() throws Exception {\n\t\tUser userObj = new User();\n\t\tuserObj.setName(\"Siva Murugan\");\n\t\tuserObj.setEmail(\"[email protected]\");\n\t\tuserObj.setGender(\"M\");\n\t\tuserObj.setMobileNumber(9878909878L);\n\t\tuserObj.setRole(\"C\");\n\t\tuserObj.setUsername(\"sivanew\");\n\t\tuserObj.setPassword(\"Siva123@\");\n\t\tString userJson = new ObjectMapper().writeValueAsString(userObj);\n\t\twhen(userService.registerUser(any(User.class))).thenThrow(new UsernameAlreadyExistException(\"E_UR01\"));\n\t\tmockMvc.perform(post(\"/vegapp/v1/users/register\").contentType(MediaType.APPLICATION_JSON).content(userJson))\n\t\t\t\t.andExpect(status().isConflict()).andExpect(jsonPath(\"$.errorMessage\").value(\"E_UR01\"));\n\t}", "@Test\n\tpublic void validateAddedUser() throws Exception {\n\t\tmockMvc.perform(\n\t\t\t\tget(\"/secure/user/{username}\", \"username1\").accept(\n\t\t\t\t\t\tMediaType.APPLICATION_JSON)).andDo(print())\n\t\t\t\t.andExpect(status().isOk())\n\t\t\t\t.andExpect(content().contentType(\"application/json\"))\n\t\t\t\t.andExpect(jsonPath(\"username\").value(\"username1\"));\n\n\t}", "boolean isUserExists(Username username);", "@ResponseStatus(value = HttpStatus.CONFLICT, reason = \"Another entity with the same identity exists\")\n @ExceptionHandler({DataIntegrityViolationException.class})\n public void handleAlreadyExists() {\n // just return empty 409\n logger.info(\"-----> Entity save operation failure\");\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n String username = request.getParameter(\"username\");\n String password1 = request.getParameter(\"password1\");\n String password2 = request.getParameter(\"password2\");\n String firstname = request.getParameter(\"firstname\");\n String lastname = request.getParameter(\"lastname\");\n \n try {\n if(manager.existingUser(username) != null){\n request.setAttribute(\"message\", \"Username esistente!\");\n RequestDispatcher rd = request.getRequestDispatcher(\"signup_page.jsp\");\n rd.forward(request, response);\n }else if(manager.badPassword(password1, password2)){\n request.setAttribute(\"message\", \"Password errata!\");\n RequestDispatcher rd = request.getRequestDispatcher(\"signup_page.jsp\");\n rd.forward(request, response);\n }else{\n User user;\n manager.register(firstname, lastname, username, password2);\n user = manager.authenticate(username, password2);\n HttpSession session = request.getSession(true);\n session.setAttribute(\"user\", user);\n response.sendRedirect(request.getContextPath()+\"/index.jsp\");\n }\n } catch (SQLException ex) {\n Logger.getLogger(SignupServlet.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }", "public boolean findUserIsExist(String name) {\n\t\treturn false;\r\n\t}", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n //Checking which request we're responding to\n if (requestCode == 1) {\n //Making sure the request was successful\n if (resultCode == RESULT_OK) {\n\n //display a toast message if the username could not be resolved on the server\n Toast.makeText(getApplicationContext(), \"Username Not Found On Server\", Toast.LENGTH_SHORT).show();\n\n }\n }\n }", "Boolean checkUserExists(Integer userId) throws AppException;", "@RequestMapping(value = \"/{username}/{password}\", method= RequestMethod.GET)\n @ResponseBody\n public ResponseEntity<HashMap<String,String>> login (@PathVariable(\"username\") String username,\n @PathVariable(\"password\") String password) throws ParseException {\n\n respMap = new HashMap<>();\n httpStatus = HttpStatus.OK;\n Timestamp startTime = getTimeStamp();\n User user = userRepo.findByEmailAddress(username);\n\n if (user != null) { // yes user with this username exists\n\n if (user.getPassword().equals(password)) {\n if ( user.getApproved()) {\n respMap.put(\"message\", user.getType() + \" User \" + user.getFirstname() + \" with id \" + user.getUserid() + \" is logged in!\");\n respMap.put(\"userType\", user.getType());\n\n respMap.put(\"name\", user.getFirstname());\n respMap.put(\"httpStatus\", \"\" + HttpStatus.OK);\n respMap.put(\"startTime\", \"\" + startTime);\n respMap.put(\"userId\", \"\" + user.getUserid());\n respMap.put(\"success\", \"\" + 1);\n } else {\n respMap.put( \"message\" , \"Account has not been approved .. check with Administrator\");\n respMap.put( \"success\" , \"0\");\n message = \"Account has not been approved .. check with Administrator\";\n }\n\n } else { // password incorrect\n respMap.put( \"message\" , \"Username : [\" + username + \"] or password : [\" + password + \"] incorrect\");\n respMap.put( \"success\" , \"0\");\n message = \"Username or password incorrect\";\n }\n } else { // username not found\n respMap.put( \"message\" , \"Username : [\" + username + \"] or password : [\" + password + \"] incorrect\");\n respMap.put( \"success\" , \"\"+0);\n respMap.put(\"httpStatus\", \"\"+ HttpStatus.OK);\n\n }\n\n\n\n return new ResponseEntity<>(respMap, httpStatus);\n }", "boolean isUserExist(String username) throws ErrorConnectionException, TException;", "@Test\n public final void testCreateUserInJSONUserAlreadyExists() {\n \n try {\n \tUserAPI fixture = new UserAPI();\n String input = \"{\\\"userName\\\":\\\"Txuso\\\", \\\"password\\\": \\\"213\\\"}\";\n \tfixture.createUserInJSON(input);\n } catch (WebApplicationException e) {\n \tassertNotNull(Response.Status.NOT_ACCEPTABLE.getStatusCode());\n }\n }", "@Test\n\tpublic void testUpdateUser_wrongUsername() {\n\t\tLogin login = new Login(\"unique_username_14365432\", \"password\");\n\t\tResponse response = createUser(login);\n\t\t//printResponse(response);\n\t\tassertEquals(Status.OK.getStatusCode(), response.getStatus());\n\t\t\n\t\t//update the user\n\t\tLogin update = new Login(\"unique_username_645324\", \"a_different_password\");\n\t\tupdate.encryptPassword(passwordEncryptionKey);\n\t\t//change the password (to test a wrong password)\n\t\tlogin.setUsername(\"a_not_existing_username_64234e985243\");\n\t\tString resource = \"update_user\";\n\t\tString requestType = \"POST\";\n\t\t\n\t\tList<Login> updateLogins = Arrays.asList(login, update);\n\t\t\n\t\tresponse = sendRequest(resource, requestType, Entity.entity(updateLogins, MediaType.APPLICATION_JSON));\n\t\t//printResponse(response);\n\t\tassertEquals(Status.NOT_FOUND.getStatusCode(), response.getStatus());\n\t}", "public void receiveResultcheckIfInwentUserExist(\r\n net.agef.jobexchange.webservice.tests.util.UserWSStub.CheckIfInwentUserExistResponse result\r\n ) {\r\n }", "@Ignore(\"Test is not done yet\")\n @Test\n public void testChangingUsernameToExisting() {\n final UserRequest request = new UserRequest();\n // We're currently logged in as Austria, so we're trying to change the\n // username to Germany.\n request.setNewUsername(\"[email protected]\");\n final Response response = administration.controlUserAccount(token, request);\n assertThat(response.getError(), is(IWSErrors.FATAL));\n }", "public UsernameOkResponse( IFieldsContainer container) throws Exception{\n\t\tthis(container.getFieldValue(UsernameMessageFieldValue.class).getUsername());\n\t}", "@Test\n public void testUserNotifiedOnRegistrationSubmission() throws Exception {\n ResponseEntity<String> response = registerUser(username, password);\n assertNotNull(userService.getUser(username));\n assertEquals(successUrl, response.getHeaders().get(\"Location\").get(0));\n }", "@Test\n\tpublic void registerUserTest2() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass123\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(true);\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(400)).andExpect(status().reason(usernameTaken));\n\t}", "@Override\n public ResponseEntity<String> createUser(@ApiParam(value = \"\" ,required=true ) @Valid @RequestBody User user) {\n String problem = detectFormatProblemInUser(user);\n if(problem != null) {\n return new ResponseEntity<>(problem, HttpStatus.BAD_REQUEST);\n }\n // Used to prevent bruteforce listing of existing emails\n try {\n Thread.sleep(200);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n // Ensure the email is not already taken by another user\n if(userRepository.findById(user.getEmail()).isPresent()) {\n return new ResponseEntity<>(\"The email address is already taken\", HttpStatus.CONFLICT);\n }\n // We can store the new user in the database\n userRepository.save(userToUserEntity(user));\n return new ResponseEntity<>(\"User created successfully\", HttpStatus.CREATED);\n }", "private boolean isExistUserName(String userName, String userId) {\n User user = userService.findByUserNameAndStatus(userName, Constant.Status.ACTIVE.getValue());\n if (user != null && !user.getUserId().equals(userId)) {\n return true;\n }\n return false;\n }", "private void logic_for_username() {\n userID = SCUtils.getUniqueID(getApplicationContext());\n databaseRef.child(\"users\").child(userID).addListenerForSingleValueEvent(new ValueEventListener() {\n @Override public void onDataChange(DataSnapshot dataSnapshot) {\n progressBar.setVisibility(View.GONE);\n if (!dataSnapshot.exists()) {\n show_alert_username();\n } else {\n username = dataSnapshot.getValue(String.class);\n Snackbar.make(findViewById(android.R.id.content), \"Logged in as \" + username, Snackbar.LENGTH_SHORT).show();\n }\n }\n\n @Override public void onCancelled(DatabaseError databaseError) {\n Log.w(\"!!!\", \"username:onCancelled\", databaseError.toException());\n }\n });\n }", "public boolean isUsernameExist(String un) {\n\n boolean exist = false;\n\n // accessing registeredUser table (collection)\n MongoCollection<Document> collection = db.getCollection(\"registeredUser\");\n\n // ----- get document of given username from registeredData -----\n System.out.println(\"\\nVerifying if username already exists or not\\n--------------------\\n\");\n String colUsername = \"username\"; // set key and value to look for in document\n FindIterable<Document> docOne = collection.find(Filters.eq(colUsername, un)); // find document by filters\n MongoCursor<Document> cursor1 = docOne.iterator(); // set up cursor to iterate rows of documents\n try {\n // cursor1 will only have 1 data if we found a match\n if (cursor1.hasNext()) {\n System.out.println(\"Username already exists\");\n exist = true;\n }\n else {\n System.out.println(\"Username is available to register\");\n }\n } finally {\n cursor1.close();\n }\n\n return exist;\n }", "public boolean existsUser(String username);", "@Override\n\tpublic String execute(HttpServletRequest request, HttpServletResponse response) {\n\t\tString userid = request.getParameter(\"userid\");\n\t\tHttpSession session = request.getSession();\n\t\tLoginServiceImpl service=LoginServiceImpl.getLoginService();\n\t\tservice.setCustomerDAO(CustomerDAOImpl.getCustomerDaoImpl());\n\t\t\n\t\tif(service.CheckCustomer(userid)) {\n\t\t\tSystem.out.println(\"user existance\"+service.CheckCustomer(userid));\n\t\t\tif(!service.checkFlag(userid)) {\n\t\t\t\tservice.UpdateFlag(userid,1);\n\t\t\t\tsession.setAttribute(\"userid\", userid);\n\t\t\t\treturn \"login.success\";\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treturn \"login.register\";\n\t\t}\n\t\t\n\t\treturn \"login.register\";\n\t\t\n\t}", "private void checkAction(HttpServletRequest req, HttpServletResponse resp) throws SQLException, IOException {\n\t\tString account = req.getParameter(\"account\");\r\n\t\tString password = req.getParameter(\"password\");\r\n\t\tManage manage = this.service.checkLogin(account, password);\r\n\r\n\t\t// 如果User不是空,证明账号密码正确\r\n\t\tif (manage != null) {\r\n\t\t\tsession.setAttribute(\"MANAGEINSESSION\", manage);\r\n//\t\t\tresp.sendRedirect(path + \"/jsps/manage/index.jsp\");\r\n\t\t\tpw.print(true);\r\n\t\t} else {\r\n\t\t\tpw.print(false);\r\n//\t\t\tresp.sendRedirect(path + \"/jsps/manage/login.jsp\");\r\n\t\t}\r\n\t\treturn;\r\n\t}", "@PostMapping(value = \"\")\n public User create(@RequestBody User user, HttpServletResponse response) {\n if(StringUtils.isEmpty(user.getUsername())) {\n throw new IllegalArgumentException(\"Invalid username\");\n }\n\n User userCreated = userService.create(user);\n response.setStatus(HttpStatus.CREATED.value());\n return userCreated;\n }", "public boolean checkUserName(TextField userName) {\n String userNameSQL = \"SELECT * FROM user WHERE user_name = ? \";\n ResultSet rsUser;\n boolean username_exists = false;\n\n\n try {\n\n PreparedStatement userPST = connection.prepareStatement(userNameSQL);\n userPST.setString(1, userName.getText());\n rsUser = userPST.executeQuery();\n\n if (rsUser.next()) {\n username_exists = true;\n outputText.setStyle(\"-fx-text-fill: #d33232\");\n outputText.setText(\"Username Already Exists\");\n }\n\n } catch (SQLException throwables) {\n throwables.printStackTrace();\n }\n\n return username_exists;\n\n }", "@Test\n public void userNameExists ()throws SQLException {\n Connection conn = DriverManager.getConnection(\"jdbc:mysql://localhost/users\", \"root\", \"tech\");\n Statement stmt= (Statement) conn.createStatement();\n sql = \"SELECT * FROM user WHERE userName='\"+uName+\"'\";\n rs = stmt.executeQuery(sql);\n \n while(rs.next()){\n uName=rs.getString(\"username\");\n }\n \n boolean exists=false;\n if(uName==null){\n System.out.println(\"Username does not exist!\");\n exists=false;\n assertTrue(exists=false);\n //return exists;\n }\n System.out.println(\"Username already exists!\");\n exists=true;\n assertTrue(exists=true);\n //return exists;\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException{\n LoginValidator loginValidator = new LoginValidator();\n \n response.setContentType(\"text/html;charset=UTF-8\");\n String user = request.getParameter(\"usuario\");\n String password = request.getParameter(\"clave\");\n \n //The user exists\n if(loginValidator.validateUser(user, password)){\n //We redirect the user to another servlet\n response.sendRedirect(\"\");\n } \n //The user doesn't exists\n else {\n //We redirect the user to another servlet\n response.sendRedirect(\"\");\n }\n }", "@RequestMapping(value = \"/twitterUpdateUsername/\", method = RequestMethod.POST)\n\tpublic String twitterUpdateUsername(HttpServletRequest req,\n\t\t\t@RequestParam(value = \"t_username\", defaultValue = \"null\") String t_username) {\n\n\t\tSystem.out.println(\"Updating twitter data!\");\n\t\tHttpSession session = req.getSession();\n\t\tString username = (String) session.getAttribute(\"username\");\n\t\tSystem.out.println(\"Here twitter Update Username: \" + username);\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\n\t\tDate date = new Date();\n\t\tRestTemplate restTemplate = new RestTemplate();\n\t\trestTemplate.setErrorHandler(new DefaultResponseErrorHandler() {\n\t\t\tprotected boolean hasError(HttpStatus statusCode) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t\tSocialMediaAccess smaNewCreate = new SocialMediaAccess(username, \"twitter\", \"twitter_username\", t_username,\n\t\t\t\t\"long_live\", dateFormat.format(date));\n\t\tResponseEntity<SocialMediaAccess> smaTwitter = restTemplate.getForEntity(uriReadSM + username + \"/twitter/\",\n\t\t\t\tSocialMediaAccess.class);\n\n\t\tSystem.out.println(\"--------------------------START check in smaTwitter. username: \" + username);\n\t\tif (smaTwitter.getStatusCode().equals(HttpStatus.OK)) {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"--------------------------***START. There is smaTwitter in database. need to UPDATE. smaFB.id: \"\n\t\t\t\t\t\t\t+ smaTwitter.getBody().getSma_id());\n\t\t\tsmaNewCreate.setSma_id(smaTwitter.getBody().getSma_id());\n\t\t\trestTemplate.put(uriUpdateSMA, smaNewCreate);\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"--------------------------***END. There is smaTwitter in database. need to UPDATE. smaFB.id: \"\n\t\t\t\t\t\t\t+ smaTwitter.getBody().getSma_id());\n\t\t} else {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"--------------------------******START. There is NO smaTwitter in database. need to CREATE.\");\n\t\t\tResponseEntity<SocialMediaAccess> resmaCreated = restTemplate.postForEntity(uriCreateSMA, smaNewCreate,\n\t\t\t\t\tSocialMediaAccess.class);\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"--------------------------******END. There is NO smaTwitter in database. need to CREATE.\");\n\t\t}\n\t\tSystem.out.println(\"--------------------------END check in smaTwitter\");\n\n\t\t// START getting twitter data\n\t\tSystem.out.println(\"Getting twitter data\");\n\n\t\tResponseEntity<SocialMediaData[]> smDataArr = restTemplate.postForEntity(uriGetTwitterDataWeb, smaNewCreate,\n\t\t\t\tSocialMediaData[].class);\n\t\tSystem.out.println(\"+++START Twitter update data. smdLength: \" + smDataArr.getBody().length);\n\t\t// START storing of twitter data to database\n\t\tfor (SocialMediaData smData : smDataArr.getBody()) {\n\t\t\tResponseEntity<SocialMediaData> oldsmd = restTemplate\n\t\t\t\t\t.getForEntity(uriGetSMDataByID + smData.getData_id() + \"/\", SocialMediaData.class);\n\t\t\tif (oldsmd.getStatusCode().equals(HttpStatus.OK)) {\n\t\t\t\tSystem.out.println(\"Social Media Data Id = \" + smData.getData_id() + \" exists already\");\n\t\t\t} else {\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.println(\"Social Media Data id = \" + smData.getData_id() + \" doesn't exists. Need to create..\");\n\t\t\t\tResponseEntity<SocialMediaData> smD = restTemplate.postForEntity(uriSocialMediaDataCreate, smData,\n\t\t\t\t\t\tSocialMediaData.class);\n\t\t\t}\n\t\t\t/*\n\t\t\t * System.out.println(\"Printing: \" + smData.getData());\n\t\t\t * ResponseEntity<SocialMediaData> smD =\n\t\t\t * restTemplate.postForEntity(uriSocialMediaDataCreate, smData,\n\t\t\t * SocialMediaData.class);\n\t\t\t */\n\t\t}\n\t\tSystem.out.println(\"+++END Updating twitter data+++\");\n\n\t\t// END storing of twitter data to database\n\t\t// END getting twitter data\n\t\tdoAsyncProcessCharacter(username);\n\t\t//\n\t\t// HttpSession session = req.getSession();\n\t\t// String username = (String) session.getAttribute(\"username\");\n\t\t// doAsyncProcessCharacter(username);\n\t\treturn \"redirect:../home\";\n\t}", "void addUser(Username username) throws UserAlreadyExistsException;", "private boolean requestNewAccount() {\n\t\tServerAPITask userTasks = new ServerAPITask();\n\t\tString uName = usernameField.getText().toString();\n\t\tuserTasks.setAPIRequest(\"http://riptide.alexkersten.com:3333/stoneapi/account/lookup/\" + uName);\n\t\ttry {\n\t\t\tString response = userTasks.execute(\"\").get();\n\t\t\tLog.e(\"Response String\", response);\n\t\t\t\n\t\t\tjsonResponse = new JSONArray(response);\n\t\t\tif (jsonResponse.length() > 0) {\n\t\t\t\tToast.makeText(this.getContext(), \"The username already exists\", Toast.LENGTH_LONG).show();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tuserTasks = new ServerAPITask();\n\t\t\t\tuserTasks.setAPIRequest(\"http://riptide.alexkersten.com:3333/stoneapi/account/create/\" + uName);\n\t\t\t\t\n\t\t\t\tString createResp = userTasks.execute(\"\").get();\n\t\t\t\tLog.e(\"Create Response\", createResp);\n\t\t\t\tJSONObject cObj = new JSONObject(createResp);\n\t\t\t\t\n\t\t\t\tString success = cObj.getString(\"success\");\n\t\t\t\tif (success.equals(\"false\")) {\n\t\t\t\t\tToast.makeText(this.getContext(), \"The username already exists\", Toast.LENGTH_LONG).show();\n\t\t\t\t}\n\t\t\t\telse if (success.equals(\"true\")) {\t\t\t\t\t\n\t\t\t\t\tuserTasks = new ServerAPITask();\n\t\t\t\t\tuserTasks.setAPIRequest(\"http://riptide.alexkersten.com:3333/stoneapi/account/lookup/\" + uName);\n\t\t\t\t\t\n\t\t\t\t\tcreateResp = userTasks.execute(\"\").get();\n\t\t\t\t\tLog.e(\"Get User ID\", createResp);\n\t\t\t\t\t\n\t\t\t\t\tjsonResponse = new JSONArray(createResp);\n\t\t\t\t\tJSONObject jsObj = jsonResponse.getJSONObject(0);\n\t\t\t\t\t\n\t\t\t\t\tif (jsObj == null) {\n\t\t\t\t\t\tToast.makeText(this.getContext(), \"An error occurred while retrieving user\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tString _user_id = jsObj.getString(\"_id\");\n\t\t\t\t\t\tPreferencesUtil.saveToPrefs(userContext, PreferencesUtil.PREFS_LOGIN_USER_ID_KEY, _user_id);\n\t\t\t\t\t\tPreferencesUtil.saveToPrefs(userContext, PreferencesUtil.PREFS_LOGIN_USERNAME_KEY, uName);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn true;\n\t}", "@PreAuthorize(\"permitAll()\")\n @GetMapping(\"/users/username-available\")\n public ResponseEntity<Boolean> isUsernameAvailable(@RequestParam(value = \"username\") String username) {\n return new ResponseEntity<>(userService.getUserByUsername(username) == null, HttpStatus.OK);\n }", "@Test\n\tvoid shouldFindUserWithIncorrectUsername() throws Exception {\n\t\tUser user = this.userService.findUserByUsername(\"antonio98\");\n\t\tAssertions.assertThat(user.getUsername()).isNotEqualTo(\"fernando98\");\n\t}", "public boolean registerNewUser(String un, String pw, String fn, String ln, String sq, String sa, int age) {\n\n boolean success;\n\n if (isUsernameExist(un)) {\n success = false;\n }\n else {\n // encrypting input password\n SHAEncryption sha = new SHAEncryption();\n String shaPW = sha.getSHA(pw);\n\n // accessing registeredUser table (collection)\n MongoCollection<Document> collRU = db.getCollection(\"registeredUser\");\n\n // creating new user document based on the input from UI\n Document newUser = new Document(\"username\", un)\n .append(\"password\", shaPW)\n .append(\"firstName\", fn)\n .append(\"lastName\", ln)\n .append(\"age\", age)\n .append(\"secureQ\", sq)\n .append(\"secureA\", sa.toLowerCase())\n .append(\"status\", \"\")\n .append(\"hidefriends\",false)\n .append(\"hideposts\",false)\n .append(\"hideage\",false)\n .append(\"hidestatus\",false);\n\n // insert newUser into registeredUser collection\n collRU.insertOne(newUser);\n System.out.println(\"Username \" + un + \" is registered!\");\n success = true;\n \n // create followList for new user\n db.getCollection(\"followList\").insertOne(\n new Document(\"username\", un).append(\"following\", new ArrayList<String>()));\n }\n\n return success;\n }", "protected void userSave(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\n\t\t// check if the typed name is real\n\t\ttry {\n\t\t\tInteger.parseInt(strFullname);\n\t\t\tsendError(request, response,\n\t\t\t\t\t\"You can't type number for your Full Name!\");\n\t\t\treturn;\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t// check if the user is filled all the lines\n\t\tif ((strUsername.equals(\"\")) || strPassword.equals(\"\")\n\t\t\t\t|| strFullname.equals(\"\") || strEmail.equals(\"\")) {\n\t\t\tsendError(request, response, \"Please, fill the lines with *\");\n\t\t\treturn;\n\t\t}\n\t\t// Check for valid email\n\t\ttry {\n\t\t\tString emailregex = \"^[_A-Za-z0-9-]+(\\\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\\\.[A-Za-z0-9-]+)*(\\\\.[A-Za-z]{2,})$\";\n\t\t\tBoolean b = strEmail.matches(emailregex);\n\t\t\tif (b == false) {\n\t\t\t\tsendError(request, response, \"Invalid Email\");\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tMySql sql = new MySql();\n\t\t// check if there is another user registered with the same name and\n\t\t// email\n\t\tif (sql.DublicateUsernameEmail(strUsername, strEmail)) {\n\t\t\tsendError(request, response,\n\t\t\t\t\t\"There is another person with the same Name and Email!\");\n\t\t\treturn;\n\t\t}\n\t\tsql.insertUserInfo(strUsername, strPassword, strFullname, strEmail);\n\t}", "@Test(expected = UserAlreadyExists.class)\n public void registryUserExists() throws Exception {\n\n User user_expected = new User();\n user_expected.setId(1L);\n user_expected.setName(\"nametest\");\n user_expected.setLast_name(\"lastnametest\");\n user_expected.setUsername(\"usernametest\");\n user_expected.setPassword(\"a7574a42198b7d7eee2c037703a0b95558f195457908d6975e681e2055fd5eb9\");\n\n given(userRepository.findByUsername(anyString())).willReturn(Optional.of(user_expected));\n\n User user_saved = userServiceImpl.registryUser(this.user);\n\n }", "public boolean checkUsername(String user) {\n\n }", "public String checkUsername() {\n String username = \"\"; // Create username\n boolean isOK = true; // Condition loop\n\n while (isOK) {\n username = checkEmpty(\"Account\"); // Call method to check input of username\n boolean isExist = false; // Check exist username\n for (Account acc : accounts) {\n // If username is exist, print out error\n if (username.equals(acc.getUsername())) {\n System.out.println(\"This account has already existed\");\n System.out.print(\"Try another account: \");\n isExist = true;\n }\n }\n // If username not exist then return username\n if (!isExist) {\n return username;\n }\n }\n return username; // Return username\n }", "boolean loginUser(String email,String password){\n boolean checkUserDetails = checkLoginDetails(email,password);\n boolean userExists = false;\n if(checkUserDetails){\n try{\n userExists =true;\n stmt = con.prepareStatement(\"UPDATE users SET userStatus = ? WHERE email = ?\");\n stmt.setBoolean(1,true);\n stmt.setString(2,email);\n stmt.executeUpdate();\n }\n catch(Exception e){\n e.printStackTrace();\n }\n finally{\n closeConnection();\n }\n }\n return userExists;\n }", "boolean createAccount(String username,String email,String password){\n boolean isEmailExist = checkEmailExist(email);\n boolean isnewUser = false;\n if(isEmailExist){\n System.out.println(\"email already exists\");\n }\n else{\n if(email !=\"\" && email !=null && username !=\"\" && username !=null && password !=\"\" && password !=null){\n try{\n stmt = con.prepareStatement(\"INSERT INTO users(name,email,password) VALUES(?,?,?)\");\n stmt.setString(1,username);\n stmt.setString(2,email);\n stmt.setString(3,password);\n stmt.executeUpdate();\n isnewUser = true;\n }\n catch(Exception e){\n e.printStackTrace();\n }\n finally{\n closeConnection();\n }\n }\n else{\n System.out.println(\"Please check the value\");\n }\n }\n return isnewUser;\n }", "public void receiveResultcheckIfUserExist(\r\n net.agef.jobexchange.webservice.tests.util.UserWSStub.CheckIfUserExistResponse result\r\n ) {\r\n }", "@POST\n @Path(\"Signup\")\n public Response signup(JpaAccount account,\n @Context HttpServletRequest request) {\n Response r;\n if (this.checkEmailString(account.getEmail())) {\n if (account.getUsername().equals(\"\") || !this.checkExistingUsername(account.getUsername())) {\n User user;\n Subject subject = SecurityUtils.getSubject();\n\n if (subject.isAuthenticated() && accountFacade.find((Long) subject.getPrincipal()) instanceof GuestJpaAccount) {\n GuestJpaAccount from = (GuestJpaAccount) accountFacade.find((Long) subject.getPrincipal());\n subject.logout();\n userFacade.upgradeGuest(from, account);\n r = Response.status(Response.Status.CREATED).build();\n } else {\n // Check if e-mail is already taken and if yes return a localized error message:\n try {\n accountFacade.findByEmail(account.getEmail());\n String msg = detectBrowserLocale(request).equals(\"fr\") ? \"Cette adresse e-mail est déjà prise.\" : \"This email address is already taken.\";\n r = Response.status(Response.Status.BAD_REQUEST).entity(WegasErrorMessage.error(msg)).build();\n } catch (WegasNoResultException e) {\n // GOTCHA\n // E-Mail not yet registered -> proceed with account creation\n user = new User(account);\n userFacade.create(user);\n r = Response.status(Response.Status.CREATED).build();\n }\n }\n } else {\n String msg = detectBrowserLocale(request).equals(\"fr\") ? \"Ce nom d'utilisateur est déjà pris.\" : \"This username is already taken.\";\n r = Response.status(Response.Status.BAD_REQUEST).entity(WegasErrorMessage.error(msg)).build();\n }\n } else {\n String msg = detectBrowserLocale(request).equals(\"fr\") ? \"Cette adresse e-mail n'est pas valide.\" : \"This e-mail address is not valid.\";\n r = Response.status(Response.Status.BAD_REQUEST).entity(WegasErrorMessage.error(msg)).build();\n }\n return r;\n }", "@PostMapping// this matches post key word\n\tpublic ResponseEntity<UsersModel> saveNewUser(@RequestBody UsersModel u){\n\t\tif(u.getUserId() != 0) {\n\t\t\treturn new ResponseEntity(\"userId must be 0\", HttpStatus.BAD_REQUEST);\n\t\t}\n\t\treturn new ResponseEntity<UsersModel>(us.saveNewUser(u), HttpStatus.CREATED);\n\t}", "private void handleUser(String username) {\n if (username.toLowerCase().equals(validUser)) {\n sendMsgToClient(\"331 User name okay, need password\");\n currentUserStatus = userStatus.ENTEREDUSERNAME;\n } else if (currentUserStatus == userStatus.LOGGEDIN) {\n sendMsgToClient(\"530 User already logged in\");\n } else {\n sendMsgToClient(\"530 Not logged in\");\n }\n }", "private boolean validateUsername() {\n // Get doctor's username\n EditText doctorUsername = (EditText) rootView.findViewById(R.id.doctorField);\n String doctorUsernameString = doctorUsername.getText().toString();\n // Query on server using that username\n try {\n String query = String.format(\"select `username` from `user` inner join `doctor` on user.id=doctor.userid where username='%s'\", doctorUsernameString); // query to check username existence\n Document document = Jsoup.connect(Constants.SERVER + query).get();\n String queryJson = document.body().html();\n if (queryJson.equals(\"0\")) { // Username not existed\n return false;\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n // Get patient's username\n EditText patientUsername = (EditText) rootView.findViewById(R.id.patientField);\n String patientUsernameString = patientUsername.getText().toString();\n // Query on server using that username\n try {\n String query = String.format(\"select `username` from `user` inner join `patient` on user.id=patient.userid where username='%s'\", patientUsernameString); // query to check username existence\n Document document = Jsoup.connect(Constants.SERVER + query).get();\n String queryJson = document.body().html();\n if (queryJson.equals(\"0\")) { // Username not existed\n return false;\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return true;\n }", "public boolean isExistingUsername(String username) {\n boolean isExistingUser = false; \n \n List<User> retrievedUsersList = new LinkedList<User>(); \n retrievedUsersList = repo.returnAllUsers(); \n \n User aUser = null; \n for(var user : retrievedUsersList) {\n aUser = (User)user; \n \n if(aUser.username.equals(username)) {\n isExistingUser = true; \n }\n }\n \n return isExistingUser; \n }", "public void testFindUserByName() throws Exception\r\n {\r\n createUser(\"testFindUserByName\");\r\n\r\n // try to find existed user\r\n User u = uHandler.findUserByName(\"demo\");\r\n\r\n assertNotNull(u);\r\n assertEquals(\"demo@localhost\", u.getEmail());\r\n assertEquals(\"Demo\", u.getFirstName());\r\n assertEquals(\"exo\", u.getLastName());\r\n assertEquals(\"demo\", u.getUserName());\r\n assertTrue(u.isEnabled());\r\n\r\n // try to find a non existing user. We are supposed to get \"null\" instead of Exception.\r\n try\r\n {\r\n assertNull(uHandler.findUserByName(\"not-existed-user\"));\r\n }\r\n catch (Exception e)\r\n {\r\n fail(\"Exception should not be thrown\");\r\n }\r\n try\r\n {\r\n assertNull(uHandler.findUserByName(\"not-existed-user\", UserStatus.ENABLED));\r\n }\r\n catch (Exception e)\r\n {\r\n fail(\"Exception should not be thrown\");\r\n }\r\n try\r\n {\r\n assertNull(uHandler.findUserByName(\"not-existed-user\", UserStatus.DISABLED));\r\n }\r\n catch (Exception e)\r\n {\r\n fail(\"Exception should not be thrown\");\r\n }\r\n try\r\n {\r\n assertNull(uHandler.findUserByName(\"not-existed-user\", UserStatus.BOTH));\r\n }\r\n catch (Exception e)\r\n {\r\n fail(\"Exception should not be thrown\");\r\n }\r\n\r\n assertNotNull(uHandler.findUserByName(\"testFindUserByName\"));\r\n assertTrue(uHandler.findUserByName(\"testFindUserByName\").isEnabled());\r\n assertNotNull(uHandler.findUserByName(\"testFindUserByName\", UserStatus.ENABLED));\r\n assertTrue(uHandler.findUserByName(\"testFindUserByName\", UserStatus.ENABLED).isEnabled());\r\n assertNotNull(uHandler.findUserByName(\"testFindUserByName\", UserStatus.BOTH));\r\n assertTrue(uHandler.findUserByName(\"testFindUserByName\", UserStatus.BOTH).isEnabled());\r\n\r\n boolean unsupportedOperation = false;\r\n try\r\n {\r\n // Disable the user testFindUserByName\r\n uHandler.setEnabled(\"testFindUserByName\", false, true);\r\n\r\n // We should not find the user testFindUserByName anymore from the normal method\r\n assertNull(uHandler.findUserByName(\"testFindUserByName\"));\r\n assertNull(uHandler.findUserByName(\"testFindUserByName\", UserStatus.ENABLED));\r\n // We should find it using the method that includes the disabled user account\r\n assertNotNull(uHandler.findUserByName(\"testFindUserByName\", UserStatus.BOTH));\r\n assertFalse(uHandler.findUserByName(\"testFindUserByName\", UserStatus.BOTH).isEnabled());\r\n // We should find it using the method that queries only the disabled user account\r\n assertNotNull(uHandler.findUserByName(\"testFindUserByName\", UserStatus.DISABLED));\r\n assertFalse(uHandler.findUserByName(\"testFindUserByName\", UserStatus.DISABLED).isEnabled());\r\n\r\n // Enable the user testFindUserByName\r\n uHandler.setEnabled(\"testFindUserByName\", true, true);\r\n\r\n // We should find it again whatever the value of the parameter status\r\n assertNotNull(uHandler.findUserByName(\"testFindUserByName\"));\r\n assertTrue(uHandler.findUserByName(\"testFindUserByName\").isEnabled());\r\n assertNotNull(uHandler.findUserByName(\"testFindUserByName\", UserStatus.ENABLED));\r\n assertTrue(uHandler.findUserByName(\"testFindUserByName\", UserStatus.ENABLED).isEnabled());\r\n assertNotNull(uHandler.findUserByName(\"testFindUserByName\", UserStatus.BOTH));\r\n assertTrue(uHandler.findUserByName(\"testFindUserByName\", UserStatus.BOTH).isEnabled());\r\n // We should not find the user using the method that queries only the disabled user account\r\n assertNull(uHandler.findUserByName(\"testFindUserByName\", UserStatus.DISABLED));\r\n }\r\n catch (UnsupportedOperationException e)\r\n {\r\n // This operation can be unsupported\r\n unsupportedOperation = true;\r\n }\r\n\r\n // Remove the user testFindUserByName\r\n uHandler.removeUser(\"testFindUserByName\", true);\r\n\r\n // try to find a user that doesn't exist anymore. We are supposed to get \"null\" instead of Exception.\r\n try\r\n {\r\n assertNull(uHandler.findUserByName(\"testFindUserByName\"));\r\n }\r\n catch (Exception e)\r\n {\r\n fail(\"Exception should not be thrown\");\r\n }\r\n try\r\n {\r\n assertNull(uHandler.findUserByName(\"testFindUserByName\", UserStatus.ENABLED));\r\n }\r\n catch (Exception e)\r\n {\r\n fail(\"Exception should not be thrown\");\r\n }\r\n try\r\n {\r\n assertNull(uHandler.findUserByName(\"testFindUserByName\", UserStatus.DISABLED));\r\n }\r\n catch (Exception e)\r\n {\r\n fail(\"Exception should not be thrown\");\r\n }\r\n try\r\n {\r\n assertNull(uHandler.findUserByName(\"testFindUserByName\", UserStatus.BOTH));\r\n }\r\n catch (Exception e)\r\n {\r\n fail(\"Exception should not be thrown\");\r\n }\r\n\r\n // Check the listener's counters\r\n assertEquals(1, listener.preSaveNew);\r\n assertEquals(1, listener.postSaveNew);\r\n assertEquals(0, listener.preSave);\r\n assertEquals(0, listener.postSave);\r\n assertEquals(unsupportedOperation ? 0 : 2, listener.preSetEnabled);\r\n assertEquals(unsupportedOperation ? 0 : 2, listener.postSetEnabled);\r\n assertEquals(1, listener.preDelete);\r\n assertEquals(1, listener.postDelete);\r\n }", "private boolean isRequestAlreadySent(String friendName)\r\n\t{\r\n\t\tlogger.debug(\"->->->->-> Inside isUserExist method ->->->->->\");\r\n\t\tString loggedInUserName = (String) httpSession.getAttribute(\"loggedInUserName\");\r\n\t\tlogger.debug(\"UserName in isRequestAlreadySent :\"+loggedInUserName);\r\n\t\tif(friendDAO.getFriendWithUserNameAndFriendName(loggedInUserName,friendName)==null){\r\n\t\t\treturn false;\r\n\t\t}\t\r\n\t\telse{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "boolean hasUsername();", "boolean hasUsername();", "boolean hasUsername();", "boolean hasUsername();", "boolean hasUsername();", "boolean hasUsername();", "public abstract boolean checkUser(String username);", "@Override\n @SuppressWarnings(\"unchecked\")\n public boolean checkExists(String username) throws DAOException{\n \n try{\n Session session = HibernateConnectionUtil.getSession();\n \n Criteria crit = session.createCriteria(UserProfile.class);\n crit.add(Restrictions.eq(\"username\", username));\n List<UserProfile> userList = crit.list();\n session.close();\n return !userList.isEmpty();\n }\n catch(HibernateException e){\n throw new DAOException(\"HibernateException: \" + e.getMessage());\n }\n\n }", "@Override\n\tprotected void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tvalidateUser(request, response);\n\t}", "@Test\n\tvoid shouldFindUserWithCorrectUsername() throws Exception {\n\t\tUser user = this.userService.findUserByUsername(\"antonio98\");\n\t\tAssertions.assertThat(user.getUsername()).isEqualTo(\"antonio98\");\n\t}", "@Test\n public void whenFetchingNonExistingUserReturn404() throws Exception {\n Response<UserDTO> user = api.getUserDetails(1000).execute();\n\n // then http status code should be 404\n assertThat(user.code(), is(404));\n }", "private static boolean verificaUser(String username) {\n String user = null;\r\n try {\r\n PreparedStatement stmt = c.prepareStatement(\"SELECT * FROM utilizador where nome=?;\");\r\n stmt.setString(1, username);\r\n ResultSet rs = stmt.executeQuery();\r\n rs.next();\r\n user = rs.getString(\"nome\");\r\n if (user.equals(username)) {\r\n return true;\r\n }\r\n } catch (SQLException e) {\r\n System.out.println(e);\r\n }\r\n return false;\r\n }", "@Override\n\tpublic String save() throws Exception{\n\t\ttry {\n\t\t\tDate date = new Date();\n\t\t\tMap<String, Object> resultMap = new HashMap<String, Object>();\n\t\t\tString msg;\n\t\t\tif(username.isEmpty() || username.contains(\" \")){\n\t\t\t\tmsg = \"Invalid username, check your username and try again!\";\n\t\t\t\tthrow new Exception(msg);\n\t\t\t}\n\t\t\tif(password.isEmpty() || password.contains(\" \") || password.length() < 6 || password.length() > 16){\n\t\t\t\tmsg = \"Password must be 6-16 characters with no whitespaces!\";\n\t\t\t\tthrow new Exception(msg);\n\t\t\t}\n\t\t\tif(loginService.verifyUsername(username)){\n\t\t\t\tmsg = \"Username already exists!\";\n\t\t\t\tthrow new Exception(msg);\n\t\t\t}\n\t\t\tif(!password.equals(password2)){\n\t\t\t\tmsg = \"Passwords do not match, please check your passwords then submit again!\";\n\t\t\t\tthrow new Exception(msg);\n\t\t\t}\n\t\t\tif(!profileService.isValidEmailAddress(email)){\n\t\t\t\tmsg = \"Invalid email, please check that your email is written correctly, and try again.\";\n\t\t\t\tthrow new Exception(msg);\n\t\t\t}\n\t\t\tif(signupService.usedEmail(email)){\n\t\t\t\tmsg = \"Email has already been used!\";\n\t\t\t\tthrow new Exception(msg);\n\t\t\t}\n\t\t\tuserEntity.setIsDisabled(\"N\");\n\t\t\tuserEntity.setIsTutor(\"N\");\n\t\t\tuserEntity.setIsAdmin(\"N\");\n\t\t\tuserEntity.setIsVerified(\"N\");\n\t\t\tuserEntity.setCreateBy(\"System\");\n\t\t\tuserEntity.setCreateDate(date);\n\t\t\tuserEntity.setPassword(EncryptUtil.encrypt(password));\n\t\t\tsignupService.registerAccount(userEntity);\n\t\t\tStruts2Utils.getSession().setAttribute(SessionData.KEY_LOGIN_USER, userEntity);\n\t\t\tif(OnlineUtils.isUseRedis()){\n\t\t\t\tif(OnlineUtils.isOnline(username)){\n\t\t\t\t\tOnlineUtils.logout(username);\n\t\t\t\t}\n\t\t\t\tOnlineUtils.login(Struts2Utils.getSession().getId(), userEntity);\n\t\t\t}\n\t\t\tresultMap.put(\"username\", userEntity.getUsername());\n\t\t\tthis.writeSuccessResult(resultMap);\n\t\t} catch (Exception e){\n\t\t\te.printStackTrace();\n\t\t\tthis.writeErrorResult(e.getMessage());\n\t\t}\n\t\treturn null;\n\t}", "@Override\n\t\t\t\t\tpublic void onFail() {\n\t\t\t\t\t\tToast.makeText(RegisterActivity.this, \"Username already exists!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}", "@PostMapping\n public User addUser(@Validated(value = Create.class) @RequestBody User user) {\n try {\n return userService.addUser(user);\n }catch (UserIdAlreadyExistsException exception){\n throw new UserIdAlreadyExistsException(\"User Id Already Exists\");\n }\n }", "@PostMapping(path = \"/register\",\n produces={MediaType.APPLICATION_JSON_VALUE, MediaType.TEXT_PLAIN_VALUE})\n @Timed\n public ResponseEntity registerAccount(@Valid @RequestBody ManagedUserVM managedUserVM) {\n\n HttpHeaders textPlainHeaders = new HttpHeaders();\n textPlainHeaders.setContentType(MediaType.TEXT_PLAIN);\n\n return userRepository.findOneByLogin(managedUserVM.getLogin().toLowerCase())\n .map(user -> new ResponseEntity<>(\"login already in use\", textPlainHeaders, HttpStatus.BAD_REQUEST))\n .orElseGet(() -> userRepository.findOneByEmail(managedUserVM.getEmail())\n .map(user -> new ResponseEntity<>(\"e-mail address already in use\", textPlainHeaders, HttpStatus.BAD_REQUEST))\n .orElseGet(() -> {\n User user = userService\n .createUser(managedUserVM.getLogin(), managedUserVM.getPassword(),\n managedUserVM.getFirstName(), managedUserVM.getLastName(),\n managedUserVM.getEmail().toLowerCase(), managedUserVM.getImageUrl(), managedUserVM.getLangKey());\n\n mailService.sendActivationEmail(user);\n return new ResponseEntity<>(HttpStatus.CREATED);\n })\n );\n }", "@PostMapping(\"/signup\")\n public ResponseEntity<?> registerUser(@Valid @RequestBody SignupRequest signupRequest) {\n System.out.println(\"Creating User \" + signupRequest);\n\n if (userAccountDetailsService.isUserExistByUsername(signupRequest.getUsername())) {\n System.out.println(\"A User with username: \" + signupRequest.getUsername() + \" already exist\");\n return new ResponseEntity<Void>(HttpStatus.CONFLICT);\n }\n\n UserAccount userAccount = new UserAccount();\n userAccount.setName(signupRequest.getName());\n userAccount.setUsername(signupRequest.getUsername());\n userAccount.setAge(signupRequest.getAge());\n userAccount.setPassword(passwordEncoder.encode(signupRequest.getPassword()));\n\n Set<String> roles = signupRequest.getRole();\n Set<Authorities> authorities = new HashSet<>();\n for(String role: roles) {\n Authorities authority = new Authorities();\n authority.setAuthority(role);\n authority.setUserAccount(userAccount);\n authorities.add(authority);\n }\n userAccount.setAuthorities(authorities);\n\n userAccountDetailsService.saveUser(userAccount);\n\n return new ResponseEntity<Void>(HttpStatus.CREATED);\n }", "@Override\n\tpublic int validateUsername(User u) {\n\t\treturn 0;\n\t}", "@PreAuthorize(\"hasRole('ROLE_ADMIN')\")\n\t@RequestMapping(value = \"/users\", method = RequestMethod.POST)\n\tpublic ResponseEntity<AppUser> createUser(@RequestBody AppUser appUser) {\n\t\tif (appUserRepository.findOneByUsername(appUser.getUsername()) != null) {\n\t\t\tthrow new RuntimeException(\"Username already exist\");\n\t\t}\n\t\treturn new ResponseEntity<AppUser>(appUserRepository.save(appUser), HttpStatus.CREATED);\n\t}", "@Test\n\tpublic void testCreateAdminAccountWithTakenUsername() {\n\n\t\tString error = null;\n\t\tAdminAccount user = null; \n\t\ttry {\n\t\t\tuser = adminAccountService.createAdminAccount(USERNAME1, PASSWORD1, NAME1);\n\t\t} catch (InvalidInputException e) {\n\t\t\terror = e.getMessage();\n\t\t}\n\n\t\tassertNull(user);\n\t\t// check error\n\t\tassertEquals(\"This username is not available.\", error);\n\t}", "@PostMapping(path = \"register_user\")\n public String registerUser(User newUser){\n for(User user:users) {\n if (user.getEmailId().equals(newUser.getEmailId())) {\n return \"user_exists\";\n }\n }\n users.add(newUser);\n return \"register_success\";\n }", "void checkUserName() {\n usernameChecked = false;\n signInUpController.checkUserName(userNameText.getText().toString(), new OnTaskListeners.Bool() {\n @Override\n public void onSuccess(Boolean result) {\n usernameChecked = true;\n if (result)\n uniqueUsername = false;\n else\n uniqueUsername = true;\n\n\n }\n });\n }", "public User userExist(User user);", "@Override\n\tpublic ResponseEntity<String> updateUser() {\n\t\treturn null;\n\t}", "boolean isUserExist(String username, String password);", "public boolean isThereSuchAUser(String username, String email) ;", "@ResponseBody\n @ExceptionHandler(UserNotFoundException.class)\n @ResponseStatus(HttpStatus.NOT_FOUND)\n String userNotFoundHandler(UserNotFoundException ex) {\n return ex.getMessage();\n }", "boolean existsByUsername(String username);", "public boolean userNameExists(){\r\n boolean userNameExists = false;\r\n //reads username and password\r\n String user = signup.getUsername();\r\n String pass = signup.getFirstPassword();\r\n try{\r\n //creates statement\r\n //connects to database\r\n \r\n Connection myConn = DriverManager.getConnection(Main.URL); \r\n \r\n //creates statement\r\n Statement myStmt = myConn.createStatement();\r\n System.out.println(\"statement initiated\");\r\n //SQL query\r\n ResultSet myRs = myStmt.executeQuery(\"select * from LISTOFUSERS \");\r\n System.out.println(\"query initiated\");\r\n //process result set\r\n //checks to see if the username already exists in the database\r\n while (myRs.next()){\r\n System.out.println(\"check\");\r\n if(user.equals(myRs.getString(\"USERNAME\"))){\r\n \r\n userNameExists = true;\r\n break;\r\n }\r\n }\r\n myConn.close();\r\n \r\n \r\n \r\n } catch (Exception e) \r\n {\r\n System.err.println(e.getMessage());\r\n } \r\n return userNameExists; \r\n }" ]
[ "0.6898705", "0.689064", "0.66457725", "0.6460312", "0.6431024", "0.6395562", "0.6388038", "0.6384723", "0.6367195", "0.6359834", "0.6350159", "0.6329772", "0.6294451", "0.6293061", "0.6291142", "0.6283558", "0.62797076", "0.6241704", "0.62292904", "0.62215173", "0.6201681", "0.6200684", "0.6143908", "0.6142792", "0.60892105", "0.60753304", "0.60599816", "0.6039049", "0.60243887", "0.6014285", "0.60129726", "0.60098207", "0.6006733", "0.5999109", "0.5997307", "0.5995391", "0.5982948", "0.5980384", "0.5965329", "0.59612125", "0.59549236", "0.59501934", "0.594662", "0.591085", "0.5903786", "0.5893742", "0.5885154", "0.5884468", "0.58663374", "0.5862986", "0.5860607", "0.58556277", "0.58516383", "0.58482987", "0.5843849", "0.5839616", "0.5839098", "0.58319145", "0.5831163", "0.5825598", "0.5824639", "0.5821111", "0.5819893", "0.58156615", "0.5814026", "0.58085376", "0.5789985", "0.57816905", "0.5779541", "0.577746", "0.57774216", "0.5776346", "0.5775703", "0.5775703", "0.5775703", "0.5775703", "0.5775703", "0.5775703", "0.5774212", "0.5768545", "0.5760862", "0.5760859", "0.5759098", "0.5756922", "0.5756832", "0.57540166", "0.5751497", "0.57381064", "0.57327425", "0.57176536", "0.5715766", "0.5709716", "0.57037574", "0.5701284", "0.5696562", "0.56939507", "0.56909335", "0.5683728", "0.5682873", "0.5677591", "0.5668776" ]
0.0
-1
The function returns true if the received username exist in the system otherwise false
@RequestMapping(value = "is_exist_user", method = { RequestMethod.GET }) public boolean isExistUser(@RequestParam("username") String username) throws IOException { System.out.println(username); boolean result = true; MongoClient mongoClient = null; try { // Create Mongo client mongoClient = new MongoClient("localhost", 27017); MongoDatabase db = mongoClient.getDatabase("projectDB"); // Create Users collection and user document MongoCollection<Document> collection = db.getCollection("USERS"); Document myDoc = collection.find(eq("username", username)).first(); //In case no document in the collection match the condition, the user not exist in the DB if (myDoc == null) { mongoClient.close(); return false; } //Close DB connection mongoClient.close(); } catch (Exception e) { mongoClient.close(); System.out.println(e); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean userNameExist(String username);", "public Boolean isUsernameExist(String username);", "boolean isUsernameExist(String username);", "boolean hasUsername();", "boolean hasUsername();", "boolean hasUsername();", "boolean hasUsername();", "boolean hasUsername();", "boolean hasUsername();", "boolean hasUserName();", "boolean exists(String username);", "public boolean existsUser(String username);", "public boolean checkUsername(String user) {\n\n }", "boolean isUserExists(Username username);", "boolean isUser(String username);", "boolean existsByUsername(String username);", "boolean exists(String userName);", "public abstract boolean checkUser(String username);", "public boolean isRegisteredUserName(String userName);", "public boolean isUser(String userName) throws Exception;", "public boolean existsByUsername(String username);", "boolean isUserExist(String username, String password);", "private boolean checkExistingUsername(String username) {\n boolean existingUsername = false;\n User user = userFacade.getUserByUsername(username);\n if (user != null) {\n existingUsername = true;\n }\n return existingUsername;\n }", "@Override\r\n\tpublic Boolean userExist(String username) {\n\t\treturn null;\r\n\t}", "public static boolean checkRegisteredUsername(String username){\n \tboolean found = false;\n \ttry {\n\t\t\tfound = DBHandler.isUsernameTaken(username, c); \n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n \treturn found;\n }", "public boolean findUserIsExist(String name) {\n\t\treturn false;\r\n\t}", "public boolean isUsernameTaken(String username) {\n\n db = this.getReadableDatabase();\n String query = \"select username from \"+ TABLE_NAME;\n Cursor cursor = db.rawQuery(query, null);\n\n String uname;\n\n if (cursor.moveToFirst()) {\n\n do {\n uname = cursor.getString(0);\n if(uname.equals(username)) {\n return true;\n }\n } while (cursor.moveToNext());\n }\n\n return false;\n }", "private static boolean verificaUser(String username) {\n String user = null;\r\n try {\r\n PreparedStatement stmt = c.prepareStatement(\"SELECT * FROM utilizador where nome=?;\");\r\n stmt.setString(1, username);\r\n ResultSet rs = stmt.executeQuery();\r\n rs.next();\r\n user = rs.getString(\"nome\");\r\n if (user.equals(username)) {\r\n return true;\r\n }\r\n } catch (SQLException e) {\r\n System.out.println(e);\r\n }\r\n return false;\r\n }", "public static Boolean checkUsername(String username){\n\t\t//String username = txtUsername.getText();\n\t\t//System.out.println(username);\n\t\treturn (username.equals(\"Admin\"));\n\t}", "public static boolean CheckUsernameAvailable(String username) {\n JSONObject obj = new JSONObject();\n try {\n obj.put(\"type\", \"checkUsernameAvailable\");\n obj.put(\"username\", username);\n outWriter.println(obj);\n return Boolean.parseBoolean(inReader.readLine().toString());\n } catch (Exception exc) {\n //TODO: Raise exceptions through the ExceptionHandler class.\n System.out.println(\"Connection check username available error: \" + exc.toString());\n }\n return false;\n }", "public boolean checkUserName(TextField userName) {\n String userNameSQL = \"SELECT * FROM user WHERE user_name = ? \";\n ResultSet rsUser;\n boolean username_exists = false;\n\n\n try {\n\n PreparedStatement userPST = connection.prepareStatement(userNameSQL);\n userPST.setString(1, userName.getText());\n rsUser = userPST.executeQuery();\n\n if (rsUser.next()) {\n username_exists = true;\n outputText.setStyle(\"-fx-text-fill: #d33232\");\n outputText.setText(\"Username Already Exists\");\n }\n\n } catch (SQLException throwables) {\n throwables.printStackTrace();\n }\n\n return username_exists;\n\n }", "public boolean validateUsernameExist(String username) {\n return userRepository.findUsername(username);\n }", "public boolean isThereSuchAUser(String username, String email) ;", "private boolean usernameAvailable(String username) throws ParseException {\n ParseQuery<TipperUser> query = ParseQuery.getQuery(\"TipperUser\");\n query.whereEqualTo(\"username\", username);\n List<TipperUser> result = query.find();\n if (result.isEmpty()) {\n return true;\n } else return false;\n }", "public boolean isExistingUsername(String username) {\n boolean isExistingUser = false; \n \n List<User> retrievedUsersList = new LinkedList<User>(); \n retrievedUsersList = repo.returnAllUsers(); \n \n User aUser = null; \n for(var user : retrievedUsersList) {\n aUser = (User)user; \n \n if(aUser.username.equals(username)) {\n isExistingUser = true; \n }\n }\n \n return isExistingUser; \n }", "public boolean isUsernameExist(String un) {\n\n boolean exist = false;\n\n // accessing registeredUser table (collection)\n MongoCollection<Document> collection = db.getCollection(\"registeredUser\");\n\n // ----- get document of given username from registeredData -----\n System.out.println(\"\\nVerifying if username already exists or not\\n--------------------\\n\");\n String colUsername = \"username\"; // set key and value to look for in document\n FindIterable<Document> docOne = collection.find(Filters.eq(colUsername, un)); // find document by filters\n MongoCursor<Document> cursor1 = docOne.iterator(); // set up cursor to iterate rows of documents\n try {\n // cursor1 will only have 1 data if we found a match\n if (cursor1.hasNext()) {\n System.out.println(\"Username already exists\");\n exist = true;\n }\n else {\n System.out.println(\"Username is available to register\");\n }\n } finally {\n cursor1.close();\n }\n\n return exist;\n }", "Boolean checkUserExists(String userName) throws AppException;", "public static boolean userExists(String username) throws IOException, SQLException {\n ArrayList<String> user = retrieveUser(username);\n if (!user.isEmpty()) {\n if (user.get(0).equals(username)) {\n System.out.println(\"Username exists in database.\");\n return true;\n }\n }\n System.out.println(\"The user: \" + username + \" does not exist\");\n return false;\n }", "@Test\n public void userExist() {\n String username = argument.substring(0, 15);\n boolean found = false;\n\n for(int i = 0; i<users.size(); i++){\n if(users.get(i).substring(0, 15).trim().toLowerCase().contains(username.trim().toLowerCase())){\n found = true;\n }\n }\n assertTrue(\"User Not Found\", found);\n }", "private Boolean findUser(String username){\n return usersDataBase.containsKey(username);\n }", "public boolean checkUsername(String username){\n\t\tFile userData = new File(\"Settings//\" + username + \".yml\");\n\n\t\t// If the players file exists.\n\t\tif(!userData.exists()){\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}", "boolean duplicatedUsername(String username);", "public boolean userNameExists(){\r\n boolean userNameExists = false;\r\n //reads username and password\r\n String user = signup.getUsername();\r\n String pass = signup.getFirstPassword();\r\n try{\r\n //creates statement\r\n //connects to database\r\n \r\n Connection myConn = DriverManager.getConnection(Main.URL); \r\n \r\n //creates statement\r\n Statement myStmt = myConn.createStatement();\r\n System.out.println(\"statement initiated\");\r\n //SQL query\r\n ResultSet myRs = myStmt.executeQuery(\"select * from LISTOFUSERS \");\r\n System.out.println(\"query initiated\");\r\n //process result set\r\n //checks to see if the username already exists in the database\r\n while (myRs.next()){\r\n System.out.println(\"check\");\r\n if(user.equals(myRs.getString(\"USERNAME\"))){\r\n \r\n userNameExists = true;\r\n break;\r\n }\r\n }\r\n myConn.close();\r\n \r\n \r\n \r\n } catch (Exception e) \r\n {\r\n System.err.println(e.getMessage());\r\n } \r\n return userNameExists; \r\n }", "public boolean isUsernameAvailable(String username) {\r\n\t\treturn utilisateurControlleur.isUsernameAvailable(username);\r\n\t}", "boolean hasUserDN();", "boolean checkAvailable(String userName);", "public static boolean userExist(String username){\n boolean exist = false;\n try{\n Class.forName(\"com.mysql.jdbc.Driver\");\n connection = DriverManager.getConnection(\"RDS_HOST\",\"RDS_USERNAME\",\"RDS_PASSWORD\");\n String query = \"SELECT username FROM users WHERE username = ?\";\n PreparedStatement preparedStatement = connection.prepareStatement(query);\n preparedStatement.setString(1,username);\n resultSet = preparedStatement.executeQuery();\n if(resultSet.next()){\n exist = true;\n }\n\n }\n finally {\n close();\n return exist;\n }\n }", "private static boolean checkUsernameAvailable(String username) {\n if (username.length() <= 6) {\n return false; // Username too short.\n } else {\n if (!patients.isEmpty()) {\n for (Patient patient : patients\n ) {\n if (patient.getUserName().equals(username)) {\n return false; // Username already added for patient.\n }\n }\n for (Medic medic : medics\n ) {\n if (medic.getUserName().equals(username)) {\n return false; // Username already added for patient.\n }\n }\n }\n\n }\n return true;\n }", "boolean isUserExist(String username) throws ErrorConnectionException, TException;", "public boolean usernameExists(String username){\r\n\t\tCursor mCursor =\r\n \t this.mDb.query(true, DATABASE_TABLE, new String[] {USERNAME,PASSWORD,FIRSTNAME,FAMILYNAME,\r\n \t \t\tMAIL,RELIABILITY,POSITION,CITY,BIRTHDATE, ROW_ID, IMGPATH}, \r\n \t \t\tUSERNAME + \"= '\" + username+ \"'\", null, null, null, null, null);\r\n \t if (mCursor != null ) {\r\n \t mCursor.moveToFirst();\r\n \t }\r\n \tboolean res = mCursor.isAfterLast();\r\n \tmCursor.close();\r\n \treturn res;\r\n\t}", "private boolean validateUsername() {\n // Get doctor's username\n EditText doctorUsername = (EditText) rootView.findViewById(R.id.doctorField);\n String doctorUsernameString = doctorUsername.getText().toString();\n // Query on server using that username\n try {\n String query = String.format(\"select `username` from `user` inner join `doctor` on user.id=doctor.userid where username='%s'\", doctorUsernameString); // query to check username existence\n Document document = Jsoup.connect(Constants.SERVER + query).get();\n String queryJson = document.body().html();\n if (queryJson.equals(\"0\")) { // Username not existed\n return false;\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n // Get patient's username\n EditText patientUsername = (EditText) rootView.findViewById(R.id.patientField);\n String patientUsernameString = patientUsername.getText().toString();\n // Query on server using that username\n try {\n String query = String.format(\"select `username` from `user` inner join `patient` on user.id=patient.userid where username='%s'\", patientUsernameString); // query to check username existence\n Document document = Jsoup.connect(Constants.SERVER + query).get();\n String queryJson = document.body().html();\n if (queryJson.equals(\"0\")) { // Username not existed\n return false;\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return true;\n }", "@Override\n public boolean isUserNameExists(String userName) {\n User user = getUserInfo(userName);\n return user != null && user.getUserName() != null && !user.getUserName().equals(\"\");\n }", "public boolean userExists(String userName) {\r\n String qr = \"from UserCredsTbl where userName like '%\" + userName + \"%'\"\r\n + \"or userName like '%\" + userName + \"%'\";\r\n List userList = crud.getObject(qr);\r\n\r\n if (userList.size() > 0) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "@Override\n\tpublic boolean checkUsername(String userName) {\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tStatement userCheck = connectionService.getConnection().createStatement();\n\t\t\t//userCheck.executeQuery(\"SELECT name FROM players WHERE name='\" + userName + \"';\");\n\t\t\t\n\t\t\tResultSet rs = userCheck.executeQuery(\"SELECT username FROM players WHERE username='\" + userName + \"';\");\n\t\t\t\n\t\t\tif (rs.next()) {\n\t\t\t\t\n\t\t\t\t//if (!rs.getString(\"\")\n\t\t\t\t\t\n\t\t\t\t\t//connectionService.finalize();\n\t\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t//connectionService.finalize();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\t\n\t\t\tSystem.out.println(\"Exception: \" + e.getMessage());\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t\t\n\t\t}\n\t}", "public Boolean checkusername( String username){\n SQLiteDatabase sdb = this.getReadableDatabase();\n Cursor cursor = sdb.rawQuery(\"Select * from user where username=?\",new String[]{username});\n if(cursor.getCount()>0) {\n return false;\n }\n else {\n return true;\n }\n }", "public boolean checkUsername(String username) {\r\n // Gets the collection of users and creates a query\r\n MongoCollection<Document> users = mongoDB.getCollection(\"Users\");\r\n Document query = new Document(\"username\", username);\r\n\r\n // Returns whether at least one user with the given username exists\r\n return users.countDocuments(query) > 0;\r\n }", "public boolean checkUserExists(String username) {\n boolean exists = false;\n try {\n conn = dao.getConnection();\n ps = conn.prepareStatement(\"SELECT * FROM USERS WHERE USERNAME=?\");\n ps.setString(1, username);\n\n ResultSet rs = ps.executeQuery();\n\n // rs.next() is false if the set is empty\n exists = rs.next();\n\n // close stuff\n ps.close();\n conn.close();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return exists;\n }", "public boolean checkUsername(String username) {\n for(int i=0; i<listOfUsers.size(); i++) {\n if(listOfUsers.get(i).compareTo(username)==0)\n return false;\n }\n return true;\n }", "public String checkUsername() {\n String username = \"\"; // Create username\n boolean isOK = true; // Condition loop\n\n while (isOK) {\n username = checkEmpty(\"Account\"); // Call method to check input of username\n boolean isExist = false; // Check exist username\n for (Account acc : accounts) {\n // If username is exist, print out error\n if (username.equals(acc.getUsername())) {\n System.out.println(\"This account has already existed\");\n System.out.print(\"Try another account: \");\n isExist = true;\n }\n }\n // If username not exist then return username\n if (!isExist) {\n return username;\n }\n }\n return username; // Return username\n }", "private boolean isOneUserName(String username){\r\n\t\tfor(int i = 0; i < users.size(); i++){\r\n\t\t\tif(users.get(i).username.equalsIgnoreCase(username)){\r\n\t\t\t\tSystem.out.println(\"Sorry the Username is already taken\");\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean isUsernameAvailable(String i_userName) throws Exception\n\t{\n\t\treturn !(doesCustVendExist((short) -1, i_userName, k_doesCustomerExistByName)) || !(doesCustVendExist((short) -1, i_userName, k_doesVendorExistByName));\n\t}", "private boolean checkUsername() {\n if(getUsername.getText().compareTo(\"\") != 0) { return true; }\n else {\n errorMessage.setText(\"Please enter a username.\");\n return false;\n }\n }", "@Override\n\tpublic boolean checkUser(String username) {\n\t\tboolean result = false;\n\n\t\tSession session = sessionFactory.getCurrentSession();\n\t\tQuery query = (Query) session.createQuery(\"from Member where username=?\");\n\n\t\tMember member = (Member) query.setString(0, username).uniqueResult();\n\t\tif (member != null) {\n\t\t\tresult = true;\n\t\t\tlogger.info(\"Member Exists\");\n\t\t} \n\n\t\treturn result;\n\n\t}", "boolean isUniqueUsername(String username) throws SQLException;", "public boolean checkUsername(String name) {\r\n\t\ttry {\r\n\t\t\tStatement statement = connection.createStatement();\r\n\t\t\tResultSet rs = statement.executeQuery(\"SELECT count(*) FROM users where username = '\" + name + \"'\");\r\n\t\t\treturn rs.first();\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public boolean checkUsername(String username, String password) {\n try {\n remoteUserAccess = new RemoteUserAccess(new URI(\"http://localhost:8080/api/user/\"));\n } catch (Exception e) {\n remoteUserAccess = new DirectUserAccess();\n }\n Collection<User> userPasswords = remoteUserAccess.getUsers();\n if (!userPasswords.stream().anyMatch(a -> a.getUsername().equals(username))) {\n return false;\n } else if (!userPasswords.stream()\n .filter(p -> p.getUsername().equals(username))\n .findFirst().get().getPassword()\n .equals(password)) { // Chekcs if passwords match\n return false;\n }\n return true;\n\n }", "@PreAuthorize(\"hasRole('ROLE_USER')\")\r\n\tpublic boolean isUsernameAvailable(String username);", "public void checkUsernameExist() {\n\n try {\n BLUser bluser = new BLUser();\n User user = new User();\n\n ResultSet rs = bluser.selectUserIdFromUsername(txt_username.getText());\n\n user.setUsername(txt_username.getText());\n bluser.setUser(user);\n\n if (bluser.checkUsernameExist()) {\n \n populateDataOnTable();\n }// end if\n else {\n JOptionPane.showMessageDialog(rootPane, \"Invalid username!\");\n }// end else \n\n }// end try\n catch (Exception ex) {\n JOptionPane.showMessageDialog(null, ex.getMessage(), \"Exception\", JOptionPane.INFORMATION_MESSAGE);\n }//end catch\n }", "private boolean checkNameExistAdd(String userName) {\n\n\t\tUser user = this.userDAO.getUserByName(userName);\n\t\tif (null != user) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public synchronized boolean hasUser(String username) {\r\n\t\tif (!mapping.containsKey(username)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "boolean exists(String nickName) {\n // To avoid file scanning\n if (this.isOnline(nickName)) return true;\n try {\n this.loadUserRegistrationInfo(nickName);\n return true;\n } catch (NoSuchElementException e) {\n return false;\n }\n }", "public boolean existsPlayer(String username) {\r\n return ctrlDomain.existsPlayer(username);\r\n }", "public boolean findValidUsername(String username) {\n if (allUserNames.isEmpty()) {\n return true;\n }\n for (String s: allUserNames) {\n if(s.equals(username)) {\n return false;\n }\n }\n return true;\n }", "public static boolean userNameDuplicate(String arg_username) {\n\n\t\tboolean userNameFound = false;\n\n\t\tfor (User u0 : userInfoArray) {\n\t\t\tString currentUserName = ((User) u0).getUserName();\n\t\t\tif (arg_username.toUpperCase().equals(currentUserName.toUpperCase())) {\n\t\t\t\tuserNameFound = true;\n\t\t\t\tbreak;\n\n\t\t\t} else {\n\t\t\t\tuserNameFound = false;\n\t\t\t}\n\n\t\t}\n\t\treturn userNameFound;\n\t}", "public Map<Boolean, Set<String>> checkUsername(String username) throws UserNameException;", "private boolean isUserExists() {\n\t\treturn KliqDataStore.isUserExists(this.mobileNumber, null);\r\n\t}", "public boolean isUsernameTaken(String username) throws Exception {\n DataBaseBroker dbb = new DataBaseBroker();\n dbb.loadDriver();\n dbb.establishConnection();\n boolean taken = dbb.isUsernameTaken(username);\n dbb.commit();\n dbb.closeConnection();\n return taken;\n }", "@Override\n\tpublic Boolean chkUserNameForApply(String usernameStr) {\n\t\tList<ApplyUsers> usersList = new ArrayList<ApplyUsers>();\n\t\tString sql=\"select applyid from apply_users where applyname='\" + usernameStr + \"'\";\n\t\tusersList = JdbcUtils.query(ApplyUsers.class, sql);\n\t\tif(usersList.size()>0){\n\t\t return false;\n\t\t}else{\n\t\t return true;\n\t\t}\n\t}", "public static boolean isUserPassed(String username) {\n if (username.equals(\"\") || username.equals(\"admin\")) return false;\n Boolean b = map.get(username);\n return b != null && b;\n }", "public boolean askForUsername()\r\n\t{\r\n\t\tboolean nameEntered = true;\r\n\r\n\t\tTextInputDialog dialog = new TextInputDialog();\r\n\t\tdialog.setTitle(\"Nom d'utilisateur\");\r\n\t\tdialog.setHeaderText(null);\r\n\t\tdialog.setContentText(\"Entrer un nom d'utilisateur:\");\r\n\t\tOptional<String> result = dialog.showAndWait();\r\n\t\tif (result.isPresent())\r\n\t\t{\r\n\t\t\ttextFieldNomUtilisateur.setText(result.get());\r\n\t\t} else\r\n\t\t{\r\n\t\t\tnameEntered = false;\r\n\t\t}\r\n\r\n\t\treturn nameEntered;\r\n\t}", "@WebMethod public boolean checkUser(String userName);", "public boolean doesTheUserExist(String user)\r\n\t {\r\n\t\t if (!users.get(user).equals(null))\r\n\t\t return true;\r\n\t\t return false;\r\n\t }", "protected boolean getLastUsernameAvailability() {\n\t\treturn this.udpServer.getLastUsernameAvailability();\n\t}", "public boolean hasUser(String username) {\n return users.containsKey(username);\n }", "public static Boolean isUser(String username){\n connect();\n try{\n String queryCheck = \"SELECT u.username \" +\n \"FROM User u \" +\n \"WHERE u.username=?\";\n ps = conn.prepareStatement(queryCheck);\n ps.setString(1,username);\n rs = ps.executeQuery();\n if(rs.next()){\n return true;\n }\n }catch(SQLException sqle){\n System.out.println(\"SQLException in function \\\" getData\\\": \");\n sqle.printStackTrace();\n }finally{\n close();\n }\n return false;\n }", "private boolean isUserNameValid(String username) {\n if (username == null) {\n return false;\n } else {\n return !username.trim().isEmpty();\n }\n }", "static boolean checkUserName(String userName) {\n\t\ttry {\n\t\t\tfor (char c : userName.toCharArray()) {\n\t\t\t\tif ((c <= '9' && c >= '0') || (c >= 'A' && c <= 'Z')\n\t\t\t\t\t\t|| (c >= 'a' && c <= 'z')) {\n\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t}\n\t\t} catch (NullPointerException e) {\n\t\t\t// TODO: handle exception\n\n\t\t}\n\n\t\treturn true;\n\t}", "@PreAuthorize(\"permitAll()\")\n @GetMapping(\"/users/username-available\")\n public ResponseEntity<Boolean> isUsernameAvailable(@RequestParam(value = \"username\") String username) {\n return new ResponseEntity<>(userService.getUserByUsername(username) == null, HttpStatus.OK);\n }", "public boolean usernameMatches(Username username) {\n return this.credential.usernameEquals(username);\n }", "public boolean userExists(String user){\n boolean answer = false;\n //look into the database\n try{\n statement = connection.createStatement();\n //execute SQL query and get the data from the database\n ResultSet myResult = statement.executeQuery(\"SELECT name FROM members WHERE name = '\" + user +\"'\");\n while (myResult.next()) {\n if (myResult.getString(\"name\")!= null)\n //name exists so answer = true\n answer = true;\n }\n\n }catch (SQLException ex){ex.printStackTrace();}\n return answer;\n }", "private boolean isExistUserName(String userName, String userId) {\n User user = userService.findByUserNameAndStatus(userName, Constant.Status.ACTIVE.getValue());\n if (user != null && !user.getUserId().equals(userId)) {\n return true;\n }\n return false;\n }", "public boolean doesUserExist(String username) {\n\t\t\n\t\tfor(User u : users) {\n\t\t\tif(u.getUsername().equals(username)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "private void testUserName(){\r\n\t\t//get user with the 'test' userName\r\n\t\tString command = \"SELECT userName FROM users \"\r\n\t\t\t\t+ \"WHERE userName = \\\"\" + commandList.get(1) + \"\\\";\";\r\n\t\tSystem.out.println(command);//print command\r\n\t\ttry {//send command\r\n\t\t\trs = stmt.executeQuery(command);\r\n\t\t\t\r\n\t\t\tif(rs.next()){//if it returns user, userName exists\r\n\t\t\t\tout.println(\"exists\");\r\n\t\t\t} else {//no results returned, empty\r\n\t\t\t\tout.println(\"free\");\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\tout.println(e.getMessage());//send back error message\r\n\t\t}\r\n\t\t\r\n\r\n\t}", "public boolean existUser(String campo1, String campo2);", "public boolean findbyUser(String username) {\n\t\tString sql=\"select username from SCOTT.USERS where USERNAME='\"+username+\"'\";\n\t\t\n\t\t Dbobj dj=new Dbobj();\n\t\t JdbcUtils jdbcu=new JdbcUtils();\n\t\t dj=jdbcu.executeQuery(sql);\n\t\t ResultSet rs=dj.getRs(); \n\t\t System.out.println(\"\"+sql);\t\n\t\t String t=\"\";\n\t\t try {\n\t\t\twhile(rs.next())\n\t\t\t\t{\n\t\t\t\t\tt=rs.getString(1);\n\t\t\t\t}\n\t\t} catch (NumberFormatException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t\t if (t.isEmpty()) {\n\t\t\t return false;\n\t\t }else{\n\t\t\t return true; \n\t\t }\n\t\t\n\t\t\n\t\t\n\t}", "public boolean checkUserNameIsOccupied(String name) {\n \t\tif (users.size() != 0) {\n \t\t\tfor (int i = 0; i < users.size(); i++) {\n \t\t\t\tif (name.equals(users.get(i).getName())) {\n \t\t\t\t\treturn true;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\treturn false;\n \t}", "private boolean checkUserame(String name) throws SQLException {\n\t\tcheckUserameStatement.clearParameters();\n\t\tcheckUserameStatement.setString(1, name);\n\t\tResultSet result = checkUserameStatement.executeQuery();\n\t\tresult.next();\n\t\tboolean out = result.getInt(1) == 1;\n\t\tif (DEBUG) {\n\t\t\tSystem.out.println(\"checkUserame: \"+result.getInt(1)+\"\\n\");\n\t\t}\n\t\tresult.close();\n\t\treturn out;\n\t}", "public boolean testUser(){\n VallidateUserName validator = new VallidateUserName();\n return validator.isValidUser(UserName);\n }", "void checkUserName() {\n usernameChecked = false;\n signInUpController.checkUserName(userNameText.getText().toString(), new OnTaskListeners.Bool() {\n @Override\n public void onSuccess(Boolean result) {\n usernameChecked = true;\n if (result)\n uniqueUsername = false;\n else\n uniqueUsername = true;\n\n\n }\n });\n }", "private static Boolean testUsername(String username){\n\t\t//Setting Up Regex -> All Numbers and Letters maximum 14 signs\n\t\tString pattern =\"[A-z1-9]{2,14}\";\n\t\tPattern p = Pattern.compile(pattern);\n\t\tMatcher m = p.matcher(username);\n\t\t\t\n\t\tif(m.matches() && !username.isEmpty()){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}" ]
[ "0.89271784", "0.8784113", "0.8725657", "0.8516042", "0.8516042", "0.8516042", "0.8516042", "0.8516042", "0.8516042", "0.8363363", "0.8273814", "0.8260506", "0.8147448", "0.8083626", "0.80096114", "0.79937935", "0.7969036", "0.79349273", "0.78953797", "0.7840845", "0.7837379", "0.78315103", "0.78297186", "0.76502776", "0.7643318", "0.76102066", "0.75642204", "0.75602317", "0.7548394", "0.7533972", "0.7533783", "0.7532365", "0.7524735", "0.75053596", "0.74969035", "0.7493702", "0.7478863", "0.7454946", "0.7407483", "0.73925024", "0.73680586", "0.7365337", "0.7356267", "0.7338823", "0.7330174", "0.73077905", "0.7307543", "0.73047286", "0.7296597", "0.7294634", "0.7286582", "0.7244182", "0.7239446", "0.72319305", "0.7220509", "0.7219483", "0.7187449", "0.7181776", "0.7178816", "0.71743065", "0.7174057", "0.71506333", "0.7145281", "0.71403116", "0.7117206", "0.71072793", "0.7097414", "0.7096952", "0.70969135", "0.70948905", "0.7094889", "0.7046286", "0.7037618", "0.70258856", "0.70242214", "0.70070744", "0.6998988", "0.6992818", "0.6990724", "0.698985", "0.69805646", "0.69605", "0.69530183", "0.69513226", "0.6948783", "0.6945361", "0.6937462", "0.6918894", "0.69063765", "0.69063383", "0.6903843", "0.68991846", "0.6887996", "0.68801576", "0.68573844", "0.6856052", "0.68445915", "0.6829746", "0.6812171", "0.67989206" ]
0.70588666
71
The function returns true if the received username and password match a system storage entry, otherwise false
@RequestMapping(value = "validate_user", method = { RequestMethod.POST }) public boolean validateUser(@RequestParam("username") String username, @RequestParam("password") String password) throws IOException { System.out.println(username + " " + password); boolean result = false; MongoClient mongoClient = null; try { // Create Mongo client mongoClient = new MongoClient("localhost", 27017); MongoDatabase db = mongoClient.getDatabase("projectDB"); // Create Users collection and user document MongoCollection<Document> collection = db.getCollection("USERS"); Document myDoc = collection.find(eq("username", username)).first(); // No user in the collection with the given username if (myDoc == null) { mongoClient.close(); return false; } else { // Check for password mongoClient.close(); result = myDoc.get("password").equals(password); } //Close DB connection mongoClient.close(); } catch (Exception e) { mongoClient.close(); System.out.println(e); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract boolean checkCredentials (String username, String password);", "private static boolean admin(String username, String password) {\r\n\t\tFile file = new File(\"admin.txt\");\r\n\t\tScanner scanner;\r\n\t\tString user = null;\r\n\t\tString pwd = null;\r\n\t\ttry {\r\n\t\t\tscanner = new Scanner(file);\r\n\t\t\tString nextLine = scanner.nextLine();\r\n\t\t\tString[] parts = nextLine.split(\"=\");\r\n\t\t\tuser = parts[0];\r\n\t\t\tpwd = parts[1];\r\n\t\t\tscanner.close();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn (username.equals(user) && password.equals(pwd));\r\n\t\t\r\n\t}", "boolean isValidCredential(String username, String password);", "private static boolean authenticate(String username, String password) {\r\n\t\tFile file = new File(\"auth.txt\");\r\n\t\tScanner scanner;\r\n\t\tString user = null;\r\n\t\tString pwd = null;\r\n\t\ttry {\r\n\t\t\tscanner = new Scanner(file);\r\n\t\t\tString nextLine = scanner.nextLine();\r\n\t\t\tString[] parts = nextLine.split(\"=\");\r\n\t\t\tuser = parts[0];\r\n\t\t\tpwd = parts[1];\r\n\t\t\tscanner.close();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn (username.equals(user) && password.equals(pwd));\r\n\t\t\r\n\t}", "boolean isUserExist(String username, String password);", "boolean authenticate(String userName, String password);", "public String isValidAgentLogin(String userName, String password);", "public boolean ValidCredentials() { \n\t\tif(!isEmptyFieldData()){\n\t\t\tSystemUserQuery sq = new SystemUserQuery();\n\t\t\tUser user = sq.loginQuery(getUsername(), getPassword());\n\t\t\t\n\t\t\tif(user != null){\n\t\t\t\tMain.setCurrentUser(user);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}", "private boolean checkCredentials(String userName, String password)\n {\n int count = 0;\n for(String user : userNames)\n {\n if(user.contentEquals(userName))\n {\n if(passwords[count].contentEquals(password))\n {\n return true;\n }\n }\n count++;\n }\n\n return false;\n }", "public Boolean authentication(String username, String password) \n\t{\n\t\n\t switch (username) {\n\t case \"FS_UTO_CoE_Sreenivas\":\n\t \t\t\tif (year<=2018)\n\t \t\t\tpassorfail=password.equals(\"q2m!x:dCk6FaG$Ec\");\n\t \t\t\t\tbreak;\n\t// case \"FS_BAN_ANZ_DIGITAL_GANESH\": \n\t//\t\t \t\t\tpassorfail=password.equals(\"q`r^8{De,Sn*!KU_\");\n\t//\t\t \t\t\t\tbreak;\t\t \t\t\t\t\n\t default: \n\t\t\t\t\t\t\tpassorfail = false; \n\t\t\t\t\t\t\tbreak; \t\t \n\t\t}\n\t\treturn passorfail;\n\n\t}", "public static boolean authenticateUser(String username, String password)\n\t\t\tthrows IOException {\n\t\t// TODO (ejeadry): We need to store the state of the user here, and make\n\t\t// sure that he cannot login on different computers.\n\n\t\tBoolean foundMatch = false;\n\n\t\tFile f = new File(DB_FOLDER + DB_AUTH_FILE + DB_FILE_TYPE);\n\n\t\tFileReader fReader;\n\t\tfReader = new FileReader(f);\n\t\tBufferedReader bReader = new BufferedReader(fReader);\n\n\t\tString s = bReader.readLine();\n\n\t\twhile (s != null) {\n\t\t\tString[] pair = s.split(\"\\\\s+\");\n\t\t\tif (pair[0].equals(username) && pair[1].equals(password)) {\n\t\t\t\tfoundMatch = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\ts = bReader.readLine();\n\t\t}\n\n\t\tfReader.close();\n\t\tbReader.close();\n\n\t\treturn foundMatch;\n\t}", "private boolean validate(String username, String password) {\n\t\tif(username.equals(\"Venkat\") && password.equals(\"kumar\")) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "private boolean checkAuthentication(String login, String passwd) {\n Connection connect;\n boolean result = false;\n try {\n // connect db\n Class.forName(DRIVER_NAME);\n connect = DriverManager.getConnection(SQLITE_DB);\n // looking for login && passwd in db\n Statement stmt = connect.createStatement();\n ResultSet rs = stmt.executeQuery(SQL_SELECT.replace(\"?\", login));\n while (rs.next())\n result = rs.getString(PASSWD_COL).equals(passwd);\n // close all\n rs.close();\n stmt.close();\n connect.close();\n } catch (Exception ex) {\n ex.printStackTrace();\n return false;\n }\n return result;\n }", "private boolean checkLogin(String username, String passwordMD5) {\n try {\n Statement stmt = GUITracker.conn.createStatement();\n ResultSet rs = stmt.executeQuery(\"SELECT * from account where username='\" + username + \"' and password='\" + passwordMD5 + \"'\");\n if (rs.next()) {\n //iduser = rs.getInt(\"Id\");\n return true;\n } else {\n return false;\n } \n \n// if ((username.equals(usernamePeer)) && (passwordMD5.equals(passwordPeer))) {\n// return true;\n// } else {\n// return false;\n// }\n } catch (Exception e) {\n e.printStackTrace();\n return false;\n }\n }", "@Override\n\tpublic boolean isUserAuthenticate(String username, String password) {\n\t\t// validate username and pwd with predefined credentials\n\t\tif (username.equals(Utility.USERNAME) && password.equals(Utility.PASSWORD)) {\n\t\t\treturn true;\n\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "@Override\n public boolean userLogin(String username, String password) \n {\n User tmpUser = null;\n tmpUser = getUser(username);\n if(tmpUser == null) return false;\n if(tmpUser.getPassword().equals(password)) return true;\n return false;\n }", "boolean validateUserAndPassword(String username, String password);", "public boolean checkUsername(String username, String password) {\n try {\n remoteUserAccess = new RemoteUserAccess(new URI(\"http://localhost:8080/api/user/\"));\n } catch (Exception e) {\n remoteUserAccess = new DirectUserAccess();\n }\n Collection<User> userPasswords = remoteUserAccess.getUsers();\n if (!userPasswords.stream().anyMatch(a -> a.getUsername().equals(username))) {\n return false;\n } else if (!userPasswords.stream()\n .filter(p -> p.getUsername().equals(username))\n .findFirst().get().getPassword()\n .equals(password)) { // Chekcs if passwords match\n return false;\n }\n return true;\n\n }", "Boolean isValidUserPassword(String username, String password);", "public static boolean authenticate(String username, String password) {\n\t\tif (username.equals(\"admin\") && password.equals(\"secret\"))\r\n\t\t\treturn true;\r\n\t\telse if (username.equals(\"user1\") && password.equals(\"1111\"))\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t}", "Boolean checkCredentials(String username, String password) throws\n SQLException, UserNotFoundException;", "User checkUser(String username, String password);", "public boolean logOn(String username, String password) {\n ArrayList<String> listOfUsernames = database.returnAllUsernames();\n for (int rowBeingChecked = 0; rowBeingChecked < listOfUsernames.size(); rowBeingChecked++) {\n if (listOfUsernames.get(rowBeingChecked).equals(username)) {\n byte[] saltAndHash = pullSaltAndHashFromDatabase(username);\n byte[] saltPulled = new byte[16];\n byte[] hashPulled = new byte[16];\n\n //Splitting 'saltAndHash' into separate bytes:\n for (int byteCounter = 0; byteCounter < 16; byteCounter++) {\n saltPulled[byteCounter] = saltAndHash[byteCounter];\n }\n for (int byteCounter = 0; byteCounter < 16; byteCounter++) {\n hashPulled[byteCounter] = saltAndHash[byteCounter + 16];\n }\n\n //Creating the hash again, and returning boolean if they're equal.\n KeySpec spec = new PBEKeySpec(password.toCharArray(), saltPulled, 66536, 128);\n try {\n SecretKeyFactory factory = SecretKeyFactory.getInstance(\"PBKDF2WithHmacSHA1\");\n byte[] hashGenerated = factory.generateSecret(spec).getEncoded();\n return Arrays.equals(hashGenerated, hashPulled);\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n return false;\n } catch (InvalidKeySpecException e) {\n e.printStackTrace();\n return false;\n }\n }\n }\n //If user name not in table:\n return false;\n }", "public static boolean checkPassword()\n {\n String pw = SmartDashboard.getString(\"Password\");\n SmartDashboard.putString(\"Password\", \"\"); //Clear the password field so that it must be reentered\n\n if(pw.equals(ADMIN_PASSWORD))\n return true;\n else\n {\n log(\"Password invalid\"); //The user gave an incorrect password, inform them.\n return false;\n }\n }", "@Override\n public boolean login(String username, char[] password) throws RemoteException {\n //Determines whether or not user with a specific username exist\n if (fileExist(USER_DIR + username + \".xml\")) {\n try {\n //Make the password a string\n String strPassword = \"\";\n for (int i = 0; i < password.length; i++) {\n strPassword += String.valueOf(password[i]);\n }\n //Open the file with the user information\n inputStream = new FileInputStream(USER_DIR + username + \".xml\");\n inputStreamReader = new InputStreamReader(inputStream);\n reader = new BufferedReader(inputStreamReader);\n\n sb = new StringBuilder();\n\n while ((lineString = reader.readLine()) != null) {\n sb.append(lineString);\n }\n \n //After that the @param userInfo contain a whole information about the user\n String userInfo = new String(sb);\n \n //Validate user form with a regular expresions\n if (!Pattern\n .compile(\"<username>\" + username + \"</username>\")\n .matcher(userInfo)\n .find()) {\n return false;\n }\n\n if (!Pattern\n .compile(\"<password>\" + strPassword + \"</password>\")\n .matcher(userInfo)\n .find()) {\n return false;\n }\n //Get the user priviliges\n if (Pattern\n .compile(\"<privilige>ENCRYPT</privilige>\")\n .matcher(userInfo)\n .find()) {\n priviliges = User.Priviliges.ENCRYPT;\n } else if (Pattern\n .compile(\"<privilige>DECRYPT</privilige>\")\n .matcher(userInfo)\n .find()) {\n priviliges = User.Priviliges.DECRYPT;\n } else if (Pattern\n .compile(\"<privilige>ENCRYPT_AND_DECRYPT</privilige>\")\n .matcher(userInfo)\n .find()) {\n priviliges = User.Priviliges.ENCRYPT_AND_DECRYPT;\n }\n } catch (IOException ex) {\n ex.printStackTrace();\n } finally {\n closeResources();\n }\n } else {\n return false;\n }\n return true;\n }", "public boolean userMatchesPassword(String username, String password) throws FileNotFoundException, IOException {\n\t\tConnection connectionToDB = null;\n\t\tconnectionToDB = connectToDB();\n\t\tString query = \"Select count(*) from PESSOA where NOMEUTILIZADOR = ? and PASSWORD = ?\";\n\t\ttry (PreparedStatement ps= connectionToDB.prepareStatement(query)){\n ps.setString(1, username);\n ps.setString(2, password);\n ResultSet rs= ps.executeQuery();\n rs.next();\n\n return (rs.getInt(1)>=1);\n }\n catch (SQLException e){\n System.out.println(e);\n return false;\n }\n\t}", "public Boolean usernamepassword (String username,String password) {\n SQLiteDatabase sdb = this.getReadableDatabase();\n Cursor cursor = sdb.rawQuery(\"select * from user where username=? and password=?\",new String[]{username,password});\n if(cursor.getCount()>0) {\n return true;\n }\n else {\n return false;\n }\n }", "private static boolean authenticateUser(String username_input, String password_input){\n\t\tif(!username_input.equals(USERNAME) || !password_input.equals(PASSWORD)){\n\t\t\tSystem.out.println(\"Invalid Credentials Entered!\");\n\t\t\treturn false;\n\t\t}\n\t\telse //username and password entered were correct\n\t\t\tSystem.out.println(\"User Credentials Authenticated! Please wait while books and students are being loaded.\");\n\t\treturn true;\n\t}", "public boolean user(String username, String password) {\n\t\ttry {\n\n\t\t\tConnection con = connect.connect();\n\t\t\tif(con!=null) {\n\t\t\t\tString sql = \"SELECT * FROM USERSTORE WHERE USERNAME=? AND PASSWORD=?\";\n\t\t\t\tPreparedStatement stmt=con.prepareStatement(sql); \n\t\t\t\tstmt.setString(1,username);\n\t\t\t\tstmt.setString(2,password);\t\t\t\t\n\t\t\t\tResultSet rs=stmt.executeQuery(); \n\t\t\t\tif(rs.next()) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t\treturn false;\n\t\t}\n\t}", "boolean hasPassword();", "boolean hasPassword();", "boolean hasPassword();", "boolean hasPassword();", "boolean hasPassword();", "boolean hasPassword();", "boolean hasPassword();", "boolean hasPassword();", "public boolean checkCredentials(String inputLogin, String inputPassword) {\n //creates boolean variable flag and defines it as True\n boolean flag = false;\n //defines Connection con as null\n Connection con = MainWindow.dbConnection();\n try {\n //tries to create a SQL statement to retrieve values of a User object from the database\n String query = \"SELECT * FROM User WHERE userID = '\" + inputLogin + \"' AND password = '\" + inputPassword + \"';\";\n Statement statement = con.createStatement();\n ResultSet result = statement.executeQuery(query);\n /*\n if statement compares data entered by user with data in the database. If there is such data in the database\n users credentials are put into MainWindow variables and defines flag variable as True\n */\n if(result.getString(\"userID\").equals(inputLogin) && result.getString(\"password\").equals(inputPassword)) {\n flag = true;\n MainWindow.userLastName = result.getString(\"lastName\");\n MainWindow.userFirstName = result.getString(\"firstName\");\n MainWindow.userID = inputLogin;\n MainWindow.userPassword = inputPassword;\n }//end if statement\n } catch (Exception e) {\n //catches exceptions and show message about them\n System.out.println(e.getMessage());\n }//end try/catch\n //checks if Connection con is equaled null or not and closes it.\n MainWindow.closeConnection(con);\n return flag;\n }", "public static String CheckUserPermissionAccess(Boolean tConnection) {\r\n\t\tboolean connection = tConnection; \r\n\t\tboolean match = false;\r\n\t\tboolean partMatch = false;\r\n\t\tString username;\r\n\t\tString password;\r\n \tScanner scnr = new Scanner(System.in);\r\n\r\n\r\n\t\tSystem.out.println(\"Enter your username\");\r\n\t\tusername = scnr.nextLine();\r\n\t\tSystem.out.println(\"Enter your password\");\r\n\t\tpassword = scnr.nextLine();\r\n\r\n\r\n\t\tif(connection == true) {\r\n\t\t\t\r\n\t\t\t//this runs a query for a valid username/password combo\r\n\t\t\tif(serverConnector.validateUser(username, password) != null) {\r\n\t\t\t\tmatch = true;\r\n\r\n\t\t\t\ttry {\r\n\t\t\t\t\tloginRecorder(\"Successful\", username, password);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\r\n\t\t\t\t\r\n\t\t\t\t//try runs a queury for just a valid username, if a match that means username was valid but password wasnt\r\n\t\t\t} else if(serverConnector.validateUserNoPass(username, password) != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tloginRecorder(\"Partial\", username, password);\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\t\t}\r\n\r\n\t\t\t\t\r\n\t\t\t\t//no matching username\r\n\t\t\t} else {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tloginRecorder(\"None\", username, password);\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(match == true) {\r\n\t\t\t\treturn username;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\r\n\t\t//will pass to login record the type of login (sucessful, partial or none,) and the username/password to be logged\r\n\t\t//Currently could have some duplicate entries sent to login recording if there are different users with the same username (however this should never be allowed)\r\n\t\tfor(int i = 0; i < userList.size(); i++) {\r\n\t\t\tif( (username.equals(userList.get(i).getUserUsername())) && password.equals(userList.get(i).getUserPassword())) {\r\n\t\t\t\t//This prints the matching usernames and passwords, used for testing\r\n\t\t\t\t\r\n\t\t\t\t/*\r\n\t\t\t\t * \t\t\t\tSystem.out.println(\"UN: \" + username + \" matches DB UN: \" + userList.get(i).getUserUsername()\r\n\t\t\t\t+ \"\\r\\nPWD: \" + password + \" matches DB PWD: \" + userList.get(i).getUserPassword());\r\n\t\t\t\t */\r\n\r\n\t\t\t\tmatch = true;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tloginRecorder(\"Successful\",username, password);\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t} else if( (username.equals(userList.get(i).getUserUsername())) && !password.equals(userList.get(i).getUserPassword())) {\r\n\t\t\t\t\r\n\t\t\t\t//This also prints a message, stating the matched usernames, but the mismatched passwords, used for testing\r\n\t\t\t\t/*\r\n\t\t\t\t * \t\t\t\tSystem.out.println(\"UN: \" + username + \" matches DB UN: \" + userList.get(i).getUserUsername()\r\n\t\t\t\t+ \"\\r\\nPWD: \" + password + \" DOES NOT match DB PWD: \" + userList.get(i).getUserPassword());\r\n\t\t\t\t\r\n\t\t\t\t */\r\n\r\n\t\t\t\t\r\n\t\t\t\tpartMatch = true;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tloginRecorder(\"Partial\",username, password);\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(match != true && partMatch != true) {\r\n\t\t\ttry {\r\n\t\t\t\tloginRecorder(\"None\",username, password);\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(match == true) {\r\n\t\t\treturn username;\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}", "private boolean cekPassword(String password){\n return password.equals(Preferences.getRegisteredPass(getBaseContext()));\n }", "boolean hasPassword2();", "private boolean checkPass(String enterPass) {\n JdbcConnection connection = JdbcConnection.getInstance();\n DaoFactory daoFactory = new RealDaoFactory(connection);\n List<User> users = daoFactory.createUserDao().findAll();\n for (User user : users) {\n if (user.getPasswordHash() == enterPass.hashCode()) {\n return true;\n }\n }\n return false;\n }", "public boolean comparePassword(String username, String password) {\n boolean matchedPass = false;\n try {\n conn = dao.getConnection();\n ps = conn.prepareStatement(\"SELECT * FROM USERS WHERE USERNAME=? AND PASSWORD=?\");\n ps.setString(1, username);\n ps.setString(2, password);\n\n ResultSet rs = ps.executeQuery();\n\n // rs.next() is not empty if both user and pass are in the same row\n matchedPass = rs.next();\n\n // close stuff\n ps.close();\n conn.close();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return matchedPass;\n }", "static boolean logIn(String username, String password) {\r\n if (accounts.containsKey(username)) {\r\n if (accounts.get(username).getPassword().equals(password)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "@Override\n\tpublic boolean authenticate(final String name, final String password) {\n\t\treturn StringUtils.isNotBlank(name) && StringUtils.isNotBlank(password) && findByIdNoCache(name) != null;\n\t}", "boolean isAuthenticate(String username, String password) throws UserDaoException;", "public static boolean checkUserPass(String username, String password){\n getCurrentUsers();\n if(userPasses.containsKey(username)){\n System.out.println(\"bo\");\n if (userPasses.get(username).equals(password)){\n return true;\n }\n }\n System.out.println(username +\"|\"+password);\n return false;\n }", "private boolean verifyCredentials() {\n\n boolean bCredentialsValid = false;\n strUserMailID = strUserName = \"\";\n\n // Get the account information, if existing\n DatabaseHandler dbHandler = new DatabaseHandler(getApplicationContext());\n AccountInformation accInfo = dbHandler.getAccountInfo(m_tfUserEmailID.getText().toString());\n\n if(accInfo != null) {\n\n // Compute the hash for the user entered password\n OperationsHelper helper = new OperationsHelper();\n String strHashPwd = helper.getHashedPassword(m_tfUserPassword.getText().toString(), accInfo.getSaltValue());\n if(strHashPwd.equals(accInfo.getPassword())) {\n\n bCredentialsValid = true;\n strUserMailID = accInfo.getEmail();\n strUserName = accInfo.getName();\n\n // If Always login option is checked, update the value in the database\n if( ! (m_cbAutoLogon.isChecked() == accInfo.getIfAlwaysSignIn()) ) {\n\n accInfo.setAlwaysSignIn(m_cbAutoLogon.isChecked());\n dbHandler.updateAlwaysSignOnOption(accInfo);\n }\n } else {\n Toast.makeText(getApplicationContext(), \"Incorrect Password\", Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(getApplicationContext(), \"No such account exists. \\n\" +\n \" Create one to login\", Toast.LENGTH_LONG).show();\n }\n\n return bCredentialsValid;\n }", "public boolean userNameExist(String username);", "public static boolean checkLogin(String username, String password) throws Exception {\n boolean pass = true;\n try {\n Class.forName(\"com.mysql.jdbc.Driver\");\n connection = DriverManager.getConnection(\"RDS_HOST\",\"RDS_USERNAME\",\"RDS_PASSWORD\");\n String query = \"SELECT username,password FROM users WHERE username = ?\";\n PreparedStatement preparedStatement = connection.prepareStatement(query);\n preparedStatement.setString(1,username);\n resultSet = preparedStatement.executeQuery();\n while(resultSet.next()){\n if(resultSet.getString(1).equals(username) &&\n checkPassword(password,resultSet.getString(2))){\n pass = true;\n } else {\n pass = false;\n }\n }\n } finally {\n close();\n return pass;\n }\n }", "public boolean adminAccess (String password) throws PasswordException;", "private boolean login()\n {\n System.out.print(\"Enter your username: \");\n String userName = keyboard.nextLine().toLowerCase();\n currentUser = fs.getUser(userName);\n System.out.println();\n\n return currentUser != null;\n }", "public boolean login (String username, String password){\r\n /*If we encrypt the entered password then it means that the password never needs to \r\n be decrypted therefore making it more secure.*/\r\n password = encrypt(password);\r\n //Returns where the user is in the array, if the user is found, if not then index = -1.\r\n int index = f.searchForUsername(username);\r\n //If the user is not found then -1 is returned, and therefore the details are incorrect.\r\n if (index != -1){\r\n //Returns true if the passwords match.\r\n if (password.equals(f.user[index].getPassword())) {\r\n return true;\r\n } else {\r\n System.err.println(\"Username and Passwords do not match.\");\r\n return false;\r\n }\r\n } else {\r\n System.err.println(\"User not found.\");\r\n return false;\r\n }\r\n }", "public boolean checkUser(String username, String password) {\n String[] columns = {COL_1};\n SQLiteDatabase db = getReadableDatabase();\n String selection = COL_2 + \"=?\" + \" and \" + COL_3 + \"=?\";\n String[] selectionArgs = {username, password};\n Cursor cursor = db.query(USER_TABLE_NAME, columns, selection, selectionArgs, null, null, null);\n int count = cursor.getCount();\n cursor.close();\n db.close();\n\n if (count > 0)\n return true;\n else\n return false;\n }", "public boolean isCorrectLoginDetails(String username, String password) {\n boolean isExistingLogin = false; \n \n //Retrieve all existing user objects from the db. \n List<User> retrievedUsersList = new LinkedList<User>(); \n retrievedUsersList = repo.returnAllUsers(); \n \n User aUser = null; \n //For each object in the array, check if there is a match for the user inputs and the object properties. \n for(var user : retrievedUsersList) {\n aUser = (User)user; \n \n if(aUser.username.equals(username) && aUser.password.equals(password)) {\n isExistingLogin = true; \n }\n }\n return isExistingLogin; \n }", "@Override\n\tpublic boolean login(String username, String password) {\n\t\treturn false;\n\t}", "public Boolean isUsernameExist(String username);", "public boolean validateUserCredentials(String login, String password) throws SQLException;", "public boolean validateLogin(String username, String password, String person){\n\n\t\t boolean verify = false;\n\t\t try{\n\t\t\t //Read from the customer list if the radio button checked was customer\n\t\t\t if(person.equals(\"customer\")){\n\t\t\t\t readFile = new Scanner(new FileInputStream(\"./customer.txt\"));\n\t\t\t }\n\t\t\t //Read from the manager list if the radio button checked was manager\n\t\t \t else if(person.equals(\"manager\")){\n\t\t \t\t readFile = new Scanner(new FileInputStream(\"./manager.txt\"));\n\t\t \t }\n\t\t\t String user, pass, u1, p1;\n\t\t\t user = username;\n\t\t\t pass = password;\n\t\t\t //continue to read each line \n\t\t\t while(readFile.hasNextLine()){\n\t\t\t\t u1 = readFile.next();\n\t\t\t\t p1 = readFile.next();\n\t\t\t\t if(u1.equals(user)&& p1.equals(pass)){\n\t\t\t\t\t verify = true;\n\t\t\t\t\t break;\n\t\t\t\t }\n\t\t\t }\n\t\t\t return verify;\n\t\t } catch (FileNotFoundException f){\n\t\t\t System.out.println(\"File not found\");\n\t\t }\n\t\t return verify;\n\t }", "@Override\n\tpublic boolean login(String username, String password) {\n\t\treturn true;\n\t}", "private boolean checkUserInfo(String username, String password) {\n\t\treturn !(username == null || username.isEmpty()\n\t\t\t\t|| password == null || password.isEmpty() || password.length() < 6 && password.length() > 12);\n }", "private boolean checkCredentials(final String userid, final String password)\n {\n if(userid == null || password == null || userid.trim().length() < 1 || password.trim().length() < 1)\n {\n return false;\n }\n this.loadPasswordFile();\n if(LoginServlet.passwords.containsKey(userid))\n {\n final String expectedPassword = LoginServlet.passwords.getProperty(userid);\n if(expectedPassword.equals(password))\n {\n return true;\n }\n }\n \n return false;\n }", "public static Boolean checkPassowd(String password){\n\t\t//String password = txtPassword.getText();\n\t\t//System.out.println(password);\n\t\treturn password.equals(\"password\");\n\t}", "public boolean authenticate(String username, String password, HttpServletRequest request){\n try {\n MySQLService sql = new MySQLService();\n String digest = DigestUtils.md5Hex(password);\n boolean isMatched = sql.checkMatch(username, digest);\n System.out.println(isMatched);\n if (isMatched) {\n request.getSession().setAttribute(\"username\", username);\n return true;\n } else {\n return false;\n }\n }catch (Exception e){\n System.out.println(e);\n\n }\n return false;\n }", "public String isValidAgentLogin(String userName, String password, String txn);", "boolean hasPasswd();", "public static boolean RetrievePassword(String username) {\n JSONObject obj = new JSONObject();\n try {\n obj.put(\"type\", \"retrievePassword\");\n obj.put(\"username\", username);\n outWriter.println(obj);\n return Boolean.parseBoolean(inReader.readLine().toString());\n } catch (Exception exc) {\n //TODO: Raise exceptions through the ExceptionHandler class.\n System.out.println(\"Connection retrieve password error: \" + exc.toString());\n }\n return false;\n }", "@Override\n\tpublic boolean checkIsPwdSame(String username, String pwd) {\n\t\tString oldPwd = mvd.querryPwd(username);\n\t\tif(oldPwd.equals(pwd)){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public static boolean check() throws FileNotFoundException, IOException{\n File user = new File(userTf.getText().toUpperCase()+\".txt\");\n \n if(user.exists()){\n \n BufferedReader br = new BufferedReader(new FileReader(user));\n String pass = br.readLine();\n br.close();\n pass = FileWriting.decryption(pass);\n if(pass.equals(passPf.getText())){\n \n return true; \n \n }\n \n \n }\n \n return false;\n }", "boolean isUsernameExist(String username);", "public static boolean logInUser(String username, String password) {\n Scanner scan;\n try {\n scan = new Scanner (new File(\"Database.txt\"));\n }\n catch(FileNotFoundException e) {\n System.err.println(\"File Doesn't Exist\");\n return false;\n }\n \n while (scan.hasNextLine()) {\n String tmp = scan.nextLine();\n int spaceIndex = tmp.indexOf(' ');\n String user = tmp.substring(0, spaceIndex);\n String pass = tmp.substring(spaceIndex + 1, tmp.length());\n \n System.out.println(\"**\" + user + \", \" + pass + \"**\");\n\n if (username.equals(user) && password.equals(pass)) {\n System.out.println(\"Login Successful\");\n scan.close();\n return true;\n } \n }\n System.out.println(\"Login Failed\");\n scan.close();\n return false;\n }", "boolean isMatchPassword(Password toCheck) throws NoUserSelectedException;", "boolean checkCust(String user, String pass){\r\n String [] lineSplit;\r\n \r\n try{\r\n out = new FileReader(\"Customer.txt\");\r\n BufferedReader read = new BufferedReader(out);\r\n \r\n String line;\r\n \r\n while((line = read.readLine()) != null){\r\n lineSplit = null;\r\n lineSplit = line.split(\",\");\r\n userName = lineSplit[0];\r\n password = lineSplit[1];\r\n \r\n if(user.equals(userName) && pass.equals(password)){\r\n return true; \r\n }\r\n }\r\n } catch (FileNotFoundException ex) {\r\n \r\n } catch (IOException ex) { \r\n } \r\n return false; \r\n }", "public abstract boolean checkUser(String username);", "boolean isUser(String username);", "@Override\n\tpublic boolean verifyUser(String username,String password )\n\t{\n\t\tboolean b;\n\t\tString sql = \"select username,password from f_loginTable where username=? and password=?\";\n\t\tint noOfRows=template.update(sql, new Object[] {username,password});\n\t\tif(noOfRows==1)\n\t\t{b=true;}\n\t\telse \n\t\t{b=false;}\n\t\treturn b;\t\t\n\t}", "private boolean valPassword(String pass){\n if (usuario.getPassword().equals(pass)){\n return true;\n }\n return false;\n }", "boolean isLogin(String username, String password)\n {\n String endURL = \"login/\" + username + \"/\" + password;\n return (request(\"GET\", \"\", endURL).equals(\"SUCCESSFUL\"));\n }", "private boolean AlreadyLogin() {\n\t\tString usn = uPreferences.getString(\"username\", null);\n\t\tString pwd = uPreferences.getString(\"password\", null);\n\t\tif((usn == null) || ((pwd == null))){\n\t\t\treturn false;\n\t\t}\n\t\telse \n\t\t\treturn true;\n\t}", "public boolean isUser(String userName) throws Exception;", "private boolean isValidUser(String userName, String password) {\n\t\tif (userName.equals(\"Admin\") && password.equals(\"Admin\")) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t}", "private boolean authenticatedUser(String uName, String pass) {\n\t\treturn true;\n\t}", "private boolean authenticate(String _uid, String _pwd) {\n\n Connection dbCon = null;\n ResultSet rs = null;\n try {\n dbCon = ds.getConnection();\n Statement s = dbCon.createStatement();\n rs = s.executeQuery(\"select * from user where id = '\"\n + _uid + \"' and pwd = '\" + _pwd + \"'\");\n return (rs.next());\n }\n catch (java.sql.SQLException e) {\n System.out.println(\"A problem occurred while accessing the database.\");\n System.out.println(e.toString());\n }\n finally {\n try {\n dbCon.close();\n }\n catch (SQLException e) {\n System.out.println(\"A problem occurred while closing the database.\");\n System.out.println(e.toString());\n }\n }\n \n return false;\n\n }", "public boolean checkPass(String password){\r\n if (password.equals(this.password)){\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public static boolean validate(String un, String pw) {\r\n\t\tboolean status=false;\r\n\t\t\r\n\t\t//Establish connection to MySQL\r\n\t\ttry{ \r\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\"); \r\n\t\t\tConnection con=DriverManager.getConnection( \r\n\t\t\t\t\t\"jdbc:mysql://localhost:3306/moviedb\",\"root\",\"\"); \r\n \r\n\t\t\tStatement stmt=con.createStatement();\r\n\t\t\t\r\n\t\t\t//execute query for password for given username\r\n\t\t\tResultSet rs=stmt.executeQuery(\"SELECT password FROM users WHERE username='\"+un+\"'\"); \r\n\t\t\t//After query pointer is set on record\r\n\t\t\t//moves pointer before record\r\n\t\t\trs.beforeFirst();\r\n\t\t\t\r\n\t\t\t//Checks that username exists based on if the pointer is before a record\r\n\t\t\tif(rs.isBeforeFirst()) {\r\n\t\t\t\t//Moves pointer back onto record so we can get string\r\n\t\t\t\trs.next();\r\n\t\t\t\t//if entered password matches password in database return true\r\n\t\t\t\tif(pw.equals(rs.getString(1))) {\r\n\t\t\t\t\tstatus = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse\r\n\t\t\t\tstatus=false;\r\n\t\t\t\r\n\t\t\t//close connection\r\n\t\t\tcon.close();\r\n\t\t} \r\n\r\n\t\tcatch(Exception e){ \r\n\t\t\tSystem.out.println(e);} \r\n\t\t\r\n\t\treturn status;\r\n\t}", "public boolean validateUser (String username, String password){\n Cursor cursor = dbHelper.getReadableDatabase().rawQuery(\n \"SELECT * FROM \" + dbHelper.TABLE_USERS + \" WHERE \" + dbHelper.COLUMN_USERNAME\n + \"='\" + username + \"' AND \" + dbHelper.COLUMN_PASSWORD + \"='\" + password + \"'\",null);\n if (cursor.getCount()>0){\n return true;\n }else {\n return false;\n }\n }", "public boolean isUserExist(String email, String Password);", "public boolean autenticaCliente(String username, String password){\r\n\t\tFile file = new File(username+\".csv\");\r\n\t\ttry {\r\n\t\t\tif(!file.exists()){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tScanner sc = new Scanner(file.getAbsoluteFile());\r\n\t\t\tif(sc.nextLine().equals(password)){\r\n\t\t\t\tsc.close();\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tsc.close();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.out.println(\"Um erro ocorreu!\");\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private boolean authenticate (HttpRequest request, HttpResponse response) throws UnsupportedEncodingException\n\t{\n\t\tString[] requestSplit=request.getPath().split(\"/\",3);\n\t\tif(requestSplit.length<2)\n\t\t\treturn false;\n\t\tString serviceName=requestSplit[1];\n\t\tfinal int BASIC_PREFIX_LENGTH=\"BASIC \".length();\n\t\tString userPass=\"\";\n\t\tString username=\"\";\n\t\tString password=\"\";\n\t\t\n\t\t//Check for authentication information in header\n\t\tif(request.hasHeaderField(AUTHENTICATION_FIELD)\n\t\t\t\t&&(request.getHeaderField(AUTHENTICATION_FIELD).length()>BASIC_PREFIX_LENGTH))\n\t\t{\n\t\t\tuserPass=request.getHeaderField(AUTHENTICATION_FIELD).substring(BASIC_PREFIX_LENGTH);\n\t\t\tuserPass=new String(Base64.decode(userPass), \"UTF-8\");\n\t\t\tint separatorPos=userPass.indexOf(':');\n\t\t\t//get username and password\n\t\t\tusername=userPass.substring(0,separatorPos);\n\t\t\tpassword=userPass.substring(separatorPos+1);\n\t\t\t\n\t\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\t\n\t\t\t\tlong userId;\n\t\t\t\tAgent userAgent;\n\t\t\t\t\n\t\t\t\tif ( username.matches (\"-?[0-9].*\") ) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tuserId = Long.valueOf(username);\n\t\t\t\t\t} catch ( NumberFormatException e ) {\n\t\t\t\t\t\tthrow new L2pSecurityException (\"The given user does not contain a valid agent id!\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tuserId = l2pNode.getAgentIdForLogin(username);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tuserAgent = l2pNode.getAgent(userId);\n\t\t\t\t\n\t\t\t\tif ( ! (userAgent instanceof PassphraseAgent ))\n\t\t\t\t\tthrow new L2pSecurityException (\"Agent is not passphrase protected!\");\n\t\t\t\t((PassphraseAgent)userAgent).unlockPrivateKey(password);\n\t\t\t\t_currentUserId=userId;\n\t\t\t\t\n\t\t\t\tif(!_userSessions.containsKey(userId))//if user not registered\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\tMediator mediator = l2pNode.getOrRegisterLocalMediator(userAgent);\n\t\t\t\t\t_userSessions.put(userId, new UserSession(mediator));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t_userSessions.get(userId).updateServiceTime(serviceName,new Date().getTime());//update last access time for service\n\t\t\t\t\n\t\t\t\tconnector.logMessage(\"Login: \"+username);\n\t\t\t\tconnector.logMessage(\"Sessions: \"+Integer.toString(_userSessions.size()));\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t}catch (AgentNotKnownException e) {\n\t\t\t\tsendUnauthorizedResponse(response, null, request.getRemoteAddress() + \": login denied for user \" + username);\n\t\t\t} catch (L2pSecurityException e) {\n\t\t\t\tsendUnauthorizedResponse( response, null, request.getRemoteAddress() + \": unauth access - prob. login problems\");\n\t\t\t} catch (Exception e) {\n\t\t\t\t\n\t\t\t\tsendInternalErrorResponse(\n\t\t\t\t\t\tresponse, \n\t\t\t\t\t\t\"The server was unable to process your request because of an internal exception!\", \n\t\t\t\t\t\t\"Exception in processing create session request: \" + e);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tresponse.setStatus ( HttpResponse.STATUS_BAD_REQUEST );\n\t\t\tresponse.setContentType( \"text/plain\" );\n\t\t\tresponse.print ( \"No authentication provided!\" );\n\t\t\tconnector.logError( \"No authentication provided!\" );\n\t\t}\n\t\treturn false;\n\t}", "boolean hasLogin();", "boolean hasLogin();", "String checkTrueDetails() throws JSONException \n {\n String result;\n DataBaseConnection db= new DataBaseConnection();\n db.connectToDB();\n try {\n if (db.checkIfExist(db.checkUser,usernameJsn ))\n {\n String userPassword= db.findValue(usernameJsn, \"USERNAME\",\"PASSWORD\",\"PLAYERS\");\n if (userPassword.equals(passwordJsn))\n result= \"Success\";\n else\n result= \"WRONG PASSWORD\";\n }\n \n else result= \"user doesn't exist\";\n } catch (SQLException ex) {\n Logger.getLogger(LoginUser.class.getName()).log(Level.SEVERE, null, ex);\n result=\"error\";\n }\n db.closeDBConnection();\n return result;\n }", "public boolean authenticate(String s) {\r\n // TODO - implement User.authenticate\r\n throw new UnsupportedOperationException();\r\n }", "boolean hasUsername();", "boolean hasUsername();", "boolean hasUsername();", "boolean hasUsername();", "boolean hasUsername();", "boolean hasUsername();", "boolean isValidUsernameAndPassword(String username, String password) throws SQLException\r\n\t{\r\n\t\tConnection connection = DatabaseHandler.getDBconnection();\r\n\t\t\r\n\t\tString query = \"SELECT * FROM user WHERE userName = ? AND password = ?\";\r\n\t\tPreparedStatement statement = connection.prepareStatement(query);\r\n\t\t\r\n\t\tstatement.setString(1, username);\r\n\t\tstatement.setString(2, password);\r\n\t\tResultSet set = statement.executeQuery();\r\n\t\t\r\n\t\tif(set.next()) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}", "boolean checkUserCorrispondenceLogin(String emailLogin, String passwordLogin);" ]
[ "0.7185651", "0.6903452", "0.6866181", "0.6801031", "0.6763969", "0.66979706", "0.66781723", "0.6586215", "0.65681046", "0.6545066", "0.6516176", "0.6508688", "0.64528334", "0.64293635", "0.64221257", "0.6418632", "0.6391839", "0.63797796", "0.63749194", "0.63726383", "0.63401085", "0.63088125", "0.628972", "0.6286587", "0.6284459", "0.62803924", "0.6271503", "0.62705964", "0.6261886", "0.62594557", "0.62594557", "0.62594557", "0.62594557", "0.62594557", "0.62594557", "0.62594557", "0.62594557", "0.6227303", "0.6215016", "0.6206773", "0.6205014", "0.61988896", "0.6197082", "0.61955225", "0.61840373", "0.61820805", "0.6173224", "0.61458105", "0.6133788", "0.6124457", "0.61227465", "0.6118306", "0.61047167", "0.60873574", "0.6085798", "0.60829073", "0.60766643", "0.60746473", "0.6065844", "0.6063187", "0.6062955", "0.6059551", "0.6046829", "0.604354", "0.60400593", "0.6038492", "0.60380757", "0.60371494", "0.60278815", "0.6022347", "0.60169333", "0.60132986", "0.6010439", "0.60086703", "0.5999456", "0.5999389", "0.59977263", "0.59968424", "0.5989193", "0.59843355", "0.59791076", "0.59697235", "0.5968212", "0.5967098", "0.5967034", "0.5949582", "0.5948643", "0.5944091", "0.5943941", "0.5939092", "0.5939092", "0.59377056", "0.59368944", "0.5927664", "0.5927664", "0.5927664", "0.5927664", "0.5927664", "0.5927664", "0.59275144", "0.59170055" ]
0.0
-1
The function retrieves number of the registered users in the past n days
@SuppressWarnings("deprecation") @RequestMapping(value = "get_number_of_registred_users", method = { RequestMethod.GET }) public int getNumberOfRegistredUsers(@RequestParam("days") int days) throws IOException { System.out.println(days + ""); int result = 0; MongoClient mongoClient = null; try { // Create the date before n days Date startDate = new Date(); startDate.setDate(startDate.getDate() - days); startDate.setHours(0); startDate.setMinutes(0); startDate.setSeconds(0); // Create Mongo client mongoClient = new MongoClient("localhost", 27017); MongoDatabase db = mongoClient.getDatabase("projectDB"); // Create Users collection MongoCollection<Document> collection = db.getCollection("USERS"); // Get all user before n days FindIterable<Document> iterDoc = collection.find(gt("RegistrationDate", startDate)); Iterator it = iterDoc.iterator(); while (it.hasNext()) { it.next(); result++; } // Close DB connection mongoClient.close(); } catch (Exception e) { mongoClient.close(); System.out.println(e); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getMessageCounterHistoryDayLimit();", "public int getNumberOfNewerOnUserActivities(Identity ownerIdentity, Long sinceTime);", "int getUsersCount();", "int getUsersCount();", "int getUsersCount();", "public int getNumberOfOlderOnUserActivities(Identity ownerIdentity, Long sinceTime);", "int getUserCount();", "int getUserCount();", "public int getCountOfMostUpcomingUserEvents(long userId);", "public int getUserCount() {\n\t\t\treturn 7;\n\t\t}", "List<Integer> getIdUsersWithExpiredLifeTimeList( Timestamp currentTimestamp );", "List<Integer> getIdUsersWithExpiredPasswordsList( Timestamp currentTimestamp );", "public List<User> getUsersByNumberOfPosts(int N);", "public int getNumberOfNewerOnActivityFeed(Identity ownerIdentity, Long sinceTime);", "public void getUsersByDays() throws IOException, SystemException {\n List<UserSubscribeDTO> usersList = planReminderService.getUsersByDays();\n LOGGER.info(\"userLIst Recievec:\" + usersList);\n shootReminderMails(usersList);\n }", "List<User> findUsers(long max, int count);", "public int getSignupByDayCount(int day) {\r\n\t\treturn signupByDayCountList.get(day);\r\n\r\n\t}", "public int getNumberOfNewerOnUserSpacesActivities(Identity ownerIdentity, Long sinceTime);", "public long getUserCount() throws UserManagementException;", "public int getLoggedInUsers();", "Integer loadUserCount();", "public int numberOfUsers() {\r\n \tint anzahlUser=userDAO.getUserList().size();\r\n \treturn anzahlUser;\r\n }", "public int getNumberOfOlderOnUserSpacesActivities(Identity ownerIdentity, Long sinceTime);", "public int getNumberOfOlderOnActivityFeed(Identity ownerIdentity, Long sinceTime);", "int getNumberDays();", "public int daysOverdue(int today);", "int getNumberOfRegsUser(long idUser);", "public int getHowManyInPeriod();", "public int getUserCount() {\n return instance.getUserCount();\n }", "public int getNumberOfOlderOnUserActivities(Identity ownerIdentity, ExoSocialActivity baseActivity);", "@Override\n\tpublic int getDaysSinceLastLogin() {\n\t\tDate now = sabre.getTimeNow();\n\t\tlong timeDiff = now.getTime() - lastLogin.getTime();\n\t\tlong diffDays = TimeUnit.DAYS.convert(timeDiff, TimeUnit.MILLISECONDS);\n\t\treturn (int)diffDays;\n\t}", "public long getExpiredSessions();", "public int getNumberOfLastDayEvents() {\n int counter = 0;\n long currentTimeSeconds = getCurrentTimeInSeconds();\n for (int i = 0; i < records.length; i++) {\n synchronized (records[i]) {\n if (currentTimeSeconds - records[i].getLastTimeReset() < SECONDS_IN_DAY) {\n counter += records[i].getCount();\n }\n }\n }\n\n return counter;\n }", "public int getNumberOfOlderOnSpaceActivities(Identity ownerIdentity, Long sinceTime);", "Data<List<User>> getfollowingUsers(Integer limit);", "int getNumberOfGuests();", "public String fetchCountMyData(User loginUser);", "public static int getNotificationsUsersCount()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException {\n\t\treturn getService().getNotificationsUsersCount();\n\t}", "public long getUsersCount(\n org.eclipse.stardust.engine.api.query.UserQuery query)\n throws org.eclipse.stardust.common.error.WorkflowException;", "@Override\n public List getPagesWithActiveUsers(Long count, String orderBy) {\n log.debug(\"This method fetches most active users\");\n SimpleDateFormat datetimeFormatter = new SimpleDateFormat(\n \"yyyy-MM-dd HH:mm:ss\");\n LocalDateTime currentDateTime = LocalDateTime.now();\n List<CsvModel> csvModelList = csvRepository.findAll();\n List<String> responseList = new ArrayList<>();\n if (csvModelList == null) {\n throw new CsvException(String.format(\"records not found , please insert some records\"));\n }\n if (csvModelList != null && csvModelList.size() > 0) {\n for (CsvModel e : csvModelList) {\n Duration diff = Duration.between(currentDateTime, e.getLast_updated_at().toLocalDateTime());\n if (diff.toDays() < 60) {\n responseList.add(e.getUuid());\n }\n }\n }\n log.debug(\"Most active users fetched successfully\");\n return responseList;\n }", "public void setUsersCount(long usersCount) {\r\n this.usersCount = usersCount;\r\n }", "Optional<List<User>> findUserLimitCount(String count) throws LogicException;", "List<NotificationEntity> findNUnseenByLogin(String login, int n);", "public int getUsersCount()\n\t{\n\t\tint usersCount=(int) userDao.count();\n\t\treturn usersCount;\n\t}", "public List<ExoSocialActivity> getOlderUserActivities(Identity owner, Long sinceTime, int limit);", "public int getNumberOfNewerOnUserActivities(Identity ownerIdentity, ExoSocialActivity baseActivity);", "List<Integer> getIdUsersToSendFirstAlert( Timestamp alertMaxDate );", "public int getNumberOfOlderOnActivitiesOfConnections(Identity ownerIdentity, Long sinceTime);", "public List<Login> getUsers(Date startDate, Date endDate);", "public long getUsersCount() {\r\n return usersCount;\r\n }", "public int getCount(String username);", "public Integer findNumOfUsers(String username);", "public List<User> getUsers(Boolean enabled, Date startDate, Date endDate, int offset, int length) throws UserManagementException;", "public int countUsers()\n {\n int nbUser = 0;\n pw.println(12);\n try\n {\n nbUser = Integer.parseInt(bis.readLine()) ;\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n return nbUser ;\n }", "public int getNowPeople() {\n\t\treturn nowPeople;\n\t}", "Long getUserCreated();", "@Override\r\n\tpublic int[] getDayPeople() {\n\t\tint[] result = new int[7];\r\n\t\tDate date = DateUtil.getCurrentDate();\r\n\t\tresult[0] = cinemaConditionDao.getDayCount(date);\r\n\t\tfor(int i=0;i<6;i++){\r\n\t\t\tdate = DateUtil.getDayBefore(date);\r\n\t\t\tresult[i+1] = cinemaConditionDao.getDayCount(date);\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "@Override\n\tpublic List<Integer> usersDate(String fecha) {\n\t\treturn controlA.usersDate(fecha);\n\t}", "public static final int getCountNewUserByIP(final String address) {\n int count = 0;\n final PairVector<String, Long> DV = p().newusersByIP;\n synchronized (DV) {\n for (int i = DV.size() - 1; i >= 0; i--) {\n if (DV.elementAt(i).first.equalsIgnoreCase(address)) {\n if (System.currentTimeMillis() > (DV.elementAt(i).second.longValue()))\n DV.removeElementAt(i);\n else\n count++;\n }\n }\n }\n return count;\n }", "public int getNumberOfNewerOnActivitiesOfConnections(Identity ownerIdentity, Long sinceTime);", "int maxReturnEventsForQuery();", "@Override\n\tpublic int queryaddtoday(Employee bi) throws Exception {\n\t\tString sql =\"select count(u.id) from userinfo u where date(u.createtime) = curdate() and u.state=0 and u.role=1 and u.fbusinessid =\"+bi.getId();\n\t\tint newadd = databaseHelper.getSqlCount(sql);\n return newadd;\n\t}", "public int getNumberOfUserActivities(Identity owner) throws ActivityStorageException;", "List<Day> getDays(String userName);", "public int numberUsers() \n\t{\n\t\treturn this.userList.size();\n\t}", "@GetMapping(\"currentUser\")\n public BetterResponse getUserLastSevenLoginLogs() {\n String currentUsername = SecurityContextHolder.getContext().getAuthentication().getName();\n List<LoginLog> userLastSevenLoginLogs = this.loginLogService.findUserLastSevenLoginLogs(currentUsername);\n return new BetterResponse().data(userLastSevenLoginLogs);\n }", "int getCountOfFemaleUsers(List<User> users);", "void setMessageCounterHistoryDayLimit(int days);", "public int getUserCount() {\n return user_.size();\n }", "public int getNumberOfNewerOnSpaceActivities(Identity spaceIdentity, Long sinceTime);", "public int takeNewestUser() {\n\t\treturn service.takeNewestUser();\n\t}", "public List<ExoSocialActivity> getNewerUserActivities(Identity owner, Long sinceTime, int limit);", "long getUnjoinedEventsCount();", "public void getUsersByWeek() throws IOException, SystemException {\n List<UserSubscribeDTO> usersList = planReminderService\n .getUsersByWeeks();\n LOGGER.info(\"userLIst Recievec:\" + usersList);\n shootReminderMails(usersList);\n }", "public int[] getDataMsgSentLast30Days() {\n\t\tint[] result = new int[30];\n\t\tint it = 0;\n\t\tfor (LocalDate date = LocalDate.now().minusDays(29); date\n\t\t\t\t.isBefore(LocalDate.now().plusDays(1)); date = date.plusDays(1)) {\n\t\t\tLocalDate day = date;\n\t\t\tcontador = 0;\n\t\t\tcurrentUser.getContacts().forEach(contact -> {\n\t\t\t\tcontador += contact.getMessages().stream()\n\t\t\t\t\t\t.filter(m -> (m.getTime().toLocalDate().getDayOfYear() == day.getDayOfYear())\n\t\t\t\t\t\t\t\t&& (m.getSpeaker() == currentUser.getId()))\n\t\t\t\t\t\t.count();\n\t\t\t});\n\t\t\tresult[it] = contador;\n\t\t\tit++;\n\t\t}\n\t\treturn result;\n\t}", "protected int countUsers() \n\t{\n\t\tint result = -1;\n\t\ttry {\n\t\t\tStatement stat = conn.createStatement();\n\t\t\tResultSet rs = stat.executeQuery(\"SELECT COUNT(lfm_username) FROM Persons;\");\n\t\t\tSystem.out.println(rs.toString());\n\t\t\tresult = rs.getInt(1);\n\t\t} \n\t\tcatch (SQLException e) \n\t\t{\n\t\t\tSystem.out.println(\"Something went wrong counting users from Persons\");\n\t\t}\n\t\treturn result;\n\t}", "public int getUsers()\n\t{\n\t\tint users=0;\n\t\tString query=\"select count(*) from login where usertype=?\";\n\t\ttry\n\t\t{\n\t\t\tConnection con=DBInfo.getConn();\t\n\t\t\tPreparedStatement ps=con.prepareStatement(query);\n\t\t\tps.setString(1, \"user\");\n\t\t\tResultSet res=ps.executeQuery();\n\t\t\twhile(res.next())\n\t\t\t{\n\t\t\t\tusers=res.getInt(1);\n\t\t\t}\n\t\t\tcon.close();\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn users;\n\t}", "public int getWallItemsCount(String userUuid);", "public int getNumberOfOlderOnUserSpacesActivities(Identity ownerIdentity, ExoSocialActivity baseActivity);", "public int getNumberOfUsers() {\n \t\treturn interactionHistorySizes.size();\n \t}", "public int getUsersCount() {\n return users_.size();\n }", "public int getUsersCount() {\n return users_.size();\n }", "public int getUserCount(UserParams params) throws Exception {\n\t\treturn 0;\n\t}", "List<Integer> getIdUsersToSendOtherAlert( Timestamp alertMaxDate, Timestamp timeBetweenAlerts, int maxNumberAlerts );", "public int getUpDays() {\n return (int)(_uptime / 86400000);\n }", "public int checkExpiryDate(LocalDate today) {\n\n final int limit = 100;\n long expirationDate = Duration.between(\n this.food.getCreateDate().atTime(0, 0), this.food.getExpiryDate().atTime(0, 0)\n ).toDays();\n long goneDate = Duration.between(\n this.food.getCreateDate().atTime(0, 0), today.atTime(0, 0)\n ).toDays();\n\n return (int) (limit * goneDate / expirationDate);\n\n }", "public int getNumberOfDays() {\n return numberOfDays;\n }", "Integer getNumberOfUserActivity() {\n return daoInterface.getNumberOfUserActivity();\n }", "public int[] getDataMsgReceivedLast30Days() {\n\t\tint[] result = new int[30];\n\t\tint it = 0;\n\t\tfor (LocalDate date = LocalDate.now().minusDays(29); date\n\t\t\t\t.isBefore(LocalDate.now().plusDays(1)); date = date.plusDays(1)) {\n\t\t\tLocalDate day = date;\n\t\t\tcontador = 0;\n\t\t\tcurrentUser.getContacts().forEach(contacto -> {\n\t\t\t\tcontador += contacto.getMessages().stream()\n\t\t\t\t\t\t.filter(m -> (m.getTime().toLocalDate().getDayOfYear() == day.getDayOfYear())\n\t\t\t\t\t\t\t\t&& !(m.getSpeaker() == currentUser.getId()))\n\t\t\t\t\t\t.count();\n\t\t\t});\n\t\t\tresult[it] = contador;\n\t\t\tit++;\n\t\t}\n\t\treturn result;\n\t}", "@Override\r\n\tpublic int selectUserCount() {\n\t\treturn userMapper.selectUserCount();\r\n\t}", "public int getMetaUsers();", "public static Date setToNDaysAgo(Date date, int n) {\n\t\t\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.setTime(date);\n\t\tcal.add(Calendar.DATE, -n);\n\t return cal.getTime();\n\t}", "@Override\n\tpublic int ddayCount(String memberNo) {\n\t\treturn dDao.ddayCount(sqlSession, memberNo);\n\t}", "public int getNumberOfUserActivitiesForUpgrade(Identity owner) throws ActivityStorageException;", "public List<ExoSocialActivity> getOlderUserSpacesActivities(Identity owner, Long sinceTime, int limit);", "@Override\n\tpublic int datecount() throws Exception {\n\t\treturn dao.datecount();\n\t}", "public ArrayList<Integer> getUsedUDays() {\n return pastUDays;\n }", "public int getNumberOfActivitesOnActivityFeedForUpgrade(Identity ownerIdentity);", "@Override\r\n\tpublic int memberCount() {\n\t\treturn sqlSession.selectOne(NAMESPACE + \".member_count_user\");\r\n\t}", "public void getUsersByMonth() throws IOException, SystemException {\n\n List<UserSubscribeDTO> usersList = planReminderService\n .getUsersByMonth();\n LOGGER.info(\"userLIst Recievecd:\" + usersList);\n shootReminderMails(usersList);\n\n }" ]
[ "0.64240754", "0.63347626", "0.63143706", "0.63143706", "0.63143706", "0.62131137", "0.6205446", "0.6205446", "0.61731756", "0.6158484", "0.615505", "0.5969962", "0.5952294", "0.5920685", "0.59170794", "0.5912049", "0.58635896", "0.5859096", "0.5852567", "0.5846927", "0.5792648", "0.578381", "0.57687575", "0.57159233", "0.57117003", "0.56792384", "0.565442", "0.5595536", "0.55223984", "0.5521254", "0.55113053", "0.5489118", "0.54663867", "0.5463532", "0.54602575", "0.54566944", "0.54411966", "0.54382855", "0.54374313", "0.5410633", "0.5408629", "0.5407786", "0.5386729", "0.5382163", "0.5374454", "0.53594047", "0.5357239", "0.5357114", "0.53549933", "0.53535223", "0.5353444", "0.53469276", "0.53419787", "0.53376645", "0.53288823", "0.53236675", "0.53217125", "0.5319005", "0.5316067", "0.53095967", "0.5302539", "0.5301923", "0.5288812", "0.5288007", "0.5280319", "0.52763456", "0.52730525", "0.5266255", "0.5261137", "0.52582", "0.5252999", "0.52502203", "0.5242985", "0.5212222", "0.5204048", "0.51994145", "0.5198557", "0.5191791", "0.51874864", "0.51790226", "0.5172513", "0.51723164", "0.5168574", "0.5168501", "0.5166396", "0.51610225", "0.51593655", "0.51579726", "0.51570004", "0.5148476", "0.51463157", "0.51411206", "0.5135427", "0.5120657", "0.51166743", "0.5113295", "0.511327", "0.5111941", "0.5102487", "0.51009536" ]
0.714399
0
The function retrieves all the users
@RequestMapping(value = "get_all_users", headers = "Accept=*/*", method = { RequestMethod.GET }, produces = "application/json") @ResponseBody @org.codehaus.jackson.map.annotate.JsonView(User.class) public User[] getAllUsers() { ArrayList<User> users = new ArrayList<>(); MongoClient mongoClient = null; try { // Create Mongo client mongoClient = new MongoClient("localhost", 27017); MongoDatabase db = mongoClient.getDatabase("projectDB"); // Create Users collection MongoCollection<Document> collection = db.getCollection("USERS"); FindIterable<Document> iterDoc = collection.find(); // Create all users collection int i = 1; Iterator it = iterDoc.iterator(); while (it.hasNext()) { Document docUser = (Document) it.next(); User user = new User((String) docUser.get("username"), (String) docUser.get("firstName"), (String) docUser.get("lastName")); users.add(user); } // Close DB connection mongoClient.close(); } catch (Exception e) { mongoClient.close(); System.out.println(e); } // Insert list to array User[] usersArray = new User[users.size()]; users.toArray(usersArray); return usersArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List getAllUsers();", "public List<User> getAllUsers();", "List<User> getAllUsers();", "List<User> getAllUsers();", "public void getAllUsers() {\n\t\t\n\t}", "public List<User> getAllUsers(){\n myUsers = loginDAO.getAllUsers();\n return myUsers;\n }", "Iterable<User> getAllUsers();", "public List<TbUser> getAllUsers() {\n return userRepository.findAll();\n }", "@Override\n\tpublic List<User> getAllUser() {\n\t\tList<User> users = dao.searchAllUser();\n\t\treturn users;\n\t}", "List<KingdomUser> getAllUsers();", "@Override\r\n\tpublic User getAllUser() {\n\t\tList<User> list=null;\r\n\t\ttry {\r\n\t\t\tString sql = \"SELECT * FROM USER\";\r\n\t\t\treturn qr.query(sql, new BeanHandler<User>(User.class));\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public List<Users> getAllUsers() {\r\n\t\t// return usDao.findAll();\r\n\t\treturn usDao.getAllUsers();\r\n\t}", "public List<User> getAllUsers(){\n return userRepository.findAll();\n }", "@Override\n\tpublic List<Object> getAllUsers() {\n\t\tList<Object> usersList = new ArrayList<Object>();\n\t\tList<TestUser> users = dao.getAll();\n\t\tSystem.out.println(dao.exists(5));\n\t\tfor(TestUser user : users){\n\t\t\tMap<String,Object> m = new HashMap<String,Object>();\n\t\t\tm.put(\"id\", user.getId());\n\t\t\tm.put(\"name\", user.getUsername());\n\t\t\tm.put(\"pwd\", user.getPassword());\n\t\t\tJSONObject j = new JSONObject(m);\n\t\t\tusersList.add(j);\n\t\t}\n\t\treturn usersList;\n\t}", "public List<User> getAll() {\n\t\treturn service.getAll();\n\t}", "public List<TestUser> getAllUsers(){\n\t\tSystem.out.println(\"getting list of users..\");\n\t\tList<TestUser> user=new ArrayList<TestUser>();\n\t\tuserRepositary.findAll().forEach(user::add);\n\t\t//System.out.println(\"data: \"+userRepositary.FindById(\"ff80818163731aea0163731b190c0000\"));\n\t\treturn user;\n\t}", "@Override\r\n\tpublic List<User> getAll() {\n\t\treturn users;\r\n\t}", "@Override\n\tpublic List<User> getAllUsers() {\n\t\tlog.info(\"get all users!\");\n\t\treturn userRepository.findAll();\n\t}", "List<User> getUsers();", "List<User> getUsers();", "@GetMapping(\"/allusers\")\n\t@Secured({CommonConstants.ROLE_EMPLOYEE,CommonConstants.ROLE_ADMIN})\n\tpublic ResponseEntity<List<UserEntity>> fetchUsers(){\n\t\treturn new ResponseEntity<List<UserEntity>>(this.service.findAll(), HttpStatus.OK);\n\t}", "@GetMapping(\"/users\")\n\tpublic List<User> retrieveAllUsers() {\n\t\treturn userService.findAll();\n\t}", "@Override\n public List<User> getAllUsers() {\n\n Session session = sessionFactory.openSession();\n Transaction tx = session.beginTransaction();\n List<User> hiberusers =\n session.createQuery(\"From User\").list();\n tx.commit();\n session.close();\n return hiberusers;\n }", "@GetMapping(path=\"/all\")\n\tpublic @ResponseBody Iterable<User> getAllUsers() {\n\t\t// This returns a JSON or XML with the users\n\t\treturn userRepository.findAll();\n\t}", "@Override\n public List<User> selectAllUsers() {\n\n List<User> userList = new ArrayList<>();\n\n try (Connection connection = DriverManager.getConnection(URL, USERNAME, PASSWORD)) {\n\n String sql = \"SELECT * FROM ers_users\";\n\n PreparedStatement ps = connection.prepareStatement(sql);\n\n ResultSet rs = ps.executeQuery();\n\n while (rs.next()) {\n\n userList.add(\n new User(\n rs.getInt(1)\n , rs.getString(2)\n , rs.getString(3)\n , rs.getString(4)\n , rs.getString(5)\n , rs.getString(6)\n , rs.getInt(7)\n )\n );\n }\n }\n\n catch (SQLException e) {\n\n e.printStackTrace();\n }\n\n return userList;\n }", "List<User> fetchAllUSers();", "public List<YuserVO> getAllUsers() {\n\t\tList<YuserVO> list = null;\n\t\t\ttry {\n\t\t\t\tlist = userDao.getAllUsers();\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.out.println(\"get users failed ..................................\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\treturn list;\n\t}", "public static List<User> getAllUsers(){\n\t\t// getting all users\n\t\treturn dao.getAllUsers();\n\t}", "@Override\n\tpublic List<ERSUser> getAllUsers() {\n\t\treturn userDao.selectAllUsers();\n\t}", "@Override\n\tpublic List<Users> getAll() {\n\t\treturn usersDAO.getAll();\n\t}", "@Override\r\n\tpublic List<User> users() {\r\n\t\tList<User> ris = new ArrayList<>();\r\n\t\tList< Map <String,String>> maps = getAll(SELECT_USERS);\r\n\t\tfor (Map<String, String> map : maps) {\r\n\t\t\tris.add(IMappable.fromMap(User.class, map));\r\n\t\t}\r\n\t\treturn ris;\r\n\t}", "@GetMapping\n public List<User> getAllUsers() {\n return userService.getAllUsers();\n }", "public List<User> listAll() throws Exception;", "@Override\n\tpublic List<User> getAll() {\n\t\treturn userDao.getAll();\n\t}", "@Override\r\n\tpublic List<User> queryAllUsers() {\n\t\tList<User> users = userMapper.queryAllUsers();\r\n\t\treturn users;\r\n\t}", "@Override\r\n\tpublic List<User> getAllUser() {\n\t\tList<User> listStudents = new ArrayList<User>();\r\n\t\tlistStudents = userReposotory.findAll();\r\n\t\treturn listStudents;\r\n\t}", "@Override\n\tpublic List<User> getallUserDetail() {\n\t\tdatasource = getDataSource();\n\t\tjdbcTemplate = new JdbcTemplate(datasource);\n\t\t// select all from table user\n\t\tString sql = \"SELECT * FROM user\";\n\t\tList<User> listuser = jdbcTemplate.query(sql, new RowMapper<User>() {\n\n\t\t\t@Override\n\t\t\tpublic User mapRow(ResultSet rs, int rowNum) throws SQLException {\n\t\t\t\tUser user = new User();\n\t\t\t\t// set parameters\n\t\t\t\tuser.setUserid(rs.getLong(\"user_id\"));\n\t\t\t\tuser.setEmailid(rs.getString(\"emailid\"));\n\t\t\t\tuser.setAppversion(rs.getString(\"appversion\"));\n\t\t\t\tuser.setGcmregistartionkey(rs.getString(\"gcmregistartionkey\"));\n\t\t\t\tuser.setMobileno(rs.getString(\"mobileno\"));\n\t\t\t\tuser.setUuid(rs.getString(\"uuid\"));\n\t\t\t\tuser.setUsername(rs.getString(\"username\"));\n\t\t\t\tuser.setCreateddate(rs.getDate(\"createddate\"));\n\t\t\t\treturn user;\n\t\t\t}\n\n\t\t});\n\n\t\treturn listuser;\n\n\t}", "public ArrayList<IndividualUser> listAllUsers() {\n try {\n PreparedStatement s = sql.prepareStatement(\"SELECT id, userName, firstName, lastName FROM Users \");\n s.execute();\n ResultSet results = s.getResultSet();\n ArrayList<IndividualUser> users = new ArrayList<>();\n if (!results.isBeforeFirst()) {\n results.close();\n s.close();\n return users;\n }\n\n while (!results.isLast()) {\n results.next();\n IndividualUser u = new IndividualUser(results.getInt(1), results.getString(2), results.getString(3), results.getString(4));\n\n users.add(u);\n\n }\n\n results.close();\n s.close();\n\n return users;\n } catch (SQLException e) {\n sqlException(e);\n return null;\n }\n }", "java.util.List<com.heroiclabs.nakama.api.User> \n getUsersList();", "public List<User> getAllUsers() {\n return users;\n }", "public List<User> getAllUsers() {\n\t\tLog.i(TAG, \"return all users list.\");\n\t\tList<User> result = new ArrayList<User>();\n\t\tSQLiteDatabase db = this.getReadableDatabase();\n\t\tString getUsers = \"select * from \" + TABLE_USER;\n\t\tCursor cursor = db.rawQuery(getUsers, null);\n\t\tfor (cursor.moveToFirst();!cursor.isAfterLast();cursor.moveToNext()) {\n\t\t\tUser user = new User(cursor.getInt(0), cursor.getString(1), cursor.getString(2));\n\t\t\tresult.add(user);\n\t\t}\n\t\treturn result;\n\t}", "public List<Users> getUserList(){\n\t\tList<Users> users = (List<Users>) this.userDao.findAll();\n\t\treturn users;\n\t}", "@GetMapping\n public ResponseEntity<List<UserEntity>> getAllUsers() {\n return ResponseEntity.ok(uService.getAllUsers());\n }", "@GetMapping(path=\"/all\",produces = MediaType.APPLICATION_JSON_VALUE)\r\n public @ResponseBody\r\n Iterable<UserEntity> getAllUsers() {\n return userService.getAllUsers();\r\n }", "@GET\n\t@Path(\"/allUsers\")\n\t@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })\n\tpublic Map<String, List<User>> getUser() throws JsonGenerationException, JsonMappingException, IOException {\n\t\t\n\t\tMap<String, List<User>> user = userDao.getUser();\n\t\t\n\t\treturn user; \n\t}", "@GetMapping(path = \"/all\")\n public @ResponseBody\n Iterable<User> getAllUsers() {\n LOG.info(\"Displays all the users from the database\");\n return userRepository.findAll();\n }", "private void getAllUsers(){\n\t\t\n\t\tSystem.out.println(\"Retrieving Social Graph Data from tibbr...\"); \n\t\tDefaultHttpClient httpClient = new DefaultHttpClient();\n\n\t\tString params = \"?sort=firstNameAsc&fields=name,jive.username,-resources&count=5000&startIndex=0\"; \n\t\tHttpGet getRequest = new HttpGet(urlBase+\"/api/core/v3/people/@all\"+params);\n\t\t\n\n\t\t\t \n\t\tgetRequest.setHeader(\"Authorization\", \"Basic \" + this.auth);\n\t\t\n\t\t\t\n\t\ttry {\n\t\t\tHttpResponse response = httpClient.execute(getRequest);\n\t\t\tString jsonOut = readStream(response.getEntity().getContent());\n\t\t // Remove throwline if present\n\t\t\tjsonOut = removeThrowLine(jsonOut);\n\t\t getAllUserElements(jsonOut);\n\t\t \n\t \n\t\t} catch (ClientProtocolException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t}", "@Override\r\n public List<User> userfindAll() {\n return userMapper.userfindAll();\r\n }", "public List<User> getUsers();", "public List<User> queryAllUsers() {\n \tList<User> userList = new ArrayList<>();\n\tUser user;\n String sql = \"SELECT * FROM users\";\n\ttry {\t\n this.statement = connection.prepareStatement(sql);\n this.resultSet = this.statement.executeQuery();\n while(this.resultSet.next()) {\n\t\tuser = new User();\n user.setUserName(this.resultSet.getString(\"user_name\"));\n user.setHashedPassword(this.resultSet.getString(\"hashed_password\"));\n\t\tuser.setEmail(this.resultSet.getString(\"email\"));\n user.setHashedAnswer(this.resultSet.getString(\"hashed_answer\"));\n user.setIsActivated(this.resultSet.getInt(\"is_activated\"));\n user.setPublicKey(this.resultSet.getString(\"pubkey\"));\n\t\tuserList.add(user);\n }\t\n this.statement.close();\n\t} \n catch(SQLException ex) {\n Logger.getLogger(UserDBManager.class.getName()).log(Level.SEVERE, null, ex);\n }\n return userList;\n }", "@Override\n\tpublic ArrayList<User> findAll() {\n\t\t\n\t\treturn userDao.querydAll();\n\t}", "List<UserDTO> getAllUsers();", "public Users findAll() {\n\tthis.createConnection();\n try {\n Connection con = this.getCon();\n PreparedStatement stmnt = con.prepareStatement(this.getAllQuery());\n ResultSet rs = stmnt.executeQuery();\n return get(rs);\n } catch (SQLException e) {\n System.out.println(\"SQL Exception\" + e.getErrorCode() + e.getMessage());\n e.getStackTrace();\n return new Users();\n }\n }", "@GetMapping\n public List<User> getAll() {\n return userService.getAll();\n }", "public List<User> getAllUsers() {\n\t\tfactory = new Configuration().configure().buildSessionFactory();\n\t\tsession = factory.getCurrentSession();\n\t\tsession.beginTransaction();\n\t\tQuery query = session.createQuery(\"from User\");\n\t\tList<User> list = query.getResultList();\n\t\tsession.close();\n\t\treturn list;\n\n\t\t\n\t}", "@Override\n\tpublic ArrayList<User> getAll() {\n\t\treturn this.users;\n\t}", "public List<User> getAllUsers() {\n List<User> users = null;\n Session session = null;\n try {\n session = openSession();\n users = session.createCriteria(User.class).list();\n } catch (HibernateException he) {\n logger.error(\"Hibernate Exception: \" + he);\n } catch (Exception e) {\n logger.error(\"Exception: \" + e);\n } finally {\n if (session != null) {\n session.close();\n }\n }\n return users;\n }", "@RequestMapping(value = \"/users/list\", method = RequestMethod.GET)\n\tpublic @ResponseBody List<UsersDTO> findAllUsers() {\n\t\tlogger.info(\"Return All Users.\");\t\n\t\treturn (List<UsersDTO>) usersService.findAllUsers();\n\t}", "public List<User> retrieveAllUsers() {\n\t\treturn (List<User>) userRepository.findAll();\n\t}", "public ArrayList<UserDetail> gettingAllAvailableUsers() throws Exception;", "@Override\r\n\tpublic List<User> findAllUsers() {\n\t\treturn userDAO.findAllUsers();\r\n\t}", "public ArrayList<User> getAllUsers() {\n return profile.getAllUsers();\n }", "@RequestMapping(method = RequestMethod.GET)\n\tpublic List<User> getAll() {\n\t\tList<User> users = dao.getAll();\n\t\treturn users;\n\t}", "public static ArrayList<Userdatas> getAllUsersList() {\n\t\tRequestContent rp = new RequestContent();\n\t\trp.type = RequestType.GET_ALL_USERS;\n\t\tReceiveContent rpp = sendReceive(rp);\n\t\tArrayList<Userdatas> anagList = (ArrayList<Userdatas>) rpp.parameters[0];\n\t\treturn anagList;\n\t}", "public List<User> getAllUsers() {\n\t\treturn userDao.selectAllUsers();\n\t}", "public List<User> findAll() \n\t{\n\t\tString sql = \"SELECT * FROM VIDEOGAMESTORE.USERS\";\n\t\t\n\t\t// Instantiate a new list of Users.\n\t\tList<User> userList = new ArrayList<User>();\n\t\t\n\t\ttry {\n\t\t\tSqlRowSet srs = jdbcTemplate.queryForRowSet(sql);\n\t\t\twhile(srs.next())\n\t\t\t{\n\t\t\t\t// Add a new User to the list for every row that is returned\n\t\t\t\tuserList.add(new User(srs.getString(\"USERNAME\"), srs.getString(\"PASSWORD\"), srs.getString(\"EMAIL\"),\n\t\t\t\t\t\tsrs.getString(\"FIRST_NAME\"), srs.getString(\"LAST_NAME\"), srs.getInt(\"GENDER\"), srs.getInt(\"USER_PRIVILEGE\"), srs.getInt(\"ID\")));\n\t\t\t}\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn userList;\n\t}", "@Override\n\tpublic List<User> selectAllUser() {\n\t\tList<User> users = null;\n\t\ttry {\n\t\t\tusers = client.queryForList(\"selectAllUser\");\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn users;\n\n\t}", "@GetMapping(\"/\")\n\tpublic ResponseEntity<List<UsersDTO>> listAllusers(){\n\t\tList<UsersDTO> users = userJpaRepository.findAll();\n\t\tif(users.isEmpty()) {\n\t\t\treturn new ResponseEntity<List<UsersDTO>>(HttpStatus.NO_CONTENT);\n\t\t}\n\t\treturn new ResponseEntity<List<UsersDTO>>(users, HttpStatus.OK);\n\t}", "public List<User> getAll() {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic List<?> getAllUser() {\n\t\treturn userQueryRepositoryImpl.getAllUser();\r\n\t}", "@Override\n\tpublic List<User> getUserList() {\n\t\treturn userDao.queryUser();\n\t}", "@Override\n\tpublic Iterable<com.example.demo.model.User> getAllUsers() {\n\t\treturn userRepository.findAll();\n\t}", "@Override\n public ObservableList<User> getAllUsers() {\n return controller.getAllUsers();\n }", "@RequestMapping(value = \"/getAll\", method = RequestMethod.GET)\n public ResponseEntity getAllUsers() {\n List<User> users = userService.getAllUsers();\n if (CollectionUtils.isEmpty(users)) {\n return new ResponseEntity(HttpStatus.NO_CONTENT);\n }\n return new ResponseEntity(users, HttpStatus.OK);\n }", "public List<User> getAllUsers() {\n\t\tTypedQuery<User> query = em.createNamedQuery(\"User.findAll\", User.class);\n\n\t\tList<User> result = query.getResultList();\n\t\tlog(\"got all users, result size: \" + result.size());\n\t\treturn result;\n\t}", "List<KingdomUser> getUsers();", "List<User> loadAll();", "public ArrayList<User> getAllUsers() {\n return allUsers;\n }", "Collection<GetUserDto> getAllUsers();", "List<UserDisplayDto> getAllUsers();", "public List listUsers() {\n Session session = HibernateSessionFactory.getSessionFactory().openSession();\n Transaction tx = null;\n List users = null;\n try {\n tx = session.beginTransaction();\n users = session.createQuery(\"FROM User\").list();\n for (Iterator iterator = users.iterator(); iterator.hasNext(); ) {\n User user = (User) iterator.next();\n System.out.print(\"id: \" + user.getId());\n System.out.print(\" Username: \" + user.getUsername());\n System.out.print(\" Password: \" + user.getPassword());\n System.out.println(\" Email: \" + user.getEmail());\n }\n tx.commit();\n } catch (HibernateException e) {\n if (tx != null) tx.rollback();\n e.printStackTrace();\n } finally {\n session.close();\n }\n return users;\n }", "@Override\n\tpublic List<ERS_USERS> getAll() {\n\t\treturn null;\n\t}", "public List<User> getAllUsers() {\n\t\t/* begin transaction */ \n\t\tSession session = getCurrentSession(); \n\t\tsession.beginTransaction();\n\n\t\tQuery query = session.createQuery(\"from User u order by u.lastLogin DESC\");\n\t\tList<User> userList = query.list();\n\n\t\t/* commit */ \n\t\tsession.getTransaction().commit();\n\n\t\treturn userList;\n\t}", "@Override\n public List<User> findAll() {\n try {\n return runner.query(con.getThreadConnection(),\"select * from user\",new BeanListHandler<User>(User.class));\n } catch (SQLException e) {\n System.out.println(\"执行失败\");\n throw new RuntimeException(e);\n }\n }", "public List<UserModel> getAllUsers()\n {\n List<UserModel> userModels =new ArrayList<>();\n //user.findAll().forEach(topics::add);\n for(UserModel userModel : userRepository.findAll())\n {\n userModels.add(userModel);\n }\n return userModels;\n }", "@Override\n\tpublic List<User> findAllUser() {\n\t\treturn mapper.findAllUser();\n\t}", "@Override\n\tpublic List<User> getAllUser() {\n\t\treturn uDao.getAllUser();\n\t}", "@Override\n\tpublic List<User> list() \n\t{\n\t\treturn userDAO.list();\n\t}", "@Override\r\n\tpublic List<Map<String, Object>> findAllUser() {\n\t\treturn userMapper.findAllUser();\r\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tpublic List<User> getUsers() \r\n\t{\n\t\tSession session = sessionFactory.getCurrentSession();\r\n String sql = \"select * from users\";\r\n Query query = session.createSQLQuery(sql).addEntity(User.class);\r\n\t\tSystem.out.println(\"getUsers list is : \" + query.list().size());\r\n\t\treturn query.list();\r\n\t}", "public List getUsers(User user);", "public static List<User> getUsersList(){\n\t\tWSResponse response = null;\n\t\tList<User> resultList = new ArrayList<User>();\n\t\ttry{\n\t\tPromise<WSResponse> result = WS.url(Utils.getApiUrl()+Urls.GET_USERS_URL)\n\t\t\t\t\t\t\t\t\t\t.setContentType(Urls.CONTENT_TYPE_JSON)\n\t\t\t\t\t\t\t\t\t\t.get();\n\t\tresponse = result.get(10000);\n\t\tGson gson = new Gson();\n\t\tUser[] users = gson.fromJson(response.getBody(), User[].class);\n\t\tfor(int i=0; i<users.length; i++){\n\t\t\tresultList.add(users[i]);\n\t\t}\n\t\t} catch(Exception exception){\n\t\t\tController.flash(Messages.ERROR, Messages.CANT_LOAD_USERS + exception);\n\t\t}\n\t\treturn resultList;\n\t}", "@Override\n\tpublic List<User> findAll() {\n\t\treturn this.userMapper.findAll();\n\t}", "public List<User> fetchAll()\n {\n String query = \"SELECT * FROM user\";\n RowMapper<User> userRowMapper = new BeanPropertyRowMapper<>(User.class); // a collection type that holds the results of the query\n List<User> userList; // list of users that will be returned\n try\n {\n userList = template.query(query, userRowMapper); // call the database and assign the results to the userList\n } catch (EmptyResultDataAccessException e)\n {\n userList = new ArrayList<>(); // return an empty arrayList\n }\n return userList;\n }", "@Override\n public Users getUsers() throws UserException {\n Users users = new Users();\n log.debug(\"getUsers\");\n User user = null;\n ResultSet result;\n Connection conn = null;\n PreparedStatement stm = null;\n try {\n conn = provider.getConnection();\n\n stm = conn.prepareStatement(GET_ALL_USERS);\n result = stm.executeQuery();\n\n while (result.next()) {\n user = buildUserFromResult(result);\n log.debug(\"User found {}\", user);\n users.add((DataUser) user);\n }\n\n } catch (SQLException e) {\n e.printStackTrace();\n throw new UserException(e.getMessage());\n\n } finally {\n try {\n stm.close();\n conn.close();\n } catch (Exception e) {\n\n e.printStackTrace();\n }\n }\n return users;\n }", "@Override\n\tpublic List<User> getAll() {\n\t\treturn null;\n\t}", "@Override\n\tpublic List<User> getAll() {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic List listAllUser() {\n\t\treturn userDAO.getUserinfoList();\r\n\t}", "@Override\n\tpublic List All() {\n\t\treturn new userDaoImpl().All();\n\t}", "@Override\n public List<User> getAllUser() {\n// SQLParameter sqlParameter = DSL.select()\n// .from(TableOperand.table(User.class))\n// .build();\n// return executor.selectList(sqlParameter);\n return null;\n }", "@Override\n\tpublic List<UserEntity> getAllUsers() {\n\t\treturn userRepository.findAll();\n\t}" ]
[ "0.87929666", "0.86154795", "0.85068935", "0.85068935", "0.83694714", "0.83441687", "0.83380973", "0.8228831", "0.8154644", "0.81355804", "0.8127571", "0.8124158", "0.8119746", "0.81188065", "0.81071657", "0.8106824", "0.8097273", "0.80845255", "0.8080779", "0.8080779", "0.80789006", "0.8074921", "0.8067551", "0.80665857", "0.80298203", "0.8019315", "0.80173194", "0.8012862", "0.8010844", "0.80053616", "0.8004531", "0.80037236", "0.79984117", "0.7995331", "0.79937166", "0.79923785", "0.79842794", "0.797432", "0.79734933", "0.7966909", "0.7949042", "0.79399306", "0.793599", "0.79350555", "0.79333794", "0.7932427", "0.7927624", "0.7926571", "0.79221475", "0.79187846", "0.79163426", "0.79137355", "0.7911608", "0.79060304", "0.79017615", "0.7887585", "0.7866589", "0.78606254", "0.7860612", "0.7859727", "0.78591764", "0.7858249", "0.7855273", "0.785137", "0.78424263", "0.7839204", "0.78291154", "0.78212893", "0.7819637", "0.781912", "0.7817928", "0.7811887", "0.78116757", "0.78011197", "0.7793596", "0.7792514", "0.77881646", "0.77856654", "0.7780419", "0.77627885", "0.7762122", "0.7759933", "0.77579606", "0.7756492", "0.7753285", "0.7751264", "0.77503383", "0.77503103", "0.7749974", "0.7744638", "0.77435476", "0.77379435", "0.77321523", "0.77234644", "0.7723086", "0.7721843", "0.7721843", "0.7720548", "0.7714506", "0.7714482", "0.7706901" ]
0.0
-1
TODO Autogenerated method stub
@Override public Act3370102 findOneByKyBaoCao(String kyBaoCao) { return act3370102Repo.findOneByKy(kyBaoCao); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void deleteByKyBaoCao(String ky) { act3370102Repo.deleteByKy(ky); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void deleteByKyBaoCaoAndUserId(String ky, String userId) { act3370102Repo.deleteByKyAndUsrId(ky, userId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Initialize the contents of the frame.
private void initialize(PeerList peerList, Peer user) { client = new Client(peerList,user); frame = new JFrame(); frame.setBounds(100, 100, 880, 584); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); client.setConnected(true); client.listenServer(); client.listenPeers(); if(peerList.getList().size()>0) { for(Peer aPeer:peerList.getList()) { if(!(aPeer.getUsername().compareTo(theUser.getUsername())==0)){ listModel.add(modelIndex,aPeer.getUsername()); modelIndex++; } if(modelIndex>0) { list = new JList<String>(listModel); } else { listModel.add(0, "No Peers Online"); list = new JList<String>(listModel); } } } else { listModel.add(0, "No Peers Online"); list = new JList<String>(listModel); } list.setFont(new Font("Tahoma", Font.PLAIN, 14)); list.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { JList<String> list = (JList<String>)evt.getSource(); if (evt.getClickCount() == 2) { // When the user double clicks on the peer list, the messageList gets populated // with the messages from that peers conversation. int index = list.locationToIndex(evt.getPoint()); String peerName = list.getComponent(index).toString(); selectedPeer = peerList.getPeer(peerName); if (!selectedPeer.getMessageList().isEmpty()) { String peerMessages = selectedPeer.getMessageListString(); messageListContent.setText(peerMessages); } } } }); JLabel lblPeers = new JLabel("Peers"); lblPeers.setFont(new Font("Tahoma", Font.PLAIN, 22)); JLabel lblmessageListContent = new JLabel("Message List:"); lblmessageListContent.setFont(new Font("Tahoma", Font.PLAIN, 22)); JLabel lblMessage = new JLabel("Message:"); lblMessage.setFont(new Font("Tahoma", Font.PLAIN, 22)); messageListContent = new JTextArea(); messageListContent.setLineWrap(true); messageListContent.setFont(new Font("Monospaced", Font.PLAIN, 15)); messageListContent.setEditable(false); JTextArea messageBox = new JTextArea(); messageBox.setLineWrap(true); messageBox.setToolTipText("Enter your text here"); messageBox.setRows(5); JButton send = new JButton("Send"); //When the send button is clicked, the contents of the message box are cleared and sent to the selected peer. send.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(selectedPeer != null) { Message sentMessage = new Message(messageBox.getText(),client.getTheUser().getUsername()); client.sendToPeer(sentMessage,selectedPeer,clientPort); messageListContent.append("Sent:"+sentMessage.toString()); messageBox.setText(null); } } }); JScrollPane scrollPane = new JScrollPane(messageListContent,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); GroupLayout groupLayout = new GroupLayout(frame.getContentPane()); groupLayout.setHorizontalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addGap(35) .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) .addComponent(lblPeers, GroupLayout.PREFERRED_SIZE, 217, GroupLayout.PREFERRED_SIZE) .addComponent(list, GroupLayout.PREFERRED_SIZE, 227, GroupLayout.PREFERRED_SIZE)) .addGap(48) .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) .addComponent(lblmessageListContent, GroupLayout.PREFERRED_SIZE, 217, GroupLayout.PREFERRED_SIZE) .addComponent(lblMessage, GroupLayout.PREFERRED_SIZE, 217, GroupLayout.PREFERRED_SIZE) .addGroup(groupLayout.createSequentialGroup() .addComponent(messageBox, GroupLayout.PREFERRED_SIZE, 474, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(send)) .addGroup(groupLayout.createSequentialGroup() .addComponent(messageListContent, GroupLayout.PREFERRED_SIZE, 530, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(scrollPane, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))) .addGap(17)) ); groupLayout.setVerticalGroup( groupLayout.createParallelGroup(Alignment.TRAILING) .addGroup(groupLayout.createSequentialGroup() .addContainerGap() .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) .addComponent(lblmessageListContent, GroupLayout.PREFERRED_SIZE, 32, GroupLayout.PREFERRED_SIZE) .addComponent(lblPeers, GroupLayout.PREFERRED_SIZE, 32, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(Alignment.TRAILING, groupLayout.createSequentialGroup() .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addComponent(messageListContent, GroupLayout.PREFERRED_SIZE, 308, GroupLayout.PREFERRED_SIZE) .addGap(18) .addComponent(lblMessage, GroupLayout.PREFERRED_SIZE, 32, GroupLayout.PREFERRED_SIZE)) .addComponent(scrollPane, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(groupLayout.createParallelGroup(Alignment.LEADING, false) .addComponent(send, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(messageBox, GroupLayout.DEFAULT_SIZE, 88, Short.MAX_VALUE)) .addGap(14)) .addGroup(groupLayout.createSequentialGroup() .addComponent(list, GroupLayout.DEFAULT_SIZE, 463, Short.MAX_VALUE) .addContainerGap()))) ); frame.getContentPane().setLayout(groupLayout); JMenuBar menuBar = new JMenuBar(); frame.setJMenuBar(menuBar); JMenu mnFile = new JMenu("File"); menuBar.add(mnFile); JMenuItem mntmNewMenuItem = new JMenuItem("New menu item"); mnFile.add(mntmNewMenuItem); JMenuItem mntmNewMenuItem_1 = new JMenuItem("New menu item"); mnFile.add(mntmNewMenuItem_1); JMenu mnHelp = new JMenu("Help"); menuBar.add(mnHelp); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public BreukFrame() {\n super();\n initialize();\n }", "public MainFrame() {\n\t\tsuper();\n\t\tinitialize();\n\t}", "private void initialize() {\n\t\tthis.setSize(211, 449);\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setTitle(\"JFrame\");\n\t}", "public SiscobanFrame() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(0, 0, 1100, 800);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\tsetUIComponents();\n\t\tsetControllers();\n\n\t}", "private void initialize() {\r\n\t\tthis.setSize(530, 329);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JFrame\");\r\n\t}", "private void initialize() {\r\n\t\tthis.setSize(300, 200);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JFrame\");\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\taddSampleData();\n\t\tsetDefaultSettings();\n\t\topenHomePage();\n\t\tframe.setVisible(true);\n\t}", "private void initialize() {\n\t\tframe = new JFrame(\"Media Inventory\");\r\n\t\tframe.setBounds(100, 100, 450, 300);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(0, 0, 1000, 700);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tframeContent = new JPanel();\n\t\tframe.getContentPane().add(frameContent);\n\t\tframeContent.setBounds(10, 10, 700, 640);\n\t\tframeContent.setLayout(null);\n\t\t\n\t\tinfoPane = new JPanel();\n\t\tframe.getContentPane().add(infoPane);\n\t\tinfoPane.setBounds(710, 10, 300, 640);\n\t\tinfoPane.setLayout(null);\n\t}", "private void initialize() {\n\t\tframe = new JFrame(\"BirdSong\");\n\t\tframe.pack();\n\t\tframe.setVisible(true);\n\t\tframe.setBounds(100, 100, 400, 200);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\tabc = new BirdPanel();\n\t\ttime = new TimePanel();\n\t\tgetContentPane().setLayout(new BoxLayout(frame, BoxLayout.Y_AXIS));\n\n\t\tframe.getContentPane().add(abc, BorderLayout.NORTH);\n\t\tframe.getContentPane().add(time, BorderLayout.CENTER);\n\t}", "private void initialize() {\r\n\t\tthis.setSize(311, 153);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JFrame\");\r\n\t\tsetCancelButton( btnCancel );\r\n\t}", "public Frame() {\n initComponents();\n }", "public Frame() {\n initComponents();\n }", "private void initialize() {\r\n\t\tthis.setSize(497, 316);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JFrame\");\r\n\t\tthis.setExtendedState(JFrame.MAXIMIZED_BOTH);\r\n\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t}", "protected HFrame(){\n\t\tinit();\n\t}", "private void initializeFields() {\r\n myFrame = new JFrame();\r\n myFrame.setSize(DEFAULT_SIZE);\r\n }", "private void initialize() {\n\t\tthis.setSize(329, 270);\n\t\tthis.setContentPane(getJContentPane());\n\t}", "private void initialize() {\r\n\t\t//setFrame\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(125,175, 720, 512);\r\n\t\tframe.setTitle(\"Periodic Table\");\r\n\t\tframe.setResizable(false);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t}", "private void initFrame() {\n setLayout(new BorderLayout());\n }", "private void initialize() {\n\t\tthis.setSize(300, 300);\n\t\tthis.setIconifiable(true);\n\t\tthis.setClosable(true);\n\t\tthis.setTitle(\"Sobre\");\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setFrameIcon(new ImageIcon(\"images/16x16/info16x16.gif\"));\n\t}", "public FrameControl() {\n initComponents();\n }", "private void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(100, 100, 450, 300);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t}", "public MainFrame() {\n initComponents();\n \n }", "private void init(Element frame) {\n\t\tthis.frameWidth = Integer.parseInt(frame.attributeValue(\"width\"));\n\t\tthis.frameHeight = Integer.parseInt(frame.attributeValue(\"height\"));\n\t\tthis.paddle = Integer.parseInt(frame.attributeValue(\"paddle\"));\n\t\tthis.size = Integer.parseInt(frame.attributeValue(\"size\"));\n\t}", "public MainFrame() {\n \n initComponents();\n \n this.initNetwork();\n \n this.render();\n \n }", "public internalFrame() {\r\n initComponents();\r\n }", "private void initialize() {\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setSize(810, 600);\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setBackground(new java.awt.Color(226,226,222));\n\t\tthis.setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);\n\t\tthis.setModal(true);\n\t\tthis.setResizable(false);\n\t\tthis.setName(\"FramePrincipalLR\");\n\t\tthis.setTitle(\"CR - Lista de Regalos\");\n\t\tthis.setLocale(new java.util.Locale(\"es\", \"VE\", \"\"));\n\t\tthis.setUndecorated(false);\n\t}", "public Mainframe() {\n initComponents();\n }", "private void initialize() {\r\n\t\tthis.setSize(392, 496);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"Informações\");\r\n\t}", "private void initialize() {\n this.setSize(253, 175);\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n this.setContentPane(getJContentPane());\n this.setTitle(\"Breuken vereenvoudigen\");\n }", "private void initialize() {\r\n\t\t// Initialize main frame\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(Constants.C_MAIN_PREFERED_POSITION_X_AT_START, Constants.C_MAIN_PREFERED_POSITION_Y_AT_START, \r\n\t\t\t\tConstants.C_MAIN_PREFERED_SIZE_X, Constants.C_MAIN_PREFERED_SIZE_Y);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.setTitle(Constants.C_MAIN_WINDOW_TITLE);\r\n\t\t\r\n\t\t// Tab panel and their panels\r\n\t\tmainTabbedPane = new JTabbedPane(JTabbedPane.TOP);\r\n\t\tframe.getContentPane().add(mainTabbedPane, BorderLayout.CENTER);\r\n\t\t\r\n\t\tpanelDecision = new DecisionPanel();\r\n\t\tmainTabbedPane.addTab(Constants.C_TAB_DECISION_TITLE, null, panelDecision, null);\r\n\t\t\r\n\t\tpanelCalculation = new CalculationPanel();\r\n\t\tmainTabbedPane.addTab(Constants.C_TAB_CALCULATION_TITLE, null, panelCalculation, null);\r\n\t\t\r\n\t\tpanelLibrary = new LibraryPanel();\r\n\t\tmainTabbedPane.addTab(Constants.C_TAB_LIBRARY_TITLE, null, panelLibrary, null);\r\n\t\t\r\n\t\t// Menu bar\r\n\t\tmenuBar = new JMenuBar();\r\n\t\tframe.setJMenuBar(menuBar);\r\n\t\tcreateMenus();\r\n\t}", "public void initializeFrame() {\n frame.getContentPane().removeAll();\n createComponents(frame.getContentPane());\n// frame.setSize(new Dimension(1000, 600));\n }", "private void initialize() {\r\n\t\t// this.setSize(271, 295);\r\n\t\tthis.setSize(495, 392);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(ResourceBundle.getBundle(\"Etiquetas\").getString(\"MainTitle\"));\r\n\t}", "private void initializeFrame() {\n add(container);\n setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);\n pack();\n }", "private void initialize() {\n this.setSize(300, 200);\n this.setContentPane(getJContentPane());\n this.pack();\n }", "private void initialize() {\n\t\tframe = new JFrame(\"DB Filler\");\n\t\tframe.setBounds(100, 100, 700, 500);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\tdbc = new DataBaseConnector();\n\t\tcreateFileChooser();\n\n\t\taddTabbedPane();\n\t\tsl_panel = new SpringLayout();\n\t\taddAddFilePanel();\n\t}", "public mainframe() {\n initComponents();\n }", "public FrameDesign() {\n initComponents();\n }", "public Jframe() {\n initComponents();\n setIndice();\n loadTextBoxs();\n }", "public JGSFrame() {\n\tsuper();\n\tinitialize();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n try {\n initComponents();\n initElements();\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"Error \" + e.getMessage());\n }\n }", "private void initialize() {\n this.setSize(495, 276);\n this.setTitle(\"Translate Frost\");\n this.setContentPane(getJContentPane());\n }", "private void initialize() {\r\n\t\t// set specific properties and add inner components.\r\n\t\tthis.setBorder(BorderFactory.createEtchedBorder());\r\n\t\tthis.setSize(300, 400);\r\n\t\tthis.setLayout(new BorderLayout());\r\n\t\taddComponents();\r\n\t}", "private void initialize() {\r\n\t\tthis.setBounds(new Rectangle(0, 0, 670, 576));\r\n\t\tthis.setResizable(false);\r\n\t\tthis.setTitle(\"数据入库 \");\r\n\t\tthis.setLocationRelativeTo(getOwner());\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t}", "public void initializePanelToFrame() {\n\t\tnew ColorResources();\n\t\tnew TextResources().changeLanguage();\n\t\tpanel = new JPanel();\n\t\tpanel.setLayout(null);\n\t\tpanel.setPreferredSize(new Dimension(375, 812));\n\n\t\tconfigureLabels();\n\t\tconfigureButtons();\n\t\taddListeners();\n\t\taddComponentsToPanel();\n\n\t\tthis.setContentPane(panel);\n\t\tthis.pack();\n\t}", "private void initialize() {\n this.setLayout(new BorderLayout());\n this.setSize(new java.awt.Dimension(564, 229));\n this.add(getMessagePanel(), java.awt.BorderLayout.NORTH);\n this.add(getBalloonSettingsListBox(), java.awt.BorderLayout.CENTER);\n this.add(getBalloonSettingsButtonPane(), java.awt.BorderLayout.SOUTH);\n\n editBalloonSettingsFrame = new EditBalloonSettingsFrame();\n\n }", "public SMFrame() {\n initComponents();\n updateComponents();\n }", "private void initialize() {\n m_frame = new JFrame(\"Video Recorder\");\n m_frame.setResizable(false);\n m_frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n m_frame.setLayout(new BorderLayout());\n m_frame.add(buildContentPanel(), BorderLayout.CENTER);\n\n JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 5, 5));\n JButton startButton = new JButton(\"Start\");\n startButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent ae) {\n listen();\n }\n });\n buttonPanel.add(startButton);\n\n m_connectionLabel = new JLabel(\"Disconnected\");\n m_connectionLabel.setOpaque(true);\n m_connectionLabel.setBackground(Color.RED);\n m_connectionLabel.setBorder(BorderFactory.createLineBorder(Color.BLACK, 3));\n m_connectionLabel.setPreferredSize(new Dimension(100, 26));\n m_connectionLabel.setHorizontalAlignment(SwingConstants.CENTER);\n buttonPanel.add(m_connectionLabel);\n\n m_frame.add(buttonPanel, BorderLayout.PAGE_END);\n }", "public FirstNewFrame() {\n\t\tjbInit();\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.getContentPane().setBackground(Color.BLACK);\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tJButton btnNewButton = new JButton(\"Play\");\n\t\tbtnNewButton.setFont(new Font(\"Bodoni 72\", Font.BOLD, 13));\n\t\tbtnNewButton.setBounds(frame.getWidth() / 2 - 60, 195, 120, 30);\n\t\tframe.getContentPane().add(btnNewButton);\n\t\t\n\t\tJLabel lblNewLabel = new JLabel(\"Space Escape\");\n\t\tlblNewLabel.setForeground(Color.WHITE);\n\t\tlblNewLabel.setFont(new Font(\"Bodoni 72\", Font.BOLD, 24));\n\t\tlblNewLabel.setBounds(frame.getWidth() / 2 - 60, 30, 135, 25);\n\t\tframe.getContentPane().add(lblNewLabel);\n\t\t\n\t\tJLabel lblNewLabel_1 = new JLabel(\"New label\");\n\t\tlblNewLabel_1.setBounds(0, 0, frame.getWidth(), frame.getHeight());\n\t\tframe.getContentPane().add(lblNewLabel_1);\n\t}", "private void initializeFrame()\r\n\t{\r\n\t\tthis.setResizable(false);\r\n\r\n\t\tsetSize(DIMENSIONS); // set the correct dimensions\r\n\t\tsetDefaultCloseOperation(EXIT_ON_CLOSE);\r\n\t\tsetLayout( new GridLayout(1,1) );\r\n\t}", "private void setupFrame()\n\t{\n\t\tthis.setContentPane(botPanel);\n\t\tthis.setSize(800,700);\n\t\tthis.setTitle(\"- Chatbot v.2.1 -\");\n\t\tthis.setResizable(true);\n\t\tthis.setVisible(true);\n\t}", "public MainFrame() {\n initComponents();\n setLocationRelativeTo(null);\n }", "public EmulatorFrame() {\r\n\t\tsuper(\"Troyboy Chip8 Emulator\");\r\n\t\t\r\n\t\tsetNativeLAndF();\r\n\t\tinitComponents();\r\n\t\tinitMenubar();\r\n\t\tsetupLayout();\r\n\t\tinitFrame();\r\n\t\t//frame is now ready to run a game\r\n\t\t//running of any games must be started by loading a ROM\r\n\t}", "public void init()\n {\n buildUI(getContentPane());\n }", "private void initialize()\n {\n this.setTitle( \"SerialComm\" ); // Generated\n this.setSize( 500, 300 );\n this.setContentPane( getJContentPane() );\n }", "public launchFrame() {\n \n initComponents();\n \n }", "private void initialize() {\r\n\t\tthis.setSize(378, 283);\r\n\t\tthis.setJMenuBar(getMenubar());\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JAVIER\");\r\n\t}", "private void initialize() {\n\t\tthis.setSize(430, 280);\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setUndecorated(true);\n\t\tthis.setModal(true);\n\t\tthis.setBackground(new java.awt.Color(226,226,222));\n\t\tthis.setTitle(\"Datos del Invitado\");\n\t\tthis.addComponentListener(this);\n\t}", "public PilaFrame() {\n initComponents();\n }", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, 900, 900);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\n\t\tgame = new Game();\n\t\t\n\t\tGameTable puzzle = new GameTable(game.getPuzzle());\n\t\tpuzzle.setBounds(100, 100, 700, 700);\n\t\t\n\t\tframe.add(puzzle);\n\t\t\n\t\tSystem.out.println(\"SAD\");\n\t\t\n\t}", "private void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.setResizable(false);\r\n\t\tframe.setBounds(100, 100, 450, 300);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\t\r\n\t\tPanel mainFramePanel = new Panel();\r\n\t\tmainFramePanel.setBounds(10, 10, 412, 235);\r\n\t\tframe.getContentPane().add(mainFramePanel);\r\n\t\tmainFramePanel.setLayout(null);\r\n\t\t\r\n\t\tfinal TextField textField = new TextField();\r\n\t\ttextField.setBounds(165, 62, 79, 24);\r\n\t\tmainFramePanel.add(textField);\r\n\t\t\r\n\t\tButton changeTextButt = new Button(\"Change Text\");\r\n\t\tchangeTextButt.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\ttextField.setText(\"Domograf\");\r\n\t\t\t}\r\n\t\t});\r\n\t\tchangeTextButt.setBounds(165, 103, 79, 24);\r\n\t\tmainFramePanel.add(changeTextButt);\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setResizable(false);\n\t\tframe.setAlwaysOnTop(true);\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t}", "StudentFrame() {\n \tgetContentPane().setFont(new Font(\"Times New Roman\", Font.PLAIN, 11));\n s1 = null; // setting to null\n initializeComponents(); // causes frame components to be initialized\n }", "private void initialize() {\r\n\t\tthis.setSize(300, 200);\r\n\t\tthis.setTitle(\"Error\");\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t}", "public NewFrame() {\n initComponents();\n }", "public SerialCommFrame()\n {\n super();\n initialize();\n }", "public LoginFrame() {\n\t\tsuper();\n\t\tinitialize();\n\t}", "public BaseFrame() {\n initComponents();\n }", "private void initialize() {\r\n\t\tthis.setSize(733, 427);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"jProxyChecker\");\r\n\t}", "public frame() {\r\n\t\tadd(createMainPanel());\r\n\t\tsetTitle(\"Lunch Date\");\r\n\t\tsetSize(FRAME_WIDTH, FRAME_HEIGHT);\r\n\r\n\t}", "public MercadoFrame() {\n initComponents();\n }", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, 800, 800);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\n\t\tJPanel browserPanel = new JPanel();\n\t\tframe.getContentPane().add(browserPanel, BorderLayout.CENTER);\n\t\t\n\t\t// create javafx panel for browser\n browserFxPanel = new JFXPanel();\n browserPanel.add(browserFxPanel);\n \n // create JavaFX scene\n Platform.runLater(new Runnable() {\n public void run() {\n createScene();\n }\n });\n\t}", "private void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(X_FRAME, Y_FRAME, WIDTH_FRAME, HEIGHT_FRAME);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\t\r\n\t\tJButton btnAddSong = new JButton(\"Add song\");\r\n\t\tbtnAddSong.setBounds(X_BTN, Y_ADDSONG, WIDTH_BTN, HEIGHT_BTN);\r\n\t\tframe.getContentPane().add(btnAddSong);\r\n\t\t\r\n\t\tJTextPane txtpnBlancoYNegro = new JTextPane();\r\n\t\ttxtpnBlancoYNegro.setText(\"Blanco y negro\\r\\nThe Spectre\\r\\nGirasoles\\r\\nFaded\\r\\nTu Foto\\r\\nEsencial\");\r\n\t\ttxtpnBlancoYNegro.setBounds(X_TXT, Y_TXT, WIDTH_TXT, HEIGHT_TXT);\r\n\t\tframe.getContentPane().add(txtpnBlancoYNegro);\r\n\t\t\r\n\t\tJLabel lblSongs = new JLabel(\"Songs\");\r\n\t\tlblSongs.setBounds(X_LBL, Y_LBL, WIDTH_LBL, HEIGHT_LBL);\r\n\t\tframe.getContentPane().add(lblSongs);\r\n\t\t\r\n\t\tJButton btnAddAlbum = new JButton(\"Add album\");\r\n\t\tbtnAddAlbum.setBounds(X_BTN, Y_ADDALBUM, WIDTH_BTN, HEIGHT_BTN);\r\n\t\tframe.getContentPane().add(btnAddAlbum);\r\n\t}", "public holdersframe() {\n initComponents();\n }", "public void init() {\n\t\tsetSize(500,300);\n\t}", "private void setupFrame()\n\t\t{\n\t\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\tthis.setResizable(false);\n\t\t\tthis.setSize(800, 600);\n\t\t\tthis.setTitle(\"SEKA Client\");\n\t\t\tthis.setContentPane(panel);\n\t\t\tthis.setVisible(true);\n\t\t}", "public addStFrame() {\n initComponents();\n }", "public JFrame() {\n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "private void initialize() {\n\t\tframe = new JFrame(\"View Report\");\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\n\t\tJButton backButton = new JButton(\"Back\");\n\t\tbackButton.setBounds(176, 227, 89, 23);\n\t\tframe.getContentPane().add(backButton);\n\t\tbackButton.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tframe.setVisible(false);\n\t\t\t}\n\t\t});\n\t\t\n\t\tJTextArea textArea = new JTextArea();\n\t\ttextArea.setBounds(50, 30, 298, 173);\n\t\tframe.getContentPane().add(textArea);\n\t\ttextArea.append(control.seeReport());\n\t\tframe.setVisible(true);\n\t}", "private void initialize() {\r\n this.setSize(new Dimension(666, 723));\r\n this.setContentPane(getJPanel());\r\n\t\t\t\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.getContentPane().setBackground(Color.BLACK);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tJLabel lblSubmission = new JLabel(\"Submission\");\n\t\tlblSubmission.setForeground(Color.WHITE);\n\t\tlblSubmission.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 16));\n\t\tlblSubmission.setBounds(164, 40, 83, 14);\n\t\tframe.getContentPane().add(lblSubmission);\n\t\t\n\t\tJLabel lblTitle = new JLabel(\"Title:\");\n\t\tlblTitle.setForeground(Color.WHITE);\n\t\tlblTitle.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 14));\n\t\tlblTitle.setBounds(77, 117, 41, 14);\n\t\tframe.getContentPane().add(lblTitle);\n\t\t\n\t\tJLabel lblPath = new JLabel(\"Path:\");\n\t\tlblPath.setForeground(Color.WHITE);\n\t\tlblPath.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 14));\n\t\tlblPath.setBounds(85, 155, 33, 14);\n\t\tframe.getContentPane().add(lblPath);\n\t\t\n\t\ttitle = new JTextField();\n\t\ttitle.setBounds(128, 116, 197, 20);\n\t\tframe.getContentPane().add(title);\n\t\ttitle.setColumns(10);\n\t\t\n\t\tpath = new JTextField();\n\t\tpath.setBounds(128, 154, 197, 20);\n\t\tframe.getContentPane().add(path);\n\t\tpath.setColumns(10);\n\t\t\n\t\tbtnSubmit = new JButton(\"Submit\");\n\t\tbtnSubmit.setBackground(Color.BLACK);\n\t\tbtnSubmit.setForeground(Color.WHITE);\n\t\tbtnSubmit.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 14));\n\t\tbtnSubmit.setBounds(158, 210, 89, 23);\n\t\tframe.getContentPane().add(btnSubmit);\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n\t\tframe.setVisible(true);\n\t}", "public void init() {\r\n\t\t\r\n\t\tsetSize(WIDTH, HEIGHT);\r\n\t\tColor backgroundColor = new Color(60, 0, 60);\r\n\t\tsetBackground(backgroundColor);\r\n\t\tintro = new GImage(\"EvilMehranIntroGraphic.png\");\r\n\t\tintro.setLocation(0,0);\r\n\t\tadd(intro);\r\n\t\tplayMusic(new File(\"EvilMehransLairThemeMusic.wav\"));\r\n\t\tinitAnimationArray();\r\n\t\taddKeyListeners();\r\n\t\taddMouseListeners();\r\n\t\twaitForClick();\r\n\t\tbuildWorld();\r\n\t}", "public FrameIntroGUI() {\n\t\ttry {\n\t\t\tjbInit();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void initialize() {\n\t\tthis.setBounds(100, 100, 950, 740);\n\t\tthis.setLayout(null);\n\n\t\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tJLabel lblCoisa = new JLabel(\"Coisa\");\n\t\tlblCoisa.setBounds(10, 11, 46, 14);\n\t\tframe.getContentPane().add(lblCoisa);\n\t\t\n\t\ttextField = new JTextField();\n\t\ttextField.setBounds(39, 8, 86, 20);\n\t\tframe.getContentPane().add(textField);\n\t\ttextField.setColumns(10);\n\t}", "private void initialize() {\n\t\tthis.setExtendedState(Frame.MAXIMIZED_BOTH);\n\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tthis.setResizable(true);\n\t\tthis.screenDimensions = Toolkit.getDefaultToolkit().getScreenSize();\n\t\tthis.getContentPane().setLayout(new BorderLayout());\n\t\t// Initialize SubComponents and GUI Commands\n\t\tthis.initializeSplitPane();\n\t\tthis.initializeExplorer();\n\t\tthis.initializeConsole();\n\t\tthis.initializeMenuBar();\n\t\tthis.pack();\n\t\tthis.hydraExplorer.refreshExplorer();\n\t}" ]
[ "0.77704835", "0.75652915", "0.7442664", "0.7369101", "0.7366378", "0.7358479", "0.73146075", "0.73096764", "0.72987294", "0.72978777", "0.7278321", "0.72729623", "0.7269468", "0.7269468", "0.7215727", "0.7180792", "0.71682984", "0.7140954", "0.7140953", "0.7126852", "0.7107974", "0.7100368", "0.7092515", "0.708178", "0.70652425", "0.70630395", "0.70621413", "0.7060283", "0.70517516", "0.7043992", "0.6996167", "0.6978269", "0.6971387", "0.6956391", "0.6938475", "0.6929829", "0.6929629", "0.69251114", "0.6921989", "0.6920365", "0.6914633", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.69020075", "0.68911743", "0.6886017", "0.6873457", "0.6870402", "0.68686837", "0.68669385", "0.686311", "0.68616706", "0.68552315", "0.68537515", "0.681551", "0.68141145", "0.68094325", "0.67992085", "0.67930394", "0.6782133", "0.6765297", "0.6748138", "0.6731745", "0.6716807", "0.6711878", "0.6706194", "0.6697453", "0.6692831", "0.66927665", "0.6689213", "0.66724384", "0.66606426", "0.664954", "0.6642464", "0.6640775", "0.6638488", "0.663824", "0.663545", "0.66264987", "0.6625419", "0.6611392", "0.6608291", "0.6600817", "0.66005784", "0.6591052", "0.65869486", "0.65862876", "0.65753394", "0.6575285", "0.6570335", "0.655961" ]
0.0
-1
Constructor Read All Data
public Cursor readAllData() { Cursor objCursor = readSQLite.query(TABLE_OFFICER, new String[]{COLUMN_ID_OFFICER, COLUMN_OFFICER, COLUMN_POSITION, COLUMN_IMAGE, COLUMN_VIDEO, COLUMN_SOUND}, null, null, null, null, null); if (objCursor != null) { objCursor.moveToFirst(); } return objCursor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Data() {}", "public InitialData(){}", "public Data() {\n }", "public Data() {\n }", "public mainData() {\n }", "public Data() {\n \n }", "public DatasetReader()\n\t{\n\t\treviews = new ArrayList<Review>();\n\t\tratings = new HashMap<Double,List<Double>>();\n\t\tproducts = new HashMap<String, Map<String,Double>>();\n\t\tproductRatings = new HashMap<String, List<Double>>();\n\t\treInstanceList = new ArrayList<ReviewInstance>();\n\t\treInstanceMap = new HashMap<String, ReviewInstance>();\n\t}", "private void initData() {\n\t}", "private void initData() {\n }", "private void initData() {\n\n }", "protected @Override\r\n abstract void initData();", "public void initData() {\n }", "public void initData() {\n }", "Data() {\n\t\t// dia = 01;\n\t\t// mes = 01;\n\t\t// ano = 1970;\n\t\tthis(1, 1, 1970); // usar um construtor dentro de outro\n\t}", "public DataParser() throws IOException {\n cem = loadCEM();\n summits = readSummitsFrom(new File(\"alps.txt\"));\n }", "private RandomData() {\n initFields();\n }", "@Override\n\tpublic void initData() {\n\n\n\n\t}", "public void initData() {\n\t\tnotes = new ArrayList<>();\n\t\t//place to read notes e.g from file\n\t}", "@Override\n\tpublic void initData() {\n\t\t\n\t}", "public SensorData() {\n\n\t}", "public Reader(){\n\n\t}", "@Override\n\tpublic void initData() {\n\n\t}", "@Override\n\tpublic void initData() {\n\n\t}", "@Override\n\tpublic void initData() {\n\n\t}", "public void init()\r\n {\n readFile(inputFile);\r\n writeInfoFile();\r\n }", "public DataRepository() throws IOException {\n\t\tthis.init();\n\t}", "@Override\n\tpublic void readData() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "public DesastreData() { //\r\n\t}", "@Override\n protected void initData() {\n }", "@Override\n protected void initData() {\n }", "public MsxReader ( ) {\r\n\t\tsuper();\r\n\t}", "private void initData(){\n\n }", "public Tass4Reader ( ) {\r\n\t\tsuper();\r\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\r\n\tpublic void initData() {\n\t}", "public WorkDataFile()\n\t{\n\t\tsuper();\n\t}", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "public StringData1() {\n }", "private TextReader() {\n // There are no fields required to initialize\n }", "public DataRecord() {\n super(DataTable.DATA);\n }", "abstract void initializeNeededData();", "private void InitData() {\n\t}", "private TigerData() {\n initFields();\n }", "public JsonDataset() {\r\n\t\tsuper();\r\n\t\tlogger.trace(\"JsonDataset() - start\");\r\n\t\tlogger.trace(\"JsonDataset() - end\");\r\n\t}", "@Override\n\tprotected void initData(){\n\t\tsuper.initData();\n\t}", "public Record() {\n data = new int[DatabaseManager.fieldNames.length];\n }", "void initData(){\n }", "protected void readConstructorParams( DataInput in ) throws\n\t\t\t\t\t\t\tIOException {\n }", "public TradeData() {\r\n\r\n\t}", "@Override\n\t\tvoid loadData() throws IOException {\n\t\t\tsuper.loadData();\n\t\t}", "Read createRead();", "public ArticleData() {\r\n\t\tid = Constants.EMPTY_STRING;\r\n\t\tname = Constants.EMPTY_STRING;\r\n\t\turl = Constants.EMPTY_STRING;\r\n\t\tdesc = Constants.EMPTY_STRING;\r\n\t\tlevels = Constants.EMPTY_STRING;\r\n\t\twebSiteId = Constants.EMPTY_STRING;\r\n\t\tmatched = Constants.EMPTY_STRING;\r\n\t\tcreateBy = Constants.EMPTY_STRING;\r\n\t\tcreateDate = Constants.EMPTY_STRING;\r\n\t\tlastUpdateBy = Constants.EMPTY_STRING;\r\n\t\tlastUpdateDate = Constants.EMPTY_STRING;\r\n\t\tenabled = Constants.EMPTY_STRING;\r\n\t\tpostTableName = Constants.EMPTY_STRING;\r\n\t\treturnPage = Constants.EMPTY_STRING;\r\n\t\twebSiteShowName = Constants.EMPTY_STRING;\r\n\t\treturnDirect = Constants.EMPTY_STRING;\r\n\t\tkeyWordTableName = Constants.EMPTY_STRING;\r\n\t\ttitle = Constants.EMPTY_STRING;\r\n\t\ttitleCounter = Constants.EMPTY_STRING;\r\n\t\tbufferStartCounter = Constants.EMPTY_STRING;\r\n\t\tbufferEndCounter = Constants.EMPTY_STRING;\r\n\t\tcatId = Constants.EMPTY_STRING;\r\n\t\tpostUrl = Constants.EMPTY_STRING;\r\n\t}", "public static void init() {\n\t\tList<Object> objects = FileManager.readObjectFromFile(\"student.dat\");\n\t\tfor (Object o : objects)\n\t\t\tStudentList.add((Student) o);\n\t}", "public void initData(){\r\n \r\n }", "public Data() {\n initComponents();\n koneksi_db();\n tampil_data();\n }", "public CreateData() {\n\t\t\n\t\t// TODO Auto-generated constructor stub\n\t}", "public Data(Main aMain, Framework frw) {\n\tmain = aMain;\n\n File pf = new File(main.myPath);\n String[] datal = pf.list(new FilenameFilter() {\n public boolean accept(File dir, String name) {\n return\n name.endsWith(\".xml\") &&\n name.startsWith(\"data\");\n }\n });\n for (int i = 0; i < datal.length; i++) {\n Document data = Framework.parse(main.myPath + datal[i], \"encounters\");\n loadFromDoc(data);\n }\n }", "public DataSet() {\n labels = new HashMap<>();\n locations = new HashMap<>();\n counter= new AtomicInteger(0);\n }", "protected void loadData()\n {\n }", "@Override\n\tprotected void initdata() {\n\n\t}", "public SensorReader() {\n\t\tinit();\n\t}", "public void init(BinaryDataReader dataReader) throws IOException\n\t{\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\n\tpublic void init(String file_name) { deserialize(file_name); }", "DataHRecordData() {}", "public Datos(){\n }", "public Data (String name, int type) {\n\t\tthis.name = name;\n\t\tthis.type = type;\n\t\tstream = new MyReader();\n\t}", "private Data initialise() {\n \r\n getRoomsData();\r\n getMeetingTimesData();\r\n setLabMeetingTimes();\r\n getInstructorsData();\r\n getCoursesData();\r\n getDepartmentsData();\r\n getInstructorFixData();\r\n \r\n for (int i=0;i<departments.size(); i++){\r\n numberOfClasses += departments.get(i).getCourses().size();\r\n }\r\n return this;\r\n }", "public Data() {\n initComponents();\n getData();\n }", "public Data(byte[] bytes) {\r\n try {\r\n this.read_data_header(bytes);\r\n } catch (IOException e) {\r\n System.out.println(e.getMessage());\r\n }\r\n }", "public void InitData() {\n }", "public StringDataList() {\n }", "public Data() {\n this.customers = new HashMap<>();\n this.orders = new HashMap<>();\n this.siteVisits = new HashMap<>();\n this.imageUploads = new HashMap<>();\n }", "public Data() {\n\t\tif (flag == 0) {\n\t\t\tflag = 1;\n\t\t\tfloat def = 0;\n\t\t\tfor (int i = 0; i < 4; i++) {\n\n\t\t\t\tlocation.add(def);\n\t\t\t\tstate.add(0);\n\t\t\t\tboardsize.add(0);\n\n\t\t\t\tsystemid.add(\"\");\n\t\t\t\ttime.add(0);\n\t\t\t\tname.add(\"\");\n\t\t\t}\n\n\t\t\tball.add(def);\n\t\t\tball.add(def);\n\n\t\t\tballsize = 0;\n\t\t}\n\t}", "public void initializeData() {\n _currentDataAll = _purityReportData.getAll();\n }", "public ListingData() {\r\n\t\tsuper();\r\n\t}", "public Id5320DataFile()\n\t{\n\t\tlineLength = OFF_CUSTOMER_NAME + LEN_CUSTOMER_NAME;\n\t}", "private RowData() {\n initFields();\n }", "public StringData() {\n\n }", "public Data()\n {\n //initialize the queues\n for (int i=0;i<10;i++)\n data[i] = new LinkedList<String >();\n }", "public StreamData(String name)\n {\n _data = new LinkedList<byte[]>();\n this.Name = name;\n this.Length = 0;\n }", "public void readParameters()\n {\n readParameters(getData());\n }", "private void readFields() throws IOException, ClassFormatException {\n final int fields_count = dataInputStream.readUnsignedShort();\n fields = new Field[fields_count];\n for (int i = 0; i < fields_count; i++) {\n fields[i] = new Field(dataInputStream, constant_pool);\n }\n }", "public DataManage() {\r\n\t\tsuper();\r\n\t}", "public NetworkData() {\n }", "public Constructor(){\n\t\t\n\t}", "public DataInputClientProperties() throws IOException {\n this(null);\n }", "@Override\n public void construct() throws IOException {\n \n }", "public StreamReader() {}", "private CustomerReader()\r\n\t{\r\n\t}", "private void initData() {\n\t\tnamesInfo = new NameSurferDataBase(fileName);\n\n\t}", "private RawGltfDataReader() {\n // Private constructor to prevent instantiation\n }", "public DataInt() {\n }" ]
[ "0.6943403", "0.67737144", "0.67569536", "0.67569536", "0.6727562", "0.66795313", "0.6572503", "0.65443224", "0.65333205", "0.65128505", "0.6496244", "0.64855164", "0.64855164", "0.6471371", "0.6437841", "0.6435638", "0.64280987", "0.64067614", "0.6393235", "0.6392273", "0.63796157", "0.6375267", "0.6375267", "0.6375267", "0.6370751", "0.63569474", "0.6353113", "0.63520026", "0.63520026", "0.63520026", "0.63520026", "0.63520026", "0.63520026", "0.6348946", "0.63302535", "0.63302535", "0.6326489", "0.63244", "0.63211954", "0.6316325", "0.6316325", "0.63133425", "0.63089144", "0.62989223", "0.62801635", "0.6259487", "0.62354594", "0.6207778", "0.62031806", "0.61950773", "0.6186231", "0.618433", "0.6181738", "0.6181082", "0.61718273", "0.6169553", "0.6166559", "0.61404127", "0.6138556", "0.6134", "0.6121956", "0.6119399", "0.6113248", "0.6105826", "0.6101331", "0.6092898", "0.60897297", "0.60831743", "0.6076913", "0.6070959", "0.60694844", "0.6066374", "0.6063596", "0.6058644", "0.60563004", "0.60561436", "0.6047701", "0.603437", "0.6024908", "0.6022257", "0.60131216", "0.6012803", "0.60082954", "0.6007964", "0.600134", "0.59994626", "0.59861815", "0.5979776", "0.59752405", "0.5968577", "0.5966834", "0.5964873", "0.59600264", "0.59562033", "0.595477", "0.5950548", "0.5949519", "0.59460986", "0.5944139", "0.5942254", "0.594209" ]
0.0
-1
Given a string, compute the relative frequency of each letter in that string.
private static HashMap<String, Double> ComputeRelativeFrequencyLetters(String text) { long length = text.length(); HashMap<String, Integer> freqMap = new HashMap<String, Integer>(); //Search through the string and count each character. for (int i = 0; i < length; i++) { char character = text.charAt(i); if ((character >= 'A' && character <= 'Z')) { int freq; //If we haven't seen this character yet, frequency is 1, otherwise, increment it. if (freqMap.get(Character.toString(character)) == null) { freq = 1; } else { freq = freqMap.get(Character.toString(character)) + 1; } freqMap.put(Character.toString(character), freq); } } HashMap<String, Double> relativeFreqMap = new HashMap<String, Double>(); long totalFreq = 0; //Find total frequency by adding all frequencies together. for (Entry<String, Integer> entry : freqMap.entrySet()) { totalFreq += entry.getValue(); } //Find relative frequency of all letters. for (Entry<String, Integer> entry : freqMap.entrySet()) { double relativeFreq = (double)entry.getValue() / (double)totalFreq; relativeFreqMap.put(entry.getKey(), relativeFreq); } return relativeFreqMap; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int[] buildFrequencyTable(String s)\n{\n int[] table = new int [Character.getNumericValue('z') - Character.getNumericValue('a') + 1];\n for (char c : s.toCharArray())\n {\n int x = getCharNumber(c);\n if (x != -1) table[x]++;\n }\n return table;\n}", "@Override //old methd for letter count\n public Integer letterCount(String inputString) {\n char[] characterArray = inputString.toCharArray();\n Map<Character, Integer> wordFrequencyMap = new HashMap<Character, Integer>();\n\n for (char character : characterArray) {\n if (wordFrequencyMap.containsKey(character)) {\n\n Integer wordCount = (Integer) wordFrequencyMap.get(character);\n wordFrequencyMap.put(character, wordCount + 1);\n\n } else {\n wordFrequencyMap.put(character, 1);\n\n }\n }\n return null; //iterateWordCount(wordFrequencyMap);\n }", "private Map<Character, Double> getStrFrequencyTable(String str) {\n str = str.toLowerCase(Locale.ENGLISH);\n\n Map<Character, Double> frequencyTable = new HashMap<>(26);\n int[] countArr = countLetters(str);\n int numOfLetters = Arrays.stream(countArr).sum();\n\n for (char alphabet = 'a'; alphabet <= 'z'; alphabet++) {\n double frequency = 0.0;\n if (numOfLetters != 0) {\n frequency = countArr[alphabet-'a'] / (double) numOfLetters;\n }\n frequencyTable.put(alphabet, frequency);\n }\n\n return frequencyTable;\n }", "public static Map<Character,Integer> countFreq(String string){\n\n\n\n Map<Character,Integer> results = new HashMap<Character,Integer>();\n for (int i = 0; i < string.length(); i++) {\n Character temp = string.charAt(i);\n Integer count;\n// System.out.println(temp);\n if (results.containsKey(temp)){\n count=results.get(temp);\n count++;\n results.replace(temp,count);\n }\n else\n results.put(temp,1);\n\n }\n\n return results;\n }", "public static int frequency(String str, char ch){\n//will return frequency of char from the string\n int count = 0; //to save the frequency of char\n/*each character is a char : and need to compare it with str.\nevery time it matches we add frequency to count*/\n\n for(char each : str.toCharArray() ){\n if(each == ch){//every time this is true, count will increase to 1\n count++;\n }\n }\n //return the frequency of one character from the string\n return count;\n }", "private Map<Character, Integer> getFreqs(String input) {\n\t\tMap<Character, Integer> freqMap = new HashMap<>();\n\t\tfor (char c : input.toCharArray()) {\n\t\t\tif (freqMap.containsKey(c)) {\n\t\t\t\tfreqMap.put(c, freqMap.get(c) + 1);\n\t\t\t} else {\n\t\t\t\tfreqMap.put(c, 1);\n\t\t\t}\n\t\t}\n\t\treturn freqMap;\n\t}", "public int fs(String s) {\n char min = 'z', current;\n int frequency = 0;\n for (int i = 0; i < s.length(); i++){\n current = s.charAt(i);\n if (current < min) {\n min = current;\n frequency = 1;\n } else if (current == min) frequency++;\n }\n return frequency;\n }", "public void countOfLetters()\n {\n Scanner sc = new Scanner(System.in);\n //Ask an user to enter a string\n System.out.print(\"Enter a string: \");\n //Read next line as string and assign it value to String str\n String str = sc.nextLine();\n\n //Create a new int array with 26 elements\n int []Letters = new int[26];\n\n //For each index in str\n for(int i = 0; i < str.length(); i++)\n {\n //Get current character\n char c = str.toLowerCase().charAt(i);\n //Get char as int\n int val = (int)c;\n //If char is letter\n if(val >= 97 && val <= 122)\n {\n //Increment a value at position of this letter\n Letters[c-'a']++;\n }\n }\n //Get sum of the array\n int Sum = Arrays.stream(Letters).sum();\n //For each index in Letters\n for(int i = 0; i<Letters.length; i++)\n {\n //If value of current position > 0 then print count of this letter at given string and its percentage\n if(Letters[i] > 0)\n {\n System.out.printf(\"The count of `%c` is %x, the percentage is %f \\n\", (char)97+i, Letters[i], (double)Letters[i]/Sum);\n }\n }\n\n }", "private static HashMap<String, Double> ComputeRelativeFrequencyDigraphs(String text) {\n\tlong length = text.length();\n\n\t//We need at least 2 characters.\n\tif (length <= 1) {\n\t return new HashMap<String, Double>();\n\t}\n\n\tHashMap<String, Integer> freqMap = new HashMap<String, Integer>();\n\n\t//Look at this character, and the next one to determine digraphs.\n\tfor (int i = 0; i < length - 1; i++) {\n\t char character1 = text.charAt(i);\n\t char character2 = text.charAt(i+1);\n\n\t if (((character1 >= 'A' && character1 <= 'Z')) &&\n\t\t((character2 >= 'A' && character2 <= 'Z')))\n\t {\n\t\tint freq;\n\t\t//If we haven't seen this combination yet, add it with a frequency of 1.\n\t\tif (freqMap.get(\"\" + character1 + character2) == null) {\n\t\t freq = 1;\n\t\t}\n\t\telse {\n\t\t freq = freqMap.get(\"\" + character1 + character2) + 1;\n\t\t}\n\t\t\n\t\tfreqMap.put((\"\" + character1 + character2), freq);\n\t }\n\t}\n\n\tHashMap<String, Double> relativeFreqMap = new HashMap<String, Double>();\n\tlong totalFreq = 0;\n\n\t//Find total frequency by adding all frequencies together.\n\tfor (Entry<String, Integer> entry : freqMap.entrySet()) {\n\t totalFreq += entry.getValue();\n\t}\n\n\t//Find relative frequency of all letters.\n\tfor (Entry<String, Integer> entry : freqMap.entrySet()) {\n\t double relativeFreq = (double)entry.getValue() / (double)totalFreq;\n\t relativeFreqMap.put(entry.getKey(), relativeFreq);\n\t}\n\n\treturn relativeFreqMap;\n }", "public String frequencySort(String s) {\n\n\t\t// prepare a frequency map\n\t\tMap<Character, Integer> m = new HashMap<Character, Integer>();\n\t\tfor (char c : s.toCharArray())\n\t\t\tm.put(c, m.getOrDefault(c, 0) + 1);\n\n\t\tPriorityQueue<CKEntry1> pq = new PriorityQueue<>();\n\t\tfor (Entry<Character, Integer> e : m.entrySet()) {\n\t\t\tpq.add(new CKEntry1(e.getKey(), e.getValue()));\n\t\t}\n\t\t\n\t\t// prepare the output now\n\t\tStringBuilder sb = new StringBuilder();\n\t\twhile(!pq.isEmpty()) {\n\t\t\tCKEntry1 temp = pq.poll();\n\t\t\tchar[] tempC = new char[temp.count];\n\t\t\tArrays.fill(tempC, temp.c); // repeat c count' times\n\t\t\tsb.append(tempC);\n\t\t}\n\t\t\n\t\treturn sb.toString();\n\n\t}", "public static String compute(String input) {\n if (input == null || input.length() == 0) {\n return \"\";\n }\n String x = input.toLowerCase();\n int[] memo = new int[256];\n for (int i = 0; i < x.length(); i++) {\n if ('a' <= x.charAt(i) && x.charAt(i) <= 'z') {\n memo[x.charAt(i)]++;\n }\n }\n List<Integer> list = new ArrayList<>();\n for (int i = 0; i < 256; i++) {\n if (memo[i] != 0) {\n list.add(memo[i]);\n }\n }\n Collections.sort(list, (a, b) -> b - a);\n long res = 0;\n int count = 26;\n for (int i : list) {\n res += i * count--;\n }\n return String.valueOf(res);\n }", "public int doCount(String s){\r\n\t\tint count = 0;\r\n\t\tint i;\r\n\t\tfor(i = 0; i < s.length(); i++){\r\n\t\t\tif ( s.charAt(i) == Letter )\r\n\t\t\t\tcount++;\r\n\t\t}\r\n\t\t\r\n\t\treturn count;\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\tString str=\"aabcccccaaaa\";\n\t\tString str2=\"\";\n\t\tint freq=1;\n\t\tfor(int i=0;i<str.length()-1;i++){\n\t\t\tif(str.charAt(i)==str.charAt(i+1)){\n\t\t\t\tfreq++;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstr2=str2+str.charAt(i)+freq;\n\t\t\t\tfreq=1;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(str2+str.charAt(str.length()-1)+freq);\n\t}", "public static void getOccuringChar(String inPutString) {\n HashMap<Character, Integer> charCountMap = new HashMap<Character, Integer>();\n /* converting given string to char Array*/\n char[] strArray = inPutString.toCharArray();\n /*Checking each char in strArray*/\n for (char c : strArray) {\n if (charCountMap.containsKey(c)) {\n //If char 'c' is present in charCountMap, incrementing it's count by 1\n charCountMap.put(c, charCountMap.get(c) + 1);\n } else {\n /*If char 'c' is not present in charCountMap,putting 'c' into charCountMap with 1 as it's value\n */\n charCountMap.put(c, 1);\n }\n }\n /*Printing input String*/\n System.out.println(\"The frequency of Character is \" + charCountMap);\n }", "public static int howManyLetters (String s)\n {\n if (s.length()==0) //stop condition - the end case, if the string is empty\n return 0;\n int isc=( s.charAt(s.length()-1)>='a'&&s.charAt(s.length()-1)<='z'||\n s.charAt(s.length()-1)>='A'&& s.charAt(s.length()-1)<='Z')? 1: 0; //checks whether the current character is a letter\n return isc+howManyLetters(s.substring(0,s.length()-1)); //return the amount of letters (by re-call the method again)\n }", "static int sherlockAndAnagrams(String s) {\n int total = 0;\n for (int width = 1; width <= s.length() - 1; width++) {\n\n for(int k = 0 ;k <= s.length() - width; k++){\n\n String sub = s.substring(k, k + width);\n\n int[] subFreq = frequenciesOf(sub);\n for (int j = k + 1; j <= s.length() - width; j++) {\n String target = s.substring(j, j + width);\n if (areAnagrams(subFreq,frequenciesOf(target))) total = total + 1;\n }\n }\n }\n return total;\n }", "@Override\n\tpublic int hash(String str) {\n\t\tint result = 0;\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\tint temp = (int) str.charAt(i);\n\t\t\tresult += (temp * (Math.pow(37, i)));\n\t\t}\n\t\treturn result;\n\t}", "private static String frequencySort(String s) {\n if (s == null || s.isEmpty()) { return s; }\n\n int[] freq = new int[256];\n for (char c : s.toCharArray()) {\n freq[c]++;\n }\n\n PriorityQueue<Pair<Character, Integer>> pq = new PriorityQueue<>((a, b) -> b.getValue() - a.getValue());\n for (int i = 0; i < freq.length; i++) {\n if (freq[i] == 0) { continue; }\n Pair<Character, Integer> pair = new Pair<>((char) (i), freq[i]);\n pq.offer(pair);\n }\n\n StringBuilder sb = new StringBuilder();\n while (!pq.isEmpty()) {\n Pair<Character, Integer> pair = pq.poll();\n for (int i = 0; i < pair.getValue(); i++) {\n sb.append(pair.getKey());\n }\n }\n return sb.toString();\n }", "static int theLoveLetterMystery(String s){\n \n int i=0, j = s.length()-1;\n int count =0;\n if(s.length() == 0 || s == null)\n return count;\n while(i<j)\n {\n if(s.charAt(i) == s.charAt(j))\n {\n i++;\n j--;\n continue;\n }\n \n else\n count = count + Math.abs((int)(s.charAt(i) - s.charAt(j)));\n \n i++;\n j--;\n }\n return count;\n }", "static int countCharacters(String[] words, String chars) {\n int ans = 0;\n int[] letters = new int[26];\n char[] arr = chars.toCharArray();\n for (char a : arr) {\n letters[a-'a']++;\n }\n for (String s : words) {\n char[] charArray = s.toCharArray();\n int[] temp = new int[26];\n int i = 0;\n for (;i<charArray.length;i++) {\n if (letters[charArray[i]-'a'] > 0) {\n letters[charArray[i]-'a']--;\n temp[charArray[i]-'a']++;\n } else {\n break;\n }\n }\n if (i == charArray.length) {\n ans += s.length();\n }\n i=0;\n for (;i<temp.length;i++) {\n letters[i] += temp[i];\n }\n }\n return ans;\n }", "public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n System.out.println(\"Enter a word:\");\n String word = scan.next();\n System.out.println(\"Enter character:\");\n char character = scan.next().charAt(0);\n\n int count=0; //count frequency of character\n for (int i =0; i<word.length(); i++) {\n char each = word.charAt(i); //each character by given string word\n\n if (each == character) { //if each character in str is matching with ch\n count++; //count increase the frequency of ch by 1\n\n }\n }\n System.out.println(count);\n\n System.out.println(\"===========================\");\n\n\n\n }", "public static char getMaxFreq(String str){\n HashMap<Character,Integer> map=new HashMap<>();\n for(int i=0;i<str.length();i++){\n char cc=str.charAt(i);\n if(map.containsKey(cc)){\n int oldValue=map.get(cc);\n int newValue=oldValue+1;\n map.put(cc,newValue);\n }else{\n map.put(cc,1);\n }\n }\n char maxChar='\\0';\n int max=0;\n Set<Map.Entry<Character,Integer>> entries=map.entrySet();\n for(Map.Entry<Character,Integer> entry:entries){\n if(entry.getValue()>max){\n max=entry.getValue();\n maxChar=entry.getKey();\n }\n }\n return maxChar;\n }", "public static int eCounter (String string) {\r\n int count = 0;\r\n \r\n if (string.length() == 0) {\r\n return count;\r\n }\r\n \r\n if (string.substring(0,1).equalsIgnoreCase(\"e\")) {\r\n count = 1 + eCounter(string.substring(1));\r\n return count;\r\n }\r\n \r\n count = eCounter(string.substring(1));\r\n return count;\r\n }", "int[] countLetters(String str) {\n int[] countArr = new int['z'-'a'+1];\n Arrays.fill(countArr, 0);\n\n for (int i = 0; i < str.length(); ++i) {\n char c = str.charAt(i);\n if (!Character.isLetter(c)) {\n continue;\n }\n\n if (c >= 'a' && c <= 'z') {\n countArr[c - 'a']++;\n }\n }\n\n return countArr;\n }", "public static void main(String[] args) {\n String res= freqAlphabets( \"10#11#12\");\n System.out.println(res);\n }", "public int getScrabbleScore(String string) {\n\t\t\n\t\t//Create a hashmap of each letter and its corresponding score value\n\t\t\n\t\tHashMap<Character, Integer> lettersAndScores = new HashMap<Character, Integer>(26);\n\t\tlettersAndScores.put('A', 1);\n\t\tlettersAndScores.put('E', 1);\n\t\tlettersAndScores.put('I', 1);\n\t\tlettersAndScores.put('O', 1);\n\t\tlettersAndScores.put('U', 1);\n\t\tlettersAndScores.put('L', 1);\n\t\tlettersAndScores.put('N', 1);\n\t\tlettersAndScores.put('R', 1);\n\t\tlettersAndScores.put('S', 1);\n\t\tlettersAndScores.put('T', 1);\n\t\tlettersAndScores.put('D', 2);\n\t\tlettersAndScores.put('G', 2);\n\t\tlettersAndScores.put('B', 3);\n\t\tlettersAndScores.put('C', 3);\n\t\tlettersAndScores.put('M', 3);\n\t\tlettersAndScores.put('P', 3);\n\t\tlettersAndScores.put('F', 4);\n\t\tlettersAndScores.put('H', 4);\n\t\tlettersAndScores.put('V', 4);\n\t\tlettersAndScores.put('W', 4);\n\t\tlettersAndScores.put('Y', 4);\n\t\tlettersAndScores.put('K', 5);\n\t\tlettersAndScores.put('J', 8);\n\t\tlettersAndScores.put('X', 8);\n\t\tlettersAndScores.put('Q', 10);\n\t\tlettersAndScores.put('Z', 10);\n\t\t\n\t\t//Insert the characters of the string into the hashmap to get the corresponding values\n\t\t//Add the values to a score variable to then return\n\t\t\n\t\tint score = 0;\n\t\tfor(int i=0; i<string.length(); i++) {\n\t\t\tscore += lettersAndScores.get(Character.toUpperCase(string.charAt(i)));\n\t\t}\n\t\treturn score;\n\t}", "public static double computeIC(String userInput) {\n int i;\n // Convert string to uppercase\n userInput = userInput.toUpperCase();\n double sum = 0.0;\n\n // Length of the array, WITHOUT counting the blankspace\n int n = 0;\n\n //initialize array of values to count frequency of each letter\n \tint[] count = new int[26];\n \tfor (i = 0; i < 26; i++){\n \t\tcount[i] = 0;\n \t}\n\n int letter;\n\n for (i = 0; i < userInput.length(); i++) {\n letter = userInput.charAt(i) - 65;\n\n // If charAt(i) is between A and Z then increase count of that letter\n if (letter >= 0 && letter < 26) {\n count[letter]++;\n n++;\n }\n }\n\n /* By defeinition, Index of Coincidence is calculated by the summation of \n each of the letter count(s) */\n for (i = 0; i < 26; i++) {\n letter = count[i];\n sum = sum + (letter * (letter-1));\n }\n\n double total = sum/(n*(n-1));\n\n return total;\n }", "private void RecalculateCharDistribution() {\r\n\t\tMap<Character, Integer> temp = new HashMap<>();\r\n\t\tfor (String s : sameWordLength) {\r\n\t\t\tfor (int i = 0; i < s.length(); i++) {\r\n\r\n\t\t\t\tchar ch = s.charAt(i);\r\n\t\t\t\tif (guessedCharacter.contains(ch)) {\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (!temp.containsKey(ch)) {\r\n\t\t\t\t\t\ttemp.put(ch, 1);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tint t = temp.get(ch) + 1;\r\n\t\t\t\t\t\ttemp.put(ch, t);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcharCount = temp;\r\n\r\n\t}", "private static void charCount(String str) {\n\t\t\n\t\tHashMap<Character, Integer> mp = new HashMap<Character, Integer>();\n\t\t\n\t\tchar[] cr=str.toCharArray();\n\t\t\n\t\tSystem.out.println(cr);\n\t\t\n\t\tfor(char c: cr) {\n\t\t\t\n\t\t\tif(mp.containsKey(c)) {\n\t\t\t\tmp.put(c, mp.get(c)+1);\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\tmp.put(c, 1);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(Map.Entry<Character, Integer> ent: mp.entrySet()) {\n\t\t\tSystem.out.println(ent.getKey() + \" \" + ent.getValue());\n\t\t}\n\t\t\n\t}", "void countCharByCategory(String inputstr) {\n\n\t\tint digitcount = 0;\n\t\tint lowercasecount = 0;\n\t\tint uppercasecount = 0;\n\t\tint specialcharcount = 0;\n\n\t\tfor (int i = 0; i < inputstr.length(); i++) {\n\n\t\t\tif (Character.isLowerCase(inputstr.charAt(i)))\n\t\t\t\tlowercasecount++;\n\t\t\telse if (Character.isUpperCase(inputstr.charAt(i)))\n\t\t\t\tuppercasecount++;\n\n\t\t\telse if (Character.isDigit(inputstr.charAt(i)))\n\t\t\t\tdigitcount++;\n\t\t\telse\n\t\t\t\tspecialcharcount++;\n\t\t}\n\t\tSystem.out.println(\"Total Digits: \" + digitcount + \"\\nTotal letters: \" + (lowercasecount+uppercasecount) + \"\\nTotal Uppercase: \"\n\t\t\t\t+ uppercasecount + \"\\nTotal lowercase: \" + lowercasecount + \"\\nTotal Special character: \"\n\t\t\t\t+ specialcharcount);\n\n\t}", "public Map<String, Integer> wordCount(String string) {\n\t\t// TODO Write an implementation for this method declaration\n\t\tString foundword = \"\";\n\t\tstring = string.replaceAll(\"\\n\",\"\");\n\t\tMap<String, Integer> WordCountMap = new HashMap<>();\n\t\tList<String> stringList = new ArrayList<String>();\n\t\tfor(int i = 0; i < string.length(); i++) {\n\t\t\t//System.out.println(string.charAt(i));\n\t\t\t\n\t\t\tif(string.charAt(i) == ' ') {\n\t\t\t\tstringList.add(foundword);\n\t\t\t\tfoundword = \"\";\n\t\t\t}\n\t\t\telse if(string.charAt(i) == ',') {\n\t\t\t\tstringList.add(foundword);\n\t\t\t\tfoundword = \"\";\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\tfoundword = foundword + string.charAt(i);\n\t\t\t}\n\n\t\t}\n\t\t\n\t\tstringList.add(foundword);\n\t\t\n\t\tfor(String name: stringList) {\n\t\t\tif(WordCountMap.containsKey(name)) {\n\t\t\t\t//The frequencyMap already contains the count for this name;\n\t\t\t\t//So we want to increase that count by 1\n\t\t\t\tint currentCount = WordCountMap.get(name);\n\t\t\t\tWordCountMap.put(name, currentCount+1);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tWordCountMap.put(name, 1); //Track the name with a count of 1 if we haven't seen it before\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\treturn WordCountMap;\n\t}", "public static int count(String str, char a) {\r\n\t\tint counter = 0;\r\n\t\tchar b = ' ';\r\n\t\tfor (int i = 0; i < str.length(); i++) {\r\n\t\t\tb = str.toLowerCase().charAt(i);\t// string prebaciti u mala slova\r\n\t\t\tif (b == a) {\r\n\t\t\t\tcounter++;\t\t\t// brojac ponavljanja karaktera\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn counter;\r\n\t}", "static int sherlockAndAnagrams(String s){\n // Complete this function\n ArrayList<String> substringArray = new ArrayList<>();\n for(int i=0;i<s.length();i++){\n for(int j=i+1;j<s.length()+1;j++){\n substringArray.add(s.substring(i,j));\n }\n }\n int count = countAnagrams(substringArray);\n return count;\n }", "public int getScrabbleScore(String string) {\n\t\t// TODO Write an implementation for this method declaration\n\t\tHashtable<Character, Integer> letterBank = new Hashtable<Character, Integer>();\n\t\tletterBank.put('A', 1);\n\t\tletterBank.put('B', 3);\n\t\tletterBank.put('C', 3);\n\t\tletterBank.put('D', 2);\n\t\tletterBank.put('E', 1);\n\t\tletterBank.put('F', 4);\n\t\tletterBank.put('G', 2);\n\t\tletterBank.put('H', 4);\n\t\tletterBank.put('I', 1);\n\t\tletterBank.put('J', 8);\n\t\tletterBank.put('K', 5);\n\t\tletterBank.put('L', 1);\n\t\tletterBank.put('M', 3);\n\t\tletterBank.put('N', 1);\n\t\tletterBank.put('O', 1);\n\t\tletterBank.put('P', 3);\n\t\tletterBank.put('Q', 10);\n\t\tletterBank.put('R', 1);\n\t\tletterBank.put('S', 1);\n\t\tletterBank.put('T', 1);\n\t\tletterBank.put('U', 1);\n\t\tletterBank.put('V', 4);\n\t\tletterBank.put('W', 4);\n\t\tletterBank.put('X', 8);\n\t\tletterBank.put('Y', 4);\n\t\tletterBank.put('Z', 10);\n\t\tint score = 0;\n\t\tchar upperCase;\n\t\tfor(int i =0; i < string.length(); i++) {\n\t\t\tif(Character.isLowerCase(string.charAt(i))){\n\t\t\t\tupperCase = Character.toUpperCase(string.charAt(i));\n\t\t\t\tscore += letterBank.get(upperCase);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tscore += letterBank.get(string.charAt(i));\n\t\t\t}\n\t\t}\n\t\t//System.out.println(score);\n\t\treturn score;\n\t}", "public int countSpecificString(String str)\n\t{\n\t\tif (str == null)\n\t\t\treturn 0;\n\n\t\tstr = str.toLowerCase();\n\t\tNode wizard = this.root; // Temporary node variable.\n\n\t\tfor (int i = 0; i < str.length(); i++)\n\t\t{\n\t\t\tif (!(Character.isLetter(str.charAt(i)))) continue;\n\t\t\tint index = str.charAt(i) - 'a';\n\t\t\t\n\t\t\tif (wizard.children[index] == null) return 0;\n\t\t\twizard = wizard.children[index];\n\t\t}\n\n\t\treturn wizard.count;\n\t}", "static int sherlockAndAnagrams(String s) {\n HashTable hashTable = new HashTable(s.length() * s.length() * 4);\n substrings(s).map(Solution::ordered).forEach(hashTable::insert);\n return substrings(s).map(Solution::ordered).mapToInt(s1 -> {\n hashTable.remove(s1);\n return hashTable.count(s1);\n }).sum();\n }", "public long numberOfSubstrings(String s) {\n int[] letterCounts = new int[26];\n long substringCount = 0;\n for (int i = 0; i < s.length(); i++) {\n char c = s.charAt(i);\n int letterCount = ++letterCounts[c - 'a'];\n substringCount += letterCount;\n }\n return substringCount;\n }", "static int sherlockAndAnagrams(String s) {\n int anagramCount = 0;\n Map<String, Integer> map = new HashMap<>();\n for (int i = 0; i < s.length(); i++) {\n for (int k = i + 1; k <= s.length(); k++) {\n String sub = s.substring(i, k);\n System.out.println(sub);\n sub = new String(sort(sub.toCharArray()));\n int value = map.getOrDefault(sub, 0);\n if(value > 0) {\n anagramCount = anagramCount + value;\n }\n map.put(sub, value+1);\n\n }\n }\n return anagramCount;\n }", "String LetterCount(String str) {\n String strr1[]=str.split(\" \");\n String strr[]= strr1;\n String strt=\"\";\n int count=0;\n int count1=0;\n int maxi=0;\n \n for(int i=0; i<strr.length; i++){\n char[] crr=strr[i].toCharArray();\n java.util.Arrays.sort(crr);\n strt=new String(crr);\n for(int j=0; j<strt.length()-1; j++){\n while(strt.charAt(j)==strt.charAt(j+1) && j<strt.length()-2){\n count++;\n j++;\n }\n }\n if(count>count1){\n count1=count;\n maxi=i;\n }\n count=0;\n }\n return strr1[maxi];\n \n }", "public static Map<Character, Integer> findDuplicateCharactersInAString(final String input){\n\n Map<Character, Integer> charCountMap= null;\n if(input !=null && input.length() > 0)\n {\n if(input.length() ==1){\n return charCountMap;\n }\n charCountMap = new LinkedHashMap<Character, Integer>();\n String inputString = input;\n // In case if the program need not consider capital and small letters,\n // if want to consider comment out below line\n inputString = inputString.toLowerCase();\n char [] inputChars = inputString.toCharArray();\n\n for(Character c : inputChars) {\n\n if (charCountMap.containsKey(c)) {\n charCountMap.put(c, charCountMap.get(c) + 1);\n } else {\n charCountMap.put(c, 1);\n }\n }\n }\n else{\n throw new IllegalArgumentException(\"Invalid input\");\n }\n return charCountMap;\n }", "static int theLoveLetterMystery(String s){\n // Complete this function\n int i= 0;\n int j = s.length()-1;\n int operations = 0;\n while(j>i){\n int char_i = s.charAt(i);\n int char_j = s.charAt(j);\n operations = operations + Math.abs(char_i - char_j);\n i++;\n j--;\n }\n return operations;\n }", "public int [] getCharCount(String str){\n\t\tint CHAR_ARRAY = 26;\n\t\tint [] count = new int [CHAR_ARRAY];\n\t\tfor(char c: str.toCharArray()){\n\t\t\tcount[c-'a']++;\n\t\t}\n\t\treturn count;\n\t}", "public static int countABC(String str) {\n int x = 0;\n char[] chars = str.toCharArray();\n for (char c : chars) {\n if (c == 'a' || c == 'b' || c == 'c') {\n x += 1;\n }\n }\n return x;\n }", "static void getCharCountArray(String str) {\n for (int i = 0; i < str.length(); i++)\n count[str.charAt(i)]++;\n }", "public static int approach2(String str) {\n\t\tMap<Character, Integer> charToCountMap = new HashMap<Character, Integer>();\n\t\tint strLength = str.length();\n\t\tfor(int i = 0; i < strLength; i++) {\n\t\t\tif(charToCountMap.containsKey(str.charAt(i))) {\n\t\t\t\tcharToCountMap.put(str.charAt(i), charToCountMap.get(str.charAt(i)) + 1);\n\t\t\t} else {\n\t\t\t\tcharToCountMap.put(str.charAt(i), 1);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < strLength; i++) {\n\t\t\tif(charToCountMap.get(str.charAt(i)) > 1) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn -1;\n\t}", "public static int countABC(String str) {\n int count = 0;\n for (int i = 0; i < str.length(); i++) {\n if (str.charAt(i) == 'a'){\n count++;\n }\n else if(str.charAt(i) == 'b'){\n count++;\n }\n else if(str.charAt(i) == 'c'){\n count++;\n\n }\n }\n return count;\n }", "static int sherlockAndAnagrams(String s) {\n int anagramCount = 0;\n HashMap<String, Integer> map = new HashMap<>();\n\n int length = s.length();\n int wordSize = 1;\n while (wordSize != length) {\n for(int i = 0; i <= length-wordSize; i++) {\n char[] charArray = s.substring(i, i+wordSize).toCharArray();\n Arrays.sort(charArray);\n String sortedWord = new String(charArray);\n Integer num = map.get(sortedWord);\n if(num == null)\n map.put(sortedWord, 1);\n else {\n map.put(sortedWord, num+1);\n anagramCount += num;\n }\n }\n wordSize++;\n }\n\n return anagramCount;\n }", "static\nint\ncountPairs(String str) \n\n{ \n\nint\nresult = \n0\n; \n\nint\nn = str.length(); \n\n\nfor\n(\nint\ni = \n0\n; i < n; i++) \n\n\n// This loop runs at most 26 times \n\nfor\n(\nint\nj = \n1\n; (i + j) < n && j <= MAX_CHAR; j++) \n\nif\n((Math.abs(str.charAt(i + j) - str.charAt(i)) == j)) \n\nresult++; \n\n\nreturn\nresult; \n\n}", "public int titleToNumber(String s) {\n\t int sum = 0;\n\t // for (int i= s.length()-1; i >= 0; i--) {\n\t // sum = sum + (int) Math.pow(26, s.length()-1-i)*(s.charAt(i) - 'A' + 1);\n\t // }\n\t for (int i=0; i<s.length(); i++) {\n\t sum = sum*26 + (s.charAt(i) - 'A' + 1);\n\t }\n\t return sum;\n\t }", "public int firstUniqChar(String s) {\n int[] freq = new int[26];\n \n for (char c : s.toCharArray())\n freq[c - 'a']++;\n \n for (int i = 0; i < s.length(); i++)\n if (freq[s.charAt(i) - 'a'] == 1) return i;\n \n return -1;\n }", "public String solve1(String s) {\n Map<String, Integer> frequency = new HashMap<>();\n String maxWord = null;\n String[] split = s.split(\" \");\n\n for (String word : split) {\n int newFrequency = frequency.getOrDefault(word, 0) + 1;\n frequency.put(word, newFrequency);\n if (newFrequency > frequency.getOrDefault(maxWord, 0)) {\n maxWord = word;\n }\n }\n\n return maxWord;\n }", "private static String stringCompress(String input) {\n int length = input.length();\n int count = 0;\n StringBuilder output = new StringBuilder();\n char curr = input.charAt(0);\n for(int i=0;i<length;i++){\n char temp = input.charAt(i);\n // If the current char is the same as previous one\n // we increment the counter and move to the next one\n if(curr == temp)\n count++;\n // If the current char is not same as previous one\n // we add the char and its frequency to output\n else{\n output.append(curr);\n output.append(count);\n // reset the counter for next char\n count = 1;\n curr = temp;\n }\n }\n // The last char and its frequency are yet to be added\n output.append(curr);\n output.append(count);\n return output.toString();\n }", "public Map<String, Integer> wordCount(String string) {\n\t\tMap<String, Integer> map = new HashMap<String, Integer>();\n\t\tString[] p = string.split(\"[\\\\W\\\\s]\");\n\t\tfor (String s : p) {\n\t\t\tif (!s.equals(\"\")) {\n\t\t\t\tif (map == null || !map.containsKey(s))\n\t\t\t\t\tmap.put(s, 1);\n\t\t\t\telse\n\t\t\t\t\tmap.replace(s, map.get(s) + 1);\n\t\t\t}\n\t\t}\n\t\treturn map;\n\t}", "public static void main(String[] args) throws IOException {\n\n String file = \"C:/Java Projects/java-web-dev-exercises/src/exercises/CountingCharsSentence.txt\";\n Path path = Paths.get(file);\n List<String> lines = Files.readAllLines(path);\n Object[] string = lines.toArray();\n String string2 = Arrays.toString(string);\n\n String[] wordsInString = string2.toLowerCase().split(\"\\\\W+\");\n String rejoinedString = String.join(\"\", wordsInString);\n char[] charactersInString = rejoinedString.toCharArray();\n\n HashMap<Character, Integer> letterMap = new HashMap<>();\n\n\n for (char letter : charactersInString) {\n if (!letterMap.containsKey(letter)) {\n int letterCount = 1;\n letterMap.put(letter, letterCount);\n } else if (letterMap.containsKey(letter)) {\n letterMap.put(letter, letterMap.get(letter) + 1);\n }\n }\n\n\n System.out.println(letterMap);\n }", "public int getScrabbleScore(String string) {\n\n\t\tif (!string.matches(\"([a-zA-Z])+\"))\n\t\t\tthrow new IllegalArgumentException();\n\n\t\tint score = 0;\n\t\tfor (char c : (string.toUpperCase()).toCharArray()) {\n\t\t\tswitch (c) {\n\t\t\tcase 'D':\n\t\t\tcase 'G':\n\t\t\t\tscore += 2;\n\t\t\t\tbreak;\n\t\t\tcase 'B':\n\t\t\tcase 'C':\n\t\t\tcase 'M':\n\t\t\tcase 'P':\n\t\t\t\tscore += 3;\n\t\t\t\tbreak;\n\t\t\tcase 'F':\n\t\t\tcase 'H':\n\t\t\tcase 'V':\n\t\t\tcase 'W':\n\t\t\tcase 'Y':\n\t\t\t\tscore += 4;\n\t\t\t\tbreak;\n\t\t\tcase 'K':\n\t\t\t\tscore += 5;\n\t\t\t\tbreak;\n\t\t\tcase 'J':\n\t\t\tcase 'X':\n\t\t\t\tscore += 8;\n\t\t\t\tbreak;\n\t\t\tcase 'Q':\n\t\t\tcase 'Z':\n\t\t\t\tscore += 10;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tscore += 1;\n\t\t\t}\n\t\t}\n\t\treturn score;\n\t}", "static int theLoveLetterMystery(String s) {\n char[] a = s.toCharArray();\n\n int i=0;\n int j=a.length-1;\n int cost=0;\n for(;i<j;i++,j--){\n\n if(a[i]<a[j]){\n cost+=a[j]-a[i];\n a[j]=a[i];\n \n }\n else{\n if(a[i]>a[j]){\n cost+=a[i]-a[j];\n a[i]=a[j];\n \n }\n }\n\n }\n\n System.out.println(\"\");\n\nreturn cost;\n }", "public static void main(String[] args) {\n HashMap<Character, Integer> finalChar = new HashMap<>();\n int charCount = 1;\n\n String str = \"If the product of two terms is zero then common sense says at least one of the two terms has to be zero to start with. \" +\n \"So if you move all the terms over to one side, \" +\n \"you can put the quadratics into a form that can be factored allowing that side of the equation to equal zero. \" +\n \"Once you’ve done that, it’s pretty straightforward from there.\";\n\n // convert String to char[] array\n char[] charInString = str.toCharArray();\n\n // iterate over charInString[] array using enhanced for loop\n for (char charName : charInString) {\n\n if (finalChar.containsKey(charName)) {\n finalChar.put(charName, finalChar.get(charName) + 1);\n } else {\n finalChar.put(charName, 1);\n }\n\n }\n System.out.println(finalChar);\n }", "public static void main(String[] args) {\n\t\t\n\t\tString s = \"asdfasdfafk asd234asda\";\n\t //Map<Character, Integer> charMap = new HashMap<Character, Integer>();\n\t \n\t Map<Character,Integer> map = new HashMap<Character,Integer>();\n\t for (int i = 0; i < s.length(); i++) {\n\t char c = s.charAt(i);\n\t System.out.println(c);\n\t //if (Character.isAlphabetic(c)) {\n\t if (map.containsKey(c)) {\n\t int cnt = map.get(c);\n\t System.out.println(cnt);\n\t map.put(c,++cnt);\n\t } else {\n\t map.put(c, 1);\n\t }\n\t \n\t }\n\t // }\n\t System.out.println(map);\n\t \n\t \n\t /* char[] arr = str.toCharArray();\n\t System.out.println(arr);\n\t \n\n\t\t\n\t\tfor (char value: arr) {\n\t\t \n\t\t if (Character.isAlphabetic(value)) { \n\t\t\t if (charMap.containsKey(value)) {\n\t\t charMap.put(value, charMap.get(value) + 1);\n\t\t \n\t\t } \n\t\t\t else { charMap.put(value, 1); \n\t\t } \n\t\t\t } \n\t\t }\n\t\t \n\t\t System.out.println(charMap);*/\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t \n \t}", "public static FreqChar exe2(String text) {\n FreqChar freqChar = new FreqChar();\n Map<Character, Integer> cFreq = new HashMap<>();\n for (Character c : text.toCharArray()) {\n cFreq.put(c, cFreq.getOrDefault(c, 0)+1);\n }\n\n int max = 0;\n for (Character c : cFreq.keySet()) {\n if (cFreq.get(c) > max) {\n max = cFreq.get(c);\n freqChar.setC(c);\n freqChar.setFreq(max);\n }\n\n }\n return freqChar;\n }", "int count(String s) {\r\n\t\tif (m_words.containsKey(s)) {\r\n\t\t\treturn m_words.get(s);\r\n\t\t} else {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "public static ArrayList<Integer> findAnagrams(String s, String p) {\r\n\t \t \r\n\t \t //write your code here\r\n\t\t if(s.length()<p.length()) {\r\n\t\t\t ArrayList<Integer> arr = new ArrayList<>();\r\n\t\t\t return arr;\r\n\t\t }\r\n\t\t ArrayList<Integer> result = new ArrayList<>();\r\n\t\t HashMap<Character,Integer> P = new HashMap<>();\r\n\t\t HashMap<Character,Integer> H = new HashMap<>();\r\n\t\t \r\n\t\t for(int i=0;i<p.length();i++) {\r\n\t\t\t char ch = p.charAt(i);\r\n\t\t\t if(!P.containsKey(ch)) {\r\n\t\t\t\t P.put(ch,1);\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t P.put(ch,P.get(ch)+1);\r\n\t\t\t }\r\n\t\t }\r\n\t\t int start =0;\r\n\t\t int end=0;\r\n\t\t int mcount=0;\r\n\t\t for(int i=0;i<p.length();i++) {\r\n\t\t\t char ch = s.charAt(i);\r\n\t\t\t if(!H.containsKey(ch)) {\r\n\t\t\t\t H.put(ch,1);\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t H.put(ch,H.get(ch)+1);\r\n\t\t\t }\r\n\t\t\t if(P.containsKey(ch)) {\r\n\t\t\t\t if(P.get(ch)>=H.get(ch)) {\r\n\t\t\t\t\t mcount++;\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t\t end=i;\r\n\t\t }\r\n\t\t if(mcount==p.length()) {\r\n\t\t\t result.add(start);\r\n\t\t }\r\n\t\t while(end<s.length()-1) {\r\n\t\t\t char ch=s.charAt(start);\r\n\t\t\t int hfreq = H.get(ch)-1;\r\n\t\t\t H.put(ch,hfreq);\r\n\t\t\t if(H.get(ch)==0) {\r\n\t\t\t\t H.remove(ch);\r\n\t\t\t }\r\n\t\t\t int pfreq=0;\r\n\t\t\t if(P.containsKey(ch)) {\r\n\t\t\t\t pfreq=P.get(ch);\r\n\t\t\t }\r\n\t\t\t if(hfreq<pfreq) {\r\n\t\t\t\t mcount--;\r\n\t\t\t }\r\n\t\t\t ch=s.charAt(end+1);\r\n\t\t\t int hfreqend=0;\r\n\t\t\t if(H.containsKey(ch)) {\r\n\t\t\t\t hfreqend = H.get(ch);\r\n\t\t\t }\r\n\t\t\t hfreqend++;\r\n\t\t\t H.put(ch, hfreqend);\r\n\t\t\t int pfreqend=0;\r\n\t\t\t if(P.containsKey(ch)) {\r\n\t\t\t\t pfreqend = P.get(ch);\r\n\t\t\t }\r\n\t\t\t if(hfreqend<=pfreqend) {\r\n\t\t\t\t mcount++;\r\n\t\t\t }\r\n\t\t\t start++;\r\n\t\t\t end++;\r\n\t\t\t if(mcount==p.length()) {\r\n\t\t\t\t result.add(start);\r\n\t\t\t }\r\n\t\t\t \r\n\t\t }\r\n\t\t return result;\r\n\t\t \r\n\t \t \r\n\t }", "static int countCharacters2(String[] words, String chars) {\n int count = 0;\n int[] seen = new int[26];\n //Count char of Chars String\n for (char c : chars.toCharArray())\n seen[c - 'a']++;\n // Comparing each word in words\n for (String word : words) {\n // simple making copy of seen arr\n int[] tSeen = Arrays.copyOf(seen, seen.length);\n int Tcount = 0;\n for (char c : word.toCharArray()) {\n if (tSeen[c - 'a'] > 0) {\n tSeen[c - 'a']--;\n Tcount++;\n }\n }\n if (Tcount == word.length())\n count += Tcount;\n }\n return count;\n }", "public static void letterCount(String[] s, int[] count){\n\t\t//Checks if s or count is null. Only continues if both are false\n\t\tif (s != null && count != null){\n\t\t\t//Loops through each index of s\n\t\t\tfor (int j = 0; j < s.length; j++){\n\t\t\t\t//Only continues if index is not null\n\t\t\t\tif (s[j] != null){\n\t\t\t\t\t//Loops through each letter of the String at index j\n\t\t\t\t\tfor (int k = 0; k < s[j].length(); k++){\n\t\t\t\t\t\t//Loops through alphabet until the character at s[j].charAt(k) equals h\n\t\t\t\t\t\tfor (char h = 'a', i = 0; h <= 'z'; h++, i++){\n\t\t\t\t\t\t\t//If the character at k in s[j] equals h, add 1 to the corresponding position to the alphabet in count[]\n\t\t\t\t\t\t\tif (Character.toLowerCase(s[j].charAt(k)) == h || Character.toUpperCase(s[j].charAt(k)) == h){\n\t\t\t\t\t\t\t\th = 'z';\n\t\t\t\t\t\t\t\tcount[i] += 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private static int countOccurrences(String input, char c) {\n int count = 0;\n for (int i = 0; i < input.length(); i++) {\n if (input.charAt(i) == c) {\n count++;\n }\n }\n return count;\n }", "public void countWordLengthsWithIsLettermethod(FileResource resource, int[] counts) {\r\n for (String word : resource.words()) {\r\n String trim = word.trim();\r\n int wordSize = trim.length();\r\n char firstChar = trim.charAt(0);\r\n char endChar = trim.charAt(trim.length()-1);\r\n if (!Character.isLetter(firstChar) && !Character.isLetter(endChar)) {\r\n wordSize -= 2;\r\n } else \r\n if (!Character.isLetter(firstChar) || !Character.isLetter(endChar)) {\r\n wordSize -= 1;\r\n }\r\n if(wordSize>=counts.length) {\r\n counts[counts.length-1] += 1; \r\n } else\r\n //right algorithm\r\n if( wordSize> 0 && counts[wordSize] != 0 ) {\r\n counts[wordSize] += 1;\r\n \r\n } else if ( wordSize> 0) {\r\n counts[wordSize] = 1;\r\n }\r\n }\r\n \r\n //test\r\n for(int i : counts) {\r\n System.out.println(i);\r\n }\r\n }", "static int maxCharacter(String string) {\n\t\tchar[] ch = string.toCharArray();\n\t\t// create a hashmap for lookup using the char as a key\n\t\tMap<Character, int[]> map = new HashMap<Character, int[]>();\n\t\t// loop through string\n\t\tfor (int i = 0; i < ch.length; i++) {\n\t\t\t// if the character is already in the map increase occurrence value\n\t\t\tif (map.containsKey(ch[i])) {\n\t\t\t\t// get value array\n\t\t\t\t// increase occurrence\n\t\t\t\t// set new value\n\t\t\t\tint[] curArr = map.get(ch[i]);\n\t\t\t\tcurArr[1] = curArr[1] + 1;\n\t\t\t\tmap.put(ch[i], curArr);\n\t\t\t\t// if the character isn't in map, make a new entry\n\t\t\t} else {\n\t\t\t\t// create an array { index, occurrence vale}\n\t\t\t\tint[] newArr = { i, 1 };\n\t\t\t\tmap.put(ch[i], newArr);\n\t\t\t}\n\t\t}\n\t\tint max = 0;\n\t\tint index = 0;\n\t\t// loop through entries\n\t\tfor (Map.Entry<Character, int[]> e : map.entrySet()) {\n\t\t\t// find the largest occurrence value\n\t\t\tint[] maxArr = e.getValue();\n\t\t\tif (maxArr[1] > max) {\n\t\t\t\tmax = maxArr[1];\n\t\t\t\tindex = maxArr[0];\n\t\t\t}\n\t\t}\n\t\t// return the index of the first found character\n\t\treturn index;\n\t}", "public int countConsonants(String str){\n\t\tint count=str.replaceAll(\"[^A-Za-z0-9_]\", \"\").length()\n\t\t\t\t-str.toLowerCase().replaceAll(\"[^aeiouy]\",\"\").length();\n\t\treturn count;\n\t}", "private int hash(String string) {\n\t\tint hash = 0;\n\t\tint temp = 0;\n\n\t\tfor (byte b : string.toLowerCase().getBytes(StandardCharsets.US_ASCII)) {\n\t\t\thash = (hash << 4) + b;\n\t\t\ttemp = hash & 0xF0000000;\n\n\t\t\tif (temp != 0) {\n\t\t\t\thash = hash ^ (temp >>> 24);\n\t\t\t\thash = hash ^ temp;\n\t\t\t}\n\t\t}\n\n\t\treturn hash;\n\t}", "private static int[] letterHist(String acharArray) {\n int[] alphabet = new int[26];\n\n for (int i = 0; i < acharArray.length(); i++) {\n char singleChar = acharArray.toLowerCase().charAt(i);\n\n if ('a' <= singleChar && 'z' >= singleChar) {\n alphabet[singleChar - 'a']++;\n }\n }\n return alphabet;\n }", "static int sherlockAndAnagrams(String s) {\n\n // **** initialize count of anagrams ****\n int count = 0;\n\n // **** loop once per grouping of characters [1 : s.length() - 1] ****\n for (int g = 1; g < s.length(); g++) {\n\n // **** generate the base sub string ****\n for (int i = 0; i < s.length() - g; i++) {\n\n // **** starting string ****\n String bs = s.substring(i, i + g);\n\n // **** generate sub strings ****\n for (int j = i + 1; j <= s.length() - g; j++) {\n\n // **** generate current sub string ****\n String cs = s.substring(j, j + g);\n\n // **** check if anagram ****\n if (areAnagram(bs, cs)) {\n count++;\n }\n }\n }\n }\n\n // **** count of anagrams ****\n return count;\n }", "public static void main(String[] args) {\n\t\tScanner stdin = new Scanner(System.in);\n\t\tString line = stdin.nextLine().toLowerCase();\n\t\tint[] freq = new int[26];\n\t\tint cnt = 0;\n\t\tfor (int i=0; i<line.length(); i++) {\n\t\t\tif (line.charAt(i) >= 'a' && line.charAt(i) <='z') {\n\t\t\t\tfreq[line.charAt(i)-'a']++;\n\t\t\t\tcnt++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// We greedily assign these in order.\n\t\tArrays.sort(freq);\n\t\t\n\t\t// So make the most frequent characters the cheapest.\n\t\tint cost = 0;\n\t\tfor (int i=0,j=freq.length-1; j>=0; i++,j--)\n\t\t\tcost += (freq[j]*COST[i]);\n\t\t\t\n\t\t// Separators.\n\t\tcost += (3*(cnt-1));\n\t\t\t\t\n\t\t// Ta da!\n\t\tSystem.out.println(cost);\n\t}", "private static void cryptanalysis() {\n\t for (char cipherChar : cipherText.toCharArray()) {\n\t if (Character.isLetter(cipherChar)) { // only letters are encrypted, punctuation marks and whitespace are not\n\t // following line converts letters to numbers between 0 and 25\n\t int cipher = (int) cipherChar - alphaIndex;\n\t // following line increments the value at frequency[cipher] to count frequency of letters used\n\t frequency[cipher] = frequency[cipher] + 1;\n\t }\n\t } \n\t char currChar = 'A';\n \t for (int i = 0; i < 26; i++) {\n \t\t System.out.println(currChar++ + \" \" + frequency[i]);\n \t }\n }", "public static void main(String args[]){\n Scanner sc=new Scanner(System.in);\n String str=sc.nextLine();\n int len=str.length();\n int stat[]=new int[26];\n for(int i=0;i<len;i++)\n {\n if((str.charAt(i)>='a') && ( str.charAt(i)<='z'))\n {\n int offset=str.charAt(i) - 'a';\n stat[offset]++; \n }\n if((str.charAt(i)>='A') && ( str.charAt(i)<='Z'))\n {\n int offset=str.charAt(i) - 'A';\n stat[offset]++; \n }\n }\n for(int i=0;i<26;i++)\n {\n \n if( stat[i]==0)\n {\n char ch=(char)('a'+i);\n System.out.print(ch+\" \");\n \n \n \n }\n }\n}", "public void getOccuringChar() \n\t\t {\n\t\t \tint count[] = new int[MAX_CHAR]; \n\t\t \t \n\t\t int len = str.length(); \n\t\t \n\t\t // Initialize count array index \n\t\t for (int i = 0; i < len; i++) \n\t\t count[str.charAt(i)]++; \n\t\t \n\t\t // Create an array of given String size \n\t\t char ch[] = new char[str.length()]; \n\t\t for (int i = 0; i < len; i++) { \n\t\t ch[i] = str.charAt(i); \n\t\t int find = 0; \n\t\t for (int j = 0; j <= i; j++) { \n\t\t \n\t\t // If any matches found \n\t\t if (str.charAt(i) == ch[j]) \n\t\t find++; \n\t\t } \n\t\t \n\t\t if (find == 1) \n\t\t System.out.println(\"Number of Occurrence of \" + \n\t\t str.charAt(i) + \" is:\" + count[str.charAt(i)]); \n\t\t } \n\t\t }", "List<Integer> allAnagrams(String s, String l) {\n\t\t// Write your solution here.\n\t\tList<Integer> result = new ArrayList<Integer>();\n\t\tif (s == null || l == null || s.length() == 0 || l.length() == 0) {\n\t\t\treturn result;\n\t\t}\n\t\tif (s.length() > l.length()) {\n\t\t\treturn result;\n\t\t}\n\t\tMap<Character, Integer> map = countMap(s);\n\t\tint match = 0;\n\t\tfor (int i = 0; i < l.length(); i++) {\n\t\t\tchar temp = l.charAt(i);\n\t\t\tInteger count = map.get(temp);\n\t\t\tif (count != null) {\n\t\t\t\tmap.put(temp, count - 1);\n\n\t\t\t\tif (count == 1) {\n\t\t\t\t\tmatch++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (i >= s.length()) {\n\t\t\t\ttemp = l.charAt(i - s.length());\n\t\t\t\tcount = map.get(temp);\n\t\t\t\tif (count != null) {\n\t\t\t\t\tmap.put(temp, count + 1);\n\t\t\t\t\tif (count == 0) {\n\t\t\t\t\t\tmatch--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (match == map.size()) {\n\t\t\t\tresult.add(i - s.length() + 1);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "static long repeatedString(String s, long n) {\n long a_count = 0;\n long total_a_count = 0;\n long modulo_s = 0;\n\n if(n>s.length()){\n for (int i=0; i<s.length(); i++)\n if(s.charAt(i)=='a') a_count++;\n\n total_a_count = a_count*(n/s.length());\n modulo_s = n%s.length();\n\n for (int i=0; i<modulo_s; i++)\n if(s.charAt(i)=='a') total_a_count++;\n\n return total_a_count;\n }\n\n else {\n for (int i=0; i<n; i++)\n if(s.charAt(i)=='a') a_count++;\n return a_count;\n }\n }", "private HashMap<Character, Integer> countAllLetters(String word) {\n WordToolbox otherWord = new WordToolbox(word.toLowerCase());\r\n HashMap<Character, Integer> mapOfWord = new HashMap<>();\r\n for (int i = 0; i < word.length(); i++) {\r\n mapOfWord.put(word.toLowerCase().charAt(i), otherWord.countHowMany(word.toLowerCase().charAt(i)));\r\n }\r\n return mapOfWord;\r\n }", "public static int[] countChar(String str) {\n\t\tint[] charSet = new int[256];\n\t\tfor(int i = 0; i < str.length(); i++) {\n\t\t\tcharSet[str.charAt(i)]++;\n\t\t}\n\t\treturn charSet;\n\t}", "public static void main(String[] args) {\n String str = \"abcDaaafmOO\";\n String uniques = \"\";//lets use string str to find unique characters\n // int count = frequency(str,'a');//return type is int, therefore assign to int variable\n // System.out.println(count);//print the frequency of char 'a'\n//This step is use to identify if the character is unique, let's use loop for this\n for (char each : str.toCharArray()){\n // char ch = str.charAt(i); //to get char as a data type\n int count = frequency(str, each);\n //this is a frequency\n if(count == 1){//if count is equal to 1, concat it to unique variable\n uniques += each;\n }\n }\n System.out.println(\"unique values are: \"+uniques);\n System.out.println(\"========================\");\n String str2 = \"ppppoifugggggsxL\";\n String uniques2 = uniques(str2);\n System.out.println(\"unique values are: \"+uniques2);\n }", "public static void main(String[] args) {\n\t\t\t\n\t\t\tString input=\"ABCGRETCABCG\";\n\t\t\tint n = 3;\n\t\t\t\n\t\t\tMap<String,Integer> substrMap=new HashMap<String,Integer>();\n\t\t\t\n\t\t\tfor(int i=0;i+n<=input.length();i++){\n\t\t\t\t\n\t\t\t\tString substr=input.substring(i, i+n);\n\t\t\t\t\n\t\t\t\tint frequency=1;\n\t\t\t\t\n\t\t\t\tif(substrMap.containsKey(substr)){\n\t\t\t\t\t\n\t\t\t\t\tfrequency=substrMap.get(substr);\n\t\t\t\t\tfrequency++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsubstrMap.put(substr, frequency);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println(substrMap.toString());\n\t\t}", "public static void main(String[] args)\n {\n System.out.println(\"Enter your sentence: \");\n Scanner in = new Scanner(System.in);\n //Take the entered sentence\n String input = in.nextLine();\n //This is for searching\n char auxiliary = 'a';\n //This is the final letter which has the highest occurrence\n char[] letter = new char[26];\n int arrayCounter = 0;\n //This is simply a counter\n int frequency = 0;\n //This shows the highest frequency of a letter inside the entered sentence\n int maxFrequency = 0;\n //The outer loop goes for all letters in English\n for(int i = 0; i < 26; i++)\n {\n //The inner loop searches along the whole entered sentence\n for(int j = 0; j < input.length(); j++)\n {\n //No matter if the letter inside the sentence is capital or small\n if((auxiliary+i == input.charAt(j)) || (auxiliary+i-32 == input.charAt(j)))\n {\n frequency++;\n }\n }\n //The counted number and its associated letter are saved as maxFrequency and\n //letter respectively, only if it is higher than the\n //previous maxFrequency\n if(frequency > maxFrequency)\n {\n maxFrequency = frequency;\n frequency = 0;\n letter[arrayCounter] = (char) (auxiliary+i);\n arrayCounter++;\n }\n //In case more than one letter has been repeated with the highest frequency\n else if((frequency == maxFrequency) && ((maxFrequency > 0)))\n {\n frequency = 0;\n letter[arrayCounter] = (char) (auxiliary+i);\n arrayCounter++;\n }\n else\n {\n //If not bigger than the max, its value simply vanishes!\n frequency = 0;\n }\n }\n System.out.print(\"The letter(s) \");\n for(int i = 0; i < arrayCounter-1; i++)\n {\n System.out.print(letter[i] + \", \");\n }\n System.out.print(letter[arrayCounter-1]);\n System.out.print(\" has/have been repeated (regardless of being small or capital) \"\n +maxFrequency+\" times,\" +\n \" which is the maximum in this entered sentence!\");\n }", "@Override\n\tpublic int getSumOfAllCharacters() {\n\t\tint sum1 = 0;\n\t\tchar[] ch = theString.toCharArray();\n\t\tint temp_integer = 64;\n\t\tint temp_small = 96;\n\n\t\tfor (char c : ch) {\n\t\t\tint temp = (int) c;\n\t\t\t// System.out.println(temp);\n\n\t\t\tif (temp <= 90 & temp >= 65) {\n\t\t\t\tint sum = (temp - temp_integer);\n\t\t\t\t// System.out.println(sum);\n\t\t\t\tsum1 = sum + sum1;\n\n\t\t\t} else if (temp <= 122 & temp >= 97) {\n\n\t\t\t\tint sum = (temp - temp_small);\n\n\t\t\t\tsum1 = sum + sum1;\n\t\t\t}\n\t\t}\n\t\t// System.out.println(\"the total is=\" + sum1);\n\n\t\treturn sum1;\n\t}", "public static int titleToNumber(String s) {\n char [] charArray = s.toCharArray();\n int num = 0;\n int j = 0;\n for(int i = charArray.length-1; i >=0; i--) {\n num += (int) ((charArray[i] - 'A' + 1) * Math.pow(26, j++)); \n }\n \n return num;\n }", "static int alternate(String s) {\n\n \n char[] charArr = s.toCharArray();\n\n int[] arrCount=new int[((byte)'z')+1];\n\n for(char ch:s.toCharArray()){ \n arrCount[(byte)ch]+=1;\n }\n \n int maxLen=0;\n for(int i1=0;i1<charArr.length;++i1)\n {\n char ch1= charArr[i1];\n for(int i2=i1+1;i2<charArr.length;++i2)\n {\n char ch2 = charArr[i2];\n if(ch1 == ch2)\n break;\n\n //validate possible result\n boolean ok=true;\n {\n char prev = ' ';\n for(char x:charArr){\n if(x == ch1 || x == ch2){\n if(prev == x){\n ok=false;\n break;\n }\n prev = x;\n }\n }\n\n }\n if(ok)\n maxLen = Math.max(maxLen,arrCount[(byte)ch1]+arrCount[(byte)ch2]);\n }\n }\n\n return maxLen;\n\n }", "public static int calculateTotalChars(String[] text) {\n int totalChars = 0;\n for (String str : text) {\n totalChars += str.length();\n totalChars++;\n }\n totalChars--;\n return totalChars;\n }", "static int charOccurrenceCount(String s, char c, int startIndex) {\n\t\tif(startIndex == s.length()) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\tif(s.charAt(startIndex) == c) {\n\t\t\t\treturn 1 + charOccurrenceCount(s, c, startIndex + 1);\n\t\t\t} else {\n\t\t\t\treturn charOccurrenceCount(s, c, startIndex + 1);\n\t\t\t}\n\t\t}\n\t}", "static int makeAnagram(String a, String b) {\n int[] frequencyA = countFrequency(a);\n int[] frequencyB = countFrequency(b);\n\n int count = 0;\n\n for (int i = 0; i < frequencyA.length; i++) {\n count += Math.abs(frequencyA[i] - frequencyB[i]);\n }\n return count;\n }", "Alphabet(String chars) {\n char[] newChars = chars.toCharArray();\n Map<Character, Integer> map = new HashMap<>();\n for (char c : newChars) {\n if (map.containsKey(c)) {\n int counter = map.get(c);\n map.put(c, ++counter);\n } else {\n map.put(c, 1);\n }\n }\n\n for (char c : map.keySet()) {\n if (map.get(c) > 1) {\n throw new EnigmaException(\"Duplicates Found\");\n } else {\n _letters = chars;\n }\n }\n }", "public static int duplicateCount(String text) {\n \r\n int count=0; \r\n \r\n \r\n \r\n int l=text.length(); int index=0; String s1=\"\"; char [] c= new\r\n char [text.length()] ; for (int i=0;i <text.length();i++) {\r\n c[i]=text.toLowerCase().charAt(index++);\r\n \r\n System.out.println(\"Character at c[\"+i+\"] is\"+c[i]);\r\n \r\n }\r\n \r\n System.out.println(\"Character array is \"+Arrays.toString(c));\r\n \r\n int charSize=c.length; int index2=1;\r\n \r\n HashMap h =new HashMap();\r\n for (int i=0;i<charSize;i++)\r\n {\r\n for(int j=i+1;j<charSize;j++)\r\n {\r\n if (c[i]==c[j])\r\n {\r\n count++;\r\n //s1=s1+c[j];\r\n \r\n h.put(c[j],count);\r\n }\r\n }\r\n }\r\n \r\n \r\n System.out.println(h);\r\n \r\n int hsize= h.size();\r\n \r\n return hsize;\r\n }", "public static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tString S = s.nextLine();\n\t\tint[] freq = new int[26]; // 빈도수 저장\n\t\tfor (int i = 0; i < S.length(); i++) {\n\t\t\tfreq[S.charAt(i) - 97]++;\n\t\t}\n\t\tfor (int i = 0; i < freq.length; i++) {\n\t\t\tif (i == freq.length - 1)\n\t\t\t\tSystem.out.println(freq[i]);\n\t\t\telse\n\t\t\t\tSystem.out.print(freq[i] + \" \");\n\t\t}\n\t}", "public Map<String, Integer> wordCount(String string) {\n\t\t//Split the input string by into individual words. Takes out the spaces, commas, apostrophes\n\t\tString[] splitWords = string.split(\"[\\\\s',]\");\n\t\t//Initiate the hashmap to store unique words as keys and incrementing values with repeated keys\n\t\tMap<String, Integer> wordCount = new HashMap<>();\n\t\tfor(int i = 0; i < splitWords.length; i++ ) {\n\t\t\t//increment word count if the word is already in the hashmap. Make a new entry if word is unique to the map.\n\t\t\tif (wordCount.containsKey(splitWords[i])) {\n\t\t\t\twordCount.put(splitWords[i], wordCount.get(splitWords[i])+1);\n\t\t\t}else {\n\t\t\t\twordCount.put(splitWords[i], 1);\n\t\t\t}\t\t\n\t\t}\n\t\t//Remove the empty spaces from the map (to satisfy a test case)\n\t\twordCount.remove(\"\");\n\t\treturn wordCount;\n\t}", "public String detect(String string) {\n\t\t//The map need to be initial again in order to flush all the previous data;\n\t\t//now we can detect multiple string with one instance!\n\t\tthis.init();\n\t\tfor(char c : string.toCharArray()) {\n\t\t\t\n\t\t\t//if character c is already in the map than increase it's frequency by 1\n\t\t\tif(this.map.keySet().contains(c)) {\n\t\t\t\tthis.map.put(c, this.map.get(c)+1);\n\t\t\t}\n\t\t\t//else, put it in the map with the frequency 1\n\t\t\telse {\n\t\t\t\tthis.map.put(c, 1);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//first is the index of first-unique character\n\t\t//last is the index of last-continuous-unique character starting from the 'first' unique character\n\t\tint i = 0, first = 0, last = 0;\n\t\twhile(i<string.length() && map.get(string.charAt(i))>1) {\n\t\t\ti++;\n\t\t}\n\t\tif(i==string.length()) {\n\t\t\treturn \"\";\n\t\t} else {\n\t\t\tfirst = i;\n\t\t\tlast = i+1;\n\t\t\twhile(last<string.length()&&map.get(string.charAt(last))==1) {\n\t\t\t\tlast += 1;\n\t\t\t}\n\t\t\treturn string.substring(first,last);\n\t\t}\n\t}", "private static int[] countLetters (String msg) {\n int[] counts = new int[26];\n for (char c : msg.toCharArray()) {\n char cuc = Character.toUpperCase(c);\n if (Character.isAlphabetic(cuc)) counts[ALPHABET.indexOf(cuc)]++;\n }\n \n return counts;\n }", "private int hashFunc(String input) {\n\t\tBigInteger value = BigInteger.valueOf(0);\n\t\tBigInteger k2 = new BigInteger(\"27\");\n\t\tchar c = input.charAt(0);\n\t\tlong i1 = (int) c - 96;\n\t\tBigInteger k1 = new BigInteger(\"0\");\n\t\tk1 = k1.add(BigInteger.valueOf(i1));\n\t\tvalue = k1;\n\n\t\tfor (int i = 1; i < input.length(); i++) {\n\n\t\t\tchar c2 = input.charAt(i);\n\n\t\t\tvalue = value.multiply(k2);\n\n\t\t\tlong i2 = (int) c2 - 96;\n\t\t\tBigInteger k3 = new BigInteger(\"0\");\n\t\t\tk3 = k3.add(BigInteger.valueOf(i2));\n\n\t\t\tvalue = value.add(k3);\n\n\t\t}\n\t\tBigInteger size = new BigInteger(\"0\");\n\t\tsize = size.add(BigInteger.valueOf(this.size));\n\t\tvalue = value.mod(size);\n\n\t\treturn value.intValue();\n\t}", "static int makeAnagram1(String a, String b) {\n int count = 0;\n Map<Character, Integer> mapA = initMap(a);\n Map<Character, Integer> mapB = initMap(b);\n\n Iterator<Character> it = mapA.keySet().iterator();\n while (it.hasNext()) {\n char c = it.next();\n int frequencyA = mapA.get(c);\n if (mapB.containsKey(c)) {\n int frequencyB = mapB.get(c);\n count += Math.abs(frequencyA - frequencyB);\n int min = Math.min(frequencyA, frequencyB);\n mapA.put(c, min);\n mapB.put(c, min);\n } else {\n count += frequencyA;\n }\n }\n\n it = mapB.keySet().iterator();\n while (it.hasNext()) {\n char c = it.next();\n int frequencyB = mapB.get(c);\n if (mapA.containsKey(c)) {\n int frequencyA = mapA.get(c);\n count += Math.abs(frequencyA - frequencyB);\n int min = Math.min(frequencyA, frequencyB);\n mapA.put(c, min);\n mapB.put(c, min);\n } else {\n count += frequencyB;\n }\n }\n return count;\n }", "public static String uniques(String str){\n String uniques = \"\";//lets use string str to find unique characters\n // int count = frequency(str,'a');//return type is int, therefore assign to int variable\n // System.out.println(count);//print the frequency of char 'a'\n//This step is use to identify if the character is unique, let's use loop for this\n for (char each : str.toCharArray()){\n // char ch = str.charAt(i); //to get char as a data type\n int count = frequency(str, each);\n //this is a frequency\n if(count == 1){//if count is equal to 1, concat it to unique variable\n uniques += each;\n }\n }\n return uniques;\n\n }", "public static void main(String[] args) {\n\t\t\n\t\tString s1=\"Hi Hello\";\n\t\tfrequent(s1);\n//\t\tchar ch[] = s1.toCharArray();\n//\t\tchar ch1;\n//\t\tchar ch2[]=new char[10];\n//\t\t\n//\t\tfor(int i=0;i<ch.length;i++) {\n//\t\t\tSystem.out.println(ch[i]);\n//\t\t}\n//\t\t\n//\t\tfor(int i=0;i<ch.length;i++) {\n//\t\t\t\n//\t\t\tint count=1;\n//\t\t\tfor(int j=i+1;j<ch.length;j++) {\n//\t\t\t\t\n//\t\t\t\tif(ch[i]==ch[j]) {\n//\t\t\t\t\t\n//\t\t\t\t\tcount++;\n//\t\t\t\t}\n//\t\t\t\t\n//\t\t\t}System.out.println(\"Count of \"+ch[i]+\"=\"+count);\n//\t\t}\n\t\t\n\t\t\n\t\n\n\t}", "private static String hashWord(String word) {\n int[] counts = new int[26];\n for (char c : word.toCharArray()) { // O(c)\n counts[(int)c-97]++;\n }\n StringBuilder sb = new StringBuilder();\n for (int i : counts) { // O(26)\n sb.append(Integer.toString(i));\n }\n return sb.toString();\n }", "public int countDistinct(String s) {\n\t\tTrie root = new Trie();\n\t\tint result = 0;\n for (int i = 0; i < s.length(); i++) {\n \tTrie cur = root;\n \tfor (int j = i; j < s.length(); j++) {\n \t\tint idx = s.charAt(j) - 'a';\n \t\tif (cur.arr[idx] == null) {\n \t\t\tresult++;\n \t\t\tcur.arr[idx] = new Trie();\n \t\t}\n \t\tcur = cur.arr[idx];\n \t}\n }\n return result;\n }", "java.lang.String getFrequency();" ]
[ "0.76649547", "0.7519262", "0.7261482", "0.7206413", "0.71254116", "0.69676393", "0.6892672", "0.68786484", "0.6793122", "0.677278", "0.67595816", "0.67077273", "0.65618914", "0.654267", "0.6539095", "0.6536824", "0.6514618", "0.6491028", "0.6457372", "0.6451825", "0.643792", "0.64352584", "0.64234275", "0.6383746", "0.63693815", "0.63140845", "0.62980366", "0.6297937", "0.6278862", "0.62354904", "0.62331045", "0.62067294", "0.6201977", "0.61944246", "0.61940515", "0.6181673", "0.61543494", "0.61528105", "0.6149403", "0.6108771", "0.60895187", "0.60894376", "0.6060306", "0.60580283", "0.60458434", "0.6039512", "0.60328835", "0.6030045", "0.6021046", "0.60076314", "0.59949315", "0.59834915", "0.59728324", "0.5972441", "0.5969686", "0.5963203", "0.5961738", "0.5961274", "0.59582263", "0.5924687", "0.59241164", "0.59224665", "0.59166163", "0.5896732", "0.58556527", "0.5851084", "0.58497936", "0.5840509", "0.58391553", "0.5838218", "0.58359677", "0.5823678", "0.58229184", "0.58212024", "0.58181", "0.57992536", "0.57948613", "0.57712126", "0.5763418", "0.57622784", "0.57610244", "0.5758169", "0.57553977", "0.57484674", "0.5747122", "0.57404405", "0.5739064", "0.5735147", "0.57272017", "0.5725021", "0.57196105", "0.5714459", "0.5712429", "0.57023555", "0.56914115", "0.569048", "0.5688117", "0.56815565", "0.5680058", "0.56794393" ]
0.75542015
1
Given a text string, calculate the frequency of all Digraphs in that string.
private static HashMap<String, Double> ComputeRelativeFrequencyDigraphs(String text) { long length = text.length(); //We need at least 2 characters. if (length <= 1) { return new HashMap<String, Double>(); } HashMap<String, Integer> freqMap = new HashMap<String, Integer>(); //Look at this character, and the next one to determine digraphs. for (int i = 0; i < length - 1; i++) { char character1 = text.charAt(i); char character2 = text.charAt(i+1); if (((character1 >= 'A' && character1 <= 'Z')) && ((character2 >= 'A' && character2 <= 'Z'))) { int freq; //If we haven't seen this combination yet, add it with a frequency of 1. if (freqMap.get("" + character1 + character2) == null) { freq = 1; } else { freq = freqMap.get("" + character1 + character2) + 1; } freqMap.put(("" + character1 + character2), freq); } } HashMap<String, Double> relativeFreqMap = new HashMap<String, Double>(); long totalFreq = 0; //Find total frequency by adding all frequencies together. for (Entry<String, Integer> entry : freqMap.entrySet()) { totalFreq += entry.getValue(); } //Find relative frequency of all letters. for (Entry<String, Integer> entry : freqMap.entrySet()) { double relativeFreq = (double)entry.getValue() / (double)totalFreq; relativeFreqMap.put(entry.getKey(), relativeFreq); } return relativeFreqMap; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int[] buildFrequencyTable(String s)\n{\n int[] table = new int [Character.getNumericValue('z') - Character.getNumericValue('a') + 1];\n for (char c : s.toCharArray())\n {\n int x = getCharNumber(c);\n if (x != -1) table[x]++;\n }\n return table;\n}", "public static Map<Character,Integer> countFreq(String string){\n\n\n\n Map<Character,Integer> results = new HashMap<Character,Integer>();\n for (int i = 0; i < string.length(); i++) {\n Character temp = string.charAt(i);\n Integer count;\n// System.out.println(temp);\n if (results.containsKey(temp)){\n count=results.get(temp);\n count++;\n results.replace(temp,count);\n }\n else\n results.put(temp,1);\n\n }\n\n return results;\n }", "private static HashMap<String, Double> ComputeRelativeFrequencyLetters(String text) {\n\tlong length = text.length();\n\tHashMap<String, Integer> freqMap = new HashMap<String, Integer>();\n\n\t//Search through the string and count each character.\n\tfor (int i = 0; i < length; i++) {\n\t char character = text.charAt(i);\n\n\t if ((character >= 'A' && character <= 'Z'))\n\t {\n\t\tint freq;\n\t\t//If we haven't seen this character yet, frequency is 1, otherwise, increment it.\n\t\tif (freqMap.get(Character.toString(character)) == null) {\n\t\t freq = 1;\n\t\t}\n\t\telse {\n\t\t freq = freqMap.get(Character.toString(character)) + 1;\n\t\t}\n\t\tfreqMap.put(Character.toString(character), freq);\n\t }\n\t}\n\n\tHashMap<String, Double> relativeFreqMap = new HashMap<String, Double>();\n\tlong totalFreq = 0;\n\n\t//Find total frequency by adding all frequencies together.\n\tfor (Entry<String, Integer> entry : freqMap.entrySet()) {\n\t totalFreq += entry.getValue();\n\t}\n\n\t//Find relative frequency of all letters.\n\tfor (Entry<String, Integer> entry : freqMap.entrySet()) {\n\t double relativeFreq = (double)entry.getValue() / (double)totalFreq;\n\t relativeFreqMap.put(entry.getKey(), relativeFreq);\n\t}\n\n\treturn relativeFreqMap;\n }", "public static void main(String[] args) {\n String res= freqAlphabets( \"10#11#12\");\n System.out.println(res);\n }", "public String frequencySort(String s) {\n\n\t\t// prepare a frequency map\n\t\tMap<Character, Integer> m = new HashMap<Character, Integer>();\n\t\tfor (char c : s.toCharArray())\n\t\t\tm.put(c, m.getOrDefault(c, 0) + 1);\n\n\t\tPriorityQueue<CKEntry1> pq = new PriorityQueue<>();\n\t\tfor (Entry<Character, Integer> e : m.entrySet()) {\n\t\t\tpq.add(new CKEntry1(e.getKey(), e.getValue()));\n\t\t}\n\t\t\n\t\t// prepare the output now\n\t\tStringBuilder sb = new StringBuilder();\n\t\twhile(!pq.isEmpty()) {\n\t\t\tCKEntry1 temp = pq.poll();\n\t\t\tchar[] tempC = new char[temp.count];\n\t\t\tArrays.fill(tempC, temp.c); // repeat c count' times\n\t\t\tsb.append(tempC);\n\t\t}\n\t\t\n\t\treturn sb.toString();\n\n\t}", "public Set<Integer> computeSuffixTreeEdges(final String text) {\n final Set<Integer> result = new LinkedHashSet();\n // Implement this function yourself\n final Node root = buildTree(patterns);\n final int length = text.length();\n for (int idx = 0; idx < length; idx++) {\n computeSuffixTree(text, idx, idx, root, result);\n }\n return result;\n }", "private Map<Character, Integer> getFreqs(String input) {\n\t\tMap<Character, Integer> freqMap = new HashMap<>();\n\t\tfor (char c : input.toCharArray()) {\n\t\t\tif (freqMap.containsKey(c)) {\n\t\t\t\tfreqMap.put(c, freqMap.get(c) + 1);\n\t\t\t} else {\n\t\t\t\tfreqMap.put(c, 1);\n\t\t\t}\n\t\t}\n\t\treturn freqMap;\n\t}", "public static int frequency(String str, char ch){\n//will return frequency of char from the string\n int count = 0; //to save the frequency of char\n/*each character is a char : and need to compare it with str.\nevery time it matches we add frequency to count*/\n\n for(char each : str.toCharArray() ){\n if(each == ch){//every time this is true, count will increase to 1\n count++;\n }\n }\n //return the frequency of one character from the string\n return count;\n }", "private void traverseLine(String str) {\n\t\tFrequencyCount f ;\r\n\t\tint prev = 0;\r\n\t\tString docid = \"\";\r\n\t\tint flag = 0,flag1 = 0;\r\n\t\tfor(int k = 0;k<str.length();k++)\r\n\t\t{\r\n\t\t\t//System.out.print(str.charAt(k));\r\n\t\t\tif(str.charAt(k) == ':'){\r\n\t\t\t\tflag = 1;k++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(flag == 1){\r\n\t\t\t\tint indexid;\r\n\t\t\t\tif(flag1 == 0){\r\n\t\t\t\t\tcounter = \"\";\r\n\t\t\t\t\tindexid = str.indexOf(':', k);\r\n\t\t\t\t\tcounter = str.substring(k, indexid);\r\n\t\t\t\t\tk = indexid+1;\r\n\t\t\t\t\tflag1 = 1;\r\n\t\t\t\t}\r\n\t\t\t\tindexid = str.indexOf('#', k);\r\n\t\t\t\tdocid = String.valueOf(Integer.parseInt(str.substring(k, indexid))+prev);\r\n\t\t\t\tprev = Integer.parseInt(docid);\r\n\t\t\t\t\r\n\t\t\t\tf = new FrequencyCount(docid);\r\n\t\t\t\tk = indexid+1;\r\n\t\t\t\twhile(str.charAt(k) != '|'){\r\n\t\t\t\t\tif(k+1 == str.length()){\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(str.charAt(k) == '#') {k++;continue;}\r\n\t\t\t\t\tint flagop = 0;\r\n\t\t\t\t\t\r\n\t\t\t\t\tswitch(str.charAt(k)){\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tcase 't' : flagop = 1;\r\n\t\t\t\t\t\t\t\t\t break;\r\n\t\t\t\t\t\tcase 'i' : flagop = 2;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 'b' : flagop = 3;\r\n\t\t\t\t \t\t \t\t\tbreak;\r\n\t\t\t\t\t\tcase 'r' : flagop = 6;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 'L' : flagop = 5;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 'c' : flagop = 4;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 'l' : flagop = 7;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault : flagop = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(flagop != 0){\r\n\t\t\t\t\t\tindexid = Math.min(str.indexOf('#', k), str.indexOf('|', k));\r\n\t\t\t\t\t\tif(indexid == -1){\r\n\t\t\t\t\t\t\tindexid = str.indexOf('|', k);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\tint count = Integer.parseInt(str.substring(k+1, indexid));\r\n\t\t\t\t\t\t//System.out.print(count +\" \");\r\n\t\t\t\t\t\tfor(int j = 0;j<count;j++)\r\n\t\t\t\t\t\t\tf.incrementCounter(flagop);\r\n\t\t\t\t\t\tk = indexid;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcatch(Exception e){e.printStackTrace();\r\n\t\t\t\t\t\t\tSystem.out.println(\"EXCEPTION : \"+e.getMessage());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfc.add(f);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tword = word+str.charAt(k);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}", "static int sherlockAndAnagrams(String s) {\n int total = 0;\n for (int width = 1; width <= s.length() - 1; width++) {\n\n for(int k = 0 ;k <= s.length() - width; k++){\n\n String sub = s.substring(k, k + width);\n\n int[] subFreq = frequenciesOf(sub);\n for (int j = k + 1; j <= s.length() - width; j++) {\n String target = s.substring(j, j + width);\n if (areAnagrams(subFreq,frequenciesOf(target))) total = total + 1;\n }\n }\n }\n return total;\n }", "private Map<Character, Double> getStrFrequencyTable(String str) {\n str = str.toLowerCase(Locale.ENGLISH);\n\n Map<Character, Double> frequencyTable = new HashMap<>(26);\n int[] countArr = countLetters(str);\n int numOfLetters = Arrays.stream(countArr).sum();\n\n for (char alphabet = 'a'; alphabet <= 'z'; alphabet++) {\n double frequency = 0.0;\n if (numOfLetters != 0) {\n frequency = countArr[alphabet-'a'] / (double) numOfLetters;\n }\n frequencyTable.put(alphabet, frequency);\n }\n\n return frequencyTable;\n }", "public int fs(String s) {\n char min = 'z', current;\n int frequency = 0;\n for (int i = 0; i < s.length(); i++){\n current = s.charAt(i);\n if (current < min) {\n min = current;\n frequency = 1;\n } else if (current == min) frequency++;\n }\n return frequency;\n }", "public static String[] digraphGenerator(String str)\n\t{\n\t\tString plainText = str.replaceAll(\"\\\\s+\",\"\"); // removes spaces\n\t\tint c1 = 0;\n\t\tint c2 = 1;\n\t\twhile( c2 > -6 )\n\t\t{\n\t\t\tif (plainText.charAt(c1) == plainText.charAt(c2))\n\t\t\t{\n\t\t\t\tplainText = plainText.substring(0, c2) + \"q\" + plainText.substring(c2, plainText.length());\n\t\t\t\tc1-=2;\n\t\t\t\tc2-=2;\n\t\t\t}\n\t\t\tc1+=2;\n\t\t\tc2+=2;\n\t\t\tif (c2 >= plainText.length())\n\t\t\t{\n\t\t\t\tif (plainText.length() % 2 == 1)\n\t\t\t\t{\n\t\t\t\t\tplainText += \"q\";\n\t\t\t\t}\n\t\t\t\tString[] blockArray = plainText.split(String.format(\"(?<=\\\\G.{%1$d})\", 2)); // splits the string into groups of 2\n\t\t\t\treturn blockArray;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public static double daleChall(String text){\n\t\tint complexWords = 0;\n\t\tint wordCount = 0;\n\t\tint sentenceCount = 0;\n\t\tDocument doc = new Document(text);\n\t\tfor(Sentence sent : doc.sentences()) {\n\t\t\tsentenceCount++;\n\t\t\tfor(String word : sent.words()) {\n\t\t\t\tif(word!=\".\" && word!= \",\" && word!=\";\" && word!=\":\") {\n\t\t\t\t\n\t\t\t\t\twordCount++;\n\t\t\t\tif(!binarySearch(word)) {\n\t\t\t\t\tcomplexWords++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\treturn daleChallCalculator(complexWords, wordCount, sentenceCount);\n\t}", "private static String frequencySort(String s) {\n if (s == null || s.isEmpty()) { return s; }\n\n int[] freq = new int[256];\n for (char c : s.toCharArray()) {\n freq[c]++;\n }\n\n PriorityQueue<Pair<Character, Integer>> pq = new PriorityQueue<>((a, b) -> b.getValue() - a.getValue());\n for (int i = 0; i < freq.length; i++) {\n if (freq[i] == 0) { continue; }\n Pair<Character, Integer> pair = new Pair<>((char) (i), freq[i]);\n pq.offer(pair);\n }\n\n StringBuilder sb = new StringBuilder();\n while (!pq.isEmpty()) {\n Pair<Character, Integer> pair = pq.poll();\n for (int i = 0; i < pair.getValue(); i++) {\n sb.append(pair.getKey());\n }\n }\n return sb.toString();\n }", "public static FreqChar exe2(String text) {\n FreqChar freqChar = new FreqChar();\n Map<Character, Integer> cFreq = new HashMap<>();\n for (Character c : text.toCharArray()) {\n cFreq.put(c, cFreq.getOrDefault(c, 0)+1);\n }\n\n int max = 0;\n for (Character c : cFreq.keySet()) {\n if (cFreq.get(c) > max) {\n max = cFreq.get(c);\n freqChar.setC(c);\n freqChar.setFreq(max);\n }\n\n }\n return freqChar;\n }", "public static void main(String[] args) {\n\t\tString str=\"aabcccccaaaa\";\n\t\tString str2=\"\";\n\t\tint freq=1;\n\t\tfor(int i=0;i<str.length()-1;i++){\n\t\t\tif(str.charAt(i)==str.charAt(i+1)){\n\t\t\t\tfreq++;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstr2=str2+str.charAt(i)+freq;\n\t\t\t\tfreq=1;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(str2+str.charAt(str.length()-1)+freq);\n\t}", "@Override //old methd for letter count\n public Integer letterCount(String inputString) {\n char[] characterArray = inputString.toCharArray();\n Map<Character, Integer> wordFrequencyMap = new HashMap<Character, Integer>();\n\n for (char character : characterArray) {\n if (wordFrequencyMap.containsKey(character)) {\n\n Integer wordCount = (Integer) wordFrequencyMap.get(character);\n wordFrequencyMap.put(character, wordCount + 1);\n\n } else {\n wordFrequencyMap.put(character, 1);\n\n }\n }\n return null; //iterateWordCount(wordFrequencyMap);\n }", "static void codonfreq(String s) {\n int[] fromNuc = new int[128];\r\n for (int i = 0; i < fromNuc.length; i++)\r\n fromNuc[i] = -1;\r\n fromNuc['a'] = fromNuc['A'] = 0;\r\n fromNuc['c'] = fromNuc['C'] = 1;\r\n fromNuc['g'] = fromNuc['G'] = 2;\r\n fromNuc['t'] = fromNuc['T'] = 3;\r\n // Count frequencies of codons (triples of nucleotides)\r\n int[][][] freq = new int[4][4][4];\r\n for (int i = 0; i + 2 < s.length(); i += 3) {\r\n int nuc1 = fromNuc[s.charAt(i)];\r\n int nuc2 = fromNuc[s.charAt(i + 1)];\r\n int nuc3 = fromNuc[s.charAt(i + 2)];\r\n freq[nuc1][nuc2][nuc3] += 1;\r\n }\r\n // The translation from index 0123 to nucleotide ACGT\r\n final char[] toNuc = {'A', 'C', 'G', 'T'};\r\n for (int i = 0; i < 4; i++)\r\n for (int j = 0; j < 4; j++) {\r\n for (int k = 0; k < 4; k++)\r\n System.out.print(\" \" + toNuc[i] + toNuc[j] + toNuc[k]\r\n + \": \" + freq[i][j][k]);\r\n System.out.println();\r\n }\r\n }", "java.lang.String getFrequency();", "static int sherlockAndAnagrams(String s){\n // Complete this function\n ArrayList<String> substringArray = new ArrayList<>();\n for(int i=0;i<s.length();i++){\n for(int j=i+1;j<s.length()+1;j++){\n substringArray.add(s.substring(i,j));\n }\n }\n int count = countAnagrams(substringArray);\n return count;\n }", "public void charFrequencyCount(Scanner s) {\n\t\twhile (s.hasNextLine()) { /* keep scanning while there is info in the\n\t\t\t\t\t\t\t\t * file\n\t\t\t\t\t\t\t\t * */ \n\t\t\tchar[] curLine = s.nextLine().toCharArray();\n\t\t\tfileData.add(curLine); // save the data for later\n\n\t\t\t/*\n\t\t\t * Go through the line curRent line and count the characters\n\t\t\t */\n\t\t\tfor (int i = 0; i < curLine.length; i++) {\n\t\t\t\tfrequencyCount[curLine[i]]++;\n\t\t\t}\n\t\t\tfrequencyCount[10]++; // add a new line!\n\t\t}\n\t\t/*\n\t\t * There is always one extra newline so take one away to re-balance it.\n\t\t */\n\t\tfrequencyCount[10]--;\n\t}", "void countCharByCategory(String inputstr) {\n\n\t\tint digitcount = 0;\n\t\tint lowercasecount = 0;\n\t\tint uppercasecount = 0;\n\t\tint specialcharcount = 0;\n\n\t\tfor (int i = 0; i < inputstr.length(); i++) {\n\n\t\t\tif (Character.isLowerCase(inputstr.charAt(i)))\n\t\t\t\tlowercasecount++;\n\t\t\telse if (Character.isUpperCase(inputstr.charAt(i)))\n\t\t\t\tuppercasecount++;\n\n\t\t\telse if (Character.isDigit(inputstr.charAt(i)))\n\t\t\t\tdigitcount++;\n\t\t\telse\n\t\t\t\tspecialcharcount++;\n\t\t}\n\t\tSystem.out.println(\"Total Digits: \" + digitcount + \"\\nTotal letters: \" + (lowercasecount+uppercasecount) + \"\\nTotal Uppercase: \"\n\t\t\t\t+ uppercasecount + \"\\nTotal lowercase: \" + lowercasecount + \"\\nTotal Special character: \"\n\t\t\t\t+ specialcharcount);\n\n\t}", "public double scoreText(CharSequence text) {\n NGramTokenizer tokenizer = new NGramTokenizer(text, min, max);\n double tot = 0;\n for (CharSequence charSequence : tokenizer) {\n double s = scoreGram(charSequence);\n if (theLogger.isDebugEnabled()) {\n theLogger.debug(charSequence + \" scores \" + s);\n }\n tot += s;\n }\n double score = tot / Math.log(gramcount);\n if (theLogger.isDebugEnabled()) {\n theLogger.debug(text + \", total \" + tot + \"/\" + Math.log(gramcount) + \"=\" + score);\n }\n return score;\n }", "@Override\n public Dimension measureText(String text) {\n return graphicsEnvironmentImpl.measureText(canvas, text);\n }", "public static void getOccuringChar(String inPutString) {\n HashMap<Character, Integer> charCountMap = new HashMap<Character, Integer>();\n /* converting given string to char Array*/\n char[] strArray = inPutString.toCharArray();\n /*Checking each char in strArray*/\n for (char c : strArray) {\n if (charCountMap.containsKey(c)) {\n //If char 'c' is present in charCountMap, incrementing it's count by 1\n charCountMap.put(c, charCountMap.get(c) + 1);\n } else {\n /*If char 'c' is not present in charCountMap,putting 'c' into charCountMap with 1 as it's value\n */\n charCountMap.put(c, 1);\n }\n }\n /*Printing input String*/\n System.out.println(\"The frequency of Character is \" + charCountMap);\n }", "public String countOfAtoms(String formula) {\n TreeMap<String, Integer> map = new TreeMap<>();\n Stack<TreeMap<String, Integer>> stack = new Stack<>();\n stack.push(map);\n map = new TreeMap<>();\n StringBuilder sb = new StringBuilder();\n int num = 0;\n for (char c : formula.toCharArray()) {\n if (Character.isDigit(c)) {\n num = num * 10 + c - '0';\n }\n else if (Character.isLowerCase(c)) {\n sb.append(c);\n }\n else {\n num = num == 0 ? 1 : num;\n if (sb.length() == 0 && map.size() > 0) {\n for (String key : map.keySet()) {\n stack.peek().put(key, stack.peek().getOrDefault(key, 0) + map.get(key) * num);\n }\n map = new TreeMap<>();\n }\n else if (sb.length() > 0) {\n String s = sb.toString();\n stack.peek().put(s, stack.peek().getOrDefault(s, 0) + num);\n }\n if (c == '(') {\n stack.push(map);\n map = new TreeMap<>();\n }\n else if (c == ')') {\n map = stack.pop();\n }\n num = 0;\n sb = new StringBuilder();\n if (Character.isUpperCase(c)) {\n sb.append(c);\n }\n }\n }\n num = num == 0 ? 1 : num;\n if (sb.length() == 0) {\n for (String key : map.keySet()) {\n stack.peek().put(key, stack.peek().getOrDefault(key, 0) + map.get(key) * num);\n }\n }\n else {\n String s = sb.toString();\n stack.peek().put(s, stack.peek().getOrDefault(s, 0) + num);\n }\n sb = new StringBuilder();\n map = stack.pop();\n for (String s : map.keySet()) {\n sb.append(s);\n if (map.get(s) != 1) {\n sb.append(map.get(s));\n }\n }\n return sb.toString();\n }", "public int countDoubleDigits() {\r\n StringBuilder temp = new StringBuilder(string);\r\n int count = 0;\r\n\r\n //This for loop replaces all non-digits with '0', and all digits with '1'.\r\n for (int i = 0; i < string.length(); i++) {\r\n if (Character.isDigit(temp.charAt(i))) {\r\n temp.setCharAt(i, '1');\r\n } else {\r\n temp.setCharAt(i, '0');\r\n }\r\n }\r\n String tempString = temp.toString();\r\n\r\n //replaces double digits with '2'\r\n tempString = tempString.replace(\"0110\", \"2\");\r\n tempString = tempString.replace(\"2110\", \"22\");\r\n tempString = tempString.replace(\"2112\", \"222\");\r\n\r\n //for each '2' add 1 to count\r\n for (int j = 0; j < tempString.length(); j++) {\r\n if (tempString.charAt(j) == '2') {\r\n count+= 1;\r\n }\r\n }\r\n //check if there are double digits at the beginning or end\r\n if (tempString.startsWith(\"110\")) {\r\n count+= 1;\r\n }\r\n if (tempString.endsWith(\"011\")) {\r\n count+= 1;\r\n }\r\n //check if the string is just one double digit\r\n if (tempString.equals(\"11\")) {\r\n return 1;\r\n }\r\n\r\n return count;\r\n }", "public HuffmanCoding(String text) {\n\t\t// TODO fill this in.\n\t\ttextArray = text.toCharArray();\n\n\t\tPriorityQueue<Leaf> queue = new PriorityQueue<>(new Comparator<Leaf>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Leaf a, Leaf b) {\n\t\t\t\tif (a.frequency > b.frequency) {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else if (a.frequency < b.frequency) {\n\t\t\t\t\treturn -1;\n\t\t\t\t} else {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tfor (char c : textArray) {\n\t\t\tif (chars.containsKey(c)) {\n\t\t\t\tint freq = chars.get(c);\n\t\t\t\tfreq = freq + 1;\n\t\t\t\tchars.remove(c);\n\t\t\t\tchars.put(c, freq);\n\t\t\t} else {\n\t\t\t\tchars.put(c, 1);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"tree print\");\t\t\t\t\t\t\t\t// print method begin\n\n\t\tfor(char c : chars.keySet()){\n\t\t\tint freq = chars.get(c);\n\t\t\tSystem.out.println(c + \" \" + freq);\n\t\t}\n\n\t\tint total = 0;\n\t\tfor(char c : chars.keySet()){\n\t\t\ttotal = total + chars.get(c);\n\t\t}\n\t\tSystem.out.println(\"total \" + total);\t\t\t\t\t\t\t// ends\n\n\t\tfor (char c : chars.keySet()) {\n\t\t\tLeaf l = new Leaf(c, chars.get(c), null, null);\n\t\t\tqueue.offer(l);\n\t\t}\n\n\t\twhile (queue.size() > 1) {\n\t\t\tLeaf a = queue.poll();\n\t\t\tLeaf b = queue.poll();\n\n\t\t\tint frequency = a.frequency + b.frequency;\n\n\t\t\tLeaf leaf = new Leaf('\\0', frequency, a, b);\n\n\t\t\tqueue.offer(leaf);\n\t\t}\n\n\t\tif(queue.size() == 1){\n\t\t\tthis.root = queue.peek();\n\t\t}\n\t}", "public static int calculateTotalChars(String[] text) {\n int totalChars = 0;\n for (String str : text) {\n totalChars += str.length();\n totalChars++;\n }\n totalChars--;\n return totalChars;\n }", "public Map<String, Integer> wordCount(String string) {\n\t\t// TODO Write an implementation for this method declaration\n\t\tString foundword = \"\";\n\t\tstring = string.replaceAll(\"\\n\",\"\");\n\t\tMap<String, Integer> WordCountMap = new HashMap<>();\n\t\tList<String> stringList = new ArrayList<String>();\n\t\tfor(int i = 0; i < string.length(); i++) {\n\t\t\t//System.out.println(string.charAt(i));\n\t\t\t\n\t\t\tif(string.charAt(i) == ' ') {\n\t\t\t\tstringList.add(foundword);\n\t\t\t\tfoundword = \"\";\n\t\t\t}\n\t\t\telse if(string.charAt(i) == ',') {\n\t\t\t\tstringList.add(foundword);\n\t\t\t\tfoundword = \"\";\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\tfoundword = foundword + string.charAt(i);\n\t\t\t}\n\n\t\t}\n\t\t\n\t\tstringList.add(foundword);\n\t\t\n\t\tfor(String name: stringList) {\n\t\t\tif(WordCountMap.containsKey(name)) {\n\t\t\t\t//The frequencyMap already contains the count for this name;\n\t\t\t\t//So we want to increase that count by 1\n\t\t\t\tint currentCount = WordCountMap.get(name);\n\t\t\t\tWordCountMap.put(name, currentCount+1);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tWordCountMap.put(name, 1); //Track the name with a count of 1 if we haven't seen it before\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\treturn WordCountMap;\n\t}", "public int getWidth(CharSequence text) {\r\n\t\tint width = 0, lineWidth = 0;\r\n\t\t\r\n\t\tfor (int i = 0; i < text.length(); i++) {\r\n\t\t\tchar character = text.charAt(i);\r\n\t\t\t\r\n\t\t\tif (character == '\\n') { // New line\r\n\t\t\t\twidth = Math.max(width, lineWidth);\r\n\t\t\t\tlineWidth = 0;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Ignore carriage returns\r\n\t\t\tif (character == '\\r') continue;\r\n\t\t\t\r\n\t\t\tGlyph glyph = glyphs.get(character);\r\n\t\t\tif (glyph == null) continue;\r\n\t\t\t\r\n\t\t\tlineWidth += glyph.getWidth();\r\n\t\t}\r\n\t\t\r\n\t\twidth = Math.max(width, lineWidth);\r\n\t\treturn width;\r\n\t}", "public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n System.out.println(\"Enter a word:\");\n String word = scan.next();\n System.out.println(\"Enter character:\");\n char character = scan.next().charAt(0);\n\n int count=0; //count frequency of character\n for (int i =0; i<word.length(); i++) {\n char each = word.charAt(i); //each character by given string word\n\n if (each == character) { //if each character in str is matching with ch\n count++; //count increase the frequency of ch by 1\n\n }\n }\n System.out.println(count);\n\n System.out.println(\"===========================\");\n\n\n\n }", "private static void scanString(String s){\n\t\t\n\t\tint product = 0;\n\t\tboolean firstToken = true; // used for adjusting product starting value\n\t\tint sum = 0;\n\t\t\n\t\t// Gather tokens\n\t\tScanningIterator iterator = new ScanningIterator(s);\n\t\tSystem.out.println(\"Tokens:\");\n\t\twhile (iterator.hasNext()){\n\t\t\n\t\t\tString token = iterator.next();\n\t\t\t\n\t\t\t// Check if invalid\n\t\t\tboolean valid = true;\n\t\t\tfor (int i = 0; i < token.length(); ++i){\n\t\t\t\tif (!Character.isDigit(token.charAt(i))){\n\t\t\t\t\tvalid = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!valid){\n\t\t\t\tSystem.out.println(\"Invalid token: \" + token);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(token);\n\t\t\t\n\t\t\t// Update counts. Product needs to be set to 1 if this is the first token\n\t\t\t// so that things can be multiplied into it.\n\t\t\tif (firstToken){\n\t\t\t\tproduct = 1;\n\t\t\t\tfirstToken = false;\n\t\t\t}\n\t\t\tproduct *= Integer.parseInt(token);\n\t\t\tsum += Integer.parseInt(token);\n\t\t\t\n\t\t}//end gathering tokens\n\t\t\n\t\tSystem.out.println(\"Sum: \" + sum);\n\t\tSystem.out.println(\"Product: \" + product);\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tString s1=\"Hi Hello\";\n\t\tfrequent(s1);\n//\t\tchar ch[] = s1.toCharArray();\n//\t\tchar ch1;\n//\t\tchar ch2[]=new char[10];\n//\t\t\n//\t\tfor(int i=0;i<ch.length;i++) {\n//\t\t\tSystem.out.println(ch[i]);\n//\t\t}\n//\t\t\n//\t\tfor(int i=0;i<ch.length;i++) {\n//\t\t\t\n//\t\t\tint count=1;\n//\t\t\tfor(int j=i+1;j<ch.length;j++) {\n//\t\t\t\t\n//\t\t\t\tif(ch[i]==ch[j]) {\n//\t\t\t\t\t\n//\t\t\t\t\tcount++;\n//\t\t\t\t}\n//\t\t\t\t\n//\t\t\t}System.out.println(\"Count of \"+ch[i]+\"=\"+count);\n//\t\t}\n\t\t\n\t\t\n\t\n\n\t}", "static long substrCount(int n, String s) {\n ArrayList<Point> points = new ArrayList<>();\n\n char current = s.charAt(0);\n int count = 1;\n\n for (int i = 1; i < s.length(); i++) {\n char ch = s.charAt(i);\n if (current == ch) {\n count++;\n } else {\n points.add(new Point(current, count));\n current = ch;\n count = 1;\n }\n }\n points.add(new Point(current, count));\n\n count = 0;\n if (points.size() > 2) {\n\n count += addup(points.get(0).count);\n\n for (int i = 1; i < points.size() - 1; i++) {\n Point prev = points.get(i - 1);\n Point curr = points.get(i);\n Point next = points.get(i + 1);\n\n\n count += addup(curr.count);\n\n if (prev.ch == next.ch && curr.count == 1) {\n int min = Math.min(prev.count, next.count);\n count += min;\n }\n }\n\n count += addup(points.get(points.size() - 1).count);\n\n } else if (points.size() == 1) {\n Point curr = points.get(0);\n count += addup(curr.count);\n } else if (points.size() == 2) {\n Point prev = points.get(0);\n count += addup(prev.count);\n Point next = points.get(1);\n count += addup(next.count);\n }\n\n\n System.out.println(points);\n\n return count;\n\n }", "public static float similarity(String str) {\n\t\t/*Set<Character> distinct = symbols(str);\n\t\tif (distinct.size() != str.length()) {\n\t\t\tstr = \"\";\n\t\t\tfor (Character ch : distinct) str += ch;\n\t\t}*/\n\t\tMap<Character, Float> bySymbol = new HashMap<Character, Float>(); \n\t\tfloat sum = 0;\n\t\tfor (int i=0; i<str.length()-1; i++) {\n\t\t\tfor (int j=i+1; j<str.length(); j++) {\n\t\t\t\tchar ch1 = str.charAt(i);\n\t\t\t\tchar ch2 = str.charAt(j);\n\t\t\t\tString bigram = \"\"+ch1+ch2;\n\t\t\t\tFloat val = Ciphers.cosineSimilaritiesMap.get(bigram);\n\t\t\t\tif (val == null) val = 0f;\n\t\t\t\t//System.out.println(bigram+\": \" + val);\n\t\t\t\tsum += val;\n\t\t\t\t\n\t\t\t\tFloat val2 = bySymbol.get(ch1);\n\t\t\t\tif (val2 == null) val2 = 0f;\n\t\t\t\tval2 += val;\n\t\t\t\tbySymbol.put(ch1, val2);\n\t\t\t\t\n\t\t\t\tval2 = bySymbol.get(ch2);\n\t\t\t\tif (val2 == null) val2 = 0f;\n\t\t\t\tval2 += val;\n\t\t\t\tbySymbol.put(ch2, val2);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//for (Character ch : bySymbol.keySet()) System.out.println(\"Sum for symbol [\" + ch + \"]: \" + bySymbol.get(ch));\n\t\treturn sum;\n\t}", "public int doCount(String s){\r\n\t\tint count = 0;\r\n\t\tint i;\r\n\t\tfor(i = 0; i < s.length(); i++){\r\n\t\t\tif ( s.charAt(i) == Letter )\r\n\t\t\t\tcount++;\r\n\t\t}\r\n\t\t\r\n\t\treturn count;\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n HashMap<Character, Integer> finalChar = new HashMap<>();\n int charCount = 1;\n\n String str = \"If the product of two terms is zero then common sense says at least one of the two terms has to be zero to start with. \" +\n \"So if you move all the terms over to one side, \" +\n \"you can put the quadratics into a form that can be factored allowing that side of the equation to equal zero. \" +\n \"Once you’ve done that, it’s pretty straightforward from there.\";\n\n // convert String to char[] array\n char[] charInString = str.toCharArray();\n\n // iterate over charInString[] array using enhanced for loop\n for (char charName : charInString) {\n\n if (finalChar.containsKey(charName)) {\n finalChar.put(charName, finalChar.get(charName) + 1);\n } else {\n finalChar.put(charName, 1);\n }\n\n }\n System.out.println(finalChar);\n }", "static int sherlockAndAnagrams(String s) {\n int anagramCount = 0;\n Map<String, Integer> map = new HashMap<>();\n for (int i = 0; i < s.length(); i++) {\n for (int k = i + 1; k <= s.length(); k++) {\n String sub = s.substring(i, k);\n System.out.println(sub);\n sub = new String(sort(sub.toCharArray()));\n int value = map.getOrDefault(sub, 0);\n if(value > 0) {\n anagramCount = anagramCount + value;\n }\n map.put(sub, value+1);\n\n }\n }\n return anagramCount;\n }", "private static void charCount(String str) {\n\t\t\n\t\tHashMap<Character, Integer> mp = new HashMap<Character, Integer>();\n\t\t\n\t\tchar[] cr=str.toCharArray();\n\t\t\n\t\tSystem.out.println(cr);\n\t\t\n\t\tfor(char c: cr) {\n\t\t\t\n\t\t\tif(mp.containsKey(c)) {\n\t\t\t\tmp.put(c, mp.get(c)+1);\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\tmp.put(c, 1);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(Map.Entry<Character, Integer> ent: mp.entrySet()) {\n\t\t\tSystem.out.println(ent.getKey() + \" \" + ent.getValue());\n\t\t}\n\t\t\n\t}", "public static ArrayList<Integer> findAnagrams(String s, String p) {\r\n\t \t \r\n\t \t //write your code here\r\n\t\t if(s.length()<p.length()) {\r\n\t\t\t ArrayList<Integer> arr = new ArrayList<>();\r\n\t\t\t return arr;\r\n\t\t }\r\n\t\t ArrayList<Integer> result = new ArrayList<>();\r\n\t\t HashMap<Character,Integer> P = new HashMap<>();\r\n\t\t HashMap<Character,Integer> H = new HashMap<>();\r\n\t\t \r\n\t\t for(int i=0;i<p.length();i++) {\r\n\t\t\t char ch = p.charAt(i);\r\n\t\t\t if(!P.containsKey(ch)) {\r\n\t\t\t\t P.put(ch,1);\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t P.put(ch,P.get(ch)+1);\r\n\t\t\t }\r\n\t\t }\r\n\t\t int start =0;\r\n\t\t int end=0;\r\n\t\t int mcount=0;\r\n\t\t for(int i=0;i<p.length();i++) {\r\n\t\t\t char ch = s.charAt(i);\r\n\t\t\t if(!H.containsKey(ch)) {\r\n\t\t\t\t H.put(ch,1);\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t H.put(ch,H.get(ch)+1);\r\n\t\t\t }\r\n\t\t\t if(P.containsKey(ch)) {\r\n\t\t\t\t if(P.get(ch)>=H.get(ch)) {\r\n\t\t\t\t\t mcount++;\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t\t end=i;\r\n\t\t }\r\n\t\t if(mcount==p.length()) {\r\n\t\t\t result.add(start);\r\n\t\t }\r\n\t\t while(end<s.length()-1) {\r\n\t\t\t char ch=s.charAt(start);\r\n\t\t\t int hfreq = H.get(ch)-1;\r\n\t\t\t H.put(ch,hfreq);\r\n\t\t\t if(H.get(ch)==0) {\r\n\t\t\t\t H.remove(ch);\r\n\t\t\t }\r\n\t\t\t int pfreq=0;\r\n\t\t\t if(P.containsKey(ch)) {\r\n\t\t\t\t pfreq=P.get(ch);\r\n\t\t\t }\r\n\t\t\t if(hfreq<pfreq) {\r\n\t\t\t\t mcount--;\r\n\t\t\t }\r\n\t\t\t ch=s.charAt(end+1);\r\n\t\t\t int hfreqend=0;\r\n\t\t\t if(H.containsKey(ch)) {\r\n\t\t\t\t hfreqend = H.get(ch);\r\n\t\t\t }\r\n\t\t\t hfreqend++;\r\n\t\t\t H.put(ch, hfreqend);\r\n\t\t\t int pfreqend=0;\r\n\t\t\t if(P.containsKey(ch)) {\r\n\t\t\t\t pfreqend = P.get(ch);\r\n\t\t\t }\r\n\t\t\t if(hfreqend<=pfreqend) {\r\n\t\t\t\t mcount++;\r\n\t\t\t }\r\n\t\t\t start++;\r\n\t\t\t end++;\r\n\t\t\t if(mcount==p.length()) {\r\n\t\t\t\t result.add(start);\r\n\t\t\t }\r\n\t\t\t \r\n\t\t }\r\n\t\t return result;\r\n\t\t \r\n\t \t \r\n\t }", "static int sherlockAndAnagrams(String s) {\n\n // **** initialize count of anagrams ****\n int count = 0;\n\n // **** loop once per grouping of characters [1 : s.length() - 1] ****\n for (int g = 1; g < s.length(); g++) {\n\n // **** generate the base sub string ****\n for (int i = 0; i < s.length() - g; i++) {\n\n // **** starting string ****\n String bs = s.substring(i, i + g);\n\n // **** generate sub strings ****\n for (int j = i + 1; j <= s.length() - g; j++) {\n\n // **** generate current sub string ****\n String cs = s.substring(j, j + g);\n\n // **** check if anagram ****\n if (areAnagram(bs, cs)) {\n count++;\n }\n }\n }\n }\n\n // **** count of anagrams ****\n return count;\n }", "public static float getFontCharWidth(Paint paint, String text) {\r\n Rect bounds = new Rect();\r\n paint.getTextBounds(text, 0, text.length(), bounds);\r\n\r\n return 1.0f * bounds.width() / text.length();\r\n }", "public TagFreq(String stringRepresentation) {\r\n\t\t\r\n\t\tint indexOfFreq = stringRepresentation.lastIndexOf('(') + 1; \r\n\t\t\r\n\t\tthis.tagName =\r\n\t\t\tstringRepresentation.substring(0, indexOfFreq - 2);\r\n\t\tthis.freq =\r\n\t\t\tInteger.parseInt(stringRepresentation.\r\n\t\t\t\t\t\t\t\tsubstring(indexOfFreq,\r\n\t\t\t\t\t\t\t\t\t\t stringRepresentation.length() - 1));\r\n\t}", "public void getOccuringChar() \n\t\t {\n\t\t \tint count[] = new int[MAX_CHAR]; \n\t\t \t \n\t\t int len = str.length(); \n\t\t \n\t\t // Initialize count array index \n\t\t for (int i = 0; i < len; i++) \n\t\t count[str.charAt(i)]++; \n\t\t \n\t\t // Create an array of given String size \n\t\t char ch[] = new char[str.length()]; \n\t\t for (int i = 0; i < len; i++) { \n\t\t ch[i] = str.charAt(i); \n\t\t int find = 0; \n\t\t for (int j = 0; j <= i; j++) { \n\t\t \n\t\t // If any matches found \n\t\t if (str.charAt(i) == ch[j]) \n\t\t find++; \n\t\t } \n\t\t \n\t\t if (find == 1) \n\t\t System.out.println(\"Number of Occurrence of \" + \n\t\t str.charAt(i) + \" is:\" + count[str.charAt(i)]); \n\t\t } \n\t\t }", "static int sherlockAndAnagrams(String s) {\n HashTable hashTable = new HashTable(s.length() * s.length() * 4);\n substrings(s).map(Solution::ordered).forEach(hashTable::insert);\n return substrings(s).map(Solution::ordered).mapToInt(s1 -> {\n hashTable.remove(s1);\n return hashTable.count(s1);\n }).sum();\n }", "public static float getCoincidenceIndex(String text){\r\n\r\n\t\tfloat index = 0;\r\n\t\tint length = text.length();\r\n\t\t// Pour chaque lettre i, on calcul (ni(ni-1))/(n*(n-1))\r\n\t\t// On ajoute le résultat à l'index total pour obtenir la somme globale\r\n\t\tfor (int i = 0; i <= 25; i++) {\r\n\t\t\tchar c = (char) (65 + (i/26)*6 + i);\r\n\t\t\tfloat occur = (float)countOccurrency(text, c);\r\n\t\t\tindex = index + (occur * (occur - 1))/(length * (length - 1)); \r\n\t\t}\r\n\t\treturn index;\r\n\t}", "public int countDistinct(String s) {\n\t\tTrie root = new Trie();\n\t\tint result = 0;\n for (int i = 0; i < s.length(); i++) {\n \tTrie cur = root;\n \tfor (int j = i; j < s.length(); j++) {\n \t\tint idx = s.charAt(j) - 'a';\n \t\tif (cur.arr[idx] == null) {\n \t\t\tresult++;\n \t\t\tcur.arr[idx] = new Trie();\n \t\t}\n \t\tcur = cur.arr[idx];\n \t}\n }\n return result;\n }", "private void RecalculateCharDistribution() {\r\n\t\tMap<Character, Integer> temp = new HashMap<>();\r\n\t\tfor (String s : sameWordLength) {\r\n\t\t\tfor (int i = 0; i < s.length(); i++) {\r\n\r\n\t\t\t\tchar ch = s.charAt(i);\r\n\t\t\t\tif (guessedCharacter.contains(ch)) {\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (!temp.containsKey(ch)) {\r\n\t\t\t\t\t\ttemp.put(ch, 1);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tint t = temp.get(ch) + 1;\r\n\t\t\t\t\t\ttemp.put(ch, t);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcharCount = temp;\r\n\r\n\t}", "public static void main(String[] args) {\n\t\t\t\n\t\t\tString input=\"ABCGRETCABCG\";\n\t\t\tint n = 3;\n\t\t\t\n\t\t\tMap<String,Integer> substrMap=new HashMap<String,Integer>();\n\t\t\t\n\t\t\tfor(int i=0;i+n<=input.length();i++){\n\t\t\t\t\n\t\t\t\tString substr=input.substring(i, i+n);\n\t\t\t\t\n\t\t\t\tint frequency=1;\n\t\t\t\t\n\t\t\t\tif(substrMap.containsKey(substr)){\n\t\t\t\t\t\n\t\t\t\t\tfrequency=substrMap.get(substr);\n\t\t\t\t\tfrequency++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsubstrMap.put(substr, frequency);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println(substrMap.toString());\n\t\t}", "private static float getMaximumWidth(final String text, final Paint paint) {\n float width = 0;\n for (String token : text.split(\"\\n\")) {\n final float textWidth = paint.measureText(token);\n if (textWidth > width) {\n width = textWidth;\n }\n }\n\n return width;\n }", "public int getFrequency(char symbol) {\r\n if(isEmpty()){\r\n throw new ArrayIndexOutOfBoundsException(\"No symbols in table\");\r\n }\r\n else {\r\n Node symbolNode = first;\r\n while(true) {\r\n if(symbolNode.symbol == symbol) {\r\n return symbolNode.frequency;\r\n }\r\n else if(symbolNode.next == null) {\r\n throw new NoSuchElementException(\"Symbol is not in the table\");\r\n }\r\n else {\r\n symbolNode = symbolNode.next;\r\n }\r\n }\r\n }\r\n }", "@Override\n public int getTermFrequency(String term) {\n return 0;\n }", "public static List<Integer> getMaxCharCount(String s, List<List<Integer>> queries) {\n // queries is a n x 2 array where queries[i][0] and queries[i][1] represents x[i] and y[i] for the ith query.\n s = s.toLowerCase();\n int[][] frequencies = new int[s.length()][26];\n frequencies[0][s.charAt(0) - 'a']++;\n for (int i = 1; i < s.length(); i++) {\n System.arraycopy(frequencies[i - 1], 0, frequencies[i], 0, 26);\n frequencies[i][s.charAt(i) - 'a']++;\n }\n\n List<Integer> result = new ArrayList<>(queries.size());\n for (List<Integer> query : queries) {\n int[] diff = query.get(0) == 0? frequencies[query.get(1)]:\n diff(frequencies[query.get(1)], frequencies[query.get(0) - 1]);\n result.add(getMax(s, diff));\n }\n return result;\n }", "public static String countWordsOccurences(String input) {\r\n\t\t\r\n\t\tif(input==null || input.length()==0)\r\n\t\t\treturn \"[]\";\r\n\t\t\r\n\t\tString inputTokens[] = input.split(\" |,|@\");\r\n\t\tHashMap<String,Integer> map = new HashMap<String,Integer>();\r\n\t\tfor(String token: inputTokens){\r\n\t\t\tif(token.length()>0) {\r\n\t\t\t\tif(map.containsKey(token)) {\r\n\t\t\t\t\tmap.put(token, map.get(token)+1);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tmap.put(token,1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tString output = map.entrySet().stream()\r\n\t\t .map(e -> \"{\\\"\" + e.getKey() + \"\\\":\" + e.getValue()+\"}\")\r\n\t\t .collect(Collectors.joining(\",\"));\r\n\t\t\r\n\t\treturn \"[\"+output+\"]\";\r\n\t}", "public int visitCountAtPathString(String pathString) {\r\n\t\tInteger visitCountOut = visitCounts.get(pathString);\r\n\r\n\t\tif (visitCountOut != null)\r\n\t\t\treturn visitCountOut;\r\n\r\n\t\treturn 0;\r\n\t}", "static int sherlockAndAnagrams(String s) {\n int anagramCount = 0;\n HashMap<String, Integer> map = new HashMap<>();\n\n int length = s.length();\n int wordSize = 1;\n while (wordSize != length) {\n for(int i = 0; i <= length-wordSize; i++) {\n char[] charArray = s.substring(i, i+wordSize).toCharArray();\n Arrays.sort(charArray);\n String sortedWord = new String(charArray);\n Integer num = map.get(sortedWord);\n if(num == null)\n map.put(sortedWord, 1);\n else {\n map.put(sortedWord, num+1);\n anagramCount += num;\n }\n }\n wordSize++;\n }\n\n return anagramCount;\n }", "public int countSpecificString(String str)\n\t{\n\t\tif (str == null)\n\t\t\treturn 0;\n\n\t\tstr = str.toLowerCase();\n\t\tNode wizard = this.root; // Temporary node variable.\n\n\t\tfor (int i = 0; i < str.length(); i++)\n\t\t{\n\t\t\tif (!(Character.isLetter(str.charAt(i)))) continue;\n\t\t\tint index = str.charAt(i) - 'a';\n\t\t\t\n\t\t\tif (wizard.children[index] == null) return 0;\n\t\t\twizard = wizard.children[index];\n\t\t}\n\n\t\treturn wizard.count;\n\t}", "public int getFrequency(int height);", "public static int [] countChar(String str) {\n char data [] = str.toCharArray();\n \n int count [] = new int [2];\n \n for (int i = 0; i < data.length; i++) {\n if (data[i] == 'n' || data[i] == 'N')\n count[0]++;\n if (data[i] == 'm' || data[i] == 'M')\n count[1]++;\n }\n return count;\n }", "List<Integer> allAnagrams(String s, String l) {\n\t\t// Write your solution here.\n\t\tList<Integer> result = new ArrayList<Integer>();\n\t\tif (s == null || l == null || s.length() == 0 || l.length() == 0) {\n\t\t\treturn result;\n\t\t}\n\t\tif (s.length() > l.length()) {\n\t\t\treturn result;\n\t\t}\n\t\tMap<Character, Integer> map = countMap(s);\n\t\tint match = 0;\n\t\tfor (int i = 0; i < l.length(); i++) {\n\t\t\tchar temp = l.charAt(i);\n\t\t\tInteger count = map.get(temp);\n\t\t\tif (count != null) {\n\t\t\t\tmap.put(temp, count - 1);\n\n\t\t\t\tif (count == 1) {\n\t\t\t\t\tmatch++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (i >= s.length()) {\n\t\t\t\ttemp = l.charAt(i - s.length());\n\t\t\t\tcount = map.get(temp);\n\t\t\t\tif (count != null) {\n\t\t\t\t\tmap.put(temp, count + 1);\n\t\t\t\t\tif (count == 0) {\n\t\t\t\t\t\tmatch--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (match == map.size()) {\n\t\t\t\tresult.add(i - s.length() + 1);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "public int getNgramFrequency(String ngram) {\n //TODO replace this line with your code\n return -1;\n }", "private void calculateNGrams() {\n\t\t\n\t\t\n\t\t// determine n grams\n\t\tSet<Suffix> cityNames = properties.getCityNames();\n\t\tfor (Suffix cityName : cityNames) {\n\t\t\tString str = cityName.getStr();\n\t\t\tchar[] letters = new char[str.length()+4];\n\t\t\tletters[0] = sow;\n\t\t\tletters[1] = sow;\n\t\t\tletters[letters.length-2] = eow;\n\t\t\tletters[letters.length-1] = eow;\t\t\t\n\t\t\tstr.getChars(0, str.length(), letters, 2);\n\t\t\t\n\t\t\t// iterate over the letters of a city name\n\t\t\tfor (int i=2; i<letters.length; i++) {\n\t\t\t\t// 1: letter distribution (eow's are ignored)\n\t\t\t\tif (i < letters.length - 2) {\n\t\t\t\t\tInteger oldValueLetter = this.letterDistribution.get(letters[i]);\n\t\t\t\t\tif (oldValueLetter == null)\t\t\t\t\t\n\t\t\t\t\t\tthis.letterDistribution.put(letters[i], 1); // add the the new letter to the distribution\n\t\t\t\t\telse\t\t\t\t\t\n\t\t\t\t\t\tthis.letterDistribution.put(letters[i], oldValueLetter + 1); // increment counter\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\t// 2: bigram distribution ([eow, eow] is ignored)\n\t\t\t\tif (i < letters.length - 1) {\n\t\t\t\t\tchar[] bigramArray = {letters[i-1], letters[i]};\n\t\t\t\t\tString bigram = String.copyValueOf(bigramArray);\n\t\t\t\t\tInteger oldValueBigram = this.bigramDistribution.get(bigram);\n\t\t\t\t\tif (oldValueBigram == null)\n\t\t\t\t\t\tthis.bigramDistribution.put(bigram, 1); // add the new bigram to the distribution\n\t\t\t\t\telse\n\t\t\t\t\t\tthis.bigramDistribution.put(bigram, oldValueBigram + 1); // increment counter\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\t// 3: trigram distribution\n\t\t\t\tchar[] trigramArray = {letters[i-2], letters[i-1], letters[i]};\n\t\t\t\tString trigram = String.copyValueOf(trigramArray);\n\t\t\t\tInteger oldValueTrigram = this.trigramDistribution.get(trigram);\n\t\t\t\tif (oldValueTrigram == null)\n\t\t\t\t\tthis.trigramDistribution.put(trigram, 1); // add the new trgram to the distribution\n\t\t\t\telse\n\t\t\t\t\tthis.trigramDistribution.put(trigram, oldValueTrigram + 1); // increment counter\n\t\t\t\t\n\t\t\t} // end iteration over letters\n\t\t\t\n\t\t\tthis.numberLetterTokens += str.length();\n\t\t\tthis.numberBigramTokens += str.length() + 1;\n\t\t\tthis.numberTrigramTokens += str.length() + 2;\n\t\t} // end iteration over city names\n\t}", "public void countOfLetters()\n {\n Scanner sc = new Scanner(System.in);\n //Ask an user to enter a string\n System.out.print(\"Enter a string: \");\n //Read next line as string and assign it value to String str\n String str = sc.nextLine();\n\n //Create a new int array with 26 elements\n int []Letters = new int[26];\n\n //For each index in str\n for(int i = 0; i < str.length(); i++)\n {\n //Get current character\n char c = str.toLowerCase().charAt(i);\n //Get char as int\n int val = (int)c;\n //If char is letter\n if(val >= 97 && val <= 122)\n {\n //Increment a value at position of this letter\n Letters[c-'a']++;\n }\n }\n //Get sum of the array\n int Sum = Arrays.stream(Letters).sum();\n //For each index in Letters\n for(int i = 0; i<Letters.length; i++)\n {\n //If value of current position > 0 then print count of this letter at given string and its percentage\n if(Letters[i] > 0)\n {\n System.out.printf(\"The count of `%c` is %x, the percentage is %f \\n\", (char)97+i, Letters[i], (double)Letters[i]/Sum);\n }\n }\n\n }", "public static int counts(String symbols, Map<Character, Integer> counts) {\n\t\tint total = 0;\n\t\tSet<Character> set = new HashSet<Character>();\n\t\tfor (int i=0; i<symbols.length(); i++) {\n\t\t\tchar ch = symbols.charAt(i);\n\t\t\tif (set.contains(ch)) continue;\n\t\t\ttotal += counts.get(ch);\n\t\t\tset.add(ch);\n\t\t}\n\t\treturn total;\n\t}", "public int calculate(String s) {\n if ((s == null) || (s.length() == 0)) return 0;\n int i = 0;\n int j = 0;\n s = s.replace(\" \", \"\");\n String val = \"\";\n int prevVal = 0;\n Stack<Integer> stack = new Stack<Integer>();\n while ((i < s.length()) && (j < s.length())) {\n char ch = s.charAt(i);\n if ((ch == '+') || (ch == '-')) {\n Integer top = null;\n if ( ! stack.isEmpty()) top = stack.peek();\n if (top != null) {\n int topValue = top.intValue();\n if ((topValue == '+') || (topValue == '-') && (stack.size() >= 2)) {\n stack.pop();\n Integer op = stack.pop();\n if (val.length() > 0) {\n if (topValue == '+') stack.push(Integer.parseInt(val) + op.intValue());\n else stack.push(op.intValue() - Integer.parseInt(val));\n }\n }\n }\n else if (val.length() > 0) stack.push(Integer.parseInt(val));\n stack.push((int) ch);\n val = \"\";\n i++;\n } else if ((ch == '*') || (ch == '/')) {\n prevVal = Integer.parseInt(val);\n val = \"\";\n j = i + 1;\n while (j < s.length()) {\n char ch_next = s.charAt(j);\n if ((ch_next == '+') || (ch_next == '-') || (ch_next == '*') || (ch_next == '/')) {\n i = j;\n break;\n } else {\n val = val + ch_next;\n }\n j++;\n }\n if (val.length() > 0) {\n if (ch == '*') val = (Integer.parseInt(val) * prevVal) + \"\";\n else val = (prevVal / Integer.parseInt(val)) + \"\";\n prevVal = 0;\n }\n } else {\n val = val + ch;\n i++;\n }\n }\n if (val.length() > 0) {\n stack.push(Integer.parseInt(val));\n }\n int res = 0;\n while ( ! stack.isEmpty()) {\n int op_2 = stack.pop();\n res = op_2;\n if (stack.size() >= 2) {\n int op = stack.pop();\n int op_1 = stack.pop();\n if (op == '+') stack.push(op_2 + op_1);\n else stack.push(op_1 - op_2);\n\n }\n }\n return res;\n }", "public static void main(String[] args) throws IOException {\n\n String file = \"C:/Java Projects/java-web-dev-exercises/src/exercises/CountingCharsSentence.txt\";\n Path path = Paths.get(file);\n List<String> lines = Files.readAllLines(path);\n Object[] string = lines.toArray();\n String string2 = Arrays.toString(string);\n\n String[] wordsInString = string2.toLowerCase().split(\"\\\\W+\");\n String rejoinedString = String.join(\"\", wordsInString);\n char[] charactersInString = rejoinedString.toCharArray();\n\n HashMap<Character, Integer> letterMap = new HashMap<>();\n\n\n for (char letter : charactersInString) {\n if (!letterMap.containsKey(letter)) {\n int letterCount = 1;\n letterMap.put(letter, letterCount);\n } else if (letterMap.containsKey(letter)) {\n letterMap.put(letter, letterMap.get(letter) + 1);\n }\n }\n\n\n System.out.println(letterMap);\n }", "public void analyzeDocument(String text) {\n\t\tString[] tokens = m_tokenizer.tokenize(text.toLowerCase());\n\t\tfor (int j = 0; j < tokens.length; j++)\n\t\t\ttokens[j] = SnowballStemmingDemo(NormalizationDemo(tokens[j]));\n\t\tHashMap<String, Integer> document_tf = new HashMap<String, Integer>();\n\t\tfor (String token : tokens) {\n\t\t\tif (!document_tf.containsKey(token))\n\t\t\t\tdocument_tf.put(token, 1);\n\t\t\telse\n\t\t\t\tdocument_tf.put(token, document_tf.get(token) + 1);\n\t\t\tif (!df.containsKey(token))\n\t\t\t\tdf.put(token, 1);\n\t\t\telse\n\t\t\t\tdf.put(token, df.get(token) + 1);\n\t\t}\n\t\ttf.add(document_tf);\n\t\t/*\n\t\t * for(String token : document_tf.keySet()) { if(!df.containsKey(token))\n\t\t * df.put(token, 1); else df.put(token, df.get(token) + 1); if(!) }\n\t\t */\n\t\tm_reviews.add(text);\n\t}", "public static int duplicateCount(String text) {\n \r\n int count=0; \r\n \r\n \r\n \r\n int l=text.length(); int index=0; String s1=\"\"; char [] c= new\r\n char [text.length()] ; for (int i=0;i <text.length();i++) {\r\n c[i]=text.toLowerCase().charAt(index++);\r\n \r\n System.out.println(\"Character at c[\"+i+\"] is\"+c[i]);\r\n \r\n }\r\n \r\n System.out.println(\"Character array is \"+Arrays.toString(c));\r\n \r\n int charSize=c.length; int index2=1;\r\n \r\n HashMap h =new HashMap();\r\n for (int i=0;i<charSize;i++)\r\n {\r\n for(int j=i+1;j<charSize;j++)\r\n {\r\n if (c[i]==c[j])\r\n {\r\n count++;\r\n //s1=s1+c[j];\r\n \r\n h.put(c[j],count);\r\n }\r\n }\r\n }\r\n \r\n \r\n System.out.println(h);\r\n \r\n int hsize= h.size();\r\n \r\n return hsize;\r\n }", "public static void main(String[] args) {\n\t\tScanner sc =new Scanner(System.in);\n\t\tString str=sc.nextLine();\n\t\tint sum=0;\n\t\tint count[]=new int[256];\n\t\tint i; \n for (i = 0; i < str.length(); i++) {\n if(str.charAt(i)!=' ') { \n count[(int)str.charAt(i)]++;\n }\n }\n int n = i; \n for (i = 0; i < n; i++) {\n if (count[(int)str.charAt(i)] == 1) {\n \tsum=sum+str.charAt(i);\n }\n }\n\t\tSystem.out.println(sum);\n\t}", "public int titleToNumber(String s) {\n\t int sum = 0;\n\t // for (int i= s.length()-1; i >= 0; i--) {\n\t // sum = sum + (int) Math.pow(26, s.length()-1-i)*(s.charAt(i) - 'A' + 1);\n\t // }\n\t for (int i=0; i<s.length(); i++) {\n\t sum = sum*26 + (s.charAt(i) - 'A' + 1);\n\t }\n\t return sum;\n\t }", "static void getCharCountArray(String str) {\n for (int i = 0; i < str.length(); i++)\n count[str.charAt(i)]++;\n }", "public String solve1(String s) {\n Map<String, Integer> frequency = new HashMap<>();\n String maxWord = null;\n String[] split = s.split(\" \");\n\n for (String word : split) {\n int newFrequency = frequency.getOrDefault(word, 0) + 1;\n frequency.put(word, newFrequency);\n if (newFrequency > frequency.getOrDefault(maxWord, 0)) {\n maxWord = word;\n }\n }\n\n return maxWord;\n }", "public static float textWidth(BitmapFont fntIn, String sIn){\n return new GlyphLayout(fntIn,sIn).width;\n }", "public int count(String word);", "public static int count(String str){\r\n\t\tString[] splitStr = str.trim().split(\"\\\\s+\"); //split according to spaces and tabs.\r\n\t\treturn splitStr.length;\r\n\t}", "public float getWidth() {\n\t\t\n\t\tfloat width= 0;\n\t\tfor(int i = 0; i < text.length(); i++) {\n\t\t\twidth += font.getChar(text.charAt(i)).X_ADVANCE * size;\n\t\t}\n\t\t\n\t\treturn width;\n\t}", "int computeNumberOfLines(String text);", "public int prefixCount(String s) {\n\n StringIterator iter = new StringIterator(s);\n Entry start = prefixCount(iter, root);\n if(start==null) // If the prefix is not in the trie, return 0.\n return 0;\n\n return dfs(start);\n }", "private String m20347f(String str) {\n C3927c cVar = new C3927c(\".cnt\", str);\n return cVar.mo27425a(m20344d(cVar.f17426b));\n }", "public static int countWords(String text) throws UIMAException { \n JCas jCas = JCasFactory.createJCas();\n jCas.setDocumentText(text);\n jCas.setDocumentLanguage(\"en\");\n initEngines();\n\n runPipeline(jCas, segmenter); \n \n int cnt = 0; \n for (Token tok : select(jCas, Token.class)) {\n String token = tok.getCoveredText();\n if (token.matches(\"\\\\p{Alpha}*\")) cnt++;\n }\n \n return cnt;\n }", "public static String alienOrder(String[] words) {\n if(words.length==0){\n return \"\";\n }\n else if(words.length==1){\n return words[0];\n }\n else{\n HashMap<Character,HashSet<Character>> graph = new HashMap<Character,HashSet<Character>>();\n //Use this array to denote each node's indegree\n int[] indegree = new int[26];\n Arrays.fill(indegree,-1);\n //****Initialize indegree array, '0' means exits****\n for(String x : words){\n for(char c : x.toCharArray()){\n indegree[c-'a'] = 0;\n }\n }\n int first = 0;\n int second = 1;\n //****Build the graph****\n while(second<words.length){\n int minLen = Math.min(words[first].length(),words[second].length());\n for(int i = 0; i<minLen; i++){\n char f = words[first].charAt(i);\n char s = words[second].charAt(i);\n if(f!=s){\n if(graph.containsKey(s)==true){\n HashSet<Character> hs = graph.get(s);\n if(hs.contains(f)==false){\n indegree[f-'a']++;\n hs.add(f);\n graph.replace(s,hs);\n }\n }\n else{\n HashSet<Character> hs = new HashSet<Character>();\n hs.add(f);\n graph.put(s,hs);\n indegree[f-'a']++;\n }\n break;\n }\n }\n first++;\n second++;\n }\n StringBuilder result = new StringBuilder();\n Queue<Character> topo = new LinkedList<Character>();\n int numOfChar = 0;\n for(int i = 0; i<26; i++){\n if(indegree[i]>=0){\n numOfChar++;\n if(indegree[i]==0){\n topo.offer((char)('a'+i));\n } \n }\n }\n if(topo.size()==0){\n return \"\";\n //Means circle exits\n }\n while(topo.size()>0){\n char c = topo.poll();\n result.append(c);\n if(graph.containsKey(c)==false){\n \tcontinue;\n }\n HashSet<Character> hs = graph.get(c);\n for(char x : hs){\n indegree[x-'a']--;\n if(indegree[x-'a']<0){\n return \"\";\n }\n else if(indegree[x-'a']==0){\n topo.offer(x);\n }\n }\n }\n return result.reverse().toString();\n //return result.length()==numOfChar?result.reverse().toString():\"HAHA\";\n }\n }", "public Map<String, Integer> wordCount(String string) {\n\t\tMap<String, Integer> map = new HashMap<String, Integer>();\n\t\tString[] p = string.split(\"[\\\\W\\\\s]\");\n\t\tfor (String s : p) {\n\t\t\tif (!s.equals(\"\")) {\n\t\t\t\tif (map == null || !map.containsKey(s))\n\t\t\t\t\tmap.put(s, 1);\n\t\t\t\telse\n\t\t\t\t\tmap.replace(s, map.get(s) + 1);\n\t\t\t}\n\t\t}\n\t\treturn map;\n\t}", "public int countX(String str) {\n\t\t if(str.length() == 0 ){\n\t\t // return count;\n\t\t\t return 0;\n\t\t }\n\t\t if(str.charAt(0) == 'x'){\n\t\t // count++;\n\t\t //return count + countX(str.substring(1));\n\t\t return 1 + countX(str.substring(1));\n\t\t }\n\t\t return countX(str.substring(1));\n\t\t}", "public int numDecodings(String s) {\n if(s==null||s.length()==0){\n return 0;\n }\n\n int n=s.length();\n int[] mem=new int[n+1];\n\n mem[n]=1;\n if(Integer.parseInt(s.substring(n-1))!=0){\n mem[n-1]=1;\n }\n\n for(int i=n-2;i>=0;i--){\n if(Integer.parseInt(s.substring(i,i+1))==0){\n continue;\n }\n if(Integer.parseInt(s.substring(i,i+2))<26){\n mem[i]=mem[i+1]+mem[i+2];\n }else{\n mem[i]=mem[i+1];\n }\n }\n\n return mem[0];\n }", "private static int numOfDecimalDigit(String text) {\n\t\treturn text.substring(text.indexOf(\".\") + 1, text.length()).length();\r\n\t}", "public static int duplicateCount(String text) {\n String[] textArray = text.toLowerCase().split(\"\");\n List<String> temp = new ArrayList<String>();\n\n // Storing all of the duplicated strings\n for(int i=0; i < textArray.length; i++){\n for(int j=i+1; j < textArray.length; j++){\n if(textArray[i].equals(textArray[j])){\n temp.add(textArray[i]);\n }\n }\n }\n \n // Convert list to array\n String[] itemsArray = new String[temp.size()];\n itemsArray = temp.toArray(itemsArray);\n \n // Removing all the duplicated strings by using hashset\n Set<String> set = new HashSet<String>();\n for(int i = 0; i < itemsArray.length; i++){\n set.add(itemsArray[i]);\n }\n\n // Returning the length \n return set.size();\n }", "public static int[] findNumsOfRepsv2(String s, char[] c) {\n int[] sums = new int[c.length];\n HashMap<Character, Integer> map = new HashMap<>();\n for (int i = 0; i < s.length(); i++){\n if (!map.containsKey(s.charAt(i))){\n map.put(s.charAt(i), 1);\n } else {\n int sum = map.get(s.charAt(i));\n map.put(s.charAt(i), sum + 1);\n }\n }\n for (int j = 0; j < c.length; j++){\n int sum;\n if (!map.containsKey(c[j])) {\n sums[j] = 0;\n } else {\n sums[j] = map.get(c[j]);\n }\n }\n return sums;\n }", "private static void cryptanalysis() {\n\t for (char cipherChar : cipherText.toCharArray()) {\n\t if (Character.isLetter(cipherChar)) { // only letters are encrypted, punctuation marks and whitespace are not\n\t // following line converts letters to numbers between 0 and 25\n\t int cipher = (int) cipherChar - alphaIndex;\n\t // following line increments the value at frequency[cipher] to count frequency of letters used\n\t frequency[cipher] = frequency[cipher] + 1;\n\t }\n\t } \n\t char currChar = 'A';\n \t for (int i = 0; i < 26; i++) {\n \t\t System.out.println(currChar++ + \" \" + frequency[i]);\n \t }\n }", "public int countConsonants(String str){\n\t\tint count=str.replaceAll(\"[^A-Za-z0-9_]\", \"\").length()\n\t\t\t\t-str.toLowerCase().replaceAll(\"[^aeiouy]\",\"\").length();\n\t\treturn count;\n\t}", "public static int countCompression(String str) {\n if (str == null || str.isEmpty()) return 0;\n char last = str.charAt(0);\n int size = 0;\n int count = 1;\n\n for (int i = 1; i < str.length(); i++) {\n if (str.charAt(i) == last) count++;\n else {\n last = str.charAt(i);\n size += 1 + String.valueOf(count).length(); //digit count\n count = 1;\n }\n }\n size += 1 + String.valueOf(count).length();\n return size;\n }", "static int countOccurrences(String str, String word) \r\n\t\t{\n\t\t String a[] = str.split(\" \");\r\n\t\t \r\n\t\t // search for pattern in a\r\n\t\t int count = 0;\r\n\t\t for (int i = 0; i < a.length; i++) \r\n\t\t {\r\n\t\t // if match found increase count\r\n\t\t if (word.equals(a[i]))\r\n\t\t count++;\r\n\t\t }\r\n\t\t \r\n\t\t return count;\r\n\t\t}", "public static ArrayList<TrigramsOcurrence> frequenciesMod26(String cipherText) {\n ArrayList<TrigramsOcurrence> trigramsOcurrence = new ArrayList<TrigramsOcurrence>();\n for (int i = 0; i < cipherText.length() - 2; i++) {\n Character c1 = cipherText.charAt(i);\n Character c2 = cipherText.charAt(i + 1);\n Character c3 = cipherText.charAt(i + 2);\n TrigramsOcurrence to = new TrigramsOcurrence(Code.encodeMod26(c1.toString())[0], Code.encodeMod26(c2.toString())[0], Code.encodeMod26(c3.toString())[0], 1);\n if (trigramsOcurrence.contains(to)) {\n int index = trigramsOcurrence.indexOf(to);\n int newFreq = trigramsOcurrence.get(index).getFrequency() + 1;\n trigramsOcurrence.get(index).setFrequency(newFreq);\n } else {\n trigramsOcurrence.add(to);\n }\n }\n return trigramsOcurrence;\n }", "public static void countWords(String text, HashMap<String, Integer> counts){\n\t\tStringTokenizer st = new StringTokenizer(text);\n\t\tString currWord = null;\n\t\twhile(st.hasMoreTokens()){\n\t\t\tcurrWord = st.nextToken();\n\t\t\tif(counts.containsKey(currWord)){\n\t\t\t\tcounts.put(currWord, counts.get(currWord)+1);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcounts.put(currWord, 1);\n\t\t\t}\n\t\t}\n\t}", "public int discCount() {\n\t\tint countBLACK = discBlackCount();\n\t\tint countWHITE = discWhiteCount();\n\n\t\treturn countBLACK + countWHITE;\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tnew FrequencyOfCharInString().findCharFreq(\"Technocredit\", \"T\");\n\t}", "@Override\r\n\t\t\tpublic long getDocumentFrequency(String term) {\n\t\t\t\treturn 0;\r\n\t\t\t}", "public static int[] countChar(String str) {\n\t\tint[] charSet = new int[256];\n\t\tfor(int i = 0; i < str.length(); i++) {\n\t\t\tcharSet[str.charAt(i)]++;\n\t\t}\n\t\treturn charSet;\n\t}", "public static int eCounter (String string) {\r\n int count = 0;\r\n \r\n if (string.length() == 0) {\r\n return count;\r\n }\r\n \r\n if (string.substring(0,1).equalsIgnoreCase(\"e\")) {\r\n count = 1 + eCounter(string.substring(1));\r\n return count;\r\n }\r\n \r\n count = eCounter(string.substring(1));\r\n return count;\r\n }" ]
[ "0.6300746", "0.60797715", "0.5829788", "0.5822353", "0.5784683", "0.5739376", "0.5727116", "0.564604", "0.5596313", "0.5579681", "0.55689275", "0.55619705", "0.5558072", "0.55118924", "0.551142", "0.54938906", "0.5464392", "0.54500157", "0.5387859", "0.53688747", "0.5329552", "0.52846944", "0.5268374", "0.525041", "0.5237209", "0.5214886", "0.5186445", "0.51792675", "0.5160259", "0.5148106", "0.5145185", "0.51297367", "0.5115731", "0.51102006", "0.5109167", "0.51086", "0.5105636", "0.5092193", "0.50809926", "0.5080442", "0.50660044", "0.50633717", "0.5059493", "0.50401545", "0.50399846", "0.50366044", "0.5033979", "0.5002748", "0.5001797", "0.49983528", "0.4997395", "0.4986539", "0.49850294", "0.49742126", "0.49531314", "0.4929631", "0.49293056", "0.49139678", "0.4906197", "0.49051028", "0.49040055", "0.48967853", "0.4888101", "0.48878595", "0.48818597", "0.48790842", "0.4869493", "0.48692775", "0.48638958", "0.48544773", "0.4847625", "0.48441344", "0.4839133", "0.4838141", "0.48365092", "0.48213533", "0.48205972", "0.48203444", "0.480952", "0.48091707", "0.48090598", "0.48040223", "0.48030874", "0.48008093", "0.47866637", "0.4786161", "0.47851038", "0.47763923", "0.4775663", "0.4775212", "0.4770153", "0.47690007", "0.4768824", "0.47670949", "0.47669235", "0.47660905", "0.47592947", "0.47515154", "0.47474396", "0.47467652" ]
0.7400556
0
Given a hashmap of relative frequencies, draw a histogram of those frequencies.
private static void drawHistogram(HashMap<String, Double> map) { double maximumRelativeFrequency = 0; //Find maximum relative frequency. for (Entry<String, Double> entry : map.entrySet()) { if (maximumRelativeFrequency < entry.getValue()) { maximumRelativeFrequency = entry.getValue(); } } for (Entry<String, Double> entry : map.entrySet()) { System.out.print(entry.getKey() + ": "); System.out.printf("%5.2f%% : ", entry.getValue()*100); //Scale histogram to largest relative frequency. int stars = (int)((entry.getValue() / maximumRelativeFrequency) * 70.0); for (int i = 0; i < stars; i++) { System.out.print("*"); } System.out.println(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void addHistogram2map(HashMap<String, double[][]> map, double[] histValues, String key, int iteration) {\r\n if (!map.containsKey(key)) {\r\n map.put(key, new double[nRandomisations][]);\r\n }\r\n double[][] values = map.get(key);\r\n values[iteration] = histValues;\r\n }", "@Override\n\tpublic int showFrequency(String key) {\n\t\tint hashVal = hashFunc(key);\n\t\twhile (hashArray[hashVal] != null) {\n\t\t\tif (hashArray[hashVal].value.equals(key))\n\t\t\t\treturn hashArray[hashVal].frequency;\n\t\t\telse {\n\t\t\t\thashVal++;\n\t\t\t\thashVal = hashVal % size;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "public static void main(String args[]) {\n int a = 0;\r\n int b = 0;\r\n int u = 0;\r\n\r\n //Declaring scanner object\r\n Scanner capture = new Scanner(System.in);\r\n System.out.println(\"How many input values [MAX: 30]?\");\r\n\r\n //Taking input\r\n int x = capture.nextInt();\r\n ArrayList<Integer> Digits = new ArrayList<>();\r\n System.out.println(\"Enter \" + x + \" numbers.\");\r\n\r\n //Declaring and initializing HashMap object\r\n HashMap<Integer, Integer> Occur = new HashMap<>();\r\n\r\n // Initialize Hashmap\r\n for(int i=0;i<10;i++){\r\n Occur.put(i,0);\r\n }\r\n\r\n\r\n\r\n\r\n int tmp = x;\r\n // Initialize ArrayList\r\n while(tmp>0){\r\n Digits.add(capture.nextInt());\r\n tmp--;\r\n }\r\n\r\n\r\n\r\n // ----------------------------\r\n while (b < x) {\r\n if (Occur.get(Digits.get(b)) != null) {\r\n int cnt = Occur.get(Digits.get(b)) + 1;\r\n Occur.put(Digits.get(b), cnt);\r\n }\r\n else {\r\n Occur.put(Digits.get(b), 1);\r\n }\r\n b++;\r\n }\r\n\r\n int height = 0;\r\n System.out.println(\"\\nNumber Occurrence\");\r\n\r\n height = 0;\r\n for(Map.Entry<Integer,Integer> entry : Occur.entrySet()){\r\n if(entry.getValue()>0){\r\n System.out.println(entry.getKey() + \" \" + entry.getValue());\r\n }\r\n if(entry.getValue()>height){\r\n height = entry.getValue();\r\n }\r\n }\r\n\r\n System.out.println(\"================= Vertical bar =================\");\r\n\r\n //Printing histogram\r\n int h = height;\r\n while ( h > 0) {\r\n\r\n System.out.print(\"| \"+h+\" | \");\r\n\r\n int g = 0;\r\n while (g < 10) {\r\n if(Occur.get(g) != null) {\r\n int kallen = Occur.get(g);\r\n if(kallen >= h)\r\n {\r\n System.out.print(\"* \");\r\n }\r\n else\r\n {\r\n System.out.print(\" \");\r\n }\r\n }\r\n else\r\n {\r\n System.out.print(\" \");\r\n }\r\n g++;\r\n }\r\n System.out.print(\"\\n\");\r\n h--;\r\n }\r\n System.out.println(\"================================================\");\r\n System.out.print(\"| N |\");\r\n while ( u < 10 ) {\r\n System.out.print(\" \"+ u );\r\n u++;\r\n }\r\n System.out.println(\"\\n================================================\");\r\n }", "public static String histogram(ArrayList<Integer> frequency)\r\n {\r\n int maxFrequency;\r\n int starRepresent;\r\n maxFrequency = 0;\r\n \r\n for (int i = 0; i < frequency.size() -1; i++)\r\n {\r\n if (frequency.get(i) > maxFrequency)\r\n maxFrequency = frequency.get(i);\r\n }\r\n \r\n starRepresent = maxFrequency / 10;\r\n \r\n System.out.printf(\"%10s\", \"Frequency Distrubution\");\r\n System.out.println();\r\n System.out.printf(\"%10s\", \"( max freq is \" + maxFrequency + \")\");\r\n System.out.println();\r\n \r\n for (int i = 10; i > 0; i--)\r\n {\r\n for (int index = 0; index <= frequency.size() - 1; index++)\r\n {\r\n if (frequency.get(index) / starRepresent >= i)\r\n System.out.print(\"* \");\r\n else\r\n System.out.print(\" \");\r\n }\r\n System.out.print(\"\\n\");\r\n }\r\n return \"\";\r\n }", "public static HashMap<String, HashMap<String, Double>> logProb(HashMap<String, HashMap<String, Double>> map){\n //for each key in the given map\n for (String key : map.keySet()){\n HashMap<String,Double> innerMap = map.get(key);\n Double total = 0.0;\n //loop through the inner map, add integer values to total\n for (String key2: innerMap.keySet()){\n total += innerMap.get(key2);\n }\n //loop through the inner map, set the integer values to log probability\n for (String key2: innerMap.keySet()){\n innerMap.put(key2, Math.log(innerMap.get(key2) / total));\n }\n }\n //return new map\n return map;\n }", "public static void printHashMapSI(Map<String, Integer> map) throws IOException{\n\t\tPrintWriter writer = new PrintWriter(\"C:/Users/Naveen/Desktop/TestRuns/LastRun/allTermHash\");\n\t\tfor (Entry<String, Integer> entry : map.entrySet())\n\t {\t \t\t\n\t \t\twriter.println(entry.getKey()+\":\"+entry.getValue());\n\t }\n\t writer.close();\n\t}", "private static void printMap(HashMap<String, Integer> hashMap) {\n\t\tfor (String key : hashMap.keySet()) {\r\n\t\t System.out.println(\"Key: \" + key + \" Value: \" + hashMap.get(key));\r\n }\r\n System.out.println(\"Total features in Hashmap: \"+ hashMap.size());\r\n\t}", "public void recalcHistogram();", "public static void dump(Map<Character, Object[]> map) {\n\t\tif (map == null) return;\n\t\tint total = 0; int hits=0;\n\t\tfor (Character ch : map.keySet()) {\n\t\t\tObject[] val = map.get(ch);\n\t\t\tint c = (Integer) val[0];\n\t\t\ttotal += c;\n\t\t\tboolean hit =Ciphers.realHomophone(\"\"+val[1]);\n\t\t\tif (hit) hits++;\n\t\t\tint len = (\"\"+val[2]).length();\n\t\t\tSystem.out.println(ch + \": \" + len + \", \" + (float)c*2/len + \", \" + c + \", \" + val[1] + \", \" + val[2] + (hit ? \" HIT \" : \" MISS \"));\n\t\t}\n\t\tSystem.out.println(\"Total: \" + total + \", hits \" + hits + \" ratio \" + (float)hits/map.size());\n\t}", "public void setCountsHashMap(HashMap<Integer, Integer> countsHashMap){\n\t\tthis.countsHashMap = countsHashMap;\n\t}", "private String histogram() {\n\t\tStringBuilder sb = new StringBuilder(\"[\");\n\t\t\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tint size = 0;\n\t\t\tfor (int j = 0; j < myBuckets.size(); j++) {\n\t\t\t\tif (myBuckets.get(j).size() == i) size++;\n\t\t\t}\n\t\t\tsb.append(size + \", \");\n\t\t}\n\t\tsb.replace(sb.length() - 2, sb.length(), \"]\");\n\t\treturn sb.toString();\n\t}", "public static HashMap<String, HashMap<Integer, Integer>> binHiggsData(HashMap<String, ArrayList<Double>> energyMap){\r\n\r\n\t\t//hashmap. Keys: detector name. Value: the hashmap above\r\n\t\tHashMap<String, HashMap<Integer, Integer>> bothDetectorsBinnedData = new HashMap<String, HashMap<Integer, Integer>>();\r\n\r\n\t\t//arraylist of the detector in the map so we can loop through all of them \r\n\t\tArrayList<String> detectorList = new ArrayList<String>();\r\n\t\tdetectorList.addAll(energyMap.keySet());\r\n\r\n\t\t//loop through all of the detectors (in this case, just GG and ZZ)\r\n\t\tfor (String detector : detectorList){\r\n\r\n\t\t\t//initialise values - this needs to be done in this for loop to reset for each detector\r\n\t\t\tint currentValueBin;\r\n\t\t\tint currentFreq;\t\r\n\t\t\tint newFreq;\r\n\t\t\tdouble currentValueBinD;\r\n\r\n\t\t\t//hashmap. Keys: each bin minimum. Value: number of readings in that bin\r\n\t\t\tHashMap<Integer, Integer> numberOfReadingsInEachBin = new HashMap<Integer, Integer>();\r\n\r\n\t\t\t//find the current list of data for this detector\r\n\t\t\tArrayList<Double> currentData = energyMap.get(detector);\r\n\r\n\t\t\tArrayList<Integer> flooredValues = new ArrayList<Integer>();\r\n\r\n\t\t\t//loop through all of the data in the set for this detector\r\n\t\t\tfor (double currentE : currentData){\r\n\r\n\t\t\t\t//round the value down, this is what the bin will be\r\n\t\t\t\tcurrentValueBinD = Math.floor(currentE);\r\n\t\t\t\tcurrentValueBin = (int) currentValueBinD;\r\n\r\n\t\t\t\tflooredValues.add(currentValueBin);\r\n\r\n\r\n\t\t\t\t//look for this value in the hashmap of bins and frequency\r\n\t\t\t\tInteger frequency = numberOfReadingsInEachBin.get(currentValueBin);\r\n\r\n\r\n\r\n\t\t\t\t//if this bin hasn't been put into the hashmap yet, put it in\r\n\t\t\t\tif (frequency == null){\r\n\t\t\t\t\tnumberOfReadingsInEachBin.put(currentValueBin, 1);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//if it has, add one to the frequency\r\n\t\t\t\telse{\r\n\t\t\t\t\tcurrentFreq = numberOfReadingsInEachBin.get(currentValueBin);\r\n\t\t\t\t\tnewFreq = currentFreq +1;\r\n\t\t\t\t\tnumberOfReadingsInEachBin.put(currentValueBin, newFreq);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//System.out.println(Collections.min(currentData));\r\n\r\n\t\t\t//if there have been frequencies of zero, they won't have been added, add them now\r\n\t\t\tfor (int i = Collections.min(flooredValues); i < Collections.max(flooredValues); i++){\r\n\t\t\t\tInteger currentReadings = numberOfReadingsInEachBin.get(i);\r\n\r\n\t\t\t\tif (currentReadings == null){\r\n\r\n\t\t\t\t\tnumberOfReadingsInEachBin.put(i, 0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//put the detector and the corresponding frequency data into the hashmap\r\n\t\t\tbothDetectorsBinnedData.put(detector, numberOfReadingsInEachBin);\r\n\r\n\t\t}\r\n\t\treturn bothDetectorsBinnedData;\r\n\t}", "public static void printHashMapSS(Map<String, String> map) throws IOException{\n\t\tPrintWriter writer = new PrintWriter(\"C:/Users/Naveen/Desktop/TestRuns/LastRun/documentHash\");\n\t\tfor (Entry<String, String> entry : map.entrySet())\n\t {\t \t\t\n\t \t\twriter.println(entry.getKey()+\":\"+entry.getValue());\n\t }\n\t writer.close();\n\t}", "public void computeHistogram() {\n\t}", "public static void printHashMapIS(Map<Integer, String> map) throws IOException{\n\t\tPrintWriter writer = new PrintWriter(\"C:/Users/Naveen/Desktop/TestRuns/LastRun/finalCatalogHash\");\n\t\tfor (Entry<Integer, String> entry : map.entrySet())\n\t {\t \t\t\n\t \t\twriter.println(entry.getKey()+\":\"+entry.getValue());\n\t }\n\t writer.close();\n\t}", "public void drawHistograms(Graphics2D g, int x0, int y0, int w, int h)\n{\n double ymax = alldefs.histogram.yaxisMax;\n double ymin = alldefs.histogram.yaxisMin;\n\n for (int i = 0; i < histograms.length; i+=alldefs.histogram.barStack)\n {\n double v0 = 0;\n double v2 = 0;\n for (int j = 0; j < alldefs.histogram.barStack; j++)\n { \n double v = histograms[i + j]; \n if (v > 0)\n v0 += v;\n else\n v2 += v;\n }\n\n if (v0 > ymax) ymax = v0;\n if (v2 < ymin) ymin = v2;\n }\n\n if (alldefs.histogram.yaxisIncrement > 0)\n {\n double y = 0;\n if (ymax >= 0)\n {\n while (ymax > y)\n { y += alldefs.histogram.yaxisIncrement; }\n }\n else\n {\n while (ymax < y - alldefs.histogram.yaxisIncrement)\n { y -= alldefs.histogram.yaxisIncrement; }\n }\n ymax = y;\n\n y = 0;\n if (ymin >= 0)\n {\n while (ymin > y)\n { y += alldefs.histogram.yaxisIncrement; }\n }\n else\n {\n while (ymin < y)\n { y -= alldefs.histogram.yaxisIncrement; }\n }\n ymin = y;\n }\n\n FontMetrics fm = getFontMetrics(getFont());\n int ascent = fm.getAscent(); \n\n int yTop = 1 //space\n + ascent //font\n + 1; //space\n\n int yBottom = 4 //tic and overlapping line\n + ascent //font\n + 1 //space\n + ascent //font\n + 1; //space\n\n int xLeft = 1 //space\n + ascent //font\n + 1 //space\n + 0 //stringwidth placeholder\n + 4; //tic and overlapping line\n\n int xRight = 4; //spacing only\n\n int sw1 = \n fm.stringWidth(format.doublewithdecimals(ymin, alldefs.histogram.yaxisDecimals));\n int sw2 = \n fm.stringWidth(format.doublewithdecimals(ymax, alldefs.histogram.yaxisDecimals));\n\n xLeft += sw1 > sw2 ? sw1 : sw2;\n\n double ypix = 0;\n if (ymax > ymin)\n {\n g.setColor(Color.black);\n\n if (yTop + yBottom < h)\n {\n ypix = Math.abs(ymax - ymin) / (double)(h - yTop - yBottom);\n\n g.drawLine(xLeft, h - yBottom, xLeft, yTop);\n g.drawLine(xLeft + 1, h - yBottom, xLeft + 1, yTop);\n }\n else\n { ypix = Math.abs(ymax - ymin) / (double)1; }\n\n if (alldefs.histogram.yaxisIncrement > 0 && ypix > 0)\n {\n int j0 = yTop;\n int jn = h - yBottom - 1;\n\n int factor = 0;\n {\n int total;\n int size = jn - j0 + 1 - ascent;\n do\n {\n total = 0;\n factor++;\n\n double y = ymax - factor * alldefs.histogram.yaxisIncrement;\n while (y > ymin)\n {\n total += ascent;\n y -= factor * alldefs.histogram.yaxisIncrement;\n }\n } while (total > size);\n }\n\n double y = ymax;\n while (j0 <= jn)\n {\n String s = format.doublewithdecimals(y, alldefs.histogram.yaxisDecimals);\n int sw = fm.stringWidth(s);\n\n g.drawString(s, xLeft - sw - 4, j0 + ascent / 2 + 1);\n g.drawLine(xLeft, j0, xLeft - 4, j0);\n \n y -= factor * alldefs.histogram.yaxisIncrement;\n j0 = yTop + (int)((ymax - y) / ypix);\n }\n }\n else\n {\n String s = \n format.doublewithdecimals(ymax, alldefs.histogram.yaxisDecimals);\n int sw = fm.stringWidth(s);\n\n g.drawString(s, xLeft - sw - 4, yTop + ascent / 2 - 1);\n g.drawLine(xLeft, yTop, xLeft - 4, yTop);\n }\n\n if (alldefs.histogram.barTotal > 0)\n {\n int spacing = alldefs.histogram.barSpacing;\n int width = alldefs.histogram.barWidth;\n\n if (width <= 0)\n {\n width = (w - xLeft - xRight - alldefs.histogram.barTotal * spacing * 2) / alldefs.histogram.barTotal;\n }\n\n if (width <= 0)\n width = 1;\n\n int total = spacing * 2 + width;\n\n int xa = xLeft + 2;\n int xb = xa + alldefs.histogram.barTotal * total;\n int yb = h - yBottom;\n g.drawLine(xa - 2, yb, xb, yb);\n g.drawLine(xa - 2, yb - 1, xb, yb - 1);\n\n int yc = yTop + (int)(ymax / ypix);\n g.drawLine(xa - 2, yc, xb, yc);\n\n int idx = 0;\n for (int i = 0; i < alldefs.histogram.barTotal; i++)\n {\n int yT = yc;\n int yB = yc;\n for (int j = 0; j < alldefs.histogram.barStack; j++)\n {\n double v = histograms[idx++];\n int j2 = Math.abs((int)(v / ypix));\n if (j2 > 1)\n {\n g.setColor(alldefs.histogram.barColors[j]);\n\n if (v > 0)\n {\n yT -= j2;\n\n g.fillRect(xa + spacing, yT, width, j2);\n \n g.setColor(Color.black);\n g.drawRect(xa + spacing, yT, width, j2);\n }\n else\n {\n g.fillRect(xa + spacing, yB, width, j2);\n \n g.setColor(Color.black);\n g.drawRect(xa + spacing, yB, width, j2);\n\n yB += j2;\n }\n }\n } \n\n if (alldefs.histogram.barLabels != null \n && alldefs.histogram.barLabels.length \n == alldefs.histogram.barTotal)\n {\n String s = alldefs.histogram.barLabels[i];\n if (s != null)\n {\n g.drawLine(xa + total / 2, yb, xa + total / 2, yb + 4);\n \n int sw0 = fm.stringWidth(s) / 2;\n g.drawString(s, xa + total / 2 - sw0, yb + 4 + 1 + ascent);\n }\n }\n xa += total;\n }\n }\n }\n\n g.setColor(Color.black);\n\n //draw Titles\n if (alldefs.histogram.title != null)\n g.drawString(alldefs.histogram.title, xLeft, yTop - 1);\n\n if (alldefs.histogram.barTitle != null)\n g.drawString(alldefs.histogram.barTitle,\n w / 2,\n h - 1);\n\n if (alldefs.histogram.yaxisTitle != null)\n {\n g.rotate(Math.PI / -2.0, 1 + ascent, h / 2);\n g.drawString(alldefs.histogram.yaxisTitle, \n 1 + ascent, \n h / 2);\n g.rotate(Math.PI / 2.0, 1 + ascent, h / 2);\n }\n}", "public static TreeMap<Integer, ArrayList<String>> countOccur(Map<String,Integer> map){\n\t\tTreeMap<Integer,ArrayList<String>> num_map = new TreeMap<Integer,ArrayList<String>>();\n\t\tfor(String key : map.keySet()) {\n\t\t\tInteger i = map.get(key);\n\t\t\tif(!num_map.containsKey(i)) {\n\t\t\t\tnum_map.put(i, new ArrayList<String>());\n\t\t\t\tnum_map.get(i).add(key);\n\t\t\t} else {\n\t\t\t\tnum_map.get(i).add(key);\n\t\t\t}\n\t\t}\n\t\treturn num_map;\n\t}", "public static void dumpAS(Map<String, Integer[]> map) {\n\t\tif (map == null) return;\n\t\tint total = 0; int hits=0;\n\t\tfor (String key : map.keySet()) {\n\t\t\tInteger[] val = map.get(key);\n\t\t\ttotal += val[1];\n\t\t\tboolean hit =Ciphers.realHomophone(key);\n\t\t\tif (hit) hits++;\n\t\t\tSystem.out.println(val[1] + \" for \" + key + \": \" + val[0] + \", \" + (hit ? \" HIT \" : \" MISS \")); \n\t\t}\n\t\tSystem.out.println(\"Total: \" + total + \", hits \" + hits + \" ratio \" + (float)hits/total);\n\t}", "private void processFileEntries(final File filePath, Map<String, Integer> bigramHistogramMap) {\n\n BufferedInputStream bis = null;\n FileInputStream fis = null;\n\n try {\n\n // create FileInputStream object\n fis = new FileInputStream(filePath);\n\n // create object of BufferedInputStream\n bis = new BufferedInputStream(fis);\n\n String stringLine;\n\n BufferedReader br = new BufferedReader(new InputStreamReader(bis));\n\n String previousWord = \"\";\n\n while ((stringLine = br.readLine()) != null) {\n previousWord = addBigramHistogramEntry(stringLine, previousWord, bigramHistogramMap);\n }\n\n } catch (FileNotFoundException e) {\n System.out.println(\"File not found - \" + e);\n } catch (IOException ioe) {\n System.out.println(\"Exception while reading file - \" + ioe);\n } catch (Exception e) {\n System.out.println(\"Unable to load: \" + filePath.getName());\n } finally {\n // close the streams using close method\n try {\n if (fis != null) {\n fis.close();\n }\n if (bis != null) {\n bis.close();\n }\n } catch (IOException ioe) {\n System.out.println(\"Error while closing stream : \" + ioe);\n }\n }\n }", "public static float countUnique(HashMap<String,Integer> hamMap, HashMap<String,Integer> spamMap){\n\t\tfloat counter = hamMap.size();\n\t\tIterator it = spamMap.entrySet().iterator();\n\t\t\n\t\tfor(String s : spamMap.keySet()){\n\t\t\tif(hamMap.containsKey(s)) continue;\n\t\t\tcounter++;\n\t\t}\n\n\t\treturn counter;\n\t}", "private void writeHistograms(PrintWriter writer) {\n Set set = tokenSizes.entrySet();\n String delimiter = \"\\t\";\n double amount = 0;\n\t\tdouble histogramAmount = 0;\n\n // Use of Iterator for the while loop that is no longer being used.\n // Iterator iterator = set.iterator();\n\n // Implement the calculateMaximumAmount method for PROJECT 3 CORRECTION\n for(Map.Entry<Integer, Integer> entry : tokenSizes.entrySet()) {\n amount = calculateMaximumAmount();\n\t\t\thistogramAmount = (double) entry.getValue() * amount;\n writer.println(entry.getKey() + delimiter + printHistogram(histogramAmount));\n } \n\n /**\n * This is a while loop I used in project 1 but Paula told me to use an \n * enhanced for loop instead. \n *\n * while (iterator.hasNext()) {\n * Map.Entry me = (Map.Entry) iterator.next();\n * int tokenValue = (int) me.getValue();\n * writer.println(me.getKey() + \"\\t\" + printHistogram(tokenValue));\n * }\n */\n }", "public static void main(String[] args) {\n int [] numbers= {23,45,66,45,78,34,201,88,66,34,7,9,3,603,7,301,7,8,7};\n\n LearnHashMapTravers.printFrequency(numbers);\n }", "private void histogramScore() {\r\n View.histogram(score, 0, this.getSize().width + 15, 0);\r\n }", "public int getFrequency(int height);", "public static void DocumentFrequencies() throws FileNotFoundException {\n for (Entry<String, List<Integer>> entry : dictionary.entrySet()) {\n List<Integer> termfrequency = new ArrayList<>();\n\n termfrequency = entry.getValue();\t// getting each word's termfrequency list\n int i = 0;\n termfrequency.add(0); \t\t\t//maintaining documentfrequency at the 57th index\n Integer documentFrequency = termfrequency.get(totaldocument+1);\n while(i<56) { //iterate 0 to 55 all speeches term frequency\n if(termfrequency.get(i)>0) {\t\t//increment document frequency of that word if termfrequency is greater than 0.0\n documentFrequency++;\t\t\t//increment document frequency\n }\n i++;\t\t//increment index\n }\n termfrequency.set(57, documentFrequency);\t//re-set the documentfrequency and save the current maintained document frequency from 0 to calculated value\n dictionary.put(entry.getKey(), termfrequency);\t\t// place the incremented final value of that word back to the same list in dictionary hashmap\n }\n //save();\n }", "public static void printValues(HashMap<String, Book> hashmap) {\n for (Book book: hashmap.values()) {\n System.out.println(book);\n }\n }", "public static int[] histogram(int[] scores, int numCounters)\n {\n int[] hist = new int[numCounters];\n for(int score:scores)\n {\n hist[score]++;\n }\n return hist;\n }", "private void collectTripFrequencyDistribution(Map<Integer, HouseholdType> householdTypeBySampleId) {\n initializeFrequencyArrays(householdTypeBySampleId);\n fillFrequencyArrays(householdTypeBySampleId);\n }", "private HashMap<Integer, HashMap<String,String>> getAllFrequencies() {\n HashMap<Integer,HashMap<String,String>> freq\n = dbController.getAllFrequencies();\n if (freq == null)\n return null;\n HashMap<Integer, HashMap<String, String>> response = new HashMap<Integer, HashMap<String, String>>();\n int i = 2;\n //Passing on any frequency and creates a message to send\n for (Map.Entry<Integer,HashMap<String,String>> objs : freq.entrySet()){\n HashMap<String,String> obj = objs.getValue();\n\n response.put(i, new HashMapBuilder<String, String>().put(\"name\", obj.get(\"name\"))\n .put(\"frequency\",obj.get(\"frequency\")).build());\n i++;\n }\n return response;\n }", "public void displayWordCounts(Map<String, Integer> wordCountMap) {\n\t\tIterator wordCountsIter = wordCountMap.keySet().iterator();\n\n\t\tSystem.out.println(\"WordName\" + \" :: :: \" + \"WordCount\");\n\n\t\twhile (wordCountsIter.hasNext()) {\n\t\t\tString inputWord = (String) wordCountsIter.next();\n\n\t\t\tSystem.out.println(inputWord + \" :: :: \"\n\t\t\t\t\t+ wordCountMap.get(inputWord));\n\t\t}\n\t}", "public static void main(String args[]){\r\n\t\t\r\n\t\t\r\n\t\tint arr[] = {2,5,2,8,5,6,8,8};\r\n\t\t\r\n\t\tMap<Integer, Integer> freqMap = new LinkedHashMap<Integer,Integer>();\r\n\t\t\r\n\t\tfor(int i = 0; i< arr.length;i++){\r\n\t\t\tif(freqMap.containsKey(arr[i])){\r\n\t\t\t\tint count = freqMap.get(arr[i]);\r\n\t\t\t\tfreqMap.put(arr[i],count + 1);\r\n\t\t\t}else{\r\n\t\t\t\tfreqMap.put(arr[i], 1);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//2-2,5-2,6-1,8-3\r\n\t\t\r\n\t\tMap<Integer,ArrayList<Integer>> sortedList = new TreeMap<Integer, ArrayList<Integer>>(new Comparator<Integer>(){\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(Integer arg0, Integer arg1) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\treturn arg1.compareTo(arg0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\tfor(Entry<Integer, Integer> entry : freqMap.entrySet()){\r\n\t\t\tint key = entry.getKey();\r\n\t\t\tint val = entry.getValue();\r\n\t\t\tif(sortedList.containsKey(val)){\r\n\t\t\t\tArrayList<Integer> list = sortedList.get(val);\r\n\t\t\t\tfor(int j = 0; j<val ; j++)\r\n\t\t\t\t\tlist.add(key);\r\n\t\t\t}else{\r\n\t\t\t\tArrayList<Integer> list = new ArrayList<Integer>();\r\n\t\t\t\tfor(int j = 0; j<val ; j++)\r\n\t\t\t\t\tlist.add(key);\r\n\t\t\t\tsortedList.put(val, list);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(sortedList.values());\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public Map<String, Integer> buildBigramHistogramOf(final File filePath) {\n Map<String, Integer> bigramHistogramMap = new HashMap<>();\n\n processFileEntries(filePath, bigramHistogramMap);\n\n for (Map.Entry<String, Integer> entry : bigramHistogramMap.entrySet()) {\n System.out.println(entry.getKey() + \" -> \" + entry.getValue());\n }\n\n return bigramHistogramMap;\n }", "public Map<String, Integer> describeThisHist() {\n \tchar[] copyOfLut = new char[256];\n \tlut[0]='+';\n \tfor (int a=1; a<255; a++) {\n \t\tif (lut[a]>lut[a-1]) copyOfLut[a]='+';\n \t\telse copyOfLut[a]='-';\n \t}\n \tSystem.out.println(Arrays.toString(lut));\n \t\n \t// TODELETE START\n \t\n \t for (int maxlit=0, maxlval=0,\n \t\t\t maxrit=0, maxrval=0,\n \t\t\t lit=0, rit=255;;lit++,rit--) {\n \t\t\t if (lut[lit]>maxlval) {maxlit=lit; maxlval=lut[lit]; histDesc.put(\"peak1idx\", lit); histDesc.put(\"peak1val\", lut[lit]);}\n \t\t\t if (lut[rit]>maxrval) {maxrit=rit; maxrval=lut[rit]; histDesc.put(\"peak2idx\", rit); histDesc.put(\"peak2val\", lut[rit]);}\n \t\t\t if (maxlit==maxrit && maxlval==maxrval) break;\n \t}\n \t\n \t// Now find the minimum between the peaks\n \tfor (int i=histDesc.get(\"peak1idx\"), valleyidx=0, valleyval=255; i<histDesc.get(\"peak2idx\"); i++) {\n \t\tif (lut[i]<valleyval) {valleyval=lut[i]; valleyidx=i; histDesc.put(\"valleyidx\", i); histDesc.put(\"valleyval\", lut[i]);}\n \t} \n \t\n \t// TODELETE END\n \t\n \tboolean isSmoothed=false;\n \tint windowSize=4;\n \tint sensitivity=2;\n \t\n \twhile (!isSmoothed) {\n \t\tisSmoothed=true;\n \t\tint noOfPluses=0;\n \t\tfor (int i=0; i<copyOfLut.length-windowSize-1; i++) {\n \t\t\tfor (int j=0; j<windowSize; j++) if (lut[i+j+1]>lut[i+j]) noOfPluses++;\n \t\t\tif (noOfPluses>=sensitivity) {\n \t\t\t\tif (copyOfLut[i]=='-') {\n \t\t\t\t\tcopyOfLut[i]='+';\n \t\t\t\t\tisSmoothed=false;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n \t\n \tisSmoothed=false;\n \t\n \twhile (!isSmoothed) {\n \t\tisSmoothed=true;\n \t\tint noOfPluses=0;\n \t\tfor (int i=0; i<copyOfLut.length-windowSize-1; i++) {\n \t\t\tfor (int j=0; j<windowSize; j++) if (lut[i+j+1]<lut[i+j]) noOfPluses++;\n \t\t\tif (noOfPluses>=sensitivity) {\n \t\t\t\tif (copyOfLut[i]=='+') {\n \t\t\t\t\tcopyOfLut[i]='-';\n \t\t\t\t\tisSmoothed=false;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n \t\n \tArrayList<Paire> listofpluses = new ArrayList<>();\n \t\n \tint startcounter=0; int endcounter=0; boolean counting=false;\n \tfor (int i=0; i<copyOfLut.length; i++){\n \t\tif (copyOfLut[i]=='+') {\n \t\t\tif (counting) endcounter=i;\n \t\t\telse {startcounter=i; counting=true;}\n \t\t}\n \t\tif (copyOfLut[i]=='-') {\n \t\t\tif (counting) {\n \t\t\t\tendcounter=i-1;\n \t\t\t\tlistofpluses.add(new Paire(startcounter,endcounter));\n \t\t\t\tcounting=false;\n \t\t\t}\n \t\t}\n \t}\n \t\n // \tlistofpluses.forEach(x -> System.out.println(x));\n \t\n \t\n \t\n \treturn histDesc; \t\n }", "private double[] computeHistrogram(ArrayList<Feature> freature, String keyID) {\r\n\r\n int nBins = (int) Math.ceil(hismax / binWidth);\r\n ArrayList<Double> values = FeatureOps.getSpecifiedFeatureNumericalPropertyAsArrayList(freature, keyID);\r\n double[] d1 = List2Prims.doubleFromDouble(values);\r\n\r\n double[] hist = new double[nBins];\r\n\r\n int bin;\r\n for (int i = 0; i < d1.length; i++) {\r\n bin = (int) Math.floor((double) nBins * (d1[i] / hismax));// \r\n bin = Math.min(nBins - 1, bin);\r\n hist[bin]++;\r\n }\r\n return hist;\r\n }", "private void calcHist(ByteBuffer depthBuffer) {\n\t\tif (mHistogram == null) {\n\t\t\tmHistogram = new float[10000];\n\t\t}\n\n\t\t// reset\n\t\tfor (int i = 0; i < mHistogram.length; ++i)\n\t\t\tmHistogram[i] = 0;\n\n\t\tint points = 0;\n\t\twhile (depthBuffer.remaining() > 0) {\n\t\t\tint depth = depthBuffer.getShort() & 0xFFFF;\n\t\t\tif (depth != 0) {\n\t\t\t\tmHistogram[depth]++;\n\t\t\t\tpoints++;\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 1; i < mHistogram.length; i++) {\n\t\t\tmHistogram[i] += mHistogram[i - 1];\n\t\t}\n\n\t\tif (points > 0) {\n\t\t\tfor (int i = 1; i < mHistogram.length; i++) {\n\t\t\t\tmHistogram[i] = (int) (256 * (1.0f - (mHistogram[i] / (float) points)));\n\t\t\t}\n\t\t}\n\t}", "public static void readFileToMap(Map<String, List<Integer>> hashMap, String path, int numFiles, int thisFileNum){\n try{\n FileReader file = new FileReader(path);\n BufferedReader textFile = new BufferedReader(file);\n\n String fileLine = \"\";\n String[] wordsInLine;\n List<Integer> occurences;\n List<Integer> temp;\n\n while((fileLine = textFile.readLine()) != null){\n wordsInLine = fileLine.split(\" \");\n cleanLine(wordsInLine);\n //add them to map\n for(String word : wordsInLine){\n\n if(word.length() > Table.maxWordLength){ //keeps track of the longest character\n Table.setMaxWordLength(word.length());\n }\n\n if(!hashMap.containsKey(word)){\n occurences = new ArrayList<>(); //creating a new value makes it so that one change wont affect every HashMap element\n occurences = setZerosList(numFiles);\n occurences.set(thisFileNum, 1);\n hashMap.put(word, occurences);\n }\n else{\n temp = hashMap.get(word); //this code makes a new list, and increments the word appearance by 1\n temp.set(thisFileNum, temp.get(thisFileNum)+1);\n hashMap.put(word, temp );\n }\n }\n }\n }\n catch (Exception e){\n //e.printStackTrace();\n return;\n }\n }", "public static void printMap(Map<Integer,Double> map){\n\t\tfor (Map.Entry entry : map.entrySet())\n\t\t\tSystem.out.println(\"Key : \" + entry.getKey()+ \" Value : \" + entry.getValue());\n\t}", "private static void updateFrequencyFile(File frequencyFile, HashMap<String, Long> dataMap) throws IOException {\n\n\t\tfinal BufferedWriter frequencyWriter = new BufferedWriter(new FileWriter(frequencyFile));\n\n\t\tfor(Entry<String, Long> entry : dataMap.entrySet()) { // Write every entry to the frequency file\n\n\t\t\tfrequencyWriter.write(generateStringFromEntry(entry));\n\t\t\tfrequencyWriter.newLine();\n\t\t}\n\n\t\tfrequencyWriter.close();\n\t}", "SortComparator(Map<Integer, Integer> tFreqMap) { \n this.freqMap = tFreqMap; \n }", "private void drawHistogram(int n, double left, double right, double[] inputStream) {\n prepareCanvas(left, right);\n doDraw(n, left, right, inputStream);\n drawGrid(left, right);\n }", "private void CreateFreq(Map<Integer, Integer> freqY, Map<Integer, Integer> freqCb, Map<Integer, Integer> freqCr) {\n for (int key : freqY.keySet()) {\n int aux = key;\n String auxs = Integer.toBinaryString(aux);\n FY.append(\"/\");\n FY.append(auxs);\n auxs = Integer.toBinaryString(freqY.get(key));\n FY.append(\"/\");\n FY.append(auxs);\n }\n\n for (int key : freqCb.keySet()) {\n int aux = key;\n String auxs = Integer.toBinaryString(aux);\n FCB.append(\"/\");\n FCB.append(auxs);\n auxs = Integer.toBinaryString(freqCb.get(key));\n FCB.append(\"/\");\n FCB.append(auxs);\n }\n\n for (int key : freqCr.keySet()) {\n int aux = key;\n String auxs = Integer.toBinaryString(aux);\n FCR.append(\"/\");\n FCR.append(auxs);\n auxs = Integer.toBinaryString(freqCr.get(key));\n FCR.append(\"/\");\n FCR.append(auxs);\n }\n FCR.append(\"/\");\n }", "public static void printLookupTable(HashMap<Integer, String> map) {\n\t\tint size = map.size();\n\t\tfor(int i = 0; i < size; i++) { \n\t\t\tSystem.out.println(\"vertex descriptor:\\t\" + i + \"\\taddress:\\t\" + map.get(i));\n\t\t}\n\t}", "public HashMap(int bins){\n\t\tthis.numOfBins=bins;\n\t\tthis.size=0;\n\t\tinitializeMap();\n\t}", "@Test\n\tpublic void testHashMap() {\n\n\t\t/*\n\t\t * Creates an empty HashMap object with default initial capacity 16 and default\n\t\t * fill ratio \"0.75\".\n\t\t */\n\t\tHashMap hm = new HashMap();\n\t\thm.put(\"evyaan\", 700);\n\t\thm.put(\"varun\", 100);\n\t\thm.put(\"dolly\", 300);\n\t\thm.put(\"vaishu\", 400);\n\t\thm.put(\"vaishu\", 300);\n\t\thm.put(null, 500);\n\t\thm.put(null, 600);\n\t\t// System.out.println(hm);\n\n\t\tCollection values = hm.values();\n//\t\tSystem.out.println(values);\n\n\t\tSet entrySet = hm.entrySet();\n\t\t// System.out.println(entrySet);\n\n\t\tIterator iterator = entrySet.iterator();\n\t\twhile (iterator.hasNext()) {\n\t\t\tMap.Entry entry = (Map.Entry) iterator.next();\n\t\t\t// System.out.println(entry.getKey()+\":\"+entry.getValue());\n\t\t}\n\n\t}", "public static void main(String[] args) {\n\r\n\t\tint arr[]={2, 3, 2, 4, 5, 12, 2, 3, 3, 3, 12};\r\n\t\tMap<Integer,Data> map = new HashMap<>();\r\n\t\tfor(int a :arr)\r\n\t\t{\r\n\t\t\tif(map.containsKey(a))\r\n\t\t\t{\r\n\t\t\t\tmap.get(a).incrementFrequency();\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tmap.put(a, new Data(a));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tSet<Data> sortedData = new TreeSet<>(map.values());\r\n\t\tList<Integer> result = new ArrayList<>();\r\n\t\tfor(Data d : sortedData)\r\n\t\t{\r\n\t\t\tfor(int i=0;i<d.frequency;i++)\r\n\t\t\t\tresult.add(d.number);\r\n\t\t}\r\n\t\tSystem.out.println(result);\r\n\t}", "public HashMap(){\n\t\tthis.numOfBins=10;\n\t\tthis.size=0;\n\t\tinitializeMap();\n\t}", "public static Histogram readFrequencyTable(String fileName) {\r\n List<String[]> data = FileUtils.readCSVFile(fileName, \";\", -1);\r\n \r\n double classWidth = Double.parseDouble(data.get(1)[0]) - Double.parseDouble(data.get(0)[0]);\r\n double start = Double.parseDouble(data.get(0)[0]) - classWidth / 2.0;\r\n double stop = Double.parseDouble(data.get(data.size() - 1)[0]) + classWidth / 2.0;\r\n \r\n Histogram table = new Histogram(start, stop, (int) ((stop - start) / classWidth));\r\n for (String[] row : data) {\r\n int frequency = (int) Double.parseDouble(row[1]);\r\n double value = Double.parseDouble(row[0]);\r\n for (int i = 0; i < frequency; i++) {\r\n table.add(value);\r\n }\r\n }\r\n return table;\r\n }", "private void printIndexMap(HashMap<String, HashSet<String>> hmap, boolean printToScreen, boolean printToFile){\n\t\t\n\t\ttry{\n\t\t\t//False overwrites old data\n\t\t\tFileWriter writer = new FileWriter(HUMAN_READABLE_INDEX, false); \n\t\t\n\t\t\t//creating output string\n\t\t\tString output = new String();\n\t for(String key: hmap.keySet()){\n\t\t \toutput = key + \" -> \" + String.join(\", \", hmap.get(key));\n\t\t \t\n\t\t //Printing to screen\n\t\t if(printToScreen)\n\t\t \tSystem.out.println(output);\n\t\t \n\t\t if(printToFile){\n\t\t\t\t\ttry {\n\t\t\t\t\t\twriter.write(output + \"\\n\");\n\t\t\t\t\t} catch (IOException e){}\t\n\t\t } \t\n\t }\n\t \n\t writer.close();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private int printMap(Map<Set<String>, Integer> f1Map, FileWriter tgFileWriter) throws IOException {\n\t\tfor(Map.Entry<Set<String>, Integer> f1MapItem : f1Map.entrySet()){\n\t\t\tfor(String p : f1MapItem.getKey()){\n\t\t\t\ttgFileWriter.append(p + \" \");\n\t\t\t}\n\t\t\ttgFileWriter.append(\": \" + f1MapItem.getValue() + \"\\n\");\n\t\t}\n\t\ttgFileWriter.flush();\n\t\treturn f1Map.size();\n\t}", "public int getCount(HashMap map) {\n\t\treturn GoodsManager.getCount(map);\n\t}", "@Test\n public void randomInt() {\n HashMap<Integer, Integer> hist = new HashMap<Integer, Integer>();\n for(int i = 0; i < 300; i++){\n // we can think of random int as a coin toss\n Integer coin = test.randInt();\n Integer coinTotal = hist.get(coin);\n if (coinTotal == null){\n hist.put(coin, 1);\n } else {\n hist.put(coin, coinTotal+1);\n }\n }\n assertTrue(\"Should be more than 100 of each\",\n hist.get(0) > 100 && hist.get(1) > 100);\n System.out.println(hist);\n }", "public void writeLengthHistogram(String fileName) {\n\t\tString contents = \"Length,Frequency\\n\";\n\t\tint literalLength = 0;\n\t\tint frequency = 0;\n\t\tfor(String literal : literalsList) {\n\n\t\t\tliteral = literal.substring(literal.indexOf(\"\\\"\")+1, literal.lastIndexOf(\"\\\"\"));\n\t\t\t\n\t\t\tif(literal.length() == literalLength) {\n\t\t\t\tfrequency++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcontents += Integer.toString(literalLength) + \",\" + \n\t\t\t\t\t\t\tInteger.toString(frequency) + \"\\n\";\n\t\t\t\tfrequency = 1;\n\t\t\t\tliteralLength = literal.length();\n\t\t\t}\n\t\t}\n\t\tFileManager.writeToFile(fileName, contents);\n\t}", "public Map<Integer, Float> getPercentInFrequency() {\n\t\t\tMap<Integer, Float> percents = new LinkedHashMap<Integer, Float>();\n\t\t\t\n\t\t\tint[][] times = getTimeInFrequency();\n\t\t\tif (times == null || times.length == 0) return null;\n\t\t\t\n\t\t\tlong total = 0;\n\t\t\t\n\t\t\tfor (int i = 0; i < times.length; ++i) {\n\t\t\t\ttotal += times[i][1];\n\t\t\t}\n\t\t\t\n\t\t\tif (total == 0) return null;\n\t\t\t\n\t\t\tfor (int i = 0; i < times.length; ++i) {\n\t\t\t\tpercents.put(times[i][0], (float) times[i][1] / total * 100);\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn percents;\n\t\t}", "JFreeChart generateHist();", "public static Histogram createFrequencyTable(List<Double> values, double classWidth, double start,\r\n double stop) {\r\n Histogram histogram = new Histogram(start, stop, (int) ((stop - start) / classWidth));\r\n for (Double value : values) {\r\n histogram.add(value);\r\n }\r\n assert histogram.getSumFreq() == values.size() : \"Number of items in bins does not correspond with total number of items\";\r\n \r\n return histogram;\r\n }", "public CountingMap( Map<K, Integer> map ) {\n this.map = map;\n }", "public static String formatRecordedMessages(Map<TransactionType, Histogram<String>> map){\n Map<TransactionType, Histogram<String>> treeMap = new TreeMap<TransactionType, Histogram<String>>(map);\n StringBuilder s = new StringBuilder();\n\n // The format should be \"TransactionType [count] message\"\n String str = \"%-20s [%4d] %s\";\n\n // Loop through the entries\n for (TransactionType key : treeMap.keySet()){\n Histogram<String> hist = treeMap.get(key);\n for (String msg : hist.values()){\n int count = hist.get(msg);\n\n if (count > 0){\n s.append(String.format(str, key, count, StringUtil.abbrv(msg, 80)));\n s.append('\\n');\n }\n }\n }\n\n return s.toString();\n }", "private static void printTable(int numberOfDocs) {\n \n Gson gs = new Gson();\n String json = gs.toJson(wor);\n // System.out.println(json);\n \n List<String> queryWords = new ArrayList();\n //to test it for other query word you can change the following two words\n //queryWords.add(\"carpet\");\n //queryWords.add(\"hous\");\n queryWords.add(\"the\");\n queryWords.add(\"crystallin\");\n queryWords.add(\"len\");\n queryWords.add(\"vertebr\");\n queryWords.add(\"includ\");\n \n \n FrequencySummary frequencySummary = new FrequencySummary();\n frequencySummary.getSummary(json,docName, queryWords);\n \n System.exit(0);\n \n Hashtable<Integer,Integer> g = new Hashtable<>();\n \n /* wor.entrySet().forEach((wordToDocument) -> {\n String currentWord = wordToDocument.getKey();\n Map<String, Integer> documentToWordCount = wordToDocument.getValue();\n freq.set(0);\n df.set(0);\n documentToWordCount.entrySet().forEach((documentToFrequency) -> {\n String document = documentToFrequency.getKey();\n Integer wordCount = documentToFrequency.getValue();\n freq.addAndGet(wordCount);\n System.out.println(\"Word \" + currentWord + \" found \" + wordCount +\n \" times in document \" + document);\n \n if(g.getOrDefault(currentWord.hashCode(), null)==null){\n g.put(currentWord.hashCode(),1);\n \n }else {\n System.out.println(\"Hello\");\n \n int i = g.get(currentWord.hashCode());\n System.out.println(\"i \"+i);\n g.put(currentWord.hashCode(), i++);\n }\n // System.out.println(currentWord+\" \"+ g.get(currentWord.hashCode()));\n // g.put(currentWord.hashCode(), g.getOrDefault(currentWord.hashCode(), 0)+wordCount);\n \n });\n // System.out.println(freq.doubleValue());\n \n // System.out.println(\"IDF for this word: \"+Math.log10( (double)(counter/freq.doubleValue())));\n });\n // System.out.println(g.get(\"plai\".hashCode()));\n //System.out.println(\"IDF for this word: \"+Math.log10( (double)(counter/(double)g.get(\"plai\".hashCode()))));\n */\n }", "public static Map<String, Integer> getFrequencies() {\n return UNIGRAM;\n }", "public void popFrequency(int height);", "public void printPotionMap(Map<Potion,Integer> map) {\n\t\n\t\tSystem.out.println(\"**** Available Potions ****\");\n\t\tSystem.out.println(\"ID\\tName\\t\\tAmount\\tIncrease\\tAttributes\");\n\t\tSystem.out.println(\"===========================================================\");\n\t\tint id = 1;\n\t\t\n\t\tIterator<Entry<Potion, Integer>> iter = map.entrySet().iterator();\n\t\twhile(iter.hasNext()) {\n\t\t\t Map.Entry<Potion, Integer> pair = iter.next();\n\t\t\t Potion p = pair.getKey();\n\t\t\t int amount = pair.getValue();\n\t\t\t System.out.printf(id++ + \"\\t\" + p.getName() + \"\\t\\t\" + amount + \"\\t\"+ p.getAmount()\t+ \"\\t\");\n\t\t\tfor(StatType t : p.getTypes()) {\n\t\t\t\tSystem.out.printf(t.toString() + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t\t\n\t\tSystem.out.println();\n\t\t\n\t}", "public double[] histogram() {\n int[][] data = toArray();\n double[] ans = new double[256];\n int totalSize = data.length * data[0].length;\n\n for (int i = 0; i < data.length; i++) {\n for (int j = 0; j < data[i].length; j++) {\n ans[data[i][j]]++;\n }\n }\n for (int i = 0; i < ans.length; i++) {\n ans[i] = ans[i] / totalSize;\n }\n return ans;\n }", "private static void fillDataMapFromFrequencyFile(File frequencyFile, HashMap<String, Long> dataMap) throws IOException {\n\n\t\tfinal BufferedReader frequencyReader = new BufferedReader(new FileReader(frequencyFile));\n\n\t\tList<String> lines = frequencyReader.lines()\n\t\t\t\t.collect(Collectors.toList());\n\n\t\tfrequencyReader.close();\n\n\t\tfor(int i = 0, size = lines.size(); i < size; i++) { // Split each line at the delimiter, into word & frequency - put them in the data map\n\n\t\t\tfinal String[] dataSplit = lines.get(i).split(WORD_FREQUENCY_DELIMITER);\n\t\t\tfinal String word = dataSplit[0];\n\t\t\tfinal long frequency = Long.parseLong(dataSplit[1]);\n\n\t\t\tdataMap.put(word, frequency);\n\t\t}\n\t}", "public static void getPerms(HashMap<Character,Integer> freqMap,String prefix,int length,ArrayList<String> result) {\n if(length==0) {\n result.add(prefix);\n return;\n }\n for(Character c:freqMap.keySet()){\n Integer count= freqMap.get(c);\n if(count>0){\n freqMap.put(c,count-1);\n getPerms(freqMap,prefix+c,length-1,result);\n freqMap.put(c,count);\n }\n\n }\n }", "public void print(){\n for (int i = 0; i < hashTable.length; i++){\n if (hashTable[i] != null){\n LLNodeHash ptr = hashTable[i];\n while (ptr.getNext() != null){\n System.out.print(\"(\" + ptr.getKey() + \", \" + ptr.getFreq() + \")\");\n ptr = ptr.getNext();\n }\n System.out.print(\"(\" + ptr.getKey() + \", \" + ptr.getFreq() + \")\");\n }\n }\n }", "public IntensityImage drawHistogram(boolean cumulative)\r\n {\r\n\treturn drawHistogram(cumulative, 200, 1);\r\n }", "float getFrequency();", "public void setFrequencies() {\n\t\tleafEntries[0] = new HuffmanData(5000, 'a');\n\t\tleafEntries[1] = new HuffmanData(2000, 'b');\n\t\tleafEntries[2] = new HuffmanData(10000, 'c');\n\t\tleafEntries[3] = new HuffmanData(8000, 'd');\n\t\tleafEntries[4] = new HuffmanData(22000, 'e');\n\t\tleafEntries[5] = new HuffmanData(49000, 'f');\n\t\tleafEntries[6] = new HuffmanData(4000, 'g');\n\t}", "public Statistics(Map<Long,Double> map) {\n this.setCount((long) map.values().size());\n Double defaultValue = Double.valueOf(0);\n this.setSum(map.values().stream().mapToDouble(Double::doubleValue).sum());\n this.setAvg(map.values().stream().mapToDouble(Double::doubleValue).average().orElse(defaultValue));\n this.setMax(map.values().stream().max(Double::compareTo).orElse(defaultValue));\n this.setMin(map.values().stream().min(Double::compareTo).orElse(defaultValue));\n }", "@Override\n public void paint(Graphics g) {\n \t Graphics2D g2 = (Graphics2D) g;\n Dimension size = getSize();\n Font font = new Font(\"Arial\", Font.PLAIN, 14);\n \n g.setFont(font);\n \n String tempString = histTitle;\n FontRenderContext frc = ((Graphics2D)g).getFontRenderContext();\n Rectangle2D boundsTemp = font.getStringBounds(tempString, frc);\n Rectangle2D boundsCond = font.getStringBounds(\"\", frc);\n int wText = Math.max((int)boundsTemp.getWidth(), (int)boundsCond.getWidth());\n int hText = (int)boundsTemp.getHeight() + (int)boundsCond.getHeight();\n int rX = (size.width-wText)/2;\n int rY = (size.height-hText)/2;\n \n g.setColor(Color.WHITE);\n g2.fillRect(0, 0, size.width, size.height);\n \n g.setColor(Color.BLACK);\n int xTextTemp = rX-(int)boundsTemp.getX(); // centres the text\n int yTextTemp = rY-(int)boundsTemp.getY();\n g.drawString(tempString, xTextTemp, 20);\n \n int maxX = size.width;\n int maxY = size.height;\n int yAxis_startX = 20; int yAxis_startY=maxY-20; int yAxis_endX=20; int yAxis_endY=20;\n int xAxis_startX = 20; int xAxis_startY=maxY-20; int xAxis_endX=maxX-20; int xAxis_endY=maxY-20;\n \n drawArrow(g, yAxis_startX, yAxis_startY, yAxis_endX, yAxis_endY, ArrowDirection.UPWARD);\n drawArrow(g, xAxis_startX, xAxis_startY, xAxis_startX+513, xAxis_endY, ArrowDirection.LEFTWARD); // what the hell. Let's fix hist width to 512 + 1 pixels (two pixels for each grayscale value)\n \n if (pierwszy==null) { // Clear the histogram view\n \t g.setColor(Color.WHITE);\n \t g.fillRect(yAxis_endX+1, yAxis_endY-1, 512, yAxis_startY-yAxis_endY-1);\n \t System.out.println(\"Cleared hist\");\n }\n else\n {\n \t BufferedImage grayScaled = new BufferedImage(pierwszy.getWidth(), pierwszy.getHeight(), BufferedImage.TYPE_BYTE_GRAY);\n \t Graphics gg = grayScaled.getGraphics();\n \t System.out.println(\"W=\"+grayScaled.getWidth()+\", H=\"+grayScaled.getHeight());\n \t gg.drawImage(pierwszy, 0, 0, null);\n \t lut = getGrayscaleHist(grayScaled);\n \t int maxBarHeight = yAxis_endY-yAxis_startY-1;\n \t paintBars(g, lut, xAxis_startX+1, xAxis_startY-1, maxBarHeight);\n }\n }", "private Double getValuesAvg(Map<Integer, Double> map) {\n\t\t// Go over the values and compute the average\n\t\tDouble avg = 0.0;\n\t\tfor (Double entry : map.values()) {\n\t\t\tavg += entry;\n\t\t}\n\t\tavg /= map.size();\n\t\treturn avg;\n\t}", "private static void sortMap(HashMap<Integer, Integer> map) {\n\t\t\n\t}", "public static void printMap(Map<String, Double> map, String filename) throws FileNotFoundException, UnsupportedEncodingException{\n\t\t\t\n\t\t\tPrintWriter writer = new PrintWriter(\"C:/Naveen/CCS/IR/AP89_DATA/AP_DATA/IndexWithStoppingAndWithStemming/\"+filename, \"UTF-8\");\n\t for (Entry<String, Double> entry : map.entrySet()){\n\t \t \n\t \t\twriter.println(entry.getKey()+\" \"+entry.getValue()+\" Exp\");\n\t }\n\t writer.close();\n\t }", "public static void generateHistogram(int primeArray[]){\n int i, j;\n int occurrences = 0;\n \n int scale = determineScale(primeArray);\n \n System.out.println(\"\\n\\nPrime Sequence Histogram\\n\");\n for(i = 0; i < MAX_DIGIT; i++){\n System.out.format(\"%d%1s\", i, \" | \");\n for(j = 0; j < primeArray.length; j++){\n if((primeArray[j] % MAX_DIGIT) == i)\n occurrences++; \n }\n for(j = 0; j < (occurrences / scale); j++)\n System.out.format(\"%-5s\", \"* \");\n occurrences = 0;\n System.out.println();\n }\n System.out.print(\" ___________________________________________\\n \");\n for(i = 1; i < MAX_DIGIT; i++)\n System.out.format(\"%-5d\", (i * scale) );\n \n }", "public static void main(String[] args) throws FileNotFoundException {\n\t\t\n\t\tint currentHash = 0; /* will be changed in the while loop to store the hash code for current word*/\n\t\tString currentWord; /* will be changed in the while loop to store the current word*/\n\t\t\n\t\tChainHashMap<myString, Integer> wordFrequency = new ChainHashMap<myString, Integer>(500); /* create the chain hash map with the size of 500; there is 500 buckets in the map*/\n\t\t\n\t\t\n\t\tFile file = new File(\"/Users/Jacob/Downloads/shakespeare.txt\");\n\t\t/*please notice that the file cannot be found on the address given above, change it to test if it works!*/\n\t\tScanner input = new Scanner(file); /* should be changed to file after debugging*/\n\t\t\n\t\t\n\t\twhile(input.hasNext()){\n\t\t\tcurrentWord = input.next();\n\t\t\t\n\t\t\twhile(currentWord.equals(\".\") || currentWord.equals(\",\") || currentWord.equals(\"!\") || currentWord.equals(\"?\") || currentWord.equals(\";\") || currentWord.equals(\":\")){\n\t\t\t\tif(input.hasNext()){\n\t\t\t\t\tcurrentWord = input.next();\n\t\t\t\t}else{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmyString wordString = new myString(currentWord);\n\t\t\t\n\t\t\tif(wordFrequency.get(wordString) == null){\n\t\t\t\t\n\t\t\t\twordFrequency.put(wordString, 1); /* the key is the string and the value should be the word frequency*/\n\t\t\t}else{\n\n\t\t\t\twordFrequency.put(wordString, wordFrequency.get(wordString) + 1); /* if the key is already in the map, increment the word frequency by 1*/\n\t\t\t}\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t/* till this point, all the work of Shakespeare have been stored in the chained hash map*/\n\t\t/* the heap is used to get the top 1000 frequent work*/\n\t\t/* it adds the element to the heap and when the size of the heap reaches 1000, the word with the lowest will be removed, which is the root of the heap*/\n\t\t/* the two element in the entry for the heap should be exchanged; the key should store the frequencies and the the value should be the string */\n\t\t\n\t\tHeapAdaptablePriorityQueue<Integer, String> frequencyHeap = new HeapAdaptablePriorityQueue<Integer, String>();\n\t\t\n\t\tfor(Entry<myString, Integer> word: wordFrequency.entrySet()){\n\t\t\tint currentFrequency = word.getValue(); /* store the value of the entry in the chain hash map, will be used as the key for the heap*/\n\t\t\tString currentString = word.getKey()._word; /* store the string in the key of the entry of the chain hash map, will be used as the value for the heap*/\n\t\t\t\n\t\t\tfrequencyHeap.insert(currentFrequency, currentString);\n\t\t\t\n\t\t\tif(frequencyHeap.size() > 1000){\t\t\t\t\n\t\t\t\tfrequencyHeap.removeMin(); /* keep the heap size fixed at 1000; remove the minimum in the heap if the size exceeds 1000*/\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* till now, all the entries has been stored in the heap*/\n\t\t/* get the minimum value and key (the frequency and the corresponding word), then remove the minimum from the heap*/\n\t\t/* the data is stored in the excel form; the screen shot is provided in the document*/\n\t\t\n\t\twhile(frequencyHeap.size() > 0){\n\t\t\tSystem.out.println(frequencyHeap.min().getValue()); /* get the word from the ascending order of the frequency*/\n\t\t\tSystem.out.println(frequencyHeap.min().getKey()); /* get the frequency of the word*/\n\t\t\t\n\t\t\tfrequencyHeap.removeMin();\n\t\t}\n\n\t\t\n\t}", "public Histogram(short[][] matrix)\r\n {\r\n\tdepth = 256;\r\n\tcalcHistogram(matrix);\r\n\r\n\t// The sum of the elements in the histogram equals the number\r\n\t// of elements in the matrix\r\n\tsum = matrix.length * matrix[0].length;\r\n }", "private static void wordCountWithMap() throws FileNotFoundException {\n Map<String, Integer> wordCounts = new HashMap<String, Integer>();\n\n Scanner input = new Scanner(new File(fileLocation));\n while (input.hasNext()) {\n String word = input.next();\n if (!wordCounts.containsKey(word)) {\n wordCounts.put(word, 1);\n } else {\n int oldValue = wordCounts.get(word);\n wordCounts.put(word, oldValue + 1);\n }\n }\n\n String term = \"test\";\n System.out.println(term + \" occurs \" + wordCounts.get(term));\n\n // loop over the map\n for (String word : wordCounts.keySet()) {\n int count = wordCounts.get(word);\n if (count >= 500) {\n System.out.println(word + \", \" + count + \" times\");\n }\n }\n\n }", "public String addBigramHistogramEntry(String line, String previousWord,\n Map<String, Integer> bigramHistogramMap) {\n\n //-- O(n)\n line = removeNonAlphabeticCharactersFrom(line);\n\n if (line.equals(\"\")) {\n return previousWord;\n }\n\n String[] tokens = line.split(\"\\\\s+\");\n tokens[0] = tokens[0].toLowerCase();\n\n String previousToken = previousWord.equals(\"\") ? tokens[0] : previousWord;\n\n int offset = previousWord.equals(\"\") ? 1 : 0;\n\n for (int i = offset; i < tokens.length; i++) {\n\n if (tokens[i].equals(\"\")) {\n continue;\n }\n\n tokens[i] = tokens[i].toLowerCase();\n\n String key = previousToken + \" \" + tokens[i];\n previousToken = tokens[i];\n\n Integer frequency = bigramHistogramMap.get(key);\n\n if (frequency == null) {\n bigramHistogramMap.put(key, 1);\n } else {\n bigramHistogramMap.put(key, frequency + 1);\n }\n }\n\n return previousToken;\n }", "private static HashMap<String, Double> ComputeRelativeFrequencyLetters(String text) {\n\tlong length = text.length();\n\tHashMap<String, Integer> freqMap = new HashMap<String, Integer>();\n\n\t//Search through the string and count each character.\n\tfor (int i = 0; i < length; i++) {\n\t char character = text.charAt(i);\n\n\t if ((character >= 'A' && character <= 'Z'))\n\t {\n\t\tint freq;\n\t\t//If we haven't seen this character yet, frequency is 1, otherwise, increment it.\n\t\tif (freqMap.get(Character.toString(character)) == null) {\n\t\t freq = 1;\n\t\t}\n\t\telse {\n\t\t freq = freqMap.get(Character.toString(character)) + 1;\n\t\t}\n\t\tfreqMap.put(Character.toString(character), freq);\n\t }\n\t}\n\n\tHashMap<String, Double> relativeFreqMap = new HashMap<String, Double>();\n\tlong totalFreq = 0;\n\n\t//Find total frequency by adding all frequencies together.\n\tfor (Entry<String, Integer> entry : freqMap.entrySet()) {\n\t totalFreq += entry.getValue();\n\t}\n\n\t//Find relative frequency of all letters.\n\tfor (Entry<String, Integer> entry : freqMap.entrySet()) {\n\t double relativeFreq = (double)entry.getValue() / (double)totalFreq;\n\t relativeFreqMap.put(entry.getKey(), relativeFreq);\n\t}\n\n\treturn relativeFreqMap;\n }", "public void printMap(Map<String, Integer> printMap, String[] outputLabels, int printNum){\n\t\tIterator mapIterator = printMap.entrySet().iterator();\n\t\tint j = 1;\n\t\tList<String> keys = new ArrayList<String>();\n\t\tList<Integer> values = new ArrayList<Integer>();\n\t\tString[] chartLabels = this.getChartLabels(outputLabels);\n\t\twhile(mapIterator.hasNext()){\n Map.Entry pair = (Map.Entry)mapIterator.next();\n if (j > printMap.size() - printNum){\n \tSystem.out.println(pair.getKey() + \": \" + (int)pair.getValue() + \" routes\");\n \tkeys.add((String) pair.getKey());\n \tvalues.add((Integer) pair.getValue());\n }\n if (!mapIterator.hasNext()){\n \tString message = outputLabels[0] + \": \" + (int)pair.getValue() + \"\\n\"\n \t\t\t+ outputLabels[1] + \": \" + pair.getKey();\n \tJOptionPane.showMessageDialog(null, message);\n \tSystem.out.println(outputLabels[0] + \": \" + (int)pair.getValue());\n System.out.println(outputLabels[1] + \": \" + pair.getKey());\n }\n j++;\n }\n\t\tSystem.out.println();\n\t\tfinal ChartUtils demo = new ChartUtils(\"Bar Chart\", keys, values, chartLabels);\n demo.pack();\n RefineryUtilities.centerFrameOnScreen(demo);\n demo.setVisible(true);\n\t}", "private static void putTileHash(HashMap<Integer,Integer> hashes, int hash) {\n\t\tInteger freq = hashes.remove(hash);\n\t\thashes.put(hash, (freq == null) ? 1 : freq+1);\n\t}", "private static void doBucketCount(HashMap<String, Integer> bigramCount) {\n\t\t//bucketCountT\n\t\tbucketCountT= new HashMap<Integer,Double>();\n\t\t\t\t\n\t\tfor(String s:bigramCount.keySet()){\n\t\t\tdouble count= bucketCountT.getOrDefault(bigramCount.get(s), (double)0);\n\t\t\tbucketCountT.put(bigramCount.get(s), count+1);\n\t\t}\n\t}", "public static void getOriginalFrequencies(double[] f)\n {\n f[0] = 0.0866;\n f[1] = 0.0440;\n f[2] = 0.0391;\n f[3] = 0.0570;\n f[4] = 0.0193;\n f[5] = 0.0367;\n f[6] = 0.0581;\n f[7] = 0.0833;\n f[8] = 0.0244;\n f[9] = 0.0485;\n f[10] = 0.0862;\n f[11] = 0.0620;\n f[12] = 0.0195;\n f[13] = 0.0384;\n f[14] = 0.0458;\n f[15] = 0.0695;\n f[16] = 0.0610;\n f[17] = 0.0144;\n f[18] = 0.0353;\n f[19] = 0.0709;\n }", "public void setFrequencies(Set<Frequency> arg0) {\n \n }", "private static HashMap<String, Double> ComputeRelativeFrequencyDigraphs(String text) {\n\tlong length = text.length();\n\n\t//We need at least 2 characters.\n\tif (length <= 1) {\n\t return new HashMap<String, Double>();\n\t}\n\n\tHashMap<String, Integer> freqMap = new HashMap<String, Integer>();\n\n\t//Look at this character, and the next one to determine digraphs.\n\tfor (int i = 0; i < length - 1; i++) {\n\t char character1 = text.charAt(i);\n\t char character2 = text.charAt(i+1);\n\n\t if (((character1 >= 'A' && character1 <= 'Z')) &&\n\t\t((character2 >= 'A' && character2 <= 'Z')))\n\t {\n\t\tint freq;\n\t\t//If we haven't seen this combination yet, add it with a frequency of 1.\n\t\tif (freqMap.get(\"\" + character1 + character2) == null) {\n\t\t freq = 1;\n\t\t}\n\t\telse {\n\t\t freq = freqMap.get(\"\" + character1 + character2) + 1;\n\t\t}\n\t\t\n\t\tfreqMap.put((\"\" + character1 + character2), freq);\n\t }\n\t}\n\n\tHashMap<String, Double> relativeFreqMap = new HashMap<String, Double>();\n\tlong totalFreq = 0;\n\n\t//Find total frequency by adding all frequencies together.\n\tfor (Entry<String, Integer> entry : freqMap.entrySet()) {\n\t totalFreq += entry.getValue();\n\t}\n\n\t//Find relative frequency of all letters.\n\tfor (Entry<String, Integer> entry : freqMap.entrySet()) {\n\t double relativeFreq = (double)entry.getValue() / (double)totalFreq;\n\t relativeFreqMap.put(entry.getKey(), relativeFreq);\n\t}\n\n\treturn relativeFreqMap;\n }", "private void updateCountersOfMap(final Map<String, Integer> map, final String key) {\n Integer visitTimes = map.get(key);\n visitTimes = (visitTimes != null ? visitTimes : 0);\n map.put(key, visitTimes + 1);\n }", "public void calcHistogramLUT(int dimProduct){\n histLUT = new ArrayList<int[]>();\n \n // Fill the lookup table\n int[] rhistogram = new int[256];\n int[] ghistogram = new int[256];\n int[] bhistogram = new int[256];\n \n for(int i=0; i<rhistogram.length; i++) rhistogram[i] = 0;\n for(int i=0; i<ghistogram.length; i++) ghistogram[i] = 0;\n for(int i=0; i<bhistogram.length; i++) bhistogram[i] = 0;\n \n long sumr = 0;\n long sumg = 0;\n long sumb = 0;\n \n // Calculate the scale factor\n float scale_factor = (float) (255.0 / dimProduct);\n \n for(int i=0; i<rhistogram.length; i++) {\n sumr += histogram.get(0)[i];\n int valr = (int) (sumr * scale_factor);\n if(valr > 255) {\n rhistogram[i] = 255;\n }\n else rhistogram[i] = valr;\n \n sumg += histogram.get(1)[i];\n int valg = (int) (sumg * scale_factor);\n if(valg > 255) {\n ghistogram[i] = 255;\n }\n else ghistogram[i] = valg;\n \n sumb += histogram.get(2)[i];\n int valb = (int) (sumb * scale_factor);\n if(valb > 255) {\n bhistogram[i] = 255;\n }\n else bhistogram[i] = valb;\n }\n \n histLUT.add(rhistogram);\n histLUT.add(ghistogram);\n histLUT.add(bhistogram); \n }", "java.lang.String getFrequency();", "private static double freqOfKey(int index) {\n return 440 * Math.pow(2, (double) (index - 12) / 24);\n }", "private static double exerciseMap(int threadCount, int perThread, int range, \n final OurMap<Integer, String> map) {\n Thread[] threads = new Thread[threadCount];\n for (int t=0; t<threadCount; t++) {\n final int myThread = t;\n threads[t] = new Thread(() -> {\n Random random = new Random(37 * myThread + 78);\n for (int i=0; i<perThread; i++) {\n Integer key = random.nextInt(range);\n if (!map.containsKey(key)) {\n // Add key with probability 60%\n if (random.nextDouble() < 0.60) \n map.put(key, Integer.toString(key));\n } \n else // Remove key with probability 2% and reinsert\n if (random.nextDouble() < 0.02) {\n map.remove(key);\n map.putIfAbsent(key, Integer.toString(key));\n }\n }\n final AtomicInteger ai = new AtomicInteger();\n map.forEach(new Consumer<Integer,String>() { \n public void accept(Integer k, String v) {\n ai.getAndIncrement();\n }});\n // System.out.println(ai.intValue() + \" \" + map.size());\n });\n }\n for (int t=0; t<threadCount; t++) \n threads[t].start();\n map.reallocateBuckets();\n try {\n for (int t=0; t<threadCount; t++) \n threads[t].join();\n } catch (InterruptedException exn) { }\n return map.size();\n }", "public static void displayCount1(HashMap<String, Integer> bigramCount) throws IOException{\n\t\tString str=\"\";\n\n\t\t//display bigram Counts\n\t\tfor(String s:bigramCount.keySet()){\n\t\t\tstr+=s + \" \"+ String.valueOf(bigramCount.get(s))+\"\\n\";\n\t\t}\n\t\tstr+=\"\\n\";\n\t\twriter1.write(str);\n\t}", "private void fillTermsDF(SortedMap<String, String[]> finalDictionary){\n termsDF = new HashMap<>();\n ArrayList<String> terms = new ArrayList<>(finalDictionary.keySet());\n\n for(String term : terms){\n termsDF.put(term,finalDictionary.get(term)[1]);\n }\n }", "private static int getHashOfMap(\n HashSet<Class> pre, Object mapObj, int prevDepth) {\n if (!(mapObj instanceof Map)) {\n logger.error(\"The given object (\" + mapObj + \") of class \" +\n mapObj.getClass() + \" is not a map.\",\n new IllegalStateException());\n Runtime.getRuntime().halt(1);\n }\n\n int cnt = 0, hash = 0;\n for (Object key : ((Map) mapObj).keySet()) {\n if (cnt++ >= Config.fanoutFactor) {\n break;\n }\n int keyHash = getHash(pre, key, prevDepth);\n int valHash = getHash(pre, ((Map) mapObj).get(key), prevDepth);\n String entryString = keyHash + \"->\" + valHash;\n hash += entryString.hashCode();\n }\n return hash;\n }", "private Map<Character, Double> getStrFrequencyTable(String str) {\n str = str.toLowerCase(Locale.ENGLISH);\n\n Map<Character, Double> frequencyTable = new HashMap<>(26);\n int[] countArr = countLetters(str);\n int numOfLetters = Arrays.stream(countArr).sum();\n\n for (char alphabet = 'a'; alphabet <= 'z'; alphabet++) {\n double frequency = 0.0;\n if (numOfLetters != 0) {\n frequency = countArr[alphabet-'a'] / (double) numOfLetters;\n }\n frequencyTable.put(alphabet, frequency);\n }\n\n return frequencyTable;\n }", "public static Map<String, Integer> sortByCount(Map<String, Integer> countMap) {\n LOG.info(\"counterUtil::sortByCount:start\");\n\n //Below logic will sort the map based on \"max count\" value and will store sorted map in a LinkedHashMap\n Map<String, Integer> sortedMap = countMap.entrySet().stream().\n sorted(Collections.reverseOrder(comparingByValue())).\n collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2, LinkedHashMap::new));\n\n LOG.info(\"counterUtil::sortByCount:end\");\n return sortedMap;\n }", "@Override\n public final void onHit(final K key) {\n if (!freqHitMap.containsKey(key)) {\n freqHitMap.put(key, 1);\n return;\n }\n\n // Add 1 to times used in map\n freqHitMap.put(key, freqHitMap.get(key) + 1);\n }", "public void calculateHistograms(int[][] patternImage, int nbits) {\n\t\tfinal int height = patternImage.length;\n\t\tfinal int width = patternImage[0].length;\n\t\tfinal TIntArrayList uniformPatterns = UniformBinaryPattern.getUniformPatterns(nbits);\n\n\t\thistograms = new FloatFV[(int) Math.ceil((double) height / (double) blocksize_y)][(int) Math.ceil((double) width\n\t\t\t\t/ (double) blocksize_x)];\n\n\t\tfor (int y = 0, j = 0; y < height; y += blocksize_y, j++) {\n\t\t\tfor (int x = 0, i = 0; x < width; x += blocksize_x, i++) {\n\t\t\t\thistograms[j][i] = new FloatFV(uniformPatterns.size() + 1);\n\n\t\t\t\tfor (int yy = y; yy < Math.min(height, y + blocksize_y); yy++) {\n\t\t\t\t\tfor (int xx = x; xx < Math.min(width, x + blocksize_x); xx++) {\n\t\t\t\t\t\tfinal int idx = uniformPatterns.indexOf(patternImage[yy][xx]);\n\n\t\t\t\t\t\thistograms[j][i].values[idx + 1]++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private HashMap<String, Double> sortByValues(HashMap<String, Double> map) {\n List<Map.Entry<String, Double>> list =\n new LinkedList<>(map.entrySet());\n\n Collections.sort(list, new Comparator<Map.Entry<String, Double>>() {\n @Override\n public int compare(Map.Entry<String, Double> o1, Map.Entry<String, Double> o2) {\n return (o1.getValue()).compareTo(o2.getValue());\n }\n });\n\n HashMap<String, Double> sortedHashMap = new LinkedHashMap<>();\n for (Map.Entry<String, Double> item : list) {\n sortedHashMap.put(item.getKey(), item.getValue());\n }\n return sortedHashMap;\n }", "public void createProbsMap() {\n\t\tif(this.counts == null) {\n\t\t\tcreateCountMap();\n\t\t}\n\t\t\n\t\tMap<String, Double> result = new HashMap<String, Double>();\n\t\t\n\t\t// Make the counts and get the highest probability found \n\t\tdouble highestProb = 0.00;\n\t\tdouble size = (double) this.getData().size();\n\t\tfor(Entry<String, Integer> entry : counts.entrySet()) {\n\t\t\tdouble value = (double) entry.getValue();\n\t\t\tresult.put(entry.getKey(), value / size);\n\t\t\t\n\t\t\tif(value/size > highestProb) {\n\t\t\t\thighestProb = value/size;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Fill the highest probilities \n\t\tList<String> highestProbs = new ArrayList<String>();\n\t\tfor(Entry<String, Integer> entry : counts.entrySet()) {\n\t\t\tdouble value = (double) entry.getValue();\n\t\t\t\n\t\t\tif(value/size == highestProb) {\n\t\t\t\thighestProbs.add(entry.getKey());\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.highestProbs = highestProbs;\n\t\tthis.highestProb = highestProb;\n\t\tthis.probs \t\t = result;\n\t}", "public static void main(String[] args) {\n String charArray = \"aBbCccDdddeFfGggHhhhXYZ\";\n System.out.println(\"Histogram for the word entered.\");\n System.out.println(Arrays.toString(letterHist(charArray)));\n\n String numberArray = \"0123456789\";\n System.out.println(\"\\nHistogram for the number entered.\");\n System.out.println(Arrays.toString(numberHeist(numberArray)));\n }" ]
[ "0.6154941", "0.6129387", "0.612876", "0.6066822", "0.5921427", "0.5870553", "0.5735457", "0.56918544", "0.56804395", "0.5641067", "0.56148684", "0.5610541", "0.5594893", "0.55906636", "0.55691475", "0.5561908", "0.55001074", "0.54810274", "0.54656523", "0.5459856", "0.54422003", "0.5438884", "0.5426234", "0.5377052", "0.5323727", "0.5322882", "0.5319326", "0.52899516", "0.5288877", "0.52860975", "0.5282258", "0.52781045", "0.52732563", "0.5264786", "0.52644485", "0.52600175", "0.5245169", "0.52396387", "0.52385646", "0.5234544", "0.5227611", "0.52097106", "0.52075124", "0.51967764", "0.51923805", "0.51696277", "0.51630354", "0.51629275", "0.5162425", "0.51617426", "0.51466066", "0.51392287", "0.51354665", "0.5107368", "0.5101425", "0.5077194", "0.5074487", "0.5067768", "0.5061422", "0.5053731", "0.5015121", "0.50076795", "0.49971265", "0.4987086", "0.49551997", "0.49526855", "0.4942859", "0.4932926", "0.49241894", "0.49131826", "0.49129516", "0.4902739", "0.48953524", "0.48913237", "0.4890388", "0.48863444", "0.48811835", "0.48782846", "0.48751995", "0.48693335", "0.4865822", "0.48592526", "0.48519844", "0.48475704", "0.4844721", "0.4843943", "0.48437077", "0.48271963", "0.48235756", "0.48232594", "0.4822079", "0.48189658", "0.48175672", "0.48145667", "0.48113328", "0.48101148", "0.4802949", "0.47962567", "0.47944906", "0.47721094" ]
0.8371269
0
Converts a map of pojos keyed by string to a map of adapters keyed by the same strings.
private Map<String, ObjectAdapter> wrap(final Map<String, Object> argumentsByParameterName) { final Map<String, ObjectAdapter> argumentsAdaptersByParameterName = _Maps.newHashMap(); for (final Map.Entry<String, Object> entry : argumentsByParameterName.entrySet()) { final String parameterName = entry.getKey(); final Object argument = argumentsByParameterName.get(parameterName); final ObjectAdapter argumentAdapter = argument != null ? adapterProvider.apply(argument) : null; argumentsAdaptersByParameterName.put(parameterName, argumentAdapter); } return argumentsAdaptersByParameterName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void convertitMap(Map<String, Object> map) {\n\t\t\n\t}", "public Map toMap(Map<String, Object> map) {\n return super.toMap(map);\n }", "public abstract Map<String, Serializable> toMap();", "public Object[] adapt( Map<String, Object> objs, Object arg );", "public abstract Map<String, Object> toMap(T object);", "public Map<String, String> a(Map<String, String> map, @Nullable Map<String, String> map2) {\n LinkedHashMap linkedHashMap = new LinkedHashMap(map);\n if (map2 == null) {\n return linkedHashMap;\n }\n for (Entry entry : map2.entrySet()) {\n String str = (String) entry.getKey();\n String str2 = (String) linkedHashMap.get(str);\n linkedHashMap.put(str, a(str).a(str2, (String) entry.getValue()));\n }\n return linkedHashMap;\n }", "public <K> Map<K, JAVATYPE> convertMap(Map<K, JAVATYPE> oldMap, final METATYPE meta);", "Map<String, String> asMap();", "private Map<String, String> m15124a(Map<String, String> map) {\n String str;\n String str2;\n HashMap hashMap = new HashMap();\n if (map != null) {\n for (Entry entry : map.entrySet()) {\n Object key = entry.getKey();\n Object value = entry.getValue();\n if (!(key instanceof String) || !(value instanceof String)) {\n C7262l b = this.f13489a.mo23049b();\n StringBuilder sb = new StringBuilder();\n sb.append(\"Unexpected class type in trackEvent(); all keys and values passed as parameters must be String. Encountered \");\n sb.append(key.getClass().getCanonicalName());\n sb.append(\"/\");\n sb.append(value.getClass().getCanonicalName());\n sb.append(\"; will use toString() value instead, which may be unexpected...\");\n b.mo22913a(\"EventServiceImpl\", sb.toString());\n str = key.toString();\n str2 = value.toString();\n } else {\n str = (String) key;\n str2 = (String) value;\n }\n hashMap.put(str, str2);\n }\n }\n return hashMap;\n }", "@Override // io.reactivex.functions.Function\n public Iterable<? extends Map.Entry<? extends String, ? extends String>> apply(Map<String, ? extends String> map) {\n Map<String, ? extends String> map2 = map;\n Intrinsics.checkNotNullParameter(map2, \"it\");\n return map2.entrySet();\n }", "private static void initializeMap() {\n addressTypeToSerializerMap = new HashMap<>();\n addressTypeToSerializerMap.put(NoAddressAfi.VALUE, NoAddressSerializer.getInstance());\n addressTypeToSerializerMap.put(Ipv4Afi.VALUE, Ipv4Serializer.getInstance());\n addressTypeToSerializerMap.put(Ipv4BinaryAfi.VALUE, Ipv4BinarySerializer.getInstance());\n addressTypeToSerializerMap.put(Ipv4PrefixAfi.VALUE, Ipv4PrefixSerializer.getInstance());\n addressTypeToSerializerMap.put(Ipv4PrefixBinaryAfi.VALUE, Ipv4PrefixBinarySerializer.getInstance());\n addressTypeToSerializerMap.put(Ipv6Afi.VALUE, Ipv6Serializer.getInstance());\n addressTypeToSerializerMap.put(Ipv6BinaryAfi.VALUE, Ipv6BinarySerializer.getInstance());\n addressTypeToSerializerMap.put(Ipv6PrefixAfi.VALUE, Ipv6PrefixSerializer.getInstance());\n addressTypeToSerializerMap.put(Ipv6PrefixBinaryAfi.VALUE, Ipv6PrefixBinarySerializer.getInstance());\n addressTypeToSerializerMap.put(MacAfi.VALUE, MacSerializer.getInstance());\n addressTypeToSerializerMap.put(DistinguishedNameAfi.VALUE, DistinguishedNameSerializer.getInstance());\n addressTypeToSerializerMap.put(Lcaf.VALUE, LcafSerializer.getInstance());\n addressTypeToSerializerMap.put(AfiListLcaf.VALUE, AfiListSerializer.getInstance());\n addressTypeToSerializerMap.put(InstanceIdLcaf.VALUE, InstanceIdSerializer.getInstance());\n addressTypeToSerializerMap.put(ApplicationDataLcaf.VALUE, ApplicationDataSerializer.getInstance());\n addressTypeToSerializerMap.put(ExplicitLocatorPathLcaf.VALUE, ExplicitLocatorPathSerializer.getInstance());\n addressTypeToSerializerMap.put(SourceDestKeyLcaf.VALUE, SourceDestKeySerializer.getInstance());\n addressTypeToSerializerMap.put(KeyValueAddressLcaf.VALUE, KeyValueAddressSerializer.getInstance());\n addressTypeToSerializerMap.put(ServicePathLcaf.VALUE, ServicePathSerializer.getInstance());\n }", "public abstract String mapKeyToItem(String str);", "public Map<String,String> toMap(final Object object)\r\n {\r\n final HashMap<String,String> hashMap = new HashMap<String,String>();\r\n final Class<?> clazz = object.getClass();\r\n final Method[] methods = getDeclaredMethods(clazz);\r\n\r\n for( Method method : methods ) {\r\n if(\r\n method.getParameterTypes().length != 0\r\n || !methodesNamePattern.matcher(\r\n method.getName()\r\n ).matches()\r\n ) {\r\n continue;\r\n }\r\n\r\n Class<?> returnType = method.getReturnType();\r\n Object result0;\r\n\r\n if( isMappable( returnType ) ) {\r\n if( returnType.isArray() ) {\r\n Mappable[] result1 = (Mappable[])invoke(object, method, hashMap, Mappable.class);\r\n\r\n if(result1 == null) {\r\n continue;\r\n }\r\n\r\n int len = Array.getLength(result1);\r\n String methodName = method.getName();\r\n int i = 0;\r\n\r\n do {\r\n if(i >= len) {\r\n continue;// label0;\r\n }\r\n\r\n Mappable value = (Mappable)Array.get(result1, i);\r\n String name = formatIterableEntry(methodName, i, len);\r\n\r\n if(value == null) {\r\n hashMap.put(name, null);\r\n\r\n }\r\n else {\r\n MappableBuilder.addRec(hashMap, name, value);\r\n }\r\n i++;\r\n } while(true);\r\n }\r\n\r\n result0 = invoke(object, method, hashMap, Mappable.class);\r\n\r\n if(result0 != null) {\r\n MappableBuilder.addRec(\r\n hashMap,\r\n (new StringBuilder()).append(method.getName()).append(\"().\").toString(),\r\n ((Mappable) (result0) )\r\n );\r\n }\r\n continue;\r\n }\r\n\r\n if(mappableItemSet.contains(MappableItem.DO_ITERATOR) && Iterator.class.isAssignableFrom(returnType)) {\r\n Iterator<?> iter = (Iterator<?>)invoke(object, method, hashMap, Iterator.class);\r\n String name = method.getName();\r\n\r\n int i = 0;\r\n hashMap.put(\r\n formatMethodName(name),\r\n (new StringBuilder()).append(iter).toString()\r\n );\r\n while( iter.hasNext() ) {\r\n hashMap.put(\r\n formatIteratorEntry(name, i++, -1),\r\n toString( iter.next())\r\n );\r\n }\r\n continue;\r\n }\r\n\r\n if( mappableItemSet.contains( MappableItem.DO_ITERABLE ) &&\r\n Iterable.class.isAssignableFrom( returnType )\r\n ) {\r\n Iterable<?> iterLst = (Iterable<?>)invoke(object, method, hashMap, Iterable.class);\r\n Iterator<?> iter = iterLst.iterator();\r\n String methodName = method.getName();\r\n\r\n int i = 0;\r\n hashMap.put(\r\n formatMethodName( methodName ),\r\n iter == null ? null : iter.toString()\r\n );\r\n\r\n while( iter.hasNext() ) {\r\n hashMap.put(\r\n formatIterableEntry(methodName, i++, -1),\r\n toString(iter.next())\r\n );\r\n }\r\n continue;\r\n }\r\n\r\n if( mappableItemSet.contains(MappableItem.DO_ENUMERATION) && Enumeration.class.isAssignableFrom(returnType)) {\r\n Enumeration<?> enum0 = (Enumeration<?>)invoke(object, method, hashMap, Enumeration.class);\r\n String methodName = method.getName();\r\n\r\n int i = 0;\r\n hashMap.put(\r\n formatMethodName( methodName ),\r\n enum0 == null ? null : enum0.toString()\r\n );\r\n\r\n if( enum0 != null ) {\r\n while( enum0.hasMoreElements() ) {\r\n hashMap.put(\r\n formatEnumerationEntry(methodName, i++, -1),\r\n toString( enum0.nextElement() )\r\n );\r\n }\r\n }\r\n continue;\r\n }\r\n\r\n if( !shouldEvaluate(returnType) ) {\r\n continue;\r\n }\r\n\r\n Object methodResult = invoke(object, method, hashMap, Object.class);\r\n\r\n if( returnType.isArray() ) {\r\n final String methodName = method.getName();\r\n\r\n if( methodResult == null ) {\r\n hashMap.put(\r\n formatMethodName( methodName ),\r\n toString( methodResult )\r\n );\r\n }\r\n else {\r\n int len = Array.getLength( methodResult );\r\n\r\n for(int i = 0; i < len; i++) {\r\n Object value = Array.get( methodResult, i );\r\n\r\n hashMap.put(\r\n formatArrayEntry(methodName, i, len),\r\n toString(value)\r\n );\r\n }\r\n }\r\n }\r\n else {\r\n if( methodResult == null ) {\r\n hashMap.put(\r\n formatMethodName(method.getName()),\r\n null\r\n );\r\n }\r\n else {\r\n hashMap.put(\r\n formatMethodName(method.getName()),\r\n methodResult.toString()\r\n );\r\n }\r\n }\r\n }\r\n\r\n return new TreeMap<String,String>(hashMap);\r\n }", "public Map<String, String> parseFrom(Map map) {\n Map<String, String> data = new HashMap<>();\n for (Object key : map.keySet()) {\n Object value = map.get(key);\n if (value instanceof Map) {\n data.putAll(parseFrom((Map) value)); //Recursion FTW\n } else if (value != null) {\n data.put((String) key, value.toString());\n }\n }\n\n return data;\n }", "public static <T> Map<String, T> json2map(String jsonStr, Class<T> clazz)\n throws Exception {\n Map<String, Map<String, Object>> map = objectMapper.readValue(jsonStr,\n new TypeReference<Map<String, T>>() {\n });\n Map<String, T> result = new HashMap<String, T>();\n for (Map.Entry<String, Map<String, Object>> entry : map.entrySet()) {\n result.put(entry.getKey(), map2pojo(entry.getValue(), clazz));\n }\n return result;\n }", "@ZenCodeType.Caster\n @ZenCodeType.Method\n default Map<String, IData> asMap() {\n \n return notSupportedCast(\"IData[string]\");\n }", "<K extends Object, V extends Object> Map<K, V> getMap(String mapName);", "public static Map<String,Object> processJSON(String jsontoMap)\n\t{\n\t\tString[] splitkeyval=null;\n\t\tMap<String,Object> mapConvert=new HashMap();\n\t\tString[] splitjson=jsontoMap.replace(\"\\\"\",\"\").split(\",\");\n\t\tfor(int i=0;i<splitjson.length;i++)\n\t\t{\n\t\t\tif(splitjson[i].contains(\"iss\"))\n\t\t\t{\n\t\t\t\tint col=splitjson[i].indexOf(\":\");\n\t\t\t\tsplitjson[i] = splitjson[i].substring(0,col) +\"=\"\n\t\t\t + splitjson[i].substring(col + 1);\n\t\t\t\tsplitkeyval=splitjson[i].split(\"=\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t splitkeyval=splitjson[i].split(\":\");\n\t\t\t}\n\t\t\tmapConvert.put(splitkeyval[0], splitkeyval[1]);\n\t\t}\n\t\treturn mapConvert;\n\t}", "private void convert(Map map) {\n if (map == null)\n return;\n\n for (Object key : valueTypes.keySet()) {\n MessagePackObject mpo = (MessagePackObject) map.get(key);\n if (mpo != null)\n map.put(key, mpo.convert(Templates.tNullable(\n TemplateRegistry.lookup(valueTypes.get(key)))));\n }\n\n }", "@Override\r\n\t\tpublic void setTypeMap(Map<String, Class<?>> map) throws SQLException {\n\t\t\t\r\n\t\t}", "public static Properties convertStringsToProperties(Map<String, String> stringsMap) {\n Properties properties = new Properties();\n if (stringsMap != null && !stringsMap.isEmpty()) {\n stringsMap.keySet().forEach(key -> properties.setProperty(key, stringsMap.get(key)));\n }\n return properties;\n }", "public Object map(String key, Object input);", "public static Map<String, String> strToMap(String str) {\n return strToMap(str, \"|\", false);\n }", "public static Map<String, Object> toMap() {\n return toMap(null);\n }", "public static <T> Map<String, Object> json2map(String jsonStr)\n throws Exception {\n return objectMapper.readValue(jsonStr, Map.class);\n }", "public static Map<String, Byte> genNameToTypeMap(){\n byte[] types = genAllTypes();\n String[] names = genAllTypeNames();\n Map<String, Byte> ret = new HashMap<String, Byte>();\n for(int i=0;i<types.length;i++){\n ret.put(names[i], types[i]);\n }\n return ret;\n }", "static Map<Name, ObjectConverter> createConversionMap (final FeatureType input, final FeatureType toConvert) throws NonconvertibleObjectException{\n\n if(input.equals(toConvert)){\n return null;\n }\n final Map<Name, ObjectConverter> map = new HashMap<Name, ObjectConverter>();\n\n for (PropertyDescriptor toConvertDesc : toConvert.getDescriptors()) {\n for(PropertyDescriptor inputDesc : input.getDescriptors()){\n\n //same property name\n if(toConvertDesc.getName().equals(inputDesc.getName())){\n\n final Class inputClass = inputDesc.getType().getBinding();\n final Class toConvertClass = toConvertDesc.getType().getBinding();\n if(toConvertClass.equals(inputClass)){\n //same name and same type\n map.put(toConvertDesc.getName(), null);\n }else{\n //same name but different type\n if(toConvertDesc instanceof GeometryDescriptor){\n map.put(toConvertDesc.getName(), new GeomConverter(toConvertClass, inputClass));\n }else{\n map.put(toConvertDesc.getName(), ConverterRegistry.system().converter(toConvertClass, inputClass));\n }\n }\n }\n }\n }\n return map;\n\n }", "public void setScannableInfoFromMap(Map<String, String> map) {\n\t\tscannableInfoList.clear();\n\t\tif (map != null) {\n\t\t\tmap.keySet().forEach(key -> scannableInfoList.add(new ScannableInfo(key, map.get(key))));\n\t\t}\n\t}", "public HashMap<String, String> convertToHashMapOfStrings()\n {\n HashMap<String, String> hashMapOfStrings = new HashMap<String, String>();\n for (DataPreferenceEnum key : preferencesHashMap.keySet())\n {\n String valueString = preferencesHashMap.get(key).toString();\n hashMapOfStrings.put(key.toString(), valueString);\n }\n\n return (hashMapOfStrings);\n }", "@Override\n public void record2Map(final Map<String, Integer> map) {\n }", "protected void loadDefaultConverters() {\n if (converters == null) {\n converters = new ReferenceMap<Class<?>, Converter<?>>(ReferenceType.WEAK, ReferenceType.STRONG);\n } else {\n converters.clear();\n }\n // order is not important here but maintain alpha order for readability\n converters.put(BigDecimal.class, new BigDecimalConverter());\n converters.put(BigInteger.class, new BigIntegerConverter());\n converters.put(Boolean.class, new BooleanConverter());\n converters.put(Byte.class, new ByteConverter());\n converters.put(Calendar.class, new CalendarConverter());\n converters.put(Character.class, new CharacterConverter());\n converters.put(Class.class, new ClassConverter());\n converters.put(Collection.class, new CollectionConverter());\n converters.put(Date.class, new DateConverter());\n converters.put(Double.class, new DoubleConverter());\n converters.put(Enum.class, new EnumConverter());\n converters.put(File.class, new FileConverter());\n converters.put(Float.class, new FloatConverter());\n converters.put(Integer.class, new IntegerConverter());\n converters.put(Long.class, new LongConverter());\n converters.put(Map.class, new MapConverter());\n converters.put(Number.class, new NumberConverter());\n converters.put(Short.class, new ShortConverter());\n converters.put(String.class, new StringConverter());\n converters.put(java.sql.Date.class, new SQLDateConverter());\n converters.put(java.sql.Time.class, new SQLTimeConverter());\n converters.put(java.sql.Timestamp.class, new TimestampConverter());\n converters.put(URL.class, new URLConverter());\n }", "@SuppressWarnings(\"unchecked\")\n private static <T> Map<String, T> mapOf(Object... inputs) {\n Map<String, T> map = new HashMap<>();\n for (int i = 0; i < inputs.length; i += 2) {\n String key = (String) inputs[i];\n T value = (T) inputs[i + 1];\n map.put(key, value);\n }\n return map;\n }", "public interface Converter {\n Map<String,Map<String, Object>> convert(Map<String, Object> doc);\n}", "public static Map<String, String> strToMap(String str, boolean trim) {\n return strToMap(str, \"|\", trim);\n }", "private static Map<String, NullnessAnnotation> createString2AnnotationMap() {\n final Map<String, NullnessAnnotation> result = new HashMap<>();\n\n for (final NullnessAnnotation annotation : NullnessAnnotation.values()) {\n result.put(annotation.annotationName, annotation);\n result.put(annotation.fullyQualifiedClassName, annotation);\n }\n\n return Collections.unmodifiableMap(result);\n }", "private static HashMap<String, String> initMapping()\n {\n HashMap<String, String> typeMapping = new HashMap<String, String>();\n\n typeMapping.put(\"boolean\", \"boolean\");\n typeMapping.put(\"float\", \"float\");\n typeMapping.put(\"double\", \"double\");\n typeMapping.put(\"byte\", \"byte\");\n typeMapping.put(\"unsignedByte\", \"short\");\n typeMapping.put(\"short\", \"short\");\n typeMapping.put(\"unsignedShort\", \"int\");\n typeMapping.put(\"int\", \"int\");\n typeMapping.put(\"integer\", \"java.math.BigDecimal\");\n typeMapping.put(\"positiveInteger\", \"java.math.BigInteger\");\n typeMapping.put(\"unsignedInt\", \"java.math.BigInteger\");\n typeMapping.put(\"long\", \"java.math.BigInteger\");\n typeMapping.put(\"unsignedLong\", \"java.math.BigDecimal\");\n typeMapping.put(\"decimal\", \"java.math.BigDecimal\");\n typeMapping.put(\"string\", \"String\");\n typeMapping.put(\"hexBinary\", \"byte[]\");\n typeMapping.put(\"base64Binary\", \"byte[]\");\n typeMapping.put(\"dateTime\", \"javax.xml.datatype.XMLGregorianCalendar\");\n typeMapping.put(\"time\", \"javax.xml.datatype.XMLGregorianCalendar\");\n typeMapping.put(\"date\", \"javax.xml.datatype.XMLGregorianCalendar\");\n typeMapping.put(\"gDay\", \"javax.xml.datatype.XMLGregorianCalendar\");\n typeMapping.put(\"gMonth\", \"javax.xml.datatype.XMLGregorianCalendar\");\n typeMapping.put(\"gMonthDay\", \"javax.xml.datatype.XMLGregorianCalendar\");\n typeMapping.put(\"gYear\", \"javax.xml.datatype.XMLGregorianCalendar\");\n typeMapping.put(\"gYearMonth\", \"javax.xml.datatype.XMLGregorianCalendar\");\n typeMapping.put(\"duration\", \"javax.xml.datatype.Duration\");\n typeMapping.put(\"NOTATION\", \"javax.xml.namespace.QName\");\n typeMapping.put(\"QName\", \"javax.xml.namespace.QName\");\n typeMapping.put(\"anyURI\", \"String\");\n typeMapping.put(\"Name\", \"String\");\n typeMapping.put(\"NCName\", \"String\");\n typeMapping.put(\"negativeInteger\", \"java.math.BigDecimal\");\n typeMapping.put(\"NMTOKEN\", \"String\");\n typeMapping.put(\"nonNegativeInteger\", \"java.math.BigDecimal\");\n typeMapping.put(\"nonPositiveInteger\", \"java.math.BigDecimal\");\n typeMapping.put(\"normalizedString\", \"String\");\n typeMapping.put(\"token\", \"String\");\n typeMapping.put(\"any\", \"Object\");\n\n return typeMapping;\n }", "public StrStrMap(Map<String, String> map) {\n this.map.putAll(map);\n }", "public static Map<String, Class<?>> convertClassToString(List<Class<?>> lc) {\n return lc.stream()\n .collect(HashMap::new,\n (m, s) -> m.put(s.getName(), s),\n (m1, m2) -> m1.putAll(m2));\n }", "private Map<String, String> toMap(final Attributes atts) {\r\n\t\tfinal Map<String, String> values = Maps.newLinkedHashMap();\r\n\t\t\r\n\t\tfor (int index = 0; index < atts.getLength(); index++) {\r\n\t\t\tvalues.put(atts.getLocalName(index), atts.getValue(index));\r\n\t\t}\r\n\t\t\r\n\t\treturn values;\r\n\t}", "public static JSONObject jsonFromMap(Map<String, Serializable> map) {\n JSONObject json = new JSONObject();\n for (String key : map.keySet()) {\n Serializable value = map.get(key);\n // support only String or String[]\n if (value instanceof String) {\n json.put(key, value);\n } else if (value instanceof String[]) {\n JSONArray arr = new JSONArray();\n for (String s : (String[]) value) {\n arr.put(s);\n }\n\n json.put(key, arr);\n }\n }\n\n return json;\n }", "public static Map<String, String> getMapFromString(String mapStr) {\n if (StringUtils.isEmpty(mapStr)){\n return null;\n }\n Map<String, String> joinCondition = new HashMap<>();\n String[] exprs = parseStringToArray(mapStr);\n for (String expr : exprs) {\n String[] cols = expr.split(\"\\\\s*=\\\\s*\");\n joinCondition.put(cols[0], cols[1]);\n }\n return joinCondition;\n }", "private static void initializeMap() {\n\t\tmap = new HashMap<String, MimeTransferEncoding>();\n\t\tfor (MimeTransferEncoding mte : MimeTransferEncoding.values()) {\n\t\t\tmap.put(mte.string, mte);\n\t\t}\n\t}", "public void map(HashMap<String, Object> map) {\n String indexString = (String) map.get(\"serviceIndexes\");\n String[] arr = indexString.split(\",\");\n // Fill indexes from map's return value.\n for(int i = 0; i < arr.length; i++) {\n this.indexes.add(new Integer(arr[i]));\n }\n // Retrieve services from enum by index\n for(int i = 0; i < indexes.size(); i++) {\n String s = ServiceTypes.values()[indexes.get(i)].getKey();\n this.services.add(s);\n }\n }", "private static HashMap<String, String> fieldsToMap(FieldMap inMap,\r\n FIXDataDictionary inDict) {\r\n HashMap<String, String> fields = new HashMap<String, String>();\r\n Iterator<Field<?>> iterator = inMap.iterator();\r\n while(iterator.hasNext()) {\r\n Field<?> f = iterator.next();\r\n String value;\r\n if(f instanceof StringField) {\r\n value = ((StringField)f).getValue();\r\n if (inDict != null) {\r\n String humanValue = inDict.getHumanFieldValue(f.getTag(),value);\r\n if(humanValue != null) {\r\n value = new StringBuilder().append(humanValue).\r\n append(\"(\").append(value). //$NON-NLS-1$\r\n append(\")\").toString(); //$NON-NLS-1$\r\n }\r\n }\r\n } else {\r\n value = String.valueOf(f.getObject());\r\n }\r\n String name = null;\r\n if (inDict != null) {\r\n name = inDict.getHumanFieldName(f.getTag());\r\n }\r\n if(name == null) {\r\n name = String.valueOf(f.getTag());\r\n } else {\r\n name = new StringBuilder().append(name).\r\n append(\"(\").append(f.getTag()). //$NON-NLS-1$\r\n append(\")\").toString(); //$NON-NLS-1$\r\n }\r\n fields.put(name,value);\r\n }\r\n return fields;\r\n }", "private XmlElement toXmlDict(Map<String, Object> map)\n {\n XmlElement dict = new XmlElement(\"dict\");\n for (Map.Entry<String, Object> entry : map.entrySet())\n {\n dict.add(new XmlElement(\"key\", entry.getKey()));\n dict.add(objectToXml(entry.getValue()));\n }\n return dict;\n }", "private <T extends Reference> void buildMap(Map<String, T> map, List<T> objects) {\n for (T candidateObject : objects) {\n String rid = candidateObject.getId();\n log.debug(\"...... caching RID: {}\", rid);\n map.put(rid, candidateObject);\n }\n }", "public void setPluginIdentifierToNameMap(Map<String, String> pluginIdentifierToNameMap) {\n\t\tthis.pluginIdentifierToNameMap = pluginIdentifierToNameMap;\n\t}", "public static void convertRsToMap(ResultSet rs,Map<String,Object> map) throws SQLException{\n\t\tResultSetMetaData rsMeta = rs.getMetaData();\r\n\t\tint columnCount = rsMeta.getColumnCount();\r\n\t\t\r\n\t\tfor(int i = 1; i <= columnCount; i++){\r\n\t\t\tString key = rsMeta.getColumnLabel(i).toLowerCase();\r\n\t\t\t\r\n\t\t\tObject value = rs.getObject(key);\r\n\t\t\t\r\n\t\t\t//if(value instanceof oracle.sql.DATE){\r\n\t\t\t//\tvalue = new java.sql.Date(((oracle.sql.DATE)value).timestampValue().getTime());\r\n\t\t\t//}else if(value instanceof oracle.sql.TIMESTAMP){\r\n\t\t\t//\tvalue = new java.sql.Timestamp(((oracle.sql.TIMESTAMP)value).timestampValue().getTime());\r\n\t\t\t//}\r\n\t\t\t\r\n\t\t\tmap.put(key, value);\r\n\t\t}\r\n\t}", "static URITranslator map(Map<String, String> uriMappings) {\n return new MappingURITranslator(uriMappings);\n }", "public DictionaryAdapter(Map<String,String> dict) {\n mData = new ArrayList();\n mData.addAll(dict.entrySet());\n }", "private static void buildDriverMap() {\n\t\tdriverMap = new HashMap<>();\n\t\t// Web Browser class\n\t\tdriverMap.put(TestBedType.CHROME.toString(), ChromeDriver.class);\n\t\tdriverMap.put(TestBedType.SAFARI.toString(), SafariDriver.class);\n\t\tdriverMap.put(TestBedType.FIREFOX.toString(), FirefoxDriver.class);\n\t\tdriverMap.put(TestBedType.INTERNETEXPLORER.toString(), IEDriver.class);\n\t\tdriverMap.put(TestBedType.EDGE.toString(), EdgeDriver.class);\n\n\t\t// Mobile Browser class\n\t\tdriverMap.put(TestBedType.ANDROID.toString(), AndroidDriver.class);\n\t\tdriverMap.put(TestBedType.ANDROIDBROWSER.toString(), AndroidDriver.class);\n\t\tdriverMap.put(TestBedType.ANDROIDCHROME.toString(), AndroidDriver.class);\n\t\tdriverMap.put(TestBedType.AndroidMotoG.toString(), AndroidDriver.class);\n\t\tdriverMap.put(TestBedType.AndroidMicromax.toString(), AndroidDriver.class);\n\t\tdriverMap.put(TestBedType.AndroidLenovo.toString(), AndroidDriver.class);\n\t\tdriverMap.put(TestBedType.ANDROIDNATIVE.toString(), AndroidDriver.class);\n\t\tdriverMap.put(TestBedType.ANDROIDHYBRIDAPP.toString(), AndroidDriver.class);\n\t\tdriverMap.put(TestBedType.MOTOROLA.toString(), AndroidDriver.class);\n\t\tdriverMap.put(TestBedType.KARBONN.toString(), AndroidDriver.class);\n\t\tdriverMap.put(TestBedType.LENOVO.toString(), AndroidDriver.class);\n\t\tdriverMap.put(TestBedType.MICROMAX.toString(), AndroidDriver.class);\n\t\tdriverMap.put(TestBedType.AndroidSAMSUNG.toString(), AndroidDriver.class);\n\t\tdriverMap.put(TestBedType.ANDROID1.toString(), AndroidDriver.class);\n\t\tdriverMap.put(TestBedType.IPHONENATIVESIM.toString(), IOSDriver.class);\n\t\tdriverMap.put(TestBedType.IPHONENATIVE.toString(), IOSDriver.class);\n\t\tdriverMap.put(TestBedType.IPADNATIVE.toString(), IOSDriver.class);\n\t\tdriverMap.put(TestBedType.IPADWEB.toString(), IOSDriver.class);\n\t\tdriverMap.put(TestBedType.IPADSIMULATOR.toString(), IOSDriver.class);\n\t\tdriverMap.put(TestBedType.AndroidNexusTab.toString(), AndroidDriver.class);\n\t}", "private Map toMap(Scriptable scriptable) {\n \t\tif (scriptable instanceof MapWrapper)\n \t\t\treturn (Map) ((MapWrapper) scriptable).unwrap();\n \t\treturn new MapAdapter(scriptable);\n \t}", "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\r\n\tpublic static Map convertToFlatConfigMap(\r\n\t\t\tfinal String name, final Map map) {\r\n\t\tfinal Map flatConfigMap = new HashMap();\r\n\r\n\t\tfor (final Object keyObj : map.keySet()) {\r\n\t\t\tString key = (String) keyObj;\r\n\t\t\tflatConfigMap.put(name + \"__\" + key,\r\n\t\t\t\t\tmap.get(key));\r\n\t\t}\r\n\t\treturn flatConfigMap;\r\n\t}", "private void initJavaType() { // FIXME move this logic to core module\n\t\tif (javaTypeMap == null) {\n\t\t\tjavaTypeMap = new TreeMap<String, List<String>>();\n\t\t}\n\t\tif (!javaTypeMap.containsKey(\"1\")) {\n\t\t\tList<String> list = new ArrayList<String>();\n\t\t\tlist.add(\"java.lang.String\");\n\t\t\tlist.add(\"java.sql.Date\");\n\t\t\tlist.add(\"java.sql.Time\");\n\t\t\tlist.add(\"java.sql.Timestamp\");\n\t\t\tlist.add(\"java.lang.Byte\");\n\t\t\tlist.add(\"java.lang.Short\");\n\t\t\tlist.add(\"java.lang.Integer\");\n\t\t\tlist.add(\"java.lang.Long\");\n\t\t\tlist.add(\"java.lang.Float\");\n\t\t\tlist.add(\"java.lang.Double\");\n\t\t\tlist.add(\"java.math.BigDecimal\");\n\t\t\tlist.add(\"byte\");\n\t\t\tlist.add(\"short\");\n\t\t\tlist.add(\"int\");\n\t\t\tlist.add(\"long\");\n\t\t\tlist.add(\"float\");\n\t\t\tlist.add(\"double\");\n\t\t\tjavaTypeMap.put(\"1\", list);\n\t\t}\n\t\tif (!javaTypeMap.containsKey(\"2\")) {\n\t\t\tList<String> list = new ArrayList<String>();\n\t\t\tlist.add(\"java.lang.Byte\");\n\t\t\tlist.add(\"java.lang.Short\");\n\t\t\tlist.add(\"java.lang.Integer\");\n\t\t\tlist.add(\"java.lang.Long\");\n\t\t\tlist.add(\"java.lang.Float\");\n\t\t\tlist.add(\"java.lang.Double\");\n\t\t\tlist.add(\"java.math.BigDecimal\");\n\t\t\tlist.add(\"java.lang.String\");\n\t\t\tlist.add(\"byte\");\n\t\t\tlist.add(\"short\");\n\t\t\tlist.add(\"int\");\n\t\t\tlist.add(\"long\");\n\t\t\tlist.add(\"float\");\n\t\t\tlist.add(\"double\");\n\t\t\tjavaTypeMap.put(\"2\", list);\n\t\t}\n\t\tif (!javaTypeMap.containsKey(\"3\")) {\n\t\t\tList<String> list = new ArrayList<String>();\n\t\t\tlist.add(\"java.sql.Date\");\n\t\t\tlist.add(\"java.sql.Time\");\n\t\t\tlist.add(\"java.sql.Timestamp\");\n\t\t\tlist.add(\"java.lang.String\");\n\t\t\tjavaTypeMap.put(\"3\", list);\n\t\t}\n\t\tif (!javaTypeMap.containsKey(\"4\")) {\n\t\t\tList<String> list = new ArrayList<String>();\n\t\t\tjavaTypeMap.put(\"4\", list);\n\t\t}\n\t\tif (!javaTypeMap.containsKey(\"5\")) {\n\t\t\tList<String> list = new ArrayList<String>();\n\t\t\tif (database != null) {\n\t\t\t\tString jdbcVersion = database.getDatabase().getServer().getJdbcDriverVersion();\n\t\t\t\tif (isAfterJdbc111(jdbcVersion)) {\n\t\t\t\t\tlist.add(\"cubrid.sql.CUBRIDOIDImpl\");\t\t\t\t\t\n\t\t\t\t} else { \n\t\t\t\t\tlist.add(\"cubrid.sql.CUBRIDOID\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlist.add(\"cubrid.sql.CUBRIDOID\");\n\t\t\t}\n\t\t\t\n\t\t\tjavaTypeMap.put(\"5\", list);\n\t\t}\n\t\tif (!javaTypeMap.containsKey(\"6\")) {\n\t\t\tList<String> list = new ArrayList<String>();\n\t\t\tlist.add(\"cubrid.jdbc.driver.CUBRIDResultSet\");\n\t\t\tjavaTypeMap.put(\"6\", list);\n\t\t}\n\t}", "public static Map<String, String> replaceData(final Map<String, String> content,\n final Map<String, Response> responses) {\n return content.entrySet().stream()\n .collect(Collectors.toMap(Map.Entry::getKey, e -> replaceData(e.getValue(), responses)));\n }", "@Override\n\tpublic void putAll(Map<? extends String, ? extends String> m) {\n\t}", "Map<String, PrimitiveTypeProvider> convert(T data);", "public Map instantiateBackingMap(String sName);", "private Map<Integer, MessageEncoder> initialiseMap() {\n Map<Integer, MessageEncoder> composerMap = new HashMap<>();\n composerMap.put(AC35MessageType.BOAT_ACTION.getCode(), new BoatActionEncoder());\n composerMap.put(AC35MessageType.REQUEST.getCode(), new RequestEncoder());\n composerMap.put(AC35MessageType.COLOUR.getCode(), new ColourEncoder());\n\n return Collections.unmodifiableMap(composerMap);\n }", "public void testElementMapWithConverterType() {\n ElementMapWithConverterTypeTestDTO obj = new ElementMapWithConverterTypeTestDTO();\n obj.map = new HashMap<Date, BigDecimal>();\n obj.map.put(getDateForConverter(\"28.02.2007:15:21:27\"), new BigDecimal(3.14));\n obj.map.put(getDateForConverter(\"01.03.2007:15:21:27\"), new BigDecimal(0.815));\n assertTrue(JSefaTestUtil.serialize(XML, obj).indexOf(\"2007-02-28T15:21:27.000Z\") >= 0);\n assertTrue(JSefaTestUtil.serialize(XML, obj).indexOf(\"2007-03-01T15:21:27.000Z\") >= 0);\n }", "public static LinkedHashMap<String, Object> toMap(Object... elems) {\n return arrayToMap(elems);\n }", "public static Map<String, String> m3185a(Map<String, String> map) {\n Map<String, String> hashMap = new HashMap();\n map = map.entrySet().iterator();\n while (map.hasNext()) {\n Entry entry = (Entry) map.next();\n Object obj = (String) entry.getKey();\n Object obj2 = (String) entry.getValue();\n if (obj.length() > 40) {\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"cd key length over:\");\n stringBuilder.append(obj);\n C0784a.m3253a(stringBuilder.toString());\n obj = obj.substring(0, 40);\n }\n if (obj2 != null && obj2.length() > 1024) {\n stringBuilder = new StringBuilder();\n stringBuilder.append(\"cd value length over:\");\n stringBuilder.append(obj2);\n C0784a.m3253a(stringBuilder.toString());\n obj2 = obj2.substring(0, 1024);\n }\n hashMap.put(obj, obj2);\n }\n return hashMap;\n }", "private static void createTypeMap() {\n\n }", "@Nullable\n @SuppressWarnings(\"unchecked\")\n protected Map createMap(MappingContext context, Object value) {\n if (value instanceof Map<?, ?>) {\n if (context.getGenericTypeInfoOrFail(0).getSafeToWriteClass() != String.class) {\n throw new ConfigMeMapperException(context, \"The key type of maps may only be of String type\");\n }\n TypeInformation mapValueType = context.getGenericTypeInfoOrFail(1);\n\n Map<String, ?> entries = (Map<String, ?>) value;\n Map result = createMapMatchingType(context);\n for (Map.Entry<String, ?> entry : entries.entrySet()) {\n Object mappedValue = convertValueForType(\n context.createChild(\"[k=\" + entry.getKey() + \"]\", mapValueType), entry.getValue());\n if (mappedValue == null) {\n context.registerError(\"Cannot map value for key \" + entry.getKey());\n } else {\n result.put(entry.getKey(), mappedValue);\n }\n }\n return result;\n }\n return null;\n }", "protected abstract T parseMap(Map<String, Object> values);", "public void setEncrypterMap(Map<String, Encrypter> encrypterMap) {\n this.encrypterMap = encrypterMap;\n }", "private Map<String, String> convertArrayToMap(PairDTO[] pairDTOs) {\n Map<String, String> map = new HashMap<>();\n for (PairDTO pairDTO : pairDTOs) {\n map.put(pairDTO.getKey(), pairDTO.getValue());\n }\n return map;\n }", "@Override\n public HashMap<String, List<String>> initializeMapping(HashMap<String, List<String>> mapping) {\n mapping.put(\"xEncoder\", Arrays.asList(\"outtakeMotor1\", \"outtake1\"));\n mapping.put(\"yEncoder\", Arrays.asList(\"wobbleMotor\"));\n\n return mapping;\n }", "@SuppressWarnings(\"rawtypes\")\n\tpublic static Map stringToMap(String params) {\n\t\tMap<String, String> map = new HashMap<String, String>();\n\n\t\tif (params == null) {\n\t\t\tSystem.out.println(\"\");\n\n\t\t} else {\n\t\t\tString[] arr = params.split(\",\");\n\t\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\t\tString key = arr[i].substring(0, arr[i].indexOf(\":\"));\n\t\t\t\tString value = arr[i].substring(arr[i].indexOf(\":\") + 1);\n\t\t\t\tmap.put(key, value);\n\t\t\t}\n\t\t}\n\t\treturn map;\n\t}", "public Map<String, Object> batchItemMap(String str, String str2, Object obj) {\n return batchItemMap(str, str2, obj, null);\n }", "public <T> StringConverter<T> registerStringConverter(StringConverter<T> converter,String... names) {\n Objects.requireNonNull(names,\"registerStringConverter requires non empty class alias names\");\n Objects.requireNonNull(converter,\"registerStringConverter requires converter for classes \"+String.join(\",\",names));\n Arrays.stream(names).filter(Objects::nonNull).forEach(name->conversionMap.computeIfAbsent(name,clsName->converter));\n return converter;\n }", "public static void addNameBindings (Map<String, Object> namesToExport)\n\t{\n\t\tfor (Entry<String, Object> entry : namesToExport.entrySet ())\n\t\t{\n\t\t\tm_interpreter.set (entry.getKey (), entry.getValue ());\n\t\t}\n\t}", "public static Map<String, Set<String>> collectStringMapByValue(Map<String, String> aToB) {\n\t\t// The reversed list to return\n\t\tMap<String, Set<String>> bToAList = new HashMap<>();\n\n\t\t// Fore every entry in the input map\n\t\tfor (Entry<String, String> entry : aToB.entrySet()) {\n\t\t\t// Get the value\n\t\t\tString b = entry.getValue();\n\t\t\t// Check if the value is already a key.\n\t\t\tif (!bToAList.containsKey(b)) {\n\t\t\t\t// If not add it as a key to a hashset (there can be more than one key for this\n\t\t\t\t// value)\n\t\t\t\tbToAList.put(b, new HashSet<>());\n\t\t\t}\n\t\t\t// Add the key to the set\n\t\t\tbToAList.get(b).add(entry.getKey());\n\t\t}\n\n\t\treturn bToAList;\n\t}", "public static Map<String, String> strToMap(String str, String delim, boolean trim) {\n return strToMap(str, delim, trim, null);\n\n }", "@Override\n public void setSpecificLinksMap(Map<Class<?>, Map<String, String>> m) {\n specificLinksMap = new HashMap<>(m);\n }", "@SuppressWarnings(\"unchecked\")\n public static JvmMetadata fromMap(Map<String, Object> map) {\n JvmMetadata metadata = new JvmMetadata();\n Metadata.fillFromMap(metadata, map);\n metadata.jvmClasses.addAll((List<JvmClass>) map.get(JvmClass.class.getSimpleName()));\n metadata.jvmFields.addAll((List<JvmField>) map.get(JvmField.class.getSimpleName()));\n metadata.jvmMethods.addAll((List<JvmMethod>) map.get(JvmMethod.class.getSimpleName()));\n metadata.jvmVariables.addAll((List<JvmVariable>) map.get(JvmVariable.class.getSimpleName()));\n metadata.jvmInvocations.addAll((List<JvmMethodInvocation>) map.get(JvmMethodInvocation.class.getSimpleName()));\n metadata.jvmHeapAllocations.addAll((List<JvmHeapAllocation>) map.get(JvmHeapAllocation.class.getSimpleName()));\n metadata.usages.addAll((List<Usage>) map.get(Usage.class.getSimpleName()));\n metadata.jvmStringConstants.addAll((List<JvmStringConstant>) map.get(JvmStringConstant.class.getSimpleName()));\n metadata.aliases.addAll((List<SymbolAlias>) map.get(SymbolAlias.class.getSimpleName()));\n return metadata;\n }", "private static Object mapValueToJava(Object value) {\n if (value instanceof Map) {\n value = ((Map<?, ?>) value).toMap();\n } else if (value instanceof Sequence) {\n value = ((Sequence<?>) value).toMappedList();\n } else if (value instanceof net.ssehub.easy.instantiation.core.model.vilTypes.Set<?>) {\n value = ((net.ssehub.easy.instantiation.core.model.vilTypes.Set<?>) value).toMappedSet();\n }\n return value;\n }", "public static Map<Byte, String> genTypeToNameMap(){\n byte[] types = genAllTypes();\n String[] names = genAllTypeNames();\n Map<Byte,String> ret = new HashMap<Byte, String>();\n for(int i=0;i<types.length;i++){\n ret.put(types[i], names[i]);\n }\n return ret;\n }", "public static <V extends Parcelable> Map<String, V> readMap(Parcel in,\n Class<? extends V> type) {\n\n Map<String, V> map = new HashMap<String, V>();\n if (in != null) {\n String[] keys = in.createStringArray();\n Bundle bundle = in.readBundle(type.getClassLoader());\n for (String key : keys)\n map.put(key, type.cast(bundle.getParcelable(key)));\n }\n return map;\n }", "private static Map<VOTableVersion,VersionDetail>\n createMap( VersionDetail[] vds ) {\n Map<VOTableVersion,VersionDetail> map =\n new LinkedHashMap<VOTableVersion,VersionDetail>();\n for ( int i = 0; i < vds.length; i++ ) {\n map.put( vds[ i ].version_, vds[ i ] );\n }\n return map;\n }", "@Nullable\n private Map<String, Number> readableMapToNumberMap(ReadableMap readableMap) {\n Map<String, Number> map = new HashMap<>();\n\n if (readableMap == null) {\n return null;\n }\n\n ReadableMapKeySetIterator iterator = readableMap.keySetIterator();\n if (!iterator.hasNextKey()) {\n return null;\n }\n\n while (iterator.hasNextKey()) {\n String key = iterator.nextKey();\n ReadableType readableType = readableMap.getType(key);\n\n switch (readableType) {\n case Number:\n // Can be int or double.\n map.put(key, readableMap.getDouble(key));\n break;\n default:\n // Do nothing and fail silently\n }\n }\n\n return map;\n }", "private void registerStringConversions(ITypeManager typeManager) {\n\t\ttypeManager.registerConverter(BsonString.class, Character.class, \n\t\t\t(Object val) -> ToCoreChrUtils.bsonStr2Chr((BsonString) val));\n\t\ttypeManager.registerConverter(BsonString.class, Byte.class, \n\t\t\t(Object val) -> ToCoreByteUtils.bsonStr2Byte((BsonString) val));\n\t\ttypeManager.registerConverter(BsonString.class, Short.class, \n\t\t\t(Object val) -> ToCoreShrtUtils.bsonStr2Shrt((BsonString) val));\n\t\ttypeManager.registerConverter(BsonString.class, Integer.class, \n\t\t\t(Object val) -> ToCoreIntUtils.bsonStr2Int((BsonString) val));\n\t\ttypeManager.registerConverter(BsonString.class, Long.class, \n\t\t\t(Object val) -> ToCoreLngUtils.bsonStr2Lng((BsonString) val));\n\t\ttypeManager.registerConverter(BsonString.class, BigInteger.class, \n\t\t\t(Object val) -> ToCoreBgiUtils.bsonStr2Bgi((BsonString) val));\n\t\ttypeManager.registerConverter(BsonString.class, Float.class, \n\t\t\t(Object val) -> ToCoreFltUtils.bsonStr2Flt((BsonString) val));\n\t\ttypeManager.registerConverter(BsonString.class, Double.class, \n\t\t\t(Object val) -> ToCoreDblUtils.bsonStr2Dbl((BsonString) val));\n\t\ttypeManager.registerConverter(BsonString.class, BigDecimal.class, \n\t\t\t(Object val) -> ToCoreBgdUtils.bsonStr2Bgd((BsonString) val));\n\t\ttypeManager.registerConverter(BsonString.class, GregorianCalendar.class, \n\t\t\t(Object val) -> ToCoreCalUtils.bsonStr2Cal((BsonString) val));\n\t\ttypeManager.registerConverter(BsonString.class, Date.class, \n\t\t\t(Object val) -> ToCoreDtUtils.bsonStr2Dt((BsonString) val));\n\t\ttypeManager.registerConverter(BsonString.class, Timestamp.class, \n\t\t\t(Object val) -> ToCoreTsUtils.bsonStr2Ts((BsonString) val));\n\t\ttypeManager.registerConverter(BsonString.class, Boolean.class, \n\t\t\t(Object val) -> ToCoreBoolUtils.bsonStr2Bool((BsonString) val));\n\t\ttypeManager.registerConverter(BsonBinary.class, String.class, \n\t\t\t(Object val) -> ToCoreStrUtils.bsonBinary2Str((BsonBinary) val));\n\t\ttypeManager.registerConverter(BsonDocument.class, String.class, \n\t\t\t(Object val) -> ToCoreStrUtils.bsonDoc2Str((BsonDocument) val));\n\t}", "String parseMapToJson(Map<String, Object> data);", "static Map<ParserRuleAlternativeContext, AlternativeKeyWithOffsets> toKeys(Map<ParserRuleAlternativeContext, AlternativeStub> m) {\n Map<String, Set<AlternativeStub>> map = CollectionUtils.supplierMap(TreeSet::new);\n Map<AlternativeStub, ParserRuleAlternativeContext> inverse = new HashMap<>();\n for (Map.Entry<ParserRuleAlternativeContext, AlternativeStub> e : m.entrySet()) {\n map.get(e.getValue().ruleName).add(e.getValue());\n inverse.put(e.getValue(), e.getKey());\n }\n Map<ParserRuleAlternativeContext, AlternativeKeyWithOffsets> result = new HashMap<>(m.size());\n for (Map.Entry<String, Set<AlternativeStub>> e : map.entrySet()) {\n int cursor = 1;\n for (AlternativeStub stub : e.getValue()) {\n ParserRuleAlternativeContext ctx = inverse.get(stub);\n AlternativeKey key = stub.toKey(cursor++);\n AlternativeKeyWithOffsets withOffsets = new AlternativeKeyWithOffsets(key, stub.startTokenIndex, stub.stopTokenIndex);\n result.put(ctx, withOffsets);\n }\n }\n return result;\n }", "public static JsonObject toJsonObject(Map<String, JsonElement> map) {\n\t\t\n\t\tJsonObject ret = new JsonObject();\n\t\tfor (Entry<String, JsonElement> entry : map.entrySet())\n\t\t\tret.add(entry.getKey(), entry.getValue());\n\t\t\n\t\treturn ret;\n\t\t\n\t}", "private void toMap(String cycle) {\n for (int i = 0; i < cycle.length() - 1; i++) {\n Integer input = _alphabet.toInt(cycle.charAt(i));\n Integer output = _alphabet.toInt(cycle.charAt(i + 1));\n _map.put(input, output);\n }\n Integer i = _alphabet.toInt(cycle.charAt(cycle.length() - 1));\n Integer o = _alphabet.toInt(cycle.charAt(0));\n _map.put(i, o);\n }", "protected Map<String, URL> createMap(Collection<? extends IconRecord> records)\n {\n Map<String, URL> map = New.map(records.size());\n for (IconRecord record : records)\n {\n map.put(getPublicUrl(record.imageURLProperty().get()), record.imageURLProperty().get());\n }\n return map;\n }", "protected void measurementToMap(Measurement m) {\n if (m instanceof WithNames) {\n values = new HashMap<String, ProbeValue>();\n for (ProbeValue pv : m.getValues()) {\n values.put(((ProbeValueWithName)pv).getName(), pv);\n }\n } else {\n LoggerFactory.getLogger(TcpdumpReporter.class).error(\"ProcessInfoReporter works with Measurements that are WithNames\");\n }\n }", "private void initCsiAdaptorCache(\n final Map<String, CsiAdaptorProtocol> adaptorMap, Configuration conf)\n throws IOException, YarnException {\n LOG.info(\"Initializing cache for csi-driver-adaptors\");\n String[] addresses =\n conf.getStrings(YarnConfiguration.NM_CSI_ADAPTOR_ADDRESSES);\n if (addresses != null && addresses.length > 0) {\n for (String addr : addresses) {\n LOG.info(\"Found csi-driver-adaptor socket address: \" + addr);\n InetSocketAddress address = NetUtils.createSocketAddr(addr);\n YarnRPC rpc = YarnRPC.create(conf);\n UserGroupInformation currentUser =\n UserGroupInformation.getCurrentUser();\n CsiAdaptorProtocol adaptorClient = NMProxy\n .createNMProxy(conf, CsiAdaptorProtocol.class, currentUser, rpc,\n address);\n // Attempt to resolve the driver by contacting to\n // the diver's identity service on the given address.\n // If the call failed, the initialization is also failed\n // in order running into inconsistent state.\n LOG.info(\"Retrieving info from csi-driver-adaptor on address \" + addr);\n GetPluginInfoResponse response =\n adaptorClient.getPluginInfo(GetPluginInfoRequest.newInstance());\n if (!Strings.isNullOrEmpty(response.getDriverName())) {\n String driverName = response.getDriverName();\n if (adaptorMap.containsKey(driverName)) {\n throw new YarnException(\n \"Duplicate driver adaptor found,\" + \" driver name: \"\n + driverName);\n }\n adaptorMap.put(driverName, adaptorClient);\n LOG.info(\"CSI Adaptor added to the cache, adaptor name: \" + driverName\n + \", driver version: \" + response.getVersion());\n }\n }\n }\n }", "protected static Map<String, List<String>> mapOptions(\n Map<Scope.Builder.COMPILER, List<String>> options) {\n return options\n .entrySet()\n .stream()\n .collect(Collectors.toMap(e -> COMPILER_OPTIONS_MAP.get(e.getKey()), Map.Entry::getValue));\n }", "private static Map<String, Method> buildMethoMap(final Class<?> c, String patternStr) throws Exception {\n\t\tMap<String, Method> methodMap = new HashMap<String, Method>();\n\t\tpatternStr = patternStr + \"([A-Z])(\\\\w+)\";\n\t\t\n\t\tfor (Method method : c.getMethods()) {\n\t\t\tString methodName = method.getName();\n\t\t\tPattern pattern = Pattern.compile(patternStr);\n\t\t\tMatcher matcher = pattern.matcher(methodName);\n\t\t\tif (!matcher.find()) continue;\n\t\t\t\n\t\t\tString fieldName = matcher.group(1).toLowerCase() + matcher.group(2);\n\t\t\t// Put the field into the hash table with its name as the key\n\t\t\tmethodMap.put(fieldName, method);\n\t\t}\n\t\t\n\t\treturn methodMap;\n\t}", "public static Map<String, String> transformXmlToMap(String string) {\n\t\treturn null;\r\n\t}", "public void toMap(HashMap<String, String> map, String prefix) {\n this.setParamSimple(map, prefix + \"DirectConnectId\", this.DirectConnectId);\n this.setParamSimple(map, prefix + \"DirectConnectTunnelName\", this.DirectConnectTunnelName);\n this.setParamSimple(map, prefix + \"DirectConnectOwnerAccount\", this.DirectConnectOwnerAccount);\n this.setParamSimple(map, prefix + \"NetworkType\", this.NetworkType);\n this.setParamSimple(map, prefix + \"NetworkRegion\", this.NetworkRegion);\n this.setParamSimple(map, prefix + \"VpcId\", this.VpcId);\n this.setParamSimple(map, prefix + \"DirectConnectGatewayId\", this.DirectConnectGatewayId);\n this.setParamSimple(map, prefix + \"Bandwidth\", this.Bandwidth);\n this.setParamSimple(map, prefix + \"RouteType\", this.RouteType);\n this.setParamObj(map, prefix + \"BgpPeer.\", this.BgpPeer);\n this.setParamArrayObj(map, prefix + \"RouteFilterPrefixes.\", this.RouteFilterPrefixes);\n this.setParamSimple(map, prefix + \"Vlan\", this.Vlan);\n this.setParamSimple(map, prefix + \"TencentAddress\", this.TencentAddress);\n this.setParamSimple(map, prefix + \"CustomerAddress\", this.CustomerAddress);\n this.setParamSimple(map, prefix + \"TencentBackupAddress\", this.TencentBackupAddress);\n this.setParamSimple(map, prefix + \"CloudAttachId\", this.CloudAttachId);\n this.setParamSimple(map, prefix + \"BfdEnable\", this.BfdEnable);\n this.setParamSimple(map, prefix + \"NqaEnable\", this.NqaEnable);\n this.setParamObj(map, prefix + \"BfdInfo.\", this.BfdInfo);\n this.setParamObj(map, prefix + \"NqaInfo.\", this.NqaInfo);\n\n }", "<T> Map<String, T> resolveAll(Class<T> type);", "private static void convertPayload(Map<String, String> source, Map<String, Object> target) {\n for (Entry<String, String> ent : source.entrySet()) {\n try {\n target.put(ent.getKey(), coder.decode(ent.getValue(), Object.class));\n\n } catch (CoderException e) {\n logger.warn(\"cannot decode JSON value {}: {}\", ent.getKey(), ent.getValue(), e);\n }\n }\n }", "public abstract void map(String key, String value) throws Exception;", "public interface TestMapper {\n public List<Map<String, Object>> findTestInfo();\n}", "private Object deserializeMap(Object datum, Schema fileSchema, Schema mapSchema, MapTypeInfo columnType)\n throws AvroSerdeException {\n Map<String, Object> map = new HashMap<String, Object>();\n Map<CharSequence, Object> mapDatum = (Map)datum;\n Schema valueSchema = mapSchema.getValueType();\n TypeInfo valueTypeInfo = columnType.getMapValueTypeInfo();\n for (CharSequence key : mapDatum.keySet()) {\n Object value = mapDatum.get(key);\n map.put(key.toString(), worker(value, fileSchema == null ? null : fileSchema.getValueType(),\n valueSchema, valueTypeInfo));\n }\n\n return map;\n }", "public void setConverters(Map<Class<?>, Converter<?>> converters) {\n loadDefaultConverters();\n if (converters != null) {\n for (Entry<Class<?>, Converter<?>> entry : converters.entrySet()) {\n if (entry.getKey() != null && entry.getValue() != null) {\n this.converters.put(entry.getKey(), entry.getValue());\n }\n }\n }\n }", "protected Map<String, String> transformMap(Map<String, String> values, Map<String, String> transformKey) {\n Map<String, String> result = new HashMap<String, String>();\n for (Map.Entry<String, String> entry : values.entrySet()) {\n if (transformKey.get(entry.getKey()) != null) {\n result.put(transformKey.get(entry.getKey()), entry.getValue());\n } else {\n result.put(entry.getKey(), entry.getValue());\n }\n }\n if (result.containsKey(INVALID_COLUMN_NAME)) {\n return null;\n } else {\n return result;\n }\n }" ]
[ "0.61853176", "0.5623682", "0.5528374", "0.5394871", "0.5358266", "0.5227834", "0.51846987", "0.5118246", "0.509647", "0.5085768", "0.5014969", "0.49510762", "0.49348825", "0.49276257", "0.49251962", "0.49148145", "0.49069482", "0.4901916", "0.48805943", "0.4864017", "0.4859119", "0.48209938", "0.48100317", "0.47857258", "0.47831357", "0.47579914", "0.4750169", "0.47492823", "0.47446492", "0.4737781", "0.47308597", "0.47270864", "0.4725033", "0.47174186", "0.46814516", "0.46781737", "0.467061", "0.46573535", "0.4646187", "0.46355346", "0.46153933", "0.4612901", "0.4612526", "0.4594618", "0.45927972", "0.4588379", "0.458462", "0.4582069", "0.4580845", "0.4576486", "0.45726314", "0.45652428", "0.45597106", "0.45229", "0.45128766", "0.45067337", "0.45000947", "0.44999722", "0.4496716", "0.44884303", "0.44875774", "0.4483962", "0.44759363", "0.44705692", "0.44666776", "0.4459669", "0.44563687", "0.4449198", "0.44448358", "0.44353008", "0.4435001", "0.4429237", "0.44262984", "0.44252294", "0.44198316", "0.44164586", "0.44064024", "0.44025278", "0.4389019", "0.43829638", "0.4382367", "0.43792698", "0.43779856", "0.43777993", "0.43734694", "0.4373201", "0.43660626", "0.43623", "0.43621826", "0.43445045", "0.43372145", "0.4337143", "0.43369472", "0.43359977", "0.4335609", "0.4335252", "0.43304387", "0.43284187", "0.43282807", "0.432719" ]
0.5150836
7
Type your code here
int main() { int i,n; float arr [100]; cin >> n; for(i=0;i<n;++i) { cin >> arr[i]; } for(i=1;i<n;++i) { if(arr[0]<arr[i]) arr[0]=arr[i]; } cout<< arr[0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void generateCode()\n {\n \n }", "@Override\r\n\tpublic void code() {\n\t\tus.code();\r\n\t\tSystem.out.println(\"我会java...\");\r\n\t}", "@Override\r\n\tpublic void code() {\n\t\tSystem.out.println(\"我会C语言....\");\r\n\t}", "CD withCode();", "Code getCode();", "private void searchCode() {\n }", "public void genCode(CodeFile code) {\n\t\t\n\t}", "public interface Code {\n //运行结果编号\n Integer getCode();\n //运行结果描述\n String getDescription();\n String toString();\n\n}", "public void Tyre() {\n\t\t\r\n\t}", "String getCode();", "String getCode();", "String getCode();", "String getCode();", "String getCode();", "public abstract int code();", "public void mo38117a() {\n }", "public abstract String getFullCode();", "public void generateCode() {\n new CodeGenerator(data).generateCode();\n }", "private void yy() {\n\n\t}", "public void mo5382o() {\n }", "public static void main(String[] args) {\n\t\tBlockCode blockcode = new BlockCode();\n\t\t//blockcode.printName();\n\t\t\n\t\t}", "public void exec(PyObject code) {\n }", "java.lang.String getCode();", "java.lang.String getCode();", "public interface CodeFormatter\n{\n}", "public String getCode();", "public String getCode();", "void setCode(String code);", "@Override public boolean isCodeTask() { return true; }", "public static void main(String[] args) {\n\t// write your code here\n }", "public String CodeInterpreter() {\n\n\t\tString timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(Calendar.getInstance().getTime());\n\t\treturn \"DA\" + \"_\" + timeStamp;\n\t}", "public void gen(CodeSeq code, ICodeEnv env) {\n\r\n\t}", "Editor mo117962b();", "public void code (String code) throws LuchthavenException\r\n\t{\r\n\t\tluchthaven.setCode(code);\r\n\t}", "public void mo9241ay() {\n }", "public void mo9848a() {\n }", "int getCode();", "int getCode();", "int getCode();", "Programming(){\n\t}", "private List<String> runCode(JasminBytecode code) throws AssembleException {\n // Turn the Jasmin code into a (hopefully) working class file\n if (code == null) {\n throw new AssembleException(\"No valid Jasmin code to assemble\");\n }\n AssembledClass aClass = AssembledClass.assemble(code);\n // Run the class and return the output\n SandBox s = new SandBox();\n s.runClass(aClass);\n return s.getOutput();\n }", "abstract protected void pre(int code);", "public Code() {\n\t}", "public void mo115188a() {\n }", "public void mo5248a() {\n }", "public void createCode(){\n\t\tsc = animationScript.newSourceCode(new Coordinates(10, 60), \"sourceCode\",\r\n\t\t\t\t\t\t null, AnimProps.SC_PROPS);\r\n\t\t \r\n\t\t// Add the lines to the SourceCode object.\r\n\t\t// Line, name, indentation, display dealy\r\n\t\tsc.addCodeLine(\"1. Berechne für jede (aktive) Zeile und Spalte der Kostenmatrix\", null, 0, null); // 0\r\n\t\tsc.addCodeLine(\" die Differenz aus dem kleinsten (blau) und zweit-kleinsten (lila)\", null, 0, null);\r\n\t\tsc.addCodeLine(\" Element der entsprechenden Zeile/ Spalte.\", null, 0, null);\r\n\t\tsc.addCodeLine(\"2. Wähle die Zeile oder Spalte (grün) aus bei der sich die größte\", null, 0, null); \r\n\t\tsc.addCodeLine(\" Differenz (blau) ergab.\", null, 0, null);\r\n\t\tsc.addCodeLine(\"3. Das kleinste Element der entsprechenden Spalte\", null, 0, null); \r\n\t\tsc.addCodeLine(\" (bzw. Zeile) gibt nun die Stelle an, welche im\", null, 0, null);\r\n\t\tsc.addCodeLine(\" Transporttableau berechnet wird (blau).\", null, 0, null);\r\n\t\tsc.addCodeLine(\"4. Nun wird der kleinere Wert von Angebots- und\", null, 0, null); // 4\r\n\t\tsc.addCodeLine(\" Nachfragevektor im Tableau eingetragen.\", null, 0, null);\r\n\t\tsc.addCodeLine(\"5. Anschließend wird der eingetragene Wert von den Rändern\", null, 0, null); // 5\r\n\t\tsc.addCodeLine(\" abgezogen (mindestens einer muss 0 werden). \", null, 0, null);\r\n\t\tsc.addCodeLine(\"6. Ist nun der Wert im Nachfragevektor Null so markiere\", null, 0, null); // 6\r\n\t\tsc.addCodeLine(\" die entsprechende Spalte in der Kostenmatrix. Diese\", null, 0, null);\r\n\t\tsc.addCodeLine(\" wird nun nicht mehr beachtet (rot). Ist der Wert des\", null, 0, null);\r\n\t\tsc.addCodeLine(\" Angebotsvektors Null markiere die Zeile der Kostenmatrix.\", null, 0, null);\r\n\t\tsc.addCodeLine(\"7. Der Algorithmus wird beendet, falls lediglich eine Zeile oder\", null, 0, null); // 8\r\n\t\tsc.addCodeLine(\" Spalte der Kostenmatrix unmarkiert ist (eines reicht aus).\", null, 0, null);\r\n\t\tsc.addCodeLine(\"8 . Der entsprechenden Zeile bzw. Spalte im Transporttableau werden\", null, 0, null); // 9\t\t \r\n\t\tsc.addCodeLine(\" die restlichen Angebots- und Nachfragemengen zugeordnet.\", null, 0, null);\r\n\t\t\r\n\t}", "@Override\n\tpublic void type() {\n\t\t\n\t}", "CodeType createCodeType();", "public void printCode( String value )\r\n\t{\r\n\t\tSystem.out.println(\"A suitable number for this : \");\r\n\t\tSystem.out.println(value);\r\n\t}", "public void mo3749d() {\n }", "public void mo9233aH() {\n }", "public void mo21785J() {\n }", "public void mo8738a() {\n }", "public void mo55254a() {\n }", "public void mo6944a() {\n }", "public void mo12930a() {\n }", "@Override\n public String getCode(String name) {\n String type = keywords.stream()\n .map(keyword -> keyword.getCode())\n .collect(Collectors.joining(\" \"));\n\n String varName = name == null ? \"\" : \" \" + name;\n return type + varName;\n /*\n if (name == null) {\n return type;\n }\n \n return type + \" \" + name;\n */\n }", "public void mo4359a() {\n }", "private void strin() {\n\n\t}", "public static void main(String[] args) {\n // write your code here - this is called comment and it always starts with double slash\n // and comlier will ignore this because of the // sign.\n // I am gonna say hello\n // JAVA IS CASE SENSITIVE LANGUAGE\n // System and system are very different things in java\n //Hello AND hello are different for java\n // System.out.println(\"Hello Batch 15!\");\n // System.out.println(\"I am still here.\");\n // System.out.println(\"I love Java.\");\n\n // Write a program to display your information.\n // When you run it, it should have this outcome.\n // I am your name here\n // I am from batch 15\n // I am from your city here\n // I love Java\n\n System.out.println(\"I am Sevim.\");\n System.out.println(\"I am from Batch 15.\");\n System.out.println(\"I'm from New Jersey.\");\n System.out.println(\"I love Java.\");\n\n\n\n }", "public void ganar() {\n // TODO implement here\n }", "public void mo21795T() {\n }", "@Override\r\n\tpublic void program() {\n\t\tSystem.out.println(\"我是一名Java工程师\");\r\n\t}", "public void mo97908d() {\n }", "public void mo21791P() {\n }", "public void mo3376r() {\n }", "void mo67924c();", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "void mo84655a();", "void mo57278c();", "public static void main(String[] args) {\n\t\tSystem.out.print(\"This is added code\");\n\t\tSystem.out.print(\"This is added code from GitHub\");\n\n\t}", "public void mo21782G() {\n }", "public void mo44053a() {\n }", "CodeBlock createCodeBlock();", "@Override\n\tpublic void orgasm() {\n\t\t\n\t}", "public void mo21789N() {\n }", "boolean hasCode();", "boolean hasCode();", "boolean hasCode();", "public void mo5097b() {\n }", "public static void main(String[] args) {\n //Ersetzt jetzt mal unseren Parser, Stell Dir vor\n // das Ding liest das Beispiel da oben ^^.\n final StatementNode[] statementNodes = readStatements();\n \n //Zustände:\n // - FillSymbolTable (was für Symbole [variablen, ...] gibt es)\n // - TypInferenz (Was für Typen haben die Expressions und sind die eingaben semantisch korrekt)\n // - CodeGenerierung oder Ausführung (ersetzen wir mit \"schreibe die Werte aller Variablen nach Ende der Ausführung\")\n \n \n final SymbolTabelle symbolTabelle = new SymbolTabelle();\n //IDEE 2:\n //Ich gebe Statements und Expressions nur eine Methode mit Visitor als Callback\n final StatementVisitorSymbolTabelle statementVisitorSymbolTabelle = new StatementVisitorSymbolTabelle(symbolTabelle);\n for(StatementNode statementNode : statementNodes) {\n statementNode.accept(statementVisitorSymbolTabelle);\n }\n \n final StatementVisitorTypInferenz statementVisitorTypInferenz = new StatementVisitorTypInferenz(symbolTabelle);\n for(StatementNode statementNode : statementNodes) {\n statementNode.accept(statementVisitorTypInferenz);\n }\n \n PseudoLaufContext laufContext = new PseudoLaufContext();\n final StatementVisitorCodeGen statementVisitorCodeGen = new StatementVisitorCodeGen(laufContext);\n for(StatementNode statementNode : statementNodes) {\n statementNode.accept(statementVisitorCodeGen);\n }\n \n laufContext.druckeVariablen();\n \n //Zusammenfassung:\n //Reduktion des Problems darauf, den Code nur noch von einem Abhängig zu machen\n //Jetzt nur noch abhängig vom Typ des Statements\n \n \n //Problem hierbei:\n //Ich muss selbst angeben, in welchem Zustand ich bin\n //Code-Duplizierung\n }", "public static void main() {\n \n }", "public void display2(){\n System.out.println(\"codegym\");\n }", "public void mo56167c() {\n }", "void program() {\n\n }", "public void edit() {\n\t\tSystem.out.println(\"编写java笔记\");\r\n\t}", "public void mo5099c() {\n }", "public void addToCode(String code){\r\n\t\tiCode+=getTabs()+code+\"\\n\";\r\n\t}", "public interface Code {\r\n \r\n /**\r\n * Called to execute the \"next\" line of code in this\r\n * virtual hardware component.\r\n * \r\n * This can be any action (or sequence of actions) as desired by\r\n * the implementation to simulate hardware functions.\r\n * \r\n * @return true when this \"process\" wants to exit.\r\n */\r\n public boolean executeNext();\r\n \r\n /**\r\n * Called when this instruction set should terminate execution permanently.\r\n * This method SHOULD NOT modify the process Identifier or CPU. It should\r\n * only shut down any processing needs and reset internal data if this\r\n * process is executed again.\r\n */\r\n public void shutdown();\r\n\r\n /**\r\n * Get the program name.\r\n */\r\n public String getName();\r\n \r\n // </editor-fold>\r\n }", "@Override\n\tpublic void compile(CodeBlock c, CompilerEnvironment environment) {\n\n\t}", "void pramitiTechTutorials() {\n\t\n}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Hello\");\r\n\t\tSystem.out.println(\" code\");\r\n\t\tSystem.out.println(\" added one more line of code\");\r\n\t\t;\r\n\r\n\t}", "public static String compileAndRun(String code) throws Exception {\n\t\treturn run(LavaCompiler.compile(code));\n\t}", "public String getCode(ClassDecl cl)\r\n\t{\r\n\t\tString testcode = \"#Region \\\"Testing code generated by KawigiEdit\\\"\\n\";\r\n\t\ttestcode += \"Module MainModule\\n\";\r\n\t\ttestcode += \"\\tSub Main()\\n\";\r\n\t\tEditorDataType returnType = cl.getMethod().getReturnType();\r\n\t\ttestcode += \"\\t\\tDim Errors As Boolean = False\\n\";\r\n\t\ttestcode += \"\\t\\tDim Answer, DesiredAnswer As \" + EditorLanguage.VB.getName(returnType) + \"\\n\";\r\n\t\ttestcode += \"\\t\\tDim Obj As \" + cl.getName() + \"\\n\";\r\n\t\ttestcode += \"\\t\\tDim Time As DateTime\\n\";\r\n\t\tif (returnType.isArrayType())\r\n\t\t{\r\n\t\t\ttestcode += \"\\t\\tDim Same As Boolean\\n\";\r\n\t\t\ttestcode += \"\\t\\tDim i As Integer\\n\";\r\n\t\t}\r\n\t\tboolean stringType = returnType.isType(EditorDataType.String);\r\n\t\tEditorDataType[] paramTypes = cl.getMethod().getParamTypes();\r\n\t\ttestcode += \"\\t\\t<%:start-tests%>\\n\";\r\n\t\tfor (int i=0; i<cl.countTests(); i++)\r\n\t\t{\r\n\t\t\ttestcode += \"\\t\\tObj = New \" + cl.getName() + \"()\\n\";\r\n\t\t\ttestcode += \"\\t\\tTime = DateTime.Now\\n\";\r\n\t\t\ttestcode += \"\\t\\tAnswer = Obj.\" + cl.getMethod().getName() + \"(\" + toTest(cl.getTest(i).getParameters(), paramTypes) + \")\\n\";\r\n\t\t\ttestcode += \"\\t\\tConsole.WriteLine(\\\"Time: \\\" & (DateTime.Now.Subtract(Time)).TotalSeconds & \\\" seconds\\\")\\n\";\r\n\t\t\ttestcode += \"\\t\\tDesiredAnswer = \" + translateObject(returnType, cl.getTest(i).getAnswer()) + \"\\n\";\r\n\t\t\ttestcode += \"\\t\\tConsole.WriteLine(\\\"Your Answer:\\\")\\n\";\r\n\t\t\tif (returnType.isArrayType())\r\n\t\t\t{\r\n\t\t\t\ttestcode += \"\\t\\tConsole.Write(\\\"{ \\\")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tIf (Answer.Length > 0) Then\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tConsole.Write(\" + (stringType ? \"\\\"\\\"\\\"\\\" & \" : \"\") + \"Answer(0)\" + (stringType ? \" & \\\"\\\"\\\"\\\"\" : \"\") + \")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tFor i = 1 To Answer.Length - 1\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\t\\tConsole.Write(\\\"\\t, \" + (stringType ? \"\\\"\\\"\" : \"\") + \"\\\" & Answer(i)\" + (stringType ? \" & \\\"\\\"\\\"\\\"\" : \"\") + \")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tNext\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tConsole.WriteLine(\\\" }\\\")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tElse\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tConsole.WriteLine(\\\"}\\\")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tEnd If\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tConsole.WriteLine(\\\"Desired Answer:\\\")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tConsole.Write(\\\"{ \\\")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tIf (DesiredAnswer.Length > 0) Then\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tConsole.Write(\" + (stringType ? \"\\\"\\\"\\\"\\\" & \" : \"\") + \"DesiredAnswer(0)\" + (stringType ? \" & \\\"\\\"\\\"\\\"\" : \"\") + \")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tFor i = 1 To DesiredAnswer.Length - 1\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\t\\tConsole.Write(\\\", \" + (stringType ? \"\\\"\\\"\" : \"\") + \"\\\" & DesiredAnswer(i)\" + (stringType ? \" & \\\"\\\"\\\"\\\"\" : \"\") + \")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tNext\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tConsole.WriteLine(\\\" }\\\")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tElse\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tConsole.WriteLine(\\\"}\\\")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tEnd If\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tSame = (Answer.Length = DesiredAnswer.Length)\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tIf (Same)\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tFor i = 0 To DesiredAnswer.Length - 1\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\t\\tIf Answer(i) <> DesiredAnswer(i) Then\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\t\\t\\tSame = False\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\t\\tEnd If\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tNext\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tEnd If\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tIf Same Then\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tConsole.WriteLine(\\\"Match :-)\\\")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tElse\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tConsole.WriteLine(\\\"DOESN'T MATCH!!!!\\\")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tErrors = True\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tEnd If\\n\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttestcode += \"\\t\\tConsole.WriteLine(\\\"\\t\" + (stringType ? \"\\\"\\\"\" : \"\") + \"\\\" & Answer\" + (stringType ? \" & \\\"\\\"\\\"\\\"\" : \"\") + \")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tConsole.WriteLine(\\\"Desired Answer:\\\")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tConsole.WriteLine(\\\"\\t\" + (stringType ? \"\\\"\\\"\" : \"\") +\"\\\" & DesiredAnswer\" + (stringType ? \" & \\\"\\\"\\\"\\\"\" : \"\") + \")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tIf Answer = DesiredAnswer Then\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tConsole.WriteLine(\\\"Match :-)\\\")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tElse\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tConsole.WriteLine(\\\"DOESN'T MATCH!!!!\\\")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tErrors = True\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tEnd If\\n\";\r\n\t\t\t}\r\n\t\t\ttestcode += \"\\t\\tConsole.WriteLine()\\n\";\r\n\t\t}\r\n\t\ttestcode += \"\\t\\t<%:end-tests%>\\n\";\r\n\t\ttestcode += \"\\t\\t\\n\\t\\tIf Errors Then\\n\";\r\n\t\ttestcode += \"\\t\\t\\tConsole.WriteLine(\\\"Some of the test cases had errors :-(\\\")\\n\";\r\n\t\ttestcode += \"\\t\\tElse\\n\";\r\n\t\ttestcode += \"\\t\\t\\tConsole.WriteLine(\\\"You're a stud (at least on the test data)! :-D \\\")\\n\";\r\n\t\ttestcode += \"\\t\\tEnd If\\n\";\r\n\t\ttestcode += \"\\tEnd Sub\\n\";\r\n\t\ttestcode += \"End Module\\n\";\r\n\t\ttestcode += \"#End Region\\n\";\r\n\t\treturn testcode;\r\n\t}", "private GenericVar run(String code) throws InterpreterException {\n\t\treturn evaluate(code);\n\t}" ]
[ "0.67529005", "0.65678793", "0.641418", "0.6334503", "0.6230944", "0.62127316", "0.6207898", "0.60968196", "0.6072467", "0.606349", "0.606349", "0.606349", "0.606349", "0.606349", "0.59795964", "0.58908486", "0.58157927", "0.5754923", "0.57194966", "0.57184726", "0.5709211", "0.5692097", "0.5684853", "0.5684853", "0.56823534", "0.56733847", "0.56733847", "0.5671409", "0.5662773", "0.5638152", "0.5632804", "0.56146115", "0.5611494", "0.5600294", "0.55993855", "0.5585444", "0.557892", "0.557892", "0.557892", "0.5578722", "0.5576019", "0.5574037", "0.5531144", "0.55272293", "0.5518262", "0.55119634", "0.55099744", "0.5506902", "0.5502219", "0.54998595", "0.54769903", "0.547528", "0.54718536", "0.54693407", "0.5468204", "0.5467253", "0.5465737", "0.5460886", "0.5458771", "0.5453637", "0.5448387", "0.54482716", "0.5444913", "0.5442078", "0.5436509", "0.5435591", "0.5432728", "0.5422528", "0.5422528", "0.5422528", "0.5422528", "0.5422528", "0.5422528", "0.5422528", "0.5422326", "0.54217345", "0.5416883", "0.5415361", "0.5414889", "0.5414248", "0.5411796", "0.5411148", "0.54099554", "0.54099554", "0.54099554", "0.5398955", "0.53947574", "0.53902584", "0.5384459", "0.5382319", "0.53795886", "0.53692216", "0.5366011", "0.536356", "0.5353671", "0.53508645", "0.53495604", "0.5349039", "0.5348749", "0.53385496", "0.5333768" ]
0.0
-1
private int index = 1;
public SetExtensionPolicyCommand(ESequenceValue value, EExtensionPolicy policy) { this.policy = policy; this.value = value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getIndex(){\r\n\t\treturn index;\r\n\t}", "public int getIndex(){\n return index;\n }", "public int getIndex(){\n return index;\n }", "public int getIndex(){\r\n \treturn index;\r\n }", "public int getIndex(){\n\t\treturn index;\n\t}", "public int getIndex(){\n\t\treturn index;\n\t}", "public int getIndex(){\n\t\treturn index;\n\t}", "public int getIndex() { return this.index; }", "public int getIndex()\n {\n return index;\n }", "public int getIndex(\n )\n {return index;}", "public final int getIndex(){\n return index_;\n }", "public int getIndex() {\n return index;\n }", "public void setIndex(int index)\n/* */ {\n/* 39 */ this.index = index;\n/* */ }", "int getIndex() {\n\t\treturn index;\n\t}", "public int getIndex()\n {\n return index;\n }", "public int getIndex() {\r\n return _index;\r\n }", "public int getIndex() {\r\n return _index;\r\n }", "private int getIndex() {\n\t\treturn this.index;\r\n\t}", "public int getIndex()\n/* */ {\n/* 46 */ return this.index;\n/* */ }", "public int getIndex() {\r\n \t\t\treturn index;\r\n \t\t}", "public int getIndex() {\n \t\treturn index;\n \t}", "@Override\r\n\tpublic int getIndex() {\n\t\treturn index;\r\n\t}", "public int getIndex()\n {\n return m_index;\n }", "public int getIndex() {\r\n return index;\r\n }", "public int getIndex() {\n return index;\n }", "public int getIndex() {\n return index;\n }", "public int getIndex() {\n return index;\n }", "public int getIndex() {\n return index;\n }", "public int getIndex() {\n return index;\n }", "public int getIndexNumber(){\n return id;\r\n }", "@java.lang.Override\n public int getIndex() {\n return index_;\n }", "int index();", "public void setIndex(int index) { this.index = index; }", "@Override\n public final int getIndex() {\n return index;\n }", "protected final int getIndex() {\n return index;\n }", "public int index();", "public int getIndex() {\r\n\t\treturn index;\r\n\t}", "public int getIndex() {\n return index;\n }", "public int index() {\n\t\treturn this.index;\n\t}", "public int getIndex() {\n\t\treturn index;\n\t}", "public int getIndex() {\n\t\treturn index;\n\t}", "public int getIndex() {\n\t\treturn index;\n\t}", "private int getRealIndex()\r\n\t{\r\n\t\treturn index - 1;\r\n\t}", "@java.lang.Override\n public int getIndex() {\n return index_;\n }", "@java.lang.Override\n public int getIndex() {\n return index_;\n }", "@java.lang.Override\n public int getIndex() {\n return index_;\n }", "@java.lang.Override\n public int getIndex() {\n return index_;\n }", "public int getIndex() {\n\t\treturn 0;\n\t}", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "@java.lang.Override\n public int getIndex() {\n return index_;\n }", "@java.lang.Override\n public int getIndex() {\n return index_;\n }", "@java.lang.Override\n public int getIndex() {\n return index_;\n }", "public int getIndex() {\n return index_;\n }", "public int getIndex() {\n return index_;\n }", "public int getIndex() {\n return index_;\n }", "public int getIndex() {\n return index_;\n }", "public int getIndex() {\n return index_;\n }", "public int getIndex() {\n return index_;\n }", "public int getIndex() {\n return this.index;\n }", "public int getIndex() {\n return this.index;\n }", "public Integer index() {\n return this.index;\n }", "@Override\n public int nextIndex()\n {\n return idx+1; \n }", "public int getIndex();", "public int getIndex();", "public int getIndex();", "public int getIndex1 () {\r\n\t\treturn _index1;\r\n\t}", "public abstract int getIndex();", "public int getIndex() {\n return mIndex;\n }", "public void setIndex(int index){\r\n \tthis.index = index;\r\n }", "public int getIndex() { \n\t\t\treturn currIndex;\n\t\t}", "private void setIndex(int index){\n\t\tthis.index = index;\n\t}", "public int getIdx() {\n return idx;\n }", "private Index(int i) {\r\n _value = i;\r\n }", "public Integer getIndex() {\n return index;\n }", "public int getValue() {\r\n return index;\r\n }", "private int newIndex() {\n //return indexes.remove(0);\n return random.nextInt(81);\n }", "public short getIndex()\n {\n return index;\n }", "public int getPosition(){\n return -1;\n }", "public int getIndex() {\n return index_;\n }", "public int getIndex() {\n return index_;\n }", "public int getIndex() {\n return index_;\n }", "public int getIndex() {\n return index_;\n }", "public int getIndex() {\n return index_;\n }", "public int getIndex() {\n return index_;\n }", "public int getIndex() {\n\t\treturn this.index;\n\t}", "public synchronized final int getIndex() {\r\n return f_index;\r\n }", "public void setIndex(int index) {\n _index = index;\n }", "int index(){\n\n\t\t\n\t\tif (cursor == null) \n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t\treturn index;\n\t}", "void setIdx(int i);" ]
[ "0.8250513", "0.8245695", "0.8245695", "0.8089802", "0.7864802", "0.7864802", "0.7864802", "0.78540635", "0.7845596", "0.7813455", "0.77428925", "0.77297086", "0.771101", "0.76551473", "0.76475435", "0.760967", "0.760967", "0.7598095", "0.757259", "0.75489503", "0.7545127", "0.7453656", "0.74421847", "0.7439525", "0.7429579", "0.7429579", "0.7429579", "0.7429579", "0.7429579", "0.7428653", "0.74164563", "0.74039227", "0.7401055", "0.73476905", "0.7342948", "0.73413324", "0.7307092", "0.7257709", "0.72420424", "0.72397345", "0.72397345", "0.72397345", "0.72356427", "0.72277683", "0.72277683", "0.72277683", "0.7223562", "0.72206795", "0.71521324", "0.71521324", "0.71521324", "0.71521324", "0.71521324", "0.71521324", "0.71521324", "0.71521324", "0.71521324", "0.71521324", "0.71521324", "0.71521324", "0.71521324", "0.71013033", "0.71013033", "0.71013033", "0.708412", "0.708412", "0.708412", "0.708412", "0.708412", "0.708412", "0.7042849", "0.7042849", "0.70228213", "0.70177394", "0.70161515", "0.70161515", "0.70161515", "0.7016014", "0.69767016", "0.694353", "0.6926052", "0.6925188", "0.6901962", "0.68970567", "0.6894351", "0.6894243", "0.6869697", "0.6839157", "0.68366426", "0.6810428", "0.680943", "0.680943", "0.680943", "0.680943", "0.680943", "0.680943", "0.6801905", "0.67873293", "0.67271596", "0.671206", "0.67058265" ]
0.0
-1
Validates given config, returns it on success or throws exception on error
public static Config checkValid(Config config) { ConfigValidator validator = new ConfigValidator(config); try { checkNotNull(config); validator.checkLogLevel(); validator.checkAuthAtMain(); validator.checkAuthXMain(); validator.checkAuthSessionId(); validator.checkAuthSessionToken(); validator.checkAuthUbidMain(); validator.checkAuthControl(); validator.checkMode(); validator.checkList(); validator.checkDocumentSourceTypes(); validator.checkComparators(); validator.checkUserAgent(); validator.checkYearDeviation(); validator.checkTimeout(); validator.checkDataBase(); } catch (NullPointerException | IllegalArgumentException e) { throw new ConfigException.Generic(e.getMessage(), e); } return config; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void validateConfiguration() {}", "protected void validate() throws ConfigurationException\n {\n\n }", "public Configuration(Config config){\n String error = fromConfig(config);\n if(errors){\n throw new RuntimeException(error);\n }\n }", "@Test\n public final void testValidate() {\n final CmdConfiguration config = new CmdConfiguration();\n try {\n config.validate();\n fail();\n } catch (RuntimeException e) {\n // expected because configuration is incomplete\n assertNotNull(e);\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (config != null) {\n config.validate();\n }\n }", "String validate(PluginConfig pluginConfig, String value);", "public void validate() throws ConfigurationException {\n if (Strings.isNullOrEmpty(name)) {\n throw ConfigurationException.propertyNotFoundException(\"name\");\n }\n }", "void validateConfigImpl() throws SMSException {\n if ((orgConfigImpl == null) || !orgConfigImpl.isValid()) {\n try {\n orgConfigImpl = OrganizationConfigManagerImpl.getInstance(\n token, orgName);\n } catch (SSOException ssoe) {\n throw (new SMSException(ssoe, \"sms-INVALID_SSO_TOKEN\"));\n }\n }\n }", "public void verifyConfig() {\r\n if (getIbnrRiskManager() == null)\r\n throw new ConfigurationException(\"The required property 'ibnrRiskManager' is missing.\");\r\n }", "void validate(Supplier<Object> instanceCreator, Config config, String prefix) {\n String prefixedKey = prefixed(prefix, configKey);\n Optional<String> value = config.getOptionalValue(prefixedKey, String.class)\n .or(() -> Optional.ofNullable(defaultValue));\n\n if (value.isPresent()) {\n // there is a configured value, fine\n return;\n }\n\n if (isOptional) {\n // there is no configured value, but the field is optional\n return;\n }\n\n if (hasFieldValue(instanceCreator, field)) {\n // there is an explicit initializer of the field (or it is a primitive type)\n return;\n }\n\n throw new DeploymentException(\"Cannot find configuration key \" + prefixedKey + \" for field \" + field);\n }", "public void verifyConfig() {\r\n if (getProcessErpManager() == null)\r\n throw new ConfigurationException(\"The required property 'processErpManager' is missing.\");\r\n if (getAnchorColumnName() == null)\r\n throw new ConfigurationException(\"The required property 'anchorColumnName' is missing.\");\r\n }", "public void testMemberNotTeamMemberForProjectValidator_InvalidConfig1() {\r\n try {\r\n TestHelper.loadConfiguration(INVALID_CONFIG1);\r\n new MemberNotTeamMemberForProjectValidator(\"MemberNotTeamMemberForProjectValidator\");\r\n fail(\"testMemberNotTeamMemberForProjectValidator_InvalidConfig1 is failure.\");\r\n } catch (RegistrationValidationConfigurationException rvce) {\r\n // pass\r\n } catch (Exception e) {\r\n fail(\"Unknown exception occurs in testMemberNotTeamMemberForProjectValidator_InvalidConfig1.\");\r\n }\r\n }", "@Override\n public void validate(KeyValue config) {\n jdbcSourceConfig = new JdbcSourceConfig(config);\n // validate config\n }", "@Override\r\n\tpublic void validateConfig(Map<String, Object> arg0) throws ConfigException {\n\t\t\r\n\t}", "public void verifyConfig() {\r\n if (getSpecialHandlingManager() == null)\r\n throw new ConfigurationException(\"The required property 'specialHandlingManager' is missing.\");\r\n }", "@Override\n public void validate() {\n LOG.ok(\"Validating configuration {0}\", this);\n\n if (CONNECTION_TYPE_SSH.equals(connectionType)) {\n if (StringUtil.isBlank(hostName))\n throw new ConfigurationException(\"The hostName configuration property is mandatory for SSH connections\");\n if (StringUtil.isBlank(userName))\n throw new ConfigurationException(\"The userName configuration property is mandatory for SSH connections\");\n if ((StringUtil.isBlank(privateKey)) && (password == null))\n throw new ConfigurationException(\"The password configuration property is mandatory for SSH connections if no private key is set\");\n }\n\n if (StringUtil.isBlank(method)) {\n throw new ConfigurationException(\"The method configuration property is mandatory\");\n } else if (!Arrays.asList(METHOD_PW, METHOD_USERADD + \":\" + SUBMETHOD_BSD, METHOD_USERADD + \":\" + SUBMETHOD_LINUX).contains(method)) {\n throw new ConfigurationException(\"Unsupported value in configuration property method\");\n }\n\n if (!Arrays.asList(BECOME_METHOD_DOAS, BECOME_METHOD_NONE, BECOME_METHOD_SUDO).contains(becomeMethod)) {\n throw new ConfigurationException(\"Unsupported value in configuration property becomeMethod\");\n }\n }", "ValidationResult isRepositoryConfigurationValid(RepositoryConfiguration repositoryConfiguration);", "public ValidateConfiguration() {\n super();\n }", "private String fromConfig(final Config config) {\n\n final StringBuilder errorMsg = new StringBuilder();\n\n this.enabled = true;\n if(config.hasPath(\"enabled\")){\n this.enabled = config.getBoolean(\"enabled\");\n }\n\n this.goServerHost = \"\";\n if(config.hasPath(\"server-host\")){\n this.goServerHost = config.getString(\"server-host\");\n }else{\n fieldError(errorMsg, \"server-host\");\n }\n\n this.goLogin = null;\n if (config.hasPath(\"login\")) {\n this.goLogin = config.getString(\"login\");\n }\n\n this.goPassword = null;\n if (config.hasPath(\"password\")) {\n this.goPassword = config.getString(\"password\");\n }\n\n this.goAPIToken = null;\n if (config.hasPath(\"api-token\")) {\n this.goAPIToken = config.getString(\"api-token\");\n }\n\n this.apiMsTeamsHost = \"http://localhost\";\n if(config.hasPath(\"api-msteams-host\")){\n this.apiMsTeamsHost = config.getString(\"api-msteams-host\");\n }else {\n fieldError(errorMsg, \"api-msteams-host\");\n }\n\n if(config.hasPath(\"msteams\")){\n\n ConfigList teams = config.getList(\"msteams\");\n this.msTeamsConfigList = new ArrayList<>();\n\n for(Object team : teams.unwrapped()){\n //Add new team\n MsTeamsConfig teamsConfig = new MsTeamsConfig((Map<String, Object>) team, errorMsg);\n this.msTeamsConfigList.add(teamsConfig);\n }\n }else {\n fieldError(errorMsg, \"msteams\");\n }\n\n this.displayConsoleLogLinks = true;\n if (config.hasPath(\"display-console-log-links\")) {\n displayConsoleLogLinks = config.getBoolean(\"display-console-log-links\");\n }\n\n this.displayMaterialChanges = true;\n if (config.hasPath(\"displayMaterialChanges\")) {\n displayMaterialChanges = config.getBoolean(\"displayMaterialChanges\");\n }\n\n this.processAllRules = true;\n if (config.hasPath(\"process-all-rules\")) {\n processAllRules = config.getBoolean(\"process-all-rules\");\n }\n\n this.truncateChanges = true;\n if(config.hasPath(\"truncate-changes\")) {\n truncateChanges = config.getBoolean(\"truncate-changes\");\n }\n\n if (config.hasPath(\"proxy\")) {\n Config proxyConfig = config.getConfig(\"proxy\");\n if (proxyConfig.hasPath(\"hostname\") && proxyConfig.hasPath(\"port\") && proxyConfig.hasPath(\"type\")) {\n String hostname = proxyConfig.getString(\"hostname\");\n int port = proxyConfig.getInt(\"port\");\n String type = proxyConfig.getString(\"type\").toUpperCase();\n Proxy.Type proxyType = Proxy.Type.valueOf(type);\n this.proxy = new Proxy(proxyType, new InetSocketAddress(hostname, port));\n }\n }\n\n return errorMsg.toString();\n }", "boolean requiresConfigSchema();", "@Override\n public void checkConfiguration() {\n }", "public Result check(ConfigContext context)\n {\n Result result;\n result = super.getInitializedResult();\n //<addition author=\"[email protected]\" [bug/RFE]-id=\"\" >\n // 8.0 XML Verifier\n /*try {\n Server server = (Server)context.getRootConfigBean();\n JmsService jms = server.getJmsService();\n String httpPort = jms.getPort();\n try {\n if(StaticTest.isPortValid(Integer.parseInt(httpPort))) \n result.passed(\"Valid Port\");\n else\n result.failed(\"Invalid JMSService Port - \" + httpPort);\n }\n catch(NumberFormatException e) {\n result.failed(\"Invalid JMSService Port Number - \" + httpPort);\n }\n // Bug : 4713369\n try {\n String timeout = jms.getInitTimeoutInSeconds();\n if(Integer.parseInt(timeout) < 0)\n result.failed(smh.getLocalString(getClass().getName()+\".initTimeoutNegative\",\"Init Timeout cannot be negative number\"));\n else\n result.passed(\"** Passed ** \");\n } catch(NumberFormatException e) {\n result.failed(smh.getLocalString(getClass().getName()+\".initTimeoutInvalid\",\"Init Timeout : invalid number\"));\n }\n }\n catch(Exception ex) {\n //<addition author=\"[email protected]\" [bug/rfe]-id=\"logging\" >\n /*ex.printStackTrace();\n result.failed(\"Exception : \" + ex.getMessage());\n // Logging\n _logger.log(Level.FINE, \"serverxmlverifier.exception\", ex);\n result.failed(\"Exception : \" + ex.getMessage());\n //</addition>\n }*/\n //</addition>\n return result;\n }", "@Test(expected = ConfigException.class)\n public void testConfigParsingInvalidSchemaVersion() {\n PowerMock.replayAll();\n Map<String, String> sampleConfig = new HashMap<>();\n sampleConfig.put(XENON_NAME, \"xenon-sink-connector\");\n sampleConfig.put(XENON_HOST, \"f3\");\n sampleConfig.put(XENON_PORT, \"51000\");\n sampleConfig.put(XENON_BUFFER_CAPACITY, \"164\");\n // cannot have null value where we expected int.\n sampleConfig.put(SCHEMA_VERSION, \"\");\n sampleConfig.put(TOPICS, \"topicA,topicB\");\n sampleConfig.put(XENON_DATASET_NAME, \"temp\");\n sampleConfig.put(XENON_DATASET_SCHEMA, \"{Date:CHAR, Type:CHAR, SymbolID:CHAR, \"\n + \"SequenceID:CHAR, BuySell:CHAR, Volume:CHAR, Symbol:CHAR, \"\n + \"Durationms:CHAR, Attribute:CHAR}\");\n Map<String, Object> checkConfig = connector.config().parse(sampleConfig);\n PowerMock.verifyAll();\n }", "private void checkConfig() {\n\t\t\n\t\tif (config.getDouble(\"configversion\", 0.0) - configVersion > .001) {\n\t\t\tString name = config.getString(QuestConfigurationField.NAME.getKey(), \"NO NAME\");\n\t\t\tQuestManagerPlugin.questManagerPlugin.getLogger().warning(\"The quest [\" + name + \"] has an invalid version!\\n\"\n\t\t\t\t\t+ \"QuestManager Configuration Version: \" + configVersion + \" doesn't match quest's: \" \n\t\t\t\t\t+ config.getDouble(\"configversion\", 0.0));\n\t\t\t\n\t\t}\n\t\t\n\t\t//Check each field and put in defaults if they aren't there (niave approach)\n\t\tfor (QuestConfigurationField field : QuestConfigurationField.values()) {\n\t\t\tif (!config.contains(field.getKey())) {\n\t\t\t\tQuestManagerPlugin.questManagerPlugin.getLogger().warning(\"[\" + getName() + \"] \"\n\t\t\t\t\t\t+ \"Failed to find field information: \" + field.name());\n\t\t\t\tQuestManagerPlugin.questManagerPlugin.getLogger().info(\"Adding default value...\");\n\t\t\t\tconfig.set(field.getKey(), field.getDefault());\n\t\t\t}\n\t\t}\n\t}", "public boolean isServiceConfigurationValid(String config) {\n try {\n LayoutProject layoutProj = new LayoutProject();\n Environment environment = new Environment();\n PageLayout layout = new PageLayout();\n\n layoutProj.setRegisteredEnvironment(environment);\n layoutProj.setRegisteredLayout(layout);\n loadLayersWithLayoutProject(config, layoutProj);\n } catch (Exception ex) {\n ex.printStackTrace();\n return false;\n }\n return true;\n }", "public ValidationResult validateConfiguration(@Nonnull AnalysisContext analysisContext) {\n ValidationResult validation = ValidationResult.success();\n\n validation = validate(analysisContext, validation, availableFilters);\n validation = validate(analysisContext, validation, availableReporters);\n validation = validate(analysisContext, validation, availableApiAnalyzers);\n validation = validate(analysisContext, validation, availableTransforms);\n\n return validation;\n }", "public void verifyConfig() {\r\n if (getAnchorColumnName() == null)\r\n throw new ConfigurationException(\"The required property 'anchorColumnName' is missing.\");\r\n }", "public void validate(Object str) throws InvalidConfigException\n {\n super.validate(str);\n checkValidName((String)str);\n checkValidXmlToken((String)str);\n checkValidObjectNameToken((String)str);\n }", "private void validate() throws DomainXmlPreParserException {\n if (serverConfigRef == null)\n throw new DomainXmlPreParserException(\n Strings.get(\"dxpp.serverNotFound\", instanceName));\n // 2. config-ref of server matches config-ref of cluster\n if (!serverConfigRef.equals(cluster.configRef))\n throw new DomainXmlPreParserException(\n Strings.get(\"dxpp.configrefnotmatch\", instanceName, cluster.name));\n\n if(!configNames.contains(serverConfigRef))\n throw new DomainXmlPreParserException(\n Strings.get(\"dxpp.confignotfound\", instanceName, serverConfigRef));\n\n\n\n valid = true;\n }", "public static void acceptConfig() {\r\n\t\t//Here, it tries to read over the config file using try-catch in case of Exception\r\n\t\ttry {\r\n\t\t\tProperties properties = new Properties();\r\n\t\t\tFileInputStream fis = new FileInputStream(new File(\"config.properties\"));\r\n\t\t\tproperties.load(fis);\r\n\t\t\tString storage = properties.getProperty(\"storage\");\r\n\t\t\tif(storage == null) \r\n\t\t\t\tthrow new IllegalArgumentException(\"Property 'storage' not found\");\r\n\t\t\tif(storage.equals(\"tree\"))\r\n\t\t\t\tdata = new BinarySearchTree();\r\n\t\t\tif(storage.equals(\"trie\"))\r\n\t\t\t\tdata = new Trie();\r\n\t\t\tif(data == null) \r\n\t\t\t\tthrow new IllegalArgumentException(\"Not valid storage configuration.\");\r\n\t\t}\r\n\t\t//If an Exception occurs, it just prints a message\r\n\t\tcatch (FileNotFoundException e) {\r\n\t\t\tSystem.out.println(\"Configuration file not found.\");\r\n\t\t\tSystem.exit(1);\r\n\t\t} catch (IllegalArgumentException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\tSystem.exit(1);\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.out.println(\"Error reading the configuration file.\");\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\t}", "ValidationResult isPackageConfigurationValid(PackageConfiguration packageConfiguration, RepositoryConfiguration repositoryConfiguration);", "public void validate() {\n String prefix = this.getClass().getSimpleName() + \" Error: \";\n // validate the config\n if (this.defaultCfg.getScript() == null) {\n throw new IllegalArgumentException(prefix + \"default script is required\");\n }\n if (this.baseHDFSDir == null) {\n throw new IllegalArgumentException(prefix + \"baseHDFSDir is required\");\n }\n\n if (!this.baseHDFSDir.endsWith(\"/\")) {\n setBaseHDFSDir(this.baseHDFSDir + \"/\");\n }\n\n if (this.socketPort < 1025 || socketPort > 65534) {\n throw new IllegalArgumentException(prefix + \"socketPort is required and must be greater than 1024 and less than 65535\");\n }\n\n if (this.flagFileDirectory == null) {\n throw new IllegalArgumentException(prefix + \"flagFileDirectory is required\");\n }\n\n if (this.defaultCfg.getMaxFlags() < 1) {\n throw new IllegalArgumentException(prefix + \"Default Max Flags must be set.\");\n }\n\n if (this.distributorType == null || !this.distributorType.matches(\"(simple|date|folderdate)\")) {\n throw new IllegalArgumentException(\n \"Invalid Distributor type provided: \" + this.distributorType + \". Must be one of the following: simple|date|folderdate\");\n }\n\n for (FlagDataTypeConfig cfg : this.flagCfg) {\n if (cfg.getInputFormat() == null)\n throw new IllegalArgumentException(\"Input Format Class must be specified for data type: \" + cfg.getDataName());\n if (cfg.getIngestPool() == null)\n throw new IllegalArgumentException(\"Ingest Pool must be specified for data type: \" + cfg.getDataName());\n if (cfg.getFlagCountThreshold() == FlagMakerConfig.UNSET) {\n cfg.setFlagCountThreshold(this.flagCountThreshold);\n }\n if (cfg.getTimeoutMilliSecs() == FlagMakerConfig.UNSET) {\n cfg.setTimeoutMilliSecs(this.timeoutMilliSecs);\n }\n cfg.setLast(System.currentTimeMillis() + cfg.getTimeoutMilliSecs());\n if (cfg.getMaxFlags() < 1) {\n cfg.setMaxFlags(this.defaultCfg.getMaxFlags());\n }\n if (cfg.getReducers() < 1) {\n cfg.setReducers(this.defaultCfg.getReducers());\n }\n if (cfg.getScript() == null || \"\".equals(cfg.getScript())) {\n cfg.setScript(this.defaultCfg.getScript());\n }\n if (cfg.getFileListMarker() == null || \"\".equals(cfg.getFileListMarker())) {\n cfg.setFileListMarker(this.defaultCfg.getFileListMarker());\n }\n if (cfg.getFileListMarker() != null) {\n if (cfg.getFileListMarker().indexOf(' ') >= 0) {\n throw new IllegalArgumentException(prefix + \"fileListMarker cannot contain spaces\");\n }\n }\n if (cfg.getCollectMetrics() == null || \"\".equals(cfg.getCollectMetrics())) {\n cfg.setCollectMetrics(this.defaultCfg.getCollectMetrics());\n }\n List<String> folders = cfg.getFolder();\n if (folders == null || folders.isEmpty()) {\n folders = new ArrayList<>();\n cfg.setFolder(folders);\n // add the default path. we'll bomb later if it's not there.\n folders.add(cfg.getDataName());\n }\n List<String> fixedFolders = new ArrayList<>();\n for (int i = 0; i < folders.size(); i++) {\n for (String folder : StringUtils.split(folders.get(i), ',')) {\n folder = folder.trim();\n // let someone specify an absolute path.\n if (!folder.startsWith(\"/\")) {\n fixedFolders.add(this.baseHDFSDir + folder);\n } else {\n fixedFolders.add(folder);\n }\n }\n }\n cfg.setFolder(fixedFolders);\n }\n }", "public Result check(ConfigContextEvent ccce) {\n Result result = new Result();\n Object value = ccce.getObject();\n String beanName = ccce.getBeanName();\n if(beanName!=null) {\n String name = ccce.getName();\n return testSave(name, (String) value);\n }\n \n //<addition author=\"[email protected]\" [bug/RFE]-id=\"\" >\n // 8.0 XML Verifier\n //JmsService jms = (JmsService) value; \n JmsHost jms = (JmsHost) value;\n //</addition>\n String httpPort = jms.getPort();\n try {\n if(StaticTest.isPortValid(Integer.parseInt(httpPort))) \n result.passed(\"Valid Port\");\n else\n result.failed(\"Invalid JMSService Port : \" + httpPort);\n }\n catch(NumberFormatException e) {\n result.failed(\"Invalid JMSService Port Number : \" + httpPort);\n }\n return result;\n }", "private void throwException() throws ConfigurationFormatException {\n\n String[] arr = data.split(\" \");\n\n int rows = numberOfRows(arr);\n if (rows != size) {\n throw new ConfigurationFormatException(\"Invalid configuration format: \" +\n \"Invalid number of rows in configuration (found \" + rows + \").\");\n }\n\n int columns = numberOfColumns(arr);\n if (columns != size) {\n throw new ConfigurationFormatException(\"Invalid configuration format: \" +\n \"Invalid number of columns in configuration (found \" + columns + \").\");\n }\n\n\n for (int i = 0; i < arr.length; i++) {\n if (!arr[i].equals(\":\")) {\n try {\n int a = Integer.parseInt(arr[i]);\n } catch (NumberFormatException e) {\n throw new ConfigurationFormatException(\"Invalid configuration format: \" +\n \"Malformed configuration '\" + data + \"'.\");\n }\n }\n }\n }", "@Test(expected = ConfigException.class)\n public void testConfigParsingInvalidPortValue() {\n PowerMock.replayAll();\n Map<String, String> sampleConfig = new HashMap<>();\n sampleConfig.put(XENON_NAME, \"xenon-sink-connector\");\n sampleConfig.put(XENON_HOST, \"f3\");\n //port value is invalid as value is to be at least 1024.\n sampleConfig.put(XENON_PORT, \"1022\");\n sampleConfig.put(XENON_BUFFER_CAPACITY, \"164\");\n sampleConfig.put(SCHEMA_VERSION, \"1\");\n sampleConfig.put(TOPICS, \"topicA,topicB\");\n sampleConfig.put(XENON_DATASET_NAME, \"temp\");\n sampleConfig.put(XENON_DATASET_SCHEMA, \"{Date:CHAR, Type:CHAR, SymbolID:CHAR, \"\n + \"SequenceID:CHAR, BuySell:CHAR, Volume:CHAR, Symbol:CHAR, \"\n + \"Durationms:CHAR, Attribute:CHAR}\");\n Map<String, Object> checkConfig = connector.config().parse(sampleConfig);\n PowerMock.verifyAll();\n }", "protected void check() throws IOException, ServletException {\n if(value.length()==0)\n error(\"please specify a configuration\");\n else {\n \t\t//TODO add more checks\n \t\tok();\n }\n }", "@Override\n public boolean validarConfiguracion(ContabilidadBoletaje conf) throws CRUDException {\n Optional op = Optional.ofNullable(conf.getIdTotalBoletoBs());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe configuracion para la el Total Boleto Bs\");\n }\n\n op = Optional.ofNullable(conf.getIdTotalBoletoUs());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe configuracion para la el Total Boleto Usd\");\n }\n\n op = Optional.ofNullable(conf.getIdCuentaFee());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe configuracion para la el Total Cuenta Fee\");\n }\n\n op = Optional.ofNullable(conf.getIdDescuentos());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe configuracion para la el Total Descuentos\");\n }\n op = Optional.ofNullable(conf.getCuentaEfectivoNoBspDebeBs());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Efectivo No BSP Debe Bs\");\n }\n op = Optional.ofNullable(conf.getCuentaEfectivoNoBspDebeUsd());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Efectivo No BSP Debe Usd\");\n }\n op = Optional.ofNullable(conf.getCuentaEfectivoNoBspHaberBs());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Efectivo No BSP Haber Bs\");\n }\n op = Optional.ofNullable(conf.getCuentaEfectivoNoBspHaberUsd());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Efectivo No BSP Haber Usd\");\n }\n op = Optional.ofNullable(conf.getTarjetaCreditoBspDebeBs());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Tarjeta Credito Bsp Debe BS\");\n }\n op = Optional.ofNullable(conf.getTarjetaCreditoBspDebeUsd());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Tarjeta Credito Bsp Debe USD\");\n }\n op = Optional.ofNullable(conf.getTarjetaCreditoBspHaberBs());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Tarjeta Credito Bsp Haber BS\");\n }\n op = Optional.ofNullable(conf.getTarjetaCreditoBspHaberUsd());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Tarjeta Credito Bsp Debe USD\");\n }\n op = Optional.ofNullable(conf.getCuentaEfectivoNoBspDebeBs());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Cuenta Efectivo No BSP Debe Bs\");\n }\n op = Optional.ofNullable(conf.getCuentaEfectivoNoBspDebeUsd());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Cuenta Efectivo No BSP Debe USD\");\n }\n op = Optional.ofNullable(conf.getCuentaEfectivoNoBspHaberBs());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Cuenta Efectivo No BSP Haber Bs\");\n }\n op = Optional.ofNullable(conf.getCuentaEfectivoNoBspHaberUsd());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Cuenta Efectivo No BSP Haber USD\");\n }\n\n op = Optional.ofNullable(conf.getOtrosCargosClienteCobrarDebeBs());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Otros Cargos Clientes x Cobrar Debe Bs.\");\n }\n op = Optional.ofNullable(conf.getOtrosCargosClienteCobrarDebeUsd());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Otros Cargos Clientes x Cobrar Debe Usd.\");\n }\n\n return true;\n }", "public T getConfig() throws InvalidConfigFormatException {\n try {\n Reader settingsFile = new FileReader( getSettingsFileName() );\n T result = gsonObject.fromJson(settingsFile, settingsClass);\n settingsFile.close();\n\n return result;\n } catch (Exception e) {\n throw new InvalidConfigFormatException(\"Can't read config file: \" + e.getMessage() );\n }\n\n }", "protected void validateConfig() {\n A.notNull(getStreamer(), \"Streamer\");\n A.notNull(getIgnite(), \"Ignite\");\n A.notNull(endpointUrl, \"Twitter Streaming API endpoint\");\n\n A.ensure(getSingleTupleExtractor() != null || getMultipleTupleExtractor() != null, \"Twitter extractor\");\n\n String followParam = apiParams.get(SITE_USER_ID_KEY);\n\n A.ensure(followParam != null && followParam.matches(\"^(\\\\d+,? ?)+$\"),\n \"Site streaming endpoint must provide 'follow' param with value as comma separated numbers\");\n }", "public boolean configurationIsValid() {\n\t\tif (this.maxThreadNumberResourceWorker + this.maxThreadNumberSeedWorker != this.maxThreadNumber) {\n\t\t\tlog.error(Logging.format(\"Confirguation error: Thread number configuration is wrong.\"));\n\t\t\treturn false;\n\t\t} else if (seedList == null || seedList.size() == 0) {\n\t\t\tlog.error(Logging.format(\"Confirguation error: Seed list is empty.\"));\n\t\t\treturn false;\n\t\t} else if (StringUtils.isEmpty(workspacePath)) {\n\t\t\tlog.error(Logging.format(\"Confirguation error: Workspace path is not set correctly.\"));\n\t\t\treturn false;\n\t\t} else if (!Files.exists(runtimeBasePath)) {\n\t\t\tlog.error(Logging.format(\"Confirguation error: Runtime directory ({}) does not exist.\", runtimeBasePath));\n\t\t\treturn false;\n\t\t}\n\t\tlog.info(Logging.format(\"Configuration check is passed.\"));\n\t\treturn true;\n\t}", "public void validate() {\n Validate.notEmpty(filePath, \"Configuration file path not specified\");\n Validate.notEmpty(fileEncoding, \"Configuration file encoding not specified\");\n Validate.notEmpty(syntaxCheckCommand, \"Syntax check command not specified\");\n Validate.notEmpty(restartCommand, \"Restart command not specified\");\n Validate.notNull(hostName, \"Host name not specified\");\n Validate.isTrue(port > 0, \"Port must be greater than zero\");\n Validate.isTrue(checkInterval > 0, \"Health check interval must be greater than zero\");\n Validate.isTrue(checkTimeout > 0, \"Health check timeout must be greater than zero\");\n }", "@Test\n\tpublic void test_invalid_config_1() throws Exception {\n\t\tConfig.configFile = \"test_files/config_files/invalid1.json\";\n\t\tString missingData = \"STUDENT_COURSE_COL\";\n\t\t\n\t\tconstructObjectsExpectFailure(missingData);\n\t}", "public Config getConfig();", "private Map<ConfigType, ValidationResult> validateSemantics(Map<ConfigType, ConfigDataProvider> configTypeWithDataProvider) {\n Map<ConfigType, ValidationResult> result = new HashMap<>();\n\n // edge cases when the input is not valid or is empty\n if (configTypeWithDataProvider == null || configTypeWithDataProvider.isEmpty()) {\n return result;\n }\n\n ConfigBuilder configBuilder = ConfigBuilder.get();\n Optional<FeatureDefConfig> optionalFeatureDefConfig;\n Optional<String> sourceNameValidationWarnStr;\n\n if (configTypeWithDataProvider.containsKey(ConfigType.FeatureDef)) {\n // Populate ValidationResult warning string when source name duplicates exist in different feature def configs\n sourceNameValidationWarnStr = validateFeatureDefConfigSourceNames(configTypeWithDataProvider.get(ConfigType.FeatureDef));\n ConfigDataProvider featureDefConfigDataProvider = configTypeWithDataProvider.get(ConfigType.FeatureDef);\n optionalFeatureDefConfig = Optional.of(configBuilder.buildFeatureDefConfig(featureDefConfigDataProvider));\n } else {\n optionalFeatureDefConfig = Optional.empty();\n sourceNameValidationWarnStr = Optional.empty();\n }\n\n if (configTypeWithDataProvider.containsKey(ConfigType.Join)) {\n ConfigDataProvider joinConfigDataProvider = configTypeWithDataProvider.get(ConfigType.Join);\n JoinConfig joinConfig = configBuilder.buildJoinConfig(joinConfigDataProvider);\n String errMsg = String.join(\"\", \"Can not perform semantic validation as the Join config is\",\n \"provided but the FeatureDef config is missing.\");\n FeatureDefConfig featureDefConfig = optionalFeatureDefConfig.orElseThrow(() -> new ConfigValidationException(errMsg));\n result = validateConsumerConfigSemantics(joinConfig, featureDefConfig);\n\n } else {\n // TODO add feature generation config semantic validation support\n // only perform semantic check for FeatureDef config\n FeatureDefConfig featureDefConfig = optionalFeatureDefConfig.orElseThrow(() -> new ConfigValidationException(\n \"Can not perform semantic validation as the FeatureDef config is missing.\"));\n result.put(ConfigType.FeatureDef, validateSemantics(featureDefConfig));\n }\n\n if (sourceNameValidationWarnStr.isPresent() && result.containsKey(ConfigType.FeatureDef)) {\n result.put(ConfigType.FeatureDef,\n new ValidationResult(ValidationType.SEMANTIC, ValidationStatus.WARN, sourceNameValidationWarnStr.get()));\n }\n return result;\n }", "private SimulationPropertiesDTO validateSimulationProperties(JSONObject simulationPropertiesConfig)\n throws InvalidConfigException {\n /**\n * checkAvailability() method performs the following checks\n * 1. has\n * 2. isNull\n * 3. isEmpty\n *\n * if checks are successful create simulationPropertiesDTO object\n * */\n try {\n if (!checkAvailability(simulationPropertiesConfig, EventSimulatorConstants.EVENT_SIMULATION_NAME)) {\n throw new InvalidConfigException(\"Simulation name is required for event simulation. Invalid \" +\n \"simulation properties configuration provided : \" + simulationPropertiesConfig.toString());\n }\n if (!checkAvailability(simulationPropertiesConfig, EventSimulatorConstants.SIMULATION_TIME_INTERVAL)) {\n throw new InvalidConfigException(\"Time interval is required for simulation '\" +\n simulationPropertiesConfig.getString(EventSimulatorConstants.EVENT_SIMULATION_NAME) +\n \"'. Invalid simulation properties configuration provided : \"\n + simulationPropertiesConfig.toString());\n }\n /**\n * a simulation must have the timestampStartTime specified or set to null\n * else throw an exception\n * if timestampStartTime is set to null it implies the current system time must be taken as the timestamp\n * start time\n * if null, set timestampStartTime to system current time\n * else if timestampStartTime is specified, and that value is positive use that value as least possible\n * timestamp value\n * */\n long timestampStartTime;\n if (simulationPropertiesConfig.has(EventSimulatorConstants.TIMESTAMP_START_TIME)) {\n if (simulationPropertiesConfig.isNull(EventSimulatorConstants.TIMESTAMP_START_TIME)) {\n timestampStartTime = System.currentTimeMillis();\n } else if (!simulationPropertiesConfig.getString(EventSimulatorConstants.TIMESTAMP_START_TIME)\n .isEmpty()) {\n timestampStartTime = simulationPropertiesConfig\n .getLong(EventSimulatorConstants.TIMESTAMP_START_TIME);\n if (timestampStartTime < 0) {\n throw new InvalidConfigException(\"TimestampStartTime must be a positive value for simulation \" +\n \"'\" + simulationPropertiesConfig.getString(EventSimulatorConstants\n .EVENT_SIMULATION_NAME) + \"'. Invalid simulation properties configuration provided : \"\n + simulationPropertiesConfig.toString());\n }\n } else {\n throw new InvalidConfigException(\"TimestampStartTime is required for simulation '\" +\n simulationPropertiesConfig.getString(EventSimulatorConstants.EVENT_SIMULATION_NAME)\n + \"'. Invalid simulation properties configuration provided : \"\n + simulationPropertiesConfig.toString());\n }\n } else {\n throw new InvalidConfigException(\"TimestampStartTime is required for simulation '\" +\n simulationPropertiesConfig.getString(EventSimulatorConstants.EVENT_SIMULATION_NAME)\n + \"'. Invalid simulation properties configuration provided : \" + simulationPropertiesConfig\n .toString());\n }\n /**\n * either the timestampEndTime or the number of events to be generated must be specified for simulation\n * initialize the timestampEndTime and noOfEventsRequire to -2 to indicate that the values have not been\n * retrieved from the simulation properties configuration\n * check whether the simulation has timestampEndTime, if so it must either be null or a non-empty value.\n * else throw an exception\n * else if timestampEndTime is null set timestampEndTime property as -1. it implies that there is no bound\n * for maximum timestamp possible for an event.\n * else if timestampEndTime is specified, use that as the maximum possible timestamp value\n * check whether the simulation properties configuration has noOfEventsRequired specified.\n * if so it must be set to null or specified\n * else throw an exception\n * if noOfEventRequired is null it implies that there is no limit on the number of events to be generated\n * else set the specified value to property 'noOfEventsRequired'\n * finally check whether both timestampEndTime and noOfEventsRequired is still -2, this implies that\n * neither of the properties have been specified, hence log a warning and set both properties to -1 to\n * imply that there is no restriction on timestampEnfTime or noOfEvents\n * the availability of properties timestampEndTime and noOfEventsRequired will not be tested using an\n * 'else-if' statement since its possible for user to require both properties\n * */\n long timestampEndTime = -2;\n int noOfEventsRequired = -2;\n if (simulationPropertiesConfig.has(EventSimulatorConstants.TIMESTAMP_END_TIME)) {\n if (simulationPropertiesConfig.isNull(EventSimulatorConstants.TIMESTAMP_END_TIME)) {\n timestampEndTime = -1;\n } else if (!simulationPropertiesConfig.getString(EventSimulatorConstants.TIMESTAMP_END_TIME)\n .isEmpty()) {\n timestampEndTime = simulationPropertiesConfig.getLong(EventSimulatorConstants.TIMESTAMP_END_TIME);\n if (timestampEndTime < 0) {\n throw new InvalidConfigException(\"TimestampEndTime must be a positive value for simulation \" +\n \"'\" + simulationPropertiesConfig.getString(EventSimulatorConstants\n .EVENT_SIMULATION_NAME) + \"'. Invalid simulation properties configuration provided : \"\n + simulationPropertiesConfig.toString());\n }\n } else {\n throw new InvalidConfigException(\"TimestampEndTime is required for simulation '\" +\n simulationPropertiesConfig.getString(EventSimulatorConstants.EVENT_SIMULATION_NAME) +\n \"'. TimestampEndTime must be either specified or set to null. Invalid simulation \" +\n \"properties configuration provided : \" + simulationPropertiesConfig.toString());\n }\n }\n if (simulationPropertiesConfig.has(EventSimulatorConstants.NUMBER_OF_EVENTS_REQUIRED)) {\n if (simulationPropertiesConfig.isNull(EventSimulatorConstants.NUMBER_OF_EVENTS_REQUIRED)) {\n noOfEventsRequired = -1;\n } else if (!simulationPropertiesConfig.getString(EventSimulatorConstants.NUMBER_OF_EVENTS_REQUIRED)\n .isEmpty()) {\n noOfEventsRequired = simulationPropertiesConfig\n .getInt(EventSimulatorConstants.NUMBER_OF_EVENTS_REQUIRED);\n if (noOfEventsRequired < 0) {\n throw new InvalidConfigException(\"Number of event to be generated for simulation '\" +\n simulationPropertiesConfig.getString(EventSimulatorConstants.EVENT_SIMULATION_NAME) +\n \"' must be a positive value. Invalid simulation configuration provided : \" +\n simulationPropertiesConfig.toString());\n }\n } else {\n throw new InvalidConfigException(\"Number of event to be generated for simulation '\" +\n simulationPropertiesConfig.getString(EventSimulatorConstants.EVENT_SIMULATION_NAME) + \"' \" +\n \"must be either specified or set to null. Invalid simulation configuration provided : \" +\n simulationPropertiesConfig.toString());\n }\n }\n /**\n * prior to checking whether the timestamp limits are valid, first check whether the timestampEndTime was\n * provided in the simulation configuration, if not assign it to -1 to imply that there is not\n * restriction on the maximum possible timestamp\n * */\n if (timestampEndTime == -2 && noOfEventsRequired == -2) {\n log.warn(\"Either the timestampEndTime or the number of event to be generated \" +\n \"must be either specified for simulation '\" + simulationPropertiesConfig.getString\n (EventSimulatorConstants.EVENT_SIMULATION_NAME) + \"'. TimestampEndTime and number of events \" +\n \"to be generated are set to -1 for simulation configuration : \" + simulationPropertiesConfig\n .toString());\n timestampEndTime = -1;\n noOfEventsRequired = -1;\n }\n if (timestampEndTime != -1 && timestampEndTime < timestampStartTime) {\n throw new InvalidConfigException(\"Either the timestampEndTime must be set to null \" +\n \"or the timestampStartTime must be less than or equal the timestampEndTime. Invalid \" +\n \"simulation properties configuration provided : \" + simulationPropertiesConfig.toString());\n }\n// create simulationPropertiesDTO object\n SimulationPropertiesDTO simulationPropertiesDTO = new SimulationPropertiesDTO();\n simulationPropertiesDTO.setSimulationName(simulationPropertiesConfig\n .getString(EventSimulatorConstants.EVENT_SIMULATION_NAME));\n simulationPropertiesDTO.setTimeInterval(simulationPropertiesConfig\n .getLong(EventSimulatorConstants.SIMULATION_TIME_INTERVAL));\n simulationPropertiesDTO.setTimestampStartTime(timestampStartTime);\n simulationPropertiesDTO.setTimestampEndTime(timestampEndTime);\n simulationPropertiesDTO.setNoOfEventsRequired(noOfEventsRequired);\n return simulationPropertiesDTO;\n } catch (JSONException e) {\n log.error(\"Error occurred when accessing simulation configuration for simulation '\" +\n simulationPropertiesConfig.getString(EventSimulatorConstants.EVENT_SIMULATION_NAME) +\n \"'. Invalid simulation properties configuration provided : \" +\n simulationPropertiesConfig.toString() + \". \",\n e);\n throw new InvalidConfigException(\"Error occurred when accessing simulation configuration for simulation '\" +\n simulationPropertiesConfig.getString(EventSimulatorConstants.EVENT_SIMULATION_NAME) + \"'. Invalid\" +\n \" simulation properties configuration provided : \" + simulationPropertiesConfig.toString() + \". \",\n e);\n }\n }", "void checkImageSearchConfiguration(Configuration configuration) throws InvalidConfigurationException;", "static boolean isConfigValid(Path path) {\n Yaml yaml = new Yaml();\n InputStream inputStream = null;\n try {\n inputStream = Files.newInputStream(path);\n } catch (IOException e) {\n // System.err.println(e);\n return false;\n }\n try {\n yaml.load(inputStream);\n } catch (RuntimeException e) {\n // TODO: Good validation messages are available here. An example:\n /*\n while scanning a simple key\n in 'reader', line 7, column 1:\n xx\n ^\n could not find expected ':'\n in 'reader', line 7, column 3:\n xx\n ^\n */\n // System.err.println(e);\n return false;\n }\n\n return true;\n }", "public void testFacesConfigValidity() throws Throwable\n {\n /*\n URL dtdSource = getClass().getResource(\"web-facesconfig_1_1.dtd\");\n String publicID = \n \"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN\";\n URL configSource = getClass().getResource(\"/META-INF/faces-config.xml\");\n executeValidityTest(dtdSource,\n publicID,\n configSource);\n */\n }", "@Test(expected = ConfigException.class)\n public void testConfigParsingInvalidDatasetName() {\n PowerMock.replayAll();\n Map<String, String> sampleConfig = new HashMap<>();\n sampleConfig.put(XENON_NAME, \"xenon-sink-connector\");\n sampleConfig.put(XENON_HOST, \"f3\");\n sampleConfig.put(XENON_PORT, \"51000\");\n sampleConfig.put(XENON_BUFFER_CAPACITY, \"164\");\n sampleConfig.put(SCHEMA_VERSION, \"1\");\n sampleConfig.put(TOPICS, \"topicA,topicB\");\n //XENON_DATASET_NAME is Empty and thus invalid.\n //String must be non-Empty exception thrown.\n sampleConfig.put(XENON_DATASET_NAME, \"\");\n sampleConfig.put(XENON_DATASET_SCHEMA, \"{Date:CHAR, Type:CHAR, SymbolID:CHAR, \"\n + \"SequenceID:CHAR, BuySell:CHAR, Volume:CHAR, Symbol:CHAR, \"\n + \"Durationms:CHAR, Attribute:CHAR}\");\n Map<String, Object> checkConfig = connector.config().parse(sampleConfig);\n PowerMock.verifyAll();\n }", "public void validate() throws org.apache.thrift.TException {\n if (conf != null) {\n conf.validate();\n }\n }", "@Test\n\tpublic void test_invalid_config_17() throws Exception {\n\t\tConfig.configFile = \"test_files/config_files/invalid17.json\";\n\t\tString missingData = \"STUDENT_INPUT\";\n\t\tconstructObjectsExpectFailure(missingData);\n\t}", "@Override\n\tpublic void validateConfigurationWithoutLogin() {\n\t\tcheckAuthorization();\n\t}", "public T configure() {\n if (validationProviderClass == null) {\n throw new ValidationException(\n \"builder is mandatory. Use Validation.byDefaultProvider() to use the generic provider discovery mechanism\");\n }\n // used mostly as a BootstrapState\n GenericBootstrapImpl state = new GenericBootstrapImpl();\n if (resolver == null) {\n resolver = state.getDefaultValidationProviderResolver();\n } else {\n // stay null if no resolver is defined\n state.providerResolver(resolver);\n }\n\n List<ValidationProvider<?>> resolvers;\n try {\n resolvers = resolver.getValidationProviders();\n } catch (RuntimeException re) {\n throw new ValidationException(\n \"Unable to get available provider resolvers.\", re);\n }\n\n for (ValidationProvider<?> provider : resolvers) {\n // GWT validation only support exact matches.\n if (validationProviderClass.equals(provider.getClass())) {\n @SuppressWarnings(\"unchecked\")\n ValidationProvider<T> specificProvider = (ValidationProvider<T>) provider;\n return specificProvider.createSpecializedConfiguration(state);\n }\n }\n throw new ValidationException(\"Unable to find provider: \"\n + validationProviderClass);\n }", "public static void validateConfiguration() throws HealthCheckException {\n for (Map.Entry<String, CheckState> entry : HealthCheck.checks.entrySet()) {\n LOG.info(\"Checking '{}'...\", entry.getKey());\n switch (entry.getValue().check) {\n case STRING:\n processValidation(validateString(entry), entry.getKey(), entry.getValue().check);\n break;\n case INTEGER:\n processValidation(validateInteger(entry), entry.getKey(), entry.getValue().check);\n break;\n case BOOL:\n processValidation(validateBoolean(entry), entry.getKey(), entry.getValue().check);\n break;\n case FILE_EXISTS:\n processValidation(validateFileExists(entry), entry.getKey(), entry.getValue().check);\n break;\n default:\n LOG.error(\"Unknown CHECK type for '{}'\", entry.getKey());\n throw new HealthCheckException(\"Unable to validate config key \" + entry.getKey());\n }\n\n }\n if (HealthCheck.failed) {\n throw new HealthCheckException(\"Healthcheck has detected a misconfiguration for Styx, please fix the preceding issues\");\n } else {\n LOG.info(\"Configuration validation passed\");\n }\n }", "public static ConfigValidator create( final InputSource inputSource )\n throws Exception\n {\n return create( null, inputSource, null );\n }", "private void checkConfigFile(String filename) {\n Scanner input;\n try {\n input = new Scanner(this.getClass().getClassLoader().getResourceAsStream(filename));\n } catch (NullPointerException e){\n throw new IllegalArgumentException(filename + \" cannot be found\", e);\n }\n input.useDelimiter(\"\\\\n\");\n var sim = input.next();\n var policy = input.next();\n String[] policies = policy.split(\",\");\n if(policies.length != policiesLength) {\n throw new IllegalArgumentException(\"Policies Length is not correct\");\n }\n var numStates = input.next();\n int num = 0;\n try {\n num = Integer.parseInt(numStates);\n } catch(IllegalArgumentException e) {\n throw new IllegalArgumentException(\"Num States is not formatted correctly\", e);\n }\n for(int i = 0; i < num; i++) {\n var state = input.next();\n String[] stateObjects = state.split(\",\");\n if(stateObjects.length != stateObjectsLength) {\n throw new IllegalArgumentException(\"State Objects length is not correct\");\n }\n try {\n int intVal = Integer.parseInt(stateObjects[1]);\n if(intVal != i) {\n throw new IllegalArgumentException(\"State value must be sequentially assigned\");\n }\n } catch(IllegalArgumentException e) {\n throw new IllegalArgumentException(\"State value is not int correctly\", e);\n }\n try {\n Color color = Color.valueOf(stateObjects[2]);\n } catch(IllegalArgumentException e) {\n throw new IllegalArgumentException(\"State color is not formatted correctly\", e);\n }\n try {\n double doubleVal = Double.parseDouble(stateObjects[4]);\n } catch(IllegalArgumentException e) {\n throw new IllegalArgumentException(\"Probability is not formatted correctly as a double\", e);\n }\n try {\n int intVal = Integer.parseInt(stateObjects[5]);\n } catch(IllegalArgumentException e) {\n throw new IllegalArgumentException(\"Total Sum is not formatted correctly as an int\", e);\n }\n }\n var colRows = input.next();\n String[] numColRows = colRows.split(\",\");\n if(numColRows.length != 2) {\n throw new IllegalArgumentException(\"Number of values for col/row must be 2\");\n }\n try {\n num = Integer.parseInt(numColRows[0]);\n } catch(IllegalArgumentException e) {\n throw new IllegalArgumentException(\"Row is not formatted correctly as an int\", e);\n }\n try {\n num = Integer.parseInt(numColRows[1]);\n } catch(IllegalArgumentException e) {\n throw new IllegalArgumentException(\"Col is not formatted correctly as an int\", e);\n }\n }", "private void checkConfiguration() throws ConfigurationException\n {\n CombinedConfiguration compositeConfiguration = (CombinedConfiguration) factory\n .getConfiguration();\n\n assertEquals(\"Number of configurations\", 3, compositeConfiguration\n .getNumberOfConfigurations());\n assertEquals(PropertiesConfiguration.class, compositeConfiguration\n .getConfiguration(0).getClass());\n assertEquals(XMLPropertiesConfiguration.class, compositeConfiguration\n .getConfiguration(1).getClass());\n assertEquals(XMLConfiguration.class, compositeConfiguration\n .getConfiguration(2).getClass());\n\n // check the first configuration\n PropertiesConfiguration pc = (PropertiesConfiguration) compositeConfiguration\n .getConfiguration(0);\n assertNotNull(\"Make sure we have a fileName: \" + pc.getFileName(), pc\n .getFileName());\n\n // check some properties\n checkProperties(compositeConfiguration);\n }", "Configuration getConfiguration();", "Configuration getConfiguration();", "Configuration getConfiguration();", "Configuration getConfiguration();", "@Test\n public void configReturnsCorrectValuesForValidKeys() throws Exception\n {\n assertEquals(\"simple_value\", config.getValue(\"simple.key\"));\n assertEquals(\"spaces value\", config.getValue(\"spaces.key\"));\n }", "@Test(expected = IllegalArgumentException.class)\n public void testParseInvalidConfigPathFails()\n {\n parser.parse(\"badConfigPath\");\n fail(\"Should have thrown an IllegalArgumentException\");\n }", "@Test\n\tpublic void test_invalid_config_14() throws Exception {\n\t\tConfig.configFile = \"test_files/config_files/invalid14.json\";\n\t\tString missingData = \"STUDENT_USERNAME\";\n\t\t\n\t\tconstructObjectsExpectFailure(missingData);\n\t}", "@Test\n\tpublic void test_invalid_config_11() throws Exception {\n\t\tConfig.configFile = \"test_files/config_files/invalid11.json\";\n\t\tString missingData = \"NOT_REAL\";\n\t\tConfig.clearConfig();\n\t\t\n\t\ttry {\n\t\t\tConfig.getConfig();\n\t\t\tfail(\"Expected exception\");\n\t\t} catch (InvalidTypeException e) {\n\t\t\tassertTrue(e.getMessage().contains(missingData));\n\t\t}\n\n\t\ttry {\n\t\t\tStudents.forceLoad();\n\t\t\tfail(\"Expected exception\");\n\t\t} catch (ConfigNotValidException e) {\n\t\t\tassertTrue(e.getMessage().contains(missingData));\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tnew Supervisors();\n\t\t\tfail(\"Expected exception\");\n\t\t} catch (ConfigNotValidException e) {\n\t\t\tassertTrue(e.getMessage().contains(missingData));\n\t\t}\n\t}", "ValidationResponse validate();", "@Override\n public Map<ConfigType, ValidationResult> validate(Map<ConfigType, ConfigDataProvider> configTypeWithDataProvider,\n ValidationType validationType) {\n\n switch (validationType) {\n case SYNTACTIC:\n // reuse default implementation in super class to perform syntax validation\n return super.validate(configTypeWithDataProvider, ValidationType.SYNTACTIC);\n case SEMANTIC:\n return validateSemantics(configTypeWithDataProvider);\n default:\n throw new ConfigValidationException(\"Unsupported validation type: \" + validationType.name());\n }\n }", "@Test\n void testValidate_noErrors() {\n ConfigValidator.Result result = configValidator.validateRecursively(appConfig);\n\n Assertions.assertThat(result.getErrorCount()).isEqualTo(0);\n }", "@Test\n\tpublic void test_invalid_config_2() throws Exception {\n\t\tConfig.configFile = \"test_files/config_files/invalid2.json\";\n\t\tString missingData = \"STUDENT_KEYWORD_COLUMNS\";\n\t\t\n\t\tconstructObjectsExpectFailure(missingData);\n\t}", "@Override\r\n public void checkConfiguration() throws ContestServicesConfigurationException {\r\n super.checkConfiguration();\r\n ServicesHelper.checkConfigObject(searchContestsManager, \"searchContestsManager\");\r\n }", "@Test\n\tpublic void test_invalid_config_8() throws Exception {\n\t\t\n\t\tConfig.configFile = \"test_files/config_files/invalid8.json\";\n\t\tString missingData = \"STUDENT_INPUT_FILE\";\n\t\t\n\t\tconstructObjectsExpectFailure(missingData);\n\t}", "@Test\n\tpublic void test_invalid_config_15() throws Exception {\n\t\tConfig.configFile = \"test_files/config_files/invalid15.json\";\n\t\tString missingData = \"STUDENT_COURSE\";\n\t\tconstructObjectsExpectFailure(missingData);\n\t}", "boolean hasInputConfig();", "boolean hasInputConfig();", "boolean hasInputConfig();", "public interface ConfigReader {\n\n /**\n * Checks if the config contains the given Path\n *\n * @return boolean\n */\n boolean contains();\n\n /**\n * Returns the requested value as int\n *\n * @return int\n */\n int getInt();\n\n /**\n * Returns the requested value as boolean\n *\n * @return boolean\n */\n boolean getBoolean();\n\n /**\n * Returns the requested value as String\n *\n * @return String\n */\n String getString();\n\n /**\n * Returns a list as string\n *\n * @return String\n */\n String getStringList();\n\n /**\n * Returns the requested value as List\n *\n * @return List\n */\n List<?> getList();\n\n /**\n * Returns the requested value as Object\n *\n * @return Object\n */\n Object getObject();\n\n}", "TestClassExecutionResult assertConfigMethodFailed(String name);", "@Test\n\tpublic void test_invalid_config_12() throws Exception {\n\t\t\n\t\tConfig.configFile = \"test_files/config_files/invalid12.json\";\n\t\tString missingData = \"\";\n\t\t\n\t\tconstructObjectsExpectFailure(missingData);\n\t}", "@Override\n public boolean isConfigured()\n {\n return (config != null) && config.isValid() &&!config.isDisabled();\n }", "@Test\n\tpublic void test_invalid_config_13() throws Exception {\n\t\tConfig.configFile = \"test_files/config_files/invalid13.json\";\n\t\tString missingData = \"STUDENT_USERNAME\";\n\t\t\n\t\tconstructObjectsExpectFailure(missingData);\n\t}", "boolean hasConfigConnectorConfig();", "public void validate() throws Exception {\n }", "@Test\n\tpublic void test_invalid_config_4() throws Exception {\n\t\t\n\t\tConfig.configFile = \"test_files/config_files/invalid4.json\";\n\t\tString missingData = \"STUDENT_PREFERENCE_COLUMNS\";\n\t\t\n\t\tconstructObjectsExpectFailure(missingData);\n\t}", "public ValidationResult validateContract() {\n return validateContract(apiContract);\n }", "public static ConfigValidator create( final InputStream inputStream )\n throws Exception\n {\n return create( null, inputStream );\n }", "static ConfigImpl load(Path source) {\n log.info(\"Loading config from \" + source);\n\n ConfigImpl ret = null;\n\n if (Files.exists(source)) {\n try {\n try {\n ret = loadJson(source);\n } catch (JsonParseException e) {\n // It's invalid Json ... maybe it is a properties file instead?\n ret = loadProperties(source);\n }\n } catch (IOException e) {\n log.info(\"Failed to load config file \" + source + \". Assuming empty config\", e);\n }\n } else {\n log.info(\"Config source \" + source + \" not found. Assuming empty config\");\n }\n\n if (ret == null) {\n ret = new ConfigImpl();\n }\n\n return ret;\n }", "public Config parseConfig() throws Exception {\n DocumentBuilder documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();\n Document document = documentBuilder.parse(new File(getFile(configFile)));\n\n return parseConfig(document);\n }", "boolean getValidSettings();", "public boolean isValidConfiguration() {\n // Check if the cube has the correct amount of squares\n\n if (!isSquareQuantityValid()) {\n return false;\n }\n\n return true;\n }", "@Override\r\n public void checkConfiguration() throws ContestServicesConfigurationException {\r\n super.checkConfiguration();\r\n ServicesHelper.checkConfigObject(upcomingContestsManager, \"upcomingContestsManager\");\r\n }", "@Test(expected = ConfigurationException.class)\n public void testInvalidSyntax2() throws Exception {\n ConfigurationParser parser = new ConfigurationParser();\n\n parser.parse(CharSource.wrap(\"{ a: 1\"), FlatObject.class);\n }", "private boolean validateRepositoryConfiguration(\n\t\t\tIRepositoryConfiguration conf) {\n\t\treturn true; // fixme igor: valid for all configurations (development\n\t\t\t\t\t\t// mode)\n\t}", "@Test\n public void testGetPropertyError() throws ConfigurationException {\n setUpErrorConfig().getProperty(\"key1\");\n checkErrorListener(ConfigurationErrorEvent.READ, ConfigurationErrorEvent.READ, \"key1\", null);\n }", "private PotentialErrorDatabaseConfiguration setUpErrorConfig() throws ConfigurationException {\n final PotentialErrorDatabaseConfiguration config = setUpConfig();\n setUpErrorListener(config);\n return config;\n }", "@Test\n\tpublic void test_invalid_config_3() throws Exception {\n\t\t\n\t\tConfig.configFile = \"test_files/config_files/invalid3.json\";\n\t\tString missingData = \"STUDENT_NAT_SCI_UNITS\";\n\t\t\n\t\tconstructObjectsExpectFailure(missingData);\n\t}", "public void validateResource(boolean strictValidation) throws SentryConfigurationException;", "@Test(expected = ProjectPaymentCalculatorConfigurationException.class)\n public void testCtor_invalid_1() throws Exception {\n XMLFilePersistence persistence = new XMLFilePersistence();\n // Get configuration\n ConfigurationObject obj =\n persistence.loadFile(DefaultProjectPaymentCalculator.DEFAULT_CONFIG_NAMESPACE, new File(TEST_DIR\n + \"invalid_1.xml\"));\n obj = obj.getChild(DefaultProjectPaymentCalculator.DEFAULT_CONFIG_NAMESPACE);\n new DefaultProjectPaymentCalculator(obj);\n }", "@Test\n public void testDetectConfigurationConfigString() throws Exception {\n\n Config config = ConfigFactory.load(\"componentTest\");\n\n ComponentConfigurator<ComponentConfiguration> configurator = new ComponentConfigurator<>(ComponentConfiguration.class);\n\n ComponentConfiguration testPojo = mapper.readValue(config.root().get(\"configuredComponent\").render(ConfigRenderOptions.concise()), ComponentConfiguration.class);\n\n assert(testPojo != null);\n\n ComponentConfiguration configuredPojo = configurator.detectConfiguration(config, \"configuredComponent\");\n\n assert(configuredPojo != null);\n\n Assert.assertEquals(configuredPojo,testPojo);\n }", "public void checkValidXmlToken(String name) throws InvalidConfigException\n {\n try\n {\n //Construct a valid xml string\n String xml = XML_1 + name + XML_2;\n ByteArrayInputStream bais = new ByteArrayInputStream(xml.getBytes());\n InputSource is = new InputSource(bais);\n DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\n dbf.setValidating(false);\n DocumentBuilder db = dbf.newDocumentBuilder();\n db.parse(is);\n }\n catch (Exception e)\n {\n throw new InvalidConfigException(\n strMgr.getString(\"validator.invalid_value\", getName(), name));\n }\n }", "@RequestMapping(value = \"/bookingConfig\", method = RequestMethod.POST)\n public ResponseEntity bookingConfig(@RequestBody List<Config> config) {\n try {\n\n List<Config> configList = configService.bookingConfig(config);\n return new ResponseEntity(configList, HttpStatus.CREATED);\n\n } catch(ConfigException ce) {\n return new ResponseEntity(generateErrorResponse.generateErrorReponse(\"400\", ce.getMessage()), HttpStatus.BAD_REQUEST);\n } catch(Exception e) {\n return new ResponseEntity(generateErrorResponse.generateErrorReponse(\"500\", \"Internal Server Error\"), HttpStatus.BAD_REQUEST);\n }\n\n }" ]
[ "0.6898073", "0.6635496", "0.61910605", "0.6051384", "0.60436136", "0.5955297", "0.5922552", "0.5904733", "0.5893993", "0.58152354", "0.5796822", "0.57673836", "0.57656723", "0.57634836", "0.57359535", "0.5720482", "0.5705048", "0.56765497", "0.5574255", "0.5561268", "0.55447704", "0.5536615", "0.54802907", "0.54665744", "0.54386467", "0.5425084", "0.540821", "0.5371844", "0.5357303", "0.535137", "0.53468364", "0.5333926", "0.5324216", "0.5313301", "0.53046316", "0.53015435", "0.53002167", "0.5280198", "0.5252977", "0.52446806", "0.5236341", "0.5231309", "0.5224136", "0.5211806", "0.5198981", "0.5196184", "0.5193882", "0.51332927", "0.5096415", "0.50923055", "0.5082807", "0.50717837", "0.5046003", "0.50406444", "0.50165313", "0.5013898", "0.5013803", "0.500641", "0.500641", "0.500641", "0.500641", "0.49976218", "0.49923256", "0.49886635", "0.498702", "0.49778405", "0.4963387", "0.49443674", "0.49431944", "0.4933908", "0.49281648", "0.49148846", "0.49119425", "0.49119425", "0.49119425", "0.49006933", "0.48916525", "0.48887312", "0.48871934", "0.48832458", "0.48796558", "0.48733956", "0.48602602", "0.4855534", "0.4849915", "0.4848352", "0.48426887", "0.4840869", "0.4839163", "0.4826285", "0.48211175", "0.4819324", "0.4805951", "0.4802334", "0.48022875", "0.4800682", "0.47854316", "0.47745237", "0.47624606", "0.47539344" ]
0.72165704
0
Checks the db and db.additional settings
private void checkDataBase() { final Config dbConfig = config.getConfig("db"); checkArgument(!isNullOrEmpty(dbConfig.getString("driver")), "db.driver is not set!"); checkArgument(!isNullOrEmpty(dbConfig.getString("url")), "db.url is not set!"); dbConfig.getString("user"); dbConfig.getString("password"); dbConfig.getObject("additional"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic boolean checkdbconfig() {\n\t\t// get path\n\t\tString path = context.getRealPath(\"/\");\n\t\tString dbpath = path + Utility.DB_PATH;\n\t\tString dbconfig = \"\";\n\t\tFileInputStream fileInputStreamSystemSettings = null;\n\t\tProperties prop = new Properties();\n\t\ttry {\n\t\t\tfileInputStreamSystemSettings = new FileInputStream(dbpath);\n\t\t\ttry {\n\t\t\t\tprop.load(fileInputStreamSystemSettings);\n\t\t\t\tdbconfig = prop.getProperty(\"jdbc.dbconfig\");\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tfileInputStreamSystemSettings.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\tif (dbconfig.equalsIgnoreCase(\"Y\")) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public void check() {\r\n logger.info(\"ADIT monitor - Checking database and application.\");\r\n\r\n checkApplication();\r\n\r\n checkDBConnection();\r\n checkDBRead(this.getMonitorConfiguration().getTestDocumentId());\r\n }", "private void loadDatabaseSettings() {\r\n\r\n\t\tint dbID = BundleHelper.getIdScenarioResultForSetup();\r\n\t\tthis.getJTextFieldDatabaseID().setText(dbID + \"\");\r\n\t}", "private void checkDatabaseStructure(DatabaseUpdateType update) {\n }", "private boolean dbCheck() {\n SQLiteDatabase db = null;\n try\n {\n String dbPath = DB_PATH + DB_NAME;\n Log.e(\"database\",\"path created \");\n Log.d(\"dbPath\", dbPath);\n db = SQLiteDatabase.openDatabase(dbPath, null, SQLiteDatabase.OPEN_READWRITE);\n Log.e(\"database\",\"open database \");\n db.setLocale(Locale.getDefault());\n Log.e(\"database\",\"set locale \");\n db.setVersion(1);\n Log.e(\"database\",\"version set\");\n }catch (SQLiteException e)\n {\n e.printStackTrace();\n Log.d(\"SQLHelper\", \"couldnt find database\");\n\n }\n if (db !=null)\n {\n db.close();\n }\n return db != null ? true : false;\n }", "private void checkStructure() {\n for (DatabaseUpdateType updateType : DatabaseUpdateType.values()) {\n checkDatabaseStructure(updateType);\n }\n }", "private void checkDB() {\n\t\tif (couchDB_ip == null) {\n\t\t\tsetCouchDB_ip();\n\t\t}\n\n\t\tif (!databaseExist) {\n\n\t\t\tsynchronized (databaseExist) {\n\n\t\t\t\tif (!databaseExist) {\n\n\t\t\t\t\tif (couchDB_USERNAME != null\n\t\t\t\t\t\t\t&& !couchDB_USERNAME.trim().isEmpty()\n\t\t\t\t\t\t\t&& couchDB_PASSWORD != null\n\t\t\t\t\t\t\t&& !couchDB_PASSWORD.trim().isEmpty()) {\n\t\t\t\t\t\tUsernamePasswordCredentials creds = new UsernamePasswordCredentials(\n\t\t\t\t\t\t\t\tcouchDB_USERNAME, couchDB_PASSWORD);\n\t\t\t\t\t\tauthentication = BasicScheme.authenticate(creds,\n\t\t\t\t\t\t\t\t\"US-ASCII\", false).toString();\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (CouchDBUtil.checkDB(getCouchDB_ip(), couchDB_NAME,\n\t\t\t\t\t\t\t\tauthentication)) {\n\n\t\t\t\t\t\t\tdatabaseExist = true;\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tCouchDBUtil.createDb(getCouchDB_ip(), couchDB_NAME,\n\t\t\t\t\t\t\t\t\tauthentication);\n\t\t\t\t\t\t\tdatabaseExist = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (MalformedURLException e) {\n\t\t\t\t\t\tlogger.info(\"Impossible to access CouchDB\", e);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void verify() {\n lblTheDatabaseNameIsEmpty();\n lblDatabaseName();\n lblUserName();\n lblPassword();\n lblDatabaseLocation();\n txtPassword();\n txtUserName();\n txtDatabaseLocation();\n btSettings();\n txtDatabaseName();\n btCancel();\n btOK();\n }", "@Override\n\tpublic boolean isdbConfigured(SystemAdmin sysadmin) {\n\n\t\treadPropertiesfileForDB(sysadmin);\n\t\tdatasource = getDataSource();\n\t\tjdbcTemplate = new JdbcTemplate(datasource);\n\t\tString sql = \"CREATE DATABASE \" + sysadmin.getDatabasename();\n\t\tint result = jdbcTemplate.update(sql);\n\t\tif (result > 0) {\n\t\t\t// read database properties file and set user given database\n\t\t\t// detailes\n\t\t\treadPropertiesfileForcrud(sysadmin);\n\t\t\t// set datasources to connect to database\n\t\t\tdatasource = getDataSource();\n\t\t\tjdbcTemplate = new JdbcTemplate(datasource);\n\t\t\t// read sql file to dump tables into databae\n\t\t\tString path = context.getRealPath(\"/\");\n\t\t\tString SQLPATH = path + Utility.SQL_PATH;\n\t\t\tString s = new String();\n\t\t\tStringBuffer sb = new StringBuffer();\n\n\t\t\ttry {\n\t\t\t\t// read sql file from path\n\t\t\t\tFileReader fr = new FileReader(new File(SQLPATH));\n\n\t\t\t\tBufferedReader br = new BufferedReader(fr);\n\n\t\t\t\twhile ((s = br.readLine()) != null) {\n\t\t\t\t\tsb.append(s);\n\t\t\t\t}\n\t\t\t\tbr.close();\n\n\t\t\t\t// here is our splitter | We use \";\" as a delimiter for each\n\t\t\t\t// request\n\t\t\t\t// then we are sure to have well formed statements\n\t\t\t\tString[] inst = sb.toString().split(\";\");\n\t\t\t\tfor (int i = 0; i < inst.length; i++) {\n\t\t\t\t\t// we ensure that there is no spaces before or after the\n\t\t\t\t\t// request string\n\t\t\t\t\t// in order to not execute empty statements\n\t\t\t\t\tif (!inst[i].trim().equals(\"\")) {\n\t\t\t\t\t\tjdbcTemplate.update(inst[i]);\n\t\t\t\t\t\tlogger.info(\">>\" + inst[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} catch (Exception e) {\n\t\t\t\tlogger.error(\"*** Error : \" + e.toString());\n\t\t\t\tlogger.error(\" *** \");\n\t\t\t\tlogger.error(\" *** Error : \");\n\t\t\t\tlogger.error(\"################################################\");\n\t\t\t\tlogger.error(sb.toString());\n\t\t\t}\n\n\t\t\treturn true;\n\n\t\t} else {\n\n\t\t\treturn false;\n\t\t}\n\t}", "boolean getValidSettings();", "private boolean checkDatabase(CommandPreferences preferences) {\n\n //checking class type of Preferences\n Logger.log(LogType.DEBUG, \"Class name of Preferences: \" + preferences.getClass().getName());\n prefClass = preferences.getClass();\n\n\n Logger.log(LogType.INFO, \"Checking Database connection...\");\n try (Connection connection = DriverManager.getConnection(purl, puser, ppassword)) {\n Logger.log(LogType.INFO, \"Database connected!\");\n isInit = true;\n con = connection;\n\n url = purl;\n user = puser;\n password = ppassword;\n\n } catch (SQLException e) {\n Logger.log(LogType.ERROR, \"Could not connect to Databse! \" + e);\n return false;\n }\n Logger.log(LogType.INFO, \"Database connection established.\");\n Logger.log(LogType.INFO, \"Checking Database setup: Tables...\");\n\n if (!checkTableExists(tablename)) return false;\n Logger.log(LogType.INFO, \"Checking Database setup: Columns...\");\n Logger.log(LogType.DEBUG, preferences.getClass().getFields().length + \"\");\n for (Field f : preferences.getClass().getFields()) {\n Logger.log(LogType.DEBUG, \"Field[\" + f.getName() + \"] \" + f.getType());\n if (!checkColumnExists(f.getName(), f)) return false;\n }\n Logger.log(LogType.INFO, \"Database check complete! starting...\");\n prefStructure = preferences;\n return true;\n }", "boolean hasSettings();", "boolean hasSettings();", "boolean hasDatabase();", "private void getSavedDBValues() {\r\n boolean isSet[] = new boolean[12];\r\n for (int i = 0; i < 12; i++)\r\n isSet[i] = false;\r\n\r\n if (this.pl_DB.getParam(\"Hostname\") != null) {\r\n this.hostnameString = this.pl_DB.getParam(\"Hostname\");\r\n isSet[0] = true;\r\n } else\r\n this.hostnameString = hostnameString_default;\r\n if (this.pl_DB.getParam(\"Port\") != null) {\r\n try {\r\n this.portNr = Integer.parseInt(this.pl_DB.getParam(\"Port\"));\r\n } catch (NumberFormatException e) {\r\n this.portNr = portNr_default;\r\n }\r\n isSet[1] = true;\r\n } else\r\n this.portNr = portNr_default;\r\n if (this.pl_DB.getParam(\"Database\") != null) {\r\n this.databaseString = this.pl_DB.getParam(\"Database\");\r\n isSet[2] = true;\r\n } else\r\n this.databaseString = databaseString_default;\r\n if (this.pl_DB.getParam(\"Username\") != null) {\r\n this.usernameString = this.pl_DB.getParam(\"Username\");\r\n isSet[3] = true;\r\n } else\r\n this.usernameString = rusernameString_default;\r\n if (this.pl_DB.getParam(\"Password\") != null) {\r\n this.passwdString = this.pl_DB.getParam(\"Password\");\r\n } else\r\n this.passwdString = \"\";\r\n if (this.pl_DB.getParam(\"nodeTableName\") != null) {\r\n this.NodeTableString = this.pl_DB.getParam(\"nodeTableName\");\r\n isSet[4] = true;\r\n } else\r\n this.NodeTableString = nodeList_DBtable_default;\r\n if (this.pl_DB.getParam(\"nodeColIDName\") != null) {\r\n this.NodeIDColString = this.pl_DB.getParam(\"nodeColIDName\");\r\n isSet[5] = true;\r\n } else\r\n this.NodeIDColString = node_ids_DBcol_default;\r\n if (this.pl_DB.getParam(\"nodeColLabelName\") != null) {\r\n this.NodeLabelColString = this.pl_DB.getParam(\"nodeColLabelName\");\r\n isSet[6] = true;\r\n } else\r\n this.NodeLabelColString = node_labels_DBcol_default;\r\n if (this.pl_DB.getParam(\"edgeTableName\") != null) {\r\n this.EdgeTableString = this.pl_DB.getParam(\"edgeTableName\");\r\n isSet[7] = true;\r\n } else\r\n this.EdgeTableString = edgeList_DBtable_default;\r\n if (this.pl_DB.getParam(\"edgeCol1Name\") != null) {\r\n this.EdgeCo1String = this.pl_DB.getParam(\"edgeCol1Name\");\r\n isSet[8] = true;\r\n } else\r\n this.EdgeCo1String = edgeList_DBcol1_default;\r\n if (this.pl_DB.getParam(\"edgeCol2Name\") != null) {\r\n this.EdgeCol2String = this.pl_DB.getParam(\"edgeCol2Name\");\r\n isSet[9] = true;\r\n } else\r\n this.EdgeCol2String = edgeList_DBcol2_default;\r\n if (this.pl_DB.getParam(\"edgeColWeightName\") != null) {\r\n this.EdgeWeightColString = this.pl_DB.getParam(\"edgeColWeightName\");\r\n isSet[10] = true;\r\n } else\r\n this.EdgeWeightColString = edgeList_DBcolweight_default;\r\n if (this.pl_DB.getParam(\"resultTableName\") != null) {\r\n this.resultTableString = this.pl_DB.getParam(\"resultTableName\");\r\n isSet[11] = true;\r\n } else\r\n this.resultTableString = result_DBtable_default;\r\n\r\n for (int i = 0; i < 12; i++) {\r\n if (isSet[i])\r\n this.isDBValuesSet = true;\r\n else {\r\n this.isDBValuesSet = false;\r\n break;\r\n }\r\n }\r\n\r\n this.is_alg_started = false;\r\n this.is_already_read_from_DB = false;\r\n this.is_already_renumbered = false;\r\n }", "private void checkSave() {\n if (config.needsSave() || motes.needsSave()) {\n System.out.println(\"need save\");\n int save = JOptionPane.showConfirmDialog(frame, \"Do you want to save this configuration?\", \"Save Configuration\", JOptionPane.YES_NO_OPTION);\n if (save == JOptionPane.YES_OPTION) {\n saveConfiguration(DEFAULT_DB_CONFIG_TABLE);\n }\n }\n }", "public boolean checkDb() {\n\t\t\n\t\tint userId = Auth.getCurrentUser().getId();\n\t\tString sql = \"select id from PersonalDetails where id='\"+userId+\"'\";\n\t\tint gotId;\n\t\t//connectToDb();\n\t\t\n\t\ttry(Connection conn = myDb;\n\t\t\tStatement stmt = conn.createStatement();\n\t\t\tResultSet rs = stmt.executeQuery(sql)){\n\t\t\tgotId = rs.getInt(\"id\");\n\t\t}catch(SQLException e){\n\t\t\t\n\t\t\tmyDb = null;\n\t\t\t\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif(gotId == userId) {\n\t\t\treturn true;\n\t\t}else {\n\t\t\t//return false;\n\t\t\treturn false;\n\t\t}\n\n\t}", "private void checkAdminInDB(DB db) {\n\t\tMap<Long, UtenteBase> users = db.getTreeMap(\"users\");\n\t\tlong hashCode = (long) \"admin\".hashCode();\n\t\tif(!users.containsKey(hashCode))\n\t\t\tusers.put(hashCode, new Admin(\"admin\", \"admin\"));\n\t}", "private boolean checkDataBase() {\n// boolean checkDB = false;\n File dbfile = null;\n try {\n String myPath = DBLOCATION + DBNAME;\n dbfile = new File(myPath);\n// checkDB = dbfile.exists();\n } catch (SQLiteException e) {\n }\n// return checkDB;\n return dbfile.exists();\n }", "default boolean checkDbObj(Object object) {\n return false;\n }", "private void ini_SelectDB()\r\n\t{\r\n\r\n\t}", "public abstract boolean isDatabaseSet();", "public boolean checkDataBase() {\n SQLiteDatabase sQLiteDatabase;\n try {\n SQLiteDatabase sQLiteDatabase2;\n sQLiteDatabase = sQLiteDatabase2 = SQLiteDatabase.openDatabase((String)(DB_PATH + DB_NAME), (SQLiteDatabase.CursorFactory)null, (int)0);\n }\n catch (SQLiteException var1_4) {\n return false;\n }\n if (sQLiteDatabase != null) {\n sQLiteDatabase.close();\n }\n boolean bl = false;\n if (sQLiteDatabase == null) return bl;\n return true;\n }", "public boolean initializeDatabase() {\n try {\n initializeCategory();\n initializeExpense();\n initializeIncome();\n initializeBalance();\n initializeUser();\n } catch (Throwable t) {\n\n System.out.println(t.getMessage());\n return false;\n }\n return true;\n }", "private void checkRequiredUserStoreConfigurations() throws UserStoreException {\n\n log.debug(\"Checking LDAP configurations \");\n String connectionURL = userStoreProperties.get(LDAPConstants.CONNECTION_URL);\n\n if (connectionURL == null || connectionURL.trim().length() == 0) {\n throw new UserStoreException(\n \"Required ConnectionURL property is not set at the LDAP configurations\");\n }\n String connectionName = userStoreProperties.get(LDAPConstants.CONNECTION_NAME);\n if (connectionName == null || connectionName.trim().length() == 0) {\n throw new UserStoreException(\n \"Required ConnectionNme property is not set at the LDAP configurations\");\n }\n String connectionPassword =\n userStoreProperties.get(LDAPConstants.CONNECTION_PASSWORD);\n if (connectionPassword == null || connectionPassword.trim().length() == 0) {\n throw new UserStoreException(\n \"Required ConnectionPassword property is not set at the LDAP configurations\");\n }\n String userSearchBase = userStoreProperties.get(LDAPConstants.USER_SEARCH_BASE);\n if (userSearchBase == null || userSearchBase.trim().length() == 0) {\n throw new UserStoreException(\n \"Required UserSearchBase property is not set at the LDAP configurations\");\n }\n String usernameListFilter =\n userStoreProperties.get(LDAPConstants.USER_NAME_LIST_FILTER);\n if (usernameListFilter == null || usernameListFilter.trim().length() == 0) {\n throw new UserStoreException(\n \"Required UserNameListFilter property is not set at the LDAP configurations\");\n }\n\n String usernameSearchFilter =\n userStoreProperties.get(LDAPConstants.USER_NAME_SEARCH_FILTER);\n if (usernameSearchFilter == null || usernameSearchFilter.trim().length() == 0) {\n throw new UserStoreException(\n \"Required UserNameSearchFilter property is not set at the LDAP configurations\");\n }\n\n String usernameAttribute =\n userStoreProperties.get(LDAPConstants.USER_NAME_ATTRIBUTE);\n if (usernameAttribute == null || usernameAttribute.trim().length() == 0) {\n throw new UserStoreException(\n \"Required UserNameAttribute property is not set at the LDAP configurations\");\n }\n String groupSearchBase = userStoreProperties.get(LDAPConstants.GROUP_SEARCH_BASE);\n if (groupSearchBase == null || groupSearchBase.trim().length() == 0) {\n throw new UserStoreException(\n \"Required GroupSearchBase property is not set at the LDAP configurations\");\n }\n String groupNameListFilter =\n userStoreProperties.get(LDAPConstants.GROUP_NAME_LIST_FILTER);\n if (groupNameListFilter == null || groupNameListFilter.trim().length() == 0) {\n throw new UserStoreException(\n \"Required GroupNameListFilter property is not set at the LDAP configurations\");\n }\n\n String groupNameAttribute =\n userStoreProperties.get(LDAPConstants.GROUP_NAME_ATTRIBUTE);\n if (groupNameAttribute == null || groupNameAttribute.trim().length() == 0) {\n throw new UserStoreException(\n \"Required GroupNameAttribute property is not set at the LDAP configurations\");\n }\n String memebershipAttribute =\n userStoreProperties.get(LDAPConstants.MEMBERSHIP_ATTRIBUTE);\n if (memebershipAttribute == null || memebershipAttribute.trim().length() == 0) {\n throw new UserStoreException(\n \"Required MembershipAttribute property is not set at the LDAP configurations\");\n }\n\n }", "private static boolean isFeatureConfigurationWrong(boolean isEnabledInDb, boolean isEnabledAccordingToAwcom) {\n\treturn (isEnabledInDb && !isEnabledAccordingToAwcom);\n }", "private boolean inDatabase() {\r\n \t\treturn inDatabase(0, null);\r\n \t}", "private boolean checkDataBase() {\n\n\t\tFile dbFile = null;\n\t\ttry {\n\t\t\t// String myPath = DATABASE_PATH + DATABASE_NAME;\n\t\t\t// checkDB = SQLiteDatabase.openDatabase(myPath, null,\n\t\t\t// SQLiteDatabase.OPEN_READONLY);\n\t\t\tdbFile = new File(DATABASE_PATH + DATABASE_NAME);\n\t\t\treturn dbFile.exists();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t/*if(checkDB != null){\n\t\t checkDB.close();}\n\t\t return checkDB != null ? true : false;*/\n\t\treturn dbFile != null ? true : false;\n\t}", "private boolean checkDataBase() {\n SQLiteDatabase checkDb = null;\n try {\n String path = DB_PATH + DB_NAME;\n checkDb = SQLiteDatabase.openDatabase(path, null,\n SQLiteDatabase.OPEN_READONLY);\n } catch (SQLException e) {\n Log.e(this.getClass().toString(), \"Error while checking db\");\n }\n //Android doesn’t like resource leaks, everything should \n // be closed\n if (checkDb != null) {\n checkDb.close();\n }\n return checkDb != null;\n }", "public boolean isDBValid(){\r\n return noInduk != null && !noInduk.isEmpty();\r\n }", "private void checkConfig() {\n\t\t\n\t\tif (config.getDouble(\"configversion\", 0.0) - configVersion > .001) {\n\t\t\tString name = config.getString(QuestConfigurationField.NAME.getKey(), \"NO NAME\");\n\t\t\tQuestManagerPlugin.questManagerPlugin.getLogger().warning(\"The quest [\" + name + \"] has an invalid version!\\n\"\n\t\t\t\t\t+ \"QuestManager Configuration Version: \" + configVersion + \" doesn't match quest's: \" \n\t\t\t\t\t+ config.getDouble(\"configversion\", 0.0));\n\t\t\t\n\t\t}\n\t\t\n\t\t//Check each field and put in defaults if they aren't there (niave approach)\n\t\tfor (QuestConfigurationField field : QuestConfigurationField.values()) {\n\t\t\tif (!config.contains(field.getKey())) {\n\t\t\t\tQuestManagerPlugin.questManagerPlugin.getLogger().warning(\"[\" + getName() + \"] \"\n\t\t\t\t\t\t+ \"Failed to find field information: \" + field.name());\n\t\t\t\tQuestManagerPlugin.questManagerPlugin.getLogger().info(\"Adding default value...\");\n\t\t\t\tconfig.set(field.getKey(), field.getDefault());\n\t\t\t}\n\t\t}\n\t}", "private boolean isDeviceProvisionedInSettingsDb() {\n return Settings.Global.getInt(this.mContext.getContentResolver(), \"device_provisioned\", 0) != 0;\n }", "private boolean checkDataBase() {\n SQLiteDatabase tempDB = null;\n try {\n String myPath = DB_PATH + DB_NAME;\n tempDB = SQLiteDatabase.openDatabase(myPath, null,\n SQLiteDatabase.OPEN_READWRITE);\n } catch (SQLiteException e) {\n Log.e(\"tle99 - check\", e.getMessage());\n }\n if (tempDB != null)\n tempDB.close();\n return tempDB != null ? true : false;\n }", "private boolean checkDataBase() {\r\n SQLiteDatabase checkDB = null;\r\n try {\r\n checkDB = SQLiteDatabase.openDatabase(\"/data/data/me.shubhamgoswami.adharshilasurvey/adharShila.db\", null,\r\n SQLiteDatabase.OPEN_READONLY);\r\n checkDB.close();\r\n } catch (SQLiteException e) {\r\n // database doesn't exist yet.\r\n }\r\n return checkDB != null;\r\n }", "boolean isDbInitialized() {return dbInitialized;}", "public boolean loadDatabaseSettingsForReceivers(){ \n log.debug(\"trying to load database connection settings for receivers from property file\");\n String databaseConnectionSettings = \"/databaseConnectionSettings.properties\"; \n java.io.InputStream sis = this.getClass().getResourceAsStream(databaseConnectionSettings); \n\n if ( sis == null ) { \n log.debug(databaseConnectionSettings+\" file does not exist\"); \n System.out.println(databaseConnectionSettings+\" file does not exist\");\n // Doesn't exist \n return false; \n }\n\n // Load props \n java.util.Properties sourceProp = new java.util.Properties(); \n \n try{ \n sourceProp.load(sis);\n if ( sourceProp != null ){ \n log.debug(\"Setting default database connection settings for receivers from property file\");\n rDatabaseType =sourceProp.getProperty(\"rDatabaseType\").trim();\n rDatabaseServerName =sourceProp.getProperty(\"rDatabaseServerName\").trim();\n rDBPort =sourceProp.getProperty(\"rDBPort\").trim();\n rUserName =sourceProp.getProperty(\"rUserName\").trim();\n rPassword =sourceProp.getProperty(\"rPassword\").trim();\n rTnsNameOrDBName =sourceProp.getProperty(\"rTnsNameOrDBName\").trim();\n rTableName =sourceProp.getProperty(\"rTableName\").trim();\n rColumnName =sourceProp.getProperty(\"rColumnName\").trim();\n rQuery =sourceProp.getProperty(\"rQuery\").trim();\n\n log.debug(\"Database Type : \" +rDatabaseType); \n log.debug(\"Database Server Name / IP : \" +rDatabaseServerName);\n log.debug(\"Database Server Connection Port : \" +rDBPort);\n log.debug(\"Database User Name : \"+rUserName);\n log.debug(\"Database Password : \" +rPassword);\n log.debug(\"Database Name / TNS Name : \" +rTnsNameOrDBName);\n log.debug(\"Table Name : \" +rTableName);\n log.debug(\"Column Name : \" +rColumnName);\n log.debug(\"SQL Query to run : \"+rQuery);\n \n return true;\n \t}else{\n log.debug(databaseConnectionSettings+\" file does not exist\");\n System.out.println(databaseConnectionSettings+\" file does not exist\");\n javax.swing.JOptionPane.showMessageDialog(null,databaseConnectionSettings+\" file does not exist\");\n \t return false;\n \t}\n \n }catch(Exception e){ \n log.debug(databaseConnectionSettings+\" file does not exist or missing parameters in file\");\n System.out.println(databaseConnectionSettings+\" file does not exist or missing parameters in file\");\n javax.swing.JOptionPane.showMessageDialog(null,databaseConnectionSettings+\" file does not exist or missing parameters in file\");\n return false; \n } \n }", "public boolean checkDbStructure(){\n\t\tboolean isStructureOk = false;\n\t\t\n\t\ttry {\n\t\t\tmMysqlConnection = DriverManager\n\t\t\t\t.getConnection(getConnectionURI());\n\t\t\t\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select ID, Name, Description, Version from \" + mDbName + \".\" + TABLE_AREA);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\t\t\t\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select Area_ID, Route_ID from \" + mDbName + \".\" + TABLE_AREA_HAS_ROUTES);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\t\t\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select ID, Ticket_ID, Name, StartName, EndName from \" + mDbName + \".\" + TABLE_ROUTE);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\t\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select Route_ID, Station_ID, Position from \" + mDbName + \".\" + TABLE_ROUTE_HAS_STATIONS);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select ID, Name, Abbreviation, Latitude, Longitude from \" + mDbName + \".\" + TABLE_STATION);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select ID, Name, Icon, Is_Superior from \" + mDbName + \".\" + TABLE_TICKET);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\t\t\t\n\t\t\tisStructureOk = true;\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\tLOGGER.severe(\"!EXCEPTION: \" + e.getMessage());\n\t\t\tisStructureOk = false;\n\t\t}\n\t\t\n\t\treturn isStructureOk;\n\t}", "private boolean checkDatabase() {\n SQLiteDatabase checkDB = null;\n\n try {\n String dbPath = DB_PATH + DB_NAME;\n checkDB = SQLiteDatabase.openDatabase(\n dbPath, \n null,\n SQLiteDatabase.NO_LOCALIZED_COLLATORS // Open without support for localized collators. setLocate() will do nothing.\n );\n } catch (SQLiteException e) {\n // Do nothing - database doesn't exist yet\n }\n\n if (checkDB != null) {\n checkDB.close();\n }\n\n return checkDB != null ? true : false;\n }", "protected boolean checkCompatibility() {\n IDatabaseAdapter adapter = getDbAdapter(dbType, connectionPool);\n try (ITransaction tx = TransactionFactory.openTransaction(connectionPool)) {\n return adapter.checkCompatibility(this.adminSchemaName);\n }\n }", "private void checkRequiredFields() {\n // check the fields which should be non-null\n if (configFileName == null || configFileName.trim().length() == 0) {\n throw new DAOConfigurationException(\n \"The 'configFileName' should not be null.\");\n }\n if (configNamespace == null || configNamespace.trim().length() == 0) {\n throw new DAOConfigurationException(\n \"The 'configNamespace' should not be null.\");\n }\n if (searchBundleManagerNamespace == null\n || searchBundleManagerNamespace.trim().length() == 0) {\n throw new DAOConfigurationException(\n \"The 'searchBundleManagerNamespace' should not be null.\");\n }\n if (entityManager == null) {\n throw new DAOConfigurationException(\n \"The 'entityManager' should not be null.\");\n }\n }", "public String[] getTestSettings(String database, IDataAccessObject dataAccessObject) throws TotalADSDBMSException;", "boolean hasDatastoreOptions();", "private boolean checkFields() {\n\t\tboolean status = true;\n\n\t\treturn status;\n\t}", "private boolean checkDataBase()\r\n {\r\n SQLiteDatabase checkDB = null;\r\n try {\r\n String myPath = DB_PATH;\r\n checkDB\r\n = SQLiteDatabase\r\n .openDatabase(\r\n myPath, null,\r\n SQLiteDatabase.OPEN_READONLY);\r\n }\r\n catch (SQLiteException e) {\r\n\r\n // database doesn't exist yet.\r\n Log.e(\"message\", \"\" + e);\r\n }\r\n if (checkDB != null) {\r\n checkDB.close();\r\n }\r\n return checkDB != null;\r\n }", "public boolean hasDatabase() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }", "public boolean isSetDb()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().count_elements(DB$2) != 0;\r\n }\r\n }", "public boolean checkDataBase(){\n \n \tSQLiteDatabase checkDB = null;\n \tLog.d(\"We're Here\", \"DatabaseHelper.checkDataBase()\");\n \ttry{\n \t\tString myPath = DB_PATH + DB_NAME;\n \t\tcheckDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);\n \n \t}catch(SQLiteException e){\n \n \t\tLog.d(\"We're Here\", \"Database doesn't exist\");\n \t\tLog.d(\"Database Error\", e.toString());\n \n \t}\n \tcatch (Exception e) { \n \t\tLog.d(\"Exception in checkDatabase\", e.toString());\n \t\t\n \t}\n \n \tif(checkDB != null){\n \n \t\tcheckDB.close();\n \n \t}\n \n \treturn checkDB != null;\n }", "@Override\r\n protected boolean validateSystemSettings() {\n return true;\r\n }", "private boolean checkDataBase() {\n\n SQLiteDatabase checkDB = null;\n\n try {\n String myPath = DB_PATH + DATABASE_NAME;\n checkDB = SQLiteDatabase.openDatabase(myPath, null,\n SQLiteDatabase.OPEN_READONLY);\n\n } catch (SQLiteException e) {\n\n // database doesn't exist yet.\n Log.d(\"DATABASE\",\"Database doesn't exist yet.\");\n }\n\n if (checkDB != null) {\n checkDB.close();\n }\n return checkDB != null;\n }", "protected boolean check(CrawlDatum datum) {\n if (datum.getStatus() != expectedDbStatus)\n return false;\n return true;\n }", "public boolean hasDatabase() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }", "private boolean checkFields() {\n if (editTxtName.getText().equals(\"\")) return false;//name\n if (editTxtDesc.getText().equals(\"\")) return false;//desc\n if (editClrColor.getValue() == null) return false;//color\n if (oldEnvironment == null) return false;//environment is null\n return true;//everything is valid\n }", "public boolean isSetDatabase() {\r\n return this.database != null;\r\n }", "public boolean isSetDatabase() {\r\n return this.database != null;\r\n }", "public boolean isSetDatabase() {\r\n return this.database != null;\r\n }", "public boolean isSetDatabase() {\r\n return this.database != null;\r\n }", "public boolean isSetDatabase() {\r\n return this.database != null;\r\n }", "protected void checkConfiguration() {\n \tsuper.checkConfiguration();\n \t\n if (this.customizations == null) {\n this.customizations = new ArrayList<String>();\n }\n if (this.options == null) {\n this.options = new HashMap<String, String>();\n }\n if (this.sourceDirectories == null) {\n \tthis.sourceDirectories = new ArrayList<String>();\n \tthis.sourceDirectories.add(DEFAULT_SOURCE_DIRECTORY);\n }\n }", "public boolean isDbToUpdate() {\n\t\treturn !(this.properties.getProperty(SoundLooperProperties.KEY_DB_TO_UPDATE, \"0\").equals(\"0\"));\n\t}", "public boolean initializeDB() {\n return false;\n }", "private ServerError updateDatabase() {\n return updateDatabase(WebConf.DB_CONN, WebConf.JSON_OBJECTS, WebConf.DEFAULT_VERSION);\r\n }", "boolean hasDatabaseSpec();", "private void saveDBValues() {\r\n this.pl_DB.setParam(\"Hostname\", this.rhostfield.getText());\r\n this.pl_DB.setParam(\"Port\", this.rportfield.getText());\r\n this.pl_DB.setParam(\"Username\", this.ruserfield.getText());\r\n\r\n String pw = \"\";\r\n for (int i = 0; i < this.rpasswdfield.getPassword().length; i++) {\r\n pw += this.rpasswdfield.getPassword()[i];\r\n }\r\n this.pl_DB.setParam(\"Password\", pw);\r\n this.pl_DB.setParam(\"Database\", this.rdatabasefield.getText());\r\n this.pl_DB.setParam(\"nodeTableName\", this.rtablename1efield.getText());\r\n this.pl_DB.setParam(\"nodeColIDName\", this.colnodeIdfield.getText());\r\n this.pl_DB.setParam(\"nodeColLabelName\", this.colnodeLabelfield.getText());\r\n this.pl_DB.setParam(\"edgeTableName\", this.rtablename2efield.getText());\r\n this.pl_DB.setParam(\"edgeCol1Name\", this.coledge1field.getText());\r\n this.pl_DB.setParam(\"edgeCol2Name\", this.coledge2field.getText());\r\n this.pl_DB.setParam(\"edgeColWeightName\", this.colweightfield.getText());\r\n this.pl_DB.setParam(\"resultTableName\", this.otablenamefield.getText());\r\n\r\n this.is_alg_started = false;\r\n this.is_already_read_from_DB = false;\r\n this.is_already_renumbered = false;\r\n }", "@Override\n\tprotected boolean checkDataStructure(Data data) throws ImportitException {\n\t\tdata.setDatabase(39);\n\t\tdata.setGroup(3);\n\t\tboolean validDb = checkDatabaseName(data);\n\t\tboolean validHead = false;\n\t\tboolean validTable = false;\n\t\tboolean existImportantFields = false;\n\t\tif (validDb) {\n\t\t\tList<Field> headerFields = data.getHeaderFields();\n\t\t\tList<Field> tableFields = data.getTableFields();\n\t\t\tvalidHead = false;\n\t\t\tvalidTable = false;\n\t\t\ttry {\n\n\t\t\t\tvalidHead = checkWarehouseGroupProperties(headerFields, data.getOptionCode().useEnglishVariables());\n\t\t\t\tvalidTable = checkFieldList(tableFields, 39, 3, false, data.getOptionCode().useEnglishVariables());\n\t\t\t\tString[] checkDataCustomerPartProperties = checkDataWarehouseGroupProperties(data);\n\t\t\t\texistImportantFields = checkDataCustomerPartProperties.length == 2;\n\n\t\t\t} catch (ImportitException e) {\n\t\t\t\tlogger.error(e);\n\t\t\t\tdata.appendError(Util.getMessage(\"err.structure.check\", e.getMessage()));\n\t\t\t}\n\t\t}\n\t\tif (validTable && validHead && validDb & existImportantFields) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public static boolean hasCustomDockerDB( final BioModule module ) {\n\t\ttry {\n\t\t\tLog.info( DockerUtil.class, Constants.LOG_SPACER );\n\t\t\tLog.info( DockerUtil.class, \"Check for Custom Docker DB\" );\n\t\t\tLog.info( DockerUtil.class, Constants.LOG_SPACER );\n\t\t\tif( inDockerEnv() ) \n\t\t\t\tLog.info( DockerUtil.class, \"Verified BLJ is running INSIDE the Docker biolockj_controller Container\" );\n\t\t\telse {\n\t\t\t\tLog.info( DockerUtil.class, \"LOOKS LIKE BLJ is <<< NOT >>> running INSIDE the Docker biolockj_controller Container - run extra tests!\" );\n\t\t\t\tfinal File testFile = new File( \"/.dockerenv\" );\n\t\t\t\tif( testFile.isFile() )\n\t\t\t\t\tLog.info( DockerUtil.class, \"testFile.isFile() == TRUE! --> WHY FAIL ON INIT ATTEMPT? BLJ is running INSIDE the Docker biolockj_controller Container\" );\n\t\t\t\telse if( testFile.exists() )\n\t\t\t\t\tLog.info( DockerUtil.class, \"testFile.exists() == TRUE! --> WHY FAIL ON INIT ATTEMPT? BLJ is running INSIDE the Docker biolockj_controller Container\" );\n\t\t\t}\n\t\t\t\n\t\t\tif( module instanceof DatabaseModule )\n\t\t\t\tLog.info( DockerUtil.class, module.getClass().getSimpleName() + \" is a DB Module!\" );\n\t\t\telse\n\t\t\t\tLog.info( DockerUtil.class, module.getClass().getSimpleName() + \" is NOT DB Module!\" );\n\t\t\t\n\t\t\tLog.info( DockerUtil.class, Constants.LOG_SPACER );\n\t\t\t\t\n\t\t\tif( inDockerEnv() && module instanceof DatabaseModule ) {\n\t\t\t\tfinal File db = ( (DatabaseModule) module ).getDB();\n\t\t\t\tif( db == null ) Log.info( DockerUtil.class, module.getClass().getSimpleName() + \" db ==> NULL \" );\n\t\t\t\tif( db != null ) Log.info( DockerUtil.class, module.getClass().getSimpleName() + \" db ==> \" + db.getAbsolutePath() );\n\t\t\t\tif( db != null ) return !db.getAbsolutePath().startsWith( DOCKER_DEFAULT_DB_DIR );\n\t\t\t}\n\t\t} catch( ConfigPathException | ConfigNotFoundException | DockerVolCreationException ex ) {\n\t\t\tLog.error( DockerUtil.class,\n\t\t\t\t\"Error occurred checking database path of module: \" + module.getClass().getName(), ex );\n\t\t} \n\t\treturn false;\n\t}", "private void ini_CacheDB()\r\n\t{\r\n\t\tLogger.DEBUG(\"ini_CacheDB\");\r\n\t\t// chk if exist filter preset splitter \"#\" and Replace\r\n\r\n\t}", "private boolean checkDataBase(){\n\n SQLiteDatabase checkDB = null;\n\n try{\n String myPath = DB_PATH + DB_NAME;\n checkDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);\n\n }catch(SQLiteException e){\n\n //database does't exist yet.\n\n }\n\n if(checkDB != null){\n\n checkDB.close();\n\n }\n\n return checkDB != null ? true : false;\n }", "private boolean checkDataBase(){\n\n SQLiteDatabase checkDB = null;\n\n try{\n String myPath = DB_PATH + DB_NAME;\n checkDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);\n\n }catch(SQLiteException e){\n\n //database does't exist yet.\n\n }\n\n if(checkDB != null){\n\n checkDB.close();\n\n }\n\n return checkDB != null ? true : false;\n }", "private boolean validateObjectForDB() {\n\t\tboolean l_ret = true;\n\t\tif (m_country_name.equals(\"\")) {\n\t\t\tm_error_string = \"Unable to add the country. Country name is required.\";\n\t\t\tl_ret = false;\n\t\t}\n\t\treturn (l_ret);\n\t}", "private void loadSettings() throws NumberFormatException, SQLException {\n\t\tmaximumRequests = Integer.parseInt(getSetting(\"maximum_requests\"));\n\t\trequestCount = Integer.parseInt(getSetting(\"requests\"));\n\t}", "void checkTapDbVersion() throws ConfigurationException;", "@Override\r\n\tpublic boolean CheckConditions() {\n\t\treturn true;\r\n\t}", "public boolean checkIfThisGAZRecordIsInTheDB()\n\t{\n\t\treturn checkIfThisRecordIsInTheDB(getWhereConditionBaseOnIdRecord());\n\t}", "public boolean checkIfDatabaseExists() {\r\n return database.exists();\r\n }", "public void postLoadProperties(){\n\ttry{\n\t \n\t switch (source){\n\t case \"heroku\":\n\t\tURL = new String(\"jdbc:postgresql://\" + host + \":\" + port + \"/\" + dbname + \"?sslmode=require&user=\" + user + \"&password=\" +password );\n\t\tbreak;\n\t case \"local\":\n\t\tURL = new String(\"jdbc:postgresql://\" + host + \"/\" + dbname);\n\t break;\n\t case \"elephantsql\":\n\t\n\t \tURL = new String(\"jdbc:postgresql://\" + host + \":\" + port + \"/\" + dbname + \"?user=\" + user + \"&password=\" +password + \"&SSL=true\" );\n\t\tbreak;\n\t}\n\t //\t LOGGER.info(\"URL: \" + URL);\n\n\tdbm = new DatabaseManager( this );\n\tif(authenticated){\n\t dbr = dbm.getDatabaseRetriever();\n\t dbi = dbm.getDatabaseInserter();\n\t dmf = new DialogMainFrame(this);\n\t}else{\n\t \tJOptionPane.showMessageDialog(null,\n\t\t\t \"Invalid username or password. Session terminated.\",\n\t\t\t\t \"Authentication Failure!\",\n\t\t\t JOptionPane.ERROR_MESSAGE);\n\t}\n\t}\n catch(SQLException sqle){\n\tLOGGER.info(\"SQL exception creating DatabaseManager: \" + sqle);\n }\n\t\n }", "boolean hasGlobalSettingsPanel();", "protected abstract boolean isMigrationNecessary();", "@Override\r\n\tpublic boolean findDbSetting(String bookName) throws Exception {\n\t\tboolean result;\r\n\t\tresult = dbSettingMapper.findDbSetting(bookName);\r\n\t\t\r\n\t\treturn result;\r\n\t}", "private DatabaseValidationProperties() {}", "private boolean shouldExecuteDbFirst() throws ServiceException {\n DbSearchConstraints.Leaf top = getTopLeafConstraint();\n if (top.convId > 0 || !top.itemIds.isEmpty()) {\n return true;\n }\n\n if (luceneOp != null && luceneOp.shouldExecuteDbFirst()) {\n return true;\n }\n\n return constraints.tryDbFirst(context.getMailbox());\n }", "boolean isSetCompanyBaseData();", "public boolean checkIfThisHBRecordIsInTheDB()\n\t{\n\t\treturn checkIfThisRecordIsInTheDB(getWhereConditionBaseOnIdRecord());\n\t}", "void checkAdmin() throws HsqlException {\n Trace.check(isAdmin(), Trace.ACCESS_IS_DENIED);\n }", "private void configureDB() {\n\t\tmDb = mDbHelper.getWritableDatabase();\n\t}", "private DatabaseCustomAccess(Context context) {\n\t\thelper = new SpokaneValleyDatabaseHelper(context);\n\n\t\tsaveInitialPoolLocation(); // save initial pools into database\n\t\tsaveInitialTotalScore(); // create total score in database\n\t\tsaveInitialGameLocation(); // create game location for GPS checking\n\t\tLoadingDatabaseTotalScore();\n\t\tLoadingDatabaseScores();\n\t\tLoadingDatabaseGameLocation();\n\t}", "public void verifyConfig() {\r\n if (getSpecialHandlingManager() == null)\r\n throw new ConfigurationException(\"The required property 'specialHandlingManager' is missing.\");\r\n }", "protected void checkIfConfigurationModificationIsAllowed() {\r\n\t\tif (isCompiled()) {\r\n\t\t\tthrow new InvalidDataAccessApiUsageException(\"Configuration can't be altered once the class has been compiled or used.\");\r\n\t\t}\r\n\t}", "private boolean Integritycheck() {\n String mail = Objects.requireNonNull(email.getEditText()).getText().toString();\n String password = Objects.requireNonNull(password1.getEditText()).getText().toString();\n String passwordAgain = Objects.requireNonNull(password2.getEditText()).getText().toString();\n String city = this.city.getText().toString();\n String fname = Objects.requireNonNull(FName.getEditText()).getText().toString();\n String Lname = Objects.requireNonNull(this.LName.getEditText()).getText().toString();\n String phone = Objects.requireNonNull(this.phone.getEditText()).getText().toString();\n\n return mail.length() < 1 || password.length() < 1 || passwordAgain.length() < 1 || city.length() < 1 || fname.length() < 1 || Lname.length() < 1 || phone.length() < 1;\n }", "private void saveDatabaseSettings() {\r\n\r\n\t\t// --- Get new database ID --------------------------------------------\r\n\t\tint newID = 0;\r\n\t\tString newIDString = this.getJTextFieldDatabaseID().getText();\r\n\t\tif (newIDString!=null && newIDString.isEmpty()==false) {\r\n\t\t\ttry {\r\n\t\t\t\tnewID = Integer.parseInt(newIDString); \r\n\t\t\t} catch (Exception e) {\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// --- Save in the preferences ----------------------------------------\r\n\t\tBundleHelper.setIdScenarioResultForSetup(newID);\r\n\t}", "boolean supports(Database database);", "private boolean checkEssentialConnects() {\r\n\t\treturn (animalsHash != null && questionChooser != null);\r\n\t}", "protected void check() throws IOException, ServletException {\n if(value.length()==0)\n error(\"please specify a configuration\");\n else {\n \t\t//TODO add more checks\n \t\tok();\n }\n }", "private static void checkRequiredProperties()\n\t{\n\t\tfor (ServerProperty prop : ServerProperty.values())\n\t\t{\n\t\t\tif (prop.isRequired())\n\t\t\t{\n\t\t\t\t// TODO\n//\t\t\t\tswitch (prop)\n//\t\t\t\t{\n//\t\t\t\t\tcase GERMINATE_AVAILABLE_PAGES:\n//\t\t\t\t\t\tSet<Page> availablePages = getSet(prop, Page.class);\n//\t\t\t\t\t\tif (CollectionUtils.isEmpty(availablePages))\n//\t\t\t\t\t\t\tthrowException(prop);\n//\t\t\t\t\t\tbreak;\n//\n//\t\t\t\t\tcase GERMINATE_USE_AUTHENTICATION:\n//\t\t\t\t\t\tboolean useAuthentication = getBoolean(prop);\n//\t\t\t\t\t\tif (useAuthentication)\n//\t\t\t\t\t\t{\n//\t\t\t\t\t\t\tif (StringUtils.isEmpty(get(ServerProperty.GERMINATE_GATEKEEPER_SERVER)))\n//\t\t\t\t\t\t\t\tthrowException(ServerProperty.GERMINATE_GATEKEEPER_SERVER);\n//\t\t\t\t\t\t\tif (StringUtils.isEmpty(get(ServerProperty.GERMINATE_GATEKEEPER_NAME)))\n//\t\t\t\t\t\t\t\tthrowException(ServerProperty.GERMINATE_GATEKEEPER_NAME);\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\tbreak;\n//\n//\t\t\t\t\tcase GERMINATE_GATEKEEPER_REGISTRATION_ENABLED:\n//\t\t\t\t\t\tboolean registrationNeedsGatekeeper = getBoolean(prop);\n//\n//\t\t\t\t\t\tif (registrationNeedsGatekeeper)\n//\t\t\t\t\t\t{\n//\t\t\t\t\t\t\tString gatekeeperUrl = get(ServerProperty.GERMINATE_GATEKEEPER_URL);\n//\n//\t\t\t\t\t\t\tif (StringUtils.isEmpty(gatekeeperUrl))\n//\t\t\t\t\t\t\t\tthrowException(ServerProperty.GERMINATE_GATEKEEPER_URL);\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\tbreak;\n//\n//\t\t\t\t\tdefault:\n\t\t\t\tif (StringUtils.isEmpty(get(prop)))\n\t\t\t\t\tthrowException(prop);\n//\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void checkPreferences() {\n String email = pref.get(EMAIL, EMPTY);\n String hashedPassword = pref.get(PASSWORD, EMPTY);\n if(!email.equals(EMPTY) && !hashedPassword.equals(EMPTY)){\n rememberMe.setSelected(true);\n emailField.setText(email);\n String passTemp = getStringWithPasswordLength();\n passwordField.setText(passTemp);\n }\n }", "private boolean exists() {\n try {\n DatabaseMetaData md = conn.getMetaData();\n ResultSet rs = md.getTables(null, null, \"settings\", null);\n return rs.next();\n } catch (SQLException e) {\n System.err.println(e.getClass().getName() + \": \" + e.getMessage());\n System.exit(0);\n return false;\n }\n }", "private void isSystemReady() {\n\tif ((moStore.getAuthenticationDefinition().getQuery() == null)\n\t\t|| moStore.getJdbcConnectionDetails() == null) {\n\t moSessionStore.setSystemToHaltState();\n\n\t return;\n\t}// if ((moStore.getAuthenticationDefinition().getQuery() == null)\n\n\tmoSessionStore.setSystemToReadyState();\n }", "public void validateSettings() {\n \n \t\ttry {\n \t\t\tfinal String serverUrl = getServerUrl();\n \t\t\tfinal String newUserId = getUserName();\n \t\t\tfinal String newPassword = getPassword();\n \t\t\tfinal boolean isAnonymous = isAnonymousAccess();\n \t\t\tfinal String newEncoding = getCharacterEncoding();\n \t\t\tfinal String httpAuthUser = getHttpAuthUserId();\n \t\t\tfinal String httpAuthPass = getHttpAuthPassword();\n \t\t\tfinal boolean checkVersion = repositoryVersionCombo.getSelectionIndex() == 0;\n \t\t\tfinal String[] version = new String[1];\n \t\t\tgetWizard().getContainer().run(true, false, new IRunnableWithProgress() {\n \t\t\t\tpublic void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {\n \t\t\t\t\tif (monitor == null) {\n \t\t\t\t\t\tmonitor = new NullProgressMonitor();\n \t\t\t\t\t}\n \t\t\t\t\ttry {\n \t\t\t\t\t\tmonitor.beginTask(\"Validating server settings\", IProgressMonitor.UNKNOWN);\n \t\t\t\t\t\tBugzillaClient client = null;\n \t\t\t\t\t\tif (!isAnonymous && version != null) {\n \t\t\t\t\t\t\tclient = BugzillaClientFactory.createClient(serverUrl, newUserId, newPassword,\n \t\t\t\t\t\t\t\t\thttpAuthUser, httpAuthPass, newEncoding);\n \t\t\t\t\t\t\tclient.validate();\t\t\t\t\t\t\t\n \t\t\t\t\t\t}\n \t\t\t\t\t\tif (checkVersion && client != null) {\n \t\t\t\t\t\t\tRepositoryConfiguration config = client.getRepositoryConfiguration();\n \t\t\t\t\t\t\tif (config != null) {\n \t\t\t\t\t\t\t\tversion[0] = config.getInstallVersion();\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t}\n \t\t\t\t\t} catch (Exception e) {\n \t\t\t\t\t\tthrow new InvocationTargetException(e);\n \t\t\t\t\t} finally {\n \t\t\t\t\t\tmonitor.done();\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t});\n \n \t\t\t// getWizard().getContainer().run(true, false, new\n \t\t\t// IRunnableWithProgress() {\n \t\t\t// public void run(IProgressMonitor monitor) throws\n \t\t\t// InvocationTargetException, InterruptedException {\n \t\t\t// monitor.beginTask(\"Validating server settings\",\n \t\t\t// IProgressMonitor.UNKNOWN);\n \t\t\t// try {\n \t\t\t//\n \t\t\t// // Check that the server exists and we can connect\n \t\t\t// // (proxy or not)\n \t\t\t// Proxy proxySettings =\n \t\t\t// TasksUiPlugin.getDefault().getProxySettings();\n \t\t\t// WebClientUtil.openUrlConnection(serverURL, proxySettings, false,\n \t\t\t// httpAuthUser, httpAuthPass);\n \t\t\t//\n \t\t\t// if (!isAnonymous) {\n \t\t\t// // Server exists, connect to service and validate\n \t\t\t// // credentials\n \t\t\t// BugzillaClient.validateCredentials(proxySettings, serverUrl,\n \t\t\t// newEncoding, newUserId,\n \t\t\t// newPassword);\n \t\t\t// }\n \t\t\t//\n \t\t\t// if (checkVersion) {\n \t\t\t// RepositoryConfiguration config =\n \t\t\t// BugzillaCorePlugin.getRepositoryConfiguration(true,\n \t\t\t// serverUrl, proxySettings, newUserId, newPassword, newEncoding);\n \t\t\t//\n \t\t\t// if (config != null) {\n \t\t\t// version[0] = config.getInstallVersion();\n \t\t\t// }\n \t\t\t// }\n \t\t\t//\n \t\t\t// } catch (Exception e) {\n \t\t\t// throw new InvocationTargetException(e);\n \t\t\t// } finally {\n \t\t\t// monitor.done();\n \t\t\t// }\n \t\t\t// }\n \t\t\t// });\n \n \t\t\tif (version[0] != null) {\n \t\t\t\tsetBugzillaVersion(version[0]);\n \t\t\t}\n \n \t\t\tif (!testing) {\n \t\t\t\tMessageDialog.openInformation(null, IBugzillaConstants.TITLE_MESSAGE_DIALOG,\n \t\t\t\t\t\t\"Authentication credentials are valid.\");\n \t\t\t}\n \t\t} catch (InvocationTargetException e) {\n \t\t\tif (e.getCause() instanceof MalformedURLException) {\n \t\t\t\tMessageDialog.openWarning(null, IBugzillaConstants.TITLE_MESSAGE_DIALOG, \"Server URL is invalid.\");\n \t\t\t} else if (e.getCause() instanceof LoginException) {\n \t\t\t\tMessageDialog.openWarning(null, IBugzillaConstants.TITLE_MESSAGE_DIALOG,\n \t\t\t\t\t\t\"Unable to authenticate with server.\\n\\n\" + e.getCause().getMessage());\n \t\t\t} else if (e.getCause() instanceof IOException) {\n \t\t\t\tMessageDialog.openWarning(null, IBugzillaConstants.TITLE_MESSAGE_DIALOG,\n \t\t\t\t\t\t\"No Bugzilla server found at url\");\n \t\t\t} else {\n \t\t\t\tMessageDialog.openWarning(null, IBugzillaConstants.TITLE_MESSAGE_DIALOG, MESSAGE_FAILURE_UNKNOWN);\n \t\t\t}\n \t\t} catch (InterruptedException e) {\n \t\t\tMessageDialog.openWarning(null, IBugzillaConstants.TITLE_MESSAGE_DIALOG, MESSAGE_FAILURE_UNKNOWN);\n \t\t}\n \n \t\tsuper.getWizard().getContainer().updateButtons();\n \t}", "public boolean databaseExists() {\n return defaultDatabaseExists();\n }", "private void checkLanguagePreferences() {\n if (submitter.languagePref == null) {\n if (rootValidator.autorepair) {\n submitter.languagePref = new ArrayList<StringWithCustomTags>();\n addInfo(\"Submitter language preference collection was null - autorepaired\", submitter);\n } else {\n addInfo(\"Submitter language preference collection is null\", submitter);\n }\n } else {\n if (submitter.languagePref.size() > 3) {\n addError(\"Submitter exceeds limit on language preferences (3)\", submitter);\n }\n for (StringWithCustomTags s : submitter.languagePref) {\n checkRequiredString(s, \"language pref\", submitter);\n }\n }\n }", "@Override\n protected void doEnsureSettingHasValue(Boolean value) throws Throwable {\n loadUrlSyncByContent(mXWalkContent, client,\n UrlUtils.getTestFileUrl(\"xwalkview/localStorage.html\"));\n assertEquals(\n value == ENABLED ? HAS_LOCAL_STORAGE : NO_LOCAL_STORAGE,\n client.getChangedTitle());\n }" ]
[ "0.65499556", "0.6523141", "0.6057843", "0.601901", "0.5827478", "0.575533", "0.5711237", "0.5700962", "0.5681436", "0.56628084", "0.56608784", "0.56476337", "0.56476337", "0.56059545", "0.55940443", "0.55918366", "0.5586424", "0.5564708", "0.5560933", "0.55395824", "0.5523103", "0.5518897", "0.5514853", "0.54697", "0.5464498", "0.546306", "0.54606456", "0.54264253", "0.53979707", "0.5391197", "0.5384742", "0.5381833", "0.5374613", "0.5370736", "0.53628874", "0.5354959", "0.53494674", "0.53427386", "0.53334546", "0.5330571", "0.53145605", "0.52989304", "0.52890813", "0.52752906", "0.52710927", "0.5267895", "0.5265747", "0.52557087", "0.5250871", "0.5242215", "0.5235359", "0.52269936", "0.5224754", "0.5224754", "0.5224754", "0.5224754", "0.5224754", "0.5214939", "0.52126294", "0.51953095", "0.51878846", "0.51853347", "0.518176", "0.5152216", "0.51512986", "0.515011", "0.51408875", "0.51408875", "0.5129483", "0.5105116", "0.5097401", "0.5093397", "0.5093052", "0.50838315", "0.5079395", "0.5061966", "0.5054904", "0.50521713", "0.50327694", "0.50126237", "0.5001927", "0.49958688", "0.49871397", "0.4983762", "0.49782625", "0.497358", "0.49582198", "0.49579117", "0.49504182", "0.49487406", "0.49316624", "0.49193034", "0.4918338", "0.4915883", "0.49089685", "0.48996595", "0.48920527", "0.4890457", "0.4890373", "0.48885214" ]
0.7417245
0
Checks the log_level string
private void checkLogLevel() { config.getString("log_level"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static boolean isValidLogLevel(int level) {\n\t\tif ((level == BackupLogger.INFO) || (level == BackupLogger.DETAIL)\n\t\t\t\t|| (level == BackupLogger.WARN) || (level == BackupLogger.TRACE)) {\n\t\t\treturn true;\n\t\t} else return false;\n\t}", "public static int getLevel(){\n\treturn logLevel;\n }", "static boolean isLoggingEnabled(String tag, int logLevel) {\n\n // this hashmap lookup might be a little expensive, and so it might make\n // sense to convert this over to a CopyOnWriteArrayList\n Integer logLevelForTag = enabledTags.get(tag);\n return logLevel >= (logLevelForTag == null ? WARN : logLevelForTag);\n }", "public static void setLevel(final String logLevel) {\r\n\t\tif (logLevel.equalsIgnoreCase(\"FATAL\")) {\r\n\t\t\tServletLoggingOutput.setLevel(LoggingOutput.LEVEL_FATAL);\r\n\t\t} else if (logLevel.equalsIgnoreCase(\"ERROR\")) {\r\n\t\t\tServletLoggingOutput.setLevel(LoggingOutput.LEVEL_ERROR);\r\n\t\t} else if (logLevel.equalsIgnoreCase(\"WARN\")) {\r\n\t\t\tServletLoggingOutput.setLevel(LoggingOutput.LEVEL_WARN);\r\n\t\t} else if (logLevel.equalsIgnoreCase(\"INFO\")) {\r\n\t\t\tServletLoggingOutput.setLevel(LoggingOutput.LEVEL_INFO);\r\n\t\t} else if (logLevel.equalsIgnoreCase(\"DEBUG\")) {\r\n\t\t\tServletLoggingOutput.setLevel(LoggingOutput.LEVEL_DEBUG);\r\n\t\t} else {\r\n\t\t\tthrow new IllegalArgumentException(\"Unknown log level: \" + logLevel);\r\n\t\t}\r\n\t}", "private void changeLogLevel(String level){\n\n }", "public static void setLevel(int level){\n\tlogLevel = level;\n }", "public void setLogLevel(int level) {\n\t\t// only change if a valid level\n\t\tif (isValidLogLevel(level)) this.logLevel = level;\n\t}", "public int get_log_level() {\r\n return logLevel;\r\n }", "private String findLevelMatch(String loggerName) {\n Properties properties = getLoggingProperties();\n String value = null;\n\n if (properties != null) {\n while (value == null) {\n int lastIndex = loggerName.lastIndexOf(_levelSeparator);\n\n value = properties.getProperty(loggerName + \".level\"); // NOI18N\n\n if (loggerName.trim().length() > 0) {\n loggerName = ((lastIndex == -1) ? \"\" : // NOI18N\n loggerName.substring(0, lastIndex));\n } else {\n return value;\n }\n }\n }\n\n return value;\n }", "private boolean onErrorLevel(int level) {\n if (status() >= level) {\n System.err.println(\"Compilation error(s) found.\");\n return true;\n } else {\n return false;\n }\n }", "public void logIfLevel(Marker ifLevel, String... messages);", "public void setLogLevel(int level) {\n logLevel = level;\n }", "void log(Level level, String message);", "public void setLogLevel(int logLevel) {\n\t\tif(logLevel > 5 || logLevel < 0) \n\t\t\tthrow new IllegalArgumentException(\"invalid parameter logLevel, please use Logger's static level constant.\");\n\t\tmLogLevel = logLevel;\n\t}", "public String changeLogLevel(ChangeLogLevelRequest logLevel){return \"\";}", "private void configureLogLevels()\r\n { \r\n String level = properties.getProperty(\"LogLevel\");\r\n \r\n switch(level)\r\n {\r\n case \"INFO\": INFO = Level.INFO; \r\n DEBUG = Level.FINE; \r\n WARNING = Level.FINE;\r\n break;\r\n case \"DEBUG\": INFO = Level.INFO;\r\n DEBUG = Level.INFO; \r\n WARNING = Level.INFO;\r\n break;\r\n case \"WARNING\": INFO = Level.FINE; \r\n DEBUG = Level.FINE; \r\n WARNING = Level.INFO; \r\n break;\r\n default: INFO = Level.INFO; \r\n DEBUG = Level.FINE; \r\n WARNING = Level.WARNING;\r\n break;\r\n }\r\n }", "protected void setLogLevel(int logLevel) \n\t{\n\t\tthis.logLevel = logLevel;\n\t}", "public void set_log_level(int level) {\r\n logLevel = Math.max(0,level);\r\n }", "void printLog(String str, int level)\n { if (log!=null) log.println(\"CommandLineUA: \"+str, UserAgent.LOG_OFFSET+level);\n }", "protected void checkLog() {\n String keyword = \"Connected controllable Agent to the Introscope Enterprise Manager\";\n LogUtils util = utilities.createLogUtils(umAgentConfig.getLogPath(), keyword);\n assertTrue(util.isKeywordInLog());\n\t}", "@Test\n public void testValidLogMappings() {\n Level log4JLevelFiner = classUnderTest.convertJdkLevelToLog4jLevel(java.util.logging.Level.FINER.toString());\n Level log4JLevelFine = classUnderTest.convertJdkLevelToLog4jLevel(java.util.logging.Level.FINE.toString());\n assertEquals(log4JLevelFine, Level.DEBUG);\n assertEquals(\"Log4j mapping for jdk.Fine should be equivalent to Finer\", log4JLevelFine, log4JLevelFiner);\n\n //Log 4j has no concept of CONFIG, so maps to INFO\n Level log4JLevelConfig = classUnderTest.convertJdkLevelToLog4jLevel(java.util.logging.Level.CONFIG.toString());\n Level log4JLevelInfo = classUnderTest.convertJdkLevelToLog4jLevel(java.util.logging.Level.INFO.toString());\n assertEquals(log4JLevelInfo, Level.INFO);\n assertEquals(\"Log4j mapping for jdk.Config should be equivalent to jdk.Info\", log4JLevelConfig, log4JLevelInfo);\n\n //Test one other\n assertEquals(\"JDK.WARNING should be equivalent to log4j.WARN\", Level.WARN,\n classUnderTest.convertJdkLevelToLog4jLevel(java.util.logging.Level.WARNING.toString()));\n\n }", "public static LogLevel getLevel(){\n return EZLoggerManager.lvl;\n }", "LogLevel getLogLevel();", "@Test\n @EnabledIfSystemProperty( named = \"integrationTest\", matches = \"true\" )\n @Order(1)\n public void testChangeLogLevel() {\n try{\n logModule.changeLogLevel(new URI(integrationHost), Logger.Level.FATAL);\n }\n catch ( Exception e)\n {\n assertTrue( false, String.format(\"Got error: %s\", e.getMessage()) );\n }\n }", "public int getLogLevel() {\n return logLevel;\n }", "final public static void setLogLevel(String logLevel) {\n\t\tlogger.setLogLevelImpl(logLevel);\n\t}", "public static void setLogLevel(int level) {\n mLogLevel = level;\n }", "public int checkLevel(int level, String requestTask) {\n\t\tint ret = 1;\n\t\tswitch(requestTask) {\n\t\tcase \"add\":\n\t\t\tif(level == 2)\n\t\t\t\tret = 1;\n\t\t\tbreak;\n\t\tcase \"delete\":\n\t\tcase \"modify\":\n\t\t\tif(level == 3)\n\t\t\t\tret = 1;\n\t\t}\n\t\treturn ret;\n\t}", "public void setLogLevel(Level logLevel) {\n\t\tthis.logLevel = logLevel;\n\t}", "private native void Df1_Set_Log_Filter_Level(int level);", "Update withLogLevel(String logLevel);", "@GET\n @Path(\"/loglevel/{level}\")\n public Response setLogLevel(@Context HttpServletRequest request,@Context HttpServletResponse response,@Context ServletContext servletContext, @PathParam(\"level\") String level) throws JsonGenerationException, JsonMappingException, IOException{\n LogManager.getRootLogger().setLevel(org.apache.log4j.Level.toLevel(level));\n return Response.status(200).entity(\"{\\\"status\\\":\\\"DONE\\\", \\\"Message\\\":\\\"Changed Log level to: \"+LogManager.getRootLogger().getLevel().toString()+\"\\\"}\").build();\n }", "public void setLevel(String level) {\n this.level = level == null ? null : level.trim();\n }", "public void setLevel(String level) {\n this.level = level == null ? null : level.trim();\n }", "public void setLevel(String level) {\n this.level = level == null ? null : level.trim();\n }", "public void setLevel(String level) {\n this.level = level == null ? null : level.trim();\n }", "public void choiceLevel(String lev) {\n switch (lev) {\n\n case \"ALL\":\n mLevelLogger = Level.ALL;\n break;\n case \"NOTIFICATION\":\n mLevelLogger = Level.INFO;\n break;\n case \"HIGH\":\n mLevelLogger = Level.SEVERE;\n break;\n case \"MEDIUM\":\n mLevelLogger = Level.WARNING;\n break;\n case \"LOW\":\n mLevelLogger = Level.INFO;\n break;\n case \"SEVERE\":\n mLevelLogger = Level.SEVERE;\n break;\n case \"WARNING\":\n mLevelLogger = Level.WARNING;\n break;\n case \"INFO\":\n mLevelLogger = Level.INFO;\n break;\n case \"CONFIG\":\n mLevelLogger = Level.CONFIG;\n break;\n case \"FINE\":\n mLevelLogger = Level.FINE;\n break;\n case \"FINER\":\n mLevelLogger = Level.FINER;\n break;\n case \"FINEST\":\n mLevelLogger = Level.FINEST;\n break;\n case \"OFF\":\n mLevelLogger = Level.OFF;\n break;\n default:\n logger.warning(\"Unknow Level:\" + lev);\n }\n }", "private boolean isLogNumFieldValid() {\n String count = logFileCount.getText();\n logNumAlert.setText(\"\");\n try {\n int count_num = Integer.parseInt(count);\n if (count_num < 1) {\n logNumAlert.setText(Bundle.AutopsyOptionsPanel_logNumAlert_invalidInput_text());\n return false;\n }\n } catch (NumberFormatException e) {\n logNumAlert.setText(Bundle.AutopsyOptionsPanel_logNumAlert_invalidInput_text());\n return false;\n }\n return true; \n }", "private void printLog(String str, int level)\n { if (log!=null) log.println(\"AudioApp: \"+str, LoopbackMediaApp.LOG_OFFSET+level);\n if (level<=Log.LEVEL_HIGH) System.out.println(\"AudioApp: \"+str);\n }", "public void setLevel(String level);", "public void logIfLevel(Marker min, Marker max, String... messages);", "Log set(Level level) {\n\tthis.logging = level.compareTo(this.level) >= 0;\n\treturn this;\n }", "public static int validate(int level) {\n if (validLevels.contains(level)) {\n return level;\n } else {\n throw new IllegalArgumentException(\"Invalid level\");\n }\n }", "abstract protected void logInternal(int level, String message);", "public Level getLogLevel() {\n\t\treturn logLevel;\n\t}", "public boolean isLevel(){\n return Math.abs(gyro_board.getPitch()) < LEVEL_TOLERANCE && Math.abs(gyro_board.getRoll()) < LEVEL_TOLERANCE;\n }", "public int getLogLevel() {\n\t\treturn this.logLevel;\n\t}", "@Test\n public void testCustomLoggingLevels() {\n LogTestLogger customLogger = new LogTestLogger();\n Database.log.setCustom(customLogger);\n\n for(int i = 5; i >= 1; i--) {\n customLogger.getLines().clear();\n customLogger.setLevel(LogLevel.values()[i]);\n Log.v(LogDomain.DATABASE, \"TEST VERBOSE\");\n Log.i(LogDomain.DATABASE, \"TEST INFO\");\n Log.w(LogDomain.DATABASE, \"TEST WARNING\");\n Log.e(LogDomain.DATABASE, \"TEST ERROR\");\n assertEquals(5 - i, customLogger.getLines().size());\n }\n }", "void printLog(String str)\n { printLog(str,Log.LEVEL_HIGH);\n }", "public Level getLogLevel()\n\t{\n\t\treturn this.logLevel;\n\t}", "protected void initLogger(String logLevel) {\n Logger.setLevel(logLevel);\n }", "@SuppressLint(\"NewApi\")\r\n\tpublic static void log(String string, LoggerLevel level) {\r\n\t\t\r\n\t\tif (string == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tswitch(level) {\r\n\t\tcase DEBUG:\r\n\t\t\tLog.d(APPNAME, string);\r\n\t\t\tbreak;\r\n\t\tcase ERROR:\r\n\t\t\tLog.e(APPNAME, string);\r\n\t\t\tbreak;\r\n\t\tcase INFO:\r\n\t\t\tLog.i(APPNAME, string);\r\n\t\t\tbreak;\r\n\t\tcase VERBOSE:\r\n\t\t\tLog.v(APPNAME, string);\r\n\t\t\tbreak;\r\n\t\tcase WARNING:\r\n\t\t\tLog.w(APPNAME, string);\r\n\t\t\tbreak;\r\n\t\tcase WTF:\r\n\t\t\tif (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO) {\r\n\t\t\t\tLog.e(APPNAME, string);\r\n\t\t\t} else {\r\n\t\t\t\tLog.wtf(APPNAME, string);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\tif (logToFile) {\r\n\t\t\t\r\n\t\t\tString storageState = Environment.getExternalStorageState();\r\n\t\t\tif (storageState.equals(Environment.MEDIA_MOUNTED)) {\r\n\t\t\t\tlock.lock();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tFile root = Environment.getExternalStorageDirectory();\r\n\t\t\t\t\tFile downloads = new File(root, APPNAME);\r\n\t\t\t\t\tdownloads.mkdirs();\r\n\t\t\t\t\tFile logFile = new File(downloads, APPNAME + \".log\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (!logFile.exists()) {\r\n\t\t\t\t\t\tlogFile.createNewFile();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tFileOutputStream fos = new FileOutputStream(logFile, true);\r\n\t\t\t\t\tfos.write(new String(new Date() + \" --> \" + string + \"\\n\").getBytes());\r\n\t\t\t\t\tfos.close();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\tlock.unlock();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public boolean logErrors()\r\n {\r\n return errorLevelHandler.getBoolean();\r\n }", "@Override\n\tpublic void log(Level level, String message) {\n\n\t}", "private void printLog(String str)\n { printLog(str,Log.LEVEL_HIGH);\n }", "public void setLevel(String value) {\n this.level = value;\n }", "protected abstract void log(T level, Object message);", "public void setLevel(String lev) {\n\t\tlevel = lev;\n\t}", "private void setLevel(final org.apache.log4j.Level level) {\r\n if (log.isWarnEnabled()) {\r\n log.warn(\"LogUtil : level changed to : \" + level.toString());\r\n }\r\n\r\n for (final Log l : this.logs.values()) {\r\n setLevel(l, level);\r\n }\r\n }", "public void setLevel(String level){\n\t\tthis.level = level;\n\t}", "public void setLogLevel(String logLevel) {\n agentConfig.setLogLevel(logLevel);\n logConfigChanged();\n }", "public void setLoggingLevel(String loggingLevel) {\n this.loggingLevel = loggingLevel;\n }", "@Test\n\tpublic void isEnabled() {\n\t\tassertThat(logger.isEnabled(org.jboss.logging.Logger.Level.TRACE)).isEqualTo(traceEnabled);\n\t\tassertThat(logger.isEnabled(org.jboss.logging.Logger.Level.DEBUG)).isEqualTo(debugEnabled);\n\t\tassertThat(logger.isEnabled(org.jboss.logging.Logger.Level.INFO)).isEqualTo(infoEnabled);\n\t\tassertThat(logger.isEnabled(org.jboss.logging.Logger.Level.WARN)).isEqualTo(warnEnabled);\n\t\tassertThat(logger.isEnabled(org.jboss.logging.Logger.Level.ERROR)).isEqualTo(errorEnabled);\n\t\tassertThat(logger.isEnabled(org.jboss.logging.Logger.Level.FATAL)).isEqualTo(errorEnabled);\n\t}", "public void setLevel(String level) {\n this.level = level;\n }", "public void setLevel(String level) {\n this.level = level;\n }", "public final void log(Level level, String string) {\n context.getBot().log(manifest.name(), level, string);\n }", "public ErrorLog level(String logLvlCd) {\n this.logLvlCd = logLvlCd;\n return this;\n }", "public static void setLogLevel(int level){\n\t\tswitch(level){\n\t\t\tcase ONE: \n\t\t\t\tLogger.getRootLogger().setLevel(Level.ALL); \n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.ALL\"); \n\t\t\t\tbreak;\n\t\t\tcase TWO: \n\t\t\t\tLogger.getRootLogger().setLevel(Level.DEBUG); \n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.DEBUG\"); \n\t\t\t\tbreak;\n\t\t\tcase THREE:\n\t\t\t\tLogger.getRootLogger().setLevel(Level.ERROR);\n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.ERROR\");\n\t\t\t\tbreak;\n\t\t\tcase FOUR:\n\t\t\t\tLogger.getRootLogger().setLevel(Level.FATAL);\n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.FATAL\");\n\t\t\t\tbreak;\n\t\t\tcase FIVE:\n\t\t\t\tLogger.getRootLogger().setLevel(Level.INFO);\n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.INFO\");\n\t\t\t\tbreak;\n\t\t\tcase SIX:\n\t\t\t\tLogger.getRootLogger().setLevel(Level.OFF); \n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.OFF\");\n\t\t\t\tbreak;\n\t\t\tcase SEVEN:\n\t\t\t\tLogger.getRootLogger().setLevel(Level.WARN);\n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.WARN\");\n\t\t\t\tbreak;\n\t\t\tcase EIGHT:\n\t\t\t\tLogger.getRootLogger().setLevel(Level.TRACE);\n\t\t\t\tLOGGER.info(\"Logging Level set to LEVEL.WARN\");\n\t\t\t\tbreak;\n\t\t\tdefault: \n\t\t\t\tLogger.getRootLogger().setLevel(Level.ALL);\n\t\t\t\tLOGGER.info(\"Logging Level defaulted to LEVEL.ALL Please add parameter to properties file for custom logging.\");\n\t\t\t\tbreak;\n\t\t}\n\t}", "public String getLogLvlCd() {\n if (null == logLvlCd) {\n logLvlCd = \"ERROR\" ;\n } \n return logLvlCd;\n }", "public void setLogFilterLevel(int level)\n\t{\n\t\tDf1_Set_Log_Filter_Level(level);\n\t}", "private LogLevel(int level, String name) {\n\t\tthis.level = level;\n\t\tthis.name = name;\n\t}", "public tech.hry.logclient.grpc.LogLevel getLevel() {\n @SuppressWarnings(\"deprecation\")\n tech.hry.logclient.grpc.LogLevel result = tech.hry.logclient.grpc.LogLevel.valueOf(level_);\n return result == null ? tech.hry.logclient.grpc.LogLevel.UNRECOGNIZED : result;\n }", "protected static void updateLevel(LogLevel lvl){\n //System.out.println(\"updateLevel: \"+lvl);\n Level level;\n \n EZLoggerManager.lvl = lvl;\n //adapted from http://blog.cag.se/?p=835\n Logger logger = Logger.getLogger(\"\");\n \n switch(lvl){\n case error:\n level = Level.SEVERE;\n break;\n case warn:\n level = Level.WARNING;\n break;\n case info:\n level = Level.INFO;\n break;\n case debug:\n default:\n level = Level.CONFIG;\n break;\n }\n logger.setLevel(level);\n Handler[] handlers = logger.getHandlers();\n for(Handler h : handlers){\n h.setLevel(level);\n }\n }", "TreeLogger.Type getLogLevel() {\n return logLevel;\n }", "public boolean logWarnings()\r\n {\r\n return warningLevelHandler.getBoolean();\r\n }", "public static String getChatAppLoglevel() {\n return CHAT_APP_LOGLEVEL;\n }", "public tech.hry.logclient.grpc.LogLevel getLevel() {\n @SuppressWarnings(\"deprecation\")\n tech.hry.logclient.grpc.LogLevel result = tech.hry.logclient.grpc.LogLevel.valueOf(level_);\n return result == null ? tech.hry.logclient.grpc.LogLevel.UNRECOGNIZED : result;\n }", "public static void setLevel(LogLevel lvl){\n updateLevel(lvl);\n if (txtAreaHandler!=null){\n txtAreaHandler.changeLevel(lvl);\n }\n }", "boolean hasLevel();", "boolean hasLevel();", "boolean hasLevel();", "boolean hasLevel();", "public static void setJXTALogger(JXTA_LOG_LEVEL logLevel) {\n\t\tswitch (logLevel) {\n\t\tcase FINEST:\n\t\t\tremoveJavaStdLoggerHandlers();\n\t\t\tSystem.setProperty(\"net.jxta.logging.Logging\",\n\t\t\t\t\tJXTA_LOG_LEVEL.FINEST.name());\n\t\t\tSystem.setProperty(\"net.jxta.level\", JXTA_LOG_LEVEL.FINEST.name());\n\t\t\tbreak;\n\t\tcase FINER:\n\t\t\tremoveJavaStdLoggerHandlers();\n\t\t\tSystem.setProperty(\"net.jxta.logging.Logging\",\n\t\t\t\t\tJXTA_LOG_LEVEL.FINER.name());\n\t\t\tSystem.setProperty(\"net.jxta.level\", JXTA_LOG_LEVEL.FINER.name());\n\t\t\tbreak;\n\t\tcase FINE:\n\t\t\tremoveJavaStdLoggerHandlers();\n\t\t\tSystem.setProperty(\"net.jxta.logging.Logging\",\n\t\t\t\t\tJXTA_LOG_LEVEL.FINE.name());\n\t\t\tSystem.setProperty(\"net.jxta.level\", JXTA_LOG_LEVEL.FINE.name());\n\t\t\tbreak;\n\t\tcase INFO:\n\t\t\tremoveJavaStdLoggerHandlers();\n\t\t\tSystem.setProperty(\"net.jxta.logging.Logging\",\n\t\t\t\t\tJXTA_LOG_LEVEL.INFO.name());\n\t\t\tSystem.setProperty(\"net.jxta.level\", JXTA_LOG_LEVEL.INFO.name());\n\t\t\tbreak;\n\t\tcase WARNING:\n\t\t\tremoveJavaStdLoggerHandlers();\n\t\t\tSystem.setProperty(\"net.jxta.logging.Logging\",\n\t\t\t\t\tJXTA_LOG_LEVEL.WARNING.name());\n\t\t\tSystem.setProperty(\"net.jxta.level\", JXTA_LOG_LEVEL.WARNING.name());\n\t\t\tbreak;\n\t\tcase SEVERE:\n\t\t\tremoveJavaStdLoggerHandlers();\n\t\t\tSystem.setProperty(\"net.jxta.logging.Logging\",\n\t\t\t\t\tJXTA_LOG_LEVEL.SEVERE.name());\n\t\t\tSystem.setProperty(\"net.jxta.level\", JXTA_LOG_LEVEL.SEVERE.name());\n\t\t\tbreak;\n\t\tcase OFF:\n\t\t\tremoveJavaStdLoggerHandlers();\n\t\t\tSystem.setProperty(\"net.jxta.logging.Logging\",\n\t\t\t\t\tJXTA_LOG_LEVEL.OFF.name());\n\t\t\tSystem.setProperty(\"net.jxta.level\", JXTA_LOG_LEVEL.OFF.name());\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}", "String getLogHandled();", "public static void setLoggingLevel(Level newLevel)\n {\n ErrorLogger.setLevel(newLevel);\n }", "@Override\n public Level getLevel() {\n return privateConfig.loggerConfigLevel;\n }", "public static String getLogLevelName(int level) {\n\t\tif( BackupLogger.LogLevels.containsKey(level) ) {\n\t\t\treturn BackupLogger.LogLevels.get(level).logLevelName;\n\t\t} else {\n\t\t\treturn \"Unknown\";\n\t\t}\n\t}", "public void overrideLogLevel(String level) {\n Logger rootLogger = LoggerFactory.getLogger(\"org.mockserver\");\n if (rootLogger instanceof ch.qos.logback.classic.Logger) {\n ((ch.qos.logback.classic.Logger) rootLogger).setLevel(Level.toLevel(level));\n }\n }", "public boolean isGreater(LogLevel lvl)\n\t{\n\t\tif(this.level > lvl.getLevel())\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public void test_getLogMessage_1() {\n String logMessage = instance.getLogMessage();\n\n assertTrue(\"'getLogMessage' should be correct.\",\n logMessage.indexOf(\"type: type id: 1 operator:operator - message\") != -1);\n assertTrue(\"'getLogMessage' should be correct.\", logMessage.indexOf(\"java.lang.Exception\") != -1);\n }", "protected void report(String msg, Level level) {\n\t\tif (verbosity!=null && verbosity.intValue() > level.intValue()) return;\n\t\tLog.report(LOGTAG, msg, level);\n\t}", "public void setLevel(final String level) {\n setAttribute(ATTRIBUTE_LEVEL, level);\n }", "static public void setLogLevel(final Logger.LEVEL desiredLevel) {\n ThreadPoolWorkQueue.execute(new Runnable() {\n @Override\n public void run() {\n setLevelSync(desiredLevel);\n // we do this mostly to enable unit tests to logger.wait(100) instead of\n // Thread.sleep(100) -- it's faster, more stable, and more deterministic that way\n synchronized (WAIT_LOCK) {\n WAIT_LOCK.notifyAll();\n }\n }\n });\n }", "boolean hasLvl();", "@Override\n\tpublic void log(Level level, Message msg) {\n\n\t}", "private static void setLoggingLevel(Level level) {\n ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) org.slf4j.LoggerFactory.getLogger(ch.qos.logback.classic.Logger.ROOT_LOGGER_NAME);\n root.setLevel(level);\n }", "public boolean isLevelEnabled(int level)\r\n {\r\n return (level >= this.enabled);\r\n }", "public void log(String message, int loglevel) {\n if (managingPc != null) {\n managingPc.log(message, loglevel);\n } else {\n (loglevel > Project.MSG_WARN ? System.out : System.err).println(message);\n }\n }", "private final static boolean doTrace(String component, String level,\n\t String type) {\n\t\tif (!enableTraces) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tif (component == null || component.trim().length() == 0) {\n\t\t\t\tcomponent = COMPONENT_UNASSIGNED;\n\t\t\t}\n\t\t\tLogger log = Logger.getLogger(component);\n\t\t\tPriority pri = getPriority(type);\n\t\t\treturn (log.isEnabledFor(pri));\n\t\t}\n\t}", "private void setLevel(){\n\t\tif(getD(y) <= T)\n\t\t\tlevel = \"lower\";\n\t\telse\n\t\t\tlevel = \"higher\";\n\t}" ]
[ "0.66294265", "0.6075189", "0.6074244", "0.59451663", "0.5912221", "0.5902757", "0.58801305", "0.57990634", "0.57826674", "0.5760973", "0.5676139", "0.5651038", "0.56348646", "0.56256694", "0.5624688", "0.5607606", "0.56006426", "0.5560052", "0.55320334", "0.5523896", "0.5511518", "0.55100995", "0.55087507", "0.54877114", "0.54796344", "0.5476916", "0.5473349", "0.5451226", "0.5446024", "0.54354393", "0.5425768", "0.53974676", "0.5351026", "0.5351026", "0.5351026", "0.5351026", "0.5345217", "0.5343365", "0.5341183", "0.5323774", "0.53134495", "0.52754873", "0.5262497", "0.5252065", "0.52480036", "0.5248001", "0.5239387", "0.5221111", "0.5220059", "0.5216311", "0.5213488", "0.5213138", "0.51958877", "0.51921964", "0.51741165", "0.51683086", "0.5161944", "0.51475054", "0.5147041", "0.51380813", "0.511117", "0.5105384", "0.509111", "0.5077003", "0.5077003", "0.507547", "0.5072317", "0.5066702", "0.5062515", "0.50453895", "0.5035307", "0.5033614", "0.5032895", "0.50099784", "0.49877423", "0.49840924", "0.4983647", "0.49726632", "0.49628043", "0.49628043", "0.49628043", "0.49628043", "0.49611446", "0.49497032", "0.4948054", "0.49465257", "0.49415347", "0.4929507", "0.49283624", "0.4928356", "0.49245286", "0.4891849", "0.48615372", "0.4859901", "0.4853564", "0.48369205", "0.4836066", "0.48202452", "0.48076066", "0.47945738" ]
0.76868004
0
Checks the user_agent string
private void checkUserAgent() { val userAgent = config.getString("user_agent"); checkArgument(!isNullOrEmpty(userAgent), "user_agent is not set!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasUserAgent();", "public static boolean isBrowser(String[] nonBrowserUserAgents, HttpServletRequest request) {\n String userAgent = request.getHeader(\"User-Agent\");\n LOG.debug(\"User agent is \" + userAgent);\n if (userAgent == null) {\n return false;\n }\n userAgent = userAgent.toLowerCase(Locale.ENGLISH);\n boolean isBrowser = true;\n for (String nonBrowserUserAgent : nonBrowserUserAgents) {\n if (userAgent.contains(nonBrowserUserAgent)) {\n isBrowser = false;\n break;\n }\n }\n return isBrowser;\n }", "@java.lang.Override\n public boolean hasUserAgentVersion() {\n return userAgentVersionTypeCase_ == 7;\n }", "public boolean hasUserAgentVersion() {\n return userAgentVersionTypeCase_ == 7;\n }", "abstract String getUserAgent();", "java.lang.String getUserAgent();", "public boolean hasUserAgent() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "public boolean hasUserAgent() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "public static String getUserAgent()\n {\n return USER_AGENT;\n }", "String getUserAgent();", "public static String m21385a() {\n return System.getProperty(\"http.agent\");\n }", "@Test\n\tpublic void testMobileDetectionEmptyUserAgent()\n\t{\n\t\tfinal String[] uas =\n\t\t{ \"-\", \"\", \" \", \"\\n\", \"\\t\", \"\\0\" };\n\n\t\tfor (int index = 0; index < uas.length; index++)\n\t\t{\n\t\t\tfinal String userAgent = uas[index];\n\t\t\tLOG.info(\"Testing :\" + userAgent);\n\n\t\t\tassertFalse(\"No markup method should render a false positive\", detectionService.isWmlCapable(userAgent, null)\n\t\t\t\t\t|| detectionService.isXhtmlCapable(userAgent, null) || detectionService.isiPhoneCapable(userAgent, null));\n\n\t\t\tassertFalse(\"Api should fail to identify as a mobile device: (\" + userAgent + \")\",\n\t\t\t\t\tdetectionService.isMobileDevice(userAgent));\n\t\t\tassertFalse(\"Api wrongly identify as a desktop device: (\" + userAgent + \")\", detectionService.isDesktop(userAgent));\n\t\t}\n\n\t}", "private boolean isPassThruRequest(String userAgent){\n //TODO we can make this more generic, but there are no plans to support anything\n //other than CFME at this time.\n if (userAgent == null){\n return false;\n }\n return userAgent.contains(Constants.CFME_USER_AGENT_BASE) ? true : false;\n }", "@java.lang.Override\n public boolean hasUserAgentBuildVersion() {\n return userAgentVersionTypeCase_ == 8;\n }", "private String createUserAgent() {\n String userAgentString = createUserAgentString();\n StringBuilder result = new StringBuilder();\n\n // Removing invalid characters\n for (int i = 0; i < userAgentString.length(); i++) {\n char c = userAgentString.charAt(i);\n if (c == '\\t' || ('\\u0020' <= c && c <= '\\u007e')) {\n result.append(c);\n }\n }\n return result.toString();\n }", "@java.lang.Override\n public boolean hasUserAgentBuildVersion() {\n return userAgentVersionTypeCase_ == 8;\n }", "public static String userAgent() {\n Random random = new Random();\n return userAgents.get(random.nextInt(userAgents.size()));\n }", "@AppNameInUserAgent\n public abstract String assertUserAgentAppName();", "public java.lang.String getUserAgent() {\n java.lang.Object ref = userAgent_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n userAgent_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String getUserAgent();", "public void setUseragent(String useragent) {\n this.standardPairs.put(Parameters.USERAGENT, useragent);\n }", "public static void setUserAgent(String userAgent)\n {\n USER_AGENT = userAgent;\n }", "public java.lang.String getUserAgent() {\n java.lang.Object ref = userAgent_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n userAgent_ = s;\n }\n return s;\n }\n }", "public void setUserAgent(String userAgent){\n this.userAgent = userAgent;\n }", "public final String getUserAgent() {\n return properties.get(USER_AGENT_PROPERTY);\n }", "public String getUserAgent(){\n return this.userAgent;\n }", "protected void parse() {\n\t\tcustomUserAgent = getConfig().getString(CUSTOM_HTTP_HEADER_USER_AGENT, \"\");\r\n\t}", "private String getUserAgent(HTTPSampleResult sampleResult) {\n String res = sampleResult.getRequestHeaders();\n int index = res.indexOf(USER_AGENT);\n if (index >= 0) {\n // see HTTPHC3Impl#getConnectionHeaders\n // see HTTPHC4Impl#getConnectionHeaders\n // see HTTPJavaImpl#getConnectionHeaders\n //': ' is used by JMeter to fill-in requestHeaders, see getConnectionHeaders\n final String userAgentPrefix = USER_AGENT+\": \";\n String userAgentHdr = res.substring(\n index+userAgentPrefix.length(),\n res.indexOf('\\n',// '\\n' is used by JMeter to fill-in requestHeaders, see getConnectionHeaders\n index+userAgentPrefix.length()+1));\n return userAgentHdr.trim();\n } else {\n if (log.isInfoEnabled()) {\n log.info(\"No user agent extracted from requestHeaders:\" + res);\n }\n return null;\n }\n }", "public Builder setUserAgent(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000004;\n userAgent_ = value;\n onChanged();\n return this;\n }", "public String getUserAgent() {\n return userAgent;\n }", "protected String getUserAgent() {\n return null;\n }", "@Override\n\tpublic java.lang.String getUserAgent() {\n\t\treturn _userTracker.getUserAgent();\n\t}", "@Test\n public void getUserAgentStringWithoutExtra()\n {\n //arrange\n ProductInfo actual = new ProductInfo();\n\n //act\n String actualUserAgentString = actual.getUserAgentString();\n\n //assert\n assertEquals(TransportUtils.USER_AGENT_STRING, actualUserAgentString);\n }", "@Test\n\tpublic void osX_10_7_3_Safari5_1_5() {\n\t\trequest.addHeader(USER_AGENT, UserAgent.OSX_10_7_3_Safari5_1_5);\n\t\tDevice device = resolver.resolveDevice(request);\n\t\tassertEquals(device.toString(), NORMAL_TO_STRING);\n\t}", "public static String getDefaultUserAgent(){\n return sDefaultUserAgent;\n }", "public final String getUserAgent( ) {\r\n\t\treturn this.userAgent;\r\n\t}", "public void setUserAgent(final String userAgent) {\n this.userAgent = userAgent;\n }", "@Override\r\n\tpublic String getUserAgent() {\n\t\treturn null;\r\n\t}", "public void setUserAgent(String uaName, String version);", "public java.lang.String getUserAgentVersion() {\n java.lang.Object ref = \"\";\n if (userAgentVersionTypeCase_ == 7) {\n ref = userAgentVersionType_;\n }\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (userAgentVersionTypeCase_ == 7) {\n userAgentVersionType_ = s;\n }\n return s;\n }\n }", "public com.google.protobuf.ByteString\n getUserAgentBytes() {\n java.lang.Object ref = userAgent_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n userAgent_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "WebCrawler setUserAgent(String userAgent);", "private static String buildUserAgent(Context context) {\r\n\t\ttry {\r\n\t\t\tfinal PackageManager manager = context.getPackageManager();\r\n\t\t\tfinal PackageInfo info = manager.getPackageInfo(\r\n\t\t\t\t\tcontext.getPackageName(), 0);\r\n\r\n\t\t\t// Some APIs require \"(gzip)\" in the user-agent string.\r\n\t\t\treturn info.packageName + \"/\" + info.versionName + \" (\"\r\n\t\t\t\t\t+ info.versionCode + \") (gzip)\";\r\n\t\t} catch (NameNotFoundException e) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "private boolean inspectHeader() throws UrlCacheException {\n\n\t\tif(header.contains(\"HTTP/1.1 2\")){\n\t\t\treturn true;\n\t\t}\n\t\telse if(header.contains(\"HTTP/1.1 304\"))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tthrow new UrlCacheException();\n\t\t\n\t}", "public void test9(HttpServletRequest request, BufferedReader reader) throws javax.servlet.ServletException, java.io.IOException {\n InetAddress addr = InetAddress.getByName(reader.readLine());\n\n if(addr.getCanonicalHostName().endsWith(\"trustme.com\")){ /* BUG */\n\n }\n }", "@java.lang.Override\n public java.lang.String getUserAgentVersion() {\n java.lang.Object ref = \"\";\n if (userAgentVersionTypeCase_ == 7) {\n ref = userAgentVersionType_;\n }\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (userAgentVersionTypeCase_ == 7) {\n userAgentVersionType_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public Builder setUserAgentVersion(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n userAgentVersionTypeCase_ = 7;\n userAgentVersionType_ = value;\n onChanged();\n return this;\n }", "public com.google.protobuf.ByteString\n getUserAgentBytes() {\n java.lang.Object ref = userAgent_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n userAgent_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@Override\n public void filter(final ClientRequestContext requestContext) throws IOException {\n final String userAgent = VersionInfo.getUserAgent(\"Apache-HttpClient\", \"org.apache.http.client\", HttpClientBuilder.class);\n // Finally, we can add the header\n requestContext.getHeaders().add(HttpHeaders.USER_AGENT, userAgent);\n }", "public static void ensureViableProvider(Provider provider) throws IOException {\n Match match = provider.match(TEST_USER_AGENT);\n logger.debug(TEST_USER_AGENT);\n assertEquals(\"Match method should be exact\", MatchMethods.EXACT, match.getMethod());\n assertEquals(\"Is a mobile device\", true, match.getValues(\"IsMobile\").toBool());\n assertEquals(\"Screen width should be 640\", 640.0, match.getValues(\"ScreenPixelsWidth\").toDouble(),0);\n }", "public static String[] getNonBrowserUserAgents(String nonBrowserUserAgentsConfig) {\n String[] result = nonBrowserUserAgentsConfig.split(\"\\\\W*,\\\\W*\");\n for (int i = 0; i < result.length; i++) {\n result[i] = result[i].toLowerCase(Locale.ENGLISH);\n }\n return result;\n }", "public String isValidAgentLogin(String userName, String password);", "private void checkAuthUbidMain() {\n val auth = config.getString(\"authUbidMain\");\n\n checkArgument(auth.length() > 10, \"auth string (ubid-main) length is less than or equal to 10!\");\n }", "@java.lang.Override\n public java.lang.String getUserAgentName() {\n java.lang.Object ref = userAgentName_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n userAgentName_ = s;\n return s;\n }\n }", "protected void check() throws IOException, ServletException {\n if(value.length()==0)\n error(\"please type in the License Server\");\n else {\n \t//TODO add more checks\n \tok();\n }\n }", "@Override\n protected Result check() throws Exception { \n try {\n GetOSVersionRes res = this.service.getOSVersion(new GetOSVersionReq());\n // only return the OS name to avoid any potential\n // security problem if the version was exposed...\n return Result.healthy(res.getReturn().getOs().getOsName());\n } catch(Exception e) {\n return Result.unhealthy(e.getMessage());\n }\n }", "private static String getUserAgent() {\n return \"FBAndroidSDK\";\n }", "public java.lang.String getUserAgentName() {\n java.lang.Object ref = userAgentName_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n userAgentName_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String findBestMatch()\n\t{\t\t\n\t\tif (robot.containsUserAgent(\"cis455crawler\"))\n\t\t{\n\t\t\tbest_match = \"cis455crawler\";\n\t\t}\n\t\telse if (robot.containsUserAgent(\"*\"))\n\t\t{\n\t\t\tbest_match = \"*\";\n\t\t}\n\t\treturn best_match;\n\t}", "public Boolean checkAJAX(HttpServletRequest request) {\n\t\tBoolean flgXhr = false;\n\t\tString strXhr = (String) request.getHeader(\"X-Requested-With\");\n\t\tif (strXhr == null) {\n\t\t\tstrXhr = (String) request.getAttribute(\"xhr\");\n\t\t\tif (strXhr == null || !strXhr.equalsIgnoreCase(\"true\"))\n\t\t\t\tstrXhr = null;\n\t\t}\n\t\tflgXhr = (strXhr != null && !strXhr.equals(\"com.android.browser\"));\n\t\treturn (flgXhr);\n\t}", "private boolean isValidAuthentication(String authHeader) {\n return !StringUtils.isEmpty(authHeader);\n }", "public boolean validateMetaCaracteres(String MetaCaracteres){\n Pattern pattern;\n Matcher matcher; \n// pattern = Pattern.compile(\"^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ]+$\");\n pattern = Pattern.compile(\"^[a-zA-ZñÑáéíóúÁÉÍÓÚ]+$\");\n matcher = pattern.matcher(MetaCaracteres);\n return matcher.matches();\n }", "private boolean validWebsite(String website) {\n String url_regex = \"(http://|https://)(www.)?([a-zA-Z0-9]+).[a-zA-Z0-9]*.[a-z]{3}.?([a-z]+)?\";\n Pattern pattern = Pattern.compile(url_regex);\n Matcher matcher = pattern.matcher(website);\n return matcher.matches();\n }", "public boolean insuranceCheck(String String) {\n\t\treturn false;\n\t}", "private static Boolean testUsername(String username){\n\t\t//Setting Up Regex -> All Numbers and Letters maximum 14 signs\n\t\tString pattern =\"[A-z1-9]{2,14}\";\n\t\tPattern p = Pattern.compile(pattern);\n\t\tMatcher m = p.matcher(username);\n\t\t\t\n\t\tif(m.matches() && !username.isEmpty()){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public boolean mo62323b(String str) {\n try {\n return \"mraid.js\".equals(Uri.parse(str.toLowerCase(Locale.US)).getLastPathSegment());\n } catch (Exception e) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"matchesInjectionUrl Exception: \");\n sb.append(e.getMessage());\n C5155g.m3807a(\"MraidWebViewClient\", 6, sb.toString());\n return false;\n }\n }", "@Override\r\n public boolean shouldVisit(WebURL url) {\r\n String href = url.getURL().toLowerCase();\r\n return !FILTERS.matcher(href).matches() && href.startsWith(\"http://fksis.bsuir.by/\");\r\n// \"http://www.ics.uci.edu/\");\r\n }", "public static boolean shouldDecodeParams(HttpServletRequest request) {\n String userAgent = request.getHeader(HttpHeaders.USER_AGENT);\n\n // If the request didn't come from build info let Jersey do the work\n if (StringUtils.isBlank(userAgent) || !userAgent.startsWith(\"ArtifactoryBuildClient/\")) {\n return false;\n }\n\n String buildInfoVersion = StringUtils.removeStart(userAgent, \"ArtifactoryBuildClient/\");\n boolean snapshotCondition = StringUtils.contains(buildInfoVersion, \"SNAPSHOT\");\n boolean newVersionCondition = new DefaultArtifactVersion(\"2.0.11\").compareTo(\n new DefaultArtifactVersion(buildInfoVersion)) < 0;\n\n // Build info version is SNAPSHOT or newer than 2.0.11 we also let Jersey do the work\n if (snapshotCondition || newVersionCondition) {\n return false;\n }\n\n // If we got here it means client is using an old build-info (<= 2.0.11) we must manually decode the http params\n return true;\n }", "public static String m21397c(Context context) {\n if (TextUtils.isEmpty(f16892c)) {\n try {\n f16892c = VERSION.SDK_INT >= 17 ? WebSettings.getDefaultUserAgent(context) : m21385a();\n } catch (Throwable unused) {\n f16892c = m21385a();\n }\n }\n return f16892c;\n }", "String getBrowser();", "public static native boolean nativeIsGoogleHomePageUrl(String url);", "public Builder setUserAgentName(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n userAgentName_ = value;\n onChanged();\n return this;\n }", "public boolean checkUsername(String user) {\n\n }", "public void userIsOnHomePage(){\n\n assertURL(\"\\\"https://demo.nopcommerce.com/\\\" \");\n }", "private void checkAuthXMain() {\n val auth = config.getString(\"authXMain\");\n\n checkArgument(auth.length() > 10, \"auth string (x-main) length is less than or equal to 10!\");\n }", "public interface WebsiteDetector {\n Boolean detect( String htmlBody );\n}", "static boolean m61440a(String str) {\n if (str == null) {\n return false;\n }\n String[] split = str.split(\" \", 2);\n if (\"CACHE\".equals(split[0])) {\n return true;\n }\n if (split.length == 1) {\n return false;\n }\n try {\n if (!\"CONDITIONAL_CACHE\".equals(split[0]) || Integer.parseInt(split[1]) != 304) {\n return false;\n }\n return true;\n } catch (NumberFormatException unused) {\n return false;\n }\n }", "private boolean checkemail(String s) {\n\t\tboolean flag = false;\r\n\t\tString[] m = s.split(\"@\");\r\n\t\tif (m.length < 2) {\r\n\t\t\tflag = true;\r\n\t\t}\r\n\t\treturn flag;\r\n\t}", "@Test\n\t\tvoid WithoutSpace_CheckForValidationForMobile_RetrunFalse() {\n\t\t\tboolean result = ValidateUserDetails.validateMobile(\"919874563214\");\n\t\t\tAssertions.assertFalse(result);\n\t\t}", "@AnonymousAllowed\n private boolean checkUPMVersion() {\n boolean result = false;\n Plugin plugin = pluginAccessor\n .getPlugin(\"com.atlassian.upm.atlassian-universal-plugin-manager-plugin\");\n if (plugin == null) {\n result = false;\n } else {\n Version upmVersion = Versions.fromPlugin(plugin, false);\n String upmVersion_str = upmVersion.toString();\n StringTokenizer st = new StringTokenizer(upmVersion_str, \".\");\n int first_index = Integer.parseInt((String) st.nextElement());\n if (first_index >= 2) {\n result = true;\n }\n }\n return result;\n }", "private static boolean validateAge(String age) {\n return true;\n\n }", "public UserAgentHeaderInterceptor(String userAgent)\n {\n super(HEADER_NAME, userAgent);\n }", "@Override\n\tpublic void setUserAgent(java.lang.String userAgent) {\n\t\t_userTracker.setUserAgent(userAgent);\n\t}", "private Boolean isValidUsername(String username){\n return (username != null) && (username.length() >= 5 && username.length() <= 16);\n }", "private void checkOperatingSystem()\n throws MojoExecutionException\n {\n final PtOperatingSystem opSystem = PtUserSniffer.getOS();\n final boolean isProperOpSystem = opSystem == PtOperatingSystem.MAC;\n\n this.logger.info( \"Checking operating system '\" + opSystem + \"' ... \" + ( isProperOpSystem ? \"ok\" : \"error\" ) );\n if ( isProperOpSystem == false )\n {\n throw new MojoExecutionException( \"Invalid Operating System '\" + opSystem + \"' (Mac OS X required)!\" );\n }\n }", "private static boolean shouldInclude(String text) {\n if (text.startsWith(\"RT @\")) return false;\n else if (text.contains(\"https://\") || text.contains(\"http://\")) return false;\n else if (endsWithNumber.matcher(text).find()) return false;\n\n return true;\n }", "private void checkAuthSessionToken() {\n val auth = config.getString(\"authSessionToken\");\n\n checkArgument(auth.length() > 10, \"auth string (sessionToken) length is less than or equal to 10!\");\n }", "public final GetHTTP setUserAgent(final String userAgent) {\n properties.put(USER_AGENT_PROPERTY, userAgent);\n return this;\n }", "public static boolean m16888b(String str) {\n if (str.startsWith(\"tel:\") || str.startsWith(\"voicemail:\") || str.startsWith(\"sms:\") || str.startsWith(\"mailto:\") || str.startsWith(\"geo:\") || str.startsWith(\"google.streetview:\")) {\n return true;\n }\n try {\n new URL(str);\n return false;\n } catch (MalformedURLException e) {\n StringBuilder sb = new StringBuilder(\"Failed to open Url: \");\n sb.append(str);\n IAlog.m18023d(sb.toString());\n return true;\n }\n }", "@Test\n\tpublic void testDesktopNonIphone()\n\t{\n\n\t\tfor (final String ua : desktop_ua)\n\t\t{\n\t\t\tLOG.info(\"Testing :\" + ua);\n\t\t\tassertTrue(\"Api fails to identify as a desktop device: (\" + ua + \")\", detectionService.isDesktop(ua));\n\t\t\tassertFalse(\"Api wrongly identify as a iphone: (\" + ua + \")\", detectionService.isiPhoneCapable(ua,\n\t\t\t\t\tnew ArrayList<String>()));\n\t\t\tassertFalse(\"Api wrongly identify as a mobile device: (\" + ua + \")\", detectionService.isMobileDevice(ua));\n\t\t}\n\n\t}", "private void findOsVersion() {\n\t\tisGBOrLower = AppUtility.isAndroidGBOrLower();\n\t\tisICSOrHigher = AppUtility.isAndroidICSOrHigher();\n\t}", "public interface UserAgent {\n\n// csci4311.chat.CLIUserAgent, which\n// implements\n// the\n// csci4311.chat.UserAgent\n// interface,\n\n// The csci4311.chat.CLIUserAgent class must only implement user interaction, and no\n// protocol details.\n\n //No protocol details\n// public void startReadWriteOperation();\n\n public void packetReceiver(Socket socket);\n public void packetSender(Socket socket,String clientName);\n\n}", "private static boolean valid(String arg) {\n\n /* check if valid option */\n if ( arg.equals(\"-v\") || arg.equals(\"-i\") || arg.equals(\"-p\") || arg.equals(\"-h\") )\n return true;\n\n /* check if valid port */\n try {\n int port = Integer.parseInt(arg);\n if ( ( 0 < port ) && ( port < 65354 ) )\n return true;\n } catch (NumberFormatException ignored) {}\n\n /* check if valid ip address */\n String[] ips = arg.split(\"\\\\.\");\n if ( ips.length != 4 )\n return false;\n try{\n for (int i=0; i<4; i++){\n int ip = Integer.parseInt(ips[i]);\n if ( ( ip < 0) || (255 < ip ) )\n return false;\n }\n } catch (NumberFormatException ignored) {return false;}\n\n return true;\n }", "@Override\n\tpublic boolean match(Request request) {\n\t\tString header = request.getHeader(HEADER_AUTHORIZATION);\n\t\treturn (header != null)\n\t\t\t&& (Pattern.matches(\"^\\\\s*(OAuth|Bearer)(.*)$\", header));\n\t}", "public void Verify_Expected_Header_Visibility()\r\n\t{\r\n\t\tString Runtime_Header_text=Page_header.getText();\r\n\t\tif(Runtime_Header_text.equals(Exp_page_header))\r\n\t\t\tSystem.out.println(\"Expected Header visible at webpage\");\r\n\t\telse\r\n\t\t\tSystem.out.println(\"Expected Header not visible at webpage\");\r\n\t}", "boolean isSite271(String url) {\n if (url.startsWith(\"http://pay.88vipbet.com/onlinePay\")) {\r\n return true;\r\n }\r\n return false;\r\n }", "private boolean checkSiteVisited(String url)\r\n\t{\r\n\t\tfor (int i = 0; i < siteVisited; i++)\r\n\t\t{\r\n\t\t\tif (webVisited[0][i].equals(url))\t\t\t//this url has been visited by user before\r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}", "@Test\n\tpublic void titlevalidation() throws IOException\n\t{\n\t\t\n\t\tLandingpage l=new Landingpage(driver);\n\t\t//compare text from the browser with the actual text\n\t\t//here comes assertion\n\t\tAssert.assertEquals(l.title().getText(),\"FEATURED COURSES\");\n\t\tlog.info(\"Compared properly\");\n\t\t\n\t}", "@Test\n public void getUserAgentStringWithExtra()\n {\n //arrange\n ProductInfo actual = new ProductInfo();\n String expectedExtra = \"some extra information\";\n actual.setExtra(expectedExtra);\n\n //act\n String actualUserAgentString = actual.getUserAgentString();\n\n //assert\n assertEquals(TransportUtils.USER_AGENT_STRING + \" \" + expectedExtra, actualUserAgentString);\n }", "public boolean isValidVCUEmail() {\r\n int atIndex = string.indexOf('@');\r\n int tagIndex = string.lastIndexOf(\"vcu.edu\");\r\n\r\n if (!string.contains(\"@\")) {\r\n return false;\r\n }\r\n if (!string.contains(\"vcu.edu\") && !string.contains(\"mymail.vcu.edu\")) {\r\n return false;\r\n }\r\n if(!string.endsWith(\"vcu.edu\")) {\r\n return false;\r\n }\r\n if (atIndex < 1) {\r\n return false;\r\n }\r\n if (tagIndex < atIndex) {\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n }" ]
[ "0.71689546", "0.6519654", "0.6286295", "0.61936563", "0.6121509", "0.6111107", "0.61019546", "0.60678947", "0.5838012", "0.5823163", "0.58209264", "0.58199704", "0.5780537", "0.57566315", "0.57512915", "0.5743594", "0.5664482", "0.5642523", "0.56274194", "0.55758977", "0.55753416", "0.55291563", "0.5512454", "0.547607", "0.5455922", "0.543832", "0.5390289", "0.5382686", "0.53635675", "0.53459334", "0.52635425", "0.5134953", "0.5094272", "0.50875294", "0.5009654", "0.4965299", "0.4948343", "0.4933744", "0.4931161", "0.48803487", "0.48782843", "0.4859955", "0.48507103", "0.48506218", "0.48239216", "0.48191798", "0.4795275", "0.4778275", "0.47698173", "0.4737154", "0.47103176", "0.4701204", "0.46969295", "0.46751767", "0.46622592", "0.46592474", "0.46514878", "0.46495152", "0.46441248", "0.46135715", "0.46063995", "0.46014446", "0.4595989", "0.4588342", "0.45771748", "0.45639083", "0.4558593", "0.45538327", "0.45520553", "0.45394146", "0.45271784", "0.4513787", "0.45097157", "0.4504135", "0.4494355", "0.4491696", "0.44874144", "0.44871777", "0.44704038", "0.44539538", "0.44503507", "0.4449293", "0.44453087", "0.44435608", "0.44269058", "0.44239262", "0.4416343", "0.44052854", "0.44026", "0.43912083", "0.4390751", "0.43826452", "0.4376118", "0.4370676", "0.43667126", "0.43644917", "0.43609336", "0.43582562", "0.4356787", "0.43542847" ]
0.7864729
0
Checks the year_deviation int
private void checkYearDeviation() { val yearDeviation = config.getInt("year_deviation"); checkArgument(yearDeviation > 0, "year_deviation is less than or equal to 0!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void isLeapYear() {\n assertFalse(Deadline.isLeapYear(Integer.parseInt(VALID_YEAR_2018)));\n\n // Valid leap year -> returns true\n assertTrue(Deadline.isLeapYear(Integer.parseInt(LEAP_YEAR_2020)));\n\n // Valid year divisible by 4 but is common year -> returns false\n assertFalse(Deadline.isLeapYear(Integer.parseInt(NON_LEAP_YEAR_2100)));\n\n // Valid year divisible by 100 but is leap year -> returns true\n assertTrue(Deadline.isLeapYear(Integer.parseInt(LEAP_YEAR_2400)));\n }", "private static Boolean checkYear(){\r\n try{\r\n int year = Integer.parseInt(yearField.getText().trim());\r\n int now = LocalDate.now().getYear();\r\n \r\n if(LocalDate.now().getMonth().compareTo(Month.SEPTEMBER) < 0){\r\n now--;\r\n }\r\n //SIS stores the schedule for last 3 years only \r\n if(year <= now && year >= now - 3 ){\r\n return true;\r\n }\r\n }\r\n catch(Exception e){\r\n Logger.getLogger(\"Year checker\").log(Level.WARNING, \"Exception while resolving the year \", e);\r\n }\r\n return false;\r\n }", "@Test\n public void leapYearIsDivisibleBy4(){\n int year = 2020;\n assertTrue(LeapYear.isLeapYear(year));\n }", "@Test\n\tpublic void testYears() {\n\t\tint birthYear = 2000;\n\t\tint deathYear = 2019;\n\t\tPlot plot = new Plot();\n\t\t\n\t\tplot.setBirthYear(2000);\n\t\tassertEquals(plot.getBirthYear(), birthYear);\n\t\tplot.setDeathYear(2019);\n\t\tassertEquals(plot.getDeathYear(), deathYear);\n\t\t\n\t\tSystem.out.println(\"Birth and Death Years were successful.\");\n\t}", "public void checkLeapYear(int year) {\r\n\t int count=1;\r\n\t int temp=year;\r\n\t\twhile(temp>10){\r\n\t\t\tint r= temp%10;\r\n\t\t\tcount++;\r\n\t\t\ttemp=temp/10;\r\n\t\t}\r\n\t\tif(count>=3){\r\n\t\t\tif(year%4==0){\r\n\t\t\t\tSystem.out.println(\"given year is leap year:\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tSystem.out.println(\"given year is not leap year:\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tSystem.out.println(\"please enter atleast 4 digit no to find leap year\");\r\n\t\t}\r\n}", "private boolean checkDivisibility(int year, int num) {\n\t\treturn (year%num==0);\n\t}", "public boolean isLeapYear(int year){\r\n if(year%4 != 0){\r\n return false;\r\n } else if(year%100 == 0){\r\n if(year%400 != 0) return false; \r\n }\r\n return true;\r\n }", "public void checkYear()\n {\n //Rat\n if (year == 1900 || year == 1912 || year == 1924 || year == 1936 || year == 1948 || year == 1960 || year == 1972 || year == 1984 || year == 1996 || year == 2008 || year == 2020)\n {System.out.println(\"Born in the year of the Rat\");}\n //Ox\n else if (year == 1901 || year == 1913 || year == 1925 || year == 1937 || year == 1949 || year == 1961 || year == 1973 || year == 1985 || year == 1997 || year == 2009 || year == 2021)\n {System.out.println(\"Born in the year of the Ox\");}\n //tiger\n else if (year == 1902 || year == 1914 || year == 1926 || year == 1938 || year == 1950 || year == 1962 || year == 1974 || year == 1986 || year == 1998 || year == 2010 || year == 2022)\n {System.out.println(\"Born in the year of the Tiger\");}\n //Hare\n else if (year == 1903 || year == 1915 || year == 1927 || year == 1939 || year == 1951 || year == 1963 || year == 1975 || year == 1987 || year == 1999 || year == 2011 || year == 2023)\n {System.out.println(\"Born in the year of the Hare/Rabbit\");}\n //Dragon\n else if (year == 1904 || year == 1916 || year == 1928 || year == 1940 || year == 1952 || year == 1964 || year == 1976 || year == 1988 || year == 2000 || year == 2012 || year == 2024)\n {System.out.println(\"Born in the year of the Dragon\");}\n //Snake\n else if (year == 1905 || year == 1917 || year == 1929 || year == 1941 || year == 1953 || year == 1965 || year == 1977 || year == 1989 || year == 2001 || year == 2012 || year == 2025)\n {System.out.println(\"Born in the year of the Snake\");}\n //Horse\n else if (year == 1906 || year == 1918 || year == 1930 || year == 1942 || year == 1954 || year == 1966 || year == 1978 || year == 1990 || year == 2002 || year == 2013 || year == 2026)\n {System.out.println(\"Born in the year of the Horse\");}\n //Ram\n else if (year == 1907 || year == 1919 || year == 1931 || year == 1943 || year == 1955 || year == 1967 || year == 1979 || year == 1991 || year == 2003 || year == 2014 || year == 2027)\n {System.out.println(\"Born in the year of the Ram\");}\n //Monkey\n else if (year == 1908 || year == 1920 || year == 1932 || year == 1944 || year == 1956 || year == 1968 || year == 1980 || year == 1992 || year == 2004 || year == 2015 || year == 2028)\n {System.out.println(\"Born in the year of the Monkey\");}\n //Rooster\n else if (year == 1909 || year == 1921 || year == 1933 || year == 1945 || year == 1957 || year == 1969 || year == 1981 || year == 1993 || year == 2005 || year == 2016 || year == 2029)\n {System.out.println(\"Born in the year of the Rooster\");}\n //Dog\n else if (year == 1910 || year == 1922 || year == 1934 || year == 1946 || year == 1958 || year == 1970 || year == 1982 || year == 1994 || year == 2006 || year == 2017 || year == 2030)\n {System.out.println(\"Born in the year of the Dog\");}\n //Pig\n else if (year == 1911 || year == 1923 || year == 1935 || year == 1947 || year == 1959 || year == 1971 || year == 1983 || year == 1995 || year == 2007 || year == 2018 || year == 2031)\n {System.out.println(\"Born in the year of the Pig\");}\n }", "public boolean LeapYearValidation(int year) {\r\n\t\tif (year >= 1582 && year <= 9999)\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\r\n\t}", "@Test\n public void isLeapYearOk(){\n assertTrue(Date.isLeapYear(2008));\n }", "private static boolean isLeapYear(int y) {\r\n\t\tif (y % 400 == 0)\r\n\t\t\treturn true;\r\n\t\tif (y % 100 == 0)\r\n\t\t\treturn false;\r\n\t\treturn (y % 4 == 0);\r\n\t}", "private static boolean isLeapYear(int year)\n\t{\n \t if ((year % 4 == 0) && (year % 100 != 0)) return true;\n\t\t if (year % 400 == 0) return true;\n\t\t return true;\n }", "public void leapYear() {\n System.out.print(\"\\nEnter a year: \");\n long year = in.nextLong();\n if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n System.out.println(\"\\n\" + year + \" is a leap year.\\n\");\n } else {\n System.out.println(\"\\n\" + year + \" is not a leap year.\\n\");\n }\n }", "private static boolean isLeapYear(int y) {\n\t\t\tif (y % 400 == 0) return true;\n\t\t\tif (y % 100 == 0) return false;\n\t\t\treturn y % 4 == 0;\n\t\t}", "boolean isLeapYear(int year){\n\tif (year % 400 == 0)\n\t\treturn true;\n\telse if (year % 100 == 0)\n\t\treturn false;\n\telse if (year % 4 == 0)\n\t\treturn true;\n\telse\n\t\treturn false;\n }", "public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n\n //take input from user and store into year variable\n System.out.printf(\"Enter a year: \");\n int year = input.nextInt();\n\n /*\n Condition:\n The year is evenly divisible by 4;\n If the year can be evenly divided by 100, it is NOT a leap year, unless;\n The year is also evenly divisible by 400. Then it is a leap year.\n */\n\n if( year%4 == 0){\n if (year%100 == 0){\n if (year%400 == 0){\n System.out.println(year + \" is leap year\");\n } else {\n System.out.println(year+\" is not leap year\");\n }\n }\n else {\n System.out.println(year + \" is leap year\");\n }\n } else {\n System.out.println(year+ \" is not leap year\");\n }\n\n\n }", "private static boolean isLeapYear(int year)\n\t{\n\t\treturn ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);\n\t}", "private boolean isDivisibleBy400(int year) {\n\t\treturn checkDivisibility(year, 400);\n\t}", "public boolean isDate (int year, int doy)\n {\n return ((year >= FIRST_YEAR)\n && (1 <= doy && doy <= getLengthOfYear (year)));\n }", "private static boolean isLeapYear(int y) {\n if (y % 400 == 0) return true;\n if (y % 100 == 0) return false;\n return y % 4 == 0;\n }", "private static boolean isLeapYear(int year) {\n return year % 400 == 0 || (year % 100 != 0 && year % 4 == 0);\n }", "public static boolean isLeapYear(int year){\n if(year%100==0){\n if(year%400==0){\n return true;\n }\n else{\n return false;\n }\n }\n else{\n if(year%4==0){\n return true;\n }\n else{\n return false;\n }\n }\n }", "public static boolean isLeapYear(int year) {\n if(year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)){\n return true;\n } \n else{\n return false; \n } \n }", "public static boolean isLeapYear(int year){\n\t\t\r\n\t\tif ((year%4==0&&year%100!=0)||(year%400==0)){\t\t\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public boolean isLeapYear(){\n\t if (((this.year % 4 == 0) && (this.year % 100 != 0)) || (this.year %400 == 0))\n\t return true;\n\treturn false;\n }", "@Test\n\tpublic void parseDateTextFieldYearTest() {\n\t\tassertEquals(2016,\n\t\t\t\tInteger.parseInt(textFieldDate.getText().substring(0, 4)));\n\t}", "private boolean isDivisibleBy4(int year) {\n\t\treturn checkDivisibility(year,4);\n\t}", "public abstract String reportLeapYear(int year);", "@Test\n public void testconvertDateYearsLongueurPasValide() {\n FieldVerifier projet = new FieldVerifier();\n boolean longueurInvalideTest = projet.isValidDate(\"01/05/102\");\n assertEquals(false, longueurInvalideTest);\n }", "@Test\n public void checkLeapYearCriteria() {\n LeapYear leapYear = new LeapYear();\n boolean flag = leapYear.isItLeapYear(1600);\n assertTrue(flag);\n }", "private boolean leapyear(int yr){\n if(yr%4 == 0 && yr%100 != 0){ //If year is divisible by 4 but not by 100\r\n days[1] = 29; //Set February's days to 29\r\n return true; //Retrn true.\r\n }\r\n return false; //Otherwise, return false.\r\n }", "public void setYear(int year) throws InvalidDateException {\r\n\t\tif (year <= 2100 & year >= 2000) {\r\n\t\t\tthis.year = year;\r\n\t\t} else {\r\n\t\t\tthrow new InvalidDateException(\"Please enter a realistic year for the date (between 2000 and 2100) !\");\r\n\t\t}\r\n\t}", "private int restrictYear(Message msg, String parameter, int section) {\n int[] years = setYearRestriction(msg, parameter, section);\n\n if (years[0] == ERROR_CODE[0]) {\n return -1;\n }\n\n yearRestriction = true;\n lowerYear = years[0];\n upperYear = years[1];\n return 0;\n }", "public static boolean isLeap (int year) {\r\n\t\tif ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0)) // uslov za prestupnu godinu\r\n\t\t\treturn true;\r\n\t\telse return false;\r\n\t}", "public boolean isALeapYear(int year){\n\n if (((year%4 == 0) && (year%100!=0)) || (year%400==0)){\n return true;\n }\n return false;\n }", "@Test\n public void test6() {\n boolean res = object.checkLeapYear(-400);\n assertEquals(false, res);\n }", "public static boolean leapYear(int year)\n\t{\n\t\tif(year<999 || year>9999) \n\t\t{\n\t\t\tSystem.out.println(\"Enter valid year\");\n\t\t}\n\t\t\n\t\tif(year%400==0 || year%4==0 && year%100!=0) \n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse \n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "@Test(expected = IllegalArgumentException.class)\r\n public void testIncorrectYear() {\r\n SimpleDate d1 = new SimpleDate(\"3/1/1700\");\r\n }", "protected static final boolean is_leap_year_gregorian (int year)\n {\n // Algorithm: Kernighan & Richie,\n // \"The C Programming Language\", 1st edition (1978), p. 37.\n //\n return (year % 4 == 0 && year % 100 != 0 || year % 400 == 0);\n }", "public static int cleanReleaseYear(Literal year) {\n String yearString;\n int yearInt = 0;\n if(year == null || \"\".equals(year.toString())) {\n yearString = \"0\";\n } else {\n yearString = year.toString();\n }\n Pattern p = Pattern.compile(\"\\\\d\\\\d\\\\d\\\\d\");\n Matcher m = p.matcher(yearString);\n if(m.find()) {\n yearString = m.group();\n yearInt = Integer.parseInt(yearString);\n }\n return yearInt;\n }", "private static int getDaysInYear(final int year) {\n return LocalDate.ofYearDay(year, 1).lengthOfYear();\n }", "@Test\n public void test7() {\n boolean res = object.checkLeapYear(1900);\n assertEquals(false, res);\n }", "public static void yearOfCar() {\n System.out.println(\"What is the year of your car? Please input the 2-digit number. \");\n int carYear = sc.nextInt(); \n if (carYear>99) {\n System.out.println(\"Invalid input. Please enter 2 digit number for your car year\");\n for(int i=0; i<10; i++) {\n carYear = sc.nextInt(); \n }\n }\n }", "public boolean isLeap(int year) {\n\n if (year % 4 == 0) {\n if (year % 100 == 0) {\n if (year % 400 == 0) {\n return true;\n } else {\n return false;\n }\n\n } else\n return true;\n } else {\n return false;\n }\n\n }", "public boolean setYear(int newYear) {\n\t\tthis.year = newYear;\n\t\tdeltatIsValid = false;\n\t\tthis.jd = swe_julday(this.year, this.month, this.day, this.hour, this.calType); // ->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// erzeugt\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// JD\n\t\treturn true;\n\t}", "@Test\n public void testSpecificYear() {\n context = new MockServletContext();\n context.setInitParameter(ConfigService.MESHRDF_YEAR, \"2018\");\n context.setInitParameter(ConfigService.MESHRDF_INTERIM, \"true\");\n configService = new ConfigServiceImpl(context);\n\n ValidYears years = configService.getValidYears();\n\n assertThat(years.getCurrent(), equalTo(2018));\n assertThat(years.getInterim(), equalTo(2019));\n }", "public void setYear(int _year) { year = _year; }", "public void setYear(int value) {\r\n this.year = value;\r\n }", "@Property\n void centurialNonLeapYearTest(@ForAll(\"centurialNonLeapYears\") int year){\n assertThat(!ly.isLeapYear(year));\n }", "public static boolean esAnoBisiesto(int year) {\r\n\t\t assert year >= 1583; // not valid before this date.\r\n\t\t return ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);\r\n\t}", "@Test\n public void test1() {\n boolean res = object.checkLeapYear(0);\n assertEquals(false, res);\n }", "public void setYear(short value) {\n this.year = value;\n }", "@Override\n protected boolean isLeapYear(int persianYear) {\n return ((((((persianYear - ((persianYear > 0) ? 474 : 473)) % 2820) + 474) + 38) * 682) % 2816) < 682;\n }", "@Property\n void nonCenturialLeapYearTest(@ForAll(\"nonCenturialLeapYears\") int year){\n assertThat(ly.isLeapYear(year));\n }", "public void setYear(int year){\r\n\t\ttry{\r\n\t\t\tif(year>=1900)\r\n\t\t\tthis.year = year;\r\n\t\t\telse\r\n\t\t\t\tthrow new cardYearException();\r\n\t\t}catch(cardYearException ex){\r\n\t\t\tSystem.out.println(\"Baseball Cards weren't invented \"\r\n\t\t\t\t\t+ \"before 1900!\");\r\n\t\t\tSystem.out.print(\"Please enter a valid year: \");\r\n\t\t\t\tScanner input = new Scanner(System.in);\r\n\t\t\t\tint retry = input.nextInt();\r\n\t\t\t\tsetYear(retry);\r\n\t\t}\r\n\t}", "private boolean isDivisibleBy100(int year) {\n\t\treturn checkDivisibility(year, 100);\n\t}", "public void Leapyear(int YearToCheck) {\n\n boolean leapValue = false;\n\n if (((YearToCheck % 4 == 0) && (YearToCheck % 100 != 0)) || (YearToCheck % 400 == 0)){\n leapValue=true;}\n\n if (leapValue)\n System.out.println(YearToCheck + \" is a leap year.\");\n else\n System.out.println(YearToCheck + \" is not a leap year.\");\n }", "public void setYear (int yr) {\n year = yr;\n }", "public static boolean isLeapYear(int year) {\n\t\t// Calendar cal = Calendar.getInstance();\n\t\t// if (cal.YEAR % 4 == 0)\n\t\tif (year % 100 != 0 || year % 400 == 0) {\n\t\t\tif (year % 4 == 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public int yearsSinceDebut(int debutYear)\n {\n int year = Calendar.getInstance().get(Calendar.YEAR);\n return year - debutYear;\n }", "public void setYear(short value) {\n this.year = value;\n }", "private boolean leap(int year) {\n\t\tif (!(year % 4 == 0)) {\n\t\t\treturn false;\n\t\t} else if (!(year % 100 == 0)) {\n\t\t\treturn true;\n\t\t} else if (!(year % 400 == 0)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public boolean Leap_Gregorian(double year)\n {\n return ((year % 4) == 0) && (!(((year % 100) == 0) && ((year % 400) != 0)));\n }", "public boolean isLeapYear() {\n\n return ((this.cyear % 4) == 3);\n\n }", "public boolean leapYear(int year) {\r\n\r\n\t\tif (year % 4 == 0 || year % 400 == 0 && year % 100 != 0) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t}", "public void setYear(short value) {\n this.year = value;\n }", "public void setYear(short value) {\n this.year = value;\n }", "public void setYear(short value) {\n this.year = value;\n }", "@Property\n void nonCenturialNonLeapyearTest(@ForAll(\"nonCenturialNonLeapyears\") int year){\n assertThat(!ly.isLeapYear(year));\n }", "public void setYear(int value) {\n\tthis.year = value;\n }", "public void setYear(Integer year) {\r\n this.year = year;\r\n }", "public void setYear(Integer year) {\r\n this.year = year;\r\n }", "public void setYear(Integer year) {\n this.year = year;\n }", "public void setYear(Integer year) {\n this.year = year;\n }", "public void setYear(Integer year) {\n this.year = year;\n }", "public void setYear(int year) {\r\n this.year = year;\r\n }", "@Test\n public void checkDivisibilityByFour() {\n LeapYear leapYear = new LeapYear();\n boolean flag = leapYear.isItDivisibleByFour(1600);\n assertTrue(flag);\n }", "protected static String goodSearchYear(String YearCheck) throws Exception\n {\n String[] Year;\n try{\n Year = YearCheck.split(\"\\\\s+\");\n if (Year.length > 1 /*|| ID[0].equals(\"\")*/) {\n throw new Exception(\"ERROR: The Year must be 1 word only\\n\");\n }\n if (!(Year[0].equals(\"\")) && Year[0].length() !=4){\n throw new Exception(\"ERROR: Year entered but it is not 4 digits\");\n }\n if (!(Year[0].matches(\"[0-9]+\"))) {\n throw new Exception(\"ERROR: Year must only contain numbers\");\n }\n return Year[0];\n } catch (Exception e){\n throw new Exception(e.getMessage());\n }\n }", "public void setYear(int year) {\n this.year = year;\n }", "int getYear();", "public boolean isLeapYear(int year) {\n\t\tboolean isALeapYear = year % 400 == 0 || year % 4 == 0 && year % 100 != 0;\n\t\treturn isALeapYear;\n\t}", "public void setYear(int year)\r\n\t{\r\n\t\tthis.year = year;\r\n\t}", "public void setYear(int year)\n {\n this.year = year;\n }", "public void setYear(short value) {\r\n this.year = value;\r\n }", "public void setYear(short value) {\n this.year = value;\n }", "public static boolean isLeap (int yyyy)\n {\n // if you change this code, make sure you make corresponding changes to\n // jan01OfYear, toGregorian, MondayIsZeroAdjustment, SundayIsZeroAdjustment,\n // AD_epochAdjustment and BC_epochAdjustment\n // yyyy & 3 is a fast way of saying yyyy % 4\n if ( yyyy < Leap100RuleYYYY )\n if ( yyyy < 0 )\n {\n return((yyyy + 1) & 3) == 0;\n }\n else\n {\n return(yyyy & 3) == 0;\n }\n if ( (yyyy & 3) != 0 ) return false;\n if ( yyyy % 100 != 0 ) return true;\n if ( yyyy < Leap400RuleYYYY ) return false;\n if ( yyyy % 400 != 0 ) return false;\n return true;\n }", "protected void checkMappingReleaseYear(RecordUrlData record) {\n checkMainMapping(record, RECORD_FACTORY.getMappingReleaseYear(record));\n }", "public static boolean isLeapYear(int year)\n\t{\n\t\tif(year < 0)\n\t\t\treturn false;\n\t\tif(year % 400 == 0)\n\t\t\treturn true;\n\t\tif(year % 100 != 0 && year % 4 == 0)\n\t\t\treturn true;\n\t\treturn false;\n\t}", "public void setYear(int year) \n\t{\n\t\tthis.year = year;\n\t}", "public boolean setYear(int value) {\r\n if (!FormatUtils.uint16RangeCheck(value)) {\r\n return false;\r\n }\r\n mYear = FormatUtils.intToUint16(value);\r\n updateGattCharacteristic();\r\n return true;\r\n }", "public static boolean getLeapYear() {\n boolean tag = false;\n Date date = new Date();\n SimpleDateFormat df = new SimpleDateFormat(\"yyyy\");\n String dt = df.format(date);\n int pastYear = Integer.parseInt(dt) - 1;\n if (pastYear % 4 == 0 && (pastYear % 100 != 0 || pastYear % 400 == 0)) tag = true;\n return tag;\n }", "@Test\n public void isNumeric() {\n assertTrue(Deadline.isNumeric(VALID_YEAR_2018));\n\n //contains other symbols -> false\n assertFalse(Deadline.isNumeric(INVALID_YEAR_WITH_SYMBOLS));\n\n //contains alphabets -> false\n assertFalse(Deadline.isNumeric(INVALID_YEAR_WITH_ALPHABETS));\n\n //contains space -> false\n assertFalse(Deadline.isNumeric(INVALID_YEAR_WITH_SPACE));\n }", "public void setYear(String year) {\n this.year = year;\n }", "public void setYear(String year) {\n this.year = year;\n }", "public void testGetYear()\r\n {\r\n assertTrue(year.equals(song.getYear()));\r\n }", "@Test\n public void checkDivisibilityByFourHundred() {\n LeapYear leapYear = new LeapYear();\n boolean flag = leapYear.isItDivisibleByFourHundred(1600);\n assertTrue(flag);\n }", "private boolean exceedRange(int year) {\n\t\tboolean exceeds = false;\n\t\tint currentYear = Calendar.getInstance().get(Calendar.YEAR);\n\t\tint upperRange = currentYear + RANGE_LIMIT;\n\t\tint lowerRange = currentYear - RANGE_LIMIT;\n\t\t\n\t\tif(year < lowerRange || year > upperRange){\n\t\t\texceeds = true;\n\t\t}\n\t\treturn exceeds;\n\t}", "private boolean isValidPeriod(int period) {\r\n\t\treturn (period > 0 && period < 366); \r\n\t}", "public void setYear(int year) {\n\t\tthis.year = year;\n\t}", "public void setYear(int year) {\n\t\tthis.year = year;\n\t}" ]
[ "0.6825966", "0.66212696", "0.65100545", "0.64896494", "0.64846843", "0.6484369", "0.645032", "0.6436598", "0.6427734", "0.6375611", "0.6351741", "0.63369745", "0.6331127", "0.63286763", "0.63221705", "0.63217956", "0.63196933", "0.6318459", "0.6303136", "0.63008064", "0.6267895", "0.62469006", "0.6231639", "0.62193143", "0.6208536", "0.62016946", "0.61993396", "0.6197514", "0.6194319", "0.6181727", "0.6178462", "0.61685115", "0.61630255", "0.61534065", "0.6150104", "0.6141512", "0.61306363", "0.61133635", "0.6093398", "0.60928965", "0.60779864", "0.6065155", "0.6060082", "0.6059465", "0.6055902", "0.6025949", "0.6025706", "0.60177916", "0.6005818", "0.5997288", "0.59886324", "0.5987793", "0.5987492", "0.5985231", "0.598208", "0.5977183", "0.59549105", "0.5952917", "0.59515226", "0.5946236", "0.5941712", "0.59393895", "0.5939087", "0.5930185", "0.5929766", "0.5912657", "0.5912657", "0.5912657", "0.5907625", "0.59058505", "0.58767116", "0.58767116", "0.5869648", "0.5869648", "0.5869648", "0.5866523", "0.5861144", "0.58506155", "0.58464766", "0.5844412", "0.58294326", "0.58075875", "0.58067954", "0.5806182", "0.57931525", "0.5772272", "0.57597333", "0.5751571", "0.5749706", "0.57399005", "0.57374114", "0.57325", "0.5721893", "0.5721893", "0.5713659", "0.5705523", "0.57042634", "0.5700588", "0.5697725", "0.5697725" ]
0.8691367
0
Checks the timeout int
private void checkTimeout() { val timeout = config.getInt("timeout"); checkArgument(timeout >= 1000, "timeout is less than 1000!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void isTimeout(long ms);", "private void checkTimeout() {\n/* 169 */ if (this.socket != null) {\n/* */ \n/* 171 */ long i = this.keepaliveTimeoutMs;\n/* */ \n/* 173 */ if (this.listRequests.size() > 0)\n/* */ {\n/* 175 */ i = 5000L;\n/* */ }\n/* */ \n/* 178 */ long j = System.currentTimeMillis();\n/* */ \n/* 180 */ if (j > this.timeLastActivityMs + i)\n/* */ {\n/* 182 */ terminate(new InterruptedException(\"Timeout \" + i));\n/* */ }\n/* */ } \n/* */ }", "int getTimeout();", "long getTimeout();", "public boolean checkTimeout(){\n\t\tif((System.currentTimeMillis()-this.activeTime.getTime())/1000 >= this.expire){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public int getTimeout();", "public long timeout(long timeout);", "int timeout();", "public void checkTime() throws InterruptedByTimeoutException\n {\n if (System.currentTimeMillis() - this.start > TIME)\n throw new InterruptedByTimeoutException();\n }", "int hardTimeout();", "public void handleTimeout();", "public FormValidation doCheckLaunchTimeout(@QueryParameter String launchTimeout) {\n try {\n Integer num = Integer.valueOf(launchTimeout);\n if (num >= 0) {\n return FormValidation.ok();\n }\n } catch (Exception e) {\n return FormValidation.error(\"Timeout should be a valid number \");\n }\n return FormValidation.ok();\n }", "@Test\r\n void timeoutNotExceeded() {\n assertTimeout(ofMinutes(2), () -> {\r\n // Perform task that takes less than 2 minutes.\r\n });\r\n }", "public long GetTimeout() { return timeout; }", "public boolean setTimeout(int timeout) {\n try {\n mTimeout = timeout;\n return true;\n } catch (Exception ex) {\n return false;\n }\n }", "public int getTimeOut()\r\n\t{\r\n\t\tString time = JOptionPane.showInputDialog(null, \"Please enter the timeout amount in milliseconds: \", \"Set Timeout\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t//Check to see if the entry was invalid\r\n\t\twhile(!isNumber(time))\r\n\t\t\ttime = JOptionPane.showInputDialog(null, \"You must enter a NUMBER. Please re-enter the timeout time in milliseconds: \", \"Set Timeout\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t\r\n\t\treturn Integer.parseInt(time);\r\n\t}", "boolean timedOut() {\n\treturn timedOut;\n }", "public void onTimeout();", "public long getTimeout() { return timeout; }", "void handleTimeoutTask();", "public int getTimeout() {\r\n return timeout;\r\n }", "public int getNortpTimeout();", "public abstract void onTimeout();", "boolean hasWaitTime();", "public LWTRTPdu timeout() throws IncorrectTransitionException;", "public int getTimeout() {\n return timeout;\n }", "boolean isQueryTimeout(Exception e);", "protected void onTimeout() {\n }", "void timedOut();", "@Override\r\n\t\tpublic boolean isValid(int timeout) throws SQLException {\n\t\t\treturn false;\r\n\t\t}", "public boolean isTimedOut() {\n\t\treturn timedOut.get();\n\t}", "private void setTimedOut() {\n\t\tthis.timedOut.set(true);\n\t}", "public int sendTimeout(){\n return 0; //TODO codavaj!!\n }", "Integer getStartTimeout();", "public int getTimeout() {\n\t\treturn (Integer)getObject(\"timeout\");\n\t}", "boolean hasResponseTimeNsec();", "@Test\r\n void timeoutNotExceededWithResult() {\n String actualResult = assertTimeout(ofMinutes(2), () -> {\r\n return \"a result\";\r\n });\r\n assertEquals(\"a result\", actualResult);\r\n }", "public void setCheckTimeout(long checkTimeout) {\n this.checkTimeout = checkTimeout;\n }", "public void setTimeout(int _timeout) {\n if (timeout < 0)\n return;\n timeout = _timeout;\n }", "public int getInCallTimeout();", "public int getDelayedTimeout();", "public int getTimeout() {\n return params.getTimeout() * 1000;\n }", "protected int maxTimeout() { return 15*1000*1000; }", "public void setTimeout(int timeout);", "public int explicitWait(){\n\t\tString time_out = null;\n\t\ttry {\n\t\t\ttime_out = new AutomationConfigurator().getTimeOut();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tif (time_out == null){\n\t\t\treturn default_timeout;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn Integer.parseInt(time_out);\n\t\t}\n\t}", "private boolean checkTime(){\n\t\treturn false;\r\n\t}", "boolean hasErrorTime();", "public static int getTimeOut() {\n\t\tTIME_OUT = 10;\n\t\treturn TIME_OUT;\n\t}", "private boolean durationValidation(int duration){\n return duration < 300 && duration >10;\n }", "protected void pktTimeout() {}", "@Override\n public boolean isValid(int timeout) throws SQLException {\n log.debug(() -> logEntry(\"isValid (%d)\", timeout));\n\n boolean isValid = true;\n\n log.debug(() -> logExit(\"isValid\", isValid));\n return isValid;\n }", "protected int minTimeout() { return 500; }", "Future timeoutIn(long timeout, TimeUnit timeUnit);", "private static void timeout(String user, int time) { sendMessage(\"/timeout \" + user + \" \" + time); }", "@Override\n protected void checkCanceled() {\n long l = System.currentTimeMillis();\n if (l >= myTime) {\n throw new ProcessCanceledException();\n }\n }", "final Long getTimeoutValue()\n/* */ {\n/* 137 */ return this.timeout;\n/* */ }", "T setStartTimeout(Integer timeout);", "public int getHardwareTimeout();", "@Test\r\n public void testSetTimeout() {\r\n // Not required\r\n }", "public void setTimeout(int timeout) {\r\n this.timeout = timeout;\r\n }", "private boolean timeout() {\n long time = SystemClock.currentThreadTimeMillis();\n while (bluetoothSync.getState() != BluetoothSync.STATE_CONNECTED) {\n if (SystemClock.currentThreadTimeMillis() > time + Constants.Bluetooth.CONNECTION_TIMEOUT) {\n return false;\n }\n }\n return true;\n }", "@Override\n public boolean isValid(int timeout) throws SQLException\n {\n return !isClosed;\n }", "@Test\n public void testLongTimeout() throws Exception {\n final int expectedTimeoutInSeconds = ((30 * 24) * 60) * 60;// 30 days.\n\n final long expectedLongValue = expectedTimeoutInSeconds * 1000L;\n Capture<Integer> capturedInt = new Capture<Integer>();\n // use a capture to make sure the setter is doing the right thing.\n mockSession.setMaxInactiveInterval(captureInt(capturedInt));\n expect(mockSession.getMaxInactiveInterval()).andReturn(expectedTimeoutInSeconds);\n replay(mockSession);\n HttpServletSession servletSession = new HttpServletSession(mockSession, null);\n servletSession.setTimeout(expectedLongValue);\n long timeoutInMilliseconds = servletSession.getTimeout();\n Assert.assertEquals(expectedLongValue, timeoutInMilliseconds);\n Assert.assertEquals(expectedTimeoutInSeconds, capturedInt.getValue().intValue());\n }", "public long getTimeout() {\n return timeout;\n }", "public long getTimeout() {\n return timeout;\n }", "public long getTimeout() {\n return timeout;\n }", "static interface TimeoutHandler {\n\n\t/**\n\t * Perform an action required for a timeout.\n\t */\n\tpublic void handleTimeout();\n }", "public void requestTimeout(Pdu packet);", "private static void checkTimeoutAndRetry() {\n while (true) {\n for (ServerAckWindow window : windowsMap.values()) {\n window.responseCollectorMap.entrySet().stream()\n .filter(entry -> window.timeout(entry.getValue()))\n .forEach(entry -> window.retry(entry.getKey(), entry.getValue()));\n }\n }\n }", "@Override\n public void onTimeout(TimeValue timeout) {\n run();\n }", "public void setTimeOut(int value) {\n this.timeOut = value;\n }", "long getInvalidLoginLockoutTime();", "public boolean hasStopped(int attempts, long timeout, TimeUnit timeUnit) {\n try {\n HttpResponse httpResponse = sendRequest(request().withMethod(\"PUT\").withPath(calculatePath(\"status\")), true, false);\n if (httpResponse != null && httpResponse.getStatusCode() == HttpStatusCode.OK_200.code()) {\n if (attempts <= 0) {\n return false;\n } else {\n try {\n timeUnit.sleep(timeout);\n } catch (InterruptedException e) {\n // ignore interrupted exception\n }\n return hasStopped(attempts - 1, timeout, timeUnit);\n }\n } else {\n return true;\n }\n } catch (SocketConnectionException | IllegalStateException sce) {\n return true;\n }\n }", "protected void touchTimeoutCounter()\n\t{\n\t this.lastAccessTime = System.currentTimeMillis();\n\t thread.interrupt ();\n\t}", "public int getIncTimeout();", "boolean hasSolverTimeLimitSeconds();", "public void onTimeout(Runnable callback)\n/* */ {\n/* 148 */ this.timeoutCallback = callback;\n/* */ }", "public void setTimeout(Integer timeout) {\n\t\tthis.timeout = timeout;\n\t}", "public void check(int time)\n {\n if(time < 0)\n {\n throw new IllegalArgumentException();\n }\n }", "boolean hasResponseTimeSec();", "public void setTimeout(int timeout) {\n this.timeout = timeout;\n }", "public void acceptTimeout();", "public boolean isOverTimeout(long now, long timeoutNS) {\n\t\tfinal long local = beginNS;\n\t\treturn (local==0) ? false : local+timeoutNS>now;\t\t\n\t}", "public void setTimeout( int timeout ) {\n this.timeout = timeout;\n }", "void setTimeout(@Nullable Duration timeout);", "public TestTimeout getTimeout() {\n return timeout;\n }", "public int connectTimeout(){\n return 0; //TODO codavaj!!\n }", "@Override\n public void run() {\n time_ = (int) (System.currentTimeMillis() - startTime_) / 1000;\n updateUI();\n\n if (time_ >= maxTime_) {\n // Log.v(VUphone.tag, \"TimerTask.run() entering timeout\");\n handler_.post(new Runnable() {\n public void run() {\n report(true);\n }\n });\n }\n }", "public abstract void isCancel(long ms);", "@Override\r\n public long getTimeouts()\r\n {\n return 0;\r\n }", "public void setTimeout(int timeout) {\r\n\t\tthis.TIMEOUT = timeout;\r\n\t}", "public void setTimeout(double timeout){\n this.timeout = timeout;\n }", "public boolean isTimeUp(long startTime){\r\n\t\tlong diff = System.currentTimeMillis() - startTime;\r\n\t\treturn diff/(1000 * 60)%60 > TIMEOUT_IN_MINUTES;\r\n\t}", "public int receiveTimeout(){\n return 0; //TODO codavaj!!\n }", "public int getTimeOut() {\n return timeOut;\n }", "int getExpireTimeout();", "public boolean shouldRetryOnTimeout() {\r\n return configuration.shouldRetryOnTimeout();\r\n }", "public boolean isTimeoutEnabled() {\n return timeoutEnabled;\n }", "public void enquireTimeout(Long sessionId);", "@Test\n public void orgApacheFelixEventadminTimeoutTest() {\n // TODO: test orgApacheFelixEventadminTimeout\n }" ]
[ "0.79481643", "0.7419109", "0.7151549", "0.7090888", "0.70721304", "0.70225406", "0.69848764", "0.6828901", "0.68051845", "0.6746278", "0.6731712", "0.6633688", "0.6607975", "0.6594529", "0.656681", "0.65509844", "0.65329474", "0.6481499", "0.6411143", "0.6353764", "0.63504684", "0.63428783", "0.6342099", "0.6320729", "0.63026726", "0.6292998", "0.6282346", "0.6280404", "0.62418944", "0.6223654", "0.62018764", "0.6190756", "0.61795205", "0.61594653", "0.61447686", "0.6124875", "0.6104806", "0.6069271", "0.6067468", "0.6044307", "0.6016318", "0.6003794", "0.6002892", "0.59966195", "0.5991268", "0.5980925", "0.5972902", "0.59625244", "0.5961873", "0.5949268", "0.59480315", "0.59469336", "0.5937162", "0.5904568", "0.5896344", "0.5894923", "0.5894615", "0.5884379", "0.58823144", "0.5871437", "0.58703285", "0.58595765", "0.58571506", "0.58471614", "0.58471614", "0.58471614", "0.5843983", "0.58415204", "0.58365977", "0.583297", "0.5832595", "0.5827304", "0.58180726", "0.58178854", "0.5816241", "0.5815893", "0.5807592", "0.5804249", "0.57954437", "0.57943916", "0.57845575", "0.57833755", "0.5766836", "0.57665944", "0.574823", "0.5747842", "0.5744468", "0.5724751", "0.57197124", "0.57118136", "0.57104874", "0.5707838", "0.568744", "0.5681087", "0.5654843", "0.5651109", "0.56508094", "0.5649929", "0.5649292", "0.5644672" ]
0.84228355
0
Checks the query_format string
private void checkDocumentSourceTypes() { val message = "document_source_types is not valid!"; val documentSourceTypes = config.getStringList("document_source_types"); if (documentSourceTypes.contains(DocumentSourceType.OMDB.name())) { val omdbApiKey = config.getString("omdbApiKey"); checkArgument(!isNullOrEmpty(omdbApiKey), "OMDB API KEY must be set for using OMDB as source. \n" + "You can obtain one here: http://www.omdbapi.com/apikey.aspx"); } try { documentSourceTypes.forEach(DocumentSourceType::valueOf); } catch (IllegalArgumentException e) { throw new IllegalArgumentException(message); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void checkFormat(String queryString) throws WrongQueryFormatException {\n\t\tString filters[] = queryString.split(\" \");\n\t\tif (filters.length != 7)\n\t\t\tthrow new WrongQueryFormatException(\n\t\t\t\t\t\"the query should be in this format-- QUERY <IP_ADDRESS> <CPU_ID> <START_DATE> <START_HOUR:START_MIN> <END_DATE> <END_HOUR:END_MIN>\");\n\t\tif (!filters[0].equals(\"QUERY\") && !filters[0].equals(\"EXIT\"))\n\t\t\tthrow new WrongQueryFormatException(\"the query should either start with a 'QUERY' or type 'EXIT' to end\");\n\t\tif (!isAnIp(filters[1]))\n\t\t\tthrow new WrongQueryFormatException(\"the second argument must be an ip address\");\n\t\tif (!isCpuId(filters[2]))\n\t\t\tthrow new WrongQueryFormatException(\"the third argument must be a cpu id(0 or 1)\");\n\t\tisDateTime(filters);\n\t}", "private String checkQuery(String query){\n\t\tif(query != null){\n\t\t\tString[] param = query.split(\"=\");\n\t\t\tif(param[0].equals(\"tenantID\")){\n\t\t\t\treturn param[1];\n\t\t\t}\n\t\t}\n\t\treturn \"\";\n\t}", "public static boolean isValidinput(String query){\r\n\t\tPattern regex = Pattern.compile(\"[$&+,:;=@#|]\");\r\n\t\tMatcher matcher = regex.matcher(query);\r\n\t\tif (matcher.find()){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t}", "private Boolean nonEmptyQuery(String query){\n\t\tBoolean isCorrect = false;\n\t\tString [] queryElements = query.split(\"--\");\n\t\tif(queryElements.length==2 && !queryElements[0].isEmpty() && !queryElements[1].isEmpty())\n\t\t\tisCorrect = true;\n\t\treturn isCorrect;\n\t}", "private static void checkFormat(String str) {\n if (str.length() != 8)\n throw new IllegalArgumentException(\"length has too be 8\");\n try {\n Integer.parseInt(str.substring(0,2)); //Hours\n Integer.parseInt(str.substring(3,5)); //Minutes\n } catch (NumberFormatException e) {\n throw new IllegalArgumentException(\"These numbers are wrong\");\n }\n if (str.charAt(2) != ':') {\n throw new IllegalArgumentException(\"requires colon between times\");\n }\n if (str.charAt(5) != ' ') {\n throw new IllegalArgumentException(\"requires space between time and period\");\n }\n String mStr = str.substring(6);\n if (!mStr.equals(\"PM\") && !mStr.equals(\"AM\")) {\n throw new IllegalArgumentException(\"Must be AM or PM\");\n }\n }", "@Test\n\tpublic void isValidQueryTest() {\n\t\tString query1 = \"< nice & cool \";\n\t\tString query2 = \"( hello & !!cool )\";\n\t\tString query3 = \"( hello | !cool )\";\n\t\t\n\t\texception.expect(IllegalArgumentException.class);\n\t\tqueryTest.isValidQuery(query1);\n\t\tqueryTest.isValidQuery(query2);\n\n\t\texception = ExpectedException.none();\n\t\tqueryTest.isValidQuery(query3);\n\n\t\t// test num of brackets\n\t\tquery1 = \"( nice & cool )\";\n\t\tquery2 = \"( ( nice & cool )\";\n\t\tquery3 = \"( hello & my | ( name | is ) | bar & ( hi )\";\n\t\t\n\t\tqueryTest.isValidQuery(query1);\n\t\texception.expect(IllegalArgumentException.class);\n\t\tqueryTest.isValidQuery(query2);\n\t\tqueryTest.isValidQuery(query3);\n\t\t\n\t\t// test phrases (+ used to indicate phrase)\n\t\tquery1 = \"hello+hi+my\";\n\t\tquery2 = \"hello+contains+my\";\n\t\tquery3 = \"( my+name & hello | ( oh my ))\";\n\t\t\n\t\texception = ExpectedException.none();\n\t\tqueryTest.isValidQuery(query1);\n\t\tqueryTest.isValidQuery(query2);\n\t\tqueryTest.isValidQuery(queryTest.fixSpacing(query3));\n\t}", "private boolean isAdvancedQuery(String enteredQuery){\n try{\n Character firstChar = enteredQuery.charAt(0);\n Character secondChar = enteredQuery.charAt(1);\n\n return isSignOperator(firstChar.toString()) && secondChar.equals(' ');\n }catch (StringIndexOutOfBoundsException ex){\n return false;\n }\n }", "@Test\n\tpublic void badQueryTest() {\n\t\texception.expect(IllegalArgumentException.class);\n\t\t\n\t\t// numbers not allowed\n\t\tqueryTest.query(\"lfhgkljaflkgjlkjlkj9f8difj3j98ouijsflkedfj90\");\n\t\t// unbalanced brackets\n\t\tqueryTest.query(\"( hello & goodbye | goodbye ( or hello )\");\n\t\t// & ) not legal\n\t\tqueryTest.query(\"A hello & goodbye | goodbye ( or hello &)\");\n\t\t// unbalanced quote\n\t\tqueryTest.query(\"kdf ksdfj (\\\") kjdf\");\n\t\t// empty quotes\n\t\tqueryTest.query(\"kdf ksdfj (\\\"\\\") kjdf\");\n\t\t// invalid text in quotes\n\t\tqueryTest.query(\"kdf ksdfj \\\"()\\\" kjdf\");\n\t\t// double negation invalid (decision)\n\t\tqueryTest.query(\"!!and\");\n\t\t\n\t\t// gibberish\n\t\tqueryTest.query(\"kjlkfgj! ! ! !!! ! !\");\n\t\tqueryTest.query(\"klkjgi & df & | herllo\");\n\t\tqueryTest.query(\"kjdfkj &\");\n\t\t\n\t\t// single negation\n\t\tqueryTest.query(\"( ! )\");\n\t\tqueryTest.query(\"!\");\n\t\t\n\t\t// quotes and parenthesis interspersed\n\t\tqueryTest.query(\"our lives | coulda ( \\\" been so ) \\\" but momma had to \\\" it all up wow\\\"\");\n\t}", "public void validateQuery(Query query) throws InvalidQueryException;", "private void constructSearchingQueryIfScanIsValid(){\n\t\t//todo: test roll back \n\t\t//String scanContent = scanningResult.getContents();\n\t\t//String scanFormat = scanningResult.getFormatName();\n\t\t\n\t\t//todo: test need delete\n\t\tString scanContent = \"9781430247883\";\n\t\tString scanFormat = \"EAN_13\";\n\t\tif(GoogleApiConverter.isScanFormatMatching(scanContent, scanFormat)){\n\t\t\tString bookSearchString = GoogleApiConverter.formateBookApiSearchQuery(scanContent);\n\t\t\tnew GetBookInfo().execute(bookSearchString);\n\t\t}\n\t\telse{\n\t\t\tToastExceptions.onShowException(this, \"Not a valid scan!\");\n\t\t}\n\t}", "protected abstract String getValidationQuery();", "public boolean checkIfHasCorrectFormat(String command, String commandType) {\r\n\t\t//begin\r\n\t\tboolean isCorrect = true;\r\n\t\tint i = 0;\r\n\t\tint counter = 0;\r\n\t\twhile(i < command.length()) {\r\n\t\t\tif(command.charAt(i) == ',') {\r\n\t\t\t\tcounter++;\r\n\t\t\t\tif( i < command.length() - 2) {\r\n\t\t\t\t\tif(command.charAt(i + 1) == ',' || command.charAt(i + 2) == ',') {\r\n\t\t\t\t\t\tisCorrect = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t\t\r\n\t\tif(commandType.compareTo(\"publish\") == 0) {\r\n\t\t\tif(counter != 3) {\r\n\t\t\t\tisCorrect = false;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(commandType.compareTo(\"subscribe\") == 0) {\r\n\t\t\tif(counter != 2) {\r\n\t\t\t\tisCorrect = false;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(commandType.compareTo(\"unsubscribe\") == 0) {\r\n\t\t\tif(counter != 2) {\r\n\t\t\t\tisCorrect = false;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn isCorrect;\r\n\t\t//end\r\n\t\t//return false;\r\n\t}", "private boolean isInValidInput(String input) {\n\n\t\tif (input == null || input.isEmpty())\n\t\t\treturn true;\n\n\t\tint firstPipeIndex = input.indexOf(PARAM_DELIMITER);\n\t\tint secondPipeIndex = input.indexOf(PARAM_DELIMITER, firstPipeIndex + 1);\n\n\t\t/*\n\t\t * if there are no PARAM_DELIMITERs or starts with a PARAM_DELIMITER\n\t\t * (Meaning command is missing) or only single PARAM_DELIMITER input is\n\t\t * not valid\n\t\t */\n\t\tif (firstPipeIndex == -1 || firstPipeIndex == 0 || secondPipeIndex == -1)\n\t\t\treturn true;\n\n\t\t// Means package name is empty\n\t\tif (secondPipeIndex - firstPipeIndex < 2)\n\t\t\treturn true;\n\n\t\treturn false;\n\t}", "public abstract ValidationResult validateDataFormat(Map<String, String[]> requestParamsMap);", "String processQuery(String query);", "public static String checkStringFormat(String str, String error, String format) {\r\n while (true) {\r\n System.out.print(str);\r\n inputValue = sc.nextLine().trim();//trim to let input only string (After blankspace doesn't count)\r\n if (inputValue.isEmpty() || inputValue.matches(format) == false) {//check if inputed value is empty or match the right format.\r\n System.out.println(error);\r\n } else {\r\n break; // if correct formated, exit loop\r\n }\r\n }\r\n return inputValue;\r\n }", "private String sanitizeQuery(String query) {\n if (query.length() >= MAX_ALLOWED_SQL_CHARACTERS) {\n throw new TooLongQueryError(query.length());\n }\n return query;\n }", "private static void isDateTime(String filters[]) throws WrongQueryFormatException {\n\t\tSimpleDateFormat format = new SimpleDateFormat(DateOperations.dateFormat);\n\t\ttry {\n\t\t\tDate startDate = format.parse(filters[3] + \" \" + filters[4]);\n\t\t\tDate endDate = format.parse(filters[5] + \" \" + filters[6]);\n\t\t\tif (startDate.after(endDate)) {\n\t\t\t\tthrow new WrongQueryFormatException(\"Start date,time should be before the end date/time\");\n\t\t\t}\n\t\t} catch (ParseException e) {\n\t\t\tthrow new WrongQueryFormatException(\"Wrong format of date, format is yyyy-MM-dd HH:MM\");\n\t\t}\n\t}", "private static String checkFormat(String date){\r\n\t\tif(date.length()==0) return \"\";\r\n\t\tint dateChars=0,timeChars=0;\r\n\t\tchar currenChar;\r\n\t\t\r\n\t\t//check if the first and the last character of the string is a number, it must always be\r\n\t\tif(!Character.isDigit(date.charAt(0))) return \"\";\r\n\t\tif(!Character.isDigit(date.charAt((date.length()-1)))) return \"\";\r\n\t\t\r\n\t\t\r\n\t\tfor(int i=1; i<date.length()-1;i++){\r\n\t\t\tcurrenChar=date.charAt(i);\r\n\t\t\t\r\n\t\t\t//check if every character is / or : or number\t\t\r\n\t\t\tif(!(Character.isDigit(currenChar) || currenChar==':' || currenChar=='/')) return \"\";\r\n\t\t\t//check if there is a number between // or ::, if not it returns false\r\n\t\t\tif((currenChar==':' || currenChar=='/') && (date.charAt(i+1)==':' || date.charAt(i+1)=='/')) return \"\";\r\n\t\t\t\r\n\t\t\t//count the / and :\r\n\t\t\tif(currenChar==':') timeChars++; \r\n\t\t\telse if(currenChar=='/') dateChars++;\r\n\t\t}\r\n\t\t\r\n\t\t//if it is time with one :\r\n\t\tif(timeChars==1 && dateChars==0){\r\n\t\t\t//check if one of the numbers has more than 2 digits, then it is invalid\r\n\t\t\tint index=0;\r\n\t\t\tfor(String s:splitWords(date.replaceAll(\":\", \" \"))){\r\n\t\t\t\tif( index==0 && s.length()!=1 && s.length()!=2) return \"\";\r\n\t\t\t\telse if(index>0 && s.length()!=2 ) return \"\";\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\r\n\t\t\treturn formats[2];\r\n\t\t}\r\n\t\t\r\n\t\t//if it is time with two :\r\n\t\telse if(timeChars==2 && dateChars==0){\r\n\t\t\t//check if one of the numbers has more than 2 digits, then it is invalid\r\n\t\t\tint index=0;\r\n\t\t\tfor(String s:splitWords(date.replaceAll(\":\", \" \"))){\r\n\t\t\t\tif( index==0 && s.length()!=1 && s.length()!=2) return \"\";\r\n\t\t\t\telse if(index>0 && s.length()!=2 ) return \"\";\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\r\n\t\t\treturn formats[1];\r\n\t\t}\r\n\t\t\r\n\t\t//if it is a date with two /\r\n\t\telse if(dateChars==2 && timeChars==0){\r\n\t\t\t//check if one of the numbers have the right amount of digits\r\n\t\t\tString[] numbers= splitWords(date.replaceAll(\"/\", \" \"));\r\n\t\t\tif(numbers[0].length()>2) return \"\";\r\n\t\t\tif(numbers[1].length()>2) return \"\";\r\n\t\t\tif(numbers[2].length()>4) return \"\";\r\n\t\t\t\r\n\t\t\treturn formats[0];\r\n\t\t}\r\n\t\t\r\n\t\telse return \"\";\t\t\r\n\t}", "public static boolean isValidFormat(String format) {\n return getFormatNoException(format) != null;\n }", "public String checkFormat() {\r\n\t\t\r\n\t\tString msg = null;\r\n\t\t\r\n\t\ttry {\t\t\t\t\t\t\t\t\t\t\t//input is not a number\r\n\t\t\t\r\n\t\t\tDouble.parseDouble(price.getText());\r\n\t\t\tInteger.parseInt(quantity.getText());\r\n\t\t\t \r\n\t\t}\r\n\t\t\r\n\t\tcatch(Exception e) {\r\n\t\t\t\r\n\t\t\treturn msg = \"Data format is invalid\";\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tif(name.getText().isEmpty() \t\t\t\t\t//wine name is empty\r\n\t\t\t\t|| name.getText().length() > 30\t\t\t//wine name is more than 30 letters\r\n\t\t\t\t\t|| quantity.getText().isEmpty()\t\t//quantity is empty\r\n\t\t\t\t\t\t||price.getText().isEmpty()\t\t//price is empty\r\n\t\t\t\t\t\t\t||((!(price.getText().length() - price.getText().indexOf('.') == 3))\t//price is not two decimal spaces \r\n\t\t\t\t\t\t\t\t\t&& price.getText().indexOf('.') != -1))\r\n\t\t{\r\n\t\t\t\r\n\t\t\tmsg = \"Data format is invalid\";\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\telse {\r\n\t\t\t\r\n\t\t\tmsg = null;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn msg;\r\n\t\t\r\n\t}", "public void InvalidFormat();", "@Test\n\tpublic void queryTest() {\n\t\tString query1 = \"(\\\"hello my name is\\\" & my | (!no & yes))\";\n\t\tString query2 = \"(hello & (\\\"yes sir\\\") | !no)\";\n\t\tString query3 = \"\\\"bob dylan\\\" ( big boy | toy ) & \\\"named troy\\\"\";\n\t\tString query4 = \"test \\\"quan what does\\\"\";\n\t\t\n\t\tString query1Result = \"hello+my+name+is my & !no yes & |\";\n\t\tString query2Result = \"hello yes+sir & !no |\";\n\t\tString query3Result = \"bob+dylan big boy & toy | & named+troy &\";\n\t\tString query4Result = \"test quan+what+does &\";\n\t\t\n\t\tassertEquals(query1Result, String.join(\" \", queryTest.getPostFix(query1)));\n\t\tassertEquals(query2Result, String.join(\" \", queryTest.getPostFix(query2)));\n\t\tassertEquals(query3Result, String.join(\" \", queryTest.getPostFix(query3)));\n\t\tassertEquals(query4Result, String.join(\" \", queryTest.getPostFix(query4)));\n\t}", "private boolean validateAmountFormat(String amount,\n HttpServletRequest req, HttpServletResponse resp) throws IOException {\n if(!amount.matches(wholeNumber)\n && !amount.matches(fraction)\n && !amount.matches(trailingZeroFraction)\n && !amount.matches(leadingZeroFraction)\n ){\n page.redirectTo(\"/account\", resp, req,\n \"errorMessage\", \"Transaction amount format invalid!\");\n return false;\n }\n return true;\n }", "protected boolean isValidDateTimeFormat(String str) {\n SimpleDateFormat inputFormat = new SimpleDateFormat(\"dd/MM/yyy hhmm\");\n try {\n inputFormat.parse(str);\n return true;\n } catch (ParseException e) {\n return false;\n }\n }", "String query();", "public String parseQueryType(String queryType){\n\t\t \tif(\"online\".equals(queryType)){\n\t\t \t\tqueryType=\"1\";\n\t\t \t}else if(\"batch\".equals(queryType)){\n\t\t \t\tqueryType=\"2\";\n\t\t \t}\n\t\t\t\treturn queryType;\n\t\t }", "static String qs(String query) {\n\t\tif (StringUtils.isBlank(query) || \"*\".equals(query.trim())) {\n\t\t\treturn \"*\";\n\t\t}\n\t\tquery = query.trim();\n\t\tif (query.length() > 1 && query.startsWith(\"*\")) {\n\t\t\tquery = query.substring(1);\n\t\t}\n\t\ttry {\n\t\t\tStandardQueryParser parser = new StandardQueryParser();\n\t\t\tparser.setAllowLeadingWildcard(false);\n\t\t\tparser.parse(query, \"\");\n\t\t} catch (Exception ex) {\n\t\t\tlogger.warn(\"Failed to parse query string '{}'.\", query);\n\t\t\tquery = \"*\";\n\t\t}\n\t\treturn query.trim();\n\t}", "public static String checkFormatCommandLine(String[] cmdStrings) {\n String result = \"\";\n String checkFormat = cmdStrings.length != 0 ? cmdStrings[0] : \"\";\n if (cmdStrings.length == 0 || checkFormat.equalsIgnoreCase(\"-h\")) {\n result = HELP;\n } else {\n if (find(cmdStrings, \"-r\") == -1) {\n result = \"Error: Not input file.\";\n } else if (find(cmdStrings, \"-1\") + 1 >= cmdStrings.length) {\n result = \"Error: Not found file.\";\n }\n }\n return result;\n }", "public boolean hasValidFilterQueries() {\n\n if (this.filterQueries.isEmpty()) {\n return true; // empty is valid!\n }\n\n for (String fq : this.filterQueries) {\n if (this.getFriendlyNamesFromFilterQuery(fq) == null) {\n return false; // not parseable is bad!\n }\n }\n return true;\n }", "private static boolean checkGenericPattern(String paramSaInput) {\r\n\t\tString saInput = paramSaInput;\r\n\t\tif (null != saInput) {\r\n\t\t\ttry {\r\n\t\t\t\tsaInput = URLDecoder.decode(saInput);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t// LOGGER.error(\"Problem in URLDecode saInput is \" + saInput);\r\n\t\t\t\t// LOGGER.error(e);\r\n\t\t\t\tLOGGER.info(\"Exception:\" + e);\r\n\t\t\t}\r\n\r\n\t\t\tRegularExpression regex = null;\r\n\t\t\ttry {\r\n\t\t\t\tfor (int ilCounter = 0; ilCounter < lSqlFilters.length; ilCounter++) {\r\n\t\t\t\t\tregex = new RegularExpression(lSqlFilters[ilCounter], \"i\");\r\n\r\n\t\t\t\t\tif (regex.matches(saInput)) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// if\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// for\r\n\t\t\tcatch (Exception e) {\r\n\t\t\t\tLOGGER.info(\"Exception\" + e);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// if not null\r\n\r\n\t\treturn true;\r\n\t}", "@SuppressWarnings(\"null\")\n\tpublic QueryParameter parseQuery(String queryString) {\n\t\t\n/*\n\t\t * extract the name of the file from the query. File name can be found after the\n\t\t * \"from\" clause.\n\t\t */\n\n\t\t/*\n\t\t * extract the order by fields from the query string. Please note that we will\n\t\t * need to extract the field(s) after \"order by\" clause in the query, if at all\n\t\t * the order by clause exists. For eg: select city,winner,team1,team2 from\n\t\t * data/ipl.csv order by city from the query mentioned above, we need to extract\n\t\t * \"city\". Please note that we can have more than one order by fields.\n\t\t */\n\n\t\t/*\n\t\t * extract the group by fields from the query string. Please note that we will\n\t\t * need to extract the field(s) after \"group by\" clause in the query, if at all\n\t\t * the group by clause exists. For eg: select city,max(win_by_runs) from\n\t\t * data/ipl.csv group by city from the query mentioned above, we need to extract\n\t\t * \"city\". Please note that we can have more than one group by fields.\n\t\t */\n\n\t\t /*\n\t\t * extract the selected fields from the query string. Please note that we will\n\t\t * need to extract the field(s) after \"select\" clause followed by a space from\n\t\t * the query string. For eg: select city,win_by_runs from data/ipl.csv from the\n\t\t * query mentioned above, we need to extract \"city\" and \"win_by_runs\". Please\n\t\t * note that we might have a field containing name \"from_date\" or \"from_hrs\".\n\t\t * Hence, consider this while parsing.\n\t\t */\n\n\t\t/*\n\t\t * extract the conditions from the query string(if exists). for each condition,\n\t\t * we need to capture the following: 1. Name of field 2. condition 3. value\n\t\t * \n\t\t * For eg: select city,winner,team1,team2,player_of_match from data/ipl.csv\n\t\t * where season >= 2008 or toss_decision != bat\n\t\t * \n\t\t * here, for the first condition, \"season>=2008\" we need to capture: 1. Name of\n\t\t * field: season 2. condition: >= 3. value: 2008\n\t\t * \n\t\t * the query might contain multiple conditions separated by OR/AND operators.\n\t\t * Please consider this while parsing the conditions.\n\t\t * \n\t\t */\n\n\t\t /*\n\t\t * extract the logical operators(AND/OR) from the query, if at all it is\n\t\t * present. For eg: select city,winner,team1,team2,player_of_match from\n\t\t * data/ipl.csv where season >= 2008 or toss_decision != bat and city =\n\t\t * bangalore\n\t\t * \n\t\t * the query mentioned above in the example should return a List of Strings\n\t\t * containing [or,and]\n\t\t */\n\n\t\t/*\n\t\t * extract the aggregate functions from the query. The presence of the aggregate\n\t\t * functions can determined if we have either \"min\" or \"max\" or \"sum\" or \"count\"\n\t\t * or \"avg\" followed by opening braces\"(\" after \"select\" clause in the query\n\t\t * string. in case it is present, then we will have to extract the same. For\n\t\t * each aggregate functions, we need to know the following: 1. type of aggregate\n\t\t * function(min/max/count/sum/avg) 2. field on which the aggregate function is\n\t\t * being applied\n\t\t * \n\t\t * Please note that more than one aggregate function can be present in a query\n\t\t * \n\t\t * \n\t\t */\n\n\t\tString file = null;\n\t\tList<Restriction> restrictions = new ArrayList<Restriction>();\n\t\tList<String> logicalOperators = new ArrayList<String>();\n\t\tList<String> fields = new ArrayList<String>();;\n\t\tList<AggregateFunction> aggregateFunction = new ArrayList<AggregateFunction>();\n\t\tList<String> groupByFields = new ArrayList<String>();;\n\t\tList<String> orderByFields = new ArrayList<String>();;\n\t\tString baseQuery=null;\n\t\n\t\tfile = getFile(queryString);\n\n\t\t\n\t\tString[] conditions = getConditions(queryString);\n\t\tif(conditions!=null) {\n\t\tRestriction[] restriction = new Restriction[conditions.length];\n\t\t\n\t\tfor (int i = 0; i < conditions.length; i++) {\n\t\t\trestriction[i] = new Restriction();\n\t\t\t\n\t\t\tString operator=null;\n\t\t\tString value=null;\n\t\t\tString property=null;\n\t\t\t if(conditions[i].contains(\"<=\")) {\n\t\t\t\tString[] split = conditions[i].split(\"<=\");\n\t\t\t\toperator=\"<=\";\n\t\t\t\t value=split[1].trim();\n\t\t\t\t property=split[0].trim();\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(conditions[i].contains(\">=\")) {\n\t\t\t\tString[] split = conditions[i].split(\">=\");\n\t\t\t\toperator=\">=\";\n\t\t\t\t value=split[1].trim();\n\t\t\t\t property=split[0].trim();\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(conditions[i].contains(\">\")) {\n\t\t\t\tString[] split = conditions[i].split(\">\");\n\t\t\t\toperator=\">\";\n\t\t\t\t value=split[1].trim();\n\t\t\t\t property=split[0].trim();\n\t\t\t}\n\t\t\telse if(conditions[i].contains(\"!=\")) {\n\t\t\t\tString[] split = conditions[i].split(\"!=\");\n\t\t\t\toperator=\"!=\";\n\t\t\t\t value=split[1].trim();\n\t\t\t\t property=split[0].trim();\n\t\t\t}\n\t\t\telse if(conditions[i].contains(\"=\")) {\n\t\t\t\tString[] split = conditions[i].split(\"=\");\n\t\t\t\toperator=\"=\";\n\t\t\t\t value=split[1].trim();\n\t\t\t\t property=split[0].trim();\n\t\t\t\t if(value.contains(\"'\")) {\n\t\t\t\t\t value= value.replaceAll(\"'\",\"\").trim();\n\t\t\t\t }\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(conditions[i].contains(\"<\")) {\n\t\t\t\tString[] split = conditions[i].split(\"<\");\n\t\t\t\toperator=\"<\";\n\t\t\t\t value=split[1].trim();\n\t\t\t\t property=split[0].trim();\n\t\t\t}\n\t\t\t \n\t\t\t\n\t\t\trestriction[i].setCondition(operator);\n\t\t\trestriction[i].setPropertyName(property);\n\t\t\trestriction[i].setPropertyValue(value);\n\t\t\trestrictions.add(restriction[i]);\n\n\t\t}\n\t\t}\n\t\n\t\tString[] operators = getLogicalOperators(queryString);\n\t\tif(operators!=null) {\n\t\tfor (String op : operators) {\n\t\t\tlogicalOperators.add(op);\n\t\t}\n\t\t}\n\t\t\n\t\tString[] filds = getFields(queryString);\n\t\tif(filds!=null) {\n\t\tfor (String field : filds) {\n\t\t\tfields.add(field);\n\t\t}\n\t\t}\n\t\t\n\t\tString[] aggregationVal = getAggregateFunctions(queryString);\n\t\tif(aggregationVal!=null) {\n\t\tAggregateFunction[] aggregation = new AggregateFunction[aggregationVal.length];\n\t\tfor (int i = 0; i < aggregationVal.length; i++) {\n\t\t\taggregation[i] = new AggregateFunction();\n\t\t\tString[] split = (aggregationVal[i].replace(\"(\", \" \")).split(\" \");\n\t\t\tSystem.out.println(split[0]);\n\t\t\tSystem.out.println(split[1].replace(\")\", \"\").trim());\n\t\t\t\n\t\t\taggregation[i].setFunction(split[0]);\n\t\t\taggregation[i].setField(split[1].replace(\")\", \"\").trim());\n\t\t\taggregateFunction.add(aggregation[i]);\n\n\t\t}\n\t\t}\n\t\t\n\t\t\t\n\t\t\n\t\tString[] groupBy = getGroupByFields(queryString);\n\t\tif(groupBy!=null) {\n\t\tfor (String group : groupBy) {\n\t\t\tgroupByFields.add(group);\n\t\t}\n\t\t}\n\t\n\t\tString[] orderBy = getOrderByFields(queryString);\n\t\tif(orderBy!=null) {\n\t\tfor (String order : orderBy) {\n\t\t\torderByFields.add(order);\n\t\t}\n\t\t}\n\t\tqueryParameter.setFile(file);\n\t\tif(restrictions.size()!=0) {\n\t\t\tqueryParameter.setRestrictions(restrictions);\n\t\t}\n\t\telse {\n\t\t\tqueryParameter.setRestrictions(null);\n\t\t}\n\t\tif(logicalOperators.size()!=0) {\n\t\tqueryParameter.setLogicalOperators(logicalOperators);\n\t\t}\n\t\telse {\n\t\t\tqueryParameter.setLogicalOperators(null);\n\t\t}\n\t\tbaseQuery=getBaseQuery(queryString);\n\t\t\n\t\tqueryParameter.setFields(fields);\n\t\tqueryParameter.setAggregateFunctions(aggregateFunction);\n\t\tqueryParameter.setGroupByFields(groupByFields);\n\t\tqueryParameter.setOrderByFields(orderByFields);\n\t\tqueryParameter.setBaseQuery(baseQuery.trim());\n\t\treturn queryParameter;\n\n\t}", "public static boolean isValid(String fullCommand) {\n String strWeek = fullCommand.replaceFirst(DukeConstants.SHOW_WEEK_HEADER, DukeConstants.NO_FIELD);\n if (!strWeek.isEmpty()) {\n char checkSpace = strWeek.charAt(0);\n if (checkSpace != ' ') {\n return false;\n }\n }\n strWeek = strWeek.trim();\n if (strWeek.isEmpty()) {\n return false;\n } else if (strWeek.equals(DukeConstants.WEEK_FORMAT_KEYWORD_RECESS)\n || strWeek.equals(DukeConstants.WEEK_FORMAT_KEYWORD_READING)\n || strWeek.equals(DukeConstants.WEEK_FORMAT_KEYWORD_EXAM)) {\n return true;\n } else {\n try {\n Integer week = Integer.parseInt(strWeek);\n if (week >= 1 && week <= 13) {\n return true;\n } else {\n return false;\n }\n } catch (NumberFormatException e) {\n return false;\n }\n }\n }", "@Override\n\tprotected int checkParseRequest(StringBuilder request) {\n\t\tif (request != null && request.length() > 3 && request.charAt(3) == '=') { // simplerpc?jzn=604107&jzp=1&jzc=1&jzz=WLL100...\n\t\t\t// parse XSS query\n\t\t\tint length = request.length();\n\t\t\t\n\t\t\tint jzzStarted = -1;\n\t\t\tint jzzStopped = -1;\n\t\t\t\n\t\t\tint jznStarted = -1;\n\t\t\tint jznStopped = -1;\n\t\t\t\n\t\t\tint jzpStarted = -1;\n\t\t\tint jzpStopped = -1;\n\t\t\t\n\t\t\tint jzcStarted = -1;\n\t\t\tint jzcStopped = -1;\n\t\t\t\n\t\t\tint unknownStarted = -1;\n\t\t\tint unknownStopped = -1;\n\n\t\t\tchar c3 = request.charAt(0);\n\t\t\tchar c2 = request.charAt(1);\n\t\t\tchar c1 = request.charAt(2);\n\t\t\tfor (int i = 3; i < length; i++) {\n\t\t\t\tchar c0 = request.charAt(i);\n\t\t\t\tif (jznStarted != -1) {\n\t\t\t\t\tif (jznStopped == -1) {\n\t\t\t\t\t\tif (c0 == '&') { // got jzn=...\n\t\t\t\t\t\t\tjznStopped = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (jzpStarted != -1) {\n\t\t\t\t\tif (jzpStopped == -1) {\n\t\t\t\t\t\tif (c0 == '&') { // got jzp=...\n\t\t\t\t\t\t\tjzpStopped = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (jzcStarted != -1) {\n\t\t\t\t\tif (jzcStopped == -1) {\n\t\t\t\t\t\tif (c0 == '&') { // got jzc=...\n\t\t\t\t\t\t\tjzcStopped = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (jzzStarted != -1) {\n\t\t\t\t\tif (jzzStopped == -1) {\n\t\t\t\t\t\tif (c0 == '&') { // got jzz=\n\t\t\t\t\t\t\tjzzStopped = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (unknownStarted != -1) {\n\t\t\t\t\tif (unknownStopped == -1) {\n\t\t\t\t\t\tif (c0 == '&') { // gotcha\n\t\t\t\t\t\t\tunknownStopped = i;\n\t\t\t\t\t\t\tunknownStarted = -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (c0 == '=' && c2 == 'z' && c3 == 'j') { // jz?=\n\t\t\t\t\tif (c1 == 'n') {\n\t\t\t\t\t\tjznStarted = i + 1;\n\t\t\t\t\t\tjznStopped = -1;\n\t\t\t\t\t} else if (c1 == 'p') {\n\t\t\t\t\t\tjzpStarted = i + 1;\n\t\t\t\t\t\tjzpStopped = -1;\n\t\t\t\t\t} else if (c1 == 'c') {\n\t\t\t\t\t\tjzcStarted = i + 1;\n\t\t\t\t\t\tjzcStopped = -1;\n\t\t\t\t\t} else if (c1 == 'z') {\n\t\t\t\t\t\tjzzStarted = i + 1;\n\t\t\t\t\t\tjzzStopped = -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tunknownStarted = i + 1;\n\t\t\t\t\t\tunknownStopped = -1;\n\t\t\t\t\t}\n\t\t\t\t\tc2 = 0;\n\t\t\t\t\tc1 = 0;\n\t\t\t\t\tc0 = 0;\n\t\t\t\t} else if (c0 == '=') {\n\t\t\t\t\tunknownStarted = i + 1;\n\t\t\t\t\tunknownStopped = -1;\n\t\t\t\t\tc2 = 0;\n\t\t\t\t\tc1 = 0;\n\t\t\t\t\tc0 = 0;\n\t\t\t\t}\n\t\t\t\tc3 = c2;\n\t\t\t\tc2 = c1;\n\t\t\t\tc1 = c0;\n\t\t\t}\n\t\t\t\n\t\t\tString jzzRequest = null;\n\t\t\tif (jzzStarted != -1) {\n\t\t\t\tif (jzzStopped == -1) {\n\t\t\t\t\tjzzStopped = length;\n\t\t\t\t}\n\t\t\t\tjzzRequest = request.substring(jzzStarted, jzzStopped);\n\t\t\t}\n\n\t\t\t// jzz without jzn is considered as XHR requests!\n\t\t\tif (jzzRequest == null || jzzRequest.trim().length() == 0) {\n\t\t\t\t//response = generateXSSErrorResponse();\n\t\t\t\trequestData = request.toString();\n\t\t\t\treturn -1; // error\n\t\t\t}\n\t\t\t\n\t\t\tif (jznStarted != -1) {\n\t\t\t\tif (jznStopped == -1) {\n\t\t\t\t\tjznStopped = length;\n\t\t\t\t}\n\t\t\t\trequestID = request.substring(jznStarted, jznStopped);\n\t\t\t}\n\t\t\tif (requestID != null && requestID.length() != 0) {\n\t\t\t\t// when jzn is defined, it's considered as a script request!\n\t\t\t\t\n\t\t\t\t// make sure that servlet support cross site script request\n\t\t\t\t// always support cross site script requests\n\t\t\t\tif (!PipeConfig.supportXSS) {\n\t\t\t\t\tresponse = new HttpQuickResponse(\"text/javascript\", \"net.sf.j2s.ajax.SimpleRPCRequest\" +\n\t\t\t\t\t\t\t\".xssNotify(\\\"\" + requestID + \"\\\", \\\"unsupported\\\");\");\n\t\t\t\t\treturn -1; // error\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t// check script request counts\n\t\t\t\tString count = null;\n\t\t\t\tif (jzpStarted != -1) {\n\t\t\t\t\tif (jzpStopped == -1) {\n\t\t\t\t\t\tjzpStopped = length;\n\t\t\t\t\t}\n\t\t\t\t\tcount = request.substring(jzpStarted, jzpStopped);\n\t\t\t\t}\n\t\t\t\tint partsCount = 1;\n\t\t\t\tif (count != null) {\n\t\t\t\t\tboolean formatError = false;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tpartsCount = Integer.parseInt(count);\n\t\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\t\t\tformatError = true; \n\t\t\t\t\t}\n\t\t\t\t\tif (formatError || partsCount <= 0) {\n\t\t\t\t\t\tresponse = generateXSSErrorResponse();\n\t\t\t\t\t\treturn -1; // error\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (partsCount != 1) {\n\t\t\t\t\t// check whether servlet can deal the requests\n\t\t\t\t\tif (partsCount > PipeConfig.maxXSSParts) {\n\t\t\t\t\t\tresponse = new HttpQuickResponse(\"text/javascript\", \"net.sf.j2s.ajax.SimpleRPCRequest\" +\n\t\t\t\t\t\t\t\t\".xssNotify(\\\"\" + requestID + \"\\\", \\\"exceedrequestlimit\\\");\");\n\t\t\t\t\t\treturn -1; // error\n\t\t\t\t\t}\n\t\t\t\t\t// check curent request index\n\t\t\t\t\tString current = null;\n\t\t\t\t\tif (jzcStarted != -1) {\n\t\t\t\t\t\tif (jzcStopped == -1) {\n\t\t\t\t\t\t\tjzcStopped = length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrent = request.substring(jzcStarted, jzcStopped);\n\t\t\t\t\t}\n\t\t\t\t\tint curPart = 1;\n\t\t\t\t\tif (current != null) {\n\t\t\t\t\t\tboolean formatError = false;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcurPart = Integer.parseInt(current);\n\t\t\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\t\t\t\tformatError = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (formatError || curPart > partsCount) {\n\t\t\t\t\t\t\tresponse = generateXSSErrorResponse();\n\t\t\t\t\t\t\treturn -1; // error\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlong now = System.currentTimeMillis();\n\t\t\t\t\tfor (Iterator<SimpleHttpRequest> itr = allSessions.values().iterator(); itr.hasNext();) {\n\t\t\t\t\t\tSimpleHttpRequest r = (SimpleHttpRequest) itr.next();\n\t\t\t\t\t\tif (now - r.jzt > PipeConfig.maxXSSLatency) {\n\t\t\t\t\t\t\titr.remove();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tString[] parts = null;\n\t\t\t\t\t\n\t\t\t\t\tSimpleHttpRequest sessionRequest = null;\n\t\t\t\t\t// store request in session before the request is completed\n\t\t\t\t\tif (session == null) {\n\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\tStringBuilder builder = new StringBuilder(32);\n\t\t\t\t\t\t\tfor (int i = 0; i < 32; i++) {\n\t\t\t\t\t\t\t\tint r = (int) Math.round((float) Math.random() * 61.1); // 0..61, total 62 numbers\n\t\t\t\t\t\t\t\tif (r < 10) {\n\t\t\t\t\t\t\t\t\tbuilder.append((char) (r + '0'));\n\t\t\t\t\t\t\t\t} else if (r < 10 + 26) {\n\t\t\t\t\t\t\t\t\tbuilder.append((char) ((r - 10) + 'a'));\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbuilder.append((char) ((r - 10 - 26) + 'A'));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsession = builder.toString();\n\t\t\t\t\t\t} while (allSessions.get(session) != null);\n\t\t\t\t\t\tsessionRequest = new SimpleHttpRequest();\n\t\t\t\t\t\tallSessions.put(session, sessionRequest);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsessionRequest = allSessions.get(session);\n\t\t\t\t\t\tif (sessionRequest == null) {\n\t\t\t\t\t\t\tsessionRequest = new SimpleHttpRequest();\n\t\t\t\t\t\t\tallSessions.put(session, sessionRequest);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (sessionRequest.jzn == null) {\n\t\t\t\t\t\tsessionRequest.jzt = now;\n\t\t\t\t\t\tparts = new String[partsCount];\n\t\t\t\t\t\tsessionRequest.jzn = parts;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tparts = sessionRequest.jzn;\n\t\t\t\t\t\tif (partsCount != parts.length) {\n\t\t\t\t\t\t\tresponse = generateXSSErrorResponse();\n\t\t\t\t\t\t\treturn -1; // error\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tparts[curPart - 1] = jzzRequest;\n\t\t\t\t\tfor (int i = 0; i < parts.length; i++) {\n\t\t\t\t\t\tif (parts[i] == null) {\n\t\t\t\t\t\t\t// not completed yet! just response and wait next request.\n\t\t\t\t\t\t\tresponse = new HttpQuickResponse(\"text/javascript\", \"net.sf.j2s.ajax.SimpleRPCRequest\" +\n\t\t\t\t\t\t\t\t\t\".xssNotify(\\\"\" + requestID + \"\\\", \\\"continue\\\"\" +\n\t\t\t\t\t\t\t\t\t((curPart == 1) ? \", \\\"\" + session + \"\\\");\" : \");\"));\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (response != null) {\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t}\n\n\t\t\t\t\tallSessions.remove(session);\n\t\t\t\t\t\n\t\t\t\t\tStringBuilder builder = new StringBuilder(16192);\n\t\t\t\t\tfor (int i = 0; i < parts.length; i++) {\n\t\t\t\t\t\tbuilder.append(parts[i]);\n\t\t\t\t\t\tparts[i] = null;\n\t\t\t\t\t}\n\t\t\t\t\trequest.delete(0, request.length()).append(builder.toString());\n\t\t\t\t} else {\n\t\t\t\t\trequest.delete(0, request.length()).append(jzzRequest);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\trequest.delete(0, request.length()).append(jzzRequest); // no request id, normal request\n\t\t\t}\n\t\t} // end of XSS script query parsing\n\t\treturn 0;\n\t}", "public static void parseQueryString(String queryString) {\n\n System.out.println(\"STUB: Calling parseQueryString(String s) to process queries\");\n System.out.println(\"Parsing the string:\\\"\" + queryString + \"\\\"\");\n queryString = queryString.toLowerCase();\n String colName = queryString.substring(0,queryString.indexOf(\"from\")+5).trim();\n String colNames[] = removeWhiteSpacesInArray(colName.split(\" \"));\n ArrayList<String> queryStringList = new ArrayList<String>(Arrays.asList(colNames));\n queryStringList.remove(\"select\");\n queryStringList.remove(\"from\");\n String condition = \"\";\n String keyValueCond[] = new String[]{};\n String tableName = \"\";\n if(queryString.contains(\"where\")) {\n tableName = queryString.substring(queryString.indexOf(\"from\") + 5, queryString.indexOf(\"where\")).trim();\n condition = queryString.substring(queryString.indexOf(\"where\")+6, queryString.length()).trim();\n keyValueCond = removeWhiteSpacesInArray(condition.split(\" \"));\n }else\n tableName = queryString.substring(queryString.indexOf(\"from\")+5).trim();\n try {\n Table table = new Table(tableName.concat(\".tbl\"));\n int noOfRecords = table.page.getNoOfRecords();\n long pos = table.page.getStartofContent();\n TreeMap<String, String> colOrder = columnOrdinalHelper.getColumnsInOrdinalPositionOrder(tableName);\n int recordLength = Integer.parseInt(recordLengthHelper.getProperties(tableName.concat(\".\").concat(Constant.recordLength)));\n if(keyValueCond.length>0){\n\n }else{\n Iterator it = colOrder.entrySet().iterator();\n while (it.hasNext()){\n Map.Entry<String, String> entryPair = (Map.Entry<String, String>) it.next();\n// ReadResult<Object> readResult = table.page.readIntasByte(pos);\n// System.out.println(readResult.getT());\n ReadResult<Object> readResult = RecordFormat.readRecordFormat(columnTypeHelper.getProperties(entryPair.getValue()),table,pos);\n System.out.println(\"RESULT COLUMN NAME : \"+entryPair.getValue()+\" Value : \"+readResult.getT());\n\n }\n\n }\n\n\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "public boolean checkFormat(String inputPrice){\n // integer followed by a \".\" followed by 2 single digits\n String format = \"((\\\\d+)(.)(\\\\d)(\\\\d))\";\n if(inputPrice.matches(format))\n return true;\n\n return false;\n }", "public String validateRegexFormat(String input) {\n String regexFootball = \"^(.+?)(\\\\d+)-(\\\\d+)(.+?)$\";\n // Regex to check valid tennis game.\n String regexTennis = \"^(.+?) (\\\\W)(\\\\d+)(\\\\W) (\\\\d+) (.{2,})-(.{2,}) (\\\\W)(\\\\d+)(\\\\W) (.+?)$\";\n // Regex to check valid american football game.\n String regexAmericanFootball = \"^(.+?) (\\\\d+)-(\\\\d+) (.+) (.+(?= Quarter)) (Quarter)$\";\n\n\n if (input.matches(regexAmericanFootball)) {\n return this.getAmericanFootballResult(input);\n } else if (input.matches(regexTennis)) {\n return this.getTennisResult(input);\n } else if (input.matches(regexFootball)) {\n return this.getFootballResult(input);\n } else {\n return \"Format not detected! Verify the input text.\";\n }\n\n }", "private QueryInfo getQueryInfoFromString(String s) {\n\t\treturn null;\n\t}", "private static boolean isTypeMatch(String s) {\n s = s.substring(1, s.length() - 1); \n /*\n * input is \n * case1: \"abc\", +3, -7.5, -7.5f, 2e3\n * case2: ?i:int, ?f:float, ?s:string\n * \n * 1. split by \",\" , get field [\" ?i:int \", \" 3\"]\n * 2. check whether is type match\n */\n String[] ss = s.split(\",\"); // [\" ?i:int \", \" 3\"]\n for (int i = 0; i < ss.length; i++) {\n String temp = ss[i].trim(); // \"abc\" +3 -7.5f 2e3\n // type match\n if (temp.charAt(0) == '?' && temp.indexOf(':') != -1) {\n return true;\n }\n }\n return false;\n }", "private String checkParameters (HttpServletRequest request)\r\n\t{\r\n\t\tString ret = \"ok\";\r\n\t\tString paramName = null;\r\n\t\tString occNo = null;\r\n\t\tString encoding = null;\r\n\t\tString reqInd = null;\r\n\t\tString expression = \"^[-+]?[0-9]*\";\r\n\t\tPattern pattern = Pattern.compile(expression);\r\n\t\tMatcher matcher = null;\r\n\t\t\r\n\t\tfor (int i = 0; true; i++) {\r\n\t\t\tparamName = request.getParameter(\"paramName\" + i);\r\n\t\t\tif(paramName == null || paramName.equalsIgnoreCase(\"\")){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\toccNo = request.getParameter(\"paramOccNo\" + i);\r\n\t\t\t\r\n\t\t\t// WI 22224\r\n\t\t\tif(occNo != null){\r\n\t\t\t\tmatcher = pattern.matcher(occNo);\r\n\t\t\t}\r\n\t\t\tif(occNo!=null && !occNo.equalsIgnoreCase(\"\") && !matcher.matches()){ \r\n\t\t\t\tret = \"The Parameter Occurence Number should be integer.\"; \r\n\t\t\t\tbreak;\r\n\t\t\t} \r\n\t\t\t\r\n\t\t\tencoding = request.getParameter(\"paramEncoding\" + i);\r\n\t\t\tif(encoding!=null && !encoding.equalsIgnoreCase(\"\") && !encoding.equalsIgnoreCase(Phrase.XML_TYPE)\r\n\t\t\t\t&& !encoding.equalsIgnoreCase(Phrase.ZIP_TYPE)\r\n\t\t\t\t&& !encoding.equalsIgnoreCase(Phrase.BASE64_TYPE)\r\n\t\t\t\t&& !encoding.equalsIgnoreCase(Phrase.ENCRYPT_TYPE)\r\n\t\t\t\t&& !encoding.equalsIgnoreCase(Phrase.DIGEST_TYPE)\r\n\t\t\t\t&& !encoding.equalsIgnoreCase(Phrase.NONE_TYPE)\r\n\t\t\t){\r\n\t\t\t\tret = \"The Parameter Encoding should be: \" \r\n\t\t\t\t\t+ Phrase.XML_TYPE + \",\"\r\n\t\t\t\t\t+ Phrase.ZIP_TYPE + \",\"\r\n\t\t\t\t\t+ Phrase.BASE64_TYPE + \",\"\r\n\t\t\t\t\t+ Phrase.ENCRYPT_TYPE + \",\"\r\n\t\t\t\t\t+ Phrase.DIGEST_TYPE + \",\"\r\n\t\t\t\t\t+ Phrase.NONE_TYPE + \".\"\r\n\t\t\t\t\t; \r\n\t\t\t\tbreak;\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\treqInd = request.getParameter(\"paramReqInd\" + i);\r\n\t\t\tif(reqInd!=null && !reqInd.equalsIgnoreCase(\"\") && !reqInd.equalsIgnoreCase(\"true\")\r\n\t\t\t\t&& !reqInd.equalsIgnoreCase(\"false\")\r\n\t\t\t){\r\n\t\t\t\tret = \"The Parameter Required Indicator should be: true or false.\"; \r\n\t\t\t\tbreak;\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn ret;\r\n\t\r\n\t}", "boolean supportsFormat(UUID formatid);", "public static boolean isValid(String format) {\r\n return null != DictionaryFormat.valueEnumMap.get(format);\r\n }", "@Test\n public void testSyntax() throws Exception {\n assertJQ(req(\"q\",\"*\", \"df\",\"doesnotexist_s\")\n ,\"/response/docs/[0]==\" // make sure we get something...\n );\n assertJQ(req(\"q\",\"doesnotexist_s:*\")\n ,\"/response/numFound==0\" // nothing should be found\n );\n assertJQ(req(\"q\",\"doesnotexist_s:( * * * )\")\n ,\"/response/numFound==0\" // nothing should be found\n );\n\n // length of date math caused issues...\n assertJQ(req(\"q\",\"foo_dt:\\\"2013-03-08T00:46:15Z/DAY+000MILLISECONDS+00SECONDS+00MINUTES+00HOURS+0000000000YEARS+6MONTHS+3DAYS\\\"\", \"debug\",\"query\")\n ,\"/debug/parsedquery=='foo_dt:2013-09-11T00:00:00Z'\"\n );\n }", "private static boolean isBadInput(String s) {\n\t\tString[] split = s.split(\"\\\\s+\");\n\t\tif (split.length != 3) {\n\t\t\tSystem.err.printf(\"Unknow length: %d\\n\", split.length);\n\t\t\treturn true;\n\t\t}\n\t\ttry {\n\t\t\tInteger.parseInt(split[0]);\n\t\t\tInteger.parseInt(split[2]);\n\t\t} catch (NumberFormatException e) {\n\t\t\tSystem.err.printf(\"Input numbers only.\\n\");\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (split[1].length() != 1) {\n\t\t\tSystem.err.printf(\"Operator should be one character.\\n\");\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean tryParse(String toParse) {\n\t\tif(toParse == null) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttoParse.strip().replaceAll(\"[^0-9\"+delimiter+\"]\", \"\");\n\t\tif(toParse.length() < 3) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\ttoParse = delimiter+delimiter + toParse; \n\t\t//making sure, there are at least 3 parts in the string\n\t\t//best case: --00-00-00, worst cases --,--000 , when 0-0 -> --0-0\n\t\t\n\t\tduration = parse(toParse);\n\t\treturn true;\n\t}", "boolean isIsQuery();", "@Override\n\tprotected void isValid(String input) throws DataInputException\n\t{\n\t}", "@Test\n public void isValidFormat() {\n assertFalse(Deadline.isValidFormat(VALID_DAY_1));\n\n // Deadline with day and month dd/mm -> true\n assertTrue(Deadline.isValidFormat(VALID_1ST_JAN_WITHOUT_YEAR.toString()));\n\n // Deadline with all 3 fields dd/mm/yyyy -> true\n assertTrue(Deadline.isValidFormat(VALID_1ST_JAN_2018.toString()));\n }", "java.lang.String getQuery();", "java.lang.String getQuery();", "protected boolean query() {\r\n\t\tqueryStr = new String(processQueryTitle(queryBk.getTitle()) + processQueryAuthor(queryBk.getCreator())\r\n\t\t\t\t+ processQueryPublisher(queryBk.getPublisher()));\r\n\t\tSystem.out.println(queryStr);\r\n\t\t// if edition is 'lastest' (coded '0'), no query is performed; and\r\n\t\t// return false.\r\n\t\tif (queryBk.parseEdition() == 0) {\r\n\t\t\treturn false;\r\n\t\t} // end if\r\n\r\n\t\t/*\r\n\t\t * The following section adds edition info to the query string if edition no. is\r\n\t\t * greater than one. By cataloging practice, for the first edition, probably\r\n\t\t * there is NO input on the associated MARC field. Considering this, edition\r\n\t\t * query string to Primo is NOT added if querying for the first edition or no\r\n\t\t * edition is specified.\r\n\t\t */\r\n\t\tif (queryBk.parseEdition() > 1) {\r\n\t\t\tqueryStr += processQueryEdition(queryBk.parseEdition());\r\n\t\t} // end if\r\n\r\n\t\t/*\r\n\t\t * Querying the Primo X-service; and invoking the matching processes (all done\r\n\t\t * by remoteQuery()).\r\n\t\t */\r\n\t\tif (strHandle.hasSomething(queryBk.getPublisher())) {\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\t/*\r\n\t\t * For various reasons, there are possibilities that the first query fails while\r\n\t\t * a match should be found. The follow work as remedy queries to ensure the\r\n\t\t * accuracy.\r\n\t\t */\r\n\r\n\t\tif (!match && strHandle.hasSomething(queryBk.getPublisher())) {\r\n\t\t\tqueryStr = new String(\r\n\t\t\t\t\tprocessQueryPublisher(queryBk.getPublisher()) + processQueryAuthor(queryBk.getCreator()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\tif (!match) {\r\n\t\t\tqueryStr = new String(processQueryTitle(queryBk.getTitle()) + processQueryAuthor(queryBk.getCreator()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\tif (!match) {\r\n\t\t\tqueryStr = new String(processQueryTitle(queryBk.getTitle()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\tif (!match && strHandle.hasSomething(queryBk.getPublishYear())) {\r\n\t\t\tqueryStr = new String(\r\n\t\t\t\t\tprocessQueryAuthor(queryBk.getCreator()) + processQueryYear(queryBk.getPublishYear()));\r\n\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\tif (!match) {\r\n\t\t\tqueryStr = new String(\r\n\t\t\t\t\tprocessQueryAuthor(queryBk.getCreator()) + processQueryTitleShort(queryBk.getTitle()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\t// Additional query for Chinese titles\r\n\r\n\t\tif (!match && (CJKStringHandling.isCJKString(queryBk.getTitle())\r\n\t\t\t\t|| CJKStringHandling.isCJKString(queryBk.getCreator())\r\n\t\t\t\t|| CJKStringHandling.isCJKString(queryBk.getPublisher()))) {\r\n\r\n\t\t\tqueryStr = new String(processQueryTitle(queryBk.getTitle()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\r\n\t\t\tif (!match && queryBk.parseEdition() != -1) {\r\n\t\t\t\tqueryStr = new String(\r\n\t\t\t\t\t\tprocessQueryTitle(queryBk.getTitle()) + processQueryEdition2(queryBk.parseEdition()));\r\n\t\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\t\tmatch = true;\r\n\t\t\t\t\tsetBookInfo();\r\n\t\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t} // end if\r\n\r\n\t\t\t\tif (!match && queryBk.parseEdition() != -1) {\r\n\t\t\t\t\tqueryStr = new String(\r\n\t\t\t\t\t\t\tprocessQueryTitle(queryBk.getTitle()) + processQueryEdition3(queryBk.parseEdition()));\r\n\t\t\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\t\t\tmatch = true;\r\n\t\t\t\t\t\tsetBookInfo();\r\n\t\t\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tmatch = false;\r\n\t\t\t\t\t} // end if\r\n\t\t\t\t} // end if\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\t// Additional check for ISO Document number in <search> <genernal> PNX\r\n\t\t// tag\r\n\t\tif (!match && !CJKStringHandling.isCJKString(queryBk.getTitle())) {\r\n\t\t\tqueryStr = new String(processQueryTitleISODoc(queryBk.getTitle()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t\terrMsg += \"Query: No record found on Primo.\" + Config.QUERY_SETTING;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\t\treturn false;\r\n\t}", "@Override\n public boolean onQueryTextSubmit(String query) {\n Log.i(TAG, \"on query submit: \" + query);\n return true;\n }", "public static boolean validateLocation(String input){\n\t\tif (input.matches(\"^\\\\{\\\".*\\\"(\\\\s|):.+\\\\}$\") && input.contains(\"\\\"\" + InterviewData.INPUT + \"\\\"\")){\n\t\t\t//System.out.println(\"IS VALID: \" + input); \t\t//debug\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private static String getQuery(String query) {\n\t\tScanner reader = new Scanner(System.in);\n\t\tString state = \"\";\n\t\twhile (true) {\n\t\t\tSystem.out.println(\"Please Type in a \" + query + \":\");\n\t\t\ttry {\n\t\t\t\tstate = reader.nextLine();\n\t\t\t\treturn state;\n\t\t\t} catch (InputMismatchException e) {\n\t\t\t\tSystem.out.println(\"Invalid Input\");\n\t\t\t}\n\t\t}\n\t}", "private boolean verifyUrlFormat( String editorUrl )\n {\n if ( null == editorUrl )\n return false;\n String normalized = editorUrl.replace('\\\\', '/');\n if ( !normalized.startsWith(CE_URL_PREFIX))\n return false;\n normalized = normalized.substring(3);\n int pos = normalized.indexOf(\"/\");\n if ( pos < 0 )\n return false;\n normalized = normalized.substring(pos+1);\n pos = normalized.indexOf(\"/\");\n if ( pos >= 0 )\n return false;\n return true;\n }", "String buildSimpleParsedBooleanQuery(String field, String val,\n\t\t\tString operator, int from, int size, DomeoPermissions permissions3) {\n\t\tStringBuffer sb = new StringBuffer(\"{ \");\n\n\t\t// Check for starting position (from) and max results (size)\n\t\tif ((from > -1) && (size > -1)) {\n\t\t\tsb.append(\"\\\"from\\\" : \" + from + \", \\\"size\\\" : \" + size + \", \");\n\t\t} else if (from > -1) { // from only, no size\n\t\t\tsb.append(\"\\\"from\\\" : \" + from + \", \");\n\t\t} else if (size > -1) { // size only, no from\n\t\t\tsb.append(\"\\\"size\\\" : \" + size + \", \");\n\t\t}\n\n\t\t// Use \"fields\" to limit fields returned in results\n\t\tif (permissions3 == null) {\n\t\t\tsb.append(\"\\\"fields\\\" : [\\\"_id\\\"], \\\"query\\\" : { \\\"match\\\" : { \\\"\"\n\t\t\t\t\t+ field + \"\\\": { \\\"query\\\" : \\\"\" + val\n\t\t\t\t\t+ \"\\\", \\\"operator\\\" : \\\"\" + operator + \"\\\" } } } }\");\n\t\t} else {\n\t\t\tString filter = permissions3.buildQueryFilter();\n\t\t\tsb.append(\"\\\"fields\\\" : [\\\"_id\\\"], \\\"query\\\" : { \\\"match\\\" : { \\\"\"\n\t\t\t\t\t+ field + \"\\\": { \\\"query\\\" : \\\"\" + val\n\t\t\t\t\t+ \"\\\", \\\"operator\\\" : \\\"\" + operator + \"\\\" } } } \" + filter\n\t\t\t\t\t+ \" } \");\n\t\t}\n\n\t\treturn sb.toString();\n\t}", "private void checkFormat() {\n if (y.pixelStride != 1) {\n throw new IllegalArgumentException(String.format(\n \"Pixel stride for Y plane must be 1 but got %d instead\",\n y.pixelStride\n ));\n }\n if (u.pixelStride != v.pixelStride || u.rowStride != v.rowStride) {\n throw new IllegalArgumentException(String.format(\n \"U and V planes must have the same pixel and row strides \" +\n \"but got pixel=%d row=%d for U \" +\n \"and pixel=%d and row=%d for V\",\n u.pixelStride, u.rowStride,\n v.pixelStride, v.rowStride\n ));\n }\n if (u.pixelStride != 1 && u.pixelStride != 2) {\n throw new IllegalArgumentException(\n \"Supported pixel strides for U and V planes are 1 and 2\"\n );\n }\n }", "public static boolean isTimeValid(String argTime, String format) {\n\t\tDateFormat timeFormat = new SimpleDateFormat(format);\n\t\ttimeFormat.setLenient(false);\n\t\ttry {\n\t\t\ttimeFormat.parse(argTime);\n\t\t} catch (ParseException e) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private static boolean validCommand(String line) {\n if (line.equals(\"GET\") || line.equals(\"BOARD\")) {\n return true;\n } else if (line.matches(\"PUT .*\")) {\n if (line.matches(\"PUT [1234]\")) {\n return true;\n } else {\n System.out.println(INVALID_PUT_COLUMN_ERROR_MESSAGE);\n return false;\n }\n } else {\n System.out.println(INVALID_COMMAND_ERROR_MESSAGE);\n return false;\n }\n }", "protected String getQuery(String query) {\r\n\t\treturn query;\r\n\t}", "protected String compileQuery(final String query, String result) throws IllegalArgumentException {\n\t\t\n\t\tif (query != null && ! query.isEmpty()) {\n\t\t\tfinal SelektQLErrorListener selektQLErrorListener = new SelektQLErrorListener();\n\t\t\tSelektQLLexer lexer = new SelektQLLexer(CharStreams.fromString(query));\n\t\t\tSelektQLParser parser = new SelektQLParser(new CommonTokenStream(lexer));\n\t\t\tparser.removeErrorListeners();\n\t\t\tparser.addErrorListener(selektQLErrorListener);\n\t\t\tresult = selektQL2Solr.visit(parser.anfrage());\n\t\t\tif (selektQLErrorListener.error) {\n\t\t\t\tthrow new IllegalArgumentException(\"Fehler beim Kompilieren der Anfrage \" + query);\n\t\t\t}\n\t\t} \n\t\treturn result;\n\t}", "public boolean checkData(String data){\n\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd\");\n\t dateFormat.setLenient(false);\n\t try {\n\t\t\tdateFormat.parse(data.trim());\n\t\t} catch (java.text.ParseException e) {\n\t\t\treturn false;\n\t\t}\n\t return true;\n\t}", "public InvalidDateTimeFormatException(String dateOrTime, String format) {\n super(String.format(\"%s should be in the form of <%s>\", dateOrTime, format));\n }", "@Test\n public void parse_emptyInvalidArgs_throwsParseException() {\n assertParseFailure(parser, ParserUtil.EMPTY_STRING, String.format(MESSAGE_INVALID_COMMAND_FORMAT,\n SortCommand.MESSAGE_USAGE));\n }", "public static boolean isWildcard(String format) {\n String routerUrl = cleanUrl(format);\n String[] routerParts = routerUrl.split(\"/\");\n\n for (String routerPart : routerParts) {\n if (routerPart.length() > 2\n && routerPart.charAt(0) == ':'\n && routerPart.charAt(routerPart.length() - 1) == ':') {\n return true;\n }\n }\n return false;\n }", "private boolean parseArguments(String input) {\r\n\t\tString arguments[] = input.split(\" \");\r\n\t\tif (arguments.length == TWO_ARGUMENTS) {\r\n\t\t\tmailbox = arguments[ARRAY_SECOND_ELEMENT].trim();\r\n\t\t\tpassword = arguments[ARRAY_THIRD_ELEMENT].trim();\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\t\t\r\n\t}", "private boolean checkAddrInputFields(){\n \tboolean same = textFieldCurrents.get(jTextFieldStart).equals(jTextFieldStart.getText()) &&\n\t\t\t\ttextFieldCurrents.get(jTextFieldEnd).equals(jTextFieldEnd.getText()) &&\n\t\t\t\tjComboBoxFormat.getSelectedIndex() == selectedFormat &&\n\t\t\t\tjCheckBoxQuickSearch.isSelected() == quickSearch;\n \t\n \tif(DEBUG){\n \t\toutputResults(\"lasts:\");\n \t\toutputResults(textFieldCurrents.get(jTextFieldStart));\n\t\t\toutputResults(textFieldCurrents.get(jTextFieldEnd));\n\t\t\toutputResults(\"\"+jComboBoxFormat.getSelectedIndex()); \n\t\t\toutputResults(\"nows:\");\n\t\t\toutputResults(jTextFieldEnd.getText());\n\t\t\toutputResults(jTextFieldStart.getText());\n\t\t\toutputResults(\"\"+selectedFormat);\n \t}\n \t\n \tif(!same){\n \t\tjButtonGetDirections.setText(\"Find Directions!\");\n \t}else{\n \t\tjButtonGetDirections.setText(\"Refresh Map\");\n \t}\n \treturn same;\n }", "protected boolean isValidPDSFormat(String[] listing) {\n String[] aLine;\n for (int i=1; i<listing.length; i++) {\n aLine = splitMVSLine(listing[i]);\n if (aLine.length != 9) { // 9 because there are two fields for changed...\n log4j.error(BaseMessages.getString(PKG, \"MVSFileParser.ERROR.Invalid.PDS.Line\", listing[i])); //$NON-NLS-1$\n return false;\n }\n if (dateFormatString != null) {\n if (!checkDateFormat(aLine[3])) {\n return false;\n }\n } else {\n guessDateFormat(aLine[2]);\n }\n }\n return true;\n }", "@ResponseBody\n @ExceptionHandler(InvalidFieldFormatException.class)\n @ResponseStatus(HttpStatus.BAD_REQUEST)\n String wrongFieldFormatHandler(InvalidFieldFormatException ex) {\n return ex.getMessage();\n }", "private static boolean checkValue(String rawValue) {\n\t\trawValue = rawValue.trim();\n\t\tif (!rawValue.startsWith(\"\\\"\")) {\n\t\t\treturn true;\n\t\t}\n\t\tif (!rawValue.endsWith(\"\\\"\")) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\n\t}", "private static boolean validateInput2(String[] input) {\n\t\tif (input.length != 2) {\n\t\t\tSystem.out.println(ErrorType.UNKNOWN_COMMAND);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public static boolean isFourthArgumentValid(String input) {\n\t\tif (CommonUtils.isNotNullOrEmpty(input) && isValidCurrency(input))\n\t\t\treturn true;\n\t\treturn false;\n\t}", "protected void checkXpathFormat(String xpath) {\n\t\tif (!Selectors.isXPath(xpath)) {\n\t\t\texceptionLauncher.throwSerenityExeption(new Exception(),\n\t\t\t\t\tString.format(\"The format for the xpath [%s] is not correct.\", xpath));\n\t\t}\n\t}", "public boolean isInputValid(ConversationContext context, String s)\r\n/* */ {\r\n/* 135 */ return (s.equalsIgnoreCase(\"one\")) || (s.equals(\"1\")) || (s.equalsIgnoreCase(\"two\")) || (s.equals(\"2\")) || (s.equalsIgnoreCase(\"zero\")) || (s.equals(\"0\"));\r\n/* */ }", "private static boolean validateInput1(String[] input) {\n\t\tif (input.length != 1) {\n\t\t\tSystem.out.println(ErrorType.UNKNOWN_COMMAND);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public static String substKeysCheckFormat(String format) throws HISDateException {\r\n String formatStr = format;\r\n // Trimmen und in Großschrift konvertieren:\r\n formatStr = formatStr.trim().toUpperCase();\r\n // Schlüsselworte für Format checken und ersetzen:\r\n if (formatStr.equals(\"GERMAN\")) {\r\n formatStr = \"DMY.\";\r\n } else if (formatStr.equals(\"ISO\")) {\r\n formatStr = \"YMD-\";\r\n } else if (formatStr.equals(\"ENGLISH\")) {\r\n formatStr = \"DMY/\";\r\n } else if (formatStr.equals(\"US\")) {\r\n formatStr = \"MDY/\";\r\n // TODO: Sind die letzten beiden richtig ??\r\n // Gibts noch andere ?? Mit guessFormat() abgleichen !!!\r\n } else {\r\n // Nicht als Schlüsselwort gegebene Formatangabe prüfen...\r\n HISDate.checkFormat(formatStr);\r\n }\r\n return formatStr;\r\n }", "boolean hasQueryParams();", "boolean isSQL();", "@Test\n public void parse_invalidArgs_throwsParseException() {\n assertParseFailure(parser, INVALID_ARG, String.format(MESSAGE_INVALID_COMMAND_FORMAT,\n SortCommand.MESSAGE_USAGE));\n }", "private static void validate(int type, int field, int match, String value) {\n if ((type != Type.SONG) && (field == Field.PLAY_COUNT || field == Field.SKIP_COUNT)) {\n throw new IllegalArgumentException(type + \" type does not have field \" + field);\n }\n // Only Songs have years\n if (type != Type.SONG && field == Field.YEAR) {\n throw new IllegalArgumentException(type + \" type does not have field \" + field);\n }\n // Only Songs have dates added\n if (type != Type.SONG && field == Field.DATE_ADDED) {\n throw new IllegalArgumentException(type + \" type does not have field \" + field);\n }\n\n if (field == Field.ID) {\n // IDs can only be compared by equals or !equals\n if (match == Match.CONTAINS || match == Match.NOT_CONTAINS\n || match == Match.LESS_THAN || match == Match.GREATER_THAN) {\n throw new IllegalArgumentException(\"ID cannot be compared by method \" + match);\n }\n // Make sure the value is actually a number\n try {\n //noinspection ResultOfMethodCallIgnored\n Long.parseLong(value);\n } catch (NumberFormatException e) {\n Crashlytics.logException(e);\n throw new IllegalArgumentException(\"ID cannot be compared to value \" + value);\n }\n } else if (field == Field.NAME) {\n // Names can't be compared by < or >... that doesn't even make sense...\n if (match == Match.GREATER_THAN || match == Match.LESS_THAN) {\n throw new IllegalArgumentException(\"Name cannot be compared by method \"\n + match);\n }\n } else if (field == Field.SKIP_COUNT || field == Field.PLAY_COUNT\n || field == Field.YEAR || field == Field.DATE_ADDED) {\n // Numeric values can't be compared by contains or !contains\n if (match == Match.CONTAINS || match == Match.NOT_CONTAINS) {\n throw new IllegalArgumentException(field + \" cannot be compared by method \"\n + match);\n }\n // Make sure the value is actually a number\n try {\n //noinspection ResultOfMethodCallIgnored\n Long.parseLong(value);\n } catch (NumberFormatException e) {\n Crashlytics.logException(e);\n throw new IllegalArgumentException(\"ID cannot be compared to value \" + value);\n }\n }\n }", "void checkRewrite(\n SqlValidator validator,\n String query,\n String expectedRewrite);", "private static boolean isParsable(String input) {\n try {\n Integer.parseInt(input);\n return true;\n } catch (NumberFormatException e) {\n return false;\n }\n }", "private static boolean validate(String line){\n\t\tString[] lineArray = line.split(\" \");\n\t\t\n\t\tif(lineArray.length != 3) return false; //skip lines in incorrect format\n\t\t\n\t\t//http://stackoverflow.com/questions/25873636/regex-pattern-for-exactly-hhmmss-time-string\n\t\tif(!lineArray[0].matches(\"(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)\")) return false;\n\n\t\tif(!lineArray[2].equals(\"Start\") && !lineArray[2].equals(\"End\")) return false;\n\t\t\n\t\treturn true;\n\t}", "@Override\n public boolean isValidFormat(String[] listing) {\n\n if (log4j.isDebugEnabled()) {log4j.debug(BaseMessages.getString(PKG, \"MVSFileParser.DEBUG.Checking.Parser\"));} //$NON-NLS-1$\n if (listing.length > 0) {\n String[] header = splitMVSLine(listing[0]); // first line of MVS listings is a header\n if ( (header.length == FOLDER_LISTING_LENGTH_NORMAL) || (header.length == FOLDER_LISTING_LENGTH_ARCIVE) ) {\n if (header[FOLDER_HEADER_TYPE_IDX].equals(HEADER_VOLUME) ) { \n this.partitionedDataset = false; // This is a directory listing, not PDS listing\n if (log4j.isInfoEnabled()) {log4j.debug(BaseMessages.getString(PKG, \"MVSFileParser.INFO.Detected.Dir\"));} //$NON-NLS-1$\n return isValidDirectoryFormat(listing);\n } else if (header[FOLDER_HEADER_TYPE_IDX].equals(HEADER_NAME)) { \n this.partitionedDataset = true; // Suspect PDS listing.\n if (log4j.isInfoEnabled()) {log4j.debug(BaseMessages.getString(PKG, \"MVSFileParser.INFO.Detected.PDS\"));} //$NON-NLS-1$\n return isValidPDSFormat(listing);\n }\n }\n }\n return false;\n }", "public static QueryOptions checkQueryOptions(QueryOptions options) throws Exception {\n QueryOptions filteredQueryOptions = new QueryOptions(options);\n Iterator<Map.Entry<String, Object>> iterator = filteredQueryOptions.entrySet().iterator();\n while (iterator.hasNext()) {\n Map.Entry<String, Object> entry = iterator.next();\n if (acceptedValues.contains(entry.getKey())) {\n if (entry.getValue() == null || entry.toString().isEmpty()) {\n iterator.remove();\n } else {\n //TODO: check type\n }\n } else {\n iterator.remove();\n System.out.println(\"Unknown query param \" + entry.getKey());\n }\n }\n return filteredQueryOptions;\n }", "String buildGenericBooleanQuery(String[] fields, String[] vals,\n\t\t\tString[] parsed, String operator, int from, int size,\n\t\t\tDomeoPermissions permissions3) {\n\t\tStringBuffer sb = new StringBuffer(\"{ \");\n\n\t\t// Check for starting position (from) and max results (size)\n\t\tif ((from > -1) && (size > -1)) {\n\t\t\tsb.append(\"\\\"from\\\" : \" + from + \", \\\"size\\\" : \" + size + \", \");\n\t\t} else if (from > -1) { // from only, no size\n\t\t\tsb.append(\"\\\"from\\\" : \" + from + \", \");\n\t\t} else if (size > -1) { // size only, no from\n\t\t\tsb.append(\"\\\"size\\\" : \" + size + \", \");\n\t\t}\n\n\t\t// Use \"fields\" to limit fields returned in results\n\t\tsb.append(\"\\\"fields\\\" : [\\\"_id\\\"], \\\"query\\\" : { \\\"bool\\\" : { \");\n\n\t\t// Operator AND -> must and OR -> should\n\t\tif (operator.equals(AND_OPERATOR)) {\n\t\t\tsb.append(\"\\\"must\\\" : [ \");\n\t\t} else {\n\t\t\tsb.append(\"\\\"should\\\" : [ \");\n\t\t}\n\n\t\t// Append clause for each field\n\t\tfor (int i = 0; i < fields.length; i++) {\n\t\t\tif (i != 0) {\n\t\t\t\tsb.append(\", \");\n\t\t\t}\n\t\t\tsb.append(\"{ \" + \"\\\"\" + parsed[i] + \"\\\"\" + \" : { \" + \"\\\"\"\n\t\t\t\t\t+ fields[i] + \"\\\" : \" + \"\\\"\" + vals[i] + \"\\\"\" + \"} }\");\n\t\t}\n\t\tif (permissions3 == null) {\n\t\t\tsb.append(\"] } } }\");\n\t\t} else {\n\t\t\tString filter = permissions3.buildQueryFilter();\n\t\t\tsb.append(\"] } } \" + filter + \" } \");\n\n\t\t\t// sb.append(\"] } }, \\\"filter\\\" : { \\\"term\\\" : { \\\"\" +\n\t\t\t// permissions.key.getValue().toString() + \"\\\" : \" + \"\\\"\" +\n\t\t\t// permissions.value + \"\\\" } } } \");\n\t\t}\n\n\t\treturn sb.toString();\n\t}", "public void setQuery (String q)\n\t throws QueryParseException\n {\n\n\tthis.q = new Query ();\n\tthis.q.parse (q);\n\n\tthis.badQuery = false;\n\tthis.exp = null;\n\n\tthis.checkFrom ();\n\n }", "String getQuery();", "@Override\n public boolean onQueryTextSubmit(String query) {\n return true;\n }", "@Override\n public boolean onQueryTextSubmit(String query) {\n return true;\n }", "public boolean onQueryTextSubmit(String query) {\n return false;\n }", "public boolean onQueryTextSubmit (String query) {\n return true;\n }", "public boolean canUseSchema(FormatSchema schema)\n/* */ {\n/* 445 */ if (schema == null) {\n/* 446 */ return false;\n/* */ }\n/* 448 */ String ourFormat = getFormatName();\n/* 449 */ return (ourFormat != null) && (ourFormat.equals(schema.getSchemaType()));\n/* */ }", "private void validateDateTimeFormat(String dateTimeLoadFormat, String dateTimeLoadOption)\r\n throws InvalidLoadOptionException {\r\n // allowing empty value to be configured for dateformat option.\r\n if (dateTimeLoadFormat != null && !dateTimeLoadFormat.trim().equalsIgnoreCase(\"\")) {\r\n try {\r\n new SimpleDateFormat(dateTimeLoadFormat);\r\n } catch (IllegalArgumentException e) {\r\n throw new InvalidLoadOptionException(\r\n \"Error: Wrong option: \" + dateTimeLoadFormat + \" is provided for option \"\r\n + dateTimeLoadOption);\r\n }\r\n }\r\n }", "@RequestMapping(value = \"invalidformat\", method = { RequestMethod.POST, RequestMethod.GET })\n\tpublic String invalidFormat(@RequestParam(value = \"who\", required = false) String mobileNo,\n\t\t\t@RequestParam(value = \"what\", required = false) String smsContent,\n\t\t\t@RequestParam(value = \"operator\", required = false) String operator,\n\t\t\t@RequestParam(value = \"carrier\", required = false) String carrier,\n\t\t\t@RequestParam(value = \"datetime\", required = false) String datetime, HttpServletRequest request) {\n\t\tString response = \"FAILURE\";\n\t\tSMS sms = new SMS(mobileNo, smsContent, operator, carrier, datetime);\n\t\tresponse = smsIntegrationService.handleInvalidSubkeyword(sms);\n\t\treturn response;\n\t}", "private static String checkInputParamType(InputParam inputParam) {\r\n\t\tString type = inputParam.getType();\r\n\t\tString value = null;\r\n\t\tswitch (type) {\r\n\t\tcase BPConstant.STRING:\r\n\t\t\tvalue = inputParam.getInputParamvalue().getStringValue();\r\n\t\t\tbreak;\r\n\t\tcase BPConstant.BOOLEAN:\r\n\t\t\tvalue = inputParam.getInputParamvalue().getBooleanValue();\r\n\t\t\tbreak;\r\n\t\tcase BPConstant.DATE_TIME:\r\n\t\t\tvalue = inputParam.getInputParamvalue().getDateValue();\r\n\t\t\tbreak;\r\n\t\tcase BPConstant.NUMBER:\r\n\t\t\tvalue = inputParam.getInputParamvalue().getIntValue();\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tvalue = BPConstant.EMPTY_STRING;\r\n\t\t}\r\n\t\treturn value;\r\n\t}", "@Override\n public boolean onQueryTextSubmit(String query) {\n return false;\n }", "@Override\n public boolean onQueryTextSubmit(String query) {\n return false;\n }", "@Override\n public boolean onQueryTextSubmit(String query) {\n return false;\n }", "@Override\n public boolean onQueryTextSubmit(String query) {\n return false;\n }", "@Override\n\t\tpublic boolean onQueryTextSubmit(String query) {\n\t\t\treturn false;\n\t\t}" ]
[ "0.76538837", "0.63320124", "0.62937236", "0.58807445", "0.5770947", "0.57396173", "0.5724959", "0.57191294", "0.5656323", "0.55946714", "0.55779815", "0.5559525", "0.54451346", "0.5437078", "0.541525", "0.5404432", "0.5382357", "0.53506553", "0.5240209", "0.5216756", "0.52142686", "0.51946527", "0.5155367", "0.51415217", "0.5130022", "0.50775725", "0.50719124", "0.5066068", "0.5047851", "0.50409925", "0.5030177", "0.5021902", "0.50177294", "0.50166535", "0.5015677", "0.50150675", "0.49907035", "0.49880216", "0.49826747", "0.49807173", "0.4979162", "0.49769223", "0.4973717", "0.49673012", "0.49573228", "0.49551022", "0.49536026", "0.49404594", "0.49197343", "0.49197343", "0.49114904", "0.4904947", "0.4902812", "0.49013084", "0.48886174", "0.4878676", "0.48649096", "0.48649067", "0.48560846", "0.48409864", "0.48288554", "0.48240748", "0.48151302", "0.48064333", "0.48031932", "0.48022428", "0.4788571", "0.47846732", "0.4769996", "0.47576123", "0.47571656", "0.4756153", "0.47512433", "0.47453937", "0.47396338", "0.4737359", "0.47319186", "0.4730385", "0.47287723", "0.47087473", "0.47035792", "0.46998936", "0.4699421", "0.46984366", "0.46979102", "0.46968436", "0.46918675", "0.46822673", "0.46804512", "0.46804512", "0.46721488", "0.46614054", "0.46578336", "0.46485427", "0.46466976", "0.4636153", "0.4632848", "0.4632848", "0.4632848", "0.4632848", "0.463068" ]
0.0
-1
Checks the comparators string list
private void checkComparators() { val message = "Comparators setting is not valid!"; val comparators = config.getStringList("comparators"); try { comparators.forEach(MovieComparator.Type::valueOf); } catch (IllegalArgumentException e) { throw new IllegalArgumentException(message); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void checkListOrder(String[] sortedList, Collator c) {\n for (int i = 0; i < sortedList.length - 1; i++) {\n if (c.compare(sortedList[i], sortedList[i + 1]) >= 0) {\n errln(\"List out of order at element #\" + i + \": \"\n + sortedList[i] + \" >= \"\n + sortedList[i + 1]);\n }\n }\n }", "@Test (priority = 1)\n public void sortAlphabetical(){\n\n for (int i = 0; i < allDepartments.getOptions().size()-1; i++) {\n String current = allDepartments.getOptions().get(i).getText();\n String next = allDepartments.getOptions().get(i+1).getText();\n\n System.out.println(\"comparing: \" + current + \" with \"+ next);\n\n Assert.assertTrue(current.compareTo(next)<=0);\n\n }\n }", "public void testCompareStrings() {\n\t\tString one = \"Hello\";\n\t\tString two = \"in the house\";\n\t\t//Gro▀schreibung vor Kleinschreibung\n\t\tassertTrue(comp.compareStrings(one, two) < 0);\n\t\tassertEquals(0, comp.compareStrings(one, one));\n\t\tassertTrue(comp.compareStrings(two, one) > 0);\n\t}", "boolean areAllDefaultComparators(\n InteropLibrary interop, HostValueToEnsoNode hostValueToEnsoNode, Object comparators) {\n assert interop.hasArrayElements(comparators);\n var ctx = EnsoContext.get(this);\n try {\n int compSize = (int) interop.getArraySize(comparators);\n for (int i = 0; i < compSize; i++) {\n assert interop.isArrayElementReadable(comparators, i);\n Object comparator = hostValueToEnsoNode.execute(interop.readArrayElement(comparators, i));\n if (!isDefaultComparator(comparator, ctx)) {\n return false;\n }\n }\n } catch (UnsupportedMessageException | InvalidArrayIndexException e) {\n throw new IllegalStateException(\"Should not be reachable\", e);\n }\n return true;\n }", "@Test\n\tpublic void testValidateSortOrder() {\n\t\ttry {\n\t\t\tfor(String emptyValue : ParameterSets.getEmptyValues()) {\n\t\t\t\tAssert.assertNull(SurveyResponseValidators.validateSortOrder(emptyValue));\n\t\t\t}\n\t\t\t\n\t\t\ttry {\n\t\t\t\tSurveyResponseValidators.validateSortOrder(\"Invalid value.\");\n\t\t\t\tfail(\"The survey response sort order was invalid.\");\n\t\t\t}\n\t\t\tcatch(ValidationException e) {\n\t\t\t\t// Passed.\n\t\t\t}\n\t\t\t\n\t\t\tSet<List<SortParameter>> permutations = \n\t\t\t\tgetUniqueSets(Arrays.asList(SortParameter.values()));\n\t\t\t\n\t\t\tfor(List<SortParameter> permutation : permutations) {\n\t\t\t\tint length = permutation.size();\n\t\t\t\tStringBuilder permutationStringBuilder = new StringBuilder();\n\t\t\t\t\n\t\t\t\tint count = 1;\n\t\t\t\tfor(SortParameter sortParameter : permutation) {\n\t\t\t\t\tpermutationStringBuilder.append(sortParameter.toString());\n\t\t\t\t\t\n\t\t\t\t\tif(count != length) {\n\t\t\t\t\t\tpermutationStringBuilder.append(InputKeys.LIST_ITEM_SEPARATOR);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tString permutationString = permutationStringBuilder.toString();\n\t\t\t\t\n\t\t\t\tAssert.assertEquals(permutation, SurveyResponseValidators.validateSortOrder(permutationString));\n\t\t\t}\n\t\t}\n\t\tcatch(ValidationException e) {\n\t\t\tfail(\"A validation exception was thrown: \" + e.getMessage());\n\t\t}\n\t}", "static void perform_cmp(String passed){\n\t\tint type = type_of_cmp(passed);\n\t\tswitch(type){\n\t\tcase 1:\n\t\t\tcmp_with_reg(passed);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcmp_with_mem(passed);\n\t\t\tbreak;\n\t\t}\n\t}", "protected void checkComponentList()\n {\n String lsLeft ;\n String lsDocComp ;\n int liDotIdx ;\n int liNumComps ;\n Hashtable loCompHash = new Hashtable( 5 ) ;\n\n for ( int liCtr = 1 ; liCtr <= 5 ; liCtr++ )\n {\n lsLeft = getData( \"AND_COND_LHS_\" + liCtr ).getString() ;\n if ( lsLeft != null )\n {\n liDotIdx = lsLeft.indexOf( '.' ) ;\n if ( liDotIdx >= 0 )\n {\n lsDocComp = lsLeft.substring( 0, liDotIdx ) ;\n } /* end if ( liDotIdx >= 0 ) */\n else\n {\n lsDocComp = lsLeft ;\n } /* end else */\n loCompHash.put( lsDocComp, lsDocComp ) ;\n } /* end if ( lsLeft != null ) */\n } /* end for ( int liCtr = 1 ; liCtr <= 5 ; liCtr++ ) */\n\n liNumComps = loCompHash.size() ;\n if ( liNumComps > 2 )\n {\n raiseException( \"%c:Q0089%\" ) ;\n } /* end if ( liNumComps > 2 ) */\n else if ( liNumComps == 2 )\n {\n Enumeration leComps = loCompHash.elements() ;\n String lsComp1 = (String)leComps.nextElement() ;\n String lsComp2 = (String)leComps.nextElement() ;\n\n if ( ( !lsComp1.endsWith( \"_DOC_HDR\" ) ) &&\n ( !lsComp2.endsWith( \"_DOC_HDR\" ) ) )\n {\n raiseException( \"%c:Q0089%\" ) ;\n } /* end if ( ( !lsComp1.endsWith( \"_DOC_HDR\" ) ) && . . . */\n } /* end else if ( liNumComps == 2 ) */\n }", "public abstract int compare(String s1, String s2) throws NumberFormatException, ParseException;", "public void testTableColumnStringComparator()\n throws TableException\n {\n\t\tTableColumn<String> tableColumn = new TableColumn<String>(\"name\", comparator);\n\t\tassertSame(tableColumn.getComparator(), comparator);\n\t\tassertNotNull(tableColumn.getReverseComparator());\n\t\tassertNotSame(tableColumn.getReverseComparator(), tableColumn.getComparator());\n\t\tassertEquals(tableColumn.isSortable(), true);\n assertEquals(tableColumn.getReverseComparator().compare(a, b),\n tableColumn.getComparator().compare(b, a));\n }", "public void testers() {\r\n assertEquals(\"A\", name1.getFirstName());\r\n assertEquals(\"B\", name1.getLastName());\r\n assertEquals(\"William\", name2.getMiddleName());\r\n name2.setFirstName(\"Luke\");\r\n assertEquals(\"Luke\", name2.getFirstName());\r\n name3.setLastName(\"Smith\");\r\n assertEquals(\"Smith\", name3.getLastName());\r\n name2.setMiddleName(\"Mike\");\r\n assertEquals(\"Mike\", name2.getMiddleName());\r\n boolean result1 = false;\r\n if (0 == name1.compareTo(name1)) {\r\n result1 = true;\r\n }\r\n assertTrue(result1);\r\n boolean result2 = false;\r\n if (name1.compareTo(name2) == -1) {\r\n result2 = true;\r\n }\r\n assertTrue(result2);\r\n boolean result3 = false;\r\n if (name2.compareTo(name1) == 1) {\r\n result3 = true;\r\n }\r\n assertTrue(result3);\r\n boolean result4 = false;\r\n if (name3.compareTo(name4) == -1) {\r\n result4 = true;\r\n }\r\n assertTrue(result4);\r\n\r\n boolean result5 = false;\r\n if (name4.compareTo(name3) == 1) {\r\n result5 = true;\r\n }\r\n assertTrue(result1);\r\n assertTrue(result2);\r\n assertTrue(result3);\r\n assertTrue(result4);\r\n assertTrue(result5);\r\n }", "private static Comparator<String> getItemNameComparator()\n\t{\n\t\tComparator<String> c = new Comparator<String>() {\n\t\t\tpublic int compare(String a, String b)\n\t\t\t{\n\t\t\t\tString help = StandardOptions.HELP.toString();\n\t\t\t\tif (a.equalsIgnoreCase(help))\n\t\t\t\t{\n\t\t\t\t\treturn b.equalsIgnoreCase(help) ? 0 : 1;\n\t\t\t\t}\n\t\t\t\telse if (b.equalsIgnoreCase(help)) // Only b is help, so a < b\n\t\t\t\t{\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\telse // neither are help\n\t\t\t\t{\n\t\t\t\t\treturn a.compareToIgnoreCase(b);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\treturn c;\n\t}", "@Test\n public void should_fail_if_actual_does_not_start_with_sequence_according_to_custom_comparison_strategy() {\n assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> {\n Iterator<String> names = asList(\"Luke\", \"Leia\").iterator();\n String[] sequence = { \"Han\", \"C-3PO\" };\n assertThat(names).usingElementComparator(CaseInsensitiveStringComparator.instance).startsWith(sequence);\n });\n }", "static public java.lang.String genComparisons (org.apache.spark.sql.catalyst.expressions.codegen.CodegenContext ctx, scala.collection.Seq<org.apache.spark.sql.catalyst.expressions.SortOrder> ordering) { throw new RuntimeException(); }", "public static String getStrcmpConstraints(String left, String right){\n\t\treturn compare(left, right, 0);\n\t}", "private Comparator parseString(final String val) {\n\t\tComparator ret = null;\n\t\tfor (Comparator comp : Comparator.values()) {\n\t\t\tif (comp.toParseString().equals(val)) {\n\t\t\t\tret = comp;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}", "public boolean compareTo(\n String tokens_[],\n String labels_[],\n String types_[],\n String constrType_[],\n String dependId_[],\n int connectQty_[],\n int componentId_[]) throws Exception {\n int N = tokens_.length;\n \n ArrayList<String> tokens = new ArrayList<String>();\n ArrayList<String> labels = new ArrayList<String>(); \n ArrayList<FieldType> types = new ArrayList<FieldType>();\n ArrayList<ArrayList<ConstraintType>> constrType \n = new ArrayList<ArrayList<ConstraintType>>();\n ArrayList<ArrayList<Integer>> dependId\n = new ArrayList<ArrayList<Integer>>();\n ArrayList<Integer> connectQty = new ArrayList<Integer>();\n ArrayList<Integer> componentId = new ArrayList<Integer>();\n \n if (labels_.length != N) throw new Exception(\n String.format(\"labels len (%d) != tokens len (%d), args))\", \n N, labels_.length));\n if (types_.length != N) throw new Exception(\n String.format(\"labels len (%d) != types len (%d), args))\", \n N, types_.length));\n if (constrType_.length != N) throw new Exception(\n String.format(\"labels len (%d) != constrType len (%d), args))\", \n N, constrType_.length));\n if (dependId_.length != N) throw new Exception(\n String.format(\"dependId len (%d) != dependId len (%d), args))\", \n N, dependId_.length));\n if (connectQty_.length != N) throw new Exception(\n String.format(\"labels len (%d) != connectQty len (%d), args))\", \n N, connectQty_.length));\n if (componentId_.length != N) throw new Exception(\n String.format(\"labels len (%d) != componentId len (%d), args))\", \n N, componentId_.length)); \n \n for (int i = 0; i < N; ++i) {\n tokens.add(tokens_[i]);\n labels.add(labels_[i]);\n types.add(FieldType.valueOf(types_[i]));\n ArrayList<ConstraintType> ct = new ArrayList<ConstraintType>();\n for (String t:constrType_[i].split(\"[,]\")) \n if (!t.isEmpty()) { \n // \"\".split(\",\") returns [\"\"] \n try {\n ct.add(ConstraintType.valueOf(t));\n } catch (java.lang.IllegalArgumentException e) {\n throw new Exception(\"Failed to parse the constraint value: '\" + t + \"'\");\n }\n }\n constrType.add(ct);\n ArrayList<Integer> it = new ArrayList<Integer>();\n for (String t:dependId_[i].split(\"[,]\")) \n if (!t.isEmpty()) { \n // \"\".split(\",\") returns [\"\"] \n try {\n it.add(Integer.valueOf(t));\n } catch (java.lang.IllegalArgumentException e) {\n throw new Exception(\"Failed to parse the dependent id value: '\" + t + \"'\");\n }\n }\n dependId.add(it);\n connectQty.add(connectQty_[i]);\n }\n \n boolean bTokens = DeepEquals.deepEquals(mTokens, tokens);\n boolean bLabels = DeepEquals.deepEquals(mLabels, labels);\n boolean bTypes = DeepEquals.deepEquals(mTypes, types);\n boolean bConstrType = DeepEquals.deepEquals(mConstrType, constrType);\n boolean bDependId = DeepEquals.deepEquals(mDependId, dependId);\n boolean bConnectQty = DeepEquals.deepEquals(mConnectQty, connectQty);\n boolean bComponentId= DeepEquals.deepEquals(mComponentId, componentId);\n boolean bFinal = bTokens && bLabels && bTypes && \n bConstrType && bDependId && bConnectQty;\n if (!bFinal) {\n System.out.println(String.format(\"Comparison failed: \\n\" +\n \" Tokens : %b \\n\" +\n \" Labels : %b \\n\" + \n \" Types : %b \\n\" + \n \" ConstrType : %b \\n\" + \n \" DependId : %b \\n\" + \n \" ConnectQty : %b \\n\" +\n \" ComponentId : %b \\n\",\n bTokens, bLabels, bTypes, bConstrType, bDependId, \n bConnectQty, bComponentId\n ));\n }\n \n return bFinal;\n }", "@Test\r\n public void test8() {\r\n String s1 = \"Abc\";\r\n String s2 = \"abc\";\r\n String s3 = \"Abcd\";\r\n System.out.println(s1.compareTo(s2));\r\n System.out.println(s1.compareTo(s3));\r\n }", "@Override\r\n\t\t\t\t\tpublic int compare(String[] arg0, String[] arg1) {\n\t\t\t\t\t\treturn arg0[2].compareTo(arg1[2]);\r\n\t\t\t\t\t}", "@Override\r\n\t\t\t\t\tpublic int compare(String[] arg0, String[] arg1) {\n\t\t\t\t\t\treturn arg0[2].compareTo(arg1[2]);\r\n\t\t\t\t\t}", "@Override\r\n\t\t\t\t\tpublic int compare(String[] arg0, String[] arg1) {\n\t\t\t\t\t\treturn arg0[2].compareTo(arg1[2]);\r\n\t\t\t\t\t}", "public static void verifyStringsAreInOrder(ArrayList<String> loadedStrings) {\n\t\tHashMap<String, Integer> lastAbbreviationNums = new HashMap<String, Integer>();\n\t\tString lastAbbreviation = \"\";\n\t\tfor (int i : foundStringsIndexList) {\n\t\t\tString abbreviation = extractAbbreviationFromString(loadedStrings.get(i));\n\t\t\tif (!abbreviation.equals(lastAbbreviation)) {\n\t\t\t\tString lettersAbbreviation = lettersAbbreviationAt(abbreviation, 0);\n\t\t\t\tint abbreviationNum = Integer.parseInt(abbreviation.substring(lettersAbbreviation.length()));\n\t\t\t\tInteger lastAbbreviationNum = lastAbbreviationNums.get(lettersAbbreviation);\n\t\t\t\tif (lastAbbreviationNum == null) {\n\t\t\t\t\tif (abbreviationNum != 1)\n\t\t\t\t\t\tSystem.out.println(abbreviation + \" not preceded by any abbreviation\");\n\t\t\t\t} else {\n\t\t\t\t\tif (abbreviationNum != lastAbbreviationNum + 1)\n\t\t\t\t\t\tSystem.out.println(abbreviation + \" preceded by \" + lettersAbbreviation + lastAbbreviationNum);\n\t\t\t\t}\n\t\t\t\tlastAbbreviationNums.put(lettersAbbreviation, abbreviationNum);\n\t\t\t\tlastAbbreviation = abbreviation;\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\t\t\t\t\tpublic int compare(String[] arg0, String[] arg1) {\n\t\t\t\t\t\treturn arg0[3].compareTo(arg1[3]);\r\n\t\t\t\t\t}", "@Override\n public int compare(String lhs, String rhs) {\n return lhs.compareTo(rhs);\n }", "public void testTableColumnStringComparatorComparator()\n \tthrows TableException\n {\n \n\t\tTableColumn<String> tableColumn = new TableColumn<String>(\"name\", comparator, reverseComparator);\n\t\tassertSame(tableColumn.getComparator(), comparator);\n\t\tassertSame(tableColumn.getReverseComparator(), reverseComparator);\n\t\tassertNotSame(tableColumn.getReverseComparator(), comparator);\n\t\tassertEquals(tableColumn.isSortable(), true);\n\t\tassertEquals(tableColumn.getReverseComparator().compare(a, b),\n\t\t\t\t\ttableColumn.getComparator().compare(b, a));\n\n\t\ttableColumn = new TableColumn<String>(\"name\", null, reverseComparator);\n\t\tassertNotNull(tableColumn.getComparator());\n\t\tassertNotSame(tableColumn.getComparator(), reverseComparator);\n\t\tassertSame(tableColumn.getReverseComparator(), reverseComparator);\n\t\tassertEquals(tableColumn.isSortable(), true);\n assertEquals(tableColumn.getReverseComparator().compare(a, b),\n tableColumn.getComparator().compare(b, a));\n }", "@Override\r\n\t\t\t\t\tpublic int compare(String[] arg0, String[] arg1) {\n\t\t\t\t\t\treturn arg0[1].compareTo(arg1[1]);\r\n\t\t\t\t\t}", "@Override\r\n\t\t\t\t\tpublic int compare(String[] arg0, String[] arg1) {\n\t\t\t\t\t\treturn arg0[1].compareTo(arg1[1]);\r\n\t\t\t\t\t}", "private static Comparator<String> arbitraryStringComparator(String... stringsInOrder) {\n var arbitraryComparator = comparing((String s) -> ImmutableList.copyOf(stringsInOrder).reverse().indexOf(s));\n return arbitraryComparator.reversed().thenComparing(naturalOrder());\n }", "@Override\n public int compare(String left, String right) {\n return left.compareTo(right);\n }", "@Override\r\n\t\t\t\t\tpublic int compare(String[] arg0, String[] arg1) {\n\t\t\t\t\t\treturn arg0[0].compareTo(arg1[0]);\r\n\t\t\t\t\t}", "@Override\r\n\t\t\t\t\tpublic int compare(String[] arg0, String[] arg1) {\n\t\t\t\t\t\treturn arg0[0].compareTo(arg1[0]);\r\n\t\t\t\t\t}", "private boolean comp(String std, String test) {\n if (std == null || std.length() == 0) return true;\n if (test == null || test.length() == 0) return false;\n return std.equals(test);\n }", "public static boolean m66069b(Comparator<String> comparator, String[] strArr, String[] strArr2) {\n if (!(strArr == null || strArr2 == null || strArr.length == 0 || strArr2.length == 0)) {\n for (String str : strArr) {\n for (String compare : strArr2) {\n if (comparator.compare(str, compare) == 0) {\n return true;\n }\n }\n }\n }\n return false;\n }", "public void strComp() {\n\t\tSystem.out.printf(\"total word: %d\", userstring.size());\n\t\tint i = 0, j = 0, k = 0;\n\t\twhile (i < userstring.size() ) {\n\t\t\tif (userstring.get(i++).equalsIgnoreCase(masterString.get(j++))) {\n\t\t\t\t// user said correct word. update the array and total number of\n\t\t\t\t// matches\n\t\t\t\tmatchValues[k] = true;\n\t\t\t\ttotalCorrectMatches++;\n\t\t\t} \n\t\t\tk++;\n\t\t}\n\n\t}", "private final boolean compareStringValues(final String data1,\n\t\t\tfinal String data2, final String colName, final String key) {\n\t\tif (data1.equals(data2)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tContextComparator.addResult(namespace,\n\t\t\t\tContextComparatorConfigReferences.TEST_CATEGORY_COLUMN_VALUES,\n\t\t\t\tContextComparatorConfigReferences.TEST_STATUS_FAILED,\n\t\t\t\t\"Mismatch for \" + colName + \" for key \" + key\n\t\t\t\t+ \". \" + ContextComparator.CONTEXT_1.getName() + \": \" + data1\n\t\t\t\t+ \", \" + ContextComparator.CONTEXT_2.getName() + \": \" + data2);\n\t\treturn false;\n\t}", "public boolean compareCategory(String categoryList, String compareString) {\n\t\tif (categoryList.contains(\"|\" + compareString + \"|\"))\n\t\t\treturn true;\n\t\treturn false;\n\t}", "public boolean areStringComparisonsCaseInsensitive() {\n \t\treturn false;\n \t}", "private String[] compareKeys(String currentString) {\n String s1 = \"\";\n String s2 = \"\";\n String[] answer = new String[2];\n for(int i = 0; i < currentString.length(); i++) {\n if(currentString.charAt(i) == '|') {\n s1 = currentString.substring(0,i);\n s2 = currentString.substring(i + 1);\n }\n }\n int compare = s1.compareTo(s2);\n String lesser = \"\";\n String greater = \"\";\n if(compare < 1) {\n lesser = s1;\n greater = s2;\n }\n else{\n lesser = s2;\n greater = s1;\n }\n answer[0] = lesser;\n answer[1] = greater;\n return answer;\n }", "@Test\r\n\tvoid testRulesList() {\r\n\t\tassertSame(email1.getRulesPerMail().size(), 5);\r\n\t\tassertSame(email3.getRulesPerMail().size(), 2);\r\n\t\tassertNotEquals(email1.getRulesPerMail(), email3.getRulesPerMail());\r\n\t\tassertEquals(email1.getRulesPerMail(), email4.getRulesPerMail());\r\n\t}", "@Override\r\n\tpublic boolean isValid(List<String> checkList, ConstraintValidatorContext cvc) {\n\r\n\t\tif (checkList == null) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif (java.util.Arrays.asList(optionList).containsAll(checkList)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "public compare(){\r\n }", "private boolean checkComp() {\n\t\tfor (int i = 0; i < comp.length; i++) {\n\t\t\tfor (int j = 0; j < comp[i].length; j++) {\n\t\t\t\tif (comp[i][j] != answer[i][j]) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "@Test\n public void testSerialization() throws Exception {\n ExtendedRegexStringComparator a = new ExtendedRegexStringComparator(\"a|b\");\n ExtendedRegexStringComparator b = ExtendedRegexStringComparator.parseFrom(a.toByteArray());\n assertTrue(a.areSerializedFieldsEqual(b));\n assertTrue(b.getEngine() instanceof ExtendedRegexStringComparator.JavaRegexEngine);\n\n // joni engine\n a = new ExtendedRegexStringComparator(\"a|b\", ExtendedRegexStringComparator.EngineType.JONI);\n b = ExtendedRegexStringComparator.parseFrom(a.toByteArray());\n assertTrue(a.areSerializedFieldsEqual(b));\n assertTrue(b.getEngine() instanceof ExtendedRegexStringComparator.JoniRegexEngine);\n\n // re2j engine\n a = new ExtendedRegexStringComparator(\"a|b\", ExtendedRegexStringComparator.EngineType.RE2J);\n b = ExtendedRegexStringComparator.parseFrom(a.toByteArray());\n assertTrue(a.areSerializedFieldsEqual(b));\n assertTrue(b.getEngine() instanceof ExtendedRegexStringComparator.Re2JRegexEngine);\n\n // brics engine\n a = new ExtendedRegexStringComparator(\"a|b\", ExtendedRegexStringComparator.EngineType.BRICS);\n b = ExtendedRegexStringComparator.parseFrom(a.toByteArray());\n assertTrue(a.areSerializedFieldsEqual(b));\n assertTrue(b.getEngine() instanceof ExtendedRegexStringComparator.BricsRegexEngine);\n\n // fast brics engine\n a = new ExtendedRegexStringComparator(\"a|b\", ExtendedRegexStringComparator.EngineType.FAST_BRICS);\n b = ExtendedRegexStringComparator.parseFrom(a.toByteArray());\n assertTrue(a.areSerializedFieldsEqual(b));\n assertTrue(b.getEngine() instanceof ExtendedRegexStringComparator.FastBricsRegexEngine);\n\n // fastest brics engine\n a = new ExtendedRegexStringComparator(\"a|b\", ExtendedRegexStringComparator.EngineType.FASTEST_BRICS);\n b = ExtendedRegexStringComparator.parseFrom(a.toByteArray());\n assertTrue(a.areSerializedFieldsEqual(b));\n assertTrue(b.getEngine() instanceof ExtendedRegexStringComparator.FastBricsRegexEngine);\n\n }", "public static void main(String[] args) {\nString a = \"aab\";\nString b = \"baa\";\nSystem.out.println(compare(a,b));\n\t}", "@Override\r\n\t\t\t\t\tpublic int compare(String[] o1, String[] o2) {\n\t\t\t\t\t\treturn o1[0].compareTo(o2[0]);\r\n\t\t\t\t\t}", "@Override\n\t\t\tpublic int compare(String[] o1, String[] o2) {\n\t\t\t\treturn Integer.compare(Integer.parseInt(o1[0]),Integer.parseInt(o2[0]));\n\t\t\t}", "public String verifyDropDownListElementsInSorted(String object, String data) {\n\t\ttry {\n\n\t\t\tWebElement select = wait.until(explicitWaitForElement(By.xpath(OR.getProperty(object))));\n\t\t\tselect.click();\n\t\t\tboolean flag = false;\n\t\t\tList<WebElement> options = driver.findElements(By.xpath(OR.getProperty(object) + OR.getProperty(\"OPTION_TAG_DISPLAY\"))); // Modified By Karan\n\t\t\tList<String> actual_list = new ArrayList<String>();\n\t\t\tList<String> sortedlist = new ArrayList<String>();\n\t\t\tfor (int i = 0; i < options.size(); i++) {\n\t\t\t\tString name = options.get(i).getText();\n\t\t\t\tactual_list.add(name);\n\t\t\t\tsortedlist.add(name);\n\t\t\t}\n\t\t\tCollections.sort(sortedlist, String.CASE_INSENSITIVE_ORDER);\n\t\t\tlogger.debug(\"Actual List = \" + actual_list ); // Modified By Karan\n\t\t\tlogger.debug(\"Sorted List = \" + sortedlist );\t// Modified By Karan\n\t\t\tfor (int i = 0; i < sortedlist.size(); i++) {\n\t\t\t\tif (sortedlist.get(i).equals(actual_list.get(i))) {\n\t\t\t\t\tflag = true;\n\t\t\t\t} else {\n\t\t\t\t\tflag = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (flag)\n\t\t\t\treturn Constants.KEYWORD_PASS + \"--elements in drop down are in sorted order\";\n\t\t\telse\n\t\t\t\treturn Constants.KEYWORD_FAIL + \"--elements are not in sorted order\";\n\t\t} \n\t\tcatch(TimeoutException ex)\n\t\t\n\t\t{\n\t\t\treturn Constants.KEYWORD_FAIL +\"Cause: \"+ ex.getCause();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\n\t\t\treturn Constants.KEYWORD_FAIL + e.getLocalizedMessage();\n\t\t}\n\t}", "@Test\n public void testComp1()\n {\n System.out.println(\"comp\");\n String compString = \"A+1\";\n assertEquals(\"0110111\", N2TCode.comp(compString));\n }", "public void testCompareIgnoreCase() {\n\t\tString one = \"hello\";\n\t\tString two = \"In the house\";\n\t\t//h vor i\n\t\tassertTrue(comp.compareStrings(one, two) > 0);\n\t\tassertEquals(0, comp.compareStrings(one, one));\n\t\tassertTrue(comp.compareStrings(two, one) < 0);\n\t}", "private boolean isLexicographicOrder() {\n UISettings settings = UISettings.getInstance();\n\n //first first try the old way and fallback to the new method\n try {\n Field property = settings.getClass().getField(\"SORT_LOOKUP_ELEMENTS_LEXICOGRAPHICALLY\");\n Object value = property.get(settings);\n return value instanceof Boolean && Boolean.TRUE.equals(value);\n } catch (Exception e) {\n try {\n Method method = settings.getClass().getMethod(\"getSortLookupElementsLexicographically\");\n Object result = method.invoke(settings);\n\n return result instanceof Boolean && Boolean.TRUE.equals(result);\n } catch (Exception e1) {\n return false;\n }\n }\n }", "private boolean areCorrectlyOrdered( int i0, int i1 )\n {\n int n = commonLength( i0, i1 );\n \tif( text[i0+n] == STOP ){\n \t // The sortest string is first, this is as it should be.\n \t return true;\n \t}\n \tif( text[i1+n] == STOP ){\n \t // The sortest string is last, this is not good.\n \t return false;\n \t}\n \treturn (text[i0+n]<text[i1+n]);\n }", "@Override\npublic int compare(String first, String second) {\n\tint ans= Integer.compare(first.length(), second.length());\n\t//\n\t\n\t\n\t\n\t\n\treturn ans;\n\t//\n\t\n\t\n}", "private static int preComparison(Object actualObject, Object compareObject) {\n\t\tint status = 0;\n\t\t//if primitive and not equal\n\t\tif ((status = compareIfPrimitive(actualObject, compareObject)) != 0) {\n\t\t\treturn status;\n\t\t}\n\t\t//if String\n\t\tif ((status = compareIfString(actualObject, compareObject)) != 0) {\n\t\t\treturn status;\n\t\t}\n\t\t//if list\n\t\tif ((status = compareIfList(actualObject, compareObject)) != 0) {\n\t\t\treturn status;\n\t\t}\n\t\t//if array\n\t\tif ((status = compareIfArray(actualObject, compareObject)) != 0) {\n\t\t\treturn status;\n\t\t}\n\t\t//if set\n\t\tif ((status = compareIfSet(actualObject, compareObject)) != 0) {\n\t\t\treturn status;\n\t\t}\n\t\t//if map\n\t\tif ((status = compareIfMap(actualObject, compareObject)) != 0) {\n\t\t\treturn status;\n\t\t}\n\n\t\treturn status;\n\t}", "@Test\n public void Test4216006() throws Exception {\n boolean caughtException = false;\n try {\n new RuleBasedCollator(\"\\u00e0<a\\u0300\");\n }\n catch (ParseException e) {\n caughtException = true;\n }\n if (!caughtException) {\n throw new Exception(\"\\\"a<a\\\" collation sequence didn't cause parse error!\");\n }\n\n RuleBasedCollator collator = new RuleBasedCollator(\"&a<\\u00e0=a\\u0300\");\n //commented by Kevin 2003/10/21 \n //for \"FULL_DECOMPOSITION is not supported here.\" in ICU4J DOC\n //collator.setDecomposition(Collator.FULL_DECOMPOSITION);\n collator.setStrength(Collator.IDENTICAL);\n\n String[] tests = {\n \"a\\u0300\", \"=\", \"\\u00e0\",\n \"\\u00e0\", \"=\", \"a\\u0300\"\n };\n\n compareArray(collator, tests);\n }", "@Override\n public int compare(String[] o1, String[] o2) {\n try {\n Integer integer1 = Integer.valueOf(o1[0]);\n Integer integer2 = Integer.valueOf(o2[0]);\n return integer1.compareTo(integer2);\n } catch (java.lang.NumberFormatException e) {\n return o1[1].compareTo(o2[1]);\n }\n }", "private boolean isOperator (String s){ \n for (int i = 0; i<operators.length; i++){\n if (s.equals(operators[i])){\n return true;\n }\n }\n return false;\n }", "@Test\n public void aminoCompareTest2() {\n //these list are already sorted\n AminoAcidLL first = AminoAcidLL.createFromRNASequence(c);\n AminoAcidLL second = AminoAcidLL.createFromRNASequence(c);\n int expected = 0;\n assertEquals(expected, first.aminoAcidCompare(second));\n }", "@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 2;\r\n\t\t\t}", "@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 2;\r\n\t\t\t}", "@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 2;\r\n\t\t\t}", "@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 2;\r\n\t\t\t}", "@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 2;\r\n\t\t\t}", "@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 2;\r\n\t\t\t}", "private static boolean compare(char[] argText, int startIndex) {\n\t\tint textIndex = 0;\n\t\tfor (int i = 0; i < patternLength; i++) {\n\t\t\ttextIndex = startIndex + i;\n\t\t\tlogger.info(\"i: \" + i + \"textIndex:\" + textIndex);\n\t\t\tif (pattern[i] != argText[textIndex])\n\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Test\n public void aminoCompareTest1(){\n //these list are already sorted\n AminoAcidLL first = AminoAcidLL.createFromRNASequence(c);\n AminoAcidLL second = AminoAcidLL.createFromRNASequence(d);\n int expected = 1;\n assertEquals(expected, first.aminoAcidCompare(second));\n }", "private boolean isOperandsValid(String valueEntered, SearchOperator binaryOperator) {\n if (StringUtils.contains(valueEntered, binaryOperator.op())) {\n // using this split method to make sure we test both sides of the operator. Using String.split would\n // throw away empty strings, so e.g. \"&&100\".split(\"&&\") would return an array with one element, [\"100\"].\n String [] l = StringUtils.splitByWholeSeparatorPreserveAllTokens(valueEntered, binaryOperator.op());\n for(String value : l) {\n if (!isPassesDefaultValidation(value)) {\n return false;\n }\n }\n }\n\n return true;\n }", "@Override\n public int compare(String o1, String o2) {\n int res = String.CASE_INSENSITIVE_ORDER.compare(o1, o2);\n if (res == 0) {\n res = o1.compareTo(o2);\n }\n return res;\n }", "@Override\r\n\t\tpublic int compare(String arg0, String arg1) {\n\t\t\treturn arg0.compareTo(arg1);\r\n\t\t}", "public List<String> validate();", "@Override\n\t\tpublic int compare(String o1, String o2) {\n\t\t\treturn o1.compareTo(o2);\n\t\t}", "@Override\n public int compare(T a, T b) {\n for (Comparator<T> comparator : comparators) {\n int cmp = comparator.compare(a, b);\n\n if (cmp != 0) {\n return cmp;\n }\n }\n return 0;\n }", "public void testCompare() throws Exception {\n\n Object testData[][] = {\n { \"aaa\", \"bbb\", -1 },\n { \"aaa\", \"aaa\", 0 },\n { \"bbb\", \"aaa\", 1 },\n { \"aaa\", \"aaa_L1_bbb.lsm\", -1 },\n { \"aaa_L1_bbb.lsm\", \"aaa_L1_bbb.lsm\", 0 },\n { \"aaa_L1_bbb.lsm\", \"aaa\", 1 },\n { \"aaa_L1_bbb.lsm\", \"aaa_L10_bbb.lsm\", -1 },\n { \"aaa_L10_bbb.lsm\", \"aaa_L1_bbb.lsm\", 1 },\n { \"aaa_La_bbb.lsm\", \"aaa_L1_bbb.lsm\", 1 },\n { \"aaa_L2_bbb.lsm\", \"aaa_L10_bbb.lsm\", -1 }\n };\n\n LNumberComparator comparator = new LNumberComparator();\n\n for (Object[] testRow : testData) {\n String name1 = (String) testRow[0];\n String name2 = (String) testRow[1];\n File file1 = new File(name1);\n File file2 = new File(name2);\n int expectedResult = (Integer) testRow[2];\n int actualResult = comparator.compare(new FileTarget(file1),\n new FileTarget(file2));\n\n boolean isValid = ((expectedResult > 0) && (actualResult > 0)) ||\n ((expectedResult < 0) && (actualResult < 0)) ||\n ((expectedResult == 0) && (actualResult == 0));\n\n assertTrue(name1 + \" compared to \" + name2 +\n \" returned invalid result of \" + actualResult +\n \" (should have same sign as \" + expectedResult + \")\",\n isValid);\n }\n\n }", "@Override\n public int compare(String o1, String o2) {\n return Integer.compare(o2.length(), o1.length());\n }", "@Override\r\n\t\t\tpublic int compare(String o1, String o2) {\n\t\t\t\tString[] values = o1.split(\";\");\r\n\t\t\t\t//Take the second string and do the same thing\r\n\t\t\t\tString[] values2 = o2.split(\";\");\r\n\t\t\t\t//Compare strings according to their integer values\r\n\t\t\t\treturn Integer.valueOf(values[0].replace(\"\\\"\", \"\")).compareTo(Integer.valueOf(values2[0].replace(\"\\\"\", \"\")));\r\n\t\t\t}", "@Test\n public void testCompareTo_1() {\n LOGGER.info(\"testCompareTo_1\");\n final AtomString atomString1 = new AtomString();\n final AtomString atomString2 = new AtomString();\n final int actual = atomString1.compareTo(atomString2);\n final int expected = 0;\n assertEquals(expected, actual);\n }", "public int compareStringObjectsForLexRange(Object obj1, Object obj2) {\n\t\t /* This makes sure that we handle inf,inf and\n -inf,-inf ASAP. One special case less. */\n\t\tif (obj1 == obj2) {\n\t\t\treturn 0;\n\t\t}\n\t\t//if (obj1 == shared.minstring || obj2 == shared.maxstring) return -1;\n\t\t//if (obj1 == shared.maxstring || obj2 == shared.minstring) return 1;\n\t\treturn compareStringObjects(obj1, obj2);\n\t}", "public SortListByNamesTest(ArrayList<String> expectedOrderOfNames, ArrayList<String> inputOrderOfNames) {\n\t\tsuper();\n\t\tthis.expectedOrderOfNames = expectedOrderOfNames;\n\t\tthis.inputOrderOfNames = inputOrderOfNames;\n\n\t}", "@Override\n\t\tpublic int compare(String o1, String o2) {\n\t\t\treturn sort(o1).compareTo(sort(o2));\n\t\t}", "public String verifySortingInAscendingWithoutPagination(String object, String data) throws Exception {\n logger.debug(\"Entered into verifySortingInAscending()\");\n\n try {\n\n List<String> actual = new ArrayList<String>();\n List<String> real = new ArrayList<String>();\n while (true) {\n\n List<WebElement> expected = explictWaitForElementList(object);\n \n for (int i = 0; i < expected.size(); i++) {\n if (expected.get(i).getText().trim().length() != 0) {\n actual.add(expected.get(i).getText().trim());\n real.add(expected.get(i).getText().trim());\n }\n }\n break;\n }\n\n Collections.sort(actual, String.CASE_INSENSITIVE_ORDER);\n\n logger.debug(\"actual is as follows-- \" + actual);\n logger.debug(\"real is as follows-- \" + real);\n\n if (real.equals(actual)) {\n return Constants.KEYWORD_PASS + \" -- Elements are sorted\";\n }\n\n else {\n return Constants.KEYWORD_FAIL + \" -- Elements are not sorted\";\n }\n\n }\ncatch(TimeoutException ex)\n\t\t\n\t\t{\n\t\t\treturn Constants.KEYWORD_FAIL +\"Cause: \"+ ex.getCause();\n\t\t}\n catch (Exception e) {\n \n return Constants.KEYWORD_FAIL + e.getLocalizedMessage();\n }\n }", "String[] checkIfLegalCommand(String strToChck);", "@Override\n\tboolean validate(Vector<String> tokens) {\n\t\treturn false;\n\t}", "private List<String> validateComposingElements(\n\t\t\tChemicalAssociationBean assocBean, List<String> msgs) {\n\t\t String compTypeA = assocBean.getAssociatedElementA().getCompositionType();\n\t\t String compTypeB = assocBean.getAssociatedElementB().getCompositionType();\n\t\t\t\n\t\t if((compTypeA!=null)&&(compTypeA.equalsIgnoreCase(\"nanomaterial entity\"))&&(assocBean.getAssociatedElementA().getEntityDisplayName()!=null)){\n\t\t\t\tif(assocBean.getAssociatedElementA().getComposingElement().getId()==null)\n\t\t\t\t\t\tmsgs.add(\"Choosing an element on the left is required.\");\n\t\t\t}\n\t\t\tif((compTypeB!=null)&&(compTypeB.equalsIgnoreCase(\"nanomaterial entity\"))&&(assocBean.getAssociatedElementB().getEntityDisplayName()!=null)){\n\t\t\t\tif(assocBean.getAssociatedElementB().getComposingElement().getId()==null)\n\t\t\t\t\t\tmsgs.add(\"Choosing an element on the right is required.\");\n\t\t\t}\n\t\t\treturn msgs;\n\t}", "public int compare(String o1, String o2) {\n\t\t\t\t\t\tif (o1.compareTo(o2) > 0) {\n\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}", "@Override\n public int compare(String o1, String o2) {\n return Integer.compare(o1.length(), o2.length());\n }", "@Override\r\n\tpublic int compare(String str0, String str1) {\n\t\tString[] tempStr0 = str0.split(\",\", 2);\r\n\t\tString[] tempStr1 = str1.split(\",\", 2);\r\n\r\n\t\t// Hilbert code comparison\r\n\t\tint hilbertComparedValue = _hibertComp.compare(tempStr0[0], tempStr1[0]);\r\n\r\n\t\tif (hilbertComparedValue != 0) \r\n\t\t{\r\n\t\t\treturn hilbertComparedValue;\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\treturn tempStr0[1].compareTo(tempStr1[1]);\r\n\t\t}\t\t\r\n\t}", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n String[] list = scanner.nextLine().split(\" \");\n int count = 0;\n for (int i = 0; i < list.length - 1; i++) {\n if (list[i + 1].compareTo(list[i]) >= 0) {\n count++;\n }\n }\n if (count == list.length - 1) {\n System.out.println(\"true\");\n } else {\n System.out.println(\"false\");\n }\n }", "public int CompareTo(String comp){\n\t\t return producto.getNombre().compareTo(comp);\n\t }", "public static void sortStringsDictionary( ArrayList<String> lst )\n {\n PredicateStringPair p = (a, b) -> {\n String[] newA = a.split(\"\");\n String[] newB = b.split(\"\");\n int min;\n boolean mismatch = false;\n String adif = \"\";\n String bdif = \"\";\n if (a.length() < b.length()) {\n min = a.length();\n } else {\n min = b.length();\n }\n\n for (int i = 0; i < min; i++) {\n if (!newA[i].equals(newB[i])) {\n mismatch = true;\n adif = newA[i];\n bdif = newB[i];\n break;\n\n }\n }\n if (mismatch == false) {\n if(a.length() < b.length()) {\n return true;\n }\n else{\n return false;\n }\n }\n else{\n if(adif.matches(\"[a-zA-Z]\") && !bdif.matches(\"[a-zA-Z]\")) {\n return true;\n }\n else if (bdif.matches(\"[a-zA-Z]\") && !adif.matches(\"[a-zA-Z]\")) {\n return false;\n }\n else if (adif.matches(\"[a-zA-Z]\") && bdif.matches(\"[a-zA-Z]\")){\n //Automates the creation of the custom alphabetical ordering\n ArrayList<String> alph = new ArrayList<String>();\n for (int i = 0; i < 26; i++){\n alph.add(Character.toString(97 + i));\n alph.add(Character.toString(65 + i));\n }\n if (alph.indexOf(adif) < alph.indexOf(bdif)){\n return true;\n }\n else {\n return false;\n }\n }\n else {\n if (adif.compareTo(bdif) > 1) {\n return false;\n }\n else{\n return true;\n }\n\n\n }\n\n }\n\n };\n sortStrings(lst, p);\n }", "public abstract void compare();", "@Override\n\tpublic int compare(String o1, String o2) {\n\t\tif (o1.length() > o2.length()) {\n\t\t\treturn 1;\n\t\t} else if (o1.length() < o2.length()) {\n\t\t\treturn -1;\n\t\t} else {\n\t\t\tif (o1.compareTo(o2) > 0) {\n\t\t\t\treturn 1;\n\t\t\t} else {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t}", "private static int strCompare(char[] paramArrayOfChar1, int paramInt1, int paramInt2, char[] paramArrayOfChar2, int paramInt3, int paramInt4, boolean paramBoolean)\n/* */ {\n/* 2157 */ int i = paramInt1;\n/* 2158 */ int j = paramInt3;\n/* */ \n/* */ \n/* */ \n/* 2162 */ int i4 = paramInt2 - paramInt1;\n/* 2163 */ int i5 = paramInt4 - paramInt3;\n/* */ \n/* */ int i6;\n/* */ \n/* 2167 */ if (i4 < i5) {\n/* 2168 */ i6 = -1;\n/* 2169 */ k = i + i4;\n/* 2170 */ } else if (i4 == i5) {\n/* 2171 */ i6 = 0;\n/* 2172 */ k = i + i4;\n/* */ } else {\n/* 2174 */ i6 = 1;\n/* 2175 */ k = i + i5;\n/* */ }\n/* */ \n/* 2178 */ if (paramArrayOfChar1 == paramArrayOfChar2) {\n/* 2179 */ return i6;\n/* */ }\n/* */ int n;\n/* */ int i2;\n/* */ for (;;) {\n/* 2184 */ if (paramInt1 == k) {\n/* 2185 */ return i6;\n/* */ }\n/* */ \n/* 2188 */ n = paramArrayOfChar1[paramInt1];\n/* 2189 */ i2 = paramArrayOfChar2[paramInt3];\n/* 2190 */ if (n != i2) {\n/* */ break;\n/* */ }\n/* 2193 */ paramInt1++;\n/* 2194 */ paramInt3++;\n/* */ }\n/* */ \n/* */ \n/* 2198 */ int k = i + i4;\n/* 2199 */ int m = j + i5;\n/* */ \n/* */ int i1;\n/* */ int i3;\n/* 2203 */ if ((n >= 55296) && (i2 >= 55296) && (paramBoolean))\n/* */ {\n/* */ \n/* 2206 */ if ((n > 56319) || (paramInt1 + 1 == k) || \n/* */ \n/* 2208 */ (!UTF16.isTrailSurrogate(paramArrayOfChar1[(paramInt1 + 1)])))\n/* */ {\n/* 2210 */ if ((!UTF16.isTrailSurrogate(n)) || (i == paramInt1) || \n/* 2211 */ (!UTF16.isLeadSurrogate(paramArrayOfChar1[(paramInt1 - 1)])))\n/* */ {\n/* */ \n/* */ \n/* */ \n/* */ \n/* 2217 */ i1 = (char)(n - 10240);\n/* */ }\n/* */ }\n/* 2220 */ if ((i2 > 56319) || (paramInt3 + 1 == m) || \n/* */ \n/* 2222 */ (!UTF16.isTrailSurrogate(paramArrayOfChar2[(paramInt3 + 1)])))\n/* */ {\n/* 2224 */ if ((!UTF16.isTrailSurrogate(i2)) || (j == paramInt3) || \n/* 2225 */ (!UTF16.isLeadSurrogate(paramArrayOfChar2[(paramInt3 - 1)])))\n/* */ {\n/* */ \n/* */ \n/* */ \n/* */ \n/* 2231 */ i3 = (char)(i2 - 10240);\n/* */ }\n/* */ }\n/* */ }\n/* */ \n/* 2236 */ return i1 - i3;\n/* */ }", "private DefaultValueComparator(Collator collator) {\n this.collator = collator;\n }", "@Test\n public void codonCompare1(){\n //these list are already sorted\n AminoAcidLL first = AminoAcidLL.createFromRNASequence(a);\n AminoAcidLL second = AminoAcidLL.createFromRNASequence(b);\n int expected = 0;\n assertEquals(expected, first.codonCompare(second));\n }", "private boolean compareActualAndExpectedOutputs(String string,\r\n\t\t\tString string2) {\r\n\t\treturn string.equals(string2);\r\n\t}", "@Override\n public int compare(String s1, String s2) {\n return s1.compareTo(s2);\n\n }", "public void verifyBugerList()\n\t{\n\t\t\n\t}", "public interface Lexicon extends Comparator<String>{\r\n\r\n\t\r\n\r\n\t/** (non-Javadoc)\r\n\t * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)\r\n\t */\r\n\tint compare(String a, String b);\r\n\r\n\t/**\r\n\t * Uses binary search to find the order of key.\r\n\t * @param key\r\n\t * @return ordering value for key or -1 if key is an invalid character.\r\n\t */\r\n\tint getCharacterOrdering(char key);\r\n\r\n\t/**\r\n\t * Returns whether or not word is valid.\r\n\t * @param word word to be checked.\r\n\t * @return\r\n\t */\r\n\tboolean isValid(String word);\r\n\t\r\n}", "public void testCompareTo() throws Exception {\r\n setUp();\r\n Student allison = new Student(\"0\", \"Allison\", \"DeSantis\");\r\n Student alli = new Student(\"0\", \"Aaa\", \"DeSantis\");\r\n\r\n // same last name, returns 1\r\n assertEquals(allison.compareTo(alli), 1);\r\n\r\n // same last name, returns -1\r\n Student al = new Student(\"0\", \"z\", \"DeSantis\");\r\n assertEquals(allison.compareTo(al), -1);\r\n\r\n // same name\r\n Student allis = new Student(\"0\", \"Allison\", \"DeSantis\");\r\n assertEquals(allison.compareTo(allis), 0);\r\n\r\n // same first name, returns 1\r\n Student last = new Student(\"0\", \"Allison\", \"c\");\r\n assertEquals(allison.compareTo(last), 1);\r\n\r\n // same first name, returns -1\r\n Student diff = new Student(\"0\", \"Allison\", \"Z\");\r\n assertEquals(allison.compareTo(diff), -1);\r\n\r\n\r\n Student c1 = new Student(\"0\", \"Colleen\", \"Schmidt\");\r\n Student c2 = new Student(\"0\", \"Colleen\", \"Schmidt\");\r\n\r\n assertEquals(c1.compareTo(c2), 0);\r\n\r\n assertEquals(c2.compareTo(c1), 0);\r\n\r\n Student c3 = new Student(\"0\", \"Colleen\", \"Schmidt\");\r\n assertEquals(c1.compareTo(c3), 0);\r\n }", "public static Boolean lexicographicOrder(ArrayList<String> list) {\r\n if (list.size() == 1) {\r\n return true;\r\n }\r\n \r\n if ((list.get(0)).compareTo(list.get(1)) <= 0) { \r\n list.remove(0);\r\n return lexicographicOrder(list);\r\n }\r\n return false;\r\n }", "@Test\n public void test_min_String_Collection1() {\n populate_s1();\n String actual = Selector.min(s1, new CompareStringAscending());\n String expected = \"A\";\n Assert.assertEquals(\"Minimum not found\", expected, actual);\n }", "static void compare()\n {\n \tif(a < c)\n\t\t {\n\t\t\t comp_one = 1; //store this value , else zero default \n\t\t }\n\t\t if(c < b)\n\t\t {\n\t\t\t comp_two = 2; //store this value , else zero default\n\t\t }\n\t\t if(b < a)\n\t\t {\n\t\t\t comp_thr = 5; //store this value , else zero default\n\t\t }\n\t\t \n\t\t comp_val = comp_one + comp_two + comp_thr; //create a unique value by addition\n }" ]
[ "0.6172035", "0.6043834", "0.57390547", "0.5666309", "0.55560476", "0.5520303", "0.54746133", "0.540282", "0.5380928", "0.5334062", "0.5302689", "0.52845657", "0.5257833", "0.5238156", "0.5226067", "0.5206425", "0.5202909", "0.51900905", "0.51900905", "0.51900905", "0.51877654", "0.51832813", "0.5182982", "0.5173293", "0.51699394", "0.51699394", "0.51604545", "0.51590025", "0.51466936", "0.51466936", "0.5137288", "0.51225144", "0.5122204", "0.509431", "0.5087627", "0.5076307", "0.50505924", "0.5045048", "0.5032703", "0.50312483", "0.5031137", "0.5009158", "0.5002886", "0.49987376", "0.4998728", "0.49790576", "0.49553698", "0.49544755", "0.49539378", "0.49502948", "0.49379936", "0.49254614", "0.49222803", "0.49208796", "0.49207556", "0.4919261", "0.49174896", "0.49174896", "0.49174896", "0.49174896", "0.49174896", "0.49174896", "0.49068266", "0.49052995", "0.489746", "0.48890013", "0.48832518", "0.4881163", "0.4877042", "0.48663926", "0.4862717", "0.48453146", "0.4844756", "0.48364887", "0.4833352", "0.48237333", "0.48224673", "0.48215356", "0.48206562", "0.48127317", "0.48066986", "0.48050955", "0.48044178", "0.48043212", "0.47995386", "0.47983852", "0.47936627", "0.47926328", "0.47876835", "0.47871935", "0.47834933", "0.4774479", "0.4772202", "0.47704485", "0.476826", "0.47677243", "0.47619578", "0.47591478", "0.475669", "0.4755322" ]
0.76884806
0
Checks the auth atmain string
private void checkAuthAtMain() { val auth = config.getString("authAtMain"); checkArgument(auth.length() > 10, "auth string (at-main) length is less than or equal to 10!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void checkAuthUbidMain() {\n val auth = config.getString(\"authUbidMain\");\n\n checkArgument(auth.length() > 10, \"auth string (ubid-main) length is less than or equal to 10!\");\n }", "private void checkAuthControl() {\n val authKey = config.getString(\"authControlKey\");\n val authValue = config.getString(\"authControlValue\");\n\n checkArgument(authKey.length() > 2, \"auth string (control key) length is less than or equal to 2!\");\n checkArgument(authValue.length() > 2, \"auth string (control value) length is less than or equal to 2!\");\n }", "private void checkAuthXMain() {\n val auth = config.getString(\"authXMain\");\n\n checkArgument(auth.length() > 10, \"auth string (x-main) length is less than or equal to 10!\");\n }", "private boolean isValidAuthentication(String authHeader) {\n return !StringUtils.isEmpty(authHeader);\n }", "public static boolean isAuth(String auths){\n\t\treturn AccUtils.manipulate(auths, ManOp.EMPTY_TO_NULL) != null;\n\t}", "boolean authNeeded();", "public boolean isAuthRequired() {\n return !AfUtil.anyEmpty(_username);\n }", "private void checkAuthSessionId() {\n val auth = config.getString(\"authSessionId\");\n\n checkArgument(auth.length() > 10, \"auth string (sessionId) length is less than or equal to 10!\");\n }", "java.lang.String getAuth();", "java.lang.String getAuth();", "java.lang.String getAuth();", "boolean hasAuth();", "abstract public boolean checkAuth(String userId) throws IOException;", "private void checkAuthSessionToken() {\n val auth = config.getString(\"authSessionToken\");\n\n checkArgument(auth.length() > 10, \"auth string (sessionToken) length is less than or equal to 10!\");\n }", "protected boolean isBasicAuth(String header) {\n if (header == null) return false;\n\n // if its not a Basic header we deny the access\n if (header.length() < BASIC_AUTH.length()) return false;\n String pre = header.substring(0,BASIC_AUTH.length());\n if (!pre.toLowerCase().equals(BASIC_AUTH.toLowerCase())) return false;\n return true;\n }", "public abstract boolean validateAuthToken(String username , String authToken);", "private void checkRep(){\n assert !this.username.equals(\"\");\n assert !this.password.equals(\"\");\n assert accessLevel != null;\n }", "private SMTP checkAuth(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tString auth = request.getHeader(\"Authorization\");\n\t\t\n\t\tif (auth == null) {\n\t\t\tsend(response, 401, \"Authorisation Needed\");\n\t\t\treturn null;\n\t\t}\n\t\t\t\t\n\t\tString[] creds = auth.split(\" \");\n\t\tif (!creds[0].equalsIgnoreCase(\"Basic\")) {\n\t\t\tsend(response, 501, \"Only Basic authentication is available - \" + creds[0] + \" is not acceptable\");\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tcreds[1] = new String(Base64.decode(creds[1]));\n\t\t} catch (Base64DecodingException e) {\n\t\t\tsend(response, 400, \"invalid base64 in authorization header\");\n\t\t\treturn null;\n\t\t}\n\n\t\ttry {\n\t\t\tint split = creds[1].indexOf(\":\");\n\t\t\tif (split == -1) {\n\t\t\t\tsend(response, 400, \"malformed authorization header (missing colon)\");\n\t\t\t}\n\t\t\tSMTP a = new SMTP(getSettings(creds[1].substring(0, split),\n\t\t\t\t\t \t\t\t creds[1].substring(split + 1)));\n\t\t\treturn a;\n\t\t} catch (AuthenticationFailedException e) {\n\t\t\tsend(response, 401, \"Authentication Failed\");\n\t\t} catch (MessagingException e ) {\n\t\t\tsend(response, 500, \"Internal Server error\");\n\t\t}\n\t\treturn null;\n\t}", "public static boolean checkValidAuth(String authCode) {\n if (authCode == null) {\n return false;\n }\n Pattern pattern = Pattern.compile(\"^([0-9A-Za-z]){1,20}$\");\n Matcher matcher = pattern.matcher(authCode);\n return matcher.matches();\n }", "protected void validateToken() {\n\n authToken = preferences.getString(getString(R.string.auth_token), \"\");\n saplynService = new SaplynService(preferences.getInt(debugLvl, -1), authToken);\n\n // Check if user already authenticated\n if (authToken.equals(\"\")) {\n Intent intent = new Intent(HomeActivity.this, AuthenticationActivity.class);\n startActivityForResult(intent, 0);\n }\n else {\n populateUser();\n }\n }", "boolean hasLoginapiavgrtt();", "@Test\n public void testBasicAuthHeader() {\n final String shellEncoded = \"Basic YWRtaW46YWRtaW5fcGFzcw==\";\n final String[] decoded = BasicAuthUtils.extractAndDecodeAuthHeader(shellEncoded, UTF_8.name());\n assertEquals(\"admin\", decoded[0]);\n assertEquals(\"admin_pass\", decoded[1]);\n\n assertEquals(shellEncoded, verify(\"admin\", \"admin_pass\"));\n }", "public String isValidAgentLogin(String userName, String password);", "public boolean isAuthRequired() {\n\t\treturn false;\n\t}", "public boolean auth() throws IOException {\r\n \treturn auth(false);\r\n }", "public boolean authenticate(String s) {\r\n // TODO - implement User.authenticate\r\n throw new UnsupportedOperationException();\r\n }", "boolean hasAuthKey();", "public boolean checkUsername(String user) {\n\n }", "private static boolean authenticate(String username, String password) {\r\n\t\tFile file = new File(\"auth.txt\");\r\n\t\tScanner scanner;\r\n\t\tString user = null;\r\n\t\tString pwd = null;\r\n\t\ttry {\r\n\t\t\tscanner = new Scanner(file);\r\n\t\t\tString nextLine = scanner.nextLine();\r\n\t\t\tString[] parts = nextLine.split(\"=\");\r\n\t\t\tuser = parts[0];\r\n\t\t\tpwd = parts[1];\r\n\t\t\tscanner.close();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn (username.equals(user) && password.equals(pwd));\r\n\t\t\r\n\t}", "public void Apr_Validation() {\n\t\thelper.assertString(Apr_AftrLogin(), payOffOffer.Apr_BfrLogin());\n\t\tSystem.out.print(\"The APR is: \" + Apr_AftrLogin());\n\n\t}", "public FuzzerAuthString(){\r\n\t\tusername = \"\";\r\n\t\tpassword = \"\";\r\n\t}", "private void login() {\n\t\t \tetUserName.addTextChangedListener(new TextWatcher() {\n\t\t public void afterTextChanged(Editable s) {\n\t\t Validation.hasText(etUserName);\n\t\t }\n\t\t public void beforeTextChanged(CharSequence s, int start, int count, int after){}\n\t\t public void onTextChanged(CharSequence s, int start, int before, int count){}\n\t\t });\n\t\t \t\n\t\t \t // TextWatcher would let us check validation error on the fly\n\t\t \tetPass.addTextChangedListener(new TextWatcher() {\n\t\t public void afterTextChanged(Editable s) {\n\t\t Validation.hasText(etPass);\n\t\t }\n\t\t public void beforeTextChanged(CharSequence s, int start, int count, int after){}\n\t\t public void onTextChanged(CharSequence s, int start, int before, int count){}\n\t\t });\n\t\t }", "@Test\n public void atrnTest() {\n assertEquals(\"atrn1\", authResponse.getAtrn());\n }", "private void authenticate( String loging, String sysLoging,String password,String sys_password) throws Exception {\n \n if(!loging.equals(sysLoging) || !(sys_password.equals(password) )){\n Exception e = new Exception();\n throw e;\n }\n\n }", "@Override\n public boolean check() {\n return GlobalParams.isLogin();\n }", "boolean isAuthenticated();", "public boolean checkAuth() {\n SharedPreferences sharedPreferences = getSharedPreferences(SHARED_PREFS, MODE_PRIVATE);\n return sharedPreferences.getBoolean(AUTH, false);\n }", "boolean checkUserCorrispondenceLogin(String emailLogin, String passwordLogin);", "public Boolean authentication(String username, String password) \n\t{\n\t\n\t switch (username) {\n\t case \"FS_UTO_CoE_Sreenivas\":\n\t \t\t\tif (year<=2018)\n\t \t\t\tpassorfail=password.equals(\"q2m!x:dCk6FaG$Ec\");\n\t \t\t\t\tbreak;\n\t// case \"FS_BAN_ANZ_DIGITAL_GANESH\": \n\t//\t\t \t\t\tpassorfail=password.equals(\"q`r^8{De,Sn*!KU_\");\n\t//\t\t \t\t\t\tbreak;\t\t \t\t\t\t\n\t default: \n\t\t\t\t\t\t\tpassorfail = false; \n\t\t\t\t\t\t\tbreak; \t\t \n\t\t}\n\t\treturn passorfail;\n\n\t}", "public String getInputAuth()\n\t{\n\t\treturn inputAuth;\n\t}", "private void authenticate(String user, String pass) {\n }", "public CheckAuthCommand() {\n this.authLevel = AUTH_LEVEL_LOGGED_IN;\n }", "private boolean authenticatedUser(String uName, String pass) {\n\t\treturn true;\n\t}", "private boolean authenticate (HttpRequest request, HttpResponse response) throws UnsupportedEncodingException\n\t{\n\t\tString[] requestSplit=request.getPath().split(\"/\",3);\n\t\tif(requestSplit.length<2)\n\t\t\treturn false;\n\t\tString serviceName=requestSplit[1];\n\t\tfinal int BASIC_PREFIX_LENGTH=\"BASIC \".length();\n\t\tString userPass=\"\";\n\t\tString username=\"\";\n\t\tString password=\"\";\n\t\t\n\t\t//Check for authentication information in header\n\t\tif(request.hasHeaderField(AUTHENTICATION_FIELD)\n\t\t\t\t&&(request.getHeaderField(AUTHENTICATION_FIELD).length()>BASIC_PREFIX_LENGTH))\n\t\t{\n\t\t\tuserPass=request.getHeaderField(AUTHENTICATION_FIELD).substring(BASIC_PREFIX_LENGTH);\n\t\t\tuserPass=new String(Base64.decode(userPass), \"UTF-8\");\n\t\t\tint separatorPos=userPass.indexOf(':');\n\t\t\t//get username and password\n\t\t\tusername=userPass.substring(0,separatorPos);\n\t\t\tpassword=userPass.substring(separatorPos+1);\n\t\t\t\n\t\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\t\n\t\t\t\tlong userId;\n\t\t\t\tAgent userAgent;\n\t\t\t\t\n\t\t\t\tif ( username.matches (\"-?[0-9].*\") ) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tuserId = Long.valueOf(username);\n\t\t\t\t\t} catch ( NumberFormatException e ) {\n\t\t\t\t\t\tthrow new L2pSecurityException (\"The given user does not contain a valid agent id!\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tuserId = l2pNode.getAgentIdForLogin(username);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tuserAgent = l2pNode.getAgent(userId);\n\t\t\t\t\n\t\t\t\tif ( ! (userAgent instanceof PassphraseAgent ))\n\t\t\t\t\tthrow new L2pSecurityException (\"Agent is not passphrase protected!\");\n\t\t\t\t((PassphraseAgent)userAgent).unlockPrivateKey(password);\n\t\t\t\t_currentUserId=userId;\n\t\t\t\t\n\t\t\t\tif(!_userSessions.containsKey(userId))//if user not registered\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\tMediator mediator = l2pNode.getOrRegisterLocalMediator(userAgent);\n\t\t\t\t\t_userSessions.put(userId, new UserSession(mediator));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t_userSessions.get(userId).updateServiceTime(serviceName,new Date().getTime());//update last access time for service\n\t\t\t\t\n\t\t\t\tconnector.logMessage(\"Login: \"+username);\n\t\t\t\tconnector.logMessage(\"Sessions: \"+Integer.toString(_userSessions.size()));\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t}catch (AgentNotKnownException e) {\n\t\t\t\tsendUnauthorizedResponse(response, null, request.getRemoteAddress() + \": login denied for user \" + username);\n\t\t\t} catch (L2pSecurityException e) {\n\t\t\t\tsendUnauthorizedResponse( response, null, request.getRemoteAddress() + \": unauth access - prob. login problems\");\n\t\t\t} catch (Exception e) {\n\t\t\t\t\n\t\t\t\tsendInternalErrorResponse(\n\t\t\t\t\t\tresponse, \n\t\t\t\t\t\t\"The server was unable to process your request because of an internal exception!\", \n\t\t\t\t\t\t\"Exception in processing create session request: \" + e);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tresponse.setStatus ( HttpResponse.STATUS_BAD_REQUEST );\n\t\t\tresponse.setContentType( \"text/plain\" );\n\t\t\tresponse.print ( \"No authentication provided!\" );\n\t\t\tconnector.logError( \"No authentication provided!\" );\n\t\t}\n\t\treturn false;\n\t}", "private void checkValidation() {\n // Get email id and password\n MainActivity.EmailAddress = emailid.getText().toString();\n finalPassword = password.getText().toString();\n\n // Check patter for email id\n Pattern p = Pattern.compile(Utils.regEx);\n\n Matcher m = p.matcher(MainActivity.EmailAddress);\n\n // Check for both field is empty or not\n if (MainActivity.EmailAddress.equals(\"\") || MainActivity.EmailAddress.length() == 0\n || finalPassword.equals(\"\") || finalPassword.length() == 0) {\n loginLayout.startAnimation(shakeAnimation);\n new CustomToast().Show_Toast(getActivity(), view,\n \"Enter both credentials.\");\n\n }\n // Check if email id is valid or not\n else if (!m.find())\n new CustomToast().Show_Toast(getActivity(), view,\n \"Your Email Id is Invalid.\");\n // Else do login and do your stuff\n else\n tryLoginUser();\n\n }", "private boolean isTokenBasedAuthentication(String authorizationHeader) {\n return authorizationHeader != null && authorizationHeader.toLowerCase()\n .startsWith(AUTHENTICATION_SCHEME.toLowerCase() + \" \");\n }", "private boolean isTokenBasedAuthentication(String authorizationHeader) {\n return authorizationHeader != null && authorizationHeader.toLowerCase()\n .startsWith(AUTHENTICATION_SCHEME.toLowerCase() + \" \");\n }", "private boolean isTokenBasedAuthentication(String authorizationHeader) {\n return authorizationHeader != null && authorizationHeader.toLowerCase()\n .startsWith(AUTHENTICATION_SCHEME.toLowerCase() + \" \");\n }", "public static String checkUsername(String in) {\n\t\tif (in.isEmpty())\r\n\t\t\treturn \"Username is empty\";\r\n\t\telse {\r\n\t\t\tPattern passPat = Pattern.compile(\"\\\\w*\");\r\n\t\t\tMatcher matchpass = passPat.matcher(in);\r\n\t\t\tif (!matchpass.matches()) {\r\n\t\t\t\treturn \"The username must only contain character and numeric\";\r\n\t\t\t} else\r\n\t\t\t\treturn null;\r\n\t\t}\r\n\t}", "public static String getCheckAuthentication() {\n\n\t\treturn baseURL + login_required_string + \"/rest/is-authenticated\";\n\t}", "public void setInputAuth(String inputAuth)\n\t{\n\t\tthis.inputAuth = Toolbox.trim(inputAuth, 1);\n\t}", "private boolean validarEInyectarAutorizacion(final HttpServletRequest request) {\n\t\tboolean autorizado = false;\n\t\tString header = request.getHeader(AUTH_HEADER);\n\t\tfor (Peticion peticion : SIN_AUTH) {\n\t\t\tif (peticion.match(request)) {\n\t\t\t\tautorizado = true;\n\t\t\t\tlog.info(\"Método: \"+peticion.metodo+\" url: \"+peticion.url);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!autorizado) {\n\t\t\t// Todos los demas servicios requieren que se envie la cadena Bearer\n\t\t\t// <token>\n//\t\t\tif (StringUtils.isNotBlank(header)) {\n\t\t\t\tif (verificarCredenciales(request)){\n\t\t\t\t\tautorizado = true;\n\t\t\t\t}\n//\t\t\t\tString[] tmpTokens = header.split(AUTH_BEARER);\n//\t\t\t\tif (tmpTokens.length == 2) {\n//\t\t\t\t\tString token = tmpTokens[1];\n//\t\t\t\t\tOptional<Identificacion> ident = validarToken(StringUtils.trimToEmpty(token));\n//\t\t\t\t\tif (ident.isPresent()) {\n//\t\t\t\t\t\trequestScope.setIdentificacion(ident.get());\n//\t\t\t\t\t\trequest.setAttribute(AUTH_KEY, ident.get());\n//\t\t\t\t\t}\n//\t\t\t\t\tautorizado = ident.isPresent();\n//\t\t\t\t}\n//\t\t\t}\n\t\t}\n\t\trequestScope.setIp(request.getRemoteAddr());\n\t\treturn autorizado;\n\t}", "public boolean hasAuth() {\n return ((bitField0_ & 0x00000080) == 0x00000080);\n }", "private int checkAuthentication( SecureDirectory secureDirectory ) throws ServerException {\r\n\r\n\t\tif ( secureDirectory == null )\r\n\t\t\treturn NOT_SECURE_DIR;\r\n\r\n\t\tif ( !request.getHeaderFields().containsKey( HeaderFields.AUTHORIZATION ) )\r\n\t\t\treturn NEED_AUTHENTICATE;\r\n\r\n\t\tString auth = request.getHeaderFields().get( HeaderFields.AUTHORIZATION );\r\n\t\tString[] tokens = auth.split( \" \", 2 );\r\n\t\tif ( authenticate( secureDirectory, tokens[0], tokens[1] ) )\r\n\t\t\treturn AUTHENTICATED;\r\n\r\n\t\t// Password or username not correct\r\n\t\tthrow new ServerException( ResponseTable.FORBIDDEN );\r\n\t}", "public static Boolean checkUsername(String username){\n\t\t//String username = txtUsername.getText();\n\t\t//System.out.println(username);\n\t\treturn (username.equals(\"Admin\"));\n\t}", "public abstract boolean checkCredentials (String username, String password);", "boolean authenticate(String userName, String password);", "boolean isValid(String jwt);", "private boolean isValidToken(String authHeader) {\n AuthorisedTokenData token = authorisedTokensServices.getAuthorisedTokenByToken(authHeader);\n\n return token != null && token.getToken().equals(authHeader);\n }", "public void verifyLogin(String s1)\n\t{\n\t\tUtilityClass.fn_Click(\"usermanagement_plusicon_bt\");\n\t\t\n\t\t//log.info(\"providing mobile number in username input field\");\n\t\t//UtilityClass.fn_Input(\"Loginpage_usernm_Input\", s1);\n\t\t//System.out.println(\"in verifylogin\");\n\t\t\n\t}", "boolean isValidCredential(String username, String password);", "@Override\n\tpublic boolean isUserAuthenticate(String username, String password) {\n\t\t// validate username and pwd with predefined credentials\n\t\tif (username.equals(Utility.USERNAME) && password.equals(Utility.PASSWORD)) {\n\t\t\treturn true;\n\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public void checkAuthority() {\n }", "public void TC_04_Authentication_Alert() {\n\n\t\tdriver.get(\"http://admin:[email protected]/basic_auth\");\n\t}", "private Boolean isValidUsername(String username){\n return (username != null) && (username.length() >= 5 && username.length() <= 16);\n }", "boolean isAuthenticate(String username, String password) throws UserDaoException;", "private boolean isTokenBasedAuthentication(String authorizationHeader) {\n return authorizationHeader != null && authorizationHeader.toLowerCase()\n .startsWith(AUTHENTICATION_SCHEME.toLowerCase());\n }", "@Override\n\tpublic int validLogin(String adminid, String adminpw) {\n\t\tif (\"admin\".equals(adminid)\n\t\t\t\t&& \"12345\".equals(adminpw))\n\t\t\t{\n\t\t\t\treturn 99;\n\t\t\t}\n\t\t\treturn -1;\n\t}", "private boolean checkPassword() {\n String password = Objects.requireNonNull(password1.getEditText()).getText().toString();\n\n return password.length() >= 8 && ContainSpecial(password) && noUpper(password);\n }", "public boolean hasAuth() {\n return ((bitField0_ & 0x00000040) == 0x00000040);\n }", "private static boolean authenticateUser(String username_input, String password_input){\n\t\tif(!username_input.equals(USERNAME) || !password_input.equals(PASSWORD)){\n\t\t\tSystem.out.println(\"Invalid Credentials Entered!\");\n\t\t\treturn false;\n\t\t}\n\t\telse //username and password entered were correct\n\t\t\tSystem.out.println(\"User Credentials Authenticated! Please wait while books and students are being loaded.\");\n\t\treturn true;\n\t}", "public void pass1()throws Exception\r\n { \r\n guiframe g=new guiframe();\r\n g.setSize(400,400);\r\n g.setTitle(\"Authentication A\");\r\n g.setVisible(true);\r\n \r\n \r\n \r\n \r\n \r\n /*Scanner s =new Scanner(System.in);\r\n System.out.println(\"Enter the Password:\");\r\n String str=s.nextLine();\r\n DateFormat df=new SimpleDateFormat(\"HH:mm\");\r\n Date d=new Date();\r\n String time=df.format(d);\r\n StringBuffer t1=new StringBuffer(time);\r\n t1=t1.deleteCharAt(2);\r\n time=t1.toString();\r\n System.out.println(t1);\r\n \r\n if(str.equals(time))\r\n System.out.println(\"Access Granted\");\r\n else\r\n System.out.println(\"Access Denied\");*/\r\n }", "public static void timeSensitiveInit(Env env, AAF_Service authzAPI, AuthzFacade facade, final DirectAAFUserPass directAAFUserPass) throws Exception {\n /**\n * Basic Auth, quick Validation\n *\n * Responds OK or NotAuthorized\n */\n authzAPI.route(env, HttpMethods.GET, \"/authn/basicAuth\", new Code(facade,\"Is given BasicAuth valid?\",true) {\n @Override\n public void handle(\n AuthzTrans trans,\n HttpServletRequest req,\n HttpServletResponse resp) throws Exception {\n\n Principal p = trans.getUserPrincipal();\n if (p instanceof BasicPrincipal) {\n // the idea is that if call is made with this credential, and it's a BasicPrincipal, it's ok\n // otherwise, it wouldn't have gotten here.\n resp.setStatus(HttpStatus.OK_200);\n } else if (p instanceof X509Principal) {\n // have to check Basic Auth here, because it might be CSP.\n String authz = req.getHeader(\"Authorization\");\n if (authz.startsWith(\"Basic \")) {\n BasicHttpTaf bht = ((X509Principal)p).getBasicHttpTaf();\n if (bht!=null) {\n BasicPrincipal bp = new BasicPrincipal(authz,\"\");\n CredVal cv = bht.getCredVal(bp.getDomain());\n if (cv!=null) {\n if (cv.validate(bp.getName(), Type.PASSWORD, bp.getCred(), null) ) {\n resp.setStatus(HttpStatus.OK_200);\n } else {\n resp.setStatus(HttpStatus.UNAUTHORIZED_401);\n }\n }\n } else {\n String decoded = Symm.base64noSplit.decode(authz.substring(6));\n int colon = decoded.indexOf(':');\n TimeTaken tt = trans.start(\"Direct Validation\", Env.REMOTE);\n try {\n if (directAAFUserPass.validate(\n decoded.substring(0,colon),\n CredVal.Type.PASSWORD ,\n decoded.substring(colon+1).getBytes(),trans)) {\n resp.setStatus(HttpStatus.OK_200);\n } else {\n // DME2 at this version crashes without some sort of response\n resp.getOutputStream().print(\"\");\n resp.setStatus(HttpStatus.FORBIDDEN_403);\n }\n } finally {\n tt.done();\n }\n }\n }\n } else if (p == null) {\n trans.error().log(\"Transaction not Authenticated... no Principal\");\n resp.setStatus(HttpStatus.FORBIDDEN_403);\n } else {\n trans.checkpoint(\"Basic Auth Check Failed: This wasn't a Basic Auth Trans\");\n // For Auth Security questions, we don't give any info to client on why failed\n resp.setStatus(HttpStatus.FORBIDDEN_403);\n }\n }\n },\"text/plain\",\"*/*\",\"*\");\n\n /**\n * returns whether a given Credential is valid\n */\n authzAPI.route(POST, \"/authn/validate\", API.CRED_REQ, new Code(facade,\"Is given Credential valid?\",true) {\n @Override\n public void handle(\n AuthzTrans trans,\n HttpServletRequest req,\n HttpServletResponse resp) throws Exception {\n // will be a valid Entity. Do we need to add permission\n //if(trans.fish(\"ns\",\"password\",\"request\")) or the like\n Result<Date> r = context.doesCredentialMatch(trans, req, resp);\n if (r.isOK()) {\n resp.setStatus(HttpStatus.OK_200);\n } else {\n // For Security, we don't give any info out on why failed, other than forbidden\n // Can't do \"401\", because that is on the call itself\n // 403 Implies you MAY NOT Ask.\n resp.setStatus(HttpStatus.NOT_ACCEPTABLE_406);\n }\n }\n });\n\n /**\n * returns whether a given Credential is valid\n */\n authzAPI.route(GET, \"/authn/cert/id/:id\", API.CERTS, new Code(facade,\"Get Cert Info by ID\",true) {\n @Override\n public void handle(\n AuthzTrans trans,\n HttpServletRequest req,\n HttpServletResponse resp) throws Exception {\n\n Result<Void> r = context.getCertInfoByID(trans, req, resp, pathParam(req,\":id\") );\n if (r.isOK()) {\n resp.setStatus(HttpStatus.OK_200);\n } else {\n // For Security, we don't give any info out on why failed, other than forbidden\n resp.setStatus(HttpStatus.FORBIDDEN_403);\n }\n }\n });\n\n\n\n\n }", "private boolean checkUserInfo(String username, String password) {\n\t\treturn !(username == null || username.isEmpty()\n\t\t\t\t|| password == null || password.isEmpty() || password.length() < 6 && password.length() > 12);\n }", "public void setAuthStat(String authStat)\n\t{\n\t\tthis.authStat = Toolbox.trim(authStat, 1);\n\t}", "static String validate(String username_or_password) {\r\n if (username_or_password.indexOf('\\'') != -1) {\r\n throw new IllegalArgumentException(\"invalid input: \" + username_or_password);\r\n }\r\n return username_or_password;\r\n }", "private boolean checkInCashe(String s) {\n return true;\n }", "private boolean isValidServerBasedAuthority(String host, int port, String userinfo) {\n \n // Check if the host is well formed.\n if (!isWellFormedAddress(host)) {\n return false;\n }\n \n // Check that port is well formed if it exists.\n // REVISIT: There's no restriction on port value ranges, but\n // perform the same check as in setPort to be consistent. Pass\n // in a string to this method instead of an integer.\n if (port < -1 || port > 65535) {\n return false;\n }\n \n // Check that userinfo is well formed if it exists.\n if (userinfo != null) {\n // Userinfo can contain alphanumerics, mark characters, escaped\n // and ';',':','&','=','+','$',','\n int index = 0;\n int end = userinfo.length();\n char testChar = '\\0';\n while (index < end) {\n testChar = userinfo.charAt(index);\n if (testChar == '%') {\n if (index+2 >= end ||\n !isHex(userinfo.charAt(index+1)) ||\n !isHex(userinfo.charAt(index+2))) {\n return false;\n }\n index += 2;\n }\n else if (!isUserinfoCharacter(testChar)) {\n return false;\n }\n ++index;\n }\n }\n return true;\n }", "public void authUser(){\n\n String emptyString = \"\";\n if(!(String.valueOf(userName.getText()).equals(emptyString) ||\n String.valueOf(userNumber.getText()).equals(emptyString))){\n\n SharedPreferences preferences = getApplicationContext().getSharedPreferences(\"user_info\", 0);\n SharedPreferences.Editor editor = preferences.edit();\n editor.putBoolean(getResources().getString(R.string.isLoggedIn), true);\n editor.putString(getResources().getString(R.string.userName), String.valueOf(userName.getText()));\n editor.putString(getResources().getString(R.string.userNumber), String.valueOf(userNumber.getText()));\n editor.apply();\n\n Intent intent = new Intent(getApplicationContext(), HomeScreen.class);\n\n startActivity(intent);\n }\n else{\n Toast.makeText(getApplicationContext(),\n \"Please enter compelete credentials..\", Toast.LENGTH_SHORT)\n .show();\n }\n\n }", "String getLoginapiavgrtt();", "@Given(\"^The app (.+) auth (.+) and (.+)$\")\n\tpublic void the_app_auth_and(String url, String username, String password) throws IOException {\n\t\tLOGGER.info(\"Starting to test the Basic Auth \");\n\t\tboolean turnOffSSL = url.contains(\"8443\")?true:false;\n\t\trestTemplate = RestTemplateUtils.newRestTemplate(turnOffSSL);\n\t\trestTemplate.getInterceptors().add(CPEHeaderInterceptor.Builder.fromBasicAuth(username, password).build());\n\t\tthis.url = url;\n\t}", "public static boolean authenticate(String preset, HttpServletRequest request) throws MnoException {\n\t\tString authHeader = request.getHeader(\"Authorization\");\n\t\tif (authHeader == null || authHeader.isEmpty()) {\n\t\t\treturn false;\n\t\t}\n\t\tString[] auth = authHeader.trim().split(\"\\\\s+\");\n\n\t\tif (auth == null || auth.length != 2 || !auth[0].equalsIgnoreCase(\"basic\")) {\n\t\t\treturn false;\n\t\t}\n\t\tbyte[] decodedStr = DatatypeConverter.parseBase64Binary(auth[1]);\n\t\tString[] creds;\n\t\ttry {\n\t\t\tcreds = (new String(decodedStr, \"UTF-8\")).split(\":\");\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\tthrow new MnoException(\"Could not decode basic authentication\" + Arrays.toString(auth));\n\t\t}\n\n\t\tif (creds.length == 2) {\n\t\t\treturn authenticate(preset, creds[0], creds[1]);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public void loanTerm_Validation() {\n\t\thelper.assertString(loanTerm_AftrLogin(), payOffOffer.loanTerm_BfrLogin());\n\t\tSystem.out.print(\"The loan Term is: \" + loanTerm_AftrLogin());\n\n\t}", "static boolean EsAdmin(String username){\n StringTokenizer stk = new StringTokenizer(username,\"_\");\n while (stk.hasMoreTokens()){\n String token = stk.nextToken();\n if (token.equals(\"admin\")){\n return true;\n }\n }\n return false;\n }", "@Test\n\tpublic void adminIDTest() {\n\t\tString string1 = \"admin\";\n\t\tassertTrue(AdminValidator.isValidAdmin(string1));\n\n\t\tString string2 = \"username\";\n\t\tassertTrue(AdminValidator.isValidAdmin(string2));\n\n\t\tString string3 = \"\";\n\t\tassertFalse(AdminValidator.isValidAdmin(string3));\n\n\n\t\tString string4 = \"admin%\";\n\t\tassertFalse(AdminValidator.isValidAdmin(string4));\n\t}", "@Test\n public void atsdTest() {\n assertEquals(\"a\", authResponse.getAtsd());\n }", "public void testCheckString() {\n Util.checkString(\"test\", \"test\");\n }", "public void testCheckString() {\n Util.checkString(\"test\", \"test\");\n }", "public static void isAuth(HttpResponse response, JSONObject jsonObj) throws JSONException, NotAuthException {\n if (response.getStatusLine().getStatusCode() != 200) {\n if (jsonObj.getBoolean(\"error\")) {\n String errorMsj = jsonObj.getString(\"message\");\n if (errorMsj.equals(\"No Autenticado\")) {\n throw new NotAuthException(errorMsj, true);\n }\n }\n\n }\n }", "private void debugAuthentcation() {\n\n\t\t/*\n\t\t * XPagesUtil.showErrorMessage(\"bluemix util: serviceName: \" +\n\t\t * serviceName + \", baseUrl: \" + baseUrl + \" username: \" + username +\n\t\t * \" password: \" + password);\n\t\t * XPagesUtil.showErrorMessage(\"bluemix util: service name: \" +\n\t\t * serviceName + \", hardcodedBaseUrl: \" + hardcodedBaseUrl +\n\t\t * \" hardcodedUsername: \" + hardcodedUsername + \" hardcodedPassword: \" +\n\t\t * hardcodedPassword);\n\t\t */\n\t}", "private boolean validateLogin() {\n final String userName = userText.getText().toString();\n final String userPass = passwordText.getText().toString();\n if (\"\".equals(userName)) {\n userText.setError(\"You must enter a username\");\n return false;\n }\n if (\"\".equals(userPass)) {\n passwordText.setError(\"You must enter a password\");\n return false;\n }\n return true;\n }", "@Override\n public boolean filterAuthenticated(final ContainerRequestContext requestContext, final String authHeader) {\n if (authHeader.length() <= MAX_SIZE_AUTH_HEADER && goodAuths.getIfPresent(authHeader) != null) {\n // fast track - we have successfully authenticated this one before\n return false; // OK\n }\n\n // must have valid authentication - first, check allowed size (depending on method)\n final int firstSpace = authHeader.indexOf(' ');\n if (firstSpace <= 0) {\n throwForbidden(requestContext);\n return true; // filtered\n }\n final String typeOfAuth = authHeader.substring(0, firstSpace + 1); // add 1 because the constant includes the space\n final String authParam = authHeader.substring(firstSpace + 1);\n final int authLength = authParam.length();\n\n try {\n switch (typeOfAuth) {\n case T9tConstants.HTTP_AUTH_PREFIX_JWT:\n if (!allowAuthJwt()) {\n throwForbidden(requestContext);\n return true; // filtered\n }\n if (authLength < 10 || authLength > 4096) { // || !BASE64_PATTERN.matcher(authParam).matches()) {\n LOGGER.debug(\"Invalid JWT - length {}\", authLength);\n throwForbidden(requestContext);\n return true; // filtered\n }\n return filterJwt(requestContext, authHeader, authParam);\n case T9tConstants.HTTP_AUTH_PREFIX_API_KEY:\n if (!allowAuthApiKey() || authLength != 36 || !UUID_PATTERN.matcher(authParam).matches()) {\n LOGGER.debug(\"Invalid UUID - length {}\", authLength);\n throwForbidden(requestContext);\n return true; // filtered\n }\n return filterApiKey(requestContext, authHeader, authParam);\n case T9tConstants.HTTP_AUTH_PREFIX_USER_PW:\n if (!allowAuthBasic() || authLength < 8 || authLength > 80 || !BASE64_PATTERN.matcher(authParam).matches()) {\n throwForbidden(requestContext);\n return true; // filtered\n }\n return filterBasic(requestContext, authHeader, authParam);\n }\n } catch (final Throwable e) {\n LOGGER.warn(\"Caller caused exception: {}\", ExceptionUtil.causeChain(e));\n }\n throwForbidden(requestContext);\n return true; // filtered\n }", "private boolean validate(String username, String password) {\n\t\tif(username.equals(\"Venkat\") && password.equals(\"kumar\")) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "private boolean checkAuthentication(String login, String passwd) {\n Connection connect;\n boolean result = false;\n try {\n // connect db\n Class.forName(DRIVER_NAME);\n connect = DriverManager.getConnection(SQLITE_DB);\n // looking for login && passwd in db\n Statement stmt = connect.createStatement();\n ResultSet rs = stmt.executeQuery(SQL_SELECT.replace(\"?\", login));\n while (rs.next())\n result = rs.getString(PASSWD_COL).equals(passwd);\n // close all\n rs.close();\n stmt.close();\n connect.close();\n } catch (Exception ex) {\n ex.printStackTrace();\n return false;\n }\n return result;\n }", "boolean isInputValid(){\n\t\tString ac = edAccount.getText().toString();\n\t\tString pwd = edPassword.getText().toString();\n\t\tboolean isAccEmpty = StringUtil.isNullOrEmpty(ac);\n\t\tboolean isPwdEmpty = StringUtil.isNullOrEmpty(pwd);\n\t\tif(isAccEmpty){\n\t\t\tedAccount.requestFocus();\n\t\t}else if(isPwdEmpty){\n\t\t\tedPassword.requestFocus();\n\t\t}\n\t\treturn !( isAccEmpty|| isPwdEmpty);\n\t}", "public void auth(View view) {\n\n // get UI inputs\n login = (EditText) findViewById(R.id.login);\n password = (EditText) findViewById(R.id.password);\n result = (TextView)findViewById(R.id.result);\n\n // change inputs to strings\n txtLogin = login.getText().toString();\n txtPass = password.getText().toString();\n\n new Thread(){\n @Override\n public void run() { // thread to not disturb the UI thread\n\n URL url = null;\n try {\n url = new URL(\"https://httpbin.org/basic-auth/bob/sympa\");\n HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();\n // adding auth headers\n String userAndPassword = txtLogin+\":\"+txtPass; // text values from text fields\n// Log.i(\"USR\", txtLogin);\n// Log.i(\"PWD\", txtPass);\n String basicAuth = \"Basic \"+ Base64.encodeToString(userAndPassword.getBytes(), Base64.NO_WRAP);\n urlConnection.setRequestProperty(\"Authorization\", basicAuth);\n\n try {\n // read the returned HTML\n InputStream in = new BufferedInputStream(urlConnection.getInputStream());\n String s = readStream(in);\n Log.i(\"JFL\", s);\n\n jsonObject = new JSONObject(s); // storing the returned html in JSON form for easy access\n\n boolean res = jsonObject.getBoolean(\"authenticated\");\n// String usr = jsonObject.getString(\"user\");\n runOnUiThread(new Runnable() { // safe way to access the UI thread\n @Override\n public void run() {\n result.setText(\"\"+res);\n }\n });\n\n } catch (JSONException e) {\n e.printStackTrace();\n } finally {\n urlConnection.disconnect();\n }\n } catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }\n }.start();\n\n }", "@Override\n\tpublic boolean authisValid(String email, String password) {\n\t\treturn false;\n\t}", "public String authentification(){\r\n\t\t\r\n\t\tString v$navigation = null;\r\n\t\ttry {\r\n\t\t\tTabUsr\tusr = AdminSvcoDeleguate.getSvcoUsr().authenticate(defaultVue.getLogin(), defaultVue.getPassword());\r\n\t\t\tif(usr != null && usr.getCodUsr() != null && !usr.getPwdExpire()){\r\n\t\t\t\t// Navigation vers le formulaire d'acceuil\r\n\t\t\t\tdefaultVue.setUser(usr);\r\n\t\t\t\tv$navigation = \"AcceuilDeBase\";\r\n\t\t\t}else if(usr != null && usr.getPwdExpire()){\r\n\t\t\t\tFacesUtil.addWarnMessage(\"Votre mot de passe a expiré : veuillez contacter l'administrateur\", \"Votre mot de passe a expiré : veuillez contacter l'administrateur\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tFacesUtil.addWarnMessage(\"Login/Mot de passe incorrect\", \"Login/Mot de passe incorrect\");\r\n\t\t\t}\r\n\t\t} catch (SysGehoAppException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ServiceLocatorException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn v$navigation;\r\n\t}", "protected boolean isValidLogin(final String path, final String method) {\n return \"/apikey\".equals(path);\n }", "private boolean isPasswordValid(String password) {\n return password.length() > 0;\r\n }" ]
[ "0.75150126", "0.74573493", "0.74476945", "0.6950745", "0.65991545", "0.64647746", "0.6432034", "0.63737977", "0.63118625", "0.63118625", "0.63118625", "0.6277698", "0.6239169", "0.62177277", "0.62089014", "0.6163429", "0.5984868", "0.59394944", "0.5904183", "0.5817632", "0.58011013", "0.57715935", "0.57686305", "0.5748115", "0.5743963", "0.5688608", "0.5665508", "0.5665109", "0.5643835", "0.5629426", "0.5626999", "0.5585375", "0.55792665", "0.5573734", "0.55577004", "0.55483174", "0.5541442", "0.5538765", "0.5527332", "0.5516451", "0.54959315", "0.5493907", "0.5491052", "0.54888576", "0.54830843", "0.5477068", "0.5477068", "0.5477068", "0.54733616", "0.546975", "0.5464956", "0.5459618", "0.5445314", "0.54386604", "0.5433187", "0.5428869", "0.5413826", "0.5409823", "0.5408582", "0.5407644", "0.5397373", "0.5393431", "0.5353498", "0.5348276", "0.533654", "0.533587", "0.5332151", "0.53118455", "0.53089327", "0.5304449", "0.53000546", "0.52994627", "0.52976584", "0.5296175", "0.5286477", "0.5285444", "0.52809346", "0.52789694", "0.527437", "0.5269578", "0.5269536", "0.52680945", "0.52624494", "0.526188", "0.5259649", "0.52593803", "0.5257904", "0.5257904", "0.52546585", "0.52522755", "0.52508557", "0.5248793", "0.5233018", "0.52320623", "0.52271265", "0.5221306", "0.5210296", "0.5208708", "0.52082825", "0.5206235" ]
0.84365606
0
Checks the auth xmain string
private void checkAuthXMain() { val auth = config.getString("authXMain"); checkArgument(auth.length() > 10, "auth string (x-main) length is less than or equal to 10!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void checkAuthAtMain() {\n val auth = config.getString(\"authAtMain\");\n\n checkArgument(auth.length() > 10, \"auth string (at-main) length is less than or equal to 10!\");\n }", "private void checkAuthUbidMain() {\n val auth = config.getString(\"authUbidMain\");\n\n checkArgument(auth.length() > 10, \"auth string (ubid-main) length is less than or equal to 10!\");\n }", "private void checkAuthControl() {\n val authKey = config.getString(\"authControlKey\");\n val authValue = config.getString(\"authControlValue\");\n\n checkArgument(authKey.length() > 2, \"auth string (control key) length is less than or equal to 2!\");\n checkArgument(authValue.length() > 2, \"auth string (control value) length is less than or equal to 2!\");\n }", "private boolean isValidAuthentication(String authHeader) {\n return !StringUtils.isEmpty(authHeader);\n }", "private void checkAuthSessionId() {\n val auth = config.getString(\"authSessionId\");\n\n checkArgument(auth.length() > 10, \"auth string (sessionId) length is less than or equal to 10!\");\n }", "private void checkAuthSessionToken() {\n val auth = config.getString(\"authSessionToken\");\n\n checkArgument(auth.length() > 10, \"auth string (sessionToken) length is less than or equal to 10!\");\n }", "public abstract boolean validateAuthToken(String username , String authToken);", "public static boolean isAuth(String auths){\n\t\treturn AccUtils.manipulate(auths, ManOp.EMPTY_TO_NULL) != null;\n\t}", "public boolean isAuthRequired() {\n return !AfUtil.anyEmpty(_username);\n }", "boolean authNeeded();", "protected void validateToken() {\n\n authToken = preferences.getString(getString(R.string.auth_token), \"\");\n saplynService = new SaplynService(preferences.getInt(debugLvl, -1), authToken);\n\n // Check if user already authenticated\n if (authToken.equals(\"\")) {\n Intent intent = new Intent(HomeActivity.this, AuthenticationActivity.class);\n startActivityForResult(intent, 0);\n }\n else {\n populateUser();\n }\n }", "private void checkRep(){\n assert !this.username.equals(\"\");\n assert !this.password.equals(\"\");\n assert accessLevel != null;\n }", "@Test\n public void testBasicAuthHeader() {\n final String shellEncoded = \"Basic YWRtaW46YWRtaW5fcGFzcw==\";\n final String[] decoded = BasicAuthUtils.extractAndDecodeAuthHeader(shellEncoded, UTF_8.name());\n assertEquals(\"admin\", decoded[0]);\n assertEquals(\"admin_pass\", decoded[1]);\n\n assertEquals(shellEncoded, verify(\"admin\", \"admin_pass\"));\n }", "java.lang.String getAuth();", "java.lang.String getAuth();", "java.lang.String getAuth();", "boolean hasAuth();", "abstract public boolean checkAuth(String userId) throws IOException;", "protected boolean isBasicAuth(String header) {\n if (header == null) return false;\n\n // if its not a Basic header we deny the access\n if (header.length() < BASIC_AUTH.length()) return false;\n String pre = header.substring(0,BASIC_AUTH.length());\n if (!pre.toLowerCase().equals(BASIC_AUTH.toLowerCase())) return false;\n return true;\n }", "public boolean checkUsername(String user) {\n\n }", "public void verifyLogin(String s1)\n\t{\n\t\tUtilityClass.fn_Click(\"usermanagement_plusicon_bt\");\n\t\t\n\t\t//log.info(\"providing mobile number in username input field\");\n\t\t//UtilityClass.fn_Input(\"Loginpage_usernm_Input\", s1);\n\t\t//System.out.println(\"in verifylogin\");\n\t\t\n\t}", "boolean checkUserCorrispondenceLogin(String emailLogin, String passwordLogin);", "private boolean isValidToken(String authHeader) {\n AuthorisedTokenData token = authorisedTokensServices.getAuthorisedTokenByToken(authHeader);\n\n return token != null && token.getToken().equals(authHeader);\n }", "public static String checkUsername(String in) {\n\t\tif (in.isEmpty())\r\n\t\t\treturn \"Username is empty\";\r\n\t\telse {\r\n\t\t\tPattern passPat = Pattern.compile(\"\\\\w*\");\r\n\t\t\tMatcher matchpass = passPat.matcher(in);\r\n\t\t\tif (!matchpass.matches()) {\r\n\t\t\t\treturn \"The username must only contain character and numeric\";\r\n\t\t\t} else\r\n\t\t\t\treturn null;\r\n\t\t}\r\n\t}", "public static boolean checkValidAuth(String authCode) {\n if (authCode == null) {\n return false;\n }\n Pattern pattern = Pattern.compile(\"^([0-9A-Za-z]){1,20}$\");\n Matcher matcher = pattern.matcher(authCode);\n return matcher.matches();\n }", "boolean hasAuthKey();", "public String getInputAuth()\n\t{\n\t\treturn inputAuth;\n\t}", "public String isValidAgentLogin(String userName, String password);", "public void setInputAuth(String inputAuth)\n\t{\n\t\tthis.inputAuth = Toolbox.trim(inputAuth, 1);\n\t}", "private SMTP checkAuth(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tString auth = request.getHeader(\"Authorization\");\n\t\t\n\t\tif (auth == null) {\n\t\t\tsend(response, 401, \"Authorisation Needed\");\n\t\t\treturn null;\n\t\t}\n\t\t\t\t\n\t\tString[] creds = auth.split(\" \");\n\t\tif (!creds[0].equalsIgnoreCase(\"Basic\")) {\n\t\t\tsend(response, 501, \"Only Basic authentication is available - \" + creds[0] + \" is not acceptable\");\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tcreds[1] = new String(Base64.decode(creds[1]));\n\t\t} catch (Base64DecodingException e) {\n\t\t\tsend(response, 400, \"invalid base64 in authorization header\");\n\t\t\treturn null;\n\t\t}\n\n\t\ttry {\n\t\t\tint split = creds[1].indexOf(\":\");\n\t\t\tif (split == -1) {\n\t\t\t\tsend(response, 400, \"malformed authorization header (missing colon)\");\n\t\t\t}\n\t\t\tSMTP a = new SMTP(getSettings(creds[1].substring(0, split),\n\t\t\t\t\t \t\t\t creds[1].substring(split + 1)));\n\t\t\treturn a;\n\t\t} catch (AuthenticationFailedException e) {\n\t\t\tsend(response, 401, \"Authentication Failed\");\n\t\t} catch (MessagingException e ) {\n\t\t\tsend(response, 500, \"Internal Server error\");\n\t\t}\n\t\treturn null;\n\t}", "@Test\n\tpublic void adminIDTest() {\n\t\tString string1 = \"admin\";\n\t\tassertTrue(AdminValidator.isValidAdmin(string1));\n\n\t\tString string2 = \"username\";\n\t\tassertTrue(AdminValidator.isValidAdmin(string2));\n\n\t\tString string3 = \"\";\n\t\tassertFalse(AdminValidator.isValidAdmin(string3));\n\n\n\t\tString string4 = \"admin%\";\n\t\tassertFalse(AdminValidator.isValidAdmin(string4));\n\t}", "@Override\n public boolean check() {\n return GlobalParams.isLogin();\n }", "boolean hasLoginapiavgrtt();", "public static void main(String[] args) {\n\n int expLast4SSN = 1487;\n int exPinCode = 2729;\n\n int last4SSN = 1459;\n int pinCode = 2726;\n\n if (expLast4SSN == last4SSN && exPinCode == pinCode) {\n System.out.println(\"Authentication successful\");\n } else {\n System.out.println(\"Authentication unsuccessful\");\n if (expLast4SSN != last4SSN) {\n System.out.println(\"Last 4 of SSN did not match\");\n }\n if (exPinCode != pinCode){\n System.out.println(\"Pin code did not match\");\n\n\n\n\n }\n }\n }", "public static Boolean checkUsername(String username){\n\t\t//String username = txtUsername.getText();\n\t\t//System.out.println(username);\n\t\treturn (username.equals(\"Admin\"));\n\t}", "public static void main(String[] args) {\n\t\tString password = \"abc@1\";\n\t\tboolean b = verify(password);\n\t\tSystem.out.println(b);\n\t}", "private boolean isTokenBasedAuthentication(String authorizationHeader) {\n return authorizationHeader != null && authorizationHeader.toLowerCase()\n .startsWith(AUTHENTICATION_SCHEME.toLowerCase() + \" \");\n }", "private boolean isTokenBasedAuthentication(String authorizationHeader) {\n return authorizationHeader != null && authorizationHeader.toLowerCase()\n .startsWith(AUTHENTICATION_SCHEME.toLowerCase() + \" \");\n }", "private boolean isTokenBasedAuthentication(String authorizationHeader) {\n return authorizationHeader != null && authorizationHeader.toLowerCase()\n .startsWith(AUTHENTICATION_SCHEME.toLowerCase() + \" \");\n }", "public void Apr_Validation() {\n\t\thelper.assertString(Apr_AftrLogin(), payOffOffer.Apr_BfrLogin());\n\t\tSystem.out.print(\"The APR is: \" + Apr_AftrLogin());\n\n\t}", "public static String getCheckAuthentication() {\n\n\t\treturn baseURL + login_required_string + \"/rest/is-authenticated\";\n\t}", "private boolean authenticatedUser(String uName, String pass) {\n\t\treturn true;\n\t}", "private boolean requiresLettersOrSymbols() {\n return mPasswordMinLetters + mPasswordMinUpperCase\n + mPasswordMinLowerCase + mPasswordMinSymbols + mPasswordMinNonLetter > 0;\n }", "public void TC_04_Authentication_Alert() {\n\n\t\tdriver.get(\"http://admin:[email protected]/basic_auth\");\n\t}", "@Override\n\tpublic int validLogin(String adminid, String adminpw) {\n\t\tif (\"admin\".equals(adminid)\n\t\t\t\t&& \"12345\".equals(adminpw))\n\t\t\t{\n\t\t\t\treturn 99;\n\t\t\t}\n\t\t\treturn -1;\n\t}", "public void loanTerm_Validation() {\n\t\thelper.assertString(loanTerm_AftrLogin(), payOffOffer.loanTerm_BfrLogin());\n\t\tSystem.out.print(\"The loan Term is: \" + loanTerm_AftrLogin());\n\n\t}", "private boolean validateToken(String token, String user) {\n System.out.println(\"Userid is: \" + user);\n System.out.println(\"The token is \" + token);\n return user.equals(Jwts.parser().setSigningKey(SIGNING_KEY).parseClaimsJws(token).getBody().getSubject());\n\n }", "boolean isValid(String jwt);", "public FuzzerAuthString(){\r\n\t\tusername = \"\";\r\n\t\tpassword = \"\";\r\n\t}", "public boolean isAuthRequired() {\n\t\treturn false;\n\t}", "public abstract boolean checkCredentials (String username, String password);", "public CheckAuthCommand() {\n this.authLevel = AUTH_LEVEL_LOGGED_IN;\n }", "static boolean verifyIDRelaxed(String id)\r\n\t{\r\n\t\tfor(int i = 0; i < id.length(); i++)\r\n\t\t{\r\n\t\t\tchar c = id.charAt(i);\r\n\t\t\tif(Character.isLetterOrDigit(c)) //isAlpha\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse if(c == ' ' || c == '_' || c == '-')\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn id.length() > 0;\r\n\t}", "private Boolean isValidUsername(String username){\n return (username != null) && (username.length() >= 5 && username.length() <= 16);\n }", "static String validate(String username_or_password) {\r\n if (username_or_password.indexOf('\\'') != -1) {\r\n throw new IllegalArgumentException(\"invalid input: \" + username_or_password);\r\n }\r\n return username_or_password;\r\n }", "static boolean EsAdmin(String username){\n StringTokenizer stk = new StringTokenizer(username,\"_\");\n while (stk.hasMoreTokens()){\n String token = stk.nextToken();\n if (token.equals(\"admin\")){\n return true;\n }\n }\n return false;\n }", "public void testCheckString() {\n Util.checkString(\"test\", \"test\");\n }", "public void testCheckString() {\n Util.checkString(\"test\", \"test\");\n }", "private void checkAppKeySetup() {\n if (APP_KEY.startsWith(\"CHANGE\") ||\n APP_SECRET.startsWith(\"CHANGE\")) {\n showToast(\"You must apply for an app key and secret from developers.dropbox.com, and add them to the DBRoulette ap before trying it.\");\n finish();\n return;\n }\n\n // Check if the app has set up its manifest properly.\n Intent testIntent = new Intent(Intent.ACTION_VIEW);\n String scheme = \"db-\" + APP_KEY;\n String uri = scheme + \"://\" + AuthActivity.AUTH_VERSION + \"/test\";\n testIntent.setData(Uri.parse(uri));\n PackageManager pm = getPackageManager();\n if (0 == pm.queryIntentActivities(testIntent, 0).size()) {\n showToast(\"URL scheme in your app's \" +\n \"manifest is not set up correctly. You should have a \" +\n \"com.dropbox.client2.android.AuthActivity with the \" +\n \"scheme: \" + scheme);\n finish();\n }\n }", "private boolean isTokenBasedAuthentication(String authorizationHeader) {\n return authorizationHeader != null && authorizationHeader.toLowerCase()\n .startsWith(AUTHENTICATION_SCHEME.toLowerCase());\n }", "public void setMaintAuth(String maintAuth)\n\t{\n\t\tthis.maintAuth = Toolbox.trim(maintAuth, 1);\n\t}", "private static boolean verify(String ident) {\n if (Arrays.asList(IDENTIFIERS).contains(ident)) return true;\n if (!ident.matches(\"[a-zA-Z]\\\\w*\")) return true;\n variables.putIfAbsent(ident,0L);\n return false;\n }", "@Override\n public boolean filterAuthenticated(final ContainerRequestContext requestContext, final String authHeader) {\n if (authHeader.length() <= MAX_SIZE_AUTH_HEADER && goodAuths.getIfPresent(authHeader) != null) {\n // fast track - we have successfully authenticated this one before\n return false; // OK\n }\n\n // must have valid authentication - first, check allowed size (depending on method)\n final int firstSpace = authHeader.indexOf(' ');\n if (firstSpace <= 0) {\n throwForbidden(requestContext);\n return true; // filtered\n }\n final String typeOfAuth = authHeader.substring(0, firstSpace + 1); // add 1 because the constant includes the space\n final String authParam = authHeader.substring(firstSpace + 1);\n final int authLength = authParam.length();\n\n try {\n switch (typeOfAuth) {\n case T9tConstants.HTTP_AUTH_PREFIX_JWT:\n if (!allowAuthJwt()) {\n throwForbidden(requestContext);\n return true; // filtered\n }\n if (authLength < 10 || authLength > 4096) { // || !BASE64_PATTERN.matcher(authParam).matches()) {\n LOGGER.debug(\"Invalid JWT - length {}\", authLength);\n throwForbidden(requestContext);\n return true; // filtered\n }\n return filterJwt(requestContext, authHeader, authParam);\n case T9tConstants.HTTP_AUTH_PREFIX_API_KEY:\n if (!allowAuthApiKey() || authLength != 36 || !UUID_PATTERN.matcher(authParam).matches()) {\n LOGGER.debug(\"Invalid UUID - length {}\", authLength);\n throwForbidden(requestContext);\n return true; // filtered\n }\n return filterApiKey(requestContext, authHeader, authParam);\n case T9tConstants.HTTP_AUTH_PREFIX_USER_PW:\n if (!allowAuthBasic() || authLength < 8 || authLength > 80 || !BASE64_PATTERN.matcher(authParam).matches()) {\n throwForbidden(requestContext);\n return true; // filtered\n }\n return filterBasic(requestContext, authHeader, authParam);\n }\n } catch (final Throwable e) {\n LOGGER.warn(\"Caller caused exception: {}\", ExceptionUtil.causeChain(e));\n }\n throwForbidden(requestContext);\n return true; // filtered\n }", "void validatePassword(String usid, String password) throws Exception;", "@Test\n public void when_token_has_no_prefix_then_user_does_not_get_authentication() throws ServletException, IOException {\n test(\"eyJhbGciOiJQUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.hZnl5amPk_I3tb4O-Otci_5XZdVWhPlFyVRvcqSwnDo_srcysDvhhKOD01DigPK1lJvTSTolyUgKGtpLqMfRDXQlekRsF4XhAjYZTmcynf-C-6wO5EI4wYewLNKFGGJzHAknMgotJFjDi_NCVSjHsW3a10nTao1lB82FRS305T226Q0VqNVJVWhE4G0JQvi2TssRtCxYTqzXVt22iDKkXeZJARZ1paXHGV5Kd1CljcZtkNZYIGcwnj65gvuCwohbkIxAnhZMJXCLaVvHqv9l-AAUV7esZvkQR1IpwBAiDQJh4qxPjFGylyXrHMqh5NlT_pWL2ZoULWTg_TJjMO9TuQ\",\n null);\n }", "private boolean isValidLoginResponse(Response response) {\n\t\treturn response.header(\"Location\").toLowerCase().contains(\"testsession\");\r\n\t}", "public boolean authenticate(String s) {\r\n // TODO - implement User.authenticate\r\n throw new UnsupportedOperationException();\r\n }", "public boolean checkAuth() {\n SharedPreferences sharedPreferences = getSharedPreferences(SHARED_PREFS, MODE_PRIVATE);\n return sharedPreferences.getBoolean(AUTH, false);\n }", "static boolean verifyID(String id)\r\n\t{\r\n\t\tfor(int i = 0; i < id.length(); i++)\r\n\t\t{\r\n\t\t\tchar c = id.charAt(i);\r\n\t\t\tif((c <= 'Z' && c >= 'A') || (c >= 'a' && c <= 'z')) //isAlpha\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse if(c >= '0' && c <= '9' || c == '_' || c == '-') //is digit or _ or -\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse if(c == ' ')\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn id.length() > 0;\r\n\t}", "protected void check() throws IOException, ServletException {\n if(value.length()==0)\n error(\"please type in the License Server\");\n else {\n \t//TODO add more checks\n \tok();\n }\n }", "@Test\n public void authcodeTest() {\n assertEquals(\"12345\", authResponse.getAuthcode());\n }", "private boolean isValidInput(String mail, String pass) {\n SharedPreferences prefs = getSharedPreferences(MY_PREFS_NAME, MODE_PRIVATE);\n String emails = prefs.getString(\"EMAIL\", \"\");\n String pass1 = prefs.getString(\"PASS\", \"\");\n\n if (isEmpty(mail)) {\n return false;\n }\n if (isEmpty(pass)) {\n return false;\n }\n if (!mail.equals(emails)) {\n return false;\n }\n if (!pass.equals(pass1)) {\n return false;\n }\n return true;\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tusername1 = JOptionPane.showInputDialog(\"Enter Username\");\r\n\t\tpassword1 = JOptionPane.showInputDialog(\"Enter Password\");\r\n\t\t\r\n\t\t\r\n\t\tAuthentication.check(username1, password1);\r\n\t\t\r\n\r\n\t}", "public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n System.out.print(\"Enter a string for password: \");\n String s = input.nextLine();\n\n if (passwordDigitCheck(s) && paswordLengt(s) && passwordCharOrDig(s)){\n System.out.println(\"This password is valid\");\n }else System.out.println(\"This is an invalid password\");\n }", "public static void main(String[] args) {\r\n\t\t\r\n\t\tString password=encode(\"asdfghjkl\");\r\n\t\tSystem.out.println(password);\r\n\t\tString p=\"asdfghjkl\";\r\n\t\tboolean result=encode(p).equals(password);\r\n\t\tSystem.out.println(result);\r\n\t\t\r\n\t\t\r\n\t}", "private boolean validateLogin() {\n final String userName = userText.getText().toString();\n final String userPass = passwordText.getText().toString();\n if (\"\".equals(userName)) {\n userText.setError(\"You must enter a username\");\n return false;\n }\n if (\"\".equals(userPass)) {\n passwordText.setError(\"You must enter a password\");\n return false;\n }\n return true;\n }", "private boolean checkUsername() {\n if(getUsername.getText().compareTo(\"\") != 0) { return true; }\n else {\n errorMessage.setText(\"Please enter a username.\");\n return false;\n }\n }", "public static void main(String[] args) {\r\n\r\n Scanner scan =new Scanner(System.in);\r\n System.out.println(\"User Name:\");\r\n String userName = scan.next();\r\n System.out.println(\"Password:\");\r\n String password = scan.next();\r\n\r\n if (userName.equalsIgnoreCase(\"user123\") && password.equalsIgnoreCase(\"pass123\") ) {\r\n System.out.println(\"Login Succesfull\");\r\n } else if (! userName.equalsIgnoreCase(\"user123\") && password.equalsIgnoreCase(\"pass123\") ) {\r\n System.out.println(\"Username is not Correct\");\r\n } else if (userName.equalsIgnoreCase(\"user123\") && ! password.equalsIgnoreCase(\"pass123\")) {\r\n System.out.println(\"Password is not Correct\");\r\n } else if (! userName.equalsIgnoreCase(\"user123\") && ! password.equalsIgnoreCase(\"pass123\") ) {\r\n System.out.println(\"User name and Password is not correct\");\r\n }\r\n\r\n }", "private void authenticate( String loging, String sysLoging,String password,String sys_password) throws Exception {\n \n if(!loging.equals(sysLoging) || !(sys_password.equals(password) )){\n Exception e = new Exception();\n throw e;\n }\n\n }", "private void login() {\n\t\t \tetUserName.addTextChangedListener(new TextWatcher() {\n\t\t public void afterTextChanged(Editable s) {\n\t\t Validation.hasText(etUserName);\n\t\t }\n\t\t public void beforeTextChanged(CharSequence s, int start, int count, int after){}\n\t\t public void onTextChanged(CharSequence s, int start, int before, int count){}\n\t\t });\n\t\t \t\n\t\t \t // TextWatcher would let us check validation error on the fly\n\t\t \tetPass.addTextChangedListener(new TextWatcher() {\n\t\t public void afterTextChanged(Editable s) {\n\t\t Validation.hasText(etPass);\n\t\t }\n\t\t public void beforeTextChanged(CharSequence s, int start, int count, int after){}\n\t\t public void onTextChanged(CharSequence s, int start, int before, int count){}\n\t\t });\n\t\t }", "protected String loginIdentifyString() {\r\n return \"hao\";\r\n }", "private void debugAuthentcation() {\n\n\t\t/*\n\t\t * XPagesUtil.showErrorMessage(\"bluemix util: serviceName: \" +\n\t\t * serviceName + \", baseUrl: \" + baseUrl + \" username: \" + username +\n\t\t * \" password: \" + password);\n\t\t * XPagesUtil.showErrorMessage(\"bluemix util: service name: \" +\n\t\t * serviceName + \", hardcodedBaseUrl: \" + hardcodedBaseUrl +\n\t\t * \" hardcodedUsername: \" + hardcodedUsername + \" hardcodedPassword: \" +\n\t\t * hardcodedPassword);\n\t\t */\n\t}", "public static GoogleIdToken.Payload checkToken(String tokenString)\n\t\t\tthrows UnauthorizedException {\n\n\t\t// TODO: validate auth token, client id, etc.\n\t\tAuthChecker checker = new AuthChecker(\n\t\t\t\tUniversalConstants.APP_CLIENT_IDS, Constants.WEB_CLIENT_ID);\n\n\t\ttry {\n\t\t\tGoogleIdToken.Payload payload = checker.check(tokenString);\n\n\t\t\tif (checker.isValid() || AppConfig.isTest()) {\n\n\t\t\t\treturn payload;\n\t\t\t} else {\n\n\t\t\t\tthrow new UnauthorizedException(\"Invalid Auth With Problem: \"\n\t\t\t\t\t\t+ checker.problem());\n\t\t\t}\n\t\t} catch (GeneralSecurityException e) {\n\t\t\t// TODO: flag the security error\n\t\t\tthrow new UnauthorizedException(\"Security Error: \"\n\t\t\t\t\t+ e.getLocalizedMessage());\n\t\t}\n\n\t}", "private void checkValidation() {\n // Get email id and password\n MainActivity.EmailAddress = emailid.getText().toString();\n finalPassword = password.getText().toString();\n\n // Check patter for email id\n Pattern p = Pattern.compile(Utils.regEx);\n\n Matcher m = p.matcher(MainActivity.EmailAddress);\n\n // Check for both field is empty or not\n if (MainActivity.EmailAddress.equals(\"\") || MainActivity.EmailAddress.length() == 0\n || finalPassword.equals(\"\") || finalPassword.length() == 0) {\n loginLayout.startAnimation(shakeAnimation);\n new CustomToast().Show_Toast(getActivity(), view,\n \"Enter both credentials.\");\n\n }\n // Check if email id is valid or not\n else if (!m.find())\n new CustomToast().Show_Toast(getActivity(), view,\n \"Your Email Id is Invalid.\");\n // Else do login and do your stuff\n else\n tryLoginUser();\n\n }", "private static boolean authenticate(String username, String password) {\r\n\t\tFile file = new File(\"auth.txt\");\r\n\t\tScanner scanner;\r\n\t\tString user = null;\r\n\t\tString pwd = null;\r\n\t\ttry {\r\n\t\t\tscanner = new Scanner(file);\r\n\t\t\tString nextLine = scanner.nextLine();\r\n\t\t\tString[] parts = nextLine.split(\"=\");\r\n\t\t\tuser = parts[0];\r\n\t\t\tpwd = parts[1];\r\n\t\t\tscanner.close();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn (username.equals(user) && password.equals(pwd));\r\n\t\t\r\n\t}", "private boolean checkPassword() {\n String password = Objects.requireNonNull(password1.getEditText()).getText().toString();\n\n return password.length() >= 8 && ContainSpecial(password) && noUpper(password);\n }", "boolean isValidCredential(String username, String password);", "public String isValidAgentLogin(String userName, String password, String txn);", "public void pass1()throws Exception\r\n { \r\n guiframe g=new guiframe();\r\n g.setSize(400,400);\r\n g.setTitle(\"Authentication A\");\r\n g.setVisible(true);\r\n \r\n \r\n \r\n \r\n \r\n /*Scanner s =new Scanner(System.in);\r\n System.out.println(\"Enter the Password:\");\r\n String str=s.nextLine();\r\n DateFormat df=new SimpleDateFormat(\"HH:mm\");\r\n Date d=new Date();\r\n String time=df.format(d);\r\n StringBuffer t1=new StringBuffer(time);\r\n t1=t1.deleteCharAt(2);\r\n time=t1.toString();\r\n System.out.println(t1);\r\n \r\n if(str.equals(time))\r\n System.out.println(\"Access Granted\");\r\n else\r\n System.out.println(\"Access Denied\");*/\r\n }", "private ModelAndView handleScriptBasicAuth(HttpServletRequest request, HttpServletResponse response)\n {\n\tfinal HttpSession session = request.getSession();\n\tString http_basic_auth = null, http_basic_auth_username = null, http_basic_auth_password = null, openid = null;\n\tBoolean user_authenticated = false;\n\tbyte[] byteArray = null;\n\thttp_basic_auth = request.getHeader(\"Authorization\");\n\t \n\t \n\tString http_basic_auth_enc = http_basic_auth.replaceAll(\"Basic \", \"\");\n\tbyteArray = Base64.decodeBase64(http_basic_auth_enc.getBytes());\n\tString http_basic_auth_dec = new String(byteArray);\n\tString[] parts = http_basic_auth_dec.split(\":\");\n\thttp_basic_auth_username = parts[0];\n\thttp_basic_auth_password = parts[1];\n\t \n\tif (LOG.isDebugEnabled()) LOG.debug(\"Attempting authentication with user=\"+http_basic_auth_username+\" password=\"+http_basic_auth_password);\n\t\t\n\tuser_authenticated = idp.authenticate_ids(http_basic_auth_username, http_basic_auth_password);\n\topenid = idp.getOpenid(http_basic_auth_username);\t\t\n\t\t\n\tif((user_authenticated) && (openid != null)) \n\t{\n\t return setPositiveSessionAuth(session, openid);\n\t} \n\telse\n\t{\n\t // set session-scope authentication flag to FALSE\n\t session.setAttribute(OpenidPars.SESSION_ATTRIBUTE_AUTHENTICATED, Boolean.FALSE);\n\t if (LOG.isDebugEnabled()) LOG.debug(\"Authentication error\");\n\t response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);\n\t return null;\n\t}\n }", "private boolean isValidRegistryBasedAuthority(String authority) {\n int index = 0;\n int end = authority.length();\n char testChar;\n \n while (index < end) {\n testChar = authority.charAt(index);\n \n // check for valid escape sequence\n if (testChar == '%') {\n if (index+2 >= end ||\n !isHex(authority.charAt(index+1)) ||\n !isHex(authority.charAt(index+2))) {\n return false;\n }\n index += 2;\n }\n // can check against path characters because the set\n // is the same except for '/' which we've already excluded.\n else if (!isPathCharacter(testChar)) {\n return false;\n }\n ++index;\n }\n return true;\n }", "boolean validateUserAndPassword(String username, String password);", "@Test\n\tpublic void adminPassWordTest() {\n\t\tString string1 = \"admin!\";\n\t\tassertTrue(AdminValidator.isStrongPassword(string1));\n\n\t\tString string2 = \"user\";\n\t\tassertFalse(AdminValidator.isStrongPassword(string2));\n\n\t\tString string3 = \"\";\n\t\tassertFalse(AdminValidator.isStrongPassword(string3));\n\n\t\tString string4 = \"admin123\";\n\t\tassertTrue(AdminValidator.isStrongPassword(string4));\n\n\t}", "@Test\n public void ValidLoginTest() throws Exception {\n openDemoSite(driver).typeAuthInfo(loginEmail, \"Temp1234%\").signInByClick();\n }", "@Override\r\n\tpublic boolean validatePassword(String arg0, String arg1) {\n\t\treturn false;\r\n\t}", "public String validateUser(String un) {\n\t\tUser checkForUser = userDao.findByUsername(un);\n\t\tif (checkForUser != null) {\t\t\t\t\t//user exists\n\t\t\treturn \"That username already exists\";\n\t\t}\n\t\telse {\n\t\t\t//validate username\n\t\t\tif(!User.isValidUsername(un)) {\n\t\t\t\treturn \"Username must be between 5 and 11 characters and contain 1 alpha\";\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "boolean isAuthenticated();", "@When(\"^user should enter the valid username in the loginpage$\")\n\tpublic void user_should_enter_the_valid_username_in_the_loginpage() throws Throwable {\n\t inputValuestoElement(pa.getAp().getUsernamedisplay(), \"Srini1010\");\n\t}", "private boolean authenticate (HttpRequest request, HttpResponse response) throws UnsupportedEncodingException\n\t{\n\t\tString[] requestSplit=request.getPath().split(\"/\",3);\n\t\tif(requestSplit.length<2)\n\t\t\treturn false;\n\t\tString serviceName=requestSplit[1];\n\t\tfinal int BASIC_PREFIX_LENGTH=\"BASIC \".length();\n\t\tString userPass=\"\";\n\t\tString username=\"\";\n\t\tString password=\"\";\n\t\t\n\t\t//Check for authentication information in header\n\t\tif(request.hasHeaderField(AUTHENTICATION_FIELD)\n\t\t\t\t&&(request.getHeaderField(AUTHENTICATION_FIELD).length()>BASIC_PREFIX_LENGTH))\n\t\t{\n\t\t\tuserPass=request.getHeaderField(AUTHENTICATION_FIELD).substring(BASIC_PREFIX_LENGTH);\n\t\t\tuserPass=new String(Base64.decode(userPass), \"UTF-8\");\n\t\t\tint separatorPos=userPass.indexOf(':');\n\t\t\t//get username and password\n\t\t\tusername=userPass.substring(0,separatorPos);\n\t\t\tpassword=userPass.substring(separatorPos+1);\n\t\t\t\n\t\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\t\n\t\t\t\tlong userId;\n\t\t\t\tAgent userAgent;\n\t\t\t\t\n\t\t\t\tif ( username.matches (\"-?[0-9].*\") ) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tuserId = Long.valueOf(username);\n\t\t\t\t\t} catch ( NumberFormatException e ) {\n\t\t\t\t\t\tthrow new L2pSecurityException (\"The given user does not contain a valid agent id!\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tuserId = l2pNode.getAgentIdForLogin(username);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tuserAgent = l2pNode.getAgent(userId);\n\t\t\t\t\n\t\t\t\tif ( ! (userAgent instanceof PassphraseAgent ))\n\t\t\t\t\tthrow new L2pSecurityException (\"Agent is not passphrase protected!\");\n\t\t\t\t((PassphraseAgent)userAgent).unlockPrivateKey(password);\n\t\t\t\t_currentUserId=userId;\n\t\t\t\t\n\t\t\t\tif(!_userSessions.containsKey(userId))//if user not registered\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\tMediator mediator = l2pNode.getOrRegisterLocalMediator(userAgent);\n\t\t\t\t\t_userSessions.put(userId, new UserSession(mediator));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t_userSessions.get(userId).updateServiceTime(serviceName,new Date().getTime());//update last access time for service\n\t\t\t\t\n\t\t\t\tconnector.logMessage(\"Login: \"+username);\n\t\t\t\tconnector.logMessage(\"Sessions: \"+Integer.toString(_userSessions.size()));\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t}catch (AgentNotKnownException e) {\n\t\t\t\tsendUnauthorizedResponse(response, null, request.getRemoteAddress() + \": login denied for user \" + username);\n\t\t\t} catch (L2pSecurityException e) {\n\t\t\t\tsendUnauthorizedResponse( response, null, request.getRemoteAddress() + \": unauth access - prob. login problems\");\n\t\t\t} catch (Exception e) {\n\t\t\t\t\n\t\t\t\tsendInternalErrorResponse(\n\t\t\t\t\t\tresponse, \n\t\t\t\t\t\t\"The server was unable to process your request because of an internal exception!\", \n\t\t\t\t\t\t\"Exception in processing create session request: \" + e);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tresponse.setStatus ( HttpResponse.STATUS_BAD_REQUEST );\n\t\t\tresponse.setContentType( \"text/plain\" );\n\t\t\tresponse.print ( \"No authentication provided!\" );\n\t\t\tconnector.logError( \"No authentication provided!\" );\n\t\t}\n\t\treturn false;\n\t}", "private static Boolean testUsername(String username){\n\t\t//Setting Up Regex -> All Numbers and Letters maximum 14 signs\n\t\tString pattern =\"[A-z1-9]{2,14}\";\n\t\tPattern p = Pattern.compile(pattern);\n\t\tMatcher m = p.matcher(username);\n\t\t\t\n\t\tif(m.matches() && !username.isEmpty()){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}" ]
[ "0.80101097", "0.7541442", "0.69882154", "0.64909357", "0.62748986", "0.61584765", "0.6040214", "0.5921183", "0.58430934", "0.5818136", "0.57469106", "0.5667527", "0.5662255", "0.5655503", "0.5655503", "0.5655503", "0.5609031", "0.55256784", "0.5509318", "0.5496828", "0.54769826", "0.54700947", "0.54614407", "0.54207736", "0.5411542", "0.5405621", "0.53838843", "0.53793246", "0.53791934", "0.5366153", "0.53448415", "0.53319275", "0.53215426", "0.5319164", "0.5311195", "0.52634394", "0.5237062", "0.5237062", "0.5237062", "0.52232105", "0.51948774", "0.5165868", "0.5165176", "0.51646996", "0.51604927", "0.51406956", "0.51378363", "0.51343197", "0.5130261", "0.512459", "0.51132786", "0.5102832", "0.51025295", "0.509898", "0.50944513", "0.5083083", "0.5081972", "0.5081972", "0.5068662", "0.50656205", "0.50632524", "0.5051864", "0.5049645", "0.5046071", "0.5033588", "0.5033225", "0.50260407", "0.5021257", "0.5020326", "0.50197935", "0.50186706", "0.50139326", "0.50110596", "0.5002448", "0.49987283", "0.49953315", "0.49937162", "0.4990649", "0.4988976", "0.4988751", "0.4987639", "0.49834403", "0.49709356", "0.4969368", "0.49688283", "0.49625978", "0.49612832", "0.49573925", "0.4956548", "0.4956126", "0.4955847", "0.4952521", "0.4951386", "0.4947232", "0.4944007", "0.49399278", "0.49342033", "0.49318272", "0.49293712", "0.4927259" ]
0.86980283
0
Checks the auth session id string
private void checkAuthSessionId() { val auth = config.getString("authSessionId"); checkArgument(auth.length() > 10, "auth string (sessionId) length is less than or equal to 10!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void checkAuthSessionToken() {\n val auth = config.getString(\"authSessionToken\");\n\n checkArgument(auth.length() > 10, \"auth string (sessionToken) length is less than or equal to 10!\");\n }", "boolean hasSessionId();", "boolean hasSessionId();", "boolean hasSessionId();", "boolean hasSessionId();", "boolean hasSessionId();", "boolean hasSessionId();", "boolean hasClientSessionID();", "static boolean verifyID(String id)\r\n\t{\r\n\t\tfor(int i = 0; i < id.length(); i++)\r\n\t\t{\r\n\t\t\tchar c = id.charAt(i);\r\n\t\t\tif((c <= 'Z' && c >= 'A') || (c >= 'a' && c <= 'z')) //isAlpha\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse if(c >= '0' && c <= '9' || c == '_' || c == '-') //is digit or _ or -\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse if(c == ' ')\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn id.length() > 0;\r\n\t}", "java.lang.String getSessionID();", "boolean isSetSessionID();", "String getSessionID();", "String getSessionID();", "protected String getSessionID(Session session) {\n String[] authorizationValues = session.getUpgradeRequest().getHeader(\"Authorization\").split(\":\");\n if (authorizationValues.length < 3) {\n session.close(HttpStatus.BAD_REQUEST_400, \"Invalid Authorization header.\");\n }\n return Player.getPlayer(authorizationValues[2]).getSession().getSessionID();\n\n }", "@Override\n\t\tpublic boolean isRequestedSessionIdValid() {\n\t\t\treturn false;\n\t\t}", "private void checkSession(final long sessionID, final long sessionVerID)\n {\n }", "abstract public boolean checkAuth(String userId) throws IOException;", "private void checkAuthUbidMain() {\n val auth = config.getString(\"authUbidMain\");\n\n checkArgument(auth.length() > 10, \"auth string (ubid-main) length is less than or equal to 10!\");\n }", "private boolean CheckID(String id) {\n\t\tif ((!id.matches(\"([0-9])+\") || id.length() != 9) && (!id.matches(\"S([0-9])+\") || id.length() != 10)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "java.lang.String getSessionId();", "private void checkAuthAtMain() {\n val auth = config.getString(\"authAtMain\");\n\n checkArgument(auth.length() > 10, \"auth string (at-main) length is less than or equal to 10!\");\n }", "public boolean CheckSession(String session) { return validSessions.containsKey(session); }", "private void checkAuthControl() {\n val authKey = config.getString(\"authControlKey\");\n val authValue = config.getString(\"authControlValue\");\n\n checkArgument(authKey.length() > 2, \"auth string (control key) length is less than or equal to 2!\");\n checkArgument(authValue.length() > 2, \"auth string (control value) length is less than or equal to 2!\");\n }", "public static boolean validateSession(String ssId){\n\t\t//Filters by sessionId\n\t\tFilter sessionFilter = new FilterPredicate(\n\t\t\t\t\"sessionId\", FilterOperator.EQUAL, ssId\n\t\t\t\t);\n\t\t\n\t\tDatastoreService datastore = DatastoreServiceFactory.getDatastoreService();\n\t\t\n\t\t//Prepare the Query\n\t\tQuery q = new Query(\"sessionId\").setFilter(sessionFilter);\n\t\t\n\t\t// Use PreparedQuery interface to retrieve results\n\t\tPreparedQuery pq = datastore.prepare(q);\n\t\t//Loops through all results. In our case, we are going to just use the first one\n\t\tfor (Entity result : pq.asIterable()) {\n\t\t\tlog.warning(\"Entity returned, found sessionId\");\n\t\t\t/*\n\t\t\tIf this gets returned at all, we know the sessionId is valid, therefore, \n\t\t\twe can just return true. If we wanted to add additional security measures\n\t\t\t(IE checking sessionId against the name or something) it would go here.\n\t\t\tI am purposefully not checking against the date here and I'll show why\n\t\t\tat a later date. \n\t\t\t */\n\t\t\treturn true;\t\n\t\t}\n\t\t//Nothing was returned, return false\n\t\tlog.warning(\"Entity not returned, found nothing\");\n\t\treturn false;\n\t}", "String getSessionId();", "String getSessionId();", "String getSessionId();", "String getSessionId();", "int getClientSessionID();", "private boolean isValidLoginResponse(Response response) {\n\t\treturn response.header(\"Location\").toLowerCase().contains(\"testsession\");\r\n\t}", "@Test\n public void identifierTest() {\n assertEquals(\"ident1\", authResponse.getIdentifier());\n }", "public static boolean isAuth(String auths){\n\t\treturn AccUtils.manipulate(auths, ManOp.EMPTY_TO_NULL) != null;\n\t}", "static boolean verifyIDRelaxed(String id)\r\n\t{\r\n\t\tfor(int i = 0; i < id.length(); i++)\r\n\t\t{\r\n\t\t\tchar c = id.charAt(i);\r\n\t\t\tif(Character.isLetterOrDigit(c)) //isAlpha\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse if(c == ' ' || c == '_' || c == '-')\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn id.length() > 0;\r\n\t}", "private static String getSessionIDFromRequest (HTTPRequest aRequest)\n\t{\n\t\treturn aRequest.getQueryValue (\"sessionID\");\n\t}", "private void checkAuthXMain() {\n val auth = config.getString(\"authXMain\");\n\n checkArgument(auth.length() > 10, \"auth string (x-main) length is less than or equal to 10!\");\n }", "boolean hasSecId();", "private boolean isValidAuthentication(String authHeader) {\n return !StringUtils.isEmpty(authHeader);\n }", "public void testStringID() {\n String testID = generator.generatePrefixedIdentifier(\"test\");\n assertNotNull(testID);\n assertTrue(testID.matches(\"test\" + ID_REGEX));\n }", "java.lang.String getLoginId();", "public boolean validate(String id, String password);", "@Test\n public void getIdUser() throws Exception {\n Assert.assertEquals(1234,session.getIdUser());\n Assert.assertNotSame(\"1235\",session2.getIdUser());\n\n }", "int getSessionId();", "public String getSessionID() {\n Object ref = sessionID_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n sessionID_ = s;\n return s;\n }\n }", "public String getSessionID() {\n Object ref = sessionID_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n sessionID_ = s;\n return s;\n }\n }", "public String getSessionID() {\n Object ref = sessionID_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n sessionID_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "public String getSessionID() {\n Object ref = sessionID_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n sessionID_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "protected String loginIdentifyString() {\r\n return \"hao\";\r\n }", "public static boolean checkAuthorisation(HttpSession session) {\r\n\t\tif (session.getAttribute(CommandParameter.PARAM_NAME_ID) == null) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@Override\r\n \t\t\tpublic boolean isValid(long sessionId) throws SSessionNotFoundException {\n \t\t\t\treturn false;\r\n \t\t\t}", "public java.lang.String getAuthId(){\r\n return localAuthId;\r\n }", "public boolean hasSessionId() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "java.lang.String getUserID();", "java.lang.String getUserID();", "java.lang.String getUserID();", "static String m9939c(String str) throws C2579j {\n if (str == null || str.isEmpty()) {\n throw new C2579j(\"Authorization response does not contain the signed_request\");\n }\n try {\n String[] split = str.split(\"\\\\.\");\n if (split.length == 2) {\n return new JSONObject(new String(Base64.decode(split[1], 0), C2793C.UTF8_NAME)).getString(\"user_id\");\n }\n } catch (UnsupportedEncodingException | JSONException unused) {\n }\n throw new C2579j(\"Failed to retrieve user_id from signed_request\");\n }", "public boolean hasSessionId() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "boolean hasAuth();", "@Override\n public boolean hasSessionId() {\n return ((bitField0_ & 0x00000800) == 0x00000800);\n }", "@Override\n\t\tpublic boolean isRequestedSessionIdFromURL() {\n\t\t\treturn false;\n\t\t}", "final protected boolean verifySecretID(Object ID) {\n\t\t\tif(this.SecretID == null) return true;\n\t\t\treturn UObject.equal(this .SecretID, ID); \n\t\t}", "private String CheckGcmID() {\n\n\t\tLocalData data = new LocalData(this);\n\t\ttry {\n\n\t\t\tif (data.GetS(\"gcmId\").length() == 0) {\n\n\t\t\t\treturn \"\";\n\t\t\t}\n\n\t\t\tint currentversion = getAppVersion(SplashActivity.this);\n\n\t\t\tif (currentversion != data.GetI(\"app_version\")) {\n\t\t\t\treturn \"\";\n\t\t\t}\n\n\t\t} catch (Exception exp) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\treturn data.GetS(\"gcmId\");\n\t}", "@Override\n\t\tpublic boolean isRequestedSessionIdFromCookie() {\n\t\t\treturn false;\n\t\t}", "public String getSessionId() {\n// synchronized (mSessionObj) {\n// return mSessionId;\n// }\n return \"\";\n }", "String getLoginId();", "@Override\n public boolean hasSessionId() {\n return ((bitField0_ & 0x00000800) == 0x00000800);\n }", "@Override\n\tpublic int validLogin(String adminid, String adminpw) {\n\t\tif (\"admin\".equals(adminid)\n\t\t\t\t&& \"12345\".equals(adminpw))\n\t\t\t{\n\t\t\t\treturn 99;\n\t\t\t}\n\t\t\treturn -1;\n\t}", "private boolean m60455c(String str) {\n AccountInterface accountInterface;\n if (str != null && (accountInterface = (AccountInterface) InstanceProvider.m107964b(AccountInterface.class)) != null && !C16990fl.m84428a((CharSequence) str) && accountInterface.isCurrent(str)) {\n return true;\n }\n return false;\n }", "boolean hasAuthKey();", "private static boolean verify(String ident) {\n if (Arrays.asList(IDENTIFIERS).contains(ident)) return true;\n if (!ident.matches(\"[a-zA-Z]\\\\w*\")) return true;\n variables.putIfAbsent(ident,0L);\n return false;\n }", "java.lang.String getAuth();", "java.lang.String getAuth();", "java.lang.String getAuth();", "private void validateSecurityContextTokenId(String expectedSctId, Packet packet) throws RmSecurityException {\n String actualSctId = validator.getSecurityContextTokenId(packet);\n boolean isValid = Objects.equals(expectedSctId, actualSctId);\n\n if (!isValid) {\n throw new RmSecurityException(LocalizationMessages.WSRM_1131_SECURITY_TOKEN_AUTHORIZATION_ERROR(actualSctId, expectedSctId));\n }\n }", "final protected boolean verifySecretID(Object ID) {\n\t\tif(this.SecretID == null) return true;\n\t\treturn UObject.equal(this .SecretID, ID); \n\t}", "public boolean validateID() {\n\t\tif (this.id == null || this.id.length() < 1)\n\t\t\treturn false;\n\t\ttry {\n\t\t\tInteger.parseInt(this.id);\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public abstract boolean validateAuthToken(String username , String authToken);", "public boolean checkCourseID(String id) {\n // check for empty String\n if (id == null || id.strip().equals(\"\")) {\n return false;\n }\n\n // check for length\n if (id.length() > 6) {\n return false;\n }\n\n return true;\n }", "private boolean is_valid_message(String ID)\n\t{\n\t\t// if the string is not null, not empty, and between 0 and 65356 in length, it is valid\n\t\tif(ID != null && !ID.equals(\"\") && ID.length() > 0 && ID.length() < 65356)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t// otherwise it's not\n\t\treturn false;\n\t}", "public String getID()\n\t{\n\t return this.sessionID;\n\t}", "@Override\n\t\tpublic boolean isRequestedSessionIdFromUrl() {\n\t\t\treturn false;\n\t\t}", "private static String sessionId(String sessionID) {\n\t\t// setting the default value when argument's value is omitted\n\t\tif (sessionID == null) {\n\t\t\t// if the sessionID isn't specified, maybe we can still recover it somehow\n\t\t\treturn firstSessionId();\n\t\t} else {\n\t\t\t// nothing to do in this case; a SessionID WAS passed along, so just continue\n\t\t\t// using it\n\t\t\treturn sessionID;\n\t\t}\n\t}", "public static String isMemberInSession(int userId) {\n\t\tString memberSessionId = \"\";\n//\t\tObject object = cache.get(FQN_USER_ID, Integer.toString(userId));\n\t\tObject object = null;\n\t\tif (object != null) {\n\t\t\tmemberSessionId = (String) cache.get(FQN_USER_ID, Integer.toString(userId));\n\t\t} else {\n\t\t\tobject = cache.get(FQN_USER_ID, Integer.toString(userId));\n\t\t\tmemberSessionId = (String) cache.get(FQN_USER_ID, Integer.toString(userId));\n//\t\t\tcache.add(FQN_USER_ID, Integer.toString(userId), memberSessionId);\n\t\t}\n\t\treturn memberSessionId;\n\t}", "protected void validateToken() {\n\n authToken = preferences.getString(getString(R.string.auth_token), \"\");\n saplynService = new SaplynService(preferences.getInt(debugLvl, -1), authToken);\n\n // Check if user already authenticated\n if (authToken.equals(\"\")) {\n Intent intent = new Intent(HomeActivity.this, AuthenticationActivity.class);\n startActivityForResult(intent, 0);\n }\n else {\n populateUser();\n }\n }", "public int getSessionNo() {\n String[] sid = sessionid.split(\"/\");\n return Integer.parseInt(sid[0]);\n }", "private static String obtainSessionID(ApiContext apiContext) throws Exception {\n GetSessionIDCall apiCall = new GetSessionIDCall(apiContext);\n\n apiCall.setRuName(ruName);\n String sessionID = apiCall.getSessionID();\n //Handle the result returned\n logger.info(\"sessionID : \" + sessionID);\n return sessionID;\n }", "boolean isValid(String candidateOid);", "private boolean isValidId(String id) {\r\n\t\tboolean result = false;\r\n\t\tif (id.length() >= 1) {\r\n\t\t\tif (Character.isLetter(id.charAt(0))) {\r\n\t\t\t\tif (id.contains(\".\")) {\r\n\t\t\t\t\tString[] tokens = id.split(\"\\\\.\");\r\n\t\t\t\t\tif (tokens.length == 2) {\r\n\t\t\t\t\t\tfor (int i = 0; i < tokens[0].length(); i++) {\r\n\t\t\t\t\t\t\tif (!(tokens[0].charAt(i) == '.'\r\n\t\t\t\t\t\t\t\t\t|| tokens[0].charAt(i) == '_'\r\n\t\t\t\t\t\t\t\t\t|| tokens[0].charAt(i) == '-' || Character\r\n\t\t\t\t\t\t\t\t\t\t.isLetterOrDigit(tokens[0].charAt(i)))) {\r\n\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfor (int i = 0; i < tokens[1].length(); i++) {\r\n\t\t\t\t\t\t\tif (!(tokens[0].charAt(i) == '.'\r\n\t\t\t\t\t\t\t\t\t|| tokens[0].charAt(i) == '_'\r\n\t\t\t\t\t\t\t\t\t|| tokens[0].charAt(i) == '-' || Character\r\n\t\t\t\t\t\t\t\t\t\t.isLetterOrDigit(tokens[0].charAt(i)))) {\r\n\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public String getServerID() {\n String[] sid = sessionid.split(\"/\");\n return sid[1];\n }", "private boolean isSessionAuthenticated(Session userSession) {\n\t\treturn accountIdsByUserSession.containsKey(userSession);\n\t}", "public void verifyLogin(String s1)\n\t{\n\t\tUtilityClass.fn_Click(\"usermanagement_plusicon_bt\");\n\t\t\n\t\t//log.info(\"providing mobile number in username input field\");\n\t\t//UtilityClass.fn_Input(\"Loginpage_usernm_Input\", s1);\n\t\t//System.out.println(\"in verifylogin\");\n\t\t\n\t}", "public String getAuthyID () {\n\t\treturn this.authyID;\n\t}", "@Override\r\n\tpublic int idcheck(String loginId) {\n\t\treturn dao.idcheck(loginId);\r\n\t}", "private void validateId(String id) {\n if (!id.matches(\"[0-9]+\")) {\n throw new IllegalArgumentException(\"Invaild Tweet Id\");\n }\n return;\n }", "boolean isSessionValid(Object session);", "UUID getSessionId();", "public static boolean isValidId(String test) {\n return test.matches(VALIDATION_REGEX);\n }", "public static boolean isValidId(String test) {\n return test.matches(VALIDATION_REGEX);\n }", "void setSessionID(java.lang.String sessionID);", "java.lang.String getSID();", "java.lang.String getSID();" ]
[ "0.743868", "0.63911045", "0.63911045", "0.63911045", "0.63911045", "0.63911045", "0.63911045", "0.63799715", "0.6290956", "0.62607", "0.6203184", "0.61655307", "0.61655307", "0.615579", "0.61359096", "0.61057794", "0.60446066", "0.6033314", "0.5971736", "0.59501994", "0.5945629", "0.5908188", "0.58448595", "0.5802324", "0.57955444", "0.57955444", "0.57955444", "0.57955444", "0.57324356", "0.57246286", "0.5658049", "0.56515956", "0.5648306", "0.56254774", "0.5621516", "0.56136227", "0.5549732", "0.5545445", "0.5533127", "0.55165046", "0.5516431", "0.55113626", "0.5498062", "0.5498062", "0.549551", "0.549551", "0.548717", "0.54729086", "0.5412122", "0.5408194", "0.5398106", "0.5393608", "0.5393608", "0.5393608", "0.53919524", "0.53865045", "0.5375537", "0.53743184", "0.53736585", "0.5358761", "0.53501034", "0.5347546", "0.53435576", "0.53404963", "0.5334897", "0.5333665", "0.53209126", "0.53198683", "0.5319792", "0.5315848", "0.5315848", "0.5315848", "0.5314847", "0.53132486", "0.53056216", "0.53053635", "0.53033674", "0.52979475", "0.52935886", "0.5292903", "0.5289919", "0.5274942", "0.5273583", "0.5269421", "0.52582115", "0.5255647", "0.52540696", "0.5249039", "0.52485794", "0.5244124", "0.52244496", "0.52221453", "0.52200204", "0.5206396", "0.52059114", "0.52051866", "0.52051866", "0.5200534", "0.5198845", "0.5198845" ]
0.85234946
0
Checks the auth session token string
private void checkAuthSessionToken() { val auth = config.getString("authSessionToken"); checkArgument(auth.length() > 10, "auth string (sessionToken) length is less than or equal to 10!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void checkAuthSessionId() {\n val auth = config.getString(\"authSessionId\");\n\n checkArgument(auth.length() > 10, \"auth string (sessionId) length is less than or equal to 10!\");\n }", "protected void validateToken() {\n\n authToken = preferences.getString(getString(R.string.auth_token), \"\");\n saplynService = new SaplynService(preferences.getInt(debugLvl, -1), authToken);\n\n // Check if user already authenticated\n if (authToken.equals(\"\")) {\n Intent intent = new Intent(HomeActivity.this, AuthenticationActivity.class);\n startActivityForResult(intent, 0);\n }\n else {\n populateUser();\n }\n }", "public abstract boolean validateAuthToken(String username , String authToken);", "private boolean validateToken(String token, String user) {\n System.out.println(\"Userid is: \" + user);\n System.out.println(\"The token is \" + token);\n return user.equals(Jwts.parser().setSigningKey(SIGNING_KEY).parseClaimsJws(token).getBody().getSubject());\n\n }", "public boolean isTokenValide() {\n try {\n token = Save.defaultLoadString(Constants.PREF_TOKEN, getApplicationContext());\n if (token != null && !token.equals(\"\")) {\n if (token.equals(\"\"))\n return false;\n JWT jwt = new JWT(token);\n boolean isExpired = jwt.isExpired(0);\n return !isExpired;\n } else\n return false;\n } catch (Exception e) {\n e.printStackTrace();\n return false;\n }\n\n }", "private boolean isValidToken(String authHeader) {\n AuthorisedTokenData token = authorisedTokensServices.getAuthorisedTokenByToken(authHeader);\n\n return token != null && token.getToken().equals(authHeader);\n }", "private boolean isValid(CachedSession cachedSession, String authToken, JsonObject jsonAuth) {\n\n if (null == cachedSession) {\n return false;\n }\n\n if (null == authToken && null != jsonAuth) {\n // we might have this token on the jsonAuth:\n if (jsonAuth.containsKey(\"token\")) {\n authToken = jsonAuth.getString(\"token\");\n }\n }\n\n if (!cachedSession.getAuthToken().equals(authToken)) {\n // this is a new token, validate it again!\n logger.backingTokenChanged(cachedSession.getAuthToken(), authToken);\n return false;\n }\n\n boolean stillValid = System.currentTimeMillis() < cachedSession.getExpiresAt();\n logger.isTokenStillValid(stillValid);\n\n return stillValid;\n }", "void checkToken(String token) throws InvalidTokenException;", "private Boolean isInSession(String token, String username) {\n \treturn true;\n }", "private boolean verifyToken(final String token) {\n LOG.debug(token);\n if (!this.verificationToken.equals(token)) {\n LOG.error(Constants.VERIFICATION_TOKEN_INVALID);\n return false;\n }\n return true;\n }", "public String validateToken(HttpServletRequest request, HttpServletResponse response) {\n String[] cookieTokens = extractAndDecodeCookie(request, response);\n return validateToken(cookieTokens, request, response);\n }", "public boolean checkToken(BrewFindToken tok) {\n\t\t\n\t\t// The 'token' field on BrewFindToken contains the username base64 encoded\n\t\tString uname = Base64.decodeAsString(tok.token);\n\t\t\n\t\t// Make sure the user exists\n\t\tUser u = findUser(uname);\n\t\tif(u == null) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn checkToken(tok, u);\n\t\t\n\t}", "boolean hasToken();", "boolean hasToken();", "boolean hasToken();", "boolean hasToken();", "boolean hasToken();", "boolean hasToken();", "public boolean validateUserToken(String login, String token) throws SQLException;", "boolean isValid(String jwt);", "public boolean isValidSessionToken(String userName, String token) {\n\t\t// the userName is not in the session map\n\t\tif (!sessionMap.containsKey(userName)) {\n\t\t\treturn false;\n\t\t} \n\t\t\n\t\t// remove the double encoding to a single encoded token\n\t\t// which is stored in the map\n\t\tString decoded = new String(Base64.getDecoder().decode(token));\n\t\t\n\t\t// the session token does not match the token passed in\n\t\tSession session = sessionMap.get(userName);\n\t\tif (!session.getToken().equals(decoded)) {\n\t\t\tsessionMap.remove(userName);\n\t\t\tif (LOG.isDebugEnabled()) {\n\t\t\t\tLOG.debug(\"Token does not match cache. Removed session token for userName: \" + userName);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// is the token expired ?\n\t\tlong currTime = (new Date()).getTime();\n\t\tlong sessionStart = session.getCreateTime().getTime();\n\t\tif ( (currTime - sessionStart) >= propsConfig.getSecurityTokenExp()) {\n\t\t\tsessionMap.remove(userName);\n\t\t\tif (LOG.isDebugEnabled()) {\n\t\t\t\tLOG.debug(\"Token expired. Removed session token for userName: \" + userName);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t// the token is valid\n\t\treturn true;\n\t}", "public static GoogleIdToken.Payload checkToken(String tokenString)\n\t\t\tthrows UnauthorizedException {\n\n\t\t// TODO: validate auth token, client id, etc.\n\t\tAuthChecker checker = new AuthChecker(\n\t\t\t\tUniversalConstants.APP_CLIENT_IDS, Constants.WEB_CLIENT_ID);\n\n\t\ttry {\n\t\t\tGoogleIdToken.Payload payload = checker.check(tokenString);\n\n\t\t\tif (checker.isValid() || AppConfig.isTest()) {\n\n\t\t\t\treturn payload;\n\t\t\t} else {\n\n\t\t\t\tthrow new UnauthorizedException(\"Invalid Auth With Problem: \"\n\t\t\t\t\t\t+ checker.problem());\n\t\t\t}\n\t\t} catch (GeneralSecurityException e) {\n\t\t\t// TODO: flag the security error\n\t\t\tthrow new UnauthorizedException(\"Security Error: \"\n\t\t\t\t\t+ e.getLocalizedMessage());\n\t\t}\n\n\t}", "public Boolean validateToken(String token, UserDetails userDetails) {\n\t\tfinal String username = getUsernameFromToken(token);\n\t\treturn (username.equals(userDetails.getUsername())\n\t\t\t\t&& !isTokenExpired(token)\n\t\t\t\t&& activeTokens.getActiveTokens().contains(token));\n\t}", "public void testGetSessionToken() throws Exception {\r\n LOG.info(\"getSessionToken\");\r\n TokenAuthorisation token = tmdb.getAuthorisationToken();\r\n assertFalse(\"Token is null\", token == null);\r\n assertTrue(\"Token is not valid\", token.getSuccess());\r\n LOG.info(token.toString());\r\n \r\n TokenSession result = tmdb.getSessionToken(token);\r\n assertFalse(\"Session token is null\", result == null);\r\n assertTrue(\"Session token is not valid\", result.getSuccess());\r\n LOG.info(result.toString());\r\n }", "public boolean validateToken(String token, String username) {\n\t\tString tokenUserName = getUsername(token);\n\t\treturn username.equals(tokenUserName) && !isTokenExpired(tokenUserName);\n\t}", "@Test\n public void when_token_has_no_prefix_then_user_does_not_get_authentication() throws ServletException, IOException {\n test(\"eyJhbGciOiJQUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.hZnl5amPk_I3tb4O-Otci_5XZdVWhPlFyVRvcqSwnDo_srcysDvhhKOD01DigPK1lJvTSTolyUgKGtpLqMfRDXQlekRsF4XhAjYZTmcynf-C-6wO5EI4wYewLNKFGGJzHAknMgotJFjDi_NCVSjHsW3a10nTao1lB82FRS305T226Q0VqNVJVWhE4G0JQvi2TssRtCxYTqzXVt22iDKkXeZJARZ1paXHGV5Kd1CljcZtkNZYIGcwnj65gvuCwohbkIxAnhZMJXCLaVvHqv9l-AAUV7esZvkQR1IpwBAiDQJh4qxPjFGylyXrHMqh5NlT_pWL2ZoULWTg_TJjMO9TuQ\",\n null);\n }", "@Override\n\tpublic boolean isTokenValid(String token) {\n\t\tLoginToken loginToken = getLoginTokenByToken(token);\n\t\tif (loginToken != null) {\n\t\t\tDate createTime = loginToken.getCreateTime();\n\t\t\tDate current = new Date();\n\t\t\tSystem.out.println(\"过了:\"+Math.abs(current.getTime() - createTime.getTime()));\n\t\t\tSystem.out.println(\"过了:\"+Math.abs(current.getTime() - createTime.getTime()) / (1000 *60));\n\t\t\tif (Math.abs(current.getTime() - createTime.getTime()) / (1000 * 60) >= 60) {\n\t\t\t\tloginToken.setStatus(Constant.LOGIN_TOKEN_STATUS_INVALID);\n\t\t\t\tloginTokenMapper.updateByPrimaryKey(loginToken);\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\tloginToken.setCreateTime(current);\n\t\t\t\tloginTokenMapper.updateByPrimaryKey(loginToken);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}else {\n\t\t\treturn false;\n\t\t}\n\t}", "public static boolean checkSavedToken(Context context) {\n SharedPreferences preferences = context.getSharedPreferences(token_storage, 0);\n String storage_token = preferences.getString(\"token\", \"notoken\");\n\n if (!storage_token.equals(\"notoken\")) {\n Log.d(\"Service\", \"Using stored token\");\n header_token = \"Bearer \" + storage_token;\n isTokenPresent = true;\n bindToken();\n return true;\n }\n return false;\n }", "private boolean isAuthenticationRequired(String token) {\n Authentication existingAuth = SecurityContextHolder.getContext().getAuthentication();\n\n //authenticate if no auth\n if (existingAuth == null || !existingAuth.isAuthenticated()) {\n return true;\n }\n\n //revalidate if token was changed\n if (existingAuth instanceof JwtAuthentication && !StringUtils.equals(token, (String) existingAuth.getCredentials())) {\n return true;\n }\n\n //always try to authenticate in case of anonymous user\n if (existingAuth instanceof AnonymousAuthenticationToken) {\n return true;\n }\n\n return false;\n }", "public Boolean isValidCredential(String jwtToken , HttpServletRequest request) throws Exception {\n// Once we get the token and session .. validate it.\n\n // means user no already registered and using an un authenticated session\n // may be session fixation attack\n if (SecurityContextHolder.getContext().getAuthentication() == null) {\n System.out.println(\"[SUSPICIOUS REQUEST]-[\"+request.getRemoteAddr()+\"] not a authenticated session but jwt is acceptable \");\n return false;\n }else {\n // get UserDetails from SecurityContextHolder\n UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();\n if (jwtTokenUtil.validateToken(jwtToken, userDetails )){\n // jwt is valid , now check the session\n String sessionIp = (String) request.getSession().getAttribute(\"IP\");\n String sessionJwt = (String) request.getSession().getAttribute(\"TOKEN\");\n if (sessionIp != null && sessionJwt != null && sessionIp.equals(request.getRemoteAddr()) && sessionJwt.equals(jwtToken)){\n System.out.println(\"[SESSION VALIDATION APPROVED]\");\n return true;\n }else {\n System.out.println(\"[SUSPICIOUS REQUEST]-[\"+request.getRemoteAddr()+\"] user ip address or jwt not match\");\n System.out.println(\"-------details:\");\n System.out.println(\"---------------storedIp [\"+sessionIp+\"] != requestIp[\"+request.getRemoteAddr()+\"]\");\n System.out.println(\"---------------storedJwt[\"+sessionJwt+\"] != requestJWT[\"+jwtToken+\"]\");\n return false;\n }\n }else {\n System.out.println(\"[ERROR] jwt is not correct\");\n return false;\n }\n\n }\n }", "private boolean isValidLoginResponse(Response response) {\n\t\treturn response.header(\"Location\").toLowerCase().contains(\"testsession\");\r\n\t}", "private void checkAuthControl() {\n val authKey = config.getString(\"authControlKey\");\n val authValue = config.getString(\"authControlValue\");\n\n checkArgument(authKey.length() > 2, \"auth string (control key) length is less than or equal to 2!\");\n checkArgument(authValue.length() > 2, \"auth string (control value) length is less than or equal to 2!\");\n }", "boolean hasAuth();", "private boolean isTokenBasedAuthentication(String authorizationHeader) {\n return authorizationHeader != null && authorizationHeader.toLowerCase()\n .startsWith(AUTHENTICATION_SCHEME.toLowerCase() + \" \");\n }", "private boolean isTokenBasedAuthentication(String authorizationHeader) {\n return authorizationHeader != null && authorizationHeader.toLowerCase()\n .startsWith(AUTHENTICATION_SCHEME.toLowerCase() + \" \");\n }", "private boolean isTokenBasedAuthentication(String authorizationHeader) {\n return authorizationHeader != null && authorizationHeader.toLowerCase()\n .startsWith(AUTHENTICATION_SCHEME.toLowerCase() + \" \");\n }", "private boolean isValidAuthentication(String authHeader) {\n return !StringUtils.isEmpty(authHeader);\n }", "private boolean checkSession(HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws IOException {\n\t\tString token = httpRequest.getHeader(HEADER_TOKEN);\n\t\tif (HttpMethod.OPTIONS.matches(httpRequest.getMethod())) {\n\t\t\treturn true;\n\n\t\t}\n\t\tif (token == null) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (authenticationService.checkToken(token)) {\n\t\t\tlog.info(\" *** \" + HEADER_TOKEN + \" valid for: \"\n\t\t\t\t\t+ SecurityContextHolder.getContext().getAuthentication().getName());\n\t\t\treturn true;\n\t\t} else {\n\t\t\tlog.info(\" *** Invalid \" + HEADER_TOKEN + ' ' + token);\n\t\t\tSecurityContextHolder.clearContext();\n\t\t\thttpResponse = HttpCommunicationHandler.AddCORSHeadertoResponse(httpRequest, httpResponse);\n\t\t\thttpResponse.sendError(HttpServletResponse.SC_UNAUTHORIZED);\n\t\t}\n\t\treturn false;\n\t}", "boolean equals(String accessToken);", "private boolean isAuthorized(String decodedToken) {\n if(StringUtils.isBlank(decodedToken)){\n return false;\n }\n \n String[] credentials = decodedToken.split(\":\", 2);\n String clientid = credentials[0];\n String clientsc = credentials[1];\n \n ClientDto client = clientService.findByClientId(clientid);\n if(null == client) {\n return false;\n }\n BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();\n if(encoder.matches(clientsc, client.getClientSecret())) {\n return true;\n }\n \n return false;\n }", "public boolean isToken(String token){\n if(currentToken == -1) return false;\n return tokens.get(currentToken).identifier.equals(token);\n }", "private void checkAuthAtMain() {\n val auth = config.getString(\"authAtMain\");\n\n checkArgument(auth.length() > 10, \"auth string (at-main) length is less than or equal to 10!\");\n }", "private boolean isTokenBasedAuthentication(String authorizationHeader) {\n return authorizationHeader != null && authorizationHeader.toLowerCase()\n .startsWith(AUTHENTICATION_SCHEME.toLowerCase());\n }", "@Override\n public boolean isLoggedin(HttpServletRequest request) {\n boolean result = false;\n HttpSession session = request.getSession();\n String userName = (String) session.getAttribute(\"userName\");\n String token = (String) session.getAttribute(\"token\");\n if (userName != null && token != null) {\n CrUser user = userRepo.findByUserName(userName);\n if (user != null && isTokenValid(user, token)) {\n result = true;\n }\n }\n return result;\n }", "@Override\n public boolean isTokenValid(CrUser user, String token) {\n boolean result = false;\n if (user.getToken().equalsIgnoreCase(token)) {\n Date currentTime = new Date();\n if ((currentTime.getTime() - user.getTokenUpdateTime().getTime()) <= 1800000) {\n user.setTokenUpdateTime(currentTime);\n result = true;\n }\n }\n return result;\n }", "public String authByToken (String token){\n if (token.equals(\"ripcpsrlro3mfdjsaieoppsaa\")){\n return \"admin\";\n }\n else {\n Document query = new Document();\n query.put(\"token\", token);\n MongoCursor<Document> cursor = Security.find(query).iterator();\n if (cursor==null || !cursor.hasNext()) {\n System.out.println(\"here fails ! token used: \"+token);\n return \"none\";\n }\n else {\n Document c = cursor.next();\n String tnp = c.get(\"token\").toString();\n String admin = c.get(\"admin\").toString();\n if (tnp.equals(token)){\n if (admin.equals(\"true\")){\n return \"admin\";\n }\n else return \"user\";\n }\n else return \"none\";\n }\n //return \"none\";\n }\n }", "boolean hasAuthKey();", "private void checkAuthXMain() {\n val auth = config.getString(\"authXMain\");\n\n checkArgument(auth.length() > 10, \"auth string (x-main) length is less than or equal to 10!\");\n }", "public boolean validateToken(String token) {\n\t\ttry {\n\t\t\tJwts.parser().setSigningKey(secret).parseClaimsJws(token);\n\t\t\treturn true;\n\t\t} catch (MalformedJwtException e) {\n\t\t\tlogger.error(\"token mal formado \" +e.getMessage());\n\t\t} catch (UnsupportedJwtException e) {\n\t\t\tlogger.error(\"token no soportado \" +e.getMessage());\n\t\t} catch (ExpiredJwtException e) {\n\t\t\tlogger.error(\"token expirado \" +e.getMessage());\n\t\t} catch (IllegalArgumentException e) {\n\t\t\tlogger.error(\"token vacío \" +e.getMessage());\n\t\t} catch (SignatureException e) {\n\t\t\tlogger.error(\"error en la firma \" +e.getMessage());\n\t\t}\n\t\treturn false;\n\t}", "boolean authNeeded();", "@Override\n public boolean tokenIsValid(String token) {\n return DATABASE.getTokens().stream()\n .anyMatch(currentToken -> currentToken.equals(token));\n }", "boolean userInRedisSession(String token);", "public boolean CheckSession(String session) { return validSessions.containsKey(session); }", "public default boolean hasTokenString() {\n\t\treturn false;\n\t}", "public Boolean isTokenValid(String token, UserDetails userDetails) {\n SecurityUser user = (SecurityUser) userDetails;\n final String username = this.getUsernameFromToken(token);\n final Date created = this.getCreatedDateFromToken(token);\n return (username.equals(user.getUsername()) &&\n !this.isTokenExpired(token) &&\n !this.isCreatedBeforeLastPasswordReset(created, user.getLastPasswordReset()) &&\n !this.isCreatedBeforeLastLogout(created, user.getLastLogout()));\n }", "boolean hasSessionId();", "boolean hasSessionId();", "boolean hasSessionId();", "boolean hasSessionId();", "boolean hasSessionId();", "boolean hasSessionId();", "@Override\n\tpublic Response validateToken(\n\t\t\tString user,\n\t\t\tString token,\n\t\t\tString client_id,//client_id from the app calling the API\n\t\t\tString url,\n\t\t\tString method){\n\n\t\ttry{\t\t\t\n\t\t\tOA2Response result = sessionHandler.validateSession(client_id, user, token, url, method);\n\t\t\treturn Response.ok(result).build();\n\t\t\t\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\toa2logger.logError(httpRequest, Level.SEVERE, e.getLocalizedMessage());\n\t\t\treturn Response.status(Status.INTERNAL_SERVER_ERROR).\n\t\t\t\t\tentity(new OA2Response(500, \"Internal server Error.\"))\n\t\t\t\t\t.build();\n\t\t}\n\t}", "public void testSessionToken() throws Exception {\n MediaSession.Token sessionToken = mSession.getSessionToken();\n\n assertNotNull(sessionToken);\n assertEquals(0, sessionToken.describeContents());\n\n // Test writeToParcel\n Parcel p = Parcel.obtain();\n sessionToken.writeToParcel(p, 0);\n p.setDataPosition(0);\n MediaSession.Token token = MediaSession.Token.CREATOR.createFromParcel(p);\n assertEquals(token, sessionToken);\n p.recycle();\n }", "@Test\r\n\tpublic void TestvalidateToken() {\r\n\t\tlog.info(env.getProperty(\"log.start\"));\r\n\t\tudetails = new User(\"admin\", \"admin\", new ArrayList<>());\r\n\t\tString generateToken = jwtutil.generateToken(udetails);\r\n\t\tBoolean validateToken = jwtutil.validateToken(generateToken);\r\n\t\tassertEquals(true, validateToken);\r\n\t\tlog.info(env.getProperty(\"log.end\"));\r\n\t}", "@Test\n public void testValidToken() {\n try {\n int coachId = authBO.getUserIdAndValidateToken(\"thisisaworkingtoken\");\n Assert.assertTrue(coachId == 1);\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail(e.getMessage());\n }\n }", "boolean hasLoginapiavgrtt();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "public static boolean isTokenValid(String token, String cookie, String url, String method, String timestamp) {\n long createTime = Long.parseLong(timestamp);\n long currentTime = (new Date()).getTime() / 1000;\n if ((currentTime - createTime) > TOKEN_LIFE_SECONDS) {\n return false;\n }\n String data = url + \" \" + method + \" \" + createTime;\n byte[] hmac;\n try {\n hmac = computeSHA1HMac(data, cookie);\n } catch (GeneralSecurityException e) {\n throw new RuntimeException(\"Security exception - \" + e.getMessage());\n }\n String hmacEnc = Base64.encodeWebSafe(hmac, true);\n return hmacEnc.equals(token);\n }", "public boolean validateRefreshToken(String token){\n return refreshTokenRepository.findByToken(token).isPresent();\n }", "public static boolean authTokenIsValid(String authToken, Connection conn) throws DataAccessException {\n\n AuthTokenDao authTokenDao = new AuthTokenDao(conn);\n\n boolean valid = (authTokenDao.getUsernameByAuthToken(authToken) != null);\n\n if (!valid) logger.severe(\"Authentication failed\");\n\n return valid;\n\n }", "public Boolean checkToken(BrewFindToken tok, User u) {\n\t\tBrewFindToken uTok = u.getU_curToken();\t\n\t\tif(uTok == null) {\n\t\t\treturn false;\n\t\t}\n\t\t\t\t\n\t\t// Check that the token matches\n\t\tif((tok.access == uTok.access) && (tok.stamp == uTok.stamp) && (tok.token.equals(uTok.token))) {\n\t\t\treturn true;\n\t\t}\n\t\t\t\t\n\t\treturn false;\n\t}", "public boolean checkTokenExpiry(String token) {\n System.out.println(token);\n Date now = new Date();\n long nowTime = now.getTime();\n //Date expire;\n Date tokenEXPClaim;\n long expires;\n try {\n DecodedJWT recievedToken = JWT.decode(token);\n tokenEXPClaim = recievedToken.getExpiresAt();\n expires = tokenEXPClaim.getTime();\n return nowTime >= expires;\n } \n catch (Exception exception){\n System.out.println(\"Problem with token, no way to check expiry\");\n System.out.println(exception);\n return true;\n }\n \n }", "public Boolean canTokenBeRefreshed(String token, UserDetails userDetails) {\n return isTokenValid(token, userDetails);\n }", "private Boolean isTokenExpired(String token) {\n\t\tfinal Date expiration = getExpirationDateFromToken(token);\n\t\treturn expiration.before(new Date());\n\t}", "public boolean isAuthRequired() {\n return !AfUtil.anyEmpty(_username);\n }", "public boolean containsToken(String token);", "boolean isAuthenticated();", "java.lang.String getAuth();", "java.lang.String getAuth();", "java.lang.String getAuth();", "public boolean hasToken(){\n return (!clozerrtoken.isEmpty());\n }", "protected boolean authenticate() {\n \tif (mConfig == null) {\n \t\tmConfig = getConfig();\n \t}\n \tString keys[] = getKeys();\n \tif (keys != null) {\n\t mConfig = api.authenticateToken(keys[0], keys[1], mConfig);\n\t if (mConfig != null) {\n\t return true;\n\t }\n \t}\n \tshowToast(\"Failed user authentication for stored login tokens.\");\n \tclearKeys();\n \tsetLoggedIn(false);\n \treturn false;\n }", "public static Result token(String body) {\n\t\t\r\n\t\tArrayList<String> data = new Gson().fromJson(body, ArrayList.class);\r\n\t\tif(data == null) {\r\n\t\t\treturn new BadRequest(\"No payload data\");\r\n\t\t}\r\n\t\t\r\n\t\tString token = data.get(0);\r\n\t\tif(token == null || token.trim().equals(\"\")) {\r\n\t\t\treturn new BadRequest(\"Invalid payload data\");\r\n\t\t}\r\n\r\n\t\tString uname = data.get(1);\r\n\t\tif(uname == null || uname.trim().equals(\"\")) {\r\n\t\t\treturn new BadRequest(\"Invalid payload data\");\r\n\t\t}\r\n\t\t\r\n\t\tUser loggedUser = User.find(\"byUsername\", uname).first();\r\n\t\tif (loggedUser == null) {\r\n\t\t\treturn new BadRequest(\"Invalid payload data\");\r\n\t\t}\r\n\t\t\r\n\t\tif(!CsrfTokenUtils.checkToken(uname, token)) {\r\n\t\t\treturn new BadRequest(\"Invalid token\");\r\n\t\t}\r\n\r\n\t\tLong msgNum = userMsgNum.get(loggedUser.username);\r\n\t\tif(msgNum == null) {\r\n\t\t\tloggedUser.msgNum = 0L;\r\n\t\t\tuserMsgNum.put(loggedUser.username, loggedUser.msgNum);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tloggedUser.msgNum = Long.parseLong(msgNum.toString());\r\n\t\t}\r\n\r\n\t\tsession.put(\"user\", loggedUser.username);\r\n\t\tsession.put(\"userRole\", loggedUser.role.name);\r\n\t\tsession.put(\"userMsgNum\", loggedUser.msgNum);\r\n\t\t\r\n\t\ttoken = JWTUtils.generateJWT(loggedUser.username);\r\n\t\tString json = \"{\\\"role\\\": \\\"\" + loggedUser.role.name\r\n\t\t\t\t\t\t+ \"\\\", \\\"username\\\": \\\"\" + loggedUser.username\r\n\t\t\t\t\t\t+ \"\\\", \\\"msgNum\\\": \" + loggedUser.msgNum\r\n\t\t\t\t\t\t+ \", \\\"token\\\": \\\"\" + token + \"\\\"}\";\r\n\t\treturn new RenderText(json);\r\n\t}", "@RequestMapping(value = \"\", method = RequestMethod.GET)\n\tpublic void validateToken(HttpServletRequest request, HttpServletResponse response) throws IOException {\n\t\tString signature = request.getParameter(\"signature\");\n\t\tSystem.out.println(\"signature: \" + signature);\n\t\tString timestamp = request.getParameter(\"timestamp\");\n\t\tSystem.out.println(\"timestamp: \" + timestamp);\n\t\tString nonce = request.getParameter(\"nonce\");\n\t\tSystem.out.println(\"nonce: \" + nonce);\n\t\tString echostr = request.getParameter(\"echostr\");\n\t\tSystem.out.println(\"echostr: \" + echostr);\n\t\tList<String> params = new ArrayList<String>();\n\t\tparams.add(TOKEN);\n\t\tparams.add(timestamp);\n\t\tparams.add(nonce);\n\n\t\tCollections.sort(params, new Comparator<String>() {\n\t\t\tpublic int compare(String o1, String o2) {\n\t\t\t\treturn o1.compareTo(o2);\n\t\t\t}\n\t\t});\n\t\tString temp = SHA1.encode(params.get(0) + params.get(1) + params.get(2));\n\t\tif (temp.equals(signature)) {\n\t\t\tresponse.getWriter().write(echostr);\n\t\t}\n\t}", "String getUsernameFromToken(String token);", "protected boolean getStravaCheckToken()\n {\n return true;\n }", "public boolean checkAuth() {\n SharedPreferences sharedPreferences = getSharedPreferences(SHARED_PREFS, MODE_PRIVATE);\n return sharedPreferences.getBoolean(AUTH, false);\n }", "public Boolean validateToken(String token, String username, String applicationCode, Date lastPasswordReset) {\n\t\tfinal String usernameToValidate = this.getUsernameFromToken(token);\n\t\tfinal String applicationCodeToValidate = this.getIssuerFromToken(token);\n\t\tfinal Date created = this.getCreatedDateFromToken(token);\n\t\tfinal Date expiration = this.getExpirationDateFromToken(token);\n\t\treturn (usernameToValidate.equals(username) \n\t\t\t\t&& applicationCodeToValidate.equals(applicationCode)\n\t\t\t\t&& !(this.isTokenExpired(token)) \n\t\t\t\t&& !(this.isCreatedBeforeLastPasswordReset(created, lastPasswordReset)));\n\t}", "boolean hasLoginResponse();", "private boolean isLengthCorrect(final String token) {\n return token.length() == VALID_TOKEN_LENGTH;\n }", "public String verify(String token) {\n return Jwts.parserBuilder()\n .setSigningKey(jwtKey)\n .requireIssuer(jwtIssuer)\n .build()\n .parseClaimsJws(token)\n .getBody()\n .getSubject();\n }", "@GET\n @Path(\"/check/{token}\")\n @Produces(MediaType.APPLICATION_JSON)\n public Response checkToken(@PathParam(\"token\")String token) {\n\n final AuthServiceResult result = AuthServiceResult.OK;\n final String tokenInfo = authService.checkToken(token);\n\n return Response\n .status(result.getStatus())\n .entity(tokenInfo)\n .build();\n }", "boolean hasLoginRequest();", "protected void checkToken(){\n DBManager dao = new DBManager(appContext);\n dao= dao.open();\n Cursor c = dao.selectionner();\n if (c.getCount()>0) {\n System.out.println(\"Base activity token:\"+c.getCount());\n System.out.println(\"Base activity token:\"+c.getString(0));\n Intent main =new Intent(this, SplashScreenActivity.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(main);\n } else {\n System.out.println(\"No token Found\");\n Intent main = new Intent(this, LoginActivity.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(main);\n }\n }", "public String isValidAgentLogin(String userName, String password);" ]
[ "0.7457813", "0.69652647", "0.67738324", "0.67035395", "0.6503571", "0.6498225", "0.64041287", "0.63988715", "0.6359072", "0.635505", "0.63294894", "0.630247", "0.6280432", "0.6280432", "0.6280432", "0.6280432", "0.6280432", "0.6280432", "0.62700564", "0.6263692", "0.61784685", "0.61528707", "0.6148859", "0.61459154", "0.61447775", "0.6142778", "0.61262757", "0.61020213", "0.60758436", "0.60538775", "0.60281414", "0.6025331", "0.5997562", "0.59858936", "0.59858936", "0.59858936", "0.5979121", "0.59778184", "0.5965734", "0.59556174", "0.5941764", "0.5910122", "0.5858989", "0.5833465", "0.5821411", "0.58194894", "0.57799524", "0.577256", "0.57653457", "0.57611626", "0.57463014", "0.5741306", "0.57251185", "0.571614", "0.5714737", "0.56787467", "0.56787467", "0.56787467", "0.56787467", "0.56787467", "0.56787467", "0.56561625", "0.5656069", "0.5653736", "0.56413645", "0.5636317", "0.5630913", "0.5630913", "0.5630913", "0.5630913", "0.5630913", "0.5630913", "0.56305057", "0.5629333", "0.5619225", "0.56172675", "0.56116396", "0.5609362", "0.5609239", "0.5605723", "0.56026596", "0.55913156", "0.5590121", "0.5590121", "0.5590121", "0.558118", "0.5571178", "0.5565858", "0.5549497", "0.5548581", "0.5544297", "0.5543601", "0.5543285", "0.5527775", "0.55239534", "0.5520259", "0.55201316", "0.5506512", "0.5501041", "0.5496815" ]
0.85516906
0
Checks the auth ubidmain string
private void checkAuthUbidMain() { val auth = config.getString("authUbidMain"); checkArgument(auth.length() > 10, "auth string (ubid-main) length is less than or equal to 10!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void checkAuthAtMain() {\n val auth = config.getString(\"authAtMain\");\n\n checkArgument(auth.length() > 10, \"auth string (at-main) length is less than or equal to 10!\");\n }", "private void checkAuthXMain() {\n val auth = config.getString(\"authXMain\");\n\n checkArgument(auth.length() > 10, \"auth string (x-main) length is less than or equal to 10!\");\n }", "private void checkAuthControl() {\n val authKey = config.getString(\"authControlKey\");\n val authValue = config.getString(\"authControlValue\");\n\n checkArgument(authKey.length() > 2, \"auth string (control key) length is less than or equal to 2!\");\n checkArgument(authValue.length() > 2, \"auth string (control value) length is less than or equal to 2!\");\n }", "private boolean isValidAuthentication(String authHeader) {\n return !StringUtils.isEmpty(authHeader);\n }", "private void checkAuthSessionId() {\n val auth = config.getString(\"authSessionId\");\n\n checkArgument(auth.length() > 10, \"auth string (sessionId) length is less than or equal to 10!\");\n }", "abstract public boolean checkAuth(String userId) throws IOException;", "public static boolean isAuth(String auths){\n\t\treturn AccUtils.manipulate(auths, ManOp.EMPTY_TO_NULL) != null;\n\t}", "@Test\n public void testBasicAuthHeader() {\n final String shellEncoded = \"Basic YWRtaW46YWRtaW5fcGFzcw==\";\n final String[] decoded = BasicAuthUtils.extractAndDecodeAuthHeader(shellEncoded, UTF_8.name());\n assertEquals(\"admin\", decoded[0]);\n assertEquals(\"admin_pass\", decoded[1]);\n\n assertEquals(shellEncoded, verify(\"admin\", \"admin_pass\"));\n }", "private void checkAuthSessionToken() {\n val auth = config.getString(\"authSessionToken\");\n\n checkArgument(auth.length() > 10, \"auth string (sessionToken) length is less than or equal to 10!\");\n }", "java.lang.String getAuth();", "java.lang.String getAuth();", "java.lang.String getAuth();", "protected boolean isBasicAuth(String header) {\n if (header == null) return false;\n\n // if its not a Basic header we deny the access\n if (header.length() < BASIC_AUTH.length()) return false;\n String pre = header.substring(0,BASIC_AUTH.length());\n if (!pre.toLowerCase().equals(BASIC_AUTH.toLowerCase())) return false;\n return true;\n }", "public boolean isAuthRequired() {\n return !AfUtil.anyEmpty(_username);\n }", "void validatePassword(String usid, String password) throws Exception;", "public static boolean checkValidAuth(String authCode) {\n if (authCode == null) {\n return false;\n }\n Pattern pattern = Pattern.compile(\"^([0-9A-Za-z]){1,20}$\");\n Matcher matcher = pattern.matcher(authCode);\n return matcher.matches();\n }", "public abstract boolean validateAuthToken(String username , String authToken);", "boolean authNeeded();", "private boolean noUpper(String password) {\n return !password.equals(password.toLowerCase());\n }", "public void Apr_Validation() {\n\t\thelper.assertString(Apr_AftrLogin(), payOffOffer.Apr_BfrLogin());\n\t\tSystem.out.print(\"The APR is: \" + Apr_AftrLogin());\n\n\t}", "@Test\n\tpublic void adminIDTest() {\n\t\tString string1 = \"admin\";\n\t\tassertTrue(AdminValidator.isValidAdmin(string1));\n\n\t\tString string2 = \"username\";\n\t\tassertTrue(AdminValidator.isValidAdmin(string2));\n\n\t\tString string3 = \"\";\n\t\tassertFalse(AdminValidator.isValidAdmin(string3));\n\n\n\t\tString string4 = \"admin%\";\n\t\tassertFalse(AdminValidator.isValidAdmin(string4));\n\t}", "public boolean checkUsername(String user) {\n\n }", "public static String checkUsername(String in) {\n\t\tif (in.isEmpty())\r\n\t\t\treturn \"Username is empty\";\r\n\t\telse {\r\n\t\t\tPattern passPat = Pattern.compile(\"\\\\w*\");\r\n\t\t\tMatcher matchpass = passPat.matcher(in);\r\n\t\t\tif (!matchpass.matches()) {\r\n\t\t\t\treturn \"The username must only contain character and numeric\";\r\n\t\t\t} else\r\n\t\t\t\treturn null;\r\n\t\t}\r\n\t}", "public void loanTerm_Validation() {\n\t\thelper.assertString(loanTerm_AftrLogin(), payOffOffer.loanTerm_BfrLogin());\n\t\tSystem.out.print(\"The loan Term is: \" + loanTerm_AftrLogin());\n\n\t}", "boolean hasAuth();", "@Test\n public void shouldGiveTwoElementsWithOneColonString() {\n String decodeString = \"Q3Jhc2ggT3ZlcnJpZGU6SSBsb3ZlIEFjaWQgQnVybg==\";\n assertThat(\"Two elements is present\", BasicAuth.decode(decodeString), is(arrayWithSize(2)));\n assertThat(\"Username is contained\", BasicAuth.decode(decodeString), is(hasItemInArray(\"Crash Override\")));\n assertThat(\"Password is contained\", BasicAuth.decode(decodeString), is(hasItemInArray(\"I love Acid Burn\")));\n assertThat(\"Username is first\", BasicAuth.decode(decodeString)[0], is(\"Crash Override\"));\n assertThat(\"Password is last\", BasicAuth.decode(decodeString)[1], is(\"I love Acid Burn\"));\n }", "@Override\n\tpublic int validLogin(String adminid, String adminpw) {\n\t\tif (\"admin\".equals(adminid)\n\t\t\t\t&& \"12345\".equals(adminpw))\n\t\t\t{\n\t\t\t\treturn 99;\n\t\t\t}\n\t\t\treturn -1;\n\t}", "public void setInputAuth(String inputAuth)\n\t{\n\t\tthis.inputAuth = Toolbox.trim(inputAuth, 1);\n\t}", "static boolean verifyID(String id)\r\n\t{\r\n\t\tfor(int i = 0; i < id.length(); i++)\r\n\t\t{\r\n\t\t\tchar c = id.charAt(i);\r\n\t\t\tif((c <= 'Z' && c >= 'A') || (c >= 'a' && c <= 'z')) //isAlpha\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse if(c >= '0' && c <= '9' || c == '_' || c == '-') //is digit or _ or -\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse if(c == ' ')\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn id.length() > 0;\r\n\t}", "private void checkRep(){\n assert !this.username.equals(\"\");\n assert !this.password.equals(\"\");\n assert accessLevel != null;\n }", "public FuzzerAuthString(){\r\n\t\tusername = \"\";\r\n\t\tpassword = \"\";\r\n\t}", "private boolean checkPassword() {\n String password = Objects.requireNonNull(password1.getEditText()).getText().toString();\n\n return password.length() >= 8 && ContainSpecial(password) && noUpper(password);\n }", "@Override\r\n\tpublic boolean validatePassword(String arg0, String arg1) {\n\t\treturn false;\r\n\t}", "static String validate(String username_or_password) {\r\n if (username_or_password.indexOf('\\'') != -1) {\r\n throw new IllegalArgumentException(\"invalid input: \" + username_or_password);\r\n }\r\n return username_or_password;\r\n }", "public void verifyLogin(String s1)\n\t{\n\t\tUtilityClass.fn_Click(\"usermanagement_plusicon_bt\");\n\t\t\n\t\t//log.info(\"providing mobile number in username input field\");\n\t\t//UtilityClass.fn_Input(\"Loginpage_usernm_Input\", s1);\n\t\t//System.out.println(\"in verifylogin\");\n\t\t\n\t}", "public boolean checkUpperCase(String password) {\n return password.matches(\".*[A-Z].*\");\n }", "@Test\n public void shouldGiveSingleElementArrayOnNoColonString() {\n String decodeString = \"QnVybWEh\";\n assertThat(\"Only one element is present\", BasicAuth.decode(decodeString), is(arrayWithSize(1)));\n assertThat(\"Input string is contained\", BasicAuth.decode(decodeString), is(hasItemInArray(\"Burma!\")));\n }", "private boolean isValidServerBasedAuthority(String host, int port, String userinfo) {\n \n // Check if the host is well formed.\n if (!isWellFormedAddress(host)) {\n return false;\n }\n \n // Check that port is well formed if it exists.\n // REVISIT: There's no restriction on port value ranges, but\n // perform the same check as in setPort to be consistent. Pass\n // in a string to this method instead of an integer.\n if (port < -1 || port > 65535) {\n return false;\n }\n \n // Check that userinfo is well formed if it exists.\n if (userinfo != null) {\n // Userinfo can contain alphanumerics, mark characters, escaped\n // and ';',':','&','=','+','$',','\n int index = 0;\n int end = userinfo.length();\n char testChar = '\\0';\n while (index < end) {\n testChar = userinfo.charAt(index);\n if (testChar == '%') {\n if (index+2 >= end ||\n !isHex(userinfo.charAt(index+1)) ||\n !isHex(userinfo.charAt(index+2))) {\n return false;\n }\n index += 2;\n }\n else if (!isUserinfoCharacter(testChar)) {\n return false;\n }\n ++index;\n }\n }\n return true;\n }", "public String isValidAgentLogin(String userName, String password);", "@Test\n\tpublic void adminPassWordTest() {\n\t\tString string1 = \"admin!\";\n\t\tassertTrue(AdminValidator.isStrongPassword(string1));\n\n\t\tString string2 = \"user\";\n\t\tassertFalse(AdminValidator.isStrongPassword(string2));\n\n\t\tString string3 = \"\";\n\t\tassertFalse(AdminValidator.isStrongPassword(string3));\n\n\t\tString string4 = \"admin123\";\n\t\tassertTrue(AdminValidator.isStrongPassword(string4));\n\n\t}", "static boolean verifyIDRelaxed(String id)\r\n\t{\r\n\t\tfor(int i = 0; i < id.length(); i++)\r\n\t\t{\r\n\t\t\tchar c = id.charAt(i);\r\n\t\t\tif(Character.isLetterOrDigit(c)) //isAlpha\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse if(c == ' ' || c == '_' || c == '-')\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn id.length() > 0;\r\n\t}", "@Override\r\n\tpublic boolean validatePassword(String hash)\r\n\t{\r\n\r\n\t\tif (hm.containsKey(hash))\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Authentication OK.\");\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Authentication fail.\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t}", "public CheckAuthCommand() {\n this.authLevel = AUTH_LEVEL_LOGGED_IN;\n }", "private boolean isPasswordValid(String password) {\n return password.length() > 0;\r\n }", "public static void main(String[] args) {\n\t\tString password = \"abc@1\";\n\t\tboolean b = verify(password);\n\t\tSystem.out.println(b);\n\t}", "private boolean isPasswordValid(String password){\n return password.length() > 2; //mot de passe de longueur sup à 2\n }", "boolean hasLoginapiavgrtt();", "boolean verifySecretKey(StringBuilder secretKey) {\n return secretKey.toString().matches(\"[a-zA-Z][a-zA-Z]-[^a-zA-Z0-9][a-zA-Z][a-zA-Z]-[2-5][^a-zA-Z0-9]\");\n }", "public String validateUser(String un) {\n\t\tUser checkForUser = userDao.findByUsername(un);\n\t\tif (checkForUser != null) {\t\t\t\t\t//user exists\n\t\t\treturn \"That username already exists\";\n\t\t}\n\t\telse {\n\t\t\t//validate username\n\t\t\tif(!User.isValidUsername(un)) {\n\t\t\t\treturn \"Username must be between 5 and 11 characters and contain 1 alpha\";\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private boolean isPasswordValid(String password) {\n return password.length() >= 1;\n }", "boolean hasAuthKey();", "private Boolean isValidUsername(String username){\n return (username != null) && (username.length() >= 5 && username.length() <= 16);\n }", "private boolean isPasswordValid(String password) {\n return password.length() > 4;\r\n }", "private boolean isPasswordValid(String password) {\n return password.length() > 4;\r\n }", "private boolean isPasswordValid(String password) {\n return password.length() > 4;\r\n }", "public void validarRut(String rut) {\n boolean validacion = false;\n try {\n rut = rut.toUpperCase().replace(\".\", \"\").replace(\"-\", \"\");\n int rutAux = Integer.parseInt(rut.substring(0, rut.length() - 1));\n char dv = rut.charAt(rut.length() - 1);\n int m = 0, s = 1;\n for (; rutAux != 0; rutAux /= 10) {\n s = (s + rutAux % 10 * (9 - m++ % 6)) % 11;\n }\n if (dv == (char) (s != 0 ? s + 47 : 75)) {\n validacion = true;\n recorrerUsuarios(rut);\n }\n } catch (java.lang.NumberFormatException e) {\n } catch (Exception e) {\n }\n if (validacion==false){\n Toast.makeText(getApplicationContext(),\"Rut no valido\",Toast.LENGTH_LONG).show();\n }\n }", "boolean checkUserCorrispondenceLogin(String emailLogin, String passwordLogin);", "private boolean authenticatedUser(String uName, String pass) {\n\t\treturn true;\n\t}", "public void setMaintAuth(String maintAuth)\n\t{\n\t\tthis.maintAuth = Toolbox.trim(maintAuth, 1);\n\t}", "private static Boolean testUsername(String username){\n\t\t//Setting Up Regex -> All Numbers and Letters maximum 14 signs\n\t\tString pattern =\"[A-z1-9]{2,14}\";\n\t\tPattern p = Pattern.compile(pattern);\n\t\tMatcher m = p.matcher(username);\n\t\t\t\n\t\tif(m.matches() && !username.isEmpty()){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "@Test\n public void shouldIgnoreMoreThanOneColon() {\n String decodeString = \"U2VyZ2VhbnQgQ29sb246b3dlZCB0aGlydHkgeWVhcnMgb2YgaGFwcHkgbWFycmlhZ2UgdG8gdGhlIGZhY3QgdGhhdCBNcnMuIENvbG9uOndvcmtlZCBhbGwgZGF5IGFuZCBTYXJnZW50IENvbG9uIHdvcmtlZCBhbGwgbmlnaHQu\";\n assertThat(\"Two elements is present\", BasicAuth.decode(decodeString), is(arrayWithSize(2)));\n assertThat(\"Username is contained\", BasicAuth.decode(decodeString), is(hasItemInArray(\"Sergeant Colon\")));\n assertThat(\"Password is contained\", BasicAuth.decode(decodeString), is(hasItemInArray(\"owed thirty years of happy marriage to the fact that Mrs. Colon:worked all day and Sargent Colon worked all night.\")));\n\n // Encoded \"They:communicated:by:means:of:notes.:They:had:three:grown-up:children,:all:born,:Vimes:had:assumed,:as:a:result:of:extremely:persuasive:handwriting.\" as Base64\n decodeString = \"VGhleTpjb21tdW5pY2F0ZWQ6Ynk6bWVhbnM6b2Y6bm90ZXMuOlRoZXk6aGFkOnRocmVlOmdyb3duLXVwOmNoaWxkcmVuLDphbGw6Ym9ybiw6VmltZXM6aGFkOmFzc3VtZWQsOmFzOmE6cmVzdWx0Om9mOmV4dHJlbWVseTpwZXJzdWFzaXZlOmhhbmR3cml0aW5nLg==\";\n assertThat(\"Two elements is present\", BasicAuth.decode(decodeString), is(arrayWithSize(2)));\n assertThat(\"Username is contained\", BasicAuth.decode(decodeString), is(hasItemInArray(\"They\")));\n assertThat(\"Password is contained\", BasicAuth.decode(decodeString), is(hasItemInArray(\"communicated:by:means:of:notes.:They:had:three:grown-up:children,:all:born,:Vimes:had:assumed,:as:a:result:of:extremely:persuasive:handwriting.\")));\n }", "public void testCheckString() {\n Util.checkString(\"test\", \"test\");\n }", "public void testCheckString() {\n Util.checkString(\"test\", \"test\");\n }", "private byte[] handleAuthPt1(byte[] payload) {\n\t\tboolean userIdentified = false;\n\t\tbyte[] supposedUser = null;\n\n//\n\t\tSystem.out.println(\"payload received by SecretServer:\");\n\t\tComMethods.charByChar(payload,true);\n//\n\n\t\tuserNum = -1;\n\t\twhile (userNum < validUsers.length-1 && !userIdentified) {\n\t\t\tuserNum++;\n\t\t\tsupposedUser = validUsers[userNum].getBytes();\n\t\t\tuserIdentified = Arrays.equals(Arrays.copyOf(payload, supposedUser.length), supposedUser);\n\n//\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"\\\"\"+validUsers[userNum]+\"\\\" in bytes:\");\n\t\t\tComMethods.charByChar(validUsers[userNum].getBytes(),true);\n\t\t\tSystem.out.println(\"\\\"Arrays.copyOf(payload, supposedUser.length\\\" in bytes:\");\n\t\t\tComMethods.charByChar(Arrays.copyOf(payload, supposedUser.length),true);\n\t\t\tSystem.out.println();\n//\n\t\t}\n\n\t\tif (!userIdentified) {\n\t\t\tComMethods.report(\"SecretServer doesn't recognize name of valid user.\", simMode);\n\t\t\treturn \"error\".getBytes();\n\t\t} else {\n\t\t\t// Process second half of message, and verify format\n\t\t\tbyte[] secondHalf = Arrays.copyOfRange(payload, supposedUser.length, payload.length);\n//\n\tSystem.out.println(\"secondHalf = \"+secondHalf);\n//\n\t\t\tsecondHalf = ComMethods.decryptRSA(secondHalf, my_n, my_d);\n\n//\n\tSystem.out.println(\"secondHalf = \"+secondHalf);\n//\n\t\t\tComMethods.report(\"SecretServer has decrypted the second half of the User's message using SecretServer's private RSA key.\", simMode);\n\n\t\t\tif (!Arrays.equals(Arrays.copyOf(secondHalf, supposedUser.length), supposedUser)) {\n\t\t\t\t// i.e. plaintext name doesn't match the encrypted bit\n\t\t\t\tComMethods.report(\"ERROR ~ invalid first message in protocol.\", simMode);\t\t\t\t\n\t\t\t\treturn \"error\".getBytes();\n\t\t\t} else {\n\t\t\t\t// confirmed: supposedUser is legit. user\n\t\t\t\tcurrentUser = new String(supposedUser); \n\t\t\t\tuserSet = true;\n\t\t\t\tbyte[] nonce_user = Arrays.copyOfRange(secondHalf, supposedUser.length, secondHalf.length);\n\n\t\t\t\t// Second Message: B->A: E_kA(nonce_A || Bob || nonce_B)\n\t\t\t\tmyNonce = ComMethods.genNonce();\n\t\t\t\tComMethods.report(\"SecretServer has randomly generated a 128-bit nonce_srvr = \"+myNonce+\".\", simMode);\n\t\t\t\n\t\t\t\tbyte[] response = ComMethods.concatByteArrs(nonce_user, \"SecretServer\".getBytes(), myNonce);\n\t\t\t\tbyte[] responsePayload = ComMethods.encryptRSA(response, usersPubKeys1[userNum], BigInteger.valueOf(usersPubKeys2[userNum]));\n\t\t\t\treturn responsePayload;\n\t\t\t}\n\t\t}\n\t}", "public static boolean isAlphapetic(String userInput) {\n return Pattern.matches(Constants.NAME_VALIDATION, userInput);\n }", "private boolean validateParams(String userName, String password, String fullName) {\n if (userName == null || password == null || fullName == null) {\n return false;\n }\n\n if (userName.length() == 0 || password.length() == 0 || fullName.length() == 0) {\n return false;\n }\n\n return true;\n }", "public boolean mo62323b(String str) {\n try {\n return \"mraid.js\".equals(Uri.parse(str.toLowerCase(Locale.US)).getLastPathSegment());\n } catch (Exception e) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"matchesInjectionUrl Exception: \");\n sb.append(e.getMessage());\n C5155g.m3807a(\"MraidWebViewClient\", 6, sb.toString());\n return false;\n }\n }", "static String m9939c(String str) throws C2579j {\n if (str == null || str.isEmpty()) {\n throw new C2579j(\"Authorization response does not contain the signed_request\");\n }\n try {\n String[] split = str.split(\"\\\\.\");\n if (split.length == 2) {\n return new JSONObject(new String(Base64.decode(split[1], 0), C2793C.UTF8_NAME)).getString(\"user_id\");\n }\n } catch (UnsupportedEncodingException | JSONException unused) {\n }\n throw new C2579j(\"Failed to retrieve user_id from signed_request\");\n }", "protected void validateToken() {\n\n authToken = preferences.getString(getString(R.string.auth_token), \"\");\n saplynService = new SaplynService(preferences.getInt(debugLvl, -1), authToken);\n\n // Check if user already authenticated\n if (authToken.equals(\"\")) {\n Intent intent = new Intent(HomeActivity.this, AuthenticationActivity.class);\n startActivityForResult(intent, 0);\n }\n else {\n populateUser();\n }\n }", "public Boolean comprovaLoginPW(String pw) {\n\t\treturn (loginValidator.validatePasswordFormat(pw));\n\t}", "@Test\n public void authcodeTest() {\n assertEquals(\"12345\", authResponse.getAuthcode());\n }", "public boolean isAuthRequired() {\n\t\treturn false;\n\t}", "@SuppressWarnings(\"unchecked\")\n\tprivate synchronized boolean auth(Connection con, JsonObject receivedMSG) throws NullPointerException {\n\t\tJSONObject auth = new JSONObject();\n\t\tString command;\n\t\tString info;\n\n\t\t// If already authenticated then reply with invalid message\n\t\tif (broadConnections.contains(con)) {\n\t\t\tInvalidMessage response = new InvalidMessage();\n\t\t\tresponse.setInfo(\"Already authenticated in this server\");\n\t\t\tcon.writeMsg(response.toJsonString());\n\t\t\treturn true;\n\t\t}\n\t\t// Check if provided secret matches the setting\n\t\tString secret = receivedMSG.get(\"secret\").getAsString();\n\t\tif (!secret.equals(Settings.getSecret())) {\n\t\t\tcommand = AUTHENTICATION_FAIL;\n\t\t\t// String authFailMSG = toJsonString();\n\t\t\tinfo = \"the supplied secret is incorrect: \" + secret;\n\t\t\tauth.put(\"command\", command);\n\t\t\tauth.put(\"info\", info);\n\t\t\tcon.writeMsg(auth.toJSONString());\n\t\t\treturn false;\n\t\t}\n\t\tbroadConnections.add(con);\n\t\treturn true;\n\t}", "private AuthenticationScheme basic(String string, String string2) {\n\t\treturn null;\n\t}", "private boolean isPasswordValid(String password) {\n return password.length() >= 4;\n }", "private boolean isPasswordValid(String password) {\n return password.length() > 4;\n }", "private boolean validate(String username, String password) {\n\t\tif(username.equals(\"Venkat\") && password.equals(\"kumar\")) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public abstract boolean containsUppercaseLetters(String str);", "private boolean isValidRegistryBasedAuthority(String authority) {\n int index = 0;\n int end = authority.length();\n char testChar;\n \n while (index < end) {\n testChar = authority.charAt(index);\n \n // check for valid escape sequence\n if (testChar == '%') {\n if (index+2 >= end ||\n !isHex(authority.charAt(index+1)) ||\n !isHex(authority.charAt(index+2))) {\n return false;\n }\n index += 2;\n }\n // can check against path characters because the set\n // is the same except for '/' which we've already excluded.\n else if (!isPathCharacter(testChar)) {\n return false;\n }\n ++index;\n }\n return true;\n }", "public void setAuthStat(String authStat)\n\t{\n\t\tthis.authStat = Toolbox.trim(authStat, 1);\n\t}", "public static Boolean checkUsername(String username){\n\t\t//String username = txtUsername.getText();\n\t\t//System.out.println(username);\n\t\treturn (username.equals(\"Admin\"));\n\t}", "public static void main(String[] args) {\n\n int expLast4SSN = 1487;\n int exPinCode = 2729;\n\n int last4SSN = 1459;\n int pinCode = 2726;\n\n if (expLast4SSN == last4SSN && exPinCode == pinCode) {\n System.out.println(\"Authentication successful\");\n } else {\n System.out.println(\"Authentication unsuccessful\");\n if (expLast4SSN != last4SSN) {\n System.out.println(\"Last 4 of SSN did not match\");\n }\n if (exPinCode != pinCode){\n System.out.println(\"Pin code did not match\");\n\n\n\n\n }\n }\n }", "private boolean isTokenBasedAuthentication(String authorizationHeader) {\n return authorizationHeader != null && authorizationHeader.toLowerCase()\n .startsWith(AUTHENTICATION_SCHEME.toLowerCase() + \" \");\n }", "private boolean isTokenBasedAuthentication(String authorizationHeader) {\n return authorizationHeader != null && authorizationHeader.toLowerCase()\n .startsWith(AUTHENTICATION_SCHEME.toLowerCase() + \" \");\n }", "private boolean isTokenBasedAuthentication(String authorizationHeader) {\n return authorizationHeader != null && authorizationHeader.toLowerCase()\n .startsWith(AUTHENTICATION_SCHEME.toLowerCase() + \" \");\n }", "public String getInputAuth()\n\t{\n\t\treturn inputAuth;\n\t}", "private SMTP checkAuth(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tString auth = request.getHeader(\"Authorization\");\n\t\t\n\t\tif (auth == null) {\n\t\t\tsend(response, 401, \"Authorisation Needed\");\n\t\t\treturn null;\n\t\t}\n\t\t\t\t\n\t\tString[] creds = auth.split(\" \");\n\t\tif (!creds[0].equalsIgnoreCase(\"Basic\")) {\n\t\t\tsend(response, 501, \"Only Basic authentication is available - \" + creds[0] + \" is not acceptable\");\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tcreds[1] = new String(Base64.decode(creds[1]));\n\t\t} catch (Base64DecodingException e) {\n\t\t\tsend(response, 400, \"invalid base64 in authorization header\");\n\t\t\treturn null;\n\t\t}\n\n\t\ttry {\n\t\t\tint split = creds[1].indexOf(\":\");\n\t\t\tif (split == -1) {\n\t\t\t\tsend(response, 400, \"malformed authorization header (missing colon)\");\n\t\t\t}\n\t\t\tSMTP a = new SMTP(getSettings(creds[1].substring(0, split),\n\t\t\t\t\t \t\t\t creds[1].substring(split + 1)));\n\t\t\treturn a;\n\t\t} catch (AuthenticationFailedException e) {\n\t\t\tsend(response, 401, \"Authentication Failed\");\n\t\t} catch (MessagingException e ) {\n\t\t\tsend(response, 500, \"Internal Server error\");\n\t\t}\n\t\treturn null;\n\t}", "@Override\r\n\t\t\tpublic boolean test(String t, String u) {\n\t\t\t\t return t.equalsIgnoreCase(u);\r\n\t\t\t}", "private static String checkAddress(String raw) \n\t{\n\t\t// Check to see if the length is greater than the maxLength of user input.\n\t\tif(raw.length() > maxLength) \n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t\treturn raw;\n\t}", "private boolean isPasswordValid(String password) {\n return password.length() > 4 && password.equals(\"123456\");\n }", "boolean isValid(String jwt);", "public static boolean hasUpperAlpha (String password) throws NoUpperAlphaException\r\n {\r\n Pattern pattern = Pattern.compile(\".*[A-Z].*\");\r\n Matcher matcher = pattern.matcher(password);\r\n if (!matcher.matches())\r\n throw new NoUpperAlphaException();\r\n return true;\r\n }", "private boolean m60455c(String str) {\n AccountInterface accountInterface;\n if (str != null && (accountInterface = (AccountInterface) InstanceProvider.m107964b(AccountInterface.class)) != null && !C16990fl.m84428a((CharSequence) str) && accountInterface.isCurrent(str)) {\n return true;\n }\n return false;\n }", "@Test\n public void testPasswordInvalid() {\n String userInput = \"Pa$$w0rd\";\n Owner testUser = ownerHelper.validateUser(\"harry.louis\", userInput);\n assertEquals(testUser, null);\n\n }", "public Boolean authentication(String username, String password) \n\t{\n\t\n\t switch (username) {\n\t case \"FS_UTO_CoE_Sreenivas\":\n\t \t\t\tif (year<=2018)\n\t \t\t\tpassorfail=password.equals(\"q2m!x:dCk6FaG$Ec\");\n\t \t\t\t\tbreak;\n\t// case \"FS_BAN_ANZ_DIGITAL_GANESH\": \n\t//\t\t \t\t\tpassorfail=password.equals(\"q`r^8{De,Sn*!KU_\");\n\t//\t\t \t\t\t\tbreak;\t\t \t\t\t\t\n\t default: \n\t\t\t\t\t\t\tpassorfail = false; \n\t\t\t\t\t\t\tbreak; \t\t \n\t\t}\n\t\treturn passorfail;\n\n\t}", "@Test\r\n\tpublic void testIsValidPasswordNoUpperAlpha()\r\n\t{\r\n\t\ttry{\r\n\t\t\tassertTrue(PasswordCheckerUtility.isValidPassword(\"rainbow\"));\r\n\t\t}\r\n\t\tcatch(NoUpperAlphaException e)\r\n\t\t{\r\n\t\t\tassertTrue(\"Successfully threw a NoUpperAlphaExcepetion\",true);\r\n\t\t}\r\n\t}", "public boolean hasAuth() {\n return ((bitField0_ & 0x00000080) == 0x00000080);\n }", "@Test\n public void atrnTest() {\n assertEquals(\"atrn1\", authResponse.getAtrn());\n }", "private boolean isPasswordValid(String password) {\n return password.length() > 4;\n }", "private boolean isPasswordValid(String password) {\n return password.length() > 4;\n }" ]
[ "0.8023687", "0.7315773", "0.7094304", "0.65884924", "0.6421431", "0.60144335", "0.6010524", "0.5795344", "0.57921684", "0.5776141", "0.5776141", "0.5776141", "0.5734299", "0.57206494", "0.56889296", "0.5683195", "0.56536657", "0.5562226", "0.55159867", "0.5515181", "0.5512329", "0.5503653", "0.5494419", "0.5473598", "0.54708034", "0.5460152", "0.5453451", "0.54374593", "0.54256064", "0.5398445", "0.5394866", "0.5380316", "0.53677666", "0.5366104", "0.5353048", "0.53280497", "0.5286802", "0.5268534", "0.5264731", "0.52375", "0.52283037", "0.52259755", "0.52079093", "0.5203752", "0.51965344", "0.5180038", "0.51771384", "0.51710266", "0.5163103", "0.5160604", "0.51593816", "0.51543343", "0.51536727", "0.51536727", "0.51536727", "0.5138655", "0.51375145", "0.5131156", "0.51255846", "0.5114728", "0.5112299", "0.5110813", "0.5110813", "0.5104611", "0.51042056", "0.5099944", "0.5096485", "0.5094236", "0.5091769", "0.50907856", "0.5089456", "0.5079758", "0.5076242", "0.50727105", "0.50700766", "0.5067228", "0.5065048", "0.5064351", "0.50622106", "0.506154", "0.5047217", "0.50386935", "0.50381535", "0.50381535", "0.50381535", "0.50330406", "0.5031259", "0.5020075", "0.50154513", "0.5011907", "0.49975786", "0.4988551", "0.4986029", "0.4984962", "0.4983966", "0.49811938", "0.49747396", "0.49740085", "0.4973108", "0.4973108" ]
0.8693198
0
Checks the auth control pair
private void checkAuthControl() { val authKey = config.getString("authControlKey"); val authValue = config.getString("authControlValue"); checkArgument(authKey.length() > 2, "auth string (control key) length is less than or equal to 2!"); checkArgument(authValue.length() > 2, "auth string (control value) length is less than or equal to 2!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean authNeeded();", "private void checkAuthAtMain() {\n val auth = config.getString(\"authAtMain\");\n\n checkArgument(auth.length() > 10, \"auth string (at-main) length is less than or equal to 10!\");\n }", "boolean hasAuth();", "@Override\n public boolean check() {\n return GlobalParams.isLogin();\n }", "public CheckAuthCommand() {\n this.authLevel = AUTH_LEVEL_LOGGED_IN;\n }", "public boolean checkAuth() {\n SharedPreferences sharedPreferences = getSharedPreferences(SHARED_PREFS, MODE_PRIVATE);\n return sharedPreferences.getBoolean(AUTH, false);\n }", "@Override\n protected void checkCredential(CredentialChecker checker) {\n checker.check(UserPasswordCredential.class, credential -> {\n return memberBhv.selectCount(cb -> arrangeLoginByCredential(cb, credential)) > 0;\n });\n }", "private void checkAuthXMain() {\n val auth = config.getString(\"authXMain\");\n\n checkArgument(auth.length() > 10, \"auth string (x-main) length is less than or equal to 10!\");\n }", "boolean hasAuthKey();", "private void checkRep(){\n assert !this.username.equals(\"\");\n assert !this.password.equals(\"\");\n assert accessLevel != null;\n }", "abstract public boolean checkAuth(String userId) throws IOException;", "private void checkAuthorization(RoutingContext context, List<CaptureMap> resolvedCaptureCollections,\n Handler<AsyncResult<Boolean>> handler) {\n AuthHandler auth = context.get(AuthenticationController.AUTH_HANDLER_PROP);\n if (auth != null && auth instanceof RedirectAuthHandlerBt) {\n MemberUtil.getCurrentUser(context, getNetRelay(), result -> {\n if (result.failed()) {\n handler.handle(Future.failedFuture(result.cause()));\n } else {\n IAuthenticatable member = result.result();\n if (member == null) {\n // this is an error\n handler.handle(Future.failedFuture(\n new IllegalArgumentException(\"This should not happen, we need an instance of IAuthenticatable here\")));\n } else {\n checkAuthorization(resolvedCaptureCollections, auth, member, handler);\n }\n }\n });\n } else {\n handler.handle(Future.succeededFuture(true));\n }\n }", "public boolean hasAuth() {\n return ((bitField0_ & 0x00000080) == 0x00000080);\n }", "private void checkAuthUbidMain() {\n val auth = config.getString(\"authUbidMain\");\n\n checkArgument(auth.length() > 10, \"auth string (ubid-main) length is less than or equal to 10!\");\n }", "public boolean isAuthRequired() {\n\t\treturn false;\n\t}", "public boolean isAuthRequired() {\n return !AfUtil.anyEmpty(_username);\n }", "protected void validateToken() {\n\n authToken = preferences.getString(getString(R.string.auth_token), \"\");\n saplynService = new SaplynService(preferences.getInt(debugLvl, -1), authToken);\n\n // Check if user already authenticated\n if (authToken.equals(\"\")) {\n Intent intent = new Intent(HomeActivity.this, AuthenticationActivity.class);\n startActivityForResult(intent, 0);\n }\n else {\n populateUser();\n }\n }", "public boolean hasAuth() {\n return ((bitField0_ & 0x00000040) == 0x00000040);\n }", "private boolean verifyCredentials() {\n\n boolean bCredentialsValid = false;\n strUserMailID = strUserName = \"\";\n\n // Get the account information, if existing\n DatabaseHandler dbHandler = new DatabaseHandler(getApplicationContext());\n AccountInformation accInfo = dbHandler.getAccountInfo(m_tfUserEmailID.getText().toString());\n\n if(accInfo != null) {\n\n // Compute the hash for the user entered password\n OperationsHelper helper = new OperationsHelper();\n String strHashPwd = helper.getHashedPassword(m_tfUserPassword.getText().toString(), accInfo.getSaltValue());\n if(strHashPwd.equals(accInfo.getPassword())) {\n\n bCredentialsValid = true;\n strUserMailID = accInfo.getEmail();\n strUserName = accInfo.getName();\n\n // If Always login option is checked, update the value in the database\n if( ! (m_cbAutoLogon.isChecked() == accInfo.getIfAlwaysSignIn()) ) {\n\n accInfo.setAlwaysSignIn(m_cbAutoLogon.isChecked());\n dbHandler.updateAlwaysSignOnOption(accInfo);\n }\n } else {\n Toast.makeText(getApplicationContext(), \"Incorrect Password\", Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(getApplicationContext(), \"No such account exists. \\n\" +\n \" Create one to login\", Toast.LENGTH_LONG).show();\n }\n\n return bCredentialsValid;\n }", "boolean hasLoginapiavgrtt();", "public boolean ValidCredentials() { \n\t\tif(!isEmptyFieldData()){\n\t\t\tSystemUserQuery sq = new SystemUserQuery();\n\t\t\tUser user = sq.loginQuery(getUsername(), getPassword());\n\t\t\t\n\t\t\tif(user != null){\n\t\t\t\tMain.setCurrentUser(user);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}", "private void verifyAuthWithServer() {\n mResetModel.connect(\n myBinding.editResetEmail.getText().toString());\n //This is an Asynchronous call. No statements after should rely on the\n //result of connect().\n }", "private boolean isValidAuthentication(String authHeader) {\n return !StringUtils.isEmpty(authHeader);\n }", "Boolean checkCredentials(ClientCredentialsData clientData) throws AuthenticationException;", "@Test\n public void testCheckAuth() throws Exception {\n SettingsManager manager = new SettingsManager();\n //manager.username = \"testUsername\";\n //manager.password = \"testPassword\";\n Assert.assertTrue(\"Correct credentials should return true\", manager.checkAuth(\"testUsername\", \"testPassword\"));\n Assert.assertFalse(\"Bad username should return false\", manager.checkAuth(\"badUsername\", \"testPassword\"));\n Assert.assertFalse(\"Bad password should return false\", manager.checkAuth(\"testUsername\", \"wrongPassword\"));\n }", "public void checkAuthority() {\n }", "private void verifyAuthWithServer() {\n mRegisterModel.connect(binding.personFirstName.getText().toString(),\n binding.personLastName.getText().toString(),\n binding.registerEmail.getText().toString(),\n binding.registerPassword.getText().toString());\n //this is an Asynchronous call no statements after should rely on the result of connect\n }", "private int checkAuthentication( SecureDirectory secureDirectory ) throws ServerException {\r\n\r\n\t\tif ( secureDirectory == null )\r\n\t\t\treturn NOT_SECURE_DIR;\r\n\r\n\t\tif ( !request.getHeaderFields().containsKey( HeaderFields.AUTHORIZATION ) )\r\n\t\t\treturn NEED_AUTHENTICATE;\r\n\r\n\t\tString auth = request.getHeaderFields().get( HeaderFields.AUTHORIZATION );\r\n\t\tString[] tokens = auth.split( \" \", 2 );\r\n\t\tif ( authenticate( secureDirectory, tokens[0], tokens[1] ) )\r\n\t\t\treturn AUTHENTICATED;\r\n\r\n\t\t// Password or username not correct\r\n\t\tthrow new ServerException( ResponseTable.FORBIDDEN );\r\n\t}", "boolean isAuthenticated();", "private void checkAuthSessionToken() {\n val auth = config.getString(\"authSessionToken\");\n\n checkArgument(auth.length() > 10, \"auth string (sessionToken) length is less than or equal to 10!\");\n }", "boolean hasAuthAccountFlags();", "public boolean auth() throws IOException {\r\n \treturn auth(false);\r\n }", "protected void doAuthCheck(CommandContext commandContext) {\n for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {\n if (processDefinitionIdIn == null && processDefinitionKeyIn == null) {\n checker.checkReadHistoryAnyProcessDefinition();\n } else {\n List<String> processDefinitionKeys = new ArrayList<String>();\n if (processDefinitionKeyIn != null) {\n processDefinitionKeys.addAll(Arrays.asList(processDefinitionKeyIn));\n }\n\n if (processDefinitionIdIn != null) {\n for (String processDefinitionId : processDefinitionIdIn) {\n ProcessDefinition processDefinition = commandContext.getProcessDefinitionManager()\n .findLatestProcessDefinitionById(processDefinitionId);\n\n if (processDefinition != null && processDefinition.getKey() != null) {\n processDefinitionKeys.add(processDefinition.getKey());\n }\n }\n }\n\n if (!processDefinitionKeys.isEmpty()) {\n for (String processDefinitionKey : processDefinitionKeys) {\n checker.checkReadHistoryProcessDefinition(processDefinitionKey);\n }\n }\n }\n }\n }", "public abstract boolean checkCredentials (String username, String password);", "private void checkAuthSessionId() {\n val auth = config.getString(\"authSessionId\");\n\n checkArgument(auth.length() > 10, \"auth string (sessionId) length is less than or equal to 10!\");\n }", "private void checkAction(HttpServletRequest req, HttpServletResponse resp) throws SQLException, IOException {\n\t\tString account = req.getParameter(\"account\");\r\n\t\tString password = req.getParameter(\"password\");\r\n\t\tManage manage = this.service.checkLogin(account, password);\r\n\r\n\t\t// 如果User不是空,证明账号密码正确\r\n\t\tif (manage != null) {\r\n\t\t\tsession.setAttribute(\"MANAGEINSESSION\", manage);\r\n//\t\t\tresp.sendRedirect(path + \"/jsps/manage/index.jsp\");\r\n\t\t\tpw.print(true);\r\n\t\t} else {\r\n\t\t\tpw.print(false);\r\n//\t\t\tresp.sendRedirect(path + \"/jsps/manage/login.jsp\");\r\n\t\t}\r\n\t\treturn;\r\n\t}", "private boolean validarEInyectarAutorizacion(final HttpServletRequest request) {\n\t\tboolean autorizado = false;\n\t\tString header = request.getHeader(AUTH_HEADER);\n\t\tfor (Peticion peticion : SIN_AUTH) {\n\t\t\tif (peticion.match(request)) {\n\t\t\t\tautorizado = true;\n\t\t\t\tlog.info(\"Método: \"+peticion.metodo+\" url: \"+peticion.url);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!autorizado) {\n\t\t\t// Todos los demas servicios requieren que se envie la cadena Bearer\n\t\t\t// <token>\n//\t\t\tif (StringUtils.isNotBlank(header)) {\n\t\t\t\tif (verificarCredenciales(request)){\n\t\t\t\t\tautorizado = true;\n\t\t\t\t}\n//\t\t\t\tString[] tmpTokens = header.split(AUTH_BEARER);\n//\t\t\t\tif (tmpTokens.length == 2) {\n//\t\t\t\t\tString token = tmpTokens[1];\n//\t\t\t\t\tOptional<Identificacion> ident = validarToken(StringUtils.trimToEmpty(token));\n//\t\t\t\t\tif (ident.isPresent()) {\n//\t\t\t\t\t\trequestScope.setIdentificacion(ident.get());\n//\t\t\t\t\t\trequest.setAttribute(AUTH_KEY, ident.get());\n//\t\t\t\t\t}\n//\t\t\t\t\tautorizado = ident.isPresent();\n//\t\t\t\t}\n//\t\t\t}\n\t\t}\n\t\trequestScope.setIp(request.getRemoteAddr());\n\t\treturn autorizado;\n\t}", "@Before(unless = { \"signin\", \"doLogin\" })\n\tprivate static void checkAuthentification() {\n\t\t// get ID from secure social plugin\n\t\tString uid = session.get(PLAYUSER_ID);\n\t\tif (uid == null) {\n\t\t\tsignin(null);\n\t\t}\n\n\t\t// get the user from the store. TODO Can also get it from the cache...\n\t\tUser user = null;\n\t\tif (Cache.get(uid) == null) {\n\t\t\ttry {\n\t\t\t\tuser = UserClient.getUserFromID(uid);\n\t\t\t\tCache.set(uid, user);\n\t\t\t} catch (ApplicationException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tflash.error(\"Problem while getting user from store...\");\n\t\t\t}\n\t\t} else {\n\t\t\tuser = (User) Cache.get(uid);\n\t\t}\n\n\t\tif (user == null) {\n\t\t\tflash.error(\"Problem while getting user from store...\");\n\t\t\tAuthentifier.logout();\n\t\t}\n\n\t\tif (user.avatarURL == null) {\n\t\t\tuser.avatarURL = Gravatar.get(user.email, 100);\n\t\t}\n\n\t\t// push the user object in the request arguments for later display...\n\t\trenderArgs.put(PLAYUSER, user);\n\t}", "public boolean onSecurityCheck() {\n boolean continueProcessing = super.onSecurityCheck();\n if (!continueProcessing) {\n return false;\n }\n AuthorizationManager authzMan = getAuthorizationManager();\n try {\n if (!authzMan.canManageApplication(user)) {\n setRedirect(\"authorization-denied.htm\");\n return false;\n }\n return true;\n } catch (AuthorizationSystemException ex) {\n throw new RuntimeException(ex);\n }\n }", "public abstract boolean validateAuthToken(String username , String authToken);", "private boolean authenticate (HttpRequest request, HttpResponse response) throws UnsupportedEncodingException\n\t{\n\t\tString[] requestSplit=request.getPath().split(\"/\",3);\n\t\tif(requestSplit.length<2)\n\t\t\treturn false;\n\t\tString serviceName=requestSplit[1];\n\t\tfinal int BASIC_PREFIX_LENGTH=\"BASIC \".length();\n\t\tString userPass=\"\";\n\t\tString username=\"\";\n\t\tString password=\"\";\n\t\t\n\t\t//Check for authentication information in header\n\t\tif(request.hasHeaderField(AUTHENTICATION_FIELD)\n\t\t\t\t&&(request.getHeaderField(AUTHENTICATION_FIELD).length()>BASIC_PREFIX_LENGTH))\n\t\t{\n\t\t\tuserPass=request.getHeaderField(AUTHENTICATION_FIELD).substring(BASIC_PREFIX_LENGTH);\n\t\t\tuserPass=new String(Base64.decode(userPass), \"UTF-8\");\n\t\t\tint separatorPos=userPass.indexOf(':');\n\t\t\t//get username and password\n\t\t\tusername=userPass.substring(0,separatorPos);\n\t\t\tpassword=userPass.substring(separatorPos+1);\n\t\t\t\n\t\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\t\n\t\t\t\tlong userId;\n\t\t\t\tAgent userAgent;\n\t\t\t\t\n\t\t\t\tif ( username.matches (\"-?[0-9].*\") ) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tuserId = Long.valueOf(username);\n\t\t\t\t\t} catch ( NumberFormatException e ) {\n\t\t\t\t\t\tthrow new L2pSecurityException (\"The given user does not contain a valid agent id!\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tuserId = l2pNode.getAgentIdForLogin(username);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tuserAgent = l2pNode.getAgent(userId);\n\t\t\t\t\n\t\t\t\tif ( ! (userAgent instanceof PassphraseAgent ))\n\t\t\t\t\tthrow new L2pSecurityException (\"Agent is not passphrase protected!\");\n\t\t\t\t((PassphraseAgent)userAgent).unlockPrivateKey(password);\n\t\t\t\t_currentUserId=userId;\n\t\t\t\t\n\t\t\t\tif(!_userSessions.containsKey(userId))//if user not registered\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\tMediator mediator = l2pNode.getOrRegisterLocalMediator(userAgent);\n\t\t\t\t\t_userSessions.put(userId, new UserSession(mediator));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t_userSessions.get(userId).updateServiceTime(serviceName,new Date().getTime());//update last access time for service\n\t\t\t\t\n\t\t\t\tconnector.logMessage(\"Login: \"+username);\n\t\t\t\tconnector.logMessage(\"Sessions: \"+Integer.toString(_userSessions.size()));\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t}catch (AgentNotKnownException e) {\n\t\t\t\tsendUnauthorizedResponse(response, null, request.getRemoteAddress() + \": login denied for user \" + username);\n\t\t\t} catch (L2pSecurityException e) {\n\t\t\t\tsendUnauthorizedResponse( response, null, request.getRemoteAddress() + \": unauth access - prob. login problems\");\n\t\t\t} catch (Exception e) {\n\t\t\t\t\n\t\t\t\tsendInternalErrorResponse(\n\t\t\t\t\t\tresponse, \n\t\t\t\t\t\t\"The server was unable to process your request because of an internal exception!\", \n\t\t\t\t\t\t\"Exception in processing create session request: \" + e);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tresponse.setStatus ( HttpResponse.STATUS_BAD_REQUEST );\n\t\t\tresponse.setContentType( \"text/plain\" );\n\t\t\tresponse.print ( \"No authentication provided!\" );\n\t\t\tconnector.logError( \"No authentication provided!\" );\n\t\t}\n\t\treturn false;\n\t}", "public boolean hasCredentials(){\r\n return state;\r\n }", "private void checkIfUserIsAuthenticated() {\n splashViewModel.checkIfUserIsAuthenticated();\n splashViewModel.getIsUserAuthenticated().observe(this, user -> {\n if (!user.isAuthenticated()) {\n startAuthActivity();\n finish();\n } else {\n getUserFromDatabase(user.getUid());\n }\n });\n }", "@Override\n\tpublic boolean checkAuthorization(HttpServletRequest request) {\n\t\treturn true;\n\t}", "protected boolean authenticate() {\n \tif (mConfig == null) {\n \t\tmConfig = getConfig();\n \t}\n \tString keys[] = getKeys();\n \tif (keys != null) {\n\t mConfig = api.authenticateToken(keys[0], keys[1], mConfig);\n\t if (mConfig != null) {\n\t return true;\n\t }\n \t}\n \tshowToast(\"Failed user authentication for stored login tokens.\");\n \tclearKeys();\n \tsetLoggedIn(false);\n \treturn false;\n }", "public boolean is_allowed()\r\n\t{\r\n\t\tboolean allowed;\r\n\t\t\r\n\t\t// Compare hashes to see if they match\r\n\t\tif (hash.equals(query_hash))\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Match successful!\");\r\n\t\t\tallowed = true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Invalid credentials...\");\r\n\t\t\tallowed = false;\r\n\t\t}\r\n\t\t\r\n\t\t//if (fail_count >= 3)\r\n\t\t\t//allowed = false;\r\n\t\t\r\n\t\treturn allowed;\r\n\t}", "@SuppressWarnings(\"unchecked\")\n\tprivate synchronized boolean auth(Connection con, JsonObject receivedMSG) throws NullPointerException {\n\t\tJSONObject auth = new JSONObject();\n\t\tString command;\n\t\tString info;\n\n\t\t// If already authenticated then reply with invalid message\n\t\tif (broadConnections.contains(con)) {\n\t\t\tInvalidMessage response = new InvalidMessage();\n\t\t\tresponse.setInfo(\"Already authenticated in this server\");\n\t\t\tcon.writeMsg(response.toJsonString());\n\t\t\treturn true;\n\t\t}\n\t\t// Check if provided secret matches the setting\n\t\tString secret = receivedMSG.get(\"secret\").getAsString();\n\t\tif (!secret.equals(Settings.getSecret())) {\n\t\t\tcommand = AUTHENTICATION_FAIL;\n\t\t\t// String authFailMSG = toJsonString();\n\t\t\tinfo = \"the supplied secret is incorrect: \" + secret;\n\t\t\tauth.put(\"command\", command);\n\t\t\tauth.put(\"info\", info);\n\t\t\tcon.writeMsg(auth.toJSONString());\n\t\t\treturn false;\n\t\t}\n\t\tbroadConnections.add(con);\n\t\treturn true;\n\t}", "public boolean isAuthenticationRequired() {\n\t\treturn true;\n\t}", "boolean hasLoginResponse();", "boolean hasLoginRequest();", "public static boolean isAuth(String auths){\n\t\treturn AccUtils.manipulate(auths, ManOp.EMPTY_TO_NULL) != null;\n\t}", "@Override\r\n\tpublic boolean checkLogin() {\n\t\treturn false;\r\n\t}", "@Override\r\n\tpublic boolean checkLogin() {\n\t\treturn false;\r\n\t}", "void checkConnection() {\n\n //Call method which checks for connection.\n boolean isNetworkConnected = isNetworkConnected();\n\n //If there is a data connection currently available for use, attempt to authenticate login details with Firebase,\n // allow user to login offline but without a profile and access only to local storage.\n if(isNetworkConnected) {\n\n //If there is an active data connection, set authenticated value to true\n authenticated = true;\n }\n\n else {\n\n //If there is an active data connection, set authenticated value to false\n authenticated = false;\n }\n }", "boolean isSecretValid();", "public static String getCheckAuthentication() {\n\n\t\treturn baseURL + login_required_string + \"/rest/is-authenticated\";\n\t}", "public boolean checkLoginCredential(GuruModel model) {\n\t\tquery = \"select id from guru where email=? and pwd=?\";\n\t\tList<GuruModel> list = this.jdbcTemplate.query(query,new Object[]{model.getEmail(),this.edutility.getSHA256(model.getPwd())},\n\t\t\t\tBeanPropertyRowMapper.newInstance(GuruModel.class));\n\t\t\n\t\tif(list.size() == 0)\n\t\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "private Boolean authorize() {\n\n return Session.getInstance().login(user.getText(), password.getText());\n }", "public void TC_04_Authentication_Alert() {\n\n\t\tdriver.get(\"http://admin:[email protected]/basic_auth\");\n\t}", "private SMTP checkAuth(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tString auth = request.getHeader(\"Authorization\");\n\t\t\n\t\tif (auth == null) {\n\t\t\tsend(response, 401, \"Authorisation Needed\");\n\t\t\treturn null;\n\t\t}\n\t\t\t\t\n\t\tString[] creds = auth.split(\" \");\n\t\tif (!creds[0].equalsIgnoreCase(\"Basic\")) {\n\t\t\tsend(response, 501, \"Only Basic authentication is available - \" + creds[0] + \" is not acceptable\");\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tcreds[1] = new String(Base64.decode(creds[1]));\n\t\t} catch (Base64DecodingException e) {\n\t\t\tsend(response, 400, \"invalid base64 in authorization header\");\n\t\t\treturn null;\n\t\t}\n\n\t\ttry {\n\t\t\tint split = creds[1].indexOf(\":\");\n\t\t\tif (split == -1) {\n\t\t\t\tsend(response, 400, \"malformed authorization header (missing colon)\");\n\t\t\t}\n\t\t\tSMTP a = new SMTP(getSettings(creds[1].substring(0, split),\n\t\t\t\t\t \t\t\t creds[1].substring(split + 1)));\n\t\t\treturn a;\n\t\t} catch (AuthenticationFailedException e) {\n\t\t\tsend(response, 401, \"Authentication Failed\");\n\t\t} catch (MessagingException e ) {\n\t\t\tsend(response, 500, \"Internal Server error\");\n\t\t}\n\t\treturn null;\n\t}", "public boolean verifyFields()\n\t{\n\t\t// check name first\n\t\tif (!validateUserName(username.getText()))\n\t\t\treturn false;\n\n\t\t// check address if name is valid\n\t\tif (!validateIP(address.getText()))\n\t\t{\n\t\t\tsetWarning(\"invalid address\");\n\t\t\treturn false;\n\t\t}\n\n\t\t// only check port if name and address are okay\n\t\ttry\n\t\t{\n\t\t\tInteger.parseInt(port.getText());\n\t\t}\n\t\tcatch (NumberFormatException e)\n\t\t{\n\t\t\tsetWarning(\"invalid port number\");\n\t\t\treturn false;\n\t\t}\n\n\t\tstatus.setTextFill(GREEN);\n\t\tstatus.setText(\"attempting connection\");\n\n\t\treturn true;\n\t}", "public boolean checkOptrAuth (java.lang.String in_optr_cde, \n java.lang.String in_func_cde) throws com.mcip.orb.CoException {\n return this._delegate.checkOptrAuth(in_optr_cde, in_func_cde);\n }", "@Override\n\tpublic boolean check() {\n\t\tSystem.out.println(\"\\n---------登陆---------\");\n\t\tSystem.out.println(\"请输入ID\");\n\t\tString ID_C=console.next();\n\t\tSystem.out.println(\"请输入密码\");\n\t\tString code_c=console.next();\n\t\t if (!Tool.confirm(ID_C, \"log\")) {\n\t System.out.println(\"[此ID不存在] 重新输入#返回\");\n\t if((ID = Tool.back()) == null)\n\t return false;\n\t }\n\t\t Statement sta;\n\t ResultSet rs;\n\t try {\n\t sta = conn.createStatement();\n\t rs = sta.executeQuery(\"SELECT code FROM log WHERE ID=\"+ID_C);\n\t rs.next();\n\t if (rs.getString(1).equals(code_c))\n\t return true;\n\t \n\t } catch (SQLException e) {\n\t e.printStackTrace();\n\t }\n\t\treturn false;\n\t}", "boolean authQop() {\n/* 114 */ return this.serverQop;\n/* */ }", "public void verify() {\n lblTheDatabaseNameIsEmpty();\n lblDatabaseName();\n lblUserName();\n lblPassword();\n lblDatabaseLocation();\n txtPassword();\n txtUserName();\n txtDatabaseLocation();\n btSettings();\n txtDatabaseName();\n btCancel();\n btOK();\n }", "private void authenticate( String loging, String sysLoging,String password,String sys_password) throws Exception {\n \n if(!loging.equals(sysLoging) || !(sys_password.equals(password) )){\n Exception e = new Exception();\n throw e;\n }\n\n }", "private void checkAppKeySetup() {\n if (APP_KEY.startsWith(\"CHANGE\") ||\n APP_SECRET.startsWith(\"CHANGE\")) {\n showToast(\"You must apply for an app key and secret from developers.dropbox.com, and add them to the DBRoulette ap before trying it.\");\n finish();\n return;\n }\n\n // Check if the app has set up its manifest properly.\n Intent testIntent = new Intent(Intent.ACTION_VIEW);\n String scheme = \"db-\" + APP_KEY;\n String uri = scheme + \"://\" + AuthActivity.AUTH_VERSION + \"/test\";\n testIntent.setData(Uri.parse(uri));\n PackageManager pm = getPackageManager();\n if (0 == pm.queryIntentActivities(testIntent, 0).size()) {\n showToast(\"URL scheme in your app's \" +\n \"manifest is not set up correctly. You should have a \" +\n \"com.dropbox.client2.android.AuthActivity with the \" +\n \"scheme: \" + scheme);\n finish();\n }\n }", "public boolean authenticatorRequest(String authURL){\r\n\t\t\r\n\t\tboolean authOK = false;\r\n\t\t\r\n\t\ttry {\r\n\t\t\t logger.finest(authURL);\r\n\t\t\t HttpURLConnection httpConnection = null;\r\n\t if(this.proxyHost.equalsIgnoreCase(\"\") || this.proxyPort.equalsIgnoreCase(\"\")){\r\n\t \t URL restServiceURL = new URL(authURL);\r\n\t \t httpConnection = (HttpURLConnection) restServiceURL.openConnection();\r\n\t } else{\r\n\t \t httpConnection = proxySetup(authURL);\r\n\t }\r\n\t httpConnection.setRequestMethod(\"GET\");\r\n\t \r\n\t if (httpConnection.getResponseCode() != 200) {\r\n\t \t logger.severe(\"Error:\tAuthenticattion failure: \" + httpConnection.getResponseCode());\r\n\t throw new RuntimeException(\"Error:\tAuthenticattion failure: \" + httpConnection.getResponseCode());\r\n\t }\r\n\t else{\r\n\t \t \tauthOK = true;\r\n\t \t \tString header = httpConnection.getHeaderFields().toString();\r\n\t \t \tthis.setjSessionId(header); \r\n\t \r\n\t \t \tString serverCookies = httpConnection.getHeaderField(\"Set-Cookie\");\r\n\t \t \tthis.setAuthHash(serverCookies);\r\n\t }\r\n\t \r\n\t logger.finest(\"Authentication successful: \" + httpConnection.getResponseCode() + \" - OK\");\t \t \t \t \t \r\n\t httpConnection.disconnect();\r\n\t\t} \r\n\t\tcatch (MalformedURLException e1) {\r\n\t e1.printStackTrace();\r\n\t logger.severe(\"Error: connection \" + e1.getMessage());\r\n\t } \r\n\t\tcatch(ConnectException e3){\r\n\t\t\tlogger.severe(\"Error:\tConnection Time out. Please relaunch the console app.\" + e3.getMessage());\r\n\t\t}\r\n\t\tcatch(UnknownHostException e){\r\n\t\t\tlogger.severe(\"Error:\tUnknown host. Please relaunch the console app.\" + e.getMessage());\r\n\t\t}\r\n\t\tcatch (IOException e2) {\r\n\t\t\tlogger.severe(\"Error:\t\" + e2.getMessage() + \"\\n was occured. Please contact the administrator.\");\r\n\t }\t\t\r\n\t\treturn authOK;\r\n\t}", "@Override\n public void check() {\n if(StringUtils.isBlank(username)||StringUtils.isBlank(password)){\n logger.error(\"登陆失败!\");\n throw new InyuException(ExceptionEnum.INVALID_PARAM.getIndex(),\"用户名或密码为空!\");\n }\n }", "public int check_both()\r\n {\r\n if(((check_passwrd.compareTo(conf_password))==0) && (Email_id.compareTo(Email))==0 && check_email()==0)\r\n {\r\n return 0;\r\n }\r\n else\r\n {\r\n return 1;\r\n }\r\n }", "public boolean loginCheck() {\n\t\tif(allParametersGiven==true) {\n\t\t\treturn dtb.checkLoginDetais(username,password);\n\t\t}\n\t\treturn false;\n\t}", "private void doVerify(HttpServletRequest request, Object handler) throws AuthenticationException {\n\t\tString authorizationHeader = request.getHeader(HttpHeaders.AUTHORIZATION);\r\n\t\tlog.debug(\"#### authorizationHeader : \" + authorizationHeader);\r\n\r\n\t\t// Check if the HTTP Authorization header is present and formatted correctly\r\n\t\tif (authorizationHeader == null || authorizationHeader.isEmpty()) {\r\n\t\t\tlog.error(\"#### invalid authorizationHeader : \" + authorizationHeader);\r\n\t\t\tthrow new AuthenticationException(\"Authorization header must be provided\");\r\n\t\t}\r\n\r\n\t\t// Extract the token from the HTTP Authorization header\r\n\t\tString token = authorizationHeader.trim();\r\n\r\n\t\ttry {\r\n\r\n\t\t\t// Validate the token\r\n\t\t\tKey key = keyGenerator.generateKey();\r\n\t\t\tClaims claims = Jwts.parser().setSigningKey(key).parseClaimsJws(token).getBody();\r\n\t\t\tlog.debug(\"ID: \" + claims.getId());\r\n\t\t log.debug(\"Subject: \" + claims.getSubject());\r\n\t\t log.debug(\"Issuer: \" + claims.getIssuer());\r\n\t\t log.debug(\"Expiration: \" + claims.getExpiration());\r\n\t\t\tlog.debug(\"#### valid token : \" + token);\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\tlog.error(\"#### invalid token : \" + token);\r\n\t\t\tthrow new AuthenticationException(\"Unauthorized\");\r\n\t\t}\r\n\r\n\t}", "@Test\n\tpublic void authenticateTest() {\n\t\t\n\t\tassertEquals(true, true);\n\n\t}", "private void checkAccessAndLoggIn() {\n // Make sure we have access\n ConnectionChecker connectionHelper = new ConnectionChecker(this);\n boolean haveAccess = connectionHelper.canConnectInternet();\n if (haveAccess) {\n // Check if user is logged in\n final ParseUser user = ParseUser.getCurrentUser();\n boolean isLoggedIn = (user != null);\n Log.d(TAG, \"User logged in = \" + isLoggedIn);\n checkLogIn(isLoggedIn);\n } else {\n // Alert user we need access to internet\n Toast.makeText(this, \"We are unable to access Good Feed. Please check your connection\", Toast.LENGTH_LONG).show();\n }\n }", "private void authorize() {\r\n\r\n\t}", "private void _verifyAuthCode(Device device,String authCode){\r\n \t\tdevice.setModified(0); // reset modified to get current time.\r\n \t\tif (device.getStatus() != DeviceStatus.Authing.getStatus()) {\r\n \t\t\tthrow new RentException(RentErrorCode.ErrorStatusViolate,\r\n \t\t\t\t\t\"device auth status not match current status is \"+device.getStatus());\r\n \t\t}\r\n \t\t//\r\n \t\t// if device modified + timeout > current time then throw timeout exception.\r\n \t\t// check verify timeout\r\n \t\t//\r\n \t\tMap<String,Object> setting = applicationConfig.get(\"general\");\r\n \tlong time=java.util.Calendar.getInstance().getTimeInMillis()/1000;\r\n \t\tint timeout = (Integer)setting.get(\"auth_verify_timeout\");\r\n \tif (time > device.getModified() + timeout ) {\t\r\n \t\t\tthrow new RentException(RentErrorCode.ErrorAuthExpired,\r\n \t\t\t\t\t\"verify mobile auth code has been timeout\");\r\n \t}\r\n \t\r\n \t\t//\r\n \t\t// check retry count\r\n \t\t//\r\n \t\tint retryLimit = (Integer)setting.get(\"auth_retry_limit\");\r\n \t\tif(logger.isDebugEnabled()) {\r\n \t\t\tlogger.debug(\"retry limit is \"+retryLimit+\" current auth retry is \"+device.getAuthRetry());\r\n \t\t}\r\n \t\tif (device.getAuthRetry() > retryLimit) {\r\n \t\t\tthrow new RentException(RentErrorCode.ErrorExceedLimit,\r\n \t\t\t\t\t\"mobile verify auth retry too many time try:\"\r\n \t\t\t\t\t\t\t+ device.getAuthRetry() + \" > \" + retryLimit);\r\n \t\t}\r\n \r\n \t\t//\r\n \t\t// check auth code\r\n \t\t//\r\n \t\tString token = device.getToken();\r\n \t\tif (!authCode.equals(this.encodeUtility.decrypt(token, Device.ENCRYPT_KEY))) {\r\n \t\t\t//\r\n \t\t\t// if fail update retry status\r\n \t\t\t//\r\n \t\t\tlogger.debug(\"token not match, token is \"+token);\r\n \t\t\tint ret =deviceDao.updateStatusAndRetryCount(device.getId(), device.getUserId(),\r\n \t\t\t\t\tDeviceStatus.Authing.getStatus(),\r\n \t\t\t\t\tDeviceStatus.Init.getStatus(), device.getModified());\r\n \t\t\tif (ret != 1) {\r\n \t\t\t\tthrow new RentException(RentErrorCode.ErrorStatusViolate,\r\n \t\t\t\t\t\t\"update device status count is not 1\");\r\n \t\t\t}\r\n \t\t\tthrow new RentException(RentErrorCode.ErrorAuthFail,\r\n \t\t\t\t\t\"device id \"+device.getId()+\" enter auth code not match\");\r\n \r\n \t\t}\r\n \t\t\r\n \t\t//\r\n \t\t// update device and user in database.\r\n \t\t//\r\n \t\tlogger.debug(\"update device status to authed\");\r\n \t\tdeviceDao.updateStatusAndRetryCount(device.getId(),device.getUserId(),\r\n \t\t\t\tDeviceStatus.Authed.getStatus(),\r\n \t\t\t\tDeviceStatus.Authing.getStatus(),\r\n \t\t\t\tdevice.getModified());\r\n \t\tUser user = device.getUser();\r\n \t\tif (user.getStatus() == UserStatus.Init.getStatus()){\r\n \t\t\tlogger.debug(\"update user status to authed\");\r\n \t\t\tuser.setModified((long)0);\r\n \t\t\tuserDao.updateUserStatus(user.getId(), UserStatus.Authed.getStatus()\r\n \t\t\t\t\t, UserStatus.Init.getStatus(), user.getModified());\r\n \t\t}\r\n \t\t\r\n \t}", "boolean hasLogin();", "boolean hasLogin();", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n // Either way, check log in again\n checkAccessAndLoggIn();\n }", "private void verifyUser(){\n getValues();\n boolean validate;\n\n validate = db.authenticateUser(username, password);\n\n if (validate) {\n\n Cursor cursor = db.fetchData(username,password);\n cursor.moveToFirst();\n\n String contact = cursor.getString(3);\n\n session.createLoginSession(username, password, contact);\n\n Toast.makeText(this, \"[SYSTEM]: Login Successful! \", Toast.LENGTH_SHORT).show();\n\n Intent i = new Intent(this, MainActivity.class);\n startActivity(i);\n finish();\n } else {\n Toast.makeText(this, \"FAIL!\", Toast.LENGTH_SHORT).show();\n }\n }", "final public boolean requiresAuthentication()\r\n {\r\n return requires_AUT;\r\n }", "private void checkPreferences() {\n String email = pref.get(EMAIL, EMPTY);\n String hashedPassword = pref.get(PASSWORD, EMPTY);\n if(!email.equals(EMPTY) && !hashedPassword.equals(EMPTY)){\n rememberMe.setSelected(true);\n emailField.setText(email);\n String passTemp = getStringWithPasswordLength();\n passwordField.setText(passTemp);\n }\n }", "public boolean authenticateUser() {\r\n try {\r\n \r\n firstServerMessage();\r\n sendKeys();\r\n sessionKeyMsg();\r\n \r\n \r\n \r\n \treturn true;\r\n }\r\n \r\n catch(Exception ioe){\r\n System.out.println(\"Terminating session with Acct#: \" + currAcct.getNumber());\r\n //ioe.printStackTrace();\r\n return false;\r\n }\r\n \r\n }", "@Override\n public void handle(\n AuthzTrans trans,\n HttpServletRequest req,\n HttpServletResponse resp) throws Exception {\n Result<Date> r = context.doesCredentialMatch(trans, req, resp);\n if (r.isOK()) {\n resp.setStatus(HttpStatus.OK_200);\n } else {\n // For Security, we don't give any info out on why failed, other than forbidden\n // Can't do \"401\", because that is on the call itself\n // 403 Implies you MAY NOT Ask.\n resp.setStatus(HttpStatus.NOT_ACCEPTABLE_406);\n }\n }", "public boolean hasAccountAuthId() {\n return fieldSetFlags()[3];\n }", "protected boolean mustTunnel (RequestHandler rh) {\n\tString auth = request.getHeader (\"Authorization\");\n\tif (auth != null) {\n\t if (auth.startsWith (\"NTLM\") || auth.startsWith (\"Negotiate\"))\n\t\treturn true;\n\t}\n\treturn false;\n }", "@Test\n public void existingUserOK_PW() {\n boolean result = auth.authenticateUser(\"Ole\", \"secret\", 0); \n //Then\n assertThat(result, is(true));\n }", "@Test\n public void authorisedTest() {\n assertTrue(authResponse.isAuthorised());\n }", "boolean isInputValid(){\n\t\tString ac = edAccount.getText().toString();\n\t\tString pwd = edPassword.getText().toString();\n\t\tboolean isAccEmpty = StringUtil.isNullOrEmpty(ac);\n\t\tboolean isPwdEmpty = StringUtil.isNullOrEmpty(pwd);\n\t\tif(isAccEmpty){\n\t\t\tedAccount.requestFocus();\n\t\t}else if(isPwdEmpty){\n\t\t\tedPassword.requestFocus();\n\t\t}\n\t\treturn !( isAccEmpty|| isPwdEmpty);\n\t}", "private void respAuth() throws Exception {\n DataOutputStream dos = new DataOutputStream(os);\n dos.writeInt(1);\n dos.writeByte(Message.MSG_RESP_AUTH);\n if (haslogin) {\n dos.writeByte(Message.SUCCESS_AUTH);\n } else {\n dos.writeByte(Message.FAILED_AUTH);\n }\n }", "boolean isValidCredential(String username, String password);", "private boolean checkAuthentication(String login, String passwd) {\n Connection connect;\n boolean result = false;\n try {\n // connect db\n Class.forName(DRIVER_NAME);\n connect = DriverManager.getConnection(SQLITE_DB);\n // looking for login && passwd in db\n Statement stmt = connect.createStatement();\n ResultSet rs = stmt.executeQuery(SQL_SELECT.replace(\"?\", login));\n while (rs.next())\n result = rs.getString(PASSWD_COL).equals(passwd);\n // close all\n rs.close();\n stmt.close();\n connect.close();\n } catch (Exception ex) {\n ex.printStackTrace();\n return false;\n }\n return result;\n }", "boolean hasLoginapisuccessfulhitcount();", "java.lang.String getAuth();", "java.lang.String getAuth();", "java.lang.String getAuth();", "private boolean checkValidation() {\n boolean result = true;\n\n if(!Validate.isEmailAddress(editTextLogin, true)){\n result = false;\n }\n if(!Validate.isPassword(editTextPassword, true)) {\n result = false;\n }\n\n return result;\n }", "@Override\r\n protected void additionalAuthenticationChecks(UserDetails userDetails, UsernamePasswordAuthenticationToken authentication) {\n }", "public boolean canHandle(HttpServletRequest request) {\n if (log.isDebugEnabled()) {\n log.debug(\"Inside Token2Authenticator canHandle method\");\n }\n return StringUtils.isNotEmpty(request.getParameter(Token2Constants.CODE));\n }", "@Override\n\tpublic boolean authenticate(OrderBean bean) {\n\t\treturn false;\n\t}" ]
[ "0.71252835", "0.69369537", "0.68943256", "0.67720556", "0.668397", "0.6521539", "0.650699", "0.64679235", "0.6441667", "0.6360892", "0.6350228", "0.62719434", "0.6249797", "0.62469673", "0.6217377", "0.62060153", "0.6175462", "0.6115119", "0.6061613", "0.605529", "0.60116136", "0.59889567", "0.59868383", "0.5986311", "0.5981727", "0.5976403", "0.5975137", "0.5973394", "0.59704506", "0.59672797", "0.5961591", "0.5953231", "0.5934813", "0.59227145", "0.5908556", "0.58572155", "0.58340997", "0.58284205", "0.58180976", "0.5775823", "0.5763321", "0.5728321", "0.5722239", "0.57193613", "0.57086295", "0.57078516", "0.5700717", "0.5675479", "0.5673454", "0.5666665", "0.56640875", "0.56640863", "0.56640863", "0.5652915", "0.5646829", "0.56085634", "0.5602236", "0.5601967", "0.557693", "0.55735934", "0.55707777", "0.55694836", "0.5567366", "0.55622214", "0.5552878", "0.55528516", "0.5538817", "0.5534572", "0.55275774", "0.5523549", "0.5513933", "0.5511435", "0.55081296", "0.5503534", "0.5495882", "0.54938686", "0.54856336", "0.54856336", "0.5480952", "0.54740995", "0.5470015", "0.5451695", "0.54511184", "0.5424365", "0.5422131", "0.5421009", "0.54166424", "0.5415176", "0.5407177", "0.5396398", "0.538952", "0.5389507", "0.5387967", "0.53878176", "0.53878176", "0.53878176", "0.53636134", "0.5362959", "0.5362885", "0.5350735" ]
0.8389808
0
Checks the list string
private void checkList() { val list = config.getString("list"); val mode = config.getString("mode"); if (isNullOrEmpty(list)) { MovieHandler.Type type = MovieHandler.Type.valueOf(mode); if (type.equals(MovieHandler.Type.COMBINED) || type.equals(MovieHandler.Type.ADD_TO_WATCHLIST)) { throw new IllegalArgumentException("list is not set, but required for current mode!"); } } else { checkArgument(list.startsWith("ls") || list.equals("watchlist"), "list doesn't start with ls prefix!"); checkArgument(list.length() >= 3, "list string length less than 3!"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 1;\r\n\t\t\t}", "@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 1;\r\n\t\t\t}", "@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 1;\r\n\t\t\t}", "@Test\n\tpublic void test_validate_string_list() throws Exception {\n\t\tArrayList<Data> rawList = new ArrayList<Data>();\n\t\trawList.add(new Data(\"subData\", \"integer\", 12, false, false, false));\n\t\tData list = new Data(\"list\", \"description\", rawList, false, false, false);\n\t\t\n\t\tHashMap<String, Data> rawParent = new HashMap<String, Data>();\n\t\trawParent.put(\"list\", list);\n\t\t\n\t\tData parent = new Data(\"parent\", \"parent\", rawParent, false,false,false);\n\t\t\n\t\tChemistryProjectGlobalValidation c = new ChemistryProjectGlobalValidation();\n\t\t\n\t\t//fail becuase list contains an integer element\n\t\tassertNotEquals(null, c.containsStringList(parent, \"list\"));\n\t\t\n\t\t//fail because key doesnt exist\n\t\tassertNotEquals(null, c.containsStringList(parent, \"non existant \"));\n\t\t\n\t\t//fail because key exists but is not list type\n\t\tassertNotEquals(null, c.containsStringList(list, \"subData\"));\n\t}", "@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 2;\r\n\t\t\t}", "@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 2;\r\n\t\t\t}", "@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 2;\r\n\t\t\t}", "@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 2;\r\n\t\t\t}", "@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 2;\r\n\t\t\t}", "@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 2;\r\n\t\t\t}", "private boolean stringContainsList(String s, ArrayList<String> list){\n\t\tboolean flag = true;\n\t\tfor(String temp : list){\n\t\t\tif(!s.contains(temp)){\n\t\t\t\tflag = false;\n\t\t\t\treturn flag;\n\t\t\t}\n\t\t}\n\t\treturn flag;\n\t}", "@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 3;\r\n\t\t\t}", "@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 3;\r\n\t\t\t}", "static public boolean isList (String listString, String startToken, String endToken,\n String delimiter)\n{\n String s = listString.trim ();\n Vector list = new Vector ();\n\n if (s.startsWith (startToken) && s.endsWith (endToken)) \n return true;\n else\n return false;\n\n\n}", "@Given(\"^a list that is \\\"([^\\\"]*)\\\"$\")\n\tpublic void a_list_that_is(String list) throws Throwable {\n\t\tlistAsString = new String(list); \n\t \n\t}", "@Test\n\tpublic void NotExamtestListToString() {\n\t\t\n\t\tassertEquals(\"[a,b,c]\",listToString(list));\n\t\tassertEquals(\"[a,b,c,aaa,a,a,d,a]\",listToString(list2));\n\t\tassertEquals(\"[]\",listToString(empty));\n\t\tassertEquals(\"[hello]\",listToString(onlyOne));\n\n\t}", "public List<String> validate();", "public static boolean notListvalue(String value, String list)\r\n\t{\r\n\t\treturn !isListvalue(value, list);\r\n\t}", "public boolean checkListItem(ArrayList<Item> inputListItem, String stringDesire)\r\n\t{\r\n\t\tString itemName = stringDesire.substring(0, stringDesire.indexOf(\":\"));;\r\n\t\tString variable = stringDesire.substring(stringDesire.indexOf(\":\")+1, stringDesire.lastIndexOf(\":\"));\r\n\t\tString desireValue = stringDesire.substring(stringDesire.lastIndexOf(\":\")+1,stringDesire.length());\r\n\t\r\n\t\t// Character may has multiple item with the same name, but different stats (sword, but one is broken, but the other aren't).\r\n\t\t// Thus all item with matching name must be checked\r\n\t\t// IF even ONE of the item match, this methods will return true;\r\n\t\t\r\n\t\tArrayList<Item> listMatchItem = new ArrayList<Item>();\r\n\r\n\t\tfor (int x = 0; x<inputListItem.size();x++)\r\n\t\t{\r\n\t\t\tif (inputListItem.get(x).getName() == itemName) \r\n\t\t\t\tlistMatchItem.add(inputListItem.get(x));\r\n\t\t}\r\n\t\t\r\n\t\tif (variable == \"itemNameNOT\" && listMatchItem.size() == 0) {\r\n\t\t\tSystem.out.println(\"Char not contain prohibit item\");\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\telse if (listMatchItem.size() == 0 ) {\r\n\t\t\tSystem.out.println(\"NO MATCH ITEM IS FOUND\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// If NONE of the item match with the desireValue >>> this method must return FALSE;\r\n\t\t// In order to do this, we use the isOneMatch.\r\n\t\t//\r\n\t\t// This boolean will turn true if one of the item match\t\t\r\n\t\t// At the end of the for loop, the methods will return this boolean\r\n\t\tboolean isOneMatch = false;\r\n\t\tif (variable == \"listPropertyNOT\")\r\n\t\t{\r\n\t\t\tisOneMatch = true;\r\n\t\t}\r\n\t\t\r\n\t\tfor (Item inputItem : listMatchItem)\t\r\n\t\t{\r\n\t\t\tswitch (variable)\r\n\t\t\t{\r\n\t\t\t\t// This is use to check if this item is in inventory\r\n\t\t\t\tcase (\"itemName\") \r\n\t\t\t\t:\r\n\t\t\t\t\tif (inputItem.getName() == desireValue) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tisOneMatch = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\tcase (\"typeOfItem\") \r\n\t\t\t\t:\r\n\t\t\t\t\tif (inputItem.getListTypeOfItem().contains(desireValue)) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tisOneMatch = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (\"typeOfFunction\") \r\n\t\t\t\t:\r\n\t\t\t\t\tif (inputItem.getListTypeOfFunction().contains(desireValue)) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tisOneMatch = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (\"ownerName\") \r\n\t\t\t\t:\r\n\t\t\t\t\tif (inputItem.getOwnerName() == desireValue) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tisOneMatch = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (\"isOnGround\") \r\n\t\t\t\t:\r\n\t\t\t\t\tString curIsAlive = Boolean.toString(inputItem.isItemOnGround());\r\n\t\t\t\t\tif (curIsAlive == desireValue) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tisOneMatch = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (\"currentLocation\") \r\n\t\t\t\t:\r\n\t\t\t\t\tif (inputItem.getCurrentLocation() == desireValue) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tisOneMatch = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tcase (\"sameLocation\")\r\n\t\t\t\t: \r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t//-------------FIND ALL ITEM THAT MATCH DESIREVALUE------------------\r\n\t\t\t\t\t\r\n\t\t\t\t\tArrayList<Item> listMatchItemSameLocation = new ArrayList<Item>();\r\n\t\t\t\t\t\r\n\t\t\t\t//\tString itemName = stringDesire.substring(0, stringDesire.indexOf(\":\"));;\r\n\t\t\t\t//\tString variable = stringDesire.substring(stringDesire.indexOf(\":\")+1, stringDesire.lastIndexOf(\":\"));\r\n\t\t\t\t//\tString desireValue = stringDesire.substring(stringDesire.lastIndexOf(\":\")+1,stringDesire.length());\r\n\t\t\t\r\n\t\t\t\t\tfor (int x = 0; x<inputListItem.size();x++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (inputListItem.get(x).getName() == desireValue) \r\n\t\t\t\t\t\t\tlistMatchItemSameLocation.add(inputListItem.get(x));\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (listMatchItemSameLocation.size() == 0 ) {\r\n\t\t\t\t\t\tSystem.out.println(\"NO MATCH ITEM IS FOUND\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//--------------------------------\r\n\t\t\t\t\t\r\n\t\t\t\t\tItem itemSameLocation = null;\r\n\t\t\t\t\tfor (Item checkItem : listMatchItemSameLocation)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (checkItem.getCurrentLocation() == inputItem.getCurrentLocation())\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// If some item in match list = in same location, break and return true;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// If the code reach this code, it mean no matched item with same location exist, Thus return false;\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t// If contain desireValue, return true;\r\n\t\t\t\tcase (\"listProperty\") \r\n\t\t\t\t:\r\n\t\t\t\t\tif (inputItem.getListProperty().contains(desireValue)){\r\n\t\t\t\t\t\tisOneMatch = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t// If NOT contain desireValue, return true;\t\r\n\t\t\t\tcase (\"listPropertyNOT\") \r\n\t\t\t\t:\r\n\t\t\t\t\tif (!inputItem.getListProperty().contains(desireValue) && isOneMatch == true) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (inputItem.getListProperty().contains(desireValue)){\r\n\t\t\t\t\t\tisOneMatch = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t// In case that variable doesn't exist, it should mean that misspelling happen\r\n\t\t\t\tdefault \r\n\t\t\t\t: \r\n\t\t\t\t\tSystem.out.println(\"checkListItem's variable does not exist, FROM enviroment.GameWorld.containCharacter\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn isOneMatch;\r\n\t}", "private boolean validateList(NodeList list, String error) {\n\t\tif (list == null || list.getLength() == 0) {\n\t\t\tCommonUITool.openErrorBox(error);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private void modify(List listString){\n\t}", "@Test\n public void testListToString() {\n // test whether empty list converts to some string\n logger.trace(\"Empty list handled?\");\n String string = \"\";\n List<String> list = Util.stringToList(string);\n String string2 = Util.listToString(list);\n Assert.assertTrue(string2.length() > 0);\n\n // test whether single element list converts to the first element\n logger.trace(\"Single element list handled?\");\n string = \"foo\";\n list = Util.stringToList(string);\n string2 = Util.listToString(list);\n Assert.assertTrue(string2.equals(string));\n\n // test whether two element list converts to some string\n logger.trace(\"Two element list handled?\");\n string = \"foo bar\";\n list = Util.stringToList(string);\n string2 = Util.listToString(list);\n final int twoElementLength = string2.length();\n Assert.assertTrue(twoElementLength > 0);\n\n // test whether three element list converts to a string longer than the two element list\n logger.trace(\"Three element list handled?\");\n string = \"foo bar baz\";\n list = Util.stringToList(string);\n string2 = Util.listToString(list);\n final int threeElementLength = string2.length();\n Assert.assertTrue(threeElementLength > twoElementLength);\n }", "void mo100443a(List<String> list);", "public void processList(List<String> inList);", "static boolean esLista(String linea)\r\n\t\t\tthrows IllegalArgumentException\r\n\t{ \r\n\t// Verifica si la primera linea del archivo comienza con \" \" para saber si es una matriz\r\n\t// de adyacencia o una lista de adyacencia.\r\n if(linea.startsWith(\" \")){\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n\t}", "public static void validateListInput(String[] words) throws DukeException {\n if (parser.parseListCommand(words)) {\n throw new DukeException(\"☹ OOPS!!! The description of a list should be empty.\");\n }\n }", "@Test\n public void testStringToList() {\n // test whether empty string converts to empty list\n logger.trace(\"Empty string handled?\");\n String string = \"\";\n List<String> list = Util.stringToList(string);\n Assert.assertEquals(list.size(), 0);\n\n // test whether single space converts to empty list\n logger.trace(\"Single space handled?\");\n string = \" \";\n list = Util.stringToList(string);\n Assert.assertEquals(list.size(), 0);\n\n // test whether single item surrounded by spaces converts to list of size 1\n logger.trace(\"Item surrounded by spaces handled?\");\n string = \" foo \";\n list = Util.stringToList(string);\n Assert.assertEquals(list.size(), 1);\n\n // test whether two item string converts to list of size 2\n logger.trace(\"Two item string handled?\");\n string = \" foo bar \";\n list = Util.stringToList(string);\n Assert.assertEquals(list.size(), 2);\n }", "public void testDumpList() {\n \n String result = tester.dumpList(box); \n \n assertTrue(\"Wrong start\", result.startsWith(\"[item 0, item 1, item 2, item 3, item 4, item 5, \"));\n assertTrue(\"Wrong end\", result.endsWith(\", item 96, item 97, item 98, item 99]\"));\n }", "public void testToString() {\r\n assertEquals(\"[]\",\r\n list.toString());\r\n list.add(\"A\");\r\n assertEquals(\"[A]\",\r\n list.toString());\r\n list.add(\"B\");\r\n assertEquals(\"[A, B]\",\r\n list.toString());\r\n }", "void mo54419a(List<String> list);", "private boolean isListValid()\n {\n boolean isValid = true;\n Collection<RecognizedElement> elementsList = tree.getChildren();\n for (Iterator<RecognizedElement> iterator = elementsList.iterator(); iterator.hasNext();)\n {\n RecognizedElement recognizedElement = (RecognizedElement) iterator.next();\n if (isSpreadsheet)\n {\n if (recognizedElement instanceof Style || recognizedElement instanceof Regex)\n {\n isValid = false;\n break;\n }\n }\n else\n {\n if (recognizedElement instanceof Column)\n {\n isValid = false;\n break;\n }\n }\n }\n return isValid;\n }", "@Test\n public void testListOfStrings() {\n JsonableTestClassWithList jtc = Jsonable.loadFromFile(\"testFiles/listTest.json\", JsonableTestClassWithList.class);\n assertEquals(4, jtc.stringArray.size());\n String jsonString = jtc.toJSON().toString();\n assertThat(jsonString, Matchers.containsString(\"\\\"abc\\\"\"));\n assertThat(jsonString, Matchers.containsString(\"\\\"def\\\"\"));\n assertThat(jsonString, Matchers.containsString(\"\\\"123\\\"\"));\n assertThat(jsonString, Matchers.containsString(\"\\\"456\\\"\"));\n }", "private boolean anyOfSetInString(String inputStr, Set<String> items) {\n\n for (String s : items) {\n if (inputStr.contains(s)) {\n // Didn't use String.equals() as user can have the number saved with or without country code\n\n return true;\n }\n }\n\n return false;\n }", "private static boolean isListProperty(String prop) {\n prop = prop.intern();\n for (int i = 0; i < listProperties.length; i++) {\n if (prop == listProperties[i]) {\n return true;\n }\n }\n return false;\n }", "public static List<String> check(String input){\n\t\treturn SQLInputValidation.traps.stream()\n\t\t\t\t\t\t.filter(input::contains)\n\t\t\t\t\t\t.collect(toList());\n\t}", "protected boolean validateData(String [] data) {\n return true;\n }", "public static boolean isValidJobListName(String test) {\n if (test == null) {\n throw new NullPointerException(\"Parameter Type cannot be null\");\n }\n return POSSIBLE_ListName_TREE.contains(test);\n }", "@Override\r\n\tprotected void validateList(List<StravaChallenge> list) {\n\t\tif (JavastravaApplicationConfig.STRAVA_ALLOWS_CHALLENGES_ENDPOINT) {\r\n\t\t\tsuper.validateList(list);\r\n\t\t}\r\n\t}", "public static boolean searchItemInList(String text, List<IStringField> list){\n for(IStringField item : list){\n if(item.getStrValue().equals(text)){\n return true;\n }\n }\n return false;\n }", "@Test\n\tpublic void testListLiteral() throws ParseException {\n\t\tListLiteral listLiteral = langParser(\"[]\").listLiteral();\n\t\tassertEquals(listLiteral.getElements().size(), 0);\n\t\tlistLiteral = langParser(\"[101,a,'b']\").listLiteral();\n\t\tassertEquals(listLiteral.getElements().size(), 3);\n\t\tassertEquals(listLiteral.getElements().get(0).getClass(), LongLiteral.class);\n\t\tassertEquals(((LongLiteral) listLiteral.getElements().get(0)).longValue(), 101L);\n\t\tassertEquals(listLiteral.getElements().get(1).getClass(), Identifier.class);\n\t\tassertEquals(((Identifier) listLiteral.getElements().get(1)).getName(), \"a\");\n\t\tassertEquals(listLiteral.getElements().get(2).getClass(), StringLiteral.class);\n\t\tassertEquals(((StringLiteral) listLiteral.getElements().get(2)).getValue(), \"b\");\n\t}", "public void validateAlbums(List<String> albumList) {\n\t\tfor(String albumName: albumList) {\n\t\t\tassertTrue(this.studioAlbumsValue.getText().contains(albumName));\n\t\t}\n\t}", "protected boolean updateStringListStatement(IASTListHolder<IASTLiteralTextNode> statement,\r\n\t\t\tList<String> list,\r\n\t\t\tListIterator<String> listIterator) { \r\n\t\treturn updateListStatement(statement, list, listIterator, \r\n\t\t\t\tnew PlatformStatementListConverter());\r\n\t}", "public static Boolean validateInput(String str) {\n String[] lines = str.split(\"\\n\");\r\n // System.out.println(\"lines array:\"+lines.length);\r\n Boolean validate = true;\r\n String[] lineParameters;\r\n int countFor =0;\r\n for (String line : lines) {\r\n if(countFor > 1){\r\n lineParameters = line.split(\",\");\r\n\r\n if (lineParameters.length != 5) {\r\n validate = false;\r\n break;\r\n }\r\n }\r\n countFor++;\r\n \r\n\r\n }\r\n return validate;\r\n }", "public void validateRecipients(List<String> expected) {\n List<String> received = Arrays.asList(recipients.getText().split(\",\"));\n assertTrue(\"Received list \" + received.toString() + \" contains the expected \" + expected.toString(), received.containsAll(expected));\n }", "public static boolean in(String strs, String str) {\n\treturn null != strs && null != str && Arrays.asList(strs.split(\",\")).contains(str);\n }", "private boolean isString(TextField input, String message){\n String valid = \"[0-9\\\\s]+\";\n if (message.matches(valid)){\n System.out.println(\"entered data is valid\");\n //splits the string at spaces and converts each number to a double\n List<String> Varlist1 = new ArrayList<String>(Arrays.asList(message.split(\"\\\\s+\")));\n for (String s: Varlist1) {\n \t\t\tdouble newVal = Double.valueOf(s);\n list1.add(newVal);\n \t\t}\n System.out.println(list1);\n return true;\n }else{\n System.out.println(\"entered data is invalid, input all numbers and spaces\");\n return false;\n }\n }", "public boolean isList();", "public boolean isList();", "public static Boolean validateInputFromPool(String str) {\n String[] lines = str.split(\"\\n\");\r\n Boolean validate = true;\r\n String[] lineParameters;\r\n int countFor =0;\r\n for (String line : lines) {\r\n if(countFor > 1){\r\n lineParameters = line.split(\",\");\r\n if (lineParameters.length != 2) {\r\n validate = false;\r\n break;\r\n }\r\n }\r\n \r\n countFor++;\r\n }\r\n return validate;\r\n }", "protected boolean checkEmptyList(){\n boolean emptyArray = true;\n String empty= alertList.get(AppCSTR.FIRST_ELEMENT).get(AppCSTR.NAME);\n if(!empty.equals(\"null\") && !empty.equals(\"\")) {\n emptyArray = false;\n }\n return emptyArray;\n }", "public boolean hasList() {\n return msgCase_ == 5;\n }", "@Override\n public boolean verify(String inputString, String vocabularyString) {\n List<String> inputStringList = getWords(inputString);\n List<String> vocabularyStringList = getWords(vocabularyString);\n if (inputStringList.size() == 0)return false;\n for (String word: inputStringList){\n if (!vocabularyStringList.contains(word))return false;\n }\n return true;\n }", "public boolean hasList() {\n return msgCase_ == 5;\n }", "@Override\n\t\tprotected void revalidate() {\n\t\t\tif (valid) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvalid = true;\n\t\t\tmissing = false;\n\t\t\tmalformed = false;\n\n\t\t\tString s = getValueAsString();\n\t\t\tif (s == null) {\n\t\t\t\tmissing = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tListBuilder builder = new ListBuilder(this);\n\n\t\t\t\tdoParse(s, builder);\n\n\t\t\t\tif (builder.getList() != null) {\n\t\t\t\t\tclear(itemList);\n\t\t\t\t}\n\t\t\t\titemList = builder.getList();\n\t\t\t} catch (ParseException e) {\n\t\t\t\titemList = new ArrayList<>(1);\n\t\t\t\tmalformed = true;\n\t\t\t}\n\t\t}", "@Test\r\n\tpublic void testListArg() {\r\n\t\tAssert.assertEquals(\"test[(`a,`b,`c)]\", new FunctionImpl.FunctionBuilderImpl(\"test\").param(SymbolValue.froms(\"a\", \"b\", \"c\")).build().toQ());\r\n\t}", "String getStringList();", "@Test\n public void testWithNonEmptyList() throws org.nfunk.jep.ParseException\n {\n Stack<Object> parameters = CollectionsUtils.newParametersStack(Arrays.asList(\"test\"));\n function.run(parameters);\n assertEquals(FALSE, parameters.pop());\n }", "public static boolean containsIgnoreCase(List<String> list, String str) {\n boolean strAvailable = false;\n if (list != null) {\n for (String s : list) {\n if (s.equalsIgnoreCase(str)) {\n strAvailable = true;\n break;\n }\n }\n }\n return strAvailable;\n }", "public static void VerifyListText(String renderingControl){\n\t\ttry{\n\t\t\tactualListText=sitecoreObj.aboutusListText.getAttribute(\"class\");\n\t\t\tAssert.assertEquals(actualListText, expectedData.getProperty(\"aboutusListText\"));\n\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" List Text - \"+actualListText);\n\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" List Text - \"+expectedData.getProperty(\"aboutusListText\"));\n\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" List Text are Same\");\n\t\t}catch(AssertionError e){\n\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" List Text - \"+actualListText);\n\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" List Text - \"+expectedData.getProperty(\"aboutusListText\"));\n\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" List Text are NOT same\");\n\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\tlog.error(\"TEST FAILED: There is No List Text on \" + renderingControl + \" element\");\n\t\t}\n\t}", "protected boolean isStopsValid(String stops) {\n return stops.matches(\"[0-9]\");\n }", "private ArrayList parseList(String localData){\n int localPointer = 0;\n ArrayList temp = new ArrayList();\n char c = localData.charAt(localPointer++);\n while (c != ']'){\n String item = \"\";\n Object itemObj = null;\n item_loop :\n while (c != ']'){\n switch (c){\n case ',' :\n c = localData.charAt(localPointer++);\n break item_loop;\n case '{' :\n String tempItem = this.getFull(localData.substring(localPointer),0);\n localPointer += tempItem.length();\n item += tempItem;\n break ;\n case '[' :\n String tempItem2 = this.getFull(localData.substring(localPointer),1);\n localPointer += tempItem2.length();\n item += tempItem2;\n break ;\n default :\n item += c;\n break ;\n }\n c = localData.charAt(localPointer++);\n }\n item = item.trim();\n switch (this.getDataType(item.trim())){\n case String:\n itemObj = item.trim().replace(\"\\\"\",\"\");\n break ;\n case Integer:\n itemObj = Long.parseLong(item.trim());\n break ;\n case Float:\n itemObj = Float.parseFloat(item.trim());\n break ;\n case Boolean:\n itemObj = Boolean.parseBoolean(item.trim());\n break ;\n case Map:\n itemObj = this.parseMap(item.trim());\n break ;\n case List:\n itemObj = this.parseList(item.trim());\n }\n temp.add(itemObj);\n }\n return temp;\n }", "public void verifyBugerList()\n\t{\n\t\t\n\t}", "public void testCheckActivityNameAvailability_withListIdSet()\n\t{\n\t\t// arrange\n\t\tUri listUri = helper.insertNewList(\"testlist\");\n\t\tint listId = Integer.parseInt(listUri.getPathSegments().get(1));\n\n\t\t// Act\n\t\tBoolean nameAvailable = service.checkActivityNameAvailability(\"testlist\", listId);\n\t\tassertTrue(nameAvailable);\n\t\tnameAvailable = service.checkActivityNameAvailability(\"testList\", listId);\n\t\tassertTrue(nameAvailable);\n\t\tnameAvailable = service.checkActivityNameAvailability(\"testList1\", listId);\n\t\tassertTrue(nameAvailable);\n\t\tnameAvailable = service.checkActivityNameAvailability(\"1testList\", listId);\n\t\tassertTrue(nameAvailable);\n\t\tnameAvailable = service.checkActivityNameAvailability(\"testList \", listId);\n\t\tassertTrue(nameAvailable);\n\t}", "public static boolean isList(RDFNode l) {\n if (l.isLiteral()) return false;\n Resource r = (Resource) l;\n return\n r.equals(RDF.nil)\n || r.hasProperty(RDF.first)\n || r.hasProperty(RDF.type, RDF.List)\n ;\n }", "public ConsList<String> tryToConsumeInput( ConsList<String> unprocessedInput );", "private void checkListOrder(String[] sortedList, Collator c) {\n for (int i = 0; i < sortedList.length - 1; i++) {\n if (c.compare(sortedList[i], sortedList[i + 1]) >= 0) {\n errln(\"List out of order at element #\" + i + \": \"\n + sortedList[i] + \" >= \"\n + sortedList[i + 1]);\n }\n }\n }", "@Test(expectedExceptions = ParseException.class)\n\tpublic void testListLiteralMissingFirstElement() throws ParseException {\n\t\tparser(\"<%=[,]%>\").block();\n\t}", "public static boolean containsMatch(List<String> list, String str) {\n boolean strAvailable = false;\n final Pattern pattern = Pattern.compile(str, Pattern.CASE_INSENSITIVE | Pattern.CANON_EQ);\n if (list != null) {\n for (String s : list) {\n final Matcher matcher = pattern.matcher(s);\n if (matcher.find()) {\n strAvailable = true;\n break;\n }\n }\n }\n return strAvailable;\n }", "public void filterStringForList(String input){\n if (input.toLowerCase().contains(\"urgent\")){\n priorityAlerts.add(input);\n }\n else{\n alerts.add(input);\n }\n }", "@Override\n public boolean isValid(Iterable<? extends CharSequence> value, ConstraintValidatorContext context) {\n if (value == null) {\n return true;\n }\n\n for (CharSequence str : value) {\n if (!validate(str)) {\n return false;\n }\n }\n\n return true;\n }", "ListString createListString();", "public synchronized boolean validate(Object data) {\n if (!(data instanceof String)) {\n return false;\n }\n\n String dataString = (String) data;\n dataString = dataString.replaceAll(\"\\\\s\", \"\").replaceAll(\"-\", \"\");\n if (dataString.length() != 6) {\n return false;\n }\n\n for (Character c : dataString.substring(0, 2).toCharArray()) {\n if (!Character.isLetter(c)) {\n return false;\n }\n }\n for (Character c : dataString.substring(3, 5).toCharArray()) {\n if (!Character.isDigit(c)) {\n return false;\n }\n }\n return true;\n }", "boolean hasList();", "@NonNull\n protected static List<RaveError> checkStringDef(\n boolean isNullable,\n @NonNull ValidationContext validationContext,\n @Nullable String[] values,\n String... acceptableValues) {\n List<RaveError> errors = checkNullable(values, isNullable, validationContext);\n if (values == null) {\n return errors;\n }\n for (String s : values) {\n errors = mergeErrors(errors, checkStringDef(false, validationContext, s, acceptableValues));\n }\n return errors == null ? Collections.<RaveError>emptyList() : errors;\n }", "public boolean isList(String key)\n {\n return getList(key, null) != null;\n }", "public static boolean isUrl(List<String> urlList, String url) {\n if (StringUtils.isNotEmpty(url) && urlList != null) {\r\n String[] needPri = url.split(DELIMITED_CHAR);\r\n for (String pri : needPri) {\r\n if (!urlList.contains(pri)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n return false;\r\n }", "@Override\r\n\tpublic boolean isValid(List<String> checkList, ConstraintValidatorContext cvc) {\n\r\n\t\tif (checkList == null) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif (java.util.Arrays.asList(optionList).containsAll(checkList)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "@Test\n\tpublic void testListOperations() {\n\t\tassertFalse(streetAddresses.contains(s1PlusNine));\n\t\tassertTrue(streetAddresses.stream().anyMatch(s -> comparator.compare(s1PlusNine, s) == 0));\n\t}", "private static void validListCheck(final List list) {\n final boolean[] testIndexSlots=new boolean[list.size()];\n Arrays.fill(testIndexSlots, false);\n int i=-1;\n try {\n\t for (i=0; i<list.size(); i++) {\n\t final ExerciseDetail exDetail=(ExerciseDetail)list.get(i);\n\t final int index=exDetail.getIndex();\n\t if (index<0) {\n\t throw new RuntimeException(\"The list of ExerciseDetails was not valid; negative index found.\");\n\t }\n\t if (testIndexSlots[index]) {\n\t throw new RuntimeException(\"The list of ExerciseDetails was not valid; two instances of the index '\"+index+\"' found.\");\n\t }\n\t testIndexSlots[index]=true;\n\t }\n }\n catch (final ArrayIndexOutOfBoundsException e) {\n throw new RuntimeException(\"The list of ExerciseDetails was not valid; the index '\"+i+\"' is out of range.\");\n }\n }", "List<String> mo5877c(String str);", "private boolean isTenantValid(String s) {\n\n for (int i = 0; i < tenantFullNames.size(); i++) {\n if (tenantFullNames.get(i).matches(s.trim())) {\n addedTenant = tenantList.get(i);\n return true;\n }\n }\n return false;\n }", "public static void m1(ArrayList<String> al)\n\t{\n\t\tal.add(\"Marshal Mathers\");\n\t\tal.add(\"Slim Shady\");\n\t\tal.add(\"Bad Meets Evil\");\t\n\t\tal.add(null);\t// null is allowed, because it is valid value for any type\n\t}", "public boolean contains(String value){\n if (value == null)\n return false;\n int index = clamp(value);\n if (linkedListStrings[index] == null)\n return false;\n else\n return linkedListStrings[index].contains(value);\n\n\n }", "@Test\r\n\tvoid testContains() {\r\n\t\tSortedList list = new SortedList(\"List\");\r\n\t\tlist.insert(toDoItem1);\r\n\t\tlist.insert(toDoItem2);\r\n\t\tlist.insert(toDoItem3);\r\n\t\tlist.insert(toDoItem4);\r\n\r\n\t\tif (list.contains(\"Item 1\") != true) {\r\n\t\t\tfail(\"Failed to find \\\"Item 1\\\"\");\r\n\t\t}\r\n\t\tif (list.contains(\"Item 2\") != true) {\r\n\t\t\tfail(\"Failed to find \\\"Item 2\\\"\");\r\n\t\t}\r\n\t\tif (list.contains(\"Item 3\") != true) {\r\n\t\t\tfail(\"Failed to find \\\"Item 3\\\"\");\r\n\t\t}\r\n\t\tif (list.contains(\"Item 4\") != true) {\r\n\t\t\tfail(\"Failed to find \\\"Item 4\\\"\");\r\n\t\t}\r\n\t}", "@Test(expectedExceptions = ParseException.class)\n\tpublic void testListLiteralMissingSecondElement() throws ParseException {\n\t\tparser(\"<%=[a,]%>\").block();\n\t}", "public abstract void mo9247b(String str, long j, List<String> list);", "public void addRow(ArrayList<String> stringList) {\n }", "public String verifyAllVauesOfList(String object, String data) {\n\t\tlogger.debug(\"Selecting from list\");\n\t\ttry {\n\n\t\t\tboolean flag = false;\n\t\t\tWebElement select = wait.until(explicitWaitForElement(By.xpath(OR.getProperty(object))));\n\t\t\tList<WebElement> options = select.findElements(By.tagName(OR.getProperty(\"OPTION_TAG\")));\n\t\t\tString temp = data;\n\t\t\tString allElements[] = temp.split(Constants.Object_SPLIT);\n\t\t\tString actual;\n\t\t\tfor (int i = 0; i < allElements.length; i++) {\n\t\t\t\tactual = options.get(i).getText().trim();\n\t\t\t\tlogger.debug(\"Actual Value = \" +actual); \n\t\t\t\tif (actual.equals(allElements[i].trim())) {\n\t\t\t\t\tflag = true;\n\t\t\t\t} else {\n\t\t\t\t\tflag = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (flag) {\n\t\t\t\treturn Constants.KEYWORD_PASS + \" -- Dropdown's all values are present\";\n\t\t\t} else {\n\t\t\t\treturn Constants.KEYWORD_FAIL + \" -- Dropdown's all values are not present\";\n\t\t\t}\n\t\t} catch(TimeoutException ex)\n\t\t\n\t\t{\n\t\t\treturn Constants.KEYWORD_FAIL +\"Cause: \"+ ex.getCause();\n\t\t}catch (Exception e) {\n\t\t\n\t\t\treturn Constants.KEYWORD_FAIL + \" - Could not select from list. \" + e.getMessage();\n\n\t\t}\n\t}", "private boolean isValidString(String task) \n\t{\n\t\tfor (int i = 0; i < names.length; i++) \n\t\t{\n\t\t\tif(task.equals(names[i]))\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean isListLengthFixed();", "public static boolean testAlphabetListAdd() {\r\n AlphabetList list1 = new AlphabetList();\r\n list1.add(new Cart(\"D\"));\r\n if (list1.size() != 1)\r\n return false;\r\n list1.add(new Cart(\"A\"));\r\n if (list1.size() != 2)\r\n return false;\r\n list1.add(new Cart(\"Z\"));\r\n if (list1.size() != 3)\r\n return false;\r\n list1.add(new Cart(\"C\"));\r\n if (list1.size() != 4)\r\n return false;\r\n if (list1.get(2).getCargo().toString() != \"D\")\r\n return false;\r\n if (list1.indexOf(new Cart(\"C\")) != 1)\r\n return false;\r\n if (!list1.readForward().equals(\"ACDZ\"))\r\n return false;\r\n if (!list1.readBackward().equals(\"ZDCA\"))\r\n return false;\r\n return true;\r\n }", "public boolean isValidSerialization(String preorder) {\n Stack<String> stack = new Stack<>();\n String[] arr = preorder.split(\",\");\n for (String str : arr) {\n stack.push(str);\n\n while(stack.size() >= 3 &&\n stack.get(stack.size() - 1).equals(\"#\") &&\n stack.get(stack.size() - 2).equals(\"#\") &&\n !stack.get(stack.size() - 3).equals(\"#\")) {\n stack.pop();\n stack.pop();\n stack.pop();\n stack.push(\"#\");\n }\n }\n return stack.size() == 1 && stack.peek().equals(\"#\");\n }", "public void validAdd(String element){\n\t\tlist.addLast(element);\n\t}", "public boolean equal(StringList list2) {\n\t\tIterator it1 = stringList.listIterator();\n\t\tIterator it2 = list2.iterator();\n\t\tif(list2.len() != stringList.size()) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\twhile( (it1.hasNext()) ) {\n\t\t\tSystem.out.format(\"Comparing %s%n\", it1.next());\n\t\t\tif( it1.next() != it2.next()) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public boolean isList() {\n // This method could not be decompiled.\n // \n // Original Bytecode:\n // \n // 0: sastore \n // 1: ladd \n // LocalVariableTable:\n // Start Length Slot Name Signature\n // ----- ------ ---- ---- ------------------------------------------\n // 0 2 0 this Lcom/sun/xml/xsom/impl/ListSimpleTypeImpl;\n // \n // The error that occurred was:\n // \n // java.lang.ArrayIndexOutOfBoundsException\n // \n throw new IllegalStateException(\"An error occurred while decompiling this method.\");\n }", "private ArrayList<String> simpleFormList(ArrayList<String> list){\n\t\tArrayList<String> simpleFormList = new ArrayList<String>();\n\t\tfor(String s : list){\n\t\t\tString pos = posMap.get(s);\n\t\t\tsimpleFormList.add(simpleForm(s,pos));\n\t\t}\n\t\treturn simpleFormList;\n\t}", "@Override\n public boolean isValidFormat(String[] listing) {\n\n if (log4j.isDebugEnabled()) {log4j.debug(BaseMessages.getString(PKG, \"MVSFileParser.DEBUG.Checking.Parser\"));} //$NON-NLS-1$\n if (listing.length > 0) {\n String[] header = splitMVSLine(listing[0]); // first line of MVS listings is a header\n if ( (header.length == FOLDER_LISTING_LENGTH_NORMAL) || (header.length == FOLDER_LISTING_LENGTH_ARCIVE) ) {\n if (header[FOLDER_HEADER_TYPE_IDX].equals(HEADER_VOLUME) ) { \n this.partitionedDataset = false; // This is a directory listing, not PDS listing\n if (log4j.isInfoEnabled()) {log4j.debug(BaseMessages.getString(PKG, \"MVSFileParser.INFO.Detected.Dir\"));} //$NON-NLS-1$\n return isValidDirectoryFormat(listing);\n } else if (header[FOLDER_HEADER_TYPE_IDX].equals(HEADER_NAME)) { \n this.partitionedDataset = true; // Suspect PDS listing.\n if (log4j.isInfoEnabled()) {log4j.debug(BaseMessages.getString(PKG, \"MVSFileParser.INFO.Detected.PDS\"));} //$NON-NLS-1$\n return isValidPDSFormat(listing);\n }\n }\n }\n return false;\n }", "@Override\n public List<String> validate(String paramName, String[] values)\n {\n return new ArrayList<String>();\n }", "@Override\n\tprotected void isValid(String input) throws DataInputException\n\t{\n\t}", "public boolean islistmatching(List<String> expected,List<String> actual){\r\n if (expected == null && actual == null){\r\n return true;\r\n }\r\n\r\n if((expected == null && actual != null) || expected != null && actual == null || expected.size() != actual.size()){\r\n return false;\r\n }\r\n\r\n expected = new ArrayList<String>(expected);\r\n actual = new ArrayList<String>(actual);\r\n\r\n Collections.sort(expected);\r\n Collections.sort(actual);\r\n\r\n return expected.equals(actual);\r\n }" ]
[ "0.6880555", "0.6880555", "0.6880555", "0.6875421", "0.68246084", "0.68246084", "0.68246084", "0.68246084", "0.68246084", "0.68246084", "0.6822071", "0.66997826", "0.66997826", "0.6674975", "0.63449544", "0.6313334", "0.62978506", "0.62032366", "0.61449224", "0.6098329", "0.6049529", "0.6041483", "0.60028595", "0.59939265", "0.596802", "0.5967975", "0.5954971", "0.5935125", "0.58842754", "0.58727795", "0.5840231", "0.58335537", "0.582991", "0.58275455", "0.58221287", "0.5749784", "0.5748838", "0.57467294", "0.57368493", "0.57278097", "0.56912345", "0.5683932", "0.56460637", "0.5620831", "0.560734", "0.56062734", "0.55850196", "0.55850196", "0.556278", "0.55536515", "0.5545875", "0.552407", "0.55082035", "0.5504405", "0.5503928", "0.55033684", "0.549762", "0.5480437", "0.54698384", "0.54572207", "0.5436836", "0.5430762", "0.541331", "0.54015565", "0.5400971", "0.5393456", "0.539165", "0.5390399", "0.53899884", "0.53580856", "0.53392434", "0.53384477", "0.533046", "0.532764", "0.5315372", "0.5313468", "0.5305397", "0.5296212", "0.529598", "0.5282093", "0.52705663", "0.52696383", "0.5260959", "0.52477753", "0.52472675", "0.52466595", "0.5242191", "0.52387553", "0.5237955", "0.5236941", "0.5236922", "0.5235118", "0.52310824", "0.5228043", "0.5227518", "0.5218922", "0.5217366", "0.5212375", "0.51994246", "0.5198483" ]
0.6779564
11
Checks the mode string
private void checkMode() { val mode = config.getString("mode"); if (!EnumUtils.isValidEnum(MovieHandler.Type.class, mode)) { throw new IllegalArgumentException("mode is not valid!"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected boolean compareModeStrings(final String source, String mode) {\r\n\t\t// Allow multiple spaces\r\n\t\tmode = mode.replace(\" \", \"(?:[\\\\s]*)\");\r\n\r\n\t\t// Create pattern object, ignore case sensitive chars.\r\n\t\tfinal Pattern pattern = Pattern.compile(\"(\" + mode + \")\", Pattern.CASE_INSENSITIVE);\r\n\t\tfinal Matcher matcher = pattern.matcher(trimStringOrNull(source));\r\n\t\treturn matcher.find();\r\n\t}", "java.lang.String getMode();", "void verifyModesEnable(String mode);", "boolean hasMode();", "private boolean ModeCheck() {\n\t\treturn prefs.getBoolean(\"appmode\", false);\n\n\t}", "private static boolean mode(int option) {\r\n System.out.println(\"Mode(1) = 1\" + \" ::: \" + \"Mode(2) = 2\");\r\n Scanner sc = new Scanner(System.in);\r\n System.out.println(\"Please enter the mode number:\");\r\n option = sc.nextInt();\r\n sc.close();\r\n switch (option) {\r\n case 1:\r\n System.out.println(\"You have selected Mode 1.\");\r\n mode1 = true;\r\n break;\r\n case 2:\r\n System.out.println(\"You have selected Mode 2.\");\r\n mode2 = true;\r\n break;\r\n }\r\n return mode;\r\n }", "public java.lang.String getMode() {\n java.lang.Object ref = mode_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n mode_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public void setMode(final String mode) {\n this.mode = checkEmpty(mode);\n }", "public java.lang.String getMode() {\n java.lang.Object ref = mode_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n mode_ = s;\n }\n return s;\n }\n }", "protected InvalidMode()\n\t{}", "boolean matchMode(QName m1) {\n/* 120 */ return matchModes(m1, this.m_template.getMode());\n/* */ }", "public void setModeinfo( String modeinfo )\n {\n this.modeinfo = modeinfo;\n }", "public com.google.protobuf.ByteString\n getModeBytes() {\n java.lang.Object ref = mode_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n mode_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public void setMode(String mode) {\n this.mode = mode == null ? null : mode.trim();\n }", "public boolean isSetModeName() {\n return (this.modeName != null ? this.modeName.isSetValue() : false);\n }", "public String getMode(){\r\n\t\treturn mode;\r\n\t}", "boolean setMode(int mode);", "private static char isOption(String opt) {\r\n\r\n\t\tif(opt.matches(\"^-?\\\\d+$\"))\r\n\t\t\treturn 0; /* It's a number */\r\n\t\t\r\n\t\tif(opt.indexOf(\"--\") == 0) {\r\n\t\t\t/* It's a string flag */\r\n\t\t\tif(opt.length() == 2 || opt.charAt(2) == '=') {\r\n\t\t\t\t/* This string flag is not long enough. It's only made of '--'. It's invalid. */\r\n\t\t\t\treturn 4;\r\n\t\t\t}\r\n\t\t\treturn 2;\r\n\t\t} else if(opt.indexOf(\"-\") == 0) {\r\n\t\t\t/* It's a single character flag */\r\n\t\t\tif(opt.length() != 2) {\r\n\t\t\t\tif(opt.contains(\"=\") && opt.length() > 2) {\r\n\t\t\t\t\t/* It's a single character flag with an equals in front of it. It's VALID. */\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t}\r\n\t\t\t\t/* This single character flag is longer/shorter than 1 character. It's invalid. */\r\n\t\t\t\treturn 3;\r\n\t\t\t}\r\n\t\t\treturn 1;\r\n\t\t} else {\r\n\t\t\t/* It's a pure value */\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "@Given(\"^Runmode is \\\"([^\\\"]*)\\\"$\")\n\t\tpublic void runmode_is(String runmode) throws Throwable {\n\t\t\t\tif(runmode.equals(\"N\"))\n\t\t\t\t\tthrow new PendingException(\"Skipping the test as Runmode is No\");\n\t\t \n\t\t}", "public String getMode()\n {\n return mode.toString();\n }", "public String getMode() {\n if (_avTable.get(ATTR_MODE) == null\n || _avTable.get(ATTR_MODE).equals(\"\")) {\n _avTable.noNotifySet(ATTR_MODE, \"ssb\", 0);\n }\n\n return _avTable.get(ATTR_MODE);\n }", "public abstract int getMode();", "public static int mode()\r\n\t{\r\n\t\tint mode;\r\n\t\tdo {\r\n\t\t\tSystem.out.println(\"Veuillez entrer 1 pour allez en mode Joueur1 contre Joueur2\");\r\n\t\t\tSystem.out.println(\"Veuillez entrer 2 pour aller en mode Joueur1 contre IA\");\r\n\t\t\tSystem.out.println(\"Veuillez entrer 3 pour allez en mode spectateur d'une partie IA contre IA\");\r\n\t\t\tmode = Saisie.litentier();\r\n\t\t} while (mode > 4);\r\n\t\treturn mode;\r\n\t}", "public static boolean isValidModeOnLoad(String fct)\n\t{\n\t\tif (fct.equals(IEquationStandardObject.FCT_ADD) || fct.equals(IEquationStandardObject.FCT_DEL)\n\t\t\t\t\t\t|| fct.equals(IEquationStandardObject.FCT_MNT) || fct.equals(IEquationStandardObject.FCT_ENQ))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public com.google.protobuf.ByteString\n getModeBytes() {\n java.lang.Object ref = mode_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n mode_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public String getMode()\n {\n return mode;\n }", "public String getMode() {\n return mode;\n }", "public String getMode() {\n return mode;\n }", "public InputMode parseInputMode(String arg) {\r\n\t\tif (arg.equals(\"-console\")) {\r\n\t\t\treturn INPUT_MODE_CONSOLE;\r\n\t\t}\r\n\t\tif (arg.equals(\"-csv\")) {\r\n\t\t\treturn INPUT_MODE_CSV;\r\n\t\t}\r\n\t\tif (arg.equals(\"-db\")) {\r\n\t\t\treturn INPUT_MODE_DB;\r\n\t\t}\r\n\t\treturn INPUT_MODE_NONE;\r\n\t}", "public boolean isMode() {\n return mode;\n }", "public Builder setMode(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000100;\n mode_ = value;\n onChanged();\n return this;\n }", "public void setMode(String mode){\n\t\tthis.mode=mode;\n\t}", "public void setGameMode(char mode) throws IllegalArgumentException {\n if (mode != 'c' && mode != 'C' && mode != 'p' && mode != 'P') {\n throw new IllegalArgumentException(\"Invalid Input: \" + mode);\n }\n if (mode == 'c' || mode == 'C') {\n gameMode = 0;\n } else {\n gameMode = 1;\n }\n }", "public void setMode(String mode) {\n this.mode = mode;\n }", "public String getMode() {\n\n return mode;\n\n }", "public static String getMode() {\n\t\treturn \"rs232 mode get\" + delimiter + \"rs232 mode get \";\n\t}", "public int getMode()\r\n {\r\n Bundle b = getArguments();\r\n return b.getInt(PARAM_MODE);\r\n }", "public boolean checkReg(String op) {\r\n\t\tString pattern = \"(R[1-2][0-9])|R[3][0-2]|R[0-9]$\";\r\n\t\tPattern reg = Pattern.compile(pattern);\r\n\t\tMatcher match = reg.matcher(op);\r\n\t\t\r\n\t\treturn match.find();\r\n\t}", "public static boolean validatenum(String str) {\n\t\tchar[] s=str.toCharArray();\n\t\tfor(int i=0;i<str.length();i++) {\n\t\t\tchar temp=s[i];\n\t\t\ts[i]=temp; \n\t\t}\n\t\tchar ch;\n\t\tboolean capital=false;\n\t\tboolean lower=false;\n\t\tboolean num=false;\n\t\tboolean spc=false;\n\t\tfor(int i=0; i<s.length; i++) {\n\t\t\tch=s[i];\n\t\t\tif(s.length>9) {\n\t\t\t\tif(Character.isDigit(ch)) {\n\t\t\t\t\tSystem.out.println(\"digit char: \"+ch);\n\t\t\t\t\tnum=true;\n\t\t\t\t}\n\t\t\t\telse if(Character.isUpperCase(ch)) {\n\t\t\t\t\tSystem.out.println(\"upper char: \"+ch);\n\t\t\t\t\tcapital=true;\n\t\t\t\t}\n\t\t\t\telse if(Character.isLowerCase(ch)) {\n\t\t\t\t\tSystem.out.println(\"lower char: \"+ch);\n\t\t\t\t\tlower=true;\n\t\t\t\t}\n\t\t\t\telse if((int)ch==(int)'$'|| (int)ch==(int)'#') {\n\t\t\t\t\tSystem.out.println(\"special char: \"+ch);\n\t\t\t\t\tspc=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"Extra :\"+ch);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\t\n\t\t}\n\t\tif(num && spc && lower && capital) {\n\t\t\tSystem.out.println(\"String is valid :\" + \"num: \"+num+\" spc: \"+spc+\" lower: \"+lower+\" capital: \"+capital);\n\t\t\treturn true;\n\t\t}\n\t\t//System.out.println(\"String is valid :\" + \"num: \"+num+\" spc: \"+spc+\" lower: \"+lower+\" capital: \"+capital);\n\t\treturn false;\n\t}", "public static boolean isValidModeOnUpdate(String fct)\n\t{\n\t\tif (fct.equals(IEquationStandardObject.FCT_ADD) || fct.equals(IEquationStandardObject.FCT_DEL)\n\t\t\t\t\t\t|| fct.equals(IEquationStandardObject.FCT_MNT))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public int evalMode(int op, int mode) {\n if (mode == 4) {\n return this.state <= AppOpsManager.resolveFirstUnrestrictedUidState(op) ? 0 : 1;\n }\n return mode;\n }", "public boolean isSetMode() {\n return this.mode != null;\n }", "static int type_of_ora(String passed){\n\t\tif(general_registers.contains(passed.charAt(4)))\n\t\t\treturn 1;\n\t\telse if(passed.charAt(4)=='M')\n\t\t\treturn 2;\n\t\telse\n\t\t\treturn 0;\n\t}", "private static boolean contains(int[] modes, int mode) {\n if (modes == null) {\n return false;\n }\n for (int i : modes) {\n if (i == mode) {\n return true;\n }\n }\n return false;\n }", "String getACModeName();", "int getOperatingMode();", "public Mode getMode();", "private static void SetMode() {\n Enum[] modes = {Mode.SINGLEPLAYER, Mode.MULTIPLAYER};\r\n // setting GameMode by passing in array to validator which will prompt what Enum is wanted\r\n Game.GameMode = (Mode) Validator.Mode(modes);\r\n }", "public IModeParser getMode();", "int getACMode();", "@Test\n\tpublic void testChordModes(){\n\t\ttry{\n\t\t\tchord = new Chord(1, \"b1\");\n\t\t\tassertEquals(1, chord.getRoot());\n\t\t\tassertEquals(\"b\", chord.getMode());\n\n\t\t\tchord = new Chord(1, \"S(3)4\");\n\t\t\tassertEquals(4, chord.getRoot());\n\t\t\tassertEquals(\"s(3)\", chord.getMode());\n\n\t\t\tchord = new Chord(6, \"5\");\n\t\t\tassertEquals(\"\", chord.getMode());\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tfail(e.getMessage());\n\t\t}\n\t}", "public void setMode(String mode) \n\t{\n\t\tthis.mode = string2Octal(mode);\n\t}", "private static Boolean contains(int[] modes, int mode) {\n if (modes == null) {\n return false;\n\n }\n for (int i : modes) {\n if (i == mode) {\n return true;\n }\n }\n return false;\n }", "String getMiscModesString();", "@Override\n\tpublic String getMode() {\n\t\treturn this.mode;\n\t}", "public String getModeName() {\n return modeName;\n }", "private static String mode() {\n return System.getProperty(SYSTEM_PROPERTY_NAME, System.getenv(ENV_VARIABLE_NAME));\n }", "public Check(Mode mode) {\n init();\n setMode(mode);\n }", "public String getMode() {\n\t\treturn (String) getStateHelper().eval(OutputSourceCodePropertyKeys.mode, null);\n\t}", "private boolean checkDeviceName(String name) {\n switch (name) {\n case \"LAPTOP\" :\n case \"PRINTER\" :\n case \"ROUTER\" :\n return true;\n default:\n return false;\n }\n }", "private boolean legalTransmitionMode() { \n \tboolean illegal=false;\n \tswitch(kind) {\n \t case Simple: \n \t\t if(type==Type.Text) break; // Simple Text\t \n \t\t else if(type.isReferenceType()) { if(mode==Parameter.Mode.value) illegal=true; } // Simple ref(ClassIdentifier)\n \t\t else if(mode==null) mode=Parameter.Mode.value; // Simple Type Integer, Real, Character\n \t\t break;\n \t case Array:\n \t \tif(type.isReferenceType() && mode==Parameter.Mode.value) illegal=true;\n \t \tbreak;\n \t case Procedure:\n \t case Label:\n \t \tif(mode==Parameter.Mode.value) illegal=true;\n \t \tbreak;\n \t default:\t\n \t}\n \treturn(!illegal);\n\t}", "public static boolean m3188a(Context context, String str, boolean z) {\n try {\n context = context.getPackageManager().getPackageInfo(context.getPackageName(), KeycodeConstants.META_CTRL_ON);\n if (context.requestedPermissions != null) {\n for (String str2 : context.requestedPermissions) {\n if (z) {\n if (str2.equalsIgnoreCase(str)) {\n return true;\n }\n } else if (str2.startsWith(str)) {\n return true;\n }\n }\n }\n } catch (Exception e) {\n C0784a.m3252a(C0766d.class, e);\n }\n return false;\n }", "private boolean matchModes(QName m1, QName m2) {\n/* 133 */ return ((null == m1 && null == m2) || (null != m1 && null != m2 && m1.equals(m2)));\n/* */ }", "@Override\r\n\tpublic String getModeName()\r\n\t{\r\n\t\treturn MODE_NAME;\r\n\t}", "private void handle_mode_display() {\n\t\t\t\n\t\t}", "private String getMode(Resource renderletDef) {\n\t\tIterator<Triple> renderletModeIter = configGraph.filter(\n\t\t\t\t(NonLiteral) renderletDef, TYPERENDERING.renderingMode, null);\n\t\tif (renderletModeIter.hasNext()) {\n\t\t\tTypedLiteral renderletMode = (TypedLiteral) renderletModeIter.next().getObject();\n\t\t\treturn LiteralFactory.getInstance().createObject(String.class,\n\t\t\t\t\trenderletMode);\n\t\t}\n\t\treturn null;\n\t}", "public static boolean modeExpression(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"modeExpression\")) return false;\n if (!nextTokenIs(b, MODE)) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = consumeTokens(b, 0, MODE, EQ);\n r = r && modeExpression_2(b, l + 1);\n exit_section_(b, m, MODE_EXPRESSION, r);\n return r;\n }", "public boolean isCorrect(String str);", "public boolean isValid (String c)\n {\n\tif (c.equals (\"f\") || c.equals (\"F\") || c.equals (\"Fire\") || c.equals (\"FIRE\") || c.equals (\"fire\") || c.equals (\"Water\") || c.equals (\"water\") || c.equals (\"WATER\") || c.equals (\"W\") || c.equals (\"w\") || c.equals (\"GRASS\") || c.equals (\"grass\") || c.equals (\"Grass\") || c.equals (\"G\") || c.equals (\"g\"))\n\t return true;\n\telse\n\t return false;\n }", "public String getProgramModeAsString() {\n return getProgramMode().name();\n }", "public boolean canProvideString();", "public boolean isSetModeID() {\n return (this.modeID != null ? this.modeID.isSetValue() : false);\n }", "public synchronized static boolean removeMode(String name) {\n\n\tCaselessStringKey key = new CaselessStringKey(name);\n\n\tif (immutableNames.contains(key))\n\t return false;\n\n\treturn registryModes.remove(key) != null;\n }", "public boolean clineIsValid(String cmd) {\n\t\tString [] parsedCmd = RunCommand.stripAndSplit(cmd);\r\n\t\tString opName = \"\";\r\n\t\tboolean flag_out = false;\r\n\t\tfor (String element: parsedCmd) {\r\n\t\t\tif (flag_out) {\r\n\t\t\t\topName = FileInfo.fileName(element);\r\n\t\t\t\tflag_out = false;\r\n\t\t\t}\r\n\t\t\tflag_out = element.equals(\"--out\");\r\n\t\t}\r\n\t\treturn (opName != \"\");\r\n\t}", "GameMode mode();", "public boolean isCorrectExtFormat( String extension ) {\n try {\n int ext = Integer.parseInt( extension );\n } catch ( Exception e ){\n return false;\n }\n return true;\n }", "String getOperatingModeName();", "private boolean isStringValid(String s){\n int[] result = getLeftRightCount(s);\n return result[0] == 0 && result[1] == 0;\n }", "boolean hasScStr();", "public boolean isInputValid(ConversationContext context, String s)\r\n/* */ {\r\n/* 135 */ return (s.equalsIgnoreCase(\"one\")) || (s.equals(\"1\")) || (s.equalsIgnoreCase(\"two\")) || (s.equals(\"2\")) || (s.equalsIgnoreCase(\"zero\")) || (s.equals(\"0\"));\r\n/* */ }", "public static boolean checkInput(String response) {\r\n\t\t\r\n\r\n\t\tif(response.length() != 1)\r\n\t\t\treturn false;\r\n\t\t\r\n\t\tswitch(response) {\r\n\t\tcase \"y\":\r\n\t\tcase \"Y\":return true;\r\n\t\tcase \"n\":\r\n\t\tcase \"N\":return true;\r\n\t\tdefault: return false;\r\n\t\t}\r\n\t\t\r\n\t}", "@Test\n public void testEmptyString() {\n assertEquals(\"Should return false\", false, val.validateTransportationModes(\"\"));\n }", "static int type_of_sub(String passed){\n\t\tif(general_registers.contains(passed.charAt(4)))\n\t\t\treturn 1;\n\t\telse if(passed.charAt(4)=='M')\n\t\t\treturn 2;\n\t\telse\n\t\t\treturn 0;\n\t}", "static int type_of_cmp(String passed){\n\t\tif(general_registers.contains(passed.charAt(4)))\n\t\t\treturn 1;\n\t\telse if(passed.charAt(4)=='M')\n\t\t\treturn 2;\n\t\telse\n\t\t\treturn 0;\n\t}", "public int getMode() {\n return mode;\n }", "public boolean isFileInEditMode(String filename)\n {\n try\n {\n waitForWindow(getWaitWindow());\n }\n catch (Exception e)\n {\n // no need to handle this exception, function will always return a boolean value bellow\n }\n return Arrays.asList(getLdtp().getWindowList()).contains(\"frm\" + filename);\n }", "boolean isAccess(char access);", "public static boolean validAtom(char atom)\n\t{\n\t\tchar temp = Character.toUpperCase(atom);\n\t\treturn temp == 'C' || temp == 'H' || temp == 'O';\n\t}", "static int type_of_mvi(String passed){\n\t\tif(passed.charAt(4)!='M')\n\t\t\treturn 1;\n\t\telse if(general_registers.contains(passed.charAt(4)))\n\t\t\treturn 2;\n\t\telse\n\t\t\treturn 0;\n\t}", "public static boolean tryTest(String testName, int mode) {\n\t\ttry{\n\t\t\tString arg[] = null;\n\n\t\t\tif (mode == 0) {\n\t\t\t\targ = new String[1];\n\t\t\t\targ[0] = testName + \".c\";\n\n\t\t\t} \n\t\t\telse if (mode == 1) {\n\t\t\t\targ = new String[2];\n\t\t\t\targ[0] = \"-O\";\n\t\t\t\targ[1] = testName + \".c\";\n\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.err.println(\"TRYTEST: unsupported mode \" + mode);\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\n\t\t\tString logName = testName + \".log\";\n\t\t\tPrintStream flog = new PrintStream(new FileOutputStream(new File(logName), false));\n\t\t\tSystem.setOut(new PrintStream(flog));\n\t\t\tmycc.parser.main(arg);\n\n\t\t\t// System.out.println(\"** Decompiling \" + testName + \".class **\");\n\t\t\t// systemCmd(\"javap -c\" + testName);\n\n\t\t\tSystem.out.println(\"** Executing \" + testName + \".class **\");\n\t\t\tsystemCmd(\"java \" + testName);\n\n\t\t\tflog.flush();\n\t\t\tflog.close();\n\n\t\t\treturn true;\n\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(\"Caught exception: \" + e);\n\t\t\te.printStackTrace();\n\t\t\tSystem.err.println();\n\t\t}\n\t\treturn false;\n\t}", "private boolean isValidMenuOption(String option, char optionLimit)\r\n {\r\n option = option.trim();\r\n if (option.length() == 1 && option.charAt(0) >= '1' && option.charAt(0) <= optionLimit)\r\n return true;\r\n else \r\n return false;\r\n }", "public int getMode() {\n\t\treturn this.mode;\n\t}", "protected boolean checkFormat() {\n\t\t// Read the card contents and check that all is ok.\n\t byte[] memory = utils.readMemory();\n\t if (memory == null)\n\t return false;\n\t \n\t // Check the application tag.\n\t for (int i = 1; i < 4; i++)\n\t if (memory[4 * 4 + i] != applicationTag[i])\n\t return false;\n\t \n\t // Check zeros. Ignore page 36 and up because of the safe mode.\n\t for (int i = 5 * 4; i < 36 * 4; i++)\n\t if (memory[i] != 0)\n\t return false;\n\t \n\t // Check that the memory pages 4..39 are not locked.\n\t // Lock 0: Check lock status for pages 4-7\n\t if (memory[2 * 4 + 2] != 0) \n\t return false;\n\t // Lock 1: \n\t if (memory[2 * 4 + 3] != 0)\n\t return false;\n\t // Lock 2:\n\t if (memory[40 * 4] != 0)\n\t \t\treturn false;\n\t // Lock 1:\n\t if (memory[40 * 4 + 1] != 0)\n\t \t\treturn false;\n\t \n\t return true;\n\t}", "private boolean changeModes() {\n\n\t\tif (fieldsChanged) {\n\t\t\tMessageBox mbWarning = new MessageBox(getShell(),\n\t\t\t\t\tSWT.ICON_WARNING | SWT.YES | SWT.NO | SWT.CANCEL);\n\t\t\tmbWarning.setText(\"iDART: Save Changes?\");\n\t\t\tmbWarning\n\t\t\t.setMessage(\"You have not saved your changes. Would you like to save your changes?\");\n\t\t\tswitch( mbWarning.open()) {\n\n\t\t\t// proceed but save changes\n\t\t\tcase SWT.YES:\n\t\t\t\tcmdSaveWidgetSelected();\n\t\t\t\treturn true;\n\t\t\t\t// proceed without saving changes\n\t\t\tcase SWT.NO:\n\t\t\t\treturn true;\n\t\t\t\t// remain in current mode\n\t\t\tcase SWT.CANCEL:\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// proceed to next mode\n\t\treturn true;\n\t}", "@Override\n public boolean isSupportedMode(final SetupMode modeParam) {\n return true;\n }", "public boolean validOperator(char op){\n switch(op){\n case '+':\n case '-':\n case '*':\n case '/':\n case '^':\n case ')':\n case '(':\n return true;\n }\n\n return false;\n }", "public void setMode(int inMode) {\n mode = inMode;\n }", "private static Boolean errorCheck(String Buffer){\n if(Buffer.matches(\"Y\")) return true;\n if(Buffer.matches(\"N\")) return false;\n screenClear(); //Clears the screen and applies an error message.\n return moreInput(); //Recursive repeat upon error.\n }", "public boolean is(String strIn) {\n for (char ch: allOps) {\n if (strIn.equals(ch + \"\")){\n return true;\n }\n }\n return false;\n }", "protected abstract boolean isValidOption(String option);" ]
[ "0.7071382", "0.6968641", "0.67482287", "0.67454547", "0.62222964", "0.6131625", "0.606369", "0.6018974", "0.5990011", "0.58819467", "0.5828322", "0.58154917", "0.5799873", "0.57898057", "0.57680464", "0.5761016", "0.5760183", "0.5748193", "0.5722793", "0.56863564", "0.5685444", "0.5677165", "0.5659449", "0.5647257", "0.56362784", "0.5629282", "0.5625253", "0.5625253", "0.56251955", "0.55964416", "0.55742264", "0.5545202", "0.55366707", "0.55202675", "0.550679", "0.548964", "0.54636955", "0.5449808", "0.544852", "0.5447945", "0.5435448", "0.54124326", "0.5411235", "0.5410658", "0.5407684", "0.5395014", "0.53936315", "0.5390476", "0.5371196", "0.53665364", "0.5365871", "0.53648674", "0.5357272", "0.53563106", "0.5351912", "0.53506935", "0.5325301", "0.532445", "0.5312838", "0.5291071", "0.52805465", "0.5273667", "0.5259733", "0.52596873", "0.52544546", "0.5243241", "0.52351886", "0.52343464", "0.5224447", "0.5196006", "0.518623", "0.5185652", "0.5179102", "0.5169938", "0.5161659", "0.51468873", "0.51348704", "0.51314163", "0.51244736", "0.51238364", "0.5122859", "0.5119816", "0.50976336", "0.50956804", "0.5082175", "0.50772345", "0.50757504", "0.50720954", "0.50704426", "0.50610495", "0.504926", "0.50458413", "0.503678", "0.5030966", "0.5029328", "0.50269043", "0.50254536", "0.50250274", "0.5023333", "0.5022356" ]
0.71614265
0
Primeiro precisamos copiar o tabuleiro pra podermos brincar direito
private void copiaTabuleiro () { Tabuleiro tab = Tabuleiro.getTabuleiro (); for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) Casa.copia (casa[i][j], tab.getCasa (i, j)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void writeIntoCSVFromTable() {\n try {\n backItUp(ROOT);\n backItUp(ROOT + Calendar.getInstance().getTime() + \"/\");\n } catch (Throwable e) {\n itsLogger.error(e.getMessage(), e);\n }\n\n }", "public void copiarComprobanteContabilidad() {\r\n if (!tab_tabla1.isFilaInsertada()) {\r\n TablaGenerica tab_cabecera = ser_comprobante.getCabeceraComprobante(tab_tabla1.getValorSeleccionado());\r\n TablaGenerica tab_detalle = ser_comprobante.getDetallesComprobante(tab_tabla1.getValorSeleccionado());\r\n tab_tabla1.insertar();\r\n tab_tabla1.setValor(\"IDE_MODU\", tab_cabecera.getValor(\"IDE_MODU\"));\r\n tab_tabla1.setValor(\"IDE_GEPER\", tab_cabecera.getValor(\"IDE_GEPER\"));\r\n tab_tabla1.setValor(\"OBSERVACION_CNCCC\", tab_cabecera.getValor(\"OBSERVACION_CNCCC\"));\r\n tab_tabla1.setValor(\"ide_cntcm\", tab_cabecera.getValor(\"ide_cntcm\"));\r\n for (int i = 0; i < tab_detalle.getTotalFilas(); i++) {\r\n tab_tabla2.insertar();\r\n tab_tabla2.setValor(\"IDE_CNLAP\", tab_detalle.getValor(i, \"IDE_CNLAP\"));\r\n tab_tabla2.setValor(\"IDE_CNDPC\", tab_detalle.getValor(i, \"IDE_CNDPC\"));\r\n tab_tabla2.setValor(\"VALOR_CNDCC\", tab_detalle.getValor(i, \"VALOR_CNDCC\"));\r\n tab_tabla2.setValor(\"OBSERVACION_CNDCC\", tab_detalle.getValor(i, \"OBSERVACION_CNDCC\"));\r\n }\r\n calcularTotal();\r\n utilitario.addUpdate(\"gri_totales\");\r\n } else {\r\n utilitario.agregarMensajeInfo(\"No se puede copiar el comprobante de contabilidad\", \"El comprobante seleccionado no se encuentra grabado\");\r\n }\r\n }", "private void preencheTable(){\n\t\t\n\t\tlistaArquivos.setItemCount(0);\n\t\t\n\t\tfor(File f : arquivos){\n\t\t\tTableItem it = new TableItem(listaArquivos, SWT.NONE);\n\t\t\tit.setText(0, f.getName());\n\t\t\tit.setText(1, formataDouble(f.length()));\n\t\t\tit.setText(2, formataData(f.lastModified()));\n\t\t}\n\t\t\n\t}", "private void cargarTabla() {\n\t\tObject[] fila = new Object[7];\r\n\t\tfila[1] = txtCedula.getText();\r\n\t\tfila[2] = txtFuncionario.getText();\r\n\t\tfila[3] = util.getDateToString(dcDesde.getDate());\r\n\t\tif (cbTipo.getSelectedIndex() == 1 || cbTipo.getSelectedIndex() == 2) {\r\n\t\t\tfila[4] = util.getDateToString(dcDesde.getDate());\r\n\t\t} else {\r\n\t\t\tfila[4] = util.getDateToString(dcHasta.getDate());\r\n\t\t}\r\n\t\tfila[5] = cbTipo.getSelectedItem();\r\n\t\tfila[6] = txtMotivo.getText().toUpperCase();\r\n\t\tthis.modelo.addRow(fila);\r\n\t\ttbJustificaciones.setModel(this.modelo);\r\n\t}", "public void preenchercomlike(){\n \n \n javax.swing.table.DefaultTableModel dtm4 = (javax.swing.table.DefaultTableModel)jtablearquivos.getModel(); \n dtm4.setNumRows(0); \n \n int k=0;\n try{\n conexao.Conectar();\n conexao.sql = \"SELECT data,nomefile FROM arquivo WHERE nomefile LIKE ? \";\n conexao.ps = conexao.con.prepareStatement(conexao.sql); \n ps.setString(1,\"%\"+jTextField2.getText()+\"%\");\n conexao.rs = conexao.ps.executeQuery();\n \n \n \n while(conexao.rs.next())\n {\n \n dtm4.addRow(new Object[]{\" \",\" \",\" \"}); \n jtablearquivos.setValueAt(conexao.rs.getString(1),k,0); \n jtablearquivos.setValueAt(conexao.rs.getString(2),k,1); \n k++;\n }\n \n \n }catch(SQLException ex){\n JOptionPane.showMessageDialog(rootPane, ex.getMessage(), \"Erro ao popular tabelas!\", JOptionPane.ERROR_MESSAGE);\n }\n \n }", "private void copyData(CopyTable table) throws Exception\n\t{\n\t\tLOG.info(\"Starting with copy of data from '\" + table.getDescription() + \"' to disk...\");\n\t\t\n\t\t// select data from source database\n\t\tStatement selectStmt =\n\t\t\tCopyToolConnectionManager.getInstance().getSourceConnection(table.getSource()).createStatement();\n\n\t\t// get number of rows in table\n\t\tResultSet resultSet =\n\t\t\tselectStmt.executeQuery(table.generateCountQuery());\n\t\tresultSet.next();\n\t\t\n\t\tlong rowCount = resultSet.getLong(1);\n\t\tLOG.info(\"Found \" + rowCount + \" rows in '\" + table.getDescription() + \"'\");\n\t\t\n\t\tresultSet.close();\n\t\t\n\t\t// get all data from table\n\t\tresultSet = selectStmt.executeQuery(table.generateSelectQuery());\n\n\t\t// get meta data (column info and such)\n\t\tResultSetMetaData metaData = resultSet.getMetaData();\n\t\t\n\t\tString tmpDir = config.getTempDirectory();\n\t\t\n\t\tString tmpFilePrefix = table.getTempFilePrefix();\n\t\t\n\t\t// serialize meta data to disk\n\t\tFile metaDataFile = new File(tmpDir, tmpFilePrefix + \"_metadata.ser\");\n\t\tFileOutputStream fileOut = new FileOutputStream(metaDataFile);\n\t\tObjectOutputStream out = new ObjectOutputStream(fileOut);\n\t\tout.writeObject(new SerializableResultSetMetaData(metaData));\n\t\tout.close();\n\t\tfileOut.close();\n\t\tLOG.info(\"Serialized metadata to temp file: \" + metaDataFile.getAbsolutePath());\n\t\n\t\t\n\t\tif (rowCount == 0)\n\t\t{\n\t\t\twriteInsertCountFile(tmpDir, tmpFilePrefix, 0L);\n\t\t\tLOG.info(\"Finished copying data of '{}' to disk (no data to copy)\", table.getDescription());\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// write data to disk\n\t\tFile temp = new File(tmpDir, tmpFilePrefix + \"_data.csv\");\t\t\n\t\tLOG.info(\"Writing data to temp file: \" + temp.getAbsolutePath());\n\t\t\n\t\tBufferedWriter bw = new BufferedWriter\n\t\t\t (new OutputStreamWriter(new FileOutputStream(temp), \"UTF-8\"));\n\n\t\tlong startTime = System.currentTimeMillis();\n\t\tlong insertCount = 0;\n\t\tint columnCount = metaData.getColumnCount();\n\t\t\n\t\twhile (resultSet.next())\n\t\t{\n\t\t\tfor (int i = 1; i <= columnCount; i++)\n\t\t\t{\n\t\t\t\tObject value = resultSet.getObject(i);\n\n\t\t\t\tif (value == null)\n\t\t\t\t{\n\t\t\t\t\tbw.write(NULL_VALUE);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tString valueStr;\n\t\t\t\t\tif (value instanceof BigDecimal)\n\t\t\t\t\t{\n\t\t\t\t\t\tvalueStr = ((BigDecimal)value).toPlainString();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvalueStr = value.toString();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (table.isAutoTrim())\n\t\t\t\t\t\tvalueStr = valueStr.trim();\n\n\t\t\t\t\t// escape \\ with \\\\\n\t\t\t\t\tvalueStr = valueStr.replaceAll(\"\\\\\\\\\", \"\\\\\\\\\\\\\\\\\");\n\n\t\t\t\t\t// escape \" with \\\"\n\t\t\t\t\tvalueStr = valueStr.replaceAll(\"\\\"\", \"\\\\\\\\\\\"\");\n\t\t\t\t\t\n\t\t\t\t\tbw.write(\"\\\"\" + valueStr + \"\\\"\");\n\t\t\t\t}\t\t\t\n\n\t\t\t\t// column separator (not for last column)\n\t\t\t\tif (i < columnCount)\n\t\t\t\t{\n\t\t\t\t\tbw.write(\",\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// record separator\n\t\t\tbw.newLine();\n\n\t\t\tinsertCount++;\n\n\t\t\tif (insertCount % 100000 == 0)\n\t\t\t{\n\t\t\t\tbw.flush();\n\t\t\t\tprintInsertProgress(startTime, insertCount, rowCount, \"written to disk\");\n\t\t\t}\n\t\t}\n\t\tbw.flush();\n\t\tbw.close();\n\t\tprintInsertProgress(startTime, insertCount, rowCount, \"written to disk\");\n\t\t\n\t\twriteInsertCountFile(tmpDir, tmpFilePrefix, insertCount);\n\t\t\n\t\tLOG.info(\"Finished copying data of '\" + table.getDescription() + \"' to disk!\");\n\t}", "public void backupCustom(String... tableName) throws Exception {\n // back up specific files\n QueryDataSet qds = new QueryDataSet(conn);\n for (String str : tableName) {\n\n qds.addTable(str);\n }\n FlatXmlDataSet.write(qds, new FileWriter(backupFile), \"UTF-8\");\n new XlsDataSetWriter().write(qds, new FileOutputStream(backupFile));\n }", "public void borrarTablaCompleta() {\r\n\tvista.getBorrarTabla().addActionListener(r->{\r\n\t\tFile bd= new File(\"Database.db\");\r\n\t\tif(bd.exists() && bd.length()>10){\r\n\t\t\tBorrarDatos.borraTablaEntera(con);\r\n\t\t\tvista.getTxtBarraStatus().setText(\"TABLA ELIMINADA\");\r\n\t\t\ttableModelArte=null;\r\n\t\t\tautoRefresh();\r\n\t\t}else{\r\n\t\t\tvista.getTxtBarraStatus().setText(\"NO HAY NINGUNA TABLA QUE ELIMINAR\");\r\n\t\t}\r\n\t});\r\n\t}", "public static void main_backup(){\n try {\n tableClone = (HiringTable) table.clone();\n System.out.println(\"Successfully created backup.\");\n } catch (CloneNotSupportedException ex){\n System.out.println(\"Clone not successful.\");\n main_menu();\n }\n }", "private void backupToFileButtonClicked(java.awt.event.ActionEvent evt) {\n\t\tbyte[][] colFamilys;\n\n\t\tList<List<HBaseRow>> tableRows;\n\n\t\tfinal JFileChooser fc = new JFileChooser();\n\t\tFile backupFile = null;\n\n\t\tfc.showSaveDialog(this);\n\n\t\tbackupFile = fc.getSelectedFile();\n\n\t\ttry {\n\t\t\tgetLabelFileOperationStatus().setText(\"Backup in progress\");\n\t\t\tfor (int i = 0; i < listSelectedTables.getModel().getSize(); i++) {\n\t\t\t\tString tblName = (String) listSelectedTables.getModel().getElementAt(i);// (String)listSelectedTables.\n\t\t\t\tlistSelectedTables.setSelectedValue(tblName, true);\n\t\t\t\tLogger.getLogger(HbaseDataBackupRestoreDialog.class.getName()).log(Level.INFO, \"Table name: \" + tblName);\n\t\t\t\tHBaseTableStructure tableStructure = new HBaseTableStructure();\n\t\t\t\ttableStructure.createWriteTableStructure(tblName);\n\n\t\t\t\tcolFamilys = tableStructure.getAllColoumnFamilies();\n\n\t\t\t\tResultScanner resultScan = HBaseTableManager.getAllDataInRangeOfFamily(\"0\", \"zz\", colFamilys, tblName);\n\n\t\t\t\ttableRows = this.getDataObjectList(resultScan, colFamilys);\n\n\t\t\t\tIterator<List<HBaseRow>> iterator = tableRows.iterator();\n\t\t\t\tList<HBaseRow> rowList;\n\t\t\t\tList<HbaseTableObject> tableObject = new ArrayList<HbaseTableObject>();\n\t\t\t\twhile (iterator.hasNext()) {\n\n\t\t\t\t\trowList = iterator.next();\n\t\t\t\t\tHbaseTableObject hbTable = new HbaseTableObject();\n\t\t\t\t\tHBaseTableData tableData = new HBaseTableData();\n\n\t\t\t\t\ttableData.setHbaseTableData(rowList);\n\t\t\t\t\thbTable.setTableData(tableData);\n\t\t\t\t\thbTable.setTableStructure(tableStructure);\n\t\t\t\t\thbTable.setLastObject(false);\n\t\t\t\t\thbTable.setLinkedFileAvailable(true);\n\n\t\t\t\t\tif (!iterator.hasNext()) {\n\t\t\t\t\t\thbTable.setLastObject(true);\n\t\t\t\t\t}\n\t\t\t\t\ttableObject.add(hbTable);\n\n\t\t\t\t}\n\n\t\t\t\tFile targetFile = new File(backupFile.getAbsolutePath().concat(\"_\").concat(tblName));\n\n\t\t\t\tBackupRestoreFileUtil fileUtil = new BackupRestoreFileUtil(targetFile);\n\t\t\t\tlong rows = (tableObject.size() - 1) * 20001 + tableObject.get(tableObject.size() - 1).getTableData().getHbaseTableData().size();\n\t\t\t\tthis.getLabelFileOperationStatus().setText(\"Backup Done: ~ \" + rows + \" backed-up\");\n\t\t\t\tfileUtil.backupToFiles(tableObject);\n\n\t\t\t\t// writeObjectFile.writeObject(hbTable);\n\t\t\t\tlistBackupSelectedModel.remove(0);\n\n\t\t\t} // write hbTable to file, object stream;\n\n\t\t\tJOptionPane.showMessageDialog(this, \"Backup Complete. \\n Backup File : \" + fc.getSelectedFile().getName());\n\n\t\t}\n\t\tcatch (Exception ex) {\n\t\t\tJOptionPane.showMessageDialog(this, \"Backup Failed.\", \"Error\", JOptionPane.ERROR_MESSAGE);\n\n\t\t}\n\n\t}", "private void inicializarTablero() {\r\n\t\t\r\n\t\tfor(int i = 0; i < filas; i++) {\r\n\t\t\tfor(int j = 0; j < columnas; j++) {\r\n\t\t\t\tsuperficie[i][j] = null;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void descargarArchivo()throws SQLException, IOException {\n //conexion con el resultset\n st = cn.createStatement();\n\n // consulta de descarga el getId es la variable que utilizo para ubicarme en la base de datos\n ResultSet rs = st.executeQuery(\"select anexo_justi, nombre FROM anexoitem where iditem=\"+rt.getId());\ntry {\n \nrs.next();\n// pone en la variable el nombre del archivo de la base de datos\nnombre= rs.getString(\"nombre\");\n// inserta la ruta completa\nFile file = new File(rt.getPath()+nombre);\n// salida del archivo de flujo\nFileOutputStream output = new FileOutputStream(file);\nBlob archivo = rs.getBlob(1);\nInputStream inStream = archivo.getBinaryStream();\n// almacenamiento del tamaño y descarga byte a byte\nint length= -1;\nint size = (int) archivo.length();\nbyte[] buffer = new byte[size];\nwhile ((length = inStream.read(buffer)) != -1) {\noutput.write(buffer, 0, length);\nJOptionPane.showMessageDialog(null,\"El archivo se descargo correctamente\");\n// output.flush();\n\n}\n// inStream.close();\noutput.close();\n} catch (Exception ioe) {\nthrow new IOException(ioe.getMessage());\n}\n}", "public void exportarapolice(){\n gettableconteudo();\n conexao.Conectar();\n File f = null;\n try {\n conexao.sql = \"SELECT data, nomefile, arquivo FROM arquivo WHERE data = ?\"; \n conexao.ps = conexao.con.prepareStatement(conexao.sql); \n ps.setString(1, id1);\n ResultSet rs = ps.executeQuery(); \n if ( rs.next() ){ \n byte [] bytes = rs.getBytes(\"arquivo\"); \n String nome = rs.getString(\"nomefile\");\n f = new File(\"C:\\\\rubinhosis\\\\exportacoes\\\\\" + nome); \n FileOutputStream fos = new FileOutputStream( f);\n fos.write( bytes ); \n fos.close(); \n }\n rs.close(); \n ps.close(); \n \n \n } catch (SQLException ex) { \n ex.printStackTrace();\n }\n catch (IOException ex) {\n ex.printStackTrace();\n }\n\n}", "private void cargarArchivoAlumnos() {\n String aux = \"\";\n String texto = \"\";\n\n JFileChooser file = new JFileChooser();\n file.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);\n\n //Filtro\n FileNameExtensionFilter filtro = new FileNameExtensionFilter(\"*.XML\", \"xml\");\n\n file.setFileFilter(filtro);\n\n int seleccion = file.showOpenDialog(this);\n\n if (seleccion == JFileChooser.APPROVE_OPTION) {\n File fichero = file.getSelectedFile();\n\n insertarAlumnos(fichero.getPath());\n\n }\n }", "public void cargarTabla(JTable table) {\n\t\tList<CocheTaller> coches = mecanicoController.cargarTablaCocheTaller();\n\t\t\n\t\tString[] columnNames = {\"Marticula\", \"Marca\", \"Modelo\", \"DNI Cliente\", \"Mecanico\", \"Coste\", \"Estado\"};\n\t\t\n\t\tif (!coches.isEmpty()) {\n\t\t\t DefaultTableModel model = new DefaultTableModel();\n\t\t\t table.setModel(model);\n\t\t\t model.setColumnIdentifiers(columnNames);\n\t\t\t \n\t\t\t for (CocheTaller c : coches) {\n\t\t\t\t Object[] o = new Object[7];\n\t\t\t\t o[0] = c.getMatricula();\n\t\t\t\t o[1] = c.getMarca();\n\t\t\t\t o[2] = c.getModelo();\n\t\t\t\t o[3] = c.getDniCliente();\n\t\t\t\t o[4] = c.getMecanico();\n\t\t\t\t o[5] = c.getCoste() + \"€\";\n\t\t\t\t o[6] = mecanicoController.traducirEstado(c.getEstado());\n\t\t\t\t model.addRow(o);\n\t\t\t\t }\n\t\t} else {\n\t\t\tlogger.error(\"No llegan correctamente los CocheTaller\");\n\t\t}\n\t}", "public void cargarTabla(String servidor){\n String base_de_datos1=cbBaseDeDatos.getSelectedItem().toString();\n String sql =\"USE [\"+base_de_datos1+\"]\\n\" +\n \"SELECT name FROM sysobjects where xtype='U' and category <> 2\";\n // JOptionPane.showMessageDialog(null,\"SQL cargarbases \"+sql);\n Conexion cc = new Conexion();\n Connection cn=cc.conectarBase(servidor, base_de_datos1);\n modeloTabla=new DefaultTableModel();\n String fila[]=new String[1] ;\n String[] titulos={\"Tablas\"} ;\n try {\n Statement psd = cn.createStatement();\n ResultSet rs=psd.executeQuery(sql);\n if(modeloTabla.getColumnCount()<2){\n modeloTabla.addColumn(titulos[0]);\n //modeloTabla.addColumn(titulos[1]);\n }\n while(rs.next()){\n fila[0]=rs.getString(\"name\");\n // fila[1]=\"1\";\n modeloTabla.addRow(fila);\n }\n tblTablas.setModel(modeloTabla);\n }catch(Exception ex){\n JOptionPane.showMessageDialog(null, ex+\" al cargar tabla\");\n }\n }", "public String getTablePath(String tableName){\n tableDir = databaseDir + File.separator + \"data\" + File.separator + tableName + \".csv\";\n return tableDir;\n }", "public void descargarArchivoVeri()throws SQLException, IOException {\n //conexion con el resultset\n st = cn.createStatement();\n\n // consulta de descarga el getId es la variable que utilizo para ubicarme en la base de datos\n ResultSet rs = st.executeQuery(\"select anexo_veri, nombre FROM anexoverificacion where idverificacion=\"+rt.getId());\ntry {\n \nrs.next();\n// pone en la variable el nombre del archivo de la base de datos\nnombre= rs.getString(\"nombre\");\n// inserta la ruta completa\nFile file = new File(rt.getPath()+nombre);\n// salida del archivo de flujo\nFileOutputStream output = new FileOutputStream(file);\nBlob archivo = rs.getBlob(1);\nInputStream inStream = archivo.getBinaryStream();\n// almacenamiento del tamaño y descarga byte a byte\nint length= -1;\nint size = (int) archivo.length();\nbyte[] buffer = new byte[size];\nwhile ((length = inStream.read(buffer)) != -1) {\noutput.write(buffer, 0, length);\nJOptionPane.showMessageDialog(null,\"El archivo se descargo correctamente\");\n// output.flush();\n\n}\n// inStream.close();\noutput.close();\n} catch (Exception ioe) {\nthrow new IOException(ioe.getMessage());\n}\n}", "@Test\n public void testCopyTileTable() throws SQLException, IOException {\n AlterTableUtils.testCopyTileTable(activity, geoPackage);\n }", "public static void backup() throws FileNotFoundException, SQLException {\n\n // Laver en dato til vores End Of Days filer i filnavnet\n Date date = new Date();\n String dagensDato = date.toString();\n dagensDato = dagensDato.replaceAll(\" \", \"_\");\n dagensDato = dagensDato.replaceAll(\":\", \"_\");\n\n File file = new File(\"End_Of_Days/End_Of_Day_\" + dagensDato + \".txt\");\n\n try (\n // Laver filen\n PrintWriter output = new PrintWriter(file);\n ) {\n // Initialiserer varibler der skal bruges\n String sql, hentetFnavn, hentetLnavn, hentetAdresse, hentetKonto_type, hentetOvertraeks, hentetUsername;\n int hentetPerson_id, hentetReg_nr, hentetKonto_nr, hentetRentesats, hentetSaldo, hentetOvertraeksgebyr, hentetId, hentetFra_Konto, hentetTil_Konto, hentetPassword;\n double hentetTrukketbelob, hentetIndfortbelob;\n Timestamp hentetTimestamp;\n\n\n output.println(\"Person_id \\t\\t fnavn \\t\\t lnavn \\t\\t adresse\");\n output.println(\"------------------------------------------------\");\n\n // Henter bruger tabelen\n stmt = con.createStatement();\n sql = \"SELECT * FROM bruger\";\n ResultSet rs = stmt.executeQuery(sql);\n while (rs.next()) { // Indsaetter raekkerne fra bruger tabelen ind i tekstfilen\n hentetPerson_id = rs.getInt(1);\n hentetFnavn = rs.getNString(2);\n hentetLnavn = rs.getNString(3);\n hentetAdresse = rs.getNString(4);\n output.print(hentetPerson_id + \"\\t\\t\" + hentetFnavn + \"\\t\\t\" + hentetLnavn + \"\\t\\t\" + hentetAdresse + \"\\n\");\n }\n\n output.println();\n output.println(\"Konto_type \\t\\t reg_nr \\t\\t konto_nr \\t\\t rentesats \\t\\t saldo \\t\\t overtraeksgebyr \\t\\t overtraek \\t\\t id\");\n output.println(\"------------------------------------------------------------------------------------------------------------------------------------\");\n\n // Henter konto tabelen\n stmt = con.createStatement();\n sql = \"SELECT * FROM konto\";\n rs = stmt.executeQuery(sql);\n while (rs.next()) { // Indsaetter raekkerne fra konto tabelen ind i tekstfilen\n hentetKonto_type = rs.getNString(1);\n hentetReg_nr = rs.getInt(2);\n hentetKonto_nr = rs.getInt(3);\n hentetRentesats = rs.getInt(4);\n hentetSaldo = rs.getInt(5);\n hentetOvertraeksgebyr = rs.getInt(6);\n hentetOvertraeks = rs.getNString(7);\n hentetId = rs.getInt(8);\n output.print(hentetKonto_type + \"\\t\\t\" + hentetReg_nr + \"\\t\\t\" + hentetKonto_nr + \"\\t\\t\" + hentetRentesats + \"\\t\\t\" + hentetSaldo + \"\\t\\t\" + hentetOvertraeksgebyr + \"\\t\\t\" + hentetOvertraeks + \"\\t\\t\" + hentetId + \"\\n\");\n }\n\n output.println();\n output.println(\"id \\t\\t Fra_Konto \\t\\t Trukketbeløb \\t\\t Til_kontoNr \\t\\t Indførtbeløb \\t\\t Timestamp\");\n output.println(\"------------------------------------------------------------------------------------------------------------------------------------\");\n\n // Henter transactioner tabelen\n stmt = con.createStatement();\n sql = \"SELECT * FROM transactioner\";\n rs = stmt.executeQuery(sql);\n while (rs.next()) { // Indsaetter raekkerne fra transactioner tabelen ind i tekstfilen\n hentetId = rs.getInt(1);\n hentetFra_Konto = rs.getInt(2);\n hentetTrukketbelob = rs.getDouble(3);\n hentetTil_Konto = rs.getInt(4);\n hentetIndfortbelob = rs.getDouble(5);\n hentetTimestamp = rs.getTimestamp(6);\n output.print(hentetId + \"\\t\\t\" + hentetFra_Konto + \"\\t\\t\" + hentetTrukketbelob + \"\\t\\t\" + hentetTil_Konto + \"\\t\\t\" + hentetIndfortbelob + \"\\t\\t\" + hentetTimestamp + \"\\n\");\n }\n\n output.println();\n output.println(\"username \\t\\t password\");\n output.println(\"------------------------------------------------------------------------------------------------------------------------------------\");\n\n // Henter login tabelen\n stmt = con.createStatement();\n sql = \"SELECT * FROM login\";\n rs = stmt.executeQuery(sql);\n while (rs.next()) { // Indsaetter raekkerne fra login tabelen ind i tekstfilen\n hentetUsername = rs.getNString(1);\n hentetPassword = rs.getInt(2);\n output.print(hentetUsername + \"\\t\\t\" + hentetPassword + \"\\n\");\n }\n\n }\n System.out.println(\"End Of Days backup successful!\");\n }", "public void writeTable(Table table, String pathName, String filename){\n\n Record tempRow; \n String tempString;\n FileWriter fw;\n\n //create file\n try {\n fw = new FileWriter(pathName + filename);\n \n //add table name\n fw.write(table.getName());\n fw.write(\"\\n\");\n\n //add each row to a new line\n //get primary keys and loop over to add rows\n List<String> keys = table.getPrimaryKeys();\n for (int i = 0; i < keys.size(); i++){\n tempRow = table.getRow(keys.get(i));\n tempString = tempRow.getAllItemString();\n fw.write(tempString);\n fw.write(\"\\n\");\n }\n\n fw.close();\n } catch (IOException ex){\n System.out.println(\"ERROR: failed to create file \" + filename);\n }\n }", "public void gettableconteudo(){\n \n int selecionada = jtablearquivos.getSelectedRow();\n if (selecionada == -1) {\n JOptionPane.showMessageDialog(null,\" Arquivo não selecionado corretamente !\");\n } \n String id = jtablearquivos.getValueAt(selecionada, 0).toString();\n id1 = id;\n String titulo = jtablearquivos.getValueAt(selecionada, 1).toString();\n titulo1 = titulo;\n \n \n \n }", "private EstabelecimentoTable() {\n\t\t\t}", "private void cargarTablaConPaquetes() {\n tcId.setCellValueFactory(\n new PropertyValueFactory<Paquete, String>(\"codigo\"));\n tcdescripcion.setCellValueFactory(\n new PropertyValueFactory<Paquete, String>(\"descripcion\"));\n tcDestino.setCellValueFactory(\n new PropertyValueFactory<Paquete, String>(\"destino\"));\n tcEntregado.setCellValueFactory(\n new PropertyValueFactory<Paquete, Boolean>(\"entregado\"));\n\n tbPaqueteria.setItems(data);\n tbPaqueteria.getSelectionModel().selectFirst();\n\n //TODO futura implementacion\n //setDobleClickFila();\n }", "public void llenadoDeTablas() {\n \n DefaultTableModel modelo1 = new DefaultTableModel();\n modelo1 = new DefaultTableModel();\n modelo1.addColumn(\"ID Usuario\");\n modelo1.addColumn(\"NOMBRE\");\n UsuarioDAO asignaciondao = new UsuarioDAO();\n List<Usuario> asignaciones = asignaciondao.select();\n TablaPerfiles.setModel(modelo1);\n String[] dato = new String[2];\n for (int i = 0; i < asignaciones.size(); i++) {\n dato[0] = (Integer.toString(asignaciones.get(i).getId_usuario()));\n dato[1] = asignaciones.get(i).getNombre_usuario();\n\n modelo1.addRow(dato);\n }\n }", "private void preencherTabela() {\n\t\tList<Cidade> listCidade;\n\t\tCidadeDAO cidadeDAO;\n\t\tObservableList<Cidade> oListCidade;\n\n\t\t// Determina os atributos que irão preencher as colunas\n\t\tcolCidade.setCellValueFactory(new PropertyValueFactory<>(\"nomeCidades\"));\n\t\tcolEstado.setCellValueFactory(new PropertyValueFactory<>(\"nomeEstado\"));\n\t\tcolSigla.setCellValueFactory(new PropertyValueFactory<>(\"siglaEstado\"));\n\t\tcolCodigoCidade.setCellValueFactory(new PropertyValueFactory<>(\"idCidade\"));\n\t\tcolIdEstado.setCellValueFactory(new PropertyValueFactory<>(\"idEstado\"));\n\n\t\t// Instancia a lista de cidades e a DAO\n\t\tlistCidade = new ArrayList<Cidade>();\n\t\tcidadeDAO = new CidadeDAO();\n\n\t\t// Chama o metodo para selecionar todas as cidades e atribuir a lista\n\t\tlistCidade = cidadeDAO.selecionar();\n\n\t\t// Converte a lista de cidades em observablearray\n\t\toListCidade = FXCollections.observableArrayList(listCidade);\n\n\t\t// Adiciona a lista na tabela\n\t\ttblCidades.setItems(oListCidade);\n\t}", "private void BackupActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BackupActionPerformed\n try{\n BufferedWriter writer = new BufferedWriter(new FileWriter(\"salvare.sql\"));\n Vector allData = getData(\"\");\n\n for(int row = 0; row < allData.size(); ++row){\n Person data = (Person)allData.elementAt(row);\n\n String sql = \"insert into \" + tableName + \" values ('\" + data.getName() + \"' , '\" +\n data.getCity() + \"' , '\" + data.getPhone() + \"');\";\n writer.write(sql);\n writer.newLine();\n }\n writer.close();\n JOptionPane.showMessageDialog(this, \"Salvare cu succes!\" , \"salvare\", JOptionPane.INFORMATION_MESSAGE);\n }catch(Exception e){\n JOptionPane.showMessageDialog(this, \"O eroare la salvarea fisierului!\" , \"formWindowOpened\", JOptionPane.ERROR_MESSAGE);\n }\n}", "private void createGoogleDriveFilesTable(){\n cellTableOfGoogleDriveFile.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);\n\n // Add a text columns to show the details.\n TextColumn<GoogleDriveFile> columnFirstLine = new TextColumn<GoogleDriveFile>() {\n @Override\n public String getValue(GoogleDriveFile object) {\n return object.getId();\n }\n };\n cellTableOfGoogleDriveFile.addColumn(columnFirstLine, \"ID\");\n\n TextColumn<GoogleDriveFile> columnSecondLine = new TextColumn<GoogleDriveFile>() {\n @Override\n public String getValue(GoogleDriveFile object) {\n return object.getName();\n }\n };\n cellTableOfGoogleDriveFile.addColumn(columnSecondLine, \"Name\");\n\n TextColumn<GoogleDriveFile> townColumn = new TextColumn<GoogleDriveFile>() {\n @Override\n public String getValue(GoogleDriveFile object) {\n return object.getKind();\n }\n };\n cellTableOfGoogleDriveFile.addColumn(townColumn, \"Kind\");\n\n TextColumn<GoogleDriveFile> countryColumn = new TextColumn<GoogleDriveFile>() {\n @Override\n public String getValue(GoogleDriveFile object) {\n return object.getMimeType();\n }\n };\n cellTableOfGoogleDriveFile.addColumn(countryColumn, \"MimeType\");\n\n final SingleSelectionModel<GoogleDriveFile> selectionModel = new SingleSelectionModel<>();\n cellTableOfGoogleDriveFile.setSelectionModel(selectionModel);\n }", "public void preencherTabela(){\n imagemEnunciado.setImage(imageDefault);\n pergunta.setImagemEnunciado(caminho);\n imagemResposta.setImage(imageDefault);\n pergunta.setImagemResposta(caminho);\n ///////////////////////////////\n perguntas = dao.read();\n if(perguntas != null){\n perguntasFormatadas = FXCollections.observableList(perguntas);\n\n tablePerguntas.setItems(perguntasFormatadas);\n }\n \n }", "private boolean sourceTableMoveObjTable(HttpServletRequest request,String username,String sourceFolder,String ojbFolder,String fileName,String fileType) throws Exception{\n boolean result=false;\n try {\n String sourcePath=request.getSession().getServletContext().getRealPath(\"/\")+REPOSITORY+\"\\\\\"+username+\"\\\\\"+PERSISTENT+\"\\\\\"+sourceFolder;\n String objPath=request.getSession().getServletContext().getRealPath(\"/\")+REPOSITORY+\"\\\\\"+username+\"\\\\\"+PERSISTENT+\"\\\\\"+ojbFolder;\n System.out.println(sourcePath+\"\\\\\"+fileName+\".\"+fileType);\n System.out.println(objPath+\"\\\\\"+fileName+\".\"+fileType);\n File newFile=new File(objPath,fileName+\".\"+fileType);\n File newFilePath=new File(objPath);\n File oldFile=new File(sourcePath,fileName+\".\"+fileType);\n File oldFilePath=new File(sourcePath);\n if(!newFilePath.exists()){\n throw new Exception(\"目标路径不存在!\");\n }\n if(!oldFilePath.exists()){\n throw new Exception(\"源路径不存在!\");\n }\n if(newFile.exists()){\n throw new Exception(\"文件已经在目标路径中存在了!\");\n }\n if(!oldFile.exists()){\n throw new Exception(\"源表不存在!\");\n }\n //文件从源路径移动到目标路径\n Files.copy(oldFile.toPath(),newFile.toPath());\n oldFile.delete();\n result=true;\n }catch (IOException io){\n io.printStackTrace();\n throw new IOException(\"文件移动失败!\");\n }\n return result;\n }", "public void cargarTitulos1() throws SQLException {\n\n tabla1.addColumn(\"CLAVE\");\n tabla1.addColumn(\"NOMBRE\");\n tabla1.addColumn(\"DIAS\");\n tabla1.addColumn(\"ESTATUS\");\n\n this.tbpercep.setModel(tabla1);\n\n TableColumnModel columnModel = tbpercep.getColumnModel();\n\n columnModel.getColumn(0).setPreferredWidth(15);\n columnModel.getColumn(1).setPreferredWidth(150);\n columnModel.getColumn(2).setPreferredWidth(50);\n columnModel.getColumn(3).setPreferredWidth(70);\n\n }", "private void cargarColumnasTabla(){\n \n modeloTabla.addColumn(\"Nombre\");\n modeloTabla.addColumn(\"Telefono\");\n modeloTabla.addColumn(\"Direccion\");\n }", "public void LimpiarJTablaPorFecha()\n {\n for(int i=modeloPorFecha.getRowCount()-1;i>=0;i--)\n {\n modeloPorFecha.removeRow(i); \n }\n }", "public static void updatePOFiles(){\n\t\tfor(TableInfo tableInfo: tables.values()){\n\t\t\tJavaFileUtils.createJavaPOFile(tableInfo,new MySQLTypeConvertor());\n\t\t}\n\t}", "public void tabla_campos() {\n int rec = AgendarA.tblAgricultor.getSelectedRow();// devuelve un entero con la posicion de la seleccion en la tabla\n ccAgricultor = AgendarA.tblAgricultor.getValueAt(rec, 1).toString();\n crearModeloAgenda();\n }", "public synchronized void saveTable() \n\t{\n\t\ttry {\n\t\t\tFileOutputStream fos = new FileOutputStream(tableFile);\n\t\t\t\n\t\t\tObjectOutputStream oos = new ObjectOutputStream(fos);\n\t\t\toos.writeObject(htRecords);\n\t\t\toos.close();\n\t\t\tfos.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\tthrow new RuntimeException(\"Cannot save : FileNotFoundException\",e);\n\t\t} catch (IOException e) {\n\t\t\tthrow new RuntimeException(\"Cannot save : IOException\",e);\n\t\t}\n\t}", "private void carregarTabelaLocatario(ELocatario eLocatario) throws SQLException {\n Vector<Object> cabecalho = new Vector<Object>();\n cabecalho.add(\"Codígo\");\n cabecalho.add(\"Nome\");\n cabecalho.add(\"Endereço\");\n cabecalho.add(\"Telefone\");\n cabecalho.add(\"Tipo Pessoa\");\n cabecalho.add(\"Email\");\n cabecalho.add(\"Tipo CNH\");\n\n Vector detalhe = new Vector();\n\n for (ELocatario item : new NLocatario().listar(eLocatario.getNome())) {\n Vector<Object> linha = new Vector<Object>();\n linha.add(item.getCodigo());\n linha.add(item.getNome());\n linha.add(item.getEndereco());\n linha.add(item.getTelefone());\n linha.add(item.getTipo_pessoa());\n linha.add(item.getEmail());\n linha.add(item.getTipoCNH());\n detalhe.add(linha);\n }\n\n tblLocatario.setModel(new DefaultTableModel(detalhe, cabecalho));\n }", "private void limparTabela() {\n while (tmLivro.getRowCount() > 0) {\n tmLivro.removeRow(0);\n }\n }", "public void createTable() {\n try {\n tableLayout = findViewById(R.id.tabla);\n tb = new TableDinamic(tableLayout, getApplicationContext(), \"cargarDetalle\", clc, cap_1, cap_2, cap_ct, txtidReg, txtId, txtBloque, txtVariedad);\n tableLayout.removeAllViews();\n tb.addHeader(header);\n tb.addData(cargarTabla());\n tb.backgroundHeader(\n Color.parseColor(\"#20C0FF\")\n );\n tb.backgroundData(\n Color.parseColor(\"#FFFFFF\"),\n Color.parseColor(\"#81F0EDED\")\n );\n } catch (Exception e) {\n Toast.makeText(this, \"Error de la table: \" + e.toString(), Toast.LENGTH_LONG).show();\n }\n }", "private static void fillTableFromFile(HashTable table) {\n Scanner in;\n try {\n in = new Scanner(new FileInputStream(\"File.txt\"));\n } catch (FileNotFoundException e) {\n System.out.println(\"File 'File.txt' not found\");\n return;\n }\n while (in.hasNext()) {\n table.add(in.next());\n }\n }", "private static void criarTabela(Connection connection) throws IOException, SQLException {\n final Path sqlFile = Paths.get(\"coursera.sql\");\n String sqlData = new String(Files.readAllBytes(sqlFile));\n Statement statement = connection.createStatement();\n statement.executeUpdate(sqlData);\n statement.close();\n connection.close();\n }", "public void realtorioCli() throws ClassNotFoundException, FileNotFoundException, DocumentException, SQLException {\r\n ContCli cocli = new ContCli();\r\n \r\n\r\n //Instancia um novo documento\r\n Document doc = new Document();\r\n \r\n //Define o local do documento\r\n PdfWriter objpdf = PdfWriter.getInstance(doc, new FileOutputStream(\"relatorioClientes.pdf\"));\r\n doc.open();\r\n PdfPTable tb = new PdfPTable(1);\r\n tb.setWidthPercentage(50);\r\n tb.setHorizontalAlignment(Element.ALIGN_CENTER);\r\n tb.setSpacingAfter(10f);\r\n tb.setSpacingBefore(10f);\r\n \r\n PdfPCell cel = new PdfPCell(new Paragraph(\"Relatório Clientes.\"));\r\n cel.setBorderColor(BaseColor.BLACK);\r\n cel.setPaddingLeft(10);\r\n cel.setHorizontalAlignment(Element.ALIGN_CENTER);\r\n cel.setVerticalAlignment(Element.ALIGN_MIDDLE);\r\n\r\n tb.addCell(cel);\r\n\r\n doc.add(tb);\r\n\r\n try {\r\n PdfPTable tabela = new PdfPTable(4); // 4 colunas.\r\n tabela.setWidthPercentage(100); //largura 100%\r\n tabela.setSpacingBefore(10f); //espaços antes da tabela\r\n tabela.setSpacingAfter(10f); //espaços antes da tabela\r\n\r\n float[] larguraColuna = {1f, 1f, 1f, 1f};\r\n tabela.setWidths(larguraColuna);\r\n\r\n PdfPCell celula01 = new PdfPCell(new Paragraph(\"Código\"));\r\n celula01.setBorderColor(BaseColor.BLACK);\r\n celula01.setPaddingLeft(10);\r\n celula01.setHorizontalAlignment(Element.ALIGN_CENTER);\r\n celula01.setVerticalAlignment(Element.ALIGN_MIDDLE);\r\n\r\n PdfPCell celula02 = new PdfPCell(new Paragraph(\"Nome\"));\r\n celula02.setBorderColor(BaseColor.BLACK);\r\n celula02.setPaddingLeft(10);\r\n celula02.setHorizontalAlignment(Element.ALIGN_CENTER);\r\n celula02.setVerticalAlignment(Element.ALIGN_MIDDLE);\r\n\r\n PdfPCell celula03 = new PdfPCell(new Paragraph(\"CPF\"));\r\n celula03.setBorderColor(BaseColor.BLACK);\r\n celula03.setPaddingLeft(10);\r\n celula03.setHorizontalAlignment(Element.ALIGN_CENTER);\r\n celula03.setVerticalAlignment(Element.ALIGN_MIDDLE);\r\n\r\n PdfPCell celula04 = new PdfPCell(new Paragraph(\"Divida\"));\r\n celula04.setBorderColor(BaseColor.BLACK);\r\n celula04.setPaddingLeft(10);\r\n celula04.setHorizontalAlignment(Element.ALIGN_CENTER);\r\n celula04.setVerticalAlignment(Element.ALIGN_MIDDLE);\r\n tabela.addCell(celula01);\r\n tabela.addCell(celula02);\r\n tabela.addCell(celula03);\r\n tabela.addCell(celula04);\r\n for (Cliente cli : cocli.selecCli()) {\r\n\r\n //Set Column widths\r\n //Para evitar que a borda da célula e o conteúdo se sobreponham, \r\n //se você tiver tendo bordas de células grossas\r\n //celula01.setUserBorderPadding(true);\r\n //celula02.setUserBorderPadding(true);\r\n //celula03.setUserBorderPadding(true);\r\n doc.add(new Paragraph());\r\n\r\n celula01 = new PdfPCell(new Paragraph(\"\" + cli.getCod()));\r\n celula01.setBorderColor(BaseColor.BLACK);\r\n celula01.setPaddingLeft(10);\r\n celula01.setHorizontalAlignment(Element.ALIGN_CENTER);\r\n celula01.setVerticalAlignment(Element.ALIGN_MIDDLE);\r\n\r\n celula02 = new PdfPCell(new Paragraph(cli.getNome()));\r\n celula02.setBorderColor(BaseColor.BLACK);\r\n celula02.setPaddingLeft(10);\r\n celula02.setHorizontalAlignment(Element.ALIGN_CENTER);\r\n celula02.setVerticalAlignment(Element.ALIGN_MIDDLE);\r\n\r\n celula03 = new PdfPCell(new Paragraph(cli.getCpf()));\r\n celula03.setBorderColor(BaseColor.BLACK);\r\n celula03.setPaddingLeft(10);\r\n celula03.setHorizontalAlignment(Element.ALIGN_CENTER);\r\n celula03.setVerticalAlignment(Element.ALIGN_MIDDLE);\r\n\r\n celula04 = new PdfPCell(new Paragraph(\"R$\" + cli.getDiv()));\r\n celula04.setBorderColor(BaseColor.BLACK);\r\n celula04.setPaddingLeft(10);\r\n celula04.setHorizontalAlignment(Element.ALIGN_CENTER);\r\n celula04.setVerticalAlignment(Element.ALIGN_MIDDLE);\r\n tabela.addCell(celula01);\r\n tabela.addCell(celula02);\r\n tabela.addCell(celula03);\r\n tabela.addCell(celula04);\r\n\r\n// String linha = \"\";\r\n// linha += (\"Codigo: \" + contatos.getCodigoContato());\r\n// linha += (\" Nome: \" + contatos.getNomeContato());\r\n// linha += (\" Celular: \" + contatos.getNumCelular());\r\n// linha += (\" Fixo: \" + contatos.getNumFixo());\r\n// documento.add(new Paragraph(linha));\r\n }\r\n doc.add(tabela);\r\n\r\n doc.close();\r\n objpdf.close();\r\n doc.close();\r\n objpdf.close();\r\n } catch (DocumentException e) {\r\n e.printStackTrace();\r\n }\r\n PDF pd = new PDF();\r\n pd.abreArquivoPdf(\"relatorioClientes.pdf\");\r\n }", "private void carregarTabela() {\n try {\n\n Vector<String> cabecalho = new Vector();\n cabecalho.add(\"Id\");\n cabecalho.add(\"Nome\");\n cabecalho.add(\"Telefone\");\n cabecalho.add(\"Titular\");\n cabecalho.add(\"Data de Nascimento\");\n\n Vector detalhe = new Vector();\n\n for (Dependente dependente : new NDependente().listar()) {\n Vector<String> linha = new Vector();\n\n linha.add(dependente.getId() + \"\");\n linha.add(dependente.getNome());\n linha.add(dependente.getTelefone());\n linha.add(new NCliente().consultar(dependente.getCliente_id()).getNome());\n linha.add(dependente.getDataNascimento().toString());\n detalhe.add(linha);\n\n }\n\n tblDependentes.setModel(new DefaultTableModel(detalhe, cabecalho));\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, e.getMessage());\n }\n\n }", "private void export(final TableFacade tableFacade) {\r\n\t\t tableFacade.setColumnProperties(\"id.invPexProductosExistencia.invArtArticulo.artCodigo\",\r\n\t\t\t\t\"id.invPexProductosExistencia.invArtArticulo.artNombre\",\r\n\t\t\t\t\"eboCantidadProducto\",\"eboSaldo\");\r\n\t\tTable table = tableFacade.getTable();\r\n\t\t\r\n\t\t//---- Titulo de la tabla\r\n\t\ttable.setCaptionKey(\"tbl.abo.caption\");\r\n\t\t\r\n\t\tRow row = table.getRow();\r\n\t\tColumn nombreColumna = row.getColumn(\"id.invPexProductosExistencia.invArtArticulo.artCodigo\");\r\n\t\tnombreColumna.setTitleKey(\"tbl.abo.id.invArtArticulo.artCodigo.x\");\r\n\r\n\t\tnombreColumna = row.getColumn(\"id.invPexProductosExistencia.invArtArticulo.artNombre\");\r\n\t\tnombreColumna.setTitleKey(\"tbl.abo.id.invArtArticulo.artNombre.x\");\r\n\t\t\r\n\t\tnombreColumna = row.getColumn(\"eboCantidadProducto\");\r\n\t\tnombreColumna.setTitleKey(\"tbl.abo.eboCantidadProducto\");\r\n\t\t\r\n\t\tnombreColumna = row.getColumn(\"eboSaldo\");\r\n\t\tnombreColumna.setTitleKey(\"tbl.abo.eboSaldo\");\r\n\t\tnombreColumna.getCellRenderer().setCellEditor(new CellEditor() {\r\n\t\t\tpublic Object getValue(Object item, String property, int rowcount) {\r\n\t\t\t\tObject value = new BasicCellEditor().getValue(item, property,\r\n\t\t\t\t\t\trowcount);\r\n\t\t\t\tInvEboExistenciaBodega existenciaBodega = (InvEboExistenciaBodega) item;\r\n\t\t\t\t\r\n\t\t\t\tvalue = Format.formatDinero(existenciaBodega.getEboSaldo());\r\n\t\t\t\treturn value;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\ttableFacade.render();\r\n\t}", "private void crearCasillerosYCrearTablero(String arch) throws ExcepcionArchivos, FileNotFoundException {\n\t\tLectorEscritor le = new LectorEscritor();\n\t\tle.leerTablero(arch, this);\n\n\t}", "private void copyDataBase() throws IOException {\n\t\tInputStream mInput = mContext.getAssets().open(DATABASE_NAME);\r\n\t\tString outFileName = DATABASE_PATH + DATABASE_NAME;\r\n\t\tOutputStream mOutput = new FileOutputStream(outFileName);\r\n\r\n\t\t// transferer donnees de la db\r\n\t\tbyte[] buffer = new byte[1024];\r\n\t\tint length;\r\n\t\twhile ((length = mInput.read(buffer)) > 0) {\r\n\t\t\tmOutput.write(buffer, 0, length);\r\n\t\t}\r\n\t\t// fermeture\r\n\t\tmOutput.flush();\r\n\t\tmOutput.close();\r\n\t\tmInput.close();\r\n\t}", "private void limparTabela() { \n while (tmLivro.getRowCount() > 0) { \n tmLivro.removeRow(0);\n }\n }", "private void export2(final TableFacade tableFacade,final HttpServletRequest request) {\n\t\ttableFacade.setColumnProperties(\"ascCodigo\", \"ascIngresoCoope\",\n\t\t\t\t\"ascAsociadoPadre\");\n\t\tTable table = tableFacade.getTable();\n\t\t// ---- Titulo de la tabla\n\t\ttable.setCaptionKey(\"tbl.planilla.caption\");\n\n\t\tRow row = table.getRow();\n\t\tColumn nombreColumna = row.getColumn(\"ascCodigo\");\n\t\tnombreColumna.setTitleKey(\"tbl.planilla.ascCodigo.x\");\n\t\tnombreColumna.getCellRenderer().setCellEditor(new CellEditor() {\n\n\t\t\tpublic Object getValue(Object item, String property, int rowcount) {\n\t\t\t\tObject value = new BasicCellEditor().getValue(item, property,\n\t\t\t\t\t\trowcount);\n\t\t\t\tCtaAscAsociado asociado = (CtaAscAsociado) item;\n\t\t\t\tString codigo = \"'\" + asociado.getAscCodigo();\n\t\t\t\treturn codigo;\n\t\t\t}\n\n\t\t});\n\n\t\tnombreColumna = row.getColumn(\"ascIngresoCoope\");\n\t\tnombreColumna.setTitleKey(\"tbl.planilla.empresa\");\n\t\tnombreColumna.getCellRenderer().setCellEditor(new CellEditor() {\n\n\t\t\tpublic Object getValue(Object item, String property, int rowcount) {\n\t\t\t\tObject value = new BasicCellEditor().getValue(item, property,\n\t\t\t\t\t\trowcount);\n\t\t\t\tCtaAscAsociado asociado = (CtaAscAsociado) item;\n\t\t\t\tString empresa = \"\";\n\t\t\t\tif (asociado.getAscDirTrabajo() == null\n\t\t\t\t\t\t|| asociado.getAscDirTrabajo().equals(\"\")) {\n\t\t\t\t\tCtaDptDepartamentoTrabajo departamentoTrabajo = asociado\n\t\t\t\t\t\t\t.getCtaDptDepartamentoTrabajo();\n\t\t\t\t\tCtaEtrEmpresaTrabajoDAO empresaTrabajoDAO = new CtaEtrEmpresaTrabajoDAO(getSessionHibernate(request));\n\t\t\t\t\tCtaEtrEmpresaTrabajo empresaTrabajo = empresaTrabajoDAO\n\t\t\t\t\t\t\t.findById(departamentoTrabajo\n\t\t\t\t\t\t\t\t\t.getCtaEtrEmpresaTrabajo().getEtrId());\n\t\t\t\t\tempresa = empresaTrabajo.getEtrNombre();\n\t\t\t\t} else {\n\t\t\t\t\tempresa = asociado.getAscDirTrabajo();\n\t\t\t\t}\n\t\t\t\treturn empresa;\n\t\t\t}\n\n\t\t});\n\n\t\tnombreColumna = row.getColumn(\"ascAsociadoPadre\");\n\t\tnombreColumna.setTitleKey(\"tbl.planilla.total\");\n\t\tnombreColumna.getCellRenderer().setCellEditor(new CellEditor() {\n\n\t\t\tpublic Object getValue(Object item, String property, int rowcount) {\n\t\t\t\tObject value = new BasicCellEditor().getValue(item, property,\n\t\t\t\t\t\trowcount);\n\t\t\t\tCtaAscAsociado asociado = (CtaAscAsociado) item;\n\t\t\t\tdouble descAportaciones = 0.0;\n\t\t\t\tdescAportaciones += obtenerDescuentos(asociado, \"B\", \"A\",\n\t\t\t\t\t\tdescAportaciones,request);\n\n\t\t\t\tdouble descAhorros = 0.0;\n\t\t\t\tdescAhorros += obtenerDescuentos(asociado, \"B\", \"B\",\n\t\t\t\t\t\tdescAhorros,request);\n\n\t\t\t\tdouble descPrestamos = 0.0;\n\t\t\t\tdescPrestamos += obtenerDescuentos(asociado, \"C\", \"\",\n\t\t\t\t\t\tdescPrestamos,request);\n\n\t\t\t\tdouble descSeguros = 0.0;\n\t\t\t\tdescSeguros += obtenerDescuentos(asociado, \"D\", \"\", descSeguros,request);\n\n\t\t\t\treturn descAportaciones + descAhorros + descPrestamos\n\t\t\t\t\t\t+ descSeguros;\n\t\t\t}\n\t\t});\n\n\t\ttableFacade.render();\n\t}", "public void copyDatabase(Context context) {\n try {\n AssetManager assetManager = context.getAssets();\n InputStream is = null;\n try {\n is = assetManager.open(DATABASE_NAME);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n //mo file de ghi\n String path = DATABASE_PATH + DATABASE_NAME;\n File f = new File(path);\n if (f.exists()) {\n return;\n } else {\n f.createNewFile();\n }\n FileOutputStream fos = new FileOutputStream(f);\n byte[] b = new byte[1024];\n int lenght = 0;\n\n while ((lenght = is.read(b)) != -1) {\n fos.write(b, 0, lenght);\n fos.flush();\n }\n is.close();\n fos.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void crearTabla() {\n\t\tthis.tabla= new String[palabras.length+1][4];\t\n\t}", "@Override\n\tpublic void exportarData() {\n\t\tDate date=new Date();\n\t\tString nameFile=\"recaudado-\"+date.getTime()+\".xls\";\n\t\tTableToExcel.save(grid,nameFile);\n\t}", "private void gerarArquivoExcel() {\n\t\tFile currDir = getPastaParaSalvarArquivo();\n\t\tString path = currDir.getAbsolutePath();\n\t\t// Adiciona ao nome da pasta o nome do arquivo que desejamos utilizar\n\t\tString fileLocation = path.substring(0, path.length()) + \"/relatorio.xls\";\n\t\t\n\t\t// mosta o caminho que exportamos na tela\n\t\ttextField.setText(fileLocation);\n\n\t\t\n\t\t// Criação do arquivo excel\n\t\ttry {\n\t\t\t\n\t\t\t// Diz pro excel que estamos usando portguês\n\t\t\tWorkbookSettings ws = new WorkbookSettings();\n\t\t\tws.setLocale(new Locale(\"pt\", \"BR\"));\n\t\t\t// Cria uma planilha\n\t\t\tWritableWorkbook workbook = Workbook.createWorkbook(new File(fileLocation), ws);\n\t\t\t// Cria uma pasta dentro da planilha\n\t\t\tWritableSheet sheet = workbook.createSheet(\"Pasta 1\", 0);\n\n\t\t\t// Cria um cabeçario para a Planilha\n\t\t\tWritableCellFormat headerFormat = new WritableCellFormat();\n\t\t\tWritableFont font = new WritableFont(WritableFont.ARIAL, 16, WritableFont.BOLD);\n\t\t\theaderFormat.setFont(font);\n\t\t\theaderFormat.setBackground(Colour.LIGHT_BLUE);\n\t\t\theaderFormat.setWrap(true);\n\n\t\t\tLabel headerLabel = new Label(0, 0, \"Nome\", headerFormat);\n\t\t\tsheet.setColumnView(0, 60);\n\t\t\tsheet.addCell(headerLabel);\n\n\t\t\theaderLabel = new Label(1, 0, \"Idade\", headerFormat);\n\t\t\tsheet.setColumnView(0, 40);\n\t\t\tsheet.addCell(headerLabel);\n\n\t\t\t// Cria as celulas com o conteudo\n\t\t\tWritableCellFormat cellFormat = new WritableCellFormat();\n\t\t\tcellFormat.setWrap(true);\n\n\t\t\t// Conteudo tipo texto\n\t\t\tLabel cellLabel = new Label(0, 2, \"Elcio Bonitão\", cellFormat);\n\t\t\tsheet.addCell(cellLabel);\n\t\t\t// Conteudo tipo número (usar jxl.write... para não confundir com java.lang.number...)\n\t\t\tjxl.write.Number cellNumber = new jxl.write.Number(1, 2, 49, cellFormat);\n\t\t\tsheet.addCell(cellNumber);\n\n\t\t\t// Não esquecer de escrever e fechar a planilha\n\t\t\tworkbook.write();\n\t\t\tworkbook.close();\n\n\t\t} catch (IOException e1) {\n\t\t\t// Imprime erro se não conseguir achar o arquivo ou pasta para gravar\n\t\t\te1.printStackTrace();\n\t\t} catch (WriteException e) {\n\t\t\t// exibe erro se acontecer algum tipo de celula de planilha inválida\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public void cargarTablas(){\n ControladorEmpleados empleados= new ControladorEmpleados();\n ControladorProyectos proyectos= new ControladorProyectos();\n ControladorCasos casos= new ControladorCasos();\n actualizarListadoObservable(empleados.consultarEmpleadosAdminProyectos(ESTADO_ASIGNADO, TIPO_3),casos.consultarCasos(devolverUser()),casos.consultarTiposCaso());\n }", "private boolean copiaArquivo(File origem, File destino)\n\t{\n\t\tboolean copiou = false;\n\t\ttry\n\t\t{\n\t\t\tFileInputStream input \t= new FileInputStream(origem);\n\t\t\tFileOutputStream output = new FileOutputStream(destino);\n\t\t\tint sizeBuffer = Integer.parseInt(getPropriedade(\"ordemVoucher.tamanhoBufferArquivos\"));\n\t\t\tbyte[] buffer = new byte[sizeBuffer];\n\t\t\tint count=0;\n\t\t\twhile( (count=input.read(buffer, 0, sizeBuffer)) != -1)\n\t\t\t\toutput.write(buffer,0,count);\n\n\t\t\toutput.close();\n\t\t\tinput.close();\n\t\t\tcopiou = true;\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\tcopiou = false;\n\t\t}\n\t\treturn copiou;\n\t}", "public void tempTable(String nameCopy, int copyK, String newName) {\r\n\t\tTable tempTab = new Table(newName);\r\n\t\tfor (int i = 1; i < tables.get(copyK).getAttributeNumber() - 1; i++) {\r\n\t\t\tint choice = 0;\r\n\t\t\tif (tables.get(copyK).getAttributes(i).getType().equals(\"string\") ) {\r\n\t\t\t\tchoice = 1;\r\n\t\t\t} else if (tables.get(copyK).getAttributes(i).getType().equals(\"char\")) {\r\n\t\t\t\tchoice = 2;\r\n\t\t\t} else if (tables.get(copyK).getAttributes(i).getType().equals(\"int\")) {\r\n\t\t\t\tchoice = 3;\r\n\t\t\t} else if (tables.get(copyK).getAttributes(i).getType().equals(\"double\")) {\r\n\t\t\t\tchoice = 4;\r\n\t\t\t} else if (tables.get(copyK).getAttributes(i).getType().equals(\"date\")) {\r\n\t\t\t\tchoice = 5;\r\n\t\t\t} \r\n\t\t\tString name = tables.get(copyK).getAttributes(i).getName();\r\n\t\t\ttempTab.newAttribute(name, choice);\r\n\t\t\tfor (int j = 0; j < tables.get(copyK).getLines(); j++) {\r\n\t\t\t\tString temp = tables.get(copyK).getAttributes(i).getArray().get(j);\r\n\t\t\t\ttempTab.getAttributes(i).getArray().add(temp);\r\n\t\t\t}\r\n\t\t}\r\n\t\tString[] entries = new String[tables.get(copyK).getAttributeNumber() - 2];\r\n\t\tfor (int j = 0; j < tables.get(copyK).getLines(); j++) {\r\n\t\t\tfor (int i = 0; i < entries.length; i++) {\r\n\t\t\t\tentries[i] = tables.get(copyK).getAttributes(i + 1)\r\n\t\t\t\t\t\t\t.getArray().get(j);\r\n\t\t\t}\r\n\t\t\ttempTab.newEntry(entries);\r\n\t\t}\r\n\t}", "public void actionPerformed(ActionEvent e) {\n if (e.getActionCommand().compareTo(\"Copy\") == 0) {\n StringBuffer sbf = new StringBuffer();\n // Check to ensure we have selected only a contiguous block of\n // cells\n int numCols = jTable.getSelectedColumnCount();\n int numRows = jTable.getSelectedRowCount();\n int[] rowsSelected = jTable.getSelectedRows();\n int[] colsSelected = jTable.getSelectedColumns();\n if (!((numRows - 1 == rowsSelected[rowsSelected.length - 1] - rowsSelected[0] &&\n numRows == rowsSelected.length) &&\n (numCols - 1 == colsSelected[colsSelected.length - 1] - colsSelected[0] &&\n numCols == colsSelected.length))) {\n JOptionPane.showMessageDialog(null, \"Invalid Copy Selection\",\n \"Invalid Copy Selection\",\n JOptionPane.ERROR_MESSAGE);\n return;\n }\n for (int i = 0; i < numRows; i++) {\n for (int j = 0; j < numCols; j++) {\n sbf.append(jTable.getValueAt(rowsSelected[i], colsSelected[j]));\n if (j < numCols - 1) sbf.append(\"\\t\");\n }\n sbf.append(\"\\n\");\n }\n StringSelection stSel = new StringSelection(sbf.toString());\n system = Toolkit.getDefaultToolkit().getSystemClipboard();\n system.setContents(stSel, stSel);\n }\n if (e.getActionCommand().compareTo(\"Paste\") == 0) {\n int startRow = (jTable.getSelectedRows())[0];\n int startCol = (jTable.getSelectedColumns())[0];\n try {\n String trString = (String) (system.getContents(this).getTransferData(DataFlavor.stringFlavor));\n StringTokenizer st1 = new StringTokenizer(trString, \"\\n\");\n for (int i = 0; st1.hasMoreTokens(); i++) {\n String rowString = st1.nextToken();\n StringTokenizer st2 = new StringTokenizer(rowString, \"\\t\");\n for (int j = 0; st2.hasMoreTokens(); j++) {\n String value = st2.nextToken();\n\n if (startRow + i < jTable.getRowCount() && startCol + j < jTable.getColumnCount()) {\n mapTable.getData()[startRow + i][startCol + j] = Double.valueOf(value);\n }\n }\n\n mapTable.setTableData(mapTable.getData());\n }\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }\n }", "void exporter(JTable tab, File file) {\n try {\r\n\r\n TableModel model = tab.getModel();\r\n FileWriter out = new FileWriter(file);\r\n for (int i = 0; i < model.getColumnCount(); i++) {\r\n out.write(model.getColumnName(i) + \"\\t\");\r\n }\r\n out.write(\"\\n\");\r\n\r\n for (int i = 0; i < model.getRowCount(); i++) {\r\n for (int j = 0; j < model.getColumnCount(); j++) {\r\n out.write(model.getValueAt(i, j).toString() + \"\\t\");\r\n }\r\n out.write(\"\\n\");\r\n }\r\n\r\n out.close();\r\n } catch (Exception err) {\r\n err.printStackTrace();\r\n }\r\n }", "public void atualizarTabela() {\n\t\tJTAlocar.setModel(modelAlocar = new TableModelAlocar(ManipulacaoXml.getInstace().todasAlocacoes()));\n\t}", "private void addButtonToTable() {\n Callback<TableColumn<FileModel, Void>, TableCell<FileModel, Void>> cellFactory = new Callback<TableColumn<FileModel, Void>, TableCell<FileModel, Void>>() {\n @Override\n public TableCell<FileModel, Void> call(final TableColumn<FileModel, Void> param) {\n final TableCell<FileModel, Void> cell = new TableCell<FileModel, Void>() {\n private final Button btn = new Button(\"download\");\n\n {\n btn.setOnAction((ActionEvent event) -> {\n if (isBusyNow()) return;\n DirectoryChooser file=new DirectoryChooser();\n file.setTitle(\"Choose the local directory for FTP\");\n File newFolder = file.showDialog(main.getWindow());\n if (newFolder == null) {\n return; // close the chooser directly\n }\n FileModel data = getTableView().getItems().get(getIndex());\n Task copyWorker = null;\n try {\n // show tip: 1 file is downing now\n tip.setVisible(true);\n progressBar.setVisible(true);\n progressBar.progressProperty().unbind();\n if (isPassive){\n main.getFtp().setPasvMode(true);\n }\n copyWorker = main.getFtp().download(data.getName(), newFolder.getPath(), MyUtil.formatSizeToLong(data.getSize()));\n progressBar.progressProperty().bind(copyWorker.progressProperty());\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n copyWorker.messageProperty().addListener(new ChangeListener<String>() {\n public void changed(ObservableValue<? extends String> observable, String oldValue,\n String newValue) {\n System.out.println(newValue);\n // download is finished, hide the tip and progress bar\n if (newValue.equals(\"finish\")) {\n tip.setVisible(false);\n progressBar.setVisible(false);\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"FTP Client\");\n alert.setHeaderText(\"Download Successfully!\");\n alert.initOwner(main.getWindow());\n alert.showAndWait();\n }\n }\n });\n new Thread(copyWorker).start();\n });\n }\n\n @Override\n public void updateItem(Void item, boolean empty) {\n super.updateItem(item, empty);\n if (empty) {\n setGraphic(null);\n } else {\n setGraphic(btn);\n setAlignment(Pos.CENTER);\n }\n }\n };\n return cell;\n }\n };\n action.setCellFactory(cellFactory);\n }", "private void copyDataBase()\r\n throws IOException\r\n {\r\n // Open your local db as the input stream\r\n InputStream myInput\r\n = myContext.getAssets()\r\n .open(DATABASE_NAME);\r\n\r\n // Path to the just created empty db\r\n String outFileName = DB_PATH;\r\n\r\n // Open the empty db as the output stream\r\n OutputStream myOutput\r\n = new FileOutputStream(outFileName);\r\n\r\n // transfer bytes from the\r\n // inputfile to the outputfile\r\n byte[] buffer = new byte[1024];\r\n int length;\r\n while ((length = myInput.read(buffer)) > 0) {\r\n myOutput.write(buffer, 0, length);\r\n }\r\n\r\n // Close the streams\r\n myOutput.flush();\r\n myOutput.close();\r\n myInput.close();\r\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n seletorArquivos = new javax.swing.JFileChooser();\n toolBar = new javax.swing.JToolBar();\n buttonAbrir = new javax.swing.JButton();\n butonSalvar = new javax.swing.JButton();\n jSeparator1 = new javax.swing.JToolBar.Separator();\n buttonAddTime = new javax.swing.JButton();\n buttonAtualizar = new javax.swing.JButton();\n buttonDistancias1 = new javax.swing.JButton();\n jSeparator2 = new javax.swing.JToolBar.Separator();\n buttonDistancias = new javax.swing.JButton();\n buttonTabela = new javax.swing.JButton();\n desktopPane = new javax.swing.JDesktopPane();\n jScrollPane1 = new javax.swing.JScrollPane();\n tableTimes = new javax.swing.JTable();\n jButton1 = new javax.swing.JButton();\n menuBar = new javax.swing.JMenuBar();\n menuArquivo = new javax.swing.JMenu();\n itemAddTime = new javax.swing.JMenuItem();\n itemDistancias = new javax.swing.JMenuItem();\n separatorUm = new javax.swing.JPopupMenu.Separator();\n itemTabela = new javax.swing.JMenuItem();\n separatorDois = new javax.swing.JPopupMenu.Separator();\n itemAbrir = new javax.swing.JMenuItem();\n itemSalvar = new javax.swing.JMenuItem();\n itemSalvarComo = new javax.swing.JMenuItem();\n itemSair = new javax.swing.JMenuItem();\n menuAjuda = new javax.swing.JMenu();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Gerador de Tabelas\");\n setBackground(new java.awt.Color(255, 255, 255));\n\n toolBar.setForeground(new java.awt.Color(255, 255, 255));\n toolBar.setRollover(true);\n toolBar.setToolTipText(\"\");\n\n buttonAbrir.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/poc/view/icons/abrir.png\"))); // NOI18N\n buttonAbrir.setToolTipText(\"Abrir...\\n\");\n buttonAbrir.setFocusable(false);\n buttonAbrir.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n buttonAbrir.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n buttonAbrir.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n buttonAbrirActionPerformed(evt);\n }\n });\n toolBar.add(buttonAbrir);\n\n butonSalvar.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/poc/view/icons/salvar.png\"))); // NOI18N\n butonSalvar.setToolTipText(\"Salvar\");\n butonSalvar.setFocusable(false);\n butonSalvar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n butonSalvar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n butonSalvar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n butonSalvarActionPerformed(evt);\n }\n });\n toolBar.add(butonSalvar);\n toolBar.add(jSeparator1);\n\n buttonAddTime.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/poc/view/icons/addTime.png\"))); // NOI18N\n buttonAddTime.setToolTipText(\"Adicionar Time\");\n buttonAddTime.setFocusable(false);\n buttonAddTime.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n buttonAddTime.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n buttonAddTime.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n buttonAddTimeActionPerformed(evt);\n }\n });\n toolBar.add(buttonAddTime);\n\n buttonAtualizar.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/poc/view/icons/atualizar.png\"))); // NOI18N\n buttonAtualizar.setToolTipText(\"Atualizar\");\n buttonAtualizar.setFocusable(false);\n buttonAtualizar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n buttonAtualizar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n buttonAtualizar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n buttonAtualizarActionPerformed(evt);\n }\n });\n toolBar.add(buttonAtualizar);\n\n buttonDistancias1.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/poc/view/icons/excluirTime.png\"))); // NOI18N\n buttonDistancias1.setToolTipText(\"Excluir Times\");\n buttonDistancias1.setFocusable(false);\n buttonDistancias1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n buttonDistancias1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n buttonDistancias1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n buttonDistancias1ActionPerformed(evt);\n }\n });\n toolBar.add(buttonDistancias1);\n toolBar.add(jSeparator2);\n\n buttonDistancias.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/poc/view/icons/distancia.png\"))); // NOI18N\n buttonDistancias.setToolTipText(\"Cadastrar Distâncias\");\n buttonDistancias.setFocusable(false);\n buttonDistancias.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n buttonDistancias.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n buttonDistancias.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n buttonDistanciasActionPerformed(evt);\n }\n });\n toolBar.add(buttonDistancias);\n\n buttonTabela.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/poc/view/icons/gerarTabela.png\"))); // NOI18N\n buttonTabela.setToolTipText(\"Gerar Tabela\");\n buttonTabela.setFocusable(false);\n buttonTabela.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n buttonTabela.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n buttonTabela.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n buttonTabelaActionPerformed(evt);\n }\n });\n toolBar.add(buttonTabela);\n\n desktopPane.addComponentListener(new java.awt.event.ComponentAdapter() {\n public void componentResized(java.awt.event.ComponentEvent evt) {\n desktopPaneComponentResized(evt);\n }\n });\n\n tableTimes.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null},\n {null, null, null},\n {null, null, null},\n {null, null, null}\n },\n new String [] {\n \"Códigos\", \"Times\", \"Prioridade\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.Object.class, java.lang.String.class, java.lang.String.class\n };\n boolean[] canEdit = new boolean [] {\n false, false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n jScrollPane1.setViewportView(tableTimes);\n\n desktopPane.setLayer(jScrollPane1, javax.swing.JLayeredPane.DEFAULT_LAYER);\n\n javax.swing.GroupLayout desktopPaneLayout = new javax.swing.GroupLayout(desktopPane);\n desktopPane.setLayout(desktopPaneLayout);\n desktopPaneLayout.setHorizontalGroup(\n desktopPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING)\n );\n desktopPaneLayout.setVerticalGroup(\n desktopPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 348, Short.MAX_VALUE)\n );\n\n jButton1.setText(\"Atualizar Tabela\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n menuBar.setBackground(new java.awt.Color(255, 255, 255));\n menuBar.setForeground(new java.awt.Color(255, 255, 255));\n\n menuArquivo.setText(\"Arquivo\");\n\n itemAddTime.setText(\"Adicionar Time\");\n menuArquivo.add(itemAddTime);\n\n itemDistancias.setText(\"Cadastrar Distâncias\");\n menuArquivo.add(itemDistancias);\n menuArquivo.add(separatorUm);\n\n itemTabela.setText(\"Gerar Tabela\");\n menuArquivo.add(itemTabela);\n menuArquivo.add(separatorDois);\n\n itemAbrir.setText(\"Abrir...\");\n itemAbrir.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n itemAbrirActionPerformed(evt);\n }\n });\n menuArquivo.add(itemAbrir);\n\n itemSalvar.setText(\"Salvar\");\n menuArquivo.add(itemSalvar);\n\n itemSalvarComo.setText(\"Salvar como...\");\n menuArquivo.add(itemSalvarComo);\n\n itemSair.setText(\"Sair\");\n itemSair.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n itemSairActionPerformed(evt);\n }\n });\n menuArquivo.add(itemSair);\n\n menuBar.add(menuArquivo);\n\n menuAjuda.setText(\"Ajuda\");\n menuBar.add(menuAjuda);\n\n setJMenuBar(menuBar);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(toolBar, javax.swing.GroupLayout.DEFAULT_SIZE, 778, Short.MAX_VALUE)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(desktopPane, javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(toolBar, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(desktopPane)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jButton1))\n );\n\n pack();\n setLocationRelativeTo(null);\n }", "@SuppressFBWarnings(\"DLS_DEAD_LOCAL_STORE\")\n @Override\n protected Collection<CopyEntity> generateCopyEntities()\n throws IOException {\n MultiTimingEvent multiTimer = new MultiTimingEvent(this.helper.getEventSubmitter(), \"TableCopy\", true);\n\n int stepPriority = 0;\n String fileSet = getTable().getTableName();\n List<CopyEntity> copyEntities = Lists.newArrayList();\n\n Optional<Table> existingTargetTable = this.helper.getExistingTargetTable();\n if (existingTargetTable.isPresent()) {\n // Use update policy if user defined table path for their copy location does not match pre-existing table path\n if (!HiveUtils.areTablePathsEquivalent(this.helper.getTargetFs(), this.helper.getTargetTable().getDataLocation(),\n existingTargetTable.get().getDataLocation())) {\n switch (this.helper.getExistingEntityPolicy()){\n case UPDATE_TABLE:\n // Update the location of files while keep the existing table entity.\n log.warn(\"Source table will not be deregistered while file location has been changed, update source table's\"\n + \" file location to\" + this.helper.getTargetTable().getDataLocation());\n existingTargetTable = Optional.absent();\n break ;\n case REPLACE_TABLE:\n case REPLACE_TABLE_AND_PARTITIONS:\n // Required to de-register the original table.\n log.warn(\"Source and target table are not compatible. Will override target table \" + existingTargetTable.get()\n .getDataLocation());\n stepPriority = this.helper.addTableDeregisterSteps(copyEntities, fileSet, stepPriority, this.helper.getTargetTable());\n existingTargetTable = Optional.absent();\n break ;\n default:\n log.error(\"Source and target table are not compatible. Aborting copy of table \" + this.helper.getTargetTable());\n multiTimer.close();\n throw new HiveTableLocationNotMatchException(this.helper.getTargetTable().getDataLocation(),\n existingTargetTable.get().getDataLocation());\n }\n }\n }\n\n stepPriority = this.helper.addSharedSteps(copyEntities, fileSet, stepPriority);\n\n HiveLocationDescriptor sourceLocation =\n HiveLocationDescriptor.forTable(getTable(), getHiveDataset().getFs(), getHiveDataset().getProperties());\n HiveLocationDescriptor desiredTargetLocation =\n HiveLocationDescriptor.forTable(this.helper.getTargetTable(), this.helper.getTargetFs(), getHiveDataset().getProperties());\n\n Optional<HiveLocationDescriptor> existingTargetLocation = existingTargetTable.isPresent() ? Optional.of(\n HiveLocationDescriptor.forTable(existingTargetTable.get(), this.helper.getTargetFs(), getHiveDataset().getProperties()))\n : Optional.<HiveLocationDescriptor> absent();\n\n if (this.helper.getFastTableSkip().isPresent() && this.helper.getFastTableSkip().get().apply(this.helper)) {\n log.info(String.format(\"Skipping copy of table %s due to fast table skip predicate.\", getTable().getDbName()+\".\" + getTable().getTableName()));\n multiTimer.close();\n return Lists.newArrayList();\n }\n\n HiveCopyEntityHelper.DiffPathSet\n diffPathSet = HiveCopyEntityHelper.fullPathDiff(sourceLocation, desiredTargetLocation, existingTargetLocation,\n Optional.<Partition> absent(), multiTimer, this.helper);\n\n multiTimer.nextStage(HiveCopyEntityHelper.Stages.FULL_PATH_DIFF);\n\n // Could used to delete files for the existing snapshot\n DeleteFileCommitStep deleteStep =\n DeleteFileCommitStep.fromPaths(this.helper.getTargetFs(), diffPathSet.pathsToDelete, getHiveDataset().getProperties());\n copyEntities.add(new PrePublishStep(fileSet, Maps.<String, String> newHashMap(), deleteStep, stepPriority++));\n\n for (CopyableFile.Builder builder : this.helper.getCopyableFilesFromPaths(diffPathSet.filesToCopy, this.helper.getConfiguration(),\n Optional.<Partition> absent())) {\n CopyableFile fileEntity =\n builder.fileSet(fileSet).datasetOutputPath(desiredTargetLocation.location.toString()).build();\n fileEntity.setSourceData(this.helper.getSourceDataset());\n fileEntity.setDestinationData(this.helper.getDestinationDataset());\n copyEntities.add(fileEntity);\n }\n\n multiTimer.close();\n return copyEntities;\n }", "private void preencherTabelaVeiculoCarga() {\n\n ArrayList dados = new ArrayList();\n cargaDao = new CargaDao();\n Carga carga;\n String[] colunas = new String[]{\"ID\", \"DESCRICAO\", \"STATUS\"};\n\n try {\n final List<Object> listaCarga = cargaDao.listarCargasDoVeiculo(idVeiculoSelecionado);\n\n if (listaCarga != null && listaCarga.size() > 0) {\n for (Object cargaAtual : listaCarga) {\n carga = (Carga) cargaAtual;\n dados.add(new Object[]{carga.getIdCarga(), carga.getDescricao(), carga.getStatus()});\n }\n }\n\n ModeloTabela modTabela = new ModeloTabela(dados, colunas);\n jTB_VeiculoCarga.setModel(modTabela);\n jTB_VeiculoCarga.getColumnModel().getColumn(0).setPreferredWidth(100);\n jTB_VeiculoCarga.getColumnModel().getColumn(0).setResizable(false);\n jTB_VeiculoCarga.getColumnModel().getColumn(1).setPreferredWidth(300);\n jTB_VeiculoCarga.getColumnModel().getColumn(1).setResizable(false);\n jTB_VeiculoCarga.getColumnModel().getColumn(2).setPreferredWidth(150);\n jTB_VeiculoCarga.getColumnModel().getColumn(2).setResizable(false);\n\n jTB_VeiculoCarga.getTableHeader().setReorderingAllowed(false);\n jTB_VeiculoCarga.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);\n jTB_VeiculoCarga.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n\n jTB_VeiculoCarga.addMouseListener(new MouseAdapter() {\n\n @Override\n public void mouseClicked(MouseEvent e) {\n try {\n List<Object> lista = cargaDao.listarCargasDoVeiculo(idVeiculoSelecionado);\n cargaSelecionada = (Carga) lista.\n get(jTB_VeiculoCarga.convertRowIndexToModel(jTB_VeiculoCarga.getSelectedRow()));\n\n // if (veiculoDao.listarVeiculosAtivos().size() > 0 && veiculoDao.listarVeiculosAtivos() != null) {}\n } catch (Exception ex) {\n JOptionPane.showMessageDialog(FormVeiculoCargas.this, \"Erro genérico1: \" + ex.getMessage());\n ex.printStackTrace(System.err);\n }\n }\n\n });\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, \"Erro genérico2: \" + e.getMessage());\n }\n }", "public void makeSQL(String dropStament, String insertStament, String createStament, boolean[] isString, String patho, String nameFile, String filtroRow, int columnaActive){\n\t\tmanagerDB.executeScript_Void(dropStament);\n\n\t\t/* Listo los archivos que hay en la carpeta para hallar el que se llama descripcion*/ \n\t\tFile[] listOfFiles = new File(patho).listFiles();\n\t\tint i=0;\n\t\twhile ( i<listOfFiles.length && !listOfFiles[i].toString().contains(nameFile) )\n\t\t\ti++;\n\n\t\t// Si encontre el archivo creo la tabla, genero un scrip de insertar, lo ejecuto desde la consola y lo borro e inserto los datos\n\t\tif (i<listOfFiles.length){\n\n\t\t\tmanagerDB.executeScript_Void(createStament);\t\t\t\t\n\n\t\t\tif (managerDB.createExecutorFile(\"C:\\\\\", \"prueba\")){\n\t\t\t\tParserSNOMED.fileToSqlScript(patho,listOfFiles[i].getName().toString(),insertStament, filtroRow,columnaActive);\n\t\t\t\tSystem.out.println(patho + listOfFiles[i].getName().toString());\n\t\t\t\ttry{\n\t\t\t\t\tThread.sleep(1000); \n\n\t\t\t\t\tRuntime.getRuntime().exec(\"cmd /c start C:\\\\prueba.bat\");\n\t\t\t\t\tmanagerDB.waitUntisFinishConsole(\"C://\",\"done.prov\" );\n\n\t\t\t\t\t// Borro todos los archivos luego de que termine el script\n\t\t\t\t\tFile file = new File(\"C:\\\\done.prov\"); \tfile.delete();\n\t\t\t\t\t//\t\t\tfile = new File(\"C:\\\\auxFile.sql\"); \tfile.delete();\n\t\t\t\t\tfile = new File(\"C:\\\\prueba.bat\");\t\tfile.delete();\n\t\t\t\t}\n\t\t\t\tcatch (Exception e1) {\n\t\t\t\t\te1.printStackTrace();}\t\t\t\t}\n\t\t}\n\t}", "public void actionPerformed(ActionEvent e) {\n if (e.getActionCommand().compareTo(\"Copy\")==0) {\n StringBuilder sbf=new StringBuilder();\n // Check to ensure we have selected only a contiguous block of\n // cells\n int numcols=jTable1.getSelectedColumnCount();\n int numrows=jTable1.getSelectedRowCount();\n int[] rowsselected=jTable1.getSelectedRows();\n int[] colsselected=jTable1.getSelectedColumns();\n if (rowsselected.length==0 || colsselected.length==0) return;\n if (!((numrows-1==rowsselected[rowsselected.length-1]-rowsselected[0] &&\n numrows==rowsselected.length) &&\n (numcols-1==colsselected[colsselected.length-1]-colsselected[0] &&\n numcols==colsselected.length)))\n {\n JOptionPane.showMessageDialog(null, \"Invalid Copy Selection\",\n \"Invalid Copy Selection\",\n JOptionPane.ERROR_MESSAGE);\n return;\n }\n for (int i=0;i<numrows;i++) {\n for (int j=0;j<numcols;j++) {\n sbf.append(jTable1.getValueAt(rowsselected[i],colsselected[j]));\n if (j<numcols-1) sbf.append(\"\\t\");\n }\n sbf.append(\"\\n\");\n }\n stsel = new StringSelection(sbf.toString());\n system = Toolkit.getDefaultToolkit().getSystemClipboard();\n system.setContents(stsel,stsel);\n }\n if (e.getActionCommand().compareTo(\"Paste\")==0) {\n int[] rows=jTable1.getSelectedRows();\n int[] cols=jTable1.getSelectedColumns();\n if (rows.length==0 || cols.length==0) return;\n int startRow=rows[0];\n int startCol=cols[0];\n try\n {\n String trstring= (String)(system.getContents(this).getTransferData(DataFlavor.stringFlavor));\n //System.out.println(\"String is:\"+trstring);\n StringTokenizer st1=new StringTokenizer(trstring,\"\\n\");\n for(int i=0;st1.hasMoreTokens();i++)\n {\n rowstring=st1.nextToken();\n StringTokenizer st2=new StringTokenizer(rowstring,\"\\t\");\n for(int j=0;st2.hasMoreTokens();j++)\n {\n value=(String)st2.nextToken();\n if (startRow+i==jTable1.getRowCount() && expandable) { // add row if necessary\n TableModel model = jTable1.getModel();\n if (model instanceof DefaultTableModel) {\n Object[] newrow=new Object[jTable1.getColumnCount()];\n for (int k=0;k<newrow.length;k++) newrow[k]=\"\";\n ((DefaultTableModel)model).addRow(newrow);\n }\n }\n if (startRow+i<jTable1.getRowCount()&& startCol+j<jTable1.getColumnCount()) {\n Object typeValue=value;\n if (value!=null && convertNumerical!=CONVERT_NONE) {\n try {\n Double doubleval=Double.parseDouble(value);\n if (convertNumerical==CONVERT_TO_INTEGER || (convertNumerical==CONVERT_TO_DOUBLE_OR_INTEGER && doubleval.intValue()==doubleval.doubleValue())) typeValue=new Integer(doubleval.intValue());\n else typeValue=doubleval;\n } catch (NumberFormatException ex) {}\n }\n if (jTable1.isCellEditable(startRow+i,startCol+j)) {\n jTable1.setValueAt(typeValue,startRow+i,startCol+j);\n //System.out.println(\"Convert[\"+typeValue.getClass().getSimpleName()+\"] \"+value+\"=>\"+typeValue+\" at row=\"+startRow+i+\" column=\"+startCol+j+\" convertNumerical=\"+convertNumerical);\n }\n }\n }\n }\n }\n catch(Exception ex){}\n } \n if (e.getActionCommand().compareTo(\"Delete\")==0) {\n int[] rows=jTable1.getSelectedRows();\n int[] cols=jTable1.getSelectedColumns(); \n if (cols.length==jTable1.getColumnCount() && (jTable1.getModel() instanceof DefaultTableModel) && expandable) { // delete complete rows\n DefaultTableModel model = (DefaultTableModel)jTable1.getModel();\n for (int i=0;i<rows.length;i++) {\n model.removeRow(rows[i]-i);\n } \n if (model.getRowCount()==0) {\n Object[] newrow=new Object[jTable1.getColumnCount()];\n for (int k=0;k<newrow.length;k++) newrow[k]=null;\n model.addRow(newrow); \n }\n } else { // delete only cell content\n for (int i=0;i<rows.length;i++) {\n for (int j=0;j<cols.length;j++) {\n jTable1.setValueAt(null,rows[i],cols[j]);\n }\n }\n }\n }\n if (e.getActionCommand().compareTo(\"PressedTab\")==0) {\n if (jTable1.getModel() instanceof DefaultTableModel && expandable) {\n int currentRow=jTable1.getSelectedRow();\n int currentColumn=jTable1.getSelectedColumn();\n if (currentRow+1==jTable1.getRowCount() && currentColumn+1==jTable1.getColumnCount()) {\n Object[] newrow=new Object[jTable1.getColumnCount()];\n for (int k=0;k<newrow.length;k++) newrow[k]=null;\n ((DefaultTableModel)jTable1.getModel()).addRow(newrow);\n }\n }\n oldTabAction.actionPerformed(e);\n }\n if (e.getActionCommand().compareTo(\"PressedArrowdown\")==0) {\n if (jTable1.getModel() instanceof DefaultTableModel && expandable) {\n int currentRow=jTable1.getSelectedRow();\n if (currentRow+1==jTable1.getRowCount()) {\n Object[] newrow=new Object[jTable1.getColumnCount()];\n for (int k=0;k<newrow.length;k++) newrow[k]=null;\n ((DefaultTableModel)jTable1.getModel()).addRow(newrow);\n }\n }\n oldArrowdownAction.actionPerformed(e);\n } \n }", "@Test\n public void testCopyFeatureTable() throws SQLException, IOException {\n AlterTableUtils.testCopyFeatureTable(activity, geoPackage);\n }", "public void excluirDados() {\n\n int linha;\n\n if (verificarAbaAtiva() == 0) {\n linha = HorarioDeTrabalho.getSelectedRow();\n modHT = (DefaultTableModel) HorarioDeTrabalho.getModel();\n tratDados.excluirDadosTabela(modHT, linha);\n txtEntrada_Horario.requestFocus();\n } else {\n linha = MarcacoesFeitas.getSelectedRow();\n modMF = (DefaultTableModel) MarcacoesFeitas.getModel();\n tratDados.excluirDadosTabela(modMF, linha);\n txtEntrada_Marcacoes.requestFocus();\n }\n \n //Limpa as tabelas de Atraso e Extras\n modAt.setRowCount(0);\n modEx.setRowCount(0);\n }", "private void createTableBill(){\r\n //Se crean y definen las columnas de la Tabla\r\n TableColumn col_orden = new TableColumn(\"#\"); \r\n TableColumn col_city = new TableColumn(\"Ciudad\");\r\n TableColumn col_codigo = new TableColumn(\"Código\"); \r\n TableColumn col_cliente = new TableColumn(\"Cliente\"); \r\n TableColumn col_fac_nc = new TableColumn(\"FAC./NC.\"); \r\n TableColumn col_fecha = new TableColumn(\"Fecha\");\r\n TableColumn col_monto = new TableColumn(\"Monto\"); \r\n TableColumn col_anulada = new TableColumn(\"A\");\r\n \r\n //Se establece el ancho de cada columna\r\n this.objectWidth(col_orden , 25, 25); \r\n this.objectWidth(col_city , 90, 150); \r\n this.objectWidth(col_codigo , 86, 86); \r\n this.objectWidth(col_cliente , 165, 300); \r\n this.objectWidth(col_fac_nc , 70, 78); \r\n this.objectWidth(col_fecha , 68, 68); \r\n this.objectWidth(col_monto , 73, 73); \r\n this.objectWidth(col_anulada , 18, 18);\r\n\r\n col_fac_nc.setCellFactory(new Callback<TableColumn, TableCell>() {\r\n @Override\r\n public TableCell call(TableColumn param) {\r\n return new TableCell<Fxp_Archguip_det, String>() {\r\n @Override\r\n public void updateItem(String item, boolean empty) {\r\n super.updateItem(item, empty);\r\n setText(empty ? null : getString());\r\n setAlignment(Pos.CENTER);\r\n }\r\n\r\n private String getString() {\r\n String ret = \"\";\r\n if (getItem() != null) {\r\n ret = getItem().toString();\r\n if (ret.equals(\"0\"))\r\n ret = \"\";\r\n } else {\r\n ret = \"\";\r\n }\r\n return ret;\r\n } \r\n };\r\n }\r\n }); \r\n\r\n col_fecha.setCellFactory(new Callback<TableColumn, TableCell>() {\r\n @Override\r\n public TableCell call(TableColumn param) {\r\n return new TableCell<Fxp_Archguip_det, Date>() {\r\n @Override\r\n public void updateItem(Date item, boolean empty) {\r\n super.updateItem(item, empty);\r\n if(!empty){\r\n setText(item.toLocalDate().toString());\r\n setAlignment(Pos.CENTER);\r\n }\r\n else\r\n setText(null);\r\n }\r\n };\r\n }\r\n }); \r\n\r\n col_monto.setCellFactory(new Callback<TableColumn, TableCell>() {\r\n @Override\r\n public TableCell call(TableColumn param) {\r\n return new TableCell<Fxp_Archguid, Double>() {\r\n @Override\r\n public void updateItem(Double item, boolean empty) {\r\n super.updateItem(item, empty);\r\n setText(empty ? null : getString());\r\n setAlignment(Pos.CENTER_RIGHT);\r\n }\r\n\r\n private String getString() {\r\n String ret = \"\";\r\n if (getItem() != null) {\r\n String gi = getItem().toString();\r\n NumberFormat df = DecimalFormat.getInstance();\r\n df.setMinimumFractionDigits(2);\r\n df.setRoundingMode(RoundingMode.DOWN);\r\n\r\n ret = df.format(Double.parseDouble(gi));\r\n } else {\r\n ret = \"0,00\";\r\n }\r\n return ret;\r\n } \r\n };\r\n }\r\n }); \r\n\r\n col_anulada.setCellFactory(new Callback<TableColumn, TableCell>() {\r\n @Override\r\n public TableCell call(TableColumn param) {\r\n return new TableCell<Fxp_Archguid, Integer>() {\r\n @Override\r\n public void updateItem(Integer item, boolean empty) {\r\n super.updateItem(item, empty);\r\n setText(empty ? null : getString());\r\n setAlignment(Pos.CENTER);\r\n }\r\n\r\n private String getString() {\r\n String ret = \"\";\r\n if (getItem() != null) {\r\n ret = getItem().toString();\r\n if (ret.equals(\"0\"))\r\n ret = \"\";\r\n\r\n setTextFill(isSelected() ? Color.WHITE :\r\n ret.equals(\"0\") ? Color.BLACK :\r\n ret.equals(\"1\") ? Color.RED : Color.GREEN);\r\n } else {\r\n ret = \"\";\r\n }\r\n return ret;\r\n } \r\n };\r\n }\r\n }); \r\n\r\n //Se define la columna de la tabla con el nombre del atributo del objeto USUARIO correspondiente\r\n col_orden.setCellValueFactory( \r\n new PropertyValueFactory<>(\"orden\") );\r\n col_city.setCellValueFactory( \r\n new PropertyValueFactory<>(\"ciudad\") );\r\n col_codigo.setCellValueFactory( \r\n new PropertyValueFactory<>(\"codigo\") );\r\n col_cliente.setCellValueFactory( \r\n new PropertyValueFactory<>(\"cliente\") );\r\n col_fac_nc.setCellValueFactory( \r\n new PropertyValueFactory<>(\"numdocs\") );\r\n col_fecha.setCellValueFactory( \r\n new PropertyValueFactory<>(\"fecdoc\") );\r\n col_monto.setCellValueFactory( \r\n new PropertyValueFactory<>(\"monto\") );\r\n col_anulada.setCellValueFactory( \r\n new PropertyValueFactory<>(\"anulada\") );\r\n \r\n //Se Asigna ordenadamente las columnas de la tabla\r\n tb_factura.getColumns().addAll(\r\n col_orden, col_city, col_codigo, col_cliente, col_fac_nc, col_fecha, \r\n col_monto, col_anulada \r\n ); \r\n \r\n //Se Asigna menu contextual \r\n tb_factura.setRowFactory((TableView<Fxp_Archguid> tableView) -> {\r\n final TableRow<Fxp_Archguid> row = new TableRow<>();\r\n final ContextMenu contextMenu = new ContextMenu();\r\n final MenuItem removeMenuItem = new MenuItem(\"Anular Factura\");\r\n removeMenuItem.setOnAction((ActionEvent event) -> {\r\n switch (tipoOperacion){\r\n case 1:\r\n tb_factura.getItems().remove(tb_factura.getSelectionModel().getSelectedIndex());\r\n break;\r\n case 2:\r\n tb_factura.getItems().get(tb_factura.getSelectionModel().getSelectedIndex()).setAnulada(1);\r\n col_anulada.setVisible(false);\r\n col_anulada.setVisible(true);\r\n break;\r\n }\r\n });\r\n contextMenu.getItems().add(removeMenuItem);\r\n // Set context menu on row, but use a binding to make it only show for non-empty rows:\r\n row.contextMenuProperty().bind(\r\n Bindings.when(row.emptyProperty())\r\n .then((ContextMenu)null)\r\n .otherwise(contextMenu)\r\n );\r\n return row ; \r\n });\r\n \r\n //Se define el comportamiento de las teclas ARRIBA y ABAJO en la tabla\r\n EventHandler eh = new EventHandler<KeyEvent>(){\r\n @Override\r\n public void handle(KeyEvent ke){\r\n //Si fue presionado la tecla ARRIBA o ABAJO\r\n if (ke.getCode().equals(KeyCode.UP) || ke.getCode().equals(KeyCode.DOWN)){ \r\n //Selecciona la FILA enfocada\r\n selectedRowInvoice();\r\n }\r\n }\r\n };\r\n //Se Asigna el comportamiento para que se ejecute cuando se suelta una tecla\r\n tb_factura.setOnKeyReleased(eh); \r\n }", "public void PreencherTabela2() throws SQLException {\n\n String[] colunas = new String[]{\"ID do Pedido\", \"Numero Grafica\", \"Data Emissao\",\"Boleto\"};\n ArrayList dados = new ArrayList();\n Connection connection = ConnectionFactory.getConnection();\n PedidoDAO pedidoDAO = new PedidoDAO(connection);\n ModeloPedido modeloPedido = new ModeloPedido();\n modeloPedido = pedidoDAO.buscaPorId(idPedidoClasse);\n SimpleDateFormat format = new SimpleDateFormat(\"dd/MM/yyyy\");\n\n dados.add(new Object[]{modeloPedido.getId(), modeloPedido.getNumeroGrafica(), format.format(modeloPedido.getDataEmissao()), modeloPedido.isBoleto()});\n\n ModeloTabela modelo = new ModeloTabela(dados, colunas);\n\n jTablePedido.setModel(modelo);\n jTablePedido.setRowSorter(new TableRowSorter(modelo));\n jTablePedido.getColumnModel().getColumn(0).setPreferredWidth(2);\n jTablePedido.getColumnModel().getColumn(0).setResizable(false);\n jTablePedido.getColumnModel().getColumn(1).setPreferredWidth(20);\n jTablePedido.getColumnModel().getColumn(1).setResizable(false);\n\n jTablePedido.getTableHeader().setReorderingAllowed(false);\n connection.close();\n }", "public void generarReporteTablaAmortiDetalles(String sAccionBusqueda,List<TablaAmortiDetalle> tablaamortidetallesParaReportes) throws Exception {\n\t\tLong iIdUsuarioSesion=0L;\t\r\n\t\t\r\n\t\t\r\n\t\tif(usuarioActual==null) {\r\n\t\t\tthis.usuarioActual=new Usuario();\r\n\t\t}\r\n\t\t\r\n\t\tiIdUsuarioSesion=usuarioActual.getId();\r\n\t\t\r\n\t\tString sPathReportes=\"\";\r\n\t\t\r\n\t\tInputStream reportFile=null;\r\n\t\tInputStream imageFile=null;\r\n\t\t\t\r\n\t\timageFile=AuxiliarImagenes.class.getResourceAsStream(\"LogoReporte.jpg\");\t\t\t\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathReporteFinal=\"\";\r\n\t\t\r\n\t\tif(!esReporteAccionProceso) {\r\n\t\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\t\tif(!this.esReporteDinamico) {\r\n\t\t\t\t\tsPathReporteFinal=\"TablaAmortiDetalle\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsPathReporteFinal=this.sPathReporteDinamico;\r\n\t\t\t\t\treportFile = new FileInputStream(sPathReporteFinal);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"TablaAmortiDetalleMasterRelaciones\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\r\n\t\t\t\t//sPathReportes=reportFile.getPath().replace(\"TablaAmortiDetalleMasterRelacionesDesign.jasper\", \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"TablaAmortiDetalle\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t}\r\n\t\t\r\n\t\tif(reportFile==null) {\r\n\t\t\tthrow new JRRuntimeException(sPathReporteFinal+\" no existe\");\r\n\t\t}\r\n\t\t\r\n\t\tString sUsuario=\"\";\r\n\t\t\r\n\t\tif(usuarioActual!=null) {\r\n\t\t\tsUsuario=usuarioActual.getuser_name();\r\n\t\t}\r\n\t\t\r\n\t\tMap<String, Object> parameters = new HashMap<String, Object>();\r\n\t\tparameters.put(\"usuario\", sUsuario);\r\n\t\t\r\n\t\tparameters.put(\"titulo\", Funciones.GetTituloSistemaReporte(this.parametroGeneralSg,this.moduloActual,this.usuarioActual));\r\n\t\tparameters.put(\"subtitulo\", \"Reporte De Tabla Amortizacion Detalles\");\t\t\r\n\t\tparameters.put(\"busquedapor\", TablaAmortiDetalleConstantesFunciones.getNombreIndice(sAccionBusqueda)+sDetalleReporte);\r\n\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\tparameters.put(\"SUBREPORT_DIR\", sPathReportes);\r\n\t\t}\r\n\t\t\r\n\t\tparameters.put(\"con_grafico\", this.conGraficoReporte);\r\n\t\t\r\n\t\tJasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile);\r\n\t\t\t\t\r\n\t\tthis.cargarDatosCliente();\r\n\t\t\r\n\t\tArrayList<Classe> classes=new ArrayList<Classe>();\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\t\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\t//FK DEBERIA TRAERSE DE ANTEMANO\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\t//CLASSES PARA REPORTES OBJETOS RELACIONADOS\r\n\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\tclasses=new ArrayList<Classe>();\r\n\t\t}\r\n\t\t\r\n\t\tJRBeanArrayDataSource jrbeanArrayDataSourceTablaAmortiDetalle=null;\r\n\t\t\r\n\t\tif(this.sTipoReporteExtra!=null && !this.sTipoReporteExtra.equals(\"\")) {\r\n\t\t\tTablaAmortiDetalleConstantesFunciones.S_TIPOREPORTE_EXTRA=this.sTipoReporteExtra;\r\n\t\t} else {\r\n\t\t\tTablaAmortiDetalleConstantesFunciones.S_TIPOREPORTE_EXTRA=\"\";\r\n\t\t}\r\n\t\t\r\n\t\tjrbeanArrayDataSourceTablaAmortiDetalle=new JRBeanArrayDataSource(TablaAmortiDetalleJInternalFrame.TraerTablaAmortiDetalleBeans(tablaamortidetallesParaReportes,classes).toArray());\r\n\t\t\r\n\t\tjasperPrint = JasperFillManager.fillReport(jasperReport,parameters,jrbeanArrayDataSourceTablaAmortiDetalle);\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathDest=Constantes.SUNIDAD_ARCHIVOS+\":/\"+Constantes.SCONTEXTSERVER+\"/\"+TablaAmortiDetalleConstantesFunciones.SCHEMA+\"/reportes\";\r\n\t\t\r\n\t\tFile filePathDest = new File(sPathDest);\r\n\t\t\r\n\t\tif(!filePathDest.exists()) {\r\n\t\t\tfilePathDest.mkdirs();\t\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\tString sDestFileName=sPathDest+\"/\"+TablaAmortiDetalleConstantesFunciones.CLASSNAME;\r\n\t\t\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"VISUALIZAR\") {\r\n\t\t\tJasperViewer jasperViewer = new JasperViewer(jasperPrint,false) ;\r\n\t\t\tjasperViewer.setVisible(true) ; \r\n\r\n\t\t} else if(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\") {\t\r\n\t\t\t//JasperFillManager.fillReportToFile(reportFile.getAbsolutePath(),parameters, new JRBeanArrayDataSource(TablaAmortiDetalleBean.TraerTablaAmortiDetalleBeans(tablaamortidetallesParaReportes).toArray()));\r\n\t\t\t\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"HTML\") {\r\n\t\t\t\tsDestFileName+=\".html\";\r\n\t\t\t\tJasperExportManager.exportReportToHtmlFile(jasperPrint,sDestFileName);\r\n\t\t\t\t\t\r\n\t\t\t} else if(this.sTipoArchivoReporte==\"PDF\") {\r\n\t\t\t\tsDestFileName+=\".pdf\";\r\n\t\t\t\tJasperExportManager.exportReportToPdfFile(jasperPrint,sDestFileName);\r\n\t\t\t} else {\r\n\t\t\t\tsDestFileName+=\".xml\";\r\n\t\t\t\tJasperExportManager.exportReportToXmlFile(jasperPrint,sDestFileName, false);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\r\n\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"WORD\") {\r\n\t\t\t\tsDestFileName+=\".rtf\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRRtfExporter exporter = new JRRtfExporter();\r\n\t\t\r\n\t\t\t\texporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\r\n\t\t\t\texporter.exportReport();\r\n\t\t\t\t\r\n\t\t\t} else\t{\r\n\t\t\t\tsDestFileName+=\".xls\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRXlsExporter exporterXls = new JRXlsExporter();\r\n\t\t\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\t\texporterXls.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);\r\n\t\t\r\n\t\t\t\texporterXls.exportReport();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"EXCEL2\"||this.sTipoArchivoReporte==\"EXCEL2_2\") {\r\n\t\t\t//sDestFileName+=\".xlsx\";\r\n\t\t\t\r\n\t\t\tif(this.sTipoReporte.equals(\"NORMAL\")) {\r\n\t\t\t\tthis.generarExcelReporteTablaAmortiDetalles(sAccionBusqueda,sTipoArchivoReporte,tablaamortidetallesParaReportes);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"FORMULARIO\")){\r\n\t\t\t\tthis.generarExcelReporteVerticalTablaAmortiDetalles(sAccionBusqueda,sTipoArchivoReporte,tablaamortidetallesParaReportes,false);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"DINAMICO\")){\r\n\t\t\t\t\r\n\t\t\t\tif(this.sTipoReporteDinamico.equals(\"NORMAL\")) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.jButtonGenerarExcelReporteDinamicoTablaAmortiDetalleActionPerformed(null);\r\n\t\t\t\t\t//this.generarExcelReporteTablaAmortiDetalles(sAccionBusqueda,sTipoArchivoReporte,tablaamortidetallesParaReportes);\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"FORMULARIO\")){\r\n\t\t\t\t\tthis.generarExcelReporteVerticalTablaAmortiDetalles(sAccionBusqueda,sTipoArchivoReporte,tablaamortidetallesParaReportes,true);\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"RELACIONES\")){\r\n\t\t\t\t\tthis.generarExcelReporteRelacionesTablaAmortiDetalles(sAccionBusqueda,sTipoArchivoReporte,tablaamortidetallesParaReportes,true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"RELACIONES\")){\r\n\t\t\t\tthis.generarExcelReporteRelacionesTablaAmortiDetalles(sAccionBusqueda,sTipoArchivoReporte,tablaamortidetallesParaReportes,false);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\"||this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\t\t\t\t\r\n\t\t\tJOptionPane.showMessageDialog(this,\"REPORTE \"+sDestFileName+\" GENERADO SATISFACTORIAMENTE\",\"REPORTES \",JOptionPane.INFORMATION_MESSAGE);\r\n\t\t}\r\n\t}", "private void copyDatabaseFile(String destinationPath) throws IOException {\n InputStream assetsDB = this.getAssets().open(DB_NAME);\n OutputStream dbOut = new FileOutputStream(destinationPath);\n byte[] buffer = new byte[1024];\n int length;\n while ((length = assetsDB.read(buffer)) > 0) {\n dbOut.write(buffer, 0, length);\n }\n dbOut.flush();\n dbOut.close();\n }", "public void doCreateTable();", "private void copyDataBase() throws IOException {\n\n\t\tInputStream myInput = rssContext.getAssets().open(DATABASE_NAME);\n\t\tString outFileName = DATABASE_PATH + DATABASE_NAME;\n\t\tOutputStream myOutput = new FileOutputStream(outFileName);\n\t\tbyte[] buffer = new byte[1024];\n\t\tint length;\n\t\twhile ((length = myInput.read(buffer)) > 0) {\n\t\t\tmyOutput.write(buffer, 0, length);\n\t\t}\n\t\tmyOutput.flush();\n\t\tmyOutput.close();\n\t\tmyInput.close();\n\t}", "@Test\n public void testCopyUserTable() throws SQLException {\n AlterTableUtils.testCopyUserTable(activity, geoPackage);\n }", "public static void Bildeinfuegen()\r\n\t{\n\t\tPath path = FileSystems.getDefault().getPath(\"bilder\", \"bild2.jpg\");\r\n\t\tFile file=path.toFile();\r\n\t\t//File file = new File(getCacheDirectory() + \"\\\\results.txt\");\r\n\t\t\r\n\t\tString INSERT_DATA_SQL=\"INSERT INTO bilder VALUES (?, ?)\";\r\n\t\ttry {\r\n\r\n\t\t\tFileInputStream fis= new FileInputStream(file);\r\n\t\t\tconn = DriverManager.getConnection(DB_URL,USER,PASS);\r\n\t\t\tpstmt = conn.prepareStatement(INSERT_DATA_SQL);\r\n\t\t\tfis = new FileInputStream(file);\r\n\t\t\t//pstmt = conn.prepareStatement(\"INSERT INTO bilder VALUES (?, ?)\");\r\n\t\t\tpstmt.setString(1, file.getName());\r\n\t\t\tpstmt.setBinaryStream(2, fis, (int)file.length());\r\n\t\t\tpstmt.executeUpdate();\r\n\r\n\t\t\tpstmt.close();\r\n\t\t\tfis.close();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"Daten in Datenbank gepeichert.\");\r\n\t}", "private static void createFileContribuicaoUmidade() throws IOException{\r\n\t\tInteger contribuicaoDefault = 0;\r\n\t\tarqContribuicaoUmidade = new File(pathContribuicaoUmidade);\r\n\t\tif(!arqContribuicaoUmidade.exists()) {\r\n\t\t\tarqContribuicaoUmidade.createNewFile();\r\n\t\t\tFileWriter fw = new FileWriter(getArqContribuicaoUmidade());\r\n\t\t\tBufferedWriter buffWrite = new BufferedWriter(fw);\r\n\t\t\tbuffWrite.append(contribuicaoDefault.toString() + String.valueOf('\\n'));\r\n\t\t\tbuffWrite.close();\r\n\t\t}else {//Se arquivo existir\r\n\t\t\tFileReader fr = new FileReader(getArqContribuicaoUmidade());\r\n\t\t\tBufferedReader buffRead = new BufferedReader(fr);\r\n\t\t\tif(!buffRead.ready()) {/*Se o arquivo se encontar criado mas estiver vazio(modificado)*/\r\n\t\t\t\tFileWriter fw = new FileWriter(arqContribuicaoUmidade);\r\n\t\t\t\tBufferedWriter buffWrite = new BufferedWriter(fw);\r\n\t\t\t\tbuffWrite.append(contribuicaoDefault.toString() + String.valueOf('\\n'));/*Inicializa o arquivo com uma contribuicao Inicial*/\r\n\t\t\t\tbuffWrite.close();\r\n\t\t\t}\r\n\t\t\tbuffRead.close();\r\n\t\t}\r\n\t}", "private void copyDataBase() throws IOException {\n InputStream myInput = myContext.getAssets().open(\"db/\" + DB_NAME);\n\n // Path to the just created empty db\n String outFileName = DB_PATH + DB_NAME;\n\n // Open the empty db as the output stream\n OutputStream myOutput = new FileOutputStream(outFileName);\n\n // transfer bytes from the inputfile to the outputfile\n byte[] buffer = new byte[1024];\n int length;\n while ((length = myInput.read(buffer)) > 0) {\n myOutput.write(buffer, 0, length);\n }\n\n // Close the streams\n myOutput.flush();\n myOutput.close();\n myInput.close();\n }", "private void moveArquivos(File arquivoOrdem) throws IOException\n\t{\n\t\t/* Busca o nome do diretorio destino definido nas configuracoes */\n\t\tString dirHistorico = getPropriedade(\"ordemVoucher.diretorioHistorico\");\n\t\t\n\t\t/* Move todos os arquivos de caixa da ordem */\n\t\tString arquivosCaixa[] = getNomeArquivosCaixa(arquivoOrdem);\n\t\tfor (int i=0; i < arquivosCaixa.length; i++)\n\t\t{\n\t\t\t/* Cria a referencia para o arquivo origem */\n\t\t\tString dirOrigem = getPropriedade(\"ordemVoucher.dirArquivos\");\n\t\t\tString nomArqOrigem\t= dirOrigem+System.getProperty(\"file.separator\")+arquivosCaixa[i];\n\t\t\tFile arquivoOrigem = new File(nomArqOrigem);\n\t\t\t/* Cria a referencia para o arquivo destino */\n\t\t\tFile arquivoDestino = new File(dirHistorico+System.getProperty(\"file.separator\")+arquivoOrigem.getName());\n\t\t\t/* Move o arquivo origem para destino */\n\t\t\tif (!renomeiaArquivo(arquivoOrigem,arquivoDestino))\n\t\t\t\tSystem.out.println(\"Nao foi possivel mover o arquivo de:\"+arquivoOrigem.getAbsolutePath()+\" para:\"+arquivoDestino.getAbsolutePath());\n\t\t\telse\n\t\t\t\tSystem.out.println(\"Arquivo \"+arquivoOrigem.getName()+\" foi movido para: \"+arquivoDestino.getAbsolutePath());\n\t\t}\n\n\t\t/* Move o arquivo da ordem */\n\t\tFile destino = new File(dirHistorico+System.getProperty(\"file.separator\")+arquivoOrdem.getName());\n\t\tif (!renomeiaArquivo(arquivoOrdem,destino))\n\t\t\tSystem.out.println(\"Nao foi possivel mover o arquivo de:\"+arquivoOrdem.getAbsolutePath()+\" para:\"+destino.getAbsolutePath());\n\t\telse\n\t\t\tSystem.out.println(\"Arquivo \"+arquivoOrdem.getName()+\" foi movido para: \"+destino.getAbsolutePath()); \n\t}", "public void preencherTabela(ArrayList<Livro> lista) {\n\t\tDefaultTableModel modelo = (DefaultTableModel) table.getModel();\n\t\tObject[] linha = new Object[4];\n\t\tmodelo.setRowCount(0);\n\t\tfor (Livro l : lista) {\n\t\t\tlinha[0] = l.getNome();\n\t\t\tlinha[1] = l.getAutor();\n\t\t\tlinha[2] = l.getDataDeLancamento();\n\t\t\tif (l.isDisponivel())\n\t\t\t\tlinha[3] = \"Disponivel\";\n\t\t\telse\n\t\t\t\tlinha[3] = \"Indisponivel\";\n\t\t\tmodelo.addRow(linha);\n\n\t\t}\n\n\t}", "private void copyDataBase() throws IOException\n {\n \tInputStream myInput = myContext.getAssets().open(DB_NAME);\n \n \t// Path to the just created empty db\n \tString outFileName = DB_PATH + DB_NAME;\n \n \t//Open the empty db as the output stream\n \tOutputStream myOutput = new FileOutputStream(outFileName);\n \n \t//transfer bytes from the inputfile to the outputfile\n \tbyte[] buffer = new byte[1024];\n \tint length;\n \twhile ((length = myInput.read(buffer))>0){\n \t\tmyOutput.write(buffer, 0, length);\n \t}\n \n \t//Close the streams\n \tmyOutput.flush();\n \tmyOutput.close();\n \tmyInput.close();\n \t\n \tLog.d(\"COPY\", \"DONE\");\n \n }", "private void copyDataBase() throws IOException\n {\n \tInputStream myInput = myContext.getAssets().open(DB_NAME);\n \n \t// Path to the just created empty db\n \tString outFileName = DB_PATH + DB_NAME;\n \n \t//Open the empty db as the output stream\n \tOutputStream myOutput = new FileOutputStream(outFileName);\n \n \t//transfer bytes from the inputfile to the outputfile\n \tbyte[] buffer = new byte[1024];\n \tint length;\n \twhile ((length = myInput.read(buffer))>0){\n \t\tmyOutput.write(buffer, 0, length);\n \t}\n \n \t//Close the streams\n \tmyOutput.flush();\n \tmyOutput.close();\n \tmyInput.close();\n \t\n \tLog.d(\"COPY\", \"DONE\");\n \n }", "private static void popuniTabelu() {\r\n\t\tDefaultTableModel dfm = (DefaultTableModel) teretanaGui.getTable().getModel();\r\n\r\n\t\tdfm.setRowCount(0);\r\n\r\n\t\tfor (int i = 0; i < listaClanova.size(); i++) {\r\n\t\t\tClan c = listaClanova.getClan(i);\r\n\t\t\tdfm.addRow(new Object[] { c.getBrojClanskeKarte(), c.getIme(), c.getPrezime(), c.getPol() });\r\n\t\t}\r\n\t\tcentrirajTabelu();\r\n\t}", "private void generateBackUpMysql() {\n Calendar c = Calendar.getInstance();//creamos una instancia de la clase calendar de java\n //java.util.Date fecha = new Date();\n String DiaHoy = Integer.toString(c.get(Calendar.DATE));\n String MesHoy = Integer.toString(c.get(Calendar.MONTH)+1);\n String AnioHoy = Integer.toString(c.get(Calendar.YEAR)); \n \n \n JFileChooser RealizarBackupMySQL = new JFileChooser();\n int resp;\n resp=RealizarBackupMySQL.showSaveDialog(this);//JFileChooser de nombre RealizarBackupMySQL\n if (resp==JFileChooser.APPROVE_OPTION) {//Si el usuario presiona aceptar; se genera el Backup\n try{\n Runtime runtime = Runtime.getRuntime();\n File backupFile = new File(String.valueOf(RealizarBackupMySQL.getSelectedFile().toString())+\" \"+DiaHoy +\"-\"+MesHoy+\"-\"+AnioHoy+\".sql\");\n FileWriter fw = new FileWriter(backupFile);\n \n Process child = runtime.exec(\"C:\\\\xampp\\\\mysql\\\\bin\\\\mysqldump --routines --opt --password= --user=root --databases utp2020-dental-system-dev\"); \n\n // Process child = runtime.exec(\"C:\\\\wamp\\\\bin\\\\mariadb\\\\mariadb10.4.10\\\\bin\\\\mysqldump --routines --opt --password= --user=root --databases utp2020-dental-system-dev\"); \n InputStreamReader irs = new InputStreamReader(child.getInputStream());\n BufferedReader br = new BufferedReader(irs);\n String line;\n while( (line=br.readLine()) != null ) {\n fw.write(line + \"\\n\");\n }\n fw.close();\n irs.close();\n br.close();\n JOptionPane.showMessageDialog(null, \"Archivo generado\",\"Verificar\",JOptionPane. INFORMATION_MESSAGE);\n }catch(Exception e){\n JOptionPane.showMessageDialog(null, \"Error no se genero el archivo por el siguiente motivo:\"+e.getMessage(), \"Verificar\",JOptionPane.ERROR_MESSAGE);\n } \n } else if (resp==JFileChooser.CANCEL_OPTION) {\n JOptionPane.showMessageDialog(null,\"Ha sido cancelada la generacion del Backup\");\n }\n }", "public void llenarTabla() {\n\n String matriz[][] = new String[lPComunes.size()][2];\n\n for (int i = 0; i < AccesoFichero.lPComunes.size(); i++) {\n matriz[i][0] = AccesoFichero.lPComunes.get(i).getPalabra();\n matriz[i][1] = AccesoFichero.lPComunes.get(i).getCodigo();\n\n }\n\n jTableComun.setModel(new javax.swing.table.DefaultTableModel(\n matriz,\n new String[]{\n \"Palabra\", \"Morse\"\n }\n ) {// Bloquea que las columnas se puedan editar, haciendo doble click en ellas\n @SuppressWarnings(\"rawtypes\")\n Class[] columnTypes = new Class[]{\n String.class, String.class\n };\n\n @SuppressWarnings({\"unchecked\", \"rawtypes\"})\n @Override\n public Class getColumnClass(int columnIndex) {\n return columnTypes[columnIndex];\n }\n boolean[] columnEditables = new boolean[]{\n false, false\n };\n\n @Override\n public boolean isCellEditable(int row, int column) {\n return columnEditables[column];\n }\n });\n\n }", "public void arquivoSaida() {\r\n\r\n try {\r\n File file = new File(\"arquivoSaida.txt\");\r\n try (FileWriter arquivoSaida = new FileWriter(file, true)) {\r\n arquivoSaida.write(\"Rota do menor caminho entre as cidades escolhidas: \\n\\n\");\r\n Vertice v;\r\n \r\n //Escreve no arquivo a rota de ida de entrega nas cidades\r\n for (int i = 0; i < rota.getLista_de_rota().size() - 1; i++) {\r\n for (int j = 0; j < rota.getLista_de_rota().get(i).size(); j++) {\r\n v = rota.getLista_de_rota().get(i).get(j);\r\n arquivoSaida.write(v.getId() + \"; \");\r\n }\r\n }\r\n \r\n arquivoSaida.write(\"\\n\\nRota do menor caminho de volta: (Considerando que não há mais nenhuma entrega)\\n\\n\");\r\n // pegando a ultima posição da lista geral em que está a lista do menor caminho de volta\r\n int t = rota.getLista_de_rota().size() - 1; \r\n \r\n //Escreve a rota do caminho de volta, verificando a distancia entre a cidade origem e a cidade destino\r\n for (int j = rota.getLista_de_rota().get(t).size() - 1; j >= 0; j--) {\r\n v = (Vertice) rota.getLista_de_rota().get(t).get(j);\r\n arquivoSaida.write(v.getId() + \"; \");\r\n }\r\n arquivoSaida.write(\"Distancia percorrida: \"+rota.getDistancia()+\"\\n\");\r\n arquivoSaida.close();\r\n }\r\n } catch (IOException ex) { //caso nao seja possivel abrir algum dos arquivos\r\n System.out.println(\"Não foi possivel abrir arquivo\");\r\n }\r\n }", "private void backupTable(Path filePath, UUID uuid) throws IOException {\n long startTime = System.currentTimeMillis();\n BackupTableStats backupTableStats;\n\n try (FileOutputStream fileOutput = new FileOutputStream(filePath.toString())) {\n StreamOptions options = StreamOptions.builder()\n .ignoreTrimmed(false)\n .cacheEntries(false)\n .build();\n Stream<OpaqueEntry> stream = (new OpaqueStream(runtime.getStreamsView().get(uuid, options))).streamUpTo(timestamp);\n\n backupTableStats = writeTableToFile(fileOutput, stream, uuid);\n } catch (IOException e) {\n log.error(\"failed to back up table {} to file {}\", uuid, filePath);\n throw e;\n } catch (TrimmedException e) {\n log.error(\"failed to back up tables as log was trimmed after back up starts.\");\n throw e;\n }\n\n long elapsedTime = System.currentTimeMillis() - startTime;\n\n log.info(\"{} SMREntry (size: {} bytes, elapsed time: {} ms) saved to temp file {}\",\n backupTableStats.getNumOfEntries(), backupTableStats.getTableSize(), elapsedTime, filePath);\n }", "private void copyDataBase() throws IOException\r\n\t{\r\n\t\t// Open your local db as the input stream\r\n\t\tInputStream myInput = myContext.getAssets().open(DB_NAME);\r\n\r\n\t\t// Path to the just created empty db\r\n\t\tString outFileName = DB_PATH + DB_NAME;\r\n\r\n\t\t// Open the empty db as the output stream\r\n\t\tOutputStream myOutput = new FileOutputStream(outFileName);\r\n\r\n\t\t// transfer bytes from the inputfile to the outputfile\r\n\t\tbyte[] buffer = new byte[1024];\r\n\t\tint length;\r\n\t\twhile ((length = myInput.read(buffer)) > 0)\r\n\t\t{\r\n\t\t\tmyOutput.write(buffer, 0, length);\r\n\t\t}\r\n\r\n\t\t// Close the streams\r\n\t\tmyOutput.flush();\r\n\t\tmyOutput.close();\r\n\t\tmyInput.close();\r\n\r\n\t}", "Tablero consultarTablero();", "public void testCreateTable1() throws Exception {\n Properties props = new Properties();\n props.setProperty(LockssRepositoryImpl.PARAM_CACHE_LOCATION, tempDirPath);\n props\n\t.setProperty(ConfigManager.PARAM_PLATFORM_DISK_SPACE_LIST, tempDirPath);\n ConfigurationUtil.setCurrentConfigFromProps(props);\n\n createTable();\n }", "private static void SaveTable(Class<?> itemClass, List<CSVItem> data) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, NoSuchFieldException {\n\t\tString tl = (String)itemClass.getMethod(\"readTitle\").invoke(null, null);\n\t\tString val = \"\";\n\t\tString fn = (String)itemClass.getField(\"file\").get(val);\n\t\t\n\t\t\n\t\t\n\t\tfn = \"C:\\\\Users\\\\Chebakov.AA\\\\neo4j\\\\import\\\\pitc\\\\\" + fn + \".csv\";\n\t\ttry (OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(fn), \"UTF8\")) { //\"cp1251\"\n\t\t\tout.write(tl + \"\\r\\n\");\n\t\t\tdata.stream()\n\t\t\t\t.map(v -> v.readDataRow())\n\t\t\t\t.forEach(v -> {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tout.write(v + \"\\r\\n\");\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void writeTables(DirectoryCache cache, Map<ResourceLocation, LootTable> tables) {\n Path outputFolder = this.generator.getOutputFolder();\n tables.forEach((key, lootTable) -> {\n Path path = outputFolder.resolve(\"data/\" + key.getNamespace() + \"/loot_tables/\" + key.getPath() + \".json\");\n try {\n IDataProvider.save(GSON, cache, LootTableManager.toJson(lootTable), path);\n } catch (IOException e) {\n Occultism.LOGGER.error(\"Couldn't write loot table {}\", path, e);\n }\n });\n }", "private void copyDatabase() throws IOException {\n // Open your local database as the input stream\n InputStream inputStream = mContext.getAssets().open(DB_NAME);\n try {\n // Path to the newly created empty database\n String outFileName = DB_PATH + DB_NAME;\n OutputStream outputStream = new FileOutputStream(outFileName);\n try {\n // Transfer bytes from input file to output file\n byte[] buffer = new byte[1024];\n int len;\n while ((len = inputStream.read(buffer)) > 0) {\n outputStream.write(buffer, 0, len);\n }\n outputStream.flush();\n } finally {\n outputStream.close();\n }\n } finally {\n inputStream.close();\n }\n }", "@Override\n public void exportToFile(SpreadsheetTable focusOwner) {\n try {\n File dire = new File(dir);\n File file = new File(dire, filename);\n\n FileWriter writer = new FileWriter(file, false);\n int start = 0;\n if (this.header) {\n start++;\n }\n\n this.selectedCells = focusOwner.getSelectedCells();\n\n for (int i = start; i < selectedCells.length; i++) {\n for (int j = 0; j < selectedCells[i].length; j++) {\n if (j != 0) {\n writer.append(delimiter);\n }\n writer.append(selectedCells[i][j].getContent());\n }\n writer.append('\\r');\n writer.append('\\n');\n }\n writer.flush();\n writer.close();\n } catch (IOException e) {\n System.out.println(\"Error exporting file!\");\n }\n }", "private void createTableHeaderFile(final Class Class_, final String simpleName) throws IOException{\n final SessionFactory SessionFactory = HibernateUtil.getSingleton().getSessionFactoryLocal();\n final ClassMetadata classMetadata = SessionFactory.getClassMetadata(Class_);\n final String[] propertyNames = classMetadata.getPropertyNames();\n \n //Get the content file\n final String contentFileTableHeader = this.getContentTableHeader(simpleName,propertyNames); \n \n //Create the path\n final String className = simpleName + \"sTableHeader\"; \n final String tableHeaderPath = \"../era_views/src/main/java/com/era/views/tables/headers\";\n final String finalClassPath = tableHeaderPath + \"/\" + className + \".java\";\n \n //If the file exists delete it\n final File File = new File(finalClassPath); \n if(File.exists()){\n File.delete();\n }\n \n //Create the file\n File.createNewFile();\n \n //Write to the file\n try ( //Write the class\n FileWriter writer = new FileWriter(File)) { \n writer.write(contentFileTableHeader);\n }\n }", "public void copyDataBase() throws IOException {\n\n // Open your local db as the input stream\n InputStream myInput = ApplicationContextProvider.getContext().getAssets().open(DATABASE_NAME);\n\n // Path to the just created empty db\n String outFileName = DB_PATH + DATABASE_NAME;\n\n // Open the empty db as the output stream\n OutputStream myOutput = new FileOutputStream(outFileName);\n\n // transfer bytes from the inputfile to the outputfile\n byte[] buffer = new byte[1024];\n int length;\n while ((length = myInput.read(buffer)) > 0) {\n myOutput.write(buffer, 0, length);\n }\n\n // Close the streams\n myOutput.flush();\n myOutput.close();\n myInput.close();\n }", "public void cargarTabla(String servidor){\n String base_de_datos=\"Renta de Autos\";\n String sql =\"USE [\"+base_de_datos+\"]\\n\" +\n \"SELECT name FROM sysobjects where xtype='U' and name='Clientes' \";\n Conexion cc = new Conexion();\n Connection cn=cc.conectarBase(servidor, base_de_datos);\n \n try {\n Statement psd = cn.createStatement();\n ResultSet rs=psd.executeQuery(sql);\n while(rs.next()){\n cbTablas.addItem(rs.getString(\"name\"));\n }\n }catch(Exception ex){\n JOptionPane.showMessageDialog(null, ex+\" al cargar tabla\");\n }\n }", "public static void viewtable() {\r\n\t\tt.dibuixa(table);\r\n\t}", "private void copyDataBase() throws IOException {\n\n //Open your local db as the input stream\n InputStream myInput = context.getAssets().open(DATABASE_NAME);\n\n // Path to the just created empty db\n String outFileName = DATABASE_PATH + DATABASE_NAME;\n\n //Open the empty db as the output stream\n OutputStream myOutput = null;\n myOutput = new FileOutputStream(outFileName);\n\n //transfer bytes from the inputfile to the outputfile\n byte[] buffer = new byte[1024];\n int length;\n while ((length = myInput.read(buffer)) > 0) {\n myOutput.write(buffer, 0, length);\n }\n\n //Close the streams\n myOutput.flush();\n myOutput.close();\n myInput.close();\n\n }", "private void saveDataToFile() {\n boolean isLoggedInNew = na.isLoggedIn();\n boolean isLoggedIn = uL.isLoggedIn();\n // path for new accounts after sucsessful new account creation\n if (isLoggedInNew) {\n String username = na.getUsername();\n String fileExt = \"_data.txt\";\n String workingDirectory = System.getProperty(\"user.dir\");\n String filePath = workingDirectory + \"\\\\\" + username + fileExt;\n File file = new File(filePath);\n try {\n try (FileWriter fw = new FileWriter(file);\n BufferedWriter bw = new BufferedWriter(fw)) {\n for (int i = 0; i < remindersTable.getRowCount(); i++) { // rows\n for (int j = 0; j < remindersTable.getColumnCount(); j++) { // cols\n bw.write(remindersTable.getValueAt(i, j).toString() + \"\\t\");\n }\n bw.newLine();\n }\n }\n } catch (IOException ex) {\n Logger.getLogger(MoneyMinderDesktopMainGui.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n // path for existing accounts after sucsessful login\n if (isLoggedIn) {\n String username = uL.getUsername();\n String fileExt = \"_data.txt\";\n String workingDirectory = System.getProperty(\"user.dir\");\n String filePath = workingDirectory + \"\\\\\" + username + fileExt;\n File file = new File(filePath);\n try {\n try (FileWriter fw = new FileWriter(file);\n BufferedWriter bw = new BufferedWriter(fw)) {\n for (int i = 0; i < remindersTable.getRowCount(); i++) { // rows\n for (int j = 0; j < remindersTable.getColumnCount(); j++) { // cols\n bw.write(remindersTable.getValueAt(i, j).toString() + \"\\t\");\n }\n bw.newLine();\n }\n }\n } catch (IOException ex) {\n Logger.getLogger(MoneyMinderDesktopMainGui.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n }", "public void rellenarDatos(){\t\r\n\t//======================================ELEGIMOS MEDIANTE FILECHOOSER EL CSV==============================================//\r\n\tvista.getMntmAbrirCsv().addActionListener(r->{\t\r\n\tJFileChooser jchooser= new JFileChooser();\r\n\tvista.setjFileChooserCSV(jchooser);\r\n\tlistaArte= new ArrayList<ObraArte>();\r\n\t//==================================CREAMOS LAS TABLAS EN LA BASE DE DATOS SQLite========================================//\r\n\tCrearTablaHistorial.crearTablaObraArte(con);\r\n\tCrearTablas.crearTablaObraArte(con);\r\n\tCrearTriggers.createTrigger(con);\r\n\tint returnJChooser= jchooser.showOpenDialog(vista.getContentPane());\r\n\tif (returnJChooser==JFileChooser.APPROVE_OPTION){\r\n\t\tFile file= new File(jchooser.getSelectedFile(),\"\");\r\n\t\tScanner sc;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tsc = new Scanner(file);\r\n\t\t\tString cabecero = sc.nextLine(); \r\n\t\t\twhile(sc.hasNextLine()){ \r\n\t\t\t\tString[] textoEnLineas = sc.nextLine().split(\",\");\r\n\t\t\t\tlistaArte.add(new ObraArte(textoEnLineas[0], textoEnLineas[1], textoEnLineas[2], textoEnLineas[4], textoEnLineas[3]));\r\n\t\t\t}\t\t\t\r\n\t\t} catch (FileNotFoundException | NoSuchElementException o) {\t\r\n\t\t\tJOptionPane.showMessageDialog(vista.getFrame(), \"Archivo de datos incorrecto\", \"Error de lectura\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//====================CARGAMOS LOS DATOS EN LA TABLA Y BORRAMOS LA LISTA, CARGANDO LA DE LA BD=================//\r\n\t\t\r\n\t\tInsertarDatos.addListaRegistroArte(con, listaArte);\r\n\t\tlistaArte.removeAll(listaArte);\r\n\t\tlistaArte=SeleccionarDatos.getTodosRegistros(con);\r\n\t\tvista.getTable().setModel(new TableModelArte(listaArte, CABECERA));\r\n\t\t\r\n\t\tvista.getLabelSize().setText(vista.getTable().getRowCount()+\" elementos.\");\r\n\t\tvista.getTxtBarraStatus().setText(\"TABLA CREADA\");\r\n\t\tvista.getButton_Modificar().setEnabled(true);\r\n\t\tvista.getButtonBorrar().setEnabled(true);\r\n\t\tvista.getButtonInsertarNuevo().setEnabled(true);\r\n\t\tvista.getMntmBorrarFila().setEnabled(true);\r\n\t\t//comprobarID();\r\n\t\t}\r\n});\t\t\t\r\n}" ]
[ "0.63208497", "0.6180567", "0.6047582", "0.6016436", "0.6014184", "0.6002217", "0.5995387", "0.5983121", "0.5861978", "0.5856897", "0.57780856", "0.5757266", "0.5734481", "0.57125086", "0.57045203", "0.569984", "0.56866074", "0.5675208", "0.56346524", "0.56329477", "0.5610608", "0.5597305", "0.55849046", "0.55736655", "0.5567618", "0.5548576", "0.5520631", "0.5503989", "0.5503347", "0.54949284", "0.5489252", "0.5480872", "0.54668975", "0.54544854", "0.54439133", "0.5436613", "0.54241043", "0.5415137", "0.540326", "0.53953564", "0.5393064", "0.539163", "0.5369741", "0.5368692", "0.5367487", "0.5367364", "0.5356173", "0.5350393", "0.5337327", "0.5326152", "0.5323897", "0.5319508", "0.5300304", "0.5295247", "0.52915734", "0.5282555", "0.52807754", "0.52799034", "0.5279411", "0.5271758", "0.52692086", "0.5267701", "0.52654546", "0.52645403", "0.5262107", "0.52510285", "0.52498513", "0.5234442", "0.52329075", "0.5231755", "0.52297825", "0.52266604", "0.5226624", "0.52143717", "0.52128184", "0.52097374", "0.5203989", "0.52001774", "0.51975906", "0.5194647", "0.5194647", "0.51946104", "0.5190891", "0.51888394", "0.51855236", "0.5180869", "0.5179043", "0.5175169", "0.51704013", "0.51698077", "0.51674724", "0.51643455", "0.5155215", "0.5152954", "0.51471025", "0.5141638", "0.5132463", "0.5123109", "0.51227736", "0.51204365" ]
0.7258981
0
Do operations on [user] table
public interface UserRepo extends BaseRepo<User, Integer>, UserCustomRepo { public User findByUserEmail(String userEmail); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "User modifyUser(Long user_id, User user);", "@Override\r\n\tpublic int updateUser(Users user) {\n\t\treturn 0;\r\n\t}", "void update(User user) throws SQLException;", "public void getAllUsers() {\n\t\t\n\t}", "public void update(JTable tblUser)\n {\n int i = tblUser.getSelectedRow();\n \n if(i != -1)\n {\n usersDto = users[i];\n \n CUpdateUser update;\n \n if(usersDto.getState() == 1)\n {\n update = new CUpdateUser(usersDto.getUserId());\n window.dispose();\n \n } else { JOptionPane.showMessageDialog(null, \"Solo se permite modificar registros activos\", \"ERROR\", JOptionPane.ERROR_MESSAGE); }\n \n } else { JOptionPane.showMessageDialog(null, \"Seleccione un registro a modificar\", \"ERROR\", JOptionPane.ERROR_MESSAGE); }\n }", "public void editUser(User user) {\n\t\t\n\t}", "public Boolean ins(User user);", "public void modifyUser() {\n\t\tUser selectedUser = null;\r\n\t\tselectedUser = tableUser.getSelectionModel().getSelectedItem();\r\n\t\tUser user = dataManager.findCurrentUser();\r\n\t\tif (user != null) {\r\n\t\t\tif (selectedUser != null) {\r\n\t\t\t\tframeManager.modifyUser(user, selectedUser);\r\n\t\t\t\tpesquisar();\r\n\t\t\t} else {\r\n\t\t\t\tAlertUtils.alertErroSelecionar(\"Para modificar um usuario é necessário selecionar um!\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tAlertUtils.alertSemPrivelegio();\r\n\t\t}\r\n\t}", "public void insertUser() {}", "public void updateUser(User user) {\n\t\t\r\n\t}", "@Override\n\tpublic void update(User objetc) {\n\t\tuserDao.update(objetc);\n\t}", "public int update(User user) throws SQLException {\n\t\treturn 0;\n\t}", "public void updateUser(User oldUser, User newUser) ;", "@Override\r\n\tpublic int update(User user) {\n\t\treturn 0;\r\n\t}", "public final void mo91725f(User user) {\n }", "@Override\r\n\tpublic int updateUser(User user, String userName) {\n\t\treturn 0;\r\n\t}", "public void clearUserTable() {\n\t\tSQLDelete deleteStatament = new SQLDelete();\n\t\tdeleteStatament.clearUserTable();\n\t}", "public void addtoTable(UserMaster user) {\n\t\tlogger.info(\"entering addtotable method in :user manager\");\n\t\tlogger.info(\"in addtotable\");\n\t\tSession session = null;\n\t\tsession = HibernateUtil.getSessionFactory().openSession();\n\t\tsession.getTransaction().begin();\n\t\tsession.save(user);\n\t\tsession.getTransaction().commit();\n\t\tlogger.info(\"transaction successfully committed\");\n\t}", "void add(User user) throws SQLException;", "protected void getUserList() {\n\t\tmyDatabaseHandler db = new myDatabaseHandler();\n\t\tStatement statement = db.getStatement();\n\t\t// db.createUserTable(statement);\n\t\tuserList = new ArrayList();\n\t\tsearchedUserList = new ArrayList();\n\t\tsearchedUserList = db.getUserList(statement);\n\t\tuserList = db.getUserList(statement);\n\t\tusers.removeAllElements();\n\t\tfor (User u : userList) {\n\t\t\tusers.addElement(u.getName());\n\t\t}\n\t}", "public org.eclipse.stardust.engine.api.query.Users\n getAllUsers(org.eclipse.stardust.engine.api.query.UserQuery query)\n throws org.eclipse.stardust.common.error.WorkflowException;", "void editUser(String uid, User newUser);", "void update(User user);", "void update(User user);", "public void editUser(User tmpUser, User user) {\n\t\t\n\t}", "@Override\n\tpublic void updateUser(user theUser) {\n\t}", "@Override\n public List<User> getAllUser() {\n// SQLParameter sqlParameter = DSL.select()\n// .from(TableOperand.table(User.class))\n// .build();\n// return executor.selectList(sqlParameter);\n return null;\n }", "public void updateUser(Person user) {\n\t\t\n\t}", "public void addUser() {\r\n PutItemRequest request = new PutItemRequest().withTableName(\"IST440Users\").withReturnConsumedCapacity(\"TOTAL\");\r\n PutItemResult response = client.putItem(request);\r\n }", "private static void multipleUsersExample()\t{\n\t}", "public void upload(JTable tblUser)\n {\n tableModel = (DefaultTableModel) tblUser.getModel();\n tableModel.setRowCount(0);\n String state;\n String profile;\n\t\t\n for (UsersDto user : users) {\n \n if (user.getUserProfile() == 1) { profile = \"Administrador\"; }\n else { profile = \"Usuario\"; }\n \n if (user.getState() == 1) { state = \"A\"; }\n else { state = \"*\"; }\n \n tableModel.addRow(new Object[]{user.getUserId(), user.getUserName(), user.getIdentification(), user.getRealName(), user.getSurname(), profile, state});\n }\n }", "public User update(User user) throws DataAccessException;", "public User updateUser(User user);", "public int insertUser(final User user);", "void updateUser(User entity) throws UserDaoException;", "@Override\r\n\tpublic User getAllUser() {\n\t\tList<User> list=null;\r\n\t\ttry {\r\n\t\t\tString sql = \"SELECT * FROM USER\";\r\n\t\t\treturn qr.query(sql, new BeanHandler<User>(User.class));\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "int updateUserById( User user);", "void storeUser(User user) throws DataAccessException;", "private void editUser(){\n getDeviceLocation();\n ProxyBuilder.SimpleCallback<User> callback = returnedUser-> responseEdit(returnedUser);\n ServerManager.editUserProfile(userManager,callback);\n }", "public void setUserMap() {\n ResultSet rs = Business.getInstance().getData().getAllUsers();\n try {\n while (rs.next()) {\n userMap.put(rs.getString(\"username\"), new User(rs.getInt(\"id\"),\n rs.getString(\"name\"),\n rs.getString(\"username\"),\n rs.getString(\"password\"),\n rs.getBoolean(\"log\"),\n rs.getBoolean(\"medicine\"),\n rs.getBoolean(\"appointment\"),\n rs.getBoolean(\"caseAccess\")));\n\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "@Override\r\n\tpublic int modifyUser(User user) {\n\t\treturn userMapper.modifyUser(user);\r\n\t}", "@Override\r\n\tpublic void viewAllUsers() {\n\t\tList<User> allUsers = new ArrayList<User>();\r\n\t\tallUsers = udao.getAllUsers();\r\n\t\t\r\n\t\tSystem.out.println(\"ALL USERS:\");\r\n\t\tSystem.out.println(\"ID\\tUsername\\tName\");\r\n\t\t\r\n\t\tfor(int i = 0; i < allUsers.size(); i++) {\r\n\t\t\tUser tempUser = allUsers.get(i);\r\n\t\t\tSystem.out.println(tempUser.getUserID() + \"\\t\" + tempUser.getUsername() + \"\\t\"\r\n\t\t\t\t\t+ tempUser.getFirstName() + \" \" + tempUser.getLastName());\r\n\t\t}\r\n\r\n\t}", "@Override\n\tpublic user getUser(int i) {\n\t\treturn userdb.get(i); \n\t}", "@Override\n protected void doDML(int i, TransactionEvent transactionEvent) {\n String userName = \"DB_ADMIN\";\n ViewObjectImpl userInfoVO = (ViewObjectImpl)this.getDBTransaction().getRootApplicationModule().findViewObject(\"XpeDccUserInfoROVO\");\n Row userInforVORow = userInfoVO.first();\n if(null!=userInforVORow)\n userName = (String)userInforVORow.getAttribute(\"USER_NAME\");\n //INSERT\n if(i==this.DML_INSERT){\n this.setCreatedBy(userName);\n this.setLastUpdatedBy(userName);\n }\n //UPDATE\n if(i==this.DML_UPDATE) \n this.setLastUpdatedBy(userName);\n \n super.doDML(i, transactionEvent);\n }", "public void update(User user);", "void update(User user, Connection connection) throws DAOException;", "private static void updateUserTest(Connection conn) {\n\t\t\n\t\ttry {\n\t\t\tUser existingUser = User.loadUserById(conn, 3); // User user = User.loadUserById(conn, 3);\n\t\t\t// the same id is preserved\n\t\t\texistingUser.setUsername(\"jo\");\n\t\t\texistingUser.setEmail(\"[email protected]\");\n\t\t\texistingUser.setUserGroupId(2);\n\t\t\texistingUser.saveToDB(conn);\n\t\t\t\n\t\t\t/*Następnie\tnależy\tsprawdzić,\tczy:\n\t\t\t\t1.\t Czy\twpis\tw\tbazie\tdanych\tma\twszystkie\n\t\t\t\tdane\todpowiednio\tponastawiane?\n\t\t\t\t2.\t Czy\tobiekt\tma\tnastawione\tpoprawne\tid? - czyli niezmienione, bo nie mamy settera dla id\n\t\t\t\t3.\t Czy\tnie\tdodał\tsię\tnowy\twpis\tw\tbazie?*/\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "@Override\n\tpublic void updateUser(User pUser) {\n\t\t\n\t}", "private void populateUser(final int amount) {\n for (int i = 0; i < amount; i++) {\n System.out\n .println(\"INSERT INTO `4400`.`User` (`username`, `password`) VALUES ('user\"\n + i + \"', 'user\" + i + \"');\");\n }\n }", "public void createTableUser(){\r\n Statement stmt;\r\n try {\r\n stmt = this.getConn().createStatement();\r\n ///////////////*********remember to retrieve*************/////////////\r\n //stmt.executeUpdate(\"create table user(username VARCHAR(40),email VARCHAR(40), password int);\");\r\n //stmt.executeUpdate(\"INSERT INTO user VALUES('A','[email protected]',12344);\");\r\n //stmt.executeUpdate(\"INSERT INTO user VALUES('CC','[email protected]',3231);\");\r\n } catch (SQLException e) { e.printStackTrace();}\r\n }", "@Transactional\r\n\tpublic List<User> getUserList() {\r\n\t\tString hql = \"from User\";\r\n\t\tQuery query = sessionFactory.getCurrentSession().createQuery(hql);\r\n\t\t\r\n\t\treturn query.list();\r\n\t}", "int updateByPrimaryKey(User record);", "int updateByPrimaryKey(User record);", "int updateByPrimaryKey(User record);", "int updateByPrimaryKey(User record);", "int updateByPrimaryKey(User record);", "int updateByPrimaryKey(User record);", "int updateByPrimaryKey(User record);", "int updateByPrimaryKey(User record);", "int updateByPrimaryKey(User record);", "public void updateUser() {\n Connection conn = null;\n try {\n conn = DriverManager.getConnection(db.DB.connectionString, db.DB.user, db.DB.password);\n Statement stmt = conn.createStatement();\n String query = \"update users set first_name='\" + firstName + \"', \";\n query += \"last_name='\" + lastName + \"', \";\n query += \"phone_number='\" + phoneNumber + \"', \";\n query += \"email='\" + email + \"', \";\n query += \"address='\" + address + \"', \";\n query += \"id_city='\" + idCity + \"' \";\n query += \"where id_user = \" + id;\n stmt.executeUpdate(query);\n\n User updatedUser = findUser(id);\n updatedUser.setFirstName(firstName);\n updatedUser.setLastName(lastName);\n updatedUser.setPhoneNumber(phoneNumber);\n updatedUser.setEmail(email);\n updatedUser.setIdCity(idCity);\n updatedUser.setAddress(address);\n\n } catch (SQLException ex) {\n Logger.getLogger(UserController.class.getName()).log(Level.SEVERE, null, ex);\n } finally {\n clear();\n try {\n conn.close();\n } catch (Exception e) {\n /* ignored */ }\n }\n }", "public boolean update(User u);", "@Override\n\tpublic void update(User user) throws DAOException {\n\t\t\n\t}", "int updateByPrimaryKey(BaseUser record);", "public boolean upadte(User user);", "@Override\r\n\tpublic int update(SpUser t) {\n\t\treturn 0;\r\n\t}", "protected void refreshAllUsers() {}", "@Override\n\tpublic String getTableName() {\n\t\treturn \"user\";\n\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tCursor result = null;\n\t\t\t\tUserEmotion rValue = null;\n\n\t\t\t\tString projection[] = dataContract.USER_COLUMNS;\n\t\t\t\tString selection = dataContract.Col._ID + \" LIKE ? AND \"\n\t\t\t\t\t\t+ dataContract.Col._OWNERID + \" LIKE ? \";\n\t\t\t\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tresult = mDB.query(dataContract.TABLE_USER, projection,\n\t\t\t\t\t\t\tselection, args, null, null, null);\n\n\t\t\t\t\tLog.i(tag, \"# of row: \" + result.getCount());\n\t\t\t\t\tif (result != null && result.moveToFirst()) {\n\t\t\t\t\t\trValue = getUserDataFromCursor(result);\n\t\t\t\t\t\tresult.close();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (rValue == null) {\n\t\t\t\t\t\tContentValues values = new ContentValues();\n\n\t\t\t\t\t\tvalues.put(dataContract.Col._ID, giftId);\n\t\t\t\t\t\tvalues.put(dataContract.Col._OWNERID, userId);\n\t\t\t\t\t\tvalues.put(dataContract.Col._TOUCHED, 0);\n\t\t\t\t\t\tvalues.put(dataContract.Col._INPROP, 0);\n\t\t\t\t\t\tvalues.put(dataContract.Col._OBSCENE, 0);\n\t\t\t\t\t\tlong row = mDB.insert(dataContract.TABLE_USER, null, values);\n\n\t\t\t\t\t\tresult = mDB.query(dataContract.TABLE_USER, projection,\n\t\t\t\t\t\t\t\tselection, args, null, null, null);\n\t\t\t\t\t\t\n\t\t\t\t\t\tLog.i(tag, \"# of row: \" + row + \" query result: \" + result.getCount());\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (result != null && result.moveToFirst()) {\n\t\t\t\t\t\t\trValue = getUserDataFromCursor(result);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tMessage msg = Message.obtain(handler,\n\t\t\t\t\t\t\tPotlatchMsg.QUERY_USERDATA.getVal());\n\t\t\t\t\tBundle b = new Bundle();\n\t\t\t\t\tb.putSerializable(PotlatchConst.query_user_data,\n\t\t\t\t\t\t\trValue);\n\t\t\t\t\tmsg.setData(b);\n\t\t\t\t\thandler.sendMessage(msg);\n\t\t\t\t\tresult.close();\n\t\t\t\t}\n\n\t\t\t\tcatch (Exception e) {\n\t\t\t\t\tLog.d(tag, e.getMessage());\n\t\t\t\t}\n\t\t\t}", "void updateUserById(String username, User userData);", "@Override\r\n\tpublic void updateUser(User user) throws ToDoListDAOException{\r\n\t\t// TODO Auto-generated method stub\r\n\t\t Session session = factory.openSession();\r\n\t\t try\r\n\t\t {\r\n\t\t session.beginTransaction();\r\n\t\t Query query = session.createQuery(\"from User where userName = :user\");\r\n\t\t User ifUserExist =(User) query.setParameter(\"user\",user.getUserName()).uniqueResult();\r\n\t\t long id = ifUserExist.getId();\r\n\t\t Query query2 = session.createQuery(\"UPDATE User SET password = :pass , userName= :user\" +\r\n\t\t \" where id = :d\");\r\n\t\t query2.setParameter(\"pass\", user.getPassword());\r\n\t\t query2.setParameter(\"user\", user.getUserName());\r\n\t\t query2.setParameter(\"d\", id);\r\n\t\t query2.executeUpdate();\r\n\t\t session.getTransaction().commit();\r\n\t\t \r\n\t\t }\r\n\t\t catch (HibernateException e)\r\n\t\t {\r\n\t\t e.printStackTrace();\r\n\t\t if(session.getTransaction()!=null) session.getTransaction().rollback();\r\n\t\t }\r\n\t\t finally\r\n\t\t {\r\n\t\t\t if(session != null) \r\n\t\t\t\t{ \r\n\t\t\t\t\tsession.close(); \r\n\t\t\t\t} \r\n\t\t } \r\n\t}", "@VisibleForTesting\n void checkUserDeletions() {\n final String METHOD = \"checkUserDeletions\";\n LOGGER.entering(CLASS_NAME, METHOD);\n\n NotesView usersView = null;\n Statement stmt = null;\n ArrayList<Long> usersToDelete = new ArrayList<Long>();\n try {\n String userSelectionFormula = connectorSession.getUserSelectionFormula();\n\n // TODO: why do we have to use this view and an abbreviated\n // full name as opposed to just using the people/groups view\n // we use elsewhere?\n usersView = directoryDatabase.getView(NCCONST.DIRVIEW_VIMUSERS);\n usersView.refresh();\n stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,\n ResultSet.CONCUR_READ_ONLY);\n ResultSet rs = stmt.executeQuery(\"select userid,notesname from \"\n + userTableName);\n while (rs.next()) {\n long userId;\n String fullName;\n try {\n userId = rs.getLong(1);\n fullName = rs.getString(2);\n } catch (SQLException e) {\n LOGGER.log(Level.WARNING, \"Failure reading user table data\", e);\n continue;\n }\n try {\n String abbrevFormula = String.format(\"@Name([ABBREVIATE];\\\"%s\\\")\",\n fullName);\n String key = notesSession.evaluate(abbrevFormula).elementAt(0)\n .toString();\n NotesDocument notesUserDoc = usersView.getDocumentByKey(key);\n if (notesUserDoc == null) {\n // This person or group no longer exists. Remove them\n LOGGER.log(Level.INFO, \"User no longer exists in source directory\"\n + \" and will be deleted: {0}\", key);\n usersToDelete.add(userId);\n } else {\n // Do an additional check for Persons to make sure they\n // still meet the selection criteria\n if (!checkPersonSelectionFormula(userSelectionFormula,\n notesUserDoc)) {\n LOGGER.log(Level.INFO, \"User no longer meets selection criteria\"\n + \" and will be deleted: {0}\", key);\n usersToDelete.add(userId);\n }\n Util.recycle(notesUserDoc);\n }\n } catch (Exception e) {\n LOGGER.log(Level.WARNING,\n \"Failure checking user deletion: \" + fullName, e);\n }\n }\n } catch (Exception e) {\n LOGGER.log(Level.WARNING, \"Error checking deletions\", e);\n } finally {\n Util.recycle(usersView);\n Util.close(stmt);\n }\n\n for (Long userId : usersToDelete) {\n try {\n removeUser(userId);\n } catch (SQLException e) {\n LOGGER.log(Level.WARNING, \"Error removing user: \" + userId, e);\n }\n }\n LOGGER.exiting(CLASS_NAME, METHOD);\n }", "@Query(\"SELECT * FROM USERS_TABLE\")\n List<UsersEntity>checkUsernameAndPassword();", "@Override\n\tpublic boolean modify(User user) {\n\t\tConnection connection = null;\n\t\tboolean flag = false;\n\t\ttry {\n\t\t\tconnection = BaseDao.getConnection();\n\t\t\tif(userMapper.modify(connection,user) > 0)\n\t\t\t\tflag = true;\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t\tBaseDao.closeResource(connection, null, null);\n\t\t}\n\t\treturn flag;\n\t}", "@Override\n public void intsertUser(SysUser user) {\n System.out.println(\"user插入到mysql数据库中(oracle数据库):\"+user);\n }", "private void testUserName(){\r\n\t\t//get user with the 'test' userName\r\n\t\tString command = \"SELECT userName FROM users \"\r\n\t\t\t\t+ \"WHERE userName = \\\"\" + commandList.get(1) + \"\\\";\";\r\n\t\tSystem.out.println(command);//print command\r\n\t\ttry {//send command\r\n\t\t\trs = stmt.executeQuery(command);\r\n\t\t\t\r\n\t\t\tif(rs.next()){//if it returns user, userName exists\r\n\t\t\t\tout.println(\"exists\");\r\n\t\t\t} else {//no results returned, empty\r\n\t\t\t\tout.println(\"free\");\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\tout.println(e.getMessage());//send back error message\r\n\t\t}\r\n\t\t\r\n\r\n\t}", "public static List<user> getAll() throws SQLException {\n\t\ttry {\n\t\t\tuserExample example = new userExample();\n\t\t\tList<Integer> values = new ArrayList<Integer>();\n\t\t\tvalues.add(0);\n\t\t\tvalues.add(1);\n\t\t\texample.or().andStatusIn(values);\n\n\t\t\treturn mapper.selectByExample(example);\n\n\t\t} finally {\n\t\t\tsqlSession.close();\n\t\t}\n\t}", "@Override\n\tpublic void updateUser(User user)\n\t{\n\n\t}", "void userChangeByAdmin(AdminUserDTO adminUserDTO) throws RecordExistException;", "public ResultSet Reuser()throws SQLException {\n\trs=DbConnect.getStatement().executeQuery(\"select c.user_id,c.first_name,c.last_name from customer c,login l where l.login_id=c.login_id and l.usertype='user' and l.status='not approved'\");\r\n\treturn rs;\r\n}", "@Override\n\tpublic void updateUser(SpaceUserVO spaceUserVO) throws Exception {\n\t\t\n\t}", "public void addUser() {\n\t\tthis.users++;\n\t}", "private void getUser(){\n mainUser = DatabaseAccess.getUser();\n }", "@Override\r\n\tpublic void updateUser(TUsers tuser) {\n\t\tdao.updateUser(tuser);\r\n\t}", "public void update(User u) {\n\r\n\t}", "private void updateUserWithoutPassword() throws ClassNotFoundException, NoSuchAlgorithmException{\n\t\tint currentPositionInTableView = usersTable.getSelectionModel().getSelectedIndex(); // zapamiętaj bieżące podświetlenie w tabeli\n\t\tif ((isAllFieldsAreFull()) \n\t\t\t\t&& (isLoginUnique(usersTable.getSelectionModel().getSelectedItem().getId()))){\t\n\t\t\t\t\tMain.getMMUser().update(\t\t\t\t \n\t\t\t\t\t\t\tnew User(\n\t\t\t\t\t\t\t\t\tusersTable.getSelectionModel().getSelectedItem().getId(),\n\t\t\t\t\t\t\t\t\tuserLoginField.getText(), \n\t\t\t\t\t\t\t\t\tusersTable.getSelectionModel().getSelectedItem().getPassword(), \n\t\t\t\t\t\t\t\t\tuserNameField.getText(), \n\t\t\t\t\t\t\t\t\tuserLastNameField.getText(), \n\t\t\t\t\t\t\t\t\tpermission,\n\t\t\t\t\t\t\t\t\teditingCheck.isSelected(),\n\t\t\t\t\t\t\t\t\treminderCheck.isSelected()));\n\t\t\t\t\t// pokaż aktualny stan bazy pracowników\n\t\t\t\t\treadUsers();\n\t\t\t\t\tshowUsers();\n\t\t\t\t\tusersTable.getSelectionModel().select(currentPositionInTableView); // ustaw podswietlenie na bieżący wiersz\n\t\t\t\t\tnew AlertDialog(\"Operacja zakończona\", \"Zaktualizowano dane\", AlertType.INFORMATION);\n\t\t}\n\t}", "public void selectAllUser() {\n String sql = \"SELECT id, user, publickey, password, salt FROM users\";\n\n try (Connection conn = this.connect();\n Statement stmt = conn.createStatement();\n ResultSet rs = stmt.executeQuery(sql)) {\n\n // loop through the result set\n while (rs.next()) {\n System.out.println(rs.getInt(\"id\") + \"\\t\" + rs.getString(\"user\") + \"\\t\" + rs.getDouble(\"publickey\")\n + \"\\t\" + rs.getString(\"password\") + \"\\t\" + rs.getString(\"salt\"));\n }\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "@Override\r\n\tprotected final void objectDataMapping() throws BillingSystemException{\r\n\t\tString[][] data=getDataAsArray(USER_DATA_FILE);\r\n\t\tif(validateData(data,\"Authorised User\",COL_LENGTH)){\r\n\t\tList<User> listUser=new ArrayList<User>();\r\n\t\t\r\n\t\tfor(int i=0;i<data.length;i++){\r\n\t \t\r\n\t \tUser usr=new User();\r\n\t \t\t\r\n\t \tusr.setUsername(data[i][0]);\r\n\t \tusr.setPassword(data[i][1]);\r\n\t \tusr.setRole(getRoleByCode(data[i][2]));\r\n\t \t\r\n\t \tlistUser.add(usr);\t\r\n\t }\r\n\r\n\t\t\r\n\t\tthis.listUser=listUser;\r\n\t\t}\r\n\t}", "@Override\n\tpublic void insert(User objetc) {\n\t\tuserDao.insert(objetc);\n\t\t\n\t}", "void remove(User user) throws SQLException;", "User getUserInformation(Long user_id);", "@Query(\"DELETE FROM USERS_TABLE\")\n void deleteAllUsers();", "public List getAllUsers();", "User editUser(User user);", "@Override\n\tpublic int modifyUser(User user) {\n\t\tuser.setUpdateTime(new Date());\n\t\treturn userDao.updateUserById(user);\n\t}", "public void insert(User user);", "void add(User user) throws AccessControlException;", "private void refreshInformationsFromTableView(User usr){\n\t\thideLackMessages();\n\t\tnewUser = false;\n\t\t\n\t\tif (usr != null){\n\t\t\tsetPrivilagesToModifyUser(usr);\n\t\t\thidePassword();\n\t\t\tchangeCancelButton.setText(\"Zmień hasło\");\n\t\t\tuserNameField.setText(usr.getFirstName());\n\t\t\tuserLastNameField.setText(usr.getLastName());\n\t\t\tuserLoginField.setText(usr.getLogin());\n\t\t\tuserPasswordField.setText(usr.getPassword());\n\t\t\t\n\t\t\tif (usr.getPermissions().equals(\"manager\")) userPermissionsBox.getSelectionModel().select(0);\n\t\t\t\n\t\t\tif (usr.getPermissions().equals(\"pracownik\")) userPermissionsBox.getSelectionModel().select(1);\n\t\t\t\n\t\t\thideShowCheckBoxes();\n\t\t\t\n\t\t\teditingCheck.setSelected(usr.getEditing());\n\t\t\treminderCheck.setSelected(usr.getReminder());\n\t\t}\n\t\telse {\n\t\t\tuserNameField.setText(\"\");\n\t\t\tuserLastNameField.setText(\"\");\n\t\t\tuserLoginField.setText(\"\");\n\t\t\tuserPasswordField.setText(\"\");\n\t\t\tuserConfirmPasswordField.setText(\"\");\n\t\t\tuserPermissionsBox.getSelectionModel().select(null);\n\t\t\teditingCheck.setSelected(false);\n\t\t\treminderCheck.setSelected(false);\n\t\t}\n\t}", "List<User> loadActiveUsers(User user);", "int insertSelective(User record);", "int insertSelective(User record);" ]
[ "0.6348393", "0.6193689", "0.6092406", "0.5981815", "0.59736824", "0.5955251", "0.59471667", "0.5946639", "0.5946421", "0.59104896", "0.5894118", "0.58727527", "0.58661044", "0.5857431", "0.58556783", "0.5844141", "0.5840577", "0.5829316", "0.58244723", "0.58168894", "0.5815128", "0.58106667", "0.58101344", "0.58101344", "0.58081067", "0.5805701", "0.58040917", "0.5796024", "0.57811356", "0.57737046", "0.57679397", "0.5767631", "0.57632554", "0.57585293", "0.5751482", "0.5748478", "0.57481116", "0.5747802", "0.5742597", "0.57346696", "0.57296276", "0.5727466", "0.5719191", "0.5718387", "0.57130945", "0.5709996", "0.57040197", "0.5691563", "0.56858414", "0.56777537", "0.5676384", "0.5666331", "0.5666331", "0.5666331", "0.5666331", "0.5666331", "0.5666331", "0.5666331", "0.5666331", "0.5666331", "0.56607217", "0.56582266", "0.565469", "0.5653732", "0.5653161", "0.5652708", "0.56404907", "0.56373644", "0.56296396", "0.5611529", "0.5610094", "0.5608983", "0.5592991", "0.5585958", "0.55723065", "0.5571501", "0.55685604", "0.5566651", "0.5565872", "0.55647075", "0.55642074", "0.55629766", "0.5562893", "0.55577844", "0.5557156", "0.554462", "0.5543235", "0.55427814", "0.5542601", "0.5532528", "0.5532304", "0.5523933", "0.5521961", "0.55121946", "0.5510784", "0.5509456", "0.55087215", "0.5507911", "0.5507619", "0.550455", "0.550455" ]
0.0
-1
The method adds a new storage into list "storages".
public void addStorage(AbstractStorageOfFoods storage) { storages.add(storage); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addStorageSystem(URI storage, URI[] providers, boolean primaryProvider, String opId) throws InternalException;", "@Override\r\n\tpublic void addStorageUnit() {\r\n\t}", "public void addStorage(StackType option);", "private void initStorage() {\n storageList = new ItemsList();\n storageList.add(new StorageItem(1, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\pen.png\", \"pen\", 3));\n storageList.add(new StorageItem(2, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\pencil.png\", \"pencil\", 2));\n storageList.add(new StorageItem(3, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\book.jpg\", \"book\", 21));\n storageList.add(new StorageItem(4, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\rubber.png\", \"rubber\", 1));\n storageList.add(new StorageItem(5, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\calculator.png\", \"calculator\", 15));\n storageList.add(new StorageItem(6, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\cover.jpg\", \"cover\", 4));\n storageList.add(new StorageItem(7, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\globe.png\", \"globe\", 46));\n storageList.add(new StorageItem(8, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\map.jpg\", \"map\", 10));\n storageList.add(new StorageItem(9, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\marker.png\", \"marker\", 6));\n\n }", "public void addStorageCard(com.hps.july.persistence.StorageCard arg0) throws java.rmi.RemoteException, javax.ejb.FinderException, javax.naming.NamingException {\n\n instantiateEJB();\n ejbRef().addStorageCard(arg0);\n }", "public int addStorageplace (Storageplace pStorageplace){\r\n\t List<Storageplace> storageplaceList = getAll();\r\n\t boolean storageplaceExists = false;\r\n\t for(Storageplace storageplace: storageplaceList){\r\n\t if(storageplace.getStorageplaceName() == pStorageplace.getStorageplaceName()){\r\n\t \t storageplaceExists = true;\r\n\t break;\r\n\t }\r\n\t }\t\t\r\n\t if(!storageplaceExists){\r\n\t \t storageplaceList.add(pStorageplace);\r\n\t // Setup query\r\n\t String query = \"INSERT INTO storageplace(storageplace_name) VALUE(?);\";\r\n\t Connection conn = Database.connectMariaDb();\r\n\t try {\r\n\t\t\t\t// Setup statement\r\n\t\t\t\t PreparedStatement stmt = conn.prepareStatement(query);\r\n\t\t\t\t // Set values\r\n\t\t\t\tstmt.setString(1, pStorageplace.getStorageplaceName());\t\t\t\t\t\t\r\n\t\t\t\t// Execute statement\r\n\t\t\t\tstmt.executeUpdate();\t\t\t\t\r\n\t\t\t\t// Closing statement and connection\r\n\t\t\t\tstmt.close();\r\n\t\t\t\tDatabase.mariaDbClose();\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\tSystem.err.println(\"An SQL exception occured when trying to add a record to storageplace \" + e.getMessage());\r\n\t\t\t\treturn 0;\r\n\t\t\t}\t\t \r\n\t return 1;\r\n\t }\r\n\t return 0;\r\n\t }", "void saveStorage(StorageEntity storage);", "@Override\n @POST\n @Path(\"/storages\")\n public Response createStorage() throws Exception {\n URI resourceUri = new URI(\"/1\");\n return Response.created(resourceUri).build();\n }", "@Override\n\tpublic String addInStorage(InStorage ins) {\n\t\treturn super.addObject(ins);\n\t}", "public void setStorage(Storage storage) {\n this.storage = storage;\n }", "public synchronized WritableStorage register(String id, WritableStorage storage) {\n log.info(\"Registered \" + id + \": \" + storage);\n return writeStorages.put(id, storage);\n }", "public void add(Stock s)\n {\n stocks.add(s);\n }", "public synchronized ReadableStorage register(String id, ReadableStorage storage) {\n log.info(\"Registered \" + id + \": \" + storage);\n return readStorages.put(id, storage);\n }", "public Storage(int storageSize) {\n\t\tstorageSpace = new Block[storageSize];\n\t}", "public synchronized void add( StorageObject target )\r\n {\r\n\t if( target == null ) throw new RuntimeException(\r\n\t\t\"Illegal attempt to add a null storage object to a list.\");\r\n\r\n EntryStorage entry = home().create( target.get_pid(), null, null, false );\r\n\r\n EntryStorage header = header();\r\n if( header != null ) synchronized( header )\r\n {\r\n // We have a list with at least one entry. Adding an entry involves updating the\r\n // last entry to include the new entry as its next entry and update the header to\r\n // reference the new entry as the header's prev entry (last entry).\r\n\r\n if( size() == 1 )\r\n {\r\n header.prev( entry.reference() );\r\n header.next( entry.reference() );\r\n entry.prev( header.reference() );\r\n size( 2 );\r\n }\r\n else\r\n {\r\n EntryStorage last = header.prev();\r\n if( last != null ) synchronized( last )\r\n {\r\n header.prev( entry.reference() );\r\n entry.prev( last.reference() );\r\n last.next( entry.reference() );\r\n size( size() + 1 );\r\n }\r\n else\r\n\t {\r\n entry.destroy_object();\r\n\t\t throw new RuntimeException(\r\n\t \"EntryStorage header return a null prev entry in list of size = \" + size()\r\n + \"\\n\" + this \r\n );\r\n }\r\n\t }\r\n }\r\n else\r\n {\r\n \r\n // This is an empty list so put a reference to the new EntryStorage \r\n // in the list header and set the header prev slot to the same value.\r\n\r\n entry.prev( entry.reference() );\r\n header( entry.reference() );\r\n size( 1 );\r\n }\r\n }", "protected void addVolumeStorageSystem(Map<URI, StorageSystem> volumeStorageSystems, Volume volume) {\n if (volumeStorageSystems == null) {\n volumeStorageSystems = new HashMap<URI, StorageSystem>();\n }\n\n StorageSystem volumeStorageSystem = volumeStorageSystems.get(volume.getStorageController());\n if (volumeStorageSystem == null) {\n volumeStorageSystem =\n _dbClient.queryObject(StorageSystem.class, volume.getStorageController());\n volumeStorageSystems.put(volumeStorageSystem.getId(), volumeStorageSystem);\n }\n }", "public void addStoreStock(String name, int amount);", "public void setStorage(com.hps.july.persistence.StoragePlaceAccessBean newStorage) {\n\tstorage = newStorage;\n}", "protected abstract void updateStorage(MasterMetaStorage storage) throws JSONException;", "public void setStorage(String storage) {\n if (storage == null || storage.equals(\"\") || storage.equals(\" \")) {\n throw new IllegalArgumentException(\"storage must be provided\");\n }\n this.storage = storage;\n }", "void replaceStorage(OStorage iNewStorage);", "public void secondaryAddStorageCard(com.hps.july.persistence.StorageCard arg0) throws java.rmi.RemoteException, javax.ejb.FinderException, javax.naming.NamingException {\n\n instantiateEJB();\n ejbRef().secondaryAddStorageCard(arg0);\n }", "public interface StorageService {\n\t\n\t/**\n\t * Storage.\n\t *\n\t * @param storage the storage\n\t * @return the storage state\n\t */\n\tpublic StorageState storage(ArrayList<StorageVO> storage);\n\t\n}", "@Override\n\tpublic void setStorage() {\n\t\tcom.setStorage(\"256g SSD\");\n\t}", "public interface IStorageManager {\n public IStorageBook getValue(String key);\n\n public void addStorageBook(String key, IStorageBook book);\n\n public void clear();\n\n public boolean isEmpty();\n\n public void remove(String key);\n}", "public interface IStorageService {\n List<Storage> findStorageList();\n}", "public interface IStorageManager {\n\n\tpublic String getStorageType();\n\n\tpublic String getStorageId();\n\n\tpublic void initialize(String configFile) throws Exception;\n}", "public void addCard(Card cardToAdd) {\n storageCards.add(cardToAdd);\n }", "void editStorage(StorageEntity storage);", "public interface BlockStorageManagementController extends StorageController {\n\n /**\n * Add Storage system to SMIS Provider\n * \n * @param storage : URI of the storage system to add to the providers\n * @param providers : array of URIs where this system must be added\n * @param primaryProvider : indicate if the first provider in the list must\n * be treated as the active provider\n * @throws InternalException\n */\n public void addStorageSystem(URI storage, URI[] providers, boolean primaryProvider, String opId) throws InternalException;\n\n /**\n * Validate storage provider connection.\n * \n * @param ipAddress the ip address\n * @param portNumber the port number\n * @param interfaceType\n * @return true, if successful\n */\n public boolean validateStorageProviderConnection(String ipAddress, Integer portNumber, String interfaceType);\n}", "@Override\n @Path(\"/storages/{sid}\")\n public IStorageResource findStorage(@PathParam(\"sid\") int storageId) {\n return new StorageResource(provider.getProviderId(), cluster.getClusterId(), storageId);\n }", "public void updateStorage(Map<Resource, Integer> newStorage) {\n\n this.gameboardPanel.updateStorage(newStorage);\n\n }", "public Storage(String s){\n this.path=s;\n }", "void setStorage(@NonNull Storage storage) {\n setValue(0, verifyNotNull(storage));\n }", "@Override\n @GET\n @Path(\"/storages\")\n @Produces(\"application/json\")\n public Response getStorages() {\n String json = String.format(\"Provider %d cluster %d storages.\", provider.getProviderId(), cluster.getClusterId());\n return Response.ok(json).build();\n }", "protected void setStorage(IStorage aStorage)\n\t{\n\n\t\tthis.storage = aStorage;\n\t}", "protected void addToStoredStrings(String s) {\n \tif (debug) debug(\n \t\t\"addToStoredStrings(s=\", StringUtil.toString(s), \") at index=\",\n \t\tString.valueOf(storedStrings.size())\n \t);\n storedStrings.add(s);\n }", "public void setStorageLocation(String storageLocation) {\n this.storageLocation = storageLocation;\n }", "public void setStorageSize(Integer storageSize) {\n\t this.storageSize = storageSize;\n\t}", "public abstract void addObject(LocalAbstractObject object) throws BucketStorageException;", "public interface SCStorage\r\n{\r\n\t/**\r\n\t * The server will register a driver before making any method calls\r\n\t *\r\n\t * @param driver the driver\r\n\t */\r\n\tpublic void setStorageServerDriver(SCStorageServerDriver driver);\r\n\r\n\t/**\r\n\t * Open the storage at the given path\r\n\t *\r\n\t * @param path path to the storage\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic void\topen(File path) throws IOException;\r\n\r\n\t/**\r\n\t * Return the object associated with the given key\r\n\t *\r\n\t * @param key the key\r\n\t * @return the object or null if not found\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic SCDataSpec get(String key) throws IOException;\r\n\r\n\t/**\r\n\t * Add an object to the storage\r\n\t *\r\n\t * @param key key\r\n\t * @param data object\r\n\t * @param groups associated groups or null\r\n\t */\r\n\tpublic void put(String key, SCDataSpec data, SCGroupSpec groups);\r\n\r\n\t/**\r\n\t * Close the storage. The storage instance will be unusable afterwards.\r\n\t *\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic void close() throws IOException;\r\n\r\n\t/**\r\n\t * Return the keys that match the given regular expression\r\n\t *\r\n\t * @param regex expression\r\n\t * @return matching keys\r\n\t */\r\n\tpublic Set<String> regexFindKeys(String regex);\r\n\r\n\t/**\r\n\t * Remove the given object\r\n\t *\r\n\t * @param key key of the object\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic void remove(String key) throws IOException;\r\n\r\n\t/**\r\n\t * sccache supports associative keys via {@link SCGroup}. This method deletes all objects\r\n\t * associated with the given group.\r\n\t *\r\n\t * @param group the group to delete\r\n\t * @return list of keys deleted.\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic List<String> removeGroup(SCGroup group) throws IOException;\r\n\r\n\t/**\r\n\t * sccache supports associative keys via {@link SCGroup}. This method lists all keys\r\n\t * associated with the given group.\r\n\t *\r\n\t * @param group the group to list\r\n\t * @return list of keys\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic List<String> listGroup(SCGroup group) throws IOException;\r\n\r\n\t/**\r\n\t * Returns storage statistics\r\n\t *\r\n\t * @param verbose if true, verbose stats are returned\r\n\t * @return list of stats\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic List<String> dumpStats(boolean verbose) throws IOException;\r\n\r\n\t/**\r\n\t * Write a tab delimited file with information about the key index\r\n\t *\r\n\t * @param f the file to write to\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic void writeKeyData(File f) throws IOException;\r\n}", "private void addToMethodStorage(Method[] methods, Set<MethodBox> storage) {\n Arrays.stream(methods)\n .filter(method -> Modifier.isAbstract(method.getModifiers()))\n .map(MethodBox::new)\n .collect(Collectors.toCollection(() -> storage));\n }", "@Override\n public void executeStorage(TaskList items, Ui ui, Storage storage) {\n }", "@Override\n public void executeStorage(TaskList items, Ui ui, Storage storage) {\n }", "public void store(Item item) {\n this.items.add(item);\n }", "public void getListAt( final String name, StorageLister lister ) throws TJSException;", "public interface DistributeStorage<T> {\n public void store(String path, T t, boolean create) throws StorageException;\n\n public T get(String path, Class<T> tClass) throws StorageException;\n\n public void del(String path) throws StorageException;\n\n public boolean exist(String path) throws StorageException;\n}", "public interface Storage extends ClientListStorage, UserPrefsStorage, PolicyListStorage {\n\n @Override\n Optional<UserPrefs> readUserPrefs() throws DataConversionException, IOException;\n\n @Override\n void saveUserPrefs(ReadOnlyUserPrefs userPrefs) throws IOException;\n\n @Override\n Path getClientListFilePath();\n\n @Override\n Optional<ReadOnlyClientList> readClientList() throws DataConversionException, IOException;\n\n @Override\n void saveClientList(ReadOnlyClientList clientList) throws IOException;\n\n @Override\n Path getPolicyListFilePath();\n\n @Override\n Optional<PolicyList> readPolicyList() throws DataConversionException, IOException;\n\n @Override\n void savePolicyList(PolicyList policyList) throws IOException;\n}", "StorageEntity getStorageById(Integer id);", "@Override\n\tpublic void addInStock(Stock s) {\n\t\n\t}", "public void addVolume(StandAlone newVolume) {\r\n volumes.add(newVolume);\r\n }", "public void setStorageType(short type) {\n\tstorageType = type;\n }", "public interface StorageService {\n\n /**\n * List all the {@link Bucket}s in a given {@link com.google.openbidder.ui.entity.Project}.\n */\n List<Bucket> listAllBuckets(ProjectUser projectUser);\n\n /**\n * List all the objects in a given {@link Bucket}.\n */\n BucketContents listAllObjectsInBucket(ProjectUser projectUser, String bucketName);\n\n /**\n * List all objects in a given {@link Bucket} with a prefix.\n */\n BucketContents listAllObjectsInBucket(\n ProjectUser projectUser,\n String bucketName,\n String objectPrefix);\n\n /**\n * Remove the specified object.\n */\n void deleteObject(ProjectUser projectUser, String bucketName, String objectName);\n}", "OStorage getStorage();", "public void addWarehouseStock(String name, int amount);", "public void addItem(StorageCartLine storageCartLine){\n\t\t\n\t\tStorageCartLine searched = this.searchById(storageCartLine.getProduct().getId(), this.getStorageCartLine());\n\t\tif(searched != null){\n\t\t\tthis.addProductFromStorageCart(storageCartLine);\n\t\t}else{\n\t\t\tthis.getStorageCartLine().add(storageCartLine);\n\t\t}\n\t\tthis.totalPrize = calculatePrize(this.getStorageCartLine());\n\t\t\n\t}", "public abstract FlowNodeStorage instantiateStorage(MockFlowExecution exec, File storageDirectory);", "@Test\n public void putStorageSameKey() {\n byte[] txDataMethodArguments = ABIUtil.encodeMethodArguments(\"putStorageSameKey\");\n AvmRule.ResultWrapper resultWrapper = avmRule.call(from, dappAddr, BigInteger.ZERO, txDataMethodArguments, energyLimit, energyPrice);\n Assert.assertTrue(resultWrapper.getReceiptStatus().isSuccess());\n Assert.assertEquals(35281 + 74 * 5 +\n RuntimeMethodFeeSchedule.BlockchainRuntime_avm_setStorage +\n 4 * RuntimeMethodFeeSchedule.BlockchainRuntime_avm_resetStorage + 500, energyLimit - resultWrapper.getTransactionResult().getEnergyRemaining());\n }", "public List<VPlexStorageSystemInfo> getStorageSystemInfo() throws VPlexApiException {\n s_logger.info(\"Request for storage system info for VPlex at {}\", _baseURI);\n return _discoveryMgr.getStorageSystemInfo();\n }", "public Builder setItemStorage(int value) {\n bitField0_ |= 0x00000040;\n itemStorage_ = value;\n onChanged();\n return this;\n }", "@RequiresPermissions(\"/storage/plugin/add\")\n\t@RequestMapping(value = \"/{type}/add/\", method = RequestMethod.POST)\n\tpublic String addStorageForm(@PathVariable(\"type\") String type, HttpSession session, HttpServletRequest request) {\n\t\tString host = request.getParameter(\"hc_mysql_host\");\n\t\tString port = request.getParameter(\"hc_mysql_port\");\n\n\t\tOdpsContent odps = new OdpsContent();\n\t\todps.setHost(host);\n\t\todps.setType(type);\n\n\t\tString id = request.getParameter(\"hc_mysql_id\");\n\t\tif (id != null && id != \"\") {\n\t\t\todps.setId(Integer.valueOf(id));\n\t\t}\n\n\t\ttry {\n\t\t\todps.setPort(Integer.valueOf(port));\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn \"redirect:/errors/500\";\n\t\t}\n\t\tif (JConstants.MYSQL.equals(type)) {\n\t\t\tString username = request.getParameter(\"hc_mysql_username\");\n\t\t\tString password = request.getParameter(\"hc_mysql_password\");\n\t\t\todps.setUsername(username);\n\t\t\todps.setPassword(password);\n\t\t}\n\t\tif (storageService.replace(odps) > 0) {\n\t\t\treturn \"redirect:/storage/\" + type;\n\t\t} else {\n\t\t\treturn \"redirect:/errors/500\";\n\t\t}\n\t}", "@Override\n\tpublic synchronized StorageOperationResponse<GetStoragePoolsResponse> getStoragePools(\n\t\t\tGetStoragePoolsRequest request) {\n\t\tlogger.log(IJavaEeLog.SEVERITY_DEBUG, this.getClass().getName(), \"getStoragePools: request:\" + request, null);\n\t\tGetStoragePoolsResponse payload = new GetStoragePoolsResponse();\n\t\tArrayList<StoragePool> storagePools = new ArrayList<StoragePool>();\n\t\tList<String> zones = null;\n\t\t BlockLimits blockLimits=openstackClient.getBlockStorageLimits();\n\t\t long totalSpaceGB=blockLimits.getAbsolute().getMaxTotalVolumeGigabytes();\n\t\t long usedSpaceGB=blockLimits.getAbsolute().getTotalGigabytesUsed();\n\t\t \n\t\tif (request.storageSystemId != null) {\n\t\t\tString region = openstackClient.getOpenstackId(request.storageSystemId);\n\t\t\ttry {\n\t\t\t\tzones = openstackClient.listAvailabilityZones(region);\n\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\tlogger.traceThrowable(IJavaEeLog.SEVERITY_DEBUG, this.getClass().getName(), \"getStoragePools:\" + e.getMessage(), null,e);\n\t\t\t \treturn StorageAdapterImplHelper.createFailedResponse(e.getMessage(), GetStoragePoolsResponse.class); \n\t\t\t}\n\t\t\n\t\t\tfor (String zone:zones) {\n\t\t\t\tstoragePools.add(OpenstackAdapterUtil.createStoragePool(zone, region, accountId, totalSpaceGB, usedSpaceGB));\n\t\t\t}\n\t\t\n\t\t} else {\n\t\t if (request.storagePoolIds == null || request.storagePoolIds.isEmpty()) {\n\t\t\t return StorageAdapterImplHelper.createFailedResponse(\"Bad request: both storageSystemId and storagePoolIds are null\", GetStoragePoolsResponse.class); \n\t\t }\n\t\t try {\n \n\t\t\t String zone = null;\n\t\t\t String region = null;\t\t \n\t\t\t for (String poolId:request.storagePoolIds) {\n\t\t\t\tif (poolId == null || poolId.indexOf(':') == -1) {\n\t\t\t\t\tstoragePools.add(null);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tzone = openstackClient.getOpenstackId(poolId);\n\t\t\t\tregion = openstackClient.getRegion(poolId);\n\t\t\t\t if (zone.equals(OpenstackConstants.Openstack_POOL_SNAPSHOTS)) {\n\t\t\t\t\t storagePools.add(OpenstackAdapterUtil.createStoragePool(OpenstackConstants.Openstack_POOL_SNAPSHOTS, region, accountId,totalSpaceGB, usedSpaceGB));\n\t\t\t\t } else {\n\t\t\t\t zones = openstackClient.listAvailabilityZones(region);\n\t\t\t\t if (zones.contains(zone)) {\n\t\t\t\t \tstoragePools.add(OpenstackAdapterUtil.createStoragePool(zone, region, accountId,totalSpaceGB, usedSpaceGB));\t\n\t\t\t\t\t} else {\n\t\t\t\t storagePools.add(null);\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t }\n\n\t\t } catch (Exception e) {\n\t\t\tlogger.traceThrowable(IJavaEeLog.SEVERITY_DEBUG, this.getClass().getName(), \"getStoragePools:\" + e.getMessage(), null,e);\n\t\t\treturn StorageAdapterImplHelper.createFailedResponse(e.getMessage(), GetStoragePoolsResponse.class); \n\t\t }\n\t\t \n\t\t}\n\t\tlogger.log(IJavaEeLog.SEVERITY_DEBUG, this.getClass().getName(), \"getStoragePools: pools found: \" + storagePools.size() + \" pools: \" + storagePools , null);\n\t\tpayload.storagePools = storagePools;\n\t\tStorageOperationResponse<GetStoragePoolsResponse> response = new StorageOperationResponse<GetStoragePoolsResponse>(payload);\n\t\tresponse.setPercentCompleted(100);\n\t\tresponse.setStatus(StorageOperationStatus.COMPLETED);\n\t\treturn response;\n\t}", "public void setStorageLocation(StorageLocation storageLocation) {\n this.storageLocation = storageLocation;\n }", "@Override\n\tpublic String addOutStorage(OutStorage out) {\n\t\treturn super.addObject(out);\n\t}", "public StorageManager() {\n makeDirectory();\n }", "public Storage getStorage() {\n return this.storage;\n }", "public DefaultStorage() {\n }", "private void addProductFromStorageCart(StorageCartLine storageCartLine){\n\t\tint index = 0;\n\t\tfor(StorageCartLine aux : this.getStorageCartLine()){\n\t\t\tif(aux.getProduct().getId() == storageCartLine.getProduct().getId()){\n\t\t\t\tbreak;\n\t\t\t}else{\n\t\t\t\tindex++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.getStorageCartLine().get(index).setCuantity(this.getStorageCartLine().get(index).getCuantity() + \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstorageCartLine.getCuantity());\n\t}", "int insert(Storage record);", "int insert(Storage record);", "public StorageInsightInner withContainers(List<String> containers) {\n this.containers = containers;\n return this;\n }", "public void addToStockManager(Stock stock){\n this.stockAnalyzer.addStock(stock);\n }", "@Override\n public void createDirectory(File storageName) throws IOException {\n }", "public interface StorageListener {\n\n /***\n * <p>Event listener for all starge node changes.</p>\n *\n * @param event the type of event causing the call\n * @param oldNode the old node content\n * @param newNode the new node content\n */\n void gotStorageChange(EventType event, Node oldNode, Node newNode);\n\n}", "void cloneTo(NamedStorage storage);", "public void fillStorageBlocks(Block[] contents) {\n\t\tfor(int i = 0; i < contents.length; i++) {\n\t\t\tstorageSpace[i] = contents[i];\n\t\t}\n\t}", "public void addShares(Shares e){\n \tthis.shares.add(e);\n }", "interface Storage {\n String getStorageSize() ;\n}", "protected abstract RegistryStorage storage();", "public static void setStorage(Storage storage) {\n Parser.storage = storage;\n }", "public List<StoragePrice> listStoragePrices() throws IOException,\n\t\t\tClassNotFoundException {\n\t\treturn new LinkedList<StoragePrice>();\n\t}", "public interface StorageFactory {\n\n\t<T> List<T> createList();\n\t\n\t<T> Set<T> createSet();\n\t\n\t<V> Map<Character, V> createMap();\n\t\n}", "public void add(String str) {\r\n list.add(str);\r\n }", "public void addItem(String i) {\n\t\tItem item = Item.getItem(ItemList, i);\n\t Inventory.add(item);\n\t inventoryList.getItems().add(i);\n\n\t}", "public void addDocumentStorageListener(IDocumentStorageListener<L> documentStorageListener);", "private void uploadFromDataStorage() {\n }", "public void add(String shoeType, int amount){\r\n\t\t\tShoeStorageInfo shoe=new ShoeStorageInfo(shoeType,amount,0);\r\n\t\t\tstoreMap.putIfAbsent(shoeType, shoe);\r\n\t\t\tShoeStorageInfo shoe1 = storeMap.get(shoeType);\r\n\t\t\tshoe1.addShoe(amount);\r\n\t\t}", "public final void addFileSystem (FileSystem fs) {\n synchronized (Repository.class) {\n // if the file system is not assigned yet\n if (!fs.assigned && !fileSystems.contains(fs)) {\n // new file system\n fileSystems.add(fs);\n String systemName = fs.getSystemName ();\n\n boolean isReg = names.get (systemName) == null;\n if (isReg && !systemName.equals (\"\")) { // NOI18N\n // file system with the same name is not there => then it is valid\n names.put (systemName, fs);\n fs.setValid (true);\n } else {\n // there is another file system with the same name => it is invalid\n fs.setValid (false);\n }\n // mark the file system as being assigned\n fs.assigned = true;\n // mark as a listener on changes in the file system\n fs.addPropertyChangeListener (propListener);\n fs.addVetoableChangeListener (vetoListener);\n\n // fire info about new file system\n fireFileSystem (fs, true);\n }\n }\n }", "private void configStorage(){\n try {\n final StorageReference storageReference = FirebaseStorage.getInstance()\n .getReference(\"motolost/\"+ String.valueOf(Math.random()) + getFileExtension(filePath));\n storageReference.putFile(filePath)\n .continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {\n @Override\n public Task<Uri> then(@NonNull Task<UploadTask.TaskSnapshot> task) throws Exception {\n if (!task.isSuccessful()) {\n throw task.getException();\n }\n return storageReference.getDownloadUrl();\n }\n }).addOnCompleteListener(new OnCompleteListener<Uri>() {\n @Override\n public void onComplete(@NonNull Task<Uri> task) {\n if (task.isSuccessful()) {\n Uri downloadUri = task.getResult();\n saveRegistry(downloadUri.toString());\n }\n }\n });\n } catch (Exception ex) {\n Constant.showMessage(\"Exception\", ex.getMessage(), this);\n }\n }", "@Override\n public void execute(TaskListHandler handler, Storage storage, String input) throws DukeException {\n ArrayList<Task> taskList = handler.getTasks();\n handler.addToList(newTask);\n Ui.printSuccess(\"add\", newTask, taskList);\n handler.saveCurrentTaskList(input);\n storage.saveToFile(taskList);\n }", "@Test\n public void testGenericStorageSerializationAndStorageFunctions() {\n String serializationFilename = \"TestStorage\";\n\n // Creating the GenericStorage which is under test\n GenericStorage<String, TestObject> storage = new GenericStorage\n (serializationFilename);\n\n // Creating the key we'll use to store the object\n String key = \"Hello\";\n\n // Creating a bogus object to see if it is stored and recovered properly\n TestObject testObj = new TestObject(\"HelloThisIsATest\");\n\n\n // Storing the object\n storage.create(key, testObj);\n\n // Is the object properly stored\n assert(storage.exists(key));\n assert(storage.read(key).equals(testObj));\n\n // Trying to serialize the object\n storage.saveStorage();\n\n // Resetting the storage to null\n storage = null;\n storage = new GenericStorage(\"TestStorage\");\n\n // The object shouldn't exist anymore in the storage\n assert(!storage.exists(key));\n\n // The storage should be restored with the serialization\n storage.loadStorage();\n\n // Is the object properly stored\n assert(storage.exists(key));\n assert(storage.read(key).equals(testObj));\n\n }", "public interface Storage {\n String SPLITTER = \" &&& \";\n\n /**\n * Gets the list of tasks held by the storage.\n * @return the list of tasks\n */\n TaskList getList();\n\n /**\n * Writes the task to the storage file.\n * @param task the task that is to be written in the task\n * @throws InvalidCommandException should never been thrown unless the file path is not working\n */\n void addToList(Task task) throws InvalidCommandException;\n\n /**\n * Re-writes the storage file because of deletion or marking-as-done executed.\n * @param list the new task list used for updating the storage file\n * @throws InvalidCommandException should never been thrown unless the file path is not working\n */\n void reWrite(TaskList list) throws InvalidCommandException;\n}", "public interface StorageModel {\n}", "public int addObjects(Collection<? extends LocalAbstractObject> objects) throws BucketStorageException {\n return addObjects(objects.iterator());\n }", "public java.util.Enumeration getStorages() {\n\ttry {\n\t\tStorageAccessBean bean = new StorageAccessBean();\n\t\treturn bean.findAllOrderByNameAsc();\n\t} catch(Exception e) {\n\t\treturn (new java.util.Vector()).elements();\n\t}\n}", "public interface Storage {\n\n String getId();\n}", "public Storage() {\n\n }", "public void add(Student s)\r\n {\r\n students.add(s);\r\n }", "public long getStorage() {\n\t\t// List<Storage> listSim = new ArrayList<Storage>();\n\t\t//\n\t\t// Storage storage;\n\t\t//\n\t\t// for (int i = 0; i < 3; i++) {\n\t\t// storage = new Storage();\n\t\t//\n\t\t// storage.setDeviceName(\"/dev/sda1\");\n\t\t// storage.setFreeSpaceKB(3 * 100 * 12 * 5 * i);\n\t\t// storage.setTotalSizeKB(288237920);\n\t\t// storage.setMountPoint(\"/\");\n\t\t// storage.setOsSpecificFSType(\"ext4\");\n\t\t//\n\t\t// listSim.add(storage);\n\t\t// }\n\t\t// return listSim;\n\n\t\treturn new Random().nextInt(19700621);\n\t}", "public interface IStorage extends Serializable {\n\n /**\n * Removes all stored values.\n */\n void clear();\n\n /**\n * Removes the value stored under the given key (if one exists).\n *\n * @return {@code true} if a successful.\n */\n StoragePrimitive remove(String key);\n\n /**\n * Adds all mappings in {@code val} to this storage object, overwriting any existing values.\n *\n * @see #addAll(String, IStorage)\n */\n void addAll(IStorage val);\n\n /**\n * Adds all mappings in {@code val} to this storage object, where all keys are prefixed with\n * {@code prefix}. Any existing values are overwritten.\n */\n void addAll(String prefix, IStorage val);\n\n /**\n * @return All stored keys.\n * @see #getKeys(String)\n */\n Collection<String> getKeys();\n\n /**\n * @return A collection of all stored keys matching the given prefix, or all stored keys if the prefix is\n * {@code null}.\n */\n Collection<String> getKeys(@Nullable String prefix);\n\n /**\n * @return {@code true} if this storage object contains a mapping for the given key.\n */\n boolean contains(String key);\n\n /**\n * Returns raw value stored under the given key.\n */\n StoragePrimitive get(String key);\n\n /**\n * Returns value stored under the given key converted to a boolean.\n *\n * @param defaultValue This value is returned instead if no value was stored under the given key, or if\n * the value couldn't be converted to the desired return type.\n * @see #getString(String, String)\n */\n boolean getBoolean(String key, boolean defaultValue);\n\n /**\n * Convenience method for retrieving a 32-bit signed integer. This is equivalent to calling\n * {@link IStorage#getDouble(String, double)} and casting the result to int.\n *\n * @see #getDouble(String, double)\n */\n int getInt(String key, int defaultValue);\n\n /**\n * Convenience method for retrieving a 64-bit signed integer. This is equivalent to calling\n * {@link IStorage#getDouble(String, double)} and casting the result to long.\n *\n * @see #getDouble(String, double)\n */\n long getLong(String keyTotal, long defaultValue);\n\n /**\n * Returns value stored under the given key converted to a double.\n *\n * @param defaultValue This value is returned instead if no value was stored under the given key, or if\n * the value couldn't be converted to the desired return type.\n * @see #getString(String, String)\n */\n double getDouble(String key, double defaultValue);\n\n /**\n * Returns value stored under the given key converted to a string.\n *\n * @param defaultValue This value is returned instead if no value was stored under the given key.\n */\n String getString(String key, String defaultValue);\n\n /**\n * Stores a value under the given key. If {@code null}, removes any existing mapping for the given key\n * instead.\n */\n void set(String key, @Nullable StoragePrimitive val);\n\n /**\n * Stores a boolean value under the given key.\n *\n * @see #setString(String, String)\n */\n void setBoolean(String key, boolean val);\n\n /**\n * Convenience method for storing an integer. All values are stored as double-precision floating point\n * internally.\n *\n * @see #setDouble(String, double)\n */\n void setInt(String key, int val);\n\n /**\n * Convenience method for storing a long. All values are stored as double-precision floating point\n * internally.\n *\n * @see #setDouble(String, double)\n */\n void setLong(String key, long val);\n\n /**\n * Stores a double-precision floating point value under the given key.\n *\n * @see #setString(String, String)\n */\n void setDouble(String key, double val);\n\n /**\n * Stores a string value under the given key.\n *\n * @param val The value to store. If {@code null}, removes any existing mapping for the given key instead.\n */\n void setString(String key, String val);\n\n}" ]
[ "0.69978595", "0.6848628", "0.6401925", "0.63949144", "0.6174116", "0.6124925", "0.6119696", "0.59944636", "0.5970229", "0.5964006", "0.59247494", "0.5902844", "0.5869836", "0.57208836", "0.5718256", "0.570732", "0.5695618", "0.5695049", "0.56750816", "0.56717306", "0.56254303", "0.56099135", "0.5590629", "0.5576169", "0.55688", "0.54970264", "0.5461423", "0.5436671", "0.54274833", "0.54124177", "0.5408568", "0.54014057", "0.5395084", "0.5386111", "0.5361334", "0.53582394", "0.5355285", "0.5347913", "0.53388715", "0.53230786", "0.53041494", "0.52979296", "0.5252053", "0.5252053", "0.52302176", "0.5226392", "0.51786166", "0.516045", "0.51447254", "0.51358414", "0.5123337", "0.51106095", "0.5107304", "0.5105922", "0.5092447", "0.5083087", "0.50817627", "0.50781435", "0.50763565", "0.50732124", "0.50503546", "0.5042725", "0.503894", "0.5032976", "0.50233907", "0.5019897", "0.5016755", "0.501442", "0.5006403", "0.5006403", "0.49947608", "0.498416", "0.49684", "0.49537018", "0.49480784", "0.49443063", "0.4940135", "0.49356294", "0.49349606", "0.49305782", "0.49275213", "0.49250206", "0.49244592", "0.49232715", "0.49172252", "0.4909503", "0.49068573", "0.4906252", "0.49054596", "0.49042714", "0.48968783", "0.48908296", "0.488448", "0.48841563", "0.48839733", "0.48758093", "0.48740616", "0.4870729", "0.48604032", "0.4849413" ]
0.7903242
0
The main method controls quality of food
public AbstractStorageOfFoods control(Food food, Date currentDate) { AbstractStorageOfFoods result = this.reallocateFood(food, currentDate); this.lowPrice(food, currentDate); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void cook(Food food) {\n //cook in pressure cooker\n }", "public static void main(String[] args)\n\t {\n\t \n\t Coffee coffee = new Coffee();\n\t Expresso espresso = new Expresso();\n\t Cappuccino cappuccino = new Cappuccino();\n\t \n\t \n\t final double SALES_TAX = 0.06;\n\t \n\t \n\t Scanner s = new Scanner(System.in); // Create a Scanner object\n\t System.out.println(\"How many coffeee drinks woul dyou like ?\");\n\t coffee.setQuantity(s.nextInt());\n\t \n\t s.hasNextLine();\n\t System.out.println(\" Would you like milk ( y or n)?\");\n\t String milkOption = s.nextLine();\n\t if (milkOption.equals(\"y\")) {\n\t \t coffee.setMilk(true);\n\t }\n\t \n\t System.out.println(\" Would you like sugar ( y or n)?\");\n\t String sugarOption = s.nextLine();\n\t if (sugarOption.equals(\"y\")) {\n\t \t coffee.setSugar(true);\n\t }\n\t \n\t System.out.printf(\"Name: %s\\nDescription: %s\\nSubtotal: %2f\\n\\n\", coffee.getName(), coffee.getDescription(),\n\t coffee.calculateProductTotal());\n\t \n\t \n\t\t \t \n\t\t \t \n\t System.out.println(\"How many Espresso drinks would you like ?\");\n\t espresso.setQuantity(s.nextInt());\n\t System.out.printf(\"Name: %s\\nDescription: %s\\nSubtotal: %2f\\n\\n\", espresso.getName(), espresso.getDescription(),\n\t espresso.calculateProductTotal());\n\t s.hasNextLine();\n\t\t System.out.println(\" Would you like milk ( y or n)?\");\n\t\t String extraShot = s.nextLine();\n\t\t if (extraShot.equals(\"y\")) {\n\t\t \t espresso.setExtraShot(true);\n\t\t }\n\t\t \n\t\t System.out.println(\" Would you like sugar ( y or n)?\");\n\t\t String macchiato = s.nextLine();\n\t\t if (macchiato.equals(\"y\")) {\n\t\t \t espresso.setMacchiato(true);\n\t\t }\n\t \n\t \n\t System.out.println(\"How many cappuccino drinks would you like ?\");\n\t cappuccino.setQuantity(s.nextInt());\n\t System.out.printf(\"Name: %s\\nDescription: %s\\nSubtotal: %2f\\n\\n\", cappuccino.getName(), cappuccino.getDescription(),\n\t cappuccino.calculateProductTotal());\n\t s.hasNextLine();\n\t\t System.out.println(\" Would you like milk ( y or n)?\");\n\t\t String peppermint = s.nextLine();\n\t\t if (peppermint.equals(\"y\")) {\n\t\t \t cappuccino.setPeppermint(true);\n\t\t }\n\t\t \n\t\t System.out.println(\" Would you like sugar ( y or n)?\");\n\t\t String whippedCream = s.nextLine();\n\t\t if (whippedCream.equals(\"y\")) {\n\t\t \t cappuccino.setWhippedCream(true);\n\t\t }\n\t \n\t \n\t double transactionSubtotal = coffee.calculateProductTotal() + espresso.calculateProductTotal() + cappuccino.calculateProductTotal();\n\t System.out.println(transactionSubtotal);\n\t double transactionTax = transactionSubtotal * SALES_TAX;\n\t double total = transactionSubtotal + transactionTax;\n\t System.out.printf(\"Subtotal: %.2f\\nTax: %.2f\\nTotal: %.2f\\n\",transactionSubtotal,transactionTax,total);\n\t s.close();\n\t }", "public static void main(String[] args) {\n\t\t// create a Scanner for user input\n\t\tScanner input = new Scanner(System.in);\n\t\t//sets the variables for the labour and energy cost\n\t\tfinal double labour = 0.75;\n\t\tfinal double POWER_COST = 0.99;\n\t\tfinal double SIZE_COST = 0.50;\n\t\t//Prompt the user for what size of pizza they want \n\t\tSystem.out.println(\"What is the size of the pizza (in cm):\");\n\t\t//gets the size of pizza from user \n\t\tint pizzaSize = input.nextInt();\n\t\t//calculates the subtotal of the pizza\n\t\tdouble subtotal = pizzaSize * SIZE_COST + labour + POWER_COST;\n\t\t//outputs the message to the user about their subtotal\n\t\tSystem.out.println(\"Subtotal: $\" + subtotal);\n\t\t//calculates the tax \n\t\tdouble tax = subtotal * 0.13;\n\t\t//outputs the taxes to the user\n\t\tSystem.out.println(\"Taxes: $\" + tax);\n\t\t//calculates the total of the user\n\t\tdouble total = subtotal + tax;\n\t\t//outputs the total to the user\n\t\tSystem.out.println(\"Total: $\" + total);\n\t\t//according to the size of the pizza it outputs a specific message \n\t\tif (pizzaSize <= 20 && pizzaSize >= 1){\n\t\t\t//outputs this message if the pizza size is between 1 and 20cm\n\t\t\tSystem.out.println(\"We are going to make you a cute little pizza!\");\n\t\t\t} else if (pizzaSize <= 40 && pizzaSize > 20) {\n\t\t\t//outputs this message if the pizza size is between 40 and 20cm\n\t\t\tSystem.out.println(\"This will be delicious!\");\n\t\t\t} else if (pizzaSize > 40) {\n\t\t\t//outputs this message if the pizza sice is greater than 40\n\t\t\tSystem.out.println(\"Whoa, big pizza! You might need a truck to get this home!\");\n\t\t\t} else {\n\t\t\t//outputs this message if value is in negative or 0\n\t\t\tSystem.out.println(\"Invalid values entered please try again\");\n\t\t\t\t}\n\t}", "public static void main(String[] args) {\n String msg;\r\n Food[] picnicBasket = new Food[6];\r\n\r\n\r\n // Shows my name\r\n System.out.print(\"Exercise executed by Laercio da Silva\\n\");\r\n\r\n\r\n //Create some food objects\r\n Food snack1 = new Food(\"Banana\", \"Fruit\");\r\n Food snack2 = new Food(\"Yam\", \"Vegetable\");\r\n Food snack3 = new Food(\"Beef Jerky\", \"Meat\");\r\n Food snack4 = new Food(\"Yoghurt\", \"Dairy\");\r\n Food snack5 = new Food(\"Orange\", \"Fruit\");\r\n Food snack6 = new Food(\"Brussel Sprouts\", \"Vegetable\");\r\n\r\n //Add food objects to my array\r\n picnicBasket[0] = snack1;\r\n picnicBasket[1] = snack2;\r\n picnicBasket[2] = snack3;\r\n picnicBasket[3] = snack4;\r\n picnicBasket[4] = snack5;\r\n picnicBasket[5] = snack6;\r\n\r\n //Go through my picnic basket array\r\n for (int i = 0; i < picnicBasket.length; i++) {\r\n Food currentItem = picnicBasket[i];\r\n\r\n //Yuck, I hate veggies! I won't eat em!\r\n if (currentItem.foodType == \"Vegetable\") {\r\n msg = currentItem.denyIt();\r\n System.out.println(msg);\r\n } else {\r\n msg = currentItem.eatIt();\r\n System.out.println(msg);\r\n }\r\n }\r\n }", "public static void main(String[] args) {\n Beverage espresso = new Espresso();\n System.out.println(espresso.getDescription()\n +\" $\"+ espresso.cost()+\"\\n\");\n\n // order a houseblend with mocha\n Beverage houseblend = new HouseBlend();\n houseblend = new Mocha(houseblend);\n System.out.println(houseblend.getDescription()\n +\" $\"+ houseblend.cost()+\"\\n\");\n\n //order an american with soy and mocha\n Beverage americano = new Americano();\n americano = new Mocha(americano);\n americano = new SoyMilk(americano);\n System.out.println(americano.getDescription()\n + \" $\"+americano.cost()+\"\\n\");\n }", "@Test\n void conjuredItems() {\n int originalSellIn = 10;\n int originalQuality = 10;\n\n Item[] items = new Item[]{new Item(\"Conjured Mana Cake\", originalSellIn, originalQuality)};\n GildedRose app = new GildedRose(items);\n app.updateQuality();\n\n assertEquals(originalQuality - 2, app.items[0].quality, \"Quality of \\\"Conjured\\\" item should decrease twice as fast\");\n }", "public static void main(String[] args) {\n\t\tFoodRequirements f ;\r\n\t\tf=new MaharashtrianFood();\r\n\t\tf.foodTypes();\r\n\t\tf.foodName();\r\n\t\tf.ingredients();\r\n\t\tf.recipie();\r\n\t\tf=new PunjabiFood();\r\n\t\tf.foodName();\r\n\t\tf.ingredients();\r\n\t\tf.recipie();\r\n\t}", "@Test\n\tpublic void testQualityWithSellInUnder0Concert() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"Backstage passes to a TAFKAL80ETC concert\", -1, 100));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality has decreased to 0\n\t\tassertEquals(\"Quality with sellIn under 0 concert passes\", 0, quality);\n\t}", "public static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tIBeverage beverage = new Base();\n\t\t\n\t\tboolean done = false;\n\t\t\n\t\twhile( !done ) {\n\t\t\tSystem.out.println(\"Current beverage price : \" + beverage.getTotalPrice());\n\t\t\tSystem.out.println(\"Please select... 1:Shot of Espresso | 2:Milk | Ener nothing if youe dink are all set.\");\n\t\t\t\n\t\t\tswitch(sc.nextInt()) {\n\t\t\t\tcase 1:\n\t\t\t\t\tSystem.out.println(\"1 Shot of espresso is added\");\n\t\t\t\t\tbeverage = new Espresso(beverage);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tSystem.out.println(\"Milk is added\");\n\t\t\t\t\tbeverage = new Milk(beverage);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tSystem.out.println(\"Your drink is set now. Thank you!\");\n\t\t\t\t\tdone = true;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Total Beverage Price : \" + beverage.getTotalPrice());\n\t\tsc.close();\n\t\t\n\t\t}", "public static void main(String[] args) {\n Beverage houseBlend = new HouseBlend();\n houseBlend = new MilkCondiment(houseBlend);\n houseBlend = new WhippedCreamCondiment(houseBlend);\n houseBlend = new WhippedCreamCondiment(houseBlend);\n var description = houseBlend.getDescription();\n var price = houseBlend.getPrice();\n System.out.println(String.format(\"Ordered %s. The price is: %.2f\",description, price));\n\n //Order 2: darkroast with soy milk and whipped cream\n Beverage darkRoast = new DarkRoast();\n darkRoast = new SoyCondiment(darkRoast);\n darkRoast = new WhippedCreamCondiment(darkRoast);\n darkRoast = new ChocolateCondiment(darkRoast);\n var darkRoastDescription = darkRoast.getDescription();\n var darkRoastPrice = darkRoast.getPrice();\n System.out.println(String.format(\"Ordered %s. The price is: %.2f\",darkRoastDescription, darkRoastPrice));\n\t}", "@Test\n void maxQuality() {\n Item[] items = new Item[]{\n new Item(\"Aged Brie\", 10, 50),\n new Item(\"Backstage passes to a TAFKAL80ETC concert\", 5, 49),\n new Item(\"Aged Brie\", 10, 40)\n };\n GildedRose app = new GildedRose(items);\n app.updateQuality();\n\n for (Item item : app.items) {\n assertTrue(50 >= item.quality, \"Quality shouldn't overtake its max capacity\");\n }\n }", "@Test\n\tpublic void testConsertPassQuality() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"Backstage passes to a TAFKAL80ETC concert\", 10, 20));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality has increased by two (perhaps should be one)\n\t\tassertEquals(\"Quality consert backstage passes\", 22, quality);\n\t}", "public static void main(String[] args) {\n\n\t\tdouble shoePrice = 220.99;\n\t\tdouble allowance = 200.00;\n\n\t\tif (shoePrice > allowance) {\n\t\t\tSystem.out.println(\"We cant buy it :(\");\n\t\t} else {\n\t\t\tSystem.out.println(\"We can buy it :D\");\n\n\t\t}\n\t\t\n\t\t//declare boolean variable its raining and if it is true your program should say take an umbrella\n\t\t\n\t\tboolean isRaining = true;\n\t\t\n\t\tif (isRaining) {\n\t\t\tSystem.out.println(\"stay home and code\");\n\t\t}else {\n\t\t\tSystem.out.println(\"take a walk and listen to java\");\n\t\t}\n\t}", "@Test\n\tpublic void testQuality1SellInUnder0() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"Sulfuras, Hand of Ragnaros\", -11, 1));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality remains the same\n\t\tassertEquals(\"Quality with quality 0 Sulfuras\", 1, quality);\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tString goringsfood = JOptionPane.showInputDialog(\"how much flour do you have\");\n\t\tint fish = Integer.parseInt(goringsfood);\n\t\t\tif(fish < 2) {\n\t\t\tSystem.out.println(\"go back to the store\");\n\t\t\t}\n\t\t\t\n\t\t\n\t\t\n//\t\t2. Now ask them how many people they are going to give cookies to. If they are going\n//\t\tto give cookies to more than 30 people, tell them they are going to have to bake two\n//\t\tbatches of cookies! \n\t\t\n\t\tString keitel = JOptionPane.showInputDialog(\"how many people are you going to give cookies to\");\n\t\tint pooroldman = Integer.parseInt(keitel);\n\t\tif(pooroldman > 30) {\n\t\tSystem.out.println(\"bake two more batches of cookies\");\n\t\t}\n\t\t\n\t\t\n//\t\t3. Finally, ask them how many batches of cookies they baked. If they baked 2 batches\n//\t\tof cookies, tell them they are lucky to have so many friends. \n\t\t\n\t\tString gunsche = JOptionPane.showInputDialog(\"how many batches of cookies have you baked\");\n\t\tif(gunsche.equals(\"2\")) {\n\t\t\tSystem.out.println(\"your lucky to have a lot of friends\");\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\r\n Ingredient ingredient=new Ingredient();\r\n\r\n Food pasta=new Pasta();\r\n String pastaItems=ingredient.getPastaItems();\r\n pasta.prepareFood(pastaItems);\r\n System.out.println(pasta.deliverFood());\r\n\r\n\r\n System.out.println(\"------------FACADE---------------\");\r\n\r\n System.out.println(Waiter.deliveryFood(FoodType.PASTA));\r\n\r\n\r\n\r\n\r\n\r\n\r\n }", "@Test\n\tpublic void testQualityWithSellInUnder0QualityUnder50Brie() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"Aged Brie\", -1, 40));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality has increased by 2\n\t\tassertEquals(\"Quality with sellIn under 0 brie\", 42, quality);\n\t}", "@Test\n\tpublic void testQualityOf50() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"Backstage passes to a TAFKAL80ETC concert\", 1, 49));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality has increased by one\n\t\tassertEquals(\"Quality with quality under 0 Concert passes\", 50, quality);\n\t}", "private void calcCalories()\n\t{\n\t\tif (getIntensity() == 1)\n\t\t{\n\t\t\tbikeCal = 10 * bikeTime; \n\t\t}\n\t\telse if (getIntensity() == 2)\n\t\t{\n\t\t\tbikeCal = 14.3 * bikeTime; \n\t\t}\n\t\telse {\n\t\t\tJOptionPane.showMessageDialog(null, \"error\");\n\t\t}\n\t}", "public static void main(String[] args) {\n\n\t\t/** Variable that will have the final price of a baguette order.*/\n\t\tdouble finalPrice = 0.00;\n\n\t\t/** Variable created with the purpose of using the methods in TestClass.*/\n\t\tTestClass testClass = new TestClass();\n\n\t\t/** Will save the option given by the user, wether is baguette or pizza.*/\n\t\tScanner sc = new Scanner(System.in);\n\t\t/** The option before mentionaded but in int.*/\n\t\tint option;\n\n\t\t/** Will save the option given by the final user to select an ingredient.*/\n\t\tScanner scIngredient = new Scanner(System.in);\n\t\t/** The option before mentionated, but in int.*/\n\t\tint optionIngredient;\n\n\t\tdo {\n\n\t\t\tSystem.out.println(\"\\n---------------------------------------\\n\" +\n\t\t\t\t\"Welcome, what would you like to order?\\n\" +\n\t\t\t\t\"1.Baguette with regular bread.\\n\" +\n\t\t\t\t\"2.Baguette with garlic bread.\\n\" +\n\t\t\t\t\"3.Baguette with wholemeal bread.\\n\" +\n\t\t\t\t\"4.Double Cheese pizza.\\n\" +\n\t\t\t\t\"5.Just Meat pizza.\\n\" +\n\t\t\t\t\"6.Ultra Thin pizza.\\n\" +\n\t\t\t\t\"7.Extra Gross pizza.\\n\" +\n\t\t\t\t\"8.Special pizza.\\n\" +\n\t\t\t\t\"0.Leave store.\");\n\t\t\t\n\t\t\tString userOption = sc.nextLine();\n\t\t\toption = Integer.parseInt(userOption);\n\n\t\t\tswitch (option) {\n\t\t\t\tcase 1:\n\t\t\t\t\tfinalPrice = 1.00;\n\t\t\t\t\ttestClass.asignRegularSandwich();\n\t\t\t\t\tdo { \n\t\t\t\t\t\tString ingredientOption = scIngredient.nextLine();\n\t\t\t\t\t\toptionIngredient = Integer.parseInt(ingredientOption);\n\n\t\t\t\t\t\tswitch (optionIngredient) {\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\tbaguette = new Chicken(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.50;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added chicken. + 0.50\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tbaguette = new Ham(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.35;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added ham. + 0.35\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\tbaguette = new Pepperoni(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.40;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added pepperoni. + 0.40\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\tbaguette = new Tomato(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.12;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added tomato. + 0.12\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\t\tbaguette = new Lettuce(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.10;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added lettuce. + 0.10\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 6:\n\t\t\t\t\t\t\t\tbaguette = new Onion(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.10;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added onion. + 0.10\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 7:\n\t\t\t\t\t\t\t\tbaguette = new Ketchup(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.05;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added ketchup. + 0.05\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 8:\n\t\t\t\t\t\t\t\tbaguette = new Mayo(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.05;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added mayonnaise. + 0.05\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 9:\n\t\t\t\t\t\t\t\tbaguette = new Mustard(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.05;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added mustard. + 0.05\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tSystem.out.println(\"Please choose a valid option.\");\n\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} while (optionIngredient != 0);\n\t\t\t\t\tSystem.out.println(\"\\nThis is your order: \" + baguette.getDescription() + \"\\n\" +\n\t\t\t\t\t\t\"The total amount to pay is: \" + finalPrice);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2:\n\t\t\t\t\tfinalPrice = 1.10;\n\t\t\t\t\ttestClass.asignGarlicSandwich();\n\t\t\t\t\tdo { \n\t\t\t\t\t\tString ingredientOption = scIngredient.nextLine();\n\t\t\t\t\t\toptionIngredient = Integer.parseInt(ingredientOption);\n\n\t\t\t\t\t\tswitch (optionIngredient) {\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\tbaguette = new Chicken(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.50;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added chicken. + 0.50\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tbaguette = new Ham(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.35;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added ham. + 0.35\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\tbaguette = new Pepperoni(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.40;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added pepperoni. + 0.40\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\tbaguette = new Tomato(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.12;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added tomato. + 0.12\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\t\tbaguette = new Lettuce(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.10;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added lettuce. + 0.10\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 6:\n\t\t\t\t\t\t\t\tbaguette = new Onion(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.10;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added onion. + 0.10\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 7:\n\t\t\t\t\t\t\t\tbaguette = new Ketchup(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.05;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added ketchup. + 0.05\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 8:\n\t\t\t\t\t\t\t\tbaguette = new Mayo(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.05;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added mayonnaise. + 0.05\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 9:\n\t\t\t\t\t\t\t\tbaguette = new Mustard(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.05;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added mustard. + 0.05\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tSystem.out.println(\"Please choose a valid option.\");\n\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} while (optionIngredient != 0);\n\t\t\t\t\tSystem.out.println(\"\\nThis is your order: \" + baguette.getDescription() + \"\\n\" +\n\t\t\t\t\t\t\"The total amount to pay is: \" + finalPrice);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 3:\n\t\t\t\t\tfinalPrice = 1.20;\n\t\t\t\t\ttestClass.asignWholemealSandwich();\n\t\t\t\t\tdo { \n\t\t\t\t\t\tString ingredientOption = scIngredient.nextLine();\n\t\t\t\t\t\toptionIngredient = Integer.parseInt(ingredientOption);\n\n\t\t\t\t\t\tswitch (optionIngredient) {\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\tbaguette = new Chicken(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.50;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added chicken. + 0.50\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tbaguette = new Ham(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.35;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added ham. + 0.35\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\tbaguette = new Pepperoni(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.40;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added pepperoni. + 0.40\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\tbaguette = new Tomato(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.12;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added tomato. + 0.12\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\t\tbaguette = new Lettuce(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.10;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added lettuce. + 0.10\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 6:\n\t\t\t\t\t\t\t\tbaguette = new Onion(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.10;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added onion. + 0.10\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 7:\n\t\t\t\t\t\t\t\tbaguette = new Ketchup(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.05;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added ketchup. + 0.05\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 8:\n\t\t\t\t\t\t\t\tbaguette = new Mayo(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.05;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added mayonnaise. + 0.05\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 9:\n\t\t\t\t\t\t\t\tbaguette = new Mustard(baguette);\n\t\t\t\t\t\t\t\tfinalPrice += 0.05;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\\nYou have added mustard. + 0.05\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tSystem.out.println(\"Please choose a valid option.\");\n\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} while (optionIngredient != 0);\n\t\t\t\t\tSystem.out.println(\"\\nThis is your order: \" + baguette.getDescription() + \"\\n\" +\n\t\t\t\t\t\t\"The total amount to pay is: \" + finalPrice);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 4:\n\t\t\t\t\tSystem.out.println(\"\\nYou have selected Double Cheese pizza:\");\n\t\t\t\t\ttestClass.asignDoubleCheese();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 5:\n\t\t\t\t\tSystem.out.println(\"\\nYou have selected Just Meat pizza:\");\n\t\t\t\t\ttestClass.asignJustMeat();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 6:\n\t\t\t\t\tSystem.out.println(\"\\nYou have selected Ultra Thin pizza:\");\n\t\t\t\t\ttestClass.asignUltraThin();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 7: \n\t\t\t\t\tSystem.out.println(\"\\nYou have selected Extra Gross pizza:\");\n\t\t\t\t\ttestClass.asignExtraGross();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 8:\n\t\t\t\t\tSystem.out.println(\"\\nYou have selected Special pizza:\");\n\t\t\t\t\ttestClass.asignSpecial();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 0:\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault :\n\t\t\t\t\tSystem.out.println(\"\\nPlease choose a valid option.\");\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} while (option != 0);\n\t}", "@Test\r\n\tvoid testCapitalEfficiency() throws IOException {\r\n\t\tStock stock = new Stock(ticker);\r\n\t\tFMPWebReaderFilter adder = new FMPWebReaderFilter();\r\n\t\tstock.setProfile(adder.getStockDetails(stock.getTicker()));\r\n\t\tstock.setCapEff(Evaluator.getCapitalEfficiency(stock));\r\n\t\tassertEquals(\"18\", stock.getCapEff());\r\n\t}", "@Override\r\n\tpublic double foodConsumption() {\n\t\treturn 0;\r\n\t}", "public static void main (String[] args){\n\t\t\n\t\tint temprature = 65;\n\t\tString suncondition =\"Overcast\";\n\t\t\n\t\tif (temprature > 85){\n\t\t\tSystem.out.println(\"It's pleasant wear shorts nad t-shirts\");\n\t\t}\n\t\telse if ((temprature > 60) && (suncondition == \"Overcast\"))\n\t\t{\n\t\t\tSystem.out.println(\"It's a littel cooler. perhaps wear a long-sleev shirt and jeans\");\n\t\t\tSystem.out.println(\"wear the hat to keep the sun out of the eye\");\n\t\t}\n\t\telse if ((temprature > 50) || (suncondition == \"Overcast\"))\n\t\t{\n\t\t\tSystem.out.println(\"This is a cool day, amke sure to wear warmer clothes.\");\n\t\t\t \n\t\t}\n\t\telse \n\t\t{\n\t\t\tSystem.out.println(\"Looks like a cold day. Bring sweater\");\n\t\t}\n\t\t\n\t\tSystem.out.println(\"The program is ending\");\n\t\t\n\t}", "protected void pickupFood() {\r\n\t\tif(this.food > 0){\r\n\t\t\tthis.food--;\r\n\t\t}\r\n\t}", "public static void main (String[] args) {\n\t\t\n\t\t\n\t\tScanner inp = new Scanner(System.in);\n\t\tSystem.out.println(\"Is there a sale? True or False\");\n\t\tboolean sale = inp.nextBoolean();\n\t\t\n\t\t\n\t double discount;\n\t\tdouble finalPrice;\n\t\tdouble price;\n\t\t\n\t\tif (!sale) {\n\t\t\tSystem.out.println(\"I am not shopping\");\n\t\t}else {\n\t\t\tSystem.out.println(\"What is the actual price?\");\n\t\t\tprice = inp.nextDouble();\n\t\t\t\n\t\tif (price<20) {\n\t\t\tdiscount = price *0.10;\n\t\t\t//finalPrice = price - discount;\n\t\t} else if (price>=20 && price<=100) {\n\t\t\tdiscount = price *0.20;\n\t\t\t//finalPrice = price - discount;\n\t\t} else if (price>=100 && price<=500) {\n\t\t\tdiscount = price *0.30;\n\t\t\t//finalPrice = price - discount;\n\t\t} else {\n\t\t\tdiscount = price *0.50;\n\t\t\t\n\t\t\t\n\t\t}\n\t\t finalPrice = price - discount;\n\t\t\t\nSystem.out.println(\"After discount \"+discount+\" the price of the item reduce from \"+price+\" to \"+finalPrice);\n\t\t\t\n\t\t}\n\t\t\n\t}", "@Test\n\tpublic void testQualityWithSellInUnder0() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"Conjured Mana Cake\", -1, 6));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality has decreased by two\n\t\tassertEquals(\"Quality with sellIn under 0 Conjured Mana Cake\", 4, quality);\n\t}", "@Test\n\tpublic void testConsertPassQualityWithSellInUnder6() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"Backstage passes to a TAFKAL80ETC concert\", 5, 20));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality has increased by three (perhaps should be one)\n\t\tassertEquals(\"Quality with sellIn under 6 consert backstage passes\", 23, quality);\n\t}", "public static void main(String[] args) {\n Inventory inventory = new Inventory(); \n \n List<Guitar> allGuitars=initializeInventory();//添加guitar列表\n \n \n GuitarSpec whatErinLikes = \n new GuitarSpec(Builder.JIANGSU, \"Stratocastor\", \n Type.ACOUSTIC, Wood.CAMPHOR, Wood.CAMPHOR);\n List matchingGuitars = inventory.search(whatErinLikes,allGuitars);\n if (!matchingGuitars.isEmpty()) {\n System.out.println(\"Erin, you might like these guitars:\");\n for (Iterator i = matchingGuitars.iterator(); i.hasNext(); ) {\n Guitar guitar = (Guitar)i.next();\n GuitarSpec spec = guitar.getSpec();\n System.out.println(\" We have a \" +\n spec.getBuilder() + \" \" + spec.getModel() + \" \" +\n spec.getType() + \" guitar:\\n \" +\n spec.getBackWood() + \" back and sides,\\n \" +\n spec.getTopWood() + \" top.\\n You can have it for only $\" +\n guitar.getPrice() + \"!\\n ----\");\n }\n } else {\n System.out.println(\"Sorry, Erin, we have nothing for you.\");\n }\n }", "public static void main(String[] args) {\n\n Addition lettuce = new Addition(1, \"Lettuce\");\n Addition tomato = new Addition(1, \"Tomato\");\n Addition carrot = new Addition(1, \"Carrot\");\n Addition mushroom = new Addition(1, \"Mushroom\");\n Addition onion = new Addition(1, \"Onion\");\n Addition bacon = new Addition(2, \"Bacon\");\n Addition cheese = new Addition(1, \"Cheese\");\n\n\n\n Burger baseBurger = new Burger(\"BaseBurger\", 10.00, \"regular\", \"beef\");\n baseBurger.addAddition(lettuce);\n baseBurger.addAddition(tomato);\n baseBurger.addAddition(carrot);\n baseBurger.addAddition(mushroom);\n baseBurger.addAddition(onion);\n System.out.println(baseBurger.getPrice());\n\n System.out.println(\"---------------------\");\n\n HealthyBurger healthyBurger = new HealthyBurger(15.00, \"organic beef\");\n healthyBurger.addAddition(lettuce);\n healthyBurger.addAddition(tomato);\n healthyBurger.addAddition(carrot);\n healthyBurger.addAddition(mushroom);\n healthyBurger.addAddition(onion);\n healthyBurger.addAddition(bacon);\n healthyBurger.addAddition(cheese);\n System.out.println(healthyBurger.getPrice());\n\n System.out.println(\"---------------------\");\n\n DeluxeHamburger deluxeHamburger = new DeluxeHamburger(14, \"whole wheet\", \"double beef\");\n deluxeHamburger.addAddition(tomato);\n System.out.println(deluxeHamburger.getPrice());\n\n }", "@Test\r\n public void testPurchaseBeverage() {\r\n coffeeMaker.addRecipe(recipe1);\r\n assertEquals(25, coffeeMaker.makeCoffee(0, 75));\r\n assertEquals(0, coffeeMaker.makeCoffee(0, 50));\r\n }", "public void getFood()\r\n\t{\r\n\t\tsetRabbitWeight(getRabbitWeight() + 2);\r\n\t}", "public static void main(String[] args) {\n\n\t\tProducer farm = new Producer();\n\t\tSupplier sysco = new Supplier();\n\t\tConsumer resturant = new Consumer();\n\t\tfarm.addObserver(sysco);\n\t\tsysco.addObserver(resturant);\n\t\tfarm.grow();\n\t\tSystem.out.println(\"Supplier Inv:\" + sysco.inventory.size());\n\n\t\tRandom buy = new Random();\n\t\tint toBuy = buy.nextInt(2) + 0;\n\t\tif (toBuy == 1) {\n\t\t\tfarm.notifyObservers(farm.bananaInventory);\n\t\t} else {\n\t\t\tfarm.notifyObservers(farm.carrotInventory);\n\t\t}\n\t\tSystem.out.println(\"Supplier Inv:\" + sysco.inventory.size());\n\t\tSystem.out.println(\"Product Available: \"\n\t\t\t\t+ resturant.getProductAvailable().get(0).getName());\n\t\tSystem.out.println(\"---End transaction----\");\n\t}", "private int calculatePrice(boolean addWhippedCream, boolean addChocolate,boolean takeAway) {\r\n int price=20;\r\n if (addWhippedCream){\r\n price=price+5;\r\n }\r\n\r\n if (addChocolate){\r\n price=price+7;\r\n }\r\n if (takeAway){\r\n price=price+2;\r\n }\r\n\r\n\r\n return quantity*price;\r\n\r\n }", "public static void main(String[] args) \n\t{\n\t\tString choiceTheKingsman2;\n\t\tString theKingsman2Info; \n\t\tDouble kingsman2Cost = 3.00;\n\t\tString choiceAmericanAssassin;\n\t\tString americanAssassinInfo;\n\t\tDouble americanAssassinCost = 3.00;\n\t\tString choiceIt;\n\t\tString itInfo;\n\t\tDouble itCost = 3.00;\n\t\tString choiceAmericanMade;\n\t\tString americanMadeInfo;\n\t\tDouble americanMadeCost = 3.00;\n\t\tString myLittlePonyInfo;\n\t\tString choiceMyLittlePony;\n\t\tDouble myLittlePonyCost = 2.00;\n\t\tString bladeRunnerInfo;\n\t\tString choiceBladeRunner;\n\t\tDouble bladeRunnerCost = 3.00;\n\t\tString theMountainBetweenUsInfo;\n\t\tString choiceTheMountainBetweenUs;\n\t\tDouble theMountainBetweenUsCost = 2.00;\n\t\tString happyDeathDayInfo;\n\t\tString choiceHappyDeathDay;\n\t\tDouble happyDeathDayCost = 3.00;\n\t\tString braveInfo;\n\t\tString choiceBrave;\n\t\tDouble braveCost = 3.00;\n\t\tString spidermanHomecomingInfo;\n\t\tString choiceSpidermanHomecoming;\n\t\tDouble spidermanHomecomingCost = 3.00;\n\t\tString movieChoice;\n\t\tString again;\n\t\tScanner input = new Scanner(System.in);\n\t\tDouble total = 0.00;\n\t\t\n\t\t\tSystem.out.println(\"The Kingsman 2\");\n\t\t\tSystem.out.println(\"American Assassin\");\n\t\t\tSystem.out.println(\"It\");\n\t\t\tSystem.out.println(\"My Little Pony\");\n\t\t\tSystem.out.println(\"Blade Runner 2049\");\n\t\t\tSystem.out.println(\"American Made\");\n\t\t\tSystem.out.println(\"The Mountain Between Us\");\n\t\t\tSystem.out.println(\"Happy Death Day\");\n\t\t\tSystem.out.println(\"Brave\");\n\t\t\tSystem.out.println(\"Spiderman Homecoming\");\n\t\t\t\n\tdo {\t\n\t\t\tSystem.out.print(\"what Movie do you want to rent \");\n\t\t\tmovieChoice = input.nextLine();\n\t\t\tif(\"The Kingsman 2\".equalsIgnoreCase(movieChoice))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"You chose \" + movieChoice + \" this movie cost 3.00\");\n\t\t\t\tSystem.out.print(\"Would you like more Information on The Kingsman 2? Yes or No \");\n\t\t\t\ttheKingsman2Info = input.nextLine();\n\t\t\t\tif(\"Yes\".equalsIgnoreCase(theKingsman2Info))\n\t\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"\"\n\t\t\t\t\t\t\t+ \"\\n With their headquarters destroyed and the world held hostage, \"\n\t\t\t\t\t\t\t+ \"\\n members of Kingsman find new allies when they discover a spy organization\"\n\t\t\t\t\t\t\t+ \"\\n in the United States known as Statesman. In an adventure that tests their\"\n\t\t\t\t\t\t\t+ \"\\n strength and wits, the elite secret agents from both sides of the pond \"\n\t\t\t\t\t\t\t+ \"\\n band together to battle a ruthless enemy and save the day, something \"\n\t\t\t\t\t\t\t+ \"\\n that's becoming a bit of a habit for Eggsy.\");\n\t\t\t\t\tSystem.out.print(\"\"\n\t\t\t\t\t\t\t+ \"\\n Would you like to rent this movie? Yes or No \");\n\t\t\t\t\tchoiceTheKingsman2 = input.nextLine();\n\t\t\t\t\t\tif(\"Yes\".equalsIgnoreCase(choiceTheKingsman2))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttotal = (total + kingsman2Cost);\n\t\t\t\t\t\t\tSystem.out.println(\"\"\n\t\t\t\t\t\t\t\t\t+\"\\n Thank you for renting The Kingsman 2.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tif(\"American Assassin\".equalsIgnoreCase(movieChoice))\n\t\t\t\t\t{\n\t\t\t\tSystem.out.println(\"You chose \" + movieChoice + \" this movie cost 3.00\");\n\t\t\t\tSystem.out.print(\"Would you like more Information on American Assassin? Yes or No \");\n\t\t\t\tamericanAssassinInfo = input.nextLine();\n\t\t\t\tif(\"Yes\".equalsIgnoreCase(americanAssassinInfo))\n\t\t\t\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"\"\n\t\t\t\t\t\t\t+ \"\\n When Cold War veteran Stan Hurley takes CIA black ops recruit Mitch \"\n\t\t\t\t\t\t\t+ \"\\n Rapp under his wing, they receive an assignment to investigate a wave of\"\n\t\t\t\t\t\t\t+ \"\\n random attacks on both military and civilian targets. After discovering \"\t\n\t\t\t\t\t\t\t+ \"\\n a pattern of violence, Hurley and Rapp join forces with a lethal Turkish\"\n\t\t\t\t\t\t\t+ \"\\n agent to stop a mysterious operative who wants to start a global war.\");\t\t\n\t\t\t\t\t\t\tSystem.out.print(\"\"\n\t\t\t\t\t\t\t\t\t+ \"\\n Would you like to rent this movie? Yes or No \");\n\t\t\t\t\t\t\tchoiceAmericanAssassin = input.nextLine();\n\t\t\t\t\t\t\t\tif(\"Yes\".equalsIgnoreCase(choiceAmericanAssassin))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttotal = (total + americanAssassinCost);\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"\"\n\t\t\t\t\t\t\t\t\t\t\t+\"\\n Thank you for renting American Assassin.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\tif(\"It\".equalsIgnoreCase(movieChoice))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"You chose \" + movieChoice + \" this movie cost 3.00\");\n\t\t\t\tSystem.out.print(\"Would you like more Information on It? Yes or No \");\n\t\t\t\titInfo = input.nextLine();\n\t\t\t\t\tif(\"Yes\".equalsIgnoreCase(itInfo))\n\t\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"\"\n\t\t\t\t\t\t\t+ \"\\n Seven young outcasts in Derry, Maine, are about to face their worst nightmare \"\n\t\t\t\t\t\t\t+ \"\\n an ancient, shape-shifting evil that emerges from the sewer every 27 years to \"\n\t\t\t\t\t\t\t+ \"\\n prey on the town's children. Banding together over the course of one horrifying\"\n\t\t\t\t\t\t\t+ \"\\n summer, the friends must overcome their own personal fears to battle the \"\n\t\t\t\t\t\t\t+ \"\\n murderous, bloodthirsty clown known as Pennywise.\");\t\t\n\t\t\t\t\tSystem.out.print(\"\"\n\t\t\t\t\t\t\t+ \"\\n Would you like to rent this movie? Yes or No \");\n\t\t\t\t\tchoiceIt = input.nextLine();\n\t\t\t\t\t\tif(\"Yes\".equalsIgnoreCase(choiceIt))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttotal = (total + itCost);\n\t\t\t\t\t\t\tSystem.out.println(\"\"\n\t\t\t\t\t\t\t\t\t+\"\\n Thank you for renting It.\");\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tif(\"My Little Pony\".equalsIgnoreCase(movieChoice))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"You chose \" + movieChoice + \" this movie cost 2.00\");\n\t\t\t\tSystem.out.print(\"Would you like more Information on My Little Pony? Yes or No \");\n\t\t\t\tmyLittlePonyInfo = input.nextLine();\n\t\t\t\t\tif(\"Yes\".equalsIgnoreCase(myLittlePonyInfo))\n\t\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"\"\n\t\t\t\t\t\t\t+ \"\\n Twilight Sparkle, Applejack, Rainbow Dash, Pinkie Pie, Fluttershy and\"\n\t\t\t\t\t\t\t+ \"\\n Rarity embark on an epic journey to save Ponyville from a dark force.\");\t\t\n\t\t\t\t\tSystem.out.print(\"\"\n\t\t\t\t\t\t\t+ \"\\n Would you like to rent this movie? Yes or No \");\n\t\t\t\t\tchoiceMyLittlePony = input.nextLine();\n\t\t\t\t\t\tif(\"Yes\".equalsIgnoreCase(choiceMyLittlePony))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttotal = (total + myLittlePonyCost);\n\t\t\t\t\t\t\tSystem.out.println(\"\"\n\t\t\t\t\t\t\t\t\t+\"\\n Thank you for renting My Little Pony.\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tif(\"Blade Runner 2049\".equalsIgnoreCase(movieChoice))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"You chose \" + movieChoice + \" this movie cost 3.00\");\n\t\t\t\tSystem.out.print(\"Would you like more Information on Blade Runner 2049? Yes or No \");\n\t\t\t\tbladeRunnerInfo = input.nextLine();\n\t\t\t\t\tif(\"Yes\".equalsIgnoreCase(bladeRunnerInfo))\n\t\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"\"\n\t\t\t\t\t\t\t+ \"\\n Officer K (Ryan Gosling), a new blade runner for the Los Angeles Police\" \n\t\t\t\t\t\t\t+ \"\\n Department, unearths a long-buried secret that has the potential to plunge\"\n\t\t\t\t\t\t\t+ \"\\n what's left of society into chaos. His discovery leads him on a quest to\"\n\t\t\t\t\t\t\t+ \"\\n find Rick Deckard (Harrison Ford), a former blade runner who's been missing\"\n\t\t\t\t\t\t\t+ \"\\n for 30 years.\");\n\t\t\t\t\tSystem.out.print(\"\"\n\t\t\t\t\t\t\t+ \"\\n Would you like to rent this movie? Yes or No \");\n\t\t\t\t\tchoiceBladeRunner = input.nextLine();\n\t\t\t\t\t\tif(\"Yes\".equalsIgnoreCase(choiceBladeRunner))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttotal = (total + bladeRunnerCost);\n\t\t\t\t\t\t\tSystem.out.println(\"\"\n\t\t\t\t\t\t\t\t\t+\"\\n Thank you for renting Blade Runner 2049.\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tif(\"American Made\".equalsIgnoreCase(movieChoice))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"You chose \" + movieChoice + \" this movie cost 3.00\");\n\t\t\t\tSystem.out.print(\"Would you like more Information on American Made? Yes or No \");\n\t\t\t\tamericanMadeInfo = input.nextLine();\n\t\t\t\t\tif(\"Yes\".equalsIgnoreCase(americanMadeInfo))\n\t\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"\"\n\t\t\t\t\t\t\t+ \"\\n Barry Seal, a TWA pilot, is recruited by the CIA to provide \"\n\t\t\t\t\t\t\t+ \"\\n reconnaissance on the burgeoning communist threat in Central America\"\n\t\t\t\t\t\t\t+ \"\\n and soon finds himself in charge of one of the biggest covert CIA \"\n\t\t\t\t\t\t\t+ \"\\n operations in the history of the United States. The operation spawns \"\n\t\t\t\t\t\t\t+ \"\\n the birth of the Medellin cartel and almost brings down the Reagan \"\n\t\t\t\t\t\t\t+ \"\\n White House.\");\t\t\n\t\t\t\t\tSystem.out.print(\"\"\n\t\t\t\t\t\t\t+ \"\\n Would you like to rent this movie? Yes or No \");\n\t\t\t\t\tchoiceAmericanMade = input.nextLine();\n\t\t\t\t\t\tif(\"Yes\".equalsIgnoreCase(choiceAmericanMade))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttotal = (total + americanMadeCost);\n\t\t\t\t\t\t\tSystem.out.println(\"\"\n\t\t\t\t\t\t\t\t\t+\"\\n Thank you for renting American Made.\");\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tif(\"The Mountain Betwween Us\".equalsIgnoreCase(movieChoice))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"You chose \" + movieChoice + \" this movie cost 2.00\");\n\t\t\t\tSystem.out.print(\"Would you like more Information on The Mountain Betwween Us? Yes or No \");\n\t\t\t\tchoiceTheMountainBetweenUs = input.nextLine();\n\t\t\t\t\tif(\"Yes\".equalsIgnoreCase(choiceTheMountainBetweenUs))\n\t\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"\"\n\t\t\t\t\t\t\t+ \"\\n Stranded on a mountain after a tragic plane crash, two strangers must\"\n\t\t\t\t\t\t\t+ \"\\n work together to endure the extreme elements of the remote, snow-covered\"\n\t\t\t\t\t\t\t+ \"\\n terrain. Realizing that help is not on the way, they embark on a perilous\"\n\t\t\t\t\t\t\t+ \"\\n journey across hundreds of miles of wilderness, pushing each other to \"\n\t\t\t\t\t\t\t+ \"\\n survive and discovering their inner strength.\");\t\t\n\t\t\t\t\tSystem.out.print(\"\"\n\t\t\t\t\t\t\t+ \"\\n Would you like to rent this movie? Yes or No \");\n\t\t\t\t\tchoiceTheMountainBetweenUs = input.nextLine();\n\t\t\t\t\t\tif(\"Yes\".equalsIgnoreCase(choiceTheMountainBetweenUs))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttotal = (total + theMountainBetweenUsCost);\n\t\t\t\t\t\t\tSystem.out.println(\"\"\n\t\t\t\t\t\t\t\t\t+\"\\n Thank you for renting The Mountain Betwween Us.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tif(\"Happy Death Day\".equalsIgnoreCase(movieChoice))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"You chose \" + movieChoice + \" this movie cost 3.00\");\n\t\t\t\tSystem.out.print(\"Would you like more Information on Happy Death Day? Yes or No \");\n\t\t\t\thappyDeathDayInfo = input.nextLine();\n\t\t\t\t\tif(\"Yes\".equalsIgnoreCase(happyDeathDayInfo))\n\t\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"\"\n\t\t\t\t\t\t\t+ \"\\n Tree Gelbman is a blissfully self-centered collegian who wakes up on her birthday \"\n\t\t\t\t\t\t\t+ \"\\n in the bed of a student named Carter. As the morning goes on, Tree gets the eerie\"\n\t\t\t\t\t\t\t+ \"\\n feeling that she's experienced the events of this day before. When a masked killer\"\n\t\t\t\t\t\t\t+ \"\\n suddenly takes her life in a brutal attack, she once again magically wakes up in\"\n\t\t\t\t\t\t\t+ \"\\n Carter's dorm room unharmed. Now, the frightened young woman must relive the same\"\n\t\t\t\t\t\t\t+ \"\\n day over and over until she figures out who murdered her.\");\t\t\n\t\t\t\t\tSystem.out.print(\"\"\n\t\t\t\t\t\t\t+ \"\\n Would you like to rent this movie? Yes or No \");\n\t\t\t\t\tchoiceHappyDeathDay = input.nextLine();\n\t\t\t\t\t\tif(\"Yes\".equalsIgnoreCase(choiceHappyDeathDay))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttotal = (total + happyDeathDayCost);\n\t\t\t\t\t\t\tSystem.out.println(\"\"\n\t\t\t\t\t\t\t\t\t+\"\\n Thank you for renting Happy Death Day.\");\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tif(\"Brave\".equalsIgnoreCase(movieChoice))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"You chose \" + movieChoice + \" this movie cost 3.00\");\n\t\t\t\tSystem.out.print(\"Would you like more Information on Brave? Yes or No \");\n\t\t\t\tbraveInfo = input.nextLine();\n\t\t\t\t\tif(\"Yes\".equalsIgnoreCase(braveInfo))\n\t\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"\"\n\t\t\t\t\t\t\t+ \"\\n Merida (Kelly Macdonald), the impetuous but courageous daughter of Scottish King\"\n\t\t\t\t\t\t\t+ \"\\n Fergus (Billy Connolly) and Queen Elinor (Emma Thompson), is a skilled archer who\"\n\t\t\t\t\t\t\t+ \"\\n wants to carve out her own path in life. Her defiance of an age-old tradition angers\"\n\t\t\t\t\t\t\t+ \"\\n the Highland lords and leads to chaos in the kingdom. Merida seeks help from an\"\n\t\t\t\t\t\t\t+ \"\\n eccentric witch (Julie Walters), who grants her an ill-fated wish. Now, Merida\"\n\t\t\t\t\t\t\t+ \"\\n must discover the true meaning of courage and undo a beastly curse before it's too \"\n\t\t\t\t\t\t\t+ \"\\n late.\");\t\t\n\t\t\t\t\tSystem.out.print(\"\"\n\t\t\t\t\t\t\t+ \"\\n Would you like to rent this movie? Yes or No \");\n\t\t\t\t\tchoiceBrave = input.nextLine();\n\t\t\t\t\t\tif(\"Yes\".equalsIgnoreCase(choiceBrave))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttotal = (total + braveCost);\n\t\t\t\t\t\t\tSystem.out.println(\"\"\n\t\t\t\t\t\t\t\t\t+\"\\n Thank you for renting Brave.\");\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tif(\"Spiderman Homecoming\".equalsIgnoreCase(movieChoice))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"You chose \" + movieChoice + \" this movie cost 3.00\");\n\t\t\t\tSystem.out.print(\"Would you like more Information on Spideman Homecoming? Yes or No \");\n\t\t\t\tspidermanHomecomingInfo = input.nextLine();\n\t\t\t\t\tif(\"Yes\".equalsIgnoreCase(spidermanHomecomingInfo))\n\t\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"\"\n\t\t\t\t\t\t\t+ \"\\n Thrilled by his experience with the Avengers, young Peter Parker returns home to \"\n\t\t\t\t\t\t\t+ \"\\n live with his Aunt May. Under the watchful eye of mentor Tony Stark, Parker starts\"\n\t\t\t\t\t\t\t+ \"\\n to embrace his newfound identity as Spider-Man. He also tries to return to his\"\n\t\t\t\t\t\t\t+ \"\\n normal daily routine -- distracted by thoughts of proving himself to be more than\"\n\t\t\t\t\t\t\t+ \"\\n just a friendly neighborhood superhero. Peter must soon put his powers to the\"\n\t\t\t\t\t\t\t+ \"\\n test when the evil Vulture emerges to threaten everything that he holds dear.\");\t\t\n\t\t\t\t\tSystem.out.print(\"\"\n\t\t\t\t\t\t\t+ \"\\n Would you like to rent this movie? Yes or No \");\n\t\t\t\t\tchoiceSpidermanHomecoming = input.nextLine();\n\t\t\t\t\t\tif(\"Yes\".equalsIgnoreCase(choiceSpidermanHomecoming))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttotal = (total + spidermanHomecomingCost);\n\t\t\t\t\t\t\tSystem.out.println(\"\"\n\t\t\t\t\t\t\t\t\t+\"\\n Thank you for renting Spiderman Homecoming.\");\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t\t System.out.println(\"Your total was $\" + total * 1.07);\n\t\t\t System.out.print(\"\"\n\t\t\t\t\t\t+\"\\n Would You like to rent another movie Yes or No?\");\t\n\n\t\t\t\tagain = input.nextLine();\n\t\t\t}while (\"Yes\".equalsIgnoreCase(again));\n\t\t\n\t}", "public static void main(String[] args) {\n int moneyAmount = 10;\n\n int capuccinoPrice = 180;\n int lattePrice = 120;\n int espressoPrice = 80;\n int pureWaterPrise = 20;\n\n var canBuyAnything = false;\n var isMilkEnough = true;\n\n if(moneyAmount >= capuccinoPrice && isMilkEnough) {\n System.out.println(\"Вы можете купить капуччино\");\n canBuyAnything = true;\n }\n\n if(moneyAmount >= lattePrice && isMilkEnough) {\n System.out.println(\"Вы можете купить латте\");\n canBuyAnything = true;\n }\n\n if(moneyAmount >= espressoPrice) {\n System.out.println(\"Вы можете купить еспрессо\");\n canBuyAnything = true;\n }\n\n if(moneyAmount >= pureWaterPrise) {\n System.out.println(\"Вы можете купить воду\");\n canBuyAnything = true;\n }\n\n if(canBuyAnything == false) {\n System.out.println(\"Недостаточно денег\");\n }\n }", "public static void main(String[]args){\n\t\n\tdouble budget =500;\n\t\n\tdouble phone =250.0;\n\tdouble watch =105.5;\n\tdouble bag = 80.00;\n\t\n\t\n\tif(budget< 80.0) {\n\t\tSystem.out.println(\"Cannot buy anything\");\n\t\t\n\t}if (budget >=435.5) {\n\t\tSystem.out.println(\"You can buy all items\");\n\t\n\t\t\n\t} else if (budget >= phone + watch) {\n\t\tSystem.out.println(\"You can buy Phone +Watch OR Phone + Bag OR watch + Bag\");\n\t\t\n\t} else if (budget >= phone +bag); {\n\t\tSystem.out.println(\"You can buy Phone OR watch + bag\");\n\t\t\t\t\n\t if (budget >= watch) {\n\t\tSystem.out.println(\"You can buy a watch or a bag\");\n\t\t\n\t} else {\n\t\tSystem.out.println(\"You can buy a bag\");}\n\t\n\t}\n\t}", "public static void main(String[] args) {\n double cost;\n double diameter;\n double unitCost;\n\n//----Get data\n System.out.print(\"What size pizza : \");\n diameter = keyboard.nextDouble();\n System.out.print(\"What does it cost : \");\n cost = keyboard.nextDouble();\n\n//----Perform computation\n unitCost = computeUnitCost(diameter,cost);\n\n//----Display the diameter, the total cost, and the unit cost\n System.out.println(\"Diameter is \" + diameter);\n System.out.println(\"Total cost is \" + cost);\n System.out.println(\"Unit cost is \" + unitCost);\n\n }", "public int calculatePrice() {\n int price = 5;\n if(hasWhippedCream) {\n price += 1;\n }\n if(hasChocolate) {\n price += 2;\n }\n return quantity * price;\n }", "public static void main(String[] args) {\n\t\tMealBuilder mealBuilder = new MealBuilder();\r\n\r\n\t\tMeal vegMeal = mealBuilder.prepareVegMeal();\r\n\t\tSystem.out.println(\"Veg Meal\");\r\n\t\tvegMeal.showItems();\r\n\t\tSystem.out.println(\"Total Cost: \" + vegMeal.getCost());\r\n\r\n\t\tMeal nonVegMeal = mealBuilder.prepareNonVegMeal();\r\n\t\tSystem.out.println(\"\\n\\nNon-Veg Meal\");\r\n\t\tnonVegMeal.showItems();\r\n\t\tSystem.out.println(\"Total Cost: \" + nonVegMeal.getCost());\r\n\r\n\t\tOrderBuilder orderBuilder = new OrderBuilder();\r\n\t\torderBuilder.burger(new VegBurger(), 1);\r\n\t\torderBuilder.burger(new ChickenBurger(), 2);\r\n\t\torderBuilder.suit(mealBuilder.prepareVegMeal(), 1);\r\n\t\torderBuilder.suit(mealBuilder.prepareNonVegMeal(), 2);\r\n\t\tOrder order = orderBuilder.build();\r\n\r\n\t\tSystem.out.println(\"\\n\\nMeal--µã²Í£¨µ¥µã¡¢Ìײͣ©\");\r\n\t\tfloat cost = 0.0f, cost1 = 0.0f, cost2 = 0.0f;\r\n\t\tMeal meal = new Meal();\r\n\t\tfor (Item item : order.getBurger()) {\r\n\t\t\tmeal.addItem(item);\r\n\t\t}\r\n\t\tmeal.showItems();\r\n\t\tcost1 = meal.getCost();\r\n\t\tSystem.out.println(\"====================================\");\r\n\t\tSystem.out.println(\"Burger subtotal Cost: \" + cost1);\r\n\t\tSystem.out.println(\"====================================\");\r\n\t\tfor (Meal meal1 : order.getSuit()) {\r\n\t\t\tmeal1.showItems();\r\n\t\t\tcost2 += meal1.getCost();\r\n\t\t}\r\n\t\tcost = cost1 + cost2;\r\n\t\tSystem.out.println(\"====================================\");\r\n\t\tSystem.out.println(\"Meal subtotal Cost: \" + cost2);\r\n\t\tSystem.out.println(\"====================================\");\r\n\t\tSystem.out.println(\"Total Cost: \" + cost);\r\n\t}", "@Test\n void doEffectheatseeker() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n WeaponFactory wf = new WeaponFactory(\"heatseeker\");\n Weapon w4 = new Weapon(\"heatseeker\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n wd.addWeapon(w4);\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n wd.addWeapon(w4);\n p.setPlayerPosition(Board.getSquare(0));\n p.getPh().drawWeapon(wd, w4.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(10));\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n try{\n p.getPh().getWeaponDeck().getWeapon(w4.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 3);\n }", "public static void setReproEnergy(){\r\n // we'll let the user determine how much energy a plant needs to acquire\r\n // before it can reproduce\r\n Scanner input = new Scanner(System.in);\r\n System.out.println(\"Each day the sun will pass over our environment,\\n\" +\r\n \"supplying a certain amount of energy to our plants.\\n\" +\r\n \"How many days must pass before our plants have\\n\" +\r\n \"enough energy to reproduce?\");\r\n reproductionEnergy = input.nextInt();\r\n if(reproductionEnergy <= 10){\r\n System.out.println(\"Great. After \" + reproductionEnergy + \" days, if a plant has not\\n\" +\r\n \"been eaten it will reproduce and make a new\\n\" +\r\n \"plant. However, some plants are growing\\n\"+\r\n \"in the shade and will take twice as long to reproduce.\");\r\n } else {\r\n System.out.println(\"Really? Ok. Let's see what happens.\");\r\n }\r\n }", "public static void main(String[] args) {\n\t\t\t\tint complexity = 0;\n\n\t\t\tcomplexity == (temps < 30) && (ingredients < 5) ;\n\n\t\tSystem.out.println(complexity);\n\n\n\n\n\t\t\tif (complexity < 30 && ingredients < 5) {\n\t\t\tSystem.out.println(\"easy\");\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t}\n\t\t\t\n\t\t\telse if(complexity < 60 && ingredients < 10) {\n\t\t\t\tSystem.out.println(\"medium\");\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t}\n\n\t\t\telse if(complexity >= 60 && ingredients >= 10) {\n\t\t\t\tSystem.out.println(\"hard\");\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t}\n\n\t\t\n\t\t\t\n\t}", "private void consumeResources(){\n\n Main.gang.setFood(Main.gang.getFood() - (Main.gang.getGangMembers().size() * Main.gang.getFoodIntake()));\n Main.gang.setWater(Main.gang.getWater() - (Main.gang.getGangMembers().size() * Main.gang.getFoodIntake()));\n }", "public void decideNature()\n {\n String nature = new String(\"\");\n Random rand = new Random();\n int i = rand.nextInt(100);\n if(i <= 25)\n {\n nature = \"Very mischievous. Enjoys hiding objects in plain sight\";\n }//ends the if\n else if(i > 25 && i <= 50)\n {\n nature = \"Loves to spend time sleeping on the clouds\";\n }//ends the else if\n else if(i > 50 && i <= 75)\n {\n nature = \"Is very playful\";\n }//ends the else if\n else\n {\n nature = \"Loves to perform dances in the air\";\n }\n \n setNature(nature);\n }", "public static void main(String[] args) {\n\t\t\tRecipeBook recipeBook= new RecipeBook();\n\t\t\trecipeBook.setName(\"My Recipe Book\");\n\t\t// This is the default value that will be shown on the drop down list\n\t\t\trecipeBook.newRecipe(\"Select an Option\");\n\t\t\n\t\t//Loading sample recipes into memory\n\t\t\t//Create an object type Recipe\n\t\t\t\trecipeBook.newRecipe(\"Peach Almond Pie\");\n\t\t\t\t\n\t\t\t//\tAdding ingredients to the the Recipe\n\t\t\t\trecipeBook.addIngredient(\"Peach Almond Pie\",\" fresh peaches, sliced \",2, \"cups\");\n\t\t\t\trecipeBook.addIngredient(\"Peach Almond Pie\",\" lemon juice \",1, \"Tbsp\");\n\t\t\t\trecipeBook.addIngredient(\"Peach Almond Pie\",\" sugar \",0.25, \"cup\");\n\t\t\t\trecipeBook.addIngredient(\"Peach Almond Pie\",\" cornstarch \",3, \"Tbsp\");\n\t\t\t\trecipeBook.addIngredient(\"Peach Almond Pie\",\" butter \",2, \"tsp\");\n\t\t\t\trecipeBook.addIngredient(\"Peach Almond Pie\",\" salt \",1, \"dash\");\n\t\t\t\trecipeBook.addIngredient(\"Peach Almond Pie\",\" almond extract \",0.25, \"tsp\");\n\t\t\t\trecipeBook.addIngredient(\"Peach Almond Pie\",\" pie shell \",1, \"9 inch\");\n\t\t\n\t\t\t\t// Adding cooking instructions\t\n\t\t\t\trecipeBook.setRecipeInstruction(\"Peach Almond Pie\", \"Sprinkle peaches with lemon and sugar. Let stand 1 hour. Drain to get 1 cup syrup. Add cornstarch to syrup and blend. Cook over low heat until thick. Remove from heat. Add butter, salt, and almond extract. Cool. Carefully stir in peaches. Put in shell. Chill. Serve with whipped cream, topped with slivered almonds and marachino cherries.\");\n\t\t\t\trecipeBook.newRecipe(\"Creamy Chicken Broccoli with Rice\");\n\t\t\t\trecipeBook.addIngredient(\"Creamy Chicken Broccoli with Rice\",\" miracle whip \",0.5, \"cups\");\n\t\t\t\trecipeBook.addIngredient(\"Creamy Chicken Broccoli with Rice\",\" skinless chicken breast, cubed \",1, \"pound\");\n\t\t\t\trecipeBook.addIngredient(\"Creamy Chicken Broccoli with Rice\",\" broccoli, chopped \",2, \"cups\");\n\t\t\t\trecipeBook.addIngredient(\"Creamy Chicken Broccoli with Rice\",\" Velveeta rice \",0.5, \"pound\");\n\t\t\t\trecipeBook.setRecipeInstruction(\"Creamy Chicken Broccoli with Rice\", \"Heat salad dressing in a large skillet. Add chicken and completely cook for about 8 minutes. Stir in broccoli and cook until heated. Add Velveeta and stir until thoroughly melted. Serve over rice.\");\n\t\t\n\t\t\t\t\n\t\t\t\t//Display the Main Menu to the user\n\t\tMainMenu mainMenu =new MainMenu(recipeBook);\n\t\tmainMenu.setVisible(true);\n//\t\t\n\t}", "@Test\n\tpublic void testQualityUnder0() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"Conjured Mana Cake\", 1, -1));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality remains the same\n\t\tassertEquals(\"Quality with quality under 0 Conjured Mana Cake\", -1, quality);\n\t}", "public static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in); \n\t\tint itemNum;\n\t\tint quantity;\n\t\tdouble price;\n\t\tdouble total;\n\t\tSystem.out.println(\"Please enter prod num\");\n\t\titemNum = input.nextInt();\n\t\tSystem.out.println(\"please enter the quantity:\");\n\t\tquantity = input.nextInt();\n\t\t/*if(itemNum == 1){\n\t\t\tprice = 2.98;\n\t\t}\n\t\tif(itemNum == 2){\n\t\t\tprice = 4.5;\n\t\t}*/\n\t\tswitch (itemNum){\n\t\tcase 1:\n\t\t\tprice = 2.98;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tprice = 4.50;\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tprice = 9.98;\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tprice = 4.49;\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\tprice = 6.87;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.out.println(\"Wrong item # price is 0\");\n\t\t\tprice = 0;\t\t\t\n\t\t}\n\t\t\n\t\ttotal = price*quantity;\n\t\tSystem.out.println(\"The total is:\" + total);\n\n\t}", "public static void main (String []args) {\n\t\tSystem.out.println(\"What is your dog's name?\");\n\t\tScanner myScanner = new Scanner(System.in); \n\t\tString dogName = myScanner.nextLine(); // reads user input\n\t\tSystem.out.println(\"Well then, I have this highly reliable report on \" + dogName + \"'s prestigious background right here.\");\n\t\tSystem.out.println(dogName + \" is: \");\n\t\t\n\t\tint percentage = 100; //keeps track the current percentage left\n\t\t\n\t\tRandom rand = new Random(); //creates an instance of random class\n\t\t//generates a random integer in range 0 to 100\n\t\tint randPercentage = rand.nextInt(percentage + 1);\n\t\tSystem.out.println( randPercentage + \"% St. Bernard\");\n\t\t//updates the total and comes up with a random integer in new range\n\t\tpercentage -= randPercentage;\n\t\trandPercentage = rand.nextInt(percentage + 1);\n\t\tSystem.out.println( randPercentage + \"% Chihuahua\"); \n\t\tpercentage -= randPercentage;\n\t\trandPercentage = rand.nextInt(percentage + 1);\n\t\tSystem.out.println( randPercentage + \"% Dramatic RedNosed Asian Pug\");\n\t\tpercentage -= randPercentage;\n\t\trandPercentage = rand.nextInt(percentage + 1);\n\t\tSystem.out.println( randPercentage + \"% Common Cur\"); \n\t\t//last breed is however much that is left\n\t\tpercentage -= randPercentage;\n\t\tSystem.out.println(percentage + \"% King Doberman\");\n\t\tSystem.out.println(\"Wow, that's QUITE the dog!\");\n\t\tmyScanner.close();\n\t}", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tProduct item1 = new Product(\"Toaster\", 29.95);\n\t\tSystem.out.print(item1.getName());\n\t\tSystem.out.println(item1.getPrice());\n\t\tProduct item2 = new Product(\"Coffee Maker\", 19.95);\n\t\tSystem.out.print(item2.getName());\n\t\tSystem.out.println(item2.getPrice());\n\t\tSystem.out.println(1+2+3+4);\n\t\t\n\t\tString itemName = JOptionPane.showInputDialog(null, \"Please input the name of the item\");\n\t\tString itemPrice = JOptionPane.showInputDialog(null, \"Please input the price of the item\");\n\t\t\n\t\tdouble item3Price = Double.parseDouble(itemPrice);\n\t\t\n\t\tProduct item3 = new Product(itemName, item3Price);\n\t\titem1.reducePrice(5.00);\n\t\tSystem.out.println(item1.getPrice());\n\t\titem2.reducePrice(5.00);\n\t\tSystem.out.println(item2.getPrice());\n\t\tSystem.out.println(itemName);\n\t\tSystem.out.println(itemPrice);\n\t\titem3.reducePrice(5.00);\n\t\tSystem.out.println(item3.getPrice());\n\t\t\n\n\t}", "public static void main(String [] args)\n\t{\n\t\tMap<String, Set<String>> ptrMap = getPotionToReagentsTestCaseMap();\n\t\tMap<String, Set<String>> rtpMap = getReagentToPotionsTestCaseMap();\n\n\t\t// Set up list of reagents on hand.\n\t\tSet<String> reagents = new HashSet<>();\n\t\treagents.add(\"Icethorn\");\n\t\treagents.add(\"12-ounce Can of Root Beer\");\n\t\treagents.add(\"Vial of Unicorn Tears\");\n\t\treagents.add(\"Raven Feather\");\n\t\treagents.add(\"Frost Lotus\");\n\t\treagents.add(\"Phoenix Song\");\n\t\treagents.add(\"Rain from a Category 4 Hurricane\");\n\t\treagents.add(\"Wax from a Partially Burned Candle\");\n\t\treagents.add(\"Black Lotus\");\n\n\t\t// Check which potions are brewable.\n\t\tSet<String> set = PotionMaster.allPossiblePotions(ptrMap, rtpMap, reagents);\n\t\tboolean result = checkSet(set);\n\n\t\tif (result)\n\t\t{\n\t\t\tSystem.out.println(\"Hooray!\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"oh no :(\");\n\t\t\tPotionInfo.printSet(set);\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Welcome to Product Application\");\n\t\tScanner sc = new Scanner (System.in);\n\t\t\n\t\t//final int Code_Width = 10;\n\t\t//final int Desc_Width = 20;\n\t\t//final int Price_Width = 10;\n\t\t\n\t\t//double value=0 ;\n\t\t\n\t\t//StringBuilder list = new StringBuilder();\n\t\t\n\t\t\n\t\t//list.append(StringUtil.Pad(\"Code\", Code_Width));\n\t\t//list.append(StringUtil.Pad(\"Decscription\", Desc_Width));\n\t\t//list.append(StringUtil.Pad(\"Price\", Price_Width));\n\t\t//list.append(\"\\n\");\n\t\t\n\t\t//list.append(StringUtil.Pad(\"========= \", Code_Width));\n\t\t//list.append(StringUtil.Pad(\"=================== \", Desc_Width));\n\t\t//list.append(StringUtil.Pad(\"========= \", Price_Width));\n\t\t//list.append(\"\\n\");\n\n\n\t\t\n\t\tString choice = \"y\";\n\t\twhile (choice.equalsIgnoreCase(\"y\")){\n\t\t\t\n\n System.out.print(\"Enter product code: \");\n String productCode = sc.nextLine();\n\t\t\t//get the import from the user\n\t\t\t//System.out.print(\"Enter the product code: \");\n\t\t\t//System.out.println();\n\t\t\t//String productCode = sc.nextLine();\n\t\t\t\n\t\t\t//Product product = Console.getString(\"Enter the product code: \");\n\t\t\t//String productCode = Console.getString(\"Enter the product code: \");\n\n\t\t\t\n\t\t\t//get the product object\n\n\t\t\t//Product product = ProductDB.getProduct(productCode);\n\t\t\tProduct product = ProductDB.getProduct(productCode);\n\n\t\t\tSystem.out.println();\n if(product!= null){\n System.out.println(\"Description: \" + product.toString());\n System.out.println(\"Price: \" + product.getPriceFormatted());\n }\n else{\n System.out.println(\"No product matches this product code. \\n\");}\n //new line\n System.out.println(\"Product count: \" + Product.getCount());\n System.out.println();\n\t\t\t\n\t\t\t\n\t\t\t//see if the user wants to continue\n\t\t\tSystem.out.print(\"Another Product? (y/n): \");\n\t\t\tchoice = sc.nextLine();\n\t\t\tSystem.out.println();\t\t\n\t\t}\n\t\t//System.out.println(list);\n\t\t//list.append(Double.toString(value))\n\t\t//System.out.printf(\"         Total: $%.2f \\n\", value);\n\t\tSystem.out.println(\"Application Ends.\");\n\t\t\n\t}", "public void evolve() {\n\t\tfurniturePriority++;\r\n\t}", "public static void main(String[] args) {\n\n String selection = \"drink\"; // Snack\n String drinkItems = \"tea\"; // coke\n String snackItems = \"chips\"; // candy\n\n if(selection.equals(\"drink\")){\n System.out.println(\"drink option is selected\");\n if(drinkItems.equals(\"tea\")){\n System.out.println(\"tea is selected\");\n }\n else{\n System.out.println(\"coke is selected\");\n }\n }\n else if(selection.equals(\"snack\")){\n System.out.println(\"snack option is selected\");\n if(snackItems.equals(\"chips\")){\n System.out.println(\"chips item is selected\");\n }\n else{\n System.out.println(\"candy item is selected\");\n }\n }\n }", "@Test\r\n public void testPurChaseBeverageWithNotEnoughInventory() {\r\n coffeeMaker.addRecipe(recipe2); // add mocha which use 20 chocolate while we only have 15 chocolate\r\n assertEquals(75, coffeeMaker.makeCoffee(0, 75)); // not enough recipe\r\n }", "public static void main(String[] args) {\n Inventory inventory = new Inventory();\n initializeInventory(inventory);\n\n GuitarSpec test = \n new GuitarSpec(\"b\", \"b\", \"b\", \"b\");\n List matchingGuitars = inventory.search(test);\n if (!matchingGuitars.isEmpty()) {\n System.out.println(\"搜索结果----\");\n for (Iterator i = matchingGuitars.iterator(); i.hasNext(); ) {\n Guitar guitar = (Guitar)i.next();\n GuitarSpec spec = guitar.getSpec();\n System.out.println(\"你搜索的这款吉他:品牌为\" +spec.getBuilder() + \"--型号为\" + spec.getModel() + \"--类型为\" +\n spec.getType() + \"--材质为\" +spec.getWood() + \"--价格为¥\" +\n guitar.getPrice()+\"--ID为\"+guitar.getID());\n }\n } else {\n System.out.println(\"Sorry, 我们没有这一款吉他.\");\n }\n }", "public static void main(String[] args){\n\t\tLunchBox economy = new LunchBox();\n\t\teconomy.add(new Rice(200));\n\t\teconomy.add(new Cabbage(100));\n\t\teconomy.add(new PorkRib(250));\n\t\t//設定變數值\n\t\teconomy.setPriceRatio(1.2);\n\t\tSystem.out.println(\"Total calories of an economy lunch box are \" + economy.getCalorie());\n\t\tSystem.out.println(\"The price of an economy lunch box is \" + economy.getPrice());\n\t\t\n\t\tLunchBox valuedChoice = new LunchBox();\n\t\tvaluedChoice.add(new Rice(200));\n\t\tvaluedChoice.add(new Egg(30));\n\t\tvaluedChoice.add(new Carrot(100));\n\t\tvaluedChoice.add(new PorkRib(300));\n\t\tvaluedChoice.setPriceRatio(1.3);\n\t\tSystem.out.println(\"Total calories of a valued-choice lunch box are \" + valuedChoice.getCalorie());\n\t\tSystem.out.println(\"The price of an valued-choice lunch box is \" + valuedChoice.getPrice());\n\t\t\n\t\t//EX4\n\t\tSystem.out.println(\"便當economy比便當valued-choice更便宜嗎?\" + (LunchBox.isCheaperThan(economy, valuedChoice)?\"是\":\"否\"));\n\t\t\n\t}", "private void haveFun() {\n\t\tint action = inputPrompt.funActivities(money);\r\n\t\tthis.money -= action;\r\n\t\t//has better effect depending on how much money you have spent\r\n\t\tthis.mentalHealth += FUNHEALTH + action;\r\n\t\tdailyTime--;\r\n\t\tinputPrompt.mainInfo(energy, physHealth, mentalHealth, money);\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tint X, Y, food_needed;\r\n\r\n\t\tSystem.out.printf(\"X: \");\r\n\t\tX = scan.nextInt();\r\n\t\tSystem.out.printf(\"Y: \");\r\n\t\tY = scan.nextInt();\r\n\t\tscan.close();\r\n\r\n\t\tfood_needed = X * 3;\r\n\r\n\t\tif (Y >= food_needed) {\r\n\t\t\tSystem.out.printf(\"Enough food to feed all fish.\\n\");\r\n\t\t}\r\n\r\n\t\tif (!(Y >= food_needed)) {\r\n\t\t\tSystem.out.printf(\"Not enough food to feed all fish.\\n\");\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\n\tScanner myScanner = new Scanner(System.in);\n\t\n\tSystem.out.println(\"What Country are you from?\");\n\tString country = myScanner.nextLine();\n\t\n\tString favoriteFood;\n\t\n\tswitch (country) {\n\t\n\tcase \"USA\":\n\t\tfavoriteFood=\"Burger\";\n\t\tbreak;\n\tcase \"Afghanistan\":\n\t\tfavoriteFood= \"Palau\";\n\t\tbreak;\n\tcase \"Russia\":\n\t\tfavoriteFood= \"Pelmeni\";\n\t\tbreak;\n\tcase \"Colombia\":\n\t\tfavoriteFood= \"Arepas\";\n\t\tbreak;\n\tcase \"Italy\":\n\t\tfavoriteFood= \"Pasta\";\n\t\tbreak;\n\tcase \"Pakistan\":\n\t\tfavoriteFood= \"Biryani\";\n\t\tbreak;\n\tdefault:\n\t\tfavoriteFood= \"Unkown\";\n\t\tbreak;\n\t\t\n\t}\n\tSystem.out.println(\"favorite food is \"+favoriteFood);\n\t}", "public static void main(String[] args) {\n\n\t\t\n\t\tdouble money=5;\t\t\t\t\n\t\tdouble iceCream=5.59;\n\n\t\tif (money<= iceCream); {\n System.out.println(\"I am going to buy iceCream\");\n }else {\n\t\tSystem.out.println(\"I cant buy iceCream\");\n\t\n\t\t}\n\t\t}", "public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n System.out.println(\"Do you want food or drink? \");\n System.out.println(\"If your answer is food you want meal or snack? \");\n System.out.println(\"If your answer is drink you want soda or juice? \");\n String mainOption= scan.next();\n String secondaryOption = scan.next();\n\n if(mainOption.equalsIgnoreCase(\"food\")){\n System.out.println(\"You have selected food\");\n if(secondaryOption.equalsIgnoreCase(\"meal\")){\n System.out.println(\"You have selected meal\");\n }else if (secondaryOption.equalsIgnoreCase(\"snack\")) {\n System.out.println(\"You have selected snack\");\n }else if(mainOption.equalsIgnoreCase(\"drink\")){\n System.out.println(\"You have selected drink\");\n }else if(secondaryOption.equalsIgnoreCase(\"soda\")) {\n System.out.println(\"You have selected soda\");\n }else if(secondaryOption.equalsIgnoreCase(\"juice\")) {\n System.out.println(\"You have selected juice\");\n\n }\n\n }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n }", "@Test\n\tpublic void testQuality0SellInUnder0() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"Sulfuras, Hand of Ragnaros\", -11, 0));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality remains the same\n\t\tassertEquals(\"Quality with quality 0 Sulfuras\", 0, quality);\n\t}", "public static void main(String[] args) {\n\t\tScanner reader=new Scanner(System.in);\n\t\tSystem.out.println(\"please enter what type of ticket buying? :\");\n\t\tString typeticket=reader.nextLine();\n\t System.out.println(typeticket);\n\t int totPrice=0;\n\t System.out.println(typeticket.toLowerCase());\n if(typeticket.toLowerCase().equals(\"silver\"))\n {\n \ttotPrice=2*150;\n \tSystem.out.println(typeticket +\" Price for 2 is :\"+totPrice);\n }\n else if(typeticket.toLowerCase().equals(\"golden\"))\n {\n \ttotPrice=2*200;\n \tSystem.out.println(typeticket +\" Price for 2 is :\"+totPrice);\n }\n \n \n\t}", "public static void main(String[] args) {\n Apple appleRp = new Apple(new BigDecimal(150.5), \"red\", Ripeness.RIPE, false);\n Banana bananaRp = new Banana(new BigDecimal(175.4), \"yellow\", Ripeness.RIPE, false);\n Orange orangeVerd = new Orange(new BigDecimal(200.0), \"yellow\", Ripeness.VERDANT, false);\n Orange orangeRp = new Orange(new BigDecimal(210.2), \"orange\", Ripeness.RIPE, false);\n Pear pearVerd = new Pear(new BigDecimal(180.9), \"green\", Ripeness.VERDANT, false);\n\n Carrot carrotRp = new Carrot(new BigDecimal(100.9), \"orange\", Ripeness.RIPE, false);\n Celery celeryVerd = new Celery(new BigDecimal(200.0), \"green\", Ripeness.VERDANT, false);\n Onion onionRp = new Onion(new BigDecimal(90.9), \"white\", Ripeness.RIPE, true);\n Potato potatoRp = new Potato(new BigDecimal(105.8), \"brown\", Ripeness.RIPE, false);\n\n // Main array of plants creation\n Plant[] basketContent = {carrotRp, orangeVerd, bananaRp, celeryVerd};\n\n // Extra array of plants creation\n Plant[] additionalBasketContent = {onionRp, appleRp, orangeRp, pearVerd, potatoRp};\n\n // Food processor creation\n FoodProcessor foodProcessor = new FoodProcessor();\n\n System.out.println(\" FRUITS&VEGETABLES\\n\\n\");\n\n // Total basket creation\n Basket basket = new Basket();\n\n // Filling the total basket by the main array of plants\n basket.put(basketContent);\n\n System.out.println(\"Basket contains:\");\n basket.printContent();\n System.out.println(\"\\nBasket weight: \" + basket.getBasketWeight() + \" g.\");\n\n // Extra basket creation\n Basket additionalBasket = new Basket();\n\n // Filling the extra basket by the extra array of plants\n additionalBasket.put(additionalBasketContent);\n\n // Combining total and extra baskets\n basket.put(additionalBasket);\n\n System.out.println(\"\\nBasket contains:\");\n basket.printContent();\n System.out.println(\"\\nBasket weight: \" + basket.getBasketWeight() + \" g.\");\n\n System.out.println(\"\\n\\n PEELING FRUITS:\\n\");\n\n // Weight of total basket\n BigDecimal oldBasketWeight = basket.getBasketWeight();\n System.out.println(\"Basket weight before fruits peeling: \" + oldBasketWeight.round(MathContext.DECIMAL32) + \" g.\");\n\n // Weight of all fruits in total basket\n BigDecimal oldFruitsWeight = basket.getFruitsWeight();\n System.out.println(\"Fruits weight before peeling: \" + oldFruitsWeight.round(MathContext.DECIMAL32) + \" g.\");\n\n // Extracting of all fruits from total basket\n Fruit[] fruitsToProcess = basket.extractAllFruits();\n\n // Weight of fruits after peeling\n BigDecimal newFruitsWeight = foodProcessor.peelItems(fruitsToProcess);\n System.out.println(\"Fruits weight after peeling: \" + newFruitsWeight.round(MathContext.DECIMAL32) + \" g.\");\n\n // Insertion of peeled fruits back to total basket\n basket.put(fruitsToProcess);\n BigDecimal newBasketWeight = basket.getBasketWeight();\n System.out.println(\"Basket weight after fruits peeling: \" + newBasketWeight.round(MathContext.DECIMAL32) + \" g.\");\n\n // Weight difference\n System.out.println(\"Weight difference: \" + (oldBasketWeight.subtract(newBasketWeight)).round(MathContext.DECIMAL32) + \" g.\");\n\n System.out.println(\"\\n\\n PEELING VEGETABLES:\\n\");\n\n // Current weight of total basket\n oldBasketWeight = basket.getBasketWeight();\n System.out.println(\"Basket weight before vegetables peeling: \" + oldBasketWeight.round(MathContext.DECIMAL32) + \" g.\");\n\n // Weight of all vegetables in total basket\n BigDecimal oldVegetablesWeight = basket.getVegetablesWeight();\n System.out.println(\"Vegetables weight before peeling: \" + oldVegetablesWeight.round(MathContext.DECIMAL32) + \" g.\");\n\n // Extracting of all vegetables from total basket\n Vegetable[] vegetablesToProcess = basket.extractAllVegetables();\n\n // Weight of vegetables after peeling\n BigDecimal newVegetablesWeight = new BigDecimal(0.0);\n\n try {\n newVegetablesWeight = foodProcessor.peelItems(vegetablesToProcess);\n } catch (IllegalArgumentException e) {\n System.out.println(e.getMessage());\n }\n\n System.out.println(\"Vegetables weight after peeling: \" + newVegetablesWeight.round(MathContext.DECIMAL32) + \" g.\");\n\n // Insertion of peeled vegetables back to total basket\n basket.put(vegetablesToProcess);\n newBasketWeight = basket.getBasketWeight();\n System.out.println(\"Basket weight after vegetables peeling: \" + newBasketWeight.round(MathContext.DECIMAL32) + \" g.\");\n\n // Weight difference\n System.out.println(\"Weight difference: \" + (oldBasketWeight.subtract(newBasketWeight)).round(MathContext.DECIMAL32) + \" g.\");\n\n System.out.println(\"\\n\\n CUTTING VEGETABLES:\\n\");\n\n // Current weight of total basket\n oldBasketWeight = basket.getBasketWeight();\n System.out.println(\"Basket weight before vegetables cutting: \" + oldBasketWeight.round(MathContext.DECIMAL32) + \" g.\");\n\n // Current weight of vegetables in total basket\n oldVegetablesWeight = basket.getVegetablesWeight();\n System.out.println(\"Vegetables weight before cutting: \" + oldVegetablesWeight.round(MathContext.DECIMAL32) + \" g.\");\n\n // Extracting of all vegetables from total basket\n vegetablesToProcess = basket.extractAllVegetables();\n\n try {\n // Weight of vegetables after cutting\n newVegetablesWeight = foodProcessor.cutAll(vegetablesToProcess);\n } catch (IllegalArgumentException e) {\n System.out.println(e.getMessage());\n }\n\n System.out.println(\"Vegetables weight after cutting: \" + newVegetablesWeight.round(MathContext.DECIMAL32) + \" g.\");\n\n // Insertion of cuted vegetables back to total basket\n basket.put(vegetablesToProcess);\n newBasketWeight = basket.getBasketWeight();\n System.out.println(\"Basket weight after vegetables cutting: \" + newBasketWeight.round(MathContext.DECIMAL32) + \" g.\");\n\n // Weight difference\n System.out.println(\"Weight difference: \" + (oldBasketWeight.subtract(newBasketWeight)).round(MathContext.DECIMAL32) + \" g.\");\n\n System.out.println(\"\\n\\n SLICING FRUITS:\\n\");\n\n // Current weight of total basket\n oldBasketWeight = basket.getBasketWeight();\n System.out.println(\"Basket weight before fruits slicing: \" + oldBasketWeight.round(MathContext.DECIMAL32) + \" g.\");\n\n // Current weight of fruits in total basket\n oldFruitsWeight = basket.getFruitsWeight();\n System.out.println(\"Fruits weight before slicing: \" + oldFruitsWeight.round(MathContext.DECIMAL32) + \" g.\");\n\n // Extracting of all fruits from total basket\n fruitsToProcess = basket.extractAllFruits();\n\n try {\n // Weight of fruits after slicing\n newFruitsWeight = foodProcessor.sliceAll(fruitsToProcess);\n } catch (IllegalArgumentException e) {\n System.out.println(e.getMessage());\n }\n\n System.out.println(\"Fruits weight after slicing: \" + newFruitsWeight.round(MathContext.DECIMAL32) + \" g.\");\n\n // Insertion of sliced fruits back to total basket\n basket.put(fruitsToProcess);\n newBasketWeight = basket.getBasketWeight();\n System.out.println(\"Basket weight after fruits slicing: \" + newBasketWeight.round(MathContext.DECIMAL32) + \" g.\");\n\n // Weight difference\n System.out.println(\"Weight difference: \" + (oldBasketWeight.subtract(newBasketWeight)).round(MathContext.DECIMAL32) + \" g.\");\n\n System.out.println(\"\\n\\n NEW PLANT SLICING\\n\");\n\n // New plant creation\n Potato potatoRpPink = new Potato(new BigDecimal(120.9), \"pink\", Ripeness.RIPE, false);\n\n // Insertion to the end of total basket\n basket.put(potatoRpPink);\n System.out.println(\"Basket contains:\");\n basket.printContent();\n System.out.println(\"\\nBasket weight: \" + basket.getBasketWeight() + \" g.\\n\");\n\n // Current weight of total basket\n oldBasketWeight = basket.getBasketWeight();\n\n // Extraction element from the end of total basket\n Plant lastInBasket = basket.extract(basket.getBasketContent().length - 1);\n\n // Weight of plant before slicing\n BigDecimal oldlastInBasketWeight = lastInBasket.getWeight();\n BigDecimal newLastInBasketWeight = new BigDecimal(0.0);\n\n System.out.println(lastInBasket);\n\n try {\n // Weight of plant after slicing\n newLastInBasketWeight = foodProcessor.slice(lastInBasket);\n } catch (IllegalArgumentException e) {\n newLastInBasketWeight = lastInBasket.getWeight();\n System.out.println(e.getMessage());\n }\n\n System.out.println(\"Plant weight after slicing: \" + newLastInBasketWeight + \" g.\");\n\n // Weight difference\n System.out.println(\"Weight difference: \" + (oldlastInBasketWeight.subtract(newLastInBasketWeight)).round(MathContext.DECIMAL32) + \" g.\");\n\n // Insertion of sliced plant back to total basket\n basket.put(lastInBasket);\n newBasketWeight = basket.getBasketWeight();\n System.out.println(\"Basket weight after last element slicing: \" + newBasketWeight.round(MathContext.DECIMAL32) + \" g.\");\n\n // Weight difference\n System.out.println(\"Weight difference: \" + (oldBasketWeight.subtract(newBasketWeight)).round(MathContext.DECIMAL32) + \" g.\");\n\n\n }", "public static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tint t=sc.nextInt();\n\t\tint pike=sc.nextInt();\n\t\tint pick=sc.nextInt();\n\t\tint total=sc.nextInt();\n\t\tint out=0;\n\t\tfor(int count=0;count*t<=total;count++) {\n\t\t\tfor(int count2=0;count2*pike<=total;count2++) {\n\t\t\t\tfor(int count3=0;count3*pick<=total;count3++) {\n\t\t\t\t\tif(count!=0||count2!=0||count3!=0) {\n\t\t\t\t\t\tif(count*t+count2*pike+count3*pick<=total) {\n\t\t\t\t\t\t\tSystem.out.println(count+\" Brown Trout, \"+count2+\" Northern Pike, \"+count3+\" Yellow Pickerel\");\n\t\t\t\t\t\t\tout++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Number of ways to catch fish: \"+out);\n\t\tsc.close();\n\t\t\n\t}", "private int calculatePrice(boolean addWhippedCream, boolean addChocolate, boolean addCinnamon, boolean addMarshmallows) {\n int basePrice = 5;\n if (addWhippedCream){\n basePrice = basePrice + 1;\n }\n if (addChocolate){\n basePrice = basePrice + 1;\n }\n if (addCinnamon){\n basePrice = basePrice + 1;\n }\n if (addMarshmallows){\n basePrice = basePrice + 1;\n }\n return quantity * basePrice;\n\n }", "public static void main(String[] args) {\nString whatPet= JOptionPane.showInputDialog(\"What pet do you want?\");\n\t\t// 7. REPEAT steps 3 - 6 enough times to make your pet happy!\n\t\tfor (int i= 0; happinessLevel < 7; ) {\n\t\t\t\n\t\t\n\t\t\t// 3. Use showOptionDialog to ask the user what they want to do to make their pet happy\n\t\t\t// (eg: cuddle, food, water, take a walk, groom, clean up poop).\n\t\t\t// Make sure to customize the title and question too.\n\t\t\tint task = JOptionPane.showOptionDialog(null, \"What do yu want to do to make your \"+whatPet+\" happy?\", \"Things to do for yor \"+whatPet, 0, JOptionPane.INFORMATION_MESSAGE, null,\n\t\t\t\t\tnew String[] { \"Cuddle\", \"Food/Water\", \"Take it for a walk\" }, null);\n\n\t\t\t// 5. Use user input to call the appropriate method created in step 4.\nif(task == 0) {\n\tcuddle(whatPet);\n}if(task == 1) {\n\tfoodOrWater(whatPet);\n}if(task == 2) {\n\twalk(whatPet);\n}\n\t\t\t// 6. If you determine the happiness level is large enough, tell the\n\t\t\t// user that he loves his pet and use break; to exit for loop.\n\t\t}\n\t JOptionPane.showMessageDialog(null, \"Good job, you love your \"+whatPet+\".\");\n\n\t}", "public void productAnalysis()\n {\n Scanner scan = new Scanner (System.in);\n String ans;\n\n do \n {\n System.out.println(\"Are you doing product analysis for a carseat [C] or a buggy [B]\");\n ans=scan.nextLine();\n if(!(ans.equalsIgnoreCase(\"B\")||ans.equalsIgnoreCase(\"C\")))\n {\n System.out.println(\"Error, Enter [B] for Buggy or [C] for Carseat\");\n }\n } while (!(ans.equalsIgnoreCase(\"B\")||ans.equalsIgnoreCase(\"C\")));\n\n if (ans.equalsIgnoreCase(\"B\"))\n {\n for (Hardware aHardware : list)\n {\n if (aHardware instanceof Buggy)\n {\n Buggy b = (Buggy) aHardware;\n\n if (b.getSales()>0)\n {\n System.out.println(\"Displaying the buggies with the most units sold\");\n System.out.println(\"Brand: \" + b.getBrand() + \" \" + \"Number of units sold: \" + b.getSales());\n }\n\n if (b.getSales() == 0)\n {\n System.out.println(\"Displaying the buggies with no sales\");\n System.out.println(\"Brand: \"+ b.getBrand());\n }\n }\n }\n }\n\n if (ans.equalsIgnoreCase(\"C\"))\n {\n for (Hardware aHardware : list)\n {\n if (aHardware instanceof Carseat)\n {\n Carseat c = (Carseat) aHardware;\n if (c.getSales()>0)\n {\n System.out.println(\"Displaying the carseats with the most units sold\");\n System.out.println(\"Brand: \" + c.getBrand() + \"Number of units sold\" + c.getSales());\n }\n\n if (c.getSales() == 0)\n {\n System.out.println(\"Displaying the carseats with no sales\");\n System.out.println(\"Brand: \"+ c.getBrand());\n } \n }\n }\n }\n\n }", "private void drink()\n { \n if(i.item3 == true && i.used == false)\n {\n p.energy += 70;\n i.item3 = false;\n i.used = true;\n System.out.println(\"Energy: \" + p.energy);\n }\n else if(i.used == true && i.item3 == false) \n {\n System.out.println(\"You already drank a redbull!\"); \n }\n else if(i.item3 == false && i.used == false)\n {\n System.out.println(\"no more drinks left!\");\n }\n }", "public static void main(String[] args) throws Exception {\n\t\tgetMeal();\r\n\t}", "@Test\n\tpublic void testQualityOver50SellInUnder0() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"Aged Brie\", -11, 51));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality remains the same\n\t\tassertEquals(\"Quality with quality 0 Brie\", 51, quality);\n\t}", "public static void fullProof()\r\n\t{\r\n\t\twhile(true)\r\n\t\t{\r\n\t\t\tif(choice >= 1 && choice <= 4)\r\n\t\t\t{\r\n\t\t\t\tif(choice == 1)\r\n\t\t\t\t{\r\n\t\t\t\t\tsetupShop();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\telse if (choice > 1 && choice <= 4)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"You have not set up shop yet!\");\r\n\t\t\t\t\tintro();\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(choice < 1 || choice > 4)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Do not know \" + choice);\r\n\t\t\t\tintro();\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\t\tintro();\r\n\t\twhile(true)\r\n\t\t{\r\n\t\t\tif(choice >= 1 && choice <= 4)\r\n\t\t\t{\r\n\t\t\t\tif(choice == 1)\r\n\t\t\t\t{\r\n\t\t\t\t\tsetupShop();\r\n\t\t\t\t\tintro();\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tif(choice == 2)\r\n\t\t\t\t{\r\n\t\t\t\t\tbuy(products);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif(choice == 3 || choice == 4)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"You have not bought anything yet!\");\r\n\t\t\t\t\tintro();\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(choice < 1 || choice > 4)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Do not know \" + choice);\r\n\t\t\t\tintro();\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\t\tintro();\r\n\t\twhile(true)\r\n\t\t{\r\n\t\t\tif(choice >= 1 || choice <= 4)\r\n\t\t\t{\r\n\t\t\t\tif(choice == 1)\r\n\t\t\t\t{\r\n\t\t\t\t\tsetupShop();\r\n\t\t\t\t\tintro();\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tif(choice == 2)\r\n\t\t\t\t{\r\n\t\t\t\t\tbuy(products);\r\n\t\t\t\t\tintro();\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tif(choice == 3)\r\n\t\t\t\t{\r\n\t\t\t\t\tlistItems(products, prices, amount);\r\n\t\t\t\t\tintro();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif(choice == 4)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"You have not listed anything yet!\");\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(choice < 0 || choice > 4)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Do not know \" + choice);\r\n\t\t\t\tintro();\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\t\twhile(true)\r\n\t\t{\r\n\t\t\tif(choice >= 1 || choice <= 4)\r\n\t\t\t{\r\n\t\t\t\tif(choice == 1)\r\n\t\t\t\t{\r\n\t\t\t\t\tsetupShop();\r\n\t\t\t\t\tintro();\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tif(choice == 2)\r\n\t\t\t\t{\r\n\t\t\t\t\tbuy(products);\r\n\t\t\t\t\tintro();\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tif(choice == 3)\r\n\t\t\t\t{\r\n\t\t\t\t\tlistItems(products, prices, amount);\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tif(choice == 4)\r\n\t\t\t\t{\r\n\t\t\t\t\tpreTotal = subTotal(productAmounts);\r\n\t\t\t\t\tcheckout(preTotal, discount, discountRate);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Do not know \" + choice);\r\n\t\t\t\tintro();\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Nature provides birdy the ability to fly.\");\n\t\tSystem.out.println(\"Nature doesn't give kitty the abilty to fly.\");\n\t\tCat kitty = new Cat(\"kitty\", 6f, new NoFlyingAbilty());\n\t\tSparrow birdy = new Sparrow(\"birdy\", 0.3f,\n\t\t\t\tnew SparrowLikeFlyingAbility());\n\n\t\t// Nature tests the flying abilities.\n\t\tSystem.out.println(\"\\nNature asks kitty to fly.\");\n\t\tkitty.getFlyingAbility().fly();\n\t\tSystem.out.println(\"\\nNature asks birdy to fly.\");\n\t\tbirdy.getFlyingAbility().fly();\n\n\t\t// Nature feels sad that kitty cannot fly, gives it flying capabilities.\n\t\tSystem.out\n\t\t\t\t.println(\"\\nNature gives kitty the power to fly like an eagle.\");\n\t\tkitty.changeFlyingAbility(new EagleLikeFlyingAbility());\n\n\t\t// And now nature asks the kitty to spread its wings.\n\t\tSystem.out.println(\"\\nNature asks the kitty to spread its wings.\");\n\t\tkitty.getFlyingAbility().fly();\n\t}", "public static void main(String[] args) {\n\n\t\tboolean allergy=true;\n\t\t\n\t\tboolean petAllergy=false;\n\t\tboolean peanatAllergy=true;\n\t\tboolean pollenAllergy=false;\n\t\t\n\t\t\n\t\t\n\tif (allergy) {\n\t\tSystem.out.println(\"Lets do further check\");\n\t\tif (petAllergy) {\n\t\t\tSystem.out.println(\"Please no cats or dogs in the house\");\n\t\t\n\t\t\n\t\t} else if (peanatAllergy){\n\t\t\tSystem.out.println(\"Dont eat peanat butter\");\n\t\t}else if (pollenAllergy) {\n\t\t\tSystem.out.println(\"Dont clean \");}\n\t}else {\n\t\tSystem.out.println(\"You are lucky\");\n\t}\n\t\n\tSystem.out.println(\"-----------Example 2----------\");\n\t\n\t/*\n\t * If todays is friday we will watch movie but would like to check the date\n\t * if date is 13--> watching scary movie\n\t * and if its is not--> i will watch comedy, action\n\t * \n\t * if no Friday --> i am studying\n\t */\n\t\n\tboolean Friday=false;\n\tint date=4;\n\tboolean monday=true;\n\t\n\tif (Friday) {\n\t\tif (date==13) {\n\t\t\tSystem.out.println(\"We will watch a scary movie\");\n\t\t\n\t\t}else {\n\t\t\tSystem.out.println(\"Watch a comedy\");\n\t\t}\n\t\t\n\t\t\n\t}else {\n\t\t\n\t\tif(monday) {\n\t\tSystem.out.println(\"I am not studying,Im working\");\n\t}else {\n\t\tSystem.out.println(\"I have class at Syntax\");\n\t}\n\t}\n\t\n\tSystem.out.println(\"----------Example 3------\");\n\t/*\n\t * check if assignment is completed\n\t * if assignment is complited:\n\t * if score >90--> great job\n\t * if score >80--> good job;\n\t * if score >70--> please study more\n\t */\n\t\n\tboolean assignment=false;\n\tint score=92;\n\t\n\tif (assignment) {\n\t\tif(score>90) {\n\t\t\tSystem.out.println(\"Great job!\");\n\t\t}else if (score>80) {\n\t\t\tSystem.out.println(\"Good job\");\n\t\t}else if (score>70) {\n\t\t\tSystem.out.println(\"Pleaase study more\");\n\t\t}else {\n\t\t\tSystem.out.println(\"Good job for trying,but must study!\");\n\t\t}\n\t\t\n\t\t\n\t}else {\n\t\tSystem.out.println(\"You should always complete all assignments\");\n\t}\n\t\n\t}", "public static void main(String[] args) {\n\t\tString flavor = smoothieFlavor();\n\t\tString size = smoothieSize();\n\t\tSystem.out.println(\"A \" + size + \" \" + flavor + \" smoothie is a whole lotta \" + flavor + \" smoothie\");\n\t}", "public static void main(String[] args) {\n\t\tint pizzaCount = 30;\n\t\tint studentCount = 145;\n\t\t\n\t\tboolean isEnoughPizza = pizzaCount*8 >= studentCount*2;\n\t\tSystem.out.println(\"Enough pizza? \" + isEnoughPizza);\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tScanner in = new Scanner(System.in);\n\t\t\n\t\tCharm charm = new Charm();\n\t\tSystem.out.print(\"Point of face : \");\n\t\tint face = in.nextInt();\n\t\tboolean bool = charm.isCondition(face);\n\t\twhile (!bool) {\n\t\t\tSystem.out.println(\"Input between 0 - 10 \");\n\t\t\tface = in.nextInt();\n\t\t\tbool = charm.isCondition(face);\n\t\t}\n\t\t\n\t\t//2\n\t\tSystem.out.print(\"Point of rich : \");\n\t\tint rich = in.nextInt();\n\t\tbool = charm.isCondition(rich);\n\t\twhile (!bool) {\n\t\t\tSystem.out.println(\"Input between 0 - 10 \");\n\t\t\trich = in.nextInt();\n\t\t\tbool = charm.isCondition(rich);\n\t\t}\n\t\t\n\t\t//3\n\t\tSystem.out.print(\"Point of nature : \");\n\t\tint nature = in.nextInt();\n\t\tbool = charm.isCondition(nature);\n\t\twhile (!bool) {\n\t\t\tSystem.out.println(\"Input between 0 - 10 \");\n\t\t\tnature = in.nextInt();\n\t\t\tbool = charm.isCondition(nature);\n\t\t}\n\t\t\n\t\t//4\n\t\tSystem.out.print(\"Point of smile : \");\n\t\tint smile = in.nextInt();\n\t\tbool = charm.isCondition(smile);\n\t\twhile (!bool) {\n\t\t\tSystem.out.println(\"Input between 0 - 10 \");\n\t\t\tsmile = in.nextInt();\n\t\t\tbool = charm.isCondition(smile);\n\t\t}\n\t\t\n\t\t//5\n\t\tSystem.out.print(\"Point of speech : \");\n\t\tint speech = in.nextInt();\n\t\tbool = charm.isCondition(speech);\n\t\twhile (!bool) {\n\t\t\tSystem.out.println(\"Input between 0 - 10 \");\n\t\t\tspeech = in.nextInt();\n\t\t\tbool = charm.isCondition(speech);\n\t\t}\n\t\t\n\t\tcharm.setFace(face);\n\t\tcharm.setNature(nature);\n\t\tcharm.setRich(rich);\n\t\tcharm.setSmile(smile);\n\t\tcharm.setSpeech(speech);\n\t\t\n\t\tdouble result = charm.process();\n\t\tSystem.out.println(\"Point of your charm is : \"+result);\n\t}", "public void flavorChosen()\n {\n changeSubtotalTextField();\n }", "public static void main(String[] args)\n\t{\n\t\t\n\t\t\n\t\tSystem.out.println (\"Which Magpie do you want to test? 2, 3 or 4\");\n\t\t\n\t\tScanner in = new Scanner (System.in);\n\t\tString tester = in.nextLine();\n\t\t\n\t\tif (tester.equals(\"2\")) {\n\t\t \t //testMagPie2(); \n\t\t \t }\n\t\t else \n\t\t if (tester.equals(\"3\")) {\n\t\t /// testMagPie3(); \n\t\t }\n\t\t else \n\t\t if (tester.equals(\"4\")) \n\t\t { \n\t\t testMagPie4(); \n\t\t }\n\t\t else System.out.println(\"Sorry you did not follow directions, try again\"); \n\t\t \n\t\t\n\t}", "public static void main (String [] args) {\n Scanner input = new Scanner(System.in);\n \n // Ask the user for their age\n System.err.print(\"How old are you? \");\n int age = input.nextInt();\n \n // Ask the user if they have a coupon\n System.err.print(\"Do you have a coupon? [true/false] \");\n \n boolean coupon = input.nextBoolean();\n \n // Print the cost of a movie ticket\n if (age <= 13 || age >= 65) {\n \tif (coupon == true) { \n \t\tSystem.out.println(\"Your ticket costs $9.5.\"); \t\n \t}\n \telse {\n \t\tSystem.out.println(\"Your ticket costs $11.5.\");\n \t}\n }\n if ((age > 13 && age < 65) && coupon == true) {\n \tSystem.out.println(\"Your ticket costs $12.5.\");\n }\n if ((age > 13 && age < 65) && coupon == false) {\n \tSystem.out.println(\"Your ticket costs $14.5.\");\n }\n }", "@Test //covers loop test with one pass through the loop\n\tpublic void exampleTest() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"+5 Dexterity Vest\", 10, 20));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality has decreased by one\n\t\tassertEquals(\"Failed quality for Dexterity Vest\", 19, quality);\n\t}", "public static void main(String[] args) {\n HealthyBurger healthyBurger = new HealthyBurger(\"pig butt\");\n healthyBurger.addLettuce();\n healthyBurger.displayPriceBreakdown();\n Hamburger hamburger = new Hamburger(\"hawaien\", \"sausage\");\n hamburger.displayPriceBreakdown();\n DeluxeBurger deluxeBurger = new DeluxeBurger(\"wheat\", \"string beef\");\n deluxeBurger.addCheese();\n deluxeBurger.displayPriceBreakdown();\n\n }", "public static void main(String[] args) {\n HouseCat garfield = new HouseCat(\"Garfield\", \"Orange\", 2_500, false, \"Persian Tabby\");\n\n garfield.displayWeightInPounds();\n garfield.meow();\n }", "abstract int food();", "public static Beverage orderDrink(){\n // Create a Scanner object\n Scanner input = new Scanner(System.in);\n\n String size = \"\";\n String type =\"\";\n int x = 0;\n int y =0;\n //Ask user if what size and type of drink they would like to order.\n do {\n System.out.print(\"\\nWhat size of Drink would you like?\\n\" +\n \"S- Small\\n\" +\n \"M- Medium\\n\" +\n \"L- Large\\n\");\n\n String answer = input.nextLine();\n switch (answer) {\n case \"S\":\n case \"s\":\n case \"Small\":\n case \"small\":\n size=\"Small\";\n x=0;\n break;\n case \"M\":\n case \"m\":\n case \"Medium\":\n case \"medium\":\n size = \"Medium\";\n x=0;\n break;\n case \"L\":\n case \"l\":\n case \"Large\":\n case \"large\":\n size = \"Large\";\n x=0;\n break;\n default:\n System.out.println(\"invalid choice\");\n x++;\n break;\n }\n } while (x>0);\n\n do {\n System.out.print(\"\\nWhat soda do you prefer?\\n\" +\n \"S- Sprite\\n\" +\n \"R- Rootbeer\\n\" +\n \"F- Orange Fanta\\n\");\n\n String answer = input.nextLine();\n switch (answer) {\n case \"S\":\n case \"s\":\n case \"Sprite\":\n case \"sprite\":\n type=\"Sprite\";\n x=0;\n break;\n case \"R\":\n case \"r\":\n case \"Rootbeer\":\n case \"rootbeer\":\n type = \"Rootbeer\";\n x=0;\n break;\n case \"F\":\n case \"f\":\n case \"Fanta\":\n case \"fanta\":\n case \"Orange Fanta\":\n case \"orange fanta\":\n type = \"Orange Fanta\";\n x=0;\n break;\n default:\n System.out.println(\"invalid choice\");\n x++;\n break;\n }\n } while (x>0);\n return new Beverage(\"Drink\", size, type);\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(tooHot(75,false));\n\n\t}", "public static void main(String[] args) {\n\t\tCatalogueItem shoes = new CatalogueItem();\n\t\tshoes.setDescription(\"Nike Air Jordans\");\n\t\tshoes.setPrice(250);\n\t\tSystem.out.println(\"My shoes are \" + shoes.getDescription());\n\t\tSystem.out.println(\"they cost $\"+ shoes.getPrice());\n\t\tSystem.out.println(\"I payed $\"+shoes.calculateTax()+ \" tax\");\n\t}", "public static void main(String [] args) {\r\n\t\ttestOne(); //adds items to WH; tests getNumItems method & toString method\r\n\t\tSystem.out.print(\"\\n\");\r\n\t\ttestTwo(); //tests getItem(String) method\r\n\t\tSystem.out.print(\"\\n\");\r\n\t\ttestThree(); //test getItem(Item) method\r\n\t\tSystem.out.print(\"\\n\");\r\n\t\ttestFour(); //tests total cost method\r\n\t\tSystem.out.print(\"\\n\");\r\n\t\ttestFive(); //this will test the getRefrigeratedItems method\r\n\t\tSystem.out.print(\"\\n\"); \r\n\t\ttestSix(); //tests getTotalCostRefrigerated method\r\n\t\tSystem.out.print(\"\\n\");\r\n\t\ttestSeven(); //tests remove method\r\n\t}", "public void cheat() {\r\n\t\t\t\tnourriture += population*10;\r\n\t\t\t\tarmee += population/2;\r\n\t\t\t\tpopulation += armee*tailleArmee;\r\n\t\t\t}", "public static void pizzaStats(DeluxePizza todaysPizza[]) {\n\t\tScanner keyboard = new Scanner(System.in);\n\n\t\tboolean repeat = true;\n\t\tdo{\n\t\t\t// display menu\n\t\t\tSystem.out.print(\"\\nWhat information would you like to see?\" +\n\t\t\t\t\t\"\\n1. Cost and details of cheapest pizza\" +\n\t\t\t\t\t\"\\n2. Cost and details of most costly pizza\" +\n\t\t\t\t\t\"\\n3. Number of pizzas sold today\" +\n\t\t\t\t\t\"\\n4. Number of pizzas of a specific size\" +\n\t\t\t\t\t\"\\n5. Average cost of pizzas\" +\n\t\t\t\t\t\"\\n6. Quit\" +\n\t\t\t\t\t\"\\nPlease enter your choice: \");\n\t\t\t// take input for menu selection\n\t\t\tint menuChoice;\n\t\t\tmenuChoice = keyboard.nextInt();\n\t\t\t\n\t\t\twhile(menuChoice < 1 || menuChoice > 6)\n\t\t\t{\n\t\t\t\tSystem.out.print(\"Incorrect option, please enter your choice: \");\n\t\t\t\tmenuChoice = keyboard.nextInt();\n\t\t\t}\n\t\t\t// run desired method\n\t\t\tswitch(menuChoice)\n\t\t\t{\n\t\t\tcase 1: lowestPrice(todaysPizza); break;\n\t\t\tcase 2: highestPrice(todaysPizza); break;\n\t\t\tcase 3: \n\t\t\t\tint totalPizzas = DeluxePizza.getNumberOfPizzas();\n\t\t\t\tSystem.out.println(\"You have sold \" + totalPizzas + \" pizzas today!\");\n\t\t\t\tbreak;\n\t\t\tcase 4: numberOfPizzasOfSize(todaysPizza); break;\n\t\t\tcase 5: \n\t\t\t\tdouble totalSales = 0.00;\n\t\t\t\ttotalPizzas = DeluxePizza.getNumberOfPizzas();\n\t\t\t\tif (totalPizzas == 0)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"You have not made any pizzas today!\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tfor(DeluxePizza x:todaysPizza)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(x == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttotalSales += 0.00;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\ttotalSales += x.calcCost();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdouble averageCost = totalSales / totalPizzas;\n\t\t\t\t\tSystem.out.println(\"The average cost per pizza is $\" + averageCost + \"!\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\trepeat = false;\n\t\t\t}\n\t\t}while(repeat);\n\t\treturn;\n\t}", "private int calculatePrice(boolean cream , boolean choco) {\n //Price per one cup is $5\n int pricePerCup = 5;\n\n\n //Cream topping costs $2\n if(cream == true & pricePerCup > 0){\n pricePerCup += 1;\n }\n\n //Chocolate topping costs $3\n if(choco == true & pricePerCup > 0){\n pricePerCup += 2;\n }\n\n return quantity * pricePerCup;\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tScanner in = new Scanner(System.in);\r\n\t\tSystem.out.println(\"How many libraries you bought?\");\r\n\t\tint sales = in.nextInt();\r\n\t\tswitch(sales){\r\n\t\tcase 6: System.out.println(\"You Won $1000\");\r\n\t\tcase 5: System.out.println(\"You Won A Motorcycle\");\r\n\t\tcase 4: System.out.println(\"You won A Smart Phone\");\r\n\t\tcase 3: System.out.println(\"You Won A Nintendo\");\r\n\t\tcase 2: System.out.println(\"You Won A Car\");\r\n\t\tcase 1: System.out.println(\"You won A watch\");\r\n\t\tbreak;\r\n\t\tdefault: System.out.println(\"no Price\");\r\n\r\n\t}\r\n\t}", "public static void main(String[] args) throws IOException\n {\n boolean metric = false;\n double[] gravity = new double[8];\n double[] weightOnPlanets = new double[8];\n double weight = 0.0;\n String[] names = {\"Mercury\", \"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\", \"Neptune\"};\n String input = \"\";\n \n \n Scanner in = new Scanner(System.in);\n \n \n //INPUT AND DATA MANIPULATIONS\n System.out.print(\"Please enter your weight on Earth: \");\n weight = in.nextDouble();\n System.out.print(\"Is your weight in kilograms [Y/N]: \");\n input = in.next();\n \n //Since metric is already false, I don't need an else statement here\n if(input.substring(0,1).equalsIgnoreCase(\"Y\"))\n {\n metric = true;\n }\n \n gravity = getGravity(gravity);\n weightOnPlanets = weightOnPlanets(weightOnPlanets, metric, gravity, weight);\n output(gravity, metric, weightOnPlanets, names);\n }", "public static void main(String[] args) {\n Addition onion = new Addition(\"Onion\", 1.5);\n Addition potato = new Addition(\"Potato\", 1.5);\n Addition lettuce = new Addition(\"Lettuce\", 0.5);\n Addition ketchup = new Addition(\"Ketchup\", 0.5);\n Addition chips = new Addition(\"Ketchup\", 1.5);\n Addition drink = new Addition(\"Ketchup\", 1.5);\n\n System.out.println(\"---------------Basic------------------\");\n Basic basic = new Basic(\"Basic\", \"Sesame\", \"Beaf\", 12.00,\n onion, potato, lettuce);\n System.out.println(basic.getName() + \" with \" + basic.getBreadRoll() + \" - Total \" + basic.getTotalPrice() + \"\\n\" +\n \" Base Price \" + basic.getBasePrice() + \"$\\n\" + basic.getAdditions() + \"Additions Total \" +\n basic.getAdditionsPrice());\n\n System.out.println(\"---------------Deluxe------------------\");\n Deluxe deluxe = new Deluxe(\"Deluxe\", \"Sumac\", \"Fish\", 8.5);\n System.out.println(deluxe.getName() + \" with \" + deluxe.getBreadRoll() + \"- Total \" + deluxe.getTotalPrice() + \"\\n\" +\n \" Base Price \" + deluxe.getBasePrice() + \"$\\n\" + deluxe.getAdditions()+ \"Additions Total \" +\n deluxe.getAdditionsPrice());\n\n System.out.println(\"---------------Healthy------------------\");\n Healthy healthy = new Healthy(\"Healthy\", \"Chicken\", 10.0, lettuce, onion);\n System.out.println(healthy.getName() + \" with \" + healthy.getBreadRoll() + \"- Total \" + healthy.getTotalPrice() + \"\\n\" +\n \" Base Price \" + healthy.getBasePrice() + \"$\\n\" + healthy.getAdditions()+ \"Additions Total \" +\n healthy.getAdditionsPrice());\n }", "public static void main(String[] args) {\n\t\ttry\n\t\t{\n\t\t\tObjectInputStream input = new ObjectInputStream(new FileInputStream(\"Cones.txt\"));\n\t\t\tAdvancedIceCreamCone vanilla = (AdvancedIceCreamCone)input.readObject();\n\t\t\tAdvancedIceCreamCone chocolate = (AdvancedIceCreamCone) input.readObject();\n\t\t\tAdvancedIceCreamCone strawberry = (AdvancedIceCreamCone) input.readObject();\n\t\t\tSystem.out.println(\"Choose a flavor (VANILLA, CHOCOLATE, STRAWBERRY\");\n\t\t\tScanner user = new Scanner(System.in);\n\t\t\tString Choice = user.nextLine();\n\t\t\tswitch(Choice.toUpperCase())\n\t\t\t{\n\t\t\t\tcase \"VANILLA\":\n\t\t\t\t\tSystem.out.println(\"Your choice was: \" + Choice);\n\t\t\t\t\tSystem.out.println(vanilla.toString());\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"CHOCOLATE\":\n\t\t\t\t\tSystem.out.println(\"Your choice was: \" + Choice);\n\t\t\t\t\tSystem.out.println(chocolate.toString());\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"STRAWBERRY\":\n\t\t\t\t\tSystem.out.println(\"Your choice was: \" + Choice);\n\t\t\t\t\tSystem.out.println(strawberry.toString());\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tcatch(FileNotFoundException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcatch(ClassNotFoundException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\t\n\t\t}\n\n\t}", "public static void main(String[] args) {\n\n\t\tint temparature = 45;\n\t\tString sunCondition = \"Overcast\";\n\n\t\tif (temparature > 80) {\n\t\t\tSystem.out.println(\"Its pleasent, wear shorts and T-shirts.\");\n\t\t} else if ((temparature > 60) && (sunCondition == \"Sunny\")) {\n\t\t\tSystem.out.println(\"Its a little coolder. Perhaps wear a long sleeve and jenas.\");\n\t\t\tSystem.out.println(\"Also bring a hat if you hate the sun on your face.\");\n\n\t\t}else if ((temparature >50) || (sunCondition == \"Overcast\")){\n\t\t\tSystem.out.println(\"This is a cooler day, make sure to wear a warm clothes.\");\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"Looks like a cool day bring a sweater.\");\n\n\t\t}\n\t\tSystem.out.println(\"the program is ending.......!!\");\n\t}", "@Test\n\tpublic void testInventoryNotEnoughChocolate() {\n\t\tcoffeeMaker.addRecipe(recipe5);\n\t\tassertEquals(1000, coffeeMaker.makeCoffee(0, 1000));\n\t}", "public static void app(HashMap<String, Integer> database) {\n //How much is the fish?\n System.out.println(\"Price of fish: \" + database.get(\"Fish\"));\n //What is the most expensive product?\n //What is the average price?\n //How many products' price is below 300?\n int expensive = 0;\n String expensiveKey = \"\";\n int sum = 0;\n int cnt300 = 0;\n for (String key : database.keySet()) {\n if (database.get(key) > expensive) {\n expensive = database.get(key);\n expensiveKey = key;\n }\n sum += database.get(key);\n if (database.get(key) < 300) {\n cnt300++;\n }\n\n }\n String cheapestKey = expensiveKey;\n int cheapest = expensive;\n for (String key : database.keySet()) {\n if (database.get(key) < cheapest) {\n cheapest = database.get(key);\n cheapestKey = key;\n }\n }\n System.out.println(\"most expensive product: \" + expensiveKey);\n System.out.println(\"Average price: \" + sum / database.size());\n System.out.println(\"#products' price below 300: \" + cnt300);\n System.out\n .println(\"Is there anything we can buy for exactly 125? \" + database.containsValue(125));\n System.out.println(\"cheapest product? \" + cheapestKey);\n\n }", "public static void main( String[ ] args ) throws FileNotFoundException\r\n\t{\n\t\tKeyboard[] keyboards = inputFromFile();\r\n\t\t//int index = findPlace(keyboards);\r\n\t\t//System.out.println ( \"\" + index );\r\n\t\t//addMoreKeyboards ( keyboards, index );\r\n\t\tshowMenu(keyboards);\r\n\t\tchar anotherItem = 'y';\r\n\t\tint totalMissed = 0;\r\n\t\tdouble totalCost=0.0;\r\n\t\tint quantity=0;\r\n\t\tdo\r\n\t\t{\r\n\t\t\t\r\n\t\t\tSystem.out.print ( \"What would you like to buy? Please type in the listing number: \" );\r\n\r\n\t\t\tint item = input.nextInt ( );\r\n\t\t\tcart.add ( keyboards[item - 1] );\r\n\t\t\tint maxBuy = keyboards[item - 1].getStock ( );\r\n\t\t\tSystem.out.printf ( \"Sweet! How many are you buying?\\nWe have %s in stock.\",maxBuy );\r\n\t\t\tquantity = input.nextInt ( );\r\n\t\t\tint missedBuy = 0;\r\n\t\t\twhile ( quantity > maxBuy )/*NEED TO FIX: Currently it will replace \r\n\t\t\t\t\t\t\t\t\t\t\t\tthe quantity from the first keyboard chosen to the quantity \r\n\t\t\t\t\t\t\t\t\t\t\t\tof the second keyboard chosen and so on.\r\n\t\t\t\t\t\t\t\t\t\t\t\t*/\r\n\t\t\t{\r\n\t\t\t\tmissedBuy = 0;\r\n\t\t\t\tSystem.out.printf ( \"We only have %s in stock! Please enter a new quantity.\", maxBuy );\r\n\t\t\t\tquantity = input.nextInt ( );\r\n\t\t\t\tmissedBuy = quantity - maxBuy;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\ttotalMissed += missedBuy;\r\n\r\n\t\t\tkeyboards[item - 1].setStock ( maxBuy-quantity );\r\n\t\t\ttotalCost += keyboards[item - 1].getPrice()*quantity;\r\n\t\t\tfor(int i=0;i<cart.size();i++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.printf ( \"\\nYou chose %s %s's \\nThe price per keyboard was %s\",quantity,( (LinkedList<Keyboard>) cart ).get(i).getBrand() , ( (LinkedList<Keyboard>) cart ).get(i).getPrice() );\r\n\t\t\t}\r\n\t\t\tSystem.out.println ( \"\\nDo you have another item? y/n\" );\r\n\t\t\tanotherItem = input.next ( ).toLowerCase().charAt(0);\r\n\t\t\t//old code commented out 22APR19Marco\r\n\t\t\t/*\r\n\t\t\t Cart[] itemsAtCheckout = new Cart[20];\r\n\t\t\t itemsAtCheckout[0] = new Cart(1, keyboards[item-1]);\r\n\t\t\t System.out.printf ( \"You owe $%.2f.\", itemsAtCheckout[0].getPrice ( ) );\r\n\t\t\t*/\r\n\t\t} while ( anotherItem == 'y' );\r\n\t\t\r\n\t\tSystem.out.printf ( \"The total was \", totalCost );\r\n\t\t/* Notes:\r\n\t\t * - Need to have conditional statements for when we would sell something with no stock\r\n\t\t * possibly have a \"we don't have that many\" printout for a quantity that exceeds stock -- Done on 22APR19MARCO\r\n\t\t * \r\n\t\t * - Must return checkout price (Cart.getPrice()) -- Done on 22APR19MARCO\r\n\t\t */\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\tPizza pizza = new Pizza();\r\n\t\tSystem.out.println(\"Order a pizza\\n\");\r\n\t\tSystem.out.println(pizza.getDescription());\r\n\t\tSystem.out.println(\"Changing my order\\n\");\r\n\t\tpizza.setSize(PizzaSize.large); \r\n\t\tpizza.setPepTops(4); \r\n\t\tpizza.setBeefTops(1);\r\n\t\tpizza.setCheeseTops(2);\r\n\t\tSystem.out.println(pizza.getDescription());\r\n\t\tSystem.out.println(\"Order a special pizza\"); \r\n\t\tSpecialPizza specialPizza = new SpecialPizza();\r\n\t\tspecialPizza.setSize(PizzaSize.small);\r\n\t\tspecialPizza.setCheeseTops(3);\r\n\t\tspecialPizza.setBeefTops(4);\r\n\t\tspecialPizza.setPepTops(1); \r\n\t\tSystem.out.println(specialPizza.bellsAndWhistles());\r\n\t}", "public int doMostFavourAction() {\n if (this.eatable > this.playable && this.eatable > this.ignorable) {\n this.raiseEatable(1.1, 0.9);\n return 0;\n } else if (this.playable > this.eatable && this.playable > this.ignorable) {\n this.raisePlayable(1.1, 0.9);\n return 1;\n } else if (this.ignorable > this.eatable && this.ignorable > this.playable) {\n this.raiseIgnorable(1.1, 0.9);\n return 2;\n } else {\n int random = (int) (Math.random()*3);\n if (random == 0) {\n this.raiseEatable(1.1, 0.9);\n } else if (random == 1) {\n this.raisePlayable(1.1, 0.9);\n } else {\n this.raiseIgnorable(1.1, 0.9);\n }\n return random;\n }\n }" ]
[ "0.6485694", "0.6451163", "0.64010286", "0.63029385", "0.6254628", "0.6179423", "0.61751825", "0.61399865", "0.61344165", "0.6128308", "0.611001", "0.60971487", "0.60914433", "0.6083961", "0.6082287", "0.6082065", "0.6051556", "0.6038935", "0.6038159", "0.6033238", "0.6026358", "0.6009828", "0.6006896", "0.5995047", "0.59866774", "0.59858465", "0.59836113", "0.59775037", "0.59680897", "0.59672904", "0.59606004", "0.59497035", "0.59371156", "0.5935872", "0.59245056", "0.5917167", "0.59011847", "0.5896538", "0.5893092", "0.5890645", "0.58870983", "0.5886449", "0.58753735", "0.58714885", "0.58701634", "0.58512694", "0.5851183", "0.58501816", "0.58438116", "0.58384305", "0.58375156", "0.58368886", "0.5832929", "0.58224463", "0.58217824", "0.58213425", "0.5821333", "0.58176637", "0.58171606", "0.58152664", "0.5813696", "0.57928866", "0.57885134", "0.578454", "0.5784222", "0.578294", "0.5782592", "0.5774609", "0.57738173", "0.57726693", "0.57685196", "0.57667613", "0.57642084", "0.5762617", "0.57605225", "0.57587326", "0.57517457", "0.57496125", "0.5736539", "0.5734666", "0.5733658", "0.57319784", "0.5729843", "0.572792", "0.5722738", "0.57220453", "0.57218665", "0.5718271", "0.5714205", "0.5706917", "0.5701793", "0.5699745", "0.5697107", "0.5695476", "0.569455", "0.56937754", "0.5693735", "0.5691858", "0.5691664", "0.56897587", "0.56891054" ]
0.0
-1
The methods reallocate food into the storage depending the shelf life of product.
private AbstractStorageOfFoods reallocateFood(Food food, Date currentDate) { AbstractStorageOfFoods result = null; for (AbstractStorageOfFoods storage : storages) { if (storage != null && storage.isAppropriate(food, currentDate)) { storage.add(food); result = storage; break; } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void Restock() {\n for (Ingredient ingredient : stock.keySet()) {\n stock.put(ingredient, inventoryMax);\n }\n }", "private void reallocate(){\n capacity = 2 * capacity;\n theData = Arrays.copyOf(theData, capacity);\n }", "public static void gained() {\n\t\tPig.alterStorage(true);\n\t}", "private void saveFood() {\n float w = Float.parseFloat(food.getDataSet().getValue(food.getMealTitle(), \"weight\"));\n float factor = Float.parseFloat(Integer.toString(quantitySeekbar.getProgress())) / w;\n\n food.setFactor(factor);\n\n LocalStorage localStorage = new LocalStorage(LocalStorage.STORAGE_KEY);\n\n ArrayList<Food> foods = (ArrayList<Food>) localStorage.retrieveObject(Constants.FOOD_ARRAYLIST_CACHE);\n\n if (foods == null) {\n foods = new ArrayList<>();\n }\n\n foods.add(food);\n\n localStorage.serializeAndStore(Constants.FOOD_ARRAYLIST_CACHE, foods);\n ((MainActivity) getActivity()).resetFragments();\n }", "public void reallocateBuckets() { }", "private void consumeResources(){\n\n Main.gang.setFood(Main.gang.getFood() - (Main.gang.getGangMembers().size() * Main.gang.getFoodIntake()));\n Main.gang.setWater(Main.gang.getWater() - (Main.gang.getGangMembers().size() * Main.gang.getFoodIntake()));\n }", "public void reload() {\n\t\tammo = AMMO_CAPACITY;\n\t}", "public AbstractStorageOfFoods control(Food food, Date currentDate) {\n AbstractStorageOfFoods result = this.reallocateFood(food, currentDate);\n this.lowPrice(food, currentDate);\n return result;\n }", "private void resizeInternal(int size) {\n // save effort if the size did not change\n if (size == this.inventory.size()) {\n return;\n }\n ItemStackList newInventory = ItemStackList.withSize(size);\n\n for (int i = 0; i < size && i < this.inventory.size(); i++) {\n newInventory.set(i, this.inventory.get(i));\n }\n this.inventory = newInventory;\n }", "protected void dropFood() {\r\n\t\tthis.food++;\r\n\t}", "protected void pickupFood() {\r\n\t\tif(this.food > 0){\r\n\t\t\tthis.food--;\r\n\t\t}\r\n\t}", "public void upgradeCapacity()\r\n\t{\r\n\t\tcapacity++;\r\n\t}", "private void reallocate() {\n capacity = 2 * capacity;\n ElementType[] newData = (ElementType[]) new Object[DEFAULT_INIT_LENGTH];\n System.arraycopy(elements, 0, newData, 0, size);\n elements = newData;\n }", "private void ensureCapacity() {\r\n\t\t\tdouble loadFactor = getLoadFactor();\r\n\r\n\t\t\tif (loadFactor >= CAPACITY_THRESHOLD)\r\n\t\t\t\trehash();\r\n\t\t}", "private void grow(){\n\t\tberries.replaceAll((p, v) -> v + 1);\n\t\tapples.replaceAll((p, v) -> v + 1);\n\t}", "public Storage(int capacity) {\n this.foods = new Food[capacity];\n buffer = new StringBuffer();\n }", "private void resize(int capacity) {\n TypeHere[] a = (TypeHere[]) new Object[capacity];\n System.arraycopy(items, 0, a, 0, size);\n items = a;\n }", "private void resize(long capacity) {\n if ((noresize == true || m >= MAXTABLESIZE) && capacity != M) return;\n CuckooHashST<Key,Value> tmp;\n if (NT != NUMBEROFTABLES) tmp = new CuckooHashST<Key,Value>(capacity, NT);\n else tmp = new CuckooHashST<Key,Value>(capacity);\n for (int i = 0; i < entries.length; i++)\n for (int j = 0; j < entries[i].length; j++)\n if (entries[i][j] != null && entries[i][j]._1 != null && entries[i][j]._2 != null)\n tmp.put(entries[i][j]._1, entries[i][j]._2);\n entries = tmp.entries;\n m = tmp.m;\n M = tmp.M;\n N = tmp.N;\n ha = tmp.ha;\n na = tmp.na;\n }", "public static void alterStorage (boolean status) {\n\t\tif (status) {\n\t\t\tnbrOfHouses+=1;\n\t\t}\n\t\telse {\n\t\t\tnbrOfHouses-=1;\n\t\t}\n\t}", "WorkitemContext reallocate(String namespace, String wid) throws Exception;", "private void enlargeCapacity() {\n Object[] tmp = this.container;\n this.container = new Object[this.container.length + this.capacity];\n System.arraycopy(tmp, 0, this.container, 0, tmp.length);\n }", "private void resize(int newCapacity) {\n\n E[] temp = (E[]) new Object[newCapacity];\n for(int i = 0; i < size(); i++)\n temp[i] = data[calculate(i)];\n data = temp;\n head = 0;\n tail = size()-1;\n\n\n }", "public static void lost() {\n\t\tPig.alterStorage(false);\n\t}", "private void reallocateIfOverfilled() {\r\n\t\tif ((size * 1.0 / table.length) > MAX_FULLNESS_PERCENTAGE) {\r\n\t\t\treallocateArray();\r\n\t\t}\r\n\t}", "private void loadStartingInventory(){\n this.shelfList = floor.getShelf();\n Iterator<String> i = items.iterator();\n for (Shelf s : shelfList){\n while (s.hasFreeSpace()){\n s.addItem(i.next(), 1);\n }\n }\n }", "private void reallocate() {\n\t\tthis.capacity *= 2;\n\t\tObject[] newElements = new Object[this.capacity];\n\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tnewElements[i] = this.elements[i];\n\t\t}\n\n\t\tthis.elements = newElements;\n\t}", "public void charge() {\r\n capacity = Math.min(capacity += originalCapacity, originalCapacity);\r\n }", "private void resize() {\r\n capacity = capacity*2;\r\n IDictionary<K, V>[] temp = chains;\r\n chains = makeArrayOfChains(capacity);\r\n for (int i = 0; i < capacity/2; i++) {\r\n if (temp[i]!=null) {\r\n IDictionary<K, V> each = temp[i];\r\n for (KVPair<K, V> element: each) {\r\n putKV(element);\r\n load--;\r\n }\r\n }\r\n }\r\n \r\n }", "public void refill() {\n\t\tfor(int i = 0; i < chests.size(); i++)\r\n\t\t\tchests.get(i).refill();\r\n\t}", "private void increaseSize() {\r\n\t\tE[] biggerE = (E[]) new Object[this.capacity * 2];\r\n\t\tdouble[] biggerC = new double[this.capacity * 2];\r\n\t\tfor (int i = 0; i < this.size; i++) {\r\n\t\t\tbiggerE[i] = this.objectHeap[i];\r\n\t\t\tbiggerC[i] = this.costHeap[i];\r\n\t\t}\r\n\t\tthis.costHeap = biggerC;\r\n\t\tthis.objectHeap = biggerE;\r\n\t\tthis.capacity = this.capacity * 2;\r\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tprivate void increaseCapacity()\r\n\t{\r\n\t\t// Store a reference to the old table\r\n\t\tHashEntry<K, V>[] oldTable = table;\r\n\r\n\t\t// Attempt to resize the table\r\n\t\ttry\r\n\t\t{\r\n\t\t\t// Make a new table full of empty entries\r\n\t\t\ttable = new HashEntry[SIZES[++sizeIdx]];\r\n\t\t}\r\n\t\t// We have too many entries in the hash table: no more sizes left\r\n\t\tcatch (ArrayIndexOutOfBoundsException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Too many entries in hash table. Exiting.\");\r\n\t\t\tSystem.exit(4);\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i < oldTable.length; ++i)\r\n\t\t{\r\n\t\t\t// If we are at an entry with a key and value\r\n\t\t\tif (oldTable[i] != null && !oldTable[i].isTombstone)\r\n\t\t\t{\r\n\t\t\t\t// Add every value at that key to the bigger table\r\n\t\t\t\tfor (V value : oldTable[i].value)\r\n\t\t\t\t{\r\n\t\t\t\t\tinsert(oldTable[i].key, value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void ensureCapacity() {\n if ( top + 1 < storage.length ) {\n return;\n }\n storage = Arrays.copyOf( storage, storage.length * 2 );\n }", "private void resize(int capacity) {\n\n\t\tKey[] oldKeys = keys;\n\t\tValue[] oldValues = values;\n\t\tint oldCapacity = this.capacity;\n\n\t\t// Allocate the new hash table.\n\n\t\tthis.keys = (Key[]) new Object[capacity];\n\t\tthis.values = (Value[]) new Object[capacity];\n\t\tthis.capacity = capacity;\n\n\t\t// For each item in the old map, rehash and then \n\t\t// insert it into the newly allocated tables.\n\n\t\tfor (int i = 0; i < oldCapacity; i++) {\n\t\t\tKey key = oldKeys[i];\n\t\t\tValue value = oldValues[i];\n\t\t\tif (key != null) {\n\t\t\t\tint index = locate(key);\n\t\t\t\tthis.keys[index] = key;\n\t\t\t\tthis.values[index] = value;\n\t\t\t}\n\t\t}\n\t}", "private void grow() {\n Book[] temp = new Book[books.length + GROWTH_SIZE];\n for (int i = 0; i < books.length; i ++){\n temp[i] = books[i];\n }\n books = temp;\n }", "private void resize(int newSize){\n Item[] temp = (Item[]) new Object[newSize]; //newsize\n for(int i=0; i<itemCount; i++){\n temp[i] = array[i]; // fill temp with array's stuff\n }\n array = temp; // reset array to temp\n }", "private void resize() {\n if (ifFull() || ifTooEmpty()) {\n int capacity = items.length;\n if (ifFull()) {\n capacity *= 2;\n } else if (ifTooEmpty()) {\n capacity /= 2;\n }\n Item[] newArray = (Item[]) new Object[capacity];\n int lastIndex = moveBack(nextLast, 1);\n int firstIndex = moveForward(nextFirst, 1);\n System.arraycopy(items, 0, newArray, 0, lastIndex + 1);\n int numOfReminder = size - (lastIndex + 1);\n int newFirstIndex = newArray.length - numOfReminder;\n System.arraycopy(items, firstIndex, newArray, newFirstIndex, numOfReminder);\n items = newArray;\n nextFirst = moveBack(newFirstIndex, 1);\n nextLast = moveForward(lastIndex, 1);\n return;\n }\n return;\n }", "private void expandCapacity() {\n heap = Arrays.copyOf(heap, heap.length * 2);\n }", "protected void grow() {\n }", "public static void doRecycleRecipes()\n {\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.golden_helmet, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.gold_ore), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.golden_chestplate, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(Blocks.gold_ore, 2, 0), 30.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.golden_leggings, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(Blocks.gold_ore, 2, 0), 30.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.golden_boots, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.gold_ore), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.golden_sword, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.gold_ore), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.golden_shovel, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.gold_ore), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.golden_pickaxe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.gold_ore), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.golden_axe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.gold_ore), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.golden_hoe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.gold_ore), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.golden_horse_armor, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(Blocks.gold_ore, 2, 0), 30.0F);\n // extra Gold recycling\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.clock), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, 1), new ItemStack(Blocks.gold_ore), 15.0F);\n //\n // recycle your Leather\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.leather_helmet, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore), 5.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.leather_chestplate, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore, 2, 0), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.leather_leggings, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore, 2, 0), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.leather_boots, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore), 5.0F);\n //\n // recycle your Wood\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.wooden_sword, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore), 5.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.wooden_shovel, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore), 5.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.wooden_pickaxe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore), 5.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.wooden_axe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore), 5.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.wooden_hoe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore), 5.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.bow, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore), 5.0F);\n // extra Wood recycling\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.boat), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore), 5.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.bed), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore), 5.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.wooden_door), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore), 5.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.fishing_rod, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore), 3.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Blocks.bookshelf), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore, 2, 0), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Blocks.chest), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore, 2, 0), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Blocks.trapped_chest), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore, 2, 0), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Blocks.hay_block), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore, 2, 0), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Blocks.crafting_table), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore), 3.0F);\n //\n // recycle your Stone\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.stone_sword, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.stone), 5.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.stone_shovel, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.stone), 5.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.stone_pickaxe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.stone), 5.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.stone_axe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.stone), 5.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.stone_hoe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.stone), 5.0F);\n // extra Stone recycling\n FusionFurnaceRecipes.addSmelting(new ItemStack(Blocks.furnace), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(Blocks.stone, 2, 0), 10.0F);\n //\n // recycle your Iron\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.iron_helmet, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.iron_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.iron_chestplate, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(Blocks.iron_ore, 2, 0), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.iron_leggings, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(Blocks.iron_ore, 2, 0), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.iron_boots, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.iron_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.iron_sword, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.iron_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.iron_shovel, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.iron_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.iron_pickaxe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.iron_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.iron_axe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.iron_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.iron_hoe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.iron_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.iron_horse_armor, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(Blocks.iron_ore, 2, 0), 20.0F);\n // extra Iron recycling\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.chainmail_helmet, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.iron_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.chainmail_chestplate, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(Blocks.iron_ore, 2, 0), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.chainmail_leggings, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(Blocks.iron_ore, 2, 0), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.chainmail_boots, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.iron_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.bucket), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.iron_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.cauldron), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(Blocks.iron_ore, 2, 0), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.compass), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.iron_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.iron_door), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.iron_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.flint_and_steel, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.iron_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.minecart), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.iron_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.hopper_minecart), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(Blocks.iron_ore, 2, 0), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.shears, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.iron_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Blocks.anvil, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel, 4, 0), new ItemStack(Items.coal, 4, WILDCARD_VALUE), new ItemStack(Blocks.iron_ore, 4, 0), 40.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Blocks.hopper), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(Blocks.iron_ore), 10.0F);\n //\n // recycle your Diamond\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.diamond_helmet, 1, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore), new ItemStack(Items.lava_bucket), new ItemStack(Blocks.diamond_ore), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.diamond_chestplate, 1, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore, 2, 0), new ItemStack(Items.lava_bucket), new ItemStack(Blocks.diamond_ore, 2, 0), 40.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.diamond_leggings, 1, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore, 2, 0), new ItemStack(Items.lava_bucket), new ItemStack(Blocks.diamond_ore, 2, 0), 40.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.diamond_boots, 1, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore), new ItemStack(Items.lava_bucket), new ItemStack(Blocks.diamond_ore), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.diamond_sword, 1, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore), new ItemStack(Items.lava_bucket), new ItemStack(Blocks.diamond_ore), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.diamond_shovel, 1, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore), new ItemStack(Items.lava_bucket), new ItemStack(Blocks.diamond_ore), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.diamond_pickaxe, 1, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore), new ItemStack(Items.lava_bucket), new ItemStack(Blocks.diamond_ore), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.diamond_axe, 1, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore), new ItemStack(Items.lava_bucket), new ItemStack(Blocks.diamond_ore), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.diamond_hoe, 1, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore), new ItemStack(Items.lava_bucket), new ItemStack(Blocks.diamond_ore), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(Items.diamond_horse_armor, 1, WILDCARD_VALUE), new ItemStack(Blocks.coal_ore, 2, 0), new ItemStack(Items.lava_bucket), new ItemStack(Blocks.diamond_ore, 2, 0), 20.0F);\n //\n\t\tif(Loader.isModLoaded(\"simpleores\") && Settings.enableSimpleOres){\n // recycle your Copper\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.copper_helmet, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.copper_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.copper_chestplate, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(soBase.copper_ore, 2, 0), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.copper_leggings, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(soBase.copper_ore, 2, 0), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.copper_boots, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.copper_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.copper_sword, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.copper_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.copper_shovel, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.copper_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.copper_pickaxe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.copper_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.copper_axe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.copper_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.copper_hoe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.copper_ore), 10.0F);\n // extra Copper recycling\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.copper_bucket), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.copper_ore), 10.0F);\n// FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.copper_door_block), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.copper_ore), 10.0F);\n //\n // recycle your Tin\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.tin_helmet, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.tin_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.tin_chestplate, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(soBase.tin_ore, 2, 0), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.tin_leggings, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(soBase.tin_ore, 2, 0), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.tin_boots, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.tin_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.tin_sword, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.tin_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.tin_shovel, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.tin_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.tin_pickaxe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.tin_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.tin_axe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.tin_ore), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.tin_hoe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.tin_ore), 10.0F);\n // extra Tin recycling\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.tin_shears, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.tin_ore), 10.0F);\n //\n // recycle your Mythril\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.mythril_helmet, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.mythril_ore), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.mythril_chestplate, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(soBase.mythril_ore, 2, 0), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.mythril_leggings, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(soBase.mythril_ore, 2, 0), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.mythril_boots, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.mythril_ore), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.mythril_sword, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.mythril_ore), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.mythril_shovel, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.mythril_ore), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.mythril_pickaxe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.mythril_ore), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.mythril_axe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.mythril_ore), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.mythril_hoe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.mythril_ore), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.mythril_bow, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.mythril_ore), 15.0F);\n // extra Mythril recycling\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.mythril_rod), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.mythril_ore), 15.0F);\n// FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.mythril_furnace), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(soBase.mythril_ore, 2, 0), 15.0F);\n //\n // recycle your Adamantium\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.adamantium_helmet, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.adamantium_ore), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.adamantium_chestplate, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(soBase.adamantium_ore, 2, 0), 30.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.adamantium_leggings, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(soBase.adamantium_ore, 2, 0), 30.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.adamantium_boots, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.adamantium_ore), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.adamantium_sword, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.adamantium_ore), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.adamantium_shovel, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.adamantium_ore), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.adamantium_pickaxe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.adamantium_ore), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.adamantium_axe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.adamantium_ore), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.adamantium_hoe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.adamantium_ore), 15.0F);\n // extra Adamantium recycling\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.adamantium_shears, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soBase.adamantium_ore), 15.0F);\n //\n // recycle your Onyx\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.onyx_helmet, 1, WILDCARD_VALUE), new ItemStack(Blocks.netherrack), new ItemStack(Items.lava_bucket), new ItemStack(soBase.onyx_ore), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.onyx_chestplate, 1, WILDCARD_VALUE), new ItemStack(Blocks.netherrack, 2, 0), new ItemStack(Items.lava_bucket), new ItemStack(soBase.onyx_ore, 2, 0), 40.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.onyx_leggings, 1, WILDCARD_VALUE), new ItemStack(Blocks.netherrack, 2, 0), new ItemStack(Items.lava_bucket), new ItemStack(soBase.onyx_ore, 2, 0), 40.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.onyx_boots, 1, WILDCARD_VALUE), new ItemStack(Blocks.netherrack), new ItemStack(Items.lava_bucket), new ItemStack(soBase.onyx_ore), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.onyx_sword, 1, WILDCARD_VALUE), new ItemStack(Blocks.netherrack), new ItemStack(Items.lava_bucket), new ItemStack(soBase.onyx_ore), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.onyx_shovel, 1, WILDCARD_VALUE), new ItemStack(Blocks.netherrack), new ItemStack(Items.lava_bucket), new ItemStack(soBase.onyx_ore), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.onyx_pickaxe, 1, WILDCARD_VALUE), new ItemStack(Blocks.netherrack), new ItemStack(Items.lava_bucket), new ItemStack(soBase.onyx_ore), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.onyx_axe, 1, WILDCARD_VALUE), new ItemStack(Blocks.netherrack), new ItemStack(Items.lava_bucket), new ItemStack(soBase.onyx_ore), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.onyx_hoe, 1, WILDCARD_VALUE), new ItemStack(Blocks.netherrack), new ItemStack(Items.lava_bucket), new ItemStack(soBase.onyx_ore), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.onyx_bow, 1, WILDCARD_VALUE), new ItemStack(Blocks.netherrack), new ItemStack(Items.lava_bucket), new ItemStack(soBase.onyx_ore), 20.0F);\n // extra Onyx recycling\n// FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.onyx_door_block), new ItemStack(Blocks.netherrack), new ItemStack(Items.lava_bucket), new ItemStack(soBase.onyx_ore), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.onyx_rod), new ItemStack(Blocks.netherrack), new ItemStack(Items.lava_bucket), new ItemStack(soBase.onyx_ore), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.onyx_shears, 1, WILDCARD_VALUE), new ItemStack(Blocks.netherrack), new ItemStack(Items.lava_bucket), new ItemStack(soBase.onyx_ore), 20.0F);\n// FusionFurnaceRecipes.addSmelting(new ItemStack(soBase.onyx_furnace), new ItemStack(Blocks.netherrack, 2, 0), new ItemStack(Items.lava_bucket), new ItemStack(soBase.onyx_ore, 2, 0), 40.0F);\n //\n // recycle your Bronze\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.bronze_helmet, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soAlloy.large_bronze_chunk), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.bronze_chestplate, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(soAlloy.large_bronze_chunk, 2, 0), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.bronze_leggings, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.coal, 2, WILDCARD_VALUE), new ItemStack(soAlloy.large_bronze_chunk, 2, 0), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.bronze_boots, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soAlloy.large_bronze_chunk), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.bronze_sword, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soAlloy.large_bronze_chunk), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.bronze_shovel, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soAlloy.large_bronze_chunk), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.bronze_pickaxe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soAlloy.large_bronze_chunk), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.bronze_axe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soAlloy.large_bronze_chunk), 10.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.bronze_hoe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.coal, 1, WILDCARD_VALUE), new ItemStack(soAlloy.large_bronze_chunk), 10.0F);\n //\n // recycle your Thyrium\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.thyrium_helmet, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.lava_bucket), new ItemStack(soAlloy.large_thyrium_chunk), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.thyrium_chestplate, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.lava_bucket), new ItemStack(soAlloy.large_thyrium_chunk, 2, 0), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.thyrium_leggings, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel, 2, 0), new ItemStack(Items.lava_bucket), new ItemStack(soAlloy.large_thyrium_chunk, 2, 0), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.thyrium_boots, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.lava_bucket), new ItemStack(soAlloy.large_thyrium_chunk), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.thyrium_sword, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.lava_bucket), new ItemStack(soAlloy.large_thyrium_chunk), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.thyrium_shovel, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.lava_bucket), new ItemStack(soAlloy.large_thyrium_chunk), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.thyrium_pickaxe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.lava_bucket), new ItemStack(soAlloy.large_thyrium_chunk), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.thyrium_axe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.lava_bucket), new ItemStack(soAlloy.large_thyrium_chunk), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.thyrium_hoe, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.lava_bucket), new ItemStack(soAlloy.large_thyrium_chunk), 15.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.thyrium_bow, 1, WILDCARD_VALUE), new ItemStack(Blocks.gravel), new ItemStack(Items.lava_bucket), new ItemStack(soAlloy.large_thyrium_chunk), 15.0F);\n // extra Thyrium recycling\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.thyrium_rod), new ItemStack(Blocks.gravel), new ItemStack(Items.lava_bucket), new ItemStack(soAlloy.large_thyrium_chunk), 15.0F);\n //\n // recycle your Sinisite\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.sinisite_helmet, 1, WILDCARD_VALUE), new ItemStack(Blocks.netherrack), new ItemStack(Items.lava_bucket), new ItemStack(soAlloy.large_sinisite_chunk), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.sinisite_chestplate, 1, WILDCARD_VALUE), new ItemStack(Blocks.netherrack, 2, 0), new ItemStack(Items.lava_bucket), new ItemStack(soAlloy.large_sinisite_chunk, 2, 0), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.sinisite_leggings, 1, WILDCARD_VALUE), new ItemStack(Blocks.netherrack, 2, 0), new ItemStack(Items.lava_bucket), new ItemStack(soAlloy.large_sinisite_chunk, 2, 0), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.sinisite_boots, 1, WILDCARD_VALUE), new ItemStack(Blocks.netherrack), new ItemStack(Items.lava_bucket), new ItemStack(soAlloy.large_sinisite_chunk), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.sinisite_sword, 1, WILDCARD_VALUE), new ItemStack(Blocks.netherrack), new ItemStack(Items.lava_bucket), new ItemStack(soAlloy.large_sinisite_chunk), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.sinisite_shovel, 1, WILDCARD_VALUE), new ItemStack(Blocks.netherrack), new ItemStack(Items.lava_bucket), new ItemStack(soAlloy.large_sinisite_chunk), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.sinisite_pickaxe, 1, WILDCARD_VALUE), new ItemStack(Blocks.netherrack), new ItemStack(Items.lava_bucket), new ItemStack(soAlloy.large_sinisite_chunk), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.sinisite_axe, 1, WILDCARD_VALUE), new ItemStack(Blocks.netherrack), new ItemStack(Items.lava_bucket), new ItemStack(soAlloy.large_sinisite_chunk), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.sinisite_hoe, 1, WILDCARD_VALUE), new ItemStack(Blocks.netherrack), new ItemStack(Items.lava_bucket), new ItemStack(soAlloy.large_sinisite_chunk), 20.0F);\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.sinisite_bow, 1, WILDCARD_VALUE), new ItemStack(Blocks.netherrack), new ItemStack(Items.lava_bucket), new ItemStack(soAlloy.large_sinisite_chunk), 20.0F);\n // extra Sinisite recycling\n FusionFurnaceRecipes.addSmelting(new ItemStack(soAlloy.sinisite_rod), new ItemStack(Blocks.netherrack), new ItemStack(Items.lava_bucket), new ItemStack(soAlloy.large_sinisite_chunk), 20.0F);\n }}", "private void resetAvailable(Roll roll){\n\t\tStock replacementStock = new Stock(roll, inventoryLevel);\n\n\t\tint i;\n\t\tint listSize = inventory.size();\n\t\tRoll temp;\n\t\tString rollType = roll.getType();\n\t\tfor(i = 0; i < listSize; i++){\n\t\t\tif(inventory.get(i).getRoll().getType().equals(rollType)){\n\t\t\t\tinventory.set(i,replacementStock);\n\t\t\t}\n\t\t}\n\t}", "private synchronized void resize() {\n tableSize = 2 * tableSize;\n tableSize = nextPrime(tableSize);\n FlightDetails[] old = HT;\n\n HT = new FlightDetails[tableSize];\n count.set(0);\n\n for (FlightDetails oldFlightDetails : old) {\n if (oldFlightDetails != null) {\n FlightDetails flightDetails = oldFlightDetails;\n put(flightDetails);\n\n while (flightDetails.getNext() != null) {\n flightDetails = flightDetails.getNext();\n put(flightDetails);\n }\n }\n }\n }", "private void growSize() {\n size++;\n\n if (size > maxSize) {\n if (keys.length == Integer.MAX_VALUE) {\n throw new IllegalStateException(\"Max capacity reached at size=\" + size);\n }\n\n // Double the capacity.\n rehash(keys.length << 1);\n }\n }", "public abstract void grow();", "private void addNewFoodItemRefresh() {\n // create a foodItem instance with input information\n FoodItem foodItem = new FoodItem(id.getText(), name.getText());\n foodItem.addNutrient(\"calories\", Double.valueOf(calories.getText()));\n foodItem.addNutrient(\"fat\", Double.valueOf(fat.getText()));\n foodItem.addNutrient(\"carbohydrate\", Double.valueOf(carbohydrate.getText()));\n foodItem.addNutrient(\"fiber\", Double.valueOf(fiber.getText()));\n foodItem.addNutrient(\"protein\", Double.valueOf(protein.getText()));\n this.foodData.addFoodItem(foodItem);// add it to the food data to store\n this.close();// close the addfooditem stage\n this.foodList.refreshAfterAdd(foodItem);// refresh the foodList\n\n }", "void resize(int newSize);", "private void grow() {\n int oldCapacity = heap.length;\n // Double size if small; else grow by 50%\n int newCapacity = oldCapacity + ((oldCapacity < 64) ?\n (oldCapacity + 2) :\n (oldCapacity >> 1));\n Object[] newQueue = new Object[newCapacity];\n for (int i = 0; i < heap.length; i++) {\n newQueue[i] = heap[i];\n }\n heap = newQueue;\n }", "@SuppressWarnings(\"unchecked\")\n\t private boolean grow() {\n\n\t /* \n\t * Add code here \n\t * Expand capacity (double it) and copy old array contents to the\n\t * new one. \n\t */\n\t\t \n\t\t capacity = (capacity*2);\n\t\t E[] new_elements = elements;\n\t\t elements = (E[])new Object[capacity];\n\t\t for(int i=0; i<new_elements.length;i++){\n\t\t\t elements[i] = new_elements[i];\n\t\t }\n\t System.out.println(\"Capacity reached. Increasing storage...\");\n\t System.out.println(\"New capacity is \" + capacity + \" elements\");\n\n\t return true;\n\t }", "protected void resize(int capacity){\n E[] temp = (E[]) new Object[capacity];\n for (int i = 0; i < size; i++) {\n temp[i] = data[i];\n }\n data = temp;\n }", "public void changeDisk(){\n if(isFull==true) {\n if (this.type == TYPE.WHITE) {\n this.type = TYPE.BLACK;\n } else {\n type = TYPE.WHITE;\n }\n }\n return;\n }", "public void withdrawAll() {\r\n for (int i = 0; i < container.capacity(); i++) {\r\n Item item = container.get(i);\r\n if (item == null) {\r\n continue;\r\n }\r\n int amount = owner.getInventory().getMaximumAdd(item);\r\n if (item.getCount() > amount) {\r\n item = new Item(item.getId(), amount);\r\n container.remove(item, false);\r\n owner.getInventory().add(item, false);\r\n } else {\r\n container.replace(null, i, false);\r\n owner.getInventory().add(item, false);\r\n }\r\n }\r\n container.update();\r\n owner.getInventory().update();\r\n }", "public void vaciar(){\n\t\tingredientes.clear();\n\t}", "private void resize(int newCapacity){\n ArrayList<ArrayList<Entry>> newBuckets = new ArrayList<>();\n for (int i = 0; i < newCapacity; i++) {\n newBuckets.add(new ArrayList<>());\n }\n\n for(K key:this){\n int newIndex=reduce(key,newCapacity);\n newBuckets.get(newIndex).add(new Entry(key,get(key)));\n\n }\n\n buckets=newBuckets;\n numBuckets=newCapacity;\n\n }", "public void resize(int newSize) {\n\t\tE[] newData = (E[]) new Object[newSize];\n\t\t// copy the data\n\t\tint copySize = size;\n\t\tif (newSize < size)\n\t\t\tcopySize = newSize;\n\t\tfor (int i = 0; i < copySize; i++)\n\t\t\tnewData[i] = data[i];\n\t\t// replace the storage with the new array\n\t\tdata = newData;\n\t\tsize = newSize;\n\t}", "public void reload()\n\t{\n\t\tammo = maxAmmo;\n\t}", "private void checkAndModifySize() {\r\n if (size == data.length * LOAD_FACTOR) {\r\n resizeAndTransfer();\r\n }\r\n }", "public void reallocate()\r\n\t{\r\n\t\tE[] newArray = (E[]) new Object[capacity * 2];\r\n\t\tint i = 0;\r\n\t\tfor(i = 0; i < this.size(); i++)\r\n\t\t{\r\n\t\t\tnewArray[i] = innerArray[(front + i) % capacity];\r\n\t\t\tSystem.out.println((front + i) % capacity);\r\n\t\t}\r\n\t\tfront = 0;\r\n\t\trear = this.size() - 1;\r\n\t\tcapacity = capacity * 2;\r\n\t\tinnerArray = newArray;\r\n\t}", "private void grow() {\n int growSize = size + (size<<1);\n array = Arrays.copyOf(array, growSize);\n }", "private void resize(int campacity) {\n Item[] a = (Item[]) new Object[campacity];\n System.arraycopy(items,0,a,0,size);\n items = a;\n }", "@Test\n public void foodDeletedGoesAway() throws Exception {\n createFood();\n // locate the food item\n\n // delete the food item\n\n // check that food item no longer locatable\n\n }", "public void addFood(RecyclableFood recyclableFood) {\n boolean recycle = false;\n for (StorageExtended storage: extendedList) {\n if (storage.match(recyclableFood)) {\n storage.addFood(recyclableFood);\n recycle = true;\n break;\n }\n }\n if (!recycle) {\n super.sort(recyclableFood.getFood());\n }\n }", "private void maybeResize() {\n\t\tif ( this.size <= this.table.length / 2) return;\r\n\t\t\r\n\t\t//store the current entries\r\n\t\tList<Entry<K,V>> temp = new ArrayList<>();\r\n\t\tfor (Entry<K,V> entry : this.entrySet())\r\n\t\t\ttemp.add(temp.size(), entry);\r\n\t\t\r\n\t\t//create new table\r\n\t\tthis.createTable(this.table.length * 2);\r\n\t\t\r\n\t\t//reinsert the old entries (since the capacity has changed, indices will be different)\r\n\t\tfor (Entry<K,V> entry : temp ) \r\n\t\t\tthis.put(entry.getKey(), entry.getValue());\r\n\t\t\r\n\t}", "public void purge() {\n/*\nudanax-top.st:16722:FakePacker methodsFor: 'transactions'!\n{void} purge\n\t\"Flush everything out to disk and remove all purgeable imaged\n\t objects from memory. This doesn't clear the ShepherdMap table. \n\t This will have to be a weak table, and then the destruction of a \n\t shepherd or shepherdStub should remove it from myShepherdMap.\"!\n*/\n}", "public void recycle();", "@Test\n public void setAndThenDeleteStorageAndSelfDestruct() {\n byte[] txDataMethodArguments = ABIUtil.encodeMethodArguments(\"putStorage\");\n AvmRule.ResultWrapper resultWrapper = avmRule.call(from, dappAddr, BigInteger.ZERO, txDataMethodArguments, energyLimit, energyPrice);\n Assert.assertTrue(resultWrapper.getReceiptStatus().isSuccess());\n\n txDataMethodArguments = ABIUtil.encodeMethodArguments(\"resetStorageSelfDestruct\");\n resultWrapper = avmRule.call(from, dappAddr, BigInteger.ZERO, txDataMethodArguments, energyLimit, energyPrice);\n Assert.assertTrue(resultWrapper.getReceiptStatus().isSuccess());\n Assert.assertEquals(65168 - 65168 / 2, energyLimit - resultWrapper.getTransactionResult().getEnergyRemaining());\n }", "public void updateUsedStorage(long consumedStorage) {\n this.usedStorage = consumedStorage;\n }", "@SuppressWarnings(\"unchecked\")\n\tprivate void resize(int newSize){\n\t\tif(newSize > max){\n\t\t\tnewSize = max;\n\t\t}\n\t\tT[] newData = (T[])new Object[newSize];\n\t\tfor(int i = 0; i < size; i++){\n\t\t\tnewData[i] = data[i];\n\t\t}\n\t\tdata = newData;\n\t}", "public void refillLife(){\r\n\t\tthis.life = totalLife;\r\n\t}", "public void resupply()\n {\n fuel = model.maxFuel;\n ammo = model.maxAmmo;\n }", "private void resize() {\n if ((double) size / buckets.length > LOADFACTOR) {\n HashTableChained newTable = new HashTableChained(2 * buckets.length);\n for (int i = 0; i < buckets.length; i++) {\n SListNode current = (SListNode) buckets[i].front();\n try {\n while (current.isValidNode()) {\n Entry entry = (Entry) current.item();\n newTable.insert(entry.key(), entry.value());\n current = (SListNode) current.next();\n }\n } catch(InvalidNodeException e1) {\n System.err.println(\"Tried to use invalid node.\");\n }\n }\n buckets = newTable.buckets;\n largePrime = newTable.largePrime;\n }\n }", "@SuppressWarnings(\"unchecked\")\n private void resize() {\n int newCap = Math.max(capacity*2, DEFAULT_CAP);\n if(size < list.length) return;\n \n Object[] temp = new Object[newCap];\n for(int i = 0; i < list.length; i++) {\n temp[i] = list[i];\n }\n list = (E[])temp;\n capacity = newCap;\n }", "private void ensureCapacity() {\n if(size() >= (0.75 * data.length)) // size() == curSize\n resize(2 * size());\n }", "private void resize(int capacity) {\n// assert capacity >= N;\n// StdOut.println(\"resize capacity:\"+ capacity);\n// StdOut.println(\"resize count:\"+ count);\n \n Item[] temp = (Item[]) new Object[capacity];\n int index = 0;\n for (int i = 0; i < N; i++) {\n if (randomizedQueue[i] != null){\n// StdOut.println(\"resize index :\"+ index);\n// StdOut.println(\"resize i :\"+ i);\n// StdOut.println(\"resize N :\"+ N);\n// StdOut.println(\"resize randomizedQueue[i] :\"+ randomizedQueue[i]);\n// StdOut.println(\"--------------------------------------------------\");\n temp[index] = randomizedQueue[i];\n index++;\n }\n }\n randomizedQueue = temp;\n }", "private void ensureCapacity(int newCapacity) {\n\t\t\t data = Arrays.copyOf(data, newCapacity * 2);\n\t\t\t this.capacity = newCapacity * 2;\n\t\t }", "public void refuel() {\n fuelAmount = type.fuelCapacity;\n }", "@Test\n public void removing_item_from_menu_should_decrease_menu_size_by_1() throws itemNotFoundException {\n\n int initialMenuSize = restaurant.getMenu().size();\n restaurant.removeFromMenu(\"Vegetable lasagne\");\n assertEquals(initialMenuSize-1,restaurant.getMenu().size());\n }", "private void grow() {\n capacity *= 2;\n Object[] temp = new Object[capacity];\n for (int i = 0; i < values.length; i++) temp[i] = values[i];\n values = temp;\n }", "@Override\n\tpublic void recycle()\n\t{\n\t}", "@SuppressWarnings(\"unchecked\")\n private void resize() {\n // Create a temporary array of the old capacity of the heap and store all of the heaps\n // elements in it\n int size = heap.length;\n T[] temp = (T[]) new Comparable[size];\n System.arraycopy(heap, 0, temp, 0, size);\n\n // Double the capacity of the heap array and copy the values of the temp array back into\n // the heap\n heap = (T[]) new Comparable[size * DOUBLE];\n System.arraycopy(temp, 0, heap, 0, size);\n }", "public void removeOrder(){\n foods.clear();\n price = 0;\n }", "public void growSnake() {\n grow = true;\n }", "@Test\r\n public void testResetInventory2()\r\n {\r\n testLongTermStorage.addItem(item2, testLongTermStorage.getCapacity() / item2.getVolume());\r\n testLongTermStorage.resetInventory();\r\n assertEquals(\"Storage should be empty\", new HashMap<>(), testLongTermStorage.getInventory());\r\n }", "@Test\n\tpublic void test() {\n\t\tCollection<Storage> storage = new ArrayList<Storage>();\n\t\tstorage.add(new Memory(2048));\n\n\t\t// create a list of disks to build a RAID array\n\t\tList<Disk> disks = new ArrayList<Disk>();\n\t\tdisks.add(new SSD(1, 1, 1));\n\t\tdisks.add(new SSD(1, 1, 1));\n\t\t\n\t\t// add the new RAID array to the storage collection\n\t\tstorage.add(new RAID(disks));\n\n\t\t// build the laptop using the storage\n\t\tLaptop laptop = new Laptop(\"Apple\", \"Intel\", storage);\n\t\tlaptop.setOpen(true);\n\n\t\t// install some applications!\n\t\tlaptop.installApplication(\"eclipse\");\n\t\tlaptop.installApplication(\"chrome\");\n\n\t\tLaptopBag bag = new LaptopBag(\"Mission Workshop\", 10.0, Color.getRandomColor());\n\t\tSystem.out.println(totalStorageCapacity(laptop));\n\t}", "private void resize(int capacity) {\r\n assert capacity >= n;\r\n Item[] temp = (Item[]) new Object[capacity];\r\n for (int i = 0; i < n; i++) {\r\n temp[i] = list[(first + i) % list.length];\r\n }\r\n list = temp;\r\n first = 0;prior=list.length-1;\r\n last = n-1;latter=n;}", "@Test\n public void remove_restaurant_should_reduce_list_of_restaurants_size_by_1() throws restaurantNotFoundException {\n LocalTime openingTime = LocalTime.parse(\"10:30:00\");\n LocalTime closingTime = LocalTime.parse(\"22:00:00\");\n restaurant = service.addRestaurant(\"Amelie's cafe\",\"Chennai\",openingTime,closingTime);\n restaurant.addToMenu(\"Sweet corn soup\",119);\n restaurant.addToMenu(\"Vegetable lasagne\", 269);\n\n int initialNumberOfRestaurants = service.getRestaurants().size();\n service.removeRestaurant(\"Amelie's cafe\");\n assertEquals(initialNumberOfRestaurants-1, service.getRestaurants().size());\n }", "private void resize(int capacity) {// O(N)\r\n\t\tthis.capacity=capacity;\r\n\t\tE[] temp=(E[])list;\t//temporary list that stores old array\r\n\t\t//array of new required length initialized\r\n\t\tlist=new Object[this.capacity];\r\n\t\t//loop executes until all elements are copied from temp to list array\r\n\t\tfor (int i=0;i<size;i++) {\r\n\t\t\tlist[i]=temp[i];\r\n\t\t}\r\n\t}", "@Test\n public void removing_item_from_menu_should_decrease_menu_size_by_1() throws itemNotFoundException_Failure_Scenario {\n\n int initialMenuSize = restaurant.getMenu().size();\n restaurant.removeFromMenu(\"Vegetable lasagne\");\n assertEquals(initialMenuSize+1,restaurant.getMenu().size());\n System.out.println(\"Will Add instead of removal\");\n }", "private void resize(int capacity) {\n assert capacity >= n;\n\n Item[] temp = (Item[]) new Object[capacity];\n for (int i = 0; i < n; i++) {\n temp[i] = a[i];\n }\n a = temp;\n }", "private void reallocateDoubleCapacity() {\n\t\tObject oldElements[] = elements;\n\t\tcapacity *= reallocateFactor;\n\t\tsize = 0;\n\t\telements = new Object[capacity];\n\n\t\tfor (Object object : oldElements) {\n\t\t\tthis.add(object);\n\t\t}\n\t}", "public void reset() {\n itemCount = 0;\n stock = new VendItem[maxItems];\n totalMoney = 0;\n userMoney = 0;\n vmStatus = null;\n }", "private void grow() {\n Account[] replaceAccounts = new Account[this.accounts.length + 5];\n System.arraycopy(this.accounts, 0, replaceAccounts, 0, this.accounts.length);\n this.accounts = replaceAccounts;\n }", "private void rehashing(boolean increase){\r\n int newLength;\r\n // if loadFactor is too big. //\r\n if (increase){\r\n newLength = capacity()*CAPACITY_CHANGE;\r\n }\r\n // if loadFactor is too small. //\r\n else{newLength = capacity()/CAPACITY_CHANGE;}\r\n // builds the new hashSet with the new capacity. //\r\n ClosedHashCell[] newHashSet = new ClosedHashCell[newLength];\r\n buildHashSet(newLength, newHashSet);\r\n for (ClosedHashCell cell : hashSet){\r\n if (cell.getValue() != null) {\r\n int j = 0;\r\n int clamping = (cell.getValue().hashCode() + (j+j*j) / 2) & (newLength - 1);\r\n while (!newHashSet[clamping].addMe(cell.getValue())) {\r\n j++;\r\n clamping = (cell.getValue().hashCode() + (j+j*j) / 2) & (newLength - 1);\r\n }\r\n }\r\n }\r\n hashSet = newHashSet;\r\n }", "protected abstract void clearRuntimeFactStorage();", "private void actualizarEnemigosItems() {\n if(estadoMapa== EstadoMapa.RURAL || estadoMapa== EstadoMapa.RURALURBANO ){\n moverCamionetas();\n moverAves();\n }\n if(estadoMapa== EstadoMapa.URBANO || estadoMapa == EstadoMapa.URBANOUNIVERSIDAD){\n moverCarroLujo();\n moverAves();\n }\n if(estadoMapa== EstadoMapa.UNIVERSIDAD){\n moverCarritoGolf();\n moverAves();\n }\n if (estadoMapa == EstadoMapa.SALONES){\n moverLamparas();\n moverSillas();\n }\n actualizaPuntuacion();\n moverTareas();\n moverItemCorazon();\n verificarColisiones();\n verificarMuerte();\n moverItemRayo();\n /*\n IMPLEMENTAR\n\n //moverPajaro();\n //etc\n */\n }", "public void itemsSold() {\n quanitySnacks--;\n }", "private void remplirFabricantData() {\n\t}", "private void refreshStock(){\n storeStock = sysMgr.getStock(sysMgr.getLoginId());\n ArrayList<Stock> nonEmpty = new ArrayList<>();\n for(Stock i : storeStock)\n if(i.getQuantity() != 0)\n nonEmpty.add(i);\n storeStock = nonEmpty;\n }", "private void resize(int capacity)\r\n {\r\n assert capacity >= n;\r\n Item[] temp = (Item[]) new Object[capacity];\r\n for (int i = 0; i < n; i++)\r\n temp[i] = a[i];\r\n a = temp;\r\n }", "public void repair(){\n if(health < 9) {\n this.health++;\n }\n }", "void resize() {\n capacity = array.size();\n }", "public void reestablecerFullStock() { \n bodega Bodega = new bodega();\n Bodega.setProductosList(this.bodegaDefault());\n }" ]
[ "0.6214184", "0.608027", "0.59825677", "0.59360164", "0.5858061", "0.5829473", "0.5799281", "0.57361877", "0.5731226", "0.5701021", "0.5680614", "0.56802064", "0.5656092", "0.5636025", "0.5615855", "0.5614843", "0.56103027", "0.5605919", "0.56022745", "0.5544424", "0.5534992", "0.5534801", "0.5511725", "0.55052334", "0.55042243", "0.54860306", "0.54847383", "0.54804635", "0.545387", "0.5453078", "0.54399455", "0.543434", "0.5428783", "0.54276127", "0.5425726", "0.54162794", "0.541343", "0.5398858", "0.5398373", "0.53915334", "0.5390727", "0.5382435", "0.53749263", "0.53701466", "0.5362583", "0.53589445", "0.53417367", "0.53176504", "0.5316304", "0.53058714", "0.5303312", "0.52949965", "0.52931625", "0.52919644", "0.529096", "0.5287584", "0.5281004", "0.52802336", "0.5278159", "0.5277715", "0.5274847", "0.5274706", "0.5274163", "0.5259563", "0.52495736", "0.5249178", "0.52396804", "0.5236026", "0.52203476", "0.5216132", "0.52132136", "0.52120525", "0.52043796", "0.520238", "0.5201001", "0.51996773", "0.5199167", "0.51957905", "0.5194093", "0.519128", "0.51870006", "0.5181428", "0.5179346", "0.5175984", "0.5175078", "0.51662254", "0.516493", "0.51646066", "0.51643765", "0.516382", "0.5146965", "0.5146756", "0.51439714", "0.51417947", "0.5141702", "0.5137028", "0.51335335", "0.51332045", "0.5129358", "0.5128135" ]
0.72363544
0
The methods low price of food.
private void lowPrice(Food food, Date currentDate) { if (food.getShelfLifeOfProductInPercent(currentDate) > START_SHELF_LIFE_OF_PRODUCT_IN_PERSENT_FOR_LOW_PRICE && food.getShelfLifeOfProductInPercent(currentDate) <= END_SHELF_LIFE_OF_PRODUCT_IN_PERSENT_FOR_LOW_PRICE) { food.setPriceByDiccount(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double getPotatoesPrice();", "public double getLowPrice() {\r\n\t\treturn lowPrice;\r\n\t}", "public double getLowPrice() {\n return this.lowPrice;\n }", "@Override\n public int getPrice() {\n return 20;\n }", "@Override\n\tpublic float getPrice() {\n\t\treturn 70.0f;\n\t}", "@Override\n public double getPrice() {\n return 2.5;\n }", "public int price(){\n return 2;\n }", "public int getPrice(){\n return 80;\n }", "@Override\n\tpublic int howmuch() {\n\t\treturn price;\n\t}", "@Override\r\n\tpublic double foodConsumption() {\n\t\treturn 0;\r\n\t}", "@Override\n public double getPrice() {\n return souvenir.getPrice() + 20;\n }", "double getPrice();", "double getPrice();", "double getPrice();", "int getPrice();", "abstract public double getPrice();", "@Override\n\tpublic double getPrice() {\n\t\treturn 20;\n\t}", "BigDecimal getLowPrice();", "public int getPrice();", "@Override\n\t\t\tpublic double getPrice() {\n\t\t\t\treturn 50.0;\n\t\t\t}", "public double getPrice();", "long getPrice();", "@Override\r\n\tpublic double getPrice() {\n\t\treturn pizza.getPrice()+ 12.88;\r\n\t}", "public float getHightPrice()\r\n{\r\n\treturn this.hightPrice;\r\n}", "public Double getPrice();", "public int prIce_Per_GUeSt(int NO_OF_PEOPLE){\r\n if (NO_OF_PEOPLE>50){\r\n price_per_guest=lower_price_per_guest;\r\n System.out.println(\"PER_PERSON_PRICE = \"+lower_price_per_guest);\r\n int total_price = price_per_guest* NO_OF_PEOPLE;\r\n return total_price;\r\n }\r\n else\r\n {price_per_guest=Highest_price_per_guest;\r\n int total_price = price_per_guest* NO_OF_PEOPLE;\r\n System.out.println(\"PER_PERSON_PRICE = \"+Highest_price_per_guest);\r\n return total_price;}\r\n }", "public void buyhouse(int cost){\n\t\n}", "@Override\n\tpublic double getPrice() {\n\t\treturn 10;\n\t}", "@Override\n\tpublic double getPrice() {\n\t\treturn 10;\n\t}", "@Override\n\tpublic double getPrice() {\n\t\t\n\t\treturn 2000;\n\t}", "public void getFood()\r\n\t{\r\n\t\tsetRabbitWeight(getRabbitWeight() + 2);\r\n\t}", "public double getPrice(){return price;}", "String getPrice();", "public double getHighPrice() {\n return this.highPrice;\n }", "@Override\n public double calculatePrice() {\n return getVolume() * (1.0 + (getAlcoholPercent() / 100.0)) * this.liquids.size();\n }", "@Override\n public int getCost() {\n return iceCreamPrice + topPrice;\n }", "public boolean lowQuantity(){\r\n if(getToolQuantity() < 40)\r\n return true;\r\n return false;\r\n }", "public double getPrice()\r\n {\r\n return price;\r\n }", "public int getPrice ( ) {\n return price;\n }", "public int calculatePrice() {\n int price = 5;\n if(hasWhippedCream) {\n price += 1;\n }\n if(hasChocolate) {\n price += 2;\n }\n return quantity * price;\n }", "@Override\n\tpublic double getPrice() {\n\t\treturn 30000;\n\t}", "public static int getPrice() {\n return PRICE_TO_BUY;\n }", "public double price() {\n return price;\n }", "void cook(Food food) {\n //cook in pressure cooker\n }", "public float getPrice() \n {\n return price;\n }", "public double getPrice(){\r\n\t\treturn price;\r\n\t}", "public double getPrice()\n {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public int getFullPrice(){\n\t\treturn price;\n\t}", "private int calculatePrice(boolean hasWhipped, boolean hasChocolate){\n return quantity * (5 + (hasWhipped ? 1 : 0) + (hasChocolate ? 2 : 0));\n }", "public double getPrice() {\r\n return price;\r\n }", "public double getPrice() {\r\n return price;\r\n }", "public double getPrice() {\r\n return price;\r\n }", "public double getPrice() {\r\n return price;\r\n }", "public int getPrice() {\n return price;\n }", "public int getPrice() {\r\n return price;\r\n }", "public Double getPrice() {\r\n return price;\r\n }", "public void getPrice(){\n System.out.println(\"Price: $\" + price); \n }", "public double getHighPrice() {\r\n\t\treturn highPrice;\r\n\t}", "public int getPrice() {\n\t\treturn 10;\n\t}", "public int getPrice() {\n return price_;\n }", "protected int get_food_level()\n {\n return food_level;\n }", "public double getPrice()\r\n {\r\n return this.price;\r\n }", "BigDecimal getHighPrice();", "public double getPrice()\n {\n return this.price;\n }", "@Override\n\tpublic int getPrice() {\n\t\treturn 0;\n\t}", "public float getPrice() {\n return _price;\n }", "public int getPrice()\n {\n return price;\n }", "public float getPrice() {\n return price;\n }", "public float getPrice() {\n return price;\n }", "public float getPrice() {\n return price;\n }", "public double getPrice(){\n\t\treturn price;\n\t}", "public int getPrice() {\r\n\t\tif (this.base.equals(\"tower\")) {\r\n\t\t\treturn price;\r\n\t\t}\r\n\t\treturn 0;\r\n\t}", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public void filterLowerPrice(double price){\n market.filterLowerPrice(price);\n car = market.filters;\n }", "public Integer getPrice() {\r\n return price;\r\n }", "public Integer getPrice() {\r\n return price;\r\n }", "double calculatePrice();", "public int getPrice() {\n return price;\n }", "public int getPrice() {\n return price;\n }", "public int getPrice() {\n return price;\n }", "@Override\r\n\tpublic double getPrice() {\n\t\treturn 60000;\r\n\t}", "protected float getPrice() {\n\t\t\treturn price;\n\t\t}", "public double price(){\n if (basePrice() >1000){\n return basePrice() *0.95;\n }else\n return basePrice() * 0.98;\n }", "public double getPrice()\n {\n \treturn price;\n }", "private int calculatePrice(boolean addWhippedCream, boolean addChocolate,boolean takeAway) {\r\n int price=20;\r\n if (addWhippedCream){\r\n price=price+5;\r\n }\r\n\r\n if (addChocolate){\r\n price=price+7;\r\n }\r\n if (takeAway){\r\n price=price+2;\r\n }\r\n\r\n\r\n return quantity*price;\r\n\r\n }", "public void setPotatoesPrice(double p);", "@Override\n public int pizzaPrice() {\n if (size.equals(\"Small\"))\n return SMALLPIZZA;\n else if (size.equals(\"Medium\"))\n return SMALLPIZZA + 2;\n else\n return SMALLPIZZA + 4;\n }", "public Double getPrice() {\n return price;\n }", "public Double getPrice() {\n return price;\n }" ]
[ "0.68966115", "0.68572456", "0.68366903", "0.6786103", "0.6697406", "0.669487", "0.6680185", "0.66578025", "0.664266", "0.6635256", "0.6623541", "0.6620752", "0.6620752", "0.6620752", "0.6617477", "0.6598059", "0.65957", "0.65818256", "0.65681624", "0.6561325", "0.6547063", "0.6538173", "0.65250677", "0.64870477", "0.6475436", "0.646079", "0.640839", "0.64028907", "0.64028907", "0.63745046", "0.6368035", "0.6335506", "0.6333845", "0.6332611", "0.6314732", "0.6312732", "0.6286435", "0.6281844", "0.6270673", "0.6266261", "0.626437", "0.6257361", "0.6254768", "0.62421614", "0.6225661", "0.6208884", "0.620874", "0.62003446", "0.6199519", "0.6182869", "0.61783904", "0.61783904", "0.61783904", "0.61783904", "0.61769897", "0.61732346", "0.6166689", "0.6164953", "0.6159252", "0.61571777", "0.61544025", "0.6154348", "0.6151562", "0.6140894", "0.6137983", "0.6137175", "0.61337334", "0.6129771", "0.61292046", "0.61292046", "0.61292046", "0.6126695", "0.6118217", "0.6115034", "0.6115034", "0.6115034", "0.6115034", "0.6115034", "0.6115034", "0.6115034", "0.6115034", "0.6115034", "0.6115034", "0.6115034", "0.6106234", "0.60995877", "0.60995877", "0.6098658", "0.6086502", "0.6083927", "0.6083927", "0.60824925", "0.6075288", "0.60726756", "0.6070368", "0.60589564", "0.6057668", "0.6050129", "0.6049291", "0.6049291" ]
0.6817849
3
TODO: Prob just learning program relationship needed
@Override public Profile createProfile(Long educationProviderId, Long learningProgramId, Profile profile) { LearningProgram lProgram = learningProgramRepository.findByIdAndEducationProviderId(learningProgramId, educationProviderId) .orElseThrow(()-> new ResourceNotFoundException(String.format("Education provider with id: %s and " + "Learning program with id: %s were not found", learningProgramId))); profile.setEducationProvider(lProgram.getEducationProvider()); profile.setLearningProgram(lProgram); return profileRepository.save(profile); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Programming(){\n\t}", "public static void main(String args[]) throws Exception\n {\n \n \n \n }", "public static void main(String[]args) {\n\t\n\t\t\n\n}", "private static void cajas() {\n\t\t\n\t}", "private void strin() {\n\n\t}", "private void kk12() {\n\n\t}", "public static void main(String[] args)\r\t{", "private void poetries() {\n\n\t}", "public void solution() {\n\t\t\n\t}", "public void smell() {\n\t\t\n\t}", "public void verliesLeven() {\r\n\t\t\r\n\t}", "public static void main(String[] args) throws Exception {\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t}", "public static void main(String[] args) {\n \r\n\t}", "public static void main() {\n \n }", "void aprovarAnalise();", "public void mo38117a() {\n }", "public static void main(String[] args) {\n \n \n \n\t}", "public static void main(String[] args) {\n\n\t\t\n\t\tProces p1= new Proces(20, 0, 10);\n\t\tProces p2= new Proces(10, 1, 10);\n\t\tProces p3= new Proces(30, 6, 10);\n\t\tProces p4= new Proces(9, 7, 10);\n\t\tArrayList<Proces> procesy1= new ArrayList<Proces>();\n\t\tprocesy1.add(p1);\n\t\tprocesy1.add(p2);\n\t\tprocesy1.add(p3);\n\t\tprocesy1.add(p4);\n\t\tProcesor proc1= new Procesor(1, procesy1);\n\t\n\t\t\n\t\t\n\t\tArrayList<Proces> procesy2= new ArrayList<Proces>();\n\t\tprocesy2.add(new Proces(40, 2, 14));\n\t\tprocesy2.add(new Proces(20, 8, 9));\n\t\tprocesy2.add(new Proces(30, 2, 3));\n\t\tprocesy2.add(new Proces(10, 4, 5));\n\t\tprocesy2.add(new Proces(4, 7, 14));\n\t\tProcesor proc2= new Procesor(2, procesy2);\n\t\n\t\t\n\t\t\n\t\tArrayList<Procesor> procesory= new ArrayList<Procesor>();\n\t\tprocesory.add(proc1);\n\t\tprocesory.add(proc2);\n\t\t\n\t\tint ileProcesorow=2;\n\t\tint progR=20;\n\t\tint progP=20;\n\t\tint iloscZapytanZ=10;\n\t\tint okresPomiaruObciazen=1;\n\t\t\n\t\tAlgorithms al= new Algorithms(procesory, progP, iloscZapytanZ, progR);\n\t\tal.wyswietlProcesory();\n\t\tal.symulacjaPierwsza(okresPomiaruObciazen);\n\t\tal.symulacjaDruga(okresPomiaruObciazen);\n\t\tal.symulacjaTrzecia(okresPomiaruObciazen);\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args)\r\n {\n \r\n \r\n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "public static void main(String[] args) {\n\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n \n \n \n \n }", "public String program();", "public void mo4359a() {\n }", "public static void main(String[] args) {\n\t\t\n\t\t\t\n\n\t}", "public static void main(String[] args){\n\t\t\n\t\t\n \t}", "public static void main(String[] args){\n\t\t\r\n\t}", "Program createProgram();", "Program createProgram();", "Program createProgram();", "public static void main(String[] args) {\n\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "private void generateSolution() {\n\t\t// TODO\n\n\t}", "@Override\n public void perish() {\n \n }", "public ProgramWilmaa()\n\t{\n\t}", "public static void main(String args[]){\n\t\t\n\t}", "public static void main(String[] args) {\t\n\t\t\n\t}", "public static void main (String args[]) {\n\t\t\n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n countDuplicateCharacters(\"My name is Fernando\");\n\n //2. Reverse an Arraylist.\n reverseArrayList();\n\n //3. Check if a particular key exists in HashMap.\n //4. Convert keys of a map to a list.\n checkKeyAndCreateList();\n\n //5. Copy all elements of a HashSet to an Object array.\n hashToObject();\n\n //6. Get highest and lowest value stored in TreeSet\n maxAndMinValueTreeSet();\n\n //7. Sort ArrayList of Strings alphabetically.\n sortArrayList();\n\n //8. Get Set view of keys from HashTable.\n getViewsHashTable();\n\n }", "public static void main(String[] args) {\n \n \n }", "public static void main(String[] args) {\n \n \n }", "private stendhal() {\n\t}", "public static void main (String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\r\n \r\n }", "public static void main(String[] args) {\r\n \r\n }", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "public static void main(String [] arg) throws IOException{\n\t\tSequenceDatabase2 sequenceDatabase2 = new SequenceDatabase2(); \n\t\tsequenceDatabase2.loadFile(fileToPath(\"contextPrefixSpan-conClases.txt\"));\n\t\t//sequenceDatabase2.loadFile(fileToPath(\"ejemplo-3clases.txt\"));\n\t\t//sequenceDatabase2.print();\n\t\t\n\t\tint minsup2 = 2; // we use a minsup of 2 sequences\n\t\t\n\t\tint k = 5;\n\t\t\n\t\t// Create an instance of the algorithm\n\t\tAlgoBIDEPlus2 algo = new AlgoBIDEPlus2();\n\t\t\n // if you set the following parameter to true, the sequence ids of the sequences where\n // each pattern appears will be shown in the result\n boolean showSequenceIdentifiers = false;\n\t\t\n\t\t// execute the algorithm\n//\t\tSequentialPatterns patterns = algo.runAlgorithm(sequenceDatabase2, null, minsup2, k);\n//\t\talgo.printStatistics(sequenceDatabase2.size());\n//\t\tpatterns.printFrequentPatterns(sequenceDatabase2.size(),showSequenceIdentifiers);\n Map<String,List<SequentialPatterns>> mapaPatrones = algo.runAlgorithm(sequenceDatabase2, null, minsup2, k);\n \n algo.printStatistics(sequenceDatabase2.size());\n \n for(String clase: mapaPatrones.keySet()) {\n \tSystem.out.println(\"c: \" + clase);\n\t Iterator<SequentialPatterns> iterator = mapaPatrones.get(clase).iterator();\n\t while (iterator.hasNext()) {\n\t \tSequentialPatterns auxPatterns = iterator.next();\n\t \tauxPatterns.printFrequentPatterns(sequenceDatabase2.size(),showSequenceIdentifiers);\n\t }\n } \n\t}", "public static void main(String args[]){\n\t\t\n\t\n\t}", "public static void main(String[] args) {\n \n\t}", "public static void main(String args[]) {\r\n }", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args){\n\t\tfor(int i=0; i<programRuns; i++){ //for loop to run gen numOfMutations creation \n\t\t\tnumOfMutations[i] = createnumOfMutationss(); //createnumOfMutationss returns number of total mutations\n\t\t}\n\t\n\t\tsort(numOfMutations); //sort array\n\t\tgetFreq(); //find the frequency of the number of mutations that occur\n\t\tgraph(); //create histogram of data\n\t\t\n\t}", "public void mo21791P() {\n }", "public static void main(String[] args) {\n System.out.println(findStrobogrammatic(6));\n }", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\t\n\n\t}", "public static void main()\n\t{\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\t\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tString pol1=\"1x^3+3x^2+7x^1+21x^0\";\r\n\t\tString pol2=\"1x^2+7x^0\";\r\n\t\tString adunare=\"+1x^3+4x^2+7x^1+28x^0\";\r\n\t\tString scadere=\"+1x^3+2x^2+7x^1+14x^0\";\r\n\t\tString inmultire=\"+1x^5+3x^4+14x^3+42x^2+49x^1+147x^0\";\r\n\t\tString restul=\"\";\r\n\t\tString catul=\"+1.0x^1+3.0x^0\";\r\n\t\tString derivare=\"+3x^2+6x^1+7x^0\";\r\n\t\tString integrare=\"+0.25x^4+1.0x^3+3.5x^2+21.0x^1\";\r\n\t\tPolinom p1=new Polinom();\r\n\t\tPolinom p2=new Polinom();\r\n\t\tPolinom p1copie=new Polinom();\r\n\t\ttry {\r\n\t\t\tp1=p1.crearePolinom(pol1, 3);\r\n\t\t\tp1copie=p1.crearePolinom(pol1, 3);\r\n\t\t\tp2=p2.crearePolinom(pol2, 2);\r\n\t\t} catch (IllegalInputException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\r\n\t\tPolinom p3=p1.adunarePolinom(p2, 4);\r\n\t\tString rezAdunare=p3.afisPolinomIntreg();\r\n\t\tPolinom p4=p1.scaderePolinom(p2, 4);\r\n\t\tString rezScadere=p4.afisPolinomIntreg();\r\n\t\tPolinom p5=p1.inmultirePolinom(p2, 6);\r\n\t\tString rezInmultire=p5.afisPolinomIntreg();\r\n\t\tString cat=p1.impartirePolinom(p2, 3, 2);\r\n\t\tString rest=p1copie.impartirePolinom(p2, 3, 2);\r\n\t\tPolinom p7=p1.derivarePolinom(3);\r\n\t\tString rezDerivare=p7.afisPolinomReal();\r\n\t\tPolinom p8=p1.integrarePolinom(4);\r\n\t\tString rezIntegrare=p8.afisPolinomReal();\r\n\t\t\r\n\t\tassert adunare!=rezAdunare : \"Nu se verifica adunarea!\";\r\n\t\tassert scadere!=rezScadere : \"Nu se verifica scaderea!\";\r\n\t\tassert inmultire!=rezInmultire : \"Nu se verifica inmultirea!\";\r\n\t\tassert derivare!=rezDerivare : \"Nu se verifica derivarea!\";\r\n\t\tassert integrare!=rezIntegrare : \"Nu se verifica integrarea!\";\r\n\t\tassert catul!=cat : \"Nu se verifica adunarea!\";\r\n\t\tassert restul!=rest : \"Nu se verifica adunarea!\";\r\n\t\t\r\n\t\t\r\n\t}", "public static void main(String [] args){\n \n \tpart1();\n \n \tpart2();\n \n\t}", "public static void main(String[] args) {\n\t \t\n\t \t\n\t }", "public static void main(String[] args)\r\n {\r\n \r\n \r\n \r\n }", "private void level7() {\n }", "private void runBest() {\n }" ]
[ "0.57306516", "0.57076705", "0.5652904", "0.5627874", "0.56170404", "0.5598698", "0.55875957", "0.55742025", "0.5527465", "0.55133295", "0.55054086", "0.5503828", "0.5484519", "0.5452728", "0.54246503", "0.54212236", "0.54203945", "0.5407801", "0.5394608", "0.53891987", "0.5379936", "0.53678226", "0.5366433", "0.5365347", "0.5359229", "0.53590125", "0.53548115", "0.5336104", "0.5336104", "0.5336104", "0.53346175", "0.53295225", "0.53295225", "0.5323533", "0.53215605", "0.5321233", "0.53186417", "0.53149027", "0.5305501", "0.5296567", "0.5296567", "0.5296567", "0.5296567", "0.5296567", "0.5296567", "0.5290876", "0.52903485", "0.52903485", "0.52780193", "0.52761585", "0.5273826", "0.5273826", "0.5273826", "0.5273826", "0.52703154", "0.52703154", "0.52699935", "0.5265783", "0.5261812", "0.5255725", "0.5252988", "0.5248939", "0.5248939", "0.5248939", "0.5248939", "0.5248939", "0.5248939", "0.5248939", "0.5248939", "0.5248939", "0.5248939", "0.5248939", "0.5248939", "0.5248939", "0.5248939", "0.5248939", "0.5248939", "0.5248939", "0.5248939", "0.5248939", "0.5248939", "0.5248939", "0.5248939", "0.5248939", "0.5248939", "0.5248939", "0.5248939", "0.5248939", "0.5248939", "0.524889", "0.5246888", "0.5246372", "0.5243344", "0.52402157", "0.5239108", "0.523813", "0.52351856", "0.5234575", "0.5234104", "0.5232709", "0.5232168" ]
0.0
-1
TODO Autogenerated method stub
@Override public Object retrieveSerializedObject() { return explanation; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void parse(InputStream iStream) throws LearningpodException { XStream xs = new XStream(); xs.autodetectAnnotations(true); xs.ignoreUnknownElements(); // set aliases xs.alias("learningpod",ExplanationBean.class); explanation = (ExplanationBean)xs.fromXML(iStream); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.save_game, menu); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.actions, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tgetMenuInflater().inflate(R.menu.actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.actions_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main_actions, menu);\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n\t\tinflater.inflate(R.menu.action_bar_menu, menu);\r\n\t\tmMenu = menu;\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.act_bar_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_actions, menu);\r\n\t\treturn true;\r\n //return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\r\n\t inflater.inflate(R.menu.action_bar_all, menu);\r\n\t return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\t super.onCreateOptionsMenu(menu);\n\t\tMenuInflater muu= getMenuInflater();\n\t\tmuu.inflate(R.menu.cool_menu, menu);\n\t\treturn true;\n\t\t\n\t\t\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.adventure_archive, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.archive_menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n \tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n \t\tinflater.inflate(R.menu.main, menu);\n \t\tsuper.onCreateOptionsMenu(menu, inflater);\n \t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.action_menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater bow=getMenuInflater();\n\t\tbow.inflate(R.menu.menu, menu);\n\t\treturn true;\n\t\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.action_menu, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\t\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\t\t\n\t\t/* Inflate the menu; this adds items to the action bar if it is present */\n\t\tgetMenuInflater().inflate(R.menu.act_main, menu);\t\t\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflate = getMenuInflater();\n inflate.inflate(R.menu.menu, ApplicationData.amvMenu.getMenu());\n return true;\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.menu, menu);\n\t\t\treturn true; \n\t\t\t\t\t\n\t\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.main, menu);\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) \n {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_bar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_item, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.menu, menu);\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t \n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\t//menu.clear();\n\t\tinflater.inflate(R.menu.soon_to_be, menu);\n\t\t//getActivity().getActionBar().show();\n\t\t//getActivity().getActionBar().setBackgroundDrawable(\n\t\t\t\t//new ColorDrawable(Color.rgb(223, 160, 23)));\n\t\t//return true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n this.getMenuInflater().inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.main, menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu( Menu menu, MenuInflater inflater )\n\t{\n\t\tsuper.onCreateOptionsMenu( menu, inflater );\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n \t// We must call through to the base implementation.\r\n \tsuper.onCreateOptionsMenu(menu);\r\n \t\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_menu, menu);\r\n\r\n return true;\r\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.inter_main, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu (Menu menu){\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.custom_action_bar, menu);\n\t\treturn true;\n\t}", "public void initMenubar() {\n\t\tremoveAll();\n\n\t\t// \"File\"\n\t\tfileMenu = new FileMenuD(app);\n\t\tadd(fileMenu);\n\n\t\t// \"Edit\"\n\t\teditMenu = new EditMenuD(app);\n\t\tadd(editMenu);\n\n\t\t// \"View\"\n\t\t// #3711 viewMenu = app.isApplet()? new ViewMenu(app, layout) : new\n\t\t// ViewMenuApplicationD(app, layout);\n\t\tviewMenu = new ViewMenuApplicationD(app, layout);\n\t\tadd(viewMenu);\n\n\t\t// \"Perspectives\"\n\t\t// if(!app.isApplet()) {\n\t\t// perspectivesMenu = new PerspectivesMenu(app, layout);\n\t\t// add(perspectivesMenu);\n\t\t// }\n\n\t\t// \"Options\"\n\t\toptionsMenu = new OptionsMenuD(app);\n\t\tadd(optionsMenu);\n\n\t\t// \"Tools\"\n\t\ttoolsMenu = new ToolsMenuD(app);\n\t\tadd(toolsMenu);\n\n\t\t// \"Window\"\n\t\twindowMenu = new WindowMenuD(app);\n\n\t\tadd(windowMenu);\n\n\t\t// \"Help\"\n\t\thelpMenu = new HelpMenuD(app);\n\t\tadd(helpMenu);\n\n\t\t// support for right-to-left languages\n\t\tapp.setComponentOrientation(this);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp=getMenuInflater();\n\t\tblowUp.inflate(R.menu.welcome_menu, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.item, menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.resource, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu,menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.home_action_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.template, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n Log.d(\"onCreateOptionsMenu\", \"create menu\");\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.socket_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_menu, menu);//Menu Resource, Menu\n\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actionbar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(toolbar_res, menu);\n updateMenuItemsVisibility(menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t// \n\t\tMenuInflater mi = getMenuInflater();\n\t\tmi.inflate(R.menu.thumb_actv_menu, menu);\n\t\t\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.swag_list_activity_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\n\t\treturn true;\n\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.jarvi, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n menuInflater.inflate(R.menu.main, menu);\n\n }", "public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){\n }", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actmain, menu);\r\n return true;\r\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.add__listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.buat_menu, menu);\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.layout.menu, menu);\n\t\treturn true;\n\t}", "@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n\n\t\n\t\n\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\n\treturn super.onCreateOptionsMenu(menu);\n}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ichat, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater)\n\t{\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\tinflater.inflate(R.menu.expenses_menu, menu);\n\t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.action_bar, menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp = getMenuInflater();\n\t\tblowUp.inflate(R.menu.status, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ui_main, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_activity_actions, menu);\n return true;\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }" ]
[ "0.7249201", "0.7204109", "0.7197405", "0.71792436", "0.7109801", "0.7041446", "0.7040234", "0.70145714", "0.7011273", "0.6983118", "0.6946729", "0.6940447", "0.6936383", "0.6920103", "0.6920103", "0.6893587", "0.6885479", "0.6877562", "0.6877041", "0.6864375", "0.6864375", "0.6864375", "0.6864375", "0.6854553", "0.6848997", "0.68213886", "0.6819509", "0.6814738", "0.68146676", "0.68146676", "0.6807654", "0.6802825", "0.679964", "0.67930657", "0.67922", "0.67903394", "0.6786084", "0.6761232", "0.6759505", "0.67503023", "0.6746139", "0.6746139", "0.6743613", "0.6743027", "0.6727706", "0.67254", "0.67245597", "0.67245597", "0.6723394", "0.67136675", "0.67081934", "0.6706639", "0.67022187", "0.6700513", "0.66984093", "0.66964614", "0.66886663", "0.6685854", "0.6685854", "0.6685123", "0.66817266", "0.66811055", "0.6679423", "0.66700786", "0.66692066", "0.66648287", "0.6659215", "0.6659215", "0.6659215", "0.665847", "0.6656809", "0.6656809", "0.6656809", "0.66543585", "0.6653763", "0.6652573", "0.6650882", "0.66493136", "0.66489655", "0.6648397", "0.6648281", "0.664721", "0.6647127", "0.6645251", "0.66444296", "0.6644408", "0.66408044", "0.66365176", "0.6635421", "0.6634293", "0.6634293", "0.6634293", "0.66340095", "0.66314715", "0.6629901", "0.6628624", "0.662851", "0.66264814", "0.6622667", "0.6621362", "0.6621362" ]
0.0
-1
Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml.
@Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n //\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // Back button clicked\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // app icon in action bar clicked; goto parent activity.\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n switch (id) {\r\n case android.R.id.home:\r\n // app icon in action bar clicked; go home\r\n this.finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // app icon in action bar clicked; go home\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n Log.e(\"clik\", \"action bar clicked\");\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\t public boolean onOptionsItemSelected(MenuItem item) {\n\t int id = item.getItemId();\n\t \n\t\t\tif (id == android.R.id.home) {\n\t\t\t\t// Respond to the action bar's Up/Home button\n\t\t\t\t// NavUtils.navigateUpFromSameTask(this);\n\t\t\t\tonBackPressed();\n\t\t\t\treturn true;\n\t\t\t}\n\t \n\t \n\t return super.onOptionsItemSelected(item);\n\t }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n // Respond to the action bar's Up/Home button\r\n case android.R.id.home:\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle presses on the action bar items\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n case R.id.action_clear:\n return true;\n case R.id.action_done:\n\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onActionHomePressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId())\n {\n case android.R.id.home :\n super.onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId ()) {\n case android.R.id.home:\n onBackPressed ();\n return true;\n\n default:\n break;\n }\n return super.onOptionsItemSelected ( item );\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t switch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\t// app icon in action bar clicked; go home \n\t\t\tIntent intent = new Intent(this, Kelutral.class); \n\t\t\tintent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); \n\t\t\tstartActivity(intent); \n\t\t\treturn true;\t\t\n\t case R.id.Search:\n\t \treturn onSearchRequested();\n\t\tcase R.id.AppInfo:\n\t\t\t// Place holder menu item\n\t\t\tIntent newIntent = new Intent(Intent.ACTION_VIEW,\n\t\t\t\t\tUri.parse(\"http://forum.learnnavi.org/mobile-apps/\"));\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\n\t\tcase R.id.Preferences:\n\t\t\tnewIntent = new Intent(getBaseContext(), Preferences.class);\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\t\n\t }\n\t return false;\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n onBackPressed();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // Intent homeIntent = new Intent(this, MainActivity.class);\n // homeIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // startActivity(homeIntent);\n finish();\n return true;\n default:\n return (super.onOptionsItemSelected(item));\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // setResult and close the activity when Action Bar Up Button clicked.\n if (item.getItemId() == android.R.id.home) {\n setResult(RESULT_CANCELED);\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // This ID represents the Home or Up button. In the case of this\n // activity, the Up button is shown. Use NavUtils to allow users\n // to navigate up one level in the application structure. For\n // more details, see the Navigation pattern on Android Design:\n //\n // http://developer.android.com/design/patterns/navigation.html#up-vs-back\n //\n \tgetActionBar().setDisplayHomeAsUpEnabled(false);\n \tgetFragmentManager().popBackStack();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if(id == android.R.id.home){\n onBackPressed();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@RequiresApi(api = Build.VERSION_CODES.M)\n @Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif(item.getItemId()==android.R.id.home)\r\n\t\t{\r\n\t\t\tgetActivity().onBackPressed();\r\n\t\t}\r\n\t\treturn super.onOptionsItemSelected(item);\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if(item.getItemId()==android.R.id.home){\n super.onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n return false;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n //Back arrow\n case android.R.id.home:\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // android.R.id.home是Android内置home按钮的id\n finish();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n this.onBackPressed();\n return false;\n }\n return false;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n int id = item.getItemId();\n\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n\r\n case android.R.id.home:\r\n /*Intent i= new Intent(getApplication(), MainActivity.class);\r\n i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n startActivity(i);*/\r\n onBackPressed();\r\n finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case android.R.id.home:\n this.finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Pass the event to ActionBarDrawerToggle, if it returns\n // true, then it has handled the app icon touch event\n if (mDrawerToggle.onOptionsItemSelected(item)) {\n return true;\n }\n\n // Handle your other action bar items...\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n NavUtils.navigateUpFromSameTask(getActivity());\n return true;\n case R.id.action_settings:\n Intent i = new Intent(getActivity(), SettingsActivity.class);\n startActivity(i);\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n //Fixes the Up Button\n if(id == android.R.id.home) {\n BuildRoute.this.finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()){\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return true;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if (id == android.R.id.home) {\n NavUtils.navigateUpFromSameTask(this);\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n break;\r\n }\r\n return true;\r\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif (item.getItemId() == android.R.id.home) {\n\t\t\tfinish();\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n onBackPressed();\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if ( id == android.R.id.home ) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.home) {\r\n NavUtils.navigateUpFromSameTask(this);\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_about) {\r\n AboutDialog();\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_exit) {\r\n finish();\r\n return true;\r\n }\r\n\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n//noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n// finish the activity\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item)\n {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if( id == android.R.id.home ) // Back button of the actionbar\n {\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\t\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\t\tswitch (item.getItemId()) {\r\n\t\t\tcase android.R.id.home:\r\n\t\t\t\tfinish();\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\treturn super.onOptionsItemSelected(item);\r\n\t\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n return true;\n }\n return false;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if(id == android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\r\n\t\tcase android.R.id.home:\r\n\t\t\tsetResult(RESULT_OK, getIntent());\r\n\t\t\tfinish();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n if (item.getItemId() == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n\n case android.R.id.home:\n this.finish();\n return true;\n }\n return true;\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tint id = item.getItemId();\n\t\tif (id == android.R.id.home) {\n\t\t\tfinish();\n\t\t\treturn true;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if (id == android.R.id.home) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n //NavUtils.navigateUpFromSameTask(this);\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // todo: goto back activity from here\n finish();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n // Handle item selection\r\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n return true;\r\n\r\n case me.cchiang.lookforthings.R.id.action_sample:\r\n// Snackbar.make(parent_view, item.getTitle() + \" Clicked \", Snackbar.LENGTH_SHORT).show();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tcase R.id.scan_menu:\n\t\t\tonScan();\n\t\t\tbreak;\n\t\tcase R.id.opt_about:\n\t\t\t//onAbout();\n\t\t\tbreak;\n\t\tcase R.id.opt_exit:\n\t\t\tfinish();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t\treturn true;\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n super.onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(@NonNull MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n finish();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if(id==android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\r\n\t switch (item.getItemId()) {\r\n\t \t// back to previous page\r\n\t case android.R.id.home:\r\n\t finish();\r\n\t return true;\r\n\t }\r\n\t return super.onOptionsItemSelected(item);\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId())\n {\n case android.R.id.home:\n this.finish();\n return (true);\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case R.id.home:{\n NavUtils.navigateUpFromSameTask(this);\n return true;\n }\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n switch(item.getItemId())\n {\n case android.R.id.home:\n super.onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\treturn true;\n\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n\r\n int id = item.getItemId();\r\n if(id==android.R.id.home){\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }" ]
[ "0.79036397", "0.78051436", "0.77656627", "0.7726445", "0.7630767", "0.76211494", "0.75842685", "0.75296193", "0.74868536", "0.74574566", "0.74574566", "0.7437983", "0.7422003", "0.7402867", "0.7391276", "0.73864174", "0.7378494", "0.73696834", "0.736246", "0.7355139", "0.73449135", "0.7340738", "0.7329403", "0.7327573", "0.7325295", "0.7318255", "0.73159224", "0.7312879", "0.73033696", "0.73033696", "0.73008657", "0.7297531", "0.72929823", "0.7285663", "0.7282749", "0.72806233", "0.7277895", "0.72592133", "0.72592133", "0.72592133", "0.725875", "0.72585285", "0.7249446", "0.72242975", "0.72188604", "0.721602", "0.7203672", "0.720087", "0.71988416", "0.7192238", "0.7184499", "0.71768767", "0.71679133", "0.71665394", "0.7153183", "0.71526414", "0.71351266", "0.71341896", "0.71341896", "0.7128609", "0.7128064", "0.7123341", "0.7122453", "0.712232", "0.71210843", "0.7116595", "0.7116595", "0.7116595", "0.7116595", "0.7116421", "0.71161103", "0.71159387", "0.7114029", "0.71116006", "0.71088904", "0.71078885", "0.7104719", "0.70989364", "0.7097548", "0.7096198", "0.7092782", "0.7092782", "0.70853245", "0.7082456", "0.70802784", "0.70795983", "0.7073409", "0.70673656", "0.7060751", "0.70591253", "0.7058957", "0.7050524", "0.70371544", "0.70371544", "0.70350724", "0.70344317", "0.70344317", "0.7031844", "0.70303893", "0.70286727", "0.7017757" ]
0.0
-1
if null, the SessionContext's value applies
public AbstractDateTimeField() { super(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic HttpSessionContext getSessionContext() {\n\t\treturn null;\n\t}", "private void saveAsCurrentSession(Context context) {\n \t// Save the context\n \tthis.context = context;\n }", "public void setSessionContext(String SessionContext) {\n this.SessionContext = SessionContext;\n }", "public void setSession(Session value);", "@Deprecated\n @InlineMe(replacement = \"null\")\n @Override\n public final HttpSessionContext getSessionContext() {\n return null;\n }", "public void setSession(Session session) {\n\tthis.session = session; \r\n}", "public void setSession(Session session) { this.session = session; }", "public String getSessionContext() {\n return this.SessionContext;\n }", "Session getCurrentSession();", "Session getCurrentSession();", "@Override\r\n\tpublic void setSession(Map<String, Object> session) \r\n\t{\n\t\tthis.session = session;\r\n\t}", "@Override\n\t\tpublic HttpSession getSession() {\n\t\t\treturn null;\n\t\t}", "public ManagedBeanSession() {\r\n this.facesContext = FacesContext.getCurrentInstance();\r\n this.httpServletRequest = (HttpServletRequest) this.facesContext.getExternalContext().getRequest();\r\n if (this.httpServletRequest.getSession().getAttribute(\"sessionUsuario\") != null) {\r\n this.usuario = this.httpServletRequest.getSession().getAttribute(\"sessionUsuario\").toString();\r\n }\r\n }", "@java.lang.Override public int getContextValue() {\n return context_;\n }", "public void setMessageDrivenContext(MessageDrivenContext context) {\n\t\tthis.sessionContext = context;\n\t}", "@Override\r\n\tpublic void setSession(Map<String, Object> session) {\n\t\tthis.session=session;\r\n\t}", "@Override\n\tpublic void setSession(Map<String, Object> session) {\n\t\tthis.session=session;\n\t}", "@Autowired\n\tpublic void setContext(ApplicationContext context) {\n\t\tthis.context = context;\n\t\t((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope(\"session\", new SessionScope());\n\t\t((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope(\"request\", new RequestScope());\n\t}", "@Override\r\n public PhoenixSession getSession()\r\n {\n return null;\r\n }", "@Override\n\tpublic void setSession(Map<String, Object> session)\n\t{\n\t\tthis.session = session;\n\n\t}", "@Autowired\r\n\tpublic void setContext(ApplicationContext context) {\r\n\t\tthis.context = context;\r\n\t\t((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope(\"session\", new SessionScope());\r\n\t\t((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope(\"request\", new RequestScope());\r\n\t}", "@Autowired\r\n\tpublic void setContext(ApplicationContext context) {\r\n\t\tthis.context = context;\r\n\t\t((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope(\"session\", new SessionScope());\r\n\t\t((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope(\"request\", new RequestScope());\r\n\t}", "@java.lang.Override public int getContextValue() {\n return context_;\n }", "@Override\n\tpublic void setSessionContext(SessionContext arg0) throws EJBException, RemoteException {\n\n\t}", "private static void sessionFromCurrentSession(final Context context) {\n\n \t// The session itself\n final Session newSession = Session.getInstance();\n \n // The service\n Service newService = new Service();\n newSession.setService(newService);\n\n // The shared preferences\n Preferences preferences = new Preferences(context);\n newSession.setPreferences(preferences);\n\n // The database\n RestaurantDBAdapter restaurantDBAdapter = new RestaurantDBAdapter(context);\n newSession.setRestaurantDBAdapter(restaurantDBAdapter);\n\n // The hashmap of all the restaurants\n HashMap<String, Restaurant> restaurants = restaurantDBAdapter.getAllRestaurants();\n newSession.setRestaurants(restaurants);\n\n //Save the current session\n Session.setCurrentSession(newSession);\n Session.currentSession.saveAsCurrentSession(context);\n }", "@Override\r\n\tpublic void setSession(Map<String, Object> session) {\n\t\tthis.session = session;\r\n\t}", "@Override\r\n\tpublic void setSession(Map<String, Object> session) {\n\t\tthis.session = session;\r\n\t}", "public void setUserContext(UserContext userContext);", "@Override\n\tpublic void setSession(Map<String, Object> session) {\n\t\tthis.session = session;\n\t}", "public interface SessionContext\nextends Serializable {\n\n /** Set the name of the context.\n * This method must be invoked in the init phase.\n * In addition a load and a save resource can be provided.\n */\n void setup(String value, String loadResource, String saveResource);\n\n /**\n * Get the name of the context\n */\n String getName();\n\n /**\n * Get a document fragment.\n * If the node specified by the path exist, its content is returned\n * as a DocumentFragment.\n * If the node does not exists, <CODE>null</CODE> is returned.\n */\n DocumentFragment getXML(String path)\n throws ProcessingException ;\n\n /**\n * Set a document fragment at the given path.\n * The implementation of this method is context specific.\n * Usually all children of the node specified by the path are removed\n * and the children of the fragment are inserted as new children.\n * If the path is not existent it is created.\n */\n void setXML(String path, DocumentFragment fragment)\n throws ProcessingException;\n\n /**\n * Append a document fragment at the given path.\n * The implementation of this method is context specific.\n * Usually the children of the fragment are appended as new children of the\n * node specified by the path.\n * If the path is not existent it is created and this method should work\n * in the same way as setXML.\n */\n void appendXML(String path, DocumentFragment fragment)\n throws ProcessingException;\n\n /**\n * Remove some content from the context.\n * The implementation of this method is context specific.\n * Usually this method should remove all children of the node specified\n * by the path.\n */\n void removeXML(String path)\n throws ProcessingException;\n\n /**\n * Set a context attribute.\n * Attributes over a means to store any data (object) in a session\n * context. If <CODE>value</CODE> is <CODE>null</CODE> the attribute is\n * removed. If already an attribute exists with the same key, the value\n * is overwritten with the new one.\n */\n void setAttribute(String key, Object value)\n throws ProcessingException;\n\n /**\n * Get the value of a context attribute.\n * If the attribute is not available return <CODE>null</CODE>.\n */\n Object getAttribute(String key)\n throws ProcessingException;\n\n /**\n * Get the value of a context attribute.\n * If the attribute is not available the return the\n * <CODE>defaultObject</CODE>.\n */\n Object getAttribute(String key, Object defaultObject)\n throws ProcessingException;\n\n /**\n * Get a copy of the first node specified by the path.\n * If the node does not exist, <CODE>null</CODE> is returned.\n */\n Node getSingleNode(String path)\n throws ProcessingException;\n\n /**\n * Get a copy of all nodes specified by the path.\n */\n NodeList getNodeList(String path)\n throws ProcessingException;\n\n /**\n * Set the value of a node. The node is copied before insertion.\n */\n void setNode(String path, Node node)\n throws ProcessingException;\n\n /**\n * Get the value of this node.\n * This is similiar to the xsl:value-of function.\n * If the node does not exist, <code>null</code> is returned.\n */\n String getValueOfNode(String path)\n throws ProcessingException;\n\n /**\n * Set the value of a node.\n * All children of the node are removed beforehand and one single text\n * node with the given value is appended to the node.\n */\n void setValueOfNode(String path, String value)\n throws ProcessingException;\n\n /**\n * Stream the XML directly to the handler.\n * This streams the contents of getXML() to the given handler without\n * creating a DocumentFragment containing a copy of the data.\n * If no data is available (if the path does not exist) <code>false</code> is\n * returned, otherwise <code>true</code>.\n */\n boolean streamXML(String path,\n ContentHandler contentHandler,\n LexicalHandler lexicalHandler)\n throws SAXException, ProcessingException;\n\n /**\n * Try to load XML into the context.\n * If the context does not provide the ability of loading,\n * an exception is thrown.\n */\n void loadXML(String path,\n SourceParameters parameters)\n throws SAXException, ProcessingException, IOException;\n\n /**\n * Try to save XML from the context.\n * If the context does not provide the ability of saving,\n * an exception is thrown.\n */\n void saveXML(String path,\n SourceParameters parameters)\n throws SAXException, ProcessingException, IOException;\n}", "@Override\n public SessionCookieConfig getSessionCookieConfig() {\n return null;\n }", "@Override\n\tprotected void doUpdate(Session session) {\n\n\t}", "@Override\n @Test(groups = {\"SessionContext access\"})\n public void testSessionContext00() throws Exception {\n super.testSessionContext00();\n }", "protected Session getSession() { return session; }", "@Override\n public void sessionCreated(HttpSessionEvent se) {\n HttpSession session = se.getSession();\n if(session!=null) {\n session.setAttribute(PERSIST_SECURITY_CONTEXT_KEY,generateSeriesData());\n }\n }", "protected Object getInitialWriteValue(AbstractSession session) {\r\n return Long.valueOf(1);\r\n }", "@Override\r\n\t\t\tprotected void saveContext() {\n\t\t\t\t\r\n\t\t\t}", "private void setSessionAttribs(HttpServletRequest req, BlogUser user) {\n\t\treq.getSession().setAttribute(\"current.user.id\", user.getId());\n\t\treq.getSession().setAttribute(\"current.user.fn\", user.getFirstName());\n\t\treq.getSession().setAttribute(\"current.user.ln\", user.getLastName());\n\t\treq.getSession().setAttribute(\"current.user.nick\", user.getNick());\n\t}", "public void setSession(Session session) {\r\n this.session = session;\r\n }", "private Session getCurrentSession() {\n return sessionFactory.getCurrentSession();\n }", "@Override\r\n\tpublic void setSession(Map<String, Object> arg0) {\n\t\tthis.session = arg0;\r\n\t}", "protected Session getCurrentSession()\n \t{\n \t\treturn this.sessionFactory.getCurrentSession();\n \t}", "public Session getSession() { return session; }", "@Override\r\npublic void setSession(Map<String, Object> arg0) {\n\t\r\n}", "@Override\r\n\tpublic void setSession(Map<String, Object> arg0) {\n\t\t\r\n\t}", "public void testGetSessionContext() throws Exception {\n assertNotNull(\"The session context has to be set.\", invoiceSessionBean.getSessionContext());\n }", "private Session() {\n userId = -1;\n onUserDeletion = null;\n }", "@Override\r\npublic void sessionWillPassivate(HttpSessionEvent arg0) {\n\t\r\n}", "@Override\n\tpublic void setSession(Map<String, Object> arg0) {\n\t\tthis.session = arg0;\n\t\t\n\t}", "public abstract void setValue(ELContext context, Object value);", "@Override\n\tpublic void setSession(Map<String, Object> arg0) {\n\t\tthis.session = arg0;\n\t}", "@Override\n\tpublic UtenteBase getSessionUser() {\n\t\tUtenteBase user = (UtenteBase) getThreadLocalRequest().getSession().getAttribute(\"user\");\n\t\treturn user;\n\t}", "@Override\n\tpublic MemberVO getSession() {\n\t\treturn null;\n\t}", "@Override\n\tpublic void setSession(Map<String,Object> mySession) {\n\t\tthis.mySession = mySession;\n\t}", "public void setSession(Map<String, Object> session)\r\n\t{\n\t\tthis.session = session;\r\n\t}", "@Override\n\tpublic void setSession(Map<String, Object> arg0) {\n\t\t\n\t}", "@Override\n\tpublic void setSession(Map<String, Object> arg0) {\n\t\t\n\t}", "@Override\n @Test(groups = {\"SessionContext access\"})\n public void testSessionContext01() throws Exception {\n super.testSessionContext01();\n }", "protected abstract SESSION getThisAsSession();", "protected Session getCurrentSession() {\n\t\treturn sessionFactory.getCurrentSession();\n\t}", "protected Session getCurrentSession() {\n\t\treturn sessionFactory.getCurrentSession();\n\t}", "public void setSession(Map<String, Object> session) {\n\t\t\n\t}", "@Override\n\tpublic Void setContext(Context context) {\n\t\treturn null;\n\t}", "@Override\n\tpublic void setSession(Map<String, Object> map) {\n\t\tthis.session=map;\n\t\t\n\t}", "@Override\r\n\tpublic void setSession(Map<String, Object> map) {\r\n\t\t sessionMap=(SessionMap<String, Object>)map;\r\n\t\t\r\n\t}", "public LocalSession session() { return session; }", "public void setSession(Session session) {\n\t\tthis.session = session;\n\t}", "@Override\n\tpublic void setSession(Map<String, Object> s) {\n\t\tsession = s;\n\t}", "@Override\r\n\tpublic HttpSession getSession()\r\n\t{\r\n\t\t// This method was implemented as a workaround to __CR3668__ and Vignette Support ticket __247976__.\r\n\t\t// The issue seems to be due to the fact that both local and remote portlets try to retrieve\r\n\t\t// the session object in the same request. Invoking getSession during local portlets\r\n\t\t// processing results in a new session being allocated. Unfortunately, as remote portlets\r\n\t\t// use non-WebLogic thread pool for rendering, WebLogic seems to get confused and associates\r\n\t\t// the session created during local portlet processing with the portal request.\r\n\t\t// As a result none of the information stored originally in the session can be found\r\n\t\t// and this results in errors.\r\n\t\t// To work around the issue we maintain a reference to original session (captured on the\r\n\t\t// first invocation of this method during the request) and return it any time this method\r\n\t\t// is called. This seems to prevent the issue.\r\n\t\t// In addition, to isolate SPF code from the session retrieval issue performed by Axis\r\n\t\t// handlers used during WSRP request processing (e.g. StickyHandler), we also store\r\n\t\t// a reference to the session as request attribute. Newly added com.hp.it.spf.wsrp.misc.Utils#retrieveSession\r\n\t\t// can then use the request attribute value instead of calling request.getSession()\r\n\t\t// which before this change resulted in new session being allocated and associated with\r\n\t\t// the portal request.\r\n\r\n\t\tif (mSession == null) {\r\n\t\t\tmSession = ((HttpServletRequest)getRequest()).getSession();\r\n\r\n\t\t\t// Store session in request attribute for com.hp.it.spf.wsrp.misc.Utils#retrieveSession\r\n\t\t\tgetRequest().setAttribute(ORIGINAL_SESSION, mSession);\r\n\t\t}\r\n\r\n\t\treturn mSession;\r\n\t}", "@Override\r\npublic void valueBound(HttpSessionBindingEvent arg0) {\n\t\r\n}", "public Session getSession() {\n return session;\n }", "@Override\n\tpublic Session getSession() throws Exception {\n\t\treturn null;\n\t}", "private UserID getCurrentUser()\n\t{\n\t return (UserID)request.getSession().getAttribute(\"userID\");\n\t}", "public void setSession(Session session)\n\t{\n\t\tm_Session = session;\n\t}", "@Override\n\tpublic void setSession(Map<String, Object> map) {\n\t\tsessionMap=(SessionMap<String, Object>) map;\n\t}", "public void setToSession(ToSession toSession, Object o) {\n if (!aweSessionObjectFactory.getObject().hasParameter(toSession.name()) || toSession.overrideIfExist()) {\n aweSessionObjectFactory.getObject().setParameter(toSession.name(), o);\n }\n }", "Session begin();", "public void sessionStarted() {\n\t\t\r\n\t}", "public void setSession(CATermSession session) {\n this.session = session;\n }", "public String getSession() {\n return this.session;\n }", "@Override\n\tpublic void setContext(Context pContext) {\n\n\t}", "public void setSessionCounter(long sessionCounter);", "public Session getCurrentSession() {\r\n return sessionFactory.getCurrentSession();\r\n }", "Session decorate(Session session);", "private void updateSessionCounter(HttpSessionEvent httpSessionEvent){\n httpSessionEvent.getSession().getServletContext()\r\n .setAttribute(\"activeSession\", counter.get());\r\n LOG.info(\"Total active session are {} \",counter.get());\r\n }", "public void setSecurityContext() {\n ctx = SecurityContextHolder.getContext();\n SecurityContextHolder.getContext();\n final Authentication authentication = ctx.getAuthentication();\n setName(authentication.getName()); //NOPMD\n }", "public void setCurrentSession(Session session){\n if(currentSession == null){\n currentSession = new MutableLiveData<>();\n }\n Log.i(\"VIewModelSessions\", \"setting current session\");\n currentSession.setValue(session);\n Log.i(\"ViewModelSessions\", \"current session: \"+session.toString());\n }", "@Override\n\tpublic Session getSession(String appKey,String contextpath, String sessionid) {\n\t\tSession session = this.sessionStore.getSession(appKey, contextpath, sessionid);\n\t\tif(session != null)\n\t\t\tsession._setSessionStore(this);\n\t\treturn session;\n\t}", "@Override\r\n\t\t\tprotected void restoreContext() {\n\t\t\t\t\r\n\t\t\t}", "private Session getSession() {\n\t\treturn factory.getCurrentSession();\n\t}", "public void sessionCreated(HttpSessionEvent httpSessionEvent) {\r\n System.out.println(\"sessionCreated method has been called in \"\r\n + this.getClass().getName());\r\n\r\n totalUserCount++;\r\n currentUserCount++;\r\n\r\n ctx = httpSessionEvent.getSession().getServletContext();\r\n\r\n ctx.setAttribute(\"totalusers\", totalUserCount);\r\n ctx.setAttribute(\"currentusers\", currentUserCount);\r\n\r\n }", "public Session session() {\n return session;\n }", "public SessionParameters () {\n\t\tsuper();\n\t\tlocale = Locale.getDefault();\n\t\tcustomDictionaries = new HashSet<>();\n\t}", "private void setConsumerSession(HttpServletRequest request, String consumerSession) {\n HttpSession session = request.getSession(true);\n session.setAttribute(USER_ATTR, consumerSession);\n }", "@Override\n public Session getSession() throws SQLException {\n // If we don't yet have a live transaction, start a new one\n // NOTE: a Session cannot be used until a Transaction is started.\n if (!isTransActionAlive()) {\n sessionFactory.getCurrentSession().beginTransaction();\n configureDatabaseMode();\n }\n // Return the current Hibernate Session object (Hibernate will create one if it doesn't yet exist)\n return sessionFactory.getCurrentSession();\n }", "public void setResult(final Object value)\n\t{\n\t\tsetResult( getSession().getSessionContext(), value );\n\t}", "public Session getCurrentSession() {\r\n return sessionFactory.getCurrentSession();\r\n }", "@Override\n\tpublic void setSession(Map<String, Object> arg0) {\n\t\tmap=arg0;\n\t\t\n\t\t\n\t}", "public void __setDaoSession(DaoSession daoSession) {\n this.daoSession = daoSession;\n myDao = daoSession != null ? daoSession.getSaleOrderReduceDao() : null;\n }", "Session getSession();", "Session getSession();" ]
[ "0.68018293", "0.65573734", "0.64271367", "0.6143757", "0.6093099", "0.60610753", "0.6056655", "0.5855892", "0.5821094", "0.5821094", "0.579492", "0.5769672", "0.57362086", "0.57307273", "0.5692915", "0.56885064", "0.5680264", "0.5667033", "0.56635755", "0.56519556", "0.5651408", "0.5651408", "0.56498224", "0.5625221", "0.56198645", "0.5611507", "0.5611507", "0.5599235", "0.55962086", "0.55960524", "0.5577393", "0.5576183", "0.5556754", "0.55390996", "0.55197126", "0.5513015", "0.55094975", "0.5503816", "0.5489015", "0.5487579", "0.5479715", "0.54782647", "0.5459929", "0.54569584", "0.5453184", "0.5450193", "0.5447295", "0.54429966", "0.5442821", "0.5431684", "0.5426027", "0.5419877", "0.5406996", "0.5394123", "0.5376734", "0.5374534", "0.5374534", "0.53717166", "0.53656805", "0.5341472", "0.5341472", "0.53216016", "0.5315596", "0.528393", "0.528251", "0.5281877", "0.52659357", "0.52563405", "0.52396774", "0.5224324", "0.52234995", "0.5212945", "0.52046484", "0.5204411", "0.5194046", "0.5183581", "0.51755756", "0.51751816", "0.5175048", "0.5168589", "0.5167647", "0.5157122", "0.51519275", "0.5149747", "0.5147651", "0.5139073", "0.51364183", "0.51344985", "0.51331085", "0.51313996", "0.51238745", "0.51185685", "0.51104844", "0.51097256", "0.5107954", "0.5106378", "0.5103968", "0.5099529", "0.5094003", "0.5089618", "0.5089618" ]
0.0
-1
Getter/Setters for all private variables.
public int getRow() { return row; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private PropertyAccess() {\n\t\tsuper();\n\t}", "public void setPrivate()\n {\n ensureLoaded();\n m_flags.setPrivate();\n setModified(true);\n }", "protected void initVars() {}", "public Variables() {\n this.numCliente = 0;\n this.tiempoSalida = 999;\n }", "@Override\r\n\tpublic void initVariables() {\n\t\t\r\n\t}", "@Override\n public List<String> getVariables() {\n return super.getVariables();\n }", "@Test\r\n\tpublic void testGettersSetters()\r\n\t{\r\n\t\tPerson p = new Person(42);\r\n\t\tp.setDisplayName(\"Fred\");\r\n\t\tassertEquals(\"Fred\", p.getFullname());\r\n\t\tp.setPassword(\"hunter2\");\r\n\t\tassertEquals(\"hunter2\", p.getPassword());\r\n\t\tassertEquals(42, p.getID());\r\n\t}", "public int getx(){\r\n return z;\r\n}", "public int getAge(){\n return age;\n }", "public int geti(){\r\n return i;\r\n}", "public int getAge() {return age;}", "private GameVariableRepository() {\r\n\t\tthis.playerTurn = 0;\r\n\t}", "private void assignment() {\n\n\t\t\t}", "protected Value() {\n flags = 0;\n num = null;\n str = null;\n object_labels = getters = setters = null;\n excluded_strings = included_strings = null;\n functionPartitions = null;\n functionTypeSignatures = null;\n var = null;\n hashcode = 0;\n }", "public int getlife(){\r\n return life;\r\n}", "private GlobalPrefs() {\n\t\tprops = new Properties();\n\t}", "public int getAge()\r\n {\r\n return age;\r\n }", "public void setPublic()\n {\n ensureLoaded();\n m_flags.setPublic();\n setModified(true);\n }", "private void updateVars()\n {\n\n }", "public void printPrivateVariables() {\n NestedTest outerClass = new NestedTest();\n System.out.println(outerClass.private_member_variable);\n //System.out.println(private_member_variable);\n //System.out.println(private_member_variable);\n }", "public TradeVariables() { /*gets default values*/ }", "public FieldModifierPropertyEditor() {\n super(Modifier.PUBLIC | Modifier.PROTECTED | Modifier.PRIVATE | Modifier.STATIC |\n Modifier.FINAL | Modifier.TRANSIENT | Modifier.VOLATILE);\n }", "public void setupProperties() {\n // left empty for subclass to override\n }", "public int getAge()\n {\n return age;\n }", "public Set<Field> getFields() {\r\n \t\t// We will only consider private fields in the declared class\r\n \t\tif (forceAccess)\r\n \t\t\treturn setUnion(source.getDeclaredFields(), source.getFields());\r\n \t\telse\r\n \t\t\treturn setUnion(source.getFields());\r\n \t}", "public Object get()\n {\n return m_internalValue;\n }", "public void get() {\n }", "final void getData() {\n\t\t//The final method can't be overriden\n\t}", "private int getMY() {\n\t\treturn 0;\r\n\t}", "public int getx() {\n return x;\n }", "public void setAge(int age) { this.age = age; }", "public java.lang.Integer getVar43() {\n return var43;\n }", "public int getAge() {\r\n return age;\r\n }", "protected Map<String, String> getVarMap() {\n\t\treturn myVarMap;\n\t}", "public double getLoY() {\r\n\treturn fieldLoY;\r\n}", "public int Getx(){\n\t\treturn x;\n\t}", "private Get() {}", "private Get() {}", "protected HashSet getNoAccess(){\n return tester.noAccess;\n }", "@Test\n\tpublic void testGetters() {\n\t\tEngine engine = new Engine(20);\n\t\tCoordinate point = new Coordinate(5,5);\n\t\tCoordinate playerLocation = engine.getMoveableObject(0).getLocation();\n\t\tint playerX = playerLocation.getX();\n\t\tint playerY = playerLocation.getY();\n\t\tassertEquals(\"failure - didn't create coordinate x-val\", 5, point.getX(), 0.0);\n\t\tassertEquals(\"failure - didn't create coordinate y-val\", 5, point.getY(), 0.0);\n\t\tassertEquals(\"failure - didn't get player's x coordinate correctly\", 3, playerX, 0.0);\n\t\tassertEquals(\"failure - didn't get player's y coordinate correctly\", 3, playerY, 0.0);\n\t\t}", "@java.lang.Override\n public int getAge() {\n return age_;\n }", "int getVar() {\n\n return super.var; //Line n3. refer to its immediate parents variable of var\n }", "private void checkNoGettersSetters() {\n if (getters != null || setters != null)\n throw new AnalysisException(\"Unexpected getter/setter value!\");\n }", "private zzfl$zzg$zzc() {\n void var3_1;\n void var2_-1;\n void var1_-1;\n this.value = var3_1;\n }", "public int getMyInt() {\n return myInt;\n }", "@Override\n public void get() {}", "@Override\n public boolean isPrivate() {\n return true;\n }", "private void initVars(){\n this.dice = new Dice();\n this.playing = true;\n this.currentPlayer = 0;\n this.turn = 0;\n this.xPlayers=new ArrayList<>(); \n this.players = new Player[4];\n this.diceRoller=true;\n this.xTokens=new ArrayList<>();\n this.winners=new ArrayList<>();\n this.computerPlayer= new Autoplay();\n this.gameResults = \"\";\n this.debug = false;\n }", "public int getAge() {\n return age;\n }", "public int getAge() {\n return age;\n }", "public int getAge() {\n return age;\n }", "public int getAge() {\n return age;\n }", "public int getAge() {\n return age;\n }", "public int getAge() {\n return age;\n }", "public int getAge() {\n return age;\n }", "public int getAge() {\n return age;\n }", "@Override\n\t/**\n\t * returns the visibility modifiers for the specific class\n\t * \n\t * @return visibility modifiers \n\t */\n\tpublic String getVisability() {\n\t\treturn visability;\n\t}", "public java.lang.Integer getVar43() {\n return var43;\n }", "public java.lang.Integer getVar42() {\n return var42;\n }", "private void initFields() {\n\n tipPercent = 0.0;\n noPersons = 1;\n totalPay = 0.0;\n totalTip = 0.0;\n totalPerPerson = 0.0;\n\n }", "public String setter() {\n\t\treturn prefix(\"set\");\n\t}", "protected void fixateBindings()\r\n\t\t\t\tthrows IllegalArgumentException, IllegalAccessException,\r\n\t\t\t\tNoSuchFieldException, SecurityException {\n\t\t\tfor (Field field : getClass().getDeclaredFields()) {\r\n\t\t\t\t// relax private fields for reflection only\r\n\t\t\t\tfield.setAccessible(true);\r\n\t\t\t\t// search local -> global -> default for set value\r\n\t\t\t\tfield.set(this, evaluateField(field));\r\n\t\t\t}\r\n\t\t}", "public int getArmadura(){return armadura;}", "public void setdat()\n {\n }", "private void addInstanceVariables(ClassWriterTracker ct) {\n // variable #1, the state manager\n ct.getCw().visitField(Opcodes.ACC_PRIVATE | Opcodes.ACC_TRANSIENT,\n \"sm\", Type.getDescriptor(OpenJPAStateManager.class), null, null).visitEnd();\n\n // variable #2, the state manager\n ct.getCw().visitField(Opcodes.ACC_PRIVATE | Opcodes.ACC_TRANSIENT,\n \"field\", Type.getDescriptor(int.class), null, null).visitEnd();\n }", "public void testing() {\n\t\tprotectedInstanceVariable = \"\";\n\t}", "public double getHiY() {\r\n\treturn fieldHiY;\r\n}", "private UserPrefernce(){\r\n\t\t\r\n\t}", "public void setPrivate(Boolean isPrivate)\n {\n this.isPrivate = isPrivate;\n }", "Var getVar();", "@Test\n public void testSongGettersSetters() {\n Integer id = 4;\n String title=\"title\",uri = \"uri\";\n\n Song song = new Song();\n song.setId(id);\n song.setTitle(title);\n song.setUri(uri);\n\n assertEquals(\"Problem with id\",id, song.getId());\n assertEquals(\"Problem with title\",title, song.getTitle());\n assertEquals(\"Problem with uri\",uri, song.getUri());\n }", "public int getAge() {\n\t \t return age; \n\t}", "public void setX(int x) { this.x=x; }", "private String getSomePrivateInfo() {\r\n \treturn \"private information of MySubject\";\r\n }", "public int getAge() {\n return mAge;\n }", "double gety() {\nreturn this.y;\n }", "public int getNumber(){return number;}", "public java.lang.Integer getVar42() {\n return var42;\n }", "@Override\r\n\tpublic void get() {\n\t\t\r\n\t}", "@Test\n\tpublic static void testGetters() {\n\t\tCompoundMadeOfElementDTO idk = new CompoundMadeOfElementDTO(1, 3, 20);\n\t\tassertEquals(1, idk.getCompoundID());\n\t\tassertEquals(3, idk.getElementID());\n\t\tassertEquals(20, idk.getElementQuantity());\n\t}", "@Test\r\n\tpublic void gettersSettersTest() {\r\n\t\tItem item = new Item();\r\n\t\titem.setCount(NUMBER);\r\n\t\tassertEquals(item.getCount(), NUMBER);\r\n\t\titem.setDescription(\"word\");\r\n\t\tassertEquals(item.getDescription(), \"word\");\r\n\t\titem.setId(NUMBER);\r\n\t\tassertEquals(item.getId(), NUMBER);\r\n\t\titem.setName(\"word\");\r\n\t\tassertEquals(item.getName(), \"word\");\r\n\t\titem.setPicture(\"picture\");\r\n\t\tassertEquals(item.getPicture(), \"picture\");\r\n\t\titem.setPrice(FLOATNUMBER);\r\n\t\tassertEquals(item.getPrice(), FLOATNUMBER, 0);\r\n\t\titem.setType(\"word\");\r\n\t\tassertEquals(item.getType(), \"word\");\r\n\t\titem.setSellerId(NUMBER);\r\n\t\tassertEquals(item.getSellerId(), NUMBER);\r\n\t\titem.setDeleted(false);\r\n\t\tassertEquals(item.isDeleted(), false);\r\n\t\titem.setDeleted(true);\r\n\t\tassertEquals(item.isDeleted(), true);\t\t\r\n\t}", "public int getYearsOffice()\n {\n return yearsOffice;\n}", "private ReadProperty()\r\n {\r\n\r\n }", "public int getHp(){\r\n return hp;\r\n }", "public Set<ObjectLabel> getGetters() {\n if (getters == null)\n return Collections.emptySet();\n if (Options.get().isDebugOrTestEnabled())\n return Collections.unmodifiableSet(getters);\n return getters;\n }", "@Test\n public void t() throws Exception {\n TestAutow ta = new TestAutow();\n Class<? extends TestAutow> clazz = ta.getClass();\n Field[] fields = clazz.getDeclaredFields();\n Arrays.asList(fields).stream().forEach(System.out::println);\n System.out.println(ta.getI()+\":\"+ta.getStr());\n\n Field field_i=clazz.getDeclaredField(\"i\");\n //获得许可\n field_i.setAccessible(true);\n field_i.set(ta,7);\n System.out.println(ta.getI()+\":\"+ta.getStr());\n\n\n }", "@java.lang.Override\n public int getAge() {\n return age_;\n }", "public java.lang.Integer getVar19() {\n return var19;\n }", "@Test\n public void testGetters()\n {\n assertEquals(\"\",test.getPlayerName());\n assertEquals(\"UseCard\",test.toString());\n assertEquals(13,test.getCardID());\n }", "int getNumber () { return number; }", "private stendhal() {\n\t}", "public int getX(){return this.x;}", "double sety(double y) {\nreturn this.y;\n }", "public String getVar()\n {\n return var;\n }", "public int getLives(){return lives;}", "public final void resetSecurityVars() {\n String disable = getStr(\"DISABLE\");\n if (getVar(Str.MULTICLASS).equalsIgnoreCase(\"DISABLED\"))\n disable += \", CLASSES\";\n CMSecurity.setAnyDisableVars(disable);\n CMSecurity.setAnyEnableVars(getStr(\"ENABLE\"));\n CMSecurity.setDebugVars(getStr(\"DEBUG\"));\n CMSecurity.setSaveFlags(getStr(\"SAVE\"));\n }", "public final void setDefautlVals() {\n this.createTime = this.writeTime = GlobalMethods.getTimeStamp(null);\n this.createId = this.writeId = PackagingVars.context.getUser().getId();\n }", "public int getGameY(){return this.gameY;}", "public double getHiX() {\r\n\treturn fieldHiX;\r\n}", "public int getAge() {\n return this.age;\n }", "int getBlue(){\n\n return this.blue;\n }" ]
[ "0.60937804", "0.60911834", "0.60206866", "0.59100324", "0.5835575", "0.5683373", "0.5680681", "0.5631033", "0.5573536", "0.5557313", "0.55498976", "0.55481064", "0.55374026", "0.5500488", "0.5485559", "0.54424435", "0.5429628", "0.5403689", "0.53998834", "0.5397976", "0.5372235", "0.53616905", "0.5328045", "0.5324662", "0.5321525", "0.5305063", "0.53026664", "0.5298879", "0.5287844", "0.5285372", "0.52628976", "0.5259264", "0.52576435", "0.5252285", "0.5244705", "0.52399457", "0.5238123", "0.5238123", "0.5237642", "0.5235145", "0.52294576", "0.5222441", "0.521969", "0.5217924", "0.52152014", "0.5215058", "0.5211845", "0.5206012", "0.5202524", "0.5202524", "0.5202524", "0.5202524", "0.5202524", "0.5202524", "0.5202524", "0.5202524", "0.5199098", "0.5196092", "0.51839215", "0.5183106", "0.5181844", "0.51753694", "0.516694", "0.51627094", "0.5162242", "0.51579", "0.51548934", "0.5152951", "0.5152419", "0.5151203", "0.51477885", "0.514263", "0.51408744", "0.5140684", "0.5140612", "0.51340127", "0.51293683", "0.511464", "0.51048714", "0.51017594", "0.50986654", "0.50863856", "0.5086266", "0.50794905", "0.50693077", "0.506703", "0.5057243", "0.5049951", "0.5047638", "0.5040605", "0.50403166", "0.5039453", "0.50373125", "0.50314623", "0.50314015", "0.50284964", "0.5025437", "0.5025425", "0.5025074", "0.5018926", "0.50135916" ]
0.0
-1
Return the next prism, if the laser hits a prism. Else this will return null.
public Prism getNext() { return next; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Area findBestNext(boolean type) {\n\t\tArea next = null;\n\t\tif (type) { // then current\n\t\t\tfor (Edge e : this.getPoly().getEdges()) {\n\t\t\t\tif (intersects(this.currents, e)) {\n\t\t\t\t\tif (this.getPoly() == e.getLeftSite().getPoly()) {\n\t\t\t\t\t\tnext = e.getRightSite().getPoly().getArea();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnext = e.getLeftSite().getPoly().getArea();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor (Edge e : this.getPoly().getEdges()) {\n\t\t\t\tif (intersects(this.winds, e)) {\n\t\t\t\t\tif (this.getPoly() == e.getLeftSite().getPoly()) {\n\t\t\t\t\t\treturn e.getRightSite().getPoly().getArea();\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn e.getLeftSite().getPoly().getArea();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (next == null) {\n\t\t\treturn null;\n\t\t}\n\t\tif (next.isOcean()) {\n\t\t\treturn next;\n\t\t}\n\t\tfor (Area a : this.getAdjacencies()) {\n\t\t\tif (a.isOcean()) {\n\t\t\t\treturn a;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\n\t}", "public NonTerminal getNextNonTerminal() {\n\t\tif (marker < getRhs().length && getRhs()[marker] instanceof NonTerminal)\n\t\t\treturn (NonTerminal) getRhs()[marker];\n\t\telse\n\t\t\treturn null;\n\t}", "public Processo next() {\n Node temp = first;\n if (first == null) {\n last = null;\n }\n return temp.processo;\n }", "public Cerradura next() {\n\t\tfor (Cerradura cerradura : cerraduras) {\n\t\t\tif (!cerradura.isProcess()) {\n\t\t\t\treturn cerradura;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public PlayerPosition getNext() {\n\n\t\tswitch (this) {\n\t\t\tcase BOTTOM:\n\t\t\t\treturn LEFT;\n\t\t\tcase LEFT:\n\t\t\t\treturn TOP;\n\t\t\tcase TOP:\n\t\t\t\treturn RIGHT;\n\t\t\tcase RIGHT:\n\t\t\t\treturn BOTTOM;\n\t\t\tdefault:\n\t\t\t\t// must not happen\n\t\t\t\treturn null;\n\t\t}\n\t}", "public Planet getPlanetForPerson(Person nextPerson) {\n if (nextPerson == null) {\n return null;\n }\n String prefer = nextPerson.getPlanetPreference();\n if (this.getPlanetIndex(prefer) != -1 && this.canAccept(planets[this\n .getPlanetIndex(prefer)], nextPerson) &&\n !planets[this.getPlanetIndex(prefer)].isFull()) {\n return planets[this.getPlanetIndex(prefer)];\n }\n\n else if ((prefer == null || this.getPlanetIndex(prefer) == -1) && this\n .canAccept(this.getHighestCapacityPlanet(nextPerson), nextPerson)) {\n return this.getHighestCapacityPlanet(nextPerson);\n\n }\n\n return null;\n }", "public Plane<?> currentTakeOfPlane() {\r\n\r\n for(int n = 0; n < runways.size(); n++ ) {\r\n\r\n if(runways.get(position).isEmpty()) {\r\n\r\n position = (position + 1) % runways.size();\r\n }\r\n else {\r\n return runways.get(position).peekRunway();\r\n }\r\n }\r\n\r\n return null;\r\n }", "public Alloc getPredecessor() {\n return variant == null ? null : variant.getPredecessor(this);\n }", "public Rail getNextRail(Rail previous, Train_Element t) {\n\n // ha nincs alagút, vagy épp vonat van az alagútban, sínként funkcionál\n if (Map.getIsTrainInTunnel() || tunnelRail == null) {\n if (previous == prevRail)\n return nextRail;\n\n // Kilépés az alagútszájon:\n else if (previous == tunnelRail) {\n t.setVisible(true);\n Map.setIsTrainInTunnel(false);\n if (dir.equals(\"next\")) {\n return prevRail;\n }\n else {\n return nextRail;\n }\n }\n else\n return prevRail;\n }\n\n\n // ha van alagút és üres is, a vonat belép\n else if (!Map.getIsTrainInTunnel() && tunnelRail != null) {\n\n // ha megfelelő irányból jövünk, behajtunk az alagútba\n if (previous == prevRail) {\n if (dir.equals(\"next\")) {\n t.setVisible(false); // alagútba behajtás: vonaton jelezzük a visible változóval \n Map.isTrainInTunnel = true;\t\t\t\t\t\t\t // map-nek jelezzük static beállításával\n return tunnelRail;\n } else\n return nextRail;\n }\n\n else if (previous == nextRail) {\n if (dir.equals(\"prev\")) {\n t.setVisible(false);\n Map.setIsTrainInTunnel(true);\n return tunnelRail;\n } else {\n return prevRail;\n }\n }\n\n\n // ha az alagútból hajtunk kifelé:\n else {\n\n t.setVisible(true);\n Map.setIsTrainInTunnel(false);\n if (dir.equals(\"next\")) {\n return prevRail;\n }\n else {\n return nextRail;\n }\n }\n }\n System.out.println(\"Error with the tunnel entrance\");\n return null;\n }", "public GJPoint2D firstPoint() {\n\t\tif (this.segments.isEmpty()) \n\t\t\treturn null;\n\t\treturn this.segments.get(0).controlPoints()[0];\n\t}", "@Override\n\tpublic Point estTraversePar(Rayon r) {\n\t\tassert r != null;\n\t\tint i, indice;\n\t\tdouble distanceMin = 0.0;\n\t\tPoint point;\n\t\tPoint pointReturn = null;\n\t\t\n\t\tfor (i = 0; i<6; i++) {\n\t\t\tpoint = this.plans.get(i).estTraversePar(r);\n\t\t\tindice = this.appartientCube(point);\n\t\t\t\n\t\t\tif (point != null & indice != -1) {\n\t\t\t\tif ((distanceMin > point.distance(r.getOrigine()) | distanceMin < Objet3D.EPSILON) ) {\n\t\t\t\t\tpointReturn = point.copie();\n\t\t\t\t\tdistanceMin = pointReturn.distance(r.getOrigine());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn pointReturn;\n\t}", "public\t\tMiPart\t\tgetNext()\n\t\t{\n\t\tMiPart obj = null;\n\t\tdo\t{\n\t\t\tobj = iterator.getNext();\n\t\t\twhile (obj == null)\n\t\t\t\t{\n\t\t\t\tif (!hasLayers)\n\t\t\t\t\treturn(null);\n\t\t\t\tif (!iterateThroughAllLayers)\n\t\t\t\t\treturn(null);\n\t\t\t\tMiContainerIterator iter = getNextIterator();\n\t\t\t\tif (iter == null)\n\t\t\t\t\treturn(null);\n\t\t\t\titerator = iter;\n\t\t\t\tobj = iterator.getNext();\n\t\t\t\t}\n\t\t\t} while ((filter != null) && ((obj = filter.accept(obj)) == null));\n\n\t\treturn(obj);\n\t\t}", "public Wagon<T> getNext() {\n\t\treturn next;\n\t}", "public Object getNext() {\n\t\tif (current != null) {\n\t\t\tcurrent = current.next; // Get the reference to the next item\n\t\t}\n\t\treturn current == null ? null : current.item;\n\t}", "@Override\r\n\t\tpublic Package next() {\r\n\t\t\tif (first.next == null)\r\n\t\t\t\treturn null;\r\n\t\t\telse\r\n\t\t\t\treturn first.next;\r\n\r\n\t\t}", "public SlideNode getNext() {\n\t\treturn next;\n\t}", "@Override\n public NodoL next() {\n posicionActual = posicionActual.getSiguiente();\n return posicionActual;\n }", "public Product getNextProduct() {\n\t\tif (!getProducts().isEmpty()) {\n\t\t\tProduct retProduct = getProducts().get(0);\n\t\t\tgetProducts().remove(0);\n\t\t\treturn retProduct;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "@Override\n\tpublic TC getProchain() {\n\t\t// TODO Auto-generated method stub\n\t\tif (!estVide()) {\n\t\t\tfor (int i = maxPrio-1; i>=0; i--) {\n\t\t\t\tif (salle.get(i).size()!=0) {\n\t\t\t\t\treturn salle.get(i).get(0);\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public gov.nih.nlm.ncbi.www.SeqIdDocument.SeqId.Pir getPir()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n gov.nih.nlm.ncbi.www.SeqIdDocument.SeqId.Pir target = null;\r\n target = (gov.nih.nlm.ncbi.www.SeqIdDocument.SeqId.Pir)get_store().find_element_user(PIR$12, 0);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target;\r\n }\r\n }", "@Override\n\t\tpublic String next() {\n\t\t\tString ret=null;\n\t\t\twhile(!this.stack.isEmpty() && localRoot!=null){\n\t\t\t\n\t\t\t}\n\t\t\treturn null ;\n\t\t}", "public BSCObject next()\n {\n if (ready_for_fetch)\n {\n // the next sibling is waiting to be returned, so just return it\n ready_for_fetch = false;\n return sibling;\n }\n else if (hasNext())\n {\n // make sure there is a next sibling; if so, return it\n ready_for_fetch = false;\n return sibling;\n }\n else\n throw new NoSuchElementException();\n }", "public Site nextone() {\r\n\t\tSite s;\r\n\t\tif (siteidx < nsites) {\r\n\t\t\ts = sites[siteidx];\r\n\t\t\tsiteidx += 1;\r\n\t\t\treturn (s);\r\n\t\t} else\r\n\t\t\treturn null;\r\n\t}", "public T getPater(T target) {\r\n int index = getIndex(target);\r\n if (index * 2 + 1 >= SIZE) {\r\n return null;\r\n } else if (tree[index * 2 + 1] == null) {\r\n return null;\r\n } else {\r\n return tree[index * 2 + 1];\r\n }\r\n }", "private myPoint getNextRoute(){\n\t\ttry {\n\t\t\treturn this.Route.take();\n\t\t} catch (InterruptedException e) {\n\t\t\treturn null;\n\t\t}\n\t}", "public Step getNextStep(Vector steps) {\r\n\t\tfor(int i = 0; i < steps.size()-1; i++) {\r\n\t\t\tStep stp1 = (Step) steps.get(i);\r\n\t\t\tMessages ifMex = stp1.getMex();\r\n\t\t\tFragment ifComp = ifMex.getPather();\r\n\t\t\tStep stp2 = (Step) steps.get(i+1);\r\n\t\t\tMessages elseMex = stp2.getMex();\r\n\t\t\tFragment elseComp = elseMex.getPather();\r\n\t\t\tif(/* this.equals(stp1) && */!this.equals(stp2)) {\r\n\t\t\t\t\r\n\t\t\t\tif(elseComp==null)\r\n\t\t\t\t\treturn stp2;\r\n\t\t\t//devo controllare se stp2 si trova in un else del padre\r\n\t\t\t\tif(!elseComp.checkIfElseIsOfParent(ifComp, elseMex.getRoot())) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(elseComp.fragFather.getName().equals(\"region\"))\r\n\t\t\t\t\t\treturn new Step(new Instance(\"\"), new Instance(\"Fork\"), new Messages(\"Fork\"));\r\n\t\t\t\t return stp2;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public Node<T> next(int level)\r\n {\r\n if(level >= height || level < 0) //If trying to access area out of bounds. \r\n return null;\r\n \r\n return pointers.get(level);\r\n }", "public Object peek() {\n if (top >= 0) {\n return stack[top];\n }\n else {\n return null;\n }\n }", "public CrossRoad getNextIntermediateDestination()\n\t{\n\t\treturn this.getHead().getIntermediate();\n\t}", "public PhysicianParc getSelectedPhysician() {\n if (nextPhysicianAvailableCheckbox.isChecked()) {\n return null;\n }\n\n // iterate the radio-buttons and get the selected physician\n for (int i = 0; i < nearbyPhysicianRadioButtonList.size(); i++) {\n if (nearbyPhysicianRadioButtonList.get(i).isChecked()) {\n return nearbyPhysicianList.get(i);\n }\n }\n\n // no physician was selected and the checkbox was not selected\n // -> handle as if the checkbox is selected\n return null;\n }", "public Player getLoser() {\n\t\treturn getLeader() == player1 ? player2 : player1;\n\t}", "private Line getMiddleTrajectory() {\n Point startPoint;\n if (movingRight()) {\n startPoint = middleRight();\n } else if (movingLeft()) {\n startPoint = middleLeft();\n } else {\n return null;\n }\n\n return new Line(startPoint, this.velocity);\n }", "public E next()\n {\n removeLevelIfEmpty();\n if (noLevelsExist()) {\n return null;\n }\n return popNextObject();\n }", "public BLine2D\ngetFivePrimeRay()\nthrows Exception\n{\n\tif (this.lastNuc2D() == null)\n\t\treturn (null);\n\treturn (new BLine2D(\n\t\tthis.getPoint2D(),\n\t\tthis.lastNuc2D().getPoint2D()));\n}", "private Sector getNext(){\n\t\tif(sectors.size() == 0){\n\t\t\treturn null;\n\t\t} \n\t\tSector sector = sectors.get(0);\n\t\tsectors.remove(0);\n\t\treturn sector;\t\n\t}", "public Waypoint getNextWaypoint() {\n if (waypoints.isEmpty()) {\n return null;\n } else {\n Waypoint waypoint = waypoints.remove(0);\n return waypoint;\n }\n }", "@Nonnull\n public Optional<ENTITY> peekNext()\n {\n return hasNext() ? Optional.of(items.get(index + 1)) : Optional.empty();\n }", "@Override\n\tpublic BerylliumSphere next() {\n\t\treturn new BerylliumSphere();\n\t}", "public Variable getNext(){\n\t\treturn this.next;\n\t}", "private IAVLNode findPredecessor(IAVLNode node)\r\n\t{\r\n\t\t//minimum node has no predecessor\r\n\t\tif (node == minimum) \r\n\t\t\treturn null; \r\n\t\t\r\n\t\tif (node.getLeft().isRealNode()) \r\n\t\t\treturn maxPointer(node.getLeft()); \r\n\t\telse \r\n\t\t{\r\n\t\t\tIAVLNode parent = node.getParent();\r\n\t\t\twhile ((node == parent.getLeft())&&(parent != null)) \r\n\t\t\t{ \r\n\t\t\t\tnode = parent; \r\n \t\t\t\tparent = parent.getParent() ; \r\n\t\t\t}\r\n\t\t\treturn parent;\t\r\n\t\t}\r\n\t}", "public INavigationProcessor getNavigationProcessor() {\n \t\tif (navigationProcessor != null) {\n \t\t\treturn navigationProcessor;\n \t\t} else if (getParent() != null) {\n \t\t\treturn getParent().getNavigationProcessor();\n \t\t} else if (ApplicationNodeManager.getApplicationNode() != null) {\n \t\t\t// if no navigation processor was found in the hierarchy, maybe the application node has one\n \t\t\treturn ApplicationNodeManager.getApplicationNode().getNavigationProcessor();\n \t\t} else {\n \t\t\t// if nobody ha a navigation processor, return the default navigation processor\n \t\t\treturn ApplicationNodeManager.getDefaultNavigationProcessor();\n \t\t}\n \t}", "@Nonnull\n public Optional<ENTITY> next()\n {\n currentItem = Optional.of(items.get(++index));\n update();\n return currentItem;\n }", "public CollisionInfo getClosestCollision(Line trajectory) {\r\n // check if there is a core.Collidable objects.\r\n if (this.collidObj.isEmpty()) {\r\n return null;\r\n }\r\n List<Collidable> collisobj = new ArrayList<Collidable>();\r\n int counter = 0;\r\n // Make a copy of the Sprite before iterating over them.\r\n List<Collidable> collidables = new ArrayList<Collidable>(this.collidObj);\r\n // create a List of collision Colidable.\r\n for (Collidable c : collidables) {\r\n if (trajectory.closestIntersectionToStartOfLine(c.getCollisionRectangle()) != null) {\r\n collisobj.add(c);\r\n }\r\n }\r\n if (collisobj.size() == 0) {\r\n return null;\r\n // if there is just one collision.\r\n } else if (collisobj.size() == 1) {\r\n Rectangle r = (collisobj.get(0)).getCollisionRectangle();\r\n return new CollisionInfo(trajectory.closestIntersectionToStartOfLine(r), collisobj.get(0));\r\n // else search the closet collision.\r\n } else {\r\n return searchClosetCollision(collisobj, trajectory);\r\n }\r\n }", "public V getOriginator() {\r\n\r\n\t\tV result = null;\r\n\t\tif ((counter <= links.size()) && (counter > 0)) {\r\n\t\t\tresult = predNodes.get(counter - 1);\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public LinearNode<T> getNext() {\r\n\t\t\r\n\t\treturn next;\r\n\t\r\n\t}", "public ShapeNode getNext()\n {\n return next;\n }", "public Disc top()\n\t{\n\t\tint poleSize = pole.size();\n\n\t\t// If the pole is empty, return nothing\n\t\tif(poleSize == 0)\n\t\t\treturn null;\n\n\t\t// Otherwise return the top disc\n\t\treturn pole.get(poleSize - 1);\n\t}", "public TaskStack getSplitScreenPrimaryStack() {\n TaskStack stack = this.mTaskStackContainers.getSplitScreenPrimaryStack();\n if (stack == null || !stack.isVisible()) {\n return null;\n }\n return stack;\n }", "protected D getNextOrSame(D d) {\n\t\t\tD next = getNext(d);\n\t\t\tif (next == null) {\n\t\t\t\treturn d;\n\t\t\t}\n\t\t\treturn next;\n\t\t}", "@Override\n public MFEDirection next()\n {\n if (!this.isPathValid()) {\n String msg = \"Annotated Path\" + this.getStart().getLocation() + \"->\" +\n this.getGoal().getLocation() + \": Cannot get next step \" +\n \"when path is invalid.\";\n logger.severe(msg);\n throw new IllegalStateException(msg);\n }\n final MFEDirection dir = this.path.poll();\n\n if (dir == null) {\n String msg = \"Annotated Path \" + this.getStart().getLocation() + \"->\" +\n this.getGoal().getLocation() + \": No more steps.\";\n logger.severe(msg);\n throw new NoSuchElementException(msg);\n }\n\n return dir;\n }", "public Pageable next() {\n\t\t\t\treturn null;\r\n\t\t\t}", "public CollisionInfo getClosestCollision(Line trajectory) {\n Collidable tempCollidable = null;\n Point p;\n Point temp = null;\n boolean first = true;\n for (Collidable c : collidables) {\n p = trajectory.closestIntersectionToStartOfLine(c.getCollisionRectangle());\n if (first && p != null) {\n temp = p;\n first = false;\n tempCollidable = c;\n }\n if (!first && p != null && p.distance(trajectory.start()) < temp.distance(trajectory.start())) {\n temp = p;\n tempCollidable = c;\n }\n }\n if (temp != null) {\n return new CollisionInfo(temp , tempCollidable);\n } else {\n return null;\n }\n }", "public DependencyElement next() {\n\t\treturn next;\n\t}", "public ListNode<Item> getNext() {\n return this.next;\n }", "public GameObject getNext() {\n\t\t\tpointerIndex++;\n\t\t\treturn(gameObjects.elementAt(pointerIndex));\n\t\t}", "public Viseme getNextViseme();", "private double volumeTriangularPrism() {\n if (!isRealFigure()) {\n return -1;\n }\n //When the triangular prism is real\n return areaFigure() * getD();\n }", "@Override public T next() {\n T elem = null;\n if (hasNext()) {\n Nodo<T> nodo = pila.pop();\n elem = nodo.elemento;\n nodo = nodo.derecho;\n while(nodo != null){\n pila.push(nodo);\n nodo = nodo.izquierdo;\n }\n return elem;\n }\n return elem;\n }", "public CardNode peek() {\n\t\treturn cardPathCollection.get(cardPathCollection.size());\n\t}", "public E next() \n {\n \tfor(int i = 0; i < size; i++)\n \t\tif(tree[i].order == next) {\n \t\t\tnext++;\n \t\t\ttree[i].position = i;\n \t\t\treturn tree[i].element;\n \t\t}\n \treturn null;\n }", "protected Diagram getDiagramToOpen() {\n\t\t\t\tIGraphicalEditPart grahicalHostEditPart = (IGraphicalEditPart) getHost();\n\t\t\t\tEObject element = grahicalHostEditPart.resolveSemanticElement();\n\t\t\t\tList<Diagram> diagramL = MultiDiagramUtil\n\t\t\t\t\t\t.getDiagramsAssociatedToElement(element);\n\n\t\t\t\tif (diagramL.isEmpty()) {\n\t\t\t\t\treturn null;\n\t\t\t\t} else if (diagramL.size() == 1) {\n\t\t\t\t\treturn diagramL.get(0);\n\t\t\t\t}\n\n\t\t\t\tElementListSelectionDialog dialog = new ElementListSelectionDialog(\n\t\t\t\t\t\tPlatformUI.getWorkbench().getActiveWorkbenchWindow()\n\t\t\t\t\t\t\t\t.getShell(), new GeneralLabelProvider());\n\t\t\t\tdialog.setMessage(\"Select the diagram to be opened\");\n\t\t\t\tdialog.setTitle(\"Diagram selection\");\n\t\t\t\tdialog.setElements(diagramL.toArray());\n\t\t\t\tif (dialog.open() == Dialog.OK) {\n\t\t\t\t\treturn (Diagram) dialog.getFirstResult();\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}", "public BLine2D\ngetThreePrimeRay()\nthrows Exception\n{\n\tif (this.nextNuc2D() == null)\n\t\treturn (null);\n\treturn (new BLine2D(\n\t\tthis.getPoint2D(),\n\t\tthis.nextNuc2D().getPoint2D()));\n}", "@Override\n\tpublic Item next() {\n\t\tindex = findNextElement();\n\n\t\tif (index == -1)\n\t\t\treturn null;\n\t\treturn items.get(index);\n\t}", "public E getNext() {\n\t\tif (!super.isEmpty()) {\n\t\t\tif (index >= this.size() - 1)\n\t\t\t\tindex = -1;\n\t\t\treturn this.get(++index);\n\t\t}\n\t\treturn null;\n\t}", "@Override\r\n\t\tpublic Node getNextSibling()\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}", "public Player getNext(){\n\t\treturn this.players.get(this.nextElem);\n\t}", "protected Projector getBestVerticalProjector() {\n return _bvp;\n }", "public Pixel next() {\n\t\treturn (isEmpty()) ? null : iterator().next();\n\t}", "@Override\r\n\tpublic VertexInterface<T> getPredecessor() {\n\t\treturn null;\r\n\t}", "public synchronized Procedure getNext() {\n\t\tif (!this.hasNext())\n\t\t\treturn null;\n\n\t\tif(!firstOrderCandidates.isEmpty()) {\n\t\t\tProcedure procId = selectProcedureAndRemove(/*firstOrderCandidates*/);\n\n\t\t\tModuleStat stat = getModuleStat(procId.getModuleId());\n\t\t\tapplyCandidate(procId, stat, true);\n\t\t\treturn procId;\n\t\t}\n\t\t\n\t\t//if(order.hasNext() && candidates.size()<max_candidates_size) {\n\t\t//\tcandidates.addAll(order.getNexts(max_candidates_size-candidates.size()));\n\t\t//}\n\t\t\t\n\t\twhile(order.hasNext() && candidatesSize<max_candidates_size) {\n\t\t\tProcedure next = order.getAnyNext();\n\t\t\taddCandidate(next);\n\t\t}\n\t\t\n\t\tModule bestModule = getBestModuleId(modules.keySet());\n\t\t//IRModuleId bestModule = getBestModuleId(candidates.keySet());\n\t\t\n\t\t//if(bestModule==null) {\n\t\t//\tbestModule = candidates.keySet().iterator().next();\n\t\t//}\n\t\t\n\t\tif(bestModule!=null) {\n\t\t\tIterator<Procedure> it = order.getNextOfModule(bestModule);\n\t\t\twhile(it.hasNext()) {\n\t\t\t\tProcedure next = it.next();\n\t\t\t\taddCandidate(next);\n\t\t\t}\t\n\t\t}\n\t\t\n\t\tSet<Procedure> procedures = bestModule==null?\n\t\t\t\tCollections.<Procedure>emptySet() : candidates.get(bestModule);\n\t\t\n\t\tif(procedures.isEmpty()){\n\t\t\tbestModule = getBestModuleId(candidates.keySet());\n\t\t\t\n\t\t\tif(bestModule==null) {\n\t\t\t\tbestModule = candidates.keySet().iterator().next();\n\t\t\t}\n\t\t\t\n\t\t\t{\n\t\t\t\tIterator<Procedure> it = order.getNextOfModule(bestModule);\n\t\t\t\twhile(it.hasNext()) {\n\t\t\t\t\tProcedure next = it.next();\n\t\t\t\t\taddCandidate(next);\n\t\t\t\t}\t\n\t\t\t}\n\t\t\t\n\t\t\tprocedures = candidates.get(bestModule);\n\t\t}\n\t\t\n\t\tIterator<Procedure> it = procedures.iterator();\n\t\tassert(it.hasNext());\n\t\t\n\t\tProcedure nextProc = it.next();\n\t\t\n\t\tModuleStat stat = getModuleStat(bestModule);\n\t\t\n\t\tapplyCandidate(nextProc, stat, false);\n\t\t\n\t\tif(!stat.waitLoading()) {\n\t\t\twhile(it.hasNext()) {\n\t\t\t\tProcedure procId = it.next();\n\t\t\t\taddCandidate(procId);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn nextProc;\n\t}", "public Level getNext() {\n\t\treturn next;\n\t}", "public Protein getOtherProteine(Protein p) {\n\t\tif (p == p1) {\n\t\t\treturn p2;\n\t\t}\n\t\tif (p == p2) {\n\t\t\treturn p1;\n\t\t}\n\t\treturn null;\n\t}", "public java.lang.Object peek() {\n /*\n r3 = this;\n monitor-enter(r3);\n r0 = r3.queue;\t Catch:{ all -> 0x001b }\n if (r0 != 0) goto L_0x0008;\n L_0x0005:\n r0 = 0;\n monitor-exit(r3);\t Catch:{ all -> 0x001b }\n return r0;\n L_0x0008:\n r1 = r0.peek();\t Catch:{ all -> 0x001b }\n r2 = r3.terminalState;\t Catch:{ all -> 0x001b }\n if (r1 != 0) goto L_0x0019;\n L_0x0010:\n if (r2 == 0) goto L_0x0019;\n L_0x0012:\n r0 = r0.peek();\t Catch:{ all -> 0x001b }\n if (r0 != 0) goto L_0x0019;\n L_0x0018:\n r1 = r2;\n L_0x0019:\n monitor-exit(r3);\t Catch:{ all -> 0x001b }\n return r1;\n L_0x001b:\n r0 = move-exception;\n monitor-exit(r3);\t Catch:{ all -> 0x001b }\n throw r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: rx.internal.util.RxRingBuffer.peek():java.lang.Object\");\n }", "public Player nextMove() {\n\t\treturn null;\n\t\t\n\t}", "public IronDome findFreeIronDome() {\n\t\tfor (IronDome ironDome : ironDomeArr) {\n\t\t\tif (!ironDome.getIsBusy())\n\t\t\t\treturn ironDome;\n\t\t}\n\n\t\treturn null;\n\t}", "public GameObject getNext();", "public Point2d getNearestPointOnLine(final Point2d p){\n\n Vector2d orth = MathUtil.getOrthogonalDirection(direction);\n Line other = new Line (p, orth);\n\n Point2d cut = this.cut(other);\n\n if( cut == null){\n System.out.println(\"Line.getNearestPointOnLine failed!!\");\n System.out.println(\"big fail: line is\" + this.point + \"lambda*\" + this.direction + \"; point is: \"+p);\n }\n\n return cut;\n }", "public T next()\n {\n // TODO: implement this method\n return null;\n }", "public Solution next() {\n\t\tif (!checked)\n\t\t\tthrow new RuntimeException(\"Cannot use SolutionIterator.next() \" +\n\t\t\t\t\t\"before checking the hasNext() returned true\");\n\t\ttry {\n\t\t\tsolution = new Solution(solver, solutionNumber);\n\t\t\tsolution.setSolutionNumber(solutionNumber);\n\t\t\tsolutionNumber++;\n\t\t} catch (Failure e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t\tchecked = false;\n\t\treturn solution;\n\t}", "public org.landxml.schema.landXML11.Station xgetIntersectRoadwayPI()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.landxml.schema.landXML11.Station target = null;\r\n target = (org.landxml.schema.landXML11.Station)get_store().find_attribute_user(INTERSECTROADWAYPI$22);\r\n return target;\r\n }\r\n }", "private Process findClosestProcess(){\n\n //Ensure that the process queue is sorted by process ID for traversal.\n Collections.sort(this.unfinishedJobs,new PIDComparator());\n\n //If there was no process currently executing on the CPU,\n //the next process is simply the process queue's first item.\n if(this.activeJob == null){\n if(this.unfinishedJobs.size() > 0){\n return this.unfinishedJobs.get(0);\n } \n } else {\n\n //Find the first process with a higher process ID than the currently executing\n //process and set it as the new process to execute next.\n for(int i = 0; i < this.unfinishedJobs.size(); i++){\n Process temp = this.unfinishedJobs.get(i);\n if(temp.getPID() > this.activeJob.getPID()){\n return temp;\n }\n }\n\n //If there are no processes with a higher process ID than the current process, use the \n //process queue's first item as a default.\n if(this.unfinishedJobs.size() > 0){\n return this.unfinishedJobs.get(0);\n }\n }\n return null;\n }", "private IAVLNode findSuccessor(IAVLNode node) \r\n\t {\r\n\t\t if(node.getRight().getHeight() != -1) \r\n\t\t\t return minPointer(node.getRight());\r\n\t\t IAVLNode parent = node.getParent();\r\n\t\t while(parent.getHeight() != -1 && node == parent.getRight())\r\n\t\t {\r\n\t\t\t node = parent;\r\n\t\t\t parent = node.getParent();\r\n\t\t }\r\n\t\t return parent;\t \r\n\t\t}", "@Override\n\tpublic Object next() {\n\t\treturn null;\n\t}", "@Nullable IStrongSlot first();", "public RBNode nextNode (RBNode x){\r\n\t\t// there are three cases: \r\n\t\t// next node is above x; it is below x; there is no next node\r\n\t\t\r\n\t\t// Case 1: next node is below\r\n\t\tif (x.right != nil) return treeMinimum(x.right);\r\n\t\t\r\n\t\t// Case 2,3: next node is above or there is no next node\r\n\t\telse return firstRightAncestor(x); // returns nil if none exists\r\n\t}", "public String readNextLine() throws IOException {\n if (this.reader == null) {\n return null;\n }\n\n boolean openNext = false;\n String line;\n while ((line = this.reader.readLine()) == null) {\n // The current file is read at the end, ready to read next one\n this.close(this.index);\n\n if (++this.index < this.readables.size()) {\n // Open the second or subsequent readables, need\n this.reader = this.open(this.index);\n openNext = true;\n } else {\n return null;\n }\n }\n // Determine if need to skip duplicate header\n if (openNext && isDuplicateHeader(line)) {\n line = this.readNextLine();\n }\n return line;\n }", "public Object peek(){\n return this.nextObject;\n }", "public static MazeSolution getSolution(MazeInfoInterface mazeInfo) {\n if (mazeInfo.getLevel() > solutions.size()) {\n return null;\n }\n\n for (HashMap.Entry<Player, MazeSolution> entry:\n solutions.get(mazeInfo.getLevel() - 1).entrySet()) {\n\n if (mazeInfo.getPlayer().equals(entry.getKey())) {\n return entry.getValue();\n }\n }\n\n return null;\n }", "public Dog next()throws NoSuchElementException{\n\t\t\tDogNode leftmostDog = left_nodes.remove(left_nodes.size()-1); //the last dog is the leftmost Dog\r\n\t\t\tif(leftmostDog.older != null){\r\n\t\t\t\tthis.init_left(leftmostDog.older); //initialize the all the left nodes of the right node\r\n\t\t\t}\r\n return leftmostDog.d; // DON'T FORGET TO MODIFY THE RETURN IF NEED BE\r\n\t\t}", "public T minValue(){\r\n \tif(size > 0) {\r\n \t\treturn stack1.peek();\r\n \t}else {\r\n \t\treturn null;\r\n \t}\r\n }", "private Loc nextPoint(Loc l, String direction) {\n\t\tif (direction.equals(\"down\")) {\n\t\t\t// Is at bottom?\n\t\t\t// System.out.println(\"p.getx= \" + l.row);\n\t\t\tif (l.row >= matrixHeight - 1) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn new Loc(l.row + 1, l.col);\n\t\t} else if (direction.equals(\"left\")) {\n\t\t\tif (l.col <= 0) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn new Loc(l.row, l.col - 1);\n\t\t} else { // right\n\t\t\tif (l.col >= matrixWidth - 1) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn new Loc(l.row, l.col + 1);\n\t\t}\n\t}", "public ListNode<T> getNext();", "public Nodo getNextHijo() {\n Nodo result = null;\n Vector<Nodo> hijos = this.getHijos();\n int lastIndex = hijos.size() - 1;\n if (this.nextChildIndex <= lastIndex) {\n result = hijos.get(this.nextChildIndex);\n this.nextChildIndex++;\n }\n return result;\n }", "public Vertex getNext() {\n\t\treturn next;\n\t}", "public Point2D nearest(Point2D p) {\n if (root == null) {\n return null;\n }\n\n currentNearest = root.p;\n currentMinDistance = root.p.distanceTo(p);\n nearest(root, p, ORIENTATION_VERTICAL);\n return currentNearest;\n }", "public NodeD getSelecNext(){\n if (this.selec == this.tail){\n return this.tail;\n }else{\n this.selec = this.selec.getNext();\n return selec;\n }\n }", "@Override\n public void obtain() {\n if (AbstractDungeon.player.hasRelic(MariStageDirections.ID)) {\n for (int i=0; i<AbstractDungeon.player.relics.size(); ++i) {\n if (AbstractDungeon.player.relics.get(i).relicId.equals(MariStageDirections.ID)) {\n instantObtain(AbstractDungeon.player, i, true);\n break;\n }\n }\n } else {\n super.obtain();\n }\n }", "public Projector getVerticalProjector() {\n return (_tile!=null)?_tile.getVerticalProjector():null;\n }", "public static DirectionPanel getNextPanel() {\n instrControl.nextInstruction();\n if (instrControl.isReversed())\n return rp;\n else {\n return sp;\n }\n }", "public Point intersection(Line l) {\n\t\tPoint p;\n\t\tp = l.intersection(new Plane(A2, B2, C2)); // A2.B2.C2.D2\n\t\tif (p == null || !contain(p)) {\n\t\t\tp = l.intersection(new Plane(A1, A2, B2)); // A1.A2.B2.B1\n\t\t\tif (p == null || !contain(p)) {\n\t\t\t\tp = l.intersection(new Plane(A1, A2, D2)); // A1.A2.D2.D1\n\t\t\t\tif (p == null || !contain(p)) {\n\t\t\t\t\tp = l.intersection(new Plane(B1, B2, C2)); // B1.B2.C2.C1\n\t\t\t\t\tif (p == null || !contain(p)) {\n\t\t\t\t\t\tp = l.intersection(new Plane(C1, D1, D2)); // C1.D1.D2.C2\n\t\t\t\t\t\tif (p == null || !contain(p)) {\n\t\t\t\t\t\t\tp = l.intersection(new Plane(A1, B1, C1)); // A1.B1.C1.D1\n\t\t\t\t\t\t\tif (p == null || !contain(p)) {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn p;\n\t}" ]
[ "0.54116434", "0.51466197", "0.5109077", "0.5083953", "0.50645363", "0.50570464", "0.5005495", "0.49761808", "0.49547952", "0.49404877", "0.49087173", "0.49070644", "0.47980586", "0.47952676", "0.47942498", "0.4768268", "0.4758897", "0.4728619", "0.47173497", "0.47042474", "0.46874514", "0.4665028", "0.46648738", "0.46630868", "0.4661913", "0.46314788", "0.46306163", "0.46292657", "0.4616876", "0.46159795", "0.45854303", "0.4581017", "0.45738804", "0.45625833", "0.4560011", "0.45596936", "0.45588815", "0.45410782", "0.4525036", "0.45230702", "0.45204565", "0.45204487", "0.45198485", "0.4515693", "0.4515595", "0.4511403", "0.44973925", "0.44843903", "0.44760165", "0.44698957", "0.44606426", "0.44601417", "0.44562274", "0.44509605", "0.44267085", "0.44264114", "0.4424355", "0.44225118", "0.4422093", "0.4413459", "0.44020888", "0.44012123", "0.4393316", "0.43925717", "0.43920958", "0.43907502", "0.43871656", "0.4384988", "0.43829295", "0.43795487", "0.43793088", "0.43779737", "0.43776935", "0.43768263", "0.43758592", "0.43739292", "0.43730915", "0.43690926", "0.43649027", "0.43643478", "0.43630925", "0.43599248", "0.43531007", "0.4351102", "0.43508533", "0.4329585", "0.43294564", "0.4326411", "0.43243852", "0.43234342", "0.43205145", "0.43169576", "0.43162188", "0.43146402", "0.43012112", "0.43001226", "0.42961237", "0.42948508", "0.4292439", "0.42906243" ]
0.6716494
0
TODO Autogenerated method stub
@Override public void declareOutputFields(OutputFieldsDeclarer fieldsDeclarer) { fieldsDeclarer.declare(new Fields("time-interval", "hotzones")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
start the playback of the background music when the screen is shown
@Override public void show() { music.play(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void playMusic() {\n\t\tthis.music.start();\n\t}", "public void start() {\n background.playMusic();\n createTimer();\n timer.start();\n }", "public void Play() {\n superPlaneGodMode = false;\r\n if (!musicPlaying)\r\n backgroundMusic.pause();\r\n if (musicPlaying)\r\n backgroundMusic.start();\r\n paused = false;\r\n }", "@Override\n public void onResume() {\n super.onResume();\n MusicManager.start(this, prefs.getBoolean(\"bgMusic\", true));\n }", "@Override\n\tpublic void OnGameStart() {\n\t\tsuper.OnGameStart();\n\t\tMusicManage.setLoopingMusic(tumMusic, true);\n\t\tMusicManage.playMusic(tumMusic);\n\t}", "@Override\r\n public void show()\r\n {\r\n // De inmediato, ponemos en marcha una melodia\r\n if (!juego.getAdminComponentes().get(\"Audios/bgmusic06.ogg\", Music.class).isPlaying())\r\n {\r\n juego.getAdminComponentes().get(\"Audios/bgmusic06.ogg\", Music.class).play();\r\n juego.getAdminComponentes().get(\"Audios/bgmusic06.ogg\", Music.class).setLooping(true);\r\n }\r\n }", "private void play()\n {\n if(AudioDetector.getInstance().isNoAudio())\n {\n return;\n }\n\n stop();\n musicPlayer.play();\n }", "private void startPlay() {\n isPlaying = true;\n isPaused = false;\n playMusic();\n }", "public static void startMusic()\n\t{\n\t\tmusic.loop();\n\t}", "private void start() {\n\t\t// 开启播放器\n\t\tmCurrentMediaPlayer.start();\n\t\tsetState(STARTED);\n\n\t\t// 开启计时心跳\n\t\tmHandler.postDelayed(mUpdateTimeTask, 500);\n\t\tif (mPlayerEngineListener != null) {\n\t\t\tmPlayerEngineListener.onTrackStart();\n\t\t}\n\t\t// 开启频谱\n\t\t// mHandler.postDelayed(mSetFxAndUI, 500);\n\t\t// setupVisualizerFxAndUI();\n\n\t\tLog.i(this.getClass().getSimpleName(), \" music player : started...\");\n\t}", "public void play() {\n Selection selection;\n if ((selection = master.getWindowManager().getMain().getSelection()) == null) {\n startPlay();\n playShow(nextStartTime, -1 / 1000.0);\n } else {\n playSelection(selection);\n playShow(selection.start, selection.duration);\n }\n }", "public void play() {\n\t\tplay(true, true);\n\t}", "public void playMusic() {\n\t\ttry {\n\t\t\tsoundManager.playMusic(\"bgroundmusic\");\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "private void playBGM() {\n if (!gameStart) {\n if (title.getStatus().equals(MediaPlayer.Status.PLAYING)) {\n title.stop(); gaming.play();\n }\n else title.play();\n }\n else if (gaming.getStatus().equals(MediaPlayer.Status.PLAYING)) {\n gaming.stop();\n if (gameStart && bgmHelper) playerDown.play();\n title.play();\n }\n }", "public void start(){\n\t\tif (host.getGameSettings().isMusicOn()) {\r\n\t\t\tspr_btnMute.setFrame(0);\r\n\t\t}else{\r\n\t\t\tspr_btnMute.setFrame(1);\r\n\t\t}\r\n\t}", "public void play() {\n\t\tmusic.play();\n\t\tsyncPosition();\n\t}", "private void startPlaying() {\n try {\n mPlayer = new MediaPlayer();\n try {\n mPlayer.setDataSource(audioFile.getAbsolutePath());\n mPlayer.prepare();\n mPlayer.start();\n } catch (IOException e) {\n Log.e(LOG_TAG, \"prepare() failed\");\n }\n showTimer(false);\n } catch (Exception e) {\n logException(e, \"MicManualFragment_startPlaying()\");\n }\n\n }", "public void startPlaying() {\n \t\tif (!isPlaying) {\n \t\t\tisPlaying = true;\n \t\t\tnew PlayThread().start();\n \t\t}\n \t}", "public static void startMusic()\r\n\t{\r\n\t\tif ( musicPlayer == null )\r\n\t\t\tmusicPlayer = new MusicPlayer( \"Music2.mid\" );\r\n\t\telse\r\n\t\t\tmusicPlayer.play();\r\n\t}", "public void play() {\n\t\tint requestStatus = mAudioManager.requestAudioFocus(\n\t\t\t\tmAudioFocusListener, AudioManager.STREAM_MUSIC,\n\t\t\t\tAudioManager.AUDIOFOCUS_GAIN);\n\n\t\tif (DEBUG)\n\t\t\tLog.d(TAG, \"Starting playback: audio focus request status = \"\n\t\t\t\t\t+ requestStatus);\n\n\t\tif (requestStatus != AudioManager.AUDIOFOCUS_REQUEST_GRANTED) {\n\t\t\treturn;\n\t\t}\n\n\t\tmAudioManager.registerMediaButtonEventReceiver(new ComponentName(this\n\t\t\t\t.getPackageName(), MediaButtonIntentReceiver.class.getName()));\n\n\t\tif (mPlayer.isInitialized()) {\n\t\t\t// if we are at the end of the song, go to the next song first\n\t\t\tlong duration = mPlayer.duration();\n\t\t\tif (mRepeatMode != REPEAT_CURRENT && duration > 2000\n\t\t\t\t\t&& mPlayer.position() >= duration - 2000) {\n\t\t\t\tgotoNext(true);\n\t\t\t}\n\n\t\t\tmPlayer.start();\n\t\t\t// make sure we fade in, in case a previous fadein was stopped\n\t\t\t// because\n\t\t\t// of another focus loss\n\t\t\tmMediaplayerHandler.removeMessages(FADEDOWN);\n\t\t\tmMediaplayerHandler.sendEmptyMessage(FADEUP);\n\n\t\t\tif (!mIsSupposedToBePlaying) {\n\t\t\t\tmIsSupposedToBePlaying = true;\n\t\t\t\tnotifyChange(EVENT_PLAYSTATE_CHANGED);\n\t\t\t}\n\n\t\t\tupdateNotification();\n\t\t} else if (mPlayListLen <= 0) {\n\t\t\t// This is mostly so that if you press 'play' on a bluetooth headset\n\t\t\t// without every having played anything before, it will still play\n\t\t\t// something.\n\t\t\tshuffleAll();\n\t\t}\n\t}", "public void backgroundMusic(String path) {\n if (Objects.equals(playingFile, path)) return;\n playingFile = path;\n\n\n // stop if playing\n stop();\n\n if (path == null) {\n // nothing to play\n playingClip = null;\n return;\n }\n\n try {\n\n // find file\n final AudioInputStream stream = AudioSystem.getAudioInputStream(new File(path));\n\n // create player\n playingClip = AudioSystem.getClip();\n playingClip.open(stream);\n playingClip.loop(playingClip.LOOP_CONTINUOUSLY);\n\n // play\n playingClip.start();\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tsetContentView(R.layout.activity_startscreen);\r\n\r\n\t\t//SingletonSoundPool.shared().release();\r\n\t\t\r\n\t\t//mHandler = new MusicHandler(this);\r\n\t\t//mHandler.load(R.raw.start2, true);\r\n\t\t//mHandler.play(2000);\r\n\t\t\r\n\t\t//SingletonBGMPlayer.shared(StartScreenActivity.this, R.raw.start2).getGetMediaPlayer().stop();\r\n\t\t//SingletonBGMPlayer.shared(StartScreenActivity.this, R.raw.start2).getGetMediaPlayer().release();\r\n\t\t\r\n\t\tSingletonBGMPlayer player = SingletonBGMPlayer.shared(this, R.raw.start2);\r\n\t\ttry {\r\n\t\t\tLog.i(\"RoomEscape-StartScreen\", \"MediaPlayer start\");\r\n\t\t\tplayer.getGetMediaPlayer().start();\r\n\t\t} catch (IllegalStateException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\tgameStart = false;\r\n\r\n\t\t// TODO Auto-generated method stub\r\n\t\tanimationFadeIn = AnimationUtils.loadAnimation(this, R.animator.fadein);\r\n\t\tanimationFadeOut = AnimationUtils.loadAnimation(this,\r\n\t\t\t\tR.animator.fadeout);\r\n\r\n\t\tstartImage = (ImageView) findViewById(R.id.startImage);\r\n\t\tstartImage.startAnimation(animationFadeIn);\r\n\r\n\t\tstartImage.setOnClickListener(new OnClickListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View arg0) {\r\n\t\t\t\tif (!gameStart) {\r\n\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\tLog.i(\"GMLRME_StartScreen\", \"GameStart\");\r\n\t\t\t\t\tgameStart = true;\r\n\t\t\t\t\t//mHandler.pause(SPLASH_DISPLAY_LENGTH);\r\n\t\t\t\t\tstartImage.startAnimation(animationFadeOut);\r\n\r\n\t\t\t\t\tnew Handler().postDelayed(new Runnable() {\r\n\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\tIntent mainIntent = new Intent(\r\n\t\t\t\t\t\t\t\t\tStartScreenActivity.this,\r\n\t\t\t\t\t\t\t\t\tStageSelectScreenActivity.class);\r\n\t\t\t\t\t\t\tmainIntent\r\n\t\t\t\t\t\t\t\t\t.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);\r\n\t\t\t\t\t\t\tStartScreenActivity.this.startActivity(mainIntent);\r\n\t\t\t\t\t\t\tStartScreenActivity.this.finish();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}, SPLASH_DISPLAY_LENGTH);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}", "public void playMedia() {\n\t\tif (MainActivity.mPlayer == null) {\n\t\t\tMainActivity.mPlayer = new MediaPlayer();\n\t\t\tMainActivity.mPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);\n\t\t\tMainActivity.currentSong = song;\n\t\t\tMainActivity.currentAlbum = album;\n\t\t}\n\t\tif (!MainActivity.currentSong.getTitleKey().equals(song.getTitleKey())) {\n\t\t\tMainActivity.currentSong = song;\n\t\t\tMainActivity.currentAlbum = album;\n\t\t\tMainActivity.mPlayer.reset();\n\t\t}\n\n\t\ttitle = song.getTitle();\n\t\talbumTitle = album.getAlbum();\n\t\talbumArt = album.getAlbumArt();\n\n\t\ttry {\n\t\t\tMainActivity.mPlayer.setDataSource(this, song.getUri());\n\t\t\tMainActivity.mPlayer.prepare();\n\t\t} catch (IllegalArgumentException e) {\n\t\t\tLog.i(TAG, e.getMessage(), e);\n\t\t\te.printStackTrace();\n\t\t} catch (SecurityException e) {\n\t\t\tLog.i(TAG, e.getMessage(), e);\n\t\t\te.printStackTrace();\n\t\t} catch (IllegalStateException e) {\n\t\t\tLog.i(TAG, e.getMessage(), e);\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\tLog.i(TAG, e.getMessage(), e);\n\t\t\te.printStackTrace();\n\t\t}\n\t\tMainActivity.mPlayer.setOnPreparedListener(new OnPreparedListener() {\n\t\t\t@Override\n\t\t\tpublic void onPrepared(MediaPlayer mp) {\n\t\t\t\tmp.start();\n\t\t\t}\n\t\t});\n\t\tMainActivity.mPlayer.setOnCompletionListener(new OnCompletionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onCompletion(MediaPlayer mp) {\n\t\t\t\tnext();\n\t\t\t}\n\n\t\t});\n\n\t\tnew Handler(getMainLooper()).post(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tupdateMainActivity();\n\t\t\t\tupdateNowPlaying();\n\t\t\t}\n\t\t});\n\t}", "@Override\r\n public void show() {\r\n // makes sure the controller is ready for new inputs\r\n controller.reset();\r\n // tell the game to take input data via our controller\r\n Gdx.input.setInputProcessor(controller);\r\n // update the preferences\r\n parent.updateActivePreferences();\r\n // set the volume to our new preference\r\n bgMusic.setVolume(musicVol);\r\n bgMusic.play();\r\n }", "public MainScreen() {\r\n\t\tthis.playSound(\"assets/audios/1.wav\");\r\n\t}", "@Override\r\n\tpublic void start() {\n\t\tmediaPlayer.start();\r\n\t}", "public void play() {\n\t\tint focusRequestResult = mAudioManager.requestAudioFocus(mOuterEventsListener, AudioManager.STREAM_MUSIC,\n\t\t\t\tAudioManager.AUDIOFOCUS_GAIN);\n\n\t\tif (PrefManager.isIgnoreAudioFocus()\n\t\t\t\t|| focusRequestResult == AudioManager.AUDIOFOCUS_REQUEST_GRANTED) {\n\t\t\tinternalPlay();\n\t\t} else {\n\t\t\terror(Error.AUDIO_FOCUS_ERROR);\n\t\t}\n\t}", "public final void play() {\n\t\tinitialize();\n\t\tstartPlay();\n\t\tendPlay();\n\t}", "public void StartMusic(int music_id);", "public void play() {\n\t\ttry {\n\t\t\tthis.mMediaPlayer.start();\n\t\t\tLog.w(\"AUDIO PLAYER\", \"just started playing\");\n\t\t} catch (IllegalStateException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tthis.isPlaying = true;\n\t\tthis.incrementPlaybackTime();\n\t}", "public void startPlayBack() {\n\t\tif (android.os.Environment.getExternalStorageState().equals(\n\t\t\t\tandroid.os.Environment.MEDIA_MOUNTED)) {\n\t\t\ttry {\n\t\t\t\tmPlayer.start();\n\t\t\t} catch (IllegalStateException e) {\n\t\t\t}\n\t\t} else {\n\t\t\tToast.makeText(mContext, \"sdcard not available\", Toast.LENGTH_LONG).show();\n\t\t}\n\t}", "public static void playBackGroundMusic(String path) {\n if (musicPlayer != null && musicPlayer.getSourceLocation() != null) {\n if (musicPlayer.getSourceLocation().equals(path)) {\n if (musicPlayer.isEndOfMediaReached()) {\n musicPlayer.seek(0);\n musicPlayer.play();\n }\n return;\n }\n musicPlayer.stop();\n }\n musicPlayer = new Player();\n musicPlayer.setSourceLocation(path);\n musicPlayer.play();\n }", "public void start() {\n setPlayerState(State.STARTED);\n mMediaPlayer.start();\n notifyPlaying();\n }", "public void play() {\n if (audio != null) {\n audio.play(sfxVolume);\n }\n }", "public void play() { \r\n if (midi) \r\n sequencer.start(); \r\n else \r\n clip.start(); \r\n timer.start(); \r\n play.setText(\"Stop\"); \r\n playing = true; \r\n }", "public void started()\n {\n if (!isPaused()) muteControl.play();\n }", "public void playSoundtrack() {\n if(this.musicEnabled) {\n try {\n Clip soundtrackClip = AudioSystem.getClip();\n AudioInputStream inputStream = AudioSystem.getAudioInputStream(new BufferedInputStream(Assets.soundTrack));\n soundtrackClip.open(inputStream);\n soundtrackClip.start();\n soundtrackClip.loop(Clip.LOOP_CONTINUOUSLY);\n } catch (Exception e) {\n e.printStackTrace();\n System.err.println(e.getMessage());\n }\n }\n }", "public static void beginCurrentSoundtrack() {\n\t\t\n\t\tif (GameFrame.settingsPanel.musicOn() && soundtrack[GameBoardModel.getLevel()-1] != null) {\n\t\t\t\n\t\t\t// In case a new game is started before the victory jingle is finished\n\t\t\t// from a previous game (rare occurrence, but possible)\n\t\t\tif (victoryFanfare.isRunning()) victoryFanfare.stop();\t\t\t\n\t\t\t\n\t\t\tsoundtrack[GameBoardModel.getLevel()-1].setFramePosition(0);\n\t\t\tsoundtrack[GameBoardModel.getLevel()-1].loop(Clip.LOOP_CONTINUOUSLY);\n\t\t\t\n\t\t}\n\t\t\n\t}", "public void stopBackgroundMusic()\n {\n background.stop();\n }", "public synchronized void playAbruptLoop(String path){\r\n if(currentLoop0){\r\n if(backgroundMusicLoop0!=null) backgroundMusicLoop0.stopClip();\r\n currentLoop0 = false;\r\n backgroundMusicLoop1 = new MusicThread(path, currentLoop0);\r\n backgroundMusicLoop1.start();\r\n }else{\r\n if(backgroundMusicLoop1!=null) backgroundMusicLoop1.stopClip();\r\n currentLoop0 = true;\r\n backgroundMusicLoop0 = new MusicThread(path, currentLoop0);\r\n backgroundMusicLoop0.start();\r\n }\r\n }", "@Override\n public void show() {\n MenuMusic.play();\n MenuMusic.setLooping(true);\n MenuMusic.setVolume(0.4f);\n }", "public void play() {\n\t\t\r\n\t}", "private void playSound() {\n if (isFlashOn) {\n mp = MediaPlayer.create(this, R.raw.light_switch_off);\n } else {\n mp = MediaPlayer.create(this, R.raw.light_switch_on);\n }\n mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {\n\n @Override\n public void onCompletion(MediaPlayer mp) {\n // TODO Auto-generated method stub\n mp.release();\n }\n });\n mp.start();\n }", "public void setScreenOnWhilePlaying(StarObjectClass self,boolean screenOn){ \r\n \t\tStarCLEMediaPlayer mediaplayer = (StarCLEMediaPlayer)WrapAndroidClass.GetAndroidObject(self,\"AndroidObject\");\r\n \t\tif( mediaplayer == null )\r\n \t\t\treturn;\r\n \t\tmediaplayer.setScreenOnWhilePlaying(screenOn);\r\n \t}", "public void onPlayStart(){\n\n\t}", "public void play(boolean music) {\n\t\tplay(1.0f, 1.0f, music);\n\t}", "private void initialMusic(){\n\n }", "private void i_win() {\n\t\tif (MainMusic.isPlaying())\n\t\t\tMainMusic.stop();\n\t\tMainMusic = MediaPlayer.create(Game.this, R.raw.win);\n\t\tMainMusic.start();\n\t\tgame_panel.Pause_game=true;\n\t\tWinDialog.setVisibility(View.VISIBLE);\n\t}", "@Override\n public void playStart() {\n }", "public static void musicFirstLevel(){\n\t\ttry {\r\n\t\t\tbgmusicLevel = new Music(\"res/sound/firstLevel.wav\");\r\n\t\t\tbgmusicLevel.loop(1f, 0.1f);\r\n\t\t} catch (SlickException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n public void onPause() {\n super.onPause();\n MusicManager.start(this, false);\n }", "@Override\n public void initialize() {\n //talonOrchestra.playMusic();\n }", "public void play() {\n\t\tif(hasAudioLoaded()) {\n\t\t\tcurrentClip.start();\n\t\t\tisPlaying = true;\n\t\t}\n\t}", "public void start() {\n \tif (mediaChangedListener != null) {\n \t\tmediaChangedListener.onStarted();\n \t}\n mMediaPlayer.start();\n }", "@Override\n public void run() {\n // This method will be executed once the timer is over\n // Start your app main activity\n play();\n }", "public void play() {\n\t\tif(currentPlayingItem==null) return;\n\t\tif(!mediaPlayer.isPlaying()) mediaPlayer.start();\n\t\tupdateNotification();\n\t\tsendBroadcast(new Intent(\"com.andreadec.musicplayer.playpausechanged\"));\n\t}", "@Override\n public void onCreate(Bundle savedInstanceState) {\n \tif(Static_Date.VOICE_SWITCH == true){\n \t\tif(Static_Date.j ==0){\n \t\tStatic_Date.MUSIC_PLAYER = new MusicPlayer(this);\n \t\tStatic_Date.MUSIC_PLAYER.music_start(R.drawable.background);\n \t\tStatic_Date.MUSIC_PLAYER.mediaPlayer.setLooping(true);\n \t\tStatic_Date.j++;\n \t}\n \t}\n \tif(Static_Date.VOICE_SWITCH == false){\n \tif(Static_Date.MUSIC_PLAYER !=null&& Static_Date.MUSIC_PLAYER.mediaPlayer !=null&&Static_Date.MUSIC_PLAYER.mediaPlayer.isPlaying()){\n\t\t\tStatic_Date.MUSIC_PLAYER.mediaPlayer.setLooping(false);\n\t\t\tStatic_Date.MUSIC_PLAYER.music_stop();\n\t\t}\n \t Static_Date.j--;\n \t\n \t}\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n Button start_game = (Button)findViewById(R.id.start_game);\n AnimationSet animationSet = new AnimationSet(true);\n TranslateAnimation translateAnimation = new TranslateAnimation(\n \t\tAnimation.RELATIVE_TO_SELF,0f,\n \t\tAnimation.RELATIVE_TO_SELF,0f,\n \t\tAnimation.RELATIVE_TO_SELF,-3f,\n \t\tAnimation.RELATIVE_TO_SELF,0f);\n translateAnimation.setDuration(1500);\n animationSet.addAnimation(translateAnimation);\n start_game.startAnimation(animationSet);\n start_game.setOnTouchListener(new OnTouchListener(){\n \tpublic boolean onTouch(View v,MotionEvent event){\n \t\tif(event.getAction()==event.ACTION_DOWN){\n \t\t\tv.findViewById(R.id.start_game).setBackgroundResource(R.drawable.bstart_game);\n \t\t}\n \t\telse if(event.getAction()==event.ACTION_UP){\n \t\t\tv.findViewById(R.id.start_game).setBackgroundResource(R.drawable.start_game);\n\t\t\t\t\tIntent intent1 = new Intent();\n\t\t\t\t\tintent1.setClass(snakemain.this , startgame.class);\n\t\t\t\t\tstartActivity(intent1);\t\n\t\t\t\t\t\n \t\t}\n \t\treturn false;\n \t}\n }\n );\n Button set = (Button)findViewById(R.id.set);\n AnimationSet animationSet1 = new AnimationSet(true);\n TranslateAnimation translateAnimation1 = new TranslateAnimation(\n \t\tAnimation.RELATIVE_TO_SELF,0f,\n \t\tAnimation.RELATIVE_TO_SELF,0f,\n \t\tAnimation.RELATIVE_TO_SELF,10f,\n \t\tAnimation.RELATIVE_TO_SELF,0f);\n translateAnimation1.setDuration(1500);\n animationSet1.addAnimation(translateAnimation1);\n set.startAnimation(animationSet1);\n set.setOnTouchListener(new OnTouchListener(){\n \tpublic boolean onTouch(View v,MotionEvent event){\n \t\tif(event.getAction()==event.ACTION_DOWN){\n \t\t\tv.findViewById(R.id.set).setBackgroundResource(R.drawable.bset);\n \t\t}\n \t\telse if(event.getAction()==event.ACTION_UP){\n \t\t\tv.findViewById(R.id.set).setBackgroundResource(R.drawable.set);\n \t\t\tIntent intent2 = new Intent();\n\t\t\t\t\tintent2.setClass(snakemain.this , set.class);\n\t\t\t\t\tstartActivity(intent2);\t\n\t\t\t\t\tfinish();\n \t\t}\n \t\treturn false;\n \t}\n }\n );\n Button help = (Button)findViewById(R.id.help);\n AnimationSet animationSet2 = new AnimationSet(true);\n TranslateAnimation translateAnimation2 = new TranslateAnimation(\n \t\tAnimation.RELATIVE_TO_SELF,0f,\n \t\tAnimation.RELATIVE_TO_SELF,0f,\n \t\tAnimation.RELATIVE_TO_SELF,-7f,\n \t\tAnimation.RELATIVE_TO_SELF,0f);\n translateAnimation2.setDuration(1500);\n animationSet2.addAnimation(translateAnimation2);\n help.startAnimation(animationSet2);\n help.setOnTouchListener(new OnTouchListener(){\n \tpublic boolean onTouch(View v,MotionEvent event){\n \t\tif(event.getAction()==event.ACTION_DOWN){\n \t\t\tv.findViewById(R.id.help).setBackgroundResource(R.drawable.bhelp);\n \t\t}\n \t\telse if(event.getAction()==event.ACTION_UP){\n \t\t\tv.findViewById(R.id.help).setBackgroundResource(R.drawable.help);\n \t\t\tIntent intent3 = new Intent();\n\t\t\t\t\tintent3.setClass(snakemain.this , help.class);\n\t\t\t\t\tstartActivity(intent3);\t\n \t\t}\n \t\treturn false;\n \t}\n }\n );\n Button finish = (Button)findViewById(R.id.finish);\n AnimationSet animationSet3 = new AnimationSet(true);\n TranslateAnimation translateAnimation3 = new TranslateAnimation(\n \t\tAnimation.RELATIVE_TO_SELF,0f,\n \t\tAnimation.RELATIVE_TO_SELF,0f,\n \t\tAnimation.RELATIVE_TO_SELF,5f,\n \t\tAnimation.RELATIVE_TO_SELF,0f);\n translateAnimation3.setDuration(1500);\n animationSet3.addAnimation(translateAnimation3);\n finish.startAnimation(animationSet3);\n finish.setOnTouchListener(new OnTouchListener(){\n \tpublic boolean onTouch(View v,MotionEvent event){\n \t\tif(event.getAction()==event.ACTION_DOWN){\n \t\t\tv.findViewById(R.id.finish).setBackgroundResource(R.drawable.bfinish);\n \t\t}\n \t\telse if(event.getAction()==event.ACTION_UP){\n \t\t\tv.findViewById(R.id.finish).setBackgroundResource(R.drawable.finish);\n \t\t\tif(Static_Date.MUSIC_PLAYER != null && Static_Date.MUSIC_PLAYER.mediaPlayer != null&&Static_Date.MUSIC_PLAYER.mediaPlayer.isPlaying()){\n \t\t\t\tStatic_Date.MUSIC_PLAYER.mediaPlayer.setLooping(false);\n \t\t\t\tStatic_Date.MUSIC_PLAYER.music_stop();\n \t\t\t}\n \t\t\tandroid.os.Process.killProcess(android.os.Process.myPid());\n \t\t}\n \t\treturn false;\n \t}\n }\n );\n \n \n }", "public static void resumeMusic() {\n\t\t\n\t\tif (currentMusic == null) {\n\t\t\tplayMusic(\"mainMenuMusic\", 0.1f);\n\t\t} else {\n\t\t\tcurrentMusic.start();\n\t\t}\n\t}", "public static void playScream()\n {\n scream.play();\n }", "public void playBackground(String path){\n\t stopBackground();\n\t\tloopingSound = new Sound(\"/res/sounds/\" + path,-1,true);\n\t\tactiveSounds++;\n\t}", "public void play() {\n\t\tSystem.out.println(\"TCL 电视机播放中...\");\r\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tPowerManager powerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);\n\t\twakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, WAKE_LOCK_TAG);\n\t\t\n\t\t// Initialize the telephony manager\n\t\ttelephonyManager = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);\n\t\tphoneStateListener = new MusicPhoneStateListener();\n\t\tnotificationManager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);\n\t\tif (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n\t\t\tnotificationChannel = new NotificationChannel(NOTIFICATION_CHANNEL, \"Music Player\", NotificationManager.IMPORTANCE_LOW);\n\t\t\tnotificationManager.createNotificationChannel(notificationChannel);\n\t\t}\n\t\t\n\t\t// Initialize pending intents\n\t\tquitPendingIntent = PendingIntent.getBroadcast(this, 0, new Intent(\"com.andreadec.musicplayer.quit\"), 0);\n\t\tpreviousPendingIntent = PendingIntent.getBroadcast(this, 0, new Intent(\"com.andreadec.musicplayer.previous\"), 0);\n\t\tplaypausePendingIntent = PendingIntent.getBroadcast(this, 0, new Intent(\"com.andreadec.musicplayer.playpause\"), 0);\n\t\tnextPendingIntent = PendingIntent.getBroadcast(this, 0, new Intent(\"com.andreadec.musicplayer.next\"), 0);\n\t\tpendingIntent = PendingIntent.getActivity(this, 0, new Intent(this, MainActivity.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP), PendingIntent.FLAG_UPDATE_CURRENT);\n\t\t\n\t\t// Read saved user preferences\n\t\tpreferences = PreferenceManager.getDefaultSharedPreferences(this);\n\t\t\t\t\n\t\t// Initialize the media player\n\t\tmediaPlayer = new MediaPlayer();\n\t\tmediaPlayer.setOnCompletionListener(this);\n\t\tmediaPlayer.setWakeMode(this, PowerManager.PARTIAL_WAKE_LOCK); // Enable the wake lock to keep CPU running when the screen is switched off\n\t\t\n\t\tplayMode = preferences.getInt(Preferences.PREFERENCE_PLAY_MODE, Preferences.DEFAULT_PLAY_MODE);\n\t\ttry { // This may fail if the device doesn't support bass boost\n\t\t\tbassBoost = new BassBoost(1, mediaPlayer.getAudioSessionId());\n\t\t\tbassBoost.setEnabled(preferences.getBoolean(Preferences.PREFERENCE_BASSBOOST, Preferences.DEFAULT_BASSBOOST));\n\t\t\tsetBassBoostStrength(preferences.getInt(Preferences.PREFERENCE_BASSBOOSTSTRENGTH, Preferences.DEFAULT_BASSBOOSTSTRENGTH));\n\t\t\tbassBoostAvailable = true;\n\t\t} catch(Exception e) {\n\t\t\tbassBoostAvailable = false;\n\t\t}\n\t\trandom = new Random(System.nanoTime()); // Necessary for song shuffle\n\t\t\n\t\tshakeListener = new ShakeListener(this);\n\t\tif(preferences.getBoolean(Preferences.PREFERENCE_SHAKEENABLED, Preferences.DEFAULT_SHAKEENABLED)) {\n\t\t\tshakeListener.enable();\n\t\t}\n\t\t\n\t\ttelephonyManager.listen(phoneStateListener, PhoneStateListener.LISTEN_CALL_STATE); // Start listen for telephony events\n\t\t\n\t\t// Inizialize the audio manager\n\t\taudioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);\n\t\tmediaButtonReceiverComponent = new ComponentName(getPackageName(), MediaButtonReceiver.class.getName());\n\t\taudioManager.registerMediaButtonEventReceiver(mediaButtonReceiverComponent);\n\t\taudioManager.requestAudioFocus(null, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN);\n\t\t\n\t\t// Initialize remote control client\n icon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);\n Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);\n mediaButtonIntent.setComponent(mediaButtonReceiverComponent);\n PendingIntent mediaPendingIntent = PendingIntent.getBroadcast(getApplicationContext(), 0, mediaButtonIntent, 0);\n\n remoteControlClient = new RemoteControlClient(mediaPendingIntent);\n remoteControlClient.setTransportControlFlags(RemoteControlClient.FLAG_KEY_MEDIA_PLAY_PAUSE | RemoteControlClient.FLAG_KEY_MEDIA_PREVIOUS | RemoteControlClient.FLAG_KEY_MEDIA_NEXT);\n audioManager.registerRemoteControlClient(remoteControlClient);\n\t\t\n\t\tupdateNotification();\n\t\t\n\t\tIntentFilter intentFilter = new IntentFilter();\n\t\tintentFilter.addAction(\"com.andreadec.musicplayer.quit\");\n\t\tintentFilter.addAction(\"com.andreadec.musicplayer.previous\");\n\t\tintentFilter.addAction(\"com.andreadec.musicplayer.previousNoRestart\");\n\t\tintentFilter.addAction(\"com.andreadec.musicplayer.playpause\");\n\t\tintentFilter.addAction(\"com.andreadec.musicplayer.next\");\n\t\tintentFilter.addAction(AudioManager.ACTION_AUDIO_BECOMING_NOISY);\n broadcastReceiver = new BroadcastReceiver() {\n @Override\n public void onReceive(Context context, Intent intent) {\n \tString action = intent.getAction();\n\n switch(action) {\n case \"com.andreadec.musicplayer.quit\":\n sendBroadcast(new Intent(\"com.andreadec.musicplayer.quitactivity\"));\n sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));\n stopSelf();\n return;\n case \"com.andreadec.musicplayer.previous\":\n previousItem(false);\n break;\n case \"com.andreadec.musicplayer.previousNoRestart\":\n previousItem(true);\n break;\n case \"com.andreadec.musicplayer.playpause\":\n playPause();\n break;\n case \"com.andreadec.musicplayer.next\":\n nextItem();\n break;\n case AudioManager.ACTION_AUDIO_BECOMING_NOISY:\n if(preferences.getBoolean(Preferences.PREFERENCE_STOPPLAYINGWHENHEADSETDISCONNECTED, Preferences.DEFAULT_STOPPLAYINGWHENHEADSETDISCONNECTED)) {\n pause();\n }\n break;\n }\n }\n };\n registerReceiver(broadcastReceiver, intentFilter);\n \n if(!isPlaying()) {\n \tloadLastSong();\n }\n \n startForeground(NOTIFICATION_ID, notification);\n\t}", "@Override\n protected void onResume()\n {\n super.onResume();\n setSound.resumeMusic(this);\n }", "@Override\r\n protected void playGameStartAudio() {\n\taudio.playClip();\r\n }", "public void play(){\n Log.d(TAG, \"startAudio: called\");\n if(mMediaPlayer!=null){\n\n mMediaPlayer.start();\n mProgressBar.setProgress(mMediaPlayer.getCurrentPosition());\n mProgressBar.setMax(mMediaPlayer.getDuration());\n\n // updating progress bar\n seekHandler.postDelayed(updateSeekBar, 5);\n }\n }", "public void start() {\n AudioPlayer.player.start(cas);\n playing = true;\n }", "public void start(StarObjectClass self){ \r\n \t\tStarCLEMediaPlayer mediaplayer = (StarCLEMediaPlayer)WrapAndroidClass.GetAndroidObject(self,\"AndroidObject\");\r\n \t\tif( mediaplayer == null )\r\n \t\t\treturn;\r\n \t\tmediaplayer.start(); \t\t\r\n \t}", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t\tSmartPlugApplication.resetTask();\n\t\tinit();\n\n\t\t// 播放声音的初始化\n\t\tif (mp3_player == null) {\n\t\t\tmp3_player = new MediaPlayer();\n\t\t\tmp3_player = MediaPlayer.create(this, R.raw.aircondi);\n\t\t\tmp3_player.setLooping(false);\n\n\t\t}\n\t}", "@Override\r\n\tprotected void onCreate(Bundle multimediacourse) {\n\t\tsuper.onCreate(multimediacourse);\r\n\t\t// Keep the Device Screen ON\r\n\t\tgetWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);\r\n\t\t// Make Activity FullScreen \r\n\t\trequestWindowFeature(Window.FEATURE_NO_TITLE);\r\n\t\tgetWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,\r\n\t\t\t\tWindowManager.LayoutParams.FLAG_FULLSCREEN);\r\n\t\tsetContentView(R.layout.splash);\r\n\r\n\t\t// Background music for Splash Screen\r\n\t\tmyPlayer=MediaPlayer.create(Splash.this, R.raw.music);\r\n\t\tmyPlayer.start();\r\n\t\tmyPlayer.setLooping(true);\r\n\r\n\t\t// Animation \r\n\t\t// Load the ImageView that will host the animation and\r\n\t\tImageView Img = (ImageView) findViewById(R.id.background);\r\n\r\n\t\t// set its background to our AnimationDrawable XML resource.\r\n\t\tImg.setBackgroundResource(R.layout.anim);\r\n\t\tAnimationDrawable frameAnimation = (AnimationDrawable) Img.getBackground();\r\n\r\n\t\t// Start the animation (looped PlayBack by default).\r\n\t\tframeAnimation.start();\r\n\r\n\t\t// End of Animation\r\n\r\n\t\t// MUTE BUTTON\r\n\t\timageButton = (ImageButton) findViewById(R.id.imageButton1);\r\n\t\timageButton.bringToFront();\r\n\t\timageButton.setOnClickListener(new OnClickListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View arg0) {\r\n\r\n\r\n\t\t\t\tif(clicked==1){\r\n\t\t\t\t\tAudioManager aManager=(AudioManager)getSystemService(Context.AUDIO_SERVICE);\r\n\t\t\t\t\taManager.setStreamMute(AudioManager.STREAM_MUSIC, false);\r\n\t\t\t\t\tToast.makeText(Splash.this,\"Music is ON!\", Toast.LENGTH_SHORT).show();\r\n\t\t\t\t\timageButton.setImageResource(R.drawable.unmute);\r\n\t\t\t\t\tclicked=0;\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tAudioManager aManager=(AudioManager)getSystemService(Context.AUDIO_SERVICE);\r\n\t\t\t\t\taManager.setStreamMute(AudioManager.STREAM_MUSIC, true);\r\n\t\t\t\t\tToast.makeText(Splash.this,\"Music is OFF!\", Toast.LENGTH_SHORT).show();\r\n\t\t\t\t\timageButton.setImageResource(R.drawable.mute);\r\n\t\t\t\t\tclicked=1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t// QUICK START BUTTON\r\n\t\tstartButton = (ImageButton) findViewById(R.id.button1);\r\n\t\tstartButton.bringToFront();\r\n\t\tstartButton.setOnClickListener(new OnClickListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\tstartButton.setImageResource(R.drawable.quick2);\r\n\t\t\t\tIntent intent= new Intent(\"com.android.BrickBreaker.main\");\r\n\r\n\t\t\t\tstartActivity(intent);\r\n\t\t\t\tmyPlayer.release();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\t// SELECT BACKGROUND IMAGE BUTTON\r\n\t\tselectButton = (ImageButton) findViewById(R.id.button2);\r\n\t\tselectButton.bringToFront();\r\n\t\tselectButton.setOnClickListener(new OnClickListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View arg0) {\r\n\t\t\t\tselectButton.setImageResource(R.drawable.select2);\r\n\t\t\t\tToast.makeText(Splash.this,\"Please Select 'Low or Medium Quality' Images\", Toast.LENGTH_LONG).show();\r\n\t\t\t\tIntent i = new Intent(\r\n\t\t\t\t\t\tIntent.ACTION_PICK,\r\n\t\t\t\t\t\tandroid.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\r\n\r\n\t\t\t\tstartActivityForResult(i, SELECT_IMAGE); \r\n\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\t// EXIT GAME BUTTON\r\n\t\texitButton = (ImageButton) findViewById(R.id.exitButton);\r\n\t\texitButton.bringToFront();\r\n\t\texitButton.setOnClickListener(new OnClickListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View arg0) {\r\n\t\t\t\texitButton.setImageResource(R.drawable.exit2);\r\n\t\t\t\tToast.makeText(Splash.this,\"Credits: Berk SOYSAL, Aditi ARYA\", Toast.LENGTH_LONG).show();\r\n\r\n\t\t\t\tThread timer = new Thread(){\r\n\t\t\t\t\tpublic void run(){\r\n\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\tsleep(2200);\r\n\t\t\t\t\t\t} catch (InterruptedException e){\r\n\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t} finally{\r\n\r\n\t\t\t\t\t\t\tSystem.exit(0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t\ttimer.start();\r\n\t\t\t}\r\n\t\t});\r\n\t}", "public void start(){\n\t\tthis.timer.start();\n\t\t\n\t\t/*this.BGM.play();\t//make it play once we have the background after the game start\n\t\tthis.BGM.loop(1);\t//make it loop constantly\n\t\t\n\t\t//once we start the BGM, start calculating the time\n\t\t//we minus this.time because if the game is restarted, we want to adjust the time displayed\n\t\t//on the label since the paused time does not account\n\t\tthis.startTime = System.nanoTime() - this.time;\t//in nanoTime*/\n\t\t\n\t\tthis.stop = false;\n\t}", "public void playSound() {\n\t\tmediaPlayer.play();\n\t}", "public static void game_sound() {\n\t\tm_player_game.start();\n\t\tm_player_game.setMediaTime(new Time(0));\n\t}", "public static void musicMainMenu(){\n\t\ttry {\r\n\t\t\tbgmusic = new Music(\"res/otherSounds/Menu.wav\");\r\n\t\t\tbgmusic.loop(1f, 0.2f);\r\n\t\t\t//System.out.println(bgmusic.getVolume()); \t\r\n\t\t} catch (SlickException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void play() {\n\t\ttry {\n\t\t\taudioInput = AudioSystem.getAudioInputStream(this.music);\n\t\t\tclip.open(audioInput);\n\t\t\tclip.start();\n\t\t} catch (UnsupportedAudioFileException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (LineUnavailableException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n\tpublic void onPrepared(MediaPlayer mp) {\n\t\tmp.start();\n\t}", "public static void music (String fileName)\r\n {\r\n\tAudioPlayer MGP = AudioPlayer.player;\r\n\tAudioStream BGM;\r\n\tAudioData MD;\r\n\r\n\tContinuousAudioDataStream loop = null;\r\n\r\n\ttry\r\n\t{\r\n\t InputStream test = new FileInputStream (\"lamarBackgroundMusic.wav\");\r\n\t BGM = new AudioStream (test);\r\n\t AudioPlayer.player.start (BGM);\r\n\r\n\t}\r\n\tcatch (FileNotFoundException e)\r\n\t{\r\n\t System.out.print (e.toString ());\r\n\t}\r\n\tcatch (IOException error)\r\n\t{\r\n\t System.out.print (error.toString ());\r\n\t}\r\n\tMGP.start (loop);\r\n }", "protected void playS()\n\t\t{\n\t\t\tplayer.start();\n\t\t}", "public void playSelectSong() {\n isStart = false;\n if (getCurrentSong() == 0) {\n audioList.get(getCurrentSong()).setSelect(true);\n playListAdapter.notifyItemChanged(getCurrentSong());\n }\n isPauseResume = false;\n if (player != null) {\n player.stopMedia();\n }\n if (!isDestroyed()) {\n playAudio(audioList.get(getCurrentSong()).getData());\n }\n /*new Handler().postDelayed(new Runnable() {\n @Override\n public void run() {\n if (!isDestroyed()) {\n playAudio(audioList.get(getCurrentSong()).getData());\n }\n }\n }, DELAY_TIME);*/\n }", "public void playAudio() {\n\t\tmusic[currentSong].stop();\n\t\tcurrentSong++;\n\t\tcurrentSong %= music.length;\n\t\tmusic[currentSong].play();\n\t}", "private void play() {\n /** Memanggil File MP3 \"indonesiaraya.mp3\" */\n try {\n mp.prepare();\n } catch (IllegalStateException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n /** Menjalankan Audio */\n mp.start();\n\n /** Penanganan Ketika Suara Berakhir */\n mp.setOnCompletionListener(new OnCompletionListener() {\n @Override\n public void onCompletion(MediaPlayer mp) {\n stateAwal();\n }\n });\n }", "public synchronized void pause(){\r\n if(currentLoop0) backgroundMusicLoop0.pause();\r\n else backgroundMusicLoop1.pause();\r\n }", "public void onPrepared(MediaPlayer player) {\n player.start(); \n }", "synchronized void toggle() {\n try {\n myShouldPause = !myShouldPause;\n if (myShouldPause) {\n if (myPlayer != null) {\n myPlayer.stop();\n }\n } else if (!myGamePause) {\n // if the player is null, we create a new one.\n if (myPlayer == null) {\n start();\n }\n // start the music.\n myPlayer.start();\n }\n } catch (Exception e) {\n // the music isn't necessary, so we ignore exceptions.\n }\n }", "@Override\n public void onPrepared(MediaPlayer mp) {\n playMedia();\n }", "public void onPrepared(MediaPlayer player) {\n //player.start();\n }", "public void play() {\n\t\t//If volume is not muted\n\t\tif (volume != Volume.MUTE) {\n\t\t\t//If the clip is running\n\t\t\tif (clip.isRunning()) {\n\t\t\t\tclip.stop(); //Stop it\n\t\t\t}\n\t\t\tclip.setFramePosition(0); //Rewind\n\t\t\tclip.start(); //Play again\n\t\t}\n\t}", "@Override\n public void run() {\n if(musicEnabled) {\n playSoundtrack();\n while (running) {\n if(!stack.isEmpty()) {\n Sound sound = stack.pop();\n sound.play(sound.loadInputStream());\n }\n }\n }\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.splash);\n\t\ttActivityDisplay = (TextView) findViewById(R.id.tView1);\n\t\t//playSong = MediaPlayer.create(Splash.this,R.raw.aakasam);\n\t\tSharedPreferences getPrefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext());\n\tboolean musicPref = getPrefs.getBoolean(\"checkbox\",true);\n\n\tif (musicPref == true)\n\t//playSong.start();\n\t\t;\n\t Thread timer = new Thread (){\n\t\t public void run(){\n\t\t\t try {\n\t\t\t\t sleep(5000);\n\t\t\t } catch (InterruptedException e){\n\t\t\t\t e.printStackTrace();\n\t\t\t } finally {\n\t\t\t\t Intent startAnotherActivity = new Intent(\"android.intent.action.MENU\");\n\t\t\t startActivity(startAnotherActivity);\n\t\t\t }\n\t\t }\n\t\t \n\t };\n\t \n\t timer.start();\n\t\t\n\t\n\t}", "public synchronized void resume(){\r\n if(currentLoop0) backgroundMusicLoop0.unpause();\r\n else backgroundMusicLoop1.unpause();\r\n }", "public void startShower(){\n Log.d(LOGTAG,\"Shower is on.\");\n playSound();\n\n\n }", "public void startPlaying() {\n\t\tpbrLoading.setVisibility(View.GONE);\n\t\tisPlaying = true;\n\t\tif (IjoomerApplicationConfiguration.isEnableVoiceReport && reportVoice) {\n\t\t\tlnrReportVoice.setVisibility(View.VISIBLE);\n\t\t\timgReport.setImageResource(reportImage);\n\n\t\t\tif (reportCaption != 0) {\n\t\t\t\ttxtReportCaption.setText(reportCaption);\n\t\t\t} else if (strReportCaption != null && strReportCaption.length() > 0) {\n\t\t\t\ttxtReportCaption.setText(strReportCaption);\n\t\t\t}\n\t\t} else {\n\t\t\tlnrReportVoice.setVisibility(View.GONE);\n\t\t}\n\t\tupdateView();\n\t}", "public void startCommand() {\r\n _playing = true;\r\n }", "private void startPlayback() {\n // start player service using intent\n Intent intent = new Intent(mActivity, PlayerService.class);\n intent.setAction(ACTION_PLAY);\n intent.putExtra(EXTRA_STATION, mThisStation);\n mActivity.startService(intent);\n LogHelper.v(LOG_TAG, \"Starting player service.\");\n }", "public void launch() {\n if (volume == 0f) {\n return;\n }\n MediaPlayer launch = MediaPlayer.create(context, R.raw.fire);\n launch.setVolume(volume, volume);\n launch.start();\n launch.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {\n @Override\n public void onCompletion(MediaPlayer mediaPlayer) {\n mediaPlayer.reset();\n mediaPlayer.release();\n }\n });\n }", "@Override\n\tpublic void resume() {\n\t\tPhoneDevice.Settings.playMusic(PhoneDevice.Settings.MusicEnum.psyche_up);\n\t \n\t}", "private void startMusic() {\r\n final Format input1 = new AudioFormat(AudioFormat.MPEGLAYER3);\r\n final Format input2 = new AudioFormat(AudioFormat.MPEG);\r\n final Format output = new AudioFormat(AudioFormat.LINEAR);\r\n PlugInManager.addPlugIn(\r\n \"com.sun.media.codec.audio.mp3.JavaDecoder\",\r\n new Format[]{input1, input2},\r\n new Format[]{output},\r\n PlugInManager.CODEC\r\n );\r\n try {\r\n final File f = new File(\"support_files//tetris.mp3\");\r\n myPlayer = Manager.createPlayer(new MediaLocator(f.toURI().toURL()));\r\n } catch (final NoPlayerException | IOException e) {\r\n e.printStackTrace();\r\n }\r\n if (myPlayer != null) {\r\n myPlayer.start();\r\n }\r\n }", "synchronized void resumeGame() {\n try {\n myGamePause = false;\n if (!myShouldPause) {\n // if the player is null, we create a new one.\n if (myPlayer == null) {\n start();\n }\n // start the music.\n myPlayer.start();\n }\n } catch (Exception e) {\n // the music isn't necessary, so we ignore exceptions.\n }\n }", "public void play()\n {\n this.mediaPlayer = new MediaPlayer(file);\n this.mediaPlayer.setVolume(volume);\n\n // Listener for end of media.\n mediaPlayer.setOnEndOfMedia(() -> {\n this.mediaPlayer.stop();\n });\n\n mediaPlayer.play();\n }", "private void clickSound() {// this function Plays a sound when a button is clicked.\n\t\tif (mp != null) {\n\t\t\tmp.release();\n\t\t}\n\t\tmp = MediaPlayer.create(getApplicationContext(), R.raw.music2);\n\t\tmp.start();// media player is started\n\t}", "public static void playerRun()\n {\n runSound.playLooped();\n }" ]
[ "0.76894873", "0.7680285", "0.7630377", "0.757257", "0.75657207", "0.75224185", "0.74158186", "0.7401109", "0.73932767", "0.7345196", "0.73246825", "0.7210529", "0.71755815", "0.7173951", "0.7094502", "0.7088825", "0.7071853", "0.7033171", "0.6995269", "0.69608706", "0.6950135", "0.694377", "0.69427425", "0.6930023", "0.6924641", "0.691208", "0.68956625", "0.68551415", "0.6849498", "0.6836798", "0.68341804", "0.68242896", "0.68200463", "0.6788952", "0.6788539", "0.67847854", "0.67736024", "0.6768926", "0.6757075", "0.6747396", "0.6739764", "0.6717749", "0.6710198", "0.67015535", "0.6691125", "0.66831934", "0.6675787", "0.66738164", "0.6661276", "0.6658845", "0.66561854", "0.6653795", "0.66489184", "0.66481423", "0.6646155", "0.6645438", "0.66338146", "0.6630862", "0.6630161", "0.6621582", "0.66185135", "0.66160893", "0.6610299", "0.65995234", "0.6597988", "0.659146", "0.65892303", "0.65868205", "0.6581234", "0.6575567", "0.65750355", "0.65698326", "0.6564628", "0.65569276", "0.6553179", "0.6552285", "0.65504336", "0.65387344", "0.6536457", "0.652368", "0.6521521", "0.65205187", "0.65169203", "0.6515648", "0.6514512", "0.65143174", "0.65136933", "0.6511732", "0.64971495", "0.6492163", "0.64913714", "0.64819294", "0.6481039", "0.64661473", "0.6465725", "0.6465305", "0.6460836", "0.64590424", "0.64502335", "0.644657" ]
0.7020255
18
TODO Autogenerated method stub
@Override public List<CompanyMessage> selectMessage(CompanyMessage companyMessage) { return companyMessageMapper.selectMessage(companyMessage); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public int updateMessageByID(CompanyMessage companyMessage) { return companyMessageMapper.updateMessageByID(companyMessage); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPasswordField1 = new javax.swing.JPasswordField(); jLabel4 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(3, 0), new java.awt.Dimension(3, 0), new java.awt.Dimension(3, 32767)); jTextField1 = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setUndecorated(true); setSize(new java.awt.Dimension(1000, 500)); getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jPasswordField1.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N jPasswordField1.setForeground(new java.awt.Color(102, 102, 102)); jPasswordField1.setText("jPasswordField1"); jPasswordField1.setBorder(null); jPasswordField1.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { jPasswordField1FocusGained(evt); } }); jPasswordField1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jPasswordField1ActionPerformed(evt); } }); getContentPane().add(jPasswordField1, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 270, 260, 30)); jLabel4.setFont(new java.awt.Font("Microsoft YaHei UI", 0, 13)); // NOI18N jLabel4.setForeground(new java.awt.Color(182, 67, 136)); jLabel4.setText("crée un compt "); jLabel4.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { jLabel4MouseEntered(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { jLabel4MouseExited(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { jLabel4MousePressed(evt); } }); getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 380, -1, -1)); jLabel3.setFont(new java.awt.Font("Microsoft YaHei UI", 0, 13)); // NOI18N jLabel3.setForeground(new java.awt.Color(102, 102, 102)); jLabel3.setText("vous ñ'avez pas un compte ?"); getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 380, -1, -1)); jLabel2.setFont(new java.awt.Font("Tahoma", 0, 70)); // NOI18N jLabel2.setForeground(new java.awt.Color(255, 255, 255)); jLabel2.setText("x"); jLabel2.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel2MouseClicked(evt); } public void mouseEntered(java.awt.event.MouseEvent evt) { jLabel2MouseEntered(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { jLabel2MouseExited(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { jLabel2MousePressed(evt); } }); getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(1150, -10, 40, -1)); jLabel5.setIcon(new javax.swing.ImageIcon("C:\\Users\\hp\\Desktop\\POROGET_JAVA\\hover_effact\\connecter_enter.png")); // NOI18N jLabel5.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { jLabel5MouseEntered(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { jLabel5MouseExited(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { jLabel5MousePressed(evt); } }); getContentPane().add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(68, 320, -1, 60)); getContentPane().add(filler1, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 220, 330, 0)); jTextField1.setFont(new java.awt.Font("OCR A Extended", 0, 22)); // NOI18N jTextField1.setForeground(new java.awt.Color(195, 190, 190)); jTextField1.setText("nom d'utilisater"); jTextField1.setBorder(null); jTextField1.setPreferredSize(new java.awt.Dimension(200, 23)); jTextField1.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { jTextField1FocusGained(evt); } public void focusLost(java.awt.event.FocusEvent evt) { jTextField1FocusLost(evt); } }); getContentPane().add(jTextField1, new org.netbeans.lib.awtextra.AbsoluteConstraints(146, 204, 270, 40)); jLabel1.setIcon(new javax.swing.ImageIcon("C:\\Users\\hp\\Desktop\\POROGET_JAVA\\back22.jpg")); // NOI18N getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1200, 600)); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n initComponents();\n }", "public AdjointForm() {\n initComponents();\n setDefaultCloseOperation(HIDE_ON_CLOSE);\n }", "public FormListRemarking() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n \n }", "public FormPemilihan() {\n initComponents();\n }", "public GUIForm() { \n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "public TorneoForm() {\n initComponents();\n }", "public FormCompra() {\n initComponents();\n }", "public muveletek() {\n initComponents();\n }", "public Interfax_D() {\n initComponents();\n }", "public quanlixe_form() {\n initComponents();\n }", "public SettingsForm() {\n initComponents();\n }", "public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public Soru1() {\n initComponents();\n }", "public FMainForm() {\n initComponents();\n this.setResizable(false);\n setLocationRelativeTo(null);\n }", "public soal2GUI() {\n initComponents();\n }", "public EindopdrachtGUI() {\n initComponents();\n }", "public MechanicForm() {\n initComponents();\n }", "public AddDocumentLineForm(java.awt.Frame parent) {\n super(parent);\n initComponents();\n myInit();\n }", "public quotaGUI() {\n initComponents();\n }", "public BloodDonationGUI() {\n initComponents();\n }", "public Customer_Form() {\n initComponents();\n setSize(890,740);\n \n \n }", "public PatientUI() {\n initComponents();\n }", "public Oddeven() {\n initComponents();\n }", "public myForm() {\n\t\t\tinitComponents();\n\t\t}", "public intrebarea() {\n initComponents();\n }", "public Magasin() {\n initComponents();\n }", "public RadioUI()\n {\n initComponents();\n }", "public NewCustomerGUI() {\n initComponents();\n }", "public ZobrazUdalost() {\n initComponents();\n }", "public FormUtama() {\n initComponents();\n }", "public p0() {\n initComponents();\n }", "public INFORMACION() {\n initComponents();\n this.setLocationRelativeTo(null); \n }", "public ProgramForm() {\n setLookAndFeel();\n initComponents();\n }", "public AmountReleasedCommentsForm() {\r\n initComponents();\r\n }", "public form2() {\n initComponents();\n }", "public MainForm() {\n\t\tsuper(\"Hospital\", List.IMPLICIT);\n\n\t\tstartComponents();\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n setRequestFocusEnabled(false);\n setVerifyInputWhenFocusTarget(false);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 465, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 357, Short.MAX_VALUE)\n );\n }", "public kunde() {\n initComponents();\n }", "public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }", "public MusteriEkle() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public DESHBORDPANAL() {\n initComponents();\n }", "public frmVenda() {\n initComponents();\n }", "public GUIForm() {\n initComponents();\n inputField.setText(NO_FILE_SELECTED);\n outputField.setText(NO_FILE_SELECTED);\n progressLabel.setBackground(INFO);\n progressLabel.setText(SELECT_FILE);\n }", "public Botonera() {\n initComponents();\n }", "public FrmMenu() {\n initComponents();\n }", "public OffertoryGUI() {\n initComponents();\n setTypes();\n }", "public JFFornecedores() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(255, 255, 255));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 983, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 769, Short.MAX_VALUE)\n );\n\n pack();\n }", "public EnterDetailsGUI() {\n initComponents();\n }", "public vpemesanan1() {\n initComponents();\n }", "public FormHorarioSSE() {\n initComponents();\n }", "public Kost() {\n initComponents();\n }", "public frmacceso() {\n initComponents();\n }", "public UploadForm() {\n initComponents();\n }", "public HW3() {\n initComponents();\n }", "public Managing_Staff_Main_Form() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "public sinavlar2() {\n initComponents();\n }", "public P0405() {\n initComponents();\n }", "public MiFrame2() {\n initComponents();\n }", "public IssueBookForm() {\n initComponents();\n }", "public Choose1() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n\n String oldAuthor = prefs.get(\"AUTHOR\", \"\");\n if(oldAuthor != null) {\n this.authorTextField.setText(oldAuthor);\n }\n String oldBook = prefs.get(\"BOOK\", \"\");\n if(oldBook != null) {\n this.bookTextField.setText(oldBook);\n }\n String oldDisc = prefs.get(\"DISC\", \"\");\n if(oldDisc != null) {\n try {\n int oldDiscNum = Integer.parseInt(oldDisc);\n oldDiscNum++;\n this.discNumberTextField.setText(Integer.toString(oldDiscNum));\n } catch (Exception ex) {\n this.discNumberTextField.setText(oldDisc);\n }\n this.bookTextField.setText(oldBook);\n }\n\n\n }", "public GUI_StudentInfo() {\n initComponents();\n }", "public Lihat_Dokter_Keseluruhan() {\n initComponents();\n }", "public JFrmPrincipal() {\n initComponents();\n }", "public bt526() {\n initComponents();\n }", "public Pemilihan_Dokter() {\n initComponents();\n }", "public Ablak() {\n initComponents();\n }", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n\t// <editor-fold defaultstate=\"collapsed\" desc=\"Generated\n\t// Code\">//GEN-BEGIN:initComponents\n\tprivate void initComponents() {\n\n\t\tlabel1 = new java.awt.Label();\n\t\tlabel2 = new java.awt.Label();\n\t\tlabel3 = new java.awt.Label();\n\t\tlabel4 = new java.awt.Label();\n\t\tlabel5 = new java.awt.Label();\n\t\tlabel6 = new java.awt.Label();\n\t\tlabel7 = new java.awt.Label();\n\t\tlabel8 = new java.awt.Label();\n\t\tlabel9 = new java.awt.Label();\n\t\tlabel10 = new java.awt.Label();\n\t\ttextField1 = new java.awt.TextField();\n\t\ttextField2 = new java.awt.TextField();\n\t\tlabel14 = new java.awt.Label();\n\t\tlabel15 = new java.awt.Label();\n\t\tlabel16 = new java.awt.Label();\n\t\ttextField3 = new java.awt.TextField();\n\t\ttextField4 = new java.awt.TextField();\n\t\ttextField5 = new java.awt.TextField();\n\t\tlabel17 = new java.awt.Label();\n\t\tlabel18 = new java.awt.Label();\n\t\tlabel19 = new java.awt.Label();\n\t\tlabel20 = new java.awt.Label();\n\t\tlabel21 = new java.awt.Label();\n\t\tlabel22 = new java.awt.Label();\n\t\ttextField6 = new java.awt.TextField();\n\t\ttextField7 = new java.awt.TextField();\n\t\ttextField8 = new java.awt.TextField();\n\t\tlabel23 = new java.awt.Label();\n\t\ttextField9 = new java.awt.TextField();\n\t\ttextField10 = new java.awt.TextField();\n\t\ttextField11 = new java.awt.TextField();\n\t\ttextField12 = new java.awt.TextField();\n\t\tlabel24 = new java.awt.Label();\n\t\tlabel25 = new java.awt.Label();\n\t\tlabel26 = new java.awt.Label();\n\t\tlabel27 = new java.awt.Label();\n\t\tlabel28 = new java.awt.Label();\n\t\tlabel30 = new java.awt.Label();\n\t\tlabel31 = new java.awt.Label();\n\t\tlabel32 = new java.awt.Label();\n\t\tjButton1 = new javax.swing.JButton();\n\n\t\tlabel1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel1.setText(\"It seems that some of the buttons on the ATM machine are not working!\");\n\n\t\tlabel2.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel2.setText(\"Unfortunately these numbers are exactly what Professor has to use to type in his password.\");\n\n\t\tlabel3.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel3.setText(\n\t\t\t\t\"If you want to eat tonight, you have to help him out and construct the numbers of the password with the working buttons and math operators.\");\n\n\t\tlabel4.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tlabel4.setText(\"Denver's Password: 2792\");\n\n\t\tlabel5.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel5.setText(\"import java.util.Scanner;\\n\");\n\n\t\tlabel6.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel6.setText(\"public class ATM{\");\n\n\t\tlabel7.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel7.setText(\"public static void main(String[] args){\");\n\n\t\tlabel8.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel8.setText(\"System.out.print(\");\n\n\t\tlabel9.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel9.setText(\" -\");\n\n\t\tlabel10.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel10.setText(\");\");\n\n\t\ttextField1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttextField1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tlabel14.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel14.setText(\"System.out.print( (\");\n\n\t\tlabel15.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel15.setText(\"System.out.print(\");\n\n\t\tlabel16.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel16.setText(\"System.out.print( ( (\");\n\n\t\tlabel17.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel17.setText(\")\");\n\n\t\tlabel18.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel18.setText(\" +\");\n\n\t\tlabel19.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel19.setText(\");\");\n\n\t\tlabel20.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel20.setText(\" /\");\n\n\t\tlabel21.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel21.setText(\" %\");\n\n\t\tlabel22.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel22.setText(\" +\");\n\n\t\tlabel23.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel23.setText(\");\");\n\n\t\tlabel24.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel24.setText(\" +\");\n\n\t\tlabel25.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel25.setText(\" /\");\n\n\t\tlabel26.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel26.setText(\" *\");\n\n\t\tlabel27.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\t\tlabel27.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel27.setText(\")\");\n\n\t\tlabel28.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel28.setText(\")\");\n\n\t\tlabel30.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel30.setText(\"}\");\n\n\t\tlabel31.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel31.setText(\"}\");\n\n\t\tlabel32.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel32.setText(\");\");\n\n\t\tjButton1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tjButton1.setText(\"Check\");\n\t\tjButton1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\tjButton1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n\t\tlayout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(28).addGroup(layout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING).addComponent(getDoneButton()).addComponent(jButton1)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, 774, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addGap(92).addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15, GroupLayout.PREFERRED_SIZE, 145,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(37))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(174)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(7)))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label23, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20).addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(23).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16, GroupLayout.PREFERRED_SIZE, 177,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createParallelGroup(Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap()\n\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup().addGroup(layout.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(19)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(78)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(76)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(75)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(27))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel23,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(29)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))))\n\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t.addGap(30)\n\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(25)\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(26).addComponent(jButton1).addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(getDoneButton()).addContainerGap(23, Short.MAX_VALUE)));\n\t\tthis.setLayout(layout);\n\n\t\tlabel16.getAccessibleContext().setAccessibleName(\"System.out.print( ( (\");\n\t\tlabel17.getAccessibleContext().setAccessibleName(\"\");\n\t\tlabel18.getAccessibleContext().setAccessibleName(\" +\");\n\t}", "public Pregunta23() {\n initComponents();\n }", "public FormMenuUser() {\n super(\"Form Menu User\");\n initComponents();\n }", "public AvtekOkno() {\n initComponents();\n }", "public busdet() {\n initComponents();\n }", "public Ventaform() {\n initComponents();\n }", "public ViewPrescriptionForm() {\n initComponents();\n }", "public Kuis2() {\n initComponents();\n }", "public CreateAccount_GUI() {\n initComponents();\n }", "public Carrera() {\n initComponents();\n }", "public POS1() {\n initComponents();\n }", "public EqGUI() {\n initComponents();\n }", "public JFriau() {\n initComponents();\n this.setLocationRelativeTo(null);\n this.setTitle(\"BuNus - Budaya Nusantara\");\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setBackground(new java.awt.Color(204, 204, 204));\n setMinimumSize(new java.awt.Dimension(1, 1));\n setPreferredSize(new java.awt.Dimension(760, 402));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 750, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n }", "public nokno() {\n initComponents();\n }", "public dokter() {\n initComponents();\n }", "public ConverterGUI() {\n initComponents();\n }", "public hitungan() {\n initComponents();\n }", "public Modify() {\n initComponents();\n }", "public frmAddIncidencias() {\n initComponents();\n }", "public FP_Calculator_GUI() {\n initComponents();\n \n setVisible(true);\n }" ]
[ "0.7318655", "0.7289971", "0.7289971", "0.7289971", "0.72860885", "0.7247684", "0.7213551", "0.72080934", "0.7195069", "0.7189731", "0.7183451", "0.71579945", "0.7147311", "0.7092687", "0.70798934", "0.7055229", "0.69868284", "0.6976656", "0.6954658", "0.6952896", "0.69449455", "0.6941766", "0.6935132", "0.6930653", "0.6926533", "0.6924141", "0.6924061", "0.691111", "0.69099087", "0.6892076", "0.68916506", "0.68900466", "0.6889725", "0.68877757", "0.68822116", "0.6881593", "0.688101", "0.68768275", "0.687494", "0.68733007", "0.6870892", "0.6859287", "0.6855569", "0.68548936", "0.6854684", "0.6854257", "0.68525183", "0.6851817", "0.6851817", "0.6842853", "0.68366945", "0.68358713", "0.68282205", "0.6827655", "0.68258286", "0.68239987", "0.68230146", "0.6816489", "0.68163615", "0.68090576", "0.6808936", "0.68077636", "0.6806842", "0.6806332", "0.68016505", "0.67948395", "0.67940617", "0.67914915", "0.6789197", "0.6788211", "0.6787595", "0.67870516", "0.678107", "0.6765869", "0.67651415", "0.6764227", "0.675663", "0.67545617", "0.67512757", "0.6750906", "0.6742937", "0.6738739", "0.67365867", "0.67357975", "0.673252", "0.6726489", "0.67264307", "0.67190623", "0.6715255", "0.6713752", "0.67136234", "0.6707712", "0.67064816", "0.6703903", "0.6700871", "0.6698895", "0.6698197", "0.66973954", "0.66938066", "0.66912496", "0.66892624" ]
0.0
-1
/ Set the Nimbus look and feel / If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. For details see
public static void main(String args[]) { try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Windows".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(menu2.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(menu2.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(menu2.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(menu2.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new menu2().setVisible(true); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void setLookAndFeel() {\n try {\n for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n\n // TODO: Configure theming colors. UIManager.put(property, new Color(...));\n // {@see http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/_nimbusDefaults.html}\n\n\t\t\tfinal NimbusLookAndFeel laf = new NimbusLookAndFeel();\n UIManager.setLookAndFeel(laf);\n UIDefaults defaults = laf.getDefaults();\n defaults.put(\"List[Selected].textForeground\",\n laf.getDerivedColor(\"nimbusLightBackground\", 0.0f, 0.0f, 0.0f, 0, false));\n defaults.put(\"List[Selected].textBackground\",\n laf.getDerivedColor(\"nimbusSelectionBackground\", 0.0f, 0.0f, 0.0f, 0, false));\n defaults.put(\"List[Disabled+Selected].textBackground\",\n laf.getDerivedColor(\"nimbusSelectionBackground\", 0.0f, 0.0f, 0.0f, 0, false));\n defaults.put(\"List[Disabled].textForeground\",\n laf.getDerivedColor(\"nimbusDisabledText\", 0.0f, 0.0f, 0.0f, 0, false));\n defaults.put(\"List:\\\"List.cellRenderer\\\"[Disabled].background\",\n laf.getDerivedColor(\"nimbusSelectionBackground\", 0.0f, 0.0f, 0.0f, 0, false));\n\n } catch (Exception e) {}\n }", "@SuppressWarnings(\"unused\")\n private static void activateNimbus() //just for testing reasons\n {\n try {\n for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (Exception e) {\n log.warn(\"error in nimbus activation?\", e);\n }\n }", "static void customizeNimbus()\r\n\t\tthrows Exception\r\n\t{\n\t\tUIManager.put(\"control\", BACKGROUND);\r\n\r\n\t\t// TODO: imilne 04/SEP/2009 - No longer working since JRE 1.6.0_u13\r\n\t\tif (SystemUtils.isWindows())\r\n\t\t{\r\n\t\t\tUIManager.put(\"defaultFont\", FONT);\r\n\t\t\tUIManager.put(\"Label[Enabled].font\", FONT);\r\n\t\t\tUIManager.put(\"Table[Enabled].font\", FONT);\r\n\t\t\tUIManager.put(\"TableHeader[Enabled].font\", FONT);\r\n\t\t\tUIManager.put(\"TabbedPane[Enabled].font\", FONT);\r\n\t\t\tUIManager.put(\"ComboBox[Enabled].font\", FONT);\r\n\t\t\tUIManager.put(\"Button[Enabled].font\", FONT);\r\n\t\t\tUIManager.put(\"ToggleButton[Enabled].font\", FONT);\r\n\t\t\tUIManager.put(\"TextField[Enabled].font\", FONT);\r\n\t\t\tUIManager.put(\"CheckBox[Enabled].font\", FONT);\r\n\t\t}\r\n\r\n\t\tfor (UIManager.LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels())\r\n\t\t\tif (laf.getName().equals(\"Nimbus\"))\r\n\t\t\t\tUIManager.setLookAndFeel(laf.getClassName());\r\n\r\n\r\n\t\tUIManager.put(\"SplitPane[Enabled].size\", 8);\r\n\r\n\t\tUIManager.put(\"nimbusOrange\", new Color(51, 98, 140));\r\n//\t\tUIManager.put(\"nimbusOrange\", new Color(57, 105, 138));\r\n//\t\tUIManager.put(\"nimbusOrange\", new Color(115, 164, 209));\r\n\r\n\r\n\t\t// Reset non-Aqua look and feels to use CMD+C/X/V rather than CTRL for copy/paste stuff\r\n\t\tif (SystemUtils.isMacOS())\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Setting OS X keyboard shortcuts\");\r\n\r\n\t\t\tInputMap textField = (InputMap) UIManager.get(\"TextField.focusInputMap\");\r\n\t\t\ttextField.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.META_DOWN_MASK), DefaultEditorKit.copyAction);\r\n\t\t\ttextField.put(KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.META_DOWN_MASK), DefaultEditorKit.pasteAction);\r\n\t\t\ttextField.put(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.META_DOWN_MASK), DefaultEditorKit.cutAction);\r\n\t\t\ttextField.put(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.META_DOWN_MASK), DefaultEditorKit.selectAllAction);\r\n\r\n\t\t\tInputMap textArea = (InputMap) UIManager.get(\"TextArea.focusInputMap\");\r\n\t\t\ttextArea.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.META_DOWN_MASK), DefaultEditorKit.copyAction);\r\n\t\t\ttextArea.put(KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.META_DOWN_MASK), DefaultEditorKit.pasteAction);\r\n\t\t\ttextArea.put(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.META_DOWN_MASK), DefaultEditorKit.cutAction);\r\n\t\t\ttextArea.put(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.META_DOWN_MASK), DefaultEditorKit.selectAllAction);\r\n\t\t}\r\n\t}", "public final static void setDesign() {\n\t\t\ttry{\n\t\t\t\tUIManager.setLookAndFeel(\"com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel\");\n\t\t\t}catch(Exception e){\n\t\t\t\tSystem.out.println(\"Prob with setDesign()\");\n\t\t\t}\n\t\t\t\n\t\t}", "public static void LookAndFeel() {\n\t\ttry {\n\t\t\tUIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); // uniformed\n\t\t} catch (Exception exc) {\n\t\t}\n\t}", "public examreports() {\n dblogincred();\n initComponents();\n try {\n for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n} catch (Exception e) {\n // If Nimbus is not available, you can set the GUI to another look and feel.\n}\n }", "private static void setLook() {\r\n try {\r\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r\n } catch (IllegalAccessException ex) {\r\n ex.printStackTrace();\r\n } catch (UnsupportedLookAndFeelException ex) {\r\n ex.printStackTrace();\r\n } catch (ClassNotFoundException ex) {\r\n ex.printStackTrace();\r\n } catch (InstantiationException ex) {\r\n ex.printStackTrace();\r\n }\r\n }", "private boolean isNimbus()\n/* */ {\n/* 152 */ return UIManager.getLookAndFeel().getName().contains(\"Nimbus\");\n/* */ }", "private void LookAndFeel() {\n try {\n // Set System L&F\n BasicLookAndFeel darcula = new DarculaLaf();\n UIManager.setLookAndFeel(darcula);\n } catch (UnsupportedLookAndFeelException e) {\n // handle exception\n }\n }", "private String getLookAndFeelClassName(String nimbus) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "protected static void initLnF() {\r\n try {\r\n if (!\"com.sun.java.swing.plaf.motif.MotifLookAndFeel\".equals(UIManager.getSystemLookAndFeelClassName())\r\n && !\"com.sun.java.swing.plaf.gtk.GTKLookAndFeel\".equals(UIManager.getSystemLookAndFeelClassName())\r\n && !UIManager.getSystemLookAndFeelClassName().equals(UIManager.getLookAndFeel().getClass().getName())) {\r\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r\n }\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }", "private static void setLookAndFeel() { \r\n try {\r\n UIManager.setLookAndFeel(\"javax.swing.plaf.metal.MetalLookAndFeel\"); \r\n } catch (final UnsupportedLookAndFeelException e) {\r\n System.out.println(\"UnsupportedLookAndFeelException\");\r\n } catch (final ClassNotFoundException e) {\r\n System.out.println(\"ClassNotFoundException\");\r\n } catch (final InstantiationException e) {\r\n System.out.println(\"InstantiationException\");\r\n } catch (final IllegalAccessException e) {\r\n System.out.println(\"IllegalAccessException\");\r\n } \r\n }", "private void configuraInterface() {\n\t\tJFrame.setDefaultLookAndFeelDecorated(true);\n\t\ttry\t{\n\t\t\tUIManager.setLookAndFeel(\"com.sun.java.swing.plaf.windows.WindowsLookAndFeel\");\n\t\t}\n\t\tcatch (Exception ex) {\n\t\t\tSystem.out.println(\"Falhou o carregamento do L&F: \");\n\t\t\tSystem.out.println(ex);\n\t\t}\n\t}", "public static void windowLookAndFeel(){\r\n\t try{\r\n\t UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r\n\t }catch (Exception e) {\r\n\t System.out.println(\"Look and Feel error: \" + e);\r\n\t }\r\n\t}", "private static void setLookAndFeel() {\n\tSystem.setProperty(\"apple.laf.useScreenMenuBar\", \"true\");\n\n\ttry {\n\t UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n\n\t //copy progress bar of System LAF\n\t HashMap<Object, Object> progressDefaults = new HashMap<Object, Object>();\n\t for (Map.Entry<Object, Object> entry : UIManager.getDefaults()\n\t\t .entrySet()) {\n\t\tif (entry.getKey().getClass() == String.class\n\t\t\t&& ((String) entry.getKey()).startsWith(\"ProgressBar\")) {\n\t\t progressDefaults.put(entry.getKey(), entry.getValue());\n\t\t}\n\t }\n\n\t prepareLayout();\n\n\t UIManager\n\t\t .setLookAndFeel(\"com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel\");\n\n\t // copy back progress bar of metal Look and Feel\n\t for (Map.Entry<Object, Object> entry : progressDefaults.entrySet()) {\n\t\tUIManager.getDefaults().put(entry.getKey(), entry.getValue());\n\t }\n\t} catch (ClassNotFoundException e) {\n\t // TODO Auto-generated catch block\n\t e.printStackTrace();\n\t} catch (InstantiationException e) {\n\t // TODO Auto-generated catch block\n\t e.printStackTrace();\n\t} catch (IllegalAccessException e) {\n\t // TODO Auto-generated catch block\n\t e.printStackTrace();\n\t} catch (UnsupportedLookAndFeelException e) {\n\t // TODO Auto-generated catch block\n\t e.printStackTrace();\n\t}\n\n }", "private void nativeLookAndFeel() {\n\n try {\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n } catch (UnsupportedLookAndFeelException | ClassNotFoundException | InstantiationException | IllegalAccessException e) {\n e.printStackTrace();\n }\n }", "private void setNativeLAndF() {\r\n\t\ttry {\r\n\t\t\tUIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r\n\t\t} catch (Exception e) {\r\n\t\t\t//do nothing. It will default to normal\r\n\t\t}\r\n\t}", "public void applyLookAndFeel() {\n\r\n\t\tLookAndFeelInfo[] infos = UIManager.getInstalledLookAndFeels();\r\n\r\n\t\tif (look < 0) {\r\n\t\t\tfor (int i = 0; i < infos.length; i++) {\r\n\t\t\t\tif (infos[i].getName().toUpperCase().contains(\"NIMBUS\")) {\r\n\t\t\t\t\tlook = i;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (look < 0) {\r\n\t\t\tfor (int i = 0; i < infos.length; i++) {\r\n\t\t\t\tif (infos[i].getName().toUpperCase().contains(\"WINDOW\")) {\r\n\t\t\t\t\tlook = i;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlook = (Math.abs(look) % infos.length);\r\n\r\n\t\tString lookName = infos[look].getName();\r\n\r\n\t\ttry {\r\n \t\tUIManager.setLookAndFeel(infos[look].getClassName());\r\n \t\tsetTitle(JMTKResizer.ABOUT + \" - \" + lookName);\r\n \tSwingUtilities.updateComponentTreeUI(this);\r\n \t\t//pack();\r\n\r\n \t} catch (Exception e) {\r\n \t\te.printStackTrace();\r\n \t}\r\n\t}", "private void menuNimbusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuNimbusActionPerformed\n try {\n UIManager.setLookAndFeel(\"com.sun.java.swing.plaf.motif.MotifLookAndFeel\");\n SwingUtilities.updateComponentTreeUI(this);\n } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {\n Logger.getLogger(MoneyMinderDesktopMainGui.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "private static void initLookAndFeel()\n {\n try \n {\n UIManager.setLookAndFeel(\"de.javasoft.plaf.synthetica.SyntheticaAluOxideLookAndFeel\");\n }\n \n catch(ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e)\n {\n JOptionPane.showMessageDialog(null, \"Failed to load resource package\");\n }\n }", "private void setupLookAndFeel() {\n SwingUtilities.invokeLater(() -> {\n model.getUserPreferences().getThemeSubject().subscribe((skin) -> {\n try {\n UIManager.setLookAndFeel(new SubstanceLookAndFeel(\n (SubstanceSkin) skin.getTheme().newInstance()\n ) {\n });\n if (frame != null) {\n frame.repaint();\n }\n } catch (UnsupportedLookAndFeelException | InstantiationException | IllegalAccessException e) {\n ExceptionHandler.get().handle(e);\n }\n });\n });\n }", "public static void setLookAndFeel(){\n\t\t\n\t\tUIManager.put(\"nimbusBase\", new Color(0,68,102));\n\t\tUIManager.put(\"nimbusBlueGrey\", new Color(60,145,144));\n\t\tUIManager.put(\"control\", new Color(43,82,102));\n\t\tUIManager.put(\"text\", new Color(255,255,255));\n\t\tUIManager.put(\"Table.alternateRowColor\", new Color(0,68,102));\n\t\tUIManager.put(\"TextField.font\", new Font(\"Font\", Font.BOLD, 12));\n\t\tUIManager.put(\"TextField.textForeground\", new Color(0,0,0));\n\t\tUIManager.put(\"PasswordField.foreground\", new Color(0,0,0));\n\t\tUIManager.put(\"TextArea.foreground\", new Color(0,0,0));\n\t\tUIManager.put(\"FormattedTextField.foreground\", new Color(0,0,0));\n\t\t\n\t\tUIManager.put(\"ComboBox:\\\"ComboBox.listRenderer\\\".background\", new Color(0,68,102));\n\t\tUIManager.put(\"ComboBox:\\\"ComboBox.listRenderer\\\"[Selected].background\", new Color(0,0,0));\n\t\t\n\t\t//TODO nie chca dzialac tooltipy na mapie\n\t\tBorder border = BorderFactory.createLineBorder(new Color(0,0,0)); //#4c4f53\n\t\tUIManager.put(\"ToolTip.border\", border);\n\n\t\t//UIManager.put(\"ToolTip.foregroundInactive\", new Color(0,0,0));\n\t\t//UIManager.put(\"ToolTip.backgroundInactive\", new Color(0,0,0));\n\t\t//UIManager.put(\"ToolTip.background\", new Color(0,0,0)); //#fff7c8\n\t\t//UIManager.put(\"ToolTip.foreground\", new Color(0,0,0));\n\t\t Painter<Component> p = new Painter<Component>() {\n\t\t public void paint(Graphics2D g, Component c, int width, int height) {\n\t\t g.setColor(new Color(20,36,122));\n\t\t //and so forth\n\t\t }\n\t\t };\n\t\t \n\t\tUIManager.put(\"ToolTip[Enabled].backgroundPainter\", p);\n\n//\t\tUIManager.getLookAndFeelDefaults().put(\"ToolTip.foregroundInactive\", new Color(255, 255, 255));\n//\t\tUIManager.getLookAndFeelDefaults().put(\"backgroundInactive\", new Color(255, 255, 255));\n//\t\tUIManager.getLookAndFeelDefaults().put(\"ToolTip.background\", new Color(255, 255, 255)); //#fff7c8\n//\t\tUIManager.getLookAndFeelDefaults().put(\"ToolTip.foreground\", new Color(255, 255, 255));\n//\t\t\n//\t\tUIManager.getLookAndFeelDefaults().put(\"ToolTip.foregroundInactive\",new ColorUIResource(new Color(255, 255, 255)));\n//\t\tUIManager.getLookAndFeelDefaults().put(\"backgroundInactive\", new ColorUIResource((new Color(255, 255, 255))));\n//\t\tUIManager.getLookAndFeelDefaults().put(\"ToolTip.background\", new ColorUIResource(new Color(255, 255, 255))); //#fff7c8\n//\t\tUIManager.getLookAndFeelDefaults().put(\"ToolTip.foreground\", new ColorUIResource(new Color(255, 255, 255)));\n\t\t\n\t \n\t\ttry {\n\t\t for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {\n\t\t if (\"Nimbus\".equals(info.getName())) {\n\t\t UIManager.setLookAndFeel(info.getClassName());\n\t\t break;\n\t\t }\n\t\t }\n\t\t} catch (Exception e) {\n\t\t // If Nimbus is not available, you can set the GUI to another look and feel.\n\t\t}\n\n\t\tUIManager.getLookAndFeelDefaults().put(\"Table:\\\"Table.cellRenderer\\\".background\", new ColorUIResource(new Color(74,144,178)));\n\t\tUIManager.getLookAndFeelDefaults().put(\"Table.background\", new ColorUIResource(new Color(74,144,178)));\n\t\t\n\n\t}", "public static String setLookAndFeel(String look) {\n UIManager.put(\"swing.boldMetal\", Boolean.FALSE); //$NON-NLS-1$\n // Display slider value is set to false (already in all LAF by the panel title), used by GTK LAF\n UIManager.put(\"Slider.paintValue\", Boolean.FALSE); //$NON-NLS-1$\n\n String laf = getAvailableLookAndFeel(look);\n try {\n UIManager.setLookAndFeel(laf);\n } catch (Exception e) {\n laf = UIManager.getSystemLookAndFeelClassName();\n LOGGER.error(\"Unable to set the Look&Feel\", e); //$NON-NLS-1$\n }\n // Fix font issue for displaying some Asiatic characters. Some L&F have special fonts.\n setUIFont(new javax.swing.plaf.FontUIResource(\"SansSerif\", Font.PLAIN, 12)); //$NON-NLS-1$\n return laf;\n }", "public JFind2() {\n try {\n String metal = \"javax.swing.plaf.metal.MetalLookAndFeel\";\n String synth = \"javax.swing.plaf.synth.SynthLookAndFeel\"; // --> since JDK-1.5\n\n String gtk = \"com.sun.java.swing.plaf.gtk.GTKLookAndFeel\"; // -> since JDK-1.4\n\n String motif = \"com.sun.java.swing.plaf.motif.MotifLookAndFeel\";\n String windows = \"com.sun.java.swing.plaf.windows.WindowsLookAndFeel\";\n\n String os = System.getProperty(\"os.name\");\n if (os.startsWith(\"Linux\")) {\n try // Install client system look and feel.\n {\n UIManager.setLookAndFeel(metal);\n } catch (Exception e) {\n }\n } else {\n try // Install client system look and feel.\n {\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n } catch (Exception e) {\n }\n }\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n\n preInit();\n initComponents();\n postInit();\n\n }", "public void lookandfeel(){\n \n try{\n UIManager.setLookAndFeel(seta_look);\n SwingUtilities.updateComponentTreeUI(this);\n }\n catch(Exception erro){\n JOptionPane.showMessageDialog(null, erro);\n \n }\n}", "public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException,\n\t\t\tUnsupportedLookAndFeelException {\n\t\tdetermineOS();\n\t\tif (currentOs == MAC_OS) {\n\t\t\tSystem.setProperty(\"com.apple.mrj.application.apple.menu.about.name\", \"UP-Admin\");\n\t\t\tSystem.setProperty(\"apple.laf.useScreenMenuBar\", \"true\");\n\t\t\tSystem.setProperty(\"com.apple.mrj.application.live-resize\", \"true\");\n\n\t\t\ttry {\n\t\t\t\tUIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (InstantiationException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IllegalAccessException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (UnsupportedLookAndFeelException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} else if ((currentOs == WIN_OS) || (currentOs == null)) {\n\n\t\t\tUIManager.put(\"nimbusBase\", new Color(0x525252));\n\t\t\tUIManager.put(\"control\", new Color(0x949494));\n\t\t\tUIManager.put(\"nimbusSelectionBackground\", new Color(0x171717));\n\t\t\tUIManager.put(\"Menu.background\", new Color(0x2B2B2B));\n\t\t\tUIManager.put(\"background\", new Color(0x171717));\n\t\t\tUIManager.put(\"DesktopIcon.background\", new Color(0x171717));\n\t\t\tUIManager.put(\"nimbusLightBackground\", new Color(0xE3E3E3));\n\t\t\tUIManager.setLookAndFeel(\"com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel\");\n\t\t\t\n\t\t}\n\n\t\tEventQueue.invokeLater(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tFrame frame = new Frame();\n\t\t\t\t\tframe.setVisible(true);\n\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "private void setupSwing() {\r\n SwingUtilities.invokeLater(new Runnable() {\r\n @Override\r\n public void run() {\r\n \r\n try {\r\n for (LookAndFeelInfo info: UIManager.getInstalledLookAndFeels()) {\r\n if (info.getName().equals(\"Windows\")) {\r\n UIManager.setLookAndFeel(info.getClassName());\r\n }\r\n }\r\n } catch (ClassNotFoundException \r\n | InstantiationException\r\n | IllegalAccessException \r\n | UnsupportedLookAndFeelException e) {\r\n e.printStackTrace(System.err);\r\n }\r\n \r\n window = new ManagerWindow(MetagridManager.this);\r\n window.pack();\r\n window.setVisible(true);\r\n }\r\n });\r\n }", "public static void main(String[] args) {\r\n SageLife sagelife = new SageLife();\r\n\r\n try {\r\n for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {\r\n if (\"Nimbus\".equals(info.getName())) {\r\n UIManager.setLookAndFeel(info.getClassName());\r\n break;\r\n }\r\n }\r\n } catch (Exception e) {\r\n // If Nimbus is not available, you can set the GUI to another look and feel.\r\n }\r\n\r\n sagelife.createLayout();\r\n }", "private LookAndFeelManager() {}", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n \n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n \n \n /* Create and display the form */ \n \n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new home().setVisible(true);\n }\n });\n }", "public Q4() {\n initComponents();\n looks=UIManager.getInstalledLookAndFeels();\n }", "public static void main(String args[]) {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(UI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(UI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(UI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(UI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n UI tesis = new UI();\n tesis.setVisible(true);\n try {\n tesis.inicializar(); \n } catch (NullPointerException e) {\n System.out.println(\"Ejecución terminada forzosamente\");\n System.exit(1);\n }\n }\n });\n }", "@Override\n public void init() {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(TugasB.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(TugasB.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(TugasB.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(TugasB.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the applet */\n try {\n java.awt.EventQueue.invokeAndWait(new Runnable() {\n public void run() {\n initComponents();\n }\n });\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "@Override\r\n public void init() {\r\n /* Set the Nimbus look and feel */\r\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\r\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\r\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \r\n */\r\n try {\r\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\r\n if (\"Nimbus\".equals(info.getName())) {\r\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\r\n break;\r\n }\r\n }\r\n } catch (ClassNotFoundException ex) {\r\n java.util.logging.Logger.getLogger(IMC.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\r\n } catch (InstantiationException ex) {\r\n java.util.logging.Logger.getLogger(IMC.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\r\n } catch (IllegalAccessException ex) {\r\n java.util.logging.Logger.getLogger(IMC.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\r\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\r\n java.util.logging.Logger.getLogger(IMC.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\r\n }\r\n //</editor-fold>\r\n\r\n /* Create and display the applet */\r\n try {\r\n java.awt.EventQueue.invokeAndWait(new Runnable() {\r\n public void run() {\r\n initComponents();\r\n }\r\n });\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }", "private void configureUI() {\r\n // UIManager.put(\"ToolTip.hideAccelerator\", Boolean.FALSE);\r\n\r\n Options.setDefaultIconSize(new Dimension(18, 18));\r\n\r\n Options.setUseNarrowButtons(settings.isUseNarrowButtons());\r\n\r\n // Global options\r\n Options.setTabIconsEnabled(settings.isTabIconsEnabled());\r\n UIManager.put(Options.POPUP_DROP_SHADOW_ENABLED_KEY,\r\n settings.isPopupDropShadowEnabled());\r\n\r\n // Swing Settings\r\n LookAndFeel selectedLaf = settings.getSelectedLookAndFeel();\r\n if (selectedLaf instanceof PlasticLookAndFeel) {\r\n PlasticLookAndFeel.setPlasticTheme(settings.getSelectedTheme());\r\n PlasticLookAndFeel.setTabStyle(settings.getPlasticTabStyle());\r\n PlasticLookAndFeel.setHighContrastFocusColorsEnabled(\r\n settings.isPlasticHighContrastFocusEnabled());\r\n } else if (selectedLaf.getClass() == MetalLookAndFeel.class) {\r\n MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());\r\n }\r\n\r\n // Work around caching in MetalRadioButtonUI\r\n JRadioButton radio = new JRadioButton();\r\n radio.getUI().uninstallUI(radio);\r\n JCheckBox checkBox = new JCheckBox();\r\n checkBox.getUI().uninstallUI(checkBox);\r\n\r\n try {\r\n UIManager.setLookAndFeel(selectedLaf);\r\n } catch (Exception e) {\r\n System.out.println(\"Can't change L&F: \" + e);\r\n }\r\n\r\n }", "public static void main(String[] args) {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(siniestro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(siniestro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(siniestro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(siniestro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n EventQueue.invokeLater(new Runnable() {\n public void run() {\n JFrame frame = new JFrame();\n frame.setContentPane(new siniestro());\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.pack();\n frame.setVisible(true);\n }\n });\n }", "@Override\n public void init() {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n getContentPane().setBackground(Color.BLUE);\n this.setSize(450, 350);\n\n /* Create and display the applet */\n /*try {\n java.awt.EventQueue.invokeAndWait(new Runnable() {\n public void run() {\n initComponents();\n }\n });\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n */\n run();\n }", "public static void start() {\n\t\ttry {\n\t\t\tfor (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n\t\t\t\tif (\"Nimbus\".equals(info.getName())) {\n\t\t\t\t\tjavax.swing.UIManager.setLookAndFeel(info.getClassName());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (ClassNotFoundException ex) {\n\t\t\tjava.util.logging.Logger.getLogger(GUInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n\t\t} catch (InstantiationException ex) {\n\t\t\tjava.util.logging.Logger.getLogger(GUInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n\t\t} catch (IllegalAccessException ex) {\n\t\t\tjava.util.logging.Logger.getLogger(GUInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n\t\t} catch (javax.swing.UnsupportedLookAndFeelException ex) {\n\t\t\tjava.util.logging.Logger.getLogger(GUInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n\t\t}\n //</editor-fold>\n\n\t\t/* Create and display the form */\n\t\tjava.awt.EventQueue.invokeLater(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tnew GUInterface().setVisible(true);\n\t\t\t}\n\t\t});\n\t}", "public static void main(String args[]) {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(HFGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(HFGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(HFGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(HFGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new HFGUI().setVisible(true);\n }\n });\n }", "public void setTheme(String name) {\n\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (name.equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(UserInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(UserInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(UserInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(UserInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n }", "public static void main(String args[]) {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(InicioSesion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(InicioSesion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(InicioSesion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(InicioSesion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new InicioSesion().setVisible(true);\n }\n });\n }", "public static void main(String[] args) {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(JFrame_Accueil.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(JFrame_Accueil.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(JFrame_Accueil.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(JFrame_Accueil.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n \n /* Create and display the form */\n java.awt.EventQueue.invokeLater(() -> {\n try {\n new JFrame_Accueil(0).setVisible(true);\n } catch (Exception ex) {\n Logger.getLogger(JFrame_Accueil.class.getName()).log(Level.SEVERE, null, ex);\n }\n });\n }", "public static void main(String[] args) {\r\n /* Set the Nimbus look and feel */\r\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\r\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\r\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html\r\n */\r\n try {\r\n javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());\r\n } catch (ClassNotFoundException ex) {\r\n java.util.logging.Logger.getLogger(FrameCuentasContablesAdmin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\r\n } catch (InstantiationException ex) {\r\n java.util.logging.Logger.getLogger(FrameCuentasContablesAdmin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\r\n } catch (IllegalAccessException ex) {\r\n java.util.logging.Logger.getLogger(FrameCuentasContablesAdmin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\r\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\r\n java.util.logging.Logger.getLogger(FrameCuentasContablesAdmin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\r\n }\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n\r\n /* Create and display the form */\r\n EventQueue.invokeLater(new Runnable() {\r\n public void run() {\r\n JFrame frame = new JFrame();\r\n frame.setContentPane(new FrameCuentasContablesAdmin());\r\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n frame.pack();\r\n frame.setVisible(true);\r\n }\r\n });\r\n }", "private void changeUIdefaults() {\n\t\tUIManager.put(\"TaskPaneContainer.useGradient\", Boolean.FALSE);\n\t\tUIManager.put(\"TaskPaneContainer.background\",\n\t\t\t\tColors.LightGray.color(0.5f));\n\n\t\t// setting taskpane defaults\n\t\tUIManager.put(\"TaskPane.font\", new FontUIResource(new Font(\"Verdana\",\n\t\t\t\tFont.BOLD, 16)));\n\t\tUIManager.put(\"TaskPane.titleBackgroundGradientStart\",\n\t\t\t\tColors.White.color());\n\t\tUIManager.put(\"TaskPane.titleBackgroundGradientEnd\",\n\t\t\t\tColors.LightBlue.color());\n\t}", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n \n\n}\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(NewJFrame1.class\n.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n \n\n} catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(NewJFrame1.class\n.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n \n\n} catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(NewJFrame1.class\n.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n \n\n} catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(NewJFrame1.class\n.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new NewJFrame1().setVisible(true);\n }\n });\n }", "@Override\r\n\tpublic void run() {\n\t\ttry {\r\n\t\t\tLookAndFeelInfo look[] = UIManager.getInstalledLookAndFeels();\r\n\t\t\tfor (LookAndFeelInfo lookAndFeelInfo : look) {\r\n\r\n\t\t\t\tSystem.out.println(lookAndFeelInfo.getClassName());\r\n\t\t\t}\r\n\t\t\tUIManager.setLookAndFeel(this.config.getLookAndFeel());\r\n\t\t} catch (ClassNotFoundException | InstantiationException\r\n\t\t\t\t| IllegalAccessException | UnsupportedLookAndFeelException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tsetVisible(true);\r\n\t}", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {\n Logger.getLogger(InterpreterGui.class.getName()).log(Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(() -> {\n new InterpreterGui().setVisible(true);\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Calculator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Calculator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Calculator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Calculator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new Calculator().setVisible(true);\n }\n } \n );\n}", "public void setLAF(String lookAndFeelStr) {\n String exceptionNotice = \"\";\n try {\n // Set the font for Metal LAF to non-bold, in case Metal is used\n UIManager.put(\"swing.boldMetal\", Boolean.FALSE);\n if (lookAndFeelStr == null || lookAndFeelStr.equalsIgnoreCase(\"Metal\")) {\n UIManager.setLookAndFeel(new MetalLookAndFeel());\n } else\n if (lookAndFeelStr.equalsIgnoreCase(\"Nimbus\")) {\n for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {\n if (info.getName().equals(\"Nimbus\")) {\n UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } else {\n UIManager.setLookAndFeel(lookAndFeelStr);\n }\n } catch (UnsupportedLookAndFeelException e) {\n exceptionNotice = \"UnsupportedLookAndFeelException\";\n } catch (ClassNotFoundException e) {\n exceptionNotice = \"ClassNotFoundException\";\n } catch (InstantiationException e) {\n exceptionNotice = \"InstantiationException\";\n } catch (IllegalAccessException e) {\n exceptionNotice = \"IllegalAccessException\";\n } finally {\n if (! exceptionNotice.isEmpty()) {\n try {\n // The desired LAF was not created, so try to use the Metal LAF as a default.\n UIManager.setLookAndFeel(new MetalLookAndFeel());\n } catch (UnsupportedLookAndFeelException e) {\n logger.error(\"Could not initialize the Swing Look and Feel settings, MCT is closing.\");\n System.exit(1);\n }\n }\n }\n // Look and Feel has been successfully created, now set colors\n initializeColors(UIManager.getLookAndFeel());\n Properties props = new Properties();\n String filename = System.getProperty(viewColor,\"resources/properties/viewColor.properties\");\n FileReader reader = null;\n try {\n \treader = new FileReader(filename);\n \tprops.load(reader);\n BASE_PROPERTIES = new ColorScheme(props);\n BASE_PROPERTIES.applyColorScheme(); // Apply top-level color bindings\n } catch (Exception e) {\n logger.warn(\"Using default color and font properties because could not open viewColor properties file :\"+filename);\n BASE_PROPERTIES = new ColorScheme();\n } finally {\n \ttry {\n if (reader != null) reader.close();\n } catch(IOException ioe1){ }\n }\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Form.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Form.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Form.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Form.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new Form().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(LibroDiario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(LibroDiario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(LibroDiario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(LibroDiario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new LibroDiario().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(KamarFrom.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(KamarFrom.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(KamarFrom.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(KamarFrom.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new KamarFrom().setVisible(true);\n }\n });\n }", "protected void installDefaults() {\n this.controlPanel.setBackground(null);\n\n Font font = this.controlPanel.getFont();\n if (font == null || font instanceof UIResource) {\n Font toSet = RadianceThemingCortex.GlobalScope.getFontPolicy().getFontSet().\n getControlFont();\n this.controlPanel.setFont(toSet);\n }\n }", "static public LookAndFeelManager createDefaultLookAndFeelManager()\n {\n LookAndFeelManager manager = new LookAndFeelManager();\n\n /* =-=AEW DO NOT register the external look-and-feels; these\n class names are UIX 2.2 look-and-feels, which won't (and can't)\n work in UIX 3, given the different class names. Only uncomment\n if and when such classes are ported to UIX 3.\n // support requests from iasWireless if laf can be found\n _registerExternalLookAndFeel(manager, iaswLaf, _IASW_SCORER);\n\n // register OA's Text LAF if laf can be found\n _registerExternalLookAndFeel(manager, _OA_TEXT_LAF, _OA_TEXT_SCORER);\n */\n\n // Base lafs\n BaseDesktopUtils.registerLookAndFeel(manager);\n\n SimpleDesktopUtils.registerLookAndFeel(manager);\n SimplePdaUtils.registerLookAndFeel(manager);\n\n return manager;\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Puntos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Puntos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Puntos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Puntos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new Puntos().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(HW3.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(HW3.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(HW3.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(HW3.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new HW3().setVisible(true);\n }\n });\n }", "public Vista_Login() {\n \t\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Vista_Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Vista_Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Vista_Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Vista_Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(FrmLoguin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(FrmLoguin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(FrmLoguin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(FrmLoguin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new FrmLoguin().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Musica.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Musica.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Musica.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Musica.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new Musica().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Register.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Register.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Register.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Register.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new Register().setVisible(true);\n }\n });\n }", "public static void main(String[] args) throws Exception{\n\t\tUIManager.setLookAndFeel(new NimbusLookAndFeel());\n\t\t\n\t\t\n\t\tMyWindow myWindow = new MyWindow();\n\t\tmyWindow.setVisible(true);\n\n\t}", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Setup.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Setup.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Setup.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Setup.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new Setup().setVisible(true);\n }\n });\n }", "public static void main(String[] args) {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(CadContasReceitasDespesasView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(CadContasReceitasDespesasView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(CadContasReceitasDespesasView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(CadContasReceitasDespesasView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n EventQueue.invokeLater(new Runnable() {\n public void run() {\n JFrame frame = new JFrame();\n frame.setContentPane(new CadContasReceitasDespesasView());\n //frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.pack();\n frame.setVisible(true);\n frame.setTitle(args[0]);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(sinavlar2.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(sinavlar2.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(sinavlar2.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(sinavlar2.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /*\n * Create and display the form\n */\n java.awt.EventQueue.invokeLater(new Runnable() {\n\n @Override\n public void run() {\n new sinavlar2().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Registracija.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Registracija.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Registracija.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Registracija.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new Registracija().setVisible(true);\n }\n });\n }", "private void applyInitialLook() {\r\n\t\tthis.control.setFont(this.initialFont);\r\n\t\tthis.control.setBackground(this.initialBackgroundColor);\r\n\t\tthis.control.setForeground(this.initialForegroundColor);\r\n\t}", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new main().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(UsuarioView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(UsuarioView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(UsuarioView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(UsuarioView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n @Override\n public void run() {\n JFrame frame = new JFrame(\"Inscrição\");\n frame.add(new InscricaoView());\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.setResizable(false);\n frame.pack();\n frame.setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(cusRegister.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(cusRegister.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(cusRegister.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(cusRegister.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n try {\n new cusRegister().setVisible(true);\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(cusRegister.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(RamkaGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(RamkaGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(RamkaGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(RamkaGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new RamkaGui().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(adminhome.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(adminhome.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(adminhome.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(adminhome.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new adminhome().setVisible(true);\n }\n });\n }", "public static void main(String[] args) \n\t{\n\t\tCommonMethods.openConnection();\n\t\ttry {\n \t for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {\n \t if (\"Nimbus\".equals(info.getName())) {\n \t UIManager.setLookAndFeel(info.getClassName());\n \t break;\n \t }\n \t }\n \t} catch (Exception e) {\n \t // If Nimbus is not available, you can set the GUI to another look and feel.\n \t}\n\t\t\n\t\tnew AddNewCustomer();\n\n\t}", "public static void main(String args[]) {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Stock_Management.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Stock_Management.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Stock_Management.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Stock_Management.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new Stock_Management().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(kullaniciEkrani.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(kullaniciEkrani.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(kullaniciEkrani.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(kullaniciEkrani.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new kullaniciEkrani().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(UIHorariosLista.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(UIHorariosLista.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(UIHorariosLista.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(UIHorariosLista.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new UIHorariosLista().setVisible(true);\n }\n });\n }", "public static void startTrayIcon() {\r\n try {\r\n \tUIManager.setLookAndFeel(\"com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel\");\r\n } catch (Exception ex) {\r\n \tJOptionPane.showMessageDialog(null, \"Error setting Look & Feel \"+ex, \"Error setting Look & Feel\", JOptionPane.ERROR_MESSAGE);\r\n }\r\n /* Turn off metal's use of bold fonts */\r\n UIManager.put(\"swing.boldMetal\", Boolean.FALSE);\r\n //Schedule a job for the event-dispatching thread:\r\n //adding TrayIcon.\r\n SwingUtilities.invokeLater(new Runnable() {\r\n public void run() {\r\n createAndShowGUI();\r\n }\r\n });\r\n }", "protected void installDefaults() {\n spinner.setLayout(createLayout());\n LookAndFeel.installBorder(spinner, \"Spinner.border\");\n LookAndFeel.installColorsAndFont(spinner, \"Spinner.background\", \"Spinner.foreground\", \"Spinner.font\"); }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(UrunListele.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(UrunListele.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(UrunListele.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(UrunListele.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new UrunListele().setVisible(true);\n }\n });\n }", "public static void main(final String[] args) {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(ClienteView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(ClienteView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(ClienteView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(ClienteView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n EventQueue.invokeLater(new Runnable() {\n public void run() {\n JFrame frame = new JFrame();\n frame.setContentPane(new ClienteView());\n frame.pack();\n frame.setVisible(true);\n frame.setTitle(args[0]);\n \n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Register.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Register.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Register.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Register.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n try {\n new Register().setVisible(true);\n } catch (SQLException ex) {\n Logger.getLogger(Register.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n });\n }", "public static void main(String[] args) {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n// * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n// */\n// try {\n// for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n// if (\"Nimbus\".equals(info.getName())) {\n// javax.swing.UIManager.setLookAndFeel(info.getClassName());\n// break;\n// }\n// }\n// } catch (ClassNotFoundException ex) {\n// java.util.logging.Logger.getLogger(CatcTitles.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n// } catch (InstantiationException ex) {\n// java.util.logging.Logger.getLogger(CatcTitles.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n// } catch (IllegalAccessException ex) {\n// java.util.logging.Logger.getLogger(CatcTitles.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n// } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n// java.util.logging.Logger.getLogger(CatcTitles.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n// }\n //</editor-fold>\n\n /* Create and display the form */\n EventQueue.invokeLater(new Runnable() {\n public void run() {\n JFrame frame = new JFrame();\n frame.setContentPane(new CatcTitles());\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.pack();\n frame.setVisible(true);\n }\n });\n }", "public CalculatorGUI() {\n initComponents();\n setTitle(\"Calculator\");\n //setLookAndFeel(\"Windows\");\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Kayıt_Sil.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Kayıt_Sil.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Kayıt_Sil.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Kayıt_Sil.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold> \n\n /* Create and display the form */\n \n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new Kayıt_Sil().setVisible(true);\n }\n });\n }", "private void menuMotifActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuMotifActionPerformed\n try {\n UIManager.setLookAndFeel(\"com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel\");\n SwingUtilities.updateComponentTreeUI(this);\n } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {\n Logger.getLogger(MoneyMinderDesktopMainGui.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(TelaDelProduto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(TelaDelProduto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(TelaDelProduto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(TelaDelProduto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n }", "private void setAppearance(String className) {\n DweezilUIManager.setLookAndFeel(className, new Component[]{MainFrame.getInstance(), StatusWindow.getInstance(),\n PrefsSettingsPanel.this.getParent().getParent()});\n\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(SpaceSim.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n @Override\n public void run() {\n new SpaceSim().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(segundapartepestaña5.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(segundapartepestaña5.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(segundapartepestaña5.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(segundapartepestaña5.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new segundapartepestaña5().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(frmBuscarRemitentes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(frmBuscarRemitentes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(frmBuscarRemitentes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(frmBuscarRemitentes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n frmBuscarRemitentes dialog = new frmBuscarRemitentes(new javax.swing.JFrame(), true);\n dialog.addWindowListener(new java.awt.event.WindowAdapter() {\n public void windowClosing(java.awt.event.WindowEvent e) {\n System.exit(0);\n }\n });\n dialog.setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(FRM_Venta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(FRM_Venta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(FRM_Venta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(FRM_Venta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new FRM_Venta().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(JFMenu_principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(JFMenu_principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(JFMenu_principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(JFMenu_principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new TelaCliente().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(ImagenesProducto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(ImagenesProducto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(ImagenesProducto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(ImagenesProducto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new ImagenesProducto().setVisible(true);\n }\n });\n }", "protected void installDefaults() {\n\t\tColor bg = this.controlPanel.getBackground();\n\t\tif (bg == null || bg instanceof UIResource) {\n\t\t\tthis.controlPanel.setBackground(FlamingoUtilities.getColor(\n\t\t\t\t\tColor.lightGray, \"ControlPanel.background\",\n\t\t\t\t\t\"Panel.background\"));\n\t\t}\n\n\t\tBorder b = this.controlPanel.getBorder();\n\t\tif (b == null || b instanceof UIResource) {\n\t\t\tBorder toSet = UIManager.getBorder(\"ControlPanel.border\");\n\t\t\tif (toSet == null)\n\t\t\t\tnew BorderUIResource.EmptyBorderUIResource(1, 2, 1, 2);\n\t\t\tthis.controlPanel.setBorder(toSet);\n\t\t}\n\t\t\n\t\tFont font = this.controlPanel.getFont();\n if (font == null || font instanceof UIResource) {\n Font toSet = UIManager.getFont(\"Panel.font\");\n this.controlPanel.setFont(toSet);\n }\n\t}", "public MainFrame() throws Exception {\r\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r\n //SynthLookAndFeel laf = new SynthLookAndFeel();\r\n //UIManager.setLookAndFeel(laf);\r\n initComponents();\r\n }", "public static void main(String args[]) {\r\n try {\r\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\r\n if (\"Nimbus\".equals(info.getName())) {\r\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\r\n break;\r\n }\r\n }\r\n } catch (ClassNotFoundException ex) {\r\n java.util.logging.Logger.getLogger(Roysched.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\r\n } catch (InstantiationException ex) {\r\n java.util.logging.Logger.getLogger(Roysched.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\r\n } catch (IllegalAccessException ex) {\r\n java.util.logging.Logger.getLogger(Roysched.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\r\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\r\n java.util.logging.Logger.getLogger(Roysched.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\r\n }\r\n //</editor-fold>\r\n\r\n /* Create and display the form */\r\n java.awt.EventQueue.invokeLater(new Runnable() {\r\n public void run() {\r\n new Roysched().setVisible(true);\r\n }\r\n });\r\n }", "public static void main(String[] args) {\n\t\ttry {\r\n\t\t\tUIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r\n\t\t} catch (Exception ex) {\r\n\t\t}\r\n\t}", "protected void uninstallDefaults() {\n\t\tLookAndFeel.uninstallBorder(this.controlPanel);\n\t}", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(jfmActividades.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(() -> {\n new jfmActividades().setVisible(true);\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(ThermalInfo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(ThermalInfo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(ThermalInfo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(ThermalInfo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new ThermalInfo().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(HomePage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(HomePage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(HomePage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(HomePage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new HomePage().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(VentaForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(VentaForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(VentaForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(VentaForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new VentaForm().setVisible(true);\n }\n });\n }" ]
[ "0.7948844", "0.77676886", "0.770006", "0.75052917", "0.7287361", "0.7227688", "0.72236377", "0.72196996", "0.71810573", "0.7155472", "0.7119134", "0.71118087", "0.70989954", "0.70609176", "0.7049158", "0.6913391", "0.681691", "0.6704903", "0.669436", "0.6584968", "0.6573832", "0.65285206", "0.65267015", "0.65056354", "0.6415645", "0.64032096", "0.6260413", "0.6259631", "0.62198114", "0.61889774", "0.6168479", "0.6137368", "0.61344767", "0.6077272", "0.60602736", "0.6055614", "0.6029982", "0.60269403", "0.5995318", "0.59474826", "0.589904", "0.5883183", "0.5860684", "0.5854079", "0.5805013", "0.5792267", "0.5785199", "0.5769751", "0.5744337", "0.57387435", "0.5725369", "0.565851", "0.56542873", "0.565279", "0.56495535", "0.5621286", "0.5604963", "0.55994266", "0.5584325", "0.5573259", "0.55703914", "0.55669487", "0.5566896", "0.5561775", "0.5546179", "0.5544241", "0.55162734", "0.5513804", "0.55118644", "0.5497242", "0.54898065", "0.54890496", "0.5472154", "0.54709107", "0.5454056", "0.545154", "0.54509455", "0.5446175", "0.5442453", "0.5437607", "0.5430731", "0.54288113", "0.5424183", "0.541862", "0.54147875", "0.5401846", "0.5401325", "0.53848934", "0.53759325", "0.53631246", "0.5361944", "0.53523225", "0.5350778", "0.533346", "0.5329027", "0.53208524", "0.53205806", "0.53205556", "0.5319904", "0.5319552", "0.5312421" ]
0.0
-1
Singleton access to the ConceptTemplate
public static ConceptTemplate getInstance(){ if (instance == null){ instance = new ConceptTemplate("src/main/resources/conceptMapping.csv"); } return instance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "T getInstance();", "public T getInstance() {\n return instance;\n }", "@Override\n public T getInstance() {\n return instance;\n }", "public Concept getConcept() {\n\t\treturn concept;\n\t}", "public Concept getConcept() {\n\t\treturn concept;\n\t}", "synchronized public static SampletypeManager getInstance()\n {\n return singleton;\n }", "ConceptsType createConceptsType();", "public interface ConceptService {\n}", "default Concept getConcept(ConceptName conceptName) {return (Concept) conceptName;}", "public Concept getConcept(Term term) {\r\n String n = term.getName();\r\n Concept concept = concepts.get(n);\r\n if (concept == null)\r\n concept = new Concept(term, this); // the only place to make a new Concept\r\n return concept;\r\n }", "@Singleton\n @Component(modules = { SingletonProvider.class })\n public interface Single {\n SingletonMaker maker();\n }", "BehaviorConcept createBehaviorConcept();", "public static Ontology getInstance() {\n return theInstance;\n }", "public static Ontology getInstance() {\n return theInstance;\n }", "private Template() {\r\n\r\n }", "public static synchronized Singleton getInstanceTS() {\n\t\tif (_instance == null) {\n\t\t\t_instance = new Singleton();\n\t\t}\n\t\treturn _instance;\n\t}", "public static SingleObject getInstance(){\n return instance;\n }", "ConceptType createConceptType();", "public static MySingleTon getInstance(){\n if(myObj == null){\n myObj = new MySingleTon();\n }\n return myObj;\n }", "private TemplateService() {\n }", "private SingletonSample() {}", "public static Singleton instance() {\n return Holder.instance;\n }", "public String getConcept() {\n\t\treturn concept;\n\t}", "static void useSingleton(){\n\t\tSingleton singleton = Singleton.getInstance();\n\t\tprint(\"singleton\", singleton);\n\t}", "public static synchronized MoodsCreator getInstance(){\n return moodsCreator;\n }", "FeatureConcept createFeatureConcept();", "public static Singleton getInstance( ) {\n return singleton;\n }", "private LazySingleton(){}", "public static SingleObject getInstance()\r\n {\r\n return instance;\r\n }", "private SingleTon() {\n\t}", "public static SingleObject getInstance(){\n\t\treturn instance;\n\t}", "@NotNull\n public static Help getInstance() {\n return LazyHolder.INSTANCE;\n }", "public interface HierarchicalKnowledgeBase {\n\n /**\n * Get the concept with the provided id.\n * @param id Concept ID.\n * @return Concept\n */\n Concept getConcept(String id);\n\n /**\n * Get the instance with the provided id.\n * @param id Instance ID.\n * @return Instance\n */\n Instance getInstance(String id);\n\t/**\n * Get a collection with the subclasses of the provided concept\n * @param concept Concept provided\n * @return collection of subclasses of the concept\n */\n Set<Concept> getSubclasses(Concept concept);\n \n /**\n * Returns a collection containing the superclasses of the provided concept\n * @param concept Concept provided\n * @return collection of subclasses of the concept\n */\n Set<Concept> getSuperclasses(Concept concept);\n \n /**\n * Check if concept x is equivalent to concept y\n * @param x Concept x\n * @param y Concept y\n * @return True if x is equivalent to y\n */\n boolean equivalent(Concept x, Concept y);\n \n /**\n * Check if concept x is subclass of concept y\n * @param x Concept x\n * @param y Concept y\n * @return True if x subclass of y, false in other case.\n */\n boolean isSubclass(Concept x, Concept y);\n \n /**\n * Check if concept x is a subclass of y, false in other case\n * @param x Concept x\n * @param y Concept y\n * @return True if x is a superclass of y\n */\n boolean isSuperclass(Concept x, Concept y);\n \n /**\n * Returns the concept Resource from which this Resource is instance. If\n * the Resource is not an instance, the function returns the same Resource.\n * @param instance Concept or Instance Resource\n * @return Concept parent of the instance.\n */\n Concept resolveInstance(Instance instance);\n \n /**\n * Return all instances of the provided concept.\n * @return {@link Set} with the instances of the concept.\n * If there are no instances, a empty set is returned.\n */\n Set<Instance> getInstances(Concept concept);\n\n /**\n * Return all concepts managed by this KB.\n * @return {@link Set} with all available concepts.\n */\n Set<Concept> getConcepts();\n\n /**\n * Return all instances managed by this KB.\n * @return {@link Set} with all available instances.\n */\n Set<Instance> getInstances();\n}", "public static Singleton getInstance( ) {\n return singleton;\n }", "private Singleton(){}", "public interface IFlexoOntologyConcept<TA extends TechnologyAdapter<TA>> extends IFlexoOntologyObject<TA> {\n\t/**\n\t * Ontology of Concept.\n\t * \n\t * @return\n\t */\n\tpublic IFlexoOntology<TA> getOntology();\n\n\t/**\n\t * Annotation upon Concept.\n\t * \n\t * @return\n\t */\n\tpublic List<? extends IFlexoOntologyAnnotation> getAnnotations();\n\n\t/**\n\t * Container of Concept.\n\t * \n\t * @return\n\t */\n\tpublic IFlexoOntologyConceptContainer<TA> getContainer();\n\n\t/**\n\t * Association with structural features for Concept.\n\t * \n\t * @return\n\t */\n\tpublic List<? extends IFlexoOntologyFeatureAssociation<TA>> getStructuralFeatureAssociations();\n\n\t/**\n\t * Association with behavioural features for Concept.\n\t * \n\t * @return\n\t */\n\tpublic List<? extends IFlexoOntologyFeatureAssociation<TA>> getBehaviouralFeatureAssociations();\n\n\t/**\n\t * \n\t * Is this a Super Concept of concept.\n\t * \n\t * @return\n\t */\n\tpublic boolean isSuperConceptOf(IFlexoOntologyConcept<TA> concept);\n\n\t/**\n\t * \n\t * Is this a Sub Concept of concept.\n\t * \n\t * @return\n\t */\n\tpublic boolean isSubConceptOf(IFlexoOntologyConcept<TA> concept);\n\n\t/**\n\t * Visitor access.\n\t * \n\t * @param visitor\n\t * @return\n\t * \n\t * @pattern visitor\n\t */\n\tpublic <T> T accept(IFlexoOntologyConceptVisitor<T> visitor);\n\n\t/**\n\t * This equals has a particular semantics (differs from {@link #equals(Object)} method) in the way that it returns true only and only if\n\t * compared objects are representing same concept regarding URI. This does not guarantee that both objects will respond the same way to\n\t * some methods.<br>\n\t * This method returns true if and only if objects are same, or if one of both object redefine the other one (with eventual many levels)\n\t * \n\t * @param o\n\t * @return\n\t */\n\tpublic boolean equalsToConcept(IFlexoOntologyConcept<TA> concept);\n\n\t/**\n\t * Return all properties accessible in the scope of this ontology object, where declared domain is this object\n\t * \n\t * @return\n\t */\n\n}", "public interface ConceptualEntitySingletonInstance extends SingletonInstance {\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model unique=\"false\" required=\"true\"\n\t * @generated\n\t */\n\tConceptualEntity conceptualEntitySingletonClassifier();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model unique=\"false\"\n\t * annotation=\"http://www.eclipse.org/emf/2002/GenModel body='<%org.eclipse.emf.common.util.EList%><<%jpl.imce.oml.specification.ecore.ScalarDataPropertyValue%>> _scalarDataPropertyValues = this.getScalarDataPropertyValues();\\nfinal <%org.eclipse.xtext.xbase.lib.Functions.Function1%><<%jpl.imce.oml.specification.ecore.ScalarDataPropertyValue%>, <%java.lang.Boolean%>> _function = new <%org.eclipse.xtext.xbase.lib.Functions.Function1%><<%jpl.imce.oml.specification.ecore.ScalarDataPropertyValue%>, <%java.lang.Boolean%>>()\\n{\\n\\tpublic <%java.lang.Boolean%> apply(final <%jpl.imce.oml.specification.ecore.ScalarDataPropertyValue%> v)\\n\\t{\\n\\t\\tboolean _xblockexpression = false;\\n\\t\\t{\\n\\t\\t\\tfinal <%jpl.imce.oml.specification.ecore.DataRelationshipToScalar%> p = v.getScalarDataProperty();\\n\\t\\t\\tboolean _switchResult = false;\\n\\t\\t\\tboolean _matched = false;\\n\\t\\t\\tif (p instanceof <%jpl.imce.oml.specification.ecore.EntityScalarDataProperty%>)\\n\\t\\t\\t{\\n\\t\\t\\t\\t_matched=true;\\n\\t\\t\\t\\t_switchResult = ((<%jpl.imce.oml.specification.ecore.EntityScalarDataProperty%>)p).isIsIdentityCriteria();\\n\\t\\t\\t}\\n\\t\\t\\tif (!_matched)\\n\\t\\t\\t{\\n\\t\\t\\t\\t_switchResult = false;\\n\\t\\t\\t}\\n\\t\\t\\t_xblockexpression = _switchResult;\\n\\t\\t}\\n\\t\\treturn <%java.lang.Boolean%>.valueOf(_xblockexpression);\\n\\t}\\n};\\n<%java.lang.Iterable%><<%jpl.imce.oml.specification.ecore.ScalarDataPropertyValue%>> _filter = <%org.eclipse.xtext.xbase.lib.IterableExtensions%>.<<%jpl.imce.oml.specification.ecore.ScalarDataPropertyValue%>>filter(_scalarDataPropertyValues, _function);\\nreturn <%org.eclipse.emf.common.util.ECollections%>.<<%jpl.imce.oml.specification.ecore.ScalarDataPropertyValue%>>asEList(((<%jpl.imce.oml.specification.ecore.ScalarDataPropertyValue%>[])org.eclipse.xtext.xbase.lib.Conversions.unwrapArray(_filter, <%jpl.imce.oml.specification.ecore.ScalarDataPropertyValue%>.class)));'\"\n\t * annotation=\"http://imce.jpl.nasa.gov/oml/Scala code='scalarDataPropertyValues.filter{ v =>\\n\\t v.scalarDataProperty match {\\n\\t case ep: EntityScalarDataProperty =>\\n\\t\\t ep.isIdentityCriteria\\n\\t case _ =>\\n\\t false\\n\\t }}'\"\n\t * annotation=\"http://imce.jpl.nasa.gov/oml/Collection kind='SortedSet'\"\n\t * @generated\n\t */\n\tEList<ScalarDataPropertyValue> identifyingScalarValues();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model unique=\"false\"\n\t * annotation=\"http://www.eclipse.org/emf/2002/GenModel body='<%org.eclipse.emf.common.util.EList%><<%jpl.imce.oml.specification.ecore.StructuredDataPropertyValue%>> _structuredDataPropertyValues = this.getStructuredDataPropertyValues();\\nfinal <%org.eclipse.xtext.xbase.lib.Functions.Function1%><<%jpl.imce.oml.specification.ecore.StructuredDataPropertyValue%>, <%java.lang.Boolean%>> _function = new <%org.eclipse.xtext.xbase.lib.Functions.Function1%><<%jpl.imce.oml.specification.ecore.StructuredDataPropertyValue%>, <%java.lang.Boolean%>>()\\n{\\n\\tpublic <%java.lang.Boolean%> apply(final <%jpl.imce.oml.specification.ecore.StructuredDataPropertyValue%> v)\\n\\t{\\n\\t\\tboolean _xblockexpression = false;\\n\\t\\t{\\n\\t\\t\\tfinal <%jpl.imce.oml.specification.ecore.DataRelationshipToStructure%> p = v.getStructuredDataProperty();\\n\\t\\t\\tboolean _switchResult = false;\\n\\t\\t\\tboolean _matched = false;\\n\\t\\t\\tif (p instanceof <%jpl.imce.oml.specification.ecore.EntityStructuredDataProperty%>)\\n\\t\\t\\t{\\n\\t\\t\\t\\t_matched=true;\\n\\t\\t\\t\\t_switchResult = ((<%jpl.imce.oml.specification.ecore.EntityStructuredDataProperty%>)p).isIsIdentityCriteria();\\n\\t\\t\\t}\\n\\t\\t\\tif (!_matched)\\n\\t\\t\\t{\\n\\t\\t\\t\\t_switchResult = false;\\n\\t\\t\\t}\\n\\t\\t\\t_xblockexpression = _switchResult;\\n\\t\\t}\\n\\t\\treturn <%java.lang.Boolean%>.valueOf(_xblockexpression);\\n\\t}\\n};\\n<%java.lang.Iterable%><<%jpl.imce.oml.specification.ecore.StructuredDataPropertyValue%>> _filter = <%org.eclipse.xtext.xbase.lib.IterableExtensions%>.<<%jpl.imce.oml.specification.ecore.StructuredDataPropertyValue%>>filter(_structuredDataPropertyValues, _function);\\nreturn <%org.eclipse.emf.common.util.ECollections%>.<<%jpl.imce.oml.specification.ecore.StructuredDataPropertyValue%>>asEList(((<%jpl.imce.oml.specification.ecore.StructuredDataPropertyValue%>[])org.eclipse.xtext.xbase.lib.Conversions.unwrapArray(_filter, <%jpl.imce.oml.specification.ecore.StructuredDataPropertyValue%>.class)));'\"\n\t * annotation=\"http://imce.jpl.nasa.gov/oml/Scala code='structuredDataPropertyValues.filter{ v =>\\n\\t v.structuredDataProperty match {\\n\\t case ep: EntityStructuredDataProperty =>\\n\\t\\t ep.isIdentityCriteria\\n\\t case _ =>\\n\\t false\\n\\t }}'\"\n\t * annotation=\"http://imce.jpl.nasa.gov/oml/Collection kind='SortedSet'\"\n\t * @generated\n\t */\n\tEList<StructuredDataPropertyValue> identifyingStructuredTuples();\n\n}", "String getConcept();", "private Singleton()\n\t\t{\n\t\t}", "@Override\n public ObservationTemplate getObservationTemplate() {\n return observationTemplate;\n }", "private SingletonEager(){\n \n }", "public ObjectFactoryTeacherPresence() {\n }", "private EagerInitializedSingleton() {\n\t}", "private EagerInitializedSingleton() {\n\t}", "@Override\n public boolean isSingleton() {\n return false;\n }", "public org.omg.uml.behavioralelements.commonbehavior.Instance getInstance();", "static RatAppModel getInstance() {return model;}", "DomainConcept createDomainConcept();", "public static TagListSingleton getInstance() {\n\t\treturn instance;\n\t}", "@SuppressWarnings(\"unchecked\")\n public static <T> Singleton<T> instance() {\n // Return the singleton instance from the SingletonHolder.\n return (Singleton<T>) SingletonHolder.INSTANCE;\n }", "public static ViewParameters getInstance ()\r\n {\r\n return Holder.INSTANCE;\r\n }", "public static Singleton getInstance() {\n return mSing;\n }", "BehavioralFeatureConcept createBehavioralFeatureConcept();", "public static utilitys getInstance(){\n\r\n\t\treturn instance;\r\n\t}", "private Singleton() { }", "public TraversalStrategyFactory getInstance() {\n\t\treturn instance;\n\t}", "private SingletonStatementGenerator() {\n\t}", "@Override\n\t\tpublic Object getInstance() {\n\t\t\treturn null;\n\t\t}", "public static final ReasonerFrontend getInstance() {\r\n return INSTANCE;\r\n }", "private SingletonSigar(){}", "public <T> T getInstance(TypeLiteral<T> type,\n Annotation annotation) {\n return getLocator(Key.get(type, annotation)).get();\n }", "private PropertySingleton(){}", "Shared shared();", "public static Boolean getSingleton() {\r\n\t\treturn singleton;\r\n\t}", "@Test\n public void testGetInstance() {\n\n // singleton\n assertSame(GestionnaireRaccourcis.getInstance(), GestionnaireRaccourcis.getInstance());\n }", "private SingleTon() {\r\n\t\t// TODO Auto-generated constructor stub\r\n\t}", "public static SpeciesCarnivorousFactory getInstance() {\n\t\treturn uniqueInstance;\n\t}", "public static Physics getInstance(){\n return instance;\n }", "private Singleton() {\n\t}", "public static SingletonEager get_instance(){\n }", "private SingletonDoubleCheck() {}", "public SDefOntologyWriter(String templateURI) throws OntologyLoadException {\r\n\t\towlModel = ProtegeOWL.createJenaOWLModelFromURI(templateURI);\r\n\t\tinstanceCounter = 0;\r\n\t\texistingKeywords = new Hashtable<String,String>();\r\n\t\texistingRegex = new Hashtable<String,String>();\r\n\t}", "Concept getConcept(String id);", "public static Replica1Singleton getInstance() {\r\n\t\tif (instance==null){\r\n\t\t/*System.err.println(\"Istanza creata\");*/\r\n\t\tinstance = new Replica1Singleton();\r\n\t\t}\r\n\t\treturn instance;\r\n\t\r\n\t}", "public static METSNamespace getInstance() {\n return ONLY_INSTANCE;\n }", "public static ResourceFactory get() {\r\n\t\treturn single;\r\n\t}", "public static SubjectManagement getInstance() {\n\n\t\tif (instance == null) {\n\t\t\tinstance = new SubjectManagement();\n\t\t}\n\n\t\treturn instance;\n\t}", "public SingletonVerifier() {\n }", "public static TrainingController getInstance(){\n if( singleInstance == null )\n singleInstance = new TrainingController();\n return singleInstance;\n }", "private SparkeyServiceSingleton(){}", "private static Session getInstance() {\n return SingletonHolder.INSTANCE;\n }", "private MySingleton() {\r\n\t\tSystem.out.println(\"Only 1 object will be created\");\r\n\t}", "public interface SingletonTask extends Task {\n}", "public static PMSFormulaContext getInstance() {\n return singleton;\n }", "private TemplateManagerHelper() {\n\n }", "private OntologyConcept getOntologyConcept(JCas jcas, LookupHit hit)\n {\n String codingScheme = this.properties.getProperty(CODING_SCHEME_PRP_KEY);\n String idname = this.properties.getProperty(ID_PRP_KEY);\n String labelName = this.properties.getProperty(LABEL_PRP_KEY);\n MetaDataHit mdh = hit.getDictMetaDataHit();\n String id = mdh.getMetaFieldValue(idname);\n OntologyConcept concept = new OntologyConcept(jcas);\n concept.setCode(id);\n /* I'm not sure what the oui is supposed to be, but it's not being used elsewhere in the pipeline */\n concept.setOui(mdh.getMetaFieldValue(labelName));\n concept.setCodingScheme(codingScheme);\n return concept;\n }", "ActivityConcept createActivityConcept();", "public static Controller getInstance() { return INSTANCE; }", "public static RCProxy instance(){\n\t\treturn SingletonHolder.INSTANCE;\n\t}", "private Singleton(){\n }", "public interface TwitterApiInstance {\n\t/**\n\t * Method to get Twitter Instance\n\t * @return Twitter\n\t */\n\tTwitter geTwitterInstance();\n}", "private TemplateReader() {\n }", "public MetodosTwit() {\r\n\r\n twitter = new TwitterFactory().getInstance();\r\n }", "public static TinkerPrefs getInstance() {\n\t\treturn instance;\n\t}", "TT createTT();", "public static MElement createConcept(String concept) {\n System.out.println(\"Attempting to create Concept from string \" + concept);\n AbstractMFeature2 sf = AbstractMFeature2.getSemanticFeature(concept);\n return getInstance(sf, MFeatureType.CONCEPT);\n }", "synchronized public static InstitutionManager getInstance()\n {\n return singleton;\n }", "public static Gadget getInstance(){\r\n\t\t\treturn instance;\r\n\t\t}", "public TypeSpecCreator getTSCreator() {\n\t\t\treturn this.TSCreator;\n\t\t}", "public static Singleton getInstance() {\n return SingletonHolder.SINGLETON_INSTANCE;\n }" ]
[ "0.6022463", "0.59359527", "0.58858883", "0.58294415", "0.58294415", "0.5814851", "0.5760358", "0.575662", "0.5623475", "0.56076187", "0.5580516", "0.5574834", "0.555148", "0.555148", "0.55358124", "0.5524439", "0.54739994", "0.5464585", "0.54565316", "0.5449786", "0.54267675", "0.5407914", "0.5371856", "0.53214943", "0.5316532", "0.5310519", "0.52704287", "0.52631533", "0.5259871", "0.5241113", "0.52348363", "0.5226197", "0.52173126", "0.5195223", "0.5184179", "0.51831126", "0.5181572", "0.5176564", "0.51686704", "0.51635593", "0.516235", "0.51376086", "0.51349694", "0.51349694", "0.5123199", "0.5121242", "0.5113224", "0.51000905", "0.5097056", "0.50825775", "0.5081971", "0.50817037", "0.50735784", "0.5073129", "0.50672454", "0.5055876", "0.50552666", "0.5054256", "0.50517434", "0.5048251", "0.5043409", "0.50420755", "0.50384426", "0.50294185", "0.5025162", "0.50167626", "0.50146633", "0.50111055", "0.5008539", "0.5006954", "0.50059557", "0.500469", "0.5001422", "0.49912283", "0.49876925", "0.49770695", "0.4973211", "0.49665692", "0.49635088", "0.49603125", "0.49598682", "0.49584395", "0.49545404", "0.494479", "0.49422958", "0.49407792", "0.4928469", "0.4927117", "0.49252152", "0.4922405", "0.49198624", "0.49098167", "0.49076557", "0.4906147", "0.489874", "0.48969764", "0.48945582", "0.4894518", "0.4892724", "0.48817176" ]
0.7103131
0
Constructor for Tool object, creates a Tool object Tool(String name, String id, String address) Creates a Tool object.
public Tool(String name, String id, String address) { this.name = name; this.id = id; this.address = address; this.isHome = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Tool(String name, String id, String address, boolean isHome) {\n this.name = name;\n this.id = id;\n this.address = address;\n this.isHome = isHome;\n }", "public Tool(ToolType type, String brand) {\n this.type = type;\n this.brand = brand;\n }", "public Tool(ToolType type, Map map)\n {\n super(type.height, type.width, map, false, false);\n this.type = type;\n }", "public Item(int id, String name, int quantity, double price, Supplier supplier){\r\n toolId = id;\r\n toolName = name;\r\n toolQuantity = quantity;\r\n toolPrice = price;\r\n toolSupplier = supplier;\r\n }", "public Tool(String itemId, Manufacturer manufacturer, String description,Category category,String stock, ToolStatus toolStatus, BigDecimal rentPrice) {\n this.itemId = itemId;\n this.manufacturer = manufacturer;\n this.description = description;\n this.category = category;\n this.stock = stock;\n this.toolStatus = toolStatus;\n this.rentPrice = rentPrice;\n }", "public ToolButton createToolButton(String path, String toolName, Tool tool);", "ToolType(String name, int sprite) {\n\t\tthis.name = name; // adds the name\n\t\tthis.sprite = sprite; // adds the sprite location number\n\t}", "public void setTool(Tool t) {\n\ttool = t;\n }", "public Tool() {\n initComponents();\n }", "protected ToolButton createToolButton(String iconName, String toolName, Tool tool) {\n return new ToolButton(this, iconName, toolName, tool);\n }", "public ToolButton createToolButton(Icon icon, Icon selectedIcon,\n String toolName, Tool tool);", "private Tool createTool(ToolType toolType, String toolCode, String brand) {\n double dailyPrice;\n boolean wkdChg;\n boolean holChg;\n\n if(toolType == ToolType.LADDER) {\n dailyPrice = LADDER_PRICE;\n wkdChg = LADDER_WKD_FREE;\n holChg = LADDER_HOL_FREE;\n } else if(toolType == ToolType.CHAINSAW) {\n dailyPrice = CHAINSAW_PRICE;\n wkdChg = CHAINSAW_WKD_FREE;\n holChg = CHAINSAW_HOL_FREE;\n } else {\n dailyPrice = JACKHAMMER_PRICE;\n wkdChg = JACKHAMMER_WKD_FREE;\n holChg = JACKHAMMER_HOL_FREE;\n }\n\n Tool tool = new Tool(toolType, toolCode, brand, dailyPrice, wkdChg, holChg);\n\n return tool;\n }", "public Tool tool(int paramInt) {\r\n\t\treturn new Tool(LeapJNI.Hand_tool(this.swigCPtr, this, paramInt), true);\r\n\t}", "public final int getToolID() {\n return toolID;\n }", "public Tool tool() {\n return fTool;\n }", "public Tool getTool() {\n\treturn tool;\n }", "protected Tool createSelectionTool() {\n return new SelectionTool(view());\n }", "public PathwayCommonsAccessTool() {\n super(PC_NAME, PC_RESOURCEID, PC_STRUCTURE);\n try {\n this.getToolResource().setResourceURL(new URL(PC_URL));\n this.getToolResource().setResourceLogo(new URL(PC_LOGO));\n this.getToolResource().setResourceElementURL(PC_ELT_URL);\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n this.getToolResource().setResourceDescription(PC_DESCRIPTION);\n }", "public tool() {\n initComponents();\n }", "public void setToolname(String toolname) {\r\n this.toolname = toolname;\r\n }", "public ToolBar(final Map<PaintTool, ToolAction> theMap, \n final List<PaintTool> theTools,\n final JFrame theFrame,\n final DrawingPanel thePanel) { \n\n myToolBar = new JToolBar();\n createToolButtons(theMap, theTools, theFrame);\n createUndoAndRedo(thePanel);\n myBar = theFrame.getJMenuBar();\n myBar.addPropertyChangeListener(this);\n myPcs = new PropertyChangeSupport(this);\n }", "public String getTool() {\n\t\treturn tool;\n\t}", "@Override\n\tpublic String getToolName() {\n\t\treturn name;\n\t}", "public Tool getToolObject(String toolClassString) throws UnknownToolException, ClassNotFoundException, InstantiationException, IllegalAccessException {\n Tool toolObject = null;\n\n // try and get the tool from the toolsCache / if the tool is not cached yet\n if ((toolObject = toolsCache.get(toolClassString)) == null)\n {\n // if the tool wasn't in the cache, load it with the classLoader\n Class toolClass = classLoader.loadClass(toolClassString);\n // create a new Tool instance\n toolObject = (Tool) toolClass.newInstance();\n // put the tool into the toolsCache for future re-use\n toolsCache.put(toolClassString, toolObject);\n }\n\n // return the Tool object\n return toolObject;\n }", "void setActiveTool(int tool) {\n this.activeTool = tool;\n }", "public String getToolname() {\r\n return toolname;\r\n }", "public OvalTool(DrawContext context, String name, String icon) {\n\t\tsuper(context, name, icon);\n\t}", "public TeamBuildTool(String name) {\n team = new Team(name);\n run();\n }", "public MakeCPMLEditableTool(){\n\t}", "public void toolAdded(ToolGroupEvent evt) {\n SimpleTool tool = (SimpleTool)evt.getChild();\n addToolButton(tool, tool.getToolID());\n }", "private void addToolButton(Tool tool, String toolId) {\n \n String iconPath = tool.getIcon();\n\n // create the button\n JToolButton button = getToggleButton(tool, toolId);\n \n // disable if it is loading\n button.setLoaded(false);\n \n // add to the data maps\n toolIdToButtonMap.put(toolId, button);\n urlToButtonMap.put(iconPath, button);\n toolIdToToolMap.put(toolId, tool);\n\n // put the proxy image in place\n if (tool instanceof ToolGroup && !(tool instanceof ToolSwitch)) {\n \n // create the necessary icons for button state\n generateButtonIcons(button, folderImage); \n \n // allow selection\n button.setLoaded(true);\n button.addItemListener(this);\n\n } else {\n \n // set count failures to 0\n loadFailureCounts.put(iconPath, 0);\n \n String category = tool.getCategory(); \n if (category != null && !category.equals(\"Category.Loading\")) {\n \n // check the cache for the resource\n if (clientCache.doesAssetExist(iconPath)) {\n \n // call the resource loaded directly\n try {\n InputStream resourceStream =\n clientCache.retrieveAsset(iconPath);\n resourceLoaded(iconPath, resourceStream);\n } catch (IOException io) {\n errorReporter.errorReport(io.getMessage(), io);\n } \n \n } else {\n \n // now try to lazy load the actual image\n resourceLoader.loadResource(iconPath, this);\n \n }\n \n } else {\n \n // set the loading image\n button.setIcon(loadingImage);\n\n }\n\n }\n\n revalidate();\n \n }", "public AssetCreationToolEntry(String label, String shortDesc, Object template, CreationFactory factory, ImageDescriptor iconSmall, ImageDescriptor iconLarge)\n {\n super(label, shortDesc, template, factory, iconSmall, iconLarge);\n }", "public void setToolnum(String toolnum) {\r\n this.toolnum = toolnum;\r\n }", "public interface ITool extends IBuildObject, IHoldsOptions {\n\t// Schema element names\n\tpublic static final String COMMAND = \"command\";\t//$NON-NLS-1$\n\tpublic static final String COMMAND_LINE_PATTERN = \"commandLinePattern\"; //$NON-NLS-1$\n\tpublic static final String COMMAND_LINE_GENERATOR = \"commandLineGenerator\"; //$NON-NLS-1$\n\tpublic static final String DEP_CALC_ID =\"dependencyCalculator\"; //$NON-NLS-1$\n\tpublic static final String INTERFACE_EXTS = \"headerExtensions\";\t//$NON-NLS-1$\n\tpublic static final String NATURE =\t\"natureFilter\";\t//$NON-NLS-1$\n\tpublic static final String OUTPUT_FLAG = \"outputFlag\";\t//$NON-NLS-1$\n\tpublic static final String INPUT_TYPE = \"inputType\";\t//$NON-NLS-1$\n\tpublic static final String OUTPUT_TYPE = \"outputType\";\t//$NON-NLS-1$\n\tpublic static final String OUTPUT_PREFIX = \"outputPrefix\";\t//$NON-NLS-1$\n\tpublic static final String OUTPUTS = \"outputs\";\t//$NON-NLS-1$\n\tpublic static final String SOURCES = \"sources\";\t//$NON-NLS-1$\n\tpublic static final String ADVANCED_INPUT_CATEGORY = \"advancedInputCategory\";\t//$NON-NLS-1$\n\tpublic static final String CUSTOM_BUILD_STEP = \"customBuildStep\";\t//$NON-NLS-1$\n\tpublic static final String ANNOUNCEMENT = \"announcement\";\t//$NON-NLS-1$\n\tpublic static final String TOOL_ELEMENT_NAME = \"tool\";\t//$NON-NLS-1$\n\tpublic static final String WHITE_SPACE = \" \";\t//$NON-NLS-1$\n\tpublic static final String EMPTY_STRING = \"\";\t//$NON-NLS-1$\n\tpublic static final String IS_SYSTEM = \"isSystem\";\t\t\t\t\t\t\t//$NON-NLS-1$\n\t\n\tpublic static final String VERSIONS_SUPPORTED = \"versionsSupported\";\t//$NON-NLS-1$\n\tpublic static final String CONVERT_TO_ID = \"convertToId\";\t\t\t\t//$NON-NLS-1$\n\tpublic static final String OPTIONPATHCONVERTER = \"optionPathConverter\";\t\t\t\t//$NON-NLS-1$\n\t\n\tpublic static final String SUPPORTS_MANAGED_BUILD = \"supportsManagedBuild\"; //$NON-NLS-1$\n\t\n\n\tpublic static final int FILTER_C = 0;\n\tpublic static final int FILTER_CC = 1;\n\tpublic static final int FILTER_BOTH = 2;\n\n\t/**\n\t * Returns the tool-chain or resource configuration that is the parent of this tool.\n\t * \n\t * @return IBuildObject\n\t */\n\tpublic IBuildObject getParent();\n\n\t/**\n\t * Creates a child InputType for this tool.\n\t * \n\t * @param InputType The superClass, if any\n\t * @param String The id for the new InputType \n\t * @param String The name for the new InputType\n\t * @param boolean Indicates whether this is an extension element or a managed project element\n\t * \n\t * @return IInputType\n\t * @since 3.0\n\t */\n\tpublic IInputType createInputType(IInputType superClass, String Id, String name, boolean isExtensionElement);\n\n\t/**\n\t * Removes an InputType from the tool's list.\n\t * \n\t * @param type\n\t * @since 3.0\n\t */\n\tpublic void removeInputType(IInputType type);\n\t\n\t/**\n\t * Returns the complete list of input types that are available for this tool.\n\t * The list is a merging of the input types specified for this tool with the \n\t * input types of its superclasses. The lowest input type instance in the hierarchy\n\t * takes precedence. \n\t * \n\t * @return IInputType[]\n\t * @since 3.0\n\t */\n\tpublic IInputType[] getInputTypes();\n\n\t/**\n\t * Returns the <code>IInputType</code> in the tool with the specified \n\t * ID. This is an efficient search in the receiver.\n\t * \n\t * <p>If the receiver does not have an InputType with that ID, the method \n\t * returns <code>null</code>. It is the responsibility of the caller to \n\t * verify the return value. \n\t * \n\t * @param id unique identifier of the InputType to search for\n\t * @return <code>IInputType</code>\n\t * @since 3.0\n\t */\n\tpublic IInputType getInputTypeById(String id);\n\n\t/**\n\t * Returns the <code>IInputType</code> in the tool that uses the \n\t * specified extension.\n\t * \n\t * <p>If the receiver does not have an InputType that uses the extension, \n\t * the method returns <code>null</code>. It is the responsibility of the \n\t * caller to verify the return value. \n\t * \n\t * @param inputExtension File extension\n\t * @return <code>IInputType</code>\n\t * @since 3.0\n\t */\n\tpublic IInputType getInputType(String inputExtension);\n\n\t/**\n\t * Returns the primary <code>IInputType</code> in this tool\n\t * \n\t * <p>If the receiver has no InputTypes, \n\t * the method returns <code>null</code>. It is the responsibility of the \n\t * caller to verify the return value. \n\t * \n\t * @return <code>IInputType</code>\n\t * @since 3.0\n\t */\n\tpublic IInputType getPrimaryInputType();\n\n\t/**\n\t * Returns all of the additional input resources of all InputType children.\n\t * Note: This does not include the primary InputType and does not include\n\t * additional dependencies.\n\t * \n\t * @return IPath[]\n\t */\n\tpublic IPath[] getAdditionalResources();\n\n\t/**\n\t * Returns all of the additional dependency resources of all InputType children.\n\t * Note: This does not include the primary InputType and does not include \n\t * additional inputs.\n\t * \n\t * @return IPath[]\n\t */\n\tpublic IPath[] getAdditionalDependencies();\n\n\t/**\n\t * Creates a child OutputType for this tool.\n\t * \n\t * @param OutputType The superClass, if any\n\t * @param String The id for the new OutputType \n\t * @param String The name for the new OutputType\n\t * @param boolean Indicates whether this is an extension element or a managed project element\n\t * \n\t * @return IOutputType\n\t * @since 3.0\n\t */\n\tpublic IOutputType createOutputType(IOutputType superClass, String Id, String name, boolean isExtensionElement);\n\n\t/**\n\t * Removes an OutputType from the tool's list.\n\t * \n\t * @param type\n\t * @since 3.0\n\t */\n\tpublic void removeOutputType(IOutputType type);\n\t\n\t/**\n\t * Returns the complete list of output types that are available for this tool.\n\t * The list is a merging of the output types specified for this tool with the \n\t * output types of its superclasses. The lowest output type instance in the hierarchy\n\t * takes precedence. \n\t * \n\t * @return IOutputType[]\n\t * @since 3.0\n\t */\n\tpublic IOutputType[] getOutputTypes();\n\t/**\n\t * Get the <code>IOutputType</code> in the receiver with the specified \n\t * ID. This is an efficient search in the receiver.\n\t * \n\t * <p>If the receiver does not have an OutputType with that ID, the method \n\t * returns <code>null</code>. It is the responsibility of the caller to \n\t * verify the return value. \n\t * \n\t * @param id unique identifier of the OutputType to search for\n\t * @return <code>IOutputType</code>\n\t * @since 3.0\n\t */\n\tpublic IOutputType getOutputTypeById(String id);\n\n\t/**\n\t * Returns the <code>IOutputType</code> in the tool that creates the \n\t * specified extension.\n\t * \n\t * <p>If the receiver does not have an OutputType that creates the extension, \n\t * the method returns <code>null</code>. It is the responsibility of the \n\t * caller to verify the return value. \n\t * \n\t * @param outputExtension File extension\n\t * @return <code>IOutputType</code>\n\t * @since 3.0\n\t */\n\tpublic IOutputType getOutputType(String outputExtension);\n\n\t/**\n\t * Returns the primary <code>IOutputType</code> in this tool\n\t * \n\t * <p>If the receiver has no OutputTypes, \n\t * the method returns <code>null</code>. It is the responsibility of the \n\t * caller to verify the return value. \n\t * \n\t * @return <code>IOutputType</code>\n\t * @since 3.0\n\t */\n\tpublic IOutputType getPrimaryOutputType();\n\n\t/**\n\t * Returns the <code>ITool</code> that is the superclass of this\n\t * tool, or <code>null</code> if the attribute was not specified.\n\t * \n\t * @return ITool\n\t */\n\tpublic ITool getSuperClass();\n\t\n\t/**\n\t * Returns whether this element is abstract. Returns <code>false</code>\n\t * if the attribute was not specified.\n\t * @return boolean \n\t */\n\tpublic boolean isAbstract();\n\n\t/**\n\t * Sets the isAbstract attribute of the tool-chain. \n\t * \n\t * @param b\n\t */\n\tpublic void setIsAbstract(boolean b);\n\t\n\t/**\n\t * Returns a semi-colon delimited list of child Ids of the superclass'\n\t * children that should not be automatically inherited by this element.\n\t * Returns an empty string if the attribute was not specified. \n\t * @return String \n\t */\n\tpublic String getUnusedChildren();\n\n\t/**\n\t * Returns the semicolon separated list of unique IDs of the error parsers associated\n\t * with the tool.\n\t * \n\t * @return String\n\t */\n\tpublic String getErrorParserIds();\n\n\t/**\n\t * Returns the ordered list of unique IDs of the error parsers associated with the \n\t * tool.\n\t * \n\t * @return String[]\n\t */\n\tpublic String[] getErrorParserList();\n\n\t/**\n\t * Sets the semicolon separated list of error parser ids\n\t * \n\t * @param ids\n\t */\n\tpublic void setErrorParserIds(String ids);\n\t\n\t/**\n\t * Returns the list of valid source extensions this tool knows how to build.\n\t * The list may be empty but will never be <code>null</code>.\n\t * \n\t * @return List\n\t * @deprecated - use getPrimaryInputExtensions or getAllInputExtensions\n\t */\n\tpublic List getInputExtensions();\n\t\n\t/**\n\t * Returns the array of valid primary source extensions this tool knows how to build.\n\t * The array may be empty but will never be <code>null</code>.\n\t * \n\t * @return String[]\n\t */\n\tpublic String[] getPrimaryInputExtensions();\n\t\n\t/**\n\t * Returns the array of all valid source extensions this tool knows how to build.\n\t * The array may be empty but will never be <code>null</code>.\n\t * \n\t * @return String[]\n\t */\n\tpublic String[] getAllInputExtensions();\n\t\n\t/**\n\t * Returns the default input extension for the primary input of the tool\n\t * \n\t * @return String\n\t */\n\tpublic String getDefaultInputExtension();\n\t\n\t/**\n\t * Returns the array of all valid dependency extensions for this tool's inputs.\n\t * The array may be empty but will never be <code>null</code>.\n\t * \n\t * @return String[]\n\t */\n\tpublic String[] getAllDependencyExtensions();\n\t\n\t/**\n\t * Returns the list of valid header extensions for this tool.\n\t * Returns the value of the headerExtensions attribute\n\t * The list may be empty but will never be <code>null</code>.\n\t * \n\t * @return List\n\t * @deprecated - use getDependency* methods\n\t */\n\tpublic List getInterfaceExtensions();\n\n\t/**\n\t * Answers a constant corresponding to the project nature the tool should be used \n\t * for. Possible answers are:\n\t * \n\t * <dl>\n\t * <dt>ITool.FILTER_C\n\t * <dd>The tool should only be displayed for C projects. <i>Notes:</i> even \n\t * though a C++ project has a C nature, this flag will mask the tool for C++ \n\t * projects. \n\t * <dt>ITool.FILTER_CC\n\t * <dd>The tool should only be displayed for C++ projects.\n\t * <dt>ITool.FILTER_BOTH\n\t * <dd>The tool should be displayed for projects with both natures.\n\t * </dl>\n\t * \n\t * @return int\n\t */\n\tpublic int getNatureFilter();\n\t\n\t/**\n\t * Returns the array of all valid output extensions this tool can create.\n\t * The array may be empty but will never be <code>null</code>.\n\t * \n\t * @return String[]\n\t */\n\tpublic String[] getAllOutputExtensions();\n\t\n\t/**\n\t * Answers all of the output extensions that the receiver can build.\n\t * This routine returns the value if the outputs attribute.\n\t * \n\t * @return <code>String[]</code> of extensions\n\t * @deprecated - use getAllOutputExtensions\n\t */\n\tpublic String[] getOutputExtensions();\n\t\n\t/**\n\t * Answers all of the output extensions that the receiver can build,\n\t * from the value of the outputs attribute\n\t * \n\t * @return <code>String[]</code> of extensions\n\t */\n\tpublic String[] getOutputsAttribute();\n\t\n\t/**\n\t * Answer the output extension the receiver will create from the input, \n\t * or <code>null</code> if the tool does not understand that extension.\n\t * \n\t * @param inputExtension The extension of the source file. \n\t * @return String\n\t */\n\tpublic String getOutputExtension(String inputExtension);\n\t\n\t/**\n\t * Sets all of the output extensions that the receiver can build,\n\t * into the outputs attribute. Note that the outputs attribute is\n\t * ignored when one or more outputTypes are specified. \n\t * \n\t * @param String\n\t */\n\tpublic void setOutputsAttribute(String extensions);\n\t\n\t/**\n\t * Answers the argument that must be passed to a specific tool in order to \n\t * control the name of the output artifact. For example, the GCC compile and \n\t * linker use '-o', while the archiver does not. \n\t * \n\t * @return String\n\t */\n\tpublic String getOutputFlag();\n\t\n\t/**\n\t * Sets the argument that must be passed to a specific tool in order to \n\t * control the name of the output artifact. For example, the GCC compile and \n\t * linker use '-o', while the archiver does not. \n\t * \n\t * @param String\n\t */\n\tpublic void setOutputFlag(String flag);\n\n\t/**\n\t * Answers the prefix that the tool should prepend to the name of the build artifact.\n\t * For example, a librarian usually prepends 'lib' to the target.a\n\t * @return String\n\t */\n\tpublic String getOutputPrefix();\n\n\t/**\n\t * Sets the prefix that the tool should prepend to the name of the build artifact.\n\t * For example, a librarian usually prepends 'lib' to the target.a\n\t * @param String\n\t * @see {@link #setOutputPrefixForPrimaryOutput(String)} \n\t */\n\tpublic void setOutputPrefix(String prefix);\n\t\n\tpublic void setOutputPrefixForPrimaryOutput(String prefix);\n\t\n\t/**\n\t * Returns <code>true</code> if the Tool wants the MBS to display the Advanced \n\t * Input category that allows the user to specify additional input resources and\n\t * dependencies, else <code>false</code>.\n\t * \n\t * @return boolean \n\t */\n\tpublic boolean getAdvancedInputCategory();\n\t\n\t/**\n\t * Sets whether the Tool wants the MBS to display the Advanced \n\t * Input category that allows the user to specify additional input resources and\n\t * dependencies. \n\t * \n\t * @param display \n\t */\n\tpublic void setAdvancedInputCategory(boolean display);\n\t\n\t/**\n\t * Returns <code>true</code> if the Tool represents a user-define custom build\n\t * step, else <code>false</code>.\n\t * \n\t * @return boolean \n\t */\n\tpublic boolean getCustomBuildStep();\n\t\n\t/**\n\t * Sets whether the Tool represents a user-define custom build step.\n\t * \n\t * @param customBuildStep\n\t */\n\tpublic void setCustomBuildStep(boolean customBuildStep);\n\t\n\t/**\n\t * Returns the announcement string for this tool \n\t * @return String\n\t */\n\tpublic String getAnnouncement();\n\t\n\t/**\n\t * Sets the announcement string for this tool \n\t * @param announcement\n\t */\n\tpublic void setAnnouncement(String announcement);\n\t\n\t/**\n\t * Answers the command-line invocation defined for the receiver.\n\t * \n\t * @return String\n\t */\n\tpublic String getToolCommand();\n\t\n\t/**\n\t * Sets the command-line invocation command defined for this tool.\n\t * \n\t * @param String\n\t * \n\t * @return boolean if <code>true</code>, then the tool command was modified \n\t */\n\tpublic boolean setToolCommand(String command);\n\t\n\t/**\n\t * Returns command line pattern for this tool \n\t * @return String\n\t */\n\tpublic String getCommandLinePattern();\n\t\n\t/**\n\t * Sets the command line pattern for this tool \n\t * @param String\n\t */\n\tpublic void setCommandLinePattern(String pattern);\n\t\n\t/**\n\t * Returns the plugin.xml element of the commandLineGenerator extension or <code>null</code> if none. \n\t * \n\t * @return IConfigurationElement\n\t * \n\t * @deprecated - use getCommandLineGenerator\n\t */\n\tpublic IConfigurationElement getCommandLineGeneratorElement();\n\t\n\t/**\n\t * Sets the CommandLineGenerator plugin.xml element\n\t * \n\t * @param element\n\t * @deprecated\n\t */\n\tpublic void setCommandLineGeneratorElement(IConfigurationElement element);\n\t\n\t/**\n\t * Returns the command line generator specified for this tool\n\t * @return IManagedCommandLineGenerator\n\t */\n\tpublic IManagedCommandLineGenerator getCommandLineGenerator();\n\t\n\t/**\n\t * Returns the plugin.xml element of the dependencyGenerator extension or <code>null</code> if none. \n\t * \n\t * @return IConfigurationElement\n\t * @deprecated - use getDependencyGeneratorForExtension or IInputType#getDependencyGenerator method\n\t */\n\tpublic IConfigurationElement getDependencyGeneratorElement();\n\t\n\t/**\n\t * Sets the DependencyGenerator plugin.xml element\n\t * \n\t * @param element\n\t * @deprecated \n\t */\n\tpublic void setDependencyGeneratorElement(IConfigurationElement element);\n\t\n\t/**\n\t * Returns a class instance that implements an interface to generate \n\t * source-level dependencies for the tool specified in the argument. \n\t * This method may return <code>null</code> in which case, the receiver \n\t * should assume that the tool does not require dependency information \n\t * when the project is built.\n\t *\n\t * @return IManagedDependencyGenerator\n\t * @deprecated - use getDependencyGeneratorForExtension or IInputType method\n\t */\n\tpublic IManagedDependencyGenerator getDependencyGenerator();\n\t\n\t/**\n\t * Returns a class instance that implements an interface to generate \n\t * source-level dependencies for the tool specified in the argument. \n\t * This method may return <code>null</code> in which case, the receiver \n\t * should assume that the tool does not require dependency information \n\t * when the project is built.\n\t *\n\t * @param sourceExt source file extension\n\t * @return IManagedDependencyGeneratorType\n\t */\n\tpublic IManagedDependencyGeneratorType getDependencyGeneratorForExtension(String sourceExt);\n\t\n\t/**\n\t * Returns an array of command line arguments that have been specified for\n\t * the tool.\n\t * The flags contain build macros resolved to the makefile format.\n\t * That is if a user has chosen to expand all macros in the buildfile,\n\t * the flags contain all macro references resolved, otherwise, if a user has \n\t * chosen to keep the environment build macros unresolved, the flags contain\n\t * the environment macro references converted to the buildfile variable format,\n\t * all other macro references are resolved \n\t * \n\t * @return String[]\n\t * @throws BuildException\n\t * \n\t * @deprecated - use getToolCommandFlags instead\n\t */\n\tpublic String[] getCommandFlags() throws BuildException;\n\t\n\t/**\n\t * Returns the command line arguments that have been specified for\n\t * the tool.\n\t * The string contains build macros resolved to the makefile format.\n\t * That is if a user has chosen to expand all macros in the buildfile,\n\t * the string contains all macro references resolved, otherwise, if a user has \n\t * chosen to keep the environment build macros unresolved, the string contains\n\t * the environment macro references converted to the buildfile variable format,\n\t * all other macro references are resolved \n\t * \n\t * @return String\n\t * \n\t * @deprecated - use getToolCommandFlagsString instead\n\t */\n\tpublic String getToolFlags() throws BuildException ;\n\t\n\t/**\n\t * Returns an array of command line arguments that have been specified for\n\t * the tool.\n\t * The flags contain build macros resolved to the makefile format.\n\t * That is if a user has chosen to expand all macros in the buildfile,\n\t * the flags contain all macro references resolved, otherwise, if a user has \n\t * chosen to keep the environment build macros unresolved, the flags contain\n\t * the environment macro references converted to the buildfile variable format,\n\t * all other macro references are resolved \n\t * \n\t * @param inputFileLocation\n\t * @param outputFileLocation\n\t * @return\n\t * @throws BuildException\n\t */\n\tpublic String[] getToolCommandFlags(IPath inputFileLocation, IPath outputFileLocation) throws BuildException;\n\t\n\t/**\n\t * Returns the command line arguments that have been specified for\n\t * the tool.\n\t * The string contains build macros resolved to the makefile format.\n\t * That is if a user has chosen to expand all macros in the buildfile,\n\t * the string contains all macro references resolved, otherwise, if a user has \n\t * chosen to keep the environment build macros unresolved, the string contains\n\t * the environment macro references converted to the buildfile variable format,\n\t * all other macro references are resolved \n\t * \n\t * @param inputFileLocation\n\t * @param outputFileLocation\n\t * @return\n\t * @throws BuildException\n\t */\n\tpublic String getToolCommandFlagsString(IPath inputFileLocation, IPath outputFileLocation) throws BuildException;\n\n\t/**\n\t * Options are organized into categories for UI purposes.\n\t * These categories are organized into a tree. This is the root\n\t * of that tree.\n\t * \n\t * @return IOptionCategory\n\t */\n\tpublic IOptionCategory getTopOptionCategory(); \n\n\t/**\n\t * Return <code>true</code> if the receiver builds files with the\n\t * specified extension, else <code>false</code>.\n\t * \n\t * @param extension file extension of the source\n\t * @return boolean\n\t */\n\tpublic boolean buildsFileType(String extension);\n\n\t/**\n\t * Return <code>true</code> if the receiver uses files with the\n\t * specified extension as input, else <code>false</code>. This\n\t * returns true for a superset of the extensions that buildFileType\n\t * returns true for - it includes secondary inputs.\n\t * \n\t * @param extension file extension of the source\n\t * @return boolean\n\t */\n\tpublic boolean isInputFileType(String extension);\n\t\n\t/**\n\t * Answers <code>true</code> if the tool considers the file extension to be \n\t * one associated with a header file.\n\t * \n\t * @param ext file extension of the source\n\t * @return boolean\n\t */\n\tpublic boolean isHeaderFile(String ext);\n\n\t/**\n\t * Answers <code>true</code> if the receiver builds a file with the extension specified\n\t * in the argument, else <code>false</code>.\n\t * \n\t * @param outputExtension extension of the file being produced by a tool\n\t * @return boolean\n\t */\n\tpublic boolean producesFileType(String outputExtension);\n\n\t/**\n\t * Returns <code>true</code> if this tool has changes that need to \n\t * be saved in the project file, else <code>false</code>.\n\t * \n\t * @return boolean \n\t */\n\tpublic boolean isDirty();\n\t\n\t/**\n\t * Sets the element's \"dirty\" (have I been modified?) flag.\n\t * \n\t * @param isDirty\n\t */\n\tpublic void setDirty(boolean isDirty);\n\t\n\t/**\n\t * Returns <code>true</code> if this tool was loaded from a manifest file,\n\t * and <code>false</code> if it was loaded from a project (.cdtbuild) file.\n\t * \n\t * @return boolean \n\t */\n\tpublic boolean isExtensionElement();\n\t\n\t/**\n\t * Returns the 'versionsSupported' of this tool\n\t * \n\t * @return String\n\t */\n\tpublic String getVersionsSupported();\n\t\n\t/**\n\t * Returns the 'convertToId' of this tool\n\t * \n\t * @return String\n\t */\n\tpublic String getConvertToId();\n\n\t/**\n\t * Sets the 'versionsSupported' attribute of the tool. \n\t * \n\t * @param versionsSupported\n\t */\t\n\tpublic void setVersionsSupported(String versionsSupported);\n\t\n\t/**\n\t * Sets the 'convertToId' attribute of the tool. \n\t * \n\t * @param convertToId\n\t */\n\tpublic void setConvertToId(String convertToId);\n\t\n\t/**\n\t * Returns an array of the Environment Build Path variable descriptors\n\t * \n\t * @return IEnvVarBuildPath[]\n\t */\n\tpublic IEnvVarBuildPath[] getEnvVarBuildPaths();\n\t\n\t/**\n\t * Returns an IOptionPathConverter implementation for this tool\n\t * or null, if no conversion is required\n\t */\n\tpublic IOptionPathConverter getOptionPathConverter() ;\n\t\n\tCLanguageData getCLanguageData(IInputType type);\n\t\n\tCLanguageData[] getCLanguageDatas();\n\t\n\tIInputType getInputTypeForCLanguageData(CLanguageData data);\n\t\n\tIResourceInfo getParentResourceInfo();\n\t\n/*\tIInputType setSourceContentTypeIds(IInputType type, String[] ids);\n\n\tIInputType setHeaderContentTypeIds(IInputType type, String[] ids);\n\t\n\tIInputType setSourceExtensionsAttribute(IInputType type, String[] extensions);\n\n\tIInputType setHeaderExtensionsAttribute(IInputType type, String[] extensions);\n*/\n\tIInputType getEditableInputType(IInputType base);\n\t\n\tIOutputType getEditableOutputType(IOutputType base);\n\t\n\tboolean isEnabled();\n\t\n//\tboolean isReal();\n\t\n\tboolean supportsBuild(boolean managed);\n\t\n\tboolean matches(ITool tool);\n\t\n\tboolean isSystemObject();\n\t\n\tString getUniqueRealName();\n}", "public static LinkTool getTool()\n {\n if (singleton == null) {\n // new Throwable(\"Warning: LinkTool.getTool: class not initialized by VUE\").printStackTrace();\n new LinkTool();\n }\n return singleton;\n }", "public SelectMapTool() {\n this.setName(\"select\");\n this.setToolTip(\"Selecting features.\");\n eventListeners = new EventListenerList();\n super.setMapIcon(MapImages.get(\"Select32.png\").orElse(null));\n }", "public TouchTool(IResourceChangeEditor editor, ISelection selection) {\n\tmEditor = editor;\n\tmCamera = editor.getCamera();\n\tmWorld = editor.getWorld();\n\tmInvoker = editor.getInvoker();\n\tmSelection = selection;\n}", "public UtilityToolUsedEvent(UtilityTool toolUsed, Point locationUsed) {\n super(toolUsed);\n this.locationUsed = locationUsed;\n }", "public OldToolInfo(String key, Class clazz)\n {\n super(key, clazz);\n }", "public ToolsMenu() {\n\t\tsuper(\"Tools\");\n\t}", "public CommandLineTool getCommandLineToolInstance() {\n \treturn COMMAND_LINE_TOOL;\n }", "public ToolImpl(Color fgColor, Integer startX, Integer startY, Integer endX, Integer endY) {\n\t\tsuper();\n\t\tthis.startX = startX;\n\t\tthis.startY = startY;\n\t\tthis.endX = endX;\n\t\tthis.endY = endY;\n\t\tthis.fgColor = fgColor;\n\t}", "public ToolBar(final List<AbstractAction> theToolActions) {\n super();\n myToolActions = theToolActions;\n\n setupButtons();\n\n }", "public void setTooltypeid(String tooltypeid) {\r\n this.tooltypeid = tooltypeid;\r\n }", "public ToolPenProvider()\r\n {\r\n super(\"Pen2\", \"/icons/tools/pen.png\", \"/manual/tools/pen.html\");\r\n }", "public Customer(int id, String name, int age, String address) {\r\n super(id, name, age, address);\r\n }", "public void setToolparam(String toolparam) {\r\n this.toolparam = toolparam;\r\n }", "public MEKeyTool() {\n keystore = new PublicKeyStoreBuilderBase();\n }", "public void setAdornmentTool(Tool tool) {\n\t\tthis.renderingTool = tool;\n\t}", "public String getTooltypeid() {\r\n return tooltypeid;\r\n }", "public ToolItem (ToolBar parent, int style) {\r\n\tthis(parent, style, parent.getItemCount ());\r\n}", "public String getToolnum() {\r\n return toolnum;\r\n }", "public YelpTool() {\n initComponents();\n }", "protected Tool() {\n\n\t\t// A hacky way of automatically registering it AFTER the parent constructor, assuming all went okay\n\t\tnew Thread(() -> {\n\n\t\t\ttry {\n\t\t\t\tThread.sleep(3);\n\t\t\t} catch (final InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\tfinal Tool instance = Tool.this;\n\n\t\t\tif (!isRegistered(instance))\n\t\t\t\tregister(instance);\n\t\t}).start();\n\t}", "public void setToolheadid(String toolheadid) {\r\n this.toolheadid = toolheadid;\r\n }", "public String getTooltype() {\r\n return tooltype;\r\n }", "private JToolButton getToggleButton(Tool tool, String toolId) {\n String name = tool.getName();\n JToolButton button = new JToolButton(name, tool instanceof ToolGroup);\n\n String displayName = name;\n // wrap the title\n if (!name.startsWith(\"<html>\")) {\n displayName = \"<html><div align='center'>\" + name + \"</div></html>\";\n }\n\n if (displayHoverover) {\n String hoveroverText = generateHoverover(tool);\n button.setToolTipText(hoveroverText);\n }\n \n button.setPreferredSize(\n new Dimension(\n iconSize.width, \n iconSize.height + TEXT_SPACE_SIZE));\n \n button.setBorderPainted(true);\n button.setBorder(BorderFactory.createEmptyBorder(0 ,0, 0, 0));\n button.setContentAreaFilled(false);\n\n button.setRolloverEnabled(true);\n button.setActionCommand(toolId);\n button.setText(displayName);\n button.setFont(FontColorUtils.getSmallFont());\n button.setVerticalTextPosition(AbstractButton.BOTTOM);\n button.setHorizontalTextPosition(AbstractButton.CENTER);\n button.setVerticalAlignment(AbstractButton.TOP);\n button.setHorizontalAlignment(AbstractButton.CENTER);\n button.setMargin(ICON_MARGIN);\n button.setEnabled(areEnabled);\n\n // assign the loading image\n buttonGroup.add(button);\n \n if (toolIdToButtonMap.containsKey(toolId)) {\n JToolButton tempButton = toolIdToButtonMap.get(toolId);\n remove(tempButton);\n buttonGroup.remove(tempButton);\n }\n add(button);\n\n return button;\n }", "public void setTooltype(String tooltype) {\r\n this.tooltype = tooltype;\r\n }", "public String getToolCommand();", "public ToolBridge createDirectBridge(ITool tool){\n\t\tDirectIOHandler toolBridgeIOHandler = new DirectIOHandler();\n\t\tDirectIOHandler busIOHandler = new DirectIOHandler();\n\t\t\n\t\ttoolBridgeIOHandler.setIOHandler(busIOHandler);\n\t\tbusIOHandler.setIOHandler(toolBridgeIOHandler);\n\n\t\tToolBridge toolBridge = new ToolBridge(tool);\n\t\ttoolBridge.setIOHandler(toolBridgeIOHandler);\n\t\ttoolBridgeIOHandler.setDataHandler(toolBridge);\n\t\t\n\t\tToolInstance toolInstance = new ToolInstance(busIOHandler);\n\t\tbusIOHandler.setDataHandler(toolInstance);\n\n\t\treturn toolBridge;\n\t}", "private Terrain(int id) {\n\t\tthis.id = id;\n\t}", "public String getToolheadid() {\r\n return toolheadid;\r\n }", "protected MenuTools(final Menu parent) {\r\n\t\tsuper(parent);\r\n\r\n\t\tthis.tools = this.compile0(this.compileTools());\r\n\r\n\t\tfinal int items = this.tools.size();\r\n\t\tfinal int pages = items < 9 ? 9 * 1 : items < 9 * 2 ? 9 * 2 : items < 9 * 3 ? 9 * 3 : items < 9 * 4 ? 9 * 4 : 9 * 5;\r\n\r\n\t\tthis.setSize(pages);\r\n\t\tthis.setTitle(SimpleLocalization.Menu.TITLE_TOOLS);\r\n\t}", "public Command (int id, String name) {\n if (commands[id] != null) {\n\n } else {\n commands[id] = this;\n this.name = name;\n System.out.println(\"[Command Initialization] Command \" + name + \" successfully initialized with id \"\n + id + \" and allowable arguments:\" /*allowable args will be printed here.*/);\n }\n }", "public ToolTips (String imageName)\r\n\t{\r\n\t\tthis.imageName = imageName;\r\n\t}", "public ToolList tools() {\r\n\t\treturn new ToolList(LeapJNI.Hand_tools(this.swigCPtr, this), true);\r\n\t}", "public ServiceAction(IElementManager manager, SystemID systemID, String name) {\r\n\t\tsuper(BaseUI.getText(UI_TEXT), BaseUI.getDescriptor(BaseUI.IMAGE_SERVICE));\r\n\t\tthis.manager = manager;\r\n\t\tthis.systemID = systemID;\r\n\t\tthis.name = name;\r\n\t}", "public void addToolListener(ToolListener listener, String toolEvent) {\n\t\t//do nothing\n\t}", "public void setToolfilename(String toolfilename) {\r\n this.toolfilename = toolfilename;\r\n }", "public void setToolteamid(String toolteamid) {\r\n this.toolteamid = toolteamid;\r\n }", "public int getToolFlag() {\r\n return toolFlag;\r\n }", "public ToolImpl(Color fgColor) {\n\t\tthis(fgColor, null, null, null, null);\n\t}", "public ToolbarInfo(Map<String, TacticUIInfo> globalRegistry,\n\t\t\tMap<String, DropdownInfo> dropdownRegistry,\n\t\t\tMap<String, DynamicDropdownInfo> dynDropdownRegistry, String id) {\n\t\tsuper(id);\n\t\tthis.globalRegistry = globalRegistry;\n\t\tthis.dropdownRegistry = dropdownRegistry;\n\t\tthis.dynDropdownRegistry = dynDropdownRegistry;\n\t}", "public GPFrame(String title, PaintTool gp) {\r\n super(title); // call the constructor of the super class\r\n initGUI(width, height); // initialize the GUI\r\n gra = getGraphics(); // get the Graphics object\r\n ge = gp; // set the reference to the tool\r\n System.out.println(\"calling method init() of the tool.\");\r\n ge.init(gra); // initialize the paint tool\r\n System.out.println(\"method init() of the tool executed.\");\r\n }", "public void setTooldeptid(String tooldeptid) {\r\n this.tooldeptid = tooldeptid;\r\n }", "public static interface OnToolListener {\n\n\t\t/**\n\t\t * On tool completed.\n\t\t */\n\t\tvoid onToolCompleted();\n\t}", "public void setTool(final Tool theTool) {\n removeMouseListener(myCurrentTool);\n removeMouseMotionListener(myCurrentTool);\n myCurrentTool = theTool;\n addMouseListener(myCurrentTool);\n addMouseMotionListener(myCurrentTool);\n }", "public TeamBuildTool(Team team) {\n this.team = team;\n run();\n }", "public Paint getTool(){\n return this.tool;\n }", "public Service(int title, int id) {\n mTitle = title;\n mId = id;\n }", "@GET\r\n @Path(\"/{id}\")\r\n @Produces(MediaType.APPLICATION_JSON)\r\n public Tool getInstrument(@PathParam(\"id\") Integer id) {\r\n return dao.findById(id);\r\n }", "public Component createNewToolItem() {\r\n Button button = new Button();\r\n gwtToolbarItem.addClasses(button);\r\n button.addStyleName(\"action-bar-tool-item\");\r\n return button;\r\n }", "public PencilTool() {\n super();\n myPencil = new Path2D.Double(); \n }", "private void addToolsAndCommands() {\n this.selectTargetCadastreObjectTool\n = new CadastreChangeSelectCadastreObjectTool(this.getPojoDataAccess());\n this.selectTargetCadastreObjectTool.setTargetParcelsLayer(targetParcelsLayer);\n this.selectTargetCadastreObjectTool.setCadastreObjectType(CadastreObjectTypeBean.CODE_PARCEL);\n this.getMap().addTool(this.selectTargetCadastreObjectTool, this.getToolbar(), true);\n }", "public void setOnToolListener( final OnToolListener listener ) {\n\t\tmToolListener = listener;\n\t}", "public ToolItem (ToolBar parent, int style, int index) {\r\n\tsuper (parent, checkStyle (style));\r\n\tthis.parent = parent;\r\n\tparent.createItem (this, index);\r\n}", "public Task(String id, String nameandpoints, String desc) {\n this.id = id;\n this.assignedMembers = new ArrayList<>();\n this.requiredSkills = new ArrayList<>();\n nameandpoints.trim();\n if (nameandpoints.startsWith(\"(\")) {\n try {\n this.name = nameandpoints.substring(4);\n String temp = nameandpoints.substring(1, 2);\n this.storyPoints = Integer.parseInt(temp);\n } catch (Exception e) {\n System.out.println(e.getMessage());\n this.name = nameandpoints;\n this.storyPoints = 0;\n }\n } else {\n this.name = nameandpoints;\n }\n\n if (!desc.isEmpty()) {\n if (desc.contains(\"Required Skills\")) {\n try {\n String skills = desc.substring(desc.lastIndexOf(\":\") + 1);\n addRequiredSkill(skills);\n System.out.println(requiredSkills);\n this.description = desc.substring(0, desc.indexOf(\"Required\"));\n } catch (Exception e) {\n Log.e(\"Task Creation\", \"Not expected format for desc in Task: \" + name);\n }\n } else this.description = desc;\n }\n\n }", "@Override\n\tpublic void addToolListener(ToolListener listener) {\n\t\t//do nothing\n\t}", "@Override\n public Tool insert(String id, Tool tool) {\n Tool existingTool = selectByCode(tool.getCode());\n\n if(existingTool == null) {\n Firestore dbFirestore = FirestoreClient.getFirestore();\n ApiFuture<WriteResult> collectionApiFuture = dbFirestore.collection(collection).document(id).set(tool);\n\n try {\n collectionApiFuture.get();\n if (collectionApiFuture.isDone()) {\n return tool;\n }\n } catch (InterruptedException | ExecutionException e) {\n e.printStackTrace();\n }\n }\n\n return existingTool;\n }", "static synchronized void register(Tool tool) {\n\t\tValid.checkBoolean(!isRegistered(tool), \"Tool with itemstack \" + tool.getItem() + \" already registered\");\n\n\t\ttools.add(tool);\n\t}", "private JadTool() { }", "public Tower(String name, int cost, TowerAttack attack) {\n this.name = name;\n this.cost = cost;\n this.attack = attack;\n this.active = false;\n this.sprite = GameApp.getAssetManager().get(this.name + \".png\", Texture.class);\n }", "public static void main(String[] args) {\n Tool<Student2> tool = new Tool<Student2>();\n tool.setObject(new Student2());\n Student2 stu = tool.getObject();\n\n }", "public void toolUpdated(ToolGroupEvent evt) { \n \n Tool tool = (Tool)evt.getChild();\n String toolId = tool.getToolID();\n \n if (toolIdToToolMap.containsKey(toolId)) {\n toolIdToToolMap.put(toolId, tool);\n }\n \n // get the button to update\n JToolButton button = toolIdToButtonMap.get(toolId);\n \n // update the hover-over if necessary\n String desc = tool.getDescription();\n if (displayHoverover && desc != null && !desc.equals(\"\")) {\n \n // create the hoverover and re-assign it\n String hoveroverText = generateHoverover(tool);\n button.setToolTipText(hoveroverText);\n \n }\n\n //\n // now request the icon if necessary\n //\n Boolean hiddenTool =\n (Boolean)tool.getProperty(\n Entity.DEFAULT_ENTITY_PROPERTIES,\n ChefX3DRuleProperties.HIDE_IN_CATALOG);\n \n if (hiddenTool == null || !hiddenTool) {\n \n String iconPath = tool.getIcon();\n \n // check the cache for the resource\n if (clientCache.doesAssetExist(iconPath)) {\n \n // call the resource loaded directly\n try {\n InputStream resourceStream =\n clientCache.retrieveAsset(iconPath);\n resourceLoaded(iconPath, resourceStream);\n } catch (IOException io) {\n errorReporter.errorReport(io.getMessage(), io);\n } \n \n } else {\n \n // now try to lazy load the actual image\n resourceLoader.loadResource(iconPath, this);\n \n }\n \n }\n\n }", "public void setToolStatus(ToolStatus toolStatus) {\n this.toolStatus = toolStatus;\n }", "public Tower(String name) {\n this.name = name;\n }", "public List<Tool> getTool(Object toolData);", "public ToDoTask(String description, int id) {\n super(description, id);\n }", "public Hotel(int hotelId, String name, String address, double price, boolean pool, boolean gym, boolean bar,\n\t\t\tboolean pets, int stars, String imgPath) {\n\t\tthis.hotelId = hotelId;\n\t\tthis.name = name;\n\t\tthis.address = address;\n\t\tthis.price = price;\n\t\tthis.pool = pool;\n\t\tthis.gym = gym;\n\t\tthis.bar = bar;\n\t\tthis.pets = pets;\n\t\tthis.stars = stars;\n\t\tthis.imgPath = imgPath;\n\n\t}", "public Person(String name, String address, String aadharId) {\n this.name = name;\n this.address = address;\n this.aadharId = aadharId;\n }" ]
[ "0.7899564", "0.6819402", "0.6731928", "0.66440344", "0.64119214", "0.62937874", "0.6288956", "0.62495166", "0.61361295", "0.60307026", "0.60065913", "0.5955404", "0.5844371", "0.56750697", "0.56548357", "0.56485635", "0.56464756", "0.562923", "0.5554701", "0.5482603", "0.54717976", "0.5455368", "0.5453056", "0.54194015", "0.5406808", "0.53863096", "0.53839314", "0.5371201", "0.5362736", "0.5350116", "0.5345066", "0.530029", "0.5269631", "0.52391225", "0.5209674", "0.5197769", "0.51818997", "0.51807034", "0.5161257", "0.51224196", "0.51110697", "0.50763357", "0.5074337", "0.5071097", "0.50555325", "0.5037805", "0.50201535", "0.5016882", "0.50164235", "0.50014997", "0.4996677", "0.49958155", "0.4993706", "0.4992661", "0.49781778", "0.4952491", "0.49513045", "0.4940942", "0.49401197", "0.4896393", "0.48913956", "0.48589286", "0.4845899", "0.48437163", "0.48313597", "0.48209906", "0.48133537", "0.4811234", "0.48111448", "0.48033187", "0.47982666", "0.47943258", "0.47931272", "0.47846252", "0.47823378", "0.4779019", "0.47712624", "0.4768429", "0.47650033", "0.47583318", "0.47541115", "0.4749992", "0.47467852", "0.4739727", "0.47337428", "0.47293434", "0.4719779", "0.4718191", "0.471505", "0.4709508", "0.47061825", "0.46933416", "0.46931595", "0.4690967", "0.46888572", "0.46837893", "0.46775857", "0.46719432", "0.4670413", "0.46655092" ]
0.8725925
0