text stringlengths 14 410k | label int32 0 9 |
|---|---|
public String makePayment(double paymentAmount) throws NegativePaymentAmountException {
if (paymentAmount < 0) {
throw new NegativePaymentAmountException();
} else if (paymentAmount == 0) {
return "Payment processed";
} else if (paymentAmount > 0 && paymentMethod == null)... | 5 |
private void JBRemoverActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JBRemoverActionPerformed
this.zerarModelo();
int codigo;
try{
int index = JTListaConsultas.getSelectedRow();
if(index >= 0){
codigo = (int) JTListaConsultas.getV... | 4 |
public void setBlogContent(String blogContent) {
this.blogContent = blogContent;
} | 0 |
public UndoableImageEdit(PaintBox box, int undoable) {
this.box = box;
String temp = null;
this.undoable = undoable;
if (box instanceof FTLRoom) {
temp = ((FTLRoom) box).interiorData.interiorPath;
old = temp != null ? new String(temp) : null;
} else if (box instanceof HullBox) {
if (undoable == Undo... | 9 |
public void testPlus_int() {
Months test2 = Months.months(2);
Months result = test2.plus(3);
assertEquals(2, test2.getMonths());
assertEquals(5, result.getMonths());
assertEquals(1, Months.ONE.plus(0).getMonths());
try {
Months.MAX_VALUE.plus... | 1 |
public void loadTiles(String s) {
try {
tileset = ImageIO.read(getClass().getResourceAsStream(s));
numTilesAcross = tileset.getWidth() / tileSize;
tiles = new Tile[2][numTilesAcross];
BufferedImage subimage;
for (int col = 0; col < numTilesAcross; col++) {
subimage = tileset.getSubimage(col * t... | 2 |
public JCheckBoxMenuItem getTuringFinalCheckBox() {
return transTuringFinalCheckBox;
} | 0 |
@Override
public IEmailKontakt next(IEmailKontakt emailKontakt)
throws NoNextEmailKontaktFoundException {
EmailKontaktList emailContacts = readContacts();
if (emailContacts.getContactList().size() == 0) {
throw new NoNextEmailKontaktFoundException("Kein Kontakt gefunden!");
} else {
EmailKontakt ek = ne... | 5 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ArrayType other = (ArrayType) obj;
if (this.supportedSchemaTypes != other.supportedSchemaTypes && (this.s... | 8 |
public String getSourceText()
{
return _sourceText;
} | 0 |
void extendToWholeWords() throws Exception
{
String[] mergedCells = getMergedCells();
for ( int i=0;i<rows.size();i++ )
{
Row r = rows.get(i);
for ( int j=0;j<r.cells.size();j++ )
{
FragList fl = r.cells.get(j);
if ( !fl.mer... | 7 |
@Override
public void acceptTrade(IPresenter presenter, boolean willAccept) {
MoveResponse response = presenter.getProxy().acceptTrade(presenter.getPlayerInfo().getIndex(), willAccept, presenter.getCookie());
if(response != null && response.isSuccessful()) {
presenter.updateServerModel(response.getGameModel(... | 2 |
static List <File> directoryFiles(String path, String extension) {
List <File> allFiles = new ArrayList <File> ();
allFiles.add(new File(path));
int index = 0;
while (index != allFiles.size()) {
File currentFile = allFiles.get(index);
if (currentFile.isDirectory()) {
allFiles.remove(index);
for (F... | 4 |
public Controller(View v, Model m) {
_view = v;
_model = m;
v.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setChatButtonClick();
setReadyButtonClick();
} | 0 |
public void back() throws JSONException {
if (this.usePrevious || this.index <= 0) {
throw new JSONException("Stepping back two steps is not supported");
}
this.index -= 1;
this.character -= 1;
this.usePrevious = true;
this.eof = false;
} | 2 |
public static SelectItem[] getSelectItems(List<?> entities, boolean selectOne) {
int size = selectOne ? entities.size() + 1 : entities.size();
SelectItem[] items = new SelectItem[size];
int i = 0;
if (selectOne) {
items[0] = new SelectItem("", "---");
i++;
... | 4 |
@Override
public void windowDeiconified(WindowEvent e) {
} | 0 |
public void setPepMoaConsec(int pepMoaConsec) {
this.pepMoaConsec = pepMoaConsec;
} | 0 |
public double getTotal() {
return total;
} | 0 |
private DisplayState constructDisplayState() {
DisplayState.States s = imagePanel instanceof SingleImagePanel ?
DisplayState.States.SINGLE_IMAGE :
DisplayState.States.QUAD_IMAGE;
List<Command> filteredCommands = new ArrayList<Command>();
for(Command c : e... | 4 |
public List<Item> getItems() {
final List<Item> items = new ArrayList<Item>();
for (Element element : elements)
if (element instanceof Item)
items.add((Item) element);
return items;
} | 2 |
@SuppressWarnings("static-access")
public Dialog(boolean flag, String info) {
if (flag == true) {
this.showMessageDialog(null, "操作成功: 保存路径:" + info, "操作信息", JOptionPane.PLAIN_MESSAGE);
} else {
this.showMessageDialog(null, "操作失败:导入的表错误,请重新检查。", "操作信息", JOptionPane.ERROR_MESSAGE);
}
this.setVisible(true);... | 1 |
@Override
public BufferedImage renderFile(String fileName, InputStream input) throws IOException {
ByteCountingDataInputStream in = new ByteCountingDataInputStream(input);
PriorityQueue<Integer> chunkIndexes = new PriorityQueue<>(
new Comparator<Integer>() {
@Override
... | 9 |
public boolean isEmpty() // Check if queue is Empty.
{
if(peek() == null) //if head is null the list isEmpty
return true;
else
return false;
} | 1 |
public ArrayList<String> moviesToList(){
ArrayList<String> temp = new ArrayList<>();
for (Movie movie : movies) {
temp.add(movie.getName());
}
return temp;
} | 1 |
public boolean equal(CDCRelation c){
return (r[0][0]==c.r[0][0] && r[0][1]==c.r[0][1] && r[0][2]==c.r[0][2]
&& r[1][0]==c.r[1][0] && r[1][1]==c.r[1][1] && r[1][2]==c.r[1][2]
&& r[2][0]==c.r[2][0] && r[2][1]==c.r[2][1] && r[2][2]==c.r[2][2]);
} | 8 |
public ArrayList<Item> getItemList() {
if (scanner.findInLine(firstLine) != null) {
scanner.nextLine();
}
list = new ArrayList<Item>();
while (scanner.hasNextLine()) {
String[] line = scanner.nextLine().split("; ");
if (line.length == 6) {
String type = line[0];
String title = line[1];
... | 6 |
public void storeMessage(final RenderMessage message) {
//Render and disappear it
new Thread() {
public void run() {
MESSAGE = message;
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.print... | 2 |
public void putAll( Map<? extends Integer, ? extends Short> map ) {
Iterator<? extends Entry<? extends Integer,? extends Short>> it =
map.entrySet().iterator();
for ( int i = map.size(); i-- > 0; ) {
Entry<? extends Integer,? extends Short> e = it.next();
this.put( e.... | 8 |
private static String printClusterStats(Clusterer clusterer, String fileName)
throws Exception {
StringBuffer text = new StringBuffer();
int i = 0;
int cnum;
double loglk = 0.0;
int cc = clusterer.numberOfClusters();
double[] instanceStats = new double[cc];
int unclusteredInstances = 0;
if (fileName... | 8 |
public double getLocalSignedDistance(Vector3d position, Matrix3d rotation,
Vector3d point) {
Vector3d localPoint = getLocalPoint(position, rotation, point);
// Calling methods should catch this since it means that a potentially
// intersecting point is not intersecting after all.
if ((localPoint.x > signedD... | 6 |
public String getTimerFile() {
boolean test = false;
if (test || m_test) {
System.out.println("FileManager :: getTimerFile() BEGIN");
}
if (test || m_test) {
System.out.println("FileManager :: getTimerFile() END");
}
return TIMER_FILE;
} | 4 |
public static boolean computeCell(boolean[][] world, int col, int row) {
boolean liveCell = getCell(world, col, row);
int neighbours = countNeighbours(world, col, row);
boolean nextCell = false;
if (neighbours < 2) nextCell = false;
if (liveCell && (neighbours == 2 || neighbours == 3)) nextCell = tru... | 7 |
private void fireClientDisconnectEvent(DisconnectOnServerEvent evt) {
try {
ISocketServerConnection ssc = evt.getClientConnection();
logger.debug(getName() + " disconnect client: " + ssc.getRemoteAddress() +
" <idconnection=" + ssc.getIdConnection() +
", count=" + remoteServ... | 1 |
final Interface18_Impl3 method3861(int i, byte i_88_, int i_89_,
Class68 class68, Class304 class304) {
try {
if (i_88_ != -84)
method3842(false);
anInt9882++;
if (aBoolean9926 || (Class192.method1436(i_88_ + 15, i_89_)
&& Class192.method1436(65, i)))
return new Class14_Sub1(this, cla... | 8 |
private synchronized void removeBlockRequest(Message.PieceMessage message) {
if (this.requests == null) {
return;
}
for (Message.RequestMessage request : this.requests) {
if (request.getPiece() == message.getPiece() &&
request.getOffset() == message.getOffset()) {
this.requests.remove(request);
... | 4 |
private int getNeedCallsForNextDepth(int[][][] newBoards) {
int r = 0;
for (int[][] board : newBoards) {
if (board == null) {
continue;
}
for (int[] row : board) {
for (int val : row) {
if (val == 0) {
... | 5 |
private Transition mergeOutgoingTransitions(Transition t1, Transition t2) throws NoSuchTransitionException, Exception {
for(String c:t2.getInput()) {
addLabelToOutgoingTransition(t1, c);
}
return t1;
} | 1 |
protected PasswordDialog(Frame owner, String loginName) {
super(owner);
this.setModalityType(ModalityType.DOCUMENT_MODAL);
this.setTitle("");
GridBagLayout layout = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
this.setLayout(layout);
c.gridwidth = GridBagConstraints.REMAINDER;
... | 0 |
public String getMidTime24(){
int hourI = this.getHour24();
this.midTime24 = (new Integer(hourI)).toString();
int minI = this.getMinute();
if(minI<10){
this.midTime24 += ".0" + minI;
}
else{
this.midTime24 += "." + minI;
}
int secI ... | 2 |
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
String funcion = request.getParameter("funcion");
... | 8 |
private JButton createContinueGameButton()
{
JButton continueGameButton = new JButton(Messages.getString("Driver.loadGame")); //$NON-NLS-1$
continueGameButton.setToolTipText(Messages.getString("Driver.loadASavedGame")); //$NON-NLS-1$
try
{
continueGameButton.setIcon(GuiUtility.createImageIcon(30, 30, "/save... | 8 |
private void push(JSONObject jo) throws JSONException {
if (this.top >= maxdepth) {
throw new JSONException("Nesting too deep.");
}
this.stack[this.top] = jo;
this.mode = jo == null ? 'a' : 'k';
this.top += 1;
} | 2 |
private void getConstants()
{
HashMap<String,String> l_data = this.ctrl_configuration.getConfigurationData();
if (l_data == null)
return;
if(l_data.containsKey("filetransfertport"))
this.ctrl_fileTransfertPort = Integer.parseInt( l_data.get("filetransfertport"));
if(l_data.containsKey("netdetect... | 6 |
public static void findAndAddClassesInPackageByFile(String packageName,
String packagePath, final boolean recursive, Set<Class<?>> classes) {
// 获取此包的目录 建立一个File
File dir = new File(packagePath);
// 如果不存在或者 也不是目录就直接返回
if (!dir.exists() || !dir.isDirectory()) {
// log.warn("用户定义包名 " + packageName + " 下没有任何... | 9 |
public void clearNodeScope(Node n) {
while (sp > mk) {
popNode();
}
mk = marks.remove(marks.size()-1);
} | 1 |
@Override
public boolean createTraining(Training training) {
Connection connection = new DbConnection().getConnection();
PreparedStatement preparedStatement = null;
boolean flag = false;
try {
preparedStatement = connection.prepareStatement(INSERT_TRAINING);
preparedStatement.setString(1, training.getTr... | 4 |
public static void bottomDiamond() {
final int SIZE = 3;
int cnt = 0;
for (int j = SIZE; j > 0; j--) {
System.out.print("|");
for (int i = 0; i < cnt; i++) {
System.out.print(".");
}
for (int i = 1; i <=j; i++) {
System.out.print("\\/");
}
fo... | 7 |
public float getZAxisDeadZone() {
if (zaxis == -1) {
return 0;
}
return getDeadZone(zaxis);
} | 1 |
protected int parseToken(boolean eof_ok) throws FormatterError {
int status;
int rc;
try {
status = st.nextToken();
} catch (Exception e) {
throw new FormatterError("parseToken: st.nextToken failed");
}
s = "";
if (status == StreamTokeni... | 4 |
public synchronized void adicionar()
{
try
{
new FonteFinanciamentoView(this);
}
catch (Exception e)
{
}
} | 1 |
public double interpolate(double xIter) {
int np = this.xArray.length; // number of points double d[] = new double[np]; // Newton form coefficients
double x[] = xArray;//new double[np]; // x-coordinates of nodes
double d[] = yArray;
double y;
double t;
... | 8 |
public void close() {
buffer.disableRenderer(IRenderer.RENDERER_OPENGL);
buffer.dispose();
} | 0 |
public String getToolTipText(MouseEvent event){
//block the appearence of the ToolTip when the simulation is runing. This prevents the
//simulation from getting inconsistencies from multiple threads drawing into the same
//buffer
if(Global.isRunning){
return null;
}
Edge edgeUnderPos = null;
E... | 6 |
final void method965(int i, int i_74_, int i_75_, int i_76_, int i_77_,
int i_78_, int i_79_) {
anInt8442++;
int i_80_ = i_75_ + i;
int i_81_ = i_76_ + i_74_;
aClass258_Sub3_Sub1_8434.method1957(9728, false);
aHa_Sub2_8430.method3792(54);
aHa_Sub2_8430.method3771((byte) -88, aClass258_Sub3_Sub1_8434);
aHa_Su... | 8 |
public static List findMatchableGoals(Proposition forallprop, Keyword headortail) {
{ int index = ((headortail == Logic.KWD_HEAD) ? 1 : 0);
Proposition proposition = ((Proposition)((forallprop.arguments.theArray)[index]));
Cons variables = Stella.NIL;
List resultlist = List.newList();
{ Pat... | 9 |
@Override
public void onError(Throwable ex) {
if (WebSocket.DEBUG)
ex.printStackTrace();
} | 1 |
static void writeActuals(List<TableEntity> tables, Workbook wb) {
int sheets = wb.getNumberOfSheets();
for (int i = 0; i < sheets; i++) {
if (wb.getSheetAt(i).getSheetName().contains("check")) {
Sheet sheet = wb.getSheetAt(i);
int first = sheet.getFirstRowNum(... | 9 |
@Override
public void saveGame(int id, String name) throws IOException{
XStream xstream = new XStream();
ServerModel game = gameModelsList.get(id);
String xml = xstream.toXML(game);
File file = new File("saves/");
if (!file.exists()) {
if (file.mkdir()) {
System.out.println("Directory is created!");
... | 2 |
public void start() {
Thread t = threadVar.get();
if (t != null) {
t.start();
}
} | 1 |
public void addDocumentListener(DocumentListener l) {
documentListeners.add(l);
} | 0 |
@Override
public boolean equals(Object o) {
Transition tmpT = (Transition) o;
return tmpT.node.equals(node) && tmpT.character.equals(character) && tmpT.leftChildren.equals(leftChildren) && tmpT.rightChildren.equals(rightChildren);
} | 3 |
@Override
public void insertUpdate(DocumentEvent event) {
if(event.getDocument() == nameTb.getDocument() || event.getDocument() == messageTbLeft.getDocument()){
previewLeft.update(messageTbLeft.getText(), "%JOINEDPLAYER%", nameTb.getText());
if(nameTb.getText().equalsIgnoreCase("join-format-string"))
b... | 6 |
@Test //별로 필요없음.
public void testDomReader(){
String uri="/Users/kimgyupyo/study/project/workspace/ResourceManager/src/test/java/file.xml";
try {
File file = new File(uri);
DocumentBuilderFactory docBuildFact = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuild = docBuildFact.newDocumentBu... | 5 |
public static List<Secteur> selectAll(EntityManager em) throws PersistenceException {
List<Secteur> lesSecteurs = null;
Query query= em.createQuery("select s from Secteur s");
lesSecteurs = query.getResultList();
return lesSecteurs;
} | 0 |
private void getFileData()
{
ArrayList<String> fileList = null;
fileList = file.getLines();
Pattern basicPattern = Pattern.compile("<(\\w+)><(\\d+)>");
for (String line: fileList)
{
Matcher matcher = basicPattern.matcher(line);
if (matcher.find())
{
if (matcher.group(1).equals("sensitivity"))
... | 5 |
private int[] calculateExpectedAndStandardDev(int[] platter) {
int[] bowl;
int total_score = 0;
int max_score = -1;
int[] samples = new int[SAMPLE_NUM];
for (int i=0; i < SAMPLE_NUM; i++) {
bowl = createBowl(platter);
int bowl_score = scoreBowl(bowl);
... | 3 |
protected void ensureSpaceFor(int entries) {
if(entries < buf.length)
return;
int newCap = entries;
if(initialCapacity > (newCap/2)) {
newCap += initialCapacity;
} else {
newCap += (newCap/2);
}
_reallocate(newCap);
} | 2 |
public TreeAppearanceController(final TreeViewer treeViewer) {
this.treeViewer = treeViewer;
final AttributableDecorator branchDecorator = new AttributableDecorator();
branchDecorator.setPaintAttributeName("!color");
branchDecorator.setStrokeAttributeName("!stroke");
treeViewer.... | 7 |
public void OptionsMain() {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
@SuppressWarnings("unused")
OptionsMenu frame2 = new OptionsMenu();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
} | 1 |
private List<List<Double>> getPairedCutPoints(List<Double> otherPoints, double digestionRate) {
List<Double> thisPairedCutPoints = new ArrayList<Double>();
List<Double> otherPairedCutPoints = new ArrayList<Double>();
List<Double> thisCuts = (flipped ? cutsFlipped : cuts);
// Calculate all of the pairwise dis... | 9 |
public static void main(String[] args) {
// TODO Auto-generated method stub
TC.lectureDansFichier("doodle.txt");
TC.ecritureDansNouveauFichier("out.txt");
String s = TC.lireLigne();
r = Integer.parseInt(TC.motsDeChaine(s)[0]);
c = Integer.parseInt(TC.motsDeChaine(s)[1]);
img = new boolean[r][c];
colored... | 8 |
public JSONObject getNotificationsTag(int USER_ID)
{
ResultSet rstemp = null;
ResultSet rstemp1=null;
Statement stmt1=null;
try {
Class.forName(JDBC_DRIVER);
conn=DriverManager.getConnection(DB_URL,USER,PASS);
stmt=conn.createStatement();
stmt1=conn.createStatement();
json=new JSO... | 8 |
public void run()
{
while (reader.readPacket() == null)
;
} | 1 |
public int divide(int[] tmpArray){
int center = tmpArray[tmpArray.length-1];
int j;
int i = 0;
if(tmpArray.length <= 2){
if(tmpArray[0] < tmpArray[1]){
j = -1;
}else{
j = -2;
}
}else{
while((i < tmpArray.length-2)&&(tmpArray[i] <= center)){
i++;
}
j = i;
if(i < tmpArray.le... | 7 |
@Override
public String getLocation()
{
String ret = super.getLocation();
if( ret.indexOf( "!" ) == -1 )
{ // doesn't have a sheet ref
// NOTE: Our tests error when PtgRefs have fully qualified range syntax
if( sheetname == null )
{
sheetname = getSheetName();
}
if( sheetname != null )
{
... | 4 |
public void actionPerformed(ActionEvent ev)
{
try
{
Local objt = classeView();
if (obj == null)
{
long x = new LocalDAO().inserir(objt);
objt.setId(x);
JOptionPane.showMessageDialog(null,
"Os dados foram inseridos com sucesso", "Sucesso", JOptionPane.INFORMATION_MESSAGE);
if (tabela ... | 3 |
public NetStatPackage receiveStatusPackage() {
statusAvailable.acquireUninterruptibly();
return netStatBuffer.pop();
} | 0 |
public String getUsername() {
return this.username;
} | 0 |
public VariableStack mapStackToLocal(VariableStack stack) {
if (!stack.isEmpty())
throw new IllegalArgumentException("stack is not empty at RET");
return null;
} | 1 |
public void onHit(Physicsable source) {
if(hitBy.contains(source)) return;
hitBy.add(source);
health -= source.damage;
if(source instanceof Meteor) health -= source.damage * 3;
if(health >= 1) return;
FMath.playSound("Meteor_Destroy0");
remove();
if(size < 18) return;
ArrayList<Meteor> mete... | 8 |
private static void shortPrintStackTrace2(final Throwable throwable, final StackTraceElement[] causedTrace, final Object cause)
{
final StackTraceElement[] trace = throwable.getStackTrace();
int m = trace.length - 1, n = causedTrace.length - 1;
while (m >= 0 && n >= 0 && trace[m].equals(causedTrace[n]))
{
m... | 6 |
public void setBookings(Collection<BookingEntity> bookings) {
this.bookings = bookings;
} | 0 |
private static int writeLines(String fname, BufferedReader in) {
try {
byte[] buf = new byte[blockSize];
int i = 0;
for (;;) {
String line = in.readLine();
if (line == null || line.equals(".")) {
break;
}
... | 7 |
@Override
public void mouseMoved(MouseEvent mouse) {
Tool tool = controls.getTool();
//spravy
if (tool.compatible(ToolTarget.message)) {
if (selectedMessage != null) {
selectedMessage.selected = 0;
}
selectedMessage = graph.getMessage(mouse... | 3 |
protected void addMissing(Instances data, int level,
boolean predictorMissing, boolean classMissing) {
int classIndex = data.classIndex();
Random random = new Random(1);
for (int i = 0; i < data.numInstances(); i++) {
Instance current = data.instance(i);
for (int j = 0; j < data.numAt... | 7 |
@Override
public void onEnable() {
PluginDescriptionFile pdfFile = this.getDescription();
getConfig().options().copyDefaults(true);
saveConfig();
if (!setupPermissions()) {
this.log.warning(prefix + ChatColor.RED + "Permission Failure! - Make sure that you have... | 3 |
public int getCap()
{
return MAXSIZE;
} | 0 |
@Override
public void run() {
long lastLoopTime = System.nanoTime();
final long OPTIMAL_TIME = 1000000000 / TARGET_FPS;
long lastFpsTime = 0;
fps = 0;
counter = 0;
while (true) {
try {
//<editor-fold defaultstate="collapsed" desc="all updat... | 6 |
protected Attr[] sortAttributes(NamedNodeMap attrs) {
int len = (attrs != null) ? attrs.getLength() : 0;
Attr array[] = new Attr[len];
for ( int i = 0; i < len; i++ ) {
array[i] = (Attr)attrs.item(i);
}
for ( int i = 0; i < len - 1; i++ ) {
String name = null;
i... | 8 |
@RequestMapping(value = "/lat/index", method = RequestMethod.GET)
public String index(Model model) {
List<Lat> lats = latDao.findAll();
model.addAttribute("lats", lats);
return "lat/index";
} | 0 |
private void verticalAlignment(Digraph<BrandesKoepfNode,Boolean> graph, List<List<BrandesKoepfNode>> layers, int mode) {
for (BrandesKoepfNode v : graph.vertices()) {
v.root = v;
v.align = v;
}
switch (mode) {
case LEFTMOST_UPPER:
for (int i = 1; i < layers.size(); i++) {
verticalAlignmentLeft(grap... | 9 |
private boolean conditionC0(String value, int index) {
if (contains(value, index, 4, "CHIA")) {
return true;
} else if (index <= 1) {
return false;
} else if (isVowel(charAt(value, index - 2))) {
return false;
} else if (!contains(value, index - 1, 3, "ACH")) {
return false;
} else {
char c = c... | 6 |
private boolean isValidWallCoverage(Grid grid) {
int wallCount = 0;
for (Element e : grid.getElementsOnGrid())
if (e instanceof Wall)
wallCount++;
if (wallCount > 1 && (wallCount * 100 / grid.gridSize() <= 20))
return true;
return false;
} | 4 |
@Override
public void keyPressed(int keyCode, char keyName) {
if(keyCode == 200) {
if(!player.isMoving) {
player.isMoving = true;
player.movePlayer(Direction.UP);
}
}
if(keyCode == 203) {
if(!player.isMoving) {
player.isMoving = true;
player.movePlayer(Direction.LEFT);
}
}
if(ke... | 8 |
public String toString() {
return name;
} | 0 |
public void init(int i, int j, VilainType v) {
if(!(i>=0 && j>=0))
throw new PreConditionError("i>= && j>=0");
super.init(i, j, v);
if(!(super.getType()==v))
throw new PostConditionError("getType(init(i,j,v)) == v");
if(!(super.getX() == i))
throw new PostConditionError("getX(init(i,j,v)) == i");
if(... | 6 |
public void overrideLR(int f) {
// for keyboard input
Doodle doodle2 = (Doodle) myGuys.get(0);
doodle2.setHFacing(f);
// set image L and R
if (f == -1) {
myImages.set(0, doodleLImg);
doodle2.setX(doodle2.getX());
} else if (f == 1) {
myImages.set(0, doodleRImg);
doodle2.setX(doodle2.getX());
... | 2 |
@Override
public int hashCode() {
int hash = 7;
hash = 67 * hash + this.id;
hash = 67 * hash + (this.login != null ? this.login.hashCode() : 0);
hash = 67 * hash + (this.password != null ? this.password.hashCode() : 0);
hash = 67 * hash + (this.nome != null ? this.nome.hashCo... | 7 |
public void login() {
try {
// Process Login
loginResult = null;
ProcessLogin processLogin = new ProcessLogin() {
public void onComplete() {
if(getErrorCode() != null) {
if(processInit != null) {
processInit.setErrorCode(getErrorCode());
}
} else {
TravelSDK.INSTANCE.lo... | 6 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.