java - 通过程序 GUI 中的队列类 (listnode) 通过电子邮件搜索申请人
问题描述
我有一个家庭作业计划,我们在其中添加/编辑/删除/分配已申请 uni/college 的学生以及联系方式和 ucas 积分。他们的联系方式之一涉及他们的电子邮件。
基本上我想通过电子邮件找到我想编辑的申请人。我对列表节点知之甚少,但我认为我做对了,但它不起作用。
我已经尝试过使用 int 搜索方法,它似乎可以正常工作,但是使用字符串时并没有那么多。
这是从AppGUI
if(e.getSource() == btnFind)
{
ApplicantQueue editApplicant = new ApplicantQueue();
String findEmail = txtFind.getText();
editApplicant.search(findEmail);
taEditDelteDisplay.setText(editApplicant.display());
if(editApplicant.getFront().getAppDetails().getEmail() == findEmail)
{
JOptionPane.showMessageDialog(null, "NOTICE, \nQualifications & UCAS Points have been cleared!\n you must re-enter this information!", "INFO", JOptionPane.INFORMATION_MESSAGE);
}
if(editApplicant.getFront().getAppDetails().getEmail() == null)
{
JOptionPane.showMessageDialog(null, "NONE FOUND, \nEmail not found.", "ERROR", JOptionPane.ERROR_MESSAGE);
}
这是来自队列类(listnodes)
public DegreeApp search(String email)
{
ListNode current = front;
while(current != null && current.getAppDetails().getEmail().equals(email) != false)
{
current = current.getLink();
}
if(current != null)
return current.getAppDetails();
else
return null;// dunno about this part so put it to null
}
//original int method
/*public int search(int reqNo)
{
int pos = 1;
ListNode current = front;
while(current != null && current.getAppDetails().getPriority() != reqNo)
{
current = current.getLink();
pos++;
}
if(current != null)
return pos;
else
return -1;
}*/
当他们通过电子邮件找到合适的申请人时,我希望能够编辑给定的申请人,我已经对该部分进行了完整的编码,因为我希望首先让搜索工作,正如你所看到的,我已经为他们制作了弹出窗口'要么被发现,要么不存在。
解决方案
推荐阅读
- node.js - 从批量操作更新时不调用 Pre Update 中间件
- python - UnicodeEncodeError:“latin-1”编解码器无法对位置 0-9 中的字符进行编码:序数不在范围内(256)
- python - 欧几里得距离的python数据框
- node.js - NODEJS EXPRESS - 正文解析问题
- php - PHP - 基于填充表单字段
- botframework - Microsoft Teams 通过打开 url 操作响应消息扩展
- angular - Paystack:如何在angular4-paystack按钮中传递paystack选项
- reactjs - Ionic 4 + React + Capacitor 应用程序 API 调用适用于浏览器,但不适用于设备
- cakephp - 如何在 cakephp 3.x 中完全禁用缓存
- javascript - 如何在 Javascript 中跳转到不同的行?